From: Andrea Amorese Date: Thu, 23 Sep 2021 07:44:07 +0000 (+0200) Subject: Built motion from commit d770e63b.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22avatar.png/%22?a=commitdiff_plain;h=245230f09ad35afb5ef62905063b364d48d52205;p=motion2.git Built motion from commit d770e63b.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 5724111..ee5266b 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-22T15:58:12.577Z", + "time": "2021-09-23T07:36:51.513Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9638f54..fe8d046 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-22T15:58:12.577Z", + "time": "2021-09-23T07:36:51.513Z", "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 0d35d51..e071742 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 _0x7046=['sequelize','exports','VIRTUAL','action','STRING','contactManager','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)]','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]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]'];(function(_0x46e693,_0x44e957){var _0x50d528=function(_0x37009f){while(--_0x37009f){_0x46e693['push'](_0x46e693['shift']());}};_0x50d528(++_0x44e957);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x6704('0x0'));module[_0x6704('0x1')]={'name':{'type':Sequelize[_0x6704('0x2')],'get':function(_0x3e2b36){return this['getDataValue'](_0x6704('0x3'));}},'action':{'type':Sequelize[_0x6704('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6704('0x5'),'integration',_0x6704('0x6'),_0x6704('0x7'),_0x6704('0x8'),_0x6704('0x9'),_0x6704('0xa'),'script']],'msg':_0x6704('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6704('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[_0x6704('0x4')](0x1000),'comment':_0x6704('0xd')},'data4':{'type':Sequelize[_0x6704('0x4')](0x1000),'comments':_0x6704('0xe')},'data5':{'type':Sequelize[_0x6704('0x4')](0x1000),'comments':_0x6704('0xf')},'data6':{'type':Sequelize[_0x6704('0x4')],'comments':_0x6704('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x6704('0x11')}}; \ No newline at end of file +var _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x436757,_0xc3de7d){var _0x343ac5=function(_0x10d715){while(--_0x10d715){_0x436757['push'](_0x436757['shift']());}};_0x343ac5(++_0xc3de7d);}(_0x4317,0x7c));var _0x7431=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4317[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 061df41..4c6990f 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 _0x6a67=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','update','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6a67,0xe1));var _0x76a6=function(_0x1d6e56,_0x1959b9){_0x1d6e56=_0x1d6e56-0x0;var _0xef8e84=_0x6a67[_0x1d6e56];return _0xef8e84;};'use strict';var emlformat=require(_0x76a6('0x0'));var rimraf=require(_0x76a6('0x1'));var zipdir=require(_0x76a6('0x2'));var jsonpatch=require(_0x76a6('0x3'));var rp=require(_0x76a6('0x4'));var moment=require('moment');var BPromise=require(_0x76a6('0x5'));var Mustache=require(_0x76a6('0x6'));var util=require(_0x76a6('0x7'));var path=require(_0x76a6('0x8'));var sox=require(_0x76a6('0x9'));var csv=require(_0x76a6('0xa'));var ejs=require(_0x76a6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76a6('0xc'));var squel=require(_0x76a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x76a6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76a6('0xf'));var Papa=require(_0x76a6('0x10'));var Redis=require(_0x76a6('0x11'));var authService=require(_0x76a6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x76a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76a6('0x14'));var utils=require('../../config/utils');var config=require(_0x76a6('0x15'));var licenseUtil=require(_0x76a6('0x16'));var db=require(_0x76a6('0x17'))['db'];function respondWithStatusCode(_0x2f7204,_0x59216b){_0x59216b=_0x59216b||0xcc;return function(_0xeef77c){if(_0xeef77c){return _0x2f7204['sendStatus'](_0x59216b);}return _0x2f7204[_0x76a6('0x18')](_0x59216b)[_0x76a6('0x19')]();};}function respondWithResult(_0x557f3c,_0x5cb00d){_0x5cb00d=_0x5cb00d||0xc8;return function(_0x4ac0e9){if(_0x4ac0e9){return _0x557f3c['status'](_0x5cb00d)['json'](_0x4ac0e9);}};}function respondWithFilteredResult(_0x19ffe1,_0x3bd0c5){return function(_0x830641){if(_0x830641){var _0xaca3ba=typeof _0x3bd0c5[_0x76a6('0x1a')]===_0x76a6('0x1b')&&typeof _0x3bd0c5[_0x76a6('0x1c')]===_0x76a6('0x1b');var _0xef8340=_0x830641[_0x76a6('0x1d')];var _0x4b0234=_0xaca3ba?0x0:_0x3bd0c5[_0x76a6('0x1a')];var _0x59e0ae=_0xaca3ba?_0x830641[_0x76a6('0x1d')]:_0x3bd0c5[_0x76a6('0x1a')]+_0x3bd0c5[_0x76a6('0x1c')];var _0x5c7abf;if(_0x59e0ae>=_0xef8340){_0x59e0ae=_0xef8340;_0x5c7abf=0xc8;}else{_0x5c7abf=0xce;}_0x19ffe1[_0x76a6('0x18')](_0x5c7abf);return _0x19ffe1['set'](_0x76a6('0x1e'),_0x4b0234+'-'+_0x59e0ae+'/'+_0xef8340)[_0x76a6('0x1f')](_0x830641);}return null;};}function patchUpdates(_0x8a8129){return function(_0x337633){try{jsonpatch[_0x76a6('0x20')](_0x337633,_0x8a8129,!![]);}catch(_0x4f6a97){return BPromise[_0x76a6('0x21')](_0x4f6a97);}return _0x337633[_0x76a6('0x22')]();};}function saveUpdates(_0x4fe0e1,_0xda1b2f){return function(_0x5bb3ae){if(_0x5bb3ae){return _0x5bb3ae['update'](_0x4fe0e1)[_0x76a6('0x23')](function(_0x469fa1){return _0x469fa1;});}return null;};}function removeEntity(_0x1face9,_0x2fcbb5){return function(_0x5d36ad){if(_0x5d36ad){return _0x5d36ad[_0x76a6('0x24')]()[_0x76a6('0x23')](function(){_0x1face9[_0x76a6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57fa01,_0x23fc20){return function(_0x4b946e){if(!_0x4b946e){_0x57fa01[_0x76a6('0x25')](0x194);}return _0x4b946e;};}function handleError(_0x17a740,_0x4e7c14){_0x4e7c14=_0x4e7c14||0x1f4;return function(_0x34089e){logger[_0x76a6('0x26')](_0x34089e[_0x76a6('0x27')]);if(_0x34089e[_0x76a6('0x28')]){delete _0x34089e[_0x76a6('0x28')];}_0x17a740[_0x76a6('0x18')](_0x4e7c14)[_0x76a6('0x29')](_0x34089e);};}exports[_0x76a6('0x2a')]=function(_0xe7f1fe,_0x852151){if(_0xe7f1fe[_0x76a6('0x2b')]['id']){delete _0xe7f1fe[_0x76a6('0x2b')]['id'];}return db['Action'][_0x76a6('0x2c')]({'where':{'id':_0xe7f1fe['params']['id']}})[_0x76a6('0x23')](handleEntityNotFound(_0x852151,null))[_0x76a6('0x23')](saveUpdates(_0xe7f1fe[_0x76a6('0x2b')],null))[_0x76a6('0x23')](respondWithResult(_0x852151,null))[_0x76a6('0x2d')](handleError(_0x852151,null));};exports['destroy']=function(_0xaba9ce,_0x57958c){return db[_0x76a6('0x2e')][_0x76a6('0x2c')]({'where':{'id':_0xaba9ce[_0x76a6('0x2f')]['id']}})['then'](handleEntityNotFound(_0x57958c,null))[_0x76a6('0x23')](removeEntity(_0x57958c,null))[_0x76a6('0x2d')](handleError(_0x57958c,null));}; \ No newline at end of file +var _0xd0b7=['Action','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','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','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','body'];(function(_0x4dcef2,_0x52845d){var _0xe80f33=function(_0x510b1c){while(--_0x510b1c){_0x4dcef2['push'](_0x4dcef2['shift']());}};_0xe80f33(++_0x52845d);}(_0xd0b7,0x15a));var _0x7d0b=function(_0xd7a1b3,_0x3a715f){_0xd7a1b3=_0xd7a1b3-0x0;var _0x2beb1b=_0xd0b7[_0xd7a1b3];return _0x2beb1b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d0b('0x0'));var jsonpatch=require(_0x7d0b('0x1'));var rp=require(_0x7d0b('0x2'));var moment=require(_0x7d0b('0x3'));var BPromise=require(_0x7d0b('0x4'));var Mustache=require(_0x7d0b('0x5'));var util=require(_0x7d0b('0x6'));var path=require(_0x7d0b('0x7'));var sox=require(_0x7d0b('0x8'));var csv=require(_0x7d0b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0b('0xa'));var _=require(_0x7d0b('0xb'));var squel=require('squel');var crypto=require(_0x7d0b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d0b('0xd'));var toCsv=require(_0x7d0b('0x9'));var querystring=require(_0x7d0b('0xe'));var Papa=require(_0x7d0b('0xf'));var Redis=require('ioredis');var authService=require(_0x7d0b('0x10'));var qs=require(_0x7d0b('0x11'));var as=require(_0x7d0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d0b('0x13'))(_0x7d0b('0x14'));var utils=require(_0x7d0b('0x15'));var config=require(_0x7d0b('0x16'));var licenseUtil=require(_0x7d0b('0x17'));var db=require(_0x7d0b('0x18'))['db'];function respondWithStatusCode(_0x227dca,_0xc6fea6){_0xc6fea6=_0xc6fea6||0xcc;return function(_0x4ad7bb){if(_0x4ad7bb){return _0x227dca[_0x7d0b('0x19')](_0xc6fea6);}return _0x227dca[_0x7d0b('0x1a')](_0xc6fea6)[_0x7d0b('0x1b')]();};}function respondWithResult(_0x3e6154,_0x7ee432){_0x7ee432=_0x7ee432||0xc8;return function(_0x3fda97){if(_0x3fda97){return _0x3e6154['status'](_0x7ee432)[_0x7d0b('0x1c')](_0x3fda97);}};}function respondWithFilteredResult(_0x494d3c,_0x3a594c){return function(_0x1513db){if(_0x1513db){var _0x19ae27=typeof _0x3a594c[_0x7d0b('0x1d')]==='undefined'&&typeof _0x3a594c['limit']===_0x7d0b('0x1e');var _0x25f924=_0x1513db['count'];var _0x2a7ab4=_0x19ae27?0x0:_0x3a594c[_0x7d0b('0x1d')];var _0x360c4a=_0x19ae27?_0x1513db[_0x7d0b('0x1f')]:_0x3a594c[_0x7d0b('0x1d')]+_0x3a594c[_0x7d0b('0x20')];var _0xf605f6;if(_0x360c4a>=_0x25f924){_0x360c4a=_0x25f924;_0xf605f6=0xc8;}else{_0xf605f6=0xce;}_0x494d3c[_0x7d0b('0x1a')](_0xf605f6);return _0x494d3c[_0x7d0b('0x21')](_0x7d0b('0x22'),_0x2a7ab4+'-'+_0x360c4a+'/'+_0x25f924)[_0x7d0b('0x1c')](_0x1513db);}return null;};}function patchUpdates(_0x29f497){return function(_0x333145){try{jsonpatch[_0x7d0b('0x23')](_0x333145,_0x29f497,!![]);}catch(_0x5cc3d7){return BPromise[_0x7d0b('0x24')](_0x5cc3d7);}return _0x333145[_0x7d0b('0x25')]();};}function saveUpdates(_0x2dab90,_0x3c227d){return function(_0x3e8ee1){if(_0x3e8ee1){return _0x3e8ee1[_0x7d0b('0x26')](_0x2dab90)['then'](function(_0x11ba9b){return _0x11ba9b;});}return null;};}function removeEntity(_0x1ed98d,_0x21fc99){return function(_0x4ab8ab){if(_0x4ab8ab){return _0x4ab8ab[_0x7d0b('0x27')]()[_0x7d0b('0x28')](function(){_0x1ed98d[_0x7d0b('0x1a')](0xcc)[_0x7d0b('0x1b')]();});}};}function handleEntityNotFound(_0x1cee6b,_0x5b6180){return function(_0x6ab149){if(!_0x6ab149){_0x1cee6b[_0x7d0b('0x19')](0x194);}return _0x6ab149;};}function handleError(_0x3c66c9,_0x3b6607){_0x3b6607=_0x3b6607||0x1f4;return function(_0x31e5ce){logger[_0x7d0b('0x29')](_0x31e5ce[_0x7d0b('0x2a')]);if(_0x31e5ce['name']){delete _0x31e5ce[_0x7d0b('0x2b')];}_0x3c66c9[_0x7d0b('0x1a')](_0x3b6607)[_0x7d0b('0x2c')](_0x31e5ce);};}exports[_0x7d0b('0x26')]=function(_0x3bd6d3,_0x30e694){if(_0x3bd6d3[_0x7d0b('0x2d')]['id']){delete _0x3bd6d3[_0x7d0b('0x2d')]['id'];}return db[_0x7d0b('0x2e')][_0x7d0b('0x2f')]({'where':{'id':_0x3bd6d3['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x30e694,null))[_0x7d0b('0x28')](saveUpdates(_0x3bd6d3[_0x7d0b('0x2d')],null))[_0x7d0b('0x28')](respondWithResult(_0x30e694,null))[_0x7d0b('0x30')](handleError(_0x30e694,null));};exports[_0x7d0b('0x27')]=function(_0x27afe6,_0x533336){return db[_0x7d0b('0x2e')]['find']({'where':{'id':_0x27afe6['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x533336,null))[_0x7d0b('0x28')](removeEntity(_0x533336,null))[_0x7d0b('0x30')](handleError(_0x533336,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9b3409b..5a48b59 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 _0x065d=['../../config/environment','./action.attributes','define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x065d,0x1e5));var _0xd065=function(_0x11bffe,_0x3f704b){_0x11bffe=_0x11bffe-0x0;var _0x476ba6=_0x065d[_0x11bffe];return _0x476ba6;};'use strict';var _=require('lodash');var util=require(_0xd065('0x0'));var logger=require(_0xd065('0x1'))('api');var moment=require(_0xd065('0x2'));var BPromise=require(_0xd065('0x3'));var rp=require(_0xd065('0x4'));var fs=require('fs');var path=require(_0xd065('0x5'));var rimraf=require(_0xd065('0x6'));var config=require(_0xd065('0x7'));var attributes=require(_0xd065('0x8'));module['exports']=function(_0x3faa73,_0x18d5fb){return _0x3faa73[_0xd065('0x9')](_0xd065('0xa'),attributes,{'tableName':_0xd065('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5e7=['exports','define','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x536bb0,_0x32489e){var _0x152386=function(_0x23fbc3){while(--_0x23fbc3){_0x536bb0['push'](_0x536bb0['shift']());}};_0x152386(++_0x32489e);}(_0xb5e7,0x9f));var _0x7b5e=function(_0x214ab7,_0x5131ef){_0x214ab7=_0x214ab7-0x0;var _0xb29292=_0xb5e7[_0x214ab7];return _0xb29292;};'use strict';var _=require(_0x7b5e('0x0'));var util=require(_0x7b5e('0x1'));var logger=require(_0x7b5e('0x2'))(_0x7b5e('0x3'));var moment=require(_0x7b5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b5e('0x5'));var fs=require('fs');var path=require(_0x7b5e('0x6'));var rimraf=require(_0x7b5e('0x7'));var config=require(_0x7b5e('0x8'));var attributes=require(_0x7b5e('0x9'));module[_0x7b5e('0xa')]=function(_0x49be6e,_0x17df59){return _0x49be6e[_0x7b5e('0xb')]('Action',attributes,{'tableName':_0x7b5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 68da481..c82e711 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf494,0x1c6));var _0x4f49=function(_0x1ae33d,_0x16cd80){_0x1ae33d=_0x1ae33d-0x0;var _0xc51c8c=_0xf494[_0x1ae33d];return _0xc51c8c;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1ffb6c,_0x5bbe7c){var _0x1e4fdd=function(_0x39af89){while(--_0x39af89){_0x1ffb6c['push'](_0x1ffb6c['shift']());}};_0x1e4fdd(++_0x5bbe7c);}(_0xabce,0x103));var _0xeabc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xabce[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f915683..0936d28 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 _0x3e06=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x3e06,0x149));var _0x63e0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3e06[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x63e0('0x0'));var path=require(_0x63e0('0x1'));var timeout=require(_0x63e0('0x2'));var express=require(_0x63e0('0x3'));var router=express[_0x63e0('0x4')]();var fs_extra=require(_0x63e0('0x5'));var auth=require(_0x63e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x63e0('0x7'));var controller=require('./action.controller');router[_0x63e0('0x8')](_0x63e0('0x9'),auth[_0x63e0('0xa')](),controller[_0x63e0('0xb')]);router[_0x63e0('0xc')](_0x63e0('0x9'),auth['isAuthenticated'](),controller[_0x63e0('0xd')]);module[_0x63e0('0xe')]=router; \ No newline at end of file +var _0x522d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x57a272,_0x2482d1){var _0x436b2d=function(_0x136cc5){while(--_0x136cc5){_0x57a272['push'](_0x57a272['shift']());}};_0x436b2d(++_0x2482d1);}(_0x522d,0x122));var _0xd522=function(_0x52cf5b,_0x394ded){_0x52cf5b=_0x52cf5b-0x0;var _0x42f1f7=_0x522d[_0x52cf5b];return _0x42f1f7;};'use strict';var multer=require(_0xd522('0x0'));var util=require(_0xd522('0x1'));var path=require(_0xd522('0x2'));var timeout=require(_0xd522('0x3'));var express=require(_0xd522('0x4'));var router=express[_0xd522('0x5')]();var fs_extra=require(_0xd522('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd522('0x7'));var config=require(_0xd522('0x8'));var controller=require(_0xd522('0x9'));router[_0xd522('0xa')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xd')]);router[_0xd522('0xe')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xf')]);module[_0xd522('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index afa6f19..701ba54 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x4a610f,_0x530785){var _0x3e4f77=function(_0x5f1812){while(--_0x5f1812){_0x4a610f['push'](_0x4a610f['shift']());}};_0x3e4f77(++_0x530785);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdbf5=['exports','STRING','TEXT'];(function(_0x6eb2b6,_0x53ac72){var _0xc0cd55=function(_0x166c3f){while(--_0x166c3f){_0x6eb2b6['push'](_0x6eb2b6['shift']());}};_0xc0cd55(++_0x53ac72);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2828ad,_0x95a0){_0x2828ad=_0x2828ad-0x0;var _0x42c43f=_0xdbf5[_0x2828ad];return _0x42c43f;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 513bb64..2df4c75 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 _0x7039=['DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','QueryTypes','COUNT(%s)','AVG(%s)','IS\x20NULL','from','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','options','keyBy','Limited\x20Query:','SELECT','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','dbH','sendStatus','status','json','offset','undefined','limit','set','apply','update','destroy','then','get','CustomReports','UserProfileResource','end','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','merge','type','VIRTUAL','where','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)'];(function(_0x41d9f9,_0x469db5){var _0x5bcb1e=function(_0x4180cf){while(--_0x4180cf){_0x41d9f9['push'](_0x41d9f9['shift']());}};_0x5bcb1e(++_0x469db5);}(_0x7039,0xe5));var _0x9703=function(_0x583b22,_0x589614){_0x583b22=_0x583b22-0x0;var _0x1252a6=_0x7039[_0x583b22];return _0x1252a6;};'use strict';var emlformat=require(_0x9703('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9703('0x1'));var moment=require(_0x9703('0x2'));var BPromise=require(_0x9703('0x3'));var Mustache=require(_0x9703('0x4'));var util=require(_0x9703('0x5'));var path=require(_0x9703('0x6'));var sox=require(_0x9703('0x7'));var csv=require(_0x9703('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9703('0x9'));var _=require(_0x9703('0xa'));var squel=require('squel');var crypto=require(_0x9703('0xb'));var jsforce=require(_0x9703('0xc'));var deskjs=require(_0x9703('0xd'));var toCsv=require(_0x9703('0x8'));var querystring=require('querystring');var Papa=require(_0x9703('0xe'));var Redis=require(_0x9703('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9703('0x10'));var as=require(_0x9703('0x11'));var hardwareService=require(_0x9703('0x12'));var logger=require(_0x9703('0x13'))(_0x9703('0x14'));var utils=require(_0x9703('0x15'));var config=require(_0x9703('0x16'));var licenseUtil=require(_0x9703('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9703('0x18'))[_0x9703('0x19')];function respondWithStatusCode(_0x52eae5,_0x28f037){_0x28f037=_0x28f037||0xcc;return function(_0x757d6f){if(_0x757d6f){return _0x52eae5[_0x9703('0x1a')](_0x28f037);}return _0x52eae5[_0x9703('0x1b')](_0x28f037)['end']();};}function respondWithResult(_0x1a0564,_0x550b0d){_0x550b0d=_0x550b0d||0xc8;return function(_0x4e2be0){if(_0x4e2be0){return _0x1a0564[_0x9703('0x1b')](_0x550b0d)[_0x9703('0x1c')](_0x4e2be0);}};}function respondWithFilteredResult(_0x293a74,_0x1b447d){return function(_0x73452a){if(_0x73452a){var _0x5629ab=typeof _0x1b447d[_0x9703('0x1d')]===_0x9703('0x1e')&&typeof _0x1b447d[_0x9703('0x1f')]===_0x9703('0x1e');var _0x283759=_0x73452a['count'];var _0xc051f0=_0x5629ab?0x0:_0x1b447d[_0x9703('0x1d')];var _0x2a855f=_0x5629ab?_0x73452a['count']:_0x1b447d['offset']+_0x1b447d[_0x9703('0x1f')];var _0x59a5d7;if(_0x2a855f>=_0x283759){_0x2a855f=_0x283759;_0x59a5d7=0xc8;}else{_0x59a5d7=0xce;}_0x293a74['status'](_0x59a5d7);return _0x293a74[_0x9703('0x20')]('Content-Range',_0xc051f0+'-'+_0x2a855f+'/'+_0x283759)[_0x9703('0x1c')](_0x73452a);}return null;};}function patchUpdates(_0x5c9dea){return function(_0x53eb3f){try{jsonpatch[_0x9703('0x21')](_0x53eb3f,_0x5c9dea,!![]);}catch(_0x4facae){return BPromise['reject'](_0x4facae);}return _0x53eb3f['save']();};}function saveUpdates(_0x178306,_0x15d3f8){return function(_0x786ae6){if(_0x786ae6){return _0x786ae6[_0x9703('0x22')](_0x178306)['then'](function(_0x3fe7ed){return _0x3fe7ed;});}return null;};}function removeEntity(_0x361934,_0x5d0cb3){return function(_0x4c0b27){if(_0x4c0b27){return _0x4c0b27[_0x9703('0x23')]()[_0x9703('0x24')](function(){var _0x4695b1=_0x4c0b27[_0x9703('0x25')]({'plain':!![]});var _0x5c1cc7=_0x9703('0x26');return db[_0x9703('0x27')]['destroy']({'where':{'type':_0x5c1cc7,'resourceId':_0x4695b1['id']}})['then'](function(){return _0x4c0b27;});})[_0x9703('0x24')](function(){_0x361934['status'](0xcc)[_0x9703('0x28')]();});}};}function handleEntityNotFound(_0x459ac0,_0x2a06f5){return function(_0x231782){if(!_0x231782){_0x459ac0[_0x9703('0x1a')](0x194);}return _0x231782;};}function handleError(_0x32887b,_0x45328c){_0x45328c=_0x45328c||0x1f4;return function(_0x4aab3c){logger[_0x9703('0x29')](_0x4aab3c['stack']);if(_0x4aab3c[_0x9703('0x2a')]){delete _0x4aab3c[_0x9703('0x2a')];}_0x32887b[_0x9703('0x1b')](_0x45328c)['send'](_0x4aab3c);};}exports['index']=function(_0x1503b0,_0x25d4f6){var _0x4ef584={},_0xeee02={},_0x9ba289={'count':0x0,'rows':[]};var _0x5411ac=_[_0x9703('0x2b')](db[_0x9703('0x2c')][_0x9703('0x2d')],function(_0x3285c4){return{'name':_0x3285c4[_0x9703('0x2e')],'type':_0x3285c4['type'][_0x9703('0x2f')]};});_0xeee02[_0x9703('0x30')]=_['map'](_0x5411ac,_0x9703('0x2a'));_0xeee02[_0x9703('0x31')]=_[_0x9703('0x32')](_0x1503b0[_0x9703('0x31')]);_0xeee02[_0x9703('0x33')]=_[_0x9703('0x34')](_0xeee02['model'],_0xeee02[_0x9703('0x31')]);_0x4ef584['attributes']=_['intersection'](_0xeee02['model'],qs[_0x9703('0x35')](_0x1503b0['query'][_0x9703('0x35')]));_0x4ef584['attributes']=_0x4ef584[_0x9703('0x36')]['length']?_0x4ef584[_0x9703('0x36')]:_0xeee02['model'];if(!_0x1503b0[_0x9703('0x31')]['hasOwnProperty']('nolimit')){_0x4ef584[_0x9703('0x1f')]=qs[_0x9703('0x1f')](_0x1503b0[_0x9703('0x31')][_0x9703('0x1f')]);_0x4ef584[_0x9703('0x1d')]=qs[_0x9703('0x1d')](_0x1503b0[_0x9703('0x31')]['offset']);}_0x4ef584[_0x9703('0x37')]=qs[_0x9703('0x38')](_0x1503b0[_0x9703('0x31')][_0x9703('0x38')]);_0x4ef584['where']=qs[_0x9703('0x33')](_[_0x9703('0x39')](_0x1503b0['query'],_0xeee02[_0x9703('0x33')]),_0x5411ac);if(_0x1503b0[_0x9703('0x31')][_0x9703('0x3a')]){_0x4ef584['where']=_[_0x9703('0x3b')](_0x4ef584['where'],{'$or':_[_0x9703('0x2b')](_0x5411ac,function(_0x347ecf){if(_0x347ecf[_0x9703('0x3c')]!==_0x9703('0x3d')){var _0x44d112={};_0x44d112[_0x347ecf[_0x9703('0x2a')]]={'$like':'%'+_0x1503b0[_0x9703('0x31')]['filter']+'%'};return _0x44d112;}})});}_0x4ef584=_[_0x9703('0x3b')]({},_0x4ef584,_0x1503b0['options']);var _0x34b251={'where':_0x4ef584[_0x9703('0x3e')]};return db['AnalyticCustomReport'][_0x9703('0x3f')](_0x34b251)['then'](function(_0x2ae367){_0x9ba289[_0x9703('0x3f')]=_0x2ae367;if(_0x1503b0[_0x9703('0x31')][_0x9703('0x40')]){_0x4ef584[_0x9703('0x41')]=[{'all':!![]}];}return db[_0x9703('0x2c')][_0x9703('0x42')](_0x4ef584);})[_0x9703('0x24')](function(_0x5b2158){_0x9ba289[_0x9703('0x43')]=_0x5b2158;return _0x9ba289;})['then'](respondWithFilteredResult(_0x25d4f6,_0x4ef584))[_0x9703('0x44')](handleError(_0x25d4f6,null));};exports[_0x9703('0x45')]=function(_0x30391f,_0xf61678){var _0x50ec30={'raw':![],'where':{'id':_0x30391f[_0x9703('0x46')]['id']}},_0xdb3929={};_0xdb3929[_0x9703('0x30')]=_[_0x9703('0x32')](db['AnalyticCustomReport'][_0x9703('0x2d')]);_0xdb3929['query']=_[_0x9703('0x32')](_0x30391f['query']);_0xdb3929[_0x9703('0x33')]=_['intersection'](_0xdb3929['model'],_0xdb3929['query']);_0x50ec30[_0x9703('0x36')]=_[_0x9703('0x34')](_0xdb3929[_0x9703('0x30')],qs['fields'](_0x30391f[_0x9703('0x31')]['fields']));_0x50ec30[_0x9703('0x36')]=_0x50ec30[_0x9703('0x36')][_0x9703('0x47')]?_0x50ec30[_0x9703('0x36')]:_0xdb3929[_0x9703('0x30')];if(_0x30391f[_0x9703('0x31')][_0x9703('0x40')]){_0x50ec30['include']=[{'all':!![]}];}_0x50ec30=_[_0x9703('0x3b')]({},_0x50ec30,_0x30391f['options']);return db['AnalyticCustomReport'][_0x9703('0x48')](_0x50ec30)[_0x9703('0x24')](handleEntityNotFound(_0xf61678,null))['then'](respondWithResult(_0xf61678,null))[_0x9703('0x44')](handleError(_0xf61678,null));};exports[_0x9703('0x49')]=function(_0x5df665,_0x43bdd1){return db[_0x9703('0x2c')][_0x9703('0x49')](_0x5df665[_0x9703('0x4a')],{})[_0x9703('0x24')](function(_0x69ee2c){var _0x52a1ae=_0x5df665['user'][_0x9703('0x25')]({'plain':!![]});if(!_0x52a1ae)throw new Error(_0x9703('0x4b'));if(_0x52a1ae['role']==='user'){var _0x429d4b=_0x69ee2c[_0x9703('0x25')]({'plain':!![]});var _0x51be49=_0x9703('0x4c');return db['UserProfileSection'][_0x9703('0x48')]({'where':{'name':_0x51be49,'userProfileId':_0x52a1ae[_0x9703('0x4d')]},'raw':!![]})[_0x9703('0x24')](function(_0x363290){if(_0x363290&&_0x363290[_0x9703('0x4e')]===0x0){return db[_0x9703('0x27')][_0x9703('0x49')]({'name':_0x429d4b[_0x9703('0x2a')],'resourceId':_0x429d4b['id'],'type':_0x9703('0x26'),'sectionId':_0x363290['id']},{})[_0x9703('0x24')](function(){return _0x69ee2c;});}else{return _0x69ee2c;}})[_0x9703('0x44')](function(_0x18b160){logger[_0x9703('0x29')](_0x9703('0x4f'),_0x18b160);throw _0x18b160;});}return _0x69ee2c;})[_0x9703('0x24')](respondWithResult(_0x43bdd1,0xc9))[_0x9703('0x44')](handleError(_0x43bdd1,null));};exports[_0x9703('0x22')]=function(_0x304608,_0x3773b2){if(_0x304608[_0x9703('0x4a')]['id']){delete _0x304608[_0x9703('0x4a')]['id'];}return db[_0x9703('0x2c')][_0x9703('0x48')]({'where':{'id':_0x304608[_0x9703('0x46')]['id']}})['then'](handleEntityNotFound(_0x3773b2,null))[_0x9703('0x24')](saveUpdates(_0x304608[_0x9703('0x4a')],null))[_0x9703('0x24')](respondWithResult(_0x3773b2,null))['catch'](handleError(_0x3773b2,null));};exports[_0x9703('0x23')]=function(_0x53fc57,_0xc3be06){return db[_0x9703('0x2c')][_0x9703('0x48')]({'where':{'id':_0x53fc57['params']['id']}})['then'](handleEntityNotFound(_0xc3be06,null))[_0x9703('0x24')](removeEntity(_0xc3be06,null))[_0x9703('0x44')](handleError(_0xc3be06,null));};exports[_0x9703('0x50')]=function(_0x427c6,_0x4ff4f9){var _0x1a6508=0xa;var _0x5c7483=[_0x9703('0x51'),_0x9703('0x52'),_0x9703('0x53'),_0x9703('0x54')];var _0x39a1ea={'SUM':_0x9703('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9703('0x56'),'MAX':_0x9703('0x57'),'MIN':_0x9703('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':_0x9703('0x5a'),'GROUP_CONCAT DESC':_0x9703('0x5b')};var _0x2ca455={'SEC_TO_TIME':_0x9703('0x5c'),'DATE':_0x9703('0x5d'),'HOUR':_0x9703('0x5e'),'ROUND':_0x9703('0x5f'),'UNIX_TIMESTAMP':_0x9703('0x60')};var _0x29ce0d=function(_0x43b2fd){return!_[_0x9703('0x61')](['IS\x20NULL',_0x9703('0x62'),_0x9703('0x63'),_0x9703('0x64')],_0x43b2fd);};var _0x562bfd=function(_0x290061){if(!_0x290061||!_0x290061[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x1e10d9='(',_0xbbb2b8=0x0;_0xbbb2b8<_0x290061['rules'][_0x9703('0x47')];_0xbbb2b8+=0x1){_0xbbb2b8>0x0&&(_0x1e10d9+='\x20'+_0x290061[_0x9703('0x66')]+'\x20');_0x1e10d9+=_0x290061['rules'][_0xbbb2b8][_0x9703('0x67')]?_0x562bfd(_0x290061['rules'][_0xbbb2b8]['group']):_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x68')]+'\x20'+_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x69')]+(_0x29ce0d(_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x69')])?'\x20'+_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x6a')]:'');}return _0x1e10d9+')';};var _0x46fe3d={'where':{'id':_0x427c6[_0x9703('0x46')]['id']}},_0x3fec3c,_0x4e8423,_0x46b3e8,_0x22ca27,_0x52af26;_0x46fe3d=_[_0x9703('0x3b')]({},_0x46fe3d,_0x427c6['options']);return db[_0x9703('0x2c')][_0x9703('0x48')](_0x46fe3d)['then'](function(_0x3dd540){if(_0x3dd540){_0x3fec3c=_0x3dd540;return _0x3dd540[_0x9703('0x6b')]();}return null;})[_0x9703('0x24')](function(_0x6ecd57){if(_0x6ecd57){if(!_0x6ecd57[_0x9703('0x47')]){throw new db[(_0x9703('0x6c'))][(_0x9703('0x6d'))](_0x9703('0x6e'),0x193);}_0x4e8423=_0x6ecd57;return db[_0x9703('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5c3401){if(_0x5c3401){_0x46b3e8=_['keyBy'](_0x5c3401,'id');var _0x26ddf6;var _0x2ce9e5=squel[_0x9703('0x70')]();_0x2ce9e5['from'](_0x3fec3c[_0x9703('0x71')]);for(var _0x3ce7b0=0x0;_0x3ce7b0<_0x4e8423[_0x9703('0x47')];_0x3ce7b0+=0x1){_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x72')]?_0x46b3e8[_0x4e8423[_0x3ce7b0][_0x9703('0x72')]][_0x9703('0x73')]:_0x4e8423[_0x3ce7b0][_0x9703('0x68')];_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x74')]?_[_0x9703('0x75')](_0x39a1ea[_0x4e8423[_0x3ce7b0][_0x9703('0x74')]],'%s',_0x26ddf6):_0x26ddf6;_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x76')]?_[_0x9703('0x75')](_0x2ca455[_0x4e8423[_0x3ce7b0]['format']],'%s',_0x26ddf6):_0x26ddf6;if(_0x4e8423[_0x3ce7b0][_0x9703('0x77')]){_0x2ce9e5['group'](_0x26ddf6);}_0x4e8423[_0x3ce7b0][_0x9703('0x78')]&&_0x2ce9e5[_0x9703('0x37')](_0x26ddf6,_0x4e8423[_0x3ce7b0][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x2ce9e5[_0x9703('0x68')](_0x26ddf6,_0x4e8423[_0x3ce7b0][_0x9703('0x7a')]||_0x26ddf6);}if(_0x3fec3c[_0x9703('0x7b')]){_0x3fec3c[_0x9703('0x7b')]=JSON['parse'](_0x3fec3c[_0x9703('0x7b')]);for(var _0x521166=0x0;_0x521166<_0x3fec3c[_0x9703('0x7b')][_0x9703('0x47')];_0x521166+=0x1){if(_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x3c')]&&_['includes'](_0x5c7483,_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x3c')])&&_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7c')]&&_0x3fec3c['joins'][_0x521166]['foreignTable']&&_0x3fec3c['joins'][_0x521166][_0x9703('0x7d')]){_0x2ce9e5[_0x3fec3c[_0x9703('0x7b')][_0x521166]['type']](_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7e')],null,util['format'](_0x9703('0x7f'),_0x3fec3c[_0x9703('0x71')],_0x3fec3c['joins'][_0x521166][_0x9703('0x7c')],_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7e')],_0x3fec3c['joins'][_0x521166][_0x9703('0x7d')]));}}}if(_0x3fec3c[_0x9703('0x80')]){_0x3fec3c[_0x9703('0x80')]=JSON[_0x9703('0x81')](_0x3fec3c['conditions']);_0x2ce9e5[_0x9703('0x3e')](_0x562bfd(_0x3fec3c[_0x9703('0x80')][_0x9703('0x67')]));}_0x52af26=_0x2ce9e5[_0x9703('0x82')]();_0x2ce9e5[_0x9703('0x1f')](_0x1a6508);_0x2ce9e5[_0x9703('0x1d')](0x0);logger[_0x9703('0x83')]('Limited\x20Query:',_0x2ce9e5[_0x9703('0x84')]());return dbH[_0x9703('0x85')][_0x9703('0x31')](_0x2ce9e5[_0x9703('0x84')](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')]['SELECT']});}})[_0x9703('0x24')](respondWithResult(_0x4ff4f9,null))['catch'](handleError(_0x4ff4f9,null));};function runReport(_0x3a9df4,_0x11bc20,_0xf04172){var _0x236044=_0x11bc20[_0x9703('0x2a')];var _0x459a44=0xa;var _0x13edb1=[_0x9703('0x51'),_0x9703('0x52'),_0x9703('0x53'),'cross_join'];var _0x11f35f={'SUM':_0x9703('0x55'),'COUNT':_0x9703('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9703('0x88'),'GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9703('0x5b')};var _0x414f19={'SEC_TO_TIME':_0x9703('0x5c'),'DATE':_0x9703('0x5d'),'HOUR':_0x9703('0x5e'),'ROUND':_0x9703('0x5f'),'UNIX_TIMESTAMP':_0x9703('0x60')};var _0x4e5050=function(_0x5af4ad){return!_[_0x9703('0x61')]([_0x9703('0x89'),_0x9703('0x62'),_0x9703('0x63'),'IS\x20NOT\x20EMPTY'],_0x5af4ad);};var _0x3fa8df=function(_0x1cba47){if(!_0x1cba47||!_0x1cba47[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x5cf963='(',_0x2ccff4=0x0;_0x2ccff4<_0x1cba47[_0x9703('0x65')][_0x9703('0x47')];_0x2ccff4+=0x1){_0x2ccff4>0x0&&(_0x5cf963+='\x20'+_0x1cba47[_0x9703('0x66')]+'\x20');_0x5cf963+=_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x67')]?_0x3fa8df(_0x1cba47['rules'][_0x2ccff4][_0x9703('0x67')]):_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x68')]+'\x20'+_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x69')]+(_0x4e5050(_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x69')])?'\x20'+_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x6a')]:'');}return _0x5cf963+')';};var _0x379caa={'where':{'id':_0x3a9df4['id']}},_0x659d66,_0x1db62b,_0x8c633b,_0x252781,_0x1eadf4;_0x379caa=_['merge']({},_0x379caa,_0xf04172);return db[_0x9703('0x2c')][_0x9703('0x48')](_0x379caa)[_0x9703('0x24')](function(_0x132638){if(_0x132638){_0x659d66=_0x132638;return _0x132638[_0x9703('0x6b')]();}return null;})['then'](function(_0x142442){if(_0x142442){if(!_0x142442[_0x9703('0x47')]){throw new db['Sequelize'][(_0x9703('0x6d'))](_0x9703('0x6e'),0x193);}_0x1db62b=_0x142442;return db[_0x9703('0x6f')][_0x9703('0x42')]({'raw':!![]});}return null;})[_0x9703('0x24')](function(_0x36f731){if(_0x36f731){_0x8c633b=_['keyBy'](_0x36f731,'id');var _0x5b148f;var _0x1ab27b=squel[_0x9703('0x70')]();_0x1ab27b[_0x9703('0x8a')](_0x659d66['table']);for(var _0xac692a=0x0;_0xac692a<_0x1db62b[_0x9703('0x47')];_0xac692a+=0x1){_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x72')]?_0x8c633b[_0x1db62b[_0xac692a][_0x9703('0x72')]][_0x9703('0x73')]:_0x1db62b[_0xac692a][_0x9703('0x68')];_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x74')]?_[_0x9703('0x75')](_0x11f35f[_0x1db62b[_0xac692a]['function']],'%s',_0x5b148f):_0x5b148f;_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x76')]?_['replace'](_0x414f19[_0x1db62b[_0xac692a][_0x9703('0x76')]],'%s',_0x5b148f):_0x5b148f;if(_0x1db62b[_0xac692a][_0x9703('0x77')]){_0x1ab27b[_0x9703('0x67')](_0x5b148f);}_0x1db62b[_0xac692a][_0x9703('0x78')]&&_0x1ab27b[_0x9703('0x37')](_0x5b148f,_0x1db62b[_0xac692a][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x1ab27b[_0x9703('0x68')](_0x5b148f,_0x1db62b[_0xac692a]['alias']||_0x5b148f);}if(_0x659d66[_0x9703('0x7b')]){_0x659d66[_0x9703('0x7b')]=JSON['parse'](_0x659d66['joins']);for(var _0x51c6ae=0x0;_0x51c6ae<_0x659d66['joins'][_0x9703('0x47')];_0x51c6ae+=0x1){if(_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')]&&_[_0x9703('0x61')](_0x13edb1,_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')])&&_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x7c')]&&_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')]&&_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x7d')]){_0x1ab27b[_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')]](_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')],null,util[_0x9703('0x76')](_0x9703('0x7f'),_0x659d66[_0x9703('0x71')],_0x659d66['joins'][_0x51c6ae]['parentKey'],_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')],_0x659d66[_0x9703('0x7b')][_0x51c6ae]['foreignKey']));}}}if(_0x659d66[_0x9703('0x80')]){_0x659d66['conditions']=JSON[_0x9703('0x81')](_0x659d66[_0x9703('0x80')]);_0x1ab27b[_0x9703('0x3e')](_0x3fa8df(_0x659d66[_0x9703('0x80')]['group']));}_0x1eadf4=_0x1ab27b[_0x9703('0x82')]();_0x1ab27b[_0x9703('0x1f')](_0x459a44);_0x1ab27b['offset'](0x0);return;}})[_0x9703('0x24')](function(){if(_0x11bc20['output']===_0x9703('0x8b')){return null;}var _0x47c5ad=_[_0x9703('0x3b')](_0x11bc20,{'name':_0x11bc20[_0x9703('0x8c')]||_0x11bc20[_0x9703('0x2a')]||_0x659d66[_0x9703('0x2a')],'basename':_0x236044,'savename':util[_0x9703('0x76')](_0x9703('0x8d'),_0x11bc20[_0x9703('0x2a')]||_0x659d66['name'],require(_0x9703('0x8e'))['generate'](0x4),_0x11bc20[_0x9703('0x8f')]||_0x9703('0x90')),'reportId':_0x659d66['id'],'reportType':_0x9703('0x91')});return db[_0x9703('0x92')][_0x9703('0x49')](_0x47c5ad,{'raw':!![]});})['then'](function(_0x25a771){if(_0x659d66[_0x9703('0x71')]===_0x9703('0x93')){_0x1eadf4[_0x9703('0x3e')](_0x659d66[_0x9703('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x11bc20['startDate'],_0x11bc20[_0x9703('0x94')]);}else{_0x1eadf4[_0x9703('0x3e')](_0x659d66['table']+_0x9703('0x95'),_0x11bc20['startDate'],_0x11bc20[_0x9703('0x94')]);}if(_0x25a771){logger[_0x9703('0x96')]('Run\x20Query:',_0x1eadf4[_0x9703('0x84')]());require(_0x9703('0x97'))[_0x9703('0x98')](path[_0x9703('0x51')](__dirname,_0x9703('0x99'),_0x25a771[_0x9703('0x8f')]),[_0x25a771['id'],_0x1eadf4['toString'](),path['join'](__dirname,_0x9703('0x9a'),_0x25a771[_0x9703('0x9b')]),_0x236044]);return _0x25a771;}else{var _0x424ca2=squel[_0x9703('0x70')]();_0x424ca2[_0x9703('0x8a')]('('+_0x1eadf4['toString']()+')',_0x9703('0x9c'));_0x424ca2[_0x9703('0x68')]('COUNT(*)',_0x9703('0x3f'));_0x1eadf4[_0x9703('0x1f')](_0x11bc20[_0x9703('0x1f')]||_0x459a44);_0x1eadf4['offset'](_0x11bc20[_0x9703('0x1d')]||0x0);return dbH['sequelize'][_0x9703('0x31')](_0x424ca2['toString'](),{'type':dbH[_0x9703('0x85')]['QueryTypes']['SELECT']})['then'](function(_0x25f770){if(!_0x25f770[_0x9703('0x47')]){_0x252781=0x0;}else{_0x252781=_0x25f770[0x0][_0x9703('0x3f')]||0x0;}return dbH[_0x9703('0x85')][_0x9703('0x31')](_0x1eadf4[_0x9703('0x84')](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')]['SELECT']});})['then'](function(_0x305d7f){return{'rows':_0x305d7f||[],'count':_0x252781};});}});}exports['run']=function(_0x521ddc,_0x48f4a8){return runReport(_0x521ddc[_0x9703('0x46')],_0x521ddc[_0x9703('0x31')],_0x521ddc[_0x9703('0x9d')])[_0x9703('0x24')](respondWithResult(_0x48f4a8,null))[_0x9703('0x44')](handleError(_0x48f4a8,null));};exports['runReport']=runReport;exports['query']=function(_0x489c46,_0x5830b1){var _0x3f1ff8=0xa;var _0xe05e7f=['join',_0x9703('0x52'),_0x9703('0x53'),_0x9703('0x54')];var _0x2a3b51={'SUM':_0x9703('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9703('0x56'),'MAX':_0x9703('0x57'),'MIN':'MIN(%s)','AVG':_0x9703('0x88'),'GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':_0x9703('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x461cca={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9703('0x60')};var _0x1e38a2=function(_0x4da17d){return!_[_0x9703('0x61')]([_0x9703('0x89'),_0x9703('0x62'),_0x9703('0x63'),_0x9703('0x64')],_0x4da17d);};var _0x53a7de=function(_0x3e4689){if(!_0x3e4689||!_0x3e4689[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x462646='(',_0xd33a56=0x0;_0xd33a56<_0x3e4689[_0x9703('0x65')]['length'];_0xd33a56+=0x1){_0xd33a56>0x0&&(_0x462646+='\x20'+_0x3e4689[_0x9703('0x66')]+'\x20');_0x462646+=_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x67')]?_0x53a7de(_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x67')]):_0x3e4689[_0x9703('0x65')][_0xd33a56]['field']+'\x20'+_0x3e4689['rules'][_0xd33a56]['condition']+(_0x1e38a2(_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x69')])?'\x20'+_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x6a')]:'');}return _0x462646+')';};var _0x20b43d={'where':{'id':_0x489c46['params']['id']}},_0xc32344,_0x479617,_0x587720,_0x50db5c,_0x2824fb;_0x20b43d=_[_0x9703('0x3b')]({},_0x20b43d,_0x489c46[_0x9703('0x9d')]);return db[_0x9703('0x2c')]['find'](_0x20b43d)['then'](function(_0xdd94c){if(_0xdd94c){_0xc32344=_0xdd94c;return _0xdd94c['getFields']();}return null;})['then'](function(_0x343cce){if(_0x343cce){if(!_0x343cce['length']){throw new db[(_0x9703('0x6c'))]['ValidationErrorItem'](_0x9703('0x6e'),0x193);}_0x479617=_0x343cce;return db[_0x9703('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x9703('0x24')](function(_0x232f63){if(_0x232f63){_0x587720=_[_0x9703('0x9e')](_0x232f63,'id');var _0x2c0e6d;var _0x5c41ee=squel['select']();_0x5c41ee[_0x9703('0x8a')](_0xc32344['table']);for(var _0x3b4be5=0x0;_0x3b4be5<_0x479617[_0x9703('0x47')];_0x3b4be5+=0x1){_0x2c0e6d=_0x479617[_0x3b4be5]['MetricId']?_0x587720[_0x479617[_0x3b4be5][_0x9703('0x72')]][_0x9703('0x73')]:_0x479617[_0x3b4be5][_0x9703('0x68')];_0x2c0e6d=_0x479617[_0x3b4be5][_0x9703('0x74')]?_[_0x9703('0x75')](_0x2a3b51[_0x479617[_0x3b4be5][_0x9703('0x74')]],'%s',_0x2c0e6d):_0x2c0e6d;_0x2c0e6d=_0x479617[_0x3b4be5][_0x9703('0x76')]?_[_0x9703('0x75')](_0x461cca[_0x479617[_0x3b4be5][_0x9703('0x76')]],'%s',_0x2c0e6d):_0x2c0e6d;if(_0x479617[_0x3b4be5][_0x9703('0x77')]){_0x5c41ee[_0x9703('0x67')](_0x2c0e6d);}_0x479617[_0x3b4be5]['orderBy']&&_0x5c41ee['order'](_0x2c0e6d,_0x479617[_0x3b4be5][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x5c41ee['field'](_0x2c0e6d,_0x479617[_0x3b4be5][_0x9703('0x7a')]||_0x2c0e6d);}if(_0xc32344[_0x9703('0x7b')]){_0xc32344[_0x9703('0x7b')]=JSON[_0x9703('0x81')](_0xc32344[_0x9703('0x7b')]);for(var _0xa2cbe2=0x0;_0xa2cbe2<_0xc32344[_0x9703('0x7b')][_0x9703('0x47')];_0xa2cbe2+=0x1){if(_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x3c')]&&_[_0x9703('0x61')](_0xe05e7f,_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['type'])&&_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['parentKey']&&_0xc32344['joins'][_0xa2cbe2]['foreignTable']&&_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7d')]){_0x5c41ee[_0xc32344['joins'][_0xa2cbe2][_0x9703('0x3c')]](_0xc32344['joins'][_0xa2cbe2][_0x9703('0x7e')],null,util[_0x9703('0x76')](_0x9703('0x7f'),_0xc32344[_0x9703('0x71')],_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['parentKey'],_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7e')],_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7d')]));}}}if(_0xc32344[_0x9703('0x80')]){_0xc32344[_0x9703('0x80')]=JSON[_0x9703('0x81')](_0xc32344[_0x9703('0x80')]);_0x5c41ee[_0x9703('0x3e')](_0x53a7de(_0xc32344[_0x9703('0x80')][_0x9703('0x67')]));}_0x2824fb=_0x5c41ee[_0x9703('0x82')]();_0x5c41ee['limit'](_0x3f1ff8);_0x5c41ee[_0x9703('0x1d')](0x0);logger[_0x9703('0x83')](_0x9703('0x9f'),_0x5c41ee[_0x9703('0x84')]());return dbH[_0x9703('0x85')]['query'](_0x5c41ee['toString'](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')][_0x9703('0xa0')]});}})[_0x9703('0x24')](function(){return{'sql':_0x2824fb['toString']()};})[_0x9703('0x24')](respondWithResult(_0x5830b1,null))[_0x9703('0x44')](handleError(_0x5830b1,null));}; \ No newline at end of file +var _0x9805=['Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','join','cross_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','AnalyticMetric','order','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','CustomReports','name','send','map','AnalyticCustomReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','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','operator','group','condition','value','getFields','Sequelize'];(function(_0x2336af,_0x53f669){var _0x84fad4=function(_0x21b892){while(--_0x21b892){_0x2336af['push'](_0x2336af['shift']());}};_0x84fad4(++_0x53f669);}(_0x9805,0x18f));var _0x5980=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x9805[_0x229a03];return _0x2d6e11;};'use strict';var emlformat=require(_0x5980('0x0'));var rimraf=require(_0x5980('0x1'));var zipdir=require(_0x5980('0x2'));var jsonpatch=require(_0x5980('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5980('0x4'));var Mustache=require(_0x5980('0x5'));var util=require(_0x5980('0x6'));var path=require(_0x5980('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5980('0x8'));var fs=require('fs');var fs_extra=require(_0x5980('0x9'));var _=require(_0x5980('0xa'));var squel=require(_0x5980('0xb'));var crypto=require(_0x5980('0xc'));var jsforce=require(_0x5980('0xd'));var deskjs=require(_0x5980('0xe'));var toCsv=require(_0x5980('0xf'));var querystring=require(_0x5980('0x10'));var Papa=require(_0x5980('0x11'));var Redis=require(_0x5980('0x12'));var authService=require(_0x5980('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5980('0x14'));var logger=require(_0x5980('0x15'))(_0x5980('0x16'));var utils=require(_0x5980('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5980('0x18'));var db=require(_0x5980('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1892d4,_0x1be1b3){_0x1be1b3=_0x1be1b3||0xcc;return function(_0x1548a1){if(_0x1548a1){return _0x1892d4[_0x5980('0x1a')](_0x1be1b3);}return _0x1892d4[_0x5980('0x1b')](_0x1be1b3)[_0x5980('0x1c')]();};}function respondWithResult(_0x15fd1a,_0x3de3a4){_0x3de3a4=_0x3de3a4||0xc8;return function(_0x489ede){if(_0x489ede){return _0x15fd1a[_0x5980('0x1b')](_0x3de3a4)['json'](_0x489ede);}};}function respondWithFilteredResult(_0x46cf94,_0x2fcdf2){return function(_0x1ce651){if(_0x1ce651){var _0x18275c=typeof _0x2fcdf2[_0x5980('0x1d')]==='undefined'&&typeof _0x2fcdf2[_0x5980('0x1e')]===_0x5980('0x1f');var _0x462408=_0x1ce651[_0x5980('0x20')];var _0x336ad3=_0x18275c?0x0:_0x2fcdf2[_0x5980('0x1d')];var _0x1753ea=_0x18275c?_0x1ce651[_0x5980('0x20')]:_0x2fcdf2[_0x5980('0x1d')]+_0x2fcdf2[_0x5980('0x1e')];var _0x2222fa;if(_0x1753ea>=_0x462408){_0x1753ea=_0x462408;_0x2222fa=0xc8;}else{_0x2222fa=0xce;}_0x46cf94['status'](_0x2222fa);return _0x46cf94['set']('Content-Range',_0x336ad3+'-'+_0x1753ea+'/'+_0x462408)[_0x5980('0x21')](_0x1ce651);}return null;};}function patchUpdates(_0x4ca6f5){return function(_0x47af1d){try{jsonpatch[_0x5980('0x22')](_0x47af1d,_0x4ca6f5,!![]);}catch(_0x2a4019){return BPromise[_0x5980('0x23')](_0x2a4019);}return _0x47af1d[_0x5980('0x24')]();};}function saveUpdates(_0x453aeb,_0x42ccc4){return function(_0x1a75c6){if(_0x1a75c6){return _0x1a75c6[_0x5980('0x25')](_0x453aeb)[_0x5980('0x26')](function(_0x509100){return _0x509100;});}return null;};}function removeEntity(_0x5826d3,_0x1f363a){return function(_0x3ce7ea){if(_0x3ce7ea){return _0x3ce7ea[_0x5980('0x27')]()[_0x5980('0x26')](function(){var _0x50c929=_0x3ce7ea['get']({'plain':!![]});var _0x5b428e=_0x5980('0x28');return db['UserProfileResource'][_0x5980('0x27')]({'where':{'type':_0x5b428e,'resourceId':_0x50c929['id']}})[_0x5980('0x26')](function(){return _0x3ce7ea;});})[_0x5980('0x26')](function(){_0x5826d3[_0x5980('0x1b')](0xcc)[_0x5980('0x1c')]();});}};}function handleEntityNotFound(_0x4ffad5,_0x9dd25a){return function(_0x252641){if(!_0x252641){_0x4ffad5[_0x5980('0x1a')](0x194);}return _0x252641;};}function handleError(_0x2b436d,_0x13a134){_0x13a134=_0x13a134||0x1f4;return function(_0x55e6f6){logger['error'](_0x55e6f6['stack']);if(_0x55e6f6[_0x5980('0x29')]){delete _0x55e6f6[_0x5980('0x29')];}_0x2b436d[_0x5980('0x1b')](_0x13a134)[_0x5980('0x2a')](_0x55e6f6);};}exports['index']=function(_0x2ca762,_0x491385){var _0x3f0fdc={},_0x5a6a7a={},_0x208575={'count':0x0,'rows':[]};var _0x4d7d81=_[_0x5980('0x2b')](db[_0x5980('0x2c')]['rawAttributes'],function(_0x4757cb){return{'name':_0x4757cb[_0x5980('0x2d')],'type':_0x4757cb[_0x5980('0x2e')][_0x5980('0x2f')]};});_0x5a6a7a['model']=_[_0x5980('0x2b')](_0x4d7d81,_0x5980('0x29'));_0x5a6a7a[_0x5980('0x30')]=_[_0x5980('0x31')](_0x2ca762[_0x5980('0x30')]);_0x5a6a7a[_0x5980('0x32')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],_0x5a6a7a[_0x5980('0x30')]);_0x3f0fdc[_0x5980('0x35')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],qs[_0x5980('0x36')](_0x2ca762[_0x5980('0x30')]['fields']));_0x3f0fdc['attributes']=_0x3f0fdc[_0x5980('0x35')]['length']?_0x3f0fdc['attributes']:_0x5a6a7a[_0x5980('0x34')];if(!_0x2ca762['query'][_0x5980('0x37')]('nolimit')){_0x3f0fdc[_0x5980('0x1e')]=qs[_0x5980('0x1e')](_0x2ca762[_0x5980('0x30')][_0x5980('0x1e')]);_0x3f0fdc[_0x5980('0x1d')]=qs['offset'](_0x2ca762[_0x5980('0x30')][_0x5980('0x1d')]);}_0x3f0fdc['order']=qs[_0x5980('0x38')](_0x2ca762[_0x5980('0x30')][_0x5980('0x38')]);_0x3f0fdc[_0x5980('0x39')]=qs[_0x5980('0x32')](_[_0x5980('0x3a')](_0x2ca762[_0x5980('0x30')],_0x5a6a7a[_0x5980('0x32')]),_0x4d7d81);if(_0x2ca762[_0x5980('0x30')]['filter']){_0x3f0fdc['where']=_['merge'](_0x3f0fdc[_0x5980('0x39')],{'$or':_['map'](_0x4d7d81,function(_0x201706){if(_0x201706['type']!==_0x5980('0x3b')){var _0x4fba61={};_0x4fba61[_0x201706[_0x5980('0x29')]]={'$like':'%'+_0x2ca762['query'][_0x5980('0x3c')]+'%'};return _0x4fba61;}})});}_0x3f0fdc=_[_0x5980('0x3d')]({},_0x3f0fdc,_0x2ca762[_0x5980('0x3e')]);var _0x37bb36={'where':_0x3f0fdc[_0x5980('0x39')]};return db[_0x5980('0x2c')][_0x5980('0x20')](_0x37bb36)['then'](function(_0x6ad54){_0x208575[_0x5980('0x20')]=_0x6ad54;if(_0x2ca762[_0x5980('0x30')][_0x5980('0x3f')]){_0x3f0fdc[_0x5980('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5980('0x41')](_0x3f0fdc);})[_0x5980('0x26')](function(_0x239798){_0x208575[_0x5980('0x42')]=_0x239798;return _0x208575;})[_0x5980('0x26')](respondWithFilteredResult(_0x491385,_0x3f0fdc))['catch'](handleError(_0x491385,null));};exports[_0x5980('0x43')]=function(_0x80f8b6,_0x9fed2a){var _0x3ee0e1={'raw':![],'where':{'id':_0x80f8b6[_0x5980('0x44')]['id']}},_0x110220={};_0x110220['model']=_[_0x5980('0x31')](db[_0x5980('0x2c')][_0x5980('0x45')]);_0x110220['query']=_[_0x5980('0x31')](_0x80f8b6[_0x5980('0x30')]);_0x110220[_0x5980('0x32')]=_[_0x5980('0x33')](_0x110220[_0x5980('0x34')],_0x110220[_0x5980('0x30')]);_0x3ee0e1[_0x5980('0x35')]=_['intersection'](_0x110220[_0x5980('0x34')],qs[_0x5980('0x36')](_0x80f8b6[_0x5980('0x30')][_0x5980('0x36')]));_0x3ee0e1[_0x5980('0x35')]=_0x3ee0e1['attributes'][_0x5980('0x46')]?_0x3ee0e1['attributes']:_0x110220[_0x5980('0x34')];if(_0x80f8b6[_0x5980('0x30')]['includeAll']){_0x3ee0e1['include']=[{'all':!![]}];}_0x3ee0e1=_[_0x5980('0x3d')]({},_0x3ee0e1,_0x80f8b6['options']);return db[_0x5980('0x2c')]['find'](_0x3ee0e1)[_0x5980('0x26')](handleEntityNotFound(_0x9fed2a,null))[_0x5980('0x26')](respondWithResult(_0x9fed2a,null))['catch'](handleError(_0x9fed2a,null));};exports['create']=function(_0x38ce3e,_0x1673b2){return db[_0x5980('0x2c')][_0x5980('0x47')](_0x38ce3e['body'],{})[_0x5980('0x26')](function(_0xa07dbb){var _0x57381e=_0x38ce3e[_0x5980('0x48')][_0x5980('0x49')]({'plain':!![]});if(!_0x57381e)throw new Error(_0x5980('0x4a'));if(_0x57381e['role']===_0x5980('0x48')){var _0x574861=_0xa07dbb['get']({'plain':!![]});var _0x4cc37f=_0x5980('0x4b');return db[_0x5980('0x4c')][_0x5980('0x4d')]({'where':{'name':_0x4cc37f,'userProfileId':_0x57381e[_0x5980('0x4e')]},'raw':!![]})[_0x5980('0x26')](function(_0x177e0c){if(_0x177e0c&&_0x177e0c[_0x5980('0x4f')]===0x0){return db[_0x5980('0x50')][_0x5980('0x47')]({'name':_0x574861[_0x5980('0x29')],'resourceId':_0x574861['id'],'type':_0x5980('0x28'),'sectionId':_0x177e0c['id']},{})[_0x5980('0x26')](function(){return _0xa07dbb;});}else{return _0xa07dbb;}})[_0x5980('0x51')](function(_0x1ee320){logger[_0x5980('0x52')](_0x5980('0x53'),_0x1ee320);throw _0x1ee320;});}return _0xa07dbb;})[_0x5980('0x26')](respondWithResult(_0x1673b2,0xc9))[_0x5980('0x51')](handleError(_0x1673b2,null));};exports[_0x5980('0x25')]=function(_0x2c83cb,_0x12c7ea){if(_0x2c83cb[_0x5980('0x54')]['id']){delete _0x2c83cb[_0x5980('0x54')]['id'];}return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x2c83cb['params']['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x12c7ea,null))[_0x5980('0x26')](saveUpdates(_0x2c83cb[_0x5980('0x54')],null))[_0x5980('0x26')](respondWithResult(_0x12c7ea,null))['catch'](handleError(_0x12c7ea,null));};exports[_0x5980('0x27')]=function(_0x483d29,_0x103177){return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x483d29[_0x5980('0x44')]['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x103177,null))[_0x5980('0x26')](removeEntity(_0x103177,null))[_0x5980('0x51')](handleError(_0x103177,null));};exports['preview']=function(_0x5379e0,_0x1861ed){var _0x23ebff=0xa;var _0x565b98=['join',_0x5980('0x55'),_0x5980('0x56'),'cross_join'];var _0x406b75={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x32d9cf={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':_0x5980('0x60'),'ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0xf60031=function(_0x43045c){return!_[_0x5980('0x63')]([_0x5980('0x64'),_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x43045c);};var _0x23c988=function(_0x3fed7f){if(!_0x3fed7f||!_0x3fed7f['rules'][_0x5980('0x46')]){return'';}for(var _0x5dac67='(',_0x2ee9bb=0x0;_0x2ee9bb<_0x3fed7f[_0x5980('0x68')][_0x5980('0x46')];_0x2ee9bb+=0x1){_0x2ee9bb>0x0&&(_0x5dac67+='\x20'+_0x3fed7f[_0x5980('0x69')]+'\x20');_0x5dac67+=_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]?_0x23c988(_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]):_0x3fed7f[_0x5980('0x68')][_0x2ee9bb]['field']+'\x20'+_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6b')]+(_0xf60031(_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6b')])?'\x20'+_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6c')]:'');}return _0x5dac67+')';};var _0x2ceed2={'where':{'id':_0x5379e0['params']['id']}},_0x108015,_0x3168c4,_0x120d4c,_0x2731ea,_0x1f63e8;_0x2ceed2=_[_0x5980('0x3d')]({},_0x2ceed2,_0x5379e0['options']);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x2ceed2)[_0x5980('0x26')](function(_0xd47a4a){if(_0xd47a4a){_0x108015=_0xd47a4a;return _0xd47a4a[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x48b7cd){if(_0x48b7cd){if(!_0x48b7cd['length']){throw new db[(_0x5980('0x6e'))]['ValidationErrorItem'](_0x5980('0x6f'),0x193);}_0x3168c4=_0x48b7cd;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x33dcfb){if(_0x33dcfb){_0x120d4c=_[_0x5980('0x70')](_0x33dcfb,'id');var _0x5d8272;var _0x416613=squel[_0x5980('0x71')]();_0x416613[_0x5980('0x72')](_0x108015[_0x5980('0x73')]);for(var _0xbd9d02=0x0;_0xbd9d02<_0x3168c4[_0x5980('0x46')];_0xbd9d02+=0x1){_0x5d8272=_0x3168c4[_0xbd9d02]['MetricId']?_0x120d4c[_0x3168c4[_0xbd9d02][_0x5980('0x74')]][_0x5980('0x75')]:_0x3168c4[_0xbd9d02]['field'];_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x76')]?_[_0x5980('0x77')](_0x406b75[_0x3168c4[_0xbd9d02][_0x5980('0x76')]],'%s',_0x5d8272):_0x5d8272;_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x78')]?_[_0x5980('0x77')](_0x32d9cf[_0x3168c4[_0xbd9d02]['format']],'%s',_0x5d8272):_0x5d8272;if(_0x3168c4[_0xbd9d02][_0x5980('0x79')]){_0x416613[_0x5980('0x6a')](_0x5d8272);}_0x3168c4[_0xbd9d02][_0x5980('0x7a')]&&_0x416613['order'](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x416613[_0x5980('0x7c')](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7d')]||_0x5d8272);}if(_0x108015[_0x5980('0x7e')]){_0x108015['joins']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x7e')]);for(var _0x1a2f60=0x0;_0x1a2f60<_0x108015[_0x5980('0x7e')]['length'];_0x1a2f60+=0x1){if(_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x565b98,_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')])&&_0x108015['joins'][_0x1a2f60][_0x5980('0x80')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x82')]){_0x416613[_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]](_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x108015[_0x5980('0x73')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x80')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],_0x108015['joins'][_0x1a2f60][_0x5980('0x82')]));}}}if(_0x108015[_0x5980('0x84')]){_0x108015['conditions']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x84')]);_0x416613['where'](_0x23c988(_0x108015[_0x5980('0x84')]['group']));}_0x1f63e8=_0x416613[_0x5980('0x85')]();_0x416613[_0x5980('0x1e')](_0x23ebff);_0x416613[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')]('Limited\x20Query:',_0x416613[_0x5980('0x87')]());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x416613['toString'](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](respondWithResult(_0x1861ed,null))[_0x5980('0x51')](handleError(_0x1861ed,null));};function runReport(_0x44b442,_0x5116d9,_0x366098){var _0x9e44b8=_0x5116d9[_0x5980('0x29')];var _0x22e52f=0xa;var _0x418f7e=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x3b587e={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x2d70eb={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x30ff9f=function(_0x161254){return!_[_0x5980('0x63')](['IS\x20NULL',_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x161254);};var _0xcb66cd=function(_0x7d4f54){if(!_0x7d4f54||!_0x7d4f54[_0x5980('0x68')][_0x5980('0x46')]){return'';}for(var _0x29f4a2='(',_0x49ae2d=0x0;_0x49ae2d<_0x7d4f54['rules'][_0x5980('0x46')];_0x49ae2d+=0x1){_0x49ae2d>0x0&&(_0x29f4a2+='\x20'+_0x7d4f54[_0x5980('0x69')]+'\x20');_0x29f4a2+=_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]?_0xcb66cd(_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]):_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['field']+'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6b')]+(_0x30ff9f(_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['condition'])?'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6c')]:'');}return _0x29f4a2+')';};var _0x1a9d01={'where':{'id':_0x44b442['id']}},_0x58694c,_0x329d9d,_0x468305,_0x3de3ac,_0x34abfd;_0x1a9d01=_[_0x5980('0x3d')]({},_0x1a9d01,_0x366098);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x1a9d01)[_0x5980('0x26')](function(_0x3401ea){if(_0x3401ea){_0x58694c=_0x3401ea;return _0x3401ea[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x2a464b){if(_0x2a464b){if(!_0x2a464b[_0x5980('0x46')]){throw new db['Sequelize'][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x329d9d=_0x2a464b;return db[_0x5980('0x90')][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x2ec02b){if(_0x2ec02b){_0x468305=_[_0x5980('0x70')](_0x2ec02b,'id');var _0x7848c1;var _0xd3b8bf=squel['select']();_0xd3b8bf[_0x5980('0x72')](_0x58694c['table']);for(var _0x5c239c=0x0;_0x5c239c<_0x329d9d['length'];_0x5c239c+=0x1){_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x74')]?_0x468305[_0x329d9d[_0x5c239c][_0x5980('0x74')]][_0x5980('0x75')]:_0x329d9d[_0x5c239c]['field'];_0x7848c1=_0x329d9d[_0x5c239c]['function']?_[_0x5980('0x77')](_0x3b587e[_0x329d9d[_0x5c239c]['function']],'%s',_0x7848c1):_0x7848c1;_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x78')]?_['replace'](_0x2d70eb[_0x329d9d[_0x5c239c][_0x5980('0x78')]],'%s',_0x7848c1):_0x7848c1;if(_0x329d9d[_0x5c239c][_0x5980('0x79')]){_0xd3b8bf[_0x5980('0x6a')](_0x7848c1);}_0x329d9d[_0x5c239c][_0x5980('0x7a')]&&_0xd3b8bf[_0x5980('0x91')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0xd3b8bf[_0x5980('0x7c')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7d')]||_0x7848c1);}if(_0x58694c[_0x5980('0x7e')]){_0x58694c[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x58694c[_0x5980('0x7e')]);for(var _0x38ad70=0x0;_0x38ad70<_0x58694c[_0x5980('0x7e')][_0x5980('0x46')];_0x38ad70+=0x1){if(_0x58694c['joins'][_0x38ad70][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x418f7e,_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')])&&_0x58694c['joins'][_0x38ad70][_0x5980('0x80')]&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignTable']&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']){_0xd3b8bf[_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')]](_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x58694c[_0x5980('0x73')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['parentKey'],_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']));}}}if(_0x58694c[_0x5980('0x84')]){_0x58694c[_0x5980('0x84')]=JSON['parse'](_0x58694c[_0x5980('0x84')]);_0xd3b8bf['where'](_0xcb66cd(_0x58694c[_0x5980('0x84')][_0x5980('0x6a')]));}_0x34abfd=_0xd3b8bf['clone']();_0xd3b8bf[_0x5980('0x1e')](_0x22e52f);_0xd3b8bf[_0x5980('0x1d')](0x0);return;}})['then'](function(){if(_0x5116d9[_0x5980('0x92')]===_0x5980('0x93')){return null;}var _0x2d13aa=_[_0x5980('0x3d')](_0x5116d9,{'name':_0x5116d9['fullPath']||_0x5116d9[_0x5980('0x29')]||_0x58694c['name'],'basename':_0x9e44b8,'savename':util[_0x5980('0x78')](_0x5980('0x94'),_0x5116d9[_0x5980('0x29')]||_0x58694c[_0x5980('0x29')],require(_0x5980('0x95'))[_0x5980('0x96')](0x4),_0x5116d9[_0x5980('0x92')]||_0x5980('0x97')),'reportId':_0x58694c['id'],'reportType':_0x5980('0x98')});return db[_0x5980('0x99')][_0x5980('0x47')](_0x2d13aa,{'raw':!![]});})[_0x5980('0x26')](function(_0x27104e){if(_0x58694c['table']===_0x5980('0x9a')){_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9b'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}else{_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9e'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}if(_0x27104e){logger[_0x5980('0x9f')](_0x5980('0xa0'),_0x34abfd['toString']());require(_0x5980('0xa1'))[_0x5980('0xa2')](path[_0x5980('0x8b')](__dirname,'../../components/export/',_0x27104e[_0x5980('0x92')]),[_0x27104e['id'],_0x34abfd['toString'](),path['join'](__dirname,_0x5980('0xa3'),_0x27104e[_0x5980('0xa4')]),_0x9e44b8]);return _0x27104e;}else{var _0x4e950a=squel[_0x5980('0x71')]();_0x4e950a['from']('('+_0x34abfd[_0x5980('0x87')]()+')',_0x5980('0xa5'));_0x4e950a['field'](_0x5980('0xa6'),_0x5980('0x20'));_0x34abfd[_0x5980('0x1e')](_0x5116d9[_0x5980('0x1e')]||_0x22e52f);_0x34abfd['offset'](_0x5116d9[_0x5980('0x1d')]||0x0);return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x4e950a[_0x5980('0x87')](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]})[_0x5980('0x26')](function(_0x71f930){if(!_0x71f930[_0x5980('0x46')]){_0x3de3ac=0x0;}else{_0x3de3ac=_0x71f930[0x0][_0x5980('0x20')]||0x0;}return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x34abfd[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});})['then'](function(_0x5a3831){return{'rows':_0x5a3831||[],'count':_0x3de3ac};});}});}exports[_0x5980('0xa7')]=function(_0x2508b1,_0x298d48){return runReport(_0x2508b1[_0x5980('0x44')],_0x2508b1[_0x5980('0x30')],_0x2508b1['options'])[_0x5980('0x26')](respondWithResult(_0x298d48,null))[_0x5980('0x51')](handleError(_0x298d48,null));};exports[_0x5980('0xa8')]=runReport;exports[_0x5980('0x30')]=function(_0x6893a,_0x5e5870){var _0x3b56e4=0xa;var _0x307e84=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x5235df={'SUM':'SUM(%s)','COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x4758f2={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0x49dc67=function(_0x21d27a){return!_[_0x5980('0x63')]([_0x5980('0x64'),'IS\x20NOT\x20NULL',_0x5980('0x66'),_0x5980('0x67')],_0x21d27a);};var _0x5e6f24=function(_0x24b0db){if(!_0x24b0db||!_0x24b0db[_0x5980('0x68')]['length']){return'';}for(var _0xceb20b='(',_0x2f7461=0x0;_0x2f7461<_0x24b0db['rules'][_0x5980('0x46')];_0x2f7461+=0x1){_0x2f7461>0x0&&(_0xceb20b+='\x20'+_0x24b0db[_0x5980('0x69')]+'\x20');_0xceb20b+=_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]?_0x5e6f24(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]):_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x7c')]+'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461]['condition']+(_0x49dc67(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6b')])?'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6c')]:'');}return _0xceb20b+')';};var _0x42ac04={'where':{'id':_0x6893a[_0x5980('0x44')]['id']}},_0x4e7a79,_0x5303ca,_0x1f4512,_0x4c92c3,_0x3ae23c;_0x42ac04=_[_0x5980('0x3d')]({},_0x42ac04,_0x6893a[_0x5980('0x3e')]);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x42ac04)['then'](function(_0x164b13){if(_0x164b13){_0x4e7a79=_0x164b13;return _0x164b13[_0x5980('0x6d')]();}return null;})['then'](function(_0xff5861){if(_0xff5861){if(!_0xff5861[_0x5980('0x46')]){throw new db[(_0x5980('0x6e'))][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x5303ca=_0xff5861;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})['then'](function(_0x4407ce){if(_0x4407ce){_0x1f4512=_['keyBy'](_0x4407ce,'id');var _0x44a3ae;var _0x3e7dc5=squel['select']();_0x3e7dc5[_0x5980('0x72')](_0x4e7a79[_0x5980('0x73')]);for(var _0xec9bc2=0x0;_0xec9bc2<_0x5303ca['length'];_0xec9bc2+=0x1){_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x74')]?_0x1f4512[_0x5303ca[_0xec9bc2][_0x5980('0x74')]][_0x5980('0x75')]:_0x5303ca[_0xec9bc2][_0x5980('0x7c')];_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x76')]?_[_0x5980('0x77')](_0x5235df[_0x5303ca[_0xec9bc2]['function']],'%s',_0x44a3ae):_0x44a3ae;_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x78')]?_[_0x5980('0x77')](_0x4758f2[_0x5303ca[_0xec9bc2][_0x5980('0x78')]],'%s',_0x44a3ae):_0x44a3ae;if(_0x5303ca[_0xec9bc2][_0x5980('0x79')]){_0x3e7dc5[_0x5980('0x6a')](_0x44a3ae);}_0x5303ca[_0xec9bc2][_0x5980('0x7a')]&&_0x3e7dc5[_0x5980('0x91')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x3e7dc5[_0x5980('0x7c')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7d')]||_0x44a3ae);}if(_0x4e7a79[_0x5980('0x7e')]){_0x4e7a79[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x4e7a79['joins']);for(var _0x3a14ed=0x0;_0x3a14ed<_0x4e7a79[_0x5980('0x7e')][_0x5980('0x46')];_0x3a14ed+=0x1){if(_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x307e84,_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')])&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['parentKey']&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['foreignTable']&&_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x82')]){_0x3e7dc5[_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')]](_0x4e7a79['joins'][_0x3a14ed]['foreignTable'],null,util[_0x5980('0x78')](_0x5980('0x83'),_0x4e7a79['table'],_0x4e7a79['joins'][_0x3a14ed]['parentKey'],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x81')],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x82')]));}}}if(_0x4e7a79[_0x5980('0x84')]){_0x4e7a79[_0x5980('0x84')]=JSON[_0x5980('0x7f')](_0x4e7a79[_0x5980('0x84')]);_0x3e7dc5[_0x5980('0x39')](_0x5e6f24(_0x4e7a79[_0x5980('0x84')][_0x5980('0x6a')]));}_0x3ae23c=_0x3e7dc5[_0x5980('0x85')]();_0x3e7dc5[_0x5980('0x1e')](_0x3b56e4);_0x3e7dc5[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')](_0x5980('0xa9'),_0x3e7dc5['toString']());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x3e7dc5[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](function(){return{'sql':_0x3ae23c['toString']()};})[_0x5980('0x26')](respondWithResult(_0x5e5870,null))[_0x5980('0x51')](handleError(_0x5e5870,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 10059d9..94f1bfc 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 _0x4b5b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_custom_reports'];(function(_0x4fbf59,_0x3b946e){var _0x5601ff=function(_0x4883e0){while(--_0x4883e0){_0x4fbf59['push'](_0x4fbf59['shift']());}};_0x5601ff(++_0x3b946e);}(_0x4b5b,0x144));var _0xb4b5=function(_0x5028af,_0xe0361f){_0x5028af=_0x5028af-0x0;var _0x2dad0f=_0x4b5b[_0x5028af];return _0x2dad0f;};'use strict';var _=require(_0xb4b5('0x0'));var util=require(_0xb4b5('0x1'));var logger=require(_0xb4b5('0x2'))(_0xb4b5('0x3'));var moment=require(_0xb4b5('0x4'));var BPromise=require(_0xb4b5('0x5'));var rp=require(_0xb4b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4b5('0x7'));var config=require(_0xb4b5('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xb4b5('0x9')]=function(_0x38ffa6,_0x134f3f){return _0x38ffa6[_0xb4b5('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xb4b5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd19=['request-promise','path','exports','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd19,0x10b));var _0x9dd1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd19[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x9dd1('0x0'));var logger=require('../../config/logger')(_0x9dd1('0x1'));var moment=require(_0x9dd1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9dd1('0x3'));var fs=require('fs');var path=require(_0x9dd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9dd1('0x5')]=function(_0x3013c,_0x521599){return _0x3013c[_0x9dd1('0x6')](_0x9dd1('0x7'),attributes,{'tableName':_0x9dd1('0x8'),'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 21107b9..a29a81c 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 _0xcdbc=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x37c677,_0x5dcd32){var _0x58d996=function(_0x2f62de){while(--_0x2f62de){_0x37c677['push'](_0x37c677['shift']());}};_0x58d996(++_0x5dcd32);}(_0xcdbc,0xab));var _0xccdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcdbc[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xccdb('0x0'));var util=require(_0xccdb('0x1'));var moment=require(_0xccdb('0x2'));var BPromise=require(_0xccdb('0x3'));var rs=require(_0xccdb('0x4'));var fs=require('fs');var Redis=require(_0xccdb('0x5'));var db=require(_0xccdb('0x6'))['db'];var utils=require(_0xccdb('0x7'));var logger=require(_0xccdb('0x8'))(_0xccdb('0x9'));var config=require(_0xccdb('0xa'));var jayson=require(_0xccdb('0xb'));var client=jayson[_0xccdb('0xc')][_0xccdb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa8f62c,_0x423cd7,_0xc9f32){return new BPromise(function(_0x52a970,_0x5acf78){return client[_0xccdb('0xe')](_0xa8f62c,_0xc9f32)[_0xccdb('0xf')](function(_0x451c81){logger[_0xccdb('0x10')](_0xccdb('0x11'),_0x423cd7,_0xccdb('0x12'));logger[_0xccdb('0x13')](_0xccdb('0x14'),_0x423cd7,'request\x20sent',JSON[_0xccdb('0x15')](_0x451c81));if(_0x451c81[_0xccdb('0x16')]){if(_0x451c81[_0xccdb('0x16')][_0xccdb('0x17')]===0x1f4){logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x451c81['error'][_0xccdb('0x18')]);return _0x5acf78(_0x451c81['error']['message']);}logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x451c81[_0xccdb('0x16')][_0xccdb('0x18')]);return _0x52a970(_0x451c81['error']['message']);}else{logger[_0xccdb('0x10')](_0xccdb('0x11'),_0x423cd7,'request\x20sent');_0x52a970(_0x451c81[_0xccdb('0x19')][_0xccdb('0x18')]);}})[_0xccdb('0x1a')](function(_0x20328e){logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x20328e);_0x5acf78(_0x20328e);});});} \ No newline at end of file +var _0x7ead=['rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x7ead,0x118));var _0xd7ea=function(_0x498f5b,_0xe69ffa){_0x498f5b=_0x498f5b-0x0;var _0x46fafb=_0x7ead[_0x498f5b];return _0x46fafb;};'use strict';var _=require('lodash');var util=require(_0xd7ea('0x0'));var moment=require(_0xd7ea('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7ea('0x3'))['db'];var utils=require(_0xd7ea('0x4'));var logger=require(_0xd7ea('0x5'))(_0xd7ea('0x6'));var config=require(_0xd7ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd7ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x409576,_0x97907f,_0x1f4cd2){return new BPromise(function(_0x32ae86,_0x2719d5){return client[_0xd7ea('0x9')](_0x409576,_0x1f4cd2)[_0xd7ea('0xa')](function(_0x5d0a93){logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));logger[_0xd7ea('0xe')](_0xd7ea('0xf'),_0x97907f,'request\x20sent',JSON[_0xd7ea('0x10')](_0x5d0a93));if(_0x5d0a93[_0xd7ea('0x11')]){if(_0x5d0a93['error'][_0xd7ea('0x12')]===0x1f4){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x2719d5(_0x5d0a93[_0xd7ea('0x11')]['message']);}logger[_0xd7ea('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x32ae86(_0x5d0a93['error'][_0xd7ea('0x13')]);}else{logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));_0x32ae86(_0x5d0a93[_0xd7ea('0x14')][_0xd7ea('0x13')]);}})[_0xd7ea('0x15')](function(_0x4e40e7){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x4e40e7);_0x2719d5(_0x4e40e7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b3e07fe..cf23dce 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 _0x4bec=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','index','/:id','show','get','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4bec,0x10e));var _0xc4be=function(_0x39483d,_0x260176){_0x39483d=_0x39483d-0x0;var _0x54d85b=_0x4bec[_0x39483d];return _0x54d85b;};'use strict';var multer=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var path=require(_0xc4be('0x2'));var timeout=require(_0xc4be('0x3'));var express=require(_0xc4be('0x4'));var router=express[_0xc4be('0x5')]();var fs_extra=require(_0xc4be('0x6'));var auth=require(_0xc4be('0x7'));var interaction=require(_0xc4be('0x8'));var config=require('../../config/environment');var controller=require(_0xc4be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc4be('0xa')]);router['get'](_0xc4be('0xb'),auth['isAuthenticated'](),controller[_0xc4be('0xc')]);router[_0xc4be('0xd')](_0xc4be('0xe'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x10')]);router[_0xc4be('0xd')](_0xc4be('0x11'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x12')]);router[_0xc4be('0xd')](_0xc4be('0x13'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x14')]);router['post']('/',auth[_0xc4be('0xf')](),controller[_0xc4be('0x15')]);router[_0xc4be('0x16')]('/:id',auth[_0xc4be('0xf')](),controller[_0xc4be('0x17')]);router[_0xc4be('0x18')](_0xc4be('0xb'),auth['isAuthenticated'](),controller[_0xc4be('0x19')]);module[_0xc4be('0x1a')]=router; \ No newline at end of file +var _0x4550=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','post','create','update','destroy','exports'];(function(_0x25f983,_0x352b9d){var _0x50a304=function(_0x2bc5db){while(--_0x2bc5db){_0x25f983['push'](_0x25f983['shift']());}};_0x50a304(++_0x352b9d);}(_0x4550,0x111));var _0x0455=function(_0x128ee7,_0xbfbe00){_0x128ee7=_0x128ee7-0x0;var _0x38450a=_0x4550[_0x128ee7];return _0x38450a;};'use strict';var multer=require('multer');var util=require(_0x0455('0x0'));var path=require(_0x0455('0x1'));var timeout=require(_0x0455('0x2'));var express=require(_0x0455('0x3'));var router=express[_0x0455('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0455('0x5'));var interaction=require(_0x0455('0x6'));var config=require(_0x0455('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x0455('0x8')]('/',auth[_0x0455('0x9')](),controller[_0x0455('0xa')]);router['get'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0xc')]);router[_0x0455('0x8')]('/:id/preview',auth[_0x0455('0x9')](),controller[_0x0455('0xd')]);router[_0x0455('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x0455('0xe')]);router[_0x0455('0x8')](_0x0455('0xf'),auth[_0x0455('0x9')](),controller['query']);router[_0x0455('0x10')]('/',auth['isAuthenticated'](),controller[_0x0455('0x11')]);router['put'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x12')]);router['delete'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x13')]);module[_0x0455('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 8c18339..6a6c9a3 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x57c53e,_0x1670a4){var _0x2db469=function(_0xb6ec0e){while(--_0xb6ec0e){_0x57c53e['push'](_0x57c53e['shift']());}};_0x2db469(++_0x1670a4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2a80a2,_0x5bd118){_0x2a80a2=_0x2a80a2-0x0;var _0x29db85=_0xdbf5[_0x2a80a2];return _0x29db85;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x27e85a,_0x32d40d){_0x27e85a=_0x27e85a-0x0;var _0x4c52da=_0x8ef6[_0x27e85a];return _0x4c52da;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 007d6f5..852cd98 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 _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x10d3e1,_0x509309){var _0x2165d7=function(_0x4d1741){while(--_0x4d1741){_0x10d3e1['push'](_0x10d3e1['shift']());}};_0x2165d7(++_0x509309);}(_0x2542,0x169));var _0x2254=function(_0x4ce78c,_0x1e609d){_0x4ce78c=_0x4ce78c-0x0;var _0x3e18f5=_0x2542[_0x4ce78c];return _0x3e18f5;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2ef3,0xba));var _0x32ef=function(_0x423ff8,_0x3d4296){_0x423ff8=_0x423ff8-0x0;var _0x4cc1e8=_0x2ef3[_0x423ff8];return _0x4cc1e8;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 608737c..377dbec 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 _0xdf68=['AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xdf68,0xb5));var _0x8df6=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xdf68[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0x8df6('0x0'));var util=require(_0x8df6('0x1'));var logger=require(_0x8df6('0x2'))(_0x8df6('0x3'));var moment=require('moment');var BPromise=require(_0x8df6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8df6('0x5'));var config=require('../../config/environment');var attributes=require(_0x8df6('0x6'));module[_0x8df6('0x7')]=function(_0xa72705,_0x30ba14){return _0xa72705[_0x8df6('0x8')](_0x8df6('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2885=['util','../../config/logger','api','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x503f1d,_0x5a83d0){var _0x184e02=function(_0x34e5b4){while(--_0x34e5b4){_0x503f1d['push'](_0x503f1d['shift']());}};_0x184e02(++_0x5a83d0);}(_0x2885,0x1ac));var _0x5288=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x2885[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require(_0x5288('0x2'))(_0x5288('0x3'));var moment=require('moment');var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5288('0x5'));var config=require('../../config/environment');var attributes=require(_0x5288('0x6'));module[_0x5288('0x7')]=function(_0x57f165,_0x2acd2b){return _0x57f165[_0x5288('0x8')](_0x5288('0x9'),attributes,{'tableName':_0x5288('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 60883f4..f06b6a0 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 _0x5c99=['rpc','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5bd83b,_0x4ea55c){var _0x231323=function(_0xb7edd){while(--_0xb7edd){_0x5bd83b['push'](_0x5bd83b['shift']());}};_0x231323(++_0x4ea55c);}(_0x5c99,0x86));var _0x95c9=function(_0x41428b,_0xe6dbc7){_0x41428b=_0x41428b-0x0;var _0x3d32df=_0x5c99[_0x41428b];return _0x3d32df;};'use strict';var _=require(_0x95c9('0x0'));var util=require('util');var moment=require(_0x95c9('0x1'));var BPromise=require('bluebird');var rs=require(_0x95c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95c9('0x3'))['db'];var utils=require(_0x95c9('0x4'));var logger=require(_0x95c9('0x5'))(_0x95c9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x95c9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a54dd,_0x30cd82,_0x4f1989){return new BPromise(function(_0x5f45ea,_0x4f189f){return client['request'](_0x1a54dd,_0x4f1989)[_0x95c9('0x8')](function(_0x16eed3){logger[_0x95c9('0x9')](_0x95c9('0xa'),_0x30cd82,_0x95c9('0xb'));logger[_0x95c9('0xc')](_0x95c9('0xd'),_0x30cd82,_0x95c9('0xb'),JSON[_0x95c9('0xe')](_0x16eed3));if(_0x16eed3['error']){if(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x10')]===0x1f4){logger['error'](_0x95c9('0xa'),_0x30cd82,_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);return _0x4f189f(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);}logger[_0x95c9('0xf')](_0x95c9('0xa'),_0x30cd82,_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);return _0x5f45ea(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);}else{logger[_0x95c9('0x9')](_0x95c9('0xa'),_0x30cd82,_0x95c9('0xb'));_0x5f45ea(_0x16eed3[_0x95c9('0x12')][_0x95c9('0x11')]);}})[_0x95c9('0x13')](function(_0x3f25b1){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x30cd82,_0x3f25b1);_0x4f189f(_0x3f25b1);});});} \ No newline at end of file +var _0xbab5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d6338,_0x2b44bb){var _0xbb9b7c=function(_0x404be4){while(--_0x404be4){_0x4d6338['push'](_0x4d6338['shift']());}};_0xbb9b7c(++_0x2b44bb);}(_0xbab5,0x1df));var _0x5bab=function(_0x51f4d3,_0x3a1271){_0x51f4d3=_0x51f4d3-0x0;var _0xbb3a38=_0xbab5[_0x51f4d3];return _0xbb3a38;};'use strict';var _=require('lodash');var util=require(_0x5bab('0x0'));var moment=require(_0x5bab('0x1'));var BPromise=require(_0x5bab('0x2'));var rs=require(_0x5bab('0x3'));var fs=require('fs');var Redis=require(_0x5bab('0x4'));var db=require(_0x5bab('0x5'))['db'];var utils=require(_0x5bab('0x6'));var logger=require(_0x5bab('0x7'))(_0x5bab('0x8'));var config=require(_0x5bab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b871,_0xc94606,_0x38b7ca){return new BPromise(function(_0x3e1832,_0x1d4e0d){return client[_0x5bab('0xb')](_0x12b871,_0x38b7ca)[_0x5bab('0xc')](function(_0x41cca8){logger[_0x5bab('0xd')](_0x5bab('0xe'),_0xc94606,_0x5bab('0xf'));logger[_0x5bab('0x10')](_0x5bab('0x11'),_0xc94606,'request\x20sent',JSON['stringify'](_0x41cca8));if(_0x41cca8[_0x5bab('0x12')]){if(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x13')]===0x1f4){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8['error'][_0x5bab('0x14')]);return _0x1d4e0d(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);}logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);return _0x3e1832(_0x41cca8[_0x5bab('0x12')]['message']);}else{logger[_0x5bab('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc94606,_0x5bab('0xf'));_0x3e1832(_0x41cca8['result'][_0x5bab('0x14')]);}})[_0x5bab('0x15')](function(_0x4cbced){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x4cbced);_0x1d4e0d(_0x4cbced);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 328df35..5815ec8 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 _0xa4f4=['show','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x180265,_0x52b0cf){var _0x191d46=function(_0x2c886b){while(--_0x2c886b){_0x180265['push'](_0x180265['shift']());}};_0x191d46(++_0x52b0cf);}(_0xa4f4,0xf6));var _0x4a4f=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa4f4[_0x36ed48];return _0x51c63a;};'use strict';var multer=require('multer');var util=require(_0x4a4f('0x0'));var path=require(_0x4a4f('0x1'));var timeout=require(_0x4a4f('0x2'));var express=require(_0x4a4f('0x3'));var router=express[_0x4a4f('0x4')]();var fs_extra=require(_0x4a4f('0x5'));var auth=require(_0x4a4f('0x6'));var interaction=require(_0x4a4f('0x7'));var config=require(_0x4a4f('0x8'));var controller=require(_0x4a4f('0x9'));router[_0x4a4f('0xa')]('/',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0xc')]);router[_0x4a4f('0xa')](_0x4a4f('0xd'),auth['isAuthenticated'](),controller[_0x4a4f('0xe')]);router[_0x4a4f('0xa')]('/:id/preview',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0xf')]);router[_0x4a4f('0xa')](_0x4a4f('0x10'),auth['isAuthenticated'](),controller[_0x4a4f('0x11')]);router[_0x4a4f('0xa')](_0x4a4f('0x12'),auth['isAuthenticated'](),controller[_0x4a4f('0x13')]);router[_0x4a4f('0x14')]('/',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x15')]);router['put'](_0x4a4f('0xd'),auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x16')]);router[_0x4a4f('0x17')](_0x4a4f('0xd'),auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x18')]);module[_0x4a4f('0x19')]=router; \ No newline at end of file +var _0x34c2=['create','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','query','post'];(function(_0x4edb8b,_0x5252bc){var _0x2e2e1b=function(_0x1286f6){while(--_0x1286f6){_0x4edb8b['push'](_0x4edb8b['shift']());}};_0x2e2e1b(++_0x5252bc);}(_0x34c2,0x98));var _0x234c=function(_0x221019,_0x15c3c1){_0x221019=_0x221019-0x0;var _0x1b3cae=_0x34c2[_0x221019];return _0x1b3cae;};'use strict';var multer=require(_0x234c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x234c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x234c('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x234c('0x3'));var controller=require(_0x234c('0x4'));router['get']('/',auth[_0x234c('0x5')](),controller[_0x234c('0x6')]);router[_0x234c('0x7')](_0x234c('0x8'),auth['isAuthenticated'](),controller[_0x234c('0x9')]);router[_0x234c('0x7')](_0x234c('0xa'),auth[_0x234c('0x5')](),controller[_0x234c('0xb')]);router[_0x234c('0x7')](_0x234c('0xc'),auth[_0x234c('0x5')](),controller[_0x234c('0xd')]);router[_0x234c('0x7')]('/:id/query',auth[_0x234c('0x5')](),controller[_0x234c('0xe')]);router[_0x234c('0xf')]('/',auth['isAuthenticated'](),controller[_0x234c('0x10')]);router['put']('/:id',auth[_0x234c('0x5')](),controller[_0x234c('0x11')]);router[_0x234c('0x12')](_0x234c('0x8'),auth[_0x234c('0x5')](),controller[_0x234c('0x13')]);module[_0x234c('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 6cb7324..dff29e6 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 _0xdf73=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','scheduled'];(function(_0x2660e1,_0x4ac698){var _0xa3f403=function(_0x2f69c5){while(--_0x2f69c5){_0x2660e1['push'](_0x2660e1['shift']());}};_0xa3f403(++_0x4ac698);}(_0xdf73,0x141));var _0x3df7=function(_0xeb46a1,_0x499aeb){_0xeb46a1=_0xeb46a1-0x0;var _0x1f8ca7=_0xdf73[_0xeb46a1];return _0x1f8ca7;};'use strict';var Sequelize=require(_0x3df7('0x0'));var moment=require(_0x3df7('0x1'));module[_0x3df7('0x2')]={'name':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3df7('0x4')](_0x3df7('0x5'),'pdf',_0x3df7('0x6')),'allowNull':![],'defaultValue':_0x3df7('0x5')},'savename':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3df7('0x7')]},'endDate':{'type':Sequelize[_0x3df7('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3df7('0x4')]('manual',_0x3df7('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x3df7('0x9')]},'reportType':{'type':Sequelize[_0x3df7('0x3')]}}; \ No newline at end of file +var _0xf3a5=['UNSIGNED','moment','exports','STRING','ENUM','xlsx','DATE','Loading','manual'];(function(_0xf00800,_0x1f50ba){var _0x381043=function(_0x4850fc){while(--_0x4850fc){_0xf00800['push'](_0xf00800['shift']());}};_0x381043(++_0x1f50ba);}(_0xf3a5,0x1c3));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5f3a('0x0'));module[_0x5f3a('0x1')]={'name':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5f3a('0x3')]('csv','pdf',_0x5f3a('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5f3a('0x5')]},'endDate':{'type':Sequelize[_0x5f3a('0x5')]},'status':{'type':Sequelize[_0x5f3a('0x2')],'defaultValue':_0x5f3a('0x6')},'type':{'type':Sequelize[_0x5f3a('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x5f3a('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x5f3a('0x8')]},'reportType':{'type':Sequelize[_0x5f3a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index a4cd754..bb041a5 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 _0x5e91=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','merge','includeAll','rows','catch','params','length','include','options','find','create','body','user','get'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x5e91,0xc0));var _0x15e9=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0x5e91[_0x3f4f3b];return _0xfc6f02;};'use strict';var emlformat=require(_0x15e9('0x0'));var rimraf=require(_0x15e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15e9('0x2'));var rp=require(_0x15e9('0x3'));var moment=require('moment');var BPromise=require(_0x15e9('0x4'));var Mustache=require(_0x15e9('0x5'));var util=require(_0x15e9('0x6'));var path=require(_0x15e9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15e9('0x8'));var _=require(_0x15e9('0x9'));var squel=require('squel');var crypto=require(_0x15e9('0xa'));var jsforce=require(_0x15e9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x15e9('0xc'));var querystring=require(_0x15e9('0xd'));var Papa=require(_0x15e9('0xe'));var Redis=require('ioredis');var authService=require(_0x15e9('0xf'));var qs=require(_0x15e9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15e9('0x11'));var logger=require(_0x15e9('0x12'))(_0x15e9('0x13'));var utils=require(_0x15e9('0x14'));var config=require(_0x15e9('0x15'));var licenseUtil=require(_0x15e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15bfa0,_0x1c3226){_0x1c3226=_0x1c3226||0xcc;return function(_0x5c24a8){if(_0x5c24a8){return _0x15bfa0[_0x15e9('0x17')](_0x1c3226);}return _0x15bfa0[_0x15e9('0x18')](_0x1c3226)[_0x15e9('0x19')]();};}function respondWithResult(_0x20eec9,_0x1c904f){_0x1c904f=_0x1c904f||0xc8;return function(_0x4fc857){if(_0x4fc857){return _0x20eec9[_0x15e9('0x18')](_0x1c904f)[_0x15e9('0x1a')](_0x4fc857);}};}function respondWithFilteredResult(_0xa7f2e4,_0x25732d){return function(_0x4fc80b){if(_0x4fc80b){var _0x3519e9=typeof _0x25732d[_0x15e9('0x1b')]===_0x15e9('0x1c')&&typeof _0x25732d[_0x15e9('0x1d')]===_0x15e9('0x1c');var _0x189d42=_0x4fc80b[_0x15e9('0x1e')];var _0x4e9e4f=_0x3519e9?0x0:_0x25732d[_0x15e9('0x1b')];var _0x2e88ba=_0x3519e9?_0x4fc80b[_0x15e9('0x1e')]:_0x25732d[_0x15e9('0x1b')]+_0x25732d[_0x15e9('0x1d')];var _0x16065f;if(_0x2e88ba>=_0x189d42){_0x2e88ba=_0x189d42;_0x16065f=0xc8;}else{_0x16065f=0xce;}_0xa7f2e4[_0x15e9('0x18')](_0x16065f);return _0xa7f2e4[_0x15e9('0x1f')]('Content-Range',_0x4e9e4f+'-'+_0x2e88ba+'/'+_0x189d42)[_0x15e9('0x1a')](_0x4fc80b);}return null;};}function patchUpdates(_0xea7295){return function(_0x59df24){try{jsonpatch['apply'](_0x59df24,_0xea7295,!![]);}catch(_0x5a56b0){return BPromise[_0x15e9('0x20')](_0x5a56b0);}return _0x59df24[_0x15e9('0x21')]();};}function saveUpdates(_0x4812e9,_0x32f39a){return function(_0x369b11){if(_0x369b11){return _0x369b11[_0x15e9('0x22')](_0x4812e9)[_0x15e9('0x23')](function(_0xbdac19){return _0xbdac19;});}return null;};}function removeEntity(_0x402737,_0x5c3702){return function(_0x62de58){if(_0x62de58){return _0x62de58['destroy']()[_0x15e9('0x23')](function(){var _0xe87e7f=_0x62de58['get']({'plain':!![]});var _0x4a9150='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x4a9150,'resourceId':_0xe87e7f['id']}})[_0x15e9('0x23')](function(){return _0x62de58;});})[_0x15e9('0x23')](function(){_0x402737[_0x15e9('0x18')](0xcc)[_0x15e9('0x19')]();});}};}function handleEntityNotFound(_0x592592,_0x5c9720){return function(_0x1e6f49){if(!_0x1e6f49){_0x592592[_0x15e9('0x17')](0x194);}return _0x1e6f49;};}function handleError(_0x40b1eb,_0x5d7421){_0x5d7421=_0x5d7421||0x1f4;return function(_0x38010b){logger[_0x15e9('0x24')](_0x38010b['stack']);if(_0x38010b[_0x15e9('0x25')]){delete _0x38010b[_0x15e9('0x25')];}_0x40b1eb['status'](_0x5d7421)[_0x15e9('0x26')](_0x38010b);};}exports[_0x15e9('0x27')]=function(_0x5dd28d,_0x731e4c){var _0x19beb7={},_0x38f9c5={},_0x74325={'count':0x0,'rows':[]};var _0x5c1901=_[_0x15e9('0x28')](db[_0x15e9('0x29')][_0x15e9('0x2a')],function(_0x3a4cb8){return{'name':_0x3a4cb8[_0x15e9('0x2b')],'type':_0x3a4cb8[_0x15e9('0x2c')][_0x15e9('0x2d')]};});_0x38f9c5['model']=_[_0x15e9('0x28')](_0x5c1901,_0x15e9('0x25'));_0x38f9c5['query']=_[_0x15e9('0x2e')](_0x5dd28d[_0x15e9('0x2f')]);_0x38f9c5[_0x15e9('0x30')]=_[_0x15e9('0x31')](_0x38f9c5[_0x15e9('0x32')],_0x38f9c5[_0x15e9('0x2f')]);_0x19beb7[_0x15e9('0x33')]=_['intersection'](_0x38f9c5['model'],qs['fields'](_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x34')]));_0x19beb7['attributes']=_0x19beb7[_0x15e9('0x33')]['length']?_0x19beb7[_0x15e9('0x33')]:_0x38f9c5[_0x15e9('0x32')];if(!_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x35')]('nolimit')){_0x19beb7[_0x15e9('0x1d')]=qs[_0x15e9('0x1d')](_0x5dd28d['query'][_0x15e9('0x1d')]);_0x19beb7[_0x15e9('0x1b')]=qs['offset'](_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x1b')]);}_0x19beb7['order']=qs[_0x15e9('0x36')](_0x5dd28d['query'][_0x15e9('0x36')]);_0x19beb7['where']=qs[_0x15e9('0x30')](_['pick'](_0x5dd28d[_0x15e9('0x2f')],_0x38f9c5[_0x15e9('0x30')]),_0x5c1901);if(_0x5dd28d[_0x15e9('0x2f')]['filter']){_0x19beb7[_0x15e9('0x37')]=_[_0x15e9('0x38')](_0x19beb7[_0x15e9('0x37')],{'$or':_[_0x15e9('0x28')](_0x5c1901,function(_0x50fdc2){if(_0x50fdc2[_0x15e9('0x2c')]!=='VIRTUAL'){var _0x508481={};_0x508481[_0x50fdc2[_0x15e9('0x25')]]={'$like':'%'+_0x5dd28d[_0x15e9('0x2f')]['filter']+'%'};return _0x508481;}})});}_0x19beb7=_[_0x15e9('0x38')]({},_0x19beb7,_0x5dd28d['options']);var _0x5f5230={'where':_0x19beb7[_0x15e9('0x37')]};return db[_0x15e9('0x29')][_0x15e9('0x1e')](_0x5f5230)[_0x15e9('0x23')](function(_0xf4257){_0x74325[_0x15e9('0x1e')]=_0xf4257;if(_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x39')]){_0x19beb7['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x19beb7);})[_0x15e9('0x23')](function(_0x3d9afb){_0x74325[_0x15e9('0x3a')]=_0x3d9afb;return _0x74325;})[_0x15e9('0x23')](respondWithFilteredResult(_0x731e4c,_0x19beb7))[_0x15e9('0x3b')](handleError(_0x731e4c,null));};exports['show']=function(_0x3069fd,_0x2cfcc5){var _0x102ba7={'raw':!![],'where':{'id':_0x3069fd[_0x15e9('0x3c')]['id']}},_0x1b3093={};_0x1b3093[_0x15e9('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x15e9('0x2a')]);_0x1b3093[_0x15e9('0x2f')]=_[_0x15e9('0x2e')](_0x3069fd[_0x15e9('0x2f')]);_0x1b3093[_0x15e9('0x30')]=_[_0x15e9('0x31')](_0x1b3093[_0x15e9('0x32')],_0x1b3093['query']);_0x102ba7['attributes']=_[_0x15e9('0x31')](_0x1b3093[_0x15e9('0x32')],qs[_0x15e9('0x34')](_0x3069fd[_0x15e9('0x2f')][_0x15e9('0x34')]));_0x102ba7[_0x15e9('0x33')]=_0x102ba7[_0x15e9('0x33')][_0x15e9('0x3d')]?_0x102ba7[_0x15e9('0x33')]:_0x1b3093[_0x15e9('0x32')];if(_0x3069fd[_0x15e9('0x2f')]['includeAll']){_0x102ba7[_0x15e9('0x3e')]=[{'all':!![]}];}_0x102ba7=_[_0x15e9('0x38')]({},_0x102ba7,_0x3069fd[_0x15e9('0x3f')]);return db['AnalyticExtractedReport'][_0x15e9('0x40')](_0x102ba7)['then'](handleEntityNotFound(_0x2cfcc5,null))['then'](respondWithResult(_0x2cfcc5,null))[_0x15e9('0x3b')](handleError(_0x2cfcc5,null));};exports[_0x15e9('0x41')]=function(_0x1e788e,_0x1fa532){return db[_0x15e9('0x29')][_0x15e9('0x41')](_0x1e788e[_0x15e9('0x42')],{})[_0x15e9('0x23')](function(_0x2cef56){var _0x40789d=_0x1e788e[_0x15e9('0x43')][_0x15e9('0x44')]({'plain':!![]});if(!_0x40789d)throw new Error(_0x15e9('0x45'));if(_0x40789d[_0x15e9('0x46')]===_0x15e9('0x43')){var _0x3c20a8=_0x2cef56[_0x15e9('0x44')]({'plain':!![]});var _0xa5fb70=_0x15e9('0x47');return db[_0x15e9('0x48')][_0x15e9('0x40')]({'where':{'name':_0xa5fb70,'userProfileId':_0x40789d['userProfileId']},'raw':!![]})[_0x15e9('0x23')](function(_0x346c34){if(_0x346c34&&_0x346c34['autoAssociation']===0x0){return db['UserProfileResource'][_0x15e9('0x41')]({'name':_0x3c20a8['name'],'resourceId':_0x3c20a8['id'],'type':_0x346c34['name'],'sectionId':_0x346c34['id']},{})[_0x15e9('0x23')](function(){return _0x2cef56;});}else{return _0x2cef56;}})[_0x15e9('0x3b')](function(_0x1cdfc0){logger['error'](_0x15e9('0x49'),_0x1cdfc0);throw _0x1cdfc0;});}return _0x2cef56;})[_0x15e9('0x23')](respondWithResult(_0x1fa532,0xc9))[_0x15e9('0x3b')](handleError(_0x1fa532,null));};exports[_0x15e9('0x22')]=function(_0x56fd13,_0x175cca){if(_0x56fd13[_0x15e9('0x42')]['id']){delete _0x56fd13[_0x15e9('0x42')]['id'];}return db[_0x15e9('0x29')][_0x15e9('0x40')]({'where':{'id':_0x56fd13[_0x15e9('0x3c')]['id']}})[_0x15e9('0x23')](handleEntityNotFound(_0x175cca,null))[_0x15e9('0x23')](saveUpdates(_0x56fd13[_0x15e9('0x42')],null))['then'](respondWithResult(_0x175cca,null))[_0x15e9('0x3b')](handleError(_0x175cca,null));};exports[_0x15e9('0x4a')]=function(_0x320ca2,_0x35822b){return db['AnalyticExtractedReport'][_0x15e9('0x40')]({'where':{'id':_0x320ca2[_0x15e9('0x3c')]['id']}})[_0x15e9('0x23')](handleEntityNotFound(_0x35822b,null))[_0x15e9('0x23')](removeEntity(_0x35822b,null))[_0x15e9('0x3b')](handleError(_0x35822b,null));};exports['download']=function(_0x595d4b,_0x56494d,_0x4043a1){return db[_0x15e9('0x29')]['find']({'where':{'id':_0x595d4b[_0x15e9('0x3c')]['id']},'attributes':['name',_0x15e9('0x4b'),_0x15e9('0x4c'),_0x15e9('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x56494d,null))[_0x15e9('0x23')](function(_0x291b13){if(_0x291b13){if(!fs[_0x15e9('0x4e')](path[_0x15e9('0x4f')](config[_0x15e9('0x50')],_0x15e9('0x51'),_0x291b13['savename']))){throw new db[(_0x15e9('0x52'))][(_0x15e9('0x53'))](_0x15e9('0x54'));}if(_0x595d4b['query']['exists']){return _0x56494d['sendStatus'](0xc8);}return _0x56494d['download'](path[_0x15e9('0x4f')](config[_0x15e9('0x50')],'server/files/reports',_0x291b13['savename']),util['format'](_0x15e9('0x55'),_0x291b13[_0x15e9('0x4b')]||_0x291b13[_0x15e9('0x25')],_0x291b13[_0x15e9('0x4d')][_0x15e9('0x56')]()));}})[_0x15e9('0x3b')](handleError(_0x56494d,null));}; \ No newline at end of file +var _0xf811=['VIRTUAL','filter','options','where','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge'];(function(_0x2fba83,_0x23638f){var _0x1536d9=function(_0x2cc5bf){while(--_0x2cc5bf){_0x2fba83['push'](_0x2fba83['shift']());}};_0x1536d9(++_0x23638f);}(_0xf811,0x139));var _0x1f81=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf811[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f81('0x4'));var Mustache=require(_0x1f81('0x5'));var util=require(_0x1f81('0x6'));var path=require(_0x1f81('0x7'));var sox=require(_0x1f81('0x8'));var csv=require(_0x1f81('0x9'));var ejs=require(_0x1f81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f81('0xb'));var crypto=require(_0x1f81('0xc'));var jsforce=require(_0x1f81('0xd'));var deskjs=require(_0x1f81('0xe'));var toCsv=require(_0x1f81('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f81('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x10'));var as=require(_0x1f81('0x11'));var hardwareService=require(_0x1f81('0x12'));var logger=require(_0x1f81('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1f81('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6276,_0x6655c5){_0x6655c5=_0x6655c5||0xcc;return function(_0xe7f42b){if(_0xe7f42b){return _0x5c6276[_0x1f81('0x15')](_0x6655c5);}return _0x5c6276['status'](_0x6655c5)['end']();};}function respondWithResult(_0xb67196,_0x3866b2){_0x3866b2=_0x3866b2||0xc8;return function(_0x5a5254){if(_0x5a5254){return _0xb67196[_0x1f81('0x16')](_0x3866b2)['json'](_0x5a5254);}};}function respondWithFilteredResult(_0x1c6503,_0xfe0d76){return function(_0x30064f){if(_0x30064f){var _0xc56e33=typeof _0xfe0d76[_0x1f81('0x17')]===_0x1f81('0x18')&&typeof _0xfe0d76[_0x1f81('0x19')]===_0x1f81('0x18');var _0x48b69e=_0x30064f[_0x1f81('0x1a')];var _0x1a5a50=_0xc56e33?0x0:_0xfe0d76[_0x1f81('0x17')];var _0x4d706c=_0xc56e33?_0x30064f[_0x1f81('0x1a')]:_0xfe0d76[_0x1f81('0x17')]+_0xfe0d76[_0x1f81('0x19')];var _0x281cc4;if(_0x4d706c>=_0x48b69e){_0x4d706c=_0x48b69e;_0x281cc4=0xc8;}else{_0x281cc4=0xce;}_0x1c6503[_0x1f81('0x16')](_0x281cc4);return _0x1c6503['set'](_0x1f81('0x1b'),_0x1a5a50+'-'+_0x4d706c+'/'+_0x48b69e)[_0x1f81('0x1c')](_0x30064f);}return null;};}function patchUpdates(_0x351c54){return function(_0x52a77f){try{jsonpatch[_0x1f81('0x1d')](_0x52a77f,_0x351c54,!![]);}catch(_0x5dd7a5){return BPromise[_0x1f81('0x1e')](_0x5dd7a5);}return _0x52a77f['save']();};}function saveUpdates(_0x2fd26c,_0x1a69c3){return function(_0x1b5f57){if(_0x1b5f57){return _0x1b5f57[_0x1f81('0x1f')](_0x2fd26c)[_0x1f81('0x20')](function(_0x44e1c9){return _0x44e1c9;});}return null;};}function removeEntity(_0x1e11df,_0x52a17f){return function(_0x763d48){if(_0x763d48){return _0x763d48[_0x1f81('0x21')]()[_0x1f81('0x20')](function(){var _0x54c778=_0x763d48[_0x1f81('0x22')]({'plain':!![]});var _0x4bb248=_0x1f81('0x23');return db[_0x1f81('0x24')]['destroy']({'where':{'type':_0x4bb248,'resourceId':_0x54c778['id']}})[_0x1f81('0x20')](function(){return _0x763d48;});})[_0x1f81('0x20')](function(){_0x1e11df[_0x1f81('0x16')](0xcc)[_0x1f81('0x25')]();});}};}function handleEntityNotFound(_0x320220,_0x4ee881){return function(_0x28e50f){if(!_0x28e50f){_0x320220[_0x1f81('0x15')](0x194);}return _0x28e50f;};}function handleError(_0x3db6db,_0x4a0d32){_0x4a0d32=_0x4a0d32||0x1f4;return function(_0x4343ac){logger[_0x1f81('0x26')](_0x4343ac[_0x1f81('0x27')]);if(_0x4343ac['name']){delete _0x4343ac[_0x1f81('0x28')];}_0x3db6db['status'](_0x4a0d32)['send'](_0x4343ac);};}exports[_0x1f81('0x29')]=function(_0x72a980,_0x39dc93){var _0x523472={},_0x2eea07={},_0x4e19bf={'count':0x0,'rows':[]};var _0x58ebdd=_[_0x1f81('0x2a')](db[_0x1f81('0x2b')][_0x1f81('0x2c')],function(_0x441163){return{'name':_0x441163['fieldName'],'type':_0x441163[_0x1f81('0x2d')][_0x1f81('0x2e')]};});_0x2eea07[_0x1f81('0x2f')]=_[_0x1f81('0x2a')](_0x58ebdd,_0x1f81('0x28'));_0x2eea07['query']=_['keys'](_0x72a980[_0x1f81('0x30')]);_0x2eea07[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x2eea07[_0x1f81('0x2f')],_0x2eea07['query']);_0x523472[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x2eea07['model'],qs[_0x1f81('0x34')](_0x72a980[_0x1f81('0x30')][_0x1f81('0x34')]));_0x523472[_0x1f81('0x33')]=_0x523472[_0x1f81('0x33')]['length']?_0x523472['attributes']:_0x2eea07[_0x1f81('0x2f')];if(!_0x72a980['query'][_0x1f81('0x35')](_0x1f81('0x36'))){_0x523472['limit']=qs['limit'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x19')]);_0x523472[_0x1f81('0x17')]=qs['offset'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x17')]);}_0x523472[_0x1f81('0x37')]=qs['sort'](_0x72a980['query'][_0x1f81('0x38')]);_0x523472['where']=qs['filters'](_[_0x1f81('0x39')](_0x72a980['query'],_0x2eea07[_0x1f81('0x31')]),_0x58ebdd);if(_0x72a980[_0x1f81('0x30')]['filter']){_0x523472['where']=_[_0x1f81('0x3a')](_0x523472['where'],{'$or':_[_0x1f81('0x2a')](_0x58ebdd,function(_0x11a151){if(_0x11a151[_0x1f81('0x2d')]!==_0x1f81('0x3b')){var _0x530555={};_0x530555[_0x11a151['name']]={'$like':'%'+_0x72a980[_0x1f81('0x30')][_0x1f81('0x3c')]+'%'};return _0x530555;}})});}_0x523472=_[_0x1f81('0x3a')]({},_0x523472,_0x72a980[_0x1f81('0x3d')]);var _0x2136e0={'where':_0x523472[_0x1f81('0x3e')]};return db['AnalyticExtractedReport'][_0x1f81('0x1a')](_0x2136e0)[_0x1f81('0x20')](function(_0x1f10fe){_0x4e19bf['count']=_0x1f10fe;if(_0x72a980[_0x1f81('0x30')][_0x1f81('0x3f')]){_0x523472['include']=[{'all':!![]}];}return db[_0x1f81('0x2b')][_0x1f81('0x40')](_0x523472);})[_0x1f81('0x20')](function(_0x59d6c3){_0x4e19bf[_0x1f81('0x41')]=_0x59d6c3;return _0x4e19bf;})['then'](respondWithFilteredResult(_0x39dc93,_0x523472))[_0x1f81('0x42')](handleError(_0x39dc93,null));};exports[_0x1f81('0x43')]=function(_0x37a322,_0x3697c0){var _0x1082ee={'raw':!![],'where':{'id':_0x37a322[_0x1f81('0x44')]['id']}},_0x420d41={};_0x420d41[_0x1f81('0x2f')]=_[_0x1f81('0x45')](db[_0x1f81('0x2b')][_0x1f81('0x2c')]);_0x420d41[_0x1f81('0x30')]=_['keys'](_0x37a322[_0x1f81('0x30')]);_0x420d41[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x420d41['model'],_0x420d41[_0x1f81('0x30')]);_0x1082ee[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x420d41[_0x1f81('0x2f')],qs[_0x1f81('0x34')](_0x37a322[_0x1f81('0x30')]['fields']));_0x1082ee[_0x1f81('0x33')]=_0x1082ee[_0x1f81('0x33')]['length']?_0x1082ee[_0x1f81('0x33')]:_0x420d41[_0x1f81('0x2f')];if(_0x37a322['query']['includeAll']){_0x1082ee[_0x1f81('0x46')]=[{'all':!![]}];}_0x1082ee=_[_0x1f81('0x3a')]({},_0x1082ee,_0x37a322[_0x1f81('0x3d')]);return db[_0x1f81('0x2b')][_0x1f81('0x47')](_0x1082ee)[_0x1f81('0x20')](handleEntityNotFound(_0x3697c0,null))['then'](respondWithResult(_0x3697c0,null))['catch'](handleError(_0x3697c0,null));};exports[_0x1f81('0x48')]=function(_0x1023bc,_0x5abb4b){return db[_0x1f81('0x2b')][_0x1f81('0x48')](_0x1023bc[_0x1f81('0x49')],{})[_0x1f81('0x20')](function(_0x22d891){var _0x36c421=_0x1023bc[_0x1f81('0x4a')][_0x1f81('0x22')]({'plain':!![]});if(!_0x36c421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36c421[_0x1f81('0x4b')]===_0x1f81('0x4a')){var _0x5c649b=_0x22d891[_0x1f81('0x22')]({'plain':!![]});var _0x2cc951=_0x1f81('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x2cc951,'userProfileId':_0x36c421[_0x1f81('0x4c')]},'raw':!![]})['then'](function(_0x450112){if(_0x450112&&_0x450112[_0x1f81('0x4d')]===0x0){return db[_0x1f81('0x24')][_0x1f81('0x48')]({'name':_0x5c649b[_0x1f81('0x28')],'resourceId':_0x5c649b['id'],'type':_0x450112[_0x1f81('0x28')],'sectionId':_0x450112['id']},{})[_0x1f81('0x20')](function(){return _0x22d891;});}else{return _0x22d891;}})[_0x1f81('0x42')](function(_0x447727){logger[_0x1f81('0x26')](_0x1f81('0x4e'),_0x447727);throw _0x447727;});}return _0x22d891;})[_0x1f81('0x20')](respondWithResult(_0x5abb4b,0xc9))[_0x1f81('0x42')](handleError(_0x5abb4b,null));};exports[_0x1f81('0x1f')]=function(_0x420ee8,_0x53aeb2){if(_0x420ee8[_0x1f81('0x49')]['id']){delete _0x420ee8['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x420ee8[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x53aeb2,null))['then'](saveUpdates(_0x420ee8[_0x1f81('0x49')],null))[_0x1f81('0x20')](respondWithResult(_0x53aeb2,null))[_0x1f81('0x42')](handleError(_0x53aeb2,null));};exports['destroy']=function(_0x5560fd,_0x1bf69b){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x5560fd[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x1bf69b,null))[_0x1f81('0x20')](removeEntity(_0x1bf69b,null))[_0x1f81('0x42')](handleError(_0x1bf69b,null));};exports[_0x1f81('0x4f')]=function(_0x3e1421,_0x4c02d5,_0x22fc32){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x3e1421[_0x1f81('0x44')]['id']},'attributes':[_0x1f81('0x28'),_0x1f81('0x50'),_0x1f81('0x51'),_0x1f81('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x4c02d5,null))[_0x1f81('0x20')](function(_0x17dc8f){if(_0x17dc8f){if(!fs[_0x1f81('0x53')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f['savename']))){throw new db[(_0x1f81('0x57'))][(_0x1f81('0x58'))](_0x1f81('0x59'));}if(_0x3e1421[_0x1f81('0x30')][_0x1f81('0x5a')]){return _0x4c02d5[_0x1f81('0x15')](0xc8);}return _0x4c02d5[_0x1f81('0x4f')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f[_0x1f81('0x51')]),util['format'](_0x1f81('0x5b'),_0x17dc8f[_0x1f81('0x50')]||_0x17dc8f[_0x1f81('0x28')],_0x17dc8f[_0x1f81('0x52')][_0x1f81('0x5c')]()));}})[_0x1f81('0x42')](handleError(_0x4c02d5,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index fd8f866..a3a25d3 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 _0xdf31=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0xdf31,0x16c));var _0x1df3=function(_0x55d0ce,_0x55c452){_0x55d0ce=_0x55d0ce-0x0;var _0x6402c6=_0xdf31[_0x55d0ce];return _0x6402c6;};'use strict';var _=require(_0x1df3('0x0'));var util=require(_0x1df3('0x1'));var logger=require(_0x1df3('0x2'))('api');var moment=require(_0x1df3('0x3'));var BPromise=require(_0x1df3('0x4'));var rp=require(_0x1df3('0x5'));var fs=require('fs');var path=require(_0x1df3('0x6'));var rimraf=require(_0x1df3('0x7'));var config=require(_0x1df3('0x8'));var attributes=require(_0x1df3('0x9'));module[_0x1df3('0xa')]=function(_0x548ffa,_0x1e31da){return _0x548ffa[_0x1df3('0xb')](_0x1df3('0xc'),attributes,{'tableName':_0x1df3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79ad=['define','util','../../config/logger','api','request-promise','path','./analyticExtractedReport.attributes'];(function(_0x40e0cc,_0x30ef05){var _0x591d5e=function(_0x3cc8d9){while(--_0x3cc8d9){_0x40e0cc['push'](_0x40e0cc['shift']());}};_0x591d5e(++_0x30ef05);}(_0x79ad,0x71));var _0xd79a=function(_0x2101c3,_0x6474a3){_0x2101c3=_0x2101c3-0x0;var _0x4592d6=_0x79ad[_0x2101c3];return _0x4592d6;};'use strict';var _=require('lodash');var util=require(_0xd79a('0x0'));var logger=require(_0xd79a('0x1'))(_0xd79a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd79a('0x3'));var fs=require('fs');var path=require(_0xd79a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd79a('0x5'));module['exports']=function(_0x1ed9f1,_0x45abea){return _0x1ed9f1[_0xd79a('0x6')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 c6460f6..d63cb53 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 _0xce65=['lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch'];(function(_0x6d6eec,_0x2ea010){var _0x32d3=function(_0x96a0ca){while(--_0x96a0ca){_0x6d6eec['push'](_0x6d6eec['shift']());}};_0x32d3(++_0x2ea010);}(_0xce65,0x18f));var _0x5ce6=function(_0x44f2b0,_0x52f2d8){_0x44f2b0=_0x44f2b0-0x0;var _0x1f3062=_0xce65[_0x44f2b0];return _0x1f3062;};'use strict';var _=require(_0x5ce6('0x0'));var util=require('util');var moment=require(_0x5ce6('0x1'));var BPromise=require(_0x5ce6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ce6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ce6('0x4'));var logger=require('../../config/logger')(_0x5ce6('0x5'));var config=require(_0x5ce6('0x6'));var jayson=require(_0x5ce6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x523120,_0x4cd6a0,_0x2934a4){return new BPromise(function(_0x5ab950,_0x261482){return client[_0x5ce6('0x8')](_0x523120,_0x2934a4)[_0x5ce6('0x9')](function(_0x54cc08){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4cd6a0,_0x5ce6('0xa'));logger[_0x5ce6('0xb')](_0x5ce6('0xc'),_0x4cd6a0,_0x5ce6('0xa'),JSON[_0x5ce6('0xd')](_0x54cc08));if(_0x54cc08[_0x5ce6('0xe')]){if(_0x54cc08['error'][_0x5ce6('0xf')]===0x1f4){logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x54cc08[_0x5ce6('0xe')][_0x5ce6('0x11')]);return _0x261482(_0x54cc08[_0x5ce6('0xe')][_0x5ce6('0x11')]);}logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x54cc08['error'][_0x5ce6('0x11')]);return _0x5ab950(_0x54cc08[_0x5ce6('0xe')]['message']);}else{logger['info'](_0x5ce6('0x10'),_0x4cd6a0,'request\x20sent');_0x5ab950(_0x54cc08['result'][_0x5ce6('0x11')]);}})[_0x5ce6('0x12')](function(_0x8c6679){logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x8c6679);_0x261482(_0x8c6679);});});} \ No newline at end of file +var _0x6bdb=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6bdb,0xaf));var _0xb6bd=function(_0x317a98,_0x4fa354){_0x317a98=_0x317a98-0x0;var _0x256419=_0x6bdb[_0x317a98];return _0x256419;};'use strict';var _=require(_0xb6bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6bd('0x1'));var rs=require(_0xb6bd('0x2'));var fs=require('fs');var Redis=require(_0xb6bd('0x3'));var db=require(_0xb6bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6bd('0x5'))('rpc');var config=require(_0xb6bd('0x6'));var jayson=require(_0xb6bd('0x7'));var client=jayson[_0xb6bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec1a4,_0x470e9c,_0xdcc11e){return new BPromise(function(_0x439f08,_0x4a6265){return client[_0xb6bd('0x9')](_0x3ec1a4,_0xdcc11e)[_0xb6bd('0xa')](function(_0x1f5b51){logger[_0xb6bd('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0xb6bd('0xc'));logger[_0xb6bd('0xd')](_0xb6bd('0xe'),_0x470e9c,'request\x20sent',JSON['stringify'](_0x1f5b51));if(_0x1f5b51[_0xb6bd('0xf')]){if(_0x1f5b51[_0xb6bd('0xf')][_0xb6bd('0x10')]===0x1f4){logger[_0xb6bd('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x4a6265(_0x1f5b51[_0xb6bd('0xf')]['message']);}logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x439f08(_0x1f5b51[_0xb6bd('0xf')]['message']);}else{logger['info'](_0xb6bd('0x12'),_0x470e9c,_0xb6bd('0xc'));_0x439f08(_0x1f5b51[_0xb6bd('0x13')]['message']);}})[_0xb6bd('0x14')](function(_0x540606){logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x540606);_0x4a6265(_0x540606);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ca25bd1..c520c85 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 _0xebd9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xebd9,0xdd));var _0x9ebd=function(_0x2dfca0,_0x2de860){_0x2dfca0=_0x2dfca0-0x0;var _0x3a73f1=_0xebd9[_0x2dfca0];return _0x3a73f1;};'use strict';var multer=require(_0x9ebd('0x0'));var util=require(_0x9ebd('0x1'));var path=require(_0x9ebd('0x2'));var timeout=require(_0x9ebd('0x3'));var express=require(_0x9ebd('0x4'));var router=express[_0x9ebd('0x5')]();var fs_extra=require(_0x9ebd('0x6'));var auth=require(_0x9ebd('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x9ebd('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ebd('0x9')]);router[_0x9ebd('0x8')](_0x9ebd('0xa'),auth[_0x9ebd('0xb')](),controller[_0x9ebd('0xc')]);router[_0x9ebd('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x9ebd('0xd')]('/',auth[_0x9ebd('0xb')](),controller[_0x9ebd('0xe')]);router[_0x9ebd('0xf')]('/:id',auth[_0x9ebd('0xb')](),controller[_0x9ebd('0x10')]);router[_0x9ebd('0x11')](_0x9ebd('0xa'),auth['isAuthenticated'](),controller[_0x9ebd('0x12')]);module[_0x9ebd('0x13')]=router; \ No newline at end of file +var _0x4179=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','update','delete','destroy','exports','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4179,0x130));var _0x9417=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4179[_0xe73080];return _0x12cbc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9417('0x0'));var express=require(_0x9417('0x1'));var router=express[_0x9417('0x2')]();var fs_extra=require(_0x9417('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9417('0x4'));var config=require(_0x9417('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x9417('0x6')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0x8')]);router['get'](_0x9417('0x9'),auth['isAuthenticated'](),controller[_0x9417('0xa')]);router[_0x9417('0x6')]('/:id/download',auth[_0x9417('0x7')](),controller[_0x9417('0xb')]);router[_0x9417('0xc')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0xd')]);router['put'](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0xe')]);router[_0x9417('0xf')](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0x10')]);module[_0x9417('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e21e5d0..0092abc 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 _0x4b35=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4eb485,_0x2fa5ae){var _0x220d69=function(_0x5311a3){while(--_0x5311a3){_0x4eb485['push'](_0x4eb485['shift']());}};_0x220d69(++_0x2fa5ae);}(_0x4b35,0x10c));var _0x54b3=function(_0x8fc9d1,_0x55be5e){_0x8fc9d1=_0x8fc9d1-0x0;var _0x445c72=_0x4b35[_0x8fc9d1];return _0x445c72;};'use strict';var Sequelize=require(_0x54b3('0x0'));module[_0x54b3('0x1')]={'field':{'type':Sequelize[_0x54b3('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x54b3('0x3')]},'format':{'type':Sequelize[_0x54b3('0x3')]},'groupBy':{'type':Sequelize[_0x54b3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x54b3('0x3')]},'custom':{'type':Sequelize[_0x54b3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c51=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3c457e,_0x38e123){var _0x21ad50=function(_0x44f76e){while(--_0x44f76e){_0x3c457e['push'](_0x3c457e['shift']());}};_0x21ad50(++_0x38e123);}(_0x6c51,0xd7));var _0x16c5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c51[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x16c5('0x0'));module[_0x16c5('0x1')]={'field':{'type':Sequelize[_0x16c5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x16c5('0x3')]},'groupBy':{'type':Sequelize[_0x16c5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x16c5('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index d3400b0..5c2d05e 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 _0xb0e7=['ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','bulkDestroy'];(function(_0x5d7212,_0x1732eb){var _0xa3ca4b=function(_0x49fbee){while(--_0x49fbee){_0x5d7212['push'](_0x5d7212['shift']());}};_0xa3ca4b(++_0x1732eb);}(_0xb0e7,0x1ec));var _0x7b0e=function(_0x166ea6,_0x5bd371){_0x166ea6=_0x166ea6-0x0;var _0x7fc332=_0xb0e7[_0x166ea6];return _0x7fc332;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b0e('0x0'));var zipdir=require(_0x7b0e('0x1'));var jsonpatch=require(_0x7b0e('0x2'));var rp=require(_0x7b0e('0x3'));var moment=require(_0x7b0e('0x4'));var BPromise=require(_0x7b0e('0x5'));var Mustache=require(_0x7b0e('0x6'));var util=require('util');var path=require(_0x7b0e('0x7'));var sox=require('sox');var csv=require(_0x7b0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0e('0x9'));var _=require(_0x7b0e('0xa'));var squel=require(_0x7b0e('0xb'));var crypto=require(_0x7b0e('0xc'));var jsforce=require(_0x7b0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7b0e('0x8'));var querystring=require(_0x7b0e('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b0e('0xf'));var authService=require(_0x7b0e('0x10'));var qs=require(_0x7b0e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b0e('0x12'))(_0x7b0e('0x13'));var utils=require(_0x7b0e('0x14'));var config=require(_0x7b0e('0x15'));var licenseUtil=require(_0x7b0e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aa600,_0x19b951){_0x19b951=_0x19b951||0xcc;return function(_0x4477ef){if(_0x4477ef){return _0x5aa600[_0x7b0e('0x17')](_0x19b951);}return _0x5aa600['status'](_0x19b951)['end']();};}function respondWithResult(_0x13958a,_0x38ac32){_0x38ac32=_0x38ac32||0xc8;return function(_0x3b26a5){if(_0x3b26a5){return _0x13958a['status'](_0x38ac32)[_0x7b0e('0x18')](_0x3b26a5);}};}function respondWithFilteredResult(_0x1908d0,_0x308621){return function(_0x5357ec){if(_0x5357ec){var _0x1030d0=typeof _0x308621[_0x7b0e('0x19')]==='undefined'&&typeof _0x308621[_0x7b0e('0x1a')]===_0x7b0e('0x1b');var _0x3b6e00=_0x5357ec[_0x7b0e('0x1c')];var _0x466775=_0x1030d0?0x0:_0x308621[_0x7b0e('0x19')];var _0x21de2e=_0x1030d0?_0x5357ec[_0x7b0e('0x1c')]:_0x308621[_0x7b0e('0x19')]+_0x308621[_0x7b0e('0x1a')];var _0x3efea4;if(_0x21de2e>=_0x3b6e00){_0x21de2e=_0x3b6e00;_0x3efea4=0xc8;}else{_0x3efea4=0xce;}_0x1908d0[_0x7b0e('0x1d')](_0x3efea4);return _0x1908d0[_0x7b0e('0x1e')](_0x7b0e('0x1f'),_0x466775+'-'+_0x21de2e+'/'+_0x3b6e00)['json'](_0x5357ec);}return null;};}function patchUpdates(_0x5223c3){return function(_0x1b151c){try{jsonpatch[_0x7b0e('0x20')](_0x1b151c,_0x5223c3,!![]);}catch(_0x1a1354){return BPromise[_0x7b0e('0x21')](_0x1a1354);}return _0x1b151c[_0x7b0e('0x22')]();};}function saveUpdates(_0x5d5749,_0xf096b8){return function(_0x2e9789){if(_0x2e9789){return _0x2e9789[_0x7b0e('0x23')](_0x5d5749)[_0x7b0e('0x24')](function(_0x5a4fd0){return _0x5a4fd0;});}return null;};}function removeEntity(_0x199d00,_0x220525){return function(_0x8f6bd7){if(_0x8f6bd7){return _0x8f6bd7[_0x7b0e('0x25')]()['then'](function(){_0x199d00[_0x7b0e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc60b0,_0x3ab8bf){return function(_0x4ae305){if(!_0x4ae305){_0xbc60b0[_0x7b0e('0x17')](0x194);}return _0x4ae305;};}function handleError(_0x1eb6cd,_0xb3de7f){_0xb3de7f=_0xb3de7f||0x1f4;return function(_0x153738){logger['error'](_0x153738[_0x7b0e('0x26')]);if(_0x153738['name']){delete _0x153738['name'];}_0x1eb6cd[_0x7b0e('0x1d')](_0xb3de7f)[_0x7b0e('0x27')](_0x153738);};}exports[_0x7b0e('0x28')]=function(_0x2d5adc,_0x113979){var _0x112727={},_0x48e749={},_0x2fff80={'count':0x0,'rows':[]};var _0x20221a=_[_0x7b0e('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x481923){return{'name':_0x481923['fieldName'],'type':_0x481923[_0x7b0e('0x2a')][_0x7b0e('0x2b')]};});_0x48e749['model']=_['map'](_0x20221a,_0x7b0e('0x2c'));_0x48e749[_0x7b0e('0x2d')]=_[_0x7b0e('0x2e')](_0x2d5adc['query']);_0x48e749['filters']=_[_0x7b0e('0x2f')](_0x48e749[_0x7b0e('0x30')],_0x48e749['query']);_0x112727[_0x7b0e('0x31')]=_[_0x7b0e('0x2f')](_0x48e749['model'],qs[_0x7b0e('0x32')](_0x2d5adc['query'][_0x7b0e('0x32')]));_0x112727['attributes']=_0x112727['attributes'][_0x7b0e('0x33')]?_0x112727[_0x7b0e('0x31')]:_0x48e749[_0x7b0e('0x30')];if(!_0x2d5adc['query'][_0x7b0e('0x34')](_0x7b0e('0x35'))){_0x112727[_0x7b0e('0x1a')]=qs['limit'](_0x2d5adc[_0x7b0e('0x2d')]['limit']);_0x112727[_0x7b0e('0x19')]=qs['offset'](_0x2d5adc['query'][_0x7b0e('0x19')]);}_0x112727[_0x7b0e('0x36')]=qs[_0x7b0e('0x37')](_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x37')]);_0x112727[_0x7b0e('0x38')]=qs['filters'](_[_0x7b0e('0x39')](_0x2d5adc[_0x7b0e('0x2d')],_0x48e749['filters']),_0x20221a);if(_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3a')]){_0x112727[_0x7b0e('0x38')]=_[_0x7b0e('0x3b')](_0x112727[_0x7b0e('0x38')],{'$or':_[_0x7b0e('0x29')](_0x20221a,function(_0x20c8d0){if(_0x20c8d0[_0x7b0e('0x2a')]!==_0x7b0e('0x3c')){var _0xe69be8={};_0xe69be8[_0x20c8d0[_0x7b0e('0x2c')]]={'$like':'%'+_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3a')]+'%'};return _0xe69be8;}})});}_0x112727=_[_0x7b0e('0x3b')]({},_0x112727,_0x2d5adc[_0x7b0e('0x3d')]);var _0xfbaf2e={'where':_0x112727[_0x7b0e('0x38')]};return db['AnalyticFieldReport'][_0x7b0e('0x1c')](_0xfbaf2e)['then'](function(_0x3717bd){_0x2fff80[_0x7b0e('0x1c')]=_0x3717bd;if(_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3e')]){_0x112727['include']=[{'all':!![]}];}return db[_0x7b0e('0x3f')][_0x7b0e('0x40')](_0x112727);})[_0x7b0e('0x24')](function(_0x2f2486){_0x2fff80[_0x7b0e('0x41')]=_0x2f2486;return _0x2fff80;})[_0x7b0e('0x24')](respondWithFilteredResult(_0x113979,_0x112727))[_0x7b0e('0x42')](handleError(_0x113979,null));};exports[_0x7b0e('0x43')]=function(_0x2828b0,_0x5dbc98){var _0x372402={'raw':![],'where':{'id':_0x2828b0['params']['id']}},_0xc1269c={};_0xc1269c[_0x7b0e('0x30')]=_['keys'](db[_0x7b0e('0x3f')]['rawAttributes']);_0xc1269c[_0x7b0e('0x2d')]=_[_0x7b0e('0x2e')](_0x2828b0[_0x7b0e('0x2d')]);_0xc1269c['filters']=_[_0x7b0e('0x2f')](_0xc1269c['model'],_0xc1269c[_0x7b0e('0x2d')]);_0x372402[_0x7b0e('0x31')]=_[_0x7b0e('0x2f')](_0xc1269c[_0x7b0e('0x30')],qs[_0x7b0e('0x32')](_0x2828b0[_0x7b0e('0x2d')][_0x7b0e('0x32')]));_0x372402[_0x7b0e('0x31')]=_0x372402[_0x7b0e('0x31')][_0x7b0e('0x33')]?_0x372402['attributes']:_0xc1269c[_0x7b0e('0x30')];if(_0x2828b0['query'][_0x7b0e('0x3e')]){_0x372402[_0x7b0e('0x44')]=[{'all':!![]}];}_0x372402=_['merge']({},_0x372402,_0x2828b0[_0x7b0e('0x3d')]);return db[_0x7b0e('0x3f')][_0x7b0e('0x45')](_0x372402)[_0x7b0e('0x24')](handleEntityNotFound(_0x5dbc98,null))['then'](respondWithResult(_0x5dbc98,null))['catch'](handleError(_0x5dbc98,null));};exports[_0x7b0e('0x46')]=function(_0x29e82b,_0x4badbd){return db[_0x7b0e('0x3f')][_0x7b0e('0x46')](_0x29e82b[_0x7b0e('0x47')],{})[_0x7b0e('0x24')](respondWithResult(_0x4badbd,0xc9))[_0x7b0e('0x42')](handleError(_0x4badbd,null));};exports[_0x7b0e('0x48')]=function(_0x416ef4,_0x9bbbeb){return db[_0x7b0e('0x3f')][_0x7b0e('0x48')](_0x416ef4[_0x7b0e('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9bbbeb,0xc9))[_0x7b0e('0x42')](handleError(_0x9bbbeb,null));};exports[_0x7b0e('0x23')]=function(_0x980cf8,_0x45489e){if(_0x980cf8[_0x7b0e('0x47')]['id']){delete _0x980cf8[_0x7b0e('0x47')]['id'];}return db[_0x7b0e('0x3f')][_0x7b0e('0x45')]({'where':{'id':_0x980cf8[_0x7b0e('0x49')]['id']}})[_0x7b0e('0x24')](handleEntityNotFound(_0x45489e,null))[_0x7b0e('0x24')](saveUpdates(_0x980cf8[_0x7b0e('0x47')],null))[_0x7b0e('0x24')](respondWithResult(_0x45489e,null))[_0x7b0e('0x42')](handleError(_0x45489e,null));};exports[_0x7b0e('0x25')]=function(_0x26ab10,_0x51a778){return db[_0x7b0e('0x3f')][_0x7b0e('0x45')]({'where':{'id':_0x26ab10[_0x7b0e('0x49')]['id']}})[_0x7b0e('0x24')](handleEntityNotFound(_0x51a778,null))[_0x7b0e('0x24')](removeEntity(_0x51a778,null))[_0x7b0e('0x42')](handleError(_0x51a778,null));};exports[_0x7b0e('0x4a')]=function(_0x481f51,_0x269ac5){return db[_0x7b0e('0x3f')][_0x7b0e('0x25')]({'where':{'id':_0x481f51[_0x7b0e('0x2d')][_0x7b0e('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7b0e('0x24')](respondWithResult(_0x269ac5,0xcc))['catch'](handleError(_0x269ac5,null));};exports['addFields']=function(_0x526226,_0x1cb914,_0x280374){return db[_0x7b0e('0x4c')][_0x7b0e('0x4d')]({'where':{'id':_0x526226[_0x7b0e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1cb914,null))['then'](function(_0x54cc7f){if(_0x54cc7f){return db[_0x7b0e('0x4e')][_0x7b0e('0x4f')](function(_0x5c6838){return db[_0x7b0e('0x3f')][_0x7b0e('0x25')]({'where':{'CustomReportId':_0x526226[_0x7b0e('0x49')]['id']},'transaction':_0x5c6838})[_0x7b0e('0x24')](function(_0x51429c){var _0x1201f4=_[_0x7b0e('0x29')](_0x526226[_0x7b0e('0x47')],function(_0x10b500){delete _0x10b500['id'];_0x10b500[_0x7b0e('0x50')]=_0x526226[_0x7b0e('0x49')]['id'];return _0x10b500;});return db[_0x7b0e('0x3f')][_0x7b0e('0x48')](_0x1201f4,{'transaction':_0x5c6838});});})['then'](function(){return db[_0x7b0e('0x3f')][_0x7b0e('0x40')]({'where':{'CustomReportId':_0x526226[_0x7b0e('0x49')]['id']}});});}})[_0x7b0e('0x24')](respondWithResult(_0x1cb914,null))[_0x7b0e('0x42')](handleError(_0x1cb914,null));}; \ No newline at end of file +var _0x64d9=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','then','rows','show','params','keys','include','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','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/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name'];(function(_0x29be44,_0x4f38b5){var _0x54394e=function(_0x214df0){while(--_0x214df0){_0x29be44['push'](_0x29be44['shift']());}};_0x54394e(++_0x4f38b5);}(_0x64d9,0x83));var _0x964d=function(_0x3d387e,_0x4ddac8){_0x3d387e=_0x3d387e-0x0;var _0x32b303=_0x64d9[_0x3d387e];return _0x32b303;};'use strict';var emlformat=require(_0x964d('0x0'));var rimraf=require(_0x964d('0x1'));var zipdir=require(_0x964d('0x2'));var jsonpatch=require(_0x964d('0x3'));var rp=require(_0x964d('0x4'));var moment=require(_0x964d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x964d('0x6'));var util=require(_0x964d('0x7'));var path=require('path');var sox=require(_0x964d('0x8'));var csv=require('to-csv');var ejs=require(_0x964d('0x9'));var fs=require('fs');var fs_extra=require(_0x964d('0xa'));var _=require(_0x964d('0xb'));var squel=require(_0x964d('0xc'));var crypto=require(_0x964d('0xd'));var jsforce=require(_0x964d('0xe'));var deskjs=require(_0x964d('0xf'));var toCsv=require(_0x964d('0x10'));var querystring=require(_0x964d('0x11'));var Papa=require(_0x964d('0x12'));var Redis=require(_0x964d('0x13'));var authService=require(_0x964d('0x14'));var qs=require(_0x964d('0x15'));var as=require(_0x964d('0x16'));var hardwareService=require(_0x964d('0x17'));var logger=require('../../config/logger')(_0x964d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x964d('0x19'));var db=require(_0x964d('0x1a'))['db'];function respondWithStatusCode(_0x24e3ad,_0x481fb9){_0x481fb9=_0x481fb9||0xcc;return function(_0x104d2e){if(_0x104d2e){return _0x24e3ad[_0x964d('0x1b')](_0x481fb9);}return _0x24e3ad[_0x964d('0x1c')](_0x481fb9)[_0x964d('0x1d')]();};}function respondWithResult(_0x493a13,_0xf7fc96){_0xf7fc96=_0xf7fc96||0xc8;return function(_0x2b7346){if(_0x2b7346){return _0x493a13[_0x964d('0x1c')](_0xf7fc96)['json'](_0x2b7346);}};}function respondWithFilteredResult(_0x12f014,_0x57ebaa){return function(_0x4a6920){if(_0x4a6920){var _0x196397=typeof _0x57ebaa['offset']==='undefined'&&typeof _0x57ebaa[_0x964d('0x1e')]===_0x964d('0x1f');var _0x486342=_0x4a6920['count'];var _0x569e97=_0x196397?0x0:_0x57ebaa[_0x964d('0x20')];var _0x59d02a=_0x196397?_0x4a6920[_0x964d('0x21')]:_0x57ebaa[_0x964d('0x20')]+_0x57ebaa[_0x964d('0x1e')];var _0x5d4544;if(_0x59d02a>=_0x486342){_0x59d02a=_0x486342;_0x5d4544=0xc8;}else{_0x5d4544=0xce;}_0x12f014['status'](_0x5d4544);return _0x12f014[_0x964d('0x22')](_0x964d('0x23'),_0x569e97+'-'+_0x59d02a+'/'+_0x486342)[_0x964d('0x24')](_0x4a6920);}return null;};}function patchUpdates(_0x3d02cf){return function(_0x3e734a){try{jsonpatch[_0x964d('0x25')](_0x3e734a,_0x3d02cf,!![]);}catch(_0x2526af){return BPromise[_0x964d('0x26')](_0x2526af);}return _0x3e734a[_0x964d('0x27')]();};}function saveUpdates(_0x4d4e0f,_0x264b94){return function(_0x35eab5){if(_0x35eab5){return _0x35eab5[_0x964d('0x28')](_0x4d4e0f)['then'](function(_0x4d9d62){return _0x4d9d62;});}return null;};}function removeEntity(_0x4f1899,_0x35524c){return function(_0x4d177b){if(_0x4d177b){return _0x4d177b[_0x964d('0x29')]()['then'](function(){_0x4f1899[_0x964d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a680,_0x22b0b7){return function(_0x4d6a75){if(!_0x4d6a75){_0x34a680[_0x964d('0x1b')](0x194);}return _0x4d6a75;};}function handleError(_0x57eda6,_0xe85011){_0xe85011=_0xe85011||0x1f4;return function(_0x1b169e){logger[_0x964d('0x2a')](_0x1b169e[_0x964d('0x2b')]);if(_0x1b169e[_0x964d('0x2c')]){delete _0x1b169e[_0x964d('0x2c')];}_0x57eda6[_0x964d('0x1c')](_0xe85011)[_0x964d('0x2d')](_0x1b169e);};}exports[_0x964d('0x2e')]=function(_0x3798fe,_0x4f0e1b){var _0x198b8a={},_0x3b7bbe={},_0x5465a9={'count':0x0,'rows':[]};var _0x7e5d5=_[_0x964d('0x2f')](db[_0x964d('0x30')][_0x964d('0x31')],function(_0x5f5979){return{'name':_0x5f5979[_0x964d('0x32')],'type':_0x5f5979[_0x964d('0x33')]['key']};});_0x3b7bbe['model']=_[_0x964d('0x2f')](_0x7e5d5,_0x964d('0x2c'));_0x3b7bbe[_0x964d('0x34')]=_['keys'](_0x3798fe[_0x964d('0x34')]);_0x3b7bbe[_0x964d('0x35')]=_[_0x964d('0x36')](_0x3b7bbe[_0x964d('0x37')],_0x3b7bbe['query']);_0x198b8a['attributes']=_['intersection'](_0x3b7bbe[_0x964d('0x37')],qs[_0x964d('0x38')](_0x3798fe[_0x964d('0x34')][_0x964d('0x38')]));_0x198b8a[_0x964d('0x39')]=_0x198b8a[_0x964d('0x39')][_0x964d('0x3a')]?_0x198b8a[_0x964d('0x39')]:_0x3b7bbe[_0x964d('0x37')];if(!_0x3798fe[_0x964d('0x34')][_0x964d('0x3b')](_0x964d('0x3c'))){_0x198b8a[_0x964d('0x1e')]=qs[_0x964d('0x1e')](_0x3798fe[_0x964d('0x34')][_0x964d('0x1e')]);_0x198b8a[_0x964d('0x20')]=qs['offset'](_0x3798fe[_0x964d('0x34')]['offset']);}_0x198b8a['order']=qs['sort'](_0x3798fe[_0x964d('0x34')][_0x964d('0x3d')]);_0x198b8a['where']=qs[_0x964d('0x35')](_[_0x964d('0x3e')](_0x3798fe[_0x964d('0x34')],_0x3b7bbe[_0x964d('0x35')]),_0x7e5d5);if(_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]){_0x198b8a[_0x964d('0x40')]=_['merge'](_0x198b8a[_0x964d('0x40')],{'$or':_[_0x964d('0x2f')](_0x7e5d5,function(_0x525b1a){if(_0x525b1a[_0x964d('0x33')]!==_0x964d('0x41')){var _0x4b2b64={};_0x4b2b64[_0x525b1a[_0x964d('0x2c')]]={'$like':'%'+_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]+'%'};return _0x4b2b64;}})});}_0x198b8a=_[_0x964d('0x42')]({},_0x198b8a,_0x3798fe['options']);var _0x5c1a6f={'where':_0x198b8a[_0x964d('0x40')]};return db['AnalyticFieldReport'][_0x964d('0x21')](_0x5c1a6f)['then'](function(_0xf6d465){_0x5465a9[_0x964d('0x21')]=_0xf6d465;if(_0x3798fe[_0x964d('0x34')][_0x964d('0x43')]){_0x198b8a['include']=[{'all':!![]}];}return db[_0x964d('0x30')][_0x964d('0x44')](_0x198b8a);})[_0x964d('0x45')](function(_0xf9a1d9){_0x5465a9[_0x964d('0x46')]=_0xf9a1d9;return _0x5465a9;})[_0x964d('0x45')](respondWithFilteredResult(_0x4f0e1b,_0x198b8a))['catch'](handleError(_0x4f0e1b,null));};exports[_0x964d('0x47')]=function(_0x30a313,_0x50ba89){var _0x1cbb78={'raw':![],'where':{'id':_0x30a313[_0x964d('0x48')]['id']}},_0xf1d365={};_0xf1d365[_0x964d('0x37')]=_[_0x964d('0x49')](db['AnalyticFieldReport']['rawAttributes']);_0xf1d365[_0x964d('0x34')]=_['keys'](_0x30a313[_0x964d('0x34')]);_0xf1d365[_0x964d('0x35')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],_0xf1d365[_0x964d('0x34')]);_0x1cbb78[_0x964d('0x39')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],qs[_0x964d('0x38')](_0x30a313[_0x964d('0x34')][_0x964d('0x38')]));_0x1cbb78[_0x964d('0x39')]=_0x1cbb78[_0x964d('0x39')][_0x964d('0x3a')]?_0x1cbb78['attributes']:_0xf1d365[_0x964d('0x37')];if(_0x30a313[_0x964d('0x34')][_0x964d('0x43')]){_0x1cbb78[_0x964d('0x4a')]=[{'all':!![]}];}_0x1cbb78=_[_0x964d('0x42')]({},_0x1cbb78,_0x30a313[_0x964d('0x4b')]);return db[_0x964d('0x30')][_0x964d('0x4c')](_0x1cbb78)[_0x964d('0x45')](handleEntityNotFound(_0x50ba89,null))[_0x964d('0x45')](respondWithResult(_0x50ba89,null))[_0x964d('0x4d')](handleError(_0x50ba89,null));};exports[_0x964d('0x4e')]=function(_0x57abbf,_0x5d602c){return db[_0x964d('0x30')]['create'](_0x57abbf[_0x964d('0x4f')],{})[_0x964d('0x45')](respondWithResult(_0x5d602c,0xc9))[_0x964d('0x4d')](handleError(_0x5d602c,null));};exports[_0x964d('0x50')]=function(_0x18d0cc,_0x46fc15){return db['AnalyticFieldReport'][_0x964d('0x50')](_0x18d0cc[_0x964d('0x4f')],{'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x46fc15,0xc9))['catch'](handleError(_0x46fc15,null));};exports[_0x964d('0x28')]=function(_0x5ed76b,_0x1012ff){if(_0x5ed76b['body']['id']){delete _0x5ed76b['body']['id'];}return db[_0x964d('0x30')]['find']({'where':{'id':_0x5ed76b['params']['id']}})[_0x964d('0x45')](handleEntityNotFound(_0x1012ff,null))[_0x964d('0x45')](saveUpdates(_0x5ed76b[_0x964d('0x4f')],null))[_0x964d('0x45')](respondWithResult(_0x1012ff,null))['catch'](handleError(_0x1012ff,null));};exports['destroy']=function(_0x573d50,_0x23e809){return db[_0x964d('0x30')][_0x964d('0x4c')]({'where':{'id':_0x573d50[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e809,null))[_0x964d('0x45')](removeEntity(_0x23e809,null))['catch'](handleError(_0x23e809,null));};exports[_0x964d('0x51')]=function(_0x57a58c,_0x13fc30){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'id':_0x57a58c[_0x964d('0x34')][_0x964d('0x52')]||[]},'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x13fc30,0xcc))[_0x964d('0x4d')](handleError(_0x13fc30,null));};exports[_0x964d('0x53')]=function(_0x59b54a,_0x2fbe64,_0x3cb75d){return db[_0x964d('0x54')][_0x964d('0x55')]({'where':{'id':_0x59b54a[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fbe64,null))[_0x964d('0x45')](function(_0x4866bc){if(_0x4866bc){return db['sequelize'][_0x964d('0x56')](function(_0x3b6c1d){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'CustomReportId':_0x59b54a[_0x964d('0x48')]['id']},'transaction':_0x3b6c1d})['then'](function(_0x26413d){var _0x675de5=_[_0x964d('0x2f')](_0x59b54a[_0x964d('0x4f')],function(_0x130c68){delete _0x130c68['id'];_0x130c68[_0x964d('0x57')]=_0x59b54a[_0x964d('0x48')]['id'];return _0x130c68;});return db[_0x964d('0x30')][_0x964d('0x50')](_0x675de5,{'transaction':_0x3b6c1d});});})['then'](function(){return db[_0x964d('0x30')][_0x964d('0x44')]({'where':{'CustomReportId':_0x59b54a['params']['id']}});});}})[_0x964d('0x45')](respondWithResult(_0x2fbe64,null))['catch'](handleError(_0x2fbe64,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3017505..6d663fc 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 _0x49b0=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','util','api'];(function(_0x2a367f,_0x871e8e){var _0x12cfad=function(_0x558fb6){while(--_0x558fb6){_0x2a367f['push'](_0x2a367f['shift']());}};_0x12cfad(++_0x871e8e);}(_0x49b0,0x1ca));var _0x049b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x049b('0x0'));var logger=require('../../config/logger')(_0x049b('0x1'));var moment=require(_0x049b('0x2'));var BPromise=require(_0x049b('0x3'));var rp=require(_0x049b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x049b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x049b('0x6')]=function(_0x28641a,_0x450dba){return _0x28641a[_0x049b('0x7')](_0x049b('0x8'),attributes,{'tableName':_0x049b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01f2=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x01f2,0x1c4));var _0x201f=function(_0x352174,_0x39fd8a){_0x352174=_0x352174-0x0;var _0x3ab398=_0x01f2[_0x352174];return _0x3ab398;};'use strict';var _=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var logger=require(_0x201f('0x2'))(_0x201f('0x3'));var moment=require(_0x201f('0x4'));var BPromise=require(_0x201f('0x5'));var rp=require(_0x201f('0x6'));var fs=require('fs');var path=require(_0x201f('0x7'));var rimraf=require(_0x201f('0x8'));var config=require(_0x201f('0x9'));var attributes=require(_0x201f('0xa'));module[_0x201f('0xb')]=function(_0x528562,_0x201b8b){return _0x528562['define'](_0x201f('0xc'),attributes,{'tableName':_0x201f('0xd'),'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 42ae159..7f5132a 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 _0xbf89=['AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0xbf89,0xfc));var _0x9bf8=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0xbf89[_0x5da54c];return _0x1246b0;};'use strict';var _=require(_0x9bf8('0x0'));var util=require('util');var moment=require(_0x9bf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x9bf8('0x2'));var fs=require('fs');var Redis=require(_0x9bf8('0x3'));var db=require(_0x9bf8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9bf8('0x5'));var config=require(_0x9bf8('0x6'));var jayson=require(_0x9bf8('0x7'));var client=jayson[_0x9bf8('0x8')][_0x9bf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21764e,_0x3ff793,_0x113f1d){return new BPromise(function(_0x3453a7,_0x13534c){return client[_0x9bf8('0xa')](_0x21764e,_0x113f1d)[_0x9bf8('0xb')](function(_0x598b99){logger['info'](_0x9bf8('0xc'),_0x3ff793,'request\x20sent');logger[_0x9bf8('0xd')](_0x9bf8('0xe'),_0x3ff793,_0x9bf8('0xf'),JSON[_0x9bf8('0x10')](_0x598b99));if(_0x598b99[_0x9bf8('0x11')]){if(_0x598b99[_0x9bf8('0x11')]['code']===0x1f4){logger[_0x9bf8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ff793,_0x598b99['error']['message']);return _0x13534c(_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);}logger[_0x9bf8('0x11')](_0x9bf8('0xc'),_0x3ff793,_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);return _0x3453a7(_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);}else{logger[_0x9bf8('0x13')](_0x9bf8('0xc'),_0x3ff793,'request\x20sent');_0x3453a7(_0x598b99[_0x9bf8('0x14')][_0x9bf8('0x12')]);}})[_0x9bf8('0x15')](function(_0x14e9ac){logger[_0x9bf8('0x11')](_0x9bf8('0xc'),_0x3ff793,_0x14e9ac);_0x13534c(_0x14e9ac);});});} \ No newline at end of file +var _0x10a7=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0x10a7,0x182));var _0x710a=function(_0x2d49f7,_0x3fcac1){_0x2d49f7=_0x2d49f7-0x0;var _0x56e5b1=_0x10a7[_0x2d49f7];return _0x56e5b1;};'use strict';var _=require(_0x710a('0x0'));var util=require(_0x710a('0x1'));var moment=require(_0x710a('0x2'));var BPromise=require('bluebird');var rs=require(_0x710a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710a('0x4'))['db'];var utils=require(_0x710a('0x5'));var logger=require('../../config/logger')(_0x710a('0x6'));var config=require('../../config/environment');var jayson=require(_0x710a('0x7'));var client=jayson[_0x710a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf5f51,_0x3e7412,_0x61042a){return new BPromise(function(_0x25a894,_0x1cfb83){return client[_0x710a('0x9')](_0xaf5f51,_0x61042a)[_0x710a('0xa')](function(_0x239e5e){logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));logger[_0x710a('0xe')](_0x710a('0xf'),_0x3e7412,'request\x20sent',JSON['stringify'](_0x239e5e));if(_0x239e5e[_0x710a('0x10')]){if(_0x239e5e[_0x710a('0x10')]['code']===0x1f4){logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x1cfb83(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x25a894(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}else{logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));_0x25a894(_0x239e5e[_0x710a('0x12')]['message']);}})[_0x710a('0x13')](function(_0x10c464){logger['error'](_0x710a('0xc'),_0x3e7412,_0x10c464);_0x1cfb83(_0x10c464);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c9f0d65..38ba2f8 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(_0x4eaa87,_0x51d135){var _0x104466=function(_0x585136){while(--_0x585136){_0x4eaa87['push'](_0x4eaa87['shift']());}};_0x104466(++_0x51d135);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x4cf0a1,_0x126c6e){var _0x533a44=function(_0x3c379a){while(--_0x3c379a){_0x4cf0a1['push'](_0x4cf0a1['shift']());}};_0x533a44(++_0x126c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 b058376..e891d05 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 _0xf323=['TEXT','STRING','name'];(function(_0x575440,_0x3684bb){var _0x54a41b=function(_0x451bcd){while(--_0x451bcd){_0x575440['push'](_0x575440['shift']());}};_0x54a41b(++_0x3684bb);}(_0xf323,0x1c6));var _0x3f32=function(_0x5ef262,_0x5480db){_0x5ef262=_0x5ef262-0x0;var _0x1e82b0=_0xf323[_0x5ef262];return _0x1e82b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3f32('0x0')],'allowNull':![],'unique':_0x3f32('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x3f32('0x2')]},'description':{'type':Sequelize[_0x3f32('0x0')]}}; \ No newline at end of file +var _0x2116=['name','STRING','TEXT','exports'];(function(_0x564801,_0x2ff0e2){var _0x10bb38=function(_0x14681a){while(--_0x14681a){_0x564801['push'](_0x564801['shift']());}};_0x10bb38(++_0x2ff0e2);}(_0x2116,0x67));var _0x6211=function(_0x773787,_0x269f85){_0x773787=_0x773787-0x0;var _0x7b67e3=_0x2116[_0x773787];return _0x7b67e3;};'use strict';var Sequelize=require('sequelize');module[_0x6211('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6211('0x1')},'table':{'type':Sequelize[_0x6211('0x2')]},'metric':{'type':Sequelize[_0x6211('0x3')]},'description':{'type':Sequelize[_0x6211('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 92b6a60..1ed5408 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1ac269,_0x3c0b34){var _0x4ac556=function(_0x4076f3){while(--_0x4076f3){_0x1ac269['push'](_0x1ac269['shift']());}};_0x4ac556(++_0x3c0b34);}(_0xdc97,0x13b));var _0x7dc9=function(_0x115411,_0x592d33){_0x115411=_0x115411-0x0;var _0x38bb7a=_0xdc97[_0x115411];return _0x38bb7a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x245044,_0x4c6022){var _0x3fac56=function(_0x138a1b){while(--_0x138a1b){_0x245044['push'](_0x245044['shift']());}};_0x3fac56(++_0x4c6022);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ae949de..7e76f45 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 _0x2d2c=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash','util'];(function(_0x4bfe34,_0x21c0a7){var _0x2c1e1e=function(_0x3f6c9e){while(--_0x3f6c9e){_0x4bfe34['push'](_0x4bfe34['shift']());}};_0x2c1e1e(++_0x21c0a7);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0xd685e,_0x360045){_0xd685e=_0xd685e-0x0;var _0x5ef5e0=_0x2d2c[_0xd685e];return _0x5ef5e0;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var logger=require(_0xc2d2('0x2'))(_0xc2d2('0x3'));var moment=require(_0xc2d2('0x4'));var BPromise=require(_0xc2d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2d2('0x6'));var rimraf=require('rimraf');var config=require(_0xc2d2('0x7'));var attributes=require(_0xc2d2('0x8'));module[_0xc2d2('0x9')]=function(_0x45ad0c,_0xe9cf0e){return _0x45ad0c['define']('AnalyticMetric',attributes,{'tableName':_0xc2d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbccd=['lodash','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x3423ff,_0x2b56c9){var _0x5c00bc=function(_0x28cdd1){while(--_0x28cdd1){_0x3423ff['push'](_0x3423ff['shift']());}};_0x5c00bc(++_0x2b56c9);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbccd[_0x279d37];return _0x530173;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbcc('0x1'));var moment=require(_0xdbcc('0x2'));var BPromise=require(_0xdbcc('0x3'));var rp=require(_0xdbcc('0x4'));var fs=require('fs');var path=require(_0xdbcc('0x5'));var rimraf=require(_0xdbcc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbcc('0x7'));module[_0xdbcc('0x8')]=function(_0x9cca7a,_0x2997fd){return _0x9cca7a[_0xdbcc('0x9')](_0xdbcc('0xa'),attributes,{'tableName':_0xdbcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 301dbac..01ccf6c 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 _0x7bac=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then'];(function(_0x473d70,_0x459c26){var _0x19314f=function(_0x43c644){while(--_0x43c644){_0x473d70['push'](_0x473d70['shift']());}};_0x19314f(++_0x459c26);}(_0x7bac,0xc6));var _0xc7ba=function(_0x5c5b0c,_0x386ea2){_0x5c5b0c=_0x5c5b0c-0x0;var _0x1f2660=_0x7bac[_0x5c5b0c];return _0x1f2660;};'use strict';var _=require(_0xc7ba('0x0'));var util=require(_0xc7ba('0x1'));var moment=require(_0xc7ba('0x2'));var BPromise=require(_0xc7ba('0x3'));var rs=require(_0xc7ba('0x4'));var fs=require('fs');var Redis=require(_0xc7ba('0x5'));var db=require(_0xc7ba('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc7ba('0x7'));var jayson=require(_0xc7ba('0x8'));var client=jayson[_0xc7ba('0x9')][_0xc7ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16b2c9,_0x575302,_0x309aff){return new BPromise(function(_0x15dcc5,_0x4e1e88){return client['request'](_0x16b2c9,_0x309aff)[_0xc7ba('0xb')](function(_0x2c52fd){logger[_0xc7ba('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,_0xc7ba('0xd'));logger[_0xc7ba('0xe')](_0xc7ba('0xf'),_0x575302,_0xc7ba('0xd'),JSON['stringify'](_0x2c52fd));if(_0x2c52fd[_0xc7ba('0x10')]){if(_0x2c52fd[_0xc7ba('0x10')]['code']===0x1f4){logger[_0xc7ba('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);return _0x4e1e88(_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);}logger[_0xc7ba('0x10')](_0xc7ba('0x12'),_0x575302,_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);return _0x15dcc5(_0x2c52fd['error'][_0xc7ba('0x11')]);}else{logger[_0xc7ba('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,'request\x20sent');_0x15dcc5(_0x2c52fd[_0xc7ba('0x13')][_0xc7ba('0x11')]);}})[_0xc7ba('0x14')](function(_0x26aa4b){logger[_0xc7ba('0x10')](_0xc7ba('0x12'),_0x575302,_0x26aa4b);_0x4e1e88(_0x26aa4b);});});} \ No newline at end of file +var _0x0475=['AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x0475,0xdb));var _0x5047=function(_0x3b0796,_0x3d5382){_0x3b0796=_0x3b0796-0x0;var _0x1bf181=_0x0475[_0x3b0796];return _0x1bf181;};'use strict';var _=require(_0x5047('0x0'));var util=require('util');var moment=require(_0x5047('0x1'));var BPromise=require(_0x5047('0x2'));var rs=require(_0x5047('0x3'));var fs=require('fs');var Redis=require(_0x5047('0x4'));var db=require(_0x5047('0x5'))['db'];var utils=require(_0x5047('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5047('0x7'));var jayson=require(_0x5047('0x8'));var client=jayson[_0x5047('0x9')][_0x5047('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f5db2,_0x4c762a,_0x44b8d6){return new BPromise(function(_0x58a239,_0x512fb9){return client[_0x5047('0xb')](_0x1f5db2,_0x44b8d6)['then'](function(_0x551912){logger['info'](_0x5047('0xc'),_0x4c762a,'request\x20sent');logger[_0x5047('0xd')](_0x5047('0xe'),_0x4c762a,_0x5047('0xf'),JSON[_0x5047('0x10')](_0x551912));if(_0x551912['error']){if(_0x551912[_0x5047('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,_0x551912[_0x5047('0x11')]['message']);return _0x512fb9(_0x551912['error'][_0x5047('0x12')]);}logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x551912[_0x5047('0x11')][_0x5047('0x12')]);return _0x58a239(_0x551912[_0x5047('0x11')][_0x5047('0x12')]);}else{logger[_0x5047('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,'request\x20sent');_0x58a239(_0x551912[_0x5047('0x14')][_0x5047('0x12')]);}})['catch'](function(_0x31193e){logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x31193e);_0x512fb9(_0x31193e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index b0d6c68..121732c 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 _0x34e7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x146e25,_0x190400){var _0x2661a8=function(_0x15ed40){while(--_0x15ed40){_0x146e25['push'](_0x146e25['shift']());}};_0x2661a8(++_0x190400);}(_0x34e7,0x164));var _0x734e=function(_0x5e7913,_0x3d4099){_0x5e7913=_0x5e7913-0x0;var _0x1d50a2=_0x34e7[_0x5e7913];return _0x1d50a2;};'use strict';var multer=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var path=require(_0x734e('0x2'));var timeout=require(_0x734e('0x3'));var express=require(_0x734e('0x4'));var router=express[_0x734e('0x5')]();var fs_extra=require(_0x734e('0x6'));var auth=require(_0x734e('0x7'));var interaction=require(_0x734e('0x8'));var config=require(_0x734e('0x9'));var controller=require(_0x734e('0xa'));router[_0x734e('0xb')]('/',auth[_0x734e('0xc')](),controller[_0x734e('0xd')]);router['get'](_0x734e('0xe'),auth[_0x734e('0xc')](),controller[_0x734e('0xf')]);router['post']('/',auth[_0x734e('0xc')](),controller['create']);router[_0x734e('0x10')](_0x734e('0xe'),auth[_0x734e('0xc')](),controller[_0x734e('0x11')]);router[_0x734e('0x12')](_0x734e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x734e('0x13')]=router; \ No newline at end of file +var _0x2cd3=['/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x3de16a,_0x3b9e39){var _0x33d96f=function(_0x578566){while(--_0x578566){_0x3de16a['push'](_0x3de16a['shift']());}};_0x33d96f(++_0x3b9e39);}(_0x2cd3,0xf1));var _0x32cd=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x2cd3[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x32cd('0x0'));var util=require('util');var path=require(_0x32cd('0x1'));var timeout=require(_0x32cd('0x2'));var express=require(_0x32cd('0x3'));var router=express[_0x32cd('0x4')]();var fs_extra=require(_0x32cd('0x5'));var auth=require(_0x32cd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32cd('0x7'));router[_0x32cd('0x8')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xa')]);router[_0x32cd('0x8')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0xc')]);router[_0x32cd('0xd')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xe')]);router[_0x32cd('0xf')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x10')]);router[_0x32cd('0x11')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f324e39..7a69cbd 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 _0x53de=['TEXT','exports'];(function(_0x4ab6cd,_0x2edbdd){var _0x289ccb=function(_0x547651){while(--_0x547651){_0x4ab6cd['push'](_0x4ab6cd['shift']());}};_0x289ccb(++_0x2edbdd);}(_0x53de,0x151));var _0xe53d=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x53de[_0x5d6270];return _0x168f26;};'use strict';var Sequelize=require('sequelize');module[_0xe53d('0x0')]={'tree':{'type':Sequelize[_0xe53d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc530=['exports','sequelize'];(function(_0x582a19,_0x34dbbf){var _0x50fa01=function(_0x470ab0){while(--_0x470ab0){_0x582a19['push'](_0x582a19['shift']());}};_0x50fa01(++_0x34dbbf);}(_0xc530,0x157));var _0x0c53=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xc530[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require(_0x0c53('0x0'));module[_0x0c53('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 52e7f80..c69cba5 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 _0x469f=['length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','rows','show','intersection','options','find','catch','create','body','update','params','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','offset','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields'];(function(_0x1cb376,_0xd7b3a3){var _0x2792a8=function(_0x47b416){while(--_0x47b416){_0x1cb376['push'](_0x1cb376['shift']());}};_0x2792a8(++_0xd7b3a3);}(_0x469f,0x188));var _0xf469=function(_0x1c7002,_0x17e2c3){_0x1c7002=_0x1c7002-0x0;var _0x4af787=_0x469f[_0x1c7002];return _0x4af787;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf469('0x0'));var zipdir=require(_0xf469('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf469('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf469('0x3'));var util=require(_0xf469('0x4'));var path=require(_0xf469('0x5'));var sox=require(_0xf469('0x6'));var csv=require('to-csv');var ejs=require(_0xf469('0x7'));var fs=require('fs');var fs_extra=require(_0xf469('0x8'));var _=require(_0xf469('0x9'));var squel=require(_0xf469('0xa'));var crypto=require('crypto');var jsforce=require(_0xf469('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf469('0xc'));var querystring=require(_0xf469('0xd'));var Papa=require(_0xf469('0xe'));var Redis=require(_0xf469('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf469('0x10'));var as=require(_0xf469('0x11'));var hardwareService=require(_0xf469('0x12'));var logger=require('../../config/logger')(_0xf469('0x13'));var utils=require(_0xf469('0x14'));var config=require(_0xf469('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4488a5,_0x17dadf){_0x17dadf=_0x17dadf||0xcc;return function(_0x5ad6f7){if(_0x5ad6f7){return _0x4488a5['sendStatus'](_0x17dadf);}return _0x4488a5['status'](_0x17dadf)['end']();};}function respondWithResult(_0x4010bd,_0x54cb3e){_0x54cb3e=_0x54cb3e||0xc8;return function(_0x4f1d2f){if(_0x4f1d2f){return _0x4010bd['status'](_0x54cb3e)['json'](_0x4f1d2f);}};}function respondWithFilteredResult(_0x5a98cb,_0x3ba49e){return function(_0x136a81){if(_0x136a81){var _0x274508=typeof _0x3ba49e[_0xf469('0x16')]==='undefined'&&typeof _0x3ba49e[_0xf469('0x17')]==='undefined';var _0x1c3178=_0x136a81[_0xf469('0x18')];var _0x288cec=_0x274508?0x0:_0x3ba49e['offset'];var _0x2f579f=_0x274508?_0x136a81[_0xf469('0x18')]:_0x3ba49e['offset']+_0x3ba49e[_0xf469('0x17')];var _0x268760;if(_0x2f579f>=_0x1c3178){_0x2f579f=_0x1c3178;_0x268760=0xc8;}else{_0x268760=0xce;}_0x5a98cb[_0xf469('0x19')](_0x268760);return _0x5a98cb[_0xf469('0x1a')](_0xf469('0x1b'),_0x288cec+'-'+_0x2f579f+'/'+_0x1c3178)[_0xf469('0x1c')](_0x136a81);}return null;};}function patchUpdates(_0x591da1){return function(_0x318df5){try{jsonpatch[_0xf469('0x1d')](_0x318df5,_0x591da1,!![]);}catch(_0xebb6b3){return BPromise[_0xf469('0x1e')](_0xebb6b3);}return _0x318df5[_0xf469('0x1f')]();};}function saveUpdates(_0x60a4aa,_0x4a28c3){return function(_0x103b46){if(_0x103b46){return _0x103b46['update'](_0x60a4aa)[_0xf469('0x20')](function(_0xa7e823){return _0xa7e823;});}return null;};}function removeEntity(_0x4ad781,_0x170e88){return function(_0x34a1d1){if(_0x34a1d1){return _0x34a1d1[_0xf469('0x21')]()[_0xf469('0x20')](function(){_0x4ad781[_0xf469('0x19')](0xcc)[_0xf469('0x22')]();});}};}function handleEntityNotFound(_0x2dcf0c,_0x359dd2){return function(_0x46455b){if(!_0x46455b){_0x2dcf0c[_0xf469('0x23')](0x194);}return _0x46455b;};}function handleError(_0xaac709,_0x4449bd){_0x4449bd=_0x4449bd||0x1f4;return function(_0x3b4df3){logger[_0xf469('0x24')](_0x3b4df3[_0xf469('0x25')]);if(_0x3b4df3[_0xf469('0x26')]){delete _0x3b4df3[_0xf469('0x26')];}_0xaac709[_0xf469('0x19')](_0x4449bd)[_0xf469('0x27')](_0x3b4df3);};}exports[_0xf469('0x28')]=function(_0x957b1a,_0x3dbc3d){var _0x28b28={},_0x3df7c9={},_0x161d70={'count':0x0,'rows':[]};var _0x1d9caa=_['map'](db[_0xf469('0x29')][_0xf469('0x2a')],function(_0x5bccb1){return{'name':_0x5bccb1['fieldName'],'type':_0x5bccb1[_0xf469('0x2b')][_0xf469('0x2c')]};});_0x3df7c9[_0xf469('0x2d')]=_[_0xf469('0x2e')](_0x1d9caa,_0xf469('0x26'));_0x3df7c9[_0xf469('0x2f')]=_[_0xf469('0x30')](_0x957b1a['query']);_0x3df7c9[_0xf469('0x31')]=_['intersection'](_0x3df7c9[_0xf469('0x2d')],_0x3df7c9['query']);_0x28b28[_0xf469('0x32')]=_['intersection'](_0x3df7c9['model'],qs[_0xf469('0x33')](_0x957b1a[_0xf469('0x2f')][_0xf469('0x33')]));_0x28b28['attributes']=_0x28b28['attributes'][_0xf469('0x34')]?_0x28b28[_0xf469('0x32')]:_0x3df7c9[_0xf469('0x2d')];if(!_0x957b1a[_0xf469('0x2f')][_0xf469('0x35')](_0xf469('0x36'))){_0x28b28[_0xf469('0x17')]=qs['limit'](_0x957b1a[_0xf469('0x2f')][_0xf469('0x17')]);_0x28b28[_0xf469('0x16')]=qs['offset'](_0x957b1a['query']['offset']);}_0x28b28[_0xf469('0x37')]=qs[_0xf469('0x38')](_0x957b1a[_0xf469('0x2f')][_0xf469('0x38')]);_0x28b28['where']=qs[_0xf469('0x31')](_[_0xf469('0x39')](_0x957b1a[_0xf469('0x2f')],_0x3df7c9[_0xf469('0x31')]),_0x1d9caa);if(_0x957b1a[_0xf469('0x2f')]['filter']){_0x28b28['where']=_[_0xf469('0x3a')](_0x28b28[_0xf469('0x3b')],{'$or':_[_0xf469('0x2e')](_0x1d9caa,function(_0xe35f9e){if(_0xe35f9e[_0xf469('0x2b')]!==_0xf469('0x3c')){var _0x20b04c={};_0x20b04c[_0xe35f9e[_0xf469('0x26')]]={'$like':'%'+_0x957b1a[_0xf469('0x2f')][_0xf469('0x3d')]+'%'};return _0x20b04c;}})});}_0x28b28=_[_0xf469('0x3a')]({},_0x28b28,_0x957b1a['options']);var _0xfa6b73={'where':_0x28b28[_0xf469('0x3b')]};return db['AnalyticTreeReport'][_0xf469('0x18')](_0xfa6b73)[_0xf469('0x20')](function(_0x3a2e77){_0x161d70['count']=_0x3a2e77;if(_0x957b1a[_0xf469('0x2f')][_0xf469('0x3e')]){_0x28b28[_0xf469('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x28b28);})['then'](function(_0x1ba5bf){_0x161d70[_0xf469('0x40')]=_0x1ba5bf;return _0x161d70;})[_0xf469('0x20')](respondWithFilteredResult(_0x3dbc3d,_0x28b28))['catch'](handleError(_0x3dbc3d,null));};exports[_0xf469('0x41')]=function(_0x3cb5c1,_0x12a1fb){var _0x2554a1={'raw':!![],'where':{'id':_0x3cb5c1['params']['id']}},_0x48f43c={};_0x48f43c[_0xf469('0x2d')]=_[_0xf469('0x30')](db[_0xf469('0x29')][_0xf469('0x2a')]);_0x48f43c['query']=_[_0xf469('0x30')](_0x3cb5c1[_0xf469('0x2f')]);_0x48f43c[_0xf469('0x31')]=_['intersection'](_0x48f43c[_0xf469('0x2d')],_0x48f43c['query']);_0x2554a1[_0xf469('0x32')]=_[_0xf469('0x42')](_0x48f43c[_0xf469('0x2d')],qs[_0xf469('0x33')](_0x3cb5c1[_0xf469('0x2f')][_0xf469('0x33')]));_0x2554a1[_0xf469('0x32')]=_0x2554a1['attributes']['length']?_0x2554a1['attributes']:_0x48f43c[_0xf469('0x2d')];if(_0x3cb5c1[_0xf469('0x2f')]['includeAll']){_0x2554a1['include']=[{'all':!![]}];}_0x2554a1=_[_0xf469('0x3a')]({},_0x2554a1,_0x3cb5c1[_0xf469('0x43')]);return db[_0xf469('0x29')][_0xf469('0x44')](_0x2554a1)[_0xf469('0x20')](handleEntityNotFound(_0x12a1fb,null))['then'](respondWithResult(_0x12a1fb,null))[_0xf469('0x45')](handleError(_0x12a1fb,null));};exports['create']=function(_0x5dcb77,_0x1dc189){return db['AnalyticTreeReport'][_0xf469('0x46')](_0x5dcb77[_0xf469('0x47')],{})['then'](respondWithResult(_0x1dc189,0xc9))[_0xf469('0x45')](handleError(_0x1dc189,null));};exports[_0xf469('0x48')]=function(_0x1fdb57,_0xa5caed){if(_0x1fdb57['body']['id']){delete _0x1fdb57[_0xf469('0x47')]['id'];}return db['AnalyticTreeReport'][_0xf469('0x44')]({'where':{'id':_0x1fdb57[_0xf469('0x49')]['id']}})['then'](handleEntityNotFound(_0xa5caed,null))['then'](saveUpdates(_0x1fdb57[_0xf469('0x47')],null))[_0xf469('0x20')](respondWithResult(_0xa5caed,null))[_0xf469('0x45')](handleError(_0xa5caed,null));};exports['destroy']=function(_0x5012ba,_0x4b9e0b){return db[_0xf469('0x29')][_0xf469('0x44')]({'where':{'id':_0x5012ba[_0xf469('0x49')]['id']}})[_0xf469('0x20')](handleEntityNotFound(_0x4b9e0b,null))[_0xf469('0x20')](removeEntity(_0x4b9e0b,null))[_0xf469('0x45')](handleError(_0x4b9e0b,null));}; \ No newline at end of file +var _0xcafb=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','merge','options','AnalyticTreeReport','include','findAll','rows','catch','show','params'];(function(_0x175d53,_0x4215d0){var _0x135620=function(_0x43649b){while(--_0x43649b){_0x175d53['push'](_0x175d53['shift']());}};_0x135620(++_0x4215d0);}(_0xcafb,0xdd));var _0xbcaf=function(_0x52aa4c,_0x1abcb2){_0x52aa4c=_0x52aa4c-0x0;var _0x3a9660=_0xcafb[_0x52aa4c];return _0x3a9660;};'use strict';var emlformat=require(_0xbcaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcaf('0x2'));var moment=require(_0xbcaf('0x3'));var BPromise=require(_0xbcaf('0x4'));var Mustache=require(_0xbcaf('0x5'));var util=require(_0xbcaf('0x6'));var path=require(_0xbcaf('0x7'));var sox=require(_0xbcaf('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcaf('0x9'));var _=require(_0xbcaf('0xa'));var squel=require(_0xbcaf('0xb'));var crypto=require(_0xbcaf('0xc'));var jsforce=require(_0xbcaf('0xd'));var deskjs=require(_0xbcaf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbcaf('0xf'));var Papa=require(_0xbcaf('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbcaf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcaf('0x12'))(_0xbcaf('0x13'));var utils=require(_0xbcaf('0x14'));var config=require(_0xbcaf('0x15'));var licenseUtil=require(_0xbcaf('0x16'));var db=require(_0xbcaf('0x17'))['db'];function respondWithStatusCode(_0x37569e,_0x4ee18f){_0x4ee18f=_0x4ee18f||0xcc;return function(_0x5527f3){if(_0x5527f3){return _0x37569e[_0xbcaf('0x18')](_0x4ee18f);}return _0x37569e[_0xbcaf('0x19')](_0x4ee18f)[_0xbcaf('0x1a')]();};}function respondWithResult(_0x4373b5,_0xa1dd4f){_0xa1dd4f=_0xa1dd4f||0xc8;return function(_0x467bb9){if(_0x467bb9){return _0x4373b5['status'](_0xa1dd4f)[_0xbcaf('0x1b')](_0x467bb9);}};}function respondWithFilteredResult(_0x253304,_0x72ac1f){return function(_0x313d8c){if(_0x313d8c){var _0x53caa8=typeof _0x72ac1f[_0xbcaf('0x1c')]===_0xbcaf('0x1d')&&typeof _0x72ac1f['limit']===_0xbcaf('0x1d');var _0x4371f6=_0x313d8c[_0xbcaf('0x1e')];var _0x1382bd=_0x53caa8?0x0:_0x72ac1f[_0xbcaf('0x1c')];var _0x459c98=_0x53caa8?_0x313d8c['count']:_0x72ac1f['offset']+_0x72ac1f['limit'];var _0x50e96b;if(_0x459c98>=_0x4371f6){_0x459c98=_0x4371f6;_0x50e96b=0xc8;}else{_0x50e96b=0xce;}_0x253304[_0xbcaf('0x19')](_0x50e96b);return _0x253304[_0xbcaf('0x1f')](_0xbcaf('0x20'),_0x1382bd+'-'+_0x459c98+'/'+_0x4371f6)['json'](_0x313d8c);}return null;};}function patchUpdates(_0xc8a5ee){return function(_0x963dc5){try{jsonpatch['apply'](_0x963dc5,_0xc8a5ee,!![]);}catch(_0x460ef1){return BPromise[_0xbcaf('0x21')](_0x460ef1);}return _0x963dc5[_0xbcaf('0x22')]();};}function saveUpdates(_0x2682ad,_0x3caaca){return function(_0x3ca623){if(_0x3ca623){return _0x3ca623[_0xbcaf('0x23')](_0x2682ad)['then'](function(_0x339bed){return _0x339bed;});}return null;};}function removeEntity(_0x576cb9,_0xbe9f60){return function(_0x167138){if(_0x167138){return _0x167138[_0xbcaf('0x24')]()[_0xbcaf('0x25')](function(){_0x576cb9[_0xbcaf('0x19')](0xcc)[_0xbcaf('0x1a')]();});}};}function handleEntityNotFound(_0x472292,_0x2b60f2){return function(_0x2f613e){if(!_0x2f613e){_0x472292[_0xbcaf('0x18')](0x194);}return _0x2f613e;};}function handleError(_0x594f33,_0x11ee72){_0x11ee72=_0x11ee72||0x1f4;return function(_0x1658be){logger[_0xbcaf('0x26')](_0x1658be[_0xbcaf('0x27')]);if(_0x1658be[_0xbcaf('0x28')]){delete _0x1658be['name'];}_0x594f33[_0xbcaf('0x19')](_0x11ee72)[_0xbcaf('0x29')](_0x1658be);};}exports[_0xbcaf('0x2a')]=function(_0x23bd35,_0x992a97){var _0x267058={},_0x50a375={},_0x4908b0={'count':0x0,'rows':[]};var _0x5ed0a5=_[_0xbcaf('0x2b')](db['AnalyticTreeReport'][_0xbcaf('0x2c')],function(_0x3800a6){return{'name':_0x3800a6['fieldName'],'type':_0x3800a6[_0xbcaf('0x2d')][_0xbcaf('0x2e')]};});_0x50a375[_0xbcaf('0x2f')]=_[_0xbcaf('0x2b')](_0x5ed0a5,_0xbcaf('0x28'));_0x50a375[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x23bd35[_0xbcaf('0x30')]);_0x50a375[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x50a375[_0xbcaf('0x2f')],_0x50a375['query']);_0x267058[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x50a375['model'],qs[_0xbcaf('0x35')](_0x23bd35['query'][_0xbcaf('0x35')]));_0x267058[_0xbcaf('0x34')]=_0x267058[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x267058['attributes']:_0x50a375[_0xbcaf('0x2f')];if(!_0x23bd35['query'][_0xbcaf('0x37')]('nolimit')){_0x267058[_0xbcaf('0x38')]=qs['limit'](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x38')]);_0x267058[_0xbcaf('0x1c')]=qs[_0xbcaf('0x1c')](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x1c')]);}_0x267058[_0xbcaf('0x39')]=qs[_0xbcaf('0x3a')](_0x23bd35[_0xbcaf('0x30')]['sort']);_0x267058[_0xbcaf('0x3b')]=qs[_0xbcaf('0x32')](_[_0xbcaf('0x3c')](_0x23bd35[_0xbcaf('0x30')],_0x50a375[_0xbcaf('0x32')]),_0x5ed0a5);if(_0x23bd35[_0xbcaf('0x30')]['filter']){_0x267058['where']=_['merge'](_0x267058['where'],{'$or':_['map'](_0x5ed0a5,function(_0x5116f8){if(_0x5116f8['type']!==_0xbcaf('0x3d')){var _0x4d6931={};_0x4d6931[_0x5116f8[_0xbcaf('0x28')]]={'$like':'%'+_0x23bd35[_0xbcaf('0x30')]['filter']+'%'};return _0x4d6931;}})});}_0x267058=_[_0xbcaf('0x3e')]({},_0x267058,_0x23bd35[_0xbcaf('0x3f')]);var _0x239e15={'where':_0x267058[_0xbcaf('0x3b')]};return db[_0xbcaf('0x40')][_0xbcaf('0x1e')](_0x239e15)['then'](function(_0x3eeae5){_0x4908b0['count']=_0x3eeae5;if(_0x23bd35['query']['includeAll']){_0x267058[_0xbcaf('0x41')]=[{'all':!![]}];}return db[_0xbcaf('0x40')][_0xbcaf('0x42')](_0x267058);})[_0xbcaf('0x25')](function(_0x2b7b0b){_0x4908b0[_0xbcaf('0x43')]=_0x2b7b0b;return _0x4908b0;})['then'](respondWithFilteredResult(_0x992a97,_0x267058))[_0xbcaf('0x44')](handleError(_0x992a97,null));};exports[_0xbcaf('0x45')]=function(_0x56ab60,_0x26c243){var _0x5a1405={'raw':!![],'where':{'id':_0x56ab60[_0xbcaf('0x46')]['id']}},_0x2608bb={};_0x2608bb[_0xbcaf('0x2f')]=_[_0xbcaf('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x2608bb[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x56ab60[_0xbcaf('0x30')]);_0x2608bb[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],_0x2608bb[_0xbcaf('0x30')]);_0x5a1405[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],qs['fields'](_0x56ab60['query'][_0xbcaf('0x35')]));_0x5a1405[_0xbcaf('0x34')]=_0x5a1405[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x5a1405[_0xbcaf('0x34')]:_0x2608bb[_0xbcaf('0x2f')];if(_0x56ab60[_0xbcaf('0x30')]['includeAll']){_0x5a1405[_0xbcaf('0x41')]=[{'all':!![]}];}_0x5a1405=_['merge']({},_0x5a1405,_0x56ab60[_0xbcaf('0x3f')]);return db['AnalyticTreeReport']['find'](_0x5a1405)[_0xbcaf('0x25')](handleEntityNotFound(_0x26c243,null))[_0xbcaf('0x25')](respondWithResult(_0x26c243,null))[_0xbcaf('0x44')](handleError(_0x26c243,null));};exports['create']=function(_0x142d48,_0x35fad7){return db[_0xbcaf('0x40')][_0xbcaf('0x47')](_0x142d48['body'],{})['then'](respondWithResult(_0x35fad7,0xc9))[_0xbcaf('0x44')](handleError(_0x35fad7,null));};exports[_0xbcaf('0x23')]=function(_0x4132f8,_0x3708c3){if(_0x4132f8[_0xbcaf('0x48')]['id']){delete _0x4132f8['body']['id'];}return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x4132f8['params']['id']}})['then'](handleEntityNotFound(_0x3708c3,null))['then'](saveUpdates(_0x4132f8[_0xbcaf('0x48')],null))['then'](respondWithResult(_0x3708c3,null))['catch'](handleError(_0x3708c3,null));};exports[_0xbcaf('0x24')]=function(_0x1d445c,_0x4bbb3c){return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x1d445c[_0xbcaf('0x46')]['id']}})[_0xbcaf('0x25')](handleEntityNotFound(_0x4bbb3c,null))[_0xbcaf('0x25')](removeEntity(_0x4bbb3c,null))[_0xbcaf('0x44')](handleError(_0x4bbb3c,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 21cd072..43f50a6 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 _0xbc8b=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc8b,0xc8));var _0xbbc8=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xbc8b[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var logger=require(_0xbbc8('0x1'))(_0xbbc8('0x2'));var moment=require('moment');var BPromise=require(_0xbbc8('0x3'));var rp=require(_0xbbc8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbc8('0x5'));var config=require(_0xbbc8('0x6'));var attributes=require(_0xbbc8('0x7'));module[_0xbbc8('0x8')]=function(_0x292b0b,_0x27782e){return _0x292b0b[_0xbbc8('0x9')](_0xbbc8('0xa'),attributes,{'tableName':_0xbbc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6df=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd6df,0xb4));var _0xfd6d=function(_0x23a3cd,_0x6e2762){_0x23a3cd=_0x23a3cd-0x0;var _0x1ec75b=_0xd6df[_0x23a3cd];return _0x1ec75b;};'use strict';var _=require(_0xfd6d('0x0'));var util=require(_0xfd6d('0x1'));var logger=require(_0xfd6d('0x2'))(_0xfd6d('0x3'));var moment=require(_0xfd6d('0x4'));var BPromise=require(_0xfd6d('0x5'));var rp=require(_0xfd6d('0x6'));var fs=require('fs');var path=require(_0xfd6d('0x7'));var rimraf=require(_0xfd6d('0x8'));var config=require(_0xfd6d('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0xfd6d('0xa')]=function(_0x39e558,_0x5f51da){return _0x39e558['define'](_0xfd6d('0xb'),attributes,{'tableName':_0xfd6d('0xc'),'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 dd06538..b95c227 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x37b2be,_0x2c92fc){var _0x1e80ef=function(_0x680b58){while(--_0x680b58){_0x37b2be['push'](_0x37b2be['shift']());}};_0x1e80ef(++_0x2c92fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x19c980,_0x53a31e){_0x19c980=_0x19c980-0x0;var _0x9b6c7=_0x2ef3[_0x19c980];return _0x9b6c7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _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(_0x1e88f9,_0xb92e06){var _0x29f1a0=function(_0x4d79d1){while(--_0x4d79d1){_0x1e88f9['push'](_0x1e88f9['shift']());}};_0x29f1a0(++_0xb92e06);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7e89ab,_0x1f8dc3){_0x7e89ab=_0x7e89ab-0x0;var _0x234184=_0x5f2f[_0x7e89ab];return _0x234184;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b7ed0a9..be4d866 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 _0xc035=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4bb28b,_0x521859){var _0x4c7c9b=function(_0x257c4d){while(--_0x257c4d){_0x4bb28b['push'](_0x4bb28b['shift']());}};_0x4c7c9b(++_0x521859);}(_0xc035,0x1dd));var _0x5c03=function(_0x355f6d,_0x2b640e){_0x355f6d=_0x355f6d-0x0;var _0x3d6f05=_0xc035[_0x355f6d];return _0x3d6f05;};'use strict';var multer=require('multer');var util=require(_0x5c03('0x0'));var path=require(_0x5c03('0x1'));var timeout=require(_0x5c03('0x2'));var express=require('express');var router=express[_0x5c03('0x3')]();var fs_extra=require(_0x5c03('0x4'));var auth=require(_0x5c03('0x5'));var interaction=require(_0x5c03('0x6'));var config=require(_0x5c03('0x7'));var controller=require(_0x5c03('0x8'));router[_0x5c03('0x9')]('/',auth['isAuthenticated'](),controller[_0x5c03('0xa')]);router['get'](_0x5c03('0xb'),auth['isAuthenticated'](),controller[_0x5c03('0xc')]);router[_0x5c03('0xd')]('/',auth[_0x5c03('0xe')](),controller['create']);router[_0x5c03('0xf')]('/:id',auth[_0x5c03('0xe')](),controller[_0x5c03('0x10')]);router[_0x5c03('0x11')](_0x5c03('0xb'),auth[_0x5c03('0xe')](),controller[_0x5c03('0x12')]);module[_0x5c03('0x13')]=router; \ No newline at end of file +var _0x6931=['express','Router','fs-extra','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4bd7c9,_0xc4fed8){var _0x593124=function(_0x13e2b6){while(--_0x13e2b6){_0x4bd7c9['push'](_0x4bd7c9['shift']());}};_0x593124(++_0xc4fed8);}(_0x6931,0x19c));var _0x1693=function(_0x29807f,_0xe0404){_0x29807f=_0x29807f-0x0;var _0x81aff2=_0x6931[_0x29807f];return _0x81aff2;};'use strict';var multer=require(_0x1693('0x0'));var util=require('util');var path=require(_0x1693('0x1'));var timeout=require('connect-timeout');var express=require(_0x1693('0x2'));var router=express[_0x1693('0x3')]();var fs_extra=require(_0x1693('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1693('0x5'));router[_0x1693('0x6')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0x8')]);router[_0x1693('0x6')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xa')]);router[_0x1693('0xb')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0xc')]);router[_0x1693('0xd')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xe')]);router[_0x1693('0xf')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0x10')]);module[_0x1693('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c35cc82..5c3dea1 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 _0xd3d1=['STRING','sequelize','exports'];(function(_0x3a8aec,_0x1aff3f){var _0x5ccb87=function(_0x13917a){while(--_0x13917a){_0x3a8aec['push'](_0x3a8aec['shift']());}};_0x5ccb87(++_0x1aff3f);}(_0xd3d1,0x172));var _0x1d3d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd3d1[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1d3d('0x2')]}}; \ No newline at end of file +var _0x37dc=['sequelize','exports','STRING'];(function(_0x3beaa7,_0x26e2d7){var _0x4e87e2=function(_0x48a569){while(--_0x48a569){_0x3beaa7['push'](_0x3beaa7['shift']());}};_0x4e87e2(++_0x26e2d7);}(_0x37dc,0x1e9));var _0xc37d=function(_0x5e086f,_0x4f1821){_0x5e086f=_0x5e086f-0x0;var _0x12dba8=_0x37dc[_0x5e086f];return _0x12dba8;};'use strict';var Sequelize=require(_0xc37d('0x0'));module[_0xc37d('0x1')]={'name':{'type':Sequelize[_0xc37d('0x2')]},'basename':{'type':Sequelize[_0xc37d('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 0641d5d..dd776e3 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 _0x6e54=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','update','create','file','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x6e54,0x1de));var _0x46e5=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x6e54[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x46e5('0x0'));var rimraf=require(_0x46e5('0x1'));var zipdir=require(_0x46e5('0x2'));var jsonpatch=require(_0x46e5('0x3'));var rp=require('request-promise');var moment=require(_0x46e5('0x4'));var BPromise=require(_0x46e5('0x5'));var Mustache=require(_0x46e5('0x6'));var util=require(_0x46e5('0x7'));var path=require('path');var sox=require(_0x46e5('0x8'));var csv=require(_0x46e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46e5('0xa'));var _=require(_0x46e5('0xb'));var squel=require('squel');var crypto=require(_0x46e5('0xc'));var jsforce=require(_0x46e5('0xd'));var deskjs=require(_0x46e5('0xe'));var toCsv=require(_0x46e5('0x9'));var querystring=require('querystring');var Papa=require(_0x46e5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x46e5('0x10'));var as=require(_0x46e5('0x11'));var hardwareService=require(_0x46e5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x46e5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x46e5('0x14'));var db=require(_0x46e5('0x15'))['db'];function respondWithStatusCode(_0xd3569f,_0x1d30b3){_0x1d30b3=_0x1d30b3||0xcc;return function(_0x52b0bd){if(_0x52b0bd){return _0xd3569f[_0x46e5('0x16')](_0x1d30b3);}return _0xd3569f['status'](_0x1d30b3)['end']();};}function respondWithResult(_0x320fbb,_0x417e1c){_0x417e1c=_0x417e1c||0xc8;return function(_0x237a6a){if(_0x237a6a){return _0x320fbb[_0x46e5('0x17')](_0x417e1c)[_0x46e5('0x18')](_0x237a6a);}};}function respondWithFilteredResult(_0x160487,_0x2f7287){return function(_0x49308c){if(_0x49308c){var _0x18fde1=typeof _0x2f7287['offset']===_0x46e5('0x19')&&typeof _0x2f7287['limit']===_0x46e5('0x19');var _0x449031=_0x49308c[_0x46e5('0x1a')];var _0xbf688f=_0x18fde1?0x0:_0x2f7287[_0x46e5('0x1b')];var _0x1b40df=_0x18fde1?_0x49308c['count']:_0x2f7287[_0x46e5('0x1b')]+_0x2f7287[_0x46e5('0x1c')];var _0x529057;if(_0x1b40df>=_0x449031){_0x1b40df=_0x449031;_0x529057=0xc8;}else{_0x529057=0xce;}_0x160487[_0x46e5('0x17')](_0x529057);return _0x160487[_0x46e5('0x1d')](_0x46e5('0x1e'),_0xbf688f+'-'+_0x1b40df+'/'+_0x449031)['json'](_0x49308c);}return null;};}function patchUpdates(_0x35706f){return function(_0x233976){try{jsonpatch['apply'](_0x233976,_0x35706f,!![]);}catch(_0x2e6eaf){return BPromise[_0x46e5('0x1f')](_0x2e6eaf);}return _0x233976[_0x46e5('0x20')]();};}function saveUpdates(_0x1e57d7,_0x627283){return function(_0x2d26d4){if(_0x2d26d4){return _0x2d26d4['update'](_0x1e57d7)[_0x46e5('0x21')](function(_0x5cb97e){return _0x5cb97e;});}return null;};}function removeEntity(_0x398143,_0x5b48fe){return function(_0x3b95fe){if(_0x3b95fe){return _0x3b95fe[_0x46e5('0x22')]()[_0x46e5('0x21')](function(){_0x398143[_0x46e5('0x17')](0xcc)[_0x46e5('0x23')]();});}};}function handleEntityNotFound(_0x5c689a,_0x515d47){return function(_0x268e65){if(!_0x268e65){_0x5c689a['sendStatus'](0x194);}return _0x268e65;};}function handleError(_0x48a791,_0x22ec36){_0x22ec36=_0x22ec36||0x1f4;return function(_0x484f85){logger[_0x46e5('0x24')](_0x484f85[_0x46e5('0x25')]);if(_0x484f85['name']){delete _0x484f85[_0x46e5('0x26')];}_0x48a791['status'](_0x22ec36)['send'](_0x484f85);};}exports['index']=function(_0x16480e,_0x5a07c6){var _0x285eaf={},_0x2a9d54={},_0x50c501={'count':0x0,'rows':[]};var _0x2249b0=_['map'](db[_0x46e5('0x27')][_0x46e5('0x28')],function(_0x5b4d53){return{'name':_0x5b4d53[_0x46e5('0x29')],'type':_0x5b4d53[_0x46e5('0x2a')][_0x46e5('0x2b')]};});_0x2a9d54[_0x46e5('0x2c')]=_[_0x46e5('0x2d')](_0x2249b0,_0x46e5('0x26'));_0x2a9d54[_0x46e5('0x2e')]=_['keys'](_0x16480e[_0x46e5('0x2e')]);_0x2a9d54['filters']=_[_0x46e5('0x2f')](_0x2a9d54[_0x46e5('0x2c')],_0x2a9d54[_0x46e5('0x2e')]);_0x285eaf[_0x46e5('0x30')]=_['intersection'](_0x2a9d54['model'],qs[_0x46e5('0x31')](_0x16480e[_0x46e5('0x2e')]['fields']));_0x285eaf['attributes']=_0x285eaf['attributes'][_0x46e5('0x32')]?_0x285eaf[_0x46e5('0x30')]:_0x2a9d54[_0x46e5('0x2c')];if(!_0x16480e[_0x46e5('0x2e')][_0x46e5('0x33')](_0x46e5('0x34'))){_0x285eaf['limit']=qs[_0x46e5('0x1c')](_0x16480e['query'][_0x46e5('0x1c')]);_0x285eaf[_0x46e5('0x1b')]=qs[_0x46e5('0x1b')](_0x16480e[_0x46e5('0x2e')]['offset']);}_0x285eaf[_0x46e5('0x35')]=qs[_0x46e5('0x36')](_0x16480e[_0x46e5('0x2e')][_0x46e5('0x36')]);_0x285eaf[_0x46e5('0x37')]=qs[_0x46e5('0x38')](_[_0x46e5('0x39')](_0x16480e['query'],_0x2a9d54[_0x46e5('0x38')]),_0x2249b0);if(_0x16480e[_0x46e5('0x2e')]['filter']){_0x285eaf[_0x46e5('0x37')]=_[_0x46e5('0x3a')](_0x285eaf[_0x46e5('0x37')],{'$or':_['map'](_0x2249b0,function(_0x18d6ab){if(_0x18d6ab['type']!==_0x46e5('0x3b')){var _0x211ed1={};_0x211ed1[_0x18d6ab[_0x46e5('0x26')]]={'$like':'%'+_0x16480e['query'][_0x46e5('0x3c')]+'%'};return _0x211ed1;}})});}_0x285eaf=_['merge']({},_0x285eaf,_0x16480e[_0x46e5('0x3d')]);var _0x5e10c4={'where':_0x285eaf[_0x46e5('0x37')]};return db['Attachment'][_0x46e5('0x1a')](_0x5e10c4)[_0x46e5('0x21')](function(_0x5f0b46){_0x50c501[_0x46e5('0x1a')]=_0x5f0b46;if(_0x16480e[_0x46e5('0x2e')][_0x46e5('0x3e')]){_0x285eaf[_0x46e5('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x46e5('0x40')](_0x285eaf);})['then'](function(_0x5ad07a){_0x50c501[_0x46e5('0x41')]=_0x5ad07a;return _0x50c501;})[_0x46e5('0x21')](respondWithFilteredResult(_0x5a07c6,_0x285eaf))[_0x46e5('0x42')](handleError(_0x5a07c6,null));};exports[_0x46e5('0x43')]=function(_0x190504,_0x2c2d0e){var _0x320f46={'raw':!![],'where':{'id':_0x190504[_0x46e5('0x44')]['id']}},_0x3e7b58={};_0x3e7b58['model']=_[_0x46e5('0x45')](db[_0x46e5('0x27')][_0x46e5('0x28')]);_0x3e7b58[_0x46e5('0x2e')]=_[_0x46e5('0x45')](_0x190504[_0x46e5('0x2e')]);_0x3e7b58['filters']=_[_0x46e5('0x2f')](_0x3e7b58[_0x46e5('0x2c')],_0x3e7b58[_0x46e5('0x2e')]);_0x320f46[_0x46e5('0x30')]=_['intersection'](_0x3e7b58['model'],qs[_0x46e5('0x31')](_0x190504['query'][_0x46e5('0x31')]));_0x320f46['attributes']=_0x320f46['attributes'][_0x46e5('0x32')]?_0x320f46['attributes']:_0x3e7b58['model'];if(_0x190504['query'][_0x46e5('0x3e')]){_0x320f46['include']=[{'all':!![]}];}_0x320f46=_['merge']({},_0x320f46,_0x190504[_0x46e5('0x3d')]);return db['Attachment'][_0x46e5('0x46')](_0x320f46)[_0x46e5('0x21')](handleEntityNotFound(_0x2c2d0e,null))[_0x46e5('0x21')](respondWithResult(_0x2c2d0e,null))[_0x46e5('0x42')](handleError(_0x2c2d0e,null));};exports[_0x46e5('0x47')]=function(_0x48cf6b,_0x342a85){var _0x494eca={'where':{'id':_0x48cf6b[_0x46e5('0x44')]['id']}},_0x2caedb={};_0x2caedb[_0x46e5('0x2c')]=_[_0x46e5('0x45')](db[_0x46e5('0x27')][_0x46e5('0x28')]);_0x494eca[_0x46e5('0x30')]=_['intersection'](_0x2caedb[_0x46e5('0x2c')],qs[_0x46e5('0x31')](_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x31')]));_0x494eca[_0x46e5('0x30')]=_0x494eca[_0x46e5('0x30')][_0x46e5('0x32')]?_0x494eca['attributes']:_0x2caedb['model'];if(_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x3e')]){_0x494eca[_0x46e5('0x3f')]=[{'all':!![]}];}_0x494eca=_['merge']({},_0x494eca,_0x48cf6b[_0x46e5('0x3d')]);return db[_0x46e5('0x27')][_0x46e5('0x46')](_0x494eca)[_0x46e5('0x21')](handleEntityNotFound(_0x342a85,null))[_0x46e5('0x21')](function(_0x5aa976){if(_0x5aa976){var _0x16ec97=_0x5aa976[_0x46e5('0x48')]({'plain':!![]});_0x16ec97=qs[_0x46e5('0x49')](_0x16ec97,['id',_0x46e5('0x4a'),_0x46e5('0x4b')]);_0x48cf6b[_0x46e5('0x4c')]=_[_0x46e5('0x49')](_0x48cf6b[_0x46e5('0x4c')],['id',_0x46e5('0x4a'),_0x46e5('0x4b')]);return db['Attachment']['create'](_[_0x46e5('0x3a')](_0x16ec97,_0x48cf6b[_0x46e5('0x4c')]),{'include':_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x3e')]?[{'all':!![]}]:undefined});}})[_0x46e5('0x21')](respondWithResult(_0x342a85,0xc9))[_0x46e5('0x42')](handleError(_0x342a85,null));};exports[_0x46e5('0x4d')]=function(_0x2b92a7,_0x641318){if(_0x2b92a7['body']['id']){delete _0x2b92a7[_0x46e5('0x4c')]['id'];}return db['Attachment'][_0x46e5('0x46')]({'where':{'id':_0x2b92a7[_0x46e5('0x44')]['id']}})[_0x46e5('0x21')](handleEntityNotFound(_0x641318,null))[_0x46e5('0x21')](saveUpdates(_0x2b92a7[_0x46e5('0x4c')],null))[_0x46e5('0x21')](respondWithResult(_0x641318,null))[_0x46e5('0x42')](handleError(_0x641318,null));};exports[_0x46e5('0x22')]=function(_0x3c95ff,_0x4f6d89){return db['Attachment']['find']({'where':{'id':_0x3c95ff['params']['id']}})['then'](handleEntityNotFound(_0x4f6d89,null))[_0x46e5('0x21')](removeEntity(_0x4f6d89,null))['catch'](handleError(_0x4f6d89,null));};exports[_0x46e5('0x4e')]=function(_0x5ec1c1,_0x1d469b,_0x4e00d0){_0x5ec1c1[_0x46e5('0x4c')][_0x46e5('0x26')]=_0x5ec1c1[_0x46e5('0x4f')]['originalname'];_0x5ec1c1['body'][_0x46e5('0x50')]=_0x5ec1c1[_0x46e5('0x4f')][_0x46e5('0x51')];_0x5ec1c1['body']['type']=_0x5ec1c1[_0x46e5('0x4f')]['mimetype'];return db[_0x46e5('0x27')][_0x46e5('0x4e')](_0x5ec1c1[_0x46e5('0x4c')])['then'](respondWithResult(_0x1d469b,0xc9))[_0x46e5('0x42')](handleError(_0x1d469b,null));};exports[_0x46e5('0x52')]=function(_0x360227,_0x224e19,_0x185ec9){return db['Attachment'][_0x46e5('0x53')]({'where':{'id':_0x360227[_0x46e5('0x44')]['id']},'raw':!![]})[_0x46e5('0x21')](handleEntityNotFound(_0x224e19,null))[_0x46e5('0x21')](function(_0x3d24f0){if(_0x3d24f0){var _0x29d96b=_0x3d24f0[_0x46e5('0x54')]!==null;var _0x2c5271=path[_0x46e5('0x55')](config[_0x46e5('0x56')],_0x46e5('0x57'));if(_0x29d96b){_0x2c5271=path['join'](_0x2c5271,'offline-chat/');}var _0xde6675=path[_0x46e5('0x55')](_0x2c5271,_0x3d24f0[_0x46e5('0x50')]);return _0x224e19[_0x46e5('0x52')](_0xde6675);}})['catch'](handleError(_0x224e19,null));}; \ No newline at end of file +var _0x658e=['reject','save','update','then','destroy','end','error','stack','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','keys','intersection','length','find','clone','merge','get','body','omit','createdAt','create','file','originalname','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','apply'];(function(_0x2c42e1,_0x5141c7){var _0x34df52=function(_0x35a840){while(--_0x35a840){_0x2c42e1['push'](_0x2c42e1['shift']());}};_0x34df52(++_0x5141c7);}(_0x658e,0x19a));var _0xe658=function(_0x5877ae,_0x358cda){_0x5877ae=_0x5877ae-0x0;var _0x5ca64e=_0x658e[_0x5877ae];return _0x5ca64e;};'use strict';var emlformat=require(_0xe658('0x0'));var rimraf=require(_0xe658('0x1'));var zipdir=require(_0xe658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe658('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe658('0x4'));var util=require('util');var path=require(_0xe658('0x5'));var sox=require(_0xe658('0x6'));var csv=require('to-csv');var ejs=require(_0xe658('0x7'));var fs=require('fs');var fs_extra=require(_0xe658('0x8'));var _=require('lodash');var squel=require(_0xe658('0x9'));var crypto=require(_0xe658('0xa'));var jsforce=require(_0xe658('0xb'));var deskjs=require(_0xe658('0xc'));var toCsv=require(_0xe658('0xd'));var querystring=require(_0xe658('0xe'));var Papa=require('papaparse');var Redis=require(_0xe658('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe658('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe658('0x11'));var logger=require(_0xe658('0x12'))('api');var utils=require(_0xe658('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe658('0x14'));var db=require(_0xe658('0x15'))['db'];function respondWithStatusCode(_0x3b0571,_0x5f5956){_0x5f5956=_0x5f5956||0xcc;return function(_0x1de6b0){if(_0x1de6b0){return _0x3b0571[_0xe658('0x16')](_0x5f5956);}return _0x3b0571['status'](_0x5f5956)['end']();};}function respondWithResult(_0x40d156,_0x4c174e){_0x4c174e=_0x4c174e||0xc8;return function(_0x1ca83c){if(_0x1ca83c){return _0x40d156['status'](_0x4c174e)[_0xe658('0x17')](_0x1ca83c);}};}function respondWithFilteredResult(_0x477658,_0x26d9d9){return function(_0xcb07c3){if(_0xcb07c3){var _0x4e7a01=typeof _0x26d9d9[_0xe658('0x18')]===_0xe658('0x19')&&typeof _0x26d9d9[_0xe658('0x1a')]===_0xe658('0x19');var _0x3d0d18=_0xcb07c3[_0xe658('0x1b')];var _0x425982=_0x4e7a01?0x0:_0x26d9d9[_0xe658('0x18')];var _0x55c698=_0x4e7a01?_0xcb07c3['count']:_0x26d9d9[_0xe658('0x18')]+_0x26d9d9['limit'];var _0x445c66;if(_0x55c698>=_0x3d0d18){_0x55c698=_0x3d0d18;_0x445c66=0xc8;}else{_0x445c66=0xce;}_0x477658[_0xe658('0x1c')](_0x445c66);return _0x477658['set']('Content-Range',_0x425982+'-'+_0x55c698+'/'+_0x3d0d18)[_0xe658('0x17')](_0xcb07c3);}return null;};}function patchUpdates(_0x1584e8){return function(_0x29181f){try{jsonpatch[_0xe658('0x1d')](_0x29181f,_0x1584e8,!![]);}catch(_0x27d26c){return BPromise[_0xe658('0x1e')](_0x27d26c);}return _0x29181f[_0xe658('0x1f')]();};}function saveUpdates(_0x5b4669,_0x2598de){return function(_0x1bac2c){if(_0x1bac2c){return _0x1bac2c[_0xe658('0x20')](_0x5b4669)[_0xe658('0x21')](function(_0x3694f3){return _0x3694f3;});}return null;};}function removeEntity(_0x28981e,_0x3fdb4e){return function(_0x3b1d90){if(_0x3b1d90){return _0x3b1d90[_0xe658('0x22')]()[_0xe658('0x21')](function(){_0x28981e[_0xe658('0x1c')](0xcc)[_0xe658('0x23')]();});}};}function handleEntityNotFound(_0x256578,_0x1ffd22){return function(_0x498b64){if(!_0x498b64){_0x256578['sendStatus'](0x194);}return _0x498b64;};}function handleError(_0xa4660a,_0x2aeae1){_0x2aeae1=_0x2aeae1||0x1f4;return function(_0x58231e){logger[_0xe658('0x24')](_0x58231e[_0xe658('0x25')]);if(_0x58231e['name']){delete _0x58231e['name'];}_0xa4660a[_0xe658('0x1c')](_0x2aeae1)[_0xe658('0x26')](_0x58231e);};}exports[_0xe658('0x27')]=function(_0x1bbd94,_0x318569){var _0x2e7467={},_0x853063={},_0x550926={'count':0x0,'rows':[]};var _0x274a5c=_[_0xe658('0x28')](db[_0xe658('0x29')][_0xe658('0x2a')],function(_0x594cbd){return{'name':_0x594cbd[_0xe658('0x2b')],'type':_0x594cbd[_0xe658('0x2c')][_0xe658('0x2d')]};});_0x853063[_0xe658('0x2e')]=_['map'](_0x274a5c,'name');_0x853063[_0xe658('0x2f')]=_['keys'](_0x1bbd94[_0xe658('0x2f')]);_0x853063[_0xe658('0x30')]=_['intersection'](_0x853063['model'],_0x853063[_0xe658('0x2f')]);_0x2e7467['attributes']=_['intersection'](_0x853063[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x31')]));_0x2e7467['attributes']=_0x2e7467[_0xe658('0x32')]['length']?_0x2e7467['attributes']:_0x853063[_0xe658('0x2e')];if(!_0x1bbd94[_0xe658('0x2f')]['hasOwnProperty'](_0xe658('0x33'))){_0x2e7467['limit']=qs[_0xe658('0x1a')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x1a')]);_0x2e7467['offset']=qs['offset'](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x18')]);}_0x2e7467[_0xe658('0x34')]=qs[_0xe658('0x35')](_0x1bbd94['query']['sort']);_0x2e7467[_0xe658('0x36')]=qs[_0xe658('0x30')](_[_0xe658('0x37')](_0x1bbd94[_0xe658('0x2f')],_0x853063[_0xe658('0x30')]),_0x274a5c);if(_0x1bbd94['query'][_0xe658('0x38')]){_0x2e7467[_0xe658('0x36')]=_['merge'](_0x2e7467[_0xe658('0x36')],{'$or':_['map'](_0x274a5c,function(_0x2b798e){if(_0x2b798e[_0xe658('0x2c')]!==_0xe658('0x39')){var _0x3ff478={};_0x3ff478[_0x2b798e[_0xe658('0x3a')]]={'$like':'%'+_0x1bbd94['query']['filter']+'%'};return _0x3ff478;}})});}_0x2e7467=_['merge']({},_0x2e7467,_0x1bbd94[_0xe658('0x3b')]);var _0x414825={'where':_0x2e7467['where']};return db['Attachment'][_0xe658('0x1b')](_0x414825)[_0xe658('0x21')](function(_0x1199fc){_0x550926['count']=_0x1199fc;if(_0x1bbd94[_0xe658('0x2f')][_0xe658('0x3c')]){_0x2e7467[_0xe658('0x3d')]=[{'all':!![]}];}return db[_0xe658('0x29')]['findAll'](_0x2e7467);})[_0xe658('0x21')](function(_0x45e11c){_0x550926[_0xe658('0x3e')]=_0x45e11c;return _0x550926;})[_0xe658('0x21')](respondWithFilteredResult(_0x318569,_0x2e7467))[_0xe658('0x3f')](handleError(_0x318569,null));};exports[_0xe658('0x40')]=function(_0x182c8b,_0x1eed15){var _0x3f0b52={'raw':!![],'where':{'id':_0x182c8b[_0xe658('0x41')]['id']}},_0x41e3ac={};_0x41e3ac['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x41e3ac[_0xe658('0x2f')]=_['keys'](_0x182c8b[_0xe658('0x2f')]);_0x41e3ac[_0xe658('0x30')]=_['intersection'](_0x41e3ac[_0xe658('0x2e')],_0x41e3ac['query']);_0x3f0b52['attributes']=_[_0xe658('0x43')](_0x41e3ac[_0xe658('0x2e')],qs['fields'](_0x182c8b[_0xe658('0x2f')]['fields']));_0x3f0b52[_0xe658('0x32')]=_0x3f0b52['attributes'][_0xe658('0x44')]?_0x3f0b52['attributes']:_0x41e3ac[_0xe658('0x2e')];if(_0x182c8b[_0xe658('0x2f')][_0xe658('0x3c')]){_0x3f0b52[_0xe658('0x3d')]=[{'all':!![]}];}_0x3f0b52=_['merge']({},_0x3f0b52,_0x182c8b[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x3f0b52)['then'](handleEntityNotFound(_0x1eed15,null))[_0xe658('0x21')](respondWithResult(_0x1eed15,null))[_0xe658('0x3f')](handleError(_0x1eed15,null));};exports[_0xe658('0x46')]=function(_0x4919cc,_0x1a102e){var _0x539af9={'where':{'id':_0x4919cc[_0xe658('0x41')]['id']}},_0x1a6b76={};_0x1a6b76['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x539af9[_0xe658('0x32')]=_[_0xe658('0x43')](_0x1a6b76[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x4919cc[_0xe658('0x2f')][_0xe658('0x31')]));_0x539af9['attributes']=_0x539af9[_0xe658('0x32')][_0xe658('0x44')]?_0x539af9[_0xe658('0x32')]:_0x1a6b76[_0xe658('0x2e')];if(_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]){_0x539af9['include']=[{'all':!![]}];}_0x539af9=_[_0xe658('0x47')]({},_0x539af9,_0x4919cc[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x539af9)[_0xe658('0x21')](handleEntityNotFound(_0x1a102e,null))[_0xe658('0x21')](function(_0x128a91){if(_0x128a91){var _0x396135=_0x128a91[_0xe658('0x48')]({'plain':!![]});_0x396135=qs['omit'](_0x396135,['id','createdAt','updatedAt']);_0x4919cc[_0xe658('0x49')]=_[_0xe658('0x4a')](_0x4919cc[_0xe658('0x49')],['id',_0xe658('0x4b'),'updatedAt']);return db[_0xe658('0x29')][_0xe658('0x4c')](_[_0xe658('0x47')](_0x396135,_0x4919cc[_0xe658('0x49')]),{'include':_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]?[{'all':!![]}]:undefined});}})[_0xe658('0x21')](respondWithResult(_0x1a102e,0xc9))['catch'](handleError(_0x1a102e,null));};exports[_0xe658('0x20')]=function(_0x35a938,_0x1ad2a7){if(_0x35a938[_0xe658('0x49')]['id']){delete _0x35a938[_0xe658('0x49')]['id'];}return db['Attachment'][_0xe658('0x45')]({'where':{'id':_0x35a938[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x1ad2a7,null))['then'](saveUpdates(_0x35a938[_0xe658('0x49')],null))[_0xe658('0x21')](respondWithResult(_0x1ad2a7,null))[_0xe658('0x3f')](handleError(_0x1ad2a7,null));};exports[_0xe658('0x22')]=function(_0x4862e5,_0x114ebc){return db[_0xe658('0x29')][_0xe658('0x45')]({'where':{'id':_0x4862e5[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x114ebc,null))[_0xe658('0x21')](removeEntity(_0x114ebc,null))[_0xe658('0x3f')](handleError(_0x114ebc,null));};exports['create']=function(_0x3b472b,_0x2c44ca,_0x449365){_0x3b472b[_0xe658('0x49')]['name']=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4e')];_0x3b472b['body']['basename']=_0x3b472b[_0xe658('0x4d')]['filename'];_0x3b472b[_0xe658('0x49')][_0xe658('0x2c')]=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4f')];return db['Attachment'][_0xe658('0x4c')](_0x3b472b[_0xe658('0x49')])[_0xe658('0x21')](respondWithResult(_0x2c44ca,0xc9))[_0xe658('0x3f')](handleError(_0x2c44ca,null));};exports['download']=function(_0x1ea1f4,_0x8cfe92,_0x50f997){return db[_0xe658('0x29')][_0xe658('0x50')]({'where':{'id':_0x1ea1f4[_0xe658('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x8cfe92,null))[_0xe658('0x21')](function(_0x59baab){if(_0x59baab){var _0x322613=_0x59baab[_0xe658('0x51')]!==null;var _0x145c81=path['join'](config[_0xe658('0x52')],_0xe658('0x53'));if(_0x322613){_0x145c81=path[_0xe658('0x54')](_0x145c81,_0xe658('0x55'));}var _0x18aa02=path['join'](_0x145c81,_0x59baab[_0xe658('0x56')]);return _0x8cfe92[_0xe658('0x57')](_0x18aa02);}})['catch'](handleError(_0x8cfe92,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 396c402..38266be 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 _0xca6d=['rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','bluebird','request-promise','path'];(function(_0x608768,_0x2ef201){var _0x1dae3f=function(_0x1950f7){while(--_0x1950f7){_0x608768['push'](_0x608768['shift']());}};_0x1dae3f(++_0x2ef201);}(_0xca6d,0xab));var _0xdca6=function(_0x16dfa1,_0x3f9429){_0x16dfa1=_0x16dfa1-0x0;var _0x5c9ad5=_0xca6d[_0x16dfa1];return _0x5c9ad5;};'use strict';var _=require('lodash');var util=require(_0xdca6('0x0'));var logger=require(_0xdca6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdca6('0x2'));var rp=require(_0xdca6('0x3'));var fs=require('fs');var path=require(_0xdca6('0x4'));var rimraf=require(_0xdca6('0x5'));var config=require(_0xdca6('0x6'));var attributes=require(_0xdca6('0x7'));module[_0xdca6('0x8')]=function(_0x4a794e,_0x3e499b){return _0x4a794e[_0xdca6('0x9')]('Attachment',attributes,{'tableName':_0xdca6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83c2=['moment','request-promise','path','rimraf','exports','define','Attachment','lodash','util','api'];(function(_0x48d74c,_0x2f597d){var _0x2fe9e3=function(_0x1a1c20){while(--_0x1a1c20){_0x48d74c['push'](_0x48d74c['shift']());}};_0x2fe9e3(++_0x2f597d);}(_0x83c2,0xed));var _0x283c=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x83c2[_0x3ec1da];return _0x472358;};'use strict';var _=require(_0x283c('0x0'));var util=require(_0x283c('0x1'));var logger=require('../../config/logger')(_0x283c('0x2'));var moment=require(_0x283c('0x3'));var BPromise=require('bluebird');var rp=require(_0x283c('0x4'));var fs=require('fs');var path=require(_0x283c('0x5'));var rimraf=require(_0x283c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x283c('0x7')]=function(_0x2f1fa6,_0x2a805b){return _0x2f1fa6[_0x283c('0x8')](_0x283c('0x9'),attributes,{'tableName':'attachments','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 44055ef..f72af6c 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 _0x7d86=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment','Attachment','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7d86,0x86));var _0x67d8=function(_0x50e447,_0x16fbc9){_0x50e447=_0x50e447-0x0;var _0x5ceab8=_0x7d86[_0x50e447];return _0x5ceab8;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2485fa,_0x282b7a,_0x30c690){return new BPromise(function(_0x16e834,_0x31726a){return client[_0x67d8('0xc')](_0x2485fa,_0x30c690)[_0x67d8('0xd')](function(_0x6bc54c){logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));logger[_0x67d8('0x11')](_0x67d8('0x12'),_0x282b7a,_0x67d8('0x10'),JSON[_0x67d8('0x13')](_0x6bc54c));if(_0x6bc54c[_0x67d8('0x14')]){if(_0x6bc54c[_0x67d8('0x14')]['code']===0x1f4){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')]['message']);return _0x31726a(_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);}logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);return _0x16e834(_0x6bc54c[_0x67d8('0x14')]['message']);}else{logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));_0x16e834(_0x6bc54c['result'][_0x67d8('0x15')]);}})[_0x67d8('0x16')](function(_0x4b2795){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x4b2795);_0x31726a(_0x4b2795);});});}exports[_0x67d8('0x17')]=function(_0xefaaea){var _0x23328d=this;return new Promise(function(_0x2a9e66,_0x5117d0){return db[_0x67d8('0x18')][_0x67d8('0x19')](_0xefaaea[_0x67d8('0x1a')],{'raw':_0xefaaea[_0x67d8('0x1b')]?_0xefaaea[_0x67d8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x67d8('0xd')](function(_0x1f682e){logger['info']('CreateAttachment',_0xefaaea);logger[_0x67d8('0x11')]('CreateAttachment',_0xefaaea,JSON[_0x67d8('0x13')](_0x1f682e));_0x2a9e66(_0x1f682e);})[_0x67d8('0x16')](function(_0xdcba3e){logger['error']('CreateAttachment',_0xdcba3e[_0x67d8('0x15')],_0xefaaea);_0x5117d0(_0x23328d[_0x67d8('0x14')](0x1f4,_0xdcba3e[_0x67d8('0x15')]));});});}; \ No newline at end of file +var _0xd246=['../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xd246,0xf5));var _0x6d24=function(_0x1c5037,_0x52e4d0){_0x1c5037=_0x1c5037-0x0;var _0x1e6ead=_0xd246[_0x1c5037];return _0x1e6ead;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var moment=require(_0x6d24('0x2'));var BPromise=require(_0x6d24('0x3'));var rs=require(_0x6d24('0x4'));var fs=require('fs');var Redis=require(_0x6d24('0x5'));var db=require(_0x6d24('0x6'))['db'];var utils=require(_0x6d24('0x7'));var logger=require('../../config/logger')(_0x6d24('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d24('0x9'));var client=jayson['client'][_0x6d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f6dfa,_0x1dcaa2,_0x358a65){return new BPromise(function(_0x38e1eb,_0x43500f){return client[_0x6d24('0xb')](_0x7f6dfa,_0x358a65)['then'](function(_0x5a05d3){logger[_0x6d24('0xc')]('Attachment,\x20%s,\x20%s',_0x1dcaa2,_0x6d24('0xd'));logger['debug'](_0x6d24('0xe'),_0x1dcaa2,'request\x20sent',JSON[_0x6d24('0xf')](_0x5a05d3));if(_0x5a05d3[_0x6d24('0x10')]){if(_0x5a05d3['error'][_0x6d24('0x11')]===0x1f4){logger['error'](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')]['message']);return _0x43500f(_0x5a05d3['error']['message']);}logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')][_0x6d24('0x13')]);return _0x38e1eb(_0x5a05d3['error']['message']);}else{logger[_0x6d24('0xc')](_0x6d24('0x12'),_0x1dcaa2,_0x6d24('0xd'));_0x38e1eb(_0x5a05d3['result']['message']);}})[_0x6d24('0x14')](function(_0x336aeb){logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x336aeb);_0x43500f(_0x336aeb);});});}exports[_0x6d24('0x15')]=function(_0xad7d02){var _0x49a269=this;return new Promise(function(_0x5b81b4,_0x430b55){return db[_0x6d24('0x16')][_0x6d24('0x17')](_0xad7d02['body'],{'raw':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x19')]===undefined?!![]:![]:!![]})[_0x6d24('0x1a')](function(_0x359430){logger['info'](_0x6d24('0x15'),_0xad7d02);logger[_0x6d24('0x1b')]('CreateAttachment',_0xad7d02,JSON[_0x6d24('0xf')](_0x359430));_0x5b81b4(_0x359430);})['catch'](function(_0xca50d5){logger[_0x6d24('0x10')](_0x6d24('0x15'),_0xca50d5[_0x6d24('0x13')],_0xad7d02);_0x430b55(_0x49a269[_0x6d24('0x10')](0x1f4,_0xca50d5[_0x6d24('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 025706c..de79136 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 _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(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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 +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(_0x2aa66,_0x3e2602){var _0x5f3186=function(_0x4ee46d){while(--_0x4ee46d){_0x2aa66['push'](_0x2aa66['shift']());}};_0x5f3186(++_0x3e2602);}(_0xb10b,0x12a));var _0xbb10=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xb10b[_0x562f3b];return _0x1edd55;};'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 diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0bde7c8..14fda2a 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 _0x3037=['clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','lodash','passport-google-oauth20','../../config/environment','authenticate','google','/login','profile','email','clientID','clientSecret','secret','callbackURL','findOne','then','User','find','map','value','admin','user','agent','disabled','blockDuration','blocked','blockedAt','add','minutes'];(function(_0x3ef945,_0x160bd6){var _0x2e8505=function(_0x92c091){while(--_0x92c091){_0x3ef945['push'](_0x3ef945['shift']());}};_0x2e8505(++_0x160bd6);}(_0x3037,0x7b));var _0x7303=function(_0x972141,_0x3cfdd7){_0x972141=_0x972141-0x0;var _0x5dfa30=_0x3037[_0x972141];return _0x5dfa30;};'use strict';var _=require(_0x7303('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x7303('0x1'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x7303('0x2'));var signToken=require('../../components/auth/service')['signToken'];var utils=require('../../config/utils');exports['login']=passport[_0x7303('0x3')](_0x7303('0x4'),{'failureRedirect':_0x7303('0x5'),'scope':[_0x7303('0x6'),_0x7303('0x7')],'session':![]});exports['callback']=passport[_0x7303('0x3')](_0x7303('0x4'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x7303('0x4')][_0x7303('0x8')]:'id','clientSecret':config[_0x7303('0x4')]?config[_0x7303('0x4')][_0x7303('0x9')]:_0x7303('0xa'),'callbackURL':config[_0x7303('0x4')]?config[_0x7303('0x4')][_0x7303('0xb')]:''},function(_0x59f554,_0x1fb1d5,_0x2b8368,_0x5e6765){var _0x3766f8,_0x5617b4;return db['Setting'][_0x7303('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x7303('0xd')](function(_0x1a68d0){_0x3766f8=_0x1a68d0;return db[_0x7303('0xe')][_0x7303('0xf')]({'where':{'email':_[_0x7303('0x10')](_0x2b8368['emails'],_0x7303('0x11')),'role':{'$or':[_0x7303('0x12'),_0x7303('0x13'),_0x7303('0x14')]}}});})[_0x7303('0xd')](function(_0x13da78){_0x5617b4=_0x13da78;if(_0x5617b4){if(_0x5617b4[_0x7303('0x15')]){return _0x5e6765('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3766f8[_0x7303('0x16')]>0x0){if(_0x5617b4[_0x7303('0x17')]){if(moment(_0x5617b4[_0x7303('0x18')])[_0x7303('0x19')](_0x3766f8[_0x7303('0x16')],_0x7303('0x1a'))>moment()){return _0x5e6765('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x7303('0x1b')](_0x5617b4,0x0,![],null)[_0x7303('0xd')](function(){return utils['getLicense'](_0x5617b4);})[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}else{return utils[_0x7303('0x1c')](_0x5617b4)[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}else{return utils[_0x7303('0x1c')](_0x5617b4)[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}return _0x5e6765(_0x7303('0x1d'));})['catch'](function(_0xbc0e84){_0x5e6765(_0xbc0e84);});})); \ No newline at end of file +var _0x18e9=['value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','/login','profile','callback','authenticate','google','use','clientID','secret','Setting','blockDuration','then','User','find','emails'];(function(_0x381043,_0x10619d){var _0x3b1ef1=function(_0x1bc04a){while(--_0x1bc04a){_0x381043['push'](_0x381043['shift']());}};_0x3b1ef1(++_0x10619d);}(_0x18e9,0x161));var _0x918e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x18e9[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x918e('0x0'));var passport=require(_0x918e('0x1'));var GoogleStrategy=require(_0x918e('0x2'))[_0x918e('0x3')];var moment=require('moment');var db=require(_0x918e('0x4'))['db'];var config=require(_0x918e('0x5'));var signToken=require(_0x918e('0x6'))['signToken'];var utils=require('../../config/utils');exports['login']=passport['authenticate']('google',{'failureRedirect':_0x918e('0x7'),'scope':[_0x918e('0x8'),'email'],'session':![]});exports[_0x918e('0x9')]=passport[_0x918e('0xa')](_0x918e('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x918e('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x918e('0xb')][_0x918e('0xd')]:'id','clientSecret':config[_0x918e('0xb')]?config[_0x918e('0xb')]['clientSecret']:_0x918e('0xe'),'callbackURL':config[_0x918e('0xb')]?config[_0x918e('0xb')]['callbackURL']:''},function(_0x1f8644,_0x45c3e0,_0x254544,_0x5066ef){var _0x872a87,_0x4694d2;return db[_0x918e('0xf')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x918e('0x10')],'raw':!![]})[_0x918e('0x11')](function(_0x5439bc){_0x872a87=_0x5439bc;return db[_0x918e('0x12')][_0x918e('0x13')]({'where':{'email':_['map'](_0x254544[_0x918e('0x14')],_0x918e('0x15')),'role':{'$or':[_0x918e('0x16'),_0x918e('0x17'),_0x918e('0x18')]}}});})[_0x918e('0x11')](function(_0x5f07e2){_0x4694d2=_0x5f07e2;if(_0x4694d2){if(_0x4694d2[_0x918e('0x19')]){return _0x5066ef(_0x918e('0x1a'));}else if(_0x872a87[_0x918e('0x10')]>0x0){if(_0x4694d2[_0x918e('0x1b')]){if(moment(_0x4694d2[_0x918e('0x1c')])[_0x918e('0x1d')](_0x872a87[_0x918e('0x10')],_0x918e('0x1e'))>moment()){return _0x5066ef(_0x918e('0x1a'));}else{return utils[_0x918e('0x1f')](_0x4694d2,0x0,![],null)[_0x918e('0x11')](function(){return utils[_0x918e('0x20')](_0x4694d2);})[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}return _0x5066ef(_0x918e('0x1a'));})[_0x918e('0x21')](function(_0x7b9ecf){_0x5066ef(_0x7b9ecf);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 02f7983..5a77818 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 _0x331e=['../user/user.controller.js','../../components/auth/service','login','get','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller'];(function(_0x520a1b,_0x446485){var _0x11bea9=function(_0x2241cc){while(--_0x2241cc){_0x520a1b['push'](_0x520a1b['shift']());}};_0x11bea9(++_0x446485);}(_0x331e,0x193));var _0xe331=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x331e[_0x4be8ba];return _0x1af822;};'use strict';var express=require(_0xe331('0x0'));var passport=require(_0xe331('0x1'));var router=express[_0xe331('0x2')]();var controller=require(_0xe331('0x3'));var userController=require(_0xe331('0x4'));var authService=require(_0xe331('0x5'));router['get']('/',controller[_0xe331('0x6')]);router[_0xe331('0x7')]('/callback',controller[_0xe331('0x8')],authService[_0xe331('0x9')],userController['login'],authService[_0xe331('0xa')]);module['exports']=router; \ No newline at end of file +var _0xc4c4=['callback','setTokenCookie','passport','Router','./authGoogle.controller','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4c4,0xec));var _0x4c4c=function(_0x205e56,_0x366e77){_0x205e56=_0x205e56-0x0;var _0x489d5d=_0xc4c4[_0x205e56];return _0x489d5d;};'use strict';var express=require('express');var passport=require(_0x4c4c('0x0'));var router=express[_0x4c4c('0x1')]();var controller=require(_0x4c4c('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4c4c('0x3')]('/',controller['login']);router[_0x4c4c('0x3')]('/callback',controller[_0x4c4c('0x4')],authService['isMiddleware'],userController['login'],authService[_0x4c4c('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 895fca4..4b643c4 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 _0xe2d3=['Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','email','trim','toLowerCase','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','then','name','password','role','disabled','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find'];(function(_0x270a02,_0x223adb){var _0x3cd07b=function(_0x387642){while(--_0x387642){_0x270a02['push'](_0x270a02['shift']());}};_0x3cd07b(++_0x223adb);}(_0xe2d3,0x1ce));var _0x3e2d=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xe2d3[_0x216d45];return _0xbaac0b;};'use strict';var util=require(_0x3e2d('0x0'));var passport=require(_0x3e2d('0x1'));var LocalStrategy=require(_0x3e2d('0x2'))['Strategy'];var jayson=require(_0x3e2d('0x3'));var _=require('lodash');var rs=require(_0x3e2d('0x4'));var moment=require(_0x3e2d('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x3e2d('0x6'));var utils=require(_0x3e2d('0x7'));var client=jayson[_0x3e2d('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x23c01b,_0x3b07de,_0x28e11d,_0x50d28f){var _0x43c8cf,_0x3ad947;return db[_0x3e2d('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x3e2d('0xa'),'blockDuration'],'raw':!![]})[_0x3e2d('0xb')](function(_0xf424ce){_0x43c8cf=_0xf424ce;return _0x23c01b['findOne']({'attributes':['id',_0x3e2d('0xc'),_0x3e2d('0xd'),'salt',_0x3e2d('0xe'),_0x3e2d('0xf'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x3b07de,'role':{'$or':['admin',_0x3e2d('0x10'),'agent']}}});})['then'](function(_0xe8df15){if(!_0xe8df15||_0xe8df15&&_0xe8df15[_0x3e2d('0xc')]!==_0x3b07de){throw new Error(_0x3e2d('0x11'));}else{_0x3ad947=_0xe8df15;return _0x3ad947;}})[_0x3e2d('0xb')](function(){_0x3ad947[_0x3e2d('0x12')](_0x28e11d,function(_0x4f0017,_0x43b9a7){var _0x1da84e=_0x3ad947[_0x3e2d('0x13')]+0x1;if(_0x4f0017){return _0x50d28f(_0x4f0017);}else if(!_0x43b9a7){if(_0x3ad947['disabled']){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else if(_0x43c8cf[_0x3e2d('0xa')]>0x0){if(_0x3ad947[_0x3e2d('0x14')]){if(_0x43c8cf[_0x3e2d('0x15')]>0x0){if(moment(_0x3ad947[_0x3e2d('0x16')])[_0x3e2d('0x17')](_0x43c8cf[_0x3e2d('0x15')],'minutes')>moment()){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils[_0x3e2d('0x18')](_0x3ad947,_0x1da84e,![],null)['then'](function(){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});});}}else{return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1da84e>=_0x43c8cf['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3ad947,0x0,!![],moment())['then'](function(){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});});}else{return utils[_0x3e2d('0x18')](_0x3ad947,_0x1da84e,![],null)[_0x3e2d('0xb')](function(){return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}}else{if(_0x3ad947['disabled']){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else if(_0x43c8cf[_0x3e2d('0xa')]>0x0){if(_0x3ad947[_0x3e2d('0x14')]){if(_0x43c8cf[_0x3e2d('0x15')]>0x0){if(moment(_0x3ad947['blockedAt'])['add'](_0x43c8cf[_0x3e2d('0x15')],_0x3e2d('0x19'))>moment()){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils['clearBlockUser'](_0x3ad947,0x0,![],null)[_0x3e2d('0xb')](function(){return utils[_0x3e2d('0x1a')](_0x3ad947);})[_0x3e2d('0xb')](function(){return _0x50d28f(null,_0x3ad947);});}}else{return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3e2d('0x18')](_0x3ad947,0x0,![],null)[_0x3e2d('0xb')](function(){return utils['getLicense'](_0x3ad947);})['then'](function(){return _0x50d28f(null,_0x3ad947);})[_0x3e2d('0x1b')](function(_0x16a9cc){return _0x50d28f(null,![],_0x16a9cc);});}}else{if(_0x3ad947[_0x3e2d('0x14')]){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils[_0x3e2d('0x1a')](_0x3ad947)[_0x3e2d('0xb')](function(){return _0x50d28f(null,_0x3ad947);});}}}});})[_0x3e2d('0x1b')](function(_0x419e51){return _0x50d28f(null,![],_0x419e51);});}function sendServiceMail(_0x13f9e9){return db[_0x3e2d('0x1c')][_0x3e2d('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x3e2d('0xc'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x3e2d('0x1e')}]})[_0x3e2d('0xb')](function(_0xc2b3ce){if(!_0xc2b3ce){throw new Error(_0x3e2d('0x1f'));}var _0x151f78={'tls':{'rejectUnauthorized':![]}};if(_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x20')]){_0x151f78[_0x3e2d('0x20')]=_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x20')];}else{_0x151f78[_0x3e2d('0x21')]=_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x21')];_0x151f78[_0x3e2d('0x22')]=_0xc2b3ce[_0x3e2d('0x1e')]['port'];_0x151f78[_0x3e2d('0x23')]=_0xc2b3ce['Smtp']['secure'];}if(_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x24')]){_0x151f78['auth']={'user':_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x10')],'pass':_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x25')]};}var _0x341583={'account':_0x151f78,'message':_['merge']({'from':util['format'](_0x3e2d('0x26'),_0xc2b3ce[_0x3e2d('0xc')],_0xc2b3ce['email']||_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x10')])},_0x13f9e9)};return client[_0x3e2d('0x27')](_0x3e2d('0x28'),_0x341583);})[_0x3e2d('0xb')](function(_0x42c822){if(_0x42c822['error']){throw new Error(util[_0x3e2d('0x29')](_0x3e2d('0x2a'),_0x42c822[_0x3e2d('0x2b')][_0x3e2d('0x2c')]||JSON[_0x3e2d('0x2d')](_0x42c822[_0x3e2d('0x2b')])));}return!![];});}function handleError(_0x34051a,_0xc2f8c0,_0x2b63e0){return _0x34051a[_0x3e2d('0x2e')](_0xc2f8c0||0x1f4)[_0x3e2d('0x2f')]({'message':_0x2b63e0?_0x2b63e0[_0x3e2d('0x2c')]||_0x2b63e0:''});}exports['login']=function(_0xc9c4f3,_0x26240c,_0x15dbb0){passport[_0x3e2d('0x12')](_0x3e2d('0x30'),function(_0x363008,_0x366c1c,_0x361859){var _0x5d0e55=_0x363008||_0x361859;if(_0x5d0e55){return handleError(_0x26240c,0x191,_0x5d0e55);}if(!_0x366c1c){return handleError(_0x26240c,0x194,{'message':_0x3e2d('0x31')});}else{var _0x55ef56={'payload':{'id':_0x366c1c['id'],'role':_0x366c1c[_0x3e2d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3e2d('0x32')](_0x55ef56)[_0x3e2d('0xb')](function(_0x2c8f08){_0x26240c[_0x3e2d('0x33')]({'id':_0x366c1c['id'],'token':_0x2c8f08,'statusCall':'','isAlreadyLogged':_0x366c1c[_0x3e2d('0x34')]});});}})(_0xc9c4f3,_0x26240c,_0x15dbb0);};exports[_0x3e2d('0x35')]=function(_0x2f8f48,_0x329c1f,_0x2aa3f4){if(!_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]){return handleError(_0x329c1f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57ae7b=rs['generate']();_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]=_0x2f8f48[_0x3e2d('0x36')]['email'][_0x3e2d('0x38')]()[_0x3e2d('0x39')]();var _0x32f9ea;return db[_0x3e2d('0x9')][_0x3e2d('0x3a')]({'where':{'id':0x1},'attributes':[_0x3e2d('0xa'),_0x3e2d('0x15')],'raw':!![]})[_0x3e2d('0xb')](function(_0xdca5b2){_0x32f9ea=_0xdca5b2;return db[_0x3e2d('0x3b')][_0x3e2d('0x1d')]({'where':{'email':_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]}});})['then'](function(_0x2aef1b){if(!_0x2aef1b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2aef1b[_0x3e2d('0xf')]){throw new Error(_0x3e2d('0x3c'));}if(_0x2aef1b[_0x3e2d('0x14')]){if(moment(_0x2aef1b[_0x3e2d('0x16')])[_0x3e2d('0x17')](_0x32f9ea[_0x3e2d('0x15')],_0x3e2d('0x19'))>moment()){throw new Error(_0x3e2d('0x3d'));}else{_0x2aef1b['blocked']=![];_0x2aef1b[_0x3e2d('0x16')]=null;}}_0x2aef1b[_0x3e2d('0x3e')]=_0x57ae7b;_0x2aef1b[_0x3e2d('0x3f')]=Date[_0x3e2d('0x40')]()+0x36ee80;return _0x2aef1b[_0x3e2d('0x41')]();})[_0x3e2d('0xb')](function(){return sendServiceMail({'to':_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')],'subject':_0x3e2d('0x42'),'text':_0x3e2d('0x43')+_0x3e2d('0x44')+_0x3e2d('0x45')+_0x2f8f48[_0x3e2d('0x46')][_0x3e2d('0x21')]+'/reset/'+_0x57ae7b+'\x0a\x0a'+_0x3e2d('0x47')});})[_0x3e2d('0xb')](function(){_0x329c1f[_0x3e2d('0x2e')](0xc8)[_0x3e2d('0x2f')]({'message':_0x3e2d('0x48')});})['catch'](function(_0x59e4fc){return handleError(_0x329c1f,0x1f4,_0x59e4fc);});};exports[_0x3e2d('0x49')]=function(_0x5fe835,_0x212168,_0x29cc0f){return db[_0x3e2d('0x3b')]['find']({'where':{'resetPasswordToken':_0x5fe835['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x3e2d('0x40')]()}}})[_0x3e2d('0xb')](function(_0x4c3ea3){if(!_0x4c3ea3){throw new Error(_0x3e2d('0x4a'));}return db[_0x3e2d('0x9')][_0x3e2d('0x3a')]({'attributes':['id','securePassword',_0x3e2d('0x4b'),_0x3e2d('0x4c')]})[_0x3e2d('0xb')](function(_0x48afbf){if(_0x48afbf[_0x3e2d('0x4d')])authService[_0x3e2d('0x4e')](_0x5fe835[_0x3e2d('0x36')]['password']);if(!_0x48afbf[_0x3e2d('0x4b')]||!_0x4c3ea3[_0x3e2d('0x4f')])return _0x4c3ea3;authService['validatePasswordHistory'](_0x5fe835['body']['password'],_0x4c3ea3[_0x3e2d('0x4f')],_0x48afbf['passwordHistoryLimit']);return _0x4c3ea3;})[_0x3e2d('0xb')](function(){_0x4c3ea3['password']=_0x5fe835[_0x3e2d('0x36')]['password'];_0x4c3ea3[_0x3e2d('0x3e')]=null;_0x4c3ea3[_0x3e2d('0x3f')]=null;return _0x4c3ea3[_0x3e2d('0x41')]();});})[_0x3e2d('0xb')](function(){_0x212168['status'](0xc8)[_0x3e2d('0x2f')]({'message':_0x3e2d('0x50')});})[_0x3e2d('0x1b')](function(_0x40d348){return handleError(_0x212168,0x1f4,_0x40d348);});};passport[_0x3e2d('0x51')](new LocalStrategy({'usernameField':_0x3e2d('0xc'),'passwordField':'password'},function(_0x288e96,_0x4d9e84,_0x45680e){return localAuthenticate(db[_0x3e2d('0x3b')],_0x288e96,_0x4d9e84,_0x45680e);})); \ No newline at end of file +var _0x049e=['Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','use','User','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','name','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x38300c,_0x4618b9){var _0x591bf6=function(_0x3595d9){while(--_0x3595d9){_0x38300c['push'](_0x38300c['shift']());}};_0x591bf6(++_0x4618b9);}(_0x049e,0x16a));var _0xe049=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x049e[_0x28407a];return _0x8bd6ef;};'use strict';var util=require(_0xe049('0x0'));var passport=require(_0xe049('0x1'));var LocalStrategy=require('passport-local')[_0xe049('0x2')];var jayson=require('jayson/promise');var _=require(_0xe049('0x3'));var rs=require(_0xe049('0x4'));var moment=require(_0xe049('0x5'));var db=require(_0xe049('0x6'))['db'];var authService=require(_0xe049('0x7'));var utils=require('../../config/utils');var client=jayson[_0xe049('0x8')][_0xe049('0x9')]({'port':0x232b});function localAuthenticate(_0x22e8f5,_0x221a5f,_0x1d4fc6,_0x17945b){var _0x22abb2,_0x515823;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x45a5fa){_0x22abb2=_0x45a5fa;return _0x22e8f5[_0xe049('0xb')]({'attributes':['id',_0xe049('0xd'),'password','salt','role',_0xe049('0xe'),_0xe049('0xf'),_0xe049('0x10'),_0xe049('0x11')],'where':{'name':_0x221a5f,'role':{'$or':[_0xe049('0x12'),_0xe049('0x13'),_0xe049('0x14')]}}});})[_0xe049('0x15')](function(_0x5272f4){if(!_0x5272f4||_0x5272f4&&_0x5272f4[_0xe049('0xd')]!==_0x221a5f){throw new Error(_0xe049('0x16'));}else{_0x515823=_0x5272f4;return _0x515823;}})[_0xe049('0x15')](function(){_0x515823[_0xe049('0x17')](_0x1d4fc6,function(_0x5f57d3,_0x3a539b){var _0xcc35b6=_0x515823['loginAttempts']+0x1;if(_0x5f57d3){return _0x17945b(_0x5f57d3);}else if(!_0x3a539b){if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823['blockedAt'])[_0xe049('0x19')](_0x22abb2['blockDuration'],'minutes')>moment()){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils['clearBlockUser'](_0x515823,_0xcc35b6,![],null)['then'](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}}else{return _0x17945b(null,![],{'message':_0xe049('0x16')});}}else{if(_0xcc35b6>=_0x22abb2['allowedLoginAttempts']){return utils['clearBlockUser'](_0x515823,0x0,!![],moment())[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}else{return utils[_0xe049('0x1a')](_0x515823,_0xcc35b6,![],null)[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823[_0xe049('0x10')])['add'](_0x22abb2[_0xe049('0x18')],_0xe049('0x1b'))>moment()){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x515823,0x0,![],null)['then'](function(){return utils[_0xe049('0x1c')](_0x515823);})['then'](function(){return _0x17945b(null,_0x515823);});}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe049('0x1a')](_0x515823,0x0,![],null)[_0xe049('0x15')](function(){return utils['getLicense'](_0x515823);})[_0xe049('0x15')](function(){return _0x17945b(null,_0x515823);})[_0xe049('0x1d')](function(_0x3e5c7f){return _0x17945b(null,![],_0x3e5c7f);});}}else{if(_0x515823[_0xe049('0xf')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils[_0xe049('0x1c')](_0x515823)['then'](function(){return _0x17945b(null,_0x515823);});}}}});})['catch'](function(_0x7f5538){return _0x17945b(null,![],_0x7f5538);});}function sendServiceMail(_0x542c7c){return db[_0xe049('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xe049('0xd'),_0xe049('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xe049('0x20')}]})[_0xe049('0x15')](function(_0xb64700){if(!_0xb64700){throw new Error(_0xe049('0x21'));}var _0x4464b2={'tls':{'rejectUnauthorized':![]}};if(_0xb64700[_0xe049('0x20')][_0xe049('0x22')]){_0x4464b2[_0xe049('0x22')]=_0xb64700[_0xe049('0x20')][_0xe049('0x22')];}else{_0x4464b2[_0xe049('0x23')]=_0xb64700['Smtp'][_0xe049('0x23')];_0x4464b2[_0xe049('0x24')]=_0xb64700['Smtp']['port'];_0x4464b2['secure']=_0xb64700['Smtp'][_0xe049('0x25')];}if(_0xb64700[_0xe049('0x20')][_0xe049('0x26')]){_0x4464b2[_0xe049('0x27')]={'user':_0xb64700[_0xe049('0x20')]['user'],'pass':_0xb64700[_0xe049('0x20')][_0xe049('0x28')]};}var _0x2fd840={'account':_0x4464b2,'message':_[_0xe049('0x29')]({'from':util[_0xe049('0x2a')]('\x22%s\x22\x20<%s>',_0xb64700[_0xe049('0xd')],_0xb64700['email']||_0xb64700[_0xe049('0x20')]['user'])},_0x542c7c)};return client[_0xe049('0x2b')](_0xe049('0x2c'),_0x2fd840);})[_0xe049('0x15')](function(_0x464c1d){if(_0x464c1d[_0xe049('0x2d')]){throw new Error(util[_0xe049('0x2a')](_0xe049('0x2e'),_0x464c1d[_0xe049('0x2d')][_0xe049('0x2f')]||JSON[_0xe049('0x30')](_0x464c1d[_0xe049('0x2d')])));}return!![];});}function handleError(_0x5275c5,_0x3b1c65,_0x1b21d9){return _0x5275c5[_0xe049('0x31')](_0x3b1c65||0x1f4)[_0xe049('0x32')]({'message':_0x1b21d9?_0x1b21d9[_0xe049('0x2f')]||_0x1b21d9:''});}exports[_0xe049('0x33')]=function(_0x2285d4,_0x1e39f2,_0x54df1a){passport[_0xe049('0x17')](_0xe049('0x34'),function(_0x3ba5e5,_0x144e48,_0x5e9613){var _0xe17673=_0x3ba5e5||_0x5e9613;if(_0xe17673){return handleError(_0x1e39f2,0x191,_0xe17673);}if(!_0x144e48){return handleError(_0x1e39f2,0x194,{'message':_0xe049('0x35')});}else{var _0x3963e6={'payload':{'id':_0x144e48['id'],'role':_0x144e48[_0xe049('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0xe049('0x37')](_0x3963e6)['then'](function(_0x245f86){_0x1e39f2[_0xe049('0x38')]({'id':_0x144e48['id'],'token':_0x245f86,'statusCall':'','isAlreadyLogged':_0x144e48[_0xe049('0x39')]});});}})(_0x2285d4,_0x1e39f2,_0x54df1a);};exports['forgot']=function(_0x28ae88,_0x4fb4e1,_0x570fa8){if(!_0x28ae88[_0xe049('0x3a')]['email']){return handleError(_0x4fb4e1,0x1f4,{'message':_0xe049('0x3b')});}var _0x29e029=rs[_0xe049('0x3c')]();_0x28ae88[_0xe049('0x3a')][_0xe049('0x1f')]=_0x28ae88['body'][_0xe049('0x1f')][_0xe049('0x3d')]()['toLowerCase']();var _0x546137;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),_0xe049('0x18')],'raw':!![]})[_0xe049('0x15')](function(_0x1d5da2){_0x546137=_0x1d5da2;return db['User'][_0xe049('0x3e')]({'where':{'email':_0x28ae88[_0xe049('0x3a')]['email']}});})[_0xe049('0x15')](function(_0x29cfa4){if(!_0x29cfa4){throw new Error(_0xe049('0x3f'));}if(_0x29cfa4[_0xe049('0xe')]){throw new Error(_0xe049('0x40'));}if(_0x29cfa4['blocked']){if(moment(_0x29cfa4['blockedAt'])[_0xe049('0x19')](_0x546137[_0xe049('0x18')],_0xe049('0x1b'))>moment()){throw new Error(_0xe049('0x41'));}else{_0x29cfa4[_0xe049('0xf')]=![];_0x29cfa4[_0xe049('0x10')]=null;}}_0x29cfa4['resetPasswordToken']=_0x29e029;_0x29cfa4[_0xe049('0x42')]=Date[_0xe049('0x43')]()+0x36ee80;return _0x29cfa4['save']();})[_0xe049('0x15')](function(){return sendServiceMail({'to':_0x28ae88['body'][_0xe049('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe049('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe049('0x45')+_0x28ae88[_0xe049('0x46')][_0xe049('0x23')]+_0xe049('0x47')+_0x29e029+'\x0a\x0a'+_0xe049('0x48')});})['then'](function(){_0x4fb4e1[_0xe049('0x31')](0xc8)[_0xe049('0x32')]({'message':_0xe049('0x49')});})[_0xe049('0x1d')](function(_0x3d1908){return handleError(_0x4fb4e1,0x1f4,_0x3d1908);});};exports[_0xe049('0x4a')]=function(_0x12f9b8,_0x1b94b5,_0x4568ac){return db['User']['find']({'where':{'resetPasswordToken':_0x12f9b8[_0xe049('0x4b')][_0xe049('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xe049('0x43')]()}}})[_0xe049('0x15')](function(_0x254dc6){if(!_0x254dc6){throw new Error(_0xe049('0x4d'));}return db[_0xe049('0xa')][_0xe049('0xb')]({'attributes':['id',_0xe049('0x4e'),_0xe049('0x4f'),_0xe049('0x50')]})['then'](function(_0x36346a){if(_0x36346a[_0xe049('0x4e')])authService[_0xe049('0x51')](_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')]);if(!_0x36346a[_0xe049('0x4f')]||!_0x254dc6[_0xe049('0x53')])return _0x254dc6;authService['validatePasswordHistory'](_0x12f9b8['body']['password'],_0x254dc6[_0xe049('0x53')],_0x36346a[_0xe049('0x50')]);return _0x254dc6;})['then'](function(){_0x254dc6[_0xe049('0x52')]=_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')];_0x254dc6[_0xe049('0x54')]=null;_0x254dc6['resetPasswordExpires']=null;return _0x254dc6['save']();});})[_0xe049('0x15')](function(){_0x1b94b5[_0xe049('0x31')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xe049('0x1d')](function(_0x57158d){return handleError(_0x1b94b5,0x1f4,_0x57158d);});};passport[_0xe049('0x55')](new LocalStrategy({'usernameField':_0xe049('0xd'),'passwordField':'password'},function(_0x6b2cf6,_0x56b9d9,_0x356605){return localAuthenticate(db[_0xe049('0x56')],_0x6b2cf6,_0x56b9d9,_0x356605);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 557116e..5101aa8 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 _0xaa93=['exports','express','Router','./authLocal.controller','post','/forgot','reset'];(function(_0x222702,_0x32b9ce){var _0x22554b=function(_0x38c45c){while(--_0x38c45c){_0x222702['push'](_0x222702['shift']());}};_0x22554b(++_0x32b9ce);}(_0xaa93,0x1e4));var _0x3aa9=function(_0x5cdb94,_0x1eb11b){_0x5cdb94=_0x5cdb94-0x0;var _0x1316fb=_0xaa93[_0x5cdb94];return _0x1316fb;};'use strict';var express=require(_0x3aa9('0x0'));var router=express[_0x3aa9('0x1')]();var controller=require(_0x3aa9('0x2'));router[_0x3aa9('0x3')]('/',controller['login']);router[_0x3aa9('0x3')](_0x3aa9('0x4'),controller['forgot']);router[_0x3aa9('0x3')]('/reset/:token',controller[_0x3aa9('0x5')]);module[_0x3aa9('0x6')]=router; \ No newline at end of file +var _0x58ce=['./authLocal.controller','login','post','/forgot','forgot','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58ce,0xde));var _0xe58c=function(_0x44fbaa,_0x372026){_0x44fbaa=_0x44fbaa-0x0;var _0x2201e3=_0x58ce[_0x44fbaa];return _0x2201e3;};'use strict';var express=require(_0xe58c('0x0'));var router=express[_0xe58c('0x1')]();var controller=require(_0xe58c('0x2'));router['post']('/',controller[_0xe58c('0x3')]);router[_0xe58c('0x4')](_0xe58c('0x5'),controller[_0xe58c('0x6')]);router['post']('/reset/:token',controller['reset']);module[_0xe58c('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 65454d7..fba21be 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 _0x4768=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x35c324,_0x1d544f){var _0x11e905=function(_0x4d1956){while(--_0x4d1956){_0x35c324['push'](_0x35c324['shift']());}};_0x11e905(++_0x1d544f);}(_0x4768,0xc2));var _0x8476=function(_0x43be32,_0x21737c){_0x43be32=_0x43be32-0x0;var _0x171708=_0x4768[_0x43be32];return _0x171708;};'use strict';var Sequelize=require(_0x8476('0x0'));module['exports']={'name':{'type':Sequelize[_0x8476('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8476('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8476('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8476('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x0f05=['STRING','INTEGER','sequelize','exports'];(function(_0x560c8d,_0x1cf910){var _0xb7e136=function(_0x203eb6){while(--_0x203eb6){_0x560c8d['push'](_0x560c8d['shift']());}};_0xb7e136(++_0x1cf910);}(_0x0f05,0x16e));var _0x50f0=function(_0x250c2c,_0x2149f8){_0x250c2c=_0x250c2c-0x0;var _0x164073=_0x0f05[_0x250c2c];return _0x164073;};'use strict';var Sequelize=require(_0x50f0('0x0'));module[_0x50f0('0x1')]={'name':{'type':Sequelize[_0x50f0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x50f0('0x2')]},'description':{'type':Sequelize[_0x50f0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x50f0('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index f371d69..eec1d2d 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 _0x7915=['request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','Automation','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','addConditions','Condition','omit','getConditions','length','pick','addActions','ids','getActions','findOne','Action','nolimit','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x126f42,_0x57f1ad){var _0x219119=function(_0xc6b727){while(--_0xc6b727){_0x126f42['push'](_0x126f42['shift']());}};_0x219119(++_0x57f1ad);}(_0x7915,0x154));var _0x5791=function(_0x58c490,_0x1b5a0a){_0x58c490=_0x58c490-0x0;var _0x4259e0=_0x7915[_0x58c490];return _0x4259e0;};'use strict';var emlformat=require(_0x5791('0x0'));var rimraf=require(_0x5791('0x1'));var zipdir=require(_0x5791('0x2'));var jsonpatch=require(_0x5791('0x3'));var rp=require(_0x5791('0x4'));var moment=require(_0x5791('0x5'));var BPromise=require(_0x5791('0x6'));var Mustache=require(_0x5791('0x7'));var util=require(_0x5791('0x8'));var path=require(_0x5791('0x9'));var sox=require('sox');var csv=require(_0x5791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5791('0xb'));var squel=require(_0x5791('0xc'));var crypto=require(_0x5791('0xd'));var jsforce=require(_0x5791('0xe'));var deskjs=require(_0x5791('0xf'));var toCsv=require(_0x5791('0xa'));var querystring=require(_0x5791('0x10'));var Papa=require('papaparse');var Redis=require(_0x5791('0x11'));var authService=require(_0x5791('0x12'));var qs=require(_0x5791('0x13'));var as=require(_0x5791('0x14'));var hardwareService=require(_0x5791('0x15'));var logger=require(_0x5791('0x16'))(_0x5791('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5791('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b72e,_0x1c3a30){_0x1c3a30=_0x1c3a30||0xcc;return function(_0xcad90){if(_0xcad90){return _0x53b72e[_0x5791('0x19')](_0x1c3a30);}return _0x53b72e[_0x5791('0x1a')](_0x1c3a30)[_0x5791('0x1b')]();};}function respondWithResult(_0x56886c,_0x1c1203){_0x1c1203=_0x1c1203||0xc8;return function(_0x5ece7e){if(_0x5ece7e){return _0x56886c[_0x5791('0x1a')](_0x1c1203)['json'](_0x5ece7e);}};}function respondWithFilteredResult(_0x4ee297,_0x567834){return function(_0x426e11){if(_0x426e11){var _0x754dc7=typeof _0x567834[_0x5791('0x1c')]===_0x5791('0x1d')&&typeof _0x567834[_0x5791('0x1e')]==='undefined';var _0x386019=_0x426e11[_0x5791('0x1f')];var _0x308592=_0x754dc7?0x0:_0x567834[_0x5791('0x1c')];var _0x1e280a=_0x754dc7?_0x426e11[_0x5791('0x1f')]:_0x567834[_0x5791('0x1c')]+_0x567834['limit'];var _0x13d488;if(_0x1e280a>=_0x386019){_0x1e280a=_0x386019;_0x13d488=0xc8;}else{_0x13d488=0xce;}_0x4ee297[_0x5791('0x1a')](_0x13d488);return _0x4ee297[_0x5791('0x20')](_0x5791('0x21'),_0x308592+'-'+_0x1e280a+'/'+_0x386019)['json'](_0x426e11);}return null;};}function patchUpdates(_0x2e97b3){return function(_0x397478){try{jsonpatch[_0x5791('0x22')](_0x397478,_0x2e97b3,!![]);}catch(_0x182c1d){return BPromise[_0x5791('0x23')](_0x182c1d);}return _0x397478[_0x5791('0x24')]();};}function saveUpdates(_0x4f04b0,_0x439f2b){return function(_0x12c2fc){if(_0x12c2fc){return _0x12c2fc[_0x5791('0x25')](_0x4f04b0)[_0x5791('0x26')](function(_0xcfd590){return _0xcfd590;});}return null;};}function removeEntity(_0x27ce85,_0x277e3e){return function(_0x45098e){if(_0x45098e){return _0x45098e[_0x5791('0x27')]()[_0x5791('0x26')](function(){_0x27ce85['status'](0xcc)[_0x5791('0x1b')]();});}};}function handleEntityNotFound(_0x3adb30,_0x5593c3){return function(_0x47f302){if(!_0x47f302){_0x3adb30['sendStatus'](0x194);}return _0x47f302;};}function handleError(_0x170483,_0x3b3619){_0x3b3619=_0x3b3619||0x1f4;return function(_0x400a7a){logger['error'](_0x400a7a[_0x5791('0x28')]);if(_0x400a7a['name']){delete _0x400a7a['name'];}_0x170483[_0x5791('0x1a')](_0x3b3619)[_0x5791('0x29')](_0x400a7a);};}exports[_0x5791('0x2a')]=function(_0x31f0c7,_0x5be759){var _0x3ddc37={},_0x3fef31={},_0x22c3fd={'count':0x0,'rows':[]};var _0x3797e7=_[_0x5791('0x2b')](db[_0x5791('0x2c')][_0x5791('0x2d')],function(_0x21e959){return{'name':_0x21e959[_0x5791('0x2e')],'type':_0x21e959[_0x5791('0x2f')][_0x5791('0x30')]};});_0x3fef31[_0x5791('0x31')]=_['map'](_0x3797e7,_0x5791('0x32'));_0x3fef31[_0x5791('0x33')]=_[_0x5791('0x34')](_0x31f0c7[_0x5791('0x33')]);_0x3fef31['filters']=_[_0x5791('0x35')](_0x3fef31[_0x5791('0x31')],_0x3fef31[_0x5791('0x33')]);_0x3ddc37[_0x5791('0x36')]=_[_0x5791('0x35')](_0x3fef31[_0x5791('0x31')],qs['fields'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x37')]));_0x3ddc37[_0x5791('0x36')]=_0x3ddc37[_0x5791('0x36')]['length']?_0x3ddc37[_0x5791('0x36')]:_0x3fef31[_0x5791('0x31')];if(!_0x31f0c7[_0x5791('0x33')][_0x5791('0x38')]('nolimit')){_0x3ddc37[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x31f0c7[_0x5791('0x33')][_0x5791('0x1e')]);_0x3ddc37[_0x5791('0x1c')]=qs['offset'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x1c')]);}_0x3ddc37[_0x5791('0x39')]=qs['sort'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x3a')]);_0x3ddc37[_0x5791('0x3b')]=qs[_0x5791('0x3c')](_['pick'](_0x31f0c7[_0x5791('0x33')],_0x3fef31[_0x5791('0x3c')]),_0x3797e7);if(_0x31f0c7['query'][_0x5791('0x3d')]){_0x3ddc37[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0x3ddc37['where'],{'$or':_[_0x5791('0x2b')](_0x3797e7,function(_0x40b1b7){if(_0x40b1b7[_0x5791('0x2f')]!==_0x5791('0x3f')){var _0x15afbe={};_0x15afbe[_0x40b1b7[_0x5791('0x32')]]={'$like':'%'+_0x31f0c7[_0x5791('0x33')][_0x5791('0x3d')]+'%'};return _0x15afbe;}})});}_0x3ddc37=_[_0x5791('0x3e')]({},_0x3ddc37,_0x31f0c7[_0x5791('0x40')]);var _0x301a2d={'where':_0x3ddc37[_0x5791('0x3b')]};return db[_0x5791('0x2c')][_0x5791('0x1f')](_0x301a2d)['then'](function(_0xc05d82){_0x22c3fd[_0x5791('0x1f')]=_0xc05d82;if(_0x31f0c7[_0x5791('0x33')][_0x5791('0x41')]){_0x3ddc37[_0x5791('0x42')]=[{'all':!![]}];}return db[_0x5791('0x2c')]['findAll'](_0x3ddc37);})[_0x5791('0x26')](function(_0x21aacb){_0x22c3fd[_0x5791('0x43')]=_0x21aacb;return _0x22c3fd;})[_0x5791('0x26')](respondWithFilteredResult(_0x5be759,_0x3ddc37))[_0x5791('0x44')](handleError(_0x5be759,null));};exports[_0x5791('0x45')]=function(_0x59bda3,_0x34eb27){var _0x10eee4={'raw':![],'where':{'id':_0x59bda3[_0x5791('0x46')]['id']}},_0x46efa0={};_0x46efa0[_0x5791('0x31')]=_[_0x5791('0x34')](db['Automation'][_0x5791('0x2d')]);_0x46efa0[_0x5791('0x33')]=_[_0x5791('0x34')](_0x59bda3['query']);_0x46efa0[_0x5791('0x3c')]=_['intersection'](_0x46efa0['model'],_0x46efa0[_0x5791('0x33')]);_0x10eee4[_0x5791('0x36')]=_[_0x5791('0x35')](_0x46efa0[_0x5791('0x31')],qs[_0x5791('0x37')](_0x59bda3[_0x5791('0x33')]['fields']));_0x10eee4[_0x5791('0x36')]=_0x10eee4[_0x5791('0x36')]['length']?_0x10eee4[_0x5791('0x36')]:_0x46efa0[_0x5791('0x31')];if(_0x59bda3['query'][_0x5791('0x41')]){_0x10eee4['include']=[{'all':!![]}];}_0x10eee4=_['merge']({},_0x10eee4,_0x59bda3['options']);return db['Automation'][_0x5791('0x47')](_0x10eee4)[_0x5791('0x26')](handleEntityNotFound(_0x34eb27,null))['then'](respondWithResult(_0x34eb27,null))[_0x5791('0x44')](handleError(_0x34eb27,null));};exports[_0x5791('0x48')]=function(_0x19d4b2,_0x159e14){return db[_0x5791('0x2c')][_0x5791('0x48')](_0x19d4b2[_0x5791('0x49')],{})[_0x5791('0x26')](respondWithResult(_0x159e14,0xc9))[_0x5791('0x44')](handleError(_0x159e14,null));};exports[_0x5791('0x25')]=function(_0xdb38e5,_0x36badb){if(_0xdb38e5[_0x5791('0x49')]['id']){delete _0xdb38e5[_0x5791('0x49')]['id'];}return db[_0x5791('0x2c')][_0x5791('0x47')]({'where':{'id':_0xdb38e5[_0x5791('0x46')]['id']}})['then'](handleEntityNotFound(_0x36badb,null))['then'](saveUpdates(_0xdb38e5[_0x5791('0x49')],null))[_0x5791('0x26')](respondWithResult(_0x36badb,null))['catch'](handleError(_0x36badb,null));};exports['destroy']=function(_0x31dd45,_0x3ef0d8){return db[_0x5791('0x2c')]['find']({'where':{'id':_0x31dd45[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x3ef0d8,null))[_0x5791('0x26')](removeEntity(_0x3ef0d8,null))[_0x5791('0x44')](handleError(_0x3ef0d8,null));};exports[_0x5791('0x4a')]=function(_0x52b0e4,_0x1dc4bb,_0x4e39f0){return db[_0x5791('0x4b')][_0x5791('0x47')]({'where':{'id':_0x52b0e4[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x1dc4bb,null))[_0x5791('0x26')](function(_0x5c1a4a){if(_0x5c1a4a){return _0x5c1a4a[_0x5791('0x4a')](_0x52b0e4[_0x5791('0x49')]['ids'],_[_0x5791('0x4c')](_0x52b0e4[_0x5791('0x49')],['ids','id'])||{});}})[_0x5791('0x26')](respondWithResult(_0x1dc4bb,null))[_0x5791('0x44')](handleError(_0x1dc4bb,null));};exports[_0x5791('0x4d')]=function(_0x18e099,_0x547e60,_0x3614e7){var _0xcdafd4={};var _0x8900af={};var _0x3e761f;var _0x263897;return db[_0x5791('0x2c')]['findOne']({'where':{'id':_0x18e099['params']['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x547e60,null))[_0x5791('0x26')](function(_0x62b35b){if(_0x62b35b){_0x3e761f=_0x62b35b;_0x8900af['model']=_[_0x5791('0x34')](db[_0x5791('0x4b')]['rawAttributes']);_0x8900af['query']=_['keys'](_0x18e099['query']);_0x8900af['filters']=_['intersection'](_0x8900af[_0x5791('0x31')],_0x8900af[_0x5791('0x33')]);_0xcdafd4[_0x5791('0x36')]=_[_0x5791('0x35')](_0x8900af[_0x5791('0x31')],qs['fields'](_0x18e099[_0x5791('0x33')]['fields']));_0xcdafd4[_0x5791('0x36')]=_0xcdafd4[_0x5791('0x36')][_0x5791('0x4e')]?_0xcdafd4[_0x5791('0x36')]:_0x8900af[_0x5791('0x31')];_0xcdafd4[_0x5791('0x39')]=qs['sort'](_0x18e099[_0x5791('0x33')][_0x5791('0x3a')]);_0xcdafd4[_0x5791('0x3b')]=qs[_0x5791('0x3c')](_[_0x5791('0x4f')](_0x18e099[_0x5791('0x33')],_0x8900af[_0x5791('0x3c')]));if(_0x18e099[_0x5791('0x33')][_0x5791('0x3d')]){_0xcdafd4[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0xcdafd4[_0x5791('0x3b')],{'$or':_[_0x5791('0x2b')](_0xcdafd4[_0x5791('0x36')],function(_0x6925c7){var _0x2ec85e={};_0x2ec85e[_0x6925c7]={'$like':'%'+_0x18e099[_0x5791('0x33')][_0x5791('0x3d')]+'%'};return _0x2ec85e;})});}_0xcdafd4=_['merge']({},_0xcdafd4,_0x18e099[_0x5791('0x40')]);return _0x3e761f[_0x5791('0x4d')](_0xcdafd4);}})['then'](function(_0x56855f){if(_0x56855f){_0x263897=_0x56855f['length'];if(!_0x18e099['query'][_0x5791('0x38')]('nolimit')){_0xcdafd4[_0x5791('0x1e')]=qs['limit'](_0x18e099[_0x5791('0x33')][_0x5791('0x1e')]);_0xcdafd4['offset']=qs[_0x5791('0x1c')](_0x18e099[_0x5791('0x33')][_0x5791('0x1c')]);}return _0x3e761f['getConditions'](_0xcdafd4);}})[_0x5791('0x26')](function(_0x1278c0){if(_0x1278c0){return _0x1278c0?{'count':_0x263897,'rows':_0x1278c0}:null;}})[_0x5791('0x26')](respondWithResult(_0x547e60,null))[_0x5791('0x44')](handleError(_0x547e60,null));};exports['addActions']=function(_0x4e2fd6,_0x5138b2,_0x7ec881){return db['Action'][_0x5791('0x47')]({'where':{'id':_0x4e2fd6[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x5138b2,null))[_0x5791('0x26')](function(_0x39fdbd){if(_0x39fdbd){return _0x39fdbd[_0x5791('0x50')](_0x4e2fd6[_0x5791('0x49')][_0x5791('0x51')],_['omit'](_0x4e2fd6[_0x5791('0x49')],[_0x5791('0x51'),'id'])||{});}})[_0x5791('0x26')](respondWithResult(_0x5138b2,null))[_0x5791('0x44')](handleError(_0x5138b2,null));};exports[_0x5791('0x52')]=function(_0x354265,_0x4a0daf,_0x2876e0){var _0x4005e6={};var _0x503711={};var _0x512115;var _0x1e1564;return db[_0x5791('0x2c')][_0x5791('0x53')]({'where':{'id':_0x354265['params']['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x4a0daf,null))[_0x5791('0x26')](function(_0xd7f799){if(_0xd7f799){_0x512115=_0xd7f799;_0x503711[_0x5791('0x31')]=_['keys'](db[_0x5791('0x54')][_0x5791('0x2d')]);_0x503711[_0x5791('0x33')]=_['keys'](_0x354265[_0x5791('0x33')]);_0x503711[_0x5791('0x3c')]=_[_0x5791('0x35')](_0x503711[_0x5791('0x31')],_0x503711[_0x5791('0x33')]);_0x4005e6[_0x5791('0x36')]=_[_0x5791('0x35')](_0x503711[_0x5791('0x31')],qs[_0x5791('0x37')](_0x354265['query'][_0x5791('0x37')]));_0x4005e6['attributes']=_0x4005e6[_0x5791('0x36')][_0x5791('0x4e')]?_0x4005e6[_0x5791('0x36')]:_0x503711['model'];_0x4005e6['order']=qs[_0x5791('0x3a')](_0x354265['query']['sort']);_0x4005e6['where']=qs[_0x5791('0x3c')](_[_0x5791('0x4f')](_0x354265['query'],_0x503711[_0x5791('0x3c')]));if(_0x354265['query'][_0x5791('0x3d')]){_0x4005e6[_0x5791('0x3b')]=_['merge'](_0x4005e6[_0x5791('0x3b')],{'$or':_[_0x5791('0x2b')](_0x4005e6[_0x5791('0x36')],function(_0x6a0206){var _0x54d6bc={};_0x54d6bc[_0x6a0206]={'$like':'%'+_0x354265[_0x5791('0x33')]['filter']+'%'};return _0x54d6bc;})});}_0x4005e6=_[_0x5791('0x3e')]({},_0x4005e6,_0x354265[_0x5791('0x40')]);return _0x512115[_0x5791('0x52')](_0x4005e6);}})[_0x5791('0x26')](function(_0x120da6){if(_0x120da6){_0x1e1564=_0x120da6[_0x5791('0x4e')];if(!_0x354265[_0x5791('0x33')][_0x5791('0x38')](_0x5791('0x55'))){_0x4005e6[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x354265[_0x5791('0x33')][_0x5791('0x1e')]);_0x4005e6[_0x5791('0x1c')]=qs[_0x5791('0x1c')](_0x354265[_0x5791('0x33')]['offset']);}return _0x512115['getActions'](_0x4005e6);}})['then'](function(_0x27fd0e){if(_0x27fd0e){return _0x27fd0e?{'count':_0x1e1564,'rows':_0x27fd0e}:null;}})[_0x5791('0x26')](respondWithResult(_0x4a0daf,null))[_0x5791('0x44')](handleError(_0x4a0daf,null));}; \ No newline at end of file +var _0x708c=['then','error','stack','name','send','map','Automation','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x708c,0xd4));var _0xc708=function(_0x2634c1,_0x4bd833){_0x2634c1=_0x2634c1-0x0;var _0x2cd333=_0x708c[_0x2634c1];return _0x2cd333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc708('0x0'));var zipdir=require(_0xc708('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc708('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc708('0x3'));var sox=require(_0xc708('0x4'));var csv=require(_0xc708('0x5'));var ejs=require(_0xc708('0x6'));var fs=require('fs');var fs_extra=require(_0xc708('0x7'));var _=require(_0xc708('0x8'));var squel=require(_0xc708('0x9'));var crypto=require('crypto');var jsforce=require(_0xc708('0xa'));var deskjs=require(_0xc708('0xb'));var toCsv=require(_0xc708('0x5'));var querystring=require(_0xc708('0xc'));var Papa=require(_0xc708('0xd'));var Redis=require(_0xc708('0xe'));var authService=require(_0xc708('0xf'));var qs=require(_0xc708('0x10'));var as=require(_0xc708('0x11'));var hardwareService=require(_0xc708('0x12'));var logger=require(_0xc708('0x13'))(_0xc708('0x14'));var utils=require(_0xc708('0x15'));var config=require(_0xc708('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc708('0x17'))['db'];function respondWithStatusCode(_0x5081b2,_0x22dc34){_0x22dc34=_0x22dc34||0xcc;return function(_0x131610){if(_0x131610){return _0x5081b2[_0xc708('0x18')](_0x22dc34);}return _0x5081b2[_0xc708('0x19')](_0x22dc34)[_0xc708('0x1a')]();};}function respondWithResult(_0x3706c1,_0x418eff){_0x418eff=_0x418eff||0xc8;return function(_0x8447e8){if(_0x8447e8){return _0x3706c1['status'](_0x418eff)[_0xc708('0x1b')](_0x8447e8);}};}function respondWithFilteredResult(_0x164d37,_0x5c99d8){return function(_0x167c25){if(_0x167c25){var _0x509faa=typeof _0x5c99d8[_0xc708('0x1c')]==='undefined'&&typeof _0x5c99d8['limit']==='undefined';var _0x11028a=_0x167c25[_0xc708('0x1d')];var _0x4c4d1d=_0x509faa?0x0:_0x5c99d8['offset'];var _0x4cb069=_0x509faa?_0x167c25['count']:_0x5c99d8[_0xc708('0x1c')]+_0x5c99d8[_0xc708('0x1e')];var _0x49a2d6;if(_0x4cb069>=_0x11028a){_0x4cb069=_0x11028a;_0x49a2d6=0xc8;}else{_0x49a2d6=0xce;}_0x164d37[_0xc708('0x19')](_0x49a2d6);return _0x164d37[_0xc708('0x1f')](_0xc708('0x20'),_0x4c4d1d+'-'+_0x4cb069+'/'+_0x11028a)[_0xc708('0x1b')](_0x167c25);}return null;};}function patchUpdates(_0x4b307a){return function(_0x12b213){try{jsonpatch[_0xc708('0x21')](_0x12b213,_0x4b307a,!![]);}catch(_0x432462){return BPromise[_0xc708('0x22')](_0x432462);}return _0x12b213[_0xc708('0x23')]();};}function saveUpdates(_0x455ac0,_0x29167a){return function(_0x19697e){if(_0x19697e){return _0x19697e[_0xc708('0x24')](_0x455ac0)[_0xc708('0x25')](function(_0x4b1674){return _0x4b1674;});}return null;};}function removeEntity(_0x5ede90,_0x8bc34b){return function(_0x3baa75){if(_0x3baa75){return _0x3baa75['destroy']()[_0xc708('0x25')](function(){_0x5ede90[_0xc708('0x19')](0xcc)[_0xc708('0x1a')]();});}};}function handleEntityNotFound(_0x497d72,_0x38cbfd){return function(_0x213627){if(!_0x213627){_0x497d72[_0xc708('0x18')](0x194);}return _0x213627;};}function handleError(_0x483420,_0x505278){_0x505278=_0x505278||0x1f4;return function(_0x1c3ecb){logger[_0xc708('0x26')](_0x1c3ecb[_0xc708('0x27')]);if(_0x1c3ecb[_0xc708('0x28')]){delete _0x1c3ecb[_0xc708('0x28')];}_0x483420[_0xc708('0x19')](_0x505278)[_0xc708('0x29')](_0x1c3ecb);};}exports['index']=function(_0x1dd21d,_0x22a4dd){var _0x276271={},_0x268494={},_0x41736d={'count':0x0,'rows':[]};var _0x1f19ac=_[_0xc708('0x2a')](db[_0xc708('0x2b')]['rawAttributes'],function(_0x6d8639){return{'name':_0x6d8639['fieldName'],'type':_0x6d8639['type'][_0xc708('0x2c')]};});_0x268494[_0xc708('0x2d')]=_[_0xc708('0x2a')](_0x1f19ac,'name');_0x268494[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x1dd21d[_0xc708('0x2e')]);_0x268494[_0xc708('0x30')]=_[_0xc708('0x31')](_0x268494[_0xc708('0x2d')],_0x268494[_0xc708('0x2e')]);_0x276271[_0xc708('0x32')]=_[_0xc708('0x31')](_0x268494['model'],qs[_0xc708('0x33')](_0x1dd21d['query'][_0xc708('0x33')]));_0x276271['attributes']=_0x276271[_0xc708('0x32')][_0xc708('0x34')]?_0x276271[_0xc708('0x32')]:_0x268494[_0xc708('0x2d')];if(!_0x1dd21d[_0xc708('0x2e')]['hasOwnProperty'](_0xc708('0x35'))){_0x276271[_0xc708('0x1e')]=qs[_0xc708('0x1e')](_0x1dd21d[_0xc708('0x2e')][_0xc708('0x1e')]);_0x276271['offset']=qs[_0xc708('0x1c')](_0x1dd21d['query'][_0xc708('0x1c')]);}_0x276271[_0xc708('0x36')]=qs[_0xc708('0x37')](_0x1dd21d['query'][_0xc708('0x37')]);_0x276271[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x1dd21d[_0xc708('0x2e')],_0x268494[_0xc708('0x30')]),_0x1f19ac);if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3a')]){_0x276271['where']=_[_0xc708('0x3b')](_0x276271[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x1f19ac,function(_0x598fc5){if(_0x598fc5[_0xc708('0x3c')]!=='VIRTUAL'){var _0x2c9164={};_0x2c9164[_0x598fc5[_0xc708('0x28')]]={'$like':'%'+_0x1dd21d['query'][_0xc708('0x3a')]+'%'};return _0x2c9164;}})});}_0x276271=_['merge']({},_0x276271,_0x1dd21d[_0xc708('0x3d')]);var _0x3d751d={'where':_0x276271['where']};return db[_0xc708('0x2b')][_0xc708('0x1d')](_0x3d751d)['then'](function(_0x3a4684){_0x41736d[_0xc708('0x1d')]=_0x3a4684;if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3e')]){_0x276271[_0xc708('0x3f')]=[{'all':!![]}];}return db[_0xc708('0x2b')][_0xc708('0x40')](_0x276271);})[_0xc708('0x25')](function(_0x344858){_0x41736d[_0xc708('0x41')]=_0x344858;return _0x41736d;})[_0xc708('0x25')](respondWithFilteredResult(_0x22a4dd,_0x276271))[_0xc708('0x42')](handleError(_0x22a4dd,null));};exports['show']=function(_0x4a96af,_0xb21f91){var _0x31cfc0={'raw':![],'where':{'id':_0x4a96af[_0xc708('0x43')]['id']}},_0x1f18b9={};_0x1f18b9[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x2b')][_0xc708('0x44')]);_0x1f18b9[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x4a96af[_0xc708('0x2e')]);_0x1f18b9[_0xc708('0x30')]=_[_0xc708('0x31')](_0x1f18b9['model'],_0x1f18b9[_0xc708('0x2e')]);_0x31cfc0[_0xc708('0x32')]=_[_0xc708('0x31')](_0x1f18b9[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x4a96af[_0xc708('0x2e')][_0xc708('0x33')]));_0x31cfc0[_0xc708('0x32')]=_0x31cfc0[_0xc708('0x32')][_0xc708('0x34')]?_0x31cfc0[_0xc708('0x32')]:_0x1f18b9['model'];if(_0x4a96af[_0xc708('0x2e')][_0xc708('0x3e')]){_0x31cfc0[_0xc708('0x3f')]=[{'all':!![]}];}_0x31cfc0=_[_0xc708('0x3b')]({},_0x31cfc0,_0x4a96af[_0xc708('0x3d')]);return db[_0xc708('0x2b')][_0xc708('0x45')](_0x31cfc0)[_0xc708('0x25')](handleEntityNotFound(_0xb21f91,null))[_0xc708('0x25')](respondWithResult(_0xb21f91,null))[_0xc708('0x42')](handleError(_0xb21f91,null));};exports[_0xc708('0x46')]=function(_0x1df486,_0x5e4cab){return db[_0xc708('0x2b')]['create'](_0x1df486[_0xc708('0x47')],{})['then'](respondWithResult(_0x5e4cab,0xc9))['catch'](handleError(_0x5e4cab,null));};exports[_0xc708('0x24')]=function(_0x1514ae,_0x1a7392){if(_0x1514ae['body']['id']){delete _0x1514ae[_0xc708('0x47')]['id'];}return db['Automation'][_0xc708('0x45')]({'where':{'id':_0x1514ae['params']['id']}})['then'](handleEntityNotFound(_0x1a7392,null))[_0xc708('0x25')](saveUpdates(_0x1514ae[_0xc708('0x47')],null))[_0xc708('0x25')](respondWithResult(_0x1a7392,null))[_0xc708('0x42')](handleError(_0x1a7392,null));};exports[_0xc708('0x48')]=function(_0x3bad3a,_0x14df29){return db[_0xc708('0x2b')][_0xc708('0x45')]({'where':{'id':_0x3bad3a['params']['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x14df29,null))[_0xc708('0x25')](removeEntity(_0x14df29,null))[_0xc708('0x42')](handleError(_0x14df29,null));};exports[_0xc708('0x49')]=function(_0x16fba9,_0x2af62b,_0x2d06e8){return db[_0xc708('0x4a')][_0xc708('0x45')]({'where':{'id':_0x16fba9[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x2af62b,null))[_0xc708('0x25')](function(_0x496746){if(_0x496746){return _0x496746[_0xc708('0x49')](_0x16fba9[_0xc708('0x47')][_0xc708('0x4b')],_[_0xc708('0x4c')](_0x16fba9[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x2af62b,null))[_0xc708('0x42')](handleError(_0x2af62b,null));};exports[_0xc708('0x4d')]=function(_0xdf3e39,_0xe1634c,_0x2381bf){var _0x19d07b={};var _0x3df97c={};var _0x2a93ef;var _0x2b8a74;return db[_0xc708('0x2b')][_0xc708('0x4e')]({'where':{'id':_0xdf3e39[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0xe1634c,null))[_0xc708('0x25')](function(_0x6509e8){if(_0x6509e8){_0x2a93ef=_0x6509e8;_0x3df97c[_0xc708('0x2d')]=_['keys'](db['Condition'][_0xc708('0x44')]);_0x3df97c[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0xdf3e39[_0xc708('0x2e')]);_0x3df97c['filters']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],_0x3df97c[_0xc708('0x2e')]);_0x19d07b['attributes']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],qs[_0xc708('0x33')](_0xdf3e39['query']['fields']));_0x19d07b[_0xc708('0x32')]=_0x19d07b[_0xc708('0x32')]['length']?_0x19d07b['attributes']:_0x3df97c[_0xc708('0x2d')];_0x19d07b[_0xc708('0x36')]=qs[_0xc708('0x37')](_0xdf3e39['query'][_0xc708('0x37')]);_0x19d07b[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0xdf3e39[_0xc708('0x2e')],_0x3df97c['filters']));if(_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]){_0x19d07b[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x19d07b[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x19d07b[_0xc708('0x32')],function(_0x4d492f){var _0x19e819={};_0x19e819[_0x4d492f]={'$like':'%'+_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]+'%'};return _0x19e819;})});}_0x19d07b=_[_0xc708('0x3b')]({},_0x19d07b,_0xdf3e39[_0xc708('0x3d')]);return _0x2a93ef[_0xc708('0x4d')](_0x19d07b);}})[_0xc708('0x25')](function(_0xc1b831){if(_0xc1b831){_0x2b8a74=_0xc1b831[_0xc708('0x34')];if(!_0xdf3e39[_0xc708('0x2e')][_0xc708('0x4f')]('nolimit')){_0x19d07b['limit']=qs[_0xc708('0x1e')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1e')]);_0x19d07b['offset']=qs[_0xc708('0x1c')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1c')]);}return _0x2a93ef['getConditions'](_0x19d07b);}})[_0xc708('0x25')](function(_0x86f819){if(_0x86f819){return _0x86f819?{'count':_0x2b8a74,'rows':_0x86f819}:null;}})['then'](respondWithResult(_0xe1634c,null))[_0xc708('0x42')](handleError(_0xe1634c,null));};exports[_0xc708('0x50')]=function(_0x1ef5b8,_0x50959c,_0xf21bbd){return db[_0xc708('0x51')][_0xc708('0x45')]({'where':{'id':_0x1ef5b8[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x50959c,null))[_0xc708('0x25')](function(_0x2b93b6){if(_0x2b93b6){return _0x2b93b6['addActions'](_0x1ef5b8[_0xc708('0x47')]['ids'],_[_0xc708('0x4c')](_0x1ef5b8[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x50959c,null))['catch'](handleError(_0x50959c,null));};exports[_0xc708('0x52')]=function(_0x41e5b6,_0x450605,_0x2c259d){var _0x55e787={};var _0x3b216a={};var _0x255b4c;var _0x245a3c;return db['Automation']['findOne']({'where':{'id':_0x41e5b6[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x450605,null))['then'](function(_0x443002){if(_0x443002){_0x255b4c=_0x443002;_0x3b216a[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x51')][_0xc708('0x44')]);_0x3b216a[_0xc708('0x2e')]=_['keys'](_0x41e5b6['query']);_0x3b216a[_0xc708('0x30')]=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],_0x3b216a[_0xc708('0x2e')]);_0x55e787['attributes']=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x41e5b6[_0xc708('0x2e')][_0xc708('0x33')]));_0x55e787['attributes']=_0x55e787[_0xc708('0x32')][_0xc708('0x34')]?_0x55e787[_0xc708('0x32')]:_0x3b216a[_0xc708('0x2d')];_0x55e787[_0xc708('0x36')]=qs['sort'](_0x41e5b6[_0xc708('0x2e')]['sort']);_0x55e787[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x41e5b6['query'],_0x3b216a[_0xc708('0x30')]));if(_0x41e5b6[_0xc708('0x2e')]['filter']){_0x55e787[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x55e787[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x55e787[_0xc708('0x32')],function(_0x197b88){var _0x435806={};_0x435806[_0x197b88]={'$like':'%'+_0x41e5b6[_0xc708('0x2e')]['filter']+'%'};return _0x435806;})});}_0x55e787=_['merge']({},_0x55e787,_0x41e5b6[_0xc708('0x3d')]);return _0x255b4c[_0xc708('0x52')](_0x55e787);}})['then'](function(_0x11fd1a){if(_0x11fd1a){_0x245a3c=_0x11fd1a[_0xc708('0x34')];if(!_0x41e5b6[_0xc708('0x2e')][_0xc708('0x4f')](_0xc708('0x35'))){_0x55e787[_0xc708('0x1e')]=qs['limit'](_0x41e5b6['query'][_0xc708('0x1e')]);_0x55e787[_0xc708('0x1c')]=qs['offset'](_0x41e5b6[_0xc708('0x2e')]['offset']);}return _0x255b4c[_0xc708('0x52')](_0x55e787);}})[_0xc708('0x25')](function(_0x30cf73){if(_0x30cf73){return _0x30cf73?{'count':_0x245a3c,'rows':_0x30cf73}:null;}})['then'](respondWithResult(_0x450605,null))['catch'](handleError(_0x450605,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 8bdf745..7c1d111 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 _0x98da=['rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x44d628,_0x3024bf){var _0x303593=function(_0x4d5781){while(--_0x4d5781){_0x44d628['push'](_0x44d628['shift']());}};_0x303593(++_0x3024bf);}(_0x98da,0xe1));var _0xa98d=function(_0xf82293,_0x23b61c){_0xf82293=_0xf82293-0x0;var _0x15589d=_0x98da[_0xf82293];return _0x15589d;};'use strict';var _=require(_0xa98d('0x0'));var util=require(_0xa98d('0x1'));var logger=require(_0xa98d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa98d('0x3'));var rp=require(_0xa98d('0x4'));var fs=require('fs');var path=require(_0xa98d('0x5'));var rimraf=require(_0xa98d('0x6'));var config=require(_0xa98d('0x7'));var attributes=require(_0xa98d('0x8'));module['exports']=function(_0x3b13ef,_0x16106f){return _0x3b13ef[_0xa98d('0x9')]('Automation',attributes,{'tableName':_0xa98d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fbc=['moment','bluebird','request-promise','path','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','api'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x4fbc,0x168));var _0xc4fb=function(_0x1cb550,_0x6b2222){_0x1cb550=_0x1cb550-0x0;var _0x588b49=_0x4fbc[_0x1cb550];return _0x588b49;};'use strict';var _=require(_0xc4fb('0x0'));var util=require('util');var logger=require(_0xc4fb('0x1'))(_0xc4fb('0x2'));var moment=require(_0xc4fb('0x3'));var BPromise=require(_0xc4fb('0x4'));var rp=require(_0xc4fb('0x5'));var fs=require('fs');var path=require(_0xc4fb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4fb('0x7'));module[_0xc4fb('0x8')]=function(_0x4b2563,_0x5e192f){return _0x4b2563[_0xc4fb('0x9')]('Automation',attributes,{'tableName':_0xc4fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index dcd7b4e..020660a 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 _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x26bfb0,_0x5b0ffc){var _0x4454b3=function(_0x2e7c5f){while(--_0x2e7c5f){_0x26bfb0['push'](_0x26bfb0['shift']());}};_0x4454b3(++_0x5b0ffc);}(_0x505d,0x93));var _0xd505=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x505d[_0x99868f];return _0x27a71b;};'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')]('Automation,\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')]('Automation,\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 +var _0x50a5=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x48efe5,_0x24d889){var _0x5962c2=function(_0x1ce132){while(--_0x1ce132){_0x48efe5['push'](_0x48efe5['shift']());}};_0x5962c2(++_0x24d889);}(_0x50a5,0xd1));var _0x550a=function(_0x5ac443,_0x284ba7){_0x5ac443=_0x5ac443-0x0;var _0x369aef=_0x50a5[_0x5ac443];return _0x369aef;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x550a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x550a('0x3'))(_0x550a('0x4'));var config=require(_0x550a('0x5'));var jayson=require(_0x550a('0x6'));var client=jayson[_0x550a('0x7')][_0x550a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1983bf,_0x2596b7,_0x3e9984){return new BPromise(function(_0x329303,_0x434f2e){return client[_0x550a('0x9')](_0x1983bf,_0x3e9984)[_0x550a('0xa')](function(_0x5247ac){logger[_0x550a('0xb')](_0x550a('0xc'),_0x2596b7,_0x550a('0xd'));logger[_0x550a('0xe')](_0x550a('0xf'),_0x2596b7,_0x550a('0xd'),JSON['stringify'](_0x5247ac));if(_0x5247ac[_0x550a('0x10')]){if(_0x5247ac[_0x550a('0x10')][_0x550a('0x11')]===0x1f4){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x5247ac[_0x550a('0x10')][_0x550a('0x12')]);return _0x434f2e(_0x5247ac[_0x550a('0x10')]['message']);}logger[_0x550a('0x10')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x5247ac['error'][_0x550a('0x12')]);return _0x329303(_0x5247ac[_0x550a('0x10')]['message']);}else{logger[_0x550a('0xb')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x550a('0xd'));_0x329303(_0x5247ac['result'][_0x550a('0x12')]);}})[_0x550a('0x13')](function(_0x11994d){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x11994d);_0x434f2e(_0x11994d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 100b494..f4f0cdb 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 _0x6548=['exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addConditions','addActions','destroy'];(function(_0x231c25,_0x237859){var _0x2b5c30=function(_0x5f0c1e){while(--_0x5f0c1e){_0x231c25['push'](_0x231c25['shift']());}};_0x2b5c30(++_0x237859);}(_0x6548,0x133));var _0x8654=function(_0x3b2163,_0x54a058){_0x3b2163=_0x3b2163-0x0;var _0x4ee9eb=_0x6548[_0x3b2163];return _0x4ee9eb;};'use strict';var multer=require(_0x8654('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8654('0x1'));var express=require(_0x8654('0x2'));var router=express[_0x8654('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8654('0x4'));var controller=require('./automation.controller');router[_0x8654('0x5')]('/',auth[_0x8654('0x6')](),controller[_0x8654('0x7')]);router[_0x8654('0x5')](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0x9')]);router['get'](_0x8654('0xa'),auth[_0x8654('0x6')](),controller['getConditions']);router[_0x8654('0x5')](_0x8654('0xb'),auth[_0x8654('0x6')](),controller['getActions']);router['post']('/',auth[_0x8654('0x6')](),controller[_0x8654('0xc')]);router[_0x8654('0xd')](_0x8654('0xa'),auth['isAuthenticated'](),controller[_0x8654('0xe')]);router[_0x8654('0xd')](_0x8654('0xb'),auth['isAuthenticated'](),controller[_0x8654('0xf')]);router['put'](_0x8654('0x8'),auth[_0x8654('0x6')](),controller['update']);router['delete']('/:id',auth[_0x8654('0x6')](),controller[_0x8654('0x10')]);module[_0x8654('0x11')]=router; \ No newline at end of file +var _0xcb70=['../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addActions','put','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x2d9315,_0xc56bd0){var _0xb6039=function(_0x48a693){while(--_0x48a693){_0x2d9315['push'](_0x2d9315['shift']());}};_0xb6039(++_0xc56bd0);}(_0xcb70,0xf3));var _0x0cb7=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xcb70[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cb7('0x2'));var auth=require(_0x0cb7('0x3'));var interaction=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var controller=require(_0x0cb7('0x6'));router[_0x0cb7('0x7')]('/',auth[_0x0cb7('0x8')](),controller['index']);router[_0x0cb7('0x7')](_0x0cb7('0x9'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xa')]);router[_0x0cb7('0x7')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x0cb7('0xb')]);router[_0x0cb7('0x7')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller['getActions']);router[_0x0cb7('0xd')]('/',auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xe')]);router['post'](_0x0cb7('0xf'),auth[_0x0cb7('0x8')](),controller['addConditions']);router[_0x0cb7('0xd')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0x10')]);router[_0x0cb7('0x11')](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cb7('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e23d2fc..9e58cc6 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 _0xa57e=['#AMD\x20Greeting','#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)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','STRING','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xa57e,0x1bf));var _0xea57=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa57e[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xea57('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xea57('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xea57('0x2')](_0xea57('0x3')),'allowNull':![],'defaultValue':_0xea57('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xea57('0x4')],'defaultValue':0x0,'comment':_0xea57('0x5')},'limitCalls':{'type':Sequelize[_0xea57('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xea57('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'comment':_0xea57('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xea57('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xea57('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xea57('0x11'),_0xea57('0x12'),_0xea57('0x13')),'defaultValue':_0xea57('0x11')},'dialAMDActive':{'type':Sequelize[_0xea57('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xea57('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xea57('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xea57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xea57('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xea57('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xea57('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xea57('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xea57('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xea57('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xea57('0x2')]('DESC','ASC'),'defaultValue':_0xea57('0x1c')},'dialPrefix':{'type':Sequelize[_0xea57('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xea57('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xea57('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x26')}}; \ No newline at end of file +var _0x2961=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#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)','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)'];(function(_0x3a3b1e,_0x230f6d){var _0x583039=function(_0x527d4c){while(--_0x527d4c){_0x3a3b1e['push'](_0x3a3b1e['shift']());}};_0x583039(++_0x230f6d);}(_0x2961,0xb6));var _0x1296=function(_0x169dbd,_0x2f741a){_0x169dbd=_0x169dbd-0x0;var _0x282fc2=_0x2961[_0x169dbd];return _0x282fc2;};'use strict';var Sequelize=require(_0x1296('0x0'));module[_0x1296('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1296('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x4')),'allowNull':![],'defaultValue':_0x1296('0x4')},'description':{'type':Sequelize[_0x1296('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1296('0xe')},'dialTimezone':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1296('0x5')],'defaultValue':_0x1296('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x10'),_0x1296('0x11'),'onlyIfOpen'),'defaultValue':_0x1296('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1296('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1296('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1296('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1296('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1296('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1296('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1296('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1296('0x18'),_0x1296('0x19')),'defaultValue':_0x1296('0x18')},'dialPrefix':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 43dcbde..c1b0147 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 _0xdc19=['CmHopper','sort','CampaignId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','ListId','toString','updatedAt','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','include','show','params','rawAttributes','options','Campaign','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','omit','createdAt','user','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne'];(function(_0x2d7676,_0x1a4420){var _0x38d992=function(_0x3652d6){while(--_0x3652d6){_0x2d7676['push'](_0x2d7676['shift']());}};_0x38d992(++_0x1a4420);}(_0xdc19,0x1ce));var _0x9dc1=function(_0x28a961,_0x552379){_0x28a961=_0x28a961-0x0;var _0x2674f3=_0xdc19[_0x28a961];return _0x2674f3;};'use strict';var emlformat=require(_0x9dc1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9dc1('0x1'));var rp=require(_0x9dc1('0x2'));var moment=require(_0x9dc1('0x3'));var BPromise=require(_0x9dc1('0x4'));var Mustache=require(_0x9dc1('0x5'));var util=require(_0x9dc1('0x6'));var path=require(_0x9dc1('0x7'));var sox=require(_0x9dc1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dc1('0x9'));var _=require(_0x9dc1('0xa'));var squel=require(_0x9dc1('0xb'));var crypto=require(_0x9dc1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dc1('0xd'));var querystring=require(_0x9dc1('0xe'));var Papa=require('papaparse');var Redis=require(_0x9dc1('0xf'));var authService=require(_0x9dc1('0x10'));var qs=require(_0x9dc1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dc1('0x12'));var logger=require('../../config/logger')(_0x9dc1('0x13'));var utils=require(_0x9dc1('0x14'));var config=require(_0x9dc1('0x15'));var licenseUtil=require(_0x9dc1('0x16'));var db=require(_0x9dc1('0x17'))['db'];function respondWithStatusCode(_0xf43f93,_0x39785c){_0x39785c=_0x39785c||0xcc;return function(_0xb6f400){if(_0xb6f400){return _0xf43f93[_0x9dc1('0x18')](_0x39785c);}return _0xf43f93[_0x9dc1('0x19')](_0x39785c)['end']();};}function respondWithResult(_0x3e4577,_0x570b3c){_0x570b3c=_0x570b3c||0xc8;return function(_0x17c7e3){if(_0x17c7e3){return _0x3e4577[_0x9dc1('0x19')](_0x570b3c)[_0x9dc1('0x1a')](_0x17c7e3);}};}function respondWithFilteredResult(_0x1995ef,_0x3fb9eb){return function(_0x5edfe9){if(_0x5edfe9){var _0x4491bd=typeof _0x3fb9eb['offset']==='undefined'&&typeof _0x3fb9eb[_0x9dc1('0x1b')]===_0x9dc1('0x1c');var _0x5a8683=_0x5edfe9[_0x9dc1('0x1d')];var _0x3f2496=_0x4491bd?0x0:_0x3fb9eb[_0x9dc1('0x1e')];var _0xf7e90b=_0x4491bd?_0x5edfe9[_0x9dc1('0x1d')]:_0x3fb9eb[_0x9dc1('0x1e')]+_0x3fb9eb[_0x9dc1('0x1b')];var _0x493c71;if(_0xf7e90b>=_0x5a8683){_0xf7e90b=_0x5a8683;_0x493c71=0xc8;}else{_0x493c71=0xce;}_0x1995ef[_0x9dc1('0x19')](_0x493c71);return _0x1995ef[_0x9dc1('0x1f')](_0x9dc1('0x20'),_0x3f2496+'-'+_0xf7e90b+'/'+_0x5a8683)[_0x9dc1('0x1a')](_0x5edfe9);}return null;};}function patchUpdates(_0x48bf18){return function(_0x2f79d9){try{jsonpatch['apply'](_0x2f79d9,_0x48bf18,!![]);}catch(_0x17e977){return BPromise[_0x9dc1('0x21')](_0x17e977);}return _0x2f79d9[_0x9dc1('0x22')]();};}function saveUpdates(_0x39d6d4,_0x479823){return function(_0x4ff15b){if(_0x4ff15b){return _0x4ff15b['update'](_0x39d6d4)['then'](function(_0x268b15){return _0x268b15;});}return null;};}function removeEntity(_0x38202a,_0x2c6a9c){return function(_0x469c4b){if(_0x469c4b){return _0x469c4b[_0x9dc1('0x23')]()[_0x9dc1('0x24')](function(){var _0x1e92ce=_0x469c4b[_0x9dc1('0x25')]({'plain':!![]});var _0x312918='IvrCampaigns';return db[_0x9dc1('0x26')][_0x9dc1('0x23')]({'where':{'type':_0x312918,'resourceId':_0x1e92ce['id']}})[_0x9dc1('0x24')](function(){return _0x469c4b;});})['then'](function(){_0x38202a[_0x9dc1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4abee8,_0x3b4e2a){return function(_0x410305){if(!_0x410305){_0x4abee8[_0x9dc1('0x18')](0x194);}return _0x410305;};}function handleError(_0x253901,_0x25f6b1){_0x25f6b1=_0x25f6b1||0x1f4;return function(_0x336ed5){logger[_0x9dc1('0x27')](_0x336ed5[_0x9dc1('0x28')]);if(_0x336ed5[_0x9dc1('0x29')]){delete _0x336ed5['name'];}_0x253901['status'](_0x25f6b1)[_0x9dc1('0x2a')](_0x336ed5);};}exports[_0x9dc1('0x2b')]=function(_0xfa8444,_0x6bf47f){var _0x26eba9={},_0x97d709={},_0x4e1650={'count':0x0,'rows':[]};var _0x386bfa=_[_0x9dc1('0x2c')](db['Campaign']['rawAttributes'],function(_0x471751){return{'name':_0x471751[_0x9dc1('0x2d')],'type':_0x471751['type'][_0x9dc1('0x2e')]};});_0x97d709[_0x9dc1('0x2f')]=_[_0x9dc1('0x2c')](_0x386bfa,_0x9dc1('0x29'));_0x97d709[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0xfa8444[_0x9dc1('0x30')]);_0x97d709[_0x9dc1('0x32')]=_['intersection'](_0x97d709[_0x9dc1('0x2f')],_0x97d709[_0x9dc1('0x30')]);_0x26eba9[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x97d709[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x26eba9[_0x9dc1('0x33')]=_0x26eba9[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x26eba9['attributes']:_0x97d709[_0x9dc1('0x2f')];if(!_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x26eba9[_0x9dc1('0x1b')]=qs['limit'](_0xfa8444[_0x9dc1('0x30')]['limit']);_0x26eba9['offset']=qs[_0x9dc1('0x1e')](_0xfa8444['query']['offset']);}_0x26eba9[_0x9dc1('0x39')]=qs['sort'](_0xfa8444[_0x9dc1('0x30')]['sort']);_0x26eba9['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0xfa8444[_0x9dc1('0x30')],_0x97d709['filters']),_0x386bfa);if(_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x26eba9[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x26eba9['where'],{'$or':_[_0x9dc1('0x2c')](_0x386bfa,function(_0x22506e){if(_0x22506e[_0x9dc1('0x3e')]!==_0x9dc1('0x3f')){var _0x2a31ff={};_0x2a31ff[_0x22506e[_0x9dc1('0x29')]]={'$like':'%'+_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x2a31ff;}})});}_0x26eba9=_[_0x9dc1('0x3d')]({},_0x26eba9,_0xfa8444['options']);var _0x28124b={'where':_0x26eba9[_0x9dc1('0x3c')]};return db['Campaign']['count'](_0x28124b)['then'](function(_0x2505d0){_0x4e1650['count']=_0x2505d0;if(_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x26eba9[_0x9dc1('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x26eba9);})['then'](function(_0x49ecc8){_0x4e1650['rows']=_0x49ecc8;return _0x4e1650;})[_0x9dc1('0x24')](respondWithFilteredResult(_0x6bf47f,_0x26eba9))['catch'](handleError(_0x6bf47f,null));};exports[_0x9dc1('0x42')]=function(_0x1437ec,_0x13d826){var _0x4452c1={'raw':![],'where':{'id':_0x1437ec[_0x9dc1('0x43')]['id']}},_0xb17783={};_0xb17783[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db['Campaign'][_0x9dc1('0x44')]);_0xb17783[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x1437ec[_0x9dc1('0x30')]);_0xb17783[_0x9dc1('0x32')]=_['intersection'](_0xb17783[_0x9dc1('0x2f')],_0xb17783[_0x9dc1('0x30')]);_0x4452c1['attributes']=_[_0x9dc1('0x34')](_0xb17783['model'],qs[_0x9dc1('0x35')](_0x1437ec[_0x9dc1('0x30')]['fields']));_0x4452c1[_0x9dc1('0x33')]=_0x4452c1[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x4452c1[_0x9dc1('0x33')]:_0xb17783['model'];if(_0x1437ec[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x4452c1[_0x9dc1('0x41')]=[{'all':!![]}];}_0x4452c1=_[_0x9dc1('0x3d')]({},_0x4452c1,_0x1437ec[_0x9dc1('0x45')]);return db[_0x9dc1('0x46')][_0x9dc1('0x47')](_0x4452c1)['then'](handleEntityNotFound(_0x13d826,null))['then'](respondWithResult(_0x13d826,null))[_0x9dc1('0x48')](handleError(_0x13d826,null));};exports['create']=function(_0x6b8bbf,_0xfe2d5a){return db['Campaign'][_0x9dc1('0x49')](_0x6b8bbf[_0x9dc1('0x4a')],{})[_0x9dc1('0x24')](function(_0x59a401){var _0x27f5de=_0x6b8bbf['user'][_0x9dc1('0x25')]({'plain':!![]});if(!_0x27f5de)throw new Error(_0x9dc1('0x4b'));if(_0x27f5de['role']==='user'){var _0x58061e=_0x59a401[_0x9dc1('0x25')]({'plain':!![]});var _0x5a8a9f='IvrCampaigns';return db[_0x9dc1('0x4c')][_0x9dc1('0x47')]({'where':{'name':_0x5a8a9f,'userProfileId':_0x27f5de['userProfileId']},'raw':!![]})['then'](function(_0x10fc18){if(_0x10fc18&&_0x10fc18['autoAssociation']===0x0){return db[_0x9dc1('0x26')][_0x9dc1('0x49')]({'name':_0x58061e[_0x9dc1('0x29')],'resourceId':_0x58061e['id'],'type':_0x10fc18[_0x9dc1('0x29')],'sectionId':_0x10fc18['id']},{})[_0x9dc1('0x24')](function(){return _0x59a401;});}else{return _0x59a401;}})[_0x9dc1('0x48')](function(_0x20c668){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20c668);throw _0x20c668;});}return _0x59a401;})[_0x9dc1('0x24')](respondWithResult(_0xfe2d5a,0xc9))['catch'](handleError(_0xfe2d5a,null));};exports['clone']=function(_0xfc3cc3,_0x8ed882){var _0x539d65={'where':{'id':_0xfc3cc3[_0x9dc1('0x43')]['id']}},_0x14cc91={};_0x14cc91[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x46')][_0x9dc1('0x44')]);_0x539d65[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x14cc91[_0x9dc1('0x2f')],qs['fields'](_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x539d65[_0x9dc1('0x33')]=_0x539d65[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x539d65[_0x9dc1('0x33')]:_0x14cc91[_0x9dc1('0x2f')];if(_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x539d65[_0x9dc1('0x41')]=[{'all':!![]}];}_0x539d65=_[_0x9dc1('0x3d')]({},_0x539d65,_0xfc3cc3['options']);return db[_0x9dc1('0x46')]['find'](_0x539d65)[_0x9dc1('0x24')](handleEntityNotFound(_0x8ed882,null))[_0x9dc1('0x24')](function(_0x1f14d1){if(_0x1f14d1){var _0x337b2c=_0x1f14d1[_0x9dc1('0x25')]({'plain':!![]});_0x337b2c=qs[_0x9dc1('0x4d')](_0x337b2c,['id',_0x9dc1('0x4e'),'updatedAt']);_0xfc3cc3['body']=_[_0x9dc1('0x4d')](_0xfc3cc3[_0x9dc1('0x4a')],['id','createdAt','updatedAt']);return db[_0x9dc1('0x46')][_0x9dc1('0x49')](_[_0x9dc1('0x3d')](_0x337b2c,_0xfc3cc3[_0x9dc1('0x4a')]),{'include':_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x107e9a){var _0x40a324=_0xfc3cc3[_0x9dc1('0x4f')]['get']({'plain':!![]});if(!_0x40a324)throw new Error(_0x9dc1('0x4b'));if(_0x40a324['role']===_0x9dc1('0x4f')){var _0x5b6fbb=_0x107e9a[_0x9dc1('0x25')]({'plain':!![]});var _0x1a8a55=_0x9dc1('0x50');return db[_0x9dc1('0x4c')]['find']({'where':{'name':_0x1a8a55,'userProfileId':_0x40a324['userProfileId']},'raw':!![]})[_0x9dc1('0x24')](function(_0x5cd8fd){if(_0x5cd8fd&&_0x5cd8fd[_0x9dc1('0x51')]===0x0){return db[_0x9dc1('0x26')][_0x9dc1('0x49')]({'name':_0x5b6fbb[_0x9dc1('0x29')],'resourceId':_0x5b6fbb['id'],'type':_0x5cd8fd[_0x9dc1('0x29')],'sectionId':_0x5cd8fd['id']},{})['then'](function(){return _0x107e9a;});}else{return _0x107e9a;}})[_0x9dc1('0x48')](function(_0x4312f8){logger['error'](_0x9dc1('0x52'),_0x4312f8);throw _0x4312f8;});}return _0x107e9a;});}})['then'](respondWithResult(_0x8ed882,0xc9))[_0x9dc1('0x48')](handleError(_0x8ed882,null));};exports[_0x9dc1('0x53')]=function(_0x39b49c,_0x587f98){if(_0x39b49c[_0x9dc1('0x4a')]['id']){delete _0x39b49c[_0x9dc1('0x4a')]['id'];}return db['Campaign'][_0x9dc1('0x47')]({'where':{'id':_0x39b49c['params']['id']}})['then'](handleEntityNotFound(_0x587f98,null))['then'](saveUpdates(_0x39b49c[_0x9dc1('0x4a')],null))[_0x9dc1('0x24')](respondWithResult(_0x587f98,null))[_0x9dc1('0x48')](handleError(_0x587f98,null));};exports[_0x9dc1('0x23')]=function(_0x53deac,_0x2c473a){return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0x53deac[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c473a,null))['then'](removeEntity(_0x2c473a,null))[_0x9dc1('0x48')](handleError(_0x2c473a,null));};exports[_0x9dc1('0x54')]=function(_0x4c785b,_0x1145d5,_0x41cc55){var _0x18ad2c={'raw':!![],'where':{}};var _0x2ddbb6={};var _0x537c14={'count':0x0,'rows':[]};return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x4c785b['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x1145d5,null))[_0x9dc1('0x24')](function(_0x1a066d){if(_0x1a066d){_0x2ddbb6[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x56')][_0x9dc1('0x44')]);_0x2ddbb6[_0x9dc1('0x30')]=_['keys'](_0x4c785b[_0x9dc1('0x30')]);_0x2ddbb6['filters']=_[_0x9dc1('0x34')](_0x2ddbb6[_0x9dc1('0x2f')],_0x2ddbb6[_0x9dc1('0x30')]);_0x18ad2c[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x2ddbb6[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x4c785b[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x18ad2c[_0x9dc1('0x33')]=_0x18ad2c[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x18ad2c['attributes']:_0x2ddbb6[_0x9dc1('0x2f')];if(!_0x4c785b['query'][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x18ad2c[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x4c785b[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x18ad2c['offset']=qs[_0x9dc1('0x1e')](_0x4c785b[_0x9dc1('0x30')]['offset']);}_0x18ad2c[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x4c785b[_0x9dc1('0x30')]['sort']);_0x18ad2c['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x4c785b[_0x9dc1('0x30')],_0x2ddbb6['filters']));_0x18ad2c[_0x9dc1('0x3c')][_0x9dc1('0x58')]=_0x1a066d['id'];if(_0x4c785b[_0x9dc1('0x30')]['filter']){_0x18ad2c[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x18ad2c['where'],{'$or':_[_0x9dc1('0x2c')](_0x18ad2c[_0x9dc1('0x33')],function(_0x5ca0b2){var _0x252215={};_0x252215[_0x5ca0b2]={'$like':'%'+_0x4c785b[_0x9dc1('0x30')]['filter']+'%'};return _0x252215;})});}_0x18ad2c=_[_0x9dc1('0x3d')]({},_0x18ad2c,_0x4c785b['options']);return db[_0x9dc1('0x56')]['count']({'where':_0x18ad2c['where']})['then'](function(_0x195568){_0x537c14[_0x9dc1('0x1d')]=_0x195568;if(_0x4c785b[_0x9dc1('0x30')]['includeAll']){_0x18ad2c[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x56')][_0x9dc1('0x59')](_0x18ad2c);})[_0x9dc1('0x24')](function(_0x43b7cc){_0x537c14[_0x9dc1('0x5a')]=_0x43b7cc;return _0x537c14;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0x1145d5,_0x18ad2c))[_0x9dc1('0x48')](handleError(_0x1145d5,null));};exports[_0x9dc1('0x5b')]=function(_0x8f60f5,_0xbeaff2,_0x7b263f){var _0x1b7e1a={'raw':!![],'where':{}};var _0x3b6e86={};var _0x4e6568={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x8f60f5[_0x9dc1('0x43')]['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0xbeaff2,null))[_0x9dc1('0x24')](function(_0x3255dd){if(_0x3255dd){_0x3b6e86['model']=_[_0x9dc1('0x31')](db[_0x9dc1('0x5c')][_0x9dc1('0x44')]);_0x3b6e86[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x8f60f5[_0x9dc1('0x30')]);_0x3b6e86[_0x9dc1('0x32')]=_['intersection'](_0x3b6e86[_0x9dc1('0x2f')],_0x3b6e86[_0x9dc1('0x30')]);_0x1b7e1a['attributes']=_[_0x9dc1('0x34')](_0x3b6e86[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x8f60f5[_0x9dc1('0x30')]['fields']));_0x1b7e1a['attributes']=_0x1b7e1a['attributes']['length']?_0x1b7e1a[_0x9dc1('0x33')]:_0x3b6e86[_0x9dc1('0x2f')];if(!_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x1b7e1a['limit']=qs['limit'](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x1b7e1a['offset']=qs[_0x9dc1('0x1e')](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x1b7e1a[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x1b7e1a[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x8f60f5[_0x9dc1('0x30')],_0x3b6e86[_0x9dc1('0x32')]));_0x1b7e1a[_0x9dc1('0x3c')]['CampaignId']=_0x3255dd['id'];if(_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x1b7e1a['where']=_[_0x9dc1('0x3d')](_0x1b7e1a[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x1b7e1a[_0x9dc1('0x33')],function(_0x246248){var _0x57caff={};_0x57caff[_0x246248]={'$like':'%'+_0x8f60f5[_0x9dc1('0x30')]['filter']+'%'};return _0x57caff;})});}_0x1b7e1a=_[_0x9dc1('0x3d')]({},_0x1b7e1a,_0x8f60f5[_0x9dc1('0x45')]);return db['CmHopperHistory'][_0x9dc1('0x1d')]({'where':_0x1b7e1a[_0x9dc1('0x3c')]})[_0x9dc1('0x24')](function(_0x1c14ee){_0x4e6568['count']=_0x1c14ee;if(_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x1b7e1a['include']=[{'all':!![]}];}return db[_0x9dc1('0x5c')][_0x9dc1('0x59')](_0x1b7e1a);})[_0x9dc1('0x24')](function(_0x7a8ea7){_0x4e6568[_0x9dc1('0x5a')]=_0x7a8ea7;return _0x4e6568;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0xbeaff2,_0x1b7e1a))[_0x9dc1('0x48')](handleError(_0xbeaff2,null));};exports[_0x9dc1('0x5d')]=function(_0x52a5d3,_0x546ac1,_0x2602c6){var _0x3a6a52={'raw':!![],'where':{}};var _0x8a4385={};var _0x47b318={'count':0x0,'rows':[]};return db[_0x9dc1('0x46')][_0x9dc1('0x55')]({'where':{'id':_0x52a5d3['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x546ac1,null))[_0x9dc1('0x24')](function(_0x1cb806){if(_0x1cb806){_0x8a4385[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x5e')][_0x9dc1('0x44')]);_0x8a4385[_0x9dc1('0x30')]=_['keys'](_0x52a5d3[_0x9dc1('0x30')]);_0x8a4385['filters']=_[_0x9dc1('0x34')](_0x8a4385[_0x9dc1('0x2f')],_0x8a4385[_0x9dc1('0x30')]);_0x3a6a52[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x8a4385['model'],qs['fields'](_0x52a5d3['query'][_0x9dc1('0x35')]));_0x3a6a52[_0x9dc1('0x33')]=_0x3a6a52[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x3a6a52[_0x9dc1('0x33')]:_0x8a4385[_0x9dc1('0x2f')];if(!_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x3a6a52[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x3a6a52[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x3a6a52[_0x9dc1('0x39')]=qs['sort'](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x3a6a52[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x52a5d3['query'],_0x8a4385[_0x9dc1('0x32')]));_0x3a6a52[_0x9dc1('0x3c')]['CampaignId']=_0x1cb806['id'];if(_0x52a5d3[_0x9dc1('0x30')]['filter']){_0x3a6a52[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x3a6a52[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x3a6a52[_0x9dc1('0x33')],function(_0x300432){var _0x23b8fd={};_0x23b8fd[_0x300432]={'$like':'%'+_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x23b8fd;})});}_0x3a6a52=_[_0x9dc1('0x3d')]({},_0x3a6a52,_0x52a5d3['options']);return db['CmHopperFinal'][_0x9dc1('0x1d')]({'where':_0x3a6a52['where']})[_0x9dc1('0x24')](function(_0x38db78){_0x47b318[_0x9dc1('0x1d')]=_0x38db78;if(_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x3a6a52[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x5e')][_0x9dc1('0x59')](_0x3a6a52);})['then'](function(_0x4509fe){_0x47b318[_0x9dc1('0x5a')]=_0x4509fe;return _0x47b318;});}})['then'](respondWithFilteredResult(_0x546ac1,_0x3a6a52))[_0x9dc1('0x48')](handleError(_0x546ac1,null));};exports[_0x9dc1('0x5f')]=function(_0x5523f7,_0x6448dd,_0x11a96b){var _0x434528={'raw':!![],'where':{}};var _0x5b0647={};var _0x1165fa={'count':0x0,'rows':[]};return db[_0x9dc1('0x46')][_0x9dc1('0x55')]({'where':{'id':_0x5523f7['params']['id']}})['then'](handleEntityNotFound(_0x6448dd,null))[_0x9dc1('0x24')](function(_0x464ea2){if(_0x464ea2){_0x5b0647[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x60')][_0x9dc1('0x44')]);_0x5b0647[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x5523f7[_0x9dc1('0x30')]);_0x5b0647[_0x9dc1('0x32')]=_[_0x9dc1('0x34')](_0x5b0647[_0x9dc1('0x2f')],_0x5b0647[_0x9dc1('0x30')]);_0x434528[_0x9dc1('0x33')]=_['intersection'](_0x5b0647[_0x9dc1('0x2f')],qs['fields'](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x434528['attributes']=_0x434528['attributes'][_0x9dc1('0x36')]?_0x434528[_0x9dc1('0x33')]:_0x5b0647[_0x9dc1('0x2f')];if(!_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x434528[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x434528[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x434528[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x5523f7[_0x9dc1('0x30')]['sort']);_0x434528[_0x9dc1('0x3c')]=qs['filters'](_[_0x9dc1('0x3a')](_0x5523f7[_0x9dc1('0x30')],_0x5b0647[_0x9dc1('0x32')]));_0x434528['where'][_0x9dc1('0x58')]=_0x464ea2['id'];if(_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x434528['where']=_[_0x9dc1('0x3d')](_0x434528[_0x9dc1('0x3c')],{'$or':_['map'](_0x434528['attributes'],function(_0x28e154){var _0x28aba4={};_0x28aba4[_0x28e154]={'$like':'%'+_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x28aba4;})});}_0x434528=_[_0x9dc1('0x3d')]({},_0x434528,_0x5523f7[_0x9dc1('0x45')]);return db[_0x9dc1('0x60')][_0x9dc1('0x1d')]({'where':_0x434528[_0x9dc1('0x3c')]})[_0x9dc1('0x24')](function(_0x5a6304){_0x1165fa[_0x9dc1('0x1d')]=_0x5a6304;if(_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x434528[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x60')]['findAll'](_0x434528);})['then'](function(_0x5d3cfb){_0x1165fa[_0x9dc1('0x5a')]=_0x5d3cfb;return _0x1165fa;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0x6448dd,_0x434528))[_0x9dc1('0x48')](handleError(_0x6448dd,null));};exports['getLists']=function(_0x2382df,_0x22217f,_0x41320e){var _0x113c99={};var _0x43ca93={};var _0x2be239;var _0x4a8bf6;return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x2382df['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x22217f,null))[_0x9dc1('0x24')](function(_0x5c5dd1){if(_0x5c5dd1){_0x2be239=_0x5c5dd1;_0x43ca93[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x61')][_0x9dc1('0x44')]);_0x43ca93['query']=_[_0x9dc1('0x31')](_0x2382df[_0x9dc1('0x30')]);_0x43ca93[_0x9dc1('0x32')]=_['intersection'](_0x43ca93[_0x9dc1('0x2f')],_0x43ca93[_0x9dc1('0x30')]);_0x113c99[_0x9dc1('0x33')]=_['intersection'](_0x43ca93['model'],qs[_0x9dc1('0x35')](_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x113c99[_0x9dc1('0x33')]=_0x113c99[_0x9dc1('0x33')]['length']?_0x113c99[_0x9dc1('0x33')]:_0x43ca93[_0x9dc1('0x2f')];_0x113c99[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x113c99[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x2382df[_0x9dc1('0x30')],_0x43ca93['filters']));if(_0x2382df['query'][_0x9dc1('0x3b')]){_0x113c99[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x113c99[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x113c99[_0x9dc1('0x33')],function(_0x5c1b06){var _0x48e3ea={};_0x48e3ea[_0x5c1b06]={'$like':'%'+_0x2382df[_0x9dc1('0x30')]['filter']+'%'};return _0x48e3ea;})});}_0x113c99=_[_0x9dc1('0x3d')]({},_0x113c99,_0x2382df[_0x9dc1('0x45')]);return _0x2be239[_0x9dc1('0x62')](_0x113c99);}})['then'](function(_0x1d4606){if(_0x1d4606){_0x4a8bf6=_0x1d4606['length'];if(!_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x113c99[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x2382df['query'][_0x9dc1('0x1b')]);_0x113c99[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x2382df['query'][_0x9dc1('0x1e')]);}return _0x2be239[_0x9dc1('0x62')](_0x113c99);}})[_0x9dc1('0x24')](function(_0x199d40){if(_0x199d40){return _0x199d40?{'count':_0x4a8bf6,'rows':_0x199d40}:null;}})['then'](respondWithResult(_0x22217f,null))[_0x9dc1('0x48')](handleError(_0x22217f,null));};exports[_0x9dc1('0x63')]=function(_0x1ba42e,_0x492518,_0x129db8){var _0x1d84f4,_0x5e1123;return db[_0x9dc1('0x46')]['find']({'where':{'id':_0x1ba42e[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x492518,null))[_0x9dc1('0x24')](function(_0x542724){if(_0x542724){_0x5e1123=_0x542724;return _0x542724[_0x9dc1('0x63')](_0x1ba42e['body'][_0x9dc1('0x64')],_['omit'](_0x1ba42e[_0x9dc1('0x4a')],['ids','id'])||{});}return null;})[_0x9dc1('0x65')](function(_0x173d05){var _0x466bd8;_0x1d84f4=_0x173d05||[];var _0x7c6ed9=[];if(_0x173d05){for(var _0x54bc1e=0x0;_0x54bc1e<_0x173d05[_0x9dc1('0x36')];_0x54bc1e+=0x1){var _0x513109=_0x173d05[_0x54bc1e][_0x9dc1('0x25')]({'plain':!![]});_0x5e1123[_0x9dc1('0x66')]=_0x1ba42e[_0x9dc1('0x4a')][_0x9dc1('0x66')]?_0x1ba42e[_0x9dc1('0x4a')][_0x9dc1('0x66')]:_0x5e1123[_0x9dc1('0x66')];switch(_0x5e1123[_0x9dc1('0x66')]){case _0x9dc1('0x67'):_0x466bd8=squel[_0x9dc1('0x68')]()['into'](_0x9dc1('0x69'))[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),'scheduledAt',_0x9dc1('0x6c'),'ListId',_0x9dc1('0x58'),_0x9dc1('0x4e'),'updatedAt'],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x70'))[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))[_0x9dc1('0x6e')](_0x513109['CmListId']['toString'](),_0x9dc1('0x71'))[_0x9dc1('0x6e')](_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x4e'))['field'](_0x9dc1('0x6f'),_0x9dc1('0x73'))[_0x9dc1('0x74')](_0x9dc1('0x75'))[_0x9dc1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x513109[_0x9dc1('0x77')]['toString']())[_0x9dc1('0x3c')](_0x9dc1('0x78'))[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x7a'))[_0x9dc1('0x74')](_0x9dc1('0x7b'))[_0x9dc1('0x3c')](_0x9dc1('0x7c'),_0x1ba42e[_0x9dc1('0x43')]['id']['toString']()))[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel['select']()[_0x9dc1('0x6e')]('COALESCE(phone,\x27\x27)')['from'](_0x9dc1('0x69'))[_0x9dc1('0x3c')]('CampaignId\x20=\x20?',_0x1ba42e['params']['id'][_0x9dc1('0x72')]())))['toString']();break;case _0x9dc1('0x7d'):_0x466bd8=squel[_0x9dc1('0x68')]()[_0x9dc1('0x7e')]('cm_hopper')[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),'scheduledAt',_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),_0x9dc1('0x4e'),_0x9dc1('0x73')],squel[_0x9dc1('0x6d')]()['field']('phone',_0x9dc1('0x6b'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x70'))[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))['field'](_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')](),_0x9dc1('0x71'))['field'](_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')]('NOW()',_0x9dc1('0x4e'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x73'))[_0x9dc1('0x74')](_0x9dc1('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x7f'))[_0x9dc1('0x74')](_0x9dc1('0x69'))[_0x9dc1('0x3c')](_0x9dc1('0x7c'),_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')]())))[_0x9dc1('0x72')]();break;default:_0x466bd8=squel[_0x9dc1('0x68')]()['into'](_0x9dc1('0x69'))['fromQuery'](['phone','scheduledAt',_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),'createdAt','updatedAt'],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))['field'](_0x9dc1('0x6f'),'scheduledAt')[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))[_0x9dc1('0x6e')](_0x513109['CmListId'][_0x9dc1('0x72')](),'ListId')[_0x9dc1('0x6e')](_0x1ba42e['params']['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')]('NOW()',_0x9dc1('0x4e'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),'updatedAt')['from'](_0x9dc1('0x75'))[_0x9dc1('0x3c')](_0x9dc1('0x80'))[_0x9dc1('0x3c')]('ListId\x20=\x20?',_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')](_0x9dc1('0x78')))['toString']();}_0x7c6ed9['push'](db[_0x9dc1('0x81')][_0x9dc1('0x30')](_0x466bd8));}return BPromise[_0x9dc1('0x82')](_0x7c6ed9);}})[_0x9dc1('0x24')](function(){return _0x1d84f4;})[_0x9dc1('0x24')](respondWithResult(_0x492518,null))['catch'](handleError(_0x492518,null));};exports[_0x9dc1('0x83')]=function(_0x4991db,_0x368859,_0x745486){return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0x4991db[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x368859,null))[_0x9dc1('0x24')](function(_0x27991a){if(_0x27991a){return _0x27991a[_0x9dc1('0x83')](_0x4991db[_0x9dc1('0x30')]['ids']);}})[_0x9dc1('0x24')](function(_0x5f48d5){if(_0x5f48d5){return db['CmHopper'][_0x9dc1('0x23')]({'where':{'ListId':_0x4991db['query'][_0x9dc1('0x64')],'CampaignId':_0x4991db[_0x9dc1('0x43')]['id']}})['then'](function(){return _0x5f48d5;});}})[_0x9dc1('0x24')](respondWithStatusCode(_0x368859,null))[_0x9dc1('0x48')](handleError(_0x368859,null));};exports[_0x9dc1('0x84')]=function(_0x5a0b69,_0x2a7e63,_0x4ffaba){var _0x2b1555={};var _0x51800d={};var _0x497115;var _0x109aa1;return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x5a0b69['params']['id']}})['then'](handleEntityNotFound(_0x2a7e63,null))[_0x9dc1('0x24')](function(_0x55f0bb){if(_0x55f0bb){_0x497115=_0x55f0bb;_0x51800d['model']=_['keys'](db[_0x9dc1('0x61')][_0x9dc1('0x44')]);_0x51800d[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x5a0b69[_0x9dc1('0x30')]);_0x51800d['filters']=_[_0x9dc1('0x34')](_0x51800d[_0x9dc1('0x2f')],_0x51800d[_0x9dc1('0x30')]);_0x2b1555[_0x9dc1('0x33')]=_['intersection'](_0x51800d[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x2b1555[_0x9dc1('0x33')]=_0x2b1555[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x2b1555[_0x9dc1('0x33')]:_0x51800d[_0x9dc1('0x2f')];_0x2b1555['order']=qs[_0x9dc1('0x57')](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x2b1555['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x5a0b69[_0x9dc1('0x30')],_0x51800d[_0x9dc1('0x32')]));if(_0x5a0b69['query'][_0x9dc1('0x3b')]){_0x2b1555[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x2b1555[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x2b1555[_0x9dc1('0x33')],function(_0x2113a4){var _0x3982f5={};_0x3982f5[_0x2113a4]={'$like':'%'+_0x5a0b69[_0x9dc1('0x30')]['filter']+'%'};return _0x3982f5;})});}_0x2b1555=_[_0x9dc1('0x3d')]({},_0x2b1555,_0x5a0b69[_0x9dc1('0x45')]);return _0x497115['getBlackLists'](_0x2b1555);}})['then'](function(_0x160b5c){if(_0x160b5c){_0x109aa1=_0x160b5c[_0x9dc1('0x36')];if(!_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x2b1555['limit']=qs['limit'](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x2b1555[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x5a0b69[_0x9dc1('0x30')]['offset']);}return _0x497115[_0x9dc1('0x84')](_0x2b1555);}})[_0x9dc1('0x24')](function(_0x2542ab){if(_0x2542ab){return _0x2542ab?{'count':_0x109aa1,'rows':_0x2542ab}:null;}})[_0x9dc1('0x24')](respondWithResult(_0x2a7e63,null))[_0x9dc1('0x48')](handleError(_0x2a7e63,null));};exports['addBlackLists']=function(_0xaeeb7c,_0x22531e,_0x2460d7){var _0x2669af,_0x205588;return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0xaeeb7c[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x22531e,null))[_0x9dc1('0x24')](function(_0x42eefe){if(_0x42eefe){_0x205588=_0x42eefe;return _0x42eefe[_0x9dc1('0x85')](_0xaeeb7c['body'][_0x9dc1('0x64')],_[_0x9dc1('0x4d')](_0xaeeb7c[_0x9dc1('0x4a')],['ids','id'])||{});}return null;})[_0x9dc1('0x65')](function(_0x11b52d){var _0xbb0b15;_0x2669af=_0x11b52d||[];var _0xb6d35e=[];if(_0x11b52d){for(var _0xfdccf7=0x0;_0xfdccf7<_0x11b52d[_0x9dc1('0x36')];_0xfdccf7+=0x1){var _0x3e55f0=_0x11b52d[_0xfdccf7][_0x9dc1('0x25')]({'plain':!![]});_0xbb0b15=squel[_0x9dc1('0x68')]()[_0x9dc1('0x7e')](_0x9dc1('0x86'))[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),_0x9dc1('0x4e'),_0x9dc1('0x73')],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))[_0x9dc1('0x6e')]('id','ContactId')['field'](_0x3e55f0[_0x9dc1('0x77')][_0x9dc1('0x72')](),_0x9dc1('0x71'))[_0x9dc1('0x6e')](_0xaeeb7c[_0x9dc1('0x43')]['id']['toString'](),_0x9dc1('0x58'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x4e'))['field'](_0x9dc1('0x6f'),_0x9dc1('0x73'))['from']('cm_contacts')['where'](_0x9dc1('0x80'))[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x3e55f0[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x9dc1('0x72')]();_0xb6d35e[_0x9dc1('0x87')](db[_0x9dc1('0x81')][_0x9dc1('0x30')](_0xbb0b15));}return BPromise['all'](_0xb6d35e);}})['then'](function(){return _0x2669af;})[_0x9dc1('0x24')](respondWithResult(_0x22531e,null))[_0x9dc1('0x48')](handleError(_0x22531e,null));};exports[_0x9dc1('0x88')]=function(_0x211c00,_0x180ddb,_0x4ae02a){return db['Campaign'][_0x9dc1('0x47')]({'where':{'id':_0x211c00[_0x9dc1('0x43')]['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x180ddb,null))[_0x9dc1('0x24')](function(_0x3e251d){if(_0x3e251d){return _0x3e251d[_0x9dc1('0x88')](_0x211c00[_0x9dc1('0x30')][_0x9dc1('0x64')]);}})[_0x9dc1('0x24')](function(_0x30c047){if(_0x30c047){return db[_0x9dc1('0x60')][_0x9dc1('0x23')]({'where':{'ListId':_0x211c00[_0x9dc1('0x30')]['ids'],'CampaignId':_0x211c00[_0x9dc1('0x43')]['id']}})['then'](function(){return _0x30c047;});}})['then'](respondWithStatusCode(_0x180ddb,null))[_0x9dc1('0x48')](handleError(_0x180ddb,null));}; \ No newline at end of file +var _0x6ccb=['rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','role','UserProfileSection','destroy','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','CmListId','cm_contacts','ListId\x20=\x20?','insert','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','params','keys'];(function(_0x154f6a,_0x4c617b){var _0x833e6e=function(_0x255f83){while(--_0x255f83){_0x154f6a['push'](_0x154f6a['shift']());}};_0x833e6e(++_0x4c617b);}(_0x6ccb,0xc9));var _0xb6cc=function(_0x54218b,_0x456eca){_0x54218b=_0x54218b-0x0;var _0x54f8da=_0x6ccb[_0x54218b];return _0x54f8da;};'use strict';var emlformat=require(_0xb6cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb6cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb6cc('0x2'));var BPromise=require(_0xb6cc('0x3'));var Mustache=require('mustache');var util=require(_0xb6cc('0x4'));var path=require(_0xb6cc('0x5'));var sox=require('sox');var csv=require(_0xb6cc('0x6'));var ejs=require(_0xb6cc('0x7'));var fs=require('fs');var fs_extra=require(_0xb6cc('0x8'));var _=require(_0xb6cc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb6cc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb6cc('0x6'));var querystring=require('querystring');var Papa=require(_0xb6cc('0xb'));var Redis=require(_0xb6cc('0xc'));var authService=require(_0xb6cc('0xd'));var qs=require(_0xb6cc('0xe'));var as=require(_0xb6cc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6cc('0x10'))(_0xb6cc('0x11'));var utils=require(_0xb6cc('0x12'));var config=require(_0xb6cc('0x13'));var licenseUtil=require(_0xb6cc('0x14'));var db=require(_0xb6cc('0x15'))['db'];function respondWithStatusCode(_0x6fc8b0,_0x5960ea){_0x5960ea=_0x5960ea||0xcc;return function(_0x5c9cd4){if(_0x5c9cd4){return _0x6fc8b0[_0xb6cc('0x16')](_0x5960ea);}return _0x6fc8b0[_0xb6cc('0x17')](_0x5960ea)[_0xb6cc('0x18')]();};}function respondWithResult(_0x16ec67,_0x35e602){_0x35e602=_0x35e602||0xc8;return function(_0x243537){if(_0x243537){return _0x16ec67[_0xb6cc('0x17')](_0x35e602)[_0xb6cc('0x19')](_0x243537);}};}function respondWithFilteredResult(_0x18b801,_0x50e3da){return function(_0x345878){if(_0x345878){var _0x4334f3=typeof _0x50e3da[_0xb6cc('0x1a')]===_0xb6cc('0x1b')&&typeof _0x50e3da[_0xb6cc('0x1c')]==='undefined';var _0x2c287f=_0x345878[_0xb6cc('0x1d')];var _0x8a2295=_0x4334f3?0x0:_0x50e3da['offset'];var _0x1b5d61=_0x4334f3?_0x345878[_0xb6cc('0x1d')]:_0x50e3da[_0xb6cc('0x1a')]+_0x50e3da['limit'];var _0x563733;if(_0x1b5d61>=_0x2c287f){_0x1b5d61=_0x2c287f;_0x563733=0xc8;}else{_0x563733=0xce;}_0x18b801[_0xb6cc('0x17')](_0x563733);return _0x18b801[_0xb6cc('0x1e')](_0xb6cc('0x1f'),_0x8a2295+'-'+_0x1b5d61+'/'+_0x2c287f)[_0xb6cc('0x19')](_0x345878);}return null;};}function patchUpdates(_0x2a81b7){return function(_0x157489){try{jsonpatch[_0xb6cc('0x20')](_0x157489,_0x2a81b7,!![]);}catch(_0x37afd3){return BPromise['reject'](_0x37afd3);}return _0x157489[_0xb6cc('0x21')]();};}function saveUpdates(_0x3f20ca,_0x23ceb7){return function(_0x48c65e){if(_0x48c65e){return _0x48c65e[_0xb6cc('0x22')](_0x3f20ca)['then'](function(_0x1f173a){return _0x1f173a;});}return null;};}function removeEntity(_0x271f38,_0x22470f){return function(_0x39a197){if(_0x39a197){return _0x39a197['destroy']()['then'](function(){var _0x4adb76=_0x39a197['get']({'plain':!![]});var _0x5ddfb4=_0xb6cc('0x23');return db[_0xb6cc('0x24')]['destroy']({'where':{'type':_0x5ddfb4,'resourceId':_0x4adb76['id']}})[_0xb6cc('0x25')](function(){return _0x39a197;});})[_0xb6cc('0x25')](function(){_0x271f38['status'](0xcc)[_0xb6cc('0x18')]();});}};}function handleEntityNotFound(_0x1506ff,_0x5e28d3){return function(_0x159cc0){if(!_0x159cc0){_0x1506ff[_0xb6cc('0x16')](0x194);}return _0x159cc0;};}function handleError(_0x28b951,_0x34b09e){_0x34b09e=_0x34b09e||0x1f4;return function(_0xf676f6){logger[_0xb6cc('0x26')](_0xf676f6[_0xb6cc('0x27')]);if(_0xf676f6['name']){delete _0xf676f6[_0xb6cc('0x28')];}_0x28b951[_0xb6cc('0x17')](_0x34b09e)[_0xb6cc('0x29')](_0xf676f6);};}exports[_0xb6cc('0x2a')]=function(_0x50aa51,_0x130b47){var _0x3d7e8f={},_0x89b079={},_0x434c={'count':0x0,'rows':[]};var _0x305027=_[_0xb6cc('0x2b')](db[_0xb6cc('0x2c')]['rawAttributes'],function(_0xededf6){return{'name':_0xededf6[_0xb6cc('0x2d')],'type':_0xededf6['type']['key']};});_0x89b079[_0xb6cc('0x2e')]=_['map'](_0x305027,_0xb6cc('0x28'));_0x89b079[_0xb6cc('0x2f')]=_['keys'](_0x50aa51[_0xb6cc('0x2f')]);_0x89b079[_0xb6cc('0x30')]=_['intersection'](_0x89b079[_0xb6cc('0x2e')],_0x89b079[_0xb6cc('0x2f')]);_0x3d7e8f[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x89b079['model'],qs[_0xb6cc('0x33')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3d7e8f[_0xb6cc('0x31')]=_0x3d7e8f[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x3d7e8f['attributes']:_0x89b079['model'];if(!_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x3d7e8f['limit']=qs[_0xb6cc('0x1c')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x3d7e8f[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}_0x3d7e8f[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x3d7e8f['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0x50aa51[_0xb6cc('0x2f')],_0x89b079['filters']),_0x305027);if(_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x3d7e8f[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x3d7e8f[_0xb6cc('0x3b')],{'$or':_['map'](_0x305027,function(_0x260e6c){if(_0x260e6c['type']!=='VIRTUAL'){var _0x44792b={};_0x44792b[_0x260e6c[_0xb6cc('0x28')]]={'$like':'%'+_0x50aa51[_0xb6cc('0x2f')]['filter']+'%'};return _0x44792b;}})});}_0x3d7e8f=_['merge']({},_0x3d7e8f,_0x50aa51[_0xb6cc('0x3d')]);var _0x15fca3={'where':_0x3d7e8f[_0xb6cc('0x3b')]};return db[_0xb6cc('0x2c')][_0xb6cc('0x1d')](_0x15fca3)[_0xb6cc('0x25')](function(_0x163159){_0x434c[_0xb6cc('0x1d')]=_0x163159;if(_0x50aa51['query'][_0xb6cc('0x3e')]){_0x3d7e8f[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x2c')]['findAll'](_0x3d7e8f);})[_0xb6cc('0x25')](function(_0x4f0d22){_0x434c[_0xb6cc('0x40')]=_0x4f0d22;return _0x434c;})[_0xb6cc('0x25')](respondWithFilteredResult(_0x130b47,_0x3d7e8f))['catch'](handleError(_0x130b47,null));};exports['show']=function(_0x5b8c59,_0x7a3934){var _0x2c7218={'raw':![],'where':{'id':_0x5b8c59[_0xb6cc('0x41')]['id']}},_0x2aa1dc={};_0x2aa1dc[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x2aa1dc['query']=_[_0xb6cc('0x42')](_0x5b8c59[_0xb6cc('0x2f')]);_0x2aa1dc['filters']=_[_0xb6cc('0x32')](_0x2aa1dc[_0xb6cc('0x2e')],_0x2aa1dc[_0xb6cc('0x2f')]);_0x2c7218[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x2aa1dc['model'],qs['fields'](_0x5b8c59[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x2c7218[_0xb6cc('0x31')]=_0x2c7218[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x2c7218[_0xb6cc('0x31')]:_0x2aa1dc[_0xb6cc('0x2e')];if(_0x5b8c59['query']['includeAll']){_0x2c7218[_0xb6cc('0x3f')]=[{'all':!![]}];}_0x2c7218=_['merge']({},_0x2c7218,_0x5b8c59['options']);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x2c7218)[_0xb6cc('0x25')](handleEntityNotFound(_0x7a3934,null))[_0xb6cc('0x25')](respondWithResult(_0x7a3934,null))[_0xb6cc('0x45')](handleError(_0x7a3934,null));};exports[_0xb6cc('0x46')]=function(_0x2e8e3f,_0x18e70e){return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_0x2e8e3f['body'],{})['then'](function(_0x354e4a){var _0x369851=_0x2e8e3f[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x369851)throw new Error(_0xb6cc('0x49'));if(_0x369851['role']===_0xb6cc('0x47')){var _0x4da830=_0x354e4a[_0xb6cc('0x48')]({'plain':!![]});var _0x21d1c6=_0xb6cc('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x21d1c6,'userProfileId':_0x369851[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x35cb0f){if(_0x35cb0f&&_0x35cb0f[_0xb6cc('0x4b')]===0x0){return db[_0xb6cc('0x24')][_0xb6cc('0x46')]({'name':_0x4da830[_0xb6cc('0x28')],'resourceId':_0x4da830['id'],'type':_0x35cb0f[_0xb6cc('0x28')],'sectionId':_0x35cb0f['id']},{})[_0xb6cc('0x25')](function(){return _0x354e4a;});}else{return _0x354e4a;}})['catch'](function(_0x239b87){logger['error'](_0xb6cc('0x4c'),_0x239b87);throw _0x239b87;});}return _0x354e4a;})[_0xb6cc('0x25')](respondWithResult(_0x18e70e,0xc9))[_0xb6cc('0x45')](handleError(_0x18e70e,null));};exports[_0xb6cc('0x4d')]=function(_0x7bbb71,_0x261139){var _0x3c0fcb={'where':{'id':_0x7bbb71[_0xb6cc('0x41')]['id']}},_0x158a55={};_0x158a55[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x3c0fcb[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x158a55[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3c0fcb['attributes']=_0x3c0fcb['attributes'][_0xb6cc('0x34')]?_0x3c0fcb[_0xb6cc('0x31')]:_0x158a55['model'];if(_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x3c0fcb['include']=[{'all':!![]}];}_0x3c0fcb=_[_0xb6cc('0x3c')]({},_0x3c0fcb,_0x7bbb71[_0xb6cc('0x3d')]);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x3c0fcb)[_0xb6cc('0x25')](handleEntityNotFound(_0x261139,null))[_0xb6cc('0x25')](function(_0x23da13){if(_0x23da13){var _0x376c78=_0x23da13[_0xb6cc('0x48')]({'plain':!![]});_0x376c78=qs[_0xb6cc('0x4e')](_0x376c78,['id','createdAt',_0xb6cc('0x4f')]);_0x7bbb71[_0xb6cc('0x50')]=_[_0xb6cc('0x4e')](_0x7bbb71[_0xb6cc('0x50')],['id','createdAt','updatedAt']);return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_['merge'](_0x376c78,_0x7bbb71['body']),{'include':_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0xe30e32){var _0x2e2669=_0x7bbb71[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x2e2669)throw new Error(_0xb6cc('0x49'));if(_0x2e2669[_0xb6cc('0x51')]===_0xb6cc('0x47')){var _0x24ace9=_0xe30e32[_0xb6cc('0x48')]({'plain':!![]});var _0x173fe6=_0xb6cc('0x23');return db[_0xb6cc('0x52')]['find']({'where':{'name':_0x173fe6,'userProfileId':_0x2e2669[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x579653){if(_0x579653&&_0x579653[_0xb6cc('0x4b')]===0x0){return db['UserProfileResource'][_0xb6cc('0x46')]({'name':_0x24ace9[_0xb6cc('0x28')],'resourceId':_0x24ace9['id'],'type':_0x579653[_0xb6cc('0x28')],'sectionId':_0x579653['id']},{})[_0xb6cc('0x25')](function(){return _0xe30e32;});}else{return _0xe30e32;}})[_0xb6cc('0x45')](function(_0x560cd5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560cd5);throw _0x560cd5;});}return _0xe30e32;});}})[_0xb6cc('0x25')](respondWithResult(_0x261139,0xc9))[_0xb6cc('0x45')](handleError(_0x261139,null));};exports[_0xb6cc('0x22')]=function(_0x23c605,_0x2712bc){if(_0x23c605[_0xb6cc('0x50')]['id']){delete _0x23c605[_0xb6cc('0x50')]['id'];}return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23c605[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x2712bc,null))['then'](saveUpdates(_0x23c605['body'],null))[_0xb6cc('0x25')](respondWithResult(_0x2712bc,null))['catch'](handleError(_0x2712bc,null));};exports[_0xb6cc('0x53')]=function(_0x4b55fd,_0x54d1c1){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x4b55fd['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x54d1c1,null))[_0xb6cc('0x25')](removeEntity(_0x54d1c1,null))[_0xb6cc('0x45')](handleError(_0x54d1c1,null));};exports[_0xb6cc('0x54')]=function(_0x42ce68,_0xa82a45,_0x5803f6){var _0x47f83c={'raw':!![],'where':{}};var _0x1aa2fa={};var _0x84b5f7={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x42ce68[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xa82a45,null))[_0xb6cc('0x25')](function(_0x3010b3){if(_0x3010b3){_0x1aa2fa[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmHopper'][_0xb6cc('0x43')]);_0x1aa2fa['query']=_[_0xb6cc('0x42')](_0x42ce68[_0xb6cc('0x2f')]);_0x1aa2fa['filters']=_[_0xb6cc('0x32')](_0x1aa2fa['model'],_0x1aa2fa[_0xb6cc('0x2f')]);_0x47f83c[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x1aa2fa[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x42ce68[_0xb6cc('0x2f')]['fields']));_0x47f83c[_0xb6cc('0x31')]=_0x47f83c['attributes']['length']?_0x47f83c[_0xb6cc('0x31')]:_0x1aa2fa[_0xb6cc('0x2e')];if(!_0x42ce68[_0xb6cc('0x2f')]['hasOwnProperty'](_0xb6cc('0x36'))){_0x47f83c[_0xb6cc('0x1c')]=qs[_0xb6cc('0x1c')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x47f83c[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x42ce68[_0xb6cc('0x2f')]['offset']);}_0x47f83c[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x47f83c[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x42ce68[_0xb6cc('0x2f')],_0x1aa2fa[_0xb6cc('0x30')]));_0x47f83c[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x3010b3['id'];if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x47f83c[_0xb6cc('0x3b')]=_['merge'](_0x47f83c[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x47f83c['attributes'],function(_0x432c5d){var _0x11a6d4={};_0x11a6d4[_0x432c5d]={'$like':'%'+_0x42ce68[_0xb6cc('0x2f')]['filter']+'%'};return _0x11a6d4;})});}_0x47f83c=_[_0xb6cc('0x3c')]({},_0x47f83c,_0x42ce68[_0xb6cc('0x3d')]);return db[_0xb6cc('0x57')]['count']({'where':_0x47f83c[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0xf48fcd){_0x84b5f7[_0xb6cc('0x1d')]=_0xf48fcd;if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x47f83c[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x47f83c);})[_0xb6cc('0x25')](function(_0x10c99e){_0x84b5f7[_0xb6cc('0x40')]=_0x10c99e;return _0x84b5f7;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0xa82a45,_0x47f83c))[_0xb6cc('0x45')](handleError(_0xa82a45,null));};exports[_0xb6cc('0x58')]=function(_0x1760fa,_0x235e52,_0x331795){var _0xba0742={'raw':!![],'where':{}};var _0x2b8761={};var _0xdcc4fc={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x1760fa[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x235e52,null))[_0xb6cc('0x25')](function(_0x37b83f){if(_0x37b83f){_0x2b8761[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x59')][_0xb6cc('0x43')]);_0x2b8761[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x1760fa[_0xb6cc('0x2f')]);_0x2b8761['filters']=_[_0xb6cc('0x32')](_0x2b8761['model'],_0x2b8761[_0xb6cc('0x2f')]);_0xba0742['attributes']=_[_0xb6cc('0x32')](_0x2b8761[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xba0742[_0xb6cc('0x31')]=_0xba0742[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0xba0742[_0xb6cc('0x31')]:_0x2b8761[_0xb6cc('0x2e')];if(!_0x1760fa['query'][_0xb6cc('0x35')]('nolimit')){_0xba0742['limit']=qs['limit'](_0x1760fa[_0xb6cc('0x2f')]['limit']);_0xba0742[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x1760fa['query'][_0xb6cc('0x1a')]);}_0xba0742['order']=qs[_0xb6cc('0x38')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0xba0742['where']=qs[_0xb6cc('0x30')](_['pick'](_0x1760fa['query'],_0x2b8761[_0xb6cc('0x30')]));_0xba0742[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x37b83f['id'];if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0xba0742[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xba0742[_0xb6cc('0x3b')],{'$or':_['map'](_0xba0742[_0xb6cc('0x31')],function(_0x48f13c){var _0x550c3a={};_0x550c3a[_0x48f13c]={'$like':'%'+_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x550c3a;})});}_0xba0742=_[_0xb6cc('0x3c')]({},_0xba0742,_0x1760fa['options']);return db[_0xb6cc('0x59')][_0xb6cc('0x1d')]({'where':_0xba0742[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x1f1f8d){_0xdcc4fc[_0xb6cc('0x1d')]=_0x1f1f8d;if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xba0742[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xba0742);})['then'](function(_0x59e58b){_0xdcc4fc[_0xb6cc('0x40')]=_0x59e58b;return _0xdcc4fc;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x235e52,_0xba0742))[_0xb6cc('0x45')](handleError(_0x235e52,null));};exports[_0xb6cc('0x5a')]=function(_0xfd9ec4,_0x10fa67,_0x5c2f00){var _0xb5aec3={'raw':!![],'where':{}};var _0x53e468={};var _0x9966c8={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0xfd9ec4['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x10fa67,null))[_0xb6cc('0x25')](function(_0x53aea7){if(_0x53aea7){_0x53e468[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x5b')][_0xb6cc('0x43')]);_0x53e468[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0xfd9ec4[_0xb6cc('0x2f')]);_0x53e468[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x53e468[_0xb6cc('0x2e')],_0x53e468['query']);_0xb5aec3[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53e468['model'],qs[_0xb6cc('0x33')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xb5aec3['attributes']=_0xb5aec3['attributes'][_0xb6cc('0x34')]?_0xb5aec3[_0xb6cc('0x31')]:_0x53e468[_0xb6cc('0x2e')];if(!_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0xb5aec3['limit']=qs[_0xb6cc('0x1c')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0xb5aec3['offset']=qs['offset'](_0xfd9ec4[_0xb6cc('0x2f')]['offset']);}_0xb5aec3[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0xfd9ec4[_0xb6cc('0x2f')]['sort']);_0xb5aec3['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0xfd9ec4[_0xb6cc('0x2f')],_0x53e468[_0xb6cc('0x30')]));_0xb5aec3[_0xb6cc('0x3b')]['CampaignId']=_0x53aea7['id'];if(_0xfd9ec4[_0xb6cc('0x2f')]['filter']){_0xb5aec3[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xb5aec3[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0xb5aec3[_0xb6cc('0x31')],function(_0x3385f0){var _0x23a8b3={};_0x23a8b3[_0x3385f0]={'$like':'%'+_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x23a8b3;})});}_0xb5aec3=_[_0xb6cc('0x3c')]({},_0xb5aec3,_0xfd9ec4['options']);return db[_0xb6cc('0x5b')][_0xb6cc('0x1d')]({'where':_0xb5aec3[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x319ba5){_0x9966c8['count']=_0x319ba5;if(_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xb5aec3['include']=[{'all':!![]}];}return db[_0xb6cc('0x5b')][_0xb6cc('0x5c')](_0xb5aec3);})[_0xb6cc('0x25')](function(_0x14ad5c){_0x9966c8[_0xb6cc('0x40')]=_0x14ad5c;return _0x9966c8;});}})['then'](respondWithFilteredResult(_0x10fa67,_0xb5aec3))[_0xb6cc('0x45')](handleError(_0x10fa67,null));};exports[_0xb6cc('0x5d')]=function(_0x4ce81d,_0x30e09e,_0x1e4827){var _0x317b40={'raw':!![],'where':{}};var _0x53c114={};var _0x4efd48={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x4ce81d[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x30e09e,null))[_0xb6cc('0x25')](function(_0x5248c1){if(_0x5248c1){_0x53c114[_0xb6cc('0x2e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x53c114[_0xb6cc('0x2f')]=_['keys'](_0x4ce81d[_0xb6cc('0x2f')]);_0x53c114[_0xb6cc('0x30')]=_['intersection'](_0x53c114[_0xb6cc('0x2e')],_0x53c114[_0xb6cc('0x2f')]);_0x317b40[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53c114[_0xb6cc('0x2e')],qs['fields'](_0x4ce81d['query'][_0xb6cc('0x33')]));_0x317b40[_0xb6cc('0x31')]=_0x317b40[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x317b40[_0xb6cc('0x31')]:_0x53c114[_0xb6cc('0x2e')];if(!_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x317b40['limit']=qs[_0xb6cc('0x1c')](_0x4ce81d['query'][_0xb6cc('0x1c')]);_0x317b40[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x4ce81d['query'][_0xb6cc('0x1a')]);}_0x317b40['order']=qs[_0xb6cc('0x38')](_0x4ce81d['query']['sort']);_0x317b40[_0xb6cc('0x3b')]=qs[_0xb6cc('0x30')](_['pick'](_0x4ce81d[_0xb6cc('0x2f')],_0x53c114['filters']));_0x317b40[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x5248c1['id'];if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x317b40['where']=_[_0xb6cc('0x3c')](_0x317b40[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x317b40[_0xb6cc('0x31')],function(_0x1ef7a2){var _0x4b8aa1={};_0x4b8aa1[_0x1ef7a2]={'$like':'%'+_0x4ce81d['query'][_0xb6cc('0x3a')]+'%'};return _0x4b8aa1;})});}_0x317b40=_[_0xb6cc('0x3c')]({},_0x317b40,_0x4ce81d[_0xb6cc('0x3d')]);return db['CmHopperBlack'][_0xb6cc('0x1d')]({'where':_0x317b40[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x3e6156){_0x4efd48['count']=_0x3e6156;if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x317b40[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x5e')][_0xb6cc('0x5c')](_0x317b40);})['then'](function(_0xdcf81a){_0x4efd48[_0xb6cc('0x40')]=_0xdcf81a;return _0x4efd48;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x30e09e,_0x317b40))[_0xb6cc('0x45')](handleError(_0x30e09e,null));};exports[_0xb6cc('0x5f')]=function(_0x2fdc61,_0xb2b7dc,_0x54ef25){var _0x11ef9d={};var _0x185cad={};var _0x4b7548;var _0x1d82e9;return db['Campaign']['findOne']({'where':{'id':_0x2fdc61[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xb2b7dc,null))['then'](function(_0x27b706){if(_0x27b706){_0x4b7548=_0x27b706;_0x185cad[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmList']['rawAttributes']);_0x185cad[_0xb6cc('0x2f')]=_['keys'](_0x2fdc61['query']);_0x185cad[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x185cad[_0xb6cc('0x2e')],_0x185cad[_0xb6cc('0x2f')]);_0x11ef9d['attributes']=_['intersection'](_0x185cad['model'],qs[_0xb6cc('0x33')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x11ef9d['attributes']=_0x11ef9d[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x11ef9d[_0xb6cc('0x31')]:_0x185cad[_0xb6cc('0x2e')];_0x11ef9d[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x11ef9d[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x2fdc61['query'],_0x185cad[_0xb6cc('0x30')]));if(_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x11ef9d[_0xb6cc('0x3b')]=_['merge'](_0x11ef9d['where'],{'$or':_[_0xb6cc('0x2b')](_0x11ef9d[_0xb6cc('0x31')],function(_0x4ba31e){var _0x47addc={};_0x47addc[_0x4ba31e]={'$like':'%'+_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x47addc;})});}_0x11ef9d=_['merge']({},_0x11ef9d,_0x2fdc61[_0xb6cc('0x3d')]);return _0x4b7548[_0xb6cc('0x5f')](_0x11ef9d);}})[_0xb6cc('0x25')](function(_0x47dc79){if(_0x47dc79){_0x1d82e9=_0x47dc79[_0xb6cc('0x34')];if(!_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x11ef9d['limit']=qs[_0xb6cc('0x1c')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x11ef9d['offset']=qs[_0xb6cc('0x1a')](_0x2fdc61[_0xb6cc('0x2f')]['offset']);}return _0x4b7548['getLists'](_0x11ef9d);}})['then'](function(_0x1661bf){if(_0x1661bf){return _0x1661bf?{'count':_0x1d82e9,'rows':_0x1661bf}:null;}})['then'](respondWithResult(_0xb2b7dc,null))[_0xb6cc('0x45')](handleError(_0xb2b7dc,null));};exports[_0xb6cc('0x60')]=function(_0xe45ed9,_0x1ccbf6,_0x389b61){var _0x231cb5,_0x1fae3e;return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0xe45ed9['params']['id']}})['then'](handleEntityNotFound(_0x1ccbf6,null))[_0xb6cc('0x25')](function(_0x21a902){if(_0x21a902){_0x1fae3e=_0x21a902;return _0x21a902['addLists'](_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0xe45ed9[_0xb6cc('0x50')],[_0xb6cc('0x61'),'id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x191994){var _0x13a010;_0x231cb5=_0x191994||[];var _0x3c3d41=[];if(_0x191994){for(var _0xaf7633=0x0;_0xaf7633<_0x191994[_0xb6cc('0x34')];_0xaf7633+=0x1){var _0x27ff91=_0x191994[_0xaf7633]['get']({'plain':!![]});_0x1fae3e[_0xb6cc('0x63')]=_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x63')]?_0xe45ed9['body'][_0xb6cc('0x63')]:_0x1fae3e[_0xb6cc('0x63')];switch(_0x1fae3e[_0xb6cc('0x63')]){case _0xb6cc('0x64'):_0x13a010=squel['insert']()[_0xb6cc('0x65')](_0xb6cc('0x66'))[_0xb6cc('0x67')]([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId','CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')]('phone',_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91['CmListId'][_0xb6cc('0x6f')](),_0xb6cc('0x70'))['field'](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x6b'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')]('cm_contacts')[_0xb6cc('0x3b')](_0xb6cc('0x72'))[_0xb6cc('0x3b')]('ListId\x20=\x20?',_0x27ff91['CmListId'][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73'))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x75'))['from'](_0xb6cc('0x76'))['where'](_0xb6cc('0x77'),_0xe45ed9['params']['id'][_0xb6cc('0x6f')]()))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')]('cm_hopper')[_0xb6cc('0x3b')]('CampaignId\x20=\x20?',_0xe45ed9['params']['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;case'onlyIfOpen':_0x13a010=squel['insert']()[_0xb6cc('0x65')]('cm_hopper')[_0xb6cc('0x67')](['phone',_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId',_0xb6cc('0x56'),'createdAt',_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()['field'](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))['field']('id','ContactId')[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field']('NOW()','createdAt')[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')](_0xb6cc('0x66'))[_0xb6cc('0x3b')](_0xb6cc('0x77'),_0xe45ed9[_0xb6cc('0x41')]['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;default:_0x13a010=squel[_0xb6cc('0x7c')]()['into'](_0xb6cc('0x66'))['fromQuery']([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),_0xb6cc('0x70'),'CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel['select']()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),'scheduledAt')[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();}_0x3c3d41[_0xb6cc('0x7d')](db['sequelize'][_0xb6cc('0x2f')](_0x13a010));}return BPromise[_0xb6cc('0x7e')](_0x3c3d41);}})[_0xb6cc('0x25')](function(){return _0x231cb5;})[_0xb6cc('0x25')](respondWithResult(_0x1ccbf6,null))['catch'](handleError(_0x1ccbf6,null));};exports[_0xb6cc('0x7f')]=function(_0x23a025,_0x36b7f2,_0x54fdf9){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23a025[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x36b7f2,null))[_0xb6cc('0x25')](function(_0x31a490){if(_0x31a490){return _0x31a490[_0xb6cc('0x7f')](_0x23a025[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x111b37){if(_0x111b37){return db['CmHopper']['destroy']({'where':{'ListId':_0x23a025[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x23a025['params']['id']}})[_0xb6cc('0x25')](function(){return _0x111b37;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x36b7f2,null))[_0xb6cc('0x45')](handleError(_0x36b7f2,null));};exports[_0xb6cc('0x80')]=function(_0x59a9df,_0x5f00a2,_0x527abd){var _0x538be5={};var _0x1303b9={};var _0x4891d9;var _0x557d24;return db[_0xb6cc('0x2c')]['findOne']({'where':{'id':_0x59a9df[_0xb6cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f00a2,null))[_0xb6cc('0x25')](function(_0x4824b6){if(_0x4824b6){_0x4891d9=_0x4824b6;_0x1303b9[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x81')]['rawAttributes']);_0x1303b9[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x59a9df[_0xb6cc('0x2f')]);_0x1303b9[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x1303b9['model'],_0x1303b9[_0xb6cc('0x2f')]);_0x538be5['attributes']=_['intersection'](_0x1303b9['model'],qs[_0xb6cc('0x33')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x538be5[_0xb6cc('0x31')]=_0x538be5[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x538be5[_0xb6cc('0x31')]:_0x1303b9['model'];_0x538be5[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x538be5['where']=qs['filters'](_[_0xb6cc('0x39')](_0x59a9df[_0xb6cc('0x2f')],_0x1303b9['filters']));if(_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x538be5[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x538be5[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x538be5[_0xb6cc('0x31')],function(_0xe2da37){var _0x3fceed={};_0x3fceed[_0xe2da37]={'$like':'%'+_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x3fceed;})});}_0x538be5=_['merge']({},_0x538be5,_0x59a9df['options']);return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x443449){if(_0x443449){_0x557d24=_0x443449['length'];if(!_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x538be5[_0xb6cc('0x1c')]=qs['limit'](_0x59a9df['query']['limit']);_0x538be5['offset']=qs[_0xb6cc('0x1a')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x4a7118){if(_0x4a7118){return _0x4a7118?{'count':_0x557d24,'rows':_0x4a7118}:null;}})[_0xb6cc('0x25')](respondWithResult(_0x5f00a2,null))[_0xb6cc('0x45')](handleError(_0x5f00a2,null));};exports[_0xb6cc('0x82')]=function(_0x2b5701,_0x12d19e,_0x2a4f2e){var _0x1ceaf3,_0x371c2e;return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x2b5701[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x12d19e,null))[_0xb6cc('0x25')](function(_0xe3d9f6){if(_0xe3d9f6){_0x371c2e=_0xe3d9f6;return _0xe3d9f6[_0xb6cc('0x82')](_0x2b5701['body'][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0x2b5701[_0xb6cc('0x50')],['ids','id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x2b7dc2){var _0x427d60;_0x1ceaf3=_0x2b7dc2||[];var _0x5b3518=[];if(_0x2b7dc2){for(var _0x4a34b0=0x0;_0x4a34b0<_0x2b7dc2[_0xb6cc('0x34')];_0x4a34b0+=0x1){var _0x3b64cd=_0x2b7dc2[_0x4a34b0][_0xb6cc('0x48')]({'plain':!![]});_0x427d60=squel[_0xb6cc('0x7c')]()[_0xb6cc('0x65')](_0xb6cc('0x83'))['fromQuery']([_0xb6cc('0x68'),'ContactId',_0xb6cc('0x70'),_0xb6cc('0x56'),_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))['field'](_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0x2b5701['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb6cc('0x7b'),_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();_0x5b3518[_0xb6cc('0x7d')](db[_0xb6cc('0x84')]['query'](_0x427d60));}return BPromise['all'](_0x5b3518);}})['then'](function(){return _0x1ceaf3;})['then'](respondWithResult(_0x12d19e,null))['catch'](handleError(_0x12d19e,null));};exports[_0xb6cc('0x85')]=function(_0x581ac2,_0x4b880c,_0x2f21e2){return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x4b880c,null))[_0xb6cc('0x25')](function(_0x3a0553){if(_0x3a0553){return _0x3a0553['removeBlackLists'](_0x581ac2[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x4e7ce0){if(_0x4e7ce0){return db[_0xb6cc('0x5e')][_0xb6cc('0x53')]({'where':{'ListId':_0x581ac2[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](function(){return _0x4e7ce0;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x4b880c,null))[_0xb6cc('0x45')](handleError(_0x4b880c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d198470..501fd50 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 4fa7672..2b10762 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 _0x3685=['request\x20sent','debug','stringify','error','code','message','result','GetCampaign','Campaign','raw','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x193c54,_0x52b209){var _0x1a8b38=function(_0x5c9db3){while(--_0x5c9db3){_0x193c54['push'](_0x193c54['shift']());}};_0x1a8b38(++_0x52b209);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Campaign,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});}exports[_0x5368('0x17')]=function(_0x5b10e9){var _0x3fcae0=this;return new Promise(function(_0x56ac4d,_0x4baaa9){return db[_0x5368('0x18')]['findAll']({'raw':_0x5b10e9['options']?_0x5b10e9['options'][_0x5368('0x19')]===undefined?!![]:![]:!![],'where':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')]['where']||null:null,'attributes':_0x5b10e9['options']?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1b')]||null:null,'limit':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1c')]||null:null,'include':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1d')]?_[_0x5368('0x1e')](_0x5b10e9[_0x5368('0x1a')]['include'],function(_0x45884f){return{'model':db[_0x45884f[_0x5368('0x1f')]],'as':_0x45884f['as'],'attributes':_0x45884f[_0x5368('0x1b')],'include':_0x45884f[_0x5368('0x1d')]?_[_0x5368('0x1e')](_0x45884f[_0x5368('0x1d')],function(_0xabac8c){return{'model':db[_0xabac8c[_0x5368('0x1f')]],'as':_0xabac8c['as'],'attributes':_0xabac8c[_0x5368('0x1b')],'include':_0xabac8c['include']?_['map'](_0xabac8c[_0x5368('0x1d')],function(_0x229e5){return{'model':db[_0x229e5[_0x5368('0x1f')]],'as':_0x229e5['as'],'attributes':_0x229e5[_0x5368('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5368('0xd')](function(_0x4b94cd){logger[_0x5368('0xe')](_0x5368('0x17'),_0x5b10e9);logger[_0x5368('0x11')](_0x5368('0x17'),_0x5b10e9,JSON[_0x5368('0x12')](_0x4b94cd));_0x56ac4d(_0x4b94cd);})[_0x5368('0x20')](function(_0x3d40de){logger[_0x5368('0x13')](_0x5368('0x17'),_0x3d40de[_0x5368('0x15')],_0x5b10e9);_0x4baaa9(_0x3fcae0[_0x5368('0x13')](0x1f4,_0x3d40de[_0x5368('0x15')]));});});}; \ No newline at end of file +var _0xc1c4=['message','result','catch','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x104abc,_0x142a9c){_0x104abc=_0x104abc-0x0;var _0x5c35a7=_0xc1c4[_0x104abc];return _0x5c35a7;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var moment=require(_0x4c1c('0x2'));var BPromise=require(_0x4c1c('0x3'));var rs=require(_0x4c1c('0x4'));var fs=require('fs');var Redis=require(_0x4c1c('0x5'));var db=require(_0x4c1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1c('0x7'))(_0x4c1c('0x8'));var config=require(_0x4c1c('0x9'));var jayson=require(_0x4c1c('0xa'));var client=jayson['client'][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4f,_0x5863d0,_0x20e276){return new BPromise(function(_0x3337e4,_0x486065){return client[_0x4c1c('0xc')](_0x4f5a4f,_0x20e276)[_0x4c1c('0xd')](function(_0x445441){logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,'request\x20sent');logger['debug'](_0x4c1c('0x10'),_0x5863d0,_0x4c1c('0x11'),JSON[_0x4c1c('0x12')](_0x445441));if(_0x445441[_0x4c1c('0x13')]){if(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x486065(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);}logger[_0x4c1c('0x13')]('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x3337e4(_0x445441['error'][_0x4c1c('0x15')]);}else{logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,_0x4c1c('0x11'));_0x3337e4(_0x445441[_0x4c1c('0x16')][_0x4c1c('0x15')]);}})[_0x4c1c('0x17')](function(_0x33641d){logger[_0x4c1c('0x13')](_0x4c1c('0xf'),_0x5863d0,_0x33641d);_0x486065(_0x33641d);});});}exports[_0x4c1c('0x18')]=function(_0x5a9217){var _0x1fad89=this;return new Promise(function(_0x213019,_0x64fe4b){return db[_0x4c1c('0x19')][_0x4c1c('0x1a')]({'raw':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['where']||null:null,'attributes':_0x5a9217['options']?_0x5a9217[_0x4c1c('0x1b')]['attributes']||null:null,'limit':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['limit']||null:null,'include':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217['options']['include']?_[_0x4c1c('0x1d')](_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1e')],function(_0x13c2a1){return{'model':db[_0x13c2a1[_0x4c1c('0x1f')]],'as':_0x13c2a1['as'],'attributes':_0x13c2a1['attributes'],'include':_0x13c2a1[_0x4c1c('0x1e')]?_[_0x4c1c('0x1d')](_0x13c2a1[_0x4c1c('0x1e')],function(_0x1ec87a){return{'model':db[_0x1ec87a[_0x4c1c('0x1f')]],'as':_0x1ec87a['as'],'attributes':_0x1ec87a['attributes'],'include':_0x1ec87a['include']?_[_0x4c1c('0x1d')](_0x1ec87a['include'],function(_0x1104d4){return{'model':db[_0x1104d4['model']],'as':_0x1104d4['as'],'attributes':_0x1104d4[_0x4c1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4c1c('0xd')](function(_0x38f7f7){logger['info'](_0x4c1c('0x18'),_0x5a9217);logger[_0x4c1c('0x21')](_0x4c1c('0x18'),_0x5a9217,JSON[_0x4c1c('0x12')](_0x38f7f7));_0x213019(_0x38f7f7);})[_0x4c1c('0x17')](function(_0x281286){logger[_0x4c1c('0x13')](_0x4c1c('0x18'),_0x281286['message'],_0x5a9217);_0x64fe4b(_0x1fad89['error'](0x1f4,_0x281286['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index fc1650c..66a6ab6 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 _0xd306=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','update','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','exports'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xd306,0x69));var _0x6d30=function(_0x5ada29,_0x339d44){_0x5ada29=_0x5ada29-0x0;var _0xb65f3=_0xd306[_0x5ada29];return _0xb65f3;};'use strict';var multer=require(_0x6d30('0x0'));var util=require(_0x6d30('0x1'));var path=require(_0x6d30('0x2'));var timeout=require(_0x6d30('0x3'));var express=require('express');var router=express[_0x6d30('0x4')]();var fs_extra=require(_0x6d30('0x5'));var auth=require(_0x6d30('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d30('0x7'));var controller=require('./campaign.controller');router[_0x6d30('0x8')]('/',auth[_0x6d30('0x9')](),controller[_0x6d30('0xa')]);router[_0x6d30('0x8')](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0xc')]);router['get'](_0x6d30('0xd'),auth[_0x6d30('0x9')](),controller['getHoppers']);router['get'](_0x6d30('0xe'),auth[_0x6d30('0x9')](),controller[_0x6d30('0xf')]);router['get'](_0x6d30('0x10'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x11')]);router[_0x6d30('0x8')](_0x6d30('0x12'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x13')]);router[_0x6d30('0x8')](_0x6d30('0x14'),auth['isAuthenticated'](),controller[_0x6d30('0x15')]);router['get']('/:id/blacklists',auth[_0x6d30('0x9')](),controller[_0x6d30('0x16')]);router[_0x6d30('0x17')]('/',auth[_0x6d30('0x9')](),controller[_0x6d30('0x18')]);router[_0x6d30('0x17')](_0x6d30('0x19'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1a')]);router['post'](_0x6d30('0x14'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1b')]);router[_0x6d30('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1c')]);router['delete'](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1d')]);router[_0x6d30('0x1e')]('/:id/lists',auth[_0x6d30('0x9')](),controller[_0x6d30('0x1f')]);router['delete'](_0x6d30('0x20'),auth['isAuthenticated'](),controller[_0x6d30('0x21')]);module[_0x6d30('0x22')]=router; \ No newline at end of file +var _0x2303=['getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x2303,0x75));var _0x3230=function(_0x55eb05,_0x36eb0d){_0x55eb05=_0x55eb05-0x0;var _0x5cefb6=_0x2303[_0x55eb05];return _0x5cefb6;};'use strict';var multer=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3230('0x2'));var auth=require(_0x3230('0x3'));var interaction=require(_0x3230('0x4'));var config=require(_0x3230('0x5'));var controller=require(_0x3230('0x6'));router[_0x3230('0x7')]('/',auth[_0x3230('0x8')](),controller[_0x3230('0x9')]);router[_0x3230('0x7')](_0x3230('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3230('0x7')](_0x3230('0xb'),auth[_0x3230('0x8')](),controller[_0x3230('0xc')]);router[_0x3230('0x7')](_0x3230('0xd'),auth[_0x3230('0x8')](),controller[_0x3230('0xe')]);router[_0x3230('0x7')](_0x3230('0xf'),auth[_0x3230('0x8')](),controller['getHopperFinals']);router[_0x3230('0x7')](_0x3230('0x10'),auth[_0x3230('0x8')](),controller[_0x3230('0x11')]);router[_0x3230('0x7')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x13')]);router[_0x3230('0x7')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x15')]);router['post']('/',auth[_0x3230('0x8')](),controller[_0x3230('0x16')]);router[_0x3230('0x17')](_0x3230('0x18'),auth[_0x3230('0x8')](),controller[_0x3230('0x19')]);router[_0x3230('0x17')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x1a')]);router['post'](_0x3230('0x14'),auth['isAuthenticated'](),controller[_0x3230('0x1b')]);router[_0x3230('0x1c')](_0x3230('0xa'),auth[_0x3230('0x8')](),controller[_0x3230('0x1d')]);router[_0x3230('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x3230('0x1f')]);router['delete'](_0x3230('0x12'),auth['isAuthenticated'](),controller[_0x3230('0x20')]);router[_0x3230('0x1e')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x21')]);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 e04ad31..5ed33c5 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 _0x85c9=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x85c9,0x9a));var _0x985c=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0x85c9[_0x1314d4];return _0x584ba5;};'use strict';var Sequelize=require(_0x985c('0x0'));module[_0x985c('0x1')]={'key':{'type':Sequelize[_0x985c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x985c('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x985c('0x2')]},'name':{'type':Sequelize[_0x985c('0x4')],'get':function(){return this[_0x985c('0x5')](_0x985c('0x6'));}}}; \ No newline at end of file +var _0xe439=['getDataValue','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xe439,0x6d));var _0x9e43=function(_0x4e3719,_0x3a6289){_0x4e3719=_0x4e3719-0x0;var _0x4c761c=_0xe439[_0x4e3719];return _0x4c761c;};'use strict';var Sequelize=require(_0x9e43('0x0'));module[_0x9e43('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9e43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9e43('0x3')]},'name':{'type':Sequelize[_0x9e43('0x4')],'get':function(){return this[_0x9e43('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 2c1591c..08345cd 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 _0x0446=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','keys','catch','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x0446,0x15c));var _0x6044=function(_0x4fbe96,_0x82c4b0){_0x4fbe96=_0x4fbe96-0x0;var _0x3d2656=_0x0446[_0x4fbe96];return _0x3d2656;};'use strict';var emlformat=require(_0x6044('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6044('0x1'));var jsonpatch=require(_0x6044('0x2'));var rp=require(_0x6044('0x3'));var moment=require('moment');var BPromise=require(_0x6044('0x4'));var Mustache=require('mustache');var util=require(_0x6044('0x5'));var path=require(_0x6044('0x6'));var sox=require(_0x6044('0x7'));var csv=require(_0x6044('0x8'));var ejs=require(_0x6044('0x9'));var fs=require('fs');var fs_extra=require(_0x6044('0xa'));var _=require('lodash');var squel=require(_0x6044('0xb'));var crypto=require(_0x6044('0xc'));var jsforce=require(_0x6044('0xd'));var deskjs=require(_0x6044('0xe'));var toCsv=require(_0x6044('0x8'));var querystring=require(_0x6044('0xf'));var Papa=require(_0x6044('0x10'));var Redis=require(_0x6044('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6044('0x12'));var as=require(_0x6044('0x13'));var hardwareService=require(_0x6044('0x14'));var logger=require(_0x6044('0x15'))(_0x6044('0x16'));var utils=require(_0x6044('0x17'));var config=require(_0x6044('0x18'));var licenseUtil=require(_0x6044('0x19'));var db=require(_0x6044('0x1a'))['db'];function respondWithStatusCode(_0x239850,_0x7b8408){_0x7b8408=_0x7b8408||0xcc;return function(_0x2e929d){if(_0x2e929d){return _0x239850[_0x6044('0x1b')](_0x7b8408);}return _0x239850['status'](_0x7b8408)[_0x6044('0x1c')]();};}function respondWithResult(_0x1cfb7f,_0x48b916){_0x48b916=_0x48b916||0xc8;return function(_0x152ba9){if(_0x152ba9){return _0x1cfb7f[_0x6044('0x1d')](_0x48b916)['json'](_0x152ba9);}};}function respondWithFilteredResult(_0x347945,_0x52a45a){return function(_0x248dee){if(_0x248dee){var _0x1169fb=typeof _0x52a45a[_0x6044('0x1e')]==='undefined'&&typeof _0x52a45a[_0x6044('0x1f')]===_0x6044('0x20');var _0x47aa4f=_0x248dee[_0x6044('0x21')];var _0x348d0c=_0x1169fb?0x0:_0x52a45a[_0x6044('0x1e')];var _0x2bae6e=_0x1169fb?_0x248dee[_0x6044('0x21')]:_0x52a45a[_0x6044('0x1e')]+_0x52a45a[_0x6044('0x1f')];var _0x51f45e;if(_0x2bae6e>=_0x47aa4f){_0x2bae6e=_0x47aa4f;_0x51f45e=0xc8;}else{_0x51f45e=0xce;}_0x347945['status'](_0x51f45e);return _0x347945[_0x6044('0x22')](_0x6044('0x23'),_0x348d0c+'-'+_0x2bae6e+'/'+_0x47aa4f)[_0x6044('0x24')](_0x248dee);}return null;};}function patchUpdates(_0x5e5dde){return function(_0x483f7a){try{jsonpatch[_0x6044('0x25')](_0x483f7a,_0x5e5dde,!![]);}catch(_0x19d3df){return BPromise[_0x6044('0x26')](_0x19d3df);}return _0x483f7a[_0x6044('0x27')]();};}function saveUpdates(_0x42d18e,_0x428d29){return function(_0x3ba305){if(_0x3ba305){return _0x3ba305[_0x6044('0x28')](_0x42d18e)[_0x6044('0x29')](function(_0x4dcfd5){return _0x4dcfd5;});}return null;};}function removeEntity(_0x54fa96,_0x499ecf){return function(_0x299038){if(_0x299038){return _0x299038['destroy']()[_0x6044('0x29')](function(){var _0x1c0da9=_0x299038[_0x6044('0x2a')]({'plain':!![]});var _0xea7bc7='CannedAnswers';return db[_0x6044('0x2b')][_0x6044('0x2c')]({'where':{'type':_0xea7bc7,'resourceId':_0x1c0da9['id']}})[_0x6044('0x29')](function(){return _0x299038;});})[_0x6044('0x29')](function(){_0x54fa96[_0x6044('0x1d')](0xcc)[_0x6044('0x1c')]();});}};}function handleEntityNotFound(_0xab05ce,_0x3f5d1e){return function(_0x22e154){if(!_0x22e154){_0xab05ce['sendStatus'](0x194);}return _0x22e154;};}function handleError(_0x2c5224,_0x25e0dd){_0x25e0dd=_0x25e0dd||0x1f4;return function(_0x46efa9){logger[_0x6044('0x2d')](_0x46efa9['stack']);if(_0x46efa9[_0x6044('0x2e')]){delete _0x46efa9[_0x6044('0x2e')];}_0x2c5224[_0x6044('0x1d')](_0x25e0dd)['send'](_0x46efa9);};}exports['index']=function(_0x5a5c5f,_0x331dc9){var _0x4f1b0d={},_0x4d5e25={},_0x516de0={'count':0x0,'rows':[]};var _0x3afe2e=_[_0x6044('0x2f')](db['CannedAnswer'][_0x6044('0x30')],function(_0x19acf4){return{'name':_0x19acf4[_0x6044('0x31')],'type':_0x19acf4[_0x6044('0x32')][_0x6044('0x33')]};});_0x4d5e25[_0x6044('0x34')]=_[_0x6044('0x2f')](_0x3afe2e,'name');_0x4d5e25['query']=_['keys'](_0x5a5c5f[_0x6044('0x35')]);_0x4d5e25[_0x6044('0x36')]=_['intersection'](_0x4d5e25[_0x6044('0x34')],_0x4d5e25[_0x6044('0x35')]);_0x4f1b0d['attributes']=_[_0x6044('0x37')](_0x4d5e25['model'],qs[_0x6044('0x38')](_0x5a5c5f[_0x6044('0x35')][_0x6044('0x38')]));_0x4f1b0d['attributes']=_0x4f1b0d[_0x6044('0x39')][_0x6044('0x3a')]?_0x4f1b0d[_0x6044('0x39')]:_0x4d5e25['model'];if(!_0x5a5c5f[_0x6044('0x35')][_0x6044('0x3b')](_0x6044('0x3c'))){_0x4f1b0d[_0x6044('0x1f')]=qs[_0x6044('0x1f')](_0x5a5c5f['query'][_0x6044('0x1f')]);_0x4f1b0d[_0x6044('0x1e')]=qs[_0x6044('0x1e')](_0x5a5c5f['query'][_0x6044('0x1e')]);}_0x4f1b0d[_0x6044('0x3d')]=qs['sort'](_0x5a5c5f['query'][_0x6044('0x3e')]);_0x4f1b0d[_0x6044('0x3f')]=qs['filters'](_[_0x6044('0x40')](_0x5a5c5f['query'],_0x4d5e25[_0x6044('0x36')]),_0x3afe2e);if(_0x5a5c5f[_0x6044('0x35')][_0x6044('0x41')]){_0x4f1b0d['where']=_['merge'](_0x4f1b0d['where'],{'$or':[{'key':{'$like':'%'+_0x5a5c5f[_0x6044('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x5a5c5f[_0x6044('0x35')]['filter']+'%'}}]});}_0x4f1b0d=_[_0x6044('0x42')]({},_0x4f1b0d,_0x5a5c5f[_0x6044('0x43')]);var _0x19dd9a={'where':_0x4f1b0d['where']};return db[_0x6044('0x44')][_0x6044('0x21')](_0x19dd9a)[_0x6044('0x29')](function(_0x292cf3){_0x516de0[_0x6044('0x21')]=_0x292cf3;if(_0x5a5c5f[_0x6044('0x35')][_0x6044('0x45')]){_0x4f1b0d[_0x6044('0x46')]=[{'all':!![]}];}return db[_0x6044('0x44')][_0x6044('0x47')](_0x4f1b0d);})['then'](function(_0x1048d6){_0x516de0['rows']=_0x1048d6;return _0x516de0;})[_0x6044('0x29')](respondWithFilteredResult(_0x331dc9,_0x4f1b0d))['catch'](handleError(_0x331dc9,null));};exports['show']=function(_0x9e3511,_0x247f53){var _0x17926b={'raw':!![],'where':{'id':_0x9e3511['params']['id']}},_0x1458a8={};_0x1458a8[_0x6044('0x34')]=_[_0x6044('0x48')](db[_0x6044('0x44')]['rawAttributes']);_0x1458a8[_0x6044('0x35')]=_[_0x6044('0x48')](_0x9e3511[_0x6044('0x35')]);_0x1458a8[_0x6044('0x36')]=_[_0x6044('0x37')](_0x1458a8[_0x6044('0x34')],_0x1458a8[_0x6044('0x35')]);_0x17926b['attributes']=_['intersection'](_0x1458a8[_0x6044('0x34')],qs[_0x6044('0x38')](_0x9e3511[_0x6044('0x35')][_0x6044('0x38')]));_0x17926b[_0x6044('0x39')]=_0x17926b[_0x6044('0x39')]['length']?_0x17926b[_0x6044('0x39')]:_0x1458a8[_0x6044('0x34')];if(_0x9e3511[_0x6044('0x35')][_0x6044('0x45')]){_0x17926b[_0x6044('0x46')]=[{'all':!![]}];}_0x17926b=_[_0x6044('0x42')]({},_0x17926b,_0x9e3511[_0x6044('0x43')]);return db['CannedAnswer']['find'](_0x17926b)['then'](handleEntityNotFound(_0x247f53,null))[_0x6044('0x29')](respondWithResult(_0x247f53,null))[_0x6044('0x49')](handleError(_0x247f53,null));};exports[_0x6044('0x28')]=function(_0x1c65e7,_0x3ea5ae){if(_0x1c65e7[_0x6044('0x4a')]['id']){delete _0x1c65e7[_0x6044('0x4a')]['id'];}return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':{'id':_0x1c65e7[_0x6044('0x4c')]['id']}})[_0x6044('0x29')](handleEntityNotFound(_0x3ea5ae,null))[_0x6044('0x29')](saveUpdates(_0x1c65e7[_0x6044('0x4a')],null))[_0x6044('0x29')](respondWithResult(_0x3ea5ae,null))[_0x6044('0x49')](handleError(_0x3ea5ae,null));};exports[_0x6044('0x2c')]=function(_0x366e24,_0x1cbda8){return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':{'id':_0x366e24[_0x6044('0x4c')]['id']}})[_0x6044('0x29')](handleEntityNotFound(_0x1cbda8,null))[_0x6044('0x29')](removeEntity(_0x1cbda8,null))[_0x6044('0x49')](handleError(_0x1cbda8,null));};exports[_0x6044('0x4d')]=function(_0x319a4a,_0x3f4a44){var _0x457967={'key':_0x319a4a[_0x6044('0x4a')][_0x6044('0x33')]};if(_0x319a4a[_0x6044('0x4a')]['MailAccountId']){_0x457967['MailAccountId']=_0x319a4a[_0x6044('0x4a')][_0x6044('0x4e')];}else if(_0x319a4a[_0x6044('0x4a')]['SmsAccountId']){_0x457967['SmsAccountId']=_0x319a4a['body'][_0x6044('0x4f')];}else if(_0x319a4a[_0x6044('0x4a')][_0x6044('0x50')]){_0x457967[_0x6044('0x50')]=_0x319a4a['body']['OpenchannelAccountId'];}else if(_0x319a4a[_0x6044('0x4a')][_0x6044('0x51')]){_0x457967[_0x6044('0x51')]=_0x319a4a[_0x6044('0x4a')][_0x6044('0x51')];}return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':_0x457967})[_0x6044('0x29')](function(_0x2bd8da){if(_0x2bd8da){throw new db['Sequelize'][(_0x6044('0x52'))](_0x6044('0x53'));}return db[_0x6044('0x44')][_0x6044('0x4d')](_0x319a4a[_0x6044('0x4a')]);})['then'](function(_0x6a44da){var _0x30c8ef=_0x319a4a[_0x6044('0x54')][_0x6044('0x2a')]({'plain':!![]});if(!_0x30c8ef)throw new Error(_0x6044('0x55'));if(_0x30c8ef[_0x6044('0x56')]===_0x6044('0x54')){var _0x29ae5b=_0x6a44da['get']({'plain':!![]});return db[_0x6044('0x57')][_0x6044('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x30c8ef[_0x6044('0x58')]},'raw':!![]})['then'](function(_0x26edcd){if(_0x26edcd&&_0x26edcd[_0x6044('0x59')]===0x0){return db[_0x6044('0x2b')][_0x6044('0x4d')]({'name':_0x29ae5b[_0x6044('0x2e')],'resourceId':_0x29ae5b['id'],'type':_0x26edcd[_0x6044('0x2e')],'sectionId':_0x26edcd['id']},{})[_0x6044('0x29')](function(){return _0x6a44da;});}else{return _0x6a44da;}})[_0x6044('0x49')](function(_0x3ec5b4){logger[_0x6044('0x2d')](_0x6044('0x5a'),_0x3ec5b4);throw _0x3ec5b4;});}return _0x6a44da;})[_0x6044('0x29')](respondWithResult(_0x3f4a44,0xc9))[_0x6044('0x49')](handleError(_0x3f4a44,null));}; \ No newline at end of file +var _0x99b3=['count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','update','body','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x99b3,0x196));var _0x399b=function(_0x58249f,_0x4668b5){_0x58249f=_0x58249f-0x0;var _0x2d0221=_0x99b3[_0x58249f];return _0x2d0221;};'use strict';var emlformat=require(_0x399b('0x0'));var rimraf=require(_0x399b('0x1'));var zipdir=require(_0x399b('0x2'));var jsonpatch=require(_0x399b('0x3'));var rp=require(_0x399b('0x4'));var moment=require(_0x399b('0x5'));var BPromise=require(_0x399b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x399b('0x7'));var sox=require(_0x399b('0x8'));var csv=require('to-csv');var ejs=require(_0x399b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x399b('0xa'));var jsforce=require(_0x399b('0xb'));var deskjs=require(_0x399b('0xc'));var toCsv=require(_0x399b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x399b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x399b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x399b('0x10'));var logger=require(_0x399b('0x11'))(_0x399b('0x12'));var utils=require(_0x399b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x399b('0x14'));var db=require(_0x399b('0x15'))['db'];function respondWithStatusCode(_0xcfe7a2,_0x3e4f25){_0x3e4f25=_0x3e4f25||0xcc;return function(_0x3954a1){if(_0x3954a1){return _0xcfe7a2[_0x399b('0x16')](_0x3e4f25);}return _0xcfe7a2[_0x399b('0x17')](_0x3e4f25)[_0x399b('0x18')]();};}function respondWithResult(_0x59bf43,_0xc05882){_0xc05882=_0xc05882||0xc8;return function(_0x41c6e6){if(_0x41c6e6){return _0x59bf43[_0x399b('0x17')](_0xc05882)[_0x399b('0x19')](_0x41c6e6);}};}function respondWithFilteredResult(_0x2cb7ec,_0x3f088a){return function(_0x2ae1d0){if(_0x2ae1d0){var _0x138c77=typeof _0x3f088a[_0x399b('0x1a')]===_0x399b('0x1b')&&typeof _0x3f088a[_0x399b('0x1c')]===_0x399b('0x1b');var _0x4793c6=_0x2ae1d0[_0x399b('0x1d')];var _0x2db9aa=_0x138c77?0x0:_0x3f088a[_0x399b('0x1a')];var _0x1be9e4=_0x138c77?_0x2ae1d0[_0x399b('0x1d')]:_0x3f088a[_0x399b('0x1a')]+_0x3f088a[_0x399b('0x1c')];var _0xd149e5;if(_0x1be9e4>=_0x4793c6){_0x1be9e4=_0x4793c6;_0xd149e5=0xc8;}else{_0xd149e5=0xce;}_0x2cb7ec['status'](_0xd149e5);return _0x2cb7ec[_0x399b('0x1e')](_0x399b('0x1f'),_0x2db9aa+'-'+_0x1be9e4+'/'+_0x4793c6)['json'](_0x2ae1d0);}return null;};}function patchUpdates(_0x5a6aad){return function(_0x5dd868){try{jsonpatch[_0x399b('0x20')](_0x5dd868,_0x5a6aad,!![]);}catch(_0x90c0eb){return BPromise[_0x399b('0x21')](_0x90c0eb);}return _0x5dd868[_0x399b('0x22')]();};}function saveUpdates(_0x50a1b8,_0x54da07){return function(_0x4f1b30){if(_0x4f1b30){return _0x4f1b30['update'](_0x50a1b8)[_0x399b('0x23')](function(_0x407077){return _0x407077;});}return null;};}function removeEntity(_0x13c864,_0xf6c33c){return function(_0x1f5fa3){if(_0x1f5fa3){return _0x1f5fa3['destroy']()[_0x399b('0x23')](function(){var _0x4e6207=_0x1f5fa3[_0x399b('0x24')]({'plain':!![]});var _0x59b488='CannedAnswers';return db[_0x399b('0x25')]['destroy']({'where':{'type':_0x59b488,'resourceId':_0x4e6207['id']}})[_0x399b('0x23')](function(){return _0x1f5fa3;});})[_0x399b('0x23')](function(){_0x13c864[_0x399b('0x17')](0xcc)[_0x399b('0x18')]();});}};}function handleEntityNotFound(_0x4fbddf,_0x1e544c){return function(_0x327690){if(!_0x327690){_0x4fbddf[_0x399b('0x16')](0x194);}return _0x327690;};}function handleError(_0x6b9dae,_0x15c1e7){_0x15c1e7=_0x15c1e7||0x1f4;return function(_0x43e853){logger[_0x399b('0x26')](_0x43e853['stack']);if(_0x43e853[_0x399b('0x27')]){delete _0x43e853[_0x399b('0x27')];}_0x6b9dae[_0x399b('0x17')](_0x15c1e7)[_0x399b('0x28')](_0x43e853);};}exports[_0x399b('0x29')]=function(_0x106a18,_0x3db879){var _0x4a9be5={},_0x3bdfe6={},_0x2a3185={'count':0x0,'rows':[]};var _0x29224b=_['map'](db[_0x399b('0x2a')][_0x399b('0x2b')],function(_0x45718a){return{'name':_0x45718a[_0x399b('0x2c')],'type':_0x45718a[_0x399b('0x2d')]['key']};});_0x3bdfe6[_0x399b('0x2e')]=_[_0x399b('0x2f')](_0x29224b,_0x399b('0x27'));_0x3bdfe6['query']=_['keys'](_0x106a18['query']);_0x3bdfe6[_0x399b('0x30')]=_[_0x399b('0x31')](_0x3bdfe6['model'],_0x3bdfe6[_0x399b('0x32')]);_0x4a9be5[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3bdfe6[_0x399b('0x2e')],qs[_0x399b('0x34')](_0x106a18[_0x399b('0x32')][_0x399b('0x34')]));_0x4a9be5[_0x399b('0x33')]=_0x4a9be5[_0x399b('0x33')][_0x399b('0x35')]?_0x4a9be5[_0x399b('0x33')]:_0x3bdfe6[_0x399b('0x2e')];if(!_0x106a18[_0x399b('0x32')][_0x399b('0x36')](_0x399b('0x37'))){_0x4a9be5[_0x399b('0x1c')]=qs[_0x399b('0x1c')](_0x106a18[_0x399b('0x32')][_0x399b('0x1c')]);_0x4a9be5[_0x399b('0x1a')]=qs[_0x399b('0x1a')](_0x106a18[_0x399b('0x32')]['offset']);}_0x4a9be5[_0x399b('0x38')]=qs[_0x399b('0x39')](_0x106a18[_0x399b('0x32')]['sort']);_0x4a9be5[_0x399b('0x3a')]=qs[_0x399b('0x30')](_[_0x399b('0x3b')](_0x106a18[_0x399b('0x32')],_0x3bdfe6[_0x399b('0x30')]),_0x29224b);if(_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]){_0x4a9be5[_0x399b('0x3a')]=_['merge'](_0x4a9be5[_0x399b('0x3a')],{'$or':[{'key':{'$like':'%'+_0x106a18['query'][_0x399b('0x3c')]+'%'}},{'value':{'$like':'%'+_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]+'%'}}]});}_0x4a9be5=_['merge']({},_0x4a9be5,_0x106a18['options']);var _0x16aa6e={'where':_0x4a9be5[_0x399b('0x3a')]};return db[_0x399b('0x2a')][_0x399b('0x1d')](_0x16aa6e)[_0x399b('0x23')](function(_0x43b7e4){_0x2a3185[_0x399b('0x1d')]=_0x43b7e4;if(_0x106a18[_0x399b('0x32')][_0x399b('0x3d')]){_0x4a9be5[_0x399b('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x399b('0x3f')](_0x4a9be5);})[_0x399b('0x23')](function(_0x4abbed){_0x2a3185[_0x399b('0x40')]=_0x4abbed;return _0x2a3185;})[_0x399b('0x23')](respondWithFilteredResult(_0x3db879,_0x4a9be5))[_0x399b('0x41')](handleError(_0x3db879,null));};exports[_0x399b('0x42')]=function(_0x2c4cc8,_0x16bfe3){var _0x254e33={'raw':!![],'where':{'id':_0x2c4cc8[_0x399b('0x43')]['id']}},_0x3af16e={};_0x3af16e[_0x399b('0x2e')]=_['keys'](db[_0x399b('0x2a')]['rawAttributes']);_0x3af16e[_0x399b('0x32')]=_[_0x399b('0x44')](_0x2c4cc8[_0x399b('0x32')]);_0x3af16e['filters']=_[_0x399b('0x31')](_0x3af16e['model'],_0x3af16e['query']);_0x254e33[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3af16e['model'],qs[_0x399b('0x34')](_0x2c4cc8[_0x399b('0x32')][_0x399b('0x34')]));_0x254e33[_0x399b('0x33')]=_0x254e33['attributes']['length']?_0x254e33[_0x399b('0x33')]:_0x3af16e[_0x399b('0x2e')];if(_0x2c4cc8[_0x399b('0x32')][_0x399b('0x3d')]){_0x254e33[_0x399b('0x3e')]=[{'all':!![]}];}_0x254e33=_['merge']({},_0x254e33,_0x2c4cc8[_0x399b('0x45')]);return db[_0x399b('0x2a')][_0x399b('0x46')](_0x254e33)[_0x399b('0x23')](handleEntityNotFound(_0x16bfe3,null))[_0x399b('0x23')](respondWithResult(_0x16bfe3,null))[_0x399b('0x41')](handleError(_0x16bfe3,null));};exports[_0x399b('0x47')]=function(_0x102997,_0x36a8ca){if(_0x102997[_0x399b('0x48')]['id']){delete _0x102997['body']['id'];}return db['CannedAnswer'][_0x399b('0x46')]({'where':{'id':_0x102997[_0x399b('0x43')]['id']}})[_0x399b('0x23')](handleEntityNotFound(_0x36a8ca,null))[_0x399b('0x23')](saveUpdates(_0x102997['body'],null))[_0x399b('0x23')](respondWithResult(_0x36a8ca,null))[_0x399b('0x41')](handleError(_0x36a8ca,null));};exports[_0x399b('0x49')]=function(_0x2669ca,_0x53ef2f){return db['CannedAnswer']['find']({'where':{'id':_0x2669ca[_0x399b('0x43')]['id']}})['then'](handleEntityNotFound(_0x53ef2f,null))[_0x399b('0x23')](removeEntity(_0x53ef2f,null))[_0x399b('0x41')](handleError(_0x53ef2f,null));};exports[_0x399b('0x4a')]=function(_0x495787,_0x598673){var _0x1fdfb3={'key':_0x495787[_0x399b('0x48')][_0x399b('0x4b')]};if(_0x495787['body'][_0x399b('0x4c')]){_0x1fdfb3['MailAccountId']=_0x495787[_0x399b('0x48')][_0x399b('0x4c')];}else if(_0x495787['body'][_0x399b('0x4d')]){_0x1fdfb3[_0x399b('0x4d')]=_0x495787[_0x399b('0x48')]['SmsAccountId'];}else if(_0x495787[_0x399b('0x48')]['OpenchannelAccountId']){_0x1fdfb3[_0x399b('0x4e')]=_0x495787[_0x399b('0x48')][_0x399b('0x4e')];}else if(_0x495787[_0x399b('0x48')][_0x399b('0x4f')]){_0x1fdfb3['ChatWebsiteId']=_0x495787[_0x399b('0x48')][_0x399b('0x4f')];}return db[_0x399b('0x2a')][_0x399b('0x46')]({'where':_0x1fdfb3})['then'](function(_0x43940d){if(_0x43940d){throw new db[(_0x399b('0x50'))][(_0x399b('0x51'))](_0x399b('0x52'));}return db[_0x399b('0x2a')][_0x399b('0x4a')](_0x495787[_0x399b('0x48')]);})[_0x399b('0x23')](function(_0x485d3a){var _0x54de6c=_0x495787[_0x399b('0x53')][_0x399b('0x24')]({'plain':!![]});if(!_0x54de6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54de6c['role']===_0x399b('0x53')){var _0x3d2d61=_0x485d3a['get']({'plain':!![]});return db[_0x399b('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x54de6c['userProfileId']},'raw':!![]})[_0x399b('0x23')](function(_0x1126c2){if(_0x1126c2&&_0x1126c2[_0x399b('0x55')]===0x0){return db[_0x399b('0x25')][_0x399b('0x4a')]({'name':_0x3d2d61[_0x399b('0x27')],'resourceId':_0x3d2d61['id'],'type':_0x1126c2['name'],'sectionId':_0x1126c2['id']},{})['then'](function(){return _0x485d3a;});}else{return _0x485d3a;}})[_0x399b('0x41')](function(_0x40a47f){logger[_0x399b('0x26')](_0x399b('0x56'),_0x40a47f);throw _0x40a47f;});}return _0x485d3a;})[_0x399b('0x23')](respondWithResult(_0x598673,0xc9))[_0x399b('0x41')](handleError(_0x598673,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 659e14a..b21aede 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 _0x1f7d=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','CannedAnswer','utf8mb4_unicode_ci'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1f7d,0xa2));var _0xd1f7=function(_0x25fc3b,_0x5b9391){_0x25fc3b=_0x25fc3b-0x0;var _0x207a55=_0x1f7d[_0x25fc3b];return _0x207a55;};'use strict';var _=require('lodash');var util=require(_0xd1f7('0x0'));var logger=require(_0xd1f7('0x1'))('api');var moment=require(_0xd1f7('0x2'));var BPromise=require(_0xd1f7('0x3'));var rp=require(_0xd1f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1f7('0x5'));var config=require('../../config/environment');var attributes=require(_0xd1f7('0x6'));module['exports']=function(_0x598e14,_0x349ca7){return _0x598e14['define'](_0xd1f7('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd1f7('0x8')});}; \ No newline at end of file +var _0x0188=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x0188,0x1a7));var _0x8018=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x0188[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0x8018('0x0'));var util=require('util');var logger=require(_0x8018('0x1'))('api');var moment=require(_0x8018('0x2'));var BPromise=require(_0x8018('0x3'));var rp=require(_0x8018('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8018('0x5'));var config=require(_0x8018('0x6'));var attributes=require(_0x8018('0x7'));module[_0x8018('0x8')]=function(_0x1b9f44,_0x16330a){return _0x1b9f44['define']('CannedAnswer',attributes,{'tableName':_0x8018('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8018('0xa'),'collate':_0x8018('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a193bb0..5a388e9 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(_0xaa7629,_0x2837d8){var _0x3d5570=function(_0x4b31b9){while(--_0x4b31b9){_0xaa7629['push'](_0xaa7629['shift']());}};_0x3d5570(++_0x2837d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x531253,_0x8acb9b){var _0x307a0e=function(_0x5cfb48){while(--_0x5cfb48){_0x531253['push'](_0x531253['shift']());}};_0x307a0e(++_0x8acb9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 b29fbbf..3b55b45 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 _0xdc0a=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc0a,0x1b9));var _0xadc0=function(_0x12e8d5,_0x5cc297){_0x12e8d5=_0x12e8d5-0x0;var _0x1dc087=_0xdc0a[_0x12e8d5];return _0x1dc087;};'use strict';var multer=require(_0xadc0('0x0'));var util=require(_0xadc0('0x1'));var path=require(_0xadc0('0x2'));var timeout=require(_0xadc0('0x3'));var express=require(_0xadc0('0x4'));var router=express[_0xadc0('0x5')]();var fs_extra=require(_0xadc0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xadc0('0x7'));var config=require(_0xadc0('0x8'));var controller=require(_0xadc0('0x9'));router[_0xadc0('0xa')]('/',auth[_0xadc0('0xb')](),controller[_0xadc0('0xc')]);router[_0xadc0('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xadc0('0xd')]('/',auth[_0xadc0('0xb')](),controller[_0xadc0('0xe')]);router[_0xadc0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xadc0('0x10')]);router[_0xadc0('0x11')]('/:id',auth[_0xadc0('0xb')](),controller[_0xadc0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x487e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x401392,_0x4572ad){var _0x102daf=function(_0x47a9c2){while(--_0x47a9c2){_0x401392['push'](_0x401392['shift']());}};_0x102daf(++_0x4572ad);}(_0x487e,0x12b));var _0xe487=function(_0xdd1d99,_0x561184){_0xdd1d99=_0xdd1d99-0x0;var _0x2e2a24=_0x487e[_0xdd1d99];return _0x2e2a24;};'use strict';var multer=require(_0xe487('0x0'));var util=require(_0xe487('0x1'));var path=require(_0xe487('0x2'));var timeout=require(_0xe487('0x3'));var express=require('express');var router=express[_0xe487('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe487('0x5'));var interaction=require(_0xe487('0x6'));var config=require(_0xe487('0x7'));var controller=require(_0xe487('0x8'));router[_0xe487('0x9')]('/',auth[_0xe487('0xa')](),controller['index']);router['get'](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0xc')]);router[_0xe487('0xd')]('/',auth['isAuthenticated'](),controller[_0xe487('0xe')]);router[_0xe487('0xf')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller['update']);router[_0xe487('0x10')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0x11')]);module[_0xe487('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 2522d78..b9a91ae 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 _0x9e3f=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3f5496,_0x281f70){var _0x2a766c=function(_0x4701ca){while(--_0x4701ca){_0x3f5496['push'](_0x3f5496['shift']());}};_0x2a766c(++_0x281f70);}(_0x9e3f,0x1f0));var _0xf9e3=function(_0x4f7567,_0x14e2cc){_0x4f7567=_0x4f7567-0x0;var _0x3ebbd8=_0x9e3f[_0x4f7567];return _0x3ebbd8;};'use strict';var Sequelize=require(_0xf9e3('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf9e3('0x1')],'allowNull':![],'defaultValue':_0xf9e3('0x2')},'clid':{'type':Sequelize[_0xf9e3('0x3')]},'src':{'type':Sequelize[_0xf9e3('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf9e3('0x3')]},'channel':{'type':Sequelize[_0xf9e3('0x3')]},'dstchannel':{'type':Sequelize[_0xf9e3('0x3')]},'lastapp':{'type':Sequelize[_0xf9e3('0x3')]},'lastdata':{'type':Sequelize[_0xf9e3('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf9e3('0x3')]},'amaflags':{'type':Sequelize[_0xf9e3('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf9e3('0x3')]},'userfield':{'type':Sequelize[_0xf9e3('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf9e3('0x3')]},'sequence':{'type':Sequelize[_0xf9e3('0x3')]},'peeraccount':{'type':Sequelize[_0xf9e3('0x3')]},'type':{'type':Sequelize[_0xf9e3('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x73b3=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1cc5c0,_0x5ef4db){var _0x34e133=function(_0x43f717){while(--_0x43f717){_0x1cc5c0['push'](_0x1cc5c0['shift']());}};_0x34e133(++_0x5ef4db);}(_0x73b3,0x183));var _0x373b=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x73b3[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x373b('0x0'));module[_0x373b('0x1')]={'calldate':{'type':Sequelize[_0x373b('0x2')],'allowNull':![],'defaultValue':_0x373b('0x3')},'clid':{'type':Sequelize[_0x373b('0x4')]},'src':{'type':Sequelize[_0x373b('0x4')]},'dst':{'type':Sequelize[_0x373b('0x4')]},'dcontext':{'type':Sequelize[_0x373b('0x4')]},'channel':{'type':Sequelize[_0x373b('0x4')]},'dstchannel':{'type':Sequelize[_0x373b('0x4')]},'lastapp':{'type':Sequelize[_0x373b('0x4')]},'lastdata':{'type':Sequelize[_0x373b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x373b('0x4')]},'amaflags':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x373b('0x4')]},'userfield':{'type':Sequelize[_0x373b('0x4')]},'uniqueid':{'type':Sequelize[_0x373b('0x4')]},'linkedid':{'type':Sequelize[_0x373b('0x4')]},'sequence':{'type':Sequelize[_0x373b('0x4')]},'peeraccount':{'type':Sequelize[_0x373b('0x4')]},'type':{'type':Sequelize[_0x373b('0x4')]},'tag':{'type':Sequelize[_0x373b('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0277962..d3242aa 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 _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0xc6f48,_0x49cfdf){var _0x3cdf62=function(_0x23c600){while(--_0x23c600){_0xc6f48['push'](_0xc6f48['shift']());}};_0x3cdf62(++_0x49cfdf);}(_0xee14,0x13a));var _0x4ee1=function(_0x2a7df1,_0x2ab434){_0x2a7df1=_0x2a7df1-0x0;var _0x242a10=_0xee14[_0x2a7df1];return _0x242a10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['Cdr'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['Cdr'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['Cdr'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));}; \ No newline at end of file +var _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x94030f,_0x476ed2){var _0x9f7747=function(_0x2b977a){while(--_0x2b977a){_0x94030f['push'](_0x94030f['shift']());}};_0x9f7747(++_0x476ed2);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4c7410,_0x43bf77){_0x4c7410=_0x4c7410-0x0;var _0x2cf87d=_0xcd59[_0x4c7410];return _0x2cf87d;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d08b475..79bf2b8 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x57cae7,_0x1620ef){var _0x3c4e36=function(_0x2fb069){while(--_0x2fb069){_0x57cae7['push'](_0x57cae7['shift']());}};_0x3c4e36(++_0x1620ef);}(_0x7a54,0x106));var _0x47a5=function(_0x467ebd,_0xf8bdf6){_0x467ebd=_0x467ebd-0x0;var _0x3c6283=_0x7a54[_0x467ebd];return _0x3c6283;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x38d058,_0x55141f){var _0xff6cef=function(_0x38a921){while(--_0x38a921){_0x38d058['push'](_0x38d058['shift']());}};_0xff6cef(++_0x55141f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b6566,_0x48a13e){_0x3b6566=_0x3b6566-0x0;var _0xae5904=_0x7a54[_0x3b6566];return _0xae5904;};'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 9dee872..b492438 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 _0x5e90=['http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x54e26b,_0x18219e){var _0x2a82f5=function(_0x3023ac){while(--_0x3023ac){_0x54e26b['push'](_0x54e26b['shift']());}};_0x2a82f5(++_0x18219e);}(_0x5e90,0x102));var _0x05e9=function(_0x26a845,_0x11eb5e){_0x26a845=_0x26a845-0x0;var _0x75e210=_0x5e90[_0x26a845];return _0x75e210;};'use strict';var _=require('lodash');var util=require(_0x05e9('0x0'));var moment=require('moment');var BPromise=require(_0x05e9('0x1'));var rs=require(_0x05e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x05e9('0x3'));var logger=require(_0x05e9('0x4'))(_0x05e9('0x5'));var config=require('../../config/environment');var jayson=require(_0x05e9('0x6'));var client=jayson[_0x05e9('0x7')][_0x05e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa46b9a,_0x51ca5e,_0x5b4ae0){return new BPromise(function(_0x55cdb9,_0x3848a9){return client[_0x05e9('0x9')](_0xa46b9a,_0x5b4ae0)[_0x05e9('0xa')](function(_0x421367){logger[_0x05e9('0xb')]('Cdr,\x20%s,\x20%s',_0x51ca5e,_0x05e9('0xc'));logger['debug'](_0x05e9('0xd'),_0x51ca5e,_0x05e9('0xc'),JSON['stringify'](_0x421367));if(_0x421367[_0x05e9('0xe')]){if(_0x421367['error'][_0x05e9('0xf')]===0x1f4){logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x421367[_0x05e9('0xe')][_0x05e9('0x11')]);return _0x3848a9(_0x421367['error']['message']);}logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x421367['error'][_0x05e9('0x11')]);return _0x55cdb9(_0x421367[_0x05e9('0xe')][_0x05e9('0x11')]);}else{logger[_0x05e9('0xb')](_0x05e9('0x10'),_0x51ca5e,'request\x20sent');_0x55cdb9(_0x421367[_0x05e9('0x12')][_0x05e9('0x11')]);}})['catch'](function(_0x19de6d){logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x19de6d);_0x3848a9(_0x19de6d);});});} \ No newline at end of file +var _0x8b56=['info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x1c3985,_0x4dbdaa){var _0x5ae93d=function(_0x1ea7c4){while(--_0x1ea7c4){_0x1c3985['push'](_0x1c3985['shift']());}};_0x5ae93d(++_0x4dbdaa);}(_0x8b56,0x13a));var _0x68b5=function(_0x3853e5,_0x9e88e4){_0x3853e5=_0x3853e5-0x0;var _0x9ad4d0=_0x8b56[_0x3853e5];return _0x9ad4d0;};'use strict';var _=require(_0x68b5('0x0'));var util=require(_0x68b5('0x1'));var moment=require(_0x68b5('0x2'));var BPromise=require(_0x68b5('0x3'));var rs=require(_0x68b5('0x4'));var fs=require('fs');var Redis=require(_0x68b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x68b5('0x6'))(_0x68b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68b5('0x8'));var client=jayson[_0x68b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f6f0d,_0x3aed63,_0x5428ca){return new BPromise(function(_0x44f53f,_0x539089){return client['request'](_0x4f6f0d,_0x5428ca)['then'](function(_0x5c6fcd){logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));logger['debug'](_0x68b5('0xd'),_0x3aed63,'request\x20sent',JSON['stringify'](_0x5c6fcd));if(_0x5c6fcd['error']){if(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0xf')]===0x1f4){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x5c6fcd[_0x68b5('0xe')]['message']);return _0x539089(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0x10')]);}logger[_0x68b5('0xe')]('Cdr,\x20%s,\x20%s',_0x3aed63,_0x5c6fcd['error'][_0x68b5('0x10')]);return _0x44f53f(_0x5c6fcd['error']['message']);}else{logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));_0x44f53f(_0x5c6fcd[_0x68b5('0x11')][_0x68b5('0x10')]);}})['catch'](function(_0x169aa5){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x169aa5);_0x539089(_0x169aa5);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1c931da..8b24132 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(_0x297d6f,_0x12c8be){var _0x4e0852=function(_0x37780e){while(--_0x37780e){_0x297d6f['push'](_0x297d6f['shift']());}};_0x4e0852(++_0x12c8be);}(_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(_0x275744,_0x338b4a){var _0x4a2944=function(_0x2950e7){while(--_0x2950e7){_0x275744['push'](_0x275744['shift']());}};_0x4a2944(++_0x338b4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x577f3d,_0x43ab79){_0x577f3d=_0x577f3d-0x0;var _0x3b11f6=_0xb10b[_0x577f3d];return _0x3b11f6;};'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 8ffea84..f9ff325 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 _0x45a8=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x2c893b,_0x8a3f46){var _0x1a023d=function(_0x3593dc){while(--_0x3593dc){_0x2c893b['push'](_0x2c893b['shift']());}};_0x1a023d(++_0x8a3f46);}(_0x45a8,0x1b2));var _0x845a=function(_0x4d12c0,_0x19f3af){_0x4d12c0=_0x4d12c0-0x0;var _0x216508=_0x45a8[_0x4d12c0];return _0x216508;};'use strict';var Sequelize=require(_0x845a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x845a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x845a('0x2')],'allowNull':![],'defaultValue':_0x845a('0x3')},'appdata':{'type':Sequelize[_0x845a('0x4')]()},'description':{'type':Sequelize[_0x845a('0x2')]},'interval':{'type':Sequelize[_0x845a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb6b2=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6b2,0x70));var _0x2b6b=function(_0x283bbe,_0x46749e){_0x283bbe=_0x283bbe-0x0;var _0x541b44=_0xb6b2[_0x283bbe];return _0x541b44;};'use strict';var Sequelize=require(_0x2b6b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2b6b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2b6b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2b6b('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2b6b('0x2')],'defaultValue':_0x2b6b('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 88bb9ff..8b99ba5 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 _0x4e83=['send','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name'];(function(_0x3636b4,_0x4cd071){var _0x5a5854=function(_0x23c674){while(--_0x23c674){_0x3636b4['push'](_0x3636b4['shift']());}};_0x5a5854(++_0x4cd071);}(_0x4e83,0x88));var _0x34e8=function(_0xdb0d3,_0xa7146b){_0xdb0d3=_0xdb0d3-0x0;var _0x333824=_0x4e83[_0xdb0d3];return _0x333824;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34e8('0x0'));var zipdir=require(_0x34e8('0x1'));var jsonpatch=require(_0x34e8('0x2'));var rp=require(_0x34e8('0x3'));var moment=require('moment');var BPromise=require(_0x34e8('0x4'));var Mustache=require(_0x34e8('0x5'));var util=require(_0x34e8('0x6'));var path=require(_0x34e8('0x7'));var sox=require(_0x34e8('0x8'));var csv=require(_0x34e8('0x9'));var ejs=require(_0x34e8('0xa'));var fs=require('fs');var fs_extra=require(_0x34e8('0xb'));var _=require(_0x34e8('0xc'));var squel=require(_0x34e8('0xd'));var crypto=require(_0x34e8('0xe'));var jsforce=require(_0x34e8('0xf'));var deskjs=require(_0x34e8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x34e8('0x11'));var Papa=require(_0x34e8('0x12'));var Redis=require(_0x34e8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x34e8('0x14'));var as=require(_0x34e8('0x15'));var hardwareService=require(_0x34e8('0x16'));var logger=require(_0x34e8('0x17'))(_0x34e8('0x18'));var utils=require('../../config/utils');var config=require(_0x34e8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x34e8('0x1a'))['db'];function respondWithStatusCode(_0x2d84a1,_0x1e198b){_0x1e198b=_0x1e198b||0xcc;return function(_0x17df4c){if(_0x17df4c){return _0x2d84a1[_0x34e8('0x1b')](_0x1e198b);}return _0x2d84a1[_0x34e8('0x1c')](_0x1e198b)['end']();};}function respondWithResult(_0x456277,_0x4bfbef){_0x4bfbef=_0x4bfbef||0xc8;return function(_0x41a776){if(_0x41a776){return _0x456277['status'](_0x4bfbef)[_0x34e8('0x1d')](_0x41a776);}};}function respondWithFilteredResult(_0x217e81,_0x3b1cec){return function(_0x4c0465){if(_0x4c0465){var _0x1dd69f=typeof _0x3b1cec['offset']===_0x34e8('0x1e')&&typeof _0x3b1cec[_0x34e8('0x1f')]===_0x34e8('0x1e');var _0x4a1af0=_0x4c0465[_0x34e8('0x20')];var _0x1a2fa7=_0x1dd69f?0x0:_0x3b1cec[_0x34e8('0x21')];var _0x38edda=_0x1dd69f?_0x4c0465[_0x34e8('0x20')]:_0x3b1cec[_0x34e8('0x21')]+_0x3b1cec[_0x34e8('0x1f')];var _0x3bbb4f;if(_0x38edda>=_0x4a1af0){_0x38edda=_0x4a1af0;_0x3bbb4f=0xc8;}else{_0x3bbb4f=0xce;}_0x217e81[_0x34e8('0x1c')](_0x3bbb4f);return _0x217e81[_0x34e8('0x22')]('Content-Range',_0x1a2fa7+'-'+_0x38edda+'/'+_0x4a1af0)[_0x34e8('0x1d')](_0x4c0465);}return null;};}function patchUpdates(_0x7462d9){return function(_0xbcfcd4){try{jsonpatch[_0x34e8('0x23')](_0xbcfcd4,_0x7462d9,!![]);}catch(_0x303f4b){return BPromise[_0x34e8('0x24')](_0x303f4b);}return _0xbcfcd4[_0x34e8('0x25')]();};}function saveUpdates(_0x9666fa,_0x39947b){return function(_0x15bbff){if(_0x15bbff){return _0x15bbff[_0x34e8('0x26')](_0x9666fa)[_0x34e8('0x27')](function(_0x28075c){return _0x28075c;});}return null;};}function removeEntity(_0x2e3038,_0x2e04f8){return function(_0x250321){if(_0x250321){return _0x250321[_0x34e8('0x28')]()[_0x34e8('0x27')](function(){_0x2e3038[_0x34e8('0x1c')](0xcc)[_0x34e8('0x29')]();});}};}function handleEntityNotFound(_0x4d8780,_0x4cf03e){return function(_0x4a2caa){if(!_0x4a2caa){_0x4d8780[_0x34e8('0x1b')](0x194);}return _0x4a2caa;};}function handleError(_0x5e4809,_0x35f3c6){_0x35f3c6=_0x35f3c6||0x1f4;return function(_0x2b1179){logger['error'](_0x2b1179[_0x34e8('0x2a')]);if(_0x2b1179['name']){delete _0x2b1179[_0x34e8('0x2b')];}_0x5e4809['status'](_0x35f3c6)[_0x34e8('0x2c')](_0x2b1179);};}exports['show']=function(_0x3d6123,_0x4087dc){var _0x3e842b={'raw':!![],'where':{'id':_0x3d6123['params']['id']}},_0x1bb4f3={};_0x1bb4f3[_0x34e8('0x2d')]=_[_0x34e8('0x2e')](db[_0x34e8('0x2f')]['rawAttributes']);_0x1bb4f3[_0x34e8('0x30')]=_['keys'](_0x3d6123[_0x34e8('0x30')]);_0x1bb4f3['filters']=_[_0x34e8('0x31')](_0x1bb4f3[_0x34e8('0x2d')],_0x1bb4f3[_0x34e8('0x30')]);_0x3e842b[_0x34e8('0x32')]=_[_0x34e8('0x31')](_0x1bb4f3[_0x34e8('0x2d')],qs[_0x34e8('0x33')](_0x3d6123['query'][_0x34e8('0x33')]));_0x3e842b['attributes']=_0x3e842b[_0x34e8('0x32')][_0x34e8('0x34')]?_0x3e842b[_0x34e8('0x32')]:_0x1bb4f3[_0x34e8('0x2d')];if(_0x3d6123[_0x34e8('0x30')][_0x34e8('0x35')]){_0x3e842b[_0x34e8('0x36')]=[{'all':!![]}];}_0x3e842b=_['merge']({},_0x3e842b,_0x3d6123[_0x34e8('0x37')]);return db[_0x34e8('0x2f')][_0x34e8('0x38')](_0x3e842b)[_0x34e8('0x27')](handleEntityNotFound(_0x4087dc,null))[_0x34e8('0x27')](respondWithResult(_0x4087dc,null))[_0x34e8('0x39')](handleError(_0x4087dc,null));};exports[_0x34e8('0x26')]=function(_0x13767c,_0x458587){if(_0x13767c[_0x34e8('0x3a')]['id']){delete _0x13767c[_0x34e8('0x3a')]['id'];}return db[_0x34e8('0x2f')][_0x34e8('0x38')]({'where':{'id':_0x13767c['params']['id']}})[_0x34e8('0x27')](handleEntityNotFound(_0x458587,null))['then'](saveUpdates(_0x13767c[_0x34e8('0x3a')],null))[_0x34e8('0x27')](respondWithResult(_0x458587,null))[_0x34e8('0x39')](handleError(_0x458587,null));};exports[_0x34e8('0x28')]=function(_0x2afc29,_0x4df663){return db[_0x34e8('0x2f')][_0x34e8('0x38')]({'where':{'id':_0x2afc29[_0x34e8('0x3b')]['id']}})[_0x34e8('0x27')](handleEntityNotFound(_0x4df663,null))[_0x34e8('0x27')](removeEntity(_0x4df663,null))[_0x34e8('0x39')](handleError(_0x4df663,null));}; \ No newline at end of file +var _0x122a=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','show','params','ChatApplication','rawAttributes','query','keys','intersection','model','attributes','fields','includeAll','include','merge','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x122a,0xba));var _0xa122=function(_0x98220c,_0x1c14f1){_0x98220c=_0x98220c-0x0;var _0x4607fc=_0x122a[_0x98220c];return _0x4607fc;};'use strict';var emlformat=require(_0xa122('0x0'));var rimraf=require(_0xa122('0x1'));var zipdir=require(_0xa122('0x2'));var jsonpatch=require(_0xa122('0x3'));var rp=require(_0xa122('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa122('0x5'));var util=require('util');var path=require(_0xa122('0x6'));var sox=require(_0xa122('0x7'));var csv=require(_0xa122('0x8'));var ejs=require(_0xa122('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa122('0xa'));var jsforce=require(_0xa122('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa122('0x8'));var querystring=require(_0xa122('0xc'));var Papa=require(_0xa122('0xd'));var Redis=require(_0xa122('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa122('0xf'));var logger=require('../../config/logger')(_0xa122('0x10'));var utils=require(_0xa122('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa122('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55772a,_0x18fd6b){_0x18fd6b=_0x18fd6b||0xcc;return function(_0x3d0912){if(_0x3d0912){return _0x55772a['sendStatus'](_0x18fd6b);}return _0x55772a[_0xa122('0x13')](_0x18fd6b)[_0xa122('0x14')]();};}function respondWithResult(_0x9feb88,_0x524ae3){_0x524ae3=_0x524ae3||0xc8;return function(_0xdc178a){if(_0xdc178a){return _0x9feb88[_0xa122('0x13')](_0x524ae3)[_0xa122('0x15')](_0xdc178a);}};}function respondWithFilteredResult(_0x3e688c,_0x3896e3){return function(_0x317817){if(_0x317817){var _0x5ec92a=typeof _0x3896e3[_0xa122('0x16')]===_0xa122('0x17')&&typeof _0x3896e3[_0xa122('0x18')]===_0xa122('0x17');var _0x15c076=_0x317817[_0xa122('0x19')];var _0x1d6c40=_0x5ec92a?0x0:_0x3896e3[_0xa122('0x16')];var _0x2f0e75=_0x5ec92a?_0x317817['count']:_0x3896e3[_0xa122('0x16')]+_0x3896e3[_0xa122('0x18')];var _0x832163;if(_0x2f0e75>=_0x15c076){_0x2f0e75=_0x15c076;_0x832163=0xc8;}else{_0x832163=0xce;}_0x3e688c[_0xa122('0x13')](_0x832163);return _0x3e688c[_0xa122('0x1a')](_0xa122('0x1b'),_0x1d6c40+'-'+_0x2f0e75+'/'+_0x15c076)[_0xa122('0x15')](_0x317817);}return null;};}function patchUpdates(_0x26ac5c){return function(_0x319836){try{jsonpatch['apply'](_0x319836,_0x26ac5c,!![]);}catch(_0x960493){return BPromise[_0xa122('0x1c')](_0x960493);}return _0x319836[_0xa122('0x1d')]();};}function saveUpdates(_0x34a78c,_0x303914){return function(_0x2a41df){if(_0x2a41df){return _0x2a41df['update'](_0x34a78c)[_0xa122('0x1e')](function(_0xb00bcf){return _0xb00bcf;});}return null;};}function removeEntity(_0x443268,_0x1e53e1){return function(_0x15742e){if(_0x15742e){return _0x15742e[_0xa122('0x1f')]()[_0xa122('0x1e')](function(){_0x443268[_0xa122('0x13')](0xcc)[_0xa122('0x14')]();});}};}function handleEntityNotFound(_0x5a295e,_0x2dbe03){return function(_0x163531){if(!_0x163531){_0x5a295e['sendStatus'](0x194);}return _0x163531;};}function handleError(_0x44feff,_0x5866f4){_0x5866f4=_0x5866f4||0x1f4;return function(_0x5f2185){logger[_0xa122('0x20')](_0x5f2185['stack']);if(_0x5f2185[_0xa122('0x21')]){delete _0x5f2185[_0xa122('0x21')];}_0x44feff[_0xa122('0x13')](_0x5866f4)[_0xa122('0x22')](_0x5f2185);};}exports[_0xa122('0x23')]=function(_0x31be08,_0x57bfa4){var _0xe37991={'raw':!![],'where':{'id':_0x31be08[_0xa122('0x24')]['id']}},_0x3c8455={};_0x3c8455['model']=_['keys'](db[_0xa122('0x25')][_0xa122('0x26')]);_0x3c8455[_0xa122('0x27')]=_[_0xa122('0x28')](_0x31be08['query']);_0x3c8455['filters']=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],_0x3c8455['query']);_0xe37991[_0xa122('0x2b')]=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],qs[_0xa122('0x2c')](_0x31be08[_0xa122('0x27')][_0xa122('0x2c')]));_0xe37991['attributes']=_0xe37991[_0xa122('0x2b')]['length']?_0xe37991[_0xa122('0x2b')]:_0x3c8455['model'];if(_0x31be08[_0xa122('0x27')][_0xa122('0x2d')]){_0xe37991[_0xa122('0x2e')]=[{'all':!![]}];}_0xe37991=_[_0xa122('0x2f')]({},_0xe37991,_0x31be08['options']);return db[_0xa122('0x25')]['find'](_0xe37991)[_0xa122('0x1e')](handleEntityNotFound(_0x57bfa4,null))[_0xa122('0x1e')](respondWithResult(_0x57bfa4,null))[_0xa122('0x30')](handleError(_0x57bfa4,null));};exports['update']=function(_0x5a0789,_0x2ab6aa){if(_0x5a0789[_0xa122('0x31')]['id']){delete _0x5a0789[_0xa122('0x31')]['id'];}return db[_0xa122('0x25')][_0xa122('0x32')]({'where':{'id':_0x5a0789[_0xa122('0x24')]['id']}})['then'](handleEntityNotFound(_0x2ab6aa,null))[_0xa122('0x1e')](saveUpdates(_0x5a0789[_0xa122('0x31')],null))['then'](respondWithResult(_0x2ab6aa,null))[_0xa122('0x30')](handleError(_0x2ab6aa,null));};exports[_0xa122('0x1f')]=function(_0x1b96d6,_0x3f7898){return db[_0xa122('0x25')]['find']({'where':{'id':_0x1b96d6[_0xa122('0x24')]['id']}})[_0xa122('0x1e')](handleEntityNotFound(_0x3f7898,null))['then'](removeEntity(_0x3f7898,null))[_0xa122('0x30')](handleError(_0x3f7898,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b0ef242..5a3d13a 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 _0xff14=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x555677,_0x552363){var _0x315a4b=function(_0x4b70d6){while(--_0x4b70d6){_0x555677['push'](_0x555677['shift']());}};_0x315a4b(++_0x552363);}(_0xff14,0x1ca));var _0x4ff1=function(_0x30a006,_0x143f3a){_0x30a006=_0x30a006-0x0;var _0x393403=_0xff14[_0x30a006];return _0x393403;};'use strict';var _=require(_0x4ff1('0x0'));var util=require(_0x4ff1('0x1'));var logger=require('../../config/logger')(_0x4ff1('0x2'));var moment=require(_0x4ff1('0x3'));var BPromise=require(_0x4ff1('0x4'));var rp=require(_0x4ff1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ff1('0x6'));var config=require(_0x4ff1('0x7'));var attributes=require(_0x4ff1('0x8'));module[_0x4ff1('0x9')]=function(_0x483725,_0x12aadb){return _0x483725[_0x4ff1('0xa')](_0x4ff1('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ff1('0xc'),'collate':_0x4ff1('0xd')});}; \ No newline at end of file +var _0x2dab=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3416e2,_0x5c9c1b){var _0x52f5fe=function(_0x428adc){while(--_0x428adc){_0x3416e2['push'](_0x3416e2['shift']());}};_0x52f5fe(++_0x5c9c1b);}(_0x2dab,0x120));var _0xb2da=function(_0x601a1b,_0xad65ad){_0x601a1b=_0x601a1b-0x0;var _0x176b0f=_0x2dab[_0x601a1b];return _0x176b0f;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var logger=require(_0xb2da('0x2'))(_0xb2da('0x3'));var moment=require(_0xb2da('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2da('0x6'));var config=require(_0xb2da('0x7'));var attributes=require(_0xb2da('0x8'));module[_0xb2da('0x9')]=function(_0x309b46,_0x3b0e4e){return _0x309b46[_0xb2da('0xa')]('ChatApplication',attributes,{'tableName':_0xb2da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2da('0xc'),'collate':_0xb2da('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f6027fa..9575ed3 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 _0x7483=['error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52e75b,_0x28e1ee){var _0x215456=function(_0x3320a6){while(--_0x3320a6){_0x52e75b['push'](_0x52e75b['shift']());}};_0x215456(++_0x28e1ee);}(_0x7483,0x17f));var _0x3748=function(_0x4cc646,_0x3e83b1){_0x4cc646=_0x4cc646-0x0;var _0x585452=_0x7483[_0x4cc646];return _0x585452;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3748('0x0'));var BPromise=require(_0x3748('0x1'));var rs=require(_0x3748('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3748('0x3'));var logger=require(_0x3748('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3748('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f321,_0x356c88,_0x1fec38){return new BPromise(function(_0xf532fa,_0x1ed93f){return client[_0x3748('0x6')](_0x34f321,_0x1fec38)['then'](function(_0x44d5b6){logger[_0x3748('0x7')](_0x3748('0x8'),_0x356c88,_0x3748('0x9'));logger[_0x3748('0xa')](_0x3748('0xb'),_0x356c88,_0x3748('0x9'),JSON[_0x3748('0xc')](_0x44d5b6));if(_0x44d5b6[_0x3748('0xd')]){if(_0x44d5b6[_0x3748('0xd')][_0x3748('0xe')]===0x1f4){logger[_0x3748('0xd')](_0x3748('0x8'),_0x356c88,_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);return _0x1ed93f(_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);}logger[_0x3748('0xd')]('ChatApplication,\x20%s,\x20%s',_0x356c88,_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);return _0xf532fa(_0x44d5b6[_0x3748('0xd')]['message']);}else{logger[_0x3748('0x7')](_0x3748('0x8'),_0x356c88,'request\x20sent');_0xf532fa(_0x44d5b6[_0x3748('0x10')]['message']);}})[_0x3748('0x11')](function(_0x24f7b0){logger[_0x3748('0xd')](_0x3748('0x8'),_0x356c88,_0x24f7b0);_0x1ed93f(_0x24f7b0);});});} \ No newline at end of file +var _0x8fe1=['client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a0b8e,_0x31087b){var _0x21eeba=function(_0x32feca){while(--_0x32feca){_0x4a0b8e['push'](_0x4a0b8e['shift']());}};_0x21eeba(++_0x31087b);}(_0x8fe1,0x1be));var _0x18fe=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x8fe1[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x18fe('0x0'));var moment=require(_0x18fe('0x1'));var BPromise=require(_0x18fe('0x2'));var rs=require(_0x18fe('0x3'));var fs=require('fs');var Redis=require(_0x18fe('0x4'));var db=require(_0x18fe('0x5'))['db'];var utils=require(_0x18fe('0x6'));var logger=require(_0x18fe('0x7'))(_0x18fe('0x8'));var config=require(_0x18fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x18fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362ad3,_0x2ba644,_0x221435){return new BPromise(function(_0x136308,_0x10f68f){return client[_0x18fe('0xb')](_0x362ad3,_0x221435)[_0x18fe('0xc')](function(_0x368cc7){logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));logger[_0x18fe('0x10')](_0x18fe('0x11'),_0x2ba644,_0x18fe('0xf'),JSON[_0x18fe('0x12')](_0x368cc7));if(_0x368cc7[_0x18fe('0x13')]){if(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x14')]===0x1f4){logger['error'](_0x18fe('0xe'),_0x2ba644,_0x368cc7['error'][_0x18fe('0x15')]);return _0x10f68f(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x15')]);}logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x368cc7[_0x18fe('0x13')]['message']);return _0x136308(_0x368cc7['error'][_0x18fe('0x15')]);}else{logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));_0x136308(_0x368cc7[_0x18fe('0x16')][_0x18fe('0x15')]);}})[_0x18fe('0x17')](function(_0x590ff1){logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x590ff1);_0x10f68f(_0x590ff1);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 8b82784..064ae94 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 _0xe9fa=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','delete','destroy','exports','multer'];(function(_0x327f10,_0x49e49e){var _0x3dbd78=function(_0x7ca0e9){while(--_0x7ca0e9){_0x327f10['push'](_0x327f10['shift']());}};_0x3dbd78(++_0x49e49e);}(_0xe9fa,0xef));var _0xae9f=function(_0x256f18,_0x420076){_0x256f18=_0x256f18-0x0;var _0xa5140b=_0xe9fa[_0x256f18];return _0xa5140b;};'use strict';var multer=require(_0xae9f('0x0'));var util=require(_0xae9f('0x1'));var path=require(_0xae9f('0x2'));var timeout=require(_0xae9f('0x3'));var express=require(_0xae9f('0x4'));var router=express[_0xae9f('0x5')]();var fs_extra=require(_0xae9f('0x6'));var auth=require(_0xae9f('0x7'));var interaction=require(_0xae9f('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0xae9f('0x9'),auth[_0xae9f('0xa')](),controller[_0xae9f('0xb')]);router['put'](_0xae9f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xae9f('0xc')](_0xae9f('0x9'),auth[_0xae9f('0xa')](),controller[_0xae9f('0xd')]);module[_0xae9f('0xe')]=router; \ No newline at end of file +var _0x92cc=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete','destroy','multer'];(function(_0x3b3b3c,_0x2e4b23){var _0x4e0a26=function(_0x19511d){while(--_0x19511d){_0x3b3b3c['push'](_0x3b3b3c['shift']());}};_0x4e0a26(++_0x2e4b23);}(_0x92cc,0x197));var _0xc92c=function(_0x418d8c,_0x48f7c8){_0x418d8c=_0x418d8c-0x0;var _0x19ad55=_0x92cc[_0x418d8c];return _0x19ad55;};'use strict';var multer=require(_0xc92c('0x0'));var util=require(_0xc92c('0x1'));var path=require(_0xc92c('0x2'));var timeout=require(_0xc92c('0x3'));var express=require(_0xc92c('0x4'));var router=express[_0xc92c('0x5')]();var fs_extra=require(_0xc92c('0x6'));var auth=require(_0xc92c('0x7'));var interaction=require(_0xc92c('0x8'));var config=require(_0xc92c('0x9'));var controller=require('./chatApplication.controller');router[_0xc92c('0xa')](_0xc92c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc92c('0xc')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0xe')]);router[_0xc92c('0xf')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4efafbd..7b3e270 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 _0xaeba=['STRING','sequelize','exports'];(function(_0x11df33,_0x57ca52){var _0x23a292=function(_0xf863b6){while(--_0xf863b6){_0x11df33['push'](_0x11df33['shift']());}};_0x23a292(++_0x57ca52);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x263dd8,_0x3df912){_0x263dd8=_0x263dd8-0x0;var _0x162906=_0xaeba[_0x263dd8];return _0x162906;};'use strict';var Sequelize=require(_0xaaeb('0x0'));module[_0xaaeb('0x1')]={'name':{'type':Sequelize[_0xaaeb('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4f75=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4df93c,_0x14cb97){var _0x523396=function(_0x34712b){while(--_0x34712b){_0x4df93c['push'](_0x4df93c['shift']());}};_0x523396(++_0x14cb97);}(_0x4f75,0xbb));var _0x54f7=function(_0x3efc17,_0x3b8777){_0x3efc17=_0x3efc17-0x0;var _0x471962=_0x4f75[_0x3efc17];return _0x471962;};'use strict';var Sequelize=require(_0x54f7('0x0'));module[_0x54f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x54f7('0x2')]},'write':{'type':Sequelize[_0x54f7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b3fb9fa..547365d 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 _0x1f44=['options','create','body','find','params','describe','getUnread','user','addMembers','omit','ids','getMembers','findOne','User','pick','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','fields'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x1f44,0x1a3));var _0x41f4=function(_0x3c910d,_0x38c746){_0x3c910d=_0x3c910d-0x0;var _0x49dc43=_0x1f44[_0x3c910d];return _0x49dc43;};'use strict';var emlformat=require(_0x41f4('0x0'));var rimraf=require(_0x41f4('0x1'));var zipdir=require(_0x41f4('0x2'));var jsonpatch=require(_0x41f4('0x3'));var rp=require(_0x41f4('0x4'));var moment=require(_0x41f4('0x5'));var BPromise=require(_0x41f4('0x6'));var Mustache=require(_0x41f4('0x7'));var util=require(_0x41f4('0x8'));var path=require(_0x41f4('0x9'));var sox=require(_0x41f4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41f4('0xb'));var _=require(_0x41f4('0xc'));var squel=require(_0x41f4('0xd'));var crypto=require(_0x41f4('0xe'));var jsforce=require(_0x41f4('0xf'));var deskjs=require(_0x41f4('0x10'));var toCsv=require(_0x41f4('0x11'));var querystring=require(_0x41f4('0x12'));var Papa=require(_0x41f4('0x13'));var Redis=require(_0x41f4('0x14'));var authService=require(_0x41f4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x41f4('0x16'));var hardwareService=require(_0x41f4('0x17'));var logger=require('../../config/logger')(_0x41f4('0x18'));var utils=require(_0x41f4('0x19'));var config=require(_0x41f4('0x1a'));var licenseUtil=require(_0x41f4('0x1b'));var db=require('../../mysqldb')['db'];config[_0x41f4('0x1c')]=_[_0x41f4('0x1d')](config[_0x41f4('0x1c')],{'host':_0x41f4('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41f4('0x1c')]));require(_0x41f4('0x1f'))[_0x41f4('0x20')](socket);function respondWithStatusCode(_0x414c12,_0x3b2d8e){_0x3b2d8e=_0x3b2d8e||0xcc;return function(_0x5c6f9d){if(_0x5c6f9d){return _0x414c12[_0x41f4('0x21')](_0x3b2d8e);}return _0x414c12[_0x41f4('0x22')](_0x3b2d8e)[_0x41f4('0x23')]();};}function respondWithResult(_0x478244,_0x1c757b){_0x1c757b=_0x1c757b||0xc8;return function(_0x2acee9){if(_0x2acee9){return _0x478244['status'](_0x1c757b)[_0x41f4('0x24')](_0x2acee9);}};}function respondWithFilteredResult(_0x19583c,_0x1e12ab){return function(_0x1ecaf3){if(_0x1ecaf3){var _0x3f49d9=typeof _0x1e12ab[_0x41f4('0x25')]===_0x41f4('0x26')&&typeof _0x1e12ab[_0x41f4('0x27')]==='undefined';var _0x22e73c=_0x1ecaf3[_0x41f4('0x28')];var _0x1fef74=_0x3f49d9?0x0:_0x1e12ab[_0x41f4('0x25')];var _0x5d381d=_0x3f49d9?_0x1ecaf3[_0x41f4('0x28')]:_0x1e12ab[_0x41f4('0x25')]+_0x1e12ab[_0x41f4('0x27')];var _0x23b10f;if(_0x5d381d>=_0x22e73c){_0x5d381d=_0x22e73c;_0x23b10f=0xc8;}else{_0x23b10f=0xce;}_0x19583c[_0x41f4('0x22')](_0x23b10f);return _0x19583c[_0x41f4('0x29')](_0x41f4('0x2a'),_0x1fef74+'-'+_0x5d381d+'/'+_0x22e73c)[_0x41f4('0x24')](_0x1ecaf3);}return null;};}function patchUpdates(_0x12df01){return function(_0x1a5055){try{jsonpatch[_0x41f4('0x2b')](_0x1a5055,_0x12df01,!![]);}catch(_0x4446c4){return BPromise[_0x41f4('0x2c')](_0x4446c4);}return _0x1a5055[_0x41f4('0x2d')]();};}function saveUpdates(_0x94fdf0,_0x508ca0){return function(_0x5ab4ed){if(_0x5ab4ed){return _0x5ab4ed[_0x41f4('0x2e')](_0x94fdf0)[_0x41f4('0x2f')](function(_0x215325){return _0x215325;});}return null;};}function removeEntity(_0xdd8524,_0x25d21a){return function(_0x393c57){if(_0x393c57){return _0x393c57[_0x41f4('0x30')]()[_0x41f4('0x2f')](function(){_0xdd8524['status'](0xcc)[_0x41f4('0x23')]();});}};}function handleEntityNotFound(_0x5de04a,_0x2acdef){return function(_0x1688b7){if(!_0x1688b7){_0x5de04a[_0x41f4('0x21')](0x194);}return _0x1688b7;};}function handleError(_0x4974c7,_0x26391a){_0x26391a=_0x26391a||0x1f4;return function(_0x4f6a53){logger['error'](_0x4f6a53[_0x41f4('0x31')]);if(_0x4f6a53[_0x41f4('0x32')]){delete _0x4f6a53['name'];}_0x4974c7['status'](_0x26391a)['send'](_0x4f6a53);};}exports[_0x41f4('0x33')]=function(_0x39b717,_0x296d76){var _0x4649bd={},_0x4b79e7={},_0x4fa804={'count':0x0,'rows':[]};var _0x21dbc5=_[_0x41f4('0x34')](db[_0x41f4('0x35')][_0x41f4('0x36')],function(_0x1937c0){return{'name':_0x1937c0['fieldName'],'type':_0x1937c0[_0x41f4('0x37')][_0x41f4('0x38')]};});_0x4b79e7[_0x41f4('0x39')]=_[_0x41f4('0x34')](_0x21dbc5,'name');_0x4b79e7[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x39b717['query']);_0x4b79e7['filters']=_[_0x41f4('0x3c')](_0x4b79e7['model'],_0x4b79e7[_0x41f4('0x3a')]);_0x4649bd[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0x4b79e7['model'],qs['fields'](_0x39b717['query']['fields']));_0x4649bd[_0x41f4('0x3d')]=_0x4649bd[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x4649bd[_0x41f4('0x3d')]:_0x4b79e7[_0x41f4('0x39')];if(!_0x39b717['query'][_0x41f4('0x3f')]('nolimit')){_0x4649bd[_0x41f4('0x27')]=qs[_0x41f4('0x27')](_0x39b717[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x4649bd['offset']=qs['offset'](_0x39b717[_0x41f4('0x3a')][_0x41f4('0x25')]);}_0x4649bd[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x39b717['query'][_0x41f4('0x41')]);_0x4649bd[_0x41f4('0x42')]=qs['filters'](_['pick'](_0x39b717[_0x41f4('0x3a')],_0x4b79e7[_0x41f4('0x43')]),_0x21dbc5);if(_0x39b717[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x4649bd[_0x41f4('0x42')]=_['merge'](_0x4649bd[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x21dbc5,function(_0x11b9e7){if(_0x11b9e7[_0x41f4('0x37')]!=='VIRTUAL'){var _0x45ad60={};_0x45ad60[_0x11b9e7[_0x41f4('0x32')]]={'$like':'%'+_0x39b717['query']['filter']+'%'};return _0x45ad60;}})});}_0x4649bd=_[_0x41f4('0x45')]({},_0x4649bd,_0x39b717['options']);var _0x3c278e={'where':_0x4649bd[_0x41f4('0x42')]};return db['ChatGroup'][_0x41f4('0x28')](_0x3c278e)[_0x41f4('0x2f')](function(_0x1a3512){_0x4fa804[_0x41f4('0x28')]=_0x1a3512;if(_0x39b717[_0x41f4('0x3a')][_0x41f4('0x46')]){_0x4649bd[_0x41f4('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x41f4('0x48')](_0x4649bd);})[_0x41f4('0x2f')](function(_0x2ce94f){_0x4fa804[_0x41f4('0x49')]=_0x2ce94f;return _0x4fa804;})[_0x41f4('0x2f')](respondWithFilteredResult(_0x296d76,_0x4649bd))[_0x41f4('0x4a')](handleError(_0x296d76,null));};exports['show']=function(_0x3442ac,_0x2e3296){var _0x2c1a02={'raw':!![],'where':{'id':_0x3442ac['params']['id']}},_0x432fd1={};_0x432fd1['model']=_[_0x41f4('0x3b')](db[_0x41f4('0x35')][_0x41f4('0x36')]);_0x432fd1[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x3442ac['query']);_0x432fd1[_0x41f4('0x43')]=_['intersection'](_0x432fd1[_0x41f4('0x39')],_0x432fd1['query']);_0x2c1a02[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0x432fd1[_0x41f4('0x39')],qs[_0x41f4('0x4b')](_0x3442ac[_0x41f4('0x3a')][_0x41f4('0x4b')]));_0x2c1a02[_0x41f4('0x3d')]=_0x2c1a02[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x2c1a02[_0x41f4('0x3d')]:_0x432fd1['model'];if(_0x3442ac[_0x41f4('0x3a')][_0x41f4('0x46')]){_0x2c1a02[_0x41f4('0x47')]=[{'all':!![]}];}_0x2c1a02=_[_0x41f4('0x45')]({},_0x2c1a02,_0x3442ac[_0x41f4('0x4c')]);return db[_0x41f4('0x35')]['find'](_0x2c1a02)[_0x41f4('0x2f')](handleEntityNotFound(_0x2e3296,null))[_0x41f4('0x2f')](respondWithResult(_0x2e3296,null))[_0x41f4('0x4a')](handleError(_0x2e3296,null));};exports[_0x41f4('0x4d')]=function(_0x487107,_0xf861d3){return db[_0x41f4('0x35')]['create'](_0x487107[_0x41f4('0x4e')],{})['then'](respondWithResult(_0xf861d3,0xc9))[_0x41f4('0x4a')](handleError(_0xf861d3,null));};exports[_0x41f4('0x2e')]=function(_0x30a8d5,_0xe7cef5){if(_0x30a8d5[_0x41f4('0x4e')]['id']){delete _0x30a8d5['body']['id'];}return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x30a8d5[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0xe7cef5,null))[_0x41f4('0x2f')](saveUpdates(_0x30a8d5[_0x41f4('0x4e')],null))[_0x41f4('0x2f')](respondWithResult(_0xe7cef5,null))[_0x41f4('0x4a')](handleError(_0xe7cef5,null));};exports[_0x41f4('0x30')]=function(_0x5d009d,_0x890ca0){return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x5d009d[_0x41f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x890ca0,null))[_0x41f4('0x2f')](removeEntity(_0x890ca0,null))['catch'](handleError(_0x890ca0,null));};exports[_0x41f4('0x51')]=function(_0x187292,_0x236301){return db[_0x41f4('0x35')][_0x41f4('0x51')]()['then'](respondWithResult(_0x236301,null))[_0x41f4('0x4a')](handleError(_0x236301,null));};exports[_0x41f4('0x52')]=function(_0x1d27fb,_0x3fb1af,_0x28b96e){return db['ChatInternalMessage'][_0x41f4('0x28')]({'where':{'ChatGroupId':_0x1d27fb[_0x41f4('0x50')]['id'],'ToId':_0x1d27fb[_0x41f4('0x53')]['id'],'read':![]}})[_0x41f4('0x2f')](function(_0xf9e1e0){return{'id':_['toInteger'](_0x1d27fb['params']['id']),'count':_0xf9e1e0};})['then'](respondWithResult(_0x3fb1af,null))[_0x41f4('0x4a')](handleError(_0x3fb1af,null));};exports['addMembers']=function(_0x3b6e11,_0x77cc38,_0x294274){return db['ChatGroup'][_0x41f4('0x4f')]({'where':{'id':_0x3b6e11['params']['id']}})['then'](handleEntityNotFound(_0x77cc38,null))[_0x41f4('0x2f')](function(_0x3b8929){if(_0x3b8929){return _0x3b8929[_0x41f4('0x54')](_0x3b6e11[_0x41f4('0x4e')]['ids'],_[_0x41f4('0x55')](_0x3b6e11['body'],[_0x41f4('0x56'),'id'])||{});}})[_0x41f4('0x2f')](respondWithResult(_0x77cc38,null))[_0x41f4('0x4a')](handleError(_0x77cc38,null));};exports[_0x41f4('0x57')]=function(_0x21abea,_0x5d0d2f,_0x1d14b8){var _0x3ed0ea={};var _0xffa8d9={};var _0x5ab814;var _0x314b41;return db['ChatGroup'][_0x41f4('0x58')]({'where':{'id':_0x21abea[_0x41f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0d2f,null))[_0x41f4('0x2f')](function(_0x2b4c0f){if(_0x2b4c0f){_0x5ab814=_0x2b4c0f;_0xffa8d9[_0x41f4('0x39')]=_[_0x41f4('0x3b')](db[_0x41f4('0x59')][_0x41f4('0x36')]);_0xffa8d9[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x21abea['query']);_0xffa8d9[_0x41f4('0x43')]=_[_0x41f4('0x3c')](_0xffa8d9[_0x41f4('0x39')],_0xffa8d9[_0x41f4('0x3a')]);_0x3ed0ea[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0xffa8d9[_0x41f4('0x39')],qs['fields'](_0x21abea[_0x41f4('0x3a')]['fields']));_0x3ed0ea[_0x41f4('0x3d')]=_0x3ed0ea[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x3ed0ea[_0x41f4('0x3d')]:_0xffa8d9['model'];_0x3ed0ea[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x21abea['query'][_0x41f4('0x41')]);_0x3ed0ea[_0x41f4('0x42')]=qs['filters'](_[_0x41f4('0x5a')](_0x21abea[_0x41f4('0x3a')],_0xffa8d9['filters']));if(_0x21abea[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x3ed0ea[_0x41f4('0x42')]=_[_0x41f4('0x45')](_0x3ed0ea[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x3ed0ea['attributes'],function(_0x397679){var _0x44bbc6={};_0x44bbc6[_0x397679]={'$like':'%'+_0x21abea[_0x41f4('0x3a')][_0x41f4('0x44')]+'%'};return _0x44bbc6;})});}_0x3ed0ea=_[_0x41f4('0x45')]({},_0x3ed0ea,_0x21abea['options']);return _0x5ab814[_0x41f4('0x57')](_0x3ed0ea);}})[_0x41f4('0x2f')](function(_0x5abbfb){if(_0x5abbfb){_0x314b41=_0x5abbfb[_0x41f4('0x3e')];if(!_0x21abea[_0x41f4('0x3a')][_0x41f4('0x3f')](_0x41f4('0x5b'))){_0x3ed0ea[_0x41f4('0x27')]=qs['limit'](_0x21abea[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x3ed0ea[_0x41f4('0x25')]=qs[_0x41f4('0x25')](_0x21abea[_0x41f4('0x3a')]['offset']);}return _0x5ab814[_0x41f4('0x57')](_0x3ed0ea);}})[_0x41f4('0x2f')](function(_0x3a0210){if(_0x3a0210){return _0x3a0210?{'count':_0x314b41,'rows':_0x3a0210}:null;}})[_0x41f4('0x2f')](respondWithResult(_0x5d0d2f,null))[_0x41f4('0x4a')](handleError(_0x5d0d2f,null));};exports[_0x41f4('0x5c')]=function(_0x583599,_0x137ce2,_0x34efeb){return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x583599[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x137ce2,null))['then'](function(_0xd11472){if(_0xd11472){return _0xd11472[_0x41f4('0x5c')](_0x583599['query'][_0x41f4('0x56')]);}})[_0x41f4('0x2f')](respondWithStatusCode(_0x137ce2,null))[_0x41f4('0x4a')](handleError(_0x137ce2,null));};exports['addMessage']=function(_0x183907,_0x362441,_0x57d5e3){if(_0x183907[_0x41f4('0x4e')]['id']){delete _0x183907[_0x41f4('0x4e')]['id'];}return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x183907['params']['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x362441,null))[_0x41f4('0x2f')](function(_0x5cc989){if(_0x5cc989){_0x183907[_0x41f4('0x4e')][_0x41f4('0x5d')]=_0x5cc989['id'];return db[_0x41f4('0x5e')][_0x41f4('0x4d')](_0x183907['body']);}})[_0x41f4('0x2f')](respondWithResult(_0x362441,null))[_0x41f4('0x4a')](handleError(_0x362441,null));};exports[_0x41f4('0x5f')]=function(_0x1b4d53,_0x1e4799,_0x2b8aa3){var _0x2bb375={};var _0x46cfe3={};var _0x492321;var _0x596507;return db[_0x41f4('0x35')]['findOne']({'where':{'id':_0x1b4d53[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x1e4799,null))[_0x41f4('0x2f')](function(_0x1c22ff){if(_0x1c22ff){_0x492321=_0x1c22ff;_0x46cfe3['model']=_['keys'](db[_0x41f4('0x5e')]['rawAttributes']);_0x46cfe3[_0x41f4('0x3a')]=_['keys'](_0x1b4d53[_0x41f4('0x3a')]);_0x46cfe3[_0x41f4('0x43')]=_[_0x41f4('0x3c')](_0x46cfe3[_0x41f4('0x39')],_0x46cfe3['query']);_0x2bb375[_0x41f4('0x3d')]=_['intersection'](_0x46cfe3[_0x41f4('0x39')],qs['fields'](_0x1b4d53[_0x41f4('0x3a')]['fields']));_0x2bb375[_0x41f4('0x3d')]=_0x2bb375[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x2bb375['attributes']:_0x46cfe3[_0x41f4('0x39')];_0x2bb375[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x41')]);_0x2bb375['where']=qs['filters'](_[_0x41f4('0x5a')](_0x1b4d53['query'],_0x46cfe3[_0x41f4('0x43')]));if(_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x2bb375['where']=_[_0x41f4('0x45')](_0x2bb375[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x2bb375[_0x41f4('0x3d')],function(_0x48befb){var _0x45b82c={};_0x45b82c[_0x48befb]={'$like':'%'+_0x1b4d53[_0x41f4('0x3a')]['filter']+'%'};return _0x45b82c;})});}if(_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x60')]){var _0x4c10a6=_0x1b4d53['query'][_0x41f4('0x60')][_0x41f4('0x61')](',');var _0x393b97={};_0x393b97[_0x4c10a6[0x0]]={'$gte':moment(_0x4c10a6[0x1])[_0x41f4('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2bb375[_0x41f4('0x42')]=_['merge'](_0x2bb375['where'],_0x393b97);}_0x2bb375=_[_0x41f4('0x45')]({},_0x2bb375,_0x1b4d53['options']);return _0x492321[_0x41f4('0x5f')](_0x2bb375);}})['then'](function(_0x1f57cf){if(_0x1f57cf){_0x596507=_0x1f57cf[_0x41f4('0x3e')];if(!_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x3f')](_0x41f4('0x5b'))){_0x2bb375[_0x41f4('0x27')]=qs[_0x41f4('0x27')](_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x2bb375[_0x41f4('0x25')]=qs[_0x41f4('0x25')](_0x1b4d53['query']['offset']);}return _0x492321['getMessages'](_0x2bb375);}})[_0x41f4('0x2f')](function(_0x50005f){if(_0x50005f){return _0x50005f?{'count':_0x596507,'rows':_0x50005f}:null;}})[_0x41f4('0x2f')](respondWithResult(_0x1e4799,null))[_0x41f4('0x4a')](handleError(_0x1e4799,null));}; \ No newline at end of file +var _0x6f69=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','omit','ids','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','pick','split','format','eml-format','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','count'];(function(_0x446a8b,_0x37f5cd){var _0xb56d31=function(_0x23ee4a){while(--_0x23ee4a){_0x446a8b['push'](_0x446a8b['shift']());}};_0xb56d31(++_0x37f5cd);}(_0x6f69,0x143));var _0x96f6=function(_0x46a836,_0x59b1e9){_0x46a836=_0x46a836-0x0;var _0x4e6773=_0x6f69[_0x46a836];return _0x4e6773;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96f6('0x1'));var BPromise=require(_0x96f6('0x2'));var Mustache=require(_0x96f6('0x3'));var util=require('util');var path=require(_0x96f6('0x4'));var sox=require('sox');var csv=require(_0x96f6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0x6'));var _=require(_0x96f6('0x7'));var squel=require(_0x96f6('0x8'));var crypto=require(_0x96f6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f6('0x5'));var querystring=require(_0x96f6('0xa'));var Papa=require('papaparse');var Redis=require(_0x96f6('0xb'));var authService=require(_0x96f6('0xc'));var qs=require(_0x96f6('0xd'));var as=require(_0x96f6('0xe'));var hardwareService=require(_0x96f6('0xf'));var logger=require(_0x96f6('0x10'))(_0x96f6('0x11'));var utils=require(_0x96f6('0x12'));var config=require(_0x96f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x96f6('0x14'))['db'];config[_0x96f6('0x15')]=_[_0x96f6('0x16')](config['redis'],{'host':_0x96f6('0x17'),'port':0x18eb});var socket=require(_0x96f6('0x18'))(new Redis(config[_0x96f6('0x15')]));require(_0x96f6('0x19'))[_0x96f6('0x1a')](socket);function respondWithStatusCode(_0x319d9c,_0x4967a7){_0x4967a7=_0x4967a7||0xcc;return function(_0x43c964){if(_0x43c964){return _0x319d9c['sendStatus'](_0x4967a7);}return _0x319d9c[_0x96f6('0x1b')](_0x4967a7)[_0x96f6('0x1c')]();};}function respondWithResult(_0x24d330,_0x2796b2){_0x2796b2=_0x2796b2||0xc8;return function(_0x3ff8d1){if(_0x3ff8d1){return _0x24d330[_0x96f6('0x1b')](_0x2796b2)[_0x96f6('0x1d')](_0x3ff8d1);}};}function respondWithFilteredResult(_0x1b7dca,_0x18bb81){return function(_0xedf402){if(_0xedf402){var _0x115b9f=typeof _0x18bb81['offset']==='undefined'&&typeof _0x18bb81[_0x96f6('0x1e')]===_0x96f6('0x1f');var _0x5171af=_0xedf402['count'];var _0x4a40c0=_0x115b9f?0x0:_0x18bb81['offset'];var _0x2d9549=_0x115b9f?_0xedf402['count']:_0x18bb81[_0x96f6('0x20')]+_0x18bb81['limit'];var _0x531c72;if(_0x2d9549>=_0x5171af){_0x2d9549=_0x5171af;_0x531c72=0xc8;}else{_0x531c72=0xce;}_0x1b7dca['status'](_0x531c72);return _0x1b7dca[_0x96f6('0x21')](_0x96f6('0x22'),_0x4a40c0+'-'+_0x2d9549+'/'+_0x5171af)[_0x96f6('0x1d')](_0xedf402);}return null;};}function patchUpdates(_0x585c77){return function(_0x2113ca){try{jsonpatch[_0x96f6('0x23')](_0x2113ca,_0x585c77,!![]);}catch(_0x165652){return BPromise[_0x96f6('0x24')](_0x165652);}return _0x2113ca[_0x96f6('0x25')]();};}function saveUpdates(_0x5caee9,_0x422aa8){return function(_0x4509a1){if(_0x4509a1){return _0x4509a1[_0x96f6('0x26')](_0x5caee9)[_0x96f6('0x27')](function(_0xb0ddda){return _0xb0ddda;});}return null;};}function removeEntity(_0x1a9a26,_0x42bbbc){return function(_0x80bae){if(_0x80bae){return _0x80bae[_0x96f6('0x28')]()[_0x96f6('0x27')](function(){_0x1a9a26['status'](0xcc)[_0x96f6('0x1c')]();});}};}function handleEntityNotFound(_0x1e2c58,_0x20a8d2){return function(_0x2e2676){if(!_0x2e2676){_0x1e2c58[_0x96f6('0x29')](0x194);}return _0x2e2676;};}function handleError(_0x2628a9,_0x41dc5c){_0x41dc5c=_0x41dc5c||0x1f4;return function(_0x13e089){logger[_0x96f6('0x2a')](_0x13e089[_0x96f6('0x2b')]);if(_0x13e089[_0x96f6('0x2c')]){delete _0x13e089[_0x96f6('0x2c')];}_0x2628a9[_0x96f6('0x1b')](_0x41dc5c)[_0x96f6('0x2d')](_0x13e089);};}exports[_0x96f6('0x2e')]=function(_0x525d69,_0x2539f8){var _0x58b00d={},_0x41d60b={},_0x3a5e93={'count':0x0,'rows':[]};var _0x3563e8=_[_0x96f6('0x2f')](db[_0x96f6('0x30')][_0x96f6('0x31')],function(_0x432a8b){return{'name':_0x432a8b[_0x96f6('0x32')],'type':_0x432a8b[_0x96f6('0x33')][_0x96f6('0x34')]};});_0x41d60b[_0x96f6('0x35')]=_[_0x96f6('0x2f')](_0x3563e8,_0x96f6('0x2c'));_0x41d60b[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x525d69['query']);_0x41d60b['filters']=_['intersection'](_0x41d60b[_0x96f6('0x35')],_0x41d60b['query']);_0x58b00d['attributes']=_[_0x96f6('0x38')](_0x41d60b[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x525d69['query'][_0x96f6('0x39')]));_0x58b00d[_0x96f6('0x3a')]=_0x58b00d[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x58b00d[_0x96f6('0x3a')]:_0x41d60b[_0x96f6('0x35')];if(!_0x525d69['query'][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x58b00d[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x525d69[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x58b00d[_0x96f6('0x20')]=qs['offset'](_0x525d69['query'][_0x96f6('0x20')]);}_0x58b00d['order']=qs[_0x96f6('0x3e')](_0x525d69[_0x96f6('0x36')]['sort']);_0x58b00d[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x525d69[_0x96f6('0x36')],_0x41d60b['filters']),_0x3563e8);if(_0x525d69['query']['filter']){_0x58b00d[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x58b00d['where'],{'$or':_[_0x96f6('0x2f')](_0x3563e8,function(_0x40793e){if(_0x40793e[_0x96f6('0x33')]!==_0x96f6('0x42')){var _0x54348b={};_0x54348b[_0x40793e[_0x96f6('0x2c')]]={'$like':'%'+_0x525d69[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x54348b;}})});}_0x58b00d=_['merge']({},_0x58b00d,_0x525d69['options']);var _0x336605={'where':_0x58b00d['where']};return db[_0x96f6('0x30')][_0x96f6('0x44')](_0x336605)[_0x96f6('0x27')](function(_0x32f825){_0x3a5e93[_0x96f6('0x44')]=_0x32f825;if(_0x525d69[_0x96f6('0x36')][_0x96f6('0x45')]){_0x58b00d[_0x96f6('0x46')]=[{'all':!![]}];}return db[_0x96f6('0x30')][_0x96f6('0x47')](_0x58b00d);})['then'](function(_0x280fd0){_0x3a5e93[_0x96f6('0x48')]=_0x280fd0;return _0x3a5e93;})[_0x96f6('0x27')](respondWithFilteredResult(_0x2539f8,_0x58b00d))[_0x96f6('0x49')](handleError(_0x2539f8,null));};exports[_0x96f6('0x4a')]=function(_0x5177c0,_0x40badd){var _0x55c04f={'raw':!![],'where':{'id':_0x5177c0[_0x96f6('0x4b')]['id']}},_0x5d317d={};_0x5d317d['model']=_[_0x96f6('0x37')](db[_0x96f6('0x30')]['rawAttributes']);_0x5d317d[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x5177c0['query']);_0x5d317d['filters']=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],_0x5d317d['query']);_0x55c04f[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5177c0[_0x96f6('0x36')]['fields']));_0x55c04f[_0x96f6('0x3a')]=_0x55c04f['attributes']['length']?_0x55c04f['attributes']:_0x5d317d[_0x96f6('0x35')];if(_0x5177c0[_0x96f6('0x36')][_0x96f6('0x45')]){_0x55c04f['include']=[{'all':!![]}];}_0x55c04f=_[_0x96f6('0x41')]({},_0x55c04f,_0x5177c0[_0x96f6('0x4c')]);return db[_0x96f6('0x30')][_0x96f6('0x4d')](_0x55c04f)[_0x96f6('0x27')](handleEntityNotFound(_0x40badd,null))[_0x96f6('0x27')](respondWithResult(_0x40badd,null))[_0x96f6('0x49')](handleError(_0x40badd,null));};exports[_0x96f6('0x4e')]=function(_0x32f430,_0x43ec2e){return db[_0x96f6('0x30')][_0x96f6('0x4e')](_0x32f430[_0x96f6('0x4f')],{})[_0x96f6('0x27')](respondWithResult(_0x43ec2e,0xc9))['catch'](handleError(_0x43ec2e,null));};exports[_0x96f6('0x26')]=function(_0x494f13,_0x4bcb05){if(_0x494f13[_0x96f6('0x4f')]['id']){delete _0x494f13[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x494f13[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x4bcb05,null))[_0x96f6('0x27')](saveUpdates(_0x494f13[_0x96f6('0x4f')],null))['then'](respondWithResult(_0x4bcb05,null))[_0x96f6('0x49')](handleError(_0x4bcb05,null));};exports[_0x96f6('0x28')]=function(_0x1ce91d,_0x431cee){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x1ce91d['params']['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x431cee,null))[_0x96f6('0x27')](removeEntity(_0x431cee,null))[_0x96f6('0x49')](handleError(_0x431cee,null));};exports['describe']=function(_0x5f2dee,_0x51107f){return db[_0x96f6('0x30')][_0x96f6('0x50')]()['then'](respondWithResult(_0x51107f,null))['catch'](handleError(_0x51107f,null));};exports[_0x96f6('0x51')]=function(_0x294036,_0x44ff09,_0x487815){return db[_0x96f6('0x52')][_0x96f6('0x44')]({'where':{'ChatGroupId':_0x294036['params']['id'],'ToId':_0x294036[_0x96f6('0x53')]['id'],'read':![]}})[_0x96f6('0x27')](function(_0x3d0014){return{'id':_['toInteger'](_0x294036[_0x96f6('0x4b')]['id']),'count':_0x3d0014};})[_0x96f6('0x27')](respondWithResult(_0x44ff09,null))[_0x96f6('0x49')](handleError(_0x44ff09,null));};exports[_0x96f6('0x54')]=function(_0x3f3e21,_0x435030,_0x2d932b){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x3f3e21[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x435030,null))[_0x96f6('0x27')](function(_0x4d4687){if(_0x4d4687){return _0x4d4687['addMembers'](_0x3f3e21[_0x96f6('0x4f')]['ids'],_[_0x96f6('0x55')](_0x3f3e21[_0x96f6('0x4f')],[_0x96f6('0x56'),'id'])||{});}})['then'](respondWithResult(_0x435030,null))[_0x96f6('0x49')](handleError(_0x435030,null));};exports['getMembers']=function(_0x5022be,_0x135d3e,_0x4a044a){var _0x5b6ff8={};var _0x46ca69={};var _0x5dbcb2;var _0x53ca24;return db['ChatGroup'][_0x96f6('0x57')]({'where':{'id':_0x5022be[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x135d3e,null))[_0x96f6('0x27')](function(_0x28c737){if(_0x28c737){_0x5dbcb2=_0x28c737;_0x46ca69[_0x96f6('0x35')]=_[_0x96f6('0x37')](db[_0x96f6('0x58')][_0x96f6('0x31')]);_0x46ca69[_0x96f6('0x36')]=_['keys'](_0x5022be['query']);_0x46ca69[_0x96f6('0x40')]=_['intersection'](_0x46ca69[_0x96f6('0x35')],_0x46ca69['query']);_0x5b6ff8[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x46ca69[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x39')]));_0x5b6ff8['attributes']=_0x5b6ff8[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x5b6ff8['attributes']:_0x46ca69[_0x96f6('0x35')];_0x5b6ff8[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x5b6ff8[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x5022be['query'],_0x46ca69[_0x96f6('0x40')]));if(_0x5022be[_0x96f6('0x36')][_0x96f6('0x43')]){_0x5b6ff8[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x5b6ff8['where'],{'$or':_[_0x96f6('0x2f')](_0x5b6ff8['attributes'],function(_0x323fa3){var _0x17ff3a={};_0x17ff3a[_0x323fa3]={'$like':'%'+_0x5022be[_0x96f6('0x36')]['filter']+'%'};return _0x17ff3a;})});}_0x5b6ff8=_[_0x96f6('0x41')]({},_0x5b6ff8,_0x5022be[_0x96f6('0x4c')]);return _0x5dbcb2[_0x96f6('0x5a')](_0x5b6ff8);}})[_0x96f6('0x27')](function(_0x153f8f){if(_0x153f8f){_0x53ca24=_0x153f8f[_0x96f6('0x3b')];if(!_0x5022be[_0x96f6('0x36')]['hasOwnProperty'](_0x96f6('0x3d'))){_0x5b6ff8[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x5b6ff8[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x5022be[_0x96f6('0x36')]['offset']);}return _0x5dbcb2['getMembers'](_0x5b6ff8);}})['then'](function(_0x47da43){if(_0x47da43){return _0x47da43?{'count':_0x53ca24,'rows':_0x47da43}:null;}})[_0x96f6('0x27')](respondWithResult(_0x135d3e,null))[_0x96f6('0x49')](handleError(_0x135d3e,null));};exports[_0x96f6('0x5b')]=function(_0x178617,_0x269f63,_0x1f9bcc){return db['ChatGroup'][_0x96f6('0x4d')]({'where':{'id':_0x178617[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x269f63,null))[_0x96f6('0x27')](function(_0x1660f1){if(_0x1660f1){return _0x1660f1[_0x96f6('0x5b')](_0x178617[_0x96f6('0x36')][_0x96f6('0x56')]);}})['then'](respondWithStatusCode(_0x269f63,null))['catch'](handleError(_0x269f63,null));};exports[_0x96f6('0x5c')]=function(_0x5d2f95,_0x3d2bc5,_0x1a5ee5){if(_0x5d2f95['body']['id']){delete _0x5d2f95[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')]['find']({'where':{'id':_0x5d2f95[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x3d2bc5,null))[_0x96f6('0x27')](function(_0x45134c){if(_0x45134c){_0x5d2f95[_0x96f6('0x4f')][_0x96f6('0x5d')]=_0x45134c['id'];return db['ChatInternalMessage']['create'](_0x5d2f95[_0x96f6('0x4f')]);}})['then'](respondWithResult(_0x3d2bc5,null))['catch'](handleError(_0x3d2bc5,null));};exports[_0x96f6('0x5e')]=function(_0x53a84d,_0x6b7ea9,_0x3da4da){var _0x53bb3f={};var _0xbfe9fb={};var _0x2068bb;var _0x4bb2a3;return db[_0x96f6('0x30')][_0x96f6('0x57')]({'where':{'id':_0x53a84d[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b7ea9,null))[_0x96f6('0x27')](function(_0x277cc9){if(_0x277cc9){_0x2068bb=_0x277cc9;_0xbfe9fb[_0x96f6('0x35')]=_[_0x96f6('0x37')](db['ChatInternalMessage'][_0x96f6('0x31')]);_0xbfe9fb[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x53a84d[_0x96f6('0x36')]);_0xbfe9fb[_0x96f6('0x40')]=_['intersection'](_0xbfe9fb[_0x96f6('0x35')],_0xbfe9fb[_0x96f6('0x36')]);_0x53bb3f['attributes']=_[_0x96f6('0x38')](_0xbfe9fb[_0x96f6('0x35')],qs['fields'](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x39')]));_0x53bb3f['attributes']=_0x53bb3f['attributes'][_0x96f6('0x3b')]?_0x53bb3f[_0x96f6('0x3a')]:_0xbfe9fb[_0x96f6('0x35')];_0x53bb3f[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x53bb3f[_0x96f6('0x3f')]=qs['filters'](_[_0x96f6('0x5f')](_0x53a84d[_0x96f6('0x36')],_0xbfe9fb[_0x96f6('0x40')]));if(_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]){_0x53bb3f[_0x96f6('0x3f')]=_['merge'](_0x53bb3f[_0x96f6('0x3f')],{'$or':_[_0x96f6('0x2f')](_0x53bb3f[_0x96f6('0x3a')],function(_0xff6e4d){var _0x110ad5={};_0x110ad5[_0xff6e4d]={'$like':'%'+_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x110ad5;})});}if(_0x53a84d[_0x96f6('0x36')]['$gte']){var _0x34a5fb=_0x53a84d[_0x96f6('0x36')]['$gte'][_0x96f6('0x60')](',');var _0x185cef={};_0x185cef[_0x34a5fb[0x0]]={'$gte':moment(_0x34a5fb[0x1])[_0x96f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53bb3f['where']=_[_0x96f6('0x41')](_0x53bb3f['where'],_0x185cef);}_0x53bb3f=_['merge']({},_0x53bb3f,_0x53a84d[_0x96f6('0x4c')]);return _0x2068bb[_0x96f6('0x5e')](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x1854e8){if(_0x1854e8){_0x4bb2a3=_0x1854e8[_0x96f6('0x3b')];if(!_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x53bb3f[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x53a84d['query'][_0x96f6('0x1e')]);_0x53bb3f[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x20')]);}return _0x2068bb['getMessages'](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x3cc98a){if(_0x3cc98a){return _0x3cc98a?{'count':_0x4bb2a3,'rows':_0x3cc98a}:null;}})[_0x96f6('0x27')](respondWithResult(_0x6b7ea9,null))[_0x96f6('0x49')](handleError(_0x6b7ea9,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index be05921..c16e413 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 _0xf23e=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x42919b,_0x598bb9){var _0x51d905=function(_0x4bec92){while(--_0x4bec92){_0x42919b['push'](_0x42919b['shift']());}};_0x51d905(++_0x598bb9);}(_0xf23e,0xd2));var _0xef23=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xf23e[_0x58e469];return _0x4c01c5;};'use strict';var EventEmitter=require(_0xef23('0x0'));var ChatGroup=require(_0xef23('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xef23('0x2')](0x0);var events={'afterCreate':_0xef23('0x3'),'afterUpdate':_0xef23('0x4'),'afterDestroy':_0xef23('0x5')};function emitEvent(_0x48a4e6){return function(_0x4a747a,_0x3a8cb1,_0x36c0c5){ChatGroupEvents[_0xef23('0x6')](_0x48a4e6+':'+_0x4a747a['id'],_0x4a747a);ChatGroupEvents[_0xef23('0x6')](_0x48a4e6,_0x4a747a);_0x36c0c5(null);};}for(var e in events){if(events[_0xef23('0x7')](e)){var event=events[e];ChatGroup[_0xef23('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xb486=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xb486,0x138));var _0x6b48=function(_0x219b60,_0xde6b4b){_0x219b60=_0x219b60-0x0;var _0x495da4=_0xb486[_0x219b60];return _0x495da4;};'use strict';var EventEmitter=require(_0x6b48('0x0'));var ChatGroup=require(_0x6b48('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6b48('0x2')](0x0);var events={'afterCreate':_0x6b48('0x3'),'afterUpdate':_0x6b48('0x4'),'afterDestroy':_0x6b48('0x5')};function emitEvent(_0x385959){return function(_0x3884f3,_0x3e4c13,_0x3a8371){ChatGroupEvents[_0x6b48('0x6')](_0x385959+':'+_0x3884f3['id'],_0x3884f3);ChatGroupEvents[_0x6b48('0x6')](_0x385959,_0x3884f3);_0x3a8371(null);};}for(var e in events){if(events[_0x6b48('0x7')](e)){var event=events[e];ChatGroup[_0x6b48('0x8')](e,emitEvent(event));}}module[_0x6b48('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 37846c0..51aa941 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 _0x90d8=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x4de2de,_0x2171db){var _0x2e3372=function(_0x2d37bd){while(--_0x2d37bd){_0x4de2de['push'](_0x4de2de['shift']());}};_0x2e3372(++_0x2171db);}(_0x90d8,0x105));var _0x890d=function(_0x1f244d,_0x19e830){_0x1f244d=_0x1f244d-0x0;var _0x16003a=_0x90d8[_0x1f244d];return _0x16003a;};'use strict';var _=require(_0x890d('0x0'));var util=require(_0x890d('0x1'));var logger=require(_0x890d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x890d('0x3'));var fs=require('fs');var path=require(_0x890d('0x4'));var rimraf=require(_0x890d('0x5'));var config=require(_0x890d('0x6'));var attributes=require(_0x890d('0x7'));module[_0x890d('0x8')]=function(_0x518dbc,_0x141535){return _0x518dbc[_0x890d('0x9')](_0x890d('0xa'),attributes,{'tableName':_0x890d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9062=['moment','bluebird','request-promise','path','../../config/environment','exports','define','chat_groups','util','../../config/logger','api'];(function(_0x424365,_0x5750d1){var _0x51119d=function(_0x4b54ab){while(--_0x4b54ab){_0x424365['push'](_0x424365['shift']());}};_0x51119d(++_0x5750d1);}(_0x9062,0xad));var _0x2906=function(_0x204a63,_0x4dc00a){_0x204a63=_0x204a63-0x0;var _0x389f09=_0x9062[_0x204a63];return _0x389f09;};'use strict';var _=require('lodash');var util=require(_0x2906('0x0'));var logger=require(_0x2906('0x1'))(_0x2906('0x2'));var moment=require(_0x2906('0x3'));var BPromise=require(_0x2906('0x4'));var rp=require(_0x2906('0x5'));var fs=require('fs');var path=require(_0x2906('0x6'));var rimraf=require('rimraf');var config=require(_0x2906('0x7'));var attributes=require('./chatGroup.attributes');module[_0x2906('0x8')]=function(_0x15af70,_0x5b1f19){return _0x15af70[_0x2906('0x9')]('ChatGroup',attributes,{'tableName':_0x2906('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 93bad78..fa3ebd2 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 _0x8bda=['http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8bda,0x104));var _0xa8bd=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8bda[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0xa8bd('0x0'));var util=require(_0xa8bd('0x1'));var moment=require(_0xa8bd('0x2'));var BPromise=require(_0xa8bd('0x3'));var rs=require(_0xa8bd('0x4'));var fs=require('fs');var Redis=require(_0xa8bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8bd('0x6'));var logger=require(_0xa8bd('0x7'))('rpc');var config=require(_0xa8bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8bd('0x9')][_0xa8bd('0xa')]({'port':0x232a});config['redis']=_[_0xa8bd('0xb')](config[_0xa8bd('0xc')],{'host':_0xa8bd('0xd'),'port':0x18eb});var socket=require(_0xa8bd('0xe'))(new Redis(config[_0xa8bd('0xc')]));require('./chatGroup.socket')[_0xa8bd('0xf')](socket);function respondWithRpcPromise(_0x47316a,_0x8253b4,_0x3bcc02){return new BPromise(function(_0x56dba9,_0xbff49b){return client[_0xa8bd('0x10')](_0x47316a,_0x3bcc02)['then'](function(_0x141d4f){logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,_0xa8bd('0x13'));logger[_0xa8bd('0x14')](_0xa8bd('0x15'),_0x8253b4,_0xa8bd('0x13'),JSON[_0xa8bd('0x16')](_0x141d4f));if(_0x141d4f[_0xa8bd('0x17')]){if(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x18')]===0x1f4){logger[_0xa8bd('0x17')](_0xa8bd('0x12'),_0x8253b4,_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);return _0xbff49b(_0x141d4f['error'][_0xa8bd('0x19')]);}logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x141d4f['error']['message']);return _0x56dba9(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);}else{logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,'request\x20sent');_0x56dba9(_0x141d4f[_0xa8bd('0x1a')]['message']);}})['catch'](function(_0x57bdeb){logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x57bdeb);_0xbff49b(_0x57bdeb);});});} \ No newline at end of file +var _0xef89=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x4974f1,_0x2ec84f){var _0x190b73=function(_0x16e562){while(--_0x16e562){_0x4974f1['push'](_0x4974f1['shift']());}};_0x190b73(++_0x2ec84f);}(_0xef89,0xf6));var _0x9ef8=function(_0x588480,_0x39b0b5){_0x588480=_0x588480-0x0;var _0x68ae0d=_0xef89[_0x588480];return _0x68ae0d;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var moment=require(_0x9ef8('0x2'));var BPromise=require(_0x9ef8('0x3'));var rs=require(_0x9ef8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ef8('0x5'))['db'];var utils=require(_0x9ef8('0x6'));var logger=require(_0x9ef8('0x7'))(_0x9ef8('0x8'));var config=require(_0x9ef8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9ef8('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9ef8('0xb')],{'host':_0x9ef8('0xc'),'port':0x18eb});var socket=require(_0x9ef8('0xd'))(new Redis(config[_0x9ef8('0xb')]));require(_0x9ef8('0xe'))[_0x9ef8('0xf')](socket);function respondWithRpcPromise(_0x3c13e7,_0x4fc3b1,_0x6ccc67){return new BPromise(function(_0x49dc9c,_0x556c62){return client[_0x9ef8('0x10')](_0x3c13e7,_0x6ccc67)[_0x9ef8('0x11')](function(_0x5269f9){logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));logger[_0x9ef8('0x15')](_0x9ef8('0x16'),_0x4fc3b1,_0x9ef8('0x14'),JSON['stringify'](_0x5269f9));if(_0x5269f9['error']){if(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x18')]===0x1f4){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x556c62(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x49dc9c(_0x5269f9[_0x9ef8('0x17')]['message']);}else{logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));_0x49dc9c(_0x5269f9['result']['message']);}})[_0x9ef8('0x1a')](function(_0xd01fd9){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0xd01fd9);_0x556c62(_0xd01fd9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2c95cd4..93c5ef3 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 _0xcd29=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xcd29,0x16b));var _0x9cd2=function(_0x38f9b3,_0x1b7191){_0x38f9b3=_0x38f9b3-0x0;var _0x41b711=_0xcd29[_0x38f9b3];return _0x41b711;};'use strict';var ChatGroupEvents=require(_0x9cd2('0x0'));var events=[_0x9cd2('0x1'),_0x9cd2('0x2'),'update'];function createListener(_0x24f023,_0x291163){return function(_0x204b77){_0x291163[_0x9cd2('0x3')](_0x24f023,_0x204b77);};}function removeListener(_0x27a31c,_0x241740){return function(){ChatGroupEvents[_0x9cd2('0x4')](_0x27a31c,_0x241740);};}exports[_0x9cd2('0x5')]=function(_0x1ac6ab){for(var _0x1ad7f8=0x0,_0x3a888a=events[_0x9cd2('0x6')];_0x1ad7f8<_0x3a888a;_0x1ad7f8++){var _0x2e781d=events[_0x1ad7f8];var _0x284fc3=createListener(_0x9cd2('0x7')+_0x2e781d,_0x1ac6ab);ChatGroupEvents['on'](_0x2e781d,_0x284fc3);}}; \ No newline at end of file +var _0x84a5=['update','emit','removeListener','length','./chatGroup.events','save','remove'];(function(_0x4c6fa0,_0x15d3b7){var _0x318edc=function(_0x16c299){while(--_0x16c299){_0x4c6fa0['push'](_0x4c6fa0['shift']());}};_0x318edc(++_0x15d3b7);}(_0x84a5,0x15b));var _0x584a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x84a5[_0x2dadb9];return _0x2f0097;};'use strict';var ChatGroupEvents=require(_0x584a('0x0'));var events=[_0x584a('0x1'),_0x584a('0x2'),_0x584a('0x3')];function createListener(_0x1f6c07,_0x257ee7){return function(_0x917934){_0x257ee7[_0x584a('0x4')](_0x1f6c07,_0x917934);};}function removeListener(_0x4ced06,_0x14e677){return function(){ChatGroupEvents[_0x584a('0x5')](_0x4ced06,_0x14e677);};}exports['register']=function(_0xe39248){for(var _0x22205a=0x0,_0x4c7618=events[_0x584a('0x6')];_0x22205a<_0x4c7618;_0x22205a++){var _0x4b6e55=events[_0x22205a];var _0x41a1ff=createListener('chatGroup:'+_0x4b6e55,_0xe39248);ChatGroupEvents['on'](_0x4b6e55,_0x41a1ff);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 92b9c24..2c9902c 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 _0x2c31=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','update','destroy','multer','util'];(function(_0x2ed005,_0x25abd0){var _0xc46288=function(_0x31d9bc){while(--_0x31d9bc){_0x2ed005['push'](_0x2ed005['shift']());}};_0xc46288(++_0x25abd0);}(_0x2c31,0x17e));var _0x12c3=function(_0x1c02e4,_0x1e1fbb){_0x1c02e4=_0x1c02e4-0x0;var _0x446869=_0x2c31[_0x1c02e4];return _0x446869;};'use strict';var multer=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var path=require(_0x12c3('0x2'));var timeout=require(_0x12c3('0x3'));var express=require(_0x12c3('0x4'));var router=express['Router']();var fs_extra=require(_0x12c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x12c3('0x6'));var config=require(_0x12c3('0x7'));var controller=require(_0x12c3('0x8'));router[_0x12c3('0x9')]('/',auth[_0x12c3('0xa')](),controller[_0x12c3('0xb')]);router[_0x12c3('0x9')](_0x12c3('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x12c3('0xa')](),controller[_0x12c3('0xd')]);router[_0x12c3('0x9')]('/:id/unread',auth[_0x12c3('0xa')](),controller['getUnread']);router[_0x12c3('0x9')](_0x12c3('0xe'),auth[_0x12c3('0xa')](),controller['getMembers']);router[_0x12c3('0x9')](_0x12c3('0xf'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x10')]);router[_0x12c3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x12c3('0x11')]('/:id/members',auth[_0x12c3('0xa')](),controller[_0x12c3('0x12')]);router[_0x12c3('0x11')](_0x12c3('0xf'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x13')]);router[_0x12c3('0x14')](_0x12c3('0x15'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x16')]);router['delete'](_0x12c3('0x15'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x17')]);router['delete'](_0x12c3('0xe'),auth[_0x12c3('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x1cc7=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','delete','destroy','removeMembers','multer'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1cc7,0x1d3));var _0x71cc=function(_0x44bb25,_0x11524d){_0x44bb25=_0x44bb25-0x0;var _0x55a226=_0x1cc7[_0x44bb25];return _0x55a226;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x71cc('0x3'));var router=express[_0x71cc('0x4')]();var fs_extra=require(_0x71cc('0x5'));var auth=require(_0x71cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x71cc('0x7'));var controller=require(_0x71cc('0x8'));router[_0x71cc('0x9')]('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0xb')]);router[_0x71cc('0x9')]('/describe',auth[_0x71cc('0xa')](),controller[_0x71cc('0xc')]);router[_0x71cc('0x9')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['show']);router[_0x71cc('0x9')](_0x71cc('0xe'),auth[_0x71cc('0xa')](),controller[_0x71cc('0xf')]);router[_0x71cc('0x9')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller['getMembers']);router[_0x71cc('0x9')](_0x71cc('0x11'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x12')]);router['post']('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0x13')]);router[_0x71cc('0x14')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x15')]);router[_0x71cc('0x14')]('/:id/messages',auth[_0x71cc('0xa')](),controller[_0x71cc('0x16')]);router['put'](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['update']);router[_0x71cc('0x17')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x18')]);router[_0x71cc('0x17')](_0x71cc('0x10'),auth['isAuthenticated'](),controller[_0x71cc('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 327eded..da0fed3 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 _0x14b7=['TEXT','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x132aed,_0x28d93c){var _0xc28b5f=function(_0x3055c2){while(--_0x3055c2){_0x132aed['push'](_0x132aed['shift']());}};_0xc28b5f(++_0x28d93c);}(_0x14b7,0x144));var _0x714b=function(_0x55c97d,_0x228ffc){_0x55c97d=_0x55c97d-0x0;var _0x1d5112=_0x14b7[_0x55c97d];return _0x1d5112;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'closed':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x714b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x714b('0x4'),_0x714b('0x5')),'defaultValue':_0x714b('0x4')},'ratingMessage':{'type':Sequelize[_0x714b('0x6')]},'pathTranscript':{'type':Sequelize[_0x714b('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x714b('0x7')]},'secondDisposition':{'type':Sequelize[_0x714b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x714b('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x714b('0x7')]},'browserVersion':{'type':Sequelize[_0x714b('0x7')]},'osName':{'type':Sequelize[_0x714b('0x7')]},'osVersion':{'type':Sequelize[_0x714b('0x7')]},'deviceModel':{'type':Sequelize[_0x714b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x714b('0x7')]},'referer':{'type':Sequelize[_0x714b('0x6')]},'customerIp':{'type':Sequelize[_0x714b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x714b('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x714b('0x9')]('in',_0x714b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x714b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x714b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xac4a=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','long','DATE','sequelize'];(function(_0x3d9afb,_0x549bf2){var _0x4b5c8a=function(_0x84d231){while(--_0x84d231){_0x3d9afb['push'](_0x3d9afb['shift']());}};_0x4b5c8a(++_0x549bf2);}(_0xac4a,0x13f));var _0xaac4=function(_0x25f17b,_0x2fbffc){_0x25f17b=_0x25f17b-0x0;var _0xc345d=_0xac4a[_0x25f17b];return _0xc345d;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'closed':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaac4('0x3')]},'ratingType':{'type':Sequelize[_0xaac4('0x4')](_0xaac4('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xaac4('0x6')]},'pathTranscript':{'type':Sequelize[_0xaac4('0x6')]},'mailTranscript':{'type':Sequelize[_0xaac4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xaac4('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaac4('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xaac4('0x7')]},'browserVersion':{'type':Sequelize[_0xaac4('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xaac4('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xaac4('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xaac4('0x6')](_0xaac4('0x8'))},'read1stAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xaac4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xaac4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xaac4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 16169e4..2048d23 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 _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52be73,_0x1b4cbd){_0x52be73=_0x52be73-0x0;var _0x26f66a=_0x5f2f[_0x52be73];return _0x26f66a;};'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 pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('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',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));}; \ No newline at end of file +var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x238d89,_0x35530b){_0x238d89=_0x238d89-0x0;var _0x55e6e9=_0x9ffd[_0x238d89];return _0x55e6e9;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0931070..585434d 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 _0x1bda=['ChatMessage','setMaxListeners','save','update','setDataValue','map','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0x1bda,0xed));var _0xa1bd=function(_0x4ae6f5,_0x3b7de0){_0x4ae6f5=_0x4ae6f5-0x0;var _0x45e3d1=_0x1bda[_0x4ae6f5];return _0x45e3d1;};'use strict';var EventEmitter=require(_0xa1bd('0x0'));var ChatInteraction=require(_0xa1bd('0x1'))['db'][_0xa1bd('0x2')];var ChatMessage=require(_0xa1bd('0x1'))['db'][_0xa1bd('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa1bd('0x4')](0x0);var events={'afterCreate':_0xa1bd('0x5'),'afterUpdate':_0xa1bd('0x6'),'afterDestroy':'remove'};function emitEvent(_0x59243e){return function(_0x29ed30,_0x2f0a52,_0x4cc87c){_0x29ed30['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x311d92){_0x29ed30[_0xa1bd('0x7')]('Users',_0x311d92[_0xa1bd('0x8')](function(_0x54c280){return{'id':_0x54c280['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x29ed30['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1bd('0x9')](function(_0x3600a8){_0x29ed30[_0xa1bd('0x7')](_0xa1bd('0xa'),_0x3600a8[_0xa1bd('0xb')]);ChatInteractionEvents[_0xa1bd('0xc')](_0x59243e+':'+_0x29ed30['id'],_0x29ed30);ChatInteractionEvents[_0xa1bd('0xc')](_0x59243e,_0x29ed30);_0x4cc87c(null);})[_0xa1bd('0xd')](_0x4cc87c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xa1bd('0xe')](e,emitEvent(event));}}module[_0xa1bd('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xd0ab=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x22da00,_0x305396){var _0x4fe74c=function(_0x1a9e95){while(--_0x1a9e95){_0x22da00['push'](_0x22da00['shift']());}};_0x4fe74c(++_0x305396);}(_0xd0ab,0xdc));var _0xbd0a=function(_0x34db4b,_0x3813c9){_0x34db4b=_0x34db4b-0x0;var _0xc2ff2f=_0xd0ab[_0x34db4b];return _0xc2ff2f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbd0a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbd0a('0x0'))['db'][_0xbd0a('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbd0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd0a('0x3'),'afterDestroy':_0xbd0a('0x4')};function emitEvent(_0xaec08b){return function(_0x5531f8,_0x35361d,_0x433725){_0x5531f8[_0xbd0a('0x5')]({'attributes':['id'],'raw':!![]})[_0xbd0a('0x6')](function(_0x4202ba){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0x8'),_0x4202ba[_0xbd0a('0x9')](function(_0x15406e){return{'id':_0x15406e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5531f8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd0a('0x6')](function(_0x455528){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0xa'),_0x455528[_0xbd0a('0xb')]);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b+':'+_0x5531f8['id'],_0x5531f8);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b,_0x5531f8);_0x433725(null);})['catch'](_0x433725(null));};}for(var e in events){if(events[_0xbd0a('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xbd0a('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e3c93e4..4fa8a78 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 _0x2ac2=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x30d967,_0x26f848){var _0x25d257=function(_0x1fabc3){while(--_0x1fabc3){_0x30d967['push'](_0x30d967['shift']());}};_0x25d257(++_0x26f848);}(_0x2ac2,0x148));var _0x22ac=function(_0x128440,_0xeaccfa){_0x128440=_0x128440-0x0;var _0x3cb264=_0x2ac2[_0x128440];return _0x3cb264;};'use strict';var _=require(_0x22ac('0x0'));var util=require(_0x22ac('0x1'));var logger=require(_0x22ac('0x2'))(_0x22ac('0x3'));var moment=require('moment');var BPromise=require(_0x22ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22ac('0x5'));var rimraf=require(_0x22ac('0x6'));var config=require(_0x22ac('0x7'));var attributes=require(_0x22ac('0x8'));module[_0x22ac('0x9')]=function(_0x4ee91e,_0x400ef9){return _0x4ee91e[_0x22ac('0xa')](_0x22ac('0xb'),attributes,{'tableName':_0x22ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa700aa,_0x47dce0,_0xbc0372){if(_0xa700aa['changed'](_0x22ac('0xd'))){_0xa700aa[_0x22ac('0xe')]=moment()[_0x22ac('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xbc0372(null,_0xa700aa);}},'charset':_0x22ac('0x10'),'collate':_0x22ac('0x11')});}; \ No newline at end of file +var _0x3c30=['moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','changed','closed','closedAt','format','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3c30,0x65));var _0x03c3=function(_0x933e49,_0x44f455){_0x933e49=_0x933e49-0x0;var _0x5e1f1f=_0x3c30[_0x933e49];return _0x5e1f1f;};'use strict';var _=require('lodash');var util=require(_0x03c3('0x0'));var logger=require(_0x03c3('0x1'))(_0x03c3('0x2'));var moment=require(_0x03c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x03c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x03c3('0x5'));var attributes=require(_0x03c3('0x6'));module[_0x03c3('0x7')]=function(_0x4a7552,_0x32b236){return _0x4a7552['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fecd3,_0x1e8bda,_0x3f10e7){if(_0x1fecd3[_0x03c3('0x8')](_0x03c3('0x9'))){_0x1fecd3[_0x03c3('0xa')]=moment()[_0x03c3('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f10e7(null,_0x1fecd3);}},'charset':'utf8mb4','collate':_0x03c3('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a112c9b..93f86e3 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 _0x087f=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','ids','omit','spread','AddTags'];(function(_0x36fbf3,_0x32aace){var _0x1536e2=function(_0x547d3a){while(--_0x547d3a){_0x36fbf3['push'](_0x36fbf3['shift']());}};_0x1536e2(++_0x32aace);}(_0x087f,0x183));var _0xf087=function(_0x5bc5fa,_0x476c67){_0x5bc5fa=_0x5bc5fa-0x0;var _0x5c2179=_0x087f[_0x5bc5fa];return _0x5c2179;};'use strict';var _=require(_0xf087('0x0'));var util=require('util');var moment=require(_0xf087('0x1'));var BPromise=require(_0xf087('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf087('0x3'));var db=require(_0xf087('0x4'))['db'];var utils=require(_0xf087('0x5'));var logger=require(_0xf087('0x6'))(_0xf087('0x7'));var config=require(_0xf087('0x8'));var jayson=require(_0xf087('0x9'));var client=jayson[_0xf087('0xa')][_0xf087('0xb')]({'port':0x232a});config['redis']=_[_0xf087('0xc')](config['redis'],{'host':_0xf087('0xd'),'port':0x18eb});var socket=require(_0xf087('0xe'))(new Redis(config['redis']));require(_0xf087('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e4b4b,_0x5dbd50,_0x147288){return new BPromise(function(_0x5dba16,_0x27f0ef){return client[_0xf087('0x10')](_0x1e4b4b,_0x147288)[_0xf087('0x11')](function(_0x43b0ae){logger['info'](_0xf087('0x12'),_0x5dbd50,_0xf087('0x13'));logger[_0xf087('0x14')](_0xf087('0x15'),_0x5dbd50,_0xf087('0x13'),JSON[_0xf087('0x16')](_0x43b0ae));if(_0x43b0ae['error']){if(_0x43b0ae['error'][_0xf087('0x17')]===0x1f4){logger[_0xf087('0x18')](_0xf087('0x12'),_0x5dbd50,_0x43b0ae['error'][_0xf087('0x19')]);return _0x27f0ef(_0x43b0ae[_0xf087('0x18')]['message']);}logger['error'](_0xf087('0x12'),_0x5dbd50,_0x43b0ae[_0xf087('0x18')][_0xf087('0x19')]);return _0x5dba16(_0x43b0ae[_0xf087('0x18')][_0xf087('0x19')]);}else{logger[_0xf087('0x1a')](_0xf087('0x12'),_0x5dbd50,_0xf087('0x13'));_0x5dba16(_0x43b0ae[_0xf087('0x1b')]['message']);}})['catch'](function(_0xf04f5a){logger['error'](_0xf087('0x12'),_0x5dbd50,_0xf04f5a);_0x27f0ef(_0xf04f5a);});});}exports[_0xf087('0x1c')]=function(_0x30828d){var _0x27e5d8=this;return new Promise(function(_0xece0e2,_0xea9128){return db[_0xf087('0x1d')][_0xf087('0x1e')](_0x30828d[_0xf087('0x1f')],{'raw':_0x30828d[_0xf087('0x20')]?_0x30828d[_0xf087('0x20')][_0xf087('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30828d[_0xf087('0x20')]?_0x30828d[_0xf087('0x20')][_0xf087('0x22')]||null:null,'attributes':_0x30828d[_0xf087('0x20')]?_0x30828d['options'][_0xf087('0x23')]||null:null,'limit':_0x30828d['options']?_0x30828d[_0xf087('0x20')]['limit']||null:null})[_0xf087('0x11')](function(_0x2f0182){logger[_0xf087('0x1a')](_0xf087('0x1c'),_0x30828d);logger[_0xf087('0x14')](_0xf087('0x1c'),_0x30828d,JSON[_0xf087('0x16')](_0x2f0182));_0xece0e2(_0x2f0182);})[_0xf087('0x24')](function(_0x1a6e18){logger[_0xf087('0x18')]('UpdateChatInteraction',_0x1a6e18[_0xf087('0x19')],_0x30828d);_0xea9128(_0x27e5d8[_0xf087('0x18')](0x1f4,_0x1a6e18[_0xf087('0x19')]));});});};exports[_0xf087('0x25')]=function(_0x8839a){return new Promise(function(_0x36c6b5,_0x43bc32){return db[_0xf087('0x1d')][_0xf087('0x26')]({'where':_0x8839a['options']?_0x8839a[_0xf087('0x20')][_0xf087('0x22')]||null:null})[_0xf087('0x11')](function(_0x4c8ffc){if(_0x4c8ffc){return _0x4c8ffc['addTags'](_0x8839a['body'][_0xf087('0x27')],_[_0xf087('0x28')](_0x8839a[_0xf087('0x1f')],[_0xf087('0x27'),'id'])||{});}})[_0xf087('0x29')](function(_0xc1688d){logger['info']('AddTags',_0x8839a);logger[_0xf087('0x14')](_0xf087('0x2a'),_0x8839a,JSON[_0xf087('0x16')](_0xc1688d));_0x36c6b5(_0xc1688d);})['catch'](function(_0x473968){logger[_0xf087('0x18')](_0xf087('0x2a'),_0x473968['message'],_0x8839a);_0x43bc32(_this['error'](0x1f4,_0x473968[_0xf087('0x19')]));});});}; \ No newline at end of file +var _0x2889=['stringify','error','message','result','ChatInteraction','update','body','options','raw','attributes','limit','then','info','UpdateChatInteraction','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0xe0be82,_0x1ee7fd){var _0x4ad171=function(_0x3ff89d){while(--_0x3ff89d){_0xe0be82['push'](_0xe0be82['shift']());}};_0x4ad171(++_0x1ee7fd);}(_0x2889,0x1ef));var _0x9288=function(_0x2b9e11,_0x1e1f09){_0x2b9e11=_0x2b9e11-0x0;var _0x25f732=_0x2889[_0x2b9e11];return _0x25f732;};'use strict';var _=require(_0x9288('0x0'));var util=require('util');var moment=require(_0x9288('0x1'));var BPromise=require(_0x9288('0x2'));var rs=require(_0x9288('0x3'));var fs=require('fs');var Redis=require(_0x9288('0x4'));var db=require(_0x9288('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9288('0x6'));var config=require(_0x9288('0x7'));var jayson=require(_0x9288('0x8'));var client=jayson[_0x9288('0x9')][_0x9288('0xa')]({'port':0x232a});config['redis']=_[_0x9288('0xb')](config[_0x9288('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9288('0xd'))(new Redis(config['redis']));require(_0x9288('0xe'))[_0x9288('0xf')](socket);function respondWithRpcPromise(_0x3757c3,_0x3c067f,_0x2757b7){return new BPromise(function(_0x5a72cc,_0x11da64){return client[_0x9288('0x10')](_0x3757c3,_0x2757b7)['then'](function(_0x30b71f){logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));logger[_0x9288('0x13')](_0x9288('0x14'),_0x3c067f,_0x9288('0x12'),JSON[_0x9288('0x15')](_0x30b71f));if(_0x30b71f['error']){if(_0x30b71f[_0x9288('0x16')]['code']===0x1f4){logger['error'](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')]['message']);return _0x11da64(_0x30b71f['error'][_0x9288('0x17')]);}logger[_0x9288('0x16')](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);return _0x5a72cc(_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);}else{logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));_0x5a72cc(_0x30b71f[_0x9288('0x18')][_0x9288('0x17')]);}})['catch'](function(_0x1d7fd2){logger[_0x9288('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3c067f,_0x1d7fd2);_0x11da64(_0x1d7fd2);});});}exports['UpdateChatInteraction']=function(_0x3df2a8){var _0x539c4c=this;return new Promise(function(_0x1cd999,_0x17c96d){return db[_0x9288('0x19')][_0x9288('0x1a')](_0x3df2a8[_0x9288('0x1b')],{'raw':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8['options'][_0x9288('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')]['where']||null:null,'attributes':_0x3df2a8['options']?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1e')]||null:null,'limit':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1f')]||null:null})[_0x9288('0x20')](function(_0x469bf1){logger[_0x9288('0x21')](_0x9288('0x22'),_0x3df2a8);logger[_0x9288('0x13')](_0x9288('0x22'),_0x3df2a8,JSON['stringify'](_0x469bf1));_0x1cd999(_0x469bf1);})[_0x9288('0x23')](function(_0x528567){logger[_0x9288('0x16')](_0x9288('0x22'),_0x528567['message'],_0x3df2a8);_0x17c96d(_0x539c4c[_0x9288('0x16')](0x1f4,_0x528567[_0x9288('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x36b372){return new Promise(function(_0x2650dc,_0x12ff1d){return db[_0x9288('0x19')][_0x9288('0x24')]({'where':_0x36b372[_0x9288('0x1c')]?_0x36b372['options'][_0x9288('0x25')]||null:null})[_0x9288('0x20')](function(_0x3dd206){if(_0x3dd206){return _0x3dd206[_0x9288('0x26')](_0x36b372['body'][_0x9288('0x27')],_[_0x9288('0x28')](_0x36b372[_0x9288('0x1b')],[_0x9288('0x27'),'id'])||{});}})[_0x9288('0x29')](function(_0x542d25){logger[_0x9288('0x21')](_0x9288('0x2a'),_0x36b372);logger[_0x9288('0x13')]('AddTags',_0x36b372,JSON['stringify'](_0x542d25));_0x2650dc(_0x542d25);})[_0x9288('0x23')](function(_0x48daef){logger['error'](_0x9288('0x2a'),_0x48daef[_0x9288('0x17')],_0x36b372);_0x12ff1d(_this[_0x9288('0x16')](0x1f4,_0x48daef['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 742e263..b420d9f 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 _0x6d50=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x1fcbf6,_0x5d66f0){var _0x8e8040=function(_0x4ecd81){while(--_0x4ecd81){_0x1fcbf6['push'](_0x1fcbf6['shift']());}};_0x8e8040(++_0x5d66f0);}(_0x6d50,0x1a6));var _0x06d5=function(_0x5531be,_0x19ae37){_0x5531be=_0x5531be-0x0;var _0x233584=_0x6d50[_0x5531be];return _0x233584;};'use strict';var ChatInteractionEvents=require(_0x06d5('0x0'));var events=[_0x06d5('0x1'),'remove',_0x06d5('0x2')];function createListener(_0x541606,_0x5b6269){return function(_0x1d5146){_0x5b6269[_0x06d5('0x3')](_0x541606,_0x1d5146);};}function removeListener(_0xddf577,_0x43b3fd){return function(){ChatInteractionEvents[_0x06d5('0x4')](_0xddf577,_0x43b3fd);};}exports[_0x06d5('0x5')]=function(_0x25cb32){for(var _0x3940ef=0x0,_0x2a2d3b=events[_0x06d5('0x6')];_0x3940ef<_0x2a2d3b;_0x3940ef++){var _0x459677=events[_0x3940ef];var _0xf81756=createListener(_0x06d5('0x7')+_0x459677,_0x25cb32);ChatInteractionEvents['on'](_0x459677,_0xf81756);}}; \ No newline at end of file +var _0xe211=['save','remove','emit','removeListener','./chatInteraction.events'];(function(_0x464b39,_0x8dad8f){var _0x589f5c=function(_0x4eb81b){while(--_0x4eb81b){_0x464b39['push'](_0x464b39['shift']());}};_0x589f5c(++_0x8dad8f);}(_0xe211,0x19e));var _0x1e21=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe211[_0x14add3];return _0x4a174f;};'use strict';var ChatInteractionEvents=require(_0x1e21('0x0'));var events=[_0x1e21('0x1'),_0x1e21('0x2'),'update'];function createListener(_0x888798,_0x4e73bb){return function(_0x3acd1d){_0x4e73bb[_0x1e21('0x3')](_0x888798,_0x3acd1d);};}function removeListener(_0x4a96e2,_0x4a3a08){return function(){ChatInteractionEvents[_0x1e21('0x4')](_0x4a96e2,_0x4a3a08);};}exports['register']=function(_0x34338b){for(var _0x11a3b3=0x0,_0x508996=events['length'];_0x11a3b3<_0x508996;_0x11a3b3++){var _0x393ab0=events[_0x11a3b3];var _0x337142=createListener('chatInteraction:'+_0x393ab0,_0x34338b);ChatInteractionEvents['on'](_0x393ab0,_0x337142);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 080be57..488f7b5 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 _0xb59b=['describe','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','root','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','/:id','chat','chatinteraction:update','update','/:id/custom_update','put','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x4c0b23,_0x474c1c){var _0x3a06f0=function(_0x340837){while(--_0x340837){_0x4c0b23['push'](_0x4c0b23['shift']());}};_0x3a06f0(++_0x474c1c);}(_0xb59b,0x18c));var _0xbb59=function(_0x25cb66,_0x11b7ce){_0x25cb66=_0x25cb66-0x0;var _0x3b805d=_0xb59b[_0x25cb66];return _0x3b805d;};'use strict';var multer=require('multer');var util=require(_0xbb59('0x0'));var path=require(_0xbb59('0x1'));var timeout=require(_0xbb59('0x2'));var express=require(_0xbb59('0x3'));var router=express[_0xbb59('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb59('0x5'));var interaction=require(_0xbb59('0x6'));var config=require('../../config/environment');var controller=require(_0xbb59('0x7'));router[_0xbb59('0x8')]('/',auth[_0xbb59('0x9')](),controller[_0xbb59('0xa')]);router['get'](_0xbb59('0xb'),auth[_0xbb59('0x9')](),controller[_0xbb59('0xc')]);router[_0xbb59('0x8')]('/:id',auth[_0xbb59('0xd')](),controller[_0xbb59('0xe')]);router['get'](_0xbb59('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xbb59('0x8')]('/:id/messages',auth[_0xbb59('0x9')](),controller[_0xbb59('0x10')]);router['get'](_0xbb59('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xbb59('0x12')]);router[_0xbb59('0x8')](_0xbb59('0x13'),auth[_0xbb59('0x9')](),controller[_0xbb59('0x14')]);router[_0xbb59('0x15')]('/',auth[_0xbb59('0x9')](),controller['create']);router[_0xbb59('0x15')](_0xbb59('0x16'),auth[_0xbb59('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1754ba,_0x5d5b42,_0x57e0b1){_0x57e0b1(null,path['join'](config[_0xbb59('0x17')],'server/files/attachments/'));},'filename':function(_0x49869e,_0x843bb0,_0xbd4de3){_0xbd4de3(null,util['format'](_0xbb59('0x18'),Date[_0xbb59('0x19')](),_0x843bb0[_0xbb59('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb59('0x15')](_0xbb59('0x1b'),upload[_0xbb59('0x1c')](_0xbb59('0x1d')),controller[_0xbb59('0x1e')]);router[_0xbb59('0x15')]('/:id/messages',auth[_0xbb59('0xd')](),controller[_0xbb59('0x1f')]);router['post'](_0xbb59('0x20'),auth['isAuthenticated'](),interaction[_0xbb59('0x21')]('chat',_0xbb59('0x22')),controller[_0xbb59('0x23')]);router['put'](_0xbb59('0x24'),auth[_0xbb59('0x9')](),interaction[_0xbb59('0x21')](_0xbb59('0x25'),_0xbb59('0x26')),controller[_0xbb59('0x27')]);router['put'](_0xbb59('0x28'),controller['customUpdate']);router[_0xbb59('0x29')](_0xbb59('0x2a'),auth[_0xbb59('0xd')](),controller[_0xbb59('0x2b')]);router[_0xbb59('0x29')](_0xbb59('0x2c'),controller[_0xbb59('0x2d')]);router['delete']('/:id',auth[_0xbb59('0x9')](),interaction['tracked']('chat',_0xbb59('0x2e')),controller[_0xbb59('0x2f')]);router[_0xbb59('0x30')]('/:id/tags',auth[_0xbb59('0x9')](),controller[_0xbb59('0x31')]);module[_0xbb59('0x32')]=router; \ No newline at end of file +var _0xd093=['/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x3f6c2d,_0x7d0ae8){var _0x432ea9=function(_0x174a16){while(--_0x174a16){_0x3f6c2d['push'](_0x3f6c2d['shift']());}};_0x432ea9(++_0x7d0ae8);}(_0xd093,0x15c));var _0x3d09=function(_0x3f53e6,_0x4c4739){_0x3f53e6=_0x3f53e6-0x0;var _0x845321=_0xd093[_0x3f53e6];return _0x845321;};'use strict';var multer=require(_0x3d09('0x0'));var util=require('util');var path=require(_0x3d09('0x1'));var timeout=require(_0x3d09('0x2'));var express=require(_0x3d09('0x3'));var router=express[_0x3d09('0x4')]();var fs_extra=require(_0x3d09('0x5'));var auth=require(_0x3d09('0x6'));var interaction=require(_0x3d09('0x7'));var config=require(_0x3d09('0x8'));var controller=require('./chatInteraction.controller');router[_0x3d09('0x9')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0xb')]);router[_0x3d09('0x9')](_0x3d09('0xc'),auth[_0x3d09('0xa')](),controller[_0x3d09('0xd')]);router[_0x3d09('0x9')](_0x3d09('0xe'),auth[_0x3d09('0xf')](),controller['show']);router['get'](_0x3d09('0x10'),auth[_0x3d09('0xf')](),controller['attachmentDownload']);router[_0x3d09('0x9')](_0x3d09('0x11'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x12')]);router[_0x3d09('0x9')](_0x3d09('0x13'),auth[_0x3d09('0xf')](),controller['getMyMessages']);router[_0x3d09('0x9')](_0x3d09('0x14'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x15')]);router[_0x3d09('0x16')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0x17')]);router[_0x3d09('0x16')]('/:id/vidaoo',auth[_0x3d09('0xa')](),controller[_0x3d09('0x18')]);var upload=multer({'storage':multer[_0x3d09('0x19')]({'destination':function(_0x400d9e,_0x2e6fa8,_0x28597e){_0x28597e(null,path[_0x3d09('0x1a')](config[_0x3d09('0x1b')],_0x3d09('0x1c')));},'filename':function(_0x8a80e2,_0xd4afdc,_0x2ef5cb){_0x2ef5cb(null,util[_0x3d09('0x1d')](_0x3d09('0x1e'),Date['now'](),_0xd4afdc[_0x3d09('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x3d09('0x20'),upload[_0x3d09('0x21')](_0x3d09('0x22')),controller[_0x3d09('0x23')]);router[_0x3d09('0x16')](_0x3d09('0x11'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x24')]);router[_0x3d09('0x16')](_0x3d09('0x25'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x28')),controller[_0x3d09('0x29')]);router['put'](_0x3d09('0xe'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x2a')),controller[_0x3d09('0x2b')]);router[_0x3d09('0x2c')](_0x3d09('0x2d'),controller['customUpdate']);router[_0x3d09('0x2c')](_0x3d09('0x2e'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x2f')]);router[_0x3d09('0x2c')](_0x3d09('0x30'),controller['close']);router['delete']('/:id',auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),'chatinteraction:destroy'),controller[_0x3d09('0x31')]);router['delete'](_0x3d09('0x25'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x32')]);module[_0x3d09('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 b4b5935..b63b540 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 _0x0b1c=['sequelize','exports','medium','BOOLEAN','INTEGER'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0x0b1c,0x109));var _0xc0b1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x0b1c[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xc0b1('0x0'));module[_0xc0b1('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc0b1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc0b1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc0b1('0x4')]}}; \ No newline at end of file +var _0x489b=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x47087a,_0x5ef3c6){var _0x28fdf1=function(_0xe1618e){while(--_0xe1618e){_0x47087a['push'](_0x47087a['shift']());}};_0x28fdf1(++_0x5ef3c6);}(_0x489b,0x15f));var _0xb489=function(_0x43a5ca,_0x279e55){_0x43a5ca=_0x43a5ca-0x0;var _0x310a4f=_0x489b[_0x43a5ca];return _0x310a4f;};'use strict';var Sequelize=require(_0xb489('0x0'));module[_0xb489('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb489('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb489('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb489('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 2b9e67e..e476f9d 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 _0x562c=['allowmessenger','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','params','intersection','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','lastLoginAt'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x562c,0x7d));var _0xc562=function(_0x1947ed,_0x30c213){_0x1947ed=_0x1947ed-0x0;var _0x435c51=_0x562c[_0x1947ed];return _0x435c51;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc562('0x0'));var jsonpatch=require(_0xc562('0x1'));var rp=require(_0xc562('0x2'));var moment=require(_0xc562('0x3'));var BPromise=require(_0xc562('0x4'));var Mustache=require(_0xc562('0x5'));var util=require('util');var path=require(_0xc562('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc562('0x7'));var fs=require('fs');var fs_extra=require(_0xc562('0x8'));var _=require(_0xc562('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc562('0xa'));var deskjs=require(_0xc562('0xb'));var toCsv=require(_0xc562('0xc'));var querystring=require(_0xc562('0xd'));var Papa=require(_0xc562('0xe'));var Redis=require('ioredis');var authService=require(_0xc562('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc562('0x10'));var logger=require('../../config/logger')(_0xc562('0x11'));var utils=require(_0xc562('0x12'));var config=require(_0xc562('0x13'));var licenseUtil=require(_0xc562('0x14'));var db=require('../../mysqldb')['db'];config[_0xc562('0x15')]=_[_0xc562('0x16')](config[_0xc562('0x15')],{'host':_0xc562('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc562('0x15')]));require('./chatInternalMessage.socket')[_0xc562('0x18')](socket);function respondWithStatusCode(_0x179439,_0x22a1f4){_0x22a1f4=_0x22a1f4||0xcc;return function(_0x3e3d7f){if(_0x3e3d7f){return _0x179439[_0xc562('0x19')](_0x22a1f4);}return _0x179439[_0xc562('0x1a')](_0x22a1f4)[_0xc562('0x1b')]();};}function respondWithResult(_0x5c82ca,_0x39bac6){_0x39bac6=_0x39bac6||0xc8;return function(_0x394789){if(_0x394789){return _0x5c82ca[_0xc562('0x1a')](_0x39bac6)['json'](_0x394789);}};}function respondWithFilteredResult(_0x3c9680,_0x69641d){return function(_0x5c6ae7){if(_0x5c6ae7){var _0x462a47=typeof _0x69641d[_0xc562('0x1c')]===_0xc562('0x1d')&&typeof _0x69641d[_0xc562('0x1e')]===_0xc562('0x1d');var _0x4bcd29=_0x5c6ae7['count'];var _0x4c9dad=_0x462a47?0x0:_0x69641d[_0xc562('0x1c')];var _0x16322f=_0x462a47?_0x5c6ae7[_0xc562('0x1f')]:_0x69641d[_0xc562('0x1c')]+_0x69641d[_0xc562('0x1e')];var _0x3fda3e;if(_0x16322f>=_0x4bcd29){_0x16322f=_0x4bcd29;_0x3fda3e=0xc8;}else{_0x3fda3e=0xce;}_0x3c9680[_0xc562('0x1a')](_0x3fda3e);return _0x3c9680[_0xc562('0x20')](_0xc562('0x21'),_0x4c9dad+'-'+_0x16322f+'/'+_0x4bcd29)[_0xc562('0x22')](_0x5c6ae7);}return null;};}function patchUpdates(_0x244450){return function(_0x333270){try{jsonpatch[_0xc562('0x23')](_0x333270,_0x244450,!![]);}catch(_0x675849){return BPromise[_0xc562('0x24')](_0x675849);}return _0x333270['save']();};}function saveUpdates(_0x4aef9f,_0xf78b49){return function(_0x43dc50){if(_0x43dc50){return _0x43dc50[_0xc562('0x25')](_0x4aef9f)['then'](function(_0x3ac1b0){return _0x3ac1b0;});}return null;};}function removeEntity(_0x118e0c,_0x164cbc){return function(_0x161660){if(_0x161660){return _0x161660[_0xc562('0x26')]()[_0xc562('0x27')](function(){_0x118e0c[_0xc562('0x1a')](0xcc)[_0xc562('0x1b')]();});}};}function handleEntityNotFound(_0x16cff1,_0x3c4ede){return function(_0x355022){if(!_0x355022){_0x16cff1['sendStatus'](0x194);}return _0x355022;};}function handleError(_0x360e72,_0x17d4a8){_0x17d4a8=_0x17d4a8||0x1f4;return function(_0x1bb21c){logger[_0xc562('0x28')](_0x1bb21c['stack']);if(_0x1bb21c[_0xc562('0x29')]){delete _0x1bb21c[_0xc562('0x29')];}_0x360e72[_0xc562('0x1a')](_0x17d4a8)[_0xc562('0x2a')](_0x1bb21c);};}exports['index']=function(_0x18403e,_0x101a13){var _0x1411a4={},_0x45799c={},_0x5c1e2d={'count':0x0,'rows':[]};var _0x50967f=_[_0xc562('0x2b')](db[_0xc562('0x2c')][_0xc562('0x2d')],function(_0x2300f4){return{'name':_0x2300f4[_0xc562('0x2e')],'type':_0x2300f4[_0xc562('0x2f')][_0xc562('0x30')]};});_0x45799c[_0xc562('0x31')]=_[_0xc562('0x2b')](_0x50967f,_0xc562('0x29'));_0x45799c[_0xc562('0x32')]=_[_0xc562('0x33')](_0x18403e['query']);_0x45799c[_0xc562('0x34')]=_['intersection'](_0x45799c['model'],_0x45799c[_0xc562('0x32')]);_0x1411a4['attributes']=_['intersection'](_0x45799c[_0xc562('0x31')],qs[_0xc562('0x35')](_0x18403e[_0xc562('0x32')][_0xc562('0x35')]));_0x1411a4[_0xc562('0x36')]=_0x1411a4[_0xc562('0x36')][_0xc562('0x37')]?_0x1411a4[_0xc562('0x36')]:_0x45799c[_0xc562('0x31')];if(!_0x18403e[_0xc562('0x32')][_0xc562('0x38')]('nolimit')){_0x1411a4['limit']=qs[_0xc562('0x1e')](_0x18403e[_0xc562('0x32')]['limit']);_0x1411a4[_0xc562('0x1c')]=qs[_0xc562('0x1c')](_0x18403e[_0xc562('0x32')]['offset']);}_0x1411a4[_0xc562('0x39')]=qs[_0xc562('0x3a')](_0x18403e[_0xc562('0x32')][_0xc562('0x3a')]);_0x1411a4['where']=qs['filters'](_[_0xc562('0x3b')](_0x18403e[_0xc562('0x32')],_0x45799c[_0xc562('0x34')]),_0x50967f);if(_0x18403e[_0xc562('0x32')][_0xc562('0x3c')]){_0x1411a4['where']=_[_0xc562('0x3d')](_0x1411a4['where'],{'$or':_['map'](_0x50967f,function(_0x26dbcd){if(_0x26dbcd['type']!=='VIRTUAL'){var _0x390876={};_0x390876[_0x26dbcd[_0xc562('0x29')]]={'$like':'%'+_0x18403e[_0xc562('0x32')][_0xc562('0x3c')]+'%'};return _0x390876;}})});}_0x1411a4=_[_0xc562('0x3d')]({},_0x1411a4,_0x18403e['options']);var _0x5f5450={'where':_0x1411a4[_0xc562('0x3e')]};return db[_0xc562('0x2c')][_0xc562('0x1f')](_0x5f5450)['then'](function(_0x2c9c83){_0x5c1e2d[_0xc562('0x1f')]=_0x2c9c83;if(_0x18403e['query'][_0xc562('0x3f')]){_0x1411a4[_0xc562('0x40')]=[{'all':!![]}];}return db[_0xc562('0x2c')][_0xc562('0x41')](_0x1411a4);})[_0xc562('0x27')](function(_0x3d93f5){_0x5c1e2d['rows']=_0x3d93f5;return _0x5c1e2d;})[_0xc562('0x27')](respondWithFilteredResult(_0x101a13,_0x1411a4))[_0xc562('0x42')](handleError(_0x101a13,null));};exports['show']=function(_0x14dff5,_0x133720){var _0xa245f5={'raw':!![],'where':{'id':_0x14dff5[_0xc562('0x43')]['id']}},_0x3469e5={};_0x3469e5[_0xc562('0x31')]=_[_0xc562('0x33')](db[_0xc562('0x2c')]['rawAttributes']);_0x3469e5['query']=_[_0xc562('0x33')](_0x14dff5[_0xc562('0x32')]);_0x3469e5[_0xc562('0x34')]=_[_0xc562('0x44')](_0x3469e5[_0xc562('0x31')],_0x3469e5[_0xc562('0x32')]);_0xa245f5['attributes']=_['intersection'](_0x3469e5[_0xc562('0x31')],qs[_0xc562('0x35')](_0x14dff5['query']['fields']));_0xa245f5[_0xc562('0x36')]=_0xa245f5[_0xc562('0x36')][_0xc562('0x37')]?_0xa245f5[_0xc562('0x36')]:_0x3469e5[_0xc562('0x31')];if(_0x14dff5[_0xc562('0x32')][_0xc562('0x3f')]){_0xa245f5['include']=[{'all':!![]}];}_0xa245f5=_[_0xc562('0x3d')]({},_0xa245f5,_0x14dff5[_0xc562('0x45')]);return db['ChatInternalMessage'][_0xc562('0x46')](_0xa245f5)['then'](handleEntityNotFound(_0x133720,null))[_0xc562('0x27')](respondWithResult(_0x133720,null))[_0xc562('0x42')](handleError(_0x133720,null));};exports[_0xc562('0x47')]=function(_0x5e908e,_0x1f8987){return db[_0xc562('0x2c')]['create'](_0x5e908e[_0xc562('0x48')],{})[_0xc562('0x27')](respondWithResult(_0x1f8987,0xc9))['catch'](handleError(_0x1f8987,null));};exports[_0xc562('0x25')]=function(_0xd1ac62,_0x32c84e){if(_0xd1ac62['body']['id']){delete _0xd1ac62[_0xc562('0x48')]['id'];}return db[_0xc562('0x2c')][_0xc562('0x46')]({'where':{'id':_0xd1ac62[_0xc562('0x43')]['id']}})[_0xc562('0x27')](handleEntityNotFound(_0x32c84e,null))[_0xc562('0x27')](saveUpdates(_0xd1ac62[_0xc562('0x48')],null))[_0xc562('0x27')](respondWithResult(_0x32c84e,null))[_0xc562('0x42')](handleError(_0x32c84e,null));};exports[_0xc562('0x26')]=function(_0x4339c2,_0x3f77aa){return db['ChatInternalMessage'][_0xc562('0x46')]({'where':{'id':_0x4339c2['params']['id']}})[_0xc562('0x27')](handleEntityNotFound(_0x3f77aa,null))[_0xc562('0x27')](removeEntity(_0x3f77aa,null))[_0xc562('0x42')](handleError(_0x3f77aa,null));};exports[_0xc562('0x49')]=function(_0x529944,_0x3438b7){return db[_0xc562('0x2c')][_0xc562('0x49')]()[_0xc562('0x27')](respondWithResult(_0x3438b7,null))[_0xc562('0x42')](handleError(_0x3438b7,null));};function wrapUser(_0x464f82){return function(_0x4344c2){var _0x27bd07=_0x464f82[_0xc562('0x4a')]({'plain':!![]});_0x27bd07[_0xc562('0x4b')]=[];if(_0x4344c2){_0x27bd07[_0xc562('0x4c')]=_0x4344c2[_0xc562('0x4d')];_0x27bd07[_0xc562('0x4e')]=_0x4344c2;}else{_0x27bd07[_0xc562('0x4c')]=moment(0x0)[_0xc562('0x4f')](_0xc562('0x50'));_0x27bd07[_0xc562('0x4e')]={};}return _0x27bd07;};}exports[_0xc562('0x51')]=function(_0x520a82,_0x10393a,_0x1dfefd){var _0x1468aa=[];return db['User'][_0xc562('0x41')]({'where':{'role':[_0xc562('0x52'),_0xc562('0x53'),'user']},'attributes':['id',_0xc562('0x54'),_0xc562('0x29'),_0xc562('0x55'),_0xc562('0x56'),_0xc562('0x57'),'online',_0xc562('0x58'),_0xc562('0x59'),_0xc562('0x5a')],'order':qs[_0xc562('0x3a')](_0xc562('0x5b')),'include':[{'model':db['VoiceQueue'],'as':_0xc562('0x5c'),'attributes':['id',_0xc562('0x29'),_0xc562('0x2f')],'through':{'attributes':[]}}]})[_0xc562('0x27')](function(_0x57536a){if(_0x57536a){var _0x45b566=_0x520a82[_0xc562('0x5d')]['get']({'plain':!![]});if(!_0x45b566)throw new Error(_0xc562('0x5e'));if(_0x45b566[_0xc562('0x55')]===_0xc562('0x5d')){return db[_0xc562('0x5f')][_0xc562('0x46')]({'where':{'name':_0xc562('0x60'),'userProfileId':_0x45b566[_0xc562('0x61')]},'raw':!![]})[_0xc562('0x27')](function(_0x3f9059){if(_0x3f9059){if(_0x3f9059[_0xc562('0x62')]===0x0){return db[_0xc562('0x63')][_0xc562('0x41')]({'where':{'sectionId':_0x3f9059['id']},'raw':!![]})['then'](function(_0x2e34dc){var _0x3fbf1f=[];if(_[_0xc562('0x64')](_0x2e34dc)){_0x3fbf1f=_[_0xc562('0x3c')](_0x57536a,function(_0x50c2){if(_0x50c2[_0xc562('0x55')]!==_0xc562('0x52')){return _0x50c2;}});return _0x3fbf1f;}else{for(var _0x2d4e6c=0x0;_0x2d4e6c<_0x57536a[_0xc562('0x37')];_0x2d4e6c++){var _0x3ede59=_0x57536a[_0x2d4e6c];if(_0x3ede59[_0xc562('0x55')]===_0xc562('0x52')){var _0x15cf0a=_[_0xc562('0x46')](_0x2e34dc,function(_0x4cd703){return _0x4cd703[_0xc562('0x65')]===_0x3ede59['id'];});if(_0x15cf0a)_0x3fbf1f[_0xc562('0x66')](_0x3ede59);}else{_0x3fbf1f[_0xc562('0x66')](_0x3ede59);}}return _0x3fbf1f;}});}else{return _0x57536a;}}else{var _0x520db6=_[_0xc562('0x3c')](_0x57536a,function(_0x4fc8a5){if(_0x4fc8a5[_0xc562('0x55')]!==_0xc562('0x52')){return _0x4fc8a5;}});return _0x520db6;}});}else{return _0x57536a;}}})[_0xc562('0x27')](function(_0x1dda8c){var _0x41303a=[];if(_0x1dda8c){_0x1468aa=_0x1dda8c;for(var _0x52ddf7=0x0;_0x52ddf7<_0x1dda8c[_0xc562('0x37')];_0x52ddf7+=0x1){_0x1468aa[_0x52ddf7][_0xc562('0x4b')]=[];_0x41303a[_0xc562('0x66')](db[_0xc562('0x2c')]['find']({'where':{'FromId':[_0x520a82[_0xc562('0x5d')]['id'],_0x1dda8c[_0x52ddf7]['id']],'ToId':[_0x520a82[_0xc562('0x5d')]['id'],_0x1dda8c[_0x52ddf7]['id']],'ChatGroupId':null},'attributes':['id',_0xc562('0x4d'),_0xc562('0x67'),_0xc562('0x68'),_0xc562('0x69'),'body'],'order':qs[_0xc562('0x3a')](_0xc562('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc562('0x27')](wrapUser(_0x1dda8c[_0x52ddf7])));}return BPromise['all'](_0x41303a);}return[];})[_0xc562('0x27')](function(_0x33dfb5){return{'rows':_0x33dfb5,'count':_0x33dfb5[_0xc562('0x37')]};})[_0xc562('0x27')](respondWithResult(_0x10393a,null))[_0xc562('0x42')](handleError(_0x10393a,null));}; \ No newline at end of file +var _0xf5bf=['params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','options','where','includeAll','include','findAll','catch','show','find','create','body'];(function(_0x195eb3,_0x59180c){var _0x36ea03=function(_0x5f583d){while(--_0x5f583d){_0x195eb3['push'](_0x195eb3['shift']());}};_0x36ea03(++_0x59180c);}(_0xf5bf,0x15d));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff5b('0x1'));var jsonpatch=require(_0xff5b('0x2'));var rp=require(_0xff5b('0x3'));var moment=require(_0xff5b('0x4'));var BPromise=require(_0xff5b('0x5'));var Mustache=require('mustache');var util=require(_0xff5b('0x6'));var path=require(_0xff5b('0x7'));var sox=require(_0xff5b('0x8'));var csv=require('to-csv');var ejs=require(_0xff5b('0x9'));var fs=require('fs');var fs_extra=require(_0xff5b('0xa'));var _=require(_0xff5b('0xb'));var squel=require('squel');var crypto=require(_0xff5b('0xc'));var jsforce=require(_0xff5b('0xd'));var deskjs=require(_0xff5b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff5b('0xf'));var Papa=require(_0xff5b('0x10'));var Redis=require(_0xff5b('0x11'));var authService=require(_0xff5b('0x12'));var qs=require(_0xff5b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff5b('0x14'));var logger=require('../../config/logger')(_0xff5b('0x15'));var utils=require(_0xff5b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff5b('0x17'))['db'];config['redis']=_[_0xff5b('0x18')](config[_0xff5b('0x19')],{'host':_0xff5b('0x1a'),'port':0x18eb});var socket=require(_0xff5b('0x1b'))(new Redis(config[_0xff5b('0x19')]));require(_0xff5b('0x1c'))[_0xff5b('0x1d')](socket);function respondWithStatusCode(_0x165ba6,_0x131c21){_0x131c21=_0x131c21||0xcc;return function(_0x1cbe53){if(_0x1cbe53){return _0x165ba6[_0xff5b('0x1e')](_0x131c21);}return _0x165ba6[_0xff5b('0x1f')](_0x131c21)[_0xff5b('0x20')]();};}function respondWithResult(_0xcc9be5,_0x3d98a7){_0x3d98a7=_0x3d98a7||0xc8;return function(_0x28acfa){if(_0x28acfa){return _0xcc9be5[_0xff5b('0x1f')](_0x3d98a7)['json'](_0x28acfa);}};}function respondWithFilteredResult(_0x3e4ed5,_0x2d12c1){return function(_0x4b90b8){if(_0x4b90b8){var _0x3abc7f=typeof _0x2d12c1[_0xff5b('0x21')]==='undefined'&&typeof _0x2d12c1[_0xff5b('0x22')]===_0xff5b('0x23');var _0x400d5e=_0x4b90b8[_0xff5b('0x24')];var _0x4ab762=_0x3abc7f?0x0:_0x2d12c1[_0xff5b('0x21')];var _0x4b3650=_0x3abc7f?_0x4b90b8[_0xff5b('0x24')]:_0x2d12c1['offset']+_0x2d12c1[_0xff5b('0x22')];var _0x5790fe;if(_0x4b3650>=_0x400d5e){_0x4b3650=_0x400d5e;_0x5790fe=0xc8;}else{_0x5790fe=0xce;}_0x3e4ed5[_0xff5b('0x1f')](_0x5790fe);return _0x3e4ed5[_0xff5b('0x25')](_0xff5b('0x26'),_0x4ab762+'-'+_0x4b3650+'/'+_0x400d5e)[_0xff5b('0x27')](_0x4b90b8);}return null;};}function patchUpdates(_0x25f9cb){return function(_0x20337e){try{jsonpatch[_0xff5b('0x28')](_0x20337e,_0x25f9cb,!![]);}catch(_0x3f9fcb){return BPromise[_0xff5b('0x29')](_0x3f9fcb);}return _0x20337e[_0xff5b('0x2a')]();};}function saveUpdates(_0x2fd738,_0x5c27ab){return function(_0x2a0dd7){if(_0x2a0dd7){return _0x2a0dd7[_0xff5b('0x2b')](_0x2fd738)['then'](function(_0x161421){return _0x161421;});}return null;};}function removeEntity(_0x506cae,_0x54e96f){return function(_0x2a2734){if(_0x2a2734){return _0x2a2734[_0xff5b('0x2c')]()[_0xff5b('0x2d')](function(){_0x506cae[_0xff5b('0x1f')](0xcc)[_0xff5b('0x20')]();});}};}function handleEntityNotFound(_0x4e9873,_0x137df3){return function(_0x15b09f){if(!_0x15b09f){_0x4e9873[_0xff5b('0x1e')](0x194);}return _0x15b09f;};}function handleError(_0x39e08e,_0x20ef59){_0x20ef59=_0x20ef59||0x1f4;return function(_0x7e1c93){logger[_0xff5b('0x2e')](_0x7e1c93['stack']);if(_0x7e1c93[_0xff5b('0x2f')]){delete _0x7e1c93['name'];}_0x39e08e[_0xff5b('0x1f')](_0x20ef59)['send'](_0x7e1c93);};}exports[_0xff5b('0x30')]=function(_0x16aa25,_0x5ce572){var _0x2e0c6b={},_0x40ee70={},_0x3884ab={'count':0x0,'rows':[]};var _0x1d287f=_[_0xff5b('0x31')](db[_0xff5b('0x32')][_0xff5b('0x33')],function(_0x92da99){return{'name':_0x92da99[_0xff5b('0x34')],'type':_0x92da99[_0xff5b('0x35')][_0xff5b('0x36')]};});_0x40ee70[_0xff5b('0x37')]=_[_0xff5b('0x31')](_0x1d287f,_0xff5b('0x2f'));_0x40ee70['query']=_[_0xff5b('0x38')](_0x16aa25['query']);_0x40ee70[_0xff5b('0x39')]=_['intersection'](_0x40ee70[_0xff5b('0x37')],_0x40ee70[_0xff5b('0x3a')]);_0x2e0c6b[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x40ee70[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2e0c6b[_0xff5b('0x3b')]=_0x2e0c6b[_0xff5b('0x3b')][_0xff5b('0x3e')]?_0x2e0c6b[_0xff5b('0x3b')]:_0x40ee70[_0xff5b('0x37')];if(!_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3f')](_0xff5b('0x40'))){_0x2e0c6b['limit']=qs[_0xff5b('0x22')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x22')]);_0x2e0c6b[_0xff5b('0x21')]=qs['offset'](_0x16aa25[_0xff5b('0x3a')]['offset']);}_0x2e0c6b[_0xff5b('0x41')]=qs[_0xff5b('0x42')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x42')]);_0x2e0c6b['where']=qs['filters'](_['pick'](_0x16aa25['query'],_0x40ee70[_0xff5b('0x39')]),_0x1d287f);if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]){_0x2e0c6b['where']=_['merge'](_0x2e0c6b['where'],{'$or':_['map'](_0x1d287f,function(_0x38f93e){if(_0x38f93e[_0xff5b('0x35')]!==_0xff5b('0x44')){var _0x129852={};_0x129852[_0x38f93e['name']]={'$like':'%'+_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]+'%'};return _0x129852;}})});}_0x2e0c6b=_['merge']({},_0x2e0c6b,_0x16aa25[_0xff5b('0x45')]);var _0x4738ad={'where':_0x2e0c6b[_0xff5b('0x46')]};return db['ChatInternalMessage'][_0xff5b('0x24')](_0x4738ad)[_0xff5b('0x2d')](function(_0x2f797b){_0x3884ab[_0xff5b('0x24')]=_0x2f797b;if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2e0c6b[_0xff5b('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xff5b('0x49')](_0x2e0c6b);})[_0xff5b('0x2d')](function(_0x4c6c18){_0x3884ab['rows']=_0x4c6c18;return _0x3884ab;})[_0xff5b('0x2d')](respondWithFilteredResult(_0x5ce572,_0x2e0c6b))[_0xff5b('0x4a')](handleError(_0x5ce572,null));};exports[_0xff5b('0x4b')]=function(_0xca66dd,_0x3c8c5e){var _0x2b96d8={'raw':!![],'where':{'id':_0xca66dd['params']['id']}},_0x511c36={};_0x511c36[_0xff5b('0x37')]=_[_0xff5b('0x38')](db['ChatInternalMessage'][_0xff5b('0x33')]);_0x511c36[_0xff5b('0x3a')]=_[_0xff5b('0x38')](_0xca66dd[_0xff5b('0x3a')]);_0x511c36['filters']=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],_0x511c36[_0xff5b('0x3a')]);_0x2b96d8[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2b96d8[_0xff5b('0x3b')]=_0x2b96d8['attributes']['length']?_0x2b96d8[_0xff5b('0x3b')]:_0x511c36[_0xff5b('0x37')];if(_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2b96d8[_0xff5b('0x48')]=[{'all':!![]}];}_0x2b96d8=_['merge']({},_0x2b96d8,_0xca66dd[_0xff5b('0x45')]);return db[_0xff5b('0x32')][_0xff5b('0x4c')](_0x2b96d8)[_0xff5b('0x2d')](handleEntityNotFound(_0x3c8c5e,null))[_0xff5b('0x2d')](respondWithResult(_0x3c8c5e,null))['catch'](handleError(_0x3c8c5e,null));};exports['create']=function(_0x5c588e,_0x195366){return db[_0xff5b('0x32')][_0xff5b('0x4d')](_0x5c588e[_0xff5b('0x4e')],{})[_0xff5b('0x2d')](respondWithResult(_0x195366,0xc9))[_0xff5b('0x4a')](handleError(_0x195366,null));};exports[_0xff5b('0x2b')]=function(_0x1b0163,_0x19cf55){if(_0x1b0163[_0xff5b('0x4e')]['id']){delete _0x1b0163[_0xff5b('0x4e')]['id'];}return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x1b0163[_0xff5b('0x4f')]['id']}})[_0xff5b('0x2d')](handleEntityNotFound(_0x19cf55,null))[_0xff5b('0x2d')](saveUpdates(_0x1b0163[_0xff5b('0x4e')],null))[_0xff5b('0x2d')](respondWithResult(_0x19cf55,null))[_0xff5b('0x4a')](handleError(_0x19cf55,null));};exports[_0xff5b('0x2c')]=function(_0x5af1d1,_0x209e87){return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x5af1d1[_0xff5b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x209e87,null))[_0xff5b('0x2d')](removeEntity(_0x209e87,null))[_0xff5b('0x4a')](handleError(_0x209e87,null));};exports[_0xff5b('0x50')]=function(_0x5bc2e6,_0x3f52fe){return db[_0xff5b('0x32')][_0xff5b('0x50')]()[_0xff5b('0x2d')](respondWithResult(_0x3f52fe,null))['catch'](handleError(_0x3f52fe,null));};function wrapUser(_0x35ab0e){return function(_0x3472a2){var _0xd32e17=_0x35ab0e[_0xff5b('0x51')]({'plain':!![]});_0xd32e17['messages']=[];if(_0x3472a2){_0xd32e17[_0xff5b('0x52')]=_0x3472a2[_0xff5b('0x53')];_0xd32e17[_0xff5b('0x54')]=_0x3472a2;}else{_0xd32e17[_0xff5b('0x52')]=moment(0x0)[_0xff5b('0x55')](_0xff5b('0x56'));_0xd32e17[_0xff5b('0x54')]={};}return _0xd32e17;};}exports['getUsers']=function(_0x543b14,_0x280b80,_0x5ec330){var _0x4301e0=[];return db[_0xff5b('0x57')][_0xff5b('0x49')]({'where':{'role':[_0xff5b('0x58'),'admin',_0xff5b('0x59')]},'attributes':['id','fullname',_0xff5b('0x2f'),_0xff5b('0x5a'),_0xff5b('0x5b'),'internal',_0xff5b('0x5c'),_0xff5b('0x5d'),_0xff5b('0x5e'),'showWebBar'],'order':qs[_0xff5b('0x42')](_0xff5b('0x5f')),'include':[{'model':db[_0xff5b('0x60')],'as':_0xff5b('0x61'),'attributes':['id',_0xff5b('0x2f'),_0xff5b('0x35')],'through':{'attributes':[]}}]})[_0xff5b('0x2d')](function(_0x286481){if(_0x286481){var _0x59a1e0=_0x543b14['user'][_0xff5b('0x51')]({'plain':!![]});if(!_0x59a1e0)throw new Error(_0xff5b('0x62'));if(_0x59a1e0['role']===_0xff5b('0x59')){return db['UserProfileSection']['find']({'where':{'name':_0xff5b('0x63'),'userProfileId':_0x59a1e0[_0xff5b('0x64')]},'raw':!![]})[_0xff5b('0x2d')](function(_0x5de466){if(_0x5de466){if(_0x5de466[_0xff5b('0x65')]===0x0){return db['UserProfileResource'][_0xff5b('0x49')]({'where':{'sectionId':_0x5de466['id']},'raw':!![]})['then'](function(_0x2adf3b){var _0x1a8fa4=[];if(_['isEmpty'](_0x2adf3b)){_0x1a8fa4=_[_0xff5b('0x43')](_0x286481,function(_0x2256d9){if(_0x2256d9['role']!==_0xff5b('0x58')){return _0x2256d9;}});return _0x1a8fa4;}else{for(var _0x5d0298=0x0;_0x5d0298<_0x286481[_0xff5b('0x3e')];_0x5d0298++){var _0x24f25e=_0x286481[_0x5d0298];if(_0x24f25e[_0xff5b('0x5a')]===_0xff5b('0x58')){var _0xccfc32=_[_0xff5b('0x4c')](_0x2adf3b,function(_0x47b4c3){return _0x47b4c3[_0xff5b('0x66')]===_0x24f25e['id'];});if(_0xccfc32)_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}else{_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}}return _0x1a8fa4;}});}else{return _0x286481;}}else{var _0x45dedf=_[_0xff5b('0x43')](_0x286481,function(_0x25400c){if(_0x25400c[_0xff5b('0x5a')]!=='agent'){return _0x25400c;}});return _0x45dedf;}});}else{return _0x286481;}}})[_0xff5b('0x2d')](function(_0x31fd25){var _0x5bed0e=[];if(_0x31fd25){_0x4301e0=_0x31fd25;for(var _0x1432dc=0x0;_0x1432dc<_0x31fd25[_0xff5b('0x3e')];_0x1432dc+=0x1){_0x4301e0[_0x1432dc]['messages']=[];_0x5bed0e['push'](db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'FromId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ToId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ChatGroupId':null},'attributes':['id',_0xff5b('0x53'),_0xff5b('0x68'),_0xff5b('0x69'),_0xff5b('0x6a'),_0xff5b('0x4e')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xff5b('0x2d')](wrapUser(_0x31fd25[_0x1432dc])));}return BPromise['all'](_0x5bed0e);}return[];})[_0xff5b('0x2d')](function(_0x197389){return{'rows':_0x197389,'count':_0x197389[_0xff5b('0x3e')]};})[_0xff5b('0x2d')](respondWithResult(_0x280b80,null))['catch'](handleError(_0x280b80,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4a95922..d207c69 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 _0x53aa=['remove','emit','hasOwnProperty','hook','ChatInternalMessage','setMaxListeners','update'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x53aa,0x6d));var _0xa53a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x53aa[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xa53a('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa53a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa53a('0x2'),'afterDestroy':_0xa53a('0x3')};function emitEvent(_0x360ab4){return function(_0x3e10a6,_0x4400bd,_0x3458a1){ChatInternalMessageEvents[_0xa53a('0x4')](_0x360ab4+':'+_0x3e10a6['id'],_0x3e10a6);ChatInternalMessageEvents[_0xa53a('0x4')](_0x360ab4,_0x3e10a6);_0x3458a1(null);};}for(var e in events){if(events[_0xa53a('0x5')](e)){var event=events[e];ChatInternalMessage[_0xa53a('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x505e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x486250,_0x316dd8){var _0x5447b2=function(_0x1d08ec){while(--_0x1d08ec){_0x486250['push'](_0x486250['shift']());}};_0x5447b2(++_0x316dd8);}(_0x505e,0x199));var _0xe505=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x505e[_0x2f62aa];return _0x1a341f;};'use strict';var EventEmitter=require(_0xe505('0x0'));var ChatInternalMessage=require(_0xe505('0x1'))['db'][_0xe505('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe505('0x3')](0x0);var events={'afterCreate':_0xe505('0x4'),'afterUpdate':_0xe505('0x5'),'afterDestroy':_0xe505('0x6')};function emitEvent(_0x19b96f){return function(_0x506b4c,_0x4ec430,_0x448d81){ChatInternalMessageEvents['emit'](_0x19b96f+':'+_0x506b4c['id'],_0x506b4c);ChatInternalMessageEvents[_0xe505('0x7')](_0x19b96f,_0x506b4c);_0x448d81(null);};}for(var e in events){if(events[_0xe505('0x8')](e)){var event=events[e];ChatInternalMessage[_0xe505('0x9')](e,emitEvent(event));}}module[_0xe505('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index f0462c4..f4b4d5a 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 _0xc30f=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','./chatInternalMessage.attributes'];(function(_0x3bc884,_0x3af23d){var _0x306ce6=function(_0x15ef60){while(--_0x15ef60){_0x3bc884['push'](_0x3bc884['shift']());}};_0x306ce6(++_0x3af23d);}(_0xc30f,0xf4));var _0xfc30=function(_0x5ef748,_0x15cb9b){_0x5ef748=_0x5ef748-0x0;var _0x106bee=_0xc30f[_0x5ef748];return _0x106bee;};'use strict';var _=require(_0xfc30('0x0'));var util=require('util');var logger=require(_0xfc30('0x1'))(_0xfc30('0x2'));var moment=require('moment');var BPromise=require(_0xfc30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc30('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfc30('0x5'));module['exports']=function(_0x5e41af,_0x1942c0){return _0x5e41af[_0xfc30('0x6')](_0xfc30('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc30('0x8'),'collate':_0xfc30('0x9')});}; \ No newline at end of file +var _0xd856=['lodash','util','../../config/logger','bluebird','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x252d53,_0x218794){var _0x560841=function(_0x379b11){while(--_0x379b11){_0x252d53['push'](_0x252d53['shift']());}};_0x560841(++_0x218794);}(_0xd856,0xdc));var _0x6d85=function(_0x596b3d,_0x2a6e03){_0x596b3d=_0x596b3d-0x0;var _0x53dda8=_0xd856[_0x596b3d];return _0x53dda8;};'use strict';var _=require(_0x6d85('0x0'));var util=require(_0x6d85('0x1'));var logger=require(_0x6d85('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d85('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d85('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x6d85('0x5')]=function(_0x392ed5,_0xec8ff6){return _0x392ed5[_0x6d85('0x6')](_0x6d85('0x7'),attributes,{'tableName':_0x6d85('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d85('0x9'),'collate':_0x6d85('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6157619..76c9371 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 _0xa7af=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5a6868,_0x4b37c2){var _0x225ed5=function(_0x3bc0d5){while(--_0x3bc0d5){_0x5a6868['push'](_0x5a6868['shift']());}};_0x225ed5(++_0x4b37c2);}(_0xa7af,0x13e));var _0xfa7a=function(_0x5628a9,_0x431158){_0x5628a9=_0x5628a9-0x0;var _0x19f4af=_0xa7af[_0x5628a9];return _0x19f4af;};'use strict';var _=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var moment=require(_0xfa7a('0x2'));var BPromise=require(_0xfa7a('0x3'));var rs=require(_0xfa7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa7a('0x5'))['db'];var utils=require(_0xfa7a('0x6'));var logger=require(_0xfa7a('0x7'))(_0xfa7a('0x8'));var config=require(_0xfa7a('0x9'));var jayson=require(_0xfa7a('0xa'));var client=jayson['client'][_0xfa7a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xfa7a('0xc'),'port':0x18eb});var socket=require(_0xfa7a('0xd'))(new Redis(config[_0xfa7a('0xe')]));require('./chatInternalMessage.socket')[_0xfa7a('0xf')](socket);function respondWithRpcPromise(_0x599969,_0x347a07,_0x9cf71a){return new BPromise(function(_0x46960e,_0x574018){return client[_0xfa7a('0x10')](_0x599969,_0x9cf71a)[_0xfa7a('0x11')](function(_0x13b0ab){logger['info'](_0xfa7a('0x12'),_0x347a07,_0xfa7a('0x13'));logger[_0xfa7a('0x14')](_0xfa7a('0x15'),_0x347a07,_0xfa7a('0x13'),JSON[_0xfa7a('0x16')](_0x13b0ab));if(_0x13b0ab[_0xfa7a('0x17')]){if(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x18')]===0x1f4){logger['error'](_0xfa7a('0x12'),_0x347a07,_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);return _0x574018(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);}logger['error'](_0xfa7a('0x12'),_0x347a07,_0x13b0ab['error']['message']);return _0x46960e(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);}else{logger[_0xfa7a('0x1a')](_0xfa7a('0x12'),_0x347a07,'request\x20sent');_0x46960e(_0x13b0ab['result'][_0xfa7a('0x19')]);}})['catch'](function(_0x567880){logger[_0xfa7a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x347a07,_0x567880);_0x574018(_0x567880);});});} \ No newline at end of file +var _0x33c1=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33c1,0x82));var _0x133c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x33c1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x133c('0x0'));var moment=require('moment');var BPromise=require(_0x133c('0x1'));var rs=require(_0x133c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133c('0x3'))['db'];var utils=require(_0x133c('0x4'));var logger=require(_0x133c('0x5'))(_0x133c('0x6'));var config=require(_0x133c('0x7'));var jayson=require(_0x133c('0x8'));var client=jayson[_0x133c('0x9')][_0x133c('0xa')]({'port':0x232a});config[_0x133c('0xb')]=_[_0x133c('0xc')](config[_0x133c('0xb')],{'host':_0x133c('0xd'),'port':0x18eb});var socket=require(_0x133c('0xe'))(new Redis(config[_0x133c('0xb')]));require(_0x133c('0xf'))[_0x133c('0x10')](socket);function respondWithRpcPromise(_0x34d536,_0x515ddf,_0x2546e7){return new BPromise(function(_0x599818,_0x4a422c){return client['request'](_0x34d536,_0x2546e7)['then'](function(_0x49909b){logger['info'](_0x133c('0x11'),_0x515ddf,_0x133c('0x12'));logger[_0x133c('0x13')](_0x133c('0x14'),_0x515ddf,_0x133c('0x12'),JSON[_0x133c('0x15')](_0x49909b));if(_0x49909b[_0x133c('0x16')]){if(_0x49909b[_0x133c('0x16')][_0x133c('0x17')]===0x1f4){logger['error'](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x4a422c(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}logger[_0x133c('0x16')](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x599818(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}else{logger[_0x133c('0x19')](_0x133c('0x11'),_0x515ddf,'request\x20sent');_0x599818(_0x49909b['result'][_0x133c('0x18')]);}})['catch'](function(_0x5c43ec){logger['error'](_0x133c('0x11'),_0x515ddf,_0x5c43ec);_0x4a422c(_0x5c43ec);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 84613a0..d2f3b09 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 _0x44b8=['remove','update','emit','register','length','chatInternalMessage:'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x44b8,0x1e6));var _0x844b=function(_0x458dc1,_0x56a907){_0x458dc1=_0x458dc1-0x0;var _0x35ab83=_0x44b8[_0x458dc1];return _0x35ab83;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x844b('0x0'),_0x844b('0x1')];function createListener(_0x4ba007,_0x426260){return function(_0xb141fa){_0x426260[_0x844b('0x2')](_0x4ba007,_0xb141fa);};}function removeListener(_0xe5ed3d,_0x3707ca){return function(){ChatInternalMessageEvents['removeListener'](_0xe5ed3d,_0x3707ca);};}exports[_0x844b('0x3')]=function(_0x19ee39){for(var _0x3eed04=0x0,_0x296392=events[_0x844b('0x4')];_0x3eed04<_0x296392;_0x3eed04++){var _0x4f2df2=events[_0x3eed04];var _0x4f38e7=createListener(_0x844b('0x5')+_0x4f2df2,_0x19ee39);ChatInternalMessageEvents['on'](_0x4f2df2,_0x4f38e7);}}; \ No newline at end of file +var _0x3abc=['save','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xee6028,_0x678569){var _0x16a6cf=function(_0x14fa6a){while(--_0x14fa6a){_0xee6028['push'](_0xee6028['shift']());}};_0x16a6cf(++_0x678569);}(_0x3abc,0xa7));var _0xc3ab=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3abc[_0xbb091];return _0x467a04;};'use strict';var ChatInternalMessageEvents=require(_0xc3ab('0x0'));var events=[_0xc3ab('0x1'),'remove',_0xc3ab('0x2')];function createListener(_0x171e80,_0x8f288e){return function(_0x153585){_0x8f288e[_0xc3ab('0x3')](_0x171e80,_0x153585);};}function removeListener(_0x163849,_0x59e4a7){return function(){ChatInternalMessageEvents[_0xc3ab('0x4')](_0x163849,_0x59e4a7);};}exports[_0xc3ab('0x5')]=function(_0x379e74){for(var _0xcfbff=0x0,_0x59e51f=events[_0xc3ab('0x6')];_0xcfbff<_0x59e51f;_0xcfbff++){var _0x3c901e=events[_0xcfbff];var _0x2be4a4=createListener(_0xc3ab('0x7')+_0x3c901e,_0x379e74);ChatInternalMessageEvents['on'](_0x3c901e,_0x2be4a4);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7b5a0c3..f17312a 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 _0x4b50=['put','/:id','update','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','getUsers','show','post','create'];(function(_0x26854d,_0x1e8768){var _0x381390=function(_0x3e5fc6){while(--_0x3e5fc6){_0x26854d['push'](_0x26854d['shift']());}};_0x381390(++_0x1e8768);}(_0x4b50,0x12f));var _0x04b5=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x4b50[_0x193e28];return _0x20ef59;};'use strict';var multer=require('multer');var util=require(_0x04b5('0x0'));var path=require(_0x04b5('0x1'));var timeout=require('connect-timeout');var express=require(_0x04b5('0x2'));var router=express[_0x04b5('0x3')]();var fs_extra=require(_0x04b5('0x4'));var auth=require(_0x04b5('0x5'));var interaction=require(_0x04b5('0x6'));var config=require(_0x04b5('0x7'));var controller=require(_0x04b5('0x8'));router[_0x04b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x04b5('0xa')]);router['get']('/describe',auth[_0x04b5('0xb')](),controller[_0x04b5('0xc')]);router[_0x04b5('0x9')]('/users',auth['isAuthenticated'](),controller[_0x04b5('0xd')]);router[_0x04b5('0x9')]('/:id',auth[_0x04b5('0xb')](),controller[_0x04b5('0xe')]);router[_0x04b5('0xf')]('/',auth[_0x04b5('0xb')](),controller[_0x04b5('0x10')]);router[_0x04b5('0x11')](_0x04b5('0x12'),controller[_0x04b5('0x13')]);router['delete'](_0x04b5('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x914d=['isAuthenticated','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x914d,0x1f0));var _0xd914=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x914d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd914('0x0'));var util=require(_0xd914('0x1'));var path=require('path');var timeout=require(_0xd914('0x2'));var express=require(_0xd914('0x3'));var router=express[_0xd914('0x4')]();var fs_extra=require(_0xd914('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd914('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xd914('0x7')]('/',auth[_0xd914('0x8')](),controller['index']);router['get'](_0xd914('0x9'),auth[_0xd914('0x8')](),controller[_0xd914('0xa')]);router[_0xd914('0x7')](_0xd914('0xb'),auth[_0xd914('0x8')](),controller[_0xd914('0xc')]);router[_0xd914('0x7')]('/:id',auth[_0xd914('0x8')](),controller[_0xd914('0xd')]);router[_0xd914('0xe')]('/',auth['isAuthenticated'](),controller[_0xd914('0xf')]);router[_0xd914('0x10')](_0xd914('0x11'),controller[_0xd914('0x12')]);router[_0xd914('0x13')](_0xd914('0x11'),auth[_0xd914('0x8')](),controller[_0xd914('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 865072e..b142dd0 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 _0x3266=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3e6680,_0xe70817){var _0x466d2c=function(_0x40e8b3){while(--_0x40e8b3){_0x3e6680['push'](_0x3e6680['shift']());}};_0x466d2c(++_0xe70817);}(_0x3266,0x6a));var _0x6326=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x3266[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'body':{'type':Sequelize[_0x6326('0x2')](_0x6326('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6326('0x5')]('in',_0x6326('0x6')),'defaultValue':_0x6326('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6326('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x3ccfea,_0x44ffb3){var _0x3a530f=function(_0x7c4323){while(--_0x7c4323){_0x3ccfea['push'](_0x3ccfea['shift']());}};_0x3a530f(++_0x44ffb3);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x384076,_0x491e1c){_0x384076=_0x384076-0x0;var _0x1d8f5d=_0xe2ab[_0x384076];return _0x1d8f5d;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 42a80a9..e93f44c 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 _0x4210=['internal','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','client','http','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','end','stack','name','send','index','map','ChatMessage','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','findAll','rows','params','rawAttributes','keys','length','includeAll','find','create','body','update','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','interface','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','email'];(function(_0x1347ea,_0x26676e){var _0x5e1b92=function(_0xba2879){while(--_0xba2879){_0x1347ea['push'](_0x1347ea['shift']());}};_0x5e1b92(++_0x26676e);}(_0x4210,0x83));var _0x0421=function(_0x13a7b3,_0x787f3c){_0x13a7b3=_0x13a7b3-0x0;var _0x1af7a3=_0x4210[_0x13a7b3];return _0x1af7a3;};'use strict';var emlformat=require(_0x0421('0x0'));var rimraf=require(_0x0421('0x1'));var zipdir=require(_0x0421('0x2'));var jsonpatch=require(_0x0421('0x3'));var rp=require(_0x0421('0x4'));var moment=require(_0x0421('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0421('0x6'));var fs=require('fs');var fs_extra=require(_0x0421('0x7'));var _=require(_0x0421('0x8'));var squel=require(_0x0421('0x9'));var crypto=require('crypto');var jsforce=require(_0x0421('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0421('0xb'));var querystring=require(_0x0421('0xc'));var Papa=require(_0x0421('0xd'));var Redis=require(_0x0421('0xe'));var authService=require(_0x0421('0xf'));var qs=require(_0x0421('0x10'));var as=require(_0x0421('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0421('0x12'))(_0x0421('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0421('0x14'));var db=require(_0x0421('0x15'))['db'];config[_0x0421('0x16')]=_[_0x0421('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0421('0x18'))(new Redis(config['redis']));require(_0x0421('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0421('0x1a')][_0x0421('0x1b')]({'port':0x232c});var client9002=jayson[_0x0421('0x1a')][_0x0421('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x495fc0,_0x43fcb6,_0x40d007,_0x4b830d){return new BPromise(function(_0x5b10ee,_0x5e162e){var _0x2a911f=_0x4b830d||client;return _0x2a911f['request'](_0x495fc0,_0x40d007)['then'](function(_0x3da6f1){logger[_0x0421('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x0421('0x1d'));logger[_0x0421('0x1e')](_0x0421('0x1f'),_0x43fcb6,_0x0421('0x1d'),JSON[_0x0421('0x20')](_0x3da6f1));if(_0x3da6f1[_0x0421('0x21')]){if(_0x3da6f1[_0x0421('0x21')][_0x0421('0x22')]===0x1f4){logger[_0x0421('0x21')](_0x0421('0x23'),_0x43fcb6,_0x3da6f1['error'][_0x0421('0x24')]);return _0x5e162e(_0x3da6f1[_0x0421('0x21')][_0x0421('0x24')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x3da6f1['error'][_0x0421('0x24')]);return _0x5b10ee(_0x3da6f1[_0x0421('0x21')][_0x0421('0x24')]);}else{logger[_0x0421('0x1c')](_0x0421('0x23'),_0x43fcb6,_0x0421('0x1d'));_0x5b10ee(_0x3da6f1[_0x0421('0x25')]['message']);}})[_0x0421('0x26')](function(_0x2d5fa0){logger[_0x0421('0x21')]('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x2d5fa0);_0x5e162e(_0x2d5fa0);});});}function respondWithStatusCode(_0x4c2c91,_0x1d948f){_0x1d948f=_0x1d948f||0xcc;return function(_0x176ad0){if(_0x176ad0){return _0x4c2c91[_0x0421('0x27')](_0x1d948f);}return _0x4c2c91['status'](_0x1d948f)['end']();};}function respondWithResult(_0x195791,_0x44adc7){_0x44adc7=_0x44adc7||0xc8;return function(_0xef5f75){if(_0xef5f75){return _0x195791[_0x0421('0x28')](_0x44adc7)['json'](_0xef5f75);}};}function respondWithFilteredResult(_0xb61599,_0x371d9c){return function(_0x14f9a6){if(_0x14f9a6){var _0x5e1354=typeof _0x371d9c[_0x0421('0x29')]===_0x0421('0x2a')&&typeof _0x371d9c['limit']===_0x0421('0x2a');var _0x2cd429=_0x14f9a6[_0x0421('0x2b')];var _0x730ce0=_0x5e1354?0x0:_0x371d9c[_0x0421('0x29')];var _0x552643=_0x5e1354?_0x14f9a6['count']:_0x371d9c[_0x0421('0x29')]+_0x371d9c[_0x0421('0x2c')];var _0x4ced5a;if(_0x552643>=_0x2cd429){_0x552643=_0x2cd429;_0x4ced5a=0xc8;}else{_0x4ced5a=0xce;}_0xb61599['status'](_0x4ced5a);return _0xb61599[_0x0421('0x2d')](_0x0421('0x2e'),_0x730ce0+'-'+_0x552643+'/'+_0x2cd429)[_0x0421('0x2f')](_0x14f9a6);}return null;};}function patchUpdates(_0x237c0d){return function(_0x2706fa){try{jsonpatch[_0x0421('0x30')](_0x2706fa,_0x237c0d,!![]);}catch(_0x1c2277){return BPromise[_0x0421('0x31')](_0x1c2277);}return _0x2706fa[_0x0421('0x32')]();};}function saveUpdates(_0x38a156,_0x1e02b5){return function(_0x2520f2){if(_0x2520f2){return _0x2520f2['update'](_0x38a156)[_0x0421('0x33')](function(_0x482b16){return _0x482b16;});}return null;};}function removeEntity(_0x2ed673,_0xfcb36e){return function(_0x31d01d){if(_0x31d01d){return _0x31d01d['destroy']()[_0x0421('0x33')](function(){_0x2ed673['status'](0xcc)[_0x0421('0x34')]();});}};}function handleEntityNotFound(_0x58f154,_0x292135){return function(_0x4eb1aa){if(!_0x4eb1aa){_0x58f154[_0x0421('0x27')](0x194);}return _0x4eb1aa;};}function handleError(_0x4a9477,_0x2ec452){_0x2ec452=_0x2ec452||0x1f4;return function(_0x520d08){logger[_0x0421('0x21')](_0x520d08[_0x0421('0x35')]);if(_0x520d08['name']){delete _0x520d08[_0x0421('0x36')];}_0x4a9477[_0x0421('0x28')](_0x2ec452)[_0x0421('0x37')](_0x520d08);};}exports[_0x0421('0x38')]=function(_0x192cb3,_0x51a376){var _0x48de6e={},_0x295e73={},_0x3b84a7={'count':0x0,'rows':[]};var _0x2840f2=_[_0x0421('0x39')](db[_0x0421('0x3a')]['rawAttributes'],function(_0x2b1f26){return{'name':_0x2b1f26['fieldName'],'type':_0x2b1f26[_0x0421('0x3b')][_0x0421('0x3c')]};});_0x295e73[_0x0421('0x3d')]=_[_0x0421('0x39')](_0x2840f2,_0x0421('0x36'));_0x295e73[_0x0421('0x3e')]=_['keys'](_0x192cb3[_0x0421('0x3e')]);_0x295e73[_0x0421('0x3f')]=_['intersection'](_0x295e73[_0x0421('0x3d')],_0x295e73[_0x0421('0x3e')]);_0x48de6e[_0x0421('0x40')]=_[_0x0421('0x41')](_0x295e73['model'],qs['fields'](_0x192cb3[_0x0421('0x3e')][_0x0421('0x42')]));_0x48de6e['attributes']=_0x48de6e[_0x0421('0x40')]['length']?_0x48de6e['attributes']:_0x295e73[_0x0421('0x3d')];if(!_0x192cb3[_0x0421('0x3e')][_0x0421('0x43')](_0x0421('0x44'))){_0x48de6e['limit']=qs[_0x0421('0x2c')](_0x192cb3[_0x0421('0x3e')]['limit']);_0x48de6e[_0x0421('0x29')]=qs[_0x0421('0x29')](_0x192cb3[_0x0421('0x3e')][_0x0421('0x29')]);}_0x48de6e[_0x0421('0x45')]=qs['sort'](_0x192cb3[_0x0421('0x3e')][_0x0421('0x46')]);_0x48de6e['where']=qs[_0x0421('0x3f')](_[_0x0421('0x47')](_0x192cb3[_0x0421('0x3e')],_0x295e73['filters']),_0x2840f2);if(_0x192cb3['query'][_0x0421('0x48')]){_0x48de6e['where']=_[_0x0421('0x49')](_0x48de6e[_0x0421('0x4a')],{'$or':_[_0x0421('0x39')](_0x2840f2,function(_0x78b5e9){if(_0x78b5e9[_0x0421('0x3b')]!=='VIRTUAL'){var _0x3399c8={};_0x3399c8[_0x78b5e9['name']]={'$like':'%'+_0x192cb3['query'][_0x0421('0x48')]+'%'};return _0x3399c8;}})});}_0x48de6e=_[_0x0421('0x49')]({},_0x48de6e,_0x192cb3[_0x0421('0x4b')]);var _0x53ba52={'where':_0x48de6e[_0x0421('0x4a')]};return db['ChatMessage']['count'](_0x53ba52)[_0x0421('0x33')](function(_0x328d37){_0x3b84a7[_0x0421('0x2b')]=_0x328d37;if(_0x192cb3[_0x0421('0x3e')]['includeAll']){_0x48de6e[_0x0421('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x0421('0x4d')](_0x48de6e);})[_0x0421('0x33')](function(_0x1f056b){_0x3b84a7[_0x0421('0x4e')]=_0x1f056b;return _0x3b84a7;})[_0x0421('0x33')](respondWithFilteredResult(_0x51a376,_0x48de6e))['catch'](handleError(_0x51a376,null));};exports['show']=function(_0x5e171f,_0x11d4a6){var _0x4e68ed={'raw':!![],'where':{'id':_0x5e171f[_0x0421('0x4f')]['id']}},_0x50b94e={};_0x50b94e[_0x0421('0x3d')]=_['keys'](db[_0x0421('0x3a')][_0x0421('0x50')]);_0x50b94e[_0x0421('0x3e')]=_[_0x0421('0x51')](_0x5e171f[_0x0421('0x3e')]);_0x50b94e[_0x0421('0x3f')]=_[_0x0421('0x41')](_0x50b94e[_0x0421('0x3d')],_0x50b94e['query']);_0x4e68ed[_0x0421('0x40')]=_['intersection'](_0x50b94e[_0x0421('0x3d')],qs['fields'](_0x5e171f[_0x0421('0x3e')]['fields']));_0x4e68ed[_0x0421('0x40')]=_0x4e68ed[_0x0421('0x40')][_0x0421('0x52')]?_0x4e68ed[_0x0421('0x40')]:_0x50b94e[_0x0421('0x3d')];if(_0x5e171f[_0x0421('0x3e')][_0x0421('0x53')]){_0x4e68ed[_0x0421('0x4c')]=[{'all':!![]}];}_0x4e68ed=_[_0x0421('0x49')]({},_0x4e68ed,_0x5e171f[_0x0421('0x4b')]);return db['ChatMessage'][_0x0421('0x54')](_0x4e68ed)[_0x0421('0x33')](handleEntityNotFound(_0x11d4a6,null))[_0x0421('0x33')](respondWithResult(_0x11d4a6,null))['catch'](handleError(_0x11d4a6,null));};exports[_0x0421('0x55')]=function(_0x5efecb,_0x171653){return db['ChatMessage'][_0x0421('0x55')](_0x5efecb[_0x0421('0x56')],{})[_0x0421('0x33')](respondWithResult(_0x171653,0xc9))['catch'](handleError(_0x171653,null));};exports[_0x0421('0x57')]=function(_0x6f57e,_0x525c92){if(_0x6f57e[_0x0421('0x56')]['id']){delete _0x6f57e[_0x0421('0x56')]['id'];}return db['ChatMessage'][_0x0421('0x54')]({'where':{'id':_0x6f57e[_0x0421('0x4f')]['id']}})[_0x0421('0x33')](handleEntityNotFound(_0x525c92,null))[_0x0421('0x33')](saveUpdates(_0x6f57e[_0x0421('0x56')],null))['then'](respondWithResult(_0x525c92,null))['catch'](handleError(_0x525c92,null));};exports[_0x0421('0x58')]=function(_0x1ff7c8,_0x41e995){return db[_0x0421('0x3a')][_0x0421('0x54')]({'where':{'id':_0x1ff7c8[_0x0421('0x4f')]['id']}})[_0x0421('0x33')](handleEntityNotFound(_0x41e995,null))[_0x0421('0x33')](removeEntity(_0x41e995,null))[_0x0421('0x26')](handleError(_0x41e995,null));};exports[_0x0421('0x59')]=function(_0x5d553f,_0x5428ca){return db[_0x0421('0x3a')][_0x0421('0x59')]()[_0x0421('0x33')](respondWithResult(_0x5428ca,null))[_0x0421('0x26')](handleError(_0x5428ca,null));};var interaction_log=require(_0x0421('0x12'))(_0x0421('0x5a'));exports['accept']=function(_0x5436d3,_0x386764,_0x2f3ee6){var _0x37c033={'agent':{},'channel':_0x0421('0x5b')};if(_0x5436d3[_0x0421('0x56')]['id']){delete _0x5436d3[_0x0421('0x56')]['id'];}_0x5436d3[_0x0421('0x56')][_0x0421('0x5c')]=!![];_0x5436d3['body'][_0x0421('0x5d')]=moment()[_0x0421('0x5e')](_0x0421('0x5f'));_0x5436d3[_0x0421('0x56')][_0x0421('0x60')]=_0x5436d3[_0x0421('0x56')][_0x0421('0x60')]||_0x5436d3['user']['id'];_0x37c033[_0x0421('0x61')]['id']=_0x5436d3[_0x0421('0x56')][_0x0421('0x60')];return db[_0x0421('0x3a')]['find']({'where':{'id':_0x5436d3['params']['id'],'UserId':null}})[_0x0421('0x33')](handleEntityNotFound(_0x386764,null))['then'](saveUpdates(_0x5436d3[_0x0421('0x56')],null))[_0x0421('0x33')](function(_0x4798e){if(_0x4798e){_0x37c033[_0x0421('0x24')]=_0x4798e['get']({'plain':!![]});return db[_0x0421('0x62')][_0x0421('0x54')]({'where':{'id':_0x4798e[_0x0421('0x63')]}});}return null;})[_0x0421('0x33')](handleEntityNotFound(_0x386764,null))['then'](function(_0x46859d){if(_0x46859d){return _0x46859d[_0x0421('0x57')]({'UserId':_0x5436d3['body'][_0x0421('0x60')],'read1stAt':_[_0x0421('0x64')](_0x46859d['read1stAt'])?moment()[_0x0421('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2d96b5){if(_0x2d96b5){_0x37c033[_0x0421('0x65')]=_0x2d96b5[_0x0421('0x66')]({'plain':!![]});interaction_log[_0x0421('0x1c')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5436d3[_0x0421('0x67')]['id'],_0x5436d3[_0x0421('0x67')][_0x0421('0x36')],_0x5436d3[_0x0421('0x67')][_0x0421('0x68')],_0x37c033[_0x0421('0x65')]['id'],_0x5436d3[_0x0421('0x56')]?JSON[_0x0421('0x20')](_0x5436d3[_0x0421('0x56')]):_0x0421('0x69'));return respondWithRpcPromise(_0x0421('0x6a'),_0x0421('0x6b'),_0x37c033);}return null;})[_0x0421('0x33')](function(_0x126b35){var _0x4afd2a=_0x0421('0x6c')+_0x126b35['message'][_0x0421('0x6d')];return db[_0x0421('0x6e')]['query'](_0x4afd2a,{'type':db[_0x0421('0x6f')][_0x0421('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x150479){return _0x150479;});})[_0x0421('0x33')](function(_0x4c7173){if(_0x4c7173){_0x37c033['message']['contact']=_0x4c7173[0x0];if(!_0x5436d3['body']['UserId'])return;return db[_0x0421('0x71')]['find']({'where':{'id':_0x5436d3[_0x0421('0x56')][_0x0421('0x60')],'role':_0x0421('0x61')},'attributes':['id',_0x0421('0x36'),_0x0421('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x0421('0x33')](function(_0x21b3fb){if(!_0x21b3fb)return null;_0x37c033[_0x0421('0x24')][_0x0421('0x61')]=_0x21b3fb;return _0x37c033;})[_0x0421('0x33')](function(_0x25c8e0){if(_0x25c8e0){if(_0x5436d3[_0x0421('0x56')]['manual']){_0x37c033[_0x0421('0x24')][_0x0421('0x73')]=util[_0x0421('0x5e')]('SIP/%s',_0x5436d3[_0x0421('0x67')]['name']);_0x37c033[_0x0421('0x24')][_0x0421('0x74')]=_0x37c033[_0x0421('0x74')];_0x37c033[_0x0421('0x24')][_0x0421('0x75')]=_0x37c033[_0x0421('0x74')];_0x37c033['message']['event']=_0x0421('0x76');return respondWithRpcPromise(_0x0421('0x77'),'EventManager',{'event':_0x0421('0x78'),'message':_[_0x0421('0x49')](_0x37c033['message'],JSON[_0x0421('0x79')](_0x37c033[_0x0421('0x65')][_0x0421('0x7a')]))},client9002)[_0x0421('0x33')](function(){return _0x37c033;});}return _0x37c033;}return null;})[_0x0421('0x33')](respondWithResult(_0x386764,null))['catch'](handleError(_0x386764,null));};var interaction_log=require('../../config/logger')(_0x0421('0x5a'));exports[_0x0421('0x31')]=function(_0xa50cae,_0xd42d74,_0x523ab1){var _0xb382f={'agent':{},'channel':_0x0421('0x5b')};if(_0xa50cae[_0x0421('0x56')]['id']){delete _0xa50cae[_0x0421('0x56')]['id'];}_0xa50cae['body'][_0x0421('0x60')]=_0xa50cae[_0x0421('0x56')][_0x0421('0x60')]||_0xa50cae[_0x0421('0x67')]['id'];_0xb382f['agent']['id']=_0xa50cae[_0x0421('0x56')][_0x0421('0x60')];return db[_0x0421('0x3a')][_0x0421('0x54')]({'where':{'id':_0xa50cae[_0x0421('0x4f')]['id'],'UserId':null}})[_0x0421('0x33')](handleEntityNotFound(_0xd42d74,null))['then'](function(_0x3de33d){if(_0x3de33d){_0xb382f['message']=_0x3de33d[_0x0421('0x66')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3de33d['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xd42d74,null))[_0x0421('0x33')](function(_0x391be8){if(_0x391be8){_0xb382f[_0x0421('0x65')]=_0x391be8['get']({'plain':!![]});interaction_log['info'](_0x0421('0x7b'),_0xa50cae[_0x0421('0x67')]['id'],_0xa50cae[_0x0421('0x67')][_0x0421('0x36')],_0xa50cae[_0x0421('0x67')][_0x0421('0x68')],_0xb382f[_0x0421('0x65')]['id'],_0xa50cae['body']?JSON['stringify'](_0xa50cae[_0x0421('0x56')]):_0x0421('0x69'));return respondWithRpcPromise('RejectMessage',_0x0421('0x7c'),_0xb382f);}return null;})['then'](function(_0x39ec7b){var _0x49a181=_0x0421('0x6c')+_0x39ec7b[_0x0421('0x24')][_0x0421('0x6d')];return db['sequelize'][_0x0421('0x3e')](_0x49a181,{'type':db[_0x0421('0x6f')][_0x0421('0x70')]['SELECT'],'raw':!![]})[_0x0421('0x33')](function(_0x46efaf){return _0x46efaf;});})[_0x0421('0x33')](function(_0x3a255b){if(_0x3a255b){_0xb382f[_0x0421('0x24')][_0x0421('0x7d')]=_0x3a255b[0x0];if(!_0xa50cae['body'][_0x0421('0x60')])return;return db[_0x0421('0x71')]['find']({'where':{'id':_0xa50cae['body']['UserId'],'role':_0x0421('0x61')},'attributes':['id',_0x0421('0x36'),_0x0421('0x72'),_0x0421('0x7e'),_0x0421('0x7f')],'raw':!![]});}return null;})[_0x0421('0x33')](function(_0x1c96c8){if(!_0x1c96c8)return null;_0xb382f[_0x0421('0x24')][_0x0421('0x61')]=_0x1c96c8;return _0xb382f;})['then'](function(_0x39c741){if(_0x39c741){_0x39c741[_0x0421('0x24')][_0x0421('0x73')]=util[_0x0421('0x5e')]('SIP/%s',_0xa50cae[_0x0421('0x67')][_0x0421('0x36')]);_0x39c741[_0x0421('0x24')][_0x0421('0x74')]=_0xb382f['channel'];_0x39c741['message']['motionChannel']=_0xb382f[_0x0421('0x74')];_0x39c741[_0x0421('0x24')][_0x0421('0x80')]=_0x0421('0x31');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x0421('0x49')](_0xb382f['message'],JSON['parse'](_0xb382f[_0x0421('0x65')][_0x0421('0x7a')]))},client9002);return _0xb382f;}return null;})['then'](respondWithResult(_0xd42d74,null))[_0x0421('0x26')](handleError(_0xd42d74,null));}; \ No newline at end of file +var _0xfe18=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','Sequelize','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','send','index','map','ChatMessage','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xfe18,0x1b5));var _0x8fe1=function(_0x52cc68,_0x440163){_0x52cc68=_0x52cc68-0x0;var _0x572cd4=_0xfe18[_0x52cc68];return _0x572cd4;};'use strict';var emlformat=require(_0x8fe1('0x0'));var rimraf=require(_0x8fe1('0x1'));var zipdir=require(_0x8fe1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fe1('0x3'));var moment=require(_0x8fe1('0x4'));var BPromise=require(_0x8fe1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8fe1('0x6'));var sox=require(_0x8fe1('0x7'));var csv=require(_0x8fe1('0x8'));var ejs=require(_0x8fe1('0x9'));var fs=require('fs');var fs_extra=require(_0x8fe1('0xa'));var _=require('lodash');var squel=require(_0x8fe1('0xb'));var crypto=require(_0x8fe1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8fe1('0xd'));var toCsv=require(_0x8fe1('0x8'));var querystring=require(_0x8fe1('0xe'));var Papa=require(_0x8fe1('0xf'));var Redis=require(_0x8fe1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8fe1('0x11'));var as=require(_0x8fe1('0x12'));var hardwareService=require(_0x8fe1('0x13'));var logger=require(_0x8fe1('0x14'))(_0x8fe1('0x15'));var utils=require(_0x8fe1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8fe1('0x17'));var db=require(_0x8fe1('0x18'))['db'];config[_0x8fe1('0x19')]=_[_0x8fe1('0x1a')](config[_0x8fe1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fe1('0x1b'))(new Redis(config[_0x8fe1('0x19')]));require(_0x8fe1('0x1c'))[_0x8fe1('0x1d')](socket);var jayson=require(_0x8fe1('0x1e'));var client=jayson['client'][_0x8fe1('0x1f')]({'port':0x232c});var client9002=jayson[_0x8fe1('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365368,_0x492dc1,_0x4ccdf4,_0x384799){return new BPromise(function(_0x4347f4,_0x1f6b80){var _0x3e047e=_0x384799||client;return _0x3e047e[_0x8fe1('0x21')](_0x365368,_0x4ccdf4)[_0x8fe1('0x22')](function(_0x52e65f){logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,_0x8fe1('0x25'));logger[_0x8fe1('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x492dc1,_0x8fe1('0x25'),JSON['stringify'](_0x52e65f));if(_0x52e65f['error']){if(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x28')]===0x1f4){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x1f6b80(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}logger['error'](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x4347f4(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}else{logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,'request\x20sent');_0x4347f4(_0x52e65f['result'][_0x8fe1('0x29')]);}})['catch'](function(_0x384cc0){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x384cc0);_0x1f6b80(_0x384cc0);});});}function respondWithStatusCode(_0x53ad2e,_0x7a0bba){_0x7a0bba=_0x7a0bba||0xcc;return function(_0x5cb0e3){if(_0x5cb0e3){return _0x53ad2e[_0x8fe1('0x2a')](_0x7a0bba);}return _0x53ad2e['status'](_0x7a0bba)[_0x8fe1('0x2b')]();};}function respondWithResult(_0x4fb99a,_0xc11967){_0xc11967=_0xc11967||0xc8;return function(_0x73f7de){if(_0x73f7de){return _0x4fb99a[_0x8fe1('0x2c')](_0xc11967)['json'](_0x73f7de);}};}function respondWithFilteredResult(_0x56a6bc,_0x391bf1){return function(_0x2aa19c){if(_0x2aa19c){var _0x2442e3=typeof _0x391bf1[_0x8fe1('0x2d')]===_0x8fe1('0x2e')&&typeof _0x391bf1[_0x8fe1('0x2f')]===_0x8fe1('0x2e');var _0x1532e2=_0x2aa19c[_0x8fe1('0x30')];var _0x35256d=_0x2442e3?0x0:_0x391bf1[_0x8fe1('0x2d')];var _0x2fb21f=_0x2442e3?_0x2aa19c['count']:_0x391bf1[_0x8fe1('0x2d')]+_0x391bf1['limit'];var _0x2a2985;if(_0x2fb21f>=_0x1532e2){_0x2fb21f=_0x1532e2;_0x2a2985=0xc8;}else{_0x2a2985=0xce;}_0x56a6bc[_0x8fe1('0x2c')](_0x2a2985);return _0x56a6bc[_0x8fe1('0x31')](_0x8fe1('0x32'),_0x35256d+'-'+_0x2fb21f+'/'+_0x1532e2)[_0x8fe1('0x33')](_0x2aa19c);}return null;};}function patchUpdates(_0x1bede1){return function(_0x5d0ae2){try{jsonpatch[_0x8fe1('0x34')](_0x5d0ae2,_0x1bede1,!![]);}catch(_0x44804d){return BPromise[_0x8fe1('0x35')](_0x44804d);}return _0x5d0ae2[_0x8fe1('0x36')]();};}function saveUpdates(_0x18f437,_0x41cf52){return function(_0x1280da){if(_0x1280da){return _0x1280da['update'](_0x18f437)[_0x8fe1('0x22')](function(_0x2089ac){return _0x2089ac;});}return null;};}function removeEntity(_0x435a99,_0x4b5f2c){return function(_0x3536d5){if(_0x3536d5){return _0x3536d5[_0x8fe1('0x37')]()[_0x8fe1('0x22')](function(){_0x435a99[_0x8fe1('0x2c')](0xcc)[_0x8fe1('0x2b')]();});}};}function handleEntityNotFound(_0x3f6a1b,_0x3bdad7){return function(_0x322826){if(!_0x322826){_0x3f6a1b[_0x8fe1('0x2a')](0x194);}return _0x322826;};}function handleError(_0x4a7d81,_0x8447cc){_0x8447cc=_0x8447cc||0x1f4;return function(_0x9382ff){logger[_0x8fe1('0x27')](_0x9382ff[_0x8fe1('0x38')]);if(_0x9382ff['name']){delete _0x9382ff['name'];}_0x4a7d81[_0x8fe1('0x2c')](_0x8447cc)[_0x8fe1('0x39')](_0x9382ff);};}exports[_0x8fe1('0x3a')]=function(_0x3ca9ca,_0x48cd57){var _0x22cfee={},_0x214deb={},_0x479add={'count':0x0,'rows':[]};var _0xaff71d=_[_0x8fe1('0x3b')](db[_0x8fe1('0x3c')][_0x8fe1('0x3d')],function(_0x33c0e1){return{'name':_0x33c0e1['fieldName'],'type':_0x33c0e1[_0x8fe1('0x3e')][_0x8fe1('0x3f')]};});_0x214deb['model']=_[_0x8fe1('0x3b')](_0xaff71d,_0x8fe1('0x40'));_0x214deb[_0x8fe1('0x41')]=_['keys'](_0x3ca9ca[_0x8fe1('0x41')]);_0x214deb[_0x8fe1('0x42')]=_[_0x8fe1('0x43')](_0x214deb[_0x8fe1('0x44')],_0x214deb['query']);_0x22cfee[_0x8fe1('0x45')]=_['intersection'](_0x214deb['model'],qs[_0x8fe1('0x46')](_0x3ca9ca[_0x8fe1('0x41')]['fields']));_0x22cfee[_0x8fe1('0x45')]=_0x22cfee[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x22cfee[_0x8fe1('0x45')]:_0x214deb[_0x8fe1('0x44')];if(!_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x48')]('nolimit')){_0x22cfee['limit']=qs['limit'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2f')]);_0x22cfee[_0x8fe1('0x2d')]=qs['offset'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2d')]);}_0x22cfee[_0x8fe1('0x49')]=qs['sort'](_0x3ca9ca['query']['sort']);_0x22cfee[_0x8fe1('0x4a')]=qs[_0x8fe1('0x42')](_[_0x8fe1('0x4b')](_0x3ca9ca['query'],_0x214deb[_0x8fe1('0x42')]),_0xaff71d);if(_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x4c')]){_0x22cfee[_0x8fe1('0x4a')]=_['merge'](_0x22cfee[_0x8fe1('0x4a')],{'$or':_['map'](_0xaff71d,function(_0x134028){if(_0x134028[_0x8fe1('0x3e')]!==_0x8fe1('0x4d')){var _0x128ec2={};_0x128ec2[_0x134028[_0x8fe1('0x40')]]={'$like':'%'+_0x3ca9ca['query'][_0x8fe1('0x4c')]+'%'};return _0x128ec2;}})});}_0x22cfee=_[_0x8fe1('0x4e')]({},_0x22cfee,_0x3ca9ca[_0x8fe1('0x4f')]);var _0x20d34d={'where':_0x22cfee[_0x8fe1('0x4a')]};return db['ChatMessage'][_0x8fe1('0x30')](_0x20d34d)['then'](function(_0x3bb7fb){_0x479add[_0x8fe1('0x30')]=_0x3bb7fb;if(_0x3ca9ca[_0x8fe1('0x41')]['includeAll']){_0x22cfee[_0x8fe1('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x8fe1('0x51')](_0x22cfee);})[_0x8fe1('0x22')](function(_0x385f98){_0x479add[_0x8fe1('0x52')]=_0x385f98;return _0x479add;})[_0x8fe1('0x22')](respondWithFilteredResult(_0x48cd57,_0x22cfee))[_0x8fe1('0x53')](handleError(_0x48cd57,null));};exports[_0x8fe1('0x54')]=function(_0x4d37fc,_0x16754f){var _0x2054ad={'raw':!![],'where':{'id':_0x4d37fc[_0x8fe1('0x55')]['id']}},_0x34668c={};_0x34668c[_0x8fe1('0x44')]=_['keys'](db[_0x8fe1('0x3c')]['rawAttributes']);_0x34668c['query']=_['keys'](_0x4d37fc[_0x8fe1('0x41')]);_0x34668c[_0x8fe1('0x42')]=_['intersection'](_0x34668c[_0x8fe1('0x44')],_0x34668c[_0x8fe1('0x41')]);_0x2054ad[_0x8fe1('0x45')]=_['intersection'](_0x34668c['model'],qs[_0x8fe1('0x46')](_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x46')]));_0x2054ad[_0x8fe1('0x45')]=_0x2054ad[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x2054ad[_0x8fe1('0x45')]:_0x34668c[_0x8fe1('0x44')];if(_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x56')]){_0x2054ad[_0x8fe1('0x50')]=[{'all':!![]}];}_0x2054ad=_[_0x8fe1('0x4e')]({},_0x2054ad,_0x4d37fc[_0x8fe1('0x4f')]);return db[_0x8fe1('0x3c')][_0x8fe1('0x57')](_0x2054ad)[_0x8fe1('0x22')](handleEntityNotFound(_0x16754f,null))[_0x8fe1('0x22')](respondWithResult(_0x16754f,null))[_0x8fe1('0x53')](handleError(_0x16754f,null));};exports[_0x8fe1('0x58')]=function(_0x7d4aac,_0x47dc58){return db[_0x8fe1('0x3c')][_0x8fe1('0x58')](_0x7d4aac[_0x8fe1('0x59')],{})[_0x8fe1('0x22')](respondWithResult(_0x47dc58,0xc9))[_0x8fe1('0x53')](handleError(_0x47dc58,null));};exports[_0x8fe1('0x5a')]=function(_0x320a84,_0x242e14){if(_0x320a84[_0x8fe1('0x59')]['id']){delete _0x320a84[_0x8fe1('0x59')]['id'];}return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x320a84['params']['id']}})[_0x8fe1('0x22')](handleEntityNotFound(_0x242e14,null))[_0x8fe1('0x22')](saveUpdates(_0x320a84[_0x8fe1('0x59')],null))[_0x8fe1('0x22')](respondWithResult(_0x242e14,null))['catch'](handleError(_0x242e14,null));};exports[_0x8fe1('0x37')]=function(_0x1c3d58,_0x44480){return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x1c3d58[_0x8fe1('0x55')]['id']}})['then'](handleEntityNotFound(_0x44480,null))[_0x8fe1('0x22')](removeEntity(_0x44480,null))['catch'](handleError(_0x44480,null));};exports[_0x8fe1('0x5b')]=function(_0x4684c2,_0x36c6d1){return db[_0x8fe1('0x3c')][_0x8fe1('0x5b')]()[_0x8fe1('0x22')](respondWithResult(_0x36c6d1,null))[_0x8fe1('0x53')](handleError(_0x36c6d1,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports[_0x8fe1('0x5d')]=function(_0x3ce5ca,_0x2ded18,_0x2eabe3){var _0x43e12f={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x3ce5ca[_0x8fe1('0x59')]['id']){delete _0x3ce5ca['body']['id'];}_0x3ce5ca['body'][_0x8fe1('0x5f')]=!![];_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x60')]=moment()[_0x8fe1('0x61')](_0x8fe1('0x62'));_0x3ce5ca['body'][_0x8fe1('0x63')]=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x3ce5ca[_0x8fe1('0x64')]['id'];_0x43e12f['agent']['id']=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x3ce5ca[_0x8fe1('0x55')]['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](saveUpdates(_0x3ce5ca['body'],null))[_0x8fe1('0x22')](function(_0x352ebf){if(_0x352ebf){_0x43e12f[_0x8fe1('0x29')]=_0x352ebf[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x352ebf[_0x8fe1('0x67')]}});}return null;})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](function(_0xc3b6af){if(_0xc3b6af){return _0xc3b6af[_0x8fe1('0x5a')]({'UserId':_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')],'read1stAt':_[_0x8fe1('0x68')](_0xc3b6af[_0x8fe1('0x69')])?moment()[_0x8fe1('0x61')](_0x8fe1('0x62')):undefined});}return null;})[_0x8fe1('0x22')](function(_0x5946d0){if(_0x5946d0){_0x43e12f[_0x8fe1('0x6a')]=_0x5946d0[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x6b'),_0x3ce5ca[_0x8fe1('0x64')]['id'],_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')],_0x3ce5ca[_0x8fe1('0x64')]['role'],_0x43e12f[_0x8fe1('0x6a')]['id'],_0x3ce5ca[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x3ce5ca[_0x8fe1('0x59')]):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x6e'),_0x8fe1('0x6f'),_0x43e12f);}return null;})['then'](function(_0x226b14){var _0x45918b=_0x8fe1('0x70')+_0x226b14['message'][_0x8fe1('0x71')];return db['sequelize'][_0x8fe1('0x41')](_0x45918b,{'type':db['Sequelize'][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x1f502b){return _0x1f502b;});})['then'](function(_0x1f1208){if(_0x1f1208){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x74')]=_0x1f1208[0x0];if(!_0x3ce5ca['body']['UserId'])return;return db[_0x8fe1('0x75')][_0x8fe1('0x57')]({'where':{'id':_0x3ce5ca['body'][_0x8fe1('0x63')],'role':_0x8fe1('0x76')},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0x3f0b1d){if(!_0x3f0b1d)return null;_0x43e12f[_0x8fe1('0x29')]['agent']=_0x3f0b1d;return _0x43e12f;})[_0x8fe1('0x22')](function(_0x454b80){if(_0x454b80){if(_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x7a')]){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')]);_0x43e12f['message'][_0x8fe1('0x7d')]=_0x43e12f[_0x8fe1('0x7d')];_0x43e12f['message']['motionChannel']=_0x43e12f['channel'];_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x5d');return respondWithRpcPromise('EventManager',_0x8fe1('0x7f'),{'event':_0x8fe1('0x80'),'message':_[_0x8fe1('0x4e')](_0x43e12f[_0x8fe1('0x29')],JSON[_0x8fe1('0x81')](_0x43e12f[_0x8fe1('0x6a')][_0x8fe1('0x82')]))},client9002)[_0x8fe1('0x22')](function(){return _0x43e12f;});}return _0x43e12f;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x2ded18,null))['catch'](handleError(_0x2ded18,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports['reject']=function(_0x4190dc,_0x255f82,_0x277596){var _0x4fd80b={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x4190dc['body']['id']){delete _0x4190dc['body']['id'];}_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x4190dc[_0x8fe1('0x64')]['id'];_0x4fd80b[_0x8fe1('0x76')]['id']=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x4190dc['params']['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1aa30c){if(_0x1aa30c){_0x4fd80b[_0x8fe1('0x29')]=_0x1aa30c[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x1aa30c[_0x8fe1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1b3a0d){if(_0x1b3a0d){_0x4fd80b['interaction']=_0x1b3a0d[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x83'),_0x4190dc[_0x8fe1('0x64')]['id'],_0x4190dc[_0x8fe1('0x64')]['name'],_0x4190dc[_0x8fe1('0x64')][_0x8fe1('0x84')],_0x4fd80b[_0x8fe1('0x6a')]['id'],_0x4190dc[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x4190dc['body']):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x85'),'rejectMessage',_0x4fd80b);}return null;})[_0x8fe1('0x22')](function(_0x3f0efe){var _0x5bd448=_0x8fe1('0x70')+_0x3f0efe['message']['ContactId'];return db[_0x8fe1('0x86')][_0x8fe1('0x41')](_0x5bd448,{'type':db[_0x8fe1('0x87')][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x2f52d9){return _0x2f52d9;});})[_0x8fe1('0x22')](function(_0x1a38b7){if(_0x1a38b7){_0x4fd80b['message']['contact']=_0x1a38b7[0x0];if(!_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')])return;return db['User'][_0x8fe1('0x57')]({'where':{'id':_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')],'role':'agent'},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0xe0ed34){if(!_0xe0ed34)return null;_0x4fd80b[_0x8fe1('0x29')][_0x8fe1('0x76')]=_0xe0ed34;return _0x4fd80b;})[_0x8fe1('0x22')](function(_0x5f0d4d){if(_0x5f0d4d){_0x5f0d4d['message'][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x4190dc['user']['name']);_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7d')]=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')]['motionChannel']=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x35');respondWithRpcPromise(_0x8fe1('0x7f'),_0x8fe1('0x7f'),{'event':_0x8fe1('0x88'),'message':_[_0x8fe1('0x4e')](_0x4fd80b[_0x8fe1('0x29')],JSON['parse'](_0x4fd80b['interaction']['formData']))},client9002);return _0x4fd80b;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x255f82,null))['catch'](handleError(_0x255f82,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3194fbf..b8631f6 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 _0x7307=['hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit'];(function(_0x3ca39c,_0x263221){var _0x3aad48=function(_0x16830e){while(--_0x16830e){_0x3ca39c['push'](_0x3ca39c['shift']());}};_0x3aad48(++_0x263221);}(_0x7307,0x6a));var _0x7730=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x7307[_0xac151d];return _0x111dba;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7730('0x0'))['db'][_0x7730('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7730('0x2')](0x0);var events={'afterCreate':_0x7730('0x3'),'afterUpdate':'update','afterDestroy':_0x7730('0x4')};function emitEvent(_0x1f0e2c){return function(_0x322343,_0x2ae0ef,_0x15f130){ChatMessageEvents[_0x7730('0x5')](_0x1f0e2c+':'+_0x322343['id'],_0x322343);ChatMessageEvents[_0x7730('0x5')](_0x1f0e2c,_0x322343);_0x15f130(null);};}for(var e in events){if(events[_0x7730('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x7730('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x6421=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','save'];(function(_0x1dcda7,_0x392711){var _0x5add78=function(_0x4af948){while(--_0x4af948){_0x1dcda7['push'](_0x1dcda7['shift']());}};_0x5add78(++_0x392711);}(_0x6421,0x1c8));var _0x1642=function(_0x4eefdf,_0x2604d0){_0x4eefdf=_0x4eefdf-0x0;var _0x165423=_0x6421[_0x4eefdf];return _0x165423;};'use strict';var EventEmitter=require(_0x1642('0x0'));var ChatMessage=require(_0x1642('0x1'))['db'][_0x1642('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1642('0x3'),'afterUpdate':_0x1642('0x4'),'afterDestroy':_0x1642('0x5')};function emitEvent(_0x541a95){return function(_0x34d7ee,_0x1282d3,_0x4d693c){ChatMessageEvents['emit'](_0x541a95+':'+_0x34d7ee['id'],_0x34d7ee);ChatMessageEvents[_0x1642('0x6')](_0x541a95,_0x34d7ee);_0x4d693c(null);};}for(var e in events){if(events[_0x1642('0x7')](e)){var event=events[e];ChatMessage[_0x1642('0x8')](e,emitEvent(event));}}module[_0x1642('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ecb448c..30c29ea 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 _0x4afd=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4afd,0x1d9));var _0xd4af=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4afd[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xd4af('0x0'));var util=require('util');var logger=require(_0xd4af('0x1'))(_0xd4af('0x2'));var moment=require(_0xd4af('0x3'));var BPromise=require(_0xd4af('0x4'));var rp=require(_0xd4af('0x5'));var fs=require('fs');var path=require(_0xd4af('0x6'));var rimraf=require(_0xd4af('0x7'));var config=require(_0xd4af('0x8'));var attributes=require(_0xd4af('0x9'));module[_0xd4af('0xa')]=function(_0x76281d,_0x1dfc4e){return _0x76281d[_0xd4af('0xb')](_0xd4af('0xc'),attributes,{'tableName':_0xd4af('0xd'),'paranoid':![],'indexes':[{'name':_0xd4af('0xe'),'fields':[_0xd4af('0xf')],'type':_0xd4af('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dbe5c,_0x122aa2,_0x5d06bb){var _0x20045e=_0x76281d[_0xd4af('0x11')];var _0x35ef09=_0x5dbe5c[_0xd4af('0x12')]({'plain':!![]});if(_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()==='in'||_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()==='out'&&!_0x35ef09[_0xd4af('0x15')]&&!_[_0xd4af('0x16')](_0x35ef09[_0xd4af('0x17')])){_0x20045e[_0xd4af('0x18')]['findOne']({'where':{'id':_0x35ef09[_0xd4af('0x19')]}})[_0xd4af('0x1a')](function(_0x489326){if(_0x489326){_0x489326['update']({'lastMsgAt':_0x35ef09[_0xd4af('0x1b')],'lastMsgDirection':_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()});}})[_0xd4af('0x1c')](function(_0x548c37){console[_0xd4af('0x1d')](_0x548c37);});}_0x5d06bb();}},'charset':_0xd4af('0x1e'),'collate':_0xd4af('0x1f')});}; \ No newline at end of file +var _0xff97=['chat_messages','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define'];(function(_0x4adead,_0x3e7eef){var _0x34cfca=function(_0x4b52ca){while(--_0x4b52ca){_0x4adead['push'](_0x4adead['shift']());}};_0x34cfca(++_0x3e7eef);}(_0xff97,0x19f));var _0x7ff9=function(_0x3e66c9,_0x22fccd){_0x3e66c9=_0x3e66c9-0x0;var _0x3c1e9b=_0xff97[_0x3e66c9];return _0x3c1e9b;};'use strict';var _=require(_0x7ff9('0x0'));var util=require(_0x7ff9('0x1'));var logger=require('../../config/logger')(_0x7ff9('0x2'));var moment=require('moment');var BPromise=require(_0x7ff9('0x3'));var rp=require(_0x7ff9('0x4'));var fs=require('fs');var path=require(_0x7ff9('0x5'));var rimraf=require(_0x7ff9('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ff9('0x7'));module[_0x7ff9('0x8')]=function(_0x23753f,_0x4229f3){return _0x23753f[_0x7ff9('0x9')]('ChatMessage',attributes,{'tableName':_0x7ff9('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x7ff9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b47c4,_0x3cf64e,_0x376e69){var _0x51a8b0=_0x23753f['models'];var _0x9c9238=_0x5b47c4[_0x7ff9('0xc')]({'plain':!![]});if(_0x9c9238['direction'][_0x7ff9('0xd')]()==='in'||_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()===_0x7ff9('0xf')&&!_0x9c9238['secret']&&!_[_0x7ff9('0x10')](_0x9c9238[_0x7ff9('0x11')])){_0x51a8b0[_0x7ff9('0x12')]['findOne']({'where':{'id':_0x9c9238[_0x7ff9('0x13')]}})[_0x7ff9('0x14')](function(_0x356f16){if(_0x356f16){_0x356f16[_0x7ff9('0x15')]({'lastMsgAt':_0x9c9238[_0x7ff9('0x16')],'lastMsgDirection':_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()});}})['catch'](function(_0x167dbb){console[_0x7ff9('0x17')](_0x167dbb);});}_0x376e69();}},'charset':'utf8mb4','collate':_0x7ff9('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f5ec1b9..b784c8b 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 _0x00e1=['redis','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ChatMessage','body','options','raw','then','CreateChatMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x58970c,_0x3c4066){var _0x1528ba=function(_0x42bc77){while(--_0x42bc77){_0x58970c['push'](_0x58970c['shift']());}};_0x1528ba(++_0x3c4066);}(_0x00e1,0x151));var _0x100e=function(_0x486215,_0x331114){_0x486215=_0x486215-0x0;var _0x2fcfa4=_0x00e1[_0x486215];return _0x2fcfa4;};'use strict';var _=require('lodash');var util=require(_0x100e('0x0'));var moment=require(_0x100e('0x1'));var BPromise=require(_0x100e('0x2'));var rs=require(_0x100e('0x3'));var fs=require('fs');var Redis=require(_0x100e('0x4'));var db=require(_0x100e('0x5'))['db'];var utils=require(_0x100e('0x6'));var logger=require(_0x100e('0x7'))(_0x100e('0x8'));var config=require(_0x100e('0x9'));var jayson=require(_0x100e('0xa'));var client=jayson['client'][_0x100e('0xb')]({'port':0x232a});config['redis']=_[_0x100e('0xc')](config[_0x100e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x100e('0xe'))(new Redis(config[_0x100e('0xd')]));require(_0x100e('0xf'))[_0x100e('0x10')](socket);function respondWithRpcPromise(_0x252350,_0x351495,_0x12b744){return new BPromise(function(_0x34d294,_0x25a30b){return client[_0x100e('0x11')](_0x252350,_0x12b744)['then'](function(_0x386b25){logger[_0x100e('0x12')](_0x100e('0x13'),_0x351495,_0x100e('0x14'));logger[_0x100e('0x15')](_0x100e('0x16'),_0x351495,_0x100e('0x14'),JSON['stringify'](_0x386b25));if(_0x386b25['error']){if(_0x386b25['error'][_0x100e('0x17')]===0x1f4){logger[_0x100e('0x18')](_0x100e('0x13'),_0x351495,_0x386b25['error'][_0x100e('0x19')]);return _0x25a30b(_0x386b25[_0x100e('0x18')][_0x100e('0x19')]);}logger[_0x100e('0x18')](_0x100e('0x13'),_0x351495,_0x386b25['error'][_0x100e('0x19')]);return _0x34d294(_0x386b25[_0x100e('0x18')][_0x100e('0x19')]);}else{logger['info'](_0x100e('0x13'),_0x351495,_0x100e('0x14'));_0x34d294(_0x386b25[_0x100e('0x1a')][_0x100e('0x19')]);}})[_0x100e('0x1b')](function(_0x421c7e){logger['error'](_0x100e('0x13'),_0x351495,_0x421c7e);_0x25a30b(_0x421c7e);});});}exports['CreateChatMessage']=function(_0x593094){var _0x4ae083=this;return new Promise(function(_0x20b5a6,_0x11f596){return db[_0x100e('0x1c')]['create'](_0x593094[_0x100e('0x1d')],{'raw':_0x593094[_0x100e('0x1e')]?_0x593094[_0x100e('0x1e')][_0x100e('0x1f')]===undefined?!![]:![]:!![]})[_0x100e('0x20')](function(_0x457b45){logger[_0x100e('0x12')](_0x100e('0x21'),_0x593094);logger['debug'](_0x100e('0x21'),_0x593094,JSON[_0x100e('0x22')](_0x457b45));_0x20b5a6(_0x457b45);})['catch'](function(_0x439ceb){logger['error'](_0x100e('0x21'),_0x439ceb['message'],_0x593094);_0x11f596(_0x4ae083[_0x100e('0x18')](0x1f4,_0x439ceb[_0x100e('0x19')]));});});}; \ No newline at end of file +var _0x4d21=['info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request'];(function(_0x4703b5,_0x5c668d){var _0x37ff03=function(_0x3d08ce){while(--_0x3d08ce){_0x4703b5['push'](_0x4703b5['shift']());}};_0x37ff03(++_0x5c668d);}(_0x4d21,0xc3));var _0x14d2=function(_0x5a95b4,_0x1f919a){_0x5a95b4=_0x5a95b4-0x0;var _0xaf224d=_0x4d21[_0x5a95b4];return _0xaf224d;};'use strict';var _=require(_0x14d2('0x0'));var util=require(_0x14d2('0x1'));var moment=require(_0x14d2('0x2'));var BPromise=require(_0x14d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d2('0x4'));var db=require(_0x14d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14d2('0x6'));var config=require(_0x14d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14d2('0x8')][_0x14d2('0x9')]({'port':0x232a});config[_0x14d2('0xa')]=_[_0x14d2('0xb')](config[_0x14d2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x14d2('0xc'))(new Redis(config['redis']));require(_0x14d2('0xd'))['register'](socket);function respondWithRpcPromise(_0x3bb3aa,_0x4fd37b,_0x50826c){return new BPromise(function(_0x26a1cf,_0x30b541){return client[_0x14d2('0xe')](_0x3bb3aa,_0x50826c)['then'](function(_0x148265){logger[_0x14d2('0xf')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x14d2('0x10'));logger[_0x14d2('0x11')](_0x14d2('0x12'),_0x4fd37b,_0x14d2('0x10'),JSON[_0x14d2('0x13')](_0x148265));if(_0x148265['error']){if(_0x148265[_0x14d2('0x14')]['code']===0x1f4){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x30b541(_0x148265['error'][_0x14d2('0x15')]);}logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x26a1cf(_0x148265['error'][_0x14d2('0x15')]);}else{logger['info'](_0x14d2('0x16'),_0x4fd37b,_0x14d2('0x10'));_0x26a1cf(_0x148265[_0x14d2('0x17')][_0x14d2('0x15')]);}})['catch'](function(_0x2214a5){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x2214a5);_0x30b541(_0x2214a5);});});}exports[_0x14d2('0x18')]=function(_0x39f10d){var _0x32350e=this;return new Promise(function(_0x47e68e,_0x1c1b88){return db[_0x14d2('0x19')][_0x14d2('0x1a')](_0x39f10d[_0x14d2('0x1b')],{'raw':_0x39f10d[_0x14d2('0x1c')]?_0x39f10d[_0x14d2('0x1c')][_0x14d2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3a4ad3){logger[_0x14d2('0xf')](_0x14d2('0x18'),_0x39f10d);logger[_0x14d2('0x11')](_0x14d2('0x18'),_0x39f10d,JSON[_0x14d2('0x13')](_0x3a4ad3));_0x47e68e(_0x3a4ad3);})['catch'](function(_0x360f86){logger[_0x14d2('0x14')]('CreateChatMessage',_0x360f86[_0x14d2('0x15')],_0x39f10d);_0x1c1b88(_0x32350e[_0x14d2('0x14')](0x1f4,_0x360f86['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 26d255a..c16cd00 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 _0xa93e=['update','emit','removeListener','register','length','remove'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa93e,0x1df));var _0xea93=function(_0x270489,_0x145ce2){_0x270489=_0x270489-0x0;var _0x194d28=_0xa93e[_0x270489];return _0x194d28;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xea93('0x0'),_0xea93('0x1')];function createListener(_0x47d9db,_0xd64380){return function(_0x50af65){_0xd64380[_0xea93('0x2')](_0x47d9db,_0x50af65);};}function removeListener(_0x5b5341,_0x5398ba){return function(){ChatMessageEvents[_0xea93('0x3')](_0x5b5341,_0x5398ba);};}exports[_0xea93('0x4')]=function(_0x6c6985){for(var _0x26def3=0x0,_0x477a7d=events[_0xea93('0x5')];_0x26def3<_0x477a7d;_0x26def3++){var _0x54ebdf=events[_0x26def3];var _0x12876e=createListener('chatMessage:'+_0x54ebdf,_0x6c6985);ChatMessageEvents['on'](_0x54ebdf,_0x12876e);}}; \ No newline at end of file +var _0x99c9=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x3dc763,_0x18c359){var _0x1338f8=function(_0x32f76d){while(--_0x32f76d){_0x3dc763['push'](_0x3dc763['shift']());}};_0x1338f8(++_0x18c359);}(_0x99c9,0x13c));var _0x999c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x99c9[_0x565ed7];return _0x183ad7;};'use strict';var ChatMessageEvents=require(_0x999c('0x0'));var events=[_0x999c('0x1'),_0x999c('0x2'),_0x999c('0x3')];function createListener(_0x2bb83d,_0x16a7a3){return function(_0x31e9b1){_0x16a7a3['emit'](_0x2bb83d,_0x31e9b1);};}function removeListener(_0x2a4e06,_0x140cd5){return function(){ChatMessageEvents[_0x999c('0x4')](_0x2a4e06,_0x140cd5);};}exports[_0x999c('0x5')]=function(_0x2bdd73){for(var _0x14df32=0x0,_0x34f100=events[_0x999c('0x6')];_0x14df32<_0x34f100;_0x14df32++){var _0xc8a6b5=events[_0x14df32];var _0xb88ec1=createListener(_0x999c('0x7')+_0xc8a6b5,_0x2bdd73);ChatMessageEvents['on'](_0xc8a6b5,_0xb88ec1);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 4c77635..eed6d76 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 _0x6e73=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','multer','util','path','connect-timeout'];(function(_0x417160,_0x54ee37){var _0x270ad1=function(_0x4bd83e){while(--_0x4bd83e){_0x417160['push'](_0x417160['shift']());}};_0x270ad1(++_0x54ee37);}(_0x6e73,0x8c));var _0x36e7=function(_0x2abd11,_0x4e9bd0){_0x2abd11=_0x2abd11-0x0;var _0x192095=_0x6e73[_0x2abd11];return _0x192095;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require(_0x36e7('0x2'));var timeout=require(_0x36e7('0x3'));var express=require(_0x36e7('0x4'));var router=express[_0x36e7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36e7('0x6'));var interaction=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var controller=require(_0x36e7('0x9'));router['get']('/',auth[_0x36e7('0xa')](),controller[_0x36e7('0xb')]);router['get'](_0x36e7('0xc'),auth[_0x36e7('0xa')](),controller['describe']);router['get'](_0x36e7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x36e7('0xe')]('/',auth[_0x36e7('0xa')](),interaction[_0x36e7('0xf')](_0x36e7('0x10'),_0x36e7('0x11')),controller['create']);router[_0x36e7('0x12')](_0x36e7('0xd'),controller[_0x36e7('0x13')]);router[_0x36e7('0x12')](_0x36e7('0x14'),auth[_0x36e7('0xa')](),controller[_0x36e7('0x15')]);router[_0x36e7('0x12')](_0x36e7('0x16'),auth[_0x36e7('0xa')](),controller['reject']);router[_0x36e7('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x50b6=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','chatmessage:create','create','put','/:id/accept','/:id/reject'];(function(_0x21fc17,_0x1496c5){var _0x4bd46e=function(_0x3d76c8){while(--_0x3d76c8){_0x21fc17['push'](_0x21fc17['shift']());}};_0x4bd46e(++_0x1496c5);}(_0x50b6,0x18f));var _0x650b=function(_0x24d03d,_0x3f7e3e){_0x24d03d=_0x24d03d-0x0;var _0x20af54=_0x50b6[_0x24d03d];return _0x20af54;};'use strict';var multer=require(_0x650b('0x0'));var util=require(_0x650b('0x1'));var path=require(_0x650b('0x2'));var timeout=require('connect-timeout');var express=require(_0x650b('0x3'));var router=express[_0x650b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x650b('0x5'));var interaction=require(_0x650b('0x6'));var config=require(_0x650b('0x7'));var controller=require('./chatMessage.controller');router[_0x650b('0x8')]('/',auth[_0x650b('0x9')](),controller[_0x650b('0xa')]);router[_0x650b('0x8')](_0x650b('0xb'),auth[_0x650b('0x9')](),controller['describe']);router[_0x650b('0x8')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0xd')]);router['post']('/',auth[_0x650b('0x9')](),interaction['tracked']('chat',_0x650b('0xe')),controller[_0x650b('0xf')]);router[_0x650b('0x10')]('/:id',controller['update']);router['put'](_0x650b('0x11'),auth['isAuthenticated'](),controller['accept']);router[_0x650b('0x10')](_0x650b('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0x650b('0x13')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0x14')]);module[_0x650b('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 377bb27..1221dc0 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 _0xcb60=['TEXT','medium','sequelize','exports'];(function(_0xafe04f,_0x26de9c){var _0x3fc6ab=function(_0x240145){while(--_0x240145){_0xafe04f['push'](_0xafe04f['shift']());}};_0x3fc6ab(++_0x26de9c);}(_0xcb60,0x16e));var _0x0cb6=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xcb60[_0x1ae4a9];return _0x54d0b0;};'use strict';var Sequelize=require(_0x0cb6('0x0'));module[_0x0cb6('0x1')]={'body':{'type':Sequelize[_0x0cb6('0x2')](_0x0cb6('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x1ea6=['medium','exports','TEXT'];(function(_0x29a2ce,_0x5d6558){var _0x2fa9ea=function(_0x526d35){while(--_0x526d35){_0x29a2ce['push'](_0x29a2ce['shift']());}};_0x2fa9ea(++_0x5d6558);}(_0x1ea6,0x6d));var _0x61ea=function(_0x14487f,_0x2ce4cb){_0x14487f=_0x14487f-0x0;var _0x1aee0b=_0x1ea6[_0x14487f];return _0x1aee0b;};'use strict';var Sequelize=require('sequelize');module[_0x61ea('0x0')]={'body':{'type':Sequelize[_0x61ea('0x1')](_0x61ea('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index d53e3b0..33a926c 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(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7a54,0x106));var _0x47a5=function(_0x3533fe,_0x1767e3){_0x3533fe=_0x3533fe-0x0;var _0x87bc86=_0x7a54[_0x3533fe];return _0x87bc86;};'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(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x241045,_0x40b4a1){_0x241045=_0x241045-0x0;var _0x24eb4a=_0x7a54[_0x241045];return _0x24eb4a;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 863a5e0..4cd7999 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 _0xce93=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xce93,0x15f));var _0x3ce9=function(_0x31b137,_0xa54c07){_0x31b137=_0x31b137-0x0;var _0x35a4f8=_0xce93[_0x31b137];return _0x35a4f8;};'use strict';var _=require(_0x3ce9('0x0'));var util=require(_0x3ce9('0x1'));var logger=require('../../config/logger')(_0x3ce9('0x2'));var moment=require(_0x3ce9('0x3'));var BPromise=require(_0x3ce9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ce9('0x5'));var rimraf=require(_0x3ce9('0x6'));var config=require(_0x3ce9('0x7'));var attributes=require(_0x3ce9('0x8'));module[_0x3ce9('0x9')]=function(_0x424920,_0x676d9c){return _0x424920[_0x3ce9('0xa')](_0x3ce9('0xb'),attributes,{'tableName':_0x3ce9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ce9('0xd'),'collate':_0x3ce9('0xe')});}; \ No newline at end of file +var _0xa902=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x26b006,_0x5f25a2){var _0x4b7c04=function(_0x521781){while(--_0x521781){_0x26b006['push'](_0x26b006['shift']());}};_0x4b7c04(++_0x5f25a2);}(_0xa902,0x85));var _0x2a90=function(_0xc12ef6,_0x3f3852){_0xc12ef6=_0xc12ef6-0x0;var _0x242bd0=_0xa902[_0xc12ef6];return _0x242bd0;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))('api');var moment=require(_0x2a90('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x4'));var fs=require('fs');var path=require(_0x2a90('0x5'));var rimraf=require(_0x2a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x5a1a83,_0x16e85b){return _0x5a1a83[_0x2a90('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x2a90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2a90('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index d9edc02..c8aedd3 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 _0x0cc8=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x0cc8,0xcb));var _0x80cc=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x0cc8[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0x80cc('0x0'));var util=require('util');var moment=require(_0x80cc('0x1'));var BPromise=require(_0x80cc('0x2'));var rs=require(_0x80cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x80cc('0x4'));var logger=require('../../config/logger')(_0x80cc('0x5'));var config=require('../../config/environment');var jayson=require(_0x80cc('0x6'));var client=jayson[_0x80cc('0x7')][_0x80cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x487346,_0x21415d,_0x10a0b8){return new BPromise(function(_0x1de064,_0x19087a){return client[_0x80cc('0x9')](_0x487346,_0x10a0b8)[_0x80cc('0xa')](function(_0x443f15){logger[_0x80cc('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21415d,_0x80cc('0xc'));logger[_0x80cc('0xd')](_0x80cc('0xe'),_0x21415d,_0x80cc('0xc'),JSON['stringify'](_0x443f15));if(_0x443f15[_0x80cc('0xf')]){if(_0x443f15[_0x80cc('0xf')]['code']===0x1f4){logger[_0x80cc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21415d,_0x443f15[_0x80cc('0xf')]['message']);return _0x19087a(_0x443f15[_0x80cc('0xf')][_0x80cc('0x10')]);}logger[_0x80cc('0xf')](_0x80cc('0x11'),_0x21415d,_0x443f15['error'][_0x80cc('0x10')]);return _0x1de064(_0x443f15['error'][_0x80cc('0x10')]);}else{logger['info'](_0x80cc('0x11'),_0x21415d,_0x80cc('0xc'));_0x1de064(_0x443f15[_0x80cc('0x12')]['message']);}})['catch'](function(_0x49e90d){logger['error'](_0x80cc('0x11'),_0x21415d,_0x49e90d);_0x19087a(_0x49e90d);});});} \ No newline at end of file +var _0xa34e=['ioredis','../../config/environment','jayson/promise','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0xa34e,0x19e));var _0xea34=function(_0x3af270,_0x5675b4){_0x3af270=_0x3af270-0x0;var _0x1dc18a=_0xa34e[_0x3af270];return _0x1dc18a;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var moment=require('moment');var BPromise=require(_0xea34('0x2'));var rs=require(_0xea34('0x3'));var fs=require('fs');var Redis=require(_0xea34('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xea34('0x5'));var jayson=require(_0xea34('0x6'));var client=jayson[_0xea34('0x7')][_0xea34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ee77,_0x3e10af,_0xdcdb59){return new BPromise(function(_0x54d3ee,_0x1d0e1a){return client['request'](_0x34ee77,_0xdcdb59)[_0xea34('0x9')](function(_0x415328){logger[_0xea34('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e10af,'request\x20sent');logger[_0xea34('0xb')](_0xea34('0xc'),_0x3e10af,_0xea34('0xd'),JSON[_0xea34('0xe')](_0x415328));if(_0x415328['error']){if(_0x415328[_0xea34('0xf')]['code']===0x1f4){logger['error'](_0xea34('0x10'),_0x3e10af,_0x415328[_0xea34('0xf')][_0xea34('0x11')]);return _0x1d0e1a(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}logger[_0xea34('0xf')](_0xea34('0x10'),_0x3e10af,_0x415328['error'][_0xea34('0x11')]);return _0x54d3ee(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}else{logger['info'](_0xea34('0x10'),_0x3e10af,_0xea34('0xd'));_0x54d3ee(_0x415328['result'][_0xea34('0x11')]);}})[_0xea34('0x12')](function(_0x2b1380){logger['error'](_0xea34('0x10'),_0x3e10af,_0x2b1380);_0x1d0e1a(_0x2b1380);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0ab1fd7..ebdd5e6 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 _0x778a=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x778a,0xdc));var _0xa778=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0x778a[_0x104993];return _0x105a96;};'use strict';var multer=require(_0xa778('0x0'));var util=require(_0xa778('0x1'));var path=require('path');var timeout=require(_0xa778('0x2'));var express=require(_0xa778('0x3'));var router=express[_0xa778('0x4')]();var fs_extra=require(_0xa778('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa778('0x6'));var config=require(_0xa778('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa778('0x8')]);router[_0xa778('0x9')]('/describe',auth[_0xa778('0xa')](),controller[_0xa778('0xb')]);router['get'](_0xa778('0xc'),auth[_0xa778('0xa')](),controller[_0xa778('0xd')]);router[_0xa778('0xe')]('/',auth[_0xa778('0xa')](),controller[_0xa778('0xf')]);router[_0xa778('0x10')]('/:id',auth[_0xa778('0xa')](),controller[_0xa778('0x11')]);router['delete'](_0xa778('0xc'),auth[_0xa778('0xa')](),controller[_0xa778('0x12')]);module[_0xa778('0x13')]=router; \ No newline at end of file +var _0x06f1=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x06f1,0x77));var _0x106f=function(_0x5c0e7d,_0x5827a1){_0x5c0e7d=_0x5c0e7d-0x0;var _0x47775e=_0x06f1[_0x5c0e7d];return _0x47775e;};'use strict';var multer=require(_0x106f('0x0'));var util=require(_0x106f('0x1'));var path=require(_0x106f('0x2'));var timeout=require('connect-timeout');var express=require(_0x106f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x106f('0x4'));var interaction=require(_0x106f('0x5'));var config=require(_0x106f('0x6'));var controller=require(_0x106f('0x7'));router[_0x106f('0x8')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xa')]);router[_0x106f('0x8')](_0x106f('0xb'),auth[_0x106f('0x9')](),controller[_0x106f('0xc')]);router['get'](_0x106f('0xd'),auth[_0x106f('0x9')](),controller['show']);router[_0x106f('0xe')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xf')]);router[_0x106f('0x10')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x11')]);router[_0x106f('0x12')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x13')]);module[_0x106f('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3cc37eb..eef8638 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 _0xaa37=['INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x3f6beb,_0x5090d7){var _0xd758bf=function(_0x17ffec){while(--_0x17ffec){_0x3f6beb['push'](_0x3f6beb['shift']());}};_0xd758bf(++_0x5090d7);}(_0xaa37,0xc9));var _0x7aa3=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xaa37[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x7aa3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7aa3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7aa3('0x2')](_0x7aa3('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7aa3('0x1')]},'timeout':{'type':Sequelize[_0x7aa3('0x4')]}}; \ No newline at end of file +var _0x6480=['exports','STRING','ENUM','timeout','INTEGER','sequelize'];(function(_0x12fa03,_0x1bfe2b){var _0x4d7545=function(_0x234921){while(--_0x234921){_0x12fa03['push'](_0x12fa03['shift']());}};_0x4d7545(++_0x1bfe2b);}(_0x6480,0x12b));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0648('0x0'));module[_0x0648('0x1')]={'name':{'type':Sequelize[_0x0648('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0648('0x3')]('mouseOver',_0x0648('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0648('0x2')]},'timeout':{'type':Sequelize[_0x0648('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 02f6e8b..0f20f93 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 _0x6e12=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','stack','name','show','ChatProactiveAction','rawAttributes','query','keys','intersection','model','attributes','fields','length','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox'];(function(_0x7e5cfe,_0x5809e1){var _0x2624c4=function(_0x43194a){while(--_0x43194a){_0x7e5cfe['push'](_0x7e5cfe['shift']());}};_0x2624c4(++_0x5809e1);}(_0x6e12,0x154));var _0x26e1=function(_0x27e8c4,_0x1321e4){_0x27e8c4=_0x27e8c4-0x0;var _0x1673e2=_0x6e12[_0x27e8c4];return _0x1673e2;};'use strict';var emlformat=require(_0x26e1('0x0'));var rimraf=require(_0x26e1('0x1'));var zipdir=require(_0x26e1('0x2'));var jsonpatch=require(_0x26e1('0x3'));var rp=require('request-promise');var moment=require(_0x26e1('0x4'));var BPromise=require(_0x26e1('0x5'));var Mustache=require(_0x26e1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x26e1('0x7'));var csv=require(_0x26e1('0x8'));var ejs=require(_0x26e1('0x9'));var fs=require('fs');var fs_extra=require(_0x26e1('0xa'));var _=require(_0x26e1('0xb'));var squel=require('squel');var crypto=require(_0x26e1('0xc'));var jsforce=require(_0x26e1('0xd'));var deskjs=require(_0x26e1('0xe'));var toCsv=require(_0x26e1('0x8'));var querystring=require(_0x26e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x26e1('0x10'));var authService=require(_0x26e1('0x11'));var qs=require(_0x26e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e1('0x13'));var logger=require(_0x26e1('0x14'))(_0x26e1('0x15'));var utils=require(_0x26e1('0x16'));var config=require(_0x26e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e1('0x18'))['db'];function respondWithStatusCode(_0x21ff26,_0x124c88){_0x124c88=_0x124c88||0xcc;return function(_0x4a85d3){if(_0x4a85d3){return _0x21ff26[_0x26e1('0x19')](_0x124c88);}return _0x21ff26[_0x26e1('0x1a')](_0x124c88)[_0x26e1('0x1b')]();};}function respondWithResult(_0x46a37b,_0x4ef6fe){_0x4ef6fe=_0x4ef6fe||0xc8;return function(_0x532aee){if(_0x532aee){return _0x46a37b[_0x26e1('0x1a')](_0x4ef6fe)[_0x26e1('0x1c')](_0x532aee);}};}function respondWithFilteredResult(_0x2bbe71,_0x1f845f){return function(_0x438eca){if(_0x438eca){var _0x5edd81=typeof _0x1f845f[_0x26e1('0x1d')]===_0x26e1('0x1e')&&typeof _0x1f845f['limit']===_0x26e1('0x1e');var _0x1043e1=_0x438eca[_0x26e1('0x1f')];var _0x1bb967=_0x5edd81?0x0:_0x1f845f[_0x26e1('0x1d')];var _0xf7a3c5=_0x5edd81?_0x438eca[_0x26e1('0x1f')]:_0x1f845f['offset']+_0x1f845f['limit'];var _0x2b5c48;if(_0xf7a3c5>=_0x1043e1){_0xf7a3c5=_0x1043e1;_0x2b5c48=0xc8;}else{_0x2b5c48=0xce;}_0x2bbe71[_0x26e1('0x1a')](_0x2b5c48);return _0x2bbe71[_0x26e1('0x20')]('Content-Range',_0x1bb967+'-'+_0xf7a3c5+'/'+_0x1043e1)[_0x26e1('0x1c')](_0x438eca);}return null;};}function patchUpdates(_0x53886f){return function(_0x46feb5){try{jsonpatch['apply'](_0x46feb5,_0x53886f,!![]);}catch(_0x2612e9){return BPromise[_0x26e1('0x21')](_0x2612e9);}return _0x46feb5[_0x26e1('0x22')]();};}function saveUpdates(_0x5dc73e,_0x248a21){return function(_0x36e971){if(_0x36e971){return _0x36e971[_0x26e1('0x23')](_0x5dc73e)[_0x26e1('0x24')](function(_0x371324){return _0x371324;});}return null;};}function removeEntity(_0x6f0034,_0x51b5bf){return function(_0x22598f){if(_0x22598f){return _0x22598f[_0x26e1('0x25')]()['then'](function(){_0x6f0034[_0x26e1('0x1a')](0xcc)[_0x26e1('0x1b')]();});}};}function handleEntityNotFound(_0x21ed95,_0x287379){return function(_0xac95a4){if(!_0xac95a4){_0x21ed95[_0x26e1('0x19')](0x194);}return _0xac95a4;};}function handleError(_0x112285,_0x5973c1){_0x5973c1=_0x5973c1||0x1f4;return function(_0x5f31fa){logger['error'](_0x5f31fa[_0x26e1('0x26')]);if(_0x5f31fa[_0x26e1('0x27')]){delete _0x5f31fa[_0x26e1('0x27')];}_0x112285['status'](_0x5973c1)['send'](_0x5f31fa);};}exports[_0x26e1('0x28')]=function(_0xeed638,_0x385698){var _0x2abff3={'raw':!![],'where':{'id':_0xeed638['params']['id']}},_0x2e4c78={};_0x2e4c78['model']=_['keys'](db[_0x26e1('0x29')][_0x26e1('0x2a')]);_0x2e4c78[_0x26e1('0x2b')]=_[_0x26e1('0x2c')](_0xeed638['query']);_0x2e4c78['filters']=_[_0x26e1('0x2d')](_0x2e4c78[_0x26e1('0x2e')],_0x2e4c78[_0x26e1('0x2b')]);_0x2abff3[_0x26e1('0x2f')]=_[_0x26e1('0x2d')](_0x2e4c78[_0x26e1('0x2e')],qs[_0x26e1('0x30')](_0xeed638['query'][_0x26e1('0x30')]));_0x2abff3[_0x26e1('0x2f')]=_0x2abff3['attributes'][_0x26e1('0x31')]?_0x2abff3[_0x26e1('0x2f')]:_0x2e4c78[_0x26e1('0x2e')];if(_0xeed638['query']['includeAll']){_0x2abff3[_0x26e1('0x32')]=[{'all':!![]}];}_0x2abff3=_[_0x26e1('0x33')]({},_0x2abff3,_0xeed638[_0x26e1('0x34')]);return db['ChatProactiveAction'][_0x26e1('0x35')](_0x2abff3)[_0x26e1('0x24')](handleEntityNotFound(_0x385698,null))[_0x26e1('0x24')](respondWithResult(_0x385698,null))[_0x26e1('0x36')](handleError(_0x385698,null));};exports[_0x26e1('0x37')]=function(_0xe8cbc6,_0x3d8a7){return db[_0x26e1('0x29')][_0x26e1('0x37')](_0xe8cbc6[_0x26e1('0x38')],{})[_0x26e1('0x24')](respondWithResult(_0x3d8a7,0xc9))['catch'](handleError(_0x3d8a7,null));};exports[_0x26e1('0x23')]=function(_0x39584a,_0x254ab2){if(_0x39584a['body']['id']){delete _0x39584a[_0x26e1('0x38')]['id'];}return db['ChatProactiveAction'][_0x26e1('0x35')]({'where':{'id':_0x39584a[_0x26e1('0x39')]['id']}})[_0x26e1('0x24')](handleEntityNotFound(_0x254ab2,null))[_0x26e1('0x24')](saveUpdates(_0x39584a[_0x26e1('0x38')],null))['then'](respondWithResult(_0x254ab2,null))[_0x26e1('0x36')](handleError(_0x254ab2,null));};exports['destroy']=function(_0x36ff0e,_0x5565d3){return db[_0x26e1('0x29')][_0x26e1('0x35')]({'where':{'id':_0x36ff0e[_0x26e1('0x39')]['id']}})[_0x26e1('0x24')](handleEntityNotFound(_0x5565d3,null))[_0x26e1('0x24')](removeEntity(_0x5565d3,null))[_0x26e1('0x36')](handleError(_0x5565d3,null));}; \ No newline at end of file +var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x1912cd,_0x1746bf){var _0x3c9336=function(_0x157695){while(--_0x157695){_0x1912cd['push'](_0x1912cd['shift']());}};_0x3c9336(++_0x1746bf);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x5ea210,_0x246fbc){_0x5ea210=_0x5ea210-0x0;var _0x31f084=_0xbcc7[_0x5ea210];return _0x31f084;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 073a2ae..4ebf8c7 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 _0xde2a=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2fcbf7,_0x2850c8){var _0x15c90f=function(_0x3694dd){while(--_0x3694dd){_0x2fcbf7['push'](_0x2fcbf7['shift']());}};_0x15c90f(++_0x2850c8);}(_0xde2a,0x18c));var _0xade2=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xde2a[_0x374ada];return _0x449ed8;};'use strict';var _=require(_0xade2('0x0'));var util=require('util');var logger=require(_0xade2('0x1'))(_0xade2('0x2'));var moment=require('moment');var BPromise=require(_0xade2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xade2('0x4'));var rimraf=require(_0xade2('0x5'));var config=require(_0xade2('0x6'));var attributes=require(_0xade2('0x7'));module[_0xade2('0x8')]=function(_0x3a2b51,_0x3fa2ce){return _0x3a2b51[_0xade2('0x9')](_0xade2('0xa'),attributes,{'tableName':_0xade2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdae7=['define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xdae7,0x1f0));var _0x7dae=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xdae7[_0xe0c564];return _0x32e0f6;};'use strict';var _=require(_0x7dae('0x0'));var util=require(_0x7dae('0x1'));var logger=require(_0x7dae('0x2'))(_0x7dae('0x3'));var moment=require(_0x7dae('0x4'));var BPromise=require(_0x7dae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dae('0x6'));var rimraf=require(_0x7dae('0x7'));var config=require(_0x7dae('0x8'));var attributes=require(_0x7dae('0x9'));module[_0x7dae('0xa')]=function(_0x36462c,_0x75a8fb){return _0x36462c[_0x7dae('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x7dae('0xc'),'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 83f0b4e..8fbdc46 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 _0xd19e=['message','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x6cf5af,_0x44dc8c){var _0x465f3a=function(_0x25146e){while(--_0x25146e){_0x6cf5af['push'](_0x6cf5af['shift']());}};_0x465f3a(++_0x44dc8c);}(_0xd19e,0xf9));var _0xed19=function(_0x4ccffd,_0xd9c2d7){_0x4ccffd=_0x4ccffd-0x0;var _0xb9e766=_0xd19e[_0x4ccffd];return _0xb9e766;};'use strict';var _=require('lodash');var util=require(_0xed19('0x0'));var moment=require('moment');var BPromise=require(_0xed19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed19('0x2'))['db'];var utils=require(_0xed19('0x3'));var logger=require('../../config/logger')(_0xed19('0x4'));var config=require(_0xed19('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xed19('0x6')][_0xed19('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x423851,_0x2bbc9b,_0x1daec0){return new BPromise(function(_0x34950b,_0x3e8e66){return client[_0xed19('0x8')](_0x423851,_0x1daec0)[_0xed19('0x9')](function(_0x4fbef4){logger[_0xed19('0xa')](_0xed19('0xb'),_0x2bbc9b,_0xed19('0xc'));logger[_0xed19('0xd')](_0xed19('0xe'),_0x2bbc9b,_0xed19('0xc'),JSON['stringify'](_0x4fbef4));if(_0x4fbef4['error']){if(_0x4fbef4['error'][_0xed19('0xf')]===0x1f4){logger[_0xed19('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bbc9b,_0x4fbef4[_0xed19('0x10')]['message']);return _0x3e8e66(_0x4fbef4[_0xed19('0x10')]['message']);}logger['error'](_0xed19('0xb'),_0x2bbc9b,_0x4fbef4[_0xed19('0x10')][_0xed19('0x11')]);return _0x34950b(_0x4fbef4[_0xed19('0x10')][_0xed19('0x11')]);}else{logger[_0xed19('0xa')](_0xed19('0xb'),_0x2bbc9b,'request\x20sent');_0x34950b(_0x4fbef4['result'][_0xed19('0x11')]);}})[_0xed19('0x12')](function(_0x22e964){logger['error'](_0xed19('0xb'),_0x2bbc9b,_0x22e964);_0x3e8e66(_0x22e964);});});} \ No newline at end of file +var _0xb21b=['client','request','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1470b4,_0x660ead){var _0x14dd3f=function(_0x45324a){while(--_0x45324a){_0x1470b4['push'](_0x1470b4['shift']());}};_0x14dd3f(++_0x660ead);}(_0xb21b,0x185));var _0xbb21=function(_0x767c,_0x5e6b61){_0x767c=_0x767c-0x0;var _0x1883ad=_0xb21b[_0x767c];return _0x1883ad;};'use strict';var _=require(_0xbb21('0x0'));var util=require(_0xbb21('0x1'));var moment=require(_0xbb21('0x2'));var BPromise=require(_0xbb21('0x3'));var rs=require(_0xbb21('0x4'));var fs=require('fs');var Redis=require(_0xbb21('0x5'));var db=require(_0xbb21('0x6'))['db'];var utils=require(_0xbb21('0x7'));var logger=require(_0xbb21('0x8'))(_0xbb21('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb21('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540a1f,_0x47a903,_0x460b98){return new BPromise(function(_0x12c4df,_0x15d5b0){return client[_0xbb21('0xb')](_0x540a1f,_0x460b98)[_0xbb21('0xc')](function(_0x382b8e){logger[_0xbb21('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0xbb21('0xe'));logger[_0xbb21('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x47a903,'request\x20sent',JSON['stringify'](_0x382b8e));if(_0x382b8e[_0xbb21('0x10')]){if(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);return _0x15d5b0(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);}logger[_0xbb21('0x10')](_0xbb21('0x13'),_0x47a903,_0x382b8e[_0xbb21('0x10')]['message']);return _0x12c4df(_0x382b8e['error'][_0xbb21('0x12')]);}else{logger[_0xbb21('0xd')](_0xbb21('0x13'),_0x47a903,_0xbb21('0xe'));_0x12c4df(_0x382b8e[_0xbb21('0x14')][_0xbb21('0x12')]);}})['catch'](function(_0x199e1c){logger['error'](_0xbb21('0x13'),_0x47a903,_0x199e1c);_0x15d5b0(_0x199e1c);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 524b3fb..2456941 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x17ebaa,_0x4131f2){var _0x6f00df=function(_0x247816){while(--_0x247816){_0x17ebaa['push'](_0x17ebaa['shift']());}};_0x6f00df(++_0x4131f2);}(_0x53ec,0x192));var _0xc53e=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0x53ec[_0x1e1fe9];return _0x4eeb06;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0xdd5ad9,_0x3ed961){var _0x18e168=function(_0x52f7ba){while(--_0x52f7ba){_0xdd5ad9['push'](_0xdd5ad9['shift']());}};_0x18e168(++_0x3ed961);}(_0xa630,0xbe));var _0x0a63=function(_0x4e5343,_0x3df35b){_0x4e5343=_0x4e5343-0x0;var _0x4f8e9d=_0xa630[_0x4e5343];return _0x4f8e9d;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('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 a40a75a..f8eacd0 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 _0x6e1c=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6e1c,0x1e6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xc6e1('0x0')]={'name':{'type':Sequelize[_0xc6e1('0x1')],'unique':_0xc6e1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc6e1('0x1')]},'timeout':{'type':Sequelize[_0xc6e1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc6e1('0x4')](_0xc6e1('0x5'),_0xc6e1('0x6'),_0xc6e1('0x7'))}}; \ No newline at end of file +var _0xd9e7=['ENUM','rrmemory','sequelize','STRING','name'];(function(_0x403687,_0x10c094){var _0x27e03f=function(_0x391589){while(--_0x391589){_0x403687['push'](_0x403687['shift']());}};_0x27e03f(++_0x10c094);}(_0xd9e7,0x7f));var _0x7d9e=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xd9e7[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0x7d9e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d9e('0x1')],'unique':_0x7d9e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d9e('0x3')](_0x7d9e('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 bbcbe78..00daa82 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 _0x8116=['name','send','map','ChatQueue','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','User','agent','chatPause','format','SIP','createdAt','updatedAt','getTeams','Team','rawAttributes','order','ids','Agents','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','clone','push','toString','SELECT','every','TeamId','all','union','isEmpty','emit','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','request\x20sent','debug','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','info','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x8116,0x1ec));var _0x6811=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8116[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6811('0x0'));var rimraf=require(_0x6811('0x1'));var zipdir=require(_0x6811('0x2'));var jsonpatch=require(_0x6811('0x3'));var rp=require(_0x6811('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6811('0x5'));var util=require('util');var path=require(_0x6811('0x6'));var sox=require('sox');var csv=require(_0x6811('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6811('0x8'));var _=require('lodash');var squel=require(_0x6811('0x9'));var crypto=require(_0x6811('0xa'));var jsforce=require(_0x6811('0xb'));var deskjs=require(_0x6811('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6811('0xd'));var Redis=require('ioredis');var authService=require(_0x6811('0xe'));var qs=require(_0x6811('0xf'));var as=require(_0x6811('0x10'));var hardwareService=require(_0x6811('0x11'));var logger=require(_0x6811('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6811('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6811('0x14')]=_['defaults'](config[_0x6811('0x14')],{'host':_0x6811('0x15'),'port':0x18eb});var socket=require(_0x6811('0x16'))(new Redis(config[_0x6811('0x14')]));require(_0x6811('0x17'))[_0x6811('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6811('0x19')][_0x6811('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x24aa91,_0x5cc1ac,_0x1be751,_0x1b0bcb){return new BPromise(function(_0x23f5ba,_0x3e9b65){var _0x50449c=_0x1b0bcb||client;return _0x50449c[_0x6811('0x1b')](_0x24aa91,_0x1be751)['then'](function(_0x412fce){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5cc1ac,_0x6811('0x1c'));logger[_0x6811('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5cc1ac,_0x6811('0x1c'),JSON[_0x6811('0x1e')](_0x412fce));if(_0x412fce['error']){if(_0x412fce[_0x6811('0x1f')][_0x6811('0x20')]===0x1f4){logger[_0x6811('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5cc1ac,_0x412fce[_0x6811('0x1f')][_0x6811('0x21')]);return _0x3e9b65(_0x412fce[_0x6811('0x1f')]['message']);}logger['error'](_0x6811('0x22'),_0x5cc1ac,_0x412fce[_0x6811('0x1f')][_0x6811('0x21')]);return _0x23f5ba(_0x412fce['error'][_0x6811('0x21')]);}else{logger[_0x6811('0x23')](_0x6811('0x22'),_0x5cc1ac,_0x6811('0x1c'));_0x23f5ba(_0x412fce[_0x6811('0x24')][_0x6811('0x21')]);}})[_0x6811('0x25')](function(_0x2068d4){logger[_0x6811('0x1f')](_0x6811('0x22'),_0x5cc1ac,_0x2068d4);_0x3e9b65(_0x2068d4);});});}function respondWithStatusCode(_0x240908,_0x233726){_0x233726=_0x233726||0xcc;return function(_0x1ee5c1){if(_0x1ee5c1){return _0x240908['sendStatus'](_0x233726);}return _0x240908[_0x6811('0x26')](_0x233726)[_0x6811('0x27')]();};}function respondWithResult(_0xdc51e0,_0x4cbc78){_0x4cbc78=_0x4cbc78||0xc8;return function(_0x5e66e7){if(_0x5e66e7){return _0xdc51e0['status'](_0x4cbc78)[_0x6811('0x28')](_0x5e66e7);}};}function respondWithFilteredResult(_0x32e8ff,_0x136c40){return function(_0x14c5b8){if(_0x14c5b8){var _0x388b46=typeof _0x136c40[_0x6811('0x29')]===_0x6811('0x2a')&&typeof _0x136c40[_0x6811('0x2b')]===_0x6811('0x2a');var _0x525074=_0x14c5b8[_0x6811('0x2c')];var _0x448657=_0x388b46?0x0:_0x136c40[_0x6811('0x29')];var _0x380a49=_0x388b46?_0x14c5b8['count']:_0x136c40[_0x6811('0x29')]+_0x136c40[_0x6811('0x2b')];var _0x2f29d9;if(_0x380a49>=_0x525074){_0x380a49=_0x525074;_0x2f29d9=0xc8;}else{_0x2f29d9=0xce;}_0x32e8ff[_0x6811('0x26')](_0x2f29d9);return _0x32e8ff['set'](_0x6811('0x2d'),_0x448657+'-'+_0x380a49+'/'+_0x525074)['json'](_0x14c5b8);}return null;};}function patchUpdates(_0x419ef0){return function(_0x522598){try{jsonpatch[_0x6811('0x2e')](_0x522598,_0x419ef0,!![]);}catch(_0x1b3d6d){return BPromise[_0x6811('0x2f')](_0x1b3d6d);}return _0x522598[_0x6811('0x30')]();};}function saveUpdates(_0x34a7f8,_0x48897e){return function(_0x5cde5c){if(_0x5cde5c){return _0x5cde5c['update'](_0x34a7f8)[_0x6811('0x31')](function(_0x10c7b0){return _0x10c7b0;});}return null;};}function removeEntity(_0x63d3fa,_0x13997d){return function(_0x10d7d7){if(_0x10d7d7){return _0x10d7d7[_0x6811('0x32')]()[_0x6811('0x31')](function(){var _0x3290b2=_0x10d7d7[_0x6811('0x33')]({'plain':!![]});var _0x3cc383=_0x6811('0x34');return db[_0x6811('0x35')][_0x6811('0x32')]({'where':{'type':_0x3cc383,'resourceId':_0x3290b2['id']}})['then'](function(){return _0x10d7d7;});})['then'](function(){_0x63d3fa[_0x6811('0x26')](0xcc)[_0x6811('0x27')]();});}};}function handleEntityNotFound(_0x5c54e5,_0x262eb6){return function(_0x389ff5){if(!_0x389ff5){_0x5c54e5[_0x6811('0x36')](0x194);}return _0x389ff5;};}function handleError(_0x23cdd3,_0x5869ea){_0x5869ea=_0x5869ea||0x1f4;return function(_0x3db3d8){logger[_0x6811('0x1f')](_0x3db3d8[_0x6811('0x37')]);if(_0x3db3d8[_0x6811('0x38')]){delete _0x3db3d8[_0x6811('0x38')];}_0x23cdd3[_0x6811('0x26')](_0x5869ea)[_0x6811('0x39')](_0x3db3d8);};}exports['index']=function(_0x2ed525,_0x18a47c){var _0x4efefb={},_0x107b6a={},_0x424e1c={'count':0x0,'rows':[]};var _0x37d3ef=_[_0x6811('0x3a')](db[_0x6811('0x3b')]['rawAttributes'],function(_0x227bbc){return{'name':_0x227bbc['fieldName'],'type':_0x227bbc['type'][_0x6811('0x3c')]};});_0x107b6a[_0x6811('0x3d')]=_['map'](_0x37d3ef,'name');_0x107b6a[_0x6811('0x3e')]=_[_0x6811('0x3f')](_0x2ed525[_0x6811('0x3e')]);_0x107b6a[_0x6811('0x40')]=_[_0x6811('0x41')](_0x107b6a['model'],_0x107b6a[_0x6811('0x3e')]);_0x4efefb[_0x6811('0x42')]=_[_0x6811('0x41')](_0x107b6a[_0x6811('0x3d')],qs[_0x6811('0x43')](_0x2ed525[_0x6811('0x3e')][_0x6811('0x43')]));_0x4efefb[_0x6811('0x42')]=_0x4efefb[_0x6811('0x42')][_0x6811('0x44')]?_0x4efefb[_0x6811('0x42')]:_0x107b6a[_0x6811('0x3d')];if(!_0x2ed525[_0x6811('0x3e')]['hasOwnProperty'](_0x6811('0x45'))){_0x4efefb['limit']=qs[_0x6811('0x2b')](_0x2ed525[_0x6811('0x3e')][_0x6811('0x2b')]);_0x4efefb[_0x6811('0x29')]=qs['offset'](_0x2ed525['query']['offset']);}_0x4efefb['order']=qs[_0x6811('0x46')](_0x2ed525['query']['sort']);_0x4efefb[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x2ed525[_0x6811('0x3e')],_0x107b6a['filters']),_0x37d3ef);if(_0x2ed525[_0x6811('0x3e')][_0x6811('0x49')]){_0x4efefb['where']=_[_0x6811('0x4a')](_0x4efefb[_0x6811('0x47')],{'$or':_[_0x6811('0x3a')](_0x37d3ef,function(_0x2d2218){if(_0x2d2218['type']!==_0x6811('0x4b')){var _0x7ebf18={};_0x7ebf18[_0x2d2218['name']]={'$like':'%'+_0x2ed525['query']['filter']+'%'};return _0x7ebf18;}})});}_0x4efefb=_[_0x6811('0x4a')]({},_0x4efefb,_0x2ed525[_0x6811('0x4c')]);var _0x11c683={'where':_0x4efefb['where']};return db['ChatQueue'][_0x6811('0x2c')](_0x11c683)['then'](function(_0x5987cb){_0x424e1c[_0x6811('0x2c')]=_0x5987cb;if(_0x2ed525[_0x6811('0x3e')][_0x6811('0x4d')]){_0x4efefb['include']=[{'all':!![]}];}return db['ChatQueue'][_0x6811('0x4e')](_0x4efefb);})[_0x6811('0x31')](function(_0x1fe555){_0x424e1c['rows']=_0x1fe555;return _0x424e1c;})[_0x6811('0x31')](respondWithFilteredResult(_0x18a47c,_0x4efefb))[_0x6811('0x25')](handleError(_0x18a47c,null));};exports[_0x6811('0x4f')]=function(_0x1acf8f,_0x4873b9){var _0x3575e1={'raw':!![],'where':{'id':_0x1acf8f[_0x6811('0x50')]['id']}},_0x1e4d83={};_0x1e4d83[_0x6811('0x3d')]=_['keys'](db[_0x6811('0x3b')]['rawAttributes']);_0x1e4d83[_0x6811('0x3e')]=_['keys'](_0x1acf8f[_0x6811('0x3e')]);_0x1e4d83[_0x6811('0x40')]=_[_0x6811('0x41')](_0x1e4d83[_0x6811('0x3d')],_0x1e4d83[_0x6811('0x3e')]);_0x3575e1['attributes']=_[_0x6811('0x41')](_0x1e4d83['model'],qs[_0x6811('0x43')](_0x1acf8f[_0x6811('0x3e')]['fields']));_0x3575e1['attributes']=_0x3575e1[_0x6811('0x42')][_0x6811('0x44')]?_0x3575e1['attributes']:_0x1e4d83[_0x6811('0x3d')];if(_0x1acf8f['query']['includeAll']){_0x3575e1[_0x6811('0x51')]=[{'all':!![]}];}_0x3575e1=_['merge']({},_0x3575e1,_0x1acf8f[_0x6811('0x4c')]);return db[_0x6811('0x3b')][_0x6811('0x52')](_0x3575e1)['then'](handleEntityNotFound(_0x4873b9,null))[_0x6811('0x31')](respondWithResult(_0x4873b9,null))[_0x6811('0x25')](handleError(_0x4873b9,null));};exports[_0x6811('0x53')]=function(_0xa3d821,_0x118d24){return db[_0x6811('0x3b')][_0x6811('0x53')](_0xa3d821[_0x6811('0x54')],{})[_0x6811('0x31')](function(_0x3d75a5){var _0x80777c=_0xa3d821[_0x6811('0x55')][_0x6811('0x33')]({'plain':!![]});if(!_0x80777c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x80777c[_0x6811('0x56')]===_0x6811('0x55')){var _0x1ba8ef=_0x3d75a5['get']({'plain':!![]});var _0x31673c=_0x6811('0x34');return db[_0x6811('0x57')][_0x6811('0x52')]({'where':{'name':_0x31673c,'userProfileId':_0x80777c[_0x6811('0x58')]},'raw':!![]})[_0x6811('0x31')](function(_0x44bb38){if(_0x44bb38&&_0x44bb38[_0x6811('0x59')]===0x0){return db[_0x6811('0x35')][_0x6811('0x53')]({'name':_0x1ba8ef[_0x6811('0x38')],'resourceId':_0x1ba8ef['id'],'type':_0x44bb38[_0x6811('0x38')],'sectionId':_0x44bb38['id']},{})[_0x6811('0x31')](function(){return _0x3d75a5;});}else{return _0x3d75a5;}})[_0x6811('0x25')](function(_0x52c6e5){logger[_0x6811('0x1f')](_0x6811('0x5a'),_0x52c6e5);throw _0x52c6e5;});}return _0x3d75a5;})[_0x6811('0x31')](respondWithResult(_0x118d24,0xc9))[_0x6811('0x25')](handleError(_0x118d24,null));};exports['update']=function(_0x1ac3a7,_0x5483ed){if(_0x1ac3a7[_0x6811('0x54')]['id']){delete _0x1ac3a7[_0x6811('0x54')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x1ac3a7[_0x6811('0x50')]['id']}})['then'](handleEntityNotFound(_0x5483ed,null))[_0x6811('0x31')](saveUpdates(_0x1ac3a7['body'],null))[_0x6811('0x31')](respondWithResult(_0x5483ed,null))[_0x6811('0x25')](handleError(_0x5483ed,null));};exports['destroy']=function(_0xc60934,_0x4e532e){return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0xc60934[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x4e532e,null))[_0x6811('0x31')](removeEntity(_0x4e532e,null))[_0x6811('0x25')](handleError(_0x4e532e,null));};exports[_0x6811('0x5b')]=function(_0x379c9f,_0x5846c6){return db[_0x6811('0x3b')]['describe']()[_0x6811('0x31')](respondWithResult(_0x5846c6,null))['catch'](handleError(_0x5846c6,null));};exports[_0x6811('0x5c')]=function(_0x38da3a,_0x56a474,_0x12100c){var _0x3f9dcc={'raw':!![],'where':{}},_0x340fb1={},_0xe88f01;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x38da3a['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x56a474,null))[_0x6811('0x31')](function(_0x24e5f7){if(_0x24e5f7){_0xe88f01=_0x24e5f7['get']({'plain':!![]});_0x340fb1['model']=_[_0x6811('0x3f')](db[_0x6811('0x5e')]['rawAttributes']);_0x340fb1[_0x6811('0x3e')]=_['keys'](_0x38da3a[_0x6811('0x3e')]);_0x340fb1[_0x6811('0x40')]=_['intersection'](_0x340fb1[_0x6811('0x3d')],_0x340fb1[_0x6811('0x3e')]);_0x3f9dcc['attributes']=_[_0x6811('0x41')](_0x340fb1[_0x6811('0x3d')],qs['fields'](_0x38da3a[_0x6811('0x3e')][_0x6811('0x43')]));_0x3f9dcc[_0x6811('0x42')]=_0x3f9dcc[_0x6811('0x42')][_0x6811('0x44')]?_0x3f9dcc[_0x6811('0x42')]:_0x340fb1[_0x6811('0x3d')];if(!_0x38da3a[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x3f9dcc['limit']=qs[_0x6811('0x2b')](_0x38da3a[_0x6811('0x3e')]['limit']);_0x3f9dcc['offset']=qs[_0x6811('0x29')](_0x38da3a[_0x6811('0x3e')]['offset']);}_0x3f9dcc['order']=qs['sort'](_0x38da3a[_0x6811('0x3e')][_0x6811('0x46')]);_0x3f9dcc[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x38da3a['query'],_0x340fb1['filters']));_0x3f9dcc['where']['ChatQueueId']=_0x24e5f7['id'];if(_0x38da3a[_0x6811('0x3e')]['filter']){_0x3f9dcc[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x3f9dcc[_0x6811('0x47')],{'$or':_['map'](_0x3f9dcc[_0x6811('0x42')],function(_0x439cc8){var _0x2f041d={};_0x2f041d[_0x439cc8]={'$like':'%'+_0x38da3a['query']['filter']+'%'};return _0x2f041d;})});}_0x3f9dcc=_[_0x6811('0x4a')]({},_0x3f9dcc,_0x38da3a[_0x6811('0x4c')]);return db[_0x6811('0x5e')][_0x6811('0x4e')](_0x3f9dcc);}})['then'](function(_0x4497ff){if(_0x4497ff){return db[_0x6811('0x60')]['findAndCountAll']({'where':{'id':_['map'](_0x4497ff,'UserId'),'role':_0x6811('0x61')},'attributes':['id',_0x6811('0x38'),_0x6811('0x62'),'updatedAt','createdAt']});}})[_0x6811('0x31')](function(_0x4ec261){if(_0x4ec261){return{'count':_0x4ec261[_0x6811('0x2c')],'rows':_[_0x6811('0x3a')](_0x4ec261['rows'],function(_0x3ebb0c){return{'membername':_0x3ebb0c['name'],'UserId':_0x3ebb0c['id'],'queue_name':_0xe88f01[_0x6811('0x38')],'ChatQueueId':_0xe88f01['id'],'interface':util[_0x6811('0x63')]('%s/%s',_0x6811('0x64'),_0x3ebb0c[_0x6811('0x38')]),'penalty':0x0,'paused':_0x3ebb0c[_0x6811('0x62')],'createdAt':_0x3ebb0c[_0x6811('0x65')],'updatedAt':_0x3ebb0c[_0x6811('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6811('0x31')](respondWithFilteredResult(_0x56a474,_0x3f9dcc))[_0x6811('0x25')](handleError(_0x56a474,null));};exports[_0x6811('0x67')]=function(_0x459189,_0x5cb588,_0x564fe7){var _0x1bbf5f={};var _0x4fb056={};var _0x1c8623;var _0x1f8e57;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x459189['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x5cb588,null))[_0x6811('0x31')](function(_0x631e7){if(_0x631e7){_0x1c8623=_0x631e7;_0x4fb056[_0x6811('0x3d')]=_[_0x6811('0x3f')](db[_0x6811('0x68')][_0x6811('0x69')]);_0x4fb056[_0x6811('0x3e')]=_[_0x6811('0x3f')](_0x459189['query']);_0x4fb056[_0x6811('0x40')]=_[_0x6811('0x41')](_0x4fb056[_0x6811('0x3d')],_0x4fb056[_0x6811('0x3e')]);_0x1bbf5f['attributes']=_[_0x6811('0x41')](_0x4fb056[_0x6811('0x3d')],qs[_0x6811('0x43')](_0x459189[_0x6811('0x3e')]['fields']));_0x1bbf5f[_0x6811('0x42')]=_0x1bbf5f[_0x6811('0x42')]['length']?_0x1bbf5f[_0x6811('0x42')]:_0x4fb056[_0x6811('0x3d')];_0x1bbf5f[_0x6811('0x6a')]=qs[_0x6811('0x46')](_0x459189[_0x6811('0x3e')]['sort']);_0x1bbf5f[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x459189[_0x6811('0x3e')],_0x4fb056[_0x6811('0x40')]));if(_0x459189[_0x6811('0x3e')][_0x6811('0x49')]){_0x1bbf5f[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x1bbf5f[_0x6811('0x47')],{'$or':_[_0x6811('0x3a')](_0x1bbf5f[_0x6811('0x42')],function(_0x31c84a){var _0x2baed9={};_0x2baed9[_0x31c84a]={'$like':'%'+_0x459189[_0x6811('0x3e')][_0x6811('0x49')]+'%'};return _0x2baed9;})});}_0x1bbf5f=_['merge']({},_0x1bbf5f,_0x459189[_0x6811('0x4c')]);return _0x1c8623['getTeams'](_0x1bbf5f);}})['then'](function(_0x58c64c){if(_0x58c64c){_0x1f8e57=_0x58c64c[_0x6811('0x44')];if(!_0x459189[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x1bbf5f['limit']=qs[_0x6811('0x2b')](_0x459189['query'][_0x6811('0x2b')]);_0x1bbf5f['offset']=qs[_0x6811('0x29')](_0x459189[_0x6811('0x3e')]['offset']);}return _0x1c8623['getTeams'](_0x1bbf5f);}})['then'](function(_0xc255a7){if(_0xc255a7){return _0xc255a7?{'count':_0x1f8e57,'rows':_0xc255a7}:null;}})[_0x6811('0x31')](respondWithResult(_0x5cb588,null))[_0x6811('0x25')](handleError(_0x5cb588,null));};exports['addTeams']=function(_0x3fce2c,_0xbfc2be,_0x1fa1e3){var _0x92d8cc=_0x3fce2c[_0x6811('0x54')][_0x6811('0x6b')];return db['Team'][_0x6811('0x4e')]({'where':{'id':_0x92d8cc},'attributes':['id'],'include':[{'model':db[_0x6811('0x60')],'as':_0x6811('0x6c'),'attributes':['id',_0x6811('0x38'),'online','voicePause','interface'],'raw':!![]}]})[_0x6811('0x31')](function(_0x3f0d42){if(_0x3f0d42){var _0x4550d0=_[_0x6811('0x6d')](_0x3f0d42,function(_0x5707c3){var _0x1519f7=_0x5707c3[_0x6811('0x33')]({'plain':!![]});return _0x1519f7[_0x6811('0x6c')];});return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0x3fce2c['params']['id']}})[_0x6811('0x31')](function(_0x533dfc){return db[_0x6811('0x6e')][_0x6811('0x6f')](function(_0x17b7af){return _0x533dfc[_0x6811('0x70')](_0x92d8cc,{'transaction':_0x17b7af})[_0x6811('0x31')](function(){return BPromise[_0x6811('0x71')](_0x4550d0,function(_0x5c3caa){return db[_0x6811('0x5e')][_0x6811('0x72')]({'where':{'UserId':_0x5c3caa['id'],'ChatQueueId':_0x3fce2c[_0x6811('0x50')]['id']},'transaction':_0x17b7af});});})['then'](function(){_0x4550d0[_0x6811('0x73')](function(_0x168e11){socket['emit']('userChatQueue:save',{'UserId':_0x168e11['id'],'ChatQueueId':_0x533dfc['id']});});});});});}})['then'](respondWithStatusCode(_0xbfc2be,null))['catch'](handleError(_0xbfc2be,null));};exports[_0x6811('0x74')]=function(_0xab3c00,_0x4aae87,_0x4864af){return db['Team'][_0x6811('0x4e')]({'where':{'id':_0xab3c00[_0x6811('0x3e')][_0x6811('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6811('0x31')](handleEntityNotFound(_0x4aae87,null))['then'](function(_0x5d4f66){var _0x129ef0=_[_0x6811('0x3a')](_0x5d4f66,'id');var _0x3a9fe1=[];var _0x58bb69=[];var _0x17f9ee=squel['select']();_0x17f9ee[_0x6811('0x75')](_0x6811('0x76'))['from'](_0x6811('0x77'),'tq')['join'](_0x6811('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0xab3c00[_0x6811('0x50')]['id']);for(var _0x4b9fa2=0x0;_0x4b9fa2<_0x5d4f66['length'];_0x4b9fa2+=0x1){let _0x4985b6=_0x5d4f66[_0x4b9fa2];for(var _0x1bd565=0x0;_0x1bd565<_0x4985b6['Agents'][_0x6811('0x44')];_0x1bd565+=0x1){let _0x488a67=_0x4985b6[_0x6811('0x6c')][_0x1bd565];var _0x1f56a5=_0x17f9ee[_0x6811('0x79')]();_0x1f56a5['where']('ut.UserId\x20=\x20?',_0x488a67['id']);_0x58bb69[_0x6811('0x7a')](db[_0x6811('0x6e')][_0x6811('0x3e')](_0x1f56a5[_0x6811('0x7b')](),{'type':db[_0x6811('0x6e')]['QueryTypes'][_0x6811('0x7c')]})['then'](function(_0x2f82fc){if(_0x2f82fc[_0x6811('0x44')]===0x1){return _0x488a67['id'];}else{var _0x598b1b=_[_0x6811('0x7d')](_[_0x6811('0x3a')](_0x2f82fc,_0x6811('0x7e')),function(_0x13b535){return _['includes'](_0x129ef0,_0x13b535);});if(_0x598b1b){return _0x488a67['id'];}}}));}}return BPromise[_0x6811('0x7f')](_0x58bb69)[_0x6811('0x31')](function(_0x164c7f){_0x3a9fe1=_(_0x3a9fe1)[_0x6811('0x80')](_0x164c7f)['compact']()['value']();return db['ChatQueue']['find']({'where':{'id':_0xab3c00[_0x6811('0x50')]['id']}})[_0x6811('0x31')](function(_0x37c7cd){return db[_0x6811('0x6e')][_0x6811('0x6f')](function(_0x4ef228){return _0x37c7cd[_0x6811('0x74')](_0xab3c00[_0x6811('0x3e')][_0x6811('0x6b')],{'transaction':_0x4ef228})[_0x6811('0x31')](function(){if(!_[_0x6811('0x81')](_0x3a9fe1)){return _0x37c7cd['removeAgents'](_0x3a9fe1,{'transaction':_0x4ef228});}})['then'](function(){_0x3a9fe1[_0x6811('0x73')](function(_0x3baf37){socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':_0x3baf37,'ChatQueueId':_0x37c7cd['id']});});});});});});})[_0x6811('0x31')](respondWithStatusCode(_0x4aae87,null))['catch'](handleError(_0x4aae87,null));};exports[_0x6811('0x84')]=function(_0x262119,_0x3c3da8,_0x21d530){return db['ChatQueue']['find']({'where':{'id':_0x262119['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x3c3da8,null))[_0x6811('0x31')](function(_0x1bb2a6){if(_0x1bb2a6){return _0x1bb2a6[_0x6811('0x84')](_0x262119['body'][_0x6811('0x6b')],_[_0x6811('0x85')](_0x262119[_0x6811('0x54')],[_0x6811('0x6b'),'id'])||{})['spread'](function(_0x1cbd93){for(var _0x23a762=0x0;_0x23a762<_0x262119['body'][_0x6811('0x6b')][_0x6811('0x44')];_0x23a762+=0x1){socket[_0x6811('0x82')]('userChatQueue:save',{'UserId':Number(_0x262119[_0x6811('0x54')][_0x6811('0x6b')][_0x23a762]),'ChatQueueId':Number(_0x262119[_0x6811('0x50')]['id'])});}return _0x1cbd93;});}})[_0x6811('0x31')](respondWithResult(_0x3c3da8,null))['catch'](handleError(_0x3c3da8,null));};exports[_0x6811('0x86')]=function(_0x4df6ce,_0x52083f,_0x458180){return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0x4df6ce[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x52083f,null))[_0x6811('0x31')](function(_0x403945){if(_0x403945){return _0x403945[_0x6811('0x86')](_0x4df6ce[_0x6811('0x3e')]['ids'])[_0x6811('0x31')](function(){if(_[_0x6811('0x87')](_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')])){for(var _0x1a270d=0x0;_0x1a270d<_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')][_0x6811('0x44')];_0x1a270d+=0x1){socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':Number(_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')][_0x1a270d]),'ChatQueueId':Number(_0x4df6ce[_0x6811('0x50')]['id'])});}}else{socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':Number(_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')]),'ChatQueueId':Number(_0x4df6ce[_0x6811('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x52083f,null))[_0x6811('0x25')](handleError(_0x52083f,null));};exports[_0x6811('0x88')]=function(_0x1581c8,_0x1cc579,_0x13ffd6){var _0x34857b={};var _0x409eb2={};var _0x4f8a02;var _0x11ad84;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x1581c8[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x1cc579,null))[_0x6811('0x31')](function(_0x2cd8b0){if(_0x2cd8b0){_0x4f8a02=_0x2cd8b0;_0x409eb2[_0x6811('0x3d')]=_['keys'](db[_0x6811('0x60')]['rawAttributes']);_0x409eb2['query']=_[_0x6811('0x3f')](_0x1581c8[_0x6811('0x3e')]);_0x409eb2[_0x6811('0x40')]=_['intersection'](_0x409eb2[_0x6811('0x3d')],_0x409eb2['query']);_0x34857b[_0x6811('0x42')]=_[_0x6811('0x41')](_0x409eb2[_0x6811('0x3d')],qs['fields'](_0x1581c8['query'][_0x6811('0x43')]));_0x34857b[_0x6811('0x42')]=_0x34857b[_0x6811('0x42')][_0x6811('0x44')]?_0x34857b[_0x6811('0x42')]:_0x409eb2['model'];_0x34857b[_0x6811('0x6a')]=qs[_0x6811('0x46')](_0x1581c8['query']['sort']);_0x34857b[_0x6811('0x47')]=qs[_0x6811('0x40')](_[_0x6811('0x48')](_0x1581c8['query'],_0x409eb2[_0x6811('0x40')]));if(_0x1581c8['query']['filter']){_0x34857b[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x34857b['where'],{'$or':_[_0x6811('0x3a')](_0x34857b[_0x6811('0x42')],function(_0x39bf03){var _0x1d7ca6={};_0x1d7ca6[_0x39bf03]={'$like':'%'+_0x1581c8[_0x6811('0x3e')]['filter']+'%'};return _0x1d7ca6;})});}_0x34857b=_['merge']({},_0x34857b,_0x1581c8[_0x6811('0x4c')]);return _0x4f8a02[_0x6811('0x88')](_0x34857b);}})['then'](function(_0x48432b){if(_0x48432b){_0x11ad84=_0x48432b[_0x6811('0x44')];if(!_0x1581c8[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x34857b['limit']=qs[_0x6811('0x2b')](_0x1581c8[_0x6811('0x3e')][_0x6811('0x2b')]);_0x34857b['offset']=qs[_0x6811('0x29')](_0x1581c8['query'][_0x6811('0x29')]);}return _0x4f8a02[_0x6811('0x88')](_0x34857b);}})[_0x6811('0x31')](function(_0x593bce){if(_0x593bce){return _0x593bce?{'count':_0x11ad84,'rows':_0x593bce}:null;}})[_0x6811('0x31')](respondWithResult(_0x1cc579,null))[_0x6811('0x25')](handleError(_0x1cc579,null));}; \ No newline at end of file +var _0xbf30=['isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','sendStatus','status','offset','limit','undefined','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value'];(function(_0x214229,_0x1a5e58){var _0x55912c=function(_0x350571){while(--_0x350571){_0x214229['push'](_0x214229['shift']());}};_0x55912c(++_0x1a5e58);}(_0xbf30,0x1bb));var _0x0bf3=function(_0x3132a3,_0x411208){_0x3132a3=_0x3132a3-0x0;var _0x2eba4a=_0xbf30[_0x3132a3];return _0x2eba4a;};'use strict';var emlformat=require(_0x0bf3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bf3('0x1'));var moment=require(_0x0bf3('0x2'));var BPromise=require(_0x0bf3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0bf3('0x4'));var ejs=require(_0x0bf3('0x5'));var fs=require('fs');var fs_extra=require(_0x0bf3('0x6'));var _=require(_0x0bf3('0x7'));var squel=require(_0x0bf3('0x8'));var crypto=require(_0x0bf3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0bf3('0xa'));var toCsv=require(_0x0bf3('0x4'));var querystring=require('querystring');var Papa=require(_0x0bf3('0xb'));var Redis=require(_0x0bf3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0bf3('0xd'));var as=require(_0x0bf3('0xe'));var hardwareService=require(_0x0bf3('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0bf3('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bf3('0x11'))['db'];config[_0x0bf3('0x12')]=_[_0x0bf3('0x13')](config[_0x0bf3('0x12')],{'host':_0x0bf3('0x14'),'port':0x18eb});var socket=require(_0x0bf3('0x15'))(new Redis(config['redis']));require(_0x0bf3('0x16'))[_0x0bf3('0x17')](socket);var jayson=require(_0x0bf3('0x18'));var client=jayson['client'][_0x0bf3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xf990be,_0x1e3b8b,_0x4508bb,_0x148efe){return new BPromise(function(_0x3f83dd,_0x524c0f){var _0x2110b2=_0x148efe||client;return _0x2110b2[_0x0bf3('0x1a')](_0xf990be,_0x4508bb)[_0x0bf3('0x1b')](function(_0x3d59ca){logger[_0x0bf3('0x1c')](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));logger[_0x0bf3('0x1f')](_0x0bf3('0x20'),_0x1e3b8b,_0x0bf3('0x1e'),JSON[_0x0bf3('0x21')](_0x3d59ca));if(_0x3d59ca[_0x0bf3('0x22')]){if(_0x3d59ca[_0x0bf3('0x22')][_0x0bf3('0x23')]===0x1f4){logger['error'](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x524c0f(_0x3d59ca[_0x0bf3('0x22')]['message']);}logger[_0x0bf3('0x22')](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x3f83dd(_0x3d59ca[_0x0bf3('0x22')]['message']);}else{logger['info'](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));_0x3f83dd(_0x3d59ca[_0x0bf3('0x24')]['message']);}})[_0x0bf3('0x25')](function(_0x2eec90){logger[_0x0bf3('0x22')]('ChatQueue,\x20%s,\x20%s',_0x1e3b8b,_0x2eec90);_0x524c0f(_0x2eec90);});});}function respondWithStatusCode(_0x3cef4e,_0x10f3ef){_0x10f3ef=_0x10f3ef||0xcc;return function(_0x5184fb){if(_0x5184fb){return _0x3cef4e[_0x0bf3('0x26')](_0x10f3ef);}return _0x3cef4e[_0x0bf3('0x27')](_0x10f3ef)['end']();};}function respondWithResult(_0x8d0602,_0x24a0d1){_0x24a0d1=_0x24a0d1||0xc8;return function(_0x408e09){if(_0x408e09){return _0x8d0602[_0x0bf3('0x27')](_0x24a0d1)['json'](_0x408e09);}};}function respondWithFilteredResult(_0x5627f3,_0x130734){return function(_0x21d651){if(_0x21d651){var _0x54eb4b=typeof _0x130734[_0x0bf3('0x28')]==='undefined'&&typeof _0x130734[_0x0bf3('0x29')]===_0x0bf3('0x2a');var _0x53c8bd=_0x21d651['count'];var _0x122e59=_0x54eb4b?0x0:_0x130734['offset'];var _0x48cd92=_0x54eb4b?_0x21d651['count']:_0x130734[_0x0bf3('0x28')]+_0x130734[_0x0bf3('0x29')];var _0x3f8b86;if(_0x48cd92>=_0x53c8bd){_0x48cd92=_0x53c8bd;_0x3f8b86=0xc8;}else{_0x3f8b86=0xce;}_0x5627f3[_0x0bf3('0x27')](_0x3f8b86);return _0x5627f3['set'](_0x0bf3('0x2b'),_0x122e59+'-'+_0x48cd92+'/'+_0x53c8bd)['json'](_0x21d651);}return null;};}function patchUpdates(_0x1e8bb5){return function(_0x1ff26f){try{jsonpatch[_0x0bf3('0x2c')](_0x1ff26f,_0x1e8bb5,!![]);}catch(_0x22f25a){return BPromise[_0x0bf3('0x2d')](_0x22f25a);}return _0x1ff26f['save']();};}function saveUpdates(_0x35617e,_0x5870d3){return function(_0x442cec){if(_0x442cec){return _0x442cec[_0x0bf3('0x2e')](_0x35617e)[_0x0bf3('0x1b')](function(_0x172a99){return _0x172a99;});}return null;};}function removeEntity(_0x56b25d,_0x572134){return function(_0x45bdb9){if(_0x45bdb9){return _0x45bdb9[_0x0bf3('0x2f')]()[_0x0bf3('0x1b')](function(){var _0x12da08=_0x45bdb9[_0x0bf3('0x30')]({'plain':!![]});var _0x590a79=_0x0bf3('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x590a79,'resourceId':_0x12da08['id']}})[_0x0bf3('0x1b')](function(){return _0x45bdb9;});})[_0x0bf3('0x1b')](function(){_0x56b25d[_0x0bf3('0x27')](0xcc)[_0x0bf3('0x32')]();});}};}function handleEntityNotFound(_0xd55b18,_0xb53878){return function(_0x3be0d9){if(!_0x3be0d9){_0xd55b18[_0x0bf3('0x26')](0x194);}return _0x3be0d9;};}function handleError(_0x3226fb,_0x1c1ef5){_0x1c1ef5=_0x1c1ef5||0x1f4;return function(_0x46ab76){logger[_0x0bf3('0x22')](_0x46ab76[_0x0bf3('0x33')]);if(_0x46ab76[_0x0bf3('0x34')]){delete _0x46ab76[_0x0bf3('0x34')];}_0x3226fb[_0x0bf3('0x27')](_0x1c1ef5)['send'](_0x46ab76);};}exports[_0x0bf3('0x35')]=function(_0x10d8d6,_0x4021f6){var _0x149986={},_0x2cba70={},_0x294d45={'count':0x0,'rows':[]};var _0x13d2b7=_[_0x0bf3('0x36')](db[_0x0bf3('0x37')][_0x0bf3('0x38')],function(_0x205a91){return{'name':_0x205a91[_0x0bf3('0x39')],'type':_0x205a91[_0x0bf3('0x3a')]['key']};});_0x2cba70[_0x0bf3('0x3b')]=_[_0x0bf3('0x36')](_0x13d2b7,_0x0bf3('0x34'));_0x2cba70['query']=_[_0x0bf3('0x3c')](_0x10d8d6[_0x0bf3('0x3d')]);_0x2cba70['filters']=_[_0x0bf3('0x3e')](_0x2cba70['model'],_0x2cba70[_0x0bf3('0x3d')]);_0x149986[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x2cba70[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x10d8d6['query'][_0x0bf3('0x40')]));_0x149986[_0x0bf3('0x3f')]=_0x149986[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x149986[_0x0bf3('0x3f')]:_0x2cba70[_0x0bf3('0x3b')];if(!_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x149986[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x149986[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0x10d8d6[_0x0bf3('0x3d')]['offset']);}_0x149986['order']=qs[_0x0bf3('0x44')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x149986[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x10d8d6[_0x0bf3('0x3d')],_0x2cba70[_0x0bf3('0x46')]),_0x13d2b7);if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x149986[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x149986[_0x0bf3('0x45')],{'$or':_['map'](_0x13d2b7,function(_0x109c2d){if(_0x109c2d['type']!=='VIRTUAL'){var _0x551d9d={};_0x551d9d[_0x109c2d[_0x0bf3('0x34')]]={'$like':'%'+_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x551d9d;}})});}_0x149986=_[_0x0bf3('0x49')]({},_0x149986,_0x10d8d6[_0x0bf3('0x4a')]);var _0x30fc78={'where':_0x149986[_0x0bf3('0x45')]};return db[_0x0bf3('0x37')][_0x0bf3('0x4b')](_0x30fc78)[_0x0bf3('0x1b')](function(_0x5ad150){_0x294d45[_0x0bf3('0x4b')]=_0x5ad150;if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x149986[_0x0bf3('0x4d')]=[{'all':!![]}];}return db[_0x0bf3('0x37')]['findAll'](_0x149986);})[_0x0bf3('0x1b')](function(_0x26cb7a){_0x294d45[_0x0bf3('0x4e')]=_0x26cb7a;return _0x294d45;})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x4021f6,_0x149986))[_0x0bf3('0x25')](handleError(_0x4021f6,null));};exports[_0x0bf3('0x4f')]=function(_0x3cb3f9,_0x2651bf){var _0x1db4a5={'raw':!![],'where':{'id':_0x3cb3f9[_0x0bf3('0x50')]['id']}},_0x5b4527={};_0x5b4527[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x37')]['rawAttributes']);_0x5b4527[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x3cb3f9[_0x0bf3('0x3d')]);_0x5b4527[_0x0bf3('0x46')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],_0x5b4527[_0x0bf3('0x3d')]);_0x1db4a5[_0x0bf3('0x3f')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],qs['fields'](_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x40')]));_0x1db4a5[_0x0bf3('0x3f')]=_0x1db4a5[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x1db4a5[_0x0bf3('0x3f')]:_0x5b4527[_0x0bf3('0x3b')];if(_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x1db4a5[_0x0bf3('0x4d')]=[{'all':!![]}];}_0x1db4a5=_[_0x0bf3('0x49')]({},_0x1db4a5,_0x3cb3f9[_0x0bf3('0x4a')]);return db['ChatQueue'][_0x0bf3('0x51')](_0x1db4a5)[_0x0bf3('0x1b')](handleEntityNotFound(_0x2651bf,null))[_0x0bf3('0x1b')](respondWithResult(_0x2651bf,null))[_0x0bf3('0x25')](handleError(_0x2651bf,null));};exports['create']=function(_0x399111,_0x172534){return db[_0x0bf3('0x37')]['create'](_0x399111['body'],{})[_0x0bf3('0x1b')](function(_0x2b6bb8){var _0x3eae2b=_0x399111['user']['get']({'plain':!![]});if(!_0x3eae2b)throw new Error(_0x0bf3('0x52'));if(_0x3eae2b[_0x0bf3('0x53')]===_0x0bf3('0x54')){var _0x189870=_0x2b6bb8[_0x0bf3('0x30')]({'plain':!![]});var _0x5a3efb=_0x0bf3('0x31');return db[_0x0bf3('0x55')][_0x0bf3('0x51')]({'where':{'name':_0x5a3efb,'userProfileId':_0x3eae2b['userProfileId']},'raw':!![]})['then'](function(_0xb194ed){if(_0xb194ed&&_0xb194ed[_0x0bf3('0x56')]===0x0){return db['UserProfileResource'][_0x0bf3('0x57')]({'name':_0x189870['name'],'resourceId':_0x189870['id'],'type':_0xb194ed[_0x0bf3('0x34')],'sectionId':_0xb194ed['id']},{})[_0x0bf3('0x1b')](function(){return _0x2b6bb8;});}else{return _0x2b6bb8;}})[_0x0bf3('0x25')](function(_0x585533){logger[_0x0bf3('0x22')](_0x0bf3('0x58'),_0x585533);throw _0x585533;});}return _0x2b6bb8;})[_0x0bf3('0x1b')](respondWithResult(_0x172534,0xc9))[_0x0bf3('0x25')](handleError(_0x172534,null));};exports[_0x0bf3('0x2e')]=function(_0x38e3ba,_0x406a4b){if(_0x38e3ba[_0x0bf3('0x59')]['id']){delete _0x38e3ba['body']['id'];}return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x38e3ba[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x406a4b,null))['then'](saveUpdates(_0x38e3ba[_0x0bf3('0x59')],null))[_0x0bf3('0x1b')](respondWithResult(_0x406a4b,null))['catch'](handleError(_0x406a4b,null));};exports[_0x0bf3('0x2f')]=function(_0xd8b30e,_0x3a9fd7){return db['ChatQueue']['find']({'where':{'id':_0xd8b30e[_0x0bf3('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a9fd7,null))[_0x0bf3('0x1b')](removeEntity(_0x3a9fd7,null))[_0x0bf3('0x25')](handleError(_0x3a9fd7,null));};exports[_0x0bf3('0x5a')]=function(_0x3b9a62,_0x224039){return db['ChatQueue'][_0x0bf3('0x5a')]()[_0x0bf3('0x1b')](respondWithResult(_0x224039,null))[_0x0bf3('0x25')](handleError(_0x224039,null));};exports['getMembers']=function(_0x27d9d0,_0x301bce,_0x20c017){var _0x375fd8={'raw':!![],'where':{}},_0x994b78={},_0x4f3e7d;return db['ChatQueue'][_0x0bf3('0x5b')]({'where':{'id':_0x27d9d0[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x301bce,null))[_0x0bf3('0x1b')](function(_0x195bad){if(_0x195bad){_0x4f3e7d=_0x195bad[_0x0bf3('0x30')]({'plain':!![]});_0x994b78[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x5c')][_0x0bf3('0x38')]);_0x994b78[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x27d9d0[_0x0bf3('0x3d')]);_0x994b78[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],_0x994b78[_0x0bf3('0x3d')]);_0x375fd8['attributes']=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x27d9d0['query']['fields']));_0x375fd8[_0x0bf3('0x3f')]=_0x375fd8['attributes'][_0x0bf3('0x41')]?_0x375fd8['attributes']:_0x994b78[_0x0bf3('0x3b')];if(!_0x27d9d0['query'][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x375fd8[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x375fd8['offset']=qs['offset'](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}_0x375fd8[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0x27d9d0['query'][_0x0bf3('0x44')]);_0x375fd8[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x27d9d0[_0x0bf3('0x3d')],_0x994b78[_0x0bf3('0x46')]));_0x375fd8['where'][_0x0bf3('0x5e')]=_0x195bad['id'];if(_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x375fd8[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x375fd8[_0x0bf3('0x45')],{'$or':_['map'](_0x375fd8['attributes'],function(_0x857839){var _0x173ad0={};_0x173ad0[_0x857839]={'$like':'%'+_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x173ad0;})});}_0x375fd8=_[_0x0bf3('0x49')]({},_0x375fd8,_0x27d9d0['options']);return db[_0x0bf3('0x5c')][_0x0bf3('0x5f')](_0x375fd8);}})[_0x0bf3('0x1b')](function(_0x21cd89){if(_0x21cd89){return db[_0x0bf3('0x60')][_0x0bf3('0x61')]({'where':{'id':_['map'](_0x21cd89,_0x0bf3('0x62')),'role':_0x0bf3('0x63')},'attributes':['id',_0x0bf3('0x34'),_0x0bf3('0x64'),_0x0bf3('0x65'),_0x0bf3('0x66')]});}})[_0x0bf3('0x1b')](function(_0x4d2b67){if(_0x4d2b67){return{'count':_0x4d2b67[_0x0bf3('0x4b')],'rows':_['map'](_0x4d2b67[_0x0bf3('0x4e')],function(_0xb60014){return{'membername':_0xb60014[_0x0bf3('0x34')],'UserId':_0xb60014['id'],'queue_name':_0x4f3e7d[_0x0bf3('0x34')],'ChatQueueId':_0x4f3e7d['id'],'interface':util['format'](_0x0bf3('0x67'),_0x0bf3('0x68'),_0xb60014['name']),'penalty':0x0,'paused':_0xb60014[_0x0bf3('0x64')],'createdAt':_0xb60014['createdAt'],'updatedAt':_0xb60014[_0x0bf3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x301bce,_0x375fd8))[_0x0bf3('0x25')](handleError(_0x301bce,null));};exports[_0x0bf3('0x69')]=function(_0xaa43d1,_0x40364b,_0x55e7f4){var _0x611e07={};var _0x5f56a8={};var _0x24b235;var _0x209f8f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xaa43d1[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x40364b,null))[_0x0bf3('0x1b')](function(_0xbc6a67){if(_0xbc6a67){_0x24b235=_0xbc6a67;_0x5f56a8[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x6a')][_0x0bf3('0x38')]);_0x5f56a8[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0xaa43d1['query']);_0x5f56a8[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],_0x5f56a8[_0x0bf3('0x3d')]);_0x611e07[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],qs['fields'](_0xaa43d1['query']['fields']));_0x611e07[_0x0bf3('0x3f')]=_0x611e07[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x611e07['attributes']:_0x5f56a8['model'];_0x611e07[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x611e07[_0x0bf3('0x45')]=qs['filters'](_[_0x0bf3('0x47')](_0xaa43d1[_0x0bf3('0x3d')],_0x5f56a8['filters']));if(_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x611e07[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x611e07[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x611e07[_0x0bf3('0x3f')],function(_0x36f73b){var _0xd9918c={};_0xd9918c[_0x36f73b]={'$like':'%'+_0xaa43d1['query']['filter']+'%'};return _0xd9918c;})});}_0x611e07=_[_0x0bf3('0x49')]({},_0x611e07,_0xaa43d1[_0x0bf3('0x4a')]);return _0x24b235[_0x0bf3('0x69')](_0x611e07);}})[_0x0bf3('0x1b')](function(_0x3f9df2){if(_0x3f9df2){_0x209f8f=_0x3f9df2['length'];if(!_0xaa43d1['query'][_0x0bf3('0x42')]('nolimit')){_0x611e07[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x611e07[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0x24b235['getTeams'](_0x611e07);}})['then'](function(_0x51bf08){if(_0x51bf08){return _0x51bf08?{'count':_0x209f8f,'rows':_0x51bf08}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x40364b,null))[_0x0bf3('0x25')](handleError(_0x40364b,null));};exports['addTeams']=function(_0x20a481,_0x553845,_0x421fd4){var _0x4c64c4=_0x20a481[_0x0bf3('0x59')][_0x0bf3('0x6b')];return db[_0x0bf3('0x6a')]['findAll']({'where':{'id':_0x4c64c4},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id','name','online',_0x0bf3('0x6d'),_0x0bf3('0x6e')],'raw':!![]}]})[_0x0bf3('0x1b')](function(_0xbfe902){if(_0xbfe902){var _0x9bddee=_[_0x0bf3('0x6f')](_0xbfe902,function(_0x298e36){var _0x21d358=_0x298e36[_0x0bf3('0x30')]({'plain':!![]});return _0x21d358[_0x0bf3('0x6c')];});return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x20a481[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](function(_0x510612){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x5bc48a){return _0x510612['addTeams'](_0x4c64c4,{'transaction':_0x5bc48a})['then'](function(){return BPromise[_0x0bf3('0x72')](_0x9bddee,function(_0x3777eb){return db[_0x0bf3('0x5c')]['findOrCreate']({'where':{'UserId':_0x3777eb['id'],'ChatQueueId':_0x20a481['params']['id']},'transaction':_0x5bc48a});});})[_0x0bf3('0x1b')](function(){_0x9bddee[_0x0bf3('0x73')](function(_0x3cd61c){socket[_0x0bf3('0x74')](_0x0bf3('0x75'),{'UserId':_0x3cd61c['id'],'ChatQueueId':_0x510612['id']});});});});});}})['then'](respondWithStatusCode(_0x553845,null))[_0x0bf3('0x25')](handleError(_0x553845,null));};exports[_0x0bf3('0x76')]=function(_0x53c83c,_0x5f4c22,_0x2d1cc7){return db[_0x0bf3('0x6a')][_0x0bf3('0x5f')]({'where':{'id':_0x53c83c['query'][_0x0bf3('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x0bf3('0x1b')](handleEntityNotFound(_0x5f4c22,null))[_0x0bf3('0x1b')](function(_0x623fa7){var _0x71c6ad=_[_0x0bf3('0x36')](_0x623fa7,'id');var _0x35eb79=[];var _0x587bb2=[];var _0x165012=squel[_0x0bf3('0x77')]();_0x165012[_0x0bf3('0x78')]('tq.TeamId')[_0x0bf3('0x79')](_0x0bf3('0x7a'),'tq')[_0x0bf3('0x7b')](_0x0bf3('0x7c'),'ut',_0x0bf3('0x7d'))['where'](_0x0bf3('0x7e'),_0x53c83c[_0x0bf3('0x50')]['id']);for(var _0x3e0317=0x0;_0x3e0317<_0x623fa7['length'];_0x3e0317+=0x1){let _0x4f1a72=_0x623fa7[_0x3e0317];for(var _0x529fde=0x0;_0x529fde<_0x4f1a72[_0x0bf3('0x6c')][_0x0bf3('0x41')];_0x529fde+=0x1){let _0x360e9e=_0x4f1a72[_0x0bf3('0x6c')][_0x529fde];var _0x80f0e0=_0x165012[_0x0bf3('0x7f')]();_0x80f0e0[_0x0bf3('0x45')]('ut.UserId\x20=\x20?',_0x360e9e['id']);_0x587bb2[_0x0bf3('0x80')](db[_0x0bf3('0x70')][_0x0bf3('0x3d')](_0x80f0e0[_0x0bf3('0x81')](),{'type':db[_0x0bf3('0x70')]['QueryTypes'][_0x0bf3('0x82')]})[_0x0bf3('0x1b')](function(_0x19cea3){if(_0x19cea3[_0x0bf3('0x41')]===0x1){return _0x360e9e['id'];}else{var _0x4cf1e5=_[_0x0bf3('0x83')](_[_0x0bf3('0x36')](_0x19cea3,_0x0bf3('0x84')),function(_0x5c1295){return _['includes'](_0x71c6ad,_0x5c1295);});if(_0x4cf1e5){return _0x360e9e['id'];}}}));}}return BPromise[_0x0bf3('0x85')](_0x587bb2)['then'](function(_0x20fc70){_0x35eb79=_(_0x35eb79)[_0x0bf3('0x86')](_0x20fc70)[_0x0bf3('0x87')]()[_0x0bf3('0x88')]();return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x53c83c[_0x0bf3('0x50')]['id']}})['then'](function(_0x5e30e1){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x146fde){return _0x5e30e1['removeTeams'](_0x53c83c[_0x0bf3('0x3d')][_0x0bf3('0x6b')],{'transaction':_0x146fde})['then'](function(){if(!_[_0x0bf3('0x89')](_0x35eb79)){return _0x5e30e1[_0x0bf3('0x8a')](_0x35eb79,{'transaction':_0x146fde});}})[_0x0bf3('0x1b')](function(){_0x35eb79['forEach'](function(_0x523054){socket['emit'](_0x0bf3('0x8b'),{'UserId':_0x523054,'ChatQueueId':_0x5e30e1['id']});});});});});});})[_0x0bf3('0x1b')](respondWithStatusCode(_0x5f4c22,null))[_0x0bf3('0x25')](handleError(_0x5f4c22,null));};exports['addAgents']=function(_0x16976c,_0x484af5,_0x5df8a8){return db[_0x0bf3('0x37')]['find']({'where':{'id':_0x16976c[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x484af5,null))['then'](function(_0x4b6c26){if(_0x4b6c26){return _0x4b6c26[_0x0bf3('0x8c')](_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')],_[_0x0bf3('0x8d')](_0x16976c['body'],['ids','id'])||{})[_0x0bf3('0x8e')](function(_0x3cfec2){for(var _0x46f655=0x0;_0x46f655<_0x16976c['body'][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x46f655+=0x1){socket[_0x0bf3('0x74')]('userChatQueue:save',{'UserId':Number(_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')][_0x46f655]),'ChatQueueId':Number(_0x16976c[_0x0bf3('0x50')]['id'])});}return _0x3cfec2;});}})[_0x0bf3('0x1b')](respondWithResult(_0x484af5,null))[_0x0bf3('0x25')](handleError(_0x484af5,null));};exports[_0x0bf3('0x8a')]=function(_0x438199,_0x1fb0d3,_0x2071aa){return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x438199[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x1fb0d3,null))[_0x0bf3('0x1b')](function(_0x49200b){if(_0x49200b){return _0x49200b[_0x0bf3('0x8a')](_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')])[_0x0bf3('0x1b')](function(){if(_[_0x0bf3('0x8f')](_0x438199['query']['ids'])){for(var _0x465488=0x0;_0x465488<_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x465488+=0x1){socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x465488]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}}else{socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}});}})[_0x0bf3('0x1b')](respondWithStatusCode(_0x1fb0d3,null))['catch'](handleError(_0x1fb0d3,null));};exports[_0x0bf3('0x90')]=function(_0xfd4bd,_0x33b987,_0xd603f5){var _0x5c8da1={};var _0x577e7c={};var _0xa45ceb;var _0x3b726f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xfd4bd[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x33b987,null))[_0x0bf3('0x1b')](function(_0x413f0f){if(_0x413f0f){_0xa45ceb=_0x413f0f;_0x577e7c['model']=_[_0x0bf3('0x3c')](db['User']['rawAttributes']);_0x577e7c['query']=_[_0x0bf3('0x3c')](_0xfd4bd['query']);_0x577e7c['filters']=_[_0x0bf3('0x3e')](_0x577e7c[_0x0bf3('0x3b')],_0x577e7c['query']);_0x5c8da1['attributes']=_[_0x0bf3('0x3e')](_0x577e7c['model'],qs[_0x0bf3('0x40')](_0xfd4bd['query']['fields']));_0x5c8da1['attributes']=_0x5c8da1[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x5c8da1[_0x0bf3('0x3f')]:_0x577e7c[_0x0bf3('0x3b')];_0x5c8da1['order']=qs[_0x0bf3('0x44')](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x5c8da1['where']=qs['filters'](_[_0x0bf3('0x47')](_0xfd4bd[_0x0bf3('0x3d')],_0x577e7c[_0x0bf3('0x46')]));if(_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x5c8da1[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x5c8da1[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x5c8da1['attributes'],function(_0x270113){var _0x209d89={};_0x209d89[_0x270113]={'$like':'%'+_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x209d89;})});}_0x5c8da1=_[_0x0bf3('0x49')]({},_0x5c8da1,_0xfd4bd[_0x0bf3('0x4a')]);return _0xa45ceb[_0x0bf3('0x90')](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x53330c){if(_0x53330c){_0x3b726f=_0x53330c[_0x0bf3('0x41')];if(!_0xfd4bd[_0x0bf3('0x3d')]['hasOwnProperty'](_0x0bf3('0x43'))){_0x5c8da1[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xfd4bd[_0x0bf3('0x3d')]['limit']);_0x5c8da1[_0x0bf3('0x28')]=qs['offset'](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0xa45ceb['getAgents'](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x211a51){if(_0x211a51){return _0x211a51?{'count':_0x3b726f,'rows':_0x211a51}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x33b987,null))[_0x0bf3('0x25')](handleError(_0x33b987,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4731baa..6c6af53 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 _0x3fc6=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','save','update','remove'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x3fc6,0x159));var _0x63fc=function(_0x1511ce,_0x37e2d9){_0x1511ce=_0x1511ce-0x0;var _0x3986b7=_0x3fc6[_0x1511ce];return _0x3986b7;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var ChatQueue=require(_0x63fc('0x1'))['db'][_0x63fc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':_0x63fc('0x5')};function emitEvent(_0x133695){return function(_0x155db7,_0x13c33d,_0x4e6030){ChatQueueEvents['emit'](_0x133695+':'+_0x155db7['id'],_0x155db7);ChatQueueEvents[_0x63fc('0x6')](_0x133695,_0x155db7);_0x4e6030(null);};}for(var e in events){if(events[_0x63fc('0x7')](e)){var event=events[e];ChatQueue[_0x63fc('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xc0b9=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0xd65c8d,_0x50621a){var _0x5f1323=function(_0x290a16){while(--_0x290a16){_0xd65c8d['push'](_0xd65c8d['shift']());}};_0x5f1323(++_0x50621a);}(_0xc0b9,0x152));var _0x9c0b=function(_0x2e15d6,_0x388a92){_0x2e15d6=_0x2e15d6-0x0;var _0x582498=_0xc0b9[_0x2e15d6];return _0x582498;};'use strict';var EventEmitter=require(_0x9c0b('0x0'));var ChatQueue=require(_0x9c0b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c0b('0x2'),'afterUpdate':'update','afterDestroy':_0x9c0b('0x3')};function emitEvent(_0x39cd77){return function(_0x1db2c4,_0x59a53e,_0x472488){ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77+':'+_0x1db2c4['id'],_0x1db2c4);ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77,_0x1db2c4);_0x472488(null);};}for(var e in events){if(events[_0x9c0b('0x5')](e)){var event=events[e];ChatQueue[_0x9c0b('0x6')](e,emitEvent(event));}}module[_0x9c0b('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f6acbc8..f500e7b 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 _0x8669=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','lodash','util','../../config/logger'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x8669,0x1d1));var _0x9866=function(_0xba26f1,_0x2709c9){_0xba26f1=_0xba26f1-0x0;var _0x5d5831=_0x8669[_0xba26f1];return _0x5d5831;};'use strict';var _=require(_0x9866('0x0'));var util=require(_0x9866('0x1'));var logger=require(_0x9866('0x2'))(_0x9866('0x3'));var moment=require(_0x9866('0x4'));var BPromise=require(_0x9866('0x5'));var rp=require(_0x9866('0x6'));var fs=require('fs');var path=require(_0x9866('0x7'));var rimraf=require(_0x9866('0x8'));var config=require(_0x9866('0x9'));var attributes=require(_0x9866('0xa'));module['exports']=function(_0x56cba8,_0x43cf87){return _0x56cba8[_0x9866('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9026=['path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9026,0xdf));var _0x6902=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9026[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0x6902('0x0'));var logger=require(_0x6902('0x1'))(_0x6902('0x2'));var moment=require(_0x6902('0x3'));var BPromise=require('bluebird');var rp=require(_0x6902('0x4'));var fs=require('fs');var path=require(_0x6902('0x5'));var rimraf=require('rimraf');var config=require(_0x6902('0x6'));var attributes=require(_0x6902('0x7'));module[_0x6902('0x8')]=function(_0x17a475,_0x34c869){return _0x17a475[_0x6902('0x9')](_0x6902('0xa'),attributes,{'tableName':_0x6902('0xb'),'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 f502e90..b719144 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 _0x56c8=['include','attributes','map','model','then','ShowChatQueue','ChatQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','limit'];(function(_0x40a107,_0x5acc82){var _0x4beb59=function(_0x4bfb2a){while(--_0x4bfb2a){_0x40a107['push'](_0x40a107['shift']());}};_0x4beb59(++_0x5acc82);}(_0x56c8,0x12f));var _0x856c=function(_0x248876,_0x4660af){_0x248876=_0x248876-0x0;var _0xf1d63f=_0x56c8[_0x248876];return _0xf1d63f;};'use strict';var _=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var moment=require(_0x856c('0x2'));var BPromise=require(_0x856c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x856c('0x4'));var db=require(_0x856c('0x5'))['db'];var utils=require(_0x856c('0x6'));var logger=require(_0x856c('0x7'))(_0x856c('0x8'));var config=require('../../config/environment');var jayson=require(_0x856c('0x9'));var client=jayson[_0x856c('0xa')][_0x856c('0xb')]({'port':0x232a});config[_0x856c('0xc')]=_[_0x856c('0xd')](config[_0x856c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x856c('0xc')]));require(_0x856c('0xe'))[_0x856c('0xf')](socket);function respondWithRpcPromise(_0x4c173b,_0x4b8bbc,_0x56217b){return new BPromise(function(_0x619489,_0x36e8ef){return client[_0x856c('0x10')](_0x4c173b,_0x56217b)['then'](function(_0x134cc9){logger[_0x856c('0x11')]('ChatQueue,\x20%s,\x20%s',_0x4b8bbc,_0x856c('0x12'));logger[_0x856c('0x13')](_0x856c('0x14'),_0x4b8bbc,_0x856c('0x12'),JSON[_0x856c('0x15')](_0x134cc9));if(_0x134cc9[_0x856c('0x16')]){if(_0x134cc9[_0x856c('0x16')][_0x856c('0x17')]===0x1f4){logger['error'](_0x856c('0x18'),_0x4b8bbc,_0x134cc9['error'][_0x856c('0x19')]);return _0x36e8ef(_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);}logger[_0x856c('0x16')](_0x856c('0x18'),_0x4b8bbc,_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);return _0x619489(_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);}else{logger[_0x856c('0x11')](_0x856c('0x18'),_0x4b8bbc,_0x856c('0x12'));_0x619489(_0x134cc9[_0x856c('0x1a')][_0x856c('0x19')]);}})[_0x856c('0x1b')](function(_0x27c7cc){logger[_0x856c('0x16')](_0x856c('0x18'),_0x4b8bbc,_0x27c7cc);_0x36e8ef(_0x27c7cc);});});}exports[_0x856c('0x1c')]=function(_0x1a262a){var _0x347b1b=this;return new Promise(function(_0x1dd835,_0x4c42e0){return db['ChatQueue'][_0x856c('0x1d')]({'raw':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a262a[_0x856c('0x1e')]?_0x1a262a['options'][_0x856c('0x1f')]||null:null,'attributes':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')]['attributes']||null:null,'limit':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')][_0x856c('0x20')]||null:null,'include':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')][_0x856c('0x21')]?_['map'](_0x1a262a[_0x856c('0x1e')][_0x856c('0x21')],function(_0x4150ec){return{'model':db[_0x4150ec['model']],'as':_0x4150ec['as'],'attributes':_0x4150ec[_0x856c('0x22')],'include':_0x4150ec['include']?_[_0x856c('0x23')](_0x4150ec['include'],function(_0x3d38d4){return{'model':db[_0x3d38d4[_0x856c('0x24')]],'as':_0x3d38d4['as'],'attributes':_0x3d38d4['attributes'],'include':_0x3d38d4[_0x856c('0x21')]?_['map'](_0x3d38d4[_0x856c('0x21')],function(_0x384f5f){return{'model':db[_0x384f5f[_0x856c('0x24')]],'as':_0x384f5f['as'],'attributes':_0x384f5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x856c('0x25')](function(_0x3548ab){logger[_0x856c('0x11')]('GetChatQueue',_0x1a262a);logger['debug'](_0x856c('0x1c'),_0x1a262a,JSON[_0x856c('0x15')](_0x3548ab));_0x1dd835(_0x3548ab);})[_0x856c('0x1b')](function(_0x25cbab){logger[_0x856c('0x16')](_0x856c('0x1c'),_0x25cbab['message'],_0x1a262a);_0x4c42e0(_0x347b1b[_0x856c('0x16')](0x1f4,_0x25cbab[_0x856c('0x19')]));});});};exports[_0x856c('0x26')]=function(_0x39e4e){var _0x3ead28=this;return new Promise(function(_0x147f23,_0x5494c2){return db[_0x856c('0x27')][_0x856c('0x28')]({'raw':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x29')]===undefined?!![]:![]:!![],'where':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x1f')]||null:null,'attributes':_0x39e4e[_0x856c('0x1e')]?_0x39e4e[_0x856c('0x1e')][_0x856c('0x22')]||null:null,'include':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x21')]?_[_0x856c('0x23')](_0x39e4e[_0x856c('0x1e')][_0x856c('0x21')],function(_0x19acd5){return{'model':db[_0x19acd5[_0x856c('0x24')]],'as':_0x19acd5['as'],'attributes':_0x19acd5[_0x856c('0x22')],'include':_0x19acd5[_0x856c('0x21')]?_[_0x856c('0x23')](_0x19acd5[_0x856c('0x21')],function(_0x1faa6a){return{'model':db[_0x1faa6a[_0x856c('0x24')]],'as':_0x1faa6a['as'],'attributes':_0x1faa6a['attributes'],'include':_0x1faa6a['include']?_[_0x856c('0x23')](_0x1faa6a['include'],function(_0x208472){return{'model':db[_0x208472[_0x856c('0x24')]],'as':_0x208472['as'],'attributes':_0x208472[_0x856c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x856c('0x25')](function(_0x44ff0a){logger['info'](_0x856c('0x26'),_0x39e4e);logger[_0x856c('0x13')](_0x856c('0x26'),_0x39e4e,JSON[_0x856c('0x15')](_0x44ff0a));_0x147f23(_0x44ff0a);})[_0x856c('0x1b')](function(_0x4d7d48){logger[_0x856c('0x16')](_0x856c('0x26'),_0x4d7d48[_0x856c('0x19')],_0x39e4e);_0x5494c2(_0x3ead28[_0x856c('0x16')](0x1f4,_0x4d7d48[_0x856c('0x19')]));});});}; \ No newline at end of file +var _0xce2f=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowChatQueue','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result'];(function(_0x413a2f,_0x1eb399){var _0x1ad4f2=function(_0x5cf9b1){while(--_0x5cf9b1){_0x413a2f['push'](_0x413a2f['shift']());}};_0x1ad4f2(++_0x1eb399);}(_0xce2f,0x18a));var _0xfce2=function(_0x1b0d0d,_0x3d8d3f){_0x1b0d0d=_0x1b0d0d-0x0;var _0x2b7df9=_0xce2f[_0x1b0d0d];return _0x2b7df9;};'use strict';var _=require('lodash');var util=require(_0xfce2('0x0'));var moment=require(_0xfce2('0x1'));var BPromise=require(_0xfce2('0x2'));var rs=require(_0xfce2('0x3'));var fs=require('fs');var Redis=require(_0xfce2('0x4'));var db=require(_0xfce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfce2('0x6'))('rpc');var config=require(_0xfce2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfce2('0x8')][_0xfce2('0x9')]({'port':0x232a});config[_0xfce2('0xa')]=_[_0xfce2('0xb')](config[_0xfce2('0xa')],{'host':_0xfce2('0xc'),'port':0x18eb});var socket=require(_0xfce2('0xd'))(new Redis(config[_0xfce2('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2141d1,_0x512cc4,_0x3f0071){return new BPromise(function(_0x4b2866,_0x441666){return client['request'](_0x2141d1,_0x3f0071)[_0xfce2('0xe')](function(_0xd76e83){logger[_0xfce2('0xf')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xfce2('0x10'));logger['debug'](_0xfce2('0x11'),_0x512cc4,_0xfce2('0x10'),JSON[_0xfce2('0x12')](_0xd76e83));if(_0xd76e83[_0xfce2('0x13')]){if(_0xd76e83[_0xfce2('0x13')][_0xfce2('0x14')]===0x1f4){logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83[_0xfce2('0x13')][_0xfce2('0x15')]);return _0x441666(_0xd76e83['error'][_0xfce2('0x15')]);}logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83['error'][_0xfce2('0x15')]);return _0x4b2866(_0xd76e83[_0xfce2('0x13')]['message']);}else{logger[_0xfce2('0xf')](_0xfce2('0x16'),_0x512cc4,_0xfce2('0x10'));_0x4b2866(_0xd76e83[_0xfce2('0x17')][_0xfce2('0x15')]);}})[_0xfce2('0x18')](function(_0x270e52){logger[_0xfce2('0x13')](_0xfce2('0x16'),_0x512cc4,_0x270e52);_0x441666(_0x270e52);});});}exports[_0xfce2('0x19')]=function(_0x4b90ed){var _0x56fb0e=this;return new Promise(function(_0x3c4f1f,_0x3ea07b){return db[_0xfce2('0x1a')][_0xfce2('0x1b')]({'raw':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed['options'][_0xfce2('0x1e')]||null:null,'attributes':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['attributes']||null:null,'limit':_0x4b90ed['options']?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1f')]||null:null,'include':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['include']?_[_0xfce2('0x20')](_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x21')],function(_0x47ed7f){return{'model':db[_0x47ed7f[_0xfce2('0x22')]],'as':_0x47ed7f['as'],'attributes':_0x47ed7f[_0xfce2('0x23')],'include':_0x47ed7f[_0xfce2('0x21')]?_['map'](_0x47ed7f[_0xfce2('0x21')],function(_0x2358dc){return{'model':db[_0x2358dc[_0xfce2('0x22')]],'as':_0x2358dc['as'],'attributes':_0x2358dc[_0xfce2('0x23')],'include':_0x2358dc['include']?_[_0xfce2('0x20')](_0x2358dc[_0xfce2('0x21')],function(_0x58022e){return{'model':db[_0x58022e[_0xfce2('0x22')]],'as':_0x58022e['as'],'attributes':_0x58022e[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x1f48ba){logger['info'](_0xfce2('0x19'),_0x4b90ed);logger['debug'](_0xfce2('0x19'),_0x4b90ed,JSON[_0xfce2('0x12')](_0x1f48ba));_0x3c4f1f(_0x1f48ba);})[_0xfce2('0x18')](function(_0x35b7fe){logger[_0xfce2('0x13')](_0xfce2('0x19'),_0x35b7fe[_0xfce2('0x15')],_0x4b90ed);_0x3ea07b(_0x56fb0e[_0xfce2('0x13')](0x1f4,_0x35b7fe['message']));});});};exports[_0xfce2('0x24')]=function(_0x26a757){var _0x254206=this;return new Promise(function(_0x4b6657,_0x44d500){return db['ChatQueue']['find']({'raw':_0x26a757[_0xfce2('0x1c')]?_0x26a757['options'][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x1e')]||null:null,'attributes':_0x26a757['options']?_0x26a757['options']['attributes']||null:null,'include':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x21')]?_[_0xfce2('0x20')](_0x26a757[_0xfce2('0x1c')]['include'],function(_0x4afa63){return{'model':db[_0x4afa63[_0xfce2('0x22')]],'as':_0x4afa63['as'],'attributes':_0x4afa63[_0xfce2('0x23')],'include':_0x4afa63[_0xfce2('0x21')]?_['map'](_0x4afa63[_0xfce2('0x21')],function(_0x4f7153){return{'model':db[_0x4f7153[_0xfce2('0x22')]],'as':_0x4f7153['as'],'attributes':_0x4f7153[_0xfce2('0x23')],'include':_0x4f7153[_0xfce2('0x21')]?_['map'](_0x4f7153['include'],function(_0x365873){return{'model':db[_0x365873[_0xfce2('0x22')]],'as':_0x365873['as'],'attributes':_0x365873[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x52caca){logger[_0xfce2('0xf')]('ShowChatQueue',_0x26a757);logger[_0xfce2('0x25')]('ShowChatQueue',_0x26a757,JSON[_0xfce2('0x12')](_0x52caca));_0x4b6657(_0x52caca);})[_0xfce2('0x18')](function(_0x3bc14e){logger[_0xfce2('0x13')](_0xfce2('0x24'),_0x3bc14e['message'],_0x26a757);_0x44d500(_0x254206[_0xfce2('0x13')](0x1f4,_0x3bc14e[_0xfce2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 42d3f51..b26b02b 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 _0xd13e=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0xd13e,0x193));var _0xed13=function(_0x5452ca,_0x125b62){_0x5452ca=_0x5452ca-0x0;var _0x1d1373=_0xd13e[_0x5452ca];return _0x1d1373;};'use strict';var ChatQueueEvents=require(_0xed13('0x0'));var events=[_0xed13('0x1'),_0xed13('0x2'),_0xed13('0x3')];function createListener(_0x50b476,_0x1a064e){return function(_0x5cdb65){_0x1a064e[_0xed13('0x4')](_0x50b476,_0x5cdb65);};}function removeListener(_0x59d4db,_0x46158d){return function(){ChatQueueEvents[_0xed13('0x5')](_0x59d4db,_0x46158d);};}exports['register']=function(_0x50de44){for(var _0x5142bd=0x0,_0x95ff4c=events[_0xed13('0x6')];_0x5142bd<_0x95ff4c;_0x5142bd++){var _0xab0fff=events[_0x5142bd];var _0x3b3984=createListener(_0xed13('0x7')+_0xab0fff,_0x50de44);ChatQueueEvents['on'](_0xab0fff,_0x3b3984);}}; \ No newline at end of file +var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x302165,_0x4543d5){var _0x36059f=function(_0x596974){while(--_0x596974){_0x302165['push'](_0x302165['shift']());}};_0x36059f(++_0x4543d5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5ec6dc,_0x1a6293){_0x5ec6dc=_0x5ec6dc-0x0;var _0x550a4b=_0x4c6d[_0x5ec6dc];return _0x550a4b;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c3f6f96..13afc01 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x24ff41,_0x1fafde){var _0x1bfede=function(_0x5831d1){while(--_0x5831d1){_0x24ff41['push'](_0x24ff41['shift']());}};_0x1bfede(++_0x1fafde);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x5fc3[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8ae0788..7c4c315 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 _0x515f=['sequelize','STRING','DATE'];(function(_0x2e32a5,_0xc5e0e4){var _0xeaf48a=function(_0x2a0592){while(--_0x2a0592){_0x2e32a5['push'](_0x2e32a5['shift']());}};_0xeaf48a(++_0xc5e0e4);}(_0x515f,0x165));var _0xf515=function(_0x3b9e02,_0x394b1c){_0x3b9e02=_0x3b9e02-0x0;var _0xee324e=_0x515f[_0x3b9e02];return _0xee324e;};'use strict';var moment=require('moment');var Sequelize=require(_0xf515('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf515('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf515('0x1')]},'joinAt':{'type':Sequelize[_0xf515('0x2')]},'leaveAt':{'type':Sequelize[_0xf515('0x2')]},'acceptAt':{'type':Sequelize[_0xf515('0x2')]},'exitAt':{'type':Sequelize[_0xf515('0x2')]},'reason':{'type':Sequelize[_0xf515('0x1')]}}; \ No newline at end of file +var _0x961e=['DATE','exports','STRING'];(function(_0x5b10a7,_0x4e441d){var _0x23b5c8=function(_0x36d59b){while(--_0x36d59b){_0x5b10a7['push'](_0x5b10a7['shift']());}};_0x23b5c8(++_0x4e441d);}(_0x961e,0x1a8));var _0xe961=function(_0x290e73,_0x2351bb){_0x290e73=_0x290e73-0x0;var _0x1e0b65=_0x961e[_0x290e73];return _0x1e0b65;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe961('0x0')]={'uniqueid':{'type':Sequelize[_0xe961('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe961('0x1')]},'joinAt':{'type':Sequelize[_0xe961('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe961('0x2')]},'reason':{'type':Sequelize[_0xe961('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1a15a56..8679c7b 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 _0x195f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4bb234,_0x105f9b){var _0x2f2db7=function(_0xc5c510){while(--_0xc5c510){_0x4bb234['push'](_0x4bb234['shift']());}};_0x2f2db7(++_0x105f9b);}(_0x195f,0x113));var _0xf195=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0x195f[_0x5ca644];return _0x5c87a2;};'use strict';var emlformat=require(_0xf195('0x0'));var rimraf=require(_0xf195('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf195('0x2'));var rp=require(_0xf195('0x3'));var moment=require('moment');var BPromise=require(_0xf195('0x4'));var Mustache=require('mustache');var util=require(_0xf195('0x5'));var path=require(_0xf195('0x6'));var sox=require(_0xf195('0x7'));var csv=require(_0xf195('0x8'));var ejs=require(_0xf195('0x9'));var fs=require('fs');var fs_extra=require(_0xf195('0xa'));var _=require(_0xf195('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf195('0xc'));var deskjs=require(_0xf195('0xd'));var toCsv=require(_0xf195('0x8'));var querystring=require(_0xf195('0xe'));var Papa=require(_0xf195('0xf'));var Redis=require(_0xf195('0x10'));var authService=require(_0xf195('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf195('0x12'));var hardwareService=require(_0xf195('0x13'));var logger=require(_0xf195('0x14'))('api');var utils=require(_0xf195('0x15'));var config=require(_0xf195('0x16'));var licenseUtil=require(_0xf195('0x17'));var db=require(_0xf195('0x18'))['db'];function respondWithStatusCode(_0x48c9d9,_0x3e12f4){_0x3e12f4=_0x3e12f4||0xcc;return function(_0x33844b){if(_0x33844b){return _0x48c9d9['sendStatus'](_0x3e12f4);}return _0x48c9d9[_0xf195('0x19')](_0x3e12f4)['end']();};}function respondWithResult(_0x3d06cc,_0x9c114){_0x9c114=_0x9c114||0xc8;return function(_0x345a44){if(_0x345a44){return _0x3d06cc[_0xf195('0x19')](_0x9c114)[_0xf195('0x1a')](_0x345a44);}};}function respondWithFilteredResult(_0x33b5c4,_0x5041fd){return function(_0xe76164){if(_0xe76164){var _0x4c1956=typeof _0x5041fd['offset']===_0xf195('0x1b')&&typeof _0x5041fd[_0xf195('0x1c')]===_0xf195('0x1b');var _0x321bd7=_0xe76164['count'];var _0x374fc6=_0x4c1956?0x0:_0x5041fd[_0xf195('0x1d')];var _0x5cf7dc=_0x4c1956?_0xe76164[_0xf195('0x1e')]:_0x5041fd[_0xf195('0x1d')]+_0x5041fd['limit'];var _0x15acd6;if(_0x5cf7dc>=_0x321bd7){_0x5cf7dc=_0x321bd7;_0x15acd6=0xc8;}else{_0x15acd6=0xce;}_0x33b5c4[_0xf195('0x19')](_0x15acd6);return _0x33b5c4['set'](_0xf195('0x1f'),_0x374fc6+'-'+_0x5cf7dc+'/'+_0x321bd7)[_0xf195('0x1a')](_0xe76164);}return null;};}function patchUpdates(_0x421cab){return function(_0x1eea05){try{jsonpatch['apply'](_0x1eea05,_0x421cab,!![]);}catch(_0x5933f0){return BPromise['reject'](_0x5933f0);}return _0x1eea05[_0xf195('0x20')]();};}function saveUpdates(_0x1b2821,_0x388c36){return function(_0x785aae){if(_0x785aae){return _0x785aae[_0xf195('0x21')](_0x1b2821)[_0xf195('0x22')](function(_0x3d3d14){return _0x3d3d14;});}return null;};}function removeEntity(_0x1ee8d6,_0x45cfa4){return function(_0x255d58){if(_0x255d58){return _0x255d58[_0xf195('0x23')]()[_0xf195('0x22')](function(){_0x1ee8d6['status'](0xcc)[_0xf195('0x24')]();});}};}function handleEntityNotFound(_0x246750,_0x3dddd3){return function(_0x2ae42e){if(!_0x2ae42e){_0x246750[_0xf195('0x25')](0x194);}return _0x2ae42e;};}function handleError(_0x23484e,_0x1ea31a){_0x1ea31a=_0x1ea31a||0x1f4;return function(_0x3c1371){logger['error'](_0x3c1371['stack']);if(_0x3c1371[_0xf195('0x26')]){delete _0x3c1371[_0xf195('0x26')];}_0x23484e[_0xf195('0x19')](_0x1ea31a)[_0xf195('0x27')](_0x3c1371);};}exports[_0xf195('0x28')]=function(_0x37b3c6,_0x408e3b){var _0x3c592e={},_0x5dbca={},_0x7d3a34={'count':0x0,'rows':[]};var _0xe3465f=_[_0xf195('0x29')](db[_0xf195('0x2a')][_0xf195('0x2b')],function(_0xdb8e93){return{'name':_0xdb8e93[_0xf195('0x2c')],'type':_0xdb8e93[_0xf195('0x2d')][_0xf195('0x2e')]};});_0x5dbca[_0xf195('0x2f')]=_['map'](_0xe3465f,_0xf195('0x26'));_0x5dbca[_0xf195('0x30')]=_[_0xf195('0x31')](_0x37b3c6[_0xf195('0x30')]);_0x5dbca[_0xf195('0x32')]=_[_0xf195('0x33')](_0x5dbca[_0xf195('0x2f')],_0x5dbca[_0xf195('0x30')]);_0x3c592e[_0xf195('0x34')]=_[_0xf195('0x33')](_0x5dbca[_0xf195('0x2f')],qs[_0xf195('0x35')](_0x37b3c6[_0xf195('0x30')][_0xf195('0x35')]));_0x3c592e[_0xf195('0x34')]=_0x3c592e[_0xf195('0x34')][_0xf195('0x36')]?_0x3c592e['attributes']:_0x5dbca[_0xf195('0x2f')];if(!_0x37b3c6[_0xf195('0x30')][_0xf195('0x37')](_0xf195('0x38'))){_0x3c592e[_0xf195('0x1c')]=qs['limit'](_0x37b3c6[_0xf195('0x30')][_0xf195('0x1c')]);_0x3c592e[_0xf195('0x1d')]=qs['offset'](_0x37b3c6['query'][_0xf195('0x1d')]);}_0x3c592e[_0xf195('0x39')]=qs[_0xf195('0x3a')](_0x37b3c6[_0xf195('0x30')][_0xf195('0x3a')]);_0x3c592e[_0xf195('0x3b')]=qs[_0xf195('0x32')](_[_0xf195('0x3c')](_0x37b3c6[_0xf195('0x30')],_0x5dbca[_0xf195('0x32')]),_0xe3465f);if(_0x37b3c6['query']['filter']){_0x3c592e[_0xf195('0x3b')]=_[_0xf195('0x3d')](_0x3c592e[_0xf195('0x3b')],{'$or':_[_0xf195('0x29')](_0xe3465f,function(_0x4059b3){if(_0x4059b3[_0xf195('0x2d')]!==_0xf195('0x3e')){var _0x34f3ce={};_0x34f3ce[_0x4059b3['name']]={'$like':'%'+_0x37b3c6[_0xf195('0x30')]['filter']+'%'};return _0x34f3ce;}})});}_0x3c592e=_['merge']({},_0x3c592e,_0x37b3c6[_0xf195('0x3f')]);var _0x83c396={'where':_0x3c592e[_0xf195('0x3b')]};return db[_0xf195('0x2a')][_0xf195('0x1e')](_0x83c396)[_0xf195('0x22')](function(_0x7f9360){_0x7d3a34[_0xf195('0x1e')]=_0x7f9360;if(_0x37b3c6[_0xf195('0x30')][_0xf195('0x40')]){_0x3c592e[_0xf195('0x41')]=[{'all':!![]}];}return db[_0xf195('0x2a')][_0xf195('0x42')](_0x3c592e);})[_0xf195('0x22')](function(_0x49edfb){_0x7d3a34['rows']=_0x49edfb;return _0x7d3a34;})[_0xf195('0x22')](respondWithFilteredResult(_0x408e3b,_0x3c592e))[_0xf195('0x43')](handleError(_0x408e3b,null));};exports[_0xf195('0x44')]=function(_0x6b22ec,_0x382fd9){var _0x1907ce={'raw':!![],'where':{'id':_0x6b22ec[_0xf195('0x45')]['id']}},_0x343f3e={};_0x343f3e['model']=_[_0xf195('0x31')](db[_0xf195('0x2a')][_0xf195('0x2b')]);_0x343f3e[_0xf195('0x30')]=_[_0xf195('0x31')](_0x6b22ec[_0xf195('0x30')]);_0x343f3e[_0xf195('0x32')]=_['intersection'](_0x343f3e[_0xf195('0x2f')],_0x343f3e[_0xf195('0x30')]);_0x1907ce['attributes']=_[_0xf195('0x33')](_0x343f3e['model'],qs[_0xf195('0x35')](_0x6b22ec[_0xf195('0x30')][_0xf195('0x35')]));_0x1907ce['attributes']=_0x1907ce[_0xf195('0x34')][_0xf195('0x36')]?_0x1907ce['attributes']:_0x343f3e[_0xf195('0x2f')];if(_0x6b22ec[_0xf195('0x30')][_0xf195('0x40')]){_0x1907ce[_0xf195('0x41')]=[{'all':!![]}];}_0x1907ce=_[_0xf195('0x3d')]({},_0x1907ce,_0x6b22ec['options']);return db[_0xf195('0x2a')][_0xf195('0x46')](_0x1907ce)[_0xf195('0x22')](handleEntityNotFound(_0x382fd9,null))[_0xf195('0x22')](respondWithResult(_0x382fd9,null))[_0xf195('0x43')](handleError(_0x382fd9,null));};exports[_0xf195('0x47')]=function(_0x2362da,_0x30fc9b){return db['ChatQueueReport'][_0xf195('0x47')](_0x2362da['body'],{})[_0xf195('0x22')](respondWithResult(_0x30fc9b,0xc9))[_0xf195('0x43')](handleError(_0x30fc9b,null));};exports[_0xf195('0x21')]=function(_0x42f895,_0x2e56ea){if(_0x42f895[_0xf195('0x48')]['id']){delete _0x42f895[_0xf195('0x48')]['id'];}return db[_0xf195('0x2a')]['find']({'where':{'id':_0x42f895[_0xf195('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e56ea,null))[_0xf195('0x22')](saveUpdates(_0x42f895[_0xf195('0x48')],null))[_0xf195('0x22')](respondWithResult(_0x2e56ea,null))[_0xf195('0x43')](handleError(_0x2e56ea,null));};exports[_0xf195('0x23')]=function(_0x586275,_0x33a0a6){return db[_0xf195('0x2a')][_0xf195('0x46')]({'where':{'id':_0x586275[_0xf195('0x45')]['id']}})['then'](handleEntityNotFound(_0x33a0a6,null))[_0xf195('0x22')](removeEntity(_0x33a0a6,null))[_0xf195('0x43')](handleError(_0x33a0a6,null));};exports['describe']=function(_0x1d7fbc,_0x29bb46){return db[_0xf195('0x2a')][_0xf195('0x49')]()[_0xf195('0x22')](respondWithResult(_0x29bb46,null))['catch'](handleError(_0x29bb46,null));}; \ No newline at end of file +var _0x3914=['filter','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','send','index','map','ChatQueueReport','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x19c429,_0x178ed2){var _0x5f2a33=function(_0x57214e){while(--_0x57214e){_0x19c429['push'](_0x19c429['shift']());}};_0x5f2a33(++_0x178ed2);}(_0x3914,0xeb));var _0x4391=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x3914[_0x2fbd0e];return _0x481c9f;};'use strict';var emlformat=require(_0x4391('0x0'));var rimraf=require(_0x4391('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4391('0x2'));var rp=require(_0x4391('0x3'));var moment=require('moment');var BPromise=require(_0x4391('0x4'));var Mustache=require(_0x4391('0x5'));var util=require(_0x4391('0x6'));var path=require('path');var sox=require(_0x4391('0x7'));var csv=require(_0x4391('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4391('0x9'));var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var Redis=require(_0x4391('0xe'));var authService=require(_0x4391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4391('0x10'));var hardwareService=require(_0x4391('0x11'));var logger=require(_0x4391('0x12'))(_0x4391('0x13'));var utils=require('../../config/utils');var config=require(_0x4391('0x14'));var licenseUtil=require(_0x4391('0x15'));var db=require(_0x4391('0x16'))['db'];function respondWithStatusCode(_0x137902,_0x254ffb){_0x254ffb=_0x254ffb||0xcc;return function(_0xdebb72){if(_0xdebb72){return _0x137902[_0x4391('0x17')](_0x254ffb);}return _0x137902[_0x4391('0x18')](_0x254ffb)['end']();};}function respondWithResult(_0x1a49ba,_0x3bd3a7){_0x3bd3a7=_0x3bd3a7||0xc8;return function(_0x3f82fb){if(_0x3f82fb){return _0x1a49ba[_0x4391('0x18')](_0x3bd3a7)['json'](_0x3f82fb);}};}function respondWithFilteredResult(_0x62c763,_0x4ff882){return function(_0x343203){if(_0x343203){var _0x3a1b80=typeof _0x4ff882[_0x4391('0x19')]===_0x4391('0x1a')&&typeof _0x4ff882[_0x4391('0x1b')]===_0x4391('0x1a');var _0x2b5117=_0x343203[_0x4391('0x1c')];var _0x58a311=_0x3a1b80?0x0:_0x4ff882['offset'];var _0x2ecb23=_0x3a1b80?_0x343203['count']:_0x4ff882[_0x4391('0x19')]+_0x4ff882[_0x4391('0x1b')];var _0xa9c97f;if(_0x2ecb23>=_0x2b5117){_0x2ecb23=_0x2b5117;_0xa9c97f=0xc8;}else{_0xa9c97f=0xce;}_0x62c763[_0x4391('0x18')](_0xa9c97f);return _0x62c763[_0x4391('0x1d')]('Content-Range',_0x58a311+'-'+_0x2ecb23+'/'+_0x2b5117)['json'](_0x343203);}return null;};}function patchUpdates(_0x36c34c){return function(_0x37fca4){try{jsonpatch[_0x4391('0x1e')](_0x37fca4,_0x36c34c,!![]);}catch(_0x5570a8){return BPromise[_0x4391('0x1f')](_0x5570a8);}return _0x37fca4[_0x4391('0x20')]();};}function saveUpdates(_0x737d10,_0x3e1e0b){return function(_0x505d2c){if(_0x505d2c){return _0x505d2c[_0x4391('0x21')](_0x737d10)[_0x4391('0x22')](function(_0x3c4c9b){return _0x3c4c9b;});}return null;};}function removeEntity(_0xfee343,_0x24e16c){return function(_0x40ff34){if(_0x40ff34){return _0x40ff34['destroy']()[_0x4391('0x22')](function(){_0xfee343[_0x4391('0x18')](0xcc)[_0x4391('0x23')]();});}};}function handleEntityNotFound(_0x333ca6,_0x540339){return function(_0x4b0c28){if(!_0x4b0c28){_0x333ca6[_0x4391('0x17')](0x194);}return _0x4b0c28;};}function handleError(_0x3aa79f,_0x3f2554){_0x3f2554=_0x3f2554||0x1f4;return function(_0x197408){logger[_0x4391('0x24')](_0x197408['stack']);if(_0x197408['name']){delete _0x197408['name'];}_0x3aa79f['status'](_0x3f2554)[_0x4391('0x25')](_0x197408);};}exports[_0x4391('0x26')]=function(_0x471d43,_0x2f7b18){var _0x49aa36={},_0x34059f={},_0x32ed74={'count':0x0,'rows':[]};var _0x115e36=_[_0x4391('0x27')](db[_0x4391('0x28')]['rawAttributes'],function(_0x1a8df0){return{'name':_0x1a8df0[_0x4391('0x29')],'type':_0x1a8df0[_0x4391('0x2a')][_0x4391('0x2b')]};});_0x34059f[_0x4391('0x2c')]=_[_0x4391('0x27')](_0x115e36,_0x4391('0x2d'));_0x34059f[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x471d43[_0x4391('0x2e')]);_0x34059f[_0x4391('0x30')]=_['intersection'](_0x34059f[_0x4391('0x2c')],_0x34059f['query']);_0x49aa36[_0x4391('0x31')]=_['intersection'](_0x34059f['model'],qs[_0x4391('0x32')](_0x471d43[_0x4391('0x2e')][_0x4391('0x32')]));_0x49aa36[_0x4391('0x31')]=_0x49aa36[_0x4391('0x31')][_0x4391('0x33')]?_0x49aa36[_0x4391('0x31')]:_0x34059f['model'];if(!_0x471d43[_0x4391('0x2e')]['hasOwnProperty'](_0x4391('0x34'))){_0x49aa36['limit']=qs[_0x4391('0x1b')](_0x471d43[_0x4391('0x2e')][_0x4391('0x1b')]);_0x49aa36[_0x4391('0x19')]=qs[_0x4391('0x19')](_0x471d43[_0x4391('0x2e')][_0x4391('0x19')]);}_0x49aa36[_0x4391('0x35')]=qs[_0x4391('0x36')](_0x471d43[_0x4391('0x2e')][_0x4391('0x36')]);_0x49aa36[_0x4391('0x37')]=qs[_0x4391('0x30')](_[_0x4391('0x38')](_0x471d43[_0x4391('0x2e')],_0x34059f[_0x4391('0x30')]),_0x115e36);if(_0x471d43[_0x4391('0x2e')][_0x4391('0x39')]){_0x49aa36['where']=_['merge'](_0x49aa36[_0x4391('0x37')],{'$or':_[_0x4391('0x27')](_0x115e36,function(_0x58e161){if(_0x58e161[_0x4391('0x2a')]!==_0x4391('0x3a')){var _0x1c716c={};_0x1c716c[_0x58e161[_0x4391('0x2d')]]={'$like':'%'+_0x471d43[_0x4391('0x2e')]['filter']+'%'};return _0x1c716c;}})});}_0x49aa36=_[_0x4391('0x3b')]({},_0x49aa36,_0x471d43['options']);var _0x5ec1cf={'where':_0x49aa36['where']};return db['ChatQueueReport'][_0x4391('0x1c')](_0x5ec1cf)[_0x4391('0x22')](function(_0x33736a){_0x32ed74[_0x4391('0x1c')]=_0x33736a;if(_0x471d43['query']['includeAll']){_0x49aa36[_0x4391('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4391('0x3d')](_0x49aa36);})[_0x4391('0x22')](function(_0x3bfcdc){_0x32ed74[_0x4391('0x3e')]=_0x3bfcdc;return _0x32ed74;})[_0x4391('0x22')](respondWithFilteredResult(_0x2f7b18,_0x49aa36))[_0x4391('0x3f')](handleError(_0x2f7b18,null));};exports['show']=function(_0x2708e2,_0x3da701){var _0x361f44={'raw':!![],'where':{'id':_0x2708e2[_0x4391('0x40')]['id']}},_0x13f5f4={};_0x13f5f4[_0x4391('0x2c')]=_[_0x4391('0x2f')](db['ChatQueueReport'][_0x4391('0x41')]);_0x13f5f4[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x2708e2[_0x4391('0x2e')]);_0x13f5f4[_0x4391('0x30')]=_[_0x4391('0x42')](_0x13f5f4[_0x4391('0x2c')],_0x13f5f4['query']);_0x361f44[_0x4391('0x31')]=_['intersection'](_0x13f5f4[_0x4391('0x2c')],qs[_0x4391('0x32')](_0x2708e2[_0x4391('0x2e')][_0x4391('0x32')]));_0x361f44[_0x4391('0x31')]=_0x361f44[_0x4391('0x31')][_0x4391('0x33')]?_0x361f44[_0x4391('0x31')]:_0x13f5f4[_0x4391('0x2c')];if(_0x2708e2[_0x4391('0x2e')][_0x4391('0x43')]){_0x361f44[_0x4391('0x3c')]=[{'all':!![]}];}_0x361f44=_[_0x4391('0x3b')]({},_0x361f44,_0x2708e2['options']);return db['ChatQueueReport'][_0x4391('0x44')](_0x361f44)[_0x4391('0x22')](handleEntityNotFound(_0x3da701,null))[_0x4391('0x22')](respondWithResult(_0x3da701,null))[_0x4391('0x3f')](handleError(_0x3da701,null));};exports[_0x4391('0x45')]=function(_0x25c7f6,_0x4efc22){return db[_0x4391('0x28')]['create'](_0x25c7f6[_0x4391('0x46')],{})['then'](respondWithResult(_0x4efc22,0xc9))[_0x4391('0x3f')](handleError(_0x4efc22,null));};exports[_0x4391('0x21')]=function(_0x738d35,_0x1b07b2){if(_0x738d35[_0x4391('0x46')]['id']){delete _0x738d35[_0x4391('0x46')]['id'];}return db['ChatQueueReport'][_0x4391('0x44')]({'where':{'id':_0x738d35[_0x4391('0x40')]['id']}})[_0x4391('0x22')](handleEntityNotFound(_0x1b07b2,null))[_0x4391('0x22')](saveUpdates(_0x738d35[_0x4391('0x46')],null))[_0x4391('0x22')](respondWithResult(_0x1b07b2,null))[_0x4391('0x3f')](handleError(_0x1b07b2,null));};exports[_0x4391('0x47')]=function(_0x1ca698,_0x294498){return db[_0x4391('0x28')][_0x4391('0x44')]({'where':{'id':_0x1ca698[_0x4391('0x40')]['id']}})['then'](handleEntityNotFound(_0x294498,null))[_0x4391('0x22')](removeEntity(_0x294498,null))[_0x4391('0x3f')](handleError(_0x294498,null));};exports[_0x4391('0x48')]=function(_0x516c64,_0x156614){return db[_0x4391('0x28')][_0x4391('0x48')]()['then'](respondWithResult(_0x156614,null))[_0x4391('0x3f')](handleError(_0x156614,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index a8894f3..dc41af0 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 17af33d..4bc04f9 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 _0xdace=['stringify','error','code','message','catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','attributes','limit','debug','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x65f140,_0x45cbc7){var _0x18fbda=function(_0x26fb39){while(--_0x26fb39){_0x65f140['push'](_0x65f140['shift']());}};_0x18fbda(++_0x45cbc7);}(_0xdace,0x9f));var _0xedac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdace[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xedac('0x0'));var moment=require(_0xedac('0x1'));var BPromise=require('bluebird');var rs=require(_0xedac('0x2'));var fs=require('fs');var Redis=require(_0xedac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xedac('0x4'));var logger=require('../../config/logger')(_0xedac('0x5'));var config=require(_0xedac('0x6'));var jayson=require(_0xedac('0x7'));var client=jayson[_0xedac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22662d,_0x511949,_0xe3371f){return new BPromise(function(_0x29dcc2,_0x1fceca){return client[_0xedac('0x9')](_0x22662d,_0xe3371f)[_0xedac('0xa')](function(_0x2a8524){logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));logger['debug'](_0xedac('0xe'),_0x511949,_0xedac('0xd'),JSON[_0xedac('0xf')](_0x2a8524));if(_0x2a8524[_0xedac('0x10')]){if(_0x2a8524[_0xedac('0x10')][_0xedac('0x11')]===0x1f4){logger[_0xedac('0x10')](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x1fceca(_0x2a8524[_0xedac('0x10')]['message']);}logger['error'](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x29dcc2(_0x2a8524[_0xedac('0x10')][_0xedac('0x12')]);}else{logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));_0x29dcc2(_0x2a8524['result'][_0xedac('0x12')]);}})[_0xedac('0x13')](function(_0x4e579b){logger[_0xedac('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x511949,_0x4e579b);_0x1fceca(_0x4e579b);});});}exports['CreateChatQueueReport']=function(_0xfb6631){var _0x23dea8=this;return new Promise(function(_0x2f02f2,_0x1fd0e3){return db[_0xedac('0x14')]['create'](_0xfb6631[_0xedac('0x15')],{'raw':_0xfb6631[_0xedac('0x16')]?_0xfb6631[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![]})[_0xedac('0xa')](function(_0x3bc9a3){logger[_0xedac('0xb')](_0xedac('0x18'),_0xfb6631);logger['debug']('CreateChatQueueReport',_0xfb6631,JSON[_0xedac('0xf')](_0x3bc9a3));_0x2f02f2(_0x3bc9a3);})[_0xedac('0x13')](function(_0xdccccc){logger['error'](_0xedac('0x18'),_0xdccccc['message'],_0xfb6631);_0x1fd0e3(_0x23dea8[_0xedac('0x10')](0x1f4,_0xdccccc['message']));});});};exports[_0xedac('0x19')]=function(_0x8359de){var _0x1871ff=this;return new Promise(function(_0x29a0f5,_0x238182){return db[_0xedac('0x14')]['update'](_0x8359de[_0xedac('0x15')],{'raw':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8359de[_0xedac('0x16')]?_0x8359de['options']['where']||null:null,'attributes':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1a')]||null:null,'limit':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1b')]||null:null})[_0xedac('0xa')](function(_0x2a8f44){logger[_0xedac('0xb')](_0xedac('0x19'),_0x8359de);logger[_0xedac('0x1c')](_0xedac('0x19'),_0x8359de,JSON[_0xedac('0xf')](_0x2a8f44));_0x29a0f5(_0x2a8f44);})[_0xedac('0x13')](function(_0x4aa9c3){logger[_0xedac('0x10')]('UpdateChatQueueReport',_0x4aa9c3[_0xedac('0x12')],_0x8359de);_0x238182(_0x1871ff[_0xedac('0x10')](0x1f4,_0x4aa9c3['message']));});});}; \ No newline at end of file +var _0x9ff3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','randomstring'];(function(_0x587218,_0x246b3e){var _0x444925=function(_0x446422){while(--_0x446422){_0x587218['push'](_0x587218['shift']());}};_0x444925(++_0x246b3e);}(_0x9ff3,0x104));var _0x39ff=function(_0xfd773b,_0xca2cb3){_0xfd773b=_0xfd773b-0x0;var _0x4927fb=_0x9ff3[_0xfd773b];return _0x4927fb;};'use strict';var _=require(_0x39ff('0x0'));var util=require(_0x39ff('0x1'));var moment=require(_0x39ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x39ff('0x3'));var fs=require('fs');var Redis=require(_0x39ff('0x4'));var db=require(_0x39ff('0x5'))['db'];var utils=require(_0x39ff('0x6'));var logger=require(_0x39ff('0x7'))(_0x39ff('0x8'));var config=require(_0x39ff('0x9'));var jayson=require(_0x39ff('0xa'));var client=jayson['client'][_0x39ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5261ee,_0x169b62,_0x22eeb0){return new BPromise(function(_0xe8bdff,_0x5d2cab){return client[_0x39ff('0xc')](_0x5261ee,_0x22eeb0)[_0x39ff('0xd')](function(_0x19b86c){logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,_0x39ff('0x10'));logger[_0x39ff('0x11')](_0x39ff('0x12'),_0x169b62,_0x39ff('0x10'),JSON[_0x39ff('0x13')](_0x19b86c));if(_0x19b86c['error']){if(_0x19b86c[_0x39ff('0x14')]['code']===0x1f4){logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0x5d2cab(_0x19b86c[_0x39ff('0x14')]['message']);}logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0xe8bdff(_0x19b86c['error'][_0x39ff('0x15')]);}else{logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,'request\x20sent');_0xe8bdff(_0x19b86c['result'][_0x39ff('0x15')]);}})[_0x39ff('0x16')](function(_0x375ada){logger[_0x39ff('0x14')](_0x39ff('0xf'),_0x169b62,_0x375ada);_0x5d2cab(_0x375ada);});});}exports[_0x39ff('0x17')]=function(_0x51a775){var _0x1df667=this;return new Promise(function(_0x1b0f3f,_0x3dbbb5){return db[_0x39ff('0x18')][_0x39ff('0x19')](_0x51a775[_0x39ff('0x1a')],{'raw':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![]})[_0x39ff('0xd')](function(_0x411621){logger['info'](_0x39ff('0x17'),_0x51a775);logger[_0x39ff('0x11')]('CreateChatQueueReport',_0x51a775,JSON[_0x39ff('0x13')](_0x411621));_0x1b0f3f(_0x411621);})[_0x39ff('0x16')](function(_0x308dd4){logger[_0x39ff('0x14')](_0x39ff('0x17'),_0x308dd4[_0x39ff('0x15')],_0x51a775);_0x3dbbb5(_0x1df667[_0x39ff('0x14')](0x1f4,_0x308dd4[_0x39ff('0x15')]));});});};exports[_0x39ff('0x1d')]=function(_0x92388c){var _0x293dc0=this;return new Promise(function(_0x13eb0b,_0x47afe5){return db[_0x39ff('0x18')][_0x39ff('0x1e')](_0x92388c[_0x39ff('0x1a')],{'raw':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')]['where']||null:null,'attributes':_0x92388c[_0x39ff('0x1b')]?_0x92388c['options'][_0x39ff('0x1f')]||null:null,'limit':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x20')]||null:null})['then'](function(_0x490084){logger['info'](_0x39ff('0x1d'),_0x92388c);logger['debug'](_0x39ff('0x1d'),_0x92388c,JSON[_0x39ff('0x13')](_0x490084));_0x13eb0b(_0x490084);})[_0x39ff('0x16')](function(_0x10e9ed){logger[_0x39ff('0x14')]('UpdateChatQueueReport',_0x10e9ed[_0x39ff('0x15')],_0x92388c);_0x47afe5(_0x293dc0[_0x39ff('0x14')](0x1f4,_0x10e9ed[_0x39ff('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index cfe45c9..2e7cf4f 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 _0x5e98=['get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5e98,0x123));var _0x85e9=function(_0x2b79db,_0x47e974){_0x2b79db=_0x2b79db-0x0;var _0x1943cf=_0x5e98[_0x2b79db];return _0x1943cf;};'use strict';var multer=require(_0x85e9('0x0'));var util=require(_0x85e9('0x1'));var path=require(_0x85e9('0x2'));var timeout=require('connect-timeout');var express=require(_0x85e9('0x3'));var router=express[_0x85e9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x85e9('0x5'));var interaction=require(_0x85e9('0x6'));var config=require(_0x85e9('0x7'));var controller=require(_0x85e9('0x8'));router[_0x85e9('0x9')]('/',auth[_0x85e9('0xa')](),controller[_0x85e9('0xb')]);router[_0x85e9('0x9')](_0x85e9('0xc'),auth[_0x85e9('0xa')](),controller[_0x85e9('0xd')]);router['get'](_0x85e9('0xe'),auth['isAuthenticated'](),controller[_0x85e9('0xf')]);router[_0x85e9('0x10')]('/',auth[_0x85e9('0xa')](),controller['create']);router['put']('/:id',auth[_0x85e9('0xa')](),controller[_0x85e9('0x11')]);router[_0x85e9('0x12')](_0x85e9('0xe'),auth[_0x85e9('0xa')](),controller[_0x85e9('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc72a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','update','delete','/:id','destroy','express'];(function(_0x1ef734,_0x57c70c){var _0x4ba9a5=function(_0x2c61ac){while(--_0x2c61ac){_0x1ef734['push'](_0x1ef734['shift']());}};_0x4ba9a5(++_0x57c70c);}(_0xc72a,0xcf));var _0xac72=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xc72a[_0x3bf925];return _0x2128a1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac72('0x0'));var router=express[_0xac72('0x1')]();var fs_extra=require(_0xac72('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xac72('0x3'));var config=require(_0xac72('0x4'));var controller=require('./chatQueueReport.controller');router[_0xac72('0x5')]('/',auth[_0xac72('0x6')](),controller['index']);router[_0xac72('0x5')](_0xac72('0x7'),auth[_0xac72('0x6')](),controller[_0xac72('0x8')]);router[_0xac72('0x5')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0x9')]);router['post']('/',auth[_0xac72('0x6')](),controller[_0xac72('0xa')]);router[_0xac72('0xb')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0xc')]);router[_0xac72('0xd')](_0xac72('0xe'),auth[_0xac72('0x6')](),controller[_0xac72('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3975e7a..36ae5aa 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x35ab16,_0x54155a){var _0x3f768d=function(_0x5c5d32){while(--_0x5c5d32){_0x35ab16['push'](_0x35ab16['shift']());}};_0x3f768d(++_0x54155a);}(_0xaa88,0x137));var _0x8aa8=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xaa88[_0x47e549];return _0x251374;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x538e8e,_0x3d57f6){var _0x21252a=function(_0x321171){while(--_0x321171){_0x538e8e['push'](_0x538e8e['shift']());}};_0x21252a(++_0x3d57f6);}(_0x70e0,0x17b));var _0x070e=function(_0x538cc5,_0x3716f7){_0x538cc5=_0x538cc5-0x0;var _0x28239=_0x70e0[_0x538cc5];return _0x28239;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5fe6ae4..d2ea4d1 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 _0x046b=['pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','create','body','find','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x33e0f6,_0x286ceb){var _0xee24dc=function(_0x5e7c96){while(--_0x5e7c96){_0x33e0f6['push'](_0x33e0f6['shift']());}};_0xee24dc(++_0x286ceb);}(_0x046b,0x13d));var _0xb046=function(_0x20048c,_0x337690){_0x20048c=_0x20048c-0x0;var _0x1d7f4b=_0x046b[_0x20048c];return _0x1d7f4b;};'use strict';var emlformat=require(_0xb046('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb046('0x1'));var jsonpatch=require(_0xb046('0x2'));var rp=require(_0xb046('0x3'));var moment=require(_0xb046('0x4'));var BPromise=require(_0xb046('0x5'));var Mustache=require(_0xb046('0x6'));var util=require(_0xb046('0x7'));var path=require(_0xb046('0x8'));var sox=require(_0xb046('0x9'));var csv=require(_0xb046('0xa'));var ejs=require(_0xb046('0xb'));var fs=require('fs');var fs_extra=require(_0xb046('0xc'));var _=require(_0xb046('0xd'));var squel=require(_0xb046('0xe'));var crypto=require(_0xb046('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb046('0x10'));var toCsv=require(_0xb046('0xa'));var querystring=require(_0xb046('0x11'));var Papa=require(_0xb046('0x12'));var Redis=require('ioredis');var authService=require(_0xb046('0x13'));var qs=require(_0xb046('0x14'));var as=require(_0xb046('0x15'));var hardwareService=require(_0xb046('0x16'));var logger=require(_0xb046('0x17'))(_0xb046('0x18'));var utils=require(_0xb046('0x19'));var config=require(_0xb046('0x1a'));var licenseUtil=require(_0xb046('0x1b'));var db=require(_0xb046('0x1c'))['db'];function respondWithStatusCode(_0x3269e5,_0x4e9b20){_0x4e9b20=_0x4e9b20||0xcc;return function(_0x174fdd){if(_0x174fdd){return _0x3269e5[_0xb046('0x1d')](_0x4e9b20);}return _0x3269e5[_0xb046('0x1e')](_0x4e9b20)[_0xb046('0x1f')]();};}function respondWithResult(_0x4126d5,_0x88c3ab){_0x88c3ab=_0x88c3ab||0xc8;return function(_0xe21a97){if(_0xe21a97){return _0x4126d5['status'](_0x88c3ab)[_0xb046('0x20')](_0xe21a97);}};}function respondWithFilteredResult(_0x5aab93,_0x475315){return function(_0x9b36e8){if(_0x9b36e8){var _0x3e4f98=typeof _0x475315[_0xb046('0x21')]==='undefined'&&typeof _0x475315[_0xb046('0x22')]===_0xb046('0x23');var _0x5175c8=_0x9b36e8['count'];var _0x561b31=_0x3e4f98?0x0:_0x475315[_0xb046('0x21')];var _0x4d0870=_0x3e4f98?_0x9b36e8[_0xb046('0x24')]:_0x475315[_0xb046('0x21')]+_0x475315['limit'];var _0x39d2e8;if(_0x4d0870>=_0x5175c8){_0x4d0870=_0x5175c8;_0x39d2e8=0xc8;}else{_0x39d2e8=0xce;}_0x5aab93[_0xb046('0x1e')](_0x39d2e8);return _0x5aab93[_0xb046('0x25')]('Content-Range',_0x561b31+'-'+_0x4d0870+'/'+_0x5175c8)[_0xb046('0x20')](_0x9b36e8);}return null;};}function patchUpdates(_0x29328f){return function(_0x383e72){try{jsonpatch[_0xb046('0x26')](_0x383e72,_0x29328f,!![]);}catch(_0x577de4){return BPromise['reject'](_0x577de4);}return _0x383e72[_0xb046('0x27')]();};}function saveUpdates(_0x4d2967,_0x3a3e5b){return function(_0x8eec63){if(_0x8eec63){return _0x8eec63[_0xb046('0x28')](_0x4d2967)[_0xb046('0x29')](function(_0x3141da){return _0x3141da;});}return null;};}function removeEntity(_0x3e0021,_0x3f6671){return function(_0x26d6aa){if(_0x26d6aa){return _0x26d6aa['destroy']()[_0xb046('0x29')](function(){_0x3e0021[_0xb046('0x1e')](0xcc)[_0xb046('0x1f')]();});}};}function handleEntityNotFound(_0xc828ea,_0x21bdcb){return function(_0x416357){if(!_0x416357){_0xc828ea[_0xb046('0x1d')](0x194);}return _0x416357;};}function handleError(_0x45f18b,_0x383bee){_0x383bee=_0x383bee||0x1f4;return function(_0x36862f){logger['error'](_0x36862f[_0xb046('0x2a')]);if(_0x36862f['name']){delete _0x36862f[_0xb046('0x2b')];}_0x45f18b[_0xb046('0x1e')](_0x383bee)[_0xb046('0x2c')](_0x36862f);};}exports[_0xb046('0x2d')]=function(_0x3e1ac0,_0x34cd46){var _0x5657e0={},_0x53293c={},_0x4dcb92={'count':0x0,'rows':[]};var _0x153b1e=_[_0xb046('0x2e')](db[_0xb046('0x2f')][_0xb046('0x30')],function(_0x516798){return{'name':_0x516798[_0xb046('0x31')],'type':_0x516798['type'][_0xb046('0x32')]};});_0x53293c[_0xb046('0x33')]=_[_0xb046('0x2e')](_0x153b1e,'name');_0x53293c['query']=_['keys'](_0x3e1ac0[_0xb046('0x34')]);_0x53293c[_0xb046('0x35')]=_['intersection'](_0x53293c['model'],_0x53293c[_0xb046('0x34')]);_0x5657e0['attributes']=_[_0xb046('0x36')](_0x53293c[_0xb046('0x33')],qs[_0xb046('0x37')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x37')]));_0x5657e0['attributes']=_0x5657e0[_0xb046('0x38')][_0xb046('0x39')]?_0x5657e0['attributes']:_0x53293c[_0xb046('0x33')];if(!_0x3e1ac0[_0xb046('0x34')][_0xb046('0x3a')](_0xb046('0x3b'))){_0x5657e0[_0xb046('0x22')]=qs[_0xb046('0x22')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x22')]);_0x5657e0[_0xb046('0x21')]=qs[_0xb046('0x21')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x21')]);}_0x5657e0[_0xb046('0x3c')]=qs[_0xb046('0x3d')](_0x3e1ac0['query'][_0xb046('0x3d')]);_0x5657e0[_0xb046('0x3e')]=qs[_0xb046('0x35')](_[_0xb046('0x3f')](_0x3e1ac0[_0xb046('0x34')],_0x53293c['filters']),_0x153b1e);if(_0x3e1ac0[_0xb046('0x34')][_0xb046('0x40')]){_0x5657e0['where']=_[_0xb046('0x41')](_0x5657e0[_0xb046('0x3e')],{'$or':_[_0xb046('0x2e')](_0x153b1e,function(_0x5742e9){if(_0x5742e9['type']!==_0xb046('0x42')){var _0x4fcc0e={};_0x4fcc0e[_0x5742e9['name']]={'$like':'%'+_0x3e1ac0[_0xb046('0x34')]['filter']+'%'};return _0x4fcc0e;}})});}_0x5657e0=_['merge']({},_0x5657e0,_0x3e1ac0['options']);var _0xfc53ce={'where':_0x5657e0[_0xb046('0x3e')]};return db['ChatTransferReport'][_0xb046('0x24')](_0xfc53ce)[_0xb046('0x29')](function(_0x377561){_0x4dcb92[_0xb046('0x24')]=_0x377561;if(_0x3e1ac0['query'][_0xb046('0x43')]){_0x5657e0['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5657e0);})[_0xb046('0x29')](function(_0x23372e){_0x4dcb92[_0xb046('0x44')]=_0x23372e;return _0x4dcb92;})['then'](respondWithFilteredResult(_0x34cd46,_0x5657e0))[_0xb046('0x45')](handleError(_0x34cd46,null));};exports[_0xb046('0x46')]=function(_0x84552c,_0x3b0d0f){var _0x595596={'raw':!![],'where':{'id':_0x84552c[_0xb046('0x47')]['id']}},_0x1ab627={};_0x1ab627[_0xb046('0x33')]=_['keys'](db[_0xb046('0x2f')][_0xb046('0x30')]);_0x1ab627[_0xb046('0x34')]=_[_0xb046('0x48')](_0x84552c['query']);_0x1ab627[_0xb046('0x35')]=_['intersection'](_0x1ab627[_0xb046('0x33')],_0x1ab627[_0xb046('0x34')]);_0x595596[_0xb046('0x38')]=_[_0xb046('0x36')](_0x1ab627[_0xb046('0x33')],qs[_0xb046('0x37')](_0x84552c[_0xb046('0x34')][_0xb046('0x37')]));_0x595596['attributes']=_0x595596[_0xb046('0x38')]['length']?_0x595596[_0xb046('0x38')]:_0x1ab627[_0xb046('0x33')];if(_0x84552c[_0xb046('0x34')][_0xb046('0x43')]){_0x595596['include']=[{'all':!![]}];}_0x595596=_['merge']({},_0x595596,_0x84552c['options']);return db[_0xb046('0x2f')]['find'](_0x595596)[_0xb046('0x29')](handleEntityNotFound(_0x3b0d0f,null))[_0xb046('0x29')](respondWithResult(_0x3b0d0f,null))[_0xb046('0x45')](handleError(_0x3b0d0f,null));};exports['create']=function(_0x513605,_0x354b57){return db['ChatTransferReport'][_0xb046('0x49')](_0x513605[_0xb046('0x4a')],{})[_0xb046('0x29')](respondWithResult(_0x354b57,0xc9))[_0xb046('0x45')](handleError(_0x354b57,null));};exports[_0xb046('0x28')]=function(_0x80b69,_0x262ce9){if(_0x80b69[_0xb046('0x4a')]['id']){delete _0x80b69[_0xb046('0x4a')]['id'];}return db[_0xb046('0x2f')][_0xb046('0x4b')]({'where':{'id':_0x80b69[_0xb046('0x47')]['id']}})[_0xb046('0x29')](handleEntityNotFound(_0x262ce9,null))[_0xb046('0x29')](saveUpdates(_0x80b69[_0xb046('0x4a')],null))[_0xb046('0x29')](respondWithResult(_0x262ce9,null))[_0xb046('0x45')](handleError(_0x262ce9,null));};exports['destroy']=function(_0x717dc2,_0x1dbb68){return db[_0xb046('0x2f')][_0xb046('0x4b')]({'where':{'id':_0x717dc2[_0xb046('0x47')]['id']}})[_0xb046('0x29')](handleEntityNotFound(_0x1dbb68,null))['then'](removeEntity(_0x1dbb68,null))['catch'](handleError(_0x1dbb68,null));};exports['describe']=function(_0x41d00f,_0x2de393){return db[_0xb046('0x2f')]['describe']()[_0xb046('0x29')](respondWithResult(_0x2de393,null))[_0xb046('0x45')](handleError(_0x2de393,null));}; \ No newline at end of file +var _0x790c=['length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x280c6a,_0x2fc1e9){var _0x4bfe09=function(_0x1a8334){while(--_0x1a8334){_0x280c6a['push'](_0x280c6a['shift']());}};_0x4bfe09(++_0x2fc1e9);}(_0x790c,0xad));var _0xc790=function(_0x1e8a30,_0x9d4596){_0x1e8a30=_0x1e8a30-0x0;var _0x1f8b30=_0x790c[_0x1e8a30];return _0x1f8b30;};'use strict';var emlformat=require(_0xc790('0x0'));var rimraf=require(_0xc790('0x1'));var zipdir=require(_0xc790('0x2'));var jsonpatch=require(_0xc790('0x3'));var rp=require(_0xc790('0x4'));var moment=require(_0xc790('0x5'));var BPromise=require(_0xc790('0x6'));var Mustache=require(_0xc790('0x7'));var util=require(_0xc790('0x8'));var path=require(_0xc790('0x9'));var sox=require('sox');var csv=require(_0xc790('0xa'));var ejs=require(_0xc790('0xb'));var fs=require('fs');var fs_extra=require(_0xc790('0xc'));var _=require(_0xc790('0xd'));var squel=require(_0xc790('0xe'));var crypto=require(_0xc790('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc790('0xa'));var querystring=require(_0xc790('0x10'));var Papa=require('papaparse');var Redis=require(_0xc790('0x11'));var authService=require(_0xc790('0x12'));var qs=require(_0xc790('0x13'));var as=require(_0xc790('0x14'));var hardwareService=require(_0xc790('0x15'));var logger=require(_0xc790('0x16'))('api');var utils=require(_0xc790('0x17'));var config=require(_0xc790('0x18'));var licenseUtil=require(_0xc790('0x19'));var db=require(_0xc790('0x1a'))['db'];function respondWithStatusCode(_0x21a159,_0x2733ff){_0x2733ff=_0x2733ff||0xcc;return function(_0x27fada){if(_0x27fada){return _0x21a159[_0xc790('0x1b')](_0x2733ff);}return _0x21a159[_0xc790('0x1c')](_0x2733ff)['end']();};}function respondWithResult(_0xeddc37,_0x31fc5e){_0x31fc5e=_0x31fc5e||0xc8;return function(_0x5f217a){if(_0x5f217a){return _0xeddc37[_0xc790('0x1c')](_0x31fc5e)[_0xc790('0x1d')](_0x5f217a);}};}function respondWithFilteredResult(_0x455928,_0x4fef85){return function(_0x43ce87){if(_0x43ce87){var _0x586912=typeof _0x4fef85[_0xc790('0x1e')]===_0xc790('0x1f')&&typeof _0x4fef85[_0xc790('0x20')]===_0xc790('0x1f');var _0x3281f7=_0x43ce87[_0xc790('0x21')];var _0x1ab208=_0x586912?0x0:_0x4fef85['offset'];var _0x23f1d1=_0x586912?_0x43ce87[_0xc790('0x21')]:_0x4fef85[_0xc790('0x1e')]+_0x4fef85['limit'];var _0x6cced5;if(_0x23f1d1>=_0x3281f7){_0x23f1d1=_0x3281f7;_0x6cced5=0xc8;}else{_0x6cced5=0xce;}_0x455928[_0xc790('0x1c')](_0x6cced5);return _0x455928[_0xc790('0x22')]('Content-Range',_0x1ab208+'-'+_0x23f1d1+'/'+_0x3281f7)[_0xc790('0x1d')](_0x43ce87);}return null;};}function patchUpdates(_0x5d8107){return function(_0x4b5b76){try{jsonpatch[_0xc790('0x23')](_0x4b5b76,_0x5d8107,!![]);}catch(_0x1a36b9){return BPromise[_0xc790('0x24')](_0x1a36b9);}return _0x4b5b76[_0xc790('0x25')]();};}function saveUpdates(_0x2da1e3,_0x4c5110){return function(_0x5497d5){if(_0x5497d5){return _0x5497d5[_0xc790('0x26')](_0x2da1e3)[_0xc790('0x27')](function(_0x5915d9){return _0x5915d9;});}return null;};}function removeEntity(_0x37d028,_0x49afc9){return function(_0x1ed864){if(_0x1ed864){return _0x1ed864[_0xc790('0x28')]()[_0xc790('0x27')](function(){_0x37d028[_0xc790('0x1c')](0xcc)[_0xc790('0x29')]();});}};}function handleEntityNotFound(_0x3bee84,_0x107438){return function(_0x152b79){if(!_0x152b79){_0x3bee84['sendStatus'](0x194);}return _0x152b79;};}function handleError(_0x5cbb3d,_0x2961a4){_0x2961a4=_0x2961a4||0x1f4;return function(_0x107dee){logger[_0xc790('0x2a')](_0x107dee[_0xc790('0x2b')]);if(_0x107dee[_0xc790('0x2c')]){delete _0x107dee[_0xc790('0x2c')];}_0x5cbb3d[_0xc790('0x1c')](_0x2961a4)[_0xc790('0x2d')](_0x107dee);};}exports['index']=function(_0x10abdf,_0x350756){var _0x5e928f={},_0x9aa1d8={},_0x31b570={'count':0x0,'rows':[]};var _0x38915c=_[_0xc790('0x2e')](db[_0xc790('0x2f')][_0xc790('0x30')],function(_0x5d0013){return{'name':_0x5d0013[_0xc790('0x31')],'type':_0x5d0013[_0xc790('0x32')]['key']};});_0x9aa1d8[_0xc790('0x33')]=_[_0xc790('0x2e')](_0x38915c,_0xc790('0x2c'));_0x9aa1d8[_0xc790('0x34')]=_[_0xc790('0x35')](_0x10abdf[_0xc790('0x34')]);_0x9aa1d8[_0xc790('0x36')]=_['intersection'](_0x9aa1d8[_0xc790('0x33')],_0x9aa1d8[_0xc790('0x34')]);_0x5e928f['attributes']=_[_0xc790('0x37')](_0x9aa1d8[_0xc790('0x33')],qs['fields'](_0x10abdf['query'][_0xc790('0x38')]));_0x5e928f[_0xc790('0x39')]=_0x5e928f[_0xc790('0x39')][_0xc790('0x3a')]?_0x5e928f['attributes']:_0x9aa1d8[_0xc790('0x33')];if(!_0x10abdf[_0xc790('0x34')][_0xc790('0x3b')]('nolimit')){_0x5e928f[_0xc790('0x20')]=qs[_0xc790('0x20')](_0x10abdf[_0xc790('0x34')][_0xc790('0x20')]);_0x5e928f[_0xc790('0x1e')]=qs[_0xc790('0x1e')](_0x10abdf[_0xc790('0x34')][_0xc790('0x1e')]);}_0x5e928f[_0xc790('0x3c')]=qs['sort'](_0x10abdf['query'][_0xc790('0x3d')]);_0x5e928f['where']=qs[_0xc790('0x36')](_['pick'](_0x10abdf['query'],_0x9aa1d8['filters']),_0x38915c);if(_0x10abdf[_0xc790('0x34')][_0xc790('0x3e')]){_0x5e928f['where']=_[_0xc790('0x3f')](_0x5e928f['where'],{'$or':_[_0xc790('0x2e')](_0x38915c,function(_0x42ba79){if(_0x42ba79[_0xc790('0x32')]!==_0xc790('0x40')){var _0x2a5e6c={};_0x2a5e6c[_0x42ba79[_0xc790('0x2c')]]={'$like':'%'+_0x10abdf[_0xc790('0x34')]['filter']+'%'};return _0x2a5e6c;}})});}_0x5e928f=_[_0xc790('0x3f')]({},_0x5e928f,_0x10abdf['options']);var _0x4cf83e={'where':_0x5e928f[_0xc790('0x41')]};return db[_0xc790('0x2f')][_0xc790('0x21')](_0x4cf83e)[_0xc790('0x27')](function(_0x4a3128){_0x31b570['count']=_0x4a3128;if(_0x10abdf[_0xc790('0x34')]['includeAll']){_0x5e928f[_0xc790('0x42')]=[{'all':!![]}];}return db[_0xc790('0x2f')]['findAll'](_0x5e928f);})[_0xc790('0x27')](function(_0x5e7926){_0x31b570[_0xc790('0x43')]=_0x5e7926;return _0x31b570;})[_0xc790('0x27')](respondWithFilteredResult(_0x350756,_0x5e928f))[_0xc790('0x44')](handleError(_0x350756,null));};exports[_0xc790('0x45')]=function(_0x4bfa06,_0x544d29){var _0x2d38c7={'raw':!![],'where':{'id':_0x4bfa06[_0xc790('0x46')]['id']}},_0x1866e7={};_0x1866e7[_0xc790('0x33')]=_['keys'](db[_0xc790('0x2f')][_0xc790('0x30')]);_0x1866e7[_0xc790('0x34')]=_['keys'](_0x4bfa06[_0xc790('0x34')]);_0x1866e7[_0xc790('0x36')]=_[_0xc790('0x37')](_0x1866e7['model'],_0x1866e7[_0xc790('0x34')]);_0x2d38c7[_0xc790('0x39')]=_[_0xc790('0x37')](_0x1866e7[_0xc790('0x33')],qs[_0xc790('0x38')](_0x4bfa06[_0xc790('0x34')]['fields']));_0x2d38c7[_0xc790('0x39')]=_0x2d38c7[_0xc790('0x39')][_0xc790('0x3a')]?_0x2d38c7[_0xc790('0x39')]:_0x1866e7[_0xc790('0x33')];if(_0x4bfa06['query'][_0xc790('0x47')]){_0x2d38c7[_0xc790('0x42')]=[{'all':!![]}];}_0x2d38c7=_['merge']({},_0x2d38c7,_0x4bfa06[_0xc790('0x48')]);return db[_0xc790('0x2f')][_0xc790('0x49')](_0x2d38c7)[_0xc790('0x27')](handleEntityNotFound(_0x544d29,null))[_0xc790('0x27')](respondWithResult(_0x544d29,null))['catch'](handleError(_0x544d29,null));};exports['create']=function(_0x4ce4cc,_0x462bc3){return db[_0xc790('0x2f')][_0xc790('0x4a')](_0x4ce4cc[_0xc790('0x4b')],{})['then'](respondWithResult(_0x462bc3,0xc9))[_0xc790('0x44')](handleError(_0x462bc3,null));};exports['update']=function(_0x36907f,_0x5cf0ee){if(_0x36907f[_0xc790('0x4b')]['id']){delete _0x36907f[_0xc790('0x4b')]['id'];}return db['ChatTransferReport'][_0xc790('0x49')]({'where':{'id':_0x36907f[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x5cf0ee,null))['then'](saveUpdates(_0x36907f[_0xc790('0x4b')],null))[_0xc790('0x27')](respondWithResult(_0x5cf0ee,null))[_0xc790('0x44')](handleError(_0x5cf0ee,null));};exports[_0xc790('0x28')]=function(_0x3ac9aa,_0x40acb5){return db[_0xc790('0x2f')][_0xc790('0x49')]({'where':{'id':_0x3ac9aa[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x40acb5,null))[_0xc790('0x27')](removeEntity(_0x40acb5,null))[_0xc790('0x44')](handleError(_0x40acb5,null));};exports[_0xc790('0x4c')]=function(_0x286083,_0x27df10){return db[_0xc790('0x2f')]['describe']()[_0xc790('0x27')](respondWithResult(_0x27df10,null))[_0xc790('0x44')](handleError(_0x27df10,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3ff00a3..eb52204 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 _0x2867=['moment','bluebird','request-promise','path','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x18321f,_0x359e53){var _0x156220=function(_0x4ffa14){while(--_0x4ffa14){_0x18321f['push'](_0x18321f['shift']());}};_0x156220(++_0x359e53);}(_0x2867,0x1ad));var _0x7286=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x2867[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0x7286('0x0'));var util=require('util');var logger=require(_0x7286('0x1'))(_0x7286('0x2'));var moment=require(_0x7286('0x3'));var BPromise=require(_0x7286('0x4'));var rp=require(_0x7286('0x5'));var fs=require('fs');var path=require(_0x7286('0x6'));var rimraf=require('rimraf');var config=require(_0x7286('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x1248eb,_0x5c5195){return _0x1248eb[_0x7286('0x8')](_0x7286('0x9'),attributes,{'tableName':_0x7286('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7286('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95a6=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define'];(function(_0x34e850,_0x3fedd6){var _0x282de1=function(_0x424539){while(--_0x424539){_0x34e850['push'](_0x34e850['shift']());}};_0x282de1(++_0x3fedd6);}(_0x95a6,0x18d));var _0x695a=function(_0xb5cd0,_0x51a333){_0xb5cd0=_0xb5cd0-0x0;var _0x2253cb=_0x95a6[_0xb5cd0];return _0x2253cb;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require(_0x695a('0x2'))(_0x695a('0x3'));var moment=require('moment');var BPromise=require(_0x695a('0x4'));var rp=require(_0x695a('0x5'));var fs=require('fs');var path=require(_0x695a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x695a('0x7'));module[_0x695a('0x8')]=function(_0x1f0d90,_0x39d199){return _0x1f0d90[_0x695a('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x695a('0xa'),'fields':[_0x695a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index d1427a8..d0de835 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 _0x0505=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','bluebird'];(function(_0x4d06ae,_0x5969a9){var _0x496033=function(_0x346b30){while(--_0x346b30){_0x4d06ae['push'](_0x4d06ae['shift']());}};_0x496033(++_0x5969a9);}(_0x0505,0x8e));var _0x5050=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x0505[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x5050('0x0'));var moment=require('moment');var BPromise=require(_0x5050('0x1'));var rs=require(_0x5050('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5050('0x3'))['db'];var utils=require(_0x5050('0x4'));var logger=require('../../config/logger')(_0x5050('0x5'));var config=require(_0x5050('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5050('0x7')][_0x5050('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x357a39,_0x340cab,_0x3a02c8){return new BPromise(function(_0x3a5da3,_0x2918f5){return client[_0x5050('0x9')](_0x357a39,_0x3a02c8)[_0x5050('0xa')](function(_0x2eef60){logger[_0x5050('0xb')](_0x5050('0xc'),_0x340cab,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x340cab,_0x5050('0xd'),JSON['stringify'](_0x2eef60));if(_0x2eef60[_0x5050('0xe')]){if(_0x2eef60[_0x5050('0xe')][_0x5050('0xf')]===0x1f4){logger[_0x5050('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x340cab,_0x2eef60[_0x5050('0xe')][_0x5050('0x10')]);return _0x2918f5(_0x2eef60[_0x5050('0xe')]['message']);}logger[_0x5050('0xe')](_0x5050('0xc'),_0x340cab,_0x2eef60['error'][_0x5050('0x10')]);return _0x3a5da3(_0x2eef60[_0x5050('0xe')][_0x5050('0x10')]);}else{logger['info'](_0x5050('0xc'),_0x340cab,_0x5050('0xd'));_0x3a5da3(_0x2eef60[_0x5050('0x11')]['message']);}})['catch'](function(_0x5efb30){logger[_0x5050('0xe')](_0x5050('0xc'),_0x340cab,_0x5efb30);_0x2918f5(_0x5efb30);});});} \ No newline at end of file +var _0xc207=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x5bd9de,_0x48f971){var _0x4d6926=function(_0xc2c465){while(--_0xc2c465){_0x5bd9de['push'](_0x5bd9de['shift']());}};_0x4d6926(++_0x48f971);}(_0xc207,0x182));var _0x7c20=function(_0x414901,_0x20ee6a){_0x414901=_0x414901-0x0;var _0x2cae72=_0xc207[_0x414901];return _0x2cae72;};'use strict';var _=require(_0x7c20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7c20('0x1'));var rs=require(_0x7c20('0x2'));var fs=require('fs');var Redis=require(_0x7c20('0x3'));var db=require(_0x7c20('0x4'))['db'];var utils=require(_0x7c20('0x5'));var logger=require(_0x7c20('0x6'))('rpc');var config=require(_0x7c20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c20('0x8')][_0x7c20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1afa18,_0x3b5cd9,_0x236dfe){return new BPromise(function(_0x1d2e9e,_0xd671e8){return client[_0x7c20('0xa')](_0x1afa18,_0x236dfe)[_0x7c20('0xb')](function(_0x53bb80){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x7c20('0xc'));logger[_0x7c20('0xd')](_0x7c20('0xe'),_0x3b5cd9,_0x7c20('0xc'),JSON[_0x7c20('0xf')](_0x53bb80));if(_0x53bb80['error']){if(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x11')]===0x1f4){logger[_0x7c20('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0xd671e8(_0x53bb80[_0x7c20('0x10')]['message']);}logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0x1d2e9e(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x12')]);}else{logger['info'](_0x7c20('0x13'),_0x3b5cd9,_0x7c20('0xc'));_0x1d2e9e(_0x53bb80[_0x7c20('0x14')]['message']);}})['catch'](function(_0x12f7ee){logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x12f7ee);_0xd671e8(_0x12f7ee);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9a78b47..084e9f7 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 _0x3861=['isAuthenticated','index','/describe','post','put','update','delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3861,0x1b9));var _0x1386=function(_0x4486d7,_0x5d8cf2){_0x4486d7=_0x4486d7-0x0;var _0x32f705=_0x3861[_0x4486d7];return _0x32f705;};'use strict';var multer=require(_0x1386('0x0'));var util=require(_0x1386('0x1'));var path=require(_0x1386('0x2'));var timeout=require('connect-timeout');var express=require(_0x1386('0x3'));var router=express['Router']();var fs_extra=require(_0x1386('0x4'));var auth=require(_0x1386('0x5'));var interaction=require(_0x1386('0x6'));var config=require(_0x1386('0x7'));var controller=require('./chatTransferReport.controller');router[_0x1386('0x8')]('/',auth[_0x1386('0x9')](),controller[_0x1386('0xa')]);router[_0x1386('0x8')](_0x1386('0xb'),auth[_0x1386('0x9')](),controller['describe']);router[_0x1386('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1386('0xc')]('/',auth[_0x1386('0x9')](),controller['create']);router[_0x1386('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1386('0xe')]);router[_0x1386('0xf')](_0x1386('0x10'),auth['isAuthenticated'](),controller[_0x1386('0x11')]);module['exports']=router; \ No newline at end of file +var _0xab44=['../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xab44,0xd6));var _0x4ab4=function(_0x384157,_0x50bf56){_0x384157=_0x384157-0x0;var _0x3ef36a=_0xab44[_0x384157];return _0x3ef36a;};'use strict';var multer=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var path=require('path');var timeout=require(_0x4ab4('0x2'));var express=require(_0x4ab4('0x3'));var router=express[_0x4ab4('0x4')]();var fs_extra=require(_0x4ab4('0x5'));var auth=require(_0x4ab4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ab4('0x7'));router[_0x4ab4('0x8')]('/',auth[_0x4ab4('0x9')](),controller['index']);router['get'](_0x4ab4('0xa'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xb')]);router['get'](_0x4ab4('0xc'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xd')]);router[_0x4ab4('0xe')]('/',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xf')]);router[_0x4ab4('0x10')]('/:id',auth[_0x4ab4('0x9')](),controller['update']);router[_0x4ab4('0x11')]('/:id',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0x12')]);module[_0x4ab4('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8186169..a70c134 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 _0x6e5d=['Thanks\x20you\x20for\x20your\x20time!','Skip','BOOLEAN','Feedback','star','thumb','TEXT','stringify','name','getDataValue','onlineForm','parse','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','#011F6A','INTEGER','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x3c3a3c,_0x2c1fac){var _0x1cb9cd=function(_0xcafb63){while(--_0xcafb63){_0x3c3a3c['push'](_0x3c3a3c['shift']());}};_0x1cb9cd(++_0x2c1fac);}(_0x6e5d,0x145));var _0xd6e5=function(_0x1c268e,_0x2a59e6){_0x1c268e=_0x1c268e-0x0;var _0x27d639=_0x6e5d[_0x1c268e];return _0x27d639;};'use strict';var Sequelize=require(_0xd6e5('0x0'));var rs=require(_0xd6e5('0x1'));module[_0xd6e5('0x2')]={'name':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'unique':_0xd6e5('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x5')},'mapKeyOffline':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':_0xd6e5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':_0xd6e5('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd6e5('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xd6e5('0x8'),_0xd6e5('0x9')),'defaultValue':_0xd6e5('0x8')},'header_online':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xf')},'noteTitle':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x10')},'placeholderMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x11')},'closingMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x12')},'closingMessageButton':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xb')},'skipMessageButton':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x13')},'conditionAgreement':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0xd6e5('0x16'),_0xd6e5('0x17')),'defaultValue':_0xd6e5('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return JSON[_0xd6e5('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd6e5('0x1a'),'type':'text','required':!![]},'props':{'title':_0xd6e5('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xd6e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6e5('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd6e5('0x1b')](_0xd6e5('0x1c'))?JSON[_0xd6e5('0x1d')](this['getDataValue'](_0xd6e5('0x1c'))):{};},'set':function(_0x56d033){return this[_0xd6e5('0x1e')](_0xd6e5('0x1c'),JSON[_0xd6e5('0x19')](_0x56d033));}},'offlineForm':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return JSON[_0xd6e5('0x19')]({'items':[{'type':_0xd6e5('0x1f'),'props':{'title':_0xd6e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6e5('0x5'),'type':_0xd6e5('0x5')},'variable':null},{'type':_0xd6e5('0x20'),'config':{'placeholder':_0xd6e5('0x21')},'props':{'title':'Comments','helpText':_0xd6e5('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xd6e5('0x1b')](_0xd6e5('0x23'))?JSON['parse'](this[_0xd6e5('0x1b')](_0xd6e5('0x23'))):{};},'set':function(_0xa2fc58){return this[_0xd6e5('0x1e')](_0xd6e5('0x23'),JSON['stringify'](_0xa2fc58));}},'token':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd6e5('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd6e5('0x3')]},'waitingTitle':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x26')},'offlineMessageBody':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x28')},'skipUnmanaged':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd6e5('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return _0xd6e5('0x29');}},'notificationSound':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x2b')},'defaultTitle':{'type':Sequelize[_0xd6e5('0x3')]},'customerAvatar':{'type':Sequelize[_0xd6e5('0x18')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6e5('0x7')],'comment':_0xd6e5('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![],'comment':_0xd6e5('0x2e'),'set':function(_0x414a59){if(!_0x414a59)this['setDataValue'](_0xd6e5('0x2f'),null);this[_0xd6e5('0x1e')](_0xd6e5('0x30'),_0x414a59);}},'vidaooEscalation':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xba6e=['Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','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}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify'];(function(_0x1b4680,_0x18ec5d){var _0x327ceb=function(_0x446ae1){while(--_0x446ae1){_0x1b4680['push'](_0x1b4680['shift']());}};_0x327ceb(++_0x18ec5d);}(_0xba6e,0x10c));var _0xeba6=function(_0x5df711,_0x3f2a31){_0x5df711=_0x5df711-0x0;var _0x24a716=_0xba6e[_0x5df711];return _0x24a716;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'unique':_0xeba6('0x3')},'description':{'type':Sequelize[_0xeba6('0x2')]},'mapKey':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeba6('0x2')]},'animation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeba6('0x9')](_0xeba6('0xa'),_0xeba6('0xb')),'defaultValue':_0xeba6('0xa')},'header_online':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xc')},'start_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xd')},'offline_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'header_offline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x12')},'noteTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x13')},'placeholderMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x14')},'closingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x15')},'closingMessageButton':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x16')},'conditionAgreement':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xeba6('0x18'),'variable':null,'config':{'placeholder':_0xeba6('0x19'),'type':_0xeba6('0x1a'),'required':!![]},'props':{'title':_0xeba6('0x19'),'helpText':''}},{'type':_0xeba6('0x18'),'props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeba6('0x1b')](_0xeba6('0x1c'))?JSON[_0xeba6('0x1d')](this[_0xeba6('0x1b')](_0xeba6('0x1c'))):{};},'set':function(_0x292b4e){return this[_0xeba6('0x1e')](_0xeba6('0x1c'),JSON['stringify'](_0x292b4e));}},'offlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON[_0xeba6('0x1f')]({'items':[{'type':'input','props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xeba6('0x20')},'props':{'title':'Comments','helpText':_0xeba6('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xeba6('0x22'))?JSON['parse'](this[_0xeba6('0x1b')](_0xeba6('0x22'))):{};},'set':function(_0x314b9e){return this[_0xeba6('0x1e')](_0xeba6('0x22'),JSON[_0xeba6('0x1f')](_0x314b9e));}},'token':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return rs[_0xeba6('0x23')]();}},'autoclose':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeba6('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeba6('0x2')]},'waitingTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x26')},'skipUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x16')},'sendUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return _0xeba6('0x27');}},'notificationSound':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x29')},'verticalAlignment':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x2a')},'defaultTitle':{'type':Sequelize[_0xeba6('0x2')]},'customerAvatar':{'type':Sequelize[_0xeba6('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeba6('0x7')],'comment':_0xeba6('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'comment':_0xeba6('0x2d'),'set':function(_0x3edc8a){if(!_0x3edc8a)this[_0xeba6('0x1e')](_0xeba6('0x2e'),null);this['setDataValue'](_0xeba6('0x2f'),_0x3edc8a);}},'vidaooEscalation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeba6('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeba6('0x30')},'vidaooNote':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return _0xeba6('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeba6('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4c40b5d..3223d09 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 _0x9608=['threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','*,*,*,*','forcedOwnership','Start','EventManager','files','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','true','interval','ONLINE','OFFLINE','timezone','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','virtual','replace','verticalAlignment','color_button','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','info','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','ChatWebsites','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','ChatWebsiteId','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','device','%s\x20%s\x20%s','vendor'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x9608,0x74));var _0x8960=function(_0x2e7398,_0x35d985){_0x2e7398=_0x2e7398-0x0;var _0x4e094e=_0x9608[_0x2e7398];return _0x4e094e;};'use strict';var emlformat=require(_0x8960('0x0'));var rimraf=require(_0x8960('0x1'));var zipdir=require(_0x8960('0x2'));var jsonpatch=require(_0x8960('0x3'));var rp=require(_0x8960('0x4'));var moment=require(_0x8960('0x5'));var BPromise=require(_0x8960('0x6'));var Mustache=require('mustache');var util=require(_0x8960('0x7'));var path=require(_0x8960('0x8'));var sox=require(_0x8960('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8960('0xa'));var _=require(_0x8960('0xb'));var squel=require('squel');var crypto=require(_0x8960('0xc'));var jsforce=require(_0x8960('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8960('0xe'));var querystring=require(_0x8960('0xf'));var Papa=require('papaparse');var Redis=require(_0x8960('0x10'));var authService=require(_0x8960('0x11'));var qs=require(_0x8960('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8960('0x13'));var logger=require(_0x8960('0x14'))(_0x8960('0x15'));var utils=require('../../config/utils');var config=require(_0x8960('0x16'));var licenseUtil=require(_0x8960('0x17'));var db=require('../../mysqldb')['db'];config[_0x8960('0x18')]=_[_0x8960('0x19')](config[_0x8960('0x18')],{'host':_0x8960('0x1a'),'port':0x18eb});var socket=require(_0x8960('0x1b'))(new Redis(config[_0x8960('0x18')]));require(_0x8960('0x1c'))[_0x8960('0x1d')](socket);var jayson=require(_0x8960('0x1e'));var client=jayson[_0x8960('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x8960('0x1f')][_0x8960('0x20')]({'port':0x232a});var client9003=jayson[_0x8960('0x1f')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x183a9c,_0x3fdf0c,_0x146976,_0x594558){return new BPromise(function(_0x1a566b,_0x58e7ad){var _0x13cc94=_0x594558||client;return _0x13cc94['request'](_0x183a9c,_0x146976)['then'](function(_0x1feba5){logger[_0x8960('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x3fdf0c,'request\x20sent');logger[_0x8960('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3fdf0c,'request\x20sent',JSON[_0x8960('0x23')](_0x1feba5));if(_0x1feba5['error']){if(_0x1feba5[_0x8960('0x24')][_0x8960('0x25')]===0x1f4){logger['error'](_0x8960('0x26'),_0x3fdf0c,_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);return _0x58e7ad(_0x1feba5['error'][_0x8960('0x27')]);}logger[_0x8960('0x24')](_0x8960('0x26'),_0x3fdf0c,_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);return _0x1a566b(_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);}else{logger['info'](_0x8960('0x26'),_0x3fdf0c,_0x8960('0x28'));_0x1a566b(_0x1feba5[_0x8960('0x29')][_0x8960('0x27')]);}})['catch'](function(_0x31fa8b){logger[_0x8960('0x24')](_0x8960('0x26'),_0x3fdf0c,_0x31fa8b);_0x58e7ad(_0x31fa8b);});});}function respondWithStatusCode(_0x54dbc9,_0x442046){_0x442046=_0x442046||0xcc;return function(_0xcd96ce){if(_0xcd96ce){return _0x54dbc9[_0x8960('0x2a')](_0x442046);}return _0x54dbc9[_0x8960('0x2b')](_0x442046)[_0x8960('0x2c')]();};}function respondWithResult(_0x16415b,_0x16f855){_0x16f855=_0x16f855||0xc8;return function(_0x325571){if(_0x325571){return _0x16415b[_0x8960('0x2b')](_0x16f855)[_0x8960('0x2d')](_0x325571);}};}function respondWithFilteredResult(_0x43bd84,_0x5151a6){return function(_0x4185a7){if(_0x4185a7){var _0x3fce2d=typeof _0x5151a6['offset']===_0x8960('0x2e')&&typeof _0x5151a6[_0x8960('0x2f')]===_0x8960('0x2e');var _0x5aaec5=_0x4185a7[_0x8960('0x30')];var _0x30d137=_0x3fce2d?0x0:_0x5151a6[_0x8960('0x31')];var _0x51da11=_0x3fce2d?_0x4185a7['count']:_0x5151a6['offset']+_0x5151a6[_0x8960('0x2f')];var _0x3c96c4;if(_0x51da11>=_0x5aaec5){_0x51da11=_0x5aaec5;_0x3c96c4=0xc8;}else{_0x3c96c4=0xce;}_0x43bd84[_0x8960('0x2b')](_0x3c96c4);return _0x43bd84[_0x8960('0x32')]('Content-Range',_0x30d137+'-'+_0x51da11+'/'+_0x5aaec5)[_0x8960('0x2d')](_0x4185a7);}return null;};}function patchUpdates(_0x5e826d){return function(_0x24ae87){try{jsonpatch[_0x8960('0x33')](_0x24ae87,_0x5e826d,!![]);}catch(_0x46260a){return BPromise[_0x8960('0x34')](_0x46260a);}return _0x24ae87[_0x8960('0x35')]();};}function saveUpdates(_0x7973a7,_0x536048){return function(_0x833407){if(_0x833407){return _0x833407[_0x8960('0x36')](_0x7973a7)[_0x8960('0x37')](function(_0x22443e){return _0x22443e;});}return null;};}function removeEntity(_0x2f74e2,_0x144b81){return function(_0x7d08b1){if(_0x7d08b1){return _0x7d08b1['destroy']()[_0x8960('0x37')](function(){var _0x1fe695=_0x7d08b1[_0x8960('0x38')]({'plain':!![]});var _0x562a1b=_0x8960('0x39');return db['UserProfileResource'][_0x8960('0x3a')]({'where':{'type':_0x562a1b,'resourceId':_0x1fe695['id']}})[_0x8960('0x37')](function(){return _0x7d08b1;});})[_0x8960('0x37')](function(){_0x2f74e2[_0x8960('0x2b')](0xcc)[_0x8960('0x2c')]();});}};}function handleEntityNotFound(_0x33e060,_0x58fbdc){return function(_0x44c3fb){if(!_0x44c3fb){_0x33e060[_0x8960('0x2a')](0x194);}return _0x44c3fb;};}function handleError(_0x12a33f,_0x4ea884){_0x4ea884=_0x4ea884||0x1f4;return function(_0x4d9183){logger[_0x8960('0x24')](_0x4d9183[_0x8960('0x3b')]);if(_0x4d9183['name']){delete _0x4d9183[_0x8960('0x3c')];}_0x12a33f['status'](_0x4ea884)[_0x8960('0x3d')](_0x4d9183);};}exports[_0x8960('0x3e')]=function(_0x31c1ff,_0x48bc9e){var _0x3e83b3={'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]},_0x4fc7fb={},_0x361391={'count':0x0,'rows':[]};var _0x277f6e=_[_0x8960('0x41')](db['ChatWebsite']['rawAttributes'],function(_0x361bbe){return{'name':_0x361bbe['fieldName'],'type':_0x361bbe[_0x8960('0x42')][_0x8960('0x43')]};});_0x4fc7fb[_0x8960('0x44')]=_[_0x8960('0x41')](_0x277f6e,_0x8960('0x3c'));_0x4fc7fb[_0x8960('0x45')]=_[_0x8960('0x46')](_0x31c1ff[_0x8960('0x45')]);_0x4fc7fb[_0x8960('0x47')]=_[_0x8960('0x48')](_0x4fc7fb['model'],_0x4fc7fb[_0x8960('0x45')]);_0x3e83b3[_0x8960('0x49')]=_[_0x8960('0x48')](_0x4fc7fb[_0x8960('0x44')],qs['fields'](_0x31c1ff[_0x8960('0x45')][_0x8960('0x4a')]));_0x3e83b3['attributes']=_0x3e83b3[_0x8960('0x49')][_0x8960('0x4b')]?_0x3e83b3[_0x8960('0x49')]:_0x4fc7fb[_0x8960('0x44')];if(!_0x31c1ff[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x3e83b3['limit']=qs[_0x8960('0x2f')](_0x31c1ff['query']['limit']);_0x3e83b3[_0x8960('0x31')]=qs['offset'](_0x31c1ff[_0x8960('0x45')][_0x8960('0x31')]);}_0x3e83b3[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x31c1ff[_0x8960('0x45')]['sort']);_0x3e83b3['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x31c1ff[_0x8960('0x45')],_0x4fc7fb['filters']),_0x277f6e);if(_0x31c1ff[_0x8960('0x45')]['filter']){_0x3e83b3['where']=_[_0x8960('0x51')](_0x3e83b3[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x277f6e,function(_0x4d678a){if(_0x4d678a['type']!==_0x8960('0x53')){var _0x1465cd={};_0x1465cd[_0x4d678a[_0x8960('0x3c')]]={'$like':'%'+_0x31c1ff['query']['filter']+'%'};return _0x1465cd;}})});}_0x3e83b3=_[_0x8960('0x51')]({},_0x3e83b3,_0x31c1ff[_0x8960('0x54')]);var _0x2c8347={'where':_0x3e83b3[_0x8960('0x52')]};return db[_0x8960('0x55')][_0x8960('0x30')](_0x2c8347)['then'](function(_0x21eb05){_0x361391[_0x8960('0x30')]=_0x21eb05;if(_0x31c1ff[_0x8960('0x45')][_0x8960('0x56')]){_0x3e83b3[_0x8960('0x57')]=[{'all':!![]}];}return db[_0x8960('0x55')][_0x8960('0x58')](_0x3e83b3);})[_0x8960('0x37')](function(_0x6910a0){_0x361391[_0x8960('0x59')]=_0x6910a0;return _0x361391;})[_0x8960('0x37')](respondWithFilteredResult(_0x48bc9e,_0x3e83b3))['catch'](handleError(_0x48bc9e,null));};exports[_0x8960('0x5a')]=function(_0x28f302,_0xb46f5b){var _0x273845={'raw':![],'where':{'id':_0x28f302[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]},_0x2854ab={};_0x2854ab[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x55')][_0x8960('0x5c')]);_0x2854ab['query']=_[_0x8960('0x46')](_0x28f302['query']);_0x2854ab['filters']=_[_0x8960('0x48')](_0x2854ab['model'],_0x2854ab['query']);_0x273845[_0x8960('0x49')]=_[_0x8960('0x48')](_0x2854ab['model'],qs['fields'](_0x28f302[_0x8960('0x45')]['fields']));_0x273845['attributes']=_0x273845['attributes']['length']?_0x273845['attributes']:_0x2854ab[_0x8960('0x44')];if(_0x28f302['query'][_0x8960('0x56')]){_0x273845[_0x8960('0x57')]=[{'all':!![]}];}_0x273845=_[_0x8960('0x51')]({},_0x273845,_0x28f302['options']);return db[_0x8960('0x55')][_0x8960('0x5d')](_0x273845)[_0x8960('0x37')](handleEntityNotFound(_0xb46f5b,null))[_0x8960('0x37')](respondWithResult(_0xb46f5b,null))[_0x8960('0x5e')](handleError(_0xb46f5b,null));};exports['create']=function(_0x568459,_0x449db5){return db['ChatWebsite'][_0x8960('0x5f')](_0x568459[_0x8960('0x60')],{})['then'](function(_0x509863){var _0x205a2a=_0x568459[_0x8960('0x61')][_0x8960('0x38')]({'plain':!![]});if(!_0x205a2a)throw new Error(_0x8960('0x62'));if(_0x205a2a[_0x8960('0x63')]==='user'){var _0x4f35b6=_0x509863[_0x8960('0x38')]({'plain':!![]});var _0x1dd17d=_0x8960('0x39');return db[_0x8960('0x64')][_0x8960('0x5d')]({'where':{'name':_0x1dd17d,'userProfileId':_0x205a2a[_0x8960('0x65')]},'raw':!![]})['then'](function(_0x4ce7b3){if(_0x4ce7b3&&_0x4ce7b3[_0x8960('0x66')]===0x0){return db[_0x8960('0x67')][_0x8960('0x5f')]({'name':_0x4f35b6['name'],'resourceId':_0x4f35b6['id'],'type':_0x4ce7b3['name'],'sectionId':_0x4ce7b3['id']},{})[_0x8960('0x37')](function(){return _0x509863;});}else{return _0x509863;}})[_0x8960('0x5e')](function(_0x5360bd){logger[_0x8960('0x24')](_0x8960('0x68'),_0x5360bd);throw _0x5360bd;});}return _0x509863;})['then'](respondWithResult(_0x449db5,0xc9))[_0x8960('0x5e')](handleError(_0x449db5,null));};exports[_0x8960('0x36')]=function(_0x175c4a,_0x887090){if(_0x175c4a[_0x8960('0x60')]['id']){delete _0x175c4a[_0x8960('0x60')]['id'];}return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x175c4a[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]})[_0x8960('0x37')](handleEntityNotFound(_0x887090,null))[_0x8960('0x37')](saveUpdates(_0x175c4a[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0x887090,null))[_0x8960('0x5e')](handleError(_0x887090,null));};exports[_0x8960('0x3a')]=function(_0x27f4df,_0x130513){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x27f4df[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x130513,null))['then'](removeEntity(_0x130513,null))[_0x8960('0x5e')](handleError(_0x130513,null));};exports[_0x8960('0x69')]=function(_0x1476ab,_0x3e2a5b){return db[_0x8960('0x55')]['describe']()[_0x8960('0x37')](respondWithResult(_0x3e2a5b,null))[_0x8960('0x5e')](handleError(_0x3e2a5b,null));};exports[_0x8960('0x6a')]=function(_0xadf2bf,_0x4d3abe,_0x499578){if(_0xadf2bf[_0x8960('0x60')]['id']){delete _0xadf2bf[_0x8960('0x60')]['id'];}return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0xadf2bf[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4d3abe,null))[_0x8960('0x37')](function(_0x3e4c39){if(_0x3e4c39){_0xadf2bf[_0x8960('0x60')]['ChatWebsiteId']=_0x3e4c39['id'];return db['Disposition'][_0x8960('0x5f')](_0xadf2bf['body']);}})[_0x8960('0x37')](respondWithResult(_0x4d3abe,null))[_0x8960('0x5e')](handleError(_0x4d3abe,null));};exports[_0x8960('0x6b')]=function(_0x485ea5,_0x64be5b,_0x4010d2){var _0x20b7a6={'raw':![],'where':{}};var _0x4f2298={};var _0x4e9776={'count':0x0,'rows':[]};return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x485ea5['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x64be5b,null))[_0x8960('0x37')](function(_0x551ba3){if(_0x551ba3){_0x4f2298[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x6c')][_0x8960('0x5c')]);_0x4f2298['query']=_[_0x8960('0x46')](_0x485ea5['query']);_0x4f2298[_0x8960('0x47')]=_[_0x8960('0x48')](_0x4f2298['model'],_0x4f2298[_0x8960('0x45')]);_0x20b7a6[_0x8960('0x49')]=_[_0x8960('0x48')](_0x4f2298[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x485ea5['query'][_0x8960('0x4a')]));_0x20b7a6[_0x8960('0x49')]=_0x20b7a6[_0x8960('0x49')][_0x8960('0x4b')]?_0x20b7a6['attributes']:_0x4f2298['model'];if(!_0x485ea5[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x20b7a6[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x485ea5[_0x8960('0x45')][_0x8960('0x2f')]);_0x20b7a6[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x485ea5[_0x8960('0x45')][_0x8960('0x31')]);}_0x20b7a6['order']=qs[_0x8960('0x4f')](_0x485ea5['query'][_0x8960('0x4f')]);_0x20b7a6['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x485ea5[_0x8960('0x45')],_0x4f2298['filters']));_0x20b7a6[_0x8960('0x52')][_0x8960('0x6d')]=_0x551ba3['id'];if(_0x485ea5['query']['filter']){_0x20b7a6[_0x8960('0x52')]=_[_0x8960('0x51')](_0x20b7a6[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x20b7a6[_0x8960('0x49')],function(_0x1f4259){var _0x55de7f={};_0x55de7f[_0x1f4259]={'$like':'%'+_0x485ea5['query'][_0x8960('0x6e')]+'%'};return _0x55de7f;})});}_0x20b7a6=_[_0x8960('0x51')]({},_0x20b7a6,_0x485ea5[_0x8960('0x54')]);return db[_0x8960('0x6c')][_0x8960('0x30')]({'where':_0x20b7a6['where']})[_0x8960('0x37')](function(_0x333b47){_0x4e9776[_0x8960('0x30')]=_0x333b47;if(_0x485ea5[_0x8960('0x45')][_0x8960('0x56')]){_0x20b7a6[_0x8960('0x57')]=[{'all':!![]}];}return db[_0x8960('0x6c')][_0x8960('0x58')](_0x20b7a6);})[_0x8960('0x37')](function(_0x21e09b){_0x4e9776[_0x8960('0x59')]=_0x21e09b;return _0x4e9776;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x64be5b,_0x20b7a6))[_0x8960('0x5e')](handleError(_0x64be5b,null));};exports[_0x8960('0x6f')]=function(_0x254ae6,_0x4cd70e,_0x1364c8){return db['ChatWebsite']['find']({'where':{'id':_0x254ae6[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4cd70e,null))[_0x8960('0x37')](function(_0x5d1dd8){if(_0x5d1dd8){return _0x5d1dd8[_0x8960('0x6f')](_0x254ae6[_0x8960('0x45')][_0x8960('0x70')]);}})['then'](respondWithStatusCode(_0x4cd70e,null))['catch'](handleError(_0x4cd70e,null));};exports[_0x8960('0x71')]=function(_0x2f16d8,_0xeb081,_0xc026e3){if(_0x2f16d8[_0x8960('0x60')]['id']){delete _0x2f16d8[_0x8960('0x60')]['id'];}return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x2f16d8[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0xeb081,null))[_0x8960('0x37')](function(_0x481600){if(_0x481600){_0x2f16d8[_0x8960('0x60')][_0x8960('0x6d')]=_0x481600['id'];return db[_0x8960('0x72')][_0x8960('0x5f')](_0x2f16d8[_0x8960('0x60')]);}})[_0x8960('0x37')](respondWithResult(_0xeb081,null))[_0x8960('0x5e')](handleError(_0xeb081,null));};exports['getAnswers']=function(_0x52b828,_0x22af3b,_0x4df7ff){var _0x151939={'raw':![],'where':{}};var _0x2273d0={};var _0x24e473={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x52b828['params']['id']}})['then'](handleEntityNotFound(_0x22af3b,null))[_0x8960('0x37')](function(_0x21d620){if(_0x21d620){_0x2273d0[_0x8960('0x44')]=_['keys'](db[_0x8960('0x72')]['rawAttributes']);_0x2273d0['query']=_['keys'](_0x52b828[_0x8960('0x45')]);_0x2273d0[_0x8960('0x47')]=_['intersection'](_0x2273d0[_0x8960('0x44')],_0x2273d0[_0x8960('0x45')]);_0x151939[_0x8960('0x49')]=_['intersection'](_0x2273d0[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x52b828['query']['fields']));_0x151939['attributes']=_0x151939[_0x8960('0x49')][_0x8960('0x4b')]?_0x151939['attributes']:_0x2273d0[_0x8960('0x44')];if(!_0x52b828[_0x8960('0x45')]['hasOwnProperty'](_0x8960('0x4d'))){_0x151939['limit']=qs[_0x8960('0x2f')](_0x52b828[_0x8960('0x45')]['limit']);_0x151939['offset']=qs[_0x8960('0x31')](_0x52b828['query'][_0x8960('0x31')]);}_0x151939[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x52b828[_0x8960('0x45')]['sort']);_0x151939[_0x8960('0x52')]=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x52b828[_0x8960('0x45')],_0x2273d0[_0x8960('0x47')]));_0x151939['where']['ChatWebsiteId']=_0x21d620['id'];if(_0x52b828['query'][_0x8960('0x6e')]){_0x151939[_0x8960('0x52')]=_[_0x8960('0x51')](_0x151939[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x151939[_0x8960('0x49')],function(_0x5609ba){var _0x50d847={};_0x50d847[_0x5609ba]={'$like':'%'+_0x52b828[_0x8960('0x45')]['filter']+'%'};return _0x50d847;})});}_0x151939=_[_0x8960('0x51')]({},_0x151939,_0x52b828[_0x8960('0x54')]);return db[_0x8960('0x72')]['count']({'where':_0x151939['where']})[_0x8960('0x37')](function(_0x1b8cf4){_0x24e473[_0x8960('0x30')]=_0x1b8cf4;if(_0x52b828[_0x8960('0x45')]['includeAll']){_0x151939[_0x8960('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8960('0x58')](_0x151939);})['then'](function(_0x55fee4){_0x24e473[_0x8960('0x59')]=_0x55fee4;return _0x24e473;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x22af3b,_0x151939))['catch'](handleError(_0x22af3b,null));};exports[_0x8960('0x74')]=function(_0x277592,_0x196a27,_0xba47b8){return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x277592['params']['id']}})['then'](handleEntityNotFound(_0x196a27,null))[_0x8960('0x37')](function(_0xa3ca8d){if(_0xa3ca8d){return _0xa3ca8d['removeAnswers'](_0x277592[_0x8960('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x196a27,null))['catch'](handleError(_0x196a27,null));};exports['addLogo']=function(_0x4be0a5,_0x498181,_0x3d26ab){_0x4be0a5[_0x8960('0x60')][_0x8960('0x75')]=_0x4be0a5[_0x8960('0x76')][_0x8960('0x77')];return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x4be0a5['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x498181,null))[_0x8960('0x37')](saveUpdates(_0x4be0a5['body'],null))[_0x8960('0x37')](respondWithResult(_0x498181,null))['catch'](handleError(_0x498181,null));};exports['addAvatar']=function(_0x1ffe14,_0xebfb86,_0x243dc1){_0x1ffe14[_0x8960('0x60')]['agentAvatar']=_0x1ffe14[_0x8960('0x76')][_0x8960('0x77')];return db['ChatWebsite']['find']({'where':{'id':_0x1ffe14['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0xebfb86,null))[_0x8960('0x37')](saveUpdates(_0x1ffe14[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0xebfb86,null))['catch'](handleError(_0xebfb86,null));};exports[_0x8960('0x78')]=function(_0x3e54dc,_0x304247,_0x31101b){_0x3e54dc[_0x8960('0x60')][_0x8960('0x79')]=_0x3e54dc[_0x8960('0x76')][_0x8960('0x77')];return db[_0x8960('0x55')]['find']({'where':{'id':_0x3e54dc[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x304247,null))['then'](saveUpdates(_0x3e54dc[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0x304247,null))['catch'](handleError(_0x304247,null));};exports[_0x8960('0x7a')]=function(_0x48bee5,_0x374783,_0x35af9d){_0x48bee5[_0x8960('0x60')][_0x8960('0x7b')]=_0x48bee5[_0x8960('0x76')]['filename'];return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x48bee5[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x374783,null))[_0x8960('0x37')](saveUpdates(_0x48bee5[_0x8960('0x60')],null))['then'](respondWithResult(_0x374783,null))['catch'](handleError(_0x374783,null));};exports[_0x8960('0x7c')]=function(_0x263d2d,_0x22fdc0,_0x2b3f8e){var _0x1657a2=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x7f'));var _0xcfed01={'where':{'id':_0x263d2d[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x75')],'raw':!![]};var _0x548f54=![];return require('../../config/license/util')[_0x8960('0x80')]()[_0x8960('0x37')](function(_0x41bead){if(_0x41bead){_0x548f54=_0x41bead[_0x8960('0x81')];}})['then'](function(){return db[_0x8960('0x55')][_0x8960('0x5d')](_0xcfed01);})[_0x8960('0x37')](handleEntityNotFound(_0x22fdc0,null))[_0x8960('0x37')](function(_0x6539ba){if(_0x6539ba){if(!_[_0x8960('0x82')](_0x6539ba[_0x8960('0x75')])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config['root'],'server/files/images/logos/',_0x6539ba[_0x8960('0x75')]))&&_0x548f54){_0x1657a2=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x84'),_0x6539ba[_0x8960('0x75')]);}}return _0x22fdc0[_0x8960('0x85')](_0x1657a2);}})[_0x8960('0x5e')](handleError(_0x22fdc0,null));};exports['getAvatar']=function(_0x441877,_0x536cfd,_0x2e2d04){var _0x26fe0b=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x86'));var _0x796759={'where':{'id':_0x441877[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x87')],'raw':!![]};return db['ChatWebsite']['find'](_0x796759)[_0x8960('0x37')](handleEntityNotFound(_0x536cfd,null))[_0x8960('0x37')](function(_0x52fc01){if(_0x52fc01){if(!_[_0x8960('0x82')](_0x52fc01[_0x8960('0x87')])){if(fs[_0x8960('0x83')](path['join'](config[_0x8960('0x7e')],_0x8960('0x88'),_0x52fc01[_0x8960('0x87')]))){_0x26fe0b=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x88'),_0x52fc01[_0x8960('0x87')]);}}return _0x536cfd['download'](_0x26fe0b);}})[_0x8960('0x5e')](handleError(_0x536cfd,null));};exports[_0x8960('0x89')]=function(_0xc726c7,_0x1f3ceb,_0x3f3d38){var _0x7ed974=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x8a'));var _0x3fb37b={'where':{'id':_0xc726c7[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x79'),_0x8960('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x8960('0x5d')](_0x3fb37b)[_0x8960('0x37')](handleEntityNotFound(_0x1f3ceb,null))[_0x8960('0x37')](function(_0x1ba4b3){if(_0x1ba4b3){if(!_[_0x8960('0x82')](_0x1ba4b3['customerAvatar'])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config[_0x8960('0x7e')],'server/files/images/avatars/',_0x1ba4b3[_0x8960('0x79')]))&&_0x1ba4b3[_0x8960('0x8b')]){_0x7ed974=path['join'](config[_0x8960('0x7e')],'server/files/images/avatars/',_0x1ba4b3['customerAvatar']);}}return _0x1f3ceb['download'](_0x7ed974);}})['catch'](handleError(_0x1f3ceb,null));};exports['getSystemAvatar']=function(_0x1ba542,_0x2362e5,_0x2e0c8e){var _0x472bc9=path['join'](config[_0x8960('0x7e')],_0x8960('0x8c'));var _0x4840ef={'where':{'id':_0x1ba542['params']['id']},'attributes':['id',_0x8960('0x7b')],'raw':!![]};return db[_0x8960('0x55')][_0x8960('0x5d')](_0x4840ef)[_0x8960('0x37')](handleEntityNotFound(_0x2362e5,null))[_0x8960('0x37')](function(_0x560322){if(_0x560322){if(!_[_0x8960('0x82')](_0x560322[_0x8960('0x7b')])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config['root'],'server/files/images/avatars/',_0x560322[_0x8960('0x7b')]))){_0x472bc9=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x88'),_0x560322[_0x8960('0x7b')]);}}return _0x2362e5['download'](_0x472bc9);}})[_0x8960('0x5e')](handleError(_0x2362e5,null));};exports[_0x8960('0x8d')]=function(_0xc4b590,_0x30890e,_0x57cc41){var _0x570348=require(_0x8960('0x8e'));var _0x5138c2=new _0x570348();var _0x19f0ca=_0x5138c2[_0x8960('0x8f')](_0xc4b590[_0x8960('0x90')]['user-agent'])[_0x8960('0x91')]();var _0x97b200={'body':_0xc4b590[_0x8960('0x60')],'channel':_0x8960('0x92')};var _0x4aa17e=[];var _0x3ecda8=[];var _0x14258a={};var _0x46fd5d=![];return db[_0x8960('0x93')][_0x8960('0x69')]()[_0x8960('0x37')](function(_0x1442d7){if(!_0x1442d7){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x96'));}_0x4aa17e=_['difference'](_[_0x8960('0x46')](_0x1442d7),['createdAt',_0x8960('0x97')]);_0x3ecda8=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x1442d7),[_0x8960('0x99'),_0x8960('0x97'),_0x8960('0x9a'),_0x8960('0x9b')]);if(_0xc4b590[_0x8960('0x60')]['id']){delete _0xc4b590[_0x8960('0x60')]['id'];}if(_[_0x8960('0x82')](_0xc4b590[_0x8960('0x60')]['from'])){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))]('from\x20is\x20mandatory');}if(_[_0x8960('0x82')](_0xc4b590['body'][_0x8960('0x60')])||_0xc4b590[_0x8960('0x60')]['body']===''){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9c'));}if(_[_0x8960('0x82')](_0xc4b590[_0x8960('0x60')][_0x8960('0x9d')])){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9e')+_0x3ecda8);}if(!_['includes'](_0x3ecda8,_0xc4b590['body']['mapKey'])){throw new db[(_0x8960('0x94'))]['ValidationError'](_0x8960('0x9f')+_0x3ecda8);}_0x14258a[_0xc4b590[_0x8960('0x60')]['mapKey']]=_0xc4b590[_0x8960('0x60')]['from'];})[_0x8960('0x37')](function(){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0xc4b590['params']['id']},'include':[{'model':db[_0x8960('0xa0')],'as':_0x8960('0xa1'),'include':[{'model':db[_0x8960('0x93')],'as':_0x8960('0xa2'),'where':_0x14258a,'limit':0x1,'order':[[_0x8960('0x97'),_0x8960('0xa3')]]}]},{'model':db[_0x8960('0xa4')],'as':_0x8960('0xa5')}]});})[_0x8960('0x37')](handleEntityNotFound(_0x30890e,null))['then'](function(_0x23b932){if(_0x23b932&&_0x23b932[_0x8960('0xa1')]){_0x97b200[_0x8960('0xa6')]=_0x23b932;_0x97b200[_0x8960('0xa7')]=_0x23b932[_0x8960('0xa5')];_0x97b200[_0x8960('0xa8')]=_0x23b932[_0x8960('0xa1')];_0x97b200[_0x8960('0xa7')]=_[_0x8960('0xa9')](_0x97b200[_0x8960('0xa7')],[_0x8960('0xaa')],['asc']);if(_0x97b200[_0x8960('0xa6')][_0x8960('0xa5')]){delete _0x97b200[_0x8960('0xa6')][_0x8960('0xa5')];}if(_0x97b200[_0x8960('0xa6')][_0x8960('0xa1')]&&_0x97b200[_0x8960('0xa6')][_0x8960('0xa1')][_0x8960('0xa2')][_0x8960('0x4b')]){return _0x97b200[_0x8960('0xa6')]['List'][_0x8960('0xa2')][0x0];}var _0x2ff8f2=_[_0x8960('0x19')](_0xc4b590[_0x8960('0x60')],{'firstName':_0xc4b590[_0x8960('0x60')][_0x8960('0xab')],'ListId':_0x23b932['ListId']});_0x2ff8f2[_0xc4b590[_0x8960('0x60')][_0x8960('0x9d')]]=_0xc4b590[_0x8960('0x60')]['from'];return db[_0x8960('0x93')]['create'](_0x2ff8f2,{'fields':_0x4aa17e,'raw':!![]});}})[_0x8960('0x37')](handleEntityNotFound(_0x30890e,null))[_0x8960('0x37')](function(_0x5e8c3f){_0x97b200[_0x8960('0xac')]=_0x5e8c3f;var _0x3d5fd6=_0xc4b590[_0x8960('0x60')][_0x8960('0xad')];if(_0xc4b590[_0x8960('0x90')]['cf-connecting-ip']){_0x3d5fd6=_0xc4b590[_0x8960('0x90')][_0x8960('0xae')];}else if(_0xc4b590[_0x8960('0x90')][_0x8960('0xaf')]){_0x3d5fd6=_[_0x8960('0xb0')](_0xc4b590[_0x8960('0x90')][_0x8960('0xaf')][_0x8960('0xb1')](','));}if(_0x5e8c3f){var _0x33815f={'ContactId':_0x5e8c3f['id'],'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'from':(_0x5e8c3f[_0x8960('0xb2')]||'')+'\x20'+(_0x5e8c3f[_0x8960('0xb3')]||''),'customerIp':_0x3d5fd6,'customerPort':_0xc4b590[_0x8960('0x90')][_0x8960('0xb4')]?_0xc4b590[_0x8960('0x90')][_0x8960('0xb4')]:null,'referer':_0xc4b590[_0x8960('0x60')]['referer'],'browserName':_0x19f0ca[_0x8960('0xb5')]['name']&&_0x19f0ca['browser'][_0x8960('0xb6')]?util[_0x8960('0xb7')](_0x8960('0xb8'),_0x19f0ca[_0x8960('0xb5')][_0x8960('0x3c')],_0x19f0ca[_0x8960('0xb5')][_0x8960('0xb6')]):'unknown','browserVersion':_0x19f0ca['browser'][_0x8960('0xb6')]||'unknown','osName':util[_0x8960('0xb7')](_0x8960('0xb8'),_0x19f0ca['os'][_0x8960('0x3c')],_0x19f0ca['os'][_0x8960('0xb6')]),'osVersion':_0x19f0ca['os'][_0x8960('0xb6')],'deviceModel':_0x19f0ca[_0x8960('0xb9')][_0x8960('0x44')]&&_0x19f0ca[_0x8960('0xb9')]['vendor']?util[_0x8960('0xb7')](_0x8960('0xba'),_0x19f0ca['device'][_0x8960('0x44')],_0x19f0ca[_0x8960('0xb9')][_0x8960('0xbb')],_0x19f0ca[_0x8960('0xb9')][_0x8960('0x42')]):null,'deviceVendor':_0x19f0ca[_0x8960('0xb9')][_0x8960('0xbb')],'deviceType':_0x19f0ca['device']['type'],'formData':JSON[_0x8960('0x23')](_0xc4b590[_0x8960('0x60')])};var _0x169bb0={'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'closed':![]};if(_0xc4b590[_0x8960('0x60')]['threadId']){_0x169bb0[_0x8960('0xbc')]=_0xc4b590['body'][_0x8960('0xbc')];return db[_0x8960('0xbd')][_0x8960('0x5d')]({'where':_0x169bb0})[_0x8960('0x37')](function(_0x2f1b9d){if(_0x2f1b9d){return[_0x2f1b9d,![]];}_0x33815f[_0x8960('0xbc')]=_0xc4b590[_0x8960('0x60')][_0x8960('0xbc')];_0x33815f['externalUrl']=_0xc4b590[_0x8960('0x60')][_0x8960('0xbe')];return db[_0x8960('0xbd')]['create'](_0x33815f)[_0x8960('0x37')](function(_0x55e2f7){return[_0x55e2f7,!![]];});});}_0x169bb0[_0x8960('0xbf')]=_0x5e8c3f['id'];if(_0xc4b590['body'][_0x8960('0xc0')]&&_0xc4b590['body'][_0x8960('0xc0')]['id']){_0x169bb0['id']=_0xc4b590[_0x8960('0x60')][_0x8960('0xc0')]['id'];return db[_0x8960('0xbd')][_0x8960('0x5d')]({'where':_0x169bb0})['then'](function(_0x22d39e){if(_0x22d39e){return[_0x22d39e,![]];}return db[_0x8960('0xbd')][_0x8960('0x5f')](_0x33815f)[_0x8960('0x37')](function(_0x42c1a1){return[_0x42c1a1,!![]];});});}return db['ChatInteraction']['create'](_0x33815f)[_0x8960('0x37')](function(_0x28fc4c){return[_0x28fc4c,!![]];});}})[_0x8960('0xc1')](function(_0x407172,_0x54eeb6){if(_0x407172){_0x46fd5d=_0x54eeb6;if(!_0x54eeb6){var _0x4a5ed0={'from':(_0x97b200[_0x8960('0xac')][_0x8960('0xb2')]||'')+'\x20'+(_0x97b200[_0x8960('0xac')][_0x8960('0xb3')]||'')};if(_0xc4b590[_0x8960('0x60')]['threadId']&&_0xc4b590['body'][_0x8960('0xc2')]&&_0xc4b590[_0x8960('0x60')][_0x8960('0xbc')]!=_0xc4b590[_0x8960('0x60')]['messageId']){_0x4a5ed0[_0x8960('0xbc')]=_0xc4b590['body']['messageId'];}return _0x407172[_0x8960('0x36')](_0x4a5ed0);}else{return _0x407172;}}})['then'](function(_0x249ac1){_0x97b200[_0x8960('0xc0')]=_0x249ac1[_0x8960('0x38')]({'plain':!![]});_0x97b200[_0x8960('0xc0')][_0x8960('0xc3')]=_0x46fd5d;if(_0x97b200['interaction'][_0x8960('0xc3')]){if(_0x97b200[_0x8960('0xa6')]['autoclose']){_0x97b200['applications'][_0x8960('0xc4')]({'id':0x0,'priority':_0x97b200[_0x8960('0xa7')]['length']+0x1,'app':_0x8960('0xc5'),'appdata':_0x8960('0xc6'),'interval':'*,*,*,*'});}}return db[_0x8960('0xc7')][_0x8960('0x5f')]({'body':_0xc4b590[_0x8960('0x60')][_0x8960('0x60')],'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'ChatInteractionId':_0x249ac1['id'],'direction':'in','ContactId':_0x97b200[_0x8960('0xac')]['id'],'AttachmentId':_0xc4b590[_0x8960('0x60')][_0x8960('0xc8')]});})[_0x8960('0x37')](function(_0xa7ddb0){_0x97b200['message']=_0xa7ddb0;if(_0x97b200[_0x8960('0xc0')][_0x8960('0xc9')]){return db[_0x8960('0xca')]['find']({'attributes':['id',_0x8960('0x3c')],'where':{'id':_0x97b200[_0x8960('0xc0')][_0x8960('0xc9')]}})[_0x8960('0x37')](function(_0x33bce6){if(_0x33bce6){_0x97b200[_0x8960('0xa7')][_0x8960('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x33bce6['name']+','+(_0x97b200[_0x8960('0xa6')]['waitForTheAssignedAgent']||0xa),'interval':_0x8960('0xcc')});_0x97b200[_0x8960('0xcd')]=!![];}return respondWithRpcPromise(_0x8960('0xce'),'startRouting',_0x97b200);});}return respondWithRpcPromise(_0x8960('0xce'),'startRouting',_0x97b200);})[_0x8960('0x37')](function(_0x4b915e){respondWithRpcPromise('EventManager',_0x8960('0xcf'),{'event':_0x8960('0x8d'),'message':_0x4b915e},client9002);return _0x4b915e;})[_0x8960('0x37')](respondWithResult(_0x30890e,null))['catch'](handleError(_0x30890e,null));};exports['offline']=function(_0x4e2144,_0x2ea795,_0x562607){var _0xac389a,_0x9b0341,_0x268e32;var _0x2f7270=[];var _0x571b87=[];var _0x14517e={};var _0x47bfe2=_0x4e2144[_0x8960('0xd0')]||[];var _0x2a9287=[];var _0x5f16c4;return db[_0x8960('0x93')][_0x8960('0x69')]()[_0x8960('0x37')](function(_0x51f3e7){if(!_0x51f3e7){throw new db[(_0x8960('0x94'))]['ValidationError'](_0x8960('0x96'));}_0x571b87=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x51f3e7),[_0x8960('0x99'),_0x8960('0x97')]);_0x2f7270=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x51f3e7),['createdAt',_0x8960('0x97'),_0x8960('0x9a'),_0x8960('0x9b')]);if(_0x4e2144['body']['id']){delete _0x4e2144[_0x8960('0x60')]['id'];}if(_[_0x8960('0x82')](_0x4e2144[_0x8960('0x60')]['from'])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0xd1')));}if(_['isNil'](_0x4e2144[_0x8960('0x60')][_0x8960('0x60')])||_0x4e2144['body'][_0x8960('0x60')]===''){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9c')));}if(_['isNil'](_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db['Sequelize'][(_0x8960('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f7270));}if(!_[_0x8960('0xd3')](_0x2f7270,_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)['send'](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0xd4')+_0x2f7270));}_0x14517e[_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')]]=_0x4e2144[_0x8960('0x60')][_0x8960('0xab')];})[_0x8960('0x37')](function(){return db[_0x8960('0x55')]['find']({'where':{'id':_0x4e2144[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0xa0')],'as':_0x8960('0xa1')},{'model':db[_0x8960('0xd5')],'as':_0x8960('0xd5')}]});})[_0x8960('0x37')](handleEntityNotFound(_0x2ea795,null))['then'](function(_0x2024f5){if(_0x2024f5&&_0x2024f5['List']){_0x9b0341=_0x2024f5;var _0x4436ee=_[_0x8960('0x19')](_0x4e2144['body'],{'firstName':_0x4e2144['body']['from'],'phone':_0x4e2144[_0x8960('0x60')][_0x8960('0xab')],'ListId':_0x2024f5[_0x8960('0x9b')]});_0x4436ee[_0x4e2144[_0x8960('0x60')]['mapKeyOffline']]=_0x4e2144[_0x8960('0x60')][_0x8960('0xab')];return db[_0x8960('0x93')]['findOrCreate']({'where':_0x14517e,'defaults':_0x4436ee});}})['spread'](function(_0x46197b){if(_0x46197b){_0x268e32=_0x46197b;var _0x1457c7=fs[_0x8960('0xd6')](path[_0x8960('0x7d')](config['root'],_0x8960('0xd7')),'utf8');var _0x26d940=ejs[_0x8960('0xd8')](_0x1457c7,{'body':_[_0x8960('0xd9')](_0x4e2144[_0x8960('0x60')]['body']),'bodyTitle':_0x9b0341['offlineMessageBody']});return db['ChatOfflineMessage'][_0x8960('0x5f')]({'body':_0x26d940,'ContactId':_0x46197b['id'],'ChatWebsiteId':_0x9b0341['id']});}})[_0x8960('0x37')](function(_0x31f849){_0x5f16c4=_0x31f849;if(_0x47bfe2[_0x8960('0x4b')]){var _0x570977=_0x47bfe2['map'](function(_0x448f29){return{'name':_0x448f29[_0x8960('0xda')],'basename':_0x448f29['filename'],'type':_0x448f29[_0x8960('0xdb')],'ChatOfflineMessageId':_0x31f849['id']};});_0x2a9287=_0x570977[_0x8960('0x41')](_0x5d56b8=>{var _0xbff41f={'filename':_0x5d56b8[_0x8960('0x3c')],'path':path[_0x8960('0x7d')](config['root'],_0x8960('0xdc'),_0x8960('0xd0'),_0x8960('0xdd'),_0x8960('0xde'),_0x5d56b8['basename'])};return _0xbff41f;});if(!_0x9b0341[_0x8960('0xdf')]){return db[_0x8960('0xe0')][_0x8960('0xe1')](function(_0x4d3c5b){return db[_0x8960('0xe2')]['bulkCreate'](_0x570977,{'transaction':_0x4d3c5b});});}}})[_0x8960('0x37')](function(){if(_0x5f16c4){_0xac389a=_0x5f16c4;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x8960('0xe3')],'as':_0x8960('0xe4'),'raw':!![]}]});}})[_0x8960('0x37')](function(_0x46e1fb){if(_0x46e1fb&&_0x46e1fb[_0x8960('0xe4')]&&_0x9b0341[_0x8960('0xe5')]&&_0x9b0341[_0x8960('0xe6')]){var _0x1be2b1={'tls':{'rejectUnauthorized':![]}};if(_0x46e1fb[_0x8960('0xe4')][_0x8960('0xe7')]){_0x1be2b1[_0x8960('0xe7')]=_0x46e1fb['Smtp'][_0x8960('0xe7')];}else{_0x1be2b1[_0x8960('0xe8')]=_0x46e1fb[_0x8960('0xe4')]['host'];_0x1be2b1['port']=_0x46e1fb[_0x8960('0xe4')][_0x8960('0xe9')];_0x1be2b1[_0x8960('0xea')]=_0x46e1fb['Smtp'][_0x8960('0xea')];}if(_0x46e1fb['Smtp'][_0x8960('0xeb')]){_0x1be2b1[_0x8960('0xec')]={'user':_0x46e1fb[_0x8960('0xe4')][_0x8960('0x61')],'pass':_0x46e1fb[_0x8960('0xe4')][_0x8960('0xed')]};}return respondWithRpcPromise(_0x8960('0xee'),_0x8960('0xef'),{'account':_0x1be2b1,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x46e1fb[_0x8960('0x3c')],_0x46e1fb[_0x8960('0xf0')]||_0x46e1fb[_0x8960('0xe4')][_0x8960('0x61')]),'to':_0x9b0341['forwardOfflineAddress'],'subject':_0x9b0341['offlineMessageSubject'],'html':_0xac389a['body'],'attachments':_0x2a9287}},client9003)[_0x8960('0x37')](function(){return _0xac389a;})[_0x8960('0x5e')](function(_0x375400){console[_0x8960('0x24')](_0x375400);});}})[_0x8960('0x37')](function(){if(_0x9b0341&&_0x9b0341[_0x8960('0xdf')]&&_0x9b0341[_0x8960('0xf1')]){var _0x4aabc6=[];if(_0x47bfe2['length']){_0x4aabc6=_0x47bfe2['map'](function(_0x113f53){return{'name':_0x113f53[_0x8960('0xda')],'basename':_0x113f53[_0x8960('0x77')],'type':_0x113f53['mimetype'],'ChatOfflineMessageId':_0x5f16c4['id']};});}var _0x572fdf;if(!_[_0x8960('0x82')](_0x9b0341[_0x8960('0xf2')])){var _0x43e748=_[_0x8960('0x41')](_0x4e2144[_0x8960('0x60')],function(_0x249f39){return _0x249f39;});var _0x1b1bc1=_[_0x8960('0xf3')](_0x43e748)[0x0];var _0x34455a=_['mapValues'](_0x1b1bc1,function(_0x5b2028){return _0x5b2028;});_0x572fdf=_0x34455a[0x1][_0x9b0341[_0x8960('0xf2')]];}var _0x4d1a9c={'from':_0x268e32[_0x8960('0xf0')],'firstName':_0x268e32[_0x8960('0xb2')],'lastName':_0x268e32['lastName'],'mapKey':_0x8960('0xf0'),'message':{'from':_0x268e32[_0x8960('0xf0')],'to':_0x9b0341[_0x8960('0xd5')]['email'],'cc':'','subject':_['isNil'](_0x572fdf)?_0x9b0341['offlineMessageSubject']:_0x572fdf,'messageId':'','sentAt':new Date(),'attach':_0x4aabc6[_0x8960('0x4b')],'attachments':_0x4aabc6,'originChannel':'Chat','ChatWebsiteId':_0x9b0341['id'],'ChatOfflineMessageId':_0xac389a['id'],'originTo':_0x9b0341[_0x8960('0xd5')][_0x8960('0xf0')]},'body':_0xac389a[_0x8960('0x60')]};var _0x2eb74b={'account':{'id':_0x9b0341[_0x8960('0xf1')]},'body':_0x4d1a9c,'log':_0x8960('0xf4')};return respondWithRpcPromise('NotifyMailAccount',_0x8960('0xf5'),_0x2eb74b,client9001)[_0x8960('0x37')](function(){return _0xac389a;})[_0x8960('0x5e')](function(_0x4d6452){console[_0x8960('0x24')](_0x4d6452);});}return;})['then'](function(){if(_0xac389a){return _0xac389a;}})[_0x8960('0x37')](respondWithResult(_0x2ea795,null))['catch'](function(_0x39df5c){console[_0x8960('0x24')](_0x8960('0x5e'),_0x39df5c);for(var _0x1707a3 of _0x47bfe2){var _0x3f56b3=path[_0x8960('0x7d')](config['root'],_0x8960('0xdc'),_0x8960('0xd0'),_0x8960('0xdd'),_0x8960('0xde'),_0x1707a3[_0x8960('0x77')]);fs_extra[_0x8960('0xf6')](_0x3f56b3)[_0x8960('0x5e')](function(_0x10eaa8){console['error'](_0x8960('0xf7'),_0x3f56b3,_0x10eaa8);});}});};exports['addInteraction']=function(_0x57919a,_0x4f0cdb,_0x576576){return db['ChatInteraction']['find']({'where':{'id':_0x57919a[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4f0cdb,null))[_0x8960('0x37')](function(_0x2594bb){if(_0x2594bb){return _0x2594bb[_0x8960('0xf8')](_0x57919a['body'][_0x8960('0x70')],_[_0x8960('0xf9')](_0x57919a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4f0cdb,null))[_0x8960('0x5e')](handleError(_0x4f0cdb,null));};exports[_0x8960('0xfa')]=function(_0x3fa94f,_0x118a8c,_0xc84562){var _0x58afb2={'raw':![],'where':{}};var _0x3c60db={};var _0x489b11={'count':0x0,'rows':[]};return db[_0x8960('0x55')][_0x8960('0x73')]({'where':{'id':_0x3fa94f[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x118a8c,null))['then'](function(_0x430a46){if(_0x430a46){_0x3c60db['model']=_[_0x8960('0x46')](db[_0x8960('0xbd')]['rawAttributes']);_0x3c60db['query']=_[_0x8960('0x46')](_0x3fa94f[_0x8960('0x45')]);_0x3c60db[_0x8960('0x47')]=_['intersection'](_0x3c60db[_0x8960('0x44')],_0x3c60db[_0x8960('0x45')]);_0x58afb2[_0x8960('0x49')]=_['intersection'](_0x3c60db['model'],qs['fields'](_0x3fa94f[_0x8960('0x45')][_0x8960('0x4a')]));_0x58afb2['attributes']=_0x58afb2[_0x8960('0x49')][_0x8960('0x4b')]?_0x58afb2[_0x8960('0x49')]:_0x3c60db[_0x8960('0x44')];if(!_0x3fa94f[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x58afb2[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x3fa94f[_0x8960('0x45')][_0x8960('0x2f')]);_0x58afb2[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x3fa94f[_0x8960('0x45')]['offset']);}_0x58afb2['order']=qs[_0x8960('0x4f')](_0x3fa94f[_0x8960('0x45')][_0x8960('0x4f')]);_0x58afb2['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x3fa94f[_0x8960('0x45')],_0x3c60db[_0x8960('0x47')]));_0x58afb2[_0x8960('0x52')][_0x8960('0x6d')]=_0x430a46['id'];if(_0x3fa94f[_0x8960('0x45')]['filter']){_0x58afb2[_0x8960('0x52')]=_[_0x8960('0x51')](_0x58afb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x58afb2[_0x8960('0x49')],function(_0x2a30db){var _0x4ad287={};_0x4ad287[_0x2a30db]={'$like':'%'+_0x3fa94f[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x4ad287;})});}_0x58afb2=_['merge']({},_0x58afb2,_0x3fa94f[_0x8960('0x54')]);return db[_0x8960('0xbd')][_0x8960('0x30')]({'where':_0x58afb2['where']})[_0x8960('0x37')](function(_0x420ad8){_0x489b11[_0x8960('0x30')]=_0x420ad8;if(_0x3fa94f[_0x8960('0x45')][_0x8960('0x56')]){_0x58afb2[_0x8960('0x57')]=[{'model':db[_0x8960('0x93')],'as':_0x8960('0xfb'),'required':![]},{'model':db[_0x8960('0xca')],'as':_0x8960('0xfc'),'attributes':[_0x8960('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x8960('0xfd')],'as':'Tags','attributes':['id',_0x8960('0x3c'),_0x8960('0xfe')],'where':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]?{'id':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]}:undefined,'required':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x8960('0x58')](_0x58afb2);})['then'](function(_0x6fd4f9){_0x489b11[_0x8960('0x59')]=_0x6fd4f9;return _0x489b11;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x118a8c,_0x58afb2))[_0x8960('0x5e')](handleError(_0x118a8c,null));};function iftimePromise(_0x42a6b8,_0x25725b){return respondWithRpcPromise(_0x8960('0x100'),_0x8960('0x101'),{'command':_0x25725b['timezone']?util['format'](_0x8960('0x102'),_0x42a6b8['interval'],_0x25725b['timezone']):util[_0x8960('0xb7')]('iftime\x20%s',_0x42a6b8['interval'])},client9002)[_0x8960('0x37')](function(_0x1a7868){var _0x14aefd=_0x1a7868&&_0x1a7868['indexOf'](_0x8960('0x103'))>=0x0?!![]:![];logger[_0x8960('0x21')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25725b['id'],_0x42a6b8['id'],_0x42a6b8[_0x8960('0x104')],_0x14aefd?_0x8960('0x105'):_0x8960('0x106'),_0x25725b[_0x8960('0x107')]?_0x25725b['timezone']:_0x8960('0x108'));return _0x14aefd;})[_0x8960('0x5e')](function(_0x892987){logger[_0x8960('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25725b['id'],_0x42a6b8['id'],_0x42a6b8[_0x8960('0x104')],util['inspect'](_0x892987,{'showHidden':![],'depth':null}),_0x25725b[_0x8960('0x107')]?_0x25725b['timezone']:_0x8960('0x108'));return![];});}exports[_0x8960('0x101')]=function(_0x326a5e,_0x946924,_0x295a5f){var _0x39de0f=0x0;var _0x54c0b0=0x0;var _0x144605=![];var _0x392d2d;var _0x4aa39b;return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x326a5e[_0x8960('0x5b')]['id']},'include':[{'model':db['Interval'],'as':_0x8960('0x109'),'include':[{'model':db['Interval'],'as':_0x8960('0x10a'),'attributes':['id',_0x8960('0x104')],'raw':!![]}]}]})[_0x8960('0x37')](handleEntityNotFound(_0x946924,null))[_0x8960('0x37')](function(_0x595ff8){if(_0x595ff8){_0x392d2d=_0x595ff8;return _0x595ff8[_0x8960('0x10b')]({'raw':!![]});}})[_0x8960('0x37')](function(_0x380196){if(_0x392d2d){if(_0x380196){_0x4aa39b=_0x380196;}}return require(_0x8960('0x17'))['getLicense']();})[_0x8960('0x37')](function(_0x2af66f){if(_0x2af66f){_0x54c0b0=_0x2af66f['virtual'];_0x144605=_0x2af66f['custom'];}})[_0x8960('0x37')](function(){return db[_0x8960('0xbd')][_0x8960('0x30')]({'where':{'closed':![]}});})[_0x8960('0x37')](function(_0x5d98dc){_0x39de0f=_0x5d98dc;if(_0x54c0b0&&_0x5d98dc>_0x54c0b0){return db[_0x8960('0x10c')][_0x8960('0x73')]({'where':{'id':0x1}})['then'](function(_0x2b2cd0){if(_0x2b2cd0){_0x2b2cd0[_0x8960('0x10d')]('chatLicenseExceeded');}});}})[_0x8960('0x37')](function(){if(_0x392d2d[_0x8960('0x109')]&&_0x392d2d['Interval']['Intervals']){var _0x33ea4e=[];for(var _0x594580=0x0;_0x594580<_0x392d2d[_0x8960('0x109')][_0x8960('0x10a')][_0x8960('0x4b')];_0x594580++){var _0xf8cae4=_0x392d2d['Interval'][_0x8960('0x10a')][_0x594580][_0x8960('0x38')]({'plain':!![]});_0x33ea4e[_0x8960('0xc4')](iftimePromise(_0xf8cae4,_0x392d2d));}return BPromise[_0x8960('0x10e')](_0x33ea4e)[_0x8960('0x37')](function(_0x32c4a3){return _[_0x8960('0x10f')](_0x32c4a3);});}else{return!![];}})['then'](function(_0x482e25){var _0x5386ef=fs['readFileSync'](path['join'](config[_0x8960('0x7e')],_0x8960('0x110')),'utf8');var _0x1f69b7={'remote':_0x392d2d[_0x8960('0x111')],'query':querystring[_0x8960('0x23')](_[_0x8960('0x51')](_0x392d2d['get']({'plain':!![]}),{'customerIp':_0x326a5e[_0x8960('0x90')][_0x8960('0xaf')]||_0x326a5e[_0x8960('0x90')][_0x8960('0x112')]||_0x326a5e[_0x8960('0x113')][_0x8960('0x114')]||_0x326a5e['ip'],'referer':_0x326a5e[_0x8960('0x90')][_0x8960('0x115')],'openedInteractions':_0x39de0f,'maxInteractions':_0x54c0b0,'virtual':_0x144605[_0x8960('0x116')],'online':_0x482e25,'custom':_0x144605}))[_0x8960('0x117')](/'/g,'\x5c\x27')};_0x946924[_0x8960('0x3d')](ejs[_0x8960('0xd8')](Mustache[_0x8960('0xd8')](_0x5386ef,_0x1f69b7),{'proactiveActions':_0x4aa39b,'alignment':_0x392d2d['alignment'],'verticalAlignment':_0x392d2d[_0x8960('0x118')],'div_color':_0x392d2d['color'],'text_color':_0x392d2d['textColor'],'button_color':_0x392d2d[_0x8960('0x119')],'background_color':_0x392d2d['backgroundColor']}));})['catch'](handleError(_0x946924,null));};exports[_0x8960('0x11a')]=function(_0x5a77c4,_0x311984,_0xfc4f90){return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x5a77c4[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x311984,null))['then'](function(_0x3182f8){if(_0x3182f8){return db[_0x8960('0xe0')][_0x8960('0xe1')](function(_0x1b330b){return db[_0x8960('0xa4')][_0x8960('0x3a')]({'where':{'ChatWebsiteId':_0x5a77c4[_0x8960('0x5b')]['id']},'transaction':_0x1b330b})[_0x8960('0x37')](function(_0x2f8272){var _0x411034=_[_0x8960('0x41')](_0x5a77c4['body'],function(_0x11187b){_0x11187b['ChatWebsiteId']=_0x5a77c4[_0x8960('0x5b')]['id'];return _0x11187b;});return db[_0x8960('0xa4')][_0x8960('0x11b')](_0x411034,{'transaction':_0x1b330b});});})[_0x8960('0x37')](function(){return db[_0x8960('0xa4')][_0x8960('0x11c')]({'where':{'ChatWebsiteId':_0x5a77c4[_0x8960('0x5b')]['id']},'order':'priority'});});}})[_0x8960('0x37')](respondWithResult(_0x311984,null))[_0x8960('0x5e')](handleError(_0x311984,null));};exports[_0x8960('0x11d')]=function(_0x3e7b98,_0xe9b87f,_0xab4c5){var _0x330cb2={};var _0x35a99c={};var _0x3c643b;var _0x473908;return db[_0x8960('0x55')][_0x8960('0x73')]({'where':{'id':_0x3e7b98[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe9b87f,null))[_0x8960('0x37')](function(_0x2ce0ad){if(_0x2ce0ad){_0x3c643b=_0x2ce0ad;_0x35a99c[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0xa4')]['rawAttributes']);_0x35a99c[_0x8960('0x45')]=_['keys'](_0x3e7b98[_0x8960('0x45')]);_0x35a99c[_0x8960('0x47')]=_[_0x8960('0x48')](_0x35a99c[_0x8960('0x44')],_0x35a99c['query']);_0x330cb2[_0x8960('0x49')]=_[_0x8960('0x48')](_0x35a99c['model'],qs[_0x8960('0x4a')](_0x3e7b98[_0x8960('0x45')][_0x8960('0x4a')]));_0x330cb2[_0x8960('0x49')]=_0x330cb2['attributes']['length']?_0x330cb2[_0x8960('0x49')]:_0x35a99c[_0x8960('0x44')];_0x330cb2['order']=qs[_0x8960('0x4f')](_0x3e7b98[_0x8960('0x45')][_0x8960('0x4f')]);_0x330cb2['where']=qs['filters'](_[_0x8960('0x50')](_0x3e7b98[_0x8960('0x45')],_0x35a99c[_0x8960('0x47')]));if(_0x3e7b98[_0x8960('0x45')][_0x8960('0x6e')]){_0x330cb2[_0x8960('0x52')]=_[_0x8960('0x51')](_0x330cb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x330cb2[_0x8960('0x49')],function(_0x481fb2){var _0x33d467={};_0x33d467[_0x481fb2]={'$like':'%'+_0x3e7b98[_0x8960('0x45')]['filter']+'%'};return _0x33d467;})});}_0x330cb2=_[_0x8960('0x51')]({},_0x330cb2,_0x3e7b98['options']);return _0x3c643b[_0x8960('0x11d')](_0x330cb2);}})[_0x8960('0x37')](function(_0x4fa9fb){if(_0x4fa9fb){_0x473908=_0x4fa9fb[_0x8960('0x4b')];if(!_0x3e7b98[_0x8960('0x45')][_0x8960('0x4c')]('nolimit')){_0x330cb2['limit']=qs['limit'](_0x3e7b98[_0x8960('0x45')][_0x8960('0x2f')]);_0x330cb2[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x3e7b98[_0x8960('0x45')]['offset']);}return _0x3c643b[_0x8960('0x11d')](_0x330cb2);}})['then'](function(_0x3accee){if(_0x3accee){return _0x3accee?{'count':_0x473908,'rows':_0x3accee}:null;}})[_0x8960('0x37')](respondWithResult(_0xe9b87f,null))[_0x8960('0x5e')](handleError(_0xe9b87f,null));};exports['addProactiveActions']=function(_0xfca6c3,_0x57c759,_0x248db1){return db['chatProactiveAction'][_0x8960('0x5d')]({'where':{'id':_0xfca6c3[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x57c759,null))[_0x8960('0x37')](function(_0xe133d6){if(_0xe133d6){return _0xe133d6[_0x8960('0x11e')](_0xfca6c3[_0x8960('0x60')][_0x8960('0x70')],_[_0x8960('0xf9')](_0xfca6c3[_0x8960('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x57c759,null))[_0x8960('0x5e')](handleError(_0x57c759,null));};exports[_0x8960('0x10b')]=function(_0x514114,_0x551b19,_0x3be707){var _0x2bfbb2={};var _0x37b027={};var _0x2633d3;var _0x413c0b;return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x514114['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x551b19,null))['then'](function(_0x44a7de){if(_0x44a7de){_0x2633d3=_0x44a7de;_0x37b027[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x11f')][_0x8960('0x5c')]);_0x37b027[_0x8960('0x45')]=_['keys'](_0x514114[_0x8960('0x45')]);_0x37b027[_0x8960('0x47')]=_['intersection'](_0x37b027[_0x8960('0x44')],_0x37b027[_0x8960('0x45')]);_0x2bfbb2['attributes']=_[_0x8960('0x48')](_0x37b027[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x514114['query'][_0x8960('0x4a')]));_0x2bfbb2[_0x8960('0x49')]=_0x2bfbb2[_0x8960('0x49')][_0x8960('0x4b')]?_0x2bfbb2['attributes']:_0x37b027[_0x8960('0x44')];_0x2bfbb2[_0x8960('0x4e')]=qs['sort'](_0x514114['query']['sort']);_0x2bfbb2[_0x8960('0x52')]=qs['filters'](_[_0x8960('0x50')](_0x514114[_0x8960('0x45')],_0x37b027['filters']));if(_0x514114[_0x8960('0x45')][_0x8960('0x6e')]){_0x2bfbb2[_0x8960('0x52')]=_['merge'](_0x2bfbb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x2bfbb2[_0x8960('0x49')],function(_0x577fc7){var _0x55666f={};_0x55666f[_0x577fc7]={'$like':'%'+_0x514114[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x55666f;})});}_0x2bfbb2=_[_0x8960('0x51')]({},_0x2bfbb2,_0x514114[_0x8960('0x54')]);return _0x2633d3[_0x8960('0x10b')](_0x2bfbb2);}})[_0x8960('0x37')](function(_0x4e9acc){if(_0x4e9acc){_0x413c0b=_0x4e9acc['length'];if(!_0x514114[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x2bfbb2[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x514114[_0x8960('0x45')][_0x8960('0x2f')]);_0x2bfbb2[_0x8960('0x31')]=qs['offset'](_0x514114[_0x8960('0x45')][_0x8960('0x31')]);}return _0x2633d3[_0x8960('0x10b')](_0x2bfbb2);}})[_0x8960('0x37')](function(_0x5b9215){if(_0x5b9215){return _0x5b9215?{'count':_0x413c0b,'rows':_0x5b9215}:null;}})[_0x8960('0x37')](respondWithResult(_0x551b19,null))[_0x8960('0x5e')](handleError(_0x551b19,null));};exports[_0x8960('0x120')]=function(_0x3fce4e,_0x296c5f,_0x42e4b7){var _0x495fe3=_0x3fce4e[_0x8960('0x45')][_0x8960('0x121')]===_0x8960('0x122')?_0x8960('0x123'):_0x8960('0x124');return db[_0x8960('0x55')][_0x8960('0x5d')]({'attributes':['id',_0x495fe3],'where':{'id':_0x3fce4e['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x296c5f,null))[_0x8960('0x37')](function(_0x43a91f){if(_0x43a91f){var _0x49a5fd=_0x43a91f[_0x495fe3];var _0x1db40c=_0x49a5fd&&_0x49a5fd[_0x8960('0x125')]?_0x49a5fd[_0x8960('0x125')]:[];_0x296c5f[_0x8960('0x3d')]({'fromKey':_[_0x8960('0x82')](_0x49a5fd[_0x8960('0x126')])?undefined:_0x49a5fd[_0x8960('0x126')],'count':_0x1db40c['length'],'rows':_0x1db40c});}})[_0x8960('0x5e')](handleError(_0x296c5f,null));};exports[_0x8960('0x127')]=function(_0x2ca615,_0x35836b,_0xb52098){var _0x4b318c={'raw':![],'where':{}};var _0x650856={};var _0x329807={'count':0x0,'rows':[]};return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x2ca615[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x35836b,null))[_0x8960('0x37')](function(_0x153be0){if(_0x153be0){_0x650856[_0x8960('0x44')]=_['keys'](db[_0x8960('0x128')][_0x8960('0x5c')]);_0x650856[_0x8960('0x45')]=_[_0x8960('0x46')](_0x2ca615[_0x8960('0x45')]);_0x650856['filters']=_[_0x8960('0x48')](_0x650856[_0x8960('0x44')],_0x650856[_0x8960('0x45')]);_0x4b318c[_0x8960('0x49')]=_[_0x8960('0x48')](_0x650856[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x2ca615['query'][_0x8960('0x4a')]));_0x4b318c[_0x8960('0x49')]=_0x4b318c[_0x8960('0x49')][_0x8960('0x4b')]?_0x4b318c[_0x8960('0x49')]:_0x650856['model'];if(!_0x2ca615[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x4b318c['limit']=qs[_0x8960('0x2f')](_0x2ca615[_0x8960('0x45')][_0x8960('0x2f')]);_0x4b318c['offset']=qs[_0x8960('0x31')](_0x2ca615['query'][_0x8960('0x31')]);}_0x4b318c[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x2ca615[_0x8960('0x45')][_0x8960('0x4f')]);_0x4b318c[_0x8960('0x52')]=qs[_0x8960('0x47')](_['pick'](_0x2ca615[_0x8960('0x45')],_0x650856[_0x8960('0x47')]));_0x4b318c['where'][_0x8960('0x6d')]=_0x153be0['id'];if(_0x2ca615[_0x8960('0x45')][_0x8960('0x6e')]){_0x4b318c[_0x8960('0x52')]=_[_0x8960('0x51')](_0x4b318c[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x4b318c[_0x8960('0x49')],function(_0x138a34){var _0x303f0={};_0x303f0[_0x138a34]={'$like':'%'+_0x2ca615[_0x8960('0x45')]['filter']+'%'};return _0x303f0;})});}_0x4b318c=_[_0x8960('0x51')]({},_0x4b318c,_0x2ca615['options']);return db[_0x8960('0x128')][_0x8960('0x30')]({'where':_0x4b318c[_0x8960('0x52')]})[_0x8960('0x37')](function(_0x443a2f){_0x329807[_0x8960('0x30')]=_0x443a2f;if(_0x2ca615[_0x8960('0x45')][_0x8960('0x56')]){_0x4b318c['include']=[{'all':!![]}];}else{_0x4b318c[_0x8960('0x57')]=[{'model':db['CmContact'],'as':_0x8960('0xfb'),'required':![]},{'model':db[_0x8960('0xe2')],'as':'Attachments','required':![]}];}return db[_0x8960('0x128')][_0x8960('0x58')](_0x4b318c);})[_0x8960('0x37')](function(_0x2de94e){_0x329807[_0x8960('0x59')]=_0x2de94e;return _0x329807;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x35836b,_0x4b318c))[_0x8960('0x5e')](handleError(_0x35836b,null));};exports['addAgents']=function(_0x10a6fb,_0x48f48f,_0x2a3e90){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x10a6fb[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x48f48f,null))['then'](function(_0x34c5c7){if(_0x34c5c7){return _0x34c5c7[_0x8960('0x129')](_0x10a6fb['body'][_0x8960('0x70')],_[_0x8960('0xf9')](_0x10a6fb[_0x8960('0x60')],[_0x8960('0x70'),'id'])||{})['spread'](function(_0x2a0d88){for(var _0x1c6ed1=0x0;_0x1c6ed1<_0x10a6fb[_0x8960('0x60')]['ids'][_0x8960('0x4b')];_0x1c6ed1+=0x1){socket[_0x8960('0x12a')](_0x8960('0x12b'),{'UserId':Number(_0x10a6fb[_0x8960('0x60')][_0x8960('0x70')][_0x1c6ed1]),'ChatWebsiteId':Number(_0x10a6fb[_0x8960('0x5b')]['id'])});}return _0x2a0d88;});}})['then'](respondWithResult(_0x48f48f,null))[_0x8960('0x5e')](handleError(_0x48f48f,null));};exports[_0x8960('0x12c')]=function(_0x5eaaae,_0x5c9463,_0x1c9c5c){return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x5eaaae[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5c9463,null))[_0x8960('0x37')](function(_0x544d5d){if(_0x544d5d){return _0x544d5d[_0x8960('0x12c')](_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')])[_0x8960('0x37')](function(){if(_[_0x8960('0x12d')](_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')])){for(var _0x11f390=0x0;_0x11f390<_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')][_0x8960('0x4b')];_0x11f390+=0x1){socket[_0x8960('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')][_0x11f390]),'ChatWebsiteId':Number(_0x5eaaae['params']['id'])});}}else{socket[_0x8960('0x12a')](_0x8960('0x12e'),{'UserId':Number(_0x5eaaae['query'][_0x8960('0x70')]),'ChatWebsiteId':Number(_0x5eaaae[_0x8960('0x5b')]['id'])});}});}})[_0x8960('0x37')](respondWithStatusCode(_0x5c9463,null))[_0x8960('0x5e')](handleError(_0x5c9463,null));};exports[_0x8960('0x12f')]=function(_0x2bb0cb,_0x42ddf1,_0x1033cd){var _0x1542f8={};var _0x54c104={};var _0x4da9eb;var _0x3c87e8;return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x2bb0cb[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x42ddf1,null))['then'](function(_0x484611){if(_0x484611){_0x4da9eb=_0x484611;_0x54c104['model']=_['keys'](db['User'][_0x8960('0x5c')]);_0x54c104[_0x8960('0x45')]=_[_0x8960('0x46')](_0x2bb0cb[_0x8960('0x45')]);_0x54c104[_0x8960('0x47')]=_[_0x8960('0x48')](_0x54c104[_0x8960('0x44')],_0x54c104[_0x8960('0x45')]);_0x1542f8[_0x8960('0x49')]=_[_0x8960('0x48')](_0x54c104[_0x8960('0x44')],qs['fields'](_0x2bb0cb['query'][_0x8960('0x4a')]));_0x1542f8[_0x8960('0x49')]=_0x1542f8[_0x8960('0x49')][_0x8960('0x4b')]?_0x1542f8[_0x8960('0x49')]:_0x54c104[_0x8960('0x44')];_0x1542f8['order']=qs[_0x8960('0x4f')](_0x2bb0cb[_0x8960('0x45')][_0x8960('0x4f')]);_0x1542f8[_0x8960('0x52')]=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x2bb0cb[_0x8960('0x45')],_0x54c104[_0x8960('0x47')]));if(_0x2bb0cb[_0x8960('0x45')][_0x8960('0x6e')]){_0x1542f8['where']=_[_0x8960('0x51')](_0x1542f8[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x1542f8[_0x8960('0x49')],function(_0x3548a0){var _0x3387d6={};_0x3387d6[_0x3548a0]={'$like':'%'+_0x2bb0cb[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x3387d6;})});}_0x1542f8=_[_0x8960('0x51')]({},_0x1542f8,_0x2bb0cb[_0x8960('0x54')]);return _0x4da9eb[_0x8960('0x12f')](_0x1542f8);}})[_0x8960('0x37')](function(_0x6225ee){if(_0x6225ee){_0x3c87e8=_0x6225ee['length'];if(!_0x2bb0cb[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x1542f8[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x2bb0cb['query'][_0x8960('0x2f')]);_0x1542f8[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x2bb0cb['query'][_0x8960('0x31')]);}return _0x4da9eb['getAgents'](_0x1542f8);}})['then'](function(_0x5b25e2){if(_0x5b25e2){return _0x5b25e2?{'count':_0x3c87e8,'rows':_0x5b25e2}:null;}})[_0x8960('0x37')](respondWithResult(_0x42ddf1,null))[_0x8960('0x5e')](handleError(_0x42ddf1,null));}; \ No newline at end of file +var _0x91bd=['update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','addLogo','sitepic','addAvatar','addCustomerAvatar','customerAvatar','file','filename','addSystemAvatar','getLogo','root','getLicense','isNil','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','interval','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','replace','color_button','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','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','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x44182a,_0xa34b75){var _0x28620e=function(_0x988aa6){while(--_0x988aa6){_0x44182a['push'](_0x44182a['shift']());}};_0x28620e(++_0xa34b75);}(_0x91bd,0xfb));var _0xd91b=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x91bd[_0x5b26cb];return _0x563d12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91b('0x0'));var zipdir=require(_0xd91b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd91b('0x2'));var moment=require('moment');var BPromise=require(_0xd91b('0x3'));var Mustache=require(_0xd91b('0x4'));var util=require(_0xd91b('0x5'));var path=require(_0xd91b('0x6'));var sox=require(_0xd91b('0x7'));var csv=require(_0xd91b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd91b('0x9'));var crypto=require(_0xd91b('0xa'));var jsforce=require(_0xd91b('0xb'));var deskjs=require(_0xd91b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd91b('0xd'));var Papa=require(_0xd91b('0xe'));var Redis=require('ioredis');var authService=require(_0xd91b('0xf'));var qs=require(_0xd91b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd91b('0x11'));var logger=require(_0xd91b('0x12'))(_0xd91b('0x13'));var utils=require(_0xd91b('0x14'));var config=require(_0xd91b('0x15'));var licenseUtil=require(_0xd91b('0x16'));var db=require(_0xd91b('0x17'))['db'];config['redis']=_[_0xd91b('0x18')](config['redis'],{'host':_0xd91b('0x19'),'port':0x18eb});var socket=require(_0xd91b('0x1a'))(new Redis(config[_0xd91b('0x1b')]));require(_0xd91b('0x1c'))[_0xd91b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd91b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd91b('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0xd91b('0x1e')][_0xd91b('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0xd91b('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x2a8fed,_0x910eea,_0x2a9cec,_0x4c6096){return new BPromise(function(_0xd154f7,_0x1272e9){var _0x149a0f=_0x4c6096||client;return _0x149a0f[_0xd91b('0x20')](_0x2a8fed,_0x2a9cec)[_0xd91b('0x21')](function(_0x2429f7){logger[_0xd91b('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x910eea,'request\x20sent');logger[_0xd91b('0x23')](_0xd91b('0x24'),_0x910eea,_0xd91b('0x25'),JSON[_0xd91b('0x26')](_0x2429f7));if(_0x2429f7['error']){if(_0x2429f7['error']['code']===0x1f4){logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0x1272e9(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0xd154f7(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0xd91b('0x25'));_0xd154f7(_0x2429f7[_0xd91b('0x2a')][_0xd91b('0x29')]);}})[_0xd91b('0x2b')](function(_0x41f1ad){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0x41f1ad);_0x1272e9(_0x41f1ad);});});}function respondWithStatusCode(_0x34c536,_0x5c95a3){_0x5c95a3=_0x5c95a3||0xcc;return function(_0x1532bc){if(_0x1532bc){return _0x34c536[_0xd91b('0x2c')](_0x5c95a3);}return _0x34c536[_0xd91b('0x2d')](_0x5c95a3)[_0xd91b('0x2e')]();};}function respondWithResult(_0x2c7d19,_0x4863f5){_0x4863f5=_0x4863f5||0xc8;return function(_0x5a3d60){if(_0x5a3d60){return _0x2c7d19[_0xd91b('0x2d')](_0x4863f5)[_0xd91b('0x2f')](_0x5a3d60);}};}function respondWithFilteredResult(_0x557959,_0x38d649){return function(_0x4852e5){if(_0x4852e5){var _0x16d5bb=typeof _0x38d649['offset']===_0xd91b('0x30')&&typeof _0x38d649[_0xd91b('0x31')]===_0xd91b('0x30');var _0x3f522a=_0x4852e5[_0xd91b('0x32')];var _0x7e958=_0x16d5bb?0x0:_0x38d649[_0xd91b('0x33')];var _0x406acd=_0x16d5bb?_0x4852e5[_0xd91b('0x32')]:_0x38d649['offset']+_0x38d649[_0xd91b('0x31')];var _0xc1f78d;if(_0x406acd>=_0x3f522a){_0x406acd=_0x3f522a;_0xc1f78d=0xc8;}else{_0xc1f78d=0xce;}_0x557959['status'](_0xc1f78d);return _0x557959[_0xd91b('0x34')]('Content-Range',_0x7e958+'-'+_0x406acd+'/'+_0x3f522a)[_0xd91b('0x2f')](_0x4852e5);}return null;};}function patchUpdates(_0x4fefa6){return function(_0x2ede62){try{jsonpatch[_0xd91b('0x35')](_0x2ede62,_0x4fefa6,!![]);}catch(_0x2f5a65){return BPromise[_0xd91b('0x36')](_0x2f5a65);}return _0x2ede62[_0xd91b('0x37')]();};}function saveUpdates(_0x1a1a01,_0x4dcdde){return function(_0x1f16f3){if(_0x1f16f3){return _0x1f16f3[_0xd91b('0x38')](_0x1a1a01)[_0xd91b('0x21')](function(_0x8029b2){return _0x8029b2;});}return null;};}function removeEntity(_0x459ca2,_0x13e83d){return function(_0x12d0d5){if(_0x12d0d5){return _0x12d0d5[_0xd91b('0x39')]()[_0xd91b('0x21')](function(){var _0x419e38=_0x12d0d5[_0xd91b('0x3a')]({'plain':!![]});var _0x596121=_0xd91b('0x3b');return db['UserProfileResource'][_0xd91b('0x39')]({'where':{'type':_0x596121,'resourceId':_0x419e38['id']}})[_0xd91b('0x21')](function(){return _0x12d0d5;});})[_0xd91b('0x21')](function(){_0x459ca2[_0xd91b('0x2d')](0xcc)[_0xd91b('0x2e')]();});}};}function handleEntityNotFound(_0x2d2bcd,_0x45013b){return function(_0x44c3f6){if(!_0x44c3f6){_0x2d2bcd[_0xd91b('0x2c')](0x194);}return _0x44c3f6;};}function handleError(_0x20377d,_0x33d589){_0x33d589=_0x33d589||0x1f4;return function(_0x3acf40){logger[_0xd91b('0x27')](_0x3acf40[_0xd91b('0x3c')]);if(_0x3acf40[_0xd91b('0x3d')]){delete _0x3acf40[_0xd91b('0x3d')];}_0x20377d['status'](_0x33d589)[_0xd91b('0x3e')](_0x3acf40);};}exports[_0xd91b('0x3f')]=function(_0x5afb7c,_0x18032e){var _0x237876={'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x5ac005={},_0x4a64df={'count':0x0,'rows':[]};var _0x16e2ba=_[_0xd91b('0x42')](db[_0xd91b('0x43')][_0xd91b('0x44')],function(_0x189346){return{'name':_0x189346[_0xd91b('0x45')],'type':_0x189346['type']['key']};});_0x5ac005[_0xd91b('0x46')]=_['map'](_0x16e2ba,'name');_0x5ac005['query']=_[_0xd91b('0x47')](_0x5afb7c[_0xd91b('0x48')]);_0x5ac005[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],_0x5ac005['query']);_0x237876[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x5afb7c[_0xd91b('0x48')]['fields']));_0x237876[_0xd91b('0x4b')]=_0x237876['attributes'][_0xd91b('0x4d')]?_0x237876[_0xd91b('0x4b')]:_0x5ac005[_0xd91b('0x46')];if(!_0x5afb7c[_0xd91b('0x48')]['hasOwnProperty']('nolimit')){_0x237876[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x5afb7c[_0xd91b('0x48')]['limit']);_0x237876['offset']=qs[_0xd91b('0x33')](_0x5afb7c[_0xd91b('0x48')]['offset']);}_0x237876['order']=qs[_0xd91b('0x4e')](_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x237876[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x5afb7c['query'],_0x5ac005['filters']),_0x16e2ba);if(_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]){_0x237876[_0xd91b('0x4f')]=_['merge'](_0x237876[_0xd91b('0x4f')],{'$or':_['map'](_0x16e2ba,function(_0x3552a5){if(_0x3552a5[_0xd91b('0x52')]!==_0xd91b('0x53')){var _0x14fbdc={};_0x14fbdc[_0x3552a5[_0xd91b('0x3d')]]={'$like':'%'+_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x14fbdc;}})});}_0x237876=_[_0xd91b('0x54')]({},_0x237876,_0x5afb7c[_0xd91b('0x55')]);var _0x145326={'where':_0x237876['where']};return db['ChatWebsite']['count'](_0x145326)[_0xd91b('0x21')](function(_0x8936d9){_0x4a64df['count']=_0x8936d9;if(_0x5afb7c['query'][_0xd91b('0x56')]){_0x237876[_0xd91b('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd91b('0x58')](_0x237876);})[_0xd91b('0x21')](function(_0x4b041a){_0x4a64df[_0xd91b('0x59')]=_0x4b041a;return _0x4a64df;})[_0xd91b('0x21')](respondWithFilteredResult(_0x18032e,_0x237876))[_0xd91b('0x2b')](handleError(_0x18032e,null));};exports[_0xd91b('0x5a')]=function(_0x22474c,_0x4f6699){var _0x900420={'raw':![],'where':{'id':_0x22474c[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x47c464={};_0x47c464[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['ChatWebsite']['rawAttributes']);_0x47c464[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x22474c[_0xd91b('0x48')]);_0x47c464['filters']=_[_0xd91b('0x4a')](_0x47c464[_0xd91b('0x46')],_0x47c464[_0xd91b('0x48')]);_0x900420[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x47c464['model'],qs[_0xd91b('0x4c')](_0x22474c[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x900420[_0xd91b('0x4b')]=_0x900420[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x900420['attributes']:_0x47c464[_0xd91b('0x46')];if(_0x22474c[_0xd91b('0x48')]['includeAll']){_0x900420['include']=[{'all':!![]}];}_0x900420=_['merge']({},_0x900420,_0x22474c['options']);return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x900420)['then'](handleEntityNotFound(_0x4f6699,null))['then'](respondWithResult(_0x4f6699,null))['catch'](handleError(_0x4f6699,null));};exports[_0xd91b('0x5d')]=function(_0x2514a3,_0x16863b){return db[_0xd91b('0x43')][_0xd91b('0x5d')](_0x2514a3['body'],{})[_0xd91b('0x21')](function(_0x369e16){var _0x3a778f=_0x2514a3[_0xd91b('0x5e')][_0xd91b('0x3a')]({'plain':!![]});if(!_0x3a778f)throw new Error(_0xd91b('0x5f'));if(_0x3a778f[_0xd91b('0x60')]==='user'){var _0x3f27f6=_0x369e16[_0xd91b('0x3a')]({'plain':!![]});var _0x4dcca2=_0xd91b('0x3b');return db[_0xd91b('0x61')][_0xd91b('0x5c')]({'where':{'name':_0x4dcca2,'userProfileId':_0x3a778f['userProfileId']},'raw':!![]})[_0xd91b('0x21')](function(_0x4106ea){if(_0x4106ea&&_0x4106ea['autoAssociation']===0x0){return db[_0xd91b('0x62')]['create']({'name':_0x3f27f6[_0xd91b('0x3d')],'resourceId':_0x3f27f6['id'],'type':_0x4106ea[_0xd91b('0x3d')],'sectionId':_0x4106ea['id']},{})[_0xd91b('0x21')](function(){return _0x369e16;});}else{return _0x369e16;}})[_0xd91b('0x2b')](function(_0x24229d){logger[_0xd91b('0x27')](_0xd91b('0x63'),_0x24229d);throw _0x24229d;});}return _0x369e16;})[_0xd91b('0x21')](respondWithResult(_0x16863b,0xc9))[_0xd91b('0x2b')](handleError(_0x16863b,null));};exports[_0xd91b('0x38')]=function(_0x503e75,_0x339cbc){if(_0x503e75[_0xd91b('0x64')]['id']){delete _0x503e75['body']['id'];}return db['ChatWebsite'][_0xd91b('0x5c')]({'where':{'id':_0x503e75[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]})['then'](handleEntityNotFound(_0x339cbc,null))[_0xd91b('0x21')](saveUpdates(_0x503e75['body'],null))[_0xd91b('0x21')](respondWithResult(_0x339cbc,null))[_0xd91b('0x2b')](handleError(_0x339cbc,null));};exports[_0xd91b('0x39')]=function(_0x1012dd,_0x534b34){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x1012dd[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x534b34,null))[_0xd91b('0x21')](removeEntity(_0x534b34,null))[_0xd91b('0x2b')](handleError(_0x534b34,null));};exports[_0xd91b('0x65')]=function(_0x332ef3,_0x52522e){return db[_0xd91b('0x43')][_0xd91b('0x65')]()[_0xd91b('0x21')](respondWithResult(_0x52522e,null))[_0xd91b('0x2b')](handleError(_0x52522e,null));};exports[_0xd91b('0x66')]=function(_0x34eba4,_0x55d653,_0x2fd11d){if(_0x34eba4[_0xd91b('0x64')]['id']){delete _0x34eba4['body']['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x34eba4[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x55d653,null))[_0xd91b('0x21')](function(_0x1c8546){if(_0x1c8546){_0x34eba4[_0xd91b('0x64')][_0xd91b('0x67')]=_0x1c8546['id'];return db[_0xd91b('0x68')][_0xd91b('0x5d')](_0x34eba4['body']);}})[_0xd91b('0x21')](respondWithResult(_0x55d653,null))[_0xd91b('0x2b')](handleError(_0x55d653,null));};exports['getDispositions']=function(_0x4402c9,_0x13416c,_0x4a2e2f){var _0x48a35f={'raw':![],'where':{}};var _0x20f041={};var _0x51bfb2={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4402c9[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x13416c,null))[_0xd91b('0x21')](function(_0x542f45){if(_0x542f45){_0x20f041[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['Disposition'][_0xd91b('0x44')]);_0x20f041[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x4402c9[_0xd91b('0x48')]);_0x20f041[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],_0x20f041['query']);_0x48a35f[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4402c9[_0xd91b('0x48')]['fields']));_0x48a35f[_0xd91b('0x4b')]=_0x48a35f[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x48a35f[_0xd91b('0x4b')]:_0x20f041[_0xd91b('0x46')];if(!_0x4402c9[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x48a35f[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4402c9['query']['limit']);_0x48a35f[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x48a35f['order']=qs['sort'](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x48a35f[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_['pick'](_0x4402c9[_0xd91b('0x48')],_0x20f041[_0xd91b('0x49')]));_0x48a35f[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x542f45['id'];if(_0x4402c9[_0xd91b('0x48')][_0xd91b('0x51')]){_0x48a35f[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x48a35f[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x48a35f['attributes'],function(_0x3a1ca1){var _0x3c9257={};_0x3c9257[_0x3a1ca1]={'$like':'%'+_0x4402c9[_0xd91b('0x48')]['filter']+'%'};return _0x3c9257;})});}_0x48a35f=_[_0xd91b('0x54')]({},_0x48a35f,_0x4402c9[_0xd91b('0x55')]);return db['Disposition'][_0xd91b('0x32')]({'where':_0x48a35f[_0xd91b('0x4f')]})['then'](function(_0x54d042){_0x51bfb2['count']=_0x54d042;if(_0x4402c9[_0xd91b('0x48')]['includeAll']){_0x48a35f['include']=[{'all':!![]}];}return db[_0xd91b('0x68')]['findAll'](_0x48a35f);})[_0xd91b('0x21')](function(_0x25499e){_0x51bfb2[_0xd91b('0x59')]=_0x25499e;return _0x51bfb2;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x13416c,_0x48a35f))[_0xd91b('0x2b')](handleError(_0x13416c,null));};exports[_0xd91b('0x6c')]=function(_0x56b0ab,_0x3a6ce7,_0x3d3c03){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x56b0ab[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3a6ce7,null))['then'](function(_0x1ad836){if(_0x1ad836){return _0x1ad836['removeDispositions'](_0x56b0ab[_0xd91b('0x48')][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x3a6ce7,null))[_0xd91b('0x2b')](handleError(_0x3a6ce7,null));};exports['addAnswer']=function(_0x4e73a3,_0xfeef6e,_0x5b80eb){if(_0x4e73a3[_0xd91b('0x64')]['id']){delete _0x4e73a3[_0xd91b('0x64')]['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x4e73a3['params']['id']}})['then'](handleEntityNotFound(_0xfeef6e,null))[_0xd91b('0x21')](function(_0x2bffc3){if(_0x2bffc3){_0x4e73a3['body'][_0xd91b('0x67')]=_0x2bffc3['id'];return db[_0xd91b('0x6e')][_0xd91b('0x5d')](_0x4e73a3[_0xd91b('0x64')]);}})['then'](respondWithResult(_0xfeef6e,null))[_0xd91b('0x2b')](handleError(_0xfeef6e,null));};exports[_0xd91b('0x6f')]=function(_0x4e7274,_0x300336,_0x18aa80){var _0x487d41={'raw':![],'where':{}};var _0x5c0e01={};var _0x533e7d={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4e7274[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x300336,null))[_0xd91b('0x21')](function(_0x3b1b3c){if(_0x3b1b3c){_0x5c0e01['model']=_[_0xd91b('0x47')](db['CannedAnswer'][_0xd91b('0x44')]);_0x5c0e01[_0xd91b('0x48')]=_['keys'](_0x4e7274['query']);_0x5c0e01[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5c0e01['model'],_0x5c0e01[_0xd91b('0x48')]);_0x487d41[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5c0e01[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x487d41[_0xd91b('0x4b')]=_0x487d41[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x487d41['attributes']:_0x5c0e01[_0xd91b('0x46')];if(!_0x4e7274['query'][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x487d41[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x31')]);_0x487d41[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4e7274['query']['offset']);}_0x487d41[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x4e7274[_0xd91b('0x48')]['sort']);_0x487d41[_0xd91b('0x4f')]=qs['filters'](_[_0xd91b('0x50')](_0x4e7274[_0xd91b('0x48')],_0x5c0e01['filters']));_0x487d41[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x3b1b3c['id'];if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x51')]){_0x487d41[_0xd91b('0x4f')]=_['merge'](_0x487d41['where'],{'$or':_[_0xd91b('0x42')](_0x487d41['attributes'],function(_0x1795d3){var _0x2877bb={};_0x2877bb[_0x1795d3]={'$like':'%'+_0x4e7274[_0xd91b('0x48')]['filter']+'%'};return _0x2877bb;})});}_0x487d41=_['merge']({},_0x487d41,_0x4e7274[_0xd91b('0x55')]);return db[_0xd91b('0x6e')][_0xd91b('0x32')]({'where':_0x487d41[_0xd91b('0x4f')]})['then'](function(_0x560b84){_0x533e7d[_0xd91b('0x32')]=_0x560b84;if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x56')]){_0x487d41[_0xd91b('0x57')]=[{'all':!![]}];}return db[_0xd91b('0x6e')][_0xd91b('0x58')](_0x487d41);})['then'](function(_0x320452){_0x533e7d[_0xd91b('0x59')]=_0x320452;return _0x533e7d;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x300336,_0x487d41))[_0xd91b('0x2b')](handleError(_0x300336,null));};exports[_0xd91b('0x71')]=function(_0x3813f5,_0x28808d,_0x2b2c00){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x3813f5['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x28808d,null))[_0xd91b('0x21')](function(_0x405b0c){if(_0x405b0c){return _0x405b0c[_0xd91b('0x71')](_0x3813f5['query'][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x28808d,null))[_0xd91b('0x2b')](handleError(_0x28808d,null));};exports[_0xd91b('0x72')]=function(_0x3c3e60,_0x3d150b,_0x229055){_0x3c3e60['body'][_0xd91b('0x73')]=_0x3c3e60['file']['filename'];return db[_0xd91b('0x43')]['find']({'where':{'id':_0x3c3e60[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3d150b,null))[_0xd91b('0x21')](saveUpdates(_0x3c3e60[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x3d150b,null))['catch'](handleError(_0x3d150b,null));};exports[_0xd91b('0x74')]=function(_0x19e579,_0x4fda30,_0x4031b3){_0x19e579[_0xd91b('0x64')]['agentAvatar']=_0x19e579['file']['filename'];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x19e579[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4fda30,null))[_0xd91b('0x21')](saveUpdates(_0x19e579[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x4fda30,null))[_0xd91b('0x2b')](handleError(_0x4fda30,null));};exports[_0xd91b('0x75')]=function(_0x375a2f,_0x57d8e8,_0x34629a){_0x375a2f['body'][_0xd91b('0x76')]=_0x375a2f[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x375a2f[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x57d8e8,null))['then'](saveUpdates(_0x375a2f[_0xd91b('0x64')],null))['then'](respondWithResult(_0x57d8e8,null))[_0xd91b('0x2b')](handleError(_0x57d8e8,null));};exports[_0xd91b('0x79')]=function(_0x392aef,_0x266719,_0x10d85c){_0x392aef['body']['systemAvatar']=_0x392aef[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x392aef[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x266719,null))[_0xd91b('0x21')](saveUpdates(_0x392aef[_0xd91b('0x64')],null))['then'](respondWithResult(_0x266719,null))['catch'](handleError(_0x266719,null));};exports[_0xd91b('0x7a')]=function(_0x189e68,_0x243721,_0xf69f35){var _0x5e30aa=path['join'](config[_0xd91b('0x7b')],'server/files/images/logos/default_logo.svg');var _0xb56c3b={'where':{'id':_0x189e68['params']['id']},'attributes':['id',_0xd91b('0x73')],'raw':!![]};var _0x52c4a4=![];return require(_0xd91b('0x16'))[_0xd91b('0x7c')]()[_0xd91b('0x21')](function(_0x1c0202){if(_0x1c0202){_0x52c4a4=_0x1c0202['custom'];}})[_0xd91b('0x21')](function(){return db['ChatWebsite'][_0xd91b('0x5c')](_0xb56c3b);})['then'](handleEntityNotFound(_0x243721,null))[_0xd91b('0x21')](function(_0x133b76){if(_0x133b76){if(!_[_0xd91b('0x7d')](_0x133b76[_0xd91b('0x73')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76['sitepic']))&&_0x52c4a4){_0x5e30aa=path['join'](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76[_0xd91b('0x73')]);}}return _0x243721['download'](_0x5e30aa);}})[_0xd91b('0x2b')](handleError(_0x243721,null));};exports[_0xd91b('0x80')]=function(_0x8580ce,_0x1941b9,_0x37c958){var _0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x81'));var _0x5ac361={'where':{'id':_0x8580ce['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x5ac361)[_0xd91b('0x21')](handleEntityNotFound(_0x1941b9,null))['then'](function(_0x6bad10){if(_0x6bad10){if(!_['isNil'](_0x6bad10[_0xd91b('0x82')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x6bad10[_0xd91b('0x82')]))){_0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/images/avatars/',_0x6bad10['agentAvatar']);}}return _0x1941b9[_0xd91b('0x85')](_0x220932);}})[_0xd91b('0x2b')](handleError(_0x1941b9,null));};exports[_0xd91b('0x86')]=function(_0x597b84,_0x321867,_0x529612){var _0x4cba33=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x43cbbc={'where':{'id':_0x597b84[_0xd91b('0x5b')]['id']},'attributes':['id','customerAvatar',_0xd91b('0x87')],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x43cbbc)[_0xd91b('0x21')](handleEntityNotFound(_0x321867,null))[_0xd91b('0x21')](function(_0x17dc02){if(_0x17dc02){if(!_[_0xd91b('0x7d')](_0x17dc02[_0xd91b('0x76')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]))&&_0x17dc02[_0xd91b('0x87')]){_0x4cba33=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]);}}return _0x321867['download'](_0x4cba33);}})[_0xd91b('0x2b')](handleError(_0x321867,null));};exports['getSystemAvatar']=function(_0x338cc5,_0x206f71,_0x5a472f){var _0x17e211=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x88'));var _0x57795d={'where':{'id':_0x338cc5[_0xd91b('0x5b')]['id']},'attributes':['id',_0xd91b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd91b('0x5c')](_0x57795d)[_0xd91b('0x21')](handleEntityNotFound(_0x206f71,null))[_0xd91b('0x21')](function(_0x5432fd){if(_0x5432fd){if(!_[_0xd91b('0x7d')](_0x5432fd[_0xd91b('0x89')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]))){_0x17e211=path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]);}}return _0x206f71[_0xd91b('0x85')](_0x17e211);}})[_0xd91b('0x2b')](handleError(_0x206f71,null));};exports[_0xd91b('0x8a')]=function(_0x26db22,_0x7b4e7d,_0x38cff3){var _0x33010c=require('user-agent-parser');var _0x380137=new _0x33010c();var _0x1cb4b9=_0x380137['setUA'](_0x26db22[_0xd91b('0x8b')][_0xd91b('0x8c')])[_0xd91b('0x8d')]();var _0x47f631={'body':_0x26db22[_0xd91b('0x64')],'channel':_0xd91b('0x8e')};var _0x57bbf9=[];var _0x3c38d5=[];var _0x48130a={};var _0x6ac3e3=![];return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x1506c6){if(!_0x1506c6){throw new db['Sequelize'][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x57bbf9=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),['createdAt',_0xd91b('0x92')]);_0x3c38d5=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),[_0xd91b('0x93'),_0xd91b('0x92'),_0xd91b('0x94'),_0xd91b('0x95')]);if(_0x26db22['body']['id']){delete _0x26db22[_0xd91b('0x64')]['id'];}if(_['isNil'](_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')])){throw new db[(_0xd91b('0x97'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')])||_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')]===''){throw new db[(_0xd91b('0x97'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c38d5);}if(!_[_0xd91b('0x98')](_0x3c38d5,_0x26db22[_0xd91b('0x64')][_0xd91b('0x99')])){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0x9a')+_0x3c38d5);}_0x48130a[_0x26db22['body'][_0xd91b('0x99')]]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];})[_0xd91b('0x21')](function(){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x26db22[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c'),'include':[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x9d'),'where':_0x48130a,'limit':0x1,'order':[[_0xd91b('0x92'),_0xd91b('0x9e')]]}]},{'model':db[_0xd91b('0x9f')],'as':_0xd91b('0xa0')}]});})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))[_0xd91b('0x21')](function(_0x4ce03d){if(_0x4ce03d&&_0x4ce03d[_0xd91b('0x9c')]){_0x47f631['account']=_0x4ce03d;_0x47f631['applications']=_0x4ce03d[_0xd91b('0xa0')];_0x47f631[_0xd91b('0xa1')]=_0x4ce03d[_0xd91b('0x9c')];_0x47f631[_0xd91b('0xa2')]=_[_0xd91b('0xa3')](_0x47f631[_0xd91b('0xa2')],[_0xd91b('0xa4')],[_0xd91b('0xa5')]);if(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')]){delete _0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')];}if(_0x47f631[_0xd91b('0xa6')]['List']&&_0x47f631[_0xd91b('0xa6')]['List'][_0xd91b('0x9d')][_0xd91b('0x4d')]){return _0x47f631[_0xd91b('0xa6')][_0xd91b('0x9c')][_0xd91b('0x9d')][0x0];}var _0x341c4e=_[_0xd91b('0x18')](_0x26db22[_0xd91b('0x64')],{'firstName':_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')],'ListId':_0x4ce03d[_0xd91b('0x95')]});_0x341c4e[_0x26db22[_0xd91b('0x64')]['mapKey']]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];return db['CmContact'][_0xd91b('0x5d')](_0x341c4e,{'fields':_0x57bbf9,'raw':!![]});}})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))['then'](function(_0x3b775b){_0x47f631[_0xd91b('0xa7')]=_0x3b775b;var _0x596b4c=_0x26db22[_0xd91b('0x64')][_0xd91b('0xa8')];if(_0x26db22['headers'][_0xd91b('0xa9')]){_0x596b4c=_0x26db22[_0xd91b('0x8b')][_0xd91b('0xa9')];}else if(_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')]){_0x596b4c=_[_0xd91b('0xab')](_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')][_0xd91b('0xac')](','));}if(_0x3b775b){var _0x4fbcf1={'ContactId':_0x3b775b['id'],'ChatWebsiteId':_0x26db22['params']['id'],'from':(_0x3b775b[_0xd91b('0xad')]||'')+'\x20'+(_0x3b775b[_0xd91b('0xae')]||''),'customerIp':_0x596b4c,'customerPort':_0x26db22[_0xd91b('0x8b')]['x-real-port']?_0x26db22['headers'][_0xd91b('0xaf')]:null,'referer':_0x26db22['body'][_0xd91b('0xb0')],'browserName':_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0x3d')]&&_0x1cb4b9['browser']['version']?util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['browser'][_0xd91b('0x3d')],_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0xb3')]):_0xd91b('0xb4'),'browserVersion':_0x1cb4b9[_0xd91b('0xb1')]['version']||_0xd91b('0xb4'),'osName':util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['os']['name'],_0x1cb4b9['os'][_0xd91b('0xb3')]),'osVersion':_0x1cb4b9['os'][_0xd91b('0xb3')],'deviceModel':_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0x46')]&&_0x1cb4b9[_0xd91b('0xb5')]['vendor']?util[_0xd91b('0xb2')](_0xd91b('0xb6'),_0x1cb4b9[_0xd91b('0xb5')]['model'],_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0xb7')],_0x1cb4b9[_0xd91b('0xb5')]['type']):null,'deviceVendor':_0x1cb4b9['device'][_0xd91b('0xb7')],'deviceType':_0x1cb4b9[_0xd91b('0xb5')]['type'],'formData':JSON[_0xd91b('0x26')](_0x26db22['body'])};var _0x151671={'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'closed':![]};if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]){_0x151671[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xb8')];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})['then'](function(_0x15be79){if(_0x15be79){return[_0x15be79,![]];}_0x4fbcf1[_0xd91b('0xb8')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')];_0x4fbcf1[_0xd91b('0xba')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xba')];return db[_0xd91b('0xb9')]['create'](_0x4fbcf1)[_0xd91b('0x21')](function(_0x528a04){return[_0x528a04,!![]];});});}_0x151671[_0xd91b('0xbb')]=_0x3b775b['id'];if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]&&_0x26db22[_0xd91b('0x64')]['interaction']['id']){_0x151671['id']=_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]['id'];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})[_0xd91b('0x21')](function(_0xa38683){if(_0xa38683){return[_0xa38683,![]];}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)[_0xd91b('0x21')](function(_0x59e790){return[_0x59e790,!![]];});});}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)['then'](function(_0x267254){return[_0x267254,!![]];});}})[_0xd91b('0xbd')](function(_0x46df80,_0x4d21a0){if(_0x46df80){_0x6ac3e3=_0x4d21a0;if(!_0x4d21a0){var _0x2fde7b={'from':(_0x47f631[_0xd91b('0xa7')][_0xd91b('0xad')]||'')+'\x20'+(_0x47f631['contact'][_0xd91b('0xae')]||'')};if(_0x26db22['body'][_0xd91b('0xb8')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xbe')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]!=_0x26db22['body'][_0xd91b('0xbe')]){_0x2fde7b[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xbe')];}return _0x46df80[_0xd91b('0x38')](_0x2fde7b);}else{return _0x46df80;}}})[_0xd91b('0x21')](function(_0x1abaa9){_0x47f631[_0xd91b('0xbc')]=_0x1abaa9['get']({'plain':!![]});_0x47f631[_0xd91b('0xbc')][_0xd91b('0xbf')]=_0x6ac3e3;if(_0x47f631[_0xd91b('0xbc')]['created']){if(_0x47f631['account']['autoclose']){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc0')]({'id':0x0,'priority':_0x47f631[_0xd91b('0xa2')][_0xd91b('0x4d')]+0x1,'app':_0xd91b('0xc1'),'appdata':'unmanaged','interval':_0xd91b('0xc2')});}}return db[_0xd91b('0xc3')][_0xd91b('0x5d')]({'body':_0x26db22[_0xd91b('0x64')]['body'],'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'ChatInteractionId':_0x1abaa9['id'],'direction':'in','ContactId':_0x47f631[_0xd91b('0xa7')]['id'],'AttachmentId':_0x26db22['body'][_0xd91b('0xc4')]});})[_0xd91b('0x21')](function(_0x3ea9cd){_0x47f631['message']=_0x3ea9cd;if(_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]){return db[_0xd91b('0xc6')][_0xd91b('0x5c')]({'attributes':['id',_0xd91b('0x3d')],'where':{'id':_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]}})[_0xd91b('0x21')](function(_0xd29a80){if(_0xd29a80){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd29a80[_0xd91b('0x3d')]+','+(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xc8')]||0xa),'interval':_0xd91b('0xc2')});_0x47f631[_0xd91b('0xc9')]=!![];}return respondWithRpcPromise(_0xd91b('0xca'),_0xd91b('0xcb'),_0x47f631);});}return respondWithRpcPromise(_0xd91b('0xca'),'startRouting',_0x47f631);})[_0xd91b('0x21')](function(_0x3646a5){respondWithRpcPromise('EventManager',_0xd91b('0xcc'),{'event':_0xd91b('0x8a'),'message':_0x3646a5},client9002);return _0x3646a5;})[_0xd91b('0x21')](respondWithResult(_0x7b4e7d,null))[_0xd91b('0x2b')](handleError(_0x7b4e7d,null));};exports[_0xd91b('0xcd')]=function(_0x22d046,_0x1e0f77,_0x579b2d){var _0x15ad28,_0x572bb8,_0x5954e4;var _0x1c70d0=[];var _0x2fd82e=[];var _0x535c45={};var _0x16dfe7=_0x22d046[_0xd91b('0xce')]||[];var _0x4b4e77=[];var _0x2a8aaa;return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x555bda){if(!_0x555bda){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x2fd82e=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),['createdAt','updatedAt']);_0x1c70d0=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),[_0xd91b('0x93'),_0xd91b('0x92'),'CompanyId','ListId']);if(_0x22d046[_0xd91b('0x64')]['id']){delete _0x22d046[_0xd91b('0x64')]['id'];}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0xcf')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')])||_0x22d046[_0xd91b('0x64')]['body']===''){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))]['ValidationError'](_0xd91b('0xd0')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c70d0));}if(!_['includes'](_0x1c70d0,_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77['status'](0x1f4)[_0xd91b('0x3e')](new db['Sequelize'][(_0xd91b('0x90'))](_0xd91b('0xd2')+_0x1c70d0));}_0x535c45[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];})[_0xd91b('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x22d046['params']['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c')},{'model':db[_0xd91b('0xd3')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1e0f77,null))[_0xd91b('0x21')](function(_0x1726a1){if(_0x1726a1&&_0x1726a1[_0xd91b('0x9c')]){_0x572bb8=_0x1726a1;var _0x544551=_[_0xd91b('0x18')](_0x22d046['body'],{'firstName':_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')],'phone':_0x22d046['body'][_0xd91b('0x96')],'ListId':_0x1726a1[_0xd91b('0x95')]});_0x544551[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];return db['CmContact'][_0xd91b('0xd4')]({'where':_0x535c45,'defaults':_0x544551});}})['spread'](function(_0x32f677){if(_0x32f677){_0x5954e4=_0x32f677;var _0x3f0489=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0xd91b('0xd6'));var _0x27666b=ejs[_0xd91b('0xd7')](_0x3f0489,{'body':_[_0xd91b('0xd8')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')]),'bodyTitle':_0x572bb8[_0xd91b('0xd9')]});return db[_0xd91b('0xda')][_0xd91b('0x5d')]({'body':_0x27666b,'ContactId':_0x32f677['id'],'ChatWebsiteId':_0x572bb8['id']});}})['then'](function(_0x328916){_0x2a8aaa=_0x328916;if(_0x16dfe7[_0xd91b('0x4d')]){var _0x3fc231=_0x16dfe7[_0xd91b('0x42')](function(_0x37a466){return{'name':_0x37a466[_0xd91b('0xdb')],'basename':_0x37a466[_0xd91b('0x78')],'type':_0x37a466['mimetype'],'ChatOfflineMessageId':_0x328916['id']};});_0x4b4e77=_0x3fc231[_0xd91b('0x42')](_0x4bc33c=>{var _0x458bb7={'filename':_0x4bc33c[_0xd91b('0x3d')],'path':path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0xdc'),_0xd91b('0xce'),_0xd91b('0xdd'),_0xd91b('0xde'),_0x4bc33c['basename'])};return _0x458bb7;});if(!_0x572bb8[_0xd91b('0xdf')]){return db['sequelize']['transaction'](function(_0x328817){return db[_0xd91b('0xe0')]['bulkCreate'](_0x3fc231,{'transaction':_0x328817});});}}})['then'](function(){if(_0x2a8aaa){_0x15ad28=_0x2a8aaa;return db[_0xd91b('0xd3')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd91b('0xe1')],'as':_0xd91b('0xe2'),'raw':!![]}]});}})[_0xd91b('0x21')](function(_0x539305){if(_0x539305&&_0x539305[_0xd91b('0xe2')]&&_0x572bb8['forwardOffline']&&_0x572bb8[_0xd91b('0xe3')]){var _0x3c232d={'tls':{'rejectUnauthorized':![]}};if(_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')]){_0x3c232d['service']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')];}else{_0x3c232d[_0xd91b('0xe5')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe5')];_0x3c232d[_0xd91b('0xe6')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe6')];_0x3c232d['secure']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe7')];}if(_0x539305[_0xd91b('0xe2')]['authentication']){_0x3c232d[_0xd91b('0xe8')]={'user':_0x539305[_0xd91b('0xe2')][_0xd91b('0x5e')],'pass':_0x539305[_0xd91b('0xe2')][_0xd91b('0xe9')]};}return respondWithRpcPromise(_0xd91b('0xea'),_0xd91b('0xeb'),{'account':_0x3c232d,'message':{'from':util[_0xd91b('0xb2')](_0xd91b('0xec'),_0x539305[_0xd91b('0x3d')],_0x539305[_0xd91b('0xed')]||_0x539305['Smtp'][_0xd91b('0x5e')]),'to':_0x572bb8[_0xd91b('0xe3')],'subject':_0x572bb8[_0xd91b('0xee')],'html':_0x15ad28['body'],'attachments':_0x4b4e77}},client9003)['then'](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x4e9221){console[_0xd91b('0x27')](_0x4e9221);});}})[_0xd91b('0x21')](function(){if(_0x572bb8&&_0x572bb8[_0xd91b('0xdf')]&&_0x572bb8[_0xd91b('0xef')]){var _0x24eb7b=[];if(_0x16dfe7[_0xd91b('0x4d')]){_0x24eb7b=_0x16dfe7[_0xd91b('0x42')](function(_0x1fc85a){return{'name':_0x1fc85a[_0xd91b('0xdb')],'basename':_0x1fc85a[_0xd91b('0x78')],'type':_0x1fc85a[_0xd91b('0xf0')],'ChatOfflineMessageId':_0x2a8aaa['id']};});}var _0x4266d2;if(!_[_0xd91b('0x7d')](_0x572bb8['subjectOffline'])){var _0x1e4383=_[_0xd91b('0x42')](_0x22d046[_0xd91b('0x64')],function(_0x3a0073){return _0x3a0073;});var _0x284a5f=_[_0xd91b('0xf1')](_0x1e4383)[0x0];var _0x1563ba=_[_0xd91b('0xf2')](_0x284a5f,function(_0xaa733a){return _0xaa733a;});_0x4266d2=_0x1563ba[0x1][_0x572bb8[_0xd91b('0xf3')]];}var _0x428415={'from':_0x5954e4['email'],'firstName':_0x5954e4[_0xd91b('0xad')],'lastName':_0x5954e4[_0xd91b('0xae')],'mapKey':_0xd91b('0xed'),'message':{'from':_0x5954e4[_0xd91b('0xed')],'to':_0x572bb8[_0xd91b('0xd3')]['email'],'cc':'','subject':_[_0xd91b('0x7d')](_0x4266d2)?_0x572bb8[_0xd91b('0xee')]:_0x4266d2,'messageId':'','sentAt':new Date(),'attach':_0x24eb7b[_0xd91b('0x4d')],'attachments':_0x24eb7b,'originChannel':_0xd91b('0xf4'),'ChatWebsiteId':_0x572bb8['id'],'ChatOfflineMessageId':_0x15ad28['id'],'originTo':_0x572bb8['MailAccount']['email']},'body':_0x15ad28[_0xd91b('0x64')]};var _0x377287={'account':{'id':_0x572bb8[_0xd91b('0xef')]},'body':_0x428415,'log':_0xd91b('0xf5')};return respondWithRpcPromise(_0xd91b('0xf5'),_0xd91b('0xf6'),_0x377287,client9001)[_0xd91b('0x21')](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x286bb5){console['error'](_0x286bb5);});}return;})['then'](function(){if(_0x15ad28){return _0x15ad28;}})[_0xd91b('0x21')](respondWithResult(_0x1e0f77,null))['catch'](function(_0x3d6c3c){console[_0xd91b('0x27')](_0xd91b('0x2b'),_0x3d6c3c);for(var _0x318a94 of _0x16dfe7){var _0x353a39=path[_0xd91b('0x7e')](config['root'],_0xd91b('0xdc'),'files',_0xd91b('0xdd'),'offline-chat',_0x318a94[_0xd91b('0x78')]);fs_extra['remove'](_0x353a39)[_0xd91b('0x2b')](function(_0x1d70c1){console[_0xd91b('0x27')](_0xd91b('0xf7'),_0x353a39,_0x1d70c1);});}});};exports[_0xd91b('0xf8')]=function(_0x4225a0,_0x373cdf,_0xb6afa2){return db[_0xd91b('0xb9')][_0xd91b('0x5c')]({'where':{'id':_0x4225a0['params']['id']}})['then'](handleEntityNotFound(_0x373cdf,null))['then'](function(_0x8f81b){if(_0x8f81b){return _0x8f81b[_0xd91b('0xf8')](_0x4225a0['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x4225a0[_0xd91b('0x64')],['ids','id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x373cdf,null))['catch'](handleError(_0x373cdf,null));};exports[_0xd91b('0xfa')]=function(_0x3075d8,_0x3ff73b,_0x1d6600){var _0x2c75fa={'raw':![],'where':{}};var _0x2a5a60={};var _0x1b6d78={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x3075d8[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3ff73b,null))[_0xd91b('0x21')](function(_0x3e244c){if(_0x3e244c){_0x2a5a60['model']=_['keys'](db['ChatInteraction'][_0xd91b('0x44')]);_0x2a5a60[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x3075d8[_0xd91b('0x48')]);_0x2a5a60[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x2a5a60['model'],_0x2a5a60['query']);_0x2c75fa['attributes']=_['intersection'](_0x2a5a60[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x3075d8['query'][_0xd91b('0x4c')]));_0x2c75fa[_0xd91b('0x4b')]=_0x2c75fa['attributes'][_0xd91b('0x4d')]?_0x2c75fa[_0xd91b('0x4b')]:_0x2a5a60[_0xd91b('0x46')];if(!_0x3075d8[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x2c75fa[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x31')]);_0x2c75fa['offset']=qs[_0xd91b('0x33')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x2c75fa[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x3075d8[_0xd91b('0x48')]['sort']);_0x2c75fa[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x3075d8[_0xd91b('0x48')],_0x2a5a60[_0xd91b('0x49')]));_0x2c75fa[_0xd91b('0x4f')]['ChatWebsiteId']=_0x3e244c['id'];if(_0x3075d8[_0xd91b('0x48')]['filter']){_0x2c75fa[_0xd91b('0x4f')]=_['merge'](_0x2c75fa[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x2c75fa[_0xd91b('0x4b')],function(_0x315422){var _0x2df11e={};_0x2df11e[_0x315422]={'$like':'%'+_0x3075d8[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2df11e;})});}_0x2c75fa=_[_0xd91b('0x54')]({},_0x2c75fa,_0x3075d8[_0xd91b('0x55')]);return db[_0xd91b('0xb9')]['count']({'where':_0x2c75fa['where']})[_0xd91b('0x21')](function(_0x44d204){_0x1b6d78['count']=_0x44d204;if(_0x3075d8[_0xd91b('0x48')][_0xd91b('0x56')]){_0x2c75fa[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':'Contact','required':![]},{'model':db[_0xd91b('0xc6')],'as':_0xd91b('0xfb'),'attributes':['name',_0xd91b('0xfc'),_0xd91b('0xfd')],'required':![]},{'model':db['Tag'],'as':_0xd91b('0xfe'),'attributes':['id','name',_0xd91b('0xff')],'where':_0x3075d8[_0xd91b('0x48')]['tag']?{'id':_0x3075d8[_0xd91b('0x48')][_0xd91b('0x100')]}:undefined,'required':_0x3075d8['query']['tag']?!![]:![]}];}return db['ChatInteraction'][_0xd91b('0x58')](_0x2c75fa);})['then'](function(_0x4dcd8e){_0x1b6d78[_0xd91b('0x59')]=_0x4dcd8e;return _0x1b6d78;});}})['then'](respondWithFilteredResult(_0x3ff73b,_0x2c75fa))[_0xd91b('0x2b')](handleError(_0x3ff73b,null));};function iftimePromise(_0x477b50,_0x2dda03){return respondWithRpcPromise(_0xd91b('0x101'),_0xd91b('0x102'),{'command':_0x2dda03['timezone']?util[_0xd91b('0xb2')](_0xd91b('0x103'),_0x477b50['interval'],_0x2dda03[_0xd91b('0x104')]):util[_0xd91b('0xb2')](_0xd91b('0x105'),_0x477b50['interval'])},client9002)[_0xd91b('0x21')](function(_0x2baff4){var _0x501474=_0x2baff4&&_0x2baff4[_0xd91b('0x106')](_0xd91b('0x107'))>=0x0?!![]:![];logger['info'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],_0x501474?_0xd91b('0x109'):_0xd91b('0x10a'),_0x2dda03['timezone']?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return _0x501474;})[_0xd91b('0x2b')](function(_0x2ad6a6){logger['error'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],util[_0xd91b('0x10c')](_0x2ad6a6,{'showHidden':![],'depth':null}),_0x2dda03[_0xd91b('0x104')]?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return![];});}exports['getSnippet']=function(_0x4d046f,_0x12a7a1,_0x2f0436){var _0x4073ef=0x0;var _0x33c921=0x0;var _0x50a269=![];var _0x5123ec;var _0x5d9af1;return db[_0xd91b('0x43')]['find']({'where':{'id':_0x4d046f[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x10d')],'as':_0xd91b('0x10d'),'include':[{'model':db['Interval'],'as':_0xd91b('0x10e'),'attributes':['id',_0xd91b('0x10f')],'raw':!![]}]}]})[_0xd91b('0x21')](handleEntityNotFound(_0x12a7a1,null))[_0xd91b('0x21')](function(_0xc941da){if(_0xc941da){_0x5123ec=_0xc941da;return _0xc941da[_0xd91b('0x110')]({'raw':!![]});}})[_0xd91b('0x21')](function(_0x29ce7e){if(_0x5123ec){if(_0x29ce7e){_0x5d9af1=_0x29ce7e;}}return require(_0xd91b('0x16'))['getLicense']();})[_0xd91b('0x21')](function(_0x12633c){if(_0x12633c){_0x33c921=_0x12633c[_0xd91b('0x111')];_0x50a269=_0x12633c['custom'];}})['then'](function(){return db[_0xd91b('0xb9')][_0xd91b('0x32')]({'where':{'closed':![]}});})[_0xd91b('0x21')](function(_0xa0d263){_0x4073ef=_0xa0d263;if(_0x33c921&&_0xa0d263>_0x33c921){return db[_0xd91b('0x112')][_0xd91b('0x69')]({'where':{'id':0x1}})[_0xd91b('0x21')](function(_0x136e30){if(_0x136e30){_0x136e30['increment'](_0xd91b('0x113'));}});}})[_0xd91b('0x21')](function(){if(_0x5123ec[_0xd91b('0x10d')]&&_0x5123ec[_0xd91b('0x10d')]['Intervals']){var _0x33e8ce=[];for(var _0xffc07c=0x0;_0xffc07c<_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xd91b('0x4d')];_0xffc07c++){var _0x1bee52=_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xffc07c][_0xd91b('0x3a')]({'plain':!![]});_0x33e8ce[_0xd91b('0xc0')](iftimePromise(_0x1bee52,_0x5123ec));}return BPromise[_0xd91b('0x114')](_0x33e8ce)[_0xd91b('0x21')](function(_0x2c7031){return _[_0xd91b('0x115')](_0x2c7031);});}else{return!![];}})[_0xd91b('0x21')](function(_0x304143){var _0x373022=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/chat/iframe.ejs'),'utf8');var _0x11b454={'remote':_0x5123ec[_0xd91b('0x116')],'query':querystring[_0xd91b('0x26')](_[_0xd91b('0x54')](_0x5123ec[_0xd91b('0x3a')]({'plain':!![]}),{'customerIp':_0x4d046f[_0xd91b('0x8b')]['x-forwarded-for']||_0x4d046f[_0xd91b('0x8b')][_0xd91b('0x117')]||_0x4d046f[_0xd91b('0x118')][_0xd91b('0x119')]||_0x4d046f['ip'],'referer':_0x4d046f[_0xd91b('0x8b')][_0xd91b('0xb0')],'openedInteractions':_0x4073ef,'maxInteractions':_0x33c921,'virtual':_0x50a269[_0xd91b('0x111')],'online':_0x304143,'custom':_0x50a269}))[_0xd91b('0x11a')](/'/g,'\x5c\x27')};_0x12a7a1[_0xd91b('0x3e')](ejs[_0xd91b('0xd7')](Mustache[_0xd91b('0xd7')](_0x373022,_0x11b454),{'proactiveActions':_0x5d9af1,'alignment':_0x5123ec['alignment'],'verticalAlignment':_0x5123ec['verticalAlignment'],'div_color':_0x5123ec[_0xd91b('0xff')],'text_color':_0x5123ec['textColor'],'button_color':_0x5123ec[_0xd91b('0x11b')],'background_color':_0x5123ec['backgroundColor']}));})[_0xd91b('0x2b')](handleError(_0x12a7a1,null));};exports[_0xd91b('0x11c')]=function(_0x1cd163,_0x3d1079,_0x59f46d){return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1cd163['params']['id']}})['then'](handleEntityNotFound(_0x3d1079,null))[_0xd91b('0x21')](function(_0x4ad226){if(_0x4ad226){return db[_0xd91b('0x11d')][_0xd91b('0x11e')](function(_0x47664a){return db['ChatApplication'][_0xd91b('0x39')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'transaction':_0x47664a})[_0xd91b('0x21')](function(_0x185ce8){var _0xddf319=_['map'](_0x1cd163[_0xd91b('0x64')],function(_0x6033e2){_0x6033e2[_0xd91b('0x67')]=_0x1cd163[_0xd91b('0x5b')]['id'];return _0x6033e2;});return db[_0xd91b('0x9f')][_0xd91b('0x11f')](_0xddf319,{'transaction':_0x47664a});});})[_0xd91b('0x21')](function(){return db['ChatApplication'][_0xd91b('0x120')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'order':'priority'});});}})[_0xd91b('0x21')](respondWithResult(_0x3d1079,null))[_0xd91b('0x2b')](handleError(_0x3d1079,null));};exports[_0xd91b('0x121')]=function(_0x1f3697,_0xa52d12,_0x298e46){var _0x26d3dc={};var _0x250478={};var _0x3c5e15;var _0x5dc275;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1f3697[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0xa52d12,null))[_0xd91b('0x21')](function(_0x283220){if(_0x283220){_0x3c5e15=_0x283220;_0x250478[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x9f')][_0xd91b('0x44')]);_0x250478[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x1f3697[_0xd91b('0x48')]);_0x250478[_0xd91b('0x49')]=_['intersection'](_0x250478[_0xd91b('0x46')],_0x250478['query']);_0x26d3dc[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x250478[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x26d3dc[_0xd91b('0x4b')]=_0x26d3dc[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x26d3dc['attributes']:_0x250478['model'];_0x26d3dc[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x26d3dc[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x1f3697[_0xd91b('0x48')],_0x250478[_0xd91b('0x49')]));if(_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]){_0x26d3dc[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x26d3dc[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x26d3dc[_0xd91b('0x4b')],function(_0x3e2776){var _0x2659c4={};_0x2659c4[_0x3e2776]={'$like':'%'+_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2659c4;})});}_0x26d3dc=_[_0xd91b('0x54')]({},_0x26d3dc,_0x1f3697[_0xd91b('0x55')]);return _0x3c5e15['getApplications'](_0x26d3dc);}})['then'](function(_0x4a8ceb){if(_0x4a8ceb){_0x5dc275=_0x4a8ceb['length'];if(!_0x1f3697[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x26d3dc[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x31')]);_0x26d3dc['offset']=qs[_0xd91b('0x33')](_0x1f3697['query'][_0xd91b('0x33')]);}return _0x3c5e15[_0xd91b('0x121')](_0x26d3dc);}})[_0xd91b('0x21')](function(_0x264371){if(_0x264371){return _0x264371?{'count':_0x5dc275,'rows':_0x264371}:null;}})[_0xd91b('0x21')](respondWithResult(_0xa52d12,null))['catch'](handleError(_0xa52d12,null));};exports[_0xd91b('0x122')]=function(_0x16665b,_0x2193f5,_0x2750f8){return db['chatProactiveAction'][_0xd91b('0x5c')]({'where':{'id':_0x16665b['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x2193f5,null))['then'](function(_0x20d645){if(_0x20d645){return _0x20d645[_0xd91b('0x122')](_0x16665b['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x16665b[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x2193f5,null))[_0xd91b('0x2b')](handleError(_0x2193f5,null));};exports[_0xd91b('0x110')]=function(_0x21d377,_0x383b12,_0x2a2364){var _0x3741ef={};var _0x842b46={};var _0x3f6265;var _0x3f2701;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x21d377[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x383b12,null))[_0xd91b('0x21')](function(_0x1e9444){if(_0x1e9444){_0x3f6265=_0x1e9444;_0x842b46[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x123')][_0xd91b('0x44')]);_0x842b46[_0xd91b('0x48')]=_['keys'](_0x21d377[_0xd91b('0x48')]);_0x842b46[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x842b46['model'],_0x842b46[_0xd91b('0x48')]);_0x3741ef['attributes']=_[_0xd91b('0x4a')](_0x842b46[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x3741ef[_0xd91b('0x4b')]=_0x3741ef[_0xd91b('0x4b')]['length']?_0x3741ef['attributes']:_0x842b46['model'];_0x3741ef['order']=qs[_0xd91b('0x4e')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x3741ef[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x21d377[_0xd91b('0x48')],_0x842b46[_0xd91b('0x49')]));if(_0x21d377['query'][_0xd91b('0x51')]){_0x3741ef['where']=_[_0xd91b('0x54')](_0x3741ef['where'],{'$or':_[_0xd91b('0x42')](_0x3741ef[_0xd91b('0x4b')],function(_0x405671){var _0x4a2e66={};_0x4a2e66[_0x405671]={'$like':'%'+_0x21d377[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4a2e66;})});}_0x3741ef=_['merge']({},_0x3741ef,_0x21d377[_0xd91b('0x55')]);return _0x3f6265[_0xd91b('0x110')](_0x3741ef);}})[_0xd91b('0x21')](function(_0x938074){if(_0x938074){_0x3f2701=_0x938074[_0xd91b('0x4d')];if(!_0x21d377[_0xd91b('0x48')]['hasOwnProperty'](_0xd91b('0x6b'))){_0x3741ef[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x31')]);_0x3741ef[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x21d377[_0xd91b('0x48')]['offset']);}return _0x3f6265['getProactiveActions'](_0x3741ef);}})[_0xd91b('0x21')](function(_0x3d0b43){if(_0x3d0b43){return _0x3d0b43?{'count':_0x3f2701,'rows':_0x3d0b43}:null;}})['then'](respondWithResult(_0x383b12,null))[_0xd91b('0x2b')](handleError(_0x383b12,null));};exports[_0xd91b('0x124')]=function(_0x12bd3c,_0x5d7f21,_0x368b50){var _0x4fbf17=_0x12bd3c['query'][_0xd91b('0x125')]===_0xd91b('0x126')?'offlineForm':'onlineForm';return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'attributes':['id',_0x4fbf17],'where':{'id':_0x12bd3c[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x5d7f21,null))[_0xd91b('0x21')](function(_0x2205a9){if(_0x2205a9){var _0x481d3f=_0x2205a9[_0x4fbf17];var _0x5953fd=_0x481d3f&&_0x481d3f[_0xd91b('0x127')]?_0x481d3f['items']:[];_0x5d7f21[_0xd91b('0x3e')]({'fromKey':_[_0xd91b('0x7d')](_0x481d3f[_0xd91b('0x128')])?undefined:_0x481d3f[_0xd91b('0x128')],'count':_0x5953fd['length'],'rows':_0x5953fd});}})[_0xd91b('0x2b')](handleError(_0x5d7f21,null));};exports[_0xd91b('0x129')]=function(_0x458e07,_0x5ccb38,_0x3b5caf){var _0x225b02={'raw':![],'where':{}};var _0x256260={};var _0x5a1306={'count':0x0,'rows':[]};return db[_0xd91b('0x43')]['findOne']({'where':{'id':_0x458e07[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ccb38,null))[_0xd91b('0x21')](function(_0x19d4be){if(_0x19d4be){_0x256260[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xda')][_0xd91b('0x44')]);_0x256260[_0xd91b('0x48')]=_['keys'](_0x458e07['query']);_0x256260['filters']=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],_0x256260['query']);_0x225b02[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x225b02['attributes']=_0x225b02['attributes'][_0xd91b('0x4d')]?_0x225b02[_0xd91b('0x4b')]:_0x256260[_0xd91b('0x46')];if(!_0x458e07[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x225b02['limit']=qs[_0xd91b('0x31')](_0x458e07['query']['limit']);_0x225b02[_0xd91b('0x33')]=qs['offset'](_0x458e07[_0xd91b('0x48')]['offset']);}_0x225b02['order']=qs[_0xd91b('0x4e')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x225b02[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x458e07['query'],_0x256260['filters']));_0x225b02[_0xd91b('0x4f')]['ChatWebsiteId']=_0x19d4be['id'];if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]){_0x225b02[_0xd91b('0x4f')]=_['merge'](_0x225b02[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x225b02[_0xd91b('0x4b')],function(_0x10264c){var _0x21f75e={};_0x21f75e[_0x10264c]={'$like':'%'+_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x21f75e;})});}_0x225b02=_[_0xd91b('0x54')]({},_0x225b02,_0x458e07[_0xd91b('0x55')]);return db['ChatOfflineMessage'][_0xd91b('0x32')]({'where':_0x225b02[_0xd91b('0x4f')]})[_0xd91b('0x21')](function(_0x58309a){_0x5a1306[_0xd91b('0x32')]=_0x58309a;if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x56')]){_0x225b02[_0xd91b('0x57')]=[{'all':!![]}];}else{_0x225b02[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x12a'),'required':![]},{'model':db[_0xd91b('0xe0')],'as':_0xd91b('0x12b'),'required':![]}];}return db[_0xd91b('0xda')][_0xd91b('0x58')](_0x225b02);})['then'](function(_0x422ddb){_0x5a1306[_0xd91b('0x59')]=_0x422ddb;return _0x5a1306;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x5ccb38,_0x225b02))[_0xd91b('0x2b')](handleError(_0x5ccb38,null));};exports[_0xd91b('0x12c')]=function(_0x49e539,_0x4b7697,_0x2a7bae){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x49e539[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x4b7697,null))[_0xd91b('0x21')](function(_0x1ac559){if(_0x1ac559){return _0x1ac559['addAgents'](_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x49e539[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{})['spread'](function(_0x152d26){for(var _0x403f8c=0x0;_0x403f8c<_0x49e539[_0xd91b('0x64')]['ids'][_0xd91b('0x4d')];_0x403f8c+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x12e'),{'UserId':Number(_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')][_0x403f8c]),'ChatWebsiteId':Number(_0x49e539[_0xd91b('0x5b')]['id'])});}return _0x152d26;});}})[_0xd91b('0x21')](respondWithResult(_0x4b7697,null))[_0xd91b('0x2b')](handleError(_0x4b7697,null));};exports[_0xd91b('0x12f')]=function(_0x2cc933,_0x285afc,_0x1bd85c){return db['ChatWebsite']['find']({'where':{'id':_0x2cc933[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x285afc,null))['then'](function(_0x52704d){if(_0x52704d){return _0x52704d[_0xd91b('0x12f')](_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')])[_0xd91b('0x21')](function(){if(_[_0xd91b('0x130')](_0x2cc933['query'][_0xd91b('0x6d')])){for(var _0x4f33fe=0x0;_0x4f33fe<_0x2cc933[_0xd91b('0x48')]['ids'][_0xd91b('0x4d')];_0x4f33fe+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933['query']['ids'][_0x4f33fe]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}}else{socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}});}})[_0xd91b('0x21')](respondWithStatusCode(_0x285afc,null))['catch'](handleError(_0x285afc,null));};exports[_0xd91b('0x132')]=function(_0x745f15,_0x310620,_0x3ce44e){var _0x204cb4={};var _0x290240={};var _0x42d938;var _0x16558a;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x745f15[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x310620,null))[_0xd91b('0x21')](function(_0x4ad69c){if(_0x4ad69c){_0x42d938=_0x4ad69c;_0x290240[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xc6')][_0xd91b('0x44')]);_0x290240[_0xd91b('0x48')]=_['keys'](_0x745f15['query']);_0x290240['filters']=_['intersection'](_0x290240[_0xd91b('0x46')],_0x290240[_0xd91b('0x48')]);_0x204cb4['attributes']=_['intersection'](_0x290240[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x745f15['query']['fields']));_0x204cb4[_0xd91b('0x4b')]=_0x204cb4[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x204cb4['attributes']:_0x290240[_0xd91b('0x46')];_0x204cb4[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x204cb4[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x745f15[_0xd91b('0x48')],_0x290240['filters']));if(_0x745f15[_0xd91b('0x48')]['filter']){_0x204cb4['where']=_[_0xd91b('0x54')](_0x204cb4[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x204cb4['attributes'],function(_0x1ad2f4){var _0x4f7a17={};_0x4f7a17[_0x1ad2f4]={'$like':'%'+_0x745f15[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4f7a17;})});}_0x204cb4=_[_0xd91b('0x54')]({},_0x204cb4,_0x745f15['options']);return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})[_0xd91b('0x21')](function(_0x151779){if(_0x151779){_0x16558a=_0x151779['length'];if(!_0x745f15[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x204cb4[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x31')]);_0x204cb4[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x33')]);}return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})['then'](function(_0x446708){if(_0x446708){return _0x446708?{'count':_0x16558a,'rows':_0x446708}:null;}})[_0xd91b('0x21')](respondWithResult(_0x310620,null))[_0xd91b('0x2b')](handleError(_0x310620,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 92eca68..24c44c4 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 _0x5395=['events','ChatWebsite','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7b4216,_0x30a95d){var _0x513051=function(_0x3920dc){while(--_0x3920dc){_0x7b4216['push'](_0x7b4216['shift']());}};_0x513051(++_0x30a95d);}(_0x5395,0x150));var _0x5539=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5395[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x5539('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x5539('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5539('0x2'),'afterDestroy':_0x5539('0x3')};function emitEvent(_0x2d24c7){return function(_0x4cd571,_0x2b6f8b,_0x453ad5){ChatWebsiteEvents[_0x5539('0x4')](_0x2d24c7+':'+_0x4cd571['id'],_0x4cd571);ChatWebsiteEvents[_0x5539('0x4')](_0x2d24c7,_0x4cd571);_0x453ad5(null);};}for(var e in events){if(events[_0x5539('0x5')](e)){var event=events[e];ChatWebsite[_0x5539('0x6')](e,emitEvent(event));}}module[_0x5539('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x94b1=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x94b1,0x102));var _0x194b=function(_0xbf12e8,_0x33154c){_0xbf12e8=_0xbf12e8-0x0;var _0x150e20=_0x94b1[_0xbf12e8];return _0x150e20;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x194b('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x194b('0x1')](0x0);var events={'afterCreate':_0x194b('0x2'),'afterUpdate':_0x194b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13fda1){return function(_0x3a21be,_0x32586a,_0x23ab83){ChatWebsiteEvents['emit'](_0x13fda1+':'+_0x3a21be['id'],_0x3a21be);ChatWebsiteEvents[_0x194b('0x4')](_0x13fda1,_0x3a21be);_0x23ab83(null);};}for(var e in events){if(events[_0x194b('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x194b('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5b2f119..c6e483c 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 _0x3ad6=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','path','../../config/environment','define'];(function(_0x1c249e,_0x56786e){var _0x28f75d=function(_0x15352a){while(--_0x15352a){_0x1c249e['push'](_0x1c249e['shift']());}};_0x28f75d(++_0x56786e);}(_0x3ad6,0xe8));var _0x63ad=function(_0x47debb,_0x335057){_0x47debb=_0x47debb-0x0;var _0x49907c=_0x3ad6[_0x47debb];return _0x49907c;};'use strict';var _=require(_0x63ad('0x0'));var util=require(_0x63ad('0x1'));var logger=require(_0x63ad('0x2'))(_0x63ad('0x3'));var moment=require(_0x63ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ad('0x5'));var rimraf=require('rimraf');var config=require(_0x63ad('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x15a147,_0x4845d9){return _0x15a147[_0x63ad('0x7')](_0x63ad('0x8'),attributes,{'tableName':_0x63ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd74a=['moment','bluebird','rimraf','./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x59092d,_0x1dd573){var _0x4aa450=function(_0x5ddc2a){while(--_0x5ddc2a){_0x59092d['push'](_0x59092d['shift']());}};_0x4aa450(++_0x1dd573);}(_0xd74a,0x1d2));var _0xad74=function(_0x4e1fd1,_0x4d9f35){_0x4e1fd1=_0x4e1fd1-0x0;var _0x1418d8=_0xd74a[_0x4e1fd1];return _0x1418d8;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var logger=require(_0xad74('0x2'))(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require(_0xad74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad74('0x6'));var config=require('../../config/environment');var attributes=require(_0xad74('0x7'));module[_0xad74('0x8')]=function(_0x3dc7d7,_0x37ec4c){return _0x3dc7d7[_0xad74('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index f86f402..207faf2 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 _0xf785=['client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c5793,_0xc25684){var _0x5503e2=function(_0x5bff71){while(--_0x5bff71){_0x4c5793['push'](_0x4c5793['shift']());}};_0x5503e2(++_0xc25684);}(_0xf785,0x8c));var _0x5f78=function(_0x112658,_0x3792de){_0x112658=_0x112658-0x0;var _0x1ac5e2=_0xf785[_0x112658];return _0x1ac5e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f78('0x0'));var BPromise=require(_0x5f78('0x1'));var rs=require(_0x5f78('0x2'));var fs=require('fs');var Redis=require(_0x5f78('0x3'));var db=require(_0x5f78('0x4'))['db'];var utils=require(_0x5f78('0x5'));var logger=require(_0x5f78('0x6'))(_0x5f78('0x7'));var config=require(_0x5f78('0x8'));var jayson=require(_0x5f78('0x9'));var client=jayson[_0x5f78('0xa')][_0x5f78('0xb')]({'port':0x232a});config[_0x5f78('0xc')]=_[_0x5f78('0xd')](config['redis'],{'host':_0x5f78('0xe'),'port':0x18eb});var socket=require(_0x5f78('0xf'))(new Redis(config[_0x5f78('0xc')]));require(_0x5f78('0x10'))[_0x5f78('0x11')](socket);function respondWithRpcPromise(_0x3ed5ac,_0x15802c,_0x57fe6d){return new BPromise(function(_0x312ff6,_0x1660be){return client[_0x5f78('0x12')](_0x3ed5ac,_0x57fe6d)['then'](function(_0x153b8b){logger[_0x5f78('0x13')](_0x5f78('0x14'),_0x15802c,'request\x20sent');logger[_0x5f78('0x15')](_0x5f78('0x16'),_0x15802c,_0x5f78('0x17'),JSON[_0x5f78('0x18')](_0x153b8b));if(_0x153b8b[_0x5f78('0x19')]){if(_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1a')]===0x1f4){logger[_0x5f78('0x19')](_0x5f78('0x14'),_0x15802c,_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);return _0x1660be(_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);}logger['error'](_0x5f78('0x14'),_0x15802c,_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);return _0x312ff6(_0x153b8b['error'][_0x5f78('0x1b')]);}else{logger['info'](_0x5f78('0x14'),_0x15802c,_0x5f78('0x17'));_0x312ff6(_0x153b8b[_0x5f78('0x1c')][_0x5f78('0x1b')]);}})[_0x5f78('0x1d')](function(_0x5cf734){logger[_0x5f78('0x19')](_0x5f78('0x14'),_0x15802c,_0x5cf734);_0x1660be(_0x5cf734);});});} \ No newline at end of file +var _0xc4e3=['./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','socket.io-emitter','redis'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xc4e3,0xd2));var _0x3c4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4e3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3c4e('0x0'));var util=require('util');var moment=require(_0x3c4e('0x1'));var BPromise=require(_0x3c4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c4e('0x3'));var db=require(_0x3c4e('0x4'))['db'];var utils=require(_0x3c4e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c4e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3c4e('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c4e('0x8'))(new Redis(config[_0x3c4e('0x9')]));require(_0x3c4e('0xa'))[_0x3c4e('0xb')](socket);function respondWithRpcPromise(_0x2387df,_0x323469,_0x34d65d){return new BPromise(function(_0x4d2238,_0x2047ea){return client['request'](_0x2387df,_0x34d65d)[_0x3c4e('0xc')](function(_0xb61990){logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,_0x3c4e('0xf'));logger[_0x3c4e('0x10')](_0x3c4e('0x11'),_0x323469,_0x3c4e('0xf'),JSON[_0x3c4e('0x12')](_0xb61990));if(_0xb61990[_0x3c4e('0x13')]){if(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x14')]===0x1f4){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0xb61990[_0x3c4e('0x13')]['message']);return _0x2047ea(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x323469,_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);return _0x4d2238(_0xb61990['error']['message']);}else{logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,'request\x20sent');_0x4d2238(_0xb61990['result'][_0x3c4e('0x15')]);}})['catch'](function(_0x4c5a5d){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0x4c5a5d);_0x2047ea(_0x4c5a5d);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fddb542..515bb74 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 _0xdb6e=['register','length','./chatWebsite.events','save','update','emit'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xdb6e,0x1d0));var _0xedb6=function(_0x45515b,_0x1e16a8){_0x45515b=_0x45515b-0x0;var _0x20ed56=_0xdb6e[_0x45515b];return _0x20ed56;};'use strict';var ChatWebsiteEvents=require(_0xedb6('0x0'));var events=[_0xedb6('0x1'),'remove',_0xedb6('0x2')];function createListener(_0x6f60e7,_0x69c088){return function(_0x18f680){_0x69c088[_0xedb6('0x3')](_0x6f60e7,_0x18f680);};}function removeListener(_0x42c542,_0x215bb2){return function(){ChatWebsiteEvents['removeListener'](_0x42c542,_0x215bb2);};}exports[_0xedb6('0x4')]=function(_0x23da33){for(var _0x2ac722=0x0,_0x4b069e=events[_0xedb6('0x5')];_0x2ac722<_0x4b069e;_0x2ac722++){var _0x4ff70d=events[_0x2ac722];var _0x22961c=createListener('chatWebsite:'+_0x4ff70d,_0x23da33);ChatWebsiteEvents['on'](_0x4ff70d,_0x22961c);}}; \ No newline at end of file +var _0xe7a8=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xe7a8,0xa9));var _0x8e7a=function(_0x49f72d,_0x315dc6){_0x49f72d=_0x49f72d-0x0;var _0x4e1123=_0xe7a8[_0x49f72d];return _0x4e1123;};'use strict';var ChatWebsiteEvents=require(_0x8e7a('0x0'));var events=['save',_0x8e7a('0x1'),_0x8e7a('0x2')];function createListener(_0x29bae1,_0x36afd7){return function(_0x5a7b17){_0x36afd7[_0x8e7a('0x3')](_0x29bae1,_0x5a7b17);};}function removeListener(_0x349445,_0x188e1e){return function(){ChatWebsiteEvents[_0x8e7a('0x4')](_0x349445,_0x188e1e);};}exports[_0x8e7a('0x5')]=function(_0x4258c8){for(var _0x27b260=0x0,_0xb7aa39=events['length'];_0x27b260<_0xb7aa39;_0x27b260++){var _0x30bbc0=events[_0x27b260];var _0x13014a=createListener(_0x8e7a('0x6')+_0x30bbc0,_0x4258c8);ChatWebsiteEvents['on'](_0x30bbc0,_0x13014a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 996bbd3..399355c 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 _0x3389=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','now','/:id/avatar','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeAnswers','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition'];(function(_0x3ad2f1,_0x3633b3){var _0x230f36=function(_0x1aef67){while(--_0x1aef67){_0x3ad2f1['push'](_0x3ad2f1['shift']());}};_0x230f36(++_0x3633b3);}(_0x3389,0xec));var _0x9338=function(_0x3dc718,_0x1d85d5){_0x3dc718=_0x3dc718-0x0;var _0x14b3b9=_0x3389[_0x3dc718];return _0x14b3b9;};'use strict';var multer=require(_0x9338('0x0'));var util=require('util');var path=require(_0x9338('0x1'));var timeout=require('connect-timeout');var express=require(_0x9338('0x2'));var router=express[_0x9338('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9338('0x4'));var config=require(_0x9338('0x5'));var controller=require(_0x9338('0x6'));router['get']('/',auth[_0x9338('0x7')](),controller['index']);router[_0x9338('0x8')](_0x9338('0x9'),auth[_0x9338('0x7')](),controller[_0x9338('0xa')]);router[_0x9338('0x8')](_0x9338('0xb'),auth[_0x9338('0x7')](),controller[_0x9338('0xc')]);router[_0x9338('0x8')](_0x9338('0xd'),auth[_0x9338('0x7')](),controller[_0x9338('0xe')]);router[_0x9338('0x8')](_0x9338('0xf'),auth['isAuthenticated'](),controller[_0x9338('0x10')]);router[_0x9338('0x8')](_0x9338('0x11'),controller['getLogo']);router[_0x9338('0x8')]('/:id/avatar',controller[_0x9338('0x12')]);router[_0x9338('0x8')](_0x9338('0x13'),controller[_0x9338('0x14')]);router[_0x9338('0x8')](_0x9338('0x15'),controller[_0x9338('0x16')]);router[_0x9338('0x8')](_0x9338('0x17'),auth[_0x9338('0x7')](),controller[_0x9338('0x18')]);router[_0x9338('0x8')](_0x9338('0x19'),controller['getSnippet']);router[_0x9338('0x8')](_0x9338('0x1a'),auth[_0x9338('0x7')](),controller['getApplications']);router[_0x9338('0x8')](_0x9338('0x1b'),auth[_0x9338('0x7')](),controller['getProactiveActions']);router['get'](_0x9338('0x1c'),controller[_0x9338('0x1d')]);router[_0x9338('0x8')]('/:id/offline_messages',auth[_0x9338('0x7')](),controller[_0x9338('0x1e')]);router[_0x9338('0x8')](_0x9338('0x1f'),auth['isAuthenticated'](),controller[_0x9338('0x20')]);router['post']('/',auth[_0x9338('0x7')](),controller[_0x9338('0x21')]);router[_0x9338('0x22')]('/:id/dispositions',auth[_0x9338('0x7')](),controller[_0x9338('0x23')]);router[_0x9338('0x22')](_0x9338('0xf'),auth[_0x9338('0x7')](),controller[_0x9338('0x24')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x2119c5,_0x4ee21e,_0x376002){_0x376002(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x28')));},'filename':function(_0xca527,_0x120936,_0x3aa7d3){_0x3aa7d3(null,util[_0x9338('0x29')](_0x9338('0x2a'),Date['now'](),_0x120936[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x11'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4452bd,_0x49bd63,_0x2cde9e){_0x2cde9e(null,path[_0x9338('0x26')](config[_0x9338('0x27')],'server/files/images/avatars/'));},'filename':function(_0x276dd6,_0x45b2c8,_0x4b666d){_0x4b666d(null,util['format'](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x45b2c8[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x2f'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller[_0x9338('0x30')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0xc2867f,_0x259ac9,_0x3d63c0){_0x3d63c0(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x31')));},'filename':function(_0x299f5b,_0x45261b,_0x97da0b){_0x97da0b(null,util['format'](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x45261b[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x13'),upload[_0x9338('0x2c')]('file'),controller[_0x9338('0x32')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x2672e4,_0x4d7192,_0x289555){_0x289555(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x31')));},'filename':function(_0x34e401,_0x2848dc,_0x52a73e){_0x52a73e(null,util[_0x9338('0x29')](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x2848dc[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x15'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller[_0x9338('0x33')]);router[_0x9338('0x22')](_0x9338('0x34'),controller[_0x9338('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x1eceb1,_0x2f87ad,_0x2854f3){const _0x319223=path['join'](config[_0x9338('0x27')],_0x9338('0x36'),'attachments',_0x9338('0x37'));fs_extra[_0x9338('0x38')](_0x319223,function(){_0x2854f3(null,_0x319223);});},'filename':function(_0x503744,_0x504c5e,_0x55aca5){const _0x303fbf=_0x504c5e[_0x9338('0x2b')][_0x9338('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x551596=path[_0x9338('0x3a')](_0x303fbf);const _0x5e4f9c=Date[_0x9338('0x2e')]()+'-'+_0x303fbf[_0x9338('0x39')](_0x551596,'')+_0x551596;_0x55aca5(null,_0x5e4f9c);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0x9338('0x3b')]);router['post'](_0x9338('0x17'),auth[_0x9338('0x7')](),controller[_0x9338('0x3c')]);router[_0x9338('0x22')](_0x9338('0x1a'),auth[_0x9338('0x7')](),controller['addApplications']);router[_0x9338('0x22')](_0x9338('0x1b'),auth[_0x9338('0x7')](),controller[_0x9338('0x3d')]);router[_0x9338('0x22')](_0x9338('0x1f'),auth['isAuthenticated'](),controller[_0x9338('0x3e')]);router[_0x9338('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x9338('0x40')]);router[_0x9338('0x41')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x9338('0x41')]('/:id/dispositions',auth[_0x9338('0x7')](),controller['removeDispositions']);router[_0x9338('0x41')]('/:id/canned_answers',auth[_0x9338('0x7')](),controller[_0x9338('0x42')]);router[_0x9338('0x41')](_0x9338('0x1f'),auth[_0x9338('0x7')](),controller['removeAgents']);module[_0x9338('0x43')]=router; \ No newline at end of file +var _0x7245=['get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getLogo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','diskStorage','root','/:id/customer_avatar','addSystemAvatar','notify','server/files','attachments','ensureDir','extname','replace','/:id/offline','offline','addInteraction','/:id/proactive_actions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x4d9e30,_0x15912b){var _0x4691fb=function(_0x5b7895){while(--_0x5b7895){_0x4d9e30['push'](_0x4d9e30['shift']());}};_0x4691fb(++_0x15912b);}(_0x7245,0x7c));var _0x5724=function(_0x28e781,_0x38485b){_0x28e781=_0x28e781-0x0;var _0x4c4cb5=_0x7245[_0x28e781];return _0x4c4cb5;};'use strict';var multer=require(_0x5724('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5724('0x1'));var express=require(_0x5724('0x2'));var router=express[_0x5724('0x3')]();var fs_extra=require(_0x5724('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5724('0x5'));var controller=require('./chatWebsite.controller');router[_0x5724('0x6')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x8')]);router[_0x5724('0x6')]('/describe',auth[_0x5724('0x7')](),controller[_0x5724('0x9')]);router[_0x5724('0x6')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller['show']);router[_0x5724('0x6')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller[_0x5724('0xc')]);router[_0x5724('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x5724('0x6')]('/:id/logo',controller[_0x5724('0xd')]);router[_0x5724('0x6')]('/:id/avatar',controller[_0x5724('0xe')]);router[_0x5724('0x6')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x5724('0x6')](_0x5724('0xf'),controller[_0x5724('0x10')]);router[_0x5724('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x5724('0x11'),controller[_0x5724('0x12')]);router[_0x5724('0x6')](_0x5724('0x13'),auth[_0x5724('0x7')](),controller[_0x5724('0x14')]);router['get']('/:id/proactive_actions',auth[_0x5724('0x7')](),controller[_0x5724('0x15')]);router['get'](_0x5724('0x16'),controller[_0x5724('0x17')]);router[_0x5724('0x6')](_0x5724('0x18'),auth[_0x5724('0x7')](),controller[_0x5724('0x19')]);router['get'](_0x5724('0x1a'),auth['isAuthenticated'](),controller[_0x5724('0x1b')]);router[_0x5724('0x1c')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x1d')]);router[_0x5724('0x1c')](_0x5724('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ac7fa,_0x1989bb,_0x20ebec){_0x20ebec(null,path[_0x5724('0x20')](config['root'],_0x5724('0x21')));},'filename':function(_0x4fed71,_0x2b205c,_0x4ca2ea){_0x4ca2ea(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x2b205c[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x26'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d5cbc,_0x366d1f,_0x590717){_0x590717(null,path[_0x5724('0x20')](config['root'],_0x5724('0x29')));},'filename':function(_0x2a44a7,_0x547576,_0x3fa6cd){_0x3fa6cd(null,util[_0x5724('0x22')]('%s-%s',Date[_0x5724('0x24')](),_0x547576[_0x5724('0x25')]));}})});router['post'](_0x5724('0x2a'),upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2b')]);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0xa4c325,_0x23d9f9,_0x544817){_0x544817(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x21f2c7,_0x40b07e,_0x57a5e0){_0x57a5e0(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x40b07e[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x2e'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x2e0657,_0x4bd00e,_0x4eb855){_0x4eb855(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x444f52,_0x3ceb27,_0x34b508){_0x34b508(null,util['format'](_0x5724('0x23'),Date['now'](),_0x3ceb27['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2f')]);router['post']('/:id/notify',controller[_0x5724('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x31b5aa,_0x2e8ed3,_0x5165c4){const _0x18e079=path[_0x5724('0x20')](config['root'],_0x5724('0x31'),_0x5724('0x32'),'offline-chat');fs_extra[_0x5724('0x33')](_0x18e079,function(){_0x5165c4(null,_0x18e079);});},'filename':function(_0x42f41c,_0xda964d,_0x4cafc6){const _0x5a4ebe=_0xda964d[_0x5724('0x25')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x551505=path[_0x5724('0x34')](_0x5a4ebe);const _0x58d142=Date[_0x5724('0x24')]()+'-'+_0x5a4ebe[_0x5724('0x35')](_0x551505,'')+_0x551505;_0x4cafc6(null,_0x58d142);}})});router[_0x5724('0x1c')](_0x5724('0x36'),offlineUploadMulter['any'](),controller[_0x5724('0x37')]);router[_0x5724('0x1c')]('/:id/interactions',auth[_0x5724('0x7')](),controller[_0x5724('0x38')]);router['post'](_0x5724('0x13'),auth[_0x5724('0x7')](),controller['addApplications']);router[_0x5724('0x1c')](_0x5724('0x39'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller[_0x5724('0x3a')]);router[_0x5724('0x3b')](_0x5724('0xa'),auth['isAuthenticated'](),controller[_0x5724('0x3c')]);router[_0x5724('0x3d')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller[_0x5724('0x3e')]);router[_0x5724('0x3d')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller['removeDispositions']);router[_0x5724('0x3d')](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x3f')]);router[_0x5724('0x3d')](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller['removeAgents']);module[_0x5724('0x40')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 741b5d0..c185a51 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 _0xf03a=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4df30a,_0x28bd70){var _0x2ac426=function(_0x3dd055){while(--_0x3dd055){_0x4df30a['push'](_0x4df30a['shift']());}};_0x2ac426(++_0x28bd70);}(_0xf03a,0x1a0));var _0xaf03=function(_0x485835,_0x4a0708){_0x485835=_0x485835-0x0;var _0x3e079f=_0xf03a[_0x485835];return _0x3e079f;};'use strict';var Sequelize=require('sequelize');module[_0xaf03('0x0')]={'name':{'type':Sequelize[_0xaf03('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaf03('0x2')](_0xaf03('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaf03('0x1')]},'data2':{'type':Sequelize[_0xaf03('0x1')]}}; \ No newline at end of file +var _0x4453=['STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x53286a,_0x485c92){var _0x5730ff=function(_0x478c81){while(--_0x478c81){_0x53286a['push'](_0x53286a['shift']());}};_0x5730ff(++_0x485c92);}(_0x4453,0x9c));var _0x3445=function(_0x45ff95,_0x4c138e){_0x45ff95=_0x45ff95-0x0;var _0x3ff0a7=_0x4453[_0x45ff95];return _0x3ff0a7;};'use strict';var Sequelize=require(_0x3445('0x0'));module[_0x3445('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3445('0x2')](_0x3445('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3445('0x4')]},'data2':{'type':Sequelize[_0x3445('0x4')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9cec9a5..39a3deb 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x129bd2,_0x4e7e88){var _0x2bc703=function(_0x53abc9){while(--_0x53abc9){_0x129bd2['push'](_0x129bd2['shift']());}};_0x2bc703(++_0x4e7e88);}(_0x7a54,0x106));var _0x47a5=function(_0xa9a3b,_0x5716e2){_0xa9a3b=_0xa9a3b-0x0;var _0x4764eb=_0x7a54[_0xa9a3b];return _0x4764eb;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','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'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5f2f,0x73));var _0xf5f2=function(_0x277ca5,_0x1b1451){_0x277ca5=_0x277ca5-0x0;var _0x48fa84=_0x5f2f[_0x277ca5];return _0x48fa84;};'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')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 3eefa8a..90c6e57 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 _0x8d3c=['rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xc58b4d,_0x6dd26a){var _0x496a98=function(_0x66892f){while(--_0x66892f){_0xc58b4d['push'](_0xc58b4d['shift']());}};_0x496a98(++_0x6dd26a);}(_0x8d3c,0x170));var _0xc8d3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8d3c[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc8d3('0x0'));var util=require(_0xc8d3('0x1'));var logger=require(_0xc8d3('0x2'))('api');var moment=require(_0xc8d3('0x3'));var BPromise=require(_0xc8d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8d3('0x5'));var rimraf=require(_0xc8d3('0x6'));var config=require(_0xc8d3('0x7'));var attributes=require(_0xc8d3('0x8'));module[_0xc8d3('0x9')]=function(_0x249baf,_0x55f8d4){return _0x249baf['define']('CloudProvider',attributes,{'tableName':_0xc8d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1db=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x377924,_0x50bdca){var _0x5ad504=function(_0x220c81){while(--_0x220c81){_0x377924['push'](_0x377924['shift']());}};_0x5ad504(++_0x50bdca);}(_0xd1db,0x13d));var _0xbd1d=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xd1db[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0xbd1d('0x0'));var util=require(_0xbd1d('0x1'));var logger=require(_0xbd1d('0x2'))(_0xbd1d('0x3'));var moment=require('moment');var BPromise=require(_0xbd1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd1d('0x5'));var rimraf=require(_0xbd1d('0x6'));var config=require(_0xbd1d('0x7'));var attributes=require(_0xbd1d('0x8'));module[_0xbd1d('0x9')]=function(_0x542c12,_0x85b70e){return _0x542c12[_0xbd1d('0xa')](_0xbd1d('0xb'),attributes,{'tableName':_0xbd1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 52d2218..96cda6a 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 _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x384ecc,_0x4c4f22){var _0x128066=function(_0x95a905){while(--_0x95a905){_0x384ecc['push'](_0x384ecc['shift']());}};_0x128066(++_0x4c4f22);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x711ac2,_0x4fd7bd){_0x711ac2=_0x711ac2-0x0;var _0x496861=_0xdd4f[_0x711ac2];return _0x496861;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});} \ No newline at end of file +var _0xaa64=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c8be7,_0x5178b2){var _0x15976c=function(_0x3f57f8){while(--_0x3f57f8){_0x5c8be7['push'](_0x5c8be7['shift']());}};_0x15976c(++_0x5178b2);}(_0xaa64,0xf7));var _0x4aa6=function(_0x85d355,_0x546c82){_0x85d355=_0x85d355-0x0;var _0x31057a=_0xaa64[_0x85d355];return _0x31057a;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dd83d,_0x39c4b5,_0x49e174){return new BPromise(function(_0x529c89,_0xee21ba){return client[_0x4aa6('0xb')](_0x7dd83d,_0x49e174)['then'](function(_0x26619c){logger['info'](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));logger[_0x4aa6('0xe')](_0x4aa6('0xf'),_0x39c4b5,'request\x20sent',JSON[_0x4aa6('0x10')](_0x26619c));if(_0x26619c[_0x4aa6('0x11')]){if(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x12')]===0x1f4){logger[_0x4aa6('0x11')](_0x4aa6('0xc'),_0x39c4b5,_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);return _0xee21ba(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}logger['error'](_0x4aa6('0xc'),_0x39c4b5,_0x26619c['error']['message']);return _0x529c89(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0x14')](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));_0x529c89(_0x26619c[_0x4aa6('0x15')][_0x4aa6('0x13')]);}})[_0x4aa6('0x16')](function(_0x530ed0){logger[_0x4aa6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x39c4b5,_0x530ed0);_0xee21ba(_0x530ed0);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 919d303..c78b659 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 _0xa0bf=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x41bfbe,_0x5eebff){var _0x470d5c=function(_0x2bd839){while(--_0x2bd839){_0x41bfbe['push'](_0x41bfbe['shift']());}};_0x470d5c(++_0x5eebff);}(_0xa0bf,0xb6));var _0xfa0b=function(_0x1e3fab,_0x22437a){_0x1e3fab=_0x1e3fab-0x0;var _0x3992f8=_0xa0bf[_0x1e3fab];return _0x3992f8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa0b('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0xfa0b('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xfa0b('0x2'));var controller=require('./cloudProvider.controller');router[_0xfa0b('0x3')]('/',auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x5')]);router[_0xfa0b('0x3')](_0xfa0b('0x6'),auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x7')]);router[_0xfa0b('0x8')]('/',auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x9')]);router['put'](_0xfa0b('0x6'),auth['isAuthenticated'](),controller[_0xfa0b('0xa')]);router[_0xfa0b('0xb')](_0xfa0b('0x6'),auth['isAuthenticated'](),controller[_0xfa0b('0xc')]);module[_0xfa0b('0xd')]=router; \ No newline at end of file +var _0x13ef=['../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x59ece8,_0xc1be9a){var _0x4ae43e=function(_0x32b914){while(--_0x32b914){_0x59ece8['push'](_0x59ece8['shift']());}};_0x4ae43e(++_0xc1be9a);}(_0x13ef,0x19c));var _0xf13e=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x13ef[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0xf13e('0x0'));var util=require(_0xf13e('0x1'));var path=require(_0xf13e('0x2'));var timeout=require(_0xf13e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf13e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf13e('0x5'));var controller=require(_0xf13e('0x6'));router[_0xf13e('0x7')]('/',auth['isAuthenticated'](),controller[_0xf13e('0x8')]);router[_0xf13e('0x7')](_0xf13e('0x9'),auth['isAuthenticated'](),controller[_0xf13e('0xa')]);router['post']('/',auth[_0xf13e('0xb')](),controller['create']);router[_0xf13e('0xc')](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xd')]);router['delete'](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xe')]);module[_0xf13e('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 083d74a..9760542 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 _0x2c0a=['exports','STRING','sequelize'];(function(_0x4a4d36,_0x41ff0d){var _0x339e31=function(_0x2e3c32){while(--_0x2e3c32){_0x4a4d36['push'](_0x4a4d36['shift']());}};_0x339e31(++_0x41ff0d);}(_0x2c0a,0x1a6));var _0xa2c0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x2c0a[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0xa2c0('0x0'));module[_0xa2c0('0x1')]={'name':{'type':Sequelize[_0xa2c0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa2c0('0x2')]},'companyId':{'type':Sequelize[_0xa2c0('0x2')]},'website':{'type':Sequelize[_0xa2c0('0x2')]},'phone':{'type':Sequelize[_0xa2c0('0x2')]},'fax':{'type':Sequelize[_0xa2c0('0x2')]},'type':{'type':Sequelize[_0xa2c0('0x2')]},'street':{'type':Sequelize[_0xa2c0('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa2c0('0x2')]},'country':{'type':Sequelize[_0xa2c0('0x2')]},'email':{'type':Sequelize[_0xa2c0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa2c0('0x2')]},'sStreet':{'type':Sequelize[_0xa2c0('0x2')]},'sPostalCode':{'type':Sequelize[_0xa2c0('0x2')]},'sCity':{'type':Sequelize[_0xa2c0('0x2')]},'sCountry':{'type':Sequelize[_0xa2c0('0x2')]},'description':{'type':Sequelize[_0xa2c0('0x2')]}}; \ No newline at end of file +var _0x7b4a=['STRING','sequelize'];(function(_0x5c44bc,_0x499961){var _0x2ba826=function(_0x49c3df){while(--_0x49c3df){_0x5c44bc['push'](_0x5c44bc['shift']());}};_0x2ba826(++_0x499961);}(_0x7b4a,0x119));var _0xa7b4=function(_0x67ef3d,_0x50f0bd){_0x67ef3d=_0x67ef3d-0x0;var _0x2ef03e=_0x7b4a[_0x67ef3d];return _0x2ef03e;};'use strict';var Sequelize=require(_0xa7b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7b4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa7b4('0x1')]},'companyId':{'type':Sequelize[_0xa7b4('0x1')]},'website':{'type':Sequelize[_0xa7b4('0x1')]},'phone':{'type':Sequelize[_0xa7b4('0x1')]},'fax':{'type':Sequelize[_0xa7b4('0x1')]},'type':{'type':Sequelize[_0xa7b4('0x1')]},'street':{'type':Sequelize[_0xa7b4('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa7b4('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa7b4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa7b4('0x1')]},'sStreet':{'type':Sequelize[_0xa7b4('0x1')]},'sPostalCode':{'type':Sequelize[_0xa7b4('0x1')]},'sCity':{'type':Sequelize[_0xa7b4('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa7b4('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 399c712..7dae7d5 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 _0x1dd6=['ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','index','CmCompany','keys','query','filters','intersection','model','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','include','findAll','catch','params','rawAttributes','fields','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0xfd7b3a,_0x477c00){var _0x1022fa=function(_0x4a3dbe){while(--_0x4a3dbe){_0xfd7b3a['push'](_0xfd7b3a['shift']());}};_0x1022fa(++_0x477c00);}(_0x1dd6,0x13b));var _0x61dd=function(_0x1ab966,_0xf40888){_0x1ab966=_0x1ab966-0x0;var _0x4f209e=_0x1dd6[_0x1ab966];return _0x4f209e;};'use strict';var emlformat=require(_0x61dd('0x0'));var rimraf=require(_0x61dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61dd('0x2'));var rp=require(_0x61dd('0x3'));var moment=require('moment');var BPromise=require(_0x61dd('0x4'));var Mustache=require(_0x61dd('0x5'));var util=require(_0x61dd('0x6'));var path=require(_0x61dd('0x7'));var sox=require('sox');var csv=require(_0x61dd('0x8'));var ejs=require(_0x61dd('0x9'));var fs=require('fs');var fs_extra=require(_0x61dd('0xa'));var _=require(_0x61dd('0xb'));var squel=require('squel');var crypto=require(_0x61dd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x61dd('0x8'));var querystring=require(_0x61dd('0xd'));var Papa=require(_0x61dd('0xe'));var Redis=require('ioredis');var authService=require(_0x61dd('0xf'));var qs=require(_0x61dd('0x10'));var as=require(_0x61dd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x61dd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x61dd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5313a2,_0xbbe503){_0xbbe503=_0xbbe503||0xcc;return function(_0x4f873e){if(_0x4f873e){return _0x5313a2[_0x61dd('0x14')](_0xbbe503);}return _0x5313a2[_0x61dd('0x15')](_0xbbe503)[_0x61dd('0x16')]();};}function respondWithResult(_0x81002e,_0x2c987b){_0x2c987b=_0x2c987b||0xc8;return function(_0x1bccbf){if(_0x1bccbf){return _0x81002e[_0x61dd('0x15')](_0x2c987b)['json'](_0x1bccbf);}};}function respondWithFilteredResult(_0x2892b6,_0x2fefa6){return function(_0x29e0eb){if(_0x29e0eb){var _0x297e57=typeof _0x2fefa6[_0x61dd('0x17')]===_0x61dd('0x18')&&typeof _0x2fefa6[_0x61dd('0x19')]===_0x61dd('0x18');var _0x1853c5=_0x29e0eb['count'];var _0x292bcd=_0x297e57?0x0:_0x2fefa6['offset'];var _0x3b491f=_0x297e57?_0x29e0eb[_0x61dd('0x1a')]:_0x2fefa6[_0x61dd('0x17')]+_0x2fefa6[_0x61dd('0x19')];var _0x1e9ed5;if(_0x3b491f>=_0x1853c5){_0x3b491f=_0x1853c5;_0x1e9ed5=0xc8;}else{_0x1e9ed5=0xce;}_0x2892b6[_0x61dd('0x15')](_0x1e9ed5);return _0x2892b6[_0x61dd('0x1b')]('Content-Range',_0x292bcd+'-'+_0x3b491f+'/'+_0x1853c5)[_0x61dd('0x1c')](_0x29e0eb);}return null;};}function patchUpdates(_0x48ee2c){return function(_0x59d248){try{jsonpatch[_0x61dd('0x1d')](_0x59d248,_0x48ee2c,!![]);}catch(_0xb48197){return BPromise[_0x61dd('0x1e')](_0xb48197);}return _0x59d248[_0x61dd('0x1f')]();};}function saveUpdates(_0x2d03ca,_0x28dda4){return function(_0xb26c04){if(_0xb26c04){return _0xb26c04[_0x61dd('0x20')](_0x2d03ca)[_0x61dd('0x21')](function(_0x1c7ad4){return _0x1c7ad4;});}return null;};}function removeEntity(_0x29eac6,_0x300436){return function(_0xf831c){if(_0xf831c){return _0xf831c[_0x61dd('0x22')]()[_0x61dd('0x21')](function(){var _0x184233=_0xf831c['get']({'plain':!![]});var _0x47007d=_0x61dd('0x23');return db[_0x61dd('0x24')]['destroy']({'where':{'type':_0x47007d,'resourceId':_0x184233['id']}})['then'](function(){return _0xf831c;});})[_0x61dd('0x21')](function(){_0x29eac6[_0x61dd('0x15')](0xcc)[_0x61dd('0x16')]();});}};}function handleEntityNotFound(_0x5ccfe7,_0x410931){return function(_0x7fc35f){if(!_0x7fc35f){_0x5ccfe7[_0x61dd('0x14')](0x194);}return _0x7fc35f;};}function handleError(_0x8b30f0,_0x261820){_0x261820=_0x261820||0x1f4;return function(_0x3ebf32){logger[_0x61dd('0x25')](_0x3ebf32[_0x61dd('0x26')]);if(_0x3ebf32[_0x61dd('0x27')]){delete _0x3ebf32['name'];}_0x8b30f0[_0x61dd('0x15')](_0x261820)['send'](_0x3ebf32);};}exports[_0x61dd('0x28')]=function(_0x1ae1d4,_0x55a538){var _0x158420={},_0x5a198c={},_0x356d2d={'count':0x0,'rows':[]};return db[_0x61dd('0x29')]['describe']()[_0x61dd('0x21')](function(_0x2ce011){_0x5a198c['model']=_[_0x61dd('0x2a')](_0x2ce011);_0x5a198c['query']=_[_0x61dd('0x2a')](_0x1ae1d4[_0x61dd('0x2b')]);_0x5a198c[_0x61dd('0x2c')]=_[_0x61dd('0x2d')](_0x5a198c[_0x61dd('0x2e')],_0x5a198c['query']);_0x158420['attributes']=_[_0x61dd('0x2d')](_0x5a198c['model'],qs['fields'](_0x1ae1d4['query']['fields']));_0x158420['attributes']=_0x158420['attributes'][_0x61dd('0x2f')]?_0x158420[_0x61dd('0x30')]:_0x5a198c[_0x61dd('0x2e')];if(!_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x31')](_0x61dd('0x32'))){_0x158420[_0x61dd('0x19')]=qs[_0x61dd('0x19')](_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x19')]);_0x158420[_0x61dd('0x17')]=qs[_0x61dd('0x17')](_0x1ae1d4[_0x61dd('0x2b')]['offset']);}_0x158420[_0x61dd('0x33')]=qs[_0x61dd('0x34')](_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x34')]);_0x158420[_0x61dd('0x35')]=qs[_0x61dd('0x2c')](_[_0x61dd('0x36')](_0x1ae1d4[_0x61dd('0x2b')],_0x5a198c[_0x61dd('0x2c')]),_0x2ce011);if(_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x37')]){_0x158420['where']=_['merge'](_0x158420[_0x61dd('0x35')],{'$or':_[_0x61dd('0x38')](_0x158420[_0x61dd('0x30')],function(_0x3a44e9){var _0xedaab6={};_0xedaab6[_0x3a44e9]={'$like':'%'+_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x37')]+'%'};return _0xedaab6;})});}_0x158420=_[_0x61dd('0x39')]({},_0x158420,_0x1ae1d4[_0x61dd('0x3a')]);var _0x282aa9={'where':_0x158420[_0x61dd('0x35')]};return db[_0x61dd('0x29')][_0x61dd('0x1a')](_0x282aa9)['then'](function(_0x592db3){_0x356d2d['count']=_0x592db3;if(_0x1ae1d4[_0x61dd('0x2b')]['includeAll']){_0x158420[_0x61dd('0x3b')]=[{'all':!![]}];}return db[_0x61dd('0x29')][_0x61dd('0x3c')](_0x158420);})['then'](function(_0x327302){_0x356d2d['rows']=_0x327302;return _0x356d2d;})[_0x61dd('0x21')](respondWithFilteredResult(_0x55a538,_0x158420))[_0x61dd('0x3d')](handleError(_0x55a538,null));})[_0x61dd('0x3d')](handleError(_0x55a538,null));};exports['show']=function(_0x24a346,_0x412fe8){var _0x242fc3={'raw':![],'where':{'id':_0x24a346[_0x61dd('0x3e')]['id']}},_0xd7eb45={};_0xd7eb45[_0x61dd('0x2e')]=_['keys'](db[_0x61dd('0x29')][_0x61dd('0x3f')]);_0xd7eb45[_0x61dd('0x2b')]=_['keys'](_0x24a346[_0x61dd('0x2b')]);_0xd7eb45['filters']=_[_0x61dd('0x2d')](_0xd7eb45[_0x61dd('0x2e')],_0xd7eb45['query']);_0x242fc3['attributes']=_['intersection'](_0xd7eb45['model'],qs[_0x61dd('0x40')](_0x24a346[_0x61dd('0x2b')][_0x61dd('0x40')]));_0x242fc3[_0x61dd('0x30')]=_0x242fc3[_0x61dd('0x30')]['length']?_0x242fc3['attributes']:_0xd7eb45[_0x61dd('0x2e')];if(_0x24a346['query'][_0x61dd('0x41')]){_0x242fc3['include']=[{'all':!![]}];}_0x242fc3=_[_0x61dd('0x39')]({},_0x242fc3,_0x24a346[_0x61dd('0x3a')]);return db[_0x61dd('0x29')][_0x61dd('0x42')](_0x242fc3)[_0x61dd('0x21')](handleEntityNotFound(_0x412fe8,null))[_0x61dd('0x21')](respondWithResult(_0x412fe8,null))['catch'](handleError(_0x412fe8,null));};exports[_0x61dd('0x43')]=function(_0x5411b7,_0x3fbdb4){return db[_0x61dd('0x29')][_0x61dd('0x43')](_0x5411b7[_0x61dd('0x44')],{})[_0x61dd('0x21')](function(_0x1f9687){var _0x28fa4d=_0x5411b7['user'][_0x61dd('0x45')]({'plain':!![]});if(!_0x28fa4d)throw new Error(_0x61dd('0x46'));if(_0x28fa4d[_0x61dd('0x47')]==='user'){var _0x4bb8ca=_0x1f9687[_0x61dd('0x45')]({'plain':!![]});var _0x4c860b=_0x61dd('0x23');return db[_0x61dd('0x48')][_0x61dd('0x42')]({'where':{'name':_0x4c860b,'userProfileId':_0x28fa4d[_0x61dd('0x49')]},'raw':!![]})['then'](function(_0x9088ff){if(_0x9088ff&&_0x9088ff[_0x61dd('0x4a')]===0x0){return db[_0x61dd('0x24')][_0x61dd('0x43')]({'name':_0x4bb8ca[_0x61dd('0x27')],'resourceId':_0x4bb8ca['id'],'type':_0x9088ff['name'],'sectionId':_0x9088ff['id']},{})[_0x61dd('0x21')](function(){return _0x1f9687;});}else{return _0x1f9687;}})[_0x61dd('0x3d')](function(_0x3b8dd8){logger[_0x61dd('0x25')](_0x61dd('0x4b'),_0x3b8dd8);throw _0x3b8dd8;});}return _0x1f9687;})[_0x61dd('0x21')](respondWithResult(_0x3fbdb4,0xc9))[_0x61dd('0x3d')](handleError(_0x3fbdb4,null));};exports[_0x61dd('0x20')]=function(_0x3cfa9d,_0x481f28){if(_0x3cfa9d[_0x61dd('0x44')]['id']){delete _0x3cfa9d[_0x61dd('0x44')]['id'];}return db[_0x61dd('0x29')][_0x61dd('0x42')]({'where':{'id':_0x3cfa9d['params']['id']}})['then'](handleEntityNotFound(_0x481f28,null))[_0x61dd('0x21')](saveUpdates(_0x3cfa9d['body'],null))[_0x61dd('0x21')](respondWithResult(_0x481f28,null))[_0x61dd('0x3d')](handleError(_0x481f28,null));};exports[_0x61dd('0x22')]=function(_0x1a9951,_0x4d216d){return db[_0x61dd('0x29')][_0x61dd('0x42')]({'where':{'id':_0x1a9951[_0x61dd('0x3e')]['id']}})[_0x61dd('0x21')](handleEntityNotFound(_0x4d216d,null))[_0x61dd('0x21')](removeEntity(_0x4d216d,null))[_0x61dd('0x3d')](handleError(_0x4d216d,null));};exports['describe']=function(_0x16fb6c,_0x5cf6e6){return db[_0x61dd('0x29')][_0x61dd('0x4c')]()[_0x61dd('0x21')](respondWithResult(_0x5cf6e6,null))[_0x61dd('0x3d')](handleError(_0x5cf6e6,null));};exports['addContacts']=function(_0x4e8d77,_0x5ae432,_0x48da4b){return db['CmContact'][_0x61dd('0x42')]({'where':{'id':_0x4e8d77['params']['id']}})[_0x61dd('0x21')](handleEntityNotFound(_0x5ae432,null))[_0x61dd('0x21')](function(_0x1e9f01){if(_0x1e9f01){return _0x1e9f01['addContacts'](_0x4e8d77[_0x61dd('0x44')][_0x61dd('0x4d')],_[_0x61dd('0x4e')](_0x4e8d77[_0x61dd('0x44')],[_0x61dd('0x4d'),'id'])||{});}})[_0x61dd('0x21')](respondWithResult(_0x5ae432,null))[_0x61dd('0x3d')](handleError(_0x5ae432,null));};exports[_0x61dd('0x4f')]=function(_0x274331,_0x2197dc,_0x12a187){var _0x109881={};var _0x55e6b2={};var _0x18601c;var _0x3d1c3e;return db[_0x61dd('0x29')][_0x61dd('0x50')]({'where':{'id':_0x274331[_0x61dd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2197dc,null))[_0x61dd('0x21')](function(_0x3491a8){if(_0x3491a8){_0x18601c=_0x3491a8;_0x55e6b2['model']=_[_0x61dd('0x2a')](db['CmContact'][_0x61dd('0x3f')]);_0x55e6b2['query']=_['keys'](_0x274331[_0x61dd('0x2b')]);_0x55e6b2[_0x61dd('0x2c')]=_[_0x61dd('0x2d')](_0x55e6b2[_0x61dd('0x2e')],_0x55e6b2[_0x61dd('0x2b')]);_0x109881[_0x61dd('0x30')]=_[_0x61dd('0x2d')](_0x55e6b2['model'],qs[_0x61dd('0x40')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x40')]));_0x109881[_0x61dd('0x30')]=_0x109881[_0x61dd('0x30')][_0x61dd('0x2f')]?_0x109881[_0x61dd('0x30')]:_0x55e6b2['model'];_0x109881['order']=qs[_0x61dd('0x34')](_0x274331[_0x61dd('0x2b')]['sort']);_0x109881[_0x61dd('0x35')]=qs[_0x61dd('0x2c')](_[_0x61dd('0x36')](_0x274331['query'],_0x55e6b2[_0x61dd('0x2c')]));if(_0x274331[_0x61dd('0x2b')]['filter']){_0x109881[_0x61dd('0x35')]=_[_0x61dd('0x39')](_0x109881[_0x61dd('0x35')],{'$or':_[_0x61dd('0x38')](_0x109881[_0x61dd('0x30')],function(_0x312139){var _0x2cde4d={};_0x2cde4d[_0x312139]={'$like':'%'+_0x274331[_0x61dd('0x2b')]['filter']+'%'};return _0x2cde4d;})});}_0x109881=_[_0x61dd('0x39')]({},_0x109881,_0x274331[_0x61dd('0x3a')]);return _0x18601c[_0x61dd('0x4f')](_0x109881);}})[_0x61dd('0x21')](function(_0x266b94){if(_0x266b94){_0x3d1c3e=_0x266b94[_0x61dd('0x2f')];if(!_0x274331['query'][_0x61dd('0x31')](_0x61dd('0x32'))){_0x109881['limit']=qs[_0x61dd('0x19')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x19')]);_0x109881[_0x61dd('0x17')]=qs[_0x61dd('0x17')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x17')]);}return _0x18601c[_0x61dd('0x4f')](_0x109881);}})['then'](function(_0x39d70e){if(_0x39d70e){return _0x39d70e?{'count':_0x3d1c3e,'rows':_0x39d70e}:null;}})['then'](respondWithResult(_0x2197dc,null))['catch'](handleError(_0x2197dc,null));}; \ No newline at end of file +var _0xd30c=['hasOwnProperty','order','sort','where','pick','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','options','nolimit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x36c20f,_0x591729){var _0x5a84ad=function(_0x22afd6){while(--_0x22afd6){_0x36c20f['push'](_0x36c20f['shift']());}};_0x5a84ad(++_0x591729);}(_0xd30c,0x12b));var _0xcd30=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd30c[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0xcd30('0x0'));var rimraf=require(_0xcd30('0x1'));var zipdir=require(_0xcd30('0x2'));var jsonpatch=require(_0xcd30('0x3'));var rp=require(_0xcd30('0x4'));var moment=require(_0xcd30('0x5'));var BPromise=require(_0xcd30('0x6'));var Mustache=require(_0xcd30('0x7'));var util=require(_0xcd30('0x8'));var path=require(_0xcd30('0x9'));var sox=require(_0xcd30('0xa'));var csv=require(_0xcd30('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd30('0xc'));var squel=require(_0xcd30('0xd'));var crypto=require(_0xcd30('0xe'));var jsforce=require(_0xcd30('0xf'));var deskjs=require(_0xcd30('0x10'));var toCsv=require(_0xcd30('0xb'));var querystring=require('querystring');var Papa=require(_0xcd30('0x11'));var Redis=require(_0xcd30('0x12'));var authService=require(_0xcd30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcd30('0x14'));var hardwareService=require(_0xcd30('0x15'));var logger=require('../../config/logger')(_0xcd30('0x16'));var utils=require(_0xcd30('0x17'));var config=require(_0xcd30('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd30('0x19'))['db'];function respondWithStatusCode(_0x53297b,_0x254887){_0x254887=_0x254887||0xcc;return function(_0x433ae3){if(_0x433ae3){return _0x53297b[_0xcd30('0x1a')](_0x254887);}return _0x53297b[_0xcd30('0x1b')](_0x254887)[_0xcd30('0x1c')]();};}function respondWithResult(_0x46043b,_0x479e23){_0x479e23=_0x479e23||0xc8;return function(_0x2a45a7){if(_0x2a45a7){return _0x46043b['status'](_0x479e23)[_0xcd30('0x1d')](_0x2a45a7);}};}function respondWithFilteredResult(_0x382bfe,_0x1851de){return function(_0x5d9930){if(_0x5d9930){var _0x142f4c=typeof _0x1851de['offset']===_0xcd30('0x1e')&&typeof _0x1851de['limit']==='undefined';var _0x50202e=_0x5d9930[_0xcd30('0x1f')];var _0x424a17=_0x142f4c?0x0:_0x1851de[_0xcd30('0x20')];var _0x513ce5=_0x142f4c?_0x5d9930[_0xcd30('0x1f')]:_0x1851de[_0xcd30('0x20')]+_0x1851de[_0xcd30('0x21')];var _0x2d9d92;if(_0x513ce5>=_0x50202e){_0x513ce5=_0x50202e;_0x2d9d92=0xc8;}else{_0x2d9d92=0xce;}_0x382bfe[_0xcd30('0x1b')](_0x2d9d92);return _0x382bfe['set'](_0xcd30('0x22'),_0x424a17+'-'+_0x513ce5+'/'+_0x50202e)[_0xcd30('0x1d')](_0x5d9930);}return null;};}function patchUpdates(_0x55a5dd){return function(_0x1e815a){try{jsonpatch[_0xcd30('0x23')](_0x1e815a,_0x55a5dd,!![]);}catch(_0x3b1c26){return BPromise[_0xcd30('0x24')](_0x3b1c26);}return _0x1e815a['save']();};}function saveUpdates(_0x13328e,_0x5a5106){return function(_0x321f7f){if(_0x321f7f){return _0x321f7f['update'](_0x13328e)[_0xcd30('0x25')](function(_0x19c600){return _0x19c600;});}return null;};}function removeEntity(_0xa42147,_0x359fb5){return function(_0x54f6e6){if(_0x54f6e6){return _0x54f6e6[_0xcd30('0x26')]()[_0xcd30('0x25')](function(){var _0x5eb9d4=_0x54f6e6[_0xcd30('0x27')]({'plain':!![]});var _0x129101=_0xcd30('0x28');return db[_0xcd30('0x29')][_0xcd30('0x26')]({'where':{'type':_0x129101,'resourceId':_0x5eb9d4['id']}})[_0xcd30('0x25')](function(){return _0x54f6e6;});})[_0xcd30('0x25')](function(){_0xa42147['status'](0xcc)[_0xcd30('0x1c')]();});}};}function handleEntityNotFound(_0xb5c846,_0x3e20e5){return function(_0x1c238d){if(!_0x1c238d){_0xb5c846[_0xcd30('0x1a')](0x194);}return _0x1c238d;};}function handleError(_0x14887e,_0x5369e3){_0x5369e3=_0x5369e3||0x1f4;return function(_0x582dee){logger[_0xcd30('0x2a')](_0x582dee[_0xcd30('0x2b')]);if(_0x582dee[_0xcd30('0x2c')]){delete _0x582dee[_0xcd30('0x2c')];}_0x14887e['status'](_0x5369e3)[_0xcd30('0x2d')](_0x582dee);};}exports[_0xcd30('0x2e')]=function(_0x415e74,_0x43c4ef){var _0x32b25e={},_0x122921={},_0x4392d4={'count':0x0,'rows':[]};return db[_0xcd30('0x2f')][_0xcd30('0x30')]()[_0xcd30('0x25')](function(_0x1aebf2){_0x122921[_0xcd30('0x31')]=_['keys'](_0x1aebf2);_0x122921[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x415e74['query']);_0x122921[_0xcd30('0x34')]=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],_0x122921[_0xcd30('0x32')]);_0x32b25e['attributes']=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],qs[_0xcd30('0x36')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x36')]));_0x32b25e[_0xcd30('0x37')]=_0x32b25e[_0xcd30('0x37')][_0xcd30('0x38')]?_0x32b25e[_0xcd30('0x37')]:_0x122921[_0xcd30('0x31')];if(!_0x415e74[_0xcd30('0x32')][_0xcd30('0x39')]('nolimit')){_0x32b25e['limit']=qs[_0xcd30('0x21')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x21')]);_0x32b25e['offset']=qs[_0xcd30('0x20')](_0x415e74['query'][_0xcd30('0x20')]);}_0x32b25e[_0xcd30('0x3a')]=qs[_0xcd30('0x3b')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x32b25e[_0xcd30('0x3c')]=qs[_0xcd30('0x34')](_[_0xcd30('0x3d')](_0x415e74['query'],_0x122921[_0xcd30('0x34')]),_0x1aebf2);if(_0x415e74[_0xcd30('0x32')]['filter']){_0x32b25e[_0xcd30('0x3c')]=_['merge'](_0x32b25e[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x32b25e[_0xcd30('0x37')],function(_0x21f6c3){var _0x5e152e={};_0x5e152e[_0x21f6c3]={'$like':'%'+_0x415e74[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x5e152e;})});}_0x32b25e=_['merge']({},_0x32b25e,_0x415e74['options']);var _0x30e17b={'where':_0x32b25e[_0xcd30('0x3c')]};return db[_0xcd30('0x2f')][_0xcd30('0x1f')](_0x30e17b)[_0xcd30('0x25')](function(_0x126bb6){_0x4392d4['count']=_0x126bb6;if(_0x415e74[_0xcd30('0x32')][_0xcd30('0x40')]){_0x32b25e[_0xcd30('0x41')]=[{'all':!![]}];}return db[_0xcd30('0x2f')][_0xcd30('0x42')](_0x32b25e);})[_0xcd30('0x25')](function(_0x70253){_0x4392d4[_0xcd30('0x43')]=_0x70253;return _0x4392d4;})[_0xcd30('0x25')](respondWithFilteredResult(_0x43c4ef,_0x32b25e))[_0xcd30('0x44')](handleError(_0x43c4ef,null));})[_0xcd30('0x44')](handleError(_0x43c4ef,null));};exports[_0xcd30('0x45')]=function(_0x51baa8,_0x42a2ed){var _0x43a1d3={'raw':![],'where':{'id':_0x51baa8[_0xcd30('0x46')]['id']}},_0x4d596c={};_0x4d596c[_0xcd30('0x31')]=_[_0xcd30('0x33')](db['CmCompany'][_0xcd30('0x47')]);_0x4d596c['query']=_[_0xcd30('0x33')](_0x51baa8[_0xcd30('0x32')]);_0x4d596c[_0xcd30('0x34')]=_['intersection'](_0x4d596c['model'],_0x4d596c[_0xcd30('0x32')]);_0x43a1d3[_0xcd30('0x37')]=_['intersection'](_0x4d596c[_0xcd30('0x31')],qs['fields'](_0x51baa8[_0xcd30('0x32')][_0xcd30('0x36')]));_0x43a1d3[_0xcd30('0x37')]=_0x43a1d3['attributes'][_0xcd30('0x38')]?_0x43a1d3[_0xcd30('0x37')]:_0x4d596c[_0xcd30('0x31')];if(_0x51baa8[_0xcd30('0x32')][_0xcd30('0x40')]){_0x43a1d3[_0xcd30('0x41')]=[{'all':!![]}];}_0x43a1d3=_[_0xcd30('0x48')]({},_0x43a1d3,_0x51baa8['options']);return db[_0xcd30('0x2f')][_0xcd30('0x49')](_0x43a1d3)[_0xcd30('0x25')](handleEntityNotFound(_0x42a2ed,null))[_0xcd30('0x25')](respondWithResult(_0x42a2ed,null))['catch'](handleError(_0x42a2ed,null));};exports[_0xcd30('0x4a')]=function(_0x316ace,_0x26f2f6){return db[_0xcd30('0x2f')]['create'](_0x316ace[_0xcd30('0x4b')],{})['then'](function(_0x12c516){var _0x4cf9f1=_0x316ace[_0xcd30('0x4c')][_0xcd30('0x27')]({'plain':!![]});if(!_0x4cf9f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf9f1[_0xcd30('0x4d')]===_0xcd30('0x4c')){var _0x2431ba=_0x12c516['get']({'plain':!![]});var _0x3f104f=_0xcd30('0x28');return db[_0xcd30('0x4e')][_0xcd30('0x49')]({'where':{'name':_0x3f104f,'userProfileId':_0x4cf9f1[_0xcd30('0x4f')]},'raw':!![]})[_0xcd30('0x25')](function(_0x172e96){if(_0x172e96&&_0x172e96[_0xcd30('0x50')]===0x0){return db[_0xcd30('0x29')][_0xcd30('0x4a')]({'name':_0x2431ba['name'],'resourceId':_0x2431ba['id'],'type':_0x172e96[_0xcd30('0x2c')],'sectionId':_0x172e96['id']},{})[_0xcd30('0x25')](function(){return _0x12c516;});}else{return _0x12c516;}})[_0xcd30('0x44')](function(_0x24b114){logger[_0xcd30('0x2a')](_0xcd30('0x51'),_0x24b114);throw _0x24b114;});}return _0x12c516;})[_0xcd30('0x25')](respondWithResult(_0x26f2f6,0xc9))[_0xcd30('0x44')](handleError(_0x26f2f6,null));};exports[_0xcd30('0x52')]=function(_0x28696e,_0x4a4c8f){if(_0x28696e[_0xcd30('0x4b')]['id']){delete _0x28696e[_0xcd30('0x4b')]['id'];}return db[_0xcd30('0x2f')][_0xcd30('0x49')]({'where':{'id':_0x28696e[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a4c8f,null))[_0xcd30('0x25')](saveUpdates(_0x28696e[_0xcd30('0x4b')],null))[_0xcd30('0x25')](respondWithResult(_0x4a4c8f,null))[_0xcd30('0x44')](handleError(_0x4a4c8f,null));};exports[_0xcd30('0x26')]=function(_0x7db9a9,_0x43b8e7){return db['CmCompany'][_0xcd30('0x49')]({'where':{'id':_0x7db9a9[_0xcd30('0x46')]['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x43b8e7,null))[_0xcd30('0x25')](removeEntity(_0x43b8e7,null))[_0xcd30('0x44')](handleError(_0x43b8e7,null));};exports[_0xcd30('0x30')]=function(_0x20d4f1,_0x936c21){return db[_0xcd30('0x2f')]['describe']()['then'](respondWithResult(_0x936c21,null))['catch'](handleError(_0x936c21,null));};exports['addContacts']=function(_0x4244c2,_0x136b49,_0x193302){return db[_0xcd30('0x53')][_0xcd30('0x49')]({'where':{'id':_0x4244c2['params']['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x136b49,null))[_0xcd30('0x25')](function(_0x35fa5a){if(_0x35fa5a){return _0x35fa5a[_0xcd30('0x54')](_0x4244c2[_0xcd30('0x4b')]['ids'],_['omit'](_0x4244c2[_0xcd30('0x4b')],[_0xcd30('0x55'),'id'])||{});}})['then'](respondWithResult(_0x136b49,null))[_0xcd30('0x44')](handleError(_0x136b49,null));};exports['getContacts']=function(_0x560e28,_0x2c6d19,_0x234b5b){var _0x41d6d8={};var _0x30d60a={};var _0x5b74ac;var _0x34b4b9;return db['CmCompany']['findOne']({'where':{'id':_0x560e28[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6d19,null))['then'](function(_0x557dfd){if(_0x557dfd){_0x5b74ac=_0x557dfd;_0x30d60a[_0xcd30('0x31')]=_[_0xcd30('0x33')](db[_0xcd30('0x53')]['rawAttributes']);_0x30d60a[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x560e28[_0xcd30('0x32')]);_0x30d60a['filters']=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],_0x30d60a[_0xcd30('0x32')]);_0x41d6d8[_0xcd30('0x37')]=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],qs['fields'](_0x560e28[_0xcd30('0x32')][_0xcd30('0x36')]));_0x41d6d8[_0xcd30('0x37')]=_0x41d6d8[_0xcd30('0x37')][_0xcd30('0x38')]?_0x41d6d8[_0xcd30('0x37')]:_0x30d60a[_0xcd30('0x31')];_0x41d6d8['order']=qs[_0xcd30('0x3b')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x41d6d8[_0xcd30('0x3c')]=qs['filters'](_[_0xcd30('0x3d')](_0x560e28[_0xcd30('0x32')],_0x30d60a['filters']));if(_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]){_0x41d6d8['where']=_[_0xcd30('0x48')](_0x41d6d8[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x41d6d8[_0xcd30('0x37')],function(_0x429f60){var _0x3a540f={};_0x3a540f[_0x429f60]={'$like':'%'+_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x3a540f;})});}_0x41d6d8=_[_0xcd30('0x48')]({},_0x41d6d8,_0x560e28[_0xcd30('0x56')]);return _0x5b74ac['getContacts'](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x14b0bd){if(_0x14b0bd){_0x34b4b9=_0x14b0bd[_0xcd30('0x38')];if(!_0x560e28[_0xcd30('0x32')][_0xcd30('0x39')](_0xcd30('0x57'))){_0x41d6d8[_0xcd30('0x21')]=qs[_0xcd30('0x21')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x21')]);_0x41d6d8['offset']=qs[_0xcd30('0x20')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x20')]);}return _0x5b74ac[_0xcd30('0x58')](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x31b2e4){if(_0x31b2e4){return _0x31b2e4?{'count':_0x34b4b9,'rows':_0x31b2e4}:null;}})[_0xcd30('0x25')](respondWithResult(_0x2c6d19,null))[_0xcd30('0x44')](handleError(_0x2c6d19,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e0c46b0..63e1219 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 _0x0282=['./cmCompany.attributes','exports','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x139faf,_0x5df434){var _0x11ef81=function(_0x1ab89f){while(--_0x1ab89f){_0x139faf['push'](_0x139faf['shift']());}};_0x11ef81(++_0x5df434);}(_0x0282,0x71));var _0x2028=function(_0x21d299,_0x4067e7){_0x21d299=_0x21d299-0x0;var _0x33a2ed=_0x0282[_0x21d299];return _0x33a2ed;};'use strict';var _=require(_0x2028('0x0'));var util=require(_0x2028('0x1'));var logger=require(_0x2028('0x2'))(_0x2028('0x3'));var moment=require(_0x2028('0x4'));var BPromise=require(_0x2028('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2028('0x6'));var rimraf=require('rimraf');var config=require(_0x2028('0x7'));var attributes=require(_0x2028('0x8'));module[_0x2028('0x9')]=function(_0x519bf3,_0x41ab62){return _0x519bf3['define']('CmCompany',attributes,{'tableName':_0x2028('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f22=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','CmCompany','lodash'];(function(_0x148bb9,_0x284f06){var _0x4a63ae=function(_0x4410ea){while(--_0x4410ea){_0x148bb9['push'](_0x148bb9['shift']());}};_0x4a63ae(++_0x284f06);}(_0x1f22,0x1c2));var _0x21f2=function(_0x2508b5,_0x2a1623){_0x2508b5=_0x2508b5-0x0;var _0x5513c2=_0x1f22[_0x2508b5];return _0x5513c2;};'use strict';var _=require(_0x21f2('0x0'));var util=require(_0x21f2('0x1'));var logger=require(_0x21f2('0x2'))(_0x21f2('0x3'));var moment=require(_0x21f2('0x4'));var BPromise=require(_0x21f2('0x5'));var rp=require(_0x21f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x21f2('0x7'));var attributes=require('./cmCompany.attributes');module[_0x21f2('0x8')]=function(_0x1d91d6,_0x1e5721){return _0x1d91d6[_0x21f2('0x9')](_0x21f2('0xa'),attributes,{'tableName':'cm_companies','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 fc938ee..1ebe682 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 _0x7e61=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result'];(function(_0x4b9d47,_0x1afd37){var _0x3c00cc=function(_0x4d3efe){while(--_0x4d3efe){_0x4b9d47['push'](_0x4b9d47['shift']());}};_0x3c00cc(++_0x1afd37);}(_0x7e61,0x19e));var _0x17e6=function(_0x2d7ba7,_0x3330be){_0x2d7ba7=_0x2d7ba7-0x0;var _0x4cf69a=_0x7e61[_0x2d7ba7];return _0x4cf69a;};'use strict';var _=require(_0x17e6('0x0'));var util=require(_0x17e6('0x1'));var moment=require(_0x17e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x17e6('0x3'));var fs=require('fs');var Redis=require(_0x17e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17e6('0x5'));var logger=require(_0x17e6('0x6'))(_0x17e6('0x7'));var config=require(_0x17e6('0x8'));var jayson=require(_0x17e6('0x9'));var client=jayson[_0x17e6('0xa')][_0x17e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44640f,_0x106572,_0x54f8d0){return new BPromise(function(_0xe82e21,_0x20b080){return client[_0x17e6('0xc')](_0x44640f,_0x54f8d0)[_0x17e6('0xd')](function(_0x3771d9){logger['info']('CmCompany,\x20%s,\x20%s',_0x106572,'request\x20sent');logger['debug'](_0x17e6('0xe'),_0x106572,_0x17e6('0xf'),JSON[_0x17e6('0x10')](_0x3771d9));if(_0x3771d9['error']){if(_0x3771d9[_0x17e6('0x11')][_0x17e6('0x12')]===0x1f4){logger[_0x17e6('0x11')](_0x17e6('0x13'),_0x106572,_0x3771d9['error'][_0x17e6('0x14')]);return _0x20b080(_0x3771d9['error'][_0x17e6('0x14')]);}logger[_0x17e6('0x11')]('CmCompany,\x20%s,\x20%s',_0x106572,_0x3771d9[_0x17e6('0x11')][_0x17e6('0x14')]);return _0xe82e21(_0x3771d9[_0x17e6('0x11')][_0x17e6('0x14')]);}else{logger[_0x17e6('0x15')](_0x17e6('0x13'),_0x106572,_0x17e6('0xf'));_0xe82e21(_0x3771d9[_0x17e6('0x16')][_0x17e6('0x14')]);}})['catch'](function(_0x2b6be0){logger['error'](_0x17e6('0x13'),_0x106572,_0x2b6be0);_0x20b080(_0x2b6be0);});});} \ No newline at end of file +var _0x5c06=['then','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x455fee,_0xdb4e0d){var _0x173acf=function(_0x315af3){while(--_0x315af3){_0x455fee['push'](_0x455fee['shift']());}};_0x173acf(++_0xdb4e0d);}(_0x5c06,0x186));var _0x65c0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5c06[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x65c0('0x0'));var util=require(_0x65c0('0x1'));var moment=require(_0x65c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x65c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65c0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x65c0('0x6'));var client=jayson[_0x65c0('0x7')][_0x65c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ec3d5,_0x2bb547,_0x170f5f){return new BPromise(function(_0x4c3401,_0x1746fc){return client['request'](_0x9ec3d5,_0x170f5f)[_0x65c0('0x9')](function(_0x47ef3f){logger['info']('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x65c0('0xa'));logger['debug'](_0x65c0('0xb'),_0x2bb547,_0x65c0('0xa'),JSON[_0x65c0('0xc')](_0x47ef3f));if(_0x47ef3f[_0x65c0('0xd')]){if(_0x47ef3f['error'][_0x65c0('0xe')]===0x1f4){logger[_0x65c0('0xd')]('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x1746fc(_0x47ef3f['error'][_0x65c0('0xf')]);}logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x4c3401(_0x47ef3f['error'][_0x65c0('0xf')]);}else{logger[_0x65c0('0x11')](_0x65c0('0x10'),_0x2bb547,_0x65c0('0xa'));_0x4c3401(_0x47ef3f[_0x65c0('0x12')][_0x65c0('0xf')]);}})['catch'](function(_0x1b7fb9){logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x1b7fb9);_0x1746fc(_0x1b7fb9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index fb3ee59..bb9873e 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 _0x4aa6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x34de7a,_0x57d22c){var _0xd1c14=function(_0x20c909){while(--_0x20c909){_0x34de7a['push'](_0x34de7a['shift']());}};_0xd1c14(++_0x57d22c);}(_0x4aa6,0x1f0));var _0x64aa=function(_0x35eddc,_0x567c9e){_0x35eddc=_0x35eddc-0x0;var _0x41c4ae=_0x4aa6[_0x35eddc];return _0x41c4ae;};'use strict';var multer=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));var path=require('path');var timeout=require(_0x64aa('0x2'));var express=require('express');var router=express[_0x64aa('0x3')]();var fs_extra=require(_0x64aa('0x4'));var auth=require(_0x64aa('0x5'));var interaction=require(_0x64aa('0x6'));var config=require(_0x64aa('0x7'));var controller=require(_0x64aa('0x8'));router[_0x64aa('0x9')]('/',auth[_0x64aa('0xa')](),controller[_0x64aa('0xb')]);router[_0x64aa('0x9')](_0x64aa('0xc'),auth['isAuthenticated'](),controller[_0x64aa('0xd')]);router['get'](_0x64aa('0xe'),auth[_0x64aa('0xa')](),controller[_0x64aa('0xf')]);router[_0x64aa('0x9')](_0x64aa('0x10'),auth[_0x64aa('0xa')](),controller[_0x64aa('0x11')]);router[_0x64aa('0x12')]('/',auth[_0x64aa('0xa')](),controller[_0x64aa('0x13')]);router[_0x64aa('0x12')](_0x64aa('0x10'),auth['isAuthenticated'](),controller[_0x64aa('0x14')]);router[_0x64aa('0x15')](_0x64aa('0xe'),auth['isAuthenticated'](),controller[_0x64aa('0x16')]);router[_0x64aa('0x17')]('/:id',auth[_0x64aa('0xa')](),controller['destroy']);module[_0x64aa('0x18')]=router; \ No newline at end of file +var _0xbe42=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts'];(function(_0x2877ad,_0x33a482){var _0x33f359=function(_0x1da939){while(--_0x1da939){_0x2877ad['push'](_0x2877ad['shift']());}};_0x33f359(++_0x33a482);}(_0xbe42,0x141));var _0x2be4=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xbe42[_0x367336];return _0x3423a7;};'use strict';var multer=require(_0x2be4('0x0'));var util=require('util');var path=require(_0x2be4('0x1'));var timeout=require(_0x2be4('0x2'));var express=require(_0x2be4('0x3'));var router=express[_0x2be4('0x4')]();var fs_extra=require(_0x2be4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2be4('0x6'));var controller=require(_0x2be4('0x7'));router[_0x2be4('0x8')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0xa')]);router[_0x2be4('0x8')](_0x2be4('0xb'),auth[_0x2be4('0x9')](),controller[_0x2be4('0xc')]);router[_0x2be4('0x8')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller['show']);router['get'](_0x2be4('0xe'),auth['isAuthenticated'](),controller[_0x2be4('0xf')]);router[_0x2be4('0x10')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0x11')]);router[_0x2be4('0x10')](_0x2be4('0xe'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x12')]);router[_0x2be4('0x13')]('/:id',auth[_0x2be4('0x9')](),controller[_0x2be4('0x14')]);router[_0x2be4('0x15')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x16')]);module[_0x2be4('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index c800736..fb89265 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 _0x7771=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1a7b8b,_0xe53a61){var _0x4e55f4=function(_0x22c00b){while(--_0x22c00b){_0x1a7b8b['push'](_0x1a7b8b['shift']());}};_0x4e55f4(++_0xe53a61);}(_0x7771,0x69));var _0x1777=function(_0x44cd28,_0x1502d9){_0x44cd28=_0x44cd28-0x0;var _0x39356e=_0x7771[_0x44cd28];return _0x39356e;};'use strict';var _=require('lodash');var Sequelize=require(_0x1777('0x0'));module[_0x1777('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x1777('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1777('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1777('0x2')]},'mobile':{'type':Sequelize[_0x1777('0x2')]},'fax':{'type':Sequelize[_0x1777('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1777('0x2')]},'facebook':{'type':Sequelize[_0x1777('0x2')]},'fb_data':{'type':Sequelize[_0x1777('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1777('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1777('0x2')]},'line':{'type':Sequelize[_0x1777('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1777('0x3')]},'priority':{'type':Sequelize[_0x1777('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1777('0x4')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x3aa5=['UNSIGNED','lodash','exports','STRING','INTEGER'];(function(_0x448ed3,_0x12fa53){var _0x3b4a07=function(_0x3279d0){while(--_0x3279d0){_0x448ed3['push'](_0x448ed3['shift']());}};_0x3b4a07(++_0x12fa53);}(_0x3aa5,0xc4));var _0x53aa=function(_0x396d43,_0x994f3a){_0x396d43=_0x396d43-0x0;var _0x58c668=_0x3aa5[_0x396d43];return _0x58c668;};'use strict';var _=require(_0x53aa('0x0'));var Sequelize=require('sequelize');module[_0x53aa('0x1')]={'firstName':{'type':Sequelize[_0x53aa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x53aa('0x2')]},'street':{'type':Sequelize[_0x53aa('0x2')]},'postalCode':{'type':Sequelize[_0x53aa('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x53aa('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x53aa('0x2')]},'mobile':{'type':Sequelize[_0x53aa('0x2')]},'fax':{'type':Sequelize[_0x53aa('0x2')]},'email':{'type':Sequelize[_0x53aa('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x53aa('0x2')]},'fb_data':{'type':Sequelize[_0x53aa('0x2')]},'twitter':{'type':Sequelize[_0x53aa('0x2')]},'skype':{'type':Sequelize[_0x53aa('0x2')]},'teams':{'type':Sequelize[_0x53aa('0x2')]},'viber':{'type':Sequelize[_0x53aa('0x2')]},'line':{'type':Sequelize[_0x53aa('0x2')]},'wechat':{'type':Sequelize[_0x53aa('0x2')]},'telegram':{'type':Sequelize[_0x53aa('0x2')]},'UserId':{'type':Sequelize[_0x53aa('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x53aa('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a6bb277..9a2c1a3 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 _0x86c9=['body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','findOrCreate','spread','show','Tags','omit','cf_%d','pickBy','table','setFields','toParam','phone','getTags','findOne','rawAttributes','options','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','startCase','Website','Account','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./cmContact.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','CmContact','describe','keys','length','startsWith','push','CmCustomField','trimStart','cf_','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','split','map','union','User','dateOfBirth','datetime','DATE','buildExpression','type','text','start','isNil','Contact','isEmpty','forEach','ListId','where','concat','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','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.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','user','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','agent','sequelize','toString','keyBy','merge','c.phone','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','params','catch','columnName','displayName','findAll','custom','values'];(function(_0x533ef1,_0x4c37a6){var _0x555ec3=function(_0x359369){while(--_0x359369){_0x533ef1['push'](_0x533ef1['shift']());}};_0x555ec3(++_0x4c37a6);}(_0x86c9,0x89));var _0x986c=function(_0x255737,_0x15e582){_0x255737=_0x255737-0x0;var _0x43b248=_0x86c9[_0x255737];return _0x43b248;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x986c('0x0'));var jsonpatch=require(_0x986c('0x1'));var rp=require(_0x986c('0x2'));var moment=require(_0x986c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x986c('0x4'));var util=require(_0x986c('0x5'));var path=require(_0x986c('0x6'));var sox=require(_0x986c('0x7'));var csv=require(_0x986c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x986c('0x9'));var _=require(_0x986c('0xa'));var squel=require(_0x986c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x986c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x986c('0xd'));var Papa=require(_0x986c('0xe'));var Redis=require('ioredis');var authService=require(_0x986c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x986c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x986c('0x11'))(_0x986c('0x12'));var utils=require(_0x986c('0x13'));var config=require(_0x986c('0x14'));var licenseUtil=require(_0x986c('0x15'));var db=require(_0x986c('0x16'))['db'];config['redis']=_[_0x986c('0x17')](config[_0x986c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x986c('0x19'))(new Redis(config[_0x986c('0x18')]));require(_0x986c('0x1a'))[_0x986c('0x1b')](socket);function respondWithStatusCode(_0x2c8c12,_0x5eba0c){_0x5eba0c=_0x5eba0c||0xcc;return function(_0x25fdd5){if(_0x25fdd5){return _0x2c8c12['sendStatus'](_0x5eba0c);}return _0x2c8c12[_0x986c('0x1c')](_0x5eba0c)[_0x986c('0x1d')]();};}function respondWithResult(_0xe5174e,_0x5c8eca){_0x5c8eca=_0x5c8eca||0xc8;return function(_0x1c1a2d){if(_0x1c1a2d){return _0xe5174e[_0x986c('0x1c')](_0x5c8eca)[_0x986c('0x1e')](_0x1c1a2d);}};}function respondWithFilteredResult(_0x58306f,_0x2db3f1){return function(_0x51d4f6){if(_0x51d4f6){var _0x2216a4=typeof _0x2db3f1[_0x986c('0x1f')]==='undefined'&&typeof _0x2db3f1[_0x986c('0x20')]===_0x986c('0x21');var _0x3e2e69=_0x51d4f6[_0x986c('0x22')];var _0x4a6fc4=_0x2216a4?0x0:_0x2db3f1['offset'];var _0x535dfd=_0x2216a4?_0x51d4f6[_0x986c('0x22')]:_0x2db3f1[_0x986c('0x1f')]+_0x2db3f1[_0x986c('0x20')];var _0x5b25f6;if(_0x535dfd>=_0x3e2e69){_0x535dfd=_0x3e2e69;_0x5b25f6=0xc8;}else{_0x5b25f6=0xce;}_0x58306f[_0x986c('0x1c')](_0x5b25f6);return _0x58306f[_0x986c('0x23')]('Content-Range',_0x4a6fc4+'-'+_0x535dfd+'/'+_0x3e2e69)[_0x986c('0x1e')](_0x51d4f6);}return null;};}function patchUpdates(_0x14a845){return function(_0x3d8d5e){try{jsonpatch[_0x986c('0x24')](_0x3d8d5e,_0x14a845,!![]);}catch(_0x3c1981){return BPromise[_0x986c('0x25')](_0x3c1981);}return _0x3d8d5e[_0x986c('0x26')]();};}function saveUpdates(_0xb09e9e,_0xec3f2c){return function(_0x49228f){if(_0x49228f){return _0x49228f[_0x986c('0x27')](_0xb09e9e)['then'](function(_0x5b912c){return _0x5b912c;});}return null;};}function removeEntity(_0x2d2d04,_0x493054){return function(_0x4a3dda){if(_0x4a3dda){return _0x4a3dda[_0x986c('0x28')]()[_0x986c('0x29')](function(){_0x2d2d04[_0x986c('0x1c')](0xcc)[_0x986c('0x1d')]();});}};}function handleEntityNotFound(_0x3992e4,_0xd14cb0){return function(_0x375b91){if(!_0x375b91){_0x3992e4[_0x986c('0x2a')](0x194);}return _0x375b91;};}function handleError(_0x40de21,_0x46fe5b){_0x46fe5b=_0x46fe5b||0x1f4;return function(_0x57ab75){logger[_0x986c('0x2b')](_0x57ab75['stack']);if(_0x57ab75[_0x986c('0x2c')]){delete _0x57ab75[_0x986c('0x2c')];}_0x40de21[_0x986c('0x1c')](_0x46fe5b)[_0x986c('0x2d')](_0x57ab75);};}exports[_0x986c('0x2e')]=function(_0x14224b,_0x101e1e){var _0x1585cb={},_0x1fe380={},_0x40c113={'count':0x0,'rows':[]};return db[_0x986c('0x2f')][_0x986c('0x30')]()[_0x986c('0x29')](function(_0x264973){var _0x3467d7=[];for(var _0x4e6ca7=0x0;_0x4e6ca70x1){_0x34ded6['or'](_0x986c('0x70'),qs[_0x986c('0x71')](_0x3f9565),null);}else{if(qs[_0x986c('0x72')](_0x3f9565)){_0x34ded6['or'](_0x986c('0x73'),_0x3f9565+'%');_0x34ded6['or'](_0x986c('0x74'),_0x3f9565+'%');_0x34ded6['or'](_0x986c('0x75'),_0x3f9565+'%');_0x34ded6['or']('c.fax\x20LIKE\x20?',_0x3f9565+'%');}else if(qs[_0x986c('0x76')](_0x3f9565)){_0x34ded6['or']('c.email\x20LIKE\x20?',_0x3f9565+'%');}else{_0x34ded6['or'](_0x986c('0x77'),'%'+_0x3f9565+'%');_0x34ded6['or']('c.lastName\x20LIKE\x20?','%'+_0x3f9565+'%');_0x34ded6['or'](_0x986c('0x78'),'%'+_0x3f9565+'%');}}}}_0x40b2b4[_0x986c('0x68')](_0x34ded6);_0x40b2b4[_0x986c('0x79')](_0x986c('0x7a'));var _0x1c9350={'type':db[_0x986c('0x7b')][_0x986c('0x7c')][_0x986c('0x7d')],'raw':!![]};var _0x5a0528=_0x40b2b4[_0x986c('0x7e')]()['field'](_0x986c('0x7a'));if(_0x1585cb[_0x986c('0x42')]){_0x1585cb[_0x986c('0x42')][_0x986c('0x66')](function(_0x563612){_0x40b2b4['order']('c.'+_0x563612[0x0],_0x563612[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x46a443)){_0x40b2b4[_0x986c('0x7f')](_0x48aeb5);_0x5a0528[_0x986c('0x68')](_0x986c('0x80'),_0x46a443);}BPromise['resolve']()[_0x986c('0x29')](function(){if(!_0x5f3405)return;if(_0x14224b[_0x986c('0x81')]['role']!=='agent')return;if(!_[_0x986c('0x82')](_0x5f3405[_0x986c('0x54')],[_0x986c('0x45'),'User'])){return _0x14224b[_0x986c('0x81')][_0x986c('0x83')]({'attributes':['id'],'raw':!![]})[_0x986c('0x29')](function(_0x504422){if(_[_0x986c('0x65')](_0x504422)){_0x5a0528[_0x986c('0x68')](_0x986c('0x84'));_0x40b2b4[_0x986c('0x68')](_0x986c('0x84'));}else{_0x5a0528[_0x986c('0x68')]('c.ListId\x20IN\x20?',_[_0x986c('0x59')](_0x504422,'id'));_0x40b2b4[_0x986c('0x68')](_0x986c('0x85'),_[_0x986c('0x59')](_0x504422,'id'));}});}})[_0x986c('0x29')](function(){if(_0x14224b[_0x986c('0x81')][_0x986c('0x86')]===_0x986c('0x87')&&!_0x5f3405&&!_0x14224b[_0x986c('0x3b')][_0x986c('0x67')])return[];return db[_0x986c('0x88')]['query'](_0x5a0528[_0x986c('0x89')](),_0x1c9350);})[_0x986c('0x29')](function(_0xe1b470){_0x40c113[_0x986c('0x22')]=_0xe1b470[_0x986c('0x32')];if(_0x40c113['count']===0x0)return[];return db[_0x986c('0x88')]['query'](_0x4c62e3[_0x986c('0x89')](),_0x1c9350)[_0x986c('0x29')](function(_0x152683){_0x3bf39a=_[_0x986c('0x8a')](_0x152683,'id');_0x1c9350=_[_0x986c('0x8b')](_0x1c9350,{'model':db[_0x986c('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14224b[_0x986c('0x3b')][_0x986c('0x3f')]){_0x1585cb[_0x986c('0x3e')][_0x986c('0x66')](function(_0x5630c4){_0x40b2b4['field']('c.'+_0x5630c4);});}else{_0x40b2b4[_0x986c('0x45')]('c.id');_0x40b2b4['field']('c.firstName');_0x40b2b4[_0x986c('0x45')]('c.lastName');_0x40b2b4[_0x986c('0x45')](_0x986c('0x8c'));_0x40b2b4[_0x986c('0x45')](_0x986c('0x8d'));_0x40b2b4[_0x986c('0x45')](_0x986c('0x8e'));_0x40b2b4['field'](_0x986c('0x8f'));_0x40b2b4[_0x986c('0x45')](_0x986c('0x90'));_0x40b2b4[_0x986c('0x45')]('c.createdAt');_0x40b2b4[_0x986c('0x45')]('c.deletedAt');_0x40b2b4[_0x986c('0x45')](_0x986c('0x91'));_0x40b2b4[_0x986c('0x45')](_0x986c('0x92'),_0x986c('0x93'));}if(_0x1585cb[_0x986c('0x20')])_0x40b2b4['limit'](_0x1585cb['limit']);if(_0x1585cb[_0x986c('0x1f')])_0x40b2b4['offset'](_0x1585cb[_0x986c('0x1f')]);return db['sequelize'][_0x986c('0x3b')](_0x40b2b4[_0x986c('0x89')](),_0x1c9350);});})['then'](function(_0x3eed74){_0x3eed74[_0x986c('0x66')](function(_0x338d4b){if(_0x338d4b[_0x986c('0x93')]){_0x338d4b['Tags']=[];_0x338d4b[_0x986c('0x93')]['split'](',')[_0x986c('0x66')](function(_0x50e3d9){_0x338d4b['Tags'][_0x986c('0x34')](_0x3bf39a[_0x50e3d9]);});}delete _0x338d4b['TagIds'];});_0x40c113[_0x986c('0x94')]=_0x3eed74;return _0x40c113;})['then'](respondWithFilteredResult(_0x101e1e,_0x1585cb));})['catch'](handleError(_0x101e1e,null));};exports['destroy']=function(_0x3c7f81,_0x5da2b4){return db[_0x986c('0x2f')][_0x986c('0x55')]({'where':{'id':_0x3c7f81[_0x986c('0x95')]['id']}})[_0x986c('0x29')](handleEntityNotFound(_0x5da2b4,null))['then'](removeEntity(_0x5da2b4,null))[_0x986c('0x96')](handleError(_0x5da2b4,null));};exports[_0x986c('0x30')]=function(_0x4af406,_0x3d8c8a){return db['CmContact'][_0x986c('0x30')]()[_0x986c('0x29')](function(_0x6be801){delete _0x6be801['tags'];for(var _0x37b129=0x0;_0x37b129=_0xab4ee1){_0x4d2c41=_0xab4ee1;_0x26c03a=0xc8;}else{_0x26c03a=0xce;}_0x5caa0b[_0xe641('0x1d')](_0x26c03a);return _0x5caa0b[_0xe641('0x23')](_0xe641('0x24'),_0x5ebbdf+'-'+_0x4d2c41+'/'+_0xab4ee1)[_0xe641('0x1e')](_0x242f9d);}return null;};}function patchUpdates(_0x1d3c19){return function(_0x219530){try{jsonpatch[_0xe641('0x25')](_0x219530,_0x1d3c19,!![]);}catch(_0xf591c4){return BPromise[_0xe641('0x26')](_0xf591c4);}return _0x219530['save']();};}function saveUpdates(_0x34b99c,_0x17f50e){return function(_0x1563c3){if(_0x1563c3){return _0x1563c3['update'](_0x34b99c)[_0xe641('0x27')](function(_0x21b71c){return _0x21b71c;});}return null;};}function removeEntity(_0x505f0f,_0x52c1c6){return function(_0xb4232){if(_0xb4232){return _0xb4232[_0xe641('0x28')]()['then'](function(){_0x505f0f[_0xe641('0x1d')](0xcc)[_0xe641('0x29')]();});}};}function handleEntityNotFound(_0x235b51,_0x2faae5){return function(_0x27773c){if(!_0x27773c){_0x235b51[_0xe641('0x1c')](0x194);}return _0x27773c;};}function handleError(_0x349d89,_0x82c992){_0x82c992=_0x82c992||0x1f4;return function(_0x4a3240){logger['error'](_0x4a3240[_0xe641('0x2a')]);if(_0x4a3240[_0xe641('0x2b')]){delete _0x4a3240[_0xe641('0x2b')];}_0x349d89['status'](_0x82c992)[_0xe641('0x2c')](_0x4a3240);};}exports[_0xe641('0x2d')]=function(_0x3c1f31,_0xa4cd05){var _0x3ae56b={},_0x1293f9={},_0x248935={'count':0x0,'rows':[]};return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x581ecf){var _0x2593da=[];for(var _0x21ef0f=0x0;_0x21ef0f0x1){_0x53823b['or'](_0xe641('0x6f'),qs[_0xe641('0x70')](_0x239864),null);}else{if(qs['isNumeric'](_0x239864)){_0x53823b['or'](_0xe641('0x71'),_0x239864+'%');_0x53823b['or'](_0xe641('0x72'),_0x239864+'%');_0x53823b['or']('c.mobile\x20LIKE\x20?',_0x239864+'%');_0x53823b['or'](_0xe641('0x73'),_0x239864+'%');}else if(qs['isEmail'](_0x239864)){_0x53823b['or'](_0xe641('0x74'),_0x239864+'%');}else{_0x53823b['or'](_0xe641('0x75'),'%'+_0x239864+'%');_0x53823b['or'](_0xe641('0x76'),'%'+_0x239864+'%');_0x53823b['or'](_0xe641('0x74'),'%'+_0x239864+'%');}}}}_0x2aa857[_0xe641('0x42')](_0x53823b);_0x2aa857['group'](_0xe641('0x77'));var _0x470dab={'type':db['Sequelize'][_0xe641('0x78')][_0xe641('0x79')],'raw':!![]};var _0x35cc50=_0x2aa857[_0xe641('0x7a')]()[_0xe641('0x45')](_0xe641('0x77'));if(_0x3ae56b[_0xe641('0x40')]){_0x3ae56b['order'][_0xe641('0x56')](function(_0x38b7ff){_0x2aa857[_0xe641('0x40')]('c.'+_0x38b7ff[0x0],_0x38b7ff[0x1]===_0xe641('0x7b')?![]:!![]);});}if(!_[_0xe641('0x65')](_0x386683)){_0x2aa857[_0xe641('0x7c')](_0xeb791);_0x35cc50[_0xe641('0x42')](_0xe641('0x7d'),_0x386683);}BPromise[_0xe641('0x7e')]()[_0xe641('0x27')](function(){if(!_0x53172d)return;if(_0x3c1f31['user'][_0xe641('0x7f')]!==_0xe641('0x80'))return;if(!_[_0xe641('0x81')](_0x53172d[_0xe641('0x51')],[_0xe641('0x45'),_0xe641('0x59')])){return _0x3c1f31[_0xe641('0x82')][_0xe641('0x83')]({'attributes':['id'],'raw':!![]})[_0xe641('0x27')](function(_0x31d539){if(_[_0xe641('0x65')](_0x31d539)){_0x35cc50[_0xe641('0x42')](_0xe641('0x84'));_0x2aa857['where'](_0xe641('0x84'));}else{_0x35cc50[_0xe641('0x42')](_0xe641('0x67'),_[_0xe641('0x55')](_0x31d539,'id'));_0x2aa857['where'](_0xe641('0x67'),_[_0xe641('0x55')](_0x31d539,'id'));}});}})[_0xe641('0x27')](function(){if(_0x3c1f31[_0xe641('0x82')]['role']===_0xe641('0x80')&&!_0x53172d&&!_0x3c1f31[_0xe641('0x3a')][_0xe641('0x66')])return[];return db[_0xe641('0x85')][_0xe641('0x3a')](_0x35cc50[_0xe641('0x86')](),_0x470dab);})[_0xe641('0x27')](function(_0x35eb15){_0x248935[_0xe641('0x21')]=_0x35eb15['length'];if(_0x248935[_0xe641('0x21')]===0x0)return[];return db[_0xe641('0x85')][_0xe641('0x3a')](_0x539767[_0xe641('0x86')](),_0x470dab)[_0xe641('0x27')](function(_0x8dfda3){_0x19050d=_[_0xe641('0x87')](_0x8dfda3,'id');_0x470dab=_[_0xe641('0x88')](_0x470dab,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c1f31['query'][_0xe641('0x3e')]){_0x3ae56b['attributes'][_0xe641('0x56')](function(_0x2ef626){_0x2aa857[_0xe641('0x45')]('c.'+_0x2ef626);});}else{_0x2aa857['field'](_0xe641('0x77'));_0x2aa857['field'](_0xe641('0x89'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8a'));_0x2aa857['field']('c.phone');_0x2aa857[_0xe641('0x45')]('c.mobile');_0x2aa857[_0xe641('0x45')](_0xe641('0x8b'));_0x2aa857['field'](_0xe641('0x8c'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8d'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8e'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8f'));_0x2aa857[_0xe641('0x45')]('c.CompanyId');_0x2aa857[_0xe641('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe641('0x90'));}if(_0x3ae56b[_0xe641('0x22')])_0x2aa857[_0xe641('0x22')](_0x3ae56b['limit']);if(_0x3ae56b['offset'])_0x2aa857[_0xe641('0x1f')](_0x3ae56b[_0xe641('0x1f')]);return db[_0xe641('0x85')][_0xe641('0x3a')](_0x2aa857[_0xe641('0x86')](),_0x470dab);});})[_0xe641('0x27')](function(_0xf1971b){_0xf1971b['forEach'](function(_0x597c32){if(_0x597c32[_0xe641('0x90')]){_0x597c32[_0xe641('0x91')]=[];_0x597c32[_0xe641('0x90')][_0xe641('0x54')](',')[_0xe641('0x56')](function(_0xca2069){_0x597c32['Tags']['push'](_0x19050d[_0xca2069]);});}delete _0x597c32['TagIds'];});_0x248935[_0xe641('0x92')]=_0xf1971b;return _0x248935;})[_0xe641('0x27')](respondWithFilteredResult(_0xa4cd05,_0x3ae56b));})[_0xe641('0x93')](handleError(_0xa4cd05,null));};exports[_0xe641('0x28')]=function(_0x38cba2,_0x52b46b){return db[_0xe641('0x2e')][_0xe641('0x52')]({'where':{'id':_0x38cba2[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x52b46b,null))[_0xe641('0x27')](removeEntity(_0x52b46b,null))[_0xe641('0x93')](handleError(_0x52b46b,null));};exports[_0xe641('0x2f')]=function(_0x50abce,_0x536c73){return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x339b46){delete _0x339b46[_0xe641('0x95')];for(var _0x3641e7=0x0;_0x3641e7{}\s\\|]/g,'-');_0x1c7e21(null,util[_0xc9e8('0x22')]('%s-%s%s',path['basename'](_0x2474c4['originalname'],path['extname'](_0x2474c4[_0xc9e8('0x20')])),Date[_0xc9e8('0x23')](),path[_0xc9e8('0x24')](_0x2474c4[_0xc9e8('0x20')])));}})});router[_0xc9e8('0x18')](_0xc9e8('0x25'),upload[_0xc9e8('0x26')](_0xc9e8('0x27')),controller[_0xc9e8('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56dc16,_0x1fd863,_0xa4490f){_0xa4490f(null,path['join'](config[_0xc9e8('0x1f')],_0xc9e8('0x29')));},'filename':function(_0x134e1e,_0x12929a,_0x5e55e1){_0x12929a[_0xc9e8('0x20')]=_0x12929a['originalname'][_0xc9e8('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e55e1(null,util[_0xc9e8('0x22')](_0xc9e8('0x2a'),path[_0xc9e8('0x2b')](_0x12929a['originalname'],path['extname'](_0x12929a[_0xc9e8('0x20')])),Date[_0xc9e8('0x23')](),path['extname'](_0x12929a[_0xc9e8('0x20')])));}})});router[_0xc9e8('0x18')](_0xc9e8('0x2c'),upload[_0xc9e8('0x26')](_0xc9e8('0x27')),controller[_0xc9e8('0x2d')]);router[_0xc9e8('0x18')](_0xc9e8('0x2e'),auth[_0xc9e8('0x9')](),controller['import']);router['put'](_0xc9e8('0x2f'),auth[_0xc9e8('0x9')](),controller[_0xc9e8('0x30')]);router['delete'](_0xc9e8('0x2f'),auth[_0xc9e8('0x9')](),controller[_0xc9e8('0x31')]);module[_0xc9e8('0x32')]=router; \ No newline at end of file +var _0x6886=['getHoppers','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','post','merge','bulkCreate','setTags','diskStorage','root','originalname','format','%s-%s%s','basename','extname','now','single','uploadCsv','join','server/files/tmp','file','import','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','show','/:id/tags','getTags','/:id/hoppers'];(function(_0xef0ce4,_0x5c2cba){var _0x4193c3=function(_0x3aebe9){while(--_0x3aebe9){_0xef0ce4['push'](_0xef0ce4['shift']());}};_0x4193c3(++_0x5c2cba);}(_0x6886,0x166));var _0x6688=function(_0x1c7a53,_0x35ed5c){_0x1c7a53=_0x1c7a53-0x0;var _0x5e05d3=_0x6886[_0x1c7a53];return _0x5e05d3;};'use strict';var multer=require(_0x6688('0x0'));var util=require(_0x6688('0x1'));var path=require(_0x6688('0x2'));var timeout=require(_0x6688('0x3'));var express=require('express');var router=express[_0x6688('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6688('0x5'));var interaction=require(_0x6688('0x6'));var config=require(_0x6688('0x7'));var controller=require(_0x6688('0x8'));router['get']('/',auth[_0x6688('0x9')](),controller[_0x6688('0xa')]);router[_0x6688('0xb')](_0x6688('0xc'),auth[_0x6688('0x9')](),controller[_0x6688('0xd')]);router[_0x6688('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6688('0xe')]);router[_0x6688('0xb')](_0x6688('0xf'),auth[_0x6688('0x9')](),controller[_0x6688('0x10')]);router[_0x6688('0xb')](_0x6688('0x11'),auth[_0x6688('0x9')](),controller[_0x6688('0x12')]);router[_0x6688('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x6688('0xb')](_0x6688('0x13'),auth[_0x6688('0x9')](),controller[_0x6688('0x14')]);router[_0x6688('0xb')]('/:id/jscripty_sessions',auth[_0x6688('0x9')](),controller[_0x6688('0x15')]);router[_0x6688('0xb')](_0x6688('0x16'),auth['isAuthenticated'](),controller['getJourney']);router[_0x6688('0x17')]('/merge',auth['isAuthenticated'](),controller[_0x6688('0x18')]);router['post']('/',auth[_0x6688('0x9')](),controller['create']);router[_0x6688('0x17')]('/create_many',auth[_0x6688('0x9')](),controller[_0x6688('0x19')]);router[_0x6688('0x17')](_0x6688('0xf'),auth[_0x6688('0x9')](),controller[_0x6688('0x1a')]);var upload=multer({'storage':multer[_0x6688('0x1b')]({'destination':function(_0x19b58f,_0x18aa7b,_0x203686){_0x203686(null,path['join'](config[_0x6688('0x1c')],'server/files/tmp'));},'filename':function(_0x21da38,_0x53a8f7,_0x494d1a){_0x53a8f7[_0x6688('0x1d')]=_0x53a8f7[_0x6688('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x494d1a(null,util[_0x6688('0x1e')](_0x6688('0x1f'),path[_0x6688('0x20')](_0x53a8f7['originalname'],path[_0x6688('0x21')](_0x53a8f7[_0x6688('0x1d')])),Date[_0x6688('0x22')](),path[_0x6688('0x21')](_0x53a8f7[_0x6688('0x1d')])));}})});router['post']('/csv',upload[_0x6688('0x23')]('file'),controller[_0x6688('0x24')]);var upload=multer({'storage':multer[_0x6688('0x1b')]({'destination':function(_0x2144a5,_0x20eade,_0x381ec2){_0x381ec2(null,path[_0x6688('0x25')](config[_0x6688('0x1c')],_0x6688('0x26')));},'filename':function(_0x180437,_0x524d63,_0x32ae4f){_0x524d63[_0x6688('0x1d')]=_0x524d63[_0x6688('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x32ae4f(null,util[_0x6688('0x1e')](_0x6688('0x1f'),path[_0x6688('0x20')](_0x524d63[_0x6688('0x1d')],path[_0x6688('0x21')](_0x524d63['originalname'])),Date[_0x6688('0x22')](),path[_0x6688('0x21')](_0x524d63[_0x6688('0x1d')])));}})});router['post']('/upload',upload['single'](_0x6688('0x27')),controller['upload']);router[_0x6688('0x17')]('/upload/:id',auth[_0x6688('0x9')](),controller[_0x6688('0x28')]);router[_0x6688('0x29')](_0x6688('0x2a'),auth['isAuthenticated'](),controller[_0x6688('0x2b')]);router[_0x6688('0x2c')](_0x6688('0x2a'),auth[_0x6688('0x9')](),controller[_0x6688('0x2d')]);module[_0x6688('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 033ad9c..218ca56 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 _0x5e35=['exports','STRING','alias','TEXT','getDataValue','select','parse','values','stringify','BOOLEAN','voice','sequelize'];(function(_0x5cc431,_0x3b4679){var _0x495108=function(_0x473dbb){while(--_0x473dbb){_0x5cc431['push'](_0x5cc431['shift']());}};_0x495108(++_0x3b4679);}(_0x5e35,0x77));var _0x55e3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5e35[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x55e3('0x0'));var _=require('lodash');module[_0x55e3('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c71a7){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x55e3('0x2')],'allowNull':![],'set':function(_0x537e96){this['setDataValue'](_0x55e3('0x3'),_0x537e96?_0x537e96:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x55e3('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x55e3('0x4')]('long'),'get':function(){if(this[_0x55e3('0x5')]('type')===_0x55e3('0x6')){return JSON[_0x55e3('0x7')](this['getDataValue'](_0x55e3('0x8')));}else{return this['getDataValue'](_0x55e3('0x8'));}},'set':function(_0x41e712){if(Array['isArray'](_0x41e712)){this['setDataValue'](_0x55e3('0x8'),JSON[_0x55e3('0x9')](_0x41e712));}else{this['setDataValue'](_0x55e3('0x8'),_0x41e712);}}},'required':{'type':Sequelize[_0x55e3('0xa')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x55e3('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x55e3('0xb'))}}; \ No newline at end of file +var _0xb26a=['parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','type','select'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb26a,0x157));var _0xab26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb26a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xab26('0x0'));module['exports']={'name':{'type':Sequelize[_0xab26('0x1')],'get':function(_0x1abb25){return this[_0xab26('0x2')](_0xab26('0x3'));}},'alias':{'type':Sequelize[_0xab26('0x4')],'allowNull':![],'set':function(_0x175997){this[_0xab26('0x5')](_0xab26('0x3'),_0x175997?_0x175997:this[_0xab26('0x2')](_0xab26('0x6')));}},'type':{'type':Sequelize[_0xab26('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xab26('0x2')](_0xab26('0x7'))===_0xab26('0x8')){return JSON[_0xab26('0x9')](this[_0xab26('0x2')](_0xab26('0xa')));}else{return this[_0xab26('0x2')]('values');}},'set':function(_0x223c76){if(Array[_0xab26('0xb')](_0x223c76)){this[_0xab26('0x5')](_0xab26('0xa'),JSON[_0xab26('0xc')](_0x223c76));}else{this['setDataValue'](_0xab26('0xa'),_0x223c76);}}},'required':{'type':Sequelize[_0xab26('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xab26('0xe')](_0xab26('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d5cc53a..1e3d30c 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 _0x98f5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','stack','name','send','CmCustomField','rawAttributes','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','catch','body','params','destroy','sequelize','transaction','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x3fc07e,_0x23af60){var _0x4924e5=function(_0xa23fd0){while(--_0xa23fd0){_0x3fc07e['push'](_0x3fc07e['shift']());}};_0x4924e5(++_0x23af60);}(_0x98f5,0x1ad));var _0x598f=function(_0x4d3cf0,_0x3635ed){_0x4d3cf0=_0x4d3cf0-0x0;var _0x322c85=_0x98f5[_0x4d3cf0];return _0x322c85;};'use strict';var emlformat=require(_0x598f('0x0'));var rimraf=require(_0x598f('0x1'));var zipdir=require(_0x598f('0x2'));var jsonpatch=require(_0x598f('0x3'));var rp=require(_0x598f('0x4'));var moment=require(_0x598f('0x5'));var BPromise=require(_0x598f('0x6'));var Mustache=require(_0x598f('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x598f('0x8'));var ejs=require(_0x598f('0x9'));var fs=require('fs');var fs_extra=require(_0x598f('0xa'));var _=require(_0x598f('0xb'));var squel=require(_0x598f('0xc'));var crypto=require(_0x598f('0xd'));var jsforce=require(_0x598f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x598f('0x8'));var querystring=require(_0x598f('0xf'));var Papa=require(_0x598f('0x10'));var Redis=require(_0x598f('0x11'));var authService=require(_0x598f('0x12'));var qs=require(_0x598f('0x13'));var as=require(_0x598f('0x14'));var hardwareService=require(_0x598f('0x15'));var logger=require(_0x598f('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x598f('0x17'));var licenseUtil=require(_0x598f('0x18'));var db=require(_0x598f('0x19'))['db'];function respondWithStatusCode(_0x5ce246,_0xa7a2e1){_0xa7a2e1=_0xa7a2e1||0xcc;return function(_0x568b38){if(_0x568b38){return _0x5ce246[_0x598f('0x1a')](_0xa7a2e1);}return _0x5ce246[_0x598f('0x1b')](_0xa7a2e1)[_0x598f('0x1c')]();};}function respondWithResult(_0x1f538e,_0x1b73d0){_0x1b73d0=_0x1b73d0||0xc8;return function(_0x3e511d){if(_0x3e511d){return _0x1f538e[_0x598f('0x1b')](_0x1b73d0)['json'](_0x3e511d);}};}function respondWithFilteredResult(_0x38e4c2,_0x27a4ef){return function(_0x496a6b){if(_0x496a6b){var _0xdd4d05=typeof _0x27a4ef[_0x598f('0x1d')]===_0x598f('0x1e')&&typeof _0x27a4ef[_0x598f('0x1f')]==='undefined';var _0x18d163=_0x496a6b[_0x598f('0x20')];var _0x106241=_0xdd4d05?0x0:_0x27a4ef[_0x598f('0x1d')];var _0x3ffc8e=_0xdd4d05?_0x496a6b[_0x598f('0x20')]:_0x27a4ef[_0x598f('0x1d')]+_0x27a4ef[_0x598f('0x1f')];var _0x165e32;if(_0x3ffc8e>=_0x18d163){_0x3ffc8e=_0x18d163;_0x165e32=0xc8;}else{_0x165e32=0xce;}_0x38e4c2[_0x598f('0x1b')](_0x165e32);return _0x38e4c2[_0x598f('0x21')]('Content-Range',_0x106241+'-'+_0x3ffc8e+'/'+_0x18d163)[_0x598f('0x22')](_0x496a6b);}return null;};}function patchUpdates(_0x208b09){return function(_0x128b38){try{jsonpatch[_0x598f('0x23')](_0x128b38,_0x208b09,!![]);}catch(_0x222f96){return BPromise[_0x598f('0x24')](_0x222f96);}return _0x128b38[_0x598f('0x25')]();};}function saveUpdates(_0x454aef,_0x1f71b6){return function(_0x41946){if(_0x41946){return _0x41946[_0x598f('0x26')](_0x454aef)[_0x598f('0x27')](function(_0x296c91){return _0x296c91;});}return null;};}function removeEntity(_0x110249,_0x215ffd){return function(_0x39ed17){if(_0x39ed17){return _0x39ed17['destroy']()['then'](function(){_0x110249['status'](0xcc)[_0x598f('0x1c')]();});}};}function handleEntityNotFound(_0x1b5980,_0x489c27){return function(_0x1a108f){if(!_0x1a108f){_0x1b5980['sendStatus'](0x194);}return _0x1a108f;};}function handleError(_0x3cd5fa,_0x4fa112){_0x4fa112=_0x4fa112||0x1f4;return function(_0x2a1e35){logger['error'](_0x2a1e35[_0x598f('0x28')]);if(_0x2a1e35[_0x598f('0x29')]){delete _0x2a1e35[_0x598f('0x29')];}_0x3cd5fa[_0x598f('0x1b')](_0x4fa112)[_0x598f('0x2a')](_0x2a1e35);};}exports['index']=function(_0x5418b3,_0x4b3b9d){var _0x11a27b={},_0x4f36a0={},_0x2cf48c={'count':0x0,'rows':[]};var _0x247ae8=_['map'](db[_0x598f('0x2b')][_0x598f('0x2c')],function(_0xbb42b){return{'name':_0xbb42b['fieldName'],'type':_0xbb42b[_0x598f('0x2d')][_0x598f('0x2e')]};});_0x4f36a0[_0x598f('0x2f')]=_[_0x598f('0x30')](_[_0x598f('0x31')](_0x247ae8,'name'),[_0x598f('0x29')]);_0x4f36a0[_0x598f('0x32')]=_[_0x598f('0x33')](_0x5418b3[_0x598f('0x32')]);_0x4f36a0[_0x598f('0x34')]=_[_0x598f('0x35')](_0x4f36a0[_0x598f('0x2f')],_0x4f36a0[_0x598f('0x32')]);_0x11a27b[_0x598f('0x36')]=_[_0x598f('0x35')](_0x4f36a0[_0x598f('0x2f')],qs[_0x598f('0x37')](_0x5418b3[_0x598f('0x32')]['fields']));_0x11a27b[_0x598f('0x36')]=_0x11a27b[_0x598f('0x36')][_0x598f('0x38')]?_0x11a27b[_0x598f('0x36')]:_0x4f36a0['model'];if(!_0x5418b3['query'][_0x598f('0x39')]('nolimit')){_0x11a27b[_0x598f('0x1f')]=qs[_0x598f('0x1f')](_0x5418b3[_0x598f('0x32')][_0x598f('0x1f')]);_0x11a27b[_0x598f('0x1d')]=qs['offset'](_0x5418b3[_0x598f('0x32')][_0x598f('0x1d')]);}_0x11a27b['order']=qs[_0x598f('0x3a')](_0x5418b3['query'][_0x598f('0x3a')]);_0x11a27b[_0x598f('0x3b')]=qs[_0x598f('0x34')](_[_0x598f('0x3c')](_0x5418b3['query'],_0x4f36a0[_0x598f('0x34')]),_0x247ae8);if(_0x5418b3[_0x598f('0x32')]['filter']){_0x11a27b[_0x598f('0x3b')]=_[_0x598f('0x3d')](_0x11a27b['where'],{'$or':_['map'](_0x247ae8,function(_0x427853){if(_0x427853['type']!==_0x598f('0x3e')){var _0x39c7cd={};_0x39c7cd[_0x427853[_0x598f('0x29')]]={'$like':'%'+_0x5418b3['query'][_0x598f('0x3f')]+'%'};return _0x39c7cd;}})});}_0x11a27b=_[_0x598f('0x3d')]({},_0x11a27b,_0x5418b3[_0x598f('0x40')]);var _0x5510d7={'where':_0x11a27b['where']};return db[_0x598f('0x2b')]['count'](_0x5510d7)[_0x598f('0x27')](function(_0x1c6fdd){_0x2cf48c[_0x598f('0x20')]=_0x1c6fdd;if(_0x5418b3[_0x598f('0x32')][_0x598f('0x41')]){_0x11a27b['include']=[{'all':!![]}];}return db[_0x598f('0x2b')][_0x598f('0x42')](_0x11a27b);})[_0x598f('0x27')](function(_0x193da1){_0x2cf48c[_0x598f('0x43')]=_0x193da1;return _0x2cf48c;})[_0x598f('0x27')](respondWithFilteredResult(_0x4b3b9d,_0x11a27b))['catch'](handleError(_0x4b3b9d,null));};exports[_0x598f('0x44')]=function(_0x251a64,_0xb936db){var _0x202de3={'raw':!![],'where':{'id':_0x251a64['params']['id']}},_0x319118={};_0x319118[_0x598f('0x2f')]=_[_0x598f('0x33')](db[_0x598f('0x2b')][_0x598f('0x2c')]);_0x319118[_0x598f('0x32')]=_['keys'](_0x251a64[_0x598f('0x32')]);_0x319118[_0x598f('0x34')]=_[_0x598f('0x35')](_0x319118['model'],_0x319118['query']);_0x202de3[_0x598f('0x36')]=_[_0x598f('0x35')](_0x319118[_0x598f('0x2f')],qs[_0x598f('0x37')](_0x251a64['query'][_0x598f('0x37')]));_0x202de3[_0x598f('0x36')]=_0x202de3['attributes'][_0x598f('0x38')]?_0x202de3[_0x598f('0x36')]:_0x319118[_0x598f('0x2f')];if(_0x251a64[_0x598f('0x32')][_0x598f('0x41')]){_0x202de3[_0x598f('0x45')]=[{'all':!![]}];}_0x202de3=_['merge']({},_0x202de3,_0x251a64[_0x598f('0x40')]);return db[_0x598f('0x2b')][_0x598f('0x46')](_0x202de3)[_0x598f('0x27')](handleEntityNotFound(_0xb936db,null))[_0x598f('0x27')](respondWithResult(_0xb936db,null))[_0x598f('0x47')](handleError(_0xb936db,null));};exports[_0x598f('0x26')]=function(_0x5003b4,_0x4ca2fe){if(_0x5003b4[_0x598f('0x48')]['id']){delete _0x5003b4[_0x598f('0x48')]['id'];}return db[_0x598f('0x2b')][_0x598f('0x46')]({'where':{'id':_0x5003b4[_0x598f('0x49')]['id']}})[_0x598f('0x27')](handleEntityNotFound(_0x4ca2fe,null))[_0x598f('0x27')](saveUpdates(_0x5003b4[_0x598f('0x48')],null))['then'](respondWithResult(_0x4ca2fe,null))[_0x598f('0x47')](handleError(_0x4ca2fe,null));};exports[_0x598f('0x4a')]=function(_0x241af2,_0x318501){return db[_0x598f('0x2b')][_0x598f('0x46')]({'where':{'id':_0x241af2[_0x598f('0x49')]['id']}})[_0x598f('0x27')](handleEntityNotFound(_0x318501,null))[_0x598f('0x27')](removeEntity(_0x318501,null))[_0x598f('0x47')](handleError(_0x318501,null));};exports['create']=function(_0x5f46be,_0x34fb79){var _0x59b590;return db[_0x598f('0x4b')][_0x598f('0x4c')](function(_0x3fc39a){return db[_0x598f('0x2b')][_0x598f('0x4d')](_0x5f46be[_0x598f('0x48')],{'transaction':_0x3fc39a})[_0x598f('0x27')](function(_0x1549c4){_0x59b590=_0x1549c4;var _0x4cccf6={'type':db[_0x598f('0x4e')][_0x598f('0x4f')],'transaction':_0x3fc39a};switch(_0x5f46be[_0x598f('0x48')][_0x598f('0x2d')]){case _0x598f('0x50'):_0x4cccf6[_0x598f('0x2d')]=db[_0x598f('0x4e')]['TEXT'];break;case _0x598f('0x51'):_0x4cccf6[_0x598f('0x2d')]=db[_0x598f('0x4e')]['INTEGER'];break;case _0x598f('0x52'):_0x4cccf6[_0x598f('0x2d')]=db[_0x598f('0x4e')][_0x598f('0x53')];_0x4cccf6[_0x598f('0x54')]=![];break;default:}return db[_0x598f('0x4b')][_0x598f('0x55')][_0x598f('0x56')]('cm_contacts',util[_0x598f('0x57')](_0x598f('0x58'),_0x59b590['id']),_0x4cccf6);})[_0x598f('0x27')](function(){return _0x59b590;});})[_0x598f('0x27')](respondWithResult(_0x34fb79,0xc9))[_0x598f('0x47')](handleError(_0x34fb79,null));}; \ No newline at end of file +var _0x47d2=['sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','find','body','sequelize','transaction','create','Sequelize','TEXT','type','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','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','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x47d2,0x11a));var _0x247d=function(_0x216488,_0x454333){_0x216488=_0x216488-0x0;var _0x2e4d5a=_0x47d2[_0x216488];return _0x2e4d5a;};'use strict';var emlformat=require(_0x247d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x247d('0x1'));var rp=require(_0x247d('0x2'));var moment=require(_0x247d('0x3'));var BPromise=require(_0x247d('0x4'));var Mustache=require(_0x247d('0x5'));var util=require(_0x247d('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(_0x247d('0x7'));var _=require(_0x247d('0x8'));var squel=require(_0x247d('0x9'));var crypto=require('crypto');var jsforce=require(_0x247d('0xa'));var deskjs=require(_0x247d('0xb'));var toCsv=require(_0x247d('0xc'));var querystring=require(_0x247d('0xd'));var Papa=require('papaparse');var Redis=require(_0x247d('0xe'));var authService=require(_0x247d('0xf'));var qs=require(_0x247d('0x10'));var as=require(_0x247d('0x11'));var hardwareService=require(_0x247d('0x12'));var logger=require('../../config/logger')(_0x247d('0x13'));var utils=require(_0x247d('0x14'));var config=require(_0x247d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x247d('0x16'))['db'];function respondWithStatusCode(_0x92f7d0,_0x432642){_0x432642=_0x432642||0xcc;return function(_0x4d6319){if(_0x4d6319){return _0x92f7d0[_0x247d('0x17')](_0x432642);}return _0x92f7d0[_0x247d('0x18')](_0x432642)[_0x247d('0x19')]();};}function respondWithResult(_0x514d35,_0x37fef5){_0x37fef5=_0x37fef5||0xc8;return function(_0x2448e2){if(_0x2448e2){return _0x514d35['status'](_0x37fef5)[_0x247d('0x1a')](_0x2448e2);}};}function respondWithFilteredResult(_0x1f3417,_0x1970e8){return function(_0x35d602){if(_0x35d602){var _0x13ba81=typeof _0x1970e8[_0x247d('0x1b')]===_0x247d('0x1c')&&typeof _0x1970e8[_0x247d('0x1d')]===_0x247d('0x1c');var _0x32fffa=_0x35d602[_0x247d('0x1e')];var _0x893ba0=_0x13ba81?0x0:_0x1970e8[_0x247d('0x1b')];var _0xab76e6=_0x13ba81?_0x35d602[_0x247d('0x1e')]:_0x1970e8[_0x247d('0x1b')]+_0x1970e8['limit'];var _0xe2e4b8;if(_0xab76e6>=_0x32fffa){_0xab76e6=_0x32fffa;_0xe2e4b8=0xc8;}else{_0xe2e4b8=0xce;}_0x1f3417[_0x247d('0x18')](_0xe2e4b8);return _0x1f3417[_0x247d('0x1f')](_0x247d('0x20'),_0x893ba0+'-'+_0xab76e6+'/'+_0x32fffa)[_0x247d('0x1a')](_0x35d602);}return null;};}function patchUpdates(_0x14f3c6){return function(_0x3e4ec3){try{jsonpatch['apply'](_0x3e4ec3,_0x14f3c6,!![]);}catch(_0x553ca3){return BPromise[_0x247d('0x21')](_0x553ca3);}return _0x3e4ec3[_0x247d('0x22')]();};}function saveUpdates(_0x90ca8c,_0x158202){return function(_0x2be2c4){if(_0x2be2c4){return _0x2be2c4[_0x247d('0x23')](_0x90ca8c)[_0x247d('0x24')](function(_0x274091){return _0x274091;});}return null;};}function removeEntity(_0x1742f9,_0x289139){return function(_0x4e0137){if(_0x4e0137){return _0x4e0137[_0x247d('0x25')]()[_0x247d('0x24')](function(){_0x1742f9['status'](0xcc)[_0x247d('0x19')]();});}};}function handleEntityNotFound(_0x5b2a20,_0x4f89bc){return function(_0x225db6){if(!_0x225db6){_0x5b2a20[_0x247d('0x17')](0x194);}return _0x225db6;};}function handleError(_0xee821e,_0x58ada8){_0x58ada8=_0x58ada8||0x1f4;return function(_0x1f22aa){logger[_0x247d('0x26')](_0x1f22aa[_0x247d('0x27')]);if(_0x1f22aa[_0x247d('0x28')]){delete _0x1f22aa[_0x247d('0x28')];}_0xee821e['status'](_0x58ada8)['send'](_0x1f22aa);};}exports[_0x247d('0x29')]=function(_0x1e87ef,_0xcc3af8){var _0x51f9d9={},_0x3a944e={},_0x11b622={'count':0x0,'rows':[]};var _0x50d27d=_[_0x247d('0x2a')](db[_0x247d('0x2b')][_0x247d('0x2c')],function(_0x41cabd){return{'name':_0x41cabd['fieldName'],'type':_0x41cabd['type'][_0x247d('0x2d')]};});_0x3a944e[_0x247d('0x2e')]=_[_0x247d('0x2f')](_['map'](_0x50d27d,_0x247d('0x28')),[_0x247d('0x28')]);_0x3a944e[_0x247d('0x30')]=_[_0x247d('0x31')](_0x1e87ef[_0x247d('0x30')]);_0x3a944e[_0x247d('0x32')]=_[_0x247d('0x33')](_0x3a944e[_0x247d('0x2e')],_0x3a944e[_0x247d('0x30')]);_0x51f9d9[_0x247d('0x34')]=_[_0x247d('0x33')](_0x3a944e['model'],qs['fields'](_0x1e87ef['query'][_0x247d('0x35')]));_0x51f9d9[_0x247d('0x34')]=_0x51f9d9[_0x247d('0x34')][_0x247d('0x36')]?_0x51f9d9[_0x247d('0x34')]:_0x3a944e[_0x247d('0x2e')];if(!_0x1e87ef['query'][_0x247d('0x37')](_0x247d('0x38'))){_0x51f9d9[_0x247d('0x1d')]=qs['limit'](_0x1e87ef[_0x247d('0x30')][_0x247d('0x1d')]);_0x51f9d9[_0x247d('0x1b')]=qs[_0x247d('0x1b')](_0x1e87ef[_0x247d('0x30')][_0x247d('0x1b')]);}_0x51f9d9[_0x247d('0x39')]=qs[_0x247d('0x3a')](_0x1e87ef[_0x247d('0x30')][_0x247d('0x3a')]);_0x51f9d9[_0x247d('0x3b')]=qs[_0x247d('0x32')](_[_0x247d('0x3c')](_0x1e87ef[_0x247d('0x30')],_0x3a944e['filters']),_0x50d27d);if(_0x1e87ef[_0x247d('0x30')][_0x247d('0x3d')]){_0x51f9d9[_0x247d('0x3b')]=_['merge'](_0x51f9d9[_0x247d('0x3b')],{'$or':_[_0x247d('0x2a')](_0x50d27d,function(_0x39afc0){if(_0x39afc0['type']!=='VIRTUAL'){var _0x593406={};_0x593406[_0x39afc0[_0x247d('0x28')]]={'$like':'%'+_0x1e87ef['query']['filter']+'%'};return _0x593406;}})});}_0x51f9d9=_[_0x247d('0x3e')]({},_0x51f9d9,_0x1e87ef['options']);var _0x38a396={'where':_0x51f9d9[_0x247d('0x3b')]};return db['CmCustomField'][_0x247d('0x1e')](_0x38a396)[_0x247d('0x24')](function(_0x400de8){_0x11b622['count']=_0x400de8;if(_0x1e87ef[_0x247d('0x30')][_0x247d('0x3f')]){_0x51f9d9[_0x247d('0x40')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x51f9d9);})[_0x247d('0x24')](function(_0x1a310a){_0x11b622[_0x247d('0x41')]=_0x1a310a;return _0x11b622;})[_0x247d('0x24')](respondWithFilteredResult(_0xcc3af8,_0x51f9d9))[_0x247d('0x42')](handleError(_0xcc3af8,null));};exports[_0x247d('0x43')]=function(_0x3e6f60,_0x4df5d4){var _0x24ac3c={'raw':!![],'where':{'id':_0x3e6f60[_0x247d('0x44')]['id']}},_0x4ce6bb={};_0x4ce6bb[_0x247d('0x2e')]=_[_0x247d('0x31')](db[_0x247d('0x2b')][_0x247d('0x2c')]);_0x4ce6bb[_0x247d('0x30')]=_[_0x247d('0x31')](_0x3e6f60['query']);_0x4ce6bb[_0x247d('0x32')]=_[_0x247d('0x33')](_0x4ce6bb[_0x247d('0x2e')],_0x4ce6bb[_0x247d('0x30')]);_0x24ac3c[_0x247d('0x34')]=_['intersection'](_0x4ce6bb['model'],qs[_0x247d('0x35')](_0x3e6f60[_0x247d('0x30')]['fields']));_0x24ac3c[_0x247d('0x34')]=_0x24ac3c[_0x247d('0x34')]['length']?_0x24ac3c[_0x247d('0x34')]:_0x4ce6bb[_0x247d('0x2e')];if(_0x3e6f60[_0x247d('0x30')][_0x247d('0x3f')]){_0x24ac3c['include']=[{'all':!![]}];}_0x24ac3c=_['merge']({},_0x24ac3c,_0x3e6f60['options']);return db[_0x247d('0x2b')]['find'](_0x24ac3c)[_0x247d('0x24')](handleEntityNotFound(_0x4df5d4,null))[_0x247d('0x24')](respondWithResult(_0x4df5d4,null))['catch'](handleError(_0x4df5d4,null));};exports[_0x247d('0x23')]=function(_0x3d6a00,_0x5c5b74){if(_0x3d6a00['body']['id']){delete _0x3d6a00['body']['id'];}return db[_0x247d('0x2b')][_0x247d('0x45')]({'where':{'id':_0x3d6a00[_0x247d('0x44')]['id']}})[_0x247d('0x24')](handleEntityNotFound(_0x5c5b74,null))[_0x247d('0x24')](saveUpdates(_0x3d6a00[_0x247d('0x46')],null))[_0x247d('0x24')](respondWithResult(_0x5c5b74,null))[_0x247d('0x42')](handleError(_0x5c5b74,null));};exports[_0x247d('0x25')]=function(_0xf1224a,_0x19f4c7){return db[_0x247d('0x2b')][_0x247d('0x45')]({'where':{'id':_0xf1224a[_0x247d('0x44')]['id']}})[_0x247d('0x24')](handleEntityNotFound(_0x19f4c7,null))[_0x247d('0x24')](removeEntity(_0x19f4c7,null))[_0x247d('0x42')](handleError(_0x19f4c7,null));};exports['create']=function(_0xe8c4a4,_0x532811){var _0x41894c;return db[_0x247d('0x47')][_0x247d('0x48')](function(_0x38436f){return db['CmCustomField'][_0x247d('0x49')](_0xe8c4a4[_0x247d('0x46')],{'transaction':_0x38436f})[_0x247d('0x24')](function(_0x2cdb7b){_0x41894c=_0x2cdb7b;var _0xbf1cb8={'type':db[_0x247d('0x4a')][_0x247d('0x4b')],'transaction':_0x38436f};switch(_0xe8c4a4[_0x247d('0x46')][_0x247d('0x4c')]){case'text':_0xbf1cb8[_0x247d('0x4c')]=db['Sequelize']['TEXT'];break;case'number':_0xbf1cb8['type']=db[_0x247d('0x4a')][_0x247d('0x4d')];break;case'switch':_0xbf1cb8[_0x247d('0x4c')]=db['Sequelize'][_0x247d('0x4e')];_0xbf1cb8[_0x247d('0x4f')]=![];break;default:}return db[_0x247d('0x47')][_0x247d('0x50')][_0x247d('0x51')](_0x247d('0x52'),util[_0x247d('0x53')](_0x247d('0x54'),_0x41894c['id']),_0xbf1cb8);})['then'](function(){return _0x41894c;});})['then'](respondWithResult(_0x532811,0xc9))['catch'](handleError(_0x532811,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index aadfc47..cf7441d 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 _0x9f06=['bluebird','request-promise','path','exports','define','CmCustomField','lodash','api','moment'];(function(_0x1465d4,_0x2d3d48){var _0x118a84=function(_0x5b95e2){while(--_0x5b95e2){_0x1465d4['push'](_0x1465d4['shift']());}};_0x118a84(++_0x2d3d48);}(_0x9f06,0xcc));var _0x69f0=function(_0x4e55b4,_0xe04754){_0x4e55b4=_0x4e55b4-0x0;var _0x119d97=_0x9f06[_0x4e55b4];return _0x119d97;};'use strict';var _=require(_0x69f0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x69f0('0x1'));var moment=require(_0x69f0('0x2'));var BPromise=require(_0x69f0('0x3'));var rp=require(_0x69f0('0x4'));var fs=require('fs');var path=require(_0x69f0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x69f0('0x6')]=function(_0xa4bd03,_0x44b6eb){return _0xa4bd03[_0x69f0('0x7')](_0x69f0('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdae5=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x27678d,_0x3fec4c){var _0x17d25c=function(_0x50037e){while(--_0x50037e){_0x27678d['push'](_0x27678d['shift']());}};_0x17d25c(++_0x3fec4c);}(_0xdae5,0x1d7));var _0x5dae=function(_0x13d957,_0x5a08e8){_0x13d957=_0x13d957-0x0;var _0x3c36bb=_0xdae5[_0x13d957];return _0x3c36bb;};'use strict';var _=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var logger=require(_0x5dae('0x2'))(_0x5dae('0x3'));var moment=require(_0x5dae('0x4'));var BPromise=require('bluebird');var rp=require(_0x5dae('0x5'));var fs=require('fs');var path=require(_0x5dae('0x6'));var rimraf=require(_0x5dae('0x7'));var config=require(_0x5dae('0x8'));var attributes=require(_0x5dae('0x9'));module[_0x5dae('0xa')]=function(_0x5aeb01,_0x5291be){return _0x5aeb01[_0x5dae('0xb')](_0x5dae('0xc'),attributes,{'tableName':_0x5dae('0xd'),'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 e746445..4a9e87c 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 _0xde77=['CmCustomField,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x447ec5,_0x580a2e){var _0x259996=function(_0x257485){while(--_0x257485){_0x447ec5['push'](_0x447ec5['shift']());}};_0x259996(++_0x580a2e);}(_0xde77,0x76));var _0x7de7=function(_0xdf19bb,_0x2b4cf7){_0xdf19bb=_0xdf19bb-0x0;var _0x25a484=_0xde77[_0xdf19bb];return _0x25a484;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7de7('0x0'));var BPromise=require(_0x7de7('0x1'));var rs=require(_0x7de7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7de7('0x3'))['db'];var utils=require(_0x7de7('0x4'));var logger=require(_0x7de7('0x5'))(_0x7de7('0x6'));var config=require(_0x7de7('0x7'));var jayson=require(_0x7de7('0x8'));var client=jayson[_0x7de7('0x9')][_0x7de7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14fdc0,_0x4cf700,_0xd97789){return new BPromise(function(_0x352997,_0x1493a0){return client[_0x7de7('0xb')](_0x14fdc0,_0xd97789)[_0x7de7('0xc')](function(_0x26ab72){logger['info']('CmCustomField,\x20%s,\x20%s',_0x4cf700,_0x7de7('0xd'));logger[_0x7de7('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x4cf700,_0x7de7('0xd'),JSON[_0x7de7('0xf')](_0x26ab72));if(_0x26ab72[_0x7de7('0x10')]){if(_0x26ab72[_0x7de7('0x10')][_0x7de7('0x11')]===0x1f4){logger[_0x7de7('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4cf700,_0x26ab72[_0x7de7('0x10')][_0x7de7('0x12')]);return _0x1493a0(_0x26ab72['error'][_0x7de7('0x12')]);}logger[_0x7de7('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4cf700,_0x26ab72[_0x7de7('0x10')]['message']);return _0x352997(_0x26ab72[_0x7de7('0x10')][_0x7de7('0x12')]);}else{logger[_0x7de7('0x13')](_0x7de7('0x14'),_0x4cf700,_0x7de7('0xd'));_0x352997(_0x26ab72[_0x7de7('0x15')][_0x7de7('0x12')]);}})[_0x7de7('0x16')](function(_0x4a11f9){logger[_0x7de7('0x10')](_0x7de7('0x14'),_0x4cf700,_0x4a11f9);_0x1493a0(_0x4a11f9);});});} \ No newline at end of file +var _0x4cbd=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4cbd,0x124));var _0xd4cb=function(_0x5eaea8,_0x199282){_0x5eaea8=_0x5eaea8-0x0;var _0x213fef=_0x4cbd[_0x5eaea8];return _0x213fef;};'use strict';var _=require(_0xd4cb('0x0'));var util=require(_0xd4cb('0x1'));var moment=require('moment');var BPromise=require(_0xd4cb('0x2'));var rs=require(_0xd4cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4cb('0x4'))['db'];var utils=require(_0xd4cb('0x5'));var logger=require('../../config/logger')(_0xd4cb('0x6'));var config=require(_0xd4cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd4cb('0x8')][_0xd4cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x63eff,_0x2d8f71,_0x261394){return new BPromise(function(_0x356085,_0xe7a5c9){return client[_0xd4cb('0xa')](_0x63eff,_0x261394)[_0xd4cb('0xb')](function(_0x2f5cd7){logger[_0xd4cb('0xc')](_0xd4cb('0xd'),_0x2d8f71,_0xd4cb('0xe'));logger[_0xd4cb('0xf')](_0xd4cb('0x10'),_0x2d8f71,_0xd4cb('0xe'),JSON[_0xd4cb('0x11')](_0x2f5cd7));if(_0x2f5cd7[_0xd4cb('0x12')]){if(_0x2f5cd7[_0xd4cb('0x12')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2d8f71,_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);return _0xe7a5c9(_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);}logger[_0xd4cb('0x12')](_0xd4cb('0xd'),_0x2d8f71,_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);return _0x356085(_0x2f5cd7['error'][_0xd4cb('0x13')]);}else{logger[_0xd4cb('0xc')](_0xd4cb('0xd'),_0x2d8f71,'request\x20sent');_0x356085(_0x2f5cd7[_0xd4cb('0x14')][_0xd4cb('0x13')]);}})[_0xd4cb('0x15')](function(_0x3e7dd1){logger[_0xd4cb('0x12')](_0xd4cb('0xd'),_0x2d8f71,_0x3e7dd1);_0xe7a5c9(_0x3e7dd1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 299e8ba..3c6b6d8 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 _0x1b07=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0x1b07,0x1ca));var _0x71b0=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x1b07[_0xe1a3a5];return _0x362646;};'use strict';var multer=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var path=require(_0x71b0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x71b0('0x3')]();var fs_extra=require(_0x71b0('0x4'));var auth=require(_0x71b0('0x5'));var interaction=require(_0x71b0('0x6'));var config=require(_0x71b0('0x7'));var controller=require('./cmCustomField.controller');router[_0x71b0('0x8')]('/',auth['isAuthenticated'](),controller[_0x71b0('0x9')]);router[_0x71b0('0x8')](_0x71b0('0xa'),auth['isAuthenticated'](),controller[_0x71b0('0xb')]);router[_0x71b0('0xc')]('/',auth[_0x71b0('0xd')](),controller[_0x71b0('0xe')]);router[_0x71b0('0xf')](_0x71b0('0xa'),auth[_0x71b0('0xd')](),controller[_0x71b0('0x10')]);router[_0x71b0('0x11')](_0x71b0('0xa'),auth[_0x71b0('0xd')](),controller[_0x71b0('0x12')]);module[_0x71b0('0x13')]=router; \ No newline at end of file +var _0x124a=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','show'];(function(_0x146a05,_0x5d03cd){var _0x530410=function(_0x16eb56){while(--_0x16eb56){_0x146a05['push'](_0x146a05['shift']());}};_0x530410(++_0x5d03cd);}(_0x124a,0x171));var _0xa124=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x124a[_0xaf25ae];return _0x49732d;};'use strict';var multer=require(_0xa124('0x0'));var util=require(_0xa124('0x1'));var path=require(_0xa124('0x2'));var timeout=require(_0xa124('0x3'));var express=require(_0xa124('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa124('0x5'));var interaction=require(_0xa124('0x6'));var config=require('../../config/environment');var controller=require(_0xa124('0x7'));router[_0xa124('0x8')]('/',auth[_0xa124('0x9')](),controller['index']);router[_0xa124('0x8')]('/:id',auth[_0xa124('0x9')](),controller[_0xa124('0xa')]);router[_0xa124('0xb')]('/',auth[_0xa124('0x9')](),controller[_0xa124('0xc')]);router[_0xa124('0xd')](_0xa124('0xe'),auth[_0xa124('0x9')](),controller[_0xa124('0xf')]);router[_0xa124('0x10')]('/:id',auth[_0xa124('0x9')](),controller[_0xa124('0x11')]);module[_0xa124('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 549cab2..ff2531e 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 _0xd840=['contactListQueue','moment','sequelize','exports','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x11af45,_0x548c23){var _0x4eea38=function(_0xce8796){while(--_0xce8796){_0x11af45['push'](_0x11af45['shift']());}};_0x4eea38(++_0x548c23);}(_0xd840,0x106));var _0x0d84=function(_0x37b9be,_0x342a7c){_0x37b9be=_0x37b9be-0x0;var _0x3a6d84=_0xd840[_0x37b9be];return _0x3a6d84;};'use strict';var moment=require(_0x0d84('0x0'));var Sequelize=require(_0x0d84('0x1'));module[_0x0d84('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x0d84('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0d84('0x4')](_0x0d84('0x5'))},'countbusyretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0d84('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0d84('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0d84('0x6')],'unique':_0x0d84('0x8')},'ListId':{'type':Sequelize[_0x0d84('0x6')],'unique':_0x0d84('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x0d84('0x6')],'unique':_0x0d84('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0d84('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xece1=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x4aa45e,_0x40cb2d){var _0x1852bc=function(_0x50330c){while(--_0x50330c){_0x4aa45e['push'](_0x4aa45e['shift']());}};_0x1852bc(++_0x40cb2d);}(_0xece1,0x1ad));var _0x1ece=function(_0x1c8f7c,_0x126967){_0x1c8f7c=_0x1c8f7c-0x0;var _0x47e45a=_0xece1[_0x1c8f7c];return _0x47e45a;};'use strict';var moment=require(_0x1ece('0x0'));var Sequelize=require(_0x1ece('0x1'));module[_0x1ece('0x2')]={'phone':{'type':Sequelize[_0x1ece('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x1ece('0x4')](_0x1ece('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x1ece('0x6')](0x2)[_0x1ece('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1ece('0x6')],'unique':_0x1ece('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1ece('0x8')},'UserId':{'type':Sequelize[_0x1ece('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1ece('0x8')},'CampaignId':{'type':Sequelize[_0x1ece('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 3d6fd81..0b3cd89 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 _0x54cd=['limit','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','filters','concat','$and','$or','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$overlap','$contains','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','keys','intersection','length','includeAll','include','find','create','update','body','describe','VoiceQueue','Campaign','VoiceQueueId','omit','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','getVoiceQueues','preview','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','List','outbound','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x468db0,_0x207e60){var _0x2246bf=function(_0x945dee){while(--_0x945dee){_0x468db0['push'](_0x468db0['shift']());}};_0x2246bf(++_0x207e60);}(_0x54cd,0x10a));var _0xd54c=function(_0x50ca88,_0x50d1fc){_0x50ca88=_0x50ca88-0x0;var _0x1b7896=_0x54cd[_0x50ca88];return _0x1b7896;};'use strict';var emlformat=require(_0xd54c('0x0'));var rimraf=require(_0xd54c('0x1'));var zipdir=require(_0xd54c('0x2'));var jsonpatch=require(_0xd54c('0x3'));var rp=require(_0xd54c('0x4'));var moment=require(_0xd54c('0x5'));var BPromise=require(_0xd54c('0x6'));var Mustache=require(_0xd54c('0x7'));var util=require(_0xd54c('0x8'));var path=require('path');var sox=require(_0xd54c('0x9'));var csv=require(_0xd54c('0xa'));var ejs=require(_0xd54c('0xb'));var fs=require('fs');var fs_extra=require(_0xd54c('0xc'));var _=require(_0xd54c('0xd'));var squel=require(_0xd54c('0xe'));var crypto=require(_0xd54c('0xf'));var jsforce=require(_0xd54c('0x10'));var deskjs=require(_0xd54c('0x11'));var toCsv=require(_0xd54c('0xa'));var querystring=require(_0xd54c('0x12'));var Papa=require(_0xd54c('0x13'));var Redis=require(_0xd54c('0x14'));var authService=require(_0xd54c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xd54c('0x16'));var hardwareService=require(_0xd54c('0x17'));var logger=require('../../config/logger')(_0xd54c('0x18'));var utils=require(_0xd54c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd54c('0x1a'));var db=require(_0xd54c('0x1b'))['db'];function respondWithStatusCode(_0x45d6c9,_0x1f3441){_0x1f3441=_0x1f3441||0xcc;return function(_0x495d1d){if(_0x495d1d){return _0x45d6c9['sendStatus'](_0x1f3441);}return _0x45d6c9[_0xd54c('0x1c')](_0x1f3441)[_0xd54c('0x1d')]();};}function respondWithResult(_0x14b3cd,_0x21e1c5){_0x21e1c5=_0x21e1c5||0xc8;return function(_0x17349c){if(_0x17349c){return _0x14b3cd['status'](_0x21e1c5)[_0xd54c('0x1e')](_0x17349c);}};}function respondWithFilteredResult(_0x5365d6,_0x28c613){return function(_0x361e12){if(_0x361e12){var _0xc4ea51=typeof _0x28c613['offset']===_0xd54c('0x1f')&&typeof _0x28c613[_0xd54c('0x20')]===_0xd54c('0x1f');var _0x11f993=_0x361e12[_0xd54c('0x21')];var _0x5825ed=_0xc4ea51?0x0:_0x28c613[_0xd54c('0x22')];var _0x10bd02=_0xc4ea51?_0x361e12[_0xd54c('0x21')]:_0x28c613[_0xd54c('0x22')]+_0x28c613[_0xd54c('0x20')];var _0x27c2f3;if(_0x10bd02>=_0x11f993){_0x10bd02=_0x11f993;_0x27c2f3=0xc8;}else{_0x27c2f3=0xce;}_0x5365d6[_0xd54c('0x1c')](_0x27c2f3);return _0x5365d6['set'](_0xd54c('0x23'),_0x5825ed+'-'+_0x10bd02+'/'+_0x11f993)[_0xd54c('0x1e')](_0x361e12);}return null;};}function patchUpdates(_0x42a7a1){return function(_0x5e6780){try{jsonpatch[_0xd54c('0x24')](_0x5e6780,_0x42a7a1,!![]);}catch(_0x3b4914){return BPromise[_0xd54c('0x25')](_0x3b4914);}return _0x5e6780[_0xd54c('0x26')]();};}function saveUpdates(_0x1c67d9,_0x6e56a7){return function(_0x193fb9){if(_0x193fb9){return _0x193fb9['update'](_0x1c67d9)[_0xd54c('0x27')](function(_0x5746a0){return _0x5746a0;});}return null;};}function removeEntity(_0x4a303a,_0x3a47ff){return function(_0x15e4ad){if(_0x15e4ad){return _0x15e4ad[_0xd54c('0x28')]()[_0xd54c('0x27')](function(){_0x4a303a[_0xd54c('0x1c')](0xcc)[_0xd54c('0x1d')]();});}};}function handleEntityNotFound(_0x5b240f,_0x403c7b){return function(_0x1aa16c){if(!_0x1aa16c){_0x5b240f[_0xd54c('0x29')](0x194);}return _0x1aa16c;};}function handleError(_0x405916,_0xcc5a4a){_0xcc5a4a=_0xcc5a4a||0x1f4;return function(_0x16fc7d){logger[_0xd54c('0x2a')](_0x16fc7d[_0xd54c('0x2b')]);if(_0x16fc7d[_0xd54c('0x2c')]){delete _0x16fc7d[_0xd54c('0x2c')];}_0x405916[_0xd54c('0x1c')](_0xcc5a4a)[_0xd54c('0x2d')](_0x16fc7d);};}exports[_0xd54c('0x2e')]=function(_0x310203,_0x3d907c){var _0x28bf61={},_0x43752d={},_0x1131a5={'count':0x0,'rows':[]};var _0x5e9c89=_[_0xd54c('0x2f')](db[_0xd54c('0x30')][_0xd54c('0x31')],function(_0x47402b){return{'name':_0x47402b[_0xd54c('0x32')],'type':_0x47402b[_0xd54c('0x33')][_0xd54c('0x34')]};});_0x43752d['model']=_[_0xd54c('0x2f')](_0x5e9c89,_0xd54c('0x2c'));_0x43752d[_0xd54c('0x35')]=_['keys'](_0x310203[_0xd54c('0x35')]);_0x43752d[_0xd54c('0x36')]=_['intersection'](_0x43752d['model'],_0x43752d['query']);_0x43752d[_0xd54c('0x36')]=_[_0xd54c('0x37')](_0x43752d[_0xd54c('0x36')],[_0xd54c('0x38'),_0xd54c('0x39'),_0xd54c('0x3a'),_0xd54c('0x3b'),'$lt',_0xd54c('0x3c'),_0xd54c('0x3d'),'$eq',_0xd54c('0x3e'),_0xd54c('0x3f'),_0xd54c('0x40'),'$in',_0xd54c('0x41'),_0xd54c('0x42'),_0xd54c('0x43'),_0xd54c('0x44'),'$notILike',_0xd54c('0x42'),_0xd54c('0x45'),_0xd54c('0x46'),'$contained','$any']);_0x28bf61['attributes']=_['intersection'](_0x43752d[_0xd54c('0x47')],qs[_0xd54c('0x48')](_0x310203[_0xd54c('0x35')]['fields']));_0x28bf61[_0xd54c('0x49')]=_0x28bf61[_0xd54c('0x49')]['length']?_0x28bf61[_0xd54c('0x49')]:_0x43752d[_0xd54c('0x47')];if(!_0x310203['query'][_0xd54c('0x4a')](_0xd54c('0x4b'))){_0x28bf61[_0xd54c('0x20')]=qs[_0xd54c('0x20')](_0x310203[_0xd54c('0x35')][_0xd54c('0x20')]);_0x28bf61['offset']=qs['offset'](_0x310203[_0xd54c('0x35')][_0xd54c('0x22')]);}_0x28bf61[_0xd54c('0x4c')]=qs[_0xd54c('0x4d')](_0x310203[_0xd54c('0x35')][_0xd54c('0x4d')]);_0x28bf61['where']=qs[_0xd54c('0x36')](_['pick'](_0x310203[_0xd54c('0x35')],_0x43752d[_0xd54c('0x36')]),_0x5e9c89);if(_0x310203['query']['filter']){_0x28bf61[_0xd54c('0x4e')]=_['merge'](_0x28bf61[_0xd54c('0x4e')],{'$or':_[_0xd54c('0x2f')](_0x5e9c89,function(_0x596652){if(_0x596652[_0xd54c('0x33')]!=='VIRTUAL'){var _0x5ec4df={};_0x5ec4df[_0x596652[_0xd54c('0x2c')]]={'$like':'%'+_0x310203[_0xd54c('0x35')][_0xd54c('0x4f')]+'%'};return _0x5ec4df;}})});}_0x28bf61=_[_0xd54c('0x50')]({},_0x28bf61,_0x310203[_0xd54c('0x51')]);var _0x318483={'where':_0x28bf61['where']};return db[_0xd54c('0x30')][_0xd54c('0x21')](_0x318483)[_0xd54c('0x27')](function(_0x2e75f7){_0x1131a5[_0xd54c('0x21')]=_0x2e75f7;if(_0x310203['query']['includeAll']){_0x28bf61['include']=[{'all':!![]}];}return db[_0xd54c('0x30')][_0xd54c('0x52')](_0x28bf61);})[_0xd54c('0x27')](function(_0x1ba8ec){_0x1131a5[_0xd54c('0x53')]=_0x1ba8ec;return _0x1131a5;})[_0xd54c('0x27')](respondWithFilteredResult(_0x3d907c,_0x28bf61))[_0xd54c('0x54')](handleError(_0x3d907c,null));};exports[_0xd54c('0x55')]=function(_0x4aad7c,_0x497c4d){var _0x183d4a={'raw':!![],'where':{'id':_0x4aad7c[_0xd54c('0x56')]['id']}},_0x39263f={};_0x39263f[_0xd54c('0x47')]=_[_0xd54c('0x57')](db[_0xd54c('0x30')]['rawAttributes']);_0x39263f[_0xd54c('0x35')]=_[_0xd54c('0x57')](_0x4aad7c['query']);_0x39263f[_0xd54c('0x36')]=_['intersection'](_0x39263f[_0xd54c('0x47')],_0x39263f[_0xd54c('0x35')]);_0x183d4a[_0xd54c('0x49')]=_[_0xd54c('0x58')](_0x39263f[_0xd54c('0x47')],qs['fields'](_0x4aad7c['query'][_0xd54c('0x48')]));_0x183d4a[_0xd54c('0x49')]=_0x183d4a[_0xd54c('0x49')][_0xd54c('0x59')]?_0x183d4a[_0xd54c('0x49')]:_0x39263f[_0xd54c('0x47')];if(_0x4aad7c[_0xd54c('0x35')][_0xd54c('0x5a')]){_0x183d4a[_0xd54c('0x5b')]=[{'all':!![]}];}_0x183d4a=_[_0xd54c('0x50')]({},_0x183d4a,_0x4aad7c['options']);return db[_0xd54c('0x30')][_0xd54c('0x5c')](_0x183d4a)[_0xd54c('0x27')](handleEntityNotFound(_0x497c4d,null))[_0xd54c('0x27')](respondWithResult(_0x497c4d,null))[_0xd54c('0x54')](handleError(_0x497c4d,null));};exports[_0xd54c('0x5d')]=function(_0x3f795c,_0x149731){return db[_0xd54c('0x30')]['create'](_0x3f795c['body'],{})[_0xd54c('0x27')](respondWithResult(_0x149731,0xc9))[_0xd54c('0x54')](handleError(_0x149731,null));};exports[_0xd54c('0x5e')]=function(_0x2e5485,_0x5ac81a){if(_0x2e5485[_0xd54c('0x5f')]['id']){delete _0x2e5485[_0xd54c('0x5f')]['id'];}return db[_0xd54c('0x30')][_0xd54c('0x5c')]({'where':{'id':_0x2e5485[_0xd54c('0x56')]['id']}})[_0xd54c('0x27')](handleEntityNotFound(_0x5ac81a,null))[_0xd54c('0x27')](saveUpdates(_0x2e5485[_0xd54c('0x5f')],null))[_0xd54c('0x27')](respondWithResult(_0x5ac81a,null))[_0xd54c('0x54')](handleError(_0x5ac81a,null));};exports['describe']=function(_0x2a198b,_0x480a48){return db[_0xd54c('0x30')][_0xd54c('0x60')]()['then'](respondWithResult(_0x480a48,null))[_0xd54c('0x54')](handleError(_0x480a48,null));};exports['destroy']=function(_0x4539ca,_0x35cce6){var _0x3495da;return db[_0xd54c('0x30')][_0xd54c('0x5c')]({'where':{'id':_0x4539ca[_0xd54c('0x56')]['id']}})['then'](handleEntityNotFound(_0x35cce6,null))[_0xd54c('0x27')](function(_0x287d1e){if(_0x287d1e){return _0x287d1e[_0xd54c('0x28')]()[_0xd54c('0x27')](function(_0x56f5d2){return _0x56f5d2;});}})[_0xd54c('0x27')](function(_0x19130d){_0x3495da=_0x19130d;if(_0x19130d){if(_0x19130d['VoiceQueueId']||_0x19130d['CampaignId']){return db[_0x19130d['VoiceQueueId']?_0xd54c('0x61'):_0xd54c('0x62')][_0xd54c('0x5c')]({'where':{'id':_0x19130d[_0xd54c('0x63')]?_0x19130d['VoiceQueueId']:_0x19130d['CampaignId']},'attributes':['id',_0xd54c('0x2c')],'raw':!![]});}}})[_0xd54c('0x27')](function(_0x10089b){var _0xf0b155={};if(_0x10089b){_[_0xd54c('0x50')](_0xf0b155,_[_0xd54c('0x64')](_0x3495da['dataValues'],[_0xd54c('0x65'),_0xd54c('0x66'),'id']));_0xf0b155[_0xd54c('0x67')]=0x15;_0xf0b155[_0xd54c('0x68')]=_0xd54c('0x69');_0xf0b155['campaign']=_0x10089b[_0xd54c('0x2c')];_0xf0b155[_0xd54c('0x6a')]=_0x4539ca[_0xd54c('0x6b')][_0xd54c('0x2c')];_0xf0b155[_0xd54c('0x6c')]=_0x4539ca['user']['id'];_0xf0b155[_0xd54c('0x69')]=!![];_0xf0b155[_0xd54c('0x6d')]=moment()[_0xd54c('0x6e')](_0xd54c('0x6f'));_0xf0b155[_0xd54c('0x70')]=_0x3495da[_0xd54c('0x71')];_0xf0b155[_0xd54c('0x72')]=_0x3495da[_0xd54c('0x63')]?'queue':_0xd54c('0x73');return db[_0xd54c('0x74')]['find']({'where':{'id':_0xf0b155[_0xd54c('0x75')]},'attributes':['firstName',_0xd54c('0x76')]})[_0xd54c('0x27')](function(_0x42ef83){if(!_['isNil'](_0x35cce6)&&!_[_0xd54c('0x77')](_0x42ef83[_0xd54c('0x78')])){_0xf0b155['calleridname']=_0x42ef83[_0xd54c('0x78')];if(!_[_0xd54c('0x77')](_0x42ef83[_0xd54c('0x76')])){_0xf0b155[_0xd54c('0x79')]+='\x20'+_0x42ef83[_0xd54c('0x76')];}}})[_0xd54c('0x7a')](function(){return db['CmHopperFinal']['create'](_0xf0b155);});}})[_0xd54c('0x27')](function(){return _0x35cce6['status'](0xcc)[_0xd54c('0x1d')]();})[_0xd54c('0x54')](handleError(_0x35cce6,null));};exports[_0xd54c('0x7b')]=function(_0x5f0e9a,_0xed47c9,_0x4dc73d){var _0x3d5980=[];return db[_0xd54c('0x74')][_0xd54c('0x60')]()[_0xd54c('0x27')](function(_0x59ba48){_0x3d5980=_[_0xd54c('0x57')](_0x59ba48);return _0x5f0e9a['user'][_0xd54c('0x7c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xd54c('0x7d')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x4ac15b){if(_0x4ac15b&&_0x4ac15b[_0xd54c('0x59')]){return db[_0xd54c('0x7e')]['transaction'](function(_0xc2664f){var _0x36ed89={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd54c('0x6e')](_0xd54c('0x6f'))},'VoiceQueueId':{'$in':_[_0xd54c('0x2f')](_0x4ac15b,'id')},'$or':[{'UserId':null},{'UserId':_0x5f0e9a[_0xd54c('0x6b')]['id']}]};var _0x46ebde=[];if(_0x5f0e9a[_0xd54c('0x5f')][_0xd54c('0x7f')]&&_0x5f0e9a[_0xd54c('0x5f')][_0xd54c('0x7f')]===_0xd54c('0x80')){if(!_[_0xd54c('0x81')](_0x5f0e9a[_0xd54c('0x5f')][_0xd54c('0x82')])){_0x36ed89['id']={'$in':_0x5f0e9a[_0xd54c('0x5f')][_0xd54c('0x82')]};}_0x46ebde=[[_0xd54c('0x83'),_0xd54c('0x84')],['scheduledAt',_0x4ac15b[0x0][_0xd54c('0x85')]===_0xd54c('0x84')?_0xd54c('0x86'):_0xd54c('0x84')],db['sequelize'][_0xd54c('0x87')](_0xd54c('0x88')),['id','DESC']];}else{if(!_[_0xd54c('0x81')](_0x5f0e9a['body'][_0xd54c('0x82')])){_0x36ed89['id']={'$notIn':_0x5f0e9a['body']['hopperIds']};}_0x46ebde=[[_0xd54c('0x83'),_0xd54c('0x86')],['scheduledAt',_0x4ac15b[0x0][_0xd54c('0x85')]],db[_0xd54c('0x7e')][_0xd54c('0x87')](_0xd54c('0x89')),['id','ASC']];}return db[_0xd54c('0x30')]['findOne']({'attributes':['id',_0xd54c('0x8a')],'where':_0x36ed89,'order':_0x46ebde,'transaction':_0xc2664f,'lock':_0xc2664f['LOCK'][_0xd54c('0x8b')],'include':[{'model':db[_0xd54c('0x74')],'as':_0xd54c('0x8c'),'attributes':_0x3d5980,'include':[{'model':db[_0xd54c('0x8d')],'as':_0xd54c('0x8e'),'attributes':['id',_0xd54c('0x2c')]}]},{'model':db[_0xd54c('0x8f')],'as':_0xd54c('0x90'),'attributes':['id',_0xd54c('0x2c')]},{'model':db[_0xd54c('0x61')],'as':'Queue','attributes':['id',_0xd54c('0x2c'),'dialActive']}]})['then'](function(_0x2e02ba){if(_0x2e02ba){return _0x2e02ba[_0xd54c('0x5e')]({'UserId':_0x5f0e9a['user']['id']},{'transaction':_0xc2664f});}});});}})[_0xd54c('0x27')](handleEntityNotFound(_0xed47c9,null))[_0xd54c('0x27')](respondWithResult(_0xed47c9,null))[_0xd54c('0x54')](handleError(_0xed47c9,null));};exports['getOpenContacts']=function(_0x4388bc,_0x480edb,_0x386f5d){return _0x4388bc[_0xd54c('0x6b')][_0xd54c('0x7c')]({'where':{'type':_0xd54c('0x91'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xd54c('0x27')](function(_0x54852c){if(_0x54852c&&_0x54852c[_0xd54c('0x59')]){return db[_0xd54c('0x30')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd54c('0x6e')](_0xd54c('0x6f'))},'VoiceQueueId':{'$in':_[_0xd54c('0x2f')](_0x54852c,'id')},'$or':[{'UserId':null},{'UserId':_0x4388bc[_0xd54c('0x6b')]['id']}]}});}return 0x0;})['then'](function(_0x1aab85){if(!_['isNil'](_0x1aab85)&&_['isNumber'](_0x1aab85)){return _0x480edb[_0xd54c('0x1c')](0xc8)[_0xd54c('0x1e')]({'contacts':_0x1aab85});}else{logger[_0xd54c('0x2a')](_0xd54c('0x92'),_0xd54c('0x93'),0x194,_0xd54c('0x94'));_0x480edb[_0xd54c('0x29')](0x194);}})['catch'](handleError(_0x480edb,null));}; \ No newline at end of file +var _0x6de3=['ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','LOCK','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','getVoiceQueues','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','concat','$and','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields','length','offset','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','VoiceQueueId','CampaignId','Campaign','dataValues','createdAt','state','statedesc','deleted','campaign','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','describe','user','outbound','dialOrderByScheduledAt','sequelize','direction','hopperIds'];(function(_0x44ce77,_0x49b532){var _0x1181b6=function(_0x59823b){while(--_0x59823b){_0x44ce77['push'](_0x44ce77['shift']());}};_0x1181b6(++_0x49b532);}(_0x6de3,0x1ae));var _0x36de=function(_0x4af9e2,_0x59517b){_0x4af9e2=_0x4af9e2-0x0;var _0x698469=_0x6de3[_0x4af9e2];return _0x698469;};'use strict';var emlformat=require(_0x36de('0x0'));var rimraf=require(_0x36de('0x1'));var zipdir=require(_0x36de('0x2'));var jsonpatch=require(_0x36de('0x3'));var rp=require(_0x36de('0x4'));var moment=require('moment');var BPromise=require(_0x36de('0x5'));var Mustache=require(_0x36de('0x6'));var util=require(_0x36de('0x7'));var path=require('path');var sox=require(_0x36de('0x8'));var csv=require('to-csv');var ejs=require(_0x36de('0x9'));var fs=require('fs');var fs_extra=require(_0x36de('0xa'));var _=require(_0x36de('0xb'));var squel=require('squel');var crypto=require(_0x36de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x36de('0xd'));var toCsv=require(_0x36de('0xe'));var querystring=require('querystring');var Papa=require(_0x36de('0xf'));var Redis=require(_0x36de('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36de('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x36de('0x13'));var licenseUtil=require(_0x36de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ab1e,_0x1cf7a0){_0x1cf7a0=_0x1cf7a0||0xcc;return function(_0x4e6a53){if(_0x4e6a53){return _0x28ab1e[_0x36de('0x15')](_0x1cf7a0);}return _0x28ab1e['status'](_0x1cf7a0)[_0x36de('0x16')]();};}function respondWithResult(_0x5ba0d2,_0x499608){_0x499608=_0x499608||0xc8;return function(_0x5f39c3){if(_0x5f39c3){return _0x5ba0d2['status'](_0x499608)[_0x36de('0x17')](_0x5f39c3);}};}function respondWithFilteredResult(_0x5051ed,_0x31a7e1){return function(_0x13cbf6){if(_0x13cbf6){var _0x50e06e=typeof _0x31a7e1['offset']===_0x36de('0x18')&&typeof _0x31a7e1['limit']===_0x36de('0x18');var _0x50d213=_0x13cbf6[_0x36de('0x19')];var _0x3f3f09=_0x50e06e?0x0:_0x31a7e1['offset'];var _0x393b52=_0x50e06e?_0x13cbf6[_0x36de('0x19')]:_0x31a7e1['offset']+_0x31a7e1[_0x36de('0x1a')];var _0x497612;if(_0x393b52>=_0x50d213){_0x393b52=_0x50d213;_0x497612=0xc8;}else{_0x497612=0xce;}_0x5051ed[_0x36de('0x1b')](_0x497612);return _0x5051ed[_0x36de('0x1c')](_0x36de('0x1d'),_0x3f3f09+'-'+_0x393b52+'/'+_0x50d213)['json'](_0x13cbf6);}return null;};}function patchUpdates(_0x3a7a12){return function(_0x326cfb){try{jsonpatch['apply'](_0x326cfb,_0x3a7a12,!![]);}catch(_0x1b01f0){return BPromise['reject'](_0x1b01f0);}return _0x326cfb[_0x36de('0x1e')]();};}function saveUpdates(_0x3ba32e,_0x28d81e){return function(_0x3fc3f9){if(_0x3fc3f9){return _0x3fc3f9[_0x36de('0x1f')](_0x3ba32e)[_0x36de('0x20')](function(_0x5498f0){return _0x5498f0;});}return null;};}function removeEntity(_0x4801e6,_0x434c74){return function(_0x46c112){if(_0x46c112){return _0x46c112[_0x36de('0x21')]()[_0x36de('0x20')](function(){_0x4801e6['status'](0xcc)[_0x36de('0x16')]();});}};}function handleEntityNotFound(_0x355160,_0x2f0e18){return function(_0x4e61f1){if(!_0x4e61f1){_0x355160['sendStatus'](0x194);}return _0x4e61f1;};}function handleError(_0x5e4cec,_0x4223d6){_0x4223d6=_0x4223d6||0x1f4;return function(_0x380b77){logger['error'](_0x380b77[_0x36de('0x22')]);if(_0x380b77[_0x36de('0x23')]){delete _0x380b77[_0x36de('0x23')];}_0x5e4cec[_0x36de('0x1b')](_0x4223d6)[_0x36de('0x24')](_0x380b77);};}exports[_0x36de('0x25')]=function(_0x536047,_0x2a81aa){var _0x1c3ac9={},_0x4f2057={},_0x448771={'count':0x0,'rows':[]};var _0x818e1b=_['map'](db[_0x36de('0x26')][_0x36de('0x27')],function(_0xea0ff0){return{'name':_0xea0ff0[_0x36de('0x28')],'type':_0xea0ff0[_0x36de('0x29')][_0x36de('0x2a')]};});_0x4f2057[_0x36de('0x2b')]=_[_0x36de('0x2c')](_0x818e1b,_0x36de('0x23'));_0x4f2057[_0x36de('0x2d')]=_[_0x36de('0x2e')](_0x536047[_0x36de('0x2d')]);_0x4f2057[_0x36de('0x2f')]=_['intersection'](_0x4f2057[_0x36de('0x2b')],_0x4f2057['query']);_0x4f2057[_0x36de('0x2f')]=_[_0x36de('0x30')](_0x4f2057[_0x36de('0x2f')],[_0x36de('0x31'),'$or',_0x36de('0x32'),_0x36de('0x33'),'$lt',_0x36de('0x34'),_0x36de('0x35'),'$eq',_0x36de('0x36'),_0x36de('0x37'),_0x36de('0x38'),'$in','$notIn',_0x36de('0x39'),_0x36de('0x3a'),_0x36de('0x3b'),_0x36de('0x3c'),_0x36de('0x39'),_0x36de('0x3d'),'$contains',_0x36de('0x3e'),_0x36de('0x3f')]);_0x1c3ac9[_0x36de('0x40')]=_[_0x36de('0x41')](_0x4f2057[_0x36de('0x2b')],qs[_0x36de('0x42')](_0x536047[_0x36de('0x2d')][_0x36de('0x42')]));_0x1c3ac9['attributes']=_0x1c3ac9[_0x36de('0x40')][_0x36de('0x43')]?_0x1c3ac9[_0x36de('0x40')]:_0x4f2057[_0x36de('0x2b')];if(!_0x536047[_0x36de('0x2d')]['hasOwnProperty']('nolimit')){_0x1c3ac9['limit']=qs[_0x36de('0x1a')](_0x536047[_0x36de('0x2d')]['limit']);_0x1c3ac9[_0x36de('0x44')]=qs[_0x36de('0x44')](_0x536047[_0x36de('0x2d')][_0x36de('0x44')]);}_0x1c3ac9['order']=qs[_0x36de('0x45')](_0x536047['query'][_0x36de('0x45')]);_0x1c3ac9[_0x36de('0x46')]=qs[_0x36de('0x2f')](_[_0x36de('0x47')](_0x536047[_0x36de('0x2d')],_0x4f2057['filters']),_0x818e1b);if(_0x536047[_0x36de('0x2d')]['filter']){_0x1c3ac9[_0x36de('0x46')]=_[_0x36de('0x48')](_0x1c3ac9[_0x36de('0x46')],{'$or':_[_0x36de('0x2c')](_0x818e1b,function(_0x33b648){if(_0x33b648['type']!==_0x36de('0x49')){var _0x4a95fe={};_0x4a95fe[_0x33b648[_0x36de('0x23')]]={'$like':'%'+_0x536047[_0x36de('0x2d')][_0x36de('0x4a')]+'%'};return _0x4a95fe;}})});}_0x1c3ac9=_[_0x36de('0x48')]({},_0x1c3ac9,_0x536047[_0x36de('0x4b')]);var _0x592d66={'where':_0x1c3ac9[_0x36de('0x46')]};return db[_0x36de('0x26')][_0x36de('0x19')](_0x592d66)[_0x36de('0x20')](function(_0x4f0964){_0x448771[_0x36de('0x19')]=_0x4f0964;if(_0x536047[_0x36de('0x2d')][_0x36de('0x4c')]){_0x1c3ac9['include']=[{'all':!![]}];}return db[_0x36de('0x26')][_0x36de('0x4d')](_0x1c3ac9);})['then'](function(_0xc28121){_0x448771[_0x36de('0x4e')]=_0xc28121;return _0x448771;})[_0x36de('0x20')](respondWithFilteredResult(_0x2a81aa,_0x1c3ac9))[_0x36de('0x4f')](handleError(_0x2a81aa,null));};exports[_0x36de('0x50')]=function(_0x556a50,_0xf9ad28){var _0x151a40={'raw':!![],'where':{'id':_0x556a50['params']['id']}},_0x401eb0={};_0x401eb0[_0x36de('0x2b')]=_[_0x36de('0x2e')](db[_0x36de('0x26')][_0x36de('0x27')]);_0x401eb0[_0x36de('0x2d')]=_[_0x36de('0x2e')](_0x556a50[_0x36de('0x2d')]);_0x401eb0['filters']=_[_0x36de('0x41')](_0x401eb0[_0x36de('0x2b')],_0x401eb0[_0x36de('0x2d')]);_0x151a40[_0x36de('0x40')]=_[_0x36de('0x41')](_0x401eb0[_0x36de('0x2b')],qs[_0x36de('0x42')](_0x556a50[_0x36de('0x2d')][_0x36de('0x42')]));_0x151a40[_0x36de('0x40')]=_0x151a40[_0x36de('0x40')][_0x36de('0x43')]?_0x151a40[_0x36de('0x40')]:_0x401eb0[_0x36de('0x2b')];if(_0x556a50['query'][_0x36de('0x4c')]){_0x151a40[_0x36de('0x51')]=[{'all':!![]}];}_0x151a40=_[_0x36de('0x48')]({},_0x151a40,_0x556a50[_0x36de('0x4b')]);return db[_0x36de('0x26')][_0x36de('0x52')](_0x151a40)[_0x36de('0x20')](handleEntityNotFound(_0xf9ad28,null))['then'](respondWithResult(_0xf9ad28,null))[_0x36de('0x4f')](handleError(_0xf9ad28,null));};exports[_0x36de('0x53')]=function(_0x4921a6,_0x2f4f58){return db[_0x36de('0x26')][_0x36de('0x53')](_0x4921a6[_0x36de('0x54')],{})['then'](respondWithResult(_0x2f4f58,0xc9))[_0x36de('0x4f')](handleError(_0x2f4f58,null));};exports[_0x36de('0x1f')]=function(_0xd4d2c8,_0x26c835){if(_0xd4d2c8[_0x36de('0x54')]['id']){delete _0xd4d2c8[_0x36de('0x54')]['id'];}return db[_0x36de('0x26')][_0x36de('0x52')]({'where':{'id':_0xd4d2c8['params']['id']}})[_0x36de('0x20')](handleEntityNotFound(_0x26c835,null))[_0x36de('0x20')](saveUpdates(_0xd4d2c8[_0x36de('0x54')],null))['then'](respondWithResult(_0x26c835,null))[_0x36de('0x4f')](handleError(_0x26c835,null));};exports['describe']=function(_0x45feb3,_0x1020c9){return db['CmHopper']['describe']()[_0x36de('0x20')](respondWithResult(_0x1020c9,null))[_0x36de('0x4f')](handleError(_0x1020c9,null));};exports[_0x36de('0x21')]=function(_0x113082,_0x1f11c0){var _0x20363a;return db[_0x36de('0x26')][_0x36de('0x52')]({'where':{'id':_0x113082[_0x36de('0x55')]['id']}})['then'](handleEntityNotFound(_0x1f11c0,null))['then'](function(_0x4a5d8b){if(_0x4a5d8b){return _0x4a5d8b[_0x36de('0x21')]()['then'](function(_0x56cc10){return _0x56cc10;});}})['then'](function(_0x4ebb23){_0x20363a=_0x4ebb23;if(_0x4ebb23){if(_0x4ebb23[_0x36de('0x56')]||_0x4ebb23[_0x36de('0x57')]){return db[_0x4ebb23[_0x36de('0x56')]?'VoiceQueue':_0x36de('0x58')][_0x36de('0x52')]({'where':{'id':_0x4ebb23[_0x36de('0x56')]?_0x4ebb23[_0x36de('0x56')]:_0x4ebb23[_0x36de('0x57')]},'attributes':['id','name'],'raw':!![]});}}})[_0x36de('0x20')](function(_0x50c878){var _0x25a800={};if(_0x50c878){_[_0x36de('0x48')](_0x25a800,_['omit'](_0x20363a[_0x36de('0x59')],[_0x36de('0x5a'),'updatedAt','id']));_0x25a800[_0x36de('0x5b')]=0x15;_0x25a800[_0x36de('0x5c')]=_0x36de('0x5d');_0x25a800[_0x36de('0x5e')]=_0x50c878[_0x36de('0x23')];_0x25a800[_0x36de('0x5f')]=_0x113082['user'][_0x36de('0x23')];_0x25a800[_0x36de('0x60')]=_0x113082['user']['id'];_0x25a800[_0x36de('0x5d')]=!![];_0x25a800[_0x36de('0x61')]=moment()[_0x36de('0x62')](_0x36de('0x63'));_0x25a800['calleridnum']=_0x20363a[_0x36de('0x64')];_0x25a800[_0x36de('0x65')]=_0x20363a['VoiceQueueId']?'queue':_0x36de('0x66');return db[_0x36de('0x67')][_0x36de('0x52')]({'where':{'id':_0x25a800[_0x36de('0x68')]},'attributes':[_0x36de('0x69'),_0x36de('0x6a')]})[_0x36de('0x20')](function(_0x3fb79c){if(!_[_0x36de('0x6b')](_0x1f11c0)&&!_[_0x36de('0x6b')](_0x3fb79c[_0x36de('0x69')])){_0x25a800[_0x36de('0x6c')]=_0x3fb79c[_0x36de('0x69')];if(!_[_0x36de('0x6b')](_0x3fb79c[_0x36de('0x6a')])){_0x25a800[_0x36de('0x6c')]+='\x20'+_0x3fb79c[_0x36de('0x6a')];}}})[_0x36de('0x6d')](function(){return db[_0x36de('0x6e')][_0x36de('0x53')](_0x25a800);});}})[_0x36de('0x20')](function(){return _0x1f11c0[_0x36de('0x1b')](0xcc)['end']();})[_0x36de('0x4f')](handleError(_0x1f11c0,null));};exports['getPreview']=function(_0x3b585c,_0x247c5b,_0x1dc7e9){var _0x56efcb=[];return db[_0x36de('0x67')][_0x36de('0x6f')]()[_0x36de('0x20')](function(_0x1a4ba3){_0x56efcb=_[_0x36de('0x2e')](_0x1a4ba3);return _0x3b585c[_0x36de('0x70')]['getVoiceQueues']({'where':{'type':_0x36de('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x36de('0x72')],'raw':!![]});})[_0x36de('0x20')](function(_0x5eb010){if(_0x5eb010&&_0x5eb010[_0x36de('0x43')]){return db[_0x36de('0x73')]['transaction'](function(_0x27b2cf){var _0x7287ef={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x36de('0x62')](_0x36de('0x63'))},'VoiceQueueId':{'$in':_[_0x36de('0x2c')](_0x5eb010,'id')},'$or':[{'UserId':null},{'UserId':_0x3b585c[_0x36de('0x70')]['id']}]};var _0x30f68a=[];if(_0x3b585c[_0x36de('0x54')]['direction']&&_0x3b585c['body'][_0x36de('0x74')]==='prev'){if(!_['isEmpty'](_0x3b585c[_0x36de('0x54')]['hopperIds'])){_0x7287ef['id']={'$in':_0x3b585c[_0x36de('0x54')][_0x36de('0x75')]};}_0x30f68a=[['priority',_0x36de('0x76')],[_0x36de('0x77'),_0x5eb010[0x0][_0x36de('0x72')]===_0x36de('0x76')?_0x36de('0x78'):_0x36de('0x76')],db['sequelize'][_0x36de('0x79')](_0x36de('0x7a')),['id',_0x36de('0x78')]];}else{if(!_[_0x36de('0x7b')](_0x3b585c['body'][_0x36de('0x75')])){_0x7287ef['id']={'$notIn':_0x3b585c[_0x36de('0x54')][_0x36de('0x75')]};}_0x30f68a=[['priority','DESC'],['scheduledAt',_0x5eb010[0x0][_0x36de('0x72')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x36de('0x26')]['findOne']({'attributes':['id','scheduledat'],'where':_0x7287ef,'order':_0x30f68a,'transaction':_0x27b2cf,'lock':_0x27b2cf[_0x36de('0x7c')]['UPDATE'],'include':[{'model':db[_0x36de('0x67')],'as':_0x36de('0x7d'),'attributes':_0x56efcb,'include':[{'model':db[_0x36de('0x7e')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x36de('0x7f')],'as':_0x36de('0x80'),'attributes':['id','name']},{'model':db[_0x36de('0x81')],'as':_0x36de('0x82'),'attributes':['id','name',_0x36de('0x83')]}]})[_0x36de('0x20')](function(_0x313b29){if(_0x313b29){return _0x313b29['update']({'UserId':_0x3b585c[_0x36de('0x70')]['id']},{'transaction':_0x27b2cf});}});});}})[_0x36de('0x20')](handleEntityNotFound(_0x247c5b,null))[_0x36de('0x20')](respondWithResult(_0x247c5b,null))['catch'](handleError(_0x247c5b,null));};exports['getOpenContacts']=function(_0x2e83e7,_0x25fcf1,_0x560059){return _0x2e83e7[_0x36de('0x70')][_0x36de('0x84')]({'where':{'type':_0x36de('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x36de('0x20')](function(_0x2e3f90){if(_0x2e3f90&&_0x2e3f90['length']){return db['CmHopper'][_0x36de('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x36de('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x36de('0x2c')](_0x2e3f90,'id')},'$or':[{'UserId':null},{'UserId':_0x2e83e7['user']['id']}]}});}return 0x0;})[_0x36de('0x20')](function(_0x4d3bc7){if(!_['isNil'](_0x4d3bc7)&&_['isNumber'](_0x4d3bc7)){return _0x25fcf1['status'](0xc8)[_0x36de('0x17')]({'contacts':_0x4d3bc7});}else{logger[_0x36de('0x85')](_0x36de('0x86'),_0x36de('0x87'),0x194,_0x36de('0x88'));_0x25fcf1[_0x36de('0x15')](0x194);}})['catch'](handleError(_0x25fcf1,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index bfb6606..ddbb11d 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 _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x24ae96,_0x2fdca2){var _0x2f3ec7=function(_0x59f7cd){while(--_0x59f7cd){_0x24ae96['push'](_0x24ae96['shift']());}};_0x2f3ec7(++_0x2fdca2);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6d38[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x86d3('0x9')]},{'name':_0x86d3('0xa'),'fields':[_0x86d3('0xa')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2e0c8e,_0x50384a){_0x2e0c8e=_0x2e0c8e-0x0;var _0x50b92e=_0xc6ac[_0x2e0c8e];return _0x50b92e;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index a819161..3c347e7 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 _0xc4be=['limit','include','map','model','CmHopper','find','raw','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','keys','User','Agent','voicePause','length','includes','push','all','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','Contact','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','catch','GetCmHopper','options','where','attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc4be,0xf7));var _0xec4b=function(_0x464837,_0x41b71c){_0x464837=_0x464837-0x0;var _0x20f0be=_0xc4be[_0x464837];return _0x20f0be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec4b('0x0'));var BPromise=require('bluebird');var rs=require(_0xec4b('0x1'));var fs=require('fs');var Redis=require(_0xec4b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec4b('0x3'));var logger=require(_0xec4b('0x4'))(_0xec4b('0x5'));var config=require('../../config/environment');var jayson=require(_0xec4b('0x6'));var client=jayson[_0xec4b('0x7')][_0xec4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x79ab53,_0x2725e6,_0x2e5803){return new BPromise(function(_0x123aa1,_0x35c356){return client[_0xec4b('0x9')](_0x79ab53,_0x2e5803)[_0xec4b('0xa')](function(_0x2506da){logger['info']('CmHopper,\x20%s,\x20%s',_0x2725e6,_0xec4b('0xb'));logger[_0xec4b('0xc')](_0xec4b('0xd'),_0x2725e6,'request\x20sent',JSON[_0xec4b('0xe')](_0x2506da));if(_0x2506da[_0xec4b('0xf')]){if(_0x2506da[_0xec4b('0xf')][_0xec4b('0x10')]===0x1f4){logger[_0xec4b('0xf')](_0xec4b('0x11'),_0x2725e6,_0x2506da[_0xec4b('0xf')][_0xec4b('0x12')]);return _0x35c356(_0x2506da[_0xec4b('0xf')]['message']);}logger[_0xec4b('0xf')](_0xec4b('0x11'),_0x2725e6,_0x2506da['error']['message']);return _0x123aa1(_0x2506da[_0xec4b('0xf')][_0xec4b('0x12')]);}else{logger[_0xec4b('0x13')](_0xec4b('0x11'),_0x2725e6,_0xec4b('0xb'));_0x123aa1(_0x2506da['result'][_0xec4b('0x12')]);}})[_0xec4b('0x14')](function(_0x39dd6e){logger[_0xec4b('0xf')]('CmHopper,\x20%s,\x20%s',_0x2725e6,_0x39dd6e);_0x35c356(_0x39dd6e);});});}exports[_0xec4b('0x15')]=function(_0x15bc68){var _0x58aed4=this;return new Promise(function(_0x202737,_0x19052b){return db['CmHopper']['findAll']({'raw':_0x15bc68[_0xec4b('0x16')]?_0x15bc68[_0xec4b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x15bc68[_0xec4b('0x16')]?_0x15bc68[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'attributes':_0x15bc68[_0xec4b('0x16')]?_0x15bc68[_0xec4b('0x16')][_0xec4b('0x18')]||null:null,'limit':_0x15bc68[_0xec4b('0x16')]?_0x15bc68[_0xec4b('0x16')][_0xec4b('0x19')]||null:null,'include':_0x15bc68[_0xec4b('0x16')]?_0x15bc68[_0xec4b('0x16')][_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x15bc68[_0xec4b('0x16')][_0xec4b('0x1a')],function(_0x4645b2){return{'model':db[_0x4645b2[_0xec4b('0x1c')]],'as':_0x4645b2['as'],'attributes':_0x4645b2[_0xec4b('0x18')],'include':_0x4645b2[_0xec4b('0x1a')]?_['map'](_0x4645b2[_0xec4b('0x1a')],function(_0x3566bf){return{'model':db[_0x3566bf[_0xec4b('0x1c')]],'as':_0x3566bf['as'],'attributes':_0x3566bf[_0xec4b('0x18')],'include':_0x3566bf[_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x3566bf[_0xec4b('0x1a')],function(_0x3028a7){return{'model':db[_0x3028a7[_0xec4b('0x1c')]],'as':_0x3028a7['as'],'attributes':_0x3028a7[_0xec4b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xec4b('0xa')](function(_0x28b088){logger[_0xec4b('0x13')](_0xec4b('0x15'),_0x15bc68);logger[_0xec4b('0xc')](_0xec4b('0x15'),_0x15bc68,JSON['stringify'](_0x28b088));_0x202737(_0x28b088);})[_0xec4b('0x14')](function(_0x2e51f5){logger[_0xec4b('0xf')]('GetCmHopper',_0x2e51f5[_0xec4b('0x12')],_0x15bc68);_0x19052b(_0x58aed4[_0xec4b('0xf')](0x1f4,_0x2e51f5[_0xec4b('0x12')]));});});};exports['ShowCmHopper']=function(_0x13554d){var _0x12c293=this;return new Promise(function(_0x97bf0f,_0x5ac5a3){return db[_0xec4b('0x1d')][_0xec4b('0x1e')]({'raw':_0x13554d[_0xec4b('0x16')]?_0x13554d[_0xec4b('0x16')][_0xec4b('0x1f')]===undefined?!![]:![]:!![],'where':_0x13554d[_0xec4b('0x16')]?_0x13554d[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'attributes':_0x13554d[_0xec4b('0x16')]?_0x13554d[_0xec4b('0x16')][_0xec4b('0x18')]||null:null,'include':_0x13554d[_0xec4b('0x16')]?_0x13554d[_0xec4b('0x16')][_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x13554d[_0xec4b('0x16')]['include'],function(_0x535652){return{'model':db[_0x535652[_0xec4b('0x1c')]],'as':_0x535652['as'],'attributes':_0x535652[_0xec4b('0x18')],'include':_0x535652['include']?_[_0xec4b('0x1b')](_0x535652[_0xec4b('0x1a')],function(_0xc58618){return{'model':db[_0xc58618['model']],'as':_0xc58618['as'],'attributes':_0xc58618[_0xec4b('0x18')],'include':_0xc58618['include']?_['map'](_0xc58618[_0xec4b('0x1a')],function(_0x36408f){return{'model':db[_0x36408f[_0xec4b('0x1c')]],'as':_0x36408f['as'],'attributes':_0x36408f['attributes']};}):[]};}):[]};}):[]:[]})[_0xec4b('0xa')](function(_0x54fec1){logger[_0xec4b('0x13')](_0xec4b('0x20'),_0x13554d);logger['debug']('ShowCmHopper',_0x13554d,JSON[_0xec4b('0xe')](_0x54fec1));_0x97bf0f(_0x54fec1);})[_0xec4b('0x14')](function(_0x3dce8c){logger[_0xec4b('0xf')](_0xec4b('0x20'),_0x3dce8c[_0xec4b('0x12')],_0x13554d);_0x5ac5a3(_0x12c293[_0xec4b('0xf')](0x1f4,_0x3dce8c[_0xec4b('0x12')]));});});};exports[_0xec4b('0x21')]=function(_0x1f7ac9){var _0x56409d=this;return new Promise(function(_0x3b67b4,_0x561c04){return db[_0xec4b('0x1d')]['create'](_0x1f7ac9[_0xec4b('0x22')],{'raw':_0x1f7ac9[_0xec4b('0x16')]?_0x1f7ac9[_0xec4b('0x16')][_0xec4b('0x1f')]===undefined?!![]:![]:!![]})[_0xec4b('0xa')](function(_0x35a291){logger[_0xec4b('0x13')](_0xec4b('0x21'),_0x1f7ac9);logger['debug'](_0xec4b('0x21'),_0x1f7ac9,JSON['stringify'](_0x35a291));_0x3b67b4(_0x35a291);})['catch'](function(_0x5d7c79){logger[_0xec4b('0xf')](_0xec4b('0x21'),_0x5d7c79[_0xec4b('0x12')],_0x1f7ac9);_0x561c04(_0x56409d[_0xec4b('0xf')](0x1f4,_0x5d7c79[_0xec4b('0x12')]));});});};exports[_0xec4b('0x23')]=function(_0x73570){var _0x2c7bf2=this;return new Promise(function(_0x8ee69e,_0x2431f5){return db[_0xec4b('0x1d')][_0xec4b('0x24')](_0x73570[_0xec4b('0x22')],{'raw':_0x73570[_0xec4b('0x16')]?_0x73570['options'][_0xec4b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x73570['options']?_0x73570[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'attributes':_0x73570[_0xec4b('0x16')]?_0x73570[_0xec4b('0x16')]['attributes']||null:null,'limit':_0x73570[_0xec4b('0x16')]?_0x73570[_0xec4b('0x16')][_0xec4b('0x19')]||null:null})[_0xec4b('0xa')](function(_0xfe8795){logger[_0xec4b('0x13')](_0xec4b('0x23'),_0x73570);logger[_0xec4b('0xc')](_0xec4b('0x23'),_0x73570,JSON[_0xec4b('0xe')](_0xfe8795));_0x8ee69e(_0xfe8795);})[_0xec4b('0x14')](function(_0x310792){logger['error'](_0xec4b('0x23'),_0x310792[_0xec4b('0x12')],_0x73570);_0x2431f5(_0x2c7bf2['error'](0x1f4,_0x310792[_0xec4b('0x12')]));});});};exports['DestroyCmHopper']=function(_0x408d52){var _0x308f96=this;return new Promise(function(_0x5ccc6b,_0x1b781b){return db[_0xec4b('0x1d')][_0xec4b('0x25')]({'where':_0x408d52[_0xec4b('0x16')]?_0x408d52['options']['where']||null:null})['then'](function(_0x2a9e25){logger[_0xec4b('0x13')](_0xec4b('0x26'),_0x408d52);logger['debug']('DestroyCmHopper',_0x408d52,JSON[_0xec4b('0xe')](_0x2a9e25));_0x5ccc6b(_0x2a9e25);})[_0xec4b('0x14')](function(_0x237c0e){logger[_0xec4b('0xf')](_0xec4b('0x26'),_0x237c0e['message'],_0x408d52);_0x1b781b(_0x308f96['error'](0x1f4,_0x237c0e[_0xec4b('0x12')]));});});};exports[_0xec4b('0x27')]=function(_0x2a2cb7){var _0x5539df=this;return new Promise(function(_0x178dbe,_0x5d423f){return db[_0xec4b('0x28')][_0xec4b('0x29')]()[_0xec4b('0xa')](function(_0x2d6dd5){return db[_0xec4b('0x2a')][_0xec4b('0x2b')](function(_0x5cabec){return db['CmHopper'][_0xec4b('0x2c')]({'where':_0x2a2cb7[_0xec4b('0x16')]?_0x2a2cb7['options']['where']||null:null,'attributes':_0x2a2cb7[_0xec4b('0x16')]?_0x2a2cb7[_0xec4b('0x16')][_0xec4b('0x18')]||null:null,'limit':_0x2a2cb7['options']?_0x2a2cb7['options'][_0xec4b('0x19')]||null:null,'order':_0x2a2cb7[_0xec4b('0x16')]?_0x2a2cb7['options'][_0xec4b('0x2d')]||null:null,'transaction':_0x5cabec,'lock':_0x5cabec[_0xec4b('0x2e')][_0xec4b('0x2f')],'include':[{'model':db[_0xec4b('0x28')],'as':'Contact','attributes':_[_0xec4b('0x30')](_0x2d6dd5)},{'model':db[_0xec4b('0x31')],'as':_0xec4b('0x32'),'attributes':['id','name',_0xec4b('0x33')]}]})[_0xec4b('0xa')](function(_0x1d6c90){var _0x5813d9=[];var _0x3d143f=[];for(var _0x59c277=0x0;_0x59c277<_0x1d6c90[_0xec4b('0x34')];_0x59c277+=0x1){var _0x378db6=_0x1d6c90[_0x59c277]['UserId'];if(_0x378db6===null){_0x5813d9['push'](_0x1d6c90[_0x59c277][_0xec4b('0x24')](_0x2a2cb7[_0xec4b('0x22')],{'transaction':_0x5cabec}));}else if(!_0x3d143f[_0xec4b('0x35')](_0x378db6)){_0x3d143f[_0xec4b('0x36')](_0x378db6);_0x5813d9[_0xec4b('0x36')](_0x1d6c90[_0x59c277]['update'](_0x2a2cb7[_0xec4b('0x22')],{'transaction':_0x5cabec}));}}return BPromise[_0xec4b('0x37')](_0x5813d9);});})[_0xec4b('0xa')](function(_0x427093){logger[_0xec4b('0x13')](_0xec4b('0x27'),_0x2a2cb7);logger[_0xec4b('0xc')]('GetContactDialer',_0x2a2cb7,JSON[_0xec4b('0xe')](_0x427093));_0x178dbe(_0x427093);})[_0xec4b('0x14')](function(_0x100924){logger[_0xec4b('0xf')]('GetContactDialer',_0x100924[_0xec4b('0x12')],_0x2a2cb7);_0x5d423f(_0x5539df[_0xec4b('0xf')](0x1f4,_0x100924[_0xec4b('0x12')]));});});});};exports[_0xec4b('0x38')]=function(_0x2220e8){var _0x671bad=this;return new Promise(function(_0xdc7d2f,_0x53b434){return db[_0xec4b('0x2a')][_0xec4b('0x2b')](function(_0x39bbc2){return db['CmHopperFinal']['create'](_0x2220e8[_0xec4b('0x22')],{'raw':_0x2220e8[_0xec4b('0x16')]?_0x2220e8[_0xec4b('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x39bbc2})[_0xec4b('0xa')](function(){return db[_0xec4b('0x1d')][_0xec4b('0x25')]({'where':_0x2220e8['options']?_0x2220e8[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'transaction':_0x39bbc2});});})[_0xec4b('0xa')](function(_0x426350){logger[_0xec4b('0x13')](_0xec4b('0x38'),_0x2220e8);logger[_0xec4b('0xc')](_0xec4b('0x38'),_0x2220e8,JSON[_0xec4b('0xe')](_0x426350));_0xdc7d2f(_0x426350);})[_0xec4b('0x14')](function(_0x5cdb5c){logger['error']('MoveContactManagedDialer',_0x5cdb5c[_0xec4b('0x12')],_0x2220e8);_0x53b434(_0x671bad[_0xec4b('0xf')](0x1f4,_0x5cdb5c[_0xec4b('0x12')]));});});};exports['CountReScheduled']=function(_0x10d57c){var _0x469210=this;return new Promise(function(_0x5e44e8,_0x1213b6){return db[_0xec4b('0x1d')]['findAll']({'raw':_0x10d57c[_0xec4b('0x16')]?_0x10d57c['options']['raw']===undefined?!![]:![]:!![],'where':_0x10d57c['options']?_0x10d57c[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0xec4b('0x39'),db[_0xec4b('0x2a')]['fn']('IF',db[_0xec4b('0x2a')][_0xec4b('0x3a')](_0xec4b('0x3b')+util[_0xec4b('0x3c')](_0xec4b('0x3d'),moment()[_0xec4b('0x3c')](_0xec4b('0x3e')))+'\x20,\x201,\x20null'))),_0xec4b('0x3f')]]})['then'](function(_0x14c80e){logger[_0xec4b('0x13')](_0xec4b('0x40'),_0x10d57c);logger['debug']('CountReScheduled',_0x10d57c,JSON[_0xec4b('0xe')](_0x14c80e));_0x5e44e8(_0x14c80e);})[_0xec4b('0x14')](function(_0x33cbec){logger['error']('CountReScheduled',_0x33cbec[_0xec4b('0x12')],_0x10d57c);_0x1213b6(_0x469210[_0xec4b('0xf')](0x1f4,_0x33cbec['message']));});});};exports[_0xec4b('0x41')]=function(_0x490ee7){var _0x3cfe8c=this;return new Promise(function(_0x22c934,_0x4354b1){return db[_0xec4b('0x28')][_0xec4b('0x29')]()['then'](function(_0x151524){return db['sequelize']['transaction'](function(_0x4d3a85){return db[_0xec4b('0x1d')][_0xec4b('0x2c')]({'where':_0x490ee7[_0xec4b('0x16')]?_0x490ee7[_0xec4b('0x16')][_0xec4b('0x17')]||null:null,'attributes':_0x490ee7['options']?_0x490ee7[_0xec4b('0x16')][_0xec4b('0x18')]||null:null,'limit':0x1,'order':_0x490ee7[_0xec4b('0x16')]?_0x490ee7[_0xec4b('0x16')]['order']||null:null,'group':db[_0xec4b('0x1d')][_0xec4b('0x42')],'transaction':_0x4d3a85,'lock':_0x4d3a85[_0xec4b('0x2e')][_0xec4b('0x2f')],'include':_0x490ee7[_0xec4b('0x16')]?_0x490ee7[_0xec4b('0x16')][_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x490ee7[_0xec4b('0x16')][_0xec4b('0x1a')],function(_0x5ea898){return{'model':db[_0x5ea898[_0xec4b('0x1c')]],'as':_0x5ea898['as'],'attributes':_0x5ea898['attributes'],'include':_0x5ea898[_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x5ea898[_0xec4b('0x1a')],function(_0x19668c){return{'model':db[_0x19668c[_0xec4b('0x1c')]],'as':_0x19668c['as'],'attributes':_0x19668c[_0xec4b('0x18')],'include':_0x19668c[_0xec4b('0x1a')]?_['map'](_0x19668c[_0xec4b('0x1a')],function(_0x2c02d5){return{'model':db[_0x2c02d5[_0xec4b('0x1c')]],'as':_0x2c02d5['as'],'attributes':_0x2c02d5[_0xec4b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xec4b('0xa')](function(_0x11cfe5){var _0x3b1b49=[];for(var _0x4ae41d=0x0;_0x4ae41d<_0x11cfe5[_0xec4b('0x34')];_0x4ae41d+=0x1){_0x3b1b49[_0xec4b('0x36')](_0x11cfe5[_0x4ae41d][_0xec4b('0x24')](_0x490ee7[_0xec4b('0x22')],{'transaction':_0x4d3a85}));}return BPromise['all'](_0x3b1b49);});})['then'](function(_0x1946cf){logger[_0xec4b('0x13')](_0xec4b('0x41'),_0x490ee7);logger[_0xec4b('0xc')](_0xec4b('0x41'),_0x490ee7,JSON[_0xec4b('0xe')](_0x1946cf));_0x22c934(_0x1946cf);})[_0xec4b('0x14')](function(_0x14016b){logger[_0xec4b('0xf')](_0xec4b('0x41'),_0x14016b[_0xec4b('0x12')],_0x490ee7);_0x4354b1(_0x3cfe8c['error'](0x1f4,_0x14016b['message']));});});});};exports['GetCmHopperPreview']=function(_0x2b069b){var _0x279590=this;return new Promise(function(_0x3f09ab,_0x45a26b){db[_0xec4b('0x28')][_0xec4b('0x29')]()[_0xec4b('0xa')](function(_0x1feaba){return db[_0xec4b('0x1d')][_0xec4b('0x2c')]({'raw':_0x2b069b[_0xec4b('0x16')]?_0x2b069b['options'][_0xec4b('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b069b[_0xec4b('0x16')]?_0x2b069b[_0xec4b('0x16')]['where']||null:null,'attributes':_0x2b069b[_0xec4b('0x16')]?_0x2b069b[_0xec4b('0x16')][_0xec4b('0x18')]||null:null,'limit':_0x2b069b[_0xec4b('0x16')]?_0x2b069b[_0xec4b('0x16')][_0xec4b('0x19')]||null:null,'include':_0x2b069b['options']?_0x2b069b[_0xec4b('0x16')]['include']?_[_0xec4b('0x1b')](_0x2b069b[_0xec4b('0x16')][_0xec4b('0x1a')],function(_0x98782c){return{'model':db[_0x98782c[_0xec4b('0x1c')]],'as':_0x98782c['as'],'attributes':_0x98782c['as']===_0xec4b('0x43')?_[_0xec4b('0x30')](_0x1feaba):_0x98782c[_0xec4b('0x18')],'include':_0x98782c[_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x98782c['include'],function(_0x3c45f8){return{'model':db[_0x3c45f8['model']],'as':_0x3c45f8['as'],'attributes':_0x3c45f8[_0xec4b('0x18')],'include':_0x3c45f8[_0xec4b('0x1a')]?_[_0xec4b('0x1b')](_0x3c45f8['include'],function(_0x389223){return{'model':db[_0x389223[_0xec4b('0x1c')]],'as':_0x389223['as'],'attributes':_0x389223[_0xec4b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b5a24){logger[_0xec4b('0x13')]('GetCmHopper',_0x2b069b);logger['debug'](_0xec4b('0x15'),_0x2b069b,JSON['stringify'](_0x4b5a24));_0x3f09ab(_0x4b5a24);})[_0xec4b('0x14')](function(_0x3a288a){logger[_0xec4b('0xf')](_0xec4b('0x15'),_0x3a288a[_0xec4b('0x12')],_0x2b069b);_0x45a26b(_0x279590[_0xec4b('0xf')](0x1f4,_0x3a288a['message']));});});});}; \ No newline at end of file +var _0xd8a5=['debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','attributes','limit','map','include','model','GetCmHopper','ShowCmHopper','where','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','Agent','name','voicePause','length','push','includes','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','describe','UserId','GetCmHopperPreview','keys','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x5437d5,_0x33294a){var _0x41af82=function(_0x4b0cd1){while(--_0x4b0cd1){_0x5437d5['push'](_0x5437d5['shift']());}};_0x41af82(++_0x33294a);}(_0xd8a5,0x10b));var _0x5d8a=function(_0x4f156f,_0x1d0655){_0x4f156f=_0x4f156f-0x0;var _0x2de4e1=_0xd8a5[_0x4f156f];return _0x2de4e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d8a('0x0'));var BPromise=require(_0x5d8a('0x1'));var rs=require(_0x5d8a('0x2'));var fs=require('fs');var Redis=require(_0x5d8a('0x3'));var db=require(_0x5d8a('0x4'))['db'];var utils=require(_0x5d8a('0x5'));var logger=require(_0x5d8a('0x6'))('rpc');var config=require(_0x5d8a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d8a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1792ec,_0x4886c1,_0x5b4633){return new BPromise(function(_0x539681,_0x34695d){return client[_0x5d8a('0x9')](_0x1792ec,_0x5b4633)[_0x5d8a('0xa')](function(_0x3b3863){logger[_0x5d8a('0xb')](_0x5d8a('0xc'),_0x4886c1,'request\x20sent');logger[_0x5d8a('0xd')](_0x5d8a('0xe'),_0x4886c1,_0x5d8a('0xf'),JSON[_0x5d8a('0x10')](_0x3b3863));if(_0x3b3863[_0x5d8a('0x11')]){if(_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x12')]===0x1f4){logger[_0x5d8a('0x11')](_0x5d8a('0xc'),_0x4886c1,_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x13')]);return _0x34695d(_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x13')]);}logger['error'](_0x5d8a('0xc'),_0x4886c1,_0x3b3863[_0x5d8a('0x11')]['message']);return _0x539681(_0x3b3863['error']['message']);}else{logger[_0x5d8a('0xb')](_0x5d8a('0xc'),_0x4886c1,_0x5d8a('0xf'));_0x539681(_0x3b3863[_0x5d8a('0x14')][_0x5d8a('0x13')]);}})[_0x5d8a('0x15')](function(_0x413316){logger['error'](_0x5d8a('0xc'),_0x4886c1,_0x413316);_0x34695d(_0x413316);});});}exports['GetCmHopper']=function(_0x1eafff){var _0x4e0aaf=this;return new Promise(function(_0x40d6f1,_0x5e593b){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')]['where']||null:null,'attributes':_0x1eafff['options']?_0x1eafff['options'][_0x5d8a('0x1a')]||null:null,'limit':_0x1eafff['options']?_0x1eafff['options'][_0x5d8a('0x1b')]||null:null,'include':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')]['include']?_[_0x5d8a('0x1c')](_0x1eafff[_0x5d8a('0x18')][_0x5d8a('0x1d')],function(_0x42cc33){return{'model':db[_0x42cc33[_0x5d8a('0x1e')]],'as':_0x42cc33['as'],'attributes':_0x42cc33[_0x5d8a('0x1a')],'include':_0x42cc33[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x42cc33[_0x5d8a('0x1d')],function(_0x39aa67){return{'model':db[_0x39aa67[_0x5d8a('0x1e')]],'as':_0x39aa67['as'],'attributes':_0x39aa67['attributes'],'include':_0x39aa67[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x39aa67[_0x5d8a('0x1d')],function(_0x45334b){return{'model':db[_0x45334b['model']],'as':_0x45334b['as'],'attributes':_0x45334b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x1ff9f1){logger[_0x5d8a('0xb')](_0x5d8a('0x1f'),_0x1eafff);logger[_0x5d8a('0xd')](_0x5d8a('0x1f'),_0x1eafff,JSON[_0x5d8a('0x10')](_0x1ff9f1));_0x40d6f1(_0x1ff9f1);})[_0x5d8a('0x15')](function(_0x4d72aa){logger['error']('GetCmHopper',_0x4d72aa['message'],_0x1eafff);_0x5e593b(_0x4e0aaf['error'](0x1f4,_0x4d72aa[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x20')]=function(_0x2a22fd){var _0x191776=this;return new Promise(function(_0xb92e5f,_0x45ac02){return db['CmHopper']['find']({'raw':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd['options']['attributes']||null:null,'include':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd['options'][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x2a22fd['options'][_0x5d8a('0x1d')],function(_0xe07472){return{'model':db[_0xe07472[_0x5d8a('0x1e')]],'as':_0xe07472['as'],'attributes':_0xe07472[_0x5d8a('0x1a')],'include':_0xe07472[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0xe07472[_0x5d8a('0x1d')],function(_0x37a715){return{'model':db[_0x37a715[_0x5d8a('0x1e')]],'as':_0x37a715['as'],'attributes':_0x37a715[_0x5d8a('0x1a')],'include':_0x37a715['include']?_[_0x5d8a('0x1c')](_0x37a715['include'],function(_0x5659ff){return{'model':db[_0x5659ff['model']],'as':_0x5659ff['as'],'attributes':_0x5659ff[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0xc70fab){logger['info'](_0x5d8a('0x20'),_0x2a22fd);logger['debug']('ShowCmHopper',_0x2a22fd,JSON[_0x5d8a('0x10')](_0xc70fab));_0xb92e5f(_0xc70fab);})[_0x5d8a('0x15')](function(_0x3605a0){logger['error'](_0x5d8a('0x20'),_0x3605a0[_0x5d8a('0x13')],_0x2a22fd);_0x45ac02(_0x191776[_0x5d8a('0x11')](0x1f4,_0x3605a0[_0x5d8a('0x13')]));});});};exports['CreateCmHopper']=function(_0x23ef01){var _0x49c1e9=this;return new Promise(function(_0xb18049,_0x132f08){return db[_0x5d8a('0x16')][_0x5d8a('0x22')](_0x23ef01[_0x5d8a('0x23')],{'raw':_0x23ef01[_0x5d8a('0x18')]?_0x23ef01[_0x5d8a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5d8a('0xa')](function(_0xaaaf7d){logger[_0x5d8a('0xb')](_0x5d8a('0x24'),_0x23ef01);logger[_0x5d8a('0xd')](_0x5d8a('0x24'),_0x23ef01,JSON[_0x5d8a('0x10')](_0xaaaf7d));_0xb18049(_0xaaaf7d);})[_0x5d8a('0x15')](function(_0x1058aa){logger[_0x5d8a('0x11')](_0x5d8a('0x24'),_0x1058aa['message'],_0x23ef01);_0x132f08(_0x49c1e9[_0x5d8a('0x11')](0x1f4,_0x1058aa[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x25')]=function(_0x4b6bf6){var _0x17b364=this;return new Promise(function(_0x44807c,_0x11a597){return db[_0x5d8a('0x16')][_0x5d8a('0x26')](_0x4b6bf6[_0x5d8a('0x23')],{'raw':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6bf6['options']?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6['options']['limit']||null:null})[_0x5d8a('0xa')](function(_0x26a567){logger['info']('UpdateCmHopper',_0x4b6bf6);logger[_0x5d8a('0xd')](_0x5d8a('0x25'),_0x4b6bf6,JSON[_0x5d8a('0x10')](_0x26a567));_0x44807c(_0x26a567);})[_0x5d8a('0x15')](function(_0x3cc96d){logger[_0x5d8a('0x11')]('UpdateCmHopper',_0x3cc96d[_0x5d8a('0x13')],_0x4b6bf6);_0x11a597(_0x17b364[_0x5d8a('0x11')](0x1f4,_0x3cc96d[_0x5d8a('0x13')]));});});};exports['DestroyCmHopper']=function(_0x2d73ac){var _0x3efd0f=this;return new Promise(function(_0x56941a,_0x46148f){return db[_0x5d8a('0x16')]['destroy']({'where':_0x2d73ac[_0x5d8a('0x18')]?_0x2d73ac['options']['where']||null:null})['then'](function(_0x3dc13a){logger[_0x5d8a('0xb')]('DestroyCmHopper',_0x2d73ac);logger[_0x5d8a('0xd')](_0x5d8a('0x27'),_0x2d73ac,JSON[_0x5d8a('0x10')](_0x3dc13a));_0x56941a(_0x3dc13a);})[_0x5d8a('0x15')](function(_0xba3fdf){logger['error']('DestroyCmHopper',_0xba3fdf[_0x5d8a('0x13')],_0x2d73ac);_0x46148f(_0x3efd0f[_0x5d8a('0x11')](0x1f4,_0xba3fdf['message']));});});};exports['GetContactDialer']=function(_0x15fe11){var _0x3cb41a=this;return new Promise(function(_0x2bfa02,_0x66b70){return db['CmContact']['describe']()[_0x5d8a('0xa')](function(_0x941ea5){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x352676){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'where':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x1b')]||null:null,'order':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x2a')]||null:null,'transaction':_0x352676,'lock':_0x352676[_0x5d8a('0x2b')][_0x5d8a('0x2c')],'include':[{'model':db[_0x5d8a('0x2d')],'as':_0x5d8a('0x2e'),'attributes':_['keys'](_0x941ea5)},{'model':db['User'],'as':_0x5d8a('0x2f'),'attributes':['id',_0x5d8a('0x30'),_0x5d8a('0x31')]}]})[_0x5d8a('0xa')](function(_0x3b5966){var _0xb21929=[];var _0x57547d=[];for(var _0x5b182a=0x0;_0x5b182a<_0x3b5966[_0x5d8a('0x32')];_0x5b182a+=0x1){var _0x66d0f3=_0x3b5966[_0x5b182a]['UserId'];if(_0x66d0f3===null){_0xb21929[_0x5d8a('0x33')](_0x3b5966[_0x5b182a][_0x5d8a('0x26')](_0x15fe11[_0x5d8a('0x23')],{'transaction':_0x352676}));}else if(!_0x57547d[_0x5d8a('0x34')](_0x66d0f3)){_0x57547d[_0x5d8a('0x33')](_0x66d0f3);_0xb21929[_0x5d8a('0x33')](_0x3b5966[_0x5b182a][_0x5d8a('0x26')](_0x15fe11[_0x5d8a('0x23')],{'transaction':_0x352676}));}}return BPromise[_0x5d8a('0x35')](_0xb21929);});})[_0x5d8a('0xa')](function(_0x13244a){logger[_0x5d8a('0xb')](_0x5d8a('0x36'),_0x15fe11);logger[_0x5d8a('0xd')]('GetContactDialer',_0x15fe11,JSON[_0x5d8a('0x10')](_0x13244a));_0x2bfa02(_0x13244a);})[_0x5d8a('0x15')](function(_0x3f2aba){logger[_0x5d8a('0x11')](_0x5d8a('0x36'),_0x3f2aba[_0x5d8a('0x13')],_0x15fe11);_0x66b70(_0x3cb41a[_0x5d8a('0x11')](0x1f4,_0x3f2aba[_0x5d8a('0x13')]));});});});};exports[_0x5d8a('0x37')]=function(_0x18c7c4){var _0x26698c=this;return new Promise(function(_0x468e58,_0x15e4ab){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x31b324){return db[_0x5d8a('0x38')]['create'](_0x18c7c4[_0x5d8a('0x23')],{'raw':_0x18c7c4[_0x5d8a('0x18')]?_0x18c7c4[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'transaction':_0x31b324})[_0x5d8a('0xa')](function(){return db['CmHopper'][_0x5d8a('0x39')]({'where':_0x18c7c4[_0x5d8a('0x18')]?_0x18c7c4[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'transaction':_0x31b324});});})[_0x5d8a('0xa')](function(_0x336414){logger[_0x5d8a('0xb')](_0x5d8a('0x37'),_0x18c7c4);logger[_0x5d8a('0xd')]('MoveContactManagedDialer',_0x18c7c4,JSON['stringify'](_0x336414));_0x468e58(_0x336414);})[_0x5d8a('0x15')](function(_0x1d4e49){logger[_0x5d8a('0x11')](_0x5d8a('0x37'),_0x1d4e49[_0x5d8a('0x13')],_0x18c7c4);_0x15e4ab(_0x26698c['error'](0x1f4,_0x1d4e49['message']));});});};exports[_0x5d8a('0x3a')]=function(_0x51239a){var _0x43847b=this;return new Promise(function(_0x1c0d6b,_0x3add13){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x51239a[_0x5d8a('0x18')]?_0x51239a[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x51239a['options']?_0x51239a['options'][_0x5d8a('0x21')]||null:null,'attributes':[[db[_0x5d8a('0x28')]['fn'](_0x5d8a('0x3b'),db['sequelize']['fn']('IF',db[_0x5d8a('0x28')][_0x5d8a('0x3c')](_0x5d8a('0x3d')+util[_0x5d8a('0x3e')](_0x5d8a('0x3f'),moment()['format'](_0x5d8a('0x40')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x5d8a('0xa')](function(_0x218561){logger[_0x5d8a('0xb')](_0x5d8a('0x3a'),_0x51239a);logger[_0x5d8a('0xd')]('CountReScheduled',_0x51239a,JSON[_0x5d8a('0x10')](_0x218561));_0x1c0d6b(_0x218561);})[_0x5d8a('0x15')](function(_0x388963){logger['error'](_0x5d8a('0x3a'),_0x388963[_0x5d8a('0x13')],_0x51239a);_0x3add13(_0x43847b[_0x5d8a('0x11')](0x1f4,_0x388963[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x41')]=function(_0xc2bce8){var _0x45ecdf=this;return new Promise(function(_0x59b854,_0x99d8f0){return db[_0x5d8a('0x2d')][_0x5d8a('0x42')]()['then'](function(_0xf576be){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x446474){return db['CmHopper'][_0x5d8a('0x17')]({'where':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8['options']['where']||null:null,'attributes':_0xc2bce8['options']?_0xc2bce8['options'][_0x5d8a('0x1a')]||null:null,'limit':0x1,'order':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8[_0x5d8a('0x18')]['order']||null:null,'group':db['CmHopper'][_0x5d8a('0x43')],'transaction':_0x446474,'lock':_0x446474['LOCK'][_0x5d8a('0x2c')],'include':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8[_0x5d8a('0x18')][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0xc2bce8[_0x5d8a('0x18')][_0x5d8a('0x1d')],function(_0x1cf04f){return{'model':db[_0x1cf04f[_0x5d8a('0x1e')]],'as':_0x1cf04f['as'],'attributes':_0x1cf04f[_0x5d8a('0x1a')],'include':_0x1cf04f[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x1cf04f[_0x5d8a('0x1d')],function(_0x1396e4){return{'model':db[_0x1396e4[_0x5d8a('0x1e')]],'as':_0x1396e4['as'],'attributes':_0x1396e4[_0x5d8a('0x1a')],'include':_0x1396e4[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x1396e4['include'],function(_0x34850c){return{'model':db[_0x34850c[_0x5d8a('0x1e')]],'as':_0x34850c['as'],'attributes':_0x34850c[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x464046){var _0x132840=[];for(var _0x3f5d0c=0x0;_0x3f5d0c<_0x464046[_0x5d8a('0x32')];_0x3f5d0c+=0x1){_0x132840[_0x5d8a('0x33')](_0x464046[_0x3f5d0c][_0x5d8a('0x26')](_0xc2bce8['body'],{'transaction':_0x446474}));}return BPromise[_0x5d8a('0x35')](_0x132840);});})[_0x5d8a('0xa')](function(_0x2b0eb6){logger[_0x5d8a('0xb')](_0x5d8a('0x41'),_0xc2bce8);logger[_0x5d8a('0xd')](_0x5d8a('0x41'),_0xc2bce8,JSON['stringify'](_0x2b0eb6));_0x59b854(_0x2b0eb6);})[_0x5d8a('0x15')](function(_0x27d2e2){logger[_0x5d8a('0x11')](_0x5d8a('0x41'),_0x27d2e2[_0x5d8a('0x13')],_0xc2bce8);_0x99d8f0(_0x45ecdf[_0x5d8a('0x11')](0x1f4,_0x27d2e2[_0x5d8a('0x13')]));});});});};exports[_0x5d8a('0x44')]=function(_0x290094){var _0x4cd90f=this;return new Promise(function(_0x255097,_0x4a3472){db[_0x5d8a('0x2d')][_0x5d8a('0x42')]()[_0x5d8a('0xa')](function(_0x54d98a){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x290094['options']?_0x290094['options'][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x290094[_0x5d8a('0x18')]?_0x290094['options'][_0x5d8a('0x1b')]||null:null,'include':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x290094['options'][_0x5d8a('0x1d')],function(_0x39a96f){return{'model':db[_0x39a96f[_0x5d8a('0x1e')]],'as':_0x39a96f['as'],'attributes':_0x39a96f['as']===_0x5d8a('0x2e')?_[_0x5d8a('0x45')](_0x54d98a):_0x39a96f[_0x5d8a('0x1a')],'include':_0x39a96f[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x39a96f[_0x5d8a('0x1d')],function(_0x22f9e2){return{'model':db[_0x22f9e2[_0x5d8a('0x1e')]],'as':_0x22f9e2['as'],'attributes':_0x22f9e2[_0x5d8a('0x1a')],'include':_0x22f9e2['include']?_[_0x5d8a('0x1c')](_0x22f9e2[_0x5d8a('0x1d')],function(_0x1096da){return{'model':db[_0x1096da[_0x5d8a('0x1e')]],'as':_0x1096da['as'],'attributes':_0x1096da[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x2d11f8){logger[_0x5d8a('0xb')]('GetCmHopper',_0x290094);logger['debug'](_0x5d8a('0x1f'),_0x290094,JSON['stringify'](_0x2d11f8));_0x255097(_0x2d11f8);})[_0x5d8a('0x15')](function(_0x1fea40){logger[_0x5d8a('0x11')](_0x5d8a('0x1f'),_0x1fea40[_0x5d8a('0x13')],_0x290094);_0x4a3472(_0x4cd90f[_0x5d8a('0x11')](0x1f4,_0x1fea40['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 01423fa..1267952 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 _0xc13f=['show','create','post','/preview','getPreview','put','update','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','index','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts'];(function(_0x3aa7b8,_0x3b25be){var _0x5402d3=function(_0xcbac98){while(--_0xcbac98){_0x3aa7b8['push'](_0x3aa7b8['shift']());}};_0x5402d3(++_0x3b25be);}(_0xc13f,0xa0));var _0xfc13=function(_0x4ddea7,_0xb49980){_0x4ddea7=_0x4ddea7-0x0;var _0x2f43d5=_0xc13f[_0x4ddea7];return _0x2f43d5;};'use strict';var multer=require(_0xfc13('0x0'));var util=require(_0xfc13('0x1'));var path=require(_0xfc13('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc13('0x3'));var router=express['Router']();var fs_extra=require(_0xfc13('0x4'));var auth=require(_0xfc13('0x5'));var interaction=require(_0xfc13('0x6'));var config=require('../../config/environment');var controller=require(_0xfc13('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc13('0x8')]);router[_0xfc13('0x9')](_0xfc13('0xa'),auth[_0xfc13('0xb')](),controller[_0xfc13('0xc')]);router[_0xfc13('0x9')](_0xfc13('0xd'),auth[_0xfc13('0xb')](),controller[_0xfc13('0xe')]);router[_0xfc13('0x9')]('/:id',auth[_0xfc13('0xb')](),controller[_0xfc13('0xf')]);router['post']('/',auth[_0xfc13('0xb')](),controller[_0xfc13('0x10')]);router[_0xfc13('0x11')](_0xfc13('0x12'),auth[_0xfc13('0xb')](),controller[_0xfc13('0x13')]);router[_0xfc13('0x14')]('/:id',auth[_0xfc13('0xb')](),controller[_0xfc13('0x15')]);router['delete'](_0xfc13('0x16'),auth[_0xfc13('0xb')](),controller[_0xfc13('0x17')]);module[_0xfc13('0x18')]=router; \ No newline at end of file +var _0x0628=['isAuthenticated','index','/opencontacts','getOpenContacts','show','post','create','getPreview','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x73e9b0,_0x608ea8){var _0xb8f052=function(_0x3c241a){while(--_0x3c241a){_0x73e9b0['push'](_0x73e9b0['shift']());}};_0xb8f052(++_0x608ea8);}(_0x0628,0x15c));var _0x8062=function(_0x3cae6c,_0x3d74ba){_0x3cae6c=_0x3cae6c-0x0;var _0x3b7421=_0x0628[_0x3cae6c];return _0x3b7421;};'use strict';var multer=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var path=require('path');var timeout=require(_0x8062('0x2'));var express=require(_0x8062('0x3'));var router=express[_0x8062('0x4')]();var fs_extra=require(_0x8062('0x5'));var auth=require(_0x8062('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8062('0x7'));var controller=require('./cmHopper.controller');router[_0x8062('0x8')]('/',auth[_0x8062('0x9')](),controller[_0x8062('0xa')]);router[_0x8062('0x8')]('/describe',auth[_0x8062('0x9')](),controller['describe']);router[_0x8062('0x8')](_0x8062('0xb'),auth[_0x8062('0x9')](),controller[_0x8062('0xc')]);router[_0x8062('0x8')]('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0xd')]);router[_0x8062('0xe')]('/',auth['isAuthenticated'](),controller[_0x8062('0xf')]);router[_0x8062('0xe')]('/preview',auth[_0x8062('0x9')](),controller[_0x8062('0x10')]);router['put']('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0x11')]);router[_0x8062('0x12')]('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0x13')]);module[_0x8062('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fbc7e6f..fcf5a90 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 _0x374c=['STRING','INTEGER','contactListQueue','sequelize','exports'];(function(_0x120ab8,_0x577eb9){var _0x597e51=function(_0x165bf4){while(--_0x165bf4){_0x120ab8['push'](_0x120ab8['shift']());}};_0x597e51(++_0x577eb9);}(_0x374c,0x1e3));var _0xc374=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x374c[_0x5037ab];return _0x512adb;};'use strict';var moment=require('moment');var Sequelize=require(_0xc374('0x0'));module[_0xc374('0x1')]={'phone':{'type':Sequelize[_0xc374('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc374('0x3')],'unique':_0xc374('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc374('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc374('0x4')}}; \ No newline at end of file +var _0x8876=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0xaaeefa,_0x4e9161){var _0x3873f4=function(_0xd6d20b){while(--_0xd6d20b){_0xaaeefa['push'](_0xaaeefa['shift']());}};_0x3873f4(++_0x4e9161);}(_0x8876,0xa0));var _0x6887=function(_0x15d748,_0x4bd8de){_0x15d748=_0x15d748-0x0;var _0x57ec7f=_0x8876[_0x15d748];return _0x57ec7f;};'use strict';var moment=require('moment');var Sequelize=require(_0x6887('0x0'));module[_0x6887('0x1')]={'phone':{'type':Sequelize[_0x6887('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6887('0x3')],'unique':_0x6887('0x4')},'ListId':{'type':Sequelize[_0x6887('0x3')],'unique':_0x6887('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6887('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 67d5d58..5ce4ee0 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 _0xec9f=['send','index','map','CmHopperBlack','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name'];(function(_0x35419d,_0x302b91){var _0x5e8be7=function(_0x402341){while(--_0x402341){_0x35419d['push'](_0x35419d['shift']());}};_0x5e8be7(++_0x302b91);}(_0xec9f,0xf8));var _0xfec9=function(_0x5e3529,_0x1fd4ca){_0x5e3529=_0x5e3529-0x0;var _0x3a44fe=_0xec9f[_0x5e3529];return _0x3a44fe;};'use strict';var emlformat=require(_0xfec9('0x0'));var rimraf=require(_0xfec9('0x1'));var zipdir=require(_0xfec9('0x2'));var jsonpatch=require(_0xfec9('0x3'));var rp=require(_0xfec9('0x4'));var moment=require(_0xfec9('0x5'));var BPromise=require(_0xfec9('0x6'));var Mustache=require(_0xfec9('0x7'));var util=require(_0xfec9('0x8'));var path=require(_0xfec9('0x9'));var sox=require(_0xfec9('0xa'));var csv=require('to-csv');var ejs=require(_0xfec9('0xb'));var fs=require('fs');var fs_extra=require(_0xfec9('0xc'));var _=require('lodash');var squel=require(_0xfec9('0xd'));var crypto=require('crypto');var jsforce=require(_0xfec9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfec9('0xf'));var Redis=require(_0xfec9('0x10'));var authService=require(_0xfec9('0x11'));var qs=require(_0xfec9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfec9('0x13'))('api');var utils=require(_0xfec9('0x14'));var config=require(_0xfec9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfec9('0x16'))['db'];function respondWithStatusCode(_0x55eb0e,_0x381fa1){_0x381fa1=_0x381fa1||0xcc;return function(_0x43c0ab){if(_0x43c0ab){return _0x55eb0e[_0xfec9('0x17')](_0x381fa1);}return _0x55eb0e[_0xfec9('0x18')](_0x381fa1)[_0xfec9('0x19')]();};}function respondWithResult(_0x2167b0,_0x9757c3){_0x9757c3=_0x9757c3||0xc8;return function(_0x1e94c2){if(_0x1e94c2){return _0x2167b0['status'](_0x9757c3)[_0xfec9('0x1a')](_0x1e94c2);}};}function respondWithFilteredResult(_0x43ad96,_0xf17464){return function(_0x11166f){if(_0x11166f){var _0x3d8042=typeof _0xf17464['offset']===_0xfec9('0x1b')&&typeof _0xf17464[_0xfec9('0x1c')]===_0xfec9('0x1b');var _0x28349c=_0x11166f[_0xfec9('0x1d')];var _0x4f2d9f=_0x3d8042?0x0:_0xf17464[_0xfec9('0x1e')];var _0x50a960=_0x3d8042?_0x11166f[_0xfec9('0x1d')]:_0xf17464[_0xfec9('0x1e')]+_0xf17464['limit'];var _0x5e9008;if(_0x50a960>=_0x28349c){_0x50a960=_0x28349c;_0x5e9008=0xc8;}else{_0x5e9008=0xce;}_0x43ad96[_0xfec9('0x18')](_0x5e9008);return _0x43ad96[_0xfec9('0x1f')]('Content-Range',_0x4f2d9f+'-'+_0x50a960+'/'+_0x28349c)[_0xfec9('0x1a')](_0x11166f);}return null;};}function patchUpdates(_0x39b9d2){return function(_0x200997){try{jsonpatch[_0xfec9('0x20')](_0x200997,_0x39b9d2,!![]);}catch(_0x540778){return BPromise[_0xfec9('0x21')](_0x540778);}return _0x200997[_0xfec9('0x22')]();};}function saveUpdates(_0x3eaa1e,_0x47b3ed){return function(_0x367a58){if(_0x367a58){return _0x367a58[_0xfec9('0x23')](_0x3eaa1e)[_0xfec9('0x24')](function(_0x1e4e13){return _0x1e4e13;});}return null;};}function removeEntity(_0x571e2f,_0x309b7c){return function(_0x264a17){if(_0x264a17){return _0x264a17[_0xfec9('0x25')]()[_0xfec9('0x24')](function(){_0x571e2f[_0xfec9('0x18')](0xcc)[_0xfec9('0x19')]();});}};}function handleEntityNotFound(_0x5a7529,_0x718ca4){return function(_0x5b625d){if(!_0x5b625d){_0x5a7529[_0xfec9('0x17')](0x194);}return _0x5b625d;};}function handleError(_0x4c4378,_0x17e917){_0x17e917=_0x17e917||0x1f4;return function(_0x3b7375){logger[_0xfec9('0x26')](_0x3b7375['stack']);if(_0x3b7375[_0xfec9('0x27')]){delete _0x3b7375[_0xfec9('0x27')];}_0x4c4378[_0xfec9('0x18')](_0x17e917)[_0xfec9('0x28')](_0x3b7375);};}exports[_0xfec9('0x29')]=function(_0x3861d0,_0x5c90fb){var _0x3c8394={},_0x3a224c={},_0x5d4861={'count':0x0,'rows':[]};var _0x4e662a=_[_0xfec9('0x2a')](db[_0xfec9('0x2b')]['rawAttributes'],function(_0x23d5c3){return{'name':_0x23d5c3['fieldName'],'type':_0x23d5c3[_0xfec9('0x2c')]['key']};});_0x3a224c[_0xfec9('0x2d')]=_[_0xfec9('0x2a')](_0x4e662a,_0xfec9('0x27'));_0x3a224c[_0xfec9('0x2e')]=_[_0xfec9('0x2f')](_0x3861d0[_0xfec9('0x2e')]);_0x3a224c['filters']=_[_0xfec9('0x30')](_0x3a224c[_0xfec9('0x2d')],_0x3a224c[_0xfec9('0x2e')]);_0x3c8394[_0xfec9('0x31')]=_[_0xfec9('0x30')](_0x3a224c[_0xfec9('0x2d')],qs[_0xfec9('0x32')](_0x3861d0[_0xfec9('0x2e')]['fields']));_0x3c8394[_0xfec9('0x31')]=_0x3c8394[_0xfec9('0x31')][_0xfec9('0x33')]?_0x3c8394[_0xfec9('0x31')]:_0x3a224c[_0xfec9('0x2d')];if(!_0x3861d0[_0xfec9('0x2e')][_0xfec9('0x34')](_0xfec9('0x35'))){_0x3c8394['limit']=qs[_0xfec9('0x1c')](_0x3861d0[_0xfec9('0x2e')][_0xfec9('0x1c')]);_0x3c8394[_0xfec9('0x1e')]=qs[_0xfec9('0x1e')](_0x3861d0[_0xfec9('0x2e')]['offset']);}_0x3c8394[_0xfec9('0x36')]=qs[_0xfec9('0x37')](_0x3861d0[_0xfec9('0x2e')][_0xfec9('0x37')]);_0x3c8394[_0xfec9('0x38')]=qs[_0xfec9('0x39')](_[_0xfec9('0x3a')](_0x3861d0[_0xfec9('0x2e')],_0x3a224c[_0xfec9('0x39')]),_0x4e662a);if(_0x3861d0['query']['filter']){_0x3c8394[_0xfec9('0x38')]=_[_0xfec9('0x3b')](_0x3c8394['where'],{'$or':_[_0xfec9('0x2a')](_0x4e662a,function(_0x81f1d0){if(_0x81f1d0[_0xfec9('0x2c')]!==_0xfec9('0x3c')){var _0x2da4b2={};_0x2da4b2[_0x81f1d0['name']]={'$like':'%'+_0x3861d0['query'][_0xfec9('0x3d')]+'%'};return _0x2da4b2;}})});}_0x3c8394=_[_0xfec9('0x3b')]({},_0x3c8394,_0x3861d0[_0xfec9('0x3e')]);var _0x56c7d6={'where':_0x3c8394[_0xfec9('0x38')]};return db[_0xfec9('0x2b')][_0xfec9('0x1d')](_0x56c7d6)[_0xfec9('0x24')](function(_0x7879d3){_0x5d4861[_0xfec9('0x1d')]=_0x7879d3;if(_0x3861d0['query'][_0xfec9('0x3f')]){_0x3c8394[_0xfec9('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xfec9('0x41')](_0x3c8394);})[_0xfec9('0x24')](function(_0x14773d){_0x5d4861['rows']=_0x14773d;return _0x5d4861;})[_0xfec9('0x24')](respondWithFilteredResult(_0x5c90fb,_0x3c8394))[_0xfec9('0x42')](handleError(_0x5c90fb,null));};exports[_0xfec9('0x43')]=function(_0x534a43,_0x1b2db3){var _0x246a95={'raw':!![],'where':{'id':_0x534a43[_0xfec9('0x44')]['id']}},_0x46bcc2={};_0x46bcc2[_0xfec9('0x2d')]=_[_0xfec9('0x2f')](db[_0xfec9('0x2b')]['rawAttributes']);_0x46bcc2[_0xfec9('0x2e')]=_[_0xfec9('0x2f')](_0x534a43[_0xfec9('0x2e')]);_0x46bcc2[_0xfec9('0x39')]=_[_0xfec9('0x30')](_0x46bcc2[_0xfec9('0x2d')],_0x46bcc2['query']);_0x246a95[_0xfec9('0x31')]=_[_0xfec9('0x30')](_0x46bcc2[_0xfec9('0x2d')],qs[_0xfec9('0x32')](_0x534a43[_0xfec9('0x2e')][_0xfec9('0x32')]));_0x246a95['attributes']=_0x246a95['attributes'][_0xfec9('0x33')]?_0x246a95[_0xfec9('0x31')]:_0x46bcc2[_0xfec9('0x2d')];if(_0x534a43[_0xfec9('0x2e')][_0xfec9('0x3f')]){_0x246a95['include']=[{'all':!![]}];}_0x246a95=_['merge']({},_0x246a95,_0x534a43[_0xfec9('0x3e')]);return db[_0xfec9('0x2b')][_0xfec9('0x45')](_0x246a95)['then'](handleEntityNotFound(_0x1b2db3,null))[_0xfec9('0x24')](respondWithResult(_0x1b2db3,null))['catch'](handleError(_0x1b2db3,null));};exports[_0xfec9('0x23')]=function(_0x232156,_0x17f133){if(_0x232156[_0xfec9('0x46')]['id']){delete _0x232156[_0xfec9('0x46')]['id'];}return db[_0xfec9('0x2b')][_0xfec9('0x45')]({'where':{'id':_0x232156[_0xfec9('0x44')]['id']}})[_0xfec9('0x24')](handleEntityNotFound(_0x17f133,null))[_0xfec9('0x24')](saveUpdates(_0x232156[_0xfec9('0x46')],null))[_0xfec9('0x24')](respondWithResult(_0x17f133,null))[_0xfec9('0x42')](handleError(_0x17f133,null));};exports[_0xfec9('0x25')]=function(_0x1184eb,_0x2f664f){return db[_0xfec9('0x2b')][_0xfec9('0x45')]({'where':{'id':_0x1184eb[_0xfec9('0x44')]['id']}})[_0xfec9('0x24')](handleEntityNotFound(_0x2f664f,null))['then'](removeEntity(_0x2f664f,null))[_0xfec9('0x42')](handleError(_0x2f664f,null));};exports[_0xfec9('0x47')]=function(_0x24ca58,_0x409480){return db[_0xfec9('0x2b')][_0xfec9('0x47')]()['then'](respondWithResult(_0x409480,null))['catch'](handleError(_0x409480,null));}; \ No newline at end of file +var _0x8259=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','CmHopperBlack','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','includeAll','rows','show','params','rawAttributes','keys','find','catch','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path'];(function(_0x23146a,_0x2c34ea){var _0x1fdb43=function(_0x3f32cb){while(--_0x3f32cb){_0x23146a['push'](_0x23146a['shift']());}};_0x1fdb43(++_0x2c34ea);}(_0x8259,0xd5));var _0x9825=function(_0x16aabf,_0x39a43f){_0x16aabf=_0x16aabf-0x0;var _0x1db1c9=_0x8259[_0x16aabf];return _0x1db1c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9825('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9825('0x1'));var rp=require(_0x9825('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9825('0x3'));var util=require(_0x9825('0x4'));var path=require(_0x9825('0x5'));var sox=require(_0x9825('0x6'));var csv=require(_0x9825('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9825('0x8'));var _=require(_0x9825('0x9'));var squel=require(_0x9825('0xa'));var crypto=require(_0x9825('0xb'));var jsforce=require(_0x9825('0xc'));var deskjs=require(_0x9825('0xd'));var toCsv=require(_0x9825('0x7'));var querystring=require(_0x9825('0xe'));var Papa=require(_0x9825('0xf'));var Redis=require(_0x9825('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9825('0x11'));var hardwareService=require(_0x9825('0x12'));var logger=require(_0x9825('0x13'))(_0x9825('0x14'));var utils=require(_0x9825('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9825('0x16'));var db=require(_0x9825('0x17'))['db'];function respondWithStatusCode(_0x16a017,_0x4b4cac){_0x4b4cac=_0x4b4cac||0xcc;return function(_0x480620){if(_0x480620){return _0x16a017[_0x9825('0x18')](_0x4b4cac);}return _0x16a017[_0x9825('0x19')](_0x4b4cac)[_0x9825('0x1a')]();};}function respondWithResult(_0x7ecb4f,_0x28861f){_0x28861f=_0x28861f||0xc8;return function(_0x4a9ec9){if(_0x4a9ec9){return _0x7ecb4f[_0x9825('0x19')](_0x28861f)[_0x9825('0x1b')](_0x4a9ec9);}};}function respondWithFilteredResult(_0x59c67e,_0x57a847){return function(_0x3b96c8){if(_0x3b96c8){var _0x52a25f=typeof _0x57a847['offset']===_0x9825('0x1c')&&typeof _0x57a847[_0x9825('0x1d')]===_0x9825('0x1c');var _0x4dfb52=_0x3b96c8[_0x9825('0x1e')];var _0x1b038a=_0x52a25f?0x0:_0x57a847[_0x9825('0x1f')];var _0x5ab5af=_0x52a25f?_0x3b96c8[_0x9825('0x1e')]:_0x57a847[_0x9825('0x1f')]+_0x57a847['limit'];var _0x1863ba;if(_0x5ab5af>=_0x4dfb52){_0x5ab5af=_0x4dfb52;_0x1863ba=0xc8;}else{_0x1863ba=0xce;}_0x59c67e['status'](_0x1863ba);return _0x59c67e[_0x9825('0x20')](_0x9825('0x21'),_0x1b038a+'-'+_0x5ab5af+'/'+_0x4dfb52)[_0x9825('0x1b')](_0x3b96c8);}return null;};}function patchUpdates(_0x348a09){return function(_0x21d551){try{jsonpatch[_0x9825('0x22')](_0x21d551,_0x348a09,!![]);}catch(_0x215d2c){return BPromise[_0x9825('0x23')](_0x215d2c);}return _0x21d551[_0x9825('0x24')]();};}function saveUpdates(_0x261f94,_0x41e744){return function(_0x277703){if(_0x277703){return _0x277703[_0x9825('0x25')](_0x261f94)[_0x9825('0x26')](function(_0x5dc199){return _0x5dc199;});}return null;};}function removeEntity(_0x1ae924,_0x29f550){return function(_0x519555){if(_0x519555){return _0x519555[_0x9825('0x27')]()['then'](function(){_0x1ae924['status'](0xcc)[_0x9825('0x1a')]();});}};}function handleEntityNotFound(_0x2561dc,_0x5ab994){return function(_0x4033b9){if(!_0x4033b9){_0x2561dc['sendStatus'](0x194);}return _0x4033b9;};}function handleError(_0xe8a5f5,_0x3b75cc){_0x3b75cc=_0x3b75cc||0x1f4;return function(_0x4a63f4){logger[_0x9825('0x28')](_0x4a63f4['stack']);if(_0x4a63f4[_0x9825('0x29')]){delete _0x4a63f4['name'];}_0xe8a5f5[_0x9825('0x19')](_0x3b75cc)[_0x9825('0x2a')](_0x4a63f4);};}exports[_0x9825('0x2b')]=function(_0x107757,_0x286b60){var _0x4b5db2={},_0x4d52c0={},_0x2d969d={'count':0x0,'rows':[]};var _0x432b2c=_['map'](db[_0x9825('0x2c')]['rawAttributes'],function(_0x51301f){return{'name':_0x51301f[_0x9825('0x2d')],'type':_0x51301f['type'][_0x9825('0x2e')]};});_0x4d52c0[_0x9825('0x2f')]=_[_0x9825('0x30')](_0x432b2c,_0x9825('0x29'));_0x4d52c0[_0x9825('0x31')]=_['keys'](_0x107757[_0x9825('0x31')]);_0x4d52c0[_0x9825('0x32')]=_['intersection'](_0x4d52c0[_0x9825('0x2f')],_0x4d52c0[_0x9825('0x31')]);_0x4b5db2[_0x9825('0x33')]=_[_0x9825('0x34')](_0x4d52c0[_0x9825('0x2f')],qs[_0x9825('0x35')](_0x107757[_0x9825('0x31')][_0x9825('0x35')]));_0x4b5db2['attributes']=_0x4b5db2['attributes'][_0x9825('0x36')]?_0x4b5db2['attributes']:_0x4d52c0['model'];if(!_0x107757[_0x9825('0x31')][_0x9825('0x37')]('nolimit')){_0x4b5db2[_0x9825('0x1d')]=qs['limit'](_0x107757[_0x9825('0x31')]['limit']);_0x4b5db2[_0x9825('0x1f')]=qs[_0x9825('0x1f')](_0x107757[_0x9825('0x31')][_0x9825('0x1f')]);}_0x4b5db2[_0x9825('0x38')]=qs[_0x9825('0x39')](_0x107757[_0x9825('0x31')][_0x9825('0x39')]);_0x4b5db2['where']=qs[_0x9825('0x32')](_['pick'](_0x107757[_0x9825('0x31')],_0x4d52c0[_0x9825('0x32')]),_0x432b2c);if(_0x107757[_0x9825('0x31')][_0x9825('0x3a')]){_0x4b5db2[_0x9825('0x3b')]=_[_0x9825('0x3c')](_0x4b5db2[_0x9825('0x3b')],{'$or':_[_0x9825('0x30')](_0x432b2c,function(_0x5b6cab){if(_0x5b6cab[_0x9825('0x3d')]!==_0x9825('0x3e')){var _0x22ab3d={};_0x22ab3d[_0x5b6cab[_0x9825('0x29')]]={'$like':'%'+_0x107757[_0x9825('0x31')][_0x9825('0x3a')]+'%'};return _0x22ab3d;}})});}_0x4b5db2=_['merge']({},_0x4b5db2,_0x107757['options']);var _0xd65dc7={'where':_0x4b5db2[_0x9825('0x3b')]};return db[_0x9825('0x2c')][_0x9825('0x1e')](_0xd65dc7)[_0x9825('0x26')](function(_0x340434){_0x2d969d[_0x9825('0x1e')]=_0x340434;if(_0x107757[_0x9825('0x31')][_0x9825('0x3f')]){_0x4b5db2['include']=[{'all':!![]}];}return db[_0x9825('0x2c')]['findAll'](_0x4b5db2);})[_0x9825('0x26')](function(_0x472f9a){_0x2d969d[_0x9825('0x40')]=_0x472f9a;return _0x2d969d;})[_0x9825('0x26')](respondWithFilteredResult(_0x286b60,_0x4b5db2))['catch'](handleError(_0x286b60,null));};exports[_0x9825('0x41')]=function(_0x287d93,_0x2cd969){var _0x20b143={'raw':!![],'where':{'id':_0x287d93[_0x9825('0x42')]['id']}},_0xe1411b={};_0xe1411b[_0x9825('0x2f')]=_['keys'](db[_0x9825('0x2c')][_0x9825('0x43')]);_0xe1411b[_0x9825('0x31')]=_[_0x9825('0x44')](_0x287d93[_0x9825('0x31')]);_0xe1411b[_0x9825('0x32')]=_['intersection'](_0xe1411b[_0x9825('0x2f')],_0xe1411b[_0x9825('0x31')]);_0x20b143[_0x9825('0x33')]=_[_0x9825('0x34')](_0xe1411b[_0x9825('0x2f')],qs['fields'](_0x287d93[_0x9825('0x31')][_0x9825('0x35')]));_0x20b143[_0x9825('0x33')]=_0x20b143[_0x9825('0x33')][_0x9825('0x36')]?_0x20b143[_0x9825('0x33')]:_0xe1411b[_0x9825('0x2f')];if(_0x287d93[_0x9825('0x31')][_0x9825('0x3f')]){_0x20b143['include']=[{'all':!![]}];}_0x20b143=_[_0x9825('0x3c')]({},_0x20b143,_0x287d93['options']);return db[_0x9825('0x2c')][_0x9825('0x45')](_0x20b143)['then'](handleEntityNotFound(_0x2cd969,null))[_0x9825('0x26')](respondWithResult(_0x2cd969,null))[_0x9825('0x46')](handleError(_0x2cd969,null));};exports['update']=function(_0x49ec0a,_0x153dda){if(_0x49ec0a['body']['id']){delete _0x49ec0a[_0x9825('0x47')]['id'];}return db[_0x9825('0x2c')][_0x9825('0x45')]({'where':{'id':_0x49ec0a[_0x9825('0x42')]['id']}})[_0x9825('0x26')](handleEntityNotFound(_0x153dda,null))['then'](saveUpdates(_0x49ec0a['body'],null))[_0x9825('0x26')](respondWithResult(_0x153dda,null))['catch'](handleError(_0x153dda,null));};exports[_0x9825('0x27')]=function(_0x3370f3,_0x398a1a){return db[_0x9825('0x2c')]['find']({'where':{'id':_0x3370f3[_0x9825('0x42')]['id']}})[_0x9825('0x26')](handleEntityNotFound(_0x398a1a,null))[_0x9825('0x26')](removeEntity(_0x398a1a,null))[_0x9825('0x46')](handleError(_0x398a1a,null));};exports[_0x9825('0x48')]=function(_0x282f08,_0x5c3aee){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x5c3aee,null))[_0x9825('0x46')](handleError(_0x5c3aee,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 8d1c687..37f5083 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 _0x798d=['./cmHopperBlack.attributes','exports','cm_hopper_black','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2b8c3a,_0x3a8520){var _0x5a7673=function(_0x374fd8){while(--_0x374fd8){_0x2b8c3a['push'](_0x2b8c3a['shift']());}};_0x5a7673(++_0x3a8520);}(_0x798d,0x157));var _0xd798=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x798d[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xd798('0x0'));var logger=require(_0xd798('0x1'))(_0xd798('0x2'));var moment=require(_0xd798('0x3'));var BPromise=require(_0xd798('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd798('0x5'));var rimraf=require('rimraf');var config=require(_0xd798('0x6'));var attributes=require(_0xd798('0x7'));module[_0xd798('0x8')]=function(_0xddd297,_0xf2aad6){return _0xddd297['define']('CmHopperBlack',attributes,{'tableName':_0xd798('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2849=['lodash','util','api','bluebird','request-promise','path','rimraf','define','CmHopperBlack','cm_hopper_black'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x2849,0x1c2));var _0x9284=function(_0x210b62,_0x10ea64){_0x210b62=_0x210b62-0x0;var _0x3c9426=_0x2849[_0x210b62];return _0x3c9426;};'use strict';var _=require(_0x9284('0x0'));var util=require(_0x9284('0x1'));var logger=require('../../config/logger')(_0x9284('0x2'));var moment=require('moment');var BPromise=require(_0x9284('0x3'));var rp=require(_0x9284('0x4'));var fs=require('fs');var path=require(_0x9284('0x5'));var rimraf=require(_0x9284('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x5bf0e5,_0x40c87d){return _0x5bf0e5[_0x9284('0x7')](_0x9284('0x8'),attributes,{'tableName':_0x9284('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 8cf9d3d..d8c8e21 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 _0x3ef9=['result','catch','GetCmHopperBlack','findAll','raw','options','where','limit','include','map','model','attributes','stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','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','error','code','message'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x3ef9,0x17a));var _0x93ef=function(_0x255adc,_0x2eb889){_0x255adc=_0x255adc-0x0;var _0x8620ee=_0x3ef9[_0x255adc];return _0x8620ee;};'use strict';var _=require(_0x93ef('0x0'));var util=require('util');var moment=require(_0x93ef('0x1'));var BPromise=require(_0x93ef('0x2'));var rs=require(_0x93ef('0x3'));var fs=require('fs');var Redis=require(_0x93ef('0x4'));var db=require(_0x93ef('0x5'))['db'];var utils=require(_0x93ef('0x6'));var logger=require(_0x93ef('0x7'))(_0x93ef('0x8'));var config=require(_0x93ef('0x9'));var jayson=require(_0x93ef('0xa'));var client=jayson[_0x93ef('0xb')][_0x93ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x435911,_0x12eb2f,_0x5a1835){return new BPromise(function(_0x5e0536,_0x4ab21a){return client[_0x93ef('0xd')](_0x435911,_0x5a1835)[_0x93ef('0xe')](function(_0x266934){logger[_0x93ef('0xf')](_0x93ef('0x10'),_0x12eb2f,_0x93ef('0x11'));logger[_0x93ef('0x12')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x12eb2f,'request\x20sent',JSON['stringify'](_0x266934));if(_0x266934[_0x93ef('0x13')]){if(_0x266934['error'][_0x93ef('0x14')]===0x1f4){logger['error'](_0x93ef('0x10'),_0x12eb2f,_0x266934[_0x93ef('0x13')]['message']);return _0x4ab21a(_0x266934[_0x93ef('0x13')][_0x93ef('0x15')]);}logger[_0x93ef('0x13')](_0x93ef('0x10'),_0x12eb2f,_0x266934[_0x93ef('0x13')]['message']);return _0x5e0536(_0x266934[_0x93ef('0x13')][_0x93ef('0x15')]);}else{logger[_0x93ef('0xf')](_0x93ef('0x10'),_0x12eb2f,_0x93ef('0x11'));_0x5e0536(_0x266934[_0x93ef('0x16')][_0x93ef('0x15')]);}})[_0x93ef('0x17')](function(_0x497947){logger[_0x93ef('0x13')](_0x93ef('0x10'),_0x12eb2f,_0x497947);_0x4ab21a(_0x497947);});});}exports[_0x93ef('0x18')]=function(_0x4f6be1){var _0x301413=this;return new Promise(function(_0xde05d3,_0x2066b8){return db['CmHopperBlack'][_0x93ef('0x19')]({'raw':_0x4f6be1['options']?_0x4f6be1['options'][_0x93ef('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f6be1['options']?_0x4f6be1[_0x93ef('0x1b')][_0x93ef('0x1c')]||null:null,'attributes':_0x4f6be1[_0x93ef('0x1b')]?_0x4f6be1[_0x93ef('0x1b')]['attributes']||null:null,'limit':_0x4f6be1[_0x93ef('0x1b')]?_0x4f6be1[_0x93ef('0x1b')][_0x93ef('0x1d')]||null:null,'include':_0x4f6be1['options']?_0x4f6be1[_0x93ef('0x1b')][_0x93ef('0x1e')]?_[_0x93ef('0x1f')](_0x4f6be1[_0x93ef('0x1b')][_0x93ef('0x1e')],function(_0xcf0de0){return{'model':db[_0xcf0de0[_0x93ef('0x20')]],'as':_0xcf0de0['as'],'attributes':_0xcf0de0[_0x93ef('0x21')],'include':_0xcf0de0[_0x93ef('0x1e')]?_[_0x93ef('0x1f')](_0xcf0de0[_0x93ef('0x1e')],function(_0x2d0bd5){return{'model':db[_0x2d0bd5[_0x93ef('0x20')]],'as':_0x2d0bd5['as'],'attributes':_0x2d0bd5[_0x93ef('0x21')],'include':_0x2d0bd5[_0x93ef('0x1e')]?_[_0x93ef('0x1f')](_0x2d0bd5[_0x93ef('0x1e')],function(_0x562480){return{'model':db[_0x562480[_0x93ef('0x20')]],'as':_0x562480['as'],'attributes':_0x562480[_0x93ef('0x21')]};}):[]};}):[]};}):[]:[]})[_0x93ef('0xe')](function(_0x118661){logger[_0x93ef('0xf')](_0x93ef('0x18'),_0x4f6be1);logger[_0x93ef('0x12')](_0x93ef('0x18'),_0x4f6be1,JSON[_0x93ef('0x22')](_0x118661));_0xde05d3(_0x118661);})[_0x93ef('0x17')](function(_0x378070){logger[_0x93ef('0x13')](_0x93ef('0x18'),_0x378070[_0x93ef('0x15')],_0x4f6be1);_0x2066b8(_0x301413[_0x93ef('0x13')](0x1f4,_0x378070['message']));});});};exports[_0x93ef('0x23')]=function(_0x2af1f0){var _0x5d9286=this;return new Promise(function(_0x3236f3,_0x2e9513){return db[_0x93ef('0x24')][_0x93ef('0x25')](_0x2af1f0[_0x93ef('0x26')],{'raw':_0x2af1f0[_0x93ef('0x1b')]?_0x2af1f0['options'][_0x93ef('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af1f0['options']?_0x2af1f0[_0x93ef('0x1b')][_0x93ef('0x1c')]||null:null,'attributes':_0x2af1f0[_0x93ef('0x1b')]?_0x2af1f0[_0x93ef('0x1b')]['attributes']||null:null,'limit':_0x2af1f0['options']?_0x2af1f0[_0x93ef('0x1b')][_0x93ef('0x1d')]||null:null})[_0x93ef('0xe')](function(_0x4a8e92){logger['info']('UpdateCmHopperBlack',_0x2af1f0);logger[_0x93ef('0x12')]('UpdateCmHopperBlack',_0x2af1f0,JSON[_0x93ef('0x22')](_0x4a8e92));_0x3236f3(_0x4a8e92);})[_0x93ef('0x17')](function(_0x5d5c84){logger['error'](_0x93ef('0x23'),_0x5d5c84['message'],_0x2af1f0);_0x2e9513(_0x5d9286[_0x93ef('0x13')](0x1f4,_0x5d5c84[_0x93ef('0x15')]));});});};exports[_0x93ef('0x27')]=function(_0x508748){var _0x31dcee=this;return new Promise(function(_0x4d50f3,_0x1cf633){return db[_0x93ef('0x24')]['destroy']({'where':_0x508748['options']?_0x508748[_0x93ef('0x1b')]['where']||null:null})[_0x93ef('0xe')](function(_0x2d103d){logger['info'](_0x93ef('0x27'),_0x508748);logger[_0x93ef('0x12')](_0x93ef('0x27'),_0x508748,JSON['stringify'](_0x2d103d));_0x4d50f3(_0x2d103d);})[_0x93ef('0x17')](function(_0x32438c){logger[_0x93ef('0x13')](_0x93ef('0x27'),_0x32438c[_0x93ef('0x15')],_0x508748);_0x1cf633(_0x31dcee[_0x93ef('0x13')](0x1f4,_0x32438c[_0x93ef('0x15')]));});});}; \ No newline at end of file +var _0x2eb1=['attributes','limit','include','map','model','then','info','UpdateCmHopperBlack','raw','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where'];(function(_0x58267a,_0x54bfe9){var _0x34314a=function(_0x45e8e2){while(--_0x45e8e2){_0x58267a['push'](_0x58267a['shift']());}};_0x34314a(++_0x54bfe9);}(_0x2eb1,0x187));var _0x12eb=function(_0x3aad90,_0x190963){_0x3aad90=_0x3aad90-0x0;var _0x13ecb4=_0x2eb1[_0x3aad90];return _0x13ecb4;};'use strict';var _=require(_0x12eb('0x0'));var util=require('util');var moment=require(_0x12eb('0x1'));var BPromise=require(_0x12eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12eb('0x3'));var db=require(_0x12eb('0x4'))['db'];var utils=require(_0x12eb('0x5'));var logger=require(_0x12eb('0x6'))('rpc');var config=require(_0x12eb('0x7'));var jayson=require(_0x12eb('0x8'));var client=jayson[_0x12eb('0x9')][_0x12eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4ba3,_0x537948,_0x2defe3){return new BPromise(function(_0x2bb827,_0x44840d){return client[_0x12eb('0xb')](_0x5e4ba3,_0x2defe3)['then'](function(_0xfa6007){logger['info'](_0x12eb('0xc'),_0x537948,_0x12eb('0xd'));logger[_0x12eb('0xe')](_0x12eb('0xf'),_0x537948,_0x12eb('0xd'),JSON[_0x12eb('0x10')](_0xfa6007));if(_0xfa6007[_0x12eb('0x11')]){if(_0xfa6007[_0x12eb('0x11')][_0x12eb('0x12')]===0x1f4){logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0xfa6007['error'][_0x12eb('0x13')]);return _0x44840d(_0xfa6007['error'][_0x12eb('0x13')]);}logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0xfa6007['error'][_0x12eb('0x13')]);return _0x2bb827(_0xfa6007['error'][_0x12eb('0x13')]);}else{logger['info'](_0x12eb('0xc'),_0x537948,_0x12eb('0xd'));_0x2bb827(_0xfa6007[_0x12eb('0x14')][_0x12eb('0x13')]);}})[_0x12eb('0x15')](function(_0x390b47){logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0x390b47);_0x44840d(_0x390b47);});});}exports[_0x12eb('0x16')]=function(_0x224dd4){var _0xb4bd9=this;return new Promise(function(_0x4ba36d,_0x5d47f2){return db[_0x12eb('0x17')][_0x12eb('0x18')]({'raw':_0x224dd4['options']?_0x224dd4[_0x12eb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x224dd4['options']?_0x224dd4['options'][_0x12eb('0x1a')]||null:null,'attributes':_0x224dd4[_0x12eb('0x19')]?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1b')]||null:null,'limit':_0x224dd4[_0x12eb('0x19')]?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1c')]||null:null,'include':_0x224dd4['options']?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0x224dd4['options'][_0x12eb('0x1d')],function(_0xd246ce){return{'model':db[_0xd246ce['model']],'as':_0xd246ce['as'],'attributes':_0xd246ce[_0x12eb('0x1b')],'include':_0xd246ce[_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0xd246ce[_0x12eb('0x1d')],function(_0x2564a1){return{'model':db[_0x2564a1[_0x12eb('0x1f')]],'as':_0x2564a1['as'],'attributes':_0x2564a1['attributes'],'include':_0x2564a1[_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0x2564a1[_0x12eb('0x1d')],function(_0x4e0d6f){return{'model':db[_0x4e0d6f[_0x12eb('0x1f')]],'as':_0x4e0d6f['as'],'attributes':_0x4e0d6f[_0x12eb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12eb('0x20')](function(_0x3a8326){logger[_0x12eb('0x21')](_0x12eb('0x16'),_0x224dd4);logger['debug']('GetCmHopperBlack',_0x224dd4,JSON[_0x12eb('0x10')](_0x3a8326));_0x4ba36d(_0x3a8326);})['catch'](function(_0x5e15ae){logger[_0x12eb('0x11')](_0x12eb('0x16'),_0x5e15ae[_0x12eb('0x13')],_0x224dd4);_0x5d47f2(_0xb4bd9[_0x12eb('0x11')](0x1f4,_0x5e15ae[_0x12eb('0x13')]));});});};exports[_0x12eb('0x22')]=function(_0x1fa498){var _0xeb7b03=this;return new Promise(function(_0x3820af,_0xbe0434){return db[_0x12eb('0x17')]['update'](_0x1fa498['body'],{'raw':_0x1fa498[_0x12eb('0x19')]?_0x1fa498['options'][_0x12eb('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fa498[_0x12eb('0x19')]?_0x1fa498['options'][_0x12eb('0x1a')]||null:null,'attributes':_0x1fa498['options']?_0x1fa498['options']['attributes']||null:null,'limit':_0x1fa498[_0x12eb('0x19')]?_0x1fa498[_0x12eb('0x19')][_0x12eb('0x1c')]||null:null})[_0x12eb('0x20')](function(_0x2591dd){logger[_0x12eb('0x21')](_0x12eb('0x22'),_0x1fa498);logger['debug'](_0x12eb('0x22'),_0x1fa498,JSON[_0x12eb('0x10')](_0x2591dd));_0x3820af(_0x2591dd);})[_0x12eb('0x15')](function(_0x4d9a39){logger['error'](_0x12eb('0x22'),_0x4d9a39[_0x12eb('0x13')],_0x1fa498);_0xbe0434(_0xeb7b03[_0x12eb('0x11')](0x1f4,_0x4d9a39[_0x12eb('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x1570ef){var _0x57602f=this;return new Promise(function(_0x32b4ca,_0x1d8697){return db[_0x12eb('0x17')][_0x12eb('0x24')]({'where':_0x1570ef[_0x12eb('0x19')]?_0x1570ef[_0x12eb('0x19')][_0x12eb('0x1a')]||null:null})[_0x12eb('0x20')](function(_0x5b1466){logger[_0x12eb('0x21')]('DestroyCmHopperBlack',_0x1570ef);logger['debug'](_0x12eb('0x25'),_0x1570ef,JSON[_0x12eb('0x10')](_0x5b1466));_0x32b4ca(_0x5b1466);})[_0x12eb('0x15')](function(_0x1d0976){logger[_0x12eb('0x11')](_0x12eb('0x25'),_0x1d0976[_0x12eb('0x13')],_0x1570ef);_0x1d8697(_0x57602f[_0x12eb('0x11')](0x1f4,_0x1d0976[_0x12eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8392a28..210d5cf 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/:id',auth[_0x7413('0xe')](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x14')]=router; \ No newline at end of file +var _0x187d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x802fd8,_0x22af66){var _0x49edd4=function(_0x2a9d31){while(--_0x2a9d31){_0x802fd8['push'](_0x802fd8['shift']());}};_0x49edd4(++_0x22af66);}(_0x187d,0x93));var _0xd187=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x187d[_0x5c351c];return _0x26f3b3;};'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')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0x13')]);module[_0xd187('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d8a71de..1bd9af6 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 _0x23b5=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x7901bb,_0x66ac4e){var _0x3becf8=function(_0x172cec){while(--_0x172cec){_0x7901bb['push'](_0x7901bb['shift']());}};_0x3becf8(++_0x66ac4e);}(_0x23b5,0xc6));var _0x523b=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x23b5[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x523b('0x0'));var moment=require(_0x523b('0x1'));module[_0x523b('0x2')]={'state':{'type':Sequelize[_0x523b('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x523b('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x523b('0x4')]},'originatecalleridname':{'type':Sequelize[_0x523b('0x4')]},'calleridnum':{'type':Sequelize[_0x523b('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x523b('0x5')]},'answertime':{'type':Sequelize[_0x523b('0x5')]},'droptime':{'type':Sequelize[_0x523b('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x523b('0x4')]},'campaigntype':{'type':Sequelize[_0x523b('0x4')]},'membername':{'type':Sequelize[_0x523b('0x4')]},'reason':{'type':Sequelize[_0x523b('0x4')]},'disposition':{'type':Sequelize[_0x523b('0x4')]},'secondDisposition':{'type':Sequelize[_0x523b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x523b('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x13142b){var _0x1addc7=this['getDataValue'](_0x523b('0x6'));if(_0x1addc7&&_0x13142b){this[_0x523b('0x7')](_0x523b('0x8'),moment(_0x13142b)[_0x523b('0x9')](moment(_0x1addc7),_0x523b('0xa')));}return this[_0x523b('0x7')](_0x523b('0xb'),_0x13142b);}},'amd':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x523b('0x5')]},'callback':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x523b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x523b('0x5')]},'deleted':{'type':Sequelize[_0x523b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x523b('0x5')]},'recallme':{'type':Sequelize[_0x523b('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x523b('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4929=['endtime','setDataValue','followuptime','diff','BOOLEAN','moment','INTEGER','STRING','DATE'];(function(_0x2852b4,_0xa93121){var _0x138ced=function(_0x99a88c){while(--_0x99a88c){_0x2852b4['push'](_0x2852b4['shift']());}};_0x138ced(++_0xa93121);}(_0x4929,0xc2));var _0x9492=function(_0x303efb,_0x54a54a){_0x303efb=_0x303efb-0x0;var _0x217597=_0x4929[_0x303efb];return _0x217597;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9492('0x0'));module['exports']={'state':{'type':Sequelize[_0x9492('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9492('0x2')]},'scheduledat':{'type':Sequelize[_0x9492('0x3')]},'countbusyretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9492('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9492('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9492('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9492('0x2')]},'starttime':{'type':Sequelize[_0x9492('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9492('0x3')]},'endtime':{'type':Sequelize[_0x9492('0x3')]},'ringtime':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9492('0x2')]},'campaign':{'type':Sequelize[_0x9492('0x2')]},'campaigntype':{'type':Sequelize[_0x9492('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9492('0x2')]},'secondDisposition':{'type':Sequelize[_0x9492('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x9492('0x3')],'set':function(_0x2966bd){var _0x13b0e8=this['getDataValue'](_0x9492('0x4'));if(_0x13b0e8&&_0x2966bd){this[_0x9492('0x5')](_0x9492('0x6'),moment(_0x2966bd)[_0x9492('0x7')](moment(_0x13b0e8),'seconds'));}return this[_0x9492('0x5')]('dispositionat',_0x2966bd);}},'amd':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9492('0x3')]},'callback':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9492('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9492('0x3')]},'deleted':{'type':Sequelize[_0x9492('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9492('0x3')]},'recallme':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9492('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9492('0x1')],'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 8ae7399..9981a89 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 _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x524e,0x15e));var _0xe524=function(_0x30e751,_0xef7d24){_0x30e751=_0x30e751-0x0;var _0x32fc56=_0x524e[_0x30e751];return _0x32fc56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file +var _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x562b5f,_0x533966){var _0x128a56=function(_0x493447){while(--_0x493447){_0x562b5f['push'](_0x562b5f['shift']());}};_0x128a56(++_0x533966);}(_0x430c,0x1a1));var _0xc430=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x430c[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ba20d5e..0574df2 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 _0xbf42=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xbf42,0xf3));var _0x2bf4=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xbf42[_0x58965a];return _0x254efc;};'use strict';var _=require(_0x2bf4('0x0'));var util=require('util');var logger=require(_0x2bf4('0x1'))(_0x2bf4('0x2'));var moment=require('moment');var BPromise=require(_0x2bf4('0x3'));var rp=require(_0x2bf4('0x4'));var fs=require('fs');var path=require(_0x2bf4('0x5'));var rimraf=require(_0x2bf4('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bf4('0x7'));module[_0x2bf4('0x8')]=function(_0x13acde,_0x208bd2){return _0x13acde[_0x2bf4('0x9')](_0x2bf4('0xa'),attributes,{'tableName':_0x2bf4('0xb'),'paranoid':![],'indexes':[{'name':_0x2bf4('0xc'),'fields':[_0x2bf4('0xc')]},{'name':'uniqueid','fields':[_0x2bf4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9824=['rimraf','../../config/environment','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x9824,0x6f));var _0x4982=function(_0x22ce61,_0x9c0f01){_0x22ce61=_0x22ce61-0x0;var _0x57bb55=_0x9824[_0x22ce61];return _0x57bb55;};'use strict';var _=require(_0x4982('0x0'));var util=require(_0x4982('0x1'));var logger=require(_0x4982('0x2'))(_0x4982('0x3'));var moment=require('moment');var BPromise=require(_0x4982('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4982('0x5'));var rimraf=require(_0x4982('0x6'));var config=require(_0x4982('0x7'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x200fc5,_0x336416){return _0x200fc5[_0x4982('0x8')](_0x4982('0x9'),attributes,{'tableName':_0x4982('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x4982('0xb')]},{'name':_0x4982('0xc'),'fields':[_0x4982('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 e23e20b..0d657fe 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x1c5ca5,_0xb79027){var _0x822be2=function(_0x10d51b){while(--_0x10d51b){_0x1c5ca5['push'](_0x1c5ca5['shift']());}};_0x822be2(++_0xb79027);}(_0xb10b,0x12a));var _0xbb10=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xb10b[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x4aebb6,_0x2208f7){var _0x2d62a0=function(_0x335a60){while(--_0x335a60){_0x4aebb6['push'](_0x4aebb6['shift']());}};_0x2d62a0(++_0x2208f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xb10b[_0x38c652];return _0x218a37;};'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 5b5ac57..f80e049 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 _0x4444=['update','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper'];(function(_0x2b32cb,_0x195222){var _0x34cb1a=function(_0x1f9609){while(--_0x1f9609){_0x2b32cb['push'](_0x2b32cb['shift']());}};_0x34cb1a(++_0x195222);}(_0x4444,0x17e));var _0x4444=function(_0x2acec2,_0x12ebf1){_0x2acec2=_0x2acec2-0x0;var _0x19aa0d=_0x4444[_0x2acec2];return _0x19aa0d;};'use strict';var multer=require(_0x4444('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4444('0x1'));var router=express[_0x4444('0x2')]();var fs_extra=require(_0x4444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4444('0x4'));var config=require(_0x4444('0x5'));var controller=require(_0x4444('0x6'));router[_0x4444('0x7')]('/',auth[_0x4444('0x8')](),controller['index']);router[_0x4444('0x7')]('/describe',auth[_0x4444('0x8')](),controller['describe']);router[_0x4444('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4444('0x9')]);router['get'](_0x4444('0xa'),auth[_0x4444('0x8')](),controller[_0x4444('0xb')]);router['get'](_0x4444('0xc'),auth[_0x4444('0x8')](),controller[_0x4444('0xd')]);router[_0x4444('0xe')]('/voice/queue/moveContacts/:id',auth[_0x4444('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x4444('0xe')](_0x4444('0xf'),auth[_0x4444('0x8')](),controller[_0x4444('0x10')]);router['post']('/checkContactHopper',auth[_0x4444('0x8')](),controller[_0x4444('0x11')]);router['put']('/:id',auth[_0x4444('0x8')](),controller[_0x4444('0x12')]);module[_0x4444('0x13')]=router; \ No newline at end of file +var _0x5ce3=['checkContactHopper','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0xe44380,_0x1fb0d8){var _0x2a3edd=function(_0x5c75cb){while(--_0x5c75cb){_0xe44380['push'](_0xe44380['shift']());}};_0x2a3edd(++_0x1fb0d8);}(_0x5ce3,0x80));var _0x35ce=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0x5ce3[_0x46b1c9];return _0x17569c;};'use strict';var multer=require(_0x35ce('0x0'));var util=require(_0x35ce('0x1'));var path=require(_0x35ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x35ce('0x3'));var router=express['Router']();var fs_extra=require(_0x35ce('0x4'));var auth=require(_0x35ce('0x5'));var interaction=require(_0x35ce('0x6'));var config=require(_0x35ce('0x7'));var controller=require(_0x35ce('0x8'));router[_0x35ce('0x9')]('/',auth[_0x35ce('0xa')](),controller[_0x35ce('0xb')]);router[_0x35ce('0x9')](_0x35ce('0xc'),auth['isAuthenticated'](),controller[_0x35ce('0xd')]);router['get'](_0x35ce('0xe'),auth[_0x35ce('0xa')](),controller['show']);router[_0x35ce('0x9')](_0x35ce('0xf'),auth['isAuthenticated'](),controller[_0x35ce('0x10')]);router[_0x35ce('0x9')](_0x35ce('0x11'),auth['isAuthenticated'](),controller[_0x35ce('0x12')]);router[_0x35ce('0x13')]('/voice/queue/moveContacts/:id',auth[_0x35ce('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x35ce('0x14')]);router[_0x35ce('0x13')](_0x35ce('0x15'),auth[_0x35ce('0xa')](),controller[_0x35ce('0x16')]);router['put'](_0x35ce('0xe'),auth['isAuthenticated'](),controller[_0x35ce('0x17')]);module[_0x35ce('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index a05ebc2..2b29a2f 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 _0xbe9f=['DATE','BOOLEAN','exports','INTEGER','STRING'];(function(_0xc48d3c,_0x434018){var _0x538ef7=function(_0x2ebf24){while(--_0x2ebf24){_0xc48d3c['push'](_0xc48d3c['shift']());}};_0x538ef7(++_0x434018);}(_0xbe9f,0xc0));var _0xfbe9=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xbe9f[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require('sequelize');module[_0xfbe9('0x0')]={'state':{'type':Sequelize[_0xfbe9('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfbe9('0x2')]},'scheduledat':{'type':Sequelize[_0xfbe9('0x3')]},'countbusyretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfbe9('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfbe9('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfbe9('0x2')]},'calleridnum':{'type':Sequelize[_0xfbe9('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xfbe9('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfbe9('0x3')]},'endtime':{'type':Sequelize[_0xfbe9('0x3')]},'ringtime':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfbe9('0x2')]},'campaign':{'type':Sequelize[_0xfbe9('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfbe9('0x2')]},'reason':{'type':Sequelize[_0xfbe9('0x2')]},'amd':{'type':Sequelize[_0xfbe9('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfbe9('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfbe9('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfbe9('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfbe9('0x3')]},'recallme':{'type':Sequelize[_0xfbe9('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfbe9('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfbe9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x91d0=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x1ebdb0,_0x41a16f){var _0x2af68f=function(_0xd8e4f4){while(--_0xd8e4f4){_0x1ebdb0['push'](_0x1ebdb0['shift']());}};_0x2af68f(++_0x41a16f);}(_0x91d0,0xb0));var _0x091d=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x91d0[_0x119b3e];return _0x1169ae;};'use strict';var Sequelize=require(_0x091d('0x0'));module['exports']={'state':{'type':Sequelize[_0x091d('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x091d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x091d('0x2')]},'calleridnum':{'type':Sequelize[_0x091d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x091d('0x3')]},'responsetime':{'type':Sequelize[_0x091d('0x3')]},'answertime':{'type':Sequelize[_0x091d('0x3')]},'droptime':{'type':Sequelize[_0x091d('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x091d('0x2')]},'campaign':{'type':Sequelize[_0x091d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x091d('0x2')]},'reason':{'type':Sequelize[_0x091d('0x2')]},'amd':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x091d('0x3')]},'recallme':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x091d('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 609ff78..5c7df53 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 _0x4f53=['show','params','keys','length','find','create','body','describe','uniqueid','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x185fb1,_0x30ad2f){var _0x3ab848=function(_0x4a40f6){while(--_0x4a40f6){_0x185fb1['push'](_0x185fb1['shift']());}};_0x3ab848(++_0x30ad2f);}(_0x4f53,0x19e));var _0x34f5=function(_0x486f7b,_0x206da9){_0x486f7b=_0x486f7b-0x0;var _0x56334c=_0x4f53[_0x486f7b];return _0x56334c;};'use strict';var emlformat=require(_0x34f5('0x0'));var rimraf=require(_0x34f5('0x1'));var zipdir=require(_0x34f5('0x2'));var jsonpatch=require(_0x34f5('0x3'));var rp=require(_0x34f5('0x4'));var moment=require('moment');var BPromise=require(_0x34f5('0x5'));var Mustache=require(_0x34f5('0x6'));var util=require(_0x34f5('0x7'));var path=require(_0x34f5('0x8'));var sox=require(_0x34f5('0x9'));var csv=require(_0x34f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34f5('0xb'));var _=require(_0x34f5('0xc'));var squel=require(_0x34f5('0xd'));var crypto=require(_0x34f5('0xe'));var jsforce=require(_0x34f5('0xf'));var deskjs=require(_0x34f5('0x10'));var toCsv=require(_0x34f5('0xa'));var querystring=require(_0x34f5('0x11'));var Papa=require(_0x34f5('0x12'));var Redis=require(_0x34f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x34f5('0x14'));var as=require(_0x34f5('0x15'));var hardwareService=require(_0x34f5('0x16'));var logger=require(_0x34f5('0x17'))(_0x34f5('0x18'));var utils=require(_0x34f5('0x19'));var config=require(_0x34f5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x34f5('0x1b'))['db'];function respondWithStatusCode(_0x16bd20,_0x18c4f0){_0x18c4f0=_0x18c4f0||0xcc;return function(_0x181723){if(_0x181723){return _0x16bd20[_0x34f5('0x1c')](_0x18c4f0);}return _0x16bd20[_0x34f5('0x1d')](_0x18c4f0)[_0x34f5('0x1e')]();};}function respondWithResult(_0x46d105,_0x5550bb){_0x5550bb=_0x5550bb||0xc8;return function(_0xc3dd7a){if(_0xc3dd7a){return _0x46d105[_0x34f5('0x1d')](_0x5550bb)[_0x34f5('0x1f')](_0xc3dd7a);}};}function respondWithFilteredResult(_0x5b4e1b,_0x46e3e6){return function(_0x2bd038){if(_0x2bd038){var _0x2942a4=typeof _0x46e3e6['offset']===_0x34f5('0x20')&&typeof _0x46e3e6[_0x34f5('0x21')]===_0x34f5('0x20');var _0x2ced07=_0x2bd038[_0x34f5('0x22')];var _0x3fdb71=_0x2942a4?0x0:_0x46e3e6[_0x34f5('0x23')];var _0xbbbe52=_0x2942a4?_0x2bd038[_0x34f5('0x22')]:_0x46e3e6['offset']+_0x46e3e6[_0x34f5('0x21')];var _0x4a6467;if(_0xbbbe52>=_0x2ced07){_0xbbbe52=_0x2ced07;_0x4a6467=0xc8;}else{_0x4a6467=0xce;}_0x5b4e1b['status'](_0x4a6467);return _0x5b4e1b[_0x34f5('0x24')](_0x34f5('0x25'),_0x3fdb71+'-'+_0xbbbe52+'/'+_0x2ced07)[_0x34f5('0x1f')](_0x2bd038);}return null;};}function patchUpdates(_0x498de1){return function(_0x4262fa){try{jsonpatch[_0x34f5('0x26')](_0x4262fa,_0x498de1,!![]);}catch(_0x1459d0){return BPromise[_0x34f5('0x27')](_0x1459d0);}return _0x4262fa[_0x34f5('0x28')]();};}function saveUpdates(_0x4a8a99,_0x253276){return function(_0x62f3c2){if(_0x62f3c2){return _0x62f3c2[_0x34f5('0x29')](_0x4a8a99)[_0x34f5('0x2a')](function(_0x460ec7){return _0x460ec7;});}return null;};}function removeEntity(_0x3042bd,_0x34f1c1){return function(_0x53eb19){if(_0x53eb19){return _0x53eb19['destroy']()['then'](function(){_0x3042bd[_0x34f5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a186d,_0x4f1086){return function(_0x2058c5){if(!_0x2058c5){_0x3a186d[_0x34f5('0x1c')](0x194);}return _0x2058c5;};}function handleError(_0x2aa4f5,_0x2d7bfb){_0x2d7bfb=_0x2d7bfb||0x1f4;return function(_0x4a3f9d){logger['error'](_0x4a3f9d[_0x34f5('0x2b')]);if(_0x4a3f9d['name']){delete _0x4a3f9d['name'];}_0x2aa4f5[_0x34f5('0x1d')](_0x2d7bfb)[_0x34f5('0x2c')](_0x4a3f9d);};}exports[_0x34f5('0x2d')]=function(_0x5e379c,_0x1596ab){var _0x48188b={},_0x58bc1e={},_0x4b9b9e={'count':0x0,'rows':[]};var _0x1819be=_[_0x34f5('0x2e')](db[_0x34f5('0x2f')][_0x34f5('0x30')],function(_0x9154fa){return{'name':_0x9154fa[_0x34f5('0x31')],'type':_0x9154fa['type'][_0x34f5('0x32')]};});_0x58bc1e['model']=_[_0x34f5('0x2e')](_0x1819be,_0x34f5('0x33'));_0x58bc1e[_0x34f5('0x34')]=_['keys'](_0x5e379c['query']);_0x58bc1e[_0x34f5('0x35')]=_[_0x34f5('0x36')](_0x58bc1e[_0x34f5('0x37')],_0x58bc1e[_0x34f5('0x34')]);_0x48188b[_0x34f5('0x38')]=_['intersection'](_0x58bc1e[_0x34f5('0x37')],qs[_0x34f5('0x39')](_0x5e379c['query'][_0x34f5('0x39')]));_0x48188b[_0x34f5('0x38')]=_0x48188b['attributes']['length']?_0x48188b[_0x34f5('0x38')]:_0x58bc1e[_0x34f5('0x37')];if(!_0x5e379c[_0x34f5('0x34')][_0x34f5('0x3a')](_0x34f5('0x3b'))){_0x48188b[_0x34f5('0x21')]=qs[_0x34f5('0x21')](_0x5e379c[_0x34f5('0x34')][_0x34f5('0x21')]);_0x48188b[_0x34f5('0x23')]=qs[_0x34f5('0x23')](_0x5e379c[_0x34f5('0x34')][_0x34f5('0x23')]);}_0x48188b['order']=qs[_0x34f5('0x3c')](_0x5e379c['query'][_0x34f5('0x3c')]);_0x48188b[_0x34f5('0x3d')]=qs[_0x34f5('0x35')](_[_0x34f5('0x3e')](_0x5e379c[_0x34f5('0x34')],_0x58bc1e[_0x34f5('0x35')]),_0x1819be);if(_0x5e379c[_0x34f5('0x34')][_0x34f5('0x3f')]){_0x48188b[_0x34f5('0x3d')]=_['merge'](_0x48188b[_0x34f5('0x3d')],{'$or':_[_0x34f5('0x2e')](_0x1819be,function(_0xac9891){if(_0xac9891['type']!==_0x34f5('0x40')){var _0x1706e7={};_0x1706e7[_0xac9891[_0x34f5('0x33')]]={'$like':'%'+_0x5e379c['query']['filter']+'%'};return _0x1706e7;}})});}_0x48188b=_[_0x34f5('0x41')]({},_0x48188b,_0x5e379c[_0x34f5('0x42')]);var _0x138a9a={'where':_0x48188b[_0x34f5('0x3d')]};return db[_0x34f5('0x2f')]['count'](_0x138a9a)['then'](function(_0x572ecd){_0x4b9b9e[_0x34f5('0x22')]=_0x572ecd;if(_0x5e379c['query'][_0x34f5('0x43')]){_0x48188b[_0x34f5('0x44')]=[{'all':!![]}];}return db[_0x34f5('0x2f')][_0x34f5('0x45')](_0x48188b);})[_0x34f5('0x2a')](function(_0x3d219d){_0x4b9b9e[_0x34f5('0x46')]=_0x3d219d;return _0x4b9b9e;})[_0x34f5('0x2a')](respondWithFilteredResult(_0x1596ab,_0x48188b))[_0x34f5('0x47')](handleError(_0x1596ab,null));};exports[_0x34f5('0x48')]=function(_0x42a4ac,_0xa50068){var _0x394955={'raw':!![],'where':{'id':_0x42a4ac[_0x34f5('0x49')]['id']}},_0x50a854={};_0x50a854[_0x34f5('0x37')]=_['keys'](db[_0x34f5('0x2f')][_0x34f5('0x30')]);_0x50a854[_0x34f5('0x34')]=_[_0x34f5('0x4a')](_0x42a4ac[_0x34f5('0x34')]);_0x50a854[_0x34f5('0x35')]=_['intersection'](_0x50a854[_0x34f5('0x37')],_0x50a854['query']);_0x394955[_0x34f5('0x38')]=_['intersection'](_0x50a854['model'],qs[_0x34f5('0x39')](_0x42a4ac['query']['fields']));_0x394955[_0x34f5('0x38')]=_0x394955[_0x34f5('0x38')][_0x34f5('0x4b')]?_0x394955['attributes']:_0x50a854[_0x34f5('0x37')];if(_0x42a4ac[_0x34f5('0x34')][_0x34f5('0x43')]){_0x394955[_0x34f5('0x44')]=[{'all':!![]}];}_0x394955=_[_0x34f5('0x41')]({},_0x394955,_0x42a4ac[_0x34f5('0x42')]);return db[_0x34f5('0x2f')][_0x34f5('0x4c')](_0x394955)[_0x34f5('0x2a')](handleEntityNotFound(_0xa50068,null))[_0x34f5('0x2a')](respondWithResult(_0xa50068,null))[_0x34f5('0x47')](handleError(_0xa50068,null));};exports[_0x34f5('0x4d')]=function(_0x5c2963,_0x1a7d35){return db[_0x34f5('0x2f')][_0x34f5('0x4d')](_0x5c2963[_0x34f5('0x4e')],{})['then'](respondWithResult(_0x1a7d35,0xc9))['catch'](handleError(_0x1a7d35,null));};exports[_0x34f5('0x4f')]=function(_0x12f66d,_0x5ee2f8){return db[_0x34f5('0x2f')][_0x34f5('0x4f')]()[_0x34f5('0x2a')](respondWithResult(_0x5ee2f8,null))[_0x34f5('0x47')](handleError(_0x5ee2f8,null));};exports[_0x34f5('0x29')]=function(_0x190a48,_0x3e192a){if(_0x190a48[_0x34f5('0x4e')]['uniqueid']){delete _0x190a48[_0x34f5('0x4e')][_0x34f5('0x50')];}return db[_0x34f5('0x2f')][_0x34f5('0x4c')]({'where':{'uniqueid':_0x190a48[_0x34f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e192a,null))[_0x34f5('0x2a')](saveUpdates(_0x190a48[_0x34f5('0x4e')],null))[_0x34f5('0x2a')](respondWithResult(_0x3e192a,null))['catch'](handleError(_0x3e192a,null));}; \ No newline at end of file +var _0xe38b=['end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','CmHopperHistory','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','merge','catch','create','body','describe','uniqueid','eml-format','request-promise','moment','mustache','ejs','fs-extra','squel','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/environment','../../config/license/util','sendStatus','status'];(function(_0x57466c,_0x56b634){var _0x15aed3=function(_0x1a8375){while(--_0x1a8375){_0x57466c['push'](_0x57466c['shift']());}};_0x15aed3(++_0x56b634);}(_0xe38b,0x7b));var _0xbe38=function(_0x4a98b2,_0x501161){_0x4a98b2=_0x4a98b2-0x0;var _0x47dd73=_0xe38b[_0x4a98b2];return _0x47dd73;};'use strict';var emlformat=require(_0xbe38('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe38('0x1'));var moment=require(_0xbe38('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbe38('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe38('0x4'));var fs=require('fs');var fs_extra=require(_0xbe38('0x5'));var _=require('lodash');var squel=require(_0xbe38('0x6'));var crypto=require(_0xbe38('0x7'));var jsforce=require(_0xbe38('0x8'));var deskjs=require(_0xbe38('0x9'));var toCsv=require(_0xbe38('0xa'));var querystring=require(_0xbe38('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe38('0xc'));var qs=require(_0xbe38('0xd'));var as=require(_0xbe38('0xe'));var hardwareService=require(_0xbe38('0xf'));var logger=require(_0xbe38('0x10'))(_0xbe38('0x11'));var utils=require(_0xbe38('0x12'));var config=require(_0xbe38('0x13'));var licenseUtil=require(_0xbe38('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570a56,_0x4dcf78){_0x4dcf78=_0x4dcf78||0xcc;return function(_0x722e54){if(_0x722e54){return _0x570a56[_0xbe38('0x15')](_0x4dcf78);}return _0x570a56[_0xbe38('0x16')](_0x4dcf78)[_0xbe38('0x17')]();};}function respondWithResult(_0x1039de,_0x42eece){_0x42eece=_0x42eece||0xc8;return function(_0x133021){if(_0x133021){return _0x1039de[_0xbe38('0x16')](_0x42eece)['json'](_0x133021);}};}function respondWithFilteredResult(_0x40b062,_0xb709ad){return function(_0x14e717){if(_0x14e717){var _0x57dd8=typeof _0xb709ad[_0xbe38('0x18')]===_0xbe38('0x19')&&typeof _0xb709ad[_0xbe38('0x1a')]==='undefined';var _0x15e480=_0x14e717[_0xbe38('0x1b')];var _0x4b6fb6=_0x57dd8?0x0:_0xb709ad[_0xbe38('0x18')];var _0x389ce0=_0x57dd8?_0x14e717[_0xbe38('0x1b')]:_0xb709ad['offset']+_0xb709ad[_0xbe38('0x1a')];var _0x1c959c;if(_0x389ce0>=_0x15e480){_0x389ce0=_0x15e480;_0x1c959c=0xc8;}else{_0x1c959c=0xce;}_0x40b062[_0xbe38('0x16')](_0x1c959c);return _0x40b062['set'](_0xbe38('0x1c'),_0x4b6fb6+'-'+_0x389ce0+'/'+_0x15e480)[_0xbe38('0x1d')](_0x14e717);}return null;};}function patchUpdates(_0x432030){return function(_0x508477){try{jsonpatch[_0xbe38('0x1e')](_0x508477,_0x432030,!![]);}catch(_0x36bd80){return BPromise[_0xbe38('0x1f')](_0x36bd80);}return _0x508477[_0xbe38('0x20')]();};}function saveUpdates(_0x508dd7,_0x1cf780){return function(_0x28297f){if(_0x28297f){return _0x28297f[_0xbe38('0x21')](_0x508dd7)[_0xbe38('0x22')](function(_0x1c3974){return _0x1c3974;});}return null;};}function removeEntity(_0x8184ba,_0x5bdf5e){return function(_0x319912){if(_0x319912){return _0x319912[_0xbe38('0x23')]()[_0xbe38('0x22')](function(){_0x8184ba['status'](0xcc)[_0xbe38('0x17')]();});}};}function handleEntityNotFound(_0x5cd1c5,_0x357358){return function(_0x26d1e3){if(!_0x26d1e3){_0x5cd1c5[_0xbe38('0x15')](0x194);}return _0x26d1e3;};}function handleError(_0x44e8b6,_0x128d91){_0x128d91=_0x128d91||0x1f4;return function(_0x31cba7){logger[_0xbe38('0x24')](_0x31cba7['stack']);if(_0x31cba7[_0xbe38('0x25')]){delete _0x31cba7[_0xbe38('0x25')];}_0x44e8b6['status'](_0x128d91)[_0xbe38('0x26')](_0x31cba7);};}exports['index']=function(_0x41ec28,_0x3807dc){var _0xc58be={},_0x5e046d={},_0x438462={'count':0x0,'rows':[]};var _0x45eeb6=_[_0xbe38('0x27')](db[_0xbe38('0x28')]['rawAttributes'],function(_0xabcf80){return{'name':_0xabcf80[_0xbe38('0x29')],'type':_0xabcf80['type'][_0xbe38('0x2a')]};});_0x5e046d[_0xbe38('0x2b')]=_['map'](_0x45eeb6,'name');_0x5e046d[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x41ec28[_0xbe38('0x2c')]);_0x5e046d[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0x5e046d[_0xbe38('0x2b')],_0x5e046d[_0xbe38('0x2c')]);_0xc58be[_0xbe38('0x30')]=_[_0xbe38('0x2f')](_0x5e046d[_0xbe38('0x2b')],qs[_0xbe38('0x31')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x31')]));_0xc58be[_0xbe38('0x30')]=_0xc58be[_0xbe38('0x30')][_0xbe38('0x32')]?_0xc58be[_0xbe38('0x30')]:_0x5e046d[_0xbe38('0x2b')];if(!_0x41ec28[_0xbe38('0x2c')]['hasOwnProperty'](_0xbe38('0x33'))){_0xc58be[_0xbe38('0x1a')]=qs[_0xbe38('0x1a')](_0x41ec28['query'][_0xbe38('0x1a')]);_0xc58be[_0xbe38('0x18')]=qs[_0xbe38('0x18')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x18')]);}_0xc58be[_0xbe38('0x34')]=qs[_0xbe38('0x35')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x35')]);_0xc58be[_0xbe38('0x36')]=qs['filters'](_[_0xbe38('0x37')](_0x41ec28['query'],_0x5e046d[_0xbe38('0x2e')]),_0x45eeb6);if(_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x38')]){_0xc58be[_0xbe38('0x36')]=_['merge'](_0xc58be['where'],{'$or':_[_0xbe38('0x27')](_0x45eeb6,function(_0x212b23){if(_0x212b23[_0xbe38('0x39')]!==_0xbe38('0x3a')){var _0x46e845={};_0x46e845[_0x212b23[_0xbe38('0x25')]]={'$like':'%'+_0x41ec28[_0xbe38('0x2c')]['filter']+'%'};return _0x46e845;}})});}_0xc58be=_['merge']({},_0xc58be,_0x41ec28[_0xbe38('0x3b')]);var _0x2be201={'where':_0xc58be[_0xbe38('0x36')]};return db[_0xbe38('0x28')]['count'](_0x2be201)['then'](function(_0x2f316f){_0x438462['count']=_0x2f316f;if(_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x3c')]){_0xc58be[_0xbe38('0x3d')]=[{'all':!![]}];}return db[_0xbe38('0x28')][_0xbe38('0x3e')](_0xc58be);})[_0xbe38('0x22')](function(_0x2f977e){_0x438462[_0xbe38('0x3f')]=_0x2f977e;return _0x438462;})['then'](respondWithFilteredResult(_0x3807dc,_0xc58be))['catch'](handleError(_0x3807dc,null));};exports[_0xbe38('0x40')]=function(_0x9b9e2f,_0x3348c4){var _0x472b39={'raw':!![],'where':{'id':_0x9b9e2f[_0xbe38('0x41')]['id']}},_0xb35afa={};_0xb35afa['model']=_[_0xbe38('0x2d')](db[_0xbe38('0x28')][_0xbe38('0x42')]);_0xb35afa[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x9b9e2f[_0xbe38('0x2c')]);_0xb35afa[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0xb35afa[_0xbe38('0x2b')],_0xb35afa[_0xbe38('0x2c')]);_0x472b39[_0xbe38('0x30')]=_[_0xbe38('0x2f')](_0xb35afa[_0xbe38('0x2b')],qs['fields'](_0x9b9e2f[_0xbe38('0x2c')][_0xbe38('0x31')]));_0x472b39['attributes']=_0x472b39[_0xbe38('0x30')][_0xbe38('0x32')]?_0x472b39[_0xbe38('0x30')]:_0xb35afa[_0xbe38('0x2b')];if(_0x9b9e2f[_0xbe38('0x2c')][_0xbe38('0x3c')]){_0x472b39[_0xbe38('0x3d')]=[{'all':!![]}];}_0x472b39=_[_0xbe38('0x43')]({},_0x472b39,_0x9b9e2f['options']);return db['CmHopperHistory']['find'](_0x472b39)[_0xbe38('0x22')](handleEntityNotFound(_0x3348c4,null))['then'](respondWithResult(_0x3348c4,null))[_0xbe38('0x44')](handleError(_0x3348c4,null));};exports[_0xbe38('0x45')]=function(_0x31dc46,_0x4cbdc7){return db['CmHopperHistory'][_0xbe38('0x45')](_0x31dc46[_0xbe38('0x46')],{})[_0xbe38('0x22')](respondWithResult(_0x4cbdc7,0xc9))[_0xbe38('0x44')](handleError(_0x4cbdc7,null));};exports[_0xbe38('0x47')]=function(_0x1dd657,_0x5cd632){return db[_0xbe38('0x28')]['describe']()[_0xbe38('0x22')](respondWithResult(_0x5cd632,null))[_0xbe38('0x44')](handleError(_0x5cd632,null));};exports[_0xbe38('0x21')]=function(_0x41d7e7,_0x209c16){if(_0x41d7e7[_0xbe38('0x46')][_0xbe38('0x48')]){delete _0x41d7e7['body'][_0xbe38('0x48')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x41d7e7[_0xbe38('0x41')]['id']}})[_0xbe38('0x22')](handleEntityNotFound(_0x209c16,null))[_0xbe38('0x22')](saveUpdates(_0x41d7e7[_0xbe38('0x46')],null))[_0xbe38('0x22')](respondWithResult(_0x209c16,null))['catch'](handleError(_0x209c16,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index eac6133..37e356a 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 _0x88c7=['uniqueid','lodash','api','moment','path','rimraf','./cmHopperHistory.attributes','exports','define','endtime'];(function(_0x191993,_0x3c4d3c){var _0x53c1bf=function(_0x43e3ff){while(--_0x43e3ff){_0x191993['push'](_0x191993['shift']());}};_0x53c1bf(++_0x3c4d3c);}(_0x88c7,0x6f));var _0x788c=function(_0x21ffd8,_0xd5f694){_0x21ffd8=_0x21ffd8-0x0;var _0x134c6e=_0x88c7[_0x21ffd8];return _0x134c6e;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x788c('0x1'));var moment=require(_0x788c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x788c('0x3'));var rimraf=require(_0x788c('0x4'));var config=require('../../config/environment');var attributes=require(_0x788c('0x5'));module[_0x788c('0x6')]=function(_0x4e6f8b,_0xbde9d1){return _0x4e6f8b[_0x788c('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x788c('0x8'),'fields':[_0x788c('0x8')]},{'name':_0x788c('0x9'),'fields':[_0x788c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x50a8=['request-promise','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x2276e1,_0x5de22c){var _0x457c09=function(_0xb0491b){while(--_0xb0491b){_0x2276e1['push'](_0x2276e1['shift']());}};_0x457c09(++_0x5de22c);}(_0x50a8,0x193));var _0x850a=function(_0x4d0d85,_0x3250d3){_0x4d0d85=_0x4d0d85-0x0;var _0x290a74=_0x50a8[_0x4d0d85];return _0x290a74;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var logger=require('../../config/logger')(_0x850a('0x1'));var moment=require(_0x850a('0x2'));var BPromise=require(_0x850a('0x3'));var rp=require(_0x850a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x850a('0x5'));module[_0x850a('0x6')]=function(_0x530b92,_0x31c037){return _0x530b92['define'](_0x850a('0x7'),attributes,{'tableName':_0x850a('0x8'),'paranoid':![],'indexes':[{'name':_0x850a('0x9'),'fields':['endtime']},{'name':_0x850a('0xa'),'fields':[_0x850a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 031b6a7..d6eed2e 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 _0x2043=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','raw','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','COUNT','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','lodash','util'];(function(_0x309616,_0x3bb928){var _0x1532c1=function(_0x2f296a){while(--_0x2f296a){_0x309616['push'](_0x309616['shift']());}};_0x1532c1(++_0x3bb928);}(_0x2043,0x122));var _0x3204=function(_0x2eda0d,_0x27d7ee){_0x2eda0d=_0x2eda0d-0x0;var _0x5f16ec=_0x2043[_0x2eda0d];return _0x5f16ec;};'use strict';var _=require(_0x3204('0x0'));var util=require(_0x3204('0x1'));var moment=require(_0x3204('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3204('0x3'));var db=require(_0x3204('0x4'))['db'];var utils=require(_0x3204('0x5'));var logger=require(_0x3204('0x6'))(_0x3204('0x7'));var config=require(_0x3204('0x8'));var jayson=require(_0x3204('0x9'));var client=jayson[_0x3204('0xa')][_0x3204('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162705,_0x20028b,_0x58e3f3){return new BPromise(function(_0x6a4ec5,_0x498944){return client[_0x3204('0xc')](_0x162705,_0x58e3f3)[_0x3204('0xd')](function(_0x3c9cbd){logger[_0x3204('0xe')](_0x3204('0xf'),_0x20028b,_0x3204('0x10'));logger[_0x3204('0x11')](_0x3204('0x12'),_0x20028b,_0x3204('0x10'),JSON[_0x3204('0x13')](_0x3c9cbd));if(_0x3c9cbd[_0x3204('0x14')]){if(_0x3c9cbd['error'][_0x3204('0x15')]===0x1f4){logger[_0x3204('0x14')](_0x3204('0xf'),_0x20028b,_0x3c9cbd['error'][_0x3204('0x16')]);return _0x498944(_0x3c9cbd[_0x3204('0x14')][_0x3204('0x16')]);}logger[_0x3204('0x14')](_0x3204('0xf'),_0x20028b,_0x3c9cbd['error'][_0x3204('0x16')]);return _0x6a4ec5(_0x3c9cbd[_0x3204('0x14')]['message']);}else{logger['info'](_0x3204('0xf'),_0x20028b,_0x3204('0x10'));_0x6a4ec5(_0x3c9cbd[_0x3204('0x17')]['message']);}})[_0x3204('0x18')](function(_0x1a038e){logger[_0x3204('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x20028b,_0x1a038e);_0x498944(_0x1a038e);});});}exports[_0x3204('0x19')]=function(_0x35edce){var _0x218c9b=this;return new Promise(function(_0x1fbf21,_0x517c58){return db[_0x3204('0x1a')][_0x3204('0x1b')](_0x35edce[_0x3204('0x1c')],{'raw':_0x35edce[_0x3204('0x1d')]?_0x35edce[_0x3204('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x3204('0xd')](function(_0x513209){logger[_0x3204('0xe')](_0x3204('0x19'),_0x35edce);logger[_0x3204('0x11')](_0x3204('0x19'),_0x35edce,JSON[_0x3204('0x13')](_0x513209));_0x1fbf21(_0x513209);})[_0x3204('0x18')](function(_0x4240f0){logger[_0x3204('0x14')](_0x3204('0x19'),_0x4240f0[_0x3204('0x16')],_0x35edce);_0x517c58(_0x218c9b[_0x3204('0x14')](0x1f4,_0x4240f0['message']));});});};exports[_0x3204('0x1e')]=function(_0xf0a787){var _0x33c388=this;return new Promise(function(_0x88d20b,_0x923384){return db[_0x3204('0x1a')]['findAll']({'raw':_0xf0a787['options']?_0xf0a787['options'][_0x3204('0x1f')]===undefined?!![]:![]:!![],'where':_0xf0a787[_0x3204('0x1d')]?_0xf0a787[_0x3204('0x1d')][_0x3204('0x20')]||null:null,'attributes':[[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')][_0x3204('0x22')]('id')),_0x3204('0x23')],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x25')))),_0x3204('0x26')],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x27')))),_0x3204('0x28')],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x29')))),_0x3204('0x2a')],[db['sequelize']['fn'](_0x3204('0x2b'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')]['literal'](_0x3204('0x2c')))),_0x3204('0x2d')],[db[_0x3204('0x21')]['fn'](_0x3204('0x2b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3204('0x2e')))),_0x3204('0x2f')]]})[_0x3204('0xd')](function(_0x2138d9){logger['info']('AvgHandleTime',_0xf0a787);logger['debug'](_0x3204('0x1e'),_0xf0a787,JSON['stringify'](_0x2138d9));_0x88d20b(_0x2138d9);})[_0x3204('0x18')](function(_0x31e888){logger['error']('AvgHandleTime',_0x31e888[_0x3204('0x16')],_0xf0a787);_0x923384(_0x33c388['error'](0x1f4,_0x31e888[_0x3204('0x16')]));});});};exports[_0x3204('0x30')]=function(_0xe1eb17){var _0x3990c1=this;return new Promise(function(_0x155ac3,_0x3e9bf5){return db[_0x3204('0x1a')][_0x3204('0x31')]({'raw':_0xe1eb17[_0x3204('0x1d')]?_0xe1eb17[_0x3204('0x1d')][_0x3204('0x1f')]===undefined?!![]:![]:!![],'where':_0xe1eb17[_0x3204('0x1d')]?_0xe1eb17[_0x3204('0x1d')][_0x3204('0x20')]||null:null,'attributes':[[_0x3204('0x32'),_0x3204('0x33')],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x35')))),'outboundNoSuchCallsDay'],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db['sequelize']['fn']('IF',db['sequelize'][_0x3204('0x24')](_0x3204('0x36')))),'outboundNoAnswerCallsDay'],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x25')))),_0x3204('0x37')],[db['sequelize']['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0x3204('0x38')],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')]['literal'](_0x3204('0x39')))),_0x3204('0x3a')],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x3b')))),'outboundDropCallsDayTimeout'],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')]['literal'](_0x3204('0x3c')))),_0x3204('0x3d')],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')]['literal'](_0x3204('0x3e')))),_0x3204('0x3f')],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x3204('0x40')],[db[_0x3204('0x21')]['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x3204('0x41')],[db['sequelize']['fn']('COUNT',db[_0x3204('0x21')]['fn']('IF',db['sequelize'][_0x3204('0x24')](_0x3204('0x42')))),'outboundRejectCallsDay'],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db['sequelize'][_0x3204('0x24')](_0x3204('0x43')))),_0x3204('0x44')],[db['sequelize']['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')][_0x3204('0x24')](_0x3204('0x45')))),_0x3204('0x46')],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db['sequelize'][_0x3204('0x24')](_0x3204('0x47')))),'outboundReCallsDay']],'group':[_0x3204('0x32')]})[_0x3204('0xd')](function(_0x4676ef){logger['info'](_0x3204('0x30'),_0xe1eb17);logger[_0x3204('0x11')](_0x3204('0x30'),_0xe1eb17,JSON[_0x3204('0x13')](_0x4676ef));_0x155ac3(_0x4676ef);})['catch'](function(_0x1b0fd6){logger['error'](_0x3204('0x30'),_0x1b0fd6[_0x3204('0x16')],_0xe1eb17);_0x3e9bf5(_0x3990c1[_0x3204('0x14')](0x1f4,_0x1b0fd6[_0x3204('0x16')]));});});};exports['GetCampaignHopperHistory']=function(_0x28c7ab){var _0x376a8e=this;return new Promise(function(_0x50b0b8,_0xd8c460){return db[_0x3204('0x1a')][_0x3204('0x31')]({'raw':_0x28c7ab[_0x3204('0x1d')]?_0x28c7ab[_0x3204('0x1d')][_0x3204('0x1f')]===undefined?!![]:![]:!![],'where':_0x28c7ab[_0x3204('0x1d')]?_0x28c7ab[_0x3204('0x1d')][_0x3204('0x20')]||null:null,'attributes':[[_0x3204('0x32'),_0x3204('0x33')],[db['sequelize']['fn'](_0x3204('0x34'),db[_0x3204('0x21')][_0x3204('0x22')]('id')),'ivrTotalCallsDays'],[db[_0x3204('0x21')]['fn'](_0x3204('0x34'),db[_0x3204('0x21')]['fn']('IF',db[_0x3204('0x21')]['literal'](_0x3204('0x25')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x3204('0xd')](function(_0x1a6e7e){logger[_0x3204('0xe')](_0x3204('0x48'),_0x28c7ab);logger[_0x3204('0x11')](_0x3204('0x48'),_0x28c7ab,JSON[_0x3204('0x13')](_0x1a6e7e));_0x50b0b8(_0x1a6e7e);})[_0x3204('0x18')](function(_0x3996ed){logger[_0x3204('0x14')](_0x3204('0x48'),_0x3996ed[_0x3204('0x16')],_0x28c7ab);_0xd8c460(_0x376a8e[_0x3204('0x14')](0x1f4,_0x3996ed[_0x3204('0x16')]));});});}; \ No newline at end of file +var _0x834d=['CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug'];(function(_0x307e0e,_0x3e97a5){var _0x1abcb3=function(_0x317073){while(--_0x317073){_0x307e0e['push'](_0x307e0e['shift']());}};_0x1abcb3(++_0x3e97a5);}(_0x834d,0x140));var _0xd834=function(_0x350446,_0x2cabe7){_0x350446=_0x350446-0x0;var _0x4f1d50=_0x834d[_0x350446];return _0x4f1d50;};'use strict';var _=require(_0xd834('0x0'));var util=require(_0xd834('0x1'));var moment=require('moment');var BPromise=require(_0xd834('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd834('0x3'))['db'];var utils=require(_0xd834('0x4'));var logger=require(_0xd834('0x5'))(_0xd834('0x6'));var config=require('../../config/environment');var jayson=require(_0xd834('0x7'));var client=jayson[_0xd834('0x8')][_0xd834('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42623d,_0x28907e,_0x256853){return new BPromise(function(_0x51c989,_0x6ab9ae){return client[_0xd834('0xa')](_0x42623d,_0x256853)[_0xd834('0xb')](function(_0x52ad61){logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,'request\x20sent');logger[_0xd834('0xe')](_0xd834('0xf'),_0x28907e,'request\x20sent',JSON[_0xd834('0x10')](_0x52ad61));if(_0x52ad61[_0xd834('0x11')]){if(_0x52ad61[_0xd834('0x11')][_0xd834('0x12')]===0x1f4){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x6ab9ae(_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);}logger[_0xd834('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x51c989(_0x52ad61[_0xd834('0x11')]['message']);}else{logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,_0xd834('0x14'));_0x51c989(_0x52ad61[_0xd834('0x15')]['message']);}})[_0xd834('0x16')](function(_0x32d8c7){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x32d8c7);_0x6ab9ae(_0x32d8c7);});});}exports['CreateCmHopperHistory']=function(_0x21ce1a){var _0x1aecf2=this;return new Promise(function(_0x530951,_0xce0df0){return db[_0xd834('0x17')][_0xd834('0x18')](_0x21ce1a['body'],{'raw':_0x21ce1a[_0xd834('0x19')]?_0x21ce1a['options'][_0xd834('0x1a')]===undefined?!![]:![]:!![]})[_0xd834('0xb')](function(_0x4b451e){logger[_0xd834('0xc')](_0xd834('0x1b'),_0x21ce1a);logger[_0xd834('0xe')](_0xd834('0x1b'),_0x21ce1a,JSON[_0xd834('0x10')](_0x4b451e));_0x530951(_0x4b451e);})[_0xd834('0x16')](function(_0x59b604){logger[_0xd834('0x11')]('CreateCmHopperHistory',_0x59b604[_0xd834('0x13')],_0x21ce1a);_0xce0df0(_0x1aecf2['error'](0x1f4,_0x59b604[_0xd834('0x13')]));});});};exports[_0xd834('0x1c')]=function(_0xd1a893){var _0x4872af=this;return new Promise(function(_0x4a399e,_0x4b89b5){return db[_0xd834('0x17')]['findAll']({'raw':_0xd1a893[_0xd834('0x19')]?_0xd1a893['options'][_0xd834('0x1a')]===undefined?!![]:![]:!![],'where':_0xd1a893['options']?_0xd1a893[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['col']('id')),_0xd834('0x20')],[db['sequelize']['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xd834('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x22')))),_0xd834('0x23')],[db['sequelize']['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x24')))),_0xd834('0x25')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x26'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xd834('0x27')],[db[_0xd834('0x1e')]['fn']('AVG',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal'](_0xd834('0x28')))),'predictiveIntervalAvgTalktime']]})[_0xd834('0xb')](function(_0x26da61){logger[_0xd834('0xc')]('AvgHandleTime',_0xd1a893);logger[_0xd834('0xe')]('AvgHandleTime',_0xd1a893,JSON[_0xd834('0x10')](_0x26da61));_0x4a399e(_0x26da61);})[_0xd834('0x16')](function(_0x490369){logger[_0xd834('0x11')](_0xd834('0x1c'),_0x490369['message'],_0xd1a893);_0x4b89b5(_0x4872af[_0xd834('0x11')](0x1f4,_0x490369[_0xd834('0x13')]));});});};exports[_0xd834('0x29')]=function(_0x5629c4){var _0x458f94=this;return new Promise(function(_0x5ef75f,_0x2313f4){return db['CmHopperHistory'][_0xd834('0x2a')]({'raw':_0x5629c4[_0xd834('0x19')]?_0x5629c4[_0xd834('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5629c4[_0xd834('0x19')]?_0x5629c4[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[_0xd834('0x2b'),_0xd834('0x2c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x2d')))),_0xd834('0x2e')],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal'](_0xd834('0x2f')))),_0xd834('0x30')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x31')))),_0xd834('0x32')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x33')))),_0xd834('0x34')],[db[_0xd834('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd834('0x35')],[db['sequelize']['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd834('0x36')],[db['sequelize']['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xd834('0x37')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x38')))),_0xd834('0x39')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x3a')))),'outboundOriginateFailureCallsDay'],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0xd834('0x3b')],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xd834('0x3c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x3d')))),_0xd834('0x3b')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x3e')))),'outboundReCallsDay']],'group':[_0xd834('0x2b')]})[_0xd834('0xb')](function(_0x5bcd52){logger[_0xd834('0xc')](_0xd834('0x29'),_0x5629c4);logger[_0xd834('0xe')](_0xd834('0x29'),_0x5629c4,JSON[_0xd834('0x10')](_0x5bcd52));_0x5ef75f(_0x5bcd52);})['catch'](function(_0x755c3d){logger[_0xd834('0x11')](_0xd834('0x29'),_0x755c3d[_0xd834('0x13')],_0x5629c4);_0x2313f4(_0x458f94['error'](0x1f4,_0x755c3d['message']));});});};exports[_0xd834('0x3f')]=function(_0x1a7514){var _0x1c7bb8=this;return new Promise(function(_0x46b8fe,_0x335aab){return db[_0xd834('0x17')][_0xd834('0x2a')]({'raw':_0x1a7514['options']?_0x1a7514[_0xd834('0x19')][_0xd834('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a7514[_0xd834('0x19')]?_0x1a7514[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[_0xd834('0x2b'),_0xd834('0x2c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')][_0xd834('0x40')]('id')),_0xd834('0x41')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xd834('0x42')]],'group':['campaign']})[_0xd834('0xb')](function(_0x10a9cc){logger[_0xd834('0xc')](_0xd834('0x3f'),_0x1a7514);logger[_0xd834('0xe')](_0xd834('0x3f'),_0x1a7514,JSON[_0xd834('0x10')](_0x10a9cc));_0x46b8fe(_0x10a9cc);})[_0xd834('0x16')](function(_0x2f2fd3){logger[_0xd834('0x11')]('GetCampaignHopperHistory',_0x2f2fd3[_0xd834('0x13')],_0x1a7514);_0x335aab(_0x1c7bb8[_0xd834('0x11')](0x1f4,_0x2f2fd3[_0xd834('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index ed14d79..2ef5b5d 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 _0x33de=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','exports','util','path','express','Router'];(function(_0x2c54f7,_0x1a2dae){var _0x369a62=function(_0x5bfcee){while(--_0x5bfcee){_0x2c54f7['push'](_0x2c54f7['shift']());}};_0x369a62(++_0x1a2dae);}(_0x33de,0x8c));var _0xe33d=function(_0x525673,_0xb429c2){_0x525673=_0x525673-0x0;var _0x8f7574=_0x33de[_0x525673];return _0x8f7574;};'use strict';var multer=require('multer');var util=require(_0xe33d('0x0'));var path=require(_0xe33d('0x1'));var timeout=require('connect-timeout');var express=require(_0xe33d('0x2'));var router=express[_0xe33d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe33d('0x4'));var interaction=require(_0xe33d('0x5'));var config=require(_0xe33d('0x6'));var controller=require(_0xe33d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe33d('0x8')]);router[_0xe33d('0x9')](_0xe33d('0xa'),auth[_0xe33d('0xb')](),controller[_0xe33d('0xc')]);router[_0xe33d('0x9')](_0xe33d('0xd'),auth[_0xe33d('0xb')](),controller[_0xe33d('0xe')]);router['post']('/',auth[_0xe33d('0xb')](),controller[_0xe33d('0xf')]);router[_0xe33d('0x10')](_0xe33d('0xd'),auth[_0xe33d('0xb')](),controller['update']);module[_0xe33d('0x11')]=router; \ No newline at end of file +var _0x06d2=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','/:id','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0x06d2,0x1d7));var _0x206d=function(_0x1e073c,_0x559893){_0x1e073c=_0x1e073c-0x0;var _0x18f3a2=_0x06d2[_0x1e073c];return _0x18f3a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x206d('0x0'));var timeout=require(_0x206d('0x1'));var express=require(_0x206d('0x2'));var router=express[_0x206d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x206d('0x4'));var config=require(_0x206d('0x5'));var controller=require(_0x206d('0x6'));router[_0x206d('0x7')]('/',auth[_0x206d('0x8')](),controller[_0x206d('0x9')]);router[_0x206d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x206d('0xa')]);router['get']('/:id',auth[_0x206d('0x8')](),controller[_0x206d('0xb')]);router[_0x206d('0xc')]('/',auth[_0x206d('0x8')](),controller['create']);router['put'](_0x206d('0xd'),auth[_0x206d('0x8')](),controller['update']);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 c2c8024..ee5a14b 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9a=['exports','name','STRING'];(function(_0x541032,_0x12ab40){var _0x2064e0=function(_0x52131a){while(--_0x52131a){_0x541032['push'](_0x541032['shift']());}};_0x2064e0(++_0x12ab40);}(_0x0a9a,0x183));var _0xa0a9=function(_0x9c7245,_0x876104){_0x9c7245=_0x9c7245-0x0;var _0xdc6cdf=_0x0a9a[_0x9c7245];return _0xdc6cdf;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa0a9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa0a9('0x2')]},'dialPrefix':{'type':Sequelize[_0xa0a9('0x2')]}}; \ No newline at end of file +var _0xb458=['STRING','sequelize','exports'];(function(_0x2cc8cb,_0x2f35c9){var _0x136176=function(_0x34cafc){while(--_0x34cafc){_0x2cc8cb['push'](_0x2cc8cb['shift']());}};_0x136176(++_0x2f35c9);}(_0xb458,0x103));var _0x8b45=function(_0x2ccfba,_0x21ee33){_0x2ccfba=_0x2ccfba-0x0;var _0x3bcb47=_0xb458[_0x2ccfba];return _0x3bcb47;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x8b45('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 80c83ff..819438b 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 _0x288b=['dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','isEmpty','format','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','get','Lists','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','CmList','includeAll','findAll','rows','show','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','options','removeDispositions','addContacts','CmContact','tags','join','isArray','each','ids','success'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x288b,0xbd));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb288('0x0'));var rimraf=require(_0xb288('0x1'));var zipdir=require(_0xb288('0x2'));var jsonpatch=require(_0xb288('0x3'));var rp=require(_0xb288('0x4'));var moment=require('moment');var BPromise=require(_0xb288('0x5'));var Mustache=require(_0xb288('0x6'));var util=require(_0xb288('0x7'));var path=require('path');var sox=require(_0xb288('0x8'));var csv=require('to-csv');var ejs=require(_0xb288('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb288('0xa'));var crypto=require(_0xb288('0xb'));var jsforce=require(_0xb288('0xc'));var deskjs=require(_0xb288('0xd'));var toCsv=require(_0xb288('0xe'));var querystring=require(_0xb288('0xf'));var Papa=require(_0xb288('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb288('0x11'));var as=require(_0xb288('0x12'));var hardwareService=require(_0xb288('0x13'));var logger=require(_0xb288('0x14'))(_0xb288('0x15'));var utils=require(_0xb288('0x16'));var config=require(_0xb288('0x17'));var licenseUtil=require(_0xb288('0x18'));var db=require(_0xb288('0x19'))['db'];config[_0xb288('0x1a')]=_['defaults'](config[_0xb288('0x1a')],{'host':_0xb288('0x1b'),'port':0x18eb});var socket=require(_0xb288('0x1c'))(new Redis(config['redis']));require(_0xb288('0x1d'))[_0xb288('0x1e')](socket);function respondWithStatusCode(_0x14f51c,_0x3ec4e9){_0x3ec4e9=_0x3ec4e9||0xcc;return function(_0x110322){if(_0x110322){return _0x14f51c[_0xb288('0x1f')](_0x3ec4e9);}return _0x14f51c[_0xb288('0x20')](_0x3ec4e9)[_0xb288('0x21')]();};}function respondWithResult(_0x2b5e62,_0x18d75c){_0x18d75c=_0x18d75c||0xc8;return function(_0x52b605){if(_0x52b605){return _0x2b5e62[_0xb288('0x20')](_0x18d75c)[_0xb288('0x22')](_0x52b605);}};}function respondWithFilteredResult(_0x13cd63,_0x2e9e8d){return function(_0x16da18){if(_0x16da18){var _0x1ef193=typeof _0x2e9e8d[_0xb288('0x23')]==='undefined'&&typeof _0x2e9e8d[_0xb288('0x24')]===_0xb288('0x25');var _0x345db5=_0x16da18[_0xb288('0x26')];var _0x2da120=_0x1ef193?0x0:_0x2e9e8d['offset'];var _0x7a05a0=_0x1ef193?_0x16da18[_0xb288('0x26')]:_0x2e9e8d[_0xb288('0x23')]+_0x2e9e8d['limit'];var _0x3052f4;if(_0x7a05a0>=_0x345db5){_0x7a05a0=_0x345db5;_0x3052f4=0xc8;}else{_0x3052f4=0xce;}_0x13cd63[_0xb288('0x20')](_0x3052f4);return _0x13cd63[_0xb288('0x27')](_0xb288('0x28'),_0x2da120+'-'+_0x7a05a0+'/'+_0x345db5)[_0xb288('0x22')](_0x16da18);}return null;};}function patchUpdates(_0x228ec2){return function(_0x6d7fc5){try{jsonpatch[_0xb288('0x29')](_0x6d7fc5,_0x228ec2,!![]);}catch(_0xfce79d){return BPromise['reject'](_0xfce79d);}return _0x6d7fc5['save']();};}function saveUpdates(_0x785c76,_0x54e883){return function(_0x1bf4f1){if(_0x1bf4f1){return _0x1bf4f1[_0xb288('0x2a')](_0x785c76)['then'](function(_0x43a772){return _0x43a772;});}return null;};}function removeEntity(_0x4b2736,_0x12c344){return function(_0x3d12f7){if(_0x3d12f7){return _0x3d12f7['destroy']()[_0xb288('0x2b')](function(){var _0x1a016d=_0x3d12f7[_0xb288('0x2c')]({'plain':!![]});var _0x26ecbe=_0xb288('0x2d');return db['UserProfileResource'][_0xb288('0x2e')]({'where':{'type':_0x26ecbe,'resourceId':_0x1a016d['id']}})[_0xb288('0x2b')](function(){return _0x3d12f7;});})[_0xb288('0x2b')](function(){_0x4b2736['status'](0xcc)[_0xb288('0x21')]();});}};}function handleEntityNotFound(_0x34886b,_0x475119){return function(_0x4c23b9){if(!_0x4c23b9){_0x34886b[_0xb288('0x1f')](0x194);}return _0x4c23b9;};}function handleError(_0x37e254,_0x4145ff){_0x4145ff=_0x4145ff||0x1f4;return function(_0x13af61){logger[_0xb288('0x2f')](_0x13af61[_0xb288('0x30')]);if(_0x13af61[_0xb288('0x31')]){delete _0x13af61[_0xb288('0x31')];}_0x37e254[_0xb288('0x20')](_0x4145ff)[_0xb288('0x32')](_0x13af61);};}exports[_0xb288('0x33')]=function(_0x3c6401,_0xf71524){var _0xa99083={},_0x52ca30={},_0x5876da={'count':0x0,'rows':[]};var _0x5042af=_[_0xb288('0x34')](db['CmList'][_0xb288('0x35')],function(_0x2ba7ff){return{'name':_0x2ba7ff[_0xb288('0x36')],'type':_0x2ba7ff[_0xb288('0x37')][_0xb288('0x38')]};});_0x52ca30[_0xb288('0x39')]=_['map'](_0x5042af,_0xb288('0x31'));_0x52ca30[_0xb288('0x3a')]=_[_0xb288('0x3b')](_0x3c6401['query']);_0x52ca30['filters']=_['intersection'](_0x52ca30[_0xb288('0x39')],_0x52ca30[_0xb288('0x3a')]);_0xa99083[_0xb288('0x3c')]=_[_0xb288('0x3d')](_0x52ca30[_0xb288('0x39')],qs['fields'](_0x3c6401[_0xb288('0x3a')][_0xb288('0x3e')]));_0xa99083['attributes']=_0xa99083['attributes'][_0xb288('0x3f')]?_0xa99083[_0xb288('0x3c')]:_0x52ca30[_0xb288('0x39')];if(!_0x3c6401['query']['hasOwnProperty']('nolimit')){_0xa99083['limit']=qs[_0xb288('0x24')](_0x3c6401['query'][_0xb288('0x24')]);_0xa99083[_0xb288('0x23')]=qs[_0xb288('0x23')](_0x3c6401[_0xb288('0x3a')]['offset']);}_0xa99083[_0xb288('0x40')]=qs[_0xb288('0x41')](_0x3c6401[_0xb288('0x3a')][_0xb288('0x41')]);_0xa99083[_0xb288('0x42')]=qs['filters'](_[_0xb288('0x43')](_0x3c6401[_0xb288('0x3a')],_0x52ca30[_0xb288('0x44')]),_0x5042af);if(_0x3c6401[_0xb288('0x3a')][_0xb288('0x45')]){_0xa99083[_0xb288('0x42')]=_[_0xb288('0x46')](_0xa99083[_0xb288('0x42')],{'$or':_[_0xb288('0x34')](_0x5042af,function(_0x57e4e4){if(_0x57e4e4['type']!==_0xb288('0x47')){var _0x21b22c={};_0x21b22c[_0x57e4e4['name']]={'$like':'%'+_0x3c6401[_0xb288('0x3a')][_0xb288('0x45')]+'%'};return _0x21b22c;}})});}_0xa99083=_[_0xb288('0x46')]({},_0xa99083,_0x3c6401['options']);var _0x1b460c={'where':_0xa99083[_0xb288('0x42')]};return db[_0xb288('0x48')][_0xb288('0x26')](_0x1b460c)[_0xb288('0x2b')](function(_0x311660){_0x5876da['count']=_0x311660;if(_0x3c6401[_0xb288('0x3a')][_0xb288('0x49')]){_0xa99083['include']=[{'all':!![]}];}return db['CmList'][_0xb288('0x4a')](_0xa99083);})[_0xb288('0x2b')](function(_0x3020f5){_0x5876da[_0xb288('0x4b')]=_0x3020f5;return _0x5876da;})[_0xb288('0x2b')](respondWithFilteredResult(_0xf71524,_0xa99083))['catch'](handleError(_0xf71524,null));};exports[_0xb288('0x4c')]=function(_0x29f52a,_0x50151a){var _0x2b3835={'raw':![],'where':{'id':_0x29f52a['params']['id']}},_0x2b4897={};_0x2b4897[_0xb288('0x39')]=_[_0xb288('0x3b')](db[_0xb288('0x48')][_0xb288('0x35')]);_0x2b4897[_0xb288('0x3a')]=_['keys'](_0x29f52a['query']);_0x2b4897[_0xb288('0x44')]=_[_0xb288('0x3d')](_0x2b4897[_0xb288('0x39')],_0x2b4897['query']);_0x2b3835[_0xb288('0x3c')]=_[_0xb288('0x3d')](_0x2b4897[_0xb288('0x39')],qs[_0xb288('0x3e')](_0x29f52a['query'][_0xb288('0x3e')]));_0x2b3835[_0xb288('0x3c')]=_0x2b3835[_0xb288('0x3c')]['length']?_0x2b3835[_0xb288('0x3c')]:_0x2b4897[_0xb288('0x39')];if(_0x29f52a[_0xb288('0x3a')][_0xb288('0x49')]){_0x2b3835[_0xb288('0x4d')]=[{'all':!![]}];}_0x2b3835=_[_0xb288('0x46')]({},_0x2b3835,_0x29f52a['options']);return db[_0xb288('0x48')][_0xb288('0x4e')](_0x2b3835)['then'](handleEntityNotFound(_0x50151a,null))[_0xb288('0x2b')](respondWithResult(_0x50151a,null))[_0xb288('0x4f')](handleError(_0x50151a,null));};exports[_0xb288('0x50')]=function(_0x1883f9,_0x5b5695){return db[_0xb288('0x48')][_0xb288('0x50')](_0x1883f9['body'],{})[_0xb288('0x2b')](function(_0x4dc753){var _0x57e29b=_0x1883f9[_0xb288('0x51')][_0xb288('0x2c')]({'plain':!![]});if(!_0x57e29b)throw new Error(_0xb288('0x52'));if(_0x57e29b[_0xb288('0x53')]==='user'){var _0x55caec=_0x4dc753[_0xb288('0x2c')]({'plain':!![]});var _0x44bbde=_0xb288('0x2d');return db[_0xb288('0x54')]['find']({'where':{'name':_0x44bbde,'userProfileId':_0x57e29b[_0xb288('0x55')]},'raw':!![]})[_0xb288('0x2b')](function(_0x48fc95){if(_0x48fc95&&_0x48fc95[_0xb288('0x56')]===0x0){return db[_0xb288('0x57')][_0xb288('0x50')]({'name':_0x55caec[_0xb288('0x31')],'resourceId':_0x55caec['id'],'type':_0x48fc95['name'],'sectionId':_0x48fc95['id']},{})[_0xb288('0x2b')](function(){return _0x4dc753;});}else{return _0x4dc753;}})[_0xb288('0x4f')](function(_0x52c9b6){logger['error'](_0xb288('0x58'),_0x52c9b6);throw _0x52c9b6;});}return _0x4dc753;})[_0xb288('0x2b')](respondWithResult(_0x5b5695,0xc9))[_0xb288('0x4f')](handleError(_0x5b5695,null));};exports['update']=function(_0x49cfd3,_0x1ce40f){if(_0x49cfd3[_0xb288('0x59')]['id']){delete _0x49cfd3[_0xb288('0x59')]['id'];}return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x49cfd3[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x1ce40f,null))[_0xb288('0x2b')](saveUpdates(_0x49cfd3['body'],null))[_0xb288('0x2b')](respondWithResult(_0x1ce40f,null))[_0xb288('0x4f')](handleError(_0x1ce40f,null));};exports[_0xb288('0x2e')]=function(_0x539e26,_0x1309f9){return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x539e26['params']['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x1309f9,null))['then'](removeEntity(_0x1309f9,null))['catch'](handleError(_0x1309f9,null));};exports[_0xb288('0x5b')]=function(_0x49162a,_0x145811){return db[_0xb288('0x48')]['describe']()[_0xb288('0x2b')](respondWithResult(_0x145811,null))[_0xb288('0x4f')](handleError(_0x145811,null));};exports[_0xb288('0x5c')]=function(_0x3e8213,_0xb1df9a,_0x4482a4){if(_0x3e8213['body']['id']){delete _0x3e8213[_0xb288('0x59')]['id'];}return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x3e8213[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0xb1df9a,null))['then'](function(_0x40e1b9){if(_0x40e1b9){_0x3e8213[_0xb288('0x59')][_0xb288('0x5d')]=_0x40e1b9['id'];return db[_0xb288('0x5e')]['create'](_0x3e8213[_0xb288('0x59')]);}})[_0xb288('0x2b')](respondWithResult(_0xb1df9a,null))[_0xb288('0x4f')](handleError(_0xb1df9a,null));};exports[_0xb288('0x5f')]=function(_0xa2ef53,_0x4f250e,_0x21b5f9){var _0xfd0555={'raw':![],'where':{}};var _0x33b49c={};var _0xc6ce13={'count':0x0,'rows':[]};return db['CmList'][_0xb288('0x60')]({'where':{'id':_0xa2ef53[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x4f250e,null))[_0xb288('0x2b')](function(_0x2e1df7){if(_0x2e1df7){_0x33b49c['model']=_[_0xb288('0x3b')](db['Disposition'][_0xb288('0x35')]);_0x33b49c[_0xb288('0x3a')]=_['keys'](_0xa2ef53[_0xb288('0x3a')]);_0x33b49c[_0xb288('0x44')]=_['intersection'](_0x33b49c[_0xb288('0x39')],_0x33b49c[_0xb288('0x3a')]);_0xfd0555['attributes']=_[_0xb288('0x3d')](_0x33b49c[_0xb288('0x39')],qs[_0xb288('0x3e')](_0xa2ef53['query'][_0xb288('0x3e')]));_0xfd0555['attributes']=_0xfd0555['attributes']['length']?_0xfd0555[_0xb288('0x3c')]:_0x33b49c[_0xb288('0x39')];if(!_0xa2ef53[_0xb288('0x3a')][_0xb288('0x61')](_0xb288('0x62'))){_0xfd0555['limit']=qs['limit'](_0xa2ef53['query'][_0xb288('0x24')]);_0xfd0555[_0xb288('0x23')]=qs[_0xb288('0x23')](_0xa2ef53[_0xb288('0x3a')][_0xb288('0x23')]);}_0xfd0555['order']=qs[_0xb288('0x41')](_0xa2ef53[_0xb288('0x3a')]['sort']);_0xfd0555[_0xb288('0x42')]=qs[_0xb288('0x44')](_['pick'](_0xa2ef53[_0xb288('0x3a')],_0x33b49c['filters']));_0xfd0555[_0xb288('0x42')][_0xb288('0x5d')]=_0x2e1df7['id'];if(_0xa2ef53[_0xb288('0x3a')][_0xb288('0x45')]){_0xfd0555['where']=_['merge'](_0xfd0555[_0xb288('0x42')],{'$or':_[_0xb288('0x34')](_0xfd0555[_0xb288('0x3c')],function(_0x34ab9d){var _0x3a5c7a={};_0x3a5c7a[_0x34ab9d]={'$like':'%'+_0xa2ef53[_0xb288('0x3a')]['filter']+'%'};return _0x3a5c7a;})});}_0xfd0555=_[_0xb288('0x46')]({},_0xfd0555,_0xa2ef53[_0xb288('0x63')]);return db[_0xb288('0x5e')][_0xb288('0x26')]({'where':_0xfd0555[_0xb288('0x42')]})[_0xb288('0x2b')](function(_0x5edfcd){_0xc6ce13[_0xb288('0x26')]=_0x5edfcd;if(_0xa2ef53[_0xb288('0x3a')][_0xb288('0x49')]){_0xfd0555[_0xb288('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0xb288('0x4a')](_0xfd0555);})[_0xb288('0x2b')](function(_0xee8ce4){_0xc6ce13[_0xb288('0x4b')]=_0xee8ce4;return _0xc6ce13;});}})[_0xb288('0x2b')](respondWithFilteredResult(_0x4f250e,_0xfd0555))[_0xb288('0x4f')](handleError(_0x4f250e,null));};exports['removeDispositions']=function(_0x27838b,_0x514135,_0x3fad31){return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x27838b[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x514135,null))[_0xb288('0x2b')](function(_0x635d28){if(_0x635d28){return _0x635d28[_0xb288('0x64')](_0x27838b[_0xb288('0x3a')]['ids']);}})[_0xb288('0x2b')](respondWithStatusCode(_0x514135,null))[_0xb288('0x4f')](handleError(_0x514135,null));};exports[_0xb288('0x65')]=function(_0x1e7c4a,_0x5f0b95,_0x18ad34){return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x1e7c4a['params']['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x5f0b95,null))[_0xb288('0x2b')](function(_0x2fad1a){if(_0x2fad1a){var _0x2cc0ed=[];var _0x55c702={'success':[],'errors':[]};return db[_0xb288('0x66')][_0xb288('0x5b')]()['then'](function(_0x1f2eae){if(_0x1e7c4a[_0xb288('0x59')]['tags']&&_['isArray'](_0x1e7c4a['body'][_0xb288('0x67')])){if(_0x1e7c4a[_0xb288('0x59')][_0xb288('0x67')][_0xb288('0x3f')]){_0x1e7c4a[_0xb288('0x59')]['tags']=_0x1e7c4a[_0xb288('0x59')]['tags'][_0xb288('0x68')](';')+';';}else{_0x1e7c4a[_0xb288('0x59')][_0xb288('0x67')]=null;}}else{_0x1e7c4a['body'][_0xb288('0x67')]=null;}if(_0x1e7c4a[_0xb288('0x59')]&&_[_0xb288('0x69')](_0x1e7c4a[_0xb288('0x59')])){for(var _0x2dd355=0x0;_0x2dd355<_0x1e7c4a[_0xb288('0x59')][_0xb288('0x3f')];_0x2dd355+=0x1){_0x1e7c4a[_0xb288('0x59')][_0x2dd355]['ListId']=_0x1e7c4a[_0xb288('0x5a')]['id'];_0x2cc0ed['push'](_0x1e7c4a[_0xb288('0x59')][_0x2dd355]);}return BPromise[_0xb288('0x6a')](_0x2cc0ed,function(_0x451adc){return db[_0xb288('0x66')][_0xb288('0x50')](_['omit'](_0x451adc,[_0xb288('0x6b'),'id'])||{},{'fields':_[_0xb288('0x3b')](_0x1f2eae),'raw':!![]})[_0xb288('0x2b')](function(_0x316c7e){_0x55c702[_0xb288('0x6c')]['push'](_0x316c7e[_0xb288('0x6d')]);})[_0xb288('0x4f')](function(_0x1b9e10){_0x55c702[_0xb288('0x6e')]['push']({'data':_0x451adc,'error':_0x1b9e10[_0xb288('0x6f')]});});})[_0xb288('0x2b')](function(_0x1e2b90){return _0x55c702;})[_0xb288('0x4f')](function(_0x1efbc1){return _0x1efbc1;});}else{_0x5f0b95[_0xb288('0x20')](0x190)['json']({'message':_0xb288('0x70')});}});}})[_0xb288('0x2b')](respondWithResult(_0x5f0b95,null))['catch'](handleError(_0x5f0b95,null));};exports[_0xb288('0x71')]=function(_0x1bb764,_0x2a594e,_0x411721){var _0x3f2399;return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x1bb764[_0xb288('0x5a')]['id']},'include':[{'model':db[_0xb288('0x72')],'as':_0xb288('0x73')}]})[_0xb288('0x2b')](handleEntityNotFound(_0x2a594e,null))[_0xb288('0x2b')](function(_0x27b807){if(_0x27b807){_0x3f2399=_0x27b807;return db['CmContact'][_0xb288('0x35')];}})[_0xb288('0x2b')](function(_0x2b4b5f){if(_0x2b4b5f){var _0x40a61e={};var _0x4f56e8={};_0x4f56e8['model']=_[_0xb288('0x74')](_[_0xb288('0x3b')](_0x2b4b5f),_[_0xb288('0x34')](_0x3f2399[_0xb288('0x73')],function(_0x3c1c0a){return util['format'](_0xb288('0x75'),_0x3c1c0a['id']);}));_0x4f56e8[_0xb288('0x3a')]=_[_0xb288('0x3b')](_0x1bb764[_0xb288('0x3a')]);_0x4f56e8['filters']=_[_0xb288('0x3d')](_0x4f56e8[_0xb288('0x39')],_0x4f56e8['query']);_0x40a61e[_0xb288('0x3c')]=_[_0xb288('0x3d')](_0x4f56e8['model'],qs['fields'](_0x1bb764[_0xb288('0x3a')]['fields']));_0x40a61e[_0xb288('0x3c')]=_0x40a61e[_0xb288('0x3c')][_0xb288('0x3f')]?_0x40a61e[_0xb288('0x3c')]:_0x4f56e8[_0xb288('0x39')];if(!_0x1bb764[_0xb288('0x3a')][_0xb288('0x61')](_0xb288('0x62'))){_0x40a61e[_0xb288('0x24')]=qs[_0xb288('0x24')](_0x1bb764[_0xb288('0x3a')][_0xb288('0x24')]);_0x40a61e[_0xb288('0x23')]=qs['offset'](_0x1bb764['query'][_0xb288('0x23')]);}_0x40a61e[_0xb288('0x40')]=qs['sort'](_0x1bb764[_0xb288('0x3a')][_0xb288('0x41')]);_0x40a61e['where']=qs[_0xb288('0x44')](_['pick'](_0x1bb764[_0xb288('0x3a')],_0x4f56e8[_0xb288('0x44')]));_0x40a61e[_0xb288('0x76')]=!![];if(_0x1bb764['query'][_0xb288('0x45')]){_0x40a61e['where']=_[_0xb288('0x46')](_0x40a61e['where'],{'$or':_[_0xb288('0x34')](_0x40a61e[_0xb288('0x3c')],function(_0x66f83f){var _0x4ab2ba={};_0x4ab2ba[_0x66f83f]={'$like':'%'+_0x1bb764[_0xb288('0x3a')][_0xb288('0x45')]+'%'};return _0x4ab2ba;})});}_0x40a61e=_['merge']({},_0x40a61e,_0x1bb764[_0xb288('0x63')]);return _0x3f2399['getContacts'](_0x40a61e);}})['then'](respondWithResult(_0x2a594e,null))['catch'](handleError(_0x2a594e,null));};exports[_0xb288('0x77')]=function(_0x477f26,_0xd7edd,_0x25ae75){var _0x2e2fd8;return db[_0xb288('0x48')]['find']({'where':{'id':_0x477f26['params']['id']},'include':[{'model':db[_0xb288('0x72')],'as':_0xb288('0x73')}]})['then'](handleEntityNotFound(_0xd7edd,null))['then'](function(_0x2925fb){if(_0x2925fb){_0x2e2fd8=_0x2925fb;return db[_0xb288('0x66')]['rawAttributes'];}})[_0xb288('0x2b')](function(_0x523df6){if(_0x523df6){var _0x49a9dc={};var _0x3f31c0={};_0x3f31c0[_0xb288('0x39')]=_[_0xb288('0x74')](_[_0xb288('0x3b')](_0x523df6),_[_0xb288('0x34')](_0x2e2fd8[_0xb288('0x73')],function(_0x10e6df){return util['format'](_0xb288('0x75'),_0x10e6df['id']);}));_0x3f31c0[_0xb288('0x3a')]=_[_0xb288('0x3b')](_0x477f26[_0xb288('0x3a')]);_0x3f31c0[_0xb288('0x44')]=_[_0xb288('0x3d')](_0x3f31c0['model'],_0x3f31c0['query']);_0x49a9dc[_0xb288('0x3c')]=_[_0xb288('0x3d')](_0x3f31c0['model'],qs[_0xb288('0x3e')](_0x477f26[_0xb288('0x3a')]['fields']));_0x49a9dc[_0xb288('0x3c')]=_0x49a9dc[_0xb288('0x3c')][_0xb288('0x3f')]?_0x49a9dc['attributes']:_0x3f31c0[_0xb288('0x39')];if(!_0x477f26[_0xb288('0x3a')][_0xb288('0x61')](_0xb288('0x62'))){_0x49a9dc['limit']=qs[_0xb288('0x24')](_0x477f26[_0xb288('0x3a')][_0xb288('0x24')]);_0x49a9dc['offset']=qs[_0xb288('0x23')](_0x477f26[_0xb288('0x3a')][_0xb288('0x23')]);}_0x49a9dc[_0xb288('0x40')]=qs[_0xb288('0x41')](_0x477f26[_0xb288('0x3a')]['sort']);_0x49a9dc['where']=qs['filters'](_['pick'](_0x477f26[_0xb288('0x3a')],_0x3f31c0['filters']));_0x49a9dc['raw']=!![];if(_0x477f26['query'][_0xb288('0x45')]){_0x49a9dc[_0xb288('0x42')]=_['merge'](_0x49a9dc[_0xb288('0x42')],{'$or':_[_0xb288('0x34')](_0x49a9dc[_0xb288('0x3c')],function(_0x12dc61){var _0x3abb4c={};_0x3abb4c[_0x12dc61]={'$like':'%'+_0x477f26['query'][_0xb288('0x45')]+'%'};return _0x3abb4c;})});}_0x49a9dc=_['merge']({},_0x49a9dc,_0x477f26[_0xb288('0x63')]);return _0x2e2fd8['getContacts'](_0x49a9dc);}})[_0xb288('0x2b')](function(_0x3f25c7){if(!_[_0xb288('0x78')](_0x3f25c7)){var _0x4a0df5=toCsv(_0x3f25c7);var _0x1cec48=Date['now']();fs['writeFileSync'](util[_0xb288('0x79')]('/tmp/list_%d_%s.csv',_0x2e2fd8['id'],_0x1cec48),_0x4a0df5);_0xd7edd['setHeader'](_0xb288('0x7a'),_0xb288('0x7b')+util[_0xb288('0x79')](_0xb288('0x7c'),_0x2e2fd8['id'],_0x1cec48));_0xd7edd[_0xb288('0x7d')]('Content-type',_0xb288('0x7e'));return _0xd7edd['download'](util[_0xb288('0x79')]('/tmp/list_%d_%s.csv',_0x2e2fd8['id'],_0x1cec48));}else{return _0xd7edd['sendStatus'](0xcc);}})[_0xb288('0x4f')](handleError(_0xd7edd,null));};exports[_0xb288('0x7f')]=function(_0x507c3e,_0x2101e4,_0x5b5ec0){var _0x2c786c;delete _0x507c3e[_0xb288('0x59')]['id'];return db[_0xb288('0x48')]['findOne']({'where':{'id':_0x507c3e[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x2101e4,null))[_0xb288('0x2b')](function(_0x3fa0b3){if(_0x3fa0b3){return db[_0xb288('0x80')][_0xb288('0x81')](function(_0x3c45d6){return db[_0xb288('0x72')][_0xb288('0x50')](_0x507c3e['body'],{'transaction':_0x3c45d6})[_0xb288('0x2b')](function(_0x420344){_0x2c786c=_0x420344;return _0x3fa0b3[_0xb288('0x82')](_0x420344,{'transaction':_0x3c45d6});})[_0xb288('0x2b')](function(){var _0x97ae1a={'type':db[_0xb288('0x83')][_0xb288('0x84')],'transaction':_0x3c45d6};switch(_0x507c3e[_0xb288('0x59')][_0xb288('0x37')]){case _0xb288('0x85'):_0x97ae1a[_0xb288('0x37')]=db['Sequelize'][_0xb288('0x84')];break;case'number':_0x97ae1a[_0xb288('0x37')]=db[_0xb288('0x83')][_0xb288('0x86')];break;case'switch':_0x97ae1a[_0xb288('0x37')]=db[_0xb288('0x83')][_0xb288('0x87')];_0x97ae1a[_0xb288('0x88')]=![];break;default:}return db['sequelize'][_0xb288('0x89')]['addColumn'](_0xb288('0x8a'),util[_0xb288('0x79')](_0xb288('0x8b'),_0x2c786c['id']),_0x97ae1a);})[_0xb288('0x2b')](function(){return _0x2c786c;});});}})[_0xb288('0x2b')](respondWithResult(_0x2101e4,null))[_0xb288('0x4f')](handleError(_0x2101e4,null));};exports[_0xb288('0x8c')]=function(_0x4307db,_0x49e0fe,_0x1b01bf){var _0x24f7fe={};var _0x15680d={};var _0x553b05;var _0x48539e;return db['CmList']['findOne']({'where':{'id':_0x4307db[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x49e0fe,null))[_0xb288('0x2b')](function(_0x200134){if(_0x200134){_0x553b05=_0x200134;_0x15680d['model']=_[_0xb288('0x3b')](db['CmCustomField'][_0xb288('0x35')]);_0x15680d[_0xb288('0x3a')]=_[_0xb288('0x3b')](_0x4307db[_0xb288('0x3a')]);_0x15680d['filters']=_[_0xb288('0x3d')](_0x15680d['model'],_0x15680d[_0xb288('0x3a')]);_0x24f7fe['attributes']=_[_0xb288('0x3d')](_0x15680d[_0xb288('0x39')],qs[_0xb288('0x3e')](_0x4307db['query'][_0xb288('0x3e')]));_0x24f7fe[_0xb288('0x3c')]=_0x24f7fe[_0xb288('0x3c')][_0xb288('0x3f')]?_0x24f7fe[_0xb288('0x3c')]:_0x15680d[_0xb288('0x39')];_0x24f7fe['order']=qs['sort'](_0x4307db[_0xb288('0x3a')][_0xb288('0x41')]);_0x24f7fe[_0xb288('0x42')]=qs[_0xb288('0x44')](_[_0xb288('0x43')](_0x4307db['query'],_0x15680d['filters']));_0x24f7fe[_0xb288('0x42')]=_['merge'](_0x24f7fe[_0xb288('0x42')],{'$or':[{'ListId':_0x200134['id']},{'ListId':null}]});if(_0x4307db[_0xb288('0x3a')]['filter']){_0x24f7fe[_0xb288('0x42')]=_['merge'](_0x24f7fe['where'],{'$or':_[_0xb288('0x34')](_0x24f7fe[_0xb288('0x3c')],function(_0x58a245){var _0xd84776={};_0xd84776[_0x58a245]={'$like':'%'+_0x4307db[_0xb288('0x3a')]['filter']+'%'};return _0xd84776;})});}_0x24f7fe=_[_0xb288('0x46')]({},_0x24f7fe,_0x4307db[_0xb288('0x63')]);return db[_0xb288('0x72')]['findAndCountAll'](_0x24f7fe);}})[_0xb288('0x2b')](respondWithResult(_0x49e0fe,null))[_0xb288('0x4f')](handleError(_0x49e0fe,null));};exports[_0xb288('0x8d')]=function(_0x3a5c44,_0x53b3fd,_0x41d02c){return db[_0xb288('0x48')][_0xb288('0x4e')]({'where':{'id':_0x3a5c44[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x53b3fd,null))[_0xb288('0x2b')](function(_0x28e75b){if(_0x28e75b){return _0x28e75b['addAgents'](_0x3a5c44['body']['ids'],_[_0xb288('0x8e')](_0x3a5c44[_0xb288('0x59')],[_0xb288('0x6b'),'id'])||{})['spread'](function(_0x4b9ac5){for(var _0x2af37f=0x0;_0x2af37f<_0x3a5c44[_0xb288('0x59')][_0xb288('0x6b')][_0xb288('0x3f')];_0x2af37f+=0x1){socket[_0xb288('0x8f')](_0xb288('0x90'),{'UserId':Number(_0x3a5c44[_0xb288('0x59')][_0xb288('0x6b')][_0x2af37f]),'CmListId':Number(_0x3a5c44[_0xb288('0x5a')]['id'])});}return _0x4b9ac5;});}})[_0xb288('0x2b')](respondWithResult(_0x53b3fd,null))[_0xb288('0x4f')](handleError(_0x53b3fd,null));};exports[_0xb288('0x91')]=function(_0x56d4c8,_0x1794e0,_0x275f8a){return db['CmList'][_0xb288('0x4e')]({'where':{'id':_0x56d4c8[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x1794e0,null))['then'](function(_0x1c6233){if(_0x1c6233){return _0x1c6233[_0xb288('0x91')](_0x56d4c8[_0xb288('0x3a')][_0xb288('0x6b')])['then'](function(){if(_[_0xb288('0x69')](_0x56d4c8[_0xb288('0x3a')]['ids'])){for(var _0x1ef010=0x0;_0x1ef010<_0x56d4c8[_0xb288('0x3a')][_0xb288('0x6b')][_0xb288('0x3f')];_0x1ef010+=0x1){socket[_0xb288('0x8f')](_0xb288('0x92'),{'UserId':Number(_0x56d4c8[_0xb288('0x3a')][_0xb288('0x6b')][_0x1ef010]),'CmListId':Number(_0x56d4c8[_0xb288('0x5a')]['id'])});}}else{socket[_0xb288('0x8f')](_0xb288('0x92'),{'UserId':Number(_0x56d4c8[_0xb288('0x3a')][_0xb288('0x6b')]),'CmListId':Number(_0x56d4c8['params']['id'])});}});}})[_0xb288('0x2b')](respondWithStatusCode(_0x1794e0,null))['catch'](handleError(_0x1794e0,null));};exports[_0xb288('0x93')]=function(_0x15dcd1,_0x2f0b1b,_0x10b94d){var _0x4309bf={};var _0x4b789c={};var _0x4d7096;var _0x536b4f;return db[_0xb288('0x48')][_0xb288('0x60')]({'where':{'id':_0x15dcd1[_0xb288('0x5a')]['id']}})[_0xb288('0x2b')](handleEntityNotFound(_0x2f0b1b,null))['then'](function(_0x50de16){if(_0x50de16){_0x4d7096=_0x50de16;_0x4b789c[_0xb288('0x39')]=_[_0xb288('0x3b')](db[_0xb288('0x94')][_0xb288('0x35')]);_0x4b789c['query']=_['keys'](_0x15dcd1['query']);_0x4b789c['filters']=_[_0xb288('0x3d')](_0x4b789c['model'],_0x4b789c[_0xb288('0x3a')]);_0x4309bf[_0xb288('0x3c')]=_[_0xb288('0x3d')](_0x4b789c['model'],qs[_0xb288('0x3e')](_0x15dcd1['query']['fields']));_0x4309bf[_0xb288('0x3c')]=_0x4309bf['attributes'][_0xb288('0x3f')]?_0x4309bf['attributes']:_0x4b789c[_0xb288('0x39')];_0x4309bf[_0xb288('0x40')]=qs[_0xb288('0x41')](_0x15dcd1['query']['sort']);_0x4309bf[_0xb288('0x42')]=qs[_0xb288('0x44')](_[_0xb288('0x43')](_0x15dcd1[_0xb288('0x3a')],_0x4b789c[_0xb288('0x44')]));if(_0x15dcd1[_0xb288('0x3a')][_0xb288('0x45')]){_0x4309bf[_0xb288('0x42')]=_[_0xb288('0x46')](_0x4309bf[_0xb288('0x42')],{'$or':_[_0xb288('0x34')](_0x4309bf[_0xb288('0x3c')],function(_0x5e7fe3){var _0xd38615={};_0xd38615[_0x5e7fe3]={'$like':'%'+_0x15dcd1[_0xb288('0x3a')]['filter']+'%'};return _0xd38615;})});}_0x4309bf=_[_0xb288('0x46')]({},_0x4309bf,_0x15dcd1['options']);return _0x4d7096[_0xb288('0x93')](_0x4309bf);}})[_0xb288('0x2b')](function(_0x519e13){if(_0x519e13){_0x536b4f=_0x519e13[_0xb288('0x3f')];if(!_0x15dcd1[_0xb288('0x3a')][_0xb288('0x61')]('nolimit')){_0x4309bf[_0xb288('0x24')]=qs[_0xb288('0x24')](_0x15dcd1['query'][_0xb288('0x24')]);_0x4309bf[_0xb288('0x23')]=qs[_0xb288('0x23')](_0x15dcd1[_0xb288('0x3a')][_0xb288('0x23')]);}return _0x4d7096[_0xb288('0x93')](_0x4309bf);}})[_0xb288('0x2b')](function(_0x4e7843){if(_0x4e7843){return _0x4e7843?{'count':_0x536b4f,'rows':_0x4e7843}:null;}})['then'](respondWithResult(_0x2f0b1b,null))[_0xb288('0x4f')](handleError(_0x2f0b1b,null));}; \ No newline at end of file +var _0xff78=['now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sendStatus','addCustomField','sequelize','Sequelize','text','TEXT','INTEGER','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','tags','isArray','each','CmContact','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','isEmpty'];(function(_0x3bda7c,_0x4b2720){var _0x415b02=function(_0x2709be){while(--_0x2709be){_0x3bda7c['push'](_0x3bda7c['shift']());}};_0x415b02(++_0x4b2720);}(_0xff78,0xb1));var _0x8ff7=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xff78[_0x2f57b2];return _0x5ace77;};'use strict';var emlformat=require(_0x8ff7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ff7('0x1'));var jsonpatch=require(_0x8ff7('0x2'));var rp=require(_0x8ff7('0x3'));var moment=require(_0x8ff7('0x4'));var BPromise=require(_0x8ff7('0x5'));var Mustache=require(_0x8ff7('0x6'));var util=require(_0x8ff7('0x7'));var path=require(_0x8ff7('0x8'));var sox=require(_0x8ff7('0x9'));var csv=require(_0x8ff7('0xa'));var ejs=require(_0x8ff7('0xb'));var fs=require('fs');var fs_extra=require(_0x8ff7('0xc'));var _=require(_0x8ff7('0xd'));var squel=require(_0x8ff7('0xe'));var crypto=require(_0x8ff7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ff7('0xa'));var querystring=require(_0x8ff7('0x10'));var Papa=require(_0x8ff7('0x11'));var Redis=require('ioredis');var authService=require(_0x8ff7('0x12'));var qs=require(_0x8ff7('0x13'));var as=require(_0x8ff7('0x14'));var hardwareService=require(_0x8ff7('0x15'));var logger=require(_0x8ff7('0x16'))(_0x8ff7('0x17'));var utils=require(_0x8ff7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ff7('0x19'));var db=require(_0x8ff7('0x1a'))['db'];config[_0x8ff7('0x1b')]=_['defaults'](config[_0x8ff7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ff7('0x1c'))(new Redis(config['redis']));require(_0x8ff7('0x1d'))['register'](socket);function respondWithStatusCode(_0x14abc4,_0x3112ff){_0x3112ff=_0x3112ff||0xcc;return function(_0x2ea3ce){if(_0x2ea3ce){return _0x14abc4['sendStatus'](_0x3112ff);}return _0x14abc4[_0x8ff7('0x1e')](_0x3112ff)[_0x8ff7('0x1f')]();};}function respondWithResult(_0x4212d6,_0x3ada82){_0x3ada82=_0x3ada82||0xc8;return function(_0x556706){if(_0x556706){return _0x4212d6[_0x8ff7('0x1e')](_0x3ada82)[_0x8ff7('0x20')](_0x556706);}};}function respondWithFilteredResult(_0x3fc622,_0x35988b){return function(_0x3ca2a7){if(_0x3ca2a7){var _0x56ba13=typeof _0x35988b['offset']===_0x8ff7('0x21')&&typeof _0x35988b[_0x8ff7('0x22')]==='undefined';var _0x5e09bc=_0x3ca2a7[_0x8ff7('0x23')];var _0x7b174a=_0x56ba13?0x0:_0x35988b[_0x8ff7('0x24')];var _0x4e859a=_0x56ba13?_0x3ca2a7['count']:_0x35988b[_0x8ff7('0x24')]+_0x35988b[_0x8ff7('0x22')];var _0x4b3cdb;if(_0x4e859a>=_0x5e09bc){_0x4e859a=_0x5e09bc;_0x4b3cdb=0xc8;}else{_0x4b3cdb=0xce;}_0x3fc622[_0x8ff7('0x1e')](_0x4b3cdb);return _0x3fc622[_0x8ff7('0x25')](_0x8ff7('0x26'),_0x7b174a+'-'+_0x4e859a+'/'+_0x5e09bc)['json'](_0x3ca2a7);}return null;};}function patchUpdates(_0xcc3b68){return function(_0x545c93){try{jsonpatch['apply'](_0x545c93,_0xcc3b68,!![]);}catch(_0x1e01c8){return BPromise[_0x8ff7('0x27')](_0x1e01c8);}return _0x545c93[_0x8ff7('0x28')]();};}function saveUpdates(_0x35f1c7,_0x3173fc){return function(_0x422127){if(_0x422127){return _0x422127[_0x8ff7('0x29')](_0x35f1c7)[_0x8ff7('0x2a')](function(_0x29560d){return _0x29560d;});}return null;};}function removeEntity(_0x4db985,_0x42243d){return function(_0x18e731){if(_0x18e731){return _0x18e731[_0x8ff7('0x2b')]()['then'](function(){var _0x8f2e42=_0x18e731[_0x8ff7('0x2c')]({'plain':!![]});var _0x1469c9=_0x8ff7('0x2d');return db[_0x8ff7('0x2e')][_0x8ff7('0x2b')]({'where':{'type':_0x1469c9,'resourceId':_0x8f2e42['id']}})['then'](function(){return _0x18e731;});})[_0x8ff7('0x2a')](function(){_0x4db985[_0x8ff7('0x1e')](0xcc)[_0x8ff7('0x1f')]();});}};}function handleEntityNotFound(_0xdb4d0c,_0x173ea8){return function(_0x56837f){if(!_0x56837f){_0xdb4d0c['sendStatus'](0x194);}return _0x56837f;};}function handleError(_0x3d9155,_0xb37402){_0xb37402=_0xb37402||0x1f4;return function(_0x98a2d9){logger[_0x8ff7('0x2f')](_0x98a2d9[_0x8ff7('0x30')]);if(_0x98a2d9[_0x8ff7('0x31')]){delete _0x98a2d9[_0x8ff7('0x31')];}_0x3d9155[_0x8ff7('0x1e')](_0xb37402)[_0x8ff7('0x32')](_0x98a2d9);};}exports[_0x8ff7('0x33')]=function(_0x45c574,_0x4eddbe){var _0x58688a={},_0x370a7f={},_0x56f8ad={'count':0x0,'rows':[]};var _0x445952=_['map'](db[_0x8ff7('0x34')][_0x8ff7('0x35')],function(_0x14a190){return{'name':_0x14a190[_0x8ff7('0x36')],'type':_0x14a190[_0x8ff7('0x37')][_0x8ff7('0x38')]};});_0x370a7f[_0x8ff7('0x39')]=_[_0x8ff7('0x3a')](_0x445952,_0x8ff7('0x31'));_0x370a7f['query']=_[_0x8ff7('0x3b')](_0x45c574[_0x8ff7('0x3c')]);_0x370a7f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x370a7f[_0x8ff7('0x39')],_0x370a7f[_0x8ff7('0x3c')]);_0x58688a[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0x370a7f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x58688a[_0x8ff7('0x3f')]=_0x58688a['attributes']['length']?_0x58688a['attributes']:_0x370a7f[_0x8ff7('0x39')];if(!_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x58688a['limit']=qs['limit'](_0x45c574['query'][_0x8ff7('0x22')]);_0x58688a[_0x8ff7('0x24')]=qs['offset'](_0x45c574[_0x8ff7('0x3c')]['offset']);}_0x58688a[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x58688a[_0x8ff7('0x45')]=qs['filters'](_[_0x8ff7('0x46')](_0x45c574['query'],_0x370a7f[_0x8ff7('0x3d')]),_0x445952);if(_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x58688a[_0x8ff7('0x45')]=_[_0x8ff7('0x48')](_0x58688a[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x445952,function(_0x1137b8){if(_0x1137b8[_0x8ff7('0x37')]!==_0x8ff7('0x49')){var _0x5b67e7={};_0x5b67e7[_0x1137b8[_0x8ff7('0x31')]]={'$like':'%'+_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x5b67e7;}})});}_0x58688a=_[_0x8ff7('0x48')]({},_0x58688a,_0x45c574[_0x8ff7('0x4a')]);var _0x51ad22={'where':_0x58688a['where']};return db[_0x8ff7('0x34')][_0x8ff7('0x23')](_0x51ad22)[_0x8ff7('0x2a')](function(_0x20c001){_0x56f8ad[_0x8ff7('0x23')]=_0x20c001;if(_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x58688a[_0x8ff7('0x4c')]=[{'all':!![]}];}return db[_0x8ff7('0x34')]['findAll'](_0x58688a);})[_0x8ff7('0x2a')](function(_0x369ce1){_0x56f8ad[_0x8ff7('0x4d')]=_0x369ce1;return _0x56f8ad;})[_0x8ff7('0x2a')](respondWithFilteredResult(_0x4eddbe,_0x58688a))[_0x8ff7('0x4e')](handleError(_0x4eddbe,null));};exports['show']=function(_0x154245,_0x5be1ce){var _0x244e7e={'raw':![],'where':{'id':_0x154245[_0x8ff7('0x4f')]['id']}},_0x53b2af={};_0x53b2af[_0x8ff7('0x39')]=_['keys'](db[_0x8ff7('0x34')][_0x8ff7('0x35')]);_0x53b2af[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x154245[_0x8ff7('0x3c')]);_0x53b2af[_0x8ff7('0x3d')]=_['intersection'](_0x53b2af['model'],_0x53b2af[_0x8ff7('0x3c')]);_0x244e7e['attributes']=_['intersection'](_0x53b2af[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x154245[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x244e7e[_0x8ff7('0x3f')]=_0x244e7e[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x244e7e[_0x8ff7('0x3f')]:_0x53b2af[_0x8ff7('0x39')];if(_0x154245[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x244e7e[_0x8ff7('0x4c')]=[{'all':!![]}];}_0x244e7e=_[_0x8ff7('0x48')]({},_0x244e7e,_0x154245[_0x8ff7('0x4a')]);return db[_0x8ff7('0x34')][_0x8ff7('0x51')](_0x244e7e)[_0x8ff7('0x2a')](handleEntityNotFound(_0x5be1ce,null))[_0x8ff7('0x2a')](respondWithResult(_0x5be1ce,null))[_0x8ff7('0x4e')](handleError(_0x5be1ce,null));};exports[_0x8ff7('0x52')]=function(_0x19751a,_0x268941){return db[_0x8ff7('0x34')][_0x8ff7('0x52')](_0x19751a[_0x8ff7('0x53')],{})[_0x8ff7('0x2a')](function(_0x785ec4){var _0x5e3a9a=_0x19751a[_0x8ff7('0x54')][_0x8ff7('0x2c')]({'plain':!![]});if(!_0x5e3a9a)throw new Error(_0x8ff7('0x55'));if(_0x5e3a9a[_0x8ff7('0x56')]===_0x8ff7('0x54')){var _0x3321e3=_0x785ec4[_0x8ff7('0x2c')]({'plain':!![]});var _0x551fa3=_0x8ff7('0x2d');return db['UserProfileSection'][_0x8ff7('0x51')]({'where':{'name':_0x551fa3,'userProfileId':_0x5e3a9a['userProfileId']},'raw':!![]})[_0x8ff7('0x2a')](function(_0x460769){if(_0x460769&&_0x460769[_0x8ff7('0x57')]===0x0){return db[_0x8ff7('0x2e')]['create']({'name':_0x3321e3['name'],'resourceId':_0x3321e3['id'],'type':_0x460769[_0x8ff7('0x31')],'sectionId':_0x460769['id']},{})[_0x8ff7('0x2a')](function(){return _0x785ec4;});}else{return _0x785ec4;}})[_0x8ff7('0x4e')](function(_0x184e62){logger[_0x8ff7('0x2f')](_0x8ff7('0x58'),_0x184e62);throw _0x184e62;});}return _0x785ec4;})[_0x8ff7('0x2a')](respondWithResult(_0x268941,0xc9))[_0x8ff7('0x4e')](handleError(_0x268941,null));};exports['update']=function(_0x473696,_0x556033){if(_0x473696[_0x8ff7('0x53')]['id']){delete _0x473696[_0x8ff7('0x53')]['id'];}return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x473696[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x556033,null))['then'](saveUpdates(_0x473696[_0x8ff7('0x53')],null))['then'](respondWithResult(_0x556033,null))['catch'](handleError(_0x556033,null));};exports[_0x8ff7('0x2b')]=function(_0x271cd9,_0x466aba){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x271cd9[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x466aba,null))[_0x8ff7('0x2a')](removeEntity(_0x466aba,null))[_0x8ff7('0x4e')](handleError(_0x466aba,null));};exports[_0x8ff7('0x59')]=function(_0xa14c49,_0x44ab97){return db[_0x8ff7('0x34')][_0x8ff7('0x59')]()[_0x8ff7('0x2a')](respondWithResult(_0x44ab97,null))[_0x8ff7('0x4e')](handleError(_0x44ab97,null));};exports[_0x8ff7('0x5a')]=function(_0x399921,_0xa892af,_0x25aa90){if(_0x399921[_0x8ff7('0x53')]['id']){delete _0x399921[_0x8ff7('0x53')]['id'];}return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x399921[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa892af,null))[_0x8ff7('0x2a')](function(_0x4a1694){if(_0x4a1694){_0x399921['body'][_0x8ff7('0x5b')]=_0x4a1694['id'];return db[_0x8ff7('0x5c')][_0x8ff7('0x52')](_0x399921[_0x8ff7('0x53')]);}})[_0x8ff7('0x2a')](respondWithResult(_0xa892af,null))[_0x8ff7('0x4e')](handleError(_0xa892af,null));};exports[_0x8ff7('0x5d')]=function(_0x2185b3,_0x2a3d37,_0xd9f3db){var _0x3e7f4c={'raw':![],'where':{}};var _0x2f2748={};var _0x58e882={'count':0x0,'rows':[]};return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x2185b3['params']['id']}})['then'](handleEntityNotFound(_0x2a3d37,null))[_0x8ff7('0x2a')](function(_0x4a2b47){if(_0x4a2b47){_0x2f2748[_0x8ff7('0x39')]=_['keys'](db[_0x8ff7('0x5c')]['rawAttributes']);_0x2f2748[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x2185b3[_0x8ff7('0x3c')]);_0x2f2748[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x2f2748[_0x8ff7('0x39')],_0x2f2748[_0x8ff7('0x3c')]);_0x3e7f4c['attributes']=_['intersection'](_0x2f2748[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x2185b3['query'][_0x8ff7('0x40')]));_0x3e7f4c['attributes']=_0x3e7f4c[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x3e7f4c[_0x8ff7('0x3f')]:_0x2f2748[_0x8ff7('0x39')];if(!_0x2185b3['query'][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x3e7f4c[_0x8ff7('0x22')]=qs[_0x8ff7('0x22')](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x3e7f4c['offset']=qs[_0x8ff7('0x24')](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}_0x3e7f4c[_0x8ff7('0x43')]=qs['sort'](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x3e7f4c[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x2185b3['query'],_0x2f2748[_0x8ff7('0x3d')]));_0x3e7f4c[_0x8ff7('0x45')]['ListId']=_0x4a2b47['id'];if(_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x3e7f4c['where']=_['merge'](_0x3e7f4c[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x3e7f4c[_0x8ff7('0x3f')],function(_0x41a51a){var _0x53b35f={};_0x53b35f[_0x41a51a]={'$like':'%'+_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x53b35f;})});}_0x3e7f4c=_[_0x8ff7('0x48')]({},_0x3e7f4c,_0x2185b3['options']);return db[_0x8ff7('0x5c')][_0x8ff7('0x23')]({'where':_0x3e7f4c[_0x8ff7('0x45')]})[_0x8ff7('0x2a')](function(_0x63330a){_0x58e882[_0x8ff7('0x23')]=_0x63330a;if(_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x3e7f4c[_0x8ff7('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x8ff7('0x5f')](_0x3e7f4c);})['then'](function(_0x7eafbc){_0x58e882[_0x8ff7('0x4d')]=_0x7eafbc;return _0x58e882;});}})[_0x8ff7('0x2a')](respondWithFilteredResult(_0x2a3d37,_0x3e7f4c))[_0x8ff7('0x4e')](handleError(_0x2a3d37,null));};exports['removeDispositions']=function(_0x3fc184,_0x2f46f5,_0x1dc277){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x3fc184[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2f46f5,null))['then'](function(_0x49b7cc){if(_0x49b7cc){return _0x49b7cc[_0x8ff7('0x60')](_0x3fc184['query'][_0x8ff7('0x61')]);}})[_0x8ff7('0x2a')](respondWithStatusCode(_0x2f46f5,null))['catch'](handleError(_0x2f46f5,null));};exports[_0x8ff7('0x62')]=function(_0x4c161b,_0x1c61dd,_0x3d6684){return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x4c161b['params']['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x1c61dd,null))[_0x8ff7('0x2a')](function(_0x18d4cb){if(_0x18d4cb){var _0x124ff7=[];var _0x42757f={'success':[],'errors':[]};return db['CmContact'][_0x8ff7('0x59')]()[_0x8ff7('0x2a')](function(_0x4b12e3){if(_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]&&_[_0x8ff7('0x64')](_0x4c161b['body'][_0x8ff7('0x63')])){if(_0x4c161b['body']['tags'][_0x8ff7('0x50')]){_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]=_0x4c161b[_0x8ff7('0x53')]['tags']['join'](';')+';';}else{_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]=null;}}else{_0x4c161b[_0x8ff7('0x53')]['tags']=null;}if(_0x4c161b[_0x8ff7('0x53')]&&_[_0x8ff7('0x64')](_0x4c161b[_0x8ff7('0x53')])){for(var _0x4628f3=0x0;_0x4628f3<_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x50')];_0x4628f3+=0x1){_0x4c161b[_0x8ff7('0x53')][_0x4628f3]['ListId']=_0x4c161b[_0x8ff7('0x4f')]['id'];_0x124ff7['push'](_0x4c161b[_0x8ff7('0x53')][_0x4628f3]);}return BPromise[_0x8ff7('0x65')](_0x124ff7,function(_0x29a866){return db[_0x8ff7('0x66')][_0x8ff7('0x52')](_['omit'](_0x29a866,['ids','id'])||{},{'fields':_['keys'](_0x4b12e3),'raw':!![]})[_0x8ff7('0x2a')](function(_0xb386c){_0x42757f[_0x8ff7('0x67')][_0x8ff7('0x68')](_0xb386c[_0x8ff7('0x69')]);})[_0x8ff7('0x4e')](function(_0x29c912){_0x42757f[_0x8ff7('0x6a')][_0x8ff7('0x68')]({'data':_0x29a866,'error':_0x29c912[_0x8ff7('0x6b')]});});})[_0x8ff7('0x2a')](function(_0x240cbc){return _0x42757f;})[_0x8ff7('0x4e')](function(_0x7e223f){return _0x7e223f;});}else{_0x1c61dd[_0x8ff7('0x1e')](0x190)[_0x8ff7('0x20')]({'message':_0x8ff7('0x6c')});}});}})[_0x8ff7('0x2a')](respondWithResult(_0x1c61dd,null))[_0x8ff7('0x4e')](handleError(_0x1c61dd,null));};exports[_0x8ff7('0x6d')]=function(_0x360f41,_0x20d347,_0x54cef0){var _0x230e44;return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x360f41[_0x8ff7('0x4f')]['id']},'include':[{'model':db[_0x8ff7('0x6e')],'as':'CustomFields'}]})[_0x8ff7('0x2a')](handleEntityNotFound(_0x20d347,null))[_0x8ff7('0x2a')](function(_0x4c4ea4){if(_0x4c4ea4){_0x230e44=_0x4c4ea4;return db[_0x8ff7('0x66')][_0x8ff7('0x35')];}})['then'](function(_0x261cb3){if(_0x261cb3){var _0x164c08={};var _0xf8a37f={};_0xf8a37f[_0x8ff7('0x39')]=_[_0x8ff7('0x6f')](_[_0x8ff7('0x3b')](_0x261cb3),_[_0x8ff7('0x3a')](_0x230e44[_0x8ff7('0x70')],function(_0x543a6b){return util[_0x8ff7('0x71')](_0x8ff7('0x72'),_0x543a6b['id']);}));_0xf8a37f[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x360f41[_0x8ff7('0x3c')]);_0xf8a37f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0xf8a37f[_0x8ff7('0x39')],_0xf8a37f[_0x8ff7('0x3c')]);_0x164c08[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0xf8a37f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x360f41[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x164c08['attributes']=_0x164c08[_0x8ff7('0x3f')]['length']?_0x164c08[_0x8ff7('0x3f')]:_0xf8a37f[_0x8ff7('0x39')];if(!_0x360f41[_0x8ff7('0x3c')]['hasOwnProperty'](_0x8ff7('0x42'))){_0x164c08[_0x8ff7('0x22')]=qs[_0x8ff7('0x22')](_0x360f41['query']['limit']);_0x164c08[_0x8ff7('0x24')]=qs[_0x8ff7('0x24')](_0x360f41['query']['offset']);}_0x164c08[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x360f41['query'][_0x8ff7('0x44')]);_0x164c08['where']=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x360f41[_0x8ff7('0x3c')],_0xf8a37f[_0x8ff7('0x3d')]));_0x164c08[_0x8ff7('0x73')]=!![];if(_0x360f41['query'][_0x8ff7('0x47')]){_0x164c08['where']=_[_0x8ff7('0x48')](_0x164c08[_0x8ff7('0x45')],{'$or':_['map'](_0x164c08[_0x8ff7('0x3f')],function(_0x1d756d){var _0x32b14d={};_0x32b14d[_0x1d756d]={'$like':'%'+_0x360f41[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x32b14d;})});}_0x164c08=_[_0x8ff7('0x48')]({},_0x164c08,_0x360f41[_0x8ff7('0x4a')]);return _0x230e44[_0x8ff7('0x6d')](_0x164c08);}})['then'](respondWithResult(_0x20d347,null))[_0x8ff7('0x4e')](handleError(_0x20d347,null));};exports['getContactsCsv']=function(_0xe336a,_0x29fb51,_0x5e1812){var _0x367081;return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0xe336a[_0x8ff7('0x4f')]['id']},'include':[{'model':db[_0x8ff7('0x6e')],'as':'CustomFields'}]})[_0x8ff7('0x2a')](handleEntityNotFound(_0x29fb51,null))['then'](function(_0x1a11d7){if(_0x1a11d7){_0x367081=_0x1a11d7;return db[_0x8ff7('0x66')][_0x8ff7('0x35')];}})[_0x8ff7('0x2a')](function(_0x58ca46){if(_0x58ca46){var _0x419ec8={};var _0x5f510f={};_0x5f510f[_0x8ff7('0x39')]=_['concat'](_[_0x8ff7('0x3b')](_0x58ca46),_[_0x8ff7('0x3a')](_0x367081[_0x8ff7('0x70')],function(_0x3ab43c){return util[_0x8ff7('0x71')](_0x8ff7('0x72'),_0x3ab43c['id']);}));_0x5f510f[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0xe336a[_0x8ff7('0x3c')]);_0x5f510f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x5f510f[_0x8ff7('0x39')],_0x5f510f['query']);_0x419ec8['attributes']=_[_0x8ff7('0x3e')](_0x5f510f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0xe336a[_0x8ff7('0x3c')]['fields']));_0x419ec8[_0x8ff7('0x3f')]=_0x419ec8[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x419ec8[_0x8ff7('0x3f')]:_0x5f510f[_0x8ff7('0x39')];if(!_0xe336a[_0x8ff7('0x3c')]['hasOwnProperty'](_0x8ff7('0x42'))){_0x419ec8['limit']=qs[_0x8ff7('0x22')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x419ec8['offset']=qs[_0x8ff7('0x24')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}_0x419ec8[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x419ec8[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0xe336a[_0x8ff7('0x3c')],_0x5f510f['filters']));_0x419ec8['raw']=!![];if(_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x419ec8['where']=_[_0x8ff7('0x48')](_0x419ec8[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x419ec8[_0x8ff7('0x3f')],function(_0x5d7fd0){var _0x2b18d9={};_0x2b18d9[_0x5d7fd0]={'$like':'%'+_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x2b18d9;})});}_0x419ec8=_[_0x8ff7('0x48')]({},_0x419ec8,_0xe336a[_0x8ff7('0x4a')]);return _0x367081['getContacts'](_0x419ec8);}})['then'](function(_0x45ec9f){if(!_[_0x8ff7('0x74')](_0x45ec9f)){var _0x9f3eea=toCsv(_0x45ec9f);var _0x5410c8=Date[_0x8ff7('0x75')]();fs['writeFileSync'](util[_0x8ff7('0x71')]('/tmp/list_%d_%s.csv',_0x367081['id'],_0x5410c8),_0x9f3eea);_0x29fb51['setHeader'](_0x8ff7('0x76'),_0x8ff7('0x77')+util['format'](_0x8ff7('0x78'),_0x367081['id'],_0x5410c8));_0x29fb51['setHeader'](_0x8ff7('0x79'),_0x8ff7('0x7a'));return _0x29fb51[_0x8ff7('0x7b')](util['format'](_0x8ff7('0x7c'),_0x367081['id'],_0x5410c8));}else{return _0x29fb51[_0x8ff7('0x7d')](0xcc);}})['catch'](handleError(_0x29fb51,null));};exports[_0x8ff7('0x7e')]=function(_0x435894,_0x192d93,_0x3b5683){var _0x335455;delete _0x435894['body']['id'];return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x435894['params']['id']}})['then'](handleEntityNotFound(_0x192d93,null))['then'](function(_0x1717fc){if(_0x1717fc){return db[_0x8ff7('0x7f')]['transaction'](function(_0x5f198c){return db[_0x8ff7('0x6e')]['create'](_0x435894['body'],{'transaction':_0x5f198c})[_0x8ff7('0x2a')](function(_0x39afef){_0x335455=_0x39afef;return _0x1717fc['addCustomFields'](_0x39afef,{'transaction':_0x5f198c});})[_0x8ff7('0x2a')](function(){var _0x445dad={'type':db[_0x8ff7('0x80')]['TEXT'],'transaction':_0x5f198c};switch(_0x435894[_0x8ff7('0x53')][_0x8ff7('0x37')]){case _0x8ff7('0x81'):_0x445dad['type']=db[_0x8ff7('0x80')][_0x8ff7('0x82')];break;case'number':_0x445dad[_0x8ff7('0x37')]=db['Sequelize'][_0x8ff7('0x83')];break;case'switch':_0x445dad[_0x8ff7('0x37')]=db[_0x8ff7('0x80')]['BOOLEAN'];_0x445dad[_0x8ff7('0x84')]=![];break;default:}return db[_0x8ff7('0x7f')]['queryInterface'][_0x8ff7('0x85')](_0x8ff7('0x86'),util[_0x8ff7('0x71')](_0x8ff7('0x87'),_0x335455['id']),_0x445dad);})[_0x8ff7('0x2a')](function(){return _0x335455;});});}})[_0x8ff7('0x2a')](respondWithResult(_0x192d93,null))[_0x8ff7('0x4e')](handleError(_0x192d93,null));};exports[_0x8ff7('0x88')]=function(_0x1367b7,_0x356611,_0x5d06ee){var _0x3e46de={};var _0x306c8c={};var _0x1e7d95;var _0xea6ef4;return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x1367b7['params']['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x356611,null))['then'](function(_0x3b0374){if(_0x3b0374){_0x1e7d95=_0x3b0374;_0x306c8c['model']=_['keys'](db[_0x8ff7('0x6e')][_0x8ff7('0x35')]);_0x306c8c['query']=_['keys'](_0x1367b7[_0x8ff7('0x3c')]);_0x306c8c['filters']=_['intersection'](_0x306c8c['model'],_0x306c8c[_0x8ff7('0x3c')]);_0x3e46de[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0x306c8c['model'],qs[_0x8ff7('0x40')](_0x1367b7[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x3e46de[_0x8ff7('0x3f')]=_0x3e46de[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x3e46de[_0x8ff7('0x3f')]:_0x306c8c[_0x8ff7('0x39')];_0x3e46de[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x1367b7[_0x8ff7('0x3c')]['sort']);_0x3e46de[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x1367b7[_0x8ff7('0x3c')],_0x306c8c[_0x8ff7('0x3d')]));_0x3e46de['where']=_[_0x8ff7('0x48')](_0x3e46de['where'],{'$or':[{'ListId':_0x3b0374['id']},{'ListId':null}]});if(_0x1367b7['query'][_0x8ff7('0x47')]){_0x3e46de['where']=_[_0x8ff7('0x48')](_0x3e46de[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x3e46de[_0x8ff7('0x3f')],function(_0x161ee1){var _0x312ae9={};_0x312ae9[_0x161ee1]={'$like':'%'+_0x1367b7['query'][_0x8ff7('0x47')]+'%'};return _0x312ae9;})});}_0x3e46de=_[_0x8ff7('0x48')]({},_0x3e46de,_0x1367b7[_0x8ff7('0x4a')]);return db[_0x8ff7('0x6e')][_0x8ff7('0x89')](_0x3e46de);}})[_0x8ff7('0x2a')](respondWithResult(_0x356611,null))[_0x8ff7('0x4e')](handleError(_0x356611,null));};exports[_0x8ff7('0x8a')]=function(_0x3ee15b,_0x1cb78c,_0x57b02e){return db['CmList']['find']({'where':{'id':_0x3ee15b[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x1cb78c,null))['then'](function(_0x56507a){if(_0x56507a){return _0x56507a[_0x8ff7('0x8a')](_0x3ee15b[_0x8ff7('0x53')][_0x8ff7('0x61')],_[_0x8ff7('0x8b')](_0x3ee15b['body'],[_0x8ff7('0x61'),'id'])||{})[_0x8ff7('0x8c')](function(_0x41f75e){for(var _0x4ff5e9=0x0;_0x4ff5e9<_0x3ee15b[_0x8ff7('0x53')][_0x8ff7('0x61')][_0x8ff7('0x50')];_0x4ff5e9+=0x1){socket['emit'](_0x8ff7('0x8d'),{'UserId':Number(_0x3ee15b[_0x8ff7('0x53')]['ids'][_0x4ff5e9]),'CmListId':Number(_0x3ee15b[_0x8ff7('0x4f')]['id'])});}return _0x41f75e;});}})['then'](respondWithResult(_0x1cb78c,null))[_0x8ff7('0x4e')](handleError(_0x1cb78c,null));};exports[_0x8ff7('0x8e')]=function(_0x2c6e4f,_0x5eab55,_0x4fa482){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x2c6e4f[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5eab55,null))['then'](function(_0x1fdfe5){if(_0x1fdfe5){return _0x1fdfe5['removeAgents'](_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')])[_0x8ff7('0x2a')](function(){if(_[_0x8ff7('0x64')](_0x2c6e4f['query']['ids'])){for(var _0x50e75e=0x0;_0x50e75e<_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')][_0x8ff7('0x50')];_0x50e75e+=0x1){socket[_0x8ff7('0x8f')](_0x8ff7('0x90'),{'UserId':Number(_0x2c6e4f['query'][_0x8ff7('0x61')][_0x50e75e]),'CmListId':Number(_0x2c6e4f['params']['id'])});}}else{socket[_0x8ff7('0x8f')]('userCmList:remove',{'UserId':Number(_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')]),'CmListId':Number(_0x2c6e4f[_0x8ff7('0x4f')]['id'])});}});}})[_0x8ff7('0x2a')](respondWithStatusCode(_0x5eab55,null))[_0x8ff7('0x4e')](handleError(_0x5eab55,null));};exports[_0x8ff7('0x91')]=function(_0x126272,_0x5ea570,_0x33db5b){var _0x2088a9={};var _0x18165e={};var _0x264131;var _0x4bcc64;return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x126272[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x5ea570,null))[_0x8ff7('0x2a')](function(_0x230972){if(_0x230972){_0x264131=_0x230972;_0x18165e['model']=_[_0x8ff7('0x3b')](db[_0x8ff7('0x92')][_0x8ff7('0x35')]);_0x18165e['query']=_[_0x8ff7('0x3b')](_0x126272['query']);_0x18165e[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x18165e[_0x8ff7('0x39')],_0x18165e[_0x8ff7('0x3c')]);_0x2088a9['attributes']=_[_0x8ff7('0x3e')](_0x18165e[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x2088a9['attributes']=_0x2088a9[_0x8ff7('0x3f')]['length']?_0x2088a9[_0x8ff7('0x3f')]:_0x18165e[_0x8ff7('0x39')];_0x2088a9[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x2088a9[_0x8ff7('0x45')]=qs['filters'](_[_0x8ff7('0x46')](_0x126272[_0x8ff7('0x3c')],_0x18165e[_0x8ff7('0x3d')]));if(_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x2088a9[_0x8ff7('0x45')]=_[_0x8ff7('0x48')](_0x2088a9[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x2088a9[_0x8ff7('0x3f')],function(_0x3aea18){var _0x264da0={};_0x264da0[_0x3aea18]={'$like':'%'+_0x126272['query'][_0x8ff7('0x47')]+'%'};return _0x264da0;})});}_0x2088a9=_[_0x8ff7('0x48')]({},_0x2088a9,_0x126272['options']);return _0x264131[_0x8ff7('0x91')](_0x2088a9);}})['then'](function(_0x56fedd){if(_0x56fedd){_0x4bcc64=_0x56fedd[_0x8ff7('0x50')];if(!_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x2088a9['limit']=qs['limit'](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x2088a9[_0x8ff7('0x24')]=qs['offset'](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}return _0x264131[_0x8ff7('0x91')](_0x2088a9);}})[_0x8ff7('0x2a')](function(_0x210509){if(_0x210509){return _0x210509?{'count':_0x4bcc64,'rows':_0x210509}:null;}})[_0x8ff7('0x2a')](respondWithResult(_0x5ea570,null))[_0x8ff7('0x4e')](handleError(_0x5ea570,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index dd1f4a4..91f72eb 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x55ca,0x126));var _0xa55c=function(_0x21c8a9,_0x5687f4){_0x21c8a9=_0x21c8a9-0x0;var _0x1f8a72=_0x55ca[_0x21c8a9];return _0x1f8a72;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x55ca,0x126));var _0xa55c=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x55ca[_0x2b737c];return _0x466ed5;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 8ced1c9..4653669 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 _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x55e0,0xdc));var _0x055e=function(_0x50368e,_0x466c09){_0x50368e=_0x50368e-0x0;var _0x4a65cd=_0x55e0[_0x50368e];return _0x4a65cd;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x4c2a65,_0x274bc1){var _0x12e4e9=function(_0x5bcefb){while(--_0x5bcefb){_0x4c2a65['push'](_0x4c2a65['shift']());}};_0x12e4e9(++_0x274bc1);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1e6d1b,_0x15fee9){_0x1e6d1b=_0x1e6d1b-0x0;var _0x5c0b80=_0xee5b[_0x1e6d1b];return _0x5c0b80;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 5259a10..e0128f5 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 _0x1e74=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x3623af,_0x55f9b8){var _0x3b58ec=function(_0x1e74d1){while(--_0x1e74d1){_0x3623af['push'](_0x3623af['shift']());}};_0x3b58ec(++_0x55f9b8);}(_0x1e74,0x123));var _0x41e7=function(_0xb8e130,_0x58bedb){_0xb8e130=_0xb8e130-0x0;var _0x306dc3=_0x1e74[_0xb8e130];return _0x306dc3;};'use strict';var _=require(_0x41e7('0x0'));var util=require(_0x41e7('0x1'));var moment=require('moment');var BPromise=require(_0x41e7('0x2'));var rs=require(_0x41e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41e7('0x4'))['db'];var utils=require(_0x41e7('0x5'));var logger=require(_0x41e7('0x6'))(_0x41e7('0x7'));var config=require(_0x41e7('0x8'));var jayson=require(_0x41e7('0x9'));var client=jayson[_0x41e7('0xa')]['http']({'port':0x232a});config[_0x41e7('0xb')]=_[_0x41e7('0xc')](config['redis'],{'host':_0x41e7('0xd'),'port':0x18eb});var socket=require(_0x41e7('0xe'))(new Redis(config[_0x41e7('0xb')]));require(_0x41e7('0xf'))[_0x41e7('0x10')](socket);function respondWithRpcPromise(_0x4aef92,_0x2f8f3a,_0x2d4df3){return new BPromise(function(_0x55ce54,_0x38639f){return client[_0x41e7('0x11')](_0x4aef92,_0x2d4df3)['then'](function(_0x1e1f47){logger[_0x41e7('0x12')](_0x41e7('0x13'),_0x2f8f3a,_0x41e7('0x14'));logger[_0x41e7('0x15')](_0x41e7('0x16'),_0x2f8f3a,_0x41e7('0x14'),JSON[_0x41e7('0x17')](_0x1e1f47));if(_0x1e1f47['error']){if(_0x1e1f47['error'][_0x41e7('0x18')]===0x1f4){logger[_0x41e7('0x19')]('CmList,\x20%s,\x20%s',_0x2f8f3a,_0x1e1f47[_0x41e7('0x19')][_0x41e7('0x1a')]);return _0x38639f(_0x1e1f47[_0x41e7('0x19')][_0x41e7('0x1a')]);}logger[_0x41e7('0x19')](_0x41e7('0x13'),_0x2f8f3a,_0x1e1f47[_0x41e7('0x19')]['message']);return _0x55ce54(_0x1e1f47[_0x41e7('0x19')][_0x41e7('0x1a')]);}else{logger[_0x41e7('0x12')](_0x41e7('0x13'),_0x2f8f3a,_0x41e7('0x14'));_0x55ce54(_0x1e1f47[_0x41e7('0x1b')][_0x41e7('0x1a')]);}})[_0x41e7('0x1c')](function(_0x2fa70e){logger['error'](_0x41e7('0x13'),_0x2f8f3a,_0x2fa70e);_0x38639f(_0x2fa70e);});});} \ No newline at end of file +var _0xfdec=['defaults','localhost','./cmList.socket','register','request','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1d0b84,_0x4a6a70){var _0x6726f0=function(_0x3decbb){while(--_0x3decbb){_0x1d0b84['push'](_0x1d0b84['shift']());}};_0x6726f0(++_0x4a6a70);}(_0xfdec,0x1d9));var _0xcfde=function(_0x51426b,_0x56069c){_0x51426b=_0x51426b-0x0;var _0xb53cc3=_0xfdec[_0x51426b];return _0xb53cc3;};'use strict';var _=require(_0xcfde('0x0'));var util=require(_0xcfde('0x1'));var moment=require(_0xcfde('0x2'));var BPromise=require(_0xcfde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfde('0x5'));var logger=require(_0xcfde('0x6'))(_0xcfde('0x7'));var config=require(_0xcfde('0x8'));var jayson=require(_0xcfde('0x9'));var client=jayson[_0xcfde('0xa')][_0xcfde('0xb')]({'port':0x232a});config[_0xcfde('0xc')]=_[_0xcfde('0xd')](config[_0xcfde('0xc')],{'host':_0xcfde('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfde('0xc')]));require(_0xcfde('0xf'))[_0xcfde('0x10')](socket);function respondWithRpcPromise(_0x4ca80f,_0x2e628c,_0x85060e){return new BPromise(function(_0x5b51b6,_0x5e5a61){return client[_0xcfde('0x11')](_0x4ca80f,_0x85060e)['then'](function(_0x17eeef){logger['info']('CmList,\x20%s,\x20%s',_0x2e628c,_0xcfde('0x12'));logger[_0xcfde('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x2e628c,'request\x20sent',JSON[_0xcfde('0x14')](_0x17eeef));if(_0x17eeef[_0xcfde('0x15')]){if(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x16')]===0x1f4){logger['error'](_0xcfde('0x17'),_0x2e628c,_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);return _0x5e5a61(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);}logger[_0xcfde('0x15')]('CmList,\x20%s,\x20%s',_0x2e628c,_0x17eeef[_0xcfde('0x15')]['message']);return _0x5b51b6(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);}else{logger[_0xcfde('0x19')]('CmList,\x20%s,\x20%s',_0x2e628c,'request\x20sent');_0x5b51b6(_0x17eeef[_0xcfde('0x1a')][_0xcfde('0x18')]);}})['catch'](function(_0x1f333f){logger[_0xcfde('0x15')](_0xcfde('0x17'),_0x2e628c,_0x1f333f);_0x5e5a61(_0x1f333f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d45258a..7a7883b 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 _0xfc89=['emit','removeListener','register','length','save','update'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0xfc89,0x1c6));var _0x9fc8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xfc89[_0x311c35];return _0x5cc50c;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x9fc8('0x0'),'remove',_0x9fc8('0x1')];function createListener(_0x335cd7,_0x33a380){return function(_0x4adbd1){_0x33a380[_0x9fc8('0x2')](_0x335cd7,_0x4adbd1);};}function removeListener(_0x1a6cf7,_0x2147a7){return function(){CmListEvents[_0x9fc8('0x3')](_0x1a6cf7,_0x2147a7);};}exports[_0x9fc8('0x4')]=function(_0x2c76f5){for(var _0x4562b0=0x0,_0x4c031e=events[_0x9fc8('0x5')];_0x4562b0<_0x4c031e;_0x4562b0++){var _0x2f3c2f=events[_0x4562b0];var _0x1d7553=createListener('cmList:'+_0x2f3c2f,_0x2c76f5);CmListEvents['on'](_0x2f3c2f,_0x1d7553);}}; \ No newline at end of file +var _0xe787=['update','emit','removeListener','register','length','./cmList.events','save','remove'];(function(_0x31b7ff,_0x4d3503){var _0x33ba84=function(_0x1e90b7){while(--_0x1e90b7){_0x31b7ff['push'](_0x31b7ff['shift']());}};_0x33ba84(++_0x4d3503);}(_0xe787,0x14d));var _0x7e78=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xe787[_0x313c96];return _0x522f53;};'use strict';var CmListEvents=require(_0x7e78('0x0'));var events=[_0x7e78('0x1'),_0x7e78('0x2'),_0x7e78('0x3')];function createListener(_0x231fb8,_0x483cb1){return function(_0x539969){_0x483cb1[_0x7e78('0x4')](_0x231fb8,_0x539969);};}function removeListener(_0x13b85d,_0x1b3e68){return function(){CmListEvents[_0x7e78('0x5')](_0x13b85d,_0x1b3e68);};}exports[_0x7e78('0x6')]=function(_0x9f6c9c){for(var _0x2b0934=0x0,_0x4721e0=events[_0x7e78('0x7')];_0x2b0934<_0x4721e0;_0x2b0934++){var _0x119b3e=events[_0x2b0934];var _0xd8b08b=createListener('cmList:'+_0x119b3e,_0x9f6c9c);CmListEvents['on'](_0x119b3e,_0xd8b08b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 782b35d..486d7ed 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 _0x745b=['show','/:id/dispositions','getDispositions','/:id/contacts','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x909abb,_0x49bef3){var _0x421e71=function(_0x4d445c){while(--_0x4d445c){_0x909abb['push'](_0x909abb['shift']());}};_0x421e71(++_0x49bef3);}(_0x745b,0x87));var _0xb745=function(_0x29a63e,_0x553998){_0x29a63e=_0x29a63e-0x0;var _0x399e42=_0x745b[_0x29a63e];return _0x399e42;};'use strict';var multer=require(_0xb745('0x0'));var util=require(_0xb745('0x1'));var path=require(_0xb745('0x2'));var timeout=require(_0xb745('0x3'));var express=require(_0xb745('0x4'));var router=express[_0xb745('0x5')]();var fs_extra=require(_0xb745('0x6'));var auth=require(_0xb745('0x7'));var interaction=require(_0xb745('0x8'));var config=require(_0xb745('0x9'));var controller=require(_0xb745('0xa'));router['get']('/',auth[_0xb745('0xb')](),controller[_0xb745('0xc')]);router['get'](_0xb745('0xd'),auth['isAuthenticated'](),controller[_0xb745('0xe')]);router[_0xb745('0xf')](_0xb745('0x10'),auth[_0xb745('0xb')](),controller[_0xb745('0x11')]);router['get'](_0xb745('0x12'),auth[_0xb745('0xb')](),controller[_0xb745('0x13')]);router['get'](_0xb745('0x14'),auth['isAuthenticated'](),controller['getContacts']);router[_0xb745('0xf')]('/:id/contacts/csv',auth[_0xb745('0xb')](),controller['getContactsCsv']);router[_0xb745('0xf')](_0xb745('0x15'),auth['isAuthenticated'](),controller[_0xb745('0x16')]);router[_0xb745('0xf')](_0xb745('0x17'),auth['isAuthenticated'](),controller[_0xb745('0x18')]);router[_0xb745('0x19')]('/',auth[_0xb745('0xb')](),controller[_0xb745('0x1a')]);router[_0xb745('0x19')]('/:id/dispositions',auth[_0xb745('0xb')](),controller[_0xb745('0x1b')]);router[_0xb745('0x19')](_0xb745('0x14'),auth[_0xb745('0xb')](),controller[_0xb745('0x1c')]);router[_0xb745('0x19')](_0xb745('0x15'),auth['isAuthenticated'](),controller[_0xb745('0x1d')]);router[_0xb745('0x19')](_0xb745('0x17'),auth[_0xb745('0xb')](),controller[_0xb745('0x1e')]);router[_0xb745('0x1f')](_0xb745('0x10'),auth[_0xb745('0xb')](),controller[_0xb745('0x20')]);router[_0xb745('0x21')](_0xb745('0x10'),auth[_0xb745('0xb')](),controller[_0xb745('0x22')]);router[_0xb745('0x21')](_0xb745('0x12'),auth['isAuthenticated'](),controller[_0xb745('0x23')]);router[_0xb745('0x21')](_0xb745('0x17'),auth['isAuthenticated'](),controller[_0xb745('0x24')]);module[_0xb745('0x25')]=router; \ No newline at end of file +var _0x8954=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','/:id/dispositions','addDisposition','post','addContacts','addAgents','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0x8954,0x136));var _0x4895=function(_0x1e4ee6,_0x1f24d2){_0x1e4ee6=_0x1e4ee6-0x0;var _0x33ced4=_0x8954[_0x1e4ee6];return _0x33ced4;};'use strict';var multer=require(_0x4895('0x0'));var util=require('util');var path=require(_0x4895('0x1'));var timeout=require(_0x4895('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4895('0x3'));var interaction=require(_0x4895('0x4'));var config=require(_0x4895('0x5'));var controller=require(_0x4895('0x6'));router[_0x4895('0x7')]('/',auth['isAuthenticated'](),controller[_0x4895('0x8')]);router[_0x4895('0x7')](_0x4895('0x9'),auth[_0x4895('0xa')](),controller[_0x4895('0xb')]);router['get'](_0x4895('0xc'),auth[_0x4895('0xa')](),controller[_0x4895('0xd')]);router[_0x4895('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x4895('0x7')](_0x4895('0xe'),auth[_0x4895('0xa')](),controller[_0x4895('0xf')]);router[_0x4895('0x7')](_0x4895('0x10'),auth[_0x4895('0xa')](),controller[_0x4895('0x11')]);router[_0x4895('0x7')](_0x4895('0x12'),auth[_0x4895('0xa')](),controller[_0x4895('0x13')]);router[_0x4895('0x7')](_0x4895('0x14'),auth[_0x4895('0xa')](),controller['getAgents']);router['post']('/',auth[_0x4895('0xa')](),controller['create']);router['post'](_0x4895('0x15'),auth[_0x4895('0xa')](),controller[_0x4895('0x16')]);router[_0x4895('0x17')](_0x4895('0xe'),auth[_0x4895('0xa')](),controller[_0x4895('0x18')]);router[_0x4895('0x17')](_0x4895('0x12'),auth[_0x4895('0xa')](),controller['addCustomField']);router[_0x4895('0x17')](_0x4895('0x14'),auth[_0x4895('0xa')](),controller[_0x4895('0x19')]);router['put'](_0x4895('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4895('0x1a')](_0x4895('0xc'),auth[_0x4895('0xa')](),controller[_0x4895('0x1b')]);router[_0x4895('0x1a')](_0x4895('0x15'),auth['isAuthenticated'](),controller[_0x4895('0x1c')]);router[_0x4895('0x1a')]('/:id/users',auth[_0x4895('0xa')](),controller[_0x4895('0x1d')]);module[_0x4895('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 6813b6f..1ef40b2 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 _0xea16=['field','STRING','sequelize','exports','getDataValue'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0xea16,0x101));var _0x6ea1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xea16[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x6ea1('0x0'));module[_0x6ea1('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xfa0c27){return this[_0x6ea1('0x2')](_0x6ea1('0x3'));}},'field':{'type':Sequelize[_0x6ea1('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6ea1('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x6ea1('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x35f5=['getDataValue','STRING','sequelize','exports','VIRTUAL'];(function(_0x46ee96,_0x3c8c1f){var _0x37208e=function(_0x581805){while(--_0x581805){_0x46ee96['push'](_0x46ee96['shift']());}};_0x37208e(++_0x3c8c1f);}(_0x35f5,0x151));var _0x535f=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x35f5[_0x46111d];return _0xe82586;};'use strict';var Sequelize=require(_0x535f('0x0'));module[_0x535f('0x1')]={'name':{'type':Sequelize[_0x535f('0x2')],'get':function(_0xcae05e){return this[_0x535f('0x3')]('field');}},'field':{'type':Sequelize[_0x535f('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x535f('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 9cfecf6..b270676 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xcfe87a,_0x3d7f0d){var _0x878dec=function(_0x32726b){while(--_0x32726b){_0xcfe87a['push'](_0xcfe87a['shift']());}};_0x878dec(++_0x3d7f0d);}(_0x7a54,0x106));var _0x47a5=function(_0x3c66ce,_0x58e771){_0x3c66ce=_0x3c66ce-0x0;var _0x5cda85=_0x7a54[_0x3c66ce];return _0x5cda85;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xe60359,_0x294a2f){var _0x355a74=function(_0x22fca7){while(--_0x22fca7){_0xe60359['push'](_0xe60359['shift']());}};_0x355a74(++_0x294a2f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 2367771..cfab45f 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 _0x02fe=['../../config/logger','api','bluebird','rimraf','./condition.attributes','define','tools_conditions','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x02fe,0x15d));var _0xe02f=function(_0x4fcdfe,_0x42037b){_0x4fcdfe=_0x4fcdfe-0x0;var _0x9f577d=_0x02fe[_0x4fcdfe];return _0x9f577d;};'use strict';var _=require(_0xe02f('0x0'));var util=require(_0xe02f('0x1'));var logger=require(_0xe02f('0x2'))(_0xe02f('0x3'));var moment=require('moment');var BPromise=require(_0xe02f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe02f('0x5'));var config=require('../../config/environment');var attributes=require(_0xe02f('0x6'));module['exports']=function(_0x4bbe96,_0x7e2a68){return _0x4bbe96[_0xe02f('0x7')]('Condition',attributes,{'tableName':_0xe02f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0cc=['./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22cb49,_0x417f2c){var _0x3ccbfe=function(_0x1009b0){while(--_0x1009b0){_0x22cb49['push'](_0x22cb49['shift']());}};_0x3ccbfe(++_0x417f2c);}(_0xf0cc,0x1d8));var _0xcf0c=function(_0x310106,_0x341531){_0x310106=_0x310106-0x0;var _0x4df22d=_0xf0cc[_0x310106];return _0x4df22d;};'use strict';var _=require(_0xcf0c('0x0'));var util=require(_0xcf0c('0x1'));var logger=require(_0xcf0c('0x2'))(_0xcf0c('0x3'));var moment=require(_0xcf0c('0x4'));var BPromise=require(_0xcf0c('0x5'));var rp=require(_0xcf0c('0x6'));var fs=require('fs');var path=require(_0xcf0c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x8'));module[_0xcf0c('0x9')]=function(_0x5c379f,_0x343e47){return _0x5c379f[_0xcf0c('0xa')]('Condition',attributes,{'tableName':_0xcf0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 13c258e..8f356be 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 _0x6245=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','code','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6245,0x8f));var _0x5624=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x6245[_0x10e840];return _0x405caa;};'use strict';var _=require(_0x5624('0x0'));var util=require(_0x5624('0x1'));var moment=require(_0x5624('0x2'));var BPromise=require('bluebird');var rs=require(_0x5624('0x3'));var fs=require('fs');var Redis=require(_0x5624('0x4'));var db=require(_0x5624('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5624('0x6'))(_0x5624('0x7'));var config=require(_0x5624('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5624('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f67f,_0x1de6e7,_0x2a1634){return new BPromise(function(_0x4ebdfd,_0x22b1e9){return client[_0x5624('0xa')](_0x7f67f,_0x2a1634)[_0x5624('0xb')](function(_0x25cf14){logger[_0x5624('0xc')]('Condition,\x20%s,\x20%s',_0x1de6e7,'request\x20sent');logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x1de6e7,_0x5624('0xd'),JSON[_0x5624('0xe')](_0x25cf14));if(_0x25cf14['error']){if(_0x25cf14['error'][_0x5624('0xf')]===0x1f4){logger[_0x5624('0x10')](_0x5624('0x11'),_0x1de6e7,_0x25cf14[_0x5624('0x10')]['message']);return _0x22b1e9(_0x25cf14[_0x5624('0x10')][_0x5624('0x12')]);}logger['error'](_0x5624('0x11'),_0x1de6e7,_0x25cf14[_0x5624('0x10')][_0x5624('0x12')]);return _0x4ebdfd(_0x25cf14[_0x5624('0x10')][_0x5624('0x12')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x1de6e7,_0x5624('0xd'));_0x4ebdfd(_0x25cf14[_0x5624('0x13')][_0x5624('0x12')]);}})[_0x5624('0x14')](function(_0x2bd06d){logger[_0x5624('0x10')](_0x5624('0x11'),_0x1de6e7,_0x2bd06d);_0x22b1e9(_0x2bd06d);});});} \ No newline at end of file +var _0xbacb=['info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x466f4b,_0x2896f0){var _0x3d4c24=function(_0xcae225){while(--_0xcae225){_0x466f4b['push'](_0x466f4b['shift']());}};_0x3d4c24(++_0x2896f0);}(_0xbacb,0x13e));var _0xbbac=function(_0x546c65,_0xe39998){_0x546c65=_0x546c65-0x0;var _0x50221a=_0xbacb[_0x546c65];return _0x50221a;};'use strict';var _=require(_0xbbac('0x0'));var util=require(_0xbbac('0x1'));var moment=require(_0xbbac('0x2'));var BPromise=require(_0xbbac('0x3'));var rs=require(_0xbbac('0x4'));var fs=require('fs');var Redis=require(_0xbbac('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbac('0x6'))(_0xbbac('0x7'));var config=require(_0xbbac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbbac('0x9')][_0xbbac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29a956,_0x1e0ba6,_0x14c015){return new BPromise(function(_0xc761ac,_0x58df80){return client[_0xbbac('0xb')](_0x29a956,_0x14c015)['then'](function(_0x2c9cdf){logger[_0xbbac('0xc')](_0xbbac('0xd'),_0x1e0ba6,_0xbbac('0xe'));logger[_0xbbac('0xf')](_0xbbac('0x10'),_0x1e0ba6,_0xbbac('0xe'),JSON['stringify'](_0x2c9cdf));if(_0x2c9cdf[_0xbbac('0x11')]){if(_0x2c9cdf[_0xbbac('0x11')][_0xbbac('0x12')]===0x1f4){logger[_0xbbac('0x11')](_0xbbac('0xd'),_0x1e0ba6,_0x2c9cdf[_0xbbac('0x11')]['message']);return _0x58df80(_0x2c9cdf['error'][_0xbbac('0x13')]);}logger[_0xbbac('0x11')]('Condition,\x20%s,\x20%s',_0x1e0ba6,_0x2c9cdf[_0xbbac('0x11')][_0xbbac('0x13')]);return _0xc761ac(_0x2c9cdf[_0xbbac('0x11')]['message']);}else{logger['info'](_0xbbac('0xd'),_0x1e0ba6,_0xbbac('0xe'));_0xc761ac(_0x2c9cdf[_0xbbac('0x14')][_0xbbac('0x13')]);}})[_0xbbac('0x15')](function(_0x3ad584){logger[_0xbbac('0x11')](_0xbbac('0xd'),_0x1e0ba6,_0x3ad584);_0x58df80(_0x3ad584);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d785675..b8fc814 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 _0x3d36=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','destroy'];(function(_0x252f9b,_0x29f7fb){var _0x9a30bb=function(_0x4e7dec){while(--_0x4e7dec){_0x252f9b['push'](_0x252f9b['shift']());}};_0x9a30bb(++_0x29f7fb);}(_0x3d36,0x139));var _0x63d3=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x3d36[_0x56ba92];return _0x8fe94d;};'use strict';var multer=require('multer');var util=require(_0x63d3('0x0'));var path=require(_0x63d3('0x1'));var timeout=require(_0x63d3('0x2'));var express=require('express');var router=express[_0x63d3('0x3')]();var fs_extra=require(_0x63d3('0x4'));var auth=require(_0x63d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x63d3('0x6'));var controller=require(_0x63d3('0x7'));router['put'](_0x63d3('0x8'),auth[_0x63d3('0x9')](),controller['update']);router['delete'](_0x63d3('0x8'),auth[_0x63d3('0x9')](),controller[_0x63d3('0xa')]);module[_0x63d3('0xb')]=router; \ No newline at end of file +var _0x60ad=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3aca0c,_0xc2fcd9){var _0x5ef72a=function(_0x43f9b3){while(--_0x43f9b3){_0x3aca0c['push'](_0x3aca0c['shift']());}};_0x5ef72a(++_0xc2fcd9);}(_0x60ad,0xb6));var _0xd60a=function(_0x4702e3,_0xec65){_0x4702e3=_0x4702e3-0x0;var _0x3c63a9=_0x60ad[_0x4702e3];return _0x3c63a9;};'use strict';var multer=require(_0xd60a('0x0'));var util=require(_0xd60a('0x1'));var path=require(_0xd60a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd60a('0x3'));var router=express[_0xd60a('0x4')]();var fs_extra=require(_0xd60a('0x5'));var auth=require(_0xd60a('0x6'));var interaction=require(_0xd60a('0x7'));var config=require(_0xd60a('0x8'));var controller=require(_0xd60a('0x9'));router[_0xd60a('0xa')](_0xd60a('0xb'),auth[_0xd60a('0xc')](),controller[_0xd60a('0xd')]);router[_0xd60a('0xe')](_0xd60a('0xb'),auth['isAuthenticated'](),controller[_0xd60a('0xf')]);module[_0xd60a('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9034d81..5c52d69 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 _0xbaf0=['name','exports','STRING'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x33f099,_0x252078){var _0x39c72b=function(_0x5bb65d){while(--_0x5bb65d){_0x33f099['push'](_0x33f099['shift']());}};_0x39c72b(++_0x252078);}(_0x757a,0xde));var _0xa757=function(_0x1a9b3f,_0x3817da){_0x1a9b3f=_0x1a9b3f-0x0;var _0x20a3db=_0x757a[_0x1a9b3f];return _0x20a3db;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 284a69a..8d6d653 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 _0x9bcb=['attrReport','attrRefresh','widgetAttributes:\x20%s','getItems','findOne','DashboardItem','order','pick','nolimit','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','options','Dashboard','includeAll','include','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','CustomDashboards','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report'];(function(_0x45739a,_0x113c3d){var _0x4a3717=function(_0x9b978){while(--_0x9b978){_0x45739a['push'](_0x45739a['shift']());}};_0x4a3717(++_0x113c3d);}(_0x9bcb,0x1d9));var _0xb9bc=function(_0xe74d2d,_0x357f97){_0xe74d2d=_0xe74d2d-0x0;var _0x5503e8=_0x9bcb[_0xe74d2d];return _0x5503e8;};'use strict';var emlformat=require(_0xb9bc('0x0'));var rimraf=require(_0xb9bc('0x1'));var zipdir=require(_0xb9bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9bc('0x3'));var moment=require('moment');var BPromise=require(_0xb9bc('0x4'));var Mustache=require(_0xb9bc('0x5'));var util=require(_0xb9bc('0x6'));var path=require('path');var sox=require(_0xb9bc('0x7'));var csv=require(_0xb9bc('0x8'));var ejs=require(_0xb9bc('0x9'));var fs=require('fs');var fs_extra=require(_0xb9bc('0xa'));var _=require('lodash');var squel=require(_0xb9bc('0xb'));var crypto=require(_0xb9bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9bc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9bc('0xe'));var Papa=require('papaparse');var Redis=require(_0xb9bc('0xf'));var authService=require(_0xb9bc('0x10'));var qs=require(_0xb9bc('0x11'));var as=require(_0xb9bc('0x12'));var hardwareService=require(_0xb9bc('0x13'));var logger=require(_0xb9bc('0x14'))(_0xb9bc('0x15'));var utils=require(_0xb9bc('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9bc('0x17'))['db'];config['redis']=_[_0xb9bc('0x18')](config[_0xb9bc('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9bc('0x1a'))(new Redis(config[_0xb9bc('0x19')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0xa8aaa3,_0x4ca3be){_0x4ca3be=_0x4ca3be||0xcc;return function(_0xf14252){if(_0xf14252){return _0xa8aaa3[_0xb9bc('0x1b')](_0x4ca3be);}return _0xa8aaa3['status'](_0x4ca3be)[_0xb9bc('0x1c')]();};}function respondWithResult(_0x44d5d2,_0x43a927){_0x43a927=_0x43a927||0xc8;return function(_0x425b1d){if(_0x425b1d){return _0x44d5d2['status'](_0x43a927)[_0xb9bc('0x1d')](_0x425b1d);}};}function respondWithFilteredResult(_0x1e8ee4,_0x494b38){return function(_0x520a08){if(_0x520a08){var _0x33550d=typeof _0x494b38[_0xb9bc('0x1e')]===_0xb9bc('0x1f')&&typeof _0x494b38[_0xb9bc('0x20')]==='undefined';var _0x3a589a=_0x520a08[_0xb9bc('0x21')];var _0x59536b=_0x33550d?0x0:_0x494b38[_0xb9bc('0x1e')];var _0x4b4ef6=_0x33550d?_0x520a08['count']:_0x494b38[_0xb9bc('0x1e')]+_0x494b38[_0xb9bc('0x20')];var _0x273e22;if(_0x4b4ef6>=_0x3a589a){_0x4b4ef6=_0x3a589a;_0x273e22=0xc8;}else{_0x273e22=0xce;}_0x1e8ee4[_0xb9bc('0x22')](_0x273e22);return _0x1e8ee4[_0xb9bc('0x23')](_0xb9bc('0x24'),_0x59536b+'-'+_0x4b4ef6+'/'+_0x3a589a)[_0xb9bc('0x1d')](_0x520a08);}return null;};}function patchUpdates(_0x24676c){return function(_0x101b54){try{jsonpatch[_0xb9bc('0x25')](_0x101b54,_0x24676c,!![]);}catch(_0x521af4){return BPromise[_0xb9bc('0x26')](_0x521af4);}return _0x101b54[_0xb9bc('0x27')]();};}function saveUpdates(_0x4d718f,_0x80043b){return function(_0x53a4d9){if(_0x53a4d9){return _0x53a4d9[_0xb9bc('0x28')](_0x4d718f)['then'](function(_0x464eff){return _0x464eff;});}return null;};}function removeEntity(_0x539f79,_0x2851e4){return function(_0xb0ef0d){if(_0xb0ef0d){return _0xb0ef0d[_0xb9bc('0x29')]()[_0xb9bc('0x2a')](function(){var _0x1a111c=_0xb0ef0d[_0xb9bc('0x2b')]({'plain':!![]});var _0x3a71c3='CustomDashboards';return db[_0xb9bc('0x2c')]['destroy']({'where':{'type':_0x3a71c3,'resourceId':_0x1a111c['id']}})[_0xb9bc('0x2a')](function(){return _0xb0ef0d;});})[_0xb9bc('0x2a')](function(){_0x539f79['status'](0xcc)[_0xb9bc('0x1c')]();});}};}function handleEntityNotFound(_0x520f3f,_0x531035){return function(_0x11a6bf){if(!_0x11a6bf){_0x520f3f['sendStatus'](0x194);}return _0x11a6bf;};}function handleError(_0x21260e,_0x3c23f8){_0x3c23f8=_0x3c23f8||0x1f4;return function(_0x52612f){logger[_0xb9bc('0x2d')](_0x52612f[_0xb9bc('0x2e')]);if(_0x52612f[_0xb9bc('0x2f')]){delete _0x52612f['name'];}_0x21260e[_0xb9bc('0x22')](_0x3c23f8)['send'](_0x52612f);};}exports['index']=function(_0x2dec02,_0x4ef8c9){var _0x4feb07={},_0x323070={},_0x40ecae={'count':0x0,'rows':[]};var _0xf2ebe7=_['map'](db['Dashboard'][_0xb9bc('0x30')],function(_0xa5dc4){return{'name':_0xa5dc4[_0xb9bc('0x31')],'type':_0xa5dc4[_0xb9bc('0x32')][_0xb9bc('0x33')]};});_0x323070['model']=_['map'](_0xf2ebe7,'name');_0x323070[_0xb9bc('0x34')]=_['keys'](_0x2dec02[_0xb9bc('0x34')]);_0x323070[_0xb9bc('0x35')]=_[_0xb9bc('0x36')](_0x323070[_0xb9bc('0x37')],_0x323070[_0xb9bc('0x34')]);_0x4feb07[_0xb9bc('0x38')]=_[_0xb9bc('0x36')](_0x323070[_0xb9bc('0x37')],qs['fields'](_0x2dec02[_0xb9bc('0x34')][_0xb9bc('0x39')]));_0x4feb07[_0xb9bc('0x38')]=_0x4feb07[_0xb9bc('0x38')][_0xb9bc('0x3a')]?_0x4feb07[_0xb9bc('0x38')]:_0x323070[_0xb9bc('0x37')];if(!_0x2dec02[_0xb9bc('0x34')][_0xb9bc('0x3b')]('nolimit')){_0x4feb07['limit']=qs[_0xb9bc('0x20')](_0x2dec02[_0xb9bc('0x34')][_0xb9bc('0x20')]);_0x4feb07[_0xb9bc('0x1e')]=qs[_0xb9bc('0x1e')](_0x2dec02[_0xb9bc('0x34')]['offset']);}_0x4feb07['order']=qs[_0xb9bc('0x3c')](_0x2dec02[_0xb9bc('0x34')]['sort']);_0x4feb07[_0xb9bc('0x3d')]=qs[_0xb9bc('0x35')](_['pick'](_0x2dec02[_0xb9bc('0x34')],_0x323070[_0xb9bc('0x35')]),_0xf2ebe7);if(_0x2dec02['query'][_0xb9bc('0x3e')]){_0x4feb07[_0xb9bc('0x3d')]=_[_0xb9bc('0x3f')](_0x4feb07['where'],{'$or':_[_0xb9bc('0x40')](_0xf2ebe7,function(_0x1687d7){if(_0x1687d7['type']!==_0xb9bc('0x41')){var _0x17b0b2={};_0x17b0b2[_0x1687d7['name']]={'$like':'%'+_0x2dec02[_0xb9bc('0x34')][_0xb9bc('0x3e')]+'%'};return _0x17b0b2;}})});}_0x4feb07=_['merge']({},_0x4feb07,_0x2dec02[_0xb9bc('0x42')]);var _0x35cbb6={'where':_0x4feb07['where']};return db[_0xb9bc('0x43')][_0xb9bc('0x21')](_0x35cbb6)[_0xb9bc('0x2a')](function(_0x44a58a){_0x40ecae[_0xb9bc('0x21')]=_0x44a58a;if(_0x2dec02[_0xb9bc('0x34')][_0xb9bc('0x44')]){_0x4feb07[_0xb9bc('0x45')]=[{'all':!![]}];}return db[_0xb9bc('0x43')]['findAll'](_0x4feb07);})[_0xb9bc('0x2a')](function(_0x3dc1e5){_0x40ecae[_0xb9bc('0x46')]=_0x3dc1e5;return _0x40ecae;})[_0xb9bc('0x2a')](respondWithFilteredResult(_0x4ef8c9,_0x4feb07))[_0xb9bc('0x47')](handleError(_0x4ef8c9,null));};exports['show']=function(_0x258a81,_0x20546b){var _0x31ff26={'raw':![],'where':{'id':_0x258a81[_0xb9bc('0x48')]['id']}},_0x435ae5={};_0x435ae5[_0xb9bc('0x37')]=_[_0xb9bc('0x49')](db[_0xb9bc('0x43')][_0xb9bc('0x30')]);_0x435ae5[_0xb9bc('0x34')]=_['keys'](_0x258a81[_0xb9bc('0x34')]);_0x435ae5[_0xb9bc('0x35')]=_[_0xb9bc('0x36')](_0x435ae5[_0xb9bc('0x37')],_0x435ae5[_0xb9bc('0x34')]);_0x31ff26[_0xb9bc('0x38')]=_[_0xb9bc('0x36')](_0x435ae5[_0xb9bc('0x37')],qs['fields'](_0x258a81[_0xb9bc('0x34')][_0xb9bc('0x39')]));_0x31ff26[_0xb9bc('0x38')]=_0x31ff26[_0xb9bc('0x38')][_0xb9bc('0x3a')]?_0x31ff26[_0xb9bc('0x38')]:_0x435ae5[_0xb9bc('0x37')];if(_0x258a81[_0xb9bc('0x34')][_0xb9bc('0x44')]){_0x31ff26[_0xb9bc('0x45')]=[{'all':!![]}];}_0x31ff26=_[_0xb9bc('0x3f')]({},_0x31ff26,_0x258a81[_0xb9bc('0x42')]);return db[_0xb9bc('0x43')]['find'](_0x31ff26)['then'](handleEntityNotFound(_0x20546b,null))['then'](respondWithResult(_0x20546b,null))[_0xb9bc('0x47')](handleError(_0x20546b,null));};exports[_0xb9bc('0x4a')]=function(_0x2b9582,_0x133d65){return db[_0xb9bc('0x43')][_0xb9bc('0x4a')](_0x2b9582[_0xb9bc('0x4b')],{})[_0xb9bc('0x2a')](function(_0xeabede){var _0x2cf9bb=_0x2b9582[_0xb9bc('0x4c')][_0xb9bc('0x2b')]({'plain':!![]});if(!_0x2cf9bb)throw new Error(_0xb9bc('0x4d'));if(_0x2cf9bb[_0xb9bc('0x4e')]===_0xb9bc('0x4c')){var _0x2f6d52=_0xeabede[_0xb9bc('0x2b')]({'plain':!![]});var _0x39c6bd='CustomDashboards';return db[_0xb9bc('0x4f')][_0xb9bc('0x50')]({'where':{'name':_0x39c6bd,'userProfileId':_0x2cf9bb[_0xb9bc('0x51')]},'raw':!![]})[_0xb9bc('0x2a')](function(_0x4edd02){if(_0x4edd02&&_0x4edd02[_0xb9bc('0x52')]===0x0){return db[_0xb9bc('0x2c')]['create']({'name':_0x2f6d52['name'],'resourceId':_0x2f6d52['id'],'type':_0x4edd02[_0xb9bc('0x2f')],'sectionId':_0x4edd02['id']},{})[_0xb9bc('0x2a')](function(){return _0xeabede;});}else{return _0xeabede;}})[_0xb9bc('0x47')](function(_0x313e70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x313e70);throw _0x313e70;});}return _0xeabede;})[_0xb9bc('0x2a')](respondWithResult(_0x133d65,0xc9))[_0xb9bc('0x47')](handleError(_0x133d65,null));};exports[_0xb9bc('0x53')]=function(_0x45c75e,_0x2ee629){var _0x1f353e={'where':{'id':_0x45c75e[_0xb9bc('0x48')]['id']}},_0x1d88f5={};_0x1d88f5[_0xb9bc('0x37')]=_[_0xb9bc('0x49')](db[_0xb9bc('0x43')][_0xb9bc('0x30')]);_0x1f353e[_0xb9bc('0x38')]=_['intersection'](_0x1d88f5[_0xb9bc('0x37')],qs[_0xb9bc('0x39')](_0x45c75e[_0xb9bc('0x34')][_0xb9bc('0x39')]));_0x1f353e[_0xb9bc('0x38')]=_0x1f353e['attributes'][_0xb9bc('0x3a')]?_0x1f353e['attributes']:_0x1d88f5[_0xb9bc('0x37')];if(_0x45c75e[_0xb9bc('0x34')][_0xb9bc('0x44')]){_0x1f353e[_0xb9bc('0x45')]=[{'all':!![]}];}_0x1f353e=_[_0xb9bc('0x3f')]({},_0x1f353e,_0x45c75e[_0xb9bc('0x42')]);return db[_0xb9bc('0x43')][_0xb9bc('0x50')](_0x1f353e)[_0xb9bc('0x2a')](handleEntityNotFound(_0x2ee629,null))[_0xb9bc('0x2a')](function(_0x879005){if(_0x879005){var _0xb16627=_0x879005['get']({'plain':!![]});_0xb16627=qs[_0xb9bc('0x54')](_0xb16627,['id','createdAt',_0xb9bc('0x55')]);_0x45c75e[_0xb9bc('0x4b')]=_[_0xb9bc('0x54')](_0x45c75e['body'],['id',_0xb9bc('0x56'),_0xb9bc('0x55')]);return db[_0xb9bc('0x43')][_0xb9bc('0x4a')](_[_0xb9bc('0x3f')](_0xb16627,_0x45c75e['body']),{'include':_0x45c75e[_0xb9bc('0x34')][_0xb9bc('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x26e069){var _0x51d24f=_0x45c75e['user']['get']({'plain':!![]});if(!_0x51d24f)throw new Error(_0xb9bc('0x4d'));if(_0x51d24f['role']==='user'){var _0x4c38ce=_0x26e069['get']({'plain':!![]});var _0x9ba25f=_0xb9bc('0x57');return db[_0xb9bc('0x4f')][_0xb9bc('0x50')]({'where':{'name':_0x9ba25f,'userProfileId':_0x51d24f[_0xb9bc('0x51')]},'raw':!![]})[_0xb9bc('0x2a')](function(_0x1df17d){if(_0x1df17d&&_0x1df17d[_0xb9bc('0x52')]===0x0){return db[_0xb9bc('0x2c')][_0xb9bc('0x4a')]({'name':_0x4c38ce[_0xb9bc('0x2f')],'resourceId':_0x4c38ce['id'],'type':_0x1df17d['name'],'sectionId':_0x1df17d['id']},{})[_0xb9bc('0x2a')](function(){return _0x26e069;});}else{return _0x26e069;}})[_0xb9bc('0x47')](function(_0x388f06){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x388f06);throw _0x388f06;});}return _0x26e069;});}})['then'](respondWithResult(_0x2ee629,0xc9))[_0xb9bc('0x47')](handleError(_0x2ee629,null));};exports['update']=function(_0x4a8295,_0xf4733a){if(_0x4a8295['body']['id']){delete _0x4a8295[_0xb9bc('0x4b')]['id'];}return db[_0xb9bc('0x43')]['find']({'where':{'id':_0x4a8295[_0xb9bc('0x48')]['id']}})[_0xb9bc('0x2a')](handleEntityNotFound(_0xf4733a,null))[_0xb9bc('0x2a')](saveUpdates(_0x4a8295[_0xb9bc('0x4b')],null))[_0xb9bc('0x2a')](respondWithResult(_0xf4733a,null))[_0xb9bc('0x47')](handleError(_0xf4733a,null));};exports[_0xb9bc('0x29')]=function(_0x33b1ce,_0x5c5289){return db[_0xb9bc('0x43')]['find']({'where':{'id':_0x33b1ce['params']['id']}})[_0xb9bc('0x2a')](handleEntityNotFound(_0x5c5289,null))['then'](removeEntity(_0x5c5289,null))[_0xb9bc('0x47')](handleError(_0x5c5289,null));};function widgetAttributes(_0x13a1b7){try{switch(_0x13a1b7[_0xb9bc('0x32')]){case _0xb9bc('0x58'):return[{'name':_0xb9bc('0x59'),'value':_0x13a1b7[_0xb9bc('0x59')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7['attrs'][0x0][_0xb9bc('0x5b')]:undefined)||'https://'}];case'custom':return[{'name':_0xb9bc('0x5c'),'value':_0x13a1b7[_0xb9bc('0x5c')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7['attrs'][0x0][_0xb9bc('0x5b')]:undefined)||''}];case _0xb9bc('0x5d'):return[{'name':_0xb9bc('0x5e'),'value':_0x13a1b7[_0xb9bc('0x5e')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7['attrs'][0x0]['value']:undefined)||_0xb9bc('0x5f')},{'name':'attrTimezone','value':_0x13a1b7[_0xb9bc('0x60')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x1]?_0x13a1b7[_0xb9bc('0x5a')][0x1][_0xb9bc('0x5b')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x13a1b7[_0xb9bc('0x61')]||(_0x13a1b7['attrs']&&_0x13a1b7[_0xb9bc('0x5a')][0x2]?_0x13a1b7['attrs'][0x2][_0xb9bc('0x5b')]:undefined)||0xc}];case _0xb9bc('0x62'):return[{'name':_0xb9bc('0x63'),'value':_0x13a1b7['attrMetric']||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7[_0xb9bc('0x5a')][0x0][_0xb9bc('0x5b')]:undefined)||_0xb9bc('0x64')},{'name':_0xb9bc('0x65'),'value':_0x13a1b7[_0xb9bc('0x65')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x1]?_0x13a1b7[_0xb9bc('0x5a')][0x1][_0xb9bc('0x5b')]:undefined)||[]},{'name':_0xb9bc('0x61'),'value':_0x13a1b7['attrFontSize']||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x2]?_0x13a1b7[_0xb9bc('0x5a')][0x2][_0xb9bc('0x5b')]:undefined)||0x14}];case _0xb9bc('0x66'):case'pie-chart':return[{'name':_0xb9bc('0x67'),'value':_0x13a1b7[_0xb9bc('0x67')]||(_0x13a1b7['attrs']&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7[_0xb9bc('0x5a')][0x0][_0xb9bc('0x5b')]:undefined)||'total'},{'name':_0xb9bc('0x68'),'value':_0x13a1b7['attrSerie2']||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x1]?_0x13a1b7[_0xb9bc('0x5a')][0x1][_0xb9bc('0x5b')]:undefined)||null},{'name':_0xb9bc('0x69'),'value':_0x13a1b7[_0xb9bc('0x69')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x2]?_0x13a1b7[_0xb9bc('0x5a')][0x2][_0xb9bc('0x5b')]:undefined)||null},{'name':_0xb9bc('0x65'),'value':_0x13a1b7[_0xb9bc('0x65')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7['attrs'][0x3]?_0x13a1b7[_0xb9bc('0x5a')][0x3][_0xb9bc('0x5b')]:undefined)||[]}];case _0xb9bc('0x6a'):return[{'name':_0xb9bc('0x6b'),'type':_0x13a1b7['reportType']||(_0x13a1b7['attrs']&&_0x13a1b7[_0xb9bc('0x5a')][0x0]?_0x13a1b7[_0xb9bc('0x5a')][0x0][_0xb9bc('0x32')]:undefined)||null,'value':_0x13a1b7['attrReport']||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7['attrs'][0x0]?_0x13a1b7[_0xb9bc('0x5a')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x13a1b7[_0xb9bc('0x6c')]||(_0x13a1b7[_0xb9bc('0x5a')]&&_0x13a1b7[_0xb9bc('0x5a')][0x1]?_0x13a1b7[_0xb9bc('0x5a')][0x1][_0xb9bc('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x3e9ca0){logger[_0xb9bc('0x2d')](_0xb9bc('0x6d'),JSON['stringify'](_0x3e9ca0));return[];}}exports['addItem']=function(_0x226b49,_0x53517f,_0x37258f){if(_0x226b49[_0xb9bc('0x4b')]['id']){delete _0x226b49[_0xb9bc('0x4b')]['id'];}return db[_0xb9bc('0x43')]['find']({'where':{'id':_0x226b49[_0xb9bc('0x48')]['id']}})[_0xb9bc('0x2a')](handleEntityNotFound(_0x53517f,null))[_0xb9bc('0x2a')](function(_0x18b944){if(_0x18b944){_0x226b49[_0xb9bc('0x4b')]['DashboardId']=_0x18b944['id'];_0x226b49['body'][_0xb9bc('0x5a')]=widgetAttributes(_0x226b49[_0xb9bc('0x4b')]);return db['DashboardItem'][_0xb9bc('0x4a')](_0x226b49[_0xb9bc('0x4b')]);}})[_0xb9bc('0x2a')](respondWithResult(_0x53517f,null))[_0xb9bc('0x47')](handleError(_0x53517f,null));};exports[_0xb9bc('0x6e')]=function(_0x16d7bc,_0xfb3c48,_0x2c9820){var _0x426d9a={};var _0x1f9b2a={};var _0x40ab77;var _0x36de68;return db['Dashboard'][_0xb9bc('0x6f')]({'where':{'id':_0x16d7bc[_0xb9bc('0x48')]['id']}})['then'](handleEntityNotFound(_0xfb3c48,null))[_0xb9bc('0x2a')](function(_0x4303f6){if(_0x4303f6){_0x40ab77=_0x4303f6;_0x1f9b2a[_0xb9bc('0x37')]=_[_0xb9bc('0x49')](db[_0xb9bc('0x70')]['rawAttributes']);_0x1f9b2a[_0xb9bc('0x34')]=_[_0xb9bc('0x49')](_0x16d7bc['query']);_0x1f9b2a['filters']=_[_0xb9bc('0x36')](_0x1f9b2a[_0xb9bc('0x37')],_0x1f9b2a['query']);_0x426d9a[_0xb9bc('0x38')]=_['intersection'](_0x1f9b2a[_0xb9bc('0x37')],qs[_0xb9bc('0x39')](_0x16d7bc['query'][_0xb9bc('0x39')]));_0x426d9a[_0xb9bc('0x38')]=_0x426d9a[_0xb9bc('0x38')]['length']?_0x426d9a[_0xb9bc('0x38')]:_0x1f9b2a[_0xb9bc('0x37')];_0x426d9a[_0xb9bc('0x71')]=qs['sort'](_0x16d7bc[_0xb9bc('0x34')][_0xb9bc('0x3c')]);_0x426d9a[_0xb9bc('0x3d')]=qs[_0xb9bc('0x35')](_[_0xb9bc('0x72')](_0x16d7bc[_0xb9bc('0x34')],_0x1f9b2a[_0xb9bc('0x35')]));if(_0x16d7bc[_0xb9bc('0x34')][_0xb9bc('0x3e')]){_0x426d9a[_0xb9bc('0x3d')]=_[_0xb9bc('0x3f')](_0x426d9a['where'],{'$or':_['map'](_0x426d9a[_0xb9bc('0x38')],function(_0x1fc277){var _0x5ae00a={};_0x5ae00a[_0x1fc277]={'$like':'%'+_0x16d7bc['query'][_0xb9bc('0x3e')]+'%'};return _0x5ae00a;})});}_0x426d9a=_[_0xb9bc('0x3f')]({},_0x426d9a,_0x16d7bc[_0xb9bc('0x42')]);return _0x40ab77[_0xb9bc('0x6e')](_0x426d9a);}})[_0xb9bc('0x2a')](function(_0x1980d5){if(_0x1980d5){_0x36de68=_0x1980d5['length'];if(!_0x16d7bc[_0xb9bc('0x34')][_0xb9bc('0x3b')](_0xb9bc('0x73'))){_0x426d9a[_0xb9bc('0x20')]=qs[_0xb9bc('0x20')](_0x16d7bc[_0xb9bc('0x34')][_0xb9bc('0x20')]);_0x426d9a['offset']=qs[_0xb9bc('0x1e')](_0x16d7bc[_0xb9bc('0x34')][_0xb9bc('0x1e')]);}return _0x40ab77[_0xb9bc('0x6e')](_0x426d9a);}})['then'](function(_0x3942fb){if(_0x3942fb){return _0x3942fb?{'count':_0x36de68,'rows':_0x3942fb}:null;}})[_0xb9bc('0x2a')](respondWithResult(_0xfb3c48,null))[_0xb9bc('0x47')](handleError(_0xfb3c48,null));}; \ No newline at end of file +var _0xc034=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','Dashboard','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','length','hasOwnProperty'];(function(_0x28caa3,_0x4e7713){var _0x41b1c3=function(_0x52d1f3){while(--_0x52d1f3){_0x28caa3['push'](_0x28caa3['shift']());}};_0x41b1c3(++_0x4e7713);}(_0xc034,0xbc));var _0x4c03=function(_0x51232a,_0x3922d9){_0x51232a=_0x51232a-0x0;var _0x7046ba=_0xc034[_0x51232a];return _0x7046ba;};'use strict';var emlformat=require(_0x4c03('0x0'));var rimraf=require(_0x4c03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c03('0x2'));var rp=require(_0x4c03('0x3'));var moment=require(_0x4c03('0x4'));var BPromise=require(_0x4c03('0x5'));var Mustache=require('mustache');var util=require(_0x4c03('0x6'));var path=require(_0x4c03('0x7'));var sox=require(_0x4c03('0x8'));var csv=require(_0x4c03('0x9'));var ejs=require(_0x4c03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c03('0xb'));var squel=require(_0x4c03('0xc'));var crypto=require(_0x4c03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4c03('0xe'));var toCsv=require(_0x4c03('0x9'));var querystring=require(_0x4c03('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c03('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4c03('0x11'));var as=require(_0x4c03('0x12'));var hardwareService=require(_0x4c03('0x13'));var logger=require(_0x4c03('0x14'))('api');var utils=require(_0x4c03('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4c03('0x16'));var db=require(_0x4c03('0x17'))['db'];config['redis']=_[_0x4c03('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c03('0x19'))(new Redis(config[_0x4c03('0x1a')]));require(_0x4c03('0x1b'))[_0x4c03('0x1c')](socket);function respondWithStatusCode(_0x4b31cf,_0x7f4e17){_0x7f4e17=_0x7f4e17||0xcc;return function(_0xe75320){if(_0xe75320){return _0x4b31cf[_0x4c03('0x1d')](_0x7f4e17);}return _0x4b31cf[_0x4c03('0x1e')](_0x7f4e17)[_0x4c03('0x1f')]();};}function respondWithResult(_0x37494b,_0xb5aa37){_0xb5aa37=_0xb5aa37||0xc8;return function(_0x10fc82){if(_0x10fc82){return _0x37494b[_0x4c03('0x1e')](_0xb5aa37)[_0x4c03('0x20')](_0x10fc82);}};}function respondWithFilteredResult(_0x3fc4fc,_0x521e6a){return function(_0x300da4){if(_0x300da4){var _0x30fc45=typeof _0x521e6a[_0x4c03('0x21')]===_0x4c03('0x22')&&typeof _0x521e6a[_0x4c03('0x23')]===_0x4c03('0x22');var _0xaddb78=_0x300da4[_0x4c03('0x24')];var _0x121ba6=_0x30fc45?0x0:_0x521e6a[_0x4c03('0x21')];var _0x5da2f2=_0x30fc45?_0x300da4[_0x4c03('0x24')]:_0x521e6a[_0x4c03('0x21')]+_0x521e6a[_0x4c03('0x23')];var _0x36994c;if(_0x5da2f2>=_0xaddb78){_0x5da2f2=_0xaddb78;_0x36994c=0xc8;}else{_0x36994c=0xce;}_0x3fc4fc[_0x4c03('0x1e')](_0x36994c);return _0x3fc4fc[_0x4c03('0x25')](_0x4c03('0x26'),_0x121ba6+'-'+_0x5da2f2+'/'+_0xaddb78)['json'](_0x300da4);}return null;};}function patchUpdates(_0xc966e5){return function(_0x2ab0fe){try{jsonpatch[_0x4c03('0x27')](_0x2ab0fe,_0xc966e5,!![]);}catch(_0x2d3d1c){return BPromise[_0x4c03('0x28')](_0x2d3d1c);}return _0x2ab0fe[_0x4c03('0x29')]();};}function saveUpdates(_0x5d19fa,_0x581f0a){return function(_0x2ecd07){if(_0x2ecd07){return _0x2ecd07[_0x4c03('0x2a')](_0x5d19fa)[_0x4c03('0x2b')](function(_0x1b76f8){return _0x1b76f8;});}return null;};}function removeEntity(_0x2f6d86,_0x49a8f3){return function(_0x7ae861){if(_0x7ae861){return _0x7ae861[_0x4c03('0x2c')]()['then'](function(){var _0x6bbbfa=_0x7ae861[_0x4c03('0x2d')]({'plain':!![]});var _0x8df195='CustomDashboards';return db[_0x4c03('0x2e')]['destroy']({'where':{'type':_0x8df195,'resourceId':_0x6bbbfa['id']}})[_0x4c03('0x2b')](function(){return _0x7ae861;});})[_0x4c03('0x2b')](function(){_0x2f6d86[_0x4c03('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf53f,_0x511b1f){return function(_0x3e51ff){if(!_0x3e51ff){_0x5bf53f[_0x4c03('0x1d')](0x194);}return _0x3e51ff;};}function handleError(_0x44efa7,_0x23aaf5){_0x23aaf5=_0x23aaf5||0x1f4;return function(_0x2f2fc9){logger[_0x4c03('0x2f')](_0x2f2fc9[_0x4c03('0x30')]);if(_0x2f2fc9['name']){delete _0x2f2fc9['name'];}_0x44efa7[_0x4c03('0x1e')](_0x23aaf5)[_0x4c03('0x31')](_0x2f2fc9);};}exports[_0x4c03('0x32')]=function(_0x3b0e50,_0x37197e){var _0x16b3d3={},_0x530550={},_0x5a09dd={'count':0x0,'rows':[]};var _0x532265=_[_0x4c03('0x33')](db[_0x4c03('0x34')][_0x4c03('0x35')],function(_0x15079f){return{'name':_0x15079f[_0x4c03('0x36')],'type':_0x15079f[_0x4c03('0x37')][_0x4c03('0x38')]};});_0x530550['model']=_[_0x4c03('0x33')](_0x532265,_0x4c03('0x39'));_0x530550[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x3b0e50[_0x4c03('0x3a')]);_0x530550[_0x4c03('0x3c')]=_[_0x4c03('0x3d')](_0x530550[_0x4c03('0x3e')],_0x530550[_0x4c03('0x3a')]);_0x16b3d3[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x530550[_0x4c03('0x3e')],qs['fields'](_0x3b0e50['query']['fields']));_0x16b3d3['attributes']=_0x16b3d3[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x16b3d3[_0x4c03('0x3f')]:_0x530550[_0x4c03('0x3e')];if(!_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x41')](_0x4c03('0x42'))){_0x16b3d3['limit']=qs[_0x4c03('0x23')](_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x23')]);_0x16b3d3[_0x4c03('0x21')]=qs[_0x4c03('0x21')](_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x21')]);}_0x16b3d3[_0x4c03('0x43')]=qs[_0x4c03('0x44')](_0x3b0e50['query'][_0x4c03('0x44')]);_0x16b3d3[_0x4c03('0x45')]=qs['filters'](_[_0x4c03('0x46')](_0x3b0e50[_0x4c03('0x3a')],_0x530550[_0x4c03('0x3c')]),_0x532265);if(_0x3b0e50['query'][_0x4c03('0x47')]){_0x16b3d3[_0x4c03('0x45')]=_['merge'](_0x16b3d3['where'],{'$or':_[_0x4c03('0x33')](_0x532265,function(_0x31e0dc){if(_0x31e0dc['type']!==_0x4c03('0x48')){var _0x499127={};_0x499127[_0x31e0dc[_0x4c03('0x39')]]={'$like':'%'+_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x47')]+'%'};return _0x499127;}})});}_0x16b3d3=_[_0x4c03('0x49')]({},_0x16b3d3,_0x3b0e50[_0x4c03('0x4a')]);var _0x53e43a={'where':_0x16b3d3[_0x4c03('0x45')]};return db[_0x4c03('0x34')][_0x4c03('0x24')](_0x53e43a)[_0x4c03('0x2b')](function(_0x5c4b52){_0x5a09dd[_0x4c03('0x24')]=_0x5c4b52;if(_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x4b')]){_0x16b3d3[_0x4c03('0x4c')]=[{'all':!![]}];}return db['Dashboard'][_0x4c03('0x4d')](_0x16b3d3);})[_0x4c03('0x2b')](function(_0x29224){_0x5a09dd['rows']=_0x29224;return _0x5a09dd;})['then'](respondWithFilteredResult(_0x37197e,_0x16b3d3))[_0x4c03('0x4e')](handleError(_0x37197e,null));};exports[_0x4c03('0x4f')]=function(_0x4dd172,_0x4face6){var _0x2cd98a={'raw':![],'where':{'id':_0x4dd172[_0x4c03('0x50')]['id']}},_0x45b80e={};_0x45b80e[_0x4c03('0x3e')]=_[_0x4c03('0x3b')](db[_0x4c03('0x34')][_0x4c03('0x35')]);_0x45b80e[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x4dd172[_0x4c03('0x3a')]);_0x45b80e[_0x4c03('0x3c')]=_[_0x4c03('0x3d')](_0x45b80e[_0x4c03('0x3e')],_0x45b80e[_0x4c03('0x3a')]);_0x2cd98a[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x45b80e[_0x4c03('0x3e')],qs[_0x4c03('0x51')](_0x4dd172['query']['fields']));_0x2cd98a[_0x4c03('0x3f')]=_0x2cd98a['attributes'][_0x4c03('0x40')]?_0x2cd98a[_0x4c03('0x3f')]:_0x45b80e[_0x4c03('0x3e')];if(_0x4dd172['query'][_0x4c03('0x4b')]){_0x2cd98a[_0x4c03('0x4c')]=[{'all':!![]}];}_0x2cd98a=_[_0x4c03('0x49')]({},_0x2cd98a,_0x4dd172['options']);return db[_0x4c03('0x34')][_0x4c03('0x52')](_0x2cd98a)[_0x4c03('0x2b')](handleEntityNotFound(_0x4face6,null))[_0x4c03('0x2b')](respondWithResult(_0x4face6,null))[_0x4c03('0x4e')](handleError(_0x4face6,null));};exports[_0x4c03('0x53')]=function(_0x1dbd83,_0x5a29a2){return db['Dashboard'][_0x4c03('0x53')](_0x1dbd83['body'],{})[_0x4c03('0x2b')](function(_0x4ee78a){var _0x55684b=_0x1dbd83[_0x4c03('0x54')][_0x4c03('0x2d')]({'plain':!![]});if(!_0x55684b)throw new Error(_0x4c03('0x55'));if(_0x55684b[_0x4c03('0x56')]===_0x4c03('0x54')){var _0x3d982a=_0x4ee78a[_0x4c03('0x2d')]({'plain':!![]});var _0x3ed0c5=_0x4c03('0x57');return db[_0x4c03('0x58')][_0x4c03('0x52')]({'where':{'name':_0x3ed0c5,'userProfileId':_0x55684b['userProfileId']},'raw':!![]})[_0x4c03('0x2b')](function(_0x17cf1c){if(_0x17cf1c&&_0x17cf1c[_0x4c03('0x59')]===0x0){return db[_0x4c03('0x2e')][_0x4c03('0x53')]({'name':_0x3d982a[_0x4c03('0x39')],'resourceId':_0x3d982a['id'],'type':_0x17cf1c[_0x4c03('0x39')],'sectionId':_0x17cf1c['id']},{})[_0x4c03('0x2b')](function(){return _0x4ee78a;});}else{return _0x4ee78a;}})['catch'](function(_0x187917){logger[_0x4c03('0x2f')](_0x4c03('0x5a'),_0x187917);throw _0x187917;});}return _0x4ee78a;})['then'](respondWithResult(_0x5a29a2,0xc9))['catch'](handleError(_0x5a29a2,null));};exports[_0x4c03('0x5b')]=function(_0xfedb0f,_0x532642){var _0x4644fd={'where':{'id':_0xfedb0f[_0x4c03('0x50')]['id']}},_0x2d1e27={};_0x2d1e27[_0x4c03('0x3e')]=_[_0x4c03('0x3b')](db[_0x4c03('0x34')]['rawAttributes']);_0x4644fd['attributes']=_[_0x4c03('0x3d')](_0x2d1e27[_0x4c03('0x3e')],qs[_0x4c03('0x51')](_0xfedb0f['query'][_0x4c03('0x51')]));_0x4644fd[_0x4c03('0x3f')]=_0x4644fd[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x4644fd[_0x4c03('0x3f')]:_0x2d1e27['model'];if(_0xfedb0f[_0x4c03('0x3a')]['includeAll']){_0x4644fd['include']=[{'all':!![]}];}_0x4644fd=_[_0x4c03('0x49')]({},_0x4644fd,_0xfedb0f[_0x4c03('0x4a')]);return db[_0x4c03('0x34')][_0x4c03('0x52')](_0x4644fd)[_0x4c03('0x2b')](handleEntityNotFound(_0x532642,null))[_0x4c03('0x2b')](function(_0x3d8436){if(_0x3d8436){var _0x15318c=_0x3d8436[_0x4c03('0x2d')]({'plain':!![]});_0x15318c=qs[_0x4c03('0x5c')](_0x15318c,['id',_0x4c03('0x5d'),_0x4c03('0x5e')]);_0xfedb0f[_0x4c03('0x5f')]=_[_0x4c03('0x5c')](_0xfedb0f['body'],['id',_0x4c03('0x5d'),'updatedAt']);return db[_0x4c03('0x34')][_0x4c03('0x53')](_['merge'](_0x15318c,_0xfedb0f['body']),{'include':_0xfedb0f[_0x4c03('0x3a')][_0x4c03('0x4b')]?[{'all':!![]}]:undefined})[_0x4c03('0x2b')](function(_0x147779){var _0x5b2dd3=_0xfedb0f['user'][_0x4c03('0x2d')]({'plain':!![]});if(!_0x5b2dd3)throw new Error(_0x4c03('0x55'));if(_0x5b2dd3[_0x4c03('0x56')]===_0x4c03('0x54')){var _0x197bcb=_0x147779[_0x4c03('0x2d')]({'plain':!![]});var _0x2073de=_0x4c03('0x57');return db['UserProfileSection'][_0x4c03('0x52')]({'where':{'name':_0x2073de,'userProfileId':_0x5b2dd3[_0x4c03('0x60')]},'raw':!![]})['then'](function(_0x327e25){if(_0x327e25&&_0x327e25[_0x4c03('0x59')]===0x0){return db[_0x4c03('0x2e')][_0x4c03('0x53')]({'name':_0x197bcb[_0x4c03('0x39')],'resourceId':_0x197bcb['id'],'type':_0x327e25[_0x4c03('0x39')],'sectionId':_0x327e25['id']},{})[_0x4c03('0x2b')](function(){return _0x147779;});}else{return _0x147779;}})[_0x4c03('0x4e')](function(_0x56726b){logger[_0x4c03('0x2f')](_0x4c03('0x5a'),_0x56726b);throw _0x56726b;});}return _0x147779;});}})[_0x4c03('0x2b')](respondWithResult(_0x532642,0xc9))[_0x4c03('0x4e')](handleError(_0x532642,null));};exports[_0x4c03('0x2a')]=function(_0x1d1304,_0x1819ab){if(_0x1d1304[_0x4c03('0x5f')]['id']){delete _0x1d1304[_0x4c03('0x5f')]['id'];}return db[_0x4c03('0x34')][_0x4c03('0x52')]({'where':{'id':_0x1d1304[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x1819ab,null))[_0x4c03('0x2b')](saveUpdates(_0x1d1304[_0x4c03('0x5f')],null))[_0x4c03('0x2b')](respondWithResult(_0x1819ab,null))[_0x4c03('0x4e')](handleError(_0x1819ab,null));};exports[_0x4c03('0x2c')]=function(_0x5414e4,_0x130f1c){return db['Dashboard'][_0x4c03('0x52')]({'where':{'id':_0x5414e4[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x130f1c,null))['then'](removeEntity(_0x130f1c,null))['catch'](handleError(_0x130f1c,null));};function widgetAttributes(_0x5298d1){try{switch(_0x5298d1[_0x4c03('0x37')]){case _0x4c03('0x61'):return[{'name':_0x4c03('0x62'),'value':_0x5298d1[_0x4c03('0x62')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x0]?_0x5298d1['attrs'][0x0]['value']:undefined)||_0x4c03('0x64')}];case _0x4c03('0x65'):return[{'name':_0x4c03('0x66'),'value':_0x5298d1[_0x4c03('0x66')]||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||''}];case _0x4c03('0x68'):return[{'name':_0x4c03('0x69'),'value':_0x5298d1[_0x4c03('0x69')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6a')},{'name':_0x4c03('0x6b'),'value':_0x5298d1[_0x4c03('0x6b')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x1]?_0x5298d1['attrs'][0x1][_0x4c03('0x67')]:undefined)||'0.00'},{'name':_0x4c03('0x6c'),'value':_0x5298d1[_0x4c03('0x6c')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x2]?_0x5298d1[_0x4c03('0x63')][0x2]['value']:undefined)||0xc}];case _0x4c03('0x6d'):return[{'name':_0x4c03('0x6e'),'value':_0x5298d1[_0x4c03('0x6e')]||(_0x5298d1['attrs']&&_0x5298d1['attrs'][0x0]?_0x5298d1['attrs'][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6f')},{'name':'attrVoiceQueues','value':_0x5298d1['attrVoiceQueues']||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||[]},{'name':_0x4c03('0x6c'),'value':_0x5298d1[_0x4c03('0x6c')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x2]?_0x5298d1['attrs'][0x2]['value']:undefined)||0x14}];case _0x4c03('0x70'):case'pie-chart':return[{'name':_0x4c03('0x71'),'value':_0x5298d1[_0x4c03('0x71')]||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6f')},{'name':_0x4c03('0x72'),'value':_0x5298d1[_0x4c03('0x72')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x73'),'value':_0x5298d1[_0x4c03('0x73')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x2]?_0x5298d1[_0x4c03('0x63')][0x2][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x74'),'value':_0x5298d1[_0x4c03('0x74')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x3]?_0x5298d1[_0x4c03('0x63')][0x3]['value']:undefined)||[]}];case _0x4c03('0x75'):return[{'name':_0x4c03('0x76'),'type':_0x5298d1[_0x4c03('0x77')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x37')]:undefined)||null,'value':_0x5298d1['attrReport']||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x78'),'value':_0x5298d1[_0x4c03('0x78')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x22b417){logger[_0x4c03('0x2f')](_0x4c03('0x79'),JSON[_0x4c03('0x7a')](_0x22b417));return[];}}exports[_0x4c03('0x7b')]=function(_0x5720f1,_0x38829c,_0x3a9f4c){if(_0x5720f1[_0x4c03('0x5f')]['id']){delete _0x5720f1['body']['id'];}return db['Dashboard'][_0x4c03('0x52')]({'where':{'id':_0x5720f1[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x38829c,null))[_0x4c03('0x2b')](function(_0x383ea2){if(_0x383ea2){_0x5720f1[_0x4c03('0x5f')][_0x4c03('0x7c')]=_0x383ea2['id'];_0x5720f1[_0x4c03('0x5f')][_0x4c03('0x63')]=widgetAttributes(_0x5720f1['body']);return db[_0x4c03('0x7d')][_0x4c03('0x53')](_0x5720f1[_0x4c03('0x5f')]);}})['then'](respondWithResult(_0x38829c,null))['catch'](handleError(_0x38829c,null));};exports[_0x4c03('0x7e')]=function(_0x584aba,_0x13ea71,_0x179e83){var _0x20c244={};var _0x27b379={};var _0x37eb92;var _0x58215f;return db[_0x4c03('0x34')]['findOne']({'where':{'id':_0x584aba['params']['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x13ea71,null))[_0x4c03('0x2b')](function(_0x25a8e0){if(_0x25a8e0){_0x37eb92=_0x25a8e0;_0x27b379['model']=_[_0x4c03('0x3b')](db[_0x4c03('0x7d')]['rawAttributes']);_0x27b379[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x584aba[_0x4c03('0x3a')]);_0x27b379['filters']=_[_0x4c03('0x3d')](_0x27b379[_0x4c03('0x3e')],_0x27b379[_0x4c03('0x3a')]);_0x20c244[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x27b379['model'],qs[_0x4c03('0x51')](_0x584aba['query'][_0x4c03('0x51')]));_0x20c244[_0x4c03('0x3f')]=_0x20c244[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x20c244[_0x4c03('0x3f')]:_0x27b379['model'];_0x20c244['order']=qs[_0x4c03('0x44')](_0x584aba[_0x4c03('0x3a')][_0x4c03('0x44')]);_0x20c244[_0x4c03('0x45')]=qs[_0x4c03('0x3c')](_[_0x4c03('0x46')](_0x584aba[_0x4c03('0x3a')],_0x27b379[_0x4c03('0x3c')]));if(_0x584aba[_0x4c03('0x3a')][_0x4c03('0x47')]){_0x20c244['where']=_[_0x4c03('0x49')](_0x20c244[_0x4c03('0x45')],{'$or':_[_0x4c03('0x33')](_0x20c244[_0x4c03('0x3f')],function(_0x2cd46f){var _0x1fcd0c={};_0x1fcd0c[_0x2cd46f]={'$like':'%'+_0x584aba[_0x4c03('0x3a')][_0x4c03('0x47')]+'%'};return _0x1fcd0c;})});}_0x20c244=_['merge']({},_0x20c244,_0x584aba[_0x4c03('0x4a')]);return _0x37eb92[_0x4c03('0x7e')](_0x20c244);}})[_0x4c03('0x2b')](function(_0x3e3d77){if(_0x3e3d77){_0x58215f=_0x3e3d77[_0x4c03('0x40')];if(!_0x584aba[_0x4c03('0x3a')][_0x4c03('0x41')](_0x4c03('0x42'))){_0x20c244[_0x4c03('0x23')]=qs[_0x4c03('0x23')](_0x584aba[_0x4c03('0x3a')]['limit']);_0x20c244['offset']=qs[_0x4c03('0x21')](_0x584aba[_0x4c03('0x3a')][_0x4c03('0x21')]);}return _0x37eb92[_0x4c03('0x7e')](_0x20c244);}})['then'](function(_0x1cb86d){if(_0x1cb86d){return _0x1cb86d?{'count':_0x58215f,'rows':_0x1cb86d}:null;}})[_0x4c03('0x2b')](respondWithResult(_0x13ea71,null))[_0x4c03('0x4e')](handleError(_0x13ea71,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1dcea6d..e619c53 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 _0xb258=['Dashboard','save','update','remove','emit','hook','../../mysqldb'];(function(_0xae3f20,_0x1eb2c9){var _0x13d9a6=function(_0x537dbe){while(--_0x537dbe){_0xae3f20['push'](_0xae3f20['shift']());}};_0x13d9a6(++_0x1eb2c9);}(_0xb258,0x19c));var _0x8b25=function(_0x4de541,_0x3969cb){_0x4de541=_0x4de541-0x0;var _0x6d5b54=_0xb258[_0x4de541];return _0x6d5b54;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x8b25('0x0'))['db'][_0x8b25('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b25('0x2'),'afterUpdate':_0x8b25('0x3'),'afterDestroy':_0x8b25('0x4')};function emitEvent(_0x47cb8e){return function(_0x321087,_0x15393d,_0x43e7eb){DashboardEvents[_0x8b25('0x5')](_0x47cb8e+':'+_0x321087['id'],_0x321087);DashboardEvents[_0x8b25('0x5')](_0x47cb8e,_0x321087);_0x43e7eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8b25('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x5224=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x7f0805,_0x362cd0){var _0xe5b2dc=function(_0x4a1eda){while(--_0x4a1eda){_0x7f0805['push'](_0x7f0805['shift']());}};_0xe5b2dc(++_0x362cd0);}(_0x5224,0xa6));var _0x4522=function(_0x8f4554,_0x97e1f8){_0x8f4554=_0x8f4554-0x0;var _0x2b7465=_0x5224[_0x8f4554];return _0x2b7465;};'use strict';var EventEmitter=require(_0x4522('0x0'));var Dashboard=require(_0x4522('0x1'))['db'][_0x4522('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4522('0x3')](0x0);var events={'afterCreate':_0x4522('0x4'),'afterUpdate':'update','afterDestroy':_0x4522('0x5')};function emitEvent(_0x1ed51b){return function(_0x630e1c,_0x1f7ac7,_0x320b1b){DashboardEvents[_0x4522('0x6')](_0x1ed51b+':'+_0x630e1c['id'],_0x630e1c);DashboardEvents['emit'](_0x1ed51b,_0x630e1c);_0x320b1b(null);};}for(var e in events){if(events[_0x4522('0x7')](e)){var event=events[e];Dashboard[_0x4522('0x8')](e,emitEvent(event));}}module[_0x4522('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 36e92e8..c909190 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 _0x8b62=['bluebird','request-promise','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','util','../../config/logger','moment'];(function(_0x5f471e,_0x2f55a3){var _0x5f0f45=function(_0x167cef){while(--_0x167cef){_0x5f471e['push'](_0x5f471e['shift']());}};_0x5f0f45(++_0x2f55a3);}(_0x8b62,0xa7));var _0x28b6=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x8b62[_0x2998db];return _0x115fea;};'use strict';var _=require('lodash');var util=require(_0x28b6('0x0'));var logger=require(_0x28b6('0x1'))('api');var moment=require(_0x28b6('0x2'));var BPromise=require(_0x28b6('0x3'));var rp=require(_0x28b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x28b6('0x5'));var attributes=require(_0x28b6('0x6'));module['exports']=function(_0x1af193,_0x38a25e){return _0x1af193[_0x28b6('0x7')](_0x28b6('0x8'),attributes,{'tableName':_0x28b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb5e=['exports','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x5cc4de,_0x2df335){var _0x1bf255=function(_0x479413){while(--_0x479413){_0x5cc4de['push'](_0x5cc4de['shift']());}};_0x1bf255(++_0x2df335);}(_0xeb5e,0x17c));var _0xeeb5=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xeb5e[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xeeb5('0x0'));var util=require('util');var logger=require(_0xeeb5('0x1'))(_0xeeb5('0x2'));var moment=require(_0xeeb5('0x3'));var BPromise=require(_0xeeb5('0x4'));var rp=require(_0xeeb5('0x5'));var fs=require('fs');var path=require(_0xeeb5('0x6'));var rimraf=require(_0xeeb5('0x7'));var config=require(_0xeeb5('0x8'));var attributes=require(_0xeeb5('0x9'));module[_0xeeb5('0xa')]=function(_0x571898,_0x3b7a2c){return _0x571898['define'](_0xeeb5('0xb'),attributes,{'tableName':_0xeeb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index d6932bc..8cb767a 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 _0x5caa=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','info','catch','util'];(function(_0x5ccf84,_0x1de66c){var _0x2596d0=function(_0x3dad88){while(--_0x3dad88){_0x5ccf84['push'](_0x5ccf84['shift']());}};_0x2596d0(++_0x1de66c);}(_0x5caa,0x95));var _0xa5ca=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x5caa[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require('lodash');var util=require(_0xa5ca('0x0'));var moment=require(_0xa5ca('0x1'));var BPromise=require(_0xa5ca('0x2'));var rs=require(_0xa5ca('0x3'));var fs=require('fs');var Redis=require(_0xa5ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5ca('0x5'));var logger=require('../../config/logger')(_0xa5ca('0x6'));var config=require('../../config/environment');var jayson=require(_0xa5ca('0x7'));var client=jayson[_0xa5ca('0x8')]['http']({'port':0x232a});config[_0xa5ca('0x9')]=_[_0xa5ca('0xa')](config[_0xa5ca('0x9')],{'host':_0xa5ca('0xb'),'port':0x18eb});var socket=require(_0xa5ca('0xc'))(new Redis(config[_0xa5ca('0x9')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x86a3a2,_0x15af4d,_0x2cdc48){return new BPromise(function(_0x281852,_0x183101){return client[_0xa5ca('0xd')](_0x86a3a2,_0x2cdc48)[_0xa5ca('0xe')](function(_0x5cd133){logger['info']('Dashboard,\x20%s,\x20%s',_0x15af4d,_0xa5ca('0xf'));logger[_0xa5ca('0x10')](_0xa5ca('0x11'),_0x15af4d,_0xa5ca('0xf'),JSON[_0xa5ca('0x12')](_0x5cd133));if(_0x5cd133['error']){if(_0x5cd133[_0xa5ca('0x13')][_0xa5ca('0x14')]===0x1f4){logger[_0xa5ca('0x13')](_0xa5ca('0x15'),_0x15af4d,_0x5cd133[_0xa5ca('0x13')][_0xa5ca('0x16')]);return _0x183101(_0x5cd133[_0xa5ca('0x13')][_0xa5ca('0x16')]);}logger['error'](_0xa5ca('0x15'),_0x15af4d,_0x5cd133['error'][_0xa5ca('0x16')]);return _0x281852(_0x5cd133[_0xa5ca('0x13')][_0xa5ca('0x16')]);}else{logger[_0xa5ca('0x17')](_0xa5ca('0x15'),_0x15af4d,'request\x20sent');_0x281852(_0x5cd133['result']['message']);}})[_0xa5ca('0x18')](function(_0x300128){logger['error'](_0xa5ca('0x15'),_0x15af4d,_0x300128);_0x183101(_0x300128);});});} \ No newline at end of file +var _0xba47=['error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x3cb9ce,_0x246df0){var _0x355a5c=function(_0x22eba1){while(--_0x22eba1){_0x3cb9ce['push'](_0x3cb9ce['shift']());}};_0x355a5c(++_0x246df0);}(_0xba47,0xc4));var _0x7ba4=function(_0x5e836a,_0x231a5d){_0x5e836a=_0x5e836a-0x0;var _0x1ad971=_0xba47[_0x5e836a];return _0x1ad971;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ba4('0x0'));var BPromise=require(_0x7ba4('0x1'));var rs=require(_0x7ba4('0x2'));var fs=require('fs');var Redis=require(_0x7ba4('0x3'));var db=require(_0x7ba4('0x4'))['db'];var utils=require(_0x7ba4('0x5'));var logger=require(_0x7ba4('0x6'))('rpc');var config=require(_0x7ba4('0x7'));var jayson=require(_0x7ba4('0x8'));var client=jayson[_0x7ba4('0x9')]['http']({'port':0x232a});config[_0x7ba4('0xa')]=_[_0x7ba4('0xb')](config[_0x7ba4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ba4('0xa')]));require(_0x7ba4('0xc'))[_0x7ba4('0xd')](socket);function respondWithRpcPromise(_0x55c372,_0x2902b8,_0x5c7686){return new BPromise(function(_0x3f4d05,_0x533f34){return client[_0x7ba4('0xe')](_0x55c372,_0x5c7686)['then'](function(_0x459c33){logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x2902b8,_0x7ba4('0x11'));logger[_0x7ba4('0x12')](_0x7ba4('0x13'),_0x2902b8,_0x7ba4('0x11'),JSON['stringify'](_0x459c33));if(_0x459c33['error']){if(_0x459c33['error']['code']===0x1f4){logger['error'](_0x7ba4('0x10'),_0x2902b8,_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);return _0x533f34(_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);}logger[_0x7ba4('0x14')](_0x7ba4('0x10'),_0x2902b8,_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);return _0x3f4d05(_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);}else{logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x2902b8,'request\x20sent');_0x3f4d05(_0x459c33[_0x7ba4('0x16')][_0x7ba4('0x15')]);}})[_0x7ba4('0x17')](function(_0x4866d2){logger[_0x7ba4('0x14')](_0x7ba4('0x10'),_0x2902b8,_0x4866d2);_0x533f34(_0x4866d2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 415fb7e..edff4f7 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 _0xe0a7=['register','length','update','emit','removeListener'];(function(_0x46c8c8,_0x35358f){var _0x3645ac=function(_0x24676c){while(--_0x24676c){_0x46c8c8['push'](_0x46c8c8['shift']());}};_0x3645ac(++_0x35358f);}(_0xe0a7,0x19c));var _0x7e0a=function(_0x342e0e,_0x5509a2){_0x342e0e=_0x342e0e-0x0;var _0x5804ff=_0xe0a7[_0x342e0e];return _0x5804ff;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x7e0a('0x0')];function createListener(_0x58ff01,_0x215cf8){return function(_0x448b22){_0x215cf8[_0x7e0a('0x1')](_0x58ff01,_0x448b22);};}function removeListener(_0x40fcd2,_0x281bc3){return function(){DashboardEvents[_0x7e0a('0x2')](_0x40fcd2,_0x281bc3);};}exports[_0x7e0a('0x3')]=function(_0x2d6df2){for(var _0x34d138=0x0,_0x5e111c=events[_0x7e0a('0x4')];_0x34d138<_0x5e111c;_0x34d138++){var _0x4cfb88=events[_0x34d138];var _0x4e300e=createListener('dashboard:'+_0x4cfb88,_0x2d6df2);DashboardEvents['on'](_0x4cfb88,_0x4e300e);}}; \ No newline at end of file +var _0x38ca=['emit','removeListener','register','dashboard:','save','remove'];(function(_0x40da58,_0x23cca4){var _0x61b669=function(_0x59915e){while(--_0x59915e){_0x40da58['push'](_0x40da58['shift']());}};_0x61b669(++_0x23cca4);}(_0x38ca,0x8e));var _0xa38c=function(_0x43d209,_0x586174){_0x43d209=_0x43d209-0x0;var _0x224032=_0x38ca[_0x43d209];return _0x224032;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa38c('0x0'),_0xa38c('0x1'),'update'];function createListener(_0x474925,_0x4fd2f1){return function(_0x335227){_0x4fd2f1[_0xa38c('0x2')](_0x474925,_0x335227);};}function removeListener(_0x5213de,_0x5f499c){return function(){DashboardEvents[_0xa38c('0x3')](_0x5213de,_0x5f499c);};}exports[_0xa38c('0x4')]=function(_0x30016f){for(var _0x26d304=0x0,_0x37f15e=events['length'];_0x26d304<_0x37f15e;_0x26d304++){var _0x4b7989=events[_0x26d304];var _0x414d90=createListener(_0xa38c('0x5')+_0x4b7989,_0x30016f);DashboardEvents['on'](_0x4b7989,_0x414d90);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 11f345b..5387cc6 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 _0x4cf0=['create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','getItems','post'];(function(_0x2e8c4a,_0x119e79){var _0x5ea3cf=function(_0x95b31a){while(--_0x95b31a){_0x2e8c4a['push'](_0x2e8c4a['shift']());}};_0x5ea3cf(++_0x119e79);}(_0x4cf0,0x67));var _0x04cf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4cf0[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x04cf('0x0'));var util=require(_0x04cf('0x1'));var path=require(_0x04cf('0x2'));var timeout=require(_0x04cf('0x3'));var express=require(_0x04cf('0x4'));var router=express[_0x04cf('0x5')]();var fs_extra=require(_0x04cf('0x6'));var auth=require(_0x04cf('0x7'));var interaction=require(_0x04cf('0x8'));var config=require('../../config/environment');var controller=require(_0x04cf('0x9'));router[_0x04cf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x04cf('0xa')](_0x04cf('0xb'),auth[_0x04cf('0xc')](),controller[_0x04cf('0xd')]);router[_0x04cf('0xa')](_0x04cf('0xe'),auth[_0x04cf('0xc')](),controller[_0x04cf('0xf')]);router[_0x04cf('0x10')]('/',auth['isAuthenticated'](),controller[_0x04cf('0x11')]);router[_0x04cf('0x10')](_0x04cf('0x12'),auth['isAuthenticated'](),controller[_0x04cf('0x13')]);router[_0x04cf('0x10')]('/:id/items',auth[_0x04cf('0xc')](),controller[_0x04cf('0x14')]);router[_0x04cf('0x15')](_0x04cf('0xb'),auth[_0x04cf('0xc')](),controller[_0x04cf('0x16')]);router[_0x04cf('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x31e3=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','/:id','show','get','/:id/items','post','create','/:id/clone','clone','addItem','put','destroy'];(function(_0x15411f,_0x42bef8){var _0x555650=function(_0x215e4f){while(--_0x215e4f){_0x15411f['push'](_0x15411f['shift']());}};_0x555650(++_0x42bef8);}(_0x31e3,0x161));var _0x331e=function(_0x3aba28,_0x4484a7){_0x3aba28=_0x3aba28-0x0;var _0x24f46d=_0x31e3[_0x3aba28];return _0x24f46d;};'use strict';var multer=require(_0x331e('0x0'));var util=require(_0x331e('0x1'));var path=require(_0x331e('0x2'));var timeout=require(_0x331e('0x3'));var express=require(_0x331e('0x4'));var router=express[_0x331e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x331e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x331e('0x7'));var controller=require(_0x331e('0x8'));router['get']('/',auth[_0x331e('0x9')](),controller['index']);router['get'](_0x331e('0xa'),auth[_0x331e('0x9')](),controller[_0x331e('0xb')]);router[_0x331e('0xc')](_0x331e('0xd'),auth[_0x331e('0x9')](),controller['getItems']);router[_0x331e('0xe')]('/',auth['isAuthenticated'](),controller[_0x331e('0xf')]);router[_0x331e('0xe')](_0x331e('0x10'),auth[_0x331e('0x9')](),controller[_0x331e('0x11')]);router[_0x331e('0xe')]('/:id/items',auth[_0x331e('0x9')](),controller[_0x331e('0x12')]);router[_0x331e('0x13')](_0x331e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x331e('0x9')](),controller[_0x331e('0x14')]);module[_0x331e('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f228d7f..0567e90 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 _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x46ed,0x168));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'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 +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0xbad09a,_0x239fa2){var _0xaababe=function(_0x4f4e06){while(--_0x4f4e06){_0xbad09a['push'](_0xbad09a['shift']());}};_0xaababe(++_0x239fa2);}(_0xeff8,0x186));var _0x8eff=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xeff8[_0x42bc91];return _0x3f5507;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 357d857..121cad1 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 _0x2874=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','name','send','show','params','model','keys','DashboardItem','query','intersection','fields','attributes','length','includeAll','include','merge','find','destroy','catch','type','iframe','attrUrl','attrs','value','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x365cf1,_0x5e1e00){var _0x1d92ff=function(_0x5620ed){while(--_0x5620ed){_0x365cf1['push'](_0x365cf1['shift']());}};_0x1d92ff(++_0x5e1e00);}(_0x2874,0x150));var _0x4287=function(_0x5cb508,_0x2cb3bd){_0x5cb508=_0x5cb508-0x0;var _0x44d4f5=_0x2874[_0x5cb508];return _0x44d4f5;};'use strict';var emlformat=require(_0x4287('0x0'));var rimraf=require(_0x4287('0x1'));var zipdir=require(_0x4287('0x2'));var jsonpatch=require(_0x4287('0x3'));var rp=require(_0x4287('0x4'));var moment=require(_0x4287('0x5'));var BPromise=require(_0x4287('0x6'));var Mustache=require(_0x4287('0x7'));var util=require(_0x4287('0x8'));var path=require('path');var sox=require(_0x4287('0x9'));var csv=require(_0x4287('0xa'));var ejs=require(_0x4287('0xb'));var fs=require('fs');var fs_extra=require(_0x4287('0xc'));var _=require(_0x4287('0xd'));var squel=require(_0x4287('0xe'));var crypto=require(_0x4287('0xf'));var jsforce=require(_0x4287('0x10'));var deskjs=require(_0x4287('0x11'));var toCsv=require(_0x4287('0xa'));var querystring=require(_0x4287('0x12'));var Papa=require('papaparse');var Redis=require(_0x4287('0x13'));var authService=require(_0x4287('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4287('0x15'));var logger=require(_0x4287('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4287('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4287('0x18')]=_[_0x4287('0x19')](config[_0x4287('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4287('0x1a'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x4287('0x1b')](socket);function respondWithStatusCode(_0x4a76be,_0x532153){_0x532153=_0x532153||0xcc;return function(_0x5a3021){if(_0x5a3021){return _0x4a76be[_0x4287('0x1c')](_0x532153);}return _0x4a76be[_0x4287('0x1d')](_0x532153)[_0x4287('0x1e')]();};}function respondWithResult(_0x5a069d,_0x41f8c2){_0x41f8c2=_0x41f8c2||0xc8;return function(_0x34a821){if(_0x34a821){return _0x5a069d['status'](_0x41f8c2)[_0x4287('0x1f')](_0x34a821);}};}function respondWithFilteredResult(_0x568467,_0x4b74c4){return function(_0x47fcb8){if(_0x47fcb8){var _0x26c6f6=typeof _0x4b74c4['offset']===_0x4287('0x20')&&typeof _0x4b74c4[_0x4287('0x21')]==='undefined';var _0x33029c=_0x47fcb8[_0x4287('0x22')];var _0x3debf8=_0x26c6f6?0x0:_0x4b74c4[_0x4287('0x23')];var _0x20b72b=_0x26c6f6?_0x47fcb8['count']:_0x4b74c4[_0x4287('0x23')]+_0x4b74c4['limit'];var _0x59cce9;if(_0x20b72b>=_0x33029c){_0x20b72b=_0x33029c;_0x59cce9=0xc8;}else{_0x59cce9=0xce;}_0x568467['status'](_0x59cce9);return _0x568467[_0x4287('0x24')](_0x4287('0x25'),_0x3debf8+'-'+_0x20b72b+'/'+_0x33029c)[_0x4287('0x1f')](_0x47fcb8);}return null;};}function patchUpdates(_0x4ceba2){return function(_0x1d5dfd){try{jsonpatch[_0x4287('0x26')](_0x1d5dfd,_0x4ceba2,!![]);}catch(_0x4b3aaf){return BPromise[_0x4287('0x27')](_0x4b3aaf);}return _0x1d5dfd['save']();};}function saveUpdates(_0x1b8c6b,_0x2ed4e3){return function(_0x334532){if(_0x334532){return _0x334532['update'](_0x1b8c6b)[_0x4287('0x28')](function(_0x48cd2a){return _0x48cd2a;});}return null;};}function removeEntity(_0xae1fbb,_0x5bf616){return function(_0x271946){if(_0x271946){return _0x271946['destroy']()[_0x4287('0x28')](function(){_0xae1fbb[_0x4287('0x1d')](0xcc)[_0x4287('0x1e')]();});}};}function handleEntityNotFound(_0x5d2cf6,_0x2373df){return function(_0x450233){if(!_0x450233){_0x5d2cf6[_0x4287('0x1c')](0x194);}return _0x450233;};}function handleError(_0x4ad61c,_0x3e2b9d){_0x3e2b9d=_0x3e2b9d||0x1f4;return function(_0x6cbae6){logger['error'](_0x6cbae6['stack']);if(_0x6cbae6[_0x4287('0x29')]){delete _0x6cbae6[_0x4287('0x29')];}_0x4ad61c['status'](_0x3e2b9d)[_0x4287('0x2a')](_0x6cbae6);};}exports[_0x4287('0x2b')]=function(_0x5af6be,_0x5d8105){var _0x2c3858={'raw':![],'where':{'id':_0x5af6be[_0x4287('0x2c')]['id']}},_0x3a3863={};_0x3a3863[_0x4287('0x2d')]=_[_0x4287('0x2e')](db[_0x4287('0x2f')]['rawAttributes']);_0x3a3863[_0x4287('0x30')]=_['keys'](_0x5af6be[_0x4287('0x30')]);_0x3a3863['filters']=_[_0x4287('0x31')](_0x3a3863[_0x4287('0x2d')],_0x3a3863[_0x4287('0x30')]);_0x2c3858['attributes']=_[_0x4287('0x31')](_0x3a3863['model'],qs['fields'](_0x5af6be[_0x4287('0x30')][_0x4287('0x32')]));_0x2c3858[_0x4287('0x33')]=_0x2c3858[_0x4287('0x33')][_0x4287('0x34')]?_0x2c3858[_0x4287('0x33')]:_0x3a3863['model'];if(_0x5af6be[_0x4287('0x30')][_0x4287('0x35')]){_0x2c3858[_0x4287('0x36')]=[{'all':!![]}];}_0x2c3858=_[_0x4287('0x37')]({},_0x2c3858,_0x5af6be['options']);return db[_0x4287('0x2f')][_0x4287('0x38')](_0x2c3858)[_0x4287('0x28')](handleEntityNotFound(_0x5d8105,null))[_0x4287('0x28')](respondWithResult(_0x5d8105,null))['catch'](handleError(_0x5d8105,null));};exports[_0x4287('0x39')]=function(_0x48d4c5,_0xc659fe){return db[_0x4287('0x2f')][_0x4287('0x38')]({'where':{'id':_0x48d4c5[_0x4287('0x2c')]['id']}})['then'](handleEntityNotFound(_0xc659fe,null))[_0x4287('0x28')](removeEntity(_0xc659fe,null))[_0x4287('0x3a')](handleError(_0xc659fe,null));};function widgetAttributes(_0x52a945){try{switch(_0x52a945[_0x4287('0x3b')]){case _0x4287('0x3c'):return[{'name':_0x4287('0x3d'),'value':_0x52a945[_0x4287('0x3d')]||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945['attrs'][0x0][_0x4287('0x3f')]:undefined)||'https://'}];case _0x4287('0x40'):return[{'name':'attrPath','value':_0x52a945['attrPath']||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945[_0x4287('0x3e')][0x0][_0x4287('0x3f')]:undefined)||''}];case _0x4287('0x41'):return[{'name':_0x4287('0x42'),'value':_0x52a945['attrHourFormat']||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945[_0x4287('0x3e')][0x0][_0x4287('0x3f')]:undefined)||_0x4287('0x43')},{'name':_0x4287('0x44'),'value':_0x52a945[_0x4287('0x44')]||(_0x52a945['attrs']&&_0x52a945[_0x4287('0x3e')][0x1]?_0x52a945[_0x4287('0x3e')][0x1][_0x4287('0x3f')]:undefined)||_0x4287('0x45')},{'name':_0x4287('0x46'),'value':_0x52a945[_0x4287('0x46')]||(_0x52a945['attrs']&&_0x52a945[_0x4287('0x3e')][0x2]?_0x52a945['attrs'][0x2][_0x4287('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0x4287('0x47'),'value':_0x52a945[_0x4287('0x47')]||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945[_0x4287('0x3e')][0x0][_0x4287('0x3f')]:undefined)||_0x4287('0x48')},{'name':_0x4287('0x49'),'value':_0x52a945['attrVoiceQueues']||(_0x52a945['attrs']&&_0x52a945['attrs'][0x1]?_0x52a945[_0x4287('0x3e')][0x1][_0x4287('0x3f')]:undefined)||[]},{'name':_0x4287('0x46'),'value':_0x52a945['attrFontSize']||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x2]?_0x52a945[_0x4287('0x3e')][0x2][_0x4287('0x3f')]:undefined)||0x14}];case _0x4287('0x4a'):case _0x4287('0x4b'):return[{'name':_0x4287('0x4c'),'value':_0x52a945['attrSerie1']||(_0x52a945['attrs']&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945['attrs'][0x0][_0x4287('0x3f')]:undefined)||_0x4287('0x48')},{'name':_0x4287('0x4d'),'value':_0x52a945[_0x4287('0x4d')]||(_0x52a945[_0x4287('0x3e')]&&_0x52a945['attrs'][0x1]?_0x52a945[_0x4287('0x3e')][0x1]['value']:undefined)||null},{'name':_0x4287('0x4e'),'value':_0x52a945[_0x4287('0x4e')]||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x2]?_0x52a945[_0x4287('0x3e')][0x2][_0x4287('0x3f')]:undefined)||null},{'name':_0x4287('0x49'),'value':_0x52a945[_0x4287('0x49')]||(_0x52a945['attrs']&&_0x52a945['attrs'][0x3]?_0x52a945[_0x4287('0x3e')][0x3][_0x4287('0x3f')]:undefined)||[]}];case _0x4287('0x4f'):return[{'name':_0x4287('0x50'),'type':_0x52a945[_0x4287('0x51')]||(_0x52a945['attrs']&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945['attrs'][0x0][_0x4287('0x3b')]:undefined)||null,'value':_0x52a945[_0x4287('0x50')]||(_0x52a945['attrs']&&_0x52a945[_0x4287('0x3e')][0x0]?_0x52a945[_0x4287('0x3e')][0x0]['value']:undefined)||null},{'name':_0x4287('0x52'),'value':_0x52a945[_0x4287('0x52')]||(_0x52a945[_0x4287('0x3e')]&&_0x52a945[_0x4287('0x3e')][0x1]?_0x52a945[_0x4287('0x3e')][0x1][_0x4287('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x4159e8){logger['error'](_0x4287('0x53'),JSON[_0x4287('0x54')](_0x4159e8));return[];}}exports[_0x4287('0x55')]=function(_0x3acf51,_0xbadfd8){if(_0x3acf51[_0x4287('0x56')]){_0x3acf51[_0x4287('0x56')][_0x4287('0x3e')]=widgetAttributes(_0x3acf51[_0x4287('0x56')]);}return db[_0x4287('0x2f')][_0x4287('0x55')](_0x3acf51[_0x4287('0x56')],{})[_0x4287('0x28')](respondWithResult(_0xbadfd8,0xc9))[_0x4287('0x3a')](handleError(_0xbadfd8,null));};exports[_0x4287('0x57')]=function(_0x37f1ff,_0x137202){if(_0x37f1ff[_0x4287('0x56')]['id']){delete _0x37f1ff['body']['id'];}_0x37f1ff[_0x4287('0x56')][_0x4287('0x3e')]=widgetAttributes(_0x37f1ff[_0x4287('0x56')]);return db['DashboardItem'][_0x4287('0x38')]({'where':{'id':_0x37f1ff[_0x4287('0x2c')]['id']}})[_0x4287('0x28')](handleEntityNotFound(_0x137202,null))[_0x4287('0x28')](saveUpdates(_0x37f1ff['body'],null))[_0x4287('0x28')](respondWithResult(_0x137202,null))[_0x4287('0x3a')](handleError(_0x137202,null));}; \ No newline at end of file +var _0xa6c5=['status','end','json','offset','undefined','count','limit','set','apply','save','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','find','catch','destroy','type','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus'];(function(_0x4e9c24,_0x37bfa3){var _0xc3407e=function(_0x4314fb){while(--_0x4314fb){_0x4e9c24['push'](_0x4e9c24['shift']());}};_0xc3407e(++_0x37bfa3);}(_0xa6c5,0xe4));var _0x5a6c=function(_0x21bdb9,_0x22ad79){_0x21bdb9=_0x21bdb9-0x0;var _0x49d8d8=_0xa6c5[_0x21bdb9];return _0x49d8d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a6c('0x0'));var zipdir=require(_0x5a6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a6c('0x2'));var moment=require('moment');var BPromise=require(_0x5a6c('0x3'));var Mustache=require(_0x5a6c('0x4'));var util=require(_0x5a6c('0x5'));var path=require(_0x5a6c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5a6c('0x7'));var fs=require('fs');var fs_extra=require(_0x5a6c('0x8'));var _=require(_0x5a6c('0x9'));var squel=require(_0x5a6c('0xa'));var crypto=require('crypto');var jsforce=require(_0x5a6c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a6c('0xc'));var querystring=require(_0x5a6c('0xd'));var Papa=require('papaparse');var Redis=require(_0x5a6c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a6c('0xf'));var as=require(_0x5a6c('0x10'));var hardwareService=require(_0x5a6c('0x11'));var logger=require('../../config/logger')(_0x5a6c('0x12'));var utils=require('../../config/utils');var config=require(_0x5a6c('0x13'));var licenseUtil=require(_0x5a6c('0x14'));var db=require('../../mysqldb')['db'];config[_0x5a6c('0x15')]=_[_0x5a6c('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5a6c('0x17'))(new Redis(config[_0x5a6c('0x15')]));require(_0x5a6c('0x18'))[_0x5a6c('0x19')](socket);function respondWithStatusCode(_0x72c8e6,_0x1efea8){_0x1efea8=_0x1efea8||0xcc;return function(_0x34432e){if(_0x34432e){return _0x72c8e6[_0x5a6c('0x1a')](_0x1efea8);}return _0x72c8e6[_0x5a6c('0x1b')](_0x1efea8)[_0x5a6c('0x1c')]();};}function respondWithResult(_0x1073f0,_0x52b8cf){_0x52b8cf=_0x52b8cf||0xc8;return function(_0x664d3e){if(_0x664d3e){return _0x1073f0[_0x5a6c('0x1b')](_0x52b8cf)[_0x5a6c('0x1d')](_0x664d3e);}};}function respondWithFilteredResult(_0x2c3079,_0x203e00){return function(_0x1f92a5){if(_0x1f92a5){var _0x4d8b23=typeof _0x203e00[_0x5a6c('0x1e')]===_0x5a6c('0x1f')&&typeof _0x203e00['limit']===_0x5a6c('0x1f');var _0x2ac928=_0x1f92a5[_0x5a6c('0x20')];var _0x37ce40=_0x4d8b23?0x0:_0x203e00[_0x5a6c('0x1e')];var _0x1c24c3=_0x4d8b23?_0x1f92a5[_0x5a6c('0x20')]:_0x203e00[_0x5a6c('0x1e')]+_0x203e00[_0x5a6c('0x21')];var _0x3f9918;if(_0x1c24c3>=_0x2ac928){_0x1c24c3=_0x2ac928;_0x3f9918=0xc8;}else{_0x3f9918=0xce;}_0x2c3079[_0x5a6c('0x1b')](_0x3f9918);return _0x2c3079[_0x5a6c('0x22')]('Content-Range',_0x37ce40+'-'+_0x1c24c3+'/'+_0x2ac928)['json'](_0x1f92a5);}return null;};}function patchUpdates(_0x5857a8){return function(_0xf51b7){try{jsonpatch[_0x5a6c('0x23')](_0xf51b7,_0x5857a8,!![]);}catch(_0x3ea904){return BPromise['reject'](_0x3ea904);}return _0xf51b7[_0x5a6c('0x24')]();};}function saveUpdates(_0x16c727,_0xe8108b){return function(_0x2d2ec7){if(_0x2d2ec7){return _0x2d2ec7['update'](_0x16c727)[_0x5a6c('0x25')](function(_0x369b9e){return _0x369b9e;});}return null;};}function removeEntity(_0x43b41b,_0x50c14b){return function(_0x4f1532){if(_0x4f1532){return _0x4f1532['destroy']()[_0x5a6c('0x25')](function(){_0x43b41b[_0x5a6c('0x1b')](0xcc)[_0x5a6c('0x1c')]();});}};}function handleEntityNotFound(_0x316794,_0x39df0b){return function(_0x205bc6){if(!_0x205bc6){_0x316794[_0x5a6c('0x1a')](0x194);}return _0x205bc6;};}function handleError(_0x3fc57c,_0x3b3a5d){_0x3b3a5d=_0x3b3a5d||0x1f4;return function(_0x4450f8){logger[_0x5a6c('0x26')](_0x4450f8[_0x5a6c('0x27')]);if(_0x4450f8[_0x5a6c('0x28')]){delete _0x4450f8[_0x5a6c('0x28')];}_0x3fc57c[_0x5a6c('0x1b')](_0x3b3a5d)[_0x5a6c('0x29')](_0x4450f8);};}exports[_0x5a6c('0x2a')]=function(_0x592af4,_0xa25af4){var _0x1ac9e6={'raw':![],'where':{'id':_0x592af4[_0x5a6c('0x2b')]['id']}},_0x132ee0={};_0x132ee0[_0x5a6c('0x2c')]=_[_0x5a6c('0x2d')](db[_0x5a6c('0x2e')][_0x5a6c('0x2f')]);_0x132ee0[_0x5a6c('0x30')]=_[_0x5a6c('0x2d')](_0x592af4[_0x5a6c('0x30')]);_0x132ee0['filters']=_[_0x5a6c('0x31')](_0x132ee0['model'],_0x132ee0[_0x5a6c('0x30')]);_0x1ac9e6[_0x5a6c('0x32')]=_[_0x5a6c('0x31')](_0x132ee0[_0x5a6c('0x2c')],qs[_0x5a6c('0x33')](_0x592af4[_0x5a6c('0x30')][_0x5a6c('0x33')]));_0x1ac9e6[_0x5a6c('0x32')]=_0x1ac9e6[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x1ac9e6[_0x5a6c('0x32')]:_0x132ee0[_0x5a6c('0x2c')];if(_0x592af4[_0x5a6c('0x30')][_0x5a6c('0x35')]){_0x1ac9e6['include']=[{'all':!![]}];}_0x1ac9e6=_['merge']({},_0x1ac9e6,_0x592af4['options']);return db[_0x5a6c('0x2e')][_0x5a6c('0x36')](_0x1ac9e6)['then'](handleEntityNotFound(_0xa25af4,null))[_0x5a6c('0x25')](respondWithResult(_0xa25af4,null))[_0x5a6c('0x37')](handleError(_0xa25af4,null));};exports[_0x5a6c('0x38')]=function(_0x3c1652,_0x38b301){return db['DashboardItem'][_0x5a6c('0x36')]({'where':{'id':_0x3c1652['params']['id']}})['then'](handleEntityNotFound(_0x38b301,null))['then'](removeEntity(_0x38b301,null))['catch'](handleError(_0x38b301,null));};function widgetAttributes(_0xd99e10){try{switch(_0xd99e10[_0x5a6c('0x39')]){case _0x5a6c('0x3a'):return[{'name':'attrUrl','value':_0xd99e10['attrUrl']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x3d')}];case _0x5a6c('0x3e'):return[{'name':_0x5a6c('0x3f'),'value':_0xd99e10[_0x5a6c('0x3f')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0]['value']:undefined)||''}];case _0x5a6c('0x40'):return[{'name':_0x5a6c('0x41'),'value':_0xd99e10['attrHourFormat']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10['attrs'][0x0][_0x5a6c('0x3c')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0xd99e10[_0x5a6c('0x42')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x43')},{'name':_0x5a6c('0x44'),'value':_0xd99e10['attrFontSize']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10['attrs'][0x2]?_0xd99e10[_0x5a6c('0x3b')][0x2][_0x5a6c('0x3c')]:undefined)||0xc}];case _0x5a6c('0x45'):return[{'name':_0x5a6c('0x46'),'value':_0xd99e10['attrMetric']||(_0xd99e10['attrs']&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x47')},{'name':_0x5a6c('0x48'),'value':_0xd99e10[_0x5a6c('0x48')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10['attrs'][0x1][_0x5a6c('0x3c')]:undefined)||[]},{'name':_0x5a6c('0x44'),'value':_0xd99e10[_0x5a6c('0x44')]||(_0xd99e10['attrs']&&_0xd99e10[_0x5a6c('0x3b')][0x2]?_0xd99e10[_0x5a6c('0x3b')][0x2][_0x5a6c('0x3c')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0xd99e10[_0x5a6c('0x49')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||'total'},{'name':_0x5a6c('0x4a'),'value':_0xd99e10[_0x5a6c('0x4a')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0xd99e10[_0x5a6c('0x4b')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x2]?_0xd99e10['attrs'][0x2]['value']:undefined)||null},{'name':_0x5a6c('0x48'),'value':_0xd99e10[_0x5a6c('0x48')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x3]?_0xd99e10[_0x5a6c('0x3b')][0x3]['value']:undefined)||[]}];case _0x5a6c('0x4c'):return[{'name':_0x5a6c('0x4d'),'type':_0xd99e10[_0x5a6c('0x4e')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0]['type']:undefined)||null,'value':_0xd99e10[_0x5a6c('0x4d')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10['attrs'][0x0][_0x5a6c('0x3c')]:undefined)||null},{'name':_0x5a6c('0x4f'),'value':_0xd99e10['attrRefresh']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1][_0x5a6c('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x46c484){logger[_0x5a6c('0x26')](_0x5a6c('0x50'),JSON[_0x5a6c('0x51')](_0x46c484));return[];}}exports[_0x5a6c('0x52')]=function(_0x2694a5,_0x130261){if(_0x2694a5[_0x5a6c('0x53')]){_0x2694a5[_0x5a6c('0x53')]['attrs']=widgetAttributes(_0x2694a5[_0x5a6c('0x53')]);}return db[_0x5a6c('0x2e')][_0x5a6c('0x52')](_0x2694a5['body'],{})[_0x5a6c('0x25')](respondWithResult(_0x130261,0xc9))['catch'](handleError(_0x130261,null));};exports[_0x5a6c('0x54')]=function(_0x34d5c3,_0x39d8ae){if(_0x34d5c3[_0x5a6c('0x53')]['id']){delete _0x34d5c3[_0x5a6c('0x53')]['id'];}_0x34d5c3[_0x5a6c('0x53')]['attrs']=widgetAttributes(_0x34d5c3['body']);return db[_0x5a6c('0x2e')][_0x5a6c('0x36')]({'where':{'id':_0x34d5c3['params']['id']}})['then'](handleEntityNotFound(_0x39d8ae,null))['then'](saveUpdates(_0x34d5c3['body'],null))['then'](respondWithResult(_0x39d8ae,null))['catch'](handleError(_0x39d8ae,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 8af13b7..2ea11b6 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 _0xaa32=['setMaxListeners','save','remove','emit','../../mysqldb','DashboardItem'];(function(_0x2419e8,_0x332edd){var _0x1b0de4=function(_0x445ace){while(--_0x445ace){_0x2419e8['push'](_0x2419e8['shift']());}};_0x1b0de4(++_0x332edd);}(_0xaa32,0xb2));var _0x2aa3=function(_0x3c8073,_0x23a0b6){_0x3c8073=_0x3c8073-0x0;var _0xc7e0b8=_0xaa32[_0x3c8073];return _0xc7e0b8;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x2aa3('0x0'))['db'][_0x2aa3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2aa3('0x2')](0x0);var events={'afterCreate':_0x2aa3('0x3'),'afterUpdate':'update','afterDestroy':_0x2aa3('0x4')};function emitEvent(_0x13b9d1){return function(_0x5ec5e1,_0x5571b6,_0x533c5a){DashboardItemEvents[_0x2aa3('0x5')](_0x13b9d1+':'+_0x5ec5e1['id'],_0x5ec5e1);DashboardItemEvents[_0x2aa3('0x5')](_0x13b9d1,_0x5ec5e1);_0x533c5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x6286=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','remove','emit'];(function(_0x16c1e6,_0x2cda03){var _0x210c98=function(_0x43f363){while(--_0x43f363){_0x16c1e6['push'](_0x16c1e6['shift']());}};_0x210c98(++_0x2cda03);}(_0x6286,0x1ea));var _0x6628=function(_0xff6f91,_0x2dacd2){_0xff6f91=_0xff6f91-0x0;var _0x1c7f2b=_0x6286[_0xff6f91];return _0x1c7f2b;};'use strict';var EventEmitter=require(_0x6628('0x0'));var DashboardItem=require(_0x6628('0x1'))['db'][_0x6628('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6628('0x3'),'afterUpdate':'update','afterDestroy':_0x6628('0x4')};function emitEvent(_0x97cfc){return function(_0x20ef84,_0x447089,_0x435cb4){DashboardItemEvents[_0x6628('0x5')](_0x97cfc+':'+_0x20ef84['id'],_0x20ef84);DashboardItemEvents[_0x6628('0x5')](_0x97cfc,_0x20ef84);_0x435cb4(null);};}for(var e in events){if(events[_0x6628('0x6')](e)){var event=events[e];DashboardItem[_0x6628('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ef5e24d..945cf1a 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 _0xc43c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items'];(function(_0x20f764,_0x185982){var _0x52ab9d=function(_0x537856){while(--_0x537856){_0x20f764['push'](_0x20f764['shift']());}};_0x52ab9d(++_0x185982);}(_0xc43c,0x152));var _0xcc43=function(_0x46eac3,_0x557014){_0x46eac3=_0x46eac3-0x0;var _0x1ab1bb=_0xc43c[_0x46eac3];return _0x1ab1bb;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x6'));var rimraf=require(_0xcc43('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc43('0x8'));module[_0xcc43('0x9')]=function(_0x217a5e,_0x17d1a2){return _0x217a5e[_0xcc43('0xa')](_0xcc43('0xb'),attributes,{'tableName':_0xcc43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebe1=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items'];(function(_0x1c7d93,_0x3c5644){var _0x2b51aa=function(_0x5c0d10){while(--_0x5c0d10){_0x1c7d93['push'](_0x1c7d93['shift']());}};_0x2b51aa(++_0x3c5644);}(_0xebe1,0xf2));var _0x1ebe=function(_0x9f7cd4,_0x46d39f){_0x9f7cd4=_0x9f7cd4-0x0;var _0x3a21e9=_0xebe1[_0x9f7cd4];return _0x3a21e9;};'use strict';var _=require(_0x1ebe('0x0'));var util=require(_0x1ebe('0x1'));var logger=require(_0x1ebe('0x2'))(_0x1ebe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ebe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ebe('0x5'));var config=require(_0x1ebe('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x1ebe('0x7')]=function(_0x4c0930,_0x47e3ac){return _0x4c0930[_0x1ebe('0x8')](_0x1ebe('0x9'),attributes,{'tableName':_0x1ebe('0xa'),'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 6baf299..e98c9a3 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 _0x02d3=['localhost','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x02d3,0xb1));var _0x302d=function(_0x36a204,_0x286bde){_0x36a204=_0x36a204-0x0;var _0x2a95a9=_0x02d3[_0x36a204];return _0x2a95a9;};'use strict';var _=require(_0x302d('0x0'));var util=require('util');var moment=require(_0x302d('0x1'));var BPromise=require('bluebird');var rs=require(_0x302d('0x2'));var fs=require('fs');var Redis=require(_0x302d('0x3'));var db=require(_0x302d('0x4'))['db'];var utils=require(_0x302d('0x5'));var logger=require(_0x302d('0x6'))(_0x302d('0x7'));var config=require('../../config/environment');var jayson=require(_0x302d('0x8'));var client=jayson['client'][_0x302d('0x9')]({'port':0x232a});config[_0x302d('0xa')]=_[_0x302d('0xb')](config['redis'],{'host':_0x302d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x302d('0xa')]));require(_0x302d('0xd'))[_0x302d('0xe')](socket);function respondWithRpcPromise(_0x3edf09,_0x5a1d82,_0x4b1fbb){return new BPromise(function(_0x40ddac,_0x39a42f){return client['request'](_0x3edf09,_0x4b1fbb)[_0x302d('0xf')](function(_0x802856){logger[_0x302d('0x10')](_0x302d('0x11'),_0x5a1d82,'request\x20sent');logger[_0x302d('0x12')](_0x302d('0x13'),_0x5a1d82,_0x302d('0x14'),JSON[_0x302d('0x15')](_0x802856));if(_0x802856[_0x302d('0x16')]){if(_0x802856[_0x302d('0x16')][_0x302d('0x17')]===0x1f4){logger[_0x302d('0x16')](_0x302d('0x11'),_0x5a1d82,_0x802856[_0x302d('0x16')][_0x302d('0x18')]);return _0x39a42f(_0x802856[_0x302d('0x16')][_0x302d('0x18')]);}logger['error'](_0x302d('0x11'),_0x5a1d82,_0x802856['error'][_0x302d('0x18')]);return _0x40ddac(_0x802856[_0x302d('0x16')]['message']);}else{logger[_0x302d('0x10')](_0x302d('0x11'),_0x5a1d82,_0x302d('0x14'));_0x40ddac(_0x802856[_0x302d('0x19')][_0x302d('0x18')]);}})[_0x302d('0x1a')](function(_0x33c966){logger[_0x302d('0x16')](_0x302d('0x11'),_0x5a1d82,_0x33c966);_0x39a42f(_0x33c966);});});} \ No newline at end of file +var _0x5da9=['info','request\x20sent','debug','stringify','error','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x26e572,_0x51d21c){var _0x1a68ae=function(_0x3187a2){while(--_0x3187a2){_0x26e572['push'](_0x26e572['shift']());}};_0x1a68ae(++_0x51d21c);}(_0x5da9,0x11b));var _0x95da=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x5da9[_0x48a96f];return _0x3ff3ef;};'use strict';var _=require(_0x95da('0x0'));var util=require(_0x95da('0x1'));var moment=require(_0x95da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95da('0x3'));var db=require(_0x95da('0x4'))['db'];var utils=require(_0x95da('0x5'));var logger=require('../../config/logger')(_0x95da('0x6'));var config=require('../../config/environment');var jayson=require(_0x95da('0x7'));var client=jayson[_0x95da('0x8')][_0x95da('0x9')]({'port':0x232a});config[_0x95da('0xa')]=_[_0x95da('0xb')](config[_0x95da('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x95da('0xc'))(new Redis(config[_0x95da('0xa')]));require(_0x95da('0xd'))[_0x95da('0xe')](socket);function respondWithRpcPromise(_0x41ac64,_0x45cc5f,_0x478e41){return new BPromise(function(_0x2520e4,_0x3a0be7){return client[_0x95da('0xf')](_0x41ac64,_0x478e41)[_0x95da('0x10')](function(_0x1a3dfe){logger[_0x95da('0x11')]('DashboardItem,\x20%s,\x20%s',_0x45cc5f,_0x95da('0x12'));logger[_0x95da('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x45cc5f,'request\x20sent',JSON[_0x95da('0x14')](_0x1a3dfe));if(_0x1a3dfe['error']){if(_0x1a3dfe[_0x95da('0x15')]['code']===0x1f4){logger[_0x95da('0x15')](_0x95da('0x16'),_0x45cc5f,_0x1a3dfe['error']['message']);return _0x3a0be7(_0x1a3dfe[_0x95da('0x15')][_0x95da('0x17')]);}logger[_0x95da('0x15')]('DashboardItem,\x20%s,\x20%s',_0x45cc5f,_0x1a3dfe[_0x95da('0x15')][_0x95da('0x17')]);return _0x2520e4(_0x1a3dfe[_0x95da('0x15')]['message']);}else{logger['info'](_0x95da('0x16'),_0x45cc5f,_0x95da('0x12'));_0x2520e4(_0x1a3dfe['result'][_0x95da('0x17')]);}})[_0x95da('0x18')](function(_0x5aede7){logger[_0x95da('0x15')](_0x95da('0x16'),_0x45cc5f,_0x5aede7);_0x3a0be7(_0x5aede7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 60d9bee..534c3be 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 _0x261f=['update','emit','removeListener','save'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0x261f,0x173));var _0xf261=function(_0xaea2de,_0x2b9d63){_0xaea2de=_0xaea2de-0x0;var _0x30e34e=_0x261f[_0xaea2de];return _0x30e34e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf261('0x0'),'remove',_0xf261('0x1')];function createListener(_0x4e4dfe,_0x576642){return function(_0x48d9a6){_0x576642[_0xf261('0x2')](_0x4e4dfe,_0x48d9a6);};}function removeListener(_0x318062,_0x5350dd){return function(){DashboardItemEvents[_0xf261('0x3')](_0x318062,_0x5350dd);};}exports['register']=function(_0x3ae1e0){for(var _0x3b1fed=0x0,_0x3b4e85=events['length'];_0x3b1fed<_0x3b4e85;_0x3b1fed++){var _0x301270=events[_0x3b1fed];var _0xa34ec4=createListener('dashboardItem:'+_0x301270,_0x3ae1e0);DashboardItemEvents['on'](_0x301270,_0xa34ec4);}}; \ No newline at end of file +var _0x66cc=['update','emit','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x4ca2dc,_0x54fc26){var _0x2f7ada=function(_0x118482){while(--_0x118482){_0x4ca2dc['push'](_0x4ca2dc['shift']());}};_0x2f7ada(++_0x54fc26);}(_0x66cc,0xbd));var _0xc66c=function(_0x467a26,_0x59aca9){_0x467a26=_0x467a26-0x0;var _0x5420e7=_0x66cc[_0x467a26];return _0x5420e7;};'use strict';var DashboardItemEvents=require(_0xc66c('0x0'));var events=[_0xc66c('0x1'),_0xc66c('0x2'),_0xc66c('0x3')];function createListener(_0x2d0c9b,_0x23b4b0){return function(_0x1c3125){_0x23b4b0[_0xc66c('0x4')](_0x2d0c9b,_0x1c3125);};}function removeListener(_0x30e464,_0x4d5cf3){return function(){DashboardItemEvents[_0xc66c('0x5')](_0x30e464,_0x4d5cf3);};}exports['register']=function(_0x57a94b){for(var _0x28da4b=0x0,_0x349046=events[_0xc66c('0x6')];_0x28da4b<_0x349046;_0x28da4b++){var _0x2ea215=events[_0x28da4b];var _0x170847=createListener(_0xc66c('0x7')+_0x2ea215,_0x57a94b);DashboardItemEvents['on'](_0x2ea215,_0x170847);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 086c01e..33ffc5a 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 _0xa773=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0xe64697,_0x226aaa){var _0x37e379=function(_0x3599fb){while(--_0x3599fb){_0xe64697['push'](_0xe64697['shift']());}};_0x37e379(++_0x226aaa);}(_0xa773,0x18c));var _0x3a77=function(_0x2f414b,_0x5103a0){_0x2f414b=_0x2f414b-0x0;var _0x2e8ac9=_0xa773[_0x2f414b];return _0x2e8ac9;};'use strict';var multer=require(_0x3a77('0x0'));var util=require('util');var path=require(_0x3a77('0x1'));var timeout=require(_0x3a77('0x2'));var express=require(_0x3a77('0x3'));var router=express[_0x3a77('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a77('0x5'));var interaction=require(_0x3a77('0x6'));var config=require(_0x3a77('0x7'));var controller=require(_0x3a77('0x8'));router[_0x3a77('0x9')](_0x3a77('0xa'),auth['isAuthenticated'](),controller[_0x3a77('0xb')]);router[_0x3a77('0xc')]('/',auth[_0x3a77('0xd')](),controller[_0x3a77('0xe')]);router[_0x3a77('0xf')](_0x3a77('0xa'),auth[_0x3a77('0xd')](),controller[_0x3a77('0x10')]);router[_0x3a77('0x11')]('/:id',auth[_0x3a77('0xd')](),controller['destroy']);module[_0x3a77('0x12')]=router; \ No newline at end of file +var _0xc079=['Router','../../config/environment','./dashboardItem.controller','/:id','show','isAuthenticated','create','put','delete','destroy','multer','util','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc079,0xda));var _0x9c07=function(_0x291fc4,_0x48a87e){_0x291fc4=_0x291fc4-0x0;var _0x547c5f=_0xc079[_0x291fc4];return _0x547c5f;};'use strict';var multer=require(_0x9c07('0x0'));var util=require(_0x9c07('0x1'));var path=require(_0x9c07('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c07('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c07('0x4'));var controller=require(_0x9c07('0x5'));router['get'](_0x9c07('0x6'),auth['isAuthenticated'](),controller[_0x9c07('0x7')]);router['post']('/',auth[_0x9c07('0x8')](),controller[_0x9c07('0x9')]);router[_0x9c07('0xa')](_0x9c07('0x6'),auth[_0x9c07('0x8')](),controller['update']);router[_0x9c07('0xb')](_0x9c07('0x6'),auth[_0x9c07('0x8')](),controller[_0x9c07('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 3369f29..3c059d8 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 _0xfe77=['second','third','sequelize','exports','STRING','ENUM'];(function(_0x5edf10,_0x3b1632){var _0x1f6018=function(_0xa37fa2){while(--_0xa37fa2){_0x5edf10['push'](_0x5edf10['shift']());}};_0x1f6018(++_0x3b1632);}(_0xfe77,0xb6));var _0x7fe7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe77[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fe7('0x0'));module[_0x7fe7('0x1')]={'name':{'type':Sequelize[_0x7fe7('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7fe7('0x3')]('first',_0x7fe7('0x4'),_0x7fe7('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7fe7('0x2')]}}; \ No newline at end of file +var _0xa31c=['exports','ENUM','first','second','third','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa31c,0x1b5));var _0xca31=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0xa31c[_0x26a10d];return _0xf90201;};'use strict';var Sequelize=require(_0xca31('0x0'));module[_0xca31('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xca31('0x2')](_0xca31('0x3'),_0xca31('0x4'),_0xca31('0x5')),'allowNull':![],'defaultValue':_0xca31('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index bacd854..cd2ebbe 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 _0xbc37=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','Disposition','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../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','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index'];(function(_0x980374,_0x1e0751){var _0x402d6a=function(_0x5d9a7d){while(--_0x5d9a7d){_0x980374['push'](_0x980374['shift']());}};_0x402d6a(++_0x1e0751);}(_0xbc37,0x11a));var _0x7bc3=function(_0xb02d52,_0x3107aa){_0xb02d52=_0xb02d52-0x0;var _0x37ce22=_0xbc37[_0xb02d52];return _0x37ce22;};'use strict';var emlformat=require(_0x7bc3('0x0'));var rimraf=require(_0x7bc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bc3('0x2'));var rp=require(_0x7bc3('0x3'));var moment=require(_0x7bc3('0x4'));var BPromise=require(_0x7bc3('0x5'));var Mustache=require('mustache');var util=require(_0x7bc3('0x6'));var path=require(_0x7bc3('0x7'));var sox=require(_0x7bc3('0x8'));var csv=require(_0x7bc3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bc3('0xa'));var _=require('lodash');var squel=require(_0x7bc3('0xb'));var crypto=require(_0x7bc3('0xc'));var jsforce=require(_0x7bc3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7bc3('0x9'));var querystring=require(_0x7bc3('0xe'));var Papa=require(_0x7bc3('0xf'));var Redis=require(_0x7bc3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7bc3('0x11'));var hardwareService=require(_0x7bc3('0x12'));var logger=require(_0x7bc3('0x13'))(_0x7bc3('0x14'));var utils=require(_0x7bc3('0x15'));var config=require(_0x7bc3('0x16'));var licenseUtil=require(_0x7bc3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50b00c,_0x17e70b){_0x17e70b=_0x17e70b||0xcc;return function(_0x32cf44){if(_0x32cf44){return _0x50b00c[_0x7bc3('0x18')](_0x17e70b);}return _0x50b00c[_0x7bc3('0x19')](_0x17e70b)[_0x7bc3('0x1a')]();};}function respondWithResult(_0x4d5e7d,_0x8a8271){_0x8a8271=_0x8a8271||0xc8;return function(_0x205b68){if(_0x205b68){return _0x4d5e7d[_0x7bc3('0x19')](_0x8a8271)[_0x7bc3('0x1b')](_0x205b68);}};}function respondWithFilteredResult(_0x133a3a,_0x2af17b){return function(_0x50577c){if(_0x50577c){var _0x380f70=typeof _0x2af17b[_0x7bc3('0x1c')]===_0x7bc3('0x1d')&&typeof _0x2af17b[_0x7bc3('0x1e')]==='undefined';var _0x37c641=_0x50577c[_0x7bc3('0x1f')];var _0x45c21b=_0x380f70?0x0:_0x2af17b['offset'];var _0xbac936=_0x380f70?_0x50577c[_0x7bc3('0x1f')]:_0x2af17b[_0x7bc3('0x1c')]+_0x2af17b[_0x7bc3('0x1e')];var _0x4ba2bd;if(_0xbac936>=_0x37c641){_0xbac936=_0x37c641;_0x4ba2bd=0xc8;}else{_0x4ba2bd=0xce;}_0x133a3a[_0x7bc3('0x19')](_0x4ba2bd);return _0x133a3a[_0x7bc3('0x20')]('Content-Range',_0x45c21b+'-'+_0xbac936+'/'+_0x37c641)[_0x7bc3('0x1b')](_0x50577c);}return null;};}function patchUpdates(_0x1aaba7){return function(_0x34ea66){try{jsonpatch[_0x7bc3('0x21')](_0x34ea66,_0x1aaba7,!![]);}catch(_0x1723dc){return BPromise[_0x7bc3('0x22')](_0x1723dc);}return _0x34ea66['save']();};}function saveUpdates(_0x4ad53d,_0xdd1d8e){return function(_0x1b95ed){if(_0x1b95ed){return _0x1b95ed[_0x7bc3('0x23')](_0x4ad53d)[_0x7bc3('0x24')](function(_0x4300ad){return _0x4300ad;});}return null;};}function removeEntity(_0x293a64,_0x2edfc3){return function(_0x5debf4){if(_0x5debf4){return _0x5debf4[_0x7bc3('0x25')]()[_0x7bc3('0x24')](function(){var _0x2d84f6=_0x5debf4[_0x7bc3('0x26')]({'plain':!![]});var _0x3a3a03=_0x7bc3('0x27');return db[_0x7bc3('0x28')][_0x7bc3('0x25')]({'where':{'type':_0x3a3a03,'resourceId':_0x2d84f6['id']}})['then'](function(){return _0x5debf4;});})[_0x7bc3('0x24')](function(){_0x293a64[_0x7bc3('0x19')](0xcc)[_0x7bc3('0x1a')]();});}};}function handleEntityNotFound(_0x34907d,_0x526fd6){return function(_0x34fbd6){if(!_0x34fbd6){_0x34907d[_0x7bc3('0x18')](0x194);}return _0x34fbd6;};}function handleError(_0x3eb9db,_0xd74d45){_0xd74d45=_0xd74d45||0x1f4;return function(_0x446f6a){logger[_0x7bc3('0x29')](_0x446f6a[_0x7bc3('0x2a')]);if(_0x446f6a[_0x7bc3('0x2b')]){delete _0x446f6a[_0x7bc3('0x2b')];}_0x3eb9db[_0x7bc3('0x19')](_0xd74d45)[_0x7bc3('0x2c')](_0x446f6a);};}exports[_0x7bc3('0x2d')]=function(_0x2248e6,_0x518bcb){var _0xa41cb={},_0x521c94={},_0x4c3357={'count':0x0,'rows':[]};var _0x11040c=_[_0x7bc3('0x2e')](db['Disposition']['rawAttributes'],function(_0x22337e){return{'name':_0x22337e[_0x7bc3('0x2f')],'type':_0x22337e[_0x7bc3('0x30')][_0x7bc3('0x31')]};});_0x521c94[_0x7bc3('0x32')]=_['map'](_0x11040c,_0x7bc3('0x2b'));_0x521c94[_0x7bc3('0x33')]=_[_0x7bc3('0x34')](_0x2248e6['query']);_0x521c94[_0x7bc3('0x35')]=_[_0x7bc3('0x36')](_0x521c94[_0x7bc3('0x32')],_0x521c94['query']);_0xa41cb[_0x7bc3('0x37')]=_[_0x7bc3('0x36')](_0x521c94[_0x7bc3('0x32')],qs[_0x7bc3('0x38')](_0x2248e6['query'][_0x7bc3('0x38')]));_0xa41cb['attributes']=_0xa41cb[_0x7bc3('0x37')][_0x7bc3('0x39')]?_0xa41cb['attributes']:_0x521c94[_0x7bc3('0x32')];if(!_0x2248e6[_0x7bc3('0x33')][_0x7bc3('0x3a')](_0x7bc3('0x3b'))){_0xa41cb[_0x7bc3('0x1e')]=qs[_0x7bc3('0x1e')](_0x2248e6[_0x7bc3('0x33')]['limit']);_0xa41cb[_0x7bc3('0x1c')]=qs[_0x7bc3('0x1c')](_0x2248e6[_0x7bc3('0x33')]['offset']);}_0xa41cb['order']=qs[_0x7bc3('0x3c')](_0x2248e6['query'][_0x7bc3('0x3c')]);_0xa41cb[_0x7bc3('0x3d')]=qs[_0x7bc3('0x35')](_['pick'](_0x2248e6[_0x7bc3('0x33')],_0x521c94['filters']),_0x11040c);if(_0x2248e6[_0x7bc3('0x33')][_0x7bc3('0x3e')]){_0xa41cb['where']=_[_0x7bc3('0x3f')](_0xa41cb[_0x7bc3('0x3d')],{'$or':_[_0x7bc3('0x2e')](_0x11040c,function(_0x344423){if(_0x344423[_0x7bc3('0x30')]!==_0x7bc3('0x40')){var _0x137724={};_0x137724[_0x344423[_0x7bc3('0x2b')]]={'$like':'%'+_0x2248e6[_0x7bc3('0x33')][_0x7bc3('0x3e')]+'%'};return _0x137724;}})});}_0xa41cb=_['merge']({},_0xa41cb,_0x2248e6[_0x7bc3('0x41')]);var _0x416a0c={'where':_0xa41cb[_0x7bc3('0x3d')]};return db['Disposition'][_0x7bc3('0x1f')](_0x416a0c)[_0x7bc3('0x24')](function(_0x5a1c3a){_0x4c3357[_0x7bc3('0x1f')]=_0x5a1c3a;if(_0x2248e6[_0x7bc3('0x33')]['includeAll']){_0xa41cb[_0x7bc3('0x42')]=[{'all':!![]}];}return db[_0x7bc3('0x43')]['findAll'](_0xa41cb);})['then'](function(_0x204f8e){_0x4c3357[_0x7bc3('0x44')]=_0x204f8e;return _0x4c3357;})['then'](respondWithFilteredResult(_0x518bcb,_0xa41cb))['catch'](handleError(_0x518bcb,null));};exports[_0x7bc3('0x45')]=function(_0x28d8a6,_0x301abb){var _0x5a11f9={'raw':!![],'where':{'id':_0x28d8a6[_0x7bc3('0x46')]['id']}},_0x42060c={};_0x42060c[_0x7bc3('0x32')]=_[_0x7bc3('0x34')](db[_0x7bc3('0x43')][_0x7bc3('0x47')]);_0x42060c[_0x7bc3('0x33')]=_[_0x7bc3('0x34')](_0x28d8a6[_0x7bc3('0x33')]);_0x42060c['filters']=_['intersection'](_0x42060c['model'],_0x42060c[_0x7bc3('0x33')]);_0x5a11f9[_0x7bc3('0x37')]=_[_0x7bc3('0x36')](_0x42060c[_0x7bc3('0x32')],qs[_0x7bc3('0x38')](_0x28d8a6[_0x7bc3('0x33')][_0x7bc3('0x38')]));_0x5a11f9[_0x7bc3('0x37')]=_0x5a11f9[_0x7bc3('0x37')]['length']?_0x5a11f9[_0x7bc3('0x37')]:_0x42060c['model'];if(_0x28d8a6[_0x7bc3('0x33')][_0x7bc3('0x48')]){_0x5a11f9['include']=[{'all':!![]}];}_0x5a11f9=_['merge']({},_0x5a11f9,_0x28d8a6[_0x7bc3('0x41')]);return db[_0x7bc3('0x43')][_0x7bc3('0x49')](_0x5a11f9)[_0x7bc3('0x24')](handleEntityNotFound(_0x301abb,null))['then'](respondWithResult(_0x301abb,null))[_0x7bc3('0x4a')](handleError(_0x301abb,null));};exports[_0x7bc3('0x4b')]=function(_0x3bdaca,_0x298c5d){return db[_0x7bc3('0x43')][_0x7bc3('0x4b')](_0x3bdaca[_0x7bc3('0x4c')],{})[_0x7bc3('0x24')](function(_0x14cc54){var _0x5a8927=_0x3bdaca[_0x7bc3('0x4d')][_0x7bc3('0x26')]({'plain':!![]});if(!_0x5a8927)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a8927[_0x7bc3('0x4e')]==='user'){var _0x416c61=_0x14cc54['get']({'plain':!![]});var _0x29043a=_0x7bc3('0x27');return db[_0x7bc3('0x4f')][_0x7bc3('0x49')]({'where':{'name':_0x29043a,'userProfileId':_0x5a8927['userProfileId']},'raw':!![]})[_0x7bc3('0x24')](function(_0x50d378){if(_0x50d378&&_0x50d378[_0x7bc3('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x416c61[_0x7bc3('0x2b')],'resourceId':_0x416c61['id'],'type':_0x50d378[_0x7bc3('0x2b')],'sectionId':_0x50d378['id']},{})[_0x7bc3('0x24')](function(){return _0x14cc54;});}else{return _0x14cc54;}})[_0x7bc3('0x4a')](function(_0x3d9052){logger[_0x7bc3('0x29')](_0x7bc3('0x51'),_0x3d9052);throw _0x3d9052;});}return _0x14cc54;})[_0x7bc3('0x24')](respondWithResult(_0x298c5d,0xc9))['catch'](handleError(_0x298c5d,null));};exports[_0x7bc3('0x23')]=function(_0x36c114,_0x102a6b){if(_0x36c114[_0x7bc3('0x4c')]['id']){delete _0x36c114[_0x7bc3('0x4c')]['id'];}return db['Disposition'][_0x7bc3('0x49')]({'where':{'id':_0x36c114[_0x7bc3('0x46')]['id']}})[_0x7bc3('0x24')](handleEntityNotFound(_0x102a6b,null))[_0x7bc3('0x24')](saveUpdates(_0x36c114[_0x7bc3('0x4c')],null))[_0x7bc3('0x24')](respondWithResult(_0x102a6b,null))['catch'](handleError(_0x102a6b,null));};exports['destroy']=function(_0x5166fc,_0x218207){return db[_0x7bc3('0x43')][_0x7bc3('0x49')]({'where':{'id':_0x5166fc['params']['id']}})[_0x7bc3('0x24')](handleEntityNotFound(_0x218207,null))[_0x7bc3('0x24')](removeEntity(_0x218207,null))[_0x7bc3('0x4a')](handleError(_0x218207,null));}; \ No newline at end of file +var _0xfd48=['hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','end','error','name','map','Disposition','fieldName','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xfd48,0x168));var _0x8fd4=function(_0x398d0d,_0xc386ff){_0x398d0d=_0x398d0d-0x0;var _0x1eb3b0=_0xfd48[_0x398d0d];return _0x1eb3b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd4('0x0'));var zipdir=require(_0x8fd4('0x1'));var jsonpatch=require(_0x8fd4('0x2'));var rp=require(_0x8fd4('0x3'));var moment=require(_0x8fd4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fd4('0x5'));var util=require('util');var path=require(_0x8fd4('0x6'));var sox=require(_0x8fd4('0x7'));var csv=require(_0x8fd4('0x8'));var ejs=require(_0x8fd4('0x9'));var fs=require('fs');var fs_extra=require(_0x8fd4('0xa'));var _=require('lodash');var squel=require(_0x8fd4('0xb'));var crypto=require(_0x8fd4('0xc'));var jsforce=require(_0x8fd4('0xd'));var deskjs=require(_0x8fd4('0xe'));var toCsv=require(_0x8fd4('0x8'));var querystring=require(_0x8fd4('0xf'));var Papa=require(_0x8fd4('0x10'));var Redis=require(_0x8fd4('0x11'));var authService=require(_0x8fd4('0x12'));var qs=require(_0x8fd4('0x13'));var as=require(_0x8fd4('0x14'));var hardwareService=require(_0x8fd4('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8fd4('0x16'));var licenseUtil=require(_0x8fd4('0x17'));var db=require(_0x8fd4('0x18'))['db'];function respondWithStatusCode(_0xf0e080,_0x36bc96){_0x36bc96=_0x36bc96||0xcc;return function(_0x5bcf00){if(_0x5bcf00){return _0xf0e080[_0x8fd4('0x19')](_0x36bc96);}return _0xf0e080[_0x8fd4('0x1a')](_0x36bc96)['end']();};}function respondWithResult(_0x240331,_0x11423a){_0x11423a=_0x11423a||0xc8;return function(_0x4691b0){if(_0x4691b0){return _0x240331['status'](_0x11423a)['json'](_0x4691b0);}};}function respondWithFilteredResult(_0x52efe7,_0x3bebba){return function(_0x2307d3){if(_0x2307d3){var _0x118ce7=typeof _0x3bebba['offset']===_0x8fd4('0x1b')&&typeof _0x3bebba[_0x8fd4('0x1c')]==='undefined';var _0x4ce30f=_0x2307d3[_0x8fd4('0x1d')];var _0x1de077=_0x118ce7?0x0:_0x3bebba[_0x8fd4('0x1e')];var _0x43c66e=_0x118ce7?_0x2307d3[_0x8fd4('0x1d')]:_0x3bebba[_0x8fd4('0x1e')]+_0x3bebba[_0x8fd4('0x1c')];var _0x4a7958;if(_0x43c66e>=_0x4ce30f){_0x43c66e=_0x4ce30f;_0x4a7958=0xc8;}else{_0x4a7958=0xce;}_0x52efe7['status'](_0x4a7958);return _0x52efe7[_0x8fd4('0x1f')](_0x8fd4('0x20'),_0x1de077+'-'+_0x43c66e+'/'+_0x4ce30f)[_0x8fd4('0x21')](_0x2307d3);}return null;};}function patchUpdates(_0x30fe18){return function(_0x3e2bc5){try{jsonpatch[_0x8fd4('0x22')](_0x3e2bc5,_0x30fe18,!![]);}catch(_0x40bdb4){return BPromise[_0x8fd4('0x23')](_0x40bdb4);}return _0x3e2bc5['save']();};}function saveUpdates(_0x3b1be5,_0x54359a){return function(_0x410fec){if(_0x410fec){return _0x410fec[_0x8fd4('0x24')](_0x3b1be5)[_0x8fd4('0x25')](function(_0x140358){return _0x140358;});}return null;};}function removeEntity(_0x33fccb,_0x117ef2){return function(_0x541534){if(_0x541534){return _0x541534[_0x8fd4('0x26')]()[_0x8fd4('0x25')](function(){var _0x30f645=_0x541534[_0x8fd4('0x27')]({'plain':!![]});var _0xc5777a=_0x8fd4('0x28');return db[_0x8fd4('0x29')]['destroy']({'where':{'type':_0xc5777a,'resourceId':_0x30f645['id']}})['then'](function(){return _0x541534;});})[_0x8fd4('0x25')](function(){_0x33fccb[_0x8fd4('0x1a')](0xcc)[_0x8fd4('0x2a')]();});}};}function handleEntityNotFound(_0x46f1b7,_0x2f09ce){return function(_0x20e33d){if(!_0x20e33d){_0x46f1b7[_0x8fd4('0x19')](0x194);}return _0x20e33d;};}function handleError(_0x3cc5ab,_0x5b0fd0){_0x5b0fd0=_0x5b0fd0||0x1f4;return function(_0x1bcd53){logger[_0x8fd4('0x2b')](_0x1bcd53['stack']);if(_0x1bcd53[_0x8fd4('0x2c')]){delete _0x1bcd53[_0x8fd4('0x2c')];}_0x3cc5ab[_0x8fd4('0x1a')](_0x5b0fd0)['send'](_0x1bcd53);};}exports['index']=function(_0xc73996,_0x56b493){var _0x331864={},_0xd993c4={},_0x19dd98={'count':0x0,'rows':[]};var _0xbb533c=_[_0x8fd4('0x2d')](db[_0x8fd4('0x2e')]['rawAttributes'],function(_0x5d6c6d){return{'name':_0x5d6c6d[_0x8fd4('0x2f')],'type':_0x5d6c6d['type']['key']};});_0xd993c4['model']=_[_0x8fd4('0x2d')](_0xbb533c,_0x8fd4('0x2c'));_0xd993c4[_0x8fd4('0x30')]=_[_0x8fd4('0x31')](_0xc73996[_0x8fd4('0x30')]);_0xd993c4[_0x8fd4('0x32')]=_[_0x8fd4('0x33')](_0xd993c4[_0x8fd4('0x34')],_0xd993c4[_0x8fd4('0x30')]);_0x331864[_0x8fd4('0x35')]=_[_0x8fd4('0x33')](_0xd993c4[_0x8fd4('0x34')],qs[_0x8fd4('0x36')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x36')]));_0x331864['attributes']=_0x331864[_0x8fd4('0x35')]['length']?_0x331864[_0x8fd4('0x35')]:_0xd993c4[_0x8fd4('0x34')];if(!_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x37')](_0x8fd4('0x38'))){_0x331864[_0x8fd4('0x1c')]=qs[_0x8fd4('0x1c')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x1c')]);_0x331864[_0x8fd4('0x1e')]=qs[_0x8fd4('0x1e')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x1e')]);}_0x331864[_0x8fd4('0x39')]=qs[_0x8fd4('0x3a')](_0xc73996['query'][_0x8fd4('0x3a')]);_0x331864['where']=qs[_0x8fd4('0x32')](_['pick'](_0xc73996[_0x8fd4('0x30')],_0xd993c4['filters']),_0xbb533c);if(_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x3b')]){_0x331864[_0x8fd4('0x3c')]=_[_0x8fd4('0x3d')](_0x331864[_0x8fd4('0x3c')],{'$or':_[_0x8fd4('0x2d')](_0xbb533c,function(_0x4dc58d){if(_0x4dc58d[_0x8fd4('0x3e')]!==_0x8fd4('0x3f')){var _0xe6215d={};_0xe6215d[_0x4dc58d['name']]={'$like':'%'+_0xc73996['query']['filter']+'%'};return _0xe6215d;}})});}_0x331864=_[_0x8fd4('0x3d')]({},_0x331864,_0xc73996[_0x8fd4('0x40')]);var _0x12f30e={'where':_0x331864[_0x8fd4('0x3c')]};return db[_0x8fd4('0x2e')]['count'](_0x12f30e)[_0x8fd4('0x25')](function(_0x3af3da){_0x19dd98['count']=_0x3af3da;if(_0xc73996['query'][_0x8fd4('0x41')]){_0x331864[_0x8fd4('0x42')]=[{'all':!![]}];}return db[_0x8fd4('0x2e')][_0x8fd4('0x43')](_0x331864);})[_0x8fd4('0x25')](function(_0x17862a){_0x19dd98[_0x8fd4('0x44')]=_0x17862a;return _0x19dd98;})[_0x8fd4('0x25')](respondWithFilteredResult(_0x56b493,_0x331864))[_0x8fd4('0x45')](handleError(_0x56b493,null));};exports[_0x8fd4('0x46')]=function(_0x43fe61,_0x354d16){var _0x3a4a1d={'raw':!![],'where':{'id':_0x43fe61[_0x8fd4('0x47')]['id']}},_0x15f9ca={};_0x15f9ca[_0x8fd4('0x34')]=_[_0x8fd4('0x31')](db[_0x8fd4('0x2e')]['rawAttributes']);_0x15f9ca[_0x8fd4('0x30')]=_['keys'](_0x43fe61[_0x8fd4('0x30')]);_0x15f9ca[_0x8fd4('0x32')]=_[_0x8fd4('0x33')](_0x15f9ca[_0x8fd4('0x34')],_0x15f9ca[_0x8fd4('0x30')]);_0x3a4a1d[_0x8fd4('0x35')]=_['intersection'](_0x15f9ca[_0x8fd4('0x34')],qs[_0x8fd4('0x36')](_0x43fe61['query'][_0x8fd4('0x36')]));_0x3a4a1d[_0x8fd4('0x35')]=_0x3a4a1d[_0x8fd4('0x35')][_0x8fd4('0x48')]?_0x3a4a1d[_0x8fd4('0x35')]:_0x15f9ca[_0x8fd4('0x34')];if(_0x43fe61[_0x8fd4('0x30')][_0x8fd4('0x41')]){_0x3a4a1d[_0x8fd4('0x42')]=[{'all':!![]}];}_0x3a4a1d=_['merge']({},_0x3a4a1d,_0x43fe61['options']);return db['Disposition']['find'](_0x3a4a1d)[_0x8fd4('0x25')](handleEntityNotFound(_0x354d16,null))[_0x8fd4('0x25')](respondWithResult(_0x354d16,null))['catch'](handleError(_0x354d16,null));};exports['create']=function(_0x5ce0d9,_0x3f1cd1){return db[_0x8fd4('0x2e')][_0x8fd4('0x49')](_0x5ce0d9[_0x8fd4('0x4a')],{})['then'](function(_0x1f93e1){var _0x69c57c=_0x5ce0d9[_0x8fd4('0x4b')]['get']({'plain':!![]});if(!_0x69c57c)throw new Error(_0x8fd4('0x4c'));if(_0x69c57c[_0x8fd4('0x4d')]===_0x8fd4('0x4b')){var _0x3fccfc=_0x1f93e1[_0x8fd4('0x27')]({'plain':!![]});var _0x19f296='Dispositions';return db[_0x8fd4('0x4e')][_0x8fd4('0x4f')]({'where':{'name':_0x19f296,'userProfileId':_0x69c57c[_0x8fd4('0x50')]},'raw':!![]})[_0x8fd4('0x25')](function(_0x752eec){if(_0x752eec&&_0x752eec[_0x8fd4('0x51')]===0x0){return db[_0x8fd4('0x29')][_0x8fd4('0x49')]({'name':_0x3fccfc[_0x8fd4('0x2c')],'resourceId':_0x3fccfc['id'],'type':_0x752eec[_0x8fd4('0x2c')],'sectionId':_0x752eec['id']},{})[_0x8fd4('0x25')](function(){return _0x1f93e1;});}else{return _0x1f93e1;}})[_0x8fd4('0x45')](function(_0x3590be){logger[_0x8fd4('0x2b')](_0x8fd4('0x52'),_0x3590be);throw _0x3590be;});}return _0x1f93e1;})[_0x8fd4('0x25')](respondWithResult(_0x3f1cd1,0xc9))[_0x8fd4('0x45')](handleError(_0x3f1cd1,null));};exports[_0x8fd4('0x24')]=function(_0x462506,_0x592cab){if(_0x462506[_0x8fd4('0x4a')]['id']){delete _0x462506[_0x8fd4('0x4a')]['id'];}return db[_0x8fd4('0x2e')][_0x8fd4('0x4f')]({'where':{'id':_0x462506['params']['id']}})['then'](handleEntityNotFound(_0x592cab,null))['then'](saveUpdates(_0x462506[_0x8fd4('0x4a')],null))[_0x8fd4('0x25')](respondWithResult(_0x592cab,null))[_0x8fd4('0x45')](handleError(_0x592cab,null));};exports[_0x8fd4('0x26')]=function(_0x2c636b,_0x4fc05a){return db['Disposition'][_0x8fd4('0x4f')]({'where':{'id':_0x2c636b[_0x8fd4('0x47')]['id']}})[_0x8fd4('0x25')](handleEntityNotFound(_0x4fc05a,null))['then'](removeEntity(_0x4fc05a,null))['catch'](handleError(_0x4fc05a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cbc55aa..904c57b 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 _0x1159=['moment','bluebird','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','name_mail','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','api'];(function(_0x3260f3,_0x3ea3ec){var _0x1f5034=function(_0x2c6505){while(--_0x2c6505){_0x3260f3['push'](_0x3260f3['shift']());}};_0x1f5034(++_0x3ea3ec);}(_0x1159,0xba));var _0x9115=function(_0x58187e,_0x59d0cc){_0x58187e=_0x58187e-0x0;var _0xf3fc20=_0x1159[_0x58187e];return _0xf3fc20;};'use strict';var _=require(_0x9115('0x0'));var util=require(_0x9115('0x1'));var logger=require('../../config/logger')(_0x9115('0x2'));var moment=require(_0x9115('0x3'));var BPromise=require(_0x9115('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require('rimraf');var config=require(_0x9115('0x6'));var attributes=require(_0x9115('0x7'));module[_0x9115('0x8')]=function(_0x12f18a,_0x21728b){return _0x12f18a[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9115('0xc'),'fields':['name',_0x9115('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x9115('0xe'),_0x9115('0xf')]},{'unique':!![],'name':_0x9115('0x10'),'fields':[_0x9115('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x9115('0xe'),_0x9115('0x11')]},{'unique':!![],'name':_0x9115('0x12'),'fields':[_0x9115('0xe'),_0x9115('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x9115('0xe'),_0x9115('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2787=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger'];(function(_0x3ed4da,_0x2a4fdd){var _0x5b7f61=function(_0x164c4d){while(--_0x164c4d){_0x3ed4da['push'](_0x3ed4da['shift']());}};_0x5b7f61(++_0x2a4fdd);}(_0x2787,0x15e));var _0x7278=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2787[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7278('0x0'));var util=require('util');var logger=require(_0x7278('0x1'))('api');var moment=require(_0x7278('0x2'));var BPromise=require(_0x7278('0x3'));var rp=require(_0x7278('0x4'));var fs=require('fs');var path=require(_0x7278('0x5'));var rimraf=require(_0x7278('0x6'));var config=require(_0x7278('0x7'));var attributes=require('./disposition.attributes');module[_0x7278('0x8')]=function(_0x38b897,_0x4e5598){return _0x38b897[_0x7278('0x9')](_0x7278('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x7278('0xb'),'fields':[_0x7278('0xc'),_0x7278('0xd')]},{'unique':!![],'name':_0x7278('0xe'),'fields':[_0x7278('0xc'),_0x7278('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x7278('0xc'),_0x7278('0x10')]},{'unique':!![],'name':_0x7278('0x11'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0x7278('0x12'),'fields':['name',_0x7278('0x13')]},{'unique':!![],'name':_0x7278('0x14'),'fields':['name',_0x7278('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 805a75e..d476383 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(_0x39ef9e,_0x561f09){var _0x347c89=function(_0x1d2f02){while(--_0x1d2f02){_0x39ef9e['push'](_0x39ef9e['shift']());}};_0x347c89(++_0x561f09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x957ba8,_0x17dadc){var _0x50caee=function(_0x3d0e13){while(--_0x3d0e13){_0x957ba8['push'](_0x957ba8['shift']());}};_0x50caee(++_0x17dadc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 52c95ae..ba7daa1 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 _0x0d84=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x64106,_0xd6dff1){var _0x337970=function(_0x1576d0){while(--_0x1576d0){_0x64106['push'](_0x64106['shift']());}};_0x337970(++_0xd6dff1);}(_0x0d84,0x115));var _0x40d8=function(_0x25a0b7,_0x5b208f){_0x25a0b7=_0x25a0b7-0x0;var _0x1f6baf=_0x0d84[_0x25a0b7];return _0x1f6baf;};'use strict';var multer=require(_0x40d8('0x0'));var util=require(_0x40d8('0x1'));var path=require(_0x40d8('0x2'));var timeout=require(_0x40d8('0x3'));var express=require(_0x40d8('0x4'));var router=express[_0x40d8('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x40d8('0x6'));var controller=require('./disposition.controller');router['get']('/',auth[_0x40d8('0x7')](),controller[_0x40d8('0x8')]);router['get'](_0x40d8('0x9'),auth[_0x40d8('0x7')](),controller[_0x40d8('0xa')]);router[_0x40d8('0xb')]('/',auth[_0x40d8('0x7')](),controller[_0x40d8('0xc')]);router['put'](_0x40d8('0x9'),auth['isAuthenticated'](),controller[_0x40d8('0xd')]);router[_0x40d8('0xe')](_0x40d8('0x9'),auth[_0x40d8('0x7')](),controller[_0x40d8('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3a12=['./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x3a12,0xb7));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x23a1('0x0'));var path=require(_0x23a1('0x1'));var timeout=require('connect-timeout');var express=require(_0x23a1('0x2'));var router=express[_0x23a1('0x3')]();var fs_extra=require(_0x23a1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x23a1('0x5'));var config=require(_0x23a1('0x6'));var controller=require(_0x23a1('0x7'));router[_0x23a1('0x8')]('/',auth[_0x23a1('0x9')](),controller[_0x23a1('0xa')]);router['get'](_0x23a1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x23a1('0xc')]('/',auth[_0x23a1('0x9')](),controller[_0x23a1('0xd')]);router[_0x23a1('0xe')](_0x23a1('0xb'),auth['isAuthenticated'](),controller[_0x23a1('0xf')]);router[_0x23a1('0x10')]('/:id',auth[_0x23a1('0x9')](),controller[_0x23a1('0x11')]);module[_0x23a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f20a8e5..e5b1b50 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 _0x1294=['7200','9600','12000','14400','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x2b84b8,_0x172458){var _0xaa5941=function(_0xabc90c){while(--_0xabc90c){_0x2b84b8['push'](_0x2b84b8['shift']());}};_0xaa5941(++_0x172458);}(_0x1294,0xb8));var _0x4129=function(_0x32faa6,_0x231c1f){_0x32faa6=_0x32faa6-0x0;var _0x1526dd=_0x1294[_0x32faa6];return _0x1526dd;};'use strict';var Sequelize=require(_0x4129('0x0'));module['exports']={'name':{'type':Sequelize[_0x4129('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4129('0x2')](_0x4129('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x4129('0x1')],'defaultValue':_0x4129('0x4')},'localstationid':{'type':Sequelize[_0x4129('0x1')],'unique':_0x4129('0x5')},'minrate':{'type':Sequelize[_0x4129('0x2')](_0x4129('0x6'),_0x4129('0x7'),_0x4129('0x8'),_0x4129('0x9'),_0x4129('0xa'),_0x4129('0xb')),'defaultValue':_0x4129('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x4129('0x6'),_0x4129('0x7'),_0x4129('0x8'),'9600','12000',_0x4129('0xb')),'defaultValue':_0x4129('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'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['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x4129('0xc'),'IAX',_0x4129('0xd'),_0x4129('0xe')),'defaultValue':_0x4129('0xc')},'key':{'type':Sequelize[_0x4129('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4129('0xf')],'defaultValue':function(){return _0x4129('0x10');}},'notificationSound':{'type':Sequelize[_0x4129('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4129('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4129('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4129('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4129('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4129('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x4129('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4129('0x11')],'defaultValue':![],'comment':_0x4129('0x14'),'set':function(_0x37208c){if(!_0x37208c)this[_0x4129('0x15')](_0x4129('0x16'),null);this['setDataValue'](_0x4129('0x17'),_0x37208c);}}}; \ No newline at end of file +var _0x4fbd=['mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x214b03,_0x351f66){var _0x186fcb=function(_0x524981){while(--_0x524981){_0x214b03['push'](_0x214b03['shift']());}};_0x186fcb(++_0x351f66);}(_0x4fbd,0x1dc));var _0xd4fb=function(_0x37ecd8,_0x1f6e94){_0x37ecd8=_0x37ecd8-0x0;var _0x54e43d=_0x4fbd[_0x37ecd8];return _0x54e43d;};'use strict';var Sequelize=require(_0xd4fb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd4fb('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd4fb('0x1')]},'ecm':{'type':Sequelize[_0xd4fb('0x2')](_0xd4fb('0x3'),'no'),'defaultValue':_0xd4fb('0x3')},'headerinfo':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':_0xd4fb('0x4')},'localstationid':{'type':Sequelize[_0xd4fb('0x1')],'unique':_0xd4fb('0x5')},'minrate':{'type':Sequelize[_0xd4fb('0x2')]('2400',_0xd4fb('0x6'),_0xd4fb('0x7'),_0xd4fb('0x8'),_0xd4fb('0x9'),_0xd4fb('0xa')),'defaultValue':_0xd4fb('0x6')},'maxrate':{'type':Sequelize[_0xd4fb('0x2')]('2400',_0xd4fb('0x6'),_0xd4fb('0x7'),'9600',_0xd4fb('0x9'),_0xd4fb('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':_0xd4fb('0xb')},'gateway':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd4fb('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd4fb('0x2')](_0xd4fb('0xd'),_0xd4fb('0xe'),_0xd4fb('0xf'),_0xd4fb('0x10')),'defaultValue':_0xd4fb('0xd')},'key':{'type':Sequelize[_0xd4fb('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd4fb('0x11')],'defaultValue':function(){return _0xd4fb('0x12');}},'notificationSound':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd4fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd4fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd4fb('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xd4fb('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![],'comment':_0xd4fb('0x15'),'set':function(_0x28ef40){if(!_0x28ef40)this[_0xd4fb('0x16')](_0xd4fb('0x17'),null);this[_0xd4fb('0x16')](_0xd4fb('0x18'),_0x28ef40);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8586ded..fb02ff4 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 _0xfb7d=['lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','options','FaxAccount','include','findAll','catch','show','includeAll','find','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','create','findOne','nolimit','merge','rows','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addInteraction','omit','FaxInteraction','Contact','Owner','internal','Tag','Tags','color','tag','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','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','sequelize','transaction','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','defaults','List\x20not\x20found','user','out','filename','spread','ContactId','dataValues','Messages','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xfb7d,0x168));var _0xdfb7=function(_0x1e9733,_0x40d456){_0x1e9733=_0x1e9733-0x0;var _0x3e1298=_0xfb7d[_0x1e9733];return _0x3e1298;};'use strict';var emlformat=require(_0xdfb7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfb7('0x1'));var jsonpatch=require(_0xdfb7('0x2'));var rp=require(_0xdfb7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfb7('0x4'));var util=require('util');var path=require(_0xdfb7('0x5'));var sox=require(_0xdfb7('0x6'));var csv=require(_0xdfb7('0x7'));var ejs=require(_0xdfb7('0x8'));var fs=require('fs');var fs_extra=require(_0xdfb7('0x9'));var _=require(_0xdfb7('0xa'));var squel=require(_0xdfb7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdfb7('0xc'));var toCsv=require(_0xdfb7('0x7'));var querystring=require(_0xdfb7('0xd'));var Papa=require(_0xdfb7('0xe'));var Redis=require('ioredis');var authService=require(_0xdfb7('0xf'));var qs=require(_0xdfb7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfb7('0x11'))(_0xdfb7('0x12'));var utils=require(_0xdfb7('0x13'));var config=require(_0xdfb7('0x14'));var licenseUtil=require(_0xdfb7('0x15'));var db=require(_0xdfb7('0x16'))['db'];config[_0xdfb7('0x17')]=_['defaults'](config['redis'],{'host':_0xdfb7('0x18'),'port':0x18eb});var socket=require(_0xdfb7('0x19'))(new Redis(config[_0xdfb7('0x17')]));require(_0xdfb7('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdfb7('0x1b')][_0xdfb7('0x1c')]({'port':0x232c});var client9002=jayson[_0xdfb7('0x1b')][_0xdfb7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3a96b3,_0x113417,_0x3d7de3,_0x421030){return new BPromise(function(_0x2a4b82,_0x376cb9){var _0x11c7a2=_0x421030||client;return _0x11c7a2[_0xdfb7('0x1d')](_0x3a96b3,_0x3d7de3)[_0xdfb7('0x1e')](function(_0x23e6af){logger[_0xdfb7('0x1f')](_0xdfb7('0x20'),_0x113417,_0xdfb7('0x21'));logger[_0xdfb7('0x22')](_0xdfb7('0x23'),_0x113417,_0xdfb7('0x21'),JSON[_0xdfb7('0x24')](_0x23e6af));if(_0x23e6af['error']){if(_0x23e6af[_0xdfb7('0x25')]['code']===0x1f4){logger[_0xdfb7('0x25')](_0xdfb7('0x20'),_0x113417,_0x23e6af[_0xdfb7('0x25')][_0xdfb7('0x26')]);return _0x376cb9(_0x23e6af[_0xdfb7('0x25')][_0xdfb7('0x26')]);}logger[_0xdfb7('0x25')](_0xdfb7('0x20'),_0x113417,_0x23e6af[_0xdfb7('0x25')][_0xdfb7('0x26')]);return _0x2a4b82(_0x23e6af['error']['message']);}else{logger[_0xdfb7('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x113417,_0xdfb7('0x21'));_0x2a4b82(_0x23e6af['result'][_0xdfb7('0x26')]);}})['catch'](function(_0x3a1926){logger[_0xdfb7('0x25')](_0xdfb7('0x20'),_0x113417,_0x3a1926);_0x376cb9(_0x3a1926);});});}function respondWithStatusCode(_0x14b955,_0x376efa){_0x376efa=_0x376efa||0xcc;return function(_0x4d8e97){if(_0x4d8e97){return _0x14b955['sendStatus'](_0x376efa);}return _0x14b955[_0xdfb7('0x27')](_0x376efa)[_0xdfb7('0x28')]();};}function respondWithResult(_0x568ca2,_0x2750a0){_0x2750a0=_0x2750a0||0xc8;return function(_0x62431f){if(_0x62431f){return _0x568ca2[_0xdfb7('0x27')](_0x2750a0)[_0xdfb7('0x29')](_0x62431f);}};}function respondWithFilteredResult(_0x4f08a0,_0x5eba0c){return function(_0x342899){if(_0x342899){var _0x3a7986=typeof _0x5eba0c['offset']===_0xdfb7('0x2a')&&typeof _0x5eba0c['limit']===_0xdfb7('0x2a');var _0x5df5c1=_0x342899[_0xdfb7('0x2b')];var _0x2978de=_0x3a7986?0x0:_0x5eba0c['offset'];var _0x485108=_0x3a7986?_0x342899[_0xdfb7('0x2b')]:_0x5eba0c[_0xdfb7('0x2c')]+_0x5eba0c[_0xdfb7('0x2d')];var _0x2a28ca;if(_0x485108>=_0x5df5c1){_0x485108=_0x5df5c1;_0x2a28ca=0xc8;}else{_0x2a28ca=0xce;}_0x4f08a0['status'](_0x2a28ca);return _0x4f08a0[_0xdfb7('0x2e')](_0xdfb7('0x2f'),_0x2978de+'-'+_0x485108+'/'+_0x5df5c1)['json'](_0x342899);}return null;};}function patchUpdates(_0x20483d){return function(_0x5025f6){try{jsonpatch[_0xdfb7('0x30')](_0x5025f6,_0x20483d,!![]);}catch(_0x1ce4f1){return BPromise[_0xdfb7('0x31')](_0x1ce4f1);}return _0x5025f6[_0xdfb7('0x32')]();};}function saveUpdates(_0x529b79,_0x40f600){return function(_0x53c4c9){if(_0x53c4c9){return _0x53c4c9[_0xdfb7('0x33')](_0x529b79)[_0xdfb7('0x1e')](function(_0x2df5df){return _0x2df5df;});}return null;};}function removeEntity(_0x1c3378,_0x49c3cf){return function(_0xc3b6c3){if(_0xc3b6c3){return _0xc3b6c3[_0xdfb7('0x34')]()['then'](function(){var _0x4fa499=_0xc3b6c3[_0xdfb7('0x35')]({'plain':!![]});var _0x4b41af=_0xdfb7('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x4b41af,'resourceId':_0x4fa499['id']}})[_0xdfb7('0x1e')](function(){return _0xc3b6c3;});})[_0xdfb7('0x1e')](function(){_0x1c3378[_0xdfb7('0x27')](0xcc)[_0xdfb7('0x28')]();});}};}function handleEntityNotFound(_0x5dd7e0,_0x11c5d0){return function(_0x349099){if(!_0x349099){_0x5dd7e0['sendStatus'](0x194);}return _0x349099;};}function handleError(_0x189203,_0x25c793){_0x25c793=_0x25c793||0x1f4;return function(_0x78d06e){logger[_0xdfb7('0x25')](_0x78d06e['stack']);if(_0x78d06e[_0xdfb7('0x37')]){delete _0x78d06e['name'];}_0x189203[_0xdfb7('0x27')](_0x25c793)[_0xdfb7('0x38')](_0x78d06e);};}exports['index']=function(_0x1284c8,_0x23ef3b){var _0x52a88e={'include':[{'model':db[_0xdfb7('0x39')],'as':_0xdfb7('0x3a')}]},_0x420ee9={},_0x309674={'count':0x0,'rows':[]};var _0xb46b2c=_[_0xdfb7('0x3b')](db['FaxAccount'][_0xdfb7('0x3c')],function(_0x14d630){return{'name':_0x14d630[_0xdfb7('0x3d')],'type':_0x14d630['type'][_0xdfb7('0x3e')]};});_0x420ee9[_0xdfb7('0x3f')]=_['map'](_0xb46b2c,'name');_0x420ee9[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x1284c8[_0xdfb7('0x40')]);_0x420ee9[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x420ee9[_0xdfb7('0x3f')],_0x420ee9[_0xdfb7('0x40')]);_0x52a88e[_0xdfb7('0x44')]=_[_0xdfb7('0x43')](_0x420ee9[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x1284c8[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0x52a88e[_0xdfb7('0x44')]=_0x52a88e[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0x52a88e['attributes']:_0x420ee9['model'];if(!_0x1284c8[_0xdfb7('0x40')]['hasOwnProperty']('nolimit')){_0x52a88e[_0xdfb7('0x2d')]=qs[_0xdfb7('0x2d')](_0x1284c8[_0xdfb7('0x40')]['limit']);_0x52a88e[_0xdfb7('0x2c')]=qs[_0xdfb7('0x2c')](_0x1284c8[_0xdfb7('0x40')][_0xdfb7('0x2c')]);}_0x52a88e[_0xdfb7('0x47')]=qs['sort'](_0x1284c8[_0xdfb7('0x40')][_0xdfb7('0x48')]);_0x52a88e[_0xdfb7('0x49')]=qs['filters'](_[_0xdfb7('0x4a')](_0x1284c8[_0xdfb7('0x40')],_0x420ee9[_0xdfb7('0x42')]),_0xb46b2c);if(_0x1284c8[_0xdfb7('0x40')][_0xdfb7('0x4b')]){_0x52a88e[_0xdfb7('0x49')]=_['merge'](_0x52a88e[_0xdfb7('0x49')],{'$or':_['map'](_0xb46b2c,function(_0x4862ec){if(_0x4862ec[_0xdfb7('0x4c')]!==_0xdfb7('0x4d')){var _0x15e71a={};_0x15e71a[_0x4862ec[_0xdfb7('0x37')]]={'$like':'%'+_0x1284c8[_0xdfb7('0x40')][_0xdfb7('0x4b')]+'%'};return _0x15e71a;}})});}_0x52a88e=_['merge']({},_0x52a88e,_0x1284c8[_0xdfb7('0x4e')]);var _0x14d60d={'where':_0x52a88e['where']};return db[_0xdfb7('0x4f')][_0xdfb7('0x2b')](_0x14d60d)[_0xdfb7('0x1e')](function(_0x1c1e29){_0x309674[_0xdfb7('0x2b')]=_0x1c1e29;if(_0x1284c8[_0xdfb7('0x40')]['includeAll']){_0x52a88e[_0xdfb7('0x50')]=[{'all':!![]}];}return db['FaxAccount'][_0xdfb7('0x51')](_0x52a88e);})[_0xdfb7('0x1e')](function(_0x7edb4f){_0x309674['rows']=_0x7edb4f;return _0x309674;})[_0xdfb7('0x1e')](respondWithFilteredResult(_0x23ef3b,_0x52a88e))[_0xdfb7('0x52')](handleError(_0x23ef3b,null));};exports[_0xdfb7('0x53')]=function(_0x55aed3,_0x119d9a){var _0x58dd90={'raw':![],'where':{'id':_0x55aed3['params']['id']},'include':[{'model':db[_0xdfb7('0x39')],'as':_0xdfb7('0x3a')}]},_0x5e066e={};_0x5e066e[_0xdfb7('0x3f')]=_['keys'](db[_0xdfb7('0x4f')][_0xdfb7('0x3c')]);_0x5e066e['query']=_['keys'](_0x55aed3[_0xdfb7('0x40')]);_0x5e066e[_0xdfb7('0x42')]=_['intersection'](_0x5e066e['model'],_0x5e066e[_0xdfb7('0x40')]);_0x58dd90['attributes']=_[_0xdfb7('0x43')](_0x5e066e[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x55aed3[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0x58dd90[_0xdfb7('0x44')]=_0x58dd90[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0x58dd90[_0xdfb7('0x44')]:_0x5e066e[_0xdfb7('0x3f')];if(_0x55aed3['query'][_0xdfb7('0x54')]){_0x58dd90[_0xdfb7('0x50')]=[{'all':!![]}];}_0x58dd90=_['merge']({},_0x58dd90,_0x55aed3['options']);return db[_0xdfb7('0x4f')][_0xdfb7('0x55')](_0x58dd90)[_0xdfb7('0x1e')](handleEntityNotFound(_0x119d9a,null))[_0xdfb7('0x1e')](respondWithResult(_0x119d9a,null))[_0xdfb7('0x52')](handleError(_0x119d9a,null));};exports['create']=function(_0x2a5807,_0x3f332a){return db[_0xdfb7('0x4f')]['create'](_0x2a5807[_0xdfb7('0x56')],{})['then'](function(_0x34c3cc){var _0x2ed5ea=_0x2a5807['user'][_0xdfb7('0x35')]({'plain':!![]});if(!_0x2ed5ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ed5ea[_0xdfb7('0x57')]==='user'){var _0x436c1e=_0x34c3cc['get']({'plain':!![]});var _0x54d240=_0xdfb7('0x36');return db[_0xdfb7('0x58')][_0xdfb7('0x55')]({'where':{'name':_0x54d240,'userProfileId':_0x2ed5ea[_0xdfb7('0x59')]},'raw':!![]})[_0xdfb7('0x1e')](function(_0x25bec8){if(_0x25bec8&&_0x25bec8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x436c1e[_0xdfb7('0x37')],'resourceId':_0x436c1e['id'],'type':_0x25bec8[_0xdfb7('0x37')],'sectionId':_0x25bec8['id']},{})[_0xdfb7('0x1e')](function(){return _0x34c3cc;});}else{return _0x34c3cc;}})['catch'](function(_0x2aa18b){logger['error'](_0xdfb7('0x5a'),_0x2aa18b);throw _0x2aa18b;});}return _0x34c3cc;})['then'](respondWithResult(_0x3f332a,0xc9))['catch'](handleError(_0x3f332a,null));};exports['update']=function(_0x53cb97,_0x4296c2){if(_0x53cb97['body']['id']){delete _0x53cb97[_0xdfb7('0x56')]['id'];}return db['FaxAccount'][_0xdfb7('0x55')]({'where':{'id':_0x53cb97['params']['id']},'include':[{'model':db[_0xdfb7('0x39')],'as':'mandatoryDispositionPause'}]})[_0xdfb7('0x1e')](handleEntityNotFound(_0x4296c2,null))[_0xdfb7('0x1e')](saveUpdates(_0x53cb97[_0xdfb7('0x56')],null))[_0xdfb7('0x1e')](respondWithResult(_0x4296c2,null))[_0xdfb7('0x52')](handleError(_0x4296c2,null));};exports[_0xdfb7('0x34')]=function(_0x1bf69b,_0x4c7e94){return db[_0xdfb7('0x4f')][_0xdfb7('0x55')]({'where':{'id':_0x1bf69b[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x4c7e94,null))[_0xdfb7('0x1e')](removeEntity(_0x4c7e94,null))[_0xdfb7('0x52')](handleError(_0x4c7e94,null));};exports[_0xdfb7('0x5c')]=function(_0x3328a4,_0x5f47ec){return db[_0xdfb7('0x4f')][_0xdfb7('0x5c')]()['then'](respondWithResult(_0x5f47ec,null))[_0xdfb7('0x52')](handleError(_0x5f47ec,null));};exports['addDisposition']=function(_0x4650a3,_0x40606f,_0x273318){if(_0x4650a3[_0xdfb7('0x56')]['id']){delete _0x4650a3[_0xdfb7('0x56')]['id'];}return db['FaxAccount'][_0xdfb7('0x55')]({'where':{'id':_0x4650a3[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x40606f,null))[_0xdfb7('0x1e')](function(_0xddeca9){if(_0xddeca9){_0x4650a3['body'][_0xdfb7('0x5d')]=_0xddeca9['id'];return db[_0xdfb7('0x5e')][_0xdfb7('0x5f')](_0x4650a3['body']);}})[_0xdfb7('0x1e')](respondWithResult(_0x40606f,null))[_0xdfb7('0x52')](handleError(_0x40606f,null));};exports['getDispositions']=function(_0x36080a,_0x3df0e9,_0x4beaa7){var _0xda0b72={'raw':![],'where':{}};var _0x23566c={};var _0x4a426f={'count':0x0,'rows':[]};return db[_0xdfb7('0x4f')][_0xdfb7('0x60')]({'where':{'id':_0x36080a[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x3df0e9,null))[_0xdfb7('0x1e')](function(_0x46f131){if(_0x46f131){_0x23566c[_0xdfb7('0x3f')]=_[_0xdfb7('0x41')](db[_0xdfb7('0x5e')]['rawAttributes']);_0x23566c[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x36080a[_0xdfb7('0x40')]);_0x23566c[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x23566c['model'],_0x23566c[_0xdfb7('0x40')]);_0xda0b72[_0xdfb7('0x44')]=_[_0xdfb7('0x43')](_0x23566c[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x36080a[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0xda0b72['attributes']=_0xda0b72[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0xda0b72['attributes']:_0x23566c[_0xdfb7('0x3f')];if(!_0x36080a[_0xdfb7('0x40')]['hasOwnProperty'](_0xdfb7('0x61'))){_0xda0b72[_0xdfb7('0x2d')]=qs[_0xdfb7('0x2d')](_0x36080a[_0xdfb7('0x40')][_0xdfb7('0x2d')]);_0xda0b72[_0xdfb7('0x2c')]=qs['offset'](_0x36080a[_0xdfb7('0x40')]['offset']);}_0xda0b72[_0xdfb7('0x47')]=qs[_0xdfb7('0x48')](_0x36080a[_0xdfb7('0x40')][_0xdfb7('0x48')]);_0xda0b72[_0xdfb7('0x49')]=qs['filters'](_[_0xdfb7('0x4a')](_0x36080a['query'],_0x23566c[_0xdfb7('0x42')]));_0xda0b72['where']['FaxAccountId']=_0x46f131['id'];if(_0x36080a['query'][_0xdfb7('0x4b')]){_0xda0b72['where']=_[_0xdfb7('0x62')](_0xda0b72['where'],{'$or':_[_0xdfb7('0x3b')](_0xda0b72[_0xdfb7('0x44')],function(_0x35ec46){var _0x5497bd={};_0x5497bd[_0x35ec46]={'$like':'%'+_0x36080a['query']['filter']+'%'};return _0x5497bd;})});}_0xda0b72=_['merge']({},_0xda0b72,_0x36080a[_0xdfb7('0x4e')]);return db[_0xdfb7('0x5e')][_0xdfb7('0x2b')]({'where':_0xda0b72['where']})[_0xdfb7('0x1e')](function(_0x1394f4){_0x4a426f[_0xdfb7('0x2b')]=_0x1394f4;if(_0x36080a[_0xdfb7('0x40')][_0xdfb7('0x54')]){_0xda0b72[_0xdfb7('0x50')]=[{'all':!![]}];}return db[_0xdfb7('0x5e')][_0xdfb7('0x51')](_0xda0b72);})[_0xdfb7('0x1e')](function(_0x2f22b2){_0x4a426f[_0xdfb7('0x63')]=_0x2f22b2;return _0x4a426f;});}})[_0xdfb7('0x1e')](respondWithFilteredResult(_0x3df0e9,_0xda0b72))[_0xdfb7('0x52')](handleError(_0x3df0e9,null));};exports[_0xdfb7('0x64')]=function(_0x1334e5,_0x56d397,_0x7a051){return db[_0xdfb7('0x4f')][_0xdfb7('0x55')]({'where':{'id':_0x1334e5[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x56d397,null))[_0xdfb7('0x1e')](function(_0x2ce00b){if(_0x2ce00b){return _0x2ce00b[_0xdfb7('0x64')](_0x1334e5[_0xdfb7('0x40')][_0xdfb7('0x65')]);}})[_0xdfb7('0x1e')](respondWithStatusCode(_0x56d397,null))[_0xdfb7('0x52')](handleError(_0x56d397,null));};exports['addAnswer']=function(_0xdc818a,_0x3af14c,_0xcc749){if(_0xdc818a[_0xdfb7('0x56')]['id']){delete _0xdc818a[_0xdfb7('0x56')]['id'];}return db[_0xdfb7('0x4f')][_0xdfb7('0x55')]({'where':{'id':_0xdc818a[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x3af14c,null))[_0xdfb7('0x1e')](function(_0x56b4eb){if(_0x56b4eb){_0xdc818a['body']['FaxAccountId']=_0x56b4eb['id'];return db[_0xdfb7('0x66')]['create'](_0xdc818a['body']);}})[_0xdfb7('0x1e')](respondWithResult(_0x3af14c,null))[_0xdfb7('0x52')](handleError(_0x3af14c,null));};exports[_0xdfb7('0x67')]=function(_0x2b8ef6,_0x141913,_0x4612b4){var _0x325ea3={'raw':![],'where':{}};var _0x503380={};var _0x281e5a={'count':0x0,'rows':[]};return db[_0xdfb7('0x4f')]['findOne']({'where':{'id':_0x2b8ef6[_0xdfb7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x141913,null))[_0xdfb7('0x1e')](function(_0x3bfa72){if(_0x3bfa72){_0x503380[_0xdfb7('0x3f')]=_[_0xdfb7('0x41')](db[_0xdfb7('0x66')][_0xdfb7('0x3c')]);_0x503380[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x2b8ef6[_0xdfb7('0x40')]);_0x503380[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x503380[_0xdfb7('0x3f')],_0x503380['query']);_0x325ea3[_0xdfb7('0x44')]=_[_0xdfb7('0x43')](_0x503380['model'],qs[_0xdfb7('0x45')](_0x2b8ef6['query']['fields']));_0x325ea3[_0xdfb7('0x44')]=_0x325ea3[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0x325ea3[_0xdfb7('0x44')]:_0x503380[_0xdfb7('0x3f')];if(!_0x2b8ef6[_0xdfb7('0x40')][_0xdfb7('0x68')](_0xdfb7('0x61'))){_0x325ea3[_0xdfb7('0x2d')]=qs[_0xdfb7('0x2d')](_0x2b8ef6[_0xdfb7('0x40')][_0xdfb7('0x2d')]);_0x325ea3[_0xdfb7('0x2c')]=qs[_0xdfb7('0x2c')](_0x2b8ef6[_0xdfb7('0x40')][_0xdfb7('0x2c')]);}_0x325ea3[_0xdfb7('0x47')]=qs['sort'](_0x2b8ef6[_0xdfb7('0x40')][_0xdfb7('0x48')]);_0x325ea3[_0xdfb7('0x49')]=qs[_0xdfb7('0x42')](_['pick'](_0x2b8ef6[_0xdfb7('0x40')],_0x503380[_0xdfb7('0x42')]));_0x325ea3[_0xdfb7('0x49')][_0xdfb7('0x5d')]=_0x3bfa72['id'];if(_0x2b8ef6[_0xdfb7('0x40')]['filter']){_0x325ea3[_0xdfb7('0x49')]=_[_0xdfb7('0x62')](_0x325ea3[_0xdfb7('0x49')],{'$or':_[_0xdfb7('0x3b')](_0x325ea3['attributes'],function(_0x52b12e){var _0x3968a8={};_0x3968a8[_0x52b12e]={'$like':'%'+_0x2b8ef6[_0xdfb7('0x40')]['filter']+'%'};return _0x3968a8;})});}_0x325ea3=_[_0xdfb7('0x62')]({},_0x325ea3,_0x2b8ef6[_0xdfb7('0x4e')]);return db[_0xdfb7('0x66')][_0xdfb7('0x2b')]({'where':_0x325ea3[_0xdfb7('0x49')]})['then'](function(_0x56afff){_0x281e5a[_0xdfb7('0x2b')]=_0x56afff;if(_0x2b8ef6[_0xdfb7('0x40')][_0xdfb7('0x54')]){_0x325ea3[_0xdfb7('0x50')]=[{'all':!![]}];}return db[_0xdfb7('0x66')][_0xdfb7('0x51')](_0x325ea3);})[_0xdfb7('0x1e')](function(_0x18aecb){_0x281e5a[_0xdfb7('0x63')]=_0x18aecb;return _0x281e5a;});}})[_0xdfb7('0x1e')](respondWithFilteredResult(_0x141913,_0x325ea3))[_0xdfb7('0x52')](handleError(_0x141913,null));};exports[_0xdfb7('0x69')]=function(_0x3cda2d,_0x1338e9,_0x537413){return db[_0xdfb7('0x4f')]['find']({'where':{'id':_0x3cda2d['params']['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x1338e9,null))[_0xdfb7('0x1e')](function(_0xef1478){if(_0xef1478){return _0xef1478[_0xdfb7('0x69')](_0x3cda2d[_0xdfb7('0x40')][_0xdfb7('0x65')]);}})[_0xdfb7('0x1e')](respondWithStatusCode(_0x1338e9,null))[_0xdfb7('0x52')](handleError(_0x1338e9,null));};exports[_0xdfb7('0x6a')]=function(_0x3f0bee,_0x59b5a6,_0x218c53){return db['FaxInteraction'][_0xdfb7('0x55')]({'where':{'id':_0x3f0bee['params']['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x59b5a6,null))[_0xdfb7('0x1e')](function(_0x524504){if(_0x524504){return _0x524504[_0xdfb7('0x6a')](_0x3f0bee[_0xdfb7('0x56')][_0xdfb7('0x65')],_[_0xdfb7('0x6b')](_0x3f0bee['body'],[_0xdfb7('0x65'),'id'])||{});}})['then'](respondWithResult(_0x59b5a6,null))['catch'](handleError(_0x59b5a6,null));};exports['getInteractions']=function(_0x4e1f24,_0x3889c6,_0x332c83){var _0x5b88f6={'raw':![],'where':{}};var _0x217d2b={};var _0x45a6a0={'count':0x0,'rows':[]};return db[_0xdfb7('0x4f')]['findOne']({'where':{'id':_0x4e1f24[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x3889c6,null))['then'](function(_0x46c8b0){if(_0x46c8b0){_0x217d2b['model']=_[_0xdfb7('0x41')](db['FaxInteraction']['rawAttributes']);_0x217d2b[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x4e1f24[_0xdfb7('0x40')]);_0x217d2b[_0xdfb7('0x42')]=_['intersection'](_0x217d2b['model'],_0x217d2b[_0xdfb7('0x40')]);_0x5b88f6[_0xdfb7('0x44')]=_[_0xdfb7('0x43')](_0x217d2b[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0x5b88f6[_0xdfb7('0x44')]=_0x5b88f6[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0x5b88f6[_0xdfb7('0x44')]:_0x217d2b[_0xdfb7('0x3f')];if(!_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x68')](_0xdfb7('0x61'))){_0x5b88f6[_0xdfb7('0x2d')]=qs['limit'](_0x4e1f24[_0xdfb7('0x40')]['limit']);_0x5b88f6[_0xdfb7('0x2c')]=qs['offset'](_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x2c')]);}_0x5b88f6[_0xdfb7('0x47')]=qs[_0xdfb7('0x48')](_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x48')]);_0x5b88f6[_0xdfb7('0x49')]=qs[_0xdfb7('0x42')](_[_0xdfb7('0x4a')](_0x4e1f24[_0xdfb7('0x40')],_0x217d2b['filters']));_0x5b88f6[_0xdfb7('0x49')][_0xdfb7('0x5d')]=_0x46c8b0['id'];if(_0x4e1f24[_0xdfb7('0x40')]['filter']){_0x5b88f6[_0xdfb7('0x49')]=_['merge'](_0x5b88f6[_0xdfb7('0x49')],{'$or':_['map'](_0x5b88f6[_0xdfb7('0x44')],function(_0x5ef9a5){var _0x131294={};_0x131294[_0x5ef9a5]={'$like':'%'+_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x4b')]+'%'};return _0x131294;})});}_0x5b88f6=_[_0xdfb7('0x62')]({},_0x5b88f6,_0x4e1f24['options']);return db[_0xdfb7('0x6c')][_0xdfb7('0x2b')]({'where':_0x5b88f6[_0xdfb7('0x49')]})['then'](function(_0x39c712){_0x45a6a0['count']=_0x39c712;if(_0x4e1f24['query'][_0xdfb7('0x54')]){_0x5b88f6[_0xdfb7('0x50')]=[{'model':db['CmContact'],'as':_0xdfb7('0x6d'),'required':![]},{'model':db['User'],'as':_0xdfb7('0x6e'),'attributes':[_0xdfb7('0x37'),'fullname',_0xdfb7('0x6f')],'required':![]},{'model':db[_0xdfb7('0x70')],'as':_0xdfb7('0x71'),'attributes':['id',_0xdfb7('0x37'),_0xdfb7('0x72')],'where':_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x73')]?{'id':_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x73')]}:undefined,'required':_0x4e1f24[_0xdfb7('0x40')][_0xdfb7('0x73')]?!![]:![]}];}return db[_0xdfb7('0x6c')]['findAll'](_0x5b88f6);})[_0xdfb7('0x1e')](function(_0x239eb1){_0x45a6a0[_0xdfb7('0x63')]=_0x239eb1;return _0x45a6a0;});}})[_0xdfb7('0x1e')](respondWithFilteredResult(_0x3889c6,_0x5b88f6))[_0xdfb7('0x52')](handleError(_0x3889c6,null));};exports['addApplications']=function(_0x428ec0,_0x2804b2,_0x474a15){return db[_0xdfb7('0x4f')][_0xdfb7('0x60')]({'where':{'id':_0x428ec0['params']['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x2804b2,null))[_0xdfb7('0x1e')](function(_0x181217){if(_0x181217){return db['sequelize']['transaction'](function(_0x5b83a5){return db[_0xdfb7('0x74')][_0xdfb7('0x34')]({'where':{'FaxAccountId':_0x428ec0[_0xdfb7('0x5b')]['id']},'transaction':_0x5b83a5})[_0xdfb7('0x1e')](function(_0x186373){var _0x48ae87=_[_0xdfb7('0x3b')](_0x428ec0[_0xdfb7('0x56')],function(_0x339e73){_0x339e73[_0xdfb7('0x5d')]=_0x428ec0[_0xdfb7('0x5b')]['id'];return _0x339e73;});return db[_0xdfb7('0x74')][_0xdfb7('0x75')](_0x48ae87,{'transaction':_0x5b83a5});});})['then'](function(){return db[_0xdfb7('0x74')][_0xdfb7('0x76')]({'where':{'FaxAccountId':_0x428ec0[_0xdfb7('0x5b')]['id']},'order':_0xdfb7('0x77')});});}})['then'](respondWithResult(_0x2804b2,null))[_0xdfb7('0x52')](handleError(_0x2804b2,null));};exports[_0xdfb7('0x78')]=function(_0x5e44ff,_0x6ae929,_0xfc8b22){var _0x50112c={};var _0x4e9ee0={};var _0x51931a;var _0x529865;return db[_0xdfb7('0x4f')]['findOne']({'where':{'id':_0x5e44ff[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x6ae929,null))['then'](function(_0x440fcf){if(_0x440fcf){_0x51931a=_0x440fcf;_0x4e9ee0[_0xdfb7('0x3f')]=_['keys'](db[_0xdfb7('0x74')][_0xdfb7('0x3c')]);_0x4e9ee0[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x5e44ff[_0xdfb7('0x40')]);_0x4e9ee0[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x4e9ee0[_0xdfb7('0x3f')],_0x4e9ee0[_0xdfb7('0x40')]);_0x50112c[_0xdfb7('0x44')]=_['intersection'](_0x4e9ee0[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x5e44ff[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0x50112c['attributes']=_0x50112c['attributes'][_0xdfb7('0x46')]?_0x50112c[_0xdfb7('0x44')]:_0x4e9ee0[_0xdfb7('0x3f')];_0x50112c[_0xdfb7('0x47')]=qs[_0xdfb7('0x48')](_0x5e44ff[_0xdfb7('0x40')]['sort']);_0x50112c[_0xdfb7('0x49')]=qs[_0xdfb7('0x42')](_[_0xdfb7('0x4a')](_0x5e44ff[_0xdfb7('0x40')],_0x4e9ee0['filters']));if(_0x5e44ff[_0xdfb7('0x40')][_0xdfb7('0x4b')]){_0x50112c[_0xdfb7('0x49')]=_['merge'](_0x50112c[_0xdfb7('0x49')],{'$or':_[_0xdfb7('0x3b')](_0x50112c['attributes'],function(_0xd72f85){var _0x67f232={};_0x67f232[_0xd72f85]={'$like':'%'+_0x5e44ff['query'][_0xdfb7('0x4b')]+'%'};return _0x67f232;})});}_0x50112c=_[_0xdfb7('0x62')]({},_0x50112c,_0x5e44ff[_0xdfb7('0x4e')]);return _0x51931a[_0xdfb7('0x78')](_0x50112c);}})[_0xdfb7('0x1e')](function(_0x29a572){if(_0x29a572){_0x529865=_0x29a572['length'];if(!_0x5e44ff[_0xdfb7('0x40')]['hasOwnProperty'](_0xdfb7('0x61'))){_0x50112c['limit']=qs[_0xdfb7('0x2d')](_0x5e44ff[_0xdfb7('0x40')][_0xdfb7('0x2d')]);_0x50112c[_0xdfb7('0x2c')]=qs['offset'](_0x5e44ff[_0xdfb7('0x40')][_0xdfb7('0x2c')]);}return _0x51931a[_0xdfb7('0x78')](_0x50112c);}})[_0xdfb7('0x1e')](function(_0x59f617){if(_0x59f617){return _0x59f617?{'count':_0x529865,'rows':_0x59f617}:null;}})[_0xdfb7('0x1e')](respondWithResult(_0x6ae929,null))[_0xdfb7('0x52')](handleError(_0x6ae929,null));};function Extension(_0x1a201e,_0x41f6b7,_0x26bf78,_0x4eca83){this[_0xdfb7('0x79')]=_0xdfb7('0x7a');this['exten']=_0x1a201e[_0xdfb7('0x7b')];this[_0xdfb7('0x7c')]=_0x4eca83;this['type']=_0xdfb7('0x7d');this[_0xdfb7('0x7e')]=_0xdfb7('0x7f');this['FaxAccountId']=_0x1a201e['id'];this['priority']=_0x41f6b7;this['appdata']=_0x26bf78;}function createExtensionsReciveFax(_0x106fe9){var _0x4f0979=0x1;var _0x2648aa=[];_0x2648aa['push'](new Extension(_0x106fe9,_0x4f0979,'',_0xdfb7('0x80')));_0x4f0979+=0x1;_0x2648aa[_0xdfb7('0x81')](new Extension(_0x106fe9,_0x4f0979,_0xdfb7('0x82'),_0xdfb7('0x83')));_0x4f0979+=0x1;for(var _0x7d1cca in _0x106fe9){if(_0x106fe9[_0xdfb7('0x68')](_0x7d1cca)&&(_0x7d1cca===_0xdfb7('0x84')||_0x7d1cca===_0xdfb7('0x7b')||_0x7d1cca===_0xdfb7('0x85')||_0x7d1cca==='faxdetect'||_0x7d1cca===_0xdfb7('0x86')||_0x7d1cca===_0xdfb7('0x87')||_0x7d1cca===_0xdfb7('0x88')||_0x7d1cca===_0xdfb7('0x89')||_0x7d1cca===_0xdfb7('0x8a'))){_0x2648aa[_0xdfb7('0x81')](new Extension(_0x106fe9,_0x4f0979,'FAXOPT('+_0x7d1cca+')='+_0x106fe9[_0x7d1cca],_0xdfb7('0x83')));_0x4f0979+=0x1;}}_0x2648aa[_0xdfb7('0x81')](new Extension(_0x106fe9,_0x4f0979,'6',_0xdfb7('0x8b')));_0x4f0979+=0x1;_0x2648aa[_0xdfb7('0x81')](new Extension(_0x106fe9,_0x4f0979,_0xdfb7('0x8c'),'ReceiveFax'));_0x4f0979=0x0;return _0x2648aa;}exports['addAccountApplications']=function(_0x47ed4d,_0x5b946b,_0x39c822){var _0xeb080;return db[_0xdfb7('0x8d')][_0xdfb7('0x8e')](function(_0x1265f3){return db[_0xdfb7('0x4f')]['create'](_0x47ed4d['body'],{'transaction':_0x1265f3})[_0xdfb7('0x1e')](function(_0x3a8fe3){_0xeb080=_0x3a8fe3[_0xdfb7('0x35')]({'plain':!![]});return db[_0xdfb7('0x8f')][_0xdfb7('0x75')](createExtensionsReciveFax(_0xeb080),{'transaction':_0x1265f3});});})[_0xdfb7('0x1e')](function(){return _0xeb080;})['then'](respondWithResult(_0x5b946b,null))[_0xdfb7('0x52')](handleError(_0x5b946b,null));};exports[_0xdfb7('0x90')]=function(_0x41bb0a,_0x423b66,_0x212575){var _0x390f11;return db[_0xdfb7('0x8d')][_0xdfb7('0x8e')](function(_0xa57844){return db['FaxAccount'][_0xdfb7('0x33')](_0x41bb0a[_0xdfb7('0x56')],{'where':{'id':_0x41bb0a['body']['id']},'transaction':_0xa57844})[_0xdfb7('0x1e')](function(_0x3e82f5){return db[_0xdfb7('0x8f')][_0xdfb7('0x34')]({'where':{'FaxAccountId':_0x41bb0a[_0xdfb7('0x56')]['id']},'transaction':_0xa57844})['then'](function(_0x2c1486){return db[_0xdfb7('0x8f')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x41bb0a['body'],[_0xdfb7('0x91'),_0xdfb7('0x3e'),'createdAt',_0xdfb7('0x92'),_0xdfb7('0x93'),_0xdfb7('0x94')])),{'transaction':_0xa57844});});});})['then'](function(){return db[_0xdfb7('0x4f')][_0xdfb7('0x95')](_0x41bb0a[_0xdfb7('0x56')]['id']);})[_0xdfb7('0x1e')](respondWithResult(_0x423b66,null))[_0xdfb7('0x52')](handleError(_0x423b66,null));};exports[_0xdfb7('0x96')]=function(_0x3094b8,_0x1069b4,_0x1c0700){var _0x4154c7={'raw':!![],'where':{}};var _0x281b4c={};var _0x5776c2={'count':0x0,'rows':[]};return db[_0xdfb7('0x4f')][_0xdfb7('0x60')]({'where':{'id':_0x3094b8['params']['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x1069b4,null))[_0xdfb7('0x1e')](function(_0x2f33e7){if(_0x2f33e7){_0x281b4c[_0xdfb7('0x3f')]=_['keys'](db[_0xdfb7('0x97')]['rawAttributes']);_0x281b4c[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x3094b8['query']);_0x281b4c[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x281b4c[_0xdfb7('0x3f')],_0x281b4c[_0xdfb7('0x40')]);_0x4154c7[_0xdfb7('0x44')]=_['intersection'](_0x281b4c[_0xdfb7('0x3f')],qs['fields'](_0x3094b8[_0xdfb7('0x40')][_0xdfb7('0x45')]));_0x4154c7[_0xdfb7('0x44')]=_0x4154c7[_0xdfb7('0x44')][_0xdfb7('0x46')]?_0x4154c7[_0xdfb7('0x44')]:_0x281b4c[_0xdfb7('0x3f')];if(!_0x3094b8['query'][_0xdfb7('0x68')](_0xdfb7('0x61'))){_0x4154c7[_0xdfb7('0x2d')]=qs[_0xdfb7('0x2d')](_0x3094b8[_0xdfb7('0x40')]['limit']);_0x4154c7[_0xdfb7('0x2c')]=qs[_0xdfb7('0x2c')](_0x3094b8[_0xdfb7('0x40')][_0xdfb7('0x2c')]);}_0x4154c7[_0xdfb7('0x47')]=qs['sort'](_0x3094b8[_0xdfb7('0x40')][_0xdfb7('0x48')]);_0x4154c7['where']=qs[_0xdfb7('0x42')](_[_0xdfb7('0x4a')](_0x3094b8[_0xdfb7('0x40')],_0x281b4c[_0xdfb7('0x42')]));_0x4154c7['where'][_0xdfb7('0x5d')]=_0x2f33e7['id'];if(_0x3094b8[_0xdfb7('0x40')][_0xdfb7('0x4b')]){_0x4154c7[_0xdfb7('0x49')]=_[_0xdfb7('0x62')](_0x4154c7[_0xdfb7('0x49')],{'$or':_[_0xdfb7('0x3b')](_0x4154c7[_0xdfb7('0x44')],function(_0x137e4e){var _0x5ec2d0={};_0x5ec2d0[_0x137e4e]={'$like':'%'+_0x3094b8[_0xdfb7('0x40')]['filter']+'%'};return _0x5ec2d0;})});}if(_0x3094b8['query'][_0xdfb7('0x98')]){var _0x4a6f64=_0x3094b8['query'][_0xdfb7('0x98')]['split'](',');var _0x59907f={};_0x59907f[_0x4a6f64[0x0]]={'$gte':moment(_0x4a6f64[0x1])[_0xdfb7('0x99')](_0xdfb7('0x9a'))};_0x4154c7['where']=_[_0xdfb7('0x62')](_0x4154c7[_0xdfb7('0x49')],_0x59907f);}_0x4154c7=_[_0xdfb7('0x62')]({},_0x4154c7,_0x3094b8[_0xdfb7('0x4e')]);return db[_0xdfb7('0x97')][_0xdfb7('0x2b')]({'where':_0x4154c7[_0xdfb7('0x49')]})[_0xdfb7('0x1e')](function(_0x3b7330){_0x5776c2[_0xdfb7('0x2b')]=_0x3b7330;if(_0x3094b8[_0xdfb7('0x40')][_0xdfb7('0x54')]){_0x4154c7[_0xdfb7('0x50')]=[{'all':!![]}];}return db[_0xdfb7('0x97')][_0xdfb7('0x51')](_0x4154c7);})[_0xdfb7('0x1e')](function(_0x4fe518){_0x5776c2[_0xdfb7('0x63')]=_0x4fe518;return _0x5776c2;});}})['then'](respondWithFilteredResult(_0x1069b4,_0x4154c7))[_0xdfb7('0x52')](handleError(_0x1069b4,null));};exports[_0xdfb7('0x38')]=function(_0x5dc456,_0x1c0569,_0x3c00e7){var _0x191b38,_0x19619c={},_0x3f0746;if(_0x5dc456[_0xdfb7('0x56')]['to']){_0x3f0746=_0x5dc456[_0xdfb7('0x56')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x5dc456['params']['id']},'include':[{'model':db[_0xdfb7('0x9b')],'as':_0xdfb7('0x9c'),'include':[{'model':db[_0xdfb7('0x9d')],'as':_0xdfb7('0x9e'),'where':{'fax':_0x3f0746},'limit':0x1,'order':[[_0xdfb7('0x92'),_0xdfb7('0x9f')]]}]}]})[_0xdfb7('0x1e')](handleEntityNotFound(_0x1c0569,null))[_0xdfb7('0x1e')](function(_0x3d9850){_0x191b38=_0x3d9850;if(_0x5dc456['body']['attachments']&&_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][_0xdfb7('0x46')]){for(var _0x4102ad=0x0;_0x4102ad<_0x5dc456[_0xdfb7('0x56')]['attachments']['length'];_0x4102ad+=0x1){_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][_0x4102ad]={'filename':_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][_0x4102ad][_0xdfb7('0x37')],'id':_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][_0x4102ad]['id'],'path':path['join'](config[_0xdfb7('0xa1')],_0xdfb7('0xa2'),_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][_0x4102ad]['basename'])};}}return respondWithRpcPromise(_0xdfb7('0xa3'),_0xdfb7('0xa3'),{'FaxAccountId':_['isNil'](_0x5dc456[_0xdfb7('0x5b')]['id'])?undefined:_0x5dc456[_0xdfb7('0x5b')]['id'],'path':_['isNil'](_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0][_0xdfb7('0x5')])?undefined:_0x5dc456[_0xdfb7('0x56')]['attachments'][0x0][_0xdfb7('0x5')],'fax':_['isNil'](_0x5dc456['body']['to'][0x0])?undefined:_0x5dc456[_0xdfb7('0x56')]['to'][0x0]},client9002);})['then'](function(){if(_0x191b38){if(_[_0xdfb7('0xa4')](_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa5')])){_0x5dc456['body'][_0xdfb7('0xa5')]=util['format'](_0xdfb7('0xa6'),_0x191b38[_0xdfb7('0x37')],_0x191b38['fax']);}if(_0x191b38[_0xdfb7('0x9c')]){if(_0x191b38[_0xdfb7('0x9c')]['Contacts'][_0xdfb7('0x46')]){return _0x191b38['List'][_0xdfb7('0x9e')][0x0];}else{return db[_0xdfb7('0x9d')]['create'](_[_0xdfb7('0xa7')](_0x5dc456[_0xdfb7('0x56')],{'firstName':_0x5dc456[_0xdfb7('0x56')]['to'][0x0],'phone':_0x5dc456[_0xdfb7('0x56')]['to'][0x0],'fax':_0x5dc456[_0xdfb7('0x56')]['to'][0x0],'ListId':_0x191b38[_0xdfb7('0x94')]}));}}else{throw new Error(_0xdfb7('0xa8'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xdfb7('0x1e')](function(_0x14c1d5){if(_0x14c1d5){return db[_0xdfb7('0x6c')][_0xdfb7('0x55')]({'where':{'ContactId':_0x14c1d5['id'],'closed':![],'FaxAccountId':_0x191b38['id']}})['then'](function(_0x530359){if(_0x530359){return[_0x530359,![]];}return db['FaxInteraction'][_0xdfb7('0x5f')]({'UserId':_0x5dc456[_0xdfb7('0xa9')]['id'],'ContactId':_0x14c1d5['id'],'FaxAccountId':_0x191b38['id'],'fax':_0x5dc456[_0xdfb7('0x56')]['to'][0x0],'firstMsgDirection':_0xdfb7('0xaa'),'Messages':[_['merge'](_0x5dc456[_0xdfb7('0x56')],{'read':![],'body':_0x5dc456['body'][_0xdfb7('0xa0')][0x0][_0xdfb7('0xab')],'FaxAccountId':_0x191b38['id'],'UserId':_0x5dc456[_0xdfb7('0xa9')]['id'],'ContactId':_0x14c1d5['id'],'AttachmentId':_0x5dc456['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xdfb7('0x97')],'as':'Messages'}]})[_0xdfb7('0x1e')](function(_0x54d3eb){return[_0x54d3eb,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xdfb7('0xac')](function(_0x282f04,_0x48294b){if(_0x48294b){return _0x282f04;}return db[_0xdfb7('0x97')]['create']({'direction':_0xdfb7('0xaa'),'read':![],'body':_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0][_0xdfb7('0xab')],'FaxAccountId':_0x191b38['id'],'FaxInteractionId':_0x282f04['id'],'UserId':_0x5dc456[_0xdfb7('0xa9')]['id'],'ContactId':_0x282f04[_0xdfb7('0xad')],'AttachmentId':_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0]['id']})[_0xdfb7('0x1e')](function(_0x277f22){_0x282f04[_0xdfb7('0xae')][_0xdfb7('0xaf')]=[];_0x282f04['dataValues']['Messages'][_0xdfb7('0x81')](_0x277f22[_0xdfb7('0xae')]);return _0x282f04;});})[_0xdfb7('0x1e')](function(_0x522e7b){respondWithRpcPromise(_0xdfb7('0xb0'),'SendFax',{'FaxAccountId':_[_0xdfb7('0xa4')](_0x5dc456[_0xdfb7('0x5b')]['id'])?undefined:_0x5dc456[_0xdfb7('0x5b')]['id'],'path':_[_0xdfb7('0xa4')](_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0][_0xdfb7('0x5')])?undefined:_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0][_0xdfb7('0x5')],'fax':_['isNil'](_0x5dc456[_0xdfb7('0x56')]['to'][0x0])?undefined:_0x5dc456[_0xdfb7('0x56')]['to'][0x0],'AttachmentId':_0x5dc456[_0xdfb7('0x56')][_0xdfb7('0xa0')][0x0]['id']},client9002)[_0xdfb7('0x1e')](function(_0x3a53b4){logger['info']('SendFaxRpc,\x20%s',_0x3a53b4);})[_0xdfb7('0x52')](function(_0x2b5b3f){logger[_0xdfb7('0x1f')]('SendFaxRpc,\x20%s',_0x2b5b3f);});return _0x522e7b;})[_0xdfb7('0x1e')](respondWithResult(_0x1c0569,null))['catch'](handleError(_0x1c0569,null));};exports[_0xdfb7('0xb1')]=function(_0x135d06,_0x25e330,_0x3afb65){return db[_0xdfb7('0x4f')][_0xdfb7('0x55')]({'where':{'id':_0x135d06[_0xdfb7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25e330,null))[_0xdfb7('0x1e')](function(_0x282735){if(_0x282735){return _0x282735[_0xdfb7('0xb1')](_0x135d06['body']['ids'],_[_0xdfb7('0x6b')](_0x135d06[_0xdfb7('0x56')],['ids','id'])||{})[_0xdfb7('0xac')](function(_0x4fe8c1){for(var _0x12af89=0x0;_0x12af89<_0x135d06[_0xdfb7('0x56')][_0xdfb7('0x65')][_0xdfb7('0x46')];_0x12af89+=0x1){socket[_0xdfb7('0xb2')](_0xdfb7('0xb3'),{'UserId':Number(_0x135d06[_0xdfb7('0x56')][_0xdfb7('0x65')][_0x12af89]),'FaxAccountId':Number(_0x135d06['params']['id'])});}return _0x4fe8c1;});}})[_0xdfb7('0x1e')](respondWithResult(_0x25e330,null))[_0xdfb7('0x52')](handleError(_0x25e330,null));};exports['removeAgents']=function(_0xf99538,_0x173bc9,_0x249625){return db[_0xdfb7('0x4f')][_0xdfb7('0x55')]({'where':{'id':_0xf99538[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x173bc9,null))[_0xdfb7('0x1e')](function(_0x599ba0){if(_0x599ba0){return _0x599ba0[_0xdfb7('0xb4')](_0xf99538['query'][_0xdfb7('0x65')])['then'](function(){if(_[_0xdfb7('0xb5')](_0xf99538[_0xdfb7('0x40')][_0xdfb7('0x65')])){for(var _0x245ea9=0x0;_0x245ea9<_0xf99538['query'][_0xdfb7('0x65')][_0xdfb7('0x46')];_0x245ea9+=0x1){socket['emit'](_0xdfb7('0xb6'),{'UserId':Number(_0xf99538[_0xdfb7('0x40')][_0xdfb7('0x65')][_0x245ea9]),'FaxAccountId':Number(_0xf99538[_0xdfb7('0x5b')]['id'])});}}else{socket['emit'](_0xdfb7('0xb6'),{'UserId':Number(_0xf99538[_0xdfb7('0x40')]['ids']),'FaxAccountId':Number(_0xf99538[_0xdfb7('0x5b')]['id'])});}});}})[_0xdfb7('0x1e')](respondWithStatusCode(_0x173bc9,null))[_0xdfb7('0x52')](handleError(_0x173bc9,null));};exports[_0xdfb7('0xb7')]=function(_0x200b4b,_0x3bbac8,_0x4510a0){var _0x106004={};var _0x54ebfa={};var _0x318723;var _0x30265b;return db[_0xdfb7('0x4f')][_0xdfb7('0x60')]({'where':{'id':_0x200b4b[_0xdfb7('0x5b')]['id']}})[_0xdfb7('0x1e')](handleEntityNotFound(_0x3bbac8,null))[_0xdfb7('0x1e')](function(_0x39479a){if(_0x39479a){_0x318723=_0x39479a;_0x54ebfa[_0xdfb7('0x3f')]=_['keys'](db[_0xdfb7('0xb8')][_0xdfb7('0x3c')]);_0x54ebfa[_0xdfb7('0x40')]=_[_0xdfb7('0x41')](_0x200b4b[_0xdfb7('0x40')]);_0x54ebfa[_0xdfb7('0x42')]=_[_0xdfb7('0x43')](_0x54ebfa[_0xdfb7('0x3f')],_0x54ebfa[_0xdfb7('0x40')]);_0x106004[_0xdfb7('0x44')]=_[_0xdfb7('0x43')](_0x54ebfa[_0xdfb7('0x3f')],qs[_0xdfb7('0x45')](_0x200b4b[_0xdfb7('0x40')]['fields']));_0x106004['attributes']=_0x106004[_0xdfb7('0x44')]['length']?_0x106004[_0xdfb7('0x44')]:_0x54ebfa[_0xdfb7('0x3f')];_0x106004[_0xdfb7('0x47')]=qs[_0xdfb7('0x48')](_0x200b4b['query'][_0xdfb7('0x48')]);_0x106004[_0xdfb7('0x49')]=qs[_0xdfb7('0x42')](_['pick'](_0x200b4b[_0xdfb7('0x40')],_0x54ebfa[_0xdfb7('0x42')]));if(_0x200b4b['query'][_0xdfb7('0x4b')]){_0x106004[_0xdfb7('0x49')]=_[_0xdfb7('0x62')](_0x106004[_0xdfb7('0x49')],{'$or':_[_0xdfb7('0x3b')](_0x106004[_0xdfb7('0x44')],function(_0xd2dd7c){var _0x36362e={};_0x36362e[_0xd2dd7c]={'$like':'%'+_0x200b4b[_0xdfb7('0x40')]['filter']+'%'};return _0x36362e;})});}_0x106004=_[_0xdfb7('0x62')]({},_0x106004,_0x200b4b['options']);return _0x318723['getAgents'](_0x106004);}})[_0xdfb7('0x1e')](function(_0x1ae700){if(_0x1ae700){_0x30265b=_0x1ae700['length'];if(!_0x200b4b[_0xdfb7('0x40')]['hasOwnProperty']('nolimit')){_0x106004[_0xdfb7('0x2d')]=qs[_0xdfb7('0x2d')](_0x200b4b[_0xdfb7('0x40')][_0xdfb7('0x2d')]);_0x106004[_0xdfb7('0x2c')]=qs[_0xdfb7('0x2c')](_0x200b4b['query']['offset']);}return _0x318723[_0xdfb7('0xb7')](_0x106004);}})[_0xdfb7('0x1e')](function(_0x1100c6){if(_0x1100c6){return _0x1100c6?{'count':_0x30265b,'rows':_0x1100c6}:null;}})[_0xdfb7('0x1e')](respondWithResult(_0x3bbac8,null))[_0xdfb7('0x52')](handleError(_0x3bbac8,null));}; \ No newline at end of file +var _0xb8c5=['result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','findAll','rows','params','mandatoryDispositionPause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','FaxAccountId','Disposition','length','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','findOne','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','exten','app','description','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','attachments','root','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0xb8c5,0x152));var _0x5b8c=function(_0x15d409,_0x16c2ee){_0x15d409=_0x15d409-0x0;var _0x379106=_0xb8c5[_0x15d409];return _0x379106;};'use strict';var emlformat=require(_0x5b8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b8c('0x2'));var BPromise=require(_0x5b8c('0x3'));var Mustache=require(_0x5b8c('0x4'));var util=require(_0x5b8c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5b8c('0x6'));var ejs=require(_0x5b8c('0x7'));var fs=require('fs');var fs_extra=require(_0x5b8c('0x8'));var _=require(_0x5b8c('0x9'));var squel=require('squel');var crypto=require(_0x5b8c('0xa'));var jsforce=require(_0x5b8c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b8c('0x6'));var querystring=require(_0x5b8c('0xc'));var Papa=require(_0x5b8c('0xd'));var Redis=require(_0x5b8c('0xe'));var authService=require(_0x5b8c('0xf'));var qs=require(_0x5b8c('0x10'));var as=require(_0x5b8c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b8c('0x12'))('api');var utils=require(_0x5b8c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5b8c('0x14'));var db=require(_0x5b8c('0x15'))['db'];config[_0x5b8c('0x16')]=_[_0x5b8c('0x17')](config[_0x5b8c('0x16')],{'host':_0x5b8c('0x18'),'port':0x18eb});var socket=require(_0x5b8c('0x19'))(new Redis(config[_0x5b8c('0x16')]));require(_0x5b8c('0x1a'))[_0x5b8c('0x1b')](socket);var jayson=require(_0x5b8c('0x1c'));var client=jayson[_0x5b8c('0x1d')][_0x5b8c('0x1e')]({'port':0x232c});var client9002=jayson[_0x5b8c('0x1d')][_0x5b8c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x72b6c8,_0x23bdee,_0x73a705,_0x62a49f){return new BPromise(function(_0x2d3f6b,_0x166fcf){var _0xb15a77=_0x62a49f||client;return _0xb15a77[_0x5b8c('0x1f')](_0x72b6c8,_0x73a705)['then'](function(_0x5bb874){logger[_0x5b8c('0x20')](_0x5b8c('0x21'),_0x23bdee,_0x5b8c('0x22'));logger['debug'](_0x5b8c('0x23'),_0x23bdee,_0x5b8c('0x22'),JSON[_0x5b8c('0x24')](_0x5bb874));if(_0x5bb874[_0x5b8c('0x25')]){if(_0x5bb874['error'][_0x5b8c('0x26')]===0x1f4){logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x5bb874[_0x5b8c('0x25')][_0x5b8c('0x27')]);return _0x166fcf(_0x5bb874['error'][_0x5b8c('0x27')]);}logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x5bb874['error'][_0x5b8c('0x27')]);return _0x2d3f6b(_0x5bb874[_0x5b8c('0x25')][_0x5b8c('0x27')]);}else{logger['info'](_0x5b8c('0x21'),_0x23bdee,'request\x20sent');_0x2d3f6b(_0x5bb874[_0x5b8c('0x28')][_0x5b8c('0x27')]);}})[_0x5b8c('0x29')](function(_0x173fb1){logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x173fb1);_0x166fcf(_0x173fb1);});});}function respondWithStatusCode(_0xefa9e0,_0x1b4e88){_0x1b4e88=_0x1b4e88||0xcc;return function(_0x4b72c9){if(_0x4b72c9){return _0xefa9e0[_0x5b8c('0x2a')](_0x1b4e88);}return _0xefa9e0[_0x5b8c('0x2b')](_0x1b4e88)[_0x5b8c('0x2c')]();};}function respondWithResult(_0x257ec1,_0x170d21){_0x170d21=_0x170d21||0xc8;return function(_0x1dd47b){if(_0x1dd47b){return _0x257ec1['status'](_0x170d21)[_0x5b8c('0x2d')](_0x1dd47b);}};}function respondWithFilteredResult(_0x56bd34,_0x2b7d39){return function(_0x1bc59e){if(_0x1bc59e){var _0x420816=typeof _0x2b7d39[_0x5b8c('0x2e')]===_0x5b8c('0x2f')&&typeof _0x2b7d39['limit']==='undefined';var _0x21c632=_0x1bc59e[_0x5b8c('0x30')];var _0x28bc2b=_0x420816?0x0:_0x2b7d39[_0x5b8c('0x2e')];var _0x3e1598=_0x420816?_0x1bc59e[_0x5b8c('0x30')]:_0x2b7d39[_0x5b8c('0x2e')]+_0x2b7d39[_0x5b8c('0x31')];var _0x5689e3;if(_0x3e1598>=_0x21c632){_0x3e1598=_0x21c632;_0x5689e3=0xc8;}else{_0x5689e3=0xce;}_0x56bd34[_0x5b8c('0x2b')](_0x5689e3);return _0x56bd34[_0x5b8c('0x32')](_0x5b8c('0x33'),_0x28bc2b+'-'+_0x3e1598+'/'+_0x21c632)['json'](_0x1bc59e);}return null;};}function patchUpdates(_0x4e2c40){return function(_0x2de48d){try{jsonpatch[_0x5b8c('0x34')](_0x2de48d,_0x4e2c40,!![]);}catch(_0x595851){return BPromise['reject'](_0x595851);}return _0x2de48d[_0x5b8c('0x35')]();};}function saveUpdates(_0x4fd9a0,_0x4bd9ee){return function(_0x472b32){if(_0x472b32){return _0x472b32['update'](_0x4fd9a0)['then'](function(_0x5b214c){return _0x5b214c;});}return null;};}function removeEntity(_0xd48b97,_0x51c44d){return function(_0x461452){if(_0x461452){return _0x461452['destroy']()[_0x5b8c('0x36')](function(){var _0x5a5500=_0x461452[_0x5b8c('0x37')]({'plain':!![]});var _0x5f51ac=_0x5b8c('0x38');return db[_0x5b8c('0x39')]['destroy']({'where':{'type':_0x5f51ac,'resourceId':_0x5a5500['id']}})[_0x5b8c('0x36')](function(){return _0x461452;});})[_0x5b8c('0x36')](function(){_0xd48b97[_0x5b8c('0x2b')](0xcc)[_0x5b8c('0x2c')]();});}};}function handleEntityNotFound(_0x54f5b6,_0x4442e7){return function(_0x1548f1){if(!_0x1548f1){_0x54f5b6[_0x5b8c('0x2a')](0x194);}return _0x1548f1;};}function handleError(_0x5b060b,_0x459ae1){_0x459ae1=_0x459ae1||0x1f4;return function(_0x1c39c6){logger[_0x5b8c('0x25')](_0x1c39c6[_0x5b8c('0x3a')]);if(_0x1c39c6[_0x5b8c('0x3b')]){delete _0x1c39c6['name'];}_0x5b060b[_0x5b8c('0x2b')](_0x459ae1)[_0x5b8c('0x3c')](_0x1c39c6);};}exports[_0x5b8c('0x3d')]=function(_0x13e87b,_0x22f050){var _0x377f09={'include':[{'model':db[_0x5b8c('0x3e')],'as':'mandatoryDispositionPause'}]},_0xb1df90={},_0x560063={'count':0x0,'rows':[]};var _0x4f3d6b=_[_0x5b8c('0x3f')](db['FaxAccount'][_0x5b8c('0x40')],function(_0x43573f){return{'name':_0x43573f['fieldName'],'type':_0x43573f[_0x5b8c('0x41')]['key']};});_0xb1df90['model']=_[_0x5b8c('0x3f')](_0x4f3d6b,_0x5b8c('0x3b'));_0xb1df90[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x13e87b['query']);_0xb1df90[_0x5b8c('0x44')]=_['intersection'](_0xb1df90[_0x5b8c('0x45')],_0xb1df90['query']);_0x377f09[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0xb1df90[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x377f09[_0x5b8c('0x46')]=_0x377f09[_0x5b8c('0x46')]['length']?_0x377f09[_0x5b8c('0x46')]:_0xb1df90[_0x5b8c('0x45')];if(!_0x13e87b[_0x5b8c('0x42')]['hasOwnProperty']('nolimit')){_0x377f09[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x377f09[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}_0x377f09[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x377f09[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0x13e87b[_0x5b8c('0x42')],_0xb1df90[_0x5b8c('0x44')]),_0x4f3d6b);if(_0x13e87b['query'][_0x5b8c('0x4d')]){_0x377f09['where']=_[_0x5b8c('0x4e')](_0x377f09[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x4f3d6b,function(_0x1550fe){if(_0x1550fe[_0x5b8c('0x41')]!==_0x5b8c('0x4f')){var _0x478522={};_0x478522[_0x1550fe[_0x5b8c('0x3b')]]={'$like':'%'+_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x478522;}})});}_0x377f09=_[_0x5b8c('0x4e')]({},_0x377f09,_0x13e87b[_0x5b8c('0x50')]);var _0x7a5fe4={'where':_0x377f09[_0x5b8c('0x4b')]};return db[_0x5b8c('0x51')][_0x5b8c('0x30')](_0x7a5fe4)['then'](function(_0x4974d4){_0x560063[_0x5b8c('0x30')]=_0x4974d4;if(_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x377f09['include']=[{'all':!![]}];}return db['FaxAccount'][_0x5b8c('0x53')](_0x377f09);})['then'](function(_0x35bd4a){_0x560063[_0x5b8c('0x54')]=_0x35bd4a;return _0x560063;})[_0x5b8c('0x36')](respondWithFilteredResult(_0x22f050,_0x377f09))['catch'](handleError(_0x22f050,null));};exports['show']=function(_0x11fe7e,_0x4d5a51){var _0x17567d={'raw':![],'where':{'id':_0x11fe7e[_0x5b8c('0x55')]['id']},'include':[{'model':db[_0x5b8c('0x3e')],'as':_0x5b8c('0x56')}]},_0x129206={};_0x129206[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0x51')][_0x5b8c('0x40')]);_0x129206[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x11fe7e[_0x5b8c('0x42')]);_0x129206[_0x5b8c('0x44')]=_['intersection'](_0x129206[_0x5b8c('0x45')],_0x129206['query']);_0x17567d[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x129206['model'],qs[_0x5b8c('0x48')](_0x11fe7e[_0x5b8c('0x42')]['fields']));_0x17567d[_0x5b8c('0x46')]=_0x17567d[_0x5b8c('0x46')]['length']?_0x17567d[_0x5b8c('0x46')]:_0x129206[_0x5b8c('0x45')];if(_0x11fe7e[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x17567d[_0x5b8c('0x57')]=[{'all':!![]}];}_0x17567d=_[_0x5b8c('0x4e')]({},_0x17567d,_0x11fe7e[_0x5b8c('0x50')]);return db[_0x5b8c('0x51')][_0x5b8c('0x58')](_0x17567d)[_0x5b8c('0x36')](handleEntityNotFound(_0x4d5a51,null))[_0x5b8c('0x36')](respondWithResult(_0x4d5a51,null))[_0x5b8c('0x29')](handleError(_0x4d5a51,null));};exports[_0x5b8c('0x59')]=function(_0x35f71c,_0x19e949){return db[_0x5b8c('0x51')][_0x5b8c('0x59')](_0x35f71c[_0x5b8c('0x5a')],{})['then'](function(_0x5415fd){var _0x1550c6=_0x35f71c[_0x5b8c('0x5b')][_0x5b8c('0x37')]({'plain':!![]});if(!_0x1550c6)throw new Error(_0x5b8c('0x5c'));if(_0x1550c6[_0x5b8c('0x5d')]==='user'){var _0x1d2287=_0x5415fd[_0x5b8c('0x37')]({'plain':!![]});var _0xf0e360=_0x5b8c('0x38');return db[_0x5b8c('0x5e')][_0x5b8c('0x58')]({'where':{'name':_0xf0e360,'userProfileId':_0x1550c6['userProfileId']},'raw':!![]})[_0x5b8c('0x36')](function(_0x520e74){if(_0x520e74&&_0x520e74[_0x5b8c('0x5f')]===0x0){return db['UserProfileResource'][_0x5b8c('0x59')]({'name':_0x1d2287[_0x5b8c('0x3b')],'resourceId':_0x1d2287['id'],'type':_0x520e74[_0x5b8c('0x3b')],'sectionId':_0x520e74['id']},{})[_0x5b8c('0x36')](function(){return _0x5415fd;});}else{return _0x5415fd;}})[_0x5b8c('0x29')](function(_0x2673db){logger[_0x5b8c('0x25')](_0x5b8c('0x60'),_0x2673db);throw _0x2673db;});}return _0x5415fd;})[_0x5b8c('0x36')](respondWithResult(_0x19e949,0xc9))[_0x5b8c('0x29')](handleError(_0x19e949,null));};exports[_0x5b8c('0x61')]=function(_0x58e4af,_0x57d96f){if(_0x58e4af[_0x5b8c('0x5a')]['id']){delete _0x58e4af[_0x5b8c('0x5a')]['id'];}return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x58e4af[_0x5b8c('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5b8c('0x36')](handleEntityNotFound(_0x57d96f,null))[_0x5b8c('0x36')](saveUpdates(_0x58e4af[_0x5b8c('0x5a')],null))[_0x5b8c('0x36')](respondWithResult(_0x57d96f,null))['catch'](handleError(_0x57d96f,null));};exports[_0x5b8c('0x62')]=function(_0x3d774e,_0x5921f1){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x3d774e[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x5921f1,null))[_0x5b8c('0x36')](removeEntity(_0x5921f1,null))[_0x5b8c('0x29')](handleError(_0x5921f1,null));};exports[_0x5b8c('0x63')]=function(_0xaad19,_0x508f01){return db[_0x5b8c('0x51')][_0x5b8c('0x63')]()['then'](respondWithResult(_0x508f01,null))[_0x5b8c('0x29')](handleError(_0x508f01,null));};exports[_0x5b8c('0x64')]=function(_0x540238,_0x42fb42,_0x301b43){if(_0x540238[_0x5b8c('0x5a')]['id']){delete _0x540238[_0x5b8c('0x5a')]['id'];}return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x540238[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x42fb42,null))[_0x5b8c('0x36')](function(_0x534551){if(_0x534551){_0x540238[_0x5b8c('0x5a')][_0x5b8c('0x65')]=_0x534551['id'];return db[_0x5b8c('0x66')]['create'](_0x540238['body']);}})['then'](respondWithResult(_0x42fb42,null))['catch'](handleError(_0x42fb42,null));};exports['getDispositions']=function(_0x148aa0,_0x5ea8c7,_0x3e6cde){var _0x1508bb={'raw':![],'where':{}};var _0x474f23={};var _0x2df7be={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')]['findOne']({'where':{'id':_0x148aa0[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x5ea8c7,null))[_0x5b8c('0x36')](function(_0x40b64f){if(_0x40b64f){_0x474f23[_0x5b8c('0x45')]=_['keys'](db[_0x5b8c('0x66')][_0x5b8c('0x40')]);_0x474f23['query']=_['keys'](_0x148aa0[_0x5b8c('0x42')]);_0x474f23['filters']=_['intersection'](_0x474f23['model'],_0x474f23[_0x5b8c('0x42')]);_0x1508bb[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x474f23[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x1508bb['attributes']=_0x1508bb[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x1508bb[_0x5b8c('0x46')]:_0x474f23[_0x5b8c('0x45')];if(!_0x148aa0[_0x5b8c('0x42')]['hasOwnProperty'](_0x5b8c('0x68'))){_0x1508bb[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x1508bb['offset']=qs[_0x5b8c('0x2e')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}_0x1508bb[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x1508bb[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_['pick'](_0x148aa0[_0x5b8c('0x42')],_0x474f23['filters']));_0x1508bb['where'][_0x5b8c('0x65')]=_0x40b64f['id'];if(_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x4d')]){_0x1508bb[_0x5b8c('0x4b')]=_['merge'](_0x1508bb[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x1508bb[_0x5b8c('0x46')],function(_0x4a4297){var _0x3771b4={};_0x3771b4[_0x4a4297]={'$like':'%'+_0x148aa0[_0x5b8c('0x42')]['filter']+'%'};return _0x3771b4;})});}_0x1508bb=_[_0x5b8c('0x4e')]({},_0x1508bb,_0x148aa0[_0x5b8c('0x50')]);return db['Disposition'][_0x5b8c('0x30')]({'where':_0x1508bb[_0x5b8c('0x4b')]})[_0x5b8c('0x36')](function(_0x2cb321){_0x2df7be['count']=_0x2cb321;if(_0x148aa0[_0x5b8c('0x42')]['includeAll']){_0x1508bb[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x66')][_0x5b8c('0x53')](_0x1508bb);})[_0x5b8c('0x36')](function(_0x33de1b){_0x2df7be[_0x5b8c('0x54')]=_0x33de1b;return _0x2df7be;});}})[_0x5b8c('0x36')](respondWithFilteredResult(_0x5ea8c7,_0x1508bb))['catch'](handleError(_0x5ea8c7,null));};exports[_0x5b8c('0x69')]=function(_0x3be657,_0x3a016e,_0x5db4ea){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x3be657[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x3a016e,null))[_0x5b8c('0x36')](function(_0x560264){if(_0x560264){return _0x560264[_0x5b8c('0x69')](_0x3be657[_0x5b8c('0x42')][_0x5b8c('0x6a')]);}})[_0x5b8c('0x36')](respondWithStatusCode(_0x3a016e,null))[_0x5b8c('0x29')](handleError(_0x3a016e,null));};exports[_0x5b8c('0x6b')]=function(_0x340269,_0x1e467b,_0x4dd661){if(_0x340269[_0x5b8c('0x5a')]['id']){delete _0x340269[_0x5b8c('0x5a')]['id'];}return db[_0x5b8c('0x51')][_0x5b8c('0x58')]({'where':{'id':_0x340269[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e467b,null))[_0x5b8c('0x36')](function(_0x116d9b){if(_0x116d9b){_0x340269[_0x5b8c('0x5a')][_0x5b8c('0x65')]=_0x116d9b['id'];return db[_0x5b8c('0x6c')][_0x5b8c('0x59')](_0x340269[_0x5b8c('0x5a')]);}})[_0x5b8c('0x36')](respondWithResult(_0x1e467b,null))[_0x5b8c('0x29')](handleError(_0x1e467b,null));};exports['getAnswers']=function(_0x3b217a,_0x52feac,_0x526510){var _0x35787e={'raw':![],'where':{}};var _0x1fc5c3={};var _0x433a8d={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x3b217a[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x52feac,null))[_0x5b8c('0x36')](function(_0x1f1216){if(_0x1f1216){_0x1fc5c3[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0x6c')][_0x5b8c('0x40')]);_0x1fc5c3['query']=_[_0x5b8c('0x43')](_0x3b217a[_0x5b8c('0x42')]);_0x1fc5c3[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x1fc5c3[_0x5b8c('0x45')],_0x1fc5c3['query']);_0x35787e[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x1fc5c3[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x35787e['attributes']=_0x35787e[_0x5b8c('0x46')]['length']?_0x35787e[_0x5b8c('0x46')]:_0x1fc5c3[_0x5b8c('0x45')];if(!_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x35787e[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x35787e[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x3b217a[_0x5b8c('0x42')]['offset']);}_0x35787e[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x35787e[_0x5b8c('0x4b')]=qs['filters'](_[_0x5b8c('0x4c')](_0x3b217a[_0x5b8c('0x42')],_0x1fc5c3[_0x5b8c('0x44')]));_0x35787e[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x1f1216['id'];if(_0x3b217a['query']['filter']){_0x35787e['where']=_[_0x5b8c('0x4e')](_0x35787e[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x35787e['attributes'],function(_0x4375e7){var _0x12187f={};_0x12187f[_0x4375e7]={'$like':'%'+_0x3b217a['query'][_0x5b8c('0x4d')]+'%'};return _0x12187f;})});}_0x35787e=_[_0x5b8c('0x4e')]({},_0x35787e,_0x3b217a[_0x5b8c('0x50')]);return db['CannedAnswer'][_0x5b8c('0x30')]({'where':_0x35787e['where']})[_0x5b8c('0x36')](function(_0x48a635){_0x433a8d[_0x5b8c('0x30')]=_0x48a635;if(_0x3b217a[_0x5b8c('0x42')]['includeAll']){_0x35787e[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x6c')][_0x5b8c('0x53')](_0x35787e);})['then'](function(_0x3bc535){_0x433a8d[_0x5b8c('0x54')]=_0x3bc535;return _0x433a8d;});}})['then'](respondWithFilteredResult(_0x52feac,_0x35787e))[_0x5b8c('0x29')](handleError(_0x52feac,null));};exports[_0x5b8c('0x6f')]=function(_0x45280a,_0x685982,_0x3be058){return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x45280a[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x685982,null))[_0x5b8c('0x36')](function(_0x16b43d){if(_0x16b43d){return _0x16b43d[_0x5b8c('0x6f')](_0x45280a[_0x5b8c('0x42')][_0x5b8c('0x6a')]);}})[_0x5b8c('0x36')](respondWithStatusCode(_0x685982,null))[_0x5b8c('0x29')](handleError(_0x685982,null));};exports[_0x5b8c('0x70')]=function(_0x5fa8d4,_0x3b7fbd,_0x49c290){return db[_0x5b8c('0x71')][_0x5b8c('0x58')]({'where':{'id':_0x5fa8d4['params']['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x3b7fbd,null))[_0x5b8c('0x36')](function(_0x20f54b){if(_0x20f54b){return _0x20f54b[_0x5b8c('0x70')](_0x5fa8d4[_0x5b8c('0x5a')][_0x5b8c('0x6a')],_[_0x5b8c('0x72')](_0x5fa8d4[_0x5b8c('0x5a')],[_0x5b8c('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x3b7fbd,null))[_0x5b8c('0x29')](handleError(_0x3b7fbd,null));};exports['getInteractions']=function(_0xfd5971,_0x9759b6,_0x351275){var _0xb5afbd={'raw':![],'where':{}};var _0x4de0e8={};var _0x5b2cee={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5b8c('0x6d')]({'where':{'id':_0xfd5971[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x9759b6,null))[_0x5b8c('0x36')](function(_0x3506ac){if(_0x3506ac){_0x4de0e8['model']=_[_0x5b8c('0x43')](db['FaxInteraction'][_0x5b8c('0x40')]);_0x4de0e8[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0xfd5971['query']);_0x4de0e8[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x4de0e8[_0x5b8c('0x45')],_0x4de0e8['query']);_0xb5afbd[_0x5b8c('0x46')]=_['intersection'](_0x4de0e8[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0xb5afbd[_0x5b8c('0x46')]=_0xb5afbd[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0xb5afbd['attributes']:_0x4de0e8[_0x5b8c('0x45')];if(!_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0xb5afbd[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0xfd5971[_0x5b8c('0x42')]['limit']);_0xb5afbd[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0xfd5971['query'][_0x5b8c('0x2e')]);}_0xb5afbd[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0xfd5971['query']['sort']);_0xb5afbd['where']=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0xfd5971[_0x5b8c('0x42')],_0x4de0e8[_0x5b8c('0x44')]));_0xb5afbd[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x3506ac['id'];if(_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x4d')]){_0xb5afbd[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0xb5afbd[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0xb5afbd['attributes'],function(_0x1cddd0){var _0x224efc={};_0x224efc[_0x1cddd0]={'$like':'%'+_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x224efc;})});}_0xb5afbd=_[_0x5b8c('0x4e')]({},_0xb5afbd,_0xfd5971['options']);return db['FaxInteraction'][_0x5b8c('0x30')]({'where':_0xb5afbd[_0x5b8c('0x4b')]})['then'](function(_0x1363bd){_0x5b2cee[_0x5b8c('0x30')]=_0x1363bd;if(_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0xb5afbd[_0x5b8c('0x57')]=[{'model':db[_0x5b8c('0x73')],'as':_0x5b8c('0x74'),'required':![]},{'model':db['User'],'as':_0x5b8c('0x75'),'attributes':[_0x5b8c('0x3b'),_0x5b8c('0x76'),_0x5b8c('0x77')],'required':![]},{'model':db[_0x5b8c('0x78')],'as':'Tags','attributes':['id',_0x5b8c('0x3b'),_0x5b8c('0x79')],'where':_0xfd5971['query'][_0x5b8c('0x7a')]?{'id':_0xfd5971['query']['tag']}:undefined,'required':_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x7a')]?!![]:![]}];}return db[_0x5b8c('0x71')][_0x5b8c('0x53')](_0xb5afbd);})[_0x5b8c('0x36')](function(_0x3eca5c){_0x5b2cee[_0x5b8c('0x54')]=_0x3eca5c;return _0x5b2cee;});}})[_0x5b8c('0x36')](respondWithFilteredResult(_0x9759b6,_0xb5afbd))['catch'](handleError(_0x9759b6,null));};exports['addApplications']=function(_0x48edaa,_0x2df5d8,_0x3f4893){return db['FaxAccount'][_0x5b8c('0x6d')]({'where':{'id':_0x48edaa[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x2df5d8,null))[_0x5b8c('0x36')](function(_0x3a6134){if(_0x3a6134){return db[_0x5b8c('0x7b')][_0x5b8c('0x7c')](function(_0x11f460){return db[_0x5b8c('0x7d')]['destroy']({'where':{'FaxAccountId':_0x48edaa['params']['id']},'transaction':_0x11f460})[_0x5b8c('0x36')](function(_0x306b3e){var _0x3a106e=_[_0x5b8c('0x3f')](_0x48edaa['body'],function(_0x35b00c){_0x35b00c[_0x5b8c('0x65')]=_0x48edaa[_0x5b8c('0x55')]['id'];return _0x35b00c;});return db[_0x5b8c('0x7d')]['bulkCreate'](_0x3a106e,{'transaction':_0x11f460});});})['then'](function(){return db[_0x5b8c('0x7d')]['findAndCountAll']({'where':{'FaxAccountId':_0x48edaa[_0x5b8c('0x55')]['id']},'order':_0x5b8c('0x7e')});});}})[_0x5b8c('0x36')](respondWithResult(_0x2df5d8,null))[_0x5b8c('0x29')](handleError(_0x2df5d8,null));};exports['getApplications']=function(_0x435e81,_0x39baa2,_0x4117ad){var _0x5f4dee={};var _0x47d17c={};var _0x1b1450;var _0x5ae785;return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x435e81['params']['id']}})['then'](handleEntityNotFound(_0x39baa2,null))[_0x5b8c('0x36')](function(_0x271512){if(_0x271512){_0x1b1450=_0x271512;_0x47d17c[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db['FaxApplication'][_0x5b8c('0x40')]);_0x47d17c[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x435e81[_0x5b8c('0x42')]);_0x47d17c['filters']=_[_0x5b8c('0x47')](_0x47d17c[_0x5b8c('0x45')],_0x47d17c[_0x5b8c('0x42')]);_0x5f4dee['attributes']=_[_0x5b8c('0x47')](_0x47d17c[_0x5b8c('0x45')],qs['fields'](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x5f4dee[_0x5b8c('0x46')]=_0x5f4dee[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x5f4dee[_0x5b8c('0x46')]:_0x47d17c[_0x5b8c('0x45')];_0x5f4dee[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x5f4dee[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0x435e81[_0x5b8c('0x42')],_0x47d17c[_0x5b8c('0x44')]));if(_0x435e81[_0x5b8c('0x42')]['filter']){_0x5f4dee[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x5f4dee[_0x5b8c('0x4b')],{'$or':_['map'](_0x5f4dee[_0x5b8c('0x46')],function(_0x20b6be){var _0x5485d1={};_0x5485d1[_0x20b6be]={'$like':'%'+_0x435e81['query'][_0x5b8c('0x4d')]+'%'};return _0x5485d1;})});}_0x5f4dee=_['merge']({},_0x5f4dee,_0x435e81[_0x5b8c('0x50')]);return _0x1b1450[_0x5b8c('0x7f')](_0x5f4dee);}})[_0x5b8c('0x36')](function(_0x54db4d){if(_0x54db4d){_0x5ae785=_0x54db4d[_0x5b8c('0x67')];if(!_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x5f4dee[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x5f4dee[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x435e81['query'][_0x5b8c('0x2e')]);}return _0x1b1450['getApplications'](_0x5f4dee);}})[_0x5b8c('0x36')](function(_0x59d6fe){if(_0x59d6fe){return _0x59d6fe?{'count':_0x5ae785,'rows':_0x59d6fe}:null;}})[_0x5b8c('0x36')](respondWithResult(_0x39baa2,null))[_0x5b8c('0x29')](handleError(_0x39baa2,null));};function Extension(_0x1e576d,_0x2b3fbb,_0x477f42,_0x4cd2de){this[_0x5b8c('0x80')]=_0x5b8c('0x81');this[_0x5b8c('0x82')]=_0x1e576d['localstationid'];this[_0x5b8c('0x83')]=_0x4cd2de;this[_0x5b8c('0x41')]='system';this[_0x5b8c('0x84')]='Fax\x20Extension';this[_0x5b8c('0x65')]=_0x1e576d['id'];this[_0x5b8c('0x7e')]=_0x2b3fbb;this['appdata']=_0x477f42;}function createExtensionsReciveFax(_0x2599f5){var _0x5b7dc8=0x1;var _0x5d369=[];_0x5d369['push'](new Extension(_0x2599f5,_0x5b7dc8,'',_0x5b8c('0x85')));_0x5b7dc8+=0x1;_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,_0x5b8c('0x87'),_0x5b8c('0x88')));_0x5b7dc8+=0x1;for(var _0x45eec4 in _0x2599f5){if(_0x2599f5[_0x5b8c('0x6e')](_0x45eec4)&&(_0x45eec4===_0x5b8c('0x89')||_0x45eec4===_0x5b8c('0x8a')||_0x45eec4==='gateway'||_0x45eec4===_0x5b8c('0x8b')||_0x45eec4===_0x5b8c('0x8c')||_0x45eec4===_0x5b8c('0x8d')||_0x45eec4===_0x5b8c('0x8e')||_0x45eec4===_0x5b8c('0x8f')||_0x45eec4===_0x5b8c('0x90'))){_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,_0x5b8c('0x91')+_0x45eec4+')='+_0x2599f5[_0x45eec4],_0x5b8c('0x88')));_0x5b7dc8+=0x1;}}_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,'6','Wait'));_0x5b7dc8+=0x1;_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,'/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',_0x5b8c('0x92')));_0x5b7dc8=0x0;return _0x5d369;}exports[_0x5b8c('0x93')]=function(_0x2a594b,_0x2b1fe7,_0x2d0de5){var _0x1434a1;return db[_0x5b8c('0x7b')][_0x5b8c('0x7c')](function(_0x523e7a){return db[_0x5b8c('0x51')][_0x5b8c('0x59')](_0x2a594b['body'],{'transaction':_0x523e7a})[_0x5b8c('0x36')](function(_0x52ac84){_0x1434a1=_0x52ac84['get']({'plain':!![]});return db[_0x5b8c('0x94')][_0x5b8c('0x95')](createExtensionsReciveFax(_0x1434a1),{'transaction':_0x523e7a});});})[_0x5b8c('0x36')](function(){return _0x1434a1;})['then'](respondWithResult(_0x2b1fe7,null))[_0x5b8c('0x29')](handleError(_0x2b1fe7,null));};exports[_0x5b8c('0x96')]=function(_0x5631f1,_0x3a7061,_0x150a89){var _0x208c1f;return db[_0x5b8c('0x7b')]['transaction'](function(_0x426dfa){return db[_0x5b8c('0x51')][_0x5b8c('0x61')](_0x5631f1[_0x5b8c('0x5a')],{'where':{'id':_0x5631f1[_0x5b8c('0x5a')]['id']},'transaction':_0x426dfa})['then'](function(_0x15c9d0){return db[_0x5b8c('0x94')][_0x5b8c('0x62')]({'where':{'FaxAccountId':_0x5631f1[_0x5b8c('0x5a')]['id']},'transaction':_0x426dfa})[_0x5b8c('0x36')](function(_0x3f827f){return db[_0x5b8c('0x94')][_0x5b8c('0x95')](createExtensionsReciveFax(_[_0x5b8c('0x72')](_0x5631f1['body'],[_0x5b8c('0x97'),_0x5b8c('0x98'),'createdAt',_0x5b8c('0x99'),'TrunkId',_0x5b8c('0x9a')])),{'transaction':_0x426dfa});});});})[_0x5b8c('0x36')](function(){return db[_0x5b8c('0x51')][_0x5b8c('0x9b')](_0x5631f1[_0x5b8c('0x5a')]['id']);})['then'](respondWithResult(_0x3a7061,null))[_0x5b8c('0x29')](handleError(_0x3a7061,null));};exports[_0x5b8c('0x9c')]=function(_0x3c5703,_0x5049ad,_0x185bbf){var _0x30ffc3={'raw':!![],'where':{}};var _0x49b2be={};var _0x9a4076={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x3c5703[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x5049ad,null))[_0x5b8c('0x36')](function(_0x195e60){if(_0x195e60){_0x49b2be['model']=_[_0x5b8c('0x43')](db[_0x5b8c('0x9d')][_0x5b8c('0x40')]);_0x49b2be[_0x5b8c('0x42')]=_['keys'](_0x3c5703['query']);_0x49b2be[_0x5b8c('0x44')]=_['intersection'](_0x49b2be[_0x5b8c('0x45')],_0x49b2be[_0x5b8c('0x42')]);_0x30ffc3[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x49b2be[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x30ffc3['attributes']=_0x30ffc3['attributes'][_0x5b8c('0x67')]?_0x30ffc3[_0x5b8c('0x46')]:_0x49b2be['model'];if(!_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x6e')]('nolimit')){_0x30ffc3[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x3c5703[_0x5b8c('0x42')]['limit']);_0x30ffc3['offset']=qs[_0x5b8c('0x2e')](_0x3c5703['query'][_0x5b8c('0x2e')]);}_0x30ffc3[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x30ffc3[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_['pick'](_0x3c5703[_0x5b8c('0x42')],_0x49b2be[_0x5b8c('0x44')]));_0x30ffc3[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x195e60['id'];if(_0x3c5703['query'][_0x5b8c('0x4d')]){_0x30ffc3['where']=_[_0x5b8c('0x4e')](_0x30ffc3['where'],{'$or':_[_0x5b8c('0x3f')](_0x30ffc3['attributes'],function(_0x92eef1){var _0x58dddc={};_0x58dddc[_0x92eef1]={'$like':'%'+_0x3c5703[_0x5b8c('0x42')]['filter']+'%'};return _0x58dddc;})});}if(_0x3c5703['query'][_0x5b8c('0x9e')]){var _0x19c112=_0x3c5703['query'][_0x5b8c('0x9e')][_0x5b8c('0x9f')](',');var _0x599286={};_0x599286[_0x19c112[0x0]]={'$gte':moment(_0x19c112[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x30ffc3[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x30ffc3['where'],_0x599286);}_0x30ffc3=_[_0x5b8c('0x4e')]({},_0x30ffc3,_0x3c5703[_0x5b8c('0x50')]);return db[_0x5b8c('0x9d')][_0x5b8c('0x30')]({'where':_0x30ffc3[_0x5b8c('0x4b')]})[_0x5b8c('0x36')](function(_0x782c7d){_0x9a4076[_0x5b8c('0x30')]=_0x782c7d;if(_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x30ffc3[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x9d')][_0x5b8c('0x53')](_0x30ffc3);})[_0x5b8c('0x36')](function(_0x5425c3){_0x9a4076['rows']=_0x5425c3;return _0x9a4076;});}})['then'](respondWithFilteredResult(_0x5049ad,_0x30ffc3))[_0x5b8c('0x29')](handleError(_0x5049ad,null));};exports['send']=function(_0x5b2605,_0x3f27cc,_0x2eff43){var _0x40c5bb,_0x1c8b41={},_0x2fd16e;if(_0x5b2605[_0x5b8c('0x5a')]['to']){_0x2fd16e=_0x5b2605[_0x5b8c('0x5a')]['to'][0x0];}return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x5b2605['params']['id']},'include':[{'model':db[_0x5b8c('0xa0')],'as':_0x5b8c('0xa1'),'include':[{'model':db[_0x5b8c('0x73')],'as':_0x5b8c('0xa2'),'where':{'fax':_0x2fd16e},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x3f27cc,null))[_0x5b8c('0x36')](function(_0x55a952){_0x40c5bb=_0x55a952;if(_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')]&&_0x5b2605['body'][_0x5b8c('0xa3')][_0x5b8c('0x67')]){for(var _0x5dd9a7=0x0;_0x5dd9a7<_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5b8c('0x67')];_0x5dd9a7+=0x1){_0x5b2605[_0x5b8c('0x5a')]['attachments'][_0x5dd9a7]={'filename':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5dd9a7][_0x5b8c('0x3b')],'id':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5dd9a7]['id'],'path':path['join'](config[_0x5b8c('0xa4')],'server/files/attachments',_0x5b2605[_0x5b8c('0x5a')]['attachments'][_0x5dd9a7][_0x5b8c('0xa5')])};}}return respondWithRpcPromise(_0x5b8c('0xa6'),_0x5b8c('0xa6'),{'FaxAccountId':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x55')]['id'])?undefined:_0x5b2605['params']['id'],'path':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')])?undefined:_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')],'fax':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')]['to'][0x0])?undefined:_0x5b2605[_0x5b8c('0x5a')]['to'][0x0]},client9002);})[_0x5b8c('0x36')](function(){if(_0x40c5bb){if(_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')]['from'])){_0x5b2605['body'][_0x5b8c('0xa9')]=util[_0x5b8c('0xaa')](_0x5b8c('0xab'),_0x40c5bb[_0x5b8c('0x3b')],_0x40c5bb[_0x5b8c('0xac')]);}if(_0x40c5bb[_0x5b8c('0xa1')]){if(_0x40c5bb[_0x5b8c('0xa1')]['Contacts']['length']){return _0x40c5bb[_0x5b8c('0xa1')][_0x5b8c('0xa2')][0x0];}else{return db[_0x5b8c('0x73')][_0x5b8c('0x59')](_[_0x5b8c('0x17')](_0x5b2605[_0x5b8c('0x5a')],{'firstName':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'phone':_0x5b2605['body']['to'][0x0],'fax':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'ListId':_0x40c5bb[_0x5b8c('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5b8c('0xad'));}})['then'](function(_0x17fecd){if(_0x17fecd){return db[_0x5b8c('0x71')][_0x5b8c('0x58')]({'where':{'ContactId':_0x17fecd['id'],'closed':![],'FaxAccountId':_0x40c5bb['id']}})['then'](function(_0x7b2d0a){if(_0x7b2d0a){return[_0x7b2d0a,![]];}return db[_0x5b8c('0x71')][_0x5b8c('0x59')]({'UserId':_0x5b2605[_0x5b8c('0x5b')]['id'],'ContactId':_0x17fecd['id'],'FaxAccountId':_0x40c5bb['id'],'fax':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'firstMsgDirection':_0x5b8c('0xae'),'Messages':[_[_0x5b8c('0x4e')](_0x5b2605[_0x5b8c('0x5a')],{'read':![],'body':_0x5b2605['body'][_0x5b8c('0xa3')][0x0][_0x5b8c('0xaf')],'FaxAccountId':_0x40c5bb['id'],'UserId':_0x5b2605['user']['id'],'ContactId':_0x17fecd['id'],'AttachmentId':_0x5b2605['body'][_0x5b8c('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5b8c('0x9d')],'as':_0x5b8c('0xb0')}]})['then'](function(_0x37804f){return[_0x37804f,!![]];});});}else{throw new Error(_0x5b8c('0xb1'));}})[_0x5b8c('0xb2')](function(_0x180878,_0x2b44c1){if(_0x2b44c1){return _0x180878;}return db[_0x5b8c('0x9d')][_0x5b8c('0x59')]({'direction':'out','read':![],'body':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['filename'],'FaxAccountId':_0x40c5bb['id'],'FaxInteractionId':_0x180878['id'],'UserId':_0x5b2605['user']['id'],'ContactId':_0x180878['ContactId'],'AttachmentId':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['id']})[_0x5b8c('0x36')](function(_0x425227){_0x180878['dataValues'][_0x5b8c('0xb0')]=[];_0x180878[_0x5b8c('0xb3')][_0x5b8c('0xb0')][_0x5b8c('0x86')](_0x425227['dataValues']);return _0x180878;});})[_0x5b8c('0x36')](function(_0x5a7131){respondWithRpcPromise(_0x5b8c('0xb4'),_0x5b8c('0xb4'),{'FaxAccountId':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x55')]['id'])?undefined:_0x5b2605[_0x5b8c('0x55')]['id'],'path':_['isNil'](_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')])?undefined:_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')],'fax':_['isNil'](_0x5b2605[_0x5b8c('0x5a')]['to'][0x0])?undefined:_0x5b2605['body']['to'][0x0],'AttachmentId':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['id']},client9002)[_0x5b8c('0x36')](function(_0x17409c){logger['info'](_0x5b8c('0xb5'),_0x17409c);})[_0x5b8c('0x29')](function(_0x523d3f){logger['info']('SendFaxRpc,\x20%s',_0x523d3f);});return _0x5a7131;})['then'](respondWithResult(_0x3f27cc,null))[_0x5b8c('0x29')](handleError(_0x3f27cc,null));};exports[_0x5b8c('0xb6')]=function(_0x26326c,_0x1de994,_0x59ab9a){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x26326c[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x1de994,null))['then'](function(_0x1ac24f){if(_0x1ac24f){return _0x1ac24f[_0x5b8c('0xb6')](_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')],_[_0x5b8c('0x72')](_0x26326c['body'],[_0x5b8c('0x6a'),'id'])||{})[_0x5b8c('0xb2')](function(_0x50454d){for(var _0x1f3bfe=0x0;_0x1f3bfe<_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')]['length'];_0x1f3bfe+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')][_0x1f3bfe]),'FaxAccountId':Number(_0x26326c['params']['id'])});}return _0x50454d;});}})[_0x5b8c('0x36')](respondWithResult(_0x1de994,null))['catch'](handleError(_0x1de994,null));};exports['removeAgents']=function(_0xb49abf,_0x41d13e,_0x5421c1){return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0xb49abf['params']['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x41d13e,null))[_0x5b8c('0x36')](function(_0x1728c9){if(_0x1728c9){return _0x1728c9[_0x5b8c('0xb7')](_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')])[_0x5b8c('0x36')](function(){if(_[_0x5b8c('0xb8')](_0xb49abf['query'][_0x5b8c('0x6a')])){for(var _0x3959f3=0x0;_0x3959f3<_0xb49abf[_0x5b8c('0x42')]['ids'][_0x5b8c('0x67')];_0x3959f3+=0x1){socket[_0x5b8c('0xb9')](_0x5b8c('0xba'),{'UserId':Number(_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')][_0x3959f3]),'FaxAccountId':Number(_0xb49abf[_0x5b8c('0x55')]['id'])});}}else{socket['emit'](_0x5b8c('0xba'),{'UserId':Number(_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')]),'FaxAccountId':Number(_0xb49abf['params']['id'])});}});}})[_0x5b8c('0x36')](respondWithStatusCode(_0x41d13e,null))[_0x5b8c('0x29')](handleError(_0x41d13e,null));};exports[_0x5b8c('0xbb')]=function(_0x44d469,_0x1893c8,_0xdbfc00){var _0x2efdc3={};var _0x505b46={};var _0x558886;var _0x5b06b3;return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x44d469[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x1893c8,null))['then'](function(_0x2145b8){if(_0x2145b8){_0x558886=_0x2145b8;_0x505b46[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0xbc')][_0x5b8c('0x40')]);_0x505b46[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x44d469['query']);_0x505b46[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x505b46[_0x5b8c('0x45')],_0x505b46[_0x5b8c('0x42')]);_0x2efdc3[_0x5b8c('0x46')]=_['intersection'](_0x505b46[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x44d469[_0x5b8c('0x42')]['fields']));_0x2efdc3[_0x5b8c('0x46')]=_0x2efdc3[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x2efdc3[_0x5b8c('0x46')]:_0x505b46[_0x5b8c('0x45')];_0x2efdc3[_0x5b8c('0x49')]=qs['sort'](_0x44d469[_0x5b8c('0x42')]['sort']);_0x2efdc3[_0x5b8c('0x4b')]=qs['filters'](_[_0x5b8c('0x4c')](_0x44d469['query'],_0x505b46['filters']));if(_0x44d469['query'][_0x5b8c('0x4d')]){_0x2efdc3[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x2efdc3[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x2efdc3[_0x5b8c('0x46')],function(_0xb09a93){var _0x2405c7={};_0x2405c7[_0xb09a93]={'$like':'%'+_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x2405c7;})});}_0x2efdc3=_[_0x5b8c('0x4e')]({},_0x2efdc3,_0x44d469['options']);return _0x558886[_0x5b8c('0xbb')](_0x2efdc3);}})[_0x5b8c('0x36')](function(_0x27b760){if(_0x27b760){_0x5b06b3=_0x27b760[_0x5b8c('0x67')];if(!_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x2efdc3[_0x5b8c('0x31')]=qs['limit'](_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x2efdc3['offset']=qs[_0x5b8c('0x2e')](_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}return _0x558886[_0x5b8c('0xbb')](_0x2efdc3);}})[_0x5b8c('0x36')](function(_0x2d6ebc){if(_0x2d6ebc){return _0x2d6ebc?{'count':_0x5b06b3,'rows':_0x2d6ebc}:null;}})[_0x5b8c('0x36')](respondWithResult(_0x1893c8,null))['catch'](handleError(_0x1893c8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index e0b80e8..7e41f58 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 _0x8c50=['hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit'];(function(_0x5eaa16,_0x28ebad){var _0x352569=function(_0x4a8013){while(--_0x4a8013){_0x5eaa16['push'](_0x5eaa16['shift']());}};_0x352569(++_0x28ebad);}(_0x8c50,0x77));var _0x08c5=function(_0x49e44e,_0x2eec33){_0x49e44e=_0x49e44e-0x0;var _0x24d8ed=_0x8c50[_0x49e44e];return _0x24d8ed;};'use strict';var EventEmitter=require(_0x08c5('0x0'));var FaxAccount=require(_0x08c5('0x1'))['db'][_0x08c5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x08c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x08c5('0x4'),'afterDestroy':_0x08c5('0x5')};function emitEvent(_0x52eff0){return function(_0x46a8c9,_0x58f063,_0x58c0d8){FaxAccountEvents['emit'](_0x52eff0+':'+_0x46a8c9['id'],_0x46a8c9);FaxAccountEvents[_0x08c5('0x6')](_0x52eff0,_0x46a8c9);_0x58c0d8(null);};}for(var e in events){if(events[_0x08c5('0x7')](e)){var event=events[e];FaxAccount[_0x08c5('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x9192=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x2dedf8,_0x4c3cc4){var _0x19e4e2=function(_0x1640f7){while(--_0x1640f7){_0x2dedf8['push'](_0x2dedf8['shift']());}};_0x19e4e2(++_0x4c3cc4);}(_0x9192,0x1bc));var _0x2919=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x9192[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x2919('0x0'));var FaxAccount=require(_0x2919('0x1'))['db'][_0x2919('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2919('0x3')](0x0);var events={'afterCreate':_0x2919('0x4'),'afterUpdate':_0x2919('0x5'),'afterDestroy':_0x2919('0x6')};function emitEvent(_0x3dbd7b){return function(_0x19e951,_0x558329,_0x4fa25e){FaxAccountEvents[_0x2919('0x7')](_0x3dbd7b+':'+_0x19e951['id'],_0x19e951);FaxAccountEvents[_0x2919('0x7')](_0x3dbd7b,_0x19e951);_0x4fa25e(null);};}for(var e in events){if(events[_0x2919('0x8')](e)){var event=events[e];FaxAccount[_0x2919('0x9')](e,emitEvent(event));}}module[_0x2919('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 22f042a..d7e038c 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 _0xc5d6=['util','api','moment','request-promise','../../config/environment','exports','define','fax_accounts'];(function(_0x5b51ea,_0x23c65d){var _0x2a8a9b=function(_0x4437ad){while(--_0x4437ad){_0x5b51ea['push'](_0x5b51ea['shift']());}};_0x2a8a9b(++_0x23c65d);}(_0xc5d6,0xe0));var _0x6c5d=function(_0x1a637e,_0x23a650){_0x1a637e=_0x1a637e-0x0;var _0x339fa2=_0xc5d6[_0x1a637e];return _0x339fa2;};'use strict';var _=require('lodash');var util=require(_0x6c5d('0x0'));var logger=require('../../config/logger')(_0x6c5d('0x1'));var moment=require(_0x6c5d('0x2'));var BPromise=require('bluebird');var rp=require(_0x6c5d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c5d('0x4'));var attributes=require('./faxAccount.attributes');module[_0x6c5d('0x5')]=function(_0x4948be,_0x300128){return _0x4948be[_0x6c5d('0x6')]('FaxAccount',attributes,{'tableName':_0x6c5d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2616=['FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./faxAccount.attributes','exports'];(function(_0x5ba527,_0x3a1920){var _0x285ecb=function(_0x5b4f0c){while(--_0x5b4f0c){_0x5ba527['push'](_0x5ba527['shift']());}};_0x285ecb(++_0x3a1920);}(_0x2616,0xb6));var _0x6261=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x2616[_0x4536a4];return _0x4fd1c1;};'use strict';var _=require(_0x6261('0x0'));var util=require(_0x6261('0x1'));var logger=require(_0x6261('0x2'))('api');var moment=require(_0x6261('0x3'));var BPromise=require(_0x6261('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6261('0x5'));var attributes=require(_0x6261('0x6'));module[_0x6261('0x7')]=function(_0x155e27,_0x53ba4f){return _0x155e27['define'](_0x6261('0x8'),attributes,{'tableName':_0x6261('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 5f4ce26..4757b88 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 _0xb462=['socket.io-emitter','redis','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','model','attributes','map','body','fax','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','DESC','FaxApplication','get','applications','list','priority','Contacts','create','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','User','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x5ef546,_0x48d6bf){var _0x3106a4=function(_0x39d3ad){while(--_0x39d3ad){_0x5ef546['push'](_0x5ef546['shift']());}};_0x3106a4(++_0x48d6bf);}(_0xb462,0x1af));var _0x2b46=function(_0x42dcb2,_0x4b7a4a){_0x42dcb2=_0x42dcb2-0x0;var _0x3d1dc4=_0xb462[_0x42dcb2];return _0x3d1dc4;};'use strict';var _=require(_0x2b46('0x0'));var util=require(_0x2b46('0x1'));var moment=require(_0x2b46('0x2'));var BPromise=require(_0x2b46('0x3'));var rs=require(_0x2b46('0x4'));var fs=require('fs');var Redis=require(_0x2b46('0x5'));var db=require(_0x2b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b46('0x7'))(_0x2b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x2b46('0x9'));var client=jayson[_0x2b46('0xa')][_0x2b46('0xb')]({'port':0x232c});config['redis']=_[_0x2b46('0xc')](config['redis'],{'host':_0x2b46('0xd'),'port':0x18eb});var socket=require(_0x2b46('0xe'))(new Redis(config[_0x2b46('0xf')]));require('./faxAccount.socket')[_0x2b46('0x10')](socket);function respondWithRpcPromise(_0x39adf1,_0x53ff53,_0x557b61){return new BPromise(function(_0x45ce09,_0x214f8b){return client[_0x2b46('0x11')](_0x39adf1,_0x557b61)[_0x2b46('0x12')](function(_0x30a865){logger[_0x2b46('0x13')](_0x2b46('0x14'),_0x53ff53,'request\x20sent');logger[_0x2b46('0x15')](_0x2b46('0x16'),_0x53ff53,'request\x20sent',JSON[_0x2b46('0x17')](_0x30a865));if(_0x30a865['error']){if(_0x30a865['error']['code']===0x1f4){logger[_0x2b46('0x18')]('FaxAccount,\x20%s,\x20%s',_0x53ff53,_0x30a865[_0x2b46('0x18')]['message']);return _0x214f8b(_0x30a865[_0x2b46('0x18')][_0x2b46('0x19')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x53ff53,_0x30a865['error'][_0x2b46('0x19')]);return _0x45ce09(_0x30a865[_0x2b46('0x18')][_0x2b46('0x19')]);}else{logger[_0x2b46('0x13')]('FaxAccount,\x20%s,\x20%s',_0x53ff53,_0x2b46('0x1a'));_0x45ce09(_0x30a865[_0x2b46('0x1b')][_0x2b46('0x19')]);}})[_0x2b46('0x1c')](function(_0x5417fb){logger[_0x2b46('0x18')](_0x2b46('0x14'),_0x53ff53,_0x5417fb);_0x214f8b(_0x5417fb);});});}exports[_0x2b46('0x1d')]=function(_0x401e54){var _0x229309=this;return new Promise(function(_0x322c1f,_0x5aa473){return db[_0x2b46('0x1e')][_0x2b46('0x1f')]({'raw':_0x401e54[_0x2b46('0x20')]?_0x401e54['options'][_0x2b46('0x21')]===undefined?!![]:![]:!![],'where':_0x401e54[_0x2b46('0x20')]?_0x401e54[_0x2b46('0x20')][_0x2b46('0x22')]||null:null,'attributes':_0x401e54['options']?_0x401e54[_0x2b46('0x20')]['attributes']||null:null,'limit':_0x401e54[_0x2b46('0x20')]?_0x401e54[_0x2b46('0x20')]['limit']||null:null,'include':_0x401e54[_0x2b46('0x20')]?_0x401e54[_0x2b46('0x20')][_0x2b46('0x23')]?_['map'](_0x401e54[_0x2b46('0x20')][_0x2b46('0x23')],function(_0x50188b){return{'model':db[_0x50188b[_0x2b46('0x24')]],'as':_0x50188b['as'],'attributes':_0x50188b[_0x2b46('0x25')],'include':_0x50188b[_0x2b46('0x23')]?_['map'](_0x50188b[_0x2b46('0x23')],function(_0x2be5cf){return{'model':db[_0x2be5cf[_0x2b46('0x24')]],'as':_0x2be5cf['as'],'attributes':_0x2be5cf[_0x2b46('0x25')],'include':_0x2be5cf[_0x2b46('0x23')]?_[_0x2b46('0x26')](_0x2be5cf[_0x2b46('0x23')],function(_0x1d9883){return{'model':db[_0x1d9883[_0x2b46('0x24')]],'as':_0x1d9883['as'],'attributes':_0x1d9883[_0x2b46('0x25')]};}):[]};}):[]};}):[]:[]})[_0x2b46('0x12')](function(_0x3ee771){logger[_0x2b46('0x13')](_0x2b46('0x1d'),_0x401e54);logger[_0x2b46('0x15')](_0x2b46('0x1d'),_0x401e54,JSON[_0x2b46('0x17')](_0x3ee771));_0x322c1f(_0x3ee771);})[_0x2b46('0x1c')](function(_0x2bf995){logger[_0x2b46('0x18')](_0x2b46('0x1d'),_0x2bf995[_0x2b46('0x19')],_0x401e54);_0x5aa473(_0x229309['error'](0x1f4,_0x2bf995[_0x2b46('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x5e67ca,_0x283be9,_0x392902){var _0x55b8db=this;return new Promise(function(_0x437b1b,_0xdd2486){var _0x27dda9={'body':_0x5e67ca[_0x2b46('0x27')],'channel':_0x2b46('0x28')};var _0x143097=[];var _0x349689=[];var _0x2bed83={};return db['CmContact']['describe']()[_0x2b46('0x12')](function(_0x2496cc){if(!_0x2496cc){throw new db['Sequelize'][(_0x2b46('0x29'))](_0x2b46('0x2a'));}_0x143097=_[_0x2b46('0x2b')](_[_0x2b46('0x2c')](_0x2496cc),['createdAt',_0x2b46('0x2d')]);_0x349689=_['difference'](_['keys'](_0x2496cc),[_0x2b46('0x2e'),_0x2b46('0x2d'),_0x2b46('0x2f'),_0x2b46('0x30')]);if(_0x5e67ca[_0x2b46('0x27')]['id']){delete _0x5e67ca[_0x2b46('0x27')]['id'];}if(_[_0x2b46('0x31')](_0x5e67ca['body'][_0x2b46('0x32')])){throw new db[(_0x2b46('0x33'))]['ValidationError'](_0x2b46('0x34'));}if(_['isNil'](_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x27')])||_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x27')]===''){throw new db[(_0x2b46('0x33'))][(_0x2b46('0x29'))](_0x2b46('0x35'));}if(_[_0x2b46('0x31')](_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x36')])){throw new db['Sequelize']['ValidationError'](_0x2b46('0x37')+_0x349689);}if(!_[_0x2b46('0x38')](_0x349689,_0x5e67ca['body'][_0x2b46('0x36')])){throw new db[(_0x2b46('0x33'))][(_0x2b46('0x29'))](_0x2b46('0x39')+_0x349689);}_0x2bed83[_0x5e67ca['body'][_0x2b46('0x36')]]=_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x32')];})[_0x2b46('0x12')](function(){return db['FaxAccount'][_0x2b46('0x3a')]({'where':{'id':_0x5e67ca[_0x2b46('0x3b')]['id']},'include':[{'model':db[_0x2b46('0x3c')],'as':_0x2b46('0x3d'),'include':[{'model':db[_0x2b46('0x3e')],'as':'Contacts','where':_0x2bed83,'limit':0x1,'order':[[_0x2b46('0x2d'),_0x2b46('0x3f')]]}]},{'model':db[_0x2b46('0x40')],'as':'Applications'}]});})['then'](function(_0x1d4944){if(_0x1d4944&&_0x1d4944[_0x2b46('0x3d')]){var _0x51defa=_0x1d4944[_0x2b46('0x41')]({'plain':!![]});_0x27dda9[_0x2b46('0x3b')]=_0x51defa;_0x27dda9[_0x2b46('0x42')]=_0x51defa['Applications'];_0x27dda9[_0x2b46('0x43')]=_0x51defa['List'];_0x27dda9[_0x2b46('0x42')]=_['orderBy'](_0x27dda9[_0x2b46('0x42')],[_0x2b46('0x44')],['asc']);if(_0x27dda9['account']['Applications']){delete _0x27dda9['account']['Applications'];}if(_0x27dda9[_0x2b46('0x3b')][_0x2b46('0x3d')]&&_0x27dda9[_0x2b46('0x3b')]['List'][_0x2b46('0x45')]['length']){return _0x27dda9[_0x2b46('0x3b')]['List'][_0x2b46('0x45')][0x0];}var _0x3972ad=_['defaults'](_0x5e67ca[_0x2b46('0x27')],{'firstName':_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x32')],'ListId':_0x51defa[_0x2b46('0x30')]});_0x3972ad[_0x5e67ca['body']['mapKey']]=_0x5e67ca[_0x2b46('0x27')][_0x2b46('0x32')];return db[_0x2b46('0x3e')][_0x2b46('0x46')](_0x3972ad,{'fields':_0x143097,'raw':!![]});}})[_0x2b46('0x12')](function(_0x51b92f){_0x27dda9['contact']=_0x51b92f;if(_0x51b92f){var _0x4ba4fe={'ContactId':_0x51b92f['id'],'FaxAccountId':_0x5e67ca['account']['id'],'fax':_0x51b92f[_0x2b46('0x28')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x51b92f['id'],'closed':![],'FaxAccountId':_0x5e67ca[_0x2b46('0x3b')]['id']}})[_0x2b46('0x12')](function(_0x370862){if(_0x370862){return[_0x370862,![]];}return db[_0x2b46('0x47')][_0x2b46('0x46')](_0x4ba4fe)[_0x2b46('0x12')](function(_0x3cc1a9){return[_0x3cc1a9,!![]];});});}else{throw new Error(_0x2b46('0x48'));}})[_0x2b46('0x49')](function(_0x1ea200,_0x397a4b){var _0x199069=_0x1ea200[_0x2b46('0x41')]({'plain':!![]});if(_0x397a4b){if(_0x27dda9[_0x2b46('0x3b')]['autoclose']){_0x27dda9[_0x2b46('0x42')][_0x2b46('0x4a')]({'id':0x0,'priority':_0x27dda9[_0x2b46('0x42')]['length']+0x1,'app':_0x2b46('0x4b'),'appdata':_0x2b46('0x4c'),'interval':_0x2b46('0x4d')});}_0x199069[_0x2b46('0x4e')]=!![];}else{_0x199069[_0x2b46('0x4e')]=![];}_0x27dda9[_0x2b46('0x4f')]=_0x199069;return db[_0x2b46('0x50')]['create']({'body':_0x5e67ca[_0x2b46('0x27')]['body'],'FaxAccountId':_0x5e67ca['account']['id'],'FaxInteractionId':_0x1ea200['id'],'direction':'in','ContactId':_0x1ea200[_0x2b46('0x51')],'AttachmentId':_0x5e67ca[_0x2b46('0x27')]['AttachmentId']});})[_0x2b46('0x12')](function(_0x249193){_0x27dda9[_0x2b46('0x19')]=_0x249193;if(_0x27dda9[_0x2b46('0x4f')]['UserId']){return db[_0x2b46('0x52')][_0x2b46('0x3a')]({'attributes':['id',_0x2b46('0x53')],'where':{'id':_0x27dda9['interaction'][_0x2b46('0x54')]}})[_0x2b46('0x12')](function(_0x5396b7){if(_0x5396b7){_0x27dda9['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2b46('0x55'),'appdata':_0x5396b7[_0x2b46('0x53')]+','+(_0x27dda9['account'][_0x2b46('0x56')]||0xa),'interval':_0x2b46('0x4d')});}return respondWithRpcPromise(_0x2b46('0x57'),'startRouting',_0x27dda9);});}return respondWithRpcPromise(_0x2b46('0x57'),_0x2b46('0x58'),_0x27dda9);})['then'](function(_0x342266){_0x437b1b(_0x342266);})[_0x2b46('0x1c')](function(_0x3281b6){_0xdd2486(_0x55b8db[_0x2b46('0x18')](0x1f4,_0x3281b6['message']));});});}; \ No newline at end of file +var _0x7aa8=['isNil','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','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','./faxAccount.socket','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7aa8,0x144));var _0x87aa=function(_0x182bff,_0x2ff075){_0x182bff=_0x182bff-0x0;var _0x5c91cf=_0x7aa8[_0x182bff];return _0x5c91cf;};'use strict';var _=require(_0x87aa('0x0'));var util=require(_0x87aa('0x1'));var moment=require(_0x87aa('0x2'));var BPromise=require(_0x87aa('0x3'));var rs=require(_0x87aa('0x4'));var fs=require('fs');var Redis=require(_0x87aa('0x5'));var db=require(_0x87aa('0x6'))['db'];var utils=require(_0x87aa('0x7'));var logger=require(_0x87aa('0x8'))(_0x87aa('0x9'));var config=require(_0x87aa('0xa'));var jayson=require(_0x87aa('0xb'));var client=jayson[_0x87aa('0xc')][_0x87aa('0xd')]({'port':0x232c});config[_0x87aa('0xe')]=_[_0x87aa('0xf')](config[_0x87aa('0xe')],{'host':_0x87aa('0x10'),'port':0x18eb});var socket=require(_0x87aa('0x11'))(new Redis(config[_0x87aa('0xe')]));require(_0x87aa('0x12'))[_0x87aa('0x13')](socket);function respondWithRpcPromise(_0x4c77ae,_0x12eff7,_0x15c9e5){return new BPromise(function(_0x5e10ef,_0x290751){return client[_0x87aa('0x14')](_0x4c77ae,_0x15c9e5)[_0x87aa('0x15')](function(_0x197ce3){logger[_0x87aa('0x16')]('FaxAccount,\x20%s,\x20%s',_0x12eff7,'request\x20sent');logger[_0x87aa('0x17')](_0x87aa('0x18'),_0x12eff7,_0x87aa('0x19'),JSON[_0x87aa('0x1a')](_0x197ce3));if(_0x197ce3[_0x87aa('0x1b')]){if(_0x197ce3['error']['code']===0x1f4){logger[_0x87aa('0x1b')](_0x87aa('0x1c'),_0x12eff7,_0x197ce3['error']['message']);return _0x290751(_0x197ce3[_0x87aa('0x1b')][_0x87aa('0x1d')]);}logger[_0x87aa('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x12eff7,_0x197ce3['error']['message']);return _0x5e10ef(_0x197ce3[_0x87aa('0x1b')][_0x87aa('0x1d')]);}else{logger[_0x87aa('0x16')](_0x87aa('0x1c'),_0x12eff7,'request\x20sent');_0x5e10ef(_0x197ce3['result'][_0x87aa('0x1d')]);}})['catch'](function(_0xb7dbe5){logger[_0x87aa('0x1b')](_0x87aa('0x1c'),_0x12eff7,_0xb7dbe5);_0x290751(_0xb7dbe5);});});}exports[_0x87aa('0x1e')]=function(_0x5d47e2){var _0x4e082b=this;return new Promise(function(_0x51cdc6,_0x45e358){return db[_0x87aa('0x1f')][_0x87aa('0x20')]({'raw':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x22')]===undefined?!![]:![]:!![],'where':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x23')]||null:null,'attributes':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x24')]||null:null,'limit':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2['options']['limit']||null:null,'include':_0x5d47e2['options']?_0x5d47e2['options'][_0x87aa('0x25')]?_[_0x87aa('0x26')](_0x5d47e2[_0x87aa('0x21')]['include'],function(_0xf487dd){return{'model':db[_0xf487dd[_0x87aa('0x27')]],'as':_0xf487dd['as'],'attributes':_0xf487dd['attributes'],'include':_0xf487dd[_0x87aa('0x25')]?_[_0x87aa('0x26')](_0xf487dd['include'],function(_0x50908b){return{'model':db[_0x50908b[_0x87aa('0x27')]],'as':_0x50908b['as'],'attributes':_0x50908b[_0x87aa('0x24')],'include':_0x50908b[_0x87aa('0x25')]?_[_0x87aa('0x26')](_0x50908b[_0x87aa('0x25')],function(_0x241f55){return{'model':db[_0x241f55[_0x87aa('0x27')]],'as':_0x241f55['as'],'attributes':_0x241f55[_0x87aa('0x24')]};}):[]};}):[]};}):[]:[]})[_0x87aa('0x15')](function(_0x5415d4){logger[_0x87aa('0x16')](_0x87aa('0x1e'),_0x5d47e2);logger[_0x87aa('0x17')](_0x87aa('0x1e'),_0x5d47e2,JSON[_0x87aa('0x1a')](_0x5415d4));_0x51cdc6(_0x5415d4);})['catch'](function(_0x5eaba4){logger[_0x87aa('0x1b')](_0x87aa('0x1e'),_0x5eaba4[_0x87aa('0x1d')],_0x5d47e2);_0x45e358(_0x4e082b['error'](0x1f4,_0x5eaba4[_0x87aa('0x1d')]));});});};exports[_0x87aa('0x28')]=function(_0x3a5a42,_0x13320b,_0x203e47){var _0x17bad7=this;return new Promise(function(_0x2b6d8f,_0x2ccf59){var _0x474c6b={'body':_0x3a5a42['body'],'channel':_0x87aa('0x29')};var _0x53ccbd=[];var _0x1e9a37=[];var _0x410b11={};return db[_0x87aa('0x2a')]['describe']()[_0x87aa('0x15')](function(_0x492505){if(!_0x492505){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x2d'));}_0x53ccbd=_[_0x87aa('0x2e')](_[_0x87aa('0x2f')](_0x492505),[_0x87aa('0x30'),'updatedAt']);_0x1e9a37=_[_0x87aa('0x2e')](_[_0x87aa('0x2f')](_0x492505),[_0x87aa('0x30'),_0x87aa('0x31'),_0x87aa('0x32'),_0x87aa('0x33')]);if(_0x3a5a42[_0x87aa('0x34')]['id']){delete _0x3a5a42['body']['id'];}if(_['isNil'](_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x35')])){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x36'));}if(_['isNil'](_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x34')])||_0x3a5a42['body'][_0x87aa('0x34')]===''){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x37'));}if(_[_0x87aa('0x38')](_0x3a5a42[_0x87aa('0x34')]['mapKey'])){throw new db['Sequelize'][(_0x87aa('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e9a37);}if(!_[_0x87aa('0x39')](_0x1e9a37,_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x3a')])){throw new db['Sequelize'][(_0x87aa('0x2c'))](_0x87aa('0x3b')+_0x1e9a37);}_0x410b11[_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x3a')]]=_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x35')];})[_0x87aa('0x15')](function(){return db[_0x87aa('0x1f')][_0x87aa('0x3c')]({'where':{'id':_0x3a5a42[_0x87aa('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0x87aa('0x3e'),'include':[{'model':db[_0x87aa('0x2a')],'as':_0x87aa('0x3f'),'where':_0x410b11,'limit':0x1,'order':[[_0x87aa('0x31'),_0x87aa('0x40')]]}]},{'model':db[_0x87aa('0x41')],'as':_0x87aa('0x42')}]});})[_0x87aa('0x15')](function(_0x41b4d7){if(_0x41b4d7&&_0x41b4d7['List']){var _0xa2d835=_0x41b4d7[_0x87aa('0x43')]({'plain':!![]});_0x474c6b['account']=_0xa2d835;_0x474c6b[_0x87aa('0x44')]=_0xa2d835[_0x87aa('0x42')];_0x474c6b['list']=_0xa2d835['List'];_0x474c6b[_0x87aa('0x44')]=_[_0x87aa('0x45')](_0x474c6b[_0x87aa('0x44')],[_0x87aa('0x46')],[_0x87aa('0x47')]);if(_0x474c6b[_0x87aa('0x3d')]['Applications']){delete _0x474c6b[_0x87aa('0x3d')][_0x87aa('0x42')];}if(_0x474c6b[_0x87aa('0x3d')]['List']&&_0x474c6b['account']['List'][_0x87aa('0x3f')][_0x87aa('0x48')]){return _0x474c6b['account']['List'][_0x87aa('0x3f')][0x0];}var _0xffb683=_[_0x87aa('0xf')](_0x3a5a42[_0x87aa('0x34')],{'firstName':_0x3a5a42['body'][_0x87aa('0x35')],'ListId':_0xa2d835[_0x87aa('0x33')]});_0xffb683[_0x3a5a42['body'][_0x87aa('0x3a')]]=_0x3a5a42[_0x87aa('0x34')]['from'];return db[_0x87aa('0x2a')][_0x87aa('0x49')](_0xffb683,{'fields':_0x53ccbd,'raw':!![]});}})['then'](function(_0x43e472){_0x474c6b[_0x87aa('0x4a')]=_0x43e472;if(_0x43e472){var _0x2c7ca9={'ContactId':_0x43e472['id'],'FaxAccountId':_0x3a5a42[_0x87aa('0x3d')]['id'],'fax':_0x43e472[_0x87aa('0x29')]};return db[_0x87aa('0x4b')][_0x87aa('0x3c')]({'where':{'ContactId':_0x43e472['id'],'closed':![],'FaxAccountId':_0x3a5a42['account']['id']}})['then'](function(_0x3c485e){if(_0x3c485e){return[_0x3c485e,![]];}return db['FaxInteraction'][_0x87aa('0x49')](_0x2c7ca9)[_0x87aa('0x15')](function(_0x3be8d4){return[_0x3be8d4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x87aa('0x4c')](function(_0x10044f,_0x5b557b){var _0x33c976=_0x10044f[_0x87aa('0x43')]({'plain':!![]});if(_0x5b557b){if(_0x474c6b[_0x87aa('0x3d')][_0x87aa('0x4d')]){_0x474c6b[_0x87aa('0x44')][_0x87aa('0x4e')]({'id':0x0,'priority':_0x474c6b[_0x87aa('0x44')]['length']+0x1,'app':_0x87aa('0x4f'),'appdata':_0x87aa('0x50'),'interval':_0x87aa('0x51')});}_0x33c976['created']=!![];}else{_0x33c976[_0x87aa('0x52')]=![];}_0x474c6b[_0x87aa('0x53')]=_0x33c976;return db[_0x87aa('0x54')][_0x87aa('0x49')]({'body':_0x3a5a42[_0x87aa('0x34')]['body'],'FaxAccountId':_0x3a5a42['account']['id'],'FaxInteractionId':_0x10044f['id'],'direction':'in','ContactId':_0x10044f[_0x87aa('0x55')],'AttachmentId':_0x3a5a42['body'][_0x87aa('0x56')]});})[_0x87aa('0x15')](function(_0x58c70c){_0x474c6b[_0x87aa('0x1d')]=_0x58c70c;if(_0x474c6b['interaction'][_0x87aa('0x57')]){return db['User'][_0x87aa('0x3c')]({'attributes':['id',_0x87aa('0x58')],'where':{'id':_0x474c6b[_0x87aa('0x53')]['UserId']}})[_0x87aa('0x15')](function(_0x3846eb){if(_0x3846eb){_0x474c6b['applications'][_0x87aa('0x59')]({'id':0x0,'priority':0x0,'app':_0x87aa('0x5a'),'appdata':_0x3846eb[_0x87aa('0x58')]+','+(_0x474c6b[_0x87aa('0x3d')][_0x87aa('0x5b')]||0xa),'interval':_0x87aa('0x51')});}return respondWithRpcPromise(_0x87aa('0x5c'),_0x87aa('0x5d'),_0x474c6b);});}return respondWithRpcPromise(_0x87aa('0x5c'),'startRouting',_0x474c6b);})['then'](function(_0x5719eb){_0x2b6d8f(_0x5719eb);})[_0x87aa('0x5e')](function(_0x5277b4){_0x2ccf59(_0x17bad7[_0x87aa('0x1b')](0x1f4,_0x5277b4[_0x87aa('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 970c0cf..0ed26c9 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 _0x4f26=['remove','update','emit','removeListener','./faxAccount.events','save'];(function(_0x478de8,_0x3cadcb){var _0x411d85=function(_0x272daa){while(--_0x272daa){_0x478de8['push'](_0x478de8['shift']());}};_0x411d85(++_0x3cadcb);}(_0x4f26,0x9a));var _0x64f2=function(_0x26d1e0,_0x397c06){_0x26d1e0=_0x26d1e0-0x0;var _0x212c91=_0x4f26[_0x26d1e0];return _0x212c91;};'use strict';var FaxAccountEvents=require(_0x64f2('0x0'));var events=[_0x64f2('0x1'),_0x64f2('0x2'),_0x64f2('0x3')];function createListener(_0x13267c,_0x43e295){return function(_0x15fca8){_0x43e295[_0x64f2('0x4')](_0x13267c,_0x15fca8);};}function removeListener(_0x3109cc,_0x862d57){return function(){FaxAccountEvents[_0x64f2('0x5')](_0x3109cc,_0x862d57);};}exports['register']=function(_0x12838a){for(var _0x300946=0x0,_0x2fb3ed=events['length'];_0x300946<_0x2fb3ed;_0x300946++){var _0x335dfd=events[_0x300946];var _0x5b105d=createListener('faxAccount:'+_0x335dfd,_0x12838a);FaxAccountEvents['on'](_0x335dfd,_0x5b105d);}}; \ No newline at end of file +var _0x7217=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x50478e,_0x404854){var _0x190c0e=function(_0x2a767e){while(--_0x2a767e){_0x50478e['push'](_0x50478e['shift']());}};_0x190c0e(++_0x404854);}(_0x7217,0x117));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'use strict';var FaxAccountEvents=require(_0x7721('0x0'));var events=[_0x7721('0x1'),_0x7721('0x2'),'update'];function createListener(_0x317be5,_0x941c54){return function(_0x504838){_0x941c54[_0x7721('0x3')](_0x317be5,_0x504838);};}function removeListener(_0x306978,_0xf2754){return function(){FaxAccountEvents[_0x7721('0x4')](_0x306978,_0xf2754);};}exports[_0x7721('0x5')]=function(_0x12313b){for(var _0x1f9f95=0x0,_0x2a0758=events[_0x7721('0x6')];_0x1f9f95<_0x2a0758;_0x1f9f95++){var _0x2272a0=events[_0x1f9f95];var _0x43d392=createListener(_0x7721('0x7')+_0x2272a0,_0x12313b);FaxAccountEvents['on'](_0x2272a0,_0x43d392);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 8dbf29b..b3ff349 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x199356,_0x2072b5){var _0x3bc7e2=function(_0x33f9ab){while(--_0x33f9ab){_0x199356['push'](_0x199356['shift']());}};_0x3bc7e2(++_0x2072b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x2b7ab3,_0x2a67ca){var _0x5e96e0=function(_0x524336){while(--_0x524336){_0x2b7ab3['push'](_0x2b7ab3['shift']());}};_0x5e96e0(++_0x2a67ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 536a531..5700628 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 _0x999b=['noop','sequelize','exports','INTEGER','STRING'];(function(_0x122c9e,_0x953140){var _0x73f499=function(_0x3c9943){while(--_0x3c9943){_0x122c9e['push'](_0x122c9e['shift']());}};_0x73f499(++_0x953140);}(_0x999b,0x9c));var _0xb999=function(_0xa558da,_0x1ca3a6){_0xa558da=_0xa558da-0x0;var _0x451fe6=_0x999b[_0xa558da];return _0x451fe6;};'use strict';var Sequelize=require(_0xb999('0x0'));module[_0xb999('0x1')]={'priority':{'type':Sequelize[_0xb999('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb999('0x3')],'allowNull':![],'defaultValue':_0xb999('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb999('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0a75=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x31b74a,_0x5da9c1){var _0x4df566=function(_0x3148ba){while(--_0x3148ba){_0x31b74a['push'](_0x31b74a['shift']());}};_0x4df566(++_0x5da9c1);}(_0x0a75,0x158));var _0x50a7=function(_0x336ac0,_0x3cbf0a){_0x336ac0=_0x336ac0-0x0;var _0x17c17b=_0x0a75[_0x336ac0];return _0x17c17b;};'use strict';var Sequelize=require(_0x50a7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x50a7('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50a7('0x2')},'appdata':{'type':Sequelize[_0x50a7('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x50a7('0x4')],'defaultValue':_0x50a7('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index afd34ac..a1abf7a 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 _0xbcfa=['../../config/environment','sendStatus','status','end','json','undefined','limit','offset','apply','save','update','then','destroy','name','send','index','map','FaxApplication','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','count','includeAll','findAll','catch','show','keys','length','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x37dac2,_0xdb5e75){var _0x351e15=function(_0x241d5e){while(--_0x241d5e){_0x37dac2['push'](_0x37dac2['shift']());}};_0x351e15(++_0xdb5e75);}(_0xbcfa,0x13f));var _0xabcf=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xbcfa[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0xabcf('0x0'));var rimraf=require(_0xabcf('0x1'));var zipdir=require(_0xabcf('0x2'));var jsonpatch=require(_0xabcf('0x3'));var rp=require('request-promise');var moment=require(_0xabcf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xabcf('0x5'));var util=require('util');var path=require(_0xabcf('0x6'));var sox=require(_0xabcf('0x7'));var csv=require(_0xabcf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabcf('0x9'));var _=require(_0xabcf('0xa'));var squel=require(_0xabcf('0xb'));var crypto=require(_0xabcf('0xc'));var jsforce=require(_0xabcf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xabcf('0xe'));var Papa=require('papaparse');var Redis=require(_0xabcf('0xf'));var authService=require(_0xabcf('0x10'));var qs=require(_0xabcf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabcf('0x12'));var logger=require(_0xabcf('0x13'))(_0xabcf('0x14'));var utils=require('../../config/utils');var config=require(_0xabcf('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a546b,_0x5373e4){_0x5373e4=_0x5373e4||0xcc;return function(_0x142dba){if(_0x142dba){return _0x1a546b[_0xabcf('0x16')](_0x5373e4);}return _0x1a546b[_0xabcf('0x17')](_0x5373e4)[_0xabcf('0x18')]();};}function respondWithResult(_0xb19eef,_0x523fa1){_0x523fa1=_0x523fa1||0xc8;return function(_0x40d98e){if(_0x40d98e){return _0xb19eef[_0xabcf('0x17')](_0x523fa1)[_0xabcf('0x19')](_0x40d98e);}};}function respondWithFilteredResult(_0x3f6885,_0x121d66){return function(_0x55eb90){if(_0x55eb90){var _0x4abab2=typeof _0x121d66['offset']===_0xabcf('0x1a')&&typeof _0x121d66[_0xabcf('0x1b')]===_0xabcf('0x1a');var _0x5438a8=_0x55eb90['count'];var _0x30144a=_0x4abab2?0x0:_0x121d66[_0xabcf('0x1c')];var _0x546e96=_0x4abab2?_0x55eb90['count']:_0x121d66[_0xabcf('0x1c')]+_0x121d66[_0xabcf('0x1b')];var _0x47b5f6;if(_0x546e96>=_0x5438a8){_0x546e96=_0x5438a8;_0x47b5f6=0xc8;}else{_0x47b5f6=0xce;}_0x3f6885[_0xabcf('0x17')](_0x47b5f6);return _0x3f6885['set']('Content-Range',_0x30144a+'-'+_0x546e96+'/'+_0x5438a8)[_0xabcf('0x19')](_0x55eb90);}return null;};}function patchUpdates(_0x505dd0){return function(_0x21fd88){try{jsonpatch[_0xabcf('0x1d')](_0x21fd88,_0x505dd0,!![]);}catch(_0x2fda26){return BPromise['reject'](_0x2fda26);}return _0x21fd88[_0xabcf('0x1e')]();};}function saveUpdates(_0xfd12a5,_0x1fd2b4){return function(_0x38b89f){if(_0x38b89f){return _0x38b89f[_0xabcf('0x1f')](_0xfd12a5)[_0xabcf('0x20')](function(_0x1b041f){return _0x1b041f;});}return null;};}function removeEntity(_0x4fe3c0,_0x5954af){return function(_0x217c3b){if(_0x217c3b){return _0x217c3b[_0xabcf('0x21')]()[_0xabcf('0x20')](function(){_0x4fe3c0['status'](0xcc)[_0xabcf('0x18')]();});}};}function handleEntityNotFound(_0x504f43,_0x583c06){return function(_0x342655){if(!_0x342655){_0x504f43['sendStatus'](0x194);}return _0x342655;};}function handleError(_0x589e14,_0x540ddd){_0x540ddd=_0x540ddd||0x1f4;return function(_0x3c7d6c){logger['error'](_0x3c7d6c['stack']);if(_0x3c7d6c[_0xabcf('0x22')]){delete _0x3c7d6c['name'];}_0x589e14[_0xabcf('0x17')](_0x540ddd)[_0xabcf('0x23')](_0x3c7d6c);};}exports[_0xabcf('0x24')]=function(_0x273d12,_0x550776){var _0xbab500={},_0x2bbf1c={},_0x1c1a1d={'count':0x0,'rows':[]};var _0x53efa0=_[_0xabcf('0x25')](db[_0xabcf('0x26')]['rawAttributes'],function(_0x29ee73){return{'name':_0x29ee73[_0xabcf('0x27')],'type':_0x29ee73[_0xabcf('0x28')][_0xabcf('0x29')]};});_0x2bbf1c[_0xabcf('0x2a')]=_[_0xabcf('0x25')](_0x53efa0,_0xabcf('0x22'));_0x2bbf1c[_0xabcf('0x2b')]=_['keys'](_0x273d12['query']);_0x2bbf1c[_0xabcf('0x2c')]=_['intersection'](_0x2bbf1c['model'],_0x2bbf1c['query']);_0xbab500[_0xabcf('0x2d')]=_[_0xabcf('0x2e')](_0x2bbf1c[_0xabcf('0x2a')],qs[_0xabcf('0x2f')](_0x273d12[_0xabcf('0x2b')][_0xabcf('0x2f')]));_0xbab500[_0xabcf('0x2d')]=_0xbab500[_0xabcf('0x2d')]['length']?_0xbab500[_0xabcf('0x2d')]:_0x2bbf1c[_0xabcf('0x2a')];if(!_0x273d12[_0xabcf('0x2b')][_0xabcf('0x30')](_0xabcf('0x31'))){_0xbab500[_0xabcf('0x1b')]=qs[_0xabcf('0x1b')](_0x273d12[_0xabcf('0x2b')][_0xabcf('0x1b')]);_0xbab500[_0xabcf('0x1c')]=qs[_0xabcf('0x1c')](_0x273d12[_0xabcf('0x2b')]['offset']);}_0xbab500['order']=qs['sort'](_0x273d12[_0xabcf('0x2b')][_0xabcf('0x32')]);_0xbab500['where']=qs[_0xabcf('0x2c')](_[_0xabcf('0x33')](_0x273d12['query'],_0x2bbf1c[_0xabcf('0x2c')]),_0x53efa0);if(_0x273d12[_0xabcf('0x2b')][_0xabcf('0x34')]){_0xbab500[_0xabcf('0x35')]=_[_0xabcf('0x36')](_0xbab500[_0xabcf('0x35')],{'$or':_['map'](_0x53efa0,function(_0xd5f49c){if(_0xd5f49c[_0xabcf('0x28')]!=='VIRTUAL'){var _0x3be95c={};_0x3be95c[_0xd5f49c['name']]={'$like':'%'+_0x273d12[_0xabcf('0x2b')]['filter']+'%'};return _0x3be95c;}})});}_0xbab500=_[_0xabcf('0x36')]({},_0xbab500,_0x273d12[_0xabcf('0x37')]);var _0x18fa0b={'where':_0xbab500[_0xabcf('0x35')]};return db[_0xabcf('0x26')][_0xabcf('0x38')](_0x18fa0b)[_0xabcf('0x20')](function(_0x4d1304){_0x1c1a1d[_0xabcf('0x38')]=_0x4d1304;if(_0x273d12[_0xabcf('0x2b')][_0xabcf('0x39')]){_0xbab500['include']=[{'all':!![]}];}return db[_0xabcf('0x26')][_0xabcf('0x3a')](_0xbab500);})[_0xabcf('0x20')](function(_0x3820f3){_0x1c1a1d['rows']=_0x3820f3;return _0x1c1a1d;})[_0xabcf('0x20')](respondWithFilteredResult(_0x550776,_0xbab500))[_0xabcf('0x3b')](handleError(_0x550776,null));};exports[_0xabcf('0x3c')]=function(_0x123eab,_0x35a7fd){var _0x4dc874={'raw':!![],'where':{'id':_0x123eab['params']['id']}},_0x3cb881={};_0x3cb881['model']=_[_0xabcf('0x3d')](db[_0xabcf('0x26')]['rawAttributes']);_0x3cb881['query']=_['keys'](_0x123eab[_0xabcf('0x2b')]);_0x3cb881[_0xabcf('0x2c')]=_['intersection'](_0x3cb881[_0xabcf('0x2a')],_0x3cb881[_0xabcf('0x2b')]);_0x4dc874[_0xabcf('0x2d')]=_[_0xabcf('0x2e')](_0x3cb881[_0xabcf('0x2a')],qs['fields'](_0x123eab[_0xabcf('0x2b')]['fields']));_0x4dc874[_0xabcf('0x2d')]=_0x4dc874[_0xabcf('0x2d')][_0xabcf('0x3e')]?_0x4dc874[_0xabcf('0x2d')]:_0x3cb881['model'];if(_0x123eab[_0xabcf('0x2b')][_0xabcf('0x39')]){_0x4dc874[_0xabcf('0x3f')]=[{'all':!![]}];}_0x4dc874=_['merge']({},_0x4dc874,_0x123eab[_0xabcf('0x37')]);return db[_0xabcf('0x26')][_0xabcf('0x40')](_0x4dc874)['then'](handleEntityNotFound(_0x35a7fd,null))[_0xabcf('0x20')](respondWithResult(_0x35a7fd,null))[_0xabcf('0x3b')](handleError(_0x35a7fd,null));};exports[_0xabcf('0x41')]=function(_0x484ce3,_0x53232b){return db[_0xabcf('0x26')][_0xabcf('0x41')](_0x484ce3[_0xabcf('0x42')],{})['then'](respondWithResult(_0x53232b,0xc9))['catch'](handleError(_0x53232b,null));};exports[_0xabcf('0x1f')]=function(_0x18500a,_0x40ed1f){if(_0x18500a[_0xabcf('0x42')]['id']){delete _0x18500a[_0xabcf('0x42')]['id'];}return db['FaxApplication'][_0xabcf('0x40')]({'where':{'id':_0x18500a['params']['id']}})[_0xabcf('0x20')](handleEntityNotFound(_0x40ed1f,null))[_0xabcf('0x20')](saveUpdates(_0x18500a[_0xabcf('0x42')],null))[_0xabcf('0x20')](respondWithResult(_0x40ed1f,null))[_0xabcf('0x3b')](handleError(_0x40ed1f,null));};exports[_0xabcf('0x21')]=function(_0x4f8aec,_0x284faa){return db[_0xabcf('0x26')][_0xabcf('0x40')]({'where':{'id':_0x4f8aec[_0xabcf('0x43')]['id']}})[_0xabcf('0x20')](handleEntityNotFound(_0x284faa,null))[_0xabcf('0x20')](removeEntity(_0x284faa,null))[_0xabcf('0x3b')](handleError(_0x284faa,null));}; \ No newline at end of file +var _0xa3bf=['params','destroy','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','show','find','create','body'];(function(_0x253596,_0x3fcff7){var _0x4435a5=function(_0x389e83){while(--_0x389e83){_0x253596['push'](_0x253596['shift']());}};_0x4435a5(++_0x3fcff7);}(_0xa3bf,0xe9));var _0xfa3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa3b('0x0'));var zipdir=require(_0xfa3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa3b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa3b('0x3'));var util=require(_0xfa3b('0x4'));var path=require(_0xfa3b('0x5'));var sox=require(_0xfa3b('0x6'));var csv=require(_0xfa3b('0x7'));var ejs=require(_0xfa3b('0x8'));var fs=require('fs');var fs_extra=require(_0xfa3b('0x9'));var _=require(_0xfa3b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa3b('0xb'));var deskjs=require(_0xfa3b('0xc'));var toCsv=require(_0xfa3b('0x7'));var querystring=require(_0xfa3b('0xd'));var Papa=require(_0xfa3b('0xe'));var Redis=require('ioredis');var authService=require(_0xfa3b('0xf'));var qs=require(_0xfa3b('0x10'));var as=require(_0xfa3b('0x11'));var hardwareService=require(_0xfa3b('0x12'));var logger=require(_0xfa3b('0x13'))(_0xfa3b('0x14'));var utils=require(_0xfa3b('0x15'));var config=require(_0xfa3b('0x16'));var licenseUtil=require(_0xfa3b('0x17'));var db=require(_0xfa3b('0x18'))['db'];function respondWithStatusCode(_0x5e2e9d,_0x2742ac){_0x2742ac=_0x2742ac||0xcc;return function(_0x5f3254){if(_0x5f3254){return _0x5e2e9d[_0xfa3b('0x19')](_0x2742ac);}return _0x5e2e9d[_0xfa3b('0x1a')](_0x2742ac)[_0xfa3b('0x1b')]();};}function respondWithResult(_0x1d5cc3,_0x4a5763){_0x4a5763=_0x4a5763||0xc8;return function(_0x20f737){if(_0x20f737){return _0x1d5cc3[_0xfa3b('0x1a')](_0x4a5763)[_0xfa3b('0x1c')](_0x20f737);}};}function respondWithFilteredResult(_0x40eeb6,_0x2ca034){return function(_0x175a4f){if(_0x175a4f){var _0x1815eb=typeof _0x2ca034[_0xfa3b('0x1d')]===_0xfa3b('0x1e')&&typeof _0x2ca034[_0xfa3b('0x1f')]==='undefined';var _0x36fe4a=_0x175a4f[_0xfa3b('0x20')];var _0x38a2cf=_0x1815eb?0x0:_0x2ca034[_0xfa3b('0x1d')];var _0x4ad73e=_0x1815eb?_0x175a4f[_0xfa3b('0x20')]:_0x2ca034[_0xfa3b('0x1d')]+_0x2ca034[_0xfa3b('0x1f')];var _0x3d67a7;if(_0x4ad73e>=_0x36fe4a){_0x4ad73e=_0x36fe4a;_0x3d67a7=0xc8;}else{_0x3d67a7=0xce;}_0x40eeb6['status'](_0x3d67a7);return _0x40eeb6[_0xfa3b('0x21')](_0xfa3b('0x22'),_0x38a2cf+'-'+_0x4ad73e+'/'+_0x36fe4a)[_0xfa3b('0x1c')](_0x175a4f);}return null;};}function patchUpdates(_0x2198ad){return function(_0x308e5b){try{jsonpatch[_0xfa3b('0x23')](_0x308e5b,_0x2198ad,!![]);}catch(_0x178a3b){return BPromise[_0xfa3b('0x24')](_0x178a3b);}return _0x308e5b['save']();};}function saveUpdates(_0x25879a,_0x36dff0){return function(_0x5411ea){if(_0x5411ea){return _0x5411ea[_0xfa3b('0x25')](_0x25879a)[_0xfa3b('0x26')](function(_0x370170){return _0x370170;});}return null;};}function removeEntity(_0x4ddc3e,_0xd482ea){return function(_0x400cd3){if(_0x400cd3){return _0x400cd3['destroy']()[_0xfa3b('0x26')](function(){_0x4ddc3e[_0xfa3b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4a49,_0x9343c7){return function(_0x368234){if(!_0x368234){_0x4d4a49[_0xfa3b('0x19')](0x194);}return _0x368234;};}function handleError(_0x3d9e5f,_0x5bac01){_0x5bac01=_0x5bac01||0x1f4;return function(_0x4cf92c){logger[_0xfa3b('0x27')](_0x4cf92c[_0xfa3b('0x28')]);if(_0x4cf92c[_0xfa3b('0x29')]){delete _0x4cf92c[_0xfa3b('0x29')];}_0x3d9e5f['status'](_0x5bac01)[_0xfa3b('0x2a')](_0x4cf92c);};}exports[_0xfa3b('0x2b')]=function(_0x13488b,_0x55b958){var _0x11e21e={},_0x539a8c={},_0x4a536b={'count':0x0,'rows':[]};var _0x8114f7=_[_0xfa3b('0x2c')](db['FaxApplication'][_0xfa3b('0x2d')],function(_0x3cbe84){return{'name':_0x3cbe84['fieldName'],'type':_0x3cbe84[_0xfa3b('0x2e')][_0xfa3b('0x2f')]};});_0x539a8c[_0xfa3b('0x30')]=_[_0xfa3b('0x2c')](_0x8114f7,'name');_0x539a8c[_0xfa3b('0x31')]=_[_0xfa3b('0x32')](_0x13488b['query']);_0x539a8c[_0xfa3b('0x33')]=_[_0xfa3b('0x34')](_0x539a8c[_0xfa3b('0x30')],_0x539a8c[_0xfa3b('0x31')]);_0x11e21e[_0xfa3b('0x35')]=_['intersection'](_0x539a8c['model'],qs['fields'](_0x13488b['query'][_0xfa3b('0x36')]));_0x11e21e[_0xfa3b('0x35')]=_0x11e21e['attributes'][_0xfa3b('0x37')]?_0x11e21e[_0xfa3b('0x35')]:_0x539a8c[_0xfa3b('0x30')];if(!_0x13488b[_0xfa3b('0x31')]['hasOwnProperty'](_0xfa3b('0x38'))){_0x11e21e[_0xfa3b('0x1f')]=qs['limit'](_0x13488b['query'][_0xfa3b('0x1f')]);_0x11e21e[_0xfa3b('0x1d')]=qs['offset'](_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x1d')]);}_0x11e21e[_0xfa3b('0x39')]=qs[_0xfa3b('0x3a')](_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3a')]);_0x11e21e[_0xfa3b('0x3b')]=qs['filters'](_[_0xfa3b('0x3c')](_0x13488b[_0xfa3b('0x31')],_0x539a8c['filters']),_0x8114f7);if(_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3d')]){_0x11e21e[_0xfa3b('0x3b')]=_[_0xfa3b('0x3e')](_0x11e21e[_0xfa3b('0x3b')],{'$or':_[_0xfa3b('0x2c')](_0x8114f7,function(_0x203024){if(_0x203024[_0xfa3b('0x2e')]!==_0xfa3b('0x3f')){var _0x34e0b3={};_0x34e0b3[_0x203024['name']]={'$like':'%'+_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3d')]+'%'};return _0x34e0b3;}})});}_0x11e21e=_[_0xfa3b('0x3e')]({},_0x11e21e,_0x13488b[_0xfa3b('0x40')]);var _0x59399a={'where':_0x11e21e[_0xfa3b('0x3b')]};return db[_0xfa3b('0x41')]['count'](_0x59399a)[_0xfa3b('0x26')](function(_0x27ae71){_0x4a536b[_0xfa3b('0x20')]=_0x27ae71;if(_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x42')]){_0x11e21e[_0xfa3b('0x43')]=[{'all':!![]}];}return db[_0xfa3b('0x41')][_0xfa3b('0x44')](_0x11e21e);})[_0xfa3b('0x26')](function(_0x5bcb24){_0x4a536b[_0xfa3b('0x45')]=_0x5bcb24;return _0x4a536b;})['then'](respondWithFilteredResult(_0x55b958,_0x11e21e))[_0xfa3b('0x46')](handleError(_0x55b958,null));};exports[_0xfa3b('0x47')]=function(_0x420351,_0x44a800){var _0x15d216={'raw':!![],'where':{'id':_0x420351['params']['id']}},_0x8d3fa5={};_0x8d3fa5[_0xfa3b('0x30')]=_[_0xfa3b('0x32')](db[_0xfa3b('0x41')][_0xfa3b('0x2d')]);_0x8d3fa5['query']=_[_0xfa3b('0x32')](_0x420351['query']);_0x8d3fa5['filters']=_['intersection'](_0x8d3fa5[_0xfa3b('0x30')],_0x8d3fa5['query']);_0x15d216[_0xfa3b('0x35')]=_[_0xfa3b('0x34')](_0x8d3fa5[_0xfa3b('0x30')],qs[_0xfa3b('0x36')](_0x420351[_0xfa3b('0x31')][_0xfa3b('0x36')]));_0x15d216[_0xfa3b('0x35')]=_0x15d216[_0xfa3b('0x35')][_0xfa3b('0x37')]?_0x15d216[_0xfa3b('0x35')]:_0x8d3fa5[_0xfa3b('0x30')];if(_0x420351[_0xfa3b('0x31')][_0xfa3b('0x42')]){_0x15d216[_0xfa3b('0x43')]=[{'all':!![]}];}_0x15d216=_[_0xfa3b('0x3e')]({},_0x15d216,_0x420351[_0xfa3b('0x40')]);return db['FaxApplication'][_0xfa3b('0x48')](_0x15d216)['then'](handleEntityNotFound(_0x44a800,null))[_0xfa3b('0x26')](respondWithResult(_0x44a800,null))[_0xfa3b('0x46')](handleError(_0x44a800,null));};exports[_0xfa3b('0x49')]=function(_0x59412f,_0x2463c8){return db[_0xfa3b('0x41')][_0xfa3b('0x49')](_0x59412f['body'],{})[_0xfa3b('0x26')](respondWithResult(_0x2463c8,0xc9))[_0xfa3b('0x46')](handleError(_0x2463c8,null));};exports[_0xfa3b('0x25')]=function(_0x3fd2cc,_0x2e2b29){if(_0x3fd2cc[_0xfa3b('0x4a')]['id']){delete _0x3fd2cc['body']['id'];}return db[_0xfa3b('0x41')]['find']({'where':{'id':_0x3fd2cc[_0xfa3b('0x4b')]['id']}})[_0xfa3b('0x26')](handleEntityNotFound(_0x2e2b29,null))['then'](saveUpdates(_0x3fd2cc['body'],null))['then'](respondWithResult(_0x2e2b29,null))[_0xfa3b('0x46')](handleError(_0x2e2b29,null));};exports[_0xfa3b('0x4c')]=function(_0x467676,_0x1680e9){return db['FaxApplication'][_0xfa3b('0x48')]({'where':{'id':_0x467676['params']['id']}})[_0xfa3b('0x26')](handleEntityNotFound(_0x1680e9,null))['then'](removeEntity(_0x1680e9,null))[_0xfa3b('0x46')](handleError(_0x1680e9,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c3e983c..8612ae9 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 _0x1df1=['lodash','util','moment','bluebird','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x13f394,_0x41cd50){var _0x59f419=function(_0x3b3676){while(--_0x3b3676){_0x13f394['push'](_0x13f394['shift']());}};_0x59f419(++_0x41cd50);}(_0x1df1,0x12c));var _0x11df=function(_0x1030fd,_0x4db35d){_0x1030fd=_0x1030fd-0x0;var _0x5365ae=_0x1df1[_0x1030fd];return _0x5365ae;};'use strict';var _=require(_0x11df('0x0'));var util=require(_0x11df('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x11df('0x2'));var BPromise=require(_0x11df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11df('0x4'));var config=require(_0x11df('0x5'));var attributes=require('./faxApplication.attributes');module[_0x11df('0x6')]=function(_0x12cf34,_0x2c0ea2){return _0x12cf34[_0x11df('0x7')](_0x11df('0x8'),attributes,{'tableName':_0x11df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11df('0xa'),'collate':_0x11df('0xb')});}; \ No newline at end of file +var _0xf839=['../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','../../config/logger','api','moment','rimraf'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xf839,0x71));var _0x9f83=function(_0x555be4,_0x1aa0d5){_0x555be4=_0x555be4-0x0;var _0x4ddb27=_0xf839[_0x555be4];return _0x4ddb27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f83('0x0'))(_0x9f83('0x1'));var moment=require(_0x9f83('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f83('0x3'));var config=require(_0x9f83('0x4'));var attributes=require(_0x9f83('0x5'));module[_0x9f83('0x6')]=function(_0x2d4d70,_0x196c2f){return _0x2d4d70[_0x9f83('0x7')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f83('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 55f56a6..056d7e1 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 _0x2c90=['rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxApplication','body','options','attributes','limit','catch','lodash','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x4a402e,_0x19eebd){var _0x1af2d6=function(_0x1383db){while(--_0x1383db){_0x4a402e['push'](_0x4a402e['shift']());}};_0x1af2d6(++_0x19eebd);}(_0x2c90,0xe5));var _0x02c9=function(_0x41122b,_0x5d8662){_0x41122b=_0x41122b-0x0;var _0x5b6e47=_0x2c90[_0x41122b];return _0x5b6e47;};'use strict';var _=require(_0x02c9('0x0'));var util=require('util');var moment=require(_0x02c9('0x1'));var BPromise=require('bluebird');var rs=require(_0x02c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02c9('0x3'));var logger=require(_0x02c9('0x4'))(_0x02c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x02c9('0x6'));var client=jayson[_0x02c9('0x7')][_0x02c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d800,_0x545f3f,_0x43ec6f){return new BPromise(function(_0x2739c0,_0x5e83bb){return client[_0x02c9('0x9')](_0x33d800,_0x43ec6f)[_0x02c9('0xa')](function(_0xdcb5a1){logger[_0x02c9('0xb')](_0x02c9('0xc'),_0x545f3f,_0x02c9('0xd'));logger[_0x02c9('0xe')](_0x02c9('0xf'),_0x545f3f,_0x02c9('0xd'),JSON[_0x02c9('0x10')](_0xdcb5a1));if(_0xdcb5a1['error']){if(_0xdcb5a1[_0x02c9('0x11')][_0x02c9('0x12')]===0x1f4){logger[_0x02c9('0x11')](_0x02c9('0xc'),_0x545f3f,_0xdcb5a1[_0x02c9('0x11')][_0x02c9('0x13')]);return _0x5e83bb(_0xdcb5a1[_0x02c9('0x11')][_0x02c9('0x13')]);}logger[_0x02c9('0x11')](_0x02c9('0xc'),_0x545f3f,_0xdcb5a1[_0x02c9('0x11')][_0x02c9('0x13')]);return _0x2739c0(_0xdcb5a1['error'][_0x02c9('0x13')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x545f3f,_0x02c9('0xd'));_0x2739c0(_0xdcb5a1['result'][_0x02c9('0x13')]);}})['catch'](function(_0x29b7c6){logger['error'](_0x02c9('0xc'),_0x545f3f,_0x29b7c6);_0x5e83bb(_0x29b7c6);});});}exports[_0x02c9('0x14')]=function(_0x4a89d9){var _0x478835=this;return new Promise(function(_0x316dba,_0x484a18){return db['FaxApplication']['update'](_0x4a89d9[_0x02c9('0x15')],{'raw':_0x4a89d9[_0x02c9('0x16')]?_0x4a89d9[_0x02c9('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a89d9['options']?_0x4a89d9[_0x02c9('0x16')]['where']||null:null,'attributes':_0x4a89d9[_0x02c9('0x16')]?_0x4a89d9[_0x02c9('0x16')][_0x02c9('0x17')]||null:null,'limit':_0x4a89d9['options']?_0x4a89d9[_0x02c9('0x16')][_0x02c9('0x18')]||null:null})[_0x02c9('0xa')](function(_0x2431ba){logger[_0x02c9('0xb')](_0x02c9('0x14'),_0x4a89d9);logger[_0x02c9('0xe')]('UpdateFaxApplication',_0x4a89d9,JSON['stringify'](_0x2431ba));_0x316dba(_0x2431ba);})[_0x02c9('0x19')](function(_0x1f34d2){logger[_0x02c9('0x11')]('UpdateFaxApplication',_0x1f34d2[_0x02c9('0x13')],_0x4a89d9);_0x484a18(_0x478835[_0x02c9('0x11')](0x1f4,_0x1f34d2[_0x02c9('0x13')]));});});}; \ No newline at end of file +var _0x591d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','debug','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b5306,_0x200588){var _0x582ea1=function(_0x361515){while(--_0x361515){_0x4b5306['push'](_0x4b5306['shift']());}};_0x582ea1(++_0x200588);}(_0x591d,0x171));var _0xd591=function(_0x2a630f,_0x4a3ecb){_0x2a630f=_0x2a630f-0x0;var _0x12326c=_0x591d[_0x2a630f];return _0x12326c;};'use strict';var _=require('lodash');var util=require(_0xd591('0x0'));var moment=require(_0xd591('0x1'));var BPromise=require(_0xd591('0x2'));var rs=require(_0xd591('0x3'));var fs=require('fs');var Redis=require(_0xd591('0x4'));var db=require(_0xd591('0x5'))['db'];var utils=require(_0xd591('0x6'));var logger=require(_0xd591('0x7'))(_0xd591('0x8'));var config=require('../../config/environment');var jayson=require(_0xd591('0x9'));var client=jayson[_0xd591('0xa')][_0xd591('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aaba9,_0x52d203,_0x577932){return new BPromise(function(_0x5dce35,_0x5dd191){return client[_0xd591('0xc')](_0x2aaba9,_0x577932)[_0xd591('0xd')](function(_0x14cba4){logger[_0xd591('0xe')](_0xd591('0xf'),_0x52d203,_0xd591('0x10'));logger['debug'](_0xd591('0x11'),_0x52d203,_0xd591('0x10'),JSON[_0xd591('0x12')](_0x14cba4));if(_0x14cba4[_0xd591('0x13')]){if(_0x14cba4[_0xd591('0x13')][_0xd591('0x14')]===0x1f4){logger[_0xd591('0x13')](_0xd591('0xf'),_0x52d203,_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);return _0x5dd191(_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);}logger[_0xd591('0x13')]('FaxApplication,\x20%s,\x20%s',_0x52d203,_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);return _0x5dce35(_0x14cba4['error'][_0xd591('0x15')]);}else{logger[_0xd591('0xe')]('FaxApplication,\x20%s,\x20%s',_0x52d203,_0xd591('0x10'));_0x5dce35(_0x14cba4[_0xd591('0x16')][_0xd591('0x15')]);}})['catch'](function(_0x10525c){logger[_0xd591('0x13')](_0xd591('0xf'),_0x52d203,_0x10525c);_0x5dd191(_0x10525c);});});}exports['UpdateFaxApplication']=function(_0x2f471e){var _0x2dfe40=this;return new Promise(function(_0x497aaf,_0x1eb0a5){return db[_0xd591('0x17')][_0xd591('0x18')](_0x2f471e[_0xd591('0x19')],{'raw':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1c')]||null:null,'attributes':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1d')]||null:null,'limit':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1e')]||null:null})[_0xd591('0xd')](function(_0x30bd08){logger[_0xd591('0xe')](_0xd591('0x1f'),_0x2f471e);logger[_0xd591('0x20')](_0xd591('0x1f'),_0x2f471e,JSON[_0xd591('0x12')](_0x30bd08));_0x497aaf(_0x30bd08);})[_0xd591('0x21')](function(_0x1325e7){logger[_0xd591('0x13')](_0xd591('0x1f'),_0x1325e7[_0xd591('0x15')],_0x2f471e);_0x1eb0a5(_0x2dfe40[_0xd591('0x13')](0x1f4,_0x1325e7['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9319099..f9616dc 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 _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x120290,_0x1e93f6){var _0x121069=function(_0x3f09f4){while(--_0x3f09f4){_0x120290['push'](_0x120290['shift']());}};_0x121069(++_0x1e93f6);}(_0xd4a2,0x173));var _0x2d4a=function(_0xaaa121,_0x242352){_0xaaa121=_0xaaa121-0x0;var _0x508f6e=_0xd4a2[_0xaaa121];return _0x508f6e;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file +var _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x4cf8[_0x431ff8];return _0x84ccd4;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index dcaa4fe..2c4cfb2 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 _0xde19=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x59a2b3,_0x22ecf7){var _0x17c74e=function(_0x3402be){while(--_0x3402be){_0x59a2b3['push'](_0x59a2b3['shift']());}};_0x17c74e(++_0x22ecf7);}(_0xde19,0x86));var _0x9de1=function(_0xb4889,_0x40d58f){_0xb4889=_0xb4889-0x0;var _0x49a716=_0xde19[_0xb4889];return _0x49a716;};'use strict';var Sequelize=require(_0x9de1('0x0'));module[_0x9de1('0x1')]={'closed':{'type':Sequelize[_0x9de1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9de1('0x3')]},'disposition':{'type':Sequelize[_0x9de1('0x4')]},'secondDisposition':{'type':Sequelize[_0x9de1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9de1('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9de1('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9de1('0x5')]('in',_0x9de1('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xbd12=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x381935,_0x3f29e1){var _0x2dd2c7=function(_0x20f1b2){while(--_0x20f1b2){_0x381935['push'](_0x381935['shift']());}};_0x2dd2c7(++_0x3f29e1);}(_0xbd12,0x129));var _0x2bd1=function(_0x56bcb3,_0x186fd6){_0x56bcb3=_0x56bcb3-0x0;var _0x38e11b=_0xbd12[_0x56bcb3];return _0x38e11b;};'use strict';var Sequelize=require(_0x2bd1('0x0'));module[_0x2bd1('0x1')]={'closed':{'type':Sequelize[_0x2bd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2bd1('0x3')]},'disposition':{'type':Sequelize[_0x2bd1('0x4')]},'secondDisposition':{'type':Sequelize[_0x2bd1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2bd1('0x4')]},'note':{'type':Sequelize[_0x2bd1('0x4')]},'read1stAt':{'type':Sequelize[_0x2bd1('0x3')]},'fax':{'type':Sequelize[_0x2bd1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2bd1('0x5')]('in',_0x2bd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2bd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2bd1('0x5')]('in',_0x2bd1('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 1de3160..66cf924 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 _0x505a=['user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','push','all','rows','params','includeAll','options','create','update','describe','addMessage','FaxMessage','ids','getMessages','findOne','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','format','Attachment','Messages','mkdirSync','basename','existsSync','pipe','resolve','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','end','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','catch','index','FaxInteraction','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId'];(function(_0x377844,_0x563004){var _0x3688f=function(_0x5908d2){while(--_0x5908d2){_0x377844['push'](_0x377844['shift']());}};_0x3688f(++_0x563004);}(_0x505a,0x159));var _0xa505=function(_0x102d2a,_0x4b3bba){_0x102d2a=_0x102d2a-0x0;var _0x190850=_0x505a[_0x102d2a];return _0x190850;};'use strict';var emlformat=require(_0xa505('0x0'));var rimraf=require(_0xa505('0x1'));var zipdir=require(_0xa505('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa505('0x3'));var moment=require(_0xa505('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa505('0x5'));var util=require(_0xa505('0x6'));var path=require(_0xa505('0x7'));var sox=require(_0xa505('0x8'));var csv=require(_0xa505('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa505('0xa'));var _=require('lodash');var squel=require(_0xa505('0xb'));var crypto=require(_0xa505('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa505('0xd'));var toCsv=require(_0xa505('0x9'));var querystring=require(_0xa505('0xe'));var Papa=require('papaparse');var Redis=require(_0xa505('0xf'));var authService=require(_0xa505('0x10'));var qs=require(_0xa505('0x11'));var as=require(_0xa505('0x12'));var hardwareService=require(_0xa505('0x13'));var logger=require(_0xa505('0x14'))(_0xa505('0x15'));var utils=require(_0xa505('0x16'));var config=require(_0xa505('0x17'));var licenseUtil=require(_0xa505('0x18'));var db=require('../../mysqldb')['db'];config[_0xa505('0x19')]=_[_0xa505('0x1a')](config['redis'],{'host':_0xa505('0x1b'),'port':0x18eb});var socket=require(_0xa505('0x1c'))(new Redis(config[_0xa505('0x19')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0xe9b08d,_0x281c69){_0x281c69=_0x281c69||0xcc;return function(_0x3244cf){if(_0x3244cf){return _0xe9b08d[_0xa505('0x1d')](_0x281c69);}return _0xe9b08d['status'](_0x281c69)['end']();};}function respondWithResult(_0x5a82e8,_0x21b829){_0x21b829=_0x21b829||0xc8;return function(_0x20a596){if(_0x20a596){return _0x5a82e8[_0xa505('0x1e')](_0x21b829)['json'](_0x20a596);}};}function respondWithFilteredResult(_0x17f73f,_0x20a2f2){return function(_0x109500){if(_0x109500){var _0x434f6d=typeof _0x20a2f2[_0xa505('0x1f')]==='undefined'&&typeof _0x20a2f2[_0xa505('0x20')]===_0xa505('0x21');var _0x5d7c60=_0x109500['count'];var _0x1947da=_0x434f6d?0x0:_0x20a2f2[_0xa505('0x1f')];var _0x48ccfb=_0x434f6d?_0x109500[_0xa505('0x22')]:_0x20a2f2[_0xa505('0x1f')]+_0x20a2f2[_0xa505('0x20')];var _0x5dc834;if(_0x48ccfb>=_0x5d7c60){_0x48ccfb=_0x5d7c60;_0x5dc834=0xc8;}else{_0x5dc834=0xce;}_0x17f73f[_0xa505('0x1e')](_0x5dc834);return _0x17f73f[_0xa505('0x23')](_0xa505('0x24'),_0x1947da+'-'+_0x48ccfb+'/'+_0x5d7c60)['json'](_0x109500);}return null;};}function patchUpdates(_0xd6a630){return function(_0x325281){try{jsonpatch[_0xa505('0x25')](_0x325281,_0xd6a630,!![]);}catch(_0x38af90){return BPromise['reject'](_0x38af90);}return _0x325281[_0xa505('0x26')]();};}function saveUpdates(_0x202e0e,_0x55d148){return function(_0x7fa803){if(_0x7fa803){return _0x7fa803['update'](_0x202e0e)['then'](function(_0x3cf06c){return _0x3cf06c;});}return null;};}function removeEntity(_0x349e4d,_0x35b49e){return function(_0x32aced){if(_0x32aced){return _0x32aced[_0xa505('0x27')]()[_0xa505('0x28')](function(){_0x349e4d['status'](0xcc)[_0xa505('0x29')]();});}};}function handleEntityNotFound(_0x84c56c,_0x220535){return function(_0x471c17){if(!_0x471c17){_0x84c56c[_0xa505('0x1d')](0x194);}return _0x471c17;};}function handleError(_0x3b09c8,_0x4a265e){_0x4a265e=_0x4a265e||0x1f4;return function(_0xcf5d6b){logger[_0xa505('0x2a')](_0xcf5d6b[_0xa505('0x2b')]);if(_0xcf5d6b[_0xa505('0x2c')]){delete _0xcf5d6b[_0xa505('0x2c')];}_0x3b09c8['status'](_0x4a265e)[_0xa505('0x2d')](_0xcf5d6b);};}function getInteractionUsers(_0x4e9c1,_0x7ba9cc){return new BPromise(function(_0x47f10a,_0x565da2){try{if(_0x7ba9cc[_0x4e9c1['id']]){_0x4e9c1[_0xa505('0x2e')]=_[_0xa505('0x2f')](_0x7ba9cc[_0x4e9c1['id']],function(_0x2a8511){return{'id':_0x2a8511['id'],'fullname':_0x2a8511['fullname']};});}}catch(_0x422b21){_0x565da2(_0x422b21);}_0x47f10a(_0x4e9c1);});}function getInteractionTags(_0x42ad31,_0xabf6d0){return new BPromise(function(_0x289ca7,_0x2d0de4){try{if(_0x42ad31['TagIds']){_0x42ad31[_0xa505('0x30')]=[];_0x42ad31[_0xa505('0x31')][_0xa505('0x32')](',')[_0xa505('0x33')](function(_0x196345){_0x42ad31['Tags']['push'](_0xabf6d0[_0x196345]);});}delete _0x42ad31[_0xa505('0x31')];}catch(_0x5c5921){_0x2d0de4(_0x5c5921);}_0x289ca7(_0x42ad31);});}function updateFaxInteraction(_0x43b938,_0x30dbda,_0x365bdb){return new BPromise(function(_0x54883c,_0x79839e){return getInteractionUsers(_0x43b938,_0x365bdb)[_0xa505('0x28')](function(_0xddeaae){return getInteractionTags(_0xddeaae,_0x30dbda);})[_0xa505('0x28')](function(_0x120ec5){_0x54883c(_0x120ec5);})[_0xa505('0x34')](function(_0x3c2dfb){_0x79839e(_0x3c2dfb);});});}exports[_0xa505('0x35')]=function(_0x3a90d6,_0x4e0359){var _0x4af28d={},_0x1a249a={},_0x4eb979={'count':0x0,'rows':[]};var _0x2a54cb=_[_0xa505('0x2f')](db[_0xa505('0x36')][_0xa505('0x37')],function(_0x7bfb90){return{'name':_0x7bfb90['fieldName'],'type':_0x7bfb90[_0xa505('0x38')][_0xa505('0x39')]};});_0x1a249a['model']=_['map'](_0x2a54cb,_0xa505('0x2c'));_0x1a249a[_0xa505('0x3a')]=_['keys'](_0x3a90d6['query']);_0x1a249a[_0xa505('0x3b')]=_[_0xa505('0x3c')](_0x1a249a[_0xa505('0x3d')],_0x1a249a[_0xa505('0x3a')]);_0x4af28d['attributes']=_[_0xa505('0x3c')](_0x1a249a[_0xa505('0x3d')],qs[_0xa505('0x3e')](_0x3a90d6[_0xa505('0x3a')][_0xa505('0x3e')]));_0x4af28d['attributes']=_0x4af28d[_0xa505('0x3f')][_0xa505('0x40')]?_0x4af28d[_0xa505('0x3f')]:_0x1a249a['model'];if(!_0x3a90d6['query'][_0xa505('0x41')](_0xa505('0x42'))){_0x4af28d['limit']=qs[_0xa505('0x20')](_0x3a90d6[_0xa505('0x3a')][_0xa505('0x20')]);_0x4af28d[_0xa505('0x1f')]=qs[_0xa505('0x1f')](_0x3a90d6[_0xa505('0x3a')][_0xa505('0x1f')]);}_0x4af28d[_0xa505('0x43')]=qs[_0xa505('0x44')](_0x3a90d6['query'][_0xa505('0x44')]);_0x4af28d[_0xa505('0x45')]=qs[_0xa505('0x3b')](_[_0xa505('0x46')](_0x3a90d6[_0xa505('0x3a')],_0x1a249a[_0xa505('0x3b')]),_0x2a54cb);var _0x4db6ed=[];var _0x2e1d65=squel[_0xa505('0x47')]()[_0xa505('0x48')]('id')['field'](_0xa505('0x2c'))['field'](_0xa505('0x49'))[_0xa505('0x4a')](_0xa505('0x4b'));var _0x3af241=squel[_0xa505('0x47')]()['field'](_0xa505('0x4c'))[_0xa505('0x48')](_0xa505('0x4d'))[_0xa505('0x48')](_0xa505('0x4e'))[_0xa505('0x4a')](_0xa505('0x4f'),'ui')[_0xa505('0x50')](_0xa505('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x39c8db=squel[_0xa505('0x47')]()[_0xa505('0x4a')](_0xa505('0x52'),'i')['left_join'](_0xa505('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xa505('0x51'),'o',_0xa505('0x54'))[_0xa505('0x50')](_0xa505('0x55'),'a','a.id\x20=\x20i.FaxAccountId')[_0xa505('0x50')]('fax_messages','me',_0xa505('0x56'))[_0xa505('0x50')]('fax_interaction_has_tags','it',_0xa505('0x57'))['left_join']('tools_tags','t',_0xa505('0x58'));var _0x21b6e6=squel[_0xa505('0x59')]();var _0x1fc77b=[];var _0x4a4f43=squel[_0xa505('0x59')]();var _0x29cc2c;if(_0x3a90d6[_0xa505('0x3a')][_0xa505('0x5a')]){_0x29cc2c=as[_0xa505('0x5b')](_0x3a90d6[_0xa505('0x3a')]['search']);var _0x5669cb=_0x29cc2c[_0xa505('0x5c')];for(var _0x25f297=0x0;_0x25f297<_0x29cc2c['conditions'][_0xa505('0x40')];_0x25f297++){var _0x1dea46=_0x29cc2c[_0xa505('0x5d')][_0x25f297];var _0x28af31='i';var _0x377b08=_[_0xa505('0x5e')](_0x2a54cb,['name',_0x1dea46[_0xa505('0x48')]]);if(!_0x377b08){switch(_0x1dea46[_0xa505('0x48')]){case _0xa505('0x5f'):if(_0x1dea46['value']==0x1){_0x39c8db['having']('`'+_0x1dea46[_0xa505('0x48')]+_0xa505('0x60'));}else{_0x39c8db[_0xa505('0x61')]('`'+_0x1dea46[_0xa505('0x48')]+_0xa505('0x62'));}break;case _0xa505('0x63'):if(_0x1dea46['operator']==='$substring'){if(_0x1dea46['value'][_0xa505('0x32')]('\x20')[_0xa505('0x40')]>0x1){_0x21b6e6[_0x5669cb](_0xa505('0x64'),qs[_0xa505('0x65')](_0x1dea46['value']),null);}else{var _0x75f9e0='%'+_0x1dea46[_0xa505('0x66')]+'%';_0x21b6e6[_0x5669cb](_0xa505('0x67'),_0x75f9e0,_0x75f9e0,_0x75f9e0);}}else{_0x377b08=_[_0xa505('0x5e')](_0x2a54cb,[_0xa505('0x2c'),'ContactId']);_0x1dea46['field']=_0xa505('0x68');_0x372743=as[_0xa505('0x69')](_0x28af31,_0x377b08[_0xa505('0x38')],_0x1dea46);_0x21b6e6[_0x5669cb](_0x372743[_0xa505('0x6a')],_0x372743[_0xa505('0x66')][_0xa505('0x6b')],_0x372743[_0xa505('0x66')][_0xa505('0x29')]);}break;case _0xa505('0x6c'):var _0x786e0e=_0x1dea46[_0xa505('0x66')]['split'](',')[_0xa505('0x2f')](function(_0x3c1811){return Number(_0x3c1811);});_0x786e0e[_0xa505('0x33')](function(_0x5a526e){_0x4a4f43['or'](_0xa505('0x6d'),'%,'+_0x5a526e+',%');});_0x1fc77b=_[_0xa505('0x6e')](_0x1fc77b,_0x786e0e);break;case _0xa505('0x6f'):if(_0x1dea46[_0xa505('0x70')]===_0xa505('0x71')){_0x21b6e6[_0x5669cb](_0xa505('0x72'),'%'+_0x1dea46[_0xa505('0x66')]+'%',null);}else{_0x377b08=_[_0xa505('0x5e')](_0x2a54cb,[_0xa505('0x2c'),_0xa505('0x73')]);_0x1dea46[_0xa505('0x48')]=_0xa505('0x73');_0x372743=as[_0xa505('0x69')](_0x28af31,_0x377b08[_0xa505('0x38')],_0x1dea46);_0x21b6e6[_0x5669cb](_0x372743[_0xa505('0x6a')],_0x372743[_0xa505('0x66')][_0xa505('0x6b')],_0x372743['value']['end']);}break;case _0xa505('0x74'):_0x372743=as['buildExpression']('me',null,_0x1dea46);_0x21b6e6[_0x5669cb](_0x372743['text'],_0x372743[_0xa505('0x66')][_0xa505('0x6b')],_0x372743[_0xa505('0x66')]['end']);break;}}else{var _0x372743=as[_0xa505('0x69')](_0x28af31,_0x377b08[_0xa505('0x38')],_0x1dea46);_0x21b6e6[_0x5669cb](_0x372743[_0xa505('0x6a')],_0x372743[_0xa505('0x66')][_0xa505('0x6b')],_0x372743[_0xa505('0x66')][_0xa505('0x29')]);}}}else{var _0x123a1e=_(_0x3a90d6[_0xa505('0x3a')])[_0xa505('0x75')]()[_0xa505('0x2f')](function(_0x1649bd){return _[_0xa505('0x76')](_0x2a54cb,['name',_0x1649bd])?_0x1649bd:undefined;})[_0xa505('0x77')]()[_0xa505('0x66')]();if(!_[_0xa505('0x78')](_0x123a1e)){_0x123a1e[_0xa505('0x33')](function(_0x22cee8){if(_0x22cee8===_0xa505('0x79')){_0x39c8db[_0xa505('0x45')]('i.FaxAccountId\x20IN\x20?',[][_0xa505('0x7a')](_0x3a90d6['query'][_0x22cee8]));}else if(_0x22cee8===_0xa505('0x7b')){var _0x438172=JSON[_0xa505('0x7c')](_0x3a90d6[_0xa505('0x3a')][_0x22cee8])[_0xa505('0x7d')];var _0xc77bf6=JSON[_0xa505('0x7c')](_0x3a90d6[_0xa505('0x3a')][_0x22cee8])['$lte'];_0x39c8db[_0xa505('0x45')](_0xa505('0x7e'),_0x438172,_0xc77bf6);}else{if(_0x3a90d6[_0xa505('0x3a')][_0x22cee8]==='null'){_0x39c8db['where']('i.'+_0x22cee8+_0xa505('0x7f'));}else{_0x39c8db['where']('i.'+_0x22cee8+_0xa505('0x80'),_0x3a90d6['query'][_0x22cee8]);}}});}if(_0x3a90d6['query'][_0xa505('0x81')]){if(_0x3a90d6[_0xa505('0x3a')][_0xa505('0x81')]==0x1){_0x39c8db['having']('`unreadMessages`\x20=\x200');}else{_0x39c8db[_0xa505('0x61')](_0xa505('0x82'));}}if(_0x3a90d6[_0xa505('0x3a')][_0xa505('0x83')]){_0x1fc77b=_['isArray'](_0x3a90d6[_0xa505('0x3a')]['tag'])?_0x3a90d6['query'][_0xa505('0x83')]:new Array(_0x3a90d6[_0xa505('0x3a')][_0xa505('0x83')]);_0x1fc77b[_0xa505('0x33')](function(_0x262b06){_0x4a4f43['or'](_0xa505('0x6d'),'%,'+_0x262b06+',%');});}if(_0x3a90d6[_0xa505('0x3a')][_0xa505('0x84')]){var _0x234461=_0x3a90d6['query'][_0xa505('0x84')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa505('0x85')](_0x234461)){_0x21b6e6['or'](_0xa505('0x86'),_0x234461+'%')['or'](_0xa505('0x87'),_0x234461+'%');}_0x21b6e6['or'](_0xa505('0x88'),_0x234461+'%');}}_0x39c8db['where'](_0x21b6e6);_0x39c8db['group'](_0xa505('0x89'));var _0x2d7ab3={'type':db[_0xa505('0x8a')][_0xa505('0x8b')]['SELECT'],'raw':!![]};var _0x35f878=_0x39c8db[_0xa505('0x8c')]();_0x35f878['field'](_0xa505('0x89'));_0x35f878['field'](_0xa505('0x8d'),_0xa505('0x5f'));if(_0x4af28d[_0xa505('0x43')]){_0x4af28d[_0xa505('0x43')][_0xa505('0x33')](function(_0x8ed567){var _0x195190=_0x8ed567[0x0]===_0xa505('0x8e')?_0x8ed567[0x0]:'i.'+_0x8ed567[0x0];_0x39c8db['order'](_0x195190,_0x8ed567[0x1]==='DESC'?![]:!![]);});}if(!_[_0xa505('0x78')](_0x1fc77b)){_0x39c8db[_0xa505('0x61')](_0x4a4f43);_0x35f878['where'](_0xa505('0x8f'),_0x1fc77b);}BPromise['resolve']()[_0xa505('0x28')](function(){if(!_0x29cc2c){if(_0x3a90d6[_0xa505('0x3a')]['FaxAccountId'])return;_0x35f878[_0xa505('0x45')](_0xa505('0x90'));_0x39c8db[_0xa505('0x45')](_0xa505('0x90'));return;}if(_0x3a90d6[_0xa505('0x91')][_0xa505('0x92')]!==_0xa505('0x93'))return;return _0x3a90d6[_0xa505('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x247548){if(_[_0xa505('0x78')](_0x247548)){_0x35f878[_0xa505('0x45')](_0xa505('0x94'));_0x39c8db[_0xa505('0x45')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x35f878['where'](_0xa505('0x95'),_[_0xa505('0x2f')](_0x247548,'id'));_0x39c8db[_0xa505('0x45')](_0xa505('0x95'),_[_0xa505('0x2f')](_0x247548,'id'));}});})[_0xa505('0x28')](function(){if(_0x3a90d6[_0xa505('0x91')][_0xa505('0x92')]==='agent'&&!_0x29cc2c&&!_0x3a90d6['query'][_0xa505('0x79')])return[];return db[_0xa505('0x96')]['query'](_0x35f878[_0xa505('0x97')](),_0x2d7ab3);})[_0xa505('0x28')](function(_0x4d3e14){_0x4eb979[_0xa505('0x22')]=_0x4d3e14[_0xa505('0x40')];if(_0x4eb979[_0xa505('0x22')]===0x0)return[];return db['sequelize'][_0xa505('0x3a')](_0x2e1d65[_0xa505('0x97')](),_0x2d7ab3)[_0xa505('0x28')](function(_0x5c9212){_0x4db6ed=_[_0xa505('0x98')](_0x5c9212,'id');_0x2d7ab3=_[_0xa505('0x99')](_0x2d7ab3,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a90d6[_0xa505('0x3a')]['fields']){_0x4af28d[_0xa505('0x3f')][_0xa505('0x33')](function(_0x119a46){_0x39c8db[_0xa505('0x48')]('i.'+_0x119a46);});}else{_0x39c8db[_0xa505('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa505('0x5f'));_0x39c8db[_0xa505('0x48')](_0xa505('0x9a'),'Account.key');_0x39c8db[_0xa505('0x48')](_0xa505('0x9b'),_0xa505('0x9c'));_0x39c8db[_0xa505('0x48')](_0xa505('0x9d'),_0xa505('0x8e'));_0x39c8db['field'](_0xa505('0x9e'));_0x39c8db[_0xa505('0x48')]('c.firstName',_0xa505('0x9f'));_0x39c8db[_0xa505('0x48')](_0xa505('0xa0'),_0xa505('0xa1'));_0x39c8db['field']('c.email',_0xa505('0xa2'));_0x39c8db[_0xa505('0x48')](_0xa505('0xa3'),_0xa505('0xa4'));_0x39c8db[_0xa505('0x48')](_0xa505('0xa5'),_0xa505('0xa6'));_0x39c8db['field'](_0xa505('0xa7'),'Contact.fax');_0x39c8db['field'](_0xa505('0xa8'),_0xa505('0xa9'));_0x39c8db[_0xa505('0x48')]('o.internal','Owner.internal');_0x39c8db[_0xa505('0x48')](_0xa505('0xaa'),_0xa505('0x31'));}if(_0x4af28d[_0xa505('0x20')])_0x39c8db[_0xa505('0x20')](_0x4af28d[_0xa505('0x20')]);if(_0x4af28d['offset'])_0x39c8db[_0xa505('0x1f')](_0x4af28d[_0xa505('0x1f')]);return db['sequelize'][_0xa505('0x3a')](_0x39c8db['toString'](),_0x2d7ab3);})[_0xa505('0x28')](function(_0x5a6f98){if(_0x5a6f98['length']>0x0)_0x3af241[_0xa505('0x45')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x5a6f98,'id'));return db[_0xa505('0x96')]['query'](_0x3af241[_0xa505('0x97')](),_0x2d7ab3)[_0xa505('0x28')](function(_0x5e3bd3){var _0xe0b8fd=_['groupBy'](_0x5e3bd3,'FaxInteractionId');var _0x4988f9=[];_0x5a6f98['forEach'](function(_0x7c5ccc){_0x4988f9[_0xa505('0xab')](updateFaxInteraction(_0x7c5ccc,_0x4db6ed,_0xe0b8fd));});return BPromise[_0xa505('0xac')](_0x4988f9);});});})['then'](function(_0x1a51fc){_0x4eb979[_0xa505('0xad')]=_0x1a51fc;return _0x4eb979;})['then'](respondWithFilteredResult(_0x4e0359,_0x4af28d))[_0xa505('0x34')](handleError(_0x4e0359,null));};exports['show']=function(_0x30662d,_0x5f2347){var _0x3b1f52={'raw':![],'where':{'id':_0x30662d[_0xa505('0xae')]['id']}},_0x2f4741={};_0x2f4741[_0xa505('0x3d')]=_[_0xa505('0x75')](db[_0xa505('0x36')][_0xa505('0x37')]);_0x2f4741['query']=_[_0xa505('0x75')](_0x30662d[_0xa505('0x3a')]);_0x2f4741[_0xa505('0x3b')]=_[_0xa505('0x3c')](_0x2f4741['model'],_0x2f4741['query']);_0x3b1f52[_0xa505('0x3f')]=_['intersection'](_0x2f4741['model'],qs[_0xa505('0x3e')](_0x30662d[_0xa505('0x3a')]['fields']));_0x3b1f52['attributes']=_0x3b1f52[_0xa505('0x3f')]['length']?_0x3b1f52[_0xa505('0x3f')]:_0x2f4741[_0xa505('0x3d')];if(_0x30662d['query'][_0xa505('0xaf')]){_0x3b1f52['include']=[{'all':!![]}];}_0x3b1f52=_[_0xa505('0x99')]({},_0x3b1f52,_0x30662d[_0xa505('0xb0')]);return db[_0xa505('0x36')][_0xa505('0x5e')](_0x3b1f52)['then'](handleEntityNotFound(_0x5f2347,null))[_0xa505('0x28')](respondWithResult(_0x5f2347,null))['catch'](handleError(_0x5f2347,null));};exports[_0xa505('0xb1')]=function(_0x16af2e,_0x262b19){return db[_0xa505('0x36')][_0xa505('0xb1')](_0x16af2e[_0xa505('0x74')],{})[_0xa505('0x28')](respondWithResult(_0x262b19,0xc9))[_0xa505('0x34')](handleError(_0x262b19,null));};exports[_0xa505('0xb2')]=function(_0x1bfe82,_0x354f98){if(_0x1bfe82[_0xa505('0x74')]['id']){delete _0x1bfe82[_0xa505('0x74')]['id'];}return db[_0xa505('0x36')][_0xa505('0x5e')]({'where':{'id':_0x1bfe82['params']['id']}})['then'](handleEntityNotFound(_0x354f98,null))[_0xa505('0x28')](saveUpdates(_0x1bfe82['body'],null))[_0xa505('0x28')](respondWithResult(_0x354f98,null))[_0xa505('0x34')](handleError(_0x354f98,null));};exports[_0xa505('0x27')]=function(_0x42a220,_0x5d492f){return db['FaxInteraction']['find']({'where':{'id':_0x42a220[_0xa505('0xae')]['id']}})[_0xa505('0x28')](handleEntityNotFound(_0x5d492f,null))['then'](removeEntity(_0x5d492f,null))['catch'](handleError(_0x5d492f,null));};exports[_0xa505('0xb3')]=function(_0x286ef2,_0x585451){return db[_0xa505('0x36')]['describe']()[_0xa505('0x28')](respondWithResult(_0x585451,null))[_0xa505('0x34')](handleError(_0x585451,null));};exports[_0xa505('0xb4')]=function(_0x20bf0c,_0x5b27e1,_0x2d12ed){return db[_0xa505('0xb5')][_0xa505('0x5e')]({'where':{'id':_0x20bf0c[_0xa505('0xae')]['id']}})['then'](handleEntityNotFound(_0x5b27e1,null))[_0xa505('0x28')](function(_0x5b6d65){if(_0x5b6d65){return _0x5b6d65[_0xa505('0xb4')](_0x20bf0c[_0xa505('0x74')][_0xa505('0xb6')],_['omit'](_0x20bf0c[_0xa505('0x74')],[_0xa505('0xb6'),'id'])||{});}})[_0xa505('0x28')](respondWithResult(_0x5b27e1,null))[_0xa505('0x34')](handleError(_0x5b27e1,null));};exports[_0xa505('0xb7')]=function(_0x4f8604,_0x397000,_0x403bb2){var _0x1ca53a={'raw':![],'where':{}};var _0x27d4b6={};var _0x2fccd={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa505('0xb8')]({'where':{'id':_0x4f8604['params']['id']}})[_0xa505('0x28')](handleEntityNotFound(_0x397000,null))[_0xa505('0x28')](function(_0x181098){if(_0x181098){_0x27d4b6[_0xa505('0x3d')]=_[_0xa505('0x75')](db[_0xa505('0xb5')][_0xa505('0x37')]);_0x27d4b6['query']=_[_0xa505('0x75')](_0x4f8604[_0xa505('0x3a')]);_0x27d4b6[_0xa505('0x3b')]=_[_0xa505('0x3c')](_0x27d4b6[_0xa505('0x3d')],_0x27d4b6['query']);_0x1ca53a[_0xa505('0x3f')]=_[_0xa505('0x3c')](_0x27d4b6['model'],qs['fields'](_0x4f8604['query']['fields']));_0x1ca53a[_0xa505('0x3f')]=_0x1ca53a[_0xa505('0x3f')][_0xa505('0x40')]?_0x1ca53a[_0xa505('0x3f')]:_0x27d4b6[_0xa505('0x3d')];if(!_0x4f8604['query']['hasOwnProperty']('nolimit')){_0x1ca53a['limit']=qs[_0xa505('0x20')](_0x4f8604[_0xa505('0x3a')][_0xa505('0x20')]);_0x1ca53a['offset']=qs[_0xa505('0x1f')](_0x4f8604[_0xa505('0x3a')][_0xa505('0x1f')]);}_0x1ca53a[_0xa505('0x43')]=qs['sort'](_0x4f8604[_0xa505('0x3a')][_0xa505('0x44')]);_0x1ca53a[_0xa505('0x45')]=qs[_0xa505('0x3b')](_[_0xa505('0x46')](_0x4f8604[_0xa505('0x3a')],_0x27d4b6[_0xa505('0x3b')]));_0x1ca53a[_0xa505('0x45')][_0xa505('0xb9')]=_0x181098['id'];if(_0x4f8604[_0xa505('0x3a')]['filter']){_0x1ca53a[_0xa505('0x45')]=_[_0xa505('0x99')](_0x1ca53a[_0xa505('0x45')],{'$or':_[_0xa505('0x2f')](_0x1ca53a[_0xa505('0x3f')],function(_0xcf4acd){var _0xea97db={};_0xea97db[_0xcf4acd]={'$like':'%'+_0x4f8604[_0xa505('0x3a')][_0xa505('0x84')]+'%'};return _0xea97db;})});}if(_0x4f8604['query']['$gte']){var _0x4f6423=_0x4f8604[_0xa505('0x3a')]['$gte'][_0xa505('0x32')](',');var _0x192347={};_0x192347[_0x4f6423[0x0]]={'$gte':moment(_0x4f6423[0x1])['format'](_0xa505('0xba'))};_0x1ca53a[_0xa505('0x45')]=_['merge'](_0x1ca53a[_0xa505('0x45')],_0x192347);}_0x1ca53a=_[_0xa505('0x99')]({},_0x1ca53a,_0x4f8604[_0xa505('0xb0')]);return db['FaxMessage'][_0xa505('0x22')]({'where':_0x1ca53a[_0xa505('0x45')]})[_0xa505('0x28')](function(_0x1d4f9b){_0x2fccd[_0xa505('0x22')]=_0x1d4f9b;if(_0x4f8604['query']['includeAll']){_0x1ca53a[_0xa505('0xbb')]=[{'all':!![]}];}return db[_0xa505('0xb5')][_0xa505('0xbc')](_0x1ca53a);})[_0xa505('0x28')](function(_0x3fd89e){_0x2fccd[_0xa505('0xad')]=_0x3fd89e;return _0x2fccd;});}})[_0xa505('0x28')](respondWithFilteredResult(_0x397000,_0x1ca53a))['catch'](handleError(_0x397000,null));};exports[_0xa505('0xbd')]=function(_0x1d3547,_0x9d6760,_0x269005){return db['FaxInteraction'][_0xa505('0x5e')]({'where':{'id':_0x1d3547[_0xa505('0xae')]['id']}})[_0xa505('0x28')](handleEntityNotFound(_0x9d6760,null))['then'](function(_0x2948fd){if(_0x2948fd){return _0x2948fd['setTags'](_0x1d3547['body'][_0xa505('0xb6')],_[_0xa505('0xbe')](_0x1d3547[_0xa505('0x74')],['ids','id'])||{})[_0xa505('0xbf')](function(){return db[_0xa505('0x6c')][_0xa505('0xbc')]({'attributes':['id','name',_0xa505('0x49')],'where':{'id':_0x1d3547[_0xa505('0x74')][_0xa505('0xb6')]}});})['then'](function(_0x30f385){socket[_0xa505('0xc0')](_0xa505('0xc1'),{'id':Number(_0x1d3547[_0xa505('0xae')]['id']),'tags':_0x30f385||[]});return{'id':Number(_0x1d3547[_0xa505('0xae')]['id']),'tags':_0x30f385||[]};});}})[_0xa505('0x28')](respondWithResult(_0x9d6760,null))[_0xa505('0x34')](handleError(_0x9d6760,null));};exports['removeTags']=function(_0x317268,_0x31c566,_0x4a86c6){return db[_0xa505('0x36')][_0xa505('0x5e')]({'where':{'id':_0x317268[_0xa505('0xae')]['id']}})[_0xa505('0x28')](handleEntityNotFound(_0x31c566,null))[_0xa505('0x28')](function(_0x13dc99){if(_0x13dc99){return _0x13dc99[_0xa505('0xc2')](_0x317268[_0xa505('0x3a')][_0xa505('0xb6')]);}})['then'](respondWithStatusCode(_0x31c566,null))[_0xa505('0x34')](handleError(_0x31c566,null));};exports[_0xa505('0xc3')]=function(_0x12553d,_0x370640){var _0x5088ee=moment()['unix']()['toString']();var _0x1049ca=path[_0xa505('0xc4')](config[_0xa505('0xc5')],_0xa505('0xc6'),_0xa505('0xc7'),_0xa505('0xc8'));var _0x549316=path['join'](config[_0xa505('0xc5')],'server',_0xa505('0xc7'),_0xa505('0xc9'));var _0x21a90f=path[_0xa505('0xc4')](_0x1049ca,_0x5088ee);var _0x2478a4=util[_0xa505('0xca')]('transcript-%d-%s.zip',_0x12553d[_0xa505('0xae')]['id'],_0x5088ee);var _0x4b6907=path['join'](_0x1049ca,_0x2478a4);var _0x37c88a=[];_0x37c88a[_0xa505('0xab')]({'model':db[_0xa505('0xcb')],'as':_0xa505('0xcb'),'raw':!![]});var _0x55528c=[{'model':db[_0xa505('0xb5')],'as':'Messages','attributes':['id',_0xa505('0x74'),_0xa505('0x7b')],'include':_0x37c88a}];return db[_0xa505('0x36')][_0xa505('0x5e')]({'where':{'id':_0x12553d[_0xa505('0xae')]['id']},'include':_0x55528c})[_0xa505('0x28')](handleEntityNotFound(_0x370640,null))[_0xa505('0x28')](function(_0x21c1b1){if(_0x21c1b1&&_0x21c1b1[_0xa505('0xcc')]){var _0x23f28c=_0x21c1b1['get']({'plain':!![]});fs[_0xa505('0xcd')](_0x21a90f);for(var _0x2b58fa=0x0;_0x2b58fa<_0x23f28c['Messages'][_0xa505('0x40')];_0x2b58fa++){var _0x4c2ab0=_0x23f28c[_0xa505('0xcc')][_0x2b58fa][_0xa505('0xcb')];if(_0x4c2ab0){var _0x310478=path[_0xa505('0xc4')](_0x549316,_0x4c2ab0[_0xa505('0xce')]);if(fs[_0xa505('0xcf')](_0x310478)){fs['createReadStream'](_0x310478)[_0xa505('0xd0')](fs['createWriteStream'](path[_0xa505('0xc4')](_0x21a90f,_0x4c2ab0[_0xa505('0xce')])));}}}return BPromise[_0xa505('0xd1')]()['then'](function(){return new BPromise(function(_0x599576,_0x223b86){zipdir(_0x21a90f,{'saveTo':_0x4b6907},function(_0x54836d,_0xef4c63){if(_0x54836d)return _0x223b86(_0x54836d);return _0x599576(_0xef4c63);});})[_0xa505('0x28')](function(){return new BPromise(function(_0x5b3bf4,_0x5336e1){rimraf(_0x21a90f,function(_0x94a9e5){if(_0x94a9e5)_0x5336e1(_0x94a9e5);return _0x5b3bf4();});});})[_0xa505('0x28')](function(){return _0x370640[_0xa505('0xc3')](_0x4b6907,_0x2478a4,function(_0x1f9f09){if(_0x1f9f09){console[_0xa505('0xd2')]('err',_0x1f9f09);}else{fs[_0xa505('0xd3')](_0x4b6907);}});});});}else{return _0x370640[_0xa505('0x1d')](0xc8);}})[_0xa505('0x34')](handleError(_0x370640,null));}; \ No newline at end of file +var _0xedb3=['replace','isNumeric','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','intersection','includeAll','include','options','create','params','describe','FaxMessage','addMessage','ids','hasOwnProperty','FaxInteractionId','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','root','server','files','join','transcript-%d-%s.zip','Attachment','Messages','get','createReadStream','basename','log','err','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','json','undefined','limit','offset','count','set','apply','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','push','catch','index','map','FaxInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','user_has_fax_interactions','from','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xedb3,0x116));var _0x3edb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xedb3[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x3edb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3edb('0x1'));var rp=require(_0x3edb('0x2'));var moment=require(_0x3edb('0x3'));var BPromise=require(_0x3edb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3edb('0x5'));var sox=require(_0x3edb('0x6'));var csv=require(_0x3edb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3edb('0x8'));var _=require(_0x3edb('0x9'));var squel=require(_0x3edb('0xa'));var crypto=require(_0x3edb('0xb'));var jsforce=require(_0x3edb('0xc'));var deskjs=require(_0x3edb('0xd'));var toCsv=require(_0x3edb('0x7'));var querystring=require(_0x3edb('0xe'));var Papa=require(_0x3edb('0xf'));var Redis=require('ioredis');var authService=require(_0x3edb('0x10'));var qs=require(_0x3edb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3edb('0x12'));var utils=require('../../config/utils');var config=require(_0x3edb('0x13'));var licenseUtil=require(_0x3edb('0x14'));var db=require(_0x3edb('0x15'))['db'];config['redis']=_[_0x3edb('0x16')](config[_0x3edb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3edb('0x18'))(new Redis(config[_0x3edb('0x17')]));require('./faxInteraction.socket')[_0x3edb('0x19')](socket);function respondWithStatusCode(_0x3cdd74,_0x8a2b4f){_0x8a2b4f=_0x8a2b4f||0xcc;return function(_0x183679){if(_0x183679){return _0x3cdd74['sendStatus'](_0x8a2b4f);}return _0x3cdd74[_0x3edb('0x1a')](_0x8a2b4f)[_0x3edb('0x1b')]();};}function respondWithResult(_0x4e3586,_0x316fba){_0x316fba=_0x316fba||0xc8;return function(_0x38be29){if(_0x38be29){return _0x4e3586['status'](_0x316fba)[_0x3edb('0x1c')](_0x38be29);}};}function respondWithFilteredResult(_0x54843b,_0x345779){return function(_0x5c278f){if(_0x5c278f){var _0x236f83=typeof _0x345779['offset']===_0x3edb('0x1d')&&typeof _0x345779[_0x3edb('0x1e')]===_0x3edb('0x1d');var _0x30526c=_0x5c278f['count'];var _0x181038=_0x236f83?0x0:_0x345779[_0x3edb('0x1f')];var _0x8340cb=_0x236f83?_0x5c278f[_0x3edb('0x20')]:_0x345779[_0x3edb('0x1f')]+_0x345779['limit'];var _0xd2e007;if(_0x8340cb>=_0x30526c){_0x8340cb=_0x30526c;_0xd2e007=0xc8;}else{_0xd2e007=0xce;}_0x54843b[_0x3edb('0x1a')](_0xd2e007);return _0x54843b[_0x3edb('0x21')]('Content-Range',_0x181038+'-'+_0x8340cb+'/'+_0x30526c)[_0x3edb('0x1c')](_0x5c278f);}return null;};}function patchUpdates(_0x22359e){return function(_0x5eb884){try{jsonpatch[_0x3edb('0x22')](_0x5eb884,_0x22359e,!![]);}catch(_0x426e50){return BPromise['reject'](_0x426e50);}return _0x5eb884['save']();};}function saveUpdates(_0x59c200,_0x44fb05){return function(_0x4572ac){if(_0x4572ac){return _0x4572ac[_0x3edb('0x23')](_0x59c200)[_0x3edb('0x24')](function(_0x4a6b06){return _0x4a6b06;});}return null;};}function removeEntity(_0x1f921a,_0x19a83c){return function(_0x3a5f45){if(_0x3a5f45){return _0x3a5f45[_0x3edb('0x25')]()[_0x3edb('0x24')](function(){_0x1f921a[_0x3edb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c7eb,_0x27cec1){return function(_0x230b5c){if(!_0x230b5c){_0x12c7eb[_0x3edb('0x26')](0x194);}return _0x230b5c;};}function handleError(_0x59db29,_0x1558e8){_0x1558e8=_0x1558e8||0x1f4;return function(_0x2e954f){logger[_0x3edb('0x27')](_0x2e954f[_0x3edb('0x28')]);if(_0x2e954f[_0x3edb('0x29')]){delete _0x2e954f['name'];}_0x59db29[_0x3edb('0x1a')](_0x1558e8)[_0x3edb('0x2a')](_0x2e954f);};}function getInteractionUsers(_0x5672af,_0x23217b){return new BPromise(function(_0x5de229,_0x12accc){try{if(_0x23217b[_0x5672af['id']]){_0x5672af[_0x3edb('0x2b')]=_['map'](_0x23217b[_0x5672af['id']],function(_0xe5286c){return{'id':_0xe5286c['id'],'fullname':_0xe5286c[_0x3edb('0x2c')]};});}}catch(_0x4ca2a2){_0x12accc(_0x4ca2a2);}_0x5de229(_0x5672af);});}function getInteractionTags(_0x341a0c,_0x1612bb){return new BPromise(function(_0x587120,_0x4952fe){try{if(_0x341a0c[_0x3edb('0x2d')]){_0x341a0c['Tags']=[];_0x341a0c['TagIds']['split'](',')['forEach'](function(_0x2232f3){_0x341a0c[_0x3edb('0x2e')][_0x3edb('0x2f')](_0x1612bb[_0x2232f3]);});}delete _0x341a0c[_0x3edb('0x2d')];}catch(_0x54a6ca){_0x4952fe(_0x54a6ca);}_0x587120(_0x341a0c);});}function updateFaxInteraction(_0x5a5b1a,_0x44e823,_0x4404da){return new BPromise(function(_0x150f77,_0x1ffffc){return getInteractionUsers(_0x5a5b1a,_0x4404da)['then'](function(_0x4d171f){return getInteractionTags(_0x4d171f,_0x44e823);})[_0x3edb('0x24')](function(_0x1c2192){_0x150f77(_0x1c2192);})[_0x3edb('0x30')](function(_0x4d7974){_0x1ffffc(_0x4d7974);});});}exports[_0x3edb('0x31')]=function(_0x46db59,_0x1db21c){var _0x3ee11c={},_0x201445={},_0x30b2b6={'count':0x0,'rows':[]};var _0x2c8044=_[_0x3edb('0x32')](db[_0x3edb('0x33')][_0x3edb('0x34')],function(_0x345e6f){return{'name':_0x345e6f['fieldName'],'type':_0x345e6f[_0x3edb('0x35')][_0x3edb('0x36')]};});_0x201445[_0x3edb('0x37')]=_['map'](_0x2c8044,_0x3edb('0x29'));_0x201445[_0x3edb('0x38')]=_[_0x3edb('0x39')](_0x46db59['query']);_0x201445[_0x3edb('0x3a')]=_['intersection'](_0x201445['model'],_0x201445['query']);_0x3ee11c[_0x3edb('0x3b')]=_['intersection'](_0x201445[_0x3edb('0x37')],qs['fields'](_0x46db59[_0x3edb('0x38')][_0x3edb('0x3c')]));_0x3ee11c[_0x3edb('0x3b')]=_0x3ee11c[_0x3edb('0x3b')][_0x3edb('0x3d')]?_0x3ee11c[_0x3edb('0x3b')]:_0x201445['model'];if(!_0x46db59[_0x3edb('0x38')]['hasOwnProperty'](_0x3edb('0x3e'))){_0x3ee11c['limit']=qs[_0x3edb('0x1e')](_0x46db59[_0x3edb('0x38')]['limit']);_0x3ee11c[_0x3edb('0x1f')]=qs[_0x3edb('0x1f')](_0x46db59[_0x3edb('0x38')][_0x3edb('0x1f')]);}_0x3ee11c[_0x3edb('0x3f')]=qs['sort'](_0x46db59[_0x3edb('0x38')][_0x3edb('0x40')]);_0x3ee11c['where']=qs[_0x3edb('0x3a')](_[_0x3edb('0x41')](_0x46db59[_0x3edb('0x38')],_0x201445['filters']),_0x2c8044);var _0x488086=[];var _0x28d13a=squel[_0x3edb('0x42')]()[_0x3edb('0x43')]('id')['field']('name')[_0x3edb('0x43')](_0x3edb('0x44'))['from'](_0x3edb('0x45'));var _0x2b7213=squel[_0x3edb('0x42')]()[_0x3edb('0x43')](_0x3edb('0x46'))[_0x3edb('0x43')](_0x3edb('0x47'))[_0x3edb('0x43')]('ui.FaxInteractionId')['from'](_0x3edb('0x48'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x4d4537=squel[_0x3edb('0x42')]()[_0x3edb('0x49')]('fax_interactions','i')[_0x3edb('0x4a')]('cm_contacts','c',_0x3edb('0x4b'))[_0x3edb('0x4a')]('users','o',_0x3edb('0x4c'))[_0x3edb('0x4a')]('fax_accounts','a',_0x3edb('0x4d'))['left_join'](_0x3edb('0x4e'),'me',_0x3edb('0x4f'))[_0x3edb('0x4a')](_0x3edb('0x50'),'it',_0x3edb('0x51'))[_0x3edb('0x4a')](_0x3edb('0x45'),'t',_0x3edb('0x52'));var _0x4c9b06=squel[_0x3edb('0x53')]();var _0x5a0bf1=[];var _0x742aee=squel[_0x3edb('0x53')]();var _0x4964f6;if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x54')]){_0x4964f6=as[_0x3edb('0x55')](_0x46db59['query'][_0x3edb('0x54')]);var _0x5d617d=_0x4964f6[_0x3edb('0x56')];for(var _0x925e5c=0x0;_0x925e5c<_0x4964f6[_0x3edb('0x57')][_0x3edb('0x3d')];_0x925e5c++){var _0x336cb2=_0x4964f6['conditions'][_0x925e5c];var _0x5b68ba='i';var _0x1f8ca4=_['find'](_0x2c8044,[_0x3edb('0x29'),_0x336cb2[_0x3edb('0x43')]]);if(!_0x1f8ca4){switch(_0x336cb2[_0x3edb('0x43')]){case _0x3edb('0x58'):if(_0x336cb2[_0x3edb('0x59')]==0x1){_0x4d4537['having']('`'+_0x336cb2[_0x3edb('0x43')]+_0x3edb('0x5a'));}else{_0x4d4537[_0x3edb('0x5b')]('`'+_0x336cb2[_0x3edb('0x43')]+_0x3edb('0x5c'));}break;case'Contact':if(_0x336cb2[_0x3edb('0x5d')]===_0x3edb('0x5e')){if(_0x336cb2[_0x3edb('0x59')][_0x3edb('0x5f')]('\x20')[_0x3edb('0x3d')]>0x1){_0x4c9b06[_0x5d617d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3edb('0x60')](_0x336cb2[_0x3edb('0x59')]),null);}else{var _0x5dfa8c='%'+_0x336cb2[_0x3edb('0x59')]+'%';_0x4c9b06[_0x5d617d](_0x3edb('0x61'),_0x5dfa8c,_0x5dfa8c,_0x5dfa8c);}}else{_0x1f8ca4=_['find'](_0x2c8044,['name',_0x3edb('0x62')]);_0x336cb2['field']='ContactId';_0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4['type'],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x65')],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}break;case _0x3edb('0x66'):var _0x12ec8d=_0x336cb2[_0x3edb('0x59')]['split'](',')[_0x3edb('0x32')](function(_0x22159a){return Number(_0x22159a);});_0x12ec8d['forEach'](function(_0x30510e){_0x742aee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x30510e+',%');});_0x5a0bf1=_[_0x3edb('0x67')](_0x5a0bf1,_0x12ec8d);break;case _0x3edb('0x68'):if(_0x336cb2[_0x3edb('0x5d')]===_0x3edb('0x5e')){_0x4c9b06[_0x5d617d](_0x3edb('0x69'),'%'+_0x336cb2[_0x3edb('0x59')]+'%',null);}else{_0x1f8ca4=_[_0x3edb('0x6a')](_0x2c8044,[_0x3edb('0x29'),'UserId']);_0x336cb2[_0x3edb('0x43')]=_0x3edb('0x6b');_0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4[_0x3edb('0x35')],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb[_0x3edb('0x59')]['start'],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}break;case _0x3edb('0x6c'):_0x2f05cb=as[_0x3edb('0x63')]('me',null,_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb['value']['start'],_0x2f05cb[_0x3edb('0x59')]['end']);break;}}else{var _0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4['type'],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb['value']['start'],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}}}else{var _0x9d82c0=_(_0x46db59[_0x3edb('0x38')])['keys']()[_0x3edb('0x32')](function(_0x872da2){return _['some'](_0x2c8044,[_0x3edb('0x29'),_0x872da2])?_0x872da2:undefined;})[_0x3edb('0x6d')]()['value']();if(!_[_0x3edb('0x6e')](_0x9d82c0)){_0x9d82c0['forEach'](function(_0x1c1d8c){if(_0x1c1d8c===_0x3edb('0x6f')){_0x4d4537[_0x3edb('0x70')](_0x3edb('0x71'),[][_0x3edb('0x72')](_0x46db59['query'][_0x1c1d8c]));}else if(_0x1c1d8c===_0x3edb('0x73')){var _0x5f0d0f=JSON['parse'](_0x46db59['query'][_0x1c1d8c])[_0x3edb('0x74')];var _0x5e3f26=JSON['parse'](_0x46db59[_0x3edb('0x38')][_0x1c1d8c])[_0x3edb('0x75')];_0x4d4537[_0x3edb('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f0d0f,_0x5e3f26);}else{if(_0x46db59[_0x3edb('0x38')][_0x1c1d8c]===_0x3edb('0x76')){_0x4d4537['where']('i.'+_0x1c1d8c+_0x3edb('0x77'));}else{_0x4d4537[_0x3edb('0x70')]('i.'+_0x1c1d8c+_0x3edb('0x78'),_0x46db59['query'][_0x1c1d8c]);}}});}if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x79')]){if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x79')]==0x1){_0x4d4537[_0x3edb('0x5b')](_0x3edb('0x7a'));}else{_0x4d4537[_0x3edb('0x5b')](_0x3edb('0x7b'));}}if(_0x46db59[_0x3edb('0x38')]['tag']){_0x5a0bf1=_['isArray'](_0x46db59['query'][_0x3edb('0x7c')])?_0x46db59[_0x3edb('0x38')]['tag']:new Array(_0x46db59[_0x3edb('0x38')]['tag']);_0x5a0bf1[_0x3edb('0x7d')](function(_0x4269d1){_0x742aee['or'](_0x3edb('0x7e'),'%,'+_0x4269d1+',%');});}if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x7f')]){var _0x391725=_0x46db59[_0x3edb('0x38')][_0x3edb('0x7f')][_0x3edb('0x80')]('\x5c','\x5c\x5c')[_0x3edb('0x80')](/'/g,'\x27\x27');if(qs[_0x3edb('0x81')](_0x391725)){_0x4c9b06['or']('i.id\x20LIKE\x20?',_0x391725+'%')['or']('i.fax\x20LIKE\x20?',_0x391725+'%');}_0x4c9b06['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x391725+'%');}}_0x4d4537[_0x3edb('0x70')](_0x4c9b06);_0x4d4537['group'](_0x3edb('0x82'));var _0xdee7d6={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x474e28=_0x4d4537[_0x3edb('0x83')]();_0x474e28[_0x3edb('0x43')](_0x3edb('0x82'));_0x474e28[_0x3edb('0x43')](_0x3edb('0x84'),_0x3edb('0x58'));if(_0x3ee11c[_0x3edb('0x3f')]){_0x3ee11c[_0x3edb('0x3f')][_0x3edb('0x7d')](function(_0x70146a){var _0x72f972=_0x70146a[0x0]===_0x3edb('0x85')?_0x70146a[0x0]:'i.'+_0x70146a[0x0];_0x4d4537[_0x3edb('0x3f')](_0x72f972,_0x70146a[0x1]===_0x3edb('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x5a0bf1)){_0x4d4537[_0x3edb('0x5b')](_0x742aee);_0x474e28[_0x3edb('0x70')](_0x3edb('0x87'),_0x5a0bf1);}BPromise[_0x3edb('0x88')]()[_0x3edb('0x24')](function(){if(!_0x4964f6){if(_0x46db59['query'][_0x3edb('0x6f')])return;_0x474e28[_0x3edb('0x70')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4d4537[_0x3edb('0x70')](_0x3edb('0x89'));return;}if(_0x46db59['user'][_0x3edb('0x8a')]!==_0x3edb('0x8b'))return;return _0x46db59[_0x3edb('0x8c')][_0x3edb('0x8d')]({'attributes':['id'],'raw':!![]})[_0x3edb('0x24')](function(_0x516dc9){if(_[_0x3edb('0x6e')](_0x516dc9)){_0x474e28[_0x3edb('0x70')](_0x3edb('0x8e'));_0x4d4537[_0x3edb('0x70')](_0x3edb('0x8e'));}else{_0x474e28[_0x3edb('0x70')](_0x3edb('0x71'),_[_0x3edb('0x32')](_0x516dc9,'id'));_0x4d4537[_0x3edb('0x70')](_0x3edb('0x71'),_[_0x3edb('0x32')](_0x516dc9,'id'));}});})[_0x3edb('0x24')](function(){if(_0x46db59['user'][_0x3edb('0x8a')]==='agent'&&!_0x4964f6&&!_0x46db59[_0x3edb('0x38')][_0x3edb('0x6f')])return[];return db[_0x3edb('0x8f')]['query'](_0x474e28[_0x3edb('0x90')](),_0xdee7d6);})[_0x3edb('0x24')](function(_0x35c3af){_0x30b2b6[_0x3edb('0x20')]=_0x35c3af[_0x3edb('0x3d')];if(_0x30b2b6[_0x3edb('0x20')]===0x0)return[];return db[_0x3edb('0x8f')][_0x3edb('0x38')](_0x28d13a[_0x3edb('0x90')](),_0xdee7d6)[_0x3edb('0x24')](function(_0x479d01){_0x488086=_[_0x3edb('0x91')](_0x479d01,'id');_0xdee7d6=_[_0x3edb('0x92')](_0xdee7d6,{'model':db[_0x3edb('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x3c')]){_0x3ee11c[_0x3edb('0x3b')][_0x3edb('0x7d')](function(_0x6c829f){_0x4d4537[_0x3edb('0x43')]('i.'+_0x6c829f);});}else{_0x4d4537[_0x3edb('0x43')](_0x3edb('0x84'),_0x3edb('0x58'));_0x4d4537[_0x3edb('0x43')]('a.key','Account.key');_0x4d4537[_0x3edb('0x43')](_0x3edb('0x93'),_0x3edb('0x94'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x95'),_0x3edb('0x85'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x96'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x97'),_0x3edb('0x98'));_0x4d4537['field'](_0x3edb('0x99'),_0x3edb('0x9a'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x9b'),_0x3edb('0x9c'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x9d'),_0x3edb('0x9e'));_0x4d4537['field'](_0x3edb('0x9f'),_0x3edb('0xa0'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa1'),_0x3edb('0xa2'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa3'),'Owner.fullname');_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa4'),_0x3edb('0xa5'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa6'),_0x3edb('0x2d'));}if(_0x3ee11c['limit'])_0x4d4537['limit'](_0x3ee11c[_0x3edb('0x1e')]);if(_0x3ee11c[_0x3edb('0x1f')])_0x4d4537[_0x3edb('0x1f')](_0x3ee11c[_0x3edb('0x1f')]);return db[_0x3edb('0x8f')][_0x3edb('0x38')](_0x4d4537[_0x3edb('0x90')](),_0xdee7d6);})[_0x3edb('0x24')](function(_0x154da6){if(_0x154da6[_0x3edb('0x3d')]>0x0)_0x2b7213['where'](_0x3edb('0xa7'),_[_0x3edb('0x32')](_0x154da6,'id'));return db[_0x3edb('0x8f')]['query'](_0x2b7213[_0x3edb('0x90')](),_0xdee7d6)[_0x3edb('0x24')](function(_0x1b7608){var _0x30155f=_[_0x3edb('0xa8')](_0x1b7608,'FaxInteractionId');var _0x358679=[];_0x154da6[_0x3edb('0x7d')](function(_0x36890c){_0x358679['push'](updateFaxInteraction(_0x36890c,_0x488086,_0x30155f));});return BPromise['all'](_0x358679);});});})['then'](function(_0x275265){_0x30b2b6[_0x3edb('0xa9')]=_0x275265;return _0x30b2b6;})[_0x3edb('0x24')](respondWithFilteredResult(_0x1db21c,_0x3ee11c))[_0x3edb('0x30')](handleError(_0x1db21c,null));};exports['show']=function(_0x5de9b1,_0x4e531b){var _0x1678b2={'raw':![],'where':{'id':_0x5de9b1['params']['id']}},_0x24ce46={};_0x24ce46['model']=_[_0x3edb('0x39')](db[_0x3edb('0x33')]['rawAttributes']);_0x24ce46[_0x3edb('0x38')]=_[_0x3edb('0x39')](_0x5de9b1['query']);_0x24ce46['filters']=_[_0x3edb('0xaa')](_0x24ce46[_0x3edb('0x37')],_0x24ce46['query']);_0x1678b2[_0x3edb('0x3b')]=_[_0x3edb('0xaa')](_0x24ce46['model'],qs[_0x3edb('0x3c')](_0x5de9b1[_0x3edb('0x38')][_0x3edb('0x3c')]));_0x1678b2[_0x3edb('0x3b')]=_0x1678b2['attributes'][_0x3edb('0x3d')]?_0x1678b2[_0x3edb('0x3b')]:_0x24ce46[_0x3edb('0x37')];if(_0x5de9b1[_0x3edb('0x38')][_0x3edb('0xab')]){_0x1678b2[_0x3edb('0xac')]=[{'all':!![]}];}_0x1678b2=_[_0x3edb('0x92')]({},_0x1678b2,_0x5de9b1[_0x3edb('0xad')]);return db[_0x3edb('0x33')]['find'](_0x1678b2)[_0x3edb('0x24')](handleEntityNotFound(_0x4e531b,null))[_0x3edb('0x24')](respondWithResult(_0x4e531b,null))['catch'](handleError(_0x4e531b,null));};exports[_0x3edb('0xae')]=function(_0x40daf6,_0x4677ac){return db['FaxInteraction']['create'](_0x40daf6[_0x3edb('0x6c')],{})[_0x3edb('0x24')](respondWithResult(_0x4677ac,0xc9))[_0x3edb('0x30')](handleError(_0x4677ac,null));};exports['update']=function(_0x114ac4,_0x11d5a7){if(_0x114ac4[_0x3edb('0x6c')]['id']){delete _0x114ac4[_0x3edb('0x6c')]['id'];}return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x114ac4[_0x3edb('0xaf')]['id']}})['then'](handleEntityNotFound(_0x11d5a7,null))[_0x3edb('0x24')](saveUpdates(_0x114ac4[_0x3edb('0x6c')],null))[_0x3edb('0x24')](respondWithResult(_0x11d5a7,null))[_0x3edb('0x30')](handleError(_0x11d5a7,null));};exports[_0x3edb('0x25')]=function(_0x509e90,_0x86db87){return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x509e90['params']['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x86db87,null))[_0x3edb('0x24')](removeEntity(_0x86db87,null))[_0x3edb('0x30')](handleError(_0x86db87,null));};exports[_0x3edb('0xb0')]=function(_0x248f83,_0xadcdda){return db[_0x3edb('0x33')][_0x3edb('0xb0')]()['then'](respondWithResult(_0xadcdda,null))[_0x3edb('0x30')](handleError(_0xadcdda,null));};exports['addMessage']=function(_0xbcc595,_0xdc816b,_0x406718){return db[_0x3edb('0xb1')][_0x3edb('0x6a')]({'where':{'id':_0xbcc595[_0x3edb('0xaf')]['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0xdc816b,null))[_0x3edb('0x24')](function(_0x3aa6ce){if(_0x3aa6ce){return _0x3aa6ce[_0x3edb('0xb2')](_0xbcc595[_0x3edb('0x6c')][_0x3edb('0xb3')],_['omit'](_0xbcc595[_0x3edb('0x6c')],['ids','id'])||{});}})[_0x3edb('0x24')](respondWithResult(_0xdc816b,null))['catch'](handleError(_0xdc816b,null));};exports['getMessages']=function(_0x52f80b,_0x524ff2,_0x156cff){var _0x31a7eb={'raw':![],'where':{}};var _0x11ab06={};var _0x39bf7a={'count':0x0,'rows':[]};return db[_0x3edb('0x33')]['findOne']({'where':{'id':_0x52f80b[_0x3edb('0xaf')]['id']}})['then'](handleEntityNotFound(_0x524ff2,null))[_0x3edb('0x24')](function(_0x40d88d){if(_0x40d88d){_0x11ab06[_0x3edb('0x37')]=_[_0x3edb('0x39')](db[_0x3edb('0xb1')]['rawAttributes']);_0x11ab06[_0x3edb('0x38')]=_['keys'](_0x52f80b[_0x3edb('0x38')]);_0x11ab06[_0x3edb('0x3a')]=_[_0x3edb('0xaa')](_0x11ab06[_0x3edb('0x37')],_0x11ab06[_0x3edb('0x38')]);_0x31a7eb[_0x3edb('0x3b')]=_[_0x3edb('0xaa')](_0x11ab06[_0x3edb('0x37')],qs[_0x3edb('0x3c')](_0x52f80b[_0x3edb('0x38')]['fields']));_0x31a7eb['attributes']=_0x31a7eb[_0x3edb('0x3b')][_0x3edb('0x3d')]?_0x31a7eb[_0x3edb('0x3b')]:_0x11ab06[_0x3edb('0x37')];if(!_0x52f80b[_0x3edb('0x38')][_0x3edb('0xb4')]('nolimit')){_0x31a7eb[_0x3edb('0x1e')]=qs[_0x3edb('0x1e')](_0x52f80b[_0x3edb('0x38')][_0x3edb('0x1e')]);_0x31a7eb[_0x3edb('0x1f')]=qs['offset'](_0x52f80b[_0x3edb('0x38')][_0x3edb('0x1f')]);}_0x31a7eb[_0x3edb('0x3f')]=qs['sort'](_0x52f80b[_0x3edb('0x38')]['sort']);_0x31a7eb[_0x3edb('0x70')]=qs[_0x3edb('0x3a')](_['pick'](_0x52f80b[_0x3edb('0x38')],_0x11ab06[_0x3edb('0x3a')]));_0x31a7eb[_0x3edb('0x70')][_0x3edb('0xb5')]=_0x40d88d['id'];if(_0x52f80b[_0x3edb('0x38')][_0x3edb('0x7f')]){_0x31a7eb['where']=_[_0x3edb('0x92')](_0x31a7eb[_0x3edb('0x70')],{'$or':_['map'](_0x31a7eb[_0x3edb('0x3b')],function(_0x3a671b){var _0x1d6438={};_0x1d6438[_0x3a671b]={'$like':'%'+_0x52f80b[_0x3edb('0x38')][_0x3edb('0x7f')]+'%'};return _0x1d6438;})});}if(_0x52f80b['query'][_0x3edb('0x74')]){var _0x1829c6=_0x52f80b[_0x3edb('0x38')][_0x3edb('0x74')][_0x3edb('0x5f')](',');var _0x4f4e35={};_0x4f4e35[_0x1829c6[0x0]]={'$gte':moment(_0x1829c6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x31a7eb['where']=_['merge'](_0x31a7eb[_0x3edb('0x70')],_0x4f4e35);}_0x31a7eb=_['merge']({},_0x31a7eb,_0x52f80b['options']);return db[_0x3edb('0xb1')]['count']({'where':_0x31a7eb['where']})[_0x3edb('0x24')](function(_0x420d7a){_0x39bf7a[_0x3edb('0x20')]=_0x420d7a;if(_0x52f80b[_0x3edb('0x38')][_0x3edb('0xab')]){_0x31a7eb['include']=[{'all':!![]}];}return db[_0x3edb('0xb1')][_0x3edb('0xb6')](_0x31a7eb);})[_0x3edb('0x24')](function(_0x3301d1){_0x39bf7a[_0x3edb('0xa9')]=_0x3301d1;return _0x39bf7a;});}})[_0x3edb('0x24')](respondWithFilteredResult(_0x524ff2,_0x31a7eb))[_0x3edb('0x30')](handleError(_0x524ff2,null));};exports[_0x3edb('0xb7')]=function(_0x4b6c7b,_0x1f00f7,_0x594794){return db[_0x3edb('0x33')]['find']({'where':{'id':_0x4b6c7b[_0x3edb('0xaf')]['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x1f00f7,null))[_0x3edb('0x24')](function(_0x58aabe){if(_0x58aabe){return _0x58aabe[_0x3edb('0xb8')](_0x4b6c7b[_0x3edb('0x6c')][_0x3edb('0xb3')],_[_0x3edb('0xb9')](_0x4b6c7b['body'],[_0x3edb('0xb3'),'id'])||{})[_0x3edb('0xba')](function(){return db[_0x3edb('0x66')][_0x3edb('0xb6')]({'attributes':['id',_0x3edb('0x29'),_0x3edb('0x44')],'where':{'id':_0x4b6c7b[_0x3edb('0x6c')][_0x3edb('0xb3')]}});})['then'](function(_0x3f321a){socket[_0x3edb('0xbb')](_0x3edb('0xbc'),{'id':Number(_0x4b6c7b[_0x3edb('0xaf')]['id']),'tags':_0x3f321a||[]});return{'id':Number(_0x4b6c7b['params']['id']),'tags':_0x3f321a||[]};});}})['then'](respondWithResult(_0x1f00f7,null))[_0x3edb('0x30')](handleError(_0x1f00f7,null));};exports[_0x3edb('0xbd')]=function(_0x934a6d,_0x285f40,_0x35bcb9){return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x934a6d['params']['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x285f40,null))[_0x3edb('0x24')](function(_0x5e58ac){if(_0x5e58ac){return _0x5e58ac[_0x3edb('0xbd')](_0x934a6d[_0x3edb('0x38')][_0x3edb('0xb3')]);}})[_0x3edb('0x24')](respondWithStatusCode(_0x285f40,null))[_0x3edb('0x30')](handleError(_0x285f40,null));};exports[_0x3edb('0xbe')]=function(_0x5aca1f,_0x2ad2be){var _0x25bee9=moment()['unix']()['toString']();var _0x52e055=path['join'](config[_0x3edb('0xbf')],_0x3edb('0xc0'),_0x3edb('0xc1'),'tmp');var _0x30f673=path[_0x3edb('0xc2')](config[_0x3edb('0xbf')],'server',_0x3edb('0xc1'),'attachments');var _0x4a059c=path[_0x3edb('0xc2')](_0x52e055,_0x25bee9);var _0x374e9e=util['format'](_0x3edb('0xc3'),_0x5aca1f[_0x3edb('0xaf')]['id'],_0x25bee9);var _0x3e3b1e=path[_0x3edb('0xc2')](_0x52e055,_0x374e9e);var _0x14d544=[];_0x14d544['push']({'model':db[_0x3edb('0xc4')],'as':_0x3edb('0xc4'),'raw':!![]});var _0xf07994=[{'model':db[_0x3edb('0xb1')],'as':_0x3edb('0xc5'),'attributes':['id',_0x3edb('0x6c'),_0x3edb('0x73')],'include':_0x14d544}];return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x5aca1f[_0x3edb('0xaf')]['id']},'include':_0xf07994})['then'](handleEntityNotFound(_0x2ad2be,null))[_0x3edb('0x24')](function(_0x4741f2){if(_0x4741f2&&_0x4741f2[_0x3edb('0xc5')]){var _0xe99acf=_0x4741f2[_0x3edb('0xc6')]({'plain':!![]});fs['mkdirSync'](_0x4a059c);for(var _0x326711=0x0;_0x326711<_0xe99acf[_0x3edb('0xc5')][_0x3edb('0x3d')];_0x326711++){var _0x33a6ef=_0xe99acf[_0x3edb('0xc5')][_0x326711][_0x3edb('0xc4')];if(_0x33a6ef){var _0x13b8a5=path[_0x3edb('0xc2')](_0x30f673,_0x33a6ef['basename']);if(fs['existsSync'](_0x13b8a5)){fs[_0x3edb('0xc7')](_0x13b8a5)['pipe'](fs['createWriteStream'](path[_0x3edb('0xc2')](_0x4a059c,_0x33a6ef[_0x3edb('0xc8')])));}}}return BPromise[_0x3edb('0x88')]()[_0x3edb('0x24')](function(){return new BPromise(function(_0x5b2b2b,_0x11dd17){zipdir(_0x4a059c,{'saveTo':_0x3e3b1e},function(_0x22ec59,_0x479294){if(_0x22ec59)return _0x11dd17(_0x22ec59);return _0x5b2b2b(_0x479294);});})[_0x3edb('0x24')](function(){return new BPromise(function(_0x50b232,_0x581f1f){rimraf(_0x4a059c,function(_0x4dfb08){if(_0x4dfb08)_0x581f1f(_0x4dfb08);return _0x50b232();});});})[_0x3edb('0x24')](function(){return _0x2ad2be[_0x3edb('0xbe')](_0x3e3b1e,_0x374e9e,function(_0x3d92de){if(_0x3d92de){console[_0x3edb('0xc9')](_0x3edb('0xca'),_0x3d92de);}else{fs['unlinkSync'](_0x3e3b1e);}});});});}else{return _0x2ad2be[_0x3edb('0x26')](0xc8);}})[_0x3edb('0x30')](handleError(_0x2ad2be,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 2f39954..3c2d8db 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 _0xcd66=['save','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners'];(function(_0x20d9ea,_0x210281){var _0xbc19a1=function(_0xa6fe1a){while(--_0xa6fe1a){_0x20d9ea['push'](_0x20d9ea['shift']());}};_0xbc19a1(++_0x210281);}(_0xcd66,0x184));var _0x6cd6=function(_0x405b97,_0x1dbd39){_0x405b97=_0x405b97-0x0;var _0x58defa=_0xcd66[_0x405b97];return _0x58defa;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x6cd6('0x0'))['db'][_0x6cd6('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x6cd6('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6cd6('0x3')](0x0);var events={'afterCreate':_0x6cd6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x450f4b){return function(_0xfa240e,_0x12bc20,_0x1a1b38){_0xfa240e['getUsers']({'attributes':['id'],'raw':!![]})[_0x6cd6('0x5')](function(_0x5eff1a){_0xfa240e['setDataValue'](_0x6cd6('0x6'),_0x5eff1a[_0x6cd6('0x7')](function(_0x270fd5){return{'id':_0x270fd5['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xfa240e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6cd6('0x5')](function(_0x5ec1ce){_0xfa240e['setDataValue'](_0x6cd6('0x8'),_0x5ec1ce['length']);FaxInteractionEvents[_0x6cd6('0x9')](_0x450f4b+':'+_0xfa240e['id'],_0xfa240e);FaxInteractionEvents[_0x6cd6('0x9')](_0x450f4b,_0xfa240e);_0x1a1b38(null);})[_0x6cd6('0xa')](_0x1a1b38(null));};}for(var e in events){if(events[_0x6cd6('0xb')](e)){var event=events[e];FaxInteraction[_0x6cd6('0xc')](e,emitEvent(event));}}module[_0x6cd6('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xb9c5=['map','findAll','length','emit','catch','hook','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','then','setDataValue','Users'];(function(_0x481b6f,_0x5a42f8){var _0x4b4464=function(_0x5cb568){while(--_0x5cb568){_0x481b6f['push'](_0x481b6f['shift']());}};_0x4b4464(++_0x5a42f8);}(_0xb9c5,0x1a6));var _0x5b9c=function(_0x2dba04,_0x16a459){_0x2dba04=_0x2dba04-0x0;var _0x1ae645=_0xb9c5[_0x2dba04];return _0x1ae645;};'use strict';var EventEmitter=require(_0x5b9c('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x5b9c('0x1')];var FaxMessage=require(_0x5b9c('0x2'))['db'][_0x5b9c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5b9c('0x4')](0x0);var events={'afterCreate':_0x5b9c('0x5'),'afterUpdate':_0x5b9c('0x6'),'afterDestroy':'remove'};function emitEvent(_0x25abe9){return function(_0x65716b,_0x51c837,_0x30f80d){_0x65716b['getUsers']({'attributes':['id'],'raw':!![]})[_0x5b9c('0x7')](function(_0x4e0fc6){_0x65716b[_0x5b9c('0x8')](_0x5b9c('0x9'),_0x4e0fc6[_0x5b9c('0xa')](function(_0x50487f){return{'id':_0x50487f['id']};}));return FaxMessage[_0x5b9c('0xb')]({'where':{'FaxInteractionId':_0x65716b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b9c('0x7')](function(_0x58c179){_0x65716b[_0x5b9c('0x8')]('unreadMessages',_0x58c179[_0x5b9c('0xc')]);FaxInteractionEvents[_0x5b9c('0xd')](_0x25abe9+':'+_0x65716b['id'],_0x65716b);FaxInteractionEvents[_0x5b9c('0xd')](_0x25abe9,_0x65716b);_0x30f80d(null);})[_0x5b9c('0xe')](_0x30f80d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x5b9c('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f780f59..00ab9be 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 _0x3e6f=['exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./faxInteraction.attributes'];(function(_0x107e0c,_0x8eaa81){var _0x130152=function(_0x25bda5){while(--_0x25bda5){_0x107e0c['push'](_0x107e0c['shift']());}};_0x130152(++_0x8eaa81);}(_0x3e6f,0x88));var _0xf3e6=function(_0x12ce1d,_0x27dad7){_0x12ce1d=_0x12ce1d-0x0;var _0x3e987f=_0x3e6f[_0x12ce1d];return _0x3e987f;};'use strict';var _=require(_0xf3e6('0x0'));var util=require(_0xf3e6('0x1'));var logger=require(_0xf3e6('0x2'))(_0xf3e6('0x3'));var moment=require('moment');var BPromise=require(_0xf3e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3e6('0x5'));var rimraf=require('rimraf');var config=require(_0xf3e6('0x6'));var attributes=require(_0xf3e6('0x7'));module[_0xf3e6('0x8')]=function(_0x1ce632,_0x4074b2){return _0x1ce632[_0xf3e6('0x9')](_0xf3e6('0xa'),attributes,{'tableName':_0xf3e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d9c77,_0x3b85ec,_0x1f7ab5){if(_0x5d9c77[_0xf3e6('0xc')](_0xf3e6('0xd'))){_0x5d9c77[_0xf3e6('0xe')]=moment()['format'](_0xf3e6('0xf'));}_0x1f7ab5(null,_0x5d9c77);}}});}; \ No newline at end of file +var _0xd9d6=['rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xd9d6,0x19c));var _0x6d9d=function(_0x17bfae,_0x52023d){_0x17bfae=_0x17bfae-0x0;var _0x6af798=_0xd9d6[_0x17bfae];return _0x6af798;};'use strict';var _=require(_0x6d9d('0x0'));var util=require(_0x6d9d('0x1'));var logger=require('../../config/logger')(_0x6d9d('0x2'));var moment=require(_0x6d9d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d9d('0x4'));var config=require(_0x6d9d('0x5'));var attributes=require(_0x6d9d('0x6'));module[_0x6d9d('0x7')]=function(_0xaf1df,_0x154aa9){return _0xaf1df['define'](_0x6d9d('0x8'),attributes,{'tableName':_0x6d9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c6076,_0x9f6196,_0x1d85ab){if(_0x3c6076['changed'](_0x6d9d('0xa'))){_0x3c6076['closedAt']=moment()[_0x6d9d('0xb')](_0x6d9d('0xc'));}_0x1d85ab(null,_0x3c6076);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 73be83f..da1311e 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 _0x9adb=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','info','stringify','AddTagsToFaxInteraction','addTags','ids','spread','AddTags'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x9adb,0xf6));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb9ad('0x0'));var util=require(_0xb9ad('0x1'));var moment=require('moment');var BPromise=require(_0xb9ad('0x2'));var rs=require(_0xb9ad('0x3'));var fs=require('fs');var Redis=require(_0xb9ad('0x4'));var db=require(_0xb9ad('0x5'))['db'];var utils=require(_0xb9ad('0x6'));var logger=require(_0xb9ad('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb9ad('0x8'));var client=jayson[_0xb9ad('0x9')]['http']({'port':0x232a});config[_0xb9ad('0xa')]=_[_0xb9ad('0xb')](config[_0xb9ad('0xa')],{'host':_0xb9ad('0xc'),'port':0x18eb});var socket=require(_0xb9ad('0xd'))(new Redis(config['redis']));require(_0xb9ad('0xe'))[_0xb9ad('0xf')](socket);function respondWithRpcPromise(_0x3355a8,_0x30d2a0,_0x79a3fe){return new BPromise(function(_0x4785da,_0x1409f1){return client[_0xb9ad('0x10')](_0x3355a8,_0x79a3fe)[_0xb9ad('0x11')](function(_0x28558a){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x30d2a0,_0xb9ad('0x12'));logger[_0xb9ad('0x13')](_0xb9ad('0x14'),_0x30d2a0,'request\x20sent',JSON['stringify'](_0x28558a));if(_0x28558a['error']){if(_0x28558a[_0xb9ad('0x15')][_0xb9ad('0x16')]===0x1f4){logger[_0xb9ad('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x30d2a0,_0x28558a[_0xb9ad('0x15')][_0xb9ad('0x17')]);return _0x1409f1(_0x28558a[_0xb9ad('0x15')][_0xb9ad('0x17')]);}logger['error'](_0xb9ad('0x18'),_0x30d2a0,_0x28558a['error']['message']);return _0x4785da(_0x28558a[_0xb9ad('0x15')][_0xb9ad('0x17')]);}else{logger['info'](_0xb9ad('0x18'),_0x30d2a0,_0xb9ad('0x12'));_0x4785da(_0x28558a[_0xb9ad('0x19')][_0xb9ad('0x17')]);}})[_0xb9ad('0x1a')](function(_0xc03a73){logger['error'](_0xb9ad('0x18'),_0x30d2a0,_0xc03a73);_0x1409f1(_0xc03a73);});});}exports[_0xb9ad('0x1b')]=function(_0x59d5ec){var _0x52351c=this;return new Promise(function(_0x4d104a,_0x299b36){return db[_0xb9ad('0x1c')][_0xb9ad('0x1d')](_0x59d5ec[_0xb9ad('0x1e')],{'raw':_0x59d5ec[_0xb9ad('0x1f')]?_0x59d5ec[_0xb9ad('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d5ec[_0xb9ad('0x1f')]?_0x59d5ec[_0xb9ad('0x1f')][_0xb9ad('0x20')]||null:null,'attributes':_0x59d5ec[_0xb9ad('0x1f')]?_0x59d5ec['options'][_0xb9ad('0x21')]||null:null,'limit':_0x59d5ec[_0xb9ad('0x1f')]?_0x59d5ec['options']['limit']||null:null})[_0xb9ad('0x11')](function(_0x55c7c6){logger[_0xb9ad('0x22')]('UpdateFaxInteraction',_0x59d5ec);logger[_0xb9ad('0x13')](_0xb9ad('0x1b'),_0x59d5ec,JSON[_0xb9ad('0x23')](_0x55c7c6));_0x4d104a(_0x55c7c6);})[_0xb9ad('0x1a')](function(_0x5c0ec5){logger[_0xb9ad('0x15')](_0xb9ad('0x1b'),_0x5c0ec5[_0xb9ad('0x17')],_0x59d5ec);_0x299b36(_0x52351c[_0xb9ad('0x15')](0x1f4,_0x5c0ec5[_0xb9ad('0x17')]));});});};exports[_0xb9ad('0x24')]=function(_0x57d50a){return new Promise(function(_0x44266d,_0x2cd468){return db[_0xb9ad('0x1c')]['find']({'where':_0x57d50a[_0xb9ad('0x1f')]?_0x57d50a['options'][_0xb9ad('0x20')]||null:null})[_0xb9ad('0x11')](function(_0x4eb2e0){if(_0x4eb2e0){return _0x4eb2e0[_0xb9ad('0x25')](_0x57d50a['body'][_0xb9ad('0x26')],_['omit'](_0x57d50a[_0xb9ad('0x1e')],['ids','id'])||{});}})[_0xb9ad('0x27')](function(_0x29cb44){logger['info']('AddTags',_0x57d50a);logger[_0xb9ad('0x13')](_0xb9ad('0x28'),_0x57d50a,JSON[_0xb9ad('0x23')](_0x29cb44));_0x44266d(_0x29cb44);})[_0xb9ad('0x1a')](function(_0x31bd48){logger[_0xb9ad('0x15')](_0xb9ad('0x28'),_0x31bd48['message'],_0x57d50a);_0x2cd468(_this['error'](0x1f4,_0x31bd48[_0xb9ad('0x17')]));});});}; \ No newline at end of file +var _0x5b7f=['../../config/utils','rpc','../../config/environment','defaults','redis','localhost','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','debug','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3688ef,_0x57ceb4){var _0x295972=function(_0x4d879f){while(--_0x4d879f){_0x3688ef['push'](_0x3688ef['shift']());}};_0x295972(++_0x57ceb4);}(_0x5b7f,0x1bc));var _0xf5b7=function(_0x2d48f5,_0x44a989){_0x2d48f5=_0x2d48f5-0x0;var _0x21fb92=_0x5b7f[_0x2d48f5];return _0x21fb92;};'use strict';var _=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var moment=require(_0xf5b7('0x2'));var BPromise=require(_0xf5b7('0x3'));var rs=require(_0xf5b7('0x4'));var fs=require('fs');var Redis=require(_0xf5b7('0x5'));var db=require(_0xf5b7('0x6'))['db'];var utils=require(_0xf5b7('0x7'));var logger=require('../../config/logger')(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf5b7('0xa')](config[_0xf5b7('0xb')],{'host':_0xf5b7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5b7('0xb')]));require(_0xf5b7('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ec13d,_0x4c5b84,_0x2bb48c){return new BPromise(function(_0x430eca,_0x1ccddb){return client[_0xf5b7('0xe')](_0x3ec13d,_0x2bb48c)[_0xf5b7('0xf')](function(_0x15d86d){logger['info'](_0xf5b7('0x10'),_0x4c5b84,_0xf5b7('0x11'));logger['debug'](_0xf5b7('0x12'),_0x4c5b84,_0xf5b7('0x11'),JSON[_0xf5b7('0x13')](_0x15d86d));if(_0x15d86d[_0xf5b7('0x14')]){if(_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x15')]===0x1f4){logger[_0xf5b7('0x14')](_0xf5b7('0x10'),_0x4c5b84,_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x16')]);return _0x1ccddb(_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x16')]);}logger['error'](_0xf5b7('0x10'),_0x4c5b84,_0x15d86d['error']['message']);return _0x430eca(_0x15d86d['error']['message']);}else{logger[_0xf5b7('0x17')](_0xf5b7('0x10'),_0x4c5b84,_0xf5b7('0x11'));_0x430eca(_0x15d86d['result'][_0xf5b7('0x16')]);}})['catch'](function(_0x3bbaec){logger[_0xf5b7('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4c5b84,_0x3bbaec);_0x1ccddb(_0x3bbaec);});});}exports[_0xf5b7('0x18')]=function(_0x167b9d){var _0x507270=this;return new Promise(function(_0x37b50d,_0x34cdfe){return db[_0xf5b7('0x19')][_0xf5b7('0x1a')](_0x167b9d[_0xf5b7('0x1b')],{'raw':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1d')]||null:null,'attributes':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1e')]||null:null,'limit':_0x167b9d['options']?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1f')]||null:null})[_0xf5b7('0xf')](function(_0x3b4241){logger[_0xf5b7('0x17')]('UpdateFaxInteraction',_0x167b9d);logger[_0xf5b7('0x20')](_0xf5b7('0x18'),_0x167b9d,JSON['stringify'](_0x3b4241));_0x37b50d(_0x3b4241);})[_0xf5b7('0x21')](function(_0x269b4c){logger[_0xf5b7('0x14')](_0xf5b7('0x18'),_0x269b4c[_0xf5b7('0x16')],_0x167b9d);_0x34cdfe(_0x507270[_0xf5b7('0x14')](0x1f4,_0x269b4c[_0xf5b7('0x16')]));});});};exports[_0xf5b7('0x22')]=function(_0x5d054c){return new Promise(function(_0x3f060d,_0x4e676f){return db[_0xf5b7('0x19')][_0xf5b7('0x23')]({'where':_0x5d054c[_0xf5b7('0x1c')]?_0x5d054c[_0xf5b7('0x1c')][_0xf5b7('0x1d')]||null:null})[_0xf5b7('0xf')](function(_0x27250f){if(_0x27250f){return _0x27250f[_0xf5b7('0x24')](_0x5d054c[_0xf5b7('0x1b')][_0xf5b7('0x25')],_[_0xf5b7('0x26')](_0x5d054c['body'],['ids','id'])||{});}})[_0xf5b7('0x27')](function(_0x350e13){logger['info'](_0xf5b7('0x28'),_0x5d054c);logger[_0xf5b7('0x20')](_0xf5b7('0x28'),_0x5d054c,JSON[_0xf5b7('0x13')](_0x350e13));_0x3f060d(_0x350e13);})[_0xf5b7('0x21')](function(_0x48c67b){logger[_0xf5b7('0x14')](_0xf5b7('0x28'),_0x48c67b[_0xf5b7('0x16')],_0x5d054c);_0x4e676f(_this[_0xf5b7('0x14')](0x1f4,_0x48c67b[_0xf5b7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 83df69b..57eb203 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 _0xf025=['register','save','remove','update','emit'];(function(_0x119aae,_0x39cc9b){var _0x4fbe00=function(_0x13bba0){while(--_0x13bba0){_0x119aae['push'](_0x119aae['shift']());}};_0x4fbe00(++_0x39cc9b);}(_0xf025,0x1d2));var _0x5f02=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xf025[_0x4a6cf8];return _0x22205e;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5f02('0x0'),_0x5f02('0x1'),_0x5f02('0x2')];function createListener(_0x2d9651,_0x5dbe93){return function(_0x5c4967){_0x5dbe93[_0x5f02('0x3')](_0x2d9651,_0x5c4967);};}function removeListener(_0x5b3c1b,_0x53c238){return function(){FaxInteractionEvents['removeListener'](_0x5b3c1b,_0x53c238);};}exports[_0x5f02('0x4')]=function(_0x200669){for(var _0x3e72f3=0x0,_0x168c94=events['length'];_0x3e72f3<_0x168c94;_0x3e72f3++){var _0x1b04ee=events[_0x3e72f3];var _0x29836f=createListener('faxInteraction:'+_0x1b04ee,_0x200669);FaxInteractionEvents['on'](_0x1b04ee,_0x29836f);}}; \ No newline at end of file +var _0xb601=['save','removeListener','length','./faxInteraction.events'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb601,0x1b7));var _0x1b60=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0xb601[_0x41da6];return _0x282340;};'use strict';var FaxInteractionEvents=require(_0x1b60('0x0'));var events=[_0x1b60('0x1'),'remove','update'];function createListener(_0x1038e7,_0x4c72ad){return function(_0xa70bd9){_0x4c72ad['emit'](_0x1038e7,_0xa70bd9);};}function removeListener(_0x36be5b,_0x4b88d5){return function(){FaxInteractionEvents[_0x1b60('0x2')](_0x36be5b,_0x4b88d5);};}exports['register']=function(_0x197163){for(var _0x13bb48=0x0,_0x3f8213=events[_0x1b60('0x3')];_0x13bb48<_0x3f8213;_0x13bb48++){var _0x42356d=events[_0x13bb48];var _0x206385=createListener('faxInteraction:'+_0x42356d,_0x197163);FaxInteractionEvents['on'](_0x42356d,_0x206385);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9dfef1a..3a92bdc 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 _0x682b=['getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','describe','isAuthenticated','show'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x682b,0x1e4));var _0xb682=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x682b[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0xb682('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb682('0x1'));var express=require(_0xb682('0x2'));var router=express[_0xb682('0x3')]();var fs_extra=require(_0xb682('0x4'));var auth=require(_0xb682('0x5'));var interaction=require(_0xb682('0x6'));var config=require(_0xb682('0x7'));var controller=require('./faxInteraction.controller');router[_0xb682('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb682('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xb682('0x9')]);router[_0xb682('0x8')]('/:id',auth[_0xb682('0xa')](),controller[_0xb682('0xb')]);router[_0xb682('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb682('0xc')]);router[_0xb682('0x8')](_0xb682('0xd'),auth[_0xb682('0xa')](),controller[_0xb682('0xe')]);router[_0xb682('0xf')]('/',auth[_0xb682('0xa')](),controller[_0xb682('0x10')]);router[_0xb682('0xf')](_0xb682('0x11'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xb682('0x12'),auth[_0xb682('0xa')](),interaction[_0xb682('0x13')](_0xb682('0x14'),_0xb682('0x15')),controller[_0xb682('0x16')]);router[_0xb682('0x17')](_0xb682('0x18'),auth[_0xb682('0xa')](),interaction[_0xb682('0x13')](_0xb682('0x14'),_0xb682('0x19')),controller[_0xb682('0x1a')]);router['delete'](_0xb682('0x18'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xb682('0x1b')),controller['destroy']);router[_0xb682('0x1c')](_0xb682('0x12'),auth['isAuthenticated'](),controller[_0xb682('0x1d')]);module[_0xb682('0x1e')]=router; \ No newline at end of file +var _0xb721=['create','/:id/messages','/:id/tags','fax','addTags','put','tracked','faxinteraction:update','destroy','removeTags','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','getMessages','post'];(function(_0x551637,_0x3292db){var _0x633a5e=function(_0x10e63e){while(--_0x10e63e){_0x551637['push'](_0x551637['shift']());}};_0x633a5e(++_0x3292db);}(_0xb721,0x169));var _0x1b72=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0xb721[_0x11deef];return _0xe9ba85;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b72('0x0'));var express=require(_0x1b72('0x1'));var router=express[_0x1b72('0x2')]();var fs_extra=require(_0x1b72('0x3'));var auth=require(_0x1b72('0x4'));var interaction=require(_0x1b72('0x5'));var config=require(_0x1b72('0x6'));var controller=require(_0x1b72('0x7'));router[_0x1b72('0x8')]('/',auth[_0x1b72('0x9')](),controller['index']);router['get'](_0x1b72('0xa'),auth[_0x1b72('0x9')](),controller['describe']);router[_0x1b72('0x8')](_0x1b72('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1b72('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1b72('0xc')]);router['get']('/:id/download',auth[_0x1b72('0x9')](),controller['download']);router[_0x1b72('0xd')]('/',auth[_0x1b72('0x9')](),controller[_0x1b72('0xe')]);router[_0x1b72('0xd')](_0x1b72('0xf'),auth[_0x1b72('0x9')](),controller['addMessage']);router['post'](_0x1b72('0x10'),auth[_0x1b72('0x9')](),interaction['tracked'](_0x1b72('0x11'),'faxinteraction:addtags'),controller[_0x1b72('0x12')]);router[_0x1b72('0x13')](_0x1b72('0xb'),auth[_0x1b72('0x9')](),interaction[_0x1b72('0x14')](_0x1b72('0x11'),_0x1b72('0x15')),controller['update']);router['delete']('/:id',auth[_0x1b72('0x9')](),interaction[_0x1b72('0x14')](_0x1b72('0x11'),'faxinteraction:destroy'),controller[_0x1b72('0x16')]);router['delete']('/:id/tags',auth[_0x1b72('0x9')](),controller[_0x1b72('0x17')]);module[_0x1b72('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 25b2b8c..d502ea4 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 _0x68fc=['sequelize','exports','TEXT','ENUM','out'];(function(_0x19a29f,_0x35d962){var _0x3f0c7f=function(_0x58baf6){while(--_0x58baf6){_0x19a29f['push'](_0x19a29f['shift']());}};_0x3f0c7f(++_0x35d962);}(_0x68fc,0xa5));var _0xc68f=function(_0x6c4854,_0x192fbb){_0x6c4854=_0x6c4854-0x0;var _0x28220b=_0x68fc[_0x6c4854];return _0x28220b;};'use strict';var Sequelize=require(_0xc68f('0x0'));module[_0xc68f('0x1')]={'body':{'type':Sequelize[_0xc68f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc68f('0x3')]('in','out'),'defaultValue':_0xc68f('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xe630=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe630,0x149));var _0x0e63=function(_0x59e703,_0x62b160){_0x59e703=_0x59e703-0x0;var _0x5e46c3=_0xe630[_0x59e703];return _0x5e46c3;};'use strict';var Sequelize=require(_0x0e63('0x0'));module[_0x0e63('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0e63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0e63('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0e63('0x4')]('in','out'),'defaultValue':_0x0e63('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0e63('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0e63('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e1b91ae..55fb9f7 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 _0x2e03=['sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','keys','length','find','body','params','describe','../../config/logger','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','update','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','Sequelize','QueryTypes','User','fullname','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','server','attachments','download','join','eml-format','zip-dir','moment','bluebird','util','path'];(function(_0x323116,_0x5ced14){var _0x14b3ea=function(_0x197bbe){while(--_0x197bbe){_0x323116['push'](_0x323116['shift']());}};_0x14b3ea(++_0x5ced14);}(_0x2e03,0x11a));var _0x32e0=function(_0x380f72,_0x10680f){_0x380f72=_0x380f72-0x0;var _0x161e49=_0x2e03[_0x380f72];return _0x161e49;};'use strict';var emlformat=require(_0x32e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x32e0('0x2'));var BPromise=require(_0x32e0('0x3'));var Mustache=require('mustache');var util=require(_0x32e0('0x4'));var path=require(_0x32e0('0x5'));var sox=require(_0x32e0('0x6'));var csv=require(_0x32e0('0x7'));var ejs=require(_0x32e0('0x8'));var fs=require('fs');var fs_extra=require(_0x32e0('0x9'));var _=require(_0x32e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x32e0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32e0('0x7'));var querystring=require(_0x32e0('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32e0('0xd'));var qs=require(_0x32e0('0xe'));var as=require(_0x32e0('0xf'));var hardwareService=require(_0x32e0('0x10'));var logger=require('../../config/logger')(_0x32e0('0x11'));var utils=require(_0x32e0('0x12'));var config=require(_0x32e0('0x13'));var licenseUtil=require(_0x32e0('0x14'));var db=require(_0x32e0('0x15'))['db'];config[_0x32e0('0x16')]=_[_0x32e0('0x17')](config[_0x32e0('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x32e0('0x18'))(new Redis(config[_0x32e0('0x16')]));require(_0x32e0('0x19'))['register'](socket);var jayson=require(_0x32e0('0x1a'));var client=jayson[_0x32e0('0x1b')][_0x32e0('0x1c')]({'port':0x232c});var client9002=jayson[_0x32e0('0x1b')][_0x32e0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1752c1,_0x119179,_0x1fea9a,_0x1c4798){return new BPromise(function(_0x440c21,_0x41c4f9){var _0x2ac3f8=_0x1c4798||client;return _0x2ac3f8[_0x32e0('0x1d')](_0x1752c1,_0x1fea9a)[_0x32e0('0x1e')](function(_0x168ef2){logger[_0x32e0('0x1f')](_0x32e0('0x20'),_0x119179,_0x32e0('0x21'));logger[_0x32e0('0x22')](_0x32e0('0x23'),_0x119179,_0x32e0('0x21'),JSON[_0x32e0('0x24')](_0x168ef2));if(_0x168ef2['error']){if(_0x168ef2['error'][_0x32e0('0x25')]===0x1f4){logger['error'](_0x32e0('0x20'),_0x119179,_0x168ef2['error'][_0x32e0('0x26')]);return _0x41c4f9(_0x168ef2[_0x32e0('0x27')][_0x32e0('0x26')]);}logger[_0x32e0('0x27')]('FaxMessage,\x20%s,\x20%s',_0x119179,_0x168ef2[_0x32e0('0x27')][_0x32e0('0x26')]);return _0x440c21(_0x168ef2[_0x32e0('0x27')][_0x32e0('0x26')]);}else{logger[_0x32e0('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x119179,_0x32e0('0x21'));_0x440c21(_0x168ef2[_0x32e0('0x28')][_0x32e0('0x26')]);}})[_0x32e0('0x29')](function(_0x3aa64a){logger['error'](_0x32e0('0x20'),_0x119179,_0x3aa64a);_0x41c4f9(_0x3aa64a);});});}function respondWithStatusCode(_0x3f7a3e,_0x19f701){_0x19f701=_0x19f701||0xcc;return function(_0x47a6c2){if(_0x47a6c2){return _0x3f7a3e[_0x32e0('0x2a')](_0x19f701);}return _0x3f7a3e[_0x32e0('0x2b')](_0x19f701)[_0x32e0('0x2c')]();};}function respondWithResult(_0xb74044,_0xb6b68c){_0xb6b68c=_0xb6b68c||0xc8;return function(_0x597528){if(_0x597528){return _0xb74044[_0x32e0('0x2b')](_0xb6b68c)['json'](_0x597528);}};}function respondWithFilteredResult(_0x730752,_0x5c77d4){return function(_0x43bffa){if(_0x43bffa){var _0x19d286=typeof _0x5c77d4[_0x32e0('0x2d')]===_0x32e0('0x2e')&&typeof _0x5c77d4[_0x32e0('0x2f')]===_0x32e0('0x2e');var _0x4ac9ca=_0x43bffa[_0x32e0('0x30')];var _0x21e450=_0x19d286?0x0:_0x5c77d4[_0x32e0('0x2d')];var _0x504de6=_0x19d286?_0x43bffa['count']:_0x5c77d4[_0x32e0('0x2d')]+_0x5c77d4[_0x32e0('0x2f')];var _0x33921d;if(_0x504de6>=_0x4ac9ca){_0x504de6=_0x4ac9ca;_0x33921d=0xc8;}else{_0x33921d=0xce;}_0x730752['status'](_0x33921d);return _0x730752[_0x32e0('0x31')](_0x32e0('0x32'),_0x21e450+'-'+_0x504de6+'/'+_0x4ac9ca)[_0x32e0('0x33')](_0x43bffa);}return null;};}function patchUpdates(_0x19046b){return function(_0xbbe831){try{jsonpatch[_0x32e0('0x34')](_0xbbe831,_0x19046b,!![]);}catch(_0x160eee){return BPromise[_0x32e0('0x35')](_0x160eee);}return _0xbbe831['save']();};}function saveUpdates(_0x2ea85b,_0x3fa89f){return function(_0x373cea){if(_0x373cea){return _0x373cea['update'](_0x2ea85b)['then'](function(_0x1322b8){return _0x1322b8;});}return null;};}function removeEntity(_0x58ce8a,_0x4d1c78){return function(_0x3454ec){if(_0x3454ec){return _0x3454ec[_0x32e0('0x36')]()[_0x32e0('0x1e')](function(){_0x58ce8a[_0x32e0('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ce8d,_0x27ee50){return function(_0x3a4059){if(!_0x3a4059){_0x38ce8d[_0x32e0('0x2a')](0x194);}return _0x3a4059;};}function handleError(_0x118a13,_0x5cf8cf){_0x5cf8cf=_0x5cf8cf||0x1f4;return function(_0x14f7a2){logger[_0x32e0('0x27')](_0x14f7a2[_0x32e0('0x37')]);if(_0x14f7a2['name']){delete _0x14f7a2[_0x32e0('0x38')];}_0x118a13[_0x32e0('0x2b')](_0x5cf8cf)[_0x32e0('0x39')](_0x14f7a2);};}exports[_0x32e0('0x3a')]=function(_0x1d5776,_0x3d0604){var _0x2e441c={},_0x54be8b={},_0x2127cc={'count':0x0,'rows':[]};var _0x5e34d8=_['map'](db[_0x32e0('0x3b')][_0x32e0('0x3c')],function(_0x278bc4){return{'name':_0x278bc4[_0x32e0('0x3d')],'type':_0x278bc4['type'][_0x32e0('0x3e')]};});_0x54be8b[_0x32e0('0x3f')]=_[_0x32e0('0x40')](_0x5e34d8,_0x32e0('0x38'));_0x54be8b[_0x32e0('0x41')]=_['keys'](_0x1d5776[_0x32e0('0x41')]);_0x54be8b[_0x32e0('0x42')]=_[_0x32e0('0x43')](_0x54be8b[_0x32e0('0x3f')],_0x54be8b[_0x32e0('0x41')]);_0x2e441c[_0x32e0('0x44')]=_[_0x32e0('0x43')](_0x54be8b[_0x32e0('0x3f')],qs[_0x32e0('0x45')](_0x1d5776[_0x32e0('0x41')]['fields']));_0x2e441c['attributes']=_0x2e441c[_0x32e0('0x44')]['length']?_0x2e441c['attributes']:_0x54be8b[_0x32e0('0x3f')];if(!_0x1d5776[_0x32e0('0x41')][_0x32e0('0x46')](_0x32e0('0x47'))){_0x2e441c[_0x32e0('0x2f')]=qs[_0x32e0('0x2f')](_0x1d5776[_0x32e0('0x41')][_0x32e0('0x2f')]);_0x2e441c[_0x32e0('0x2d')]=qs[_0x32e0('0x2d')](_0x1d5776[_0x32e0('0x41')]['offset']);}_0x2e441c['order']=qs['sort'](_0x1d5776[_0x32e0('0x41')]['sort']);_0x2e441c[_0x32e0('0x48')]=qs[_0x32e0('0x42')](_[_0x32e0('0x49')](_0x1d5776[_0x32e0('0x41')],_0x54be8b[_0x32e0('0x42')]),_0x5e34d8);if(_0x1d5776[_0x32e0('0x41')][_0x32e0('0x4a')]){_0x2e441c[_0x32e0('0x48')]=_[_0x32e0('0x4b')](_0x2e441c[_0x32e0('0x48')],{'$or':_[_0x32e0('0x40')](_0x5e34d8,function(_0xce1f97){if(_0xce1f97[_0x32e0('0x4c')]!==_0x32e0('0x4d')){var _0x340344={};_0x340344[_0xce1f97[_0x32e0('0x38')]]={'$like':'%'+_0x1d5776[_0x32e0('0x41')][_0x32e0('0x4a')]+'%'};return _0x340344;}})});}_0x2e441c=_['merge']({},_0x2e441c,_0x1d5776[_0x32e0('0x4e')]);var _0x43e0da={'where':_0x2e441c['where']};return db[_0x32e0('0x3b')][_0x32e0('0x30')](_0x43e0da)[_0x32e0('0x1e')](function(_0x4c23b9){_0x2127cc[_0x32e0('0x30')]=_0x4c23b9;if(_0x1d5776['query'][_0x32e0('0x4f')]){_0x2e441c[_0x32e0('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x32e0('0x51')](_0x2e441c);})['then'](function(_0x7448f5){_0x2127cc['rows']=_0x7448f5;return _0x2127cc;})[_0x32e0('0x1e')](respondWithFilteredResult(_0x3d0604,_0x2e441c))[_0x32e0('0x29')](handleError(_0x3d0604,null));};exports[_0x32e0('0x52')]=function(_0x440edf,_0x3f577b){var _0x299269={'raw':!![],'where':{'id':_0x440edf['params']['id']}},_0x4ead83={};_0x4ead83['model']=_['keys'](db[_0x32e0('0x3b')][_0x32e0('0x3c')]);_0x4ead83[_0x32e0('0x41')]=_[_0x32e0('0x53')](_0x440edf[_0x32e0('0x41')]);_0x4ead83[_0x32e0('0x42')]=_['intersection'](_0x4ead83['model'],_0x4ead83[_0x32e0('0x41')]);_0x299269[_0x32e0('0x44')]=_['intersection'](_0x4ead83[_0x32e0('0x3f')],qs[_0x32e0('0x45')](_0x440edf['query'][_0x32e0('0x45')]));_0x299269['attributes']=_0x299269['attributes'][_0x32e0('0x54')]?_0x299269[_0x32e0('0x44')]:_0x4ead83[_0x32e0('0x3f')];if(_0x440edf[_0x32e0('0x41')][_0x32e0('0x4f')]){_0x299269[_0x32e0('0x50')]=[{'all':!![]}];}_0x299269=_[_0x32e0('0x4b')]({},_0x299269,_0x440edf[_0x32e0('0x4e')]);return db[_0x32e0('0x3b')][_0x32e0('0x55')](_0x299269)[_0x32e0('0x1e')](handleEntityNotFound(_0x3f577b,null))[_0x32e0('0x1e')](respondWithResult(_0x3f577b,null))[_0x32e0('0x29')](handleError(_0x3f577b,null));};exports['update']=function(_0x1b0692,_0x442f73){if(_0x1b0692[_0x32e0('0x56')]['id']){delete _0x1b0692[_0x32e0('0x56')]['id'];}return db[_0x32e0('0x3b')]['find']({'where':{'id':_0x1b0692[_0x32e0('0x57')]['id']}})[_0x32e0('0x1e')](handleEntityNotFound(_0x442f73,null))[_0x32e0('0x1e')](saveUpdates(_0x1b0692[_0x32e0('0x56')],null))[_0x32e0('0x1e')](respondWithResult(_0x442f73,null))['catch'](handleError(_0x442f73,null));};exports[_0x32e0('0x36')]=function(_0x30f1b8,_0x4fc1c8){return db[_0x32e0('0x3b')][_0x32e0('0x55')]({'where':{'id':_0x30f1b8[_0x32e0('0x57')]['id']}})[_0x32e0('0x1e')](handleEntityNotFound(_0x4fc1c8,null))[_0x32e0('0x1e')](removeEntity(_0x4fc1c8,null))['catch'](handleError(_0x4fc1c8,null));};exports[_0x32e0('0x58')]=function(_0x3999a0,_0x15cf5c){return db[_0x32e0('0x3b')][_0x32e0('0x58')]()[_0x32e0('0x1e')](respondWithResult(_0x15cf5c,null))[_0x32e0('0x29')](handleError(_0x15cf5c,null));};var interaction_log=require(_0x32e0('0x59'))('fax-interactions');exports[_0x32e0('0x5a')]=function(_0x3c946d,_0x4754a2,_0x232c2c){var _0x4803ba={'agent':{},'channel':'fax'};if(_0x3c946d[_0x32e0('0x56')]['id']){delete _0x3c946d['body']['id'];}_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5b')]=!![];_0x3c946d[_0x32e0('0x56')]['readAt']=moment()[_0x32e0('0x5c')](_0x32e0('0x5d'));_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5e')]=_0x3c946d['body'][_0x32e0('0x5e')]||_0x3c946d[_0x32e0('0x5f')]['id'];_0x4803ba[_0x32e0('0x60')]['id']=_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5e')];return db['FaxMessage'][_0x32e0('0x55')]({'where':{'id':_0x3c946d[_0x32e0('0x57')]['id'],'UserId':null}})[_0x32e0('0x1e')](handleEntityNotFound(_0x4754a2,null))['then'](saveUpdates(_0x3c946d[_0x32e0('0x56')],null))[_0x32e0('0x1e')](function(_0x54d581){if(_0x54d581){_0x4803ba[_0x32e0('0x26')]=_0x54d581[_0x32e0('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x32e0('0x55')]({'where':{'id':_0x54d581[_0x32e0('0x62')]}});}return null;})[_0x32e0('0x1e')](handleEntityNotFound(_0x4754a2,null))[_0x32e0('0x1e')](function(_0x509f7f){if(_0x509f7f){return _0x509f7f[_0x32e0('0x63')]({'UserId':_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5e')],'read1stAt':_[_0x32e0('0x64')](_0x509f7f['read1stAt'])?moment()[_0x32e0('0x5c')](_0x32e0('0x5d')):undefined});}return null;})[_0x32e0('0x1e')](function(_0x46a55c){if(_0x46a55c){_0x4803ba[_0x32e0('0x65')]=_0x46a55c[_0x32e0('0x61')]({'plain':!![]});interaction_log[_0x32e0('0x1f')](_0x32e0('0x66'),_0x3c946d[_0x32e0('0x5f')]['id'],_0x3c946d[_0x32e0('0x5f')]['name'],_0x3c946d[_0x32e0('0x5f')]['role'],_0x4803ba[_0x32e0('0x65')]['id'],_0x3c946d[_0x32e0('0x56')]?JSON['stringify'](_0x3c946d[_0x32e0('0x56')]):'null');return respondWithRpcPromise(_0x32e0('0x67'),_0x32e0('0x68'),_0x4803ba);}return null;})[_0x32e0('0x1e')](function(_0x5ddeaf){var _0x5a31ba=_0x32e0('0x69')+_0x5ddeaf['message']['ContactId'];return db[_0x32e0('0x6a')][_0x32e0('0x41')](_0x5a31ba,{'type':db['Sequelize']['QueryTypes'][_0x32e0('0x6b')],'raw':!![]})[_0x32e0('0x1e')](function(_0x548861){return _0x548861;});})['then'](function(_0x10bc36){if(_0x10bc36){_0x4803ba[_0x32e0('0x26')][_0x32e0('0x6c')]=_0x10bc36[0x0];if(!_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5e')])return;return db['User'][_0x32e0('0x55')]({'where':{'id':_0x3c946d[_0x32e0('0x56')][_0x32e0('0x5e')],'role':'agent'},'attributes':['id',_0x32e0('0x38'),'fullname',_0x32e0('0x6d'),_0x32e0('0x6e')],'raw':!![]});}return null;})[_0x32e0('0x1e')](function(_0x1cb8ba){if(!_0x1cb8ba)return null;_0x4803ba[_0x32e0('0x26')][_0x32e0('0x60')]=_0x1cb8ba;return _0x4803ba;})[_0x32e0('0x1e')](function(_0x147c30){if(_0x147c30){if(_0x3c946d[_0x32e0('0x56')][_0x32e0('0x6f')]){_0x4803ba[_0x32e0('0x26')]['interface']=util[_0x32e0('0x5c')](_0x32e0('0x70'),_0x3c946d['user'][_0x32e0('0x38')]);_0x4803ba[_0x32e0('0x26')]['channel']=_0x4803ba[_0x32e0('0x71')];_0x4803ba['message'][_0x32e0('0x72')]=_0x4803ba[_0x32e0('0x71')];_0x4803ba[_0x32e0('0x26')][_0x32e0('0x73')]=_0x32e0('0x5a');return respondWithRpcPromise(_0x32e0('0x74'),_0x32e0('0x74'),{'event':_0x32e0('0x75'),'message':_0x4803ba[_0x32e0('0x26')]},client9002)[_0x32e0('0x1e')](function(){return _0x4803ba;});}return _0x4803ba;}return null;})[_0x32e0('0x1e')](respondWithResult(_0x4754a2,null))[_0x32e0('0x29')](handleError(_0x4754a2,null));};var interaction_log=require(_0x32e0('0x59'))(_0x32e0('0x76'));exports[_0x32e0('0x35')]=function(_0x1d5951,_0x2071f7,_0x18c886){var _0x5f54ba={'agent':{},'channel':_0x32e0('0x77')};if(_0x1d5951['body']['id']){delete _0x1d5951[_0x32e0('0x56')]['id'];}_0x1d5951[_0x32e0('0x56')][_0x32e0('0x5e')]=_0x1d5951[_0x32e0('0x56')][_0x32e0('0x5e')]||_0x1d5951[_0x32e0('0x5f')]['id'];_0x5f54ba['agent']['id']=_0x1d5951[_0x32e0('0x56')][_0x32e0('0x5e')];return db['FaxMessage'][_0x32e0('0x55')]({'where':{'id':_0x1d5951[_0x32e0('0x57')]['id'],'UserId':null}})[_0x32e0('0x1e')](handleEntityNotFound(_0x2071f7,null))['then'](function(_0x42ec50){if(_0x42ec50){_0x5f54ba['message']=_0x42ec50[_0x32e0('0x61')]({'plain':!![]});return db[_0x32e0('0x78')][_0x32e0('0x55')]({'where':{'id':_0x42ec50[_0x32e0('0x62')]}});}return null;})[_0x32e0('0x1e')](handleEntityNotFound(_0x2071f7,null))[_0x32e0('0x1e')](function(_0x105019){if(_0x105019){_0x5f54ba['interaction']=_0x105019[_0x32e0('0x61')]({'plain':!![]});interaction_log[_0x32e0('0x1f')](_0x32e0('0x79'),_0x1d5951[_0x32e0('0x5f')]['id'],_0x1d5951[_0x32e0('0x5f')][_0x32e0('0x38')],_0x1d5951[_0x32e0('0x5f')][_0x32e0('0x7a')],_0x5f54ba[_0x32e0('0x65')]['id'],_0x1d5951[_0x32e0('0x56')]?JSON[_0x32e0('0x24')](_0x1d5951[_0x32e0('0x56')]):_0x32e0('0x7b'));return respondWithRpcPromise('RejectMessage',_0x32e0('0x7c'),_0x5f54ba);}return null;})[_0x32e0('0x1e')](function(_0x48014d){var _0x1215ee=_0x32e0('0x69')+_0x48014d[_0x32e0('0x26')]['ContactId'];return db[_0x32e0('0x6a')][_0x32e0('0x41')](_0x1215ee,{'type':db[_0x32e0('0x7d')][_0x32e0('0x7e')][_0x32e0('0x6b')],'raw':!![]})[_0x32e0('0x1e')](function(_0x125326){return _0x125326;});})['then'](function(_0x17e498){if(_0x17e498){_0x5f54ba[_0x32e0('0x26')]['contact']=_0x17e498[0x0];if(!_0x1d5951['body'][_0x32e0('0x5e')])return;return db[_0x32e0('0x7f')][_0x32e0('0x55')]({'where':{'id':_0x1d5951[_0x32e0('0x56')]['UserId'],'role':_0x32e0('0x60')},'attributes':['id',_0x32e0('0x38'),_0x32e0('0x80'),'email',_0x32e0('0x6e')],'raw':!![]});}return null;})['then'](function(_0x5521ba){if(!_0x5521ba)return null;_0x5f54ba[_0x32e0('0x26')]['agent']=_0x5521ba;return _0x5f54ba;})[_0x32e0('0x1e')](function(_0x31bf95){if(_0x31bf95){_0x31bf95[_0x32e0('0x26')]['interface']=util[_0x32e0('0x5c')](_0x32e0('0x70'),_0x1d5951[_0x32e0('0x5f')]['name']);_0x31bf95[_0x32e0('0x26')][_0x32e0('0x71')]=_0x5f54ba[_0x32e0('0x71')];_0x31bf95[_0x32e0('0x26')]['motionChannel']=_0x5f54ba['channel'];_0x31bf95[_0x32e0('0x26')][_0x32e0('0x73')]=_0x32e0('0x35');respondWithRpcPromise(_0x32e0('0x74'),_0x32e0('0x74'),{'event':_0x32e0('0x81'),'message':_0x31bf95[_0x32e0('0x26')]},client9002);return _0x5f54ba;}return null;})['then'](respondWithResult(_0x2071f7,null))[_0x32e0('0x29')](handleError(_0x2071f7,null));};exports[_0x32e0('0x82')]=function(_0x4dc75e,_0x5aa0a4){var _0x5c6d20;return db[_0x32e0('0x3b')]['create'](_0x4dc75e[_0x32e0('0x56')],{})[_0x32e0('0x1e')](function(_0xfd479c){_0x5c6d20=_0xfd479c;return db[_0x32e0('0x83')][_0x32e0('0x84')]({'where':{'id':_0x5c6d20[_0x32e0('0x85')]}});})[_0x32e0('0x1e')](function(_0x542ac3){if(_[_0x32e0('0x64')](_0x542ac3)){return;}else{_0x5c6d20[_0x32e0('0x77')]=_0x542ac3[_0x32e0('0x77')];return db[_0x32e0('0x86')]['findOne']({'where':{'id':_0x5c6d20[_0x32e0('0x87')]}});}})['then'](function(_0x2c4dcb){return respondWithRpcPromise('SendFax',_0x32e0('0x88'),{'FaxAccountId':_['isNil'](_0x4dc75e[_0x32e0('0x56')])?undefined:_0x4dc75e[_0x32e0('0x56')][_0x32e0('0x89')],'path':_[_0x32e0('0x64')](_0x2c4dcb)?undefined:util['format'](_0x32e0('0x8a'),_0x2c4dcb[_0x32e0('0x8b')]),'fax':_[_0x32e0('0x64')](_0x5c6d20[_0x32e0('0x77')])?undefined:_0x5c6d20[_0x32e0('0x77')],'AttachmentId':_0x5c6d20['AttachmentId']},client9002);})[_0x32e0('0x1e')](respondWithResult(_0x5aa0a4,0xc9))[_0x32e0('0x29')](handleError(_0x5aa0a4,null));};exports['download']=function(_0x3a73d3,_0x31059f){var _0x129c1c=path['join'](config['root'],_0x32e0('0x8c'),'files',_0x32e0('0x8d'));return db[_0x32e0('0x3b')]['find']({'where':{'id':_0x3a73d3[_0x32e0('0x57')]['id']},'include':[{'model':db[_0x32e0('0x86')],'as':'Attachment'}]})[_0x32e0('0x1e')](handleEntityNotFound(_0x31059f,null))[_0x32e0('0x1e')](function(_0x5a05c1){if(_0x5a05c1){return _0x31059f[_0x32e0('0x8e')](path[_0x32e0('0x8f')](_0x129c1c,_0x5a05c1[_0x32e0('0x86')][_0x32e0('0x8b')]));}})[_0x32e0('0x29')](handleError(_0x31059f,null));}; \ No newline at end of file +var _0xc177=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','FaxMessage','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','body','find','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','internal','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','interface','SIP/%s','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2ed404,_0x5d6108){var _0xd7b62f=function(_0xd25107){while(--_0xd25107){_0x2ed404['push'](_0x2ed404['shift']());}};_0xd7b62f(++_0x5d6108);}(_0xc177,0x1b5));var _0x7c17=function(_0x3c7776,_0x2c4da2){_0x3c7776=_0x3c7776-0x0;var _0x9b7072=_0xc177[_0x3c7776];return _0x9b7072;};'use strict';var emlformat=require(_0x7c17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c17('0x1'));var jsonpatch=require(_0x7c17('0x2'));var rp=require(_0x7c17('0x3'));var moment=require(_0x7c17('0x4'));var BPromise=require(_0x7c17('0x5'));var Mustache=require(_0x7c17('0x6'));var util=require(_0x7c17('0x7'));var path=require(_0x7c17('0x8'));var sox=require(_0x7c17('0x9'));var csv=require(_0x7c17('0xa'));var ejs=require(_0x7c17('0xb'));var fs=require('fs');var fs_extra=require(_0x7c17('0xc'));var _=require(_0x7c17('0xd'));var squel=require(_0x7c17('0xe'));var crypto=require(_0x7c17('0xf'));var jsforce=require(_0x7c17('0x10'));var deskjs=require(_0x7c17('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c17('0x12'));var Redis=require('ioredis');var authService=require(_0x7c17('0x13'));var qs=require(_0x7c17('0x14'));var as=require(_0x7c17('0x15'));var hardwareService=require(_0x7c17('0x16'));var logger=require('../../config/logger')(_0x7c17('0x17'));var utils=require('../../config/utils');var config=require(_0x7c17('0x18'));var licenseUtil=require(_0x7c17('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7c17('0x1a')](config[_0x7c17('0x1b')],{'host':_0x7c17('0x1c'),'port':0x18eb});var socket=require(_0x7c17('0x1d'))(new Redis(config['redis']));require(_0x7c17('0x1e'))['register'](socket);var jayson=require(_0x7c17('0x1f'));var client=jayson[_0x7c17('0x20')][_0x7c17('0x21')]({'port':0x232c});var client9002=jayson[_0x7c17('0x20')][_0x7c17('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x12f7a1,_0x4dab88,_0x57a627,_0x3ce5b7){return new BPromise(function(_0x187b0e,_0x2a7a12){var _0x159610=_0x3ce5b7||client;return _0x159610[_0x7c17('0x22')](_0x12f7a1,_0x57a627)['then'](function(_0x499cba){logger[_0x7c17('0x23')](_0x7c17('0x24'),_0x4dab88,_0x7c17('0x25'));logger[_0x7c17('0x26')](_0x7c17('0x27'),_0x4dab88,_0x7c17('0x25'),JSON[_0x7c17('0x28')](_0x499cba));if(_0x499cba[_0x7c17('0x29')]){if(_0x499cba['error'][_0x7c17('0x2a')]===0x1f4){logger['error'](_0x7c17('0x24'),_0x4dab88,_0x499cba[_0x7c17('0x29')][_0x7c17('0x2b')]);return _0x2a7a12(_0x499cba[_0x7c17('0x29')]['message']);}logger[_0x7c17('0x29')](_0x7c17('0x24'),_0x4dab88,_0x499cba[_0x7c17('0x29')]['message']);return _0x187b0e(_0x499cba[_0x7c17('0x29')][_0x7c17('0x2b')]);}else{logger['info'](_0x7c17('0x24'),_0x4dab88,_0x7c17('0x25'));_0x187b0e(_0x499cba['result'][_0x7c17('0x2b')]);}})['catch'](function(_0x19418f){logger[_0x7c17('0x29')]('FaxMessage,\x20%s,\x20%s',_0x4dab88,_0x19418f);_0x2a7a12(_0x19418f);});});}function respondWithStatusCode(_0x3b4c18,_0x1d3292){_0x1d3292=_0x1d3292||0xcc;return function(_0x376062){if(_0x376062){return _0x3b4c18[_0x7c17('0x2c')](_0x1d3292);}return _0x3b4c18[_0x7c17('0x2d')](_0x1d3292)['end']();};}function respondWithResult(_0x13d336,_0x2cc1ed){_0x2cc1ed=_0x2cc1ed||0xc8;return function(_0x2c0958){if(_0x2c0958){return _0x13d336[_0x7c17('0x2d')](_0x2cc1ed)[_0x7c17('0x2e')](_0x2c0958);}};}function respondWithFilteredResult(_0x4a8b8e,_0x4439f1){return function(_0x23110a){if(_0x23110a){var _0x251757=typeof _0x4439f1[_0x7c17('0x2f')]===_0x7c17('0x30')&&typeof _0x4439f1[_0x7c17('0x31')]===_0x7c17('0x30');var _0x55aef0=_0x23110a['count'];var _0x3b1c65=_0x251757?0x0:_0x4439f1[_0x7c17('0x2f')];var _0x8a9410=_0x251757?_0x23110a[_0x7c17('0x32')]:_0x4439f1['offset']+_0x4439f1[_0x7c17('0x31')];var _0x547286;if(_0x8a9410>=_0x55aef0){_0x8a9410=_0x55aef0;_0x547286=0xc8;}else{_0x547286=0xce;}_0x4a8b8e[_0x7c17('0x2d')](_0x547286);return _0x4a8b8e[_0x7c17('0x33')]('Content-Range',_0x3b1c65+'-'+_0x8a9410+'/'+_0x55aef0)['json'](_0x23110a);}return null;};}function patchUpdates(_0x2380ce){return function(_0x19b88c){try{jsonpatch[_0x7c17('0x34')](_0x19b88c,_0x2380ce,!![]);}catch(_0x675259){return BPromise[_0x7c17('0x35')](_0x675259);}return _0x19b88c[_0x7c17('0x36')]();};}function saveUpdates(_0x7a5732,_0x5e2c88){return function(_0x42d785){if(_0x42d785){return _0x42d785[_0x7c17('0x37')](_0x7a5732)['then'](function(_0x1e2aea){return _0x1e2aea;});}return null;};}function removeEntity(_0x29fb89,_0x18b116){return function(_0x1c2ae4){if(_0x1c2ae4){return _0x1c2ae4[_0x7c17('0x38')]()[_0x7c17('0x39')](function(){_0x29fb89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7286,_0x251454){return function(_0x5df12d){if(!_0x5df12d){_0x5d7286[_0x7c17('0x2c')](0x194);}return _0x5df12d;};}function handleError(_0x27f0e5,_0xad2077){_0xad2077=_0xad2077||0x1f4;return function(_0xdc03af){logger['error'](_0xdc03af[_0x7c17('0x3a')]);if(_0xdc03af[_0x7c17('0x3b')]){delete _0xdc03af['name'];}_0x27f0e5['status'](_0xad2077)[_0x7c17('0x3c')](_0xdc03af);};}exports[_0x7c17('0x3d')]=function(_0x73d6c7,_0xf5910c){var _0x9df87e={},_0x4d6a1f={},_0x1fcd2c={'count':0x0,'rows':[]};var _0x4a22ac=_['map'](db[_0x7c17('0x3e')]['rawAttributes'],function(_0x232790){return{'name':_0x232790[_0x7c17('0x3f')],'type':_0x232790[_0x7c17('0x40')]['key']};});_0x4d6a1f['model']=_['map'](_0x4a22ac,_0x7c17('0x3b'));_0x4d6a1f[_0x7c17('0x41')]=_[_0x7c17('0x42')](_0x73d6c7[_0x7c17('0x41')]);_0x4d6a1f[_0x7c17('0x43')]=_[_0x7c17('0x44')](_0x4d6a1f[_0x7c17('0x45')],_0x4d6a1f[_0x7c17('0x41')]);_0x9df87e[_0x7c17('0x46')]=_[_0x7c17('0x44')](_0x4d6a1f[_0x7c17('0x45')],qs[_0x7c17('0x47')](_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x47')]));_0x9df87e['attributes']=_0x9df87e['attributes'][_0x7c17('0x48')]?_0x9df87e[_0x7c17('0x46')]:_0x4d6a1f['model'];if(!_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x49')](_0x7c17('0x4a'))){_0x9df87e[_0x7c17('0x31')]=qs[_0x7c17('0x31')](_0x73d6c7['query'][_0x7c17('0x31')]);_0x9df87e[_0x7c17('0x2f')]=qs[_0x7c17('0x2f')](_0x73d6c7['query'][_0x7c17('0x2f')]);}_0x9df87e[_0x7c17('0x4b')]=qs['sort'](_0x73d6c7[_0x7c17('0x41')]['sort']);_0x9df87e['where']=qs[_0x7c17('0x43')](_[_0x7c17('0x4c')](_0x73d6c7[_0x7c17('0x41')],_0x4d6a1f[_0x7c17('0x43')]),_0x4a22ac);if(_0x73d6c7[_0x7c17('0x41')]['filter']){_0x9df87e[_0x7c17('0x4d')]=_[_0x7c17('0x4e')](_0x9df87e[_0x7c17('0x4d')],{'$or':_['map'](_0x4a22ac,function(_0x219621){if(_0x219621[_0x7c17('0x40')]!=='VIRTUAL'){var _0xf0d2bb={};_0xf0d2bb[_0x219621['name']]={'$like':'%'+_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x4f')]+'%'};return _0xf0d2bb;}})});}_0x9df87e=_[_0x7c17('0x4e')]({},_0x9df87e,_0x73d6c7[_0x7c17('0x50')]);var _0x5bb1a1={'where':_0x9df87e['where']};return db[_0x7c17('0x3e')][_0x7c17('0x32')](_0x5bb1a1)[_0x7c17('0x39')](function(_0x5d1fb5){_0x1fcd2c[_0x7c17('0x32')]=_0x5d1fb5;if(_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x51')]){_0x9df87e[_0x7c17('0x52')]=[{'all':!![]}];}return db[_0x7c17('0x3e')]['findAll'](_0x9df87e);})[_0x7c17('0x39')](function(_0x2356fb){_0x1fcd2c[_0x7c17('0x53')]=_0x2356fb;return _0x1fcd2c;})[_0x7c17('0x39')](respondWithFilteredResult(_0xf5910c,_0x9df87e))[_0x7c17('0x54')](handleError(_0xf5910c,null));};exports[_0x7c17('0x55')]=function(_0x4a70a3,_0x394fed){var _0x1fd2e8={'raw':!![],'where':{'id':_0x4a70a3[_0x7c17('0x56')]['id']}},_0x3dddfd={};_0x3dddfd[_0x7c17('0x45')]=_[_0x7c17('0x42')](db['FaxMessage'][_0x7c17('0x57')]);_0x3dddfd['query']=_[_0x7c17('0x42')](_0x4a70a3[_0x7c17('0x41')]);_0x3dddfd[_0x7c17('0x43')]=_['intersection'](_0x3dddfd[_0x7c17('0x45')],_0x3dddfd['query']);_0x1fd2e8[_0x7c17('0x46')]=_[_0x7c17('0x44')](_0x3dddfd[_0x7c17('0x45')],qs[_0x7c17('0x47')](_0x4a70a3[_0x7c17('0x41')][_0x7c17('0x47')]));_0x1fd2e8['attributes']=_0x1fd2e8[_0x7c17('0x46')]['length']?_0x1fd2e8[_0x7c17('0x46')]:_0x3dddfd[_0x7c17('0x45')];if(_0x4a70a3[_0x7c17('0x41')][_0x7c17('0x51')]){_0x1fd2e8['include']=[{'all':!![]}];}_0x1fd2e8=_[_0x7c17('0x4e')]({},_0x1fd2e8,_0x4a70a3[_0x7c17('0x50')]);return db['FaxMessage']['find'](_0x1fd2e8)[_0x7c17('0x39')](handleEntityNotFound(_0x394fed,null))[_0x7c17('0x39')](respondWithResult(_0x394fed,null))[_0x7c17('0x54')](handleError(_0x394fed,null));};exports['update']=function(_0x4c928f,_0x16be9c){if(_0x4c928f[_0x7c17('0x58')]['id']){delete _0x4c928f[_0x7c17('0x58')]['id'];}return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0x4c928f[_0x7c17('0x56')]['id']}})[_0x7c17('0x39')](handleEntityNotFound(_0x16be9c,null))[_0x7c17('0x39')](saveUpdates(_0x4c928f[_0x7c17('0x58')],null))[_0x7c17('0x39')](respondWithResult(_0x16be9c,null))[_0x7c17('0x54')](handleError(_0x16be9c,null));};exports[_0x7c17('0x38')]=function(_0xf6c2c1,_0x4c08cd){return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0xf6c2c1[_0x7c17('0x56')]['id']}})[_0x7c17('0x39')](handleEntityNotFound(_0x4c08cd,null))[_0x7c17('0x39')](removeEntity(_0x4c08cd,null))[_0x7c17('0x54')](handleError(_0x4c08cd,null));};exports[_0x7c17('0x5a')]=function(_0x326c71,_0x299418){return db[_0x7c17('0x3e')][_0x7c17('0x5a')]()[_0x7c17('0x39')](respondWithResult(_0x299418,null))[_0x7c17('0x54')](handleError(_0x299418,null));};var interaction_log=require(_0x7c17('0x5b'))(_0x7c17('0x5c'));exports[_0x7c17('0x5d')]=function(_0x11e3c7,_0x2d76be,_0x1bead3){var _0x158845={'agent':{},'channel':_0x7c17('0x5e')};if(_0x11e3c7['body']['id']){delete _0x11e3c7[_0x7c17('0x58')]['id'];}_0x11e3c7['body'][_0x7c17('0x5f')]=!![];_0x11e3c7['body'][_0x7c17('0x60')]=moment()[_0x7c17('0x61')](_0x7c17('0x62'));_0x11e3c7['body'][_0x7c17('0x63')]=_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')]||_0x11e3c7[_0x7c17('0x64')]['id'];_0x158845['agent']['id']=_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')];return db['FaxMessage']['find']({'where':{'id':_0x11e3c7[_0x7c17('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d76be,null))[_0x7c17('0x39')](saveUpdates(_0x11e3c7[_0x7c17('0x58')],null))[_0x7c17('0x39')](function(_0x445f1b){if(_0x445f1b){_0x158845[_0x7c17('0x2b')]=_0x445f1b['get']({'plain':!![]});return db[_0x7c17('0x65')][_0x7c17('0x59')]({'where':{'id':_0x445f1b[_0x7c17('0x66')]}});}return null;})[_0x7c17('0x39')](handleEntityNotFound(_0x2d76be,null))[_0x7c17('0x39')](function(_0x31be62){if(_0x31be62){return _0x31be62[_0x7c17('0x37')]({'UserId':_0x11e3c7[_0x7c17('0x58')]['UserId'],'read1stAt':_[_0x7c17('0x67')](_0x31be62[_0x7c17('0x68')])?moment()[_0x7c17('0x61')](_0x7c17('0x62')):undefined});}return null;})[_0x7c17('0x39')](function(_0xecd990){if(_0xecd990){_0x158845[_0x7c17('0x69')]=_0xecd990[_0x7c17('0x6a')]({'plain':!![]});interaction_log['info'](_0x7c17('0x6b'),_0x11e3c7[_0x7c17('0x64')]['id'],_0x11e3c7[_0x7c17('0x64')][_0x7c17('0x3b')],_0x11e3c7[_0x7c17('0x64')]['role'],_0x158845[_0x7c17('0x69')]['id'],_0x11e3c7['body']?JSON['stringify'](_0x11e3c7[_0x7c17('0x58')]):_0x7c17('0x6c'));return respondWithRpcPromise(_0x7c17('0x6d'),'acceptMessage',_0x158845);}return null;})['then'](function(_0x2aef9a){var _0x2c5ec8=_0x7c17('0x6e')+_0x2aef9a['message'][_0x7c17('0x6f')];return db[_0x7c17('0x70')][_0x7c17('0x41')](_0x2c5ec8,{'type':db[_0x7c17('0x71')]['QueryTypes'][_0x7c17('0x72')],'raw':!![]})[_0x7c17('0x39')](function(_0x28dbe5){return _0x28dbe5;});})[_0x7c17('0x39')](function(_0x31c304){if(_0x31c304){_0x158845[_0x7c17('0x2b')][_0x7c17('0x73')]=_0x31c304[0x0];if(!_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')])return;return db[_0x7c17('0x74')]['find']({'where':{'id':_0x11e3c7['body'][_0x7c17('0x63')],'role':_0x7c17('0x75')},'attributes':['id',_0x7c17('0x3b'),'fullname','email',_0x7c17('0x76')],'raw':!![]});}return null;})[_0x7c17('0x39')](function(_0x51f2ee){if(!_0x51f2ee)return null;_0x158845[_0x7c17('0x2b')][_0x7c17('0x75')]=_0x51f2ee;return _0x158845;})['then'](function(_0x293b35){if(_0x293b35){if(_0x11e3c7['body']['manual']){_0x158845[_0x7c17('0x2b')]['interface']=util[_0x7c17('0x61')]('SIP/%s',_0x11e3c7[_0x7c17('0x64')][_0x7c17('0x3b')]);_0x158845[_0x7c17('0x2b')]['channel']=_0x158845[_0x7c17('0x77')];_0x158845[_0x7c17('0x2b')]['motionChannel']=_0x158845[_0x7c17('0x77')];_0x158845[_0x7c17('0x2b')][_0x7c17('0x78')]=_0x7c17('0x5d');return respondWithRpcPromise(_0x7c17('0x79'),_0x7c17('0x79'),{'event':_0x7c17('0x7a'),'message':_0x158845[_0x7c17('0x2b')]},client9002)[_0x7c17('0x39')](function(){return _0x158845;});}return _0x158845;}return null;})[_0x7c17('0x39')](respondWithResult(_0x2d76be,null))[_0x7c17('0x54')](handleError(_0x2d76be,null));};var interaction_log=require(_0x7c17('0x5b'))('fax-interactions');exports['reject']=function(_0x455d7d,_0x4f92cf,_0x22aa8e){var _0x52af33={'agent':{},'channel':_0x7c17('0x5e')};if(_0x455d7d[_0x7c17('0x58')]['id']){delete _0x455d7d[_0x7c17('0x58')]['id'];}_0x455d7d['body'][_0x7c17('0x63')]=_0x455d7d[_0x7c17('0x58')][_0x7c17('0x63')]||_0x455d7d[_0x7c17('0x64')]['id'];_0x52af33[_0x7c17('0x75')]['id']=_0x455d7d[_0x7c17('0x58')]['UserId'];return db['FaxMessage'][_0x7c17('0x59')]({'where':{'id':_0x455d7d[_0x7c17('0x56')]['id'],'UserId':null}})[_0x7c17('0x39')](handleEntityNotFound(_0x4f92cf,null))[_0x7c17('0x39')](function(_0x34bd3b){if(_0x34bd3b){_0x52af33[_0x7c17('0x2b')]=_0x34bd3b[_0x7c17('0x6a')]({'plain':!![]});return db[_0x7c17('0x65')]['find']({'where':{'id':_0x34bd3b[_0x7c17('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4f92cf,null))['then'](function(_0x528394){if(_0x528394){_0x52af33[_0x7c17('0x69')]=_0x528394[_0x7c17('0x6a')]({'plain':!![]});interaction_log[_0x7c17('0x23')](_0x7c17('0x7b'),_0x455d7d[_0x7c17('0x64')]['id'],_0x455d7d[_0x7c17('0x64')][_0x7c17('0x3b')],_0x455d7d[_0x7c17('0x64')][_0x7c17('0x7c')],_0x52af33['interaction']['id'],_0x455d7d[_0x7c17('0x58')]?JSON[_0x7c17('0x28')](_0x455d7d['body']):_0x7c17('0x6c'));return respondWithRpcPromise(_0x7c17('0x7d'),_0x7c17('0x7e'),_0x52af33);}return null;})[_0x7c17('0x39')](function(_0x1fe2e5){var _0x41254e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1fe2e5[_0x7c17('0x2b')][_0x7c17('0x6f')];return db[_0x7c17('0x70')][_0x7c17('0x41')](_0x41254e,{'type':db['Sequelize'][_0x7c17('0x7f')]['SELECT'],'raw':!![]})[_0x7c17('0x39')](function(_0x268315){return _0x268315;});})[_0x7c17('0x39')](function(_0x36af45){if(_0x36af45){_0x52af33[_0x7c17('0x2b')]['contact']=_0x36af45[0x0];if(!_0x455d7d['body'][_0x7c17('0x63')])return;return db[_0x7c17('0x74')][_0x7c17('0x59')]({'where':{'id':_0x455d7d[_0x7c17('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x7c17('0x3b'),'fullname','email',_0x7c17('0x76')],'raw':!![]});}return null;})[_0x7c17('0x39')](function(_0x20c394){if(!_0x20c394)return null;_0x52af33[_0x7c17('0x2b')][_0x7c17('0x75')]=_0x20c394;return _0x52af33;})[_0x7c17('0x39')](function(_0x4b353c){if(_0x4b353c){_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x80')]=util[_0x7c17('0x61')](_0x7c17('0x81'),_0x455d7d[_0x7c17('0x64')][_0x7c17('0x3b')]);_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x77')]=_0x52af33[_0x7c17('0x77')];_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x82')]=_0x52af33[_0x7c17('0x77')];_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x78')]=_0x7c17('0x35');respondWithRpcPromise(_0x7c17('0x79'),_0x7c17('0x79'),{'event':_0x7c17('0x83'),'message':_0x4b353c['message']},client9002);return _0x52af33;}return null;})[_0x7c17('0x39')](respondWithResult(_0x4f92cf,null))[_0x7c17('0x54')](handleError(_0x4f92cf,null));};exports[_0x7c17('0x84')]=function(_0xd09968,_0x29ea47){var _0x106af6;return db[_0x7c17('0x3e')][_0x7c17('0x84')](_0xd09968[_0x7c17('0x58')],{})[_0x7c17('0x39')](function(_0x15e6b0){_0x106af6=_0x15e6b0;return db[_0x7c17('0x85')][_0x7c17('0x86')]({'where':{'id':_0x106af6[_0x7c17('0x6f')]}});})[_0x7c17('0x39')](function(_0x509ff4){if(_[_0x7c17('0x67')](_0x509ff4)){return;}else{_0x106af6['fax']=_0x509ff4[_0x7c17('0x5e')];return db[_0x7c17('0x87')][_0x7c17('0x86')]({'where':{'id':_0x106af6[_0x7c17('0x88')]}});}})[_0x7c17('0x39')](function(_0x4353b5){return respondWithRpcPromise(_0x7c17('0x89'),_0x7c17('0x89'),{'FaxAccountId':_['isNil'](_0xd09968[_0x7c17('0x58')])?undefined:_0xd09968['body'][_0x7c17('0x8a')],'path':_[_0x7c17('0x67')](_0x4353b5)?undefined:util['format'](_0x7c17('0x8b'),_0x4353b5['basename']),'fax':_[_0x7c17('0x67')](_0x106af6['fax'])?undefined:_0x106af6[_0x7c17('0x5e')],'AttachmentId':_0x106af6[_0x7c17('0x88')]},client9002);})[_0x7c17('0x39')](respondWithResult(_0x29ea47,0xc9))[_0x7c17('0x54')](handleError(_0x29ea47,null));};exports[_0x7c17('0x8c')]=function(_0x44c828,_0x1fb62b){var _0x2cd87b=path[_0x7c17('0x8d')](config[_0x7c17('0x8e')],_0x7c17('0x8f'),_0x7c17('0x90'),_0x7c17('0x91'));return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0x44c828[_0x7c17('0x56')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x7c17('0x39')](handleEntityNotFound(_0x1fb62b,null))[_0x7c17('0x39')](function(_0x2732d7){if(_0x2732d7){return _0x1fb62b[_0x7c17('0x8c')](path[_0x7c17('0x8d')](_0x2cd87b,_0x2732d7[_0x7c17('0x87')][_0x7c17('0x92')]));}})[_0x7c17('0x54')](handleError(_0x1fb62b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f770b43..2f18d50 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 _0xacd6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xacd6,0xef));var _0x6acd=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xacd6[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x6acd('0x0'));var FaxMessage=require(_0x6acd('0x1'))['db'][_0x6acd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6acd('0x3')](0x0);var events={'afterCreate':_0x6acd('0x4'),'afterUpdate':_0x6acd('0x5'),'afterDestroy':_0x6acd('0x6')};function emitEvent(_0x1c354f){return function(_0xac184f,_0x34bae2,_0x33c0cb){FaxMessageEvents[_0x6acd('0x7')](_0x1c354f+':'+_0xac184f['id'],_0xac184f);FaxMessageEvents['emit'](_0x1c354f,_0xac184f);_0x33c0cb(null);};}for(var e in events){if(events[_0x6acd('0x8')](e)){var event=events[e];FaxMessage[_0x6acd('0x9')](e,emitEvent(event));}}module[_0x6acd('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x77a9=['hasOwnProperty','events','FaxMessage','save','update','remove','emit'];(function(_0x10b474,_0x3edb89){var _0x22e3e3=function(_0x18af4f){while(--_0x18af4f){_0x10b474['push'](_0x10b474['shift']());}};_0x22e3e3(++_0x3edb89);}(_0x77a9,0x19e));var _0x977a=function(_0x3a7cac,_0x1db945){_0x3a7cac=_0x3a7cac-0x0;var _0x32ca4e=_0x77a9[_0x3a7cac];return _0x32ca4e;};'use strict';var EventEmitter=require(_0x977a('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x977a('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x977a('0x2'),'afterUpdate':_0x977a('0x3'),'afterDestroy':_0x977a('0x4')};function emitEvent(_0x368664){return function(_0x520cd7,_0x318fc8,_0xb755){FaxMessageEvents[_0x977a('0x5')](_0x368664+':'+_0x520cd7['id'],_0x520cd7);FaxMessageEvents[_0x977a('0x5')](_0x368664,_0x520cd7);_0xb755(null);};}for(var e in events){if(events[_0x977a('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index eb916e6..f9c34ad 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 _0x7b21=['fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','fax_messages'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x7b21,0x1b9));var _0x17b2=function(_0x1a56c4,_0x26e5c6){_0x1a56c4=_0x1a56c4-0x0;var _0x8c1742=_0x7b21[_0x1a56c4];return _0x8c1742;};'use strict';var _=require(_0x17b2('0x0'));var util=require('util');var logger=require(_0x17b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x17b2('0x2'));var rp=require(_0x17b2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17b2('0x4'));var config=require(_0x17b2('0x5'));var attributes=require('./faxMessage.attributes');module[_0x17b2('0x6')]=function(_0x3ab3fd,_0x47140a){return _0x3ab3fd[_0x17b2('0x7')]('FaxMessage',attributes,{'tableName':_0x17b2('0x8'),'paranoid':![],'indexes':[{'name':_0x17b2('0x9'),'fields':[_0x17b2('0xa')],'type':_0x17b2('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2aeb55,_0x3e84b9,_0x3b944f){var _0x5e8d7c=_0x3ab3fd[_0x17b2('0xc')];var _0x2055dc=_0x2aeb55[_0x17b2('0xd')]({'plain':!![]});if(_0x2055dc['direction'][_0x17b2('0xe')]()==='in'||_0x2055dc[_0x17b2('0xf')][_0x17b2('0xe')]()===_0x17b2('0x10')&&!_0x2055dc[_0x17b2('0x11')]&&!_[_0x17b2('0x12')](_0x2055dc[_0x17b2('0x13')])){_0x5e8d7c[_0x17b2('0x14')][_0x17b2('0x15')]({'where':{'id':_0x2055dc[_0x17b2('0x16')]}})[_0x17b2('0x17')](function(_0x264aae){if(_0x264aae){_0x264aae[_0x17b2('0x18')]({'lastMsgAt':_0x2055dc[_0x17b2('0x19')],'lastMsgDirection':_0x2055dc['direction'][_0x17b2('0xe')]()});}})[_0x17b2('0x1a')](function(_0x1b6e7c){console[_0x17b2('0x1b')](_0x1b6e7c);});}_0x3b944f();}},'charset':_0x17b2('0x1c'),'collate':_0x17b2('0x1d')});}; \ No newline at end of file +var _0xb945=['out','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','get','direction','toLowerCase'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb945,0x19a));var _0x5b94=function(_0x58ff4c,_0x320115){_0x58ff4c=_0x58ff4c-0x0;var _0x2a49df=_0xb945[_0x58ff4c];return _0x2a49df;};'use strict';var _=require('lodash');var util=require(_0x5b94('0x0'));var logger=require(_0x5b94('0x1'))(_0x5b94('0x2'));var moment=require(_0x5b94('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b94('0x4'));var fs=require('fs');var path=require(_0x5b94('0x5'));var rimraf=require('rimraf');var config=require(_0x5b94('0x6'));var attributes=require(_0x5b94('0x7'));module['exports']=function(_0x4d3faf,_0x348cb0){return _0x4d3faf[_0x5b94('0x8')]('FaxMessage',attributes,{'tableName':_0x5b94('0x9'),'paranoid':![],'indexes':[{'name':_0x5b94('0xa'),'fields':[_0x5b94('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46dbda,_0x36e3a5,_0x4552bf){var _0xa32a4e=_0x4d3faf['models'];var _0x2c6779=_0x46dbda[_0x5b94('0xc')]({'plain':!![]});if(_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()==='in'||_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()===_0x5b94('0xf')&&!_0x2c6779['secret']&&!_[_0x5b94('0x10')](_0x2c6779['UserId'])){_0xa32a4e[_0x5b94('0x11')]['findOne']({'where':{'id':_0x2c6779[_0x5b94('0x12')]}})[_0x5b94('0x13')](function(_0x42559c){if(_0x42559c){_0x42559c[_0x5b94('0x14')]({'lastMsgAt':_0x2c6779[_0x5b94('0x15')],'lastMsgDirection':_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()});}})[_0x5b94('0x16')](function(_0x1bd2d8){console[_0x5b94('0x17')](_0x1bd2d8);});}_0x4552bf();}},'charset':_0x5b94('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 8357be9..589d43e 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 _0x9a19=['http','redis','socket.io-emitter','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','update','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x8b1a5e,_0x2744eb){var _0x1146b1=function(_0x5a9f50){while(--_0x5a9f50){_0x8b1a5e['push'](_0x8b1a5e['shift']());}};_0x1146b1(++_0x2744eb);}(_0x9a19,0x114));var _0x99a1=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x9a19[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});config[_0x99a1('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x99a1('0xe'))(new Redis(config[_0x99a1('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4696f6,_0xd7b568,_0x23db53){return new BPromise(function(_0x26473f,_0x1551a1){return client['request'](_0x4696f6,_0x23db53)[_0x99a1('0xf')](function(_0xdd29e1){logger[_0x99a1('0x10')](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));logger[_0x99a1('0x13')](_0x99a1('0x14'),_0xd7b568,_0x99a1('0x12'),JSON[_0x99a1('0x15')](_0xdd29e1));if(_0xdd29e1[_0x99a1('0x16')]){if(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x17')]===0x1f4){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')]['message']);return _0x1551a1(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);}logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);return _0x26473f(_0xdd29e1[_0x99a1('0x16')]['message']);}else{logger['info'](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));_0x26473f(_0xdd29e1[_0x99a1('0x19')][_0x99a1('0x18')]);}})[_0x99a1('0x1a')](function(_0x209021){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0x209021);_0x1551a1(_0x209021);});});}exports[_0x99a1('0x1b')]=function(_0x2d8cac){var _0x3c23c0=this;return new Promise(function(_0x5eabcb,_0x3023a1){return db[_0x99a1('0x1c')]['create'](_0x2d8cac[_0x99a1('0x1d')],{'raw':_0x2d8cac['options']?_0x2d8cac[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![]})[_0x99a1('0xf')](function(_0x2d3b82){logger['info'](_0x99a1('0x1b'),_0x2d8cac);logger[_0x99a1('0x13')]('CreateFaxMessage',_0x2d8cac,JSON[_0x99a1('0x15')](_0x2d3b82));_0x5eabcb(_0x2d3b82);})['catch'](function(_0x1f9800){logger[_0x99a1('0x16')](_0x99a1('0x1b'),_0x1f9800[_0x99a1('0x18')],_0x2d8cac);_0x3023a1(_0x3c23c0[_0x99a1('0x16')](0x1f4,_0x1f9800[_0x99a1('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x114b38){var _0x5dabd9=this;return new Promise(function(_0x5dc733,_0xafea84){return db[_0x99a1('0x1c')][_0x99a1('0x20')](_0x114b38[_0x99a1('0x1d')],{'raw':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')]['where']||null:null,'attributes':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x21')]||null:null,'limit':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x22')]||null:null})['then'](function(_0x37514e){logger[_0x99a1('0x10')](_0x99a1('0x23'),_0x114b38);logger[_0x99a1('0x13')](_0x99a1('0x23'),_0x114b38,JSON[_0x99a1('0x15')](_0x37514e));_0x5dc733(_0x37514e);})[_0x99a1('0x1a')](function(_0x26c23c){logger['error']('UpdateFaxMessage',_0x26c23c[_0x99a1('0x18')],_0x114b38);_0xafea84(_0x5dabd9['error'](0x1f4,_0x26c23c[_0x99a1('0x18')]));});});}; \ No newline at end of file +var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x6999ff,_0x448788){_0x6999ff=_0x6999ff-0x0;var _0x16a187=_0x5fd1[_0x6999ff];return _0x16a187;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index a5a55e5..4c6844c 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 _0x453d=['faxMessage:','remove','update','removeListener','length'];(function(_0x1db8d9,_0x23798a){var _0x544053=function(_0x4c16ac){while(--_0x4c16ac){_0x1db8d9['push'](_0x1db8d9['shift']());}};_0x544053(++_0x23798a);}(_0x453d,0xb0));var _0xd453=function(_0x1d14a4,_0x5b223f){_0x1d14a4=_0x1d14a4-0x0;var _0x2a2972=_0x453d[_0x1d14a4];return _0x2a2972;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xd453('0x0'),_0xd453('0x1')];function createListener(_0x57baa0,_0x56cbb7){return function(_0x4cb984){_0x56cbb7['emit'](_0x57baa0,_0x4cb984);};}function removeListener(_0x356bb6,_0x416f12){return function(){FaxMessageEvents[_0xd453('0x2')](_0x356bb6,_0x416f12);};}exports['register']=function(_0x18dfcb){for(var _0x270d3c=0x0,_0x304387=events[_0xd453('0x3')];_0x270d3c<_0x304387;_0x270d3c++){var _0x2ad31b=events[_0x270d3c];var _0x199db7=createListener(_0xd453('0x4')+_0x2ad31b,_0x18dfcb);FaxMessageEvents['on'](_0x2ad31b,_0x199db7);}}; \ No newline at end of file +var _0xe543=['remove','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0xb205d4,_0x3594e4){var _0x4f80d5=function(_0x463f52){while(--_0x463f52){_0xb205d4['push'](_0xb205d4['shift']());}};_0x4f80d5(++_0x3594e4);}(_0xe543,0xbe));var _0x3e54=function(_0x1170db,_0x1f061a){_0x1170db=_0x1170db-0x0;var _0x16e575=_0xe543[_0x1170db];return _0x16e575;};'use strict';var FaxMessageEvents=require(_0x3e54('0x0'));var events=[_0x3e54('0x1'),_0x3e54('0x2'),'update'];function createListener(_0x46c073,_0x45d5f0){return function(_0x3b77ea){_0x45d5f0[_0x3e54('0x3')](_0x46c073,_0x3b77ea);};}function removeListener(_0x161cdf,_0x1f205a){return function(){FaxMessageEvents[_0x3e54('0x4')](_0x161cdf,_0x1f205a);};}exports[_0x3e54('0x5')]=function(_0x22992b){for(var _0x5a3e74=0x0,_0x4685df=events[_0x3e54('0x6')];_0x5a3e74<_0x4685df;_0x5a3e74++){var _0x2d1697=events[_0x5a3e74];var _0x58fa93=createListener(_0x3e54('0x7')+_0x2d1697,_0x22992b);FaxMessageEvents['on'](_0x2d1697,_0x58fa93);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4dff124..c478ef7 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 _0xb58b=['Router','fs-extra','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','/:id/accept','accept','reject','destroy','exports','util','path','connect-timeout'];(function(_0x47242f,_0x2968c4){var _0x3e19f8=function(_0x1adfb2){while(--_0x1adfb2){_0x47242f['push'](_0x47242f['shift']());}};_0x3e19f8(++_0x2968c4);}(_0xb58b,0x1f1));var _0xbb58=function(_0x18789e,_0x87aeff){_0x18789e=_0x18789e-0x0;var _0x22e3ab=_0xb58b[_0x18789e];return _0x22e3ab;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['download']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),interaction[_0xbb58('0xf')](_0xbb58('0x10'),_0xbb58('0x11')),controller[_0xbb58('0x12')]);router['put'](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['update']);router[_0xbb58('0x13')](_0xbb58('0x14'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x15')]);router[_0xbb58('0x13')]('/:id/reject',auth[_0xbb58('0x8')](),controller[_0xbb58('0x16')]);router['delete']('/:id',auth[_0xbb58('0x8')](),controller[_0xbb58('0x17')]);module[_0xbb58('0x18')]=router; \ No newline at end of file +var _0x97c1=['isAuthenticated','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','get','/describe'];(function(_0xe30f2d,_0x401070){var _0x50ee29=function(_0x423795){while(--_0x423795){_0xe30f2d['push'](_0xe30f2d['shift']());}};_0x50ee29(++_0x401070);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x197c('0x3'));var auth=require(_0x197c('0x4'));var interaction=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var controller=require(_0x197c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x197c('0x8')]);router[_0x197c('0x9')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['describe']);router['get'](_0x197c('0xc'),auth['isAuthenticated'](),controller[_0x197c('0xd')]);router[_0x197c('0x9')](_0x197c('0xe'),auth[_0x197c('0xb')](),controller['download']);router[_0x197c('0xf')]('/',auth[_0x197c('0xb')](),interaction[_0x197c('0x10')](_0x197c('0x11'),_0x197c('0x12')),controller['create']);router[_0x197c('0x13')](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x14')]);router['put'](_0x197c('0x15'),auth[_0x197c('0xb')](),controller[_0x197c('0x16')]);router[_0x197c('0x13')](_0x197c('0x17'),auth[_0x197c('0xb')](),controller['reject']);router['delete'](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x18')]);module[_0x197c('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b2b1bc0..ec9919f 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 _0x80f7=['name','INTEGER','ENUM','roundrobin','sequelize','STRING'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x80f7,0xd6));var _0x780f=function(_0x720e20,_0x1a827){_0x720e20=_0x720e20-0x0;var _0xfef46e=_0x80f7[_0x720e20];return _0xfef46e;};'use strict';var Sequelize=require(_0x780f('0x0'));module['exports']={'name':{'type':Sequelize[_0x780f('0x1')],'unique':_0x780f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x780f('0x1')]},'timeout':{'type':Sequelize[_0x780f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x780f('0x4')]('rrmemory','beepall',_0x780f('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x780f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c0c=['beepall','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x2c224a,_0x36b3fa){var _0x34942e=function(_0x4cf882){while(--_0x4cf882){_0x2c224a['push'](_0x2c224a['shift']());}};_0x34942e(++_0x36b3fa);}(_0x4c0c,0xef));var _0xc4c0=function(_0x3330b8,_0x19b32a){_0x3330b8=_0x3330b8-0x0;var _0x191799=_0x4c0c[_0x3330b8];return _0x191799;};'use strict';var Sequelize=require(_0xc4c0('0x0'));module[_0xc4c0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc4c0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc4c0('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc4c0('0x4')](_0xc4c0('0x5'),_0xc4c0('0x6'),'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 e328cf6..e2fb6a4 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 _0x1abc=['voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','compact','value','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','FaxQueue','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','Team','getTeams','ids','Agents','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1abc,0x1c7));var _0xc1ab=function(_0x2ff5aa,_0x4d251f){_0x2ff5aa=_0x2ff5aa-0x0;var _0x366c91=_0x1abc[_0x2ff5aa];return _0x366c91;};'use strict';var emlformat=require(_0xc1ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1ab('0x1'));var jsonpatch=require(_0xc1ab('0x2'));var rp=require(_0xc1ab('0x3'));var moment=require(_0xc1ab('0x4'));var BPromise=require(_0xc1ab('0x5'));var Mustache=require('mustache');var util=require(_0xc1ab('0x6'));var path=require(_0xc1ab('0x7'));var sox=require(_0xc1ab('0x8'));var csv=require(_0xc1ab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1ab('0xa'));var _=require(_0xc1ab('0xb'));var squel=require(_0xc1ab('0xc'));var crypto=require(_0xc1ab('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc1ab('0xe'));var Papa=require(_0xc1ab('0xf'));var Redis=require(_0xc1ab('0x10'));var authService=require(_0xc1ab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc1ab('0x12'));var hardwareService=require(_0xc1ab('0x13'));var logger=require(_0xc1ab('0x14'))('api');var utils=require(_0xc1ab('0x15'));var config=require(_0xc1ab('0x16'));var licenseUtil=require(_0xc1ab('0x17'));var db=require(_0xc1ab('0x18'))['db'];config[_0xc1ab('0x19')]=_[_0xc1ab('0x1a')](config[_0xc1ab('0x19')],{'host':_0xc1ab('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1ab('0x19')]));require('./faxQueue.socket')[_0xc1ab('0x1c')](socket);function respondWithStatusCode(_0x2d5e09,_0x4b445f){_0x4b445f=_0x4b445f||0xcc;return function(_0x110ecc){if(_0x110ecc){return _0x2d5e09[_0xc1ab('0x1d')](_0x4b445f);}return _0x2d5e09[_0xc1ab('0x1e')](_0x4b445f)[_0xc1ab('0x1f')]();};}function respondWithResult(_0x31a617,_0x7b7999){_0x7b7999=_0x7b7999||0xc8;return function(_0x185c7a){if(_0x185c7a){return _0x31a617['status'](_0x7b7999)['json'](_0x185c7a);}};}function respondWithFilteredResult(_0x5576eb,_0x43e6e1){return function(_0x33376d){if(_0x33376d){var _0x478c5d=typeof _0x43e6e1[_0xc1ab('0x20')]===_0xc1ab('0x21')&&typeof _0x43e6e1[_0xc1ab('0x22')]===_0xc1ab('0x21');var _0x2067e0=_0x33376d['count'];var _0x42ed20=_0x478c5d?0x0:_0x43e6e1[_0xc1ab('0x20')];var _0x8c6fa0=_0x478c5d?_0x33376d[_0xc1ab('0x23')]:_0x43e6e1[_0xc1ab('0x20')]+_0x43e6e1[_0xc1ab('0x22')];var _0xc927bf;if(_0x8c6fa0>=_0x2067e0){_0x8c6fa0=_0x2067e0;_0xc927bf=0xc8;}else{_0xc927bf=0xce;}_0x5576eb[_0xc1ab('0x1e')](_0xc927bf);return _0x5576eb[_0xc1ab('0x24')](_0xc1ab('0x25'),_0x42ed20+'-'+_0x8c6fa0+'/'+_0x2067e0)[_0xc1ab('0x26')](_0x33376d);}return null;};}function patchUpdates(_0x227b5e){return function(_0x259b7b){try{jsonpatch[_0xc1ab('0x27')](_0x259b7b,_0x227b5e,!![]);}catch(_0x12483c){return BPromise[_0xc1ab('0x28')](_0x12483c);}return _0x259b7b[_0xc1ab('0x29')]();};}function saveUpdates(_0x4a7792,_0x7c897e){return function(_0x3b640e){if(_0x3b640e){return _0x3b640e[_0xc1ab('0x2a')](_0x4a7792)[_0xc1ab('0x2b')](function(_0x44ea3a){return _0x44ea3a;});}return null;};}function removeEntity(_0x95a954,_0x154d10){return function(_0x2ca6fa){if(_0x2ca6fa){return _0x2ca6fa[_0xc1ab('0x2c')]()[_0xc1ab('0x2b')](function(){var _0x227405=_0x2ca6fa[_0xc1ab('0x2d')]({'plain':!![]});var _0x14f5fb=_0xc1ab('0x2e');return db[_0xc1ab('0x2f')][_0xc1ab('0x2c')]({'where':{'type':_0x14f5fb,'resourceId':_0x227405['id']}})[_0xc1ab('0x2b')](function(){return _0x2ca6fa;});})[_0xc1ab('0x2b')](function(){_0x95a954['status'](0xcc)[_0xc1ab('0x1f')]();});}};}function handleEntityNotFound(_0x4a59f6,_0x5e4ec7){return function(_0x3add06){if(!_0x3add06){_0x4a59f6[_0xc1ab('0x1d')](0x194);}return _0x3add06;};}function handleError(_0x589ac2,_0x4dff2b){_0x4dff2b=_0x4dff2b||0x1f4;return function(_0x2a4535){logger['error'](_0x2a4535[_0xc1ab('0x30')]);if(_0x2a4535[_0xc1ab('0x31')]){delete _0x2a4535[_0xc1ab('0x31')];}_0x589ac2[_0xc1ab('0x1e')](_0x4dff2b)[_0xc1ab('0x32')](_0x2a4535);};}exports[_0xc1ab('0x33')]=function(_0x3022b4,_0x15bfea){var _0x24d5c5={},_0x4f2d24={},_0xa581e={'count':0x0,'rows':[]};var _0x3faed9=_['map'](db[_0xc1ab('0x34')][_0xc1ab('0x35')],function(_0x326b7d){return{'name':_0x326b7d['fieldName'],'type':_0x326b7d[_0xc1ab('0x36')][_0xc1ab('0x37')]};});_0x4f2d24[_0xc1ab('0x38')]=_[_0xc1ab('0x39')](_0x3faed9,_0xc1ab('0x31'));_0x4f2d24['query']=_[_0xc1ab('0x3a')](_0x3022b4[_0xc1ab('0x3b')]);_0x4f2d24[_0xc1ab('0x3c')]=_[_0xc1ab('0x3d')](_0x4f2d24[_0xc1ab('0x38')],_0x4f2d24[_0xc1ab('0x3b')]);_0x24d5c5['attributes']=_[_0xc1ab('0x3d')](_0x4f2d24[_0xc1ab('0x38')],qs[_0xc1ab('0x3e')](_0x3022b4['query'][_0xc1ab('0x3e')]));_0x24d5c5['attributes']=_0x24d5c5[_0xc1ab('0x3f')]['length']?_0x24d5c5[_0xc1ab('0x3f')]:_0x4f2d24[_0xc1ab('0x38')];if(!_0x3022b4[_0xc1ab('0x3b')][_0xc1ab('0x40')](_0xc1ab('0x41'))){_0x24d5c5[_0xc1ab('0x22')]=qs[_0xc1ab('0x22')](_0x3022b4[_0xc1ab('0x3b')][_0xc1ab('0x22')]);_0x24d5c5[_0xc1ab('0x20')]=qs[_0xc1ab('0x20')](_0x3022b4[_0xc1ab('0x3b')]['offset']);}_0x24d5c5[_0xc1ab('0x42')]=qs[_0xc1ab('0x43')](_0x3022b4[_0xc1ab('0x3b')][_0xc1ab('0x43')]);_0x24d5c5[_0xc1ab('0x44')]=qs['filters'](_[_0xc1ab('0x45')](_0x3022b4['query'],_0x4f2d24[_0xc1ab('0x3c')]),_0x3faed9);if(_0x3022b4[_0xc1ab('0x3b')]['filter']){_0x24d5c5['where']=_[_0xc1ab('0x46')](_0x24d5c5[_0xc1ab('0x44')],{'$or':_[_0xc1ab('0x39')](_0x3faed9,function(_0x37090a){if(_0x37090a['type']!==_0xc1ab('0x47')){var _0x19c845={};_0x19c845[_0x37090a[_0xc1ab('0x31')]]={'$like':'%'+_0x3022b4['query'][_0xc1ab('0x48')]+'%'};return _0x19c845;}})});}_0x24d5c5=_['merge']({},_0x24d5c5,_0x3022b4[_0xc1ab('0x49')]);var _0x5f13d3={'where':_0x24d5c5['where']};return db[_0xc1ab('0x34')][_0xc1ab('0x23')](_0x5f13d3)[_0xc1ab('0x2b')](function(_0x1018a8){_0xa581e[_0xc1ab('0x23')]=_0x1018a8;if(_0x3022b4[_0xc1ab('0x3b')][_0xc1ab('0x4a')]){_0x24d5c5[_0xc1ab('0x4b')]=[{'all':!![]}];}return db[_0xc1ab('0x34')][_0xc1ab('0x4c')](_0x24d5c5);})[_0xc1ab('0x2b')](function(_0x324269){_0xa581e[_0xc1ab('0x4d')]=_0x324269;return _0xa581e;})[_0xc1ab('0x2b')](respondWithFilteredResult(_0x15bfea,_0x24d5c5))['catch'](handleError(_0x15bfea,null));};exports[_0xc1ab('0x4e')]=function(_0x5d9a29,_0x88531){var _0x4e7bd5={'raw':!![],'where':{'id':_0x5d9a29[_0xc1ab('0x4f')]['id']}},_0x15bbbf={};_0x15bbbf[_0xc1ab('0x38')]=_['keys'](db[_0xc1ab('0x34')]['rawAttributes']);_0x15bbbf[_0xc1ab('0x3b')]=_[_0xc1ab('0x3a')](_0x5d9a29['query']);_0x15bbbf['filters']=_['intersection'](_0x15bbbf[_0xc1ab('0x38')],_0x15bbbf[_0xc1ab('0x3b')]);_0x4e7bd5[_0xc1ab('0x3f')]=_[_0xc1ab('0x3d')](_0x15bbbf[_0xc1ab('0x38')],qs[_0xc1ab('0x3e')](_0x5d9a29[_0xc1ab('0x3b')][_0xc1ab('0x3e')]));_0x4e7bd5[_0xc1ab('0x3f')]=_0x4e7bd5[_0xc1ab('0x3f')][_0xc1ab('0x50')]?_0x4e7bd5[_0xc1ab('0x3f')]:_0x15bbbf['model'];if(_0x5d9a29[_0xc1ab('0x3b')][_0xc1ab('0x4a')]){_0x4e7bd5[_0xc1ab('0x4b')]=[{'all':!![]}];}_0x4e7bd5=_[_0xc1ab('0x46')]({},_0x4e7bd5,_0x5d9a29[_0xc1ab('0x49')]);return db['FaxQueue']['find'](_0x4e7bd5)[_0xc1ab('0x2b')](handleEntityNotFound(_0x88531,null))[_0xc1ab('0x2b')](respondWithResult(_0x88531,null))['catch'](handleError(_0x88531,null));};exports['create']=function(_0x3f17e5,_0x946784){return db['FaxQueue'][_0xc1ab('0x51')](_0x3f17e5[_0xc1ab('0x52')],{})[_0xc1ab('0x2b')](function(_0x46e503){var _0x4aeebf=_0x3f17e5[_0xc1ab('0x53')][_0xc1ab('0x2d')]({'plain':!![]});if(!_0x4aeebf)throw new Error(_0xc1ab('0x54'));if(_0x4aeebf[_0xc1ab('0x55')]==='user'){var _0x562cb4=_0x46e503[_0xc1ab('0x2d')]({'plain':!![]});var _0x3f03c5='FaxQueues';return db[_0xc1ab('0x56')]['find']({'where':{'name':_0x3f03c5,'userProfileId':_0x4aeebf[_0xc1ab('0x57')]},'raw':!![]})[_0xc1ab('0x2b')](function(_0x58073a){if(_0x58073a&&_0x58073a[_0xc1ab('0x58')]===0x0){return db[_0xc1ab('0x2f')]['create']({'name':_0x562cb4[_0xc1ab('0x31')],'resourceId':_0x562cb4['id'],'type':_0x58073a[_0xc1ab('0x31')],'sectionId':_0x58073a['id']},{})[_0xc1ab('0x2b')](function(){return _0x46e503;});}else{return _0x46e503;}})[_0xc1ab('0x59')](function(_0x2c5992){logger[_0xc1ab('0x5a')](_0xc1ab('0x5b'),_0x2c5992);throw _0x2c5992;});}return _0x46e503;})[_0xc1ab('0x2b')](respondWithResult(_0x946784,0xc9))[_0xc1ab('0x59')](handleError(_0x946784,null));};exports[_0xc1ab('0x2a')]=function(_0x5ecabe,_0x12c0a6){if(_0x5ecabe[_0xc1ab('0x52')]['id']){delete _0x5ecabe['body']['id'];}return db[_0xc1ab('0x34')][_0xc1ab('0x5c')]({'where':{'id':_0x5ecabe['params']['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x12c0a6,null))[_0xc1ab('0x2b')](saveUpdates(_0x5ecabe[_0xc1ab('0x52')],null))['then'](respondWithResult(_0x12c0a6,null))[_0xc1ab('0x59')](handleError(_0x12c0a6,null));};exports[_0xc1ab('0x2c')]=function(_0x1c60e7,_0x966fab){return db[_0xc1ab('0x34')][_0xc1ab('0x5c')]({'where':{'id':_0x1c60e7['params']['id']}})['then'](handleEntityNotFound(_0x966fab,null))['then'](removeEntity(_0x966fab,null))[_0xc1ab('0x59')](handleError(_0x966fab,null));};exports['describe']=function(_0x2f220a,_0x4e624a){return db[_0xc1ab('0x34')][_0xc1ab('0x5d')]()[_0xc1ab('0x2b')](respondWithResult(_0x4e624a,null))['catch'](handleError(_0x4e624a,null));};exports['getMembers']=function(_0x59c953,_0x5467bb,_0x4f107f){var _0xff5651={'raw':!![],'where':{}},_0x4b6a6a={},_0x217a84;return db['FaxQueue'][_0xc1ab('0x5e')]({'where':{'id':_0x59c953[_0xc1ab('0x4f')]['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x5467bb,null))[_0xc1ab('0x2b')](function(_0x21bb05){if(_0x21bb05){_0x217a84=_0x21bb05[_0xc1ab('0x2d')]({'plain':!![]});_0x4b6a6a['model']=_[_0xc1ab('0x3a')](db[_0xc1ab('0x5f')][_0xc1ab('0x35')]);_0x4b6a6a[_0xc1ab('0x3b')]=_[_0xc1ab('0x3a')](_0x59c953[_0xc1ab('0x3b')]);_0x4b6a6a['filters']=_['intersection'](_0x4b6a6a[_0xc1ab('0x38')],_0x4b6a6a[_0xc1ab('0x3b')]);_0xff5651['attributes']=_['intersection'](_0x4b6a6a[_0xc1ab('0x38')],qs[_0xc1ab('0x3e')](_0x59c953[_0xc1ab('0x3b')][_0xc1ab('0x3e')]));_0xff5651[_0xc1ab('0x3f')]=_0xff5651['attributes'][_0xc1ab('0x50')]?_0xff5651[_0xc1ab('0x3f')]:_0x4b6a6a['model'];if(!_0x59c953[_0xc1ab('0x3b')]['hasOwnProperty'](_0xc1ab('0x41'))){_0xff5651[_0xc1ab('0x22')]=qs[_0xc1ab('0x22')](_0x59c953[_0xc1ab('0x3b')][_0xc1ab('0x22')]);_0xff5651[_0xc1ab('0x20')]=qs[_0xc1ab('0x20')](_0x59c953[_0xc1ab('0x3b')]['offset']);}_0xff5651[_0xc1ab('0x42')]=qs[_0xc1ab('0x43')](_0x59c953['query'][_0xc1ab('0x43')]);_0xff5651['where']=qs[_0xc1ab('0x3c')](_[_0xc1ab('0x45')](_0x59c953[_0xc1ab('0x3b')],_0x4b6a6a['filters']));_0xff5651[_0xc1ab('0x44')]['FaxQueueId']=_0x21bb05['id'];if(_0x59c953[_0xc1ab('0x3b')][_0xc1ab('0x48')]){_0xff5651[_0xc1ab('0x44')]=_[_0xc1ab('0x46')](_0xff5651[_0xc1ab('0x44')],{'$or':_[_0xc1ab('0x39')](_0xff5651[_0xc1ab('0x3f')],function(_0x30e0b8){var _0x1f9383={};_0x1f9383[_0x30e0b8]={'$like':'%'+_0x59c953[_0xc1ab('0x3b')][_0xc1ab('0x48')]+'%'};return _0x1f9383;})});}_0xff5651=_[_0xc1ab('0x46')]({},_0xff5651,_0x59c953['options']);return db[_0xc1ab('0x5f')][_0xc1ab('0x4c')](_0xff5651);}})[_0xc1ab('0x2b')](function(_0x32282f){if(_0x32282f){return db[_0xc1ab('0x60')][_0xc1ab('0x61')]({'where':{'id':_['map'](_0x32282f,_0xc1ab('0x62')),'role':_0xc1ab('0x63')},'attributes':['id','name',_0xc1ab('0x64'),'updatedAt',_0xc1ab('0x65')]});}})[_0xc1ab('0x2b')](function(_0x144897){if(_0x144897){return{'count':_0x144897[_0xc1ab('0x23')],'rows':_[_0xc1ab('0x39')](_0x144897['rows'],function(_0x12ce58){return{'membername':_0x12ce58[_0xc1ab('0x31')],'UserId':_0x12ce58['id'],'queue_name':_0x217a84[_0xc1ab('0x31')],'FaxQueueId':_0x217a84['id'],'interface':util[_0xc1ab('0x66')](_0xc1ab('0x67'),'SIP',_0x12ce58[_0xc1ab('0x31')]),'penalty':0x0,'paused':_0x12ce58[_0xc1ab('0x64')],'createdAt':_0x12ce58[_0xc1ab('0x65')],'updatedAt':_0x12ce58['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc1ab('0x2b')](respondWithFilteredResult(_0x5467bb,_0xff5651))['catch'](handleError(_0x5467bb,null));};exports['getTeams']=function(_0x2038ba,_0x40d4c8,_0x58fe25){var _0x748ce5={};var _0x16dff8={};var _0x3fbacf;var _0x4f68ba;return db['FaxQueue'][_0xc1ab('0x5e')]({'where':{'id':_0x2038ba[_0xc1ab('0x4f')]['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x40d4c8,null))[_0xc1ab('0x2b')](function(_0x1648d2){if(_0x1648d2){_0x3fbacf=_0x1648d2;_0x16dff8[_0xc1ab('0x38')]=_['keys'](db[_0xc1ab('0x68')]['rawAttributes']);_0x16dff8['query']=_[_0xc1ab('0x3a')](_0x2038ba['query']);_0x16dff8['filters']=_[_0xc1ab('0x3d')](_0x16dff8[_0xc1ab('0x38')],_0x16dff8[_0xc1ab('0x3b')]);_0x748ce5['attributes']=_[_0xc1ab('0x3d')](_0x16dff8[_0xc1ab('0x38')],qs['fields'](_0x2038ba[_0xc1ab('0x3b')]['fields']));_0x748ce5['attributes']=_0x748ce5[_0xc1ab('0x3f')]['length']?_0x748ce5[_0xc1ab('0x3f')]:_0x16dff8['model'];_0x748ce5[_0xc1ab('0x42')]=qs[_0xc1ab('0x43')](_0x2038ba['query'][_0xc1ab('0x43')]);_0x748ce5[_0xc1ab('0x44')]=qs[_0xc1ab('0x3c')](_[_0xc1ab('0x45')](_0x2038ba[_0xc1ab('0x3b')],_0x16dff8[_0xc1ab('0x3c')]));if(_0x2038ba[_0xc1ab('0x3b')][_0xc1ab('0x48')]){_0x748ce5['where']=_[_0xc1ab('0x46')](_0x748ce5[_0xc1ab('0x44')],{'$or':_['map'](_0x748ce5[_0xc1ab('0x3f')],function(_0x316de3){var _0x347aeb={};_0x347aeb[_0x316de3]={'$like':'%'+_0x2038ba['query']['filter']+'%'};return _0x347aeb;})});}_0x748ce5=_['merge']({},_0x748ce5,_0x2038ba[_0xc1ab('0x49')]);return _0x3fbacf[_0xc1ab('0x69')](_0x748ce5);}})[_0xc1ab('0x2b')](function(_0x44d941){if(_0x44d941){_0x4f68ba=_0x44d941['length'];if(!_0x2038ba[_0xc1ab('0x3b')][_0xc1ab('0x40')]('nolimit')){_0x748ce5[_0xc1ab('0x22')]=qs[_0xc1ab('0x22')](_0x2038ba[_0xc1ab('0x3b')]['limit']);_0x748ce5[_0xc1ab('0x20')]=qs[_0xc1ab('0x20')](_0x2038ba['query'][_0xc1ab('0x20')]);}return _0x3fbacf[_0xc1ab('0x69')](_0x748ce5);}})[_0xc1ab('0x2b')](function(_0x351d80){if(_0x351d80){return _0x351d80?{'count':_0x4f68ba,'rows':_0x351d80}:null;}})[_0xc1ab('0x2b')](respondWithResult(_0x40d4c8,null))[_0xc1ab('0x59')](handleError(_0x40d4c8,null));};exports['addTeams']=function(_0x2be6a4,_0x32bfb4,_0x556816){var _0x4e25ff=_0x2be6a4['body'][_0xc1ab('0x6a')];return db[_0xc1ab('0x68')][_0xc1ab('0x4c')]({'where':{'id':_0x4e25ff},'attributes':['id'],'include':[{'model':db[_0xc1ab('0x60')],'as':_0xc1ab('0x6b'),'attributes':['id',_0xc1ab('0x31'),_0xc1ab('0x6c'),_0xc1ab('0x6d'),_0xc1ab('0x6e')],'raw':!![]}]})[_0xc1ab('0x2b')](function(_0x4f25fc){if(_0x4f25fc){var _0x4c2223=_[_0xc1ab('0x6f')](_0x4f25fc,function(_0x38dd60){var _0x4f2e7b=_0x38dd60[_0xc1ab('0x2d')]({'plain':!![]});return _0x4f2e7b[_0xc1ab('0x6b')];});return db['FaxQueue'][_0xc1ab('0x5c')]({'where':{'id':_0x2be6a4['params']['id']}})[_0xc1ab('0x2b')](function(_0xcfa64b){return db[_0xc1ab('0x70')][_0xc1ab('0x71')](function(_0x7f9997){return _0xcfa64b['addTeams'](_0x4e25ff,{'transaction':_0x7f9997})[_0xc1ab('0x2b')](function(){return BPromise[_0xc1ab('0x72')](_0x4c2223,function(_0xed3b76){return db[_0xc1ab('0x5f')][_0xc1ab('0x73')]({'where':{'UserId':_0xed3b76['id'],'FaxQueueId':_0x2be6a4[_0xc1ab('0x4f')]['id']},'transaction':_0x7f9997});});})[_0xc1ab('0x2b')](function(){_0x4c2223[_0xc1ab('0x74')](function(_0x508197){socket['emit']('userFaxQueue:save',{'UserId':_0x508197['id'],'FaxQueueId':_0xcfa64b['id']});});});});});}})[_0xc1ab('0x2b')](respondWithStatusCode(_0x32bfb4,null))[_0xc1ab('0x59')](handleError(_0x32bfb4,null));};exports[_0xc1ab('0x75')]=function(_0x2767ab,_0x488924,_0x1d523e){return db[_0xc1ab('0x68')][_0xc1ab('0x4c')]({'where':{'id':_0x2767ab[_0xc1ab('0x3b')][_0xc1ab('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xc1ab('0x60')],'as':_0xc1ab('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xc1ab('0x2b')](handleEntityNotFound(_0x488924,null))['then'](function(_0x1dd6ac){var _0x7cdafe=_[_0xc1ab('0x39')](_0x1dd6ac,'id');var _0x344448=[];var _0x492c66=[];var _0x1131d5=squel[_0xc1ab('0x76')]();_0x1131d5['field'](_0xc1ab('0x77'))['from']('team_has_fax_queues','tq')['join'](_0xc1ab('0x78'),'ut',_0xc1ab('0x79'))[_0xc1ab('0x44')](_0xc1ab('0x7a'),_0x2767ab[_0xc1ab('0x4f')]['id']);for(var _0x36b241=0x0;_0x36b241<_0x1dd6ac[_0xc1ab('0x50')];_0x36b241+=0x1){let _0x46ae03=_0x1dd6ac[_0x36b241];for(var _0x327910=0x0;_0x327910<_0x46ae03[_0xc1ab('0x6b')][_0xc1ab('0x50')];_0x327910+=0x1){let _0x424ec3=_0x46ae03['Agents'][_0x327910];var _0x1e0be5=_0x1131d5['clone']();_0x1e0be5[_0xc1ab('0x44')](_0xc1ab('0x7b'),_0x424ec3['id']);_0x492c66[_0xc1ab('0x7c')](db['sequelize'][_0xc1ab('0x3b')](_0x1e0be5['toString'](),{'type':db[_0xc1ab('0x70')][_0xc1ab('0x7d')][_0xc1ab('0x7e')]})[_0xc1ab('0x2b')](function(_0xccb889){if(_0xccb889['length']===0x1){return _0x424ec3['id'];}else{var _0x4a7b19=_['every'](_['map'](_0xccb889,_0xc1ab('0x7f')),function(_0xa289e6){return _[_0xc1ab('0x80')](_0x7cdafe,_0xa289e6);});if(_0x4a7b19){return _0x424ec3['id'];}}}));}}return BPromise[_0xc1ab('0x81')](_0x492c66)[_0xc1ab('0x2b')](function(_0x996477){_0x344448=_(_0x344448)['union'](_0x996477)[_0xc1ab('0x82')]()[_0xc1ab('0x83')]();return db[_0xc1ab('0x34')][_0xc1ab('0x5c')]({'where':{'id':_0x2767ab[_0xc1ab('0x4f')]['id']}})['then'](function(_0x4db430){return db[_0xc1ab('0x70')][_0xc1ab('0x71')](function(_0x3ce91f){return _0x4db430['removeTeams'](_0x2767ab[_0xc1ab('0x3b')][_0xc1ab('0x6a')],{'transaction':_0x3ce91f})[_0xc1ab('0x2b')](function(){if(!_['isEmpty'](_0x344448)){return _0x4db430[_0xc1ab('0x84')](_0x344448,{'transaction':_0x3ce91f});}})['then'](function(){_0x344448['forEach'](function(_0x1db751){socket[_0xc1ab('0x85')](_0xc1ab('0x86'),{'UserId':_0x1db751,'FaxQueueId':_0x4db430['id']});});});});});});})[_0xc1ab('0x2b')](respondWithStatusCode(_0x488924,null))[_0xc1ab('0x59')](handleError(_0x488924,null));};exports[_0xc1ab('0x87')]=function(_0x26d7a8,_0x434a9f,_0x375b29){return db['FaxQueue']['find']({'where':{'id':_0x26d7a8[_0xc1ab('0x4f')]['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x434a9f,null))[_0xc1ab('0x2b')](function(_0x1a06b2){if(_0x1a06b2){return _0x1a06b2[_0xc1ab('0x87')](_0x26d7a8['body'][_0xc1ab('0x6a')],_[_0xc1ab('0x88')](_0x26d7a8['body'],[_0xc1ab('0x6a'),'id'])||{})[_0xc1ab('0x89')](function(_0x599196){for(var _0x5d0c8c=0x0;_0x5d0c8c<_0x26d7a8[_0xc1ab('0x52')][_0xc1ab('0x6a')][_0xc1ab('0x50')];_0x5d0c8c+=0x1){socket[_0xc1ab('0x85')](_0xc1ab('0x8a'),{'UserId':Number(_0x26d7a8[_0xc1ab('0x52')][_0xc1ab('0x6a')][_0x5d0c8c]),'FaxQueueId':Number(_0x26d7a8[_0xc1ab('0x4f')]['id'])});}return _0x599196;});}})['then'](respondWithResult(_0x434a9f,null))[_0xc1ab('0x59')](handleError(_0x434a9f,null));};exports[_0xc1ab('0x84')]=function(_0x555a38,_0x4ab657,_0x552cc2){return db['FaxQueue']['find']({'where':{'id':_0x555a38[_0xc1ab('0x4f')]['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x4ab657,null))[_0xc1ab('0x2b')](function(_0x5c24fd){if(_0x5c24fd){return _0x5c24fd['removeAgents'](_0x555a38[_0xc1ab('0x3b')][_0xc1ab('0x6a')])[_0xc1ab('0x2b')](function(){if(_[_0xc1ab('0x8b')](_0x555a38['query'][_0xc1ab('0x6a')])){for(var _0x50eeb4=0x0;_0x50eeb4<_0x555a38[_0xc1ab('0x3b')][_0xc1ab('0x6a')][_0xc1ab('0x50')];_0x50eeb4+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x555a38[_0xc1ab('0x3b')][_0xc1ab('0x6a')][_0x50eeb4]),'FaxQueueId':Number(_0x555a38[_0xc1ab('0x4f')]['id'])});}}else{socket[_0xc1ab('0x85')](_0xc1ab('0x86'),{'UserId':Number(_0x555a38[_0xc1ab('0x3b')][_0xc1ab('0x6a')]),'FaxQueueId':Number(_0x555a38[_0xc1ab('0x4f')]['id'])});}});}})[_0xc1ab('0x2b')](respondWithStatusCode(_0x4ab657,null))[_0xc1ab('0x59')](handleError(_0x4ab657,null));};exports[_0xc1ab('0x8c')]=function(_0x47f5aa,_0x5bcbcb,_0x3e85fd){var _0x5785d1={};var _0x2c8d25={};var _0x208be5;var _0x3280f2;return db[_0xc1ab('0x34')]['findOne']({'where':{'id':_0x47f5aa['params']['id']}})[_0xc1ab('0x2b')](handleEntityNotFound(_0x5bcbcb,null))[_0xc1ab('0x2b')](function(_0x49525d){if(_0x49525d){_0x208be5=_0x49525d;_0x2c8d25['model']=_['keys'](db[_0xc1ab('0x60')][_0xc1ab('0x35')]);_0x2c8d25[_0xc1ab('0x3b')]=_[_0xc1ab('0x3a')](_0x47f5aa[_0xc1ab('0x3b')]);_0x2c8d25[_0xc1ab('0x3c')]=_['intersection'](_0x2c8d25[_0xc1ab('0x38')],_0x2c8d25[_0xc1ab('0x3b')]);_0x5785d1[_0xc1ab('0x3f')]=_[_0xc1ab('0x3d')](_0x2c8d25['model'],qs[_0xc1ab('0x3e')](_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x3e')]));_0x5785d1[_0xc1ab('0x3f')]=_0x5785d1[_0xc1ab('0x3f')][_0xc1ab('0x50')]?_0x5785d1[_0xc1ab('0x3f')]:_0x2c8d25['model'];_0x5785d1[_0xc1ab('0x42')]=qs[_0xc1ab('0x43')](_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x43')]);_0x5785d1[_0xc1ab('0x44')]=qs[_0xc1ab('0x3c')](_[_0xc1ab('0x45')](_0x47f5aa[_0xc1ab('0x3b')],_0x2c8d25[_0xc1ab('0x3c')]));if(_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x48')]){_0x5785d1[_0xc1ab('0x44')]=_[_0xc1ab('0x46')](_0x5785d1[_0xc1ab('0x44')],{'$or':_[_0xc1ab('0x39')](_0x5785d1[_0xc1ab('0x3f')],function(_0x3256c9){var _0x101f8c={};_0x101f8c[_0x3256c9]={'$like':'%'+_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x48')]+'%'};return _0x101f8c;})});}_0x5785d1=_[_0xc1ab('0x46')]({},_0x5785d1,_0x47f5aa[_0xc1ab('0x49')]);return _0x208be5['getAgents'](_0x5785d1);}})[_0xc1ab('0x2b')](function(_0x39dda3){if(_0x39dda3){_0x3280f2=_0x39dda3[_0xc1ab('0x50')];if(!_0x47f5aa['query'][_0xc1ab('0x40')]('nolimit')){_0x5785d1['limit']=qs['limit'](_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x22')]);_0x5785d1[_0xc1ab('0x20')]=qs[_0xc1ab('0x20')](_0x47f5aa[_0xc1ab('0x3b')][_0xc1ab('0x20')]);}return _0x208be5[_0xc1ab('0x8c')](_0x5785d1);}})['then'](function(_0xfcdc90){if(_0xfcdc90){return _0xfcdc90?{'count':_0x3280f2,'rows':_0xfcdc90}:null;}})[_0xc1ab('0x2b')](respondWithResult(_0x5bcbcb,null))[_0xc1ab('0x59')](handleError(_0x5bcbcb,null));}; \ No newline at end of file +var _0x27b1=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','index','FaxQueue','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','user','role','FaxQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x27b1,0x117));var _0x127b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x27b1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x127b('0x0'));var rimraf=require(_0x127b('0x1'));var zipdir=require(_0x127b('0x2'));var jsonpatch=require(_0x127b('0x3'));var rp=require(_0x127b('0x4'));var moment=require(_0x127b('0x5'));var BPromise=require(_0x127b('0x6'));var Mustache=require('mustache');var util=require(_0x127b('0x7'));var path=require(_0x127b('0x8'));var sox=require(_0x127b('0x9'));var csv=require(_0x127b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x127b('0xb'));var _=require(_0x127b('0xc'));var squel=require(_0x127b('0xd'));var crypto=require(_0x127b('0xe'));var jsforce=require(_0x127b('0xf'));var deskjs=require(_0x127b('0x10'));var toCsv=require(_0x127b('0xa'));var querystring=require(_0x127b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x127b('0x12'));var as=require(_0x127b('0x13'));var hardwareService=require(_0x127b('0x14'));var logger=require('../../config/logger')(_0x127b('0x15'));var utils=require('../../config/utils');var config=require(_0x127b('0x16'));var licenseUtil=require(_0x127b('0x17'));var db=require(_0x127b('0x18'))['db'];config[_0x127b('0x19')]=_[_0x127b('0x1a')](config[_0x127b('0x19')],{'host':_0x127b('0x1b'),'port':0x18eb});var socket=require(_0x127b('0x1c'))(new Redis(config[_0x127b('0x19')]));require(_0x127b('0x1d'))[_0x127b('0x1e')](socket);function respondWithStatusCode(_0x5f3be5,_0x280501){_0x280501=_0x280501||0xcc;return function(_0x18f2e3){if(_0x18f2e3){return _0x5f3be5[_0x127b('0x1f')](_0x280501);}return _0x5f3be5[_0x127b('0x20')](_0x280501)[_0x127b('0x21')]();};}function respondWithResult(_0x34a9c9,_0x588471){_0x588471=_0x588471||0xc8;return function(_0x5ad5a1){if(_0x5ad5a1){return _0x34a9c9[_0x127b('0x20')](_0x588471)[_0x127b('0x22')](_0x5ad5a1);}};}function respondWithFilteredResult(_0xf6078c,_0x2101b8){return function(_0x242e09){if(_0x242e09){var _0x5d18e0=typeof _0x2101b8['offset']===_0x127b('0x23')&&typeof _0x2101b8[_0x127b('0x24')]===_0x127b('0x23');var _0x31d17a=_0x242e09[_0x127b('0x25')];var _0x19c789=_0x5d18e0?0x0:_0x2101b8['offset'];var _0x3be5c4=_0x5d18e0?_0x242e09['count']:_0x2101b8['offset']+_0x2101b8[_0x127b('0x24')];var _0xb13eb3;if(_0x3be5c4>=_0x31d17a){_0x3be5c4=_0x31d17a;_0xb13eb3=0xc8;}else{_0xb13eb3=0xce;}_0xf6078c[_0x127b('0x20')](_0xb13eb3);return _0xf6078c[_0x127b('0x26')](_0x127b('0x27'),_0x19c789+'-'+_0x3be5c4+'/'+_0x31d17a)[_0x127b('0x22')](_0x242e09);}return null;};}function patchUpdates(_0x37dbbb){return function(_0x538ee1){try{jsonpatch['apply'](_0x538ee1,_0x37dbbb,!![]);}catch(_0x883501){return BPromise['reject'](_0x883501);}return _0x538ee1[_0x127b('0x28')]();};}function saveUpdates(_0x12a5bc,_0x44646d){return function(_0x5767ee){if(_0x5767ee){return _0x5767ee['update'](_0x12a5bc)[_0x127b('0x29')](function(_0x3f9e03){return _0x3f9e03;});}return null;};}function removeEntity(_0x25958c,_0x2395d6){return function(_0x509512){if(_0x509512){return _0x509512[_0x127b('0x2a')]()[_0x127b('0x29')](function(){var _0x8d581d=_0x509512[_0x127b('0x2b')]({'plain':!![]});var _0x5b30f7='FaxQueues';return db[_0x127b('0x2c')][_0x127b('0x2a')]({'where':{'type':_0x5b30f7,'resourceId':_0x8d581d['id']}})[_0x127b('0x29')](function(){return _0x509512;});})[_0x127b('0x29')](function(){_0x25958c['status'](0xcc)[_0x127b('0x21')]();});}};}function handleEntityNotFound(_0x34f165,_0x239407){return function(_0x2f969e){if(!_0x2f969e){_0x34f165[_0x127b('0x1f')](0x194);}return _0x2f969e;};}function handleError(_0xd2ae89,_0x1ea47e){_0x1ea47e=_0x1ea47e||0x1f4;return function(_0x14f343){logger[_0x127b('0x2d')](_0x14f343[_0x127b('0x2e')]);if(_0x14f343[_0x127b('0x2f')]){delete _0x14f343[_0x127b('0x2f')];}_0xd2ae89[_0x127b('0x20')](_0x1ea47e)['send'](_0x14f343);};}exports[_0x127b('0x30')]=function(_0x11347b,_0x2e701a){var _0x56e293={},_0xbfaa2b={},_0x102d31={'count':0x0,'rows':[]};var _0x467c31=_['map'](db[_0x127b('0x31')][_0x127b('0x32')],function(_0x5742eb){return{'name':_0x5742eb[_0x127b('0x33')],'type':_0x5742eb[_0x127b('0x34')]['key']};});_0xbfaa2b[_0x127b('0x35')]=_[_0x127b('0x36')](_0x467c31,'name');_0xbfaa2b['query']=_[_0x127b('0x37')](_0x11347b[_0x127b('0x38')]);_0xbfaa2b[_0x127b('0x39')]=_[_0x127b('0x3a')](_0xbfaa2b[_0x127b('0x35')],_0xbfaa2b[_0x127b('0x38')]);_0x56e293['attributes']=_[_0x127b('0x3a')](_0xbfaa2b[_0x127b('0x35')],qs['fields'](_0x11347b['query'][_0x127b('0x3b')]));_0x56e293[_0x127b('0x3c')]=_0x56e293['attributes']['length']?_0x56e293[_0x127b('0x3c')]:_0xbfaa2b['model'];if(!_0x11347b[_0x127b('0x38')]['hasOwnProperty'](_0x127b('0x3d'))){_0x56e293['limit']=qs[_0x127b('0x24')](_0x11347b[_0x127b('0x38')][_0x127b('0x24')]);_0x56e293[_0x127b('0x3e')]=qs['offset'](_0x11347b[_0x127b('0x38')]['offset']);}_0x56e293[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x11347b[_0x127b('0x38')][_0x127b('0x40')]);_0x56e293[_0x127b('0x41')]=qs['filters'](_[_0x127b('0x42')](_0x11347b[_0x127b('0x38')],_0xbfaa2b[_0x127b('0x39')]),_0x467c31);if(_0x11347b[_0x127b('0x38')][_0x127b('0x43')]){_0x56e293[_0x127b('0x41')]=_['merge'](_0x56e293[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x467c31,function(_0x1ac722){if(_0x1ac722[_0x127b('0x34')]!==_0x127b('0x44')){var _0x413680={};_0x413680[_0x1ac722[_0x127b('0x2f')]]={'$like':'%'+_0x11347b['query']['filter']+'%'};return _0x413680;}})});}_0x56e293=_[_0x127b('0x45')]({},_0x56e293,_0x11347b[_0x127b('0x46')]);var _0x25b958={'where':_0x56e293[_0x127b('0x41')]};return db[_0x127b('0x31')][_0x127b('0x25')](_0x25b958)[_0x127b('0x29')](function(_0x427fec){_0x102d31['count']=_0x427fec;if(_0x11347b[_0x127b('0x38')][_0x127b('0x47')]){_0x56e293[_0x127b('0x48')]=[{'all':!![]}];}return db[_0x127b('0x31')][_0x127b('0x49')](_0x56e293);})[_0x127b('0x29')](function(_0x49e800){_0x102d31[_0x127b('0x4a')]=_0x49e800;return _0x102d31;})[_0x127b('0x29')](respondWithFilteredResult(_0x2e701a,_0x56e293))[_0x127b('0x4b')](handleError(_0x2e701a,null));};exports[_0x127b('0x4c')]=function(_0x2fd343,_0x5b4e24){var _0x59dca3={'raw':!![],'where':{'id':_0x2fd343['params']['id']}},_0xac6120={};_0xac6120[_0x127b('0x35')]=_['keys'](db[_0x127b('0x31')]['rawAttributes']);_0xac6120[_0x127b('0x38')]=_[_0x127b('0x37')](_0x2fd343[_0x127b('0x38')]);_0xac6120['filters']=_[_0x127b('0x3a')](_0xac6120['model'],_0xac6120[_0x127b('0x38')]);_0x59dca3[_0x127b('0x3c')]=_[_0x127b('0x3a')](_0xac6120[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x2fd343[_0x127b('0x38')]['fields']));_0x59dca3[_0x127b('0x3c')]=_0x59dca3[_0x127b('0x3c')][_0x127b('0x4d')]?_0x59dca3[_0x127b('0x3c')]:_0xac6120[_0x127b('0x35')];if(_0x2fd343[_0x127b('0x38')][_0x127b('0x47')]){_0x59dca3[_0x127b('0x48')]=[{'all':!![]}];}_0x59dca3=_[_0x127b('0x45')]({},_0x59dca3,_0x2fd343[_0x127b('0x46')]);return db['FaxQueue'][_0x127b('0x4e')](_0x59dca3)[_0x127b('0x29')](handleEntityNotFound(_0x5b4e24,null))[_0x127b('0x29')](respondWithResult(_0x5b4e24,null))[_0x127b('0x4b')](handleError(_0x5b4e24,null));};exports[_0x127b('0x4f')]=function(_0x51a66a,_0x1c60c9){return db[_0x127b('0x31')][_0x127b('0x4f')](_0x51a66a['body'],{})[_0x127b('0x29')](function(_0x2fd7d7){var _0x3e3c01=_0x51a66a[_0x127b('0x50')][_0x127b('0x2b')]({'plain':!![]});if(!_0x3e3c01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3c01[_0x127b('0x51')]===_0x127b('0x50')){var _0x3ecb48=_0x2fd7d7[_0x127b('0x2b')]({'plain':!![]});var _0x25421e=_0x127b('0x52');return db['UserProfileSection'][_0x127b('0x4e')]({'where':{'name':_0x25421e,'userProfileId':_0x3e3c01['userProfileId']},'raw':!![]})[_0x127b('0x29')](function(_0x386728){if(_0x386728&&_0x386728['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ecb48[_0x127b('0x2f')],'resourceId':_0x3ecb48['id'],'type':_0x386728[_0x127b('0x2f')],'sectionId':_0x386728['id']},{})[_0x127b('0x29')](function(){return _0x2fd7d7;});}else{return _0x2fd7d7;}})['catch'](function(_0x2d0cb4){logger[_0x127b('0x2d')](_0x127b('0x53'),_0x2d0cb4);throw _0x2d0cb4;});}return _0x2fd7d7;})['then'](respondWithResult(_0x1c60c9,0xc9))[_0x127b('0x4b')](handleError(_0x1c60c9,null));};exports[_0x127b('0x54')]=function(_0x33e3a5,_0x359490){if(_0x33e3a5['body']['id']){delete _0x33e3a5[_0x127b('0x55')]['id'];}return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x33e3a5['params']['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x359490,null))[_0x127b('0x29')](saveUpdates(_0x33e3a5['body'],null))[_0x127b('0x29')](respondWithResult(_0x359490,null))[_0x127b('0x4b')](handleError(_0x359490,null));};exports[_0x127b('0x2a')]=function(_0x3b3fa2,_0x10041e){return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x3b3fa2[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x10041e,null))['then'](removeEntity(_0x10041e,null))[_0x127b('0x4b')](handleError(_0x10041e,null));};exports[_0x127b('0x57')]=function(_0x3e4506,_0x54a026){return db['FaxQueue'][_0x127b('0x57')]()[_0x127b('0x29')](respondWithResult(_0x54a026,null))['catch'](handleError(_0x54a026,null));};exports['getMembers']=function(_0x4a9a75,_0x2e8b89,_0x7480b){var _0x44f91c={'raw':!![],'where':{}},_0x1a9fe5={},_0x1414ab;return db[_0x127b('0x31')][_0x127b('0x58')]({'where':{'id':_0x4a9a75['params']['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x2e8b89,null))[_0x127b('0x29')](function(_0x283877){if(_0x283877){_0x1414ab=_0x283877[_0x127b('0x2b')]({'plain':!![]});_0x1a9fe5[_0x127b('0x35')]=_[_0x127b('0x37')](db[_0x127b('0x59')][_0x127b('0x32')]);_0x1a9fe5['query']=_[_0x127b('0x37')](_0x4a9a75[_0x127b('0x38')]);_0x1a9fe5[_0x127b('0x39')]=_['intersection'](_0x1a9fe5[_0x127b('0x35')],_0x1a9fe5['query']);_0x44f91c['attributes']=_[_0x127b('0x3a')](_0x1a9fe5[_0x127b('0x35')],qs['fields'](_0x4a9a75[_0x127b('0x38')][_0x127b('0x3b')]));_0x44f91c[_0x127b('0x3c')]=_0x44f91c[_0x127b('0x3c')][_0x127b('0x4d')]?_0x44f91c['attributes']:_0x1a9fe5[_0x127b('0x35')];if(!_0x4a9a75[_0x127b('0x38')]['hasOwnProperty']('nolimit')){_0x44f91c[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x4a9a75['query'][_0x127b('0x24')]);_0x44f91c['offset']=qs[_0x127b('0x3e')](_0x4a9a75[_0x127b('0x38')]['offset']);}_0x44f91c[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x4a9a75[_0x127b('0x38')][_0x127b('0x40')]);_0x44f91c['where']=qs[_0x127b('0x39')](_[_0x127b('0x42')](_0x4a9a75[_0x127b('0x38')],_0x1a9fe5[_0x127b('0x39')]));_0x44f91c['where'][_0x127b('0x5a')]=_0x283877['id'];if(_0x4a9a75[_0x127b('0x38')]['filter']){_0x44f91c['where']=_[_0x127b('0x45')](_0x44f91c[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x44f91c[_0x127b('0x3c')],function(_0x199fab){var _0x4ce19c={};_0x4ce19c[_0x199fab]={'$like':'%'+_0x4a9a75[_0x127b('0x38')][_0x127b('0x43')]+'%'};return _0x4ce19c;})});}_0x44f91c=_['merge']({},_0x44f91c,_0x4a9a75[_0x127b('0x46')]);return db[_0x127b('0x59')][_0x127b('0x49')](_0x44f91c);}})['then'](function(_0x49068d){if(_0x49068d){return db[_0x127b('0x5b')][_0x127b('0x5c')]({'where':{'id':_[_0x127b('0x36')](_0x49068d,'UserId'),'role':_0x127b('0x5d')},'attributes':['id','name',_0x127b('0x5e'),_0x127b('0x5f'),_0x127b('0x60')]});}})[_0x127b('0x29')](function(_0x35eada){if(_0x35eada){return{'count':_0x35eada[_0x127b('0x25')],'rows':_['map'](_0x35eada['rows'],function(_0x10d17f){return{'membername':_0x10d17f[_0x127b('0x2f')],'UserId':_0x10d17f['id'],'queue_name':_0x1414ab['name'],'FaxQueueId':_0x1414ab['id'],'interface':util['format'](_0x127b('0x61'),_0x127b('0x62'),_0x10d17f[_0x127b('0x2f')]),'penalty':0x0,'paused':_0x10d17f[_0x127b('0x5e')],'createdAt':_0x10d17f['createdAt'],'updatedAt':_0x10d17f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x127b('0x29')](respondWithFilteredResult(_0x2e8b89,_0x44f91c))[_0x127b('0x4b')](handleError(_0x2e8b89,null));};exports[_0x127b('0x63')]=function(_0x4fdddf,_0x3719cb,_0x22f8ba){var _0x95d015={};var _0x5e98e6={};var _0xd7777c;var _0x3b66f1;return db['FaxQueue'][_0x127b('0x58')]({'where':{'id':_0x4fdddf[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x3719cb,null))['then'](function(_0xce6b9c){if(_0xce6b9c){_0xd7777c=_0xce6b9c;_0x5e98e6[_0x127b('0x35')]=_[_0x127b('0x37')](db['Team'][_0x127b('0x32')]);_0x5e98e6[_0x127b('0x38')]=_[_0x127b('0x37')](_0x4fdddf[_0x127b('0x38')]);_0x5e98e6[_0x127b('0x39')]=_[_0x127b('0x3a')](_0x5e98e6[_0x127b('0x35')],_0x5e98e6[_0x127b('0x38')]);_0x95d015['attributes']=_[_0x127b('0x3a')](_0x5e98e6[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x4fdddf[_0x127b('0x38')][_0x127b('0x3b')]));_0x95d015[_0x127b('0x3c')]=_0x95d015[_0x127b('0x3c')][_0x127b('0x4d')]?_0x95d015['attributes']:_0x5e98e6[_0x127b('0x35')];_0x95d015['order']=qs['sort'](_0x4fdddf[_0x127b('0x38')][_0x127b('0x40')]);_0x95d015[_0x127b('0x41')]=qs[_0x127b('0x39')](_['pick'](_0x4fdddf[_0x127b('0x38')],_0x5e98e6[_0x127b('0x39')]));if(_0x4fdddf[_0x127b('0x38')][_0x127b('0x43')]){_0x95d015[_0x127b('0x41')]=_['merge'](_0x95d015[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x95d015[_0x127b('0x3c')],function(_0x4dbef0){var _0xffd5c4={};_0xffd5c4[_0x4dbef0]={'$like':'%'+_0x4fdddf['query'][_0x127b('0x43')]+'%'};return _0xffd5c4;})});}_0x95d015=_[_0x127b('0x45')]({},_0x95d015,_0x4fdddf['options']);return _0xd7777c[_0x127b('0x63')](_0x95d015);}})[_0x127b('0x29')](function(_0x1d920e){if(_0x1d920e){_0x3b66f1=_0x1d920e[_0x127b('0x4d')];if(!_0x4fdddf[_0x127b('0x38')]['hasOwnProperty'](_0x127b('0x3d'))){_0x95d015[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x4fdddf['query'][_0x127b('0x24')]);_0x95d015[_0x127b('0x3e')]=qs[_0x127b('0x3e')](_0x4fdddf[_0x127b('0x38')]['offset']);}return _0xd7777c[_0x127b('0x63')](_0x95d015);}})[_0x127b('0x29')](function(_0x5cbd3c){if(_0x5cbd3c){return _0x5cbd3c?{'count':_0x3b66f1,'rows':_0x5cbd3c}:null;}})[_0x127b('0x29')](respondWithResult(_0x3719cb,null))[_0x127b('0x4b')](handleError(_0x3719cb,null));};exports[_0x127b('0x64')]=function(_0xcae708,_0xa6a3e3,_0x18327d){var _0x1fe166=_0xcae708[_0x127b('0x55')][_0x127b('0x65')];return db[_0x127b('0x66')]['findAll']({'where':{'id':_0x1fe166},'attributes':['id'],'include':[{'model':db[_0x127b('0x5b')],'as':_0x127b('0x67'),'attributes':['id',_0x127b('0x2f'),_0x127b('0x68'),_0x127b('0x69'),_0x127b('0x6a')],'raw':!![]}]})[_0x127b('0x29')](function(_0x3f0daa){if(_0x3f0daa){var _0x7c17b0=_[_0x127b('0x6b')](_0x3f0daa,function(_0x19be68){var _0x4a4559=_0x19be68[_0x127b('0x2b')]({'plain':!![]});return _0x4a4559[_0x127b('0x67')];});return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0xcae708[_0x127b('0x56')]['id']}})[_0x127b('0x29')](function(_0x59fcf4){return db[_0x127b('0x6c')][_0x127b('0x6d')](function(_0x5032b9){return _0x59fcf4[_0x127b('0x64')](_0x1fe166,{'transaction':_0x5032b9})[_0x127b('0x29')](function(){return BPromise['each'](_0x7c17b0,function(_0x110308){return db[_0x127b('0x59')]['findOrCreate']({'where':{'UserId':_0x110308['id'],'FaxQueueId':_0xcae708[_0x127b('0x56')]['id']},'transaction':_0x5032b9});});})[_0x127b('0x29')](function(){_0x7c17b0['forEach'](function(_0x1ecb1f){socket['emit'](_0x127b('0x6e'),{'UserId':_0x1ecb1f['id'],'FaxQueueId':_0x59fcf4['id']});});});});});}})[_0x127b('0x29')](respondWithStatusCode(_0xa6a3e3,null))[_0x127b('0x4b')](handleError(_0xa6a3e3,null));};exports[_0x127b('0x6f')]=function(_0x4c0add,_0x49c583,_0x5a81d0){return db['Team']['findAll']({'where':{'id':_0x4c0add[_0x127b('0x38')][_0x127b('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x49c583,null))[_0x127b('0x29')](function(_0x591413){var _0x1f96ee=_[_0x127b('0x36')](_0x591413,'id');var _0x4196ae=[];var _0x3ee4fe=[];var _0x3d2f0f=squel[_0x127b('0x70')]();_0x3d2f0f[_0x127b('0x71')](_0x127b('0x72'))[_0x127b('0x73')](_0x127b('0x74'),'tq')[_0x127b('0x75')](_0x127b('0x76'),'ut',_0x127b('0x77'))[_0x127b('0x41')](_0x127b('0x78'),_0x4c0add['params']['id']);for(var _0x5fe1dd=0x0;_0x5fe1dd<_0x591413['length'];_0x5fe1dd+=0x1){let _0x4e736c=_0x591413[_0x5fe1dd];for(var _0x1d0639=0x0;_0x1d0639<_0x4e736c[_0x127b('0x67')][_0x127b('0x4d')];_0x1d0639+=0x1){let _0x240aa2=_0x4e736c[_0x127b('0x67')][_0x1d0639];var _0x33473e=_0x3d2f0f[_0x127b('0x79')]();_0x33473e[_0x127b('0x41')]('ut.UserId\x20=\x20?',_0x240aa2['id']);_0x3ee4fe[_0x127b('0x7a')](db[_0x127b('0x6c')][_0x127b('0x38')](_0x33473e[_0x127b('0x7b')](),{'type':db['sequelize'][_0x127b('0x7c')][_0x127b('0x7d')]})[_0x127b('0x29')](function(_0x41a099){if(_0x41a099[_0x127b('0x4d')]===0x1){return _0x240aa2['id'];}else{var _0x4e9f93=_[_0x127b('0x7e')](_[_0x127b('0x36')](_0x41a099,_0x127b('0x7f')),function(_0x3eb368){return _[_0x127b('0x80')](_0x1f96ee,_0x3eb368);});if(_0x4e9f93){return _0x240aa2['id'];}}}));}}return BPromise[_0x127b('0x81')](_0x3ee4fe)[_0x127b('0x29')](function(_0x2e6360){_0x4196ae=_(_0x4196ae)[_0x127b('0x82')](_0x2e6360)[_0x127b('0x83')]()[_0x127b('0x84')]();return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x4c0add[_0x127b('0x56')]['id']}})[_0x127b('0x29')](function(_0xd48663){return db['sequelize'][_0x127b('0x6d')](function(_0x503d23){return _0xd48663['removeTeams'](_0x4c0add[_0x127b('0x38')][_0x127b('0x65')],{'transaction':_0x503d23})[_0x127b('0x29')](function(){if(!_[_0x127b('0x85')](_0x4196ae)){return _0xd48663[_0x127b('0x86')](_0x4196ae,{'transaction':_0x503d23});}})['then'](function(){_0x4196ae[_0x127b('0x87')](function(_0x3a97e0){socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':_0x3a97e0,'FaxQueueId':_0xd48663['id']});});});});});});})[_0x127b('0x29')](respondWithStatusCode(_0x49c583,null))[_0x127b('0x4b')](handleError(_0x49c583,null));};exports['addAgents']=function(_0x19d0fb,_0xc05dec,_0xb71272){return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x19d0fb[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0xc05dec,null))[_0x127b('0x29')](function(_0x24fcc9){if(_0x24fcc9){return _0x24fcc9[_0x127b('0x8a')](_0x19d0fb['body'][_0x127b('0x65')],_[_0x127b('0x8b')](_0x19d0fb[_0x127b('0x55')],['ids','id'])||{})[_0x127b('0x8c')](function(_0x50aea0){for(var _0x3aaf0a=0x0;_0x3aaf0a<_0x19d0fb[_0x127b('0x55')][_0x127b('0x65')]['length'];_0x3aaf0a+=0x1){socket[_0x127b('0x88')](_0x127b('0x6e'),{'UserId':Number(_0x19d0fb['body'][_0x127b('0x65')][_0x3aaf0a]),'FaxQueueId':Number(_0x19d0fb['params']['id'])});}return _0x50aea0;});}})[_0x127b('0x29')](respondWithResult(_0xc05dec,null))[_0x127b('0x4b')](handleError(_0xc05dec,null));};exports[_0x127b('0x86')]=function(_0x106e89,_0x2eb44c,_0x3c0c54){return db[_0x127b('0x31')]['find']({'where':{'id':_0x106e89['params']['id']}})['then'](handleEntityNotFound(_0x2eb44c,null))[_0x127b('0x29')](function(_0x1fa720){if(_0x1fa720){return _0x1fa720[_0x127b('0x86')](_0x106e89[_0x127b('0x38')][_0x127b('0x65')])[_0x127b('0x29')](function(){if(_[_0x127b('0x8d')](_0x106e89[_0x127b('0x38')][_0x127b('0x65')])){for(var _0x5053a9=0x0;_0x5053a9<_0x106e89[_0x127b('0x38')][_0x127b('0x65')][_0x127b('0x4d')];_0x5053a9+=0x1){socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':Number(_0x106e89[_0x127b('0x38')][_0x127b('0x65')][_0x5053a9]),'FaxQueueId':Number(_0x106e89[_0x127b('0x56')]['id'])});}}else{socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':Number(_0x106e89[_0x127b('0x38')][_0x127b('0x65')]),'FaxQueueId':Number(_0x106e89[_0x127b('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x2eb44c,null))[_0x127b('0x4b')](handleError(_0x2eb44c,null));};exports[_0x127b('0x8e')]=function(_0x3b2996,_0x5d72c9,_0x262f58){var _0xd4834f={};var _0xe866d5={};var _0x2fc9fc;var _0x1ac304;return db[_0x127b('0x31')][_0x127b('0x58')]({'where':{'id':_0x3b2996[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x5d72c9,null))['then'](function(_0x1ddf9f){if(_0x1ddf9f){_0x2fc9fc=_0x1ddf9f;_0xe866d5['model']=_[_0x127b('0x37')](db[_0x127b('0x5b')]['rawAttributes']);_0xe866d5['query']=_[_0x127b('0x37')](_0x3b2996[_0x127b('0x38')]);_0xe866d5['filters']=_[_0x127b('0x3a')](_0xe866d5[_0x127b('0x35')],_0xe866d5[_0x127b('0x38')]);_0xd4834f[_0x127b('0x3c')]=_[_0x127b('0x3a')](_0xe866d5[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x3b2996[_0x127b('0x38')][_0x127b('0x3b')]));_0xd4834f[_0x127b('0x3c')]=_0xd4834f[_0x127b('0x3c')][_0x127b('0x4d')]?_0xd4834f['attributes']:_0xe866d5[_0x127b('0x35')];_0xd4834f[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x3b2996[_0x127b('0x38')][_0x127b('0x40')]);_0xd4834f[_0x127b('0x41')]=qs[_0x127b('0x39')](_[_0x127b('0x42')](_0x3b2996[_0x127b('0x38')],_0xe866d5[_0x127b('0x39')]));if(_0x3b2996['query'][_0x127b('0x43')]){_0xd4834f[_0x127b('0x41')]=_[_0x127b('0x45')](_0xd4834f['where'],{'$or':_['map'](_0xd4834f[_0x127b('0x3c')],function(_0xc98fc){var _0x4ee23d={};_0x4ee23d[_0xc98fc]={'$like':'%'+_0x3b2996[_0x127b('0x38')][_0x127b('0x43')]+'%'};return _0x4ee23d;})});}_0xd4834f=_[_0x127b('0x45')]({},_0xd4834f,_0x3b2996[_0x127b('0x46')]);return _0x2fc9fc[_0x127b('0x8e')](_0xd4834f);}})['then'](function(_0x55bfc0){if(_0x55bfc0){_0x1ac304=_0x55bfc0[_0x127b('0x4d')];if(!_0x3b2996['query']['hasOwnProperty']('nolimit')){_0xd4834f[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x3b2996['query'][_0x127b('0x24')]);_0xd4834f[_0x127b('0x3e')]=qs[_0x127b('0x3e')](_0x3b2996[_0x127b('0x38')][_0x127b('0x3e')]);}return _0x2fc9fc[_0x127b('0x8e')](_0xd4834f);}})[_0x127b('0x29')](function(_0x3d87d6){if(_0x3d87d6){return _0x3d87d6?{'count':_0x1ac304,'rows':_0x3d87d6}:null;}})[_0x127b('0x29')](respondWithResult(_0x5d72c9,null))[_0x127b('0x4b')](handleError(_0x5d72c9,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c64037d..22d982b 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 _0x0379=['hook','exports','events','../../mysqldb','FaxQueue','remove','emit','hasOwnProperty'];(function(_0x2e1952,_0x567598){var _0x3788eb=function(_0xebd732){while(--_0xebd732){_0x2e1952['push'](_0x2e1952['shift']());}};_0x3788eb(++_0x567598);}(_0x0379,0x18a));var _0x9037=function(_0xf17d31,_0xf600d4){_0xf17d31=_0xf17d31-0x0;var _0x355e19=_0x0379[_0xf17d31];return _0x355e19;};'use strict';var EventEmitter=require(_0x9037('0x0'));var FaxQueue=require(_0x9037('0x1'))['db'][_0x9037('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9037('0x3')};function emitEvent(_0x2f635c){return function(_0x3904ba,_0x5045cb,_0x487e9d){FaxQueueEvents['emit'](_0x2f635c+':'+_0x3904ba['id'],_0x3904ba);FaxQueueEvents[_0x9037('0x4')](_0x2f635c,_0x3904ba);_0x487e9d(null);};}for(var e in events){if(events[_0x9037('0x5')](e)){var event=events[e];FaxQueue[_0x9037('0x6')](e,emitEvent(event));}}module[_0x9037('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x3d86=['hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x510ef9,_0x58f37b){var _0x3c6558=function(_0xa1b305){while(--_0xa1b305){_0x510ef9['push'](_0x510ef9['shift']());}};_0x3c6558(++_0x58f37b);}(_0x3d86,0xbf));var _0x63d8=function(_0xd030f8,_0x20b5a7){_0xd030f8=_0xd030f8-0x0;var _0x488519=_0x3d86[_0xd030f8];return _0x488519;};'use strict';var EventEmitter=require(_0x63d8('0x0'));var FaxQueue=require(_0x63d8('0x1'))['db'][_0x63d8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x63d8('0x3')](0x0);var events={'afterCreate':_0x63d8('0x4'),'afterUpdate':_0x63d8('0x5'),'afterDestroy':_0x63d8('0x6')};function emitEvent(_0x590958){return function(_0x484b2f,_0x367b8b,_0x983ac1){FaxQueueEvents['emit'](_0x590958+':'+_0x484b2f['id'],_0x484b2f);FaxQueueEvents[_0x63d8('0x7')](_0x590958,_0x484b2f);_0x983ac1(null);};}for(var e in events){if(events[_0x63d8('0x8')](e)){var event=events[e];FaxQueue[_0x63d8('0x9')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index aff8d57..8089ab0 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 _0xe288=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','lodash','util','api','bluebird'];(function(_0x3d1269,_0x30cfa1){var _0x5d31b1=function(_0x490e25){while(--_0x490e25){_0x3d1269['push'](_0x3d1269['shift']());}};_0x5d31b1(++_0x30cfa1);}(_0xe288,0xb7));var _0x8e28=function(_0x21d242,_0x21e56c){_0x21d242=_0x21d242-0x0;var _0x1e89a6=_0xe288[_0x21d242];return _0x1e89a6;};'use strict';var _=require(_0x8e28('0x0'));var util=require(_0x8e28('0x1'));var logger=require('../../config/logger')(_0x8e28('0x2'));var moment=require('moment');var BPromise=require(_0x8e28('0x3'));var rp=require(_0x8e28('0x4'));var fs=require('fs');var path=require(_0x8e28('0x5'));var rimraf=require(_0x8e28('0x6'));var config=require(_0x8e28('0x7'));var attributes=require(_0x8e28('0x8'));module['exports']=function(_0x12bc99,_0x4f9997){return _0x12bc99[_0x8e28('0x9')](_0x8e28('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6afc=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x369f7b,_0x4325f0){var _0x4a46b9=function(_0x327df8){while(--_0x327df8){_0x369f7b['push'](_0x369f7b['shift']());}};_0x4a46b9(++_0x4325f0);}(_0x6afc,0xdf));var _0xc6af=function(_0x629258,_0x7302e1){_0x629258=_0x629258-0x0;var _0x1aa316=_0x6afc[_0x629258];return _0x1aa316;};'use strict';var _=require(_0xc6af('0x0'));var util=require(_0xc6af('0x1'));var logger=require(_0xc6af('0x2'))(_0xc6af('0x3'));var moment=require(_0xc6af('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6af('0x6'));var config=require(_0xc6af('0x7'));var attributes=require(_0xc6af('0x8'));module[_0xc6af('0x9')]=function(_0x4a7b41,_0x1487d8){return _0x4a7b41[_0xc6af('0xa')](_0xc6af('0xb'),attributes,{'tableName':_0xc6af('0xc'),'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 7ebf60a..3416e8f 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 _0xc7e0=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','GetFaxQueue','FaxQueue','options','where','limit','include','map','attributes','model','debug','catch','ShowFaxQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0xc7e0,0xed));var _0x0c7e=function(_0x382c19,_0x224ae4){_0x382c19=_0x382c19-0x0;var _0x3cb34f=_0xc7e0[_0x382c19];return _0x3cb34f;};'use strict';var _=require('lodash');var util=require(_0x0c7e('0x0'));var moment=require(_0x0c7e('0x1'));var BPromise=require(_0x0c7e('0x2'));var rs=require(_0x0c7e('0x3'));var fs=require('fs');var Redis=require(_0x0c7e('0x4'));var db=require(_0x0c7e('0x5'))['db'];var utils=require(_0x0c7e('0x6'));var logger=require(_0x0c7e('0x7'))('rpc');var config=require(_0x0c7e('0x8'));var jayson=require(_0x0c7e('0x9'));var client=jayson[_0x0c7e('0xa')]['http']({'port':0x232a});config[_0x0c7e('0xb')]=_[_0x0c7e('0xc')](config['redis'],{'host':_0x0c7e('0xd'),'port':0x18eb});var socket=require(_0x0c7e('0xe'))(new Redis(config[_0x0c7e('0xb')]));require(_0x0c7e('0xf'))[_0x0c7e('0x10')](socket);function respondWithRpcPromise(_0x41c828,_0x11d83a,_0x1998d6){return new BPromise(function(_0x2500d2,_0x4de4d4){return client[_0x0c7e('0x11')](_0x41c828,_0x1998d6)[_0x0c7e('0x12')](function(_0x4e4500){logger[_0x0c7e('0x13')]('FaxQueue,\x20%s,\x20%s',_0x11d83a,'request\x20sent');logger['debug'](_0x0c7e('0x14'),_0x11d83a,_0x0c7e('0x15'),JSON[_0x0c7e('0x16')](_0x4e4500));if(_0x4e4500[_0x0c7e('0x17')]){if(_0x4e4500[_0x0c7e('0x17')][_0x0c7e('0x18')]===0x1f4){logger[_0x0c7e('0x17')](_0x0c7e('0x19'),_0x11d83a,_0x4e4500[_0x0c7e('0x17')][_0x0c7e('0x1a')]);return _0x4de4d4(_0x4e4500[_0x0c7e('0x17')][_0x0c7e('0x1a')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x11d83a,_0x4e4500[_0x0c7e('0x17')][_0x0c7e('0x1a')]);return _0x2500d2(_0x4e4500[_0x0c7e('0x17')][_0x0c7e('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x11d83a,_0x0c7e('0x15'));_0x2500d2(_0x4e4500['result'][_0x0c7e('0x1a')]);}})['catch'](function(_0x211d4c){logger[_0x0c7e('0x17')](_0x0c7e('0x19'),_0x11d83a,_0x211d4c);_0x4de4d4(_0x211d4c);});});}exports[_0x0c7e('0x1b')]=function(_0x41a52b){var _0x36ab03=this;return new Promise(function(_0x47872b,_0x4aba95){return db[_0x0c7e('0x1c')]['findAll']({'raw':_0x41a52b[_0x0c7e('0x1d')]?_0x41a52b[_0x0c7e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x41a52b['options']?_0x41a52b[_0x0c7e('0x1d')][_0x0c7e('0x1e')]||null:null,'attributes':_0x41a52b[_0x0c7e('0x1d')]?_0x41a52b[_0x0c7e('0x1d')]['attributes']||null:null,'limit':_0x41a52b[_0x0c7e('0x1d')]?_0x41a52b[_0x0c7e('0x1d')][_0x0c7e('0x1f')]||null:null,'include':_0x41a52b['options']?_0x41a52b[_0x0c7e('0x1d')][_0x0c7e('0x20')]?_[_0x0c7e('0x21')](_0x41a52b[_0x0c7e('0x1d')][_0x0c7e('0x20')],function(_0x4e34b2){return{'model':db[_0x4e34b2['model']],'as':_0x4e34b2['as'],'attributes':_0x4e34b2[_0x0c7e('0x22')],'include':_0x4e34b2[_0x0c7e('0x20')]?_[_0x0c7e('0x21')](_0x4e34b2[_0x0c7e('0x20')],function(_0x13c89d){return{'model':db[_0x13c89d[_0x0c7e('0x23')]],'as':_0x13c89d['as'],'attributes':_0x13c89d[_0x0c7e('0x22')],'include':_0x13c89d[_0x0c7e('0x20')]?_[_0x0c7e('0x21')](_0x13c89d['include'],function(_0x14a078){return{'model':db[_0x14a078['model']],'as':_0x14a078['as'],'attributes':_0x14a078['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c7e('0x12')](function(_0x29bb01){logger[_0x0c7e('0x13')](_0x0c7e('0x1b'),_0x41a52b);logger[_0x0c7e('0x24')](_0x0c7e('0x1b'),_0x41a52b,JSON['stringify'](_0x29bb01));_0x47872b(_0x29bb01);})[_0x0c7e('0x25')](function(_0x2cc475){logger['error'](_0x0c7e('0x1b'),_0x2cc475['message'],_0x41a52b);_0x4aba95(_0x36ab03['error'](0x1f4,_0x2cc475[_0x0c7e('0x1a')]));});});};exports[_0x0c7e('0x26')]=function(_0x720891){var _0x375973=this;return new Promise(function(_0x306f22,_0x5733a7){return db[_0x0c7e('0x1c')][_0x0c7e('0x27')]({'raw':_0x720891[_0x0c7e('0x1d')]?_0x720891[_0x0c7e('0x1d')][_0x0c7e('0x28')]===undefined?!![]:![]:!![],'where':_0x720891[_0x0c7e('0x1d')]?_0x720891[_0x0c7e('0x1d')][_0x0c7e('0x1e')]||null:null,'attributes':_0x720891[_0x0c7e('0x1d')]?_0x720891[_0x0c7e('0x1d')][_0x0c7e('0x22')]||null:null,'include':_0x720891['options']?_0x720891[_0x0c7e('0x1d')][_0x0c7e('0x20')]?_['map'](_0x720891['options'][_0x0c7e('0x20')],function(_0x228555){return{'model':db[_0x228555[_0x0c7e('0x23')]],'as':_0x228555['as'],'attributes':_0x228555[_0x0c7e('0x22')],'include':_0x228555[_0x0c7e('0x20')]?_[_0x0c7e('0x21')](_0x228555['include'],function(_0x5983df){return{'model':db[_0x5983df[_0x0c7e('0x23')]],'as':_0x5983df['as'],'attributes':_0x5983df['attributes'],'include':_0x5983df[_0x0c7e('0x20')]?_[_0x0c7e('0x21')](_0x5983df['include'],function(_0x46dc63){return{'model':db[_0x46dc63[_0x0c7e('0x23')]],'as':_0x46dc63['as'],'attributes':_0x46dc63[_0x0c7e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0c7e('0x12')](function(_0x47f358){logger[_0x0c7e('0x13')](_0x0c7e('0x26'),_0x720891);logger[_0x0c7e('0x24')]('ShowFaxQueue',_0x720891,JSON['stringify'](_0x47f358));_0x306f22(_0x47f358);})[_0x0c7e('0x25')](function(_0x338326){logger[_0x0c7e('0x17')](_0x0c7e('0x26'),_0x338326[_0x0c7e('0x1a')],_0x720891);_0x5733a7(_0x375973[_0x0c7e('0x17')](0x1f4,_0x338326[_0x0c7e('0x1a')]));});});}; \ No newline at end of file +var _0xa9ac=['map','model','include','GetFaxQueue','ShowFaxQueue','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FaxQueue','findAll','options','raw','where','attributes','limit'];(function(_0x2bdab2,_0x3bb6ce){var _0x12c028=function(_0x57cab8){while(--_0x57cab8){_0x2bdab2['push'](_0x2bdab2['shift']());}};_0x12c028(++_0x3bb6ce);}(_0xa9ac,0x140));var _0xca9a=function(_0x3da2d4,_0x4f2fbe){_0x3da2d4=_0x3da2d4-0x0;var _0x4a99f5=_0xa9ac[_0x3da2d4];return _0x4a99f5;};'use strict';var _=require(_0xca9a('0x0'));var util=require(_0xca9a('0x1'));var moment=require(_0xca9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9a('0x3'))['db'];var utils=require(_0xca9a('0x4'));var logger=require(_0xca9a('0x5'))('rpc');var config=require(_0xca9a('0x6'));var jayson=require(_0xca9a('0x7'));var client=jayson[_0xca9a('0x8')][_0xca9a('0x9')]({'port':0x232a});config[_0xca9a('0xa')]=_[_0xca9a('0xb')](config[_0xca9a('0xa')],{'host':_0xca9a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca9a('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x308213,_0xe45530,_0x527f82){return new BPromise(function(_0x1d8d2d,_0x1f9e7d){return client[_0xca9a('0xd')](_0x308213,_0x527f82)[_0xca9a('0xe')](function(_0x5e445f){logger[_0xca9a('0xf')](_0xca9a('0x10'),_0xe45530,_0xca9a('0x11'));logger['debug'](_0xca9a('0x12'),_0xe45530,_0xca9a('0x11'),JSON[_0xca9a('0x13')](_0x5e445f));if(_0x5e445f['error']){if(_0x5e445f[_0xca9a('0x14')]['code']===0x1f4){logger[_0xca9a('0x14')](_0xca9a('0x10'),_0xe45530,_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);return _0x1f9e7d(_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);}logger[_0xca9a('0x14')](_0xca9a('0x10'),_0xe45530,_0x5e445f['error']['message']);return _0x1d8d2d(_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);}else{logger['info'](_0xca9a('0x10'),_0xe45530,_0xca9a('0x11'));_0x1d8d2d(_0x5e445f['result'][_0xca9a('0x15')]);}})[_0xca9a('0x16')](function(_0xed1a3d){logger['error'](_0xca9a('0x10'),_0xe45530,_0xed1a3d);_0x1f9e7d(_0xed1a3d);});});}exports['GetFaxQueue']=function(_0x5e7bce){var _0x53aff8=this;return new Promise(function(_0x5514fc,_0x3f6f37){return db[_0xca9a('0x17')][_0xca9a('0x18')]({'raw':_0x5e7bce['options']?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e7bce['options']?_0x5e7bce['options'][_0xca9a('0x1b')]||null:null,'attributes':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1c')]||null:null,'limit':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1d')]||null:null,'include':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce['options']['include']?_[_0xca9a('0x1e')](_0x5e7bce[_0xca9a('0x19')]['include'],function(_0x46fc69){return{'model':db[_0x46fc69[_0xca9a('0x1f')]],'as':_0x46fc69['as'],'attributes':_0x46fc69[_0xca9a('0x1c')],'include':_0x46fc69[_0xca9a('0x20')]?_[_0xca9a('0x1e')](_0x46fc69[_0xca9a('0x20')],function(_0x4bc633){return{'model':db[_0x4bc633['model']],'as':_0x4bc633['as'],'attributes':_0x4bc633[_0xca9a('0x1c')],'include':_0x4bc633[_0xca9a('0x20')]?_[_0xca9a('0x1e')](_0x4bc633[_0xca9a('0x20')],function(_0x3adffb){return{'model':db[_0x3adffb[_0xca9a('0x1f')]],'as':_0x3adffb['as'],'attributes':_0x3adffb[_0xca9a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xca9a('0xe')](function(_0x3878c5){logger[_0xca9a('0xf')]('GetFaxQueue',_0x5e7bce);logger['debug'](_0xca9a('0x21'),_0x5e7bce,JSON['stringify'](_0x3878c5));_0x5514fc(_0x3878c5);})[_0xca9a('0x16')](function(_0x52078c){logger[_0xca9a('0x14')](_0xca9a('0x21'),_0x52078c[_0xca9a('0x15')],_0x5e7bce);_0x3f6f37(_0x53aff8[_0xca9a('0x14')](0x1f4,_0x52078c['message']));});});};exports[_0xca9a('0x22')]=function(_0x5307b8){var _0xf844e6=this;return new Promise(function(_0xa31add,_0x4dc19d){return db[_0xca9a('0x17')]['find']({'raw':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')][_0xca9a('0x1b')]||null:null,'attributes':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')][_0xca9a('0x1c')]||null:null,'include':_0x5307b8[_0xca9a('0x19')]?_0x5307b8['options']['include']?_[_0xca9a('0x1e')](_0x5307b8[_0xca9a('0x19')][_0xca9a('0x20')],function(_0x8fd954){return{'model':db[_0x8fd954['model']],'as':_0x8fd954['as'],'attributes':_0x8fd954[_0xca9a('0x1c')],'include':_0x8fd954['include']?_[_0xca9a('0x1e')](_0x8fd954[_0xca9a('0x20')],function(_0x1e563c){return{'model':db[_0x1e563c['model']],'as':_0x1e563c['as'],'attributes':_0x1e563c[_0xca9a('0x1c')],'include':_0x1e563c['include']?_[_0xca9a('0x1e')](_0x1e563c[_0xca9a('0x20')],function(_0x293374){return{'model':db[_0x293374[_0xca9a('0x1f')]],'as':_0x293374['as'],'attributes':_0x293374[_0xca9a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xca9a('0xe')](function(_0x32138e){logger[_0xca9a('0xf')](_0xca9a('0x22'),_0x5307b8);logger['debug'](_0xca9a('0x22'),_0x5307b8,JSON[_0xca9a('0x13')](_0x32138e));_0xa31add(_0x32138e);})[_0xca9a('0x16')](function(_0x3ad98c){logger['error'](_0xca9a('0x22'),_0x3ad98c[_0xca9a('0x15')],_0x5307b8);_0x4dc19d(_0xf844e6[_0xca9a('0x14')](0x1f4,_0x3ad98c[_0xca9a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f3fbbb7..18a684c 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 _0x14d8=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x14d8,0x9f));var _0x814d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x14d8[_0x21a9d9];return _0x46adce;};'use strict';var FaxQueueEvents=require(_0x814d('0x0'));var events=[_0x814d('0x1'),_0x814d('0x2'),_0x814d('0x3')];function createListener(_0x1a89e8,_0xab454c){return function(_0x469ea5){_0xab454c[_0x814d('0x4')](_0x1a89e8,_0x469ea5);};}function removeListener(_0x15d388,_0x82af2c){return function(){FaxQueueEvents[_0x814d('0x5')](_0x15d388,_0x82af2c);};}exports[_0x814d('0x6')]=function(_0x2ca1eb){for(var _0x39fe1e=0x0,_0x345dd9=events[_0x814d('0x7')];_0x39fe1e<_0x345dd9;_0x39fe1e++){var _0x5129ce=events[_0x39fe1e];var _0x4bb8f8=createListener(_0x814d('0x8')+_0x5129ce,_0x2ca1eb);FaxQueueEvents['on'](_0x5129ce,_0x4bb8f8);}}; \ No newline at end of file +var _0x4ab1=['emit','removeListener','register','length','./faxQueue.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ab1,0x6d));var _0x14ab=function(_0x437894,_0x29d1be){_0x437894=_0x437894-0x0;var _0x25322b=_0x4ab1[_0x437894];return _0x25322b;};'use strict';var FaxQueueEvents=require(_0x14ab('0x0'));var events=[_0x14ab('0x1'),'remove',_0x14ab('0x2')];function createListener(_0x2cc532,_0x5da392){return function(_0x426839){_0x5da392[_0x14ab('0x3')](_0x2cc532,_0x426839);};}function removeListener(_0x472d15,_0x33b55c){return function(){FaxQueueEvents[_0x14ab('0x4')](_0x472d15,_0x33b55c);};}exports[_0x14ab('0x5')]=function(_0x54c341){for(var _0x3b5de3=0x0,_0x1120cd=events[_0x14ab('0x6')];_0x3b5de3<_0x1120cd;_0x3b5de3++){var _0x4c496d=events[_0x3b5de3];var _0x208d32=createListener('faxQueue:'+_0x4c496d,_0x54c341);FaxQueueEvents['on'](_0x4c496d,_0x208d32);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2b58730..07b67b7 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 _0x9f0e=['destroy','/:id/teams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','getTeams','post','create','/:id/users','put','delete'];(function(_0x193492,_0x1ae582){var _0x21a1ed=function(_0x42f3b3){while(--_0x42f3b3){_0x193492['push'](_0x193492['shift']());}};_0x21a1ed(++_0x1ae582);}(_0x9f0e,0x116));var _0xe9f0=function(_0x46e54c,_0x2722bf){_0x46e54c=_0x46e54c-0x0;var _0x58a495=_0x9f0e[_0x46e54c];return _0x58a495;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/teams',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x9')]('/:id/users',auth[_0xe9f0('0xb')](),controller['getAgents']);router[_0xe9f0('0x11')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x12')]);router[_0xe9f0('0x11')]('/:id/teams',auth[_0xe9f0('0xb')](),controller['addTeams']);router[_0xe9f0('0x11')](_0xe9f0('0x13'),auth[_0xe9f0('0xb')](),controller['addAgents']);router[_0xe9f0('0x14')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller['update']);router[_0xe9f0('0x15')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x16')]);router[_0xe9f0('0x15')](_0xe9f0('0x17'),auth[_0xe9f0('0xb')](),controller['removeTeams']);router[_0xe9f0('0x15')](_0xe9f0('0x13'),auth[_0xe9f0('0xb')](),controller['removeAgents']);module[_0xe9f0('0x18')]=router; \ No newline at end of file +var _0x27a0=['/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete','exports','util','path','connect-timeout','express','Router','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x27a0,0xbf));var _0x027a=function(_0x2473ce,_0x2ca2a6){_0x2473ce=_0x2473ce-0x0;var _0x30f41e=_0x27a0[_0x2473ce];return _0x30f41e;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x027a('0x5'));router[_0x027a('0x6')]('/',auth[_0x027a('0x7')](),controller[_0x027a('0x8')]);router[_0x027a('0x6')](_0x027a('0x9'),auth['isAuthenticated'](),controller[_0x027a('0xa')]);router[_0x027a('0x6')](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0xc')]);router[_0x027a('0x6')](_0x027a('0xd'),auth['isAuthenticated'](),controller[_0x027a('0xe')]);router[_0x027a('0x6')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x10')]);router[_0x027a('0x6')](_0x027a('0x11'),auth[_0x027a('0x7')](),controller[_0x027a('0x12')]);router[_0x027a('0x13')]('/',auth[_0x027a('0x7')](),controller['create']);router[_0x027a('0x13')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x14')]);router[_0x027a('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x027a('0x15')]);router['put'](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x027a('0x17')]);router[_0x027a('0x18')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller['removeTeams']);router[_0x027a('0x18')](_0x027a('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x027a('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index ab9e62e..eb795e6 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 _0x29ae=['STRING','DATE','moment'];(function(_0x8052d,_0x393d4e){var _0x3c1ea1=function(_0x559ff4){while(--_0x559ff4){_0x8052d['push'](_0x8052d['shift']());}};_0x3c1ea1(++_0x393d4e);}(_0x29ae,0x167));var _0xe29a=function(_0x18c887,_0x30ff50){_0x18c887=_0x18c887-0x0;var _0x502760=_0x29ae[_0x18c887];return _0x502760;};'use strict';var moment=require(_0xe29a('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe29a('0x1')]},'joinAt':{'type':Sequelize[_0xe29a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe29a('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe29a('0x1')]}}; \ No newline at end of file +var _0xe3be=['STRING','DATE','moment','sequelize','exports'];(function(_0x2e7048,_0x3ba77d){var _0x60dddb=function(_0x48e314){while(--_0x48e314){_0x2e7048['push'](_0x2e7048['shift']());}};_0x60dddb(++_0x3ba77d);}(_0xe3be,0x93));var _0xee3b=function(_0x57fbf9,_0x25d30c){_0x57fbf9=_0x57fbf9-0x0;var _0x115323=_0xe3be[_0x57fbf9];return _0x115323;};'use strict';var moment=require(_0xee3b('0x0'));var Sequelize=require(_0xee3b('0x1'));module[_0xee3b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xee3b('0x3')]},'joinAt':{'type':Sequelize[_0xee3b('0x4')]},'leaveAt':{'type':Sequelize[_0xee3b('0x4')]},'acceptAt':{'type':Sequelize[_0xee3b('0x4')]},'exitAt':{'type':Sequelize[_0xee3b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9eaf61c..56db160 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 _0xd66c=['index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x5ecf50,_0x203ab4){var _0x50ef1b=function(_0x1f90c6){while(--_0x1f90c6){_0x5ecf50['push'](_0x5ecf50['shift']());}};_0x50ef1b(++_0x203ab4);}(_0xd66c,0x106));var _0xcd66=function(_0x4cfbc9,_0x1d6b1d){_0x4cfbc9=_0x4cfbc9-0x0;var _0x458897=_0xd66c[_0x4cfbc9];return _0x458897;};'use strict';var emlformat=require(_0xcd66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x1'));var jsonpatch=require(_0xcd66('0x2'));var rp=require(_0xcd66('0x3'));var moment=require(_0xcd66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x5'));var util=require(_0xcd66('0x6'));var path=require(_0xcd66('0x7'));var sox=require(_0xcd66('0x8'));var csv=require(_0xcd66('0x9'));var ejs=require(_0xcd66('0xa'));var fs=require('fs');var fs_extra=require(_0xcd66('0xb'));var _=require(_0xcd66('0xc'));var squel=require('squel');var crypto=require(_0xcd66('0xd'));var jsforce=require(_0xcd66('0xe'));var deskjs=require(_0xcd66('0xf'));var toCsv=require(_0xcd66('0x9'));var querystring=require(_0xcd66('0x10'));var Papa=require(_0xcd66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd66('0x13'));var logger=require(_0xcd66('0x14'))('api');var utils=require(_0xcd66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd66('0x16'));var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1cb4a9,_0x3e4e92){_0x3e4e92=_0x3e4e92||0xcc;return function(_0x35479d){if(_0x35479d){return _0x1cb4a9['sendStatus'](_0x3e4e92);}return _0x1cb4a9['status'](_0x3e4e92)[_0xcd66('0x18')]();};}function respondWithResult(_0x5d9bb4,_0x28ae0c){_0x28ae0c=_0x28ae0c||0xc8;return function(_0x588b46){if(_0x588b46){return _0x5d9bb4['status'](_0x28ae0c)[_0xcd66('0x19')](_0x588b46);}};}function respondWithFilteredResult(_0x1fafad,_0x4df4df){return function(_0x3178a7){if(_0x3178a7){var _0x3ed659=typeof _0x4df4df[_0xcd66('0x1a')]==='undefined'&&typeof _0x4df4df[_0xcd66('0x1b')]==='undefined';var _0x1268db=_0x3178a7[_0xcd66('0x1c')];var _0x191f8e=_0x3ed659?0x0:_0x4df4df[_0xcd66('0x1a')];var _0x35d431=_0x3ed659?_0x3178a7[_0xcd66('0x1c')]:_0x4df4df[_0xcd66('0x1a')]+_0x4df4df[_0xcd66('0x1b')];var _0x417907;if(_0x35d431>=_0x1268db){_0x35d431=_0x1268db;_0x417907=0xc8;}else{_0x417907=0xce;}_0x1fafad[_0xcd66('0x1d')](_0x417907);return _0x1fafad[_0xcd66('0x1e')](_0xcd66('0x1f'),_0x191f8e+'-'+_0x35d431+'/'+_0x1268db)[_0xcd66('0x19')](_0x3178a7);}return null;};}function patchUpdates(_0x2d3819){return function(_0x842033){try{jsonpatch['apply'](_0x842033,_0x2d3819,!![]);}catch(_0x3e3bea){return BPromise[_0xcd66('0x20')](_0x3e3bea);}return _0x842033[_0xcd66('0x21')]();};}function saveUpdates(_0x11c75c,_0x1cc184){return function(_0x1f8a04){if(_0x1f8a04){return _0x1f8a04[_0xcd66('0x22')](_0x11c75c)[_0xcd66('0x23')](function(_0x64424a){return _0x64424a;});}return null;};}function removeEntity(_0x35e19e,_0x5ec2d5){return function(_0x2ab69e){if(_0x2ab69e){return _0x2ab69e[_0xcd66('0x24')]()['then'](function(){_0x35e19e[_0xcd66('0x1d')](0xcc)[_0xcd66('0x18')]();});}};}function handleEntityNotFound(_0xb37e77,_0x526e13){return function(_0x141a64){if(!_0x141a64){_0xb37e77[_0xcd66('0x25')](0x194);}return _0x141a64;};}function handleError(_0x3de898,_0x54ac81){_0x54ac81=_0x54ac81||0x1f4;return function(_0x12891d){logger[_0xcd66('0x26')](_0x12891d[_0xcd66('0x27')]);if(_0x12891d[_0xcd66('0x28')]){delete _0x12891d[_0xcd66('0x28')];}_0x3de898[_0xcd66('0x1d')](_0x54ac81)[_0xcd66('0x29')](_0x12891d);};}exports[_0xcd66('0x2a')]=function(_0x51201f,_0xb6d828){var _0x51a7f6={},_0x2506d3={},_0x851a5c={'count':0x0,'rows':[]};var _0x2dfa40=_[_0xcd66('0x2b')](db[_0xcd66('0x2c')][_0xcd66('0x2d')],function(_0x54597e){return{'name':_0x54597e[_0xcd66('0x2e')],'type':_0x54597e[_0xcd66('0x2f')][_0xcd66('0x30')]};});_0x2506d3[_0xcd66('0x31')]=_['map'](_0x2dfa40,_0xcd66('0x28'));_0x2506d3[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x51201f[_0xcd66('0x32')]);_0x2506d3[_0xcd66('0x34')]=_['intersection'](_0x2506d3[_0xcd66('0x31')],_0x2506d3[_0xcd66('0x32')]);_0x51a7f6[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x2506d3['model'],qs['fields'](_0x51201f[_0xcd66('0x32')]['fields']));_0x51a7f6[_0xcd66('0x35')]=_0x51a7f6[_0xcd66('0x35')][_0xcd66('0x37')]?_0x51a7f6[_0xcd66('0x35')]:_0x2506d3[_0xcd66('0x31')];if(!_0x51201f[_0xcd66('0x32')][_0xcd66('0x38')]('nolimit')){_0x51a7f6[_0xcd66('0x1b')]=qs[_0xcd66('0x1b')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x51a7f6['offset']=qs[_0xcd66('0x1a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1a')]);}_0x51a7f6[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x3a')]);_0x51a7f6[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x51201f[_0xcd66('0x32')],_0x2506d3[_0xcd66('0x34')]),_0x2dfa40);if(_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x51a7f6[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x51a7f6[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x2dfa40,function(_0x17a327){if(_0x17a327['type']!=='VIRTUAL'){var _0x8e55c6={};_0x8e55c6[_0x17a327['name']]={'$like':'%'+_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x8e55c6;}})});}_0x51a7f6=_[_0xcd66('0x3e')]({},_0x51a7f6,_0x51201f[_0xcd66('0x3f')]);var _0x2bfb26={'where':_0x51a7f6['where']};return db[_0xcd66('0x2c')][_0xcd66('0x1c')](_0x2bfb26)['then'](function(_0xd6bd6f){_0x851a5c[_0xcd66('0x1c')]=_0xd6bd6f;if(_0x51201f['query'][_0xcd66('0x40')]){_0x51a7f6[_0xcd66('0x41')]=[{'all':!![]}];}return db[_0xcd66('0x2c')][_0xcd66('0x42')](_0x51a7f6);})[_0xcd66('0x23')](function(_0x285ef4){_0x851a5c[_0xcd66('0x43')]=_0x285ef4;return _0x851a5c;})['then'](respondWithFilteredResult(_0xb6d828,_0x51a7f6))[_0xcd66('0x44')](handleError(_0xb6d828,null));};exports[_0xcd66('0x45')]=function(_0x2bb778,_0x333ee1){var _0x62802e={'raw':!![],'where':{'id':_0x2bb778['params']['id']}},_0x7e904d={};_0x7e904d[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x2c')][_0xcd66('0x2d')]);_0x7e904d['query']=_[_0xcd66('0x33')](_0x2bb778[_0xcd66('0x32')]);_0x7e904d[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],_0x7e904d[_0xcd66('0x32')]);_0x62802e[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x2bb778[_0xcd66('0x32')][_0xcd66('0x46')]));_0x62802e[_0xcd66('0x35')]=_0x62802e[_0xcd66('0x35')][_0xcd66('0x37')]?_0x62802e[_0xcd66('0x35')]:_0x7e904d[_0xcd66('0x31')];if(_0x2bb778['query'][_0xcd66('0x40')]){_0x62802e[_0xcd66('0x41')]=[{'all':!![]}];}_0x62802e=_[_0xcd66('0x3e')]({},_0x62802e,_0x2bb778[_0xcd66('0x3f')]);return db[_0xcd66('0x2c')]['find'](_0x62802e)[_0xcd66('0x23')](handleEntityNotFound(_0x333ee1,null))[_0xcd66('0x23')](respondWithResult(_0x333ee1,null))['catch'](handleError(_0x333ee1,null));};exports['create']=function(_0x533289,_0x11079c){return db[_0xcd66('0x2c')][_0xcd66('0x47')](_0x533289[_0xcd66('0x48')],{})[_0xcd66('0x23')](respondWithResult(_0x11079c,0xc9))[_0xcd66('0x44')](handleError(_0x11079c,null));};exports['update']=function(_0x2efa27,_0x558f09){if(_0x2efa27[_0xcd66('0x48')]['id']){delete _0x2efa27[_0xcd66('0x48')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2efa27[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x558f09,null))['then'](saveUpdates(_0x2efa27[_0xcd66('0x48')],null))['then'](respondWithResult(_0x558f09,null))[_0xcd66('0x44')](handleError(_0x558f09,null));};exports[_0xcd66('0x24')]=function(_0xb9051d,_0x52496f){return db[_0xcd66('0x2c')][_0xcd66('0x4a')]({'where':{'id':_0xb9051d[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x52496f,null))[_0xcd66('0x23')](removeEntity(_0x52496f,null))['catch'](handleError(_0x52496f,null));};exports[_0xcd66('0x4b')]=function(_0x5e5da3,_0x5bef71){return db[_0xcd66('0x2c')]['describe']()['then'](respondWithResult(_0x5bef71,null))[_0xcd66('0x44')](handleError(_0x5bef71,null));}; \ No newline at end of file +var _0x255f=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format'];(function(_0x124e0b,_0x50d410){var _0x2f4c1b=function(_0x38367b){while(--_0x38367b){_0x124e0b['push'](_0x124e0b['shift']());}};_0x2f4c1b(++_0x50d410);}(_0x255f,0x185));var _0xf255=function(_0x2f57db,_0x318730){_0x2f57db=_0x2f57db-0x0;var _0x5ee309=_0x255f[_0x2f57db];return _0x5ee309;};'use strict';var emlformat=require(_0xf255('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf255('0x1'));var jsonpatch=require(_0xf255('0x2'));var rp=require(_0xf255('0x3'));var moment=require('moment');var BPromise=require(_0xf255('0x4'));var Mustache=require(_0xf255('0x5'));var util=require(_0xf255('0x6'));var path=require(_0xf255('0x7'));var sox=require(_0xf255('0x8'));var csv=require(_0xf255('0x9'));var ejs=require(_0xf255('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf255('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf255('0xc'));var deskjs=require(_0xf255('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf255('0xe'));var Papa=require(_0xf255('0xf'));var Redis=require('ioredis');var authService=require(_0xf255('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf255('0x11'));var hardwareService=require(_0xf255('0x12'));var logger=require(_0xf255('0x13'))(_0xf255('0x14'));var utils=require(_0xf255('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf255('0x16'));var db=require(_0xf255('0x17'))['db'];function respondWithStatusCode(_0x35fe1b,_0x50c1ca){_0x50c1ca=_0x50c1ca||0xcc;return function(_0x395f0f){if(_0x395f0f){return _0x35fe1b[_0xf255('0x18')](_0x50c1ca);}return _0x35fe1b['status'](_0x50c1ca)[_0xf255('0x19')]();};}function respondWithResult(_0x266b73,_0x233853){_0x233853=_0x233853||0xc8;return function(_0x49240a){if(_0x49240a){return _0x266b73[_0xf255('0x1a')](_0x233853)[_0xf255('0x1b')](_0x49240a);}};}function respondWithFilteredResult(_0x4b8c8,_0x750c8a){return function(_0x194e28){if(_0x194e28){var _0x4d9a07=typeof _0x750c8a['offset']===_0xf255('0x1c')&&typeof _0x750c8a['limit']===_0xf255('0x1c');var _0x516b16=_0x194e28[_0xf255('0x1d')];var _0x426286=_0x4d9a07?0x0:_0x750c8a[_0xf255('0x1e')];var _0x43902c=_0x4d9a07?_0x194e28[_0xf255('0x1d')]:_0x750c8a[_0xf255('0x1e')]+_0x750c8a[_0xf255('0x1f')];var _0x422a19;if(_0x43902c>=_0x516b16){_0x43902c=_0x516b16;_0x422a19=0xc8;}else{_0x422a19=0xce;}_0x4b8c8[_0xf255('0x1a')](_0x422a19);return _0x4b8c8[_0xf255('0x20')](_0xf255('0x21'),_0x426286+'-'+_0x43902c+'/'+_0x516b16)['json'](_0x194e28);}return null;};}function patchUpdates(_0x2fe87d){return function(_0x1ed880){try{jsonpatch[_0xf255('0x22')](_0x1ed880,_0x2fe87d,!![]);}catch(_0x2c5fbc){return BPromise[_0xf255('0x23')](_0x2c5fbc);}return _0x1ed880[_0xf255('0x24')]();};}function saveUpdates(_0x31bde5,_0x5b9b5f){return function(_0x25d910){if(_0x25d910){return _0x25d910[_0xf255('0x25')](_0x31bde5)[_0xf255('0x26')](function(_0x1dad1e){return _0x1dad1e;});}return null;};}function removeEntity(_0x325ee8,_0x1b3b1a){return function(_0x25eca0){if(_0x25eca0){return _0x25eca0['destroy']()[_0xf255('0x26')](function(){_0x325ee8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d64c5,_0x3270d4){return function(_0x382084){if(!_0x382084){_0x3d64c5[_0xf255('0x18')](0x194);}return _0x382084;};}function handleError(_0x3c0c32,_0x54d391){_0x54d391=_0x54d391||0x1f4;return function(_0x1c3a8e){logger[_0xf255('0x27')](_0x1c3a8e[_0xf255('0x28')]);if(_0x1c3a8e['name']){delete _0x1c3a8e[_0xf255('0x29')];}_0x3c0c32[_0xf255('0x1a')](_0x54d391)[_0xf255('0x2a')](_0x1c3a8e);};}exports['index']=function(_0xa1827e,_0x12424d){var _0x3bc770={},_0x39aac5={},_0x1b6f56={'count':0x0,'rows':[]};var _0x1ca07f=_[_0xf255('0x2b')](db[_0xf255('0x2c')][_0xf255('0x2d')],function(_0x280dac){return{'name':_0x280dac['fieldName'],'type':_0x280dac[_0xf255('0x2e')][_0xf255('0x2f')]};});_0x39aac5[_0xf255('0x30')]=_[_0xf255('0x2b')](_0x1ca07f,_0xf255('0x29'));_0x39aac5[_0xf255('0x31')]=_[_0xf255('0x32')](_0xa1827e[_0xf255('0x31')]);_0x39aac5['filters']=_[_0xf255('0x33')](_0x39aac5['model'],_0x39aac5['query']);_0x3bc770[_0xf255('0x34')]=_[_0xf255('0x33')](_0x39aac5[_0xf255('0x30')],qs[_0xf255('0x35')](_0xa1827e[_0xf255('0x31')][_0xf255('0x35')]));_0x3bc770[_0xf255('0x34')]=_0x3bc770['attributes'][_0xf255('0x36')]?_0x3bc770[_0xf255('0x34')]:_0x39aac5[_0xf255('0x30')];if(!_0xa1827e[_0xf255('0x31')][_0xf255('0x37')](_0xf255('0x38'))){_0x3bc770['limit']=qs[_0xf255('0x1f')](_0xa1827e[_0xf255('0x31')][_0xf255('0x1f')]);_0x3bc770[_0xf255('0x1e')]=qs[_0xf255('0x1e')](_0xa1827e['query'][_0xf255('0x1e')]);}_0x3bc770[_0xf255('0x39')]=qs[_0xf255('0x3a')](_0xa1827e[_0xf255('0x31')][_0xf255('0x3a')]);_0x3bc770[_0xf255('0x3b')]=qs['filters'](_[_0xf255('0x3c')](_0xa1827e[_0xf255('0x31')],_0x39aac5[_0xf255('0x3d')]),_0x1ca07f);if(_0xa1827e[_0xf255('0x31')][_0xf255('0x3e')]){_0x3bc770['where']=_[_0xf255('0x3f')](_0x3bc770[_0xf255('0x3b')],{'$or':_[_0xf255('0x2b')](_0x1ca07f,function(_0x1fd628){if(_0x1fd628[_0xf255('0x2e')]!==_0xf255('0x40')){var _0x4b3733={};_0x4b3733[_0x1fd628['name']]={'$like':'%'+_0xa1827e[_0xf255('0x31')][_0xf255('0x3e')]+'%'};return _0x4b3733;}})});}_0x3bc770=_[_0xf255('0x3f')]({},_0x3bc770,_0xa1827e['options']);var _0x1aef9c={'where':_0x3bc770['where']};return db[_0xf255('0x2c')][_0xf255('0x1d')](_0x1aef9c)[_0xf255('0x26')](function(_0x4516c5){_0x1b6f56[_0xf255('0x1d')]=_0x4516c5;if(_0xa1827e[_0xf255('0x31')][_0xf255('0x41')]){_0x3bc770[_0xf255('0x42')]=[{'all':!![]}];}return db[_0xf255('0x2c')][_0xf255('0x43')](_0x3bc770);})[_0xf255('0x26')](function(_0x22fe5c){_0x1b6f56[_0xf255('0x44')]=_0x22fe5c;return _0x1b6f56;})[_0xf255('0x26')](respondWithFilteredResult(_0x12424d,_0x3bc770))[_0xf255('0x45')](handleError(_0x12424d,null));};exports[_0xf255('0x46')]=function(_0x40a775,_0x4f9d63){var _0x44ea98={'raw':!![],'where':{'id':_0x40a775[_0xf255('0x47')]['id']}},_0x5eedd8={};_0x5eedd8[_0xf255('0x30')]=_['keys'](db[_0xf255('0x2c')]['rawAttributes']);_0x5eedd8[_0xf255('0x31')]=_[_0xf255('0x32')](_0x40a775['query']);_0x5eedd8[_0xf255('0x3d')]=_['intersection'](_0x5eedd8['model'],_0x5eedd8['query']);_0x44ea98[_0xf255('0x34')]=_[_0xf255('0x33')](_0x5eedd8[_0xf255('0x30')],qs[_0xf255('0x35')](_0x40a775['query'][_0xf255('0x35')]));_0x44ea98[_0xf255('0x34')]=_0x44ea98[_0xf255('0x34')][_0xf255('0x36')]?_0x44ea98[_0xf255('0x34')]:_0x5eedd8['model'];if(_0x40a775[_0xf255('0x31')][_0xf255('0x41')]){_0x44ea98[_0xf255('0x42')]=[{'all':!![]}];}_0x44ea98=_[_0xf255('0x3f')]({},_0x44ea98,_0x40a775[_0xf255('0x48')]);return db[_0xf255('0x2c')][_0xf255('0x49')](_0x44ea98)[_0xf255('0x26')](handleEntityNotFound(_0x4f9d63,null))['then'](respondWithResult(_0x4f9d63,null))['catch'](handleError(_0x4f9d63,null));};exports['create']=function(_0x34cc13,_0x4b27e7){return db['FaxQueueReport'][_0xf255('0x4a')](_0x34cc13[_0xf255('0x4b')],{})[_0xf255('0x26')](respondWithResult(_0x4b27e7,0xc9))[_0xf255('0x45')](handleError(_0x4b27e7,null));};exports['update']=function(_0x5bf6e7,_0x1a893c){if(_0x5bf6e7['body']['id']){delete _0x5bf6e7['body']['id'];}return db[_0xf255('0x2c')]['find']({'where':{'id':_0x5bf6e7[_0xf255('0x47')]['id']}})[_0xf255('0x26')](handleEntityNotFound(_0x1a893c,null))[_0xf255('0x26')](saveUpdates(_0x5bf6e7[_0xf255('0x4b')],null))[_0xf255('0x26')](respondWithResult(_0x1a893c,null))[_0xf255('0x45')](handleError(_0x1a893c,null));};exports[_0xf255('0x4c')]=function(_0x392632,_0x271074){return db[_0xf255('0x2c')][_0xf255('0x49')]({'where':{'id':_0x392632[_0xf255('0x47')]['id']}})[_0xf255('0x26')](handleEntityNotFound(_0x271074,null))[_0xf255('0x26')](removeEntity(_0x271074,null))[_0xf255('0x45')](handleError(_0x271074,null));};exports['describe']=function(_0x2d86ea,_0x11ecbd){return db[_0xf255('0x2c')][_0xf255('0x4d')]()[_0xf255('0x26')](respondWithResult(_0x11ecbd,null))['catch'](handleError(_0x11ecbd,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e9d3b6c..d0e7d52 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x113db7,_0x4da038){var _0x5918f3=function(_0x3d8c07){while(--_0x3d8c07){_0x113db7['push'](_0x113db7['shift']());}};_0x5918f3(++_0x4da038);}(_0x7a54,0x106));var _0x47a5=function(_0x295500,_0x186f45){_0x295500=_0x295500-0x0;var _0x1d7aa1=_0x7a54[_0x295500];return _0x1d7aa1;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x5a07ba,_0x3e2e4d){var _0x2a93dc=function(_0x5edce7){while(--_0x5edce7){_0x5a07ba['push'](_0x5a07ba['shift']());}};_0x2a93dc(++_0x3e2e4d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8bb749e..be88687 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 _0x28c0=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','options','UpdateFaxQueueReport','FaxQueueReport','update','raw','limit','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x15b950,_0xfab47f){var _0x2f7d3a=function(_0x395f18){while(--_0x395f18){_0x15b950['push'](_0x15b950['shift']());}};_0x2f7d3a(++_0xfab47f);}(_0x28c0,0x17b));var _0x028c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x28c0[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x028c('0x0'));var util=require(_0x028c('0x1'));var moment=require(_0x028c('0x2'));var BPromise=require(_0x028c('0x3'));var rs=require(_0x028c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x028c('0x5'));var jayson=require(_0x028c('0x6'));var client=jayson[_0x028c('0x7')][_0x028c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21044b,_0x51a9f6,_0x5ceee9){return new BPromise(function(_0x535ce8,_0x3159fb){return client[_0x028c('0x9')](_0x21044b,_0x5ceee9)[_0x028c('0xa')](function(_0x17918f){logger[_0x028c('0xb')](_0x028c('0xc'),_0x51a9f6,_0x028c('0xd'));logger[_0x028c('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x51a9f6,'request\x20sent',JSON[_0x028c('0xf')](_0x17918f));if(_0x17918f[_0x028c('0x10')]){if(_0x17918f[_0x028c('0x10')][_0x028c('0x11')]===0x1f4){logger['error'](_0x028c('0xc'),_0x51a9f6,_0x17918f['error'][_0x028c('0x12')]);return _0x3159fb(_0x17918f[_0x028c('0x10')]['message']);}logger[_0x028c('0x10')](_0x028c('0xc'),_0x51a9f6,_0x17918f[_0x028c('0x10')]['message']);return _0x535ce8(_0x17918f[_0x028c('0x10')][_0x028c('0x12')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x51a9f6,_0x028c('0xd'));_0x535ce8(_0x17918f[_0x028c('0x13')][_0x028c('0x12')]);}})[_0x028c('0x14')](function(_0x373cb0){logger[_0x028c('0x10')](_0x028c('0xc'),_0x51a9f6,_0x373cb0);_0x3159fb(_0x373cb0);});});}exports[_0x028c('0x15')]=function(_0x32056e){var _0x1f2f13=this;return new Promise(function(_0x43791d,_0x2a17ee){return db['FaxQueueReport'][_0x028c('0x16')](_0x32056e[_0x028c('0x17')],{'raw':_0x32056e[_0x028c('0x18')]?_0x32056e[_0x028c('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x50de90){logger[_0x028c('0xb')](_0x028c('0x15'),_0x32056e);logger['debug'](_0x028c('0x15'),_0x32056e,JSON[_0x028c('0xf')](_0x50de90));_0x43791d(_0x50de90);})[_0x028c('0x14')](function(_0x5ba8e7){logger[_0x028c('0x10')](_0x028c('0x15'),_0x5ba8e7[_0x028c('0x12')],_0x32056e);_0x2a17ee(_0x1f2f13[_0x028c('0x10')](0x1f4,_0x5ba8e7[_0x028c('0x12')]));});});};exports[_0x028c('0x19')]=function(_0x1daeae){var _0x2ff82d=this;return new Promise(function(_0x56195e,_0x9bb819){return db[_0x028c('0x1a')][_0x028c('0x1b')](_0x1daeae[_0x028c('0x17')],{'raw':_0x1daeae[_0x028c('0x18')]?_0x1daeae[_0x028c('0x18')][_0x028c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1daeae[_0x028c('0x18')]?_0x1daeae[_0x028c('0x18')]['where']||null:null,'attributes':_0x1daeae[_0x028c('0x18')]?_0x1daeae[_0x028c('0x18')]['attributes']||null:null,'limit':_0x1daeae[_0x028c('0x18')]?_0x1daeae[_0x028c('0x18')][_0x028c('0x1d')]||null:null})[_0x028c('0xa')](function(_0x250c43){logger[_0x028c('0xb')](_0x028c('0x19'),_0x1daeae);logger['debug'](_0x028c('0x19'),_0x1daeae,JSON[_0x028c('0xf')](_0x250c43));_0x56195e(_0x250c43);})['catch'](function(_0x336f1b){logger[_0x028c('0x10')](_0x028c('0x19'),_0x336f1b[_0x028c('0x12')],_0x1daeae);_0x9bb819(_0x2ff82d[_0x028c('0x10')](0x1f4,_0x336f1b['message']));});});}; \ No newline at end of file +var _0xa3a0=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','code','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','where','attributes','UpdateFaxQueueReport','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3a0,0xf3));var _0x0a3a=function(_0x2d1b47,_0x11d484){_0x2d1b47=_0x2d1b47-0x0;var _0x3178ff=_0xa3a0[_0x2d1b47];return _0x3178ff;};'use strict';var _=require(_0x0a3a('0x0'));var util=require(_0x0a3a('0x1'));var moment=require(_0x0a3a('0x2'));var BPromise=require(_0x0a3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a3a('0x4'))['db'];var utils=require(_0x0a3a('0x5'));var logger=require(_0x0a3a('0x6'))(_0x0a3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a3a('0x8'));var client=jayson[_0x0a3a('0x9')][_0x0a3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa67a,_0x2c9645,_0x22a96c){return new BPromise(function(_0xa6869d,_0x20661e){return client[_0x0a3a('0xb')](_0x4fa67a,_0x22a96c)[_0x0a3a('0xc')](function(_0x172db4){logger[_0x0a3a('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,'request\x20sent');logger[_0x0a3a('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2c9645,_0x0a3a('0xf'),JSON[_0x0a3a('0x10')](_0x172db4));if(_0x172db4['error']){if(_0x172db4['error'][_0x0a3a('0x11')]===0x1f4){logger[_0x0a3a('0x12')](_0x0a3a('0x13'),_0x2c9645,_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);return _0x20661e(_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);}logger[_0x0a3a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);return _0xa6869d(_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);}else{logger[_0x0a3a('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x0a3a('0xf'));_0xa6869d(_0x172db4[_0x0a3a('0x15')][_0x0a3a('0x14')]);}})[_0x0a3a('0x16')](function(_0x4b94d2){logger[_0x0a3a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x4b94d2);_0x20661e(_0x4b94d2);});});}exports[_0x0a3a('0x17')]=function(_0x377e48){var _0x46ccdb=this;return new Promise(function(_0x847a12,_0xe399cc){return db[_0x0a3a('0x18')]['create'](_0x377e48[_0x0a3a('0x19')],{'raw':_0x377e48[_0x0a3a('0x1a')]?_0x377e48[_0x0a3a('0x1a')][_0x0a3a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x12b2de){logger[_0x0a3a('0xd')]('CreateFaxQueueReport',_0x377e48);logger[_0x0a3a('0xe')](_0x0a3a('0x17'),_0x377e48,JSON[_0x0a3a('0x10')](_0x12b2de));_0x847a12(_0x12b2de);})[_0x0a3a('0x16')](function(_0x840428){logger[_0x0a3a('0x12')](_0x0a3a('0x17'),_0x840428[_0x0a3a('0x14')],_0x377e48);_0xe399cc(_0x46ccdb[_0x0a3a('0x12')](0x1f4,_0x840428['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1640bd){var _0x444a3d=this;return new Promise(function(_0x1fbe26,_0x517908){return db['FaxQueueReport']['update'](_0x1640bd[_0x0a3a('0x19')],{'raw':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1c')]||null:null,'attributes':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1d')]||null:null,'limit':_0x1640bd['options']?_0x1640bd[_0x0a3a('0x1a')]['limit']||null:null})[_0x0a3a('0xc')](function(_0xdcde16){logger[_0x0a3a('0xd')](_0x0a3a('0x1e'),_0x1640bd);logger['debug'](_0x0a3a('0x1e'),_0x1640bd,JSON[_0x0a3a('0x10')](_0xdcde16));_0x1fbe26(_0xdcde16);})[_0x0a3a('0x16')](function(_0x202a68){logger[_0x0a3a('0x12')](_0x0a3a('0x1e'),_0x202a68[_0x0a3a('0x14')],_0x1640bd);_0x517908(_0x444a3d[_0x0a3a('0x12')](0x1f4,_0x202a68[_0x0a3a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 934cb53..6e38e56 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 _0x4aba=['./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x275590,_0x558511){var _0xe365a0=function(_0x3bbda7){while(--_0x3bbda7){_0x275590['push'](_0x275590['shift']());}};_0xe365a0(++_0x558511);}(_0x4aba,0xd4));var _0xa4ab=function(_0x3faa10,_0x5909af){_0x3faa10=_0x3faa10-0x0;var _0x493e08=_0x4aba[_0x3faa10];return _0x493e08;};'use strict';var multer=require(_0xa4ab('0x0'));var util=require(_0xa4ab('0x1'));var path=require('path');var timeout=require(_0xa4ab('0x2'));var express=require(_0xa4ab('0x3'));var router=express[_0xa4ab('0x4')]();var fs_extra=require(_0xa4ab('0x5'));var auth=require(_0xa4ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa4ab('0x7'));var controller=require(_0xa4ab('0x8'));router[_0xa4ab('0x9')]('/',auth[_0xa4ab('0xa')](),controller[_0xa4ab('0xb')]);router[_0xa4ab('0x9')]('/describe',auth[_0xa4ab('0xa')](),controller[_0xa4ab('0xc')]);router['get'](_0xa4ab('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa4ab('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa4ab('0xf')](_0xa4ab('0xd'),auth['isAuthenticated'](),controller[_0xa4ab('0x10')]);router[_0xa4ab('0x11')](_0xa4ab('0xd'),auth[_0xa4ab('0xa')](),controller[_0xa4ab('0x12')]);module[_0xa4ab('0x13')]=router; \ No newline at end of file +var _0xe9f1=['fs-extra','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','destroy','exports','multer','connect-timeout','Router'];(function(_0x59557e,_0x8f9209){var _0x2bfe66=function(_0x413290){while(--_0x413290){_0x59557e['push'](_0x59557e['shift']());}};_0x2bfe66(++_0x8f9209);}(_0xe9f1,0xc3));var _0x1e9f=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe9f1[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x1e9f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e9f('0x1'));var express=require('express');var router=express[_0x1e9f('0x2')]();var fs_extra=require(_0x1e9f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1e9f('0x4'));var config=require('../../config/environment');var controller=require(_0x1e9f('0x5'));router['get']('/',auth[_0x1e9f('0x6')](),controller[_0x1e9f('0x7')]);router[_0x1e9f('0x8')](_0x1e9f('0x9'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xa')]);router[_0x1e9f('0x8')]('/:id',auth[_0x1e9f('0x6')](),controller['show']);router[_0x1e9f('0xb')]('/',auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xc')]);router[_0x1e9f('0xd')](_0x1e9f('0xe'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xf')]);router['delete'](_0x1e9f('0xe'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0x10')]);module[_0x1e9f('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9c7093c..eb30b55 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x20aaa4,_0x36a1c3){var _0x5369a8=function(_0x11301a){while(--_0x11301a){_0x20aaa4['push'](_0x20aaa4['shift']());}};_0x5369a8(++_0x36a1c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xcb91[_0x3438cf];return _0x278698;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1a992a,_0x3ae516){var _0x3fb4ef=function(_0x339645){while(--_0x339645){_0x1a992a['push'](_0x1a992a['shift']());}};_0x3fb4ef(++_0x3ae516);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 9f49b3b..ccbab7d 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 _0xe68e=['fields','query','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','include','findAll','then','rows','catch','show','params','keys','FaxTransferReport','length','includeAll','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','filters','attributes','intersection'];(function(_0x59385f,_0x218c19){var _0x3502df=function(_0x80e493){while(--_0x80e493){_0x59385f['push'](_0x59385f['shift']());}};_0x3502df(++_0x218c19);}(_0xe68e,0xb6));var _0xee68=function(_0x41ee64,_0x206c94){_0x41ee64=_0x41ee64-0x0;var _0x468e47=_0xe68e[_0x41ee64];return _0x468e47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee68('0x0'));var zipdir=require(_0xee68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee68('0x2'));var moment=require(_0xee68('0x3'));var BPromise=require(_0xee68('0x4'));var Mustache=require(_0xee68('0x5'));var util=require(_0xee68('0x6'));var path=require(_0xee68('0x7'));var sox=require('sox');var csv=require(_0xee68('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee68('0x9'));var _=require(_0xee68('0xa'));var squel=require(_0xee68('0xb'));var crypto=require(_0xee68('0xc'));var jsforce=require(_0xee68('0xd'));var deskjs=require(_0xee68('0xe'));var toCsv=require(_0xee68('0x8'));var querystring=require(_0xee68('0xf'));var Papa=require(_0xee68('0x10'));var Redis=require(_0xee68('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xee68('0x12'));var as=require(_0xee68('0x13'));var hardwareService=require(_0xee68('0x14'));var logger=require('../../config/logger')(_0xee68('0x15'));var utils=require(_0xee68('0x16'));var config=require(_0xee68('0x17'));var licenseUtil=require(_0xee68('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d68eb,_0x110c06){_0x110c06=_0x110c06||0xcc;return function(_0x5ae5d7){if(_0x5ae5d7){return _0x3d68eb[_0xee68('0x19')](_0x110c06);}return _0x3d68eb[_0xee68('0x1a')](_0x110c06)[_0xee68('0x1b')]();};}function respondWithResult(_0x31d7a6,_0x1fafcd){_0x1fafcd=_0x1fafcd||0xc8;return function(_0x2e479){if(_0x2e479){return _0x31d7a6['status'](_0x1fafcd)['json'](_0x2e479);}};}function respondWithFilteredResult(_0xf52dcb,_0x3678d7){return function(_0x56b093){if(_0x56b093){var _0x10fdd=typeof _0x3678d7['offset']===_0xee68('0x1c')&&typeof _0x3678d7[_0xee68('0x1d')]===_0xee68('0x1c');var _0x394105=_0x56b093['count'];var _0x283b84=_0x10fdd?0x0:_0x3678d7[_0xee68('0x1e')];var _0x3e386d=_0x10fdd?_0x56b093[_0xee68('0x1f')]:_0x3678d7[_0xee68('0x1e')]+_0x3678d7[_0xee68('0x1d')];var _0x409978;if(_0x3e386d>=_0x394105){_0x3e386d=_0x394105;_0x409978=0xc8;}else{_0x409978=0xce;}_0xf52dcb['status'](_0x409978);return _0xf52dcb[_0xee68('0x20')](_0xee68('0x21'),_0x283b84+'-'+_0x3e386d+'/'+_0x394105)[_0xee68('0x22')](_0x56b093);}return null;};}function patchUpdates(_0x2b71ac){return function(_0x5ead1b){try{jsonpatch[_0xee68('0x23')](_0x5ead1b,_0x2b71ac,!![]);}catch(_0x1bf4ad){return BPromise['reject'](_0x1bf4ad);}return _0x5ead1b[_0xee68('0x24')]();};}function saveUpdates(_0x1762ae,_0x409d9c){return function(_0x202b6e){if(_0x202b6e){return _0x202b6e[_0xee68('0x25')](_0x1762ae)['then'](function(_0x38589d){return _0x38589d;});}return null;};}function removeEntity(_0x4cbb21,_0x14c86a){return function(_0x11d16f){if(_0x11d16f){return _0x11d16f[_0xee68('0x26')]()['then'](function(){_0x4cbb21['status'](0xcc)[_0xee68('0x1b')]();});}};}function handleEntityNotFound(_0x3ac7e6,_0x3467da){return function(_0x4d274b){if(!_0x4d274b){_0x3ac7e6[_0xee68('0x19')](0x194);}return _0x4d274b;};}function handleError(_0x200905,_0x33a935){_0x33a935=_0x33a935||0x1f4;return function(_0x591af8){logger[_0xee68('0x27')](_0x591af8[_0xee68('0x28')]);if(_0x591af8[_0xee68('0x29')]){delete _0x591af8[_0xee68('0x29')];}_0x200905[_0xee68('0x1a')](_0x33a935)[_0xee68('0x2a')](_0x591af8);};}exports[_0xee68('0x2b')]=function(_0x186ec1,_0x57969f){var _0x18ad2b={},_0x10b940={},_0x4ac714={'count':0x0,'rows':[]};var _0x5aa418=_[_0xee68('0x2c')](db['FaxTransferReport'][_0xee68('0x2d')],function(_0x2eb954){return{'name':_0x2eb954[_0xee68('0x2e')],'type':_0x2eb954['type'][_0xee68('0x2f')]};});_0x10b940[_0xee68('0x30')]=_[_0xee68('0x2c')](_0x5aa418,'name');_0x10b940['query']=_['keys'](_0x186ec1['query']);_0x10b940[_0xee68('0x31')]=_['intersection'](_0x10b940[_0xee68('0x30')],_0x10b940['query']);_0x18ad2b[_0xee68('0x32')]=_[_0xee68('0x33')](_0x10b940['model'],qs['fields'](_0x186ec1['query'][_0xee68('0x34')]));_0x18ad2b[_0xee68('0x32')]=_0x18ad2b[_0xee68('0x32')]['length']?_0x18ad2b[_0xee68('0x32')]:_0x10b940[_0xee68('0x30')];if(!_0x186ec1[_0xee68('0x35')][_0xee68('0x36')](_0xee68('0x37'))){_0x18ad2b[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x186ec1[_0xee68('0x35')][_0xee68('0x1d')]);_0x18ad2b['offset']=qs[_0xee68('0x1e')](_0x186ec1['query'][_0xee68('0x1e')]);}_0x18ad2b[_0xee68('0x38')]=qs[_0xee68('0x39')](_0x186ec1[_0xee68('0x35')]['sort']);_0x18ad2b['where']=qs[_0xee68('0x31')](_['pick'](_0x186ec1[_0xee68('0x35')],_0x10b940[_0xee68('0x31')]),_0x5aa418);if(_0x186ec1['query'][_0xee68('0x3a')]){_0x18ad2b['where']=_[_0xee68('0x3b')](_0x18ad2b['where'],{'$or':_[_0xee68('0x2c')](_0x5aa418,function(_0x30a084){if(_0x30a084['type']!==_0xee68('0x3c')){var _0x5bb40e={};_0x5bb40e[_0x30a084[_0xee68('0x29')]]={'$like':'%'+_0x186ec1[_0xee68('0x35')][_0xee68('0x3a')]+'%'};return _0x5bb40e;}})});}_0x18ad2b=_[_0xee68('0x3b')]({},_0x18ad2b,_0x186ec1[_0xee68('0x3d')]);var _0x341cfe={'where':_0x18ad2b[_0xee68('0x3e')]};return db['FaxTransferReport'][_0xee68('0x1f')](_0x341cfe)['then'](function(_0x1eb497){_0x4ac714['count']=_0x1eb497;if(_0x186ec1[_0xee68('0x35')]['includeAll']){_0x18ad2b[_0xee68('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xee68('0x40')](_0x18ad2b);})[_0xee68('0x41')](function(_0xe4b3cf){_0x4ac714[_0xee68('0x42')]=_0xe4b3cf;return _0x4ac714;})[_0xee68('0x41')](respondWithFilteredResult(_0x57969f,_0x18ad2b))[_0xee68('0x43')](handleError(_0x57969f,null));};exports[_0xee68('0x44')]=function(_0x5c9c08,_0x3bed02){var _0x5147f4={'raw':!![],'where':{'id':_0x5c9c08[_0xee68('0x45')]['id']}},_0x23251d={};_0x23251d[_0xee68('0x30')]=_[_0xee68('0x46')](db[_0xee68('0x47')]['rawAttributes']);_0x23251d[_0xee68('0x35')]=_['keys'](_0x5c9c08['query']);_0x23251d[_0xee68('0x31')]=_[_0xee68('0x33')](_0x23251d[_0xee68('0x30')],_0x23251d[_0xee68('0x35')]);_0x5147f4[_0xee68('0x32')]=_[_0xee68('0x33')](_0x23251d['model'],qs[_0xee68('0x34')](_0x5c9c08[_0xee68('0x35')][_0xee68('0x34')]));_0x5147f4['attributes']=_0x5147f4[_0xee68('0x32')][_0xee68('0x48')]?_0x5147f4[_0xee68('0x32')]:_0x23251d[_0xee68('0x30')];if(_0x5c9c08[_0xee68('0x35')][_0xee68('0x49')]){_0x5147f4[_0xee68('0x3f')]=[{'all':!![]}];}_0x5147f4=_['merge']({},_0x5147f4,_0x5c9c08[_0xee68('0x3d')]);return db[_0xee68('0x47')]['find'](_0x5147f4)['then'](handleEntityNotFound(_0x3bed02,null))[_0xee68('0x41')](respondWithResult(_0x3bed02,null))[_0xee68('0x43')](handleError(_0x3bed02,null));};exports[_0xee68('0x4a')]=function(_0x533950,_0x47ef37){return db[_0xee68('0x47')][_0xee68('0x4a')](_0x533950[_0xee68('0x4b')],{})['then'](respondWithResult(_0x47ef37,0xc9))[_0xee68('0x43')](handleError(_0x47ef37,null));};exports[_0xee68('0x25')]=function(_0x5dbec2,_0x284be6){if(_0x5dbec2[_0xee68('0x4b')]['id']){delete _0x5dbec2['body']['id'];}return db[_0xee68('0x47')]['find']({'where':{'id':_0x5dbec2[_0xee68('0x45')]['id']}})[_0xee68('0x41')](handleEntityNotFound(_0x284be6,null))[_0xee68('0x41')](saveUpdates(_0x5dbec2[_0xee68('0x4b')],null))[_0xee68('0x41')](respondWithResult(_0x284be6,null))[_0xee68('0x43')](handleError(_0x284be6,null));};exports[_0xee68('0x26')]=function(_0x16ed99,_0xb476c4){return db['FaxTransferReport'][_0xee68('0x4c')]({'where':{'id':_0x16ed99['params']['id']}})['then'](handleEntityNotFound(_0xb476c4,null))[_0xee68('0x41')](removeEntity(_0xb476c4,null))[_0xee68('0x43')](handleError(_0xb476c4,null));};exports[_0xee68('0x4d')]=function(_0x1571a9,_0x9d0e6a){return db['FaxTransferReport'][_0xee68('0x4d')]()['then'](respondWithResult(_0x9d0e6a,null))[_0xee68('0x43')](handleError(_0x9d0e6a,null));}; \ No newline at end of file +var _0xec97=['request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','fields','length','includeAll','include','options','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xec97,0x1b2));var _0x7ec9=function(_0x138541,_0x33f9d0){_0x138541=_0x138541-0x0;var _0x3fb2fc=_0xec97[_0x138541];return _0x3fb2fc;};'use strict';var emlformat=require(_0x7ec9('0x0'));var rimraf=require(_0x7ec9('0x1'));var zipdir=require(_0x7ec9('0x2'));var jsonpatch=require(_0x7ec9('0x3'));var rp=require(_0x7ec9('0x4'));var moment=require(_0x7ec9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7ec9('0x6'));var path=require(_0x7ec9('0x7'));var sox=require(_0x7ec9('0x8'));var csv=require('to-csv');var ejs=require(_0x7ec9('0x9'));var fs=require('fs');var fs_extra=require(_0x7ec9('0xa'));var _=require(_0x7ec9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ec9('0xc'));var deskjs=require(_0x7ec9('0xd'));var toCsv=require(_0x7ec9('0xe'));var querystring=require(_0x7ec9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ec9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7ec9('0x11'));var hardwareService=require(_0x7ec9('0x12'));var logger=require('../../config/logger')(_0x7ec9('0x13'));var utils=require(_0x7ec9('0x14'));var config=require(_0x7ec9('0x15'));var licenseUtil=require(_0x7ec9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6f22,_0x1a5451){_0x1a5451=_0x1a5451||0xcc;return function(_0x48209c){if(_0x48209c){return _0x3f6f22[_0x7ec9('0x17')](_0x1a5451);}return _0x3f6f22['status'](_0x1a5451)[_0x7ec9('0x18')]();};}function respondWithResult(_0x147cf2,_0x26d5b9){_0x26d5b9=_0x26d5b9||0xc8;return function(_0x58a6bc){if(_0x58a6bc){return _0x147cf2[_0x7ec9('0x19')](_0x26d5b9)['json'](_0x58a6bc);}};}function respondWithFilteredResult(_0x3b9cf9,_0x2038aa){return function(_0x246cb9){if(_0x246cb9){var _0x56ba80=typeof _0x2038aa[_0x7ec9('0x1a')]==='undefined'&&typeof _0x2038aa['limit']==='undefined';var _0x1a6d99=_0x246cb9[_0x7ec9('0x1b')];var _0x597209=_0x56ba80?0x0:_0x2038aa[_0x7ec9('0x1a')];var _0x4b677b=_0x56ba80?_0x246cb9[_0x7ec9('0x1b')]:_0x2038aa['offset']+_0x2038aa[_0x7ec9('0x1c')];var _0x38c35c;if(_0x4b677b>=_0x1a6d99){_0x4b677b=_0x1a6d99;_0x38c35c=0xc8;}else{_0x38c35c=0xce;}_0x3b9cf9[_0x7ec9('0x19')](_0x38c35c);return _0x3b9cf9[_0x7ec9('0x1d')](_0x7ec9('0x1e'),_0x597209+'-'+_0x4b677b+'/'+_0x1a6d99)['json'](_0x246cb9);}return null;};}function patchUpdates(_0x3af608){return function(_0x17d6b2){try{jsonpatch['apply'](_0x17d6b2,_0x3af608,!![]);}catch(_0x3ee3e6){return BPromise['reject'](_0x3ee3e6);}return _0x17d6b2[_0x7ec9('0x1f')]();};}function saveUpdates(_0x3908e5,_0x46e035){return function(_0x2a5e22){if(_0x2a5e22){return _0x2a5e22[_0x7ec9('0x20')](_0x3908e5)['then'](function(_0x5b0c5d){return _0x5b0c5d;});}return null;};}function removeEntity(_0x3028be,_0x53d17e){return function(_0x4f5156){if(_0x4f5156){return _0x4f5156[_0x7ec9('0x21')]()[_0x7ec9('0x22')](function(){_0x3028be[_0x7ec9('0x19')](0xcc)[_0x7ec9('0x18')]();});}};}function handleEntityNotFound(_0x44469b,_0x43a9d8){return function(_0x11b0b1){if(!_0x11b0b1){_0x44469b[_0x7ec9('0x17')](0x194);}return _0x11b0b1;};}function handleError(_0x55db81,_0x5747c0){_0x5747c0=_0x5747c0||0x1f4;return function(_0x5bc547){logger[_0x7ec9('0x23')](_0x5bc547[_0x7ec9('0x24')]);if(_0x5bc547[_0x7ec9('0x25')]){delete _0x5bc547[_0x7ec9('0x25')];}_0x55db81[_0x7ec9('0x19')](_0x5747c0)[_0x7ec9('0x26')](_0x5bc547);};}exports['index']=function(_0x403a19,_0x60bd68){var _0x12d626={},_0x49de50={},_0x32c7d7={'count':0x0,'rows':[]};var _0x552c7c=_[_0x7ec9('0x27')](db[_0x7ec9('0x28')][_0x7ec9('0x29')],function(_0x2f7765){return{'name':_0x2f7765[_0x7ec9('0x2a')],'type':_0x2f7765[_0x7ec9('0x2b')][_0x7ec9('0x2c')]};});_0x49de50[_0x7ec9('0x2d')]=_[_0x7ec9('0x27')](_0x552c7c,_0x7ec9('0x25'));_0x49de50[_0x7ec9('0x2e')]=_[_0x7ec9('0x2f')](_0x403a19[_0x7ec9('0x2e')]);_0x49de50[_0x7ec9('0x30')]=_[_0x7ec9('0x31')](_0x49de50[_0x7ec9('0x2d')],_0x49de50[_0x7ec9('0x2e')]);_0x12d626['attributes']=_[_0x7ec9('0x31')](_0x49de50['model'],qs['fields'](_0x403a19[_0x7ec9('0x2e')]['fields']));_0x12d626['attributes']=_0x12d626[_0x7ec9('0x32')]['length']?_0x12d626[_0x7ec9('0x32')]:_0x49de50[_0x7ec9('0x2d')];if(!_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x33')](_0x7ec9('0x34'))){_0x12d626[_0x7ec9('0x1c')]=qs[_0x7ec9('0x1c')](_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x1c')]);_0x12d626[_0x7ec9('0x1a')]=qs[_0x7ec9('0x1a')](_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x1a')]);}_0x12d626[_0x7ec9('0x35')]=qs[_0x7ec9('0x36')](_0x403a19[_0x7ec9('0x2e')]['sort']);_0x12d626[_0x7ec9('0x37')]=qs[_0x7ec9('0x30')](_[_0x7ec9('0x38')](_0x403a19[_0x7ec9('0x2e')],_0x49de50['filters']),_0x552c7c);if(_0x403a19['query'][_0x7ec9('0x39')]){_0x12d626[_0x7ec9('0x37')]=_['merge'](_0x12d626[_0x7ec9('0x37')],{'$or':_[_0x7ec9('0x27')](_0x552c7c,function(_0x53a706){if(_0x53a706[_0x7ec9('0x2b')]!==_0x7ec9('0x3a')){var _0x605fb0={};_0x605fb0[_0x53a706[_0x7ec9('0x25')]]={'$like':'%'+_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x39')]+'%'};return _0x605fb0;}})});}_0x12d626=_[_0x7ec9('0x3b')]({},_0x12d626,_0x403a19['options']);var _0x592863={'where':_0x12d626[_0x7ec9('0x37')]};return db[_0x7ec9('0x28')][_0x7ec9('0x1b')](_0x592863)[_0x7ec9('0x22')](function(_0x87b9f0){_0x32c7d7[_0x7ec9('0x1b')]=_0x87b9f0;if(_0x403a19[_0x7ec9('0x2e')]['includeAll']){_0x12d626['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x7ec9('0x3c')](_0x12d626);})[_0x7ec9('0x22')](function(_0x3b1ebe){_0x32c7d7[_0x7ec9('0x3d')]=_0x3b1ebe;return _0x32c7d7;})['then'](respondWithFilteredResult(_0x60bd68,_0x12d626))[_0x7ec9('0x3e')](handleError(_0x60bd68,null));};exports[_0x7ec9('0x3f')]=function(_0x5c6a7a,_0x52da5c){var _0x49cd53={'raw':!![],'where':{'id':_0x5c6a7a[_0x7ec9('0x40')]['id']}},_0x21c076={};_0x21c076['model']=_[_0x7ec9('0x2f')](db[_0x7ec9('0x28')][_0x7ec9('0x29')]);_0x21c076[_0x7ec9('0x2e')]=_[_0x7ec9('0x2f')](_0x5c6a7a[_0x7ec9('0x2e')]);_0x21c076['filters']=_['intersection'](_0x21c076[_0x7ec9('0x2d')],_0x21c076[_0x7ec9('0x2e')]);_0x49cd53[_0x7ec9('0x32')]=_['intersection'](_0x21c076[_0x7ec9('0x2d')],qs[_0x7ec9('0x41')](_0x5c6a7a['query'][_0x7ec9('0x41')]));_0x49cd53['attributes']=_0x49cd53[_0x7ec9('0x32')][_0x7ec9('0x42')]?_0x49cd53[_0x7ec9('0x32')]:_0x21c076[_0x7ec9('0x2d')];if(_0x5c6a7a[_0x7ec9('0x2e')][_0x7ec9('0x43')]){_0x49cd53[_0x7ec9('0x44')]=[{'all':!![]}];}_0x49cd53=_[_0x7ec9('0x3b')]({},_0x49cd53,_0x5c6a7a[_0x7ec9('0x45')]);return db[_0x7ec9('0x28')]['find'](_0x49cd53)['then'](handleEntityNotFound(_0x52da5c,null))[_0x7ec9('0x22')](respondWithResult(_0x52da5c,null))['catch'](handleError(_0x52da5c,null));};exports[_0x7ec9('0x46')]=function(_0x5e53ca,_0x48cd44){return db[_0x7ec9('0x28')][_0x7ec9('0x46')](_0x5e53ca['body'],{})[_0x7ec9('0x22')](respondWithResult(_0x48cd44,0xc9))[_0x7ec9('0x3e')](handleError(_0x48cd44,null));};exports[_0x7ec9('0x20')]=function(_0x5162c2,_0x2caff1){if(_0x5162c2[_0x7ec9('0x47')]['id']){delete _0x5162c2[_0x7ec9('0x47')]['id'];}return db[_0x7ec9('0x28')]['find']({'where':{'id':_0x5162c2[_0x7ec9('0x40')]['id']}})[_0x7ec9('0x22')](handleEntityNotFound(_0x2caff1,null))[_0x7ec9('0x22')](saveUpdates(_0x5162c2[_0x7ec9('0x47')],null))[_0x7ec9('0x22')](respondWithResult(_0x2caff1,null))[_0x7ec9('0x3e')](handleError(_0x2caff1,null));};exports['destroy']=function(_0x59febd,_0x2a9655){return db[_0x7ec9('0x28')]['find']({'where':{'id':_0x59febd[_0x7ec9('0x40')]['id']}})[_0x7ec9('0x22')](handleEntityNotFound(_0x2a9655,null))[_0x7ec9('0x22')](removeEntity(_0x2a9655,null))[_0x7ec9('0x3e')](handleError(_0x2a9655,null));};exports[_0x7ec9('0x48')]=function(_0x2319b8,_0x25f9cd){return db[_0x7ec9('0x28')][_0x7ec9('0x48')]()[_0x7ec9('0x22')](respondWithResult(_0x25f9cd,null))['catch'](handleError(_0x25f9cd,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 159f326..1d171f9 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 _0xd60e=['path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2bc540,_0x1d875a){var _0x3bac26=function(_0x4b9136){while(--_0x4b9136){_0x2bc540['push'](_0x2bc540['shift']());}};_0x3bac26(++_0x1d875a);}(_0xd60e,0x1d6));var _0xed60=function(_0x4ba4cd,_0x533876){_0x4ba4cd=_0x4ba4cd-0x0;var _0xa997c7=_0xd60e[_0x4ba4cd];return _0xa997c7;};'use strict';var _=require(_0xed60('0x0'));var util=require(_0xed60('0x1'));var logger=require(_0xed60('0x2'))('api');var moment=require(_0xed60('0x3'));var BPromise=require(_0xed60('0x4'));var rp=require(_0xed60('0x5'));var fs=require('fs');var path=require(_0xed60('0x6'));var rimraf=require(_0xed60('0x7'));var config=require(_0xed60('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xed60('0x9')]=function(_0x4df4f2,_0x9a7a55){return _0x4df4f2[_0xed60('0xa')](_0xed60('0xb'),attributes,{'tableName':_0xed60('0xc'),'paranoid':![],'indexes':[{'name':_0xed60('0xd'),'fields':[_0xed60('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb24d=['report_fax_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb24d,0x1b4));var _0xdb24=function(_0x281e30,_0x208926){_0x281e30=_0x281e30-0x0;var _0x1ad614=_0xb24d[_0x281e30];return _0x1ad614;};'use strict';var _=require('lodash');var util=require(_0xdb24('0x0'));var logger=require(_0xdb24('0x1'))(_0xdb24('0x2'));var moment=require(_0xdb24('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb24('0x4'));var fs=require('fs');var path=require(_0xdb24('0x5'));var rimraf=require(_0xdb24('0x6'));var config=require(_0xdb24('0x7'));var attributes=require(_0xdb24('0x8'));module[_0xdb24('0x9')]=function(_0x997566,_0x3e343e){return _0x997566[_0xdb24('0xa')](_0xdb24('0xb'),attributes,{'tableName':_0xdb24('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdb24('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index d708f07..1ecafc3 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 _0x691b=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x691b,0x1b9));var _0xb691=function(_0x4a2b7d,_0x291f7c){_0x4a2b7d=_0x4a2b7d-0x0;var _0x3d8fb2=_0x691b[_0x4a2b7d];return _0x3d8fb2;};'use strict';var _=require(_0xb691('0x0'));var util=require(_0xb691('0x1'));var moment=require('moment');var BPromise=require(_0xb691('0x2'));var rs=require(_0xb691('0x3'));var fs=require('fs');var Redis=require(_0xb691('0x4'));var db=require(_0xb691('0x5'))['db'];var utils=require(_0xb691('0x6'));var logger=require('../../config/logger')(_0xb691('0x7'));var config=require(_0xb691('0x8'));var jayson=require(_0xb691('0x9'));var client=jayson[_0xb691('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcc527a,_0x416765,_0x7967c2){return new BPromise(function(_0xacb367,_0x57ce54){return client[_0xb691('0xb')](_0xcc527a,_0x7967c2)[_0xb691('0xc')](function(_0x1b3807){logger['info'](_0xb691('0xd'),_0x416765,_0xb691('0xe'));logger[_0xb691('0xf')](_0xb691('0x10'),_0x416765,_0xb691('0xe'),JSON[_0xb691('0x11')](_0x1b3807));if(_0x1b3807[_0xb691('0x12')]){if(_0x1b3807[_0xb691('0x12')]['code']===0x1f4){logger[_0xb691('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x416765,_0x1b3807['error']['message']);return _0x57ce54(_0x1b3807[_0xb691('0x12')]['message']);}logger[_0xb691('0x12')](_0xb691('0xd'),_0x416765,_0x1b3807[_0xb691('0x12')]['message']);return _0xacb367(_0x1b3807[_0xb691('0x12')][_0xb691('0x13')]);}else{logger[_0xb691('0x14')](_0xb691('0xd'),_0x416765,_0xb691('0xe'));_0xacb367(_0x1b3807[_0xb691('0x15')][_0xb691('0x13')]);}})[_0xb691('0x16')](function(_0x397f13){logger[_0xb691('0x12')](_0xb691('0xd'),_0x416765,_0x397f13);_0x57ce54(_0x397f13);});});} \ No newline at end of file +var _0xb385=['jayson/promise','http','then','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1afcff,_0x45e3b1){var _0x48227e=function(_0x4fab67){while(--_0x4fab67){_0x1afcff['push'](_0x1afcff['shift']());}};_0x48227e(++_0x45e3b1);}(_0xb385,0x12a));var _0x5b38=function(_0x558e2f,_0x5f6d5f){_0x558e2f=_0x558e2f-0x0;var _0xf39505=_0xb385[_0x558e2f];return _0xf39505;};'use strict';var _=require(_0x5b38('0x0'));var util=require(_0x5b38('0x1'));var moment=require(_0x5b38('0x2'));var BPromise=require(_0x5b38('0x3'));var rs=require(_0x5b38('0x4'));var fs=require('fs');var Redis=require(_0x5b38('0x5'));var db=require(_0x5b38('0x6'))['db'];var utils=require(_0x5b38('0x7'));var logger=require(_0x5b38('0x8'))('rpc');var config=require(_0x5b38('0x9'));var jayson=require(_0x5b38('0xa'));var client=jayson['client'][_0x5b38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1604c2,_0x55cfaa,_0x594b10){return new BPromise(function(_0x5f4fd3,_0x4e1244){return client['request'](_0x1604c2,_0x594b10)[_0x5b38('0xc')](function(_0x5a95be){logger['info'](_0x5b38('0xd'),_0x55cfaa,'request\x20sent');logger['debug'](_0x5b38('0xe'),_0x55cfaa,_0x5b38('0xf'),JSON[_0x5b38('0x10')](_0x5a95be));if(_0x5a95be[_0x5b38('0x11')]){if(_0x5a95be['error'][_0x5b38('0x12')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x5a95be['error'][_0x5b38('0x13')]);return _0x4e1244(_0x5a95be[_0x5b38('0x11')]['message']);}logger['error'](_0x5b38('0xd'),_0x55cfaa,_0x5a95be[_0x5b38('0x11')]['message']);return _0x5f4fd3(_0x5a95be[_0x5b38('0x11')][_0x5b38('0x13')]);}else{logger[_0x5b38('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x5b38('0xf'));_0x5f4fd3(_0x5a95be[_0x5b38('0x15')][_0x5b38('0x13')]);}})['catch'](function(_0x52c2d4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x52c2d4);_0x4e1244(_0x52c2d4);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index bf58a7d..11cd8ea 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 _0x1098=['express','Router','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x206515,_0x5b2ee8){var _0x43fde1=function(_0x4d6caa){while(--_0x4d6caa){_0x206515['push'](_0x206515['shift']());}};_0x43fde1(++_0x5b2ee8);}(_0x1098,0x9f));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8109('0x0'));var path=require(_0x8109('0x1'));var timeout=require(_0x8109('0x2'));var express=require(_0x8109('0x3'));var router=express[_0x8109('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8109('0x5'));var config=require('../../config/environment');var controller=require(_0x8109('0x6'));router['get']('/',auth[_0x8109('0x7')](),controller['index']);router[_0x8109('0x8')](_0x8109('0x9'),auth[_0x8109('0x7')](),controller[_0x8109('0xa')]);router[_0x8109('0x8')](_0x8109('0xb'),auth[_0x8109('0x7')](),controller[_0x8109('0xc')]);router[_0x8109('0xd')]('/',auth[_0x8109('0x7')](),controller['create']);router[_0x8109('0xe')](_0x8109('0xb'),auth[_0x8109('0x7')](),controller[_0x8109('0xf')]);router['delete'](_0x8109('0xb'),auth[_0x8109('0x7')](),controller[_0x8109('0x10')]);module[_0x8109('0x11')]=router; \ No newline at end of file +var _0x755d=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x292ace,_0x5607ec){var _0x42b447=function(_0x2fb9db){while(--_0x2fb9db){_0x292ace['push'](_0x292ace['shift']());}};_0x42b447(++_0x5607ec);}(_0x755d,0x150));var _0xd755=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0x755d[_0x540160];return _0x476120;};'use strict';var multer=require(_0xd755('0x0'));var util=require(_0xd755('0x1'));var path=require(_0xd755('0x2'));var timeout=require(_0xd755('0x3'));var express=require('express');var router=express[_0xd755('0x4')]();var fs_extra=require(_0xd755('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd755('0x6'));var config=require(_0xd755('0x7'));var controller=require(_0xd755('0x8'));router[_0xd755('0x9')]('/',auth[_0xd755('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd755('0xb')]);router['get'](_0xd755('0xc'),auth[_0xd755('0xa')](),controller[_0xd755('0xd')]);router[_0xd755('0xe')]('/',auth[_0xd755('0xa')](),controller['create']);router[_0xd755('0xf')](_0xd755('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd755('0x10')](_0xd755('0xc'),auth['isAuthenticated'](),controller[_0xd755('0x11')]);module[_0xd755('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f20af4c..7f5ff9c 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 _0x30b9=['get','/:id/configurations','/:id/fields','getFields','post','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated'];(function(_0x44076d,_0x3d88e0){var _0x560ad5=function(_0x5c3dc2){while(--_0x5c3dc2){_0x44076d['push'](_0x44076d['shift']());}};_0x560ad5(++_0x3d88e0);}(_0x30b9,0x1af));var _0x930b=function(_0x59cdf6,_0x5d85e8){_0x59cdf6=_0x59cdf6-0x0;var _0x21a5d0=_0x30b9[_0x59cdf6];return _0x21a5d0;};'use strict';var multer=require('multer');var util=require(_0x930b('0x0'));var path=require('path');var timeout=require(_0x930b('0x1'));var express=require(_0x930b('0x2'));var router=express['Router']();var fs_extra=require(_0x930b('0x3'));var auth=require(_0x930b('0x4'));var interaction=require(_0x930b('0x5'));var config=require(_0x930b('0x6'));var controller=require(_0x930b('0x7'));router['get']('/',auth[_0x930b('0x8')](),controller['index']);router[_0x930b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x930b('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x930b('0x9')](_0x930b('0xb'),auth[_0x930b('0x8')](),controller[_0x930b('0xc')]);router['post']('/',auth[_0x930b('0x8')](),controller['create']);router[_0x930b('0xd')](_0x930b('0xa'),auth[_0x930b('0x8')](),controller['addConfiguration']);router[_0x930b('0xe')](_0x930b('0xf'),auth[_0x930b('0x8')](),controller[_0x930b('0x10')]);router[_0x930b('0x11')](_0x930b('0xf'),auth['isAuthenticated'](),controller[_0x930b('0x12')]);module[_0x930b('0x13')]=router; \ No newline at end of file +var _0xf96b=['express','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf96b,0x16c));var _0xbf96=function(_0x1f2a65,_0x4f24d8){_0x1f2a65=_0x1f2a65-0x0;var _0x46e643=_0xf96b[_0x1f2a65];return _0x46e643;};'use strict';var multer=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var path=require(_0xbf96('0x2'));var timeout=require(_0xbf96('0x3'));var express=require(_0xbf96('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf96('0x5'));var config=require(_0xbf96('0x6'));var controller=require(_0xbf96('0x7'));router[_0xbf96('0x8')]('/',auth[_0xbf96('0x9')](),controller[_0xbf96('0xa')]);router[_0xbf96('0x8')](_0xbf96('0xb'),auth[_0xbf96('0x9')](),controller[_0xbf96('0xc')]);router['get'](_0xbf96('0xd'),auth[_0xbf96('0x9')](),controller[_0xbf96('0xe')]);router[_0xbf96('0x8')]('/:id/fields',auth[_0xbf96('0x9')](),controller[_0xbf96('0xf')]);router[_0xbf96('0x10')]('/',auth[_0xbf96('0x9')](),controller[_0xbf96('0x11')]);router['post']('/:id/configurations',auth[_0xbf96('0x9')](),controller[_0xbf96('0x12')]);router[_0xbf96('0x13')](_0xbf96('0xb'),auth[_0xbf96('0x9')](),controller[_0xbf96('0x14')]);router[_0xbf96('0x15')](_0xbf96('0xb'),auth['isAuthenticated'](),controller[_0xbf96('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 78e3dca..739926f 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 _0x82ea=['basic','integrationTab','newTab','exports','STRING','ENUM'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x82ea,0x99));var _0xa82e=function(_0x2fe07e,_0x2b3224){_0x2fe07e=_0x2fe07e-0x0;var _0x1cd659=_0x82ea[_0x2fe07e];return _0x1cd659;};'use strict';var Sequelize=require('sequelize');module[_0xa82e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa82e('0x1')]},'remoteUri':{'type':Sequelize[_0xa82e('0x1')]},'authType':{'type':Sequelize[_0xa82e('0x2')](_0xa82e('0x3')),'defaultValue':_0xa82e('0x3')},'password':{'type':Sequelize[_0xa82e('0x1')]},'consumerKey':{'type':Sequelize[_0xa82e('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa82e('0x1')]},'tokenSecret':{'type':Sequelize[_0xa82e('0x1')]},'serverUrl':{'type':Sequelize[_0xa82e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa82e('0x2')](_0xa82e('0x4'),_0xa82e('0x5')),'defaultValue':_0xa82e('0x4')}}; \ No newline at end of file +var _0xd1c5=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd1c5,0xb1));var _0x5d1c=function(_0x36e27b,_0x5a7055){_0x36e27b=_0x36e27b-0x0;var _0x5c0d36=_0xd1c5[_0x36e27b];return _0x5c0d36;};'use strict';var Sequelize=require(_0x5d1c('0x0'));module[_0x5d1c('0x1')]={'name':{'type':Sequelize[_0x5d1c('0x2')]},'description':{'type':Sequelize[_0x5d1c('0x2')]},'username':{'type':Sequelize[_0x5d1c('0x2')]},'remoteUri':{'type':Sequelize[_0x5d1c('0x2')]},'authType':{'type':Sequelize[_0x5d1c('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5d1c('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x5d1c('0x2')]},'tokenSecret':{'type':Sequelize[_0x5d1c('0x2')]},'serverUrl':{'type':Sequelize[_0x5d1c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5d1c('0x4'),_0x5d1c('0x5')),'defaultValue':_0x5d1c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9863d36..619af02 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 _0x6063=['GET','format','application/json','headers','%s:%s','toString','concat','entries','label','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','destroy','getConfigurations','DeskConfiguration','options','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','password','consumerKey','token','slice','substring','lastIndexOf'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x6063,0x78));var _0x3606=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6063[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x3606('0x0'));var rimraf=require(_0x3606('0x1'));var zipdir=require(_0x3606('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3606('0x3'));var moment=require('moment');var BPromise=require(_0x3606('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3606('0x5'));var sox=require(_0x3606('0x6'));var csv=require(_0x3606('0x7'));var ejs=require(_0x3606('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3606('0x9'));var toCsv=require('to-csv');var querystring=require(_0x3606('0xa'));var Papa=require('papaparse');var Redis=require(_0x3606('0xb'));var authService=require(_0x3606('0xc'));var qs=require(_0x3606('0xd'));var as=require(_0x3606('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3606('0xf'))(_0x3606('0x10'));var utils=require(_0x3606('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3606('0x12'));var db=require(_0x3606('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x540c86,_0x2902d7){_0x2902d7=_0x2902d7||0xcc;return function(_0x5449de){if(_0x5449de){return _0x540c86[_0x3606('0x14')](_0x2902d7);}return _0x540c86[_0x3606('0x15')](_0x2902d7)[_0x3606('0x16')]();};}function respondWithResult(_0x1d451a,_0xb213da){_0xb213da=_0xb213da||0xc8;return function(_0x50c336){if(_0x50c336){return _0x1d451a['status'](_0xb213da)[_0x3606('0x17')](_0x50c336);}};}function respondWithFilteredResult(_0x327827,_0x55e008){return function(_0x3ab22b){if(_0x3ab22b){var _0x2075cb=typeof _0x55e008[_0x3606('0x18')]===_0x3606('0x19')&&typeof _0x55e008[_0x3606('0x1a')]===_0x3606('0x19');var _0x2ab3d3=_0x3ab22b[_0x3606('0x1b')];var _0x2bdef6=_0x2075cb?0x0:_0x55e008[_0x3606('0x18')];var _0x4c2818=_0x2075cb?_0x3ab22b[_0x3606('0x1b')]:_0x55e008['offset']+_0x55e008[_0x3606('0x1a')];var _0x396f87;if(_0x4c2818>=_0x2ab3d3){_0x4c2818=_0x2ab3d3;_0x396f87=0xc8;}else{_0x396f87=0xce;}_0x327827[_0x3606('0x15')](_0x396f87);return _0x327827[_0x3606('0x1c')](_0x3606('0x1d'),_0x2bdef6+'-'+_0x4c2818+'/'+_0x2ab3d3)[_0x3606('0x17')](_0x3ab22b);}return null;};}function patchUpdates(_0x1aad44){return function(_0x2e0db3){try{jsonpatch[_0x3606('0x1e')](_0x2e0db3,_0x1aad44,!![]);}catch(_0x46e057){return BPromise[_0x3606('0x1f')](_0x46e057);}return _0x2e0db3[_0x3606('0x20')]();};}function saveUpdates(_0x359d0d,_0x3b9dbe){return function(_0x2a80a3){if(_0x2a80a3){return _0x2a80a3['update'](_0x359d0d)[_0x3606('0x21')](function(_0x28475a){return _0x28475a;});}return null;};}function removeEntity(_0x121496,_0x312901){return function(_0x68fca5){if(_0x68fca5){return _0x68fca5['destroy']()[_0x3606('0x21')](function(){_0x121496[_0x3606('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46cd87,_0x5b4de8){return function(_0x3a0c9d){if(!_0x3a0c9d){_0x46cd87[_0x3606('0x14')](0x194);}return _0x3a0c9d;};}function handleError(_0x40ce2a,_0x540424){_0x540424=_0x540424||0x1f4;return function(_0x178a08){logger[_0x3606('0x22')](_0x178a08[_0x3606('0x23')]);if(_0x178a08['name']){delete _0x178a08[_0x3606('0x24')];}_0x40ce2a['status'](_0x540424)[_0x3606('0x25')](_0x178a08);};}exports[_0x3606('0x26')]=function(_0x1e0ada,_0x457a33){var _0xd0ff12={},_0xd344e3={},_0x200126={'count':0x0,'rows':[]};var _0x41061c=_[_0x3606('0x27')](db[_0x3606('0x28')][_0x3606('0x29')],function(_0x1ca755){return{'name':_0x1ca755['fieldName'],'type':_0x1ca755[_0x3606('0x2a')][_0x3606('0x2b')]};});_0xd344e3['model']=_['map'](_0x41061c,_0x3606('0x24'));_0xd344e3[_0x3606('0x2c')]=_[_0x3606('0x2d')](_0x1e0ada[_0x3606('0x2c')]);_0xd344e3[_0x3606('0x2e')]=_['intersection'](_0xd344e3[_0x3606('0x2f')],_0xd344e3[_0x3606('0x2c')]);_0xd0ff12[_0x3606('0x30')]=_[_0x3606('0x31')](_0xd344e3[_0x3606('0x2f')],qs[_0x3606('0x32')](_0x1e0ada[_0x3606('0x2c')][_0x3606('0x32')]));_0xd0ff12[_0x3606('0x30')]=_0xd0ff12['attributes'][_0x3606('0x33')]?_0xd0ff12[_0x3606('0x30')]:_0xd344e3[_0x3606('0x2f')];if(!_0x1e0ada[_0x3606('0x2c')][_0x3606('0x34')](_0x3606('0x35'))){_0xd0ff12[_0x3606('0x1a')]=qs[_0x3606('0x1a')](_0x1e0ada[_0x3606('0x2c')][_0x3606('0x1a')]);_0xd0ff12[_0x3606('0x18')]=qs[_0x3606('0x18')](_0x1e0ada[_0x3606('0x2c')][_0x3606('0x18')]);}_0xd0ff12[_0x3606('0x36')]=qs[_0x3606('0x37')](_0x1e0ada[_0x3606('0x2c')][_0x3606('0x37')]);_0xd0ff12[_0x3606('0x38')]=qs[_0x3606('0x2e')](_[_0x3606('0x39')](_0x1e0ada[_0x3606('0x2c')],_0xd344e3[_0x3606('0x2e')]),_0x41061c);if(_0x1e0ada['query'][_0x3606('0x3a')]){_0xd0ff12[_0x3606('0x38')]=_[_0x3606('0x3b')](_0xd0ff12[_0x3606('0x38')],{'$or':_[_0x3606('0x27')](_0x41061c,function(_0x45806a){if(_0x45806a[_0x3606('0x2a')]!==_0x3606('0x3c')){var _0x50997a={};_0x50997a[_0x45806a[_0x3606('0x24')]]={'$like':'%'+_0x1e0ada[_0x3606('0x2c')][_0x3606('0x3a')]+'%'};return _0x50997a;}})});}_0xd0ff12=_[_0x3606('0x3b')]({},_0xd0ff12,_0x1e0ada['options']);var _0x3359b2={'where':_0xd0ff12[_0x3606('0x38')]};return db[_0x3606('0x28')][_0x3606('0x1b')](_0x3359b2)[_0x3606('0x21')](function(_0x16b6ce){_0x200126['count']=_0x16b6ce;if(_0x1e0ada[_0x3606('0x2c')][_0x3606('0x3d')]){_0xd0ff12[_0x3606('0x3e')]=[{'all':!![]}];}return db[_0x3606('0x28')][_0x3606('0x3f')](_0xd0ff12);})['then'](function(_0xeffe4d){_0x200126[_0x3606('0x40')]=_0xeffe4d;return _0x200126;})[_0x3606('0x21')](respondWithFilteredResult(_0x457a33,_0xd0ff12))['catch'](handleError(_0x457a33,null));};exports[_0x3606('0x41')]=function(_0x14718b,_0x3b40a4){var _0x50d80a={'raw':![],'where':{'id':_0x14718b[_0x3606('0x42')]['id']}},_0x58ba36={};_0x58ba36['model']=_[_0x3606('0x2d')](db[_0x3606('0x28')][_0x3606('0x29')]);_0x58ba36[_0x3606('0x2c')]=_[_0x3606('0x2d')](_0x14718b['query']);_0x58ba36[_0x3606('0x2e')]=_[_0x3606('0x31')](_0x58ba36[_0x3606('0x2f')],_0x58ba36[_0x3606('0x2c')]);_0x50d80a[_0x3606('0x30')]=_[_0x3606('0x31')](_0x58ba36[_0x3606('0x2f')],qs['fields'](_0x14718b['query']['fields']));_0x50d80a['attributes']=_0x50d80a[_0x3606('0x30')][_0x3606('0x33')]?_0x50d80a[_0x3606('0x30')]:_0x58ba36['model'];if(_0x14718b[_0x3606('0x2c')][_0x3606('0x3d')]){_0x50d80a[_0x3606('0x3e')]=[{'all':!![]}];}_0x50d80a=_[_0x3606('0x3b')]({},_0x50d80a,_0x14718b['options']);return db['DeskAccount'][_0x3606('0x43')](_0x50d80a)[_0x3606('0x21')](handleEntityNotFound(_0x3b40a4,null))[_0x3606('0x21')](respondWithResult(_0x3b40a4,null))[_0x3606('0x44')](handleError(_0x3b40a4,null));};exports[_0x3606('0x45')]=function(_0x755bb3,_0x575fc0){return db[_0x3606('0x28')][_0x3606('0x45')](_0x755bb3[_0x3606('0x46')],{})[_0x3606('0x21')](respondWithResult(_0x575fc0,0xc9))[_0x3606('0x44')](handleError(_0x575fc0,null));};exports[_0x3606('0x47')]=function(_0x3fe060,_0x541ce9){if(_0x3fe060[_0x3606('0x46')]['id']){delete _0x3fe060[_0x3606('0x46')]['id'];}return db[_0x3606('0x28')][_0x3606('0x43')]({'where':{'id':_0x3fe060['params']['id']}})[_0x3606('0x21')](handleEntityNotFound(_0x541ce9,null))[_0x3606('0x21')](saveUpdates(_0x3fe060[_0x3606('0x46')],null))['then'](respondWithResult(_0x541ce9,null))[_0x3606('0x44')](handleError(_0x541ce9,null));};exports[_0x3606('0x48')]=function(_0xbc1cef,_0x4be5a3){return db[_0x3606('0x28')]['find']({'where':{'id':_0xbc1cef[_0x3606('0x42')]['id']}})[_0x3606('0x21')](handleEntityNotFound(_0x4be5a3,null))[_0x3606('0x21')](removeEntity(_0x4be5a3,null))[_0x3606('0x44')](handleError(_0x4be5a3,null));};exports[_0x3606('0x49')]=function(_0x3ca0af,_0x5c63a1,_0x461ef5){var _0x615b09={};var _0x25cb7a={};var _0x1f2d0b;var _0x451907;return db[_0x3606('0x28')]['findOne']({'where':{'id':_0x3ca0af[_0x3606('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c63a1,null))['then'](function(_0x43c58e){if(_0x43c58e){_0x1f2d0b=_0x43c58e;_0x25cb7a[_0x3606('0x2f')]=_[_0x3606('0x2d')](db[_0x3606('0x4a')][_0x3606('0x29')]);_0x25cb7a[_0x3606('0x2c')]=_[_0x3606('0x2d')](_0x3ca0af['query']);_0x25cb7a[_0x3606('0x2e')]=_[_0x3606('0x31')](_0x25cb7a[_0x3606('0x2f')],_0x25cb7a['query']);_0x615b09[_0x3606('0x30')]=_[_0x3606('0x31')](_0x25cb7a[_0x3606('0x2f')],qs[_0x3606('0x32')](_0x3ca0af[_0x3606('0x2c')][_0x3606('0x32')]));_0x615b09[_0x3606('0x30')]=_0x615b09[_0x3606('0x30')][_0x3606('0x33')]?_0x615b09['attributes']:_0x25cb7a[_0x3606('0x2f')];_0x615b09['order']=qs['sort'](_0x3ca0af['query'][_0x3606('0x37')]);_0x615b09['where']=qs[_0x3606('0x2e')](_[_0x3606('0x39')](_0x3ca0af['query'],_0x25cb7a[_0x3606('0x2e')]));if(_0x3ca0af[_0x3606('0x2c')][_0x3606('0x3a')]){_0x615b09['where']=_[_0x3606('0x3b')](_0x615b09[_0x3606('0x38')],{'$or':_[_0x3606('0x27')](_0x615b09[_0x3606('0x30')],function(_0xf7894a){var _0x25124b={};_0x25124b[_0xf7894a]={'$like':'%'+_0x3ca0af['query'][_0x3606('0x3a')]+'%'};return _0x25124b;})});}_0x615b09=_['merge']({},_0x615b09,_0x3ca0af[_0x3606('0x4b')]);return _0x1f2d0b[_0x3606('0x49')](_0x615b09);}})[_0x3606('0x21')](function(_0x470e0c){if(_0x470e0c){_0x451907=_0x470e0c[_0x3606('0x33')];if(!_0x3ca0af[_0x3606('0x2c')][_0x3606('0x34')](_0x3606('0x35'))){_0x615b09[_0x3606('0x1a')]=qs[_0x3606('0x1a')](_0x3ca0af[_0x3606('0x2c')]['limit']);_0x615b09['offset']=qs[_0x3606('0x18')](_0x3ca0af[_0x3606('0x2c')][_0x3606('0x18')]);}return _0x1f2d0b['getConfigurations'](_0x615b09);}})['then'](function(_0x5d88f6){if(_0x5d88f6){return _0x5d88f6?{'count':_0x451907,'rows':_0x5d88f6}:null;}})['then'](respondWithResult(_0x5c63a1,null))[_0x3606('0x44')](handleError(_0x5c63a1,null));};exports[_0x3606('0x4c')]=function(_0x51ea62,_0xa7ed89,_0x52cd6b){if(_0x51ea62[_0x3606('0x46')]['id']){delete _0x51ea62[_0x3606('0x46')]['id'];}return db[_0x3606('0x28')]['findOne']({'where':{'id':_0x51ea62['params']['id']}})['then'](handleEntityNotFound(_0xa7ed89,null))[_0x3606('0x21')](function(_0x428b95){if(_0x428b95){_0x51ea62['body']['AccountId']=_0x428b95['id'];_0x51ea62['body'][_0x3606('0x4d')]=integrations[_0x3606('0x4e')](_0x51ea62['body']['channel'],_0x51ea62['body'][_0x3606('0x2a')]);_0x51ea62[_0x3606('0x46')][_0x3606('0x4f')]=integrations[_0x3606('0x50')](_0x51ea62[_0x3606('0x46')]['channel'],_0x51ea62[_0x3606('0x46')][_0x3606('0x2a')]);return db[_0x3606('0x4a')]['create'](_0x51ea62[_0x3606('0x46')],{'include':[{'model':db[_0x3606('0x51')],'as':'Subjects'},{'model':db[_0x3606('0x51')],'as':_0x3606('0x4f')}]});}return null;})['then'](respondWithResult(_0xa7ed89,null))[_0x3606('0x44')](handleError(_0xa7ed89,null));};exports[_0x3606('0x52')]=function(_0x16ceca,_0x4ef6af,_0x1df96e){var _0x18251d=[{'name':_0x3606('0x53'),'label':_0x3606('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 _0x21792e='';return db[_0x3606('0x28')][_0x3606('0x54')]({'where':{'id':_0x16ceca[_0x3606('0x42')]['id']},'attributes':['id',_0x3606('0x55'),_0x3606('0x56'),_0x3606('0x57'),_0x3606('0x58'),_0x3606('0x59'),'consumerSecret',_0x3606('0x5a'),'tokenSecret']})[_0x3606('0x21')](handleEntityNotFound(_0x4ef6af,null))[_0x3606('0x21')](function(_0x283b54){if(_0x283b54){_0x21792e=_0x283b54['remoteUri'];var _0x47d017=_0x21792e[_0x3606('0x5b')](-0x1);if(_0x47d017==='/'){_0x21792e=_0x21792e[_0x3606('0x5c')](0x0,_0x21792e[_0x3606('0x5d')](_0x47d017));}var _0x2616e6={'method':_0x3606('0x5e'),'uri':util[_0x3606('0x5f')]('%s/custom_fields',_0x21792e),'headers':{'Content-Type':_0x3606('0x60'),'Accept':_0x3606('0x60')},'json':!![]};if(_0x283b54['authType']==='basic'){_0x2616e6[_0x3606('0x61')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x3606('0x5f')](_0x3606('0x62'),_0x283b54[_0x3606('0x57')],_0x283b54[_0x3606('0x58')]))[_0x3606('0x63')]('base64'));}return rp(_0x2616e6)[_0x3606('0x21')](function(_0x2b04a0){return _0x18251d[_0x3606('0x64')](_['map'](_0x2b04a0['_embedded'][_0x3606('0x65')],function(_0x26cb3f){return{'id':_0x26cb3f[_0x3606('0x24')],'name':_0x26cb3f[_0x3606('0x24')],'type':_0x26cb3f[_0x3606('0x2a')],'active':_0x26cb3f['active'],'label':_0x26cb3f[_0x3606('0x66')],'custom':!![]};}));});}})[_0x3606('0x21')](function(_0x352d0d){return{'count':_0x352d0d[_0x3606('0x33')],'rows':_0x352d0d};})[_0x3606('0x21')](respondWithResult(_0x4ef6af,null))[_0x3606('0x44')](function(_0x106ff4){var _0x2036a1=_0x16ceca[_0x3606('0x2c')]['test']?0x1f4:_0x106ff4[_0x3606('0x67')]||0x1f4;logger[_0x3606('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2036a1,JSON[_0x3606('0x68')](_0x106ff4));delete _0x106ff4[_0x3606('0x24')];if(_0x2036a1===0x191){_0x2036a1=0x190;}_0x4ef6af[_0x3606('0x15')](_0x2036a1)['send'](_0x16ceca[_0x3606('0x2c')][_0x3606('0x69')]?{'message':_0x3606('0x6a'),'statusCode':_0x106ff4[_0x3606('0x67')]}:_0x106ff4);});}; \ No newline at end of file +var _0xb00a=['params','keys','merge','find','catch','create','body','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','basic','headers','toString','base64','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','DeskAccount','includeAll','include','findAll'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb00a,0x99));var _0xab00=function(_0x3ad93c,_0x380191){_0x3ad93c=_0x3ad93c-0x0;var _0x52a453=_0xb00a[_0x3ad93c];return _0x52a453;};'use strict';var emlformat=require(_0xab00('0x0'));var rimraf=require(_0xab00('0x1'));var zipdir=require(_0xab00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab00('0x3'));var moment=require(_0xab00('0x4'));var BPromise=require(_0xab00('0x5'));var Mustache=require(_0xab00('0x6'));var util=require(_0xab00('0x7'));var path=require(_0xab00('0x8'));var sox=require(_0xab00('0x9'));var csv=require('to-csv');var ejs=require(_0xab00('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab00('0xb'));var squel=require(_0xab00('0xc'));var crypto=require(_0xab00('0xd'));var jsforce=require(_0xab00('0xe'));var deskjs=require(_0xab00('0xf'));var toCsv=require(_0xab00('0x10'));var querystring=require('querystring');var Papa=require(_0xab00('0x11'));var Redis=require(_0xab00('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xab00('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab00('0x14'));var logger=require('../../config/logger')(_0xab00('0x15'));var utils=require(_0xab00('0x16'));var config=require(_0xab00('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x442a87,_0xa44cfc){_0xa44cfc=_0xa44cfc||0xcc;return function(_0x1b7ec0){if(_0x1b7ec0){return _0x442a87[_0xab00('0x18')](_0xa44cfc);}return _0x442a87['status'](_0xa44cfc)[_0xab00('0x19')]();};}function respondWithResult(_0x5a32bb,_0x3c818e){_0x3c818e=_0x3c818e||0xc8;return function(_0x4f88a1){if(_0x4f88a1){return _0x5a32bb[_0xab00('0x1a')](_0x3c818e)[_0xab00('0x1b')](_0x4f88a1);}};}function respondWithFilteredResult(_0x1cf715,_0x433f73){return function(_0x3e22c3){if(_0x3e22c3){var _0xb2dc65=typeof _0x433f73[_0xab00('0x1c')]===_0xab00('0x1d')&&typeof _0x433f73[_0xab00('0x1e')]===_0xab00('0x1d');var _0x4b8249=_0x3e22c3[_0xab00('0x1f')];var _0x380292=_0xb2dc65?0x0:_0x433f73[_0xab00('0x1c')];var _0x5650a3=_0xb2dc65?_0x3e22c3[_0xab00('0x1f')]:_0x433f73[_0xab00('0x1c')]+_0x433f73['limit'];var _0x3a240f;if(_0x5650a3>=_0x4b8249){_0x5650a3=_0x4b8249;_0x3a240f=0xc8;}else{_0x3a240f=0xce;}_0x1cf715['status'](_0x3a240f);return _0x1cf715['set'](_0xab00('0x20'),_0x380292+'-'+_0x5650a3+'/'+_0x4b8249)['json'](_0x3e22c3);}return null;};}function patchUpdates(_0x11a100){return function(_0x3593d6){try{jsonpatch[_0xab00('0x21')](_0x3593d6,_0x11a100,!![]);}catch(_0x276b35){return BPromise[_0xab00('0x22')](_0x276b35);}return _0x3593d6['save']();};}function saveUpdates(_0x99ab1a,_0x3873a1){return function(_0x347e5f){if(_0x347e5f){return _0x347e5f[_0xab00('0x23')](_0x99ab1a)[_0xab00('0x24')](function(_0x36b98f){return _0x36b98f;});}return null;};}function removeEntity(_0x38b935,_0x2d7997){return function(_0x388a1e){if(_0x388a1e){return _0x388a1e[_0xab00('0x25')]()[_0xab00('0x24')](function(){_0x38b935[_0xab00('0x1a')](0xcc)[_0xab00('0x19')]();});}};}function handleEntityNotFound(_0x53cc0,_0x28f5d6){return function(_0x73996d){if(!_0x73996d){_0x53cc0[_0xab00('0x18')](0x194);}return _0x73996d;};}function handleError(_0x6a2fee,_0x5247b6){_0x5247b6=_0x5247b6||0x1f4;return function(_0x13ff2c){logger['error'](_0x13ff2c[_0xab00('0x26')]);if(_0x13ff2c[_0xab00('0x27')]){delete _0x13ff2c[_0xab00('0x27')];}_0x6a2fee[_0xab00('0x1a')](_0x5247b6)[_0xab00('0x28')](_0x13ff2c);};}exports[_0xab00('0x29')]=function(_0x146ba0,_0x2c5c24){var _0x558235={},_0x5a5024={},_0x331f80={'count':0x0,'rows':[]};var _0x598e91=_['map'](db['DeskAccount'][_0xab00('0x2a')],function(_0x280fad){return{'name':_0x280fad[_0xab00('0x2b')],'type':_0x280fad[_0xab00('0x2c')][_0xab00('0x2d')]};});_0x5a5024['model']=_[_0xab00('0x2e')](_0x598e91,'name');_0x5a5024['query']=_['keys'](_0x146ba0[_0xab00('0x2f')]);_0x5a5024[_0xab00('0x30')]=_[_0xab00('0x31')](_0x5a5024['model'],_0x5a5024[_0xab00('0x2f')]);_0x558235[_0xab00('0x32')]=_[_0xab00('0x31')](_0x5a5024[_0xab00('0x33')],qs['fields'](_0x146ba0[_0xab00('0x2f')][_0xab00('0x34')]));_0x558235['attributes']=_0x558235[_0xab00('0x32')][_0xab00('0x35')]?_0x558235[_0xab00('0x32')]:_0x5a5024['model'];if(!_0x146ba0['query'][_0xab00('0x36')](_0xab00('0x37'))){_0x558235[_0xab00('0x1e')]=qs[_0xab00('0x1e')](_0x146ba0['query'][_0xab00('0x1e')]);_0x558235[_0xab00('0x1c')]=qs[_0xab00('0x1c')](_0x146ba0[_0xab00('0x2f')][_0xab00('0x1c')]);}_0x558235[_0xab00('0x38')]=qs[_0xab00('0x39')](_0x146ba0['query'][_0xab00('0x39')]);_0x558235[_0xab00('0x3a')]=qs[_0xab00('0x30')](_[_0xab00('0x3b')](_0x146ba0[_0xab00('0x2f')],_0x5a5024[_0xab00('0x30')]),_0x598e91);if(_0x146ba0[_0xab00('0x2f')][_0xab00('0x3c')]){_0x558235['where']=_['merge'](_0x558235[_0xab00('0x3a')],{'$or':_[_0xab00('0x2e')](_0x598e91,function(_0x4d321c){if(_0x4d321c[_0xab00('0x2c')]!==_0xab00('0x3d')){var _0x3b8f79={};_0x3b8f79[_0x4d321c[_0xab00('0x27')]]={'$like':'%'+_0x146ba0[_0xab00('0x2f')]['filter']+'%'};return _0x3b8f79;}})});}_0x558235=_['merge']({},_0x558235,_0x146ba0[_0xab00('0x3e')]);var _0x1bfbc7={'where':_0x558235[_0xab00('0x3a')]};return db[_0xab00('0x3f')][_0xab00('0x1f')](_0x1bfbc7)[_0xab00('0x24')](function(_0x37db3a){_0x331f80['count']=_0x37db3a;if(_0x146ba0[_0xab00('0x2f')][_0xab00('0x40')]){_0x558235[_0xab00('0x41')]=[{'all':!![]}];}return db[_0xab00('0x3f')][_0xab00('0x42')](_0x558235);})[_0xab00('0x24')](function(_0x1d5e34){_0x331f80['rows']=_0x1d5e34;return _0x331f80;})[_0xab00('0x24')](respondWithFilteredResult(_0x2c5c24,_0x558235))['catch'](handleError(_0x2c5c24,null));};exports['show']=function(_0x4681ce,_0x368523){var _0x5b767c={'raw':![],'where':{'id':_0x4681ce[_0xab00('0x43')]['id']}},_0x35b0bc={};_0x35b0bc['model']=_[_0xab00('0x44')](db[_0xab00('0x3f')][_0xab00('0x2a')]);_0x35b0bc[_0xab00('0x2f')]=_['keys'](_0x4681ce[_0xab00('0x2f')]);_0x35b0bc[_0xab00('0x30')]=_['intersection'](_0x35b0bc[_0xab00('0x33')],_0x35b0bc[_0xab00('0x2f')]);_0x5b767c[_0xab00('0x32')]=_['intersection'](_0x35b0bc[_0xab00('0x33')],qs['fields'](_0x4681ce[_0xab00('0x2f')][_0xab00('0x34')]));_0x5b767c['attributes']=_0x5b767c[_0xab00('0x32')][_0xab00('0x35')]?_0x5b767c[_0xab00('0x32')]:_0x35b0bc[_0xab00('0x33')];if(_0x4681ce[_0xab00('0x2f')][_0xab00('0x40')]){_0x5b767c[_0xab00('0x41')]=[{'all':!![]}];}_0x5b767c=_[_0xab00('0x45')]({},_0x5b767c,_0x4681ce[_0xab00('0x3e')]);return db[_0xab00('0x3f')][_0xab00('0x46')](_0x5b767c)[_0xab00('0x24')](handleEntityNotFound(_0x368523,null))[_0xab00('0x24')](respondWithResult(_0x368523,null))[_0xab00('0x47')](handleError(_0x368523,null));};exports[_0xab00('0x48')]=function(_0x5d170b,_0x144d3d){return db[_0xab00('0x3f')]['create'](_0x5d170b[_0xab00('0x49')],{})['then'](respondWithResult(_0x144d3d,0xc9))[_0xab00('0x47')](handleError(_0x144d3d,null));};exports[_0xab00('0x23')]=function(_0x5a26f8,_0x5e206d){if(_0x5a26f8[_0xab00('0x49')]['id']){delete _0x5a26f8[_0xab00('0x49')]['id'];}return db[_0xab00('0x3f')][_0xab00('0x46')]({'where':{'id':_0x5a26f8[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x5e206d,null))[_0xab00('0x24')](saveUpdates(_0x5a26f8['body'],null))[_0xab00('0x24')](respondWithResult(_0x5e206d,null))[_0xab00('0x47')](handleError(_0x5e206d,null));};exports[_0xab00('0x25')]=function(_0x215f54,_0x9d7602){return db[_0xab00('0x3f')][_0xab00('0x46')]({'where':{'id':_0x215f54[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x9d7602,null))[_0xab00('0x24')](removeEntity(_0x9d7602,null))['catch'](handleError(_0x9d7602,null));};exports[_0xab00('0x4a')]=function(_0x582482,_0x3797e2,_0x5205fa){var _0x2c6910={};var _0x2658e1={};var _0x18b171;var _0x342ebe;return db[_0xab00('0x3f')]['findOne']({'where':{'id':_0x582482['params']['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x3797e2,null))[_0xab00('0x24')](function(_0x5a6d69){if(_0x5a6d69){_0x18b171=_0x5a6d69;_0x2658e1[_0xab00('0x33')]=_[_0xab00('0x44')](db[_0xab00('0x4b')][_0xab00('0x2a')]);_0x2658e1[_0xab00('0x2f')]=_[_0xab00('0x44')](_0x582482[_0xab00('0x2f')]);_0x2658e1[_0xab00('0x30')]=_['intersection'](_0x2658e1[_0xab00('0x33')],_0x2658e1['query']);_0x2c6910[_0xab00('0x32')]=_[_0xab00('0x31')](_0x2658e1[_0xab00('0x33')],qs[_0xab00('0x34')](_0x582482[_0xab00('0x2f')][_0xab00('0x34')]));_0x2c6910['attributes']=_0x2c6910[_0xab00('0x32')][_0xab00('0x35')]?_0x2c6910['attributes']:_0x2658e1['model'];_0x2c6910[_0xab00('0x38')]=qs[_0xab00('0x39')](_0x582482[_0xab00('0x2f')][_0xab00('0x39')]);_0x2c6910[_0xab00('0x3a')]=qs[_0xab00('0x30')](_[_0xab00('0x3b')](_0x582482[_0xab00('0x2f')],_0x2658e1[_0xab00('0x30')]));if(_0x582482[_0xab00('0x2f')][_0xab00('0x3c')]){_0x2c6910['where']=_[_0xab00('0x45')](_0x2c6910['where'],{'$or':_['map'](_0x2c6910[_0xab00('0x32')],function(_0x5aa16d){var _0x4058ca={};_0x4058ca[_0x5aa16d]={'$like':'%'+_0x582482[_0xab00('0x2f')][_0xab00('0x3c')]+'%'};return _0x4058ca;})});}_0x2c6910=_['merge']({},_0x2c6910,_0x582482[_0xab00('0x3e')]);return _0x18b171[_0xab00('0x4a')](_0x2c6910);}})[_0xab00('0x24')](function(_0x49e559){if(_0x49e559){_0x342ebe=_0x49e559[_0xab00('0x35')];if(!_0x582482[_0xab00('0x2f')][_0xab00('0x36')](_0xab00('0x37'))){_0x2c6910[_0xab00('0x1e')]=qs[_0xab00('0x1e')](_0x582482[_0xab00('0x2f')][_0xab00('0x1e')]);_0x2c6910[_0xab00('0x1c')]=qs['offset'](_0x582482[_0xab00('0x2f')]['offset']);}return _0x18b171[_0xab00('0x4a')](_0x2c6910);}})['then'](function(_0x18ed6a){if(_0x18ed6a){return _0x18ed6a?{'count':_0x342ebe,'rows':_0x18ed6a}:null;}})[_0xab00('0x24')](respondWithResult(_0x3797e2,null))['catch'](handleError(_0x3797e2,null));};exports[_0xab00('0x4c')]=function(_0x12d67d,_0x2dcbb4,_0x471a04){if(_0x12d67d[_0xab00('0x49')]['id']){delete _0x12d67d['body']['id'];}return db['DeskAccount'][_0xab00('0x4d')]({'where':{'id':_0x12d67d[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x2dcbb4,null))[_0xab00('0x24')](function(_0x2ea5b2){if(_0x2ea5b2){_0x12d67d[_0xab00('0x49')][_0xab00('0x4e')]=_0x2ea5b2['id'];_0x12d67d[_0xab00('0x49')]['Subjects']=integrations[_0xab00('0x4f')](_0x12d67d[_0xab00('0x49')][_0xab00('0x50')],_0x12d67d['body'][_0xab00('0x2c')]);_0x12d67d['body'][_0xab00('0x51')]=integrations[_0xab00('0x52')](_0x12d67d[_0xab00('0x49')][_0xab00('0x50')],_0x12d67d[_0xab00('0x49')][_0xab00('0x2c')]);return db['DeskConfiguration'][_0xab00('0x48')](_0x12d67d[_0xab00('0x49')],{'include':[{'model':db['DeskField'],'as':_0xab00('0x53')},{'model':db[_0xab00('0x54')],'as':_0xab00('0x51')}]});}return null;})[_0xab00('0x24')](respondWithResult(_0x2dcbb4,null))[_0xab00('0x47')](handleError(_0x2dcbb4,null));};exports[_0xab00('0x55')]=function(_0x3a64c5,_0x48489f,_0x3af81a){var _0x1f509b=[{'name':'priority','label':_0xab00('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4a843b='';return db[_0xab00('0x3f')][_0xab00('0x4d')]({'where':{'id':_0x3a64c5[_0xab00('0x43')]['id']},'attributes':['id',_0xab00('0x57'),'authType',_0xab00('0x58'),_0xab00('0x59'),_0xab00('0x5a'),_0xab00('0x5b'),_0xab00('0x5c'),_0xab00('0x5d')]})[_0xab00('0x24')](handleEntityNotFound(_0x48489f,null))[_0xab00('0x24')](function(_0x3e8e61){if(_0x3e8e61){_0x4a843b=_0x3e8e61[_0xab00('0x57')];var _0x12d35a=_0x4a843b['slice'](-0x1);if(_0x12d35a==='/'){_0x4a843b=_0x4a843b[_0xab00('0x5e')](0x0,_0x4a843b['lastIndexOf'](_0x12d35a));}var _0x31f238={'method':_0xab00('0x5f'),'uri':util[_0xab00('0x60')](_0xab00('0x61'),_0x4a843b),'headers':{'Content-Type':_0xab00('0x62'),'Accept':'application/json'},'json':!![]};if(_0x3e8e61['authType']===_0xab00('0x63')){_0x31f238[_0xab00('0x64')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0xab00('0x60')]('%s:%s',_0x3e8e61[_0xab00('0x58')],_0x3e8e61['password']))[_0xab00('0x65')](_0xab00('0x66')));}return rp(_0x31f238)['then'](function(_0x29cd2b){return _0x1f509b['concat'](_[_0xab00('0x2e')](_0x29cd2b['_embedded']['entries'],function(_0x1fb1f6){return{'id':_0x1fb1f6['name'],'name':_0x1fb1f6[_0xab00('0x27')],'type':_0x1fb1f6[_0xab00('0x2c')],'active':_0x1fb1f6[_0xab00('0x67')],'label':_0x1fb1f6[_0xab00('0x68')],'custom':!![]};}));});}})[_0xab00('0x24')](function(_0x1ae865){return{'count':_0x1ae865[_0xab00('0x35')],'rows':_0x1ae865};})[_0xab00('0x24')](respondWithResult(_0x48489f,null))[_0xab00('0x47')](function(_0x51b7f9){var _0x1b205e=_0x3a64c5[_0xab00('0x2f')][_0xab00('0x69')]?0x1f4:_0x51b7f9[_0xab00('0x6a')]||0x1f4;logger['error'](_0xab00('0x6b'),_0xab00('0x55'),_0x1b205e,JSON[_0xab00('0x6c')](_0x51b7f9));delete _0x51b7f9[_0xab00('0x27')];if(_0x1b205e===0x191){_0x1b205e=0x190;}_0x48489f['status'](_0x1b205e)[_0xab00('0x28')](_0x3a64c5[_0xab00('0x2f')][_0xab00('0x69')]?{'message':_0xab00('0x6d'),'statusCode':_0x51b7f9['statusCode']}:_0x51b7f9);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index fb6c733..b555fc2 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 _0x95d6=['define','int_desk_accounts','lodash','util','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x95d6,0x7b));var _0x695d=function(_0x349ccc,_0x4df493){_0x349ccc=_0x349ccc-0x0;var _0x2f1d1a=_0x95d6[_0x349ccc];return _0x2f1d1a;};'use strict';var _=require(_0x695d('0x0'));var util=require(_0x695d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x695d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x695d('0x3'));var rimraf=require(_0x695d('0x4'));var config=require(_0x695d('0x5'));var attributes=require(_0x695d('0x6'));var integrations=require(_0x695d('0x7'));module[_0x695d('0x8')]=function(_0x1e5fa6,_0x16ee15){return _0x1e5fa6[_0x695d('0x9')]('DeskAccount',attributes,{'tableName':_0x695d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0041=['exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0041,0xe8));var _0x1004=function(_0x111225,_0xcdcd11){_0x111225=_0x111225-0x0;var _0x228c23=_0x0041[_0x111225];return _0x228c23;};'use strict';var _=require(_0x1004('0x0'));var util=require('util');var logger=require(_0x1004('0x1'))(_0x1004('0x2'));var moment=require(_0x1004('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1004('0x4'));var rimraf=require(_0x1004('0x5'));var config=require('../../config/environment');var attributes=require(_0x1004('0x6'));var integrations=require(_0x1004('0x7'));module[_0x1004('0x8')]=function(_0x379820,_0x58ef82){return _0x379820[_0x1004('0x9')](_0x1004('0xa'),attributes,{'tableName':_0x1004('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 922e694..6397895 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 _0xe808=['error','code','DeskAccount,\x20%s,\x20%s','message','catch','GetDeskAccount','findAll','options','raw','where','attributes','map','include','model','find','then','debug','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe808,0x188));var _0x8e80=function(_0x1ee3f7,_0x96a9a9){_0x1ee3f7=_0x1ee3f7-0x0;var _0x5b2e02=_0xe808[_0x1ee3f7];return _0x5b2e02;};'use strict';var _=require(_0x8e80('0x0'));var util=require(_0x8e80('0x1'));var moment=require(_0x8e80('0x2'));var BPromise=require(_0x8e80('0x3'));var rs=require(_0x8e80('0x4'));var fs=require('fs');var Redis=require(_0x8e80('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e80('0x6'));var config=require(_0x8e80('0x7'));var jayson=require(_0x8e80('0x8'));var client=jayson[_0x8e80('0x9')][_0x8e80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b1335,_0x207df2,_0x3189a1){return new BPromise(function(_0x2c8c61,_0x23150f){return client[_0x8e80('0xb')](_0x3b1335,_0x3189a1)['then'](function(_0x255157){logger[_0x8e80('0xc')]('DeskAccount,\x20%s,\x20%s',_0x207df2,'request\x20sent');logger['debug'](_0x8e80('0xd'),_0x207df2,_0x8e80('0xe'),JSON[_0x8e80('0xf')](_0x255157));if(_0x255157[_0x8e80('0x10')]){if(_0x255157[_0x8e80('0x10')][_0x8e80('0x11')]===0x1f4){logger[_0x8e80('0x10')](_0x8e80('0x12'),_0x207df2,_0x255157[_0x8e80('0x10')][_0x8e80('0x13')]);return _0x23150f(_0x255157[_0x8e80('0x10')][_0x8e80('0x13')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x207df2,_0x255157[_0x8e80('0x10')][_0x8e80('0x13')]);return _0x2c8c61(_0x255157[_0x8e80('0x10')][_0x8e80('0x13')]);}else{logger[_0x8e80('0xc')](_0x8e80('0x12'),_0x207df2,_0x8e80('0xe'));_0x2c8c61(_0x255157['result'][_0x8e80('0x13')]);}})[_0x8e80('0x14')](function(_0x3464a4){logger['error'](_0x8e80('0x12'),_0x207df2,_0x3464a4);_0x23150f(_0x3464a4);});});}exports[_0x8e80('0x15')]=function(_0x1c5906){var _0xa42497=this;return new Promise(function(_0x500e23,_0x5987cb){return db['DeskAccount'][_0x8e80('0x16')]({'raw':_0x1c5906[_0x8e80('0x17')]?_0x1c5906[_0x8e80('0x17')][_0x8e80('0x18')]===undefined?!![]:![]:!![],'where':_0x1c5906[_0x8e80('0x17')]?_0x1c5906['options'][_0x8e80('0x19')]||null:null,'attributes':_0x1c5906[_0x8e80('0x17')]?_0x1c5906['options'][_0x8e80('0x1a')]||null:null,'limit':_0x1c5906['options']?_0x1c5906[_0x8e80('0x17')]['limit']||null:null,'include':_0x1c5906[_0x8e80('0x17')]?_0x1c5906[_0x8e80('0x17')]['include']?_[_0x8e80('0x1b')](_0x1c5906['options']['include'],function(_0x197630){return{'model':db[_0x197630['model']],'as':_0x197630['as'],'attributes':_0x197630[_0x8e80('0x1a')],'include':_0x197630['include']?_[_0x8e80('0x1b')](_0x197630[_0x8e80('0x1c')],function(_0x2e341b){return{'model':db[_0x2e341b[_0x8e80('0x1d')]],'as':_0x2e341b['as'],'attributes':_0x2e341b[_0x8e80('0x1a')],'include':_0x2e341b[_0x8e80('0x1c')]?_[_0x8e80('0x1b')](_0x2e341b[_0x8e80('0x1c')],function(_0x55b36f){return{'model':db[_0x55b36f[_0x8e80('0x1d')]],'as':_0x55b36f['as'],'attributes':_0x55b36f[_0x8e80('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c6a72){logger[_0x8e80('0xc')]('GetDeskAccount',_0x1c5906);logger['debug'](_0x8e80('0x15'),_0x1c5906,JSON['stringify'](_0x1c6a72));_0x500e23(_0x1c6a72);})['catch'](function(_0x572bd1){logger['error'](_0x8e80('0x15'),_0x572bd1[_0x8e80('0x13')],_0x1c5906);_0x5987cb(_0xa42497[_0x8e80('0x10')](0x1f4,_0x572bd1[_0x8e80('0x13')]));});});};exports['ShowDeskAccount']=function(_0x31f3f1){var _0x137739=this;return new Promise(function(_0x50ce13,_0x3d2af4){return db['DeskAccount'][_0x8e80('0x1e')]({'raw':_0x31f3f1[_0x8e80('0x17')]?_0x31f3f1[_0x8e80('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31f3f1[_0x8e80('0x17')]?_0x31f3f1[_0x8e80('0x17')][_0x8e80('0x19')]||null:null,'attributes':_0x31f3f1[_0x8e80('0x17')]?_0x31f3f1[_0x8e80('0x17')]['attributes']||null:null,'include':_0x31f3f1[_0x8e80('0x17')]?_0x31f3f1[_0x8e80('0x17')][_0x8e80('0x1c')]?_[_0x8e80('0x1b')](_0x31f3f1[_0x8e80('0x17')]['include'],function(_0x575248){return{'model':db[_0x575248['model']],'as':_0x575248['as'],'attributes':_0x575248['attributes'],'include':_0x575248['include']?_[_0x8e80('0x1b')](_0x575248[_0x8e80('0x1c')],function(_0x1d2212){return{'model':db[_0x1d2212['model']],'as':_0x1d2212['as'],'attributes':_0x1d2212[_0x8e80('0x1a')],'include':_0x1d2212[_0x8e80('0x1c')]?_[_0x8e80('0x1b')](_0x1d2212['include'],function(_0x5bc81e){return{'model':db[_0x5bc81e[_0x8e80('0x1d')]],'as':_0x5bc81e['as'],'attributes':_0x5bc81e['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e80('0x1f')](function(_0x219549){logger[_0x8e80('0xc')]('ShowDeskAccount',_0x31f3f1);logger[_0x8e80('0x20')](_0x8e80('0x21'),_0x31f3f1,JSON[_0x8e80('0xf')](_0x219549));_0x50ce13(_0x219549);})[_0x8e80('0x14')](function(_0x457888){logger['error'](_0x8e80('0x21'),_0x457888[_0x8e80('0x13')],_0x31f3f1);_0x3d2af4(_0x137739['error'](0x1f4,_0x457888[_0x8e80('0x13')]));});});}; \ No newline at end of file +var _0x6112=['ShowDeskAccount','find','where','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include','map','model','debug'];(function(_0x3260da,_0x4b1bdc){var _0x26df59=function(_0x53710c){while(--_0x53710c){_0x3260da['push'](_0x3260da['shift']());}};_0x26df59(++_0x4b1bdc);}(_0x6112,0x100));var _0x2611=function(_0x70b94a,_0x11e941){_0x70b94a=_0x70b94a-0x0;var _0x1d67a2=_0x6112[_0x70b94a];return _0x1d67a2;};'use strict';var _=require(_0x2611('0x0'));var util=require(_0x2611('0x1'));var moment=require(_0x2611('0x2'));var BPromise=require(_0x2611('0x3'));var rs=require(_0x2611('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2611('0x5'))['db'];var utils=require(_0x2611('0x6'));var logger=require(_0x2611('0x7'))(_0x2611('0x8'));var config=require(_0x2611('0x9'));var jayson=require(_0x2611('0xa'));var client=jayson[_0x2611('0xb')][_0x2611('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15df63,_0x4ef1c8,_0x46ecc1){return new BPromise(function(_0x3e385f,_0x34b5c0){return client['request'](_0x15df63,_0x46ecc1)[_0x2611('0xd')](function(_0x20b110){logger[_0x2611('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4ef1c8,_0x2611('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4ef1c8,_0x2611('0xf'),JSON['stringify'](_0x20b110));if(_0x20b110[_0x2611('0x10')]){if(_0x20b110[_0x2611('0x10')][_0x2611('0x11')]===0x1f4){logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);return _0x34b5c0(_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);}logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);return _0x3e385f(_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);}else{logger[_0x2611('0xe')](_0x2611('0x12'),_0x4ef1c8,_0x2611('0xf'));_0x3e385f(_0x20b110[_0x2611('0x14')][_0x2611('0x13')]);}})[_0x2611('0x15')](function(_0x4d1dbe){logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x4d1dbe);_0x34b5c0(_0x4d1dbe);});});}exports[_0x2611('0x16')]=function(_0x23ec5b){var _0x38962c=this;return new Promise(function(_0x11a017,_0x26201b){return db[_0x2611('0x17')]['findAll']({'raw':_0x23ec5b['options']?_0x23ec5b[_0x2611('0x18')][_0x2611('0x19')]===undefined?!![]:![]:!![],'where':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b['options']['where']||null:null,'attributes':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1a')]||null:null,'limit':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1b')]||null:null,'include':_0x23ec5b['options']?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1c')]?_[_0x2611('0x1d')](_0x23ec5b[_0x2611('0x18')][_0x2611('0x1c')],function(_0x576ecc){return{'model':db[_0x576ecc['model']],'as':_0x576ecc['as'],'attributes':_0x576ecc[_0x2611('0x1a')],'include':_0x576ecc[_0x2611('0x1c')]?_['map'](_0x576ecc[_0x2611('0x1c')],function(_0x622f66){return{'model':db[_0x622f66['model']],'as':_0x622f66['as'],'attributes':_0x622f66[_0x2611('0x1a')],'include':_0x622f66[_0x2611('0x1c')]?_[_0x2611('0x1d')](_0x622f66[_0x2611('0x1c')],function(_0x4607da){return{'model':db[_0x4607da[_0x2611('0x1e')]],'as':_0x4607da['as'],'attributes':_0x4607da[_0x2611('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x190e50){logger[_0x2611('0xe')](_0x2611('0x16'),_0x23ec5b);logger[_0x2611('0x1f')]('GetDeskAccount',_0x23ec5b,JSON['stringify'](_0x190e50));_0x11a017(_0x190e50);})[_0x2611('0x15')](function(_0x119bcd){logger['error'](_0x2611('0x16'),_0x119bcd[_0x2611('0x13')],_0x23ec5b);_0x26201b(_0x38962c[_0x2611('0x10')](0x1f4,_0x119bcd[_0x2611('0x13')]));});});};exports[_0x2611('0x20')]=function(_0x215b24){var _0x16ea1e=this;return new Promise(function(_0x5a6a2d,_0x5cada2){return db[_0x2611('0x17')][_0x2611('0x21')]({'raw':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215b24['options']?_0x215b24[_0x2611('0x18')][_0x2611('0x22')]||null:null,'attributes':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')][_0x2611('0x1a')]||null:null,'include':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')]['include']?_['map'](_0x215b24[_0x2611('0x18')][_0x2611('0x1c')],function(_0x26585a){return{'model':db[_0x26585a[_0x2611('0x1e')]],'as':_0x26585a['as'],'attributes':_0x26585a['attributes'],'include':_0x26585a['include']?_['map'](_0x26585a[_0x2611('0x1c')],function(_0x2a65c0){return{'model':db[_0x2a65c0['model']],'as':_0x2a65c0['as'],'attributes':_0x2a65c0[_0x2611('0x1a')],'include':_0x2a65c0['include']?_[_0x2611('0x1d')](_0x2a65c0[_0x2611('0x1c')],function(_0x12187a){return{'model':db[_0x12187a[_0x2611('0x1e')]],'as':_0x12187a['as'],'attributes':_0x12187a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15fec3){logger[_0x2611('0xe')](_0x2611('0x20'),_0x215b24);logger[_0x2611('0x1f')](_0x2611('0x20'),_0x215b24,JSON[_0x2611('0x23')](_0x15fec3));_0x5a6a2d(_0x15fec3);})['catch'](function(_0x4fc833){logger[_0x2611('0x10')](_0x2611('0x20'),_0x4fc833['message'],_0x215b24);_0x5cada2(_0x16ea1e['error'](0x1f4,_0x4fc833['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 477bb4d..77e8fb4 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1c837c,_0x23a4de){var _0x23d926=function(_0x25f50b){while(--_0x25f50b){_0x1c837c['push'](_0x1c837c['shift']());}};_0x23d926(++_0x23a4de);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c4925,_0x4d6341){var _0x4e8c60=function(_0x4f3b15){while(--_0x4f3b15){_0x1c4925['push'](_0x1c4925['shift']());}};_0x4e8c60(++_0x4d6341);}(_0x008c,0x188));var _0xc008=function(_0x5df952,_0x3940da){_0x5df952=_0x5df952-0x0;var _0xf5400a=_0x008c[_0x5df952];return _0xf5400a;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index fc797c9..d20f338 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 _0x1d05=['exports','STRING','sequelize'];(function(_0xb5f992,_0xd3893d){var _0x530070=function(_0x4f466c){while(--_0x4f466c){_0xb5f992['push'](_0xb5f992['shift']());}};_0x530070(++_0xd3893d);}(_0x1d05,0x1a6));var _0x51d0=function(_0x3e4bc0,_0x3ed6f0){_0x3e4bc0=_0x3e4bc0-0x0;var _0x4f4cd3=_0x1d05[_0x3e4bc0];return _0x4f4cd3;};'use strict';var Sequelize=require(_0x51d0('0x0'));module[_0x51d0('0x1')]={'name':{'type':Sequelize[_0x51d0('0x2')]},'description':{'type':Sequelize[_0x51d0('0x2')]}}; \ No newline at end of file +var _0xa49a=['sequelize','exports','STRING'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xa49a,0x1c5));var _0xaa49=function(_0x15bacf,_0x24253f){_0x15bacf=_0x15bacf-0x0;var _0x576d15=_0xa49a[_0x15bacf];return _0x576d15;};'use strict';var Sequelize=require(_0xaa49('0x0'));module[_0xaa49('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa49('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 0e21fbf..5deb5ce 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 _0x3dc9=['Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','then','catch','show','params','length','find','create','body','destroy','findOne','hasOwnProperty','getSubjects','DeskField','order','getDescriptions'];(function(_0x596c85,_0x3f44c7){var _0x3b08d8=function(_0x5a305b){while(--_0x5a305b){_0x596c85['push'](_0x596c85['shift']());}};_0x3b08d8(++_0x3f44c7);}(_0x3dc9,0x160));var _0x93dc=function(_0xa42af2,_0x5bfd21){_0xa42af2=_0xa42af2-0x0;var _0x3b8f1e=_0x3dc9[_0xa42af2];return _0x3b8f1e;};'use strict';var emlformat=require(_0x93dc('0x0'));var rimraf=require(_0x93dc('0x1'));var zipdir=require(_0x93dc('0x2'));var jsonpatch=require(_0x93dc('0x3'));var rp=require('request-promise');var moment=require(_0x93dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93dc('0x5'));var util=require(_0x93dc('0x6'));var path=require('path');var sox=require(_0x93dc('0x7'));var csv=require(_0x93dc('0x8'));var ejs=require(_0x93dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93dc('0xa'));var squel=require(_0x93dc('0xb'));var crypto=require(_0x93dc('0xc'));var jsforce=require(_0x93dc('0xd'));var deskjs=require(_0x93dc('0xe'));var toCsv=require(_0x93dc('0x8'));var querystring=require(_0x93dc('0xf'));var Papa=require(_0x93dc('0x10'));var Redis=require('ioredis');var authService=require(_0x93dc('0x11'));var qs=require(_0x93dc('0x12'));var as=require(_0x93dc('0x13'));var hardwareService=require(_0x93dc('0x14'));var logger=require(_0x93dc('0x15'))(_0x93dc('0x16'));var utils=require(_0x93dc('0x17'));var config=require(_0x93dc('0x18'));var licenseUtil=require(_0x93dc('0x19'));var db=require(_0x93dc('0x1a'))['db'];function respondWithStatusCode(_0x5c1f85,_0x240f54){_0x240f54=_0x240f54||0xcc;return function(_0x3bb533){if(_0x3bb533){return _0x5c1f85[_0x93dc('0x1b')](_0x240f54);}return _0x5c1f85[_0x93dc('0x1c')](_0x240f54)[_0x93dc('0x1d')]();};}function respondWithResult(_0x147c57,_0x5fd23e){_0x5fd23e=_0x5fd23e||0xc8;return function(_0x3ddaef){if(_0x3ddaef){return _0x147c57['status'](_0x5fd23e)[_0x93dc('0x1e')](_0x3ddaef);}};}function respondWithFilteredResult(_0x13f50c,_0x3041dd){return function(_0x11546b){if(_0x11546b){var _0x60960d=typeof _0x3041dd['offset']==='undefined'&&typeof _0x3041dd[_0x93dc('0x1f')]===_0x93dc('0x20');var _0x507dec=_0x11546b[_0x93dc('0x21')];var _0x20d7dc=_0x60960d?0x0:_0x3041dd[_0x93dc('0x22')];var _0x58498b=_0x60960d?_0x11546b['count']:_0x3041dd[_0x93dc('0x22')]+_0x3041dd[_0x93dc('0x1f')];var _0x49b91c;if(_0x58498b>=_0x507dec){_0x58498b=_0x507dec;_0x49b91c=0xc8;}else{_0x49b91c=0xce;}_0x13f50c['status'](_0x49b91c);return _0x13f50c[_0x93dc('0x23')](_0x93dc('0x24'),_0x20d7dc+'-'+_0x58498b+'/'+_0x507dec)[_0x93dc('0x1e')](_0x11546b);}return null;};}function patchUpdates(_0x2b6cbd){return function(_0x48950a){try{jsonpatch[_0x93dc('0x25')](_0x48950a,_0x2b6cbd,!![]);}catch(_0x1751c2){return BPromise[_0x93dc('0x26')](_0x1751c2);}return _0x48950a[_0x93dc('0x27')]();};}function saveUpdates(_0x31e269,_0x2538a2){return function(_0x1aec33){if(_0x1aec33){return _0x1aec33[_0x93dc('0x28')](_0x31e269)['then'](function(_0x2757b4){return _0x2757b4;});}return null;};}function removeEntity(_0xf6b23b,_0x5208dd){return function(_0x1a9c24){if(_0x1a9c24){return _0x1a9c24['destroy']()['then'](function(){_0xf6b23b[_0x93dc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33042a,_0x432425){return function(_0x52813c){if(!_0x52813c){_0x33042a[_0x93dc('0x1b')](0x194);}return _0x52813c;};}function handleError(_0x39c661,_0x593988){_0x593988=_0x593988||0x1f4;return function(_0x1c5f29){logger[_0x93dc('0x29')](_0x1c5f29[_0x93dc('0x2a')]);if(_0x1c5f29[_0x93dc('0x2b')]){delete _0x1c5f29['name'];}_0x39c661['status'](_0x593988)['send'](_0x1c5f29);};}exports[_0x93dc('0x2c')]=function(_0x3afe39,_0x46334f){var _0x136286={},_0x5202e7={},_0x34346a={'count':0x0,'rows':[]};var _0x54872b=_[_0x93dc('0x2d')](db[_0x93dc('0x2e')][_0x93dc('0x2f')],function(_0x8a55d0){return{'name':_0x8a55d0[_0x93dc('0x30')],'type':_0x8a55d0[_0x93dc('0x31')][_0x93dc('0x32')]};});_0x5202e7[_0x93dc('0x33')]=_[_0x93dc('0x2d')](_0x54872b,_0x93dc('0x2b'));_0x5202e7[_0x93dc('0x34')]=_[_0x93dc('0x35')](_0x3afe39[_0x93dc('0x34')]);_0x5202e7['filters']=_[_0x93dc('0x36')](_0x5202e7['model'],_0x5202e7[_0x93dc('0x34')]);_0x136286[_0x93dc('0x37')]=_[_0x93dc('0x36')](_0x5202e7[_0x93dc('0x33')],qs[_0x93dc('0x38')](_0x3afe39[_0x93dc('0x34')][_0x93dc('0x38')]));_0x136286['attributes']=_0x136286[_0x93dc('0x37')]['length']?_0x136286[_0x93dc('0x37')]:_0x5202e7[_0x93dc('0x33')];if(!_0x3afe39[_0x93dc('0x34')]['hasOwnProperty'](_0x93dc('0x39'))){_0x136286[_0x93dc('0x1f')]=qs[_0x93dc('0x1f')](_0x3afe39[_0x93dc('0x34')]['limit']);_0x136286[_0x93dc('0x22')]=qs[_0x93dc('0x22')](_0x3afe39[_0x93dc('0x34')]['offset']);}_0x136286['order']=qs[_0x93dc('0x3a')](_0x3afe39['query'][_0x93dc('0x3a')]);_0x136286[_0x93dc('0x3b')]=qs[_0x93dc('0x3c')](_[_0x93dc('0x3d')](_0x3afe39['query'],_0x5202e7[_0x93dc('0x3c')]),_0x54872b);if(_0x3afe39[_0x93dc('0x34')][_0x93dc('0x3e')]){_0x136286['where']=_['merge'](_0x136286[_0x93dc('0x3b')],{'$or':_[_0x93dc('0x2d')](_0x54872b,function(_0x21e3ed){if(_0x21e3ed[_0x93dc('0x31')]!==_0x93dc('0x3f')){var _0x23c609={};_0x23c609[_0x21e3ed[_0x93dc('0x2b')]]={'$like':'%'+_0x3afe39[_0x93dc('0x34')][_0x93dc('0x3e')]+'%'};return _0x23c609;}})});}_0x136286=_[_0x93dc('0x40')]({},_0x136286,_0x3afe39[_0x93dc('0x41')]);var _0x13ec15={'where':_0x136286[_0x93dc('0x3b')]};return db[_0x93dc('0x2e')][_0x93dc('0x21')](_0x13ec15)['then'](function(_0x317377){_0x34346a['count']=_0x317377;if(_0x3afe39[_0x93dc('0x34')][_0x93dc('0x42')]){_0x136286[_0x93dc('0x43')]=[{'all':!![]}];}return db[_0x93dc('0x2e')]['findAll'](_0x136286);})['then'](function(_0x3192ce){_0x34346a['rows']=_0x3192ce;return _0x34346a;})[_0x93dc('0x44')](respondWithFilteredResult(_0x46334f,_0x136286))[_0x93dc('0x45')](handleError(_0x46334f,null));};exports[_0x93dc('0x46')]=function(_0x121d3f,_0xc6eb56){var _0x227f7d={'raw':![],'where':{'id':_0x121d3f[_0x93dc('0x47')]['id']}},_0x26f6ce={};_0x26f6ce[_0x93dc('0x33')]=_[_0x93dc('0x35')](db[_0x93dc('0x2e')][_0x93dc('0x2f')]);_0x26f6ce['query']=_['keys'](_0x121d3f[_0x93dc('0x34')]);_0x26f6ce[_0x93dc('0x3c')]=_['intersection'](_0x26f6ce['model'],_0x26f6ce['query']);_0x227f7d['attributes']=_[_0x93dc('0x36')](_0x26f6ce['model'],qs[_0x93dc('0x38')](_0x121d3f['query'][_0x93dc('0x38')]));_0x227f7d[_0x93dc('0x37')]=_0x227f7d['attributes'][_0x93dc('0x48')]?_0x227f7d['attributes']:_0x26f6ce['model'];if(_0x121d3f[_0x93dc('0x34')][_0x93dc('0x42')]){_0x227f7d[_0x93dc('0x43')]=[{'all':!![]}];}_0x227f7d=_[_0x93dc('0x40')]({},_0x227f7d,_0x121d3f[_0x93dc('0x41')]);return db[_0x93dc('0x2e')][_0x93dc('0x49')](_0x227f7d)[_0x93dc('0x44')](handleEntityNotFound(_0xc6eb56,null))[_0x93dc('0x44')](respondWithResult(_0xc6eb56,null))[_0x93dc('0x45')](handleError(_0xc6eb56,null));};exports[_0x93dc('0x4a')]=function(_0x28d52d,_0x203b7d){return db[_0x93dc('0x2e')]['create'](_0x28d52d[_0x93dc('0x4b')],{})['then'](respondWithResult(_0x203b7d,0xc9))[_0x93dc('0x45')](handleError(_0x203b7d,null));};exports[_0x93dc('0x28')]=function(_0x58a5ee,_0x3f1dd9){if(_0x58a5ee['body']['id']){delete _0x58a5ee[_0x93dc('0x4b')]['id'];}return db[_0x93dc('0x2e')][_0x93dc('0x49')]({'where':{'id':_0x58a5ee[_0x93dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f1dd9,null))['then'](saveUpdates(_0x58a5ee[_0x93dc('0x4b')],null))[_0x93dc('0x44')](respondWithResult(_0x3f1dd9,null))['catch'](handleError(_0x3f1dd9,null));};exports[_0x93dc('0x4c')]=function(_0x374cfe,_0x3ca9d2){return db[_0x93dc('0x2e')]['find']({'where':{'id':_0x374cfe['params']['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x3ca9d2,null))[_0x93dc('0x44')](removeEntity(_0x3ca9d2,null))[_0x93dc('0x45')](handleError(_0x3ca9d2,null));};exports['getFields']=function(_0x457efb,_0x21aca6,_0x383d6d){var _0x2b20f8={};var _0x458756={};var _0x1407fc;var _0x39dc89;return db[_0x93dc('0x2e')][_0x93dc('0x4d')]({'where':{'id':_0x457efb[_0x93dc('0x47')]['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x21aca6,null))['then'](function(_0x2257c3){if(_0x2257c3){_0x1407fc=_0x2257c3;_0x458756[_0x93dc('0x33')]=_[_0x93dc('0x35')](db['DeskField'][_0x93dc('0x2f')]);_0x458756['query']=_[_0x93dc('0x35')](_0x457efb[_0x93dc('0x34')]);_0x458756['filters']=_[_0x93dc('0x36')](_0x458756['model'],_0x458756[_0x93dc('0x34')]);_0x2b20f8[_0x93dc('0x37')]=_['intersection'](_0x458756[_0x93dc('0x33')],qs[_0x93dc('0x38')](_0x457efb[_0x93dc('0x34')][_0x93dc('0x38')]));_0x2b20f8[_0x93dc('0x37')]=_0x2b20f8[_0x93dc('0x37')][_0x93dc('0x48')]?_0x2b20f8[_0x93dc('0x37')]:_0x458756[_0x93dc('0x33')];_0x2b20f8['order']=qs[_0x93dc('0x3a')](_0x457efb['query'][_0x93dc('0x3a')]);_0x2b20f8[_0x93dc('0x3b')]=qs[_0x93dc('0x3c')](_[_0x93dc('0x3d')](_0x457efb[_0x93dc('0x34')],_0x458756[_0x93dc('0x3c')]));if(_0x457efb[_0x93dc('0x34')][_0x93dc('0x3e')]){_0x2b20f8[_0x93dc('0x3b')]=_[_0x93dc('0x40')](_0x2b20f8[_0x93dc('0x3b')],{'$or':_[_0x93dc('0x2d')](_0x2b20f8[_0x93dc('0x37')],function(_0x2bb0aa){var _0x47c48c={};_0x47c48c[_0x2bb0aa]={'$like':'%'+_0x457efb[_0x93dc('0x34')][_0x93dc('0x3e')]+'%'};return _0x47c48c;})});}_0x2b20f8=_['merge']({},_0x2b20f8,_0x457efb[_0x93dc('0x41')]);return _0x1407fc['getFields'](_0x2b20f8);}})[_0x93dc('0x44')](function(_0x24b6d9){if(_0x24b6d9){_0x39dc89=_0x24b6d9[_0x93dc('0x48')];if(!_0x457efb[_0x93dc('0x34')][_0x93dc('0x4e')]('nolimit')){_0x2b20f8[_0x93dc('0x1f')]=qs[_0x93dc('0x1f')](_0x457efb[_0x93dc('0x34')][_0x93dc('0x1f')]);_0x2b20f8['offset']=qs[_0x93dc('0x22')](_0x457efb[_0x93dc('0x34')][_0x93dc('0x22')]);}return _0x1407fc['getFields'](_0x2b20f8);}})[_0x93dc('0x44')](function(_0x39ade0){if(_0x39ade0){return _0x39ade0?{'count':_0x39dc89,'rows':_0x39ade0}:null;}})[_0x93dc('0x44')](respondWithResult(_0x21aca6,null))['catch'](handleError(_0x21aca6,null));};exports[_0x93dc('0x4f')]=function(_0x64ffa5,_0x58ec24,_0x84a399){var _0x4c8517={};var _0x30d0b3={};var _0x4d15f8;var _0x42d519;return db[_0x93dc('0x2e')][_0x93dc('0x4d')]({'where':{'id':_0x64ffa5['params']['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x58ec24,null))[_0x93dc('0x44')](function(_0x1d2f81){if(_0x1d2f81){_0x4d15f8=_0x1d2f81;_0x30d0b3[_0x93dc('0x33')]=_[_0x93dc('0x35')](db[_0x93dc('0x50')]['rawAttributes']);_0x30d0b3[_0x93dc('0x34')]=_['keys'](_0x64ffa5[_0x93dc('0x34')]);_0x30d0b3['filters']=_['intersection'](_0x30d0b3[_0x93dc('0x33')],_0x30d0b3[_0x93dc('0x34')]);_0x4c8517[_0x93dc('0x37')]=_['intersection'](_0x30d0b3[_0x93dc('0x33')],qs[_0x93dc('0x38')](_0x64ffa5[_0x93dc('0x34')]['fields']));_0x4c8517[_0x93dc('0x37')]=_0x4c8517['attributes'][_0x93dc('0x48')]?_0x4c8517[_0x93dc('0x37')]:_0x30d0b3[_0x93dc('0x33')];_0x4c8517[_0x93dc('0x51')]=qs[_0x93dc('0x3a')](_0x64ffa5['query']['sort']);_0x4c8517[_0x93dc('0x3b')]=qs[_0x93dc('0x3c')](_[_0x93dc('0x3d')](_0x64ffa5[_0x93dc('0x34')],_0x30d0b3[_0x93dc('0x3c')]));if(_0x64ffa5[_0x93dc('0x34')]['filter']){_0x4c8517[_0x93dc('0x3b')]=_[_0x93dc('0x40')](_0x4c8517[_0x93dc('0x3b')],{'$or':_[_0x93dc('0x2d')](_0x4c8517[_0x93dc('0x37')],function(_0x4e4fe4){var _0x40bca5={};_0x40bca5[_0x4e4fe4]={'$like':'%'+_0x64ffa5[_0x93dc('0x34')][_0x93dc('0x3e')]+'%'};return _0x40bca5;})});}_0x4c8517=_['merge']({},_0x4c8517,_0x64ffa5['options']);return _0x4d15f8[_0x93dc('0x4f')](_0x4c8517);}})[_0x93dc('0x44')](function(_0x44ca34){if(_0x44ca34){_0x42d519=_0x44ca34[_0x93dc('0x48')];if(!_0x64ffa5['query'][_0x93dc('0x4e')]('nolimit')){_0x4c8517['limit']=qs[_0x93dc('0x1f')](_0x64ffa5['query'][_0x93dc('0x1f')]);_0x4c8517[_0x93dc('0x22')]=qs[_0x93dc('0x22')](_0x64ffa5[_0x93dc('0x34')][_0x93dc('0x22')]);}return _0x4d15f8['getSubjects'](_0x4c8517);}})[_0x93dc('0x44')](function(_0xbb5141){if(_0xbb5141){return _0xbb5141?{'count':_0x42d519,'rows':_0xbb5141}:null;}})[_0x93dc('0x44')](respondWithResult(_0x58ec24,null))[_0x93dc('0x45')](handleError(_0x58ec24,null));};exports[_0x93dc('0x52')]=function(_0x1abb1a,_0x2dbfe6,_0x3269b4){var _0xf6aa42={};var _0x1a46bd={};var _0x1d5e9e;var _0xb5200d;return db[_0x93dc('0x2e')]['findOne']({'where':{'id':_0x1abb1a[_0x93dc('0x47')]['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x2dbfe6,null))[_0x93dc('0x44')](function(_0x1f495f){if(_0x1f495f){_0x1d5e9e=_0x1f495f;_0x1a46bd[_0x93dc('0x33')]=_[_0x93dc('0x35')](db[_0x93dc('0x50')][_0x93dc('0x2f')]);_0x1a46bd[_0x93dc('0x34')]=_[_0x93dc('0x35')](_0x1abb1a[_0x93dc('0x34')]);_0x1a46bd[_0x93dc('0x3c')]=_[_0x93dc('0x36')](_0x1a46bd[_0x93dc('0x33')],_0x1a46bd[_0x93dc('0x34')]);_0xf6aa42[_0x93dc('0x37')]=_[_0x93dc('0x36')](_0x1a46bd[_0x93dc('0x33')],qs[_0x93dc('0x38')](_0x1abb1a[_0x93dc('0x34')][_0x93dc('0x38')]));_0xf6aa42['attributes']=_0xf6aa42[_0x93dc('0x37')][_0x93dc('0x48')]?_0xf6aa42['attributes']:_0x1a46bd[_0x93dc('0x33')];_0xf6aa42[_0x93dc('0x51')]=qs[_0x93dc('0x3a')](_0x1abb1a[_0x93dc('0x34')][_0x93dc('0x3a')]);_0xf6aa42[_0x93dc('0x3b')]=qs[_0x93dc('0x3c')](_['pick'](_0x1abb1a[_0x93dc('0x34')],_0x1a46bd[_0x93dc('0x3c')]));if(_0x1abb1a[_0x93dc('0x34')]['filter']){_0xf6aa42[_0x93dc('0x3b')]=_['merge'](_0xf6aa42[_0x93dc('0x3b')],{'$or':_[_0x93dc('0x2d')](_0xf6aa42[_0x93dc('0x37')],function(_0x16846a){var _0x2bfa20={};_0x2bfa20[_0x16846a]={'$like':'%'+_0x1abb1a['query']['filter']+'%'};return _0x2bfa20;})});}_0xf6aa42=_['merge']({},_0xf6aa42,_0x1abb1a[_0x93dc('0x41')]);return _0x1d5e9e[_0x93dc('0x52')](_0xf6aa42);}})[_0x93dc('0x44')](function(_0x2ebc33){if(_0x2ebc33){_0xb5200d=_0x2ebc33['length'];if(!_0x1abb1a['query'][_0x93dc('0x4e')](_0x93dc('0x39'))){_0xf6aa42[_0x93dc('0x1f')]=qs[_0x93dc('0x1f')](_0x1abb1a[_0x93dc('0x34')][_0x93dc('0x1f')]);_0xf6aa42[_0x93dc('0x22')]=qs['offset'](_0x1abb1a[_0x93dc('0x34')]['offset']);}return _0x1d5e9e[_0x93dc('0x52')](_0xf6aa42);}})['then'](function(_0x3d9934){if(_0x3d9934){return _0x3d9934?{'count':_0xb5200d,'rows':_0x3d9934}:null;}})['then'](respondWithResult(_0x2dbfe6,null))[_0x93dc('0x45')](handleError(_0x2dbfe6,null));};exports['getTags']=function(_0x4a8339,_0x27014e,_0x2109d9){var _0x594a62={};var _0x17a5dc={};var _0x37ea0b;var _0x525b2a;return db[_0x93dc('0x2e')][_0x93dc('0x4d')]({'where':{'id':_0x4a8339['params']['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x27014e,null))[_0x93dc('0x44')](function(_0x19c607){if(_0x19c607){_0x37ea0b=_0x19c607;_0x17a5dc['model']=_['keys'](db[_0x93dc('0x53')][_0x93dc('0x2f')]);_0x17a5dc['query']=_['keys'](_0x4a8339[_0x93dc('0x34')]);_0x17a5dc['filters']=_[_0x93dc('0x36')](_0x17a5dc['model'],_0x17a5dc[_0x93dc('0x34')]);_0x594a62[_0x93dc('0x37')]=_['intersection'](_0x17a5dc[_0x93dc('0x33')],qs[_0x93dc('0x38')](_0x4a8339['query'][_0x93dc('0x38')]));_0x594a62[_0x93dc('0x37')]=_0x594a62[_0x93dc('0x37')]['length']?_0x594a62[_0x93dc('0x37')]:_0x17a5dc['model'];_0x594a62[_0x93dc('0x51')]=qs[_0x93dc('0x3a')](_0x4a8339['query'][_0x93dc('0x3a')]);_0x594a62[_0x93dc('0x3b')]=qs[_0x93dc('0x3c')](_[_0x93dc('0x3d')](_0x4a8339[_0x93dc('0x34')],_0x17a5dc[_0x93dc('0x3c')]));if(_0x4a8339['query'][_0x93dc('0x3e')]){_0x594a62[_0x93dc('0x3b')]=_['merge'](_0x594a62['where'],{'$or':_[_0x93dc('0x2d')](_0x594a62['attributes'],function(_0x1ff420){var _0x1f47d3={};_0x1f47d3[_0x1ff420]={'$like':'%'+_0x4a8339[_0x93dc('0x34')][_0x93dc('0x3e')]+'%'};return _0x1f47d3;})});}_0x594a62=_['merge']({},_0x594a62,_0x4a8339[_0x93dc('0x41')]);return _0x37ea0b[_0x93dc('0x54')](_0x594a62);}})[_0x93dc('0x44')](function(_0x4ce185){if(_0x4ce185){_0x525b2a=_0x4ce185['length'];if(!_0x4a8339[_0x93dc('0x34')][_0x93dc('0x4e')](_0x93dc('0x39'))){_0x594a62[_0x93dc('0x1f')]=qs[_0x93dc('0x1f')](_0x4a8339['query'][_0x93dc('0x1f')]);_0x594a62[_0x93dc('0x22')]=qs[_0x93dc('0x22')](_0x4a8339[_0x93dc('0x34')][_0x93dc('0x22')]);}return _0x37ea0b['getTags'](_0x594a62);}})['then'](function(_0x20857d){if(_0x20857d){return _0x20857d?{'count':_0x525b2a,'rows':_0x20857d}:null;}})['then'](respondWithResult(_0x27014e,null))['catch'](handleError(_0x27014e,null));};exports[_0x93dc('0x55')]=function(_0x226e69,_0x4cca64,_0x29c1f0){if(_0x226e69[_0x93dc('0x4b')]['id']){delete _0x226e69[_0x93dc('0x4b')]['id'];}return db[_0x93dc('0x2e')][_0x93dc('0x4d')]({'where':{'id':_0x226e69[_0x93dc('0x47')]['id']}})[_0x93dc('0x44')](handleEntityNotFound(_0x4cca64,null))[_0x93dc('0x44')](function(_0x3561d4){if(_0x3561d4){return _0x3561d4[_0x93dc('0x55')](_0x226e69[_0x93dc('0x4b')][_0x93dc('0x56')]||[]);}return null;})['then'](respondWithResult(_0x4cca64,null))[_0x93dc('0x45')](handleError(_0x4cca64,null));}; \ No newline at end of file +var _0xdc96=['then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','includeAll','include','find','create','body','update','getFields','params','DeskField','options','getSubjects','getDescriptions','Tag','getTags','setTags','findOne','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x48140d,_0x3c78d8){var _0x344ff5=function(_0x1ebc3c){while(--_0x1ebc3c){_0x48140d['push'](_0x48140d['shift']());}};_0x344ff5(++_0x3c78d8);}(_0xdc96,0x86));var _0x6dc9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xdc96[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x6dc9('0x0'));var rimraf=require(_0x6dc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc9('0x2'));var rp=require('request-promise');var moment=require(_0x6dc9('0x3'));var BPromise=require(_0x6dc9('0x4'));var Mustache=require(_0x6dc9('0x5'));var util=require(_0x6dc9('0x6'));var path=require('path');var sox=require(_0x6dc9('0x7'));var csv=require('to-csv');var ejs=require(_0x6dc9('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc9('0x9'));var _=require('lodash');var squel=require(_0x6dc9('0xa'));var crypto=require('crypto');var jsforce=require(_0x6dc9('0xb'));var deskjs=require(_0x6dc9('0xc'));var toCsv=require(_0x6dc9('0xd'));var querystring=require(_0x6dc9('0xe'));var Papa=require(_0x6dc9('0xf'));var Redis=require(_0x6dc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6dc9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc9('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6dc9('0x13'));var licenseUtil=require(_0x6dc9('0x14'));var db=require(_0x6dc9('0x15'))['db'];function respondWithStatusCode(_0x2a5543,_0x4836f4){_0x4836f4=_0x4836f4||0xcc;return function(_0x2ce4e2){if(_0x2ce4e2){return _0x2a5543['sendStatus'](_0x4836f4);}return _0x2a5543[_0x6dc9('0x16')](_0x4836f4)[_0x6dc9('0x17')]();};}function respondWithResult(_0x277195,_0x45ad6b){_0x45ad6b=_0x45ad6b||0xc8;return function(_0x499f3c){if(_0x499f3c){return _0x277195[_0x6dc9('0x16')](_0x45ad6b)[_0x6dc9('0x18')](_0x499f3c);}};}function respondWithFilteredResult(_0x3c552f,_0x491f69){return function(_0x56ad11){if(_0x56ad11){var _0x13585e=typeof _0x491f69['offset']===_0x6dc9('0x19')&&typeof _0x491f69[_0x6dc9('0x1a')]===_0x6dc9('0x19');var _0x5880d0=_0x56ad11['count'];var _0x1da28a=_0x13585e?0x0:_0x491f69[_0x6dc9('0x1b')];var _0x3ef743=_0x13585e?_0x56ad11[_0x6dc9('0x1c')]:_0x491f69[_0x6dc9('0x1b')]+_0x491f69[_0x6dc9('0x1a')];var _0x1037b9;if(_0x3ef743>=_0x5880d0){_0x3ef743=_0x5880d0;_0x1037b9=0xc8;}else{_0x1037b9=0xce;}_0x3c552f[_0x6dc9('0x16')](_0x1037b9);return _0x3c552f[_0x6dc9('0x1d')](_0x6dc9('0x1e'),_0x1da28a+'-'+_0x3ef743+'/'+_0x5880d0)[_0x6dc9('0x18')](_0x56ad11);}return null;};}function patchUpdates(_0x5ae134){return function(_0x5c37a7){try{jsonpatch[_0x6dc9('0x1f')](_0x5c37a7,_0x5ae134,!![]);}catch(_0x149cb2){return BPromise[_0x6dc9('0x20')](_0x149cb2);}return _0x5c37a7[_0x6dc9('0x21')]();};}function saveUpdates(_0x414772,_0x544405){return function(_0x20b53d){if(_0x20b53d){return _0x20b53d['update'](_0x414772)[_0x6dc9('0x22')](function(_0x5d17dd){return _0x5d17dd;});}return null;};}function removeEntity(_0x59a086,_0x503126){return function(_0x4b062d){if(_0x4b062d){return _0x4b062d[_0x6dc9('0x23')]()['then'](function(){_0x59a086[_0x6dc9('0x16')](0xcc)[_0x6dc9('0x17')]();});}};}function handleEntityNotFound(_0x71aa53,_0x436b32){return function(_0x42376c){if(!_0x42376c){_0x71aa53['sendStatus'](0x194);}return _0x42376c;};}function handleError(_0x246dc7,_0x33d377){_0x33d377=_0x33d377||0x1f4;return function(_0x3eb036){logger[_0x6dc9('0x24')](_0x3eb036[_0x6dc9('0x25')]);if(_0x3eb036[_0x6dc9('0x26')]){delete _0x3eb036[_0x6dc9('0x26')];}_0x246dc7[_0x6dc9('0x16')](_0x33d377)[_0x6dc9('0x27')](_0x3eb036);};}exports[_0x6dc9('0x28')]=function(_0x2801ed,_0x3fd7d2){var _0x1b6d13={},_0x2e13c8={},_0x528c08={'count':0x0,'rows':[]};var _0x1ebb89=_[_0x6dc9('0x29')](db[_0x6dc9('0x2a')][_0x6dc9('0x2b')],function(_0x2435ef){return{'name':_0x2435ef[_0x6dc9('0x2c')],'type':_0x2435ef[_0x6dc9('0x2d')]['key']};});_0x2e13c8[_0x6dc9('0x2e')]=_['map'](_0x1ebb89,'name');_0x2e13c8[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x2801ed[_0x6dc9('0x2f')]);_0x2e13c8[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0x2e13c8[_0x6dc9('0x2e')],_0x2e13c8[_0x6dc9('0x2f')]);_0x1b6d13[_0x6dc9('0x33')]=_[_0x6dc9('0x32')](_0x2e13c8[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x1b6d13[_0x6dc9('0x33')]=_0x1b6d13['attributes'][_0x6dc9('0x35')]?_0x1b6d13[_0x6dc9('0x33')]:_0x2e13c8[_0x6dc9('0x2e')];if(!_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x1b6d13[_0x6dc9('0x1a')]=qs['limit'](_0x2801ed['query'][_0x6dc9('0x1a')]);_0x1b6d13[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}_0x1b6d13[_0x6dc9('0x38')]=qs['sort'](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x1b6d13[_0x6dc9('0x3a')]=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x2801ed[_0x6dc9('0x2f')],_0x2e13c8[_0x6dc9('0x31')]),_0x1ebb89);if(_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x1b6d13['where']=_[_0x6dc9('0x3d')](_0x1b6d13[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x1ebb89,function(_0x2f7ddd){if(_0x2f7ddd[_0x6dc9('0x2d')]!==_0x6dc9('0x3e')){var _0x3cbd1a={};_0x3cbd1a[_0x2f7ddd[_0x6dc9('0x26')]]={'$like':'%'+_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x3cbd1a;}})});}_0x1b6d13=_['merge']({},_0x1b6d13,_0x2801ed['options']);var _0x3b4e84={'where':_0x1b6d13[_0x6dc9('0x3a')]};return db[_0x6dc9('0x2a')][_0x6dc9('0x1c')](_0x3b4e84)[_0x6dc9('0x22')](function(_0x47e116){_0x528c08['count']=_0x47e116;if(_0x2801ed['query']['includeAll']){_0x1b6d13['include']=[{'all':!![]}];}return db[_0x6dc9('0x2a')][_0x6dc9('0x3f')](_0x1b6d13);})[_0x6dc9('0x22')](function(_0xdbd53e){_0x528c08[_0x6dc9('0x40')]=_0xdbd53e;return _0x528c08;})[_0x6dc9('0x22')](respondWithFilteredResult(_0x3fd7d2,_0x1b6d13))[_0x6dc9('0x41')](handleError(_0x3fd7d2,null));};exports[_0x6dc9('0x42')]=function(_0x2bfdfa,_0xc98063){var _0x2474c8={'raw':![],'where':{'id':_0x2bfdfa['params']['id']}},_0x43e553={};_0x43e553[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x2a')][_0x6dc9('0x2b')]);_0x43e553[_0x6dc9('0x2f')]=_['keys'](_0x2bfdfa[_0x6dc9('0x2f')]);_0x43e553[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0x43e553['model'],_0x43e553['query']);_0x2474c8[_0x6dc9('0x33')]=_['intersection'](_0x43e553[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x2bfdfa[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x2474c8[_0x6dc9('0x33')]=_0x2474c8[_0x6dc9('0x33')][_0x6dc9('0x35')]?_0x2474c8[_0x6dc9('0x33')]:_0x43e553[_0x6dc9('0x2e')];if(_0x2bfdfa[_0x6dc9('0x2f')][_0x6dc9('0x43')]){_0x2474c8[_0x6dc9('0x44')]=[{'all':!![]}];}_0x2474c8=_[_0x6dc9('0x3d')]({},_0x2474c8,_0x2bfdfa['options']);return db[_0x6dc9('0x2a')][_0x6dc9('0x45')](_0x2474c8)[_0x6dc9('0x22')](handleEntityNotFound(_0xc98063,null))[_0x6dc9('0x22')](respondWithResult(_0xc98063,null))[_0x6dc9('0x41')](handleError(_0xc98063,null));};exports[_0x6dc9('0x46')]=function(_0x377488,_0xc8a12f){return db[_0x6dc9('0x2a')][_0x6dc9('0x46')](_0x377488[_0x6dc9('0x47')],{})[_0x6dc9('0x22')](respondWithResult(_0xc8a12f,0xc9))[_0x6dc9('0x41')](handleError(_0xc8a12f,null));};exports[_0x6dc9('0x48')]=function(_0x1a196d,_0x6a50b5){if(_0x1a196d[_0x6dc9('0x47')]['id']){delete _0x1a196d[_0x6dc9('0x47')]['id'];}return db[_0x6dc9('0x2a')][_0x6dc9('0x45')]({'where':{'id':_0x1a196d['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x6a50b5,null))[_0x6dc9('0x22')](saveUpdates(_0x1a196d[_0x6dc9('0x47')],null))[_0x6dc9('0x22')](respondWithResult(_0x6a50b5,null))[_0x6dc9('0x41')](handleError(_0x6a50b5,null));};exports['destroy']=function(_0x9b2193,_0x45df14){return db[_0x6dc9('0x2a')][_0x6dc9('0x45')]({'where':{'id':_0x9b2193['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x45df14,null))[_0x6dc9('0x22')](removeEntity(_0x45df14,null))[_0x6dc9('0x41')](handleError(_0x45df14,null));};exports[_0x6dc9('0x49')]=function(_0x1958a6,_0x499b64,_0x4ccd5f){var _0x4637da={};var _0xcf96d8={};var _0x3d60bc;var _0x2b7897;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x1958a6[_0x6dc9('0x4a')]['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x499b64,null))[_0x6dc9('0x22')](function(_0x58d7af){if(_0x58d7af){_0x3d60bc=_0x58d7af;_0xcf96d8['model']=_[_0x6dc9('0x30')](db[_0x6dc9('0x4b')]['rawAttributes']);_0xcf96d8[_0x6dc9('0x2f')]=_['keys'](_0x1958a6[_0x6dc9('0x2f')]);_0xcf96d8[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0xcf96d8[_0x6dc9('0x2e')],_0xcf96d8[_0x6dc9('0x2f')]);_0x4637da[_0x6dc9('0x33')]=_['intersection'](_0xcf96d8['model'],qs['fields'](_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x4637da['attributes']=_0x4637da['attributes'][_0x6dc9('0x35')]?_0x4637da['attributes']:_0xcf96d8[_0x6dc9('0x2e')];_0x4637da['order']=qs[_0x6dc9('0x39')](_0x1958a6[_0x6dc9('0x2f')]['sort']);_0x4637da['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x1958a6[_0x6dc9('0x2f')],_0xcf96d8['filters']));if(_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x4637da[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x4637da[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x4637da[_0x6dc9('0x33')],function(_0x2527da){var _0xf3179a={};_0xf3179a[_0x2527da]={'$like':'%'+_0x1958a6['query'][_0x6dc9('0x3c')]+'%'};return _0xf3179a;})});}_0x4637da=_[_0x6dc9('0x3d')]({},_0x4637da,_0x1958a6[_0x6dc9('0x4c')]);return _0x3d60bc[_0x6dc9('0x49')](_0x4637da);}})[_0x6dc9('0x22')](function(_0x16feb2){if(_0x16feb2){_0x2b7897=_0x16feb2[_0x6dc9('0x35')];if(!_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x4637da[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x1a')]);_0x4637da[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x1958a6[_0x6dc9('0x2f')]['offset']);}return _0x3d60bc[_0x6dc9('0x49')](_0x4637da);}})[_0x6dc9('0x22')](function(_0x447b74){if(_0x447b74){return _0x447b74?{'count':_0x2b7897,'rows':_0x447b74}:null;}})['then'](respondWithResult(_0x499b64,null))[_0x6dc9('0x41')](handleError(_0x499b64,null));};exports[_0x6dc9('0x4d')]=function(_0x136bdc,_0xeb7351,_0x196f5e){var _0x342558={};var _0x51e143={};var _0x2cfc83;var _0x2f5411;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x136bdc['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0xeb7351,null))['then'](function(_0x58e2f9){if(_0x58e2f9){_0x2cfc83=_0x58e2f9;_0x51e143[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x4b')][_0x6dc9('0x2b')]);_0x51e143[_0x6dc9('0x2f')]=_['keys'](_0x136bdc['query']);_0x51e143[_0x6dc9('0x31')]=_['intersection'](_0x51e143['model'],_0x51e143[_0x6dc9('0x2f')]);_0x342558[_0x6dc9('0x33')]=_['intersection'](_0x51e143[_0x6dc9('0x2e')],qs['fields'](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x342558[_0x6dc9('0x33')]=_0x342558[_0x6dc9('0x33')]['length']?_0x342558['attributes']:_0x51e143[_0x6dc9('0x2e')];_0x342558['order']=qs[_0x6dc9('0x39')](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x342558['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x136bdc[_0x6dc9('0x2f')],_0x51e143['filters']));if(_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x342558[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x342558[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x342558[_0x6dc9('0x33')],function(_0x10e105){var _0xf85f12={};_0xf85f12[_0x10e105]={'$like':'%'+_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0xf85f12;})});}_0x342558=_[_0x6dc9('0x3d')]({},_0x342558,_0x136bdc['options']);return _0x2cfc83[_0x6dc9('0x4d')](_0x342558);}})[_0x6dc9('0x22')](function(_0x398ff6){if(_0x398ff6){_0x2f5411=_0x398ff6[_0x6dc9('0x35')];if(!_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x342558[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x136bdc['query'][_0x6dc9('0x1a')]);_0x342558[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}return _0x2cfc83['getSubjects'](_0x342558);}})[_0x6dc9('0x22')](function(_0xfd52b){if(_0xfd52b){return _0xfd52b?{'count':_0x2f5411,'rows':_0xfd52b}:null;}})[_0x6dc9('0x22')](respondWithResult(_0xeb7351,null))[_0x6dc9('0x41')](handleError(_0xeb7351,null));};exports['getDescriptions']=function(_0x14fd46,_0x473e21,_0x11fb4b){var _0x35cce9={};var _0xc7d650={};var _0x6422ec;var _0x28ce14;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x14fd46[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x473e21,null))[_0x6dc9('0x22')](function(_0x4a93ea){if(_0x4a93ea){_0x6422ec=_0x4a93ea;_0xc7d650[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db['DeskField'][_0x6dc9('0x2b')]);_0xc7d650[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x14fd46[_0x6dc9('0x2f')]);_0xc7d650['filters']=_['intersection'](_0xc7d650['model'],_0xc7d650[_0x6dc9('0x2f')]);_0x35cce9[_0x6dc9('0x33')]=_['intersection'](_0xc7d650[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x14fd46[_0x6dc9('0x2f')]['fields']));_0x35cce9[_0x6dc9('0x33')]=_0x35cce9[_0x6dc9('0x33')][_0x6dc9('0x35')]?_0x35cce9[_0x6dc9('0x33')]:_0xc7d650[_0x6dc9('0x2e')];_0x35cce9[_0x6dc9('0x38')]=qs['sort'](_0x14fd46[_0x6dc9('0x2f')]['sort']);_0x35cce9['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x14fd46[_0x6dc9('0x2f')],_0xc7d650[_0x6dc9('0x31')]));if(_0x14fd46[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x35cce9[_0x6dc9('0x3a')]=_['merge'](_0x35cce9[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x35cce9[_0x6dc9('0x33')],function(_0xaa6a40){var _0x3d5d09={};_0x3d5d09[_0xaa6a40]={'$like':'%'+_0x14fd46[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x3d5d09;})});}_0x35cce9=_[_0x6dc9('0x3d')]({},_0x35cce9,_0x14fd46['options']);return _0x6422ec[_0x6dc9('0x4e')](_0x35cce9);}})[_0x6dc9('0x22')](function(_0x485d79){if(_0x485d79){_0x28ce14=_0x485d79[_0x6dc9('0x35')];if(!_0x14fd46[_0x6dc9('0x2f')]['hasOwnProperty'](_0x6dc9('0x37'))){_0x35cce9[_0x6dc9('0x1a')]=qs['limit'](_0x14fd46['query'][_0x6dc9('0x1a')]);_0x35cce9[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x14fd46['query'][_0x6dc9('0x1b')]);}return _0x6422ec[_0x6dc9('0x4e')](_0x35cce9);}})[_0x6dc9('0x22')](function(_0x3d099a){if(_0x3d099a){return _0x3d099a?{'count':_0x28ce14,'rows':_0x3d099a}:null;}})['then'](respondWithResult(_0x473e21,null))['catch'](handleError(_0x473e21,null));};exports['getTags']=function(_0x12958a,_0x5c209f,_0xd7d244){var _0x447468={};var _0x4dc7d0={};var _0x2a4933;var _0x585db4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x12958a[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c209f,null))[_0x6dc9('0x22')](function(_0x2cf693){if(_0x2cf693){_0x2a4933=_0x2cf693;_0x4dc7d0[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x4f')]['rawAttributes']);_0x4dc7d0[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x12958a[_0x6dc9('0x2f')]);_0x4dc7d0[_0x6dc9('0x31')]=_['intersection'](_0x4dc7d0[_0x6dc9('0x2e')],_0x4dc7d0[_0x6dc9('0x2f')]);_0x447468[_0x6dc9('0x33')]=_[_0x6dc9('0x32')](_0x4dc7d0[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x447468['attributes']=_0x447468[_0x6dc9('0x33')]['length']?_0x447468[_0x6dc9('0x33')]:_0x4dc7d0[_0x6dc9('0x2e')];_0x447468[_0x6dc9('0x38')]=qs[_0x6dc9('0x39')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x447468[_0x6dc9('0x3a')]=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x12958a[_0x6dc9('0x2f')],_0x4dc7d0[_0x6dc9('0x31')]));if(_0x12958a['query'][_0x6dc9('0x3c')]){_0x447468[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x447468[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x447468['attributes'],function(_0x589be0){var _0x588634={};_0x588634[_0x589be0]={'$like':'%'+_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x588634;})});}_0x447468=_['merge']({},_0x447468,_0x12958a[_0x6dc9('0x4c')]);return _0x2a4933['getTags'](_0x447468);}})['then'](function(_0x45889f){if(_0x45889f){_0x585db4=_0x45889f[_0x6dc9('0x35')];if(!_0x12958a['query'][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x447468[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x1a')]);_0x447468[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}return _0x2a4933[_0x6dc9('0x50')](_0x447468);}})[_0x6dc9('0x22')](function(_0x46a310){if(_0x46a310){return _0x46a310?{'count':_0x585db4,'rows':_0x46a310}:null;}})[_0x6dc9('0x22')](respondWithResult(_0x5c209f,null))[_0x6dc9('0x41')](handleError(_0x5c209f,null));};exports[_0x6dc9('0x51')]=function(_0x3976ab,_0x56de99,_0x43b40b){if(_0x3976ab['body']['id']){delete _0x3976ab[_0x6dc9('0x47')]['id'];}return db[_0x6dc9('0x2a')][_0x6dc9('0x52')]({'where':{'id':_0x3976ab[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56de99,null))[_0x6dc9('0x22')](function(_0x53ca4c){if(_0x53ca4c){return _0x53ca4c[_0x6dc9('0x51')](_0x3976ab['body'][_0x6dc9('0x53')]||[]);}return null;})[_0x6dc9('0x22')](respondWithResult(_0x56de99,null))[_0x6dc9('0x41')](handleError(_0x56de99,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b1f02c0..2f88f77 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 _0xa554=['lodash','util','../../config/logger','api','request-promise','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0xea2195,_0x27b275){var _0x9b6cc6=function(_0x26dba8){while(--_0x26dba8){_0xea2195['push'](_0xea2195['shift']());}};_0x9b6cc6(++_0x27b275);}(_0xa554,0x104));var _0x4a55=function(_0x474a4c,_0x280193){_0x474a4c=_0x474a4c-0x0;var _0x5679b2=_0xa554[_0x474a4c];return _0x5679b2;};'use strict';var _=require(_0x4a55('0x0'));var util=require(_0x4a55('0x1'));var logger=require(_0x4a55('0x2'))(_0x4a55('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a55('0x5'));var config=require('../../config/environment');var attributes=require(_0x4a55('0x6'));module[_0x4a55('0x7')]=function(_0xc99a95,_0x194953){return _0xc99a95[_0x4a55('0x8')](_0x4a55('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f43=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_desk_configurations','util','../../config/logger'];(function(_0x33123f,_0x2255c5){var _0xa33d79=function(_0xaa420){while(--_0xaa420){_0x33123f['push'](_0x33123f['shift']());}};_0xa33d79(++_0x2255c5);}(_0x5f43,0xbc));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x35f4('0x0'));var logger=require(_0x35f4('0x1'))('api');var moment=require(_0x35f4('0x2'));var BPromise=require(_0x35f4('0x3'));var rp=require(_0x35f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35f4('0x5'));var config=require(_0x35f4('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x35f4('0x7')]=function(_0x29edea,_0x2d70c5){return _0x29edea[_0x35f4('0x8')]('DeskConfiguration',attributes,{'tableName':_0x35f4('0x9'),'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 b487ae4..e25ff4f 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 _0xab54=['error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x57beaf,_0x165fb5){var _0x1f23c6=function(_0x240790){while(--_0x240790){_0x57beaf['push'](_0x57beaf['shift']());}};_0x1f23c6(++_0x165fb5);}(_0xab54,0x115));var _0x4ab5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab54[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4ab5('0x0'));var moment=require(_0x4ab5('0x1'));var BPromise=require(_0x4ab5('0x2'));var rs=require(_0x4ab5('0x3'));var fs=require('fs');var Redis=require(_0x4ab5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ab5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4ab5('0x6'));var client=jayson[_0x4ab5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c39fe,_0x5c8c61,_0x467942){return new BPromise(function(_0x600112,_0xd57886){return client[_0x4ab5('0x8')](_0x2c39fe,_0x467942)['then'](function(_0x58e6a7){logger['info'](_0x4ab5('0x9'),_0x5c8c61,_0x4ab5('0xa'));logger['debug'](_0x4ab5('0xb'),_0x5c8c61,_0x4ab5('0xa'),JSON['stringify'](_0x58e6a7));if(_0x58e6a7[_0x4ab5('0xc')]){if(_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xd')]===0x1f4){logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);return _0xd57886(_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);}logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);return _0x600112(_0x58e6a7[_0x4ab5('0xc')]['message']);}else{logger[_0x4ab5('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x5c8c61,_0x4ab5('0xa'));_0x600112(_0x58e6a7['result']['message']);}})[_0x4ab5('0x10')](function(_0x1b1ca5){logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x1b1ca5);_0xd57886(_0x1b1ca5);});});} \ No newline at end of file +var _0x97ce=['jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x1609ef,_0x5c7fbb){var _0x1c7ad8=function(_0x1de73b){while(--_0x1de73b){_0x1609ef['push'](_0x1609ef['shift']());}};_0x1c7ad8(++_0x5c7fbb);}(_0x97ce,0x151));var _0xe97c=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x97ce[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index ec7e05a..7257f19 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 _0x333e=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','/:id','post','create','update'];(function(_0x4af063,_0x4bac54){var _0x5e1430=function(_0x5d2219){while(--_0x5d2219){_0x4af063['push'](_0x4af063['shift']());}};_0x5e1430(++_0x4bac54);}(_0x333e,0x113));var _0xe333=function(_0x10cfc2,_0x1cffff){_0x10cfc2=_0x10cfc2-0x0;var _0x19f55e=_0x333e[_0x10cfc2];return _0x19f55e;};'use strict';var multer=require(_0xe333('0x0'));var util=require(_0xe333('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe333('0x2'));var router=express[_0xe333('0x3')]();var fs_extra=require(_0xe333('0x4'));var auth=require(_0xe333('0x5'));var interaction=require(_0xe333('0x6'));var config=require('../../config/environment');var controller=require(_0xe333('0x7'));router[_0xe333('0x8')]('/',auth[_0xe333('0x9')](),controller['index']);router[_0xe333('0x8')](_0xe333('0xa'),auth[_0xe333('0x9')](),controller['show']);router[_0xe333('0xb')]('/',auth[_0xe333('0x9')](),controller[_0xe333('0xc')]);router['put']('/:id',auth[_0xe333('0x9')](),controller[_0xe333('0xd')]);router[_0xe333('0xe')](_0xe333('0xa'),auth[_0xe333('0x9')](),controller[_0xe333('0xf')]);module[_0xe333('0x10')]=router; \ No newline at end of file +var _0x2539=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x302e35,_0x197af1){var _0x31d5f9=function(_0x140029){while(--_0x140029){_0x302e35['push'](_0x302e35['shift']());}};_0x31d5f9(++_0x197af1);}(_0x2539,0x147));var _0x9253=function(_0xdb8e11,_0x29b21d){_0xdb8e11=_0xdb8e11-0x0;var _0x109e0f=_0x2539[_0xdb8e11];return _0x109e0f;};'use strict';var multer=require(_0x9253('0x0'));var util=require(_0x9253('0x1'));var path=require(_0x9253('0x2'));var timeout=require(_0x9253('0x3'));var express=require(_0x9253('0x4'));var router=express[_0x9253('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9253('0x6'));var interaction=require(_0x9253('0x7'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x9253('0x8')]('/',auth['isAuthenticated'](),controller[_0x9253('0x9')]);router['get'](_0x9253('0xa'),auth[_0x9253('0xb')](),controller[_0x9253('0xc')]);router[_0x9253('0xd')]('/',auth[_0x9253('0xb')](),controller[_0x9253('0xe')]);router[_0x9253('0xf')]('/:id',auth[_0x9253('0xb')](),controller[_0x9253('0x10')]);router[_0x9253('0x11')]('/:id',auth[_0x9253('0xb')](),controller['destroy']);module[_0x9253('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 41cfe3f..513355e 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 _0x38cc=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x38cc,0x16d));var _0xc38c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38cc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc38c('0x0'));module[_0xc38c('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc38c('0x2'),_0xc38c('0x3'),'customVariable',_0xc38c('0x4'),_0xc38c('0x5')),'defaultValue':_0xc38c('0x2')},'content':{'type':Sequelize[_0xc38c('0x6')]},'key':{'type':Sequelize[_0xc38c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc38c('0x2'),'variable',_0xc38c('0x7'))},'keyContent':{'type':Sequelize[_0xc38c('0x6')]},'idField':{'type':Sequelize[_0xc38c('0x6')]},'nameField':{'type':Sequelize[_0xc38c('0x6')]},'customField':{'type':Sequelize[_0xc38c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc38c('0x6')]}}; \ No newline at end of file +var _0x79c0=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x79c0,0xac));var _0x079c=function(_0x361b92,_0x52bd74){_0x361b92=_0x361b92-0x0;var _0x34b36b=_0x79c0[_0x361b92];return _0x34b36b;};'use strict';var Sequelize=require(_0x079c('0x0'));module[_0x079c('0x1')]={'type':{'type':Sequelize[_0x079c('0x2')](_0x079c('0x3'),_0x079c('0x4'),_0x079c('0x5'),_0x079c('0x6'),'picklist'),'defaultValue':_0x079c('0x3')},'content':{'type':Sequelize[_0x079c('0x7')]},'key':{'type':Sequelize[_0x079c('0x7')]},'keyType':{'type':Sequelize[_0x079c('0x2')](_0x079c('0x3'),_0x079c('0x4'),_0x079c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x079c('0x7')]},'nameField':{'type':Sequelize[_0x079c('0x7')]},'customField':{'type':Sequelize[_0x079c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x079c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 392b710..0d8cea0 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 _0x2133=['create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','index','map','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','params','DeskField','rawAttributes','includeAll'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x2133,0x1d1));var _0x3213=function(_0x53d451,_0x550b81){_0x53d451=_0x53d451-0x0;var _0x3de4d9=_0x2133[_0x53d451];return _0x3de4d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3213('0x0'));var zipdir=require(_0x3213('0x1'));var jsonpatch=require(_0x3213('0x2'));var rp=require(_0x3213('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3213('0x4'));var util=require(_0x3213('0x5'));var path=require(_0x3213('0x6'));var sox=require(_0x3213('0x7'));var csv=require(_0x3213('0x8'));var ejs=require(_0x3213('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3213('0xa'));var squel=require(_0x3213('0xb'));var crypto=require(_0x3213('0xc'));var jsforce=require(_0x3213('0xd'));var deskjs=require(_0x3213('0xe'));var toCsv=require(_0x3213('0x8'));var querystring=require(_0x3213('0xf'));var Papa=require(_0x3213('0x10'));var Redis=require(_0x3213('0x11'));var authService=require(_0x3213('0x12'));var qs=require(_0x3213('0x13'));var as=require(_0x3213('0x14'));var hardwareService=require(_0x3213('0x15'));var logger=require(_0x3213('0x16'))(_0x3213('0x17'));var utils=require(_0x3213('0x18'));var config=require(_0x3213('0x19'));var licenseUtil=require(_0x3213('0x1a'));var db=require(_0x3213('0x1b'))['db'];function respondWithStatusCode(_0x31d472,_0xe1df65){_0xe1df65=_0xe1df65||0xcc;return function(_0x5a5d7f){if(_0x5a5d7f){return _0x31d472[_0x3213('0x1c')](_0xe1df65);}return _0x31d472['status'](_0xe1df65)[_0x3213('0x1d')]();};}function respondWithResult(_0x37ee36,_0x129581){_0x129581=_0x129581||0xc8;return function(_0x291310){if(_0x291310){return _0x37ee36[_0x3213('0x1e')](_0x129581)[_0x3213('0x1f')](_0x291310);}};}function respondWithFilteredResult(_0x5c62f6,_0x4a7097){return function(_0x52ac4c){if(_0x52ac4c){var _0x60ca77=typeof _0x4a7097[_0x3213('0x20')]===_0x3213('0x21')&&typeof _0x4a7097[_0x3213('0x22')]===_0x3213('0x21');var _0x11976a=_0x52ac4c[_0x3213('0x23')];var _0x45e196=_0x60ca77?0x0:_0x4a7097[_0x3213('0x20')];var _0x2187aa=_0x60ca77?_0x52ac4c['count']:_0x4a7097[_0x3213('0x20')]+_0x4a7097[_0x3213('0x22')];var _0x21ac6b;if(_0x2187aa>=_0x11976a){_0x2187aa=_0x11976a;_0x21ac6b=0xc8;}else{_0x21ac6b=0xce;}_0x5c62f6['status'](_0x21ac6b);return _0x5c62f6[_0x3213('0x24')]('Content-Range',_0x45e196+'-'+_0x2187aa+'/'+_0x11976a)[_0x3213('0x1f')](_0x52ac4c);}return null;};}function patchUpdates(_0x389582){return function(_0x42577b){try{jsonpatch[_0x3213('0x25')](_0x42577b,_0x389582,!![]);}catch(_0x2e7826){return BPromise[_0x3213('0x26')](_0x2e7826);}return _0x42577b[_0x3213('0x27')]();};}function saveUpdates(_0x5e0176,_0x7a799d){return function(_0x2b041b){if(_0x2b041b){return _0x2b041b[_0x3213('0x28')](_0x5e0176)[_0x3213('0x29')](function(_0x2b13b2){return _0x2b13b2;});}return null;};}function removeEntity(_0x147b36,_0x3c4eeb){return function(_0x4f4759){if(_0x4f4759){return _0x4f4759[_0x3213('0x2a')]()[_0x3213('0x29')](function(){_0x147b36[_0x3213('0x1e')](0xcc)[_0x3213('0x1d')]();});}};}function handleEntityNotFound(_0x5ec619,_0x34231e){return function(_0x1b0593){if(!_0x1b0593){_0x5ec619['sendStatus'](0x194);}return _0x1b0593;};}function handleError(_0x402d0e,_0x2b449b){_0x2b449b=_0x2b449b||0x1f4;return function(_0x506929){logger[_0x3213('0x2b')](_0x506929['stack']);if(_0x506929['name']){delete _0x506929['name'];}_0x402d0e[_0x3213('0x1e')](_0x2b449b)['send'](_0x506929);};}exports[_0x3213('0x2c')]=function(_0x589a8e,_0x146183){var _0x1e50c2={},_0x288094={},_0x2c3184={'count':0x0,'rows':[]};var _0x160971=_[_0x3213('0x2d')](db['DeskField']['rawAttributes'],function(_0x46a841){return{'name':_0x46a841[_0x3213('0x2e')],'type':_0x46a841[_0x3213('0x2f')]['key']};});_0x288094[_0x3213('0x30')]=_[_0x3213('0x2d')](_0x160971,_0x3213('0x31'));_0x288094[_0x3213('0x32')]=_[_0x3213('0x33')](_0x589a8e['query']);_0x288094[_0x3213('0x34')]=_[_0x3213('0x35')](_0x288094[_0x3213('0x30')],_0x288094[_0x3213('0x32')]);_0x1e50c2[_0x3213('0x36')]=_[_0x3213('0x35')](_0x288094[_0x3213('0x30')],qs[_0x3213('0x37')](_0x589a8e[_0x3213('0x32')][_0x3213('0x37')]));_0x1e50c2[_0x3213('0x36')]=_0x1e50c2[_0x3213('0x36')][_0x3213('0x38')]?_0x1e50c2[_0x3213('0x36')]:_0x288094[_0x3213('0x30')];if(!_0x589a8e[_0x3213('0x32')][_0x3213('0x39')](_0x3213('0x3a'))){_0x1e50c2['limit']=qs['limit'](_0x589a8e[_0x3213('0x32')][_0x3213('0x22')]);_0x1e50c2['offset']=qs['offset'](_0x589a8e[_0x3213('0x32')][_0x3213('0x20')]);}_0x1e50c2[_0x3213('0x3b')]=qs['sort'](_0x589a8e[_0x3213('0x32')][_0x3213('0x3c')]);_0x1e50c2[_0x3213('0x3d')]=qs[_0x3213('0x34')](_[_0x3213('0x3e')](_0x589a8e[_0x3213('0x32')],_0x288094['filters']),_0x160971);if(_0x589a8e[_0x3213('0x32')][_0x3213('0x3f')]){_0x1e50c2[_0x3213('0x3d')]=_['merge'](_0x1e50c2[_0x3213('0x3d')],{'$or':_[_0x3213('0x2d')](_0x160971,function(_0x9fc77e){if(_0x9fc77e[_0x3213('0x2f')]!==_0x3213('0x40')){var _0x44af3a={};_0x44af3a[_0x9fc77e[_0x3213('0x31')]]={'$like':'%'+_0x589a8e[_0x3213('0x32')][_0x3213('0x3f')]+'%'};return _0x44af3a;}})});}_0x1e50c2=_[_0x3213('0x41')]({},_0x1e50c2,_0x589a8e['options']);var _0x4f3351={'where':_0x1e50c2['where']};return db['DeskField']['count'](_0x4f3351)[_0x3213('0x29')](function(_0x505802){_0x2c3184[_0x3213('0x23')]=_0x505802;if(_0x589a8e['query']['includeAll']){_0x1e50c2[_0x3213('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x3213('0x43')](_0x1e50c2);})[_0x3213('0x29')](function(_0x12d466){_0x2c3184[_0x3213('0x44')]=_0x12d466;return _0x2c3184;})['then'](respondWithFilteredResult(_0x146183,_0x1e50c2))[_0x3213('0x45')](handleError(_0x146183,null));};exports['show']=function(_0x18f4f9,_0x2ec796){var _0x134fce={'raw':!![],'where':{'id':_0x18f4f9[_0x3213('0x46')]['id']}},_0x55b3ff={};_0x55b3ff['model']=_[_0x3213('0x33')](db[_0x3213('0x47')][_0x3213('0x48')]);_0x55b3ff[_0x3213('0x32')]=_['keys'](_0x18f4f9['query']);_0x55b3ff[_0x3213('0x34')]=_['intersection'](_0x55b3ff['model'],_0x55b3ff[_0x3213('0x32')]);_0x134fce[_0x3213('0x36')]=_[_0x3213('0x35')](_0x55b3ff[_0x3213('0x30')],qs['fields'](_0x18f4f9[_0x3213('0x32')][_0x3213('0x37')]));_0x134fce[_0x3213('0x36')]=_0x134fce['attributes']['length']?_0x134fce['attributes']:_0x55b3ff[_0x3213('0x30')];if(_0x18f4f9[_0x3213('0x32')][_0x3213('0x49')]){_0x134fce[_0x3213('0x42')]=[{'all':!![]}];}_0x134fce=_['merge']({},_0x134fce,_0x18f4f9['options']);return db['DeskField']['find'](_0x134fce)['then'](handleEntityNotFound(_0x2ec796,null))[_0x3213('0x29')](respondWithResult(_0x2ec796,null))[_0x3213('0x45')](handleError(_0x2ec796,null));};exports[_0x3213('0x4a')]=function(_0x519847,_0x4794b9){return db['DeskField'][_0x3213('0x4a')](_0x519847[_0x3213('0x4b')],{})['then'](respondWithResult(_0x4794b9,0xc9))[_0x3213('0x45')](handleError(_0x4794b9,null));};exports[_0x3213('0x28')]=function(_0x1168bd,_0x3768fc){if(_0x1168bd[_0x3213('0x4b')]['id']){delete _0x1168bd[_0x3213('0x4b')]['id'];}return db['DeskField'][_0x3213('0x4c')]({'where':{'id':_0x1168bd[_0x3213('0x46')]['id']}})['then'](handleEntityNotFound(_0x3768fc,null))[_0x3213('0x29')](saveUpdates(_0x1168bd[_0x3213('0x4b')],null))['then'](respondWithResult(_0x3768fc,null))[_0x3213('0x45')](handleError(_0x3768fc,null));};exports[_0x3213('0x2a')]=function(_0x3d29fe,_0x163614){return db[_0x3213('0x47')][_0x3213('0x4c')]({'where':{'id':_0x3d29fe[_0x3213('0x46')]['id']}})[_0x3213('0x29')](handleEntityNotFound(_0x163614,null))[_0x3213('0x29')](removeEntity(_0x163614,null))[_0x3213('0x45')](handleError(_0x163614,null));}; \ No newline at end of file +var _0x8958=['create','body','params','rimraf','bluebird','util','path','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','DeskField','includeAll','include','findAll','merge','find','catch'];(function(_0x15b1d3,_0x254331){var _0x31caf2=function(_0xa05e12){while(--_0xa05e12){_0x15b1d3['push'](_0x15b1d3['shift']());}};_0x31caf2(++_0x254331);}(_0x8958,0x93));var _0x8895=function(_0x37010b,_0x1d1778){_0x37010b=_0x37010b-0x0;var _0x118613=_0x8958[_0x37010b];return _0x118613;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['DeskField']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['map'](_0x16b65b,_0x8895('0x26'));_0x37ac3a['query']=_[_0x8895('0x2e')](_0x5c03ea['query']);_0x37ac3a[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a[_0x8895('0x31')]);_0x6e449d[_0x8895('0x32')]=_['intersection'](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x33')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x33')]));_0x6e449d[_0x8895('0x32')]=_0x6e449d['attributes'][_0x8895('0x34')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea['query'][_0x8895('0x35')](_0x8895('0x36'))){_0x6e449d[_0x8895('0x1d')]=qs[_0x8895('0x1d')](_0x5c03ea[_0x8895('0x31')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs['offset'](_0x5c03ea[_0x8895('0x31')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x37')]=qs[_0x8895('0x38')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x38')]);_0x6e449d['where']=qs[_0x8895('0x2f')](_[_0x8895('0x39')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x2f')]),_0x16b65b);if(_0x5c03ea['query'][_0x8895('0x3a')]){_0x6e449d[_0x8895('0x3b')]=_['merge'](_0x6e449d[_0x8895('0x3b')],{'$or':_[_0x8895('0x29')](_0x16b65b,function(_0x5b7204){if(_0x5b7204['type']!==_0x8895('0x3c')){var _0xf0b378={};_0xf0b378[_0x5b7204[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea[_0x8895('0x31')][_0x8895('0x3a')]+'%'};return _0xf0b378;}})});}_0x6e449d=_['merge']({},_0x6e449d,_0x5c03ea[_0x8895('0x3d')]);var _0x25c854={'where':_0x6e449d[_0x8895('0x3b')]};return db[_0x8895('0x3e')][_0x8895('0x1e')](_0x25c854)[_0x8895('0x24')](function(_0x4a7e22){_0x3fc4cc[_0x8895('0x1e')]=_0x4a7e22;if(_0x5c03ea['query'][_0x8895('0x3f')]){_0x6e449d[_0x8895('0x40')]=[{'all':!![]}];}return db['DeskField'][_0x8895('0x41')](_0x6e449d);})['then'](function(_0x1e6395){_0x3fc4cc['rows']=_0x1e6395;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x4881d0,_0x47cf10){var _0x447ed6={'raw':!![],'where':{'id':_0x4881d0['params']['id']}},_0x206f57={};_0x206f57['model']=_[_0x8895('0x2e')](db[_0x8895('0x3e')]['rawAttributes']);_0x206f57[_0x8895('0x31')]=_[_0x8895('0x2e')](_0x4881d0[_0x8895('0x31')]);_0x206f57[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x206f57['model'],_0x206f57['query']);_0x447ed6['attributes']=_[_0x8895('0x30')](_0x206f57['model'],qs[_0x8895('0x33')](_0x4881d0[_0x8895('0x31')][_0x8895('0x33')]));_0x447ed6[_0x8895('0x32')]=_0x447ed6['attributes'][_0x8895('0x34')]?_0x447ed6[_0x8895('0x32')]:_0x206f57[_0x8895('0x2d')];if(_0x4881d0[_0x8895('0x31')][_0x8895('0x3f')]){_0x447ed6[_0x8895('0x40')]=[{'all':!![]}];}_0x447ed6=_[_0x8895('0x42')]({},_0x447ed6,_0x4881d0[_0x8895('0x3d')]);return db['DeskField'][_0x8895('0x43')](_0x447ed6)[_0x8895('0x24')](handleEntityNotFound(_0x47cf10,null))['then'](respondWithResult(_0x47cf10,null))[_0x8895('0x44')](handleError(_0x47cf10,null));};exports['create']=function(_0x5829ec,_0x13546d){return db[_0x8895('0x3e')][_0x8895('0x45')](_0x5829ec['body'],{})[_0x8895('0x24')](respondWithResult(_0x13546d,0xc9))['catch'](handleError(_0x13546d,null));};exports[_0x8895('0x23')]=function(_0x152197,_0xb3ecd6){if(_0x152197[_0x8895('0x46')]['id']){delete _0x152197[_0x8895('0x46')]['id'];}return db[_0x8895('0x3e')][_0x8895('0x43')]({'where':{'id':_0x152197['params']['id']}})['then'](handleEntityNotFound(_0xb3ecd6,null))[_0x8895('0x24')](saveUpdates(_0x152197[_0x8895('0x46')],null))['then'](respondWithResult(_0xb3ecd6,null))[_0x8895('0x44')](handleError(_0xb3ecd6,null));};exports['destroy']=function(_0x4e8af3,_0x2daafe){return db['DeskField'][_0x8895('0x43')]({'where':{'id':_0x4e8af3[_0x8895('0x47')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2daafe,null))[_0x8895('0x24')](removeEntity(_0x2daafe,null))[_0x8895('0x44')](handleError(_0x2daafe,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 04a4c73..926ac30 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 _0x1cfe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x25e4d6,_0x4dc667){var _0x27cd6e=function(_0x362484){while(--_0x362484){_0x25e4d6['push'](_0x25e4d6['shift']());}};_0x27cd6e(++_0x4dc667);}(_0x1cfe,0x8c));var _0xe1cf=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x1cfe[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xe1cf('0x0'));var util=require(_0xe1cf('0x1'));var logger=require(_0xe1cf('0x2'))(_0xe1cf('0x3'));var moment=require(_0xe1cf('0x4'));var BPromise=require(_0xe1cf('0x5'));var rp=require(_0xe1cf('0x6'));var fs=require('fs');var path=require(_0xe1cf('0x7'));var rimraf=require(_0xe1cf('0x8'));var config=require(_0xe1cf('0x9'));var attributes=require(_0xe1cf('0xa'));module[_0xe1cf('0xb')]=function(_0x514636,_0x841226){return _0x514636[_0xe1cf('0xc')](_0xe1cf('0xd'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xe1cf('0xe'),'fields':['idField',_0xe1cf('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd89=['int_desk_fields','desk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField'];(function(_0x729b6e,_0x27ec6d){var _0x3475f1=function(_0x1afc76){while(--_0x1afc76){_0x729b6e['push'](_0x729b6e['shift']());}};_0x3475f1(++_0x27ec6d);}(_0xbd89,0x13e));var _0x9bd8=function(_0x2b11f9,_0x55a82b){_0x2b11f9=_0x2b11f9-0x0;var _0x44def1=_0xbd89[_0x2b11f9];return _0x44def1;};'use strict';var _=require('lodash');var util=require(_0x9bd8('0x0'));var logger=require(_0x9bd8('0x1'))(_0x9bd8('0x2'));var moment=require(_0x9bd8('0x3'));var BPromise=require(_0x9bd8('0x4'));var rp=require(_0x9bd8('0x5'));var fs=require('fs');var path=require(_0x9bd8('0x6'));var rimraf=require(_0x9bd8('0x7'));var config=require('../../config/environment');var attributes=require(_0x9bd8('0x8'));module[_0x9bd8('0x9')]=function(_0x37d137,_0x5547be){return _0x37d137[_0x9bd8('0xa')](_0x9bd8('0xb'),attributes,{'tableName':_0x9bd8('0xc'),'paranoid':![],'indexes':[{'name':_0x9bd8('0xd'),'fields':[_0x9bd8('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 918b130..60898df 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 _0x9003=['DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x267893,_0x32e5b7){var _0x1d0bbd=function(_0xb4d3f4){while(--_0xb4d3f4){_0x267893['push'](_0x267893['shift']());}};_0x1d0bbd(++_0x32e5b7);}(_0x9003,0x178));var _0x3900=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9003[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x3900('0x0'));var util=require(_0x3900('0x1'));var moment=require(_0x3900('0x2'));var BPromise=require(_0x3900('0x3'));var rs=require(_0x3900('0x4'));var fs=require('fs');var Redis=require(_0x3900('0x5'));var db=require(_0x3900('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3900('0x7'))('rpc');var config=require(_0x3900('0x8'));var jayson=require(_0x3900('0x9'));var client=jayson[_0x3900('0xa')][_0x3900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d8c12,_0x5ed86c,_0x29d11f){return new BPromise(function(_0x5a43a9,_0x5c8bf1){return client[_0x3900('0xc')](_0x2d8c12,_0x29d11f)[_0x3900('0xd')](function(_0x3bb106){logger[_0x3900('0xe')](_0x3900('0xf'),_0x5ed86c,_0x3900('0x10'));logger[_0x3900('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x5ed86c,'request\x20sent',JSON[_0x3900('0x12')](_0x3bb106));if(_0x3bb106[_0x3900('0x13')]){if(_0x3bb106['error'][_0x3900('0x14')]===0x1f4){logger[_0x3900('0x13')](_0x3900('0xf'),_0x5ed86c,_0x3bb106[_0x3900('0x13')][_0x3900('0x15')]);return _0x5c8bf1(_0x3bb106[_0x3900('0x13')][_0x3900('0x15')]);}logger[_0x3900('0x13')]('DeskField,\x20%s,\x20%s',_0x5ed86c,_0x3bb106['error'][_0x3900('0x15')]);return _0x5a43a9(_0x3bb106[_0x3900('0x13')][_0x3900('0x15')]);}else{logger[_0x3900('0xe')](_0x3900('0xf'),_0x5ed86c,_0x3900('0x10'));_0x5a43a9(_0x3bb106[_0x3900('0x16')][_0x3900('0x15')]);}})['catch'](function(_0x56b07e){logger[_0x3900('0x13')]('DeskField,\x20%s,\x20%s',_0x5ed86c,_0x56b07e);_0x5c8bf1(_0x56b07e);});});} \ No newline at end of file +var _0xff92=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xff92,0x154));var _0x2ff9=function(_0xe2a4aa,_0x14fce2){_0xe2a4aa=_0xe2a4aa-0x0;var _0x51d232=_0xff92[_0xe2a4aa];return _0x51d232;};'use strict';var _=require('lodash');var util=require(_0x2ff9('0x0'));var moment=require(_0x2ff9('0x1'));var BPromise=require(_0x2ff9('0x2'));var rs=require(_0x2ff9('0x3'));var fs=require('fs');var Redis=require(_0x2ff9('0x4'));var db=require(_0x2ff9('0x5'))['db'];var utils=require(_0x2ff9('0x6'));var logger=require('../../config/logger')(_0x2ff9('0x7'));var config=require(_0x2ff9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ff9('0x9')][_0x2ff9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a3b16,_0x25d310,_0x153f1e){return new BPromise(function(_0x5bf2fc,_0x545e87){return client[_0x2ff9('0xb')](_0x1a3b16,_0x153f1e)[_0x2ff9('0xc')](function(_0xbd6ba6){logger[_0x2ff9('0xd')](_0x2ff9('0xe'),_0x25d310,_0x2ff9('0xf'));logger[_0x2ff9('0x10')](_0x2ff9('0x11'),_0x25d310,_0x2ff9('0xf'),JSON[_0x2ff9('0x12')](_0xbd6ba6));if(_0xbd6ba6[_0x2ff9('0x13')]){if(_0xbd6ba6[_0x2ff9('0x13')]['code']===0x1f4){logger['error'](_0x2ff9('0xe'),_0x25d310,_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);return _0x545e87(_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);}logger[_0x2ff9('0x13')](_0x2ff9('0xe'),_0x25d310,_0xbd6ba6['error'][_0x2ff9('0x14')]);return _0x5bf2fc(_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);}else{logger[_0x2ff9('0xd')]('DeskField,\x20%s,\x20%s',_0x25d310,'request\x20sent');_0x5bf2fc(_0xbd6ba6[_0x2ff9('0x15')][_0x2ff9('0x14')]);}})[_0x2ff9('0x16')](function(_0x116364){logger[_0x2ff9('0x13')](_0x2ff9('0xe'),_0x25d310,_0x116364);_0x545e87(_0x116364);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 94fbc24..dc75826 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 _0xa043=['addConfiguration','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','./intDynamics365Account.controller','isAuthenticated','get','/:id/configurations','post','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa043,0x84));var _0x3a04=function(_0x4a61c8,_0x17f136){_0x4a61c8=_0x4a61c8-0x0;var _0x548e5f=_0xa043[_0x4a61c8];return _0x548e5f;};'use strict';var multer=require(_0x3a04('0x0'));var util=require(_0x3a04('0x1'));var path=require(_0x3a04('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a04('0x3'));var router=express[_0x3a04('0x4')]();var fs_extra=require(_0x3a04('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3a04('0x6'));router['get']('/',auth[_0x3a04('0x7')](),controller['index']);router[_0x3a04('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3a04('0x8')](_0x3a04('0x9'),auth[_0x3a04('0x7')](),controller['getConfigurations']);router[_0x3a04('0x8')]('/:id/fields',auth[_0x3a04('0x7')](),controller['getFields']);router[_0x3a04('0xa')]('/',auth[_0x3a04('0x7')](),controller[_0x3a04('0xb')]);router[_0x3a04('0xa')](_0x3a04('0x9'),auth[_0x3a04('0x7')](),controller[_0x3a04('0xc')]);router[_0x3a04('0xd')](_0x3a04('0xe'),auth[_0x3a04('0x7')](),controller[_0x3a04('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3a04('0x10')]);module[_0x3a04('0x11')]=router; \ No newline at end of file +var _0x3377=['../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x566dd5,_0x491250){var _0x184612=function(_0xe8a501){while(--_0xe8a501){_0x566dd5['push'](_0x566dd5['shift']());}};_0x184612(++_0x491250);}(_0x3377,0x1c4));var _0x7337=function(_0x59c8b1,_0x35894c){_0x59c8b1=_0x59c8b1-0x0;var _0x442e8e=_0x3377[_0x59c8b1];return _0x442e8e;};'use strict';var multer=require(_0x7337('0x0'));var util=require(_0x7337('0x1'));var path=require(_0x7337('0x2'));var timeout=require(_0x7337('0x3'));var express=require(_0x7337('0x4'));var router=express[_0x7337('0x5')]();var fs_extra=require(_0x7337('0x6'));var auth=require(_0x7337('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7337('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x7337('0x9')]('/',auth[_0x7337('0xa')](),controller[_0x7337('0xb')]);router[_0x7337('0x9')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller['show']);router[_0x7337('0x9')](_0x7337('0xd'),auth[_0x7337('0xa')](),controller[_0x7337('0xe')]);router[_0x7337('0x9')](_0x7337('0xf'),auth[_0x7337('0xa')](),controller[_0x7337('0x10')]);router[_0x7337('0x11')]('/',auth[_0x7337('0xa')](),controller[_0x7337('0x12')]);router[_0x7337('0x11')](_0x7337('0xd'),auth['isAuthenticated'](),controller[_0x7337('0x13')]);router[_0x7337('0x14')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller[_0x7337('0x15')]);router[_0x7337('0x16')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b86f786..73c3318 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 _0x2cc0=['STRING'];(function(_0x1edd20,_0x1dbc2f){var _0x4188b9=function(_0x465e48){while(--_0x465e48){_0x1edd20['push'](_0x1edd20['shift']());}};_0x4188b9(++_0x1dbc2f);}(_0x2cc0,0x17f));var _0x02cc=function(_0x3b4f0c,_0x30a9f5){_0x3b4f0c=_0x3b4f0c-0x0;var _0x3b1849=_0x2cc0[_0x3b4f0c];return _0x3b1849;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x02cc('0x0')]},'password':{'type':Sequelize[_0x02cc('0x0')]},'remoteUri':{'type':Sequelize[_0x02cc('0x0')]},'tenantId':{'type':Sequelize[_0x02cc('0x0')]},'clientId':{'type':Sequelize[_0x02cc('0x0')]},'clientSecret':{'type':Sequelize[_0x02cc('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd3f3=['sequelize','STRING'];(function(_0x339057,_0x4bf133){var _0x41da7c=function(_0x1c97b0){while(--_0x1c97b0){_0x339057['push'](_0x339057['shift']());}};_0x41da7c(++_0x4bf133);}(_0xd3f3,0xf0));var _0x3d3f=function(_0xf6fc32,_0x175c5e){_0xf6fc32=_0xf6fc32-0x0;var _0x32a988=_0xd3f3[_0xf6fc32];return _0x32a988;};'use strict';var Sequelize=require(_0x3d3f('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d3f('0x1')]},'username':{'type':Sequelize[_0x3d3f('0x1')]},'password':{'type':Sequelize[_0x3d3f('0x1')]},'remoteUri':{'type':Sequelize[_0x3d3f('0x1')]},'tenantId':{'type':Sequelize[_0x3d3f('0x1')]},'clientId':{'type':Sequelize[_0x3d3f('0x1')]},'clientSecret':{'type':Sequelize[_0x3d3f('0x1')]},'serverUrl':{'type':Sequelize[_0x3d3f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index ad87814..48c630e 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 _0x0fc2=['phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','tenantId','clientId','clientSecret','%s/api/data/v9.0/','https://login.microsoftonline.com/','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','isNil','forEach','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','test','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','Dynamics365Account','includeAll','include','findAll','rows','catch','params','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','Incident','PhoneCall','title','description','customerid','subject'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x0fc2,0x6e));var _0x20fc=function(_0x564b5f,_0x483efc){_0x564b5f=_0x564b5f-0x0;var _0x4735c6=_0x0fc2[_0x564b5f];return _0x4735c6;};'use strict';var emlformat=require(_0x20fc('0x0'));var rimraf=require(_0x20fc('0x1'));var zipdir=require(_0x20fc('0x2'));var jsonpatch=require(_0x20fc('0x3'));var rp=require('request-promise');var moment=require(_0x20fc('0x4'));var BPromise=require(_0x20fc('0x5'));var Mustache=require(_0x20fc('0x6'));var util=require(_0x20fc('0x7'));var path=require(_0x20fc('0x8'));var sox=require(_0x20fc('0x9'));var csv=require(_0x20fc('0xa'));var ejs=require(_0x20fc('0xb'));var fs=require('fs');var fs_extra=require(_0x20fc('0xc'));var _=require(_0x20fc('0xd'));var squel=require(_0x20fc('0xe'));var crypto=require(_0x20fc('0xf'));var jsforce=require(_0x20fc('0x10'));var deskjs=require(_0x20fc('0x11'));var toCsv=require(_0x20fc('0xa'));var querystring=require(_0x20fc('0x12'));var Papa=require('papaparse');var Redis=require(_0x20fc('0x13'));var authService=require(_0x20fc('0x14'));var qs=require(_0x20fc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20fc('0x16'));var logger=require(_0x20fc('0x17'))(_0x20fc('0x18'));var utils=require(_0x20fc('0x19'));var config=require(_0x20fc('0x1a'));var licenseUtil=require(_0x20fc('0x1b'));var db=require(_0x20fc('0x1c'))['db'];var integrations=require(_0x20fc('0x1d'));function respondWithStatusCode(_0x552afe,_0xe97a3e){_0xe97a3e=_0xe97a3e||0xcc;return function(_0x54caf2){if(_0x54caf2){return _0x552afe[_0x20fc('0x1e')](_0xe97a3e);}return _0x552afe['status'](_0xe97a3e)[_0x20fc('0x1f')]();};}function respondWithResult(_0x4c7f0e,_0x520c02){_0x520c02=_0x520c02||0xc8;return function(_0x18a462){if(_0x18a462){return _0x4c7f0e[_0x20fc('0x20')](_0x520c02)[_0x20fc('0x21')](_0x18a462);}};}function respondWithFilteredResult(_0x38a6da,_0x511e79){return function(_0x29fe77){if(_0x29fe77){var _0x368662=typeof _0x511e79['offset']==='undefined'&&typeof _0x511e79[_0x20fc('0x22')]===_0x20fc('0x23');var _0x3f3e2e=_0x29fe77[_0x20fc('0x24')];var _0x4d5e00=_0x368662?0x0:_0x511e79[_0x20fc('0x25')];var _0x322e2c=_0x368662?_0x29fe77[_0x20fc('0x24')]:_0x511e79[_0x20fc('0x25')]+_0x511e79[_0x20fc('0x22')];var _0xa4cfa1;if(_0x322e2c>=_0x3f3e2e){_0x322e2c=_0x3f3e2e;_0xa4cfa1=0xc8;}else{_0xa4cfa1=0xce;}_0x38a6da[_0x20fc('0x20')](_0xa4cfa1);return _0x38a6da[_0x20fc('0x26')](_0x20fc('0x27'),_0x4d5e00+'-'+_0x322e2c+'/'+_0x3f3e2e)[_0x20fc('0x21')](_0x29fe77);}return null;};}function patchUpdates(_0x4e2b0c){return function(_0x168369){try{jsonpatch[_0x20fc('0x28')](_0x168369,_0x4e2b0c,!![]);}catch(_0x57286b){return BPromise[_0x20fc('0x29')](_0x57286b);}return _0x168369[_0x20fc('0x2a')]();};}function saveUpdates(_0x359881,_0x39339a){return function(_0x2ef93a){if(_0x2ef93a){return _0x2ef93a[_0x20fc('0x2b')](_0x359881)[_0x20fc('0x2c')](function(_0x4bc36b){return _0x4bc36b;});}return null;};}function removeEntity(_0x37d3ad,_0x25d8d9){return function(_0x4bc227){if(_0x4bc227){return _0x4bc227[_0x20fc('0x2d')]()[_0x20fc('0x2c')](function(){_0x37d3ad[_0x20fc('0x20')](0xcc)[_0x20fc('0x1f')]();});}};}function handleEntityNotFound(_0x4feaa1,_0x1d1393){return function(_0x5dbded){if(!_0x5dbded){_0x4feaa1['sendStatus'](0x194);}return _0x5dbded;};}function handleError(_0x1b80f,_0x554092){_0x554092=_0x554092||0x1f4;return function(_0x4d1cb3){logger[_0x20fc('0x2e')](_0x4d1cb3[_0x20fc('0x2f')]);if(_0x4d1cb3['name']){delete _0x4d1cb3['name'];}_0x1b80f['status'](_0x554092)[_0x20fc('0x30')](_0x4d1cb3);};}exports[_0x20fc('0x31')]=function(_0x171d14,_0x2c6408){var _0x5d705f={},_0x498468={},_0x2e4115={'count':0x0,'rows':[]};var _0x18aa2c=_['map'](db['Dynamics365Account'][_0x20fc('0x32')],function(_0x539268){return{'name':_0x539268[_0x20fc('0x33')],'type':_0x539268[_0x20fc('0x34')][_0x20fc('0x35')]};});_0x498468[_0x20fc('0x36')]=_[_0x20fc('0x37')](_0x18aa2c,_0x20fc('0x38'));_0x498468['query']=_[_0x20fc('0x39')](_0x171d14['query']);_0x498468['filters']=_[_0x20fc('0x3a')](_0x498468['model'],_0x498468[_0x20fc('0x3b')]);_0x5d705f[_0x20fc('0x3c')]=_[_0x20fc('0x3a')](_0x498468[_0x20fc('0x36')],qs[_0x20fc('0x3d')](_0x171d14['query'][_0x20fc('0x3d')]));_0x5d705f['attributes']=_0x5d705f[_0x20fc('0x3c')][_0x20fc('0x3e')]?_0x5d705f['attributes']:_0x498468[_0x20fc('0x36')];if(!_0x171d14['query'][_0x20fc('0x3f')]('nolimit')){_0x5d705f['limit']=qs[_0x20fc('0x22')](_0x171d14[_0x20fc('0x3b')][_0x20fc('0x22')]);_0x5d705f[_0x20fc('0x25')]=qs[_0x20fc('0x25')](_0x171d14[_0x20fc('0x3b')]['offset']);}_0x5d705f[_0x20fc('0x40')]=qs[_0x20fc('0x41')](_0x171d14[_0x20fc('0x3b')][_0x20fc('0x41')]);_0x5d705f[_0x20fc('0x42')]=qs[_0x20fc('0x43')](_[_0x20fc('0x44')](_0x171d14[_0x20fc('0x3b')],_0x498468['filters']),_0x18aa2c);if(_0x171d14[_0x20fc('0x3b')][_0x20fc('0x45')]){_0x5d705f[_0x20fc('0x42')]=_[_0x20fc('0x46')](_0x5d705f[_0x20fc('0x42')],{'$or':_[_0x20fc('0x37')](_0x18aa2c,function(_0x4c24e9){if(_0x4c24e9['type']!=='VIRTUAL'){var _0x3def34={};_0x3def34[_0x4c24e9['name']]={'$like':'%'+_0x171d14[_0x20fc('0x3b')][_0x20fc('0x45')]+'%'};return _0x3def34;}})});}_0x5d705f=_[_0x20fc('0x46')]({},_0x5d705f,_0x171d14['options']);var _0x276910={'where':_0x5d705f[_0x20fc('0x42')]};return db[_0x20fc('0x47')][_0x20fc('0x24')](_0x276910)[_0x20fc('0x2c')](function(_0x212d72){_0x2e4115[_0x20fc('0x24')]=_0x212d72;if(_0x171d14[_0x20fc('0x3b')][_0x20fc('0x48')]){_0x5d705f[_0x20fc('0x49')]=[{'all':!![]}];}return db[_0x20fc('0x47')][_0x20fc('0x4a')](_0x5d705f);})['then'](function(_0x51a9d0){_0x2e4115[_0x20fc('0x4b')]=_0x51a9d0;return _0x2e4115;})[_0x20fc('0x2c')](respondWithFilteredResult(_0x2c6408,_0x5d705f))[_0x20fc('0x4c')](handleError(_0x2c6408,null));};exports['show']=function(_0x57469d,_0x249adb){var _0x2f8ee2={'raw':![],'where':{'id':_0x57469d[_0x20fc('0x4d')]['id']}},_0x1c7fcb={};_0x1c7fcb['model']=_['keys'](db[_0x20fc('0x47')][_0x20fc('0x32')]);_0x1c7fcb[_0x20fc('0x3b')]=_[_0x20fc('0x39')](_0x57469d['query']);_0x1c7fcb['filters']=_[_0x20fc('0x3a')](_0x1c7fcb[_0x20fc('0x36')],_0x1c7fcb[_0x20fc('0x3b')]);_0x2f8ee2[_0x20fc('0x3c')]=_[_0x20fc('0x3a')](_0x1c7fcb['model'],qs[_0x20fc('0x3d')](_0x57469d['query'][_0x20fc('0x3d')]));_0x2f8ee2[_0x20fc('0x3c')]=_0x2f8ee2[_0x20fc('0x3c')][_0x20fc('0x3e')]?_0x2f8ee2[_0x20fc('0x3c')]:_0x1c7fcb[_0x20fc('0x36')];if(_0x57469d[_0x20fc('0x3b')][_0x20fc('0x48')]){_0x2f8ee2[_0x20fc('0x49')]=[{'all':!![]}];}_0x2f8ee2=_[_0x20fc('0x46')]({},_0x2f8ee2,_0x57469d[_0x20fc('0x4e')]);return db[_0x20fc('0x47')][_0x20fc('0x4f')](_0x2f8ee2)[_0x20fc('0x2c')](handleEntityNotFound(_0x249adb,null))[_0x20fc('0x2c')](respondWithResult(_0x249adb,null))[_0x20fc('0x4c')](handleError(_0x249adb,null));};exports['create']=function(_0x21f50e,_0x46eb17){return db[_0x20fc('0x47')][_0x20fc('0x50')](_0x21f50e[_0x20fc('0x51')],{})[_0x20fc('0x2c')](respondWithResult(_0x46eb17,0xc9))[_0x20fc('0x4c')](handleError(_0x46eb17,null));};exports[_0x20fc('0x2b')]=function(_0x35d84c,_0x2829a0){if(_0x35d84c[_0x20fc('0x51')]['id']){delete _0x35d84c['body']['id'];}return db[_0x20fc('0x47')][_0x20fc('0x4f')]({'where':{'id':_0x35d84c[_0x20fc('0x4d')]['id']}})[_0x20fc('0x2c')](handleEntityNotFound(_0x2829a0,null))[_0x20fc('0x2c')](saveUpdates(_0x35d84c[_0x20fc('0x51')],null))['then'](respondWithResult(_0x2829a0,null))[_0x20fc('0x4c')](handleError(_0x2829a0,null));};exports[_0x20fc('0x2d')]=function(_0x1f5975,_0x3abe75){return db[_0x20fc('0x47')][_0x20fc('0x4f')]({'where':{'id':_0x1f5975[_0x20fc('0x4d')]['id']}})[_0x20fc('0x2c')](handleEntityNotFound(_0x3abe75,null))['then'](removeEntity(_0x3abe75,null))['catch'](handleError(_0x3abe75,null));};exports[_0x20fc('0x52')]=function(_0x113aa8,_0x17f6cf,_0x2a02ca){var _0x5ed81b={};var _0x5d7a7e={};var _0x49dd3a;var _0x1b5903;return db[_0x20fc('0x47')][_0x20fc('0x53')]({'where':{'id':_0x113aa8['params']['id']}})[_0x20fc('0x2c')](handleEntityNotFound(_0x17f6cf,null))[_0x20fc('0x2c')](function(_0x46bea7){if(_0x46bea7){_0x49dd3a=_0x46bea7;_0x5d7a7e[_0x20fc('0x36')]=_['keys'](db[_0x20fc('0x54')][_0x20fc('0x32')]);_0x5d7a7e[_0x20fc('0x3b')]=_['keys'](_0x113aa8[_0x20fc('0x3b')]);_0x5d7a7e[_0x20fc('0x43')]=_[_0x20fc('0x3a')](_0x5d7a7e[_0x20fc('0x36')],_0x5d7a7e[_0x20fc('0x3b')]);_0x5ed81b[_0x20fc('0x3c')]=_[_0x20fc('0x3a')](_0x5d7a7e[_0x20fc('0x36')],qs[_0x20fc('0x3d')](_0x113aa8[_0x20fc('0x3b')][_0x20fc('0x3d')]));_0x5ed81b['attributes']=_0x5ed81b[_0x20fc('0x3c')][_0x20fc('0x3e')]?_0x5ed81b[_0x20fc('0x3c')]:_0x5d7a7e[_0x20fc('0x36')];_0x5ed81b['order']=qs[_0x20fc('0x41')](_0x113aa8[_0x20fc('0x3b')][_0x20fc('0x41')]);_0x5ed81b[_0x20fc('0x42')]=qs['filters'](_['pick'](_0x113aa8[_0x20fc('0x3b')],_0x5d7a7e[_0x20fc('0x43')]));if(_0x113aa8[_0x20fc('0x3b')][_0x20fc('0x45')]){_0x5ed81b[_0x20fc('0x42')]=_['merge'](_0x5ed81b['where'],{'$or':_[_0x20fc('0x37')](_0x5ed81b[_0x20fc('0x3c')],function(_0x3874ce){var _0x2cbba6={};_0x2cbba6[_0x3874ce]={'$like':'%'+_0x113aa8['query'][_0x20fc('0x45')]+'%'};return _0x2cbba6;})});}_0x5ed81b=_['merge']({},_0x5ed81b,_0x113aa8[_0x20fc('0x4e')]);return _0x49dd3a[_0x20fc('0x52')](_0x5ed81b);}})[_0x20fc('0x2c')](function(_0x293583){if(_0x293583){_0x1b5903=_0x293583[_0x20fc('0x3e')];if(!_0x113aa8[_0x20fc('0x3b')][_0x20fc('0x3f')]('nolimit')){_0x5ed81b['limit']=qs['limit'](_0x113aa8[_0x20fc('0x3b')]['limit']);_0x5ed81b[_0x20fc('0x25')]=qs['offset'](_0x113aa8[_0x20fc('0x3b')][_0x20fc('0x25')]);}return _0x49dd3a['getConfigurations'](_0x5ed81b);}})[_0x20fc('0x2c')](function(_0x1bc572){if(_0x1bc572){return _0x1bc572?{'count':_0x1b5903,'rows':_0x1bc572}:null;}})[_0x20fc('0x2c')](respondWithResult(_0x17f6cf,null))[_0x20fc('0x4c')](handleError(_0x17f6cf,null));};exports[_0x20fc('0x55')]=function(_0x5708ae,_0x4c35bd,_0x1887e8){if(_0x5708ae[_0x20fc('0x51')]['id']){delete _0x5708ae[_0x20fc('0x51')]['id'];}return db[_0x20fc('0x47')][_0x20fc('0x53')]({'where':{'id':_0x5708ae[_0x20fc('0x4d')]['id']}})[_0x20fc('0x2c')](handleEntityNotFound(_0x4c35bd,null))[_0x20fc('0x2c')](function(_0x221ad8){if(_0x221ad8){_0x5708ae['body'][_0x20fc('0x56')]=_0x221ad8['id'];_0x5708ae[_0x20fc('0x51')][_0x20fc('0x57')]=integrations[_0x20fc('0x58')](_0x5708ae[_0x20fc('0x51')][_0x20fc('0x59')],_0x5708ae[_0x20fc('0x51')][_0x20fc('0x34')]);_0x5708ae['body'][_0x20fc('0x5a')]=integrations[_0x20fc('0x5b')](_0x5708ae[_0x20fc('0x51')][_0x20fc('0x59')],_0x5708ae[_0x20fc('0x51')][_0x20fc('0x34')]);return db[_0x20fc('0x54')][_0x20fc('0x50')](_0x5708ae[_0x20fc('0x51')],{'include':[{'model':db[_0x20fc('0x5c')],'as':_0x20fc('0x57')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4c35bd,null))['catch'](handleError(_0x4c35bd,null));};exports[_0x20fc('0x5d')]=function(_0x227d3e,_0x9ff6c3,_0x5dae8d){var _0x587fb0=_0x227d3e[_0x20fc('0x3b')][_0x20fc('0x5e')];var _0x5552d0=_0x587fb0==='incident'?_0x20fc('0x5f'):_0x20fc('0x60');var _0xd8c1de='';var _0x3dda9e='';var _0x504f0f='';var _0x565f34='';var _0x29f529='';var _0x337d76='';var _0x237ab2='';var _0x44893c='';var _0x2f252e=[_0x20fc('0x61'),_0x20fc('0x62'),_0x20fc('0x63'),'ownerid','caseorigincode',_0x20fc('0x64'),_0x20fc('0x65'),_0x20fc('0x66'),_0x20fc('0x67'),_0x20fc('0x68')];var _0x3f6bef=[_0x20fc('0x69'),_0x20fc('0x6a'),_0x20fc('0x6b'),_0x20fc('0x6c'),_0x20fc('0x6d'),_0x20fc('0x6e'),_0x20fc('0x6f'),'contractidname',_0x20fc('0x70'),_0x20fc('0x71'),_0x20fc('0x72'),_0x20fc('0x73'),_0x20fc('0x74'),_0x20fc('0x75'),_0x20fc('0x76'),_0x20fc('0x77'),'customeridtype','customeridyominame',_0x20fc('0x78'),'entitlementidname',_0x20fc('0x79'),_0x20fc('0x7a'),'escalatedon',_0x20fc('0x7b'),_0x20fc('0x7c'),_0x20fc('0x7d'),_0x20fc('0x7e'),_0x20fc('0x7f'),_0x20fc('0x80'),_0x20fc('0x81'),_0x20fc('0x82'),_0x20fc('0x83'),_0x20fc('0x84'),_0x20fc('0x85'),_0x20fc('0x86'),'modifiedon',_0x20fc('0x87'),_0x20fc('0x88'),_0x20fc('0x89'),'msdyn_iotalertname','numberofchildincidents',_0x20fc('0x8a'),_0x20fc('0x8b'),_0x20fc('0x8c'),_0x20fc('0x8d'),_0x20fc('0x8e'),_0x20fc('0x8f'),_0x20fc('0x90'),_0x20fc('0x91'),_0x20fc('0x92'),_0x20fc('0x93'),'productserialnumber',_0x20fc('0x94'),_0x20fc('0x95'),_0x20fc('0x96'),'responsiblecontactidname',_0x20fc('0x97'),_0x20fc('0x98'),_0x20fc('0x99'),_0x20fc('0x9a'),_0x20fc('0x9b'),'statecode',_0x20fc('0x9c'),_0x20fc('0x9d'),_0x20fc('0x9e'),_0x20fc('0x9f'),_0x20fc('0xa0'),_0x20fc('0xa1'),_0x20fc('0xa2'),_0x20fc('0xa3')];var _0x5d9d23=_0x2f252e[_0x20fc('0xa4')](_0x3f6bef);return db['Dynamics365Account'][_0x20fc('0x53')]({'where':{'id':_0x227d3e[_0x20fc('0x4d')]['id']},'attributes':['id','username','password','remoteUri',_0x20fc('0xa5'),_0x20fc('0xa6'),_0x20fc('0xa7')]})['then'](handleEntityNotFound(_0x9ff6c3,null))[_0x20fc('0x2c')](function(_0x22b5b9){if(_0x22b5b9){_0x44893c=_0x22b5b9['remoteUri'];var _0xcc3f0c=_0x44893c['slice'](-0x1);if(_0xcc3f0c==='/'){_0x44893c=_0x44893c['substring'](0x0,_0x44893c['lastIndexOf'](_0xcc3f0c));}_0x237ab2=util['format'](_0x20fc('0xa8'),_0x44893c);var _0x4e5936={'method':'POST','uri':_0x20fc('0xa9')+_0x22b5b9['tenantId']+'/oauth2/token','form':{'client_id':_0x22b5b9[_0x20fc('0xa6')],'resource':_0x44893c,'username':_0x22b5b9['username'],'password':_0x22b5b9[_0x20fc('0xaa')],'grant_type':_0x20fc('0xaa'),'client_secret':_0x22b5b9[_0x20fc('0xa7')]},'json':!![]};return rp(_0x4e5936);}})['then'](function(_0x5a8efa){_0x337d76=_0x5a8efa[_0x20fc('0xab')];var _0x3151d5={'method':_0x20fc('0xac'),'uri':encodeURI(_0x237ab2+_0x20fc('0xad')+_0x5552d0+'\x27'),'headers':{'Authorization':_0x20fc('0xae')+_0x337d76,'If-None-Match':null,'OData-Version':_0x20fc('0xaf')},'json':!![]};return rp(_0x3151d5);})[_0x20fc('0x2c')](function(_0x584e41){var _0x1e65fc=_0x584e41['value'][0x0];var _0x20d0f0=_0x1e65fc[_0x20fc('0xb0')];var _0x37c4b3={'method':_0x20fc('0xac'),'uri':_0x237ab2+'EntityDefinitions('+_0x20d0f0+_0x20fc('0xb1'),'headers':{'Authorization':_0x20fc('0xae')+_0x337d76,'If-None-Match':null,'OData-Version':_0x20fc('0xaf')},'json':!![]};return rp(_0x37c4b3);})[_0x20fc('0x2c')](function(_0x542076){_0xd8c1de=_0x542076;_0x3dda9e=_0xd8c1de[_0x20fc('0xb2')];_0x3dda9e=_[_0x20fc('0xb3')](_0x3dda9e,function(_0x38f303){return!_0x5d9d23[_0x20fc('0xb4')](_0x38f303[_0x20fc('0xb5')]);});var _0x1e8ddd=[];var _0x1affed=[];_0x3dda9e['forEach'](function(_0x10a444){if(_0x10a444[_0x20fc('0xb6')]){var _0x8c9294=_0x10a444['@odata.type'][_0x20fc('0xb7')](_0x10a444[_0x20fc('0xb6')][_0x20fc('0xb8')]('.')+0x1);if(_0x8c9294===_0x20fc('0xb9')){_0x1e8ddd[_0x20fc('0xba')](getSelectList(_0x237ab2,_0x587fb0,_0x1affed,_0xd8c1de[_0x20fc('0xb0')],_0x10a444[_0x20fc('0xb0')],_0x337d76));}}});return Promise['all'](_0x1e8ddd);})[_0x20fc('0x2c')](function(_0xbe1fe6){_0x504f0f=_0xbe1fe6[0x0];var _0x1f5aa6=[];var _0x57a7fb=[];_0x3dda9e['forEach'](function(_0x59f549){if(!_[_0x20fc('0xbb')](_0x59f549['@odata.type'])){var _0x3c6c9c=_0x59f549['@odata.type'][_0x20fc('0xb7')](_0x59f549[_0x20fc('0xb6')]['lastIndexOf']('.')+0x1);if(_0x3c6c9c==='BooleanAttributeMetadata'){_0x1f5aa6['push'](getBooleanList(_0x237ab2,_0x587fb0,_0x57a7fb,_0xd8c1de[_0x20fc('0xb0')],_0x59f549[_0x20fc('0xb0')],_0x337d76));}}});return Promise['all'](_0x1f5aa6);})[_0x20fc('0x2c')](function(_0x3cedd8){_0x565f34=_0x3cedd8[0x0];var _0x2fb7b6=[];var _0x452063=[];_0x3dda9e[_0x20fc('0xbc')](function(_0x3c6878){if(_0x3c6878['@odata.type']){var _0x117ef5=_0x3c6878['@odata.type'][_0x20fc('0xb7')](_0x3c6878[_0x20fc('0xb6')]['lastIndexOf']('.')+0x1);if(_0x117ef5===_0x20fc('0xbd')||_0x117ef5===_0x20fc('0xbe')||_0x117ef5==='BigIntAttributeMetadata'||_0x117ef5===_0x20fc('0xbf')||_0x117ef5===_0x20fc('0xc0')||_0x117ef5==='DateTimeAttributeMetadata'||_0x117ef5==='StatusAttributeMetadata'||_0x117ef5===_0x20fc('0xc1')||_0x117ef5==='StateAttributeMetadata'||_0x117ef5==='DecimalAttributeMetadata'){_0x2fb7b6[_0x20fc('0xba')](getInputList(_0x237ab2,_0x587fb0,_0x117ef5,_0x452063,_0xd8c1de[_0x20fc('0xb0')],_0x3c6878[_0x20fc('0xb0')],_0x337d76));}}});return Promise['all'](_0x2fb7b6);})['then'](function(_0x27935d){_0x29f529=_0x27935d[0x0];var _0xcc3a33=_0x504f0f[_0x20fc('0xa4')](_0x565f34)[_0x20fc('0xa4')](_0x29f529);var _0x5a29d9={'count':_0xcc3a33[_0x20fc('0x3e')],'rows':_0xcc3a33};return _0x5a29d9;})[_0x20fc('0x2c')](respondWithResult(_0x9ff6c3,null))[_0x20fc('0x4c')](function(_0x3437d0){var _0xdda714=_0x227d3e[_0x20fc('0x3b')]['test']?0x1f4:_0x3437d0['statusCode']||0x1f4;logger[_0x20fc('0x2e')](_0x3437d0['stack']);delete _0x3437d0[_0x20fc('0x38')];if(_0xdda714===0x191){_0xdda714=0x190;}_0x9ff6c3[_0x20fc('0x20')](_0xdda714)['send'](_0x227d3e[_0x20fc('0x3b')][_0x20fc('0xc2')]?{'message':'Wrong\x20credentials','statusCode':_0x3437d0['statusCode']}:_0x3437d0);});};function getSelectList(_0x57afe2,_0x4945b6,_0x37d05d,_0x220af6,_0x9ce511,_0x446762){var _0x19a0f1={'method':_0x20fc('0xac'),'uri':_0x57afe2+_0x20fc('0xc3')+_0x220af6+')/Attributes('+_0x9ce511+_0x20fc('0xc4')+_0x20fc('0xc5'),'headers':{'Authorization':_0x20fc('0xae')+_0x446762,'If-None-Match':null,'OData-Version':_0x20fc('0xaf')},'json':!![]};return rp(_0x19a0f1)[_0x20fc('0x2c')](function(_0x1a91af){var _0x2bcae7=[];var _0x320f48=_0x1a91af[_0x20fc('0xc6')][_0x20fc('0xc7')];_0x320f48[_0x20fc('0xbc')](function(_0x1342ac){_0x2bcae7[_0x20fc('0xba')]({'name':_0x1342ac[_0x20fc('0xc8')]['UserLocalizedLabel']['Label'],'value':String(_0x1342ac[_0x20fc('0xc9')])});});var _0xc9d7b={'id':_0x4945b6+'_'+_0x1a91af['LogicalName'],'name':_0x1a91af['DisplayName'][_0x20fc('0xca')][_0x20fc('0xc8')],'custom':![],'options':_0x2bcae7};_0x37d05d[_0x20fc('0xba')](_0xc9d7b);return _0x37d05d;});}function getBooleanList(_0x363db0,_0x12c96d,_0x38417,_0x33d6c4,_0x4772bd,_0x99a268){var _0x36be20={'method':_0x20fc('0xac'),'uri':_0x363db0+_0x20fc('0xc3')+_0x33d6c4+_0x20fc('0xcb')+_0x4772bd+_0x20fc('0xcc'),'headers':{'Authorization':_0x20fc('0xae')+_0x99a268,'If-None-Match':null,'OData-Version':_0x20fc('0xaf')},'json':!![]};return rp(_0x36be20)[_0x20fc('0x2c')](function(_0x27dfc8){var _0x18f687=[];_0x18f687[_0x20fc('0xba')]({'name':_0x27dfc8['OptionSet'][_0x20fc('0xcd')]['Label'][_0x20fc('0xca')][_0x20fc('0xc8')],'value':_0x20fc('0xce')},{'name':_0x27dfc8[_0x20fc('0xc6')]['FalseOption'][_0x20fc('0xc8')][_0x20fc('0xca')][_0x20fc('0xc8')],'value':_0x20fc('0xcf')});var _0x2e3c99={'id':_0x12c96d+'_'+_0x27dfc8[_0x20fc('0xb5')],'name':_0x27dfc8[_0x20fc('0xd0')][_0x20fc('0xca')][_0x20fc('0xc8')],'custom':![],'options':_0x18f687};_0x38417[_0x20fc('0xba')](_0x2e3c99);return _0x38417;});}function getInputList(_0x1626a4,_0x160971,_0x3fa38b,_0x43f9db,_0x3c0001,_0x33c6d6,_0xf3ff89){var _0x17cb2a={'method':_0x20fc('0xac'),'uri':_0x1626a4+_0x20fc('0xc3')+_0x3c0001+_0x20fc('0xcb')+_0x33c6d6+_0x20fc('0xd1')+_0x3fa38b+_0x20fc('0xd2'),'headers':{'Authorization':'Bearer\x20'+_0xf3ff89,'If-None-Match':null,'OData-Version':_0x20fc('0xaf')},'json':!![]};return rp(_0x17cb2a)[_0x20fc('0x2c')](function(_0xe07c9d){var _0x582d97={'id':_0x160971+'_'+_0xe07c9d[_0x20fc('0xb5')],'name':_0xe07c9d[_0x20fc('0xd0')]['UserLocalizedLabel']?_0xe07c9d['DisplayName'][_0x20fc('0xca')]['Label']:_0xe07c9d['LogicalName'],'custom':![],'options':[]};_0x43f9db['push'](_0x582d97);return _0x43f9db;});} \ No newline at end of file +var _0x581a=['contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','StringAttributeMetadata','DoubleAttributeMetadata','StatusAttributeMetadata','error','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','Dynamics365Account','include','rows','params','includeAll','find','catch','create','body','update','getConfigurations','Dynamics365Configuration','options','nolimit','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','getFields','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x581a,0x127));var _0xa581=function(_0x5cc1c8,_0xe5fa61){_0x5cc1c8=_0x5cc1c8-0x0;var _0xc2647b=_0x581a[_0x5cc1c8];return _0xc2647b;};'use strict';var emlformat=require(_0xa581('0x0'));var rimraf=require(_0xa581('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa581('0x2'));var rp=require(_0xa581('0x3'));var moment=require(_0xa581('0x4'));var BPromise=require(_0xa581('0x5'));var Mustache=require(_0xa581('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa581('0x7'));var csv=require('to-csv');var ejs=require(_0xa581('0x8'));var fs=require('fs');var fs_extra=require(_0xa581('0x9'));var _=require(_0xa581('0xa'));var squel=require(_0xa581('0xb'));var crypto=require(_0xa581('0xc'));var jsforce=require(_0xa581('0xd'));var deskjs=require(_0xa581('0xe'));var toCsv=require(_0xa581('0xf'));var querystring=require(_0xa581('0x10'));var Papa=require(_0xa581('0x11'));var Redis=require(_0xa581('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa581('0x13'));var as=require(_0xa581('0x14'));var hardwareService=require(_0xa581('0x15'));var logger=require(_0xa581('0x16'))(_0xa581('0x17'));var utils=require(_0xa581('0x18'));var config=require(_0xa581('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa581('0x1a'))['db'];var integrations=require(_0xa581('0x1b'));function respondWithStatusCode(_0x2068f6,_0x21f0e2){_0x21f0e2=_0x21f0e2||0xcc;return function(_0x202296){if(_0x202296){return _0x2068f6['sendStatus'](_0x21f0e2);}return _0x2068f6[_0xa581('0x1c')](_0x21f0e2)[_0xa581('0x1d')]();};}function respondWithResult(_0x23b205,_0x3ba90d){_0x3ba90d=_0x3ba90d||0xc8;return function(_0x499c08){if(_0x499c08){return _0x23b205['status'](_0x3ba90d)[_0xa581('0x1e')](_0x499c08);}};}function respondWithFilteredResult(_0x27bf02,_0xf12782){return function(_0x35669d){if(_0x35669d){var _0xf6f762=typeof _0xf12782['offset']===_0xa581('0x1f')&&typeof _0xf12782[_0xa581('0x20')]===_0xa581('0x1f');var _0x100ebe=_0x35669d[_0xa581('0x21')];var _0x1484b1=_0xf6f762?0x0:_0xf12782['offset'];var _0x48a44b=_0xf6f762?_0x35669d[_0xa581('0x21')]:_0xf12782[_0xa581('0x22')]+_0xf12782[_0xa581('0x20')];var _0x5dad6c;if(_0x48a44b>=_0x100ebe){_0x48a44b=_0x100ebe;_0x5dad6c=0xc8;}else{_0x5dad6c=0xce;}_0x27bf02[_0xa581('0x1c')](_0x5dad6c);return _0x27bf02[_0xa581('0x23')](_0xa581('0x24'),_0x1484b1+'-'+_0x48a44b+'/'+_0x100ebe)[_0xa581('0x1e')](_0x35669d);}return null;};}function patchUpdates(_0x3dcc72){return function(_0x25d205){try{jsonpatch[_0xa581('0x25')](_0x25d205,_0x3dcc72,!![]);}catch(_0x1b0a88){return BPromise[_0xa581('0x26')](_0x1b0a88);}return _0x25d205[_0xa581('0x27')]();};}function saveUpdates(_0xa746ab,_0x4706d0){return function(_0x231ce2){if(_0x231ce2){return _0x231ce2['update'](_0xa746ab)[_0xa581('0x28')](function(_0x44fa06){return _0x44fa06;});}return null;};}function removeEntity(_0x32bdaa,_0x1f05b1){return function(_0x460d1e){if(_0x460d1e){return _0x460d1e[_0xa581('0x29')]()[_0xa581('0x28')](function(){_0x32bdaa[_0xa581('0x1c')](0xcc)[_0xa581('0x1d')]();});}};}function handleEntityNotFound(_0x5c15fe,_0x24c8cc){return function(_0x127a4b){if(!_0x127a4b){_0x5c15fe[_0xa581('0x2a')](0x194);}return _0x127a4b;};}function handleError(_0x31e377,_0x36ba28){_0x36ba28=_0x36ba28||0x1f4;return function(_0x1f52ec){logger['error'](_0x1f52ec[_0xa581('0x2b')]);if(_0x1f52ec[_0xa581('0x2c')]){delete _0x1f52ec[_0xa581('0x2c')];}_0x31e377['status'](_0x36ba28)[_0xa581('0x2d')](_0x1f52ec);};}exports[_0xa581('0x2e')]=function(_0xf8c669,_0x213eb5){var _0x40352f={},_0x595bf1={},_0x46243b={'count':0x0,'rows':[]};var _0x590a36=_[_0xa581('0x2f')](db['Dynamics365Account'][_0xa581('0x30')],function(_0x292aaf){return{'name':_0x292aaf[_0xa581('0x31')],'type':_0x292aaf[_0xa581('0x32')]['key']};});_0x595bf1[_0xa581('0x33')]=_[_0xa581('0x2f')](_0x590a36,_0xa581('0x2c'));_0x595bf1['query']=_[_0xa581('0x34')](_0xf8c669[_0xa581('0x35')]);_0x595bf1[_0xa581('0x36')]=_[_0xa581('0x37')](_0x595bf1[_0xa581('0x33')],_0x595bf1['query']);_0x40352f[_0xa581('0x38')]=_[_0xa581('0x37')](_0x595bf1[_0xa581('0x33')],qs[_0xa581('0x39')](_0xf8c669[_0xa581('0x35')][_0xa581('0x39')]));_0x40352f[_0xa581('0x38')]=_0x40352f[_0xa581('0x38')][_0xa581('0x3a')]?_0x40352f['attributes']:_0x595bf1[_0xa581('0x33')];if(!_0xf8c669[_0xa581('0x35')][_0xa581('0x3b')]('nolimit')){_0x40352f['limit']=qs[_0xa581('0x20')](_0xf8c669[_0xa581('0x35')]['limit']);_0x40352f['offset']=qs[_0xa581('0x22')](_0xf8c669[_0xa581('0x35')]['offset']);}_0x40352f[_0xa581('0x3c')]=qs[_0xa581('0x3d')](_0xf8c669[_0xa581('0x35')]['sort']);_0x40352f['where']=qs[_0xa581('0x36')](_[_0xa581('0x3e')](_0xf8c669[_0xa581('0x35')],_0x595bf1[_0xa581('0x36')]),_0x590a36);if(_0xf8c669[_0xa581('0x35')][_0xa581('0x3f')]){_0x40352f[_0xa581('0x40')]=_[_0xa581('0x41')](_0x40352f[_0xa581('0x40')],{'$or':_[_0xa581('0x2f')](_0x590a36,function(_0x124f71){if(_0x124f71[_0xa581('0x32')]!=='VIRTUAL'){var _0x93c996={};_0x93c996[_0x124f71[_0xa581('0x2c')]]={'$like':'%'+_0xf8c669[_0xa581('0x35')][_0xa581('0x3f')]+'%'};return _0x93c996;}})});}_0x40352f=_[_0xa581('0x41')]({},_0x40352f,_0xf8c669['options']);var _0x5a1f40={'where':_0x40352f[_0xa581('0x40')]};return db[_0xa581('0x42')][_0xa581('0x21')](_0x5a1f40)[_0xa581('0x28')](function(_0x350aca){_0x46243b['count']=_0x350aca;if(_0xf8c669[_0xa581('0x35')]['includeAll']){_0x40352f[_0xa581('0x43')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x40352f);})[_0xa581('0x28')](function(_0x162ecb){_0x46243b[_0xa581('0x44')]=_0x162ecb;return _0x46243b;})[_0xa581('0x28')](respondWithFilteredResult(_0x213eb5,_0x40352f))['catch'](handleError(_0x213eb5,null));};exports['show']=function(_0x538248,_0x14d6d8){var _0x3cefe4={'raw':![],'where':{'id':_0x538248[_0xa581('0x45')]['id']}},_0x581329={};_0x581329[_0xa581('0x33')]=_[_0xa581('0x34')](db[_0xa581('0x42')]['rawAttributes']);_0x581329[_0xa581('0x35')]=_[_0xa581('0x34')](_0x538248[_0xa581('0x35')]);_0x581329[_0xa581('0x36')]=_[_0xa581('0x37')](_0x581329['model'],_0x581329[_0xa581('0x35')]);_0x3cefe4[_0xa581('0x38')]=_[_0xa581('0x37')](_0x581329[_0xa581('0x33')],qs['fields'](_0x538248['query'][_0xa581('0x39')]));_0x3cefe4['attributes']=_0x3cefe4[_0xa581('0x38')]['length']?_0x3cefe4['attributes']:_0x581329[_0xa581('0x33')];if(_0x538248[_0xa581('0x35')][_0xa581('0x46')]){_0x3cefe4[_0xa581('0x43')]=[{'all':!![]}];}_0x3cefe4=_['merge']({},_0x3cefe4,_0x538248['options']);return db[_0xa581('0x42')][_0xa581('0x47')](_0x3cefe4)[_0xa581('0x28')](handleEntityNotFound(_0x14d6d8,null))[_0xa581('0x28')](respondWithResult(_0x14d6d8,null))[_0xa581('0x48')](handleError(_0x14d6d8,null));};exports[_0xa581('0x49')]=function(_0x101d52,_0xfe0629){return db['Dynamics365Account'][_0xa581('0x49')](_0x101d52[_0xa581('0x4a')],{})['then'](respondWithResult(_0xfe0629,0xc9))[_0xa581('0x48')](handleError(_0xfe0629,null));};exports[_0xa581('0x4b')]=function(_0x4940b7,_0x3c5276){if(_0x4940b7[_0xa581('0x4a')]['id']){delete _0x4940b7['body']['id'];}return db[_0xa581('0x42')]['find']({'where':{'id':_0x4940b7[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x3c5276,null))[_0xa581('0x28')](saveUpdates(_0x4940b7[_0xa581('0x4a')],null))[_0xa581('0x28')](respondWithResult(_0x3c5276,null))[_0xa581('0x48')](handleError(_0x3c5276,null));};exports[_0xa581('0x29')]=function(_0x4dac09,_0x291cee){return db[_0xa581('0x42')]['find']({'where':{'id':_0x4dac09[_0xa581('0x45')]['id']}})['then'](handleEntityNotFound(_0x291cee,null))[_0xa581('0x28')](removeEntity(_0x291cee,null))[_0xa581('0x48')](handleError(_0x291cee,null));};exports[_0xa581('0x4c')]=function(_0x108cf4,_0x1d8379,_0x8c78f4){var _0x238b33={};var _0x5ab30a={};var _0x406751;var _0x4453a6;return db[_0xa581('0x42')]['findOne']({'where':{'id':_0x108cf4[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x1d8379,null))[_0xa581('0x28')](function(_0x35c2a5){if(_0x35c2a5){_0x406751=_0x35c2a5;_0x5ab30a[_0xa581('0x33')]=_[_0xa581('0x34')](db[_0xa581('0x4d')]['rawAttributes']);_0x5ab30a[_0xa581('0x35')]=_[_0xa581('0x34')](_0x108cf4[_0xa581('0x35')]);_0x5ab30a[_0xa581('0x36')]=_[_0xa581('0x37')](_0x5ab30a[_0xa581('0x33')],_0x5ab30a[_0xa581('0x35')]);_0x238b33[_0xa581('0x38')]=_[_0xa581('0x37')](_0x5ab30a[_0xa581('0x33')],qs[_0xa581('0x39')](_0x108cf4['query'][_0xa581('0x39')]));_0x238b33[_0xa581('0x38')]=_0x238b33[_0xa581('0x38')][_0xa581('0x3a')]?_0x238b33['attributes']:_0x5ab30a[_0xa581('0x33')];_0x238b33['order']=qs[_0xa581('0x3d')](_0x108cf4[_0xa581('0x35')][_0xa581('0x3d')]);_0x238b33[_0xa581('0x40')]=qs[_0xa581('0x36')](_[_0xa581('0x3e')](_0x108cf4[_0xa581('0x35')],_0x5ab30a[_0xa581('0x36')]));if(_0x108cf4[_0xa581('0x35')]['filter']){_0x238b33[_0xa581('0x40')]=_[_0xa581('0x41')](_0x238b33[_0xa581('0x40')],{'$or':_[_0xa581('0x2f')](_0x238b33[_0xa581('0x38')],function(_0x462150){var _0x24477c={};_0x24477c[_0x462150]={'$like':'%'+_0x108cf4['query'][_0xa581('0x3f')]+'%'};return _0x24477c;})});}_0x238b33=_['merge']({},_0x238b33,_0x108cf4[_0xa581('0x4e')]);return _0x406751[_0xa581('0x4c')](_0x238b33);}})[_0xa581('0x28')](function(_0x3b07ba){if(_0x3b07ba){_0x4453a6=_0x3b07ba[_0xa581('0x3a')];if(!_0x108cf4[_0xa581('0x35')][_0xa581('0x3b')](_0xa581('0x4f'))){_0x238b33[_0xa581('0x20')]=qs[_0xa581('0x20')](_0x108cf4[_0xa581('0x35')][_0xa581('0x20')]);_0x238b33[_0xa581('0x22')]=qs['offset'](_0x108cf4[_0xa581('0x35')][_0xa581('0x22')]);}return _0x406751[_0xa581('0x4c')](_0x238b33);}})['then'](function(_0x11549b){if(_0x11549b){return _0x11549b?{'count':_0x4453a6,'rows':_0x11549b}:null;}})[_0xa581('0x28')](respondWithResult(_0x1d8379,null))['catch'](handleError(_0x1d8379,null));};exports[_0xa581('0x50')]=function(_0x346fa3,_0x1ce62a,_0x1e33ca){if(_0x346fa3[_0xa581('0x4a')]['id']){delete _0x346fa3[_0xa581('0x4a')]['id'];}return db[_0xa581('0x42')][_0xa581('0x51')]({'where':{'id':_0x346fa3[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x1ce62a,null))[_0xa581('0x28')](function(_0x5a3b50){if(_0x5a3b50){_0x346fa3[_0xa581('0x4a')][_0xa581('0x52')]=_0x5a3b50['id'];_0x346fa3['body']['Subjects']=integrations[_0xa581('0x53')](_0x346fa3[_0xa581('0x4a')]['channel'],_0x346fa3['body'][_0xa581('0x32')]);_0x346fa3[_0xa581('0x4a')][_0xa581('0x54')]=integrations[_0xa581('0x55')](_0x346fa3[_0xa581('0x4a')][_0xa581('0x56')],_0x346fa3[_0xa581('0x4a')][_0xa581('0x32')]);return db[_0xa581('0x4d')][_0xa581('0x49')](_0x346fa3[_0xa581('0x4a')],{'include':[{'model':db[_0xa581('0x57')],'as':_0xa581('0x58')},{'model':db[_0xa581('0x57')],'as':_0xa581('0x54')}]});}return null;})[_0xa581('0x28')](respondWithResult(_0x1ce62a,null))['catch'](handleError(_0x1ce62a,null));};exports[_0xa581('0x59')]=function(_0x32b4f2,_0x140fd3,_0x28754a){var _0x30c7df=_0x32b4f2[_0xa581('0x35')]['ticketType'];var _0x5d0fd2=_0x30c7df===_0xa581('0x5a')?_0xa581('0x5b'):'PhoneCall';var _0x1a4932='';var _0x503700='';var _0x99b897='';var _0x25aa6e='';var _0x2e256e='';var _0x33cc02='';var _0x7516e='';var _0x3482c7='';var _0x1943b6=[_0xa581('0x5c'),_0xa581('0x5d'),_0xa581('0x5e'),_0xa581('0x5f'),_0xa581('0x60'),_0xa581('0x61'),_0xa581('0x62'),_0xa581('0x63'),_0xa581('0x64'),'phonecall_activity_parties'];var _0x1fa56=[_0xa581('0x65'),'accountidyominame',_0xa581('0x66'),_0xa581('0x67'),_0xa581('0x68'),_0xa581('0x69'),_0xa581('0x6a'),_0xa581('0x6b'),_0xa581('0x6c'),'createdbyexternalpartyyominame',_0xa581('0x6d'),'createdbyyominame',_0xa581('0x6e'),_0xa581('0x6f'),_0xa581('0x70'),_0xa581('0x71'),_0xa581('0x72'),'customeridyominame',_0xa581('0x73'),'entitlementidname',_0xa581('0x74'),_0xa581('0x75'),_0xa581('0x76'),_0xa581('0x77'),'firstresponsebykpiidname','followupby','importsequencenumber',_0xa581('0x78'),_0xa581('0x79'),_0xa581('0x7a'),'masteridname','modifiedbyexternalpartyname',_0xa581('0x7b'),_0xa581('0x7c'),_0xa581('0x7d'),_0xa581('0x7e'),_0xa581('0x7f'),'modifiedonbehalfbyyominame',_0xa581('0x80'),'msdyn_iotalertname',_0xa581('0x81'),_0xa581('0x82'),_0xa581('0x83'),_0xa581('0x84'),_0xa581('0x85'),_0xa581('0x86'),'parentcaseidname','primarycontactidname','primarycontactidyominame',_0xa581('0x87'),_0xa581('0x88'),_0xa581('0x89'),_0xa581('0x8a'),_0xa581('0x8b'),'responseby','responsiblecontactidname',_0xa581('0x8c'),'sentimentvalue',_0xa581('0x8d'),_0xa581('0x8e'),'socialprofileidname',_0xa581('0x8f'),'statuscode',_0xa581('0x90'),_0xa581('0x91'),'timezoneruleversionnumber',_0xa581('0x92'),_0xa581('0x93'),_0xa581('0x94'),'versionnumber'];var _0x227257=_0x1943b6[_0xa581('0x95')](_0x1fa56);return db[_0xa581('0x42')][_0xa581('0x51')]({'where':{'id':_0x32b4f2['params']['id']},'attributes':['id',_0xa581('0x96'),'password',_0xa581('0x97'),'tenantId',_0xa581('0x98'),_0xa581('0x99')]})[_0xa581('0x28')](handleEntityNotFound(_0x140fd3,null))[_0xa581('0x28')](function(_0x58a1f5){if(_0x58a1f5){_0x3482c7=_0x58a1f5[_0xa581('0x97')];var _0x363bea=_0x3482c7[_0xa581('0x9a')](-0x1);if(_0x363bea==='/'){_0x3482c7=_0x3482c7[_0xa581('0x9b')](0x0,_0x3482c7['lastIndexOf'](_0x363bea));}_0x7516e=util[_0xa581('0x9c')](_0xa581('0x9d'),_0x3482c7);var _0x4dc548={'method':'POST','uri':_0xa581('0x9e')+_0x58a1f5['tenantId']+_0xa581('0x9f'),'form':{'client_id':_0x58a1f5[_0xa581('0x98')],'resource':_0x3482c7,'username':_0x58a1f5[_0xa581('0x96')],'password':_0x58a1f5[_0xa581('0xa0')],'grant_type':'password','client_secret':_0x58a1f5[_0xa581('0x99')]},'json':!![]};return rp(_0x4dc548);}})[_0xa581('0x28')](function(_0xfa770a){_0x33cc02=_0xfa770a[_0xa581('0xa1')];var _0x3f39f2={'method':_0xa581('0xa2'),'uri':encodeURI(_0x7516e+_0xa581('0xa3')+_0x5d0fd2+'\x27'),'headers':{'Authorization':_0xa581('0xa4')+_0x33cc02,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x3f39f2);})['then'](function(_0x14ea12){var _0x56279d=_0x14ea12[_0xa581('0xa6')][0x0];var _0x12e8ea=_0x56279d['MetadataId'];var _0xfbf56={'method':_0xa581('0xa2'),'uri':_0x7516e+_0xa581('0xa7')+_0x12e8ea+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xa581('0xa4')+_0x33cc02,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0xfbf56);})['then'](function(_0x1f0e6d){_0x1a4932=_0x1f0e6d;_0x503700=_0x1a4932[_0xa581('0xa8')];_0x503700=_[_0xa581('0xa9')](_0x503700,function(_0x730fa4){return!_0x227257[_0xa581('0xaa')](_0x730fa4[_0xa581('0xab')]);});var _0x3853e7=[];var _0x359050=[];_0x503700[_0xa581('0xac')](function(_0x1d0e5a){if(_0x1d0e5a[_0xa581('0xad')]){var _0x13d1f4=_0x1d0e5a[_0xa581('0xad')][_0xa581('0x9b')](_0x1d0e5a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x13d1f4===_0xa581('0xae')){_0x3853e7[_0xa581('0xaf')](getSelectList(_0x7516e,_0x30c7df,_0x359050,_0x1a4932[_0xa581('0xb0')],_0x1d0e5a[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0x3853e7);})['then'](function(_0x584703){_0x99b897=_0x584703[0x0];var _0xbaf3d3=[];var _0x15f4ec=[];_0x503700[_0xa581('0xac')](function(_0x160beb){if(!_['isNil'](_0x160beb[_0xa581('0xad')])){var _0x10221e=_0x160beb[_0xa581('0xad')][_0xa581('0x9b')](_0x160beb[_0xa581('0xad')]['lastIndexOf']('.')+0x1);if(_0x10221e==='BooleanAttributeMetadata'){_0xbaf3d3[_0xa581('0xaf')](getBooleanList(_0x7516e,_0x30c7df,_0x15f4ec,_0x1a4932['MetadataId'],_0x160beb[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0xbaf3d3);})[_0xa581('0x28')](function(_0x231ebc){_0x25aa6e=_0x231ebc[0x0];var _0x291c64=[];var _0x2aa41b=[];_0x503700[_0xa581('0xac')](function(_0x5774a3){if(_0x5774a3[_0xa581('0xad')]){var _0x31bdf3=_0x5774a3[_0xa581('0xad')][_0xa581('0x9b')](_0x5774a3[_0xa581('0xad')]['lastIndexOf']('.')+0x1);if(_0x31bdf3===_0xa581('0xb2')||_0x31bdf3===_0xa581('0xb3')||_0x31bdf3==='BigIntAttributeMetadata'||_0x31bdf3==='IntegerAttributeMetadata'||_0x31bdf3==='MemoAttributeMetadata'||_0x31bdf3==='DateTimeAttributeMetadata'||_0x31bdf3===_0xa581('0xb4')||_0x31bdf3==='EntityNameAttributeMetadata'||_0x31bdf3==='StateAttributeMetadata'||_0x31bdf3==='DecimalAttributeMetadata'){_0x291c64['push'](getInputList(_0x7516e,_0x30c7df,_0x31bdf3,_0x2aa41b,_0x1a4932[_0xa581('0xb0')],_0x5774a3[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0x291c64);})[_0xa581('0x28')](function(_0x502a87){_0x2e256e=_0x502a87[0x0];var _0x5ff649=_0x99b897[_0xa581('0x95')](_0x25aa6e)[_0xa581('0x95')](_0x2e256e);var _0x3b40df={'count':_0x5ff649[_0xa581('0x3a')],'rows':_0x5ff649};return _0x3b40df;})[_0xa581('0x28')](respondWithResult(_0x140fd3,null))['catch'](function(_0x463525){var _0x3e82ae=_0x32b4f2[_0xa581('0x35')]['test']?0x1f4:_0x463525['statusCode']||0x1f4;logger[_0xa581('0xb5')](_0x463525[_0xa581('0x2b')]);delete _0x463525[_0xa581('0x2c')];if(_0x3e82ae===0x191){_0x3e82ae=0x190;}_0x140fd3[_0xa581('0x1c')](_0x3e82ae)[_0xa581('0x2d')](_0x32b4f2[_0xa581('0x35')][_0xa581('0xb6')]?{'message':_0xa581('0xb7'),'statusCode':_0x463525[_0xa581('0xb8')]}:_0x463525);});};function getSelectList(_0x5c7c73,_0x1f2622,_0x35633d,_0x32a79c,_0x5ef894,_0x563988){var _0x12f0f4={'method':_0xa581('0xa2'),'uri':_0x5c7c73+_0xa581('0xa7')+_0x32a79c+_0xa581('0xb9')+_0x5ef894+_0xa581('0xba')+_0xa581('0xbb'),'headers':{'Authorization':_0xa581('0xa4')+_0x563988,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x12f0f4)[_0xa581('0x28')](function(_0x5d240a){var _0x16a209=[];var _0x14d56e=_0x5d240a[_0xa581('0xbc')][_0xa581('0xbd')];_0x14d56e[_0xa581('0xac')](function(_0x334dcf){_0x16a209[_0xa581('0xaf')]({'name':_0x334dcf[_0xa581('0xbe')]['UserLocalizedLabel'][_0xa581('0xbe')],'value':String(_0x334dcf[_0xa581('0xbf')])});});var _0x1c57c9={'id':_0x1f2622+'_'+_0x5d240a['LogicalName'],'name':_0x5d240a[_0xa581('0xc0')][_0xa581('0xc1')]['Label'],'custom':![],'options':_0x16a209};_0x35633d['push'](_0x1c57c9);return _0x35633d;});}function getBooleanList(_0x440294,_0x4aeb1c,_0xaa89bb,_0x54af00,_0x4fb817,_0x5f54ed){var _0x5d3e42={'method':_0xa581('0xa2'),'uri':_0x440294+_0xa581('0xa7')+_0x54af00+')/Attributes('+_0x4fb817+_0xa581('0xc2'),'headers':{'Authorization':_0xa581('0xa4')+_0x5f54ed,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x5d3e42)[_0xa581('0x28')](function(_0x436c69){var _0xf21f8b=[];_0xf21f8b[_0xa581('0xaf')]({'name':_0x436c69[_0xa581('0xbc')][_0xa581('0xc3')]['Label'][_0xa581('0xc1')]['Label'],'value':_0xa581('0xc4')},{'name':_0x436c69[_0xa581('0xbc')][_0xa581('0xc5')][_0xa581('0xbe')][_0xa581('0xc1')][_0xa581('0xbe')],'value':_0xa581('0xc6')});var _0x3ffb75={'id':_0x4aeb1c+'_'+_0x436c69[_0xa581('0xab')],'name':_0x436c69['DisplayName'][_0xa581('0xc1')][_0xa581('0xbe')],'custom':![],'options':_0xf21f8b};_0xaa89bb[_0xa581('0xaf')](_0x3ffb75);return _0xaa89bb;});}function getInputList(_0x11d745,_0x309ce5,_0x2a2ba2,_0x4abaf7,_0x1467ca,_0x492bc5,_0x3726e4){var _0xe87749={'method':_0xa581('0xa2'),'uri':_0x11d745+_0xa581('0xa7')+_0x1467ca+_0xa581('0xb9')+_0x492bc5+_0xa581('0xc7')+_0x2a2ba2+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa581('0xa4')+_0x3726e4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe87749)[_0xa581('0x28')](function(_0x11c8c8){var _0x51c565={'id':_0x309ce5+'_'+_0x11c8c8[_0xa581('0xab')],'name':_0x11c8c8[_0xa581('0xc0')][_0xa581('0xc1')]?_0x11c8c8[_0xa581('0xc0')][_0xa581('0xc1')]['Label']:_0x11c8c8[_0xa581('0xab')],'custom':![],'options':[]};_0x4abaf7[_0xa581('0xaf')](_0x51c565);return _0x4abaf7;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7939f44..9864a51 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1921b1,_0x343ed3){var _0x5b3be4=function(_0x7007fb){while(--_0x7007fb){_0x1921b1['push'](_0x1921b1['shift']());}};_0x5b3be4(++_0x343ed3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3aa206,_0x245a91){var _0x37aea0=function(_0x2813f5){while(--_0x2813f5){_0x3aa206['push'](_0x3aa206['shift']());}};_0x37aea0(++_0x245a91);}(_0x757a,0xde));var _0xa757=function(_0x8370e0,_0x459128){_0x8370e0=_0x8370e0-0x0;var _0x1e6a36=_0x757a[_0x8370e0];return _0x1e6a36;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('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 2c1b8a0..2e1dea1 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 _0xaff9=['jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','limit','include','attributes','map','model','ShowDynamics365Account','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x209ac6,_0x3ea65f){var _0x335264=function(_0x250bab){while(--_0x250bab){_0x209ac6['push'](_0x209ac6['shift']());}};_0x335264(++_0x3ea65f);}(_0xaff9,0x13b));var _0x9aff=function(_0x845ab6,_0x78f9a5){_0x845ab6=_0x845ab6-0x0;var _0xdff4e0=_0xaff9[_0x845ab6];return _0xdff4e0;};'use strict';var _=require('lodash');var util=require(_0x9aff('0x0'));var moment=require(_0x9aff('0x1'));var BPromise=require(_0x9aff('0x2'));var rs=require(_0x9aff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9aff('0x4'))['db'];var utils=require(_0x9aff('0x5'));var logger=require(_0x9aff('0x6'))(_0x9aff('0x7'));var config=require(_0x9aff('0x8'));var jayson=require(_0x9aff('0x9'));var client=jayson[_0x9aff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49b58b,_0x1593b1,_0x328a4e){return new BPromise(function(_0x1cfafa,_0x3cb891){return client[_0x9aff('0xb')](_0x49b58b,_0x328a4e)[_0x9aff('0xc')](function(_0x1b8fb7){logger['info'](_0x9aff('0xd'),_0x1593b1,_0x9aff('0xe'));logger[_0x9aff('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1593b1,_0x9aff('0xe'),JSON[_0x9aff('0x10')](_0x1b8fb7));if(_0x1b8fb7[_0x9aff('0x11')]){if(_0x1b8fb7[_0x9aff('0x11')][_0x9aff('0x12')]===0x1f4){logger[_0x9aff('0x11')](_0x9aff('0xd'),_0x1593b1,_0x1b8fb7['error'][_0x9aff('0x13')]);return _0x3cb891(_0x1b8fb7[_0x9aff('0x11')][_0x9aff('0x13')]);}logger[_0x9aff('0x11')](_0x9aff('0xd'),_0x1593b1,_0x1b8fb7[_0x9aff('0x11')][_0x9aff('0x13')]);return _0x1cfafa(_0x1b8fb7['error'][_0x9aff('0x13')]);}else{logger[_0x9aff('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x1593b1,_0x9aff('0xe'));_0x1cfafa(_0x1b8fb7[_0x9aff('0x15')]['message']);}})[_0x9aff('0x16')](function(_0x3149f5){logger['error'](_0x9aff('0xd'),_0x1593b1,_0x3149f5);_0x3cb891(_0x3149f5);});});}exports[_0x9aff('0x17')]=function(_0x508f33){var _0x4cdfc1=this;return new Promise(function(_0x52cdc6,_0x2ff6f3){return db[_0x9aff('0x18')][_0x9aff('0x19')]({'raw':_0x508f33[_0x9aff('0x1a')]?_0x508f33['options'][_0x9aff('0x1b')]===undefined?!![]:![]:!![],'where':_0x508f33[_0x9aff('0x1a')]?_0x508f33[_0x9aff('0x1a')]['where']||null:null,'attributes':_0x508f33['options']?_0x508f33[_0x9aff('0x1a')]['attributes']||null:null,'limit':_0x508f33[_0x9aff('0x1a')]?_0x508f33[_0x9aff('0x1a')][_0x9aff('0x1c')]||null:null,'include':_0x508f33['options']?_0x508f33['options'][_0x9aff('0x1d')]?_['map'](_0x508f33['options']['include'],function(_0x51db0f){return{'model':db[_0x51db0f['model']],'as':_0x51db0f['as'],'attributes':_0x51db0f[_0x9aff('0x1e')],'include':_0x51db0f['include']?_[_0x9aff('0x1f')](_0x51db0f['include'],function(_0x4be5fa){return{'model':db[_0x4be5fa[_0x9aff('0x20')]],'as':_0x4be5fa['as'],'attributes':_0x4be5fa[_0x9aff('0x1e')],'include':_0x4be5fa['include']?_[_0x9aff('0x1f')](_0x4be5fa[_0x9aff('0x1d')],function(_0x52777b){return{'model':db[_0x52777b['model']],'as':_0x52777b['as'],'attributes':_0x52777b[_0x9aff('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bce08){logger[_0x9aff('0x14')](_0x9aff('0x17'),_0x508f33);logger[_0x9aff('0xf')]('GetDynamics365Account',_0x508f33,JSON[_0x9aff('0x10')](_0x1bce08));_0x52cdc6(_0x1bce08);})[_0x9aff('0x16')](function(_0x4199b9){logger['error'](_0x9aff('0x17'),_0x4199b9[_0x9aff('0x13')],_0x508f33);_0x2ff6f3(_0x4cdfc1[_0x9aff('0x11')](0x1f4,_0x4199b9[_0x9aff('0x13')]));});});};exports[_0x9aff('0x21')]=function(_0x23fc00){var _0x3bf951=this;return new Promise(function(_0x257132,_0x2416ca){return db[_0x9aff('0x18')][_0x9aff('0x22')]({'raw':_0x23fc00[_0x9aff('0x1a')]?_0x23fc00[_0x9aff('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x23fc00[_0x9aff('0x1a')]?_0x23fc00['options'][_0x9aff('0x23')]||null:null,'attributes':_0x23fc00[_0x9aff('0x1a')]?_0x23fc00['options']['attributes']||null:null,'include':_0x23fc00['options']?_0x23fc00[_0x9aff('0x1a')]['include']?_[_0x9aff('0x1f')](_0x23fc00[_0x9aff('0x1a')]['include'],function(_0x36025f){return{'model':db[_0x36025f[_0x9aff('0x20')]],'as':_0x36025f['as'],'attributes':_0x36025f[_0x9aff('0x1e')],'include':_0x36025f['include']?_[_0x9aff('0x1f')](_0x36025f[_0x9aff('0x1d')],function(_0x4ff628){return{'model':db[_0x4ff628[_0x9aff('0x20')]],'as':_0x4ff628['as'],'attributes':_0x4ff628[_0x9aff('0x1e')],'include':_0x4ff628[_0x9aff('0x1d')]?_['map'](_0x4ff628['include'],function(_0x52cf15){return{'model':db[_0x52cf15[_0x9aff('0x20')]],'as':_0x52cf15['as'],'attributes':_0x52cf15[_0x9aff('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x400d23){logger[_0x9aff('0x14')](_0x9aff('0x21'),_0x23fc00);logger[_0x9aff('0xf')](_0x9aff('0x21'),_0x23fc00,JSON['stringify'](_0x400d23));_0x257132(_0x400d23);})[_0x9aff('0x16')](function(_0x8f376b){logger[_0x9aff('0x11')](_0x9aff('0x21'),_0x8f376b[_0x9aff('0x13')],_0x23fc00);_0x2416ca(_0x3bf951['error'](0x1f4,_0x8f376b[_0x9aff('0x13')]));});});}; \ No newline at end of file +var _0x82a0=['info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','map','include','model','find','raw','ShowDynamics365Account','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x39958f,_0x288e76){var _0x1e72b6=function(_0x579f84){while(--_0x579f84){_0x39958f['push'](_0x39958f['shift']());}};_0x1e72b6(++_0x288e76);}(_0x82a0,0xdb));var _0x082a=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x82a0[_0x547add];return _0x2ed1f3;};'use strict';var _=require(_0x082a('0x0'));var util=require(_0x082a('0x1'));var moment=require(_0x082a('0x2'));var BPromise=require(_0x082a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x082a('0x4'))['db'];var utils=require(_0x082a('0x5'));var logger=require('../../config/logger')(_0x082a('0x6'));var config=require(_0x082a('0x7'));var jayson=require(_0x082a('0x8'));var client=jayson[_0x082a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263934,_0x29f2c4,_0x580fd2){return new BPromise(function(_0x860b06,_0x5c6e1f){return client[_0x082a('0xa')](_0x263934,_0x580fd2)[_0x082a('0xb')](function(_0x208df4){logger[_0x082a('0xc')](_0x082a('0xd'),_0x29f2c4,_0x082a('0xe'));logger[_0x082a('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x29f2c4,_0x082a('0xe'),JSON[_0x082a('0x10')](_0x208df4));if(_0x208df4[_0x082a('0x11')]){if(_0x208df4['error']['code']===0x1f4){logger['error'](_0x082a('0xd'),_0x29f2c4,_0x208df4[_0x082a('0x11')][_0x082a('0x12')]);return _0x5c6e1f(_0x208df4[_0x082a('0x11')]['message']);}logger[_0x082a('0x11')](_0x082a('0xd'),_0x29f2c4,_0x208df4[_0x082a('0x11')]['message']);return _0x860b06(_0x208df4[_0x082a('0x11')][_0x082a('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x29f2c4,_0x082a('0xe'));_0x860b06(_0x208df4['result'][_0x082a('0x12')]);}})[_0x082a('0x13')](function(_0xa36729){logger[_0x082a('0x11')](_0x082a('0xd'),_0x29f2c4,_0xa36729);_0x5c6e1f(_0xa36729);});});}exports[_0x082a('0x14')]=function(_0x460c6c){var _0x1e540a=this;return new Promise(function(_0x5770c3,_0x51785e){return db[_0x082a('0x15')][_0x082a('0x16')]({'raw':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x460c6c[_0x082a('0x17')]?_0x460c6c['options'][_0x082a('0x18')]||null:null,'attributes':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')][_0x082a('0x19')]||null:null,'limit':_0x460c6c['options']?_0x460c6c['options'][_0x082a('0x1a')]||null:null,'include':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')]['include']?_[_0x082a('0x1b')](_0x460c6c[_0x082a('0x17')][_0x082a('0x1c')],function(_0x265ad0){return{'model':db[_0x265ad0[_0x082a('0x1d')]],'as':_0x265ad0['as'],'attributes':_0x265ad0[_0x082a('0x19')],'include':_0x265ad0[_0x082a('0x1c')]?_[_0x082a('0x1b')](_0x265ad0[_0x082a('0x1c')],function(_0x1e9fb6){return{'model':db[_0x1e9fb6[_0x082a('0x1d')]],'as':_0x1e9fb6['as'],'attributes':_0x1e9fb6[_0x082a('0x19')],'include':_0x1e9fb6[_0x082a('0x1c')]?_[_0x082a('0x1b')](_0x1e9fb6[_0x082a('0x1c')],function(_0x22e6ed){return{'model':db[_0x22e6ed[_0x082a('0x1d')]],'as':_0x22e6ed['as'],'attributes':_0x22e6ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x082a('0xb')](function(_0x2b6be6){logger['info']('GetDynamics365Account',_0x460c6c);logger[_0x082a('0xf')](_0x082a('0x14'),_0x460c6c,JSON['stringify'](_0x2b6be6));_0x5770c3(_0x2b6be6);})['catch'](function(_0x51b1e6){logger[_0x082a('0x11')](_0x082a('0x14'),_0x51b1e6[_0x082a('0x12')],_0x460c6c);_0x51785e(_0x1e540a['error'](0x1f4,_0x51b1e6['message']));});});};exports['ShowDynamics365Account']=function(_0x403114){var _0x2f27c6=this;return new Promise(function(_0x12fb88,_0x20550a){return db[_0x082a('0x15')][_0x082a('0x1e')]({'raw':_0x403114['options']?_0x403114[_0x082a('0x17')][_0x082a('0x1f')]===undefined?!![]:![]:!![],'where':_0x403114['options']?_0x403114['options'][_0x082a('0x18')]||null:null,'attributes':_0x403114[_0x082a('0x17')]?_0x403114['options']['attributes']||null:null,'include':_0x403114[_0x082a('0x17')]?_0x403114[_0x082a('0x17')][_0x082a('0x1c')]?_['map'](_0x403114[_0x082a('0x17')][_0x082a('0x1c')],function(_0x12f3c9){return{'model':db[_0x12f3c9[_0x082a('0x1d')]],'as':_0x12f3c9['as'],'attributes':_0x12f3c9[_0x082a('0x19')],'include':_0x12f3c9[_0x082a('0x1c')]?_['map'](_0x12f3c9[_0x082a('0x1c')],function(_0x563579){return{'model':db[_0x563579[_0x082a('0x1d')]],'as':_0x563579['as'],'attributes':_0x563579[_0x082a('0x19')],'include':_0x563579['include']?_['map'](_0x563579[_0x082a('0x1c')],function(_0x1382c6){return{'model':db[_0x1382c6['model']],'as':_0x1382c6['as'],'attributes':_0x1382c6[_0x082a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x082a('0xb')](function(_0x4b7165){logger[_0x082a('0xc')](_0x082a('0x20'),_0x403114);logger[_0x082a('0xf')]('ShowDynamics365Account',_0x403114,JSON[_0x082a('0x10')](_0x4b7165));_0x12fb88(_0x4b7165);})[_0x082a('0x13')](function(_0xa25d95){logger[_0x082a('0x11')](_0x082a('0x20'),_0xa25d95['message'],_0x403114);_0x20550a(_0x2f27c6[_0x082a('0x11')](0x1f4,_0xa25d95[_0x082a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 733e1b0..9af237e 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 _0xb7e7=['show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','get','/:id'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router[_0x7b7e('0x14')]('/:id',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x15')]);router['delete'](_0x7b7e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x16')]=router; \ No newline at end of file +var _0xfa60=['post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x15491c,_0xcb4e47){var _0x23c024=function(_0x535a64){while(--_0x535a64){_0x15491c['push'](_0x15491c['shift']());}};_0x23c024(++_0xcb4e47);}(_0xfa60,0x8a));var _0x0fa6=function(_0xb53d5c,_0x37fbda){_0xb53d5c=_0xb53d5c-0x0;var _0x353932=_0xfa60[_0xb53d5c];return _0x353932;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0fa6('0x0'));var timeout=require(_0x0fa6('0x1'));var express=require(_0x0fa6('0x2'));var router=express[_0x0fa6('0x3')]();var fs_extra=require(_0x0fa6('0x4'));var auth=require(_0x0fa6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0fa6('0x6'));router[_0x0fa6('0x7')]('/',auth[_0x0fa6('0x8')](),controller['index']);router['get'](_0x0fa6('0x9'),auth[_0x0fa6('0x8')](),controller['show']);router[_0x0fa6('0x7')](_0x0fa6('0xa'),auth[_0x0fa6('0x8')](),controller[_0x0fa6('0xb')]);router['get'](_0x0fa6('0xc'),auth['isAuthenticated'](),controller[_0x0fa6('0xd')]);router[_0x0fa6('0x7')](_0x0fa6('0xe'),auth[_0x0fa6('0x8')](),controller[_0x0fa6('0xf')]);router[_0x0fa6('0x10')]('/',auth[_0x0fa6('0x8')](),controller[_0x0fa6('0x11')]);router[_0x0fa6('0x12')](_0x0fa6('0x9'),auth['isAuthenticated'](),controller[_0x0fa6('0x13')]);router[_0x0fa6('0x14')](_0x0fa6('0x9'),auth[_0x0fa6('0x8')](),controller['destroy']);module[_0x0fa6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 4cc6f52..379d9c5 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 _0x2141=['phonecall','sequelize','STRING','ENUM','incident'];(function(_0x341c18,_0x2c5718){var _0x2d0f8a=function(_0x2de7c1){while(--_0x2de7c1){_0x341c18['push'](_0x341c18['shift']());}};_0x2d0f8a(++_0x2c5718);}(_0x2141,0xf6));var _0x1214=function(_0x57a4ad,_0x3d8ff2){_0x57a4ad=_0x57a4ad-0x0;var _0x4ed6c3=_0x2141[_0x57a4ad];return _0x4ed6c3;};'use strict';var Sequelize=require(_0x1214('0x0'));module['exports']={'name':{'type':Sequelize[_0x1214('0x1')]},'description':{'type':Sequelize[_0x1214('0x1')]},'ticketType':{'type':Sequelize[_0x1214('0x2')](_0x1214('0x3'),_0x1214('0x4')),'defaultValue':_0x1214('0x3')}}; \ No newline at end of file +var _0x477b=['incident','phonecall','sequelize','STRING','ENUM'];(function(_0x3079a6,_0x4c0bf2){var _0x55cc26=function(_0x1d8631){while(--_0x1d8631){_0x3079a6['push'](_0x3079a6['shift']());}};_0x55cc26(++_0x4c0bf2);}(_0x477b,0x188));var _0xb477=function(_0xf36a7c,_0x53f974){_0xf36a7c=_0xf36a7c-0x0;var _0x3be6ac=_0x477b[_0xf36a7c];return _0x3be6ac;};'use strict';var Sequelize=require(_0xb477('0x0'));module['exports']={'name':{'type':Sequelize[_0xb477('0x1')]},'description':{'type':Sequelize[_0xb477('0x1')]},'ticketType':{'type':Sequelize[_0xb477('0x2')](_0xb477('0x3'),_0xb477('0x4')),'defaultValue':_0xb477('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 4724f1f..e6e2950 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 _0x0a80=['Dynamics365Field','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','getFields','getSubjects'];(function(_0x3a8eab,_0x4d7d44){var _0x231ad3=function(_0x2abe82){while(--_0x2abe82){_0x3a8eab['push'](_0x3a8eab['shift']());}};_0x231ad3(++_0x4d7d44);}(_0x0a80,0xde));var _0x00a8=function(_0x2ec589,_0x3e9afa){_0x2ec589=_0x2ec589-0x0;var _0x3c203c=_0x0a80[_0x2ec589];return _0x3c203c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00a8('0x0'));var zipdir=require(_0x00a8('0x1'));var jsonpatch=require(_0x00a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00a8('0x3'));var Mustache=require('mustache');var util=require(_0x00a8('0x4'));var path=require(_0x00a8('0x5'));var sox=require(_0x00a8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00a8('0x7'));var _=require('lodash');var squel=require(_0x00a8('0x8'));var crypto=require(_0x00a8('0x9'));var jsforce=require(_0x00a8('0xa'));var deskjs=require(_0x00a8('0xb'));var toCsv=require(_0x00a8('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x00a8('0xd'));var authService=require(_0x00a8('0xe'));var qs=require(_0x00a8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00a8('0x10'));var logger=require(_0x00a8('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x00a8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x00a8('0x13'))['db'];function respondWithStatusCode(_0x5c2a03,_0x4d0165){_0x4d0165=_0x4d0165||0xcc;return function(_0x244688){if(_0x244688){return _0x5c2a03['sendStatus'](_0x4d0165);}return _0x5c2a03[_0x00a8('0x14')](_0x4d0165)[_0x00a8('0x15')]();};}function respondWithResult(_0x30e534,_0x751afd){_0x751afd=_0x751afd||0xc8;return function(_0x4cc46d){if(_0x4cc46d){return _0x30e534['status'](_0x751afd)['json'](_0x4cc46d);}};}function respondWithFilteredResult(_0x58920d,_0x2ad357){return function(_0x59d43f){if(_0x59d43f){var _0x3ecbf1=typeof _0x2ad357['offset']===_0x00a8('0x16')&&typeof _0x2ad357[_0x00a8('0x17')]===_0x00a8('0x16');var _0x541060=_0x59d43f[_0x00a8('0x18')];var _0x2567b5=_0x3ecbf1?0x0:_0x2ad357[_0x00a8('0x19')];var _0x35480d=_0x3ecbf1?_0x59d43f[_0x00a8('0x18')]:_0x2ad357[_0x00a8('0x19')]+_0x2ad357[_0x00a8('0x17')];var _0x75437b;if(_0x35480d>=_0x541060){_0x35480d=_0x541060;_0x75437b=0xc8;}else{_0x75437b=0xce;}_0x58920d[_0x00a8('0x14')](_0x75437b);return _0x58920d[_0x00a8('0x1a')](_0x00a8('0x1b'),_0x2567b5+'-'+_0x35480d+'/'+_0x541060)[_0x00a8('0x1c')](_0x59d43f);}return null;};}function patchUpdates(_0x220c61){return function(_0x3135ce){try{jsonpatch['apply'](_0x3135ce,_0x220c61,!![]);}catch(_0x5197a7){return BPromise['reject'](_0x5197a7);}return _0x3135ce['save']();};}function saveUpdates(_0x2ae058,_0x42d05){return function(_0x521f68){if(_0x521f68){return _0x521f68[_0x00a8('0x1d')](_0x2ae058)[_0x00a8('0x1e')](function(_0x1875af){return _0x1875af;});}return null;};}function removeEntity(_0xaff9eb,_0x58d35c){return function(_0x4de497){if(_0x4de497){return _0x4de497[_0x00a8('0x1f')]()['then'](function(){_0xaff9eb[_0x00a8('0x14')](0xcc)[_0x00a8('0x15')]();});}};}function handleEntityNotFound(_0x5653fc,_0x576309){return function(_0x1d17e4){if(!_0x1d17e4){_0x5653fc[_0x00a8('0x20')](0x194);}return _0x1d17e4;};}function handleError(_0x24c431,_0x396a2e){_0x396a2e=_0x396a2e||0x1f4;return function(_0x406d62){logger['error'](_0x406d62[_0x00a8('0x21')]);if(_0x406d62['name']){delete _0x406d62[_0x00a8('0x22')];}_0x24c431[_0x00a8('0x14')](_0x396a2e)[_0x00a8('0x23')](_0x406d62);};}exports[_0x00a8('0x24')]=function(_0x36248d,_0x594473){var _0x46893d={},_0x3ec287={},_0x5ee5d6={'count':0x0,'rows':[]};var _0x5dff28=_[_0x00a8('0x25')](db[_0x00a8('0x26')][_0x00a8('0x27')],function(_0x228db5){return{'name':_0x228db5['fieldName'],'type':_0x228db5['type'][_0x00a8('0x28')]};});_0x3ec287[_0x00a8('0x29')]=_['map'](_0x5dff28,'name');_0x3ec287[_0x00a8('0x2a')]=_[_0x00a8('0x2b')](_0x36248d['query']);_0x3ec287[_0x00a8('0x2c')]=_[_0x00a8('0x2d')](_0x3ec287[_0x00a8('0x29')],_0x3ec287[_0x00a8('0x2a')]);_0x46893d[_0x00a8('0x2e')]=_[_0x00a8('0x2d')](_0x3ec287[_0x00a8('0x29')],qs[_0x00a8('0x2f')](_0x36248d['query']['fields']));_0x46893d[_0x00a8('0x2e')]=_0x46893d[_0x00a8('0x2e')][_0x00a8('0x30')]?_0x46893d['attributes']:_0x3ec287[_0x00a8('0x29')];if(!_0x36248d[_0x00a8('0x2a')]['hasOwnProperty'](_0x00a8('0x31'))){_0x46893d[_0x00a8('0x17')]=qs[_0x00a8('0x17')](_0x36248d[_0x00a8('0x2a')][_0x00a8('0x17')]);_0x46893d[_0x00a8('0x19')]=qs[_0x00a8('0x19')](_0x36248d['query']['offset']);}_0x46893d[_0x00a8('0x32')]=qs[_0x00a8('0x33')](_0x36248d[_0x00a8('0x2a')][_0x00a8('0x33')]);_0x46893d[_0x00a8('0x34')]=qs[_0x00a8('0x2c')](_[_0x00a8('0x35')](_0x36248d[_0x00a8('0x2a')],_0x3ec287[_0x00a8('0x2c')]),_0x5dff28);if(_0x36248d[_0x00a8('0x2a')][_0x00a8('0x36')]){_0x46893d[_0x00a8('0x34')]=_[_0x00a8('0x37')](_0x46893d[_0x00a8('0x34')],{'$or':_['map'](_0x5dff28,function(_0x508fed){if(_0x508fed[_0x00a8('0x38')]!==_0x00a8('0x39')){var _0x1fe2cf={};_0x1fe2cf[_0x508fed[_0x00a8('0x22')]]={'$like':'%'+_0x36248d['query'][_0x00a8('0x36')]+'%'};return _0x1fe2cf;}})});}_0x46893d=_['merge']({},_0x46893d,_0x36248d['options']);var _0x2e2368={'where':_0x46893d[_0x00a8('0x34')]};return db[_0x00a8('0x26')]['count'](_0x2e2368)[_0x00a8('0x1e')](function(_0x51fa9c){_0x5ee5d6[_0x00a8('0x18')]=_0x51fa9c;if(_0x36248d[_0x00a8('0x2a')][_0x00a8('0x3a')]){_0x46893d[_0x00a8('0x3b')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x00a8('0x3c')](_0x46893d);})[_0x00a8('0x1e')](function(_0x2a5f06){_0x5ee5d6['rows']=_0x2a5f06;return _0x5ee5d6;})[_0x00a8('0x1e')](respondWithFilteredResult(_0x594473,_0x46893d))[_0x00a8('0x3d')](handleError(_0x594473,null));};exports[_0x00a8('0x3e')]=function(_0x2408e2,_0x3c3da8){var _0x3c3fe4={'raw':![],'where':{'id':_0x2408e2[_0x00a8('0x3f')]['id']}},_0x507e18={};_0x507e18[_0x00a8('0x29')]=_[_0x00a8('0x2b')](db[_0x00a8('0x26')][_0x00a8('0x27')]);_0x507e18[_0x00a8('0x2a')]=_[_0x00a8('0x2b')](_0x2408e2[_0x00a8('0x2a')]);_0x507e18[_0x00a8('0x2c')]=_[_0x00a8('0x2d')](_0x507e18[_0x00a8('0x29')],_0x507e18[_0x00a8('0x2a')]);_0x3c3fe4[_0x00a8('0x2e')]=_[_0x00a8('0x2d')](_0x507e18[_0x00a8('0x29')],qs[_0x00a8('0x2f')](_0x2408e2[_0x00a8('0x2a')][_0x00a8('0x2f')]));_0x3c3fe4[_0x00a8('0x2e')]=_0x3c3fe4['attributes'][_0x00a8('0x30')]?_0x3c3fe4[_0x00a8('0x2e')]:_0x507e18['model'];if(_0x2408e2[_0x00a8('0x2a')][_0x00a8('0x3a')]){_0x3c3fe4['include']=[{'all':!![]}];}_0x3c3fe4=_[_0x00a8('0x37')]({},_0x3c3fe4,_0x2408e2[_0x00a8('0x40')]);return db[_0x00a8('0x26')]['find'](_0x3c3fe4)[_0x00a8('0x1e')](handleEntityNotFound(_0x3c3da8,null))[_0x00a8('0x1e')](respondWithResult(_0x3c3da8,null))[_0x00a8('0x3d')](handleError(_0x3c3da8,null));};exports[_0x00a8('0x41')]=function(_0x3c99fe,_0x38b89a){return db['Dynamics365Configuration'][_0x00a8('0x41')](_0x3c99fe[_0x00a8('0x42')],{})[_0x00a8('0x1e')](respondWithResult(_0x38b89a,0xc9))[_0x00a8('0x3d')](handleError(_0x38b89a,null));};exports[_0x00a8('0x1d')]=function(_0x6ac76a,_0x511ace){if(_0x6ac76a[_0x00a8('0x42')]['id']){delete _0x6ac76a[_0x00a8('0x42')]['id'];}return db[_0x00a8('0x26')]['find']({'where':{'id':_0x6ac76a[_0x00a8('0x3f')]['id']}})[_0x00a8('0x1e')](handleEntityNotFound(_0x511ace,null))['then'](saveUpdates(_0x6ac76a[_0x00a8('0x42')],null))['then'](respondWithResult(_0x511ace,null))[_0x00a8('0x3d')](handleError(_0x511ace,null));};exports[_0x00a8('0x1f')]=function(_0x54e149,_0x3b52d7){return db['Dynamics365Configuration'][_0x00a8('0x43')]({'where':{'id':_0x54e149['params']['id']}})[_0x00a8('0x1e')](handleEntityNotFound(_0x3b52d7,null))[_0x00a8('0x1e')](removeEntity(_0x3b52d7,null))[_0x00a8('0x3d')](handleError(_0x3b52d7,null));};exports['getFields']=function(_0x486156,_0x3eb3ab,_0x4c5527){var _0x549816={};var _0x115733={};var _0xe4807e;var _0x575955;return db[_0x00a8('0x26')]['findOne']({'where':{'id':_0x486156[_0x00a8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3eb3ab,null))[_0x00a8('0x1e')](function(_0x4741bd){if(_0x4741bd){_0xe4807e=_0x4741bd;_0x115733['model']=_['keys'](db['Dynamics365Field'][_0x00a8('0x27')]);_0x115733[_0x00a8('0x2a')]=_[_0x00a8('0x2b')](_0x486156[_0x00a8('0x2a')]);_0x115733['filters']=_[_0x00a8('0x2d')](_0x115733[_0x00a8('0x29')],_0x115733[_0x00a8('0x2a')]);_0x549816[_0x00a8('0x2e')]=_[_0x00a8('0x2d')](_0x115733[_0x00a8('0x29')],qs[_0x00a8('0x2f')](_0x486156[_0x00a8('0x2a')][_0x00a8('0x2f')]));_0x549816[_0x00a8('0x2e')]=_0x549816[_0x00a8('0x2e')][_0x00a8('0x30')]?_0x549816[_0x00a8('0x2e')]:_0x115733[_0x00a8('0x29')];_0x549816[_0x00a8('0x32')]=qs[_0x00a8('0x33')](_0x486156[_0x00a8('0x2a')][_0x00a8('0x33')]);_0x549816[_0x00a8('0x34')]=qs[_0x00a8('0x2c')](_['pick'](_0x486156[_0x00a8('0x2a')],_0x115733[_0x00a8('0x2c')]));if(_0x486156[_0x00a8('0x2a')][_0x00a8('0x36')]){_0x549816['where']=_[_0x00a8('0x37')](_0x549816[_0x00a8('0x34')],{'$or':_[_0x00a8('0x25')](_0x549816['attributes'],function(_0x4507e0){var _0x38d774={};_0x38d774[_0x4507e0]={'$like':'%'+_0x486156[_0x00a8('0x2a')][_0x00a8('0x36')]+'%'};return _0x38d774;})});}_0x549816=_[_0x00a8('0x37')]({},_0x549816,_0x486156[_0x00a8('0x40')]);return _0xe4807e['getFields'](_0x549816);}})['then'](function(_0x272b85){if(_0x272b85){_0x575955=_0x272b85[_0x00a8('0x30')];if(!_0x486156[_0x00a8('0x2a')]['hasOwnProperty'](_0x00a8('0x31'))){_0x549816[_0x00a8('0x17')]=qs['limit'](_0x486156[_0x00a8('0x2a')][_0x00a8('0x17')]);_0x549816[_0x00a8('0x19')]=qs[_0x00a8('0x19')](_0x486156[_0x00a8('0x2a')][_0x00a8('0x19')]);}return _0xe4807e[_0x00a8('0x44')](_0x549816);}})['then'](function(_0x401916){if(_0x401916){return _0x401916?{'count':_0x575955,'rows':_0x401916}:null;}})[_0x00a8('0x1e')](respondWithResult(_0x3eb3ab,null))[_0x00a8('0x3d')](handleError(_0x3eb3ab,null));};exports[_0x00a8('0x45')]=function(_0x2381c8,_0x2c4380,_0x2f3715){var _0x4f4bc2={};var _0x5c2477={};var _0x8c8fcb;var _0x31df5b;return db[_0x00a8('0x26')]['findOne']({'where':{'id':_0x2381c8[_0x00a8('0x3f')]['id']}})[_0x00a8('0x1e')](handleEntityNotFound(_0x2c4380,null))[_0x00a8('0x1e')](function(_0x13094a){if(_0x13094a){_0x8c8fcb=_0x13094a;_0x5c2477[_0x00a8('0x29')]=_[_0x00a8('0x2b')](db[_0x00a8('0x46')][_0x00a8('0x27')]);_0x5c2477[_0x00a8('0x2a')]=_[_0x00a8('0x2b')](_0x2381c8['query']);_0x5c2477[_0x00a8('0x2c')]=_['intersection'](_0x5c2477[_0x00a8('0x29')],_0x5c2477[_0x00a8('0x2a')]);_0x4f4bc2[_0x00a8('0x2e')]=_[_0x00a8('0x2d')](_0x5c2477[_0x00a8('0x29')],qs[_0x00a8('0x2f')](_0x2381c8['query']['fields']));_0x4f4bc2[_0x00a8('0x2e')]=_0x4f4bc2[_0x00a8('0x2e')]['length']?_0x4f4bc2[_0x00a8('0x2e')]:_0x5c2477[_0x00a8('0x29')];_0x4f4bc2[_0x00a8('0x32')]=qs[_0x00a8('0x33')](_0x2381c8[_0x00a8('0x2a')]['sort']);_0x4f4bc2[_0x00a8('0x34')]=qs[_0x00a8('0x2c')](_[_0x00a8('0x35')](_0x2381c8['query'],_0x5c2477[_0x00a8('0x2c')]));if(_0x2381c8[_0x00a8('0x2a')][_0x00a8('0x36')]){_0x4f4bc2['where']=_[_0x00a8('0x37')](_0x4f4bc2[_0x00a8('0x34')],{'$or':_[_0x00a8('0x25')](_0x4f4bc2['attributes'],function(_0x1ef374){var _0x5b6316={};_0x5b6316[_0x1ef374]={'$like':'%'+_0x2381c8[_0x00a8('0x2a')]['filter']+'%'};return _0x5b6316;})});}_0x4f4bc2=_[_0x00a8('0x37')]({},_0x4f4bc2,_0x2381c8[_0x00a8('0x40')]);return _0x8c8fcb[_0x00a8('0x45')](_0x4f4bc2);}})[_0x00a8('0x1e')](function(_0x5d2567){if(_0x5d2567){_0x31df5b=_0x5d2567[_0x00a8('0x30')];if(!_0x2381c8[_0x00a8('0x2a')][_0x00a8('0x47')]('nolimit')){_0x4f4bc2[_0x00a8('0x17')]=qs[_0x00a8('0x17')](_0x2381c8['query']['limit']);_0x4f4bc2[_0x00a8('0x19')]=qs[_0x00a8('0x19')](_0x2381c8[_0x00a8('0x2a')][_0x00a8('0x19')]);}return _0x8c8fcb[_0x00a8('0x45')](_0x4f4bc2);}})['then'](function(_0x39e4cc){if(_0x39e4cc){return _0x39e4cc?{'count':_0x31df5b,'rows':_0x39e4cc}:null;}})[_0x00a8('0x1e')](respondWithResult(_0x2c4380,null))[_0x00a8('0x3d')](handleError(_0x2c4380,null));};exports[_0x00a8('0x48')]=function(_0x483a5c,_0x28ff25,_0x1dcc28){var _0x447598={};var _0x57add8={};var _0x2db52c;var _0x36a597;return db[_0x00a8('0x26')]['findOne']({'where':{'id':_0x483a5c[_0x00a8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x28ff25,null))[_0x00a8('0x1e')](function(_0x5a30ba){if(_0x5a30ba){_0x2db52c=_0x5a30ba;_0x57add8[_0x00a8('0x29')]=_[_0x00a8('0x2b')](db[_0x00a8('0x46')]['rawAttributes']);_0x57add8[_0x00a8('0x2a')]=_[_0x00a8('0x2b')](_0x483a5c[_0x00a8('0x2a')]);_0x57add8[_0x00a8('0x2c')]=_[_0x00a8('0x2d')](_0x57add8[_0x00a8('0x29')],_0x57add8[_0x00a8('0x2a')]);_0x447598['attributes']=_[_0x00a8('0x2d')](_0x57add8[_0x00a8('0x29')],qs[_0x00a8('0x2f')](_0x483a5c[_0x00a8('0x2a')]['fields']));_0x447598[_0x00a8('0x2e')]=_0x447598[_0x00a8('0x2e')][_0x00a8('0x30')]?_0x447598[_0x00a8('0x2e')]:_0x57add8[_0x00a8('0x29')];_0x447598[_0x00a8('0x32')]=qs['sort'](_0x483a5c[_0x00a8('0x2a')][_0x00a8('0x33')]);_0x447598[_0x00a8('0x34')]=qs[_0x00a8('0x2c')](_['pick'](_0x483a5c['query'],_0x57add8[_0x00a8('0x2c')]));if(_0x483a5c[_0x00a8('0x2a')][_0x00a8('0x36')]){_0x447598[_0x00a8('0x34')]=_[_0x00a8('0x37')](_0x447598['where'],{'$or':_['map'](_0x447598[_0x00a8('0x2e')],function(_0x547861){var _0x221e5e={};_0x221e5e[_0x547861]={'$like':'%'+_0x483a5c[_0x00a8('0x2a')]['filter']+'%'};return _0x221e5e;})});}_0x447598=_[_0x00a8('0x37')]({},_0x447598,_0x483a5c['options']);return _0x2db52c[_0x00a8('0x48')](_0x447598);}})[_0x00a8('0x1e')](function(_0x526641){if(_0x526641){_0x36a597=_0x526641[_0x00a8('0x30')];if(!_0x483a5c[_0x00a8('0x2a')][_0x00a8('0x47')]('nolimit')){_0x447598['limit']=qs[_0x00a8('0x17')](_0x483a5c['query']['limit']);_0x447598[_0x00a8('0x19')]=qs[_0x00a8('0x19')](_0x483a5c[_0x00a8('0x2a')][_0x00a8('0x19')]);}return _0x2db52c['getDescriptions'](_0x447598);}})['then'](function(_0x3ff8e8){if(_0x3ff8e8){return _0x3ff8e8?{'count':_0x36a597,'rows':_0x3ff8e8}:null;}})[_0x00a8('0x1e')](respondWithResult(_0x28ff25,null))['catch'](handleError(_0x28ff25,null));}; \ No newline at end of file +var _0x9c55=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','getFields','getSubjects','findOne','Dynamics365Field','getDescriptions','rimraf'];(function(_0x154f8d,_0x4bb33b){var _0x3df89d=function(_0x5f5cc3){while(--_0x5f5cc3){_0x154f8d['push'](_0x154f8d['shift']());}};_0x3df89d(++_0x4bb33b);}(_0x9c55,0xf8));var _0x59c5=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x9c55[_0x2cef86];return _0x46dfd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59c5('0x0'));var zipdir=require(_0x59c5('0x1'));var jsonpatch=require(_0x59c5('0x2'));var rp=require(_0x59c5('0x3'));var moment=require(_0x59c5('0x4'));var BPromise=require(_0x59c5('0x5'));var Mustache=require(_0x59c5('0x6'));var util=require(_0x59c5('0x7'));var path=require(_0x59c5('0x8'));var sox=require(_0x59c5('0x9'));var csv=require(_0x59c5('0xa'));var ejs=require(_0x59c5('0xb'));var fs=require('fs');var fs_extra=require(_0x59c5('0xc'));var _=require('lodash');var squel=require(_0x59c5('0xd'));var crypto=require(_0x59c5('0xe'));var jsforce=require(_0x59c5('0xf'));var deskjs=require(_0x59c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x59c5('0x11'));var Papa=require(_0x59c5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59c5('0x13'));var hardwareService=require(_0x59c5('0x14'));var logger=require('../../config/logger')(_0x59c5('0x15'));var utils=require(_0x59c5('0x16'));var config=require(_0x59c5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x59c5('0x18'))['db'];function respondWithStatusCode(_0x2315be,_0x1a8835){_0x1a8835=_0x1a8835||0xcc;return function(_0x247d3c){if(_0x247d3c){return _0x2315be['sendStatus'](_0x1a8835);}return _0x2315be['status'](_0x1a8835)[_0x59c5('0x19')]();};}function respondWithResult(_0x56e1aa,_0x2c8757){_0x2c8757=_0x2c8757||0xc8;return function(_0x396146){if(_0x396146){return _0x56e1aa[_0x59c5('0x1a')](_0x2c8757)[_0x59c5('0x1b')](_0x396146);}};}function respondWithFilteredResult(_0x43d147,_0x588288){return function(_0x5db798){if(_0x5db798){var _0x514132=typeof _0x588288[_0x59c5('0x1c')]===_0x59c5('0x1d')&&typeof _0x588288[_0x59c5('0x1e')]==='undefined';var _0x83e641=_0x5db798[_0x59c5('0x1f')];var _0x52382d=_0x514132?0x0:_0x588288[_0x59c5('0x1c')];var _0x237737=_0x514132?_0x5db798[_0x59c5('0x1f')]:_0x588288[_0x59c5('0x1c')]+_0x588288[_0x59c5('0x1e')];var _0x359915;if(_0x237737>=_0x83e641){_0x237737=_0x83e641;_0x359915=0xc8;}else{_0x359915=0xce;}_0x43d147[_0x59c5('0x1a')](_0x359915);return _0x43d147[_0x59c5('0x20')](_0x59c5('0x21'),_0x52382d+'-'+_0x237737+'/'+_0x83e641)['json'](_0x5db798);}return null;};}function patchUpdates(_0x23ad10){return function(_0x11646c){try{jsonpatch[_0x59c5('0x22')](_0x11646c,_0x23ad10,!![]);}catch(_0x150710){return BPromise[_0x59c5('0x23')](_0x150710);}return _0x11646c[_0x59c5('0x24')]();};}function saveUpdates(_0x634cc4,_0x28c0b4){return function(_0x4af72b){if(_0x4af72b){return _0x4af72b[_0x59c5('0x25')](_0x634cc4)[_0x59c5('0x26')](function(_0x442b35){return _0x442b35;});}return null;};}function removeEntity(_0x481d0e,_0x5dd740){return function(_0x56deab){if(_0x56deab){return _0x56deab[_0x59c5('0x27')]()[_0x59c5('0x26')](function(){_0x481d0e['status'](0xcc)[_0x59c5('0x19')]();});}};}function handleEntityNotFound(_0x3a2032,_0x56e96a){return function(_0x2e4cab){if(!_0x2e4cab){_0x3a2032[_0x59c5('0x28')](0x194);}return _0x2e4cab;};}function handleError(_0x1aad88,_0x419a88){_0x419a88=_0x419a88||0x1f4;return function(_0x2f03e3){logger[_0x59c5('0x29')](_0x2f03e3[_0x59c5('0x2a')]);if(_0x2f03e3[_0x59c5('0x2b')]){delete _0x2f03e3[_0x59c5('0x2b')];}_0x1aad88[_0x59c5('0x1a')](_0x419a88)[_0x59c5('0x2c')](_0x2f03e3);};}exports[_0x59c5('0x2d')]=function(_0x2cd6e3,_0x5698c8){var _0x70c2de={},_0x225b84={},_0x4f0ea0={'count':0x0,'rows':[]};var _0xe5872f=_[_0x59c5('0x2e')](db[_0x59c5('0x2f')][_0x59c5('0x30')],function(_0x55b8c4){return{'name':_0x55b8c4['fieldName'],'type':_0x55b8c4[_0x59c5('0x31')][_0x59c5('0x32')]};});_0x225b84[_0x59c5('0x33')]=_[_0x59c5('0x2e')](_0xe5872f,_0x59c5('0x2b'));_0x225b84['query']=_[_0x59c5('0x34')](_0x2cd6e3[_0x59c5('0x35')]);_0x225b84[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x225b84[_0x59c5('0x33')],_0x225b84[_0x59c5('0x35')]);_0x70c2de[_0x59c5('0x38')]=_['intersection'](_0x225b84[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x2cd6e3['query']['fields']));_0x70c2de['attributes']=_0x70c2de[_0x59c5('0x38')]['length']?_0x70c2de[_0x59c5('0x38')]:_0x225b84[_0x59c5('0x33')];if(!_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x70c2de[_0x59c5('0x1e')]=qs['limit'](_0x2cd6e3['query'][_0x59c5('0x1e')]);_0x70c2de[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x2cd6e3['query'][_0x59c5('0x1c')]);}_0x70c2de[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x3d')]);_0x70c2de['where']=qs['filters'](_[_0x59c5('0x3e')](_0x2cd6e3[_0x59c5('0x35')],_0x225b84[_0x59c5('0x36')]),_0xe5872f);if(_0x2cd6e3['query'][_0x59c5('0x3f')]){_0x70c2de[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x70c2de[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0xe5872f,function(_0x14d582){if(_0x14d582[_0x59c5('0x31')]!=='VIRTUAL'){var _0x4abac4={};_0x4abac4[_0x14d582[_0x59c5('0x2b')]]={'$like':'%'+_0x2cd6e3['query'][_0x59c5('0x3f')]+'%'};return _0x4abac4;}})});}_0x70c2de=_['merge']({},_0x70c2de,_0x2cd6e3[_0x59c5('0x42')]);var _0x532eaf={'where':_0x70c2de[_0x59c5('0x40')]};return db['Dynamics365Configuration'][_0x59c5('0x1f')](_0x532eaf)[_0x59c5('0x26')](function(_0x2b9549){_0x4f0ea0[_0x59c5('0x1f')]=_0x2b9549;if(_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x43')]){_0x70c2de['include']=[{'all':!![]}];}return db[_0x59c5('0x2f')][_0x59c5('0x44')](_0x70c2de);})[_0x59c5('0x26')](function(_0x594105){_0x4f0ea0[_0x59c5('0x45')]=_0x594105;return _0x4f0ea0;})[_0x59c5('0x26')](respondWithFilteredResult(_0x5698c8,_0x70c2de))[_0x59c5('0x46')](handleError(_0x5698c8,null));};exports[_0x59c5('0x47')]=function(_0x1e6faa,_0x12e668){var _0x43f233={'raw':![],'where':{'id':_0x1e6faa['params']['id']}},_0x475d8c={};_0x475d8c['model']=_[_0x59c5('0x34')](db['Dynamics365Configuration'][_0x59c5('0x30')]);_0x475d8c[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0x1e6faa[_0x59c5('0x35')]);_0x475d8c[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x475d8c[_0x59c5('0x33')],_0x475d8c[_0x59c5('0x35')]);_0x43f233['attributes']=_['intersection'](_0x475d8c[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x1e6faa[_0x59c5('0x35')][_0x59c5('0x39')]));_0x43f233[_0x59c5('0x38')]=_0x43f233[_0x59c5('0x38')][_0x59c5('0x48')]?_0x43f233[_0x59c5('0x38')]:_0x475d8c[_0x59c5('0x33')];if(_0x1e6faa[_0x59c5('0x35')][_0x59c5('0x43')]){_0x43f233[_0x59c5('0x49')]=[{'all':!![]}];}_0x43f233=_[_0x59c5('0x41')]({},_0x43f233,_0x1e6faa[_0x59c5('0x42')]);return db[_0x59c5('0x2f')][_0x59c5('0x4a')](_0x43f233)[_0x59c5('0x26')](handleEntityNotFound(_0x12e668,null))[_0x59c5('0x26')](respondWithResult(_0x12e668,null))[_0x59c5('0x46')](handleError(_0x12e668,null));};exports['create']=function(_0x466535,_0x1989d4){return db[_0x59c5('0x2f')][_0x59c5('0x4b')](_0x466535['body'],{})['then'](respondWithResult(_0x1989d4,0xc9))[_0x59c5('0x46')](handleError(_0x1989d4,null));};exports[_0x59c5('0x25')]=function(_0x3ad1e9,_0x552196){if(_0x3ad1e9['body']['id']){delete _0x3ad1e9[_0x59c5('0x4c')]['id'];}return db['Dynamics365Configuration'][_0x59c5('0x4a')]({'where':{'id':_0x3ad1e9[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x552196,null))[_0x59c5('0x26')](saveUpdates(_0x3ad1e9[_0x59c5('0x4c')],null))['then'](respondWithResult(_0x552196,null))[_0x59c5('0x46')](handleError(_0x552196,null));};exports[_0x59c5('0x27')]=function(_0x11588b,_0x4a96cb){return db['Dynamics365Configuration']['find']({'where':{'id':_0x11588b[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x4a96cb,null))[_0x59c5('0x26')](removeEntity(_0x4a96cb,null))[_0x59c5('0x46')](handleError(_0x4a96cb,null));};exports['getFields']=function(_0x16b74a,_0x3133a9,_0x1ab47e){var _0x3baf9d={};var _0x4dfb01={};var _0x43fbf3;var _0x147d2f;return db[_0x59c5('0x2f')]['findOne']({'where':{'id':_0x16b74a[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x3133a9,null))[_0x59c5('0x26')](function(_0x4e4a52){if(_0x4e4a52){_0x43fbf3=_0x4e4a52;_0x4dfb01[_0x59c5('0x33')]=_[_0x59c5('0x34')](db['Dynamics365Field']['rawAttributes']);_0x4dfb01[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0x16b74a[_0x59c5('0x35')]);_0x4dfb01[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x4dfb01[_0x59c5('0x33')],_0x4dfb01[_0x59c5('0x35')]);_0x3baf9d[_0x59c5('0x38')]=_[_0x59c5('0x37')](_0x4dfb01[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x16b74a[_0x59c5('0x35')][_0x59c5('0x39')]));_0x3baf9d[_0x59c5('0x38')]=_0x3baf9d[_0x59c5('0x38')][_0x59c5('0x48')]?_0x3baf9d[_0x59c5('0x38')]:_0x4dfb01['model'];_0x3baf9d[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0x16b74a[_0x59c5('0x35')]['sort']);_0x3baf9d[_0x59c5('0x40')]=qs[_0x59c5('0x36')](_[_0x59c5('0x3e')](_0x16b74a[_0x59c5('0x35')],_0x4dfb01['filters']));if(_0x16b74a[_0x59c5('0x35')]['filter']){_0x3baf9d[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x3baf9d[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0x3baf9d['attributes'],function(_0x1ce61c){var _0x2bbba3={};_0x2bbba3[_0x1ce61c]={'$like':'%'+_0x16b74a[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x2bbba3;})});}_0x3baf9d=_[_0x59c5('0x41')]({},_0x3baf9d,_0x16b74a[_0x59c5('0x42')]);return _0x43fbf3[_0x59c5('0x4e')](_0x3baf9d);}})[_0x59c5('0x26')](function(_0xca787a){if(_0xca787a){_0x147d2f=_0xca787a[_0x59c5('0x48')];if(!_0x16b74a['query'][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x3baf9d['limit']=qs[_0x59c5('0x1e')](_0x16b74a[_0x59c5('0x35')][_0x59c5('0x1e')]);_0x3baf9d[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x16b74a['query']['offset']);}return _0x43fbf3['getFields'](_0x3baf9d);}})['then'](function(_0x368674){if(_0x368674){return _0x368674?{'count':_0x147d2f,'rows':_0x368674}:null;}})['then'](respondWithResult(_0x3133a9,null))['catch'](handleError(_0x3133a9,null));};exports[_0x59c5('0x4f')]=function(_0xd6e7a,_0x56a6f9,_0x5c649a){var _0x3f57fe={};var _0x4e711c={};var _0x3f9cb3;var _0x3a110e;return db[_0x59c5('0x2f')][_0x59c5('0x50')]({'where':{'id':_0xd6e7a[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x56a6f9,null))[_0x59c5('0x26')](function(_0x2bd2b4){if(_0x2bd2b4){_0x3f9cb3=_0x2bd2b4;_0x4e711c['model']=_['keys'](db[_0x59c5('0x51')]['rawAttributes']);_0x4e711c[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0xd6e7a[_0x59c5('0x35')]);_0x4e711c[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x4e711c['model'],_0x4e711c['query']);_0x3f57fe[_0x59c5('0x38')]=_['intersection'](_0x4e711c[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x39')]));_0x3f57fe[_0x59c5('0x38')]=_0x3f57fe[_0x59c5('0x38')][_0x59c5('0x48')]?_0x3f57fe['attributes']:_0x4e711c['model'];_0x3f57fe[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x3d')]);_0x3f57fe['where']=qs[_0x59c5('0x36')](_[_0x59c5('0x3e')](_0xd6e7a[_0x59c5('0x35')],_0x4e711c[_0x59c5('0x36')]));if(_0xd6e7a[_0x59c5('0x35')]['filter']){_0x3f57fe[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x3f57fe[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0x3f57fe[_0x59c5('0x38')],function(_0x5c2106){var _0x29cd38={};_0x29cd38[_0x5c2106]={'$like':'%'+_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x29cd38;})});}_0x3f57fe=_[_0x59c5('0x41')]({},_0x3f57fe,_0xd6e7a[_0x59c5('0x42')]);return _0x3f9cb3['getSubjects'](_0x3f57fe);}})[_0x59c5('0x26')](function(_0x4757bb){if(_0x4757bb){_0x3a110e=_0x4757bb[_0x59c5('0x48')];if(!_0xd6e7a['query'][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x3f57fe[_0x59c5('0x1e')]=qs['limit'](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x1e')]);_0x3f57fe[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0xd6e7a['query']['offset']);}return _0x3f9cb3[_0x59c5('0x4f')](_0x3f57fe);}})[_0x59c5('0x26')](function(_0x54088d){if(_0x54088d){return _0x54088d?{'count':_0x3a110e,'rows':_0x54088d}:null;}})['then'](respondWithResult(_0x56a6f9,null))[_0x59c5('0x46')](handleError(_0x56a6f9,null));};exports[_0x59c5('0x52')]=function(_0x4e73aa,_0x53db92,_0x35b32a){var _0x360a56={};var _0x2d9f8e={};var _0x48b24e;var _0x4e57c0;return db[_0x59c5('0x2f')][_0x59c5('0x50')]({'where':{'id':_0x4e73aa[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x53db92,null))[_0x59c5('0x26')](function(_0x283a11){if(_0x283a11){_0x48b24e=_0x283a11;_0x2d9f8e[_0x59c5('0x33')]=_['keys'](db[_0x59c5('0x51')][_0x59c5('0x30')]);_0x2d9f8e[_0x59c5('0x35')]=_['keys'](_0x4e73aa[_0x59c5('0x35')]);_0x2d9f8e[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x2d9f8e[_0x59c5('0x33')],_0x2d9f8e[_0x59c5('0x35')]);_0x360a56[_0x59c5('0x38')]=_['intersection'](_0x2d9f8e[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x4e73aa[_0x59c5('0x35')]['fields']));_0x360a56[_0x59c5('0x38')]=_0x360a56[_0x59c5('0x38')]['length']?_0x360a56[_0x59c5('0x38')]:_0x2d9f8e['model'];_0x360a56[_0x59c5('0x3c')]=qs['sort'](_0x4e73aa['query'][_0x59c5('0x3d')]);_0x360a56['where']=qs['filters'](_[_0x59c5('0x3e')](_0x4e73aa[_0x59c5('0x35')],_0x2d9f8e['filters']));if(_0x4e73aa[_0x59c5('0x35')]['filter']){_0x360a56[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x360a56['where'],{'$or':_['map'](_0x360a56['attributes'],function(_0x3f44e2){var _0x3e4208={};_0x3e4208[_0x3f44e2]={'$like':'%'+_0x4e73aa[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x3e4208;})});}_0x360a56=_['merge']({},_0x360a56,_0x4e73aa[_0x59c5('0x42')]);return _0x48b24e[_0x59c5('0x52')](_0x360a56);}})[_0x59c5('0x26')](function(_0x3fcd7f){if(_0x3fcd7f){_0x4e57c0=_0x3fcd7f[_0x59c5('0x48')];if(!_0x4e73aa[_0x59c5('0x35')][_0x59c5('0x3a')]('nolimit')){_0x360a56[_0x59c5('0x1e')]=qs[_0x59c5('0x1e')](_0x4e73aa[_0x59c5('0x35')]['limit']);_0x360a56[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x4e73aa['query'][_0x59c5('0x1c')]);}return _0x48b24e[_0x59c5('0x52')](_0x360a56);}})[_0x59c5('0x26')](function(_0x308f7d){if(_0x308f7d){return _0x308f7d?{'count':_0x4e57c0,'rows':_0x308f7d}:null;}})[_0x59c5('0x26')](respondWithResult(_0x53db92,null))[_0x59c5('0x46')](handleError(_0x53db92,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d74ac25..1d83ae4 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x4b84[_0x57d370];return _0x550fd2;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0xae03ec,_0x126329){var _0x26b415=function(_0x287564){while(--_0x287564){_0xae03ec['push'](_0xae03ec['shift']());}};_0x26b415(++_0x126329);}(_0x70e0,0x17b));var _0x070e=function(_0x523ad4,_0x20f312){_0x523ad4=_0x523ad4-0x0;var _0x16e865=_0x70e0[_0x523ad4];return _0x16e865;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1cd2b6f..f8c6a4d 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 _0x87ac=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0xc2b4c8,_0x756a49){var _0x402443=function(_0x571bae){while(--_0x571bae){_0xc2b4c8['push'](_0xc2b4c8['shift']());}};_0x402443(++_0x756a49);}(_0x87ac,0x1a3));var _0xc87a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x87ac[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xc87a('0x0'));var util=require(_0xc87a('0x1'));var moment=require(_0xc87a('0x2'));var BPromise=require(_0xc87a('0x3'));var rs=require(_0xc87a('0x4'));var fs=require('fs');var Redis=require(_0xc87a('0x5'));var db=require(_0xc87a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc87a('0x7'))(_0xc87a('0x8'));var config=require(_0xc87a('0x9'));var jayson=require(_0xc87a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56a0e5,_0x1089a3,_0x10a92c){return new BPromise(function(_0x1f7646,_0x1c3352){return client[_0xc87a('0xb')](_0x56a0e5,_0x10a92c)[_0xc87a('0xc')](function(_0x312363){logger[_0xc87a('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1089a3,_0xc87a('0xe'));logger[_0xc87a('0xf')](_0xc87a('0x10'),_0x1089a3,'request\x20sent',JSON['stringify'](_0x312363));if(_0x312363[_0xc87a('0x11')]){if(_0x312363['error'][_0xc87a('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1089a3,_0x312363[_0xc87a('0x11')]['message']);return _0x1c3352(_0x312363[_0xc87a('0x11')][_0xc87a('0x13')]);}logger[_0xc87a('0x11')](_0xc87a('0x14'),_0x1089a3,_0x312363[_0xc87a('0x11')][_0xc87a('0x13')]);return _0x1f7646(_0x312363[_0xc87a('0x11')][_0xc87a('0x13')]);}else{logger['info'](_0xc87a('0x14'),_0x1089a3,'request\x20sent');_0x1f7646(_0x312363['result'][_0xc87a('0x13')]);}})[_0xc87a('0x15')](function(_0x2fd7a5){logger[_0xc87a('0x11')](_0xc87a('0x14'),_0x1089a3,_0x2fd7a5);_0x1c3352(_0x2fd7a5);});});} \ No newline at end of file +var _0x4bb9=['info','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x1fbc17,_0xb0627){var _0x2dfec1=function(_0x1593bf){while(--_0x1593bf){_0x1fbc17['push'](_0x1fbc17['shift']());}};_0x2dfec1(++_0xb0627);}(_0x4bb9,0x18e));var _0x94bb=function(_0x476b8b,_0x24942a){_0x476b8b=_0x476b8b-0x0;var _0x5628d2=_0x4bb9[_0x476b8b];return _0x5628d2;};'use strict';var _=require('lodash');var util=require(_0x94bb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94bb('0x1'));var db=require(_0x94bb('0x2'))['db'];var utils=require(_0x94bb('0x3'));var logger=require(_0x94bb('0x4'))(_0x94bb('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x94bb('0x6')][_0x94bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22e496,_0x524fc1,_0x1287a5){return new BPromise(function(_0xe80445,_0x20d597){return client[_0x94bb('0x8')](_0x22e496,_0x1287a5)[_0x94bb('0x9')](function(_0x85670d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x524fc1,_0x94bb('0xa'));logger[_0x94bb('0xb')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x524fc1,_0x94bb('0xa'),JSON[_0x94bb('0xc')](_0x85670d));if(_0x85670d['error']){if(_0x85670d[_0x94bb('0xd')]['code']===0x1f4){logger['error'](_0x94bb('0xe'),_0x524fc1,_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);return _0x20d597(_0x85670d[_0x94bb('0xd')]['message']);}logger[_0x94bb('0xd')](_0x94bb('0xe'),_0x524fc1,_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);return _0xe80445(_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);}else{logger[_0x94bb('0x10')](_0x94bb('0xe'),_0x524fc1,_0x94bb('0xa'));_0xe80445(_0x85670d['result'][_0x94bb('0xf')]);}})[_0x94bb('0x11')](function(_0x5650c3){logger['error'](_0x94bb('0xe'),_0x524fc1,_0x5650c3);_0x20d597(_0x5650c3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 3d0ce87..8400424 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 _0xec6a=['get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x3bcefb,_0x3cffe5){var _0x157a77=function(_0x4e627f){while(--_0x4e627f){_0x3bcefb['push'](_0x3bcefb['shift']());}};_0x157a77(++_0x3cffe5);}(_0xec6a,0x197));var _0xaec6=function(_0x48530c,_0x10edb2){_0x48530c=_0x48530c-0x0;var _0x59ea9e=_0xec6a[_0x48530c];return _0x59ea9e;};'use strict';var multer=require(_0xaec6('0x0'));var util=require(_0xaec6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaec6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaec6('0x3'));var interaction=require(_0xaec6('0x4'));var config=require(_0xaec6('0x5'));var controller=require(_0xaec6('0x6'));router[_0xaec6('0x7')]('/',auth[_0xaec6('0x8')](),controller[_0xaec6('0x9')]);router[_0xaec6('0x7')]('/:id',auth[_0xaec6('0x8')](),controller[_0xaec6('0xa')]);router[_0xaec6('0xb')]('/',auth[_0xaec6('0x8')](),controller[_0xaec6('0xc')]);router[_0xaec6('0xd')](_0xaec6('0xe'),auth['isAuthenticated'](),controller[_0xaec6('0xf')]);router[_0xaec6('0x10')](_0xaec6('0xe'),auth['isAuthenticated'](),controller[_0xaec6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7673=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4b51df,_0x53d013){var _0x534cd6=function(_0x303f87){while(--_0x303f87){_0x4b51df['push'](_0x4b51df['shift']());}};_0x534cd6(++_0x53d013);}(_0x7673,0x6c));var _0x3767=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x7673[_0x5c6244];return _0x5800ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3767('0x0'));var timeout=require(_0x3767('0x1'));var express=require('express');var router=express[_0x3767('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3767('0x3'));var interaction=require(_0x3767('0x4'));var config=require(_0x3767('0x5'));var controller=require('./intDynamics365Field.controller');router[_0x3767('0x6')]('/',auth[_0x3767('0x7')](),controller[_0x3767('0x8')]);router[_0x3767('0x6')](_0x3767('0x9'),auth[_0x3767('0x7')](),controller['show']);router[_0x3767('0xa')]('/',auth[_0x3767('0x7')](),controller[_0x3767('0xb')]);router['put'](_0x3767('0x9'),auth[_0x3767('0x7')](),controller[_0x3767('0xc')]);router[_0x3767('0xd')](_0x3767('0x9'),auth[_0x3767('0x7')](),controller[_0x3767('0xe')]);module[_0x3767('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 490c423..0d4ba85 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 _0x0152=['sequelize','exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN'];(function(_0x497c93,_0xa38304){var _0x1a95bb=function(_0x47636f){while(--_0x47636f){_0x497c93['push'](_0x497c93['shift']());}};_0x1a95bb(++_0xa38304);}(_0x0152,0xcf));var _0x2015=function(_0x50b164,_0x55e6da){_0x50b164=_0x50b164-0x0;var _0xa550cd=_0x0152[_0x50b164];return _0xa550cd;};'use strict';var Sequelize=require(_0x2015('0x0'));module[_0x2015('0x1')]={'type':{'type':Sequelize[_0x2015('0x2')](_0x2015('0x3'),'variable',_0x2015('0x4'),'keyValue',_0x2015('0x5')),'defaultValue':_0x2015('0x3')},'content':{'type':Sequelize[_0x2015('0x6')]},'key':{'type':Sequelize[_0x2015('0x6')]},'keyType':{'type':Sequelize[_0x2015('0x2')](_0x2015('0x3'),_0x2015('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x2015('0x6')]},'idField':{'type':Sequelize[_0x2015('0x6')]},'nameField':{'type':Sequelize[_0x2015('0x6')]},'customField':{'type':Sequelize[_0x2015('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6347=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x6347,0x73));var _0x7634=function(_0xa0cdfe,_0x230408){_0xa0cdfe=_0xa0cdfe-0x0;var _0x17470b=_0x6347[_0xa0cdfe];return _0x17470b;};'use strict';var Sequelize=require(_0x7634('0x0'));module[_0x7634('0x1')]={'type':{'type':Sequelize[_0x7634('0x2')](_0x7634('0x3'),_0x7634('0x4'),_0x7634('0x5'),_0x7634('0x6'),_0x7634('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7634('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7634('0x3'),_0x7634('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7634('0x8')]},'nameField':{'type':Sequelize[_0x7634('0x8')]},'customField':{'type':Sequelize[_0x7634('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7634('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d7cef9e..8c35536 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 _0x7dde=['model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','findAll','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','save','then','destroy','error','stack','name','send','index','map','Dynamics365Field','type','key','query','keys','filters'];(function(_0x57da40,_0x5236cd){var _0x2b84b2=function(_0x3d1d8e){while(--_0x3d1d8e){_0x57da40['push'](_0x57da40['shift']());}};_0x2b84b2(++_0x5236cd);}(_0x7dde,0xe5));var _0xe7dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dde[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe7dd('0x0'));var rimraf=require(_0xe7dd('0x1'));var zipdir=require(_0xe7dd('0x2'));var jsonpatch=require(_0xe7dd('0x3'));var rp=require(_0xe7dd('0x4'));var moment=require(_0xe7dd('0x5'));var BPromise=require(_0xe7dd('0x6'));var Mustache=require('mustache');var util=require(_0xe7dd('0x7'));var path=require(_0xe7dd('0x8'));var sox=require(_0xe7dd('0x9'));var csv=require('to-csv');var ejs=require(_0xe7dd('0xa'));var fs=require('fs');var fs_extra=require(_0xe7dd('0xb'));var _=require(_0xe7dd('0xc'));var squel=require('squel');var crypto=require(_0xe7dd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe7dd('0xe'));var toCsv=require(_0xe7dd('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7dd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7dd('0x11'));var logger=require('../../config/logger')(_0xe7dd('0x12'));var utils=require(_0xe7dd('0x13'));var config=require(_0xe7dd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7dd('0x15'))['db'];function respondWithStatusCode(_0x4c551e,_0x2e8de5){_0x2e8de5=_0x2e8de5||0xcc;return function(_0x3961eb){if(_0x3961eb){return _0x4c551e[_0xe7dd('0x16')](_0x2e8de5);}return _0x4c551e['status'](_0x2e8de5)[_0xe7dd('0x17')]();};}function respondWithResult(_0x2ef351,_0x185ed3){_0x185ed3=_0x185ed3||0xc8;return function(_0x25d38f){if(_0x25d38f){return _0x2ef351[_0xe7dd('0x18')](_0x185ed3)['json'](_0x25d38f);}};}function respondWithFilteredResult(_0x44b894,_0x2b049c){return function(_0x5602e2){if(_0x5602e2){var _0x41eff6=typeof _0x2b049c[_0xe7dd('0x19')]===_0xe7dd('0x1a')&&typeof _0x2b049c[_0xe7dd('0x1b')]==='undefined';var _0x459270=_0x5602e2[_0xe7dd('0x1c')];var _0x55ae8d=_0x41eff6?0x0:_0x2b049c[_0xe7dd('0x19')];var _0x30b262=_0x41eff6?_0x5602e2['count']:_0x2b049c[_0xe7dd('0x19')]+_0x2b049c[_0xe7dd('0x1b')];var _0x540e87;if(_0x30b262>=_0x459270){_0x30b262=_0x459270;_0x540e87=0xc8;}else{_0x540e87=0xce;}_0x44b894[_0xe7dd('0x18')](_0x540e87);return _0x44b894[_0xe7dd('0x1d')]('Content-Range',_0x55ae8d+'-'+_0x30b262+'/'+_0x459270)[_0xe7dd('0x1e')](_0x5602e2);}return null;};}function patchUpdates(_0x58d13b){return function(_0x79a360){try{jsonpatch[_0xe7dd('0x1f')](_0x79a360,_0x58d13b,!![]);}catch(_0x37b2f9){return BPromise['reject'](_0x37b2f9);}return _0x79a360[_0xe7dd('0x20')]();};}function saveUpdates(_0x3d6e38,_0x310632){return function(_0x380d53){if(_0x380d53){return _0x380d53['update'](_0x3d6e38)[_0xe7dd('0x21')](function(_0x28f305){return _0x28f305;});}return null;};}function removeEntity(_0x170a2d,_0x1ef01d){return function(_0x49309d){if(_0x49309d){return _0x49309d[_0xe7dd('0x22')]()[_0xe7dd('0x21')](function(){_0x170a2d[_0xe7dd('0x18')](0xcc)[_0xe7dd('0x17')]();});}};}function handleEntityNotFound(_0x3d9b92,_0x4c4409){return function(_0x22874a){if(!_0x22874a){_0x3d9b92['sendStatus'](0x194);}return _0x22874a;};}function handleError(_0x11fce0,_0x1c93d8){_0x1c93d8=_0x1c93d8||0x1f4;return function(_0x5a8fc4){logger[_0xe7dd('0x23')](_0x5a8fc4[_0xe7dd('0x24')]);if(_0x5a8fc4[_0xe7dd('0x25')]){delete _0x5a8fc4[_0xe7dd('0x25')];}_0x11fce0['status'](_0x1c93d8)[_0xe7dd('0x26')](_0x5a8fc4);};}exports[_0xe7dd('0x27')]=function(_0x396f3f,_0x410173){var _0x2349c2={},_0x29beb4={},_0xb4abbc={'count':0x0,'rows':[]};var _0x2d402e=_[_0xe7dd('0x28')](db[_0xe7dd('0x29')]['rawAttributes'],function(_0x35a918){return{'name':_0x35a918['fieldName'],'type':_0x35a918[_0xe7dd('0x2a')][_0xe7dd('0x2b')]};});_0x29beb4['model']=_[_0xe7dd('0x28')](_0x2d402e,_0xe7dd('0x25'));_0x29beb4[_0xe7dd('0x2c')]=_[_0xe7dd('0x2d')](_0x396f3f[_0xe7dd('0x2c')]);_0x29beb4[_0xe7dd('0x2e')]=_['intersection'](_0x29beb4[_0xe7dd('0x2f')],_0x29beb4[_0xe7dd('0x2c')]);_0x2349c2[_0xe7dd('0x30')]=_[_0xe7dd('0x31')](_0x29beb4['model'],qs[_0xe7dd('0x32')](_0x396f3f['query']['fields']));_0x2349c2[_0xe7dd('0x30')]=_0x2349c2[_0xe7dd('0x30')][_0xe7dd('0x33')]?_0x2349c2[_0xe7dd('0x30')]:_0x29beb4[_0xe7dd('0x2f')];if(!_0x396f3f[_0xe7dd('0x2c')][_0xe7dd('0x34')](_0xe7dd('0x35'))){_0x2349c2['limit']=qs['limit'](_0x396f3f[_0xe7dd('0x2c')][_0xe7dd('0x1b')]);_0x2349c2[_0xe7dd('0x19')]=qs[_0xe7dd('0x19')](_0x396f3f[_0xe7dd('0x2c')][_0xe7dd('0x19')]);}_0x2349c2['order']=qs[_0xe7dd('0x36')](_0x396f3f['query'][_0xe7dd('0x36')]);_0x2349c2[_0xe7dd('0x37')]=qs['filters'](_[_0xe7dd('0x38')](_0x396f3f['query'],_0x29beb4[_0xe7dd('0x2e')]),_0x2d402e);if(_0x396f3f[_0xe7dd('0x2c')]['filter']){_0x2349c2[_0xe7dd('0x37')]=_[_0xe7dd('0x39')](_0x2349c2[_0xe7dd('0x37')],{'$or':_[_0xe7dd('0x28')](_0x2d402e,function(_0xda19dc){if(_0xda19dc[_0xe7dd('0x2a')]!=='VIRTUAL'){var _0xa4bf48={};_0xa4bf48[_0xda19dc[_0xe7dd('0x25')]]={'$like':'%'+_0x396f3f[_0xe7dd('0x2c')][_0xe7dd('0x3a')]+'%'};return _0xa4bf48;}})});}_0x2349c2=_[_0xe7dd('0x39')]({},_0x2349c2,_0x396f3f['options']);var _0x8d0feb={'where':_0x2349c2['where']};return db[_0xe7dd('0x29')][_0xe7dd('0x1c')](_0x8d0feb)['then'](function(_0x205b92){_0xb4abbc['count']=_0x205b92;if(_0x396f3f[_0xe7dd('0x2c')][_0xe7dd('0x3b')]){_0x2349c2[_0xe7dd('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xe7dd('0x3d')](_0x2349c2);})[_0xe7dd('0x21')](function(_0xdb5b12){_0xb4abbc['rows']=_0xdb5b12;return _0xb4abbc;})[_0xe7dd('0x21')](respondWithFilteredResult(_0x410173,_0x2349c2))['catch'](handleError(_0x410173,null));};exports[_0xe7dd('0x3e')]=function(_0x52b684,_0x9f8c7b){var _0x3d7e7b={'raw':!![],'where':{'id':_0x52b684[_0xe7dd('0x3f')]['id']}},_0x35d0bd={};_0x35d0bd[_0xe7dd('0x2f')]=_[_0xe7dd('0x2d')](db['Dynamics365Field']['rawAttributes']);_0x35d0bd[_0xe7dd('0x2c')]=_[_0xe7dd('0x2d')](_0x52b684['query']);_0x35d0bd[_0xe7dd('0x2e')]=_[_0xe7dd('0x31')](_0x35d0bd[_0xe7dd('0x2f')],_0x35d0bd[_0xe7dd('0x2c')]);_0x3d7e7b['attributes']=_['intersection'](_0x35d0bd[_0xe7dd('0x2f')],qs[_0xe7dd('0x32')](_0x52b684[_0xe7dd('0x2c')]['fields']));_0x3d7e7b[_0xe7dd('0x30')]=_0x3d7e7b['attributes'][_0xe7dd('0x33')]?_0x3d7e7b['attributes']:_0x35d0bd['model'];if(_0x52b684['query'][_0xe7dd('0x3b')]){_0x3d7e7b[_0xe7dd('0x3c')]=[{'all':!![]}];}_0x3d7e7b=_[_0xe7dd('0x39')]({},_0x3d7e7b,_0x52b684['options']);return db['Dynamics365Field'][_0xe7dd('0x40')](_0x3d7e7b)[_0xe7dd('0x21')](handleEntityNotFound(_0x9f8c7b,null))['then'](respondWithResult(_0x9f8c7b,null))[_0xe7dd('0x41')](handleError(_0x9f8c7b,null));};exports[_0xe7dd('0x42')]=function(_0x1d94bd,_0x21ce72){return db['Dynamics365Field'][_0xe7dd('0x42')](_0x1d94bd[_0xe7dd('0x43')],{})[_0xe7dd('0x21')](respondWithResult(_0x21ce72,0xc9))[_0xe7dd('0x41')](handleError(_0x21ce72,null));};exports[_0xe7dd('0x44')]=function(_0x4ee14b,_0x1b6617){if(_0x4ee14b['body']['id']){delete _0x4ee14b[_0xe7dd('0x43')]['id'];}return db[_0xe7dd('0x29')]['find']({'where':{'id':_0x4ee14b[_0xe7dd('0x3f')]['id']}})[_0xe7dd('0x21')](handleEntityNotFound(_0x1b6617,null))['then'](saveUpdates(_0x4ee14b[_0xe7dd('0x43')],null))[_0xe7dd('0x21')](respondWithResult(_0x1b6617,null))[_0xe7dd('0x41')](handleError(_0x1b6617,null));};exports[_0xe7dd('0x22')]=function(_0x380d0f,_0x6c4622){return db[_0xe7dd('0x29')]['find']({'where':{'id':_0x380d0f[_0xe7dd('0x3f')]['id']}})[_0xe7dd('0x21')](handleEntityNotFound(_0x6c4622,null))[_0xe7dd('0x21')](removeEntity(_0x6c4622,null))[_0xe7dd('0x41')](handleError(_0x6c4622,null));}; \ No newline at end of file +var _0xd8a5=['stack','name','Dynamics365Field','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x2fb437,_0x24d8c7){var _0x431640=function(_0x23bf0e){while(--_0x23bf0e){_0x2fb437['push'](_0x2fb437['shift']());}};_0x431640(++_0x24d8c7);}(_0xd8a5,0x195));var _0x5d8a=function(_0xc0b795,_0x462a55){_0xc0b795=_0xc0b795-0x0;var _0x3500ed=_0xd8a5[_0xc0b795];return _0x3500ed;};'use strict';var emlformat=require(_0x5d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x1'));var jsonpatch=require(_0x5d8a('0x2'));var rp=require(_0x5d8a('0x3'));var moment=require(_0x5d8a('0x4'));var BPromise=require(_0x5d8a('0x5'));var Mustache=require('mustache');var util=require(_0x5d8a('0x6'));var path=require(_0x5d8a('0x7'));var sox=require(_0x5d8a('0x8'));var csv=require(_0x5d8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d8a('0xa'));var _=require(_0x5d8a('0xb'));var squel=require(_0x5d8a('0xc'));var crypto=require(_0x5d8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5d8a('0xe'));var toCsv=require(_0x5d8a('0x9'));var querystring=require('querystring');var Papa=require(_0x5d8a('0xf'));var Redis=require(_0x5d8a('0x10'));var authService=require(_0x5d8a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8a('0x12'));var hardwareService=require(_0x5d8a('0x13'));var logger=require(_0x5d8a('0x14'))(_0x5d8a('0x15'));var utils=require(_0x5d8a('0x16'));var config=require(_0x5d8a('0x17'));var licenseUtil=require(_0x5d8a('0x18'));var db=require(_0x5d8a('0x19'))['db'];function respondWithStatusCode(_0x22000e,_0x31eae5){_0x31eae5=_0x31eae5||0xcc;return function(_0x37c2c8){if(_0x37c2c8){return _0x22000e[_0x5d8a('0x1a')](_0x31eae5);}return _0x22000e[_0x5d8a('0x1b')](_0x31eae5)[_0x5d8a('0x1c')]();};}function respondWithResult(_0xa15b6,_0x3fcb62){_0x3fcb62=_0x3fcb62||0xc8;return function(_0x107e37){if(_0x107e37){return _0xa15b6[_0x5d8a('0x1b')](_0x3fcb62)['json'](_0x107e37);}};}function respondWithFilteredResult(_0x3c43b3,_0x484a00){return function(_0x5386f2){if(_0x5386f2){var _0x756ee9=typeof _0x484a00[_0x5d8a('0x1d')]===_0x5d8a('0x1e')&&typeof _0x484a00[_0x5d8a('0x1f')]===_0x5d8a('0x1e');var _0xe00dae=_0x5386f2[_0x5d8a('0x20')];var _0x2c7e3e=_0x756ee9?0x0:_0x484a00[_0x5d8a('0x1d')];var _0x150f96=_0x756ee9?_0x5386f2[_0x5d8a('0x20')]:_0x484a00[_0x5d8a('0x1d')]+_0x484a00['limit'];var _0x1fca20;if(_0x150f96>=_0xe00dae){_0x150f96=_0xe00dae;_0x1fca20=0xc8;}else{_0x1fca20=0xce;}_0x3c43b3['status'](_0x1fca20);return _0x3c43b3['set'](_0x5d8a('0x21'),_0x2c7e3e+'-'+_0x150f96+'/'+_0xe00dae)['json'](_0x5386f2);}return null;};}function patchUpdates(_0x2a862b){return function(_0x41f67a){try{jsonpatch[_0x5d8a('0x22')](_0x41f67a,_0x2a862b,!![]);}catch(_0x3be05b){return BPromise[_0x5d8a('0x23')](_0x3be05b);}return _0x41f67a[_0x5d8a('0x24')]();};}function saveUpdates(_0x454871,_0x40bb96){return function(_0x394b2a){if(_0x394b2a){return _0x394b2a[_0x5d8a('0x25')](_0x454871)[_0x5d8a('0x26')](function(_0x3916de){return _0x3916de;});}return null;};}function removeEntity(_0x240c92,_0x84b9ed){return function(_0x5612d1){if(_0x5612d1){return _0x5612d1['destroy']()['then'](function(){_0x240c92[_0x5d8a('0x1b')](0xcc)[_0x5d8a('0x1c')]();});}};}function handleEntityNotFound(_0x444b4d,_0x22eeb0){return function(_0x20fba2){if(!_0x20fba2){_0x444b4d['sendStatus'](0x194);}return _0x20fba2;};}function handleError(_0x43d7d6,_0x383a85){_0x383a85=_0x383a85||0x1f4;return function(_0x425ee7){logger['error'](_0x425ee7[_0x5d8a('0x27')]);if(_0x425ee7['name']){delete _0x425ee7[_0x5d8a('0x28')];}_0x43d7d6[_0x5d8a('0x1b')](_0x383a85)['send'](_0x425ee7);};}exports['index']=function(_0x4f7d2e,_0x329742){var _0x51fa65={},_0x1c8f78={},_0x4a68e2={'count':0x0,'rows':[]};var _0x9d5eaf=_['map'](db[_0x5d8a('0x29')][_0x5d8a('0x2a')],function(_0x234b84){return{'name':_0x234b84[_0x5d8a('0x2b')],'type':_0x234b84['type'][_0x5d8a('0x2c')]};});_0x1c8f78[_0x5d8a('0x2d')]=_[_0x5d8a('0x2e')](_0x9d5eaf,_0x5d8a('0x28'));_0x1c8f78['query']=_[_0x5d8a('0x2f')](_0x4f7d2e[_0x5d8a('0x30')]);_0x1c8f78[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](_0x1c8f78[_0x5d8a('0x2d')],_0x1c8f78[_0x5d8a('0x30')]);_0x51fa65[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x1c8f78[_0x5d8a('0x2d')],qs[_0x5d8a('0x34')](_0x4f7d2e['query']['fields']));_0x51fa65[_0x5d8a('0x33')]=_0x51fa65[_0x5d8a('0x33')][_0x5d8a('0x35')]?_0x51fa65[_0x5d8a('0x33')]:_0x1c8f78[_0x5d8a('0x2d')];if(!_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x36')](_0x5d8a('0x37'))){_0x51fa65[_0x5d8a('0x1f')]=qs['limit'](_0x4f7d2e[_0x5d8a('0x30')]['limit']);_0x51fa65[_0x5d8a('0x1d')]=qs[_0x5d8a('0x1d')](_0x4f7d2e[_0x5d8a('0x30')]['offset']);}_0x51fa65[_0x5d8a('0x38')]=qs[_0x5d8a('0x39')](_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x39')]);_0x51fa65[_0x5d8a('0x3a')]=qs[_0x5d8a('0x31')](_['pick'](_0x4f7d2e['query'],_0x1c8f78[_0x5d8a('0x31')]),_0x9d5eaf);if(_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x3b')]){_0x51fa65[_0x5d8a('0x3a')]=_[_0x5d8a('0x3c')](_0x51fa65['where'],{'$or':_[_0x5d8a('0x2e')](_0x9d5eaf,function(_0x2c8b8d){if(_0x2c8b8d[_0x5d8a('0x3d')]!==_0x5d8a('0x3e')){var _0x3784c8={};_0x3784c8[_0x2c8b8d[_0x5d8a('0x28')]]={'$like':'%'+_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x3b')]+'%'};return _0x3784c8;}})});}_0x51fa65=_[_0x5d8a('0x3c')]({},_0x51fa65,_0x4f7d2e[_0x5d8a('0x3f')]);var _0x49829a={'where':_0x51fa65[_0x5d8a('0x3a')]};return db[_0x5d8a('0x29')][_0x5d8a('0x20')](_0x49829a)[_0x5d8a('0x26')](function(_0x4edc65){_0x4a68e2['count']=_0x4edc65;if(_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x40')]){_0x51fa65[_0x5d8a('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x51fa65);})['then'](function(_0x5ab7a7){_0x4a68e2[_0x5d8a('0x42')]=_0x5ab7a7;return _0x4a68e2;})[_0x5d8a('0x26')](respondWithFilteredResult(_0x329742,_0x51fa65))[_0x5d8a('0x43')](handleError(_0x329742,null));};exports[_0x5d8a('0x44')]=function(_0x111e71,_0x5e12f0){var _0x2e012b={'raw':!![],'where':{'id':_0x111e71['params']['id']}},_0x494f8f={};_0x494f8f[_0x5d8a('0x2d')]=_[_0x5d8a('0x2f')](db[_0x5d8a('0x29')][_0x5d8a('0x2a')]);_0x494f8f[_0x5d8a('0x30')]=_[_0x5d8a('0x2f')](_0x111e71['query']);_0x494f8f[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](_0x494f8f[_0x5d8a('0x2d')],_0x494f8f[_0x5d8a('0x30')]);_0x2e012b[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x494f8f['model'],qs[_0x5d8a('0x34')](_0x111e71[_0x5d8a('0x30')]['fields']));_0x2e012b[_0x5d8a('0x33')]=_0x2e012b[_0x5d8a('0x33')][_0x5d8a('0x35')]?_0x2e012b[_0x5d8a('0x33')]:_0x494f8f[_0x5d8a('0x2d')];if(_0x111e71['query']['includeAll']){_0x2e012b[_0x5d8a('0x41')]=[{'all':!![]}];}_0x2e012b=_['merge']({},_0x2e012b,_0x111e71[_0x5d8a('0x3f')]);return db['Dynamics365Field'][_0x5d8a('0x45')](_0x2e012b)['then'](handleEntityNotFound(_0x5e12f0,null))[_0x5d8a('0x26')](respondWithResult(_0x5e12f0,null))[_0x5d8a('0x43')](handleError(_0x5e12f0,null));};exports[_0x5d8a('0x46')]=function(_0x3ec3e1,_0x27c0e9){return db['Dynamics365Field'][_0x5d8a('0x46')](_0x3ec3e1[_0x5d8a('0x47')],{})[_0x5d8a('0x26')](respondWithResult(_0x27c0e9,0xc9))['catch'](handleError(_0x27c0e9,null));};exports['update']=function(_0x1401e2,_0x2386b5){if(_0x1401e2[_0x5d8a('0x47')]['id']){delete _0x1401e2[_0x5d8a('0x47')]['id'];}return db[_0x5d8a('0x29')]['find']({'where':{'id':_0x1401e2[_0x5d8a('0x48')]['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x2386b5,null))[_0x5d8a('0x26')](saveUpdates(_0x1401e2[_0x5d8a('0x47')],null))['then'](respondWithResult(_0x2386b5,null))['catch'](handleError(_0x2386b5,null));};exports[_0x5d8a('0x49')]=function(_0x5301df,_0x5709ca){return db[_0x5d8a('0x29')][_0x5d8a('0x45')]({'where':{'id':_0x5301df['params']['id']}})['then'](handleEntityNotFound(_0x5709ca,null))['then'](removeEntity(_0x5709ca,null))[_0x5d8a('0x43')](handleError(_0x5709ca,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index cf3c7d5..1e02e9e 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 _0x7c60=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x3de9f8,_0x4ee56c){var _0x27b4d9=function(_0x1b370e){while(--_0x1b370e){_0x3de9f8['push'](_0x3de9f8['shift']());}};_0x27b4d9(++_0x4ee56c);}(_0x7c60,0x1e1));var _0x07c6=function(_0x55191e,_0x237ec0){_0x55191e=_0x55191e-0x0;var _0x1dff93=_0x7c60[_0x55191e];return _0x1dff93;};'use strict';var _=require(_0x07c6('0x0'));var util=require(_0x07c6('0x1'));var logger=require(_0x07c6('0x2'))(_0x07c6('0x3'));var moment=require(_0x07c6('0x4'));var BPromise=require(_0x07c6('0x5'));var rp=require(_0x07c6('0x6'));var fs=require('fs');var path=require(_0x07c6('0x7'));var rimraf=require(_0x07c6('0x8'));var config=require(_0x07c6('0x9'));var attributes=require(_0x07c6('0xa'));module[_0x07c6('0xb')]=function(_0x1286be,_0x2ac290){return _0x1286be['define'](_0x07c6('0xc'),attributes,{'tableName':_0x07c6('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x07c6('0xe'),_0x07c6('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b06=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','FieldId','lodash','util','../../config/logger','bluebird','path'];(function(_0x4966de,_0x3fd693){var _0x246ba4=function(_0xc3f481){while(--_0xc3f481){_0x4966de['push'](_0x4966de['shift']());}};_0x246ba4(++_0x3fd693);}(_0x7b06,0x1b7));var _0x67b0=function(_0x502c83,_0x1db15d){_0x502c83=_0x502c83-0x0;var _0x40dd62=_0x7b06[_0x502c83];return _0x40dd62;};'use strict';var _=require(_0x67b0('0x0'));var util=require(_0x67b0('0x1'));var logger=require(_0x67b0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x67b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67b0('0x4'));var rimraf=require(_0x67b0('0x5'));var config=require(_0x67b0('0x6'));var attributes=require(_0x67b0('0x7'));module[_0x67b0('0x8')]=function(_0x3c54fc,_0x1e634d){return _0x3c54fc[_0x67b0('0x9')](_0x67b0('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x67b0('0xb')],'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 7d74747..53802eb 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 _0xfde1=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x420ff7,_0xa38f2a){var _0x4d5543=function(_0x2779a4){while(--_0x2779a4){_0x420ff7['push'](_0x420ff7['shift']());}};_0x4d5543(++_0xa38f2a);}(_0xfde1,0x67));var _0x1fde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfde1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1fde('0x0'));var util=require(_0x1fde('0x1'));var moment=require(_0x1fde('0x2'));var BPromise=require(_0x1fde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fde('0x4'))['db'];var utils=require(_0x1fde('0x5'));var logger=require(_0x1fde('0x6'))(_0x1fde('0x7'));var config=require(_0x1fde('0x8'));var jayson=require(_0x1fde('0x9'));var client=jayson[_0x1fde('0xa')][_0x1fde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27cda4,_0x2e8f5c,_0xe0071a){return new BPromise(function(_0x4d7389,_0x1acaf9){return client[_0x1fde('0xc')](_0x27cda4,_0xe0071a)[_0x1fde('0xd')](function(_0x25eff8){logger[_0x1fde('0xe')](_0x1fde('0xf'),_0x2e8f5c,'request\x20sent');logger['debug'](_0x1fde('0x10'),_0x2e8f5c,_0x1fde('0x11'),JSON[_0x1fde('0x12')](_0x25eff8));if(_0x25eff8[_0x1fde('0x13')]){if(_0x25eff8[_0x1fde('0x13')][_0x1fde('0x14')]===0x1f4){logger[_0x1fde('0x13')](_0x1fde('0xf'),_0x2e8f5c,_0x25eff8['error']['message']);return _0x1acaf9(_0x25eff8[_0x1fde('0x13')]['message']);}logger[_0x1fde('0x13')](_0x1fde('0xf'),_0x2e8f5c,_0x25eff8[_0x1fde('0x13')][_0x1fde('0x15')]);return _0x4d7389(_0x25eff8[_0x1fde('0x13')]['message']);}else{logger['info'](_0x1fde('0xf'),_0x2e8f5c,_0x1fde('0x11'));_0x4d7389(_0x25eff8[_0x1fde('0x16')][_0x1fde('0x15')]);}})[_0x1fde('0x17')](function(_0x4112e3){logger['error'](_0x1fde('0xf'),_0x2e8f5c,_0x4112e3);_0x1acaf9(_0x4112e3);});});} \ No newline at end of file +var _0x9a3d=['jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x46fb90,_0x520dd1){var _0x445119=function(_0x2c2da5){while(--_0x2c2da5){_0x46fb90['push'](_0x46fb90['shift']());}};_0x445119(++_0x520dd1);}(_0x9a3d,0x184));var _0xd9a3=function(_0x533e21,_0x5ae9df){_0x533e21=_0x533e21-0x0;var _0x4ee9ec=_0x9a3d[_0x533e21];return _0x4ee9ec;};'use strict';var _=require(_0xd9a3('0x0'));var util=require(_0xd9a3('0x1'));var moment=require('moment');var BPromise=require(_0xd9a3('0x2'));var rs=require(_0xd9a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9a3('0x5'))(_0xd9a3('0x6'));var config=require(_0xd9a3('0x7'));var jayson=require(_0xd9a3('0x8'));var client=jayson[_0xd9a3('0x9')][_0xd9a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b1216,_0x435749,_0x50046f){return new BPromise(function(_0x377c63,_0x577768){return client[_0xd9a3('0xb')](_0x4b1216,_0x50046f)['then'](function(_0x2a3355){logger[_0xd9a3('0xc')](_0xd9a3('0xd'),_0x435749,'request\x20sent');logger[_0xd9a3('0xe')](_0xd9a3('0xf'),_0x435749,_0xd9a3('0x10'),JSON[_0xd9a3('0x11')](_0x2a3355));if(_0x2a3355[_0xd9a3('0x12')]){if(_0x2a3355['error'][_0xd9a3('0x13')]===0x1f4){logger[_0xd9a3('0x12')](_0xd9a3('0xd'),_0x435749,_0x2a3355['error']['message']);return _0x577768(_0x2a3355[_0xd9a3('0x12')]['message']);}logger['error'](_0xd9a3('0xd'),_0x435749,_0x2a3355[_0xd9a3('0x12')]['message']);return _0x377c63(_0x2a3355[_0xd9a3('0x12')]['message']);}else{logger['info'](_0xd9a3('0xd'),_0x435749,_0xd9a3('0x10'));_0x377c63(_0x2a3355[_0xd9a3('0x14')][_0xd9a3('0x15')]);}})['catch'](function(_0x1fdfa1){logger[_0xd9a3('0x12')](_0xd9a3('0xd'),_0x435749,_0x1fdfa1);_0x577768(_0x1fdfa1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c9b09ea..85ec6d8 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 _0xac0f=['create','post','put','/:id','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','/:id/configurations','get','/:id/fields'];(function(_0x3cbb4d,_0x1f993a){var _0x6ae803=function(_0x97e6ea){while(--_0x97e6ea){_0x3cbb4d['push'](_0x3cbb4d['shift']());}};_0x6ae803(++_0x1f993a);}(_0xac0f,0x84));var _0xfac0=function(_0x39868e,_0x4b6da9){_0x39868e=_0x39868e-0x0;var _0x4eadec=_0xac0f[_0x39868e];return _0x4eadec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfac0('0x0'));var timeout=require('connect-timeout');var express=require(_0xfac0('0x1'));var router=express[_0xfac0('0x2')]();var fs_extra=require(_0xfac0('0x3'));var auth=require(_0xfac0('0x4'));var interaction=require(_0xfac0('0x5'));var config=require(_0xfac0('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xfac0('0x7')](),controller[_0xfac0('0x8')]);router['get'](_0xfac0('0x9'),auth[_0xfac0('0x7')](),controller['getConfigurations']);router[_0xfac0('0xa')](_0xfac0('0xb'),auth[_0xfac0('0x7')](),controller['getFields']);router['post']('/',auth[_0xfac0('0x7')](),controller[_0xfac0('0xc')]);router[_0xfac0('0xd')](_0xfac0('0x9'),auth[_0xfac0('0x7')](),controller['addConfiguration']);router[_0xfac0('0xe')](_0xfac0('0xf'),auth[_0xfac0('0x7')](),controller['update']);router[_0xfac0('0x10')](_0xfac0('0xf'),auth[_0xfac0('0x7')](),controller[_0xfac0('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf539=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration'];(function(_0x3b7e9c,_0x2771b2){var _0x1b0cf5=function(_0x2142a0){while(--_0x2142a0){_0x3b7e9c['push'](_0x3b7e9c['shift']());}};_0x1b0cf5(++_0x2771b2);}(_0xf539,0x7d));var _0x9f53=function(_0x373b5f,_0x3491ba){_0x373b5f=_0x373b5f-0x0;var _0x2b8d68=_0xf539[_0x373b5f];return _0x2b8d68;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require('path');var timeout=require(_0x9f53('0x2'));var express=require(_0x9f53('0x3'));var router=express[_0x9f53('0x4')]();var fs_extra=require(_0x9f53('0x5'));var auth=require(_0x9f53('0x6'));var interaction=require(_0x9f53('0x7'));var config=require('../../config/environment');var controller=require(_0x9f53('0x8'));router[_0x9f53('0x9')]('/',auth[_0x9f53('0xa')](),controller[_0x9f53('0xb')]);router['get'](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0xd')]);router[_0x9f53('0x9')](_0x9f53('0xe'),auth[_0x9f53('0xa')](),controller['getConfigurations']);router['get'](_0x9f53('0xf'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9f53('0x12')]);router[_0x9f53('0x13')](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0x14')]);router[_0x9f53('0x15')](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0x16')]);module[_0x9f53('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index e645880..8bae5e1 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 _0x958a=['sequelize','exports','STRING','username'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x958a,0x128));var _0xa958=function(_0xb0d0cb,_0x132050){_0xb0d0cb=_0xb0d0cb-0x0;var _0x403a93=_0x958a[_0xb0d0cb];return _0x403a93;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['STRING','username','exports'];(function(_0x2b9621,_0x5b4cff){var _0x76ebfb=function(_0x1bd8c0){while(--_0x1bd8c0){_0x2b9621['push'](_0x2b9621['shift']());}};_0x76ebfb(++_0x5b4cff);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65f6('0x1')]},'username':{'type':Sequelize[_0x65f6('0x1')],'unique':_0x65f6('0x2')},'apiKey':{'type':Sequelize[_0x65f6('0x1')]},'remoteUri':{'type':Sequelize[_0x65f6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x65f6('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 41febd1..f6ffaec 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 _0x9c02=['error','send','map','FreshdeskAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','catch','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','getFields','apiKey','remoteUri','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','remove','default','custom_text','custom_dropdown','label','choices','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','mustache','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x55abea,_0xa4eaf9){var _0x4c7bed=function(_0x4f246e){while(--_0x4f246e){_0x55abea['push'](_0x55abea['shift']());}};_0x4c7bed(++_0xa4eaf9);}(_0x9c02,0x196));var _0x29c0=function(_0x42661b,_0x2de416){_0x42661b=_0x42661b-0x0;var _0x28a416=_0x9c02[_0x42661b];return _0x28a416;};'use strict';var emlformat=require(_0x29c0('0x0'));var rimraf=require(_0x29c0('0x1'));var zipdir=require(_0x29c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29c0('0x3'));var util=require('util');var path=require(_0x29c0('0x4'));var sox=require('sox');var csv=require(_0x29c0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29c0('0x6'));var _=require(_0x29c0('0x7'));var squel=require(_0x29c0('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x29c0('0x9'));var toCsv=require(_0x29c0('0x5'));var querystring=require(_0x29c0('0xa'));var Papa=require(_0x29c0('0xb'));var Redis=require(_0x29c0('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x29c0('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29c0('0xe'))(_0x29c0('0xf'));var utils=require(_0x29c0('0x10'));var config=require(_0x29c0('0x11'));var licenseUtil=require(_0x29c0('0x12'));var db=require(_0x29c0('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x7a6a5e,_0x350922){_0x350922=_0x350922||0xcc;return function(_0x7f4922){if(_0x7f4922){return _0x7a6a5e[_0x29c0('0x14')](_0x350922);}return _0x7a6a5e[_0x29c0('0x15')](_0x350922)[_0x29c0('0x16')]();};}function respondWithResult(_0x1e622a,_0x2947da){_0x2947da=_0x2947da||0xc8;return function(_0x50025f){if(_0x50025f){return _0x1e622a[_0x29c0('0x15')](_0x2947da)[_0x29c0('0x17')](_0x50025f);}};}function respondWithFilteredResult(_0xccb222,_0x235725){return function(_0x1ce122){if(_0x1ce122){var _0x5c1163=typeof _0x235725[_0x29c0('0x18')]===_0x29c0('0x19')&&typeof _0x235725[_0x29c0('0x1a')]===_0x29c0('0x19');var _0x2f6da1=_0x1ce122[_0x29c0('0x1b')];var _0x281597=_0x5c1163?0x0:_0x235725[_0x29c0('0x18')];var _0x429b88=_0x5c1163?_0x1ce122[_0x29c0('0x1b')]:_0x235725[_0x29c0('0x18')]+_0x235725[_0x29c0('0x1a')];var _0x4b463f;if(_0x429b88>=_0x2f6da1){_0x429b88=_0x2f6da1;_0x4b463f=0xc8;}else{_0x4b463f=0xce;}_0xccb222[_0x29c0('0x15')](_0x4b463f);return _0xccb222[_0x29c0('0x1c')](_0x29c0('0x1d'),_0x281597+'-'+_0x429b88+'/'+_0x2f6da1)[_0x29c0('0x17')](_0x1ce122);}return null;};}function patchUpdates(_0x38eab0){return function(_0x25c007){try{jsonpatch['apply'](_0x25c007,_0x38eab0,!![]);}catch(_0x3609a6){return BPromise[_0x29c0('0x1e')](_0x3609a6);}return _0x25c007[_0x29c0('0x1f')]();};}function saveUpdates(_0x26bf2e,_0x1f962f){return function(_0x503199){if(_0x503199){return _0x503199[_0x29c0('0x20')](_0x26bf2e)[_0x29c0('0x21')](function(_0x5846d0){return _0x5846d0;});}return null;};}function removeEntity(_0x1114a8,_0x402c54){return function(_0x3698fe){if(_0x3698fe){return _0x3698fe['destroy']()[_0x29c0('0x21')](function(){_0x1114a8['status'](0xcc)[_0x29c0('0x16')]();});}};}function handleEntityNotFound(_0x140988,_0x5561af){return function(_0x5b9b11){if(!_0x5b9b11){_0x140988[_0x29c0('0x14')](0x194);}return _0x5b9b11;};}function handleError(_0x3946f8,_0x184998){_0x184998=_0x184998||0x1f4;return function(_0x2cb718){logger[_0x29c0('0x22')](_0x2cb718['stack']);if(_0x2cb718['name']){delete _0x2cb718['name'];}_0x3946f8[_0x29c0('0x15')](_0x184998)[_0x29c0('0x23')](_0x2cb718);};}exports['index']=function(_0x4aa6bd,_0x208a5d){var _0x3eebaa={},_0x542b9c={},_0x5187ff={'count':0x0,'rows':[]};var _0x4d4f31=_[_0x29c0('0x24')](db[_0x29c0('0x25')][_0x29c0('0x26')],function(_0x4edead){return{'name':_0x4edead[_0x29c0('0x27')],'type':_0x4edead[_0x29c0('0x28')]['key']};});_0x542b9c[_0x29c0('0x29')]=_[_0x29c0('0x24')](_0x4d4f31,_0x29c0('0x2a'));_0x542b9c[_0x29c0('0x2b')]=_[_0x29c0('0x2c')](_0x4aa6bd[_0x29c0('0x2b')]);_0x542b9c[_0x29c0('0x2d')]=_['intersection'](_0x542b9c['model'],_0x542b9c[_0x29c0('0x2b')]);_0x3eebaa[_0x29c0('0x2e')]=_[_0x29c0('0x2f')](_0x542b9c['model'],qs[_0x29c0('0x30')](_0x4aa6bd[_0x29c0('0x2b')]['fields']));_0x3eebaa['attributes']=_0x3eebaa[_0x29c0('0x2e')][_0x29c0('0x31')]?_0x3eebaa[_0x29c0('0x2e')]:_0x542b9c[_0x29c0('0x29')];if(!_0x4aa6bd[_0x29c0('0x2b')][_0x29c0('0x32')](_0x29c0('0x33'))){_0x3eebaa['limit']=qs[_0x29c0('0x1a')](_0x4aa6bd['query'][_0x29c0('0x1a')]);_0x3eebaa[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x4aa6bd['query'][_0x29c0('0x18')]);}_0x3eebaa[_0x29c0('0x34')]=qs['sort'](_0x4aa6bd[_0x29c0('0x2b')][_0x29c0('0x35')]);_0x3eebaa[_0x29c0('0x36')]=qs[_0x29c0('0x2d')](_[_0x29c0('0x37')](_0x4aa6bd[_0x29c0('0x2b')],_0x542b9c[_0x29c0('0x2d')]),_0x4d4f31);if(_0x4aa6bd[_0x29c0('0x2b')][_0x29c0('0x38')]){_0x3eebaa[_0x29c0('0x36')]=_[_0x29c0('0x39')](_0x3eebaa[_0x29c0('0x36')],{'$or':_[_0x29c0('0x24')](_0x4d4f31,function(_0x36a188){if(_0x36a188[_0x29c0('0x28')]!==_0x29c0('0x3a')){var _0x34c426={};_0x34c426[_0x36a188[_0x29c0('0x2a')]]={'$like':'%'+_0x4aa6bd[_0x29c0('0x2b')][_0x29c0('0x38')]+'%'};return _0x34c426;}})});}_0x3eebaa=_[_0x29c0('0x39')]({},_0x3eebaa,_0x4aa6bd[_0x29c0('0x3b')]);var _0x270160={'where':_0x3eebaa['where']};return db[_0x29c0('0x25')][_0x29c0('0x1b')](_0x270160)[_0x29c0('0x21')](function(_0x280f62){_0x5187ff[_0x29c0('0x1b')]=_0x280f62;if(_0x4aa6bd['query'][_0x29c0('0x3c')]){_0x3eebaa[_0x29c0('0x3d')]=[{'all':!![]}];}return db[_0x29c0('0x25')]['findAll'](_0x3eebaa);})[_0x29c0('0x21')](function(_0x3f6f3f){_0x5187ff['rows']=_0x3f6f3f;return _0x5187ff;})[_0x29c0('0x21')](respondWithFilteredResult(_0x208a5d,_0x3eebaa))['catch'](handleError(_0x208a5d,null));};exports[_0x29c0('0x3e')]=function(_0x5f4937,_0x21c457){var _0x406a23={'raw':![],'where':{'id':_0x5f4937[_0x29c0('0x3f')]['id']}},_0xbd55a4={};_0xbd55a4[_0x29c0('0x29')]=_[_0x29c0('0x2c')](db['FreshdeskAccount']['rawAttributes']);_0xbd55a4[_0x29c0('0x2b')]=_[_0x29c0('0x2c')](_0x5f4937['query']);_0xbd55a4[_0x29c0('0x2d')]=_[_0x29c0('0x2f')](_0xbd55a4[_0x29c0('0x29')],_0xbd55a4[_0x29c0('0x2b')]);_0x406a23[_0x29c0('0x2e')]=_[_0x29c0('0x2f')](_0xbd55a4[_0x29c0('0x29')],qs[_0x29c0('0x30')](_0x5f4937[_0x29c0('0x2b')][_0x29c0('0x30')]));_0x406a23[_0x29c0('0x2e')]=_0x406a23[_0x29c0('0x2e')][_0x29c0('0x31')]?_0x406a23[_0x29c0('0x2e')]:_0xbd55a4[_0x29c0('0x29')];if(_0x5f4937[_0x29c0('0x2b')]['includeAll']){_0x406a23[_0x29c0('0x3d')]=[{'all':!![]}];}_0x406a23=_[_0x29c0('0x39')]({},_0x406a23,_0x5f4937['options']);return db[_0x29c0('0x25')][_0x29c0('0x40')](_0x406a23)['then'](handleEntityNotFound(_0x21c457,null))[_0x29c0('0x21')](respondWithResult(_0x21c457,null))['catch'](handleError(_0x21c457,null));};exports[_0x29c0('0x41')]=function(_0x49371c,_0x1b74f9){return db[_0x29c0('0x25')][_0x29c0('0x41')](_0x49371c['body'],{})[_0x29c0('0x21')](respondWithResult(_0x1b74f9,0xc9))['catch'](handleError(_0x1b74f9,null));};exports[_0x29c0('0x20')]=function(_0x4bc495,_0x2af922){if(_0x4bc495[_0x29c0('0x42')]['id']){delete _0x4bc495[_0x29c0('0x42')]['id'];}return db[_0x29c0('0x25')][_0x29c0('0x40')]({'where':{'id':_0x4bc495['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x2af922,null))[_0x29c0('0x21')](saveUpdates(_0x4bc495['body'],null))[_0x29c0('0x21')](respondWithResult(_0x2af922,null))[_0x29c0('0x43')](handleError(_0x2af922,null));};exports[_0x29c0('0x44')]=function(_0x42623f,_0x1d2578){return db[_0x29c0('0x25')]['find']({'where':{'id':_0x42623f[_0x29c0('0x3f')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x1d2578,null))['then'](removeEntity(_0x1d2578,null))[_0x29c0('0x43')](handleError(_0x1d2578,null));};exports[_0x29c0('0x45')]=function(_0x4e3333,_0x388e5d,_0x5b2987){var _0x482e48={};var _0x8c71b2={};var _0x54cc2a;var _0x271709;return db[_0x29c0('0x25')][_0x29c0('0x46')]({'where':{'id':_0x4e3333[_0x29c0('0x3f')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x388e5d,null))['then'](function(_0x4f3d30){if(_0x4f3d30){_0x54cc2a=_0x4f3d30;_0x8c71b2[_0x29c0('0x29')]=_['keys'](db[_0x29c0('0x47')][_0x29c0('0x26')]);_0x8c71b2['query']=_[_0x29c0('0x2c')](_0x4e3333['query']);_0x8c71b2[_0x29c0('0x2d')]=_['intersection'](_0x8c71b2[_0x29c0('0x29')],_0x8c71b2[_0x29c0('0x2b')]);_0x482e48['attributes']=_['intersection'](_0x8c71b2['model'],qs[_0x29c0('0x30')](_0x4e3333[_0x29c0('0x2b')]['fields']));_0x482e48['attributes']=_0x482e48[_0x29c0('0x2e')][_0x29c0('0x31')]?_0x482e48[_0x29c0('0x2e')]:_0x8c71b2[_0x29c0('0x29')];_0x482e48[_0x29c0('0x34')]=qs['sort'](_0x4e3333[_0x29c0('0x2b')]['sort']);_0x482e48[_0x29c0('0x36')]=qs[_0x29c0('0x2d')](_[_0x29c0('0x37')](_0x4e3333[_0x29c0('0x2b')],_0x8c71b2[_0x29c0('0x2d')]));if(_0x4e3333[_0x29c0('0x2b')][_0x29c0('0x38')]){_0x482e48[_0x29c0('0x36')]=_[_0x29c0('0x39')](_0x482e48['where'],{'$or':_['map'](_0x482e48[_0x29c0('0x2e')],function(_0x3e27d3){var _0x135c8b={};_0x135c8b[_0x3e27d3]={'$like':'%'+_0x4e3333[_0x29c0('0x2b')]['filter']+'%'};return _0x135c8b;})});}_0x482e48=_['merge']({},_0x482e48,_0x4e3333[_0x29c0('0x3b')]);return _0x54cc2a[_0x29c0('0x45')](_0x482e48);}})[_0x29c0('0x21')](function(_0x5a393d){if(_0x5a393d){_0x271709=_0x5a393d['length'];if(!_0x4e3333[_0x29c0('0x2b')]['hasOwnProperty'](_0x29c0('0x33'))){_0x482e48[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x4e3333[_0x29c0('0x2b')][_0x29c0('0x1a')]);_0x482e48[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x4e3333[_0x29c0('0x2b')]['offset']);}return _0x54cc2a[_0x29c0('0x45')](_0x482e48);}})['then'](function(_0x18f619){if(_0x18f619){return _0x18f619?{'count':_0x271709,'rows':_0x18f619}:null;}})[_0x29c0('0x21')](respondWithResult(_0x388e5d,null))[_0x29c0('0x43')](handleError(_0x388e5d,null));};exports[_0x29c0('0x48')]=function(_0x69c358,_0x146a99,_0x12cb44){if(_0x69c358[_0x29c0('0x42')]['id']){delete _0x69c358[_0x29c0('0x42')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x69c358[_0x29c0('0x3f')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x146a99,null))[_0x29c0('0x21')](function(_0x28c970){if(_0x28c970){_0x69c358[_0x29c0('0x42')][_0x29c0('0x49')]=_0x28c970['id'];_0x69c358['body']['Subjects']=integrations[_0x29c0('0x4a')](_0x69c358['body'][_0x29c0('0x4b')],_0x69c358['body']['type']);_0x69c358[_0x29c0('0x42')]['Descriptions']=integrations[_0x29c0('0x4c')](_0x69c358[_0x29c0('0x42')][_0x29c0('0x4b')],_0x69c358[_0x29c0('0x42')][_0x29c0('0x28')]);return db['FreshdeskConfiguration'][_0x29c0('0x41')](_0x69c358[_0x29c0('0x42')],{'include':[{'model':db[_0x29c0('0x4d')],'as':_0x29c0('0x4e')},{'model':db[_0x29c0('0x4d')],'as':_0x29c0('0x4f')}]});}return null;})[_0x29c0('0x21')](respondWithResult(_0x146a99,null))[_0x29c0('0x43')](handleError(_0x146a99,null));};exports[_0x29c0('0x50')]=function(_0x15eabe,_0x4a0629,_0x32609d){var _0x340052='';return db['FreshdeskAccount'][_0x29c0('0x46')]({'where':{'id':_0x15eabe[_0x29c0('0x3f')]['id']},'attributes':['id','remoteUri',_0x29c0('0x51')]})['then'](handleEntityNotFound(_0x4a0629,null))['then'](function(_0x58341b){if(_0x58341b){_0x340052=_0x58341b[_0x29c0('0x52')];var _0xa2ead3=_0x340052['slice'](-0x1);if(_0xa2ead3==='/'){_0x340052=_0x340052[_0x29c0('0x53')](0x0,_0x340052['lastIndexOf'](_0xa2ead3));}return rp({'method':_0x29c0('0x54'),'uri':util[_0x29c0('0x55')](_0x29c0('0x56'),_0x340052,_0x29c0('0x57')),'headers':{'Authorization':util[_0x29c0('0x55')](_0x29c0('0x58'),new Buffer(util[_0x29c0('0x55')](_0x29c0('0x59'),_0x58341b[_0x29c0('0x51')]))[_0x29c0('0x5a')](_0x29c0('0x5b')))},'json':!![]});}})[_0x29c0('0x21')](function(_0x57398a){if(_0x57398a){var _0x44719e=[_0x29c0('0x5c'),_0x29c0('0x5d'),_0x29c0('0x5e'),_0x29c0('0x5f'),_0x29c0('0x15'),_0x29c0('0x60'),'group',_0x29c0('0x61'),_0x29c0('0x62'),_0x29c0('0x63'),_0x29c0('0x64')];_[_0x29c0('0x65')](_0x57398a,function(_0x7c3cc2){return _0x44719e['includes'](_0x7c3cc2[_0x29c0('0x2a')])||!_0x7c3cc2[_0x29c0('0x66')]&&_0x7c3cc2['type']!==_0x29c0('0x67')&&_0x7c3cc2[_0x29c0('0x28')]!==_0x29c0('0x68');});return{'count':_0x57398a[_0x29c0('0x31')],'rows':_[_0x29c0('0x24')](_0x57398a,function(_0x394739){return{'id':_0x394739[_0x29c0('0x2a')],'name':_0x394739[_0x29c0('0x69')],'custom':!_0x394739['default'],'options':_0x394739['choices']?_['map'](_0x394739[_0x29c0('0x6a')],function(_0x54f777){return{'name':_['capitalize'](_0x54f777),'value':_0x54f777};}):[]};})};}})['then'](respondWithResult(_0x4a0629,null))['catch'](function(_0x48bf1c){var _0x9df541=_0x15eabe['query'][_0x29c0('0x6b')]?0x1f4:_0x48bf1c[_0x29c0('0x6c')]||0x1f4;logger[_0x29c0('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x29c0('0x50'),_0x9df541,JSON['stringify'](_0x48bf1c));delete _0x48bf1c['name'];if(_0x9df541===0x191){_0x9df541=0x190;}_0x4a0629['status'](_0x9df541)[_0x29c0('0x23')](_0x15eabe[_0x29c0('0x2b')][_0x29c0('0x6b')]?{'message':_0x29c0('0x6d'),'statusCode':_0x48bf1c[_0x29c0('0x6c')]}:_0x48bf1c);});}; \ No newline at end of file +var _0xed8a=['count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','map','FreshdeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','update','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','Subjects','getFields','findOne','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','base64','requester','agent','description','priority','group','ticket_type','remove','default','custom_dropdown','label','choices','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','end','undefined','limit'];(function(_0x5a3891,_0xecbe25){var _0x7cf90d=function(_0x5f0bd3){while(--_0x5f0bd3){_0x5a3891['push'](_0x5a3891['shift']());}};_0x7cf90d(++_0xecbe25);}(_0xed8a,0xc5));var _0xaed8=function(_0x31b10f,_0x5dd91b){_0x31b10f=_0x31b10f-0x0;var _0xdbae85=_0xed8a[_0x31b10f];return _0xdbae85;};'use strict';var emlformat=require(_0xaed8('0x0'));var rimraf=require(_0xaed8('0x1'));var zipdir=require(_0xaed8('0x2'));var jsonpatch=require(_0xaed8('0x3'));var rp=require('request-promise');var moment=require(_0xaed8('0x4'));var BPromise=require(_0xaed8('0x5'));var Mustache=require('mustache');var util=require(_0xaed8('0x6'));var path=require(_0xaed8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaed8('0x8'));var fs=require('fs');var fs_extra=require(_0xaed8('0x9'));var _=require(_0xaed8('0xa'));var squel=require(_0xaed8('0xb'));var crypto=require(_0xaed8('0xc'));var jsforce=require(_0xaed8('0xd'));var deskjs=require(_0xaed8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaed8('0xf'));var Papa=require(_0xaed8('0x10'));var Redis=require(_0xaed8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaed8('0x12'));var as=require(_0xaed8('0x13'));var hardwareService=require(_0xaed8('0x14'));var logger=require(_0xaed8('0x15'))(_0xaed8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaed8('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xaed8('0x18'));function respondWithStatusCode(_0x36c833,_0x129051){_0x129051=_0x129051||0xcc;return function(_0x36d561){if(_0x36d561){return _0x36c833['sendStatus'](_0x129051);}return _0x36c833[_0xaed8('0x19')](_0x129051)[_0xaed8('0x1a')]();};}function respondWithResult(_0x3a7aab,_0x248cd7){_0x248cd7=_0x248cd7||0xc8;return function(_0x2c5039){if(_0x2c5039){return _0x3a7aab[_0xaed8('0x19')](_0x248cd7)['json'](_0x2c5039);}};}function respondWithFilteredResult(_0xefac0c,_0x4a7448){return function(_0x4593c1){if(_0x4593c1){var _0x1aab7d=typeof _0x4a7448['offset']===_0xaed8('0x1b')&&typeof _0x4a7448[_0xaed8('0x1c')]===_0xaed8('0x1b');var _0x3c973d=_0x4593c1[_0xaed8('0x1d')];var _0x1b8eb8=_0x1aab7d?0x0:_0x4a7448[_0xaed8('0x1e')];var _0x3c6313=_0x1aab7d?_0x4593c1[_0xaed8('0x1d')]:_0x4a7448[_0xaed8('0x1e')]+_0x4a7448[_0xaed8('0x1c')];var _0x460165;if(_0x3c6313>=_0x3c973d){_0x3c6313=_0x3c973d;_0x460165=0xc8;}else{_0x460165=0xce;}_0xefac0c[_0xaed8('0x19')](_0x460165);return _0xefac0c[_0xaed8('0x1f')](_0xaed8('0x20'),_0x1b8eb8+'-'+_0x3c6313+'/'+_0x3c973d)['json'](_0x4593c1);}return null;};}function patchUpdates(_0x5cd103){return function(_0x2ac96a){try{jsonpatch['apply'](_0x2ac96a,_0x5cd103,!![]);}catch(_0x13e498){return BPromise[_0xaed8('0x21')](_0x13e498);}return _0x2ac96a[_0xaed8('0x22')]();};}function saveUpdates(_0x344949,_0x5a69aa){return function(_0x5aa616){if(_0x5aa616){return _0x5aa616['update'](_0x344949)[_0xaed8('0x23')](function(_0x4437aa){return _0x4437aa;});}return null;};}function removeEntity(_0x448ef9,_0x38a3f1){return function(_0x112eab){if(_0x112eab){return _0x112eab[_0xaed8('0x24')]()[_0xaed8('0x23')](function(){_0x448ef9[_0xaed8('0x19')](0xcc)[_0xaed8('0x1a')]();});}};}function handleEntityNotFound(_0x57898b,_0x33d3ea){return function(_0x393bcb){if(!_0x393bcb){_0x57898b[_0xaed8('0x25')](0x194);}return _0x393bcb;};}function handleError(_0x14cd92,_0x349736){_0x349736=_0x349736||0x1f4;return function(_0xe906a3){logger['error'](_0xe906a3[_0xaed8('0x26')]);if(_0xe906a3['name']){delete _0xe906a3[_0xaed8('0x27')];}_0x14cd92['status'](_0x349736)[_0xaed8('0x28')](_0xe906a3);};}exports['index']=function(_0x2fc145,_0x475974){var _0x284c6a={},_0x601d8d={},_0x3dbe7e={'count':0x0,'rows':[]};var _0x476e93=_[_0xaed8('0x29')](db[_0xaed8('0x2a')][_0xaed8('0x2b')],function(_0x4b1db6){return{'name':_0x4b1db6['fieldName'],'type':_0x4b1db6[_0xaed8('0x2c')][_0xaed8('0x2d')]};});_0x601d8d[_0xaed8('0x2e')]=_[_0xaed8('0x29')](_0x476e93,_0xaed8('0x27'));_0x601d8d['query']=_[_0xaed8('0x2f')](_0x2fc145[_0xaed8('0x30')]);_0x601d8d[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x601d8d[_0xaed8('0x2e')],_0x601d8d[_0xaed8('0x30')]);_0x284c6a['attributes']=_['intersection'](_0x601d8d[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x2fc145[_0xaed8('0x30')]['fields']));_0x284c6a['attributes']=_0x284c6a[_0xaed8('0x34')][_0xaed8('0x35')]?_0x284c6a[_0xaed8('0x34')]:_0x601d8d['model'];if(!_0x2fc145[_0xaed8('0x30')][_0xaed8('0x36')](_0xaed8('0x37'))){_0x284c6a['limit']=qs[_0xaed8('0x1c')](_0x2fc145[_0xaed8('0x30')][_0xaed8('0x1c')]);_0x284c6a[_0xaed8('0x1e')]=qs[_0xaed8('0x1e')](_0x2fc145[_0xaed8('0x30')][_0xaed8('0x1e')]);}_0x284c6a[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x2fc145['query'][_0xaed8('0x39')]);_0x284c6a[_0xaed8('0x3a')]=qs[_0xaed8('0x31')](_[_0xaed8('0x3b')](_0x2fc145['query'],_0x601d8d[_0xaed8('0x31')]),_0x476e93);if(_0x2fc145[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x284c6a[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x284c6a[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x29')](_0x476e93,function(_0xad472c){if(_0xad472c['type']!==_0xaed8('0x3e')){var _0x19b734={};_0x19b734[_0xad472c['name']]={'$like':'%'+_0x2fc145[_0xaed8('0x30')]['filter']+'%'};return _0x19b734;}})});}_0x284c6a=_[_0xaed8('0x3d')]({},_0x284c6a,_0x2fc145[_0xaed8('0x3f')]);var _0x5a735e={'where':_0x284c6a[_0xaed8('0x3a')]};return db[_0xaed8('0x2a')]['count'](_0x5a735e)[_0xaed8('0x23')](function(_0x17f52d){_0x3dbe7e['count']=_0x17f52d;if(_0x2fc145[_0xaed8('0x30')][_0xaed8('0x40')]){_0x284c6a['include']=[{'all':!![]}];}return db[_0xaed8('0x2a')]['findAll'](_0x284c6a);})[_0xaed8('0x23')](function(_0x306c4e){_0x3dbe7e[_0xaed8('0x41')]=_0x306c4e;return _0x3dbe7e;})['then'](respondWithFilteredResult(_0x475974,_0x284c6a))['catch'](handleError(_0x475974,null));};exports[_0xaed8('0x42')]=function(_0x263bc4,_0x4ddb0f){var _0x22ddd8={'raw':![],'where':{'id':_0x263bc4[_0xaed8('0x43')]['id']}},_0x3d55a3={};_0x3d55a3[_0xaed8('0x2e')]=_[_0xaed8('0x2f')](db[_0xaed8('0x2a')][_0xaed8('0x2b')]);_0x3d55a3[_0xaed8('0x30')]=_[_0xaed8('0x2f')](_0x263bc4[_0xaed8('0x30')]);_0x3d55a3['filters']=_[_0xaed8('0x32')](_0x3d55a3['model'],_0x3d55a3[_0xaed8('0x30')]);_0x22ddd8[_0xaed8('0x34')]=_['intersection'](_0x3d55a3[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x263bc4[_0xaed8('0x30')]['fields']));_0x22ddd8[_0xaed8('0x34')]=_0x22ddd8[_0xaed8('0x34')]['length']?_0x22ddd8[_0xaed8('0x34')]:_0x3d55a3[_0xaed8('0x2e')];if(_0x263bc4[_0xaed8('0x30')][_0xaed8('0x40')]){_0x22ddd8[_0xaed8('0x44')]=[{'all':!![]}];}_0x22ddd8=_[_0xaed8('0x3d')]({},_0x22ddd8,_0x263bc4['options']);return db[_0xaed8('0x2a')][_0xaed8('0x45')](_0x22ddd8)[_0xaed8('0x23')](handleEntityNotFound(_0x4ddb0f,null))[_0xaed8('0x23')](respondWithResult(_0x4ddb0f,null))[_0xaed8('0x46')](handleError(_0x4ddb0f,null));};exports[_0xaed8('0x47')]=function(_0x560a69,_0x2b73ef){return db[_0xaed8('0x2a')][_0xaed8('0x47')](_0x560a69[_0xaed8('0x48')],{})[_0xaed8('0x23')](respondWithResult(_0x2b73ef,0xc9))[_0xaed8('0x46')](handleError(_0x2b73ef,null));};exports[_0xaed8('0x49')]=function(_0x26c015,_0x32679e){if(_0x26c015[_0xaed8('0x48')]['id']){delete _0x26c015['body']['id'];}return db[_0xaed8('0x2a')][_0xaed8('0x45')]({'where':{'id':_0x26c015['params']['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x32679e,null))[_0xaed8('0x23')](saveUpdates(_0x26c015[_0xaed8('0x48')],null))['then'](respondWithResult(_0x32679e,null))[_0xaed8('0x46')](handleError(_0x32679e,null));};exports[_0xaed8('0x24')]=function(_0x4a4eac,_0x213341){return db[_0xaed8('0x2a')][_0xaed8('0x45')]({'where':{'id':_0x4a4eac[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x213341,null))[_0xaed8('0x23')](removeEntity(_0x213341,null))[_0xaed8('0x46')](handleError(_0x213341,null));};exports['getConfigurations']=function(_0x1fa6a6,_0x1f40ff,_0x4468d8){var _0x45b03c={};var _0x14483d={};var _0x143ce0;var _0x2508fa;return db[_0xaed8('0x2a')]['findOne']({'where':{'id':_0x1fa6a6[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x1f40ff,null))[_0xaed8('0x23')](function(_0x107dbd){if(_0x107dbd){_0x143ce0=_0x107dbd;_0x14483d[_0xaed8('0x2e')]=_[_0xaed8('0x2f')](db[_0xaed8('0x4a')][_0xaed8('0x2b')]);_0x14483d['query']=_['keys'](_0x1fa6a6[_0xaed8('0x30')]);_0x14483d[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x14483d[_0xaed8('0x2e')],_0x14483d[_0xaed8('0x30')]);_0x45b03c[_0xaed8('0x34')]=_[_0xaed8('0x32')](_0x14483d[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x33')]));_0x45b03c[_0xaed8('0x34')]=_0x45b03c[_0xaed8('0x34')][_0xaed8('0x35')]?_0x45b03c[_0xaed8('0x34')]:_0x14483d['model'];_0x45b03c[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x39')]);_0x45b03c['where']=qs[_0xaed8('0x31')](_['pick'](_0x1fa6a6[_0xaed8('0x30')],_0x14483d[_0xaed8('0x31')]));if(_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x45b03c[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x45b03c[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x29')](_0x45b03c[_0xaed8('0x34')],function(_0x35900f){var _0x50e97f={};_0x50e97f[_0x35900f]={'$like':'%'+_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x3c')]+'%'};return _0x50e97f;})});}_0x45b03c=_['merge']({},_0x45b03c,_0x1fa6a6[_0xaed8('0x3f')]);return _0x143ce0[_0xaed8('0x4b')](_0x45b03c);}})['then'](function(_0x13962f){if(_0x13962f){_0x2508fa=_0x13962f['length'];if(!_0x1fa6a6[_0xaed8('0x30')]['hasOwnProperty'](_0xaed8('0x37'))){_0x45b03c['limit']=qs[_0xaed8('0x1c')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x1c')]);_0x45b03c['offset']=qs['offset'](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x1e')]);}return _0x143ce0[_0xaed8('0x4b')](_0x45b03c);}})['then'](function(_0x3c99b1){if(_0x3c99b1){return _0x3c99b1?{'count':_0x2508fa,'rows':_0x3c99b1}:null;}})['then'](respondWithResult(_0x1f40ff,null))[_0xaed8('0x46')](handleError(_0x1f40ff,null));};exports[_0xaed8('0x4c')]=function(_0x136cae,_0x5320c2,_0xbed924){if(_0x136cae[_0xaed8('0x48')]['id']){delete _0x136cae['body']['id'];}return db[_0xaed8('0x2a')]['findOne']({'where':{'id':_0x136cae[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x5320c2,null))[_0xaed8('0x23')](function(_0x45c321){if(_0x45c321){_0x136cae[_0xaed8('0x48')][_0xaed8('0x4d')]=_0x45c321['id'];_0x136cae[_0xaed8('0x48')]['Subjects']=integrations[_0xaed8('0x4e')](_0x136cae[_0xaed8('0x48')]['channel'],_0x136cae['body']['type']);_0x136cae['body'][_0xaed8('0x4f')]=integrations[_0xaed8('0x50')](_0x136cae[_0xaed8('0x48')][_0xaed8('0x51')],_0x136cae[_0xaed8('0x48')][_0xaed8('0x2c')]);return db[_0xaed8('0x4a')][_0xaed8('0x47')](_0x136cae[_0xaed8('0x48')],{'include':[{'model':db[_0xaed8('0x52')],'as':_0xaed8('0x53')},{'model':db[_0xaed8('0x52')],'as':'Descriptions'}]});}return null;})[_0xaed8('0x23')](respondWithResult(_0x5320c2,null))[_0xaed8('0x46')](handleError(_0x5320c2,null));};exports[_0xaed8('0x54')]=function(_0x42acb3,_0x4d5abb,_0x18e926){var _0x722467='';return db[_0xaed8('0x2a')][_0xaed8('0x55')]({'where':{'id':_0x42acb3[_0xaed8('0x43')]['id']},'attributes':['id','remoteUri',_0xaed8('0x56')]})[_0xaed8('0x23')](handleEntityNotFound(_0x4d5abb,null))[_0xaed8('0x23')](function(_0x1e1476){if(_0x1e1476){_0x722467=_0x1e1476[_0xaed8('0x57')];var _0x285522=_0x722467[_0xaed8('0x58')](-0x1);if(_0x285522==='/'){_0x722467=_0x722467[_0xaed8('0x59')](0x0,_0x722467[_0xaed8('0x5a')](_0x285522));}return rp({'method':_0xaed8('0x5b'),'uri':util[_0xaed8('0x5c')](_0xaed8('0x5d'),_0x722467,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xaed8('0x5c')]('Basic\x20%s',new Buffer(util[_0xaed8('0x5c')](_0xaed8('0x5e'),_0x1e1476[_0xaed8('0x56')]))['toString'](_0xaed8('0x5f')))},'json':!![]});}})['then'](function(_0x16a382){if(_0x16a382){var _0x14c64b=[_0xaed8('0x60'),'subject',_0xaed8('0x61'),_0xaed8('0x62'),'status',_0xaed8('0x63'),_0xaed8('0x64'),'source',_0xaed8('0x65'),_0xaed8('0x64'),'company'];_[_0xaed8('0x66')](_0x16a382,function(_0x422f3c){return _0x14c64b['includes'](_0x422f3c[_0xaed8('0x27')])||!_0x422f3c[_0xaed8('0x67')]&&_0x422f3c['type']!=='custom_text'&&_0x422f3c[_0xaed8('0x2c')]!==_0xaed8('0x68');});return{'count':_0x16a382[_0xaed8('0x35')],'rows':_[_0xaed8('0x29')](_0x16a382,function(_0x53f29b){return{'id':_0x53f29b[_0xaed8('0x27')],'name':_0x53f29b[_0xaed8('0x69')],'custom':!_0x53f29b[_0xaed8('0x67')],'options':_0x53f29b[_0xaed8('0x6a')]?_[_0xaed8('0x29')](_0x53f29b[_0xaed8('0x6a')],function(_0x41c34c){return{'name':_['capitalize'](_0x41c34c),'value':_0x41c34c};}):[]};})};}})[_0xaed8('0x23')](respondWithResult(_0x4d5abb,null))[_0xaed8('0x46')](function(_0x4389c2){var _0x42e5cf=_0x42acb3[_0xaed8('0x30')]['test']?0x1f4:_0x4389c2[_0xaed8('0x6b')]||0x1f4;logger[_0xaed8('0x6c')](_0xaed8('0x6d'),_0xaed8('0x54'),_0x42e5cf,JSON[_0xaed8('0x6e')](_0x4389c2));delete _0x4389c2[_0xaed8('0x27')];if(_0x42e5cf===0x191){_0x42e5cf=0x190;}_0x4d5abb[_0xaed8('0x19')](_0x42e5cf)[_0xaed8('0x28')](_0x42acb3[_0xaed8('0x30')][_0xaed8('0x6f')]?{'message':_0xaed8('0x70'),'statusCode':_0x4389c2['statusCode']}:_0x4389c2);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 8dfd5a3..9531844 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 _0xd0ec=['request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','int_freshdesk_accounts','util','api','moment'];(function(_0x199b6b,_0x257f0d){var _0x4872bd=function(_0x176d78){while(--_0x176d78){_0x199b6b['push'](_0x199b6b['shift']());}};_0x4872bd(++_0x257f0d);}(_0xd0ec,0x14a));var _0xcd0e=function(_0x42b4cb,_0x56da2a){_0x42b4cb=_0x42b4cb-0x0;var _0x3412ad=_0xd0ec[_0x42b4cb];return _0x3412ad;};'use strict';var _=require('lodash');var util=require(_0xcd0e('0x0'));var logger=require('../../config/logger')(_0xcd0e('0x1'));var moment=require(_0xcd0e('0x2'));var BPromise=require('bluebird');var rp=require(_0xcd0e('0x3'));var fs=require('fs');var path=require(_0xcd0e('0x4'));var rimraf=require(_0xcd0e('0x5'));var config=require('../../config/environment');var attributes=require(_0xcd0e('0x6'));var integrations=require(_0xcd0e('0x7'));module['exports']=function(_0x1af363,_0x33b6ca){return _0x1af363['define']('FreshdeskAccount',attributes,{'tableName':_0xcd0e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd089=['define','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x3e977e,_0x2a57da){var _0x33bbfa=function(_0x29607c){while(--_0x29607c){_0x3e977e['push'](_0x3e977e['shift']());}};_0x33bbfa(++_0x2a57da);}(_0xd089,0x184));var _0x9d08=function(_0x43d6d1,_0x22dfdd){_0x43d6d1=_0x43d6d1-0x0;var _0x1267b3=_0xd089[_0x43d6d1];return _0x1267b3;};'use strict';var _=require(_0x9d08('0x0'));var util=require(_0x9d08('0x1'));var logger=require(_0x9d08('0x2'))(_0x9d08('0x3'));var moment=require('moment');var BPromise=require(_0x9d08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d08('0x5'));var config=require(_0x9d08('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9d08('0x7'));module['exports']=function(_0x2cc09d,_0x30be24){return _0x2cc09d[_0x9d08('0x8')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 0f488b9..1f62ad2 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 _0x4859=['model','then','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','raw','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','info','result','FreshdeskAccount','findAll','options','attributes','limit','include','map'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x4859,0x1ac));var _0x9485=function(_0x25a538,_0x74075){_0x25a538=_0x25a538-0x0;var _0x56f7b3=_0x4859[_0x25a538];return _0x56f7b3;};'use strict';var _=require('lodash');var util=require(_0x9485('0x0'));var moment=require(_0x9485('0x1'));var BPromise=require(_0x9485('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9485('0x3'));var db=require(_0x9485('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9485('0x5'))(_0x9485('0x6'));var config=require(_0x9485('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9485('0x8')][_0x9485('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7940,_0x555d70,_0x7e3f32){return new BPromise(function(_0x32ad2c,_0x1fafdc){return client[_0x9485('0xa')](_0x1c7940,_0x7e3f32)['then'](function(_0x24008f){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x555d70,_0x9485('0xb'));logger[_0x9485('0xc')](_0x9485('0xd'),_0x555d70,_0x9485('0xb'),JSON[_0x9485('0xe')](_0x24008f));if(_0x24008f[_0x9485('0xf')]){if(_0x24008f[_0x9485('0xf')]['code']===0x1f4){logger[_0x9485('0xf')](_0x9485('0x10'),_0x555d70,_0x24008f['error'][_0x9485('0x11')]);return _0x1fafdc(_0x24008f[_0x9485('0xf')]['message']);}logger[_0x9485('0xf')](_0x9485('0x10'),_0x555d70,_0x24008f[_0x9485('0xf')][_0x9485('0x11')]);return _0x32ad2c(_0x24008f['error'][_0x9485('0x11')]);}else{logger[_0x9485('0x12')](_0x9485('0x10'),_0x555d70,_0x9485('0xb'));_0x32ad2c(_0x24008f[_0x9485('0x13')][_0x9485('0x11')]);}})['catch'](function(_0x1efb1c){logger[_0x9485('0xf')](_0x9485('0x10'),_0x555d70,_0x1efb1c);_0x1fafdc(_0x1efb1c);});});}exports['GetFreshdeskAccount']=function(_0x17baca){var _0x1d5341=this;return new Promise(function(_0x2c87db,_0x246729){return db[_0x9485('0x14')][_0x9485('0x15')]({'raw':_0x17baca[_0x9485('0x16')]?_0x17baca[_0x9485('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x17baca[_0x9485('0x16')]?_0x17baca[_0x9485('0x16')]['where']||null:null,'attributes':_0x17baca['options']?_0x17baca[_0x9485('0x16')][_0x9485('0x17')]||null:null,'limit':_0x17baca[_0x9485('0x16')]?_0x17baca[_0x9485('0x16')][_0x9485('0x18')]||null:null,'include':_0x17baca[_0x9485('0x16')]?_0x17baca['options'][_0x9485('0x19')]?_[_0x9485('0x1a')](_0x17baca[_0x9485('0x16')]['include'],function(_0x5c6e8b){return{'model':db[_0x5c6e8b[_0x9485('0x1b')]],'as':_0x5c6e8b['as'],'attributes':_0x5c6e8b[_0x9485('0x17')],'include':_0x5c6e8b[_0x9485('0x19')]?_[_0x9485('0x1a')](_0x5c6e8b[_0x9485('0x19')],function(_0x2921c4){return{'model':db[_0x2921c4['model']],'as':_0x2921c4['as'],'attributes':_0x2921c4['attributes'],'include':_0x2921c4[_0x9485('0x19')]?_[_0x9485('0x1a')](_0x2921c4[_0x9485('0x19')],function(_0x30ceac){return{'model':db[_0x30ceac[_0x9485('0x1b')]],'as':_0x30ceac['as'],'attributes':_0x30ceac['attributes']};}):[]};}):[]};}):[]:[]})[_0x9485('0x1c')](function(_0x1a3507){logger[_0x9485('0x12')](_0x9485('0x1d'),_0x17baca);logger['debug'](_0x9485('0x1d'),_0x17baca,JSON['stringify'](_0x1a3507));_0x2c87db(_0x1a3507);})[_0x9485('0x1e')](function(_0x30fce2){logger[_0x9485('0xf')](_0x9485('0x1d'),_0x30fce2['message'],_0x17baca);_0x246729(_0x1d5341[_0x9485('0xf')](0x1f4,_0x30fce2[_0x9485('0x11')]));});});};exports[_0x9485('0x1f')]=function(_0x5daecd){var _0xc6c27e=this;return new Promise(function(_0x478a12,_0x19a051){return db[_0x9485('0x14')][_0x9485('0x20')]({'raw':_0x5daecd[_0x9485('0x16')]?_0x5daecd[_0x9485('0x16')][_0x9485('0x21')]===undefined?!![]:![]:!![],'where':_0x5daecd[_0x9485('0x16')]?_0x5daecd[_0x9485('0x16')][_0x9485('0x22')]||null:null,'attributes':_0x5daecd[_0x9485('0x16')]?_0x5daecd['options'][_0x9485('0x17')]||null:null,'include':_0x5daecd[_0x9485('0x16')]?_0x5daecd[_0x9485('0x16')]['include']?_[_0x9485('0x1a')](_0x5daecd[_0x9485('0x16')][_0x9485('0x19')],function(_0x4c346d){return{'model':db[_0x4c346d['model']],'as':_0x4c346d['as'],'attributes':_0x4c346d[_0x9485('0x17')],'include':_0x4c346d[_0x9485('0x19')]?_[_0x9485('0x1a')](_0x4c346d[_0x9485('0x19')],function(_0x197f29){return{'model':db[_0x197f29[_0x9485('0x1b')]],'as':_0x197f29['as'],'attributes':_0x197f29[_0x9485('0x17')],'include':_0x197f29[_0x9485('0x19')]?_[_0x9485('0x1a')](_0x197f29[_0x9485('0x19')],function(_0x4423c8){return{'model':db[_0x4423c8[_0x9485('0x1b')]],'as':_0x4423c8['as'],'attributes':_0x4423c8[_0x9485('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9485('0x1c')](function(_0x5a55eb){logger[_0x9485('0x12')](_0x9485('0x1f'),_0x5daecd);logger[_0x9485('0xc')](_0x9485('0x1f'),_0x5daecd,JSON['stringify'](_0x5a55eb));_0x478a12(_0x5a55eb);})[_0x9485('0x1e')](function(_0x372c3b){logger[_0x9485('0xf')]('ShowFreshdeskAccount',_0x372c3b['message'],_0x5daecd);_0x19a051(_0xc6c27e['error'](0x1f4,_0x372c3b['message']));});});}; \ No newline at end of file +var _0x861f=['FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshdeskAccount','options','raw','where','attributes','include','map','model','info','FreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x301785,_0x506056){var _0x4ea53b=function(_0x5da0a7){while(--_0x5da0a7){_0x301785['push'](_0x301785['shift']());}};_0x4ea53b(++_0x506056);}(_0x861f,0x1ad));var _0xf861=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x861f[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xf861('0x0'));var util=require(_0xf861('0x1'));var moment=require('moment');var BPromise=require(_0xf861('0x2'));var rs=require(_0xf861('0x3'));var fs=require('fs');var Redis=require(_0xf861('0x4'));var db=require(_0xf861('0x5'))['db'];var utils=require(_0xf861('0x6'));var logger=require(_0xf861('0x7'))(_0xf861('0x8'));var config=require(_0xf861('0x9'));var jayson=require(_0xf861('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdaf08d,_0x2547e2,_0x156c41){return new BPromise(function(_0x561c85,_0x1588c0){return client[_0xf861('0xb')](_0xdaf08d,_0x156c41)[_0xf861('0xc')](function(_0x5bc91a){logger['info'](_0xf861('0xd'),_0x2547e2,'request\x20sent');logger[_0xf861('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2547e2,'request\x20sent',JSON[_0xf861('0xf')](_0x5bc91a));if(_0x5bc91a[_0xf861('0x10')]){if(_0x5bc91a['error'][_0xf861('0x11')]===0x1f4){logger[_0xf861('0x10')](_0xf861('0xd'),_0x2547e2,_0x5bc91a['error'][_0xf861('0x12')]);return _0x1588c0(_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);}logger[_0xf861('0x10')](_0xf861('0xd'),_0x2547e2,_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);return _0x561c85(_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);}else{logger['info'](_0xf861('0xd'),_0x2547e2,_0xf861('0x13'));_0x561c85(_0x5bc91a[_0xf861('0x14')][_0xf861('0x12')]);}})[_0xf861('0x15')](function(_0x5bd289){logger['error'](_0xf861('0xd'),_0x2547e2,_0x5bd289);_0x1588c0(_0x5bd289);});});}exports[_0xf861('0x16')]=function(_0x2eee25){var _0x19f56b=this;return new Promise(function(_0x42e381,_0x552237){return db['FreshdeskAccount']['findAll']({'raw':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x18')]===undefined?!![]:![]:!![],'where':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x19')]||null:null,'attributes':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x1a')]||null:null,'limit':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')]['limit']||null:null,'include':_0x2eee25[_0xf861('0x17')]?_0x2eee25['options'][_0xf861('0x1b')]?_[_0xf861('0x1c')](_0x2eee25['options'][_0xf861('0x1b')],function(_0x62653e){return{'model':db[_0x62653e[_0xf861('0x1d')]],'as':_0x62653e['as'],'attributes':_0x62653e[_0xf861('0x1a')],'include':_0x62653e[_0xf861('0x1b')]?_['map'](_0x62653e[_0xf861('0x1b')],function(_0x40d109){return{'model':db[_0x40d109[_0xf861('0x1d')]],'as':_0x40d109['as'],'attributes':_0x40d109['attributes'],'include':_0x40d109[_0xf861('0x1b')]?_['map'](_0x40d109[_0xf861('0x1b')],function(_0x5b694c){return{'model':db[_0x5b694c[_0xf861('0x1d')]],'as':_0x5b694c['as'],'attributes':_0x5b694c[_0xf861('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x243d82){logger[_0xf861('0x1e')](_0xf861('0x16'),_0x2eee25);logger[_0xf861('0xe')](_0xf861('0x16'),_0x2eee25,JSON[_0xf861('0xf')](_0x243d82));_0x42e381(_0x243d82);})['catch'](function(_0x51bddd){logger[_0xf861('0x10')]('GetFreshdeskAccount',_0x51bddd[_0xf861('0x12')],_0x2eee25);_0x552237(_0x19f56b[_0xf861('0x10')](0x1f4,_0x51bddd[_0xf861('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x1e1c05){var _0x5d4206=this;return new Promise(function(_0x354906,_0x2123ec){return db[_0xf861('0x1f')][_0xf861('0x20')]({'raw':_0x1e1c05['options']?_0x1e1c05['options'][_0xf861('0x18')]===undefined?!![]:![]:!![],'where':_0x1e1c05[_0xf861('0x17')]?_0x1e1c05['options'][_0xf861('0x19')]||null:null,'attributes':_0x1e1c05['options']?_0x1e1c05[_0xf861('0x17')][_0xf861('0x1a')]||null:null,'include':_0x1e1c05[_0xf861('0x17')]?_0x1e1c05[_0xf861('0x17')][_0xf861('0x1b')]?_['map'](_0x1e1c05[_0xf861('0x17')][_0xf861('0x1b')],function(_0x2d55fa){return{'model':db[_0x2d55fa['model']],'as':_0x2d55fa['as'],'attributes':_0x2d55fa[_0xf861('0x1a')],'include':_0x2d55fa['include']?_[_0xf861('0x1c')](_0x2d55fa[_0xf861('0x1b')],function(_0x4a0ec1){return{'model':db[_0x4a0ec1[_0xf861('0x1d')]],'as':_0x4a0ec1['as'],'attributes':_0x4a0ec1[_0xf861('0x1a')],'include':_0x4a0ec1[_0xf861('0x1b')]?_[_0xf861('0x1c')](_0x4a0ec1['include'],function(_0x18d788){return{'model':db[_0x18d788[_0xf861('0x1d')]],'as':_0x18d788['as'],'attributes':_0x18d788[_0xf861('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf861('0xc')](function(_0x47d3bd){logger[_0xf861('0x1e')](_0xf861('0x21'),_0x1e1c05);logger[_0xf861('0xe')](_0xf861('0x21'),_0x1e1c05,JSON[_0xf861('0xf')](_0x47d3bd));_0x354906(_0x47d3bd);})[_0xf861('0x15')](function(_0x17800e){logger[_0xf861('0x10')](_0xf861('0x21'),_0x17800e[_0xf861('0x12')],_0x1e1c05);_0x2123ec(_0x5d4206[_0xf861('0x10')](0x1f4,_0x17800e[_0xf861('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 184543a..b940303 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 _0x50d7=['update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','put'];(function(_0x270afc,_0x51c829){var _0x3c4278=function(_0x5321f0){while(--_0x5321f0){_0x270afc['push'](_0x270afc['shift']());}};_0x3c4278(++_0x51c829);}(_0x50d7,0x115));var _0x750d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x50d7[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x750d('0x0'));var util=require(_0x750d('0x1'));var path=require(_0x750d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x750d('0x3')]();var fs_extra=require(_0x750d('0x4'));var auth=require(_0x750d('0x5'));var interaction=require(_0x750d('0x6'));var config=require(_0x750d('0x7'));var controller=require(_0x750d('0x8'));router[_0x750d('0x9')]('/',auth[_0x750d('0xa')](),controller[_0x750d('0xb')]);router['get'](_0x750d('0xc'),auth[_0x750d('0xa')](),controller[_0x750d('0xd')]);router[_0x750d('0x9')](_0x750d('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x750d('0x9')](_0x750d('0xf'),auth[_0x750d('0xa')](),controller[_0x750d('0x10')]);router['get']('/:id/descriptions',auth[_0x750d('0xa')](),controller[_0x750d('0x11')]);router[_0x750d('0x9')](_0x750d('0x12'),auth['isAuthenticated'](),controller[_0x750d('0x13')]);router[_0x750d('0x14')]('/',auth[_0x750d('0xa')](),controller['create']);router[_0x750d('0x14')](_0x750d('0x12'),auth[_0x750d('0xa')](),controller[_0x750d('0x15')]);router[_0x750d('0x16')](_0x750d('0xc'),auth[_0x750d('0xa')](),controller[_0x750d('0x17')]);router[_0x750d('0x18')](_0x750d('0xc'),auth[_0x750d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8932=['getSubjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','put','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects'];(function(_0xcd49bd,_0x2a12a3){var _0xb6ee44=function(_0x1f77bb){while(--_0x1f77bb){_0xcd49bd['push'](_0xcd49bd['shift']());}};_0xb6ee44(++_0x2a12a3);}(_0x8932,0xd2));var _0x2893=function(_0x40ed9c,_0x4aa80d){_0x40ed9c=_0x40ed9c-0x0;var _0x296758=_0x8932[_0x40ed9c];return _0x296758;};'use strict';var multer=require(_0x2893('0x0'));var util=require(_0x2893('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2893('0x2'));var router=express[_0x2893('0x3')]();var fs_extra=require(_0x2893('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2893('0x5'));var config=require(_0x2893('0x6'));var controller=require(_0x2893('0x7'));router['get']('/',auth[_0x2893('0x8')](),controller[_0x2893('0x9')]);router['get']('/:id',auth[_0x2893('0x8')](),controller[_0x2893('0xa')]);router[_0x2893('0xb')](_0x2893('0xc'),auth['isAuthenticated'](),controller[_0x2893('0xd')]);router[_0x2893('0xb')](_0x2893('0xe'),auth['isAuthenticated'](),controller[_0x2893('0xf')]);router[_0x2893('0xb')](_0x2893('0x10'),auth[_0x2893('0x8')](),controller[_0x2893('0x11')]);router[_0x2893('0xb')]('/:id/tags',auth[_0x2893('0x8')](),controller['getTags']);router['post']('/',auth[_0x2893('0x8')](),controller[_0x2893('0x12')]);router[_0x2893('0x13')](_0x2893('0x14'),auth['isAuthenticated'](),controller[_0x2893('0x15')]);router[_0x2893('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2893('0x8')](),controller[_0x2893('0x17')]);module[_0x2893('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 53d3076..8ec04c4 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 _0x55ab=['sequelize','exports','STRING'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x55ab,0xff));var _0xb55a=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x55ab[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xb55a('0x0'));module[_0xb55a('0x1')]={'name':{'type':Sequelize[_0xb55a('0x2')]},'description':{'type':Sequelize[_0xb55a('0x2')]}}; \ No newline at end of file +var _0x79a6=['sequelize','exports','STRING'];(function(_0x11628a,_0x230a79){var _0x484f67=function(_0xde39c5){while(--_0xde39c5){_0x11628a['push'](_0x11628a['shift']());}};_0x484f67(++_0x230a79);}(_0x79a6,0xf3));var _0x679a=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x79a6[_0x408b34];return _0x1182aa;};'use strict';var Sequelize=require(_0x679a('0x0'));module[_0x679a('0x1')]={'name':{'type':Sequelize[_0x679a('0x2')]},'description':{'type':Sequelize[_0x679a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 3f9e23e..5639084 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 _0x49ac=['sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','show','include','create','body','catch','params','destroy','find','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x49ac,0x141));var _0xc49a=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x49ac[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0xc49a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc49a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc49a('0x2'));var moment=require(_0xc49a('0x3'));var BPromise=require(_0xc49a('0x4'));var Mustache=require(_0xc49a('0x5'));var util=require('util');var path=require(_0xc49a('0x6'));var sox=require(_0xc49a('0x7'));var csv=require('to-csv');var ejs=require(_0xc49a('0x8'));var fs=require('fs');var fs_extra=require(_0xc49a('0x9'));var _=require(_0xc49a('0xa'));var squel=require(_0xc49a('0xb'));var crypto=require(_0xc49a('0xc'));var jsforce=require(_0xc49a('0xd'));var deskjs=require(_0xc49a('0xe'));var toCsv=require(_0xc49a('0xf'));var querystring=require(_0xc49a('0x10'));var Papa=require(_0xc49a('0x11'));var Redis=require(_0xc49a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc49a('0x13'));var as=require(_0xc49a('0x14'));var hardwareService=require(_0xc49a('0x15'));var logger=require(_0xc49a('0x16'))('api');var utils=require(_0xc49a('0x17'));var config=require(_0xc49a('0x18'));var licenseUtil=require(_0xc49a('0x19'));var db=require(_0xc49a('0x1a'))['db'];function respondWithStatusCode(_0x2bc68c,_0x4e22ba){_0x4e22ba=_0x4e22ba||0xcc;return function(_0x4ff65a){if(_0x4ff65a){return _0x2bc68c[_0xc49a('0x1b')](_0x4e22ba);}return _0x2bc68c['status'](_0x4e22ba)[_0xc49a('0x1c')]();};}function respondWithResult(_0x1cd5f7,_0x31a27f){_0x31a27f=_0x31a27f||0xc8;return function(_0x5357d7){if(_0x5357d7){return _0x1cd5f7[_0xc49a('0x1d')](_0x31a27f)[_0xc49a('0x1e')](_0x5357d7);}};}function respondWithFilteredResult(_0x24ab65,_0x3108b0){return function(_0x30a2a0){if(_0x30a2a0){var _0x5c6ddd=typeof _0x3108b0['offset']===_0xc49a('0x1f')&&typeof _0x3108b0['limit']===_0xc49a('0x1f');var _0x31ff53=_0x30a2a0[_0xc49a('0x20')];var _0x2dcc03=_0x5c6ddd?0x0:_0x3108b0[_0xc49a('0x21')];var _0x15c14b=_0x5c6ddd?_0x30a2a0['count']:_0x3108b0['offset']+_0x3108b0['limit'];var _0x54b95c;if(_0x15c14b>=_0x31ff53){_0x15c14b=_0x31ff53;_0x54b95c=0xc8;}else{_0x54b95c=0xce;}_0x24ab65[_0xc49a('0x1d')](_0x54b95c);return _0x24ab65[_0xc49a('0x22')](_0xc49a('0x23'),_0x2dcc03+'-'+_0x15c14b+'/'+_0x31ff53)[_0xc49a('0x1e')](_0x30a2a0);}return null;};}function patchUpdates(_0x5bce50){return function(_0x1b4f83){try{jsonpatch[_0xc49a('0x24')](_0x1b4f83,_0x5bce50,!![]);}catch(_0x1b3da6){return BPromise['reject'](_0x1b3da6);}return _0x1b4f83[_0xc49a('0x25')]();};}function saveUpdates(_0x4d028d,_0x3403a4){return function(_0x62701d){if(_0x62701d){return _0x62701d[_0xc49a('0x26')](_0x4d028d)[_0xc49a('0x27')](function(_0x27387a){return _0x27387a;});}return null;};}function removeEntity(_0x12d5f9,_0x2f8ea1){return function(_0x312d23){if(_0x312d23){return _0x312d23['destroy']()[_0xc49a('0x27')](function(){_0x12d5f9['status'](0xcc)[_0xc49a('0x1c')]();});}};}function handleEntityNotFound(_0x14416b,_0x2734bc){return function(_0x5655c9){if(!_0x5655c9){_0x14416b[_0xc49a('0x1b')](0x194);}return _0x5655c9;};}function handleError(_0x494f83,_0x551431){_0x551431=_0x551431||0x1f4;return function(_0x99fd0e){logger[_0xc49a('0x28')](_0x99fd0e[_0xc49a('0x29')]);if(_0x99fd0e[_0xc49a('0x2a')]){delete _0x99fd0e[_0xc49a('0x2a')];}_0x494f83[_0xc49a('0x1d')](_0x551431)[_0xc49a('0x2b')](_0x99fd0e);};}exports[_0xc49a('0x2c')]=function(_0x582402,_0x4842e2){var _0x53484c={},_0x3c9f92={},_0xe0d5d6={'count':0x0,'rows':[]};var _0x41a0ad=_[_0xc49a('0x2d')](db[_0xc49a('0x2e')][_0xc49a('0x2f')],function(_0x1a977b){return{'name':_0x1a977b['fieldName'],'type':_0x1a977b[_0xc49a('0x30')]['key']};});_0x3c9f92[_0xc49a('0x31')]=_[_0xc49a('0x2d')](_0x41a0ad,_0xc49a('0x2a'));_0x3c9f92[_0xc49a('0x32')]=_[_0xc49a('0x33')](_0x582402['query']);_0x3c9f92['filters']=_[_0xc49a('0x34')](_0x3c9f92['model'],_0x3c9f92[_0xc49a('0x32')]);_0x53484c[_0xc49a('0x35')]=_['intersection'](_0x3c9f92[_0xc49a('0x31')],qs[_0xc49a('0x36')](_0x582402[_0xc49a('0x32')][_0xc49a('0x36')]));_0x53484c['attributes']=_0x53484c[_0xc49a('0x35')][_0xc49a('0x37')]?_0x53484c[_0xc49a('0x35')]:_0x3c9f92['model'];if(!_0x582402['query'][_0xc49a('0x38')](_0xc49a('0x39'))){_0x53484c['limit']=qs[_0xc49a('0x3a')](_0x582402[_0xc49a('0x32')]['limit']);_0x53484c[_0xc49a('0x21')]=qs['offset'](_0x582402[_0xc49a('0x32')][_0xc49a('0x21')]);}_0x53484c[_0xc49a('0x3b')]=qs[_0xc49a('0x3c')](_0x582402[_0xc49a('0x32')][_0xc49a('0x3c')]);_0x53484c[_0xc49a('0x3d')]=qs['filters'](_[_0xc49a('0x3e')](_0x582402[_0xc49a('0x32')],_0x3c9f92[_0xc49a('0x3f')]),_0x41a0ad);if(_0x582402[_0xc49a('0x32')][_0xc49a('0x40')]){_0x53484c[_0xc49a('0x3d')]=_[_0xc49a('0x41')](_0x53484c[_0xc49a('0x3d')],{'$or':_[_0xc49a('0x2d')](_0x41a0ad,function(_0x2b43cd){if(_0x2b43cd['type']!==_0xc49a('0x42')){var _0x1c7b40={};_0x1c7b40[_0x2b43cd[_0xc49a('0x2a')]]={'$like':'%'+_0x582402[_0xc49a('0x32')][_0xc49a('0x40')]+'%'};return _0x1c7b40;}})});}_0x53484c=_[_0xc49a('0x41')]({},_0x53484c,_0x582402[_0xc49a('0x43')]);var _0x11d39d={'where':_0x53484c[_0xc49a('0x3d')]};return db['FreshdeskConfiguration'][_0xc49a('0x20')](_0x11d39d)[_0xc49a('0x27')](function(_0x961b04){_0xe0d5d6[_0xc49a('0x20')]=_0x961b04;if(_0x582402['query'][_0xc49a('0x44')]){_0x53484c['include']=[{'all':!![]}];}return db[_0xc49a('0x2e')][_0xc49a('0x45')](_0x53484c);})[_0xc49a('0x27')](function(_0x4ab57b){_0xe0d5d6['rows']=_0x4ab57b;return _0xe0d5d6;})[_0xc49a('0x27')](respondWithFilteredResult(_0x4842e2,_0x53484c))['catch'](handleError(_0x4842e2,null));};exports[_0xc49a('0x46')]=function(_0x3cf2e7,_0x2d9cbf){var _0x47d71b={'raw':![],'where':{'id':_0x3cf2e7['params']['id']}},_0x473e87={};_0x473e87[_0xc49a('0x31')]=_[_0xc49a('0x33')](db[_0xc49a('0x2e')][_0xc49a('0x2f')]);_0x473e87[_0xc49a('0x32')]=_[_0xc49a('0x33')](_0x3cf2e7[_0xc49a('0x32')]);_0x473e87['filters']=_[_0xc49a('0x34')](_0x473e87['model'],_0x473e87[_0xc49a('0x32')]);_0x47d71b[_0xc49a('0x35')]=_[_0xc49a('0x34')](_0x473e87[_0xc49a('0x31')],qs[_0xc49a('0x36')](_0x3cf2e7['query']['fields']));_0x47d71b[_0xc49a('0x35')]=_0x47d71b['attributes'][_0xc49a('0x37')]?_0x47d71b[_0xc49a('0x35')]:_0x473e87['model'];if(_0x3cf2e7[_0xc49a('0x32')][_0xc49a('0x44')]){_0x47d71b[_0xc49a('0x47')]=[{'all':!![]}];}_0x47d71b=_[_0xc49a('0x41')]({},_0x47d71b,_0x3cf2e7[_0xc49a('0x43')]);return db[_0xc49a('0x2e')]['find'](_0x47d71b)[_0xc49a('0x27')](handleEntityNotFound(_0x2d9cbf,null))['then'](respondWithResult(_0x2d9cbf,null))['catch'](handleError(_0x2d9cbf,null));};exports['create']=function(_0x2b1322,_0x1cb736){return db['FreshdeskConfiguration'][_0xc49a('0x48')](_0x2b1322[_0xc49a('0x49')],{})[_0xc49a('0x27')](respondWithResult(_0x1cb736,0xc9))[_0xc49a('0x4a')](handleError(_0x1cb736,null));};exports[_0xc49a('0x26')]=function(_0xbb5e0d,_0x18735a){if(_0xbb5e0d['body']['id']){delete _0xbb5e0d['body']['id'];}return db[_0xc49a('0x2e')]['find']({'where':{'id':_0xbb5e0d[_0xc49a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18735a,null))[_0xc49a('0x27')](saveUpdates(_0xbb5e0d[_0xc49a('0x49')],null))['then'](respondWithResult(_0x18735a,null))[_0xc49a('0x4a')](handleError(_0x18735a,null));};exports[_0xc49a('0x4c')]=function(_0x46a48e,_0x4c55a2){return db[_0xc49a('0x2e')][_0xc49a('0x4d')]({'where':{'id':_0x46a48e['params']['id']}})['then'](handleEntityNotFound(_0x4c55a2,null))[_0xc49a('0x27')](removeEntity(_0x4c55a2,null))[_0xc49a('0x4a')](handleError(_0x4c55a2,null));};exports[_0xc49a('0x4e')]=function(_0x11f598,_0x49c73b,_0x109283){var _0x2efecb={};var _0x15638e={};var _0x502f43;var _0x211acf;return db[_0xc49a('0x2e')][_0xc49a('0x4f')]({'where':{'id':_0x11f598[_0xc49a('0x4b')]['id']}})[_0xc49a('0x27')](handleEntityNotFound(_0x49c73b,null))[_0xc49a('0x27')](function(_0x4e5b41){if(_0x4e5b41){_0x502f43=_0x4e5b41;_0x15638e['model']=_[_0xc49a('0x33')](db[_0xc49a('0x50')][_0xc49a('0x2f')]);_0x15638e[_0xc49a('0x32')]=_[_0xc49a('0x33')](_0x11f598[_0xc49a('0x32')]);_0x15638e[_0xc49a('0x3f')]=_['intersection'](_0x15638e[_0xc49a('0x31')],_0x15638e['query']);_0x2efecb['attributes']=_[_0xc49a('0x34')](_0x15638e[_0xc49a('0x31')],qs[_0xc49a('0x36')](_0x11f598[_0xc49a('0x32')][_0xc49a('0x36')]));_0x2efecb[_0xc49a('0x35')]=_0x2efecb[_0xc49a('0x35')]['length']?_0x2efecb['attributes']:_0x15638e[_0xc49a('0x31')];_0x2efecb[_0xc49a('0x3b')]=qs[_0xc49a('0x3c')](_0x11f598['query'][_0xc49a('0x3c')]);_0x2efecb[_0xc49a('0x3d')]=qs[_0xc49a('0x3f')](_[_0xc49a('0x3e')](_0x11f598[_0xc49a('0x32')],_0x15638e[_0xc49a('0x3f')]));if(_0x11f598[_0xc49a('0x32')]['filter']){_0x2efecb[_0xc49a('0x3d')]=_[_0xc49a('0x41')](_0x2efecb[_0xc49a('0x3d')],{'$or':_['map'](_0x2efecb[_0xc49a('0x35')],function(_0xce0ef7){var _0x32b533={};_0x32b533[_0xce0ef7]={'$like':'%'+_0x11f598[_0xc49a('0x32')][_0xc49a('0x40')]+'%'};return _0x32b533;})});}_0x2efecb=_[_0xc49a('0x41')]({},_0x2efecb,_0x11f598[_0xc49a('0x43')]);return _0x502f43[_0xc49a('0x4e')](_0x2efecb);}})[_0xc49a('0x27')](function(_0x4342a2){if(_0x4342a2){_0x211acf=_0x4342a2[_0xc49a('0x37')];if(!_0x11f598[_0xc49a('0x32')][_0xc49a('0x38')]('nolimit')){_0x2efecb[_0xc49a('0x3a')]=qs[_0xc49a('0x3a')](_0x11f598['query'][_0xc49a('0x3a')]);_0x2efecb[_0xc49a('0x21')]=qs[_0xc49a('0x21')](_0x11f598[_0xc49a('0x32')]['offset']);}return _0x502f43[_0xc49a('0x4e')](_0x2efecb);}})[_0xc49a('0x27')](function(_0x510f1f){if(_0x510f1f){return _0x510f1f?{'count':_0x211acf,'rows':_0x510f1f}:null;}})['then'](respondWithResult(_0x49c73b,null))[_0xc49a('0x4a')](handleError(_0x49c73b,null));};exports['getSubjects']=function(_0x4f6324,_0xbe567,_0x3e3616){var _0x4eedba={};var _0x55aa72={};var _0x326b43;var _0x45cf07;return db[_0xc49a('0x2e')]['findOne']({'where':{'id':_0x4f6324[_0xc49a('0x4b')]['id']}})[_0xc49a('0x27')](handleEntityNotFound(_0xbe567,null))[_0xc49a('0x27')](function(_0x465491){if(_0x465491){_0x326b43=_0x465491;_0x55aa72[_0xc49a('0x31')]=_['keys'](db[_0xc49a('0x50')][_0xc49a('0x2f')]);_0x55aa72['query']=_[_0xc49a('0x33')](_0x4f6324[_0xc49a('0x32')]);_0x55aa72[_0xc49a('0x3f')]=_[_0xc49a('0x34')](_0x55aa72[_0xc49a('0x31')],_0x55aa72[_0xc49a('0x32')]);_0x4eedba[_0xc49a('0x35')]=_['intersection'](_0x55aa72[_0xc49a('0x31')],qs[_0xc49a('0x36')](_0x4f6324[_0xc49a('0x32')]['fields']));_0x4eedba[_0xc49a('0x35')]=_0x4eedba[_0xc49a('0x35')][_0xc49a('0x37')]?_0x4eedba[_0xc49a('0x35')]:_0x55aa72[_0xc49a('0x31')];_0x4eedba[_0xc49a('0x3b')]=qs[_0xc49a('0x3c')](_0x4f6324[_0xc49a('0x32')]['sort']);_0x4eedba[_0xc49a('0x3d')]=qs[_0xc49a('0x3f')](_['pick'](_0x4f6324['query'],_0x55aa72[_0xc49a('0x3f')]));if(_0x4f6324['query'][_0xc49a('0x40')]){_0x4eedba[_0xc49a('0x3d')]=_[_0xc49a('0x41')](_0x4eedba[_0xc49a('0x3d')],{'$or':_[_0xc49a('0x2d')](_0x4eedba[_0xc49a('0x35')],function(_0x5bc03b){var _0x2681a1={};_0x2681a1[_0x5bc03b]={'$like':'%'+_0x4f6324[_0xc49a('0x32')][_0xc49a('0x40')]+'%'};return _0x2681a1;})});}_0x4eedba=_['merge']({},_0x4eedba,_0x4f6324['options']);return _0x326b43[_0xc49a('0x51')](_0x4eedba);}})['then'](function(_0x3bd6bb){if(_0x3bd6bb){_0x45cf07=_0x3bd6bb[_0xc49a('0x37')];if(!_0x4f6324[_0xc49a('0x32')]['hasOwnProperty'](_0xc49a('0x39'))){_0x4eedba[_0xc49a('0x3a')]=qs[_0xc49a('0x3a')](_0x4f6324[_0xc49a('0x32')][_0xc49a('0x3a')]);_0x4eedba[_0xc49a('0x21')]=qs['offset'](_0x4f6324[_0xc49a('0x32')][_0xc49a('0x21')]);}return _0x326b43['getSubjects'](_0x4eedba);}})['then'](function(_0x115377){if(_0x115377){return _0x115377?{'count':_0x45cf07,'rows':_0x115377}:null;}})[_0xc49a('0x27')](respondWithResult(_0xbe567,null))[_0xc49a('0x4a')](handleError(_0xbe567,null));};exports['getDescriptions']=function(_0x4d1403,_0x67362a,_0x1cab99){var _0x2a1f1c={};var _0x47882a={};var _0x227a93;var _0x8069b6;return db[_0xc49a('0x2e')][_0xc49a('0x4f')]({'where':{'id':_0x4d1403[_0xc49a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x67362a,null))['then'](function(_0x3e69ec){if(_0x3e69ec){_0x227a93=_0x3e69ec;_0x47882a[_0xc49a('0x31')]=_[_0xc49a('0x33')](db[_0xc49a('0x50')][_0xc49a('0x2f')]);_0x47882a[_0xc49a('0x32')]=_[_0xc49a('0x33')](_0x4d1403[_0xc49a('0x32')]);_0x47882a[_0xc49a('0x3f')]=_[_0xc49a('0x34')](_0x47882a[_0xc49a('0x31')],_0x47882a[_0xc49a('0x32')]);_0x2a1f1c[_0xc49a('0x35')]=_[_0xc49a('0x34')](_0x47882a['model'],qs['fields'](_0x4d1403[_0xc49a('0x32')][_0xc49a('0x36')]));_0x2a1f1c[_0xc49a('0x35')]=_0x2a1f1c[_0xc49a('0x35')][_0xc49a('0x37')]?_0x2a1f1c[_0xc49a('0x35')]:_0x47882a[_0xc49a('0x31')];_0x2a1f1c[_0xc49a('0x3b')]=qs[_0xc49a('0x3c')](_0x4d1403[_0xc49a('0x32')]['sort']);_0x2a1f1c['where']=qs[_0xc49a('0x3f')](_[_0xc49a('0x3e')](_0x4d1403[_0xc49a('0x32')],_0x47882a['filters']));if(_0x4d1403[_0xc49a('0x32')][_0xc49a('0x40')]){_0x2a1f1c['where']=_['merge'](_0x2a1f1c[_0xc49a('0x3d')],{'$or':_[_0xc49a('0x2d')](_0x2a1f1c[_0xc49a('0x35')],function(_0x385c07){var _0xc350b2={};_0xc350b2[_0x385c07]={'$like':'%'+_0x4d1403[_0xc49a('0x32')][_0xc49a('0x40')]+'%'};return _0xc350b2;})});}_0x2a1f1c=_[_0xc49a('0x41')]({},_0x2a1f1c,_0x4d1403[_0xc49a('0x43')]);return _0x227a93[_0xc49a('0x52')](_0x2a1f1c);}})[_0xc49a('0x27')](function(_0x54c50d){if(_0x54c50d){_0x8069b6=_0x54c50d[_0xc49a('0x37')];if(!_0x4d1403[_0xc49a('0x32')][_0xc49a('0x38')]('nolimit')){_0x2a1f1c[_0xc49a('0x3a')]=qs[_0xc49a('0x3a')](_0x4d1403[_0xc49a('0x32')][_0xc49a('0x3a')]);_0x2a1f1c[_0xc49a('0x21')]=qs['offset'](_0x4d1403[_0xc49a('0x32')][_0xc49a('0x21')]);}return _0x227a93[_0xc49a('0x52')](_0x2a1f1c);}})['then'](function(_0x396813){if(_0x396813){return _0x396813?{'count':_0x8069b6,'rows':_0x396813}:null;}})[_0xc49a('0x27')](respondWithResult(_0x67362a,null))[_0xc49a('0x4a')](handleError(_0x67362a,null));};exports[_0xc49a('0x53')]=function(_0x4c1650,_0x3e70d1,_0x167809){var _0x49f359={};var _0x40948a={};var _0x9e74b7;var _0x279093;return db[_0xc49a('0x2e')][_0xc49a('0x4f')]({'where':{'id':_0x4c1650[_0xc49a('0x4b')]['id']}})[_0xc49a('0x27')](handleEntityNotFound(_0x3e70d1,null))[_0xc49a('0x27')](function(_0x4b4aa9){if(_0x4b4aa9){_0x9e74b7=_0x4b4aa9;_0x40948a[_0xc49a('0x31')]=_['keys'](db[_0xc49a('0x54')][_0xc49a('0x2f')]);_0x40948a['query']=_['keys'](_0x4c1650['query']);_0x40948a[_0xc49a('0x3f')]=_['intersection'](_0x40948a[_0xc49a('0x31')],_0x40948a[_0xc49a('0x32')]);_0x49f359[_0xc49a('0x35')]=_[_0xc49a('0x34')](_0x40948a[_0xc49a('0x31')],qs['fields'](_0x4c1650['query'][_0xc49a('0x36')]));_0x49f359['attributes']=_0x49f359[_0xc49a('0x35')][_0xc49a('0x37')]?_0x49f359[_0xc49a('0x35')]:_0x40948a[_0xc49a('0x31')];_0x49f359[_0xc49a('0x3b')]=qs[_0xc49a('0x3c')](_0x4c1650[_0xc49a('0x32')][_0xc49a('0x3c')]);_0x49f359['where']=qs[_0xc49a('0x3f')](_['pick'](_0x4c1650[_0xc49a('0x32')],_0x40948a[_0xc49a('0x3f')]));if(_0x4c1650[_0xc49a('0x32')][_0xc49a('0x40')]){_0x49f359[_0xc49a('0x3d')]=_['merge'](_0x49f359['where'],{'$or':_['map'](_0x49f359[_0xc49a('0x35')],function(_0x527f6b){var _0x46c655={};_0x46c655[_0x527f6b]={'$like':'%'+_0x4c1650[_0xc49a('0x32')][_0xc49a('0x40')]+'%'};return _0x46c655;})});}_0x49f359=_[_0xc49a('0x41')]({},_0x49f359,_0x4c1650['options']);return _0x9e74b7[_0xc49a('0x53')](_0x49f359);}})[_0xc49a('0x27')](function(_0x5689b9){if(_0x5689b9){_0x279093=_0x5689b9[_0xc49a('0x37')];if(!_0x4c1650[_0xc49a('0x32')][_0xc49a('0x38')](_0xc49a('0x39'))){_0x49f359[_0xc49a('0x3a')]=qs['limit'](_0x4c1650['query']['limit']);_0x49f359['offset']=qs['offset'](_0x4c1650['query'][_0xc49a('0x21')]);}return _0x9e74b7[_0xc49a('0x53')](_0x49f359);}})[_0xc49a('0x27')](function(_0x3f4c3){if(_0x3f4c3){return _0x3f4c3?{'count':_0x279093,'rows':_0x3f4c3}:null;}})[_0xc49a('0x27')](respondWithResult(_0x3e70d1,null))[_0xc49a('0x4a')](handleError(_0x3e70d1,null));};exports['setTags']=function(_0x24b04b,_0x22b3e3,_0x4d34be){if(_0x24b04b[_0xc49a('0x49')]['id']){delete _0x24b04b[_0xc49a('0x49')]['id'];}return db['FreshdeskConfiguration'][_0xc49a('0x4f')]({'where':{'id':_0x24b04b[_0xc49a('0x4b')]['id']}})[_0xc49a('0x27')](handleEntityNotFound(_0x22b3e3,null))[_0xc49a('0x27')](function(_0xa852f8){if(_0xa852f8){return _0xa852f8[_0xc49a('0x55')](_0x24b04b[_0xc49a('0x49')][_0xc49a('0x56')]||[]);}return null;})[_0xc49a('0x27')](respondWithResult(_0x22b3e3,null))['catch'](handleError(_0x22b3e3,null));}; \ No newline at end of file +var _0x5507=['pick','filters','filter','VIRTUAL','merge','options','count','includeAll','include','catch','show','params','create','body','find','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x448bab,_0x25517b){var _0x5dc534=function(_0x2196ba){while(--_0x2196ba){_0x448bab['push'](_0x448bab['shift']());}};_0x5dc534(++_0x25517b);}(_0x5507,0x1b6));var _0x7550=function(_0x4f8aec,_0x468088){_0x4f8aec=_0x4f8aec-0x0;var _0x343f45=_0x5507[_0x4f8aec];return _0x343f45;};'use strict';var emlformat=require(_0x7550('0x0'));var rimraf=require(_0x7550('0x1'));var zipdir=require(_0x7550('0x2'));var jsonpatch=require(_0x7550('0x3'));var rp=require(_0x7550('0x4'));var moment=require(_0x7550('0x5'));var BPromise=require(_0x7550('0x6'));var Mustache=require(_0x7550('0x7'));var util=require('util');var path=require(_0x7550('0x8'));var sox=require('sox');var csv=require(_0x7550('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7550('0xa'));var _=require(_0x7550('0xb'));var squel=require(_0x7550('0xc'));var crypto=require('crypto');var jsforce=require(_0x7550('0xd'));var deskjs=require(_0x7550('0xe'));var toCsv=require(_0x7550('0x9'));var querystring=require(_0x7550('0xf'));var Papa=require(_0x7550('0x10'));var Redis=require(_0x7550('0x11'));var authService=require(_0x7550('0x12'));var qs=require(_0x7550('0x13'));var as=require(_0x7550('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7550('0x15'));var utils=require(_0x7550('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7550('0x17'));var db=require(_0x7550('0x18'))['db'];function respondWithStatusCode(_0x151867,_0x1da917){_0x1da917=_0x1da917||0xcc;return function(_0x34c7ec){if(_0x34c7ec){return _0x151867[_0x7550('0x19')](_0x1da917);}return _0x151867['status'](_0x1da917)[_0x7550('0x1a')]();};}function respondWithResult(_0x4b2085,_0x6c095a){_0x6c095a=_0x6c095a||0xc8;return function(_0x1e8958){if(_0x1e8958){return _0x4b2085[_0x7550('0x1b')](_0x6c095a)['json'](_0x1e8958);}};}function respondWithFilteredResult(_0x231831,_0x58b002){return function(_0x1f69ff){if(_0x1f69ff){var _0x25a786=typeof _0x58b002['offset']===_0x7550('0x1c')&&typeof _0x58b002['limit']==='undefined';var _0x508171=_0x1f69ff['count'];var _0x208a7a=_0x25a786?0x0:_0x58b002['offset'];var _0x1183e5=_0x25a786?_0x1f69ff['count']:_0x58b002[_0x7550('0x1d')]+_0x58b002[_0x7550('0x1e')];var _0x35b260;if(_0x1183e5>=_0x508171){_0x1183e5=_0x508171;_0x35b260=0xc8;}else{_0x35b260=0xce;}_0x231831[_0x7550('0x1b')](_0x35b260);return _0x231831[_0x7550('0x1f')]('Content-Range',_0x208a7a+'-'+_0x1183e5+'/'+_0x508171)['json'](_0x1f69ff);}return null;};}function patchUpdates(_0x39f25b){return function(_0x593350){try{jsonpatch[_0x7550('0x20')](_0x593350,_0x39f25b,!![]);}catch(_0x52c367){return BPromise[_0x7550('0x21')](_0x52c367);}return _0x593350[_0x7550('0x22')]();};}function saveUpdates(_0x413429,_0x3b98fd){return function(_0x29afd5){if(_0x29afd5){return _0x29afd5[_0x7550('0x23')](_0x413429)[_0x7550('0x24')](function(_0x8ce54c){return _0x8ce54c;});}return null;};}function removeEntity(_0x568afb,_0x3ff582){return function(_0x3aff76){if(_0x3aff76){return _0x3aff76[_0x7550('0x25')]()[_0x7550('0x24')](function(){_0x568afb[_0x7550('0x1b')](0xcc)[_0x7550('0x1a')]();});}};}function handleEntityNotFound(_0x337c33,_0x182466){return function(_0x8f76db){if(!_0x8f76db){_0x337c33['sendStatus'](0x194);}return _0x8f76db;};}function handleError(_0x31572b,_0x47bd91){_0x47bd91=_0x47bd91||0x1f4;return function(_0xc446a1){logger[_0x7550('0x26')](_0xc446a1[_0x7550('0x27')]);if(_0xc446a1['name']){delete _0xc446a1[_0x7550('0x28')];}_0x31572b['status'](_0x47bd91)[_0x7550('0x29')](_0xc446a1);};}exports[_0x7550('0x2a')]=function(_0x35ac46,_0x36b063){var _0x4c063a={},_0x5e1284={},_0x146e24={'count':0x0,'rows':[]};var _0x489438=_['map'](db[_0x7550('0x2b')][_0x7550('0x2c')],function(_0x3bdc09){return{'name':_0x3bdc09['fieldName'],'type':_0x3bdc09[_0x7550('0x2d')][_0x7550('0x2e')]};});_0x5e1284[_0x7550('0x2f')]=_[_0x7550('0x30')](_0x489438,_0x7550('0x28'));_0x5e1284[_0x7550('0x31')]=_[_0x7550('0x32')](_0x35ac46[_0x7550('0x31')]);_0x5e1284['filters']=_[_0x7550('0x33')](_0x5e1284['model'],_0x5e1284[_0x7550('0x31')]);_0x4c063a[_0x7550('0x34')]=_['intersection'](_0x5e1284['model'],qs['fields'](_0x35ac46[_0x7550('0x31')][_0x7550('0x35')]));_0x4c063a['attributes']=_0x4c063a[_0x7550('0x34')][_0x7550('0x36')]?_0x4c063a['attributes']:_0x5e1284[_0x7550('0x2f')];if(!_0x35ac46[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x4c063a[_0x7550('0x1e')]=qs[_0x7550('0x1e')](_0x35ac46[_0x7550('0x31')][_0x7550('0x1e')]);_0x4c063a[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x35ac46[_0x7550('0x31')]['offset']);}_0x4c063a[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x35ac46['query']['sort']);_0x4c063a[_0x7550('0x3b')]=qs['filters'](_[_0x7550('0x3c')](_0x35ac46[_0x7550('0x31')],_0x5e1284[_0x7550('0x3d')]),_0x489438);if(_0x35ac46[_0x7550('0x31')][_0x7550('0x3e')]){_0x4c063a[_0x7550('0x3b')]=_['merge'](_0x4c063a[_0x7550('0x3b')],{'$or':_[_0x7550('0x30')](_0x489438,function(_0x58ff70){if(_0x58ff70[_0x7550('0x2d')]!==_0x7550('0x3f')){var _0x1ab9f9={};_0x1ab9f9[_0x58ff70[_0x7550('0x28')]]={'$like':'%'+_0x35ac46[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x1ab9f9;}})});}_0x4c063a=_[_0x7550('0x40')]({},_0x4c063a,_0x35ac46[_0x7550('0x41')]);var _0x551425={'where':_0x4c063a['where']};return db[_0x7550('0x2b')][_0x7550('0x42')](_0x551425)['then'](function(_0xed737e){_0x146e24[_0x7550('0x42')]=_0xed737e;if(_0x35ac46[_0x7550('0x31')][_0x7550('0x43')]){_0x4c063a[_0x7550('0x44')]=[{'all':!![]}];}return db[_0x7550('0x2b')]['findAll'](_0x4c063a);})[_0x7550('0x24')](function(_0x32ba88){_0x146e24['rows']=_0x32ba88;return _0x146e24;})['then'](respondWithFilteredResult(_0x36b063,_0x4c063a))[_0x7550('0x45')](handleError(_0x36b063,null));};exports[_0x7550('0x46')]=function(_0x99bdb,_0x26e613){var _0xe15e99={'raw':![],'where':{'id':_0x99bdb[_0x7550('0x47')]['id']}},_0xf86b77={};_0xf86b77[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x2b')][_0x7550('0x2c')]);_0xf86b77['query']=_[_0x7550('0x32')](_0x99bdb[_0x7550('0x31')]);_0xf86b77[_0x7550('0x3d')]=_['intersection'](_0xf86b77[_0x7550('0x2f')],_0xf86b77[_0x7550('0x31')]);_0xe15e99[_0x7550('0x34')]=_[_0x7550('0x33')](_0xf86b77['model'],qs[_0x7550('0x35')](_0x99bdb[_0x7550('0x31')][_0x7550('0x35')]));_0xe15e99[_0x7550('0x34')]=_0xe15e99['attributes'][_0x7550('0x36')]?_0xe15e99[_0x7550('0x34')]:_0xf86b77['model'];if(_0x99bdb[_0x7550('0x31')][_0x7550('0x43')]){_0xe15e99[_0x7550('0x44')]=[{'all':!![]}];}_0xe15e99=_[_0x7550('0x40')]({},_0xe15e99,_0x99bdb['options']);return db[_0x7550('0x2b')]['find'](_0xe15e99)[_0x7550('0x24')](handleEntityNotFound(_0x26e613,null))[_0x7550('0x24')](respondWithResult(_0x26e613,null))[_0x7550('0x45')](handleError(_0x26e613,null));};exports[_0x7550('0x48')]=function(_0xa7c0e0,_0x5b1f30){return db['FreshdeskConfiguration'][_0x7550('0x48')](_0xa7c0e0['body'],{})[_0x7550('0x24')](respondWithResult(_0x5b1f30,0xc9))['catch'](handleError(_0x5b1f30,null));};exports[_0x7550('0x23')]=function(_0x2fc7f2,_0x5f00cf){if(_0x2fc7f2[_0x7550('0x49')]['id']){delete _0x2fc7f2[_0x7550('0x49')]['id'];}return db[_0x7550('0x2b')][_0x7550('0x4a')]({'where':{'id':_0x2fc7f2['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x5f00cf,null))[_0x7550('0x24')](saveUpdates(_0x2fc7f2['body'],null))[_0x7550('0x24')](respondWithResult(_0x5f00cf,null))['catch'](handleError(_0x5f00cf,null));};exports['destroy']=function(_0x45b56e,_0x364348){return db[_0x7550('0x2b')][_0x7550('0x4a')]({'where':{'id':_0x45b56e[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x364348,null))[_0x7550('0x24')](removeEntity(_0x364348,null))[_0x7550('0x45')](handleError(_0x364348,null));};exports['getFields']=function(_0x4187,_0x5e4a18,_0x11c40f){var _0x433b07={};var _0x6e8888={};var _0xc1bce3;var _0x2affb2;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x4187['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x5e4a18,null))[_0x7550('0x24')](function(_0x5c41c3){if(_0x5c41c3){_0xc1bce3=_0x5c41c3;_0x6e8888[_0x7550('0x2f')]=_['keys'](db[_0x7550('0x4c')][_0x7550('0x2c')]);_0x6e8888[_0x7550('0x31')]=_[_0x7550('0x32')](_0x4187[_0x7550('0x31')]);_0x6e8888[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x6e8888[_0x7550('0x2f')],_0x6e8888[_0x7550('0x31')]);_0x433b07[_0x7550('0x34')]=_[_0x7550('0x33')](_0x6e8888['model'],qs[_0x7550('0x35')](_0x4187[_0x7550('0x31')]['fields']));_0x433b07['attributes']=_0x433b07[_0x7550('0x34')]['length']?_0x433b07['attributes']:_0x6e8888[_0x7550('0x2f')];_0x433b07[_0x7550('0x39')]=qs['sort'](_0x4187[_0x7550('0x31')][_0x7550('0x3a')]);_0x433b07[_0x7550('0x3b')]=qs['filters'](_['pick'](_0x4187[_0x7550('0x31')],_0x6e8888[_0x7550('0x3d')]));if(_0x4187[_0x7550('0x31')][_0x7550('0x3e')]){_0x433b07[_0x7550('0x3b')]=_[_0x7550('0x40')](_0x433b07[_0x7550('0x3b')],{'$or':_[_0x7550('0x30')](_0x433b07[_0x7550('0x34')],function(_0x187870){var _0x5bc99e={};_0x5bc99e[_0x187870]={'$like':'%'+_0x4187[_0x7550('0x31')]['filter']+'%'};return _0x5bc99e;})});}_0x433b07=_['merge']({},_0x433b07,_0x4187[_0x7550('0x41')]);return _0xc1bce3[_0x7550('0x4d')](_0x433b07);}})[_0x7550('0x24')](function(_0x27c376){if(_0x27c376){_0x2affb2=_0x27c376[_0x7550('0x36')];if(!_0x4187['query'][_0x7550('0x37')](_0x7550('0x38'))){_0x433b07[_0x7550('0x1e')]=qs['limit'](_0x4187[_0x7550('0x31')]['limit']);_0x433b07[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x4187[_0x7550('0x31')][_0x7550('0x1d')]);}return _0xc1bce3[_0x7550('0x4d')](_0x433b07);}})[_0x7550('0x24')](function(_0xb2d129){if(_0xb2d129){return _0xb2d129?{'count':_0x2affb2,'rows':_0xb2d129}:null;}})[_0x7550('0x24')](respondWithResult(_0x5e4a18,null))['catch'](handleError(_0x5e4a18,null));};exports['getSubjects']=function(_0x61d997,_0x4fbd22,_0x5b7abf){var _0x1bf2d3={};var _0x30c8cd={};var _0x535670;var _0x37c9f5;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x61d997['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x4fbd22,null))[_0x7550('0x24')](function(_0x52e75d){if(_0x52e75d){_0x535670=_0x52e75d;_0x30c8cd[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x4c')][_0x7550('0x2c')]);_0x30c8cd[_0x7550('0x31')]=_[_0x7550('0x32')](_0x61d997[_0x7550('0x31')]);_0x30c8cd[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x30c8cd[_0x7550('0x2f')],_0x30c8cd[_0x7550('0x31')]);_0x1bf2d3[_0x7550('0x34')]=_[_0x7550('0x33')](_0x30c8cd[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x61d997[_0x7550('0x31')][_0x7550('0x35')]));_0x1bf2d3[_0x7550('0x34')]=_0x1bf2d3[_0x7550('0x34')][_0x7550('0x36')]?_0x1bf2d3['attributes']:_0x30c8cd[_0x7550('0x2f')];_0x1bf2d3[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x61d997[_0x7550('0x31')][_0x7550('0x3a')]);_0x1bf2d3['where']=qs['filters'](_['pick'](_0x61d997[_0x7550('0x31')],_0x30c8cd['filters']));if(_0x61d997[_0x7550('0x31')][_0x7550('0x3e')]){_0x1bf2d3['where']=_[_0x7550('0x40')](_0x1bf2d3[_0x7550('0x3b')],{'$or':_['map'](_0x1bf2d3[_0x7550('0x34')],function(_0x247769){var _0x4d1827={};_0x4d1827[_0x247769]={'$like':'%'+_0x61d997[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x4d1827;})});}_0x1bf2d3=_[_0x7550('0x40')]({},_0x1bf2d3,_0x61d997[_0x7550('0x41')]);return _0x535670['getSubjects'](_0x1bf2d3);}})['then'](function(_0x4be17a){if(_0x4be17a){_0x37c9f5=_0x4be17a['length'];if(!_0x61d997['query']['hasOwnProperty']('nolimit')){_0x1bf2d3[_0x7550('0x1e')]=qs['limit'](_0x61d997[_0x7550('0x31')][_0x7550('0x1e')]);_0x1bf2d3[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x61d997[_0x7550('0x31')][_0x7550('0x1d')]);}return _0x535670[_0x7550('0x4e')](_0x1bf2d3);}})[_0x7550('0x24')](function(_0x200d46){if(_0x200d46){return _0x200d46?{'count':_0x37c9f5,'rows':_0x200d46}:null;}})[_0x7550('0x24')](respondWithResult(_0x4fbd22,null))['catch'](handleError(_0x4fbd22,null));};exports['getDescriptions']=function(_0x44dd7a,_0x905ac1,_0xac1398){var _0x57b6f3={};var _0x32b164={};var _0x1a7783;var _0x2753ed;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x44dd7a[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x905ac1,null))[_0x7550('0x24')](function(_0x299655){if(_0x299655){_0x1a7783=_0x299655;_0x32b164[_0x7550('0x2f')]=_['keys'](db['FreshdeskField'][_0x7550('0x2c')]);_0x32b164[_0x7550('0x31')]=_[_0x7550('0x32')](_0x44dd7a['query']);_0x32b164[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x32b164['model'],_0x32b164['query']);_0x57b6f3[_0x7550('0x34')]=_[_0x7550('0x33')](_0x32b164[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x44dd7a[_0x7550('0x31')][_0x7550('0x35')]));_0x57b6f3[_0x7550('0x34')]=_0x57b6f3[_0x7550('0x34')]['length']?_0x57b6f3[_0x7550('0x34')]:_0x32b164['model'];_0x57b6f3[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x44dd7a['query'][_0x7550('0x3a')]);_0x57b6f3[_0x7550('0x3b')]=qs[_0x7550('0x3d')](_[_0x7550('0x3c')](_0x44dd7a[_0x7550('0x31')],_0x32b164[_0x7550('0x3d')]));if(_0x44dd7a[_0x7550('0x31')][_0x7550('0x3e')]){_0x57b6f3['where']=_[_0x7550('0x40')](_0x57b6f3['where'],{'$or':_[_0x7550('0x30')](_0x57b6f3[_0x7550('0x34')],function(_0x2f7b54){var _0x279c1e={};_0x279c1e[_0x2f7b54]={'$like':'%'+_0x44dd7a[_0x7550('0x31')]['filter']+'%'};return _0x279c1e;})});}_0x57b6f3=_[_0x7550('0x40')]({},_0x57b6f3,_0x44dd7a[_0x7550('0x41')]);return _0x1a7783[_0x7550('0x4f')](_0x57b6f3);}})[_0x7550('0x24')](function(_0x37df68){if(_0x37df68){_0x2753ed=_0x37df68[_0x7550('0x36')];if(!_0x44dd7a[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x57b6f3[_0x7550('0x1e')]=qs[_0x7550('0x1e')](_0x44dd7a[_0x7550('0x31')][_0x7550('0x1e')]);_0x57b6f3[_0x7550('0x1d')]=qs['offset'](_0x44dd7a[_0x7550('0x31')]['offset']);}return _0x1a7783[_0x7550('0x4f')](_0x57b6f3);}})[_0x7550('0x24')](function(_0x526b92){if(_0x526b92){return _0x526b92?{'count':_0x2753ed,'rows':_0x526b92}:null;}})[_0x7550('0x24')](respondWithResult(_0x905ac1,null))[_0x7550('0x45')](handleError(_0x905ac1,null));};exports[_0x7550('0x50')]=function(_0x3e1d92,_0x27e33a,_0x4bbfec){var _0x2f74cf={};var _0x56de0e={};var _0x1afa7f;var _0x4de7ce;return db[_0x7550('0x2b')]['findOne']({'where':{'id':_0x3e1d92['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x27e33a,null))[_0x7550('0x24')](function(_0x32e7a4){if(_0x32e7a4){_0x1afa7f=_0x32e7a4;_0x56de0e[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x51')][_0x7550('0x2c')]);_0x56de0e[_0x7550('0x31')]=_['keys'](_0x3e1d92[_0x7550('0x31')]);_0x56de0e[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x56de0e[_0x7550('0x2f')],_0x56de0e['query']);_0x2f74cf['attributes']=_[_0x7550('0x33')](_0x56de0e[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x3e1d92['query'][_0x7550('0x35')]));_0x2f74cf[_0x7550('0x34')]=_0x2f74cf['attributes'][_0x7550('0x36')]?_0x2f74cf[_0x7550('0x34')]:_0x56de0e[_0x7550('0x2f')];_0x2f74cf['order']=qs[_0x7550('0x3a')](_0x3e1d92[_0x7550('0x31')][_0x7550('0x3a')]);_0x2f74cf['where']=qs[_0x7550('0x3d')](_[_0x7550('0x3c')](_0x3e1d92[_0x7550('0x31')],_0x56de0e[_0x7550('0x3d')]));if(_0x3e1d92[_0x7550('0x31')]['filter']){_0x2f74cf[_0x7550('0x3b')]=_[_0x7550('0x40')](_0x2f74cf['where'],{'$or':_['map'](_0x2f74cf[_0x7550('0x34')],function(_0x4d7626){var _0x3bc202={};_0x3bc202[_0x4d7626]={'$like':'%'+_0x3e1d92[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x3bc202;})});}_0x2f74cf=_[_0x7550('0x40')]({},_0x2f74cf,_0x3e1d92['options']);return _0x1afa7f[_0x7550('0x50')](_0x2f74cf);}})[_0x7550('0x24')](function(_0x22e410){if(_0x22e410){_0x4de7ce=_0x22e410[_0x7550('0x36')];if(!_0x3e1d92[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x2f74cf['limit']=qs[_0x7550('0x1e')](_0x3e1d92['query'][_0x7550('0x1e')]);_0x2f74cf['offset']=qs[_0x7550('0x1d')](_0x3e1d92[_0x7550('0x31')][_0x7550('0x1d')]);}return _0x1afa7f[_0x7550('0x50')](_0x2f74cf);}})['then'](function(_0xce51f6){if(_0xce51f6){return _0xce51f6?{'count':_0x4de7ce,'rows':_0xce51f6}:null;}})[_0x7550('0x24')](respondWithResult(_0x27e33a,null))[_0x7550('0x45')](handleError(_0x27e33a,null));};exports[_0x7550('0x52')]=function(_0x2bc81d,_0x456977,_0x5482b6){if(_0x2bc81d[_0x7550('0x49')]['id']){delete _0x2bc81d[_0x7550('0x49')]['id'];}return db[_0x7550('0x2b')]['findOne']({'where':{'id':_0x2bc81d[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x456977,null))['then'](function(_0x21a02c){if(_0x21a02c){return _0x21a02c[_0x7550('0x52')](_0x2bc81d[_0x7550('0x49')]['ids']||[]);}return null;})[_0x7550('0x24')](respondWithResult(_0x456977,null))['catch'](handleError(_0x456977,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3bbb3d4..4d5b91f 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 _0xe414=['util','api','moment','bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash'];(function(_0x3ead6b,_0x54cba2){var _0x12d181=function(_0x569654){while(--_0x569654){_0x3ead6b['push'](_0x3ead6b['shift']());}};_0x12d181(++_0x54cba2);}(_0xe414,0x107));var _0x4e41=function(_0x33ce1d,_0x194c23){_0x33ce1d=_0x33ce1d-0x0;var _0x50ffb0=_0xe414[_0x33ce1d];return _0x50ffb0;};'use strict';var _=require(_0x4e41('0x0'));var util=require(_0x4e41('0x1'));var logger=require('../../config/logger')(_0x4e41('0x2'));var moment=require(_0x4e41('0x3'));var BPromise=require(_0x4e41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e41('0x5'));var rimraf=require('rimraf');var config=require(_0x4e41('0x6'));var attributes=require(_0x4e41('0x7'));module[_0x4e41('0x8')]=function(_0x334ff3,_0x2f7e90){return _0x334ff3[_0x4e41('0x9')](_0x4e41('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb22f=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api'];(function(_0x44e1d7,_0x5ef46b){var _0x414a28=function(_0x1e6494){while(--_0x1e6494){_0x44e1d7['push'](_0x44e1d7['shift']());}};_0x414a28(++_0x5ef46b);}(_0xb22f,0xc3));var _0xfb22=function(_0x5cfdbc,_0x21f713){_0x5cfdbc=_0x5cfdbc-0x0;var _0x2c2d98=_0xb22f[_0x5cfdbc];return _0x2c2d98;};'use strict';var _=require(_0xfb22('0x0'));var util=require(_0xfb22('0x1'));var logger=require('../../config/logger')(_0xfb22('0x2'));var moment=require('moment');var BPromise=require(_0xfb22('0x3'));var rp=require(_0xfb22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb22('0x5'));var config=require(_0xfb22('0x6'));var attributes=require(_0xfb22('0x7'));module['exports']=function(_0x28b52d,_0x3ea7fb){return _0x28b52d[_0xfb22('0x8')](_0xfb22('0x9'),attributes,{'tableName':_0xfb22('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 47f4133..4e343fb 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 _0x1db1=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x53298a,_0x1660b6){var _0x232e46=function(_0x52413b){while(--_0x52413b){_0x53298a['push'](_0x53298a['shift']());}};_0x232e46(++_0x1660b6);}(_0x1db1,0x12c));var _0x11db=function(_0x22988a,_0x491675){_0x22988a=_0x22988a-0x0;var _0x5315f3=_0x1db1[_0x22988a];return _0x5315f3;};'use strict';var _=require(_0x11db('0x0'));var util=require(_0x11db('0x1'));var moment=require(_0x11db('0x2'));var BPromise=require(_0x11db('0x3'));var rs=require(_0x11db('0x4'));var fs=require('fs');var Redis=require(_0x11db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x11db('0x6'));var logger=require(_0x11db('0x7'))('rpc');var config=require(_0x11db('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x11db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1887b7,_0xc1524d,_0x4f6ef4){return new BPromise(function(_0x99d168,_0x62f38){return client[_0x11db('0xa')](_0x1887b7,_0x4f6ef4)[_0x11db('0xb')](function(_0x248a98){logger[_0x11db('0xc')](_0x11db('0xd'),_0xc1524d,_0x11db('0xe'));logger[_0x11db('0xf')](_0x11db('0x10'),_0xc1524d,_0x11db('0xe'),JSON['stringify'](_0x248a98));if(_0x248a98['error']){if(_0x248a98[_0x11db('0x11')]['code']===0x1f4){logger[_0x11db('0x11')](_0x11db('0xd'),_0xc1524d,_0x248a98['error'][_0x11db('0x12')]);return _0x62f38(_0x248a98[_0x11db('0x11')]['message']);}logger['error'](_0x11db('0xd'),_0xc1524d,_0x248a98['error'][_0x11db('0x12')]);return _0x99d168(_0x248a98[_0x11db('0x11')][_0x11db('0x12')]);}else{logger[_0x11db('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xc1524d,_0x11db('0xe'));_0x99d168(_0x248a98[_0x11db('0x13')][_0x11db('0x12')]);}})[_0x11db('0x14')](function(_0x196fee){logger['error'](_0x11db('0xd'),_0xc1524d,_0x196fee);_0x62f38(_0x196fee);});});} \ No newline at end of file +var _0xa908=['message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xa908,0x119));var _0x8a90=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0xa908[_0x3a8b7c];return _0x40eb80;};'use strict';var _=require('lodash');var util=require(_0x8a90('0x0'));var moment=require(_0x8a90('0x1'));var BPromise=require(_0x8a90('0x2'));var rs=require(_0x8a90('0x3'));var fs=require('fs');var Redis=require(_0x8a90('0x4'));var db=require(_0x8a90('0x5'))['db'];var utils=require(_0x8a90('0x6'));var logger=require(_0x8a90('0x7'))(_0x8a90('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a90('0x9')][_0x8a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562814,_0x5050a7,_0x4c0da8){return new BPromise(function(_0x162dbf,_0x164462){return client[_0x8a90('0xb')](_0x562814,_0x4c0da8)[_0x8a90('0xc')](function(_0x3e1134){logger[_0x8a90('0xd')](_0x8a90('0xe'),_0x5050a7,'request\x20sent');logger[_0x8a90('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5050a7,_0x8a90('0x10'),JSON[_0x8a90('0x11')](_0x3e1134));if(_0x3e1134['error']){if(_0x3e1134[_0x8a90('0x12')]['code']===0x1f4){logger[_0x8a90('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5050a7,_0x3e1134[_0x8a90('0x12')]['message']);return _0x164462(_0x3e1134[_0x8a90('0x12')][_0x8a90('0x13')]);}logger[_0x8a90('0x12')](_0x8a90('0xe'),_0x5050a7,_0x3e1134['error'][_0x8a90('0x13')]);return _0x162dbf(_0x3e1134[_0x8a90('0x12')][_0x8a90('0x13')]);}else{logger[_0x8a90('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5050a7,_0x8a90('0x10'));_0x162dbf(_0x3e1134['result']['message']);}})['catch'](function(_0x2163bd){logger[_0x8a90('0x12')](_0x8a90('0xe'),_0x5050a7,_0x2163bd);_0x164462(_0x2163bd);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 164f54f..57ded2c 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 _0x9189=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','show','post','create'];(function(_0x3be43c,_0x1ba5d7){var _0x2f92a8=function(_0x330953){while(--_0x330953){_0x3be43c['push'](_0x3be43c['shift']());}};_0x2f92a8(++_0x1ba5d7);}(_0x9189,0x1a7));var _0x9918=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0x9189[_0x158f01];return _0x5ef74e;};'use strict';var multer=require(_0x9918('0x0'));var util=require(_0x9918('0x1'));var path=require(_0x9918('0x2'));var timeout=require(_0x9918('0x3'));var express=require(_0x9918('0x4'));var router=express[_0x9918('0x5')]();var fs_extra=require(_0x9918('0x6'));var auth=require(_0x9918('0x7'));var interaction=require(_0x9918('0x8'));var config=require(_0x9918('0x9'));var controller=require(_0x9918('0xa'));router['get']('/',auth[_0x9918('0xb')](),controller[_0x9918('0xc')]);router[_0x9918('0xd')]('/:id',auth[_0x9918('0xb')](),controller[_0x9918('0xe')]);router[_0x9918('0xf')]('/',auth[_0x9918('0xb')](),controller[_0x9918('0x10')]);router[_0x9918('0x11')](_0x9918('0x12'),auth[_0x9918('0xb')](),controller['update']);router[_0x9918('0x13')](_0x9918('0x12'),auth[_0x9918('0xb')](),controller[_0x9918('0x14')]);module[_0x9918('0x15')]=router; \ No newline at end of file +var _0x018a=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0xb0ef0d,_0x152f1a){var _0x32adba=function(_0x296bad){while(--_0x296bad){_0xb0ef0d['push'](_0xb0ef0d['shift']());}};_0x32adba(++_0x152f1a);}(_0x018a,0x19a));var _0xa018=function(_0x431f27,_0x152cc4){_0x431f27=_0x431f27-0x0;var _0x559a65=_0x018a[_0x431f27];return _0x559a65;};'use strict';var multer=require(_0xa018('0x0'));var util=require('util');var path=require(_0xa018('0x1'));var timeout=require('connect-timeout');var express=require(_0xa018('0x2'));var router=express[_0xa018('0x3')]();var fs_extra=require(_0xa018('0x4'));var auth=require(_0xa018('0x5'));var interaction=require(_0xa018('0x6'));var config=require(_0xa018('0x7'));var controller=require(_0xa018('0x8'));router[_0xa018('0x9')]('/',auth[_0xa018('0xa')](),controller[_0xa018('0xb')]);router[_0xa018('0x9')](_0xa018('0xc'),auth['isAuthenticated'](),controller[_0xa018('0xd')]);router[_0xa018('0xe')]('/',auth[_0xa018('0xa')](),controller[_0xa018('0xf')]);router[_0xa018('0x10')]('/:id',auth[_0xa018('0xa')](),controller[_0xa018('0x11')]);router[_0xa018('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa018('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 13a8a35..0bba0dd 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 _0xc44b=['picklist','string','STRING','BOOLEAN','sequelize','exports','customVariable','keyValue'];(function(_0x2649c3,_0x4518f9){var _0x307fb8=function(_0xc1b018){while(--_0xc1b018){_0x2649c3['push'](_0x2649c3['shift']());}};_0x307fb8(++_0x4518f9);}(_0xc44b,0x9c));var _0xbc44=function(_0x28089e,_0x530f8a){_0x28089e=_0x28089e-0x0;var _0x46a73c=_0xc44b[_0x28089e];return _0x46a73c;};'use strict';var Sequelize=require(_0xbc44('0x0'));module[_0xbc44('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xbc44('0x2'),_0xbc44('0x3'),_0xbc44('0x4')),'defaultValue':_0xbc44('0x5')},'content':{'type':Sequelize[_0xbc44('0x6')]},'key':{'type':Sequelize[_0xbc44('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xbc44('0x6')]},'idField':{'type':Sequelize[_0xbc44('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbc44('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbc44('0x6')]}}; \ No newline at end of file +var _0x84de=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x1a6c17,_0x1909c5){var _0x2ede84=function(_0x1d6873){while(--_0x1d6873){_0x1a6c17['push'](_0x1a6c17['shift']());}};_0x2ede84(++_0x1909c5);}(_0x84de,0xfe));var _0xe84d=function(_0x245c4f,_0x34b70f){_0x245c4f=_0x245c4f-0x0;var _0x3157a1=_0x84de[_0x245c4f];return _0x3157a1;};'use strict';var Sequelize=require(_0xe84d('0x0'));module[_0xe84d('0x1')]={'type':{'type':Sequelize[_0xe84d('0x2')](_0xe84d('0x3'),_0xe84d('0x4'),_0xe84d('0x5'),'keyValue',_0xe84d('0x6')),'defaultValue':_0xe84d('0x3')},'content':{'type':Sequelize[_0xe84d('0x7')]},'key':{'type':Sequelize[_0xe84d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe84d('0x3'),_0xe84d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe84d('0x7')]},'idField':{'type':Sequelize[_0xe84d('0x7')]},'nameField':{'type':Sequelize[_0xe84d('0x7')]},'customField':{'type':Sequelize[_0xe84d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe84d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f6411da..93f652e 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 _0x2e54=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','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','apply','reject','save','then','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x1761f0,_0x27fe8b){var _0x371d9f=function(_0x4b1a4e){while(--_0x4b1a4e){_0x1761f0['push'](_0x1761f0['shift']());}};_0x371d9f(++_0x27fe8b);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3d1482,_0x4eb5e9){_0x3d1482=_0x3d1482-0x0;var _0x4f64f2=_0x2e54[_0x3d1482];return _0x4f64f2;};'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(){_0x37d10e[_0x42e5('0x19')](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x275c80,_0x4638bc){return function(_0x4f52b2){if(!_0x4f52b2){_0x275c80['sendStatus'](0x194);}return _0x4f52b2;};}function handleError(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0x1f4;return function(_0x56f812){logger[_0x42e5('0x25')](_0x56f812['stack']);if(_0x56f812[_0x42e5('0x26')]){delete _0x56f812[_0x42e5('0x26')];}_0x3115e4[_0x42e5('0x19')](_0x534a26)[_0x42e5('0x27')](_0x56f812);};}exports[_0x42e5('0x28')]=function(_0x2f1edc,_0x59a46b){var _0x3e2ea5={},_0x201d9e={},_0x39f763={'count':0x0,'rows':[]};var _0x2c53d4=_[_0x42e5('0x29')](db[_0x42e5('0x2a')][_0x42e5('0x2b')],function(_0x282cbf){return{'name':_0x282cbf[_0x42e5('0x2c')],'type':_0x282cbf[_0x42e5('0x2d')][_0x42e5('0x2e')]};});_0x201d9e[_0x42e5('0x2f')]=_[_0x42e5('0x29')](_0x2c53d4,'name');_0x201d9e[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2f1edc[_0x42e5('0x30')]);_0x201d9e[_0x42e5('0x32')]=_['intersection'](_0x201d9e['model'],_0x201d9e[_0x42e5('0x30')]);_0x3e2ea5['attributes']=_[_0x42e5('0x33')](_0x201d9e['model'],qs[_0x42e5('0x34')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x34')]));_0x3e2ea5['attributes']=_0x3e2ea5[_0x42e5('0x35')][_0x42e5('0x36')]?_0x3e2ea5['attributes']:_0x201d9e[_0x42e5('0x2f')];if(!_0x2f1edc['query'][_0x42e5('0x37')](_0x42e5('0x38'))){_0x3e2ea5[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x1e')]);_0x3e2ea5[_0x42e5('0x1c')]=qs['offset'](_0x2f1edc['query'][_0x42e5('0x1c')]);}_0x3e2ea5[_0x42e5('0x39')]=qs[_0x42e5('0x3a')](_0x2f1edc['query']['sort']);_0x3e2ea5['where']=qs['filters'](_[_0x42e5('0x3b')](_0x2f1edc[_0x42e5('0x30')],_0x201d9e[_0x42e5('0x32')]),_0x2c53d4);if(_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]){_0x3e2ea5[_0x42e5('0x3d')]=_[_0x42e5('0x3e')](_0x3e2ea5[_0x42e5('0x3d')],{'$or':_['map'](_0x2c53d4,function(_0x260413){if(_0x260413['type']!==_0x42e5('0x3f')){var _0x343363={};_0x343363[_0x260413[_0x42e5('0x26')]]={'$like':'%'+_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]+'%'};return _0x343363;}})});}_0x3e2ea5=_[_0x42e5('0x3e')]({},_0x3e2ea5,_0x2f1edc[_0x42e5('0x40')]);var _0x5ab9b8={'where':_0x3e2ea5[_0x42e5('0x3d')]};return db[_0x42e5('0x2a')]['count'](_0x5ab9b8)[_0x42e5('0x24')](function(_0x5e8f96){_0x39f763['count']=_0x5e8f96;if(_0x2f1edc['query'][_0x42e5('0x41')]){_0x3e2ea5[_0x42e5('0x42')]=[{'all':!![]}];}return db[_0x42e5('0x2a')][_0x42e5('0x43')](_0x3e2ea5);})[_0x42e5('0x24')](function(_0x77aa22){_0x39f763[_0x42e5('0x44')]=_0x77aa22;return _0x39f763;})['then'](respondWithFilteredResult(_0x59a46b,_0x3e2ea5))[_0x42e5('0x45')](handleError(_0x59a46b,null));};exports[_0x42e5('0x46')]=function(_0x5bec97,_0x398b73){var _0x1c697a={'raw':!![],'where':{'id':_0x5bec97[_0x42e5('0x47')]['id']}},_0x5db771={};_0x5db771[_0x42e5('0x2f')]=_[_0x42e5('0x31')](db[_0x42e5('0x2a')][_0x42e5('0x2b')]);_0x5db771['query']=_[_0x42e5('0x31')](_0x5bec97[_0x42e5('0x30')]);_0x5db771[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x5db771['model'],_0x5db771[_0x42e5('0x30')]);_0x1c697a[_0x42e5('0x35')]=_[_0x42e5('0x33')](_0x5db771[_0x42e5('0x2f')],qs[_0x42e5('0x34')](_0x5bec97[_0x42e5('0x30')][_0x42e5('0x34')]));_0x1c697a[_0x42e5('0x35')]=_0x1c697a['attributes'][_0x42e5('0x36')]?_0x1c697a['attributes']:_0x5db771['model'];if(_0x5bec97[_0x42e5('0x30')][_0x42e5('0x41')]){_0x1c697a[_0x42e5('0x42')]=[{'all':!![]}];}_0x1c697a=_[_0x42e5('0x3e')]({},_0x1c697a,_0x5bec97[_0x42e5('0x40')]);return db[_0x42e5('0x2a')][_0x42e5('0x48')](_0x1c697a)['then'](handleEntityNotFound(_0x398b73,null))[_0x42e5('0x24')](respondWithResult(_0x398b73,null))[_0x42e5('0x45')](handleError(_0x398b73,null));};exports[_0x42e5('0x49')]=function(_0x21a047,_0x1086b2){return db[_0x42e5('0x2a')][_0x42e5('0x49')](_0x21a047[_0x42e5('0x4a')],{})['then'](respondWithResult(_0x1086b2,0xc9))[_0x42e5('0x45')](handleError(_0x1086b2,null));};exports[_0x42e5('0x4b')]=function(_0x3616f4,_0x48757e){if(_0x3616f4[_0x42e5('0x4a')]['id']){delete _0x3616f4[_0x42e5('0x4a')]['id'];}return db[_0x42e5('0x2a')][_0x42e5('0x48')]({'where':{'id':_0x3616f4[_0x42e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x48757e,null))[_0x42e5('0x24')](saveUpdates(_0x3616f4['body'],null))[_0x42e5('0x24')](respondWithResult(_0x48757e,null))[_0x42e5('0x45')](handleError(_0x48757e,null));};exports[_0x42e5('0x4c')]=function(_0x48b63b,_0x50f59c){return db['FreshdeskField'][_0x42e5('0x48')]({'where':{'id':_0x48b63b[_0x42e5('0x47')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x50f59c,null))[_0x42e5('0x24')](removeEntity(_0x50f59c,null))['catch'](handleError(_0x50f59c,null));}; \ No newline at end of file +var _0xb6b1=['set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x30c879,_0x18ffe8){var _0x45e4ce=function(_0x50dade){while(--_0x50dade){_0x30c879['push'](_0x30c879['shift']());}};_0x45e4ce(++_0x18ffe8);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xb6b1[_0x2b0bc2];return _0x56e5b9;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1000ccb..cf08978 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 _0x34ab=['../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x2d92ed,_0x13983c){var _0x5f446d=function(_0x473f42){while(--_0x473f42){_0x2d92ed['push'](_0x2d92ed['shift']());}};_0x5f446d(++_0x13983c);}(_0x34ab,0xf1));var _0xb34a=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x34ab[_0x23b655];return _0x364b32;};'use strict';var _=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb34a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb34a('0x5'));var config=require(_0xb34a('0x6'));var attributes=require(_0xb34a('0x7'));module['exports']=function(_0x6e669,_0x1f6df3){return _0x6e669[_0xb34a('0x8')](_0xb34a('0x9'),attributes,{'tableName':_0xb34a('0xa'),'paranoid':![],'indexes':[{'name':_0xb34a('0xb'),'fields':[_0xb34a('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3643=['FieldId','lodash','api','moment','bluebird','request-promise','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x43eb84,_0x2f0fe1){var _0x1fc8b9=function(_0x8acde4){while(--_0x8acde4){_0x43eb84['push'](_0x43eb84['shift']());}};_0x1fc8b9(++_0x2f0fe1);}(_0x3643,0xa9));var _0x3364=function(_0x264b2b,_0x2133a0){_0x264b2b=_0x264b2b-0x0;var _0x5f1df4=_0x3643[_0x264b2b];return _0x5f1df4;};'use strict';var _=require(_0x3364('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3364('0x1'));var moment=require(_0x3364('0x2'));var BPromise=require(_0x3364('0x3'));var rp=require(_0x3364('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3364('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0x3364('0x6')]=function(_0x439a3c,_0x5bbfb3){return _0x439a3c[_0x3364('0x7')](_0x3364('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3364('0x9'),'fields':[_0x3364('0xa'),_0x3364('0xb')],'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 98bdd4c..7723261 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 _0xc591=['then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xc591,0xf2));var _0x1c59=function(_0x43d952,_0x453ec9){_0x43d952=_0x43d952-0x0;var _0x1c53b5=_0xc591[_0x43d952];return _0x1c53b5;};'use strict';var _=require(_0x1c59('0x0'));var util=require('util');var moment=require(_0x1c59('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c59('0x2'));var fs=require('fs');var Redis=require(_0x1c59('0x3'));var db=require(_0x1c59('0x4'))['db'];var utils=require(_0x1c59('0x5'));var logger=require(_0x1c59('0x6'))('rpc');var config=require(_0x1c59('0x7'));var jayson=require(_0x1c59('0x8'));var client=jayson[_0x1c59('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15bcee,_0x324110,_0x22b70a){return new BPromise(function(_0x334b54,_0x42b568){return client['request'](_0x15bcee,_0x22b70a)[_0x1c59('0xa')](function(_0x553a6e){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x324110,_0x1c59('0xb'));logger[_0x1c59('0xc')](_0x1c59('0xd'),_0x324110,_0x1c59('0xb'),JSON['stringify'](_0x553a6e));if(_0x553a6e[_0x1c59('0xe')]){if(_0x553a6e[_0x1c59('0xe')][_0x1c59('0xf')]===0x1f4){logger['error'](_0x1c59('0x10'),_0x324110,_0x553a6e[_0x1c59('0xe')][_0x1c59('0x11')]);return _0x42b568(_0x553a6e['error'][_0x1c59('0x11')]);}logger['error'](_0x1c59('0x10'),_0x324110,_0x553a6e[_0x1c59('0xe')][_0x1c59('0x11')]);return _0x334b54(_0x553a6e[_0x1c59('0xe')][_0x1c59('0x11')]);}else{logger[_0x1c59('0x12')](_0x1c59('0x10'),_0x324110,'request\x20sent');_0x334b54(_0x553a6e[_0x1c59('0x13')]['message']);}})[_0x1c59('0x14')](function(_0x801ae3){logger[_0x1c59('0xe')](_0x1c59('0x10'),_0x324110,_0x801ae3);_0x42b568(_0x801ae3);});});} \ No newline at end of file +var _0x3349=['jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3faf76,_0x1a75ca){var _0x45cc55=function(_0x2d640d){while(--_0x2d640d){_0x3faf76['push'](_0x3faf76['shift']());}};_0x45cc55(++_0x1a75ca);}(_0x3349,0x142));var _0x9334=function(_0x244e46,_0x5a2dd3){_0x244e46=_0x244e46-0x0;var _0x1bacd5=_0x3349[_0x244e46];return _0x1bacd5;};'use strict';var _=require(_0x9334('0x0'));var util=require(_0x9334('0x1'));var moment=require(_0x9334('0x2'));var BPromise=require(_0x9334('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9334('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9334('0x5'));var logger=require(_0x9334('0x6'))(_0x9334('0x7'));var config=require('../../config/environment');var jayson=require(_0x9334('0x8'));var client=jayson[_0x9334('0x9')][_0x9334('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x116dd4,_0x4dab4f,_0x2efa76){return new BPromise(function(_0x223831,_0x1b5827){return client[_0x9334('0xb')](_0x116dd4,_0x2efa76)[_0x9334('0xc')](function(_0x78eea){logger[_0x9334('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x4dab4f,'request\x20sent');logger['debug'](_0x9334('0xe'),_0x4dab4f,_0x9334('0xf'),JSON['stringify'](_0x78eea));if(_0x78eea[_0x9334('0x10')]){if(_0x78eea[_0x9334('0x10')][_0x9334('0x11')]===0x1f4){logger['error'](_0x9334('0x12'),_0x4dab4f,_0x78eea[_0x9334('0x10')]['message']);return _0x1b5827(_0x78eea[_0x9334('0x10')][_0x9334('0x13')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x4dab4f,_0x78eea[_0x9334('0x10')][_0x9334('0x13')]);return _0x223831(_0x78eea['error'][_0x9334('0x13')]);}else{logger[_0x9334('0xd')](_0x9334('0x12'),_0x4dab4f,_0x9334('0xf'));_0x223831(_0x78eea[_0x9334('0x14')]['message']);}})[_0x9334('0x15')](function(_0x4fd26c){logger[_0x9334('0x10')](_0x9334('0x12'),_0x4dab4f,_0x4fd26c);_0x1b5827(_0x4fd26c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 229223d..d6a7b47 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 _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x195a3b,_0x6e9cf1){var _0x3b915f=function(_0x89f215){while(--_0x89f215){_0x195a3b['push'](_0x195a3b['shift']());}};_0x3b915f(++_0x6e9cf1);}(_0x96cc,0x16c));var _0xc96c=function(_0x475575,_0x30d540){_0x475575=_0x475575-0x0;var _0x53e8d8=_0x96cc[_0x475575];return _0x53e8d8;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file +var _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x56b215,_0x3adc22){var _0x23219c=function(_0x5e4690){while(--_0x5e4690){_0x56b215['push'](_0x56b215['shift']());}};_0x23219c(++_0x3adc22);}(_0xefda,0x96));var _0xaefd=function(_0x1d15cd,_0x9933cf){_0x1d15cd=_0x1d15cd-0x0;var _0x22a70a=_0xefda[_0x1d15cd];return _0x22a70a;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 2a6b5cb..567ebbd 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 _0x1a85=['STRING','remoteUri'];(function(_0x1c6476,_0x438e0e){var _0x9b7648=function(_0x2814a2){while(--_0x2814a2){_0x1c6476['push'](_0x1c6476['shift']());}};_0x9b7648(++_0x438e0e);}(_0x1a85,0x178));var _0x51a8=function(_0x5d8792,_0x4f5438){_0x5d8792=_0x5d8792-0x0;var _0x986d0e=_0x1a85[_0x5d8792];return _0x986d0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0xa2c7d0,_0x45b4df){var _0x21cef4=function(_0x3baf1c){while(--_0x3baf1c){_0xa2c7d0['push'](_0xa2c7d0['shift']());}};_0x21cef4(++_0x45b4df);}(_0x5464,0x15d));var _0x4546=function(_0x5e1988,_0x5c7414){_0x5e1988=_0x5e1988-0x0;var _0x4549c0=_0x5464[_0x5e1988];return _0x4549c0;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('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 a89db75..0cd352f 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 _0x48ae=['limit','count','set','Content-Range','then','destroy','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','findAll','catch','show','filters','intersection','include','body','update','find','params','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x52d478,_0x2ca6b5){var _0x7adadf=function(_0x39a1aa){while(--_0x39a1aa){_0x52d478['push'](_0x52d478['shift']());}};_0x7adadf(++_0x2ca6b5);}(_0x48ae,0x1d1));var _0xe48a=function(_0x667c97,_0x434375){_0x667c97=_0x667c97-0x0;var _0x394280=_0x48ae[_0x667c97];return _0x394280;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe48a('0x0'));var zipdir=require(_0xe48a('0x1'));var jsonpatch=require(_0xe48a('0x2'));var rp=require('request-promise');var moment=require(_0xe48a('0x3'));var BPromise=require(_0xe48a('0x4'));var Mustache=require(_0xe48a('0x5'));var util=require(_0xe48a('0x6'));var path=require(_0xe48a('0x7'));var sox=require(_0xe48a('0x8'));var csv=require(_0xe48a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe48a('0xa'));var _=require('lodash');var squel=require(_0xe48a('0xb'));var crypto=require(_0xe48a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe48a('0xd'));var toCsv=require(_0xe48a('0x9'));var querystring=require('querystring');var Papa=require(_0xe48a('0xe'));var Redis=require(_0xe48a('0xf'));var authService=require(_0xe48a('0x10'));var qs=require(_0xe48a('0x11'));var as=require(_0xe48a('0x12'));var hardwareService=require(_0xe48a('0x13'));var logger=require(_0xe48a('0x14'))(_0xe48a('0x15'));var utils=require('../../config/utils');var config=require(_0xe48a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe48a('0x17'))['db'];var integrations=require(_0xe48a('0x18'));function respondWithStatusCode(_0xa56d47,_0x3f6c9d){_0x3f6c9d=_0x3f6c9d||0xcc;return function(_0x1ce558){if(_0x1ce558){return _0xa56d47['sendStatus'](_0x3f6c9d);}return _0xa56d47[_0xe48a('0x19')](_0x3f6c9d)[_0xe48a('0x1a')]();};}function respondWithResult(_0x4de0a2,_0x489d2a){_0x489d2a=_0x489d2a||0xc8;return function(_0xac5e5f){if(_0xac5e5f){return _0x4de0a2['status'](_0x489d2a)[_0xe48a('0x1b')](_0xac5e5f);}};}function respondWithFilteredResult(_0x32b1da,_0x5366f4){return function(_0x526619){if(_0x526619){var _0x374a60=typeof _0x5366f4[_0xe48a('0x1c')]===_0xe48a('0x1d')&&typeof _0x5366f4[_0xe48a('0x1e')]===_0xe48a('0x1d');var _0x1a6742=_0x526619[_0xe48a('0x1f')];var _0x3b59c5=_0x374a60?0x0:_0x5366f4[_0xe48a('0x1c')];var _0x455982=_0x374a60?_0x526619[_0xe48a('0x1f')]:_0x5366f4[_0xe48a('0x1c')]+_0x5366f4[_0xe48a('0x1e')];var _0x457bcd;if(_0x455982>=_0x1a6742){_0x455982=_0x1a6742;_0x457bcd=0xc8;}else{_0x457bcd=0xce;}_0x32b1da[_0xe48a('0x19')](_0x457bcd);return _0x32b1da[_0xe48a('0x20')](_0xe48a('0x21'),_0x3b59c5+'-'+_0x455982+'/'+_0x1a6742)[_0xe48a('0x1b')](_0x526619);}return null;};}function patchUpdates(_0xc7ab80){return function(_0x40b9f1){try{jsonpatch['apply'](_0x40b9f1,_0xc7ab80,!![]);}catch(_0x49e923){return BPromise['reject'](_0x49e923);}return _0x40b9f1['save']();};}function saveUpdates(_0x2e49e0,_0x38f4eb){return function(_0x1bd707){if(_0x1bd707){return _0x1bd707['update'](_0x2e49e0)[_0xe48a('0x22')](function(_0x582861){return _0x582861;});}return null;};}function removeEntity(_0x332688,_0x53b426){return function(_0x3fb652){if(_0x3fb652){return _0x3fb652[_0xe48a('0x23')]()[_0xe48a('0x22')](function(){_0x332688['status'](0xcc)[_0xe48a('0x1a')]();});}};}function handleEntityNotFound(_0x164c38,_0x5d6340){return function(_0xb046bd){if(!_0xb046bd){_0x164c38['sendStatus'](0x194);}return _0xb046bd;};}function handleError(_0x5e18f2,_0x387c44){_0x387c44=_0x387c44||0x1f4;return function(_0xb9fa8f){logger[_0xe48a('0x24')](_0xb9fa8f['stack']);if(_0xb9fa8f[_0xe48a('0x25')]){delete _0xb9fa8f[_0xe48a('0x25')];}_0x5e18f2[_0xe48a('0x19')](_0x387c44)[_0xe48a('0x26')](_0xb9fa8f);};}exports[_0xe48a('0x27')]=function(_0x28d011,_0x456f8a){var _0x1207da={},_0x24ccf5={},_0x33b169={'count':0x0,'rows':[]};var _0x596bec=_['map'](db[_0xe48a('0x28')][_0xe48a('0x29')],function(_0x4e3d47){return{'name':_0x4e3d47[_0xe48a('0x2a')],'type':_0x4e3d47['type'][_0xe48a('0x2b')]};});_0x24ccf5[_0xe48a('0x2c')]=_['map'](_0x596bec,_0xe48a('0x25'));_0x24ccf5[_0xe48a('0x2d')]=_[_0xe48a('0x2e')](_0x28d011[_0xe48a('0x2d')]);_0x24ccf5['filters']=_['intersection'](_0x24ccf5[_0xe48a('0x2c')],_0x24ccf5[_0xe48a('0x2d')]);_0x1207da[_0xe48a('0x2f')]=_['intersection'](_0x24ccf5[_0xe48a('0x2c')],qs[_0xe48a('0x30')](_0x28d011[_0xe48a('0x2d')]['fields']));_0x1207da['attributes']=_0x1207da[_0xe48a('0x2f')][_0xe48a('0x31')]?_0x1207da[_0xe48a('0x2f')]:_0x24ccf5[_0xe48a('0x2c')];if(!_0x28d011['query'][_0xe48a('0x32')](_0xe48a('0x33'))){_0x1207da[_0xe48a('0x1e')]=qs[_0xe48a('0x1e')](_0x28d011[_0xe48a('0x2d')][_0xe48a('0x1e')]);_0x1207da['offset']=qs['offset'](_0x28d011[_0xe48a('0x2d')][_0xe48a('0x1c')]);}_0x1207da[_0xe48a('0x34')]=qs[_0xe48a('0x35')](_0x28d011[_0xe48a('0x2d')][_0xe48a('0x35')]);_0x1207da['where']=qs['filters'](_[_0xe48a('0x36')](_0x28d011[_0xe48a('0x2d')],_0x24ccf5['filters']),_0x596bec);if(_0x28d011[_0xe48a('0x2d')][_0xe48a('0x37')]){_0x1207da[_0xe48a('0x38')]=_[_0xe48a('0x39')](_0x1207da[_0xe48a('0x38')],{'$or':_[_0xe48a('0x3a')](_0x596bec,function(_0x52ad2f){if(_0x52ad2f[_0xe48a('0x3b')]!==_0xe48a('0x3c')){var _0x316d81={};_0x316d81[_0x52ad2f['name']]={'$like':'%'+_0x28d011[_0xe48a('0x2d')][_0xe48a('0x37')]+'%'};return _0x316d81;}})});}_0x1207da=_[_0xe48a('0x39')]({},_0x1207da,_0x28d011[_0xe48a('0x3d')]);var _0x1175b4={'where':_0x1207da[_0xe48a('0x38')]};return db['FreshsalesAccount'][_0xe48a('0x1f')](_0x1175b4)[_0xe48a('0x22')](function(_0x2d6c45){_0x33b169[_0xe48a('0x1f')]=_0x2d6c45;if(_0x28d011[_0xe48a('0x2d')][_0xe48a('0x3e')]){_0x1207da['include']=[{'all':!![]}];}return db[_0xe48a('0x28')][_0xe48a('0x3f')](_0x1207da);})['then'](function(_0x47903){_0x33b169['rows']=_0x47903;return _0x33b169;})[_0xe48a('0x22')](respondWithFilteredResult(_0x456f8a,_0x1207da))[_0xe48a('0x40')](handleError(_0x456f8a,null));};exports[_0xe48a('0x41')]=function(_0x2a8f77,_0x40cdc3){var _0x97db7f={'raw':![],'where':{'id':_0x2a8f77['params']['id']}},_0x337223={};_0x337223[_0xe48a('0x2c')]=_[_0xe48a('0x2e')](db['FreshsalesAccount']['rawAttributes']);_0x337223[_0xe48a('0x2d')]=_[_0xe48a('0x2e')](_0x2a8f77[_0xe48a('0x2d')]);_0x337223[_0xe48a('0x42')]=_[_0xe48a('0x43')](_0x337223[_0xe48a('0x2c')],_0x337223[_0xe48a('0x2d')]);_0x97db7f[_0xe48a('0x2f')]=_[_0xe48a('0x43')](_0x337223['model'],qs[_0xe48a('0x30')](_0x2a8f77['query'][_0xe48a('0x30')]));_0x97db7f[_0xe48a('0x2f')]=_0x97db7f[_0xe48a('0x2f')]['length']?_0x97db7f[_0xe48a('0x2f')]:_0x337223['model'];if(_0x2a8f77[_0xe48a('0x2d')][_0xe48a('0x3e')]){_0x97db7f[_0xe48a('0x44')]=[{'all':!![]}];}_0x97db7f=_[_0xe48a('0x39')]({},_0x97db7f,_0x2a8f77[_0xe48a('0x3d')]);return db[_0xe48a('0x28')]['find'](_0x97db7f)[_0xe48a('0x22')](handleEntityNotFound(_0x40cdc3,null))[_0xe48a('0x22')](respondWithResult(_0x40cdc3,null))[_0xe48a('0x40')](handleError(_0x40cdc3,null));};exports['create']=function(_0xeac584,_0x3aed9c){return db[_0xe48a('0x28')]['create'](_0xeac584[_0xe48a('0x45')],{})['then'](respondWithResult(_0x3aed9c,0xc9))[_0xe48a('0x40')](handleError(_0x3aed9c,null));};exports[_0xe48a('0x46')]=function(_0x302a70,_0x3e77e0){if(_0x302a70[_0xe48a('0x45')]['id']){delete _0x302a70[_0xe48a('0x45')]['id'];}return db[_0xe48a('0x28')][_0xe48a('0x47')]({'where':{'id':_0x302a70[_0xe48a('0x48')]['id']}})[_0xe48a('0x22')](handleEntityNotFound(_0x3e77e0,null))[_0xe48a('0x22')](saveUpdates(_0x302a70[_0xe48a('0x45')],null))[_0xe48a('0x22')](respondWithResult(_0x3e77e0,null))[_0xe48a('0x40')](handleError(_0x3e77e0,null));};exports[_0xe48a('0x23')]=function(_0x3672a8,_0x373f49){return db[_0xe48a('0x28')][_0xe48a('0x47')]({'where':{'id':_0x3672a8['params']['id']}})['then'](handleEntityNotFound(_0x373f49,null))[_0xe48a('0x22')](removeEntity(_0x373f49,null))[_0xe48a('0x40')](handleError(_0x373f49,null));};exports[_0xe48a('0x49')]=function(_0x1dae44,_0x5afce7,_0x59a11c){var _0x54751c={};var _0x5ed354={};var _0x52f5e2;var _0x5484cc;return db[_0xe48a('0x28')][_0xe48a('0x4a')]({'where':{'id':_0x1dae44['params']['id']}})['then'](handleEntityNotFound(_0x5afce7,null))['then'](function(_0x3940d6){if(_0x3940d6){_0x52f5e2=_0x3940d6;_0x5ed354[_0xe48a('0x2c')]=_[_0xe48a('0x2e')](db[_0xe48a('0x4b')][_0xe48a('0x29')]);_0x5ed354[_0xe48a('0x2d')]=_[_0xe48a('0x2e')](_0x1dae44[_0xe48a('0x2d')]);_0x5ed354[_0xe48a('0x42')]=_[_0xe48a('0x43')](_0x5ed354['model'],_0x5ed354[_0xe48a('0x2d')]);_0x54751c['attributes']=_[_0xe48a('0x43')](_0x5ed354[_0xe48a('0x2c')],qs[_0xe48a('0x30')](_0x1dae44[_0xe48a('0x2d')]['fields']));_0x54751c[_0xe48a('0x2f')]=_0x54751c[_0xe48a('0x2f')][_0xe48a('0x31')]?_0x54751c[_0xe48a('0x2f')]:_0x5ed354[_0xe48a('0x2c')];_0x54751c[_0xe48a('0x34')]=qs['sort'](_0x1dae44[_0xe48a('0x2d')][_0xe48a('0x35')]);_0x54751c[_0xe48a('0x38')]=qs[_0xe48a('0x42')](_[_0xe48a('0x36')](_0x1dae44[_0xe48a('0x2d')],_0x5ed354[_0xe48a('0x42')]));if(_0x1dae44[_0xe48a('0x2d')][_0xe48a('0x37')]){_0x54751c[_0xe48a('0x38')]=_[_0xe48a('0x39')](_0x54751c['where'],{'$or':_[_0xe48a('0x3a')](_0x54751c[_0xe48a('0x2f')],function(_0x5a6208){var _0x68288a={};_0x68288a[_0x5a6208]={'$like':'%'+_0x1dae44[_0xe48a('0x2d')][_0xe48a('0x37')]+'%'};return _0x68288a;})});}_0x54751c=_[_0xe48a('0x39')]({},_0x54751c,_0x1dae44[_0xe48a('0x3d')]);return _0x52f5e2['getConfigurations'](_0x54751c);}})['then'](function(_0x43c4ea){if(_0x43c4ea){_0x5484cc=_0x43c4ea[_0xe48a('0x31')];if(!_0x1dae44[_0xe48a('0x2d')][_0xe48a('0x32')](_0xe48a('0x33'))){_0x54751c[_0xe48a('0x1e')]=qs['limit'](_0x1dae44[_0xe48a('0x2d')][_0xe48a('0x1e')]);_0x54751c['offset']=qs['offset'](_0x1dae44[_0xe48a('0x2d')]['offset']);}return _0x52f5e2[_0xe48a('0x49')](_0x54751c);}})['then'](function(_0x2ad9b5){if(_0x2ad9b5){return _0x2ad9b5?{'count':_0x5484cc,'rows':_0x2ad9b5}:null;}})[_0xe48a('0x22')](respondWithResult(_0x5afce7,null))[_0xe48a('0x40')](handleError(_0x5afce7,null));};exports[_0xe48a('0x4c')]=function(_0x3c2cdb,_0x4720eb,_0x5d5693){if(_0x3c2cdb[_0xe48a('0x45')]['id']){delete _0x3c2cdb[_0xe48a('0x45')]['id'];}return db[_0xe48a('0x28')][_0xe48a('0x4a')]({'where':{'id':_0x3c2cdb[_0xe48a('0x48')]['id']}})[_0xe48a('0x22')](handleEntityNotFound(_0x4720eb,null))[_0xe48a('0x22')](function(_0x588898){if(_0x588898){_0x3c2cdb[_0xe48a('0x45')][_0xe48a('0x4d')]=_0x588898['id'];_0x3c2cdb[_0xe48a('0x45')][_0xe48a('0x4e')]=integrations['getSubjects'](_0x3c2cdb['body']['channel'],_0x3c2cdb['body'][_0xe48a('0x3b')]);_0x3c2cdb[_0xe48a('0x45')][_0xe48a('0x4f')]=integrations[_0xe48a('0x50')](_0x3c2cdb[_0xe48a('0x45')][_0xe48a('0x51')],_0x3c2cdb['body'][_0xe48a('0x3b')]);return db[_0xe48a('0x4b')]['create'](_0x3c2cdb['body'],{'include':[{'model':db[_0xe48a('0x52')],'as':'Subjects'},{'model':db[_0xe48a('0x52')],'as':_0xe48a('0x4f')}]});}return null;})[_0xe48a('0x22')](respondWithResult(_0x4720eb,null))[_0xe48a('0x40')](handleError(_0x4720eb,null));};exports[_0xe48a('0x53')]=function(_0x5ebae6,_0x2e4a8b,_0x3bb4d3){var _0x2689b9='';var _0x10e125='';return db['FreshsalesAccount'][_0xe48a('0x4a')]({'where':{'id':_0x5ebae6[_0xe48a('0x48')]['id']},'attributes':['id',_0xe48a('0x54'),'remoteUri',_0xe48a('0x55')]})[_0xe48a('0x22')](handleEntityNotFound(_0x2e4a8b,null))['then'](function(_0x16259a){if(_0x16259a){_0x10e125=_0x16259a[_0xe48a('0x54')];_0x2689b9=_0x16259a[_0xe48a('0x56')];var _0x1fb59e=_0x16259a[_0xe48a('0x56')][_0xe48a('0x57')](-0x1);if(_0x1fb59e==='/'){_0x2689b9=_0x2689b9[_0xe48a('0x58')](0x0,_0x2689b9[_0xe48a('0x59')](_0x1fb59e));}return rp({'method':_0xe48a('0x5a'),'uri':util['format'](_0xe48a('0x5b'),_0x2689b9,_0xe48a('0x5c')),'headers':{'Authorization':_0xe48a('0x5d')+_0x16259a[_0xe48a('0x55')]},'json':!![]});}})['then'](function(_0x29fd87){if(_0x29fd87){var _0x521c63=_0x29fd87[_0xe48a('0x5e')];var _0x536b60=![];var _0x34f77c=null;for(_0x34f77c=0x0;_0x34f77c<_0x521c63[_0xe48a('0x31')];_0x34f77c++){if(_0x521c63[_0x34f77c]['email']===_0x10e125){_0x536b60=!![];}}if(_0x536b60){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x2e4a8b,null))[_0xe48a('0x40')](function(_0x493a0c){var _0x59e5be=_0x5ebae6['query'][_0xe48a('0x5f')]?0x1f4:_0x493a0c['statusCode']||0x1f4;logger['error'](_0xe48a('0x60'),'getFields',_0x59e5be,JSON[_0xe48a('0x61')](_0x493a0c));delete _0x493a0c[_0xe48a('0x25')];if(_0x59e5be===0x191){_0x59e5be=0x190;}_0x2e4a8b[_0xe48a('0x19')](_0x59e5be)[_0xe48a('0x26')](_0x5ebae6[_0xe48a('0x2d')][_0xe48a('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x493a0c[_0xe48a('0x62')]}:_0x493a0c);});}; \ No newline at end of file +var _0xe1f9=['count','set','json','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','AccountId','getSubjects','channel','Descriptions','username','remoteUri','apiKey','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit'];(function(_0x38ef51,_0x2fa9fd){var _0x17f3a6=function(_0x519567){while(--_0x519567){_0x38ef51['push'](_0x38ef51['shift']());}};_0x17f3a6(++_0x2fa9fd);}(_0xe1f9,0x1df));var _0x9e1f=function(_0x2f360e,_0x46c04c){_0x2f360e=_0x2f360e-0x0;var _0x52016d=_0xe1f9[_0x2f360e];return _0x52016d;};'use strict';var emlformat=require(_0x9e1f('0x0'));var rimraf=require(_0x9e1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e1f('0x2'));var rp=require(_0x9e1f('0x3'));var moment=require('moment');var BPromise=require(_0x9e1f('0x4'));var Mustache=require(_0x9e1f('0x5'));var util=require('util');var path=require(_0x9e1f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e1f('0x7'));var fs=require('fs');var fs_extra=require(_0x9e1f('0x8'));var _=require(_0x9e1f('0x9'));var squel=require('squel');var crypto=require(_0x9e1f('0xa'));var jsforce=require(_0x9e1f('0xb'));var deskjs=require(_0x9e1f('0xc'));var toCsv=require(_0x9e1f('0xd'));var querystring=require(_0x9e1f('0xe'));var Papa=require(_0x9e1f('0xf'));var Redis=require('ioredis');var authService=require(_0x9e1f('0x10'));var qs=require(_0x9e1f('0x11'));var as=require(_0x9e1f('0x12'));var hardwareService=require(_0x9e1f('0x13'));var logger=require('../../config/logger')(_0x9e1f('0x14'));var utils=require(_0x9e1f('0x15'));var config=require(_0x9e1f('0x16'));var licenseUtil=require(_0x9e1f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9e1f('0x18'));function respondWithStatusCode(_0x505fba,_0x108cd9){_0x108cd9=_0x108cd9||0xcc;return function(_0x388b11){if(_0x388b11){return _0x505fba[_0x9e1f('0x19')](_0x108cd9);}return _0x505fba[_0x9e1f('0x1a')](_0x108cd9)[_0x9e1f('0x1b')]();};}function respondWithResult(_0x1d3364,_0x252ac7){_0x252ac7=_0x252ac7||0xc8;return function(_0x3c01a2){if(_0x3c01a2){return _0x1d3364[_0x9e1f('0x1a')](_0x252ac7)['json'](_0x3c01a2);}};}function respondWithFilteredResult(_0x32d858,_0x4d3d0b){return function(_0x2607ab){if(_0x2607ab){var _0x10e291=typeof _0x4d3d0b[_0x9e1f('0x1c')]===_0x9e1f('0x1d')&&typeof _0x4d3d0b[_0x9e1f('0x1e')]===_0x9e1f('0x1d');var _0x454a2c=_0x2607ab[_0x9e1f('0x1f')];var _0x234099=_0x10e291?0x0:_0x4d3d0b[_0x9e1f('0x1c')];var _0x599102=_0x10e291?_0x2607ab[_0x9e1f('0x1f')]:_0x4d3d0b[_0x9e1f('0x1c')]+_0x4d3d0b[_0x9e1f('0x1e')];var _0xb09eca;if(_0x599102>=_0x454a2c){_0x599102=_0x454a2c;_0xb09eca=0xc8;}else{_0xb09eca=0xce;}_0x32d858[_0x9e1f('0x1a')](_0xb09eca);return _0x32d858[_0x9e1f('0x20')]('Content-Range',_0x234099+'-'+_0x599102+'/'+_0x454a2c)[_0x9e1f('0x21')](_0x2607ab);}return null;};}function patchUpdates(_0x183934){return function(_0x524782){try{jsonpatch['apply'](_0x524782,_0x183934,!![]);}catch(_0x37add1){return BPromise[_0x9e1f('0x22')](_0x37add1);}return _0x524782[_0x9e1f('0x23')]();};}function saveUpdates(_0x31a7fa,_0x3fd5b0){return function(_0x30955c){if(_0x30955c){return _0x30955c[_0x9e1f('0x24')](_0x31a7fa)[_0x9e1f('0x25')](function(_0x52bed5){return _0x52bed5;});}return null;};}function removeEntity(_0x1a1b7b,_0xb53d4){return function(_0x17def0){if(_0x17def0){return _0x17def0[_0x9e1f('0x26')]()['then'](function(){_0x1a1b7b['status'](0xcc)[_0x9e1f('0x1b')]();});}};}function handleEntityNotFound(_0x16f272,_0x3ec02b){return function(_0x80c8b7){if(!_0x80c8b7){_0x16f272[_0x9e1f('0x19')](0x194);}return _0x80c8b7;};}function handleError(_0x328752,_0x1430e7){_0x1430e7=_0x1430e7||0x1f4;return function(_0xdc7026){logger['error'](_0xdc7026[_0x9e1f('0x27')]);if(_0xdc7026[_0x9e1f('0x28')]){delete _0xdc7026[_0x9e1f('0x28')];}_0x328752['status'](_0x1430e7)[_0x9e1f('0x29')](_0xdc7026);};}exports[_0x9e1f('0x2a')]=function(_0x58e9c8,_0x4bdb26){var _0x5262af={},_0x5ddea3={},_0x27fb96={'count':0x0,'rows':[]};var _0x4e728b=_[_0x9e1f('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x15a279){return{'name':_0x15a279[_0x9e1f('0x2c')],'type':_0x15a279['type'][_0x9e1f('0x2d')]};});_0x5ddea3['model']=_['map'](_0x4e728b,'name');_0x5ddea3[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x58e9c8[_0x9e1f('0x2e')]);_0x5ddea3['filters']=_[_0x9e1f('0x30')](_0x5ddea3[_0x9e1f('0x31')],_0x5ddea3[_0x9e1f('0x2e')]);_0x5262af[_0x9e1f('0x32')]=_[_0x9e1f('0x30')](_0x5ddea3['model'],qs[_0x9e1f('0x33')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0x5262af[_0x9e1f('0x32')]=_0x5262af[_0x9e1f('0x32')][_0x9e1f('0x34')]?_0x5262af[_0x9e1f('0x32')]:_0x5ddea3[_0x9e1f('0x31')];if(!_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x35')](_0x9e1f('0x36'))){_0x5262af[_0x9e1f('0x1e')]=qs[_0x9e1f('0x1e')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x1e')]);_0x5262af['offset']=qs[_0x9e1f('0x1c')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x1c')]);}_0x5262af[_0x9e1f('0x37')]=qs[_0x9e1f('0x38')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x38')]);_0x5262af[_0x9e1f('0x39')]=qs[_0x9e1f('0x3a')](_[_0x9e1f('0x3b')](_0x58e9c8[_0x9e1f('0x2e')],_0x5ddea3[_0x9e1f('0x3a')]),_0x4e728b);if(_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x3c')]){_0x5262af[_0x9e1f('0x39')]=_[_0x9e1f('0x3d')](_0x5262af[_0x9e1f('0x39')],{'$or':_[_0x9e1f('0x2b')](_0x4e728b,function(_0x2e9713){if(_0x2e9713[_0x9e1f('0x3e')]!==_0x9e1f('0x3f')){var _0x15e82b={};_0x15e82b[_0x2e9713[_0x9e1f('0x28')]]={'$like':'%'+_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x3c')]+'%'};return _0x15e82b;}})});}_0x5262af=_[_0x9e1f('0x3d')]({},_0x5262af,_0x58e9c8[_0x9e1f('0x40')]);var _0x1b59cb={'where':_0x5262af[_0x9e1f('0x39')]};return db[_0x9e1f('0x41')][_0x9e1f('0x1f')](_0x1b59cb)['then'](function(_0x22aa06){_0x27fb96[_0x9e1f('0x1f')]=_0x22aa06;if(_0x58e9c8['query'][_0x9e1f('0x42')]){_0x5262af['include']=[{'all':!![]}];}return db[_0x9e1f('0x41')][_0x9e1f('0x43')](_0x5262af);})['then'](function(_0x462252){_0x27fb96[_0x9e1f('0x44')]=_0x462252;return _0x27fb96;})[_0x9e1f('0x25')](respondWithFilteredResult(_0x4bdb26,_0x5262af))[_0x9e1f('0x45')](handleError(_0x4bdb26,null));};exports[_0x9e1f('0x46')]=function(_0x1e2059,_0x1b9b76){var _0x1f5d5a={'raw':![],'where':{'id':_0x1e2059['params']['id']}},_0x4b150e={};_0x4b150e[_0x9e1f('0x31')]=_['keys'](db[_0x9e1f('0x41')][_0x9e1f('0x47')]);_0x4b150e[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x1e2059[_0x9e1f('0x2e')]);_0x4b150e[_0x9e1f('0x3a')]=_['intersection'](_0x4b150e[_0x9e1f('0x31')],_0x4b150e[_0x9e1f('0x2e')]);_0x1f5d5a['attributes']=_[_0x9e1f('0x30')](_0x4b150e[_0x9e1f('0x31')],qs[_0x9e1f('0x33')](_0x1e2059[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0x1f5d5a[_0x9e1f('0x32')]=_0x1f5d5a['attributes']['length']?_0x1f5d5a['attributes']:_0x4b150e['model'];if(_0x1e2059[_0x9e1f('0x2e')][_0x9e1f('0x42')]){_0x1f5d5a[_0x9e1f('0x48')]=[{'all':!![]}];}_0x1f5d5a=_[_0x9e1f('0x3d')]({},_0x1f5d5a,_0x1e2059[_0x9e1f('0x40')]);return db[_0x9e1f('0x41')][_0x9e1f('0x49')](_0x1f5d5a)[_0x9e1f('0x25')](handleEntityNotFound(_0x1b9b76,null))[_0x9e1f('0x25')](respondWithResult(_0x1b9b76,null))[_0x9e1f('0x45')](handleError(_0x1b9b76,null));};exports[_0x9e1f('0x4a')]=function(_0x4dcd75,_0x3a368c){return db[_0x9e1f('0x41')][_0x9e1f('0x4a')](_0x4dcd75[_0x9e1f('0x4b')],{})[_0x9e1f('0x25')](respondWithResult(_0x3a368c,0xc9))[_0x9e1f('0x45')](handleError(_0x3a368c,null));};exports[_0x9e1f('0x24')]=function(_0x2a0b9c,_0x2e276a){if(_0x2a0b9c[_0x9e1f('0x4b')]['id']){delete _0x2a0b9c[_0x9e1f('0x4b')]['id'];}return db[_0x9e1f('0x41')][_0x9e1f('0x49')]({'where':{'id':_0x2a0b9c['params']['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x2e276a,null))[_0x9e1f('0x25')](saveUpdates(_0x2a0b9c[_0x9e1f('0x4b')],null))['then'](respondWithResult(_0x2e276a,null))[_0x9e1f('0x45')](handleError(_0x2e276a,null));};exports['destroy']=function(_0x42dd85,_0x496950){return db[_0x9e1f('0x41')][_0x9e1f('0x49')]({'where':{'id':_0x42dd85[_0x9e1f('0x4c')]['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x496950,null))[_0x9e1f('0x25')](removeEntity(_0x496950,null))[_0x9e1f('0x45')](handleError(_0x496950,null));};exports[_0x9e1f('0x4d')]=function(_0x34a720,_0x21adbf,_0x1bff6f){var _0xdbdfdd={};var _0x3954ef={};var _0x2f03aa;var _0x1e25f6;return db[_0x9e1f('0x41')][_0x9e1f('0x4e')]({'where':{'id':_0x34a720['params']['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x21adbf,null))[_0x9e1f('0x25')](function(_0x2dad92){if(_0x2dad92){_0x2f03aa=_0x2dad92;_0x3954ef[_0x9e1f('0x31')]=_[_0x9e1f('0x2f')](db[_0x9e1f('0x4f')][_0x9e1f('0x47')]);_0x3954ef[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x34a720[_0x9e1f('0x2e')]);_0x3954ef[_0x9e1f('0x3a')]=_[_0x9e1f('0x30')](_0x3954ef[_0x9e1f('0x31')],_0x3954ef[_0x9e1f('0x2e')]);_0xdbdfdd['attributes']=_[_0x9e1f('0x30')](_0x3954ef[_0x9e1f('0x31')],qs['fields'](_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0xdbdfdd['attributes']=_0xdbdfdd[_0x9e1f('0x32')][_0x9e1f('0x34')]?_0xdbdfdd[_0x9e1f('0x32')]:_0x3954ef[_0x9e1f('0x31')];_0xdbdfdd[_0x9e1f('0x37')]=qs['sort'](_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x38')]);_0xdbdfdd['where']=qs[_0x9e1f('0x3a')](_['pick'](_0x34a720[_0x9e1f('0x2e')],_0x3954ef['filters']));if(_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x3c')]){_0xdbdfdd[_0x9e1f('0x39')]=_[_0x9e1f('0x3d')](_0xdbdfdd[_0x9e1f('0x39')],{'$or':_['map'](_0xdbdfdd[_0x9e1f('0x32')],function(_0x3f3257){var _0x23e3ea={};_0x23e3ea[_0x3f3257]={'$like':'%'+_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x3c')]+'%'};return _0x23e3ea;})});}_0xdbdfdd=_[_0x9e1f('0x3d')]({},_0xdbdfdd,_0x34a720[_0x9e1f('0x40')]);return _0x2f03aa[_0x9e1f('0x4d')](_0xdbdfdd);}})[_0x9e1f('0x25')](function(_0x3fd237){if(_0x3fd237){_0x1e25f6=_0x3fd237[_0x9e1f('0x34')];if(!_0x34a720['query'][_0x9e1f('0x35')](_0x9e1f('0x36'))){_0xdbdfdd['limit']=qs[_0x9e1f('0x1e')](_0x34a720[_0x9e1f('0x2e')]['limit']);_0xdbdfdd['offset']=qs['offset'](_0x34a720['query'][_0x9e1f('0x1c')]);}return _0x2f03aa['getConfigurations'](_0xdbdfdd);}})[_0x9e1f('0x25')](function(_0x598b9c){if(_0x598b9c){return _0x598b9c?{'count':_0x1e25f6,'rows':_0x598b9c}:null;}})['then'](respondWithResult(_0x21adbf,null))[_0x9e1f('0x45')](handleError(_0x21adbf,null));};exports['addConfiguration']=function(_0x3fa677,_0x2504ef,_0x2c4f66){if(_0x3fa677['body']['id']){delete _0x3fa677[_0x9e1f('0x4b')]['id'];}return db['FreshsalesAccount'][_0x9e1f('0x4e')]({'where':{'id':_0x3fa677[_0x9e1f('0x4c')]['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x2504ef,null))[_0x9e1f('0x25')](function(_0x582e1e){if(_0x582e1e){_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x50')]=_0x582e1e['id'];_0x3fa677[_0x9e1f('0x4b')]['Subjects']=integrations[_0x9e1f('0x51')](_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x52')],_0x3fa677['body'][_0x9e1f('0x3e')]);_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x53')]=integrations['getDescriptions'](_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x52')],_0x3fa677[_0x9e1f('0x4b')]['type']);return db[_0x9e1f('0x4f')][_0x9e1f('0x4a')](_0x3fa677[_0x9e1f('0x4b')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x9e1f('0x53')}]});}return null;})['then'](respondWithResult(_0x2504ef,null))[_0x9e1f('0x45')](handleError(_0x2504ef,null));};exports['getFields']=function(_0x2f69af,_0x3725c6,_0x3a5334){var _0x33f74b='';var _0x562351='';return db['FreshsalesAccount'][_0x9e1f('0x4e')]({'where':{'id':_0x2f69af[_0x9e1f('0x4c')]['id']},'attributes':['id',_0x9e1f('0x54'),_0x9e1f('0x55'),_0x9e1f('0x56')]})['then'](handleEntityNotFound(_0x3725c6,null))[_0x9e1f('0x25')](function(_0x39e5c5){if(_0x39e5c5){_0x562351=_0x39e5c5['username'];_0x33f74b=_0x39e5c5['remoteUri'];var _0x440977=_0x39e5c5[_0x9e1f('0x55')][_0x9e1f('0x57')](-0x1);if(_0x440977==='/'){_0x33f74b=_0x33f74b[_0x9e1f('0x58')](0x0,_0x33f74b['lastIndexOf'](_0x440977));}return rp({'method':_0x9e1f('0x59'),'uri':util['format'](_0x9e1f('0x5a'),_0x33f74b,_0x9e1f('0x5b')),'headers':{'Authorization':_0x9e1f('0x5c')+_0x39e5c5[_0x9e1f('0x56')]},'json':!![]});}})[_0x9e1f('0x25')](function(_0x32955c){if(_0x32955c){var _0x3fa1fa=_0x32955c[_0x9e1f('0x5d')];var _0x32bf16=![];var _0x4067a3=null;for(_0x4067a3=0x0;_0x4067a3<_0x3fa1fa[_0x9e1f('0x34')];_0x4067a3++){if(_0x3fa1fa[_0x4067a3][_0x9e1f('0x5e')]===_0x562351){_0x32bf16=!![];}}if(_0x32bf16){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9e1f('0x5f')});}}})['then'](respondWithResult(_0x3725c6,null))[_0x9e1f('0x45')](function(_0x30e2bd){var _0xa7ded6=_0x2f69af[_0x9e1f('0x2e')][_0x9e1f('0x60')]?0x1f4:_0x30e2bd[_0x9e1f('0x61')]||0x1f4;logger[_0x9e1f('0x62')]('getFields,\x20%s,\x20%s,\x20%s',_0x9e1f('0x63'),_0xa7ded6,JSON[_0x9e1f('0x64')](_0x30e2bd));delete _0x30e2bd[_0x9e1f('0x28')];if(_0xa7ded6===0x191){_0xa7ded6=0x190;}_0x3725c6['status'](_0xa7ded6)[_0x9e1f('0x29')](_0x2f69af[_0x9e1f('0x2e')][_0x9e1f('0x60')]?{'message':_0x9e1f('0x65'),'statusCode':_0x30e2bd[_0x9e1f('0x61')]}:_0x30e2bd);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2e17633..9033c96 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 _0x71ab=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','bluebird','request-promise'];(function(_0x1afbf3,_0x587a36){var _0x2028f1=function(_0x298f58){while(--_0x298f58){_0x1afbf3['push'](_0x1afbf3['shift']());}};_0x2028f1(++_0x587a36);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util'];(function(_0x4baafe,_0x1f86c0){var _0x28336d=function(_0x194a0c){while(--_0x194a0c){_0x4baafe['push'](_0x4baafe['shift']());}};_0x28336d(++_0x1f86c0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b38df,_0x3a6808){_0x5b38df=_0x5b38df-0x0;var _0x2e4f3e=_0x5f2f[_0x5b38df];return _0x2e4f3e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));var integrations=require(_0xf5f2('0x9'));module[_0xf5f2('0xa')]=function(_0x3eebf6,_0x3133bc){return _0x3eebf6[_0xf5f2('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xf5f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 6f2be08..09fccae 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 _0x4975=['jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x43bbf5,_0x4cab3a){_0x43bbf5=_0x43bbf5-0x0;var _0x346bdb=_0x4975[_0x43bbf5];return _0x346bdb;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['GetFreshsalesAccount']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')]({'raw':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1b')]||null:null,'attributes':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1c')]||null:null,'limit':_0x3f4d20['options']?_0x3f4d20[_0x5497('0x19')]['limit']||null:null,'include':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')],function(_0x5018fa){return{'model':db[_0x5018fa['model']],'as':_0x5018fa['as'],'attributes':_0x5018fa[_0x5497('0x1c')],'include':_0x5018fa[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5018fa[_0x5497('0x1d')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x1f')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5223b5[_0x5497('0x1d')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x1f')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af5f4){logger['info']('GetFreshsalesAccount',_0x3f4d20);logger['debug'](_0x5497('0x20'),_0x3f4d20,JSON['stringify'](_0x4af5f4));_0x3a47fd(_0x4af5f4);})['catch'](function(_0xc3465){logger[_0x5497('0x13')](_0x5497('0x20'),_0xc3465['message'],_0x3f4d20);_0x5d9e24(_0x1bf442['error'](0x1f4,_0xc3465['message']));});});};exports[_0x5497('0x21')]=function(_0x471e0b){var _0xf4c117=this;return new Promise(function(_0x5b8f79,_0x489f71){return db['FreshsalesAccount'][_0x5497('0x22')]({'raw':_0x471e0b['options']?_0x471e0b[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1b')]||null:null,'attributes':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1c')]||null:null,'include':_0x471e0b[_0x5497('0x19')]?_0x471e0b[_0x5497('0x19')]['include']?_[_0x5497('0x1e')](_0x471e0b[_0x5497('0x19')][_0x5497('0x1d')],function(_0x362b96){return{'model':db[_0x362b96[_0x5497('0x1f')]],'as':_0x362b96['as'],'attributes':_0x362b96['attributes'],'include':_0x362b96[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x362b96['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x1f')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x1c')],'include':_0x1ffc9b[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x1ffc9b[_0x5497('0x1d')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x1f')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes']};}):[]};}):[]};}):[]:[]})[_0x5497('0x23')](function(_0x212199){logger[_0x5497('0xd')]('ShowFreshsalesAccount',_0x471e0b);logger['debug'](_0x5497('0x21'),_0x471e0b,JSON[_0x5497('0x12')](_0x212199));_0x5b8f79(_0x212199);})[_0x5497('0x16')](function(_0x429cbf){logger[_0x5497('0x13')](_0x5497('0x21'),_0x429cbf['message'],_0x471e0b);_0x489f71(_0xf4c117[_0x5497('0x13')](0x1f4,_0x429cbf[_0x5497('0x14')]));});});}; \ No newline at end of file +var _0x6d11=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FreshsalesAccount','findAll','options','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x102b2b,_0x45d45e){var _0x55db93=function(_0x502524){while(--_0x502524){_0x102b2b['push'](_0x102b2b['shift']());}};_0x55db93(++_0x45d45e);}(_0x6d11,0xbf));var _0x16d1=function(_0x1e0414,_0x2f755a){_0x1e0414=_0x1e0414-0x0;var _0x84b43=_0x6d11[_0x1e0414];return _0x84b43;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['GetFreshsalesAccount']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')]({'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'where':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')]['where']||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'limit':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x19')]||null:null,'include':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')]['include']?_[_0x16d1('0x1a')](_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x47cad4){return{'model':db[_0x47cad4[_0x16d1('0x1c')]],'as':_0x47cad4['as'],'attributes':_0x47cad4[_0x16d1('0x18')],'include':_0x47cad4[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x47cad4[_0x16d1('0x1b')],function(_0x335c24){return{'model':db[_0x335c24[_0x16d1('0x1c')]],'as':_0x335c24['as'],'attributes':_0x335c24[_0x16d1('0x18')],'include':_0x335c24[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x335c24[_0x16d1('0x1b')],function(_0x2b8403){return{'model':db[_0x2b8403['model']],'as':_0x2b8403['as'],'attributes':_0x2b8403[_0x16d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16d1('0xa')](function(_0x4257f1){logger['info'](_0x16d1('0x1d'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1d'),_0x46a25e,JSON[_0x16d1('0x10')](_0x4257f1));_0x1da1b8(_0x4257f1);})[_0x16d1('0x14')](function(_0x462e5b){logger[_0x16d1('0x11')]('GetFreshsalesAccount',_0x462e5b[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x462e5b[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1e')]=function(_0x55c021){var _0x4b27f6=this;return new Promise(function(_0x2f16ee,_0x4ab3d4){return db[_0x16d1('0x15')][_0x16d1('0x1f')]({'raw':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x20')]===undefined?!![]:![]:!![],'where':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x21')]||null:null,'attributes':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'include':_0x55c021[_0x16d1('0x17')]?_0x55c021['options'][_0x16d1('0x1b')]?_['map'](_0x55c021[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x2b9126){return{'model':db[_0x2b9126[_0x16d1('0x1c')]],'as':_0x2b9126['as'],'attributes':_0x2b9126[_0x16d1('0x18')],'include':_0x2b9126[_0x16d1('0x1b')]?_['map'](_0x2b9126['include'],function(_0x58d72d){return{'model':db[_0x58d72d[_0x16d1('0x1c')]],'as':_0x58d72d['as'],'attributes':_0x58d72d[_0x16d1('0x18')],'include':_0x58d72d[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x58d72d['include'],function(_0x885454){return{'model':db[_0x885454[_0x16d1('0x1c')]],'as':_0x885454['as'],'attributes':_0x885454['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508ed7){logger[_0x16d1('0xb')](_0x16d1('0x1e'),_0x55c021);logger[_0x16d1('0xd')]('ShowFreshsalesAccount',_0x55c021,JSON[_0x16d1('0x10')](_0x508ed7));_0x2f16ee(_0x508ed7);})[_0x16d1('0x14')](function(_0x2928ad){logger[_0x16d1('0x11')](_0x16d1('0x1e'),_0x2928ad[_0x16d1('0x13')],_0x55c021);_0x4ab3d4(_0x4b27f6[_0x16d1('0x11')](0x1f4,_0x2928ad['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0d710b6..a8af8d4 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 _0x2f47=['/:id/subjects','getSubjects','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x2f47,0x1d6));var _0x72f4=function(_0x554066,_0x451615){_0x554066=_0x554066-0x0;var _0x43bd47=_0x2f47[_0x554066];return _0x43bd47;};'use strict';var multer=require(_0x72f4('0x0'));var util=require('util');var path=require(_0x72f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x72f4('0x2'));var router=express[_0x72f4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x72f4('0x4'));var interaction=require(_0x72f4('0x5'));var config=require(_0x72f4('0x6'));var controller=require(_0x72f4('0x7'));router[_0x72f4('0x8')]('/',auth[_0x72f4('0x9')](),controller[_0x72f4('0xa')]);router[_0x72f4('0x8')](_0x72f4('0xb'),auth[_0x72f4('0x9')](),controller[_0x72f4('0xc')]);router['get'](_0x72f4('0xd'),auth[_0x72f4('0x9')](),controller[_0x72f4('0xe')]);router[_0x72f4('0x8')]('/:id/descriptions',auth[_0x72f4('0x9')](),controller['getDescriptions']);router['get'](_0x72f4('0xf'),auth['isAuthenticated'](),controller[_0x72f4('0x10')]);router[_0x72f4('0x11')]('/',auth[_0x72f4('0x9')](),controller[_0x72f4('0x12')]);router['put']('/:id',auth[_0x72f4('0x9')](),controller[_0x72f4('0x13')]);router[_0x72f4('0x14')](_0x72f4('0xb'),auth[_0x72f4('0x9')](),controller[_0x72f4('0x15')]);module[_0x72f4('0x16')]=router; \ No newline at end of file +var _0x1c12=['show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x129267,_0x2057f8){var _0x5e1204=function(_0x22f676){while(--_0x22f676){_0x129267['push'](_0x129267['shift']());}};_0x5e1204(++_0x2057f8);}(_0x1c12,0x136));var _0x21c1=function(_0x631ef6,_0x149aa9){_0x631ef6=_0x631ef6-0x0;var _0x41af6=_0x1c12[_0x631ef6];return _0x41af6;};'use strict';var multer=require(_0x21c1('0x0'));var util=require(_0x21c1('0x1'));var path=require(_0x21c1('0x2'));var timeout=require(_0x21c1('0x3'));var express=require('express');var router=express[_0x21c1('0x4')]();var fs_extra=require(_0x21c1('0x5'));var auth=require(_0x21c1('0x6'));var interaction=require(_0x21c1('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x21c1('0x8')]('/',auth[_0x21c1('0x9')](),controller[_0x21c1('0xa')]);router['get'](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0xc')]);router['get'](_0x21c1('0xd'),auth[_0x21c1('0x9')](),controller[_0x21c1('0xe')]);router[_0x21c1('0x8')](_0x21c1('0xf'),auth[_0x21c1('0x9')](),controller['getDescriptions']);router[_0x21c1('0x8')](_0x21c1('0x10'),auth['isAuthenticated'](),controller[_0x21c1('0x11')]);router[_0x21c1('0x12')]('/',auth[_0x21c1('0x9')](),controller['create']);router['put'](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0x13')]);router[_0x21c1('0x14')](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0x15')]);module[_0x21c1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 75c15d7..59d9fef 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 _0x758f=['STRING','sequelize','exports'];(function(_0x34ca85,_0x447306){var _0x3c05f3=function(_0xf6e522){while(--_0xf6e522){_0x34ca85['push'](_0x34ca85['shift']());}};_0x3c05f3(++_0x447306);}(_0x758f,0x15a));var _0xf758=function(_0x817388,_0x58547f){_0x817388=_0x817388-0x0;var _0x12d106=_0x758f[_0x817388];return _0x12d106;};'use strict';var Sequelize=require(_0xf758('0x0'));module[_0xf758('0x1')]={'name':{'type':Sequelize[_0xf758('0x2')]},'description':{'type':Sequelize[_0xf758('0x2')]}}; \ No newline at end of file +var _0x9e31=['STRING','sequelize','exports'];(function(_0xba53e9,_0x4087cd){var _0x4cca2b=function(_0x31ea86){while(--_0x31ea86){_0xba53e9['push'](_0xba53e9['shift']());}};_0x4cca2b(++_0x4087cd);}(_0x9e31,0x6a));var _0x19e3=function(_0x20e5ab,_0x409b9a){_0x20e5ab=_0x20e5ab-0x0;var _0x2361f1=_0x9e31[_0x20e5ab];return _0x2361f1;};'use strict';var Sequelize=require(_0x19e3('0x0'));module[_0x19e3('0x1')]={'name':{'type':Sequelize[_0x19e3('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 51fed08..70f68c7 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 _0xeeff=['bluebird','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','fields','include','options','find','create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5afdaf,_0x21d4df){var _0xbb4bc0=function(_0x150522){while(--_0x150522){_0x5afdaf['push'](_0x5afdaf['shift']());}};_0xbb4bc0(++_0x21d4df);}(_0xeeff,0x1e7));var _0xfeef=function(_0x39882c,_0x55492b){_0x39882c=_0x39882c-0x0;var _0x3af0d9=_0xeeff[_0x39882c];return _0x3af0d9;};'use strict';var emlformat=require(_0xfeef('0x0'));var rimraf=require(_0xfeef('0x1'));var zipdir=require(_0xfeef('0x2'));var jsonpatch=require(_0xfeef('0x3'));var rp=require('request-promise');var moment=require(_0xfeef('0x4'));var BPromise=require(_0xfeef('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfeef('0x6'));var csv=require('to-csv');var ejs=require(_0xfeef('0x7'));var fs=require('fs');var fs_extra=require(_0xfeef('0x8'));var _=require('lodash');var squel=require(_0xfeef('0x9'));var crypto=require('crypto');var jsforce=require(_0xfeef('0xa'));var deskjs=require(_0xfeef('0xb'));var toCsv=require(_0xfeef('0xc'));var querystring=require(_0xfeef('0xd'));var Papa=require(_0xfeef('0xe'));var Redis=require(_0xfeef('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfeef('0x10'));var as=require(_0xfeef('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfeef('0x12'))(_0xfeef('0x13'));var utils=require(_0xfeef('0x14'));var config=require(_0xfeef('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfeef('0x16'))['db'];function respondWithStatusCode(_0x4dff9a,_0x352994){_0x352994=_0x352994||0xcc;return function(_0x3e3949){if(_0x3e3949){return _0x4dff9a[_0xfeef('0x17')](_0x352994);}return _0x4dff9a[_0xfeef('0x18')](_0x352994)[_0xfeef('0x19')]();};}function respondWithResult(_0x39a396,_0x3446e2){_0x3446e2=_0x3446e2||0xc8;return function(_0x19d06b){if(_0x19d06b){return _0x39a396[_0xfeef('0x18')](_0x3446e2)[_0xfeef('0x1a')](_0x19d06b);}};}function respondWithFilteredResult(_0x5b4445,_0x17b6ed){return function(_0x39a703){if(_0x39a703){var _0x240175=typeof _0x17b6ed[_0xfeef('0x1b')]==='undefined'&&typeof _0x17b6ed['limit']===_0xfeef('0x1c');var _0x43ddad=_0x39a703[_0xfeef('0x1d')];var _0x49bea8=_0x240175?0x0:_0x17b6ed[_0xfeef('0x1b')];var _0x439e33=_0x240175?_0x39a703[_0xfeef('0x1d')]:_0x17b6ed['offset']+_0x17b6ed[_0xfeef('0x1e')];var _0x15f7c4;if(_0x439e33>=_0x43ddad){_0x439e33=_0x43ddad;_0x15f7c4=0xc8;}else{_0x15f7c4=0xce;}_0x5b4445['status'](_0x15f7c4);return _0x5b4445[_0xfeef('0x1f')](_0xfeef('0x20'),_0x49bea8+'-'+_0x439e33+'/'+_0x43ddad)[_0xfeef('0x1a')](_0x39a703);}return null;};}function patchUpdates(_0xd0c71d){return function(_0x49d680){try{jsonpatch[_0xfeef('0x21')](_0x49d680,_0xd0c71d,!![]);}catch(_0x421b53){return BPromise['reject'](_0x421b53);}return _0x49d680[_0xfeef('0x22')]();};}function saveUpdates(_0x42fb9c,_0x2d21cd){return function(_0x33e777){if(_0x33e777){return _0x33e777[_0xfeef('0x23')](_0x42fb9c)[_0xfeef('0x24')](function(_0x9bc7c9){return _0x9bc7c9;});}return null;};}function removeEntity(_0x2a56a1,_0x2d4b67){return function(_0x2d4800){if(_0x2d4800){return _0x2d4800[_0xfeef('0x25')]()[_0xfeef('0x24')](function(){_0x2a56a1[_0xfeef('0x18')](0xcc)[_0xfeef('0x19')]();});}};}function handleEntityNotFound(_0x362c07,_0x4591f4){return function(_0x4d09c8){if(!_0x4d09c8){_0x362c07[_0xfeef('0x17')](0x194);}return _0x4d09c8;};}function handleError(_0x22a9cd,_0x1a98f5){_0x1a98f5=_0x1a98f5||0x1f4;return function(_0x1850c6){logger[_0xfeef('0x26')](_0x1850c6[_0xfeef('0x27')]);if(_0x1850c6[_0xfeef('0x28')]){delete _0x1850c6[_0xfeef('0x28')];}_0x22a9cd[_0xfeef('0x18')](_0x1a98f5)[_0xfeef('0x29')](_0x1850c6);};}exports[_0xfeef('0x2a')]=function(_0x128086,_0x35c8f2){var _0x550d3e={},_0x31d1bb={},_0x282003={'count':0x0,'rows':[]};var _0x11dee3=_[_0xfeef('0x2b')](db[_0xfeef('0x2c')][_0xfeef('0x2d')],function(_0x596bb8){return{'name':_0x596bb8[_0xfeef('0x2e')],'type':_0x596bb8['type'][_0xfeef('0x2f')]};});_0x31d1bb[_0xfeef('0x30')]=_[_0xfeef('0x2b')](_0x11dee3,_0xfeef('0x28'));_0x31d1bb[_0xfeef('0x31')]=_[_0xfeef('0x32')](_0x128086[_0xfeef('0x31')]);_0x31d1bb[_0xfeef('0x33')]=_[_0xfeef('0x34')](_0x31d1bb['model'],_0x31d1bb[_0xfeef('0x31')]);_0x550d3e[_0xfeef('0x35')]=_[_0xfeef('0x34')](_0x31d1bb[_0xfeef('0x30')],qs['fields'](_0x128086['query']['fields']));_0x550d3e[_0xfeef('0x35')]=_0x550d3e[_0xfeef('0x35')][_0xfeef('0x36')]?_0x550d3e['attributes']:_0x31d1bb['model'];if(!_0x128086[_0xfeef('0x31')][_0xfeef('0x37')](_0xfeef('0x38'))){_0x550d3e[_0xfeef('0x1e')]=qs[_0xfeef('0x1e')](_0x128086[_0xfeef('0x31')][_0xfeef('0x1e')]);_0x550d3e[_0xfeef('0x1b')]=qs[_0xfeef('0x1b')](_0x128086[_0xfeef('0x31')][_0xfeef('0x1b')]);}_0x550d3e[_0xfeef('0x39')]=qs[_0xfeef('0x3a')](_0x128086['query'][_0xfeef('0x3a')]);_0x550d3e[_0xfeef('0x3b')]=qs[_0xfeef('0x33')](_[_0xfeef('0x3c')](_0x128086[_0xfeef('0x31')],_0x31d1bb[_0xfeef('0x33')]),_0x11dee3);if(_0x128086[_0xfeef('0x31')][_0xfeef('0x3d')]){_0x550d3e['where']=_[_0xfeef('0x3e')](_0x550d3e['where'],{'$or':_[_0xfeef('0x2b')](_0x11dee3,function(_0x31df04){if(_0x31df04[_0xfeef('0x3f')]!==_0xfeef('0x40')){var _0xe1f519={};_0xe1f519[_0x31df04['name']]={'$like':'%'+_0x128086['query']['filter']+'%'};return _0xe1f519;}})});}_0x550d3e=_[_0xfeef('0x3e')]({},_0x550d3e,_0x128086['options']);var _0x42aa1a={'where':_0x550d3e[_0xfeef('0x3b')]};return db[_0xfeef('0x2c')]['count'](_0x42aa1a)['then'](function(_0x54cc7b){_0x282003[_0xfeef('0x1d')]=_0x54cc7b;if(_0x128086[_0xfeef('0x31')][_0xfeef('0x41')]){_0x550d3e['include']=[{'all':!![]}];}return db[_0xfeef('0x2c')][_0xfeef('0x42')](_0x550d3e);})[_0xfeef('0x24')](function(_0x2bd9a6){_0x282003[_0xfeef('0x43')]=_0x2bd9a6;return _0x282003;})[_0xfeef('0x24')](respondWithFilteredResult(_0x35c8f2,_0x550d3e))[_0xfeef('0x44')](handleError(_0x35c8f2,null));};exports[_0xfeef('0x45')]=function(_0x1e004b,_0x2f3ee7){var _0x59271e={'raw':![],'where':{'id':_0x1e004b['params']['id']}},_0x50aa89={};_0x50aa89['model']=_[_0xfeef('0x32')](db[_0xfeef('0x2c')][_0xfeef('0x2d')]);_0x50aa89[_0xfeef('0x31')]=_[_0xfeef('0x32')](_0x1e004b['query']);_0x50aa89[_0xfeef('0x33')]=_[_0xfeef('0x34')](_0x50aa89[_0xfeef('0x30')],_0x50aa89['query']);_0x59271e[_0xfeef('0x35')]=_['intersection'](_0x50aa89[_0xfeef('0x30')],qs['fields'](_0x1e004b['query'][_0xfeef('0x46')]));_0x59271e['attributes']=_0x59271e[_0xfeef('0x35')][_0xfeef('0x36')]?_0x59271e[_0xfeef('0x35')]:_0x50aa89['model'];if(_0x1e004b[_0xfeef('0x31')][_0xfeef('0x41')]){_0x59271e[_0xfeef('0x47')]=[{'all':!![]}];}_0x59271e=_[_0xfeef('0x3e')]({},_0x59271e,_0x1e004b[_0xfeef('0x48')]);return db[_0xfeef('0x2c')][_0xfeef('0x49')](_0x59271e)[_0xfeef('0x24')](handleEntityNotFound(_0x2f3ee7,null))[_0xfeef('0x24')](respondWithResult(_0x2f3ee7,null))['catch'](handleError(_0x2f3ee7,null));};exports[_0xfeef('0x4a')]=function(_0x23f027,_0x3c2a8b){return db[_0xfeef('0x2c')][_0xfeef('0x4a')](_0x23f027[_0xfeef('0x4b')],{})['then'](respondWithResult(_0x3c2a8b,0xc9))['catch'](handleError(_0x3c2a8b,null));};exports[_0xfeef('0x23')]=function(_0x5c2ffe,_0xaa48b){if(_0x5c2ffe['body']['id']){delete _0x5c2ffe['body']['id'];}return db['FreshsalesConfiguration'][_0xfeef('0x49')]({'where':{'id':_0x5c2ffe[_0xfeef('0x4c')]['id']}})[_0xfeef('0x24')](handleEntityNotFound(_0xaa48b,null))[_0xfeef('0x24')](saveUpdates(_0x5c2ffe['body'],null))[_0xfeef('0x24')](respondWithResult(_0xaa48b,null))[_0xfeef('0x44')](handleError(_0xaa48b,null));};exports[_0xfeef('0x25')]=function(_0x31494e,_0x27c20b){return db[_0xfeef('0x2c')][_0xfeef('0x49')]({'where':{'id':_0x31494e['params']['id']}})['then'](handleEntityNotFound(_0x27c20b,null))[_0xfeef('0x24')](removeEntity(_0x27c20b,null))[_0xfeef('0x44')](handleError(_0x27c20b,null));};exports[_0xfeef('0x4d')]=function(_0xe0164d,_0xbccb9,_0x3023ac){var _0x25378d={};var _0x59c5b0={};var _0x32d1f5;var _0x31abeb;return db[_0xfeef('0x2c')][_0xfeef('0x4e')]({'where':{'id':_0xe0164d[_0xfeef('0x4c')]['id']}})[_0xfeef('0x24')](handleEntityNotFound(_0xbccb9,null))[_0xfeef('0x24')](function(_0x1ea9b7){if(_0x1ea9b7){_0x32d1f5=_0x1ea9b7;_0x59c5b0[_0xfeef('0x30')]=_[_0xfeef('0x32')](db[_0xfeef('0x4f')][_0xfeef('0x2d')]);_0x59c5b0[_0xfeef('0x31')]=_[_0xfeef('0x32')](_0xe0164d['query']);_0x59c5b0[_0xfeef('0x33')]=_[_0xfeef('0x34')](_0x59c5b0['model'],_0x59c5b0['query']);_0x25378d[_0xfeef('0x35')]=_['intersection'](_0x59c5b0[_0xfeef('0x30')],qs[_0xfeef('0x46')](_0xe0164d[_0xfeef('0x31')][_0xfeef('0x46')]));_0x25378d[_0xfeef('0x35')]=_0x25378d['attributes'][_0xfeef('0x36')]?_0x25378d['attributes']:_0x59c5b0[_0xfeef('0x30')];_0x25378d[_0xfeef('0x39')]=qs[_0xfeef('0x3a')](_0xe0164d[_0xfeef('0x31')]['sort']);_0x25378d['where']=qs[_0xfeef('0x33')](_[_0xfeef('0x3c')](_0xe0164d[_0xfeef('0x31')],_0x59c5b0[_0xfeef('0x33')]));if(_0xe0164d[_0xfeef('0x31')][_0xfeef('0x3d')]){_0x25378d[_0xfeef('0x3b')]=_[_0xfeef('0x3e')](_0x25378d[_0xfeef('0x3b')],{'$or':_[_0xfeef('0x2b')](_0x25378d['attributes'],function(_0x2f43a9){var _0x222f33={};_0x222f33[_0x2f43a9]={'$like':'%'+_0xe0164d[_0xfeef('0x31')][_0xfeef('0x3d')]+'%'};return _0x222f33;})});}_0x25378d=_[_0xfeef('0x3e')]({},_0x25378d,_0xe0164d[_0xfeef('0x48')]);return _0x32d1f5[_0xfeef('0x4d')](_0x25378d);}})['then'](function(_0x9605b1){if(_0x9605b1){_0x31abeb=_0x9605b1[_0xfeef('0x36')];if(!_0xe0164d[_0xfeef('0x31')][_0xfeef('0x37')](_0xfeef('0x38'))){_0x25378d[_0xfeef('0x1e')]=qs[_0xfeef('0x1e')](_0xe0164d['query'][_0xfeef('0x1e')]);_0x25378d['offset']=qs[_0xfeef('0x1b')](_0xe0164d[_0xfeef('0x31')][_0xfeef('0x1b')]);}return _0x32d1f5[_0xfeef('0x4d')](_0x25378d);}})[_0xfeef('0x24')](function(_0x1b9045){if(_0x1b9045){return _0x1b9045?{'count':_0x31abeb,'rows':_0x1b9045}:null;}})[_0xfeef('0x24')](respondWithResult(_0xbccb9,null))[_0xfeef('0x44')](handleError(_0xbccb9,null));};exports[_0xfeef('0x50')]=function(_0x31c024,_0x1fe9ef,_0x8fc60a){var _0x305dd7={};var _0x39d2b6={};var _0x4d3163;var _0x180913;return db[_0xfeef('0x2c')]['findOne']({'where':{'id':_0x31c024[_0xfeef('0x4c')]['id']}})[_0xfeef('0x24')](handleEntityNotFound(_0x1fe9ef,null))[_0xfeef('0x24')](function(_0xddfeaa){if(_0xddfeaa){_0x4d3163=_0xddfeaa;_0x39d2b6[_0xfeef('0x30')]=_[_0xfeef('0x32')](db[_0xfeef('0x4f')]['rawAttributes']);_0x39d2b6[_0xfeef('0x31')]=_['keys'](_0x31c024[_0xfeef('0x31')]);_0x39d2b6[_0xfeef('0x33')]=_[_0xfeef('0x34')](_0x39d2b6[_0xfeef('0x30')],_0x39d2b6[_0xfeef('0x31')]);_0x305dd7[_0xfeef('0x35')]=_['intersection'](_0x39d2b6['model'],qs['fields'](_0x31c024[_0xfeef('0x31')][_0xfeef('0x46')]));_0x305dd7[_0xfeef('0x35')]=_0x305dd7[_0xfeef('0x35')][_0xfeef('0x36')]?_0x305dd7[_0xfeef('0x35')]:_0x39d2b6[_0xfeef('0x30')];_0x305dd7[_0xfeef('0x39')]=qs[_0xfeef('0x3a')](_0x31c024['query'][_0xfeef('0x3a')]);_0x305dd7[_0xfeef('0x3b')]=qs[_0xfeef('0x33')](_['pick'](_0x31c024[_0xfeef('0x31')],_0x39d2b6['filters']));if(_0x31c024[_0xfeef('0x31')][_0xfeef('0x3d')]){_0x305dd7[_0xfeef('0x3b')]=_[_0xfeef('0x3e')](_0x305dd7[_0xfeef('0x3b')],{'$or':_[_0xfeef('0x2b')](_0x305dd7[_0xfeef('0x35')],function(_0x4a3091){var _0x18cf97={};_0x18cf97[_0x4a3091]={'$like':'%'+_0x31c024[_0xfeef('0x31')][_0xfeef('0x3d')]+'%'};return _0x18cf97;})});}_0x305dd7=_[_0xfeef('0x3e')]({},_0x305dd7,_0x31c024[_0xfeef('0x48')]);return _0x4d3163[_0xfeef('0x50')](_0x305dd7);}})[_0xfeef('0x24')](function(_0x52b21b){if(_0x52b21b){_0x180913=_0x52b21b[_0xfeef('0x36')];if(!_0x31c024[_0xfeef('0x31')]['hasOwnProperty'](_0xfeef('0x38'))){_0x305dd7['limit']=qs[_0xfeef('0x1e')](_0x31c024[_0xfeef('0x31')][_0xfeef('0x1e')]);_0x305dd7[_0xfeef('0x1b')]=qs[_0xfeef('0x1b')](_0x31c024[_0xfeef('0x31')][_0xfeef('0x1b')]);}return _0x4d3163[_0xfeef('0x50')](_0x305dd7);}})[_0xfeef('0x24')](function(_0x3850c0){if(_0x3850c0){return _0x3850c0?{'count':_0x180913,'rows':_0x3850c0}:null;}})[_0xfeef('0x24')](respondWithResult(_0x1fe9ef,null))['catch'](handleError(_0x1fe9ef,null));};exports[_0xfeef('0x51')]=function(_0x161aaa,_0x2abef8,_0x240644){var _0x246e2a={};var _0x5ec00b={};var _0x4beb74;var _0x43adf3;return db[_0xfeef('0x2c')]['findOne']({'where':{'id':_0x161aaa['params']['id']}})[_0xfeef('0x24')](handleEntityNotFound(_0x2abef8,null))['then'](function(_0x1911dd){if(_0x1911dd){_0x4beb74=_0x1911dd;_0x5ec00b[_0xfeef('0x30')]=_['keys'](db[_0xfeef('0x4f')]['rawAttributes']);_0x5ec00b[_0xfeef('0x31')]=_[_0xfeef('0x32')](_0x161aaa['query']);_0x5ec00b[_0xfeef('0x33')]=_['intersection'](_0x5ec00b[_0xfeef('0x30')],_0x5ec00b['query']);_0x246e2a[_0xfeef('0x35')]=_[_0xfeef('0x34')](_0x5ec00b[_0xfeef('0x30')],qs[_0xfeef('0x46')](_0x161aaa['query'][_0xfeef('0x46')]));_0x246e2a[_0xfeef('0x35')]=_0x246e2a[_0xfeef('0x35')][_0xfeef('0x36')]?_0x246e2a[_0xfeef('0x35')]:_0x5ec00b[_0xfeef('0x30')];_0x246e2a['order']=qs[_0xfeef('0x3a')](_0x161aaa[_0xfeef('0x31')]['sort']);_0x246e2a[_0xfeef('0x3b')]=qs[_0xfeef('0x33')](_[_0xfeef('0x3c')](_0x161aaa[_0xfeef('0x31')],_0x5ec00b[_0xfeef('0x33')]));if(_0x161aaa[_0xfeef('0x31')]['filter']){_0x246e2a['where']=_[_0xfeef('0x3e')](_0x246e2a[_0xfeef('0x3b')],{'$or':_[_0xfeef('0x2b')](_0x246e2a['attributes'],function(_0x49e9c8){var _0x484482={};_0x484482[_0x49e9c8]={'$like':'%'+_0x161aaa[_0xfeef('0x31')][_0xfeef('0x3d')]+'%'};return _0x484482;})});}_0x246e2a=_[_0xfeef('0x3e')]({},_0x246e2a,_0x161aaa[_0xfeef('0x48')]);return _0x4beb74['getFields'](_0x246e2a);}})[_0xfeef('0x24')](function(_0x58f391){if(_0x58f391){_0x43adf3=_0x58f391[_0xfeef('0x36')];if(!_0x161aaa[_0xfeef('0x31')][_0xfeef('0x37')](_0xfeef('0x38'))){_0x246e2a[_0xfeef('0x1e')]=qs[_0xfeef('0x1e')](_0x161aaa['query'][_0xfeef('0x1e')]);_0x246e2a[_0xfeef('0x1b')]=qs[_0xfeef('0x1b')](_0x161aaa[_0xfeef('0x31')][_0xfeef('0x1b')]);}return _0x4beb74[_0xfeef('0x51')](_0x246e2a);}})['then'](function(_0x1d4749){if(_0x1d4749){return _0x1d4749?{'count':_0x43adf3,'rows':_0x1d4749}:null;}})[_0xfeef('0x24')](respondWithResult(_0x2abef8,null))[_0xfeef('0x44')](handleError(_0x2abef8,null));}; \ No newline at end of file +var _0xa834=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','findOne','FreshsalesField','order','getSubjects','hasOwnProperty','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4f608e,_0x1bc59c){var _0x4c90d7=function(_0x3ce3d0){while(--_0x3ce3d0){_0x4f608e['push'](_0x4f608e['shift']());}};_0x4c90d7(++_0x1bc59c);}(_0xa834,0x18a));var _0x4a83=function(_0x4eb3b2,_0x21261f){_0x4eb3b2=_0x4eb3b2-0x0;var _0x4db257=_0xa834[_0x4eb3b2];return _0x4db257;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a83('0x0'));var zipdir=require(_0x4a83('0x1'));var jsonpatch=require(_0x4a83('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a83('0x3'));var Mustache=require(_0x4a83('0x4'));var util=require('util');var path=require(_0x4a83('0x5'));var sox=require(_0x4a83('0x6'));var csv=require(_0x4a83('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a83('0x8'));var _=require('lodash');var squel=require(_0x4a83('0x9'));var crypto=require(_0x4a83('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4a83('0xb'));var toCsv=require(_0x4a83('0x7'));var querystring=require('querystring');var Papa=require(_0x4a83('0xc'));var Redis=require(_0x4a83('0xd'));var authService=require(_0x4a83('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4a83('0xf'));var hardwareService=require(_0x4a83('0x10'));var logger=require(_0x4a83('0x11'))(_0x4a83('0x12'));var utils=require(_0x4a83('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4a83('0x14'));var db=require(_0x4a83('0x15'))['db'];function respondWithStatusCode(_0x21ba6f,_0xe5fa18){_0xe5fa18=_0xe5fa18||0xcc;return function(_0x4c24e1){if(_0x4c24e1){return _0x21ba6f['sendStatus'](_0xe5fa18);}return _0x21ba6f[_0x4a83('0x16')](_0xe5fa18)[_0x4a83('0x17')]();};}function respondWithResult(_0x5438d0,_0x3c0c4e){_0x3c0c4e=_0x3c0c4e||0xc8;return function(_0x24dead){if(_0x24dead){return _0x5438d0['status'](_0x3c0c4e)['json'](_0x24dead);}};}function respondWithFilteredResult(_0x27892e,_0x234d75){return function(_0x4dfb50){if(_0x4dfb50){var _0x4c822f=typeof _0x234d75[_0x4a83('0x18')]===_0x4a83('0x19')&&typeof _0x234d75[_0x4a83('0x1a')]==='undefined';var _0x2a0b09=_0x4dfb50['count'];var _0x4dcd36=_0x4c822f?0x0:_0x234d75[_0x4a83('0x18')];var _0x3920ab=_0x4c822f?_0x4dfb50[_0x4a83('0x1b')]:_0x234d75[_0x4a83('0x18')]+_0x234d75[_0x4a83('0x1a')];var _0x3b71d1;if(_0x3920ab>=_0x2a0b09){_0x3920ab=_0x2a0b09;_0x3b71d1=0xc8;}else{_0x3b71d1=0xce;}_0x27892e[_0x4a83('0x16')](_0x3b71d1);return _0x27892e[_0x4a83('0x1c')](_0x4a83('0x1d'),_0x4dcd36+'-'+_0x3920ab+'/'+_0x2a0b09)[_0x4a83('0x1e')](_0x4dfb50);}return null;};}function patchUpdates(_0x417fe1){return function(_0x17d85f){try{jsonpatch[_0x4a83('0x1f')](_0x17d85f,_0x417fe1,!![]);}catch(_0x4dfc40){return BPromise[_0x4a83('0x20')](_0x4dfc40);}return _0x17d85f[_0x4a83('0x21')]();};}function saveUpdates(_0x172a41,_0x2a54b3){return function(_0x40e8ad){if(_0x40e8ad){return _0x40e8ad[_0x4a83('0x22')](_0x172a41)[_0x4a83('0x23')](function(_0xbb2981){return _0xbb2981;});}return null;};}function removeEntity(_0x41ee6c,_0x5ce038){return function(_0x18fccf){if(_0x18fccf){return _0x18fccf[_0x4a83('0x24')]()[_0x4a83('0x23')](function(){_0x41ee6c[_0x4a83('0x16')](0xcc)[_0x4a83('0x17')]();});}};}function handleEntityNotFound(_0x5d1e92,_0x187a65){return function(_0x1118c6){if(!_0x1118c6){_0x5d1e92[_0x4a83('0x25')](0x194);}return _0x1118c6;};}function handleError(_0x56253f,_0x54d48a){_0x54d48a=_0x54d48a||0x1f4;return function(_0x59585b){logger[_0x4a83('0x26')](_0x59585b[_0x4a83('0x27')]);if(_0x59585b[_0x4a83('0x28')]){delete _0x59585b[_0x4a83('0x28')];}_0x56253f['status'](_0x54d48a)[_0x4a83('0x29')](_0x59585b);};}exports[_0x4a83('0x2a')]=function(_0x458823,_0x588da4){var _0x23aa0f={},_0x386c38={},_0x4d0401={'count':0x0,'rows':[]};var _0x41ee38=_[_0x4a83('0x2b')](db[_0x4a83('0x2c')]['rawAttributes'],function(_0x2e10f0){return{'name':_0x2e10f0[_0x4a83('0x2d')],'type':_0x2e10f0['type'][_0x4a83('0x2e')]};});_0x386c38['model']=_[_0x4a83('0x2b')](_0x41ee38,_0x4a83('0x28'));_0x386c38[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0x458823[_0x4a83('0x2f')]);_0x386c38[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x386c38[_0x4a83('0x33')],_0x386c38['query']);_0x23aa0f['attributes']=_[_0x4a83('0x32')](_0x386c38['model'],qs[_0x4a83('0x34')](_0x458823[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x23aa0f['attributes']=_0x23aa0f[_0x4a83('0x35')][_0x4a83('0x36')]?_0x23aa0f[_0x4a83('0x35')]:_0x386c38[_0x4a83('0x33')];if(!_0x458823[_0x4a83('0x2f')]['hasOwnProperty'](_0x4a83('0x37'))){_0x23aa0f[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x458823[_0x4a83('0x2f')]['limit']);_0x23aa0f[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0x458823['query'][_0x4a83('0x18')]);}_0x23aa0f['order']=qs[_0x4a83('0x38')](_0x458823[_0x4a83('0x2f')][_0x4a83('0x38')]);_0x23aa0f[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0x458823[_0x4a83('0x2f')],_0x386c38[_0x4a83('0x31')]),_0x41ee38);if(_0x458823[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x23aa0f['where']=_[_0x4a83('0x3c')](_0x23aa0f[_0x4a83('0x39')],{'$or':_[_0x4a83('0x2b')](_0x41ee38,function(_0x14ae21){if(_0x14ae21[_0x4a83('0x3d')]!==_0x4a83('0x3e')){var _0x5082c2={};_0x5082c2[_0x14ae21[_0x4a83('0x28')]]={'$like':'%'+_0x458823['query'][_0x4a83('0x3b')]+'%'};return _0x5082c2;}})});}_0x23aa0f=_[_0x4a83('0x3c')]({},_0x23aa0f,_0x458823[_0x4a83('0x3f')]);var _0x39b988={'where':_0x23aa0f[_0x4a83('0x39')]};return db[_0x4a83('0x2c')][_0x4a83('0x1b')](_0x39b988)['then'](function(_0x2c35c6){_0x4d0401[_0x4a83('0x1b')]=_0x2c35c6;if(_0x458823[_0x4a83('0x2f')][_0x4a83('0x40')]){_0x23aa0f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x4a83('0x41')](_0x23aa0f);})['then'](function(_0x238446){_0x4d0401[_0x4a83('0x42')]=_0x238446;return _0x4d0401;})[_0x4a83('0x23')](respondWithFilteredResult(_0x588da4,_0x23aa0f))[_0x4a83('0x43')](handleError(_0x588da4,null));};exports[_0x4a83('0x44')]=function(_0x48aed7,_0x35ea17){var _0x3a3b0d={'raw':![],'where':{'id':_0x48aed7[_0x4a83('0x45')]['id']}},_0x49c851={};_0x49c851['model']=_[_0x4a83('0x30')](db[_0x4a83('0x2c')][_0x4a83('0x46')]);_0x49c851['query']=_[_0x4a83('0x30')](_0x48aed7[_0x4a83('0x2f')]);_0x49c851['filters']=_['intersection'](_0x49c851[_0x4a83('0x33')],_0x49c851[_0x4a83('0x2f')]);_0x3a3b0d['attributes']=_[_0x4a83('0x32')](_0x49c851['model'],qs[_0x4a83('0x34')](_0x48aed7[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x3a3b0d[_0x4a83('0x35')]=_0x3a3b0d[_0x4a83('0x35')]['length']?_0x3a3b0d[_0x4a83('0x35')]:_0x49c851[_0x4a83('0x33')];if(_0x48aed7[_0x4a83('0x2f')][_0x4a83('0x40')]){_0x3a3b0d[_0x4a83('0x47')]=[{'all':!![]}];}_0x3a3b0d=_[_0x4a83('0x3c')]({},_0x3a3b0d,_0x48aed7[_0x4a83('0x3f')]);return db[_0x4a83('0x2c')]['find'](_0x3a3b0d)[_0x4a83('0x23')](handleEntityNotFound(_0x35ea17,null))[_0x4a83('0x23')](respondWithResult(_0x35ea17,null))['catch'](handleError(_0x35ea17,null));};exports[_0x4a83('0x48')]=function(_0x94ad5d,_0x3e9927){return db[_0x4a83('0x2c')][_0x4a83('0x48')](_0x94ad5d[_0x4a83('0x49')],{})[_0x4a83('0x23')](respondWithResult(_0x3e9927,0xc9))[_0x4a83('0x43')](handleError(_0x3e9927,null));};exports[_0x4a83('0x22')]=function(_0x365340,_0x184d0e){if(_0x365340[_0x4a83('0x49')]['id']){delete _0x365340['body']['id'];}return db[_0x4a83('0x2c')][_0x4a83('0x4a')]({'where':{'id':_0x365340[_0x4a83('0x45')]['id']}})[_0x4a83('0x23')](handleEntityNotFound(_0x184d0e,null))[_0x4a83('0x23')](saveUpdates(_0x365340[_0x4a83('0x49')],null))[_0x4a83('0x23')](respondWithResult(_0x184d0e,null))[_0x4a83('0x43')](handleError(_0x184d0e,null));};exports['destroy']=function(_0x3f814f,_0x2e25b9){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3f814f[_0x4a83('0x45')]['id']}})[_0x4a83('0x23')](handleEntityNotFound(_0x2e25b9,null))[_0x4a83('0x23')](removeEntity(_0x2e25b9,null))['catch'](handleError(_0x2e25b9,null));};exports['getSubjects']=function(_0x18438f,_0x492c77,_0x5b18f3){var _0x3533e7={};var _0x4ded0e={};var _0xa78e78;var _0xf7853d;return db[_0x4a83('0x2c')][_0x4a83('0x4b')]({'where':{'id':_0x18438f[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0x492c77,null))[_0x4a83('0x23')](function(_0x21fc63){if(_0x21fc63){_0xa78e78=_0x21fc63;_0x4ded0e[_0x4a83('0x33')]=_[_0x4a83('0x30')](db[_0x4a83('0x4c')][_0x4a83('0x46')]);_0x4ded0e['query']=_[_0x4a83('0x30')](_0x18438f['query']);_0x4ded0e[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x4ded0e[_0x4a83('0x33')],_0x4ded0e[_0x4a83('0x2f')]);_0x3533e7[_0x4a83('0x35')]=_['intersection'](_0x4ded0e[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0x18438f[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x3533e7[_0x4a83('0x35')]=_0x3533e7[_0x4a83('0x35')][_0x4a83('0x36')]?_0x3533e7[_0x4a83('0x35')]:_0x4ded0e['model'];_0x3533e7[_0x4a83('0x4d')]=qs['sort'](_0x18438f[_0x4a83('0x2f')][_0x4a83('0x38')]);_0x3533e7[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0x18438f[_0x4a83('0x2f')],_0x4ded0e['filters']));if(_0x18438f[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x3533e7[_0x4a83('0x39')]=_['merge'](_0x3533e7[_0x4a83('0x39')],{'$or':_['map'](_0x3533e7['attributes'],function(_0x10779f){var _0xba674c={};_0xba674c[_0x10779f]={'$like':'%'+_0x18438f['query'][_0x4a83('0x3b')]+'%'};return _0xba674c;})});}_0x3533e7=_['merge']({},_0x3533e7,_0x18438f[_0x4a83('0x3f')]);return _0xa78e78[_0x4a83('0x4e')](_0x3533e7);}})['then'](function(_0x53d811){if(_0x53d811){_0xf7853d=_0x53d811[_0x4a83('0x36')];if(!_0x18438f[_0x4a83('0x2f')][_0x4a83('0x4f')]('nolimit')){_0x3533e7[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x18438f[_0x4a83('0x2f')]['limit']);_0x3533e7['offset']=qs[_0x4a83('0x18')](_0x18438f['query'][_0x4a83('0x18')]);}return _0xa78e78['getSubjects'](_0x3533e7);}})['then'](function(_0x13eed5){if(_0x13eed5){return _0x13eed5?{'count':_0xf7853d,'rows':_0x13eed5}:null;}})[_0x4a83('0x23')](respondWithResult(_0x492c77,null))[_0x4a83('0x43')](handleError(_0x492c77,null));};exports[_0x4a83('0x50')]=function(_0xc31397,_0xd0b4e3,_0x324d8b){var _0xf34909={};var _0x56ac2d={};var _0x52de90;var _0x4ab260;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xc31397[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0xd0b4e3,null))[_0x4a83('0x23')](function(_0x27de9d){if(_0x27de9d){_0x52de90=_0x27de9d;_0x56ac2d['model']=_['keys'](db['FreshsalesField'][_0x4a83('0x46')]);_0x56ac2d[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0xc31397[_0x4a83('0x2f')]);_0x56ac2d[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x56ac2d[_0x4a83('0x33')],_0x56ac2d['query']);_0xf34909[_0x4a83('0x35')]=_[_0x4a83('0x32')](_0x56ac2d[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0xc31397['query'][_0x4a83('0x34')]));_0xf34909[_0x4a83('0x35')]=_0xf34909['attributes'][_0x4a83('0x36')]?_0xf34909[_0x4a83('0x35')]:_0x56ac2d[_0x4a83('0x33')];_0xf34909[_0x4a83('0x4d')]=qs['sort'](_0xc31397[_0x4a83('0x2f')]['sort']);_0xf34909[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0xc31397[_0x4a83('0x2f')],_0x56ac2d[_0x4a83('0x31')]));if(_0xc31397['query'][_0x4a83('0x3b')]){_0xf34909[_0x4a83('0x39')]=_['merge'](_0xf34909[_0x4a83('0x39')],{'$or':_['map'](_0xf34909[_0x4a83('0x35')],function(_0xf41617){var _0x5118e4={};_0x5118e4[_0xf41617]={'$like':'%'+_0xc31397[_0x4a83('0x2f')][_0x4a83('0x3b')]+'%'};return _0x5118e4;})});}_0xf34909=_['merge']({},_0xf34909,_0xc31397['options']);return _0x52de90[_0x4a83('0x50')](_0xf34909);}})[_0x4a83('0x23')](function(_0x190154){if(_0x190154){_0x4ab260=_0x190154['length'];if(!_0xc31397['query'][_0x4a83('0x4f')]('nolimit')){_0xf34909[_0x4a83('0x1a')]=qs['limit'](_0xc31397[_0x4a83('0x2f')][_0x4a83('0x1a')]);_0xf34909[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0xc31397[_0x4a83('0x2f')][_0x4a83('0x18')]);}return _0x52de90[_0x4a83('0x50')](_0xf34909);}})[_0x4a83('0x23')](function(_0x2b8336){if(_0x2b8336){return _0x2b8336?{'count':_0x4ab260,'rows':_0x2b8336}:null;}})[_0x4a83('0x23')](respondWithResult(_0xd0b4e3,null))[_0x4a83('0x43')](handleError(_0xd0b4e3,null));};exports[_0x4a83('0x51')]=function(_0x3f8aeb,_0x36575b,_0x50d24a){var _0x45ea01={};var _0x3b9c7c={};var _0x49fc96;var _0x4c0a0e;return db[_0x4a83('0x2c')][_0x4a83('0x4b')]({'where':{'id':_0x3f8aeb[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0x36575b,null))[_0x4a83('0x23')](function(_0x2086d1){if(_0x2086d1){_0x49fc96=_0x2086d1;_0x3b9c7c['model']=_[_0x4a83('0x30')](db[_0x4a83('0x4c')][_0x4a83('0x46')]);_0x3b9c7c[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0x3f8aeb['query']);_0x3b9c7c[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x3b9c7c[_0x4a83('0x33')],_0x3b9c7c[_0x4a83('0x2f')]);_0x45ea01[_0x4a83('0x35')]=_[_0x4a83('0x32')](_0x3b9c7c[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x45ea01['attributes']=_0x45ea01[_0x4a83('0x35')][_0x4a83('0x36')]?_0x45ea01['attributes']:_0x3b9c7c['model'];_0x45ea01[_0x4a83('0x4d')]=qs['sort'](_0x3f8aeb[_0x4a83('0x2f')]['sort']);_0x45ea01[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_['pick'](_0x3f8aeb[_0x4a83('0x2f')],_0x3b9c7c[_0x4a83('0x31')]));if(_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x45ea01[_0x4a83('0x39')]=_[_0x4a83('0x3c')](_0x45ea01[_0x4a83('0x39')],{'$or':_[_0x4a83('0x2b')](_0x45ea01[_0x4a83('0x35')],function(_0x38873d){var _0x5d0971={};_0x5d0971[_0x38873d]={'$like':'%'+_0x3f8aeb[_0x4a83('0x2f')]['filter']+'%'};return _0x5d0971;})});}_0x45ea01=_[_0x4a83('0x3c')]({},_0x45ea01,_0x3f8aeb[_0x4a83('0x3f')]);return _0x49fc96[_0x4a83('0x51')](_0x45ea01);}})[_0x4a83('0x23')](function(_0x928149){if(_0x928149){_0x4c0a0e=_0x928149[_0x4a83('0x36')];if(!_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x4f')](_0x4a83('0x37'))){_0x45ea01[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x1a')]);_0x45ea01[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0x3f8aeb[_0x4a83('0x2f')]['offset']);}return _0x49fc96['getFields'](_0x45ea01);}})[_0x4a83('0x23')](function(_0x4cd2d8){if(_0x4cd2d8){return _0x4cd2d8?{'count':_0x4c0a0e,'rows':_0x4cd2d8}:null;}})[_0x4a83('0x23')](respondWithResult(_0x36575b,null))['catch'](handleError(_0x36575b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 7fa3d2b..c2fa76e 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 _0xa6d6=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','util','../../config/logger'];(function(_0x367d67,_0x5ea268){var _0x2199d7=function(_0x5367d7){while(--_0x5367d7){_0x367d67['push'](_0x367d67['shift']());}};_0x2199d7(++_0x5ea268);}(_0xa6d6,0xae));var _0x6a6d=function(_0x4dec6a,_0x2bf3c9){_0x4dec6a=_0x4dec6a-0x0;var _0x17065f=_0xa6d6[_0x4dec6a];return _0x17065f;};'use strict';var _=require('lodash');var util=require(_0x6a6d('0x0'));var logger=require(_0x6a6d('0x1'))(_0x6a6d('0x2'));var moment=require(_0x6a6d('0x3'));var BPromise=require(_0x6a6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a6d('0x5'));var rimraf=require(_0x6a6d('0x6'));var config=require(_0x6a6d('0x7'));var attributes=require(_0x6a6d('0x8'));module['exports']=function(_0x15c097,_0x27d902){return _0x15c097[_0x6a6d('0x9')](_0x6a6d('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe362=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f8a89,_0x578c3f){var _0x26ea18=function(_0x48288a){while(--_0x48288a){_0x1f8a89['push'](_0x1f8a89['shift']());}};_0x26ea18(++_0x578c3f);}(_0xe362,0x13b));var _0x2e36=function(_0x1619cc,_0x34a660){_0x1619cc=_0x1619cc-0x0;var _0x55bda7=_0xe362[_0x1619cc];return _0x55bda7;};'use strict';var _=require(_0x2e36('0x0'));var util=require(_0x2e36('0x1'));var logger=require(_0x2e36('0x2'))(_0x2e36('0x3'));var moment=require(_0x2e36('0x4'));var BPromise=require(_0x2e36('0x5'));var rp=require(_0x2e36('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e36('0x7'));var config=require(_0x2e36('0x8'));var attributes=require(_0x2e36('0x9'));module[_0x2e36('0xa')]=function(_0x554bea,_0x5bab90){return _0x554bea[_0x2e36('0xb')](_0x2e36('0xc'),attributes,{'tableName':_0x2e36('0xd'),'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 48cced2..a11ccd4 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 _0x4ba0=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x4ba0,0xff));var _0x04ba=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x4ba0[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x04ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x04ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04ba('0x2'));var db=require(_0x04ba('0x3'))['db'];var utils=require(_0x04ba('0x4'));var logger=require(_0x04ba('0x5'))(_0x04ba('0x6'));var config=require(_0x04ba('0x7'));var jayson=require(_0x04ba('0x8'));var client=jayson[_0x04ba('0x9')][_0x04ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b8b5c,_0x4b7fd3,_0x33c918){return new BPromise(function(_0x36baed,_0x2df204){return client['request'](_0x5b8b5c,_0x33c918)[_0x04ba('0xb')](function(_0x3042a1){logger[_0x04ba('0xc')](_0x04ba('0xd'),_0x4b7fd3,'request\x20sent');logger[_0x04ba('0xe')](_0x04ba('0xf'),_0x4b7fd3,_0x04ba('0x10'),JSON[_0x04ba('0x11')](_0x3042a1));if(_0x3042a1['error']){if(_0x3042a1[_0x04ba('0x12')][_0x04ba('0x13')]===0x1f4){logger[_0x04ba('0x12')](_0x04ba('0xd'),_0x4b7fd3,_0x3042a1[_0x04ba('0x12')][_0x04ba('0x14')]);return _0x2df204(_0x3042a1['error'][_0x04ba('0x14')]);}logger[_0x04ba('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4b7fd3,_0x3042a1[_0x04ba('0x12')][_0x04ba('0x14')]);return _0x36baed(_0x3042a1[_0x04ba('0x12')][_0x04ba('0x14')]);}else{logger['info'](_0x04ba('0xd'),_0x4b7fd3,_0x04ba('0x10'));_0x36baed(_0x3042a1[_0x04ba('0x15')][_0x04ba('0x14')]);}})[_0x04ba('0x16')](function(_0x520f5f){logger[_0x04ba('0x12')](_0x04ba('0xd'),_0x4b7fd3,_0x520f5f);_0x2df204(_0x520f5f);});});} \ No newline at end of file +var _0x37bf=['../../config/logger','rpc','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x958b43,_0x1dfc07){var _0x213319=function(_0xbeb551){while(--_0xbeb551){_0x958b43['push'](_0x958b43['shift']());}};_0x213319(++_0x1dfc07);}(_0x37bf,0x143));var _0xf37b=function(_0x4e47ed,_0x5753d9){_0x4e47ed=_0x4e47ed-0x0;var _0x277cdf=_0x37bf[_0x4e47ed];return _0x277cdf;};'use strict';var _=require('lodash');var util=require(_0xf37b('0x0'));var moment=require(_0xf37b('0x1'));var BPromise=require(_0xf37b('0x2'));var rs=require(_0xf37b('0x3'));var fs=require('fs');var Redis=require(_0xf37b('0x4'));var db=require(_0xf37b('0x5'))['db'];var utils=require(_0xf37b('0x6'));var logger=require(_0xf37b('0x7'))(_0xf37b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf37b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547b57,_0x13e61e,_0x9533c2){return new BPromise(function(_0x167ea6,_0x4843f4){return client[_0xf37b('0xa')](_0x547b57,_0x9533c2)[_0xf37b('0xb')](function(_0x27d1bc){logger[_0xf37b('0xc')](_0xf37b('0xd'),_0x13e61e,'request\x20sent');logger[_0xf37b('0xe')](_0xf37b('0xf'),_0x13e61e,_0xf37b('0x10'),JSON[_0xf37b('0x11')](_0x27d1bc));if(_0x27d1bc['error']){if(_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x13')]===0x1f4){logger[_0xf37b('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x13e61e,_0x27d1bc[_0xf37b('0x12')]['message']);return _0x4843f4(_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x14')]);}logger['error'](_0xf37b('0xd'),_0x13e61e,_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x14')]);return _0x167ea6(_0x27d1bc[_0xf37b('0x12')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13e61e,_0xf37b('0x10'));_0x167ea6(_0x27d1bc[_0xf37b('0x15')][_0xf37b('0x14')]);}})['catch'](function(_0x1fa5e2){logger['error'](_0xf37b('0xd'),_0x13e61e,_0x1fa5e2);_0x4843f4(_0x1fa5e2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 50c76b8..849c863 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 _0xa44a=['/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','create'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa44a,0x9a));var _0xaa44=function(_0x43dfb1,_0x1943ab){_0x43dfb1=_0x43dfb1-0x0;var _0x12a6b6=_0xa44a[_0x43dfb1];return _0x12a6b6;};'use strict';var multer=require(_0xaa44('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa44('0x1'));var express=require(_0xaa44('0x2'));var router=express[_0xaa44('0x3')]();var fs_extra=require(_0xaa44('0x4'));var auth=require(_0xaa44('0x5'));var interaction=require(_0xaa44('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0xaa44('0x7')]('/',auth[_0xaa44('0x8')](),controller['index']);router[_0xaa44('0x7')]('/:id',auth[_0xaa44('0x8')](),controller[_0xaa44('0x9')]);router['post']('/',auth[_0xaa44('0x8')](),controller[_0xaa44('0xa')]);router['put'](_0xaa44('0xb'),auth[_0xaa44('0x8')](),controller[_0xaa44('0xc')]);router[_0xaa44('0xd')]('/:id',auth[_0xaa44('0x8')](),controller['destroy']);module[_0xaa44('0xe')]=router; \ No newline at end of file +var _0xe489=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1029f2,_0x2f5903){var _0xdc52c=function(_0x459b0b){while(--_0x459b0b){_0x1029f2['push'](_0x1029f2['shift']());}};_0xdc52c(++_0x2f5903);}(_0xe489,0x9e));var _0x9e48=function(_0x15816f,_0x5c1ad1){_0x15816f=_0x15816f-0x0;var _0x477b42=_0xe489[_0x15816f];return _0x477b42;};'use strict';var multer=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var path=require('path');var timeout=require(_0x9e48('0x2'));var express=require(_0x9e48('0x3'));var router=express[_0x9e48('0x4')]();var fs_extra=require(_0x9e48('0x5'));var auth=require(_0x9e48('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e48('0x7'));router['get']('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0x9')]);router[_0x9e48('0xa')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0xc')]);router[_0x9e48('0xd')]('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0xe')]);router[_0x9e48('0xf')]('/:id',auth[_0x9e48('0x8')](),controller[_0x9e48('0x10')]);router[_0x9e48('0x11')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0x12')]);module[_0x9e48('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0322455..62109b2 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 _0x6481=['STRING','sequelize','ENUM','string','customVariable','keyValue','picklist','variable'];(function(_0x1f71b6,_0x1c87db){var _0x2d05a5=function(_0x1567db){while(--_0x1567db){_0x1f71b6['push'](_0x1f71b6['shift']());}};_0x2d05a5(++_0x1c87db);}(_0x6481,0x89));var _0x1648=function(_0x1fe386,_0x5e6858){_0x1fe386=_0x1fe386-0x0;var _0x394d9b=_0x6481[_0x1fe386];return _0x394d9b;};'use strict';var Sequelize=require(_0x1648('0x0'));module['exports']={'type':{'type':Sequelize[_0x1648('0x1')](_0x1648('0x2'),'variable',_0x1648('0x3'),_0x1648('0x4'),_0x1648('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1648('0x1')](_0x1648('0x2'),_0x1648('0x6'),_0x1648('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1648('0x7')]}}; \ No newline at end of file +var _0x332b=['variable','customVariable','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x332b,0x9f));var _0xb332=function(_0xb0158,_0x3ebd8b){_0xb0158=_0xb0158-0x0;var _0x478159=_0x332b[_0xb0158];return _0x478159;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb332('0x0')](_0xb332('0x1'),_0xb332('0x2'),_0xb332('0x3'),'keyValue',_0xb332('0x4')),'defaultValue':_0xb332('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb332('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb332('0x1'),_0xb332('0x2'),_0xb332('0x3'))},'keyContent':{'type':Sequelize[_0xb332('0x5')]},'idField':{'type':Sequelize[_0xb332('0x5')]},'nameField':{'type':Sequelize[_0xb332('0x5')]},'customField':{'type':Sequelize[_0xb332('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb332('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 25e9142..25e9a04 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 _0x11c9=['rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','options','FreshsalesField','includeAll','include','findAll'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x11c9,0x155));var _0x911c=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x11c9[_0x4c2dfc];return _0xfd728d;};'use strict';var emlformat=require(_0x911c('0x0'));var rimraf=require(_0x911c('0x1'));var zipdir=require(_0x911c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x911c('0x3'));var BPromise=require(_0x911c('0x4'));var Mustache=require(_0x911c('0x5'));var util=require('util');var path=require('path');var sox=require(_0x911c('0x6'));var csv=require(_0x911c('0x7'));var ejs=require(_0x911c('0x8'));var fs=require('fs');var fs_extra=require(_0x911c('0x9'));var _=require(_0x911c('0xa'));var squel=require('squel');var crypto=require(_0x911c('0xb'));var jsforce=require(_0x911c('0xc'));var deskjs=require(_0x911c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x911c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x911c('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x911c('0x10'));var config=require(_0x911c('0x11'));var licenseUtil=require(_0x911c('0x12'));var db=require(_0x911c('0x13'))['db'];function respondWithStatusCode(_0x20fa51,_0x22aa2c){_0x22aa2c=_0x22aa2c||0xcc;return function(_0x476754){if(_0x476754){return _0x20fa51['sendStatus'](_0x22aa2c);}return _0x20fa51[_0x911c('0x14')](_0x22aa2c)[_0x911c('0x15')]();};}function respondWithResult(_0xf87928,_0x1772a4){_0x1772a4=_0x1772a4||0xc8;return function(_0x4fb3ce){if(_0x4fb3ce){return _0xf87928[_0x911c('0x14')](_0x1772a4)[_0x911c('0x16')](_0x4fb3ce);}};}function respondWithFilteredResult(_0x3c1429,_0x27b780){return function(_0x12b678){if(_0x12b678){var _0x28e04f=typeof _0x27b780[_0x911c('0x17')]===_0x911c('0x18')&&typeof _0x27b780[_0x911c('0x19')]===_0x911c('0x18');var _0x420bdf=_0x12b678['count'];var _0x1a3816=_0x28e04f?0x0:_0x27b780['offset'];var _0x4ea774=_0x28e04f?_0x12b678[_0x911c('0x1a')]:_0x27b780[_0x911c('0x17')]+_0x27b780[_0x911c('0x19')];var _0x217b6a;if(_0x4ea774>=_0x420bdf){_0x4ea774=_0x420bdf;_0x217b6a=0xc8;}else{_0x217b6a=0xce;}_0x3c1429['status'](_0x217b6a);return _0x3c1429[_0x911c('0x1b')]('Content-Range',_0x1a3816+'-'+_0x4ea774+'/'+_0x420bdf)[_0x911c('0x16')](_0x12b678);}return null;};}function patchUpdates(_0x515e8a){return function(_0x10b6fd){try{jsonpatch[_0x911c('0x1c')](_0x10b6fd,_0x515e8a,!![]);}catch(_0x41a7e7){return BPromise[_0x911c('0x1d')](_0x41a7e7);}return _0x10b6fd[_0x911c('0x1e')]();};}function saveUpdates(_0x35507f,_0x3943bf){return function(_0x3f13a6){if(_0x3f13a6){return _0x3f13a6[_0x911c('0x1f')](_0x35507f)[_0x911c('0x20')](function(_0x74785a){return _0x74785a;});}return null;};}function removeEntity(_0x1805ed,_0x5f1f1f){return function(_0x51624b){if(_0x51624b){return _0x51624b[_0x911c('0x21')]()[_0x911c('0x20')](function(){_0x1805ed[_0x911c('0x14')](0xcc)[_0x911c('0x15')]();});}};}function handleEntityNotFound(_0x4e4157,_0x101387){return function(_0x3742b3){if(!_0x3742b3){_0x4e4157[_0x911c('0x22')](0x194);}return _0x3742b3;};}function handleError(_0x45d301,_0x181bf0){_0x181bf0=_0x181bf0||0x1f4;return function(_0x4febef){logger[_0x911c('0x23')](_0x4febef[_0x911c('0x24')]);if(_0x4febef[_0x911c('0x25')]){delete _0x4febef[_0x911c('0x25')];}_0x45d301[_0x911c('0x14')](_0x181bf0)[_0x911c('0x26')](_0x4febef);};}exports['index']=function(_0x3e780c,_0x273922){var _0x3944c1={},_0x4b38d2={},_0x208a29={'count':0x0,'rows':[]};var _0x1d550a=_[_0x911c('0x27')](db['FreshsalesField']['rawAttributes'],function(_0x3f20d6){return{'name':_0x3f20d6[_0x911c('0x28')],'type':_0x3f20d6[_0x911c('0x29')][_0x911c('0x2a')]};});_0x4b38d2[_0x911c('0x2b')]=_['map'](_0x1d550a,_0x911c('0x25'));_0x4b38d2[_0x911c('0x2c')]=_[_0x911c('0x2d')](_0x3e780c[_0x911c('0x2c')]);_0x4b38d2[_0x911c('0x2e')]=_[_0x911c('0x2f')](_0x4b38d2[_0x911c('0x2b')],_0x4b38d2[_0x911c('0x2c')]);_0x3944c1['attributes']=_[_0x911c('0x2f')](_0x4b38d2[_0x911c('0x2b')],qs['fields'](_0x3e780c[_0x911c('0x2c')][_0x911c('0x30')]));_0x3944c1[_0x911c('0x31')]=_0x3944c1[_0x911c('0x31')][_0x911c('0x32')]?_0x3944c1['attributes']:_0x4b38d2['model'];if(!_0x3e780c[_0x911c('0x2c')][_0x911c('0x33')]('nolimit')){_0x3944c1['limit']=qs[_0x911c('0x19')](_0x3e780c[_0x911c('0x2c')][_0x911c('0x19')]);_0x3944c1[_0x911c('0x17')]=qs['offset'](_0x3e780c['query'][_0x911c('0x17')]);}_0x3944c1['order']=qs[_0x911c('0x34')](_0x3e780c[_0x911c('0x2c')][_0x911c('0x34')]);_0x3944c1['where']=qs['filters'](_['pick'](_0x3e780c[_0x911c('0x2c')],_0x4b38d2[_0x911c('0x2e')]),_0x1d550a);if(_0x3e780c[_0x911c('0x2c')][_0x911c('0x35')]){_0x3944c1['where']=_['merge'](_0x3944c1[_0x911c('0x36')],{'$or':_[_0x911c('0x27')](_0x1d550a,function(_0x37c39f){if(_0x37c39f[_0x911c('0x29')]!=='VIRTUAL'){var _0x527596={};_0x527596[_0x37c39f['name']]={'$like':'%'+_0x3e780c['query'][_0x911c('0x35')]+'%'};return _0x527596;}})});}_0x3944c1=_[_0x911c('0x37')]({},_0x3944c1,_0x3e780c[_0x911c('0x38')]);var _0x25ea1e={'where':_0x3944c1[_0x911c('0x36')]};return db[_0x911c('0x39')][_0x911c('0x1a')](_0x25ea1e)['then'](function(_0x1a2e7b){_0x208a29['count']=_0x1a2e7b;if(_0x3e780c['query'][_0x911c('0x3a')]){_0x3944c1[_0x911c('0x3b')]=[{'all':!![]}];}return db['FreshsalesField'][_0x911c('0x3c')](_0x3944c1);})['then'](function(_0xfa560){_0x208a29[_0x911c('0x3d')]=_0xfa560;return _0x208a29;})['then'](respondWithFilteredResult(_0x273922,_0x3944c1))[_0x911c('0x3e')](handleError(_0x273922,null));};exports['show']=function(_0x258914,_0xcf8732){var _0x32740d={'raw':!![],'where':{'id':_0x258914[_0x911c('0x3f')]['id']}},_0x3209ae={};_0x3209ae['model']=_[_0x911c('0x2d')](db['FreshsalesField']['rawAttributes']);_0x3209ae['query']=_[_0x911c('0x2d')](_0x258914[_0x911c('0x2c')]);_0x3209ae[_0x911c('0x2e')]=_[_0x911c('0x2f')](_0x3209ae[_0x911c('0x2b')],_0x3209ae[_0x911c('0x2c')]);_0x32740d[_0x911c('0x31')]=_[_0x911c('0x2f')](_0x3209ae[_0x911c('0x2b')],qs[_0x911c('0x30')](_0x258914[_0x911c('0x2c')][_0x911c('0x30')]));_0x32740d[_0x911c('0x31')]=_0x32740d['attributes']['length']?_0x32740d['attributes']:_0x3209ae[_0x911c('0x2b')];if(_0x258914[_0x911c('0x2c')][_0x911c('0x3a')]){_0x32740d['include']=[{'all':!![]}];}_0x32740d=_[_0x911c('0x37')]({},_0x32740d,_0x258914[_0x911c('0x38')]);return db[_0x911c('0x39')][_0x911c('0x40')](_0x32740d)[_0x911c('0x20')](handleEntityNotFound(_0xcf8732,null))['then'](respondWithResult(_0xcf8732,null))[_0x911c('0x3e')](handleError(_0xcf8732,null));};exports['create']=function(_0x2bd506,_0x55973b){return db[_0x911c('0x39')][_0x911c('0x41')](_0x2bd506['body'],{})[_0x911c('0x20')](respondWithResult(_0x55973b,0xc9))[_0x911c('0x3e')](handleError(_0x55973b,null));};exports['update']=function(_0x1ba9aa,_0x1da9ae){if(_0x1ba9aa['body']['id']){delete _0x1ba9aa[_0x911c('0x42')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x1ba9aa[_0x911c('0x3f')]['id']}})[_0x911c('0x20')](handleEntityNotFound(_0x1da9ae,null))[_0x911c('0x20')](saveUpdates(_0x1ba9aa['body'],null))[_0x911c('0x20')](respondWithResult(_0x1da9ae,null))['catch'](handleError(_0x1da9ae,null));};exports[_0x911c('0x21')]=function(_0x272593,_0x20a469){return db[_0x911c('0x39')][_0x911c('0x40')]({'where':{'id':_0x272593[_0x911c('0x3f')]['id']}})[_0x911c('0x20')](handleEntityNotFound(_0x20a469,null))[_0x911c('0x20')](removeEntity(_0x20a469,null))['catch'](handleError(_0x20a469,null));}; \ No newline at end of file +var _0x214f=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','end','error','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','destroy','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x472a66,_0xcc0bcd){var _0xf99cf1=function(_0x1ab69b){while(--_0x1ab69b){_0x472a66['push'](_0x472a66['shift']());}};_0xf99cf1(++_0xcc0bcd);}(_0x214f,0x89));var _0xf214=function(_0x1180e9,_0x1031a3){_0x1180e9=_0x1180e9-0x0;var _0x501c38=_0x214f[_0x1180e9];return _0x501c38;};'use strict';var emlformat=require(_0xf214('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf214('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf214('0x2'));var util=require(_0xf214('0x3'));var path=require(_0xf214('0x4'));var sox=require(_0xf214('0x5'));var csv=require(_0xf214('0x6'));var ejs=require(_0xf214('0x7'));var fs=require('fs');var fs_extra=require(_0xf214('0x8'));var _=require(_0xf214('0x9'));var squel=require(_0xf214('0xa'));var crypto=require(_0xf214('0xb'));var jsforce=require(_0xf214('0xc'));var deskjs=require(_0xf214('0xd'));var toCsv=require(_0xf214('0x6'));var querystring=require(_0xf214('0xe'));var Papa=require(_0xf214('0xf'));var Redis=require(_0xf214('0x10'));var authService=require(_0xf214('0x11'));var qs=require(_0xf214('0x12'));var as=require(_0xf214('0x13'));var hardwareService=require(_0xf214('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf214('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf214('0x16'))['db'];function respondWithStatusCode(_0x2ff1c7,_0x44e161){_0x44e161=_0x44e161||0xcc;return function(_0x155a7c){if(_0x155a7c){return _0x2ff1c7[_0xf214('0x17')](_0x44e161);}return _0x2ff1c7[_0xf214('0x18')](_0x44e161)['end']();};}function respondWithResult(_0x1fe7c5,_0x3348e0){_0x3348e0=_0x3348e0||0xc8;return function(_0x69ce1a){if(_0x69ce1a){return _0x1fe7c5[_0xf214('0x18')](_0x3348e0)[_0xf214('0x19')](_0x69ce1a);}};}function respondWithFilteredResult(_0x50b8d4,_0x290767){return function(_0x158874){if(_0x158874){var _0x242c9a=typeof _0x290767[_0xf214('0x1a')]===_0xf214('0x1b')&&typeof _0x290767['limit']==='undefined';var _0x4faedb=_0x158874[_0xf214('0x1c')];var _0x39836f=_0x242c9a?0x0:_0x290767[_0xf214('0x1a')];var _0x521f79=_0x242c9a?_0x158874[_0xf214('0x1c')]:_0x290767[_0xf214('0x1a')]+_0x290767['limit'];var _0x1846fc;if(_0x521f79>=_0x4faedb){_0x521f79=_0x4faedb;_0x1846fc=0xc8;}else{_0x1846fc=0xce;}_0x50b8d4[_0xf214('0x18')](_0x1846fc);return _0x50b8d4[_0xf214('0x1d')](_0xf214('0x1e'),_0x39836f+'-'+_0x521f79+'/'+_0x4faedb)['json'](_0x158874);}return null;};}function patchUpdates(_0x169735){return function(_0x4ddbd3){try{jsonpatch[_0xf214('0x1f')](_0x4ddbd3,_0x169735,!![]);}catch(_0x4ef564){return BPromise['reject'](_0x4ef564);}return _0x4ddbd3['save']();};}function saveUpdates(_0x4abb72,_0x4a2ed6){return function(_0x413f0b){if(_0x413f0b){return _0x413f0b[_0xf214('0x20')](_0x4abb72)[_0xf214('0x21')](function(_0x49eb0a){return _0x49eb0a;});}return null;};}function removeEntity(_0x158f90,_0x30615c){return function(_0x441808){if(_0x441808){return _0x441808['destroy']()[_0xf214('0x21')](function(){_0x158f90['status'](0xcc)[_0xf214('0x22')]();});}};}function handleEntityNotFound(_0xa8a328,_0x3bcb0d){return function(_0x43b208){if(!_0x43b208){_0xa8a328['sendStatus'](0x194);}return _0x43b208;};}function handleError(_0x45b987,_0x4b43d1){_0x4b43d1=_0x4b43d1||0x1f4;return function(_0x978a5f){logger[_0xf214('0x23')](_0x978a5f[_0xf214('0x24')]);if(_0x978a5f[_0xf214('0x25')]){delete _0x978a5f[_0xf214('0x25')];}_0x45b987[_0xf214('0x18')](_0x4b43d1)[_0xf214('0x26')](_0x978a5f);};}exports[_0xf214('0x27')]=function(_0x1309de,_0x58d88e){var _0x534b41={},_0x2fb577={},_0xc2dc10={'count':0x0,'rows':[]};var _0x2fcec2=_['map'](db[_0xf214('0x28')][_0xf214('0x29')],function(_0x47c29e){return{'name':_0x47c29e[_0xf214('0x2a')],'type':_0x47c29e[_0xf214('0x2b')][_0xf214('0x2c')]};});_0x2fb577[_0xf214('0x2d')]=_[_0xf214('0x2e')](_0x2fcec2,_0xf214('0x25'));_0x2fb577[_0xf214('0x2f')]=_[_0xf214('0x30')](_0x1309de[_0xf214('0x2f')]);_0x2fb577[_0xf214('0x31')]=_['intersection'](_0x2fb577[_0xf214('0x2d')],_0x2fb577[_0xf214('0x2f')]);_0x534b41[_0xf214('0x32')]=_[_0xf214('0x33')](_0x2fb577[_0xf214('0x2d')],qs[_0xf214('0x34')](_0x1309de[_0xf214('0x2f')]['fields']));_0x534b41['attributes']=_0x534b41[_0xf214('0x32')][_0xf214('0x35')]?_0x534b41[_0xf214('0x32')]:_0x2fb577[_0xf214('0x2d')];if(!_0x1309de[_0xf214('0x2f')][_0xf214('0x36')](_0xf214('0x37'))){_0x534b41[_0xf214('0x38')]=qs['limit'](_0x1309de['query'][_0xf214('0x38')]);_0x534b41[_0xf214('0x1a')]=qs[_0xf214('0x1a')](_0x1309de[_0xf214('0x2f')]['offset']);}_0x534b41['order']=qs['sort'](_0x1309de[_0xf214('0x2f')][_0xf214('0x39')]);_0x534b41[_0xf214('0x3a')]=qs[_0xf214('0x31')](_[_0xf214('0x3b')](_0x1309de['query'],_0x2fb577[_0xf214('0x31')]),_0x2fcec2);if(_0x1309de[_0xf214('0x2f')]['filter']){_0x534b41[_0xf214('0x3a')]=_['merge'](_0x534b41[_0xf214('0x3a')],{'$or':_['map'](_0x2fcec2,function(_0x11049b){if(_0x11049b[_0xf214('0x2b')]!==_0xf214('0x3c')){var _0x289faa={};_0x289faa[_0x11049b[_0xf214('0x25')]]={'$like':'%'+_0x1309de[_0xf214('0x2f')][_0xf214('0x3d')]+'%'};return _0x289faa;}})});}_0x534b41=_[_0xf214('0x3e')]({},_0x534b41,_0x1309de['options']);var _0x33d481={'where':_0x534b41[_0xf214('0x3a')]};return db[_0xf214('0x28')][_0xf214('0x1c')](_0x33d481)[_0xf214('0x21')](function(_0x2a1022){_0xc2dc10[_0xf214('0x1c')]=_0x2a1022;if(_0x1309de[_0xf214('0x2f')][_0xf214('0x3f')]){_0x534b41[_0xf214('0x40')]=[{'all':!![]}];}return db[_0xf214('0x28')][_0xf214('0x41')](_0x534b41);})['then'](function(_0x1ac201){_0xc2dc10[_0xf214('0x42')]=_0x1ac201;return _0xc2dc10;})[_0xf214('0x21')](respondWithFilteredResult(_0x58d88e,_0x534b41))[_0xf214('0x43')](handleError(_0x58d88e,null));};exports[_0xf214('0x44')]=function(_0x3078b2,_0x1555c0){var _0x4d5f3b={'raw':!![],'where':{'id':_0x3078b2['params']['id']}},_0x3ad06e={};_0x3ad06e[_0xf214('0x2d')]=_[_0xf214('0x30')](db[_0xf214('0x28')]['rawAttributes']);_0x3ad06e[_0xf214('0x2f')]=_[_0xf214('0x30')](_0x3078b2[_0xf214('0x2f')]);_0x3ad06e[_0xf214('0x31')]=_[_0xf214('0x33')](_0x3ad06e[_0xf214('0x2d')],_0x3ad06e[_0xf214('0x2f')]);_0x4d5f3b[_0xf214('0x32')]=_[_0xf214('0x33')](_0x3ad06e[_0xf214('0x2d')],qs['fields'](_0x3078b2[_0xf214('0x2f')][_0xf214('0x34')]));_0x4d5f3b[_0xf214('0x32')]=_0x4d5f3b[_0xf214('0x32')][_0xf214('0x35')]?_0x4d5f3b[_0xf214('0x32')]:_0x3ad06e['model'];if(_0x3078b2[_0xf214('0x2f')]['includeAll']){_0x4d5f3b[_0xf214('0x40')]=[{'all':!![]}];}_0x4d5f3b=_[_0xf214('0x3e')]({},_0x4d5f3b,_0x3078b2[_0xf214('0x45')]);return db['FreshsalesField'][_0xf214('0x46')](_0x4d5f3b)[_0xf214('0x21')](handleEntityNotFound(_0x1555c0,null))[_0xf214('0x21')](respondWithResult(_0x1555c0,null))[_0xf214('0x43')](handleError(_0x1555c0,null));};exports[_0xf214('0x47')]=function(_0x5566eb,_0x149d46){return db[_0xf214('0x28')][_0xf214('0x47')](_0x5566eb[_0xf214('0x48')],{})[_0xf214('0x21')](respondWithResult(_0x149d46,0xc9))[_0xf214('0x43')](handleError(_0x149d46,null));};exports[_0xf214('0x20')]=function(_0x52f7b6,_0x2f868b){if(_0x52f7b6['body']['id']){delete _0x52f7b6[_0xf214('0x48')]['id'];}return db[_0xf214('0x28')]['find']({'where':{'id':_0x52f7b6['params']['id']}})['then'](handleEntityNotFound(_0x2f868b,null))['then'](saveUpdates(_0x52f7b6[_0xf214('0x48')],null))[_0xf214('0x21')](respondWithResult(_0x2f868b,null))['catch'](handleError(_0x2f868b,null));};exports[_0xf214('0x49')]=function(_0x3e543b,_0xe688d0){return db[_0xf214('0x28')][_0xf214('0x46')]({'where':{'id':_0x3e543b['params']['id']}})[_0xf214('0x21')](handleEntityNotFound(_0xe688d0,null))[_0xf214('0x21')](removeEntity(_0xe688d0,null))[_0xf214('0x43')](handleError(_0xe688d0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6b51575..8516a5f 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 _0x1131=['freshsales_unique_index','idField','FieldId','util','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define'];(function(_0x4b25e3,_0x33a600){var _0x1596c6=function(_0x3a2209){while(--_0x3a2209){_0x4b25e3['push'](_0x4b25e3['shift']());}};_0x1596c6(++_0x33a600);}(_0x1131,0x71));var _0x1113=function(_0x1e7d8f,_0x3418a8){_0x1e7d8f=_0x1e7d8f-0x0;var _0x4ccbdd=_0x1131[_0x1e7d8f];return _0x4ccbdd;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1113('0x1'));var rp=require(_0x1113('0x2'));var fs=require('fs');var path=require(_0x1113('0x3'));var rimraf=require(_0x1113('0x4'));var config=require(_0x1113('0x5'));var attributes=require(_0x1113('0x6'));module['exports']=function(_0x3880aa,_0x4e6389){return _0x3880aa[_0x1113('0x7')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x1113('0x8'),'fields':[_0x1113('0x9'),_0x1113('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1d3=['define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports'];(function(_0x3cb78f,_0x25d80d){var _0x13cf73=function(_0x241803){while(--_0x241803){_0x3cb78f['push'](_0x3cb78f['shift']());}};_0x13cf73(++_0x25d80d);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x4916f3,_0x5a5004){_0x4916f3=_0x4916f3-0x0;var _0x3241a6=_0xd1d3[_0x4916f3];return _0x3241a6;};'use strict';var _=require(_0x3d1d('0x0'));var util=require('util');var logger=require(_0x3d1d('0x1'))('api');var moment=require(_0x3d1d('0x2'));var BPromise=require(_0x3d1d('0x3'));var rp=require(_0x3d1d('0x4'));var fs=require('fs');var path=require(_0x3d1d('0x5'));var rimraf=require(_0x3d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d1d('0x7'));module[_0x3d1d('0x8')]=function(_0x55c165,_0x2d3a52){return _0x55c165[_0x3d1d('0x9')]('FreshsalesField',attributes,{'tableName':_0x3d1d('0xa'),'paranoid':![],'indexes':[{'name':_0x3d1d('0xb'),'fields':[_0x3d1d('0xc'),_0x3d1d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index caa0a14..d400dc0 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 _0x2542=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3c5993,_0x22c6d7){var _0x53146f=function(_0x37fd30){while(--_0x37fd30){_0x3c5993['push'](_0x3c5993['shift']());}};_0x53146f(++_0x22c6d7);}(_0x2542,0x169));var _0x2254=function(_0x5cb185,_0x777b62){_0x5cb185=_0x5cb185-0x0;var _0x2a1d86=_0x2542[_0x5cb185];return _0x2a1d86;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd5a3,_0x202f38){var _0x6e217b=function(_0x3bbee0){while(--_0x3bbee0){_0x3dd5a3['push'](_0x3dd5a3['shift']());}};_0x6e217b(++_0x202f38);}(_0xafc4,0x69));var _0x4afc=function(_0x4dba98,_0x24dc49){_0x4dba98=_0x4dba98-0x0;var _0x48c9d3=_0xafc4[_0x4dba98];return _0x48c9d3;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e4a5d3d..7d83730 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(_0x52db51,_0x44d667){var _0x599cc0=function(_0x4d2fdc){while(--_0x4d2fdc){_0x52db51['push'](_0x52db51['shift']());}};_0x599cc0(++_0x44d667);}(_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/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(_0x59d682,_0xbc3730){var _0x3d6e77=function(_0x530e36){while(--_0x530e36){_0x59d682['push'](_0x59d682['shift']());}};_0x3d6e77(++_0xbc3730);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ed60fb7..359799c 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 _0x4a41=['integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x46b832,_0x454e18){var _0x42b328=function(_0x204e99){while(--_0x204e99){_0x46b832['push'](_0x46b832['shift']());}};_0x42b328(++_0x454e18);}(_0x4a41,0x1b8));var _0x14a4=function(_0x652c36,_0xbd54a1){_0x652c36=_0x652c36-0x0;var _0x30c32f=_0x4a41[_0x652c36];return _0x30c32f;};'use strict';var Sequelize=require(_0x14a4('0x0'));module[_0x14a4('0x1')]={'name':{'type':Sequelize[_0x14a4('0x2')]},'description':{'type':Sequelize[_0x14a4('0x2')]},'username':{'type':Sequelize[_0x14a4('0x2')],'unique':_0x14a4('0x3')},'remoteUri':{'type':Sequelize[_0x14a4('0x2')]},'password':{'type':Sequelize[_0x14a4('0x2')]},'clientId':{'type':Sequelize[_0x14a4('0x2')]},'clientSecret':{'type':Sequelize[_0x14a4('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x14a4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x14a4('0x4'),_0x14a4('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x6d11=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x416b07,_0x5563a6){var _0x5c892f=function(_0x410057){while(--_0x410057){_0x416b07['push'](_0x416b07['shift']());}};_0x5c892f(++_0x5563a6);}(_0x6d11,0xbf));var _0x16d1=function(_0x501114,_0x12e07b){_0x501114=_0x501114-0x0;var _0x1dcd26=_0x6d11[_0x501114];return _0x1dcd26;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x16d1('0x2')]},'password':{'type':Sequelize[_0x16d1('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x16d1('0x2')]},'serverUrl':{'type':Sequelize[_0x16d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x4'),_0x16d1('0x5')),'defaultValue':_0x16d1('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e633d36..643e9e5 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 _0x4375=['Connection','login','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','textarea','phone','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','SalesforceAccount','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','SalesforceConfiguration','sort','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','findOne','clientId','clientSecret','username','password','remoteUri','lastIndexOf'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x4375,0x198));var _0x5437=function(_0xd90f97,_0x50a58d){_0xd90f97=_0xd90f97-0x0;var _0x55bdb1=_0x4375[_0xd90f97];return _0x55bdb1;};'use strict';var emlformat=require(_0x5437('0x0'));var rimraf=require(_0x5437('0x1'));var zipdir=require(_0x5437('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5437('0x3'));var moment=require(_0x5437('0x4'));var BPromise=require(_0x5437('0x5'));var Mustache=require('mustache');var util=require(_0x5437('0x6'));var path=require(_0x5437('0x7'));var sox=require(_0x5437('0x8'));var csv=require(_0x5437('0x9'));var ejs=require(_0x5437('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5437('0xb'));var squel=require(_0x5437('0xc'));var crypto=require(_0x5437('0xd'));var jsforce=require(_0x5437('0xe'));var deskjs=require(_0x5437('0xf'));var toCsv=require(_0x5437('0x9'));var querystring=require(_0x5437('0x10'));var Papa=require(_0x5437('0x11'));var Redis=require(_0x5437('0x12'));var authService=require(_0x5437('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5437('0x14'));var hardwareService=require(_0x5437('0x15'));var logger=require(_0x5437('0x16'))(_0x5437('0x17'));var utils=require(_0x5437('0x18'));var config=require(_0x5437('0x19'));var licenseUtil=require(_0x5437('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5437('0x1b'));function respondWithStatusCode(_0x10d8cb,_0x51183d){_0x51183d=_0x51183d||0xcc;return function(_0x8d2244){if(_0x8d2244){return _0x10d8cb['sendStatus'](_0x51183d);}return _0x10d8cb[_0x5437('0x1c')](_0x51183d)[_0x5437('0x1d')]();};}function respondWithResult(_0x1af07b,_0x2820b8){_0x2820b8=_0x2820b8||0xc8;return function(_0x1a1b78){if(_0x1a1b78){return _0x1af07b[_0x5437('0x1c')](_0x2820b8)[_0x5437('0x1e')](_0x1a1b78);}};}function respondWithFilteredResult(_0x1abbbc,_0x23b0b0){return function(_0x5aa9a1){if(_0x5aa9a1){var _0x34872a=typeof _0x23b0b0[_0x5437('0x1f')]===_0x5437('0x20')&&typeof _0x23b0b0[_0x5437('0x21')]===_0x5437('0x20');var _0xb9ce25=_0x5aa9a1[_0x5437('0x22')];var _0x458d91=_0x34872a?0x0:_0x23b0b0[_0x5437('0x1f')];var _0x478128=_0x34872a?_0x5aa9a1['count']:_0x23b0b0[_0x5437('0x1f')]+_0x23b0b0[_0x5437('0x21')];var _0x2fd2c7;if(_0x478128>=_0xb9ce25){_0x478128=_0xb9ce25;_0x2fd2c7=0xc8;}else{_0x2fd2c7=0xce;}_0x1abbbc[_0x5437('0x1c')](_0x2fd2c7);return _0x1abbbc[_0x5437('0x23')]('Content-Range',_0x458d91+'-'+_0x478128+'/'+_0xb9ce25)['json'](_0x5aa9a1);}return null;};}function patchUpdates(_0x51be84){return function(_0x25bf15){try{jsonpatch['apply'](_0x25bf15,_0x51be84,!![]);}catch(_0x3c6dc4){return BPromise[_0x5437('0x24')](_0x3c6dc4);}return _0x25bf15[_0x5437('0x25')]();};}function saveUpdates(_0x5ad641,_0x25f619){return function(_0x5274ec){if(_0x5274ec){return _0x5274ec[_0x5437('0x26')](_0x5ad641)[_0x5437('0x27')](function(_0x4d5698){return _0x4d5698;});}return null;};}function removeEntity(_0x19460a,_0x2cd84c){return function(_0x4f4c76){if(_0x4f4c76){return _0x4f4c76[_0x5437('0x28')]()['then'](function(){_0x19460a[_0x5437('0x1c')](0xcc)[_0x5437('0x1d')]();});}};}function handleEntityNotFound(_0x3de7d7,_0x4c62ce){return function(_0x177546){if(!_0x177546){_0x3de7d7['sendStatus'](0x194);}return _0x177546;};}function handleError(_0x4b2416,_0x18b47e){_0x18b47e=_0x18b47e||0x1f4;return function(_0x1cfb5d){logger[_0x5437('0x29')](_0x1cfb5d['stack']);if(_0x1cfb5d[_0x5437('0x2a')]){delete _0x1cfb5d[_0x5437('0x2a')];}_0x4b2416[_0x5437('0x1c')](_0x18b47e)[_0x5437('0x2b')](_0x1cfb5d);};}exports[_0x5437('0x2c')]=function(_0x4c56ae,_0x1bdaa7){var _0x1a52fc={},_0x1bf0c6={},_0x263963={'count':0x0,'rows':[]};var _0x3928dc=_[_0x5437('0x2d')](db['SalesforceAccount'][_0x5437('0x2e')],function(_0x1eabb3){return{'name':_0x1eabb3['fieldName'],'type':_0x1eabb3[_0x5437('0x2f')][_0x5437('0x30')]};});_0x1bf0c6[_0x5437('0x31')]=_[_0x5437('0x2d')](_0x3928dc,_0x5437('0x2a'));_0x1bf0c6[_0x5437('0x32')]=_[_0x5437('0x33')](_0x4c56ae[_0x5437('0x32')]);_0x1bf0c6[_0x5437('0x34')]=_['intersection'](_0x1bf0c6[_0x5437('0x31')],_0x1bf0c6[_0x5437('0x32')]);_0x1a52fc['attributes']=_[_0x5437('0x35')](_0x1bf0c6[_0x5437('0x31')],qs[_0x5437('0x36')](_0x4c56ae[_0x5437('0x32')][_0x5437('0x36')]));_0x1a52fc[_0x5437('0x37')]=_0x1a52fc['attributes'][_0x5437('0x38')]?_0x1a52fc['attributes']:_0x1bf0c6[_0x5437('0x31')];if(!_0x4c56ae[_0x5437('0x32')][_0x5437('0x39')](_0x5437('0x3a'))){_0x1a52fc[_0x5437('0x21')]=qs[_0x5437('0x21')](_0x4c56ae['query'][_0x5437('0x21')]);_0x1a52fc[_0x5437('0x1f')]=qs['offset'](_0x4c56ae[_0x5437('0x32')][_0x5437('0x1f')]);}_0x1a52fc[_0x5437('0x3b')]=qs['sort'](_0x4c56ae['query']['sort']);_0x1a52fc['where']=qs['filters'](_['pick'](_0x4c56ae[_0x5437('0x32')],_0x1bf0c6[_0x5437('0x34')]),_0x3928dc);if(_0x4c56ae[_0x5437('0x32')]['filter']){_0x1a52fc[_0x5437('0x3c')]=_[_0x5437('0x3d')](_0x1a52fc[_0x5437('0x3c')],{'$or':_[_0x5437('0x2d')](_0x3928dc,function(_0x39fa29){if(_0x39fa29['type']!==_0x5437('0x3e')){var _0x2223be={};_0x2223be[_0x39fa29[_0x5437('0x2a')]]={'$like':'%'+_0x4c56ae[_0x5437('0x32')][_0x5437('0x3f')]+'%'};return _0x2223be;}})});}_0x1a52fc=_['merge']({},_0x1a52fc,_0x4c56ae[_0x5437('0x40')]);var _0x510dc1={'where':_0x1a52fc[_0x5437('0x3c')]};return db[_0x5437('0x41')][_0x5437('0x22')](_0x510dc1)[_0x5437('0x27')](function(_0x4a3a13){_0x263963[_0x5437('0x22')]=_0x4a3a13;if(_0x4c56ae[_0x5437('0x32')][_0x5437('0x42')]){_0x1a52fc[_0x5437('0x43')]=[{'all':!![]}];}return db[_0x5437('0x41')][_0x5437('0x44')](_0x1a52fc);})[_0x5437('0x27')](function(_0x51aa77){_0x263963[_0x5437('0x45')]=_0x51aa77;return _0x263963;})[_0x5437('0x27')](respondWithFilteredResult(_0x1bdaa7,_0x1a52fc))[_0x5437('0x46')](handleError(_0x1bdaa7,null));};exports[_0x5437('0x47')]=function(_0x39d3b3,_0x89964c){var _0xe6e4ba={'raw':![],'where':{'id':_0x39d3b3['params']['id']}},_0x15b38b={};_0x15b38b[_0x5437('0x31')]=_[_0x5437('0x33')](db['SalesforceAccount'][_0x5437('0x2e')]);_0x15b38b[_0x5437('0x32')]=_['keys'](_0x39d3b3[_0x5437('0x32')]);_0x15b38b[_0x5437('0x34')]=_[_0x5437('0x35')](_0x15b38b[_0x5437('0x31')],_0x15b38b[_0x5437('0x32')]);_0xe6e4ba[_0x5437('0x37')]=_[_0x5437('0x35')](_0x15b38b['model'],qs[_0x5437('0x36')](_0x39d3b3[_0x5437('0x32')][_0x5437('0x36')]));_0xe6e4ba[_0x5437('0x37')]=_0xe6e4ba[_0x5437('0x37')][_0x5437('0x38')]?_0xe6e4ba[_0x5437('0x37')]:_0x15b38b[_0x5437('0x31')];if(_0x39d3b3[_0x5437('0x32')]['includeAll']){_0xe6e4ba[_0x5437('0x43')]=[{'all':!![]}];}_0xe6e4ba=_['merge']({},_0xe6e4ba,_0x39d3b3[_0x5437('0x40')]);return db[_0x5437('0x41')][_0x5437('0x48')](_0xe6e4ba)[_0x5437('0x27')](handleEntityNotFound(_0x89964c,null))[_0x5437('0x27')](respondWithResult(_0x89964c,null))[_0x5437('0x46')](handleError(_0x89964c,null));};exports[_0x5437('0x49')]=function(_0x2a8b06,_0x37dbe2){return db[_0x5437('0x41')][_0x5437('0x49')](_0x2a8b06[_0x5437('0x4a')],{})[_0x5437('0x27')](respondWithResult(_0x37dbe2,0xc9))['catch'](handleError(_0x37dbe2,null));};exports[_0x5437('0x26')]=function(_0xd99344,_0x26c672){if(_0xd99344[_0x5437('0x4a')]['id']){delete _0xd99344[_0x5437('0x4a')]['id'];}return db['SalesforceAccount'][_0x5437('0x48')]({'where':{'id':_0xd99344[_0x5437('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26c672,null))['then'](saveUpdates(_0xd99344[_0x5437('0x4a')],null))[_0x5437('0x27')](respondWithResult(_0x26c672,null))[_0x5437('0x46')](handleError(_0x26c672,null));};exports[_0x5437('0x28')]=function(_0xe14260,_0x14e591){return db['SalesforceAccount'][_0x5437('0x48')]({'where':{'id':_0xe14260['params']['id']}})[_0x5437('0x27')](handleEntityNotFound(_0x14e591,null))[_0x5437('0x27')](removeEntity(_0x14e591,null))[_0x5437('0x46')](handleError(_0x14e591,null));};exports[_0x5437('0x4c')]=function(_0x46a996,_0x342ae0,_0x3ce130){var _0x7a40dd={};var _0x43185c={};var _0x434acf;var _0x4f0d03;return db[_0x5437('0x41')]['findOne']({'where':{'id':_0x46a996['params']['id']}})[_0x5437('0x27')](handleEntityNotFound(_0x342ae0,null))[_0x5437('0x27')](function(_0x5b7c30){if(_0x5b7c30){_0x434acf=_0x5b7c30;_0x43185c[_0x5437('0x31')]=_[_0x5437('0x33')](db[_0x5437('0x4d')]['rawAttributes']);_0x43185c[_0x5437('0x32')]=_['keys'](_0x46a996['query']);_0x43185c[_0x5437('0x34')]=_[_0x5437('0x35')](_0x43185c[_0x5437('0x31')],_0x43185c['query']);_0x7a40dd['attributes']=_[_0x5437('0x35')](_0x43185c[_0x5437('0x31')],qs['fields'](_0x46a996['query'][_0x5437('0x36')]));_0x7a40dd[_0x5437('0x37')]=_0x7a40dd[_0x5437('0x37')][_0x5437('0x38')]?_0x7a40dd[_0x5437('0x37')]:_0x43185c[_0x5437('0x31')];_0x7a40dd['order']=qs[_0x5437('0x4e')](_0x46a996[_0x5437('0x32')]['sort']);_0x7a40dd[_0x5437('0x3c')]=qs[_0x5437('0x34')](_['pick'](_0x46a996['query'],_0x43185c[_0x5437('0x34')]));if(_0x46a996[_0x5437('0x32')][_0x5437('0x3f')]){_0x7a40dd[_0x5437('0x3c')]=_['merge'](_0x7a40dd[_0x5437('0x3c')],{'$or':_[_0x5437('0x2d')](_0x7a40dd[_0x5437('0x37')],function(_0x47a858){var _0x35af0e={};_0x35af0e[_0x47a858]={'$like':'%'+_0x46a996[_0x5437('0x32')][_0x5437('0x3f')]+'%'};return _0x35af0e;})});}_0x7a40dd=_[_0x5437('0x3d')]({},_0x7a40dd,_0x46a996['options']);return _0x434acf['getConfigurations'](_0x7a40dd);}})[_0x5437('0x27')](function(_0x2b4925){if(_0x2b4925){_0x4f0d03=_0x2b4925[_0x5437('0x38')];if(!_0x46a996['query'][_0x5437('0x39')](_0x5437('0x3a'))){_0x7a40dd[_0x5437('0x21')]=qs[_0x5437('0x21')](_0x46a996['query'][_0x5437('0x21')]);_0x7a40dd['offset']=qs[_0x5437('0x1f')](_0x46a996[_0x5437('0x32')][_0x5437('0x1f')]);}return _0x434acf['getConfigurations'](_0x7a40dd);}})[_0x5437('0x27')](function(_0x41d8eb){if(_0x41d8eb){return _0x41d8eb?{'count':_0x4f0d03,'rows':_0x41d8eb}:null;}})[_0x5437('0x27')](respondWithResult(_0x342ae0,null))[_0x5437('0x46')](handleError(_0x342ae0,null));};exports['addConfiguration']=function(_0x75817,_0x3e08e1,_0x465a0){if(_0x75817['body']['id']){delete _0x75817[_0x5437('0x4a')]['id'];}return db[_0x5437('0x41')]['findOne']({'where':{'id':_0x75817['params']['id']}})[_0x5437('0x27')](handleEntityNotFound(_0x3e08e1,null))[_0x5437('0x27')](function(_0x4cd6bd){if(_0x4cd6bd){_0x75817[_0x5437('0x4a')][_0x5437('0x4f')]=_0x4cd6bd['id'];_0x75817[_0x5437('0x4a')][_0x5437('0x50')]=integrations[_0x5437('0x51')](_0x75817[_0x5437('0x4a')][_0x5437('0x52')],_0x75817[_0x5437('0x4a')][_0x5437('0x2f')]);_0x75817[_0x5437('0x4a')][_0x5437('0x53')]=integrations['getDescriptions'](_0x75817['body'][_0x5437('0x52')],_0x75817['body'][_0x5437('0x2f')]);return db[_0x5437('0x4d')][_0x5437('0x49')](_0x75817[_0x5437('0x4a')],{'include':[{'model':db[_0x5437('0x54')],'as':_0x5437('0x50')},{'model':db[_0x5437('0x54')],'as':_0x5437('0x53')}]});}return null;})[_0x5437('0x27')](respondWithResult(_0x3e08e1,null))[_0x5437('0x46')](handleError(_0x3e08e1,null));};exports['getFields']=function(_0x9bb40c,_0xd5b893,_0x3cd482){var _0x598734;var _0x2432c5='';var _0x382cd1='Task';return db['SalesforceAccount'][_0x5437('0x55')]({'where':{'id':_0x9bb40c[_0x5437('0x4b')]['id']},'attributes':['id','remoteUri',_0x5437('0x56'),_0x5437('0x57'),_0x5437('0x58'),_0x5437('0x59'),'securityToken']})['then'](handleEntityNotFound(_0xd5b893,null))[_0x5437('0x27')](function(_0x470adb){if(_0x470adb){_0x2432c5=_0x470adb[_0x5437('0x5a')];var _0x226291=_0x2432c5['slice'](-0x1);if(_0x226291==='/'){_0x2432c5=_0x2432c5['substring'](0x0,_0x2432c5[_0x5437('0x5b')](_0x226291));}_0x598734=new jsforce[(_0x5437('0x5c'))]({'oauth2':{'loginUrl':_0x2432c5,'clientId':_0x470adb[_0x5437('0x56')],'clientSecret':_0x470adb[_0x5437('0x57')]}});return _0x598734[_0x5437('0x5d')](_0x470adb[_0x5437('0x58')],_0x470adb[_0x5437('0x59')][_0x5437('0x5e')](_0x470adb[_0x5437('0x5f')]));}})[_0x5437('0x27')](function(_0x2371eb){if(_0x2371eb){if(!_[_0x5437('0x60')](_0x9bb40c[_0x5437('0x32')][_0x5437('0x61')])){_0x382cd1=_0x9bb40c[_0x5437('0x32')][_0x5437('0x61')];}return _0x598734[_0x5437('0x62')](_0x382cd1)[_0x5437('0x63')]();}})[_0x5437('0x27')](function(_0x176c6b){var _0x287bd7=[_0x5437('0x64'),_0x5437('0x65'),_0x5437('0x66'),_0x5437('0x67'),_0x5437('0x68'),_0x5437('0x69')];var _0x5a1396=['string',_0x5437('0x6a'),_0x5437('0x6b'),'boolean','email',_0x5437('0x6c'),_0x5437('0x6d')];if(_0x176c6b){_['remove'](_0x176c6b[_0x5437('0x36')],function(_0x510e79){return _0x287bd7[_0x5437('0x6e')](_0x510e79[_0x5437('0x2a')])||!_0x5a1396[_0x5437('0x6e')](_0x510e79[_0x5437('0x2f')]);});return{'count':_0x176c6b[_0x5437('0x36')][_0x5437('0x38')],'rows':_['map'](_0x176c6b[_0x5437('0x36')],function(_0x1b7ad2){return{'id':_0x1b7ad2[_0x5437('0x2a')],'name':_0x1b7ad2[_0x5437('0x6f')],'custom':_0x1b7ad2[_0x5437('0x70')],'options':_0x1b7ad2[_0x5437('0x71')][_0x5437('0x38')]>0x0?_[_0x5437('0x2d')](_0x1b7ad2['picklistValues'],function(_0x4bd8ca){return{'name':_0x4bd8ca['label'],'value':_0x4bd8ca[_0x5437('0x72')]};}):_0x1b7ad2['type']==_0x5437('0x73')?[{'name':_0x5437('0x74'),'value':_0x5437('0x75')},{'name':_0x5437('0x76'),'value':_0x5437('0x77')}]:[]};})};}})[_0x5437('0x27')](respondWithResult(_0xd5b893,null))['catch'](function(_0x50f84f){var _0x3f5943=_0x9bb40c[_0x5437('0x32')][_0x5437('0x78')]?0x1f4:_0x50f84f['statusCode']||0x1f4;logger[_0x5437('0x29')](_0x5437('0x79'),'getFields',_0x3f5943,JSON[_0x5437('0x7a')](_0x50f84f));delete _0x50f84f[_0x5437('0x2a')];if(_0x3f5943===0x191){_0x3f5943=0x190;}_0xd5b893[_0x5437('0x1c')](_0x3f5943)[_0x5437('0x2b')](_0x9bb40c['query'][_0x5437('0x78')]?{'message':_0x5437('0x7b'),'statusCode':_0x50f84f[_0x5437('0x7c')]}:_0x50f84f);});}; \ No newline at end of file +var _0xf5fd=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','findOne','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Subjects','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x515a94,_0x87b1e5){var _0x22751f=function(_0x5edb1c){while(--_0x5edb1c){_0x515a94['push'](_0x515a94['shift']());}};_0x22751f(++_0x87b1e5);}(_0xf5fd,0x76));var _0xdf5f=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf5fd[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf5f('0x0'));var zipdir=require(_0xdf5f('0x1'));var jsonpatch=require(_0xdf5f('0x2'));var rp=require(_0xdf5f('0x3'));var moment=require(_0xdf5f('0x4'));var BPromise=require(_0xdf5f('0x5'));var Mustache=require(_0xdf5f('0x6'));var util=require('util');var path=require(_0xdf5f('0x7'));var sox=require(_0xdf5f('0x8'));var csv=require(_0xdf5f('0x9'));var ejs=require(_0xdf5f('0xa'));var fs=require('fs');var fs_extra=require(_0xdf5f('0xb'));var _=require('lodash');var squel=require(_0xdf5f('0xc'));var crypto=require(_0xdf5f('0xd'));var jsforce=require(_0xdf5f('0xe'));var deskjs=require(_0xdf5f('0xf'));var toCsv=require(_0xdf5f('0x9'));var querystring=require(_0xdf5f('0x10'));var Papa=require(_0xdf5f('0x11'));var Redis=require(_0xdf5f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdf5f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf5f('0x14'));var logger=require(_0xdf5f('0x15'))(_0xdf5f('0x16'));var utils=require(_0xdf5f('0x17'));var config=require(_0xdf5f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf5f('0x19'))['db'];var integrations=require(_0xdf5f('0x1a'));function respondWithStatusCode(_0x4955f8,_0x4ba235){_0x4ba235=_0x4ba235||0xcc;return function(_0x500a0f){if(_0x500a0f){return _0x4955f8['sendStatus'](_0x4ba235);}return _0x4955f8['status'](_0x4ba235)[_0xdf5f('0x1b')]();};}function respondWithResult(_0x5a5762,_0x23bc2b){_0x23bc2b=_0x23bc2b||0xc8;return function(_0x548f9a){if(_0x548f9a){return _0x5a5762[_0xdf5f('0x1c')](_0x23bc2b)['json'](_0x548f9a);}};}function respondWithFilteredResult(_0x313d97,_0xd8c4df){return function(_0xcd1449){if(_0xcd1449){var _0x58f2f9=typeof _0xd8c4df[_0xdf5f('0x1d')]==='undefined'&&typeof _0xd8c4df['limit']===_0xdf5f('0x1e');var _0x5bd443=_0xcd1449[_0xdf5f('0x1f')];var _0x70bdbf=_0x58f2f9?0x0:_0xd8c4df['offset'];var _0x1ce865=_0x58f2f9?_0xcd1449[_0xdf5f('0x1f')]:_0xd8c4df[_0xdf5f('0x1d')]+_0xd8c4df[_0xdf5f('0x20')];var _0x478981;if(_0x1ce865>=_0x5bd443){_0x1ce865=_0x5bd443;_0x478981=0xc8;}else{_0x478981=0xce;}_0x313d97['status'](_0x478981);return _0x313d97[_0xdf5f('0x21')](_0xdf5f('0x22'),_0x70bdbf+'-'+_0x1ce865+'/'+_0x5bd443)[_0xdf5f('0x23')](_0xcd1449);}return null;};}function patchUpdates(_0x2e7a5c){return function(_0x3d476d){try{jsonpatch['apply'](_0x3d476d,_0x2e7a5c,!![]);}catch(_0x22f4dc){return BPromise[_0xdf5f('0x24')](_0x22f4dc);}return _0x3d476d[_0xdf5f('0x25')]();};}function saveUpdates(_0x958ae3,_0x4f74d1){return function(_0x11d543){if(_0x11d543){return _0x11d543[_0xdf5f('0x26')](_0x958ae3)['then'](function(_0x5ad95e){return _0x5ad95e;});}return null;};}function removeEntity(_0xe4ddc1,_0x136433){return function(_0x2fb467){if(_0x2fb467){return _0x2fb467[_0xdf5f('0x27')]()[_0xdf5f('0x28')](function(){_0xe4ddc1[_0xdf5f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b449d,_0x1a8d7b){return function(_0x4025ec){if(!_0x4025ec){_0x1b449d[_0xdf5f('0x29')](0x194);}return _0x4025ec;};}function handleError(_0x17412b,_0x2fb328){_0x2fb328=_0x2fb328||0x1f4;return function(_0x415e79){logger[_0xdf5f('0x2a')](_0x415e79[_0xdf5f('0x2b')]);if(_0x415e79[_0xdf5f('0x2c')]){delete _0x415e79[_0xdf5f('0x2c')];}_0x17412b[_0xdf5f('0x1c')](_0x2fb328)[_0xdf5f('0x2d')](_0x415e79);};}exports[_0xdf5f('0x2e')]=function(_0x403b41,_0x2ae430){var _0x4b1095={},_0x6e5189={},_0x44317b={'count':0x0,'rows':[]};var _0x3c58a9=_[_0xdf5f('0x2f')](db[_0xdf5f('0x30')][_0xdf5f('0x31')],function(_0x44286e){return{'name':_0x44286e[_0xdf5f('0x32')],'type':_0x44286e[_0xdf5f('0x33')][_0xdf5f('0x34')]};});_0x6e5189[_0xdf5f('0x35')]=_[_0xdf5f('0x2f')](_0x3c58a9,_0xdf5f('0x2c'));_0x6e5189[_0xdf5f('0x36')]=_[_0xdf5f('0x37')](_0x403b41[_0xdf5f('0x36')]);_0x6e5189[_0xdf5f('0x38')]=_[_0xdf5f('0x39')](_0x6e5189[_0xdf5f('0x35')],_0x6e5189[_0xdf5f('0x36')]);_0x4b1095[_0xdf5f('0x3a')]=_[_0xdf5f('0x39')](_0x6e5189[_0xdf5f('0x35')],qs[_0xdf5f('0x3b')](_0x403b41[_0xdf5f('0x36')]['fields']));_0x4b1095['attributes']=_0x4b1095[_0xdf5f('0x3a')][_0xdf5f('0x3c')]?_0x4b1095[_0xdf5f('0x3a')]:_0x6e5189[_0xdf5f('0x35')];if(!_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x3d')]('nolimit')){_0x4b1095[_0xdf5f('0x20')]=qs['limit'](_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x20')]);_0x4b1095[_0xdf5f('0x1d')]=qs['offset'](_0x403b41[_0xdf5f('0x36')]['offset']);}_0x4b1095[_0xdf5f('0x3e')]=qs[_0xdf5f('0x3f')](_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x3f')]);_0x4b1095[_0xdf5f('0x40')]=qs[_0xdf5f('0x38')](_[_0xdf5f('0x41')](_0x403b41[_0xdf5f('0x36')],_0x6e5189['filters']),_0x3c58a9);if(_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x42')]){_0x4b1095[_0xdf5f('0x40')]=_[_0xdf5f('0x43')](_0x4b1095['where'],{'$or':_[_0xdf5f('0x2f')](_0x3c58a9,function(_0x2afcc5){if(_0x2afcc5[_0xdf5f('0x33')]!=='VIRTUAL'){var _0x32887f={};_0x32887f[_0x2afcc5[_0xdf5f('0x2c')]]={'$like':'%'+_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x42')]+'%'};return _0x32887f;}})});}_0x4b1095=_[_0xdf5f('0x43')]({},_0x4b1095,_0x403b41[_0xdf5f('0x44')]);var _0x5eac52={'where':_0x4b1095[_0xdf5f('0x40')]};return db['SalesforceAccount']['count'](_0x5eac52)['then'](function(_0x2de10c){_0x44317b['count']=_0x2de10c;if(_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x45')]){_0x4b1095[_0xdf5f('0x46')]=[{'all':!![]}];}return db[_0xdf5f('0x30')][_0xdf5f('0x47')](_0x4b1095);})['then'](function(_0x76378b){_0x44317b['rows']=_0x76378b;return _0x44317b;})[_0xdf5f('0x28')](respondWithFilteredResult(_0x2ae430,_0x4b1095))[_0xdf5f('0x48')](handleError(_0x2ae430,null));};exports[_0xdf5f('0x49')]=function(_0x4e06e3,_0x50f828){var _0x9fa94a={'raw':![],'where':{'id':_0x4e06e3[_0xdf5f('0x4a')]['id']}},_0x9e084f={};_0x9e084f[_0xdf5f('0x35')]=_['keys'](db[_0xdf5f('0x30')][_0xdf5f('0x31')]);_0x9e084f[_0xdf5f('0x36')]=_['keys'](_0x4e06e3['query']);_0x9e084f[_0xdf5f('0x38')]=_[_0xdf5f('0x39')](_0x9e084f[_0xdf5f('0x35')],_0x9e084f[_0xdf5f('0x36')]);_0x9fa94a[_0xdf5f('0x3a')]=_['intersection'](_0x9e084f[_0xdf5f('0x35')],qs[_0xdf5f('0x3b')](_0x4e06e3['query'][_0xdf5f('0x3b')]));_0x9fa94a[_0xdf5f('0x3a')]=_0x9fa94a[_0xdf5f('0x3a')][_0xdf5f('0x3c')]?_0x9fa94a[_0xdf5f('0x3a')]:_0x9e084f['model'];if(_0x4e06e3[_0xdf5f('0x36')][_0xdf5f('0x45')]){_0x9fa94a[_0xdf5f('0x46')]=[{'all':!![]}];}_0x9fa94a=_[_0xdf5f('0x43')]({},_0x9fa94a,_0x4e06e3[_0xdf5f('0x44')]);return db[_0xdf5f('0x30')]['find'](_0x9fa94a)['then'](handleEntityNotFound(_0x50f828,null))['then'](respondWithResult(_0x50f828,null))['catch'](handleError(_0x50f828,null));};exports['create']=function(_0x4b1814,_0x4692cb){return db[_0xdf5f('0x30')][_0xdf5f('0x4b')](_0x4b1814[_0xdf5f('0x4c')],{})[_0xdf5f('0x28')](respondWithResult(_0x4692cb,0xc9))[_0xdf5f('0x48')](handleError(_0x4692cb,null));};exports[_0xdf5f('0x26')]=function(_0x48ceb9,_0x3ce2ad){if(_0x48ceb9[_0xdf5f('0x4c')]['id']){delete _0x48ceb9['body']['id'];}return db[_0xdf5f('0x30')][_0xdf5f('0x4d')]({'where':{'id':_0x48ceb9['params']['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x3ce2ad,null))[_0xdf5f('0x28')](saveUpdates(_0x48ceb9['body'],null))[_0xdf5f('0x28')](respondWithResult(_0x3ce2ad,null))[_0xdf5f('0x48')](handleError(_0x3ce2ad,null));};exports['destroy']=function(_0x447eb5,_0x31aad8){return db[_0xdf5f('0x30')]['find']({'where':{'id':_0x447eb5[_0xdf5f('0x4a')]['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x31aad8,null))['then'](removeEntity(_0x31aad8,null))[_0xdf5f('0x48')](handleError(_0x31aad8,null));};exports['getConfigurations']=function(_0x35beea,_0x173f0e,_0x2f5a37){var _0x27d3ec={};var _0x2e0ba3={};var _0x2ab512;var _0x505b22;return db['SalesforceAccount'][_0xdf5f('0x4e')]({'where':{'id':_0x35beea[_0xdf5f('0x4a')]['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x173f0e,null))[_0xdf5f('0x28')](function(_0x154b62){if(_0x154b62){_0x2ab512=_0x154b62;_0x2e0ba3[_0xdf5f('0x35')]=_['keys'](db['SalesforceConfiguration'][_0xdf5f('0x31')]);_0x2e0ba3[_0xdf5f('0x36')]=_['keys'](_0x35beea[_0xdf5f('0x36')]);_0x2e0ba3[_0xdf5f('0x38')]=_['intersection'](_0x2e0ba3[_0xdf5f('0x35')],_0x2e0ba3[_0xdf5f('0x36')]);_0x27d3ec['attributes']=_['intersection'](_0x2e0ba3['model'],qs['fields'](_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x3b')]));_0x27d3ec['attributes']=_0x27d3ec['attributes'][_0xdf5f('0x3c')]?_0x27d3ec[_0xdf5f('0x3a')]:_0x2e0ba3[_0xdf5f('0x35')];_0x27d3ec[_0xdf5f('0x3e')]=qs['sort'](_0x35beea['query'][_0xdf5f('0x3f')]);_0x27d3ec[_0xdf5f('0x40')]=qs[_0xdf5f('0x38')](_[_0xdf5f('0x41')](_0x35beea[_0xdf5f('0x36')],_0x2e0ba3[_0xdf5f('0x38')]));if(_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x42')]){_0x27d3ec[_0xdf5f('0x40')]=_['merge'](_0x27d3ec[_0xdf5f('0x40')],{'$or':_['map'](_0x27d3ec[_0xdf5f('0x3a')],function(_0x27d8e7){var _0x3ac603={};_0x3ac603[_0x27d8e7]={'$like':'%'+_0x35beea['query'][_0xdf5f('0x42')]+'%'};return _0x3ac603;})});}_0x27d3ec=_[_0xdf5f('0x43')]({},_0x27d3ec,_0x35beea[_0xdf5f('0x44')]);return _0x2ab512['getConfigurations'](_0x27d3ec);}})[_0xdf5f('0x28')](function(_0x4463f9){if(_0x4463f9){_0x505b22=_0x4463f9[_0xdf5f('0x3c')];if(!_0x35beea[_0xdf5f('0x36')]['hasOwnProperty'](_0xdf5f('0x4f'))){_0x27d3ec[_0xdf5f('0x20')]=qs['limit'](_0x35beea[_0xdf5f('0x36')]['limit']);_0x27d3ec[_0xdf5f('0x1d')]=qs[_0xdf5f('0x1d')](_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x1d')]);}return _0x2ab512['getConfigurations'](_0x27d3ec);}})[_0xdf5f('0x28')](function(_0x4ef76e){if(_0x4ef76e){return _0x4ef76e?{'count':_0x505b22,'rows':_0x4ef76e}:null;}})[_0xdf5f('0x28')](respondWithResult(_0x173f0e,null))[_0xdf5f('0x48')](handleError(_0x173f0e,null));};exports[_0xdf5f('0x50')]=function(_0x3a3e54,_0x456192,_0x27585d){if(_0x3a3e54[_0xdf5f('0x4c')]['id']){delete _0x3a3e54[_0xdf5f('0x4c')]['id'];}return db[_0xdf5f('0x30')][_0xdf5f('0x4e')]({'where':{'id':_0x3a3e54[_0xdf5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x456192,null))[_0xdf5f('0x28')](function(_0x4560b1){if(_0x4560b1){_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x51')]=_0x4560b1['id'];_0x3a3e54[_0xdf5f('0x4c')]['Subjects']=integrations[_0xdf5f('0x52')](_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x53')],_0x3a3e54['body']['type']);_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x54')]=integrations[_0xdf5f('0x55')](_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x53')],_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x33')]);return db[_0xdf5f('0x56')]['create'](_0x3a3e54[_0xdf5f('0x4c')],{'include':[{'model':db[_0xdf5f('0x57')],'as':_0xdf5f('0x58')},{'model':db[_0xdf5f('0x57')],'as':_0xdf5f('0x54')}]});}return null;})[_0xdf5f('0x28')](respondWithResult(_0x456192,null))['catch'](handleError(_0x456192,null));};exports[_0xdf5f('0x59')]=function(_0x5a8f1c,_0x48e74a,_0x83c74d){var _0x431d9e;var _0x165a0e='';var _0x1b3afe=_0xdf5f('0x5a');return db[_0xdf5f('0x30')][_0xdf5f('0x4e')]({'where':{'id':_0x5a8f1c[_0xdf5f('0x4a')]['id']},'attributes':['id','remoteUri',_0xdf5f('0x5b'),_0xdf5f('0x5c'),_0xdf5f('0x5d'),_0xdf5f('0x5e'),_0xdf5f('0x5f')]})[_0xdf5f('0x28')](handleEntityNotFound(_0x48e74a,null))[_0xdf5f('0x28')](function(_0x3968b7){if(_0x3968b7){_0x165a0e=_0x3968b7[_0xdf5f('0x60')];var _0x3c4137=_0x165a0e[_0xdf5f('0x61')](-0x1);if(_0x3c4137==='/'){_0x165a0e=_0x165a0e[_0xdf5f('0x62')](0x0,_0x165a0e['lastIndexOf'](_0x3c4137));}_0x431d9e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x165a0e,'clientId':_0x3968b7[_0xdf5f('0x5b')],'clientSecret':_0x3968b7['clientSecret']}});return _0x431d9e[_0xdf5f('0x63')](_0x3968b7[_0xdf5f('0x5d')],_0x3968b7[_0xdf5f('0x5e')][_0xdf5f('0x64')](_0x3968b7['securityToken']));}})[_0xdf5f('0x28')](function(_0x5b1c74){if(_0x5b1c74){if(!_[_0xdf5f('0x65')](_0x5a8f1c['query'][_0xdf5f('0x66')])){_0x1b3afe=_0x5a8f1c[_0xdf5f('0x36')][_0xdf5f('0x66')];}return _0x431d9e[_0xdf5f('0x67')](_0x1b3afe)[_0xdf5f('0x68')]();}})[_0xdf5f('0x28')](function(_0x30b040){var _0x22e00e=[_0xdf5f('0x69'),_0xdf5f('0x6a'),_0xdf5f('0x6b'),_0xdf5f('0x6c'),_0xdf5f('0x6d'),_0xdf5f('0x6e')];var _0x43c269=[_0xdf5f('0x6f'),_0xdf5f('0x70'),_0xdf5f('0x71'),_0xdf5f('0x72'),'email',_0xdf5f('0x73'),_0xdf5f('0x74')];if(_0x30b040){_[_0xdf5f('0x75')](_0x30b040['fields'],function(_0x27f33a){return _0x22e00e[_0xdf5f('0x76')](_0x27f33a[_0xdf5f('0x2c')])||!_0x43c269[_0xdf5f('0x76')](_0x27f33a['type']);});return{'count':_0x30b040[_0xdf5f('0x3b')][_0xdf5f('0x3c')],'rows':_['map'](_0x30b040[_0xdf5f('0x3b')],function(_0x54af8f){return{'id':_0x54af8f[_0xdf5f('0x2c')],'name':_0x54af8f['label'],'custom':_0x54af8f[_0xdf5f('0x77')],'options':_0x54af8f['picklistValues'][_0xdf5f('0x3c')]>0x0?_[_0xdf5f('0x2f')](_0x54af8f[_0xdf5f('0x78')],function(_0xe9454b){return{'name':_0xe9454b[_0xdf5f('0x79')],'value':_0xe9454b[_0xdf5f('0x7a')]};}):_0x54af8f['type']==_0xdf5f('0x72')?[{'name':_0xdf5f('0x7b'),'value':_0xdf5f('0x7c')},{'name':_0xdf5f('0x7d'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x48e74a,null))['catch'](function(_0x24883d){var _0x3f09bd=_0x5a8f1c[_0xdf5f('0x36')][_0xdf5f('0x7e')]?0x1f4:_0x24883d[_0xdf5f('0x7f')]||0x1f4;logger[_0xdf5f('0x2a')](_0xdf5f('0x80'),_0xdf5f('0x59'),_0x3f09bd,JSON[_0xdf5f('0x81')](_0x24883d));delete _0x24883d[_0xdf5f('0x2c')];if(_0x3f09bd===0x191){_0x3f09bd=0x190;}_0x48e74a[_0xdf5f('0x1c')](_0x3f09bd)[_0xdf5f('0x2d')](_0x5a8f1c[_0xdf5f('0x36')]['test']?{'message':_0xdf5f('0x82'),'statusCode':_0x24883d[_0xdf5f('0x7f')]}:_0x24883d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 19cf3d6..8919642 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 _0xe27e=['../../config/environment','../../components/integrations/configuration','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x56260c,_0x3594bc){var _0x3293b9=function(_0x3e1744){while(--_0x3e1744){_0x56260c['push'](_0x56260c['shift']());}};_0x3293b9(++_0x3594bc);}(_0xe27e,0xa8));var _0xee27=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0xe27e[_0x4e21ba];return _0x55b94b;};'use strict';var _=require(_0xee27('0x0'));var util=require('util');var logger=require(_0xee27('0x1'))(_0xee27('0x2'));var moment=require(_0xee27('0x3'));var BPromise=require(_0xee27('0x4'));var rp=require(_0xee27('0x5'));var fs=require('fs');var path=require(_0xee27('0x6'));var rimraf=require(_0xee27('0x7'));var config=require(_0xee27('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xee27('0x9'));module[_0xee27('0xa')]=function(_0x3a19b0,_0x199a2e){return _0x3a19b0['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d51=['../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','request-promise','path','rimraf'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x7d51,0x1e9));var _0x17d5=function(_0x313aa8,_0x13c9b3){_0x313aa8=_0x313aa8-0x0;var _0x4e984d=_0x7d51[_0x313aa8];return _0x4e984d;};'use strict';var _=require(_0x17d5('0x0'));var util=require(_0x17d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x17d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x17d5('0x3'));var fs=require('fs');var path=require(_0x17d5('0x4'));var rimraf=require(_0x17d5('0x5'));var config=require(_0x17d5('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x17d5('0x7')]=function(_0x4127e2,_0x28afa2){return _0x4127e2[_0x17d5('0x8')](_0x17d5('0x9'),attributes,{'tableName':_0x17d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 0ee458d..085fea5 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 _0xcc4f=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc4f,0x82));var _0xfcc4=function(_0x43bc44,_0x1f1377){_0x43bc44=_0x43bc44-0x0;var _0x294f66=_0xcc4f[_0x43bc44];return _0x294f66;};'use strict';var _=require(_0xfcc4('0x0'));var util=require(_0xfcc4('0x1'));var moment=require(_0xfcc4('0x2'));var BPromise=require(_0xfcc4('0x3'));var rs=require(_0xfcc4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcc4('0x5'))['db'];var utils=require(_0xfcc4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfcc4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfcc4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fb07,_0x40110e,_0x4f40c6){return new BPromise(function(_0x19d5f0,_0x5a4722){return client[_0xfcc4('0x9')](_0x25fb07,_0x4f40c6)[_0xfcc4('0xa')](function(_0x175828){logger['info'](_0xfcc4('0xb'),_0x40110e,_0xfcc4('0xc'));logger[_0xfcc4('0xd')](_0xfcc4('0xe'),_0x40110e,'request\x20sent',JSON[_0xfcc4('0xf')](_0x175828));if(_0x175828[_0xfcc4('0x10')]){if(_0x175828['error'][_0xfcc4('0x11')]===0x1f4){logger[_0xfcc4('0x10')](_0xfcc4('0xb'),_0x40110e,_0x175828[_0xfcc4('0x10')][_0xfcc4('0x12')]);return _0x5a4722(_0x175828[_0xfcc4('0x10')][_0xfcc4('0x12')]);}logger['error'](_0xfcc4('0xb'),_0x40110e,_0x175828['error'][_0xfcc4('0x12')]);return _0x19d5f0(_0x175828[_0xfcc4('0x10')][_0xfcc4('0x12')]);}else{logger[_0xfcc4('0x13')](_0xfcc4('0xb'),_0x40110e,_0xfcc4('0xc'));_0x19d5f0(_0x175828['result'][_0xfcc4('0x12')]);}})[_0xfcc4('0x14')](function(_0x5500f6){logger[_0xfcc4('0x10')](_0xfcc4('0xb'),_0x40110e,_0x5500f6);_0x5a4722(_0x5500f6);});});}exports[_0xfcc4('0x15')]=function(_0x3f14ec){var _0x32b455=this;return new Promise(function(_0x362644,_0x2aa09e){return db[_0xfcc4('0x16')]['findAll']({'raw':_0x3f14ec[_0xfcc4('0x17')]?_0x3f14ec[_0xfcc4('0x17')][_0xfcc4('0x18')]===undefined?!![]:![]:!![],'where':_0x3f14ec[_0xfcc4('0x17')]?_0x3f14ec['options'][_0xfcc4('0x19')]||null:null,'attributes':_0x3f14ec[_0xfcc4('0x17')]?_0x3f14ec[_0xfcc4('0x17')][_0xfcc4('0x1a')]||null:null,'limit':_0x3f14ec['options']?_0x3f14ec[_0xfcc4('0x17')][_0xfcc4('0x1b')]||null:null,'include':_0x3f14ec['options']?_0x3f14ec['options'][_0xfcc4('0x1c')]?_[_0xfcc4('0x1d')](_0x3f14ec[_0xfcc4('0x17')][_0xfcc4('0x1c')],function(_0x306a9a){return{'model':db[_0x306a9a[_0xfcc4('0x1e')]],'as':_0x306a9a['as'],'attributes':_0x306a9a[_0xfcc4('0x1a')],'include':_0x306a9a[_0xfcc4('0x1c')]?_[_0xfcc4('0x1d')](_0x306a9a[_0xfcc4('0x1c')],function(_0x4034dd){return{'model':db[_0x4034dd[_0xfcc4('0x1e')]],'as':_0x4034dd['as'],'attributes':_0x4034dd[_0xfcc4('0x1a')],'include':_0x4034dd[_0xfcc4('0x1c')]?_['map'](_0x4034dd[_0xfcc4('0x1c')],function(_0x8318b3){return{'model':db[_0x8318b3[_0xfcc4('0x1e')]],'as':_0x8318b3['as'],'attributes':_0x8318b3['attributes']};}):[]};}):[]};}):[]:[]})[_0xfcc4('0xa')](function(_0x1478d4){logger[_0xfcc4('0x13')](_0xfcc4('0x15'),_0x3f14ec);logger['debug'](_0xfcc4('0x15'),_0x3f14ec,JSON['stringify'](_0x1478d4));_0x362644(_0x1478d4);})[_0xfcc4('0x14')](function(_0x340576){logger['error']('GetSalesforceAccount',_0x340576[_0xfcc4('0x12')],_0x3f14ec);_0x2aa09e(_0x32b455[_0xfcc4('0x10')](0x1f4,_0x340576['message']));});});};exports[_0xfcc4('0x1f')]=function(_0x4b8cd8){var _0x56a558=this;return new Promise(function(_0x45ded0,_0x3b3774){return db[_0xfcc4('0x16')][_0xfcc4('0x20')]({'raw':_0x4b8cd8[_0xfcc4('0x17')]?_0x4b8cd8[_0xfcc4('0x17')][_0xfcc4('0x18')]===undefined?!![]:![]:!![],'where':_0x4b8cd8[_0xfcc4('0x17')]?_0x4b8cd8['options']['where']||null:null,'attributes':_0x4b8cd8['options']?_0x4b8cd8[_0xfcc4('0x17')][_0xfcc4('0x1a')]||null:null,'include':_0x4b8cd8[_0xfcc4('0x17')]?_0x4b8cd8[_0xfcc4('0x17')]['include']?_['map'](_0x4b8cd8[_0xfcc4('0x17')][_0xfcc4('0x1c')],function(_0x268b2a){return{'model':db[_0x268b2a[_0xfcc4('0x1e')]],'as':_0x268b2a['as'],'attributes':_0x268b2a[_0xfcc4('0x1a')],'include':_0x268b2a['include']?_[_0xfcc4('0x1d')](_0x268b2a['include'],function(_0x25b5ac){return{'model':db[_0x25b5ac[_0xfcc4('0x1e')]],'as':_0x25b5ac['as'],'attributes':_0x25b5ac[_0xfcc4('0x1a')],'include':_0x25b5ac[_0xfcc4('0x1c')]?_[_0xfcc4('0x1d')](_0x25b5ac[_0xfcc4('0x1c')],function(_0x45214a){return{'model':db[_0x45214a[_0xfcc4('0x1e')]],'as':_0x45214a['as'],'attributes':_0x45214a[_0xfcc4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfcc4('0xa')](function(_0x2b0118){logger['info'](_0xfcc4('0x1f'),_0x4b8cd8);logger['debug'](_0xfcc4('0x1f'),_0x4b8cd8,JSON[_0xfcc4('0xf')](_0x2b0118));_0x45ded0(_0x2b0118);})['catch'](function(_0x195bae){logger[_0xfcc4('0x10')]('ShowSalesforceAccount',_0x195bae['message'],_0x4b8cd8);_0x3b3774(_0x56a558[_0xfcc4('0x10')](0x1f4,_0x195bae['message']));});});}; \ No newline at end of file +var _0x01c2=['request\x20sent','error','code','message','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetSalesforceAccount','stringify','find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2a3103,_0x3712f1){var _0x4d8c98=function(_0x4d6e1f){while(--_0x4d6e1f){_0x2a3103['push'](_0x2a3103['shift']());}};_0x4d8c98(++_0x3712f1);}(_0x01c2,0x17b));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x201c('0x0'));var util=require(_0x201c('0x1'));var moment=require(_0x201c('0x2'));var BPromise=require(_0x201c('0x3'));var rs=require(_0x201c('0x4'));var fs=require('fs');var Redis=require(_0x201c('0x5'));var db=require(_0x201c('0x6'))['db'];var utils=require(_0x201c('0x7'));var logger=require('../../config/logger')(_0x201c('0x8'));var config=require(_0x201c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x201c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b92f6,_0x18e0c8,_0x375753){return new BPromise(function(_0x4f2dc1,_0x125a10){return client[_0x201c('0xb')](_0x1b92f6,_0x375753)[_0x201c('0xc')](function(_0x14f9fe){logger[_0x201c('0xd')](_0x201c('0xe'),_0x18e0c8,'request\x20sent');logger[_0x201c('0xf')](_0x201c('0x10'),_0x18e0c8,_0x201c('0x11'),JSON['stringify'](_0x14f9fe));if(_0x14f9fe[_0x201c('0x12')]){if(_0x14f9fe[_0x201c('0x12')][_0x201c('0x13')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x18e0c8,_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);return _0x125a10(_0x14f9fe[_0x201c('0x12')]['message']);}logger[_0x201c('0x12')](_0x201c('0xe'),_0x18e0c8,_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);return _0x4f2dc1(_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);}else{logger[_0x201c('0xd')](_0x201c('0xe'),_0x18e0c8,'request\x20sent');_0x4f2dc1(_0x14f9fe['result'][_0x201c('0x14')]);}})[_0x201c('0x15')](function(_0xac1c73){logger[_0x201c('0x12')](_0x201c('0xe'),_0x18e0c8,_0xac1c73);_0x125a10(_0xac1c73);});});}exports['GetSalesforceAccount']=function(_0x10da1){var _0x2a36ef=this;return new Promise(function(_0x13a06e,_0x1fcaee){return db[_0x201c('0x16')][_0x201c('0x17')]({'raw':_0x10da1['options']?_0x10da1[_0x201c('0x18')][_0x201c('0x19')]===undefined?!![]:![]:!![],'where':_0x10da1['options']?_0x10da1[_0x201c('0x18')][_0x201c('0x1a')]||null:null,'attributes':_0x10da1[_0x201c('0x18')]?_0x10da1[_0x201c('0x18')][_0x201c('0x1b')]||null:null,'limit':_0x10da1[_0x201c('0x18')]?_0x10da1[_0x201c('0x18')][_0x201c('0x1c')]||null:null,'include':_0x10da1['options']?_0x10da1['options'][_0x201c('0x1d')]?_['map'](_0x10da1[_0x201c('0x18')][_0x201c('0x1d')],function(_0x452edb){return{'model':db[_0x452edb[_0x201c('0x1e')]],'as':_0x452edb['as'],'attributes':_0x452edb[_0x201c('0x1b')],'include':_0x452edb[_0x201c('0x1d')]?_[_0x201c('0x1f')](_0x452edb[_0x201c('0x1d')],function(_0x379654){return{'model':db[_0x379654[_0x201c('0x1e')]],'as':_0x379654['as'],'attributes':_0x379654['attributes'],'include':_0x379654['include']?_[_0x201c('0x1f')](_0x379654[_0x201c('0x1d')],function(_0x3b17b1){return{'model':db[_0x3b17b1[_0x201c('0x1e')]],'as':_0x3b17b1['as'],'attributes':_0x3b17b1[_0x201c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x201c('0xc')](function(_0x23aa08){logger['info']('GetSalesforceAccount',_0x10da1);logger[_0x201c('0xf')](_0x201c('0x20'),_0x10da1,JSON[_0x201c('0x21')](_0x23aa08));_0x13a06e(_0x23aa08);})['catch'](function(_0x4d8e96){logger[_0x201c('0x12')](_0x201c('0x20'),_0x4d8e96['message'],_0x10da1);_0x1fcaee(_0x2a36ef['error'](0x1f4,_0x4d8e96['message']));});});};exports['ShowSalesforceAccount']=function(_0x59e708){var _0x295990=this;return new Promise(function(_0x20b340,_0x39e593){return db[_0x201c('0x16')][_0x201c('0x22')]({'raw':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')]['where']||null:null,'attributes':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')][_0x201c('0x1b')]||null:null,'include':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')][_0x201c('0x1d')]?_['map'](_0x59e708[_0x201c('0x18')]['include'],function(_0x9c04d9){return{'model':db[_0x9c04d9[_0x201c('0x1e')]],'as':_0x9c04d9['as'],'attributes':_0x9c04d9[_0x201c('0x1b')],'include':_0x9c04d9[_0x201c('0x1d')]?_[_0x201c('0x1f')](_0x9c04d9['include'],function(_0x23980b){return{'model':db[_0x23980b['model']],'as':_0x23980b['as'],'attributes':_0x23980b[_0x201c('0x1b')],'include':_0x23980b['include']?_[_0x201c('0x1f')](_0x23980b[_0x201c('0x1d')],function(_0x4e3546){return{'model':db[_0x4e3546['model']],'as':_0x4e3546['as'],'attributes':_0x4e3546[_0x201c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x201c('0xc')](function(_0x9f03dd){logger[_0x201c('0xd')]('ShowSalesforceAccount',_0x59e708);logger[_0x201c('0xf')]('ShowSalesforceAccount',_0x59e708,JSON[_0x201c('0x21')](_0x9f03dd));_0x20b340(_0x9f03dd);})[_0x201c('0x15')](function(_0x429cec){logger[_0x201c('0x12')](_0x201c('0x23'),_0x429cec['message'],_0x59e708);_0x39e593(_0x295990[_0x201c('0x12')](0x1f4,_0x429cec[_0x201c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1a67ecb..1c0b9ed 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x0b0e[_0x574ce3];return _0x3447a0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x149f32,_0x4273f7){_0x149f32=_0x149f32-0x0;var _0x11f475=_0x0b0e[_0x149f32];return _0x11f475;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7a7864a..5803b03 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 _0xc09e=['account','sequelize','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','nothing'];(function(_0x34246b,_0x1d5f54){var _0x314402=function(_0x1d4c61){while(--_0x1d4c61){_0x34246b['push'](_0x34246b['shift']());}};_0x314402(++_0x1d5f54);}(_0xc09e,0x6f));var _0xec09=function(_0xc7ed,_0x36c883){_0xc7ed=_0xc7ed-0x0;var _0x5e2f81=_0xc09e[_0xc7ed];return _0x5e2f81;};'use strict';var Sequelize=require(_0xec09('0x0'));module['exports']={'name':{'type':Sequelize[_0xec09('0x1')]},'description':{'type':Sequelize[_0xec09('0x1')]},'ticketType':{'type':Sequelize[_0xec09('0x2')](_0xec09('0x3'),'Case'),'defaultValue':_0xec09('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xec09('0x4'),_0xec09('0x5'),_0xec09('0x6'),_0xec09('0x7'),'account'),'defaultValue':_0xec09('0x4')},'moduleCreate':{'type':Sequelize[_0xec09('0x2')](_0xec09('0x8'),_0xec09('0x5'),_0xec09('0x6'),_0xec09('0x9')),'defaultValue':_0xec09('0x6')},'leadId':{'type':Sequelize[_0xec09('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xec09('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xec09('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xec09('0x1')]}}; \ No newline at end of file +var _0xd34c=['nothing','lead','exports','STRING','ENUM','Task','contact_lead','contact','account'];(function(_0x5b74b2,_0x34430b){var _0x4c4581=function(_0x204c62){while(--_0x204c62){_0x5b74b2['push'](_0x5b74b2['shift']());}};_0x4c4581(++_0x34430b);}(_0xd34c,0x1cd));var _0xcd34=function(_0x4ebd99,_0xb49d24){_0x4ebd99=_0x4ebd99-0x0;var _0x53eb6b=_0xd34c[_0x4ebd99];return _0x53eb6b;};'use strict';var Sequelize=require('sequelize');module[_0xcd34('0x0')]={'name':{'type':Sequelize[_0xcd34('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x3'),'Case'),'defaultValue':_0xcd34('0x3')},'moduleSearch':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x4'),_0xcd34('0x5'),'lead','account_contact_lead',_0xcd34('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x7'),_0xcd34('0x5'),_0xcd34('0x8'),_0xcd34('0x6')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xcd34('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4b721c7..3dc9338 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 _0x686d=['json','apply','reject','save','update','destroy','then','error','name','send','index','map','SalesforceConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range'];(function(_0x23b434,_0xaa5e7c){var _0x278220=function(_0xbc844d){while(--_0xbc844d){_0x23b434['push'](_0x23b434['shift']());}};_0x278220(++_0xaa5e7c);}(_0x686d,0x172));var _0xd686=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x686d[_0x27604f];return _0x40d189;};'use strict';var emlformat=require(_0xd686('0x0'));var rimraf=require(_0xd686('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd686('0x2'));var rp=require(_0xd686('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd686('0x4'));var path=require(_0xd686('0x5'));var sox=require('sox');var csv=require(_0xd686('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd686('0x7'));var _=require(_0xd686('0x8'));var squel=require(_0xd686('0x9'));var crypto=require('crypto');var jsforce=require(_0xd686('0xa'));var deskjs=require(_0xd686('0xb'));var toCsv=require(_0xd686('0x6'));var querystring=require(_0xd686('0xc'));var Papa=require(_0xd686('0xd'));var Redis=require(_0xd686('0xe'));var authService=require(_0xd686('0xf'));var qs=require(_0xd686('0x10'));var as=require(_0xd686('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd686('0x12'));var config=require(_0xd686('0x13'));var licenseUtil=require(_0xd686('0x14'));var db=require(_0xd686('0x15'))['db'];function respondWithStatusCode(_0x178337,_0x44a074){_0x44a074=_0x44a074||0xcc;return function(_0x42b821){if(_0x42b821){return _0x178337[_0xd686('0x16')](_0x44a074);}return _0x178337[_0xd686('0x17')](_0x44a074)[_0xd686('0x18')]();};}function respondWithResult(_0x529953,_0x2e8cb1){_0x2e8cb1=_0x2e8cb1||0xc8;return function(_0x72f69a){if(_0x72f69a){return _0x529953[_0xd686('0x17')](_0x2e8cb1)['json'](_0x72f69a);}};}function respondWithFilteredResult(_0x5b1e78,_0x2b5b37){return function(_0x16dd62){if(_0x16dd62){var _0x173c69=typeof _0x2b5b37[_0xd686('0x19')]==='undefined'&&typeof _0x2b5b37[_0xd686('0x1a')]==='undefined';var _0x1e7b2e=_0x16dd62[_0xd686('0x1b')];var _0x2ca845=_0x173c69?0x0:_0x2b5b37[_0xd686('0x19')];var _0x161ec9=_0x173c69?_0x16dd62[_0xd686('0x1b')]:_0x2b5b37[_0xd686('0x19')]+_0x2b5b37[_0xd686('0x1a')];var _0x4ad99e;if(_0x161ec9>=_0x1e7b2e){_0x161ec9=_0x1e7b2e;_0x4ad99e=0xc8;}else{_0x4ad99e=0xce;}_0x5b1e78[_0xd686('0x17')](_0x4ad99e);return _0x5b1e78[_0xd686('0x1c')](_0xd686('0x1d'),_0x2ca845+'-'+_0x161ec9+'/'+_0x1e7b2e)[_0xd686('0x1e')](_0x16dd62);}return null;};}function patchUpdates(_0xb44d38){return function(_0x37d885){try{jsonpatch[_0xd686('0x1f')](_0x37d885,_0xb44d38,!![]);}catch(_0x22884b){return BPromise[_0xd686('0x20')](_0x22884b);}return _0x37d885[_0xd686('0x21')]();};}function saveUpdates(_0x8949c8,_0x2d9891){return function(_0x2ff3cb){if(_0x2ff3cb){return _0x2ff3cb[_0xd686('0x22')](_0x8949c8)['then'](function(_0x30b480){return _0x30b480;});}return null;};}function removeEntity(_0x18821f,_0x31877e){return function(_0x4b9eb9){if(_0x4b9eb9){return _0x4b9eb9[_0xd686('0x23')]()[_0xd686('0x24')](function(){_0x18821f['status'](0xcc)[_0xd686('0x18')]();});}};}function handleEntityNotFound(_0x201480,_0x18e46e){return function(_0x534f18){if(!_0x534f18){_0x201480[_0xd686('0x16')](0x194);}return _0x534f18;};}function handleError(_0x5527e9,_0x5a7175){_0x5a7175=_0x5a7175||0x1f4;return function(_0x44df64){logger[_0xd686('0x25')](_0x44df64['stack']);if(_0x44df64[_0xd686('0x26')]){delete _0x44df64['name'];}_0x5527e9['status'](_0x5a7175)[_0xd686('0x27')](_0x44df64);};}exports[_0xd686('0x28')]=function(_0xd1fc9b,_0x3ead83){var _0x57a480={},_0x4b87cd={},_0x270ac5={'count':0x0,'rows':[]};var _0x2bc319=_[_0xd686('0x29')](db[_0xd686('0x2a')]['rawAttributes'],function(_0x544752){return{'name':_0x544752[_0xd686('0x2b')],'type':_0x544752[_0xd686('0x2c')][_0xd686('0x2d')]};});_0x4b87cd['model']=_[_0xd686('0x29')](_0x2bc319,'name');_0x4b87cd[_0xd686('0x2e')]=_[_0xd686('0x2f')](_0xd1fc9b[_0xd686('0x2e')]);_0x4b87cd[_0xd686('0x30')]=_[_0xd686('0x31')](_0x4b87cd[_0xd686('0x32')],_0x4b87cd[_0xd686('0x2e')]);_0x57a480[_0xd686('0x33')]=_[_0xd686('0x31')](_0x4b87cd['model'],qs['fields'](_0xd1fc9b[_0xd686('0x2e')][_0xd686('0x34')]));_0x57a480[_0xd686('0x33')]=_0x57a480['attributes'][_0xd686('0x35')]?_0x57a480['attributes']:_0x4b87cd['model'];if(!_0xd1fc9b[_0xd686('0x2e')][_0xd686('0x36')](_0xd686('0x37'))){_0x57a480['limit']=qs[_0xd686('0x1a')](_0xd1fc9b[_0xd686('0x2e')][_0xd686('0x1a')]);_0x57a480['offset']=qs[_0xd686('0x19')](_0xd1fc9b[_0xd686('0x2e')][_0xd686('0x19')]);}_0x57a480[_0xd686('0x38')]=qs[_0xd686('0x39')](_0xd1fc9b['query']['sort']);_0x57a480['where']=qs[_0xd686('0x30')](_[_0xd686('0x3a')](_0xd1fc9b[_0xd686('0x2e')],_0x4b87cd[_0xd686('0x30')]),_0x2bc319);if(_0xd1fc9b[_0xd686('0x2e')][_0xd686('0x3b')]){_0x57a480['where']=_[_0xd686('0x3c')](_0x57a480[_0xd686('0x3d')],{'$or':_[_0xd686('0x29')](_0x2bc319,function(_0x351574){if(_0x351574[_0xd686('0x2c')]!==_0xd686('0x3e')){var _0x29b796={};_0x29b796[_0x351574[_0xd686('0x26')]]={'$like':'%'+_0xd1fc9b['query'][_0xd686('0x3b')]+'%'};return _0x29b796;}})});}_0x57a480=_[_0xd686('0x3c')]({},_0x57a480,_0xd1fc9b['options']);var _0x248ac0={'where':_0x57a480[_0xd686('0x3d')]};return db[_0xd686('0x2a')]['count'](_0x248ac0)['then'](function(_0x15616a){_0x270ac5[_0xd686('0x1b')]=_0x15616a;if(_0xd1fc9b['query'][_0xd686('0x3f')]){_0x57a480['include']=[{'all':!![]}];}return db[_0xd686('0x2a')][_0xd686('0x40')](_0x57a480);})[_0xd686('0x24')](function(_0x44e2f5){_0x270ac5[_0xd686('0x41')]=_0x44e2f5;return _0x270ac5;})[_0xd686('0x24')](respondWithFilteredResult(_0x3ead83,_0x57a480))[_0xd686('0x42')](handleError(_0x3ead83,null));};exports[_0xd686('0x43')]=function(_0x3f1935,_0x18192c){var _0x1c7d06={'raw':![],'where':{'id':_0x3f1935['params']['id']}},_0x9c0261={};_0x9c0261['model']=_[_0xd686('0x2f')](db[_0xd686('0x2a')][_0xd686('0x44')]);_0x9c0261[_0xd686('0x2e')]=_[_0xd686('0x2f')](_0x3f1935[_0xd686('0x2e')]);_0x9c0261[_0xd686('0x30')]=_[_0xd686('0x31')](_0x9c0261[_0xd686('0x32')],_0x9c0261['query']);_0x1c7d06[_0xd686('0x33')]=_[_0xd686('0x31')](_0x9c0261[_0xd686('0x32')],qs[_0xd686('0x34')](_0x3f1935[_0xd686('0x2e')][_0xd686('0x34')]));_0x1c7d06[_0xd686('0x33')]=_0x1c7d06['attributes'][_0xd686('0x35')]?_0x1c7d06[_0xd686('0x33')]:_0x9c0261['model'];if(_0x3f1935[_0xd686('0x2e')][_0xd686('0x3f')]){_0x1c7d06[_0xd686('0x45')]=[{'all':!![]}];}_0x1c7d06=_[_0xd686('0x3c')]({},_0x1c7d06,_0x3f1935[_0xd686('0x46')]);return db[_0xd686('0x2a')][_0xd686('0x47')](_0x1c7d06)['then'](handleEntityNotFound(_0x18192c,null))[_0xd686('0x24')](respondWithResult(_0x18192c,null))['catch'](handleError(_0x18192c,null));};exports[_0xd686('0x48')]=function(_0x569dd0,_0x29fc5b){return db[_0xd686('0x2a')][_0xd686('0x48')](_0x569dd0[_0xd686('0x49')],{})['then'](respondWithResult(_0x29fc5b,0xc9))['catch'](handleError(_0x29fc5b,null));};exports['update']=function(_0xfba468,_0x5d4495){if(_0xfba468['body']['id']){delete _0xfba468['body']['id'];}return db[_0xd686('0x2a')][_0xd686('0x47')]({'where':{'id':_0xfba468[_0xd686('0x4a')]['id']}})[_0xd686('0x24')](handleEntityNotFound(_0x5d4495,null))[_0xd686('0x24')](saveUpdates(_0xfba468[_0xd686('0x49')],null))[_0xd686('0x24')](respondWithResult(_0x5d4495,null))['catch'](handleError(_0x5d4495,null));};exports[_0xd686('0x23')]=function(_0x292cc7,_0x3e3263){return db[_0xd686('0x2a')]['find']({'where':{'id':_0x292cc7[_0xd686('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e3263,null))['then'](removeEntity(_0x3e3263,null))[_0xd686('0x42')](handleError(_0x3e3263,null));};exports[_0xd686('0x4b')]=function(_0x36cab6,_0xc71b9d,_0x32161a){var _0x34431f={};var _0x3c5a54={};var _0x46f079;var _0x57beb2;return db[_0xd686('0x2a')][_0xd686('0x4c')]({'where':{'id':_0x36cab6[_0xd686('0x4a')]['id']}})[_0xd686('0x24')](handleEntityNotFound(_0xc71b9d,null))[_0xd686('0x24')](function(_0x3c6ca8){if(_0x3c6ca8){_0x46f079=_0x3c6ca8;_0x3c5a54['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x3c5a54[_0xd686('0x2e')]=_[_0xd686('0x2f')](_0x36cab6[_0xd686('0x2e')]);_0x3c5a54[_0xd686('0x30')]=_['intersection'](_0x3c5a54['model'],_0x3c5a54[_0xd686('0x2e')]);_0x34431f[_0xd686('0x33')]=_[_0xd686('0x31')](_0x3c5a54[_0xd686('0x32')],qs[_0xd686('0x34')](_0x36cab6[_0xd686('0x2e')][_0xd686('0x34')]));_0x34431f[_0xd686('0x33')]=_0x34431f['attributes']['length']?_0x34431f[_0xd686('0x33')]:_0x3c5a54[_0xd686('0x32')];_0x34431f[_0xd686('0x38')]=qs[_0xd686('0x39')](_0x36cab6[_0xd686('0x2e')]['sort']);_0x34431f[_0xd686('0x3d')]=qs[_0xd686('0x30')](_[_0xd686('0x3a')](_0x36cab6[_0xd686('0x2e')],_0x3c5a54[_0xd686('0x30')]));if(_0x36cab6[_0xd686('0x2e')][_0xd686('0x3b')]){_0x34431f[_0xd686('0x3d')]=_['merge'](_0x34431f[_0xd686('0x3d')],{'$or':_[_0xd686('0x29')](_0x34431f[_0xd686('0x33')],function(_0x57194b){var _0x546d77={};_0x546d77[_0x57194b]={'$like':'%'+_0x36cab6['query'][_0xd686('0x3b')]+'%'};return _0x546d77;})});}_0x34431f=_['merge']({},_0x34431f,_0x36cab6[_0xd686('0x46')]);return _0x46f079['getFields'](_0x34431f);}})[_0xd686('0x24')](function(_0x1f65b3){if(_0x1f65b3){_0x57beb2=_0x1f65b3[_0xd686('0x35')];if(!_0x36cab6[_0xd686('0x2e')]['hasOwnProperty']('nolimit')){_0x34431f['limit']=qs[_0xd686('0x1a')](_0x36cab6[_0xd686('0x2e')]['limit']);_0x34431f[_0xd686('0x19')]=qs['offset'](_0x36cab6['query'][_0xd686('0x19')]);}return _0x46f079[_0xd686('0x4b')](_0x34431f);}})[_0xd686('0x24')](function(_0x500a4a){if(_0x500a4a){return _0x500a4a?{'count':_0x57beb2,'rows':_0x500a4a}:null;}})[_0xd686('0x24')](respondWithResult(_0xc71b9d,null))[_0xd686('0x42')](handleError(_0xc71b9d,null));};exports['getSubjects']=function(_0x43263c,_0x140806,_0x29acc7){var _0x4b4321={};var _0x9b107b={};var _0x50e6c2;var _0x1dcd66;return db[_0xd686('0x2a')][_0xd686('0x4c')]({'where':{'id':_0x43263c[_0xd686('0x4a')]['id']}})[_0xd686('0x24')](handleEntityNotFound(_0x140806,null))[_0xd686('0x24')](function(_0xbd4473){if(_0xbd4473){_0x50e6c2=_0xbd4473;_0x9b107b['model']=_[_0xd686('0x2f')](db[_0xd686('0x4d')]['rawAttributes']);_0x9b107b[_0xd686('0x2e')]=_[_0xd686('0x2f')](_0x43263c['query']);_0x9b107b[_0xd686('0x30')]=_['intersection'](_0x9b107b[_0xd686('0x32')],_0x9b107b['query']);_0x4b4321[_0xd686('0x33')]=_['intersection'](_0x9b107b[_0xd686('0x32')],qs[_0xd686('0x34')](_0x43263c['query'][_0xd686('0x34')]));_0x4b4321[_0xd686('0x33')]=_0x4b4321[_0xd686('0x33')][_0xd686('0x35')]?_0x4b4321[_0xd686('0x33')]:_0x9b107b['model'];_0x4b4321[_0xd686('0x38')]=qs['sort'](_0x43263c[_0xd686('0x2e')]['sort']);_0x4b4321[_0xd686('0x3d')]=qs[_0xd686('0x30')](_[_0xd686('0x3a')](_0x43263c[_0xd686('0x2e')],_0x9b107b[_0xd686('0x30')]));if(_0x43263c['query']['filter']){_0x4b4321['where']=_[_0xd686('0x3c')](_0x4b4321[_0xd686('0x3d')],{'$or':_[_0xd686('0x29')](_0x4b4321[_0xd686('0x33')],function(_0x1db992){var _0x5f359c={};_0x5f359c[_0x1db992]={'$like':'%'+_0x43263c[_0xd686('0x2e')][_0xd686('0x3b')]+'%'};return _0x5f359c;})});}_0x4b4321=_[_0xd686('0x3c')]({},_0x4b4321,_0x43263c[_0xd686('0x46')]);return _0x50e6c2[_0xd686('0x4e')](_0x4b4321);}})[_0xd686('0x24')](function(_0x19bd18){if(_0x19bd18){_0x1dcd66=_0x19bd18[_0xd686('0x35')];if(!_0x43263c[_0xd686('0x2e')][_0xd686('0x36')](_0xd686('0x37'))){_0x4b4321[_0xd686('0x1a')]=qs[_0xd686('0x1a')](_0x43263c[_0xd686('0x2e')][_0xd686('0x1a')]);_0x4b4321['offset']=qs[_0xd686('0x19')](_0x43263c[_0xd686('0x2e')]['offset']);}return _0x50e6c2[_0xd686('0x4e')](_0x4b4321);}})[_0xd686('0x24')](function(_0xf065c0){if(_0xf065c0){return _0xf065c0?{'count':_0x1dcd66,'rows':_0xf065c0}:null;}})[_0xd686('0x24')](respondWithResult(_0x140806,null))[_0xd686('0x42')](handleError(_0x140806,null));};exports[_0xd686('0x4f')]=function(_0x36f3ae,_0x246590,_0x505f01){var _0xc86e39={};var _0x1ef2b8={};var _0x47b860;var _0x57c07b;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x36f3ae['params']['id']}})[_0xd686('0x24')](handleEntityNotFound(_0x246590,null))[_0xd686('0x24')](function(_0x203b7d){if(_0x203b7d){_0x47b860=_0x203b7d;_0x1ef2b8[_0xd686('0x32')]=_[_0xd686('0x2f')](db[_0xd686('0x4d')]['rawAttributes']);_0x1ef2b8[_0xd686('0x2e')]=_[_0xd686('0x2f')](_0x36f3ae[_0xd686('0x2e')]);_0x1ef2b8['filters']=_[_0xd686('0x31')](_0x1ef2b8[_0xd686('0x32')],_0x1ef2b8[_0xd686('0x2e')]);_0xc86e39[_0xd686('0x33')]=_[_0xd686('0x31')](_0x1ef2b8['model'],qs[_0xd686('0x34')](_0x36f3ae[_0xd686('0x2e')]['fields']));_0xc86e39['attributes']=_0xc86e39['attributes']['length']?_0xc86e39[_0xd686('0x33')]:_0x1ef2b8[_0xd686('0x32')];_0xc86e39[_0xd686('0x38')]=qs[_0xd686('0x39')](_0x36f3ae[_0xd686('0x2e')][_0xd686('0x39')]);_0xc86e39[_0xd686('0x3d')]=qs['filters'](_[_0xd686('0x3a')](_0x36f3ae['query'],_0x1ef2b8['filters']));if(_0x36f3ae[_0xd686('0x2e')][_0xd686('0x3b')]){_0xc86e39[_0xd686('0x3d')]=_[_0xd686('0x3c')](_0xc86e39[_0xd686('0x3d')],{'$or':_['map'](_0xc86e39[_0xd686('0x33')],function(_0x2a36d4){var _0x4ad6a7={};_0x4ad6a7[_0x2a36d4]={'$like':'%'+_0x36f3ae[_0xd686('0x2e')][_0xd686('0x3b')]+'%'};return _0x4ad6a7;})});}_0xc86e39=_[_0xd686('0x3c')]({},_0xc86e39,_0x36f3ae[_0xd686('0x46')]);return _0x47b860[_0xd686('0x4f')](_0xc86e39);}})['then'](function(_0x35e1c1){if(_0x35e1c1){_0x57c07b=_0x35e1c1[_0xd686('0x35')];if(!_0x36f3ae[_0xd686('0x2e')][_0xd686('0x36')](_0xd686('0x37'))){_0xc86e39[_0xd686('0x1a')]=qs[_0xd686('0x1a')](_0x36f3ae[_0xd686('0x2e')]['limit']);_0xc86e39[_0xd686('0x19')]=qs[_0xd686('0x19')](_0x36f3ae[_0xd686('0x2e')][_0xd686('0x19')]);}return _0x47b860[_0xd686('0x4f')](_0xc86e39);}})['then'](function(_0x244d0b){if(_0x244d0b){return _0x244d0b?{'count':_0x57c07b,'rows':_0x244d0b}:null;}})[_0xd686('0x24')](respondWithResult(_0x246590,null))[_0xd686('0x42')](handleError(_0x246590,null));}; \ No newline at end of file +var _0x1fca=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','catch','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x917159,_0x4920a8){var _0x2bd31e=function(_0x6dce0e){while(--_0x6dce0e){_0x917159['push'](_0x917159['shift']());}};_0x2bd31e(++_0x4920a8);}(_0x1fca,0x138));var _0xa1fc=function(_0xa18e4,_0x4b7825){_0xa18e4=_0xa18e4-0x0;var _0x751ac8=_0x1fca[_0xa18e4];return _0x751ac8;};'use strict';var emlformat=require(_0xa1fc('0x0'));var rimraf=require(_0xa1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1fc('0x2'));var moment=require(_0xa1fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1fc('0x4'));var util=require(_0xa1fc('0x5'));var path=require(_0xa1fc('0x6'));var sox=require(_0xa1fc('0x7'));var csv=require(_0xa1fc('0x8'));var ejs=require(_0xa1fc('0x9'));var fs=require('fs');var fs_extra=require(_0xa1fc('0xa'));var _=require(_0xa1fc('0xb'));var squel=require(_0xa1fc('0xc'));var crypto=require(_0xa1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa1fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1fc('0xf'));var Papa=require(_0xa1fc('0x10'));var Redis=require(_0xa1fc('0x11'));var authService=require(_0xa1fc('0x12'));var qs=require(_0xa1fc('0x13'));var as=require(_0xa1fc('0x14'));var hardwareService=require(_0xa1fc('0x15'));var logger=require(_0xa1fc('0x16'))(_0xa1fc('0x17'));var utils=require(_0xa1fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa1fc('0x19'));var db=require(_0xa1fc('0x1a'))['db'];function respondWithStatusCode(_0x3d05f3,_0x28de26){_0x28de26=_0x28de26||0xcc;return function(_0x5be976){if(_0x5be976){return _0x3d05f3[_0xa1fc('0x1b')](_0x28de26);}return _0x3d05f3['status'](_0x28de26)[_0xa1fc('0x1c')]();};}function respondWithResult(_0x5dc940,_0xd2cae8){_0xd2cae8=_0xd2cae8||0xc8;return function(_0x4db77f){if(_0x4db77f){return _0x5dc940[_0xa1fc('0x1d')](_0xd2cae8)['json'](_0x4db77f);}};}function respondWithFilteredResult(_0x4d645f,_0x9d82a1){return function(_0x24b3b7){if(_0x24b3b7){var _0x267f65=typeof _0x9d82a1['offset']==='undefined'&&typeof _0x9d82a1['limit']===_0xa1fc('0x1e');var _0x49d81a=_0x24b3b7[_0xa1fc('0x1f')];var _0x489e92=_0x267f65?0x0:_0x9d82a1['offset'];var _0x537839=_0x267f65?_0x24b3b7[_0xa1fc('0x1f')]:_0x9d82a1[_0xa1fc('0x20')]+_0x9d82a1[_0xa1fc('0x21')];var _0x29f3ea;if(_0x537839>=_0x49d81a){_0x537839=_0x49d81a;_0x29f3ea=0xc8;}else{_0x29f3ea=0xce;}_0x4d645f[_0xa1fc('0x1d')](_0x29f3ea);return _0x4d645f[_0xa1fc('0x22')](_0xa1fc('0x23'),_0x489e92+'-'+_0x537839+'/'+_0x49d81a)['json'](_0x24b3b7);}return null;};}function patchUpdates(_0x3a3f36){return function(_0x195aa4){try{jsonpatch['apply'](_0x195aa4,_0x3a3f36,!![]);}catch(_0x17fe8f){return BPromise[_0xa1fc('0x24')](_0x17fe8f);}return _0x195aa4[_0xa1fc('0x25')]();};}function saveUpdates(_0x52ce54,_0x9b5d9c){return function(_0x6a54bd){if(_0x6a54bd){return _0x6a54bd[_0xa1fc('0x26')](_0x52ce54)[_0xa1fc('0x27')](function(_0x39aab5){return _0x39aab5;});}return null;};}function removeEntity(_0x1074b1,_0x35b004){return function(_0x384aec){if(_0x384aec){return _0x384aec[_0xa1fc('0x28')]()['then'](function(){_0x1074b1[_0xa1fc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34211c,_0x46286c){return function(_0x39e608){if(!_0x39e608){_0x34211c[_0xa1fc('0x1b')](0x194);}return _0x39e608;};}function handleError(_0x521d9e,_0x33f3c4){_0x33f3c4=_0x33f3c4||0x1f4;return function(_0x48bdbe){logger['error'](_0x48bdbe[_0xa1fc('0x29')]);if(_0x48bdbe[_0xa1fc('0x2a')]){delete _0x48bdbe['name'];}_0x521d9e[_0xa1fc('0x1d')](_0x33f3c4)[_0xa1fc('0x2b')](_0x48bdbe);};}exports[_0xa1fc('0x2c')]=function(_0x16463b,_0x59027e){var _0x1719dc={},_0x4b74db={},_0x3533fb={'count':0x0,'rows':[]};var _0x525816=_[_0xa1fc('0x2d')](db[_0xa1fc('0x2e')]['rawAttributes'],function(_0x56e6af){return{'name':_0x56e6af[_0xa1fc('0x2f')],'type':_0x56e6af[_0xa1fc('0x30')][_0xa1fc('0x31')]};});_0x4b74db[_0xa1fc('0x32')]=_[_0xa1fc('0x2d')](_0x525816,_0xa1fc('0x2a'));_0x4b74db[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x16463b[_0xa1fc('0x33')]);_0x4b74db[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x4b74db['model'],_0x4b74db[_0xa1fc('0x33')]);_0x1719dc[_0xa1fc('0x37')]=_['intersection'](_0x4b74db[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x16463b['query'][_0xa1fc('0x38')]));_0x1719dc[_0xa1fc('0x37')]=_0x1719dc[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x1719dc[_0xa1fc('0x37')]:_0x4b74db[_0xa1fc('0x32')];if(!_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x1719dc[_0xa1fc('0x21')]=qs['limit'](_0x16463b[_0xa1fc('0x33')]['limit']);_0x1719dc[_0xa1fc('0x20')]=qs[_0xa1fc('0x20')](_0x16463b[_0xa1fc('0x33')]['offset']);}_0x1719dc[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3d')](_0x16463b[_0xa1fc('0x33')]['sort']);_0x1719dc[_0xa1fc('0x3e')]=qs['filters'](_[_0xa1fc('0x3f')](_0x16463b[_0xa1fc('0x33')],_0x4b74db['filters']),_0x525816);if(_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x1719dc[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x1719dc[_0xa1fc('0x3e')],{'$or':_['map'](_0x525816,function(_0x317395){if(_0x317395['type']!==_0xa1fc('0x42')){var _0x346713={};_0x346713[_0x317395['name']]={'$like':'%'+_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0x346713;}})});}_0x1719dc=_[_0xa1fc('0x41')]({},_0x1719dc,_0x16463b[_0xa1fc('0x43')]);var _0x3ea6d8={'where':_0x1719dc[_0xa1fc('0x3e')]};return db['SalesforceConfiguration'][_0xa1fc('0x1f')](_0x3ea6d8)[_0xa1fc('0x27')](function(_0x3eea4c){_0x3533fb[_0xa1fc('0x1f')]=_0x3eea4c;if(_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x44')]){_0x1719dc[_0xa1fc('0x45')]=[{'all':!![]}];}return db[_0xa1fc('0x2e')]['findAll'](_0x1719dc);})[_0xa1fc('0x27')](function(_0x1dcab2){_0x3533fb['rows']=_0x1dcab2;return _0x3533fb;})[_0xa1fc('0x27')](respondWithFilteredResult(_0x59027e,_0x1719dc))['catch'](handleError(_0x59027e,null));};exports[_0xa1fc('0x46')]=function(_0x237a5a,_0xa054e1){var _0x294591={'raw':![],'where':{'id':_0x237a5a[_0xa1fc('0x47')]['id']}},_0x52af01={};_0x52af01[_0xa1fc('0x32')]=_[_0xa1fc('0x34')](db[_0xa1fc('0x2e')][_0xa1fc('0x48')]);_0x52af01[_0xa1fc('0x33')]=_['keys'](_0x237a5a[_0xa1fc('0x33')]);_0x52af01['filters']=_[_0xa1fc('0x36')](_0x52af01['model'],_0x52af01[_0xa1fc('0x33')]);_0x294591[_0xa1fc('0x37')]=_['intersection'](_0x52af01[_0xa1fc('0x32')],qs['fields'](_0x237a5a['query']['fields']));_0x294591['attributes']=_0x294591[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x294591['attributes']:_0x52af01['model'];if(_0x237a5a[_0xa1fc('0x33')]['includeAll']){_0x294591[_0xa1fc('0x45')]=[{'all':!![]}];}_0x294591=_[_0xa1fc('0x41')]({},_0x294591,_0x237a5a['options']);return db[_0xa1fc('0x2e')][_0xa1fc('0x49')](_0x294591)[_0xa1fc('0x27')](handleEntityNotFound(_0xa054e1,null))[_0xa1fc('0x27')](respondWithResult(_0xa054e1,null))['catch'](handleError(_0xa054e1,null));};exports[_0xa1fc('0x4a')]=function(_0x4eb5f1,_0x5d6ea7){return db[_0xa1fc('0x2e')]['create'](_0x4eb5f1[_0xa1fc('0x4b')],{})['then'](respondWithResult(_0x5d6ea7,0xc9))[_0xa1fc('0x4c')](handleError(_0x5d6ea7,null));};exports[_0xa1fc('0x26')]=function(_0x1f2853,_0x486130){if(_0x1f2853['body']['id']){delete _0x1f2853[_0xa1fc('0x4b')]['id'];}return db[_0xa1fc('0x2e')][_0xa1fc('0x49')]({'where':{'id':_0x1f2853['params']['id']}})['then'](handleEntityNotFound(_0x486130,null))['then'](saveUpdates(_0x1f2853['body'],null))['then'](respondWithResult(_0x486130,null))[_0xa1fc('0x4c')](handleError(_0x486130,null));};exports[_0xa1fc('0x28')]=function(_0x4d2424,_0x4f274a){return db[_0xa1fc('0x2e')][_0xa1fc('0x49')]({'where':{'id':_0x4d2424[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x4f274a,null))[_0xa1fc('0x27')](removeEntity(_0x4f274a,null))[_0xa1fc('0x4c')](handleError(_0x4f274a,null));};exports[_0xa1fc('0x4d')]=function(_0x626a33,_0x59d6da,_0x34cf8f){var _0x5adf52={};var _0x1ff927={};var _0x32f467;var _0x271642;return db[_0xa1fc('0x2e')][_0xa1fc('0x4e')]({'where':{'id':_0x626a33[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x59d6da,null))[_0xa1fc('0x27')](function(_0x56d59b){if(_0x56d59b){_0x32f467=_0x56d59b;_0x1ff927['model']=_[_0xa1fc('0x34')](db['SalesforceField'][_0xa1fc('0x48')]);_0x1ff927[_0xa1fc('0x33')]=_['keys'](_0x626a33[_0xa1fc('0x33')]);_0x1ff927[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x1ff927[_0xa1fc('0x32')],_0x1ff927[_0xa1fc('0x33')]);_0x5adf52[_0xa1fc('0x37')]=_['intersection'](_0x1ff927[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x626a33[_0xa1fc('0x33')]['fields']));_0x5adf52[_0xa1fc('0x37')]=_0x5adf52[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x5adf52[_0xa1fc('0x37')]:_0x1ff927[_0xa1fc('0x32')];_0x5adf52[_0xa1fc('0x3c')]=qs['sort'](_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x5adf52[_0xa1fc('0x3e')]=qs[_0xa1fc('0x35')](_['pick'](_0x626a33[_0xa1fc('0x33')],_0x1ff927['filters']));if(_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x5adf52[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x5adf52[_0xa1fc('0x3e')],{'$or':_[_0xa1fc('0x2d')](_0x5adf52[_0xa1fc('0x37')],function(_0x2b2758){var _0xea7786={};_0xea7786[_0x2b2758]={'$like':'%'+_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0xea7786;})});}_0x5adf52=_[_0xa1fc('0x41')]({},_0x5adf52,_0x626a33[_0xa1fc('0x43')]);return _0x32f467[_0xa1fc('0x4d')](_0x5adf52);}})['then'](function(_0x13b3ae){if(_0x13b3ae){_0x271642=_0x13b3ae[_0xa1fc('0x39')];if(!_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x5adf52[_0xa1fc('0x21')]=qs[_0xa1fc('0x21')](_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x21')]);_0x5adf52['offset']=qs[_0xa1fc('0x20')](_0x626a33['query'][_0xa1fc('0x20')]);}return _0x32f467[_0xa1fc('0x4d')](_0x5adf52);}})[_0xa1fc('0x27')](function(_0x416db6){if(_0x416db6){return _0x416db6?{'count':_0x271642,'rows':_0x416db6}:null;}})[_0xa1fc('0x27')](respondWithResult(_0x59d6da,null))[_0xa1fc('0x4c')](handleError(_0x59d6da,null));};exports[_0xa1fc('0x4f')]=function(_0x4b8573,_0x56bffc,_0x21cc5c){var _0x43e7b1={};var _0x3f64c3={};var _0x5c2261;var _0x4bb8ec;return db['SalesforceConfiguration'][_0xa1fc('0x4e')]({'where':{'id':_0x4b8573[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x56bffc,null))[_0xa1fc('0x27')](function(_0x3efd46){if(_0x3efd46){_0x5c2261=_0x3efd46;_0x3f64c3['model']=_['keys'](db[_0xa1fc('0x50')]['rawAttributes']);_0x3f64c3[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x4b8573[_0xa1fc('0x33')]);_0x3f64c3[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x3f64c3[_0xa1fc('0x32')],_0x3f64c3['query']);_0x43e7b1[_0xa1fc('0x37')]=_[_0xa1fc('0x36')](_0x3f64c3[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x4b8573['query']['fields']));_0x43e7b1['attributes']=_0x43e7b1[_0xa1fc('0x37')]['length']?_0x43e7b1[_0xa1fc('0x37')]:_0x3f64c3[_0xa1fc('0x32')];_0x43e7b1[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3d')](_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x43e7b1['where']=qs[_0xa1fc('0x35')](_[_0xa1fc('0x3f')](_0x4b8573['query'],_0x3f64c3[_0xa1fc('0x35')]));if(_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x43e7b1[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x43e7b1['where'],{'$or':_[_0xa1fc('0x2d')](_0x43e7b1[_0xa1fc('0x37')],function(_0x1ad7d0){var _0x4a62ea={};_0x4a62ea[_0x1ad7d0]={'$like':'%'+_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0x4a62ea;})});}_0x43e7b1=_['merge']({},_0x43e7b1,_0x4b8573[_0xa1fc('0x43')]);return _0x5c2261[_0xa1fc('0x4f')](_0x43e7b1);}})['then'](function(_0xdc0104){if(_0xdc0104){_0x4bb8ec=_0xdc0104[_0xa1fc('0x39')];if(!_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x43e7b1[_0xa1fc('0x21')]=qs['limit'](_0x4b8573[_0xa1fc('0x33')]['limit']);_0x43e7b1['offset']=qs[_0xa1fc('0x20')](_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x20')]);}return _0x5c2261[_0xa1fc('0x4f')](_0x43e7b1);}})[_0xa1fc('0x27')](function(_0x571398){if(_0x571398){return _0x571398?{'count':_0x4bb8ec,'rows':_0x571398}:null;}})[_0xa1fc('0x27')](respondWithResult(_0x56bffc,null))[_0xa1fc('0x4c')](handleError(_0x56bffc,null));};exports[_0xa1fc('0x51')]=function(_0x5aa524,_0x1775e9,_0x35a681){var _0x39ca65={};var _0x1e9da5={};var _0x11fa55;var _0x34aef7;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5aa524[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x1775e9,null))[_0xa1fc('0x27')](function(_0x45368c){if(_0x45368c){_0x11fa55=_0x45368c;_0x1e9da5['model']=_['keys'](db[_0xa1fc('0x50')][_0xa1fc('0x48')]);_0x1e9da5[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x5aa524[_0xa1fc('0x33')]);_0x1e9da5[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x1e9da5['model'],_0x1e9da5['query']);_0x39ca65['attributes']=_[_0xa1fc('0x36')](_0x1e9da5[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x38')]));_0x39ca65[_0xa1fc('0x37')]=_0x39ca65[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x39ca65[_0xa1fc('0x37')]:_0x1e9da5[_0xa1fc('0x32')];_0x39ca65[_0xa1fc('0x3c')]=qs['sort'](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x39ca65[_0xa1fc('0x3e')]=qs[_0xa1fc('0x35')](_[_0xa1fc('0x3f')](_0x5aa524['query'],_0x1e9da5[_0xa1fc('0x35')]));if(_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x39ca65['where']=_[_0xa1fc('0x41')](_0x39ca65[_0xa1fc('0x3e')],{'$or':_[_0xa1fc('0x2d')](_0x39ca65[_0xa1fc('0x37')],function(_0x260e88){var _0x5bb263={};_0x5bb263[_0x260e88]={'$like':'%'+_0x5aa524['query'][_0xa1fc('0x40')]+'%'};return _0x5bb263;})});}_0x39ca65=_[_0xa1fc('0x41')]({},_0x39ca65,_0x5aa524['options']);return _0x11fa55['getDescriptions'](_0x39ca65);}})[_0xa1fc('0x27')](function(_0x2d0d20){if(_0x2d0d20){_0x34aef7=_0x2d0d20[_0xa1fc('0x39')];if(!_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x39ca65[_0xa1fc('0x21')]=qs[_0xa1fc('0x21')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x21')]);_0x39ca65[_0xa1fc('0x20')]=qs[_0xa1fc('0x20')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x20')]);}return _0x11fa55[_0xa1fc('0x51')](_0x39ca65);}})[_0xa1fc('0x27')](function(_0x315998){if(_0x315998){return _0x315998?{'count':_0x34aef7,'rows':_0x315998}:null;}})['then'](respondWithResult(_0x1775e9,null))['catch'](handleError(_0x1775e9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e171854..bce8b6a 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 _0xed27=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x2cb64a,_0x12a79b){var _0x2d198b=function(_0xa39c32){while(--_0xa39c32){_0x2cb64a['push'](_0x2cb64a['shift']());}};_0x2d198b(++_0x12a79b);}(_0xed27,0x178));var _0x7ed2=function(_0x2ab30a,_0x88db9d){_0x2ab30a=_0x2ab30a-0x0;var _0xe98270=_0xed27[_0x2ab30a];return _0xe98270;};'use strict';var _=require(_0x7ed2('0x0'));var util=require('util');var logger=require(_0x7ed2('0x1'))(_0x7ed2('0x2'));var moment=require(_0x7ed2('0x3'));var BPromise=require(_0x7ed2('0x4'));var rp=require(_0x7ed2('0x5'));var fs=require('fs');var path=require(_0x7ed2('0x6'));var rimraf=require(_0x7ed2('0x7'));var config=require(_0x7ed2('0x8'));var attributes=require(_0x7ed2('0x9'));module['exports']=function(_0x48e88a,_0x4ab0cf){return _0x48e88a[_0x7ed2('0xa')](_0x7ed2('0xb'),attributes,{'tableName':_0x7ed2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55c8=['api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x3f1f70,_0x353494){var _0x264ef6=function(_0x3038fe){while(--_0x3038fe){_0x3f1f70['push'](_0x3f1f70['shift']());}};_0x264ef6(++_0x353494);}(_0x55c8,0x1c7));var _0x855c=function(_0x1b155f,_0x622157){_0x1b155f=_0x1b155f-0x0;var _0x25dc24=_0x55c8[_0x1b155f];return _0x25dc24;};'use strict';var _=require('lodash');var util=require(_0x855c('0x0'));var logger=require('../../config/logger')(_0x855c('0x1'));var moment=require(_0x855c('0x2'));var BPromise=require(_0x855c('0x3'));var rp=require(_0x855c('0x4'));var fs=require('fs');var path=require(_0x855c('0x5'));var rimraf=require('rimraf');var config=require(_0x855c('0x6'));var attributes=require(_0x855c('0x7'));module[_0x855c('0x8')]=function(_0x4a8a6b,_0x212eb2){return _0x4a8a6b[_0x855c('0x9')](_0x855c('0xa'),attributes,{'tableName':_0x855c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index a0c1aba..be649ed 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 _0xa343=['debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0xa343,0x102));var _0x3a34=function(_0x58e19c,_0x17b34e){_0x58e19c=_0x58e19c-0x0;var _0x536652=_0xa343[_0x58e19c];return _0x536652;};'use strict';var _=require('lodash');var util=require(_0x3a34('0x0'));var moment=require(_0x3a34('0x1'));var BPromise=require(_0x3a34('0x2'));var rs=require(_0x3a34('0x3'));var fs=require('fs');var Redis=require(_0x3a34('0x4'));var db=require(_0x3a34('0x5'))['db'];var utils=require(_0x3a34('0x6'));var logger=require('../../config/logger')(_0x3a34('0x7'));var config=require('../../config/environment');var jayson=require(_0x3a34('0x8'));var client=jayson[_0x3a34('0x9')][_0x3a34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cea21,_0x477ce1,_0x157e8b){return new BPromise(function(_0x42edbd,_0x37a0a3){return client[_0x3a34('0xb')](_0x1cea21,_0x157e8b)[_0x3a34('0xc')](function(_0x27e98b){logger['info'](_0x3a34('0xd'),_0x477ce1,_0x3a34('0xe'));logger[_0x3a34('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x477ce1,_0x3a34('0xe'),JSON[_0x3a34('0x10')](_0x27e98b));if(_0x27e98b[_0x3a34('0x11')]){if(_0x27e98b[_0x3a34('0x11')][_0x3a34('0x12')]===0x1f4){logger[_0x3a34('0x11')](_0x3a34('0xd'),_0x477ce1,_0x27e98b[_0x3a34('0x11')][_0x3a34('0x13')]);return _0x37a0a3(_0x27e98b[_0x3a34('0x11')][_0x3a34('0x13')]);}logger[_0x3a34('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x477ce1,_0x27e98b[_0x3a34('0x11')][_0x3a34('0x13')]);return _0x42edbd(_0x27e98b[_0x3a34('0x11')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x477ce1,_0x3a34('0xe'));_0x42edbd(_0x27e98b[_0x3a34('0x14')][_0x3a34('0x13')]);}})['catch'](function(_0xc00ae){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x477ce1,_0xc00ae);_0x37a0a3(_0xc00ae);});});} \ No newline at end of file +var _0x645d=['jayson/promise','http','request','then','request\x20sent','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x645d,0x13c));var _0xd645=function(_0x419c4a,_0x5d525d){_0x419c4a=_0x419c4a-0x0;var _0x4dae37=_0x645d[_0x419c4a];return _0x4dae37;};'use strict';var _=require(_0xd645('0x0'));var util=require(_0xd645('0x1'));var moment=require('moment');var BPromise=require(_0xd645('0x2'));var rs=require(_0xd645('0x3'));var fs=require('fs');var Redis=require(_0xd645('0x4'));var db=require(_0xd645('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd645('0x6'))('rpc');var config=require(_0xd645('0x7'));var jayson=require(_0xd645('0x8'));var client=jayson['client'][_0xd645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d113a,_0x547444,_0x546510){return new BPromise(function(_0x1c02e6,_0x1f4077){return client[_0xd645('0xa')](_0x5d113a,_0x546510)[_0xd645('0xb')](function(_0x287e27){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,_0xd645('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x547444,'request\x20sent',JSON[_0xd645('0xd')](_0x287e27));if(_0x287e27['error']){if(_0x287e27[_0xd645('0xe')]['code']===0x1f4){logger[_0xd645('0xe')](_0xd645('0xf'),_0x547444,_0x287e27['error'][_0xd645('0x10')]);return _0x1f4077(_0x287e27['error'][_0xd645('0x10')]);}logger[_0xd645('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,_0x287e27[_0xd645('0xe')][_0xd645('0x10')]);return _0x1c02e6(_0x287e27[_0xd645('0xe')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,'request\x20sent');_0x1c02e6(_0x287e27['result'][_0xd645('0x10')]);}})[_0xd645('0x11')](function(_0x481076){logger[_0xd645('0xe')](_0xd645('0xf'),_0x547444,_0x481076);_0x1f4077(_0x481076);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 077d9ce..39d46bb 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 _0x7faf=['isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller'];(function(_0x457bc6,_0x431adc){var _0x337f06=function(_0x158788){while(--_0x158788){_0x457bc6['push'](_0x457bc6['shift']());}};_0x337f06(++_0x431adc);}(_0x7faf,0x170));var _0xf7fa=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7faf[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xf7fa('0x0'));var util=require(_0xf7fa('0x1'));var path=require(_0xf7fa('0x2'));var timeout=require(_0xf7fa('0x3'));var express=require(_0xf7fa('0x4'));var router=express[_0xf7fa('0x5')]();var fs_extra=require(_0xf7fa('0x6'));var auth=require(_0xf7fa('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf7fa('0x8'));var controller=require(_0xf7fa('0x9'));router['get']('/',auth[_0xf7fa('0xa')](),controller[_0xf7fa('0xb')]);router[_0xf7fa('0xc')](_0xf7fa('0xd'),auth[_0xf7fa('0xa')](),controller['show']);router[_0xf7fa('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7fa('0xf')]);router[_0xf7fa('0x10')]('/:id',auth[_0xf7fa('0xa')](),controller[_0xf7fa('0x11')]);router[_0xf7fa('0x12')]('/:id',auth[_0xf7fa('0xa')](),controller[_0xf7fa('0x13')]);module[_0xf7fa('0x14')]=router; \ No newline at end of file +var _0x6f70=['show','create','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x31fdaf,_0x6cdd12){var _0x1a7a61=function(_0x492c97){while(--_0x492c97){_0x31fdaf['push'](_0x31fdaf['shift']());}};_0x1a7a61(++_0x6cdd12);}(_0x6f70,0x1ec));var _0x06f7=function(_0x37a590,_0x3a8e40){_0x37a590=_0x37a590-0x0;var _0x1e3477=_0x6f70[_0x37a590];return _0x1e3477;};'use strict';var multer=require(_0x06f7('0x0'));var util=require(_0x06f7('0x1'));var path=require(_0x06f7('0x2'));var timeout=require(_0x06f7('0x3'));var express=require('express');var router=express[_0x06f7('0x4')]();var fs_extra=require(_0x06f7('0x5'));var auth=require(_0x06f7('0x6'));var interaction=require(_0x06f7('0x7'));var config=require(_0x06f7('0x8'));var controller=require(_0x06f7('0x9'));router[_0x06f7('0xa')]('/',auth[_0x06f7('0xb')](),controller['index']);router[_0x06f7('0xa')]('/:id',auth[_0x06f7('0xb')](),controller[_0x06f7('0xc')]);router['post']('/',auth[_0x06f7('0xb')](),controller[_0x06f7('0xd')]);router['put']('/:id',auth[_0x06f7('0xb')](),controller[_0x06f7('0xe')]);router[_0x06f7('0xf')](_0x06f7('0x10'),auth[_0x06f7('0xb')](),controller['destroy']);module[_0x06f7('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 ebefd18..a6fdd47 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 _0xfb0b=['ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x572706,_0xadcdb5){var _0x556ee9=function(_0x5c174b){while(--_0x5c174b){_0x572706['push'](_0x572706['shift']());}};_0x556ee9(++_0xadcdb5);}(_0xfb0b,0x1c7));var _0xbfb0=function(_0xc2a1ef,_0x4cb18e){_0xc2a1ef=_0xc2a1ef-0x0;var _0x1581d4=_0xfb0b[_0xc2a1ef];return _0x1581d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xbfb0('0x0')]('string',_0xbfb0('0x1'),_0xbfb0('0x2'),_0xbfb0('0x3'),_0xbfb0('0x4')),'defaultValue':_0xbfb0('0x5')},'content':{'type':Sequelize[_0xbfb0('0x6')]},'key':{'type':Sequelize[_0xbfb0('0x6')]},'keyType':{'type':Sequelize[_0xbfb0('0x0')]('string',_0xbfb0('0x1'),_0xbfb0('0x2'))},'keyContent':{'type':Sequelize[_0xbfb0('0x6')]},'idField':{'type':Sequelize[_0xbfb0('0x6')]},'variableName':{'type':Sequelize[_0xbfb0('0x6')]}}; \ No newline at end of file +var _0xc12e=['ENUM','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc12e,0x1cd));var _0xec12=function(_0xcf0d44,_0x2aa898){_0xcf0d44=_0xcf0d44-0x0;var _0x4a1f12=_0xc12e[_0xcf0d44];return _0x4a1f12;};'use strict';var Sequelize=require(_0xec12('0x0'));module['exports']={'type':{'type':Sequelize[_0xec12('0x1')]('string',_0xec12('0x2'),_0xec12('0x3'),_0xec12('0x4'),_0xec12('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xec12('0x6')]},'key':{'type':Sequelize[_0xec12('0x6')]},'keyType':{'type':Sequelize[_0xec12('0x1')]('string','variable',_0xec12('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec12('0x6')]},'variableName':{'type':Sequelize[_0xec12('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 391956e..56f78a0 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 _0x1caa=['includeAll','include','findAll','rows','show','params','rawAttributes','attributes','create','catch','body','destroy','find','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','error','name','send','index','map','fieldName','model','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','type','filter','options','SalesforceField'];(function(_0x43790f,_0x833895){var _0xf241e0=function(_0xccd061){while(--_0xccd061){_0x43790f['push'](_0x43790f['shift']());}};_0xf241e0(++_0x833895);}(_0x1caa,0xa3));var _0xa1ca=function(_0x5f598a,_0x20a4c3){_0x5f598a=_0x5f598a-0x0;var _0x29bc79=_0x1caa[_0x5f598a];return _0x29bc79;};'use strict';var emlformat=require(_0xa1ca('0x0'));var rimraf=require(_0xa1ca('0x1'));var zipdir=require(_0xa1ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa1ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1ca('0x4'));var util=require(_0xa1ca('0x5'));var path=require(_0xa1ca('0x6'));var sox=require(_0xa1ca('0x7'));var csv=require('to-csv');var ejs=require(_0xa1ca('0x8'));var fs=require('fs');var fs_extra=require(_0xa1ca('0x9'));var _=require(_0xa1ca('0xa'));var squel=require(_0xa1ca('0xb'));var crypto=require(_0xa1ca('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa1ca('0xd'));var toCsv=require(_0xa1ca('0xe'));var querystring=require(_0xa1ca('0xf'));var Papa=require(_0xa1ca('0x10'));var Redis=require('ioredis');var authService=require(_0xa1ca('0x11'));var qs=require(_0xa1ca('0x12'));var as=require(_0xa1ca('0x13'));var hardwareService=require(_0xa1ca('0x14'));var logger=require(_0xa1ca('0x15'))(_0xa1ca('0x16'));var utils=require(_0xa1ca('0x17'));var config=require(_0xa1ca('0x18'));var licenseUtil=require(_0xa1ca('0x19'));var db=require(_0xa1ca('0x1a'))['db'];function respondWithStatusCode(_0x3ad97d,_0x1512fa){_0x1512fa=_0x1512fa||0xcc;return function(_0x686e11){if(_0x686e11){return _0x3ad97d[_0xa1ca('0x1b')](_0x1512fa);}return _0x3ad97d[_0xa1ca('0x1c')](_0x1512fa)[_0xa1ca('0x1d')]();};}function respondWithResult(_0xdb84f3,_0x5cf0a6){_0x5cf0a6=_0x5cf0a6||0xc8;return function(_0x2c0ee9){if(_0x2c0ee9){return _0xdb84f3[_0xa1ca('0x1c')](_0x5cf0a6)[_0xa1ca('0x1e')](_0x2c0ee9);}};}function respondWithFilteredResult(_0x51dddf,_0x1d7415){return function(_0x3e62ff){if(_0x3e62ff){var _0x520a18=typeof _0x1d7415[_0xa1ca('0x1f')]===_0xa1ca('0x20')&&typeof _0x1d7415['limit']===_0xa1ca('0x20');var _0x520a92=_0x3e62ff[_0xa1ca('0x21')];var _0x1ae5b9=_0x520a18?0x0:_0x1d7415[_0xa1ca('0x1f')];var _0x244810=_0x520a18?_0x3e62ff['count']:_0x1d7415['offset']+_0x1d7415['limit'];var _0x36cb1e;if(_0x244810>=_0x520a92){_0x244810=_0x520a92;_0x36cb1e=0xc8;}else{_0x36cb1e=0xce;}_0x51dddf[_0xa1ca('0x1c')](_0x36cb1e);return _0x51dddf[_0xa1ca('0x22')](_0xa1ca('0x23'),_0x1ae5b9+'-'+_0x244810+'/'+_0x520a92)[_0xa1ca('0x1e')](_0x3e62ff);}return null;};}function patchUpdates(_0x505ed0){return function(_0x47168c){try{jsonpatch['apply'](_0x47168c,_0x505ed0,!![]);}catch(_0x10f85e){return BPromise[_0xa1ca('0x24')](_0x10f85e);}return _0x47168c['save']();};}function saveUpdates(_0x5dc392,_0x124eb3){return function(_0x48eb9d){if(_0x48eb9d){return _0x48eb9d[_0xa1ca('0x25')](_0x5dc392)[_0xa1ca('0x26')](function(_0x427f3e){return _0x427f3e;});}return null;};}function removeEntity(_0x1535e4,_0xd1b414){return function(_0x26b173){if(_0x26b173){return _0x26b173['destroy']()[_0xa1ca('0x26')](function(){_0x1535e4[_0xa1ca('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b97b4,_0x5b2ad7){return function(_0xf42fe7){if(!_0xf42fe7){_0x2b97b4[_0xa1ca('0x1b')](0x194);}return _0xf42fe7;};}function handleError(_0x5b73db,_0x5abb0e){_0x5abb0e=_0x5abb0e||0x1f4;return function(_0x22fc20){logger[_0xa1ca('0x27')](_0x22fc20['stack']);if(_0x22fc20[_0xa1ca('0x28')]){delete _0x22fc20[_0xa1ca('0x28')];}_0x5b73db['status'](_0x5abb0e)[_0xa1ca('0x29')](_0x22fc20);};}exports[_0xa1ca('0x2a')]=function(_0x3d8846,_0x512238){var _0xc2dc7f={},_0x2c85aa={},_0x1820df={'count':0x0,'rows':[]};var _0x1cf9ed=_[_0xa1ca('0x2b')](db['SalesforceField']['rawAttributes'],function(_0x41415b){return{'name':_0x41415b[_0xa1ca('0x2c')],'type':_0x41415b['type']['key']};});_0x2c85aa[_0xa1ca('0x2d')]=_[_0xa1ca('0x2b')](_0x1cf9ed,_0xa1ca('0x28'));_0x2c85aa['query']=_[_0xa1ca('0x2e')](_0x3d8846[_0xa1ca('0x2f')]);_0x2c85aa[_0xa1ca('0x30')]=_[_0xa1ca('0x31')](_0x2c85aa[_0xa1ca('0x2d')],_0x2c85aa['query']);_0xc2dc7f['attributes']=_[_0xa1ca('0x31')](_0x2c85aa[_0xa1ca('0x2d')],qs[_0xa1ca('0x32')](_0x3d8846[_0xa1ca('0x2f')][_0xa1ca('0x32')]));_0xc2dc7f['attributes']=_0xc2dc7f['attributes'][_0xa1ca('0x33')]?_0xc2dc7f['attributes']:_0x2c85aa[_0xa1ca('0x2d')];if(!_0x3d8846[_0xa1ca('0x2f')][_0xa1ca('0x34')](_0xa1ca('0x35'))){_0xc2dc7f[_0xa1ca('0x36')]=qs['limit'](_0x3d8846[_0xa1ca('0x2f')]['limit']);_0xc2dc7f[_0xa1ca('0x1f')]=qs['offset'](_0x3d8846['query']['offset']);}_0xc2dc7f['order']=qs[_0xa1ca('0x37')](_0x3d8846[_0xa1ca('0x2f')]['sort']);_0xc2dc7f['where']=qs['filters'](_['pick'](_0x3d8846[_0xa1ca('0x2f')],_0x2c85aa[_0xa1ca('0x30')]),_0x1cf9ed);if(_0x3d8846[_0xa1ca('0x2f')]['filter']){_0xc2dc7f[_0xa1ca('0x38')]=_[_0xa1ca('0x39')](_0xc2dc7f[_0xa1ca('0x38')],{'$or':_[_0xa1ca('0x2b')](_0x1cf9ed,function(_0x2f52cd){if(_0x2f52cd[_0xa1ca('0x3a')]!=='VIRTUAL'){var _0x5210ea={};_0x5210ea[_0x2f52cd['name']]={'$like':'%'+_0x3d8846[_0xa1ca('0x2f')][_0xa1ca('0x3b')]+'%'};return _0x5210ea;}})});}_0xc2dc7f=_['merge']({},_0xc2dc7f,_0x3d8846[_0xa1ca('0x3c')]);var _0x684aa8={'where':_0xc2dc7f[_0xa1ca('0x38')]};return db[_0xa1ca('0x3d')][_0xa1ca('0x21')](_0x684aa8)[_0xa1ca('0x26')](function(_0x7dfdb2){_0x1820df[_0xa1ca('0x21')]=_0x7dfdb2;if(_0x3d8846['query'][_0xa1ca('0x3e')]){_0xc2dc7f[_0xa1ca('0x3f')]=[{'all':!![]}];}return db[_0xa1ca('0x3d')][_0xa1ca('0x40')](_0xc2dc7f);})[_0xa1ca('0x26')](function(_0x570227){_0x1820df[_0xa1ca('0x41')]=_0x570227;return _0x1820df;})['then'](respondWithFilteredResult(_0x512238,_0xc2dc7f))['catch'](handleError(_0x512238,null));};exports[_0xa1ca('0x42')]=function(_0x417584,_0x4e757){var _0x3e092c={'raw':!![],'where':{'id':_0x417584[_0xa1ca('0x43')]['id']}},_0x405b36={};_0x405b36[_0xa1ca('0x2d')]=_[_0xa1ca('0x2e')](db[_0xa1ca('0x3d')][_0xa1ca('0x44')]);_0x405b36[_0xa1ca('0x2f')]=_['keys'](_0x417584[_0xa1ca('0x2f')]);_0x405b36[_0xa1ca('0x30')]=_[_0xa1ca('0x31')](_0x405b36['model'],_0x405b36['query']);_0x3e092c[_0xa1ca('0x45')]=_[_0xa1ca('0x31')](_0x405b36[_0xa1ca('0x2d')],qs[_0xa1ca('0x32')](_0x417584[_0xa1ca('0x2f')][_0xa1ca('0x32')]));_0x3e092c[_0xa1ca('0x45')]=_0x3e092c[_0xa1ca('0x45')][_0xa1ca('0x33')]?_0x3e092c['attributes']:_0x405b36[_0xa1ca('0x2d')];if(_0x417584['query'][_0xa1ca('0x3e')]){_0x3e092c['include']=[{'all':!![]}];}_0x3e092c=_[_0xa1ca('0x39')]({},_0x3e092c,_0x417584[_0xa1ca('0x3c')]);return db[_0xa1ca('0x3d')]['find'](_0x3e092c)[_0xa1ca('0x26')](handleEntityNotFound(_0x4e757,null))[_0xa1ca('0x26')](respondWithResult(_0x4e757,null))['catch'](handleError(_0x4e757,null));};exports['create']=function(_0x3aca5d,_0x1976af){return db['SalesforceField'][_0xa1ca('0x46')](_0x3aca5d['body'],{})[_0xa1ca('0x26')](respondWithResult(_0x1976af,0xc9))[_0xa1ca('0x47')](handleError(_0x1976af,null));};exports[_0xa1ca('0x25')]=function(_0x1678ee,_0x285f84){if(_0x1678ee[_0xa1ca('0x48')]['id']){delete _0x1678ee[_0xa1ca('0x48')]['id'];}return db[_0xa1ca('0x3d')]['find']({'where':{'id':_0x1678ee[_0xa1ca('0x43')]['id']}})[_0xa1ca('0x26')](handleEntityNotFound(_0x285f84,null))['then'](saveUpdates(_0x1678ee[_0xa1ca('0x48')],null))['then'](respondWithResult(_0x285f84,null))[_0xa1ca('0x47')](handleError(_0x285f84,null));};exports[_0xa1ca('0x49')]=function(_0x428490,_0x3c7296){return db[_0xa1ca('0x3d')][_0xa1ca('0x4a')]({'where':{'id':_0x428490[_0xa1ca('0x43')]['id']}})[_0xa1ca('0x26')](handleEntityNotFound(_0x3c7296,null))[_0xa1ca('0x26')](removeEntity(_0x3c7296,null))['catch'](handleError(_0x3c7296,null));}; \ No newline at end of file +var _0x5cd1=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../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','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x1f4d63,_0x2a06a3){var _0x2a4078=function(_0x518ca2){while(--_0x518ca2){_0x1f4d63['push'](_0x1f4d63['shift']());}};_0x2a4078(++_0x2a06a3);}(_0x5cd1,0x137));var _0x15cd=function(_0x39fd82,_0x43e501){_0x39fd82=_0x39fd82-0x0;var _0xc76f5c=_0x5cd1[_0x39fd82];return _0xc76f5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15cd('0x0'));var zipdir=require(_0x15cd('0x1'));var jsonpatch=require(_0x15cd('0x2'));var rp=require(_0x15cd('0x3'));var moment=require(_0x15cd('0x4'));var BPromise=require(_0x15cd('0x5'));var Mustache=require(_0x15cd('0x6'));var util=require(_0x15cd('0x7'));var path=require(_0x15cd('0x8'));var sox=require(_0x15cd('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15cd('0xa'));var squel=require(_0x15cd('0xb'));var crypto=require(_0x15cd('0xc'));var jsforce=require(_0x15cd('0xd'));var deskjs=require(_0x15cd('0xe'));var toCsv=require(_0x15cd('0xf'));var querystring=require(_0x15cd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x15cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x15cd('0x12'));var hardwareService=require(_0x15cd('0x13'));var logger=require(_0x15cd('0x14'))('api');var utils=require(_0x15cd('0x15'));var config=require(_0x15cd('0x16'));var licenseUtil=require(_0x15cd('0x17'));var db=require(_0x15cd('0x18'))['db'];function respondWithStatusCode(_0x346895,_0x5366cb){_0x5366cb=_0x5366cb||0xcc;return function(_0x44a763){if(_0x44a763){return _0x346895[_0x15cd('0x19')](_0x5366cb);}return _0x346895[_0x15cd('0x1a')](_0x5366cb)[_0x15cd('0x1b')]();};}function respondWithResult(_0x3f9e6e,_0x3715f6){_0x3715f6=_0x3715f6||0xc8;return function(_0x3101d7){if(_0x3101d7){return _0x3f9e6e[_0x15cd('0x1a')](_0x3715f6)[_0x15cd('0x1c')](_0x3101d7);}};}function respondWithFilteredResult(_0x2c598c,_0x41e73a){return function(_0x11bfe1){if(_0x11bfe1){var _0x8e7a5f=typeof _0x41e73a[_0x15cd('0x1d')]===_0x15cd('0x1e')&&typeof _0x41e73a['limit']===_0x15cd('0x1e');var _0x139e78=_0x11bfe1['count'];var _0x3efe40=_0x8e7a5f?0x0:_0x41e73a[_0x15cd('0x1d')];var _0x4b44aa=_0x8e7a5f?_0x11bfe1[_0x15cd('0x1f')]:_0x41e73a[_0x15cd('0x1d')]+_0x41e73a[_0x15cd('0x20')];var _0x487b22;if(_0x4b44aa>=_0x139e78){_0x4b44aa=_0x139e78;_0x487b22=0xc8;}else{_0x487b22=0xce;}_0x2c598c['status'](_0x487b22);return _0x2c598c[_0x15cd('0x21')]('Content-Range',_0x3efe40+'-'+_0x4b44aa+'/'+_0x139e78)['json'](_0x11bfe1);}return null;};}function patchUpdates(_0x22fa42){return function(_0x55c27a){try{jsonpatch['apply'](_0x55c27a,_0x22fa42,!![]);}catch(_0xb36811){return BPromise[_0x15cd('0x22')](_0xb36811);}return _0x55c27a[_0x15cd('0x23')]();};}function saveUpdates(_0x118221,_0x57bd91){return function(_0xcc3a8c){if(_0xcc3a8c){return _0xcc3a8c[_0x15cd('0x24')](_0x118221)[_0x15cd('0x25')](function(_0x1de360){return _0x1de360;});}return null;};}function removeEntity(_0x441088,_0x4bbe3c){return function(_0x589f9d){if(_0x589f9d){return _0x589f9d[_0x15cd('0x26')]()[_0x15cd('0x25')](function(){_0x441088[_0x15cd('0x1a')](0xcc)[_0x15cd('0x1b')]();});}};}function handleEntityNotFound(_0x38dade,_0x50348d){return function(_0x2a2b76){if(!_0x2a2b76){_0x38dade[_0x15cd('0x19')](0x194);}return _0x2a2b76;};}function handleError(_0x10b4bb,_0x2680a9){_0x2680a9=_0x2680a9||0x1f4;return function(_0x5f0c85){logger['error'](_0x5f0c85[_0x15cd('0x27')]);if(_0x5f0c85[_0x15cd('0x28')]){delete _0x5f0c85[_0x15cd('0x28')];}_0x10b4bb[_0x15cd('0x1a')](_0x2680a9)[_0x15cd('0x29')](_0x5f0c85);};}exports[_0x15cd('0x2a')]=function(_0x573b33,_0x654a49){var _0x19dbbf={},_0x4e3a56={},_0x302c01={'count':0x0,'rows':[]};var _0x28b9c2=_[_0x15cd('0x2b')](db[_0x15cd('0x2c')]['rawAttributes'],function(_0x8e2dbc){return{'name':_0x8e2dbc[_0x15cd('0x2d')],'type':_0x8e2dbc[_0x15cd('0x2e')][_0x15cd('0x2f')]};});_0x4e3a56[_0x15cd('0x30')]=_[_0x15cd('0x2b')](_0x28b9c2,_0x15cd('0x28'));_0x4e3a56[_0x15cd('0x31')]=_[_0x15cd('0x32')](_0x573b33[_0x15cd('0x31')]);_0x4e3a56[_0x15cd('0x33')]=_[_0x15cd('0x34')](_0x4e3a56[_0x15cd('0x30')],_0x4e3a56[_0x15cd('0x31')]);_0x19dbbf[_0x15cd('0x35')]=_[_0x15cd('0x34')](_0x4e3a56['model'],qs['fields'](_0x573b33[_0x15cd('0x31')][_0x15cd('0x36')]));_0x19dbbf[_0x15cd('0x35')]=_0x19dbbf['attributes'][_0x15cd('0x37')]?_0x19dbbf[_0x15cd('0x35')]:_0x4e3a56[_0x15cd('0x30')];if(!_0x573b33['query'][_0x15cd('0x38')](_0x15cd('0x39'))){_0x19dbbf['limit']=qs[_0x15cd('0x20')](_0x573b33[_0x15cd('0x31')][_0x15cd('0x20')]);_0x19dbbf['offset']=qs[_0x15cd('0x1d')](_0x573b33['query'][_0x15cd('0x1d')]);}_0x19dbbf[_0x15cd('0x3a')]=qs[_0x15cd('0x3b')](_0x573b33[_0x15cd('0x31')]['sort']);_0x19dbbf[_0x15cd('0x3c')]=qs['filters'](_[_0x15cd('0x3d')](_0x573b33[_0x15cd('0x31')],_0x4e3a56[_0x15cd('0x33')]),_0x28b9c2);if(_0x573b33[_0x15cd('0x31')][_0x15cd('0x3e')]){_0x19dbbf[_0x15cd('0x3c')]=_[_0x15cd('0x3f')](_0x19dbbf[_0x15cd('0x3c')],{'$or':_[_0x15cd('0x2b')](_0x28b9c2,function(_0x34475f){if(_0x34475f[_0x15cd('0x2e')]!==_0x15cd('0x40')){var _0x5b2199={};_0x5b2199[_0x34475f[_0x15cd('0x28')]]={'$like':'%'+_0x573b33['query'][_0x15cd('0x3e')]+'%'};return _0x5b2199;}})});}_0x19dbbf=_['merge']({},_0x19dbbf,_0x573b33[_0x15cd('0x41')]);var _0x38509f={'where':_0x19dbbf[_0x15cd('0x3c')]};return db[_0x15cd('0x2c')]['count'](_0x38509f)[_0x15cd('0x25')](function(_0x368b27){_0x302c01[_0x15cd('0x1f')]=_0x368b27;if(_0x573b33[_0x15cd('0x31')][_0x15cd('0x42')]){_0x19dbbf['include']=[{'all':!![]}];}return db[_0x15cd('0x2c')][_0x15cd('0x43')](_0x19dbbf);})[_0x15cd('0x25')](function(_0x3fb0d4){_0x302c01[_0x15cd('0x44')]=_0x3fb0d4;return _0x302c01;})[_0x15cd('0x25')](respondWithFilteredResult(_0x654a49,_0x19dbbf))[_0x15cd('0x45')](handleError(_0x654a49,null));};exports[_0x15cd('0x46')]=function(_0x12b324,_0x274c31){var _0x293045={'raw':!![],'where':{'id':_0x12b324[_0x15cd('0x47')]['id']}},_0x6b3df1={};_0x6b3df1['model']=_[_0x15cd('0x32')](db[_0x15cd('0x2c')]['rawAttributes']);_0x6b3df1['query']=_[_0x15cd('0x32')](_0x12b324[_0x15cd('0x31')]);_0x6b3df1['filters']=_[_0x15cd('0x34')](_0x6b3df1[_0x15cd('0x30')],_0x6b3df1[_0x15cd('0x31')]);_0x293045[_0x15cd('0x35')]=_['intersection'](_0x6b3df1[_0x15cd('0x30')],qs['fields'](_0x12b324[_0x15cd('0x31')][_0x15cd('0x36')]));_0x293045['attributes']=_0x293045[_0x15cd('0x35')][_0x15cd('0x37')]?_0x293045[_0x15cd('0x35')]:_0x6b3df1[_0x15cd('0x30')];if(_0x12b324[_0x15cd('0x31')][_0x15cd('0x42')]){_0x293045['include']=[{'all':!![]}];}_0x293045=_['merge']({},_0x293045,_0x12b324[_0x15cd('0x41')]);return db['SalesforceField']['find'](_0x293045)[_0x15cd('0x25')](handleEntityNotFound(_0x274c31,null))[_0x15cd('0x25')](respondWithResult(_0x274c31,null))[_0x15cd('0x45')](handleError(_0x274c31,null));};exports[_0x15cd('0x48')]=function(_0xa789af,_0x452c73){return db[_0x15cd('0x2c')]['create'](_0xa789af[_0x15cd('0x49')],{})['then'](respondWithResult(_0x452c73,0xc9))['catch'](handleError(_0x452c73,null));};exports['update']=function(_0x53cdd6,_0x33a2c6){if(_0x53cdd6['body']['id']){delete _0x53cdd6[_0x15cd('0x49')]['id'];}return db['SalesforceField'][_0x15cd('0x4a')]({'where':{'id':_0x53cdd6['params']['id']}})[_0x15cd('0x25')](handleEntityNotFound(_0x33a2c6,null))[_0x15cd('0x25')](saveUpdates(_0x53cdd6[_0x15cd('0x49')],null))[_0x15cd('0x25')](respondWithResult(_0x33a2c6,null))['catch'](handleError(_0x33a2c6,null));};exports[_0x15cd('0x26')]=function(_0x5c8eae,_0x2e058b){return db['SalesforceField'][_0x15cd('0x4a')]({'where':{'id':_0x5c8eae[_0x15cd('0x47')]['id']}})[_0x15cd('0x25')](handleEntityNotFound(_0x2e058b,null))[_0x15cd('0x25')](removeEntity(_0x2e058b,null))['catch'](handleError(_0x2e058b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b15e4ba..4d2f9e3 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 _0x536c=['../../config/environment','exports','define','int_salesforce_fields','salesforce_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2434b2,_0x46ab35){var _0xe3fa7f=function(_0x1dfc0d){while(--_0x1dfc0d){_0x2434b2['push'](_0x2434b2['shift']());}};_0xe3fa7f(++_0x46ab35);}(_0x536c,0xa2));var _0xc536=function(_0x7d40bc,_0x5c9ee1){_0x7d40bc=_0x7d40bc-0x0;var _0x2e955a=_0x536c[_0x7d40bc];return _0x2e955a;};'use strict';var _=require(_0xc536('0x0'));var util=require('util');var logger=require(_0xc536('0x1'))(_0xc536('0x2'));var moment=require(_0xc536('0x3'));var BPromise=require(_0xc536('0x4'));var rp=require(_0xc536('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc536('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0xc536('0x7')]=function(_0x175953,_0x17b731){return _0x175953[_0xc536('0x8')]('SalesforceField',attributes,{'tableName':_0xc536('0x9'),'paranoid':![],'indexes':[{'name':_0xc536('0xa'),'fields':[_0xc536('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e93=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x2e93,0xd8));var _0x32e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32e9('0x0'));var util=require('util');var logger=require(_0x32e9('0x1'))('api');var moment=require(_0x32e9('0x2'));var BPromise=require(_0x32e9('0x3'));var rp=require(_0x32e9('0x4'));var fs=require('fs');var path=require(_0x32e9('0x5'));var rimraf=require(_0x32e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x32e9('0x7'));module[_0x32e9('0x8')]=function(_0x1a4b43,_0x120fd6){return _0x1a4b43[_0x32e9('0x9')](_0x32e9('0xa'),attributes,{'tableName':_0x32e9('0xb'),'paranoid':![],'indexes':[{'name':_0x32e9('0xc'),'fields':[_0x32e9('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 0a4e296..4ef1db9 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 _0x8c23=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x192000,_0x4dcef9){var _0x42effa=function(_0x1f7acb){while(--_0x1f7acb){_0x192000['push'](_0x192000['shift']());}};_0x42effa(++_0x4dcef9);}(_0x8c23,0x1c1));var _0x38c2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8c23[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x38c2('0x0'));var util=require('util');var moment=require(_0x38c2('0x1'));var BPromise=require(_0x38c2('0x2'));var rs=require(_0x38c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38c2('0x4'))['db'];var utils=require(_0x38c2('0x5'));var logger=require(_0x38c2('0x6'))(_0x38c2('0x7'));var config=require(_0x38c2('0x8'));var jayson=require(_0x38c2('0x9'));var client=jayson[_0x38c2('0xa')][_0x38c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b982,_0x5a607c,_0x5baf0e){return new BPromise(function(_0x4208f2,_0x367e2f){return client[_0x38c2('0xc')](_0x10b982,_0x5baf0e)[_0x38c2('0xd')](function(_0x3bb86c){logger[_0x38c2('0xe')](_0x38c2('0xf'),_0x5a607c,_0x38c2('0x10'));logger[_0x38c2('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5a607c,_0x38c2('0x10'),JSON[_0x38c2('0x12')](_0x3bb86c));if(_0x3bb86c['error']){if(_0x3bb86c[_0x38c2('0x13')]['code']===0x1f4){logger[_0x38c2('0x13')](_0x38c2('0xf'),_0x5a607c,_0x3bb86c['error'][_0x38c2('0x14')]);return _0x367e2f(_0x3bb86c[_0x38c2('0x13')][_0x38c2('0x14')]);}logger[_0x38c2('0x13')](_0x38c2('0xf'),_0x5a607c,_0x3bb86c[_0x38c2('0x13')][_0x38c2('0x14')]);return _0x4208f2(_0x3bb86c[_0x38c2('0x13')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x5a607c,_0x38c2('0x10'));_0x4208f2(_0x3bb86c[_0x38c2('0x15')][_0x38c2('0x14')]);}})['catch'](function(_0x11a171){logger['error'](_0x38c2('0xf'),_0x5a607c,_0x11a171);_0x367e2f(_0x11a171);});});} \ No newline at end of file +var _0x76de=['error','SalesforceField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76de,0x196));var _0xe76d=function(_0x371b74,_0x2c45a0){_0x371b74=_0x371b74-0x0;var _0x4cf68f=_0x76de[_0x371b74];return _0x4cf68f;};'use strict';var _=require('lodash');var util=require(_0xe76d('0x0'));var moment=require(_0xe76d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe76d('0x2'));var fs=require('fs');var Redis=require(_0xe76d('0x3'));var db=require(_0xe76d('0x4'))['db'];var utils=require(_0xe76d('0x5'));var logger=require(_0xe76d('0x6'))(_0xe76d('0x7'));var config=require(_0xe76d('0x8'));var jayson=require(_0xe76d('0x9'));var client=jayson['client'][_0xe76d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x635231,_0x4bf194,_0x330d55){return new BPromise(function(_0x4a4667,_0x3354a9){return client[_0xe76d('0xb')](_0x635231,_0x330d55)['then'](function(_0x2bf16a){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4bf194,_0xe76d('0xc'));logger[_0xe76d('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4bf194,_0xe76d('0xc'),JSON['stringify'](_0x2bf16a));if(_0x2bf16a[_0xe76d('0xe')]){if(_0x2bf16a[_0xe76d('0xe')]['code']===0x1f4){logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x2bf16a[_0xe76d('0xe')][_0xe76d('0x10')]);return _0x3354a9(_0x2bf16a['error'][_0xe76d('0x10')]);}logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x2bf16a[_0xe76d('0xe')]['message']);return _0x4a4667(_0x2bf16a[_0xe76d('0xe')][_0xe76d('0x10')]);}else{logger[_0xe76d('0x11')](_0xe76d('0xf'),_0x4bf194,'request\x20sent');_0x4a4667(_0x2bf16a[_0xe76d('0x12')]['message']);}})[_0xe76d('0x13')](function(_0x4e36b2){logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x4e36b2);_0x3354a9(_0x4e36b2);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 253ecbe..e5d331c 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 _0xc805=['index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','post','create','addConfiguration','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc805,0x171));var _0x5c80=function(_0x1b640f,_0x215390){_0x1b640f=_0x1b640f-0x0;var _0x560770=_0xc805[_0x1b640f];return _0x560770;};'use strict';var multer=require(_0x5c80('0x0'));var util=require('util');var path=require(_0x5c80('0x1'));var timeout=require(_0x5c80('0x2'));var express=require(_0x5c80('0x3'));var router=express[_0x5c80('0x4')]();var fs_extra=require(_0x5c80('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5c80('0x6'));var config=require(_0x5c80('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x5c80('0x8')]('/',auth['isAuthenticated'](),controller[_0x5c80('0x9')]);router[_0x5c80('0x8')](_0x5c80('0xa'),auth['isAuthenticated'](),controller[_0x5c80('0xb')]);router[_0x5c80('0x8')](_0x5c80('0xc'),auth[_0x5c80('0xd')](),controller['getConfigurations']);router['get'](_0x5c80('0xe'),auth[_0x5c80('0xd')](),controller['getFields']);router[_0x5c80('0xf')]('/',auth[_0x5c80('0xd')](),controller[_0x5c80('0x10')]);router[_0x5c80('0xf')]('/:id/configurations',auth[_0x5c80('0xd')](),controller[_0x5c80('0x11')]);router['put'](_0x5c80('0xa'),auth[_0x5c80('0xd')](),controller[_0x5c80('0x12')]);router[_0x5c80('0x13')](_0x5c80('0xa'),auth[_0x5c80('0xd')](),controller[_0x5c80('0x14')]);module['exports']=router; \ No newline at end of file +var _0x66f4=['express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','create','/:id/configurations','put','update','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x66f4,0x7f));var _0x466f=function(_0x278262,_0x55faa4){_0x278262=_0x278262-0x0;var _0x291144=_0x66f4[_0x278262];return _0x291144;};'use strict';var multer=require('multer');var util=require(_0x466f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x466f('0x1'));var router=express[_0x466f('0x2')]();var fs_extra=require(_0x466f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x466f('0x4'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x466f('0x5')](),controller[_0x466f('0x6')]);router[_0x466f('0x7')](_0x466f('0x8'),auth['isAuthenticated'](),controller[_0x466f('0x9')]);router[_0x466f('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x466f('0x7')](_0x466f('0xa'),auth[_0x466f('0x5')](),controller[_0x466f('0xb')]);router['post']('/',auth[_0x466f('0x5')](),controller[_0x466f('0xc')]);router['post'](_0x466f('0xd'),auth[_0x466f('0x5')](),controller['addConfiguration']);router[_0x466f('0xe')](_0x466f('0x8'),auth['isAuthenticated'](),controller[_0x466f('0xf')]);router['delete'](_0x466f('0x8'),auth[_0x466f('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ebdcd4b..085a004 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 _0xe9cc=['STRING','remoteUri','sequelize','exports'];(function(_0x25faea,_0xed3bd8){var _0x20c766=function(_0xd7ac0b){while(--_0xd7ac0b){_0x25faea['push'](_0x25faea['shift']());}};_0x20c766(++_0xed3bd8);}(_0xe9cc,0x14a));var _0xce9c=function(_0x5a5f64,_0x342af9){_0x5a5f64=_0x5a5f64-0x0;var _0x59cb35=_0xe9cc[_0x5a5f64];return _0x59cb35;};'use strict';var Sequelize=require(_0xce9c('0x0'));module[_0xce9c('0x1')]={'name':{'type':Sequelize[_0xce9c('0x2')]},'description':{'type':Sequelize[_0xce9c('0x2')]},'username':{'type':Sequelize[_0xce9c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xce9c('0x2')]},'email':{'type':Sequelize[_0xce9c('0x2')]},'remoteUri':{'type':Sequelize[_0xce9c('0x2')],'unique':_0xce9c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc340=['sequelize','STRING','username','remoteUri'];(function(_0x3d6904,_0x20c455){var _0x374f9e=function(_0xe72b40){while(--_0xe72b40){_0x3d6904['push'](_0x3d6904['shift']());}};_0x374f9e(++_0x20c455);}(_0xc340,0xa0));var _0x0c34=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc340[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x0c34('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c34('0x1')]},'description':{'type':Sequelize[_0x0c34('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0c34('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0c34('0x1')]},'remoteUri':{'type':Sequelize[_0x0c34('0x1')],'unique':_0x0c34('0x3')},'serverUrl':{'type':Sequelize[_0x0c34('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 77d173d..be542e3 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 _0x873a=['reassignment_count','activity_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','remoteUri','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','approval_set','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company'];(function(_0x212478,_0x56e183){var _0x3de0a6=function(_0x706f71){while(--_0x706f71){_0x212478['push'](_0x212478['shift']());}};_0x3de0a6(++_0x56e183);}(_0x873a,0x195));var _0xa873=function(_0x349f8c,_0xeef035){_0x349f8c=_0x349f8c-0x0;var _0x3ab6ad=_0x873a[_0x349f8c];return _0x3ab6ad;};'use strict';var emlformat=require(_0xa873('0x0'));var rimraf=require(_0xa873('0x1'));var zipdir=require(_0xa873('0x2'));var jsonpatch=require(_0xa873('0x3'));var rp=require(_0xa873('0x4'));var moment=require(_0xa873('0x5'));var BPromise=require(_0xa873('0x6'));var Mustache=require(_0xa873('0x7'));var util=require(_0xa873('0x8'));var path=require('path');var sox=require(_0xa873('0x9'));var csv=require(_0xa873('0xa'));var ejs=require(_0xa873('0xb'));var fs=require('fs');var fs_extra=require(_0xa873('0xc'));var _=require(_0xa873('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa873('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa873('0xa'));var querystring=require(_0xa873('0xf'));var Papa=require(_0xa873('0x10'));var Redis=require('ioredis');var authService=require(_0xa873('0x11'));var qs=require(_0xa873('0x12'));var as=require(_0xa873('0x13'));var hardwareService=require(_0xa873('0x14'));var logger=require(_0xa873('0x15'))(_0xa873('0x16'));var utils=require('../../config/utils');var config=require(_0xa873('0x17'));var licenseUtil=require(_0xa873('0x18'));var db=require(_0xa873('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xb1e079,_0xa56f5d){_0xa56f5d=_0xa56f5d||0xcc;return function(_0x49ee11){if(_0x49ee11){return _0xb1e079['sendStatus'](_0xa56f5d);}return _0xb1e079[_0xa873('0x1a')](_0xa56f5d)[_0xa873('0x1b')]();};}function respondWithResult(_0x285ab3,_0x96cb24){_0x96cb24=_0x96cb24||0xc8;return function(_0x1142ba){if(_0x1142ba){return _0x285ab3[_0xa873('0x1a')](_0x96cb24)[_0xa873('0x1c')](_0x1142ba);}};}function respondWithFilteredResult(_0x462848,_0x1fef35){return function(_0x24a3c0){if(_0x24a3c0){var _0x3a1771=typeof _0x1fef35[_0xa873('0x1d')]===_0xa873('0x1e')&&typeof _0x1fef35[_0xa873('0x1f')]==='undefined';var _0x51954=_0x24a3c0['count'];var _0x576bb0=_0x3a1771?0x0:_0x1fef35[_0xa873('0x1d')];var _0x218eaf=_0x3a1771?_0x24a3c0[_0xa873('0x20')]:_0x1fef35[_0xa873('0x1d')]+_0x1fef35[_0xa873('0x1f')];var _0x17c27c;if(_0x218eaf>=_0x51954){_0x218eaf=_0x51954;_0x17c27c=0xc8;}else{_0x17c27c=0xce;}_0x462848['status'](_0x17c27c);return _0x462848[_0xa873('0x21')](_0xa873('0x22'),_0x576bb0+'-'+_0x218eaf+'/'+_0x51954)[_0xa873('0x1c')](_0x24a3c0);}return null;};}function patchUpdates(_0x43a824){return function(_0x51cdd6){try{jsonpatch['apply'](_0x51cdd6,_0x43a824,!![]);}catch(_0x407b5c){return BPromise[_0xa873('0x23')](_0x407b5c);}return _0x51cdd6[_0xa873('0x24')]();};}function saveUpdates(_0x4cea36,_0x41f3c5){return function(_0x5aa243){if(_0x5aa243){return _0x5aa243[_0xa873('0x25')](_0x4cea36)[_0xa873('0x26')](function(_0x1dcaee){return _0x1dcaee;});}return null;};}function removeEntity(_0x28118c,_0x2b068d){return function(_0x47abc8){if(_0x47abc8){return _0x47abc8[_0xa873('0x27')]()[_0xa873('0x26')](function(){_0x28118c[_0xa873('0x1a')](0xcc)[_0xa873('0x1b')]();});}};}function handleEntityNotFound(_0xd9a59b,_0x16012f){return function(_0x2569c6){if(!_0x2569c6){_0xd9a59b['sendStatus'](0x194);}return _0x2569c6;};}function handleError(_0x29fd6e,_0x286848){_0x286848=_0x286848||0x1f4;return function(_0x3e6696){logger['error'](_0x3e6696[_0xa873('0x28')]);if(_0x3e6696[_0xa873('0x29')]){delete _0x3e6696['name'];}_0x29fd6e[_0xa873('0x1a')](_0x286848)[_0xa873('0x2a')](_0x3e6696);};}exports['index']=function(_0x410b52,_0x260f40){var _0x3fb88e={},_0x21b979={},_0x535772={'count':0x0,'rows':[]};var _0x3a0bd8=_[_0xa873('0x2b')](db[_0xa873('0x2c')][_0xa873('0x2d')],function(_0x7513c3){return{'name':_0x7513c3[_0xa873('0x2e')],'type':_0x7513c3[_0xa873('0x2f')]['key']};});_0x21b979[_0xa873('0x30')]=_['map'](_0x3a0bd8,'name');_0x21b979[_0xa873('0x31')]=_[_0xa873('0x32')](_0x410b52[_0xa873('0x31')]);_0x21b979[_0xa873('0x33')]=_[_0xa873('0x34')](_0x21b979['model'],_0x21b979[_0xa873('0x31')]);_0x3fb88e[_0xa873('0x35')]=_[_0xa873('0x34')](_0x21b979[_0xa873('0x30')],qs[_0xa873('0x36')](_0x410b52[_0xa873('0x31')][_0xa873('0x36')]));_0x3fb88e[_0xa873('0x35')]=_0x3fb88e[_0xa873('0x35')]['length']?_0x3fb88e[_0xa873('0x35')]:_0x21b979['model'];if(!_0x410b52[_0xa873('0x31')]['hasOwnProperty']('nolimit')){_0x3fb88e[_0xa873('0x1f')]=qs['limit'](_0x410b52[_0xa873('0x31')][_0xa873('0x1f')]);_0x3fb88e[_0xa873('0x1d')]=qs[_0xa873('0x1d')](_0x410b52['query'][_0xa873('0x1d')]);}_0x3fb88e[_0xa873('0x37')]=qs[_0xa873('0x38')](_0x410b52[_0xa873('0x31')]['sort']);_0x3fb88e[_0xa873('0x39')]=qs[_0xa873('0x33')](_['pick'](_0x410b52['query'],_0x21b979[_0xa873('0x33')]),_0x3a0bd8);if(_0x410b52[_0xa873('0x31')][_0xa873('0x3a')]){_0x3fb88e[_0xa873('0x39')]=_[_0xa873('0x3b')](_0x3fb88e[_0xa873('0x39')],{'$or':_[_0xa873('0x2b')](_0x3a0bd8,function(_0x5b5279){if(_0x5b5279[_0xa873('0x2f')]!==_0xa873('0x3c')){var _0x548e28={};_0x548e28[_0x5b5279['name']]={'$like':'%'+_0x410b52[_0xa873('0x31')]['filter']+'%'};return _0x548e28;}})});}_0x3fb88e=_[_0xa873('0x3b')]({},_0x3fb88e,_0x410b52['options']);var _0x76dd18={'where':_0x3fb88e[_0xa873('0x39')]};return db['ServicenowAccount'][_0xa873('0x20')](_0x76dd18)[_0xa873('0x26')](function(_0x469c14){_0x535772[_0xa873('0x20')]=_0x469c14;if(_0x410b52[_0xa873('0x31')][_0xa873('0x3d')]){_0x3fb88e[_0xa873('0x3e')]=[{'all':!![]}];}return db[_0xa873('0x2c')][_0xa873('0x3f')](_0x3fb88e);})[_0xa873('0x26')](function(_0x5aff07){_0x535772[_0xa873('0x40')]=_0x5aff07;return _0x535772;})['then'](respondWithFilteredResult(_0x260f40,_0x3fb88e))[_0xa873('0x41')](handleError(_0x260f40,null));};exports[_0xa873('0x42')]=function(_0x3f8045,_0x39b6ab){var _0x5bc5af={'raw':![],'where':{'id':_0x3f8045[_0xa873('0x43')]['id']}},_0x2f9558={};_0x2f9558[_0xa873('0x30')]=_['keys'](db[_0xa873('0x2c')][_0xa873('0x2d')]);_0x2f9558[_0xa873('0x31')]=_[_0xa873('0x32')](_0x3f8045[_0xa873('0x31')]);_0x2f9558[_0xa873('0x33')]=_['intersection'](_0x2f9558['model'],_0x2f9558[_0xa873('0x31')]);_0x5bc5af[_0xa873('0x35')]=_['intersection'](_0x2f9558[_0xa873('0x30')],qs[_0xa873('0x36')](_0x3f8045[_0xa873('0x31')]['fields']));_0x5bc5af['attributes']=_0x5bc5af[_0xa873('0x35')][_0xa873('0x44')]?_0x5bc5af[_0xa873('0x35')]:_0x2f9558['model'];if(_0x3f8045['query']['includeAll']){_0x5bc5af[_0xa873('0x3e')]=[{'all':!![]}];}_0x5bc5af=_[_0xa873('0x3b')]({},_0x5bc5af,_0x3f8045[_0xa873('0x45')]);return db[_0xa873('0x2c')][_0xa873('0x46')](_0x5bc5af)[_0xa873('0x26')](handleEntityNotFound(_0x39b6ab,null))['then'](respondWithResult(_0x39b6ab,null))[_0xa873('0x41')](handleError(_0x39b6ab,null));};exports['create']=function(_0x9fad5e,_0x3b7c1f){return db[_0xa873('0x2c')][_0xa873('0x47')](_0x9fad5e[_0xa873('0x48')],{})['then'](respondWithResult(_0x3b7c1f,0xc9))[_0xa873('0x41')](handleError(_0x3b7c1f,null));};exports['update']=function(_0x1d6d89,_0x201715){if(_0x1d6d89[_0xa873('0x48')]['id']){delete _0x1d6d89[_0xa873('0x48')]['id'];}return db[_0xa873('0x2c')][_0xa873('0x46')]({'where':{'id':_0x1d6d89[_0xa873('0x43')]['id']}})[_0xa873('0x26')](handleEntityNotFound(_0x201715,null))['then'](saveUpdates(_0x1d6d89[_0xa873('0x48')],null))['then'](respondWithResult(_0x201715,null))[_0xa873('0x41')](handleError(_0x201715,null));};exports[_0xa873('0x27')]=function(_0x1d1afc,_0xabd2be){return db[_0xa873('0x2c')][_0xa873('0x46')]({'where':{'id':_0x1d1afc[_0xa873('0x43')]['id']}})[_0xa873('0x26')](handleEntityNotFound(_0xabd2be,null))[_0xa873('0x26')](removeEntity(_0xabd2be,null))['catch'](handleError(_0xabd2be,null));};exports[_0xa873('0x49')]=function(_0x2039c3,_0x4e205c,_0x304f1c){var _0x201966={};var _0x1ef354={};var _0x4bc458;var _0x1b012d;return db[_0xa873('0x2c')][_0xa873('0x4a')]({'where':{'id':_0x2039c3[_0xa873('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e205c,null))[_0xa873('0x26')](function(_0x3e986e){if(_0x3e986e){_0x4bc458=_0x3e986e;_0x1ef354['model']=_[_0xa873('0x32')](db[_0xa873('0x4b')]['rawAttributes']);_0x1ef354[_0xa873('0x31')]=_['keys'](_0x2039c3[_0xa873('0x31')]);_0x1ef354['filters']=_[_0xa873('0x34')](_0x1ef354['model'],_0x1ef354[_0xa873('0x31')]);_0x201966[_0xa873('0x35')]=_[_0xa873('0x34')](_0x1ef354[_0xa873('0x30')],qs[_0xa873('0x36')](_0x2039c3[_0xa873('0x31')][_0xa873('0x36')]));_0x201966[_0xa873('0x35')]=_0x201966[_0xa873('0x35')][_0xa873('0x44')]?_0x201966[_0xa873('0x35')]:_0x1ef354[_0xa873('0x30')];_0x201966[_0xa873('0x37')]=qs[_0xa873('0x38')](_0x2039c3[_0xa873('0x31')]['sort']);_0x201966[_0xa873('0x39')]=qs[_0xa873('0x33')](_['pick'](_0x2039c3[_0xa873('0x31')],_0x1ef354[_0xa873('0x33')]));if(_0x2039c3[_0xa873('0x31')][_0xa873('0x3a')]){_0x201966[_0xa873('0x39')]=_[_0xa873('0x3b')](_0x201966[_0xa873('0x39')],{'$or':_[_0xa873('0x2b')](_0x201966[_0xa873('0x35')],function(_0x15c632){var _0x3cddb0={};_0x3cddb0[_0x15c632]={'$like':'%'+_0x2039c3['query'][_0xa873('0x3a')]+'%'};return _0x3cddb0;})});}_0x201966=_[_0xa873('0x3b')]({},_0x201966,_0x2039c3[_0xa873('0x45')]);return _0x4bc458[_0xa873('0x49')](_0x201966);}})[_0xa873('0x26')](function(_0x3faa67){if(_0x3faa67){_0x1b012d=_0x3faa67[_0xa873('0x44')];if(!_0x2039c3[_0xa873('0x31')][_0xa873('0x4c')](_0xa873('0x4d'))){_0x201966['limit']=qs[_0xa873('0x1f')](_0x2039c3[_0xa873('0x31')][_0xa873('0x1f')]);_0x201966[_0xa873('0x1d')]=qs[_0xa873('0x1d')](_0x2039c3[_0xa873('0x31')]['offset']);}return _0x4bc458[_0xa873('0x49')](_0x201966);}})[_0xa873('0x26')](function(_0x7c5e61){if(_0x7c5e61){return _0x7c5e61?{'count':_0x1b012d,'rows':_0x7c5e61}:null;}})['then'](respondWithResult(_0x4e205c,null))[_0xa873('0x41')](handleError(_0x4e205c,null));};exports[_0xa873('0x4e')]=function(_0x521696,_0x4b7a40,_0x48423b){if(_0x521696['body']['id']){delete _0x521696['body']['id'];}return db[_0xa873('0x2c')]['findOne']({'where':{'id':_0x521696['params']['id']}})[_0xa873('0x26')](handleEntityNotFound(_0x4b7a40,null))[_0xa873('0x26')](function(_0x345e2c){if(_0x345e2c){_0x521696[_0xa873('0x48')][_0xa873('0x4f')]=_0x345e2c['id'];_0x521696[_0xa873('0x48')][_0xa873('0x50')]=integrations[_0xa873('0x51')](_0x521696[_0xa873('0x48')][_0xa873('0x52')],_0x521696[_0xa873('0x48')][_0xa873('0x2f')]);_0x521696[_0xa873('0x48')][_0xa873('0x53')]=integrations[_0xa873('0x54')](_0x521696['body']['channel'],_0x521696[_0xa873('0x48')][_0xa873('0x2f')]);return db['ServicenowConfiguration'][_0xa873('0x47')](_0x521696[_0xa873('0x48')],{'include':[{'model':db[_0xa873('0x55')],'as':_0xa873('0x50')},{'model':db['ServicenowField'],'as':_0xa873('0x53')}]});}return null;})[_0xa873('0x26')](respondWithResult(_0x4b7a40,null))[_0xa873('0x41')](handleError(_0x4b7a40,null));};exports[_0xa873('0x56')]=function(_0x2b9d70,_0x593c75,_0x18326c){var _0x5903b6=['made_sla',_0xa873('0x57'),_0xa873('0x58'),_0xa873('0x59'),_0xa873('0x5a'),'notify',_0xa873('0x5b'),_0xa873('0x5c'),_0xa873('0x5d')];var _0x44fbfd=['parent',_0xa873('0x5e'),_0xa873('0x5f'),'watch_list',_0xa873('0x60'),_0xa873('0x61'),_0xa873('0x62'),_0xa873('0x57'),'approval_history','number',_0xa873('0x63'),'sys_updated_by','opened_by','user_input','sys_created_on',_0xa873('0x64'),_0xa873('0x65'),_0xa873('0x66'),_0xa873('0x58'),_0xa873('0x37'),_0xa873('0x67'),_0xa873('0x68'),_0xa873('0x69'),_0xa873('0x6a'),_0xa873('0x6b'),_0xa873('0x6c'),_0xa873('0x6d'),_0xa873('0x6e'),'priority',_0xa873('0x6f'),_0xa873('0x70'),'time_worked',_0xa873('0x71'),_0xa873('0x72'),_0xa873('0x73'),_0xa873('0x74'),_0xa873('0x75'),'reopened_time',_0xa873('0x76'),'caller_id',_0xa873('0x77'),'subcategory','work_notes',_0xa873('0x78'),_0xa873('0x5a'),_0xa873('0x79'),_0xa873('0x7a'),'work_start',_0xa873('0x7b'),_0xa873('0x7c'),_0xa873('0x7d'),_0xa873('0x7e'),_0xa873('0x7f'),'notify',_0xa873('0x80'),_0xa873('0x81'),'closed_by',_0xa873('0x82'),_0xa873('0x83'),_0xa873('0x84'),_0xa873('0x85'),_0xa873('0x86'),_0xa873('0x5b'),_0xa873('0x87'),_0xa873('0x88'),_0xa873('0x89'),_0xa873('0x8a'),_0xa873('0x8b'),'assigned_to',_0xa873('0x5c'),'comments','sla_due',_0xa873('0x8c'),_0xa873('0x8d'),_0xa873('0x8e'),_0xa873('0x8f'),_0xa873('0x90'),_0xa873('0x91'),_0xa873('0x92'),_0xa873('0x93'),'correlation_id',_0xa873('0x94'),_0xa873('0x5d')];var _0x3869fb='';var _0x47de67='';var _0x11f3b4=[];var _0x435711='';var _0xce0d6f='';var _0x1453cf=[];var _0x1d619b='';var _0xd057a0='';var _0x543370={};var _0x47356f='';return db[_0xa873('0x2c')]['findOne']({'where':{'id':_0x2b9d70[_0xa873('0x43')]['id']},'attributes':['id','username','password','email','remoteUri','serverUrl']})[_0xa873('0x26')](handleEntityNotFound(_0x593c75,null))[_0xa873('0x26')](function(_0x3fd6f5){if(_0x3fd6f5){_0x47356f=_0x3fd6f5[_0xa873('0x95')];var _0x47f332=_0x47356f['slice'](-0x1);if(_0x47f332==='/'){_0x47356f=_0x47356f[_0xa873('0x96')](0x0,_0x47356f[_0xa873('0x97')](_0x47f332));}_0xd057a0=util['format'](_0xa873('0x98'),_0x47356f);_0x1d619b=util[_0xa873('0x99')]('%s/api/now/table/',_0x47356f);_0x543370={'user':_0x3fd6f5['username'],'pass':_0x3fd6f5[_0xa873('0x9a')]};var _0x13c95c={'method':_0xa873('0x9b'),'uri':_0xd057a0+_0xa873('0x9c'),'auth':_0x543370,'json':!![]};return rp(_0x13c95c);}})['then'](function(_0x598484){if(_0x598484[_0xa873('0x9d')]['length']>0x0){_0x3869fb=_0x598484[_0xa873('0x9d')];}console[_0xa873('0x9e')]('incident\x20table\x20objects',_0x3869fb);_0x1453cf=[];_0x47de67=Object[_0xa873('0x9f')]([],_0x3869fb);_[_0xa873('0xa0')](_0x47de67,function(_0x15886a){return!_0x5903b6[_0xa873('0xa1')](_0x15886a[_0xa873('0x29')]);});_0x47de67[_0xa873('0xa2')](function(_0x82b068){var _0x14ff9c=createFieldObject(_0x1d619b,_0x543370,_0x82b068[_0xa873('0xa3')],_0x82b068[_0xa873('0x29')],_0x82b068['label'],![]);_0x1453cf[_0xa873('0xa4')](_0x14ff9c);});return Promise[_0xa873('0xa5')](_0x1453cf);})['then'](function(_0x9acae1){_0x11f3b4=_0x9acae1;_0x435711=Object[_0xa873('0x9f')]([],_0x3869fb);console[_0xa873('0x9e')](_0xa873('0xa6'),_0x3869fb);_[_0xa873('0xa0')](_0x435711,function(_0x50b3f3){return _0x44fbfd['includes'](_0x50b3f3[_0xa873('0x29')]);});console[_0xa873('0x9e')](_0xa873('0xa7'),_0x435711);_0x1453cf=[];_0x435711[_0xa873('0xa2')](function(_0x45375c){var _0x414881=createFieldObject(_0x1d619b,_0x543370,_0x45375c['internalType'],_0x45375c[_0xa873('0x29')],_0x45375c[_0xa873('0xa8')],!![]);_0x1453cf[_0xa873('0xa4')](_0x414881);});return Promise['all'](_0x1453cf);})[_0xa873('0x26')](function(_0x1f6535){_0xce0d6f=_0x1f6535;var _0x43177d=_0x11f3b4[_0xa873('0xa9')](_0xce0d6f);return{'count':_0x43177d['length'],'rows':_0x43177d};})[_0xa873('0x26')](respondWithResult(_0x593c75,null))[_0xa873('0x41')](function(_0x53a87c){console[_0xa873('0x9e')](_0xa873('0xaa')+_0x53a87c);var _0x5ec275=_0x2b9d70['query'][_0xa873('0xab')]?0x1f4:_0x53a87c[_0xa873('0xac')]||0x1f4;logger['error'](_0x53a87c[_0xa873('0x28')]);delete _0x53a87c['name'];if(_0x5ec275===0x191){_0x5ec275=0x190;}_0x593c75[_0xa873('0x1a')](_0x5ec275)['send'](_0x2b9d70[_0xa873('0x31')]['test']?{'message':_0xa873('0xad'),'statusCode':_0x53a87c[_0xa873('0xac')]}:_0x53a87c);});};function createFieldObject(_0x4b8f87,_0x622cc3,_0x193270,_0x434c87,_0x49c6e5,_0x138a56){return new Promise(function(_0x2f0671,_0x380fbb){var _0x50569a={'id':_0x434c87,'name':_0x49c6e5,'custom':_0x138a56};if(_0x193270===_0xa873('0xae')){_0x50569a[_0xa873('0x45')]=[{'name':_0xa873('0xaf'),'value':_0xa873('0xb0')},{'name':_0xa873('0xb1'),'value':_0xa873('0xb2')}];_0x2f0671(_0x50569a);}else{var _0x419e1c={'method':_0xa873('0x9b'),'uri':_0x4b8f87+'sys_choice?sysparm_query=name=incident^element='+_0x434c87,'auth':_0x622cc3,'json':!![]};return rp(_0x419e1c)[_0xa873('0x26')](function(_0x5a183){var _0x24a432=[];if(_0x5a183[_0xa873('0x9d')][_0xa873('0x44')]>0x0){_0x5a183[_0xa873('0x9d')][_0xa873('0xa2')](function(_0x1b8434){if(_0x1b8434[_0xa873('0xb3')]===_0xa873('0xb2')){var _0x54042a={'name':_0x1b8434[_0xa873('0xa8')],'value':_0x1b8434[_0xa873('0xb4')]};_0x24a432[_0xa873('0xa4')](_0x54042a);}});}_0x50569a[_0xa873('0x45')]=_0x24a432;if(_0x50569a[_0xa873('0x45')][_0xa873('0x44')]>0x0){_0x2f0671(_0x50569a);}else{if(_0x138a56==![]){_0x2f0671();}else{_0x2f0671(_0x50569a);}}});}});} \ No newline at end of file +var _0x6308=['VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','destroy','getConfigurations','ServicenowConfiguration','filter','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','knowledge','subcategory','close_code','notify','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','order','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','upon_approval','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','all','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','end','error','stack','name','index','map','ServicenowAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick'];(function(_0x4b23d3,_0x332657){var _0x459c0f=function(_0x7770ee){while(--_0x7770ee){_0x4b23d3['push'](_0x4b23d3['shift']());}};_0x459c0f(++_0x332657);}(_0x6308,0x85));var _0x8630=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x6308[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require(_0x8630('0x1'));var zipdir=require(_0x8630('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8630('0x3'));var moment=require('moment');var BPromise=require(_0x8630('0x4'));var Mustache=require(_0x8630('0x5'));var util=require(_0x8630('0x6'));var path=require('path');var sox=require(_0x8630('0x7'));var csv=require(_0x8630('0x8'));var ejs=require(_0x8630('0x9'));var fs=require('fs');var fs_extra=require(_0x8630('0xa'));var _=require(_0x8630('0xb'));var squel=require(_0x8630('0xc'));var crypto=require(_0x8630('0xd'));var jsforce=require(_0x8630('0xe'));var deskjs=require(_0x8630('0xf'));var toCsv=require(_0x8630('0x8'));var querystring=require(_0x8630('0x10'));var Papa=require(_0x8630('0x11'));var Redis=require(_0x8630('0x12'));var authService=require(_0x8630('0x13'));var qs=require(_0x8630('0x14'));var as=require(_0x8630('0x15'));var hardwareService=require(_0x8630('0x16'));var logger=require(_0x8630('0x17'))(_0x8630('0x18'));var utils=require(_0x8630('0x19'));var config=require(_0x8630('0x1a'));var licenseUtil=require(_0x8630('0x1b'));var db=require(_0x8630('0x1c'))['db'];var integrations=require(_0x8630('0x1d'));function respondWithStatusCode(_0x2d7476,_0x51597f){_0x51597f=_0x51597f||0xcc;return function(_0x4b0297){if(_0x4b0297){return _0x2d7476[_0x8630('0x1e')](_0x51597f);}return _0x2d7476['status'](_0x51597f)['end']();};}function respondWithResult(_0x19557d,_0xcd7c86){_0xcd7c86=_0xcd7c86||0xc8;return function(_0x3e5229){if(_0x3e5229){return _0x19557d['status'](_0xcd7c86)[_0x8630('0x1f')](_0x3e5229);}};}function respondWithFilteredResult(_0x2dee81,_0xd4193b){return function(_0x38e12b){if(_0x38e12b){var _0x52a1de=typeof _0xd4193b[_0x8630('0x20')]===_0x8630('0x21')&&typeof _0xd4193b[_0x8630('0x22')]===_0x8630('0x21');var _0x559f82=_0x38e12b[_0x8630('0x23')];var _0x45b84e=_0x52a1de?0x0:_0xd4193b[_0x8630('0x20')];var _0x58a853=_0x52a1de?_0x38e12b[_0x8630('0x23')]:_0xd4193b[_0x8630('0x20')]+_0xd4193b[_0x8630('0x22')];var _0x47d104;if(_0x58a853>=_0x559f82){_0x58a853=_0x559f82;_0x47d104=0xc8;}else{_0x47d104=0xce;}_0x2dee81[_0x8630('0x24')](_0x47d104);return _0x2dee81['set'](_0x8630('0x25'),_0x45b84e+'-'+_0x58a853+'/'+_0x559f82)[_0x8630('0x1f')](_0x38e12b);}return null;};}function patchUpdates(_0x193ca0){return function(_0x38c853){try{jsonpatch[_0x8630('0x26')](_0x38c853,_0x193ca0,!![]);}catch(_0x396f48){return BPromise[_0x8630('0x27')](_0x396f48);}return _0x38c853['save']();};}function saveUpdates(_0x53e71c,_0xe2c124){return function(_0xa10c6f){if(_0xa10c6f){return _0xa10c6f[_0x8630('0x28')](_0x53e71c)['then'](function(_0x3e21e9){return _0x3e21e9;});}return null;};}function removeEntity(_0x20831b,_0x53fb06){return function(_0x5df3ea){if(_0x5df3ea){return _0x5df3ea['destroy']()['then'](function(){_0x20831b[_0x8630('0x24')](0xcc)[_0x8630('0x29')]();});}};}function handleEntityNotFound(_0x416e8f,_0x19d77f){return function(_0x1edeb6){if(!_0x1edeb6){_0x416e8f[_0x8630('0x1e')](0x194);}return _0x1edeb6;};}function handleError(_0x44c2b4,_0x7b40f0){_0x7b40f0=_0x7b40f0||0x1f4;return function(_0x138bcd){logger[_0x8630('0x2a')](_0x138bcd[_0x8630('0x2b')]);if(_0x138bcd['name']){delete _0x138bcd[_0x8630('0x2c')];}_0x44c2b4[_0x8630('0x24')](_0x7b40f0)['send'](_0x138bcd);};}exports[_0x8630('0x2d')]=function(_0x5a6265,_0x58358b){var _0x443088={},_0x46f7ea={},_0x2791d6={'count':0x0,'rows':[]};var _0x52b04f=_[_0x8630('0x2e')](db[_0x8630('0x2f')]['rawAttributes'],function(_0x150433){return{'name':_0x150433[_0x8630('0x30')],'type':_0x150433[_0x8630('0x31')][_0x8630('0x32')]};});_0x46f7ea[_0x8630('0x33')]=_[_0x8630('0x2e')](_0x52b04f,_0x8630('0x2c'));_0x46f7ea[_0x8630('0x34')]=_['keys'](_0x5a6265[_0x8630('0x34')]);_0x46f7ea[_0x8630('0x35')]=_[_0x8630('0x36')](_0x46f7ea[_0x8630('0x33')],_0x46f7ea[_0x8630('0x34')]);_0x443088['attributes']=_[_0x8630('0x36')](_0x46f7ea[_0x8630('0x33')],qs['fields'](_0x5a6265[_0x8630('0x34')][_0x8630('0x37')]));_0x443088[_0x8630('0x38')]=_0x443088[_0x8630('0x38')]['length']?_0x443088[_0x8630('0x38')]:_0x46f7ea[_0x8630('0x33')];if(!_0x5a6265[_0x8630('0x34')]['hasOwnProperty'](_0x8630('0x39'))){_0x443088[_0x8630('0x22')]=qs[_0x8630('0x22')](_0x5a6265[_0x8630('0x34')][_0x8630('0x22')]);_0x443088[_0x8630('0x20')]=qs[_0x8630('0x20')](_0x5a6265['query']['offset']);}_0x443088['order']=qs[_0x8630('0x3a')](_0x5a6265['query'][_0x8630('0x3a')]);_0x443088[_0x8630('0x3b')]=qs[_0x8630('0x35')](_[_0x8630('0x3c')](_0x5a6265[_0x8630('0x34')],_0x46f7ea[_0x8630('0x35')]),_0x52b04f);if(_0x5a6265[_0x8630('0x34')]['filter']){_0x443088[_0x8630('0x3b')]=_['merge'](_0x443088[_0x8630('0x3b')],{'$or':_[_0x8630('0x2e')](_0x52b04f,function(_0x4c2231){if(_0x4c2231[_0x8630('0x31')]!==_0x8630('0x3d')){var _0x1124b6={};_0x1124b6[_0x4c2231[_0x8630('0x2c')]]={'$like':'%'+_0x5a6265[_0x8630('0x34')]['filter']+'%'};return _0x1124b6;}})});}_0x443088=_[_0x8630('0x3e')]({},_0x443088,_0x5a6265[_0x8630('0x3f')]);var _0x45d27f={'where':_0x443088[_0x8630('0x3b')]};return db['ServicenowAccount']['count'](_0x45d27f)[_0x8630('0x40')](function(_0xaa0016){_0x2791d6[_0x8630('0x23')]=_0xaa0016;if(_0x5a6265[_0x8630('0x34')][_0x8630('0x41')]){_0x443088[_0x8630('0x42')]=[{'all':!![]}];}return db[_0x8630('0x2f')][_0x8630('0x43')](_0x443088);})[_0x8630('0x40')](function(_0x3a5950){_0x2791d6[_0x8630('0x44')]=_0x3a5950;return _0x2791d6;})['then'](respondWithFilteredResult(_0x58358b,_0x443088))[_0x8630('0x45')](handleError(_0x58358b,null));};exports['show']=function(_0x5f1556,_0x337975){var _0x1bb1c4={'raw':![],'where':{'id':_0x5f1556[_0x8630('0x46')]['id']}},_0x10f72f={};_0x10f72f[_0x8630('0x33')]=_[_0x8630('0x47')](db[_0x8630('0x2f')][_0x8630('0x48')]);_0x10f72f['query']=_[_0x8630('0x47')](_0x5f1556[_0x8630('0x34')]);_0x10f72f[_0x8630('0x35')]=_[_0x8630('0x36')](_0x10f72f[_0x8630('0x33')],_0x10f72f['query']);_0x1bb1c4[_0x8630('0x38')]=_[_0x8630('0x36')](_0x10f72f[_0x8630('0x33')],qs[_0x8630('0x37')](_0x5f1556[_0x8630('0x34')][_0x8630('0x37')]));_0x1bb1c4[_0x8630('0x38')]=_0x1bb1c4['attributes'][_0x8630('0x49')]?_0x1bb1c4[_0x8630('0x38')]:_0x10f72f[_0x8630('0x33')];if(_0x5f1556[_0x8630('0x34')][_0x8630('0x41')]){_0x1bb1c4['include']=[{'all':!![]}];}_0x1bb1c4=_[_0x8630('0x3e')]({},_0x1bb1c4,_0x5f1556[_0x8630('0x3f')]);return db[_0x8630('0x2f')][_0x8630('0x4a')](_0x1bb1c4)[_0x8630('0x40')](handleEntityNotFound(_0x337975,null))['then'](respondWithResult(_0x337975,null))[_0x8630('0x45')](handleError(_0x337975,null));};exports[_0x8630('0x4b')]=function(_0x572426,_0x1aef56){return db[_0x8630('0x2f')][_0x8630('0x4b')](_0x572426[_0x8630('0x4c')],{})[_0x8630('0x40')](respondWithResult(_0x1aef56,0xc9))[_0x8630('0x45')](handleError(_0x1aef56,null));};exports[_0x8630('0x28')]=function(_0x35229a,_0x52fe49){if(_0x35229a[_0x8630('0x4c')]['id']){delete _0x35229a[_0x8630('0x4c')]['id'];}return db[_0x8630('0x2f')][_0x8630('0x4a')]({'where':{'id':_0x35229a[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x52fe49,null))[_0x8630('0x40')](saveUpdates(_0x35229a[_0x8630('0x4c')],null))[_0x8630('0x40')](respondWithResult(_0x52fe49,null))['catch'](handleError(_0x52fe49,null));};exports[_0x8630('0x4d')]=function(_0x5724ba,_0x35b822){return db[_0x8630('0x2f')][_0x8630('0x4a')]({'where':{'id':_0x5724ba[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x35b822,null))[_0x8630('0x40')](removeEntity(_0x35b822,null))['catch'](handleError(_0x35b822,null));};exports[_0x8630('0x4e')]=function(_0x589188,_0x46822e,_0x2f1cc4){var _0x1656bb={};var _0x522a2f={};var _0x4985d7;var _0x523508;return db[_0x8630('0x2f')]['findOne']({'where':{'id':_0x589188[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x46822e,null))[_0x8630('0x40')](function(_0x48cd5e){if(_0x48cd5e){_0x4985d7=_0x48cd5e;_0x522a2f[_0x8630('0x33')]=_[_0x8630('0x47')](db[_0x8630('0x4f')][_0x8630('0x48')]);_0x522a2f[_0x8630('0x34')]=_['keys'](_0x589188[_0x8630('0x34')]);_0x522a2f[_0x8630('0x35')]=_[_0x8630('0x36')](_0x522a2f[_0x8630('0x33')],_0x522a2f[_0x8630('0x34')]);_0x1656bb[_0x8630('0x38')]=_[_0x8630('0x36')](_0x522a2f['model'],qs[_0x8630('0x37')](_0x589188['query'][_0x8630('0x37')]));_0x1656bb['attributes']=_0x1656bb['attributes'][_0x8630('0x49')]?_0x1656bb[_0x8630('0x38')]:_0x522a2f[_0x8630('0x33')];_0x1656bb['order']=qs['sort'](_0x589188[_0x8630('0x34')]['sort']);_0x1656bb[_0x8630('0x3b')]=qs[_0x8630('0x35')](_[_0x8630('0x3c')](_0x589188[_0x8630('0x34')],_0x522a2f[_0x8630('0x35')]));if(_0x589188[_0x8630('0x34')]['filter']){_0x1656bb[_0x8630('0x3b')]=_['merge'](_0x1656bb['where'],{'$or':_[_0x8630('0x2e')](_0x1656bb['attributes'],function(_0x539504){var _0x5693f6={};_0x5693f6[_0x539504]={'$like':'%'+_0x589188[_0x8630('0x34')][_0x8630('0x50')]+'%'};return _0x5693f6;})});}_0x1656bb=_['merge']({},_0x1656bb,_0x589188[_0x8630('0x3f')]);return _0x4985d7['getConfigurations'](_0x1656bb);}})[_0x8630('0x40')](function(_0x3b1f42){if(_0x3b1f42){_0x523508=_0x3b1f42[_0x8630('0x49')];if(!_0x589188[_0x8630('0x34')][_0x8630('0x51')](_0x8630('0x39'))){_0x1656bb[_0x8630('0x22')]=qs['limit'](_0x589188['query']['limit']);_0x1656bb[_0x8630('0x20')]=qs[_0x8630('0x20')](_0x589188[_0x8630('0x34')]['offset']);}return _0x4985d7['getConfigurations'](_0x1656bb);}})[_0x8630('0x40')](function(_0x3a19e7){if(_0x3a19e7){return _0x3a19e7?{'count':_0x523508,'rows':_0x3a19e7}:null;}})['then'](respondWithResult(_0x46822e,null))['catch'](handleError(_0x46822e,null));};exports[_0x8630('0x52')]=function(_0x2f73d7,_0x1aa4e1,_0x38e7bf){if(_0x2f73d7[_0x8630('0x4c')]['id']){delete _0x2f73d7[_0x8630('0x4c')]['id'];}return db[_0x8630('0x2f')][_0x8630('0x53')]({'where':{'id':_0x2f73d7[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x1aa4e1,null))['then'](function(_0x53c446){if(_0x53c446){_0x2f73d7[_0x8630('0x4c')][_0x8630('0x54')]=_0x53c446['id'];_0x2f73d7['body'][_0x8630('0x55')]=integrations['getSubjects'](_0x2f73d7[_0x8630('0x4c')][_0x8630('0x56')],_0x2f73d7[_0x8630('0x4c')][_0x8630('0x31')]);_0x2f73d7['body'][_0x8630('0x57')]=integrations[_0x8630('0x58')](_0x2f73d7[_0x8630('0x4c')][_0x8630('0x56')],_0x2f73d7[_0x8630('0x4c')]['type']);return db[_0x8630('0x4f')]['create'](_0x2f73d7[_0x8630('0x4c')],{'include':[{'model':db['ServicenowField'],'as':_0x8630('0x55')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x8630('0x40')](respondWithResult(_0x1aa4e1,null))[_0x8630('0x45')](handleError(_0x1aa4e1,null));};exports[_0x8630('0x59')]=function(_0x8311cc,_0x545ff2,_0x2967d9){var _0x5f38e5=['made_sla','hold_reason',_0x8630('0x5a'),_0x8630('0x5b'),_0x8630('0x5c'),_0x8630('0x5d'),'incident_state',_0x8630('0x5e'),'category'];var _0x2ee5b8=[_0x8630('0x5f'),'made_sla','caused_by',_0x8630('0x60'),_0x8630('0x61'),_0x8630('0x62'),_0x8630('0x63'),_0x8630('0x64'),_0x8630('0x65'),_0x8630('0x66'),_0x8630('0x67'),_0x8630('0x68'),_0x8630('0x69'),_0x8630('0x6a'),_0x8630('0x6b'),_0x8630('0x6c'),_0x8630('0x6d'),_0x8630('0x6e'),_0x8630('0x5a'),_0x8630('0x6f'),'calendar_stc','closed_at',_0x8630('0x70'),_0x8630('0x71'),_0x8630('0x72'),_0x8630('0x73'),_0x8630('0x74'),_0x8630('0x75'),'priority',_0x8630('0x76'),_0x8630('0x77'),_0x8630('0x78'),_0x8630('0x79'),'opened_at',_0x8630('0x7a'),_0x8630('0x7b'),_0x8630('0x7c'),_0x8630('0x7d'),_0x8630('0x7e'),_0x8630('0x7f'),_0x8630('0x80'),_0x8630('0x5b'),_0x8630('0x81'),_0x8630('0x82'),'close_code',_0x8630('0x83'),_0x8630('0x84'),'work_start',_0x8630('0x85'),_0x8630('0x86'),_0x8630('0x87'),_0x8630('0x88'),_0x8630('0x89'),_0x8630('0x5d'),'sys_class_name',_0x8630('0x8a'),_0x8630('0x8b'),_0x8630('0x8c'),_0x8630('0x8d'),_0x8630('0x8e'),'contact_type',_0x8630('0x8f'),'incident_state',_0x8630('0x90'),_0x8630('0x91'),_0x8630('0x92'),_0x8630('0x93'),_0x8630('0x94'),_0x8630('0x95'),_0x8630('0x5e'),_0x8630('0x96'),_0x8630('0x97'),_0x8630('0x98'),'comments_and_work_notes',_0x8630('0x99'),_0x8630('0x9a'),'reopen_count',_0x8630('0x9b'),_0x8630('0x9c'),_0x8630('0x9d'),'correlation_id',_0x8630('0x9e'),_0x8630('0x9f')];var _0x426953='';var _0x1f02c0='';var _0x39ef0c=[];var _0x4d6e79='';var _0x357155='';var _0x3d0af6=[];var _0x18c4bd='';var _0x538be0='';var _0x43053c={};var _0xfb08bf='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x8311cc[_0x8630('0x46')]['id']},'attributes':['id','username',_0x8630('0xa0'),_0x8630('0xa1'),_0x8630('0xa2'),_0x8630('0xa3')]})[_0x8630('0x40')](handleEntityNotFound(_0x545ff2,null))['then'](function(_0x4f2fe0){if(_0x4f2fe0){_0xfb08bf=_0x4f2fe0[_0x8630('0xa2')];var _0x1a074d=_0xfb08bf[_0x8630('0xa4')](-0x1);if(_0x1a074d==='/'){_0xfb08bf=_0xfb08bf[_0x8630('0xa5')](0x0,_0xfb08bf[_0x8630('0xa6')](_0x1a074d));}_0x538be0=util[_0x8630('0xa7')](_0x8630('0xa8'),_0xfb08bf);_0x18c4bd=util[_0x8630('0xa7')](_0x8630('0xa9'),_0xfb08bf);_0x43053c={'user':_0x4f2fe0[_0x8630('0xaa')],'pass':_0x4f2fe0[_0x8630('0xa0')]};var _0x22e810={'method':'GET','uri':_0x538be0+'incident?sysparm_display_value=all','auth':_0x43053c,'json':!![]};return rp(_0x22e810);}})['then'](function(_0x3d522a){if(_0x3d522a[_0x8630('0xab')][_0x8630('0x49')]>0x0){_0x426953=_0x3d522a[_0x8630('0xab')];}console[_0x8630('0xac')](_0x8630('0xad'),_0x426953);_0x3d0af6=[];_0x1f02c0=Object[_0x8630('0xae')]([],_0x426953);_['remove'](_0x1f02c0,function(_0x172d43){return!_0x5f38e5[_0x8630('0xaf')](_0x172d43[_0x8630('0x2c')]);});_0x1f02c0[_0x8630('0xb0')](function(_0x27a1b1){var _0x176a82=createFieldObject(_0x18c4bd,_0x43053c,_0x27a1b1[_0x8630('0xb1')],_0x27a1b1[_0x8630('0x2c')],_0x27a1b1['label'],![]);_0x3d0af6['push'](_0x176a82);});return Promise['all'](_0x3d0af6);})[_0x8630('0x40')](function(_0x271bee){_0x39ef0c=_0x271bee;_0x4d6e79=Object[_0x8630('0xae')]([],_0x426953);console[_0x8630('0xac')](_0x8630('0xb2'),_0x426953);_['remove'](_0x4d6e79,function(_0x21017f){return _0x2ee5b8[_0x8630('0xaf')](_0x21017f[_0x8630('0x2c')]);});console[_0x8630('0xac')](_0x8630('0xb3'),_0x4d6e79);_0x3d0af6=[];_0x4d6e79['forEach'](function(_0x17487d){var _0x133a8c=createFieldObject(_0x18c4bd,_0x43053c,_0x17487d[_0x8630('0xb1')],_0x17487d['name'],_0x17487d[_0x8630('0xb4')],!![]);_0x3d0af6[_0x8630('0xb5')](_0x133a8c);});return Promise[_0x8630('0xb6')](_0x3d0af6);})['then'](function(_0x424560){_0x357155=_0x424560;var _0x3dd9f2=_0x39ef0c['concat'](_0x357155);return{'count':_0x3dd9f2[_0x8630('0x49')],'rows':_0x3dd9f2};})[_0x8630('0x40')](respondWithResult(_0x545ff2,null))[_0x8630('0x45')](function(_0x4f6df7){console['log'](_0x8630('0xb7')+_0x4f6df7);var _0x435146=_0x8311cc['query'][_0x8630('0xb8')]?0x1f4:_0x4f6df7[_0x8630('0xb9')]||0x1f4;logger[_0x8630('0x2a')](_0x4f6df7[_0x8630('0x2b')]);delete _0x4f6df7[_0x8630('0x2c')];if(_0x435146===0x191){_0x435146=0x190;}_0x545ff2[_0x8630('0x24')](_0x435146)['send'](_0x8311cc[_0x8630('0x34')][_0x8630('0xb8')]?{'message':_0x8630('0xba'),'statusCode':_0x4f6df7[_0x8630('0xb9')]}:_0x4f6df7);});};function createFieldObject(_0x4cf47c,_0x1b730b,_0x24690f,_0x2b5cea,_0x4dfac5,_0x1afce8){return new Promise(function(_0x4f1c55,_0x201d28){var _0x1a32e7={'id':_0x2b5cea,'name':_0x4dfac5,'custom':_0x1afce8};if(_0x24690f===_0x8630('0xbb')){_0x1a32e7[_0x8630('0x3f')]=[{'name':_0x8630('0xbc'),'value':_0x8630('0xbd')},{'name':_0x8630('0xbe'),'value':_0x8630('0xbf')}];_0x4f1c55(_0x1a32e7);}else{var _0x5e2e82={'method':_0x8630('0xc0'),'uri':_0x4cf47c+_0x8630('0xc1')+_0x2b5cea,'auth':_0x1b730b,'json':!![]};return rp(_0x5e2e82)['then'](function(_0x11bc22){var _0x34ea26=[];if(_0x11bc22['result'][_0x8630('0x49')]>0x0){_0x11bc22[_0x8630('0xab')][_0x8630('0xb0')](function(_0x92617){if(_0x92617['inactive']==='false'){var _0x3d3951={'name':_0x92617[_0x8630('0xb4')],'value':_0x92617['value']};_0x34ea26['push'](_0x3d3951);}});}_0x1a32e7[_0x8630('0x3f')]=_0x34ea26;if(_0x1a32e7[_0x8630('0x3f')][_0x8630('0x49')]>0x0){_0x4f1c55(_0x1a32e7);}else{if(_0x1afce8==![]){_0x4f1c55();}else{_0x4f1c55(_0x1a32e7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index cdad2a5..c7b4d4f 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 _0xba34=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x151998,_0x548e07){var _0x477f27=function(_0x98e97f){while(--_0x98e97f){_0x151998['push'](_0x151998['shift']());}};_0x477f27(++_0x548e07);}(_0xba34,0x119));var _0x4ba3=function(_0x98b227,_0x460cc5){_0x98b227=_0x98b227-0x0;var _0x53b6ca=_0xba34[_0x98b227];return _0x53b6ca;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x33ef0b,_0x10390a){var _0x10d8a2=function(_0x5baa11){while(--_0x5baa11){_0x33ef0b['push'](_0x33ef0b['shift']());}};_0x10d8a2(++_0x10390a);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'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 6aee033..53fed09 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 _0x95ac=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ServicenowAccount','options','where','attributes','limit','include','map','model','GetServicenowAccount','debug','catch','ShowServicenowAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4124a7,_0x3beb55){var _0x399d50=function(_0x54b697){while(--_0x54b697){_0x4124a7['push'](_0x4124a7['shift']());}};_0x399d50(++_0x3beb55);}(_0x95ac,0x1aa));var _0xc95a=function(_0xfb4b3f,_0x575cd3){_0xfb4b3f=_0xfb4b3f-0x0;var _0x305dc3=_0x95ac[_0xfb4b3f];return _0x305dc3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc95a('0x0'));var BPromise=require(_0xc95a('0x1'));var rs=require(_0xc95a('0x2'));var fs=require('fs');var Redis=require(_0xc95a('0x3'));var db=require(_0xc95a('0x4'))['db'];var utils=require(_0xc95a('0x5'));var logger=require(_0xc95a('0x6'))(_0xc95a('0x7'));var config=require(_0xc95a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc95a('0x9')][_0xc95a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3beadc,_0x1cefcd,_0xd4cc4){return new BPromise(function(_0x1e0704,_0x55aab0){return client[_0xc95a('0xb')](_0x3beadc,_0xd4cc4)[_0xc95a('0xc')](function(_0x5021f3){logger[_0xc95a('0xd')](_0xc95a('0xe'),_0x1cefcd,_0xc95a('0xf'));logger['debug'](_0xc95a('0x10'),_0x1cefcd,_0xc95a('0xf'),JSON[_0xc95a('0x11')](_0x5021f3));if(_0x5021f3[_0xc95a('0x12')]){if(_0x5021f3['error'][_0xc95a('0x13')]===0x1f4){logger[_0xc95a('0x12')](_0xc95a('0xe'),_0x1cefcd,_0x5021f3[_0xc95a('0x12')]['message']);return _0x55aab0(_0x5021f3[_0xc95a('0x12')][_0xc95a('0x14')]);}logger[_0xc95a('0x12')](_0xc95a('0xe'),_0x1cefcd,_0x5021f3[_0xc95a('0x12')][_0xc95a('0x14')]);return _0x1e0704(_0x5021f3[_0xc95a('0x12')][_0xc95a('0x14')]);}else{logger['info'](_0xc95a('0xe'),_0x1cefcd,_0xc95a('0xf'));_0x1e0704(_0x5021f3[_0xc95a('0x15')][_0xc95a('0x14')]);}})['catch'](function(_0x348961){logger[_0xc95a('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1cefcd,_0x348961);_0x55aab0(_0x348961);});});}exports['GetServicenowAccount']=function(_0x34eb02){var _0x3b78b1=this;return new Promise(function(_0x3dad39,_0x5b8c51){return db[_0xc95a('0x16')]['findAll']({'raw':_0x34eb02[_0xc95a('0x17')]?_0x34eb02['options']['raw']===undefined?!![]:![]:!![],'where':_0x34eb02[_0xc95a('0x17')]?_0x34eb02[_0xc95a('0x17')][_0xc95a('0x18')]||null:null,'attributes':_0x34eb02[_0xc95a('0x17')]?_0x34eb02[_0xc95a('0x17')][_0xc95a('0x19')]||null:null,'limit':_0x34eb02['options']?_0x34eb02['options'][_0xc95a('0x1a')]||null:null,'include':_0x34eb02[_0xc95a('0x17')]?_0x34eb02[_0xc95a('0x17')][_0xc95a('0x1b')]?_[_0xc95a('0x1c')](_0x34eb02[_0xc95a('0x17')][_0xc95a('0x1b')],function(_0x60d23f){return{'model':db[_0x60d23f[_0xc95a('0x1d')]],'as':_0x60d23f['as'],'attributes':_0x60d23f[_0xc95a('0x19')],'include':_0x60d23f[_0xc95a('0x1b')]?_[_0xc95a('0x1c')](_0x60d23f['include'],function(_0xab598c){return{'model':db[_0xab598c[_0xc95a('0x1d')]],'as':_0xab598c['as'],'attributes':_0xab598c[_0xc95a('0x19')],'include':_0xab598c['include']?_[_0xc95a('0x1c')](_0xab598c[_0xc95a('0x1b')],function(_0x1a5940){return{'model':db[_0x1a5940['model']],'as':_0x1a5940['as'],'attributes':_0x1a5940[_0xc95a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc0cee4){logger[_0xc95a('0xd')](_0xc95a('0x1e'),_0x34eb02);logger[_0xc95a('0x1f')](_0xc95a('0x1e'),_0x34eb02,JSON[_0xc95a('0x11')](_0xc0cee4));_0x3dad39(_0xc0cee4);})[_0xc95a('0x20')](function(_0xc9de62){logger[_0xc95a('0x12')](_0xc95a('0x1e'),_0xc9de62['message'],_0x34eb02);_0x5b8c51(_0x3b78b1['error'](0x1f4,_0xc9de62[_0xc95a('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x1b4520){var _0x4822a8=this;return new Promise(function(_0x3dd622,_0x58a498){return db[_0xc95a('0x16')]['find']({'raw':_0x1b4520['options']?_0x1b4520[_0xc95a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b4520['options']?_0x1b4520[_0xc95a('0x17')][_0xc95a('0x18')]||null:null,'attributes':_0x1b4520[_0xc95a('0x17')]?_0x1b4520[_0xc95a('0x17')][_0xc95a('0x19')]||null:null,'include':_0x1b4520[_0xc95a('0x17')]?_0x1b4520[_0xc95a('0x17')][_0xc95a('0x1b')]?_[_0xc95a('0x1c')](_0x1b4520[_0xc95a('0x17')]['include'],function(_0x40424a){return{'model':db[_0x40424a[_0xc95a('0x1d')]],'as':_0x40424a['as'],'attributes':_0x40424a[_0xc95a('0x19')],'include':_0x40424a[_0xc95a('0x1b')]?_['map'](_0x40424a[_0xc95a('0x1b')],function(_0x3dccf8){return{'model':db[_0x3dccf8['model']],'as':_0x3dccf8['as'],'attributes':_0x3dccf8[_0xc95a('0x19')],'include':_0x3dccf8[_0xc95a('0x1b')]?_['map'](_0x3dccf8[_0xc95a('0x1b')],function(_0x4be193){return{'model':db[_0x4be193[_0xc95a('0x1d')]],'as':_0x4be193['as'],'attributes':_0x4be193[_0xc95a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc95a('0xc')](function(_0x55d4e0){logger['info'](_0xc95a('0x21'),_0x1b4520);logger['debug'](_0xc95a('0x21'),_0x1b4520,JSON['stringify'](_0x55d4e0));_0x3dd622(_0x55d4e0);})[_0xc95a('0x20')](function(_0x3dcd12){logger[_0xc95a('0x12')]('ShowServicenowAccount',_0x3dcd12[_0xc95a('0x14')],_0x1b4520);_0x58a498(_0x4822a8[_0xc95a('0x12')](0x1f4,_0x3dcd12[_0xc95a('0x14')]));});});}; \ No newline at end of file +var _0x8679=['ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','stringify','find'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8679,0xb5));var _0x9867=function(_0x4d6d72,_0x2a3f6b){_0x4d6d72=_0x4d6d72-0x0;var _0x2772a2=_0x8679[_0x4d6d72];return _0x2772a2;};'use strict';var _=require(_0x9867('0x0'));var util=require(_0x9867('0x1'));var moment=require(_0x9867('0x2'));var BPromise=require(_0x9867('0x3'));var rs=require(_0x9867('0x4'));var fs=require('fs');var Redis=require(_0x9867('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9867('0x6'));var logger=require(_0x9867('0x7'))(_0x9867('0x8'));var config=require(_0x9867('0x9'));var jayson=require(_0x9867('0xa'));var client=jayson[_0x9867('0xb')][_0x9867('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f7ccd,_0x258c85,_0x95d4b5){return new BPromise(function(_0x2b0732,_0x3d48d9){return client[_0x9867('0xd')](_0x3f7ccd,_0x95d4b5)[_0x9867('0xe')](function(_0x572672){logger['info'](_0x9867('0xf'),_0x258c85,'request\x20sent');logger['debug'](_0x9867('0x10'),_0x258c85,_0x9867('0x11'),JSON['stringify'](_0x572672));if(_0x572672[_0x9867('0x12')]){if(_0x572672[_0x9867('0x12')][_0x9867('0x13')]===0x1f4){logger[_0x9867('0x12')](_0x9867('0xf'),_0x258c85,_0x572672[_0x9867('0x12')][_0x9867('0x14')]);return _0x3d48d9(_0x572672[_0x9867('0x12')]['message']);}logger[_0x9867('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x258c85,_0x572672[_0x9867('0x12')]['message']);return _0x2b0732(_0x572672[_0x9867('0x12')][_0x9867('0x14')]);}else{logger[_0x9867('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x258c85,'request\x20sent');_0x2b0732(_0x572672[_0x9867('0x16')][_0x9867('0x14')]);}})[_0x9867('0x17')](function(_0x4435a7){logger[_0x9867('0x12')](_0x9867('0xf'),_0x258c85,_0x4435a7);_0x3d48d9(_0x4435a7);});});}exports['GetServicenowAccount']=function(_0x5b40f0){var _0x5717ad=this;return new Promise(function(_0x2b97bb,_0x38514d){return db['ServicenowAccount'][_0x9867('0x18')]({'raw':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1b')]||null:null,'attributes':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1c')]||null:null,'limit':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')]['limit']||null:null,'include':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1d')]?_['map'](_0x5b40f0[_0x9867('0x19')][_0x9867('0x1d')],function(_0x8a9cc){return{'model':db[_0x8a9cc['model']],'as':_0x8a9cc['as'],'attributes':_0x8a9cc[_0x9867('0x1c')],'include':_0x8a9cc[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x8a9cc[_0x9867('0x1d')],function(_0x49204b){return{'model':db[_0x49204b['model']],'as':_0x49204b['as'],'attributes':_0x49204b[_0x9867('0x1c')],'include':_0x49204b['include']?_[_0x9867('0x1e')](_0x49204b[_0x9867('0x1d')],function(_0x2b1e43){return{'model':db[_0x2b1e43[_0x9867('0x1f')]],'as':_0x2b1e43['as'],'attributes':_0x2b1e43[_0x9867('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x227ae0){logger[_0x9867('0x15')](_0x9867('0x20'),_0x5b40f0);logger['debug']('GetServicenowAccount',_0x5b40f0,JSON[_0x9867('0x21')](_0x227ae0));_0x2b97bb(_0x227ae0);})[_0x9867('0x17')](function(_0x257102){logger[_0x9867('0x12')](_0x9867('0x20'),_0x257102[_0x9867('0x14')],_0x5b40f0);_0x38514d(_0x5717ad[_0x9867('0x12')](0x1f4,_0x257102[_0x9867('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x1647b2){var _0x146af4=this;return new Promise(function(_0x449a74,_0x22331b){return db['ServicenowAccount'][_0x9867('0x22')]({'raw':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')][_0x9867('0x1a')]===undefined?!![]:![]:!![],'where':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')]['where']||null:null,'attributes':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')][_0x9867('0x1c')]||null:null,'include':_0x1647b2['options']?_0x1647b2[_0x9867('0x19')][_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x1647b2[_0x9867('0x19')][_0x9867('0x1d')],function(_0x94711b){return{'model':db[_0x94711b[_0x9867('0x1f')]],'as':_0x94711b['as'],'attributes':_0x94711b[_0x9867('0x1c')],'include':_0x94711b[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x94711b[_0x9867('0x1d')],function(_0x1a2c30){return{'model':db[_0x1a2c30['model']],'as':_0x1a2c30['as'],'attributes':_0x1a2c30[_0x9867('0x1c')],'include':_0x1a2c30[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x1a2c30[_0x9867('0x1d')],function(_0x4c6618){return{'model':db[_0x4c6618[_0x9867('0x1f')]],'as':_0x4c6618['as'],'attributes':_0x4c6618[_0x9867('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53801b){logger['info'](_0x9867('0x23'),_0x1647b2);logger['debug'](_0x9867('0x23'),_0x1647b2,JSON[_0x9867('0x21')](_0x53801b));_0x449a74(_0x53801b);})[_0x9867('0x17')](function(_0x41da0b){logger[_0x9867('0x12')]('ShowServicenowAccount',_0x41da0b['message'],_0x1647b2);_0x22331b(_0x146af4[_0x9867('0x12')](0x1f4,_0x41da0b['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 767944a..f2a5fdf 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 _0x52c5=['isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','index','get'];(function(_0x204166,_0x52f64d){var _0x546f68=function(_0x13029d){while(--_0x13029d){_0x204166['push'](_0x204166['shift']());}};_0x546f68(++_0x52f64d);}(_0x52c5,0x16a));var _0x552c=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x52c5[_0x5d9ceb];return _0x33ce82;};'use strict';var multer=require(_0x552c('0x0'));var util=require(_0x552c('0x1'));var path=require(_0x552c('0x2'));var timeout=require(_0x552c('0x3'));var express=require(_0x552c('0x4'));var router=express[_0x552c('0x5')]();var fs_extra=require(_0x552c('0x6'));var auth=require(_0x552c('0x7'));var interaction=require(_0x552c('0x8'));var config=require('../../config/environment');var controller=require(_0x552c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x552c('0xa')]);router[_0x552c('0xb')]('/:id',auth[_0x552c('0xc')](),controller[_0x552c('0xd')]);router[_0x552c('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x552c('0xb')](_0x552c('0xe'),auth[_0x552c('0xc')](),controller[_0x552c('0xf')]);router[_0x552c('0xb')](_0x552c('0x10'),auth[_0x552c('0xc')](),controller[_0x552c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x552c('0x12')]);router['put'](_0x552c('0x13'),auth[_0x552c('0xc')](),controller[_0x552c('0x14')]);router[_0x552c('0x15')](_0x552c('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0341=['create','put','update','/:id','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','show','get','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x0341,0x1a8));var _0x1034=function(_0x2297dd,_0xcab9f8){_0x2297dd=_0x2297dd-0x0;var _0x189e11=_0x0341[_0x2297dd];return _0x189e11;};'use strict';var multer=require(_0x1034('0x0'));var util=require(_0x1034('0x1'));var path=require(_0x1034('0x2'));var timeout=require(_0x1034('0x3'));var express=require(_0x1034('0x4'));var router=express['Router']();var fs_extra=require(_0x1034('0x5'));var auth=require(_0x1034('0x6'));var interaction=require(_0x1034('0x7'));var config=require(_0x1034('0x8'));var controller=require(_0x1034('0x9'));router['get']('/',auth[_0x1034('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1034('0xb')]);router[_0x1034('0xc')]('/:id/fields',auth[_0x1034('0xa')](),controller[_0x1034('0xd')]);router['get'](_0x1034('0xe'),auth[_0x1034('0xa')](),controller['getSubjects']);router[_0x1034('0xc')](_0x1034('0xf'),auth[_0x1034('0xa')](),controller[_0x1034('0x10')]);router['post']('/',auth[_0x1034('0xa')](),controller[_0x1034('0x11')]);router[_0x1034('0x12')]('/:id',auth[_0x1034('0xa')](),controller[_0x1034('0x13')]);router['delete'](_0x1034('0x14'),auth[_0x1034('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index edc41ac..b2a3f0a 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 _0x04b1=['STRING','sequelize','exports'];(function(_0x20b2f8,_0x32dc96){var _0xf77d1c=function(_0x409ddf){while(--_0x409ddf){_0x20b2f8['push'](_0x20b2f8['shift']());}};_0xf77d1c(++_0x32dc96);}(_0x04b1,0x12a));var _0x104b=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x04b1[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require(_0x104b('0x0'));module[_0x104b('0x1')]={'name':{'type':Sequelize[_0x104b('0x2')]},'description':{'type':Sequelize[_0x104b('0x2')]}}; \ No newline at end of file +var _0x9b80=['exports','STRING'];(function(_0x31ed6e,_0x5424a8){var _0x2908d6=function(_0x242700){while(--_0x242700){_0x31ed6e['push'](_0x31ed6e['shift']());}};_0x2908d6(++_0x5424a8);}(_0x9b80,0x19a));var _0x09b8=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x9b80[_0x398294];return _0x2a872d;};'use strict';var Sequelize=require('sequelize');module[_0x09b8('0x0')]={'name':{'type':Sequelize[_0x09b8('0x1')]},'description':{'type':Sequelize[_0x09b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c29717b..bd1c6fa 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 _0xa797=['findOne','ServicenowField','pick','getFields','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','update','body','find'];(function(_0x549490,_0xea5dd0){var _0x3a8791=function(_0x4930d4){while(--_0x4930d4){_0x549490['push'](_0x549490['shift']());}};_0x3a8791(++_0xea5dd0);}(_0xa797,0x1ac));var _0x7a79=function(_0x549e70,_0x8a5460){_0x549e70=_0x549e70-0x0;var _0x9a9d8c=_0xa797[_0x549e70];return _0x9a9d8c;};'use strict';var emlformat=require(_0x7a79('0x0'));var rimraf=require(_0x7a79('0x1'));var zipdir=require(_0x7a79('0x2'));var jsonpatch=require(_0x7a79('0x3'));var rp=require('request-promise');var moment=require(_0x7a79('0x4'));var BPromise=require(_0x7a79('0x5'));var Mustache=require(_0x7a79('0x6'));var util=require(_0x7a79('0x7'));var path=require(_0x7a79('0x8'));var sox=require(_0x7a79('0x9'));var csv=require(_0x7a79('0xa'));var ejs=require(_0x7a79('0xb'));var fs=require('fs');var fs_extra=require(_0x7a79('0xc'));var _=require('lodash');var squel=require(_0x7a79('0xd'));var crypto=require(_0x7a79('0xe'));var jsforce=require(_0x7a79('0xf'));var deskjs=require(_0x7a79('0x10'));var toCsv=require(_0x7a79('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7a79('0x11'));var authService=require(_0x7a79('0x12'));var qs=require(_0x7a79('0x13'));var as=require(_0x7a79('0x14'));var hardwareService=require(_0x7a79('0x15'));var logger=require('../../config/logger')(_0x7a79('0x16'));var utils=require(_0x7a79('0x17'));var config=require(_0x7a79('0x18'));var licenseUtil=require(_0x7a79('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x541d44,_0x505727){_0x505727=_0x505727||0xcc;return function(_0x1f7b86){if(_0x1f7b86){return _0x541d44[_0x7a79('0x1a')](_0x505727);}return _0x541d44[_0x7a79('0x1b')](_0x505727)[_0x7a79('0x1c')]();};}function respondWithResult(_0x2ee56f,_0x53267d){_0x53267d=_0x53267d||0xc8;return function(_0xc6cfe3){if(_0xc6cfe3){return _0x2ee56f['status'](_0x53267d)['json'](_0xc6cfe3);}};}function respondWithFilteredResult(_0x1f36d1,_0x1b60f5){return function(_0x541f81){if(_0x541f81){var _0x3dee72=typeof _0x1b60f5[_0x7a79('0x1d')]===_0x7a79('0x1e')&&typeof _0x1b60f5['limit']===_0x7a79('0x1e');var _0x51907b=_0x541f81[_0x7a79('0x1f')];var _0x154f99=_0x3dee72?0x0:_0x1b60f5[_0x7a79('0x1d')];var _0x357b39=_0x3dee72?_0x541f81[_0x7a79('0x1f')]:_0x1b60f5[_0x7a79('0x1d')]+_0x1b60f5[_0x7a79('0x20')];var _0x1b2993;if(_0x357b39>=_0x51907b){_0x357b39=_0x51907b;_0x1b2993=0xc8;}else{_0x1b2993=0xce;}_0x1f36d1[_0x7a79('0x1b')](_0x1b2993);return _0x1f36d1['set'](_0x7a79('0x21'),_0x154f99+'-'+_0x357b39+'/'+_0x51907b)[_0x7a79('0x22')](_0x541f81);}return null;};}function patchUpdates(_0x1c514c){return function(_0x48c236){try{jsonpatch[_0x7a79('0x23')](_0x48c236,_0x1c514c,!![]);}catch(_0x1146da){return BPromise[_0x7a79('0x24')](_0x1146da);}return _0x48c236[_0x7a79('0x25')]();};}function saveUpdates(_0x199732,_0x320c6e){return function(_0x5f069d){if(_0x5f069d){return _0x5f069d['update'](_0x199732)[_0x7a79('0x26')](function(_0x2cc593){return _0x2cc593;});}return null;};}function removeEntity(_0x192cff,_0x48c022){return function(_0xf5a3fc){if(_0xf5a3fc){return _0xf5a3fc[_0x7a79('0x27')]()[_0x7a79('0x26')](function(){_0x192cff[_0x7a79('0x1b')](0xcc)[_0x7a79('0x1c')]();});}};}function handleEntityNotFound(_0x818de7,_0x485714){return function(_0x7d90f3){if(!_0x7d90f3){_0x818de7[_0x7a79('0x1a')](0x194);}return _0x7d90f3;};}function handleError(_0x26f502,_0x56f8e2){_0x56f8e2=_0x56f8e2||0x1f4;return function(_0x13ece6){logger[_0x7a79('0x28')](_0x13ece6[_0x7a79('0x29')]);if(_0x13ece6[_0x7a79('0x2a')]){delete _0x13ece6[_0x7a79('0x2a')];}_0x26f502[_0x7a79('0x1b')](_0x56f8e2)[_0x7a79('0x2b')](_0x13ece6);};}exports['index']=function(_0x22786c,_0x4de10f){var _0xe9d705={},_0x400ea2={},_0x3ef494={'count':0x0,'rows':[]};var _0x33b517=_[_0x7a79('0x2c')](db[_0x7a79('0x2d')][_0x7a79('0x2e')],function(_0x1dd987){return{'name':_0x1dd987[_0x7a79('0x2f')],'type':_0x1dd987[_0x7a79('0x30')][_0x7a79('0x31')]};});_0x400ea2[_0x7a79('0x32')]=_['map'](_0x33b517,_0x7a79('0x2a'));_0x400ea2[_0x7a79('0x33')]=_['keys'](_0x22786c[_0x7a79('0x33')]);_0x400ea2['filters']=_[_0x7a79('0x34')](_0x400ea2[_0x7a79('0x32')],_0x400ea2[_0x7a79('0x33')]);_0xe9d705[_0x7a79('0x35')]=_[_0x7a79('0x34')](_0x400ea2[_0x7a79('0x32')],qs[_0x7a79('0x36')](_0x22786c[_0x7a79('0x33')][_0x7a79('0x36')]));_0xe9d705[_0x7a79('0x35')]=_0xe9d705[_0x7a79('0x35')][_0x7a79('0x37')]?_0xe9d705[_0x7a79('0x35')]:_0x400ea2['model'];if(!_0x22786c[_0x7a79('0x33')]['hasOwnProperty']('nolimit')){_0xe9d705['limit']=qs[_0x7a79('0x20')](_0x22786c[_0x7a79('0x33')]['limit']);_0xe9d705[_0x7a79('0x1d')]=qs[_0x7a79('0x1d')](_0x22786c['query'][_0x7a79('0x1d')]);}_0xe9d705[_0x7a79('0x38')]=qs[_0x7a79('0x39')](_0x22786c[_0x7a79('0x33')][_0x7a79('0x39')]);_0xe9d705[_0x7a79('0x3a')]=qs[_0x7a79('0x3b')](_['pick'](_0x22786c[_0x7a79('0x33')],_0x400ea2[_0x7a79('0x3b')]),_0x33b517);if(_0x22786c['query']['filter']){_0xe9d705['where']=_['merge'](_0xe9d705[_0x7a79('0x3a')],{'$or':_['map'](_0x33b517,function(_0xad1446){if(_0xad1446[_0x7a79('0x30')]!==_0x7a79('0x3c')){var _0x2ad479={};_0x2ad479[_0xad1446[_0x7a79('0x2a')]]={'$like':'%'+_0x22786c[_0x7a79('0x33')][_0x7a79('0x3d')]+'%'};return _0x2ad479;}})});}_0xe9d705=_[_0x7a79('0x3e')]({},_0xe9d705,_0x22786c[_0x7a79('0x3f')]);var _0x3d81b5={'where':_0xe9d705[_0x7a79('0x3a')]};return db['ServicenowConfiguration'][_0x7a79('0x1f')](_0x3d81b5)[_0x7a79('0x26')](function(_0x527157){_0x3ef494['count']=_0x527157;if(_0x22786c[_0x7a79('0x33')][_0x7a79('0x40')]){_0xe9d705[_0x7a79('0x41')]=[{'all':!![]}];}return db[_0x7a79('0x2d')][_0x7a79('0x42')](_0xe9d705);})['then'](function(_0x1d2adb){_0x3ef494[_0x7a79('0x43')]=_0x1d2adb;return _0x3ef494;})[_0x7a79('0x26')](respondWithFilteredResult(_0x4de10f,_0xe9d705))[_0x7a79('0x44')](handleError(_0x4de10f,null));};exports[_0x7a79('0x45')]=function(_0xdb2bdd,_0xdf188){var _0x13c566={'raw':![],'where':{'id':_0xdb2bdd[_0x7a79('0x46')]['id']}},_0x4dcd55={};_0x4dcd55[_0x7a79('0x32')]=_[_0x7a79('0x47')](db[_0x7a79('0x2d')][_0x7a79('0x2e')]);_0x4dcd55['query']=_[_0x7a79('0x47')](_0xdb2bdd[_0x7a79('0x33')]);_0x4dcd55[_0x7a79('0x3b')]=_['intersection'](_0x4dcd55[_0x7a79('0x32')],_0x4dcd55[_0x7a79('0x33')]);_0x13c566[_0x7a79('0x35')]=_[_0x7a79('0x34')](_0x4dcd55[_0x7a79('0x32')],qs[_0x7a79('0x36')](_0xdb2bdd[_0x7a79('0x33')][_0x7a79('0x36')]));_0x13c566[_0x7a79('0x35')]=_0x13c566['attributes'][_0x7a79('0x37')]?_0x13c566['attributes']:_0x4dcd55['model'];if(_0xdb2bdd[_0x7a79('0x33')]['includeAll']){_0x13c566[_0x7a79('0x41')]=[{'all':!![]}];}_0x13c566=_[_0x7a79('0x3e')]({},_0x13c566,_0xdb2bdd[_0x7a79('0x3f')]);return db[_0x7a79('0x2d')]['find'](_0x13c566)[_0x7a79('0x26')](handleEntityNotFound(_0xdf188,null))[_0x7a79('0x26')](respondWithResult(_0xdf188,null))[_0x7a79('0x44')](handleError(_0xdf188,null));};exports['create']=function(_0x2421bb,_0xd108ef){return db['ServicenowConfiguration'][_0x7a79('0x48')](_0x2421bb['body'],{})[_0x7a79('0x26')](respondWithResult(_0xd108ef,0xc9))[_0x7a79('0x44')](handleError(_0xd108ef,null));};exports[_0x7a79('0x49')]=function(_0x27070e,_0xbcdf5b){if(_0x27070e[_0x7a79('0x4a')]['id']){delete _0x27070e[_0x7a79('0x4a')]['id'];}return db[_0x7a79('0x2d')][_0x7a79('0x4b')]({'where':{'id':_0x27070e[_0x7a79('0x46')]['id']}})['then'](handleEntityNotFound(_0xbcdf5b,null))[_0x7a79('0x26')](saveUpdates(_0x27070e[_0x7a79('0x4a')],null))[_0x7a79('0x26')](respondWithResult(_0xbcdf5b,null))[_0x7a79('0x44')](handleError(_0xbcdf5b,null));};exports['destroy']=function(_0x223d51,_0x4a0353){return db[_0x7a79('0x2d')][_0x7a79('0x4b')]({'where':{'id':_0x223d51[_0x7a79('0x46')]['id']}})[_0x7a79('0x26')](handleEntityNotFound(_0x4a0353,null))[_0x7a79('0x26')](removeEntity(_0x4a0353,null))['catch'](handleError(_0x4a0353,null));};exports['getFields']=function(_0x4169ba,_0x35394b,_0x5eed03){var _0xe4422c={};var _0x3a3824={};var _0x568bd7;var _0x5ee624;return db[_0x7a79('0x2d')][_0x7a79('0x4c')]({'where':{'id':_0x4169ba[_0x7a79('0x46')]['id']}})['then'](handleEntityNotFound(_0x35394b,null))[_0x7a79('0x26')](function(_0x43514f){if(_0x43514f){_0x568bd7=_0x43514f;_0x3a3824['model']=_['keys'](db[_0x7a79('0x4d')][_0x7a79('0x2e')]);_0x3a3824[_0x7a79('0x33')]=_[_0x7a79('0x47')](_0x4169ba[_0x7a79('0x33')]);_0x3a3824['filters']=_['intersection'](_0x3a3824[_0x7a79('0x32')],_0x3a3824[_0x7a79('0x33')]);_0xe4422c[_0x7a79('0x35')]=_['intersection'](_0x3a3824[_0x7a79('0x32')],qs[_0x7a79('0x36')](_0x4169ba['query']['fields']));_0xe4422c[_0x7a79('0x35')]=_0xe4422c['attributes']['length']?_0xe4422c[_0x7a79('0x35')]:_0x3a3824[_0x7a79('0x32')];_0xe4422c[_0x7a79('0x38')]=qs[_0x7a79('0x39')](_0x4169ba[_0x7a79('0x33')]['sort']);_0xe4422c[_0x7a79('0x3a')]=qs['filters'](_[_0x7a79('0x4e')](_0x4169ba[_0x7a79('0x33')],_0x3a3824[_0x7a79('0x3b')]));if(_0x4169ba[_0x7a79('0x33')][_0x7a79('0x3d')]){_0xe4422c['where']=_[_0x7a79('0x3e')](_0xe4422c['where'],{'$or':_[_0x7a79('0x2c')](_0xe4422c['attributes'],function(_0x82f98f){var _0x296783={};_0x296783[_0x82f98f]={'$like':'%'+_0x4169ba[_0x7a79('0x33')][_0x7a79('0x3d')]+'%'};return _0x296783;})});}_0xe4422c=_[_0x7a79('0x3e')]({},_0xe4422c,_0x4169ba[_0x7a79('0x3f')]);return _0x568bd7[_0x7a79('0x4f')](_0xe4422c);}})['then'](function(_0x101e06){if(_0x101e06){_0x5ee624=_0x101e06[_0x7a79('0x37')];if(!_0x4169ba[_0x7a79('0x33')]['hasOwnProperty'](_0x7a79('0x50'))){_0xe4422c['limit']=qs[_0x7a79('0x20')](_0x4169ba['query']['limit']);_0xe4422c['offset']=qs[_0x7a79('0x1d')](_0x4169ba[_0x7a79('0x33')][_0x7a79('0x1d')]);}return _0x568bd7[_0x7a79('0x4f')](_0xe4422c);}})[_0x7a79('0x26')](function(_0x10b8ad){if(_0x10b8ad){return _0x10b8ad?{'count':_0x5ee624,'rows':_0x10b8ad}:null;}})[_0x7a79('0x26')](respondWithResult(_0x35394b,null))[_0x7a79('0x44')](handleError(_0x35394b,null));};exports[_0x7a79('0x51')]=function(_0x2994cb,_0x173fc1,_0x431e2c){var _0x15cbe6={};var _0x534a0f={};var _0x2b3aac;var _0x445da8;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2994cb[_0x7a79('0x46')]['id']}})['then'](handleEntityNotFound(_0x173fc1,null))[_0x7a79('0x26')](function(_0x7df949){if(_0x7df949){_0x2b3aac=_0x7df949;_0x534a0f[_0x7a79('0x32')]=_[_0x7a79('0x47')](db[_0x7a79('0x4d')][_0x7a79('0x2e')]);_0x534a0f[_0x7a79('0x33')]=_[_0x7a79('0x47')](_0x2994cb[_0x7a79('0x33')]);_0x534a0f[_0x7a79('0x3b')]=_[_0x7a79('0x34')](_0x534a0f[_0x7a79('0x32')],_0x534a0f['query']);_0x15cbe6[_0x7a79('0x35')]=_[_0x7a79('0x34')](_0x534a0f[_0x7a79('0x32')],qs[_0x7a79('0x36')](_0x2994cb[_0x7a79('0x33')][_0x7a79('0x36')]));_0x15cbe6[_0x7a79('0x35')]=_0x15cbe6[_0x7a79('0x35')]['length']?_0x15cbe6['attributes']:_0x534a0f[_0x7a79('0x32')];_0x15cbe6[_0x7a79('0x38')]=qs['sort'](_0x2994cb[_0x7a79('0x33')][_0x7a79('0x39')]);_0x15cbe6[_0x7a79('0x3a')]=qs[_0x7a79('0x3b')](_[_0x7a79('0x4e')](_0x2994cb[_0x7a79('0x33')],_0x534a0f[_0x7a79('0x3b')]));if(_0x2994cb[_0x7a79('0x33')]['filter']){_0x15cbe6[_0x7a79('0x3a')]=_[_0x7a79('0x3e')](_0x15cbe6['where'],{'$or':_[_0x7a79('0x2c')](_0x15cbe6['attributes'],function(_0x33c2a2){var _0x2b9407={};_0x2b9407[_0x33c2a2]={'$like':'%'+_0x2994cb[_0x7a79('0x33')][_0x7a79('0x3d')]+'%'};return _0x2b9407;})});}_0x15cbe6=_[_0x7a79('0x3e')]({},_0x15cbe6,_0x2994cb[_0x7a79('0x3f')]);return _0x2b3aac['getSubjects'](_0x15cbe6);}})[_0x7a79('0x26')](function(_0x29c934){if(_0x29c934){_0x445da8=_0x29c934[_0x7a79('0x37')];if(!_0x2994cb[_0x7a79('0x33')][_0x7a79('0x52')](_0x7a79('0x50'))){_0x15cbe6[_0x7a79('0x20')]=qs['limit'](_0x2994cb[_0x7a79('0x33')][_0x7a79('0x20')]);_0x15cbe6[_0x7a79('0x1d')]=qs[_0x7a79('0x1d')](_0x2994cb['query'][_0x7a79('0x1d')]);}return _0x2b3aac['getSubjects'](_0x15cbe6);}})['then'](function(_0x523489){if(_0x523489){return _0x523489?{'count':_0x445da8,'rows':_0x523489}:null;}})['then'](respondWithResult(_0x173fc1,null))[_0x7a79('0x44')](handleError(_0x173fc1,null));};exports[_0x7a79('0x53')]=function(_0x4afe18,_0x30ffc5,_0x557e3d){var _0x16388c={};var _0x3f728c={};var _0x284124;var _0x2f4923;return db[_0x7a79('0x2d')][_0x7a79('0x4c')]({'where':{'id':_0x4afe18[_0x7a79('0x46')]['id']}})[_0x7a79('0x26')](handleEntityNotFound(_0x30ffc5,null))['then'](function(_0x58db60){if(_0x58db60){_0x284124=_0x58db60;_0x3f728c[_0x7a79('0x32')]=_[_0x7a79('0x47')](db[_0x7a79('0x4d')]['rawAttributes']);_0x3f728c[_0x7a79('0x33')]=_[_0x7a79('0x47')](_0x4afe18[_0x7a79('0x33')]);_0x3f728c['filters']=_['intersection'](_0x3f728c['model'],_0x3f728c[_0x7a79('0x33')]);_0x16388c['attributes']=_[_0x7a79('0x34')](_0x3f728c[_0x7a79('0x32')],qs[_0x7a79('0x36')](_0x4afe18[_0x7a79('0x33')][_0x7a79('0x36')]));_0x16388c[_0x7a79('0x35')]=_0x16388c['attributes']['length']?_0x16388c['attributes']:_0x3f728c[_0x7a79('0x32')];_0x16388c[_0x7a79('0x38')]=qs[_0x7a79('0x39')](_0x4afe18[_0x7a79('0x33')]['sort']);_0x16388c[_0x7a79('0x3a')]=qs[_0x7a79('0x3b')](_[_0x7a79('0x4e')](_0x4afe18[_0x7a79('0x33')],_0x3f728c['filters']));if(_0x4afe18[_0x7a79('0x33')][_0x7a79('0x3d')]){_0x16388c[_0x7a79('0x3a')]=_[_0x7a79('0x3e')](_0x16388c[_0x7a79('0x3a')],{'$or':_[_0x7a79('0x2c')](_0x16388c[_0x7a79('0x35')],function(_0x4109e4){var _0x4face8={};_0x4face8[_0x4109e4]={'$like':'%'+_0x4afe18[_0x7a79('0x33')][_0x7a79('0x3d')]+'%'};return _0x4face8;})});}_0x16388c=_['merge']({},_0x16388c,_0x4afe18['options']);return _0x284124['getDescriptions'](_0x16388c);}})[_0x7a79('0x26')](function(_0x1be202){if(_0x1be202){_0x2f4923=_0x1be202[_0x7a79('0x37')];if(!_0x4afe18[_0x7a79('0x33')][_0x7a79('0x52')](_0x7a79('0x50'))){_0x16388c[_0x7a79('0x20')]=qs[_0x7a79('0x20')](_0x4afe18['query']['limit']);_0x16388c['offset']=qs[_0x7a79('0x1d')](_0x4afe18['query']['offset']);}return _0x284124['getDescriptions'](_0x16388c);}})[_0x7a79('0x26')](function(_0x343ae1){if(_0x343ae1){return _0x343ae1?{'count':_0x2f4923,'rows':_0x343ae1}:null;}})[_0x7a79('0x26')](respondWithResult(_0x30ffc5,null))[_0x7a79('0x44')](handleError(_0x30ffc5,null));}; \ No newline at end of file +var _0x1410=['nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','getFields','findOne','ServicenowField','map','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x45625,_0x4a2c27){var _0x2e4bce=function(_0x3e0687){while(--_0x3e0687){_0x45625['push'](_0x45625['shift']());}};_0x2e4bce(++_0x4a2c27);}(_0x1410,0x1da));var _0x0141=function(_0x2c3d4f,_0x448a69){_0x2c3d4f=_0x2c3d4f-0x0;var _0x2dddb6=_0x1410[_0x2c3d4f];return _0x2dddb6;};'use strict';var emlformat=require(_0x0141('0x0'));var rimraf=require(_0x0141('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0141('0x2'));var rp=require('request-promise');var moment=require(_0x0141('0x3'));var BPromise=require(_0x0141('0x4'));var Mustache=require(_0x0141('0x5'));var util=require(_0x0141('0x6'));var path=require(_0x0141('0x7'));var sox=require('sox');var csv=require(_0x0141('0x8'));var ejs=require(_0x0141('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0141('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0141('0xb'));var deskjs=require(_0x0141('0xc'));var toCsv=require(_0x0141('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0141('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0141('0xe'));var as=require(_0x0141('0xf'));var hardwareService=require(_0x0141('0x10'));var logger=require(_0x0141('0x11'))(_0x0141('0x12'));var utils=require(_0x0141('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0141('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522788,_0xcd927d){_0xcd927d=_0xcd927d||0xcc;return function(_0x81a0c8){if(_0x81a0c8){return _0x522788[_0x0141('0x15')](_0xcd927d);}return _0x522788[_0x0141('0x16')](_0xcd927d)[_0x0141('0x17')]();};}function respondWithResult(_0x5e4590,_0x458f17){_0x458f17=_0x458f17||0xc8;return function(_0x2d399a){if(_0x2d399a){return _0x5e4590[_0x0141('0x16')](_0x458f17)[_0x0141('0x18')](_0x2d399a);}};}function respondWithFilteredResult(_0x2b73ec,_0x17e53f){return function(_0x1d06e6){if(_0x1d06e6){var _0x1058df=typeof _0x17e53f[_0x0141('0x19')]===_0x0141('0x1a')&&typeof _0x17e53f[_0x0141('0x1b')]===_0x0141('0x1a');var _0x4d9b87=_0x1d06e6[_0x0141('0x1c')];var _0x3aec42=_0x1058df?0x0:_0x17e53f[_0x0141('0x19')];var _0x1f76fd=_0x1058df?_0x1d06e6[_0x0141('0x1c')]:_0x17e53f[_0x0141('0x19')]+_0x17e53f[_0x0141('0x1b')];var _0x3b435c;if(_0x1f76fd>=_0x4d9b87){_0x1f76fd=_0x4d9b87;_0x3b435c=0xc8;}else{_0x3b435c=0xce;}_0x2b73ec['status'](_0x3b435c);return _0x2b73ec[_0x0141('0x1d')](_0x0141('0x1e'),_0x3aec42+'-'+_0x1f76fd+'/'+_0x4d9b87)[_0x0141('0x18')](_0x1d06e6);}return null;};}function patchUpdates(_0x28ab5d){return function(_0x515c48){try{jsonpatch[_0x0141('0x1f')](_0x515c48,_0x28ab5d,!![]);}catch(_0x5747a1){return BPromise[_0x0141('0x20')](_0x5747a1);}return _0x515c48[_0x0141('0x21')]();};}function saveUpdates(_0x5499bb,_0xb8a2b2){return function(_0x2c1feb){if(_0x2c1feb){return _0x2c1feb['update'](_0x5499bb)['then'](function(_0x4fd9d6){return _0x4fd9d6;});}return null;};}function removeEntity(_0x16b560,_0x10a877){return function(_0x1cd36c){if(_0x1cd36c){return _0x1cd36c[_0x0141('0x22')]()[_0x0141('0x23')](function(){_0x16b560[_0x0141('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb17e,_0x549db1){return function(_0x15c8ee){if(!_0x15c8ee){_0x5bb17e[_0x0141('0x15')](0x194);}return _0x15c8ee;};}function handleError(_0x21633b,_0x2fc203){_0x2fc203=_0x2fc203||0x1f4;return function(_0x236686){logger['error'](_0x236686['stack']);if(_0x236686[_0x0141('0x24')]){delete _0x236686[_0x0141('0x24')];}_0x21633b[_0x0141('0x16')](_0x2fc203)['send'](_0x236686);};}exports[_0x0141('0x25')]=function(_0x5b8265,_0x4ca393){var _0x919a72={},_0x2b3b9d={},_0x5b6efb={'count':0x0,'rows':[]};var _0x34e0ce=_['map'](db[_0x0141('0x26')][_0x0141('0x27')],function(_0x422377){return{'name':_0x422377[_0x0141('0x28')],'type':_0x422377[_0x0141('0x29')][_0x0141('0x2a')]};});_0x2b3b9d[_0x0141('0x2b')]=_['map'](_0x34e0ce,_0x0141('0x24'));_0x2b3b9d['query']=_[_0x0141('0x2c')](_0x5b8265[_0x0141('0x2d')]);_0x2b3b9d[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x2b3b9d['model'],_0x2b3b9d[_0x0141('0x2d')]);_0x919a72[_0x0141('0x30')]=_['intersection'](_0x2b3b9d[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x5b8265[_0x0141('0x2d')][_0x0141('0x31')]));_0x919a72[_0x0141('0x30')]=_0x919a72[_0x0141('0x30')][_0x0141('0x32')]?_0x919a72['attributes']:_0x2b3b9d[_0x0141('0x2b')];if(!_0x5b8265[_0x0141('0x2d')]['hasOwnProperty'](_0x0141('0x33'))){_0x919a72[_0x0141('0x1b')]=qs['limit'](_0x5b8265[_0x0141('0x2d')][_0x0141('0x1b')]);_0x919a72[_0x0141('0x19')]=qs[_0x0141('0x19')](_0x5b8265[_0x0141('0x2d')][_0x0141('0x19')]);}_0x919a72[_0x0141('0x34')]=qs['sort'](_0x5b8265[_0x0141('0x2d')][_0x0141('0x35')]);_0x919a72[_0x0141('0x36')]=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x5b8265[_0x0141('0x2d')],_0x2b3b9d[_0x0141('0x2e')]),_0x34e0ce);if(_0x5b8265[_0x0141('0x2d')][_0x0141('0x38')]){_0x919a72['where']=_[_0x0141('0x39')](_0x919a72['where'],{'$or':_['map'](_0x34e0ce,function(_0x4f01ea){if(_0x4f01ea[_0x0141('0x29')]!=='VIRTUAL'){var _0x3a54d0={};_0x3a54d0[_0x4f01ea['name']]={'$like':'%'+_0x5b8265[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x3a54d0;}})});}_0x919a72=_[_0x0141('0x39')]({},_0x919a72,_0x5b8265[_0x0141('0x3a')]);var _0x453b28={'where':_0x919a72[_0x0141('0x36')]};return db[_0x0141('0x26')]['count'](_0x453b28)['then'](function(_0x184205){_0x5b6efb[_0x0141('0x1c')]=_0x184205;if(_0x5b8265['query'][_0x0141('0x3b')]){_0x919a72[_0x0141('0x3c')]=[{'all':!![]}];}return db[_0x0141('0x26')]['findAll'](_0x919a72);})['then'](function(_0xe78ab4){_0x5b6efb[_0x0141('0x3d')]=_0xe78ab4;return _0x5b6efb;})[_0x0141('0x23')](respondWithFilteredResult(_0x4ca393,_0x919a72))[_0x0141('0x3e')](handleError(_0x4ca393,null));};exports[_0x0141('0x3f')]=function(_0x5ee059,_0x5b6df0){var _0x490390={'raw':![],'where':{'id':_0x5ee059['params']['id']}},_0x4d7147={};_0x4d7147[_0x0141('0x2b')]=_['keys'](db[_0x0141('0x26')][_0x0141('0x27')]);_0x4d7147[_0x0141('0x2d')]=_[_0x0141('0x2c')](_0x5ee059[_0x0141('0x2d')]);_0x4d7147[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x4d7147['model'],_0x4d7147['query']);_0x490390[_0x0141('0x30')]=_['intersection'](_0x4d7147[_0x0141('0x2b')],qs['fields'](_0x5ee059[_0x0141('0x2d')][_0x0141('0x31')]));_0x490390[_0x0141('0x30')]=_0x490390[_0x0141('0x30')][_0x0141('0x32')]?_0x490390[_0x0141('0x30')]:_0x4d7147[_0x0141('0x2b')];if(_0x5ee059[_0x0141('0x2d')][_0x0141('0x3b')]){_0x490390[_0x0141('0x3c')]=[{'all':!![]}];}_0x490390=_[_0x0141('0x39')]({},_0x490390,_0x5ee059[_0x0141('0x3a')]);return db['ServicenowConfiguration'][_0x0141('0x40')](_0x490390)[_0x0141('0x23')](handleEntityNotFound(_0x5b6df0,null))['then'](respondWithResult(_0x5b6df0,null))[_0x0141('0x3e')](handleError(_0x5b6df0,null));};exports[_0x0141('0x41')]=function(_0x45a170,_0x4daee6){return db['ServicenowConfiguration']['create'](_0x45a170['body'],{})[_0x0141('0x23')](respondWithResult(_0x4daee6,0xc9))['catch'](handleError(_0x4daee6,null));};exports['update']=function(_0x31bbda,_0x540095){if(_0x31bbda[_0x0141('0x42')]['id']){delete _0x31bbda[_0x0141('0x42')]['id'];}return db[_0x0141('0x26')]['find']({'where':{'id':_0x31bbda[_0x0141('0x43')]['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x540095,null))[_0x0141('0x23')](saveUpdates(_0x31bbda[_0x0141('0x42')],null))[_0x0141('0x23')](respondWithResult(_0x540095,null))['catch'](handleError(_0x540095,null));};exports[_0x0141('0x22')]=function(_0x35ce12,_0x43dd7f){return db[_0x0141('0x26')][_0x0141('0x40')]({'where':{'id':_0x35ce12['params']['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x43dd7f,null))[_0x0141('0x23')](removeEntity(_0x43dd7f,null))[_0x0141('0x3e')](handleError(_0x43dd7f,null));};exports[_0x0141('0x44')]=function(_0x1f0d7d,_0x40aaf0,_0xcca2e4){var _0x28fc15={};var _0x4458c0={};var _0x40e125;var _0x57e6bf;return db[_0x0141('0x26')][_0x0141('0x45')]({'where':{'id':_0x1f0d7d[_0x0141('0x43')]['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x40aaf0,null))[_0x0141('0x23')](function(_0x32a526){if(_0x32a526){_0x40e125=_0x32a526;_0x4458c0[_0x0141('0x2b')]=_['keys'](db[_0x0141('0x46')][_0x0141('0x27')]);_0x4458c0['query']=_[_0x0141('0x2c')](_0x1f0d7d[_0x0141('0x2d')]);_0x4458c0[_0x0141('0x2e')]=_['intersection'](_0x4458c0[_0x0141('0x2b')],_0x4458c0['query']);_0x28fc15['attributes']=_[_0x0141('0x2f')](_0x4458c0[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x1f0d7d[_0x0141('0x2d')][_0x0141('0x31')]));_0x28fc15['attributes']=_0x28fc15[_0x0141('0x30')][_0x0141('0x32')]?_0x28fc15[_0x0141('0x30')]:_0x4458c0[_0x0141('0x2b')];_0x28fc15[_0x0141('0x34')]=qs[_0x0141('0x35')](_0x1f0d7d[_0x0141('0x2d')][_0x0141('0x35')]);_0x28fc15['where']=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x1f0d7d[_0x0141('0x2d')],_0x4458c0[_0x0141('0x2e')]));if(_0x1f0d7d[_0x0141('0x2d')]['filter']){_0x28fc15[_0x0141('0x36')]=_['merge'](_0x28fc15[_0x0141('0x36')],{'$or':_[_0x0141('0x47')](_0x28fc15[_0x0141('0x30')],function(_0x106619){var _0x470547={};_0x470547[_0x106619]={'$like':'%'+_0x1f0d7d[_0x0141('0x2d')]['filter']+'%'};return _0x470547;})});}_0x28fc15=_['merge']({},_0x28fc15,_0x1f0d7d[_0x0141('0x3a')]);return _0x40e125[_0x0141('0x44')](_0x28fc15);}})[_0x0141('0x23')](function(_0x539832){if(_0x539832){_0x57e6bf=_0x539832[_0x0141('0x32')];if(!_0x1f0d7d['query'][_0x0141('0x48')]('nolimit')){_0x28fc15[_0x0141('0x1b')]=qs[_0x0141('0x1b')](_0x1f0d7d['query'][_0x0141('0x1b')]);_0x28fc15[_0x0141('0x19')]=qs['offset'](_0x1f0d7d['query'][_0x0141('0x19')]);}return _0x40e125['getFields'](_0x28fc15);}})[_0x0141('0x23')](function(_0x51ec9c){if(_0x51ec9c){return _0x51ec9c?{'count':_0x57e6bf,'rows':_0x51ec9c}:null;}})[_0x0141('0x23')](respondWithResult(_0x40aaf0,null))['catch'](handleError(_0x40aaf0,null));};exports[_0x0141('0x49')]=function(_0x520d58,_0x2260d2,_0x53c4d7){var _0x3af263={};var _0x561a06={};var _0x207d5e;var _0x148020;return db[_0x0141('0x26')][_0x0141('0x45')]({'where':{'id':_0x520d58[_0x0141('0x43')]['id']}})['then'](handleEntityNotFound(_0x2260d2,null))[_0x0141('0x23')](function(_0x258c70){if(_0x258c70){_0x207d5e=_0x258c70;_0x561a06[_0x0141('0x2b')]=_[_0x0141('0x2c')](db['ServicenowField'][_0x0141('0x27')]);_0x561a06[_0x0141('0x2d')]=_['keys'](_0x520d58['query']);_0x561a06[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x561a06[_0x0141('0x2b')],_0x561a06['query']);_0x3af263[_0x0141('0x30')]=_[_0x0141('0x2f')](_0x561a06['model'],qs[_0x0141('0x31')](_0x520d58[_0x0141('0x2d')]['fields']));_0x3af263['attributes']=_0x3af263['attributes'][_0x0141('0x32')]?_0x3af263[_0x0141('0x30')]:_0x561a06[_0x0141('0x2b')];_0x3af263[_0x0141('0x34')]=qs[_0x0141('0x35')](_0x520d58[_0x0141('0x2d')][_0x0141('0x35')]);_0x3af263[_0x0141('0x36')]=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x520d58[_0x0141('0x2d')],_0x561a06[_0x0141('0x2e')]));if(_0x520d58['query'][_0x0141('0x38')]){_0x3af263[_0x0141('0x36')]=_[_0x0141('0x39')](_0x3af263[_0x0141('0x36')],{'$or':_[_0x0141('0x47')](_0x3af263[_0x0141('0x30')],function(_0x1ef926){var _0x576cda={};_0x576cda[_0x1ef926]={'$like':'%'+_0x520d58[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x576cda;})});}_0x3af263=_['merge']({},_0x3af263,_0x520d58[_0x0141('0x3a')]);return _0x207d5e[_0x0141('0x49')](_0x3af263);}})['then'](function(_0x53f5ad){if(_0x53f5ad){_0x148020=_0x53f5ad['length'];if(!_0x520d58[_0x0141('0x2d')][_0x0141('0x48')](_0x0141('0x33'))){_0x3af263[_0x0141('0x1b')]=qs[_0x0141('0x1b')](_0x520d58[_0x0141('0x2d')]['limit']);_0x3af263[_0x0141('0x19')]=qs[_0x0141('0x19')](_0x520d58[_0x0141('0x2d')][_0x0141('0x19')]);}return _0x207d5e[_0x0141('0x49')](_0x3af263);}})[_0x0141('0x23')](function(_0x630b38){if(_0x630b38){return _0x630b38?{'count':_0x148020,'rows':_0x630b38}:null;}})[_0x0141('0x23')](respondWithResult(_0x2260d2,null))['catch'](handleError(_0x2260d2,null));};exports[_0x0141('0x4a')]=function(_0x11babf,_0x1a50be,_0x3e798b){var _0x2ded85={};var _0x49eee1={};var _0x10a149;var _0x4abdc0;return db['ServicenowConfiguration'][_0x0141('0x45')]({'where':{'id':_0x11babf['params']['id']}})['then'](handleEntityNotFound(_0x1a50be,null))[_0x0141('0x23')](function(_0x49e54d){if(_0x49e54d){_0x10a149=_0x49e54d;_0x49eee1[_0x0141('0x2b')]=_[_0x0141('0x2c')](db[_0x0141('0x46')][_0x0141('0x27')]);_0x49eee1[_0x0141('0x2d')]=_[_0x0141('0x2c')](_0x11babf[_0x0141('0x2d')]);_0x49eee1[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x49eee1[_0x0141('0x2b')],_0x49eee1[_0x0141('0x2d')]);_0x2ded85[_0x0141('0x30')]=_[_0x0141('0x2f')](_0x49eee1[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x11babf[_0x0141('0x2d')][_0x0141('0x31')]));_0x2ded85[_0x0141('0x30')]=_0x2ded85[_0x0141('0x30')][_0x0141('0x32')]?_0x2ded85[_0x0141('0x30')]:_0x49eee1[_0x0141('0x2b')];_0x2ded85['order']=qs[_0x0141('0x35')](_0x11babf['query']['sort']);_0x2ded85[_0x0141('0x36')]=qs['filters'](_[_0x0141('0x37')](_0x11babf[_0x0141('0x2d')],_0x49eee1['filters']));if(_0x11babf[_0x0141('0x2d')][_0x0141('0x38')]){_0x2ded85[_0x0141('0x36')]=_['merge'](_0x2ded85['where'],{'$or':_[_0x0141('0x47')](_0x2ded85['attributes'],function(_0x577a95){var _0x2ed4aa={};_0x2ed4aa[_0x577a95]={'$like':'%'+_0x11babf[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x2ed4aa;})});}_0x2ded85=_[_0x0141('0x39')]({},_0x2ded85,_0x11babf[_0x0141('0x3a')]);return _0x10a149[_0x0141('0x4a')](_0x2ded85);}})['then'](function(_0x3d77b6){if(_0x3d77b6){_0x4abdc0=_0x3d77b6[_0x0141('0x32')];if(!_0x11babf[_0x0141('0x2d')][_0x0141('0x48')](_0x0141('0x33'))){_0x2ded85[_0x0141('0x1b')]=qs['limit'](_0x11babf[_0x0141('0x2d')]['limit']);_0x2ded85[_0x0141('0x19')]=qs['offset'](_0x11babf['query'][_0x0141('0x19')]);}return _0x10a149[_0x0141('0x4a')](_0x2ded85);}})['then'](function(_0x133f0f){if(_0x133f0f){return _0x133f0f?{'count':_0x4abdc0,'rows':_0x133f0f}:null;}})['then'](respondWithResult(_0x1a50be,null))[_0x0141('0x3e')](handleError(_0x1a50be,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e33a2af..201163c 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 _0x0457=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x53beb2,_0x1c6af6){var _0x2a1da2=function(_0x30e46f){while(--_0x30e46f){_0x53beb2['push'](_0x53beb2['shift']());}};_0x2a1da2(++_0x1c6af6);}(_0x0457,0x11f));var _0x7045=function(_0x5a5113,_0x1c008b){_0x5a5113=_0x5a5113-0x0;var _0x16a596=_0x0457[_0x5a5113];return _0x16a596;};'use strict';var _=require('lodash');var util=require(_0x7045('0x0'));var logger=require(_0x7045('0x1'))('api');var moment=require(_0x7045('0x2'));var BPromise=require(_0x7045('0x3'));var rp=require(_0x7045('0x4'));var fs=require('fs');var path=require(_0x7045('0x5'));var rimraf=require(_0x7045('0x6'));var config=require(_0x7045('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x7045('0x8')]=function(_0x51e53b,_0x91fb4c){return _0x51e53b[_0x7045('0x9')](_0x7045('0xa'),attributes,{'tableName':_0x7045('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5454=['define','ServicenowConfiguration','int_servicenow_configurations','api','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x5ac757,_0x10cd1f){var _0xbddee6=function(_0x2d34cc){while(--_0x2d34cc){_0x5ac757['push'](_0x5ac757['shift']());}};_0xbddee6(++_0x10cd1f);}(_0x5454,0x15b));var _0x4545=function(_0x3a87f6,_0x400633){_0x3a87f6=_0x3a87f6-0x0;var _0x132c09=_0x5454[_0x3a87f6];return _0x132c09;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4545('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4545('0x1'));var rimraf=require(_0x4545('0x2'));var config=require(_0x4545('0x3'));var attributes=require(_0x4545('0x4'));module['exports']=function(_0x41ffd0,_0xececc1){return _0x41ffd0[_0x4545('0x5')](_0x4545('0x6'),attributes,{'tableName':_0x4545('0x7'),'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 48dbc4e..12374e7 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 _0xc9a3=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1b943f,_0x52b7a7){var _0x4efc12=function(_0x9e11d){while(--_0x9e11d){_0x1b943f['push'](_0x1b943f['shift']());}};_0x4efc12(++_0x52b7a7);}(_0xc9a3,0x83));var _0x3c9a=function(_0x528c90,_0x1e612e){_0x528c90=_0x528c90-0x0;var _0x2a7439=_0xc9a3[_0x528c90];return _0x2a7439;};'use strict';var _=require(_0x3c9a('0x0'));var util=require(_0x3c9a('0x1'));var moment=require(_0x3c9a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c9a('0x3'));var fs=require('fs');var Redis=require(_0x3c9a('0x4'));var db=require(_0x3c9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c9a('0x6'))(_0x3c9a('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c9a('0x8'));var client=jayson[_0x3c9a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x347ffa,_0x44e1dd,_0x73a949){return new BPromise(function(_0x2c3c40,_0x274a23){return client['request'](_0x347ffa,_0x73a949)[_0x3c9a('0xa')](function(_0x563105){logger[_0x3c9a('0xb')](_0x3c9a('0xc'),_0x44e1dd,_0x3c9a('0xd'));logger[_0x3c9a('0xe')](_0x3c9a('0xf'),_0x44e1dd,_0x3c9a('0xd'),JSON['stringify'](_0x563105));if(_0x563105[_0x3c9a('0x10')]){if(_0x563105['error'][_0x3c9a('0x11')]===0x1f4){logger[_0x3c9a('0x10')](_0x3c9a('0xc'),_0x44e1dd,_0x563105[_0x3c9a('0x10')]['message']);return _0x274a23(_0x563105[_0x3c9a('0x10')][_0x3c9a('0x12')]);}logger[_0x3c9a('0x10')](_0x3c9a('0xc'),_0x44e1dd,_0x563105[_0x3c9a('0x10')]['message']);return _0x2c3c40(_0x563105[_0x3c9a('0x10')][_0x3c9a('0x12')]);}else{logger[_0x3c9a('0xb')](_0x3c9a('0xc'),_0x44e1dd,'request\x20sent');_0x2c3c40(_0x563105[_0x3c9a('0x13')][_0x3c9a('0x12')]);}})[_0x3c9a('0x14')](function(_0x13ccb2){logger[_0x3c9a('0x10')](_0x3c9a('0xc'),_0x44e1dd,_0x13ccb2);_0x274a23(_0x13ccb2);});});} \ No newline at end of file +var _0x15b8=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x269e80,_0xfd0e6d){var _0x52b1be=function(_0x24d66b){while(--_0x24d66b){_0x269e80['push'](_0x269e80['shift']());}};_0x52b1be(++_0xfd0e6d);}(_0x15b8,0x1c2));var _0x815b=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x15b8[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x815b('0x0'));var util=require('util');var moment=require(_0x815b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x815b('0x2'));var db=require(_0x815b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x815b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x815b('0x5')][_0x815b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x37d1e2,_0x453cf3,_0x83f43a){return new BPromise(function(_0x5b79ff,_0x224a42){return client['request'](_0x37d1e2,_0x83f43a)['then'](function(_0x4e3e10){logger[_0x815b('0x7')](_0x815b('0x8'),_0x453cf3,_0x815b('0x9'));logger['debug'](_0x815b('0xa'),_0x453cf3,_0x815b('0x9'),JSON['stringify'](_0x4e3e10));if(_0x4e3e10['error']){if(_0x4e3e10[_0x815b('0xb')][_0x815b('0xc')]===0x1f4){logger[_0x815b('0xb')](_0x815b('0x8'),_0x453cf3,_0x4e3e10['error'][_0x815b('0xd')]);return _0x224a42(_0x4e3e10[_0x815b('0xb')][_0x815b('0xd')]);}logger['error'](_0x815b('0x8'),_0x453cf3,_0x4e3e10['error'][_0x815b('0xd')]);return _0x5b79ff(_0x4e3e10[_0x815b('0xb')][_0x815b('0xd')]);}else{logger[_0x815b('0x7')](_0x815b('0x8'),_0x453cf3,_0x815b('0x9'));_0x5b79ff(_0x4e3e10[_0x815b('0xe')]['message']);}})[_0x815b('0xf')](function(_0x4ea925){logger[_0x815b('0xb')](_0x815b('0x8'),_0x453cf3,_0x4ea925);_0x224a42(_0x4ea925);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1a8f349..8379f96 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 _0x391f=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','/:id','post','create','put','update','delete'];(function(_0x5f7457,_0x65c8c6){var _0xa62c01=function(_0x27bc15){while(--_0x27bc15){_0x5f7457['push'](_0x5f7457['shift']());}};_0xa62c01(++_0x65c8c6);}(_0x391f,0x122));var _0xf391=function(_0x2de33e,_0x23f117){_0x2de33e=_0x2de33e-0x0;var _0x4e1381=_0x391f[_0x2de33e];return _0x4e1381;};'use strict';var multer=require(_0xf391('0x0'));var util=require(_0xf391('0x1'));var path=require(_0xf391('0x2'));var timeout=require(_0xf391('0x3'));var express=require('express');var router=express[_0xf391('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf391('0x5'));var interaction=require(_0xf391('0x6'));var config=require(_0xf391('0x7'));var controller=require(_0xf391('0x8'));router['get']('/',auth[_0xf391('0x9')](),controller['index']);router['get'](_0xf391('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf391('0xb')]('/',auth[_0xf391('0x9')](),controller[_0xf391('0xc')]);router[_0xf391('0xd')](_0xf391('0xa'),auth[_0xf391('0x9')](),controller[_0xf391('0xe')]);router[_0xf391('0xf')](_0xf391('0xa'),auth['isAuthenticated'](),controller[_0xf391('0x10')]);module['exports']=router; \ No newline at end of file +var _0x75b9=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x57de44,_0x2bd26a){var _0x1fc3b4=function(_0x277a02){while(--_0x277a02){_0x57de44['push'](_0x57de44['shift']());}};_0x1fc3b4(++_0x2bd26a);}(_0x75b9,0x9b));var _0x975b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x75b9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x975b('0x0'));var util=require('util');var path=require(_0x975b('0x1'));var timeout=require('connect-timeout');var express=require(_0x975b('0x2'));var router=express[_0x975b('0x3')]();var fs_extra=require(_0x975b('0x4'));var auth=require(_0x975b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x975b('0x6'));var controller=require(_0x975b('0x7'));router[_0x975b('0x8')]('/',auth[_0x975b('0x9')](),controller['index']);router['get'](_0x975b('0xa'),auth[_0x975b('0x9')](),controller[_0x975b('0xb')]);router[_0x975b('0xc')]('/',auth[_0x975b('0x9')](),controller[_0x975b('0xd')]);router[_0x975b('0xe')](_0x975b('0xa'),auth['isAuthenticated'](),controller[_0x975b('0xf')]);router[_0x975b('0x10')](_0x975b('0xa'),auth['isAuthenticated'](),controller[_0x975b('0x11')]);module[_0x975b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index b54b90c..fd0c924 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 _0x7fdb=['keyValue','STRING','ENUM','BOOLEAN','exports','string','variable','customVariable'];(function(_0x1156f4,_0x24d852){var _0x2c1a05=function(_0x15ba8f){while(--_0x15ba8f){_0x1156f4['push'](_0x1156f4['shift']());}};_0x2c1a05(++_0x24d852);}(_0x7fdb,0x144));var _0xb7fd=function(_0x106466,_0xe55a0){_0x106466=_0x106466-0x0;var _0x4ae2aa=_0x7fdb[_0x106466];return _0x4ae2aa;};'use strict';var Sequelize=require('sequelize');module[_0xb7fd('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb7fd('0x1'),_0xb7fd('0x2'),_0xb7fd('0x3'),_0xb7fd('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb7fd('0x5')]},'keyType':{'type':Sequelize[_0xb7fd('0x6')](_0xb7fd('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb7fd('0x5')]},'customField':{'type':Sequelize[_0xb7fd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda77=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x173336,_0x3f98c4){var _0x12dc79=function(_0xae7bf5){while(--_0xae7bf5){_0x173336['push'](_0x173336['shift']());}};_0x12dc79(++_0x3f98c4);}(_0xda77,0x1a2));var _0x7da7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xda77[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x7da7('0x0'));module[_0x7da7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7da7('0x2'),_0x7da7('0x3'),_0x7da7('0x4'),_0x7da7('0x5'),_0x7da7('0x6')),'defaultValue':_0x7da7('0x2')},'content':{'type':Sequelize[_0x7da7('0x7')]},'key':{'type':Sequelize[_0x7da7('0x7')]},'keyType':{'type':Sequelize[_0x7da7('0x8')]('string','variable',_0x7da7('0x4'))},'keyContent':{'type':Sequelize[_0x7da7('0x7')]},'idField':{'type':Sequelize[_0x7da7('0x7')]},'nameField':{'type':Sequelize[_0x7da7('0x7')]},'customField':{'type':Sequelize[_0x7da7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7da7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 78549e1..af3b9f8 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 _0x5fd0=['set','Content-Range','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','ServicenowField','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x589993,_0x3d8e97){var _0x11bd07=function(_0x21277){while(--_0x21277){_0x589993['push'](_0x589993['shift']());}};_0x11bd07(++_0x3d8e97);}(_0x5fd0,0x1ad));var _0x05fd=function(_0x458656,_0x4292d8){_0x458656=_0x458656-0x0;var _0x24e475=_0x5fd0[_0x458656];return _0x24e475;};'use strict';var emlformat=require(_0x05fd('0x0'));var rimraf=require(_0x05fd('0x1'));var zipdir=require(_0x05fd('0x2'));var jsonpatch=require(_0x05fd('0x3'));var rp=require(_0x05fd('0x4'));var moment=require(_0x05fd('0x5'));var BPromise=require(_0x05fd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05fd('0x7'));var sox=require(_0x05fd('0x8'));var csv=require(_0x05fd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05fd('0xa'));var _=require(_0x05fd('0xb'));var squel=require(_0x05fd('0xc'));var crypto=require(_0x05fd('0xd'));var jsforce=require(_0x05fd('0xe'));var deskjs=require(_0x05fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x05fd('0x10'));var Papa=require(_0x05fd('0x11'));var Redis=require(_0x05fd('0x12'));var authService=require(_0x05fd('0x13'));var qs=require(_0x05fd('0x14'));var as=require(_0x05fd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05fd('0x16'))('api');var utils=require(_0x05fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x05fd('0x18'));var db=require(_0x05fd('0x19'))['db'];function respondWithStatusCode(_0x30eb54,_0x32ab33){_0x32ab33=_0x32ab33||0xcc;return function(_0x191ac4){if(_0x191ac4){return _0x30eb54[_0x05fd('0x1a')](_0x32ab33);}return _0x30eb54[_0x05fd('0x1b')](_0x32ab33)[_0x05fd('0x1c')]();};}function respondWithResult(_0x57fdae,_0x5b6ec4){_0x5b6ec4=_0x5b6ec4||0xc8;return function(_0x1cd848){if(_0x1cd848){return _0x57fdae[_0x05fd('0x1b')](_0x5b6ec4)[_0x05fd('0x1d')](_0x1cd848);}};}function respondWithFilteredResult(_0x5a1e16,_0x252b52){return function(_0x1fe9dd){if(_0x1fe9dd){var _0x2f5a98=typeof _0x252b52[_0x05fd('0x1e')]===_0x05fd('0x1f')&&typeof _0x252b52[_0x05fd('0x20')]===_0x05fd('0x1f');var _0x4724a7=_0x1fe9dd['count'];var _0x24bb5b=_0x2f5a98?0x0:_0x252b52['offset'];var _0xcea29a=_0x2f5a98?_0x1fe9dd['count']:_0x252b52[_0x05fd('0x1e')]+_0x252b52[_0x05fd('0x20')];var _0x1a4948;if(_0xcea29a>=_0x4724a7){_0xcea29a=_0x4724a7;_0x1a4948=0xc8;}else{_0x1a4948=0xce;}_0x5a1e16[_0x05fd('0x1b')](_0x1a4948);return _0x5a1e16[_0x05fd('0x21')](_0x05fd('0x22'),_0x24bb5b+'-'+_0xcea29a+'/'+_0x4724a7)[_0x05fd('0x1d')](_0x1fe9dd);}return null;};}function patchUpdates(_0x188cf2){return function(_0x2117cd){try{jsonpatch['apply'](_0x2117cd,_0x188cf2,!![]);}catch(_0x4b8372){return BPromise['reject'](_0x4b8372);}return _0x2117cd[_0x05fd('0x23')]();};}function saveUpdates(_0x356a34,_0x11340f){return function(_0x2223fa){if(_0x2223fa){return _0x2223fa[_0x05fd('0x24')](_0x356a34)[_0x05fd('0x25')](function(_0x509420){return _0x509420;});}return null;};}function removeEntity(_0x2f2da2,_0x110bbe){return function(_0x4ea192){if(_0x4ea192){return _0x4ea192[_0x05fd('0x26')]()[_0x05fd('0x25')](function(){_0x2f2da2[_0x05fd('0x1b')](0xcc)[_0x05fd('0x1c')]();});}};}function handleEntityNotFound(_0x50c5f8,_0x1d40fb){return function(_0x38fcbe){if(!_0x38fcbe){_0x50c5f8[_0x05fd('0x1a')](0x194);}return _0x38fcbe;};}function handleError(_0x393473,_0x5d55cd){_0x5d55cd=_0x5d55cd||0x1f4;return function(_0x172ea4){logger[_0x05fd('0x27')](_0x172ea4[_0x05fd('0x28')]);if(_0x172ea4['name']){delete _0x172ea4[_0x05fd('0x29')];}_0x393473[_0x05fd('0x1b')](_0x5d55cd)['send'](_0x172ea4);};}exports[_0x05fd('0x2a')]=function(_0x5b42cd,_0x2c05d9){var _0x191940={},_0x567938={},_0x2faa42={'count':0x0,'rows':[]};var _0x44358d=_[_0x05fd('0x2b')](db['ServicenowField']['rawAttributes'],function(_0x5888fb){return{'name':_0x5888fb[_0x05fd('0x2c')],'type':_0x5888fb[_0x05fd('0x2d')][_0x05fd('0x2e')]};});_0x567938[_0x05fd('0x2f')]=_[_0x05fd('0x2b')](_0x44358d,_0x05fd('0x29'));_0x567938[_0x05fd('0x30')]=_['keys'](_0x5b42cd[_0x05fd('0x30')]);_0x567938[_0x05fd('0x31')]=_['intersection'](_0x567938[_0x05fd('0x2f')],_0x567938['query']);_0x191940['attributes']=_[_0x05fd('0x32')](_0x567938[_0x05fd('0x2f')],qs[_0x05fd('0x33')](_0x5b42cd['query'][_0x05fd('0x33')]));_0x191940['attributes']=_0x191940[_0x05fd('0x34')][_0x05fd('0x35')]?_0x191940['attributes']:_0x567938['model'];if(!_0x5b42cd['query'][_0x05fd('0x36')](_0x05fd('0x37'))){_0x191940['limit']=qs['limit'](_0x5b42cd['query'][_0x05fd('0x20')]);_0x191940['offset']=qs[_0x05fd('0x1e')](_0x5b42cd[_0x05fd('0x30')][_0x05fd('0x1e')]);}_0x191940[_0x05fd('0x38')]=qs['sort'](_0x5b42cd['query']['sort']);_0x191940['where']=qs['filters'](_[_0x05fd('0x39')](_0x5b42cd[_0x05fd('0x30')],_0x567938['filters']),_0x44358d);if(_0x5b42cd['query'][_0x05fd('0x3a')]){_0x191940[_0x05fd('0x3b')]=_['merge'](_0x191940[_0x05fd('0x3b')],{'$or':_['map'](_0x44358d,function(_0x325f41){if(_0x325f41[_0x05fd('0x2d')]!==_0x05fd('0x3c')){var _0x564c8b={};_0x564c8b[_0x325f41[_0x05fd('0x29')]]={'$like':'%'+_0x5b42cd[_0x05fd('0x30')][_0x05fd('0x3a')]+'%'};return _0x564c8b;}})});}_0x191940=_[_0x05fd('0x3d')]({},_0x191940,_0x5b42cd[_0x05fd('0x3e')]);var _0x34a60f={'where':_0x191940[_0x05fd('0x3b')]};return db['ServicenowField'][_0x05fd('0x3f')](_0x34a60f)[_0x05fd('0x25')](function(_0x41890c){_0x2faa42[_0x05fd('0x3f')]=_0x41890c;if(_0x5b42cd['query'][_0x05fd('0x40')]){_0x191940[_0x05fd('0x41')]=[{'all':!![]}];}return db[_0x05fd('0x42')][_0x05fd('0x43')](_0x191940);})['then'](function(_0x3b77df){_0x2faa42[_0x05fd('0x44')]=_0x3b77df;return _0x2faa42;})[_0x05fd('0x25')](respondWithFilteredResult(_0x2c05d9,_0x191940))[_0x05fd('0x45')](handleError(_0x2c05d9,null));};exports[_0x05fd('0x46')]=function(_0x13b81d,_0x38faec){var _0x557b25={'raw':!![],'where':{'id':_0x13b81d[_0x05fd('0x47')]['id']}},_0x373ca8={};_0x373ca8['model']=_[_0x05fd('0x48')](db['ServicenowField'][_0x05fd('0x49')]);_0x373ca8[_0x05fd('0x30')]=_['keys'](_0x13b81d[_0x05fd('0x30')]);_0x373ca8[_0x05fd('0x31')]=_['intersection'](_0x373ca8['model'],_0x373ca8[_0x05fd('0x30')]);_0x557b25[_0x05fd('0x34')]=_[_0x05fd('0x32')](_0x373ca8['model'],qs[_0x05fd('0x33')](_0x13b81d[_0x05fd('0x30')][_0x05fd('0x33')]));_0x557b25[_0x05fd('0x34')]=_0x557b25[_0x05fd('0x34')][_0x05fd('0x35')]?_0x557b25[_0x05fd('0x34')]:_0x373ca8['model'];if(_0x13b81d[_0x05fd('0x30')][_0x05fd('0x40')]){_0x557b25['include']=[{'all':!![]}];}_0x557b25=_[_0x05fd('0x3d')]({},_0x557b25,_0x13b81d[_0x05fd('0x3e')]);return db['ServicenowField'][_0x05fd('0x4a')](_0x557b25)[_0x05fd('0x25')](handleEntityNotFound(_0x38faec,null))[_0x05fd('0x25')](respondWithResult(_0x38faec,null))[_0x05fd('0x45')](handleError(_0x38faec,null));};exports[_0x05fd('0x4b')]=function(_0x2acaf0,_0x8f062d){return db[_0x05fd('0x42')][_0x05fd('0x4b')](_0x2acaf0[_0x05fd('0x4c')],{})[_0x05fd('0x25')](respondWithResult(_0x8f062d,0xc9))[_0x05fd('0x45')](handleError(_0x8f062d,null));};exports['update']=function(_0xc09038,_0x1ae637){if(_0xc09038['body']['id']){delete _0xc09038[_0x05fd('0x4c')]['id'];}return db[_0x05fd('0x42')][_0x05fd('0x4a')]({'where':{'id':_0xc09038[_0x05fd('0x47')]['id']}})[_0x05fd('0x25')](handleEntityNotFound(_0x1ae637,null))[_0x05fd('0x25')](saveUpdates(_0xc09038[_0x05fd('0x4c')],null))['then'](respondWithResult(_0x1ae637,null))[_0x05fd('0x45')](handleError(_0x1ae637,null));};exports['destroy']=function(_0x330a35,_0x521c88){return db[_0x05fd('0x42')][_0x05fd('0x4a')]({'where':{'id':_0x330a35[_0x05fd('0x47')]['id']}})[_0x05fd('0x25')](handleEntityNotFound(_0x521c88,null))[_0x05fd('0x25')](removeEntity(_0x521c88,null))['catch'](handleError(_0x521c88,null));}; \ No newline at end of file +var _0xdf89=['show','params','rawAttributes','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','ServicenowField','findAll','rows','catch'];(function(_0x3f758f,_0x302451){var _0x26e4ae=function(_0x54beae){while(--_0x54beae){_0x3f758f['push'](_0x3f758f['shift']());}};_0x26e4ae(++_0x302451);}(_0xdf89,0x97));var _0x9df8=function(_0x55a5e7,_0x4422ed){_0x55a5e7=_0x55a5e7-0x0;var _0x9780e3=_0xdf89[_0x55a5e7];return _0x9780e3;};'use strict';var emlformat=require(_0x9df8('0x0'));var rimraf=require(_0x9df8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9df8('0x2'));var rp=require(_0x9df8('0x3'));var moment=require(_0x9df8('0x4'));var BPromise=require(_0x9df8('0x5'));var Mustache=require(_0x9df8('0x6'));var util=require(_0x9df8('0x7'));var path=require(_0x9df8('0x8'));var sox=require(_0x9df8('0x9'));var csv=require(_0x9df8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9df8('0xb'));var _=require('lodash');var squel=require(_0x9df8('0xc'));var crypto=require('crypto');var jsforce=require(_0x9df8('0xd'));var deskjs=require(_0x9df8('0xe'));var toCsv=require(_0x9df8('0xa'));var querystring=require(_0x9df8('0xf'));var Papa=require(_0x9df8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9df8('0x11'));var logger=require(_0x9df8('0x12'))(_0x9df8('0x13'));var utils=require('../../config/utils');var config=require(_0x9df8('0x14'));var licenseUtil=require(_0x9df8('0x15'));var db=require(_0x9df8('0x16'))['db'];function respondWithStatusCode(_0xad7a8a,_0xb84be1){_0xb84be1=_0xb84be1||0xcc;return function(_0x31f122){if(_0x31f122){return _0xad7a8a[_0x9df8('0x17')](_0xb84be1);}return _0xad7a8a[_0x9df8('0x18')](_0xb84be1)[_0x9df8('0x19')]();};}function respondWithResult(_0x37c8a8,_0x25d1dd){_0x25d1dd=_0x25d1dd||0xc8;return function(_0x47df63){if(_0x47df63){return _0x37c8a8['status'](_0x25d1dd)['json'](_0x47df63);}};}function respondWithFilteredResult(_0x485e81,_0x5e5c86){return function(_0xb7a9b8){if(_0xb7a9b8){var _0x426fac=typeof _0x5e5c86['offset']===_0x9df8('0x1a')&&typeof _0x5e5c86[_0x9df8('0x1b')]==='undefined';var _0x38530c=_0xb7a9b8['count'];var _0x5dd1be=_0x426fac?0x0:_0x5e5c86[_0x9df8('0x1c')];var _0x488534=_0x426fac?_0xb7a9b8[_0x9df8('0x1d')]:_0x5e5c86[_0x9df8('0x1c')]+_0x5e5c86['limit'];var _0x9386d3;if(_0x488534>=_0x38530c){_0x488534=_0x38530c;_0x9386d3=0xc8;}else{_0x9386d3=0xce;}_0x485e81['status'](_0x9386d3);return _0x485e81['set'](_0x9df8('0x1e'),_0x5dd1be+'-'+_0x488534+'/'+_0x38530c)['json'](_0xb7a9b8);}return null;};}function patchUpdates(_0x11bd86){return function(_0x3f94e7){try{jsonpatch[_0x9df8('0x1f')](_0x3f94e7,_0x11bd86,!![]);}catch(_0x355dac){return BPromise[_0x9df8('0x20')](_0x355dac);}return _0x3f94e7[_0x9df8('0x21')]();};}function saveUpdates(_0x5c4041,_0x5492ad){return function(_0x37938a){if(_0x37938a){return _0x37938a[_0x9df8('0x22')](_0x5c4041)[_0x9df8('0x23')](function(_0x1d4cf7){return _0x1d4cf7;});}return null;};}function removeEntity(_0xa4830c,_0x4a68f5){return function(_0x250cf2){if(_0x250cf2){return _0x250cf2[_0x9df8('0x24')]()['then'](function(){_0xa4830c[_0x9df8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58c6f2,_0x189ff2){return function(_0x527a82){if(!_0x527a82){_0x58c6f2[_0x9df8('0x17')](0x194);}return _0x527a82;};}function handleError(_0x57a96d,_0x1e4455){_0x1e4455=_0x1e4455||0x1f4;return function(_0x30a286){logger[_0x9df8('0x25')](_0x30a286['stack']);if(_0x30a286[_0x9df8('0x26')]){delete _0x30a286[_0x9df8('0x26')];}_0x57a96d[_0x9df8('0x18')](_0x1e4455)['send'](_0x30a286);};}exports[_0x9df8('0x27')]=function(_0x161c13,_0x2d1cbc){var _0xa01fbc={},_0x4cbb42={},_0x272bbb={'count':0x0,'rows':[]};var _0x15b0d7=_['map'](db['ServicenowField']['rawAttributes'],function(_0x103d49){return{'name':_0x103d49[_0x9df8('0x28')],'type':_0x103d49[_0x9df8('0x29')][_0x9df8('0x2a')]};});_0x4cbb42[_0x9df8('0x2b')]=_['map'](_0x15b0d7,_0x9df8('0x26'));_0x4cbb42['query']=_[_0x9df8('0x2c')](_0x161c13[_0x9df8('0x2d')]);_0x4cbb42[_0x9df8('0x2e')]=_[_0x9df8('0x2f')](_0x4cbb42[_0x9df8('0x2b')],_0x4cbb42['query']);_0xa01fbc[_0x9df8('0x30')]=_['intersection'](_0x4cbb42[_0x9df8('0x2b')],qs[_0x9df8('0x31')](_0x161c13[_0x9df8('0x2d')]['fields']));_0xa01fbc['attributes']=_0xa01fbc['attributes'][_0x9df8('0x32')]?_0xa01fbc['attributes']:_0x4cbb42[_0x9df8('0x2b')];if(!_0x161c13['query'][_0x9df8('0x33')]('nolimit')){_0xa01fbc[_0x9df8('0x1b')]=qs[_0x9df8('0x1b')](_0x161c13[_0x9df8('0x2d')]['limit']);_0xa01fbc[_0x9df8('0x1c')]=qs[_0x9df8('0x1c')](_0x161c13[_0x9df8('0x2d')][_0x9df8('0x1c')]);}_0xa01fbc[_0x9df8('0x34')]=qs['sort'](_0x161c13['query'][_0x9df8('0x35')]);_0xa01fbc[_0x9df8('0x36')]=qs[_0x9df8('0x2e')](_['pick'](_0x161c13[_0x9df8('0x2d')],_0x4cbb42['filters']),_0x15b0d7);if(_0x161c13[_0x9df8('0x2d')][_0x9df8('0x37')]){_0xa01fbc[_0x9df8('0x36')]=_[_0x9df8('0x38')](_0xa01fbc['where'],{'$or':_[_0x9df8('0x39')](_0x15b0d7,function(_0x2bd2a0){if(_0x2bd2a0['type']!==_0x9df8('0x3a')){var _0x39f21c={};_0x39f21c[_0x2bd2a0[_0x9df8('0x26')]]={'$like':'%'+_0x161c13[_0x9df8('0x2d')][_0x9df8('0x37')]+'%'};return _0x39f21c;}})});}_0xa01fbc=_[_0x9df8('0x38')]({},_0xa01fbc,_0x161c13[_0x9df8('0x3b')]);var _0x43da24={'where':_0xa01fbc[_0x9df8('0x36')]};return db['ServicenowField'][_0x9df8('0x1d')](_0x43da24)[_0x9df8('0x23')](function(_0x1750f9){_0x272bbb['count']=_0x1750f9;if(_0x161c13[_0x9df8('0x2d')][_0x9df8('0x3c')]){_0xa01fbc['include']=[{'all':!![]}];}return db[_0x9df8('0x3d')][_0x9df8('0x3e')](_0xa01fbc);})[_0x9df8('0x23')](function(_0x2435ed){_0x272bbb[_0x9df8('0x3f')]=_0x2435ed;return _0x272bbb;})[_0x9df8('0x23')](respondWithFilteredResult(_0x2d1cbc,_0xa01fbc))[_0x9df8('0x40')](handleError(_0x2d1cbc,null));};exports[_0x9df8('0x41')]=function(_0x248230,_0x3e9887){var _0x237ba9={'raw':!![],'where':{'id':_0x248230[_0x9df8('0x42')]['id']}},_0x2c4a25={};_0x2c4a25[_0x9df8('0x2b')]=_[_0x9df8('0x2c')](db[_0x9df8('0x3d')][_0x9df8('0x43')]);_0x2c4a25[_0x9df8('0x2d')]=_['keys'](_0x248230[_0x9df8('0x2d')]);_0x2c4a25[_0x9df8('0x2e')]=_[_0x9df8('0x2f')](_0x2c4a25[_0x9df8('0x2b')],_0x2c4a25[_0x9df8('0x2d')]);_0x237ba9['attributes']=_[_0x9df8('0x2f')](_0x2c4a25[_0x9df8('0x2b')],qs[_0x9df8('0x31')](_0x248230[_0x9df8('0x2d')][_0x9df8('0x31')]));_0x237ba9[_0x9df8('0x30')]=_0x237ba9['attributes'][_0x9df8('0x32')]?_0x237ba9[_0x9df8('0x30')]:_0x2c4a25[_0x9df8('0x2b')];if(_0x248230[_0x9df8('0x2d')][_0x9df8('0x3c')]){_0x237ba9[_0x9df8('0x44')]=[{'all':!![]}];}_0x237ba9=_[_0x9df8('0x38')]({},_0x237ba9,_0x248230['options']);return db[_0x9df8('0x3d')][_0x9df8('0x45')](_0x237ba9)['then'](handleEntityNotFound(_0x3e9887,null))['then'](respondWithResult(_0x3e9887,null))[_0x9df8('0x40')](handleError(_0x3e9887,null));};exports[_0x9df8('0x46')]=function(_0x298f50,_0x1da538){return db['ServicenowField']['create'](_0x298f50[_0x9df8('0x47')],{})[_0x9df8('0x23')](respondWithResult(_0x1da538,0xc9))[_0x9df8('0x40')](handleError(_0x1da538,null));};exports[_0x9df8('0x22')]=function(_0x316393,_0x4d72dd){if(_0x316393[_0x9df8('0x47')]['id']){delete _0x316393[_0x9df8('0x47')]['id'];}return db[_0x9df8('0x3d')][_0x9df8('0x45')]({'where':{'id':_0x316393[_0x9df8('0x42')]['id']}})[_0x9df8('0x23')](handleEntityNotFound(_0x4d72dd,null))[_0x9df8('0x23')](saveUpdates(_0x316393['body'],null))['then'](respondWithResult(_0x4d72dd,null))[_0x9df8('0x40')](handleError(_0x4d72dd,null));};exports[_0x9df8('0x24')]=function(_0x49fa39,_0x34d8a0){return db[_0x9df8('0x3d')][_0x9df8('0x45')]({'where':{'id':_0x49fa39['params']['id']}})[_0x9df8('0x23')](handleEntityNotFound(_0x34d8a0,null))[_0x9df8('0x23')](removeEntity(_0x34d8a0,null))[_0x9df8('0x40')](handleError(_0x34d8a0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8ac6bbb..3f3798a 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 _0xbb31=['./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5b5ee7,_0x1c75a0){var _0x57278b=function(_0x3470c9){while(--_0x3470c9){_0x5b5ee7['push'](_0x5b5ee7['shift']());}};_0x57278b(++_0x1c75a0);}(_0xbb31,0x1e7));var _0x1bb3=function(_0x4fc06f,_0x56f4cb){_0x4fc06f=_0x4fc06f-0x0;var _0x1257ab=_0xbb31[_0x4fc06f];return _0x1257ab;};'use strict';var _=require(_0x1bb3('0x0'));var util=require(_0x1bb3('0x1'));var logger=require(_0x1bb3('0x2'))('api');var moment=require(_0x1bb3('0x3'));var BPromise=require(_0x1bb3('0x4'));var rp=require(_0x1bb3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bb3('0x6'));var config=require(_0x1bb3('0x7'));var attributes=require(_0x1bb3('0x8'));module['exports']=function(_0x3a68af,_0x52eb08){return _0x3a68af[_0x1bb3('0x9')](_0x1bb3('0xa'),attributes,{'tableName':_0x1bb3('0xb'),'paranoid':![],'indexes':[{'name':_0x1bb3('0xc'),'fields':[_0x1bb3('0xd'),_0x1bb3('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef06=['api','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0xef06,0x186));var _0x6ef0=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0xef06[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require(_0x6ef0('0x0'));var util=require('util');var logger=require(_0x6ef0('0x1'))(_0x6ef0('0x2'));var moment=require('moment');var BPromise=require(_0x6ef0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ef0('0x4'));var rimraf=require(_0x6ef0('0x5'));var config=require(_0x6ef0('0x6'));var attributes=require(_0x6ef0('0x7'));module[_0x6ef0('0x8')]=function(_0x69e99c,_0x46866b){return _0x69e99c[_0x6ef0('0x9')](_0x6ef0('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x6ef0('0xb'),'fields':[_0x6ef0('0xc'),_0x6ef0('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 181a859..9b4d8dc 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x25b6e6,_0x372fa6){var _0x197c16=function(_0xe00fde){while(--_0xe00fde){_0x25b6e6['push'](_0x25b6e6['shift']());}};_0x197c16(++_0x372fa6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x41857c,_0x926c57){var _0xde1cdd=function(_0x474700){while(--_0x474700){_0x41857c['push'](_0x41857c['shift']());}};_0xde1cdd(++_0x926c57);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7f0bec2..4c4f76a 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4269ae,_0xbee855){var _0x43cbe8=function(_0xbeb349){while(--_0xbeb349){_0x4269ae['push'](_0x4269ae['shift']());}};_0x43cbe8(++_0xbee855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4505d0,_0x4aa5d6){var _0x1975e1=function(_0x2dd02d){while(--_0x2dd02d){_0x4505d0['push'](_0x4505d0['shift']());}};_0x1975e1(++_0x4aa5d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index b7e62a8..d12cc5d 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(_0xe4413a,_0x2a49f0){var _0x42a520=function(_0x47b936){while(--_0x47b936){_0xe4413a['push'](_0xe4413a['shift']());}};_0x42a520(++_0x2a49f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x1caf2e,_0x2540f1){var _0x462e4a=function(_0x3a4f15){while(--_0x3a4f15){_0x1caf2e['push'](_0x1caf2e['shift']());}};_0x462e4a(++_0x2540f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 6c6e99a..8314e40 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 _0x2555=['lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','includes','endsWith','values','value','test','statusCode','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','findOne','SugarcrmConfiguration','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_name','username','password','remoteUri','slice','substring'];(function(_0x3c5c5e,_0x174a3b){var _0x1002b6=function(_0xd308da){while(--_0xd308da){_0x3c5c5e['push'](_0x3c5c5e['shift']());}};_0x1002b6(++_0x174a3b);}(_0x2555,0xf8));var _0x5255=function(_0x25c582,_0xfb304c){_0x25c582=_0x25c582-0x0;var _0x178ce1=_0x2555[_0x25c582];return _0x178ce1;};'use strict';var emlformat=require(_0x5255('0x0'));var rimraf=require(_0x5255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5255('0x2'));var rp=require(_0x5255('0x3'));var moment=require(_0x5255('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5255('0x5'));var util=require(_0x5255('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5255('0x7'));var fs=require('fs');var fs_extra=require(_0x5255('0x8'));var _=require(_0x5255('0x9'));var squel=require(_0x5255('0xa'));var crypto=require(_0x5255('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5255('0xc'));var toCsv=require(_0x5255('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5255('0xe'));var authService=require(_0x5255('0xf'));var qs=require(_0x5255('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5255('0x11'));var logger=require(_0x5255('0x12'))(_0x5255('0x13'));var utils=require(_0x5255('0x14'));var config=require(_0x5255('0x15'));var licenseUtil=require(_0x5255('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5255('0x17'));function respondWithStatusCode(_0x426a1c,_0xc7790d){_0xc7790d=_0xc7790d||0xcc;return function(_0x5b52e7){if(_0x5b52e7){return _0x426a1c[_0x5255('0x18')](_0xc7790d);}return _0x426a1c[_0x5255('0x19')](_0xc7790d)[_0x5255('0x1a')]();};}function respondWithResult(_0x14eaae,_0x256b83){_0x256b83=_0x256b83||0xc8;return function(_0x264e78){if(_0x264e78){return _0x14eaae[_0x5255('0x19')](_0x256b83)[_0x5255('0x1b')](_0x264e78);}};}function respondWithFilteredResult(_0x3fe15a,_0x5830a9){return function(_0x5340b1){if(_0x5340b1){var _0x149da8=typeof _0x5830a9[_0x5255('0x1c')]===_0x5255('0x1d')&&typeof _0x5830a9['limit']===_0x5255('0x1d');var _0x4a0a2f=_0x5340b1[_0x5255('0x1e')];var _0x1131fa=_0x149da8?0x0:_0x5830a9[_0x5255('0x1c')];var _0x15041c=_0x149da8?_0x5340b1[_0x5255('0x1e')]:_0x5830a9[_0x5255('0x1c')]+_0x5830a9[_0x5255('0x1f')];var _0x11d073;if(_0x15041c>=_0x4a0a2f){_0x15041c=_0x4a0a2f;_0x11d073=0xc8;}else{_0x11d073=0xce;}_0x3fe15a[_0x5255('0x19')](_0x11d073);return _0x3fe15a[_0x5255('0x20')](_0x5255('0x21'),_0x1131fa+'-'+_0x15041c+'/'+_0x4a0a2f)[_0x5255('0x1b')](_0x5340b1);}return null;};}function patchUpdates(_0x52dde1){return function(_0xbd6821){try{jsonpatch['apply'](_0xbd6821,_0x52dde1,!![]);}catch(_0x1341d7){return BPromise[_0x5255('0x22')](_0x1341d7);}return _0xbd6821[_0x5255('0x23')]();};}function saveUpdates(_0x5fdbd5,_0x536504){return function(_0x12f9e2){if(_0x12f9e2){return _0x12f9e2[_0x5255('0x24')](_0x5fdbd5)['then'](function(_0x5e6aeb){return _0x5e6aeb;});}return null;};}function removeEntity(_0xd5d960,_0x5cf7a3){return function(_0x14918e){if(_0x14918e){return _0x14918e[_0x5255('0x25')]()[_0x5255('0x26')](function(){_0xd5d960[_0x5255('0x19')](0xcc)[_0x5255('0x1a')]();});}};}function handleEntityNotFound(_0x21b3ad,_0x53f436){return function(_0x5e5f5b){if(!_0x5e5f5b){_0x21b3ad[_0x5255('0x18')](0x194);}return _0x5e5f5b;};}function handleError(_0x668154,_0x1ca1e4){_0x1ca1e4=_0x1ca1e4||0x1f4;return function(_0x85751c){logger[_0x5255('0x27')](_0x85751c[_0x5255('0x28')]);if(_0x85751c[_0x5255('0x29')]){delete _0x85751c[_0x5255('0x29')];}_0x668154[_0x5255('0x19')](_0x1ca1e4)[_0x5255('0x2a')](_0x85751c);};}exports['index']=function(_0x550e36,_0x490121){var _0x45e260={},_0xe05da0={},_0x125da6={'count':0x0,'rows':[]};var _0x388323=_[_0x5255('0x2b')](db[_0x5255('0x2c')][_0x5255('0x2d')],function(_0x52a665){return{'name':_0x52a665['fieldName'],'type':_0x52a665[_0x5255('0x2e')][_0x5255('0x2f')]};});_0xe05da0[_0x5255('0x30')]=_[_0x5255('0x2b')](_0x388323,_0x5255('0x29'));_0xe05da0[_0x5255('0x31')]=_[_0x5255('0x32')](_0x550e36['query']);_0xe05da0[_0x5255('0x33')]=_[_0x5255('0x34')](_0xe05da0[_0x5255('0x30')],_0xe05da0[_0x5255('0x31')]);_0x45e260[_0x5255('0x35')]=_[_0x5255('0x34')](_0xe05da0[_0x5255('0x30')],qs[_0x5255('0x36')](_0x550e36[_0x5255('0x31')][_0x5255('0x36')]));_0x45e260[_0x5255('0x35')]=_0x45e260[_0x5255('0x35')]['length']?_0x45e260[_0x5255('0x35')]:_0xe05da0['model'];if(!_0x550e36['query'][_0x5255('0x37')]('nolimit')){_0x45e260[_0x5255('0x1f')]=qs[_0x5255('0x1f')](_0x550e36['query'][_0x5255('0x1f')]);_0x45e260[_0x5255('0x1c')]=qs[_0x5255('0x1c')](_0x550e36['query'][_0x5255('0x1c')]);}_0x45e260[_0x5255('0x38')]=qs['sort'](_0x550e36[_0x5255('0x31')][_0x5255('0x39')]);_0x45e260[_0x5255('0x3a')]=qs[_0x5255('0x33')](_[_0x5255('0x3b')](_0x550e36['query'],_0xe05da0['filters']),_0x388323);if(_0x550e36[_0x5255('0x31')][_0x5255('0x3c')]){_0x45e260[_0x5255('0x3a')]=_[_0x5255('0x3d')](_0x45e260[_0x5255('0x3a')],{'$or':_['map'](_0x388323,function(_0x153323){if(_0x153323['type']!==_0x5255('0x3e')){var _0x4ed77a={};_0x4ed77a[_0x153323[_0x5255('0x29')]]={'$like':'%'+_0x550e36[_0x5255('0x31')][_0x5255('0x3c')]+'%'};return _0x4ed77a;}})});}_0x45e260=_[_0x5255('0x3d')]({},_0x45e260,_0x550e36[_0x5255('0x3f')]);var _0x22654f={'where':_0x45e260['where']};return db[_0x5255('0x2c')][_0x5255('0x1e')](_0x22654f)['then'](function(_0x549c9c){_0x125da6['count']=_0x549c9c;if(_0x550e36[_0x5255('0x31')][_0x5255('0x40')]){_0x45e260[_0x5255('0x41')]=[{'all':!![]}];}return db[_0x5255('0x2c')][_0x5255('0x42')](_0x45e260);})[_0x5255('0x26')](function(_0xb4fcd4){_0x125da6[_0x5255('0x43')]=_0xb4fcd4;return _0x125da6;})[_0x5255('0x26')](respondWithFilteredResult(_0x490121,_0x45e260))[_0x5255('0x44')](handleError(_0x490121,null));};exports[_0x5255('0x45')]=function(_0x3b0213,_0x57f350){var _0x31d8d7={'raw':![],'where':{'id':_0x3b0213['params']['id']}},_0x7ba389={};_0x7ba389[_0x5255('0x30')]=_['keys'](db[_0x5255('0x2c')]['rawAttributes']);_0x7ba389['query']=_[_0x5255('0x32')](_0x3b0213[_0x5255('0x31')]);_0x7ba389[_0x5255('0x33')]=_[_0x5255('0x34')](_0x7ba389[_0x5255('0x30')],_0x7ba389[_0x5255('0x31')]);_0x31d8d7[_0x5255('0x35')]=_[_0x5255('0x34')](_0x7ba389[_0x5255('0x30')],qs[_0x5255('0x36')](_0x3b0213['query'][_0x5255('0x36')]));_0x31d8d7['attributes']=_0x31d8d7['attributes'][_0x5255('0x46')]?_0x31d8d7['attributes']:_0x7ba389['model'];if(_0x3b0213[_0x5255('0x31')][_0x5255('0x40')]){_0x31d8d7[_0x5255('0x41')]=[{'all':!![]}];}_0x31d8d7=_[_0x5255('0x3d')]({},_0x31d8d7,_0x3b0213[_0x5255('0x3f')]);return db[_0x5255('0x2c')][_0x5255('0x47')](_0x31d8d7)[_0x5255('0x26')](handleEntityNotFound(_0x57f350,null))['then'](respondWithResult(_0x57f350,null))[_0x5255('0x44')](handleError(_0x57f350,null));};exports['create']=function(_0x10bfb2,_0xad17){return db['SugarcrmAccount'][_0x5255('0x48')](_0x10bfb2[_0x5255('0x49')],{})[_0x5255('0x26')](respondWithResult(_0xad17,0xc9))['catch'](handleError(_0xad17,null));};exports[_0x5255('0x24')]=function(_0x4bda7c,_0x27886d){if(_0x4bda7c[_0x5255('0x49')]['id']){delete _0x4bda7c[_0x5255('0x49')]['id'];}return db[_0x5255('0x2c')]['find']({'where':{'id':_0x4bda7c[_0x5255('0x4a')]['id']}})[_0x5255('0x26')](handleEntityNotFound(_0x27886d,null))[_0x5255('0x26')](saveUpdates(_0x4bda7c[_0x5255('0x49')],null))[_0x5255('0x26')](respondWithResult(_0x27886d,null))['catch'](handleError(_0x27886d,null));};exports[_0x5255('0x25')]=function(_0x329b54,_0x2a1dd0){return db[_0x5255('0x2c')]['find']({'where':{'id':_0x329b54['params']['id']}})['then'](handleEntityNotFound(_0x2a1dd0,null))[_0x5255('0x26')](removeEntity(_0x2a1dd0,null))[_0x5255('0x44')](handleError(_0x2a1dd0,null));};exports['getConfigurations']=function(_0x514593,_0x4ca69c,_0x125ff3){var _0x2b426c={};var _0xbfcb08={};var _0x4e1be4;var _0x3a342a;return db[_0x5255('0x2c')][_0x5255('0x4b')]({'where':{'id':_0x514593[_0x5255('0x4a')]['id']}})[_0x5255('0x26')](handleEntityNotFound(_0x4ca69c,null))['then'](function(_0x1fec08){if(_0x1fec08){_0x4e1be4=_0x1fec08;_0xbfcb08[_0x5255('0x30')]=_[_0x5255('0x32')](db[_0x5255('0x4c')][_0x5255('0x2d')]);_0xbfcb08[_0x5255('0x31')]=_[_0x5255('0x32')](_0x514593['query']);_0xbfcb08[_0x5255('0x33')]=_['intersection'](_0xbfcb08[_0x5255('0x30')],_0xbfcb08[_0x5255('0x31')]);_0x2b426c[_0x5255('0x35')]=_[_0x5255('0x34')](_0xbfcb08[_0x5255('0x30')],qs['fields'](_0x514593['query'][_0x5255('0x36')]));_0x2b426c['attributes']=_0x2b426c[_0x5255('0x35')][_0x5255('0x46')]?_0x2b426c[_0x5255('0x35')]:_0xbfcb08['model'];_0x2b426c[_0x5255('0x38')]=qs[_0x5255('0x39')](_0x514593[_0x5255('0x31')]['sort']);_0x2b426c['where']=qs['filters'](_[_0x5255('0x3b')](_0x514593[_0x5255('0x31')],_0xbfcb08[_0x5255('0x33')]));if(_0x514593[_0x5255('0x31')][_0x5255('0x3c')]){_0x2b426c[_0x5255('0x3a')]=_[_0x5255('0x3d')](_0x2b426c[_0x5255('0x3a')],{'$or':_[_0x5255('0x2b')](_0x2b426c['attributes'],function(_0x496a42){var _0xedc982={};_0xedc982[_0x496a42]={'$like':'%'+_0x514593[_0x5255('0x31')][_0x5255('0x3c')]+'%'};return _0xedc982;})});}_0x2b426c=_[_0x5255('0x3d')]({},_0x2b426c,_0x514593[_0x5255('0x3f')]);return _0x4e1be4[_0x5255('0x4d')](_0x2b426c);}})[_0x5255('0x26')](function(_0x2712bc){if(_0x2712bc){_0x3a342a=_0x2712bc[_0x5255('0x46')];if(!_0x514593[_0x5255('0x31')][_0x5255('0x37')](_0x5255('0x4e'))){_0x2b426c[_0x5255('0x1f')]=qs[_0x5255('0x1f')](_0x514593[_0x5255('0x31')][_0x5255('0x1f')]);_0x2b426c[_0x5255('0x1c')]=qs[_0x5255('0x1c')](_0x514593[_0x5255('0x31')][_0x5255('0x1c')]);}return _0x4e1be4[_0x5255('0x4d')](_0x2b426c);}})[_0x5255('0x26')](function(_0x23ed04){if(_0x23ed04){return _0x23ed04?{'count':_0x3a342a,'rows':_0x23ed04}:null;}})[_0x5255('0x26')](respondWithResult(_0x4ca69c,null))[_0x5255('0x44')](handleError(_0x4ca69c,null));};exports['addConfiguration']=function(_0x4f21a1,_0x4be18c,_0x1ab716){if(_0x4f21a1[_0x5255('0x49')]['id']){delete _0x4f21a1[_0x5255('0x49')]['id'];}return db[_0x5255('0x2c')][_0x5255('0x4b')]({'where':{'id':_0x4f21a1[_0x5255('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4be18c,null))[_0x5255('0x26')](function(_0x182311){if(_0x182311){_0x4f21a1[_0x5255('0x49')][_0x5255('0x4f')]=_0x182311['id'];_0x4f21a1[_0x5255('0x49')][_0x5255('0x50')]=integrations['getSubjects'](_0x4f21a1[_0x5255('0x49')][_0x5255('0x51')],_0x4f21a1[_0x5255('0x49')][_0x5255('0x2e')]);_0x4f21a1[_0x5255('0x49')][_0x5255('0x52')]=integrations[_0x5255('0x53')](_0x4f21a1[_0x5255('0x49')]['channel'],_0x4f21a1[_0x5255('0x49')]['type']);return db[_0x5255('0x4c')][_0x5255('0x48')](_0x4f21a1['body'],{'include':[{'model':db[_0x5255('0x54')],'as':'Subjects'},{'model':db[_0x5255('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4be18c,null))[_0x5255('0x44')](handleError(_0x4be18c,null));};exports[_0x5255('0x55')]=function(_0x44273b,_0x5beccb,_0x7a3f79){var _0x17e252='';var _0x2fab2b=['id',_0x5255('0x29'),_0x5255('0x56'),_0x5255('0x57'),_0x5255('0x58'),_0x5255('0x59'),_0x5255('0x5a'),'duration_minutes','parent_id','parent_type',_0x5255('0x5b'),'direction'];return db[_0x5255('0x2c')][_0x5255('0x4b')]({'where':{'id':_0x44273b[_0x5255('0x4a')]['id']},'attributes':['id',_0x5255('0x5c'),_0x5255('0x5d'),_0x5255('0x5e')]})[_0x5255('0x26')](handleEntityNotFound(_0x5beccb,null))['then'](function(_0x2e780e){if(_0x2e780e){_0x17e252=_0x2e780e[_0x5255('0x5e')];var _0x3a16de=_0x17e252[_0x5255('0x5f')](-0x1);if(_0x3a16de==='/'){_0x17e252=_0x17e252[_0x5255('0x60')](0x0,_0x17e252[_0x5255('0x61')](_0x3a16de));}return rp({'method':_0x5255('0x62'),'uri':util['format'](_0x5255('0x63'),_0x17e252,_0x5255('0x64')),'json':!![],'form':{'method':_0x5255('0x65'),'input_type':_0x5255('0x66'),'response_type':'JSON','rest_data':JSON[_0x5255('0x67')]({'user_auth':{'user_name':_0x2e780e[_0x5255('0x5c')],'password':_0x2e780e[_0x5255('0x5d')],'encryption':'PLAIN'},'application':_0x5255('0x68')})}});}})[_0x5255('0x26')](function(_0x4fb279){if(_0x4fb279&&_0x4fb279[_0x5255('0x29')]!==_0x5255('0x69')&&_0x4fb279['name']!==_0x5255('0x6a')){return rp({'method':_0x5255('0x62'),'uri':util['format'](_0x5255('0x63'),_0x17e252,_0x5255('0x64')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x5255('0x66'),'rest_data':JSON[_0x5255('0x67')]({'session':_0x4fb279['id'],'module_name':_0x5255('0x6b')})}})['then'](function(_0x5dfe5d){if(_0x5dfe5d){var _0x16c3e2=_['values'](_0x5dfe5d['module_fields']);_['remove'](_0x16c3e2,function(_0x22c931){return _0x2fab2b[_0x5255('0x6c')](_0x22c931[_0x5255('0x29')]);});return{'count':_0x16c3e2[_0x5255('0x46')],'rows':_[_0x5255('0x2b')](_0x16c3e2,function(_0x48ad91){return{'id':_0x48ad91['name'],'name':_0x48ad91['label'],'custom':_[_0x5255('0x6d')](_0x48ad91[_0x5255('0x29')],'_c')?!![]:![],'options':_0x48ad91[_0x5255('0x3f')]?_['map'](_[_0x5255('0x6e')](_0x48ad91[_0x5255('0x3f')]),function(_0x6e198c){return{'name':_0x6e198c[_0x5255('0x6f')],'value':_0x6e198c[_0x5255('0x29')]};}):[]};})};}})[_0x5255('0x26')](respondWithResult(_0x5beccb,null))['catch'](function(_0x232434){var _0x27a5cd=_0x44273b[_0x5255('0x31')][_0x5255('0x70')]?0x1f4:_0x232434[_0x5255('0x71')]||0x1f4;logger[_0x5255('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x5255('0x55'),_0x27a5cd,JSON[_0x5255('0x67')](_0x232434));delete _0x232434['name'];if(_0x27a5cd===0x191){_0x27a5cd=0x190;}_0x5beccb[_0x5255('0x19')](_0x27a5cd)[_0x5255('0x2a')](_0x44273b[_0x5255('0x31')][_0x5255('0x70')]?{'message':_0x5255('0x72'),'statusCode':_0x232434[_0x5255('0x71')]}:_0x232434);});}else{var _0x38ad84=0x1f4;_0x5beccb[_0x5255('0x19')](_0x38ad84)['send']({'message':_0x5255('0x72'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5548=['mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SugarcrmAccount','include','findAll','rows','catch','params','includeAll','body','update','destroy','find','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','remoteUri','substring','POST','format','/service/v4_1/rest.php','login','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x381497,_0x4f195d){var _0x3a7865=function(_0x58c391){while(--_0x58c391){_0x381497['push'](_0x381497['shift']());}};_0x3a7865(++_0x4f195d);}(_0x5548,0x70));var _0x8554=function(_0x559434,_0x2f9870){_0x559434=_0x559434-0x0;var _0x252834=_0x5548[_0x559434];return _0x252834;};'use strict';var emlformat=require(_0x8554('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8554('0x1'));var jsonpatch=require(_0x8554('0x2'));var rp=require(_0x8554('0x3'));var moment=require(_0x8554('0x4'));var BPromise=require(_0x8554('0x5'));var Mustache=require(_0x8554('0x6'));var util=require(_0x8554('0x7'));var path=require(_0x8554('0x8'));var sox=require(_0x8554('0x9'));var csv=require(_0x8554('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8554('0xb'));var squel=require(_0x8554('0xc'));var crypto=require(_0x8554('0xd'));var jsforce=require(_0x8554('0xe'));var deskjs=require(_0x8554('0xf'));var toCsv=require(_0x8554('0xa'));var querystring=require(_0x8554('0x10'));var Papa=require(_0x8554('0x11'));var Redis=require('ioredis');var authService=require(_0x8554('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8554('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8554('0x14'));var utils=require(_0x8554('0x15'));var config=require(_0x8554('0x16'));var licenseUtil=require(_0x8554('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x28be37,_0xba71fd){_0xba71fd=_0xba71fd||0xcc;return function(_0x31d121){if(_0x31d121){return _0x28be37[_0x8554('0x18')](_0xba71fd);}return _0x28be37[_0x8554('0x19')](_0xba71fd)['end']();};}function respondWithResult(_0x57fe60,_0x3dde28){_0x3dde28=_0x3dde28||0xc8;return function(_0x526d2e){if(_0x526d2e){return _0x57fe60[_0x8554('0x19')](_0x3dde28)[_0x8554('0x1a')](_0x526d2e);}};}function respondWithFilteredResult(_0x5162a2,_0x2295ee){return function(_0x765312){if(_0x765312){var _0xe442ec=typeof _0x2295ee[_0x8554('0x1b')]===_0x8554('0x1c')&&typeof _0x2295ee[_0x8554('0x1d')]===_0x8554('0x1c');var _0x12397f=_0x765312[_0x8554('0x1e')];var _0xa35030=_0xe442ec?0x0:_0x2295ee['offset'];var _0x44be83=_0xe442ec?_0x765312[_0x8554('0x1e')]:_0x2295ee['offset']+_0x2295ee[_0x8554('0x1d')];var _0x540f1f;if(_0x44be83>=_0x12397f){_0x44be83=_0x12397f;_0x540f1f=0xc8;}else{_0x540f1f=0xce;}_0x5162a2[_0x8554('0x19')](_0x540f1f);return _0x5162a2[_0x8554('0x1f')]('Content-Range',_0xa35030+'-'+_0x44be83+'/'+_0x12397f)[_0x8554('0x1a')](_0x765312);}return null;};}function patchUpdates(_0x34ecd){return function(_0x19c118){try{jsonpatch[_0x8554('0x20')](_0x19c118,_0x34ecd,!![]);}catch(_0x26325e){return BPromise[_0x8554('0x21')](_0x26325e);}return _0x19c118[_0x8554('0x22')]();};}function saveUpdates(_0x47320f,_0x13bc26){return function(_0x31c1e8){if(_0x31c1e8){return _0x31c1e8['update'](_0x47320f)[_0x8554('0x23')](function(_0x3aab75){return _0x3aab75;});}return null;};}function removeEntity(_0x536b2b,_0x2862e3){return function(_0x48b268){if(_0x48b268){return _0x48b268['destroy']()[_0x8554('0x23')](function(){_0x536b2b[_0x8554('0x19')](0xcc)[_0x8554('0x24')]();});}};}function handleEntityNotFound(_0x4bd09c,_0x419b6f){return function(_0x3128c9){if(!_0x3128c9){_0x4bd09c['sendStatus'](0x194);}return _0x3128c9;};}function handleError(_0x3b91bb,_0x4c21e0){_0x4c21e0=_0x4c21e0||0x1f4;return function(_0x4c49b7){logger[_0x8554('0x25')](_0x4c49b7[_0x8554('0x26')]);if(_0x4c49b7[_0x8554('0x27')]){delete _0x4c49b7[_0x8554('0x27')];}_0x3b91bb['status'](_0x4c21e0)[_0x8554('0x28')](_0x4c49b7);};}exports['index']=function(_0x5918de,_0x35e26d){var _0x4e5113={},_0x1c47d4={},_0x1bddf3={'count':0x0,'rows':[]};var _0x3ef715=_[_0x8554('0x29')](db['SugarcrmAccount'][_0x8554('0x2a')],function(_0x451894){return{'name':_0x451894[_0x8554('0x2b')],'type':_0x451894[_0x8554('0x2c')][_0x8554('0x2d')]};});_0x1c47d4[_0x8554('0x2e')]=_['map'](_0x3ef715,_0x8554('0x27'));_0x1c47d4[_0x8554('0x2f')]=_[_0x8554('0x30')](_0x5918de[_0x8554('0x2f')]);_0x1c47d4[_0x8554('0x31')]=_['intersection'](_0x1c47d4['model'],_0x1c47d4[_0x8554('0x2f')]);_0x4e5113['attributes']=_[_0x8554('0x32')](_0x1c47d4[_0x8554('0x2e')],qs[_0x8554('0x33')](_0x5918de[_0x8554('0x2f')][_0x8554('0x33')]));_0x4e5113[_0x8554('0x34')]=_0x4e5113[_0x8554('0x34')][_0x8554('0x35')]?_0x4e5113[_0x8554('0x34')]:_0x1c47d4[_0x8554('0x2e')];if(!_0x5918de['query'][_0x8554('0x36')](_0x8554('0x37'))){_0x4e5113[_0x8554('0x1d')]=qs[_0x8554('0x1d')](_0x5918de['query'][_0x8554('0x1d')]);_0x4e5113[_0x8554('0x1b')]=qs[_0x8554('0x1b')](_0x5918de[_0x8554('0x2f')][_0x8554('0x1b')]);}_0x4e5113[_0x8554('0x38')]=qs[_0x8554('0x39')](_0x5918de[_0x8554('0x2f')][_0x8554('0x39')]);_0x4e5113['where']=qs['filters'](_['pick'](_0x5918de[_0x8554('0x2f')],_0x1c47d4[_0x8554('0x31')]),_0x3ef715);if(_0x5918de[_0x8554('0x2f')]['filter']){_0x4e5113[_0x8554('0x3a')]=_[_0x8554('0x3b')](_0x4e5113[_0x8554('0x3a')],{'$or':_['map'](_0x3ef715,function(_0x29d0c9){if(_0x29d0c9[_0x8554('0x2c')]!==_0x8554('0x3c')){var _0x30978b={};_0x30978b[_0x29d0c9['name']]={'$like':'%'+_0x5918de[_0x8554('0x2f')][_0x8554('0x3d')]+'%'};return _0x30978b;}})});}_0x4e5113=_[_0x8554('0x3b')]({},_0x4e5113,_0x5918de[_0x8554('0x3e')]);var _0x1e7238={'where':_0x4e5113[_0x8554('0x3a')]};return db[_0x8554('0x3f')][_0x8554('0x1e')](_0x1e7238)[_0x8554('0x23')](function(_0x48dcca){_0x1bddf3[_0x8554('0x1e')]=_0x48dcca;if(_0x5918de['query']['includeAll']){_0x4e5113[_0x8554('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x8554('0x41')](_0x4e5113);})[_0x8554('0x23')](function(_0x37da9b){_0x1bddf3[_0x8554('0x42')]=_0x37da9b;return _0x1bddf3;})['then'](respondWithFilteredResult(_0x35e26d,_0x4e5113))[_0x8554('0x43')](handleError(_0x35e26d,null));};exports['show']=function(_0x140d82,_0x58662f){var _0x4fc387={'raw':![],'where':{'id':_0x140d82[_0x8554('0x44')]['id']}},_0x50e8c6={};_0x50e8c6[_0x8554('0x2e')]=_[_0x8554('0x30')](db[_0x8554('0x3f')][_0x8554('0x2a')]);_0x50e8c6['query']=_['keys'](_0x140d82[_0x8554('0x2f')]);_0x50e8c6['filters']=_['intersection'](_0x50e8c6[_0x8554('0x2e')],_0x50e8c6[_0x8554('0x2f')]);_0x4fc387[_0x8554('0x34')]=_[_0x8554('0x32')](_0x50e8c6['model'],qs[_0x8554('0x33')](_0x140d82[_0x8554('0x2f')][_0x8554('0x33')]));_0x4fc387['attributes']=_0x4fc387[_0x8554('0x34')]['length']?_0x4fc387[_0x8554('0x34')]:_0x50e8c6[_0x8554('0x2e')];if(_0x140d82[_0x8554('0x2f')][_0x8554('0x45')]){_0x4fc387[_0x8554('0x40')]=[{'all':!![]}];}_0x4fc387=_[_0x8554('0x3b')]({},_0x4fc387,_0x140d82[_0x8554('0x3e')]);return db[_0x8554('0x3f')]['find'](_0x4fc387)[_0x8554('0x23')](handleEntityNotFound(_0x58662f,null))[_0x8554('0x23')](respondWithResult(_0x58662f,null))['catch'](handleError(_0x58662f,null));};exports['create']=function(_0x13c749,_0x4442a3){return db[_0x8554('0x3f')]['create'](_0x13c749[_0x8554('0x46')],{})[_0x8554('0x23')](respondWithResult(_0x4442a3,0xc9))[_0x8554('0x43')](handleError(_0x4442a3,null));};exports[_0x8554('0x47')]=function(_0x4a4181,_0x59c167){if(_0x4a4181[_0x8554('0x46')]['id']){delete _0x4a4181['body']['id'];}return db[_0x8554('0x3f')]['find']({'where':{'id':_0x4a4181['params']['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x59c167,null))[_0x8554('0x23')](saveUpdates(_0x4a4181[_0x8554('0x46')],null))[_0x8554('0x23')](respondWithResult(_0x59c167,null))[_0x8554('0x43')](handleError(_0x59c167,null));};exports[_0x8554('0x48')]=function(_0x1e5fd5,_0x2c7dbd){return db['SugarcrmAccount'][_0x8554('0x49')]({'where':{'id':_0x1e5fd5[_0x8554('0x44')]['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x2c7dbd,null))[_0x8554('0x23')](removeEntity(_0x2c7dbd,null))[_0x8554('0x43')](handleError(_0x2c7dbd,null));};exports[_0x8554('0x4a')]=function(_0x590d0b,_0x3f9e59,_0x220ea4){var _0x2e74cc={};var _0x3f476d={};var _0x3093cd;var _0x38fbda;return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x590d0b['params']['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x3f9e59,null))['then'](function(_0x4b0343){if(_0x4b0343){_0x3093cd=_0x4b0343;_0x3f476d[_0x8554('0x2e')]=_[_0x8554('0x30')](db[_0x8554('0x4c')][_0x8554('0x2a')]);_0x3f476d['query']=_['keys'](_0x590d0b[_0x8554('0x2f')]);_0x3f476d[_0x8554('0x31')]=_[_0x8554('0x32')](_0x3f476d[_0x8554('0x2e')],_0x3f476d['query']);_0x2e74cc[_0x8554('0x34')]=_[_0x8554('0x32')](_0x3f476d['model'],qs[_0x8554('0x33')](_0x590d0b[_0x8554('0x2f')]['fields']));_0x2e74cc[_0x8554('0x34')]=_0x2e74cc[_0x8554('0x34')][_0x8554('0x35')]?_0x2e74cc['attributes']:_0x3f476d['model'];_0x2e74cc[_0x8554('0x38')]=qs['sort'](_0x590d0b['query'][_0x8554('0x39')]);_0x2e74cc[_0x8554('0x3a')]=qs[_0x8554('0x31')](_[_0x8554('0x4d')](_0x590d0b[_0x8554('0x2f')],_0x3f476d[_0x8554('0x31')]));if(_0x590d0b[_0x8554('0x2f')][_0x8554('0x3d')]){_0x2e74cc['where']=_[_0x8554('0x3b')](_0x2e74cc[_0x8554('0x3a')],{'$or':_[_0x8554('0x29')](_0x2e74cc['attributes'],function(_0x54e7d5){var _0x129cb9={};_0x129cb9[_0x54e7d5]={'$like':'%'+_0x590d0b[_0x8554('0x2f')][_0x8554('0x3d')]+'%'};return _0x129cb9;})});}_0x2e74cc=_['merge']({},_0x2e74cc,_0x590d0b[_0x8554('0x3e')]);return _0x3093cd['getConfigurations'](_0x2e74cc);}})[_0x8554('0x23')](function(_0x306dce){if(_0x306dce){_0x38fbda=_0x306dce[_0x8554('0x35')];if(!_0x590d0b[_0x8554('0x2f')][_0x8554('0x36')](_0x8554('0x37'))){_0x2e74cc[_0x8554('0x1d')]=qs['limit'](_0x590d0b[_0x8554('0x2f')][_0x8554('0x1d')]);_0x2e74cc[_0x8554('0x1b')]=qs[_0x8554('0x1b')](_0x590d0b[_0x8554('0x2f')][_0x8554('0x1b')]);}return _0x3093cd[_0x8554('0x4a')](_0x2e74cc);}})['then'](function(_0x12de4f){if(_0x12de4f){return _0x12de4f?{'count':_0x38fbda,'rows':_0x12de4f}:null;}})[_0x8554('0x23')](respondWithResult(_0x3f9e59,null))[_0x8554('0x43')](handleError(_0x3f9e59,null));};exports[_0x8554('0x4e')]=function(_0x157e6f,_0x98f9a6,_0x3c0b1c){if(_0x157e6f['body']['id']){delete _0x157e6f['body']['id'];}return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x157e6f[_0x8554('0x44')]['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x98f9a6,null))['then'](function(_0x4b844c){if(_0x4b844c){_0x157e6f[_0x8554('0x46')]['AccountId']=_0x4b844c['id'];_0x157e6f['body'][_0x8554('0x4f')]=integrations[_0x8554('0x50')](_0x157e6f['body'][_0x8554('0x51')],_0x157e6f['body'][_0x8554('0x2c')]);_0x157e6f[_0x8554('0x46')][_0x8554('0x52')]=integrations[_0x8554('0x53')](_0x157e6f['body']['channel'],_0x157e6f[_0x8554('0x46')][_0x8554('0x2c')]);return db[_0x8554('0x4c')][_0x8554('0x54')](_0x157e6f['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x8554('0x4f')},{'model':db[_0x8554('0x55')],'as':_0x8554('0x52')}]});}return null;})[_0x8554('0x23')](respondWithResult(_0x98f9a6,null))[_0x8554('0x43')](handleError(_0x98f9a6,null));};exports[_0x8554('0x56')]=function(_0x124a24,_0x216f65,_0x33a18d){var _0x4f30af='';var _0x156913=['id','name',_0x8554('0x57'),_0x8554('0x58'),'description',_0x8554('0x59'),_0x8554('0x5a'),_0x8554('0x5b'),_0x8554('0x5c'),'parent_type',_0x8554('0x5d'),_0x8554('0x5e')];return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x124a24[_0x8554('0x44')]['id']},'attributes':['id',_0x8554('0x5f'),'password',_0x8554('0x60')]})[_0x8554('0x23')](handleEntityNotFound(_0x216f65,null))[_0x8554('0x23')](function(_0x39ee60){if(_0x39ee60){_0x4f30af=_0x39ee60[_0x8554('0x60')];var _0x3b2bc5=_0x4f30af['slice'](-0x1);if(_0x3b2bc5==='/'){_0x4f30af=_0x4f30af[_0x8554('0x61')](0x0,_0x4f30af['lastIndexOf'](_0x3b2bc5));}return rp({'method':_0x8554('0x62'),'uri':util[_0x8554('0x63')]('%s%s',_0x4f30af,_0x8554('0x64')),'json':!![],'form':{'method':_0x8554('0x65'),'input_type':_0x8554('0x66'),'response_type':_0x8554('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x39ee60[_0x8554('0x5f')],'password':_0x39ee60['password'],'encryption':_0x8554('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x1a9f1e){if(_0x1a9f1e&&_0x1a9f1e['name']!==_0x8554('0x68')&&_0x1a9f1e[_0x8554('0x27')]!==_0x8554('0x69')){return rp({'method':_0x8554('0x62'),'uri':util[_0x8554('0x63')](_0x8554('0x6a'),_0x4f30af,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8554('0x6b'),'input_type':_0x8554('0x66'),'response_type':_0x8554('0x66'),'rest_data':JSON['stringify']({'session':_0x1a9f1e['id'],'module_name':_0x8554('0x6c')})}})[_0x8554('0x23')](function(_0x53d15d){if(_0x53d15d){var _0xf753ac=_[_0x8554('0x6d')](_0x53d15d['module_fields']);_[_0x8554('0x6e')](_0xf753ac,function(_0x215e42){return _0x156913[_0x8554('0x6f')](_0x215e42[_0x8554('0x27')]);});return{'count':_0xf753ac[_0x8554('0x35')],'rows':_['map'](_0xf753ac,function(_0x3bc79e){return{'id':_0x3bc79e[_0x8554('0x27')],'name':_0x3bc79e[_0x8554('0x70')],'custom':_[_0x8554('0x71')](_0x3bc79e['name'],'_c')?!![]:![],'options':_0x3bc79e[_0x8554('0x3e')]?_[_0x8554('0x29')](_[_0x8554('0x6d')](_0x3bc79e[_0x8554('0x3e')]),function(_0x323b0f){return{'name':_0x323b0f[_0x8554('0x72')],'value':_0x323b0f[_0x8554('0x27')]};}):[]};})};}})[_0x8554('0x23')](respondWithResult(_0x216f65,null))['catch'](function(_0x523d2d){var _0x3acb27=_0x124a24['query'][_0x8554('0x73')]?0x1f4:_0x523d2d[_0x8554('0x74')]||0x1f4;logger[_0x8554('0x25')](_0x8554('0x75'),_0x8554('0x56'),_0x3acb27,JSON['stringify'](_0x523d2d));delete _0x523d2d['name'];if(_0x3acb27===0x191){_0x3acb27=0x190;}_0x216f65['status'](_0x3acb27)['send'](_0x124a24[_0x8554('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x523d2d[_0x8554('0x74')]}:_0x523d2d);});}else{var _0x2269c1=0x1f4;_0x216f65[_0x8554('0x19')](_0x2269c1)[_0x8554('0x28')]({'message':'Wrong\x20credentials','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 04aec47..b296539 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 _0xc794=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc794,0x95));var _0x4c79=function(_0x5ea469,_0x4da7d2){_0x5ea469=_0x5ea469-0x0;var _0x3ea4b1=_0xc794[_0x5ea469];return _0x3ea4b1;};'use strict';var _=require('lodash');var util=require(_0x4c79('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4c79('0x1'));var BPromise=require(_0x4c79('0x2'));var rp=require(_0x4c79('0x3'));var fs=require('fs');var path=require(_0x4c79('0x4'));var rimraf=require(_0x4c79('0x5'));var config=require(_0x4c79('0x6'));var attributes=require(_0x4c79('0x7'));var integrations=require(_0x4c79('0x8'));module[_0x4c79('0x9')]=function(_0x1e6dbb,_0x2c24c6){return _0x1e6dbb[_0x4c79('0xa')](_0x4c79('0xb'),attributes,{'tableName':_0x4c79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1d4=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports'];(function(_0x5254e8,_0x4abf77){var _0x54731c=function(_0x336f89){while(--_0x336f89){_0x5254e8['push'](_0x5254e8['shift']());}};_0x54731c(++_0x4abf77);}(_0xf1d4,0x158));var _0x4f1d=function(_0x367f94,_0x557c2e){_0x367f94=_0x367f94-0x0;var _0x642387=_0xf1d4[_0x367f94];return _0x642387;};'use strict';var _=require(_0x4f1d('0x0'));var util=require('util');var logger=require(_0x4f1d('0x1'))('api');var moment=require(_0x4f1d('0x2'));var BPromise=require(_0x4f1d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f1d('0x4'));var rimraf=require(_0x4f1d('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x4f1d('0x6'));module[_0x4f1d('0x7')]=function(_0x49948e,_0x17b170){return _0x49948e[_0x4f1d('0x8')](_0x4f1d('0x9'),attributes,{'tableName':_0x4f1d('0xa'),'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 60a6d77..f39f41d 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 _0x278f=['model','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x55e722,_0xef5d78){var _0x33964d=function(_0x2a6718){while(--_0x2a6718){_0x55e722['push'](_0x55e722['shift']());}};_0x33964d(++_0xef5d78);}(_0x278f,0x12c));var _0xf278=function(_0x16e50a,_0x5aec08){_0x16e50a=_0x16e50a-0x0;var _0x1bf2b6=_0x278f[_0x16e50a];return _0x1bf2b6;};'use strict';var _=require(_0xf278('0x0'));var util=require('util');var moment=require(_0xf278('0x1'));var BPromise=require(_0xf278('0x2'));var rs=require(_0xf278('0x3'));var fs=require('fs');var Redis=require(_0xf278('0x4'));var db=require(_0xf278('0x5'))['db'];var utils=require(_0xf278('0x6'));var logger=require(_0xf278('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf278('0x8'));var client=jayson[_0xf278('0x9')][_0xf278('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aea10,_0x25339e,_0x56a968){return new BPromise(function(_0x4ee785,_0x45b169){return client['request'](_0x2aea10,_0x56a968)[_0xf278('0xb')](function(_0x4d83d1){logger[_0xf278('0xc')](_0xf278('0xd'),_0x25339e,_0xf278('0xe'));logger[_0xf278('0xf')](_0xf278('0x10'),_0x25339e,'request\x20sent',JSON[_0xf278('0x11')](_0x4d83d1));if(_0x4d83d1[_0xf278('0x12')]){if(_0x4d83d1[_0xf278('0x12')]['code']===0x1f4){logger[_0xf278('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x25339e,_0x4d83d1[_0xf278('0x12')][_0xf278('0x13')]);return _0x45b169(_0x4d83d1['error'][_0xf278('0x13')]);}logger[_0xf278('0x12')](_0xf278('0xd'),_0x25339e,_0x4d83d1['error']['message']);return _0x4ee785(_0x4d83d1['error']['message']);}else{logger['info'](_0xf278('0xd'),_0x25339e,_0xf278('0xe'));_0x4ee785(_0x4d83d1['result'][_0xf278('0x13')]);}})[_0xf278('0x14')](function(_0x3f6f15){logger[_0xf278('0x12')](_0xf278('0xd'),_0x25339e,_0x3f6f15);_0x45b169(_0x3f6f15);});});}exports[_0xf278('0x15')]=function(_0x3153b1){var _0x515b5a=this;return new Promise(function(_0x1cc3d8,_0x1ca4a5){return db['SugarcrmAccount'][_0xf278('0x16')]({'raw':_0x3153b1[_0xf278('0x17')]?_0x3153b1[_0xf278('0x17')][_0xf278('0x18')]===undefined?!![]:![]:!![],'where':_0x3153b1[_0xf278('0x17')]?_0x3153b1[_0xf278('0x17')][_0xf278('0x19')]||null:null,'attributes':_0x3153b1[_0xf278('0x17')]?_0x3153b1['options'][_0xf278('0x1a')]||null:null,'limit':_0x3153b1[_0xf278('0x17')]?_0x3153b1[_0xf278('0x17')][_0xf278('0x1b')]||null:null,'include':_0x3153b1['options']?_0x3153b1[_0xf278('0x17')][_0xf278('0x1c')]?_[_0xf278('0x1d')](_0x3153b1['options'][_0xf278('0x1c')],function(_0x581956){return{'model':db[_0x581956[_0xf278('0x1e')]],'as':_0x581956['as'],'attributes':_0x581956[_0xf278('0x1a')],'include':_0x581956[_0xf278('0x1c')]?_[_0xf278('0x1d')](_0x581956['include'],function(_0x1d208c){return{'model':db[_0x1d208c[_0xf278('0x1e')]],'as':_0x1d208c['as'],'attributes':_0x1d208c['attributes'],'include':_0x1d208c[_0xf278('0x1c')]?_[_0xf278('0x1d')](_0x1d208c[_0xf278('0x1c')],function(_0x350631){return{'model':db[_0x350631['model']],'as':_0x350631['as'],'attributes':_0x350631[_0xf278('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf278('0xb')](function(_0x5ede7a){logger[_0xf278('0xc')](_0xf278('0x15'),_0x3153b1);logger['debug'](_0xf278('0x15'),_0x3153b1,JSON['stringify'](_0x5ede7a));_0x1cc3d8(_0x5ede7a);})[_0xf278('0x14')](function(_0x3f0bda){logger['error'](_0xf278('0x15'),_0x3f0bda[_0xf278('0x13')],_0x3153b1);_0x1ca4a5(_0x515b5a[_0xf278('0x12')](0x1f4,_0x3f0bda[_0xf278('0x13')]));});});};exports[_0xf278('0x1f')]=function(_0x3aa359){var _0xb50030=this;return new Promise(function(_0x10ee86,_0x127ebc){return db['SugarcrmAccount'][_0xf278('0x20')]({'raw':_0x3aa359[_0xf278('0x17')]?_0x3aa359[_0xf278('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3aa359[_0xf278('0x17')]?_0x3aa359[_0xf278('0x17')][_0xf278('0x19')]||null:null,'attributes':_0x3aa359[_0xf278('0x17')]?_0x3aa359[_0xf278('0x17')][_0xf278('0x1a')]||null:null,'include':_0x3aa359['options']?_0x3aa359[_0xf278('0x17')][_0xf278('0x1c')]?_[_0xf278('0x1d')](_0x3aa359[_0xf278('0x17')][_0xf278('0x1c')],function(_0x131644){return{'model':db[_0x131644[_0xf278('0x1e')]],'as':_0x131644['as'],'attributes':_0x131644[_0xf278('0x1a')],'include':_0x131644[_0xf278('0x1c')]?_[_0xf278('0x1d')](_0x131644[_0xf278('0x1c')],function(_0x23cbf8){return{'model':db[_0x23cbf8[_0xf278('0x1e')]],'as':_0x23cbf8['as'],'attributes':_0x23cbf8[_0xf278('0x1a')],'include':_0x23cbf8['include']?_[_0xf278('0x1d')](_0x23cbf8['include'],function(_0x1cd45f){return{'model':db[_0x1cd45f[_0xf278('0x1e')]],'as':_0x1cd45f['as'],'attributes':_0x1cd45f[_0xf278('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf278('0xb')](function(_0x34148f){logger[_0xf278('0xc')](_0xf278('0x1f'),_0x3aa359);logger[_0xf278('0xf')](_0xf278('0x1f'),_0x3aa359,JSON['stringify'](_0x34148f));_0x10ee86(_0x34148f);})[_0xf278('0x14')](function(_0x200670){logger[_0xf278('0x12')](_0xf278('0x1f'),_0x200670[_0xf278('0x13')],_0x3aa359);_0x127ebc(_0xb50030[_0xf278('0x12')](0x1f4,_0x200670[_0xf278('0x13')]));});});}; \ No newline at end of file +var _0xcd99=['include','map','model','ShowSugarcrmAccount','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit'];(function(_0x2f6541,_0x363cba){var _0x4d76d8=function(_0x86404){while(--_0x86404){_0x2f6541['push'](_0x2f6541['shift']());}};_0x4d76d8(++_0x363cba);}(_0xcd99,0x145));var _0x9cd9=function(_0x34c60e,_0x56bb45){_0x34c60e=_0x34c60e-0x0;var _0x40ae0b=_0xcd99[_0x34c60e];return _0x40ae0b;};'use strict';var _=require(_0x9cd9('0x0'));var util=require(_0x9cd9('0x1'));var moment=require(_0x9cd9('0x2'));var BPromise=require(_0x9cd9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9cd9('0x4'));var logger=require(_0x9cd9('0x5'))(_0x9cd9('0x6'));var config=require(_0x9cd9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cd9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538579,_0x1d2833,_0xaeebf3){return new BPromise(function(_0x548852,_0x2e0af2){return client[_0x9cd9('0x9')](_0x538579,_0xaeebf3)[_0x9cd9('0xa')](function(_0x22e66c){logger[_0x9cd9('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x1d2833,_0x9cd9('0xc'));logger['debug'](_0x9cd9('0xd'),_0x1d2833,_0x9cd9('0xc'),JSON[_0x9cd9('0xe')](_0x22e66c));if(_0x22e66c['error']){if(_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x10')]===0x1f4){logger['error'](_0x9cd9('0x11'),_0x1d2833,_0x22e66c[_0x9cd9('0xf')]['message']);return _0x2e0af2(_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x12')]);}logger[_0x9cd9('0xf')](_0x9cd9('0x11'),_0x1d2833,_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x12')]);return _0x548852(_0x22e66c[_0x9cd9('0xf')]['message']);}else{logger[_0x9cd9('0xb')](_0x9cd9('0x11'),_0x1d2833,_0x9cd9('0xc'));_0x548852(_0x22e66c['result']['message']);}})[_0x9cd9('0x13')](function(_0x15180c){logger['error'](_0x9cd9('0x11'),_0x1d2833,_0x15180c);_0x2e0af2(_0x15180c);});});}exports[_0x9cd9('0x14')]=function(_0xf13b5b){var _0x556858=this;return new Promise(function(_0x5cb935,_0x4df7af){return db[_0x9cd9('0x15')][_0x9cd9('0x16')]({'raw':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b['options']['raw']===undefined?!![]:![]:!![],'where':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x18')]||null:null,'attributes':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x19')]||null:null,'limit':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1a')]||null:null,'include':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1b')],function(_0x19f7b6){return{'model':db[_0x19f7b6[_0x9cd9('0x1d')]],'as':_0x19f7b6['as'],'attributes':_0x19f7b6[_0x9cd9('0x19')],'include':_0x19f7b6[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x19f7b6[_0x9cd9('0x1b')],function(_0x35eef2){return{'model':db[_0x35eef2['model']],'as':_0x35eef2['as'],'attributes':_0x35eef2[_0x9cd9('0x19')],'include':_0x35eef2['include']?_[_0x9cd9('0x1c')](_0x35eef2[_0x9cd9('0x1b')],function(_0x4158eb){return{'model':db[_0x4158eb['model']],'as':_0x4158eb['as'],'attributes':_0x4158eb[_0x9cd9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9cd9('0xa')](function(_0x56838c){logger[_0x9cd9('0xb')](_0x9cd9('0x14'),_0xf13b5b);logger['debug']('GetSugarcrmAccount',_0xf13b5b,JSON[_0x9cd9('0xe')](_0x56838c));_0x5cb935(_0x56838c);})[_0x9cd9('0x13')](function(_0x3be6ec){logger[_0x9cd9('0xf')](_0x9cd9('0x14'),_0x3be6ec['message'],_0xf13b5b);_0x4df7af(_0x556858[_0x9cd9('0xf')](0x1f4,_0x3be6ec[_0x9cd9('0x12')]));});});};exports[_0x9cd9('0x1e')]=function(_0x31f212){var _0x1587f2=this;return new Promise(function(_0x36ff5b,_0x431134){return db[_0x9cd9('0x15')]['find']({'raw':_0x31f212[_0x9cd9('0x17')]?_0x31f212[_0x9cd9('0x17')][_0x9cd9('0x1f')]===undefined?!![]:![]:!![],'where':_0x31f212[_0x9cd9('0x17')]?_0x31f212['options'][_0x9cd9('0x18')]||null:null,'attributes':_0x31f212[_0x9cd9('0x17')]?_0x31f212['options'][_0x9cd9('0x19')]||null:null,'include':_0x31f212[_0x9cd9('0x17')]?_0x31f212[_0x9cd9('0x17')][_0x9cd9('0x1b')]?_['map'](_0x31f212['options'][_0x9cd9('0x1b')],function(_0x854ac){return{'model':db[_0x854ac[_0x9cd9('0x1d')]],'as':_0x854ac['as'],'attributes':_0x854ac['attributes'],'include':_0x854ac[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x854ac[_0x9cd9('0x1b')],function(_0x58a0ed){return{'model':db[_0x58a0ed[_0x9cd9('0x1d')]],'as':_0x58a0ed['as'],'attributes':_0x58a0ed[_0x9cd9('0x19')],'include':_0x58a0ed[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x58a0ed['include'],function(_0x2f5717){return{'model':db[_0x2f5717[_0x9cd9('0x1d')]],'as':_0x2f5717['as'],'attributes':_0x2f5717[_0x9cd9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9cd9('0xa')](function(_0x5a6a59){logger[_0x9cd9('0xb')]('ShowSugarcrmAccount',_0x31f212);logger['debug'](_0x9cd9('0x1e'),_0x31f212,JSON['stringify'](_0x5a6a59));_0x36ff5b(_0x5a6a59);})['catch'](function(_0x5696d9){logger[_0x9cd9('0xf')](_0x9cd9('0x1e'),_0x5696d9[_0x9cd9('0x12')],_0x31f212);_0x431134(_0x1587f2[_0x9cd9('0xf')](0x1f4,_0x5696d9[_0x9cd9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 20f600d..5edcf4e 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 _0xa752=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','/:id','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0xb1174e,_0x1e68a7){var _0x285bac=function(_0x32c505){while(--_0x32c505){_0xb1174e['push'](_0xb1174e['shift']());}};_0x285bac(++_0x1e68a7);}(_0xa752,0x155));var _0x2a75=function(_0x36ddb6,_0x4986c3){_0x36ddb6=_0x36ddb6-0x0;var _0x284334=_0xa752[_0x36ddb6];return _0x284334;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2a75('0x0'));var express=require(_0x2a75('0x1'));var router=express[_0x2a75('0x2')]();var fs_extra=require(_0x2a75('0x3'));var auth=require(_0x2a75('0x4'));var interaction=require(_0x2a75('0x5'));var config=require(_0x2a75('0x6'));var controller=require(_0x2a75('0x7'));router[_0x2a75('0x8')]('/',auth[_0x2a75('0x9')](),controller[_0x2a75('0xa')]);router['get']('/:id',auth[_0x2a75('0x9')](),controller['show']);router[_0x2a75('0x8')](_0x2a75('0xb'),auth['isAuthenticated'](),controller[_0x2a75('0xc')]);router[_0x2a75('0x8')](_0x2a75('0xd'),auth[_0x2a75('0x9')](),controller['getSubjects']);router[_0x2a75('0x8')](_0x2a75('0xe'),auth[_0x2a75('0x9')](),controller[_0x2a75('0xf')]);router['post']('/',auth[_0x2a75('0x9')](),controller[_0x2a75('0x10')]);router[_0x2a75('0x11')](_0x2a75('0x12'),auth['isAuthenticated'](),controller[_0x2a75('0x13')]);router['delete'](_0x2a75('0x12'),auth['isAuthenticated'](),controller[_0x2a75('0x14')]);module[_0x2a75('0x15')]=router; \ No newline at end of file +var _0xa611=['getSubjects','/:id/descriptions','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x57edc8,_0x1174bf){var _0x2734c2=function(_0x3170e1){while(--_0x3170e1){_0x57edc8['push'](_0x57edc8['shift']());}};_0x2734c2(++_0x1174bf);}(_0xa611,0x1ab));var _0x1a61=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa611[_0x173d7e];return _0x2220d6;};'use strict';var multer=require('multer');var util=require(_0x1a61('0x0'));var path=require(_0x1a61('0x1'));var timeout=require(_0x1a61('0x2'));var express=require(_0x1a61('0x3'));var router=express['Router']();var fs_extra=require(_0x1a61('0x4'));var auth=require(_0x1a61('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a61('0x6'));router[_0x1a61('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a61('0x7')]('/:id',auth[_0x1a61('0x8')](),controller[_0x1a61('0x9')]);router['get'](_0x1a61('0xa'),auth[_0x1a61('0x8')](),controller[_0x1a61('0xb')]);router[_0x1a61('0x7')](_0x1a61('0xc'),auth[_0x1a61('0x8')](),controller[_0x1a61('0xd')]);router[_0x1a61('0x7')](_0x1a61('0xe'),auth[_0x1a61('0x8')](),controller['getDescriptions']);router[_0x1a61('0xf')]('/',auth[_0x1a61('0x8')](),controller['create']);router[_0x1a61('0x10')](_0x1a61('0x11'),auth[_0x1a61('0x8')](),controller[_0x1a61('0x12')]);router[_0x1a61('0x13')]('/:id',auth[_0x1a61('0x8')](),controller[_0x1a61('0x14')]);module[_0x1a61('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 27a625f..cb41cc5 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 _0x95d3=['sequelize','exports','STRING'];(function(_0x317f47,_0x3a7a2e){var _0x4c553b=function(_0x4b63e2){while(--_0x4b63e2){_0x317f47['push'](_0x317f47['shift']());}};_0x4c553b(++_0x3a7a2e);}(_0x95d3,0xd8));var _0x395d=function(_0x559a98,_0x46765f){_0x559a98=_0x559a98-0x0;var _0x12d5a0=_0x95d3[_0x559a98];return _0x12d5a0;};'use strict';var Sequelize=require(_0x395d('0x0'));module[_0x395d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x395d('0x2')]}}; \ No newline at end of file +var _0x61ea=['STRING','exports'];(function(_0xaa5cb8,_0x3b78cb){var _0x518b8c=function(_0x157b70){while(--_0x157b70){_0xaa5cb8['push'](_0xaa5cb8['shift']());}};_0x518b8c(++_0x3b78cb);}(_0x61ea,0x1df));var _0xa61e=function(_0x2b623c,_0x1eca8f){_0x2b623c=_0x2b623c-0x0;var _0x1e8df7=_0x61ea[_0x2b623c];return _0x1e8df7;};'use strict';var Sequelize=require('sequelize');module[_0xa61e('0x0')]={'name':{'type':Sequelize[_0xa61e('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index dd18a6d..d2991ec 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 _0x56e3=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','fields','options','find','create','update','body','params','getFields','findOne','SugarcrmField','filter','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs'];(function(_0xbc0086,_0xb4a167){var _0x587185=function(_0x3d0be3){while(--_0x3d0be3){_0xbc0086['push'](_0xbc0086['shift']());}};_0x587185(++_0xb4a167);}(_0x56e3,0xa7));var _0x356e=function(_0x32c162,_0x2d30ac){_0x32c162=_0x32c162-0x0;var _0x58435f=_0x56e3[_0x32c162];return _0x58435f;};'use strict';var emlformat=require(_0x356e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x356e('0x1'));var jsonpatch=require(_0x356e('0x2'));var rp=require(_0x356e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x356e('0x4'));var util=require('util');var path=require(_0x356e('0x5'));var sox=require(_0x356e('0x6'));var csv=require(_0x356e('0x7'));var ejs=require(_0x356e('0x8'));var fs=require('fs');var fs_extra=require(_0x356e('0x9'));var _=require(_0x356e('0xa'));var squel=require(_0x356e('0xb'));var crypto=require(_0x356e('0xc'));var jsforce=require(_0x356e('0xd'));var deskjs=require(_0x356e('0xe'));var toCsv=require(_0x356e('0x7'));var querystring=require(_0x356e('0xf'));var Papa=require(_0x356e('0x10'));var Redis=require(_0x356e('0x11'));var authService=require(_0x356e('0x12'));var qs=require(_0x356e('0x13'));var as=require(_0x356e('0x14'));var hardwareService=require(_0x356e('0x15'));var logger=require(_0x356e('0x16'))(_0x356e('0x17'));var utils=require(_0x356e('0x18'));var config=require(_0x356e('0x19'));var licenseUtil=require(_0x356e('0x1a'));var db=require(_0x356e('0x1b'))['db'];function respondWithStatusCode(_0x291bcd,_0x1e0298){_0x1e0298=_0x1e0298||0xcc;return function(_0x56fbd7){if(_0x56fbd7){return _0x291bcd[_0x356e('0x1c')](_0x1e0298);}return _0x291bcd[_0x356e('0x1d')](_0x1e0298)[_0x356e('0x1e')]();};}function respondWithResult(_0x30163e,_0x1a25f3){_0x1a25f3=_0x1a25f3||0xc8;return function(_0x53cdb3){if(_0x53cdb3){return _0x30163e[_0x356e('0x1d')](_0x1a25f3)[_0x356e('0x1f')](_0x53cdb3);}};}function respondWithFilteredResult(_0x2e5e71,_0xe3c661){return function(_0x25b5c9){if(_0x25b5c9){var _0x4c2547=typeof _0xe3c661[_0x356e('0x20')]==='undefined'&&typeof _0xe3c661[_0x356e('0x21')]===_0x356e('0x22');var _0x5206ec=_0x25b5c9[_0x356e('0x23')];var _0x213e4e=_0x4c2547?0x0:_0xe3c661[_0x356e('0x20')];var _0x5c5726=_0x4c2547?_0x25b5c9[_0x356e('0x23')]:_0xe3c661['offset']+_0xe3c661[_0x356e('0x21')];var _0x2496ba;if(_0x5c5726>=_0x5206ec){_0x5c5726=_0x5206ec;_0x2496ba=0xc8;}else{_0x2496ba=0xce;}_0x2e5e71['status'](_0x2496ba);return _0x2e5e71[_0x356e('0x24')](_0x356e('0x25'),_0x213e4e+'-'+_0x5c5726+'/'+_0x5206ec)['json'](_0x25b5c9);}return null;};}function patchUpdates(_0x2e272b){return function(_0x55bf56){try{jsonpatch[_0x356e('0x26')](_0x55bf56,_0x2e272b,!![]);}catch(_0x46898b){return BPromise[_0x356e('0x27')](_0x46898b);}return _0x55bf56[_0x356e('0x28')]();};}function saveUpdates(_0xb7b78a,_0x80698f){return function(_0x3702c4){if(_0x3702c4){return _0x3702c4['update'](_0xb7b78a)[_0x356e('0x29')](function(_0x54128d){return _0x54128d;});}return null;};}function removeEntity(_0x1ec0b3,_0x15c7f1){return function(_0xf8a900){if(_0xf8a900){return _0xf8a900[_0x356e('0x2a')]()[_0x356e('0x29')](function(){_0x1ec0b3[_0x356e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xad2830,_0x108412){return function(_0x25b707){if(!_0x25b707){_0xad2830['sendStatus'](0x194);}return _0x25b707;};}function handleError(_0x158ad8,_0x7a6b72){_0x7a6b72=_0x7a6b72||0x1f4;return function(_0x51fc09){logger[_0x356e('0x2b')](_0x51fc09[_0x356e('0x2c')]);if(_0x51fc09[_0x356e('0x2d')]){delete _0x51fc09[_0x356e('0x2d')];}_0x158ad8[_0x356e('0x1d')](_0x7a6b72)[_0x356e('0x2e')](_0x51fc09);};}exports[_0x356e('0x2f')]=function(_0x2bb73b,_0x330cde){var _0x40716d={},_0x5d1761={},_0x2620ad={'count':0x0,'rows':[]};var _0x4beb5a=_[_0x356e('0x30')](db[_0x356e('0x31')][_0x356e('0x32')],function(_0x4e114a){return{'name':_0x4e114a[_0x356e('0x33')],'type':_0x4e114a[_0x356e('0x34')][_0x356e('0x35')]};});_0x5d1761[_0x356e('0x36')]=_[_0x356e('0x30')](_0x4beb5a,_0x356e('0x2d'));_0x5d1761[_0x356e('0x37')]=_[_0x356e('0x38')](_0x2bb73b[_0x356e('0x37')]);_0x5d1761[_0x356e('0x39')]=_[_0x356e('0x3a')](_0x5d1761[_0x356e('0x36')],_0x5d1761['query']);_0x40716d[_0x356e('0x3b')]=_[_0x356e('0x3a')](_0x5d1761['model'],qs['fields'](_0x2bb73b[_0x356e('0x37')]['fields']));_0x40716d[_0x356e('0x3b')]=_0x40716d['attributes'][_0x356e('0x3c')]?_0x40716d[_0x356e('0x3b')]:_0x5d1761[_0x356e('0x36')];if(!_0x2bb73b[_0x356e('0x37')]['hasOwnProperty'](_0x356e('0x3d'))){_0x40716d[_0x356e('0x21')]=qs[_0x356e('0x21')](_0x2bb73b[_0x356e('0x37')][_0x356e('0x21')]);_0x40716d['offset']=qs['offset'](_0x2bb73b[_0x356e('0x37')][_0x356e('0x20')]);}_0x40716d[_0x356e('0x3e')]=qs[_0x356e('0x3f')](_0x2bb73b['query']['sort']);_0x40716d[_0x356e('0x40')]=qs[_0x356e('0x39')](_[_0x356e('0x41')](_0x2bb73b['query'],_0x5d1761[_0x356e('0x39')]),_0x4beb5a);if(_0x2bb73b[_0x356e('0x37')]['filter']){_0x40716d['where']=_['merge'](_0x40716d[_0x356e('0x40')],{'$or':_[_0x356e('0x30')](_0x4beb5a,function(_0x1bfffd){if(_0x1bfffd[_0x356e('0x34')]!==_0x356e('0x42')){var _0x29331c={};_0x29331c[_0x1bfffd[_0x356e('0x2d')]]={'$like':'%'+_0x2bb73b[_0x356e('0x37')]['filter']+'%'};return _0x29331c;}})});}_0x40716d=_[_0x356e('0x43')]({},_0x40716d,_0x2bb73b['options']);var _0x1e4a47={'where':_0x40716d[_0x356e('0x40')]};return db[_0x356e('0x31')][_0x356e('0x23')](_0x1e4a47)[_0x356e('0x29')](function(_0x5f76be){_0x2620ad[_0x356e('0x23')]=_0x5f76be;if(_0x2bb73b['query'][_0x356e('0x44')]){_0x40716d[_0x356e('0x45')]=[{'all':!![]}];}return db[_0x356e('0x31')][_0x356e('0x46')](_0x40716d);})[_0x356e('0x29')](function(_0x4414b4){_0x2620ad[_0x356e('0x47')]=_0x4414b4;return _0x2620ad;})[_0x356e('0x29')](respondWithFilteredResult(_0x330cde,_0x40716d))[_0x356e('0x48')](handleError(_0x330cde,null));};exports[_0x356e('0x49')]=function(_0x3c7e7d,_0x2e1152){var _0x1eea9d={'raw':![],'where':{'id':_0x3c7e7d['params']['id']}},_0x435292={};_0x435292['model']=_[_0x356e('0x38')](db[_0x356e('0x31')][_0x356e('0x32')]);_0x435292[_0x356e('0x37')]=_['keys'](_0x3c7e7d[_0x356e('0x37')]);_0x435292['filters']=_['intersection'](_0x435292['model'],_0x435292[_0x356e('0x37')]);_0x1eea9d[_0x356e('0x3b')]=_[_0x356e('0x3a')](_0x435292[_0x356e('0x36')],qs[_0x356e('0x4a')](_0x3c7e7d[_0x356e('0x37')][_0x356e('0x4a')]));_0x1eea9d[_0x356e('0x3b')]=_0x1eea9d[_0x356e('0x3b')][_0x356e('0x3c')]?_0x1eea9d['attributes']:_0x435292[_0x356e('0x36')];if(_0x3c7e7d[_0x356e('0x37')]['includeAll']){_0x1eea9d[_0x356e('0x45')]=[{'all':!![]}];}_0x1eea9d=_[_0x356e('0x43')]({},_0x1eea9d,_0x3c7e7d[_0x356e('0x4b')]);return db[_0x356e('0x31')][_0x356e('0x4c')](_0x1eea9d)[_0x356e('0x29')](handleEntityNotFound(_0x2e1152,null))[_0x356e('0x29')](respondWithResult(_0x2e1152,null))[_0x356e('0x48')](handleError(_0x2e1152,null));};exports[_0x356e('0x4d')]=function(_0x2e26eb,_0x1452a4){return db[_0x356e('0x31')][_0x356e('0x4d')](_0x2e26eb['body'],{})[_0x356e('0x29')](respondWithResult(_0x1452a4,0xc9))['catch'](handleError(_0x1452a4,null));};exports[_0x356e('0x4e')]=function(_0x3fe8ae,_0x217a0d){if(_0x3fe8ae[_0x356e('0x4f')]['id']){delete _0x3fe8ae['body']['id'];}return db[_0x356e('0x31')][_0x356e('0x4c')]({'where':{'id':_0x3fe8ae[_0x356e('0x50')]['id']}})[_0x356e('0x29')](handleEntityNotFound(_0x217a0d,null))[_0x356e('0x29')](saveUpdates(_0x3fe8ae[_0x356e('0x4f')],null))[_0x356e('0x29')](respondWithResult(_0x217a0d,null))[_0x356e('0x48')](handleError(_0x217a0d,null));};exports[_0x356e('0x2a')]=function(_0x29d47b,_0x5e355d){return db[_0x356e('0x31')][_0x356e('0x4c')]({'where':{'id':_0x29d47b[_0x356e('0x50')]['id']}})[_0x356e('0x29')](handleEntityNotFound(_0x5e355d,null))[_0x356e('0x29')](removeEntity(_0x5e355d,null))[_0x356e('0x48')](handleError(_0x5e355d,null));};exports[_0x356e('0x51')]=function(_0x3b77b3,_0x6fdd4,_0x347944){var _0x392d0e={};var _0x2340c5={};var _0x1777e0;var _0x49ecd6;return db[_0x356e('0x31')][_0x356e('0x52')]({'where':{'id':_0x3b77b3['params']['id']}})[_0x356e('0x29')](handleEntityNotFound(_0x6fdd4,null))['then'](function(_0x58490a){if(_0x58490a){_0x1777e0=_0x58490a;_0x2340c5[_0x356e('0x36')]=_['keys'](db[_0x356e('0x53')][_0x356e('0x32')]);_0x2340c5[_0x356e('0x37')]=_[_0x356e('0x38')](_0x3b77b3[_0x356e('0x37')]);_0x2340c5[_0x356e('0x39')]=_[_0x356e('0x3a')](_0x2340c5['model'],_0x2340c5[_0x356e('0x37')]);_0x392d0e['attributes']=_[_0x356e('0x3a')](_0x2340c5[_0x356e('0x36')],qs[_0x356e('0x4a')](_0x3b77b3[_0x356e('0x37')]['fields']));_0x392d0e[_0x356e('0x3b')]=_0x392d0e[_0x356e('0x3b')][_0x356e('0x3c')]?_0x392d0e[_0x356e('0x3b')]:_0x2340c5[_0x356e('0x36')];_0x392d0e[_0x356e('0x3e')]=qs[_0x356e('0x3f')](_0x3b77b3[_0x356e('0x37')][_0x356e('0x3f')]);_0x392d0e[_0x356e('0x40')]=qs[_0x356e('0x39')](_[_0x356e('0x41')](_0x3b77b3[_0x356e('0x37')],_0x2340c5[_0x356e('0x39')]));if(_0x3b77b3[_0x356e('0x37')][_0x356e('0x54')]){_0x392d0e[_0x356e('0x40')]=_['merge'](_0x392d0e['where'],{'$or':_['map'](_0x392d0e[_0x356e('0x3b')],function(_0x429b0b){var _0x179d84={};_0x179d84[_0x429b0b]={'$like':'%'+_0x3b77b3['query'][_0x356e('0x54')]+'%'};return _0x179d84;})});}_0x392d0e=_[_0x356e('0x43')]({},_0x392d0e,_0x3b77b3[_0x356e('0x4b')]);return _0x1777e0[_0x356e('0x51')](_0x392d0e);}})[_0x356e('0x29')](function(_0x50b6d4){if(_0x50b6d4){_0x49ecd6=_0x50b6d4[_0x356e('0x3c')];if(!_0x3b77b3[_0x356e('0x37')][_0x356e('0x55')](_0x356e('0x3d'))){_0x392d0e[_0x356e('0x21')]=qs['limit'](_0x3b77b3[_0x356e('0x37')][_0x356e('0x21')]);_0x392d0e['offset']=qs[_0x356e('0x20')](_0x3b77b3[_0x356e('0x37')][_0x356e('0x20')]);}return _0x1777e0[_0x356e('0x51')](_0x392d0e);}})[_0x356e('0x29')](function(_0x6f69c4){if(_0x6f69c4){return _0x6f69c4?{'count':_0x49ecd6,'rows':_0x6f69c4}:null;}})[_0x356e('0x29')](respondWithResult(_0x6fdd4,null))[_0x356e('0x48')](handleError(_0x6fdd4,null));};exports[_0x356e('0x56')]=function(_0x5a7dcc,_0x448895,_0x31dab1){var _0xb258f8={};var _0x357e0a={};var _0x3b3aab;var _0x5dc123;return db[_0x356e('0x31')]['findOne']({'where':{'id':_0x5a7dcc[_0x356e('0x50')]['id']}})[_0x356e('0x29')](handleEntityNotFound(_0x448895,null))[_0x356e('0x29')](function(_0x18c83a){if(_0x18c83a){_0x3b3aab=_0x18c83a;_0x357e0a[_0x356e('0x36')]=_['keys'](db[_0x356e('0x53')]['rawAttributes']);_0x357e0a[_0x356e('0x37')]=_[_0x356e('0x38')](_0x5a7dcc[_0x356e('0x37')]);_0x357e0a[_0x356e('0x39')]=_['intersection'](_0x357e0a[_0x356e('0x36')],_0x357e0a[_0x356e('0x37')]);_0xb258f8[_0x356e('0x3b')]=_['intersection'](_0x357e0a[_0x356e('0x36')],qs['fields'](_0x5a7dcc[_0x356e('0x37')][_0x356e('0x4a')]));_0xb258f8[_0x356e('0x3b')]=_0xb258f8[_0x356e('0x3b')][_0x356e('0x3c')]?_0xb258f8[_0x356e('0x3b')]:_0x357e0a['model'];_0xb258f8[_0x356e('0x3e')]=qs[_0x356e('0x3f')](_0x5a7dcc['query']['sort']);_0xb258f8[_0x356e('0x40')]=qs[_0x356e('0x39')](_['pick'](_0x5a7dcc[_0x356e('0x37')],_0x357e0a[_0x356e('0x39')]));if(_0x5a7dcc[_0x356e('0x37')][_0x356e('0x54')]){_0xb258f8['where']=_[_0x356e('0x43')](_0xb258f8[_0x356e('0x40')],{'$or':_[_0x356e('0x30')](_0xb258f8[_0x356e('0x3b')],function(_0x5c5ca2){var _0x12160d={};_0x12160d[_0x5c5ca2]={'$like':'%'+_0x5a7dcc['query'][_0x356e('0x54')]+'%'};return _0x12160d;})});}_0xb258f8=_[_0x356e('0x43')]({},_0xb258f8,_0x5a7dcc[_0x356e('0x4b')]);return _0x3b3aab[_0x356e('0x56')](_0xb258f8);}})['then'](function(_0x42c1db){if(_0x42c1db){_0x5dc123=_0x42c1db[_0x356e('0x3c')];if(!_0x5a7dcc['query']['hasOwnProperty'](_0x356e('0x3d'))){_0xb258f8[_0x356e('0x21')]=qs['limit'](_0x5a7dcc[_0x356e('0x37')][_0x356e('0x21')]);_0xb258f8[_0x356e('0x20')]=qs[_0x356e('0x20')](_0x5a7dcc[_0x356e('0x37')][_0x356e('0x20')]);}return _0x3b3aab['getSubjects'](_0xb258f8);}})[_0x356e('0x29')](function(_0x5c3ca3){if(_0x5c3ca3){return _0x5c3ca3?{'count':_0x5dc123,'rows':_0x5c3ca3}:null;}})[_0x356e('0x29')](respondWithResult(_0x448895,null))[_0x356e('0x48')](handleError(_0x448895,null));};exports[_0x356e('0x57')]=function(_0x361b7d,_0x3848bc,_0x5c7a12){var _0x4fb86b={};var _0x1ba60d={};var _0x5bf069;var _0x4b8158;return db[_0x356e('0x31')][_0x356e('0x52')]({'where':{'id':_0x361b7d[_0x356e('0x50')]['id']}})['then'](handleEntityNotFound(_0x3848bc,null))['then'](function(_0x41918e){if(_0x41918e){_0x5bf069=_0x41918e;_0x1ba60d[_0x356e('0x36')]=_[_0x356e('0x38')](db['SugarcrmField'][_0x356e('0x32')]);_0x1ba60d['query']=_[_0x356e('0x38')](_0x361b7d[_0x356e('0x37')]);_0x1ba60d[_0x356e('0x39')]=_[_0x356e('0x3a')](_0x1ba60d['model'],_0x1ba60d[_0x356e('0x37')]);_0x4fb86b[_0x356e('0x3b')]=_['intersection'](_0x1ba60d[_0x356e('0x36')],qs['fields'](_0x361b7d['query'][_0x356e('0x4a')]));_0x4fb86b[_0x356e('0x3b')]=_0x4fb86b[_0x356e('0x3b')][_0x356e('0x3c')]?_0x4fb86b['attributes']:_0x1ba60d[_0x356e('0x36')];_0x4fb86b[_0x356e('0x3e')]=qs['sort'](_0x361b7d[_0x356e('0x37')][_0x356e('0x3f')]);_0x4fb86b[_0x356e('0x40')]=qs[_0x356e('0x39')](_['pick'](_0x361b7d['query'],_0x1ba60d[_0x356e('0x39')]));if(_0x361b7d[_0x356e('0x37')][_0x356e('0x54')]){_0x4fb86b[_0x356e('0x40')]=_[_0x356e('0x43')](_0x4fb86b[_0x356e('0x40')],{'$or':_['map'](_0x4fb86b[_0x356e('0x3b')],function(_0x34a859){var _0x53d62b={};_0x53d62b[_0x34a859]={'$like':'%'+_0x361b7d[_0x356e('0x37')][_0x356e('0x54')]+'%'};return _0x53d62b;})});}_0x4fb86b=_[_0x356e('0x43')]({},_0x4fb86b,_0x361b7d['options']);return _0x5bf069[_0x356e('0x57')](_0x4fb86b);}})[_0x356e('0x29')](function(_0x240d79){if(_0x240d79){_0x4b8158=_0x240d79['length'];if(!_0x361b7d['query'][_0x356e('0x55')](_0x356e('0x3d'))){_0x4fb86b[_0x356e('0x21')]=qs[_0x356e('0x21')](_0x361b7d[_0x356e('0x37')]['limit']);_0x4fb86b[_0x356e('0x20')]=qs['offset'](_0x361b7d[_0x356e('0x37')][_0x356e('0x20')]);}return _0x5bf069[_0x356e('0x57')](_0x4fb86b);}})[_0x356e('0x29')](function(_0x4fe4a9){if(_0x4fe4a9){return _0x4fe4a9?{'count':_0x4b8158,'rows':_0x4fe4a9}:null;}})[_0x356e('0x29')](respondWithResult(_0x3848bc,null))[_0x356e('0x48')](handleError(_0x3848bc,null));}; \ No newline at end of file +var _0x21b3=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','options','includeAll','findAll','rows','catch','find','create','body','update','params','getFields','findOne','getSubjects','SugarcrmField','getDescriptions','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x305677,_0xd67d7d){var _0x1b07a8=function(_0x2f8162){while(--_0x2f8162){_0x305677['push'](_0x305677['shift']());}};_0x1b07a8(++_0xd67d7d);}(_0x21b3,0x16e));var _0x321b=function(_0x2edcfc,_0x5f465a){_0x2edcfc=_0x2edcfc-0x0;var _0xfd5dc3=_0x21b3[_0x2edcfc];return _0xfd5dc3;};'use strict';var emlformat=require(_0x321b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x321b('0x1'));var jsonpatch=require(_0x321b('0x2'));var rp=require(_0x321b('0x3'));var moment=require(_0x321b('0x4'));var BPromise=require(_0x321b('0x5'));var Mustache=require(_0x321b('0x6'));var util=require(_0x321b('0x7'));var path=require(_0x321b('0x8'));var sox=require(_0x321b('0x9'));var csv=require(_0x321b('0xa'));var ejs=require(_0x321b('0xb'));var fs=require('fs');var fs_extra=require(_0x321b('0xc'));var _=require(_0x321b('0xd'));var squel=require(_0x321b('0xe'));var crypto=require(_0x321b('0xf'));var jsforce=require(_0x321b('0x10'));var deskjs=require(_0x321b('0x11'));var toCsv=require(_0x321b('0xa'));var querystring=require(_0x321b('0x12'));var Papa=require('papaparse');var Redis=require(_0x321b('0x13'));var authService=require(_0x321b('0x14'));var qs=require(_0x321b('0x15'));var as=require(_0x321b('0x16'));var hardwareService=require(_0x321b('0x17'));var logger=require(_0x321b('0x18'))(_0x321b('0x19'));var utils=require(_0x321b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x321b('0x1b'))['db'];function respondWithStatusCode(_0x5c3ae4,_0x40c238){_0x40c238=_0x40c238||0xcc;return function(_0x27c602){if(_0x27c602){return _0x5c3ae4[_0x321b('0x1c')](_0x40c238);}return _0x5c3ae4[_0x321b('0x1d')](_0x40c238)['end']();};}function respondWithResult(_0x4f1bae,_0x43cd25){_0x43cd25=_0x43cd25||0xc8;return function(_0x46b910){if(_0x46b910){return _0x4f1bae['status'](_0x43cd25)[_0x321b('0x1e')](_0x46b910);}};}function respondWithFilteredResult(_0x4fb78b,_0x10a63f){return function(_0x24cfba){if(_0x24cfba){var _0x36988b=typeof _0x10a63f['offset']===_0x321b('0x1f')&&typeof _0x10a63f[_0x321b('0x20')]===_0x321b('0x1f');var _0x55efff=_0x24cfba['count'];var _0x43746e=_0x36988b?0x0:_0x10a63f[_0x321b('0x21')];var _0x1beb30=_0x36988b?_0x24cfba[_0x321b('0x22')]:_0x10a63f[_0x321b('0x21')]+_0x10a63f[_0x321b('0x20')];var _0x7cfb98;if(_0x1beb30>=_0x55efff){_0x1beb30=_0x55efff;_0x7cfb98=0xc8;}else{_0x7cfb98=0xce;}_0x4fb78b[_0x321b('0x1d')](_0x7cfb98);return _0x4fb78b['set'](_0x321b('0x23'),_0x43746e+'-'+_0x1beb30+'/'+_0x55efff)[_0x321b('0x1e')](_0x24cfba);}return null;};}function patchUpdates(_0x5e1f23){return function(_0x4ffdc3){try{jsonpatch[_0x321b('0x24')](_0x4ffdc3,_0x5e1f23,!![]);}catch(_0x45ace0){return BPromise[_0x321b('0x25')](_0x45ace0);}return _0x4ffdc3[_0x321b('0x26')]();};}function saveUpdates(_0x936eb0,_0x1bfa55){return function(_0x1549cd){if(_0x1549cd){return _0x1549cd['update'](_0x936eb0)['then'](function(_0x2fb307){return _0x2fb307;});}return null;};}function removeEntity(_0x411e0c,_0x34d3b6){return function(_0x58b435){if(_0x58b435){return _0x58b435[_0x321b('0x27')]()[_0x321b('0x28')](function(){_0x411e0c[_0x321b('0x1d')](0xcc)[_0x321b('0x29')]();});}};}function handleEntityNotFound(_0x96c326,_0x56027f){return function(_0x143f84){if(!_0x143f84){_0x96c326[_0x321b('0x1c')](0x194);}return _0x143f84;};}function handleError(_0x4dceaf,_0x2f31ca){_0x2f31ca=_0x2f31ca||0x1f4;return function(_0x51732b){logger[_0x321b('0x2a')](_0x51732b[_0x321b('0x2b')]);if(_0x51732b[_0x321b('0x2c')]){delete _0x51732b[_0x321b('0x2c')];}_0x4dceaf['status'](_0x2f31ca)[_0x321b('0x2d')](_0x51732b);};}exports['index']=function(_0x389c13,_0x34e0de){var _0x5d5b1f={},_0xdbcbb8={},_0xc10607={'count':0x0,'rows':[]};var _0x25e9e8=_['map'](db[_0x321b('0x2e')][_0x321b('0x2f')],function(_0x6dbc99){return{'name':_0x6dbc99[_0x321b('0x30')],'type':_0x6dbc99[_0x321b('0x31')][_0x321b('0x32')]};});_0xdbcbb8[_0x321b('0x33')]=_['map'](_0x25e9e8,_0x321b('0x2c'));_0xdbcbb8[_0x321b('0x34')]=_[_0x321b('0x35')](_0x389c13[_0x321b('0x34')]);_0xdbcbb8['filters']=_[_0x321b('0x36')](_0xdbcbb8[_0x321b('0x33')],_0xdbcbb8[_0x321b('0x34')]);_0x5d5b1f[_0x321b('0x37')]=_[_0x321b('0x36')](_0xdbcbb8[_0x321b('0x33')],qs[_0x321b('0x38')](_0x389c13['query'][_0x321b('0x38')]));_0x5d5b1f[_0x321b('0x37')]=_0x5d5b1f[_0x321b('0x37')][_0x321b('0x39')]?_0x5d5b1f[_0x321b('0x37')]:_0xdbcbb8[_0x321b('0x33')];if(!_0x389c13['query'][_0x321b('0x3a')](_0x321b('0x3b'))){_0x5d5b1f[_0x321b('0x20')]=qs[_0x321b('0x20')](_0x389c13[_0x321b('0x34')][_0x321b('0x20')]);_0x5d5b1f[_0x321b('0x21')]=qs['offset'](_0x389c13[_0x321b('0x34')][_0x321b('0x21')]);}_0x5d5b1f[_0x321b('0x3c')]=qs[_0x321b('0x3d')](_0x389c13[_0x321b('0x34')][_0x321b('0x3d')]);_0x5d5b1f['where']=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x389c13[_0x321b('0x34')],_0xdbcbb8[_0x321b('0x3e')]),_0x25e9e8);if(_0x389c13[_0x321b('0x34')][_0x321b('0x40')]){_0x5d5b1f['where']=_[_0x321b('0x41')](_0x5d5b1f[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x25e9e8,function(_0x3ca7eb){if(_0x3ca7eb[_0x321b('0x31')]!==_0x321b('0x44')){var _0xef9f7d={};_0xef9f7d[_0x3ca7eb['name']]={'$like':'%'+_0x389c13[_0x321b('0x34')]['filter']+'%'};return _0xef9f7d;}})});}_0x5d5b1f=_[_0x321b('0x41')]({},_0x5d5b1f,_0x389c13[_0x321b('0x45')]);var _0x243c5e={'where':_0x5d5b1f['where']};return db[_0x321b('0x2e')]['count'](_0x243c5e)[_0x321b('0x28')](function(_0x3c8f05){_0xc10607[_0x321b('0x22')]=_0x3c8f05;if(_0x389c13[_0x321b('0x34')][_0x321b('0x46')]){_0x5d5b1f['include']=[{'all':!![]}];}return db[_0x321b('0x2e')][_0x321b('0x47')](_0x5d5b1f);})[_0x321b('0x28')](function(_0x43a614){_0xc10607[_0x321b('0x48')]=_0x43a614;return _0xc10607;})[_0x321b('0x28')](respondWithFilteredResult(_0x34e0de,_0x5d5b1f))[_0x321b('0x49')](handleError(_0x34e0de,null));};exports['show']=function(_0x144ecd,_0xecfc6e){var _0x59256f={'raw':![],'where':{'id':_0x144ecd['params']['id']}},_0x47b4a3={};_0x47b4a3['model']=_[_0x321b('0x35')](db['SugarcrmConfiguration'][_0x321b('0x2f')]);_0x47b4a3[_0x321b('0x34')]=_['keys'](_0x144ecd[_0x321b('0x34')]);_0x47b4a3['filters']=_['intersection'](_0x47b4a3[_0x321b('0x33')],_0x47b4a3['query']);_0x59256f[_0x321b('0x37')]=_[_0x321b('0x36')](_0x47b4a3[_0x321b('0x33')],qs['fields'](_0x144ecd['query']['fields']));_0x59256f[_0x321b('0x37')]=_0x59256f[_0x321b('0x37')][_0x321b('0x39')]?_0x59256f['attributes']:_0x47b4a3[_0x321b('0x33')];if(_0x144ecd[_0x321b('0x34')]['includeAll']){_0x59256f['include']=[{'all':!![]}];}_0x59256f=_[_0x321b('0x41')]({},_0x59256f,_0x144ecd[_0x321b('0x45')]);return db[_0x321b('0x2e')][_0x321b('0x4a')](_0x59256f)[_0x321b('0x28')](handleEntityNotFound(_0xecfc6e,null))[_0x321b('0x28')](respondWithResult(_0xecfc6e,null))[_0x321b('0x49')](handleError(_0xecfc6e,null));};exports['create']=function(_0x36878a,_0x16f38c){return db[_0x321b('0x2e')][_0x321b('0x4b')](_0x36878a[_0x321b('0x4c')],{})[_0x321b('0x28')](respondWithResult(_0x16f38c,0xc9))[_0x321b('0x49')](handleError(_0x16f38c,null));};exports[_0x321b('0x4d')]=function(_0x54914d,_0x102917){if(_0x54914d[_0x321b('0x4c')]['id']){delete _0x54914d['body']['id'];}return db[_0x321b('0x2e')][_0x321b('0x4a')]({'where':{'id':_0x54914d[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x102917,null))[_0x321b('0x28')](saveUpdates(_0x54914d[_0x321b('0x4c')],null))['then'](respondWithResult(_0x102917,null))[_0x321b('0x49')](handleError(_0x102917,null));};exports[_0x321b('0x27')]=function(_0x54fe80,_0x5e303f){return db[_0x321b('0x2e')]['find']({'where':{'id':_0x54fe80['params']['id']}})['then'](handleEntityNotFound(_0x5e303f,null))[_0x321b('0x28')](removeEntity(_0x5e303f,null))['catch'](handleError(_0x5e303f,null));};exports[_0x321b('0x4f')]=function(_0x51db4a,_0x84eefe,_0x118a9e){var _0x16586b={};var _0x37b076={};var _0x4cc9ff;var _0x3780f2;return db[_0x321b('0x2e')][_0x321b('0x50')]({'where':{'id':_0x51db4a[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x84eefe,null))['then'](function(_0x35e61b){if(_0x35e61b){_0x4cc9ff=_0x35e61b;_0x37b076['model']=_[_0x321b('0x35')](db['SugarcrmField'][_0x321b('0x2f')]);_0x37b076[_0x321b('0x34')]=_[_0x321b('0x35')](_0x51db4a[_0x321b('0x34')]);_0x37b076['filters']=_['intersection'](_0x37b076[_0x321b('0x33')],_0x37b076[_0x321b('0x34')]);_0x16586b[_0x321b('0x37')]=_[_0x321b('0x36')](_0x37b076[_0x321b('0x33')],qs[_0x321b('0x38')](_0x51db4a[_0x321b('0x34')]['fields']));_0x16586b[_0x321b('0x37')]=_0x16586b[_0x321b('0x37')][_0x321b('0x39')]?_0x16586b[_0x321b('0x37')]:_0x37b076['model'];_0x16586b[_0x321b('0x3c')]=qs[_0x321b('0x3d')](_0x51db4a[_0x321b('0x34')][_0x321b('0x3d')]);_0x16586b[_0x321b('0x42')]=qs['filters'](_['pick'](_0x51db4a[_0x321b('0x34')],_0x37b076[_0x321b('0x3e')]));if(_0x51db4a[_0x321b('0x34')][_0x321b('0x40')]){_0x16586b[_0x321b('0x42')]=_[_0x321b('0x41')](_0x16586b[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x16586b[_0x321b('0x37')],function(_0x5aa4c3){var _0x17c8d6={};_0x17c8d6[_0x5aa4c3]={'$like':'%'+_0x51db4a['query'][_0x321b('0x40')]+'%'};return _0x17c8d6;})});}_0x16586b=_['merge']({},_0x16586b,_0x51db4a[_0x321b('0x45')]);return _0x4cc9ff['getFields'](_0x16586b);}})[_0x321b('0x28')](function(_0x4db3c1){if(_0x4db3c1){_0x3780f2=_0x4db3c1[_0x321b('0x39')];if(!_0x51db4a[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x16586b['limit']=qs[_0x321b('0x20')](_0x51db4a['query'][_0x321b('0x20')]);_0x16586b[_0x321b('0x21')]=qs[_0x321b('0x21')](_0x51db4a[_0x321b('0x34')][_0x321b('0x21')]);}return _0x4cc9ff[_0x321b('0x4f')](_0x16586b);}})[_0x321b('0x28')](function(_0x306998){if(_0x306998){return _0x306998?{'count':_0x3780f2,'rows':_0x306998}:null;}})[_0x321b('0x28')](respondWithResult(_0x84eefe,null))[_0x321b('0x49')](handleError(_0x84eefe,null));};exports[_0x321b('0x51')]=function(_0x2096bc,_0x50c6f7,_0x20d435){var _0x2becf7={};var _0x99d325={};var _0x166763;var _0x3ec72b;return db['SugarcrmConfiguration'][_0x321b('0x50')]({'where':{'id':_0x2096bc[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x50c6f7,null))[_0x321b('0x28')](function(_0x487799){if(_0x487799){_0x166763=_0x487799;_0x99d325['model']=_[_0x321b('0x35')](db['SugarcrmField'][_0x321b('0x2f')]);_0x99d325[_0x321b('0x34')]=_[_0x321b('0x35')](_0x2096bc[_0x321b('0x34')]);_0x99d325['filters']=_[_0x321b('0x36')](_0x99d325['model'],_0x99d325[_0x321b('0x34')]);_0x2becf7['attributes']=_[_0x321b('0x36')](_0x99d325[_0x321b('0x33')],qs[_0x321b('0x38')](_0x2096bc['query']['fields']));_0x2becf7[_0x321b('0x37')]=_0x2becf7['attributes'][_0x321b('0x39')]?_0x2becf7[_0x321b('0x37')]:_0x99d325[_0x321b('0x33')];_0x2becf7[_0x321b('0x3c')]=qs['sort'](_0x2096bc[_0x321b('0x34')]['sort']);_0x2becf7['where']=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x2096bc[_0x321b('0x34')],_0x99d325['filters']));if(_0x2096bc['query']['filter']){_0x2becf7[_0x321b('0x42')]=_[_0x321b('0x41')](_0x2becf7[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x2becf7[_0x321b('0x37')],function(_0x475488){var _0x1ee68d={};_0x1ee68d[_0x475488]={'$like':'%'+_0x2096bc[_0x321b('0x34')]['filter']+'%'};return _0x1ee68d;})});}_0x2becf7=_[_0x321b('0x41')]({},_0x2becf7,_0x2096bc['options']);return _0x166763['getSubjects'](_0x2becf7);}})['then'](function(_0x3084c2){if(_0x3084c2){_0x3ec72b=_0x3084c2[_0x321b('0x39')];if(!_0x2096bc[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x2becf7['limit']=qs[_0x321b('0x20')](_0x2096bc[_0x321b('0x34')]['limit']);_0x2becf7[_0x321b('0x21')]=qs['offset'](_0x2096bc[_0x321b('0x34')][_0x321b('0x21')]);}return _0x166763[_0x321b('0x51')](_0x2becf7);}})[_0x321b('0x28')](function(_0x514ab2){if(_0x514ab2){return _0x514ab2?{'count':_0x3ec72b,'rows':_0x514ab2}:null;}})[_0x321b('0x28')](respondWithResult(_0x50c6f7,null))[_0x321b('0x49')](handleError(_0x50c6f7,null));};exports['getDescriptions']=function(_0x433e50,_0x11db6,_0x163a2a){var _0x3a582e={};var _0x17a6f8={};var _0x5e9180;var _0x453120;return db[_0x321b('0x2e')][_0x321b('0x50')]({'where':{'id':_0x433e50['params']['id']}})['then'](handleEntityNotFound(_0x11db6,null))[_0x321b('0x28')](function(_0x2098c2){if(_0x2098c2){_0x5e9180=_0x2098c2;_0x17a6f8[_0x321b('0x33')]=_[_0x321b('0x35')](db[_0x321b('0x52')]['rawAttributes']);_0x17a6f8[_0x321b('0x34')]=_[_0x321b('0x35')](_0x433e50[_0x321b('0x34')]);_0x17a6f8[_0x321b('0x3e')]=_['intersection'](_0x17a6f8[_0x321b('0x33')],_0x17a6f8['query']);_0x3a582e[_0x321b('0x37')]=_[_0x321b('0x36')](_0x17a6f8[_0x321b('0x33')],qs[_0x321b('0x38')](_0x433e50[_0x321b('0x34')][_0x321b('0x38')]));_0x3a582e['attributes']=_0x3a582e[_0x321b('0x37')][_0x321b('0x39')]?_0x3a582e[_0x321b('0x37')]:_0x17a6f8['model'];_0x3a582e['order']=qs['sort'](_0x433e50[_0x321b('0x34')][_0x321b('0x3d')]);_0x3a582e[_0x321b('0x42')]=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x433e50[_0x321b('0x34')],_0x17a6f8[_0x321b('0x3e')]));if(_0x433e50[_0x321b('0x34')][_0x321b('0x40')]){_0x3a582e['where']=_[_0x321b('0x41')](_0x3a582e[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x3a582e[_0x321b('0x37')],function(_0x54cb9b){var _0x549a2d={};_0x549a2d[_0x54cb9b]={'$like':'%'+_0x433e50[_0x321b('0x34')]['filter']+'%'};return _0x549a2d;})});}_0x3a582e=_[_0x321b('0x41')]({},_0x3a582e,_0x433e50[_0x321b('0x45')]);return _0x5e9180['getDescriptions'](_0x3a582e);}})['then'](function(_0x2433c8){if(_0x2433c8){_0x453120=_0x2433c8[_0x321b('0x39')];if(!_0x433e50[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x3a582e[_0x321b('0x20')]=qs[_0x321b('0x20')](_0x433e50[_0x321b('0x34')][_0x321b('0x20')]);_0x3a582e[_0x321b('0x21')]=qs[_0x321b('0x21')](_0x433e50['query'][_0x321b('0x21')]);}return _0x5e9180[_0x321b('0x53')](_0x3a582e);}})[_0x321b('0x28')](function(_0x3d1f0a){if(_0x3d1f0a){return _0x3d1f0a?{'count':_0x453120,'rows':_0x3d1f0a}:null;}})[_0x321b('0x28')](respondWithResult(_0x11db6,null))[_0x321b('0x49')](handleError(_0x11db6,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 10bac40..b1af2da 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 _0xd652=['bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x1c223c,_0x3cef2f){var _0x141766=function(_0x5c09ed){while(--_0x5c09ed){_0x1c223c['push'](_0x1c223c['shift']());}};_0x141766(++_0x3cef2f);}(_0xd652,0x104));var _0x2d65=function(_0x3c19fe,_0x2e1b96){_0x3c19fe=_0x3c19fe-0x0;var _0x25245a=_0xd652[_0x3c19fe];return _0x25245a;};'use strict';var _=require(_0x2d65('0x0'));var util=require('util');var logger=require(_0x2d65('0x1'))(_0x2d65('0x2'));var moment=require(_0x2d65('0x3'));var BPromise=require(_0x2d65('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2d65('0x5'));var config=require(_0x2d65('0x6'));var attributes=require(_0x2d65('0x7'));module[_0x2d65('0x8')]=function(_0xd874bb,_0x41aa53){return _0xd874bb[_0x2d65('0x9')](_0x2d65('0xa'),attributes,{'tableName':_0x2d65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1943=['../../config/environment','./intSugarcrmConfiguration.attributes','define','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1943,0x85));var _0x3194=function(_0x7005dc,_0xeb51c4){_0x7005dc=_0x7005dc-0x0;var _0x5b2497=_0x1943[_0x7005dc];return _0x5b2497;};'use strict';var _=require('lodash');var util=require(_0x3194('0x0'));var logger=require('../../config/logger')(_0x3194('0x1'));var moment=require(_0x3194('0x2'));var BPromise=require(_0x3194('0x3'));var rp=require(_0x3194('0x4'));var fs=require('fs');var path=require(_0x3194('0x5'));var rimraf=require(_0x3194('0x6'));var config=require(_0x3194('0x7'));var attributes=require(_0x3194('0x8'));module['exports']=function(_0x26ec4d,_0x47fdae){return _0x26ec4d[_0x3194('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5d19996..a25b11d 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 _0x9a3b=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a3b,0xb0));var _0xb9a3=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x9a3b[_0x4d337e];return _0x247963;};'use strict';var _=require('lodash');var util=require(_0xb9a3('0x0'));var moment=require(_0xb9a3('0x1'));var BPromise=require(_0xb9a3('0x2'));var rs=require(_0xb9a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9a3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb9a3('0x6'));var client=jayson[_0xb9a3('0x7')][_0xb9a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bbb7,_0x1ed7a8,_0x50bb7b){return new BPromise(function(_0x1a28cf,_0xd50e6a){return client[_0xb9a3('0x9')](_0x1bbb7,_0x50bb7b)['then'](function(_0x5e49bf){logger[_0xb9a3('0xa')](_0xb9a3('0xb'),_0x1ed7a8,_0xb9a3('0xc'));logger['debug'](_0xb9a3('0xd'),_0x1ed7a8,_0xb9a3('0xc'),JSON['stringify'](_0x5e49bf));if(_0x5e49bf['error']){if(_0x5e49bf[_0xb9a3('0xe')]['code']===0x1f4){logger[_0xb9a3('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ed7a8,_0x5e49bf[_0xb9a3('0xe')][_0xb9a3('0xf')]);return _0xd50e6a(_0x5e49bf[_0xb9a3('0xe')][_0xb9a3('0xf')]);}logger[_0xb9a3('0xe')](_0xb9a3('0xb'),_0x1ed7a8,_0x5e49bf[_0xb9a3('0xe')][_0xb9a3('0xf')]);return _0x1a28cf(_0x5e49bf[_0xb9a3('0xe')][_0xb9a3('0xf')]);}else{logger['info'](_0xb9a3('0xb'),_0x1ed7a8,_0xb9a3('0xc'));_0x1a28cf(_0x5e49bf[_0xb9a3('0x10')][_0xb9a3('0xf')]);}})[_0xb9a3('0x11')](function(_0x809d2a){logger[_0xb9a3('0xe')](_0xb9a3('0xb'),_0x1ed7a8,_0x809d2a);_0xd50e6a(_0x809d2a);});});} \ No newline at end of file +var _0x1ae5=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x543a5e,_0x33dd65){var _0x29afa6=function(_0x42d2ec){while(--_0x42d2ec){_0x543a5e['push'](_0x543a5e['shift']());}};_0x29afa6(++_0x33dd65);}(_0x1ae5,0x1a3));var _0x51ae=function(_0x4d5e2f,_0x5b91ed){_0x4d5e2f=_0x4d5e2f-0x0;var _0x4d9bd0=_0x1ae5[_0x4d5e2f];return _0x4d9bd0;};'use strict';var _=require(_0x51ae('0x0'));var util=require(_0x51ae('0x1'));var moment=require(_0x51ae('0x2'));var BPromise=require(_0x51ae('0x3'));var rs=require(_0x51ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51ae('0x5'))['db'];var utils=require(_0x51ae('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x51ae('0x7'));var client=jayson[_0x51ae('0x8')][_0x51ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8720,_0x48c941,_0x4d2fe6){return new BPromise(function(_0x17746b,_0x1d76ad){return client[_0x51ae('0xa')](_0x2c8720,_0x4d2fe6)[_0x51ae('0xb')](function(_0x3154ea){logger['info'](_0x51ae('0xc'),_0x48c941,_0x51ae('0xd'));logger[_0x51ae('0xe')](_0x51ae('0xf'),_0x48c941,_0x51ae('0xd'),JSON[_0x51ae('0x10')](_0x3154ea));if(_0x3154ea[_0x51ae('0x11')]){if(_0x3154ea['error'][_0x51ae('0x12')]===0x1f4){logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x3154ea[_0x51ae('0x11')][_0x51ae('0x13')]);return _0x1d76ad(_0x3154ea['error'][_0x51ae('0x13')]);}logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x3154ea[_0x51ae('0x11')]['message']);return _0x17746b(_0x3154ea[_0x51ae('0x11')][_0x51ae('0x13')]);}else{logger['info'](_0x51ae('0xc'),_0x48c941,_0x51ae('0xd'));_0x17746b(_0x3154ea[_0x51ae('0x14')][_0x51ae('0x13')]);}})[_0x51ae('0x15')](function(_0x5ed9be){logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x5ed9be);_0x1d76ad(_0x5ed9be);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 2bd4608..fc20abd 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 _0x953a=['../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','post','create','update','delete','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2ae906,_0x3634b4){var _0x432740=function(_0x4ff50d){while(--_0x4ff50d){_0x2ae906['push'](_0x2ae906['shift']());}};_0x432740(++_0x3634b4);}(_0x953a,0x64));var _0xa953=function(_0x3fd8ce,_0x17186e){_0x3fd8ce=_0x3fd8ce-0x0;var _0x113885=_0x953a[_0x3fd8ce];return _0x113885;};'use strict';var multer=require(_0xa953('0x0'));var util=require(_0xa953('0x1'));var path=require('path');var timeout=require(_0xa953('0x2'));var express=require('express');var router=express[_0xa953('0x3')]();var fs_extra=require(_0xa953('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa953('0x5'));var config=require('../../config/environment');var controller=require(_0xa953('0x6'));router[_0xa953('0x7')]('/',auth['isAuthenticated'](),controller[_0xa953('0x8')]);router['get'](_0xa953('0x9'),auth[_0xa953('0xa')](),controller['show']);router[_0xa953('0xb')]('/',auth[_0xa953('0xa')](),controller[_0xa953('0xc')]);router['put'](_0xa953('0x9'),auth[_0xa953('0xa')](),controller[_0xa953('0xd')]);router[_0xa953('0xe')]('/:id',auth[_0xa953('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xacae=['post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated'];(function(_0x27803b,_0x585f7e){var _0x59ca91=function(_0x143095){while(--_0x143095){_0x27803b['push'](_0x27803b['shift']());}};_0x59ca91(++_0x585f7e);}(_0xacae,0x1cf));var _0xeaca=function(_0x3e02a4,_0x362c89){_0x3e02a4=_0x3e02a4-0x0;var _0xaf9824=_0xacae[_0x3e02a4];return _0xaf9824;};'use strict';var multer=require('multer');var util=require(_0xeaca('0x0'));var path=require(_0xeaca('0x1'));var timeout=require(_0xeaca('0x2'));var express=require(_0xeaca('0x3'));var router=express[_0xeaca('0x4')]();var fs_extra=require(_0xeaca('0x5'));var auth=require(_0xeaca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaca('0x7'));var controller=require(_0xeaca('0x8'));router[_0xeaca('0x9')]('/',auth['isAuthenticated'](),controller[_0xeaca('0xa')]);router['get']('/:id',auth[_0xeaca('0xb')](),controller['show']);router[_0xeaca('0xc')]('/',auth[_0xeaca('0xb')](),controller[_0xeaca('0xd')]);router[_0xeaca('0xe')]('/:id',auth[_0xeaca('0xb')](),controller['update']);router[_0xeaca('0xf')](_0xeaca('0x10'),auth[_0xeaca('0xb')](),controller[_0xeaca('0x11')]);module[_0xeaca('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3503bb3..612a946 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 _0x1a5f=['ENUM','string','variable','customVariable','STRING','BOOLEAN','exports'];(function(_0x245690,_0x3bf938){var _0x3fb9a4=function(_0x3354b3){while(--_0x3354b3){_0x245690['push'](_0x245690['shift']());}};_0x3fb9a4(++_0x3bf938);}(_0x1a5f,0x6f));var _0xf1a5=function(_0x387ceb,_0x1e1b68){_0x387ceb=_0x387ceb-0x0;var _0x1b3d13=_0x1a5f[_0x387ceb];return _0x1b3d13;};'use strict';var Sequelize=require('sequelize');module[_0xf1a5('0x0')]={'type':{'type':Sequelize[_0xf1a5('0x1')](_0xf1a5('0x2'),_0xf1a5('0x3'),_0xf1a5('0x4'),'keyValue','picklist'),'defaultValue':_0xf1a5('0x2')},'content':{'type':Sequelize[_0xf1a5('0x5')]},'key':{'type':Sequelize[_0xf1a5('0x5')]},'keyType':{'type':Sequelize[_0xf1a5('0x1')](_0xf1a5('0x2'),_0xf1a5('0x3'),_0xf1a5('0x4'))},'keyContent':{'type':Sequelize[_0xf1a5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf1a5('0x5')]},'customField':{'type':Sequelize[_0xf1a5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf1a5('0x5')]}}; \ No newline at end of file +var _0xe33f=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x382353,_0x1ece1e){var _0xf42fa9=function(_0x399b28){while(--_0x399b28){_0x382353['push'](_0x382353['shift']());}};_0xf42fa9(++_0x1ece1e);}(_0xe33f,0x1b1));var _0xfe33=function(_0x34b852,_0x4b2534){_0x34b852=_0x34b852-0x0;var _0x254075=_0xe33f[_0x34b852];return _0x254075;};'use strict';var Sequelize=require(_0xfe33('0x0'));module[_0xfe33('0x1')]={'type':{'type':Sequelize[_0xfe33('0x2')](_0xfe33('0x3'),_0xfe33('0x4'),_0xfe33('0x5'),_0xfe33('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xfe33('0x7')]},'key':{'type':Sequelize[_0xfe33('0x7')]},'keyType':{'type':Sequelize[_0xfe33('0x2')](_0xfe33('0x3'),'variable',_0xfe33('0x5'))},'keyContent':{'type':Sequelize[_0xfe33('0x7')]},'idField':{'type':Sequelize[_0xfe33('0x7')]},'nameField':{'type':Sequelize[_0xfe33('0x7')]},'customField':{'type':Sequelize[_0xfe33('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfe33('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 6bae06a..d5d1a01 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 _0x1d0a=['count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','SugarcrmField','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','catch','params','keys','rawAttributes','includeAll','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3f18d9,_0x3b2f8f){var _0x243ff4=function(_0xee1c4a){while(--_0xee1c4a){_0x3f18d9['push'](_0x3f18d9['shift']());}};_0x243ff4(++_0x3b2f8f);}(_0x1d0a,0x14c));var _0xa1d0=function(_0x154886,_0x4cfc3f){_0x154886=_0x154886-0x0;var _0x9df414=_0x1d0a[_0x154886];return _0x9df414;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1d0('0x0'));var zipdir=require(_0xa1d0('0x1'));var jsonpatch=require(_0xa1d0('0x2'));var rp=require(_0xa1d0('0x3'));var moment=require(_0xa1d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1d0('0x5'));var util=require(_0xa1d0('0x6'));var path=require('path');var sox=require(_0xa1d0('0x7'));var csv=require(_0xa1d0('0x8'));var ejs=require(_0xa1d0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1d0('0xa'));var squel=require(_0xa1d0('0xb'));var crypto=require('crypto');var jsforce=require(_0xa1d0('0xc'));var deskjs=require(_0xa1d0('0xd'));var toCsv=require(_0xa1d0('0x8'));var querystring=require(_0xa1d0('0xe'));var Papa=require(_0xa1d0('0xf'));var Redis=require('ioredis');var authService=require(_0xa1d0('0x10'));var qs=require(_0xa1d0('0x11'));var as=require(_0xa1d0('0x12'));var hardwareService=require(_0xa1d0('0x13'));var logger=require(_0xa1d0('0x14'))(_0xa1d0('0x15'));var utils=require(_0xa1d0('0x16'));var config=require(_0xa1d0('0x17'));var licenseUtil=require(_0xa1d0('0x18'));var db=require(_0xa1d0('0x19'))['db'];function respondWithStatusCode(_0xd3560,_0x5050d0){_0x5050d0=_0x5050d0||0xcc;return function(_0x214ade){if(_0x214ade){return _0xd3560[_0xa1d0('0x1a')](_0x5050d0);}return _0xd3560[_0xa1d0('0x1b')](_0x5050d0)[_0xa1d0('0x1c')]();};}function respondWithResult(_0x60892c,_0x42f980){_0x42f980=_0x42f980||0xc8;return function(_0x238419){if(_0x238419){return _0x60892c[_0xa1d0('0x1b')](_0x42f980)[_0xa1d0('0x1d')](_0x238419);}};}function respondWithFilteredResult(_0x3382fa,_0x5934a3){return function(_0x2644c2){if(_0x2644c2){var _0x11b9b7=typeof _0x5934a3[_0xa1d0('0x1e')]===_0xa1d0('0x1f')&&typeof _0x5934a3[_0xa1d0('0x20')]===_0xa1d0('0x1f');var _0x5a71ce=_0x2644c2[_0xa1d0('0x21')];var _0x53bc7e=_0x11b9b7?0x0:_0x5934a3[_0xa1d0('0x1e')];var _0x144ce6=_0x11b9b7?_0x2644c2[_0xa1d0('0x21')]:_0x5934a3[_0xa1d0('0x1e')]+_0x5934a3[_0xa1d0('0x20')];var _0x4e4cbb;if(_0x144ce6>=_0x5a71ce){_0x144ce6=_0x5a71ce;_0x4e4cbb=0xc8;}else{_0x4e4cbb=0xce;}_0x3382fa[_0xa1d0('0x1b')](_0x4e4cbb);return _0x3382fa[_0xa1d0('0x22')](_0xa1d0('0x23'),_0x53bc7e+'-'+_0x144ce6+'/'+_0x5a71ce)['json'](_0x2644c2);}return null;};}function patchUpdates(_0x292060){return function(_0x5384c7){try{jsonpatch['apply'](_0x5384c7,_0x292060,!![]);}catch(_0x5e9d97){return BPromise[_0xa1d0('0x24')](_0x5e9d97);}return _0x5384c7[_0xa1d0('0x25')]();};}function saveUpdates(_0x22e1b5,_0x3f5447){return function(_0x930842){if(_0x930842){return _0x930842[_0xa1d0('0x26')](_0x22e1b5)[_0xa1d0('0x27')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x4b04d6,_0x908e69){return function(_0x422a56){if(_0x422a56){return _0x422a56['destroy']()['then'](function(){_0x4b04d6[_0xa1d0('0x1b')](0xcc)[_0xa1d0('0x1c')]();});}};}function handleEntityNotFound(_0x3ee678,_0x4da39d){return function(_0x28058c){if(!_0x28058c){_0x3ee678[_0xa1d0('0x1a')](0x194);}return _0x28058c;};}function handleError(_0x34209c,_0x252fe3){_0x252fe3=_0x252fe3||0x1f4;return function(_0x2ab983){logger['error'](_0x2ab983[_0xa1d0('0x28')]);if(_0x2ab983[_0xa1d0('0x29')]){delete _0x2ab983['name'];}_0x34209c[_0xa1d0('0x1b')](_0x252fe3)[_0xa1d0('0x2a')](_0x2ab983);};}exports[_0xa1d0('0x2b')]=function(_0x4e666b,_0x5aed13){var _0x4a3ac6={},_0x2933f4={},_0x48902e={'count':0x0,'rows':[]};var _0x1e5890=_[_0xa1d0('0x2c')](db[_0xa1d0('0x2d')]['rawAttributes'],function(_0x1b0bc4){return{'name':_0x1b0bc4['fieldName'],'type':_0x1b0bc4[_0xa1d0('0x2e')]['key']};});_0x2933f4[_0xa1d0('0x2f')]=_['map'](_0x1e5890,_0xa1d0('0x29'));_0x2933f4[_0xa1d0('0x30')]=_['keys'](_0x4e666b[_0xa1d0('0x30')]);_0x2933f4[_0xa1d0('0x31')]=_[_0xa1d0('0x32')](_0x2933f4['model'],_0x2933f4['query']);_0x4a3ac6[_0xa1d0('0x33')]=_[_0xa1d0('0x32')](_0x2933f4[_0xa1d0('0x2f')],qs[_0xa1d0('0x34')](_0x4e666b['query'][_0xa1d0('0x34')]));_0x4a3ac6[_0xa1d0('0x33')]=_0x4a3ac6[_0xa1d0('0x33')][_0xa1d0('0x35')]?_0x4a3ac6['attributes']:_0x2933f4[_0xa1d0('0x2f')];if(!_0x4e666b[_0xa1d0('0x30')][_0xa1d0('0x36')](_0xa1d0('0x37'))){_0x4a3ac6[_0xa1d0('0x20')]=qs[_0xa1d0('0x20')](_0x4e666b[_0xa1d0('0x30')][_0xa1d0('0x20')]);_0x4a3ac6[_0xa1d0('0x1e')]=qs[_0xa1d0('0x1e')](_0x4e666b[_0xa1d0('0x30')][_0xa1d0('0x1e')]);}_0x4a3ac6['order']=qs[_0xa1d0('0x38')](_0x4e666b['query'][_0xa1d0('0x38')]);_0x4a3ac6['where']=qs[_0xa1d0('0x31')](_[_0xa1d0('0x39')](_0x4e666b[_0xa1d0('0x30')],_0x2933f4[_0xa1d0('0x31')]),_0x1e5890);if(_0x4e666b[_0xa1d0('0x30')][_0xa1d0('0x3a')]){_0x4a3ac6[_0xa1d0('0x3b')]=_[_0xa1d0('0x3c')](_0x4a3ac6['where'],{'$or':_[_0xa1d0('0x2c')](_0x1e5890,function(_0x955127){if(_0x955127['type']!=='VIRTUAL'){var _0x5dc122={};_0x5dc122[_0x955127[_0xa1d0('0x29')]]={'$like':'%'+_0x4e666b[_0xa1d0('0x30')]['filter']+'%'};return _0x5dc122;}})});}_0x4a3ac6=_[_0xa1d0('0x3c')]({},_0x4a3ac6,_0x4e666b[_0xa1d0('0x3d')]);var _0x4c0e2f={'where':_0x4a3ac6[_0xa1d0('0x3b')]};return db[_0xa1d0('0x2d')][_0xa1d0('0x21')](_0x4c0e2f)['then'](function(_0x3708e9){_0x48902e[_0xa1d0('0x21')]=_0x3708e9;if(_0x4e666b[_0xa1d0('0x30')]['includeAll']){_0x4a3ac6[_0xa1d0('0x3e')]=[{'all':!![]}];}return db[_0xa1d0('0x2d')][_0xa1d0('0x3f')](_0x4a3ac6);})[_0xa1d0('0x27')](function(_0x5e1df4){_0x48902e['rows']=_0x5e1df4;return _0x48902e;})[_0xa1d0('0x27')](respondWithFilteredResult(_0x5aed13,_0x4a3ac6))[_0xa1d0('0x40')](handleError(_0x5aed13,null));};exports['show']=function(_0x2ca651,_0x367811){var _0x557699={'raw':!![],'where':{'id':_0x2ca651[_0xa1d0('0x41')]['id']}},_0x144d5f={};_0x144d5f[_0xa1d0('0x2f')]=_[_0xa1d0('0x42')](db[_0xa1d0('0x2d')][_0xa1d0('0x43')]);_0x144d5f[_0xa1d0('0x30')]=_[_0xa1d0('0x42')](_0x2ca651[_0xa1d0('0x30')]);_0x144d5f[_0xa1d0('0x31')]=_['intersection'](_0x144d5f[_0xa1d0('0x2f')],_0x144d5f['query']);_0x557699[_0xa1d0('0x33')]=_[_0xa1d0('0x32')](_0x144d5f[_0xa1d0('0x2f')],qs['fields'](_0x2ca651[_0xa1d0('0x30')][_0xa1d0('0x34')]));_0x557699[_0xa1d0('0x33')]=_0x557699[_0xa1d0('0x33')][_0xa1d0('0x35')]?_0x557699[_0xa1d0('0x33')]:_0x144d5f['model'];if(_0x2ca651['query'][_0xa1d0('0x44')]){_0x557699[_0xa1d0('0x3e')]=[{'all':!![]}];}_0x557699=_['merge']({},_0x557699,_0x2ca651[_0xa1d0('0x3d')]);return db[_0xa1d0('0x2d')][_0xa1d0('0x45')](_0x557699)[_0xa1d0('0x27')](handleEntityNotFound(_0x367811,null))[_0xa1d0('0x27')](respondWithResult(_0x367811,null))['catch'](handleError(_0x367811,null));};exports[_0xa1d0('0x46')]=function(_0x28d77f,_0x109b7e){return db['SugarcrmField']['create'](_0x28d77f['body'],{})[_0xa1d0('0x27')](respondWithResult(_0x109b7e,0xc9))['catch'](handleError(_0x109b7e,null));};exports[_0xa1d0('0x26')]=function(_0x2aae72,_0x4cbc59){if(_0x2aae72[_0xa1d0('0x47')]['id']){delete _0x2aae72[_0xa1d0('0x47')]['id'];}return db['SugarcrmField'][_0xa1d0('0x45')]({'where':{'id':_0x2aae72['params']['id']}})['then'](handleEntityNotFound(_0x4cbc59,null))[_0xa1d0('0x27')](saveUpdates(_0x2aae72[_0xa1d0('0x47')],null))['then'](respondWithResult(_0x4cbc59,null))[_0xa1d0('0x40')](handleError(_0x4cbc59,null));};exports[_0xa1d0('0x48')]=function(_0x29e651,_0x28b115){return db['SugarcrmField'][_0xa1d0('0x45')]({'where':{'id':_0x29e651['params']['id']}})['then'](handleEntityNotFound(_0x28b115,null))['then'](removeEntity(_0x28b115,null))[_0xa1d0('0x40')](handleError(_0x28b115,null));}; \ No newline at end of file +var _0x5cdb=['catch','show','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','filters','pick','filter','merge','type','VIRTUAL','options','where','SugarcrmField','include','findAll','rows'];(function(_0x5545f7,_0x570414){var _0x52a979=function(_0x28eb97){while(--_0x28eb97){_0x5545f7['push'](_0x5545f7['shift']());}};_0x52a979(++_0x570414);}(_0x5cdb,0x12f));var _0xb5cd=function(_0x141b15,_0x26f272){_0x141b15=_0x141b15-0x0;var _0x3486c9=_0x5cdb[_0x141b15];return _0x3486c9;};'use strict';var emlformat=require(_0xb5cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5cd('0x1'));var jsonpatch=require(_0xb5cd('0x2'));var rp=require(_0xb5cd('0x3'));var moment=require(_0xb5cd('0x4'));var BPromise=require(_0xb5cd('0x5'));var Mustache=require(_0xb5cd('0x6'));var util=require(_0xb5cd('0x7'));var path=require(_0xb5cd('0x8'));var sox=require('sox');var csv=require(_0xb5cd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5cd('0xa'));var _=require('lodash');var squel=require(_0xb5cd('0xb'));var crypto=require(_0xb5cd('0xc'));var jsforce=require(_0xb5cd('0xd'));var deskjs=require(_0xb5cd('0xe'));var toCsv=require(_0xb5cd('0x9'));var querystring=require(_0xb5cd('0xf'));var Papa=require(_0xb5cd('0x10'));var Redis=require(_0xb5cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb5cd('0x12'));var as=require(_0xb5cd('0x13'));var hardwareService=require(_0xb5cd('0x14'));var logger=require(_0xb5cd('0x15'))(_0xb5cd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb5cd('0x17'));var db=require(_0xb5cd('0x18'))['db'];function respondWithStatusCode(_0x47f7af,_0x567041){_0x567041=_0x567041||0xcc;return function(_0x2d61af){if(_0x2d61af){return _0x47f7af['sendStatus'](_0x567041);}return _0x47f7af[_0xb5cd('0x19')](_0x567041)[_0xb5cd('0x1a')]();};}function respondWithResult(_0x2e34f0,_0x27bc96){_0x27bc96=_0x27bc96||0xc8;return function(_0x260aa7){if(_0x260aa7){return _0x2e34f0[_0xb5cd('0x19')](_0x27bc96)[_0xb5cd('0x1b')](_0x260aa7);}};}function respondWithFilteredResult(_0x29d4a6,_0xa90ea7){return function(_0xf25b2f){if(_0xf25b2f){var _0x58d3b0=typeof _0xa90ea7[_0xb5cd('0x1c')]===_0xb5cd('0x1d')&&typeof _0xa90ea7[_0xb5cd('0x1e')]===_0xb5cd('0x1d');var _0x2c49f0=_0xf25b2f[_0xb5cd('0x1f')];var _0x37162c=_0x58d3b0?0x0:_0xa90ea7[_0xb5cd('0x1c')];var _0x1b49e1=_0x58d3b0?_0xf25b2f[_0xb5cd('0x1f')]:_0xa90ea7[_0xb5cd('0x1c')]+_0xa90ea7[_0xb5cd('0x1e')];var _0x1a0966;if(_0x1b49e1>=_0x2c49f0){_0x1b49e1=_0x2c49f0;_0x1a0966=0xc8;}else{_0x1a0966=0xce;}_0x29d4a6['status'](_0x1a0966);return _0x29d4a6[_0xb5cd('0x20')](_0xb5cd('0x21'),_0x37162c+'-'+_0x1b49e1+'/'+_0x2c49f0)['json'](_0xf25b2f);}return null;};}function patchUpdates(_0x2cdbe2){return function(_0x263bcf){try{jsonpatch[_0xb5cd('0x22')](_0x263bcf,_0x2cdbe2,!![]);}catch(_0x550094){return BPromise[_0xb5cd('0x23')](_0x550094);}return _0x263bcf[_0xb5cd('0x24')]();};}function saveUpdates(_0x27c8f4,_0x202d68){return function(_0x1e1170){if(_0x1e1170){return _0x1e1170[_0xb5cd('0x25')](_0x27c8f4)[_0xb5cd('0x26')](function(_0x4bc86a){return _0x4bc86a;});}return null;};}function removeEntity(_0x1696b4,_0x126ccb){return function(_0x3cf7f8){if(_0x3cf7f8){return _0x3cf7f8[_0xb5cd('0x27')]()[_0xb5cd('0x26')](function(){_0x1696b4[_0xb5cd('0x19')](0xcc)[_0xb5cd('0x1a')]();});}};}function handleEntityNotFound(_0xf03e5b,_0xdb8e46){return function(_0x226724){if(!_0x226724){_0xf03e5b[_0xb5cd('0x28')](0x194);}return _0x226724;};}function handleError(_0x4e4dbb,_0x848776){_0x848776=_0x848776||0x1f4;return function(_0x2b1d06){logger[_0xb5cd('0x29')](_0x2b1d06[_0xb5cd('0x2a')]);if(_0x2b1d06['name']){delete _0x2b1d06[_0xb5cd('0x2b')];}_0x4e4dbb[_0xb5cd('0x19')](_0x848776)['send'](_0x2b1d06);};}exports[_0xb5cd('0x2c')]=function(_0x18ff66,_0x13330b){var _0x5585a1={},_0x29dc2c={},_0x3f8a22={'count':0x0,'rows':[]};var _0x1de15f=_[_0xb5cd('0x2d')](db['SugarcrmField'][_0xb5cd('0x2e')],function(_0x3ade4c){return{'name':_0x3ade4c['fieldName'],'type':_0x3ade4c['type'][_0xb5cd('0x2f')]};});_0x29dc2c[_0xb5cd('0x30')]=_[_0xb5cd('0x2d')](_0x1de15f,_0xb5cd('0x2b'));_0x29dc2c[_0xb5cd('0x31')]=_[_0xb5cd('0x32')](_0x18ff66[_0xb5cd('0x31')]);_0x29dc2c['filters']=_[_0xb5cd('0x33')](_0x29dc2c[_0xb5cd('0x30')],_0x29dc2c[_0xb5cd('0x31')]);_0x5585a1[_0xb5cd('0x34')]=_[_0xb5cd('0x33')](_0x29dc2c[_0xb5cd('0x30')],qs[_0xb5cd('0x35')](_0x18ff66[_0xb5cd('0x31')]['fields']));_0x5585a1[_0xb5cd('0x34')]=_0x5585a1[_0xb5cd('0x34')][_0xb5cd('0x36')]?_0x5585a1[_0xb5cd('0x34')]:_0x29dc2c[_0xb5cd('0x30')];if(!_0x18ff66['query']['hasOwnProperty']('nolimit')){_0x5585a1[_0xb5cd('0x1e')]=qs[_0xb5cd('0x1e')](_0x18ff66[_0xb5cd('0x31')]['limit']);_0x5585a1[_0xb5cd('0x1c')]=qs[_0xb5cd('0x1c')](_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x1c')]);}_0x5585a1['order']=qs['sort'](_0x18ff66['query']['sort']);_0x5585a1['where']=qs[_0xb5cd('0x37')](_[_0xb5cd('0x38')](_0x18ff66[_0xb5cd('0x31')],_0x29dc2c['filters']),_0x1de15f);if(_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x39')]){_0x5585a1['where']=_[_0xb5cd('0x3a')](_0x5585a1['where'],{'$or':_['map'](_0x1de15f,function(_0x45ddda){if(_0x45ddda[_0xb5cd('0x3b')]!==_0xb5cd('0x3c')){var _0x22d55f={};_0x22d55f[_0x45ddda['name']]={'$like':'%'+_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x39')]+'%'};return _0x22d55f;}})});}_0x5585a1=_[_0xb5cd('0x3a')]({},_0x5585a1,_0x18ff66[_0xb5cd('0x3d')]);var _0x549bd3={'where':_0x5585a1[_0xb5cd('0x3e')]};return db[_0xb5cd('0x3f')]['count'](_0x549bd3)[_0xb5cd('0x26')](function(_0x254a6b){_0x3f8a22[_0xb5cd('0x1f')]=_0x254a6b;if(_0x18ff66[_0xb5cd('0x31')]['includeAll']){_0x5585a1[_0xb5cd('0x40')]=[{'all':!![]}];}return db[_0xb5cd('0x3f')][_0xb5cd('0x41')](_0x5585a1);})[_0xb5cd('0x26')](function(_0x3810f2){_0x3f8a22[_0xb5cd('0x42')]=_0x3810f2;return _0x3f8a22;})[_0xb5cd('0x26')](respondWithFilteredResult(_0x13330b,_0x5585a1))[_0xb5cd('0x43')](handleError(_0x13330b,null));};exports[_0xb5cd('0x44')]=function(_0x478aef,_0x4b959a){var _0x431962={'raw':!![],'where':{'id':_0x478aef[_0xb5cd('0x45')]['id']}},_0x239f41={};_0x239f41[_0xb5cd('0x30')]=_[_0xb5cd('0x32')](db[_0xb5cd('0x3f')]['rawAttributes']);_0x239f41[_0xb5cd('0x31')]=_['keys'](_0x478aef[_0xb5cd('0x31')]);_0x239f41[_0xb5cd('0x37')]=_[_0xb5cd('0x33')](_0x239f41['model'],_0x239f41[_0xb5cd('0x31')]);_0x431962[_0xb5cd('0x34')]=_['intersection'](_0x239f41['model'],qs['fields'](_0x478aef[_0xb5cd('0x31')]['fields']));_0x431962['attributes']=_0x431962[_0xb5cd('0x34')][_0xb5cd('0x36')]?_0x431962[_0xb5cd('0x34')]:_0x239f41[_0xb5cd('0x30')];if(_0x478aef[_0xb5cd('0x31')][_0xb5cd('0x46')]){_0x431962['include']=[{'all':!![]}];}_0x431962=_[_0xb5cd('0x3a')]({},_0x431962,_0x478aef[_0xb5cd('0x3d')]);return db[_0xb5cd('0x3f')][_0xb5cd('0x47')](_0x431962)[_0xb5cd('0x26')](handleEntityNotFound(_0x4b959a,null))[_0xb5cd('0x26')](respondWithResult(_0x4b959a,null))[_0xb5cd('0x43')](handleError(_0x4b959a,null));};exports[_0xb5cd('0x48')]=function(_0x5e352d,_0x42c669){return db[_0xb5cd('0x3f')][_0xb5cd('0x48')](_0x5e352d['body'],{})[_0xb5cd('0x26')](respondWithResult(_0x42c669,0xc9))[_0xb5cd('0x43')](handleError(_0x42c669,null));};exports[_0xb5cd('0x25')]=function(_0x5e099f,_0x4e72a1){if(_0x5e099f[_0xb5cd('0x49')]['id']){delete _0x5e099f[_0xb5cd('0x49')]['id'];}return db['SugarcrmField'][_0xb5cd('0x47')]({'where':{'id':_0x5e099f['params']['id']}})[_0xb5cd('0x26')](handleEntityNotFound(_0x4e72a1,null))[_0xb5cd('0x26')](saveUpdates(_0x5e099f[_0xb5cd('0x49')],null))[_0xb5cd('0x26')](respondWithResult(_0x4e72a1,null))[_0xb5cd('0x43')](handleError(_0x4e72a1,null));};exports[_0xb5cd('0x27')]=function(_0x2d7dc7,_0x500d9a){return db['SugarcrmField'][_0xb5cd('0x47')]({'where':{'id':_0x2d7dc7[_0xb5cd('0x45')]['id']}})[_0xb5cd('0x26')](handleEntityNotFound(_0x500d9a,null))[_0xb5cd('0x26')](removeEntity(_0x500d9a,null))[_0xb5cd('0x43')](handleError(_0x500d9a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index e8f42e5..b8d2464 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 _0xbeb3=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x4de20d,_0x2b9826){var _0x3cd4e6=function(_0x47ed48){while(--_0x47ed48){_0x4de20d['push'](_0x4de20d['shift']());}};_0x3cd4e6(++_0x2b9826);}(_0xbeb3,0xd9));var _0x3beb=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xbeb3[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x3beb('0x0'));var util=require(_0x3beb('0x1'));var logger=require(_0x3beb('0x2'))(_0x3beb('0x3'));var moment=require(_0x3beb('0x4'));var BPromise=require(_0x3beb('0x5'));var rp=require(_0x3beb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3beb('0x7'));var config=require(_0x3beb('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x3beb('0x9')]=function(_0x8fe3e6,_0x571578){return _0x8fe3e6[_0x3beb('0xa')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3beb('0xb'),_0x3beb('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa574=['int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x5766ed,_0x2fa1eb){var _0x36ee69=function(_0x1e18e5){while(--_0x1e18e5){_0x5766ed['push'](_0x5766ed['shift']());}};_0x36ee69(++_0x2fa1eb);}(_0xa574,0x1a7));var _0x4a57=function(_0x271b2a,_0xcd5e52){_0x271b2a=_0x271b2a-0x0;var _0x332785=_0xa574[_0x271b2a];return _0x332785;};'use strict';var _=require('lodash');var util=require(_0x4a57('0x0'));var logger=require(_0x4a57('0x1'))('api');var moment=require(_0x4a57('0x2'));var BPromise=require(_0x4a57('0x3'));var rp=require(_0x4a57('0x4'));var fs=require('fs');var path=require(_0x4a57('0x5'));var rimraf=require(_0x4a57('0x6'));var config=require(_0x4a57('0x7'));var attributes=require(_0x4a57('0x8'));module[_0x4a57('0x9')]=function(_0x53fd44,_0x581838){return _0x53fd44[_0x4a57('0xa')](_0x4a57('0xb'),attributes,{'tableName':_0x4a57('0xc'),'paranoid':![],'indexes':[{'name':_0x4a57('0xd'),'fields':[_0x4a57('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index aa43282..ee9ad6c 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 _0x6bf7=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x2b9cf5,_0x2a7804){var _0xd0cf15=function(_0x92a896){while(--_0x92a896){_0x2b9cf5['push'](_0x2b9cf5['shift']());}};_0xd0cf15(++_0x2a7804);}(_0x6bf7,0x11d));var _0x76bf=function(_0x1f12af,_0x12d3a3){_0x1f12af=_0x1f12af-0x0;var _0x4b75ce=_0x6bf7[_0x1f12af];return _0x4b75ce;};'use strict';var _=require(_0x76bf('0x0'));var util=require(_0x76bf('0x1'));var moment=require(_0x76bf('0x2'));var BPromise=require(_0x76bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76bf('0x4'));var db=require(_0x76bf('0x5'))['db'];var utils=require(_0x76bf('0x6'));var logger=require(_0x76bf('0x7'))(_0x76bf('0x8'));var config=require(_0x76bf('0x9'));var jayson=require(_0x76bf('0xa'));var client=jayson['client'][_0x76bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x217561,_0x2959ed,_0xe23d0){return new BPromise(function(_0xdfe433,_0x4b8f83){return client['request'](_0x217561,_0xe23d0)['then'](function(_0x5af9c8){logger[_0x76bf('0xc')](_0x76bf('0xd'),_0x2959ed,_0x76bf('0xe'));logger[_0x76bf('0xf')](_0x76bf('0x10'),_0x2959ed,_0x76bf('0xe'),JSON[_0x76bf('0x11')](_0x5af9c8));if(_0x5af9c8[_0x76bf('0x12')]){if(_0x5af9c8[_0x76bf('0x12')][_0x76bf('0x13')]===0x1f4){logger[_0x76bf('0x12')](_0x76bf('0xd'),_0x2959ed,_0x5af9c8[_0x76bf('0x12')][_0x76bf('0x14')]);return _0x4b8f83(_0x5af9c8[_0x76bf('0x12')][_0x76bf('0x14')]);}logger[_0x76bf('0x12')](_0x76bf('0xd'),_0x2959ed,_0x5af9c8[_0x76bf('0x12')][_0x76bf('0x14')]);return _0xdfe433(_0x5af9c8['error'][_0x76bf('0x14')]);}else{logger[_0x76bf('0xc')](_0x76bf('0xd'),_0x2959ed,_0x76bf('0xe'));_0xdfe433(_0x5af9c8[_0x76bf('0x15')][_0x76bf('0x14')]);}})[_0x76bf('0x16')](function(_0x49b1df){logger[_0x76bf('0x12')](_0x76bf('0xd'),_0x2959ed,_0x49b1df);_0x4b8f83(_0x49b1df);});});} \ No newline at end of file +var _0x11ba=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x4744cb,_0x398865){var _0x1e4370=function(_0x5b3d39){while(--_0x5b3d39){_0x4744cb['push'](_0x4744cb['shift']());}};_0x1e4370(++_0x398865);}(_0x11ba,0xed));var _0xa11b=function(_0x5a2272,_0x213cbf){_0x5a2272=_0x5a2272-0x0;var _0x2c8c62=_0x11ba[_0x5a2272];return _0x2c8c62;};'use strict';var _=require(_0xa11b('0x0'));var util=require(_0xa11b('0x1'));var moment=require(_0xa11b('0x2'));var BPromise=require(_0xa11b('0x3'));var rs=require(_0xa11b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa11b('0x5'));var logger=require('../../config/logger')(_0xa11b('0x6'));var config=require(_0xa11b('0x7'));var jayson=require(_0xa11b('0x8'));var client=jayson[_0xa11b('0x9')][_0xa11b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d68a2,_0x114606,_0x4ddeb0){return new BPromise(function(_0x1b3103,_0x1752e0){return client['request'](_0x1d68a2,_0x4ddeb0)['then'](function(_0x2e6666){logger[_0xa11b('0xb')](_0xa11b('0xc'),_0x114606,_0xa11b('0xd'));logger[_0xa11b('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x114606,_0xa11b('0xd'),JSON['stringify'](_0x2e6666));if(_0x2e6666[_0xa11b('0xf')]){if(_0x2e6666[_0xa11b('0xf')][_0xa11b('0x10')]===0x1f4){logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);return _0x1752e0(_0x2e6666['error']['message']);}logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);return _0x1b3103(_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);}else{logger['info'](_0xa11b('0xc'),_0x114606,_0xa11b('0xd'));_0x1b3103(_0x2e6666[_0xa11b('0x12')][_0xa11b('0x11')]);}})[_0xa11b('0x13')](function(_0x2e84b5){logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e84b5);_0x1752e0(_0x2e84b5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1dfbd4c..880e515 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 _0x46b3=['isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0xf374b5,_0x1d259e){var _0x222d52=function(_0x35e011){while(--_0x35e011){_0xf374b5['push'](_0xf374b5['shift']());}};_0x222d52(++_0x1d259e);}(_0x46b3,0x194));var _0x346b=function(_0x282db2,_0x3d86ae){_0x282db2=_0x282db2-0x0;var _0x42017e=_0x46b3[_0x282db2];return _0x42017e;};'use strict';var multer=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var path=require(_0x346b('0x2'));var timeout=require(_0x346b('0x3'));var express=require(_0x346b('0x4'));var router=express['Router']();var fs_extra=require(_0x346b('0x5'));var auth=require(_0x346b('0x6'));var interaction=require(_0x346b('0x7'));var config=require(_0x346b('0x8'));var controller=require(_0x346b('0x9'));router['get']('/',auth[_0x346b('0xa')](),controller[_0x346b('0xb')]);router['get'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller['show']);router[_0x346b('0xd')](_0x346b('0xe'),auth[_0x346b('0xa')](),controller[_0x346b('0xf')]);router[_0x346b('0xd')](_0x346b('0x10'),auth[_0x346b('0xa')](),controller[_0x346b('0x11')]);router[_0x346b('0x12')]('/',auth['isAuthenticated'](),controller[_0x346b('0x13')]);router[_0x346b('0x12')]('/:id/configurations',auth[_0x346b('0xa')](),controller[_0x346b('0x14')]);router['put'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller['update']);router['delete'](_0x346b('0xc'),auth[_0x346b('0xa')](),controller[_0x346b('0x15')]);module[_0x346b('0x16')]=router; \ No newline at end of file +var _0x6475=['getFields','post','addConfiguration','put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/configurations','/:id/fields'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x6475,0x133));var _0x5647=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0x6475[_0x5111a9];return _0x59a15a;};'use strict';var multer=require(_0x5647('0x0'));var util=require(_0x5647('0x1'));var path=require(_0x5647('0x2'));var timeout=require('connect-timeout');var express=require(_0x5647('0x3'));var router=express[_0x5647('0x4')]();var fs_extra=require(_0x5647('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5647('0x6'));var config=require(_0x5647('0x7'));var controller=require(_0x5647('0x8'));router['get']('/',auth[_0x5647('0x9')](),controller[_0x5647('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5647('0xb')]);router[_0x5647('0xc')](_0x5647('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x5647('0xc')](_0x5647('0xe'),auth[_0x5647('0x9')](),controller[_0x5647('0xf')]);router[_0x5647('0x10')]('/',auth[_0x5647('0x9')](),controller['create']);router[_0x5647('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5647('0x11')]);router[_0x5647('0x12')]('/:id',auth[_0x5647('0x9')](),controller[_0x5647('0x13')]);router[_0x5647('0x14')](_0x5647('0x15'),auth[_0x5647('0x9')](),controller['destroy']);module[_0x5647('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 a2327a0..9ad79ab 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 _0xd400=['STRING','sequelize','exports'];(function(_0x13202e,_0x51c85c){var _0x23ed9c=function(_0x32c5ff){while(--_0x32c5ff){_0x13202e['push'](_0x13202e['shift']());}};_0x23ed9c(++_0x51c85c);}(_0xd400,0x163));var _0x0d40=function(_0x514fcc,_0x20118f){_0x514fcc=_0x514fcc-0x0;var _0x271fd5=_0xd400[_0x514fcc];return _0x271fd5;};'use strict';var Sequelize=require(_0x0d40('0x0'));module[_0x0d40('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0d40('0x2')]},'username':{'type':Sequelize[_0x0d40('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0d40('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0d40('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1213=['HelpDesk','sequelize','STRING'];(function(_0xf0f87,_0x10c0ef){var _0x48623e=function(_0x2751be){while(--_0x2751be){_0xf0f87['push'](_0xf0f87['shift']());}};_0x48623e(++_0x10c0ef);}(_0x1213,0x14e));var _0x3121=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x1213[_0x328b1c];return _0x4dbeaa;};'use strict';var Sequelize=require(_0x3121('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3121('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3121('0x2')},'remoteUri':{'type':Sequelize[_0x3121('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3121('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index fddd403..fb80b79 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 _0x1af2=['cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','create','update','body','find','getConfigurations','findOne','VtigerConfiguration','length','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','remoteUri','serverUrl','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','reference','remove','includes','false','label'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x1af2,0x178));var _0x21af=function(_0x1bfd25,_0x349005){_0x1bfd25=_0x1bfd25-0x0;var _0x11804d=_0x1af2[_0x1bfd25];return _0x11804d;};'use strict';var emlformat=require(_0x21af('0x0'));var rimraf=require(_0x21af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21af('0x2'));var rp=require('request-promise');var moment=require(_0x21af('0x3'));var BPromise=require(_0x21af('0x4'));var Mustache=require(_0x21af('0x5'));var util=require(_0x21af('0x6'));var path=require('path');var sox=require(_0x21af('0x7'));var csv=require(_0x21af('0x8'));var ejs=require(_0x21af('0x9'));var fs=require('fs');var fs_extra=require(_0x21af('0xa'));var _=require(_0x21af('0xb'));var squel=require(_0x21af('0xc'));var crypto=require(_0x21af('0xd'));var jsforce=require(_0x21af('0xe'));var deskjs=require(_0x21af('0xf'));var toCsv=require(_0x21af('0x8'));var querystring=require(_0x21af('0x10'));var Papa=require(_0x21af('0x11'));var Redis=require('ioredis');var authService=require(_0x21af('0x12'));var qs=require(_0x21af('0x13'));var as=require(_0x21af('0x14'));var hardwareService=require(_0x21af('0x15'));var logger=require(_0x21af('0x16'))('api');var utils=require(_0x21af('0x17'));var config=require(_0x21af('0x18'));var licenseUtil=require(_0x21af('0x19'));var db=require(_0x21af('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4432c9,_0x3f76e8){_0x3f76e8=_0x3f76e8||0xcc;return function(_0x48d172){if(_0x48d172){return _0x4432c9[_0x21af('0x1b')](_0x3f76e8);}return _0x4432c9['status'](_0x3f76e8)[_0x21af('0x1c')]();};}function respondWithResult(_0x4999a1,_0x229285){_0x229285=_0x229285||0xc8;return function(_0x140769){if(_0x140769){return _0x4999a1[_0x21af('0x1d')](_0x229285)[_0x21af('0x1e')](_0x140769);}};}function respondWithFilteredResult(_0x4ede98,_0xa98170){return function(_0x1e4bcf){if(_0x1e4bcf){var _0x1ce88c=typeof _0xa98170[_0x21af('0x1f')]===_0x21af('0x20')&&typeof _0xa98170['limit']===_0x21af('0x20');var _0xdba7e1=_0x1e4bcf['count'];var _0x5d8b9f=_0x1ce88c?0x0:_0xa98170['offset'];var _0x3acff8=_0x1ce88c?_0x1e4bcf[_0x21af('0x21')]:_0xa98170[_0x21af('0x1f')]+_0xa98170[_0x21af('0x22')];var _0x34b1e1;if(_0x3acff8>=_0xdba7e1){_0x3acff8=_0xdba7e1;_0x34b1e1=0xc8;}else{_0x34b1e1=0xce;}_0x4ede98[_0x21af('0x1d')](_0x34b1e1);return _0x4ede98['set'](_0x21af('0x23'),_0x5d8b9f+'-'+_0x3acff8+'/'+_0xdba7e1)[_0x21af('0x1e')](_0x1e4bcf);}return null;};}function patchUpdates(_0x1623e8){return function(_0x53bfbc){try{jsonpatch[_0x21af('0x24')](_0x53bfbc,_0x1623e8,!![]);}catch(_0x5702ca){return BPromise[_0x21af('0x25')](_0x5702ca);}return _0x53bfbc[_0x21af('0x26')]();};}function saveUpdates(_0xc144f5,_0x12109b){return function(_0x56d94c){if(_0x56d94c){return _0x56d94c['update'](_0xc144f5)[_0x21af('0x27')](function(_0x510d07){return _0x510d07;});}return null;};}function removeEntity(_0x570a85,_0x572dc1){return function(_0x2d14d2){if(_0x2d14d2){return _0x2d14d2[_0x21af('0x28')]()[_0x21af('0x27')](function(){_0x570a85['status'](0xcc)[_0x21af('0x1c')]();});}};}function handleEntityNotFound(_0x3104d8,_0x192f43){return function(_0x272b1c){if(!_0x272b1c){_0x3104d8[_0x21af('0x1b')](0x194);}return _0x272b1c;};}function handleError(_0x3964c5,_0x1e9f2e){_0x1e9f2e=_0x1e9f2e||0x1f4;return function(_0x32d8f8){logger[_0x21af('0x29')](_0x32d8f8[_0x21af('0x2a')]);if(_0x32d8f8[_0x21af('0x2b')]){delete _0x32d8f8[_0x21af('0x2b')];}_0x3964c5[_0x21af('0x1d')](_0x1e9f2e)[_0x21af('0x2c')](_0x32d8f8);};}exports[_0x21af('0x2d')]=function(_0x19c216,_0x3e050f){var _0x5f86e4={},_0x94e7cc={},_0x4c4fba={'count':0x0,'rows':[]};var _0x14f2ba=_[_0x21af('0x2e')](db[_0x21af('0x2f')][_0x21af('0x30')],function(_0x5be07f){return{'name':_0x5be07f[_0x21af('0x31')],'type':_0x5be07f[_0x21af('0x32')][_0x21af('0x33')]};});_0x94e7cc[_0x21af('0x34')]=_[_0x21af('0x2e')](_0x14f2ba,_0x21af('0x2b'));_0x94e7cc[_0x21af('0x35')]=_[_0x21af('0x36')](_0x19c216[_0x21af('0x35')]);_0x94e7cc[_0x21af('0x37')]=_[_0x21af('0x38')](_0x94e7cc[_0x21af('0x34')],_0x94e7cc[_0x21af('0x35')]);_0x5f86e4[_0x21af('0x39')]=_[_0x21af('0x38')](_0x94e7cc[_0x21af('0x34')],qs['fields'](_0x19c216['query'][_0x21af('0x3a')]));_0x5f86e4['attributes']=_0x5f86e4[_0x21af('0x39')]['length']?_0x5f86e4[_0x21af('0x39')]:_0x94e7cc[_0x21af('0x34')];if(!_0x19c216[_0x21af('0x35')][_0x21af('0x3b')]('nolimit')){_0x5f86e4[_0x21af('0x22')]=qs[_0x21af('0x22')](_0x19c216[_0x21af('0x35')][_0x21af('0x22')]);_0x5f86e4[_0x21af('0x1f')]=qs[_0x21af('0x1f')](_0x19c216[_0x21af('0x35')][_0x21af('0x1f')]);}_0x5f86e4[_0x21af('0x3c')]=qs['sort'](_0x19c216[_0x21af('0x35')]['sort']);_0x5f86e4[_0x21af('0x3d')]=qs[_0x21af('0x37')](_[_0x21af('0x3e')](_0x19c216['query'],_0x94e7cc[_0x21af('0x37')]),_0x14f2ba);if(_0x19c216[_0x21af('0x35')][_0x21af('0x3f')]){_0x5f86e4[_0x21af('0x3d')]=_[_0x21af('0x40')](_0x5f86e4[_0x21af('0x3d')],{'$or':_[_0x21af('0x2e')](_0x14f2ba,function(_0x1e16fa){if(_0x1e16fa['type']!==_0x21af('0x41')){var _0x313030={};_0x313030[_0x1e16fa[_0x21af('0x2b')]]={'$like':'%'+_0x19c216[_0x21af('0x35')][_0x21af('0x3f')]+'%'};return _0x313030;}})});}_0x5f86e4=_['merge']({},_0x5f86e4,_0x19c216[_0x21af('0x42')]);var _0x23f251={'where':_0x5f86e4['where']};return db[_0x21af('0x2f')]['count'](_0x23f251)['then'](function(_0x3eade9){_0x4c4fba[_0x21af('0x21')]=_0x3eade9;if(_0x19c216[_0x21af('0x35')]['includeAll']){_0x5f86e4[_0x21af('0x43')]=[{'all':!![]}];}return db[_0x21af('0x2f')][_0x21af('0x44')](_0x5f86e4);})[_0x21af('0x27')](function(_0x5e9c18){_0x4c4fba[_0x21af('0x45')]=_0x5e9c18;return _0x4c4fba;})['then'](respondWithFilteredResult(_0x3e050f,_0x5f86e4))[_0x21af('0x46')](handleError(_0x3e050f,null));};exports[_0x21af('0x47')]=function(_0x469f15,_0x32d4ec){var _0x1525ea={'raw':![],'where':{'id':_0x469f15[_0x21af('0x48')]['id']}},_0x2dba5b={};_0x2dba5b['model']=_['keys'](db[_0x21af('0x2f')][_0x21af('0x30')]);_0x2dba5b['query']=_[_0x21af('0x36')](_0x469f15['query']);_0x2dba5b['filters']=_[_0x21af('0x38')](_0x2dba5b[_0x21af('0x34')],_0x2dba5b[_0x21af('0x35')]);_0x1525ea[_0x21af('0x39')]=_[_0x21af('0x38')](_0x2dba5b[_0x21af('0x34')],qs[_0x21af('0x3a')](_0x469f15[_0x21af('0x35')][_0x21af('0x3a')]));_0x1525ea[_0x21af('0x39')]=_0x1525ea[_0x21af('0x39')]['length']?_0x1525ea[_0x21af('0x39')]:_0x2dba5b[_0x21af('0x34')];if(_0x469f15[_0x21af('0x35')]['includeAll']){_0x1525ea[_0x21af('0x43')]=[{'all':!![]}];}_0x1525ea=_['merge']({},_0x1525ea,_0x469f15[_0x21af('0x42')]);return db[_0x21af('0x2f')]['find'](_0x1525ea)[_0x21af('0x27')](handleEntityNotFound(_0x32d4ec,null))['then'](respondWithResult(_0x32d4ec,null))['catch'](handleError(_0x32d4ec,null));};exports['create']=function(_0x473560,_0x47e35e){return db[_0x21af('0x2f')][_0x21af('0x49')](_0x473560['body'],{})[_0x21af('0x27')](respondWithResult(_0x47e35e,0xc9))[_0x21af('0x46')](handleError(_0x47e35e,null));};exports[_0x21af('0x4a')]=function(_0x28fe50,_0x817ca5){if(_0x28fe50['body']['id']){delete _0x28fe50[_0x21af('0x4b')]['id'];}return db[_0x21af('0x2f')][_0x21af('0x4c')]({'where':{'id':_0x28fe50['params']['id']}})['then'](handleEntityNotFound(_0x817ca5,null))[_0x21af('0x27')](saveUpdates(_0x28fe50[_0x21af('0x4b')],null))[_0x21af('0x27')](respondWithResult(_0x817ca5,null))[_0x21af('0x46')](handleError(_0x817ca5,null));};exports[_0x21af('0x28')]=function(_0x7b150b,_0x58bfe4){return db[_0x21af('0x2f')][_0x21af('0x4c')]({'where':{'id':_0x7b150b['params']['id']}})[_0x21af('0x27')](handleEntityNotFound(_0x58bfe4,null))[_0x21af('0x27')](removeEntity(_0x58bfe4,null))[_0x21af('0x46')](handleError(_0x58bfe4,null));};exports[_0x21af('0x4d')]=function(_0x213060,_0x2d9d98,_0x2a3f6b){var _0x5dc64b={};var _0x5a9389={};var _0x110aa1;var _0x37f570;return db[_0x21af('0x2f')][_0x21af('0x4e')]({'where':{'id':_0x213060['params']['id']}})[_0x21af('0x27')](handleEntityNotFound(_0x2d9d98,null))[_0x21af('0x27')](function(_0x2c32bb){if(_0x2c32bb){_0x110aa1=_0x2c32bb;_0x5a9389[_0x21af('0x34')]=_['keys'](db[_0x21af('0x4f')]['rawAttributes']);_0x5a9389[_0x21af('0x35')]=_[_0x21af('0x36')](_0x213060[_0x21af('0x35')]);_0x5a9389[_0x21af('0x37')]=_[_0x21af('0x38')](_0x5a9389[_0x21af('0x34')],_0x5a9389['query']);_0x5dc64b['attributes']=_[_0x21af('0x38')](_0x5a9389[_0x21af('0x34')],qs[_0x21af('0x3a')](_0x213060['query'][_0x21af('0x3a')]));_0x5dc64b[_0x21af('0x39')]=_0x5dc64b['attributes'][_0x21af('0x50')]?_0x5dc64b[_0x21af('0x39')]:_0x5a9389['model'];_0x5dc64b['order']=qs[_0x21af('0x51')](_0x213060[_0x21af('0x35')][_0x21af('0x51')]);_0x5dc64b[_0x21af('0x3d')]=qs[_0x21af('0x37')](_['pick'](_0x213060['query'],_0x5a9389[_0x21af('0x37')]));if(_0x213060['query']['filter']){_0x5dc64b[_0x21af('0x3d')]=_['merge'](_0x5dc64b[_0x21af('0x3d')],{'$or':_['map'](_0x5dc64b[_0x21af('0x39')],function(_0x5405f8){var _0xb723ed={};_0xb723ed[_0x5405f8]={'$like':'%'+_0x213060[_0x21af('0x35')]['filter']+'%'};return _0xb723ed;})});}_0x5dc64b=_[_0x21af('0x40')]({},_0x5dc64b,_0x213060['options']);return _0x110aa1[_0x21af('0x4d')](_0x5dc64b);}})[_0x21af('0x27')](function(_0xba11f){if(_0xba11f){_0x37f570=_0xba11f[_0x21af('0x50')];if(!_0x213060['query']['hasOwnProperty'](_0x21af('0x52'))){_0x5dc64b['limit']=qs[_0x21af('0x22')](_0x213060[_0x21af('0x35')][_0x21af('0x22')]);_0x5dc64b[_0x21af('0x1f')]=qs['offset'](_0x213060[_0x21af('0x35')][_0x21af('0x1f')]);}return _0x110aa1[_0x21af('0x4d')](_0x5dc64b);}})[_0x21af('0x27')](function(_0x3286f0){if(_0x3286f0){return _0x3286f0?{'count':_0x37f570,'rows':_0x3286f0}:null;}})[_0x21af('0x27')](respondWithResult(_0x2d9d98,null))[_0x21af('0x46')](handleError(_0x2d9d98,null));};exports[_0x21af('0x53')]=function(_0x3c0db9,_0x150ae0,_0x5be565){if(_0x3c0db9[_0x21af('0x4b')]['id']){delete _0x3c0db9[_0x21af('0x4b')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x3c0db9[_0x21af('0x48')]['id']}})[_0x21af('0x27')](handleEntityNotFound(_0x150ae0,null))['then'](function(_0x552179){if(_0x552179){_0x3c0db9[_0x21af('0x4b')][_0x21af('0x54')]=_0x552179['id'];_0x3c0db9[_0x21af('0x4b')][_0x21af('0x55')]=integrations[_0x21af('0x56')](_0x3c0db9[_0x21af('0x4b')][_0x21af('0x57')],_0x3c0db9[_0x21af('0x4b')][_0x21af('0x32')]);_0x3c0db9['body'][_0x21af('0x58')]=integrations[_0x21af('0x59')](_0x3c0db9[_0x21af('0x4b')][_0x21af('0x57')],_0x3c0db9[_0x21af('0x4b')]['type']);return db['VtigerConfiguration']['create'](_0x3c0db9[_0x21af('0x4b')],{'include':[{'model':db[_0x21af('0x5a')],'as':_0x21af('0x55')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x21af('0x27')](respondWithResult(_0x150ae0,null))['catch'](handleError(_0x150ae0,null));};var md5=require('md5');exports[_0x21af('0x5b')]=function(_0x2e5a62,_0x23979c,_0x5a6991){var _0xb56ac8=null;var _0x527029=null;var _0x3f4d26=null;var _0x23c81d=null;var _0x4e9d0a='';return db[_0x21af('0x2f')][_0x21af('0x4e')]({'where':{'id':_0x2e5a62['params']['id']},'attributes':['id',_0x21af('0x2b'),_0x21af('0x5c'),_0x21af('0x5d'),'moduleName',_0x21af('0x5e'),_0x21af('0x5f'),_0x21af('0x60')]})['then'](handleEntityNotFound(_0x23979c,null))['then'](function(_0x2915cf){if(_0x2915cf){_0xb56ac8=_0x2915cf[_0x21af('0x5c')];_0x527029=_0x2915cf[_0x21af('0x60')];_0x3f4d26=_0x2915cf['moduleName'];_0x4e9d0a=_0x2915cf[_0x21af('0x5e')];var _0x1a4341=_0x4e9d0a['slice'](-0x1);if(_0x1a4341==='/'){_0x4e9d0a=_0x4e9d0a[_0x21af('0x61')](0x0,_0x4e9d0a[_0x21af('0x62')](_0x1a4341));}_0x23c81d=util['format'](_0x21af('0x63'),_0x4e9d0a);var _0xb78b56={'method':_0x21af('0x64'),'uri':_0x23c81d,'qs':{'operation':_0x21af('0x65'),'username':_0x2915cf[_0x21af('0x5c')]},'json':!![]};return rp(_0xb78b56);}})[_0x21af('0x27')](function(_0x167ecf){if(_0x167ecf[_0x21af('0x66')]){var _0x5193fc={'method':_0x21af('0x67'),'uri':_0x23c81d,'form':{'operation':'login','username':_0xb56ac8,'accessKey':md5(_0x167ecf[_0x21af('0x68')]['token']+_0x527029)},'json':!![]};return rp(_0x5193fc);}})['then'](function(_0x1922e7){if(_0x1922e7[_0x21af('0x66')]){var _0x3e2e1b={'method':'GET','uri':_0x23c81d,'qs':{'operation':_0x21af('0x69'),'username':_0xb56ac8,'sessionName':_0x1922e7[_0x21af('0x68')][_0x21af('0x6a')],'elementType':_0x3f4d26},'json':!![]};return rp(_0x3e2e1b);}})[_0x21af('0x27')](function(_0x4e564d){if(_0x4e564d['success']){var _0x13f585=['autogenerated',_0x21af('0x6b'),'owner'];_[_0x21af('0x6c')](_0x4e564d[_0x21af('0x68')]['fields'],function(_0x571aef){return _0x13f585[_0x21af('0x6d')](_0x571aef[_0x21af('0x32')]['name']);});_[_0x21af('0x6c')](_0x4e564d[_0x21af('0x68')][_0x21af('0x3a')],function(_0x26fcdd){return _0x26fcdd['editable']===_0x21af('0x6e');});return{'count':_0x4e564d['result']['fields'][_0x21af('0x50')],'rows':_['map'](_0x4e564d[_0x21af('0x68')]['fields'],function(_0x491b57){return{'id':_0x491b57['name'],'name':_0x491b57[_0x21af('0x6f')],'custom':_['startsWith'](_0x491b57['name'],_0x21af('0x70'))?!![]:![],'options':_0x491b57[_0x21af('0x32')]['name']===_0x21af('0x71')&&_0x491b57['type'][_0x21af('0x72')]['length']>0x0?_[_0x21af('0x2e')](_0x491b57[_0x21af('0x32')][_0x21af('0x72')],function(_0x32e210){return{'name':_0x32e210[_0x21af('0x6f')],'value':_0x32e210[_0x21af('0x73')]};}):[]};})};}})[_0x21af('0x27')](respondWithResult(_0x23979c,null))[_0x21af('0x46')](function(_0x5ab252){console['log'](_0x21af('0x74')+_0x5ab252);var _0x5eeb71=_0x2e5a62[_0x21af('0x35')][_0x21af('0x75')]?0x1f4:_0x5ab252[_0x21af('0x76')]||0x1f4;logger['error'](_0x21af('0x77'),_0x21af('0x5b'),_0x5eeb71,JSON[_0x21af('0x78')](_0x5ab252));delete _0x5ab252[_0x21af('0x2b')];if(_0x5eeb71===0x191){_0x5eeb71=0x190;}_0x23979c[_0x21af('0x1d')](_0x5eeb71)[_0x21af('0x2c')](_0x2e5a62[_0x21af('0x35')][_0x21af('0x75')]?{'message':_0x21af('0x79'),'statusCode':_0x5ab252[_0x21af('0x76')]}:_0x5ab252);});}; \ No newline at end of file +var _0xa1f0=['name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','success','POST','login','result','describe','reference','owner','remove','includes','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1ea7d,_0x1514c2){var _0x43b911=function(_0x4b582d){while(--_0x4b582d){_0x1ea7d['push'](_0x1ea7d['shift']());}};_0x43b911(++_0x1514c2);}(_0xa1f0,0x13c));var _0x0a1f=function(_0x5a1a91,_0x51f4d4){_0x5a1a91=_0x5a1a91-0x0;var _0x3b3d66=_0xa1f0[_0x5a1a91];return _0x3b3d66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a1f('0x0'));var rp=require(_0x0a1f('0x1'));var moment=require(_0x0a1f('0x2'));var BPromise=require(_0x0a1f('0x3'));var Mustache=require(_0x0a1f('0x4'));var util=require('util');var path=require(_0x0a1f('0x5'));var sox=require(_0x0a1f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a1f('0x7'));var _=require(_0x0a1f('0x8'));var squel=require(_0x0a1f('0x9'));var crypto=require(_0x0a1f('0xa'));var jsforce=require(_0x0a1f('0xb'));var deskjs=require(_0x0a1f('0xc'));var toCsv=require(_0x0a1f('0xd'));var querystring=require(_0x0a1f('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a1f('0xf'));var authService=require(_0x0a1f('0x10'));var qs=require(_0x0a1f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a1f('0x12'));var logger=require(_0x0a1f('0x13'))('api');var utils=require(_0x0a1f('0x14'));var config=require(_0x0a1f('0x15'));var licenseUtil=require(_0x0a1f('0x16'));var db=require(_0x0a1f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x137315,_0x4fa939){_0x4fa939=_0x4fa939||0xcc;return function(_0x2ec222){if(_0x2ec222){return _0x137315['sendStatus'](_0x4fa939);}return _0x137315[_0x0a1f('0x18')](_0x4fa939)[_0x0a1f('0x19')]();};}function respondWithResult(_0x27e3bd,_0x374b89){_0x374b89=_0x374b89||0xc8;return function(_0x5e64ca){if(_0x5e64ca){return _0x27e3bd[_0x0a1f('0x18')](_0x374b89)[_0x0a1f('0x1a')](_0x5e64ca);}};}function respondWithFilteredResult(_0x3b79f6,_0x2d77f5){return function(_0x3a3932){if(_0x3a3932){var _0x31ca75=typeof _0x2d77f5[_0x0a1f('0x1b')]==='undefined'&&typeof _0x2d77f5['limit']===_0x0a1f('0x1c');var _0x407af7=_0x3a3932[_0x0a1f('0x1d')];var _0x33610d=_0x31ca75?0x0:_0x2d77f5[_0x0a1f('0x1b')];var _0x385912=_0x31ca75?_0x3a3932['count']:_0x2d77f5['offset']+_0x2d77f5['limit'];var _0x5afb2b;if(_0x385912>=_0x407af7){_0x385912=_0x407af7;_0x5afb2b=0xc8;}else{_0x5afb2b=0xce;}_0x3b79f6[_0x0a1f('0x18')](_0x5afb2b);return _0x3b79f6[_0x0a1f('0x1e')](_0x0a1f('0x1f'),_0x33610d+'-'+_0x385912+'/'+_0x407af7)[_0x0a1f('0x1a')](_0x3a3932);}return null;};}function patchUpdates(_0x371c6b){return function(_0x3ad333){try{jsonpatch[_0x0a1f('0x20')](_0x3ad333,_0x371c6b,!![]);}catch(_0x49b56a){return BPromise[_0x0a1f('0x21')](_0x49b56a);}return _0x3ad333[_0x0a1f('0x22')]();};}function saveUpdates(_0x5888d1,_0xb4d650){return function(_0xe77d62){if(_0xe77d62){return _0xe77d62[_0x0a1f('0x23')](_0x5888d1)[_0x0a1f('0x24')](function(_0x255e32){return _0x255e32;});}return null;};}function removeEntity(_0x27065f,_0x4e2d39){return function(_0x1d2d2f){if(_0x1d2d2f){return _0x1d2d2f[_0x0a1f('0x25')]()['then'](function(){_0x27065f[_0x0a1f('0x18')](0xcc)[_0x0a1f('0x19')]();});}};}function handleEntityNotFound(_0x817d5,_0x1f48a2){return function(_0x17d258){if(!_0x17d258){_0x817d5[_0x0a1f('0x26')](0x194);}return _0x17d258;};}function handleError(_0x57a421,_0xc16f){_0xc16f=_0xc16f||0x1f4;return function(_0x55f08d){logger[_0x0a1f('0x27')](_0x55f08d[_0x0a1f('0x28')]);if(_0x55f08d[_0x0a1f('0x29')]){delete _0x55f08d['name'];}_0x57a421['status'](_0xc16f)[_0x0a1f('0x2a')](_0x55f08d);};}exports[_0x0a1f('0x2b')]=function(_0x91aeeb,_0x72e43f){var _0x3eb176={},_0x52f4a1={},_0x47cc26={'count':0x0,'rows':[]};var _0x4b509d=_[_0x0a1f('0x2c')](db[_0x0a1f('0x2d')][_0x0a1f('0x2e')],function(_0x1fe1b7){return{'name':_0x1fe1b7[_0x0a1f('0x2f')],'type':_0x1fe1b7['type'][_0x0a1f('0x30')]};});_0x52f4a1['model']=_['map'](_0x4b509d,'name');_0x52f4a1[_0x0a1f('0x31')]=_[_0x0a1f('0x32')](_0x91aeeb[_0x0a1f('0x31')]);_0x52f4a1[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x52f4a1[_0x0a1f('0x35')],_0x52f4a1[_0x0a1f('0x31')]);_0x3eb176['attributes']=_[_0x0a1f('0x34')](_0x52f4a1['model'],qs[_0x0a1f('0x36')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x36')]));_0x3eb176['attributes']=_0x3eb176[_0x0a1f('0x37')]['length']?_0x3eb176[_0x0a1f('0x37')]:_0x52f4a1[_0x0a1f('0x35')];if(!_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x38')](_0x0a1f('0x39'))){_0x3eb176[_0x0a1f('0x3a')]=qs[_0x0a1f('0x3a')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3a')]);_0x3eb176[_0x0a1f('0x1b')]=qs[_0x0a1f('0x1b')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x1b')]);}_0x3eb176[_0x0a1f('0x3b')]=qs[_0x0a1f('0x3c')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3c')]);_0x3eb176[_0x0a1f('0x3d')]=qs[_0x0a1f('0x33')](_['pick'](_0x91aeeb[_0x0a1f('0x31')],_0x52f4a1[_0x0a1f('0x33')]),_0x4b509d);if(_0x91aeeb['query'][_0x0a1f('0x3e')]){_0x3eb176[_0x0a1f('0x3d')]=_[_0x0a1f('0x3f')](_0x3eb176['where'],{'$or':_[_0x0a1f('0x2c')](_0x4b509d,function(_0x448c5e){if(_0x448c5e[_0x0a1f('0x40')]!==_0x0a1f('0x41')){var _0x3d26b3={};_0x3d26b3[_0x448c5e[_0x0a1f('0x29')]]={'$like':'%'+_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3e')]+'%'};return _0x3d26b3;}})});}_0x3eb176=_[_0x0a1f('0x3f')]({},_0x3eb176,_0x91aeeb[_0x0a1f('0x42')]);var _0x293663={'where':_0x3eb176[_0x0a1f('0x3d')]};return db[_0x0a1f('0x2d')][_0x0a1f('0x1d')](_0x293663)[_0x0a1f('0x24')](function(_0x2ff4d5){_0x47cc26[_0x0a1f('0x1d')]=_0x2ff4d5;if(_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x43')]){_0x3eb176['include']=[{'all':!![]}];}return db[_0x0a1f('0x2d')][_0x0a1f('0x44')](_0x3eb176);})[_0x0a1f('0x24')](function(_0x4a59f3){_0x47cc26[_0x0a1f('0x45')]=_0x4a59f3;return _0x47cc26;})['then'](respondWithFilteredResult(_0x72e43f,_0x3eb176))[_0x0a1f('0x46')](handleError(_0x72e43f,null));};exports[_0x0a1f('0x47')]=function(_0x54710e,_0x7ade26){var _0x56593b={'raw':![],'where':{'id':_0x54710e[_0x0a1f('0x48')]['id']}},_0x1299e6={};_0x1299e6[_0x0a1f('0x35')]=_[_0x0a1f('0x32')](db[_0x0a1f('0x2d')][_0x0a1f('0x2e')]);_0x1299e6[_0x0a1f('0x31')]=_[_0x0a1f('0x32')](_0x54710e[_0x0a1f('0x31')]);_0x1299e6[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x1299e6['model'],_0x1299e6[_0x0a1f('0x31')]);_0x56593b['attributes']=_[_0x0a1f('0x34')](_0x1299e6['model'],qs['fields'](_0x54710e['query'][_0x0a1f('0x36')]));_0x56593b[_0x0a1f('0x37')]=_0x56593b[_0x0a1f('0x37')][_0x0a1f('0x49')]?_0x56593b[_0x0a1f('0x37')]:_0x1299e6[_0x0a1f('0x35')];if(_0x54710e[_0x0a1f('0x31')][_0x0a1f('0x43')]){_0x56593b[_0x0a1f('0x4a')]=[{'all':!![]}];}_0x56593b=_[_0x0a1f('0x3f')]({},_0x56593b,_0x54710e[_0x0a1f('0x42')]);return db[_0x0a1f('0x2d')][_0x0a1f('0x4b')](_0x56593b)[_0x0a1f('0x24')](handleEntityNotFound(_0x7ade26,null))[_0x0a1f('0x24')](respondWithResult(_0x7ade26,null))[_0x0a1f('0x46')](handleError(_0x7ade26,null));};exports[_0x0a1f('0x4c')]=function(_0xa69ea9,_0x4f62f5){return db[_0x0a1f('0x2d')][_0x0a1f('0x4c')](_0xa69ea9[_0x0a1f('0x4d')],{})[_0x0a1f('0x24')](respondWithResult(_0x4f62f5,0xc9))[_0x0a1f('0x46')](handleError(_0x4f62f5,null));};exports[_0x0a1f('0x23')]=function(_0x5b3d58,_0x3127c3){if(_0x5b3d58[_0x0a1f('0x4d')]['id']){delete _0x5b3d58['body']['id'];}return db[_0x0a1f('0x2d')]['find']({'where':{'id':_0x5b3d58['params']['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x3127c3,null))[_0x0a1f('0x24')](saveUpdates(_0x5b3d58[_0x0a1f('0x4d')],null))[_0x0a1f('0x24')](respondWithResult(_0x3127c3,null))[_0x0a1f('0x46')](handleError(_0x3127c3,null));};exports[_0x0a1f('0x25')]=function(_0x15e304,_0x20a323){return db[_0x0a1f('0x2d')]['find']({'where':{'id':_0x15e304[_0x0a1f('0x48')]['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x20a323,null))[_0x0a1f('0x24')](removeEntity(_0x20a323,null))[_0x0a1f('0x46')](handleError(_0x20a323,null));};exports[_0x0a1f('0x4e')]=function(_0x24322a,_0x1f8d9f,_0x161fa2){var _0x4ea4df={};var _0x102f38={};var _0x42667f;var _0x50a715;return db['VtigerAccount'][_0x0a1f('0x4f')]({'where':{'id':_0x24322a['params']['id']}})['then'](handleEntityNotFound(_0x1f8d9f,null))[_0x0a1f('0x24')](function(_0x28a536){if(_0x28a536){_0x42667f=_0x28a536;_0x102f38[_0x0a1f('0x35')]=_[_0x0a1f('0x32')](db['VtigerConfiguration']['rawAttributes']);_0x102f38[_0x0a1f('0x31')]=_['keys'](_0x24322a['query']);_0x102f38[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x102f38[_0x0a1f('0x35')],_0x102f38[_0x0a1f('0x31')]);_0x4ea4df[_0x0a1f('0x37')]=_[_0x0a1f('0x34')](_0x102f38['model'],qs[_0x0a1f('0x36')](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x36')]));_0x4ea4df['attributes']=_0x4ea4df['attributes'][_0x0a1f('0x49')]?_0x4ea4df[_0x0a1f('0x37')]:_0x102f38[_0x0a1f('0x35')];_0x4ea4df['order']=qs['sort'](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3c')]);_0x4ea4df[_0x0a1f('0x3d')]=qs[_0x0a1f('0x33')](_['pick'](_0x24322a['query'],_0x102f38[_0x0a1f('0x33')]));if(_0x24322a[_0x0a1f('0x31')]['filter']){_0x4ea4df[_0x0a1f('0x3d')]=_[_0x0a1f('0x3f')](_0x4ea4df[_0x0a1f('0x3d')],{'$or':_[_0x0a1f('0x2c')](_0x4ea4df[_0x0a1f('0x37')],function(_0x5c4157){var _0x5a5ede={};_0x5a5ede[_0x5c4157]={'$like':'%'+_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3e')]+'%'};return _0x5a5ede;})});}_0x4ea4df=_[_0x0a1f('0x3f')]({},_0x4ea4df,_0x24322a[_0x0a1f('0x42')]);return _0x42667f[_0x0a1f('0x4e')](_0x4ea4df);}})[_0x0a1f('0x24')](function(_0x4a9867){if(_0x4a9867){_0x50a715=_0x4a9867['length'];if(!_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x38')](_0x0a1f('0x39'))){_0x4ea4df[_0x0a1f('0x3a')]=qs['limit'](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3a')]);_0x4ea4df[_0x0a1f('0x1b')]=qs[_0x0a1f('0x1b')](_0x24322a['query'][_0x0a1f('0x1b')]);}return _0x42667f['getConfigurations'](_0x4ea4df);}})[_0x0a1f('0x24')](function(_0x343893){if(_0x343893){return _0x343893?{'count':_0x50a715,'rows':_0x343893}:null;}})[_0x0a1f('0x24')](respondWithResult(_0x1f8d9f,null))['catch'](handleError(_0x1f8d9f,null));};exports[_0x0a1f('0x50')]=function(_0x93a507,_0x228170,_0xa3d62b){if(_0x93a507[_0x0a1f('0x4d')]['id']){delete _0x93a507[_0x0a1f('0x4d')]['id'];}return db[_0x0a1f('0x2d')]['findOne']({'where':{'id':_0x93a507[_0x0a1f('0x48')]['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x228170,null))[_0x0a1f('0x24')](function(_0x38ff70){if(_0x38ff70){_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x51')]=_0x38ff70['id'];_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x52')]=integrations[_0x0a1f('0x53')](_0x93a507['body'][_0x0a1f('0x54')],_0x93a507['body']['type']);_0x93a507['body'][_0x0a1f('0x55')]=integrations[_0x0a1f('0x56')](_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x54')],_0x93a507[_0x0a1f('0x4d')]['type']);return db[_0x0a1f('0x57')][_0x0a1f('0x4c')](_0x93a507[_0x0a1f('0x4d')],{'include':[{'model':db[_0x0a1f('0x58')],'as':_0x0a1f('0x52')},{'model':db[_0x0a1f('0x58')],'as':_0x0a1f('0x55')}]});}return null;})[_0x0a1f('0x24')](respondWithResult(_0x228170,null))[_0x0a1f('0x46')](handleError(_0x228170,null));};var md5=require(_0x0a1f('0x59'));exports[_0x0a1f('0x5a')]=function(_0x329b97,_0x1d7d78,_0x10fcf2){var _0x11b1e6=null;var _0x2f8942=null;var _0x495bb6=null;var _0x3c046c=null;var _0x2186af='';return db[_0x0a1f('0x2d')][_0x0a1f('0x4f')]({'where':{'id':_0x329b97[_0x0a1f('0x48')]['id']},'attributes':['id',_0x0a1f('0x29'),_0x0a1f('0x5b'),_0x0a1f('0x5c'),_0x0a1f('0x5d'),_0x0a1f('0x5e'),_0x0a1f('0x5f'),_0x0a1f('0x60')]})[_0x0a1f('0x24')](handleEntityNotFound(_0x1d7d78,null))['then'](function(_0x64bd25){if(_0x64bd25){_0x11b1e6=_0x64bd25[_0x0a1f('0x5b')];_0x2f8942=_0x64bd25[_0x0a1f('0x60')];_0x495bb6=_0x64bd25[_0x0a1f('0x5d')];_0x2186af=_0x64bd25['remoteUri'];var _0x5c4e7b=_0x2186af[_0x0a1f('0x61')](-0x1);if(_0x5c4e7b==='/'){_0x2186af=_0x2186af['substring'](0x0,_0x2186af[_0x0a1f('0x62')](_0x5c4e7b));}_0x3c046c=util['format']('%s/webservice.php',_0x2186af);var _0x73ce05={'method':'GET','uri':_0x3c046c,'qs':{'operation':'getchallenge','username':_0x64bd25[_0x0a1f('0x5b')]},'json':!![]};return rp(_0x73ce05);}})['then'](function(_0x49a579){if(_0x49a579[_0x0a1f('0x63')]){var _0x4c8496={'method':_0x0a1f('0x64'),'uri':_0x3c046c,'form':{'operation':_0x0a1f('0x65'),'username':_0x11b1e6,'accessKey':md5(_0x49a579[_0x0a1f('0x66')]['token']+_0x2f8942)},'json':!![]};return rp(_0x4c8496);}})[_0x0a1f('0x24')](function(_0x474658){if(_0x474658[_0x0a1f('0x63')]){var _0x62bea8={'method':'GET','uri':_0x3c046c,'qs':{'operation':_0x0a1f('0x67'),'username':_0x11b1e6,'sessionName':_0x474658['result']['sessionName'],'elementType':_0x495bb6},'json':!![]};return rp(_0x62bea8);}})['then'](function(_0x362752){if(_0x362752[_0x0a1f('0x63')]){var _0x261174=['autogenerated',_0x0a1f('0x68'),_0x0a1f('0x69')];_[_0x0a1f('0x6a')](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x3667d1){return _0x261174[_0x0a1f('0x6b')](_0x3667d1[_0x0a1f('0x40')][_0x0a1f('0x29')]);});_[_0x0a1f('0x6a')](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x1f4dd6){return _0x1f4dd6['editable']===_0x0a1f('0x6c');});return{'count':_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')][_0x0a1f('0x49')],'rows':_['map'](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x526806){return{'id':_0x526806[_0x0a1f('0x29')],'name':_0x526806['label'],'custom':_[_0x0a1f('0x6d')](_0x526806[_0x0a1f('0x29')],_0x0a1f('0x6e'))?!![]:![],'options':_0x526806[_0x0a1f('0x40')][_0x0a1f('0x29')]==='picklist'&&_0x526806[_0x0a1f('0x40')]['picklistValues']['length']>0x0?_['map'](_0x526806[_0x0a1f('0x40')][_0x0a1f('0x6f')],function(_0x5bdd4f){return{'name':_0x5bdd4f[_0x0a1f('0x70')],'value':_0x5bdd4f[_0x0a1f('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x1d7d78,null))[_0x0a1f('0x46')](function(_0x3c1dc5){console[_0x0a1f('0x72')](_0x0a1f('0x73')+_0x3c1dc5);var _0x183722=_0x329b97['query'][_0x0a1f('0x74')]?0x1f4:_0x3c1dc5[_0x0a1f('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0a1f('0x5a'),_0x183722,JSON['stringify'](_0x3c1dc5));delete _0x3c1dc5[_0x0a1f('0x29')];if(_0x183722===0x191){_0x183722=0x190;}_0x1d7d78[_0x0a1f('0x18')](_0x183722)[_0x0a1f('0x2a')](_0x329b97['query']['test']?{'message':_0x0a1f('0x76'),'statusCode':_0x3c1dc5['statusCode']}:_0x3c1dc5);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4d57305..6aa3518 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 _0xaa6a=['bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment'];(function(_0x18f9d1,_0x187373){var _0x31e587=function(_0x22c22c){while(--_0x22c22c){_0x18f9d1['push'](_0x18f9d1['shift']());}};_0x31e587(++_0x187373);}(_0xaa6a,0x1bb));var _0xaaa6=function(_0x54235f,_0x20516d){_0x54235f=_0x54235f-0x0;var _0x12e60d=_0xaa6a[_0x54235f];return _0x12e60d;};'use strict';var _=require(_0xaaa6('0x0'));var util=require(_0xaaa6('0x1'));var logger=require(_0xaaa6('0x2'))(_0xaaa6('0x3'));var moment=require(_0xaaa6('0x4'));var BPromise=require(_0xaaa6('0x5'));var rp=require(_0xaaa6('0x6'));var fs=require('fs');var path=require(_0xaaa6('0x7'));var rimraf=require(_0xaaa6('0x8'));var config=require('../../config/environment');var attributes=require(_0xaaa6('0x9'));var integrations=require(_0xaaa6('0xa'));module[_0xaaa6('0xb')]=function(_0x49425c,_0x465da3){return _0x49425c[_0xaaa6('0xc')](_0xaaa6('0xd'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5c0=['request-promise','path','rimraf','../../config/environment','exports','define','VtigerAccount','lodash','../../config/logger','api','bluebird'];(function(_0x23859c,_0x5f24eb){var _0x581bcd=function(_0xadf906){while(--_0xadf906){_0x23859c['push'](_0x23859c['shift']());}};_0x581bcd(++_0x5f24eb);}(_0xc5c0,0xac));var _0x0c5c=function(_0x35a758,_0x43cfb8){_0x35a758=_0x35a758-0x0;var _0x19bfa6=_0xc5c0[_0x35a758];return _0x19bfa6;};'use strict';var _=require(_0x0c5c('0x0'));var util=require('util');var logger=require(_0x0c5c('0x1'))(_0x0c5c('0x2'));var moment=require('moment');var BPromise=require(_0x0c5c('0x3'));var rp=require(_0x0c5c('0x4'));var fs=require('fs');var path=require(_0x0c5c('0x5'));var rimraf=require(_0x0c5c('0x6'));var config=require(_0x0c5c('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0c5c('0x8')]=function(_0x1cb67b,_0x58164c){return _0x1cb67b[_0x0c5c('0x9')](_0x0c5c('0xa'),attributes,{'tableName':'int_vtiger_accounts','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 2670b72..137493f 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 _0xe605=['include','map','model','ShowVtigerAccount','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe605,0x92));var _0x5e60=function(_0x17bc62,_0x20fb69){_0x17bc62=_0x17bc62-0x0;var _0x38f807=_0xe605[_0x17bc62];return _0x38f807;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')]({'raw':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'limit':_0x5c485d['options']?_0x5c485d[_0x5e60('0x19')]['limit']||null:null,'include':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')],function(_0x2636f1){return{'model':db[_0x2636f1['model']],'as':_0x2636f1['as'],'attributes':_0x2636f1[_0x5e60('0x1c')],'include':_0x2636f1[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2636f1['include'],function(_0x45cb62){return{'model':db[_0x45cb62[_0x5e60('0x1f')]],'as':_0x45cb62['as'],'attributes':_0x45cb62[_0x5e60('0x1c')],'include':_0x45cb62[_0x5e60('0x1d')]?_['map'](_0x45cb62[_0x5e60('0x1d')],function(_0x5712f7){return{'model':db[_0x5712f7[_0x5e60('0x1f')]],'as':_0x5712f7['as'],'attributes':_0x5712f7[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46691f){logger[_0x5e60('0xe')]('GetVtigerAccount',_0x5c485d);logger[_0x5e60('0x11')](_0x5e60('0x16'),_0x5c485d,JSON['stringify'](_0x46691f));_0x22d718(_0x46691f);})['catch'](function(_0x52f668){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x52f668[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x52f668[_0x5e60('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x168ce6){var _0x405461=this;return new Promise(function(_0x4d4b55,_0x11fc87){return db['VtigerAccount']['find']({'raw':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'include':_0x168ce6[_0x5e60('0x19')]?_0x168ce6['options'][_0x5e60('0x1d')]?_['map'](_0x168ce6['options'][_0x5e60('0x1d')],function(_0x317206){return{'model':db[_0x317206['model']],'as':_0x317206['as'],'attributes':_0x317206[_0x5e60('0x1c')],'include':_0x317206['include']?_[_0x5e60('0x1e')](_0x317206[_0x5e60('0x1d')],function(_0x2b2426){return{'model':db[_0x2b2426[_0x5e60('0x1f')]],'as':_0x2b2426['as'],'attributes':_0x2b2426[_0x5e60('0x1c')],'include':_0x2b2426[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2b2426[_0x5e60('0x1d')],function(_0x5b3aa5){return{'model':db[_0x5b3aa5[_0x5e60('0x1f')]],'as':_0x5b3aa5['as'],'attributes':_0x5b3aa5[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5e60('0xd')](function(_0x1a3782){logger[_0x5e60('0xe')](_0x5e60('0x20'),_0x168ce6);logger[_0x5e60('0x11')]('ShowVtigerAccount',_0x168ce6,JSON[_0x5e60('0x21')](_0x1a3782));_0x4d4b55(_0x1a3782);})[_0x5e60('0x22')](function(_0x4cba18){logger['error'](_0x5e60('0x20'),_0x4cba18[_0x5e60('0x14')],_0x168ce6);_0x11fc87(_0x405461[_0x5e60('0x12')](0x1f4,_0x4cba18[_0x5e60('0x14')]));});});}; \ No newline at end of file +var _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x473ac3,_0xf8066a){var _0x563cfd=function(_0x54b0eb){while(--_0x54b0eb){_0x473ac3['push'](_0x473ac3['shift']());}};_0x563cfd(++_0xf8066a);}(_0x0bb5,0x148));var _0x50bb=function(_0xe616ba,_0x1f2b4c){_0xe616ba=_0xe616ba-0x0;var _0x587b5b=_0x0bb5[_0xe616ba];return _0x587b5b;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a8ed74a..2827739 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 _0x0915=['./intVtigerConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x217685,_0x469d3a){var _0x6729f5=function(_0x2ef9d5){while(--_0x2ef9d5){_0x217685['push'](_0x217685['shift']());}};_0x6729f5(++_0x469d3a);}(_0x0915,0x1c1));var _0x5091=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x0915[_0x3b150c];return _0x5cd414;};'use strict';var multer=require('multer');var util=require(_0x5091('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5091('0x1'));var router=express[_0x5091('0x2')]();var fs_extra=require(_0x5091('0x3'));var auth=require(_0x5091('0x4'));var interaction=require(_0x5091('0x5'));var config=require(_0x5091('0x6'));var controller=require(_0x5091('0x7'));router[_0x5091('0x8')]('/',auth['isAuthenticated'](),controller[_0x5091('0x9')]);router['get'](_0x5091('0xa'),auth['isAuthenticated'](),controller[_0x5091('0xb')]);router['get'](_0x5091('0xc'),auth[_0x5091('0xd')](),controller[_0x5091('0xe')]);router[_0x5091('0x8')](_0x5091('0xf'),auth[_0x5091('0xd')](),controller[_0x5091('0x10')]);router[_0x5091('0x8')](_0x5091('0x11'),auth[_0x5091('0xd')](),controller[_0x5091('0x12')]);router[_0x5091('0x13')]('/',auth[_0x5091('0xd')](),controller[_0x5091('0x14')]);router[_0x5091('0x15')]('/:id',auth[_0x5091('0xd')](),controller[_0x5091('0x16')]);router['delete'](_0x5091('0xa'),auth[_0x5091('0xd')](),controller[_0x5091('0x17')]);module['exports']=router; \ No newline at end of file +var _0x62df=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','/:id','/:id/fields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x153f66,_0x378889){var _0x31dc3a=function(_0x15a3ea){while(--_0x15a3ea){_0x153f66['push'](_0x153f66['shift']());}};_0x31dc3a(++_0x378889);}(_0x62df,0x105));var _0xf62d=function(_0x1e2e4c,_0xd72dd4){_0x1e2e4c=_0x1e2e4c-0x0;var _0x5f50be=_0x62df[_0x1e2e4c];return _0x5f50be;};'use strict';var multer=require(_0xf62d('0x0'));var util=require(_0xf62d('0x1'));var path=require(_0xf62d('0x2'));var timeout=require(_0xf62d('0x3'));var express=require(_0xf62d('0x4'));var router=express[_0xf62d('0x5')]();var fs_extra=require(_0xf62d('0x6'));var auth=require(_0xf62d('0x7'));var interaction=require(_0xf62d('0x8'));var config=require(_0xf62d('0x9'));var controller=require(_0xf62d('0xa'));router['get']('/',auth[_0xf62d('0xb')](),controller[_0xf62d('0xc')]);router['get'](_0xf62d('0xd'),auth[_0xf62d('0xb')](),controller['show']);router['get'](_0xf62d('0xe'),auth[_0xf62d('0xb')](),controller['getFields']);router[_0xf62d('0xf')](_0xf62d('0x10'),auth[_0xf62d('0xb')](),controller[_0xf62d('0x11')]);router[_0xf62d('0xf')](_0xf62d('0x12'),auth['isAuthenticated'](),controller[_0xf62d('0x13')]);router[_0xf62d('0x14')]('/',auth[_0xf62d('0xb')](),controller[_0xf62d('0x15')]);router[_0xf62d('0x16')](_0xf62d('0xd'),auth['isAuthenticated'](),controller[_0xf62d('0x17')]);router[_0xf62d('0x18')]('/:id',auth[_0xf62d('0xb')](),controller[_0xf62d('0x19')]);module[_0xf62d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index e7215a8..7e57ace 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 _0x5121=['STRING','exports'];(function(_0xa3da82,_0x3be0c4){var _0x55a74=function(_0x4f0f76){while(--_0x4f0f76){_0xa3da82['push'](_0xa3da82['shift']());}};_0x55a74(++_0x3be0c4);}(_0x5121,0xe5));var _0x1512=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x5121[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require('sequelize');module[_0x1512('0x0')]={'name':{'type':Sequelize[_0x1512('0x1')]},'description':{'type':Sequelize[_0x1512('0x1')]}}; \ No newline at end of file +var _0x1d86=['sequelize','STRING'];(function(_0x3e151d,_0x5b96a8){var _0x10ad6a=function(_0x57fddf){while(--_0x57fddf){_0x3e151d['push'](_0x3e151d['shift']());}};_0x10ad6a(++_0x5b96a8);}(_0x1d86,0xe8));var _0x61d8=function(_0x2f61d3,_0x232a49){_0x2f61d3=_0x2f61d3-0x0;var _0xbdcdf9=_0x1d86[_0x2f61d3];return _0xbdcdf9;};'use strict';var Sequelize=require(_0x61d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x61d8('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2768784..10627a7 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 _0x6a2b=['merge','VIRTUAL','name','options','includeAll','include','rows','catch','params','VtigerConfiguration','find','create','body','destroy','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x4f994e,_0x57d326){var _0x4df8b6=function(_0x385c2e){while(--_0x385c2e){_0x4f994e['push'](_0x4f994e['shift']());}};_0x4df8b6(++_0x57d326);}(_0x6a2b,0x1e2));var _0xb6a2=function(_0x382c0f,_0x3ec282){_0x382c0f=_0x382c0f-0x0;var _0x42ec77=_0x6a2b[_0x382c0f];return _0x42ec77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6a2('0x0'));var zipdir=require(_0xb6a2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6a2('0x2'));var moment=require('moment');var BPromise=require(_0xb6a2('0x3'));var Mustache=require(_0xb6a2('0x4'));var util=require(_0xb6a2('0x5'));var path=require(_0xb6a2('0x6'));var sox=require('sox');var csv=require(_0xb6a2('0x7'));var ejs=require(_0xb6a2('0x8'));var fs=require('fs');var fs_extra=require(_0xb6a2('0x9'));var _=require(_0xb6a2('0xa'));var squel=require('squel');var crypto=require(_0xb6a2('0xb'));var jsforce=require(_0xb6a2('0xc'));var deskjs=require(_0xb6a2('0xd'));var toCsv=require(_0xb6a2('0x7'));var querystring=require(_0xb6a2('0xe'));var Papa=require('papaparse');var Redis=require(_0xb6a2('0xf'));var authService=require(_0xb6a2('0x10'));var qs=require(_0xb6a2('0x11'));var as=require(_0xb6a2('0x12'));var hardwareService=require(_0xb6a2('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb6a2('0x14'));var licenseUtil=require(_0xb6a2('0x15'));var db=require(_0xb6a2('0x16'))['db'];function respondWithStatusCode(_0x49c3c4,_0x218bfa){_0x218bfa=_0x218bfa||0xcc;return function(_0x5679fe){if(_0x5679fe){return _0x49c3c4[_0xb6a2('0x17')](_0x218bfa);}return _0x49c3c4[_0xb6a2('0x18')](_0x218bfa)[_0xb6a2('0x19')]();};}function respondWithResult(_0x3e61c3,_0x30654f){_0x30654f=_0x30654f||0xc8;return function(_0x4e28ca){if(_0x4e28ca){return _0x3e61c3['status'](_0x30654f)[_0xb6a2('0x1a')](_0x4e28ca);}};}function respondWithFilteredResult(_0x18e43b,_0x29417c){return function(_0x3019a8){if(_0x3019a8){var _0x5b68e8=typeof _0x29417c[_0xb6a2('0x1b')]===_0xb6a2('0x1c')&&typeof _0x29417c[_0xb6a2('0x1d')]==='undefined';var _0x1f3f2d=_0x3019a8[_0xb6a2('0x1e')];var _0x526f92=_0x5b68e8?0x0:_0x29417c['offset'];var _0x4d227b=_0x5b68e8?_0x3019a8[_0xb6a2('0x1e')]:_0x29417c['offset']+_0x29417c[_0xb6a2('0x1d')];var _0x276e7b;if(_0x4d227b>=_0x1f3f2d){_0x4d227b=_0x1f3f2d;_0x276e7b=0xc8;}else{_0x276e7b=0xce;}_0x18e43b['status'](_0x276e7b);return _0x18e43b[_0xb6a2('0x1f')](_0xb6a2('0x20'),_0x526f92+'-'+_0x4d227b+'/'+_0x1f3f2d)['json'](_0x3019a8);}return null;};}function patchUpdates(_0x495316){return function(_0x15a52e){try{jsonpatch[_0xb6a2('0x21')](_0x15a52e,_0x495316,!![]);}catch(_0x36abb3){return BPromise['reject'](_0x36abb3);}return _0x15a52e[_0xb6a2('0x22')]();};}function saveUpdates(_0x123f10,_0x971e33){return function(_0x2eb909){if(_0x2eb909){return _0x2eb909[_0xb6a2('0x23')](_0x123f10)[_0xb6a2('0x24')](function(_0x412603){return _0x412603;});}return null;};}function removeEntity(_0x11a696,_0x319c60){return function(_0x80fbce){if(_0x80fbce){return _0x80fbce['destroy']()[_0xb6a2('0x24')](function(){_0x11a696[_0xb6a2('0x18')](0xcc)[_0xb6a2('0x19')]();});}};}function handleEntityNotFound(_0xaba297,_0x307222){return function(_0x5fa4dc){if(!_0x5fa4dc){_0xaba297['sendStatus'](0x194);}return _0x5fa4dc;};}function handleError(_0x386138,_0x442369){_0x442369=_0x442369||0x1f4;return function(_0x6adfe3){logger['error'](_0x6adfe3[_0xb6a2('0x25')]);if(_0x6adfe3['name']){delete _0x6adfe3['name'];}_0x386138[_0xb6a2('0x18')](_0x442369)[_0xb6a2('0x26')](_0x6adfe3);};}exports['index']=function(_0x4dd5f5,_0x1603fb){var _0x4eab7d={},_0x16f3f0={},_0x17b97a={'count':0x0,'rows':[]};var _0x115968=_[_0xb6a2('0x27')](db['VtigerConfiguration'][_0xb6a2('0x28')],function(_0x31eeb8){return{'name':_0x31eeb8[_0xb6a2('0x29')],'type':_0x31eeb8[_0xb6a2('0x2a')]['key']};});_0x16f3f0[_0xb6a2('0x2b')]=_[_0xb6a2('0x27')](_0x115968,'name');_0x16f3f0[_0xb6a2('0x2c')]=_[_0xb6a2('0x2d')](_0x4dd5f5[_0xb6a2('0x2c')]);_0x16f3f0[_0xb6a2('0x2e')]=_[_0xb6a2('0x2f')](_0x16f3f0[_0xb6a2('0x2b')],_0x16f3f0[_0xb6a2('0x2c')]);_0x4eab7d[_0xb6a2('0x30')]=_[_0xb6a2('0x2f')](_0x16f3f0[_0xb6a2('0x2b')],qs[_0xb6a2('0x31')](_0x4dd5f5['query'][_0xb6a2('0x31')]));_0x4eab7d[_0xb6a2('0x30')]=_0x4eab7d['attributes'][_0xb6a2('0x32')]?_0x4eab7d['attributes']:_0x16f3f0[_0xb6a2('0x2b')];if(!_0x4dd5f5['query']['hasOwnProperty'](_0xb6a2('0x33'))){_0x4eab7d[_0xb6a2('0x1d')]=qs[_0xb6a2('0x1d')](_0x4dd5f5[_0xb6a2('0x2c')][_0xb6a2('0x1d')]);_0x4eab7d[_0xb6a2('0x1b')]=qs['offset'](_0x4dd5f5[_0xb6a2('0x2c')][_0xb6a2('0x1b')]);}_0x4eab7d[_0xb6a2('0x34')]=qs[_0xb6a2('0x35')](_0x4dd5f5[_0xb6a2('0x2c')]['sort']);_0x4eab7d[_0xb6a2('0x36')]=qs[_0xb6a2('0x2e')](_[_0xb6a2('0x37')](_0x4dd5f5['query'],_0x16f3f0[_0xb6a2('0x2e')]),_0x115968);if(_0x4dd5f5[_0xb6a2('0x2c')][_0xb6a2('0x38')]){_0x4eab7d['where']=_[_0xb6a2('0x39')](_0x4eab7d[_0xb6a2('0x36')],{'$or':_[_0xb6a2('0x27')](_0x115968,function(_0x23c546){if(_0x23c546[_0xb6a2('0x2a')]!==_0xb6a2('0x3a')){var _0x2a7566={};_0x2a7566[_0x23c546[_0xb6a2('0x3b')]]={'$like':'%'+_0x4dd5f5['query'][_0xb6a2('0x38')]+'%'};return _0x2a7566;}})});}_0x4eab7d=_[_0xb6a2('0x39')]({},_0x4eab7d,_0x4dd5f5[_0xb6a2('0x3c')]);var _0x5d763c={'where':_0x4eab7d[_0xb6a2('0x36')]};return db['VtigerConfiguration'][_0xb6a2('0x1e')](_0x5d763c)['then'](function(_0x146000){_0x17b97a['count']=_0x146000;if(_0x4dd5f5['query'][_0xb6a2('0x3d')]){_0x4eab7d[_0xb6a2('0x3e')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x4eab7d);})[_0xb6a2('0x24')](function(_0x5b583e){_0x17b97a[_0xb6a2('0x3f')]=_0x5b583e;return _0x17b97a;})[_0xb6a2('0x24')](respondWithFilteredResult(_0x1603fb,_0x4eab7d))[_0xb6a2('0x40')](handleError(_0x1603fb,null));};exports['show']=function(_0x36b575,_0x5e6eae){var _0x2719ee={'raw':![],'where':{'id':_0x36b575[_0xb6a2('0x41')]['id']}},_0xda45a2={};_0xda45a2[_0xb6a2('0x2b')]=_[_0xb6a2('0x2d')](db[_0xb6a2('0x42')][_0xb6a2('0x28')]);_0xda45a2['query']=_['keys'](_0x36b575[_0xb6a2('0x2c')]);_0xda45a2['filters']=_['intersection'](_0xda45a2[_0xb6a2('0x2b')],_0xda45a2[_0xb6a2('0x2c')]);_0x2719ee[_0xb6a2('0x30')]=_[_0xb6a2('0x2f')](_0xda45a2[_0xb6a2('0x2b')],qs[_0xb6a2('0x31')](_0x36b575[_0xb6a2('0x2c')][_0xb6a2('0x31')]));_0x2719ee[_0xb6a2('0x30')]=_0x2719ee[_0xb6a2('0x30')]['length']?_0x2719ee[_0xb6a2('0x30')]:_0xda45a2[_0xb6a2('0x2b')];if(_0x36b575[_0xb6a2('0x2c')][_0xb6a2('0x3d')]){_0x2719ee[_0xb6a2('0x3e')]=[{'all':!![]}];}_0x2719ee=_[_0xb6a2('0x39')]({},_0x2719ee,_0x36b575[_0xb6a2('0x3c')]);return db['VtigerConfiguration'][_0xb6a2('0x43')](_0x2719ee)[_0xb6a2('0x24')](handleEntityNotFound(_0x5e6eae,null))[_0xb6a2('0x24')](respondWithResult(_0x5e6eae,null))[_0xb6a2('0x40')](handleError(_0x5e6eae,null));};exports['create']=function(_0xca538f,_0x5f5569){return db[_0xb6a2('0x42')][_0xb6a2('0x44')](_0xca538f[_0xb6a2('0x45')],{})[_0xb6a2('0x24')](respondWithResult(_0x5f5569,0xc9))['catch'](handleError(_0x5f5569,null));};exports[_0xb6a2('0x23')]=function(_0x1027a6,_0x2594ec){if(_0x1027a6['body']['id']){delete _0x1027a6['body']['id'];}return db[_0xb6a2('0x42')][_0xb6a2('0x43')]({'where':{'id':_0x1027a6['params']['id']}})[_0xb6a2('0x24')](handleEntityNotFound(_0x2594ec,null))[_0xb6a2('0x24')](saveUpdates(_0x1027a6['body'],null))[_0xb6a2('0x24')](respondWithResult(_0x2594ec,null))[_0xb6a2('0x40')](handleError(_0x2594ec,null));};exports[_0xb6a2('0x46')]=function(_0x50f806,_0x2abd06){return db[_0xb6a2('0x42')][_0xb6a2('0x43')]({'where':{'id':_0x50f806[_0xb6a2('0x41')]['id']}})[_0xb6a2('0x24')](handleEntityNotFound(_0x2abd06,null))['then'](removeEntity(_0x2abd06,null))['catch'](handleError(_0x2abd06,null));};exports[_0xb6a2('0x47')]=function(_0x46867c,_0x55cdac,_0x263009){var _0x1b4412={};var _0x5a8634={};var _0x29a0b2;var _0x5f5c1d;return db['VtigerConfiguration'][_0xb6a2('0x48')]({'where':{'id':_0x46867c[_0xb6a2('0x41')]['id']}})[_0xb6a2('0x24')](handleEntityNotFound(_0x55cdac,null))[_0xb6a2('0x24')](function(_0xd23819){if(_0xd23819){_0x29a0b2=_0xd23819;_0x5a8634[_0xb6a2('0x2b')]=_[_0xb6a2('0x2d')](db[_0xb6a2('0x49')][_0xb6a2('0x28')]);_0x5a8634['query']=_[_0xb6a2('0x2d')](_0x46867c['query']);_0x5a8634[_0xb6a2('0x2e')]=_['intersection'](_0x5a8634[_0xb6a2('0x2b')],_0x5a8634['query']);_0x1b4412[_0xb6a2('0x30')]=_[_0xb6a2('0x2f')](_0x5a8634['model'],qs[_0xb6a2('0x31')](_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x31')]));_0x1b4412[_0xb6a2('0x30')]=_0x1b4412[_0xb6a2('0x30')]['length']?_0x1b4412[_0xb6a2('0x30')]:_0x5a8634[_0xb6a2('0x2b')];_0x1b4412['order']=qs['sort'](_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x35')]);_0x1b4412['where']=qs[_0xb6a2('0x2e')](_[_0xb6a2('0x37')](_0x46867c[_0xb6a2('0x2c')],_0x5a8634[_0xb6a2('0x2e')]));if(_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x38')]){_0x1b4412[_0xb6a2('0x36')]=_['merge'](_0x1b4412[_0xb6a2('0x36')],{'$or':_[_0xb6a2('0x27')](_0x1b4412['attributes'],function(_0x4e959d){var _0x54b31a={};_0x54b31a[_0x4e959d]={'$like':'%'+_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x38')]+'%'};return _0x54b31a;})});}_0x1b4412=_[_0xb6a2('0x39')]({},_0x1b4412,_0x46867c[_0xb6a2('0x3c')]);return _0x29a0b2['getFields'](_0x1b4412);}})['then'](function(_0x1a95d2){if(_0x1a95d2){_0x5f5c1d=_0x1a95d2[_0xb6a2('0x32')];if(!_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x4a')](_0xb6a2('0x33'))){_0x1b4412[_0xb6a2('0x1d')]=qs['limit'](_0x46867c[_0xb6a2('0x2c')][_0xb6a2('0x1d')]);_0x1b4412['offset']=qs[_0xb6a2('0x1b')](_0x46867c[_0xb6a2('0x2c')]['offset']);}return _0x29a0b2[_0xb6a2('0x47')](_0x1b4412);}})['then'](function(_0x2d90aa){if(_0x2d90aa){return _0x2d90aa?{'count':_0x5f5c1d,'rows':_0x2d90aa}:null;}})[_0xb6a2('0x24')](respondWithResult(_0x55cdac,null))[_0xb6a2('0x40')](handleError(_0x55cdac,null));};exports[_0xb6a2('0x4b')]=function(_0x37ef00,_0x275ac8,_0x468ac4){var _0x4ca154={};var _0x347bac={};var _0xe80adf;var _0x12ea3e;return db[_0xb6a2('0x42')][_0xb6a2('0x48')]({'where':{'id':_0x37ef00[_0xb6a2('0x41')]['id']}})['then'](handleEntityNotFound(_0x275ac8,null))['then'](function(_0x55153a){if(_0x55153a){_0xe80adf=_0x55153a;_0x347bac[_0xb6a2('0x2b')]=_[_0xb6a2('0x2d')](db['VtigerField'][_0xb6a2('0x28')]);_0x347bac[_0xb6a2('0x2c')]=_[_0xb6a2('0x2d')](_0x37ef00[_0xb6a2('0x2c')]);_0x347bac[_0xb6a2('0x2e')]=_[_0xb6a2('0x2f')](_0x347bac[_0xb6a2('0x2b')],_0x347bac[_0xb6a2('0x2c')]);_0x4ca154[_0xb6a2('0x30')]=_['intersection'](_0x347bac[_0xb6a2('0x2b')],qs[_0xb6a2('0x31')](_0x37ef00['query']['fields']));_0x4ca154[_0xb6a2('0x30')]=_0x4ca154[_0xb6a2('0x30')]['length']?_0x4ca154[_0xb6a2('0x30')]:_0x347bac[_0xb6a2('0x2b')];_0x4ca154[_0xb6a2('0x34')]=qs[_0xb6a2('0x35')](_0x37ef00[_0xb6a2('0x2c')]['sort']);_0x4ca154['where']=qs[_0xb6a2('0x2e')](_['pick'](_0x37ef00[_0xb6a2('0x2c')],_0x347bac[_0xb6a2('0x2e')]));if(_0x37ef00[_0xb6a2('0x2c')]['filter']){_0x4ca154['where']=_[_0xb6a2('0x39')](_0x4ca154[_0xb6a2('0x36')],{'$or':_[_0xb6a2('0x27')](_0x4ca154[_0xb6a2('0x30')],function(_0x1e4aae){var _0x427c1e={};_0x427c1e[_0x1e4aae]={'$like':'%'+_0x37ef00[_0xb6a2('0x2c')][_0xb6a2('0x38')]+'%'};return _0x427c1e;})});}_0x4ca154=_[_0xb6a2('0x39')]({},_0x4ca154,_0x37ef00[_0xb6a2('0x3c')]);return _0xe80adf[_0xb6a2('0x4b')](_0x4ca154);}})['then'](function(_0x282120){if(_0x282120){_0x12ea3e=_0x282120[_0xb6a2('0x32')];if(!_0x37ef00[_0xb6a2('0x2c')][_0xb6a2('0x4a')]('nolimit')){_0x4ca154[_0xb6a2('0x1d')]=qs[_0xb6a2('0x1d')](_0x37ef00[_0xb6a2('0x2c')]['limit']);_0x4ca154[_0xb6a2('0x1b')]=qs[_0xb6a2('0x1b')](_0x37ef00[_0xb6a2('0x2c')][_0xb6a2('0x1b')]);}return _0xe80adf[_0xb6a2('0x4b')](_0x4ca154);}})['then'](function(_0x49521){if(_0x49521){return _0x49521?{'count':_0x12ea3e,'rows':_0x49521}:null;}})['then'](respondWithResult(_0x275ac8,null))[_0xb6a2('0x40')](handleError(_0x275ac8,null));};exports[_0xb6a2('0x4c')]=function(_0x217afc,_0x4c3139,_0x199f49){var _0x55aa83={};var _0x3ba223={};var _0x5ced18;var _0xaa8f62;return db['VtigerConfiguration'][_0xb6a2('0x48')]({'where':{'id':_0x217afc[_0xb6a2('0x41')]['id']}})[_0xb6a2('0x24')](handleEntityNotFound(_0x4c3139,null))['then'](function(_0x3ae288){if(_0x3ae288){_0x5ced18=_0x3ae288;_0x3ba223[_0xb6a2('0x2b')]=_[_0xb6a2('0x2d')](db[_0xb6a2('0x49')][_0xb6a2('0x28')]);_0x3ba223['query']=_[_0xb6a2('0x2d')](_0x217afc['query']);_0x3ba223[_0xb6a2('0x2e')]=_[_0xb6a2('0x2f')](_0x3ba223[_0xb6a2('0x2b')],_0x3ba223[_0xb6a2('0x2c')]);_0x55aa83[_0xb6a2('0x30')]=_[_0xb6a2('0x2f')](_0x3ba223[_0xb6a2('0x2b')],qs[_0xb6a2('0x31')](_0x217afc['query'][_0xb6a2('0x31')]));_0x55aa83[_0xb6a2('0x30')]=_0x55aa83['attributes'][_0xb6a2('0x32')]?_0x55aa83[_0xb6a2('0x30')]:_0x3ba223[_0xb6a2('0x2b')];_0x55aa83[_0xb6a2('0x34')]=qs[_0xb6a2('0x35')](_0x217afc[_0xb6a2('0x2c')]['sort']);_0x55aa83[_0xb6a2('0x36')]=qs[_0xb6a2('0x2e')](_[_0xb6a2('0x37')](_0x217afc[_0xb6a2('0x2c')],_0x3ba223['filters']));if(_0x217afc[_0xb6a2('0x2c')][_0xb6a2('0x38')]){_0x55aa83['where']=_[_0xb6a2('0x39')](_0x55aa83[_0xb6a2('0x36')],{'$or':_[_0xb6a2('0x27')](_0x55aa83[_0xb6a2('0x30')],function(_0x37a4fb){var _0x2fd635={};_0x2fd635[_0x37a4fb]={'$like':'%'+_0x217afc[_0xb6a2('0x2c')][_0xb6a2('0x38')]+'%'};return _0x2fd635;})});}_0x55aa83=_['merge']({},_0x55aa83,_0x217afc['options']);return _0x5ced18[_0xb6a2('0x4c')](_0x55aa83);}})['then'](function(_0x27f6ad){if(_0x27f6ad){_0xaa8f62=_0x27f6ad[_0xb6a2('0x32')];if(!_0x217afc['query'][_0xb6a2('0x4a')](_0xb6a2('0x33'))){_0x55aa83[_0xb6a2('0x1d')]=qs[_0xb6a2('0x1d')](_0x217afc['query'][_0xb6a2('0x1d')]);_0x55aa83[_0xb6a2('0x1b')]=qs[_0xb6a2('0x1b')](_0x217afc[_0xb6a2('0x2c')][_0xb6a2('0x1b')]);}return _0x5ced18[_0xb6a2('0x4c')](_0x55aa83);}})[_0xb6a2('0x24')](function(_0x1179e0){if(_0x1179e0){return _0x1179e0?{'count':_0xaa8f62,'rows':_0x1179e0}:null;}})[_0xb6a2('0x24')](respondWithResult(_0x4c3139,null))['catch'](handleError(_0x4c3139,null));}; \ No newline at end of file +var _0xb1db=['mustache','util','path','sox','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','catch','params','includeAll','include','merge','find','create','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xb1db,0x1be));var _0xbb1d=function(_0x7b102d,_0x414b58){_0x7b102d=_0x7b102d-0x0;var _0x235e07=_0xb1db[_0x7b102d];return _0x235e07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbb1d('0x0'));var rp=require(_0xbb1d('0x1'));var moment=require(_0xbb1d('0x2'));var BPromise=require(_0xbb1d('0x3'));var Mustache=require(_0xbb1d('0x4'));var util=require(_0xbb1d('0x5'));var path=require(_0xbb1d('0x6'));var sox=require(_0xbb1d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb1d('0x8'));var squel=require('squel');var crypto=require(_0xbb1d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbb1d('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb1d('0xb'));var Redis=require(_0xbb1d('0xc'));var authService=require(_0xbb1d('0xd'));var qs=require(_0xbb1d('0xe'));var as=require(_0xbb1d('0xf'));var hardwareService=require(_0xbb1d('0x10'));var logger=require(_0xbb1d('0x11'))('api');var utils=require(_0xbb1d('0x12'));var config=require(_0xbb1d('0x13'));var licenseUtil=require(_0xbb1d('0x14'));var db=require(_0xbb1d('0x15'))['db'];function respondWithStatusCode(_0x306a5e,_0x5b745a){_0x5b745a=_0x5b745a||0xcc;return function(_0x12bbfb){if(_0x12bbfb){return _0x306a5e['sendStatus'](_0x5b745a);}return _0x306a5e[_0xbb1d('0x16')](_0x5b745a)[_0xbb1d('0x17')]();};}function respondWithResult(_0x5c77a7,_0x42bf50){_0x42bf50=_0x42bf50||0xc8;return function(_0x24c0a0){if(_0x24c0a0){return _0x5c77a7['status'](_0x42bf50)[_0xbb1d('0x18')](_0x24c0a0);}};}function respondWithFilteredResult(_0x35e3b4,_0x299f42){return function(_0x508d62){if(_0x508d62){var _0x823303=typeof _0x299f42[_0xbb1d('0x19')]===_0xbb1d('0x1a')&&typeof _0x299f42[_0xbb1d('0x1b')]===_0xbb1d('0x1a');var _0x3a6754=_0x508d62[_0xbb1d('0x1c')];var _0x3454a0=_0x823303?0x0:_0x299f42['offset'];var _0x2305a7=_0x823303?_0x508d62[_0xbb1d('0x1c')]:_0x299f42['offset']+_0x299f42['limit'];var _0x12f69e;if(_0x2305a7>=_0x3a6754){_0x2305a7=_0x3a6754;_0x12f69e=0xc8;}else{_0x12f69e=0xce;}_0x35e3b4[_0xbb1d('0x16')](_0x12f69e);return _0x35e3b4[_0xbb1d('0x1d')](_0xbb1d('0x1e'),_0x3454a0+'-'+_0x2305a7+'/'+_0x3a6754)[_0xbb1d('0x18')](_0x508d62);}return null;};}function patchUpdates(_0x3fa0f1){return function(_0x19e2f0){try{jsonpatch['apply'](_0x19e2f0,_0x3fa0f1,!![]);}catch(_0x364395){return BPromise['reject'](_0x364395);}return _0x19e2f0['save']();};}function saveUpdates(_0x1b19a6,_0x150a55){return function(_0x35e867){if(_0x35e867){return _0x35e867[_0xbb1d('0x1f')](_0x1b19a6)[_0xbb1d('0x20')](function(_0x3223f7){return _0x3223f7;});}return null;};}function removeEntity(_0x31b38a,_0xe9f35a){return function(_0x4a296b){if(_0x4a296b){return _0x4a296b[_0xbb1d('0x21')]()[_0xbb1d('0x20')](function(){_0x31b38a[_0xbb1d('0x16')](0xcc)[_0xbb1d('0x17')]();});}};}function handleEntityNotFound(_0x86e9ec,_0x9678c0){return function(_0x18f75e){if(!_0x18f75e){_0x86e9ec['sendStatus'](0x194);}return _0x18f75e;};}function handleError(_0x41c770,_0x59afb9){_0x59afb9=_0x59afb9||0x1f4;return function(_0x42e3ea){logger[_0xbb1d('0x22')](_0x42e3ea[_0xbb1d('0x23')]);if(_0x42e3ea[_0xbb1d('0x24')]){delete _0x42e3ea[_0xbb1d('0x24')];}_0x41c770[_0xbb1d('0x16')](_0x59afb9)[_0xbb1d('0x25')](_0x42e3ea);};}exports[_0xbb1d('0x26')]=function(_0x4173b7,_0x82af72){var _0x107e35={},_0x1bc70c={},_0x9bc6aa={'count':0x0,'rows':[]};var _0x1db0cc=_[_0xbb1d('0x27')](db[_0xbb1d('0x28')][_0xbb1d('0x29')],function(_0xcd3c94){return{'name':_0xcd3c94[_0xbb1d('0x2a')],'type':_0xcd3c94[_0xbb1d('0x2b')][_0xbb1d('0x2c')]};});_0x1bc70c[_0xbb1d('0x2d')]=_[_0xbb1d('0x27')](_0x1db0cc,_0xbb1d('0x24'));_0x1bc70c[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x4173b7['query']);_0x1bc70c[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x1bc70c[_0xbb1d('0x2d')],_0x1bc70c[_0xbb1d('0x2e')]);_0x107e35[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x1bc70c[_0xbb1d('0x2d')],qs['fields'](_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x107e35[_0xbb1d('0x32')]=_0x107e35[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x107e35['attributes']:_0x1bc70c[_0xbb1d('0x2d')];if(!_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x107e35[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x1b')]);_0x107e35[_0xbb1d('0x19')]=qs['offset'](_0x4173b7['query']['offset']);}_0x107e35[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x4173b7['query']['sort']);_0x107e35[_0xbb1d('0x39')]=qs['filters'](_['pick'](_0x4173b7['query'],_0x1bc70c[_0xbb1d('0x30')]),_0x1db0cc);if(_0x4173b7['query'][_0xbb1d('0x3a')]){_0x107e35[_0xbb1d('0x39')]=_['merge'](_0x107e35[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x1db0cc,function(_0x29f534){if(_0x29f534[_0xbb1d('0x2b')]!==_0xbb1d('0x3b')){var _0x53206f={};_0x53206f[_0x29f534[_0xbb1d('0x24')]]={'$like':'%'+_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x3a')]+'%'};return _0x53206f;}})});}_0x107e35=_['merge']({},_0x107e35,_0x4173b7[_0xbb1d('0x3c')]);var _0x1f1090={'where':_0x107e35[_0xbb1d('0x39')]};return db[_0xbb1d('0x28')][_0xbb1d('0x1c')](_0x1f1090)[_0xbb1d('0x20')](function(_0x5149c5){_0x9bc6aa['count']=_0x5149c5;if(_0x4173b7['query']['includeAll']){_0x107e35['include']=[{'all':!![]}];}return db[_0xbb1d('0x28')]['findAll'](_0x107e35);})[_0xbb1d('0x20')](function(_0x4447fe){_0x9bc6aa['rows']=_0x4447fe;return _0x9bc6aa;})['then'](respondWithFilteredResult(_0x82af72,_0x107e35))[_0xbb1d('0x3d')](handleError(_0x82af72,null));};exports['show']=function(_0x2a7847,_0x3b18ff){var _0x526377={'raw':![],'where':{'id':_0x2a7847[_0xbb1d('0x3e')]['id']}},_0x46d5e9={};_0x46d5e9['model']=_[_0xbb1d('0x2f')](db[_0xbb1d('0x28')][_0xbb1d('0x29')]);_0x46d5e9['query']=_[_0xbb1d('0x2f')](_0x2a7847[_0xbb1d('0x2e')]);_0x46d5e9['filters']=_[_0xbb1d('0x31')](_0x46d5e9['model'],_0x46d5e9['query']);_0x526377[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x46d5e9[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x2a7847['query'][_0xbb1d('0x33')]));_0x526377[_0xbb1d('0x32')]=_0x526377['attributes'][_0xbb1d('0x34')]?_0x526377[_0xbb1d('0x32')]:_0x46d5e9[_0xbb1d('0x2d')];if(_0x2a7847[_0xbb1d('0x2e')][_0xbb1d('0x3f')]){_0x526377[_0xbb1d('0x40')]=[{'all':!![]}];}_0x526377=_[_0xbb1d('0x41')]({},_0x526377,_0x2a7847[_0xbb1d('0x3c')]);return db[_0xbb1d('0x28')][_0xbb1d('0x42')](_0x526377)[_0xbb1d('0x20')](handleEntityNotFound(_0x3b18ff,null))['then'](respondWithResult(_0x3b18ff,null))[_0xbb1d('0x3d')](handleError(_0x3b18ff,null));};exports[_0xbb1d('0x43')]=function(_0x133f0a,_0x1a48ae){return db[_0xbb1d('0x28')]['create'](_0x133f0a[_0xbb1d('0x44')],{})[_0xbb1d('0x20')](respondWithResult(_0x1a48ae,0xc9))['catch'](handleError(_0x1a48ae,null));};exports[_0xbb1d('0x1f')]=function(_0x5b2ccc,_0x596602){if(_0x5b2ccc[_0xbb1d('0x44')]['id']){delete _0x5b2ccc[_0xbb1d('0x44')]['id'];}return db[_0xbb1d('0x28')]['find']({'where':{'id':_0x5b2ccc[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x596602,null))[_0xbb1d('0x20')](saveUpdates(_0x5b2ccc[_0xbb1d('0x44')],null))[_0xbb1d('0x20')](respondWithResult(_0x596602,null))[_0xbb1d('0x3d')](handleError(_0x596602,null));};exports[_0xbb1d('0x21')]=function(_0x450885,_0x29be01){return db['VtigerConfiguration'][_0xbb1d('0x42')]({'where':{'id':_0x450885[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x29be01,null))[_0xbb1d('0x20')](removeEntity(_0x29be01,null))[_0xbb1d('0x3d')](handleError(_0x29be01,null));};exports[_0xbb1d('0x45')]=function(_0x15c858,_0x312ad3,_0x5bf156){var _0x3bf167={};var _0x4cfb7e={};var _0x449938;var _0xfe7278;return db[_0xbb1d('0x28')][_0xbb1d('0x46')]({'where':{'id':_0x15c858[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x312ad3,null))[_0xbb1d('0x20')](function(_0x153cfc){if(_0x153cfc){_0x449938=_0x153cfc;_0x4cfb7e[_0xbb1d('0x2d')]=_[_0xbb1d('0x2f')](db[_0xbb1d('0x47')][_0xbb1d('0x29')]);_0x4cfb7e[_0xbb1d('0x2e')]=_['keys'](_0x15c858[_0xbb1d('0x2e')]);_0x4cfb7e[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x4cfb7e[_0xbb1d('0x2d')],_0x4cfb7e[_0xbb1d('0x2e')]);_0x3bf167[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x4cfb7e[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x3bf167[_0xbb1d('0x32')]=_0x3bf167['attributes'][_0xbb1d('0x34')]?_0x3bf167[_0xbb1d('0x32')]:_0x4cfb7e['model'];_0x3bf167[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x15c858['query'][_0xbb1d('0x38')]);_0x3bf167[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x15c858['query'],_0x4cfb7e['filters']));if(_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x3a')]){_0x3bf167['where']=_[_0xbb1d('0x41')](_0x3bf167[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x3bf167[_0xbb1d('0x32')],function(_0x315189){var _0x57ee51={};_0x57ee51[_0x315189]={'$like':'%'+_0x15c858[_0xbb1d('0x2e')]['filter']+'%'};return _0x57ee51;})});}_0x3bf167=_[_0xbb1d('0x41')]({},_0x3bf167,_0x15c858[_0xbb1d('0x3c')]);return _0x449938[_0xbb1d('0x45')](_0x3bf167);}})['then'](function(_0x3277d0){if(_0x3277d0){_0xfe7278=_0x3277d0[_0xbb1d('0x34')];if(!_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x3bf167[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x1b')]);_0x3bf167[_0xbb1d('0x19')]=qs[_0xbb1d('0x19')](_0x15c858['query']['offset']);}return _0x449938[_0xbb1d('0x45')](_0x3bf167);}})[_0xbb1d('0x20')](function(_0x3f9869){if(_0x3f9869){return _0x3f9869?{'count':_0xfe7278,'rows':_0x3f9869}:null;}})[_0xbb1d('0x20')](respondWithResult(_0x312ad3,null))[_0xbb1d('0x3d')](handleError(_0x312ad3,null));};exports['getSubjects']=function(_0x43770d,_0xc66624,_0x51b86c){var _0x5262cc={};var _0x4ceadd={};var _0x2b2536;var _0x2b128d;return db[_0xbb1d('0x28')][_0xbb1d('0x46')]({'where':{'id':_0x43770d[_0xbb1d('0x3e')]['id']}})[_0xbb1d('0x20')](handleEntityNotFound(_0xc66624,null))[_0xbb1d('0x20')](function(_0x13de43){if(_0x13de43){_0x2b2536=_0x13de43;_0x4ceadd[_0xbb1d('0x2d')]=_[_0xbb1d('0x2f')](db[_0xbb1d('0x47')][_0xbb1d('0x29')]);_0x4ceadd[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x43770d['query']);_0x4ceadd[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x4ceadd[_0xbb1d('0x2d')],_0x4ceadd[_0xbb1d('0x2e')]);_0x5262cc[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x4ceadd[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x43770d[_0xbb1d('0x2e')]['fields']));_0x5262cc[_0xbb1d('0x32')]=_0x5262cc[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x5262cc[_0xbb1d('0x32')]:_0x4ceadd[_0xbb1d('0x2d')];_0x5262cc['order']=qs[_0xbb1d('0x38')](_0x43770d['query'][_0xbb1d('0x38')]);_0x5262cc[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x43770d[_0xbb1d('0x2e')],_0x4ceadd[_0xbb1d('0x30')]));if(_0x43770d['query'][_0xbb1d('0x3a')]){_0x5262cc[_0xbb1d('0x39')]=_[_0xbb1d('0x41')](_0x5262cc[_0xbb1d('0x39')],{'$or':_['map'](_0x5262cc['attributes'],function(_0x5932a9){var _0x5f5292={};_0x5f5292[_0x5932a9]={'$like':'%'+_0x43770d['query'][_0xbb1d('0x3a')]+'%'};return _0x5f5292;})});}_0x5262cc=_['merge']({},_0x5262cc,_0x43770d[_0xbb1d('0x3c')]);return _0x2b2536[_0xbb1d('0x49')](_0x5262cc);}})[_0xbb1d('0x20')](function(_0x559fd8){if(_0x559fd8){_0x2b128d=_0x559fd8[_0xbb1d('0x34')];if(!_0x43770d[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x5262cc[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x43770d[_0xbb1d('0x2e')]['limit']);_0x5262cc[_0xbb1d('0x19')]=qs['offset'](_0x43770d[_0xbb1d('0x2e')][_0xbb1d('0x19')]);}return _0x2b2536['getSubjects'](_0x5262cc);}})[_0xbb1d('0x20')](function(_0x2349b9){if(_0x2349b9){return _0x2349b9?{'count':_0x2b128d,'rows':_0x2349b9}:null;}})[_0xbb1d('0x20')](respondWithResult(_0xc66624,null))[_0xbb1d('0x3d')](handleError(_0xc66624,null));};exports[_0xbb1d('0x4a')]=function(_0x12c2b3,_0x1a14e2,_0x23233e){var _0x2c15b4={};var _0x2715fb={};var _0xd9afc8;var _0xffd31d;return db['VtigerConfiguration'][_0xbb1d('0x46')]({'where':{'id':_0x12c2b3[_0xbb1d('0x3e')]['id']}})[_0xbb1d('0x20')](handleEntityNotFound(_0x1a14e2,null))[_0xbb1d('0x20')](function(_0x152303){if(_0x152303){_0xd9afc8=_0x152303;_0x2715fb['model']=_[_0xbb1d('0x2f')](db['VtigerField']['rawAttributes']);_0x2715fb[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x12c2b3[_0xbb1d('0x2e')]);_0x2715fb[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x2715fb[_0xbb1d('0x2d')],_0x2715fb[_0xbb1d('0x2e')]);_0x2c15b4[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x2715fb['model'],qs[_0xbb1d('0x33')](_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x2c15b4['attributes']=_0x2c15b4[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x2c15b4['attributes']:_0x2715fb[_0xbb1d('0x2d')];_0x2c15b4[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x12c2b3['query'][_0xbb1d('0x38')]);_0x2c15b4[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x12c2b3[_0xbb1d('0x2e')],_0x2715fb['filters']));if(_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x3a')]){_0x2c15b4[_0xbb1d('0x39')]=_[_0xbb1d('0x41')](_0x2c15b4[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x2c15b4[_0xbb1d('0x32')],function(_0x4202f2){var _0x25ac1d={};_0x25ac1d[_0x4202f2]={'$like':'%'+_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x3a')]+'%'};return _0x25ac1d;})});}_0x2c15b4=_[_0xbb1d('0x41')]({},_0x2c15b4,_0x12c2b3['options']);return _0xd9afc8['getDescriptions'](_0x2c15b4);}})[_0xbb1d('0x20')](function(_0x577a72){if(_0x577a72){_0xffd31d=_0x577a72[_0xbb1d('0x34')];if(!_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x2c15b4[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x12c2b3['query']['limit']);_0x2c15b4['offset']=qs[_0xbb1d('0x19')](_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x19')]);}return _0xd9afc8[_0xbb1d('0x4a')](_0x2c15b4);}})[_0xbb1d('0x20')](function(_0x1a0d4c){if(_0x1a0d4c){return _0x1a0d4c?{'count':_0xffd31d,'rows':_0x1a0d4c}:null;}})[_0xbb1d('0x20')](respondWithResult(_0x1a14e2,null))['catch'](handleError(_0x1a14e2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 50ad005..a13c3f5 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 _0x7f42=['lodash','../../config/logger','api','moment','bluebird','request-promise','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x18a816,_0xcf8471){var _0x11354c=function(_0x3c2da7){while(--_0x3c2da7){_0x18a816['push'](_0x18a816['shift']());}};_0x11354c(++_0xcf8471);}(_0x7f42,0x14a));var _0x27f4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7f42[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require(_0x27f4('0x3'));var BPromise=require(_0x27f4('0x4'));var rp=require(_0x27f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x27f4('0x6')]=function(_0x1778d9,_0x496f8b){return _0x1778d9[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe237=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations'];(function(_0x1a9ca4,_0x5115db){var _0x19a2c2=function(_0x13a68f){while(--_0x13a68f){_0x1a9ca4['push'](_0x1a9ca4['shift']());}};_0x19a2c2(++_0x5115db);}(_0xe237,0x155));var _0x7e23=function(_0x94f6f9,_0x71dac4){_0x94f6f9=_0x94f6f9-0x0;var _0x547063=_0xe237[_0x94f6f9];return _0x547063;};'use strict';var _=require(_0x7e23('0x0'));var util=require('util');var logger=require(_0x7e23('0x1'))(_0x7e23('0x2'));var moment=require(_0x7e23('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e23('0x4'));var fs=require('fs');var path=require(_0x7e23('0x5'));var rimraf=require(_0x7e23('0x6'));var config=require(_0x7e23('0x7'));var attributes=require(_0x7e23('0x8'));module['exports']=function(_0x5b9e75,_0x133182){return _0x5b9e75['define'](_0x7e23('0x9'),attributes,{'tableName':_0x7e23('0xa'),'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 f9e07c8..b7972e2 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 _0x4f71=['../../config/utils','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24e767,_0x955278){var _0x4f79dc=function(_0x1ccae2){while(--_0x1ccae2){_0x24e767['push'](_0x24e767['shift']());}};_0x4f79dc(++_0x955278);}(_0x4f71,0x15e));var _0x14f7=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4f71[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x14f7('0x0'));var util=require(_0x14f7('0x1'));var moment=require(_0x14f7('0x2'));var BPromise=require(_0x14f7('0x3'));var rs=require(_0x14f7('0x4'));var fs=require('fs');var Redis=require(_0x14f7('0x5'));var db=require(_0x14f7('0x6'))['db'];var utils=require(_0x14f7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x14f7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x14f7('0x9')][_0x14f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d0285,_0x33c0e7,_0x34cc17){return new BPromise(function(_0x361288,_0x1cd895){return client[_0x14f7('0xb')](_0x5d0285,_0x34cc17)[_0x14f7('0xc')](function(_0x414b15){logger[_0x14f7('0xd')](_0x14f7('0xe'),_0x33c0e7,'request\x20sent');logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x33c0e7,_0x14f7('0xf'),JSON[_0x14f7('0x10')](_0x414b15));if(_0x414b15[_0x14f7('0x11')]){if(_0x414b15[_0x14f7('0x11')][_0x14f7('0x12')]===0x1f4){logger[_0x14f7('0x11')](_0x14f7('0xe'),_0x33c0e7,_0x414b15[_0x14f7('0x11')][_0x14f7('0x13')]);return _0x1cd895(_0x414b15[_0x14f7('0x11')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x33c0e7,_0x414b15[_0x14f7('0x11')]['message']);return _0x361288(_0x414b15[_0x14f7('0x11')][_0x14f7('0x13')]);}else{logger['info'](_0x14f7('0xe'),_0x33c0e7,'request\x20sent');_0x361288(_0x414b15['result'][_0x14f7('0x13')]);}})[_0x14f7('0x14')](function(_0x1b65f5){logger['error'](_0x14f7('0xe'),_0x33c0e7,_0x1b65f5);_0x1cd895(_0x1b65f5);});});} \ No newline at end of file +var _0x766a=['debug','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x27f11d,_0x498a00){var _0x4a6697=function(_0x1c054e){while(--_0x1c054e){_0x27f11d['push'](_0x27f11d['shift']());}};_0x4a6697(++_0x498a00);}(_0x766a,0x96));var _0xa766=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0x766a[_0x2652ef];return _0x2db578;};'use strict';var _=require(_0xa766('0x0'));var util=require('util');var moment=require(_0xa766('0x1'));var BPromise=require(_0xa766('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa766('0x3'))['db'];var utils=require(_0xa766('0x4'));var logger=require(_0xa766('0x5'))(_0xa766('0x6'));var config=require(_0xa766('0x7'));var jayson=require(_0xa766('0x8'));var client=jayson[_0xa766('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a913b,_0x470fda,_0x38f2df){return new BPromise(function(_0x1ad260,_0x520a7b){return client['request'](_0x1a913b,_0x38f2df)['then'](function(_0x380890){logger[_0xa766('0xa')](_0xa766('0xb'),_0x470fda,'request\x20sent');logger[_0xa766('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x470fda,_0xa766('0xd'),JSON[_0xa766('0xe')](_0x380890));if(_0x380890[_0xa766('0xf')]){if(_0x380890[_0xa766('0xf')]['code']===0x1f4){logger[_0xa766('0xf')](_0xa766('0xb'),_0x470fda,_0x380890[_0xa766('0xf')][_0xa766('0x10')]);return _0x520a7b(_0x380890[_0xa766('0xf')][_0xa766('0x10')]);}logger[_0xa766('0xf')](_0xa766('0xb'),_0x470fda,_0x380890[_0xa766('0xf')]['message']);return _0x1ad260(_0x380890['error'][_0xa766('0x10')]);}else{logger[_0xa766('0xa')](_0xa766('0xb'),_0x470fda,_0xa766('0xd'));_0x1ad260(_0x380890['result'][_0xa766('0x10')]);}})[_0xa766('0x11')](function(_0x363741){logger[_0xa766('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x470fda,_0x363741);_0x520a7b(_0x363741);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ac12594..e8a269f 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 _0x43fc=['../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40ecd0,_0x27de55){var _0x5a9953=function(_0x3c5807){while(--_0x3c5807){_0x40ecd0['push'](_0x40ecd0['shift']());}};_0x5a9953(++_0x27de55);}(_0x43fc,0x84));var _0xc43f=function(_0x47205a,_0xfcdbf7){_0x47205a=_0x47205a-0x0;var _0x27c665=_0x43fc[_0x47205a];return _0x27c665;};'use strict';var multer=require('multer');var util=require(_0xc43f('0x0'));var path=require(_0xc43f('0x1'));var timeout=require(_0xc43f('0x2'));var express=require(_0xc43f('0x3'));var router=express[_0xc43f('0x4')]();var fs_extra=require(_0xc43f('0x5'));var auth=require(_0xc43f('0x6'));var interaction=require(_0xc43f('0x7'));var config=require(_0xc43f('0x8'));var controller=require(_0xc43f('0x9'));router[_0xc43f('0xa')]('/',auth[_0xc43f('0xb')](),controller[_0xc43f('0xc')]);router[_0xc43f('0xa')]('/:id',auth[_0xc43f('0xb')](),controller[_0xc43f('0xd')]);router[_0xc43f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc43f('0xf')]('/:id',auth[_0xc43f('0xb')](),controller[_0xc43f('0x10')]);router[_0xc43f('0x11')](_0xc43f('0x12'),auth[_0xc43f('0xb')](),controller[_0xc43f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa02d=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4141d9,_0x45e0b9){var _0x4392a3=function(_0x12c7dd){while(--_0x12c7dd){_0x4141d9['push'](_0x4141d9['shift']());}};_0x4392a3(++_0x45e0b9);}(_0xa02d,0x1a5));var _0xda02=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xa02d[_0x19a49f];return _0x5351ae;};'use strict';var multer=require(_0xda02('0x0'));var util=require(_0xda02('0x1'));var path=require(_0xda02('0x2'));var timeout=require(_0xda02('0x3'));var express=require('express');var router=express[_0xda02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda02('0x6'));var controller=require('./intVtigerField.controller');router[_0xda02('0x7')]('/',auth[_0xda02('0x8')](),controller[_0xda02('0x9')]);router['get'](_0xda02('0xa'),auth[_0xda02('0x8')](),controller[_0xda02('0xb')]);router[_0xda02('0xc')]('/',auth[_0xda02('0x8')](),controller[_0xda02('0xd')]);router[_0xda02('0xe')]('/:id',auth[_0xda02('0x8')](),controller['update']);router['delete']('/:id',auth[_0xda02('0x8')](),controller[_0xda02('0xf')]);module[_0xda02('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index d3dd369..5dc5fdd 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 _0xf61f=['variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf61f,0x197));var _0xff61=function(_0x44fede,_0x386a68){_0x44fede=_0x44fede-0x0;var _0x3c478f=_0xf61f[_0x44fede];return _0x3c478f;};'use strict';var Sequelize=require(_0xff61('0x0'));module[_0xff61('0x1')]={'type':{'type':Sequelize[_0xff61('0x2')]('string',_0xff61('0x3'),_0xff61('0x4'),_0xff61('0x5'),_0xff61('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xff61('0x7')]},'keyType':{'type':Sequelize[_0xff61('0x2')](_0xff61('0x8'),'variable',_0xff61('0x4'))},'keyContent':{'type':Sequelize[_0xff61('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xff61('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdbd7=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x40b8b1,_0x584d41){var _0x22a6fa=function(_0x50d6ee){while(--_0x50d6ee){_0x40b8b1['push'](_0x40b8b1['shift']());}};_0x22a6fa(++_0x584d41);}(_0xdbd7,0x193));var _0x7dbd=function(_0x4ce80d,_0x4a07e8){_0x4ce80d=_0x4ce80d-0x0;var _0x1251ba=_0xdbd7[_0x4ce80d];return _0x1251ba;};'use strict';var Sequelize=require(_0x7dbd('0x0'));module[_0x7dbd('0x1')]={'type':{'type':Sequelize[_0x7dbd('0x2')](_0x7dbd('0x3'),'variable','customVariable',_0x7dbd('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7dbd('0x5')]},'key':{'type':Sequelize[_0x7dbd('0x5')]},'keyType':{'type':Sequelize[_0x7dbd('0x2')](_0x7dbd('0x3'),_0x7dbd('0x6'),_0x7dbd('0x7'))},'keyContent':{'type':Sequelize[_0x7dbd('0x5')]},'idField':{'type':Sequelize[_0x7dbd('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7dbd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7dbd('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c77bcf3..e122683 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 _0xfe6b=['ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','find','rimraf','fast-json-patch','moment','mustache','util','path','sox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe6b,0x1b5));var _0xbfe6=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xfe6b[_0x145b3c];return _0x1b6e36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfe6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfe6('0x1'));var rp=require('request-promise');var moment=require(_0xbfe6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbfe6('0x3'));var util=require(_0xbfe6('0x4'));var path=require(_0xbfe6('0x5'));var sox=require(_0xbfe6('0x6'));var csv=require('to-csv');var ejs=require(_0xbfe6('0x7'));var fs=require('fs');var fs_extra=require(_0xbfe6('0x8'));var _=require(_0xbfe6('0x9'));var squel=require('squel');var crypto=require(_0xbfe6('0xa'));var jsforce=require(_0xbfe6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbfe6('0xc'));var Redis=require(_0xbfe6('0xd'));var authService=require(_0xbfe6('0xe'));var qs=require(_0xbfe6('0xf'));var as=require(_0xbfe6('0x10'));var hardwareService=require(_0xbfe6('0x11'));var logger=require(_0xbfe6('0x12'))(_0xbfe6('0x13'));var utils=require(_0xbfe6('0x14'));var config=require(_0xbfe6('0x15'));var licenseUtil=require(_0xbfe6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4811b7,_0x35aff4){_0x35aff4=_0x35aff4||0xcc;return function(_0x114fcf){if(_0x114fcf){return _0x4811b7[_0xbfe6('0x17')](_0x35aff4);}return _0x4811b7[_0xbfe6('0x18')](_0x35aff4)['end']();};}function respondWithResult(_0x1b0c0a,_0x52056d){_0x52056d=_0x52056d||0xc8;return function(_0x39800d){if(_0x39800d){return _0x1b0c0a[_0xbfe6('0x18')](_0x52056d)['json'](_0x39800d);}};}function respondWithFilteredResult(_0x12b678,_0xdd2760){return function(_0x3a1121){if(_0x3a1121){var _0xda184d=typeof _0xdd2760[_0xbfe6('0x19')]===_0xbfe6('0x1a')&&typeof _0xdd2760[_0xbfe6('0x1b')]==='undefined';var _0x1a9239=_0x3a1121[_0xbfe6('0x1c')];var _0x184d96=_0xda184d?0x0:_0xdd2760[_0xbfe6('0x19')];var _0x40903f=_0xda184d?_0x3a1121['count']:_0xdd2760[_0xbfe6('0x19')]+_0xdd2760[_0xbfe6('0x1b')];var _0x3b9245;if(_0x40903f>=_0x1a9239){_0x40903f=_0x1a9239;_0x3b9245=0xc8;}else{_0x3b9245=0xce;}_0x12b678['status'](_0x3b9245);return _0x12b678[_0xbfe6('0x1d')]('Content-Range',_0x184d96+'-'+_0x40903f+'/'+_0x1a9239)[_0xbfe6('0x1e')](_0x3a1121);}return null;};}function patchUpdates(_0x1f5e05){return function(_0x3a5a12){try{jsonpatch[_0xbfe6('0x1f')](_0x3a5a12,_0x1f5e05,!![]);}catch(_0x417984){return BPromise[_0xbfe6('0x20')](_0x417984);}return _0x3a5a12[_0xbfe6('0x21')]();};}function saveUpdates(_0x7da433,_0x4b7cf4){return function(_0x24f947){if(_0x24f947){return _0x24f947[_0xbfe6('0x22')](_0x7da433)['then'](function(_0x2b6608){return _0x2b6608;});}return null;};}function removeEntity(_0x3850f7,_0x128e68){return function(_0x1a1a5c){if(_0x1a1a5c){return _0x1a1a5c['destroy']()[_0xbfe6('0x23')](function(){_0x3850f7[_0xbfe6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30cbe7,_0x572b15){return function(_0x3c429d){if(!_0x3c429d){_0x30cbe7[_0xbfe6('0x17')](0x194);}return _0x3c429d;};}function handleError(_0x41ac84,_0x3f8566){_0x3f8566=_0x3f8566||0x1f4;return function(_0x4ad7a3){logger[_0xbfe6('0x24')](_0x4ad7a3[_0xbfe6('0x25')]);if(_0x4ad7a3[_0xbfe6('0x26')]){delete _0x4ad7a3[_0xbfe6('0x26')];}_0x41ac84[_0xbfe6('0x18')](_0x3f8566)['send'](_0x4ad7a3);};}exports[_0xbfe6('0x27')]=function(_0x3452dd,_0x1b38f3){var _0x538fc2={},_0x301166={},_0x2f9ee2={'count':0x0,'rows':[]};var _0x4d5103=_[_0xbfe6('0x28')](db['VtigerField']['rawAttributes'],function(_0x2d0261){return{'name':_0x2d0261[_0xbfe6('0x29')],'type':_0x2d0261[_0xbfe6('0x2a')][_0xbfe6('0x2b')]};});_0x301166[_0xbfe6('0x2c')]=_[_0xbfe6('0x28')](_0x4d5103,_0xbfe6('0x26'));_0x301166[_0xbfe6('0x2d')]=_[_0xbfe6('0x2e')](_0x3452dd['query']);_0x301166[_0xbfe6('0x2f')]=_['intersection'](_0x301166[_0xbfe6('0x2c')],_0x301166['query']);_0x538fc2[_0xbfe6('0x30')]=_[_0xbfe6('0x31')](_0x301166[_0xbfe6('0x2c')],qs[_0xbfe6('0x32')](_0x3452dd[_0xbfe6('0x2d')][_0xbfe6('0x32')]));_0x538fc2[_0xbfe6('0x30')]=_0x538fc2[_0xbfe6('0x30')][_0xbfe6('0x33')]?_0x538fc2[_0xbfe6('0x30')]:_0x301166['model'];if(!_0x3452dd['query'][_0xbfe6('0x34')](_0xbfe6('0x35'))){_0x538fc2[_0xbfe6('0x1b')]=qs[_0xbfe6('0x1b')](_0x3452dd['query'][_0xbfe6('0x1b')]);_0x538fc2[_0xbfe6('0x19')]=qs['offset'](_0x3452dd['query'][_0xbfe6('0x19')]);}_0x538fc2[_0xbfe6('0x36')]=qs[_0xbfe6('0x37')](_0x3452dd[_0xbfe6('0x2d')]['sort']);_0x538fc2[_0xbfe6('0x38')]=qs[_0xbfe6('0x2f')](_[_0xbfe6('0x39')](_0x3452dd[_0xbfe6('0x2d')],_0x301166[_0xbfe6('0x2f')]),_0x4d5103);if(_0x3452dd['query'][_0xbfe6('0x3a')]){_0x538fc2[_0xbfe6('0x38')]=_[_0xbfe6('0x3b')](_0x538fc2['where'],{'$or':_[_0xbfe6('0x28')](_0x4d5103,function(_0x1e4cf5){if(_0x1e4cf5[_0xbfe6('0x2a')]!==_0xbfe6('0x3c')){var _0x160469={};_0x160469[_0x1e4cf5['name']]={'$like':'%'+_0x3452dd[_0xbfe6('0x2d')][_0xbfe6('0x3a')]+'%'};return _0x160469;}})});}_0x538fc2=_[_0xbfe6('0x3b')]({},_0x538fc2,_0x3452dd[_0xbfe6('0x3d')]);var _0x478921={'where':_0x538fc2[_0xbfe6('0x38')]};return db[_0xbfe6('0x3e')][_0xbfe6('0x1c')](_0x478921)[_0xbfe6('0x23')](function(_0x43d76e){_0x2f9ee2[_0xbfe6('0x1c')]=_0x43d76e;if(_0x3452dd[_0xbfe6('0x2d')][_0xbfe6('0x3f')]){_0x538fc2['include']=[{'all':!![]}];}return db[_0xbfe6('0x3e')][_0xbfe6('0x40')](_0x538fc2);})[_0xbfe6('0x23')](function(_0x215851){_0x2f9ee2[_0xbfe6('0x41')]=_0x215851;return _0x2f9ee2;})[_0xbfe6('0x23')](respondWithFilteredResult(_0x1b38f3,_0x538fc2))[_0xbfe6('0x42')](handleError(_0x1b38f3,null));};exports[_0xbfe6('0x43')]=function(_0x2614d7,_0x4e8413){var _0x7c98be={'raw':!![],'where':{'id':_0x2614d7[_0xbfe6('0x44')]['id']}},_0xbc0ca5={};_0xbc0ca5['model']=_[_0xbfe6('0x2e')](db[_0xbfe6('0x3e')]['rawAttributes']);_0xbc0ca5[_0xbfe6('0x2d')]=_[_0xbfe6('0x2e')](_0x2614d7[_0xbfe6('0x2d')]);_0xbc0ca5[_0xbfe6('0x2f')]=_[_0xbfe6('0x31')](_0xbc0ca5[_0xbfe6('0x2c')],_0xbc0ca5['query']);_0x7c98be[_0xbfe6('0x30')]=_[_0xbfe6('0x31')](_0xbc0ca5['model'],qs[_0xbfe6('0x32')](_0x2614d7[_0xbfe6('0x2d')][_0xbfe6('0x32')]));_0x7c98be['attributes']=_0x7c98be[_0xbfe6('0x30')][_0xbfe6('0x33')]?_0x7c98be[_0xbfe6('0x30')]:_0xbc0ca5[_0xbfe6('0x2c')];if(_0x2614d7[_0xbfe6('0x2d')][_0xbfe6('0x3f')]){_0x7c98be[_0xbfe6('0x45')]=[{'all':!![]}];}_0x7c98be=_[_0xbfe6('0x3b')]({},_0x7c98be,_0x2614d7['options']);return db[_0xbfe6('0x3e')]['find'](_0x7c98be)[_0xbfe6('0x23')](handleEntityNotFound(_0x4e8413,null))[_0xbfe6('0x23')](respondWithResult(_0x4e8413,null))[_0xbfe6('0x42')](handleError(_0x4e8413,null));};exports['create']=function(_0x13422e,_0x29c7a5){return db[_0xbfe6('0x3e')][_0xbfe6('0x46')](_0x13422e[_0xbfe6('0x47')],{})[_0xbfe6('0x23')](respondWithResult(_0x29c7a5,0xc9))[_0xbfe6('0x42')](handleError(_0x29c7a5,null));};exports['update']=function(_0x417418,_0x39c471){if(_0x417418['body']['id']){delete _0x417418[_0xbfe6('0x47')]['id'];}return db[_0xbfe6('0x3e')]['find']({'where':{'id':_0x417418[_0xbfe6('0x44')]['id']}})[_0xbfe6('0x23')](handleEntityNotFound(_0x39c471,null))[_0xbfe6('0x23')](saveUpdates(_0x417418[_0xbfe6('0x47')],null))['then'](respondWithResult(_0x39c471,null))[_0xbfe6('0x42')](handleError(_0x39c471,null));};exports[_0xbfe6('0x48')]=function(_0x20413e,_0x574c61){return db['VtigerField'][_0xbfe6('0x49')]({'where':{'id':_0x20413e[_0xbfe6('0x44')]['id']}})[_0xbfe6('0x23')](handleEntityNotFound(_0x574c61,null))['then'](removeEntity(_0x574c61,null))[_0xbfe6('0x42')](handleError(_0x574c61,null));}; \ No newline at end of file +var _0x26f7=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','lodash'];(function(_0x578998,_0x1816f0){var _0x544a2d=function(_0xb7be44){while(--_0xb7be44){_0x578998['push'](_0x578998['shift']());}};_0x544a2d(++_0x1816f0);}(_0x26f7,0xd1));var _0x726f=function(_0x2bf1b6,_0x4b5ed4){_0x2bf1b6=_0x2bf1b6-0x0;var _0x6e4207=_0x26f7[_0x2bf1b6];return _0x6e4207;};'use strict';var emlformat=require(_0x726f('0x0'));var rimraf=require(_0x726f('0x1'));var zipdir=require(_0x726f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x726f('0x3'));var BPromise=require(_0x726f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x726f('0x5'));var sox=require(_0x726f('0x6'));var csv=require(_0x726f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x726f('0x8'));var _=require(_0x726f('0x9'));var squel=require('squel');var crypto=require(_0x726f('0xa'));var jsforce=require(_0x726f('0xb'));var deskjs=require(_0x726f('0xc'));var toCsv=require(_0x726f('0x7'));var querystring=require(_0x726f('0xd'));var Papa=require(_0x726f('0xe'));var Redis=require(_0x726f('0xf'));var authService=require(_0x726f('0x10'));var qs=require(_0x726f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x726f('0x12'));var logger=require('../../config/logger')(_0x726f('0x13'));var utils=require(_0x726f('0x14'));var config=require(_0x726f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x726f('0x16'))['db'];function respondWithStatusCode(_0x3bfdb2,_0xf36c8b){_0xf36c8b=_0xf36c8b||0xcc;return function(_0x3fe931){if(_0x3fe931){return _0x3bfdb2['sendStatus'](_0xf36c8b);}return _0x3bfdb2[_0x726f('0x17')](_0xf36c8b)[_0x726f('0x18')]();};}function respondWithResult(_0x5a648b,_0x31e451){_0x31e451=_0x31e451||0xc8;return function(_0x279195){if(_0x279195){return _0x5a648b['status'](_0x31e451)[_0x726f('0x19')](_0x279195);}};}function respondWithFilteredResult(_0x5db6a0,_0x3a8fb3){return function(_0x10c88b){if(_0x10c88b){var _0x203d84=typeof _0x3a8fb3[_0x726f('0x1a')]==='undefined'&&typeof _0x3a8fb3[_0x726f('0x1b')]==='undefined';var _0x2e42eb=_0x10c88b['count'];var _0x5a2b83=_0x203d84?0x0:_0x3a8fb3[_0x726f('0x1a')];var _0x11ec92=_0x203d84?_0x10c88b[_0x726f('0x1c')]:_0x3a8fb3[_0x726f('0x1a')]+_0x3a8fb3[_0x726f('0x1b')];var _0x5daae1;if(_0x11ec92>=_0x2e42eb){_0x11ec92=_0x2e42eb;_0x5daae1=0xc8;}else{_0x5daae1=0xce;}_0x5db6a0[_0x726f('0x17')](_0x5daae1);return _0x5db6a0[_0x726f('0x1d')]('Content-Range',_0x5a2b83+'-'+_0x11ec92+'/'+_0x2e42eb)[_0x726f('0x19')](_0x10c88b);}return null;};}function patchUpdates(_0x44adca){return function(_0x28ff46){try{jsonpatch['apply'](_0x28ff46,_0x44adca,!![]);}catch(_0x4aeb7b){return BPromise[_0x726f('0x1e')](_0x4aeb7b);}return _0x28ff46['save']();};}function saveUpdates(_0x14180d,_0x7fd9ee){return function(_0x5eccaa){if(_0x5eccaa){return _0x5eccaa[_0x726f('0x1f')](_0x14180d)[_0x726f('0x20')](function(_0x552296){return _0x552296;});}return null;};}function removeEntity(_0x3a82b8,_0x3ce828){return function(_0x42e9bb){if(_0x42e9bb){return _0x42e9bb[_0x726f('0x21')]()['then'](function(){_0x3a82b8[_0x726f('0x17')](0xcc)[_0x726f('0x18')]();});}};}function handleEntityNotFound(_0x1a8910,_0x321ec8){return function(_0x4b4b8e){if(!_0x4b4b8e){_0x1a8910[_0x726f('0x22')](0x194);}return _0x4b4b8e;};}function handleError(_0x1cedea,_0x36f13a){_0x36f13a=_0x36f13a||0x1f4;return function(_0x814f86){logger[_0x726f('0x23')](_0x814f86[_0x726f('0x24')]);if(_0x814f86[_0x726f('0x25')]){delete _0x814f86['name'];}_0x1cedea['status'](_0x36f13a)[_0x726f('0x26')](_0x814f86);};}exports[_0x726f('0x27')]=function(_0x3b0bb3,_0x631b72){var _0x4a4317={},_0x5ca5e5={},_0xb09b8e={'count':0x0,'rows':[]};var _0xedd3f7=_[_0x726f('0x28')](db['VtigerField'][_0x726f('0x29')],function(_0x5ace89){return{'name':_0x5ace89[_0x726f('0x2a')],'type':_0x5ace89[_0x726f('0x2b')][_0x726f('0x2c')]};});_0x5ca5e5[_0x726f('0x2d')]=_['map'](_0xedd3f7,'name');_0x5ca5e5[_0x726f('0x2e')]=_[_0x726f('0x2f')](_0x3b0bb3['query']);_0x5ca5e5[_0x726f('0x30')]=_[_0x726f('0x31')](_0x5ca5e5[_0x726f('0x2d')],_0x5ca5e5['query']);_0x4a4317[_0x726f('0x32')]=_[_0x726f('0x31')](_0x5ca5e5[_0x726f('0x2d')],qs['fields'](_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x33')]));_0x4a4317['attributes']=_0x4a4317['attributes'][_0x726f('0x34')]?_0x4a4317[_0x726f('0x32')]:_0x5ca5e5['model'];if(!_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x35')](_0x726f('0x36'))){_0x4a4317[_0x726f('0x1b')]=qs['limit'](_0x3b0bb3['query']['limit']);_0x4a4317[_0x726f('0x1a')]=qs[_0x726f('0x1a')](_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x1a')]);}_0x4a4317[_0x726f('0x37')]=qs[_0x726f('0x38')](_0x3b0bb3['query'][_0x726f('0x38')]);_0x4a4317[_0x726f('0x39')]=qs['filters'](_['pick'](_0x3b0bb3['query'],_0x5ca5e5[_0x726f('0x30')]),_0xedd3f7);if(_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3a')]){_0x4a4317[_0x726f('0x39')]=_[_0x726f('0x3b')](_0x4a4317['where'],{'$or':_[_0x726f('0x28')](_0xedd3f7,function(_0x11baef){if(_0x11baef[_0x726f('0x2b')]!==_0x726f('0x3c')){var _0x2d5335={};_0x2d5335[_0x11baef[_0x726f('0x25')]]={'$like':'%'+_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3a')]+'%'};return _0x2d5335;}})});}_0x4a4317=_[_0x726f('0x3b')]({},_0x4a4317,_0x3b0bb3[_0x726f('0x3d')]);var _0x2ee8e4={'where':_0x4a4317['where']};return db[_0x726f('0x3e')]['count'](_0x2ee8e4)[_0x726f('0x20')](function(_0x2ffe87){_0xb09b8e[_0x726f('0x1c')]=_0x2ffe87;if(_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3f')]){_0x4a4317[_0x726f('0x40')]=[{'all':!![]}];}return db[_0x726f('0x3e')][_0x726f('0x41')](_0x4a4317);})[_0x726f('0x20')](function(_0x5252a1){_0xb09b8e[_0x726f('0x42')]=_0x5252a1;return _0xb09b8e;})[_0x726f('0x20')](respondWithFilteredResult(_0x631b72,_0x4a4317))[_0x726f('0x43')](handleError(_0x631b72,null));};exports[_0x726f('0x44')]=function(_0x2948fe,_0x44b90a){var _0x1222ef={'raw':!![],'where':{'id':_0x2948fe[_0x726f('0x45')]['id']}},_0x1d18a5={};_0x1d18a5['model']=_[_0x726f('0x2f')](db['VtigerField'][_0x726f('0x29')]);_0x1d18a5[_0x726f('0x2e')]=_[_0x726f('0x2f')](_0x2948fe[_0x726f('0x2e')]);_0x1d18a5[_0x726f('0x30')]=_[_0x726f('0x31')](_0x1d18a5[_0x726f('0x2d')],_0x1d18a5['query']);_0x1222ef[_0x726f('0x32')]=_['intersection'](_0x1d18a5[_0x726f('0x2d')],qs[_0x726f('0x33')](_0x2948fe[_0x726f('0x2e')][_0x726f('0x33')]));_0x1222ef[_0x726f('0x32')]=_0x1222ef[_0x726f('0x32')][_0x726f('0x34')]?_0x1222ef['attributes']:_0x1d18a5['model'];if(_0x2948fe[_0x726f('0x2e')][_0x726f('0x3f')]){_0x1222ef[_0x726f('0x40')]=[{'all':!![]}];}_0x1222ef=_[_0x726f('0x3b')]({},_0x1222ef,_0x2948fe[_0x726f('0x3d')]);return db[_0x726f('0x3e')][_0x726f('0x46')](_0x1222ef)[_0x726f('0x20')](handleEntityNotFound(_0x44b90a,null))[_0x726f('0x20')](respondWithResult(_0x44b90a,null))[_0x726f('0x43')](handleError(_0x44b90a,null));};exports[_0x726f('0x47')]=function(_0x192be1,_0xb091fa){return db['VtigerField'][_0x726f('0x47')](_0x192be1[_0x726f('0x48')],{})[_0x726f('0x20')](respondWithResult(_0xb091fa,0xc9))['catch'](handleError(_0xb091fa,null));};exports['update']=function(_0x1e720d,_0x5b16ba){if(_0x1e720d[_0x726f('0x48')]['id']){delete _0x1e720d[_0x726f('0x48')]['id'];}return db[_0x726f('0x3e')][_0x726f('0x46')]({'where':{'id':_0x1e720d['params']['id']}})[_0x726f('0x20')](handleEntityNotFound(_0x5b16ba,null))[_0x726f('0x20')](saveUpdates(_0x1e720d['body'],null))['then'](respondWithResult(_0x5b16ba,null))[_0x726f('0x43')](handleError(_0x5b16ba,null));};exports[_0x726f('0x21')]=function(_0x296fa1,_0x500547){return db[_0x726f('0x3e')][_0x726f('0x46')]({'where':{'id':_0x296fa1[_0x726f('0x45')]['id']}})['then'](handleEntityNotFound(_0x500547,null))[_0x726f('0x20')](removeEntity(_0x500547,null))[_0x726f('0x43')](handleError(_0x500547,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index b5cc927..127ea07 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 _0x5d50=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x5c06d7,_0x2ee20f){var _0x3da523=function(_0x338f80){while(--_0x338f80){_0x5c06d7['push'](_0x5c06d7['shift']());}};_0x3da523(++_0x2ee20f);}(_0x5d50,0x156));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05d5('0x0'));var util=require(_0x05d5('0x1'));var logger=require(_0x05d5('0x2'))(_0x05d5('0x3'));var moment=require(_0x05d5('0x4'));var BPromise=require('bluebird');var rp=require(_0x05d5('0x5'));var fs=require('fs');var path=require(_0x05d5('0x6'));var rimraf=require(_0x05d5('0x7'));var config=require(_0x05d5('0x8'));var attributes=require(_0x05d5('0x9'));module[_0x05d5('0xa')]=function(_0x3ca918,_0x1236cc){return _0x3ca918[_0x05d5('0xb')](_0x05d5('0xc'),attributes,{'tableName':_0x05d5('0xd'),'paranoid':![],'indexes':[{'name':_0x05d5('0xe'),'fields':[_0x05d5('0xf'),_0x05d5('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x441c=['rimraf','../../config/environment','exports','define','int_vtiger_fields','lodash','util','api','moment','bluebird','path'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x441c,0x102));var _0xc441=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x441c[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xc441('0x0'));var util=require(_0xc441('0x1'));var logger=require('../../config/logger')(_0xc441('0x2'));var moment=require(_0xc441('0x3'));var BPromise=require(_0xc441('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc441('0x5'));var rimraf=require(_0xc441('0x6'));var config=require(_0xc441('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xc441('0x8')]=function(_0x5e5853,_0x5dd40f){return _0x5e5853[_0xc441('0x9')]('VtigerField',attributes,{'tableName':_0xc441('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'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 9ec98ec..86d097d 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 _0xe356=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result'];(function(_0x38ae07,_0x59d4e8){var _0x4c1010=function(_0x19fda5){while(--_0x19fda5){_0x38ae07['push'](_0x38ae07['shift']());}};_0x4c1010(++_0x59d4e8);}(_0xe356,0x1ee));var _0x6e35=function(_0x24d289,_0x5f305b){_0x24d289=_0x24d289-0x0;var _0x219753=_0xe356[_0x24d289];return _0x219753;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var moment=require(_0x6e35('0x2'));var BPromise=require(_0x6e35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e35('0x5'));var logger=require(_0x6e35('0x6'))(_0x6e35('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e35('0x8'));var client=jayson[_0x6e35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389ae2,_0xba948e,_0x114b4c){return new BPromise(function(_0x1da99b,_0x5119fa){return client[_0x6e35('0xa')](_0x389ae2,_0x114b4c)['then'](function(_0x3b3c16){logger['info'](_0x6e35('0xb'),_0xba948e,'request\x20sent');logger['debug'](_0x6e35('0xc'),_0xba948e,_0x6e35('0xd'),JSON['stringify'](_0x3b3c16));if(_0x3b3c16['error']){if(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0xf')]===0x1f4){logger[_0x6e35('0xe')]('VtigerField,\x20%s,\x20%s',_0xba948e,_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);return _0x5119fa(_0x3b3c16[_0x6e35('0xe')]['message']);}logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3b3c16[_0x6e35('0xe')]['message']);return _0x1da99b(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);}else{logger[_0x6e35('0x11')]('VtigerField,\x20%s,\x20%s',_0xba948e,_0x6e35('0xd'));_0x1da99b(_0x3b3c16[_0x6e35('0x12')][_0x6e35('0x10')]);}})['catch'](function(_0x3e7e7a){logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3e7e7a);_0x5119fa(_0x3e7e7a);});});} \ No newline at end of file +var _0xf46f=['../../mysqldb','../../config/utils','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x52fd6a,_0x4de6e7){var _0x1c8e1c=function(_0x58beb4){while(--_0x58beb4){_0x52fd6a['push'](_0x52fd6a['shift']());}};_0x1c8e1c(++_0x4de6e7);}(_0xf46f,0x12e));var _0xff46=function(_0x4fd3ed,_0x173344){_0x4fd3ed=_0x4fd3ed-0x0;var _0x280ed0=_0xf46f[_0x4fd3ed];return _0x280ed0;};'use strict';var _=require('lodash');var util=require(_0xff46('0x0'));var moment=require(_0xff46('0x1'));var BPromise=require('bluebird');var rs=require(_0xff46('0x2'));var fs=require('fs');var Redis=require(_0xff46('0x3'));var db=require(_0xff46('0x4'))['db'];var utils=require(_0xff46('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff46('0x6')][_0xff46('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2503d8,_0x36c5d5,_0x554170){return new BPromise(function(_0x4a06d0,_0x509e52){return client['request'](_0x2503d8,_0x554170)[_0xff46('0x8')](function(_0x35a7cf){logger[_0xff46('0x9')](_0xff46('0xa'),_0x36c5d5,_0xff46('0xb'));logger[_0xff46('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x36c5d5,_0xff46('0xb'),JSON['stringify'](_0x35a7cf));if(_0x35a7cf[_0xff46('0xd')]){if(_0x35a7cf[_0xff46('0xd')][_0xff46('0xe')]===0x1f4){logger['error'](_0xff46('0xa'),_0x36c5d5,_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);return _0x509e52(_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);}logger[_0xff46('0xd')](_0xff46('0xa'),_0x36c5d5,_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);return _0x4a06d0(_0x35a7cf['error'][_0xff46('0xf')]);}else{logger[_0xff46('0x9')]('VtigerField,\x20%s,\x20%s',_0x36c5d5,_0xff46('0xb'));_0x4a06d0(_0x35a7cf[_0xff46('0x10')][_0xff46('0xf')]);}})[_0xff46('0x11')](function(_0x2ba069){logger[_0xff46('0xd')]('VtigerField,\x20%s,\x20%s',_0x36c5d5,_0x2ba069);_0x509e52(_0x2ba069);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6c1a5f6..5157e42 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 _0x264c=['exports','multer','util','path','Router','../../components/interaction/service','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x264c,0x119));var _0xc264=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x264c[_0x52096b];return _0x2b1cc7;};'use strict';var multer=require(_0xc264('0x0'));var util=require(_0xc264('0x1'));var path=require(_0xc264('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc264('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc264('0x4'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xc264('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xc264('0x6')](),controller[_0xc264('0x7')]);router['get'](_0xc264('0x8'),auth[_0xc264('0x6')](),controller[_0xc264('0x9')]);router[_0xc264('0x5')](_0xc264('0xa'),auth[_0xc264('0x6')](),controller[_0xc264('0xb')]);router[_0xc264('0xc')]('/',auth[_0xc264('0x6')](),controller[_0xc264('0xd')]);router[_0xc264('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xc264('0xe')]);router[_0xc264('0xf')](_0xc264('0x10'),auth[_0xc264('0x6')](),controller[_0xc264('0x11')]);router[_0xc264('0x12')](_0xc264('0x10'),auth[_0xc264('0x6')](),controller['destroy']);module[_0xc264('0x13')]=router; \ No newline at end of file +var _0xb921=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x12f836,_0x3ec96a){var _0x4713d6=function(_0x3a84ce){while(--_0x3a84ce){_0x12f836['push'](_0x12f836['shift']());}};_0x4713d6(++_0x3ec96a);}(_0xb921,0xd7));var _0x1b92=function(_0x31ae9c,_0x33e5cb){_0x31ae9c=_0x31ae9c-0x0;var _0x2012a2=_0xb921[_0x31ae9c];return _0x2012a2;};'use strict';var multer=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var path=require(_0x1b92('0x2'));var timeout=require(_0x1b92('0x3'));var express=require(_0x1b92('0x4'));var router=express[_0x1b92('0x5')]();var fs_extra=require(_0x1b92('0x6'));var auth=require(_0x1b92('0x7'));var interaction=require(_0x1b92('0x8'));var config=require(_0x1b92('0x9'));var controller=require(_0x1b92('0xa'));router[_0x1b92('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b92('0xb')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0xe')]);router[_0x1b92('0xb')](_0x1b92('0xf'),auth['isAuthenticated'](),controller[_0x1b92('0x10')]);router['get'](_0x1b92('0x11'),auth['isAuthenticated'](),controller[_0x1b92('0x12')]);router[_0x1b92('0x13')]('/',auth[_0x1b92('0xd')](),controller[_0x1b92('0x14')]);router[_0x1b92('0x13')](_0x1b92('0xf'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x15')]);router[_0x1b92('0x16')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x17')]);router[_0x1b92('0x18')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x19')]);module[_0x1b92('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 ce7569d..3d6fd0c 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 _0xf03a=['exports','STRING','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xf03a,0x1a0));var _0xaf03=function(_0x1ae31c,_0x3b3e51){_0x1ae31c=_0x1ae31c-0x0;var _0x47f711=_0xf03a[_0x1ae31c];return _0x47f711;};'use strict';var Sequelize=require('sequelize');module[_0xaf03('0x0')]={'name':{'type':Sequelize[_0xaf03('0x1')]},'description':{'type':Sequelize[_0xaf03('0x1')]},'username':{'type':Sequelize[_0xaf03('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xaf03('0x1')]},'token':{'type':Sequelize[_0xaf03('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xaf03('0x2')},'authType':{'type':Sequelize[_0xaf03('0x3')](_0xaf03('0x4'),_0xaf03('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xaf03('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xaf03('0x6'),_0xaf03('0x7')),'defaultValue':_0xaf03('0x6')}}; \ No newline at end of file +var _0x1574=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports'];(function(_0x295583,_0x4756aa){var _0x4c2ae6=function(_0xa20d19){while(--_0xa20d19){_0x295583['push'](_0x295583['shift']());}};_0x4c2ae6(++_0x4756aa);}(_0x1574,0x148));var _0x4157=function(_0x43a435,_0x1f811e){_0x43a435=_0x43a435-0x0;var _0x2a7284=_0x1574[_0x43a435];return _0x2a7284;};'use strict';var Sequelize=require(_0x4157('0x0'));module[_0x4157('0x1')]={'name':{'type':Sequelize[_0x4157('0x2')]},'description':{'type':Sequelize[_0x4157('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4157('0x3')},'password':{'type':Sequelize[_0x4157('0x2')]},'token':{'type':Sequelize[_0x4157('0x2')]},'remoteUri':{'type':Sequelize[_0x4157('0x2')],'unique':_0x4157('0x4')},'authType':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x6'),_0x4157('0x7')),'defaultValue':_0x4157('0x6')},'serverUrl':{'type':Sequelize[_0x4157('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x8'),_0x4157('0x9')),'defaultValue':_0x4157('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 20ff2ad..e9c3de6 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 _0xa571=['lastIndexOf','GET','format','%s/%s','ticket_fields','headers','%s:%s','password','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','ZendeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskConfiguration','order','merge','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','substring'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa571,0x107));var _0x1a57=function(_0x552ea5,_0x28c15c){_0x552ea5=_0x552ea5-0x0;var _0x34dc4a=_0xa571[_0x552ea5];return _0x34dc4a;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];var integrations=require(_0x1a57('0x18'));function respondWithStatusCode(_0x202d9a,_0x5ae643){_0x5ae643=_0x5ae643||0xcc;return function(_0x3de36a){if(_0x3de36a){return _0x202d9a[_0x1a57('0x19')](_0x5ae643);}return _0x202d9a['status'](_0x5ae643)[_0x1a57('0x1a')]();};}function respondWithResult(_0x587422,_0xd08107){_0xd08107=_0xd08107||0xc8;return function(_0x17434c){if(_0x17434c){return _0x587422[_0x1a57('0x1b')](_0xd08107)[_0x1a57('0x1c')](_0x17434c);}};}function respondWithFilteredResult(_0x5802d6,_0x20f7ad){return function(_0x53c61f){if(_0x53c61f){var _0x49ee05=typeof _0x20f7ad[_0x1a57('0x1d')]===_0x1a57('0x1e')&&typeof _0x20f7ad[_0x1a57('0x1f')]==='undefined';var _0x10793e=_0x53c61f[_0x1a57('0x20')];var _0x80f8c1=_0x49ee05?0x0:_0x20f7ad['offset'];var _0x3daa66=_0x49ee05?_0x53c61f[_0x1a57('0x20')]:_0x20f7ad[_0x1a57('0x1d')]+_0x20f7ad[_0x1a57('0x1f')];var _0xe936dd;if(_0x3daa66>=_0x10793e){_0x3daa66=_0x10793e;_0xe936dd=0xc8;}else{_0xe936dd=0xce;}_0x5802d6['status'](_0xe936dd);return _0x5802d6['set'](_0x1a57('0x21'),_0x80f8c1+'-'+_0x3daa66+'/'+_0x10793e)[_0x1a57('0x1c')](_0x53c61f);}return null;};}function patchUpdates(_0x211c63){return function(_0x4d3e05){try{jsonpatch['apply'](_0x4d3e05,_0x211c63,!![]);}catch(_0x51e271){return BPromise[_0x1a57('0x22')](_0x51e271);}return _0x4d3e05[_0x1a57('0x23')]();};}function saveUpdates(_0x3f52b9,_0xee133b){return function(_0x277d06){if(_0x277d06){return _0x277d06[_0x1a57('0x24')](_0x3f52b9)[_0x1a57('0x25')](function(_0x2f8b00){return _0x2f8b00;});}return null;};}function removeEntity(_0x183ca3,_0x35d5dc){return function(_0x29e7cd){if(_0x29e7cd){return _0x29e7cd[_0x1a57('0x26')]()[_0x1a57('0x25')](function(){_0x183ca3[_0x1a57('0x1b')](0xcc)[_0x1a57('0x1a')]();});}};}function handleEntityNotFound(_0x182649,_0x25c1e9){return function(_0x267302){if(!_0x267302){_0x182649[_0x1a57('0x19')](0x194);}return _0x267302;};}function handleError(_0xf6ffef,_0x26584b){_0x26584b=_0x26584b||0x1f4;return function(_0x1dd939){logger['error'](_0x1dd939['stack']);if(_0x1dd939[_0x1a57('0x27')]){delete _0x1dd939[_0x1a57('0x27')];}_0xf6ffef['status'](_0x26584b)[_0x1a57('0x28')](_0x1dd939);};}exports['index']=function(_0x2d8738,_0x4a2901){var _0x53bf6e={},_0x8179a4={},_0x274fe6={'count':0x0,'rows':[]};var _0x30527c=_[_0x1a57('0x29')](db['ZendeskAccount'][_0x1a57('0x2a')],function(_0x396832){return{'name':_0x396832[_0x1a57('0x2b')],'type':_0x396832[_0x1a57('0x2c')]['key']};});_0x8179a4[_0x1a57('0x2d')]=_[_0x1a57('0x29')](_0x30527c,_0x1a57('0x27'));_0x8179a4[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x2d8738[_0x1a57('0x2e')]);_0x8179a4[_0x1a57('0x30')]=_[_0x1a57('0x31')](_0x8179a4[_0x1a57('0x2d')],_0x8179a4['query']);_0x53bf6e[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x8179a4['model'],qs['fields'](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x53bf6e[_0x1a57('0x32')]=_0x53bf6e[_0x1a57('0x32')][_0x1a57('0x34')]?_0x53bf6e[_0x1a57('0x32')]:_0x8179a4[_0x1a57('0x2d')];if(!_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x35')](_0x1a57('0x36'))){_0x53bf6e[_0x1a57('0x1f')]=qs[_0x1a57('0x1f')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x53bf6e[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1d')]);}_0x53bf6e['order']=qs[_0x1a57('0x37')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x53bf6e[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_[_0x1a57('0x39')](_0x2d8738[_0x1a57('0x2e')],_0x8179a4[_0x1a57('0x30')]),_0x30527c);if(_0x2d8738[_0x1a57('0x2e')]['filter']){_0x53bf6e['where']=_['merge'](_0x53bf6e['where'],{'$or':_[_0x1a57('0x29')](_0x30527c,function(_0x14d619){if(_0x14d619[_0x1a57('0x2c')]!=='VIRTUAL'){var _0x364797={};_0x364797[_0x14d619[_0x1a57('0x27')]]={'$like':'%'+_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x364797;}})});}_0x53bf6e=_['merge']({},_0x53bf6e,_0x2d8738[_0x1a57('0x3b')]);var _0x5e79f0={'where':_0x53bf6e[_0x1a57('0x38')]};return db[_0x1a57('0x3c')][_0x1a57('0x20')](_0x5e79f0)['then'](function(_0x1848cc){_0x274fe6[_0x1a57('0x20')]=_0x1848cc;if(_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3d')]){_0x53bf6e[_0x1a57('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x1a57('0x3f')](_0x53bf6e);})['then'](function(_0x4ba6b3){_0x274fe6[_0x1a57('0x40')]=_0x4ba6b3;return _0x274fe6;})['then'](respondWithFilteredResult(_0x4a2901,_0x53bf6e))[_0x1a57('0x41')](handleError(_0x4a2901,null));};exports[_0x1a57('0x42')]=function(_0x3fbae1,_0x59abb1){var _0x188a50={'raw':![],'where':{'id':_0x3fbae1[_0x1a57('0x43')]['id']}},_0x3c7ea8={};_0x3c7ea8[_0x1a57('0x2d')]=_['keys'](db[_0x1a57('0x3c')][_0x1a57('0x2a')]);_0x3c7ea8['query']=_[_0x1a57('0x2f')](_0x3fbae1['query']);_0x3c7ea8['filters']=_[_0x1a57('0x31')](_0x3c7ea8[_0x1a57('0x2d')],_0x3c7ea8[_0x1a57('0x2e')]);_0x188a50[_0x1a57('0x32')]=_['intersection'](_0x3c7ea8[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x3fbae1[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x188a50[_0x1a57('0x32')]=_0x188a50['attributes'][_0x1a57('0x34')]?_0x188a50[_0x1a57('0x32')]:_0x3c7ea8[_0x1a57('0x2d')];if(_0x3fbae1[_0x1a57('0x2e')]['includeAll']){_0x188a50[_0x1a57('0x3e')]=[{'all':!![]}];}_0x188a50=_['merge']({},_0x188a50,_0x3fbae1[_0x1a57('0x3b')]);return db[_0x1a57('0x3c')][_0x1a57('0x44')](_0x188a50)[_0x1a57('0x25')](handleEntityNotFound(_0x59abb1,null))[_0x1a57('0x25')](respondWithResult(_0x59abb1,null))[_0x1a57('0x41')](handleError(_0x59abb1,null));};exports[_0x1a57('0x45')]=function(_0x401285,_0x29fe1f){return db[_0x1a57('0x3c')][_0x1a57('0x45')](_0x401285[_0x1a57('0x46')],{})[_0x1a57('0x25')](respondWithResult(_0x29fe1f,0xc9))['catch'](handleError(_0x29fe1f,null));};exports[_0x1a57('0x24')]=function(_0x480aff,_0x3bf103){if(_0x480aff[_0x1a57('0x46')]['id']){delete _0x480aff[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')][_0x1a57('0x44')]({'where':{'id':_0x480aff[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x3bf103,null))[_0x1a57('0x25')](saveUpdates(_0x480aff[_0x1a57('0x46')],null))['then'](respondWithResult(_0x3bf103,null))[_0x1a57('0x41')](handleError(_0x3bf103,null));};exports[_0x1a57('0x26')]=function(_0x51651d,_0x15f1f5){return db[_0x1a57('0x3c')]['find']({'where':{'id':_0x51651d[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x15f1f5,null))['then'](removeEntity(_0x15f1f5,null))['catch'](handleError(_0x15f1f5,null));};exports['getConfigurations']=function(_0x2c1bac,_0x41465b,_0x509c4f){var _0x1ec79c={};var _0x18267c={};var _0x572202;var _0x5e510e;return db['ZendeskAccount'][_0x1a57('0x47')]({'where':{'id':_0x2c1bac[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x41465b,null))[_0x1a57('0x25')](function(_0x28738e){if(_0x28738e){_0x572202=_0x28738e;_0x18267c[_0x1a57('0x2d')]=_[_0x1a57('0x2f')](db[_0x1a57('0x48')]['rawAttributes']);_0x18267c['query']=_['keys'](_0x2c1bac['query']);_0x18267c['filters']=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],_0x18267c[_0x1a57('0x2e')]);_0x1ec79c[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x2c1bac[_0x1a57('0x2e')]['fields']));_0x1ec79c['attributes']=_0x1ec79c['attributes'][_0x1a57('0x34')]?_0x1ec79c['attributes']:_0x18267c[_0x1a57('0x2d')];_0x1ec79c[_0x1a57('0x49')]=qs[_0x1a57('0x37')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x1ec79c[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_['pick'](_0x2c1bac['query'],_0x18267c['filters']));if(_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]){_0x1ec79c[_0x1a57('0x38')]=_[_0x1a57('0x4a')](_0x1ec79c[_0x1a57('0x38')],{'$or':_[_0x1a57('0x29')](_0x1ec79c[_0x1a57('0x32')],function(_0x4ab246){var _0x5b691c={};_0x5b691c[_0x4ab246]={'$like':'%'+_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x5b691c;})});}_0x1ec79c=_[_0x1a57('0x4a')]({},_0x1ec79c,_0x2c1bac[_0x1a57('0x3b')]);return _0x572202[_0x1a57('0x4b')](_0x1ec79c);}})[_0x1a57('0x25')](function(_0x59a731){if(_0x59a731){_0x5e510e=_0x59a731['length'];if(!_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x35')]('nolimit')){_0x1ec79c['limit']=qs[_0x1a57('0x1f')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x1ec79c[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1d')]);}return _0x572202['getConfigurations'](_0x1ec79c);}})['then'](function(_0x2fbf49){if(_0x2fbf49){return _0x2fbf49?{'count':_0x5e510e,'rows':_0x2fbf49}:null;}})[_0x1a57('0x25')](respondWithResult(_0x41465b,null))[_0x1a57('0x41')](handleError(_0x41465b,null));};exports[_0x1a57('0x4c')]=function(_0x5d92dc,_0x33092d,_0x28354c){if(_0x5d92dc[_0x1a57('0x46')]['id']){delete _0x5d92dc[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')]['findOne']({'where':{'id':_0x5d92dc['params']['id']}})['then'](handleEntityNotFound(_0x33092d,null))[_0x1a57('0x25')](function(_0x223ba5){if(_0x223ba5){_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4d')]=_0x223ba5['id'];_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4e')]=integrations[_0x1a57('0x4f')](_0x5d92dc[_0x1a57('0x46')]['channel'],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);_0x5d92dc['body']['Descriptions']=integrations[_0x1a57('0x50')](_0x5d92dc['body'][_0x1a57('0x51')],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);return db[_0x1a57('0x48')][_0x1a57('0x45')](_0x5d92dc[_0x1a57('0x46')],{'include':[{'model':db[_0x1a57('0x52')],'as':_0x1a57('0x4e')},{'model':db['ZendeskField'],'as':_0x1a57('0x53')}]});}return null;})[_0x1a57('0x25')](respondWithResult(_0x33092d,null))['catch'](handleError(_0x33092d,null));};exports[_0x1a57('0x54')]=function(_0x392f49,_0x20b0d5,_0x570674){var _0x5c3eb8='';return db[_0x1a57('0x3c')][_0x1a57('0x47')]({'where':{'id':_0x392f49[_0x1a57('0x43')]['id']},'attributes':['id',_0x1a57('0x55'),'password',_0x1a57('0x56'),_0x1a57('0x57'),_0x1a57('0x58')]})[_0x1a57('0x25')](handleEntityNotFound(_0x20b0d5,null))[_0x1a57('0x25')](function(_0x58d8cc){if(_0x58d8cc){_0x5c3eb8=_0x58d8cc[_0x1a57('0x58')];var _0x393187=_0x5c3eb8[_0x1a57('0x59')](-0x1);if(_0x393187==='/'){_0x5c3eb8=_0x5c3eb8[_0x1a57('0x5a')](0x0,_0x5c3eb8[_0x1a57('0x5b')](_0x393187));}var _0x69f3fb={'method':_0x1a57('0x5c'),'uri':util[_0x1a57('0x5d')](_0x1a57('0x5e'),_0x5c3eb8,_0x1a57('0x5f')),'json':!![]};switch(_0x58d8cc[_0x1a57('0x57')]){case'password':_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')]('Basic\x20%s',new Buffer(util[_0x1a57('0x5d')](_0x1a57('0x61'),_0x58d8cc['username'],_0x58d8cc[_0x1a57('0x62')]))[_0x1a57('0x63')](_0x1a57('0x64')))};break;case _0x1a57('0x56'):_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')](_0x1a57('0x65'),new Buffer(util[_0x1a57('0x5d')]('%s/token:%s',_0x58d8cc[_0x1a57('0x55')],_0x58d8cc[_0x1a57('0x56')]))['toString'](_0x1a57('0x64')))};break;default:throw new db[(_0x1a57('0x66'))][(_0x1a57('0x67'))](_0x1a57('0x68'));}return rp(_0x69f3fb);}})[_0x1a57('0x25')](function(_0xf2b1c5){if(_0xf2b1c5){var _0x220725=[_0x1a57('0x69'),_0x1a57('0x6a'),'group',_0x1a57('0x6b')];_[_0x1a57('0x6c')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x1e4d4e){return _0x220725[_0x1a57('0x6d')](_0x1e4d4e['type']);});return{'count':_0xf2b1c5[_0x1a57('0x5f')][_0x1a57('0x34')],'rows':_[_0x1a57('0x29')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x33f8da){return{'id':_0x33f8da['id'],'name':_0x33f8da[_0x1a57('0x6e')]>0x7?_0x33f8da[_0x1a57('0x6f')]:_0x33f8da[_0x1a57('0x2c')],'custom':_0x33f8da['position']>0x7?!![]:![],'options':_0x33f8da[_0x1a57('0x70')]?_0x33f8da[_0x1a57('0x70')]:_0x33f8da[_0x1a57('0x71')]?_0x33f8da[_0x1a57('0x71')]:[]};})};}})['then'](respondWithResult(_0x20b0d5,null))['catch'](function(_0x49f809){var _0x57cd92=_0x392f49['query'][_0x1a57('0x72')]?0x1f4:_0x49f809[_0x1a57('0x73')]||0x1f4;logger['error'](_0x1a57('0x74'),_0x1a57('0x54'),_0x57cd92,JSON['stringify'](_0x49f809));delete _0x49f809[_0x1a57('0x27')];if(_0x57cd92===0x191){_0x57cd92=0x190;}_0x20b0d5[_0x1a57('0x1b')](_0x57cd92)[_0x1a57('0x28')](_0x392f49[_0x1a57('0x2e')]['test']?{'message':_0x1a57('0x75'),'statusCode':_0x49f809[_0x1a57('0x73')]}:_0x49f809);});}; \ No newline at end of file +var _0x9c00=['options','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','findOne','filter'];(function(_0x4fb65f,_0x507407){var _0x230ef0=function(_0x14af52){while(--_0x14af52){_0x4fb65f['push'](_0x4fb65f['shift']());}};_0x230ef0(++_0x507407);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x9c00[_0x2b63c9];return _0x5928c6;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];var integrations=require(_0x09c0('0x1b'));function respondWithStatusCode(_0x3b95cc,_0x331905){_0x331905=_0x331905||0xcc;return function(_0x6149a8){if(_0x6149a8){return _0x3b95cc[_0x09c0('0x1c')](_0x331905);}return _0x3b95cc[_0x09c0('0x1d')](_0x331905)[_0x09c0('0x1e')]();};}function respondWithResult(_0x16e490,_0x254598){_0x254598=_0x254598||0xc8;return function(_0x152140){if(_0x152140){return _0x16e490[_0x09c0('0x1d')](_0x254598)[_0x09c0('0x1f')](_0x152140);}};}function respondWithFilteredResult(_0x2fdf11,_0x4ff6b7){return function(_0x590129){if(_0x590129){var _0x558b4f=typeof _0x4ff6b7[_0x09c0('0x20')]===_0x09c0('0x21')&&typeof _0x4ff6b7[_0x09c0('0x22')]===_0x09c0('0x21');var _0x5dcab7=_0x590129[_0x09c0('0x23')];var _0x4aa8a5=_0x558b4f?0x0:_0x4ff6b7['offset'];var _0x2c12da=_0x558b4f?_0x590129['count']:_0x4ff6b7[_0x09c0('0x20')]+_0x4ff6b7[_0x09c0('0x22')];var _0x2da257;if(_0x2c12da>=_0x5dcab7){_0x2c12da=_0x5dcab7;_0x2da257=0xc8;}else{_0x2da257=0xce;}_0x2fdf11['status'](_0x2da257);return _0x2fdf11[_0x09c0('0x24')](_0x09c0('0x25'),_0x4aa8a5+'-'+_0x2c12da+'/'+_0x5dcab7)[_0x09c0('0x1f')](_0x590129);}return null;};}function patchUpdates(_0x3447c5){return function(_0x12bba7){try{jsonpatch[_0x09c0('0x26')](_0x12bba7,_0x3447c5,!![]);}catch(_0x8c6b9a){return BPromise['reject'](_0x8c6b9a);}return _0x12bba7[_0x09c0('0x27')]();};}function saveUpdates(_0x46f171,_0x473fbd){return function(_0x1d18e9){if(_0x1d18e9){return _0x1d18e9['update'](_0x46f171)['then'](function(_0x321bcc){return _0x321bcc;});}return null;};}function removeEntity(_0x25fdb5,_0x1e8a1c){return function(_0x3a5370){if(_0x3a5370){return _0x3a5370['destroy']()[_0x09c0('0x28')](function(){_0x25fdb5[_0x09c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(!_0x2e3d4d){_0x2c7202[_0x09c0('0x1c')](0x194);}return _0x2e3d4d;};}function handleError(_0x1f8131,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0x1f4;return function(_0x45cc64){logger[_0x09c0('0x29')](_0x45cc64[_0x09c0('0x2a')]);if(_0x45cc64[_0x09c0('0x2b')]){delete _0x45cc64[_0x09c0('0x2b')];}_0x1f8131['status'](_0x1d2d9d)[_0x09c0('0x2c')](_0x45cc64);};}exports[_0x09c0('0x2d')]=function(_0x53a7b8,_0x1d09e0){var _0x5aa0b9={},_0x3f5b10={},_0x4d6bdc={'count':0x0,'rows':[]};var _0x3ac8e4=_[_0x09c0('0x2e')](db[_0x09c0('0x2f')][_0x09c0('0x30')],function(_0x4e999a){return{'name':_0x4e999a['fieldName'],'type':_0x4e999a[_0x09c0('0x31')][_0x09c0('0x32')]};});_0x3f5b10[_0x09c0('0x33')]=_['map'](_0x3ac8e4,_0x09c0('0x2b'));_0x3f5b10['query']=_[_0x09c0('0x34')](_0x53a7b8[_0x09c0('0x35')]);_0x3f5b10[_0x09c0('0x36')]=_['intersection'](_0x3f5b10[_0x09c0('0x33')],_0x3f5b10[_0x09c0('0x35')]);_0x5aa0b9[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x3f5b10[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x53a7b8[_0x09c0('0x35')]['fields']));_0x5aa0b9[_0x09c0('0x37')]=_0x5aa0b9[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x5aa0b9[_0x09c0('0x37')]:_0x3f5b10[_0x09c0('0x33')];if(!_0x53a7b8['query'][_0x09c0('0x3b')](_0x09c0('0x3c'))){_0x5aa0b9[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0x53a7b8[_0x09c0('0x35')]['limit']);_0x5aa0b9[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x53a7b8[_0x09c0('0x35')][_0x09c0('0x20')]);}_0x5aa0b9[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0x53a7b8[_0x09c0('0x35')]['sort']);_0x5aa0b9[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0x53a7b8[_0x09c0('0x35')],_0x3f5b10[_0x09c0('0x36')]),_0x3ac8e4);if(_0x53a7b8['query']['filter']){_0x5aa0b9['where']=_['merge'](_0x5aa0b9[_0x09c0('0x3f')],{'$or':_[_0x09c0('0x2e')](_0x3ac8e4,function(_0xfd295b){if(_0xfd295b[_0x09c0('0x31')]!==_0x09c0('0x41')){var _0x4bd637={};_0x4bd637[_0xfd295b[_0x09c0('0x2b')]]={'$like':'%'+_0x53a7b8[_0x09c0('0x35')]['filter']+'%'};return _0x4bd637;}})});}_0x5aa0b9=_[_0x09c0('0x42')]({},_0x5aa0b9,_0x53a7b8['options']);var _0x3ee063={'where':_0x5aa0b9['where']};return db[_0x09c0('0x2f')][_0x09c0('0x23')](_0x3ee063)['then'](function(_0x26a21c){_0x4d6bdc[_0x09c0('0x23')]=_0x26a21c;if(_0x53a7b8['query'][_0x09c0('0x43')]){_0x5aa0b9[_0x09c0('0x44')]=[{'all':!![]}];}return db[_0x09c0('0x2f')][_0x09c0('0x45')](_0x5aa0b9);})[_0x09c0('0x28')](function(_0x34326c){_0x4d6bdc['rows']=_0x34326c;return _0x4d6bdc;})[_0x09c0('0x28')](respondWithFilteredResult(_0x1d09e0,_0x5aa0b9))[_0x09c0('0x46')](handleError(_0x1d09e0,null));};exports[_0x09c0('0x47')]=function(_0x57835c,_0x193ed2){var _0x30c0c5={'raw':![],'where':{'id':_0x57835c['params']['id']}},_0x447224={};_0x447224[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskAccount']['rawAttributes']);_0x447224[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0x57835c['query']);_0x447224[_0x09c0('0x36')]=_[_0x09c0('0x38')](_0x447224['model'],_0x447224[_0x09c0('0x35')]);_0x30c0c5[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x447224[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x57835c['query'][_0x09c0('0x39')]));_0x30c0c5['attributes']=_0x30c0c5['attributes'][_0x09c0('0x3a')]?_0x30c0c5[_0x09c0('0x37')]:_0x447224[_0x09c0('0x33')];if(_0x57835c[_0x09c0('0x35')][_0x09c0('0x43')]){_0x30c0c5[_0x09c0('0x44')]=[{'all':!![]}];}_0x30c0c5=_['merge']({},_0x30c0c5,_0x57835c['options']);return db['ZendeskAccount'][_0x09c0('0x48')](_0x30c0c5)[_0x09c0('0x28')](handleEntityNotFound(_0x193ed2,null))[_0x09c0('0x28')](respondWithResult(_0x193ed2,null))['catch'](handleError(_0x193ed2,null));};exports[_0x09c0('0x49')]=function(_0xff9650,_0x2016f1){return db[_0x09c0('0x2f')][_0x09c0('0x49')](_0xff9650[_0x09c0('0x4a')],{})[_0x09c0('0x28')](respondWithResult(_0x2016f1,0xc9))[_0x09c0('0x46')](handleError(_0x2016f1,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){if(_0x38085c[_0x09c0('0x4a')]['id']){delete _0x38085c[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x38085c[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x1b0198,null))[_0x09c0('0x28')](saveUpdates(_0x38085c[_0x09c0('0x4a')],null))[_0x09c0('0x28')](respondWithResult(_0x1b0198,null))['catch'](handleError(_0x1b0198,null));};exports[_0x09c0('0x4d')]=function(_0x44befb,_0x15b0a2){return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x44befb['params']['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x15b0a2,null))[_0x09c0('0x28')](removeEntity(_0x15b0a2,null))[_0x09c0('0x46')](handleError(_0x15b0a2,null));};exports['getConfigurations']=function(_0xe0b82a,_0x18c728,_0x14b701){var _0x25a36a={};var _0x55b0f0={};var _0xebfd6d;var _0x45ecd0;return db['ZendeskAccount'][_0x09c0('0x4e')]({'where':{'id':_0xe0b82a[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x18c728,null))[_0x09c0('0x28')](function(_0x21fe00){if(_0x21fe00){_0xebfd6d=_0x21fe00;_0x55b0f0[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskConfiguration']['rawAttributes']);_0x55b0f0[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0xe0b82a[_0x09c0('0x35')]);_0x55b0f0['filters']=_[_0x09c0('0x38')](_0x55b0f0['model'],_0x55b0f0[_0x09c0('0x35')]);_0x25a36a[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x55b0f0[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x39')]));_0x25a36a['attributes']=_0x25a36a[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x25a36a[_0x09c0('0x37')]:_0x55b0f0[_0x09c0('0x33')];_0x25a36a[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x3e')]);_0x25a36a[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0xe0b82a['query'],_0x55b0f0[_0x09c0('0x36')]));if(_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x4f')]){_0x25a36a[_0x09c0('0x3f')]=_['merge'](_0x25a36a[_0x09c0('0x3f')],{'$or':_['map'](_0x25a36a[_0x09c0('0x37')],function(_0x9a4f4){var _0x1cfdb3={};_0x1cfdb3[_0x9a4f4]={'$like':'%'+_0xe0b82a['query']['filter']+'%'};return _0x1cfdb3;})});}_0x25a36a=_[_0x09c0('0x42')]({},_0x25a36a,_0xe0b82a[_0x09c0('0x50')]);return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x4b65c7){if(_0x4b65c7){_0x45ecd0=_0x4b65c7[_0x09c0('0x3a')];if(!_0xe0b82a[_0x09c0('0x35')]['hasOwnProperty'](_0x09c0('0x3c'))){_0x25a36a[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0xe0b82a[_0x09c0('0x35')]['limit']);_0x25a36a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x20')]);}return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x30d976){if(_0x30d976){return _0x30d976?{'count':_0x45ecd0,'rows':_0x30d976}:null;}})[_0x09c0('0x28')](respondWithResult(_0x18c728,null))[_0x09c0('0x46')](handleError(_0x18c728,null));};exports[_0x09c0('0x52')]=function(_0x85adc7,_0x2906cb,_0x2d67e8){if(_0x85adc7['body']['id']){delete _0x85adc7[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x85adc7[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x2906cb,null))['then'](function(_0x1205da){if(_0x1205da){_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x53')]=_0x1205da['id'];_0x85adc7[_0x09c0('0x4a')]['Subjects']=integrations[_0x09c0('0x54')](_0x85adc7[_0x09c0('0x4a')]['channel'],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x55')]=integrations[_0x09c0('0x56')](_0x85adc7['body'][_0x09c0('0x57')],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);return db[_0x09c0('0x58')][_0x09c0('0x49')](_0x85adc7['body'],{'include':[{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x5a')},{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x55')}]});}return null;})[_0x09c0('0x28')](respondWithResult(_0x2906cb,null))[_0x09c0('0x46')](handleError(_0x2906cb,null));};exports['getFields']=function(_0x51fc84,_0x583c0d,_0x52fe65){var _0x7c1cb8='';return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x51fc84['params']['id']},'attributes':['id',_0x09c0('0x5b'),'password',_0x09c0('0x5c'),_0x09c0('0x5d'),'remoteUri']})[_0x09c0('0x28')](handleEntityNotFound(_0x583c0d,null))['then'](function(_0x4a42c4){if(_0x4a42c4){_0x7c1cb8=_0x4a42c4[_0x09c0('0x5e')];var _0x111647=_0x7c1cb8[_0x09c0('0x5f')](-0x1);if(_0x111647==='/'){_0x7c1cb8=_0x7c1cb8[_0x09c0('0x60')](0x0,_0x7c1cb8[_0x09c0('0x61')](_0x111647));}var _0x3ffd37={'method':_0x09c0('0x62'),'uri':util[_0x09c0('0x63')](_0x09c0('0x64'),_0x7c1cb8,_0x09c0('0x65')),'json':!![]};switch(_0x4a42c4['authType']){case _0x09c0('0x66'):_0x3ffd37[_0x09c0('0x67')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x68'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x66')]))[_0x09c0('0x69')](_0x09c0('0x6a')))};break;case _0x09c0('0x5c'):_0x3ffd37['headers']={'Authorization':util[_0x09c0('0x63')]('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x6b'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x5c')]))[_0x09c0('0x69')]('base64'))};break;default:throw new db[(_0x09c0('0x6c'))]['ValidationError'](_0x09c0('0x6d'));}return rp(_0x3ffd37);}})['then'](function(_0x35c446){if(_0x35c446){var _0x3e8b19=[_0x09c0('0x6e'),_0x09c0('0x6f'),_0x09c0('0x70'),_0x09c0('0x71')];_[_0x09c0('0x72')](_0x35c446['ticket_fields'],function(_0x4ab50d){return _0x3e8b19[_0x09c0('0x73')](_0x4ab50d[_0x09c0('0x31')]);});return{'count':_0x35c446[_0x09c0('0x65')][_0x09c0('0x3a')],'rows':_[_0x09c0('0x2e')](_0x35c446[_0x09c0('0x65')],function(_0x4060bb){return{'id':_0x4060bb['id'],'name':_0x4060bb[_0x09c0('0x74')]>0x7?_0x4060bb[_0x09c0('0x75')]:_0x4060bb[_0x09c0('0x31')],'custom':_0x4060bb['position']>0x7?!![]:![],'options':_0x4060bb['system_field_options']?_0x4060bb['system_field_options']:_0x4060bb[_0x09c0('0x76')]?_0x4060bb[_0x09c0('0x76')]:[]};})};}})[_0x09c0('0x28')](respondWithResult(_0x583c0d,null))['catch'](function(_0x5f1857){var _0x1618de=_0x51fc84['query'][_0x09c0('0x77')]?0x1f4:_0x5f1857[_0x09c0('0x78')]||0x1f4;logger['error'](_0x09c0('0x79'),'getFields',_0x1618de,JSON[_0x09c0('0x7a')](_0x5f1857));delete _0x5f1857[_0x09c0('0x2b')];if(_0x1618de===0x191){_0x1618de=0x190;}_0x583c0d[_0x09c0('0x1d')](_0x1618de)['send'](_0x51fc84[_0x09c0('0x35')][_0x09c0('0x77')]?{'message':_0x09c0('0x7b'),'statusCode':_0x5f1857[_0x09c0('0x78')]}:_0x5f1857);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e045929..e1cd2d8 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 _0x0505=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api'];(function(_0xacf313,_0x4be7a8){var _0x4d0c60=function(_0x487125){while(--_0x487125){_0xacf313['push'](_0xacf313['shift']());}};_0x4d0c60(++_0x4be7a8);}(_0x0505,0xe7));var _0x5050=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x0505[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x5050('0x0'));var util=require('util');var logger=require(_0x5050('0x1'))(_0x5050('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5050('0x3'));var fs=require('fs');var path=require(_0x5050('0x4'));var rimraf=require(_0x5050('0x5'));var config=require(_0x5050('0x6'));var attributes=require(_0x5050('0x7'));var integrations=require(_0x5050('0x8'));module[_0x5050('0x9')]=function(_0x10023c,_0x23c986){return _0x10023c[_0x5050('0xa')](_0x5050('0xb'),attributes,{'tableName':_0x5050('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27fc8b,_0x36c64b){var _0x3cd69c=function(_0x2293ff){while(--_0x2293ff){_0x27fc8b['push'](_0x27fc8b['shift']());}};_0x3cd69c(++_0x36c64b);}(_0x01d9,0x16f));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x901d('0x0'));var moment=require(_0x901d('0x1'));var BPromise=require(_0x901d('0x2'));var rp=require(_0x901d('0x3'));var fs=require('fs');var path=require(_0x901d('0x4'));var rimraf=require(_0x901d('0x5'));var config=require(_0x901d('0x6'));var attributes=require(_0x901d('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x901d('0x8')]=function(_0x4ee5f1,_0x40e944){return _0x4ee5f1[_0x901d('0x9')]('ZendeskAccount',attributes,{'tableName':_0x901d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 97f1a8d..cbb331b 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 _0x7c8d=['GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x7c8d,0x115));var _0xd7c8=function(_0x3ede73,_0x5c2f32){_0x3ede73=_0x3ede73-0x0;var _0x42967c=_0x7c8d[_0x3ede73];return _0x42967c;};'use strict';var _=require(_0xd7c8('0x0'));var util=require(_0xd7c8('0x1'));var moment=require(_0xd7c8('0x2'));var BPromise=require(_0xd7c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7c8('0x4'));var db=require(_0xd7c8('0x5'))['db'];var utils=require(_0xd7c8('0x6'));var logger=require(_0xd7c8('0x7'))('rpc');var config=require(_0xd7c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd7c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39d4e9,_0x462437,_0x3065be){return new BPromise(function(_0x568896,_0x5be160){return client[_0xd7c8('0xa')](_0x39d4e9,_0x3065be)[_0xd7c8('0xb')](function(_0x455d39){logger['info'](_0xd7c8('0xc'),_0x462437,'request\x20sent');logger[_0xd7c8('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x462437,_0xd7c8('0xe'),JSON['stringify'](_0x455d39));if(_0x455d39[_0xd7c8('0xf')]){if(_0x455d39[_0xd7c8('0xf')][_0xd7c8('0x10')]===0x1f4){logger[_0xd7c8('0xf')](_0xd7c8('0xc'),_0x462437,_0x455d39[_0xd7c8('0xf')][_0xd7c8('0x11')]);return _0x5be160(_0x455d39[_0xd7c8('0xf')][_0xd7c8('0x11')]);}logger[_0xd7c8('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x462437,_0x455d39[_0xd7c8('0xf')][_0xd7c8('0x11')]);return _0x568896(_0x455d39[_0xd7c8('0xf')][_0xd7c8('0x11')]);}else{logger[_0xd7c8('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x462437,'request\x20sent');_0x568896(_0x455d39[_0xd7c8('0x13')]['message']);}})['catch'](function(_0x2a52b6){logger[_0xd7c8('0xf')](_0xd7c8('0xc'),_0x462437,_0x2a52b6);_0x5be160(_0x2a52b6);});});}exports[_0xd7c8('0x14')]=function(_0x2ed378){var _0x256c41=this;return new Promise(function(_0x6b2577,_0x55dde4){return db[_0xd7c8('0x15')][_0xd7c8('0x16')]({'raw':_0x2ed378[_0xd7c8('0x17')]?_0x2ed378[_0xd7c8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2ed378[_0xd7c8('0x17')]?_0x2ed378[_0xd7c8('0x17')][_0xd7c8('0x18')]||null:null,'attributes':_0x2ed378['options']?_0x2ed378[_0xd7c8('0x17')][_0xd7c8('0x19')]||null:null,'limit':_0x2ed378[_0xd7c8('0x17')]?_0x2ed378[_0xd7c8('0x17')][_0xd7c8('0x1a')]||null:null,'include':_0x2ed378['options']?_0x2ed378[_0xd7c8('0x17')][_0xd7c8('0x1b')]?_[_0xd7c8('0x1c')](_0x2ed378['options'][_0xd7c8('0x1b')],function(_0x529f7f){return{'model':db[_0x529f7f['model']],'as':_0x529f7f['as'],'attributes':_0x529f7f['attributes'],'include':_0x529f7f[_0xd7c8('0x1b')]?_[_0xd7c8('0x1c')](_0x529f7f[_0xd7c8('0x1b')],function(_0x749c76){return{'model':db[_0x749c76[_0xd7c8('0x1d')]],'as':_0x749c76['as'],'attributes':_0x749c76[_0xd7c8('0x19')],'include':_0x749c76[_0xd7c8('0x1b')]?_[_0xd7c8('0x1c')](_0x749c76['include'],function(_0x5797a4){return{'model':db[_0x5797a4[_0xd7c8('0x1d')]],'as':_0x5797a4['as'],'attributes':_0x5797a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7c8('0xb')](function(_0x1bd0de){logger[_0xd7c8('0x12')](_0xd7c8('0x14'),_0x2ed378);logger['debug'](_0xd7c8('0x14'),_0x2ed378,JSON[_0xd7c8('0x1e')](_0x1bd0de));_0x6b2577(_0x1bd0de);})['catch'](function(_0x4d5c11){logger[_0xd7c8('0xf')]('GetZendeskAccount',_0x4d5c11[_0xd7c8('0x11')],_0x2ed378);_0x55dde4(_0x256c41[_0xd7c8('0xf')](0x1f4,_0x4d5c11[_0xd7c8('0x11')]));});});};exports[_0xd7c8('0x1f')]=function(_0x3821c4){var _0x478ba4=this;return new Promise(function(_0x166a8c,_0x45cad7){return db[_0xd7c8('0x15')][_0xd7c8('0x20')]({'raw':_0x3821c4[_0xd7c8('0x17')]?_0x3821c4[_0xd7c8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3821c4[_0xd7c8('0x17')]?_0x3821c4[_0xd7c8('0x17')]['where']||null:null,'attributes':_0x3821c4[_0xd7c8('0x17')]?_0x3821c4['options'][_0xd7c8('0x19')]||null:null,'include':_0x3821c4[_0xd7c8('0x17')]?_0x3821c4['options'][_0xd7c8('0x1b')]?_[_0xd7c8('0x1c')](_0x3821c4['options'][_0xd7c8('0x1b')],function(_0x1acb14){return{'model':db[_0x1acb14['model']],'as':_0x1acb14['as'],'attributes':_0x1acb14[_0xd7c8('0x19')],'include':_0x1acb14[_0xd7c8('0x1b')]?_[_0xd7c8('0x1c')](_0x1acb14['include'],function(_0x88da9a){return{'model':db[_0x88da9a[_0xd7c8('0x1d')]],'as':_0x88da9a['as'],'attributes':_0x88da9a['attributes'],'include':_0x88da9a['include']?_[_0xd7c8('0x1c')](_0x88da9a[_0xd7c8('0x1b')],function(_0x53192a){return{'model':db[_0x53192a['model']],'as':_0x53192a['as'],'attributes':_0x53192a[_0xd7c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd7c8('0xb')](function(_0x197612){logger[_0xd7c8('0x12')](_0xd7c8('0x1f'),_0x3821c4);logger['debug'](_0xd7c8('0x1f'),_0x3821c4,JSON[_0xd7c8('0x1e')](_0x197612));_0x166a8c(_0x197612);})['catch'](function(_0x490db0){logger['error'](_0xd7c8('0x1f'),_0x490db0[_0xd7c8('0x11')],_0x3821c4);_0x45cad7(_0x478ba4['error'](0x1f4,_0x490db0[_0xd7c8('0x11')]));});});}; \ No newline at end of file +var _0x8b38=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x8b38,0x18a));var _0x88b3=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x8b38[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var moment=require('moment');var BPromise=require(_0x88b3('0x2'));var rs=require(_0x88b3('0x3'));var fs=require('fs');var Redis=require(_0x88b3('0x4'));var db=require(_0x88b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88b3('0x6'))(_0x88b3('0x7'));var config=require(_0x88b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x88b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4197ca,_0x52ab52,_0x18370a){return new BPromise(function(_0x5190af,_0x202634){return client[_0x88b3('0xa')](_0x4197ca,_0x18370a)[_0x88b3('0xb')](function(_0x20dde7){logger[_0x88b3('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x52ab52,_0x88b3('0xd'));logger['debug'](_0x88b3('0xe'),_0x52ab52,_0x88b3('0xd'),JSON[_0x88b3('0xf')](_0x20dde7));if(_0x20dde7[_0x88b3('0x10')]){if(_0x20dde7[_0x88b3('0x10')][_0x88b3('0x11')]===0x1f4){logger['error'](_0x88b3('0x12'),_0x52ab52,_0x20dde7['error']['message']);return _0x202634(_0x20dde7[_0x88b3('0x10')]['message']);}logger[_0x88b3('0x10')](_0x88b3('0x12'),_0x52ab52,_0x20dde7[_0x88b3('0x10')][_0x88b3('0x13')]);return _0x5190af(_0x20dde7[_0x88b3('0x10')][_0x88b3('0x13')]);}else{logger['info'](_0x88b3('0x12'),_0x52ab52,'request\x20sent');_0x5190af(_0x20dde7[_0x88b3('0x14')][_0x88b3('0x13')]);}})[_0x88b3('0x15')](function(_0x42d49f){logger[_0x88b3('0x10')](_0x88b3('0x12'),_0x52ab52,_0x42d49f);_0x202634(_0x42d49f);});});}exports[_0x88b3('0x16')]=function(_0x49b17b){var _0x35b425=this;return new Promise(function(_0x2db3af,_0xf91135){return db['ZendeskAccount'][_0x88b3('0x17')]({'raw':_0x49b17b['options']?_0x49b17b[_0x88b3('0x18')][_0x88b3('0x19')]===undefined?!![]:![]:!![],'where':_0x49b17b[_0x88b3('0x18')]?_0x49b17b['options'][_0x88b3('0x1a')]||null:null,'attributes':_0x49b17b[_0x88b3('0x18')]?_0x49b17b['options'][_0x88b3('0x1b')]||null:null,'limit':_0x49b17b[_0x88b3('0x18')]?_0x49b17b[_0x88b3('0x18')]['limit']||null:null,'include':_0x49b17b[_0x88b3('0x18')]?_0x49b17b[_0x88b3('0x18')][_0x88b3('0x1c')]?_[_0x88b3('0x1d')](_0x49b17b[_0x88b3('0x18')][_0x88b3('0x1c')],function(_0x46f388){return{'model':db[_0x46f388[_0x88b3('0x1e')]],'as':_0x46f388['as'],'attributes':_0x46f388['attributes'],'include':_0x46f388[_0x88b3('0x1c')]?_['map'](_0x46f388[_0x88b3('0x1c')],function(_0x49307c){return{'model':db[_0x49307c['model']],'as':_0x49307c['as'],'attributes':_0x49307c[_0x88b3('0x1b')],'include':_0x49307c['include']?_['map'](_0x49307c[_0x88b3('0x1c')],function(_0x1d1144){return{'model':db[_0x1d1144[_0x88b3('0x1e')]],'as':_0x1d1144['as'],'attributes':_0x1d1144['attributes']};}):[]};}):[]};}):[]:[]})[_0x88b3('0xb')](function(_0x303d9e){logger[_0x88b3('0xc')](_0x88b3('0x16'),_0x49b17b);logger[_0x88b3('0x1f')](_0x88b3('0x16'),_0x49b17b,JSON[_0x88b3('0xf')](_0x303d9e));_0x2db3af(_0x303d9e);})[_0x88b3('0x15')](function(_0x3fd646){logger['error'](_0x88b3('0x16'),_0x3fd646[_0x88b3('0x13')],_0x49b17b);_0xf91135(_0x35b425[_0x88b3('0x10')](0x1f4,_0x3fd646[_0x88b3('0x13')]));});});};exports[_0x88b3('0x20')]=function(_0x5ddf43){var _0x1ac357=this;return new Promise(function(_0x1755ea,_0x5a33fa){return db['ZendeskAccount'][_0x88b3('0x21')]({'raw':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43[_0x88b3('0x18')][_0x88b3('0x1a')]||null:null,'attributes':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43[_0x88b3('0x18')][_0x88b3('0x1b')]||null:null,'include':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43['options'][_0x88b3('0x1c')]?_['map'](_0x5ddf43['options']['include'],function(_0x20f0f1){return{'model':db[_0x20f0f1[_0x88b3('0x1e')]],'as':_0x20f0f1['as'],'attributes':_0x20f0f1['attributes'],'include':_0x20f0f1[_0x88b3('0x1c')]?_[_0x88b3('0x1d')](_0x20f0f1[_0x88b3('0x1c')],function(_0x1fc4c2){return{'model':db[_0x1fc4c2[_0x88b3('0x1e')]],'as':_0x1fc4c2['as'],'attributes':_0x1fc4c2['attributes'],'include':_0x1fc4c2['include']?_[_0x88b3('0x1d')](_0x1fc4c2[_0x88b3('0x1c')],function(_0x19be75){return{'model':db[_0x19be75[_0x88b3('0x1e')]],'as':_0x19be75['as'],'attributes':_0x19be75[_0x88b3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d4b48){logger[_0x88b3('0xc')](_0x88b3('0x20'),_0x5ddf43);logger[_0x88b3('0x1f')]('ShowZendeskAccount',_0x5ddf43,JSON['stringify'](_0x4d4b48));_0x1755ea(_0x4d4b48);})[_0x88b3('0x15')](function(_0xb8b1a4){logger['error']('ShowZendeskAccount',_0xb8b1a4[_0x88b3('0x13')],_0x5ddf43);_0x5a33fa(_0x1ac357[_0x88b3('0x10')](0x1f4,_0xb8b1a4['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index acbed2a..d1e4730 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x478ac2,_0x1b0087){var _0x123194=function(_0x2fadcb){while(--_0x2fadcb){_0x478ac2['push'](_0x478ac2['shift']());}};_0x123194(++_0x1b0087);}(_0xb10b,0x12a));var _0xbb10=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0xb10b[_0x19691f];return _0x5677b6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x54425a,_0x406695){var _0x31f9f9=function(_0x58f707){while(--_0x58f707){_0x54425a['push'](_0x54425a['shift']());}};_0x31f9f9(++_0x406695);}(_0xda3f,0xec));var _0xfda3=function(_0x6fd218,_0x1ec710){_0x6fd218=_0x6fd218-0x0;var _0x4b8110=_0xda3f[_0x6fd218];return _0x4b8110;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index c006f07..c1e658d 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 _0xac0f=['sequelize','exports','STRING'];(function(_0x50efff,_0x16022a){var _0x337538=function(_0x39cb02){while(--_0x39cb02){_0x50efff['push'](_0x50efff['shift']());}};_0x337538(++_0x16022a);}(_0xac0f,0x102));var _0xfac0=function(_0x26cd17,_0x1faa73){_0x26cd17=_0x26cd17-0x0;var _0x3f9e21=_0xac0f[_0x26cd17];return _0x3f9e21;};'use strict';var Sequelize=require(_0xfac0('0x0'));module[_0xfac0('0x1')]={'name':{'type':Sequelize[_0xfac0('0x2')]},'description':{'type':Sequelize[_0xfac0('0x2')]}}; \ No newline at end of file +var _0xe2ce=['STRING','exports'];(function(_0x31211d,_0x1735d2){var _0x537426=function(_0x21656e){while(--_0x21656e){_0x31211d['push'](_0x31211d['shift']());}};_0x537426(++_0x1735d2);}(_0xe2ce,0x10f));var _0xee2c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe2ce[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0xee2c('0x0')]={'name':{'type':Sequelize[_0xee2c('0x1')]},'description':{'type':Sequelize[_0xee2c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b89c211..b01f7b5 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 _0xf301=['type','VIRTUAL','ZendeskConfiguration','includeAll','findAll','catch','show','params','length','include','create','body','find','getFields','findOne','ZendeskField','rawAttributes','pick','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','fieldName','key','model','map','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0xf301,0x124));var _0x1f30=function(_0x2d1b0f,_0x1d49ab){_0x2d1b0f=_0x2d1b0f-0x0;var _0x401404=_0xf301[_0x2d1b0f];return _0x401404;};'use strict';var emlformat=require(_0x1f30('0x0'));var rimraf=require(_0x1f30('0x1'));var zipdir=require(_0x1f30('0x2'));var jsonpatch=require(_0x1f30('0x3'));var rp=require(_0x1f30('0x4'));var moment=require(_0x1f30('0x5'));var BPromise=require(_0x1f30('0x6'));var Mustache=require(_0x1f30('0x7'));var util=require(_0x1f30('0x8'));var path=require(_0x1f30('0x9'));var sox=require(_0x1f30('0xa'));var csv=require(_0x1f30('0xb'));var ejs=require(_0x1f30('0xc'));var fs=require('fs');var fs_extra=require(_0x1f30('0xd'));var _=require(_0x1f30('0xe'));var squel=require(_0x1f30('0xf'));var crypto=require(_0x1f30('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x1f30('0x11'));var toCsv=require(_0x1f30('0xb'));var querystring=require(_0x1f30('0x12'));var Papa=require(_0x1f30('0x13'));var Redis=require(_0x1f30('0x14'));var authService=require(_0x1f30('0x15'));var qs=require(_0x1f30('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1f30('0x17'));var utils=require(_0x1f30('0x18'));var config=require(_0x1f30('0x19'));var licenseUtil=require(_0x1f30('0x1a'));var db=require(_0x1f30('0x1b'))['db'];function respondWithStatusCode(_0x415f50,_0xf964f8){_0xf964f8=_0xf964f8||0xcc;return function(_0x694b66){if(_0x694b66){return _0x415f50[_0x1f30('0x1c')](_0xf964f8);}return _0x415f50[_0x1f30('0x1d')](_0xf964f8)[_0x1f30('0x1e')]();};}function respondWithResult(_0x597007,_0x501b07){_0x501b07=_0x501b07||0xc8;return function(_0x7dc095){if(_0x7dc095){return _0x597007[_0x1f30('0x1d')](_0x501b07)[_0x1f30('0x1f')](_0x7dc095);}};}function respondWithFilteredResult(_0x176062,_0x5c826f){return function(_0x4588ec){if(_0x4588ec){var _0x526bee=typeof _0x5c826f[_0x1f30('0x20')]===_0x1f30('0x21')&&typeof _0x5c826f[_0x1f30('0x22')]===_0x1f30('0x21');var _0x5f0c17=_0x4588ec[_0x1f30('0x23')];var _0xe78cd5=_0x526bee?0x0:_0x5c826f[_0x1f30('0x20')];var _0x5dd4fa=_0x526bee?_0x4588ec[_0x1f30('0x23')]:_0x5c826f[_0x1f30('0x20')]+_0x5c826f[_0x1f30('0x22')];var _0x9f3b41;if(_0x5dd4fa>=_0x5f0c17){_0x5dd4fa=_0x5f0c17;_0x9f3b41=0xc8;}else{_0x9f3b41=0xce;}_0x176062[_0x1f30('0x1d')](_0x9f3b41);return _0x176062[_0x1f30('0x24')](_0x1f30('0x25'),_0xe78cd5+'-'+_0x5dd4fa+'/'+_0x5f0c17)['json'](_0x4588ec);}return null;};}function patchUpdates(_0x33ed06){return function(_0x35f0e6){try{jsonpatch[_0x1f30('0x26')](_0x35f0e6,_0x33ed06,!![]);}catch(_0x3579e9){return BPromise[_0x1f30('0x27')](_0x3579e9);}return _0x35f0e6[_0x1f30('0x28')]();};}function saveUpdates(_0x3d858c,_0x504f1c){return function(_0x4207fe){if(_0x4207fe){return _0x4207fe[_0x1f30('0x29')](_0x3d858c)[_0x1f30('0x2a')](function(_0x2d5c92){return _0x2d5c92;});}return null;};}function removeEntity(_0x262e56,_0x42963e){return function(_0x4ff05b){if(_0x4ff05b){return _0x4ff05b[_0x1f30('0x2b')]()[_0x1f30('0x2a')](function(){_0x262e56[_0x1f30('0x1d')](0xcc)[_0x1f30('0x1e')]();});}};}function handleEntityNotFound(_0x289969,_0x303c9c){return function(_0x58a2c9){if(!_0x58a2c9){_0x289969['sendStatus'](0x194);}return _0x58a2c9;};}function handleError(_0x2935ee,_0x2795e2){_0x2795e2=_0x2795e2||0x1f4;return function(_0x3554e5){logger[_0x1f30('0x2c')](_0x3554e5[_0x1f30('0x2d')]);if(_0x3554e5['name']){delete _0x3554e5['name'];}_0x2935ee[_0x1f30('0x1d')](_0x2795e2)['send'](_0x3554e5);};}exports['index']=function(_0x32fab0,_0x6d3917){var _0x65b309={},_0x95984b={},_0x527294={'count':0x0,'rows':[]};var _0x209687=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0xdd58b5){return{'name':_0xdd58b5[_0x1f30('0x2e')],'type':_0xdd58b5['type'][_0x1f30('0x2f')]};});_0x95984b[_0x1f30('0x30')]=_[_0x1f30('0x31')](_0x209687,_0x1f30('0x32'));_0x95984b['query']=_[_0x1f30('0x33')](_0x32fab0[_0x1f30('0x34')]);_0x95984b[_0x1f30('0x35')]=_[_0x1f30('0x36')](_0x95984b[_0x1f30('0x30')],_0x95984b[_0x1f30('0x34')]);_0x65b309[_0x1f30('0x37')]=_[_0x1f30('0x36')](_0x95984b[_0x1f30('0x30')],qs['fields'](_0x32fab0[_0x1f30('0x34')][_0x1f30('0x38')]));_0x65b309['attributes']=_0x65b309[_0x1f30('0x37')]['length']?_0x65b309[_0x1f30('0x37')]:_0x95984b['model'];if(!_0x32fab0['query'][_0x1f30('0x39')](_0x1f30('0x3a'))){_0x65b309[_0x1f30('0x22')]=qs[_0x1f30('0x22')](_0x32fab0[_0x1f30('0x34')][_0x1f30('0x22')]);_0x65b309[_0x1f30('0x20')]=qs[_0x1f30('0x20')](_0x32fab0[_0x1f30('0x34')]['offset']);}_0x65b309[_0x1f30('0x3b')]=qs[_0x1f30('0x3c')](_0x32fab0[_0x1f30('0x34')]['sort']);_0x65b309[_0x1f30('0x3d')]=qs[_0x1f30('0x35')](_['pick'](_0x32fab0[_0x1f30('0x34')],_0x95984b[_0x1f30('0x35')]),_0x209687);if(_0x32fab0[_0x1f30('0x34')][_0x1f30('0x3e')]){_0x65b309[_0x1f30('0x3d')]=_[_0x1f30('0x3f')](_0x65b309[_0x1f30('0x3d')],{'$or':_[_0x1f30('0x31')](_0x209687,function(_0x1adedf){if(_0x1adedf[_0x1f30('0x40')]!==_0x1f30('0x41')){var _0x341631={};_0x341631[_0x1adedf[_0x1f30('0x32')]]={'$like':'%'+_0x32fab0['query'][_0x1f30('0x3e')]+'%'};return _0x341631;}})});}_0x65b309=_[_0x1f30('0x3f')]({},_0x65b309,_0x32fab0['options']);var _0x4eec8f={'where':_0x65b309[_0x1f30('0x3d')]};return db[_0x1f30('0x42')]['count'](_0x4eec8f)[_0x1f30('0x2a')](function(_0x35c666){_0x527294[_0x1f30('0x23')]=_0x35c666;if(_0x32fab0['query'][_0x1f30('0x43')]){_0x65b309['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x1f30('0x44')](_0x65b309);})[_0x1f30('0x2a')](function(_0x4dd8aa){_0x527294['rows']=_0x4dd8aa;return _0x527294;})[_0x1f30('0x2a')](respondWithFilteredResult(_0x6d3917,_0x65b309))[_0x1f30('0x45')](handleError(_0x6d3917,null));};exports[_0x1f30('0x46')]=function(_0x772eab,_0x18924a){var _0x311b4a={'raw':![],'where':{'id':_0x772eab[_0x1f30('0x47')]['id']}},_0x4f4417={};_0x4f4417[_0x1f30('0x30')]=_[_0x1f30('0x33')](db[_0x1f30('0x42')]['rawAttributes']);_0x4f4417[_0x1f30('0x34')]=_[_0x1f30('0x33')](_0x772eab['query']);_0x4f4417['filters']=_['intersection'](_0x4f4417[_0x1f30('0x30')],_0x4f4417[_0x1f30('0x34')]);_0x311b4a[_0x1f30('0x37')]=_[_0x1f30('0x36')](_0x4f4417[_0x1f30('0x30')],qs[_0x1f30('0x38')](_0x772eab['query']['fields']));_0x311b4a['attributes']=_0x311b4a[_0x1f30('0x37')][_0x1f30('0x48')]?_0x311b4a[_0x1f30('0x37')]:_0x4f4417[_0x1f30('0x30')];if(_0x772eab['query'][_0x1f30('0x43')]){_0x311b4a[_0x1f30('0x49')]=[{'all':!![]}];}_0x311b4a=_['merge']({},_0x311b4a,_0x772eab['options']);return db[_0x1f30('0x42')]['find'](_0x311b4a)[_0x1f30('0x2a')](handleEntityNotFound(_0x18924a,null))[_0x1f30('0x2a')](respondWithResult(_0x18924a,null))[_0x1f30('0x45')](handleError(_0x18924a,null));};exports[_0x1f30('0x4a')]=function(_0x3e2821,_0x103ac7){return db[_0x1f30('0x42')][_0x1f30('0x4a')](_0x3e2821['body'],{})['then'](respondWithResult(_0x103ac7,0xc9))[_0x1f30('0x45')](handleError(_0x103ac7,null));};exports['update']=function(_0x30b9fe,_0x520710){if(_0x30b9fe['body']['id']){delete _0x30b9fe[_0x1f30('0x4b')]['id'];}return db['ZendeskConfiguration'][_0x1f30('0x4c')]({'where':{'id':_0x30b9fe['params']['id']}})['then'](handleEntityNotFound(_0x520710,null))[_0x1f30('0x2a')](saveUpdates(_0x30b9fe['body'],null))[_0x1f30('0x2a')](respondWithResult(_0x520710,null))['catch'](handleError(_0x520710,null));};exports[_0x1f30('0x2b')]=function(_0x23877f,_0x399ec9){return db[_0x1f30('0x42')][_0x1f30('0x4c')]({'where':{'id':_0x23877f[_0x1f30('0x47')]['id']}})[_0x1f30('0x2a')](handleEntityNotFound(_0x399ec9,null))[_0x1f30('0x2a')](removeEntity(_0x399ec9,null))['catch'](handleError(_0x399ec9,null));};exports[_0x1f30('0x4d')]=function(_0x4ea91b,_0x4802dc,_0x598ea9){var _0x584442={};var _0x5aaa58={};var _0x8b76a;var _0x5de2d2;return db[_0x1f30('0x42')][_0x1f30('0x4e')]({'where':{'id':_0x4ea91b['params']['id']}})['then'](handleEntityNotFound(_0x4802dc,null))[_0x1f30('0x2a')](function(_0x5c39dc){if(_0x5c39dc){_0x8b76a=_0x5c39dc;_0x5aaa58[_0x1f30('0x30')]=_[_0x1f30('0x33')](db[_0x1f30('0x4f')]['rawAttributes']);_0x5aaa58['query']=_[_0x1f30('0x33')](_0x4ea91b[_0x1f30('0x34')]);_0x5aaa58[_0x1f30('0x35')]=_[_0x1f30('0x36')](_0x5aaa58[_0x1f30('0x30')],_0x5aaa58['query']);_0x584442[_0x1f30('0x37')]=_[_0x1f30('0x36')](_0x5aaa58[_0x1f30('0x30')],qs[_0x1f30('0x38')](_0x4ea91b[_0x1f30('0x34')][_0x1f30('0x38')]));_0x584442[_0x1f30('0x37')]=_0x584442[_0x1f30('0x37')][_0x1f30('0x48')]?_0x584442[_0x1f30('0x37')]:_0x5aaa58[_0x1f30('0x30')];_0x584442[_0x1f30('0x3b')]=qs['sort'](_0x4ea91b[_0x1f30('0x34')][_0x1f30('0x3c')]);_0x584442[_0x1f30('0x3d')]=qs[_0x1f30('0x35')](_['pick'](_0x4ea91b[_0x1f30('0x34')],_0x5aaa58[_0x1f30('0x35')]));if(_0x4ea91b[_0x1f30('0x34')][_0x1f30('0x3e')]){_0x584442[_0x1f30('0x3d')]=_[_0x1f30('0x3f')](_0x584442[_0x1f30('0x3d')],{'$or':_[_0x1f30('0x31')](_0x584442[_0x1f30('0x37')],function(_0x10bc57){var _0x4daa72={};_0x4daa72[_0x10bc57]={'$like':'%'+_0x4ea91b[_0x1f30('0x34')]['filter']+'%'};return _0x4daa72;})});}_0x584442=_[_0x1f30('0x3f')]({},_0x584442,_0x4ea91b['options']);return _0x8b76a['getFields'](_0x584442);}})[_0x1f30('0x2a')](function(_0x513575){if(_0x513575){_0x5de2d2=_0x513575[_0x1f30('0x48')];if(!_0x4ea91b[_0x1f30('0x34')][_0x1f30('0x39')](_0x1f30('0x3a'))){_0x584442[_0x1f30('0x22')]=qs['limit'](_0x4ea91b['query'][_0x1f30('0x22')]);_0x584442[_0x1f30('0x20')]=qs[_0x1f30('0x20')](_0x4ea91b['query'][_0x1f30('0x20')]);}return _0x8b76a['getFields'](_0x584442);}})[_0x1f30('0x2a')](function(_0xd0d97b){if(_0xd0d97b){return _0xd0d97b?{'count':_0x5de2d2,'rows':_0xd0d97b}:null;}})['then'](respondWithResult(_0x4802dc,null))[_0x1f30('0x45')](handleError(_0x4802dc,null));};exports['getSubjects']=function(_0x48dd43,_0x34a89f,_0x3ecb9a){var _0x4d3f7a={};var _0x1a90e6={};var _0x35accd;var _0xd34497;return db[_0x1f30('0x42')][_0x1f30('0x4e')]({'where':{'id':_0x48dd43['params']['id']}})['then'](handleEntityNotFound(_0x34a89f,null))[_0x1f30('0x2a')](function(_0x24f471){if(_0x24f471){_0x35accd=_0x24f471;_0x1a90e6[_0x1f30('0x30')]=_[_0x1f30('0x33')](db[_0x1f30('0x4f')][_0x1f30('0x50')]);_0x1a90e6['query']=_[_0x1f30('0x33')](_0x48dd43[_0x1f30('0x34')]);_0x1a90e6[_0x1f30('0x35')]=_[_0x1f30('0x36')](_0x1a90e6[_0x1f30('0x30')],_0x1a90e6['query']);_0x4d3f7a[_0x1f30('0x37')]=_[_0x1f30('0x36')](_0x1a90e6[_0x1f30('0x30')],qs[_0x1f30('0x38')](_0x48dd43[_0x1f30('0x34')][_0x1f30('0x38')]));_0x4d3f7a[_0x1f30('0x37')]=_0x4d3f7a['attributes'][_0x1f30('0x48')]?_0x4d3f7a['attributes']:_0x1a90e6[_0x1f30('0x30')];_0x4d3f7a[_0x1f30('0x3b')]=qs[_0x1f30('0x3c')](_0x48dd43['query'][_0x1f30('0x3c')]);_0x4d3f7a['where']=qs['filters'](_[_0x1f30('0x51')](_0x48dd43['query'],_0x1a90e6['filters']));if(_0x48dd43[_0x1f30('0x34')][_0x1f30('0x3e')]){_0x4d3f7a['where']=_['merge'](_0x4d3f7a[_0x1f30('0x3d')],{'$or':_[_0x1f30('0x31')](_0x4d3f7a['attributes'],function(_0x1ece59){var _0x4c1a12={};_0x4c1a12[_0x1ece59]={'$like':'%'+_0x48dd43['query']['filter']+'%'};return _0x4c1a12;})});}_0x4d3f7a=_[_0x1f30('0x3f')]({},_0x4d3f7a,_0x48dd43[_0x1f30('0x52')]);return _0x35accd[_0x1f30('0x53')](_0x4d3f7a);}})[_0x1f30('0x2a')](function(_0x27883b){if(_0x27883b){_0xd34497=_0x27883b[_0x1f30('0x48')];if(!_0x48dd43[_0x1f30('0x34')][_0x1f30('0x39')]('nolimit')){_0x4d3f7a[_0x1f30('0x22')]=qs[_0x1f30('0x22')](_0x48dd43[_0x1f30('0x34')]['limit']);_0x4d3f7a[_0x1f30('0x20')]=qs['offset'](_0x48dd43[_0x1f30('0x34')][_0x1f30('0x20')]);}return _0x35accd[_0x1f30('0x53')](_0x4d3f7a);}})[_0x1f30('0x2a')](function(_0x480c52){if(_0x480c52){return _0x480c52?{'count':_0xd34497,'rows':_0x480c52}:null;}})[_0x1f30('0x2a')](respondWithResult(_0x34a89f,null))[_0x1f30('0x45')](handleError(_0x34a89f,null));};exports[_0x1f30('0x54')]=function(_0x1df86a,_0x32d034,_0x4b8344){var _0x592578={};var _0x332509={};var _0x50e563;var _0x1974e0;return db[_0x1f30('0x42')][_0x1f30('0x4e')]({'where':{'id':_0x1df86a[_0x1f30('0x47')]['id']}})['then'](handleEntityNotFound(_0x32d034,null))[_0x1f30('0x2a')](function(_0x45b3f4){if(_0x45b3f4){_0x50e563=_0x45b3f4;_0x332509[_0x1f30('0x30')]=_[_0x1f30('0x33')](db['ZendeskField'][_0x1f30('0x50')]);_0x332509[_0x1f30('0x34')]=_[_0x1f30('0x33')](_0x1df86a['query']);_0x332509[_0x1f30('0x35')]=_[_0x1f30('0x36')](_0x332509[_0x1f30('0x30')],_0x332509[_0x1f30('0x34')]);_0x592578[_0x1f30('0x37')]=_[_0x1f30('0x36')](_0x332509['model'],qs[_0x1f30('0x38')](_0x1df86a[_0x1f30('0x34')][_0x1f30('0x38')]));_0x592578['attributes']=_0x592578[_0x1f30('0x37')]['length']?_0x592578['attributes']:_0x332509['model'];_0x592578[_0x1f30('0x3b')]=qs[_0x1f30('0x3c')](_0x1df86a['query']['sort']);_0x592578['where']=qs[_0x1f30('0x35')](_[_0x1f30('0x51')](_0x1df86a[_0x1f30('0x34')],_0x332509[_0x1f30('0x35')]));if(_0x1df86a[_0x1f30('0x34')][_0x1f30('0x3e')]){_0x592578[_0x1f30('0x3d')]=_[_0x1f30('0x3f')](_0x592578[_0x1f30('0x3d')],{'$or':_[_0x1f30('0x31')](_0x592578[_0x1f30('0x37')],function(_0x50cbbb){var _0x56781d={};_0x56781d[_0x50cbbb]={'$like':'%'+_0x1df86a[_0x1f30('0x34')][_0x1f30('0x3e')]+'%'};return _0x56781d;})});}_0x592578=_['merge']({},_0x592578,_0x1df86a[_0x1f30('0x52')]);return _0x50e563['getDescriptions'](_0x592578);}})['then'](function(_0x13baa){if(_0x13baa){_0x1974e0=_0x13baa[_0x1f30('0x48')];if(!_0x1df86a[_0x1f30('0x34')]['hasOwnProperty'](_0x1f30('0x3a'))){_0x592578[_0x1f30('0x22')]=qs[_0x1f30('0x22')](_0x1df86a[_0x1f30('0x34')]['limit']);_0x592578['offset']=qs[_0x1f30('0x20')](_0x1df86a[_0x1f30('0x34')][_0x1f30('0x20')]);}return _0x50e563[_0x1f30('0x54')](_0x592578);}})[_0x1f30('0x2a')](function(_0x41b947){if(_0x41b947){return _0x41b947?{'count':_0x1974e0,'rows':_0x41b947}:null;}})['then'](respondWithResult(_0x32d034,null))[_0x1f30('0x45')](handleError(_0x32d034,null));};exports[_0x1f30('0x55')]=function(_0x294573,_0x4010ef,_0x33adb9){var _0x345067={};var _0x4e4092={};var _0x4044d4;var _0x5d13d3;return db['ZendeskConfiguration'][_0x1f30('0x4e')]({'where':{'id':_0x294573[_0x1f30('0x47')]['id']}})[_0x1f30('0x2a')](handleEntityNotFound(_0x4010ef,null))['then'](function(_0x3abb37){if(_0x3abb37){_0x4044d4=_0x3abb37;_0x4e4092[_0x1f30('0x30')]=_[_0x1f30('0x33')](db[_0x1f30('0x56')][_0x1f30('0x50')]);_0x4e4092[_0x1f30('0x34')]=_['keys'](_0x294573[_0x1f30('0x34')]);_0x4e4092[_0x1f30('0x35')]=_['intersection'](_0x4e4092[_0x1f30('0x30')],_0x4e4092['query']);_0x345067[_0x1f30('0x37')]=_['intersection'](_0x4e4092['model'],qs[_0x1f30('0x38')](_0x294573[_0x1f30('0x34')][_0x1f30('0x38')]));_0x345067[_0x1f30('0x37')]=_0x345067['attributes']['length']?_0x345067[_0x1f30('0x37')]:_0x4e4092[_0x1f30('0x30')];_0x345067['order']=qs[_0x1f30('0x3c')](_0x294573[_0x1f30('0x34')]['sort']);_0x345067['where']=qs[_0x1f30('0x35')](_[_0x1f30('0x51')](_0x294573[_0x1f30('0x34')],_0x4e4092['filters']));if(_0x294573[_0x1f30('0x34')]['filter']){_0x345067['where']=_['merge'](_0x345067['where'],{'$or':_[_0x1f30('0x31')](_0x345067[_0x1f30('0x37')],function(_0x5c0450){var _0x303bed={};_0x303bed[_0x5c0450]={'$like':'%'+_0x294573[_0x1f30('0x34')][_0x1f30('0x3e')]+'%'};return _0x303bed;})});}_0x345067=_[_0x1f30('0x3f')]({},_0x345067,_0x294573[_0x1f30('0x52')]);return _0x4044d4[_0x1f30('0x55')](_0x345067);}})[_0x1f30('0x2a')](function(_0x49497b){if(_0x49497b){_0x5d13d3=_0x49497b[_0x1f30('0x48')];if(!_0x294573['query'][_0x1f30('0x39')]('nolimit')){_0x345067[_0x1f30('0x22')]=qs[_0x1f30('0x22')](_0x294573[_0x1f30('0x34')][_0x1f30('0x22')]);_0x345067[_0x1f30('0x20')]=qs[_0x1f30('0x20')](_0x294573[_0x1f30('0x34')][_0x1f30('0x20')]);}return _0x4044d4[_0x1f30('0x55')](_0x345067);}})[_0x1f30('0x2a')](function(_0x3399c9){if(_0x3399c9){return _0x3399c9?{'count':_0x5d13d3,'rows':_0x3399c9}:null;}})[_0x1f30('0x2a')](respondWithResult(_0x4010ef,null))['catch'](handleError(_0x4010ef,null));};exports[_0x1f30('0x57')]=function(_0x1c5964,_0x4f9e1d,_0x2d1088){if(_0x1c5964[_0x1f30('0x4b')]['id']){delete _0x1c5964['body']['id'];}return db[_0x1f30('0x42')]['findOne']({'where':{'id':_0x1c5964[_0x1f30('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f9e1d,null))[_0x1f30('0x2a')](function(_0x283674){if(_0x283674){return _0x283674[_0x1f30('0x57')](_0x1c5964[_0x1f30('0x4b')][_0x1f30('0x58')]||[]);}return null;})[_0x1f30('0x2a')](respondWithResult(_0x4f9e1d,null))[_0x1f30('0x45')](handleError(_0x4f9e1d,null));}; \ No newline at end of file +var _0x2963=['intersection','options','find','catch','create','body','findOne','ZendeskField','getFields','getSubjects','order','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','sort','pick','merge','VIRTUAL','filter','where','includeAll','include','findAll','rows','show','params'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x2963,0x1b5));var _0x3296=function(_0x2f982c,_0x12d464){_0x2f982c=_0x2f982c-0x0;var _0x24f4d7=_0x2963[_0x2f982c];return _0x24f4d7;};'use strict';var emlformat=require(_0x3296('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3296('0x1'));var BPromise=require(_0x3296('0x2'));var Mustache=require(_0x3296('0x3'));var util=require(_0x3296('0x4'));var path=require(_0x3296('0x5'));var sox=require(_0x3296('0x6'));var csv=require(_0x3296('0x7'));var ejs=require(_0x3296('0x8'));var fs=require('fs');var fs_extra=require(_0x3296('0x9'));var _=require(_0x3296('0xa'));var squel=require(_0x3296('0xb'));var crypto=require(_0x3296('0xc'));var jsforce=require(_0x3296('0xd'));var deskjs=require(_0x3296('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3296('0xf'));var Papa=require('papaparse');var Redis=require(_0x3296('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3296('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3296('0x12'));var utils=require(_0x3296('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3296('0x14'));var db=require(_0x3296('0x15'))['db'];function respondWithStatusCode(_0x2c41bd,_0x5226e6){_0x5226e6=_0x5226e6||0xcc;return function(_0x1bfd64){if(_0x1bfd64){return _0x2c41bd[_0x3296('0x16')](_0x5226e6);}return _0x2c41bd[_0x3296('0x17')](_0x5226e6)[_0x3296('0x18')]();};}function respondWithResult(_0xf89efd,_0x2b3317){_0x2b3317=_0x2b3317||0xc8;return function(_0x287e56){if(_0x287e56){return _0xf89efd[_0x3296('0x17')](_0x2b3317)[_0x3296('0x19')](_0x287e56);}};}function respondWithFilteredResult(_0x506fb1,_0xbe308){return function(_0x87f8cb){if(_0x87f8cb){var _0x10835a=typeof _0xbe308[_0x3296('0x1a')]==='undefined'&&typeof _0xbe308[_0x3296('0x1b')]===_0x3296('0x1c');var _0x3d92b2=_0x87f8cb[_0x3296('0x1d')];var _0x1daed5=_0x10835a?0x0:_0xbe308['offset'];var _0x183664=_0x10835a?_0x87f8cb[_0x3296('0x1d')]:_0xbe308['offset']+_0xbe308[_0x3296('0x1b')];var _0x4835a1;if(_0x183664>=_0x3d92b2){_0x183664=_0x3d92b2;_0x4835a1=0xc8;}else{_0x4835a1=0xce;}_0x506fb1['status'](_0x4835a1);return _0x506fb1[_0x3296('0x1e')]('Content-Range',_0x1daed5+'-'+_0x183664+'/'+_0x3d92b2)[_0x3296('0x19')](_0x87f8cb);}return null;};}function patchUpdates(_0x48d4bb){return function(_0xdf64d3){try{jsonpatch[_0x3296('0x1f')](_0xdf64d3,_0x48d4bb,!![]);}catch(_0x58647b){return BPromise[_0x3296('0x20')](_0x58647b);}return _0xdf64d3[_0x3296('0x21')]();};}function saveUpdates(_0x1df8e2,_0x3e652b){return function(_0x4cbf9c){if(_0x4cbf9c){return _0x4cbf9c[_0x3296('0x22')](_0x1df8e2)['then'](function(_0x2796ce){return _0x2796ce;});}return null;};}function removeEntity(_0x5792e9,_0x10a943){return function(_0x3d6d42){if(_0x3d6d42){return _0x3d6d42[_0x3296('0x23')]()[_0x3296('0x24')](function(){_0x5792e9['status'](0xcc)[_0x3296('0x18')]();});}};}function handleEntityNotFound(_0x5a0e9c,_0x3e4775){return function(_0x58a5d4){if(!_0x58a5d4){_0x5a0e9c[_0x3296('0x16')](0x194);}return _0x58a5d4;};}function handleError(_0x229149,_0x1b8dac){_0x1b8dac=_0x1b8dac||0x1f4;return function(_0x7501bd){logger[_0x3296('0x25')](_0x7501bd['stack']);if(_0x7501bd[_0x3296('0x26')]){delete _0x7501bd[_0x3296('0x26')];}_0x229149[_0x3296('0x17')](_0x1b8dac)[_0x3296('0x27')](_0x7501bd);};}exports[_0x3296('0x28')]=function(_0x38c98b,_0x324a59){var _0x37d4c3={},_0x1bd61a={},_0x25bec1={'count':0x0,'rows':[]};var _0xb797af=_[_0x3296('0x29')](db[_0x3296('0x2a')][_0x3296('0x2b')],function(_0x1967fe){return{'name':_0x1967fe[_0x3296('0x2c')],'type':_0x1967fe[_0x3296('0x2d')][_0x3296('0x2e')]};});_0x1bd61a[_0x3296('0x2f')]=_[_0x3296('0x29')](_0xb797af,_0x3296('0x26'));_0x1bd61a['query']=_[_0x3296('0x30')](_0x38c98b[_0x3296('0x31')]);_0x1bd61a[_0x3296('0x32')]=_['intersection'](_0x1bd61a[_0x3296('0x2f')],_0x1bd61a[_0x3296('0x31')]);_0x37d4c3[_0x3296('0x33')]=_['intersection'](_0x1bd61a[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x38c98b[_0x3296('0x31')][_0x3296('0x34')]));_0x37d4c3[_0x3296('0x33')]=_0x37d4c3[_0x3296('0x33')][_0x3296('0x35')]?_0x37d4c3[_0x3296('0x33')]:_0x1bd61a[_0x3296('0x2f')];if(!_0x38c98b[_0x3296('0x31')]['hasOwnProperty'](_0x3296('0x36'))){_0x37d4c3[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x38c98b[_0x3296('0x31')][_0x3296('0x1b')]);_0x37d4c3[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x38c98b[_0x3296('0x31')][_0x3296('0x1a')]);}_0x37d4c3['order']=qs[_0x3296('0x37')](_0x38c98b[_0x3296('0x31')][_0x3296('0x37')]);_0x37d4c3['where']=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x38c98b[_0x3296('0x31')],_0x1bd61a[_0x3296('0x32')]),_0xb797af);if(_0x38c98b[_0x3296('0x31')]['filter']){_0x37d4c3['where']=_[_0x3296('0x39')](_0x37d4c3['where'],{'$or':_[_0x3296('0x29')](_0xb797af,function(_0x50a190){if(_0x50a190[_0x3296('0x2d')]!==_0x3296('0x3a')){var _0x33969e={};_0x33969e[_0x50a190[_0x3296('0x26')]]={'$like':'%'+_0x38c98b[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x33969e;}})});}_0x37d4c3=_['merge']({},_0x37d4c3,_0x38c98b['options']);var _0x9a1404={'where':_0x37d4c3[_0x3296('0x3c')]};return db[_0x3296('0x2a')][_0x3296('0x1d')](_0x9a1404)['then'](function(_0x1cca62){_0x25bec1[_0x3296('0x1d')]=_0x1cca62;if(_0x38c98b[_0x3296('0x31')][_0x3296('0x3d')]){_0x37d4c3[_0x3296('0x3e')]=[{'all':!![]}];}return db[_0x3296('0x2a')][_0x3296('0x3f')](_0x37d4c3);})['then'](function(_0x426254){_0x25bec1[_0x3296('0x40')]=_0x426254;return _0x25bec1;})[_0x3296('0x24')](respondWithFilteredResult(_0x324a59,_0x37d4c3))['catch'](handleError(_0x324a59,null));};exports[_0x3296('0x41')]=function(_0x4f848c,_0x3400c3){var _0x11b5fe={'raw':![],'where':{'id':_0x4f848c[_0x3296('0x42')]['id']}},_0x11d54a={};_0x11d54a[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x2a')][_0x3296('0x2b')]);_0x11d54a[_0x3296('0x31')]=_['keys'](_0x4f848c[_0x3296('0x31')]);_0x11d54a[_0x3296('0x32')]=_[_0x3296('0x43')](_0x11d54a[_0x3296('0x2f')],_0x11d54a[_0x3296('0x31')]);_0x11b5fe[_0x3296('0x33')]=_[_0x3296('0x43')](_0x11d54a['model'],qs[_0x3296('0x34')](_0x4f848c['query'][_0x3296('0x34')]));_0x11b5fe[_0x3296('0x33')]=_0x11b5fe[_0x3296('0x33')][_0x3296('0x35')]?_0x11b5fe['attributes']:_0x11d54a[_0x3296('0x2f')];if(_0x4f848c[_0x3296('0x31')][_0x3296('0x3d')]){_0x11b5fe[_0x3296('0x3e')]=[{'all':!![]}];}_0x11b5fe=_[_0x3296('0x39')]({},_0x11b5fe,_0x4f848c[_0x3296('0x44')]);return db[_0x3296('0x2a')][_0x3296('0x45')](_0x11b5fe)[_0x3296('0x24')](handleEntityNotFound(_0x3400c3,null))[_0x3296('0x24')](respondWithResult(_0x3400c3,null))[_0x3296('0x46')](handleError(_0x3400c3,null));};exports[_0x3296('0x47')]=function(_0xfc13ff,_0x108653){return db[_0x3296('0x2a')]['create'](_0xfc13ff['body'],{})[_0x3296('0x24')](respondWithResult(_0x108653,0xc9))[_0x3296('0x46')](handleError(_0x108653,null));};exports['update']=function(_0xefe3a4,_0x58c169){if(_0xefe3a4['body']['id']){delete _0xefe3a4[_0x3296('0x48')]['id'];}return db[_0x3296('0x2a')][_0x3296('0x45')]({'where':{'id':_0xefe3a4['params']['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x58c169,null))[_0x3296('0x24')](saveUpdates(_0xefe3a4[_0x3296('0x48')],null))['then'](respondWithResult(_0x58c169,null))[_0x3296('0x46')](handleError(_0x58c169,null));};exports[_0x3296('0x23')]=function(_0x4d0607,_0x14b850){return db['ZendeskConfiguration'][_0x3296('0x45')]({'where':{'id':_0x4d0607[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x14b850,null))[_0x3296('0x24')](removeEntity(_0x14b850,null))['catch'](handleError(_0x14b850,null));};exports['getFields']=function(_0x54d571,_0xc62048,_0x121da5){var _0x567b65={};var _0x2c4dfa={};var _0x5d3088;var _0x264d9d;return db[_0x3296('0x2a')][_0x3296('0x49')]({'where':{'id':_0x54d571[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0xc62048,null))['then'](function(_0x1b9b8e){if(_0x1b9b8e){_0x5d3088=_0x1b9b8e;_0x2c4dfa[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x4a')][_0x3296('0x2b')]);_0x2c4dfa[_0x3296('0x31')]=_[_0x3296('0x30')](_0x54d571[_0x3296('0x31')]);_0x2c4dfa[_0x3296('0x32')]=_[_0x3296('0x43')](_0x2c4dfa[_0x3296('0x2f')],_0x2c4dfa[_0x3296('0x31')]);_0x567b65[_0x3296('0x33')]=_[_0x3296('0x43')](_0x2c4dfa[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x54d571['query'][_0x3296('0x34')]));_0x567b65[_0x3296('0x33')]=_0x567b65[_0x3296('0x33')]['length']?_0x567b65[_0x3296('0x33')]:_0x2c4dfa[_0x3296('0x2f')];_0x567b65['order']=qs[_0x3296('0x37')](_0x54d571[_0x3296('0x31')]['sort']);_0x567b65[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x54d571[_0x3296('0x31')],_0x2c4dfa['filters']));if(_0x54d571[_0x3296('0x31')][_0x3296('0x3b')]){_0x567b65[_0x3296('0x3c')]=_[_0x3296('0x39')](_0x567b65[_0x3296('0x3c')],{'$or':_[_0x3296('0x29')](_0x567b65[_0x3296('0x33')],function(_0x987726){var _0x1c7bcf={};_0x1c7bcf[_0x987726]={'$like':'%'+_0x54d571[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x1c7bcf;})});}_0x567b65=_[_0x3296('0x39')]({},_0x567b65,_0x54d571[_0x3296('0x44')]);return _0x5d3088[_0x3296('0x4b')](_0x567b65);}})[_0x3296('0x24')](function(_0x25da95){if(_0x25da95){_0x264d9d=_0x25da95[_0x3296('0x35')];if(!_0x54d571[_0x3296('0x31')]['hasOwnProperty']('nolimit')){_0x567b65[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x54d571[_0x3296('0x31')][_0x3296('0x1b')]);_0x567b65[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x54d571[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x5d3088[_0x3296('0x4b')](_0x567b65);}})[_0x3296('0x24')](function(_0x58306e){if(_0x58306e){return _0x58306e?{'count':_0x264d9d,'rows':_0x58306e}:null;}})['then'](respondWithResult(_0xc62048,null))['catch'](handleError(_0xc62048,null));};exports[_0x3296('0x4c')]=function(_0x35a654,_0x47a62f,_0x8b19fa){var _0x466b18={};var _0x529679={};var _0x13af95;var _0x4dcac9;return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x35a654['params']['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x47a62f,null))[_0x3296('0x24')](function(_0x496a3f){if(_0x496a3f){_0x13af95=_0x496a3f;_0x529679['model']=_[_0x3296('0x30')](db[_0x3296('0x4a')]['rawAttributes']);_0x529679[_0x3296('0x31')]=_['keys'](_0x35a654[_0x3296('0x31')]);_0x529679[_0x3296('0x32')]=_[_0x3296('0x43')](_0x529679[_0x3296('0x2f')],_0x529679[_0x3296('0x31')]);_0x466b18['attributes']=_[_0x3296('0x43')](_0x529679['model'],qs[_0x3296('0x34')](_0x35a654['query'][_0x3296('0x34')]));_0x466b18['attributes']=_0x466b18['attributes']['length']?_0x466b18[_0x3296('0x33')]:_0x529679[_0x3296('0x2f')];_0x466b18[_0x3296('0x4d')]=qs[_0x3296('0x37')](_0x35a654[_0x3296('0x31')][_0x3296('0x37')]);_0x466b18[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x35a654['query'],_0x529679[_0x3296('0x32')]));if(_0x35a654['query']['filter']){_0x466b18[_0x3296('0x3c')]=_['merge'](_0x466b18[_0x3296('0x3c')],{'$or':_[_0x3296('0x29')](_0x466b18['attributes'],function(_0x29381c){var _0x18196f={};_0x18196f[_0x29381c]={'$like':'%'+_0x35a654[_0x3296('0x31')]['filter']+'%'};return _0x18196f;})});}_0x466b18=_['merge']({},_0x466b18,_0x35a654[_0x3296('0x44')]);return _0x13af95[_0x3296('0x4c')](_0x466b18);}})[_0x3296('0x24')](function(_0x30a9a2){if(_0x30a9a2){_0x4dcac9=_0x30a9a2[_0x3296('0x35')];if(!_0x35a654['query']['hasOwnProperty'](_0x3296('0x36'))){_0x466b18[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x35a654['query']['limit']);_0x466b18['offset']=qs[_0x3296('0x1a')](_0x35a654[_0x3296('0x31')]['offset']);}return _0x13af95[_0x3296('0x4c')](_0x466b18);}})[_0x3296('0x24')](function(_0xee8463){if(_0xee8463){return _0xee8463?{'count':_0x4dcac9,'rows':_0xee8463}:null;}})[_0x3296('0x24')](respondWithResult(_0x47a62f,null))[_0x3296('0x46')](handleError(_0x47a62f,null));};exports['getDescriptions']=function(_0x506e7b,_0xbc2cdc,_0x553dfc){var _0x5e3568={};var _0x1f5326={};var _0x474b18;var _0xd1856b;return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x506e7b[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0xbc2cdc,null))['then'](function(_0x12d319){if(_0x12d319){_0x474b18=_0x12d319;_0x1f5326[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x4a')]['rawAttributes']);_0x1f5326[_0x3296('0x31')]=_['keys'](_0x506e7b[_0x3296('0x31')]);_0x1f5326[_0x3296('0x32')]=_[_0x3296('0x43')](_0x1f5326[_0x3296('0x2f')],_0x1f5326[_0x3296('0x31')]);_0x5e3568[_0x3296('0x33')]=_['intersection'](_0x1f5326[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x506e7b[_0x3296('0x31')]['fields']));_0x5e3568[_0x3296('0x33')]=_0x5e3568[_0x3296('0x33')][_0x3296('0x35')]?_0x5e3568[_0x3296('0x33')]:_0x1f5326[_0x3296('0x2f')];_0x5e3568[_0x3296('0x4d')]=qs[_0x3296('0x37')](_0x506e7b['query']['sort']);_0x5e3568[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x506e7b[_0x3296('0x31')],_0x1f5326['filters']));if(_0x506e7b[_0x3296('0x31')][_0x3296('0x3b')]){_0x5e3568[_0x3296('0x3c')]=_[_0x3296('0x39')](_0x5e3568['where'],{'$or':_[_0x3296('0x29')](_0x5e3568[_0x3296('0x33')],function(_0x1d0c29){var _0x989305={};_0x989305[_0x1d0c29]={'$like':'%'+_0x506e7b[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x989305;})});}_0x5e3568=_[_0x3296('0x39')]({},_0x5e3568,_0x506e7b[_0x3296('0x44')]);return _0x474b18['getDescriptions'](_0x5e3568);}})[_0x3296('0x24')](function(_0xf6aaa1){if(_0xf6aaa1){_0xd1856b=_0xf6aaa1[_0x3296('0x35')];if(!_0x506e7b[_0x3296('0x31')][_0x3296('0x4e')](_0x3296('0x36'))){_0x5e3568[_0x3296('0x1b')]=qs['limit'](_0x506e7b[_0x3296('0x31')][_0x3296('0x1b')]);_0x5e3568['offset']=qs['offset'](_0x506e7b[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x474b18[_0x3296('0x4f')](_0x5e3568);}})['then'](function(_0x3814f0){if(_0x3814f0){return _0x3814f0?{'count':_0xd1856b,'rows':_0x3814f0}:null;}})['then'](respondWithResult(_0xbc2cdc,null))[_0x3296('0x46')](handleError(_0xbc2cdc,null));};exports['getTags']=function(_0x2897e5,_0x391862,_0x39f6d8){var _0xb2a1ef={};var _0x512d98={};var _0x551fe1;var _0x282b86;return db['ZendeskConfiguration'][_0x3296('0x49')]({'where':{'id':_0x2897e5[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x391862,null))['then'](function(_0x1d307){if(_0x1d307){_0x551fe1=_0x1d307;_0x512d98[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x50')][_0x3296('0x2b')]);_0x512d98[_0x3296('0x31')]=_[_0x3296('0x30')](_0x2897e5[_0x3296('0x31')]);_0x512d98[_0x3296('0x32')]=_[_0x3296('0x43')](_0x512d98[_0x3296('0x2f')],_0x512d98[_0x3296('0x31')]);_0xb2a1ef[_0x3296('0x33')]=_[_0x3296('0x43')](_0x512d98[_0x3296('0x2f')],qs['fields'](_0x2897e5['query'][_0x3296('0x34')]));_0xb2a1ef[_0x3296('0x33')]=_0xb2a1ef[_0x3296('0x33')]['length']?_0xb2a1ef[_0x3296('0x33')]:_0x512d98[_0x3296('0x2f')];_0xb2a1ef[_0x3296('0x4d')]=qs['sort'](_0x2897e5[_0x3296('0x31')][_0x3296('0x37')]);_0xb2a1ef[_0x3296('0x3c')]=qs[_0x3296('0x32')](_['pick'](_0x2897e5['query'],_0x512d98['filters']));if(_0x2897e5[_0x3296('0x31')][_0x3296('0x3b')]){_0xb2a1ef['where']=_['merge'](_0xb2a1ef[_0x3296('0x3c')],{'$or':_['map'](_0xb2a1ef[_0x3296('0x33')],function(_0x5129bc){var _0x8120c2={};_0x8120c2[_0x5129bc]={'$like':'%'+_0x2897e5['query'][_0x3296('0x3b')]+'%'};return _0x8120c2;})});}_0xb2a1ef=_['merge']({},_0xb2a1ef,_0x2897e5['options']);return _0x551fe1[_0x3296('0x51')](_0xb2a1ef);}})[_0x3296('0x24')](function(_0x591a5c){if(_0x591a5c){_0x282b86=_0x591a5c[_0x3296('0x35')];if(!_0x2897e5['query'][_0x3296('0x4e')](_0x3296('0x36'))){_0xb2a1ef[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x2897e5['query'][_0x3296('0x1b')]);_0xb2a1ef[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x2897e5[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x551fe1['getTags'](_0xb2a1ef);}})[_0x3296('0x24')](function(_0x5d3871){if(_0x5d3871){return _0x5d3871?{'count':_0x282b86,'rows':_0x5d3871}:null;}})[_0x3296('0x24')](respondWithResult(_0x391862,null))[_0x3296('0x46')](handleError(_0x391862,null));};exports[_0x3296('0x52')]=function(_0x376537,_0x3c1276,_0x1ce9fb){if(_0x376537[_0x3296('0x48')]['id']){delete _0x376537[_0x3296('0x48')]['id'];}return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x376537[_0x3296('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c1276,null))[_0x3296('0x24')](function(_0xa05e16){if(_0xa05e16){return _0xa05e16[_0x3296('0x52')](_0x376537[_0x3296('0x48')][_0x3296('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3c1276,null))[_0x3296('0x46')](handleError(_0x3c1276,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5d32888..4a6b06f 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 _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x69d3,0xda));var _0x369d=function(_0x39b42d,_0x372cc9){_0x39b42d=_0x39b42d-0x0;var _0x22fdee=_0x69d3[_0x39b42d];return _0x22fdee;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa30a=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'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 7a4b39c..b476c8f 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 _0x4bdc=['../../config/environment','client','http','request','then','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','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1ccfb1,_0x54dee0){var _0x47e35e=function(_0x48c85f){while(--_0x48c85f){_0x1ccfb1['push'](_0x1ccfb1['shift']());}};_0x47e35e(++_0x54dee0);}(_0x4bdc,0x1eb));var _0xc4bd=function(_0x3b7dc6,_0x4ca6f5){_0x3b7dc6=_0x3b7dc6-0x0;var _0x1215e9=_0x4bdc[_0x3b7dc6];return _0x1215e9;};'use strict';var _=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var moment=require(_0xc4bd('0x2'));var BPromise=require(_0xc4bd('0x3'));var rs=require(_0xc4bd('0x4'));var fs=require('fs');var Redis=require(_0xc4bd('0x5'));var db=require(_0xc4bd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4bd('0x7'))(_0xc4bd('0x8'));var config=require(_0xc4bd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc4bd('0xa')][_0xc4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ac17,_0x3c5620,_0x17e8c4){return new BPromise(function(_0x1019a5,_0x2d2fd6){return client[_0xc4bd('0xc')](_0x44ac17,_0x17e8c4)[_0xc4bd('0xd')](function(_0x289ca5){logger[_0xc4bd('0xe')](_0xc4bd('0xf'),_0x3c5620,_0xc4bd('0x10'));logger[_0xc4bd('0x11')](_0xc4bd('0x12'),_0x3c5620,'request\x20sent',JSON[_0xc4bd('0x13')](_0x289ca5));if(_0x289ca5[_0xc4bd('0x14')]){if(_0x289ca5['error'][_0xc4bd('0x15')]===0x1f4){logger['error'](_0xc4bd('0xf'),_0x3c5620,_0x289ca5[_0xc4bd('0x14')][_0xc4bd('0x16')]);return _0x2d2fd6(_0x289ca5[_0xc4bd('0x14')]['message']);}logger[_0xc4bd('0x14')](_0xc4bd('0xf'),_0x3c5620,_0x289ca5[_0xc4bd('0x14')][_0xc4bd('0x16')]);return _0x1019a5(_0x289ca5['error']['message']);}else{logger[_0xc4bd('0xe')](_0xc4bd('0xf'),_0x3c5620,_0xc4bd('0x10'));_0x1019a5(_0x289ca5[_0xc4bd('0x17')][_0xc4bd('0x16')]);}})[_0xc4bd('0x18')](function(_0x52835d){logger[_0xc4bd('0x14')](_0xc4bd('0xf'),_0x3c5620,_0x52835d);_0x2d2fd6(_0x52835d);});});} \ No newline at end of file +var _0x3871=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x2e9015,_0x1602ee){var _0x1442fe=function(_0x348cf9){while(--_0x348cf9){_0x2e9015['push'](_0x2e9015['shift']());}};_0x1442fe(++_0x1602ee);}(_0x3871,0x9a));var _0x1387=function(_0x5d02ac,_0x5d31d5){_0x5d02ac=_0x5d02ac-0x0;var _0x1e325a=_0x3871[_0x5d02ac];return _0x1e325a;};'use strict';var _=require(_0x1387('0x0'));var util=require(_0x1387('0x1'));var moment=require('moment');var BPromise=require(_0x1387('0x2'));var rs=require(_0x1387('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1387('0x4'))['db'];var utils=require(_0x1387('0x5'));var logger=require(_0x1387('0x6'))(_0x1387('0x7'));var config=require('../../config/environment');var jayson=require(_0x1387('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49377f,_0x14795f,_0xfd0195){return new BPromise(function(_0x1a21b7,_0x1b6079){return client['request'](_0x49377f,_0xfd0195)['then'](function(_0x3d1370){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x14795f,_0x1387('0x9'));logger[_0x1387('0xa')](_0x1387('0xb'),_0x14795f,_0x1387('0x9'),JSON['stringify'](_0x3d1370));if(_0x3d1370[_0x1387('0xc')]){if(_0x3d1370[_0x1387('0xc')][_0x1387('0xd')]===0x1f4){logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x3d1370[_0x1387('0xc')][_0x1387('0xf')]);return _0x1b6079(_0x3d1370['error'][_0x1387('0xf')]);}logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x3d1370[_0x1387('0xc')]['message']);return _0x1a21b7(_0x3d1370[_0x1387('0xc')][_0x1387('0xf')]);}else{logger[_0x1387('0x10')](_0x1387('0xe'),_0x14795f,_0x1387('0x9'));_0x1a21b7(_0x3d1370[_0x1387('0x11')]['message']);}})[_0x1387('0x12')](function(_0x28c592){logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x28c592);_0x1b6079(_0x28c592);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2860f48..865bfe1 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 _0xe9aa=['index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x549feb,_0x5ca426){var _0x4b0ed4=function(_0x270054){while(--_0x270054){_0x549feb['push'](_0x549feb['shift']());}};_0x4b0ed4(++_0x5ca426);}(_0xe9aa,0xf5));var _0xae9a=function(_0xfd85c2,_0xf75c42){_0xfd85c2=_0xfd85c2-0x0;var _0xd07fcb=_0xe9aa[_0xfd85c2];return _0xd07fcb;};'use strict';var multer=require(_0xae9a('0x0'));var util=require(_0xae9a('0x1'));var path=require(_0xae9a('0x2'));var timeout=require(_0xae9a('0x3'));var express=require('express');var router=express[_0xae9a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xae9a('0x5'));var config=require(_0xae9a('0x6'));var controller=require(_0xae9a('0x7'));router[_0xae9a('0x8')]('/',auth[_0xae9a('0x9')](),controller[_0xae9a('0xa')]);router[_0xae9a('0x8')](_0xae9a('0xb'),auth[_0xae9a('0x9')](),controller[_0xae9a('0xc')]);router[_0xae9a('0xd')]('/',auth[_0xae9a('0x9')](),controller['create']);router['put']('/:id',auth[_0xae9a('0x9')](),controller[_0xae9a('0xe')]);router['delete'](_0xae9a('0xb'),auth['isAuthenticated'](),controller[_0xae9a('0xf')]);module[_0xae9a('0x10')]=router; \ No newline at end of file +var _0xd45d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','exports','multer','util'];(function(_0xe58d63,_0x4bbd12){var _0x9900c6=function(_0x12d447){while(--_0x12d447){_0xe58d63['push'](_0xe58d63['shift']());}};_0x9900c6(++_0x4bbd12);}(_0xd45d,0x154));var _0xdd45=function(_0x45243a,_0x58a4fc){_0x45243a=_0x45243a-0x0;var _0x374a3e=_0xd45d[_0x45243a];return _0x374a3e;};'use strict';var multer=require(_0xdd45('0x0'));var util=require(_0xdd45('0x1'));var path=require(_0xdd45('0x2'));var timeout=require(_0xdd45('0x3'));var express=require(_0xdd45('0x4'));var router=express['Router']();var fs_extra=require(_0xdd45('0x5'));var auth=require(_0xdd45('0x6'));var interaction=require(_0xdd45('0x7'));var config=require(_0xdd45('0x8'));var controller=require(_0xdd45('0x9'));router[_0xdd45('0xa')]('/',auth['isAuthenticated'](),controller[_0xdd45('0xb')]);router[_0xdd45('0xa')](_0xdd45('0xc'),auth[_0xdd45('0xd')](),controller[_0xdd45('0xe')]);router['post']('/',auth[_0xdd45('0xd')](),controller[_0xdd45('0xf')]);router[_0xdd45('0x10')]('/:id',auth[_0xdd45('0xd')](),controller[_0xdd45('0x11')]);router['delete'](_0xdd45('0xc'),auth[_0xdd45('0xd')](),controller['destroy']);module[_0xdd45('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 623379b..c2eb6b1 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 _0xd53c=['STRING','variable','customVariable','keyValue','picklist','ENUM'];(function(_0x4eb7e6,_0x451464){var _0x3cf508=function(_0x462471){while(--_0x462471){_0x4eb7e6['push'](_0x4eb7e6['shift']());}};_0x3cf508(++_0x451464);}(_0xd53c,0x1e1));var _0xcd53=function(_0x245c89,_0x2feb4a){_0x245c89=_0x245c89-0x0;var _0x3cebe3=_0xd53c[_0x245c89];return _0x3cebe3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xcd53('0x0'),_0xcd53('0x1'),_0xcd53('0x2'),_0xcd53('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcd53('0x4')]('string',_0xcd53('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0xcd53('0x5')]},'idField':{'type':Sequelize[_0xcd53('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b98=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x33553d,_0x84dede){var _0x187c94=function(_0x3fe42f){while(--_0x3fe42f){_0x33553d['push'](_0x33553d['shift']());}};_0x187c94(++_0x84dede);}(_0x6b98,0x6f));var _0x86b9=function(_0x42508b,_0x693bd2){_0x42508b=_0x42508b-0x0;var _0x4739b6=_0x6b98[_0x42508b];return _0x4739b6;};'use strict';var Sequelize=require('sequelize');module[_0x86b9('0x0')]={'type':{'type':Sequelize[_0x86b9('0x1')](_0x86b9('0x2'),_0x86b9('0x3'),_0x86b9('0x4'),_0x86b9('0x5'),_0x86b9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x86b9('0x7')]},'key':{'type':Sequelize[_0x86b9('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x86b9('0x2'),'variable',_0x86b9('0x4'))},'keyContent':{'type':Sequelize[_0x86b9('0x7')]},'idField':{'type':Sequelize[_0x86b9('0x7')]},'nameField':{'type':Sequelize[_0x86b9('0x7')]},'customField':{'type':Sequelize[_0x86b9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8846667..9bfa38d 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 _0x8a91=['index','map','ZendeskField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x8a91,0xb7));var _0x18a9=function(_0x3af35e,_0x59f896){_0x3af35e=_0x3af35e-0x0;var _0x5d54b5=_0x8a91[_0x3af35e];return _0x5d54b5;};'use strict';var emlformat=require(_0x18a9('0x0'));var rimraf=require(_0x18a9('0x1'));var zipdir=require(_0x18a9('0x2'));var jsonpatch=require(_0x18a9('0x3'));var rp=require(_0x18a9('0x4'));var moment=require('moment');var BPromise=require(_0x18a9('0x5'));var Mustache=require(_0x18a9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x18a9('0x7'));var csv=require(_0x18a9('0x8'));var ejs=require(_0x18a9('0x9'));var fs=require('fs');var fs_extra=require(_0x18a9('0xa'));var _=require('lodash');var squel=require(_0x18a9('0xb'));var crypto=require('crypto');var jsforce=require(_0x18a9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x18a9('0xd'));var Papa=require(_0x18a9('0xe'));var Redis=require(_0x18a9('0xf'));var authService=require(_0x18a9('0x10'));var qs=require(_0x18a9('0x11'));var as=require(_0x18a9('0x12'));var hardwareService=require(_0x18a9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18a9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x18a9('0x15'));var db=require(_0x18a9('0x16'))['db'];function respondWithStatusCode(_0x47287a,_0x47e3e8){_0x47e3e8=_0x47e3e8||0xcc;return function(_0x4da1e7){if(_0x4da1e7){return _0x47287a[_0x18a9('0x17')](_0x47e3e8);}return _0x47287a[_0x18a9('0x18')](_0x47e3e8)['end']();};}function respondWithResult(_0x207a53,_0x359368){_0x359368=_0x359368||0xc8;return function(_0x15b0a8){if(_0x15b0a8){return _0x207a53['status'](_0x359368)[_0x18a9('0x19')](_0x15b0a8);}};}function respondWithFilteredResult(_0x33742e,_0x385c9d){return function(_0x373804){if(_0x373804){var _0x3960f4=typeof _0x385c9d[_0x18a9('0x1a')]===_0x18a9('0x1b')&&typeof _0x385c9d['limit']===_0x18a9('0x1b');var _0x2bb383=_0x373804[_0x18a9('0x1c')];var _0x55552a=_0x3960f4?0x0:_0x385c9d[_0x18a9('0x1a')];var _0x2b5dd1=_0x3960f4?_0x373804[_0x18a9('0x1c')]:_0x385c9d[_0x18a9('0x1a')]+_0x385c9d['limit'];var _0x48f650;if(_0x2b5dd1>=_0x2bb383){_0x2b5dd1=_0x2bb383;_0x48f650=0xc8;}else{_0x48f650=0xce;}_0x33742e[_0x18a9('0x18')](_0x48f650);return _0x33742e[_0x18a9('0x1d')](_0x18a9('0x1e'),_0x55552a+'-'+_0x2b5dd1+'/'+_0x2bb383)['json'](_0x373804);}return null;};}function patchUpdates(_0x5b535a){return function(_0x3d0c2d){try{jsonpatch[_0x18a9('0x1f')](_0x3d0c2d,_0x5b535a,!![]);}catch(_0x55fae6){return BPromise[_0x18a9('0x20')](_0x55fae6);}return _0x3d0c2d[_0x18a9('0x21')]();};}function saveUpdates(_0x57ea37,_0x14f4d3){return function(_0x4e43a6){if(_0x4e43a6){return _0x4e43a6[_0x18a9('0x22')](_0x57ea37)[_0x18a9('0x23')](function(_0x127c5f){return _0x127c5f;});}return null;};}function removeEntity(_0x444de0,_0x347543){return function(_0x4402e6){if(_0x4402e6){return _0x4402e6[_0x18a9('0x24')]()[_0x18a9('0x23')](function(){_0x444de0[_0x18a9('0x18')](0xcc)[_0x18a9('0x25')]();});}};}function handleEntityNotFound(_0x100f34,_0xdb4849){return function(_0x18a108){if(!_0x18a108){_0x100f34['sendStatus'](0x194);}return _0x18a108;};}function handleError(_0x560cf6,_0x45d7a7){_0x45d7a7=_0x45d7a7||0x1f4;return function(_0x28513f){logger['error'](_0x28513f['stack']);if(_0x28513f['name']){delete _0x28513f[_0x18a9('0x26')];}_0x560cf6['status'](_0x45d7a7)['send'](_0x28513f);};}exports[_0x18a9('0x27')]=function(_0x4d6d81,_0x3306ff){var _0x492553={},_0x2fcd36={},_0x310f72={'count':0x0,'rows':[]};var _0x3f3a3=_[_0x18a9('0x28')](db[_0x18a9('0x29')][_0x18a9('0x2a')],function(_0x16ee4b){return{'name':_0x16ee4b[_0x18a9('0x2b')],'type':_0x16ee4b[_0x18a9('0x2c')]['key']};});_0x2fcd36[_0x18a9('0x2d')]=_[_0x18a9('0x28')](_0x3f3a3,'name');_0x2fcd36['query']=_[_0x18a9('0x2e')](_0x4d6d81['query']);_0x2fcd36[_0x18a9('0x2f')]=_[_0x18a9('0x30')](_0x2fcd36[_0x18a9('0x2d')],_0x2fcd36[_0x18a9('0x31')]);_0x492553[_0x18a9('0x32')]=_[_0x18a9('0x30')](_0x2fcd36['model'],qs['fields'](_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x33')]));_0x492553[_0x18a9('0x32')]=_0x492553[_0x18a9('0x32')]['length']?_0x492553[_0x18a9('0x32')]:_0x2fcd36['model'];if(!_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x34')](_0x18a9('0x35'))){_0x492553[_0x18a9('0x36')]=qs['limit'](_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x36')]);_0x492553[_0x18a9('0x1a')]=qs[_0x18a9('0x1a')](_0x4d6d81['query'][_0x18a9('0x1a')]);}_0x492553[_0x18a9('0x37')]=qs['sort'](_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x38')]);_0x492553[_0x18a9('0x39')]=qs[_0x18a9('0x2f')](_[_0x18a9('0x3a')](_0x4d6d81[_0x18a9('0x31')],_0x2fcd36[_0x18a9('0x2f')]),_0x3f3a3);if(_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x3b')]){_0x492553[_0x18a9('0x39')]=_[_0x18a9('0x3c')](_0x492553[_0x18a9('0x39')],{'$or':_[_0x18a9('0x28')](_0x3f3a3,function(_0x5e9ea2){if(_0x5e9ea2['type']!==_0x18a9('0x3d')){var _0x3e664b={};_0x3e664b[_0x5e9ea2[_0x18a9('0x26')]]={'$like':'%'+_0x4d6d81[_0x18a9('0x31')]['filter']+'%'};return _0x3e664b;}})});}_0x492553=_[_0x18a9('0x3c')]({},_0x492553,_0x4d6d81[_0x18a9('0x3e')]);var _0x14aa95={'where':_0x492553[_0x18a9('0x39')]};return db['ZendeskField']['count'](_0x14aa95)[_0x18a9('0x23')](function(_0x57166d){_0x310f72['count']=_0x57166d;if(_0x4d6d81[_0x18a9('0x31')][_0x18a9('0x3f')]){_0x492553[_0x18a9('0x40')]=[{'all':!![]}];}return db[_0x18a9('0x29')][_0x18a9('0x41')](_0x492553);})['then'](function(_0x584a8f){_0x310f72[_0x18a9('0x42')]=_0x584a8f;return _0x310f72;})[_0x18a9('0x23')](respondWithFilteredResult(_0x3306ff,_0x492553))[_0x18a9('0x43')](handleError(_0x3306ff,null));};exports[_0x18a9('0x44')]=function(_0x958536,_0x138d0d){var _0x42041e={'raw':!![],'where':{'id':_0x958536[_0x18a9('0x45')]['id']}},_0x252133={};_0x252133[_0x18a9('0x2d')]=_[_0x18a9('0x2e')](db[_0x18a9('0x29')][_0x18a9('0x2a')]);_0x252133[_0x18a9('0x31')]=_[_0x18a9('0x2e')](_0x958536[_0x18a9('0x31')]);_0x252133[_0x18a9('0x2f')]=_[_0x18a9('0x30')](_0x252133[_0x18a9('0x2d')],_0x252133[_0x18a9('0x31')]);_0x42041e['attributes']=_[_0x18a9('0x30')](_0x252133[_0x18a9('0x2d')],qs[_0x18a9('0x33')](_0x958536[_0x18a9('0x31')][_0x18a9('0x33')]));_0x42041e[_0x18a9('0x32')]=_0x42041e[_0x18a9('0x32')][_0x18a9('0x46')]?_0x42041e['attributes']:_0x252133[_0x18a9('0x2d')];if(_0x958536[_0x18a9('0x31')]['includeAll']){_0x42041e[_0x18a9('0x40')]=[{'all':!![]}];}_0x42041e=_[_0x18a9('0x3c')]({},_0x42041e,_0x958536[_0x18a9('0x3e')]);return db[_0x18a9('0x29')][_0x18a9('0x47')](_0x42041e)[_0x18a9('0x23')](handleEntityNotFound(_0x138d0d,null))[_0x18a9('0x23')](respondWithResult(_0x138d0d,null))['catch'](handleError(_0x138d0d,null));};exports[_0x18a9('0x48')]=function(_0x16ec06,_0x155b1a){return db[_0x18a9('0x29')][_0x18a9('0x48')](_0x16ec06['body'],{})[_0x18a9('0x23')](respondWithResult(_0x155b1a,0xc9))[_0x18a9('0x43')](handleError(_0x155b1a,null));};exports['update']=function(_0xddd904,_0x25f407){if(_0xddd904[_0x18a9('0x49')]['id']){delete _0xddd904[_0x18a9('0x49')]['id'];}return db['ZendeskField'][_0x18a9('0x47')]({'where':{'id':_0xddd904[_0x18a9('0x45')]['id']}})[_0x18a9('0x23')](handleEntityNotFound(_0x25f407,null))[_0x18a9('0x23')](saveUpdates(_0xddd904[_0x18a9('0x49')],null))['then'](respondWithResult(_0x25f407,null))[_0x18a9('0x43')](handleError(_0x25f407,null));};exports[_0x18a9('0x24')]=function(_0x3be3e3,_0x42c382){return db[_0x18a9('0x29')]['find']({'where':{'id':_0x3be3e3['params']['id']}})[_0x18a9('0x23')](handleEntityNotFound(_0x42c382,null))[_0x18a9('0x23')](removeEntity(_0x42c382,null))[_0x18a9('0x43')](handleError(_0x42c382,null));}; \ No newline at end of file +var _0xd377=['save','update','then','destroy','error','stack','name','map','ZendeskField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x1eb9b5,_0x5b8629){var _0x1cde4c=function(_0x48e6fc){while(--_0x48e6fc){_0x1eb9b5['push'](_0x1eb9b5['shift']());}};_0x1cde4c(++_0x5b8629);}(_0xd377,0x1a3));var _0x7d37=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd377[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d37('0x0'));var zipdir=require(_0x7d37('0x1'));var jsonpatch=require(_0x7d37('0x2'));var rp=require(_0x7d37('0x3'));var moment=require(_0x7d37('0x4'));var BPromise=require(_0x7d37('0x5'));var Mustache=require(_0x7d37('0x6'));var util=require(_0x7d37('0x7'));var path=require(_0x7d37('0x8'));var sox=require(_0x7d37('0x9'));var csv=require(_0x7d37('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d37('0xb'));var _=require(_0x7d37('0xc'));var squel=require(_0x7d37('0xd'));var crypto=require(_0x7d37('0xe'));var jsforce=require(_0x7d37('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d37('0x10'));var Redis=require(_0x7d37('0x11'));var authService=require(_0x7d37('0x12'));var qs=require(_0x7d37('0x13'));var as=require(_0x7d37('0x14'));var hardwareService=require(_0x7d37('0x15'));var logger=require(_0x7d37('0x16'))(_0x7d37('0x17'));var utils=require('../../config/utils');var config=require(_0x7d37('0x18'));var licenseUtil=require(_0x7d37('0x19'));var db=require(_0x7d37('0x1a'))['db'];function respondWithStatusCode(_0x55996f,_0x3832c4){_0x3832c4=_0x3832c4||0xcc;return function(_0x5b064f){if(_0x5b064f){return _0x55996f[_0x7d37('0x1b')](_0x3832c4);}return _0x55996f[_0x7d37('0x1c')](_0x3832c4)[_0x7d37('0x1d')]();};}function respondWithResult(_0x31de3f,_0x3a0d0d){_0x3a0d0d=_0x3a0d0d||0xc8;return function(_0x468199){if(_0x468199){return _0x31de3f[_0x7d37('0x1c')](_0x3a0d0d)[_0x7d37('0x1e')](_0x468199);}};}function respondWithFilteredResult(_0x530ce1,_0x33485f){return function(_0x5a9812){if(_0x5a9812){var _0x580933=typeof _0x33485f['offset']===_0x7d37('0x1f')&&typeof _0x33485f[_0x7d37('0x20')]==='undefined';var _0x4f3eb4=_0x5a9812[_0x7d37('0x21')];var _0x1e9e65=_0x580933?0x0:_0x33485f[_0x7d37('0x22')];var _0x5db8a6=_0x580933?_0x5a9812['count']:_0x33485f['offset']+_0x33485f[_0x7d37('0x20')];var _0x441ad0;if(_0x5db8a6>=_0x4f3eb4){_0x5db8a6=_0x4f3eb4;_0x441ad0=0xc8;}else{_0x441ad0=0xce;}_0x530ce1['status'](_0x441ad0);return _0x530ce1[_0x7d37('0x23')](_0x7d37('0x24'),_0x1e9e65+'-'+_0x5db8a6+'/'+_0x4f3eb4)[_0x7d37('0x1e')](_0x5a9812);}return null;};}function patchUpdates(_0x7c1489){return function(_0x43f969){try{jsonpatch['apply'](_0x43f969,_0x7c1489,!![]);}catch(_0x47105c){return BPromise['reject'](_0x47105c);}return _0x43f969[_0x7d37('0x25')]();};}function saveUpdates(_0x4cda1f,_0x260da7){return function(_0x25d8d2){if(_0x25d8d2){return _0x25d8d2[_0x7d37('0x26')](_0x4cda1f)[_0x7d37('0x27')](function(_0x256738){return _0x256738;});}return null;};}function removeEntity(_0x560f81,_0x307e69){return function(_0x2d6b6c){if(_0x2d6b6c){return _0x2d6b6c[_0x7d37('0x28')]()[_0x7d37('0x27')](function(){_0x560f81[_0x7d37('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502397,_0x51e1a3){return function(_0x133852){if(!_0x133852){_0x502397[_0x7d37('0x1b')](0x194);}return _0x133852;};}function handleError(_0x828209,_0x40fe3c){_0x40fe3c=_0x40fe3c||0x1f4;return function(_0x23bdb0){logger[_0x7d37('0x29')](_0x23bdb0[_0x7d37('0x2a')]);if(_0x23bdb0[_0x7d37('0x2b')]){delete _0x23bdb0[_0x7d37('0x2b')];}_0x828209['status'](_0x40fe3c)['send'](_0x23bdb0);};}exports['index']=function(_0x53d7b6,_0x364eab){var _0x21d4e0={},_0x483822={},_0x34b113={'count':0x0,'rows':[]};var _0x370aae=_[_0x7d37('0x2c')](db[_0x7d37('0x2d')][_0x7d37('0x2e')],function(_0x4ee38d){return{'name':_0x4ee38d['fieldName'],'type':_0x4ee38d[_0x7d37('0x2f')][_0x7d37('0x30')]};});_0x483822[_0x7d37('0x31')]=_['map'](_0x370aae,_0x7d37('0x2b'));_0x483822[_0x7d37('0x32')]=_[_0x7d37('0x33')](_0x53d7b6['query']);_0x483822[_0x7d37('0x34')]=_[_0x7d37('0x35')](_0x483822[_0x7d37('0x31')],_0x483822[_0x7d37('0x32')]);_0x21d4e0['attributes']=_[_0x7d37('0x35')](_0x483822['model'],qs['fields'](_0x53d7b6['query'][_0x7d37('0x36')]));_0x21d4e0[_0x7d37('0x37')]=_0x21d4e0[_0x7d37('0x37')][_0x7d37('0x38')]?_0x21d4e0[_0x7d37('0x37')]:_0x483822['model'];if(!_0x53d7b6['query'][_0x7d37('0x39')](_0x7d37('0x3a'))){_0x21d4e0[_0x7d37('0x20')]=qs[_0x7d37('0x20')](_0x53d7b6[_0x7d37('0x32')]['limit']);_0x21d4e0['offset']=qs[_0x7d37('0x22')](_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x22')]);}_0x21d4e0[_0x7d37('0x3b')]=qs['sort'](_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x3c')]);_0x21d4e0[_0x7d37('0x3d')]=qs['filters'](_['pick'](_0x53d7b6['query'],_0x483822[_0x7d37('0x34')]),_0x370aae);if(_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x3e')]){_0x21d4e0[_0x7d37('0x3d')]=_[_0x7d37('0x3f')](_0x21d4e0[_0x7d37('0x3d')],{'$or':_['map'](_0x370aae,function(_0x44c71f){if(_0x44c71f[_0x7d37('0x2f')]!==_0x7d37('0x40')){var _0x4dbe7f={};_0x4dbe7f[_0x44c71f[_0x7d37('0x2b')]]={'$like':'%'+_0x53d7b6['query'][_0x7d37('0x3e')]+'%'};return _0x4dbe7f;}})});}_0x21d4e0=_[_0x7d37('0x3f')]({},_0x21d4e0,_0x53d7b6[_0x7d37('0x41')]);var _0x144ce0={'where':_0x21d4e0[_0x7d37('0x3d')]};return db[_0x7d37('0x2d')][_0x7d37('0x21')](_0x144ce0)['then'](function(_0x4e4051){_0x34b113[_0x7d37('0x21')]=_0x4e4051;if(_0x53d7b6[_0x7d37('0x32')]['includeAll']){_0x21d4e0[_0x7d37('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x7d37('0x43')](_0x21d4e0);})[_0x7d37('0x27')](function(_0x2f5173){_0x34b113[_0x7d37('0x44')]=_0x2f5173;return _0x34b113;})['then'](respondWithFilteredResult(_0x364eab,_0x21d4e0))['catch'](handleError(_0x364eab,null));};exports[_0x7d37('0x45')]=function(_0x40a022,_0x23fa31){var _0x213d7c={'raw':!![],'where':{'id':_0x40a022['params']['id']}},_0x57cbc5={};_0x57cbc5[_0x7d37('0x31')]=_[_0x7d37('0x33')](db[_0x7d37('0x2d')]['rawAttributes']);_0x57cbc5[_0x7d37('0x32')]=_['keys'](_0x40a022[_0x7d37('0x32')]);_0x57cbc5['filters']=_[_0x7d37('0x35')](_0x57cbc5['model'],_0x57cbc5['query']);_0x213d7c[_0x7d37('0x37')]=_['intersection'](_0x57cbc5[_0x7d37('0x31')],qs[_0x7d37('0x36')](_0x40a022[_0x7d37('0x32')]['fields']));_0x213d7c[_0x7d37('0x37')]=_0x213d7c[_0x7d37('0x37')][_0x7d37('0x38')]?_0x213d7c[_0x7d37('0x37')]:_0x57cbc5['model'];if(_0x40a022[_0x7d37('0x32')][_0x7d37('0x46')]){_0x213d7c[_0x7d37('0x42')]=[{'all':!![]}];}_0x213d7c=_[_0x7d37('0x3f')]({},_0x213d7c,_0x40a022[_0x7d37('0x41')]);return db['ZendeskField'][_0x7d37('0x47')](_0x213d7c)[_0x7d37('0x27')](handleEntityNotFound(_0x23fa31,null))[_0x7d37('0x27')](respondWithResult(_0x23fa31,null))[_0x7d37('0x48')](handleError(_0x23fa31,null));};exports[_0x7d37('0x49')]=function(_0x1e25df,_0x101544){return db[_0x7d37('0x2d')]['create'](_0x1e25df[_0x7d37('0x4a')],{})[_0x7d37('0x27')](respondWithResult(_0x101544,0xc9))[_0x7d37('0x48')](handleError(_0x101544,null));};exports['update']=function(_0x5f0423,_0x8d3fdd){if(_0x5f0423[_0x7d37('0x4a')]['id']){delete _0x5f0423[_0x7d37('0x4a')]['id'];}return db[_0x7d37('0x2d')][_0x7d37('0x47')]({'where':{'id':_0x5f0423[_0x7d37('0x4b')]['id']}})[_0x7d37('0x27')](handleEntityNotFound(_0x8d3fdd,null))[_0x7d37('0x27')](saveUpdates(_0x5f0423['body'],null))[_0x7d37('0x27')](respondWithResult(_0x8d3fdd,null))['catch'](handleError(_0x8d3fdd,null));};exports[_0x7d37('0x28')]=function(_0x1f310b,_0x172a38){return db[_0x7d37('0x2d')][_0x7d37('0x47')]({'where':{'id':_0x1f310b[_0x7d37('0x4b')]['id']}})['then'](handleEntityNotFound(_0x172a38,null))[_0x7d37('0x27')](removeEntity(_0x172a38,null))['catch'](handleError(_0x172a38,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 715de76..861da07 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 _0x4489=['exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes'];(function(_0x10471c,_0x597603){var _0x32bdee=function(_0x5b3d4c){while(--_0x5b3d4c){_0x10471c['push'](_0x10471c['shift']());}};_0x32bdee(++_0x597603);}(_0x4489,0x76));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var logger=require(_0x9448('0x2'))('api');var moment=require(_0x9448('0x3'));var BPromise=require(_0x9448('0x4'));var rp=require(_0x9448('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9448('0x6'));var attributes=require(_0x9448('0x7'));module[_0x9448('0x8')]=function(_0x2d14a4,_0xecdb93){return _0x2d14a4[_0x9448('0x9')]('ZendeskField',attributes,{'tableName':_0x9448('0xa'),'paranoid':![],'indexes':[{'name':_0x9448('0xb'),'fields':[_0x9448('0xc'),_0x9448('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5278=['FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','zendesk_unique_index','idField'];(function(_0x404307,_0x57c281){var _0x2b558c=function(_0x491407){while(--_0x491407){_0x404307['push'](_0x404307['shift']());}};_0x2b558c(++_0x57c281);}(_0x5278,0x105));var _0x8527=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5278[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x8527('0x0'));var util=require(_0x8527('0x1'));var logger=require('../../config/logger')(_0x8527('0x2'));var moment=require(_0x8527('0x3'));var BPromise=require(_0x8527('0x4'));var rp=require(_0x8527('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8527('0x6'));var config=require(_0x8527('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x8527('0x8')]=function(_0x15f074,_0x63e893){return _0x15f074[_0x8527('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8527('0xa'),'fields':[_0x8527('0xb'),_0x8527('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 326c466..05aebce 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 _0x35fb=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x35fb,0x1b5));var _0xb35f=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0x35fb[_0x303064];return _0x5a1d3d;};'use strict';var _=require(_0xb35f('0x0'));var util=require(_0xb35f('0x1'));var moment=require(_0xb35f('0x2'));var BPromise=require(_0xb35f('0x3'));var rs=require(_0xb35f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb35f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb35f('0x6'))('rpc');var config=require(_0xb35f('0x7'));var jayson=require(_0xb35f('0x8'));var client=jayson['client'][_0xb35f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47b89f,_0x172f04,_0x1c1aed){return new BPromise(function(_0x43c894,_0x26b5bc){return client[_0xb35f('0xa')](_0x47b89f,_0x1c1aed)['then'](function(_0x446870){logger[_0xb35f('0xb')](_0xb35f('0xc'),_0x172f04,_0xb35f('0xd'));logger['debug'](_0xb35f('0xe'),_0x172f04,_0xb35f('0xd'),JSON[_0xb35f('0xf')](_0x446870));if(_0x446870[_0xb35f('0x10')]){if(_0x446870[_0xb35f('0x10')][_0xb35f('0x11')]===0x1f4){logger[_0xb35f('0x10')](_0xb35f('0xc'),_0x172f04,_0x446870[_0xb35f('0x10')][_0xb35f('0x12')]);return _0x26b5bc(_0x446870[_0xb35f('0x10')][_0xb35f('0x12')]);}logger[_0xb35f('0x10')]('ZendeskField,\x20%s,\x20%s',_0x172f04,_0x446870['error'][_0xb35f('0x12')]);return _0x43c894(_0x446870[_0xb35f('0x10')][_0xb35f('0x12')]);}else{logger[_0xb35f('0xb')](_0xb35f('0xc'),_0x172f04,_0xb35f('0xd'));_0x43c894(_0x446870[_0xb35f('0x13')]['message']);}})['catch'](function(_0x2eb17b){logger['error']('ZendeskField,\x20%s,\x20%s',_0x172f04,_0x2eb17b);_0x26b5bc(_0x2eb17b);});});} \ No newline at end of file +var _0x1e19=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','ZendeskField,\x20%s,\x20%s','message','lodash','util'];(function(_0x303fd7,_0x3697e8){var _0x5a0cae=function(_0x3dde58){while(--_0x3dde58){_0x303fd7['push'](_0x303fd7['shift']());}};_0x5a0cae(++_0x3697e8);}(_0x1e19,0x1de));var _0x91e1=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x1e19[_0x1d930e];return _0x5bbd66;};'use strict';var _=require(_0x91e1('0x0'));var util=require(_0x91e1('0x1'));var moment=require('moment');var BPromise=require(_0x91e1('0x2'));var rs=require(_0x91e1('0x3'));var fs=require('fs');var Redis=require(_0x91e1('0x4'));var db=require(_0x91e1('0x5'))['db'];var utils=require(_0x91e1('0x6'));var logger=require(_0x91e1('0x7'))(_0x91e1('0x8'));var config=require(_0x91e1('0x9'));var jayson=require(_0x91e1('0xa'));var client=jayson[_0x91e1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d825,_0x44c9b9,_0x2732c6){return new BPromise(function(_0x3bdc91,_0x52d637){return client[_0x91e1('0xc')](_0x53d825,_0x2732c6)['then'](function(_0x5b36b2){logger[_0x91e1('0xd')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x91e1('0xe'));logger[_0x91e1('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x44c9b9,_0x91e1('0xe'),JSON[_0x91e1('0x10')](_0x5b36b2));if(_0x5b36b2['error']){if(_0x5b36b2['error']['code']===0x1f4){logger[_0x91e1('0x11')](_0x91e1('0x12'),_0x44c9b9,_0x5b36b2['error'][_0x91e1('0x13')]);return _0x52d637(_0x5b36b2[_0x91e1('0x11')]['message']);}logger[_0x91e1('0x11')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x5b36b2['error'][_0x91e1('0x13')]);return _0x3bdc91(_0x5b36b2[_0x91e1('0x11')][_0x91e1('0x13')]);}else{logger[_0x91e1('0xd')](_0x91e1('0x12'),_0x44c9b9,'request\x20sent');_0x3bdc91(_0x5b36b2['result'][_0x91e1('0x13')]);}})['catch'](function(_0x26f7eb){logger[_0x91e1('0x11')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x26f7eb);_0x52d637(_0x26f7eb);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d9ed598..5316826 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 _0x349c=['post','create','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x349c,0x119));var _0xc349=function(_0x44976e,_0x311385){_0x44976e=_0x44976e-0x0;var _0x4852b2=_0x349c[_0x44976e];return _0x4852b2;};'use strict';var multer=require(_0xc349('0x0'));var util=require(_0xc349('0x1'));var path=require(_0xc349('0x2'));var timeout=require(_0xc349('0x3'));var express=require(_0xc349('0x4'));var router=express[_0xc349('0x5')]();var fs_extra=require(_0xc349('0x6'));var auth=require(_0xc349('0x7'));var interaction=require(_0xc349('0x8'));var config=require(_0xc349('0x9'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xc349('0xa')](),controller[_0xc349('0xb')]);router[_0xc349('0xc')](_0xc349('0xd'),auth['isAuthenticated'](),controller[_0xc349('0xe')]);router['get'](_0xc349('0xf'),auth[_0xc349('0xa')](),controller['getConfigurations']);router['get'](_0xc349('0x10'),auth[_0xc349('0xa')](),controller[_0xc349('0x11')]);router[_0xc349('0x12')]('/',auth['isAuthenticated'](),controller[_0xc349('0x13')]);router[_0xc349('0x12')](_0xc349('0xf'),auth['isAuthenticated'](),controller[_0xc349('0x14')]);router[_0xc349('0x15')]('/:id',auth[_0xc349('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc349('0xa')](),controller[_0xc349('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8be5=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0xd8d167,_0x58d76b){var _0x12c50c=function(_0x253f17){while(--_0x253f17){_0xd8d167['push'](_0xd8d167['shift']());}};_0x12c50c(++_0x58d76b);}(_0x8be5,0x191));var _0x58be=function(_0x101aea,_0x8d805d){_0x101aea=_0x101aea-0x0;var _0x5280e9=_0x8be5[_0x101aea];return _0x5280e9;};'use strict';var multer=require(_0x58be('0x0'));var util=require(_0x58be('0x1'));var path=require('path');var timeout=require(_0x58be('0x2'));var express=require(_0x58be('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x58be('0x4'));var controller=require('./intZohoAccount.controller');router[_0x58be('0x5')]('/',auth[_0x58be('0x6')](),controller['index']);router[_0x58be('0x5')]('/:id',auth[_0x58be('0x6')](),controller[_0x58be('0x7')]);router[_0x58be('0x5')](_0x58be('0x8'),auth[_0x58be('0x6')](),controller[_0x58be('0x9')]);router[_0x58be('0x5')]('/:id/fields',auth[_0x58be('0x6')](),controller['getFields']);router[_0x58be('0xa')]('/',auth[_0x58be('0x6')](),controller[_0x58be('0xb')]);router[_0x58be('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x58be('0xc')]);router[_0x58be('0xd')](_0x58be('0xe'),auth[_0x58be('0x6')](),controller[_0x58be('0xf')]);router[_0x58be('0x10')](_0x58be('0xe'),auth[_0x58be('0x6')](),controller['destroy']);module[_0x58be('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index b9d77c3..312c83a 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 _0x9c44=['STRING'];(function(_0x5e8721,_0x378840){var _0xc78d88=function(_0x3dbff7){while(--_0x3dbff7){_0x5e8721['push'](_0x5e8721['shift']());}};_0xc78d88(++_0x378840);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0x3df3c6,_0x496e1a){var _0x254c43=function(_0x371daa){while(--_0x371daa){_0x3df3c6['push'](_0x3df3c6['shift']());}};_0x254c43(++_0x496e1a);}(_0x41bb,0xc5));var _0xb41b=function(_0x165545,_0x46467e){_0x165545=_0x165545-0x0;var _0x5cf0b7=_0x41bb[_0x165545];return _0x5cf0b7;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 475458b..81856a1 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 _0xd740=['https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','getFields','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','display_label','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','ZohoAccount','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x3ebb27,_0x1745df){var _0x3fe7a9=function(_0x2bd552){while(--_0x2bd552){_0x3ebb27['push'](_0x3ebb27['shift']());}};_0x3fe7a9(++_0x1745df);}(_0xd740,0x1a9));var _0x0d74=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xd740[_0x334651];return _0x29657c;};'use strict';var emlformat=require(_0x0d74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d74('0x1'));var jsonpatch=require(_0x0d74('0x2'));var rp=require(_0x0d74('0x3'));var moment=require(_0x0d74('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d74('0x5'));var path=require('path');var sox=require(_0x0d74('0x6'));var csv=require(_0x0d74('0x7'));var ejs=require(_0x0d74('0x8'));var fs=require('fs');var fs_extra=require(_0x0d74('0x9'));var _=require(_0x0d74('0xa'));var squel=require(_0x0d74('0xb'));var crypto=require(_0x0d74('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d74('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0d74('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d74('0xf'));var authService=require(_0x0d74('0x10'));var qs=require(_0x0d74('0x11'));var as=require(_0x0d74('0x12'));var hardwareService=require(_0x0d74('0x13'));var logger=require(_0x0d74('0x14'))(_0x0d74('0x15'));var utils=require('../../config/utils');var config=require(_0x0d74('0x16'));var licenseUtil=require(_0x0d74('0x17'));var db=require(_0x0d74('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x182481,_0x135c06){_0x135c06=_0x135c06||0xcc;return function(_0x283dfc){if(_0x283dfc){return _0x182481['sendStatus'](_0x135c06);}return _0x182481[_0x0d74('0x19')](_0x135c06)[_0x0d74('0x1a')]();};}function respondWithResult(_0x5e5c2c,_0x57c18b){_0x57c18b=_0x57c18b||0xc8;return function(_0x48547a){if(_0x48547a){return _0x5e5c2c['status'](_0x57c18b)[_0x0d74('0x1b')](_0x48547a);}};}function respondWithFilteredResult(_0x2607f4,_0x40107b){return function(_0x54b064){if(_0x54b064){var _0x1923f6=typeof _0x40107b[_0x0d74('0x1c')]===_0x0d74('0x1d')&&typeof _0x40107b[_0x0d74('0x1e')]===_0x0d74('0x1d');var _0x4d23aa=_0x54b064[_0x0d74('0x1f')];var _0x36ecd6=_0x1923f6?0x0:_0x40107b[_0x0d74('0x1c')];var _0x48f1a8=_0x1923f6?_0x54b064[_0x0d74('0x1f')]:_0x40107b[_0x0d74('0x1c')]+_0x40107b[_0x0d74('0x1e')];var _0x1c146d;if(_0x48f1a8>=_0x4d23aa){_0x48f1a8=_0x4d23aa;_0x1c146d=0xc8;}else{_0x1c146d=0xce;}_0x2607f4[_0x0d74('0x19')](_0x1c146d);return _0x2607f4[_0x0d74('0x20')]('Content-Range',_0x36ecd6+'-'+_0x48f1a8+'/'+_0x4d23aa)[_0x0d74('0x1b')](_0x54b064);}return null;};}function patchUpdates(_0x319e2e){return function(_0x27f2f8){try{jsonpatch[_0x0d74('0x21')](_0x27f2f8,_0x319e2e,!![]);}catch(_0x8c21d3){return BPromise[_0x0d74('0x22')](_0x8c21d3);}return _0x27f2f8[_0x0d74('0x23')]();};}function saveUpdates(_0x5928cf,_0x1f7b7a){return function(_0x10fa99){if(_0x10fa99){return _0x10fa99[_0x0d74('0x24')](_0x5928cf)[_0x0d74('0x25')](function(_0x2aa646){return _0x2aa646;});}return null;};}function removeEntity(_0x248ef9,_0x459510){return function(_0x5e9704){if(_0x5e9704){return _0x5e9704[_0x0d74('0x26')]()['then'](function(){_0x248ef9[_0x0d74('0x19')](0xcc)[_0x0d74('0x1a')]();});}};}function handleEntityNotFound(_0x24068d,_0xb5201a){return function(_0x2d80d3){if(!_0x2d80d3){_0x24068d[_0x0d74('0x27')](0x194);}return _0x2d80d3;};}function handleError(_0x5c4228,_0xd4f69e){_0xd4f69e=_0xd4f69e||0x1f4;return function(_0x6d2f26){logger[_0x0d74('0x28')](_0x6d2f26[_0x0d74('0x29')]);if(_0x6d2f26[_0x0d74('0x2a')]){delete _0x6d2f26['name'];}_0x5c4228['status'](_0xd4f69e)['send'](_0x6d2f26);};}exports[_0x0d74('0x2b')]=function(_0x3b86f1,_0x335a05){var _0x3ccea8={},_0x5695b2={},_0x3cff67={'count':0x0,'rows':[]};var _0x484d33=_[_0x0d74('0x2c')](db['ZohoAccount'][_0x0d74('0x2d')],function(_0x5d8d91){return{'name':_0x5d8d91['fieldName'],'type':_0x5d8d91[_0x0d74('0x2e')][_0x0d74('0x2f')]};});_0x5695b2[_0x0d74('0x30')]=_['map'](_0x484d33,_0x0d74('0x2a'));_0x5695b2['query']=_[_0x0d74('0x31')](_0x3b86f1['query']);_0x5695b2[_0x0d74('0x32')]=_[_0x0d74('0x33')](_0x5695b2['model'],_0x5695b2[_0x0d74('0x34')]);_0x3ccea8[_0x0d74('0x35')]=_['intersection'](_0x5695b2[_0x0d74('0x30')],qs[_0x0d74('0x36')](_0x3b86f1[_0x0d74('0x34')]['fields']));_0x3ccea8['attributes']=_0x3ccea8['attributes'][_0x0d74('0x37')]?_0x3ccea8[_0x0d74('0x35')]:_0x5695b2['model'];if(!_0x3b86f1['query'][_0x0d74('0x38')]('nolimit')){_0x3ccea8[_0x0d74('0x1e')]=qs['limit'](_0x3b86f1['query'][_0x0d74('0x1e')]);_0x3ccea8[_0x0d74('0x1c')]=qs[_0x0d74('0x1c')](_0x3b86f1['query'][_0x0d74('0x1c')]);}_0x3ccea8[_0x0d74('0x39')]=qs[_0x0d74('0x3a')](_0x3b86f1[_0x0d74('0x34')]['sort']);_0x3ccea8[_0x0d74('0x3b')]=qs[_0x0d74('0x32')](_['pick'](_0x3b86f1[_0x0d74('0x34')],_0x5695b2['filters']),_0x484d33);if(_0x3b86f1['query'][_0x0d74('0x3c')]){_0x3ccea8['where']=_['merge'](_0x3ccea8['where'],{'$or':_[_0x0d74('0x2c')](_0x484d33,function(_0x4019ba){if(_0x4019ba[_0x0d74('0x2e')]!==_0x0d74('0x3d')){var _0x1bc474={};_0x1bc474[_0x4019ba['name']]={'$like':'%'+_0x3b86f1['query'][_0x0d74('0x3c')]+'%'};return _0x1bc474;}})});}_0x3ccea8=_[_0x0d74('0x3e')]({},_0x3ccea8,_0x3b86f1['options']);var _0x5ed9c9={'where':_0x3ccea8[_0x0d74('0x3b')]};return db[_0x0d74('0x3f')][_0x0d74('0x1f')](_0x5ed9c9)[_0x0d74('0x25')](function(_0x22ea06){_0x3cff67[_0x0d74('0x1f')]=_0x22ea06;if(_0x3b86f1[_0x0d74('0x34')][_0x0d74('0x40')]){_0x3ccea8['include']=[{'all':!![]}];}return db[_0x0d74('0x3f')][_0x0d74('0x41')](_0x3ccea8);})[_0x0d74('0x25')](function(_0x5f4342){_0x3cff67[_0x0d74('0x42')]=_0x5f4342;return _0x3cff67;})[_0x0d74('0x25')](respondWithFilteredResult(_0x335a05,_0x3ccea8))[_0x0d74('0x43')](handleError(_0x335a05,null));};exports[_0x0d74('0x44')]=function(_0x2455b6,_0x5dec5e){var _0x4fdcc7={'raw':![],'where':{'id':_0x2455b6[_0x0d74('0x45')]['id']}},_0x151ec3={};_0x151ec3['model']=_[_0x0d74('0x31')](db['ZohoAccount'][_0x0d74('0x2d')]);_0x151ec3[_0x0d74('0x34')]=_['keys'](_0x2455b6[_0x0d74('0x34')]);_0x151ec3[_0x0d74('0x32')]=_[_0x0d74('0x33')](_0x151ec3[_0x0d74('0x30')],_0x151ec3[_0x0d74('0x34')]);_0x4fdcc7[_0x0d74('0x35')]=_[_0x0d74('0x33')](_0x151ec3[_0x0d74('0x30')],qs[_0x0d74('0x36')](_0x2455b6[_0x0d74('0x34')]['fields']));_0x4fdcc7[_0x0d74('0x35')]=_0x4fdcc7[_0x0d74('0x35')][_0x0d74('0x37')]?_0x4fdcc7[_0x0d74('0x35')]:_0x151ec3[_0x0d74('0x30')];if(_0x2455b6[_0x0d74('0x34')][_0x0d74('0x40')]){_0x4fdcc7[_0x0d74('0x46')]=[{'all':!![]}];}_0x4fdcc7=_['merge']({},_0x4fdcc7,_0x2455b6[_0x0d74('0x47')]);return db[_0x0d74('0x3f')][_0x0d74('0x48')](_0x4fdcc7)[_0x0d74('0x25')](handleEntityNotFound(_0x5dec5e,null))[_0x0d74('0x25')](respondWithResult(_0x5dec5e,null))[_0x0d74('0x43')](handleError(_0x5dec5e,null));};exports[_0x0d74('0x49')]=function(_0x1ac46e,_0xe744ec){return db[_0x0d74('0x3f')][_0x0d74('0x49')](_0x1ac46e[_0x0d74('0x4a')],{})[_0x0d74('0x25')](respondWithResult(_0xe744ec,0xc9))[_0x0d74('0x43')](handleError(_0xe744ec,null));};exports[_0x0d74('0x24')]=function(_0x39ad82,_0x3c9b47){if(_0x39ad82[_0x0d74('0x4a')]['id']){delete _0x39ad82['body']['id'];}return db[_0x0d74('0x3f')]['find']({'where':{'id':_0x39ad82['params']['id']}})[_0x0d74('0x25')](handleEntityNotFound(_0x3c9b47,null))[_0x0d74('0x25')](saveUpdates(_0x39ad82['body'],null))[_0x0d74('0x25')](respondWithResult(_0x3c9b47,null))['catch'](handleError(_0x3c9b47,null));};exports[_0x0d74('0x26')]=function(_0xd33784,_0xbfdcd1){return db[_0x0d74('0x3f')]['find']({'where':{'id':_0xd33784[_0x0d74('0x45')]['id']}})[_0x0d74('0x25')](handleEntityNotFound(_0xbfdcd1,null))['then'](removeEntity(_0xbfdcd1,null))[_0x0d74('0x43')](handleError(_0xbfdcd1,null));};exports['getConfigurations']=function(_0x241433,_0x4508c8,_0x22f63a){var _0x45283e={};var _0x1b5c5f={};var _0xd640c;var _0x26a276;return db['ZohoAccount'][_0x0d74('0x4b')]({'where':{'id':_0x241433['params']['id']}})[_0x0d74('0x25')](handleEntityNotFound(_0x4508c8,null))['then'](function(_0x1bac7d){if(_0x1bac7d){_0xd640c=_0x1bac7d;_0x1b5c5f[_0x0d74('0x30')]=_[_0x0d74('0x31')](db[_0x0d74('0x4c')][_0x0d74('0x2d')]);_0x1b5c5f['query']=_[_0x0d74('0x31')](_0x241433['query']);_0x1b5c5f[_0x0d74('0x32')]=_[_0x0d74('0x33')](_0x1b5c5f['model'],_0x1b5c5f[_0x0d74('0x34')]);_0x45283e[_0x0d74('0x35')]=_[_0x0d74('0x33')](_0x1b5c5f[_0x0d74('0x30')],qs[_0x0d74('0x36')](_0x241433[_0x0d74('0x34')]['fields']));_0x45283e[_0x0d74('0x35')]=_0x45283e[_0x0d74('0x35')][_0x0d74('0x37')]?_0x45283e[_0x0d74('0x35')]:_0x1b5c5f[_0x0d74('0x30')];_0x45283e[_0x0d74('0x39')]=qs[_0x0d74('0x3a')](_0x241433[_0x0d74('0x34')]['sort']);_0x45283e[_0x0d74('0x3b')]=qs[_0x0d74('0x32')](_[_0x0d74('0x4d')](_0x241433['query'],_0x1b5c5f['filters']));if(_0x241433[_0x0d74('0x34')][_0x0d74('0x3c')]){_0x45283e[_0x0d74('0x3b')]=_[_0x0d74('0x3e')](_0x45283e[_0x0d74('0x3b')],{'$or':_[_0x0d74('0x2c')](_0x45283e[_0x0d74('0x35')],function(_0x4dd211){var _0x3d558d={};_0x3d558d[_0x4dd211]={'$like':'%'+_0x241433[_0x0d74('0x34')][_0x0d74('0x3c')]+'%'};return _0x3d558d;})});}_0x45283e=_['merge']({},_0x45283e,_0x241433['options']);return _0xd640c[_0x0d74('0x4e')](_0x45283e);}})[_0x0d74('0x25')](function(_0x374242){if(_0x374242){_0x26a276=_0x374242['length'];if(!_0x241433[_0x0d74('0x34')]['hasOwnProperty'](_0x0d74('0x4f'))){_0x45283e[_0x0d74('0x1e')]=qs[_0x0d74('0x1e')](_0x241433[_0x0d74('0x34')][_0x0d74('0x1e')]);_0x45283e['offset']=qs[_0x0d74('0x1c')](_0x241433[_0x0d74('0x34')][_0x0d74('0x1c')]);}return _0xd640c[_0x0d74('0x4e')](_0x45283e);}})[_0x0d74('0x25')](function(_0x452720){if(_0x452720){return _0x452720?{'count':_0x26a276,'rows':_0x452720}:null;}})[_0x0d74('0x25')](respondWithResult(_0x4508c8,null))[_0x0d74('0x43')](handleError(_0x4508c8,null));};exports[_0x0d74('0x50')]=function(_0x44e22f,_0x44d940,_0x339bb3){if(_0x44e22f[_0x0d74('0x4a')]['id']){delete _0x44e22f[_0x0d74('0x4a')]['id'];}return db[_0x0d74('0x3f')][_0x0d74('0x4b')]({'where':{'id':_0x44e22f['params']['id']}})[_0x0d74('0x25')](handleEntityNotFound(_0x44d940,null))[_0x0d74('0x25')](function(_0x3c41f8){if(_0x3c41f8){_0x44e22f[_0x0d74('0x4a')][_0x0d74('0x51')]=_0x3c41f8['id'];_0x44e22f[_0x0d74('0x4a')][_0x0d74('0x52')]=integrations[_0x0d74('0x53')](_0x44e22f[_0x0d74('0x4a')][_0x0d74('0x54')],_0x44e22f[_0x0d74('0x4a')][_0x0d74('0x2e')]);_0x44e22f[_0x0d74('0x4a')]['Descriptions']=integrations[_0x0d74('0x55')](_0x44e22f[_0x0d74('0x4a')]['channel'],_0x44e22f[_0x0d74('0x4a')][_0x0d74('0x2e')]);return db[_0x0d74('0x4c')]['create'](_0x44e22f['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x0d74('0x56')],'as':_0x0d74('0x57')}]});}return null;})['then'](respondWithResult(_0x44d940,null))['catch'](handleError(_0x44d940,null));};function getAccessToken(_0x5a6ccd){return new Promise(function(_0xed4f40,_0x52b566){var _0x2e5a58;switch(_0x5a6ccd[_0x0d74('0x58')]){case'US':_0x2e5a58=_0x0d74('0x59');break;case'AU':_0x2e5a58=_0x0d74('0x5a');break;case'EU':_0x2e5a58='https://accounts.zoho.eu';break;case'IN':_0x2e5a58=_0x0d74('0x5b');break;case'CN':_0x2e5a58='https://accounts.zoho.com.cn';break;default:_0x2e5a58=_0x0d74('0x5c');break;}var _0x93f738={'method':_0x0d74('0x5d'),'uri':_0x2e5a58+_0x0d74('0x5e'),'qs':{'refresh_token':_0x5a6ccd[_0x0d74('0x5f')],'client_id':_0x5a6ccd['clientId'],'client_secret':_0x5a6ccd[_0x0d74('0x60')],'grant_type':_0x0d74('0x61')},'json':!![]};return rp(_0x93f738)['then'](function(_0x165564){if(_0x165564[_0x0d74('0x62')]){_0xed4f40(_0x165564[_0x0d74('0x62')]);}else{_0x52b566('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x1c4b5c){_0x52b566(_0x1c4b5c);});});}exports[_0x0d74('0x63')]=function(_0x552171,_0x4cbb20,_0x422d4e){var _0x2cc825,_0x7e87b9,_0x40cbea,_0x8b2d38,_0x168ea9;return db['ZohoAccount'][_0x0d74('0x4b')]({'where':{'id':_0x552171[_0x0d74('0x45')]['id']},'attributes':['id',_0x0d74('0x64'),_0x0d74('0x58'),'clientId',_0x0d74('0x60'),'serverUrl','code',_0x0d74('0x5f')]})[_0x0d74('0x25')](handleEntityNotFound(_0x4cbb20,null))[_0x0d74('0x25')](function(_0x34909f){_0x168ea9=_0x34909f;_0x2cc825=_0x168ea9[_0x0d74('0x64')];_0x7e87b9=_0x2cc825===_0x0d74('0x65')?'eu':_0x0d74('0x66');_0x40cbea=_0x168ea9[_0x0d74('0x67')];var _0x5b0d38=_0x40cbea[_0x0d74('0x68')](-0x1);if(_0x5b0d38==='/'||_0x5b0d38==='\x5c'||_0x5b0d38===':'){_0x40cbea=_0x40cbea[_0x0d74('0x69')](0x0,_0x40cbea[_0x0d74('0x6a')](_0x5b0d38));}if(!_0x168ea9[_0x0d74('0x5f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x168ea9);})[_0x0d74('0x25')](function(_0x51d6e1){if(_0x51d6e1){return rp({'method':'GET','uri':util[_0x0d74('0x6b')](_0x0d74('0x6c'),_0x7e87b9),'qs':{'module':'Calls'},'headers':{'Authorization':_0x0d74('0x6d')+_0x51d6e1},'json':!![]});}})[_0x0d74('0x25')](function(_0x204ac4){if(_0x204ac4){if(_0x204ac4[_0x0d74('0x6e')]&&_0x204ac4[_0x0d74('0x6e')]['error']){throw new Error(_0x204ac4['response'][_0x0d74('0x28')][_0x0d74('0x6f')]);}var _0x47882a=[];var _0x2249a1=[];var _0x3152cc=['Owner','Subject',_0x0d74('0x70'),_0x0d74('0x71'),'Call_Duration',_0x0d74('0x72'),_0x0d74('0x73'),_0x0d74('0x74')];_0x2249a1=_[_0x0d74('0x75')](_0x204ac4['fields'],function(_0x26220a){return _0x3152cc[_0x0d74('0x76')](_0x26220a['api_name']);});for(var _0x53bf53=0x0;_0x53bf53<_0x2249a1[_0x0d74('0x37')];_0x53bf53++){if(_0x2249a1[_0x53bf53][_0x0d74('0x77')]===![]){_0x47882a['push']({'id':_0x2249a1[_0x53bf53]['id'],'name':_0x2249a1[_0x53bf53][_0x0d74('0x78')],'custom':_0x2249a1[_0x53bf53]['custom_field'],'options':_0x2249a1[_0x53bf53][_0x0d74('0x79')]==='picklist'&&_0x2249a1[_0x53bf53][_0x0d74('0x7a')][_0x0d74('0x37')]>-0x1?_['map'](_0x2249a1[_0x53bf53][_0x0d74('0x7a')],function(_0x2a79b0){return{'name':_0x2a79b0,'value':_0x2a79b0};}):[]});}}return{'count':_0x47882a[_0x0d74('0x37')],'rows':_0x47882a};}else{return{'count':0x0,'rows':[]};}})[_0x0d74('0x25')](respondWithResult(_0x4cbb20,null))['catch'](function(_0x208945){var _0x2fec33=_0x552171[_0x0d74('0x34')]['test']?0x1f4:_0x208945[_0x0d74('0x7b')]||0x1f4;logger[_0x0d74('0x28')](_0x0d74('0x7c'),_0x0d74('0x63'),_0x2fec33,JSON[_0x0d74('0x7d')](_0x208945));delete _0x208945[_0x0d74('0x2a')];if(_0x2fec33===0x191){_0x2fec33=0x190;}_0x4cbb20[_0x0d74('0x19')](_0x2fec33)[_0x0d74('0x7e')](_0x552171[_0x0d74('0x34')][_0x0d74('0x7f')]?{'message':_0x0d74('0x80'),'statusCode':_0x208945[_0x0d74('0x7b')]}:_0x208945);});}; \ No newline at end of file +var _0xc960=['custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','ZohoConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','host','zoho.eu','com','slice','substring','lastIndexOf','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label'];(function(_0x2103dd,_0x2cb8f6){var _0x457cf6=function(_0x1f9738){while(--_0x1f9738){_0x2103dd['push'](_0x2103dd['shift']());}};_0x457cf6(++_0x2cb8f6);}(_0xc960,0x8d));var _0x0c96=function(_0x29bc89,_0x424c24){_0x29bc89=_0x29bc89-0x0;var _0x3d6b79=_0xc960[_0x29bc89];return _0x3d6b79;};'use strict';var emlformat=require(_0x0c96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c96('0x2'));var moment=require(_0x0c96('0x3'));var BPromise=require(_0x0c96('0x4'));var Mustache=require(_0x0c96('0x5'));var util=require(_0x0c96('0x6'));var path=require(_0x0c96('0x7'));var sox=require(_0x0c96('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c96('0x9'));var squel=require(_0x0c96('0xa'));var crypto=require('crypto');var jsforce=require(_0x0c96('0xb'));var deskjs=require(_0x0c96('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0c96('0xd'));var Papa=require(_0x0c96('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0c96('0xf'));var as=require(_0x0c96('0x10'));var hardwareService=require(_0x0c96('0x11'));var logger=require(_0x0c96('0x12'))(_0x0c96('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0c96('0x14'));var db=require(_0x0c96('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x376a74,_0x780730){_0x780730=_0x780730||0xcc;return function(_0x5db207){if(_0x5db207){return _0x376a74[_0x0c96('0x16')](_0x780730);}return _0x376a74['status'](_0x780730)[_0x0c96('0x17')]();};}function respondWithResult(_0x5425bf,_0x53d4af){_0x53d4af=_0x53d4af||0xc8;return function(_0x53888e){if(_0x53888e){return _0x5425bf[_0x0c96('0x18')](_0x53d4af)[_0x0c96('0x19')](_0x53888e);}};}function respondWithFilteredResult(_0x1cf3fd,_0x4972bf){return function(_0x45506){if(_0x45506){var _0x526574=typeof _0x4972bf[_0x0c96('0x1a')]===_0x0c96('0x1b')&&typeof _0x4972bf[_0x0c96('0x1c')]===_0x0c96('0x1b');var _0x389fca=_0x45506['count'];var _0x3edebe=_0x526574?0x0:_0x4972bf[_0x0c96('0x1a')];var _0x4582be=_0x526574?_0x45506[_0x0c96('0x1d')]:_0x4972bf[_0x0c96('0x1a')]+_0x4972bf['limit'];var _0x37fd8c;if(_0x4582be>=_0x389fca){_0x4582be=_0x389fca;_0x37fd8c=0xc8;}else{_0x37fd8c=0xce;}_0x1cf3fd[_0x0c96('0x18')](_0x37fd8c);return _0x1cf3fd[_0x0c96('0x1e')](_0x0c96('0x1f'),_0x3edebe+'-'+_0x4582be+'/'+_0x389fca)[_0x0c96('0x19')](_0x45506);}return null;};}function patchUpdates(_0x23727e){return function(_0x5453e0){try{jsonpatch[_0x0c96('0x20')](_0x5453e0,_0x23727e,!![]);}catch(_0xfdc2fd){return BPromise[_0x0c96('0x21')](_0xfdc2fd);}return _0x5453e0['save']();};}function saveUpdates(_0x433a8c,_0x1657c9){return function(_0x2d3c8c){if(_0x2d3c8c){return _0x2d3c8c[_0x0c96('0x22')](_0x433a8c)[_0x0c96('0x23')](function(_0x2ec755){return _0x2ec755;});}return null;};}function removeEntity(_0x8b7162,_0x548f72){return function(_0x4b03b4){if(_0x4b03b4){return _0x4b03b4[_0x0c96('0x24')]()[_0x0c96('0x23')](function(){_0x8b7162[_0x0c96('0x18')](0xcc)[_0x0c96('0x17')]();});}};}function handleEntityNotFound(_0x5d848d,_0x3c6435){return function(_0xf90f3c){if(!_0xf90f3c){_0x5d848d[_0x0c96('0x16')](0x194);}return _0xf90f3c;};}function handleError(_0x57649e,_0xfa9fb6){_0xfa9fb6=_0xfa9fb6||0x1f4;return function(_0x31bdfb){logger[_0x0c96('0x25')](_0x31bdfb[_0x0c96('0x26')]);if(_0x31bdfb[_0x0c96('0x27')]){delete _0x31bdfb[_0x0c96('0x27')];}_0x57649e[_0x0c96('0x18')](_0xfa9fb6)[_0x0c96('0x28')](_0x31bdfb);};}exports[_0x0c96('0x29')]=function(_0x40b12f,_0x3df7f4){var _0x5f2abc={},_0x4de242={},_0x373a2b={'count':0x0,'rows':[]};var _0x3dc2ab=_['map'](db[_0x0c96('0x2a')][_0x0c96('0x2b')],function(_0x5743cd){return{'name':_0x5743cd[_0x0c96('0x2c')],'type':_0x5743cd[_0x0c96('0x2d')][_0x0c96('0x2e')]};});_0x4de242[_0x0c96('0x2f')]=_[_0x0c96('0x30')](_0x3dc2ab,_0x0c96('0x27'));_0x4de242[_0x0c96('0x31')]=_['keys'](_0x40b12f['query']);_0x4de242['filters']=_[_0x0c96('0x32')](_0x4de242[_0x0c96('0x2f')],_0x4de242[_0x0c96('0x31')]);_0x5f2abc[_0x0c96('0x33')]=_[_0x0c96('0x32')](_0x4de242['model'],qs[_0x0c96('0x34')](_0x40b12f['query'][_0x0c96('0x34')]));_0x5f2abc['attributes']=_0x5f2abc['attributes'][_0x0c96('0x35')]?_0x5f2abc['attributes']:_0x4de242[_0x0c96('0x2f')];if(!_0x40b12f['query'][_0x0c96('0x36')]('nolimit')){_0x5f2abc['limit']=qs[_0x0c96('0x1c')](_0x40b12f['query'][_0x0c96('0x1c')]);_0x5f2abc['offset']=qs[_0x0c96('0x1a')](_0x40b12f[_0x0c96('0x31')][_0x0c96('0x1a')]);}_0x5f2abc[_0x0c96('0x37')]=qs[_0x0c96('0x38')](_0x40b12f[_0x0c96('0x31')][_0x0c96('0x38')]);_0x5f2abc[_0x0c96('0x39')]=qs[_0x0c96('0x3a')](_[_0x0c96('0x3b')](_0x40b12f[_0x0c96('0x31')],_0x4de242[_0x0c96('0x3a')]),_0x3dc2ab);if(_0x40b12f[_0x0c96('0x31')][_0x0c96('0x3c')]){_0x5f2abc[_0x0c96('0x39')]=_[_0x0c96('0x3d')](_0x5f2abc[_0x0c96('0x39')],{'$or':_['map'](_0x3dc2ab,function(_0x8f862c){if(_0x8f862c['type']!==_0x0c96('0x3e')){var _0x571996={};_0x571996[_0x8f862c['name']]={'$like':'%'+_0x40b12f[_0x0c96('0x31')][_0x0c96('0x3c')]+'%'};return _0x571996;}})});}_0x5f2abc=_[_0x0c96('0x3d')]({},_0x5f2abc,_0x40b12f[_0x0c96('0x3f')]);var _0x39bccd={'where':_0x5f2abc['where']};return db[_0x0c96('0x2a')][_0x0c96('0x1d')](_0x39bccd)[_0x0c96('0x23')](function(_0x3ad021){_0x373a2b[_0x0c96('0x1d')]=_0x3ad021;if(_0x40b12f[_0x0c96('0x31')][_0x0c96('0x40')]){_0x5f2abc[_0x0c96('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x0c96('0x42')](_0x5f2abc);})[_0x0c96('0x23')](function(_0x4ef4aa){_0x373a2b[_0x0c96('0x43')]=_0x4ef4aa;return _0x373a2b;})[_0x0c96('0x23')](respondWithFilteredResult(_0x3df7f4,_0x5f2abc))[_0x0c96('0x44')](handleError(_0x3df7f4,null));};exports[_0x0c96('0x45')]=function(_0x14882c,_0x318b6f){var _0x23a38c={'raw':![],'where':{'id':_0x14882c['params']['id']}},_0x1d879f={};_0x1d879f[_0x0c96('0x2f')]=_[_0x0c96('0x46')](db['ZohoAccount'][_0x0c96('0x2b')]);_0x1d879f[_0x0c96('0x31')]=_[_0x0c96('0x46')](_0x14882c[_0x0c96('0x31')]);_0x1d879f['filters']=_['intersection'](_0x1d879f[_0x0c96('0x2f')],_0x1d879f[_0x0c96('0x31')]);_0x23a38c[_0x0c96('0x33')]=_[_0x0c96('0x32')](_0x1d879f[_0x0c96('0x2f')],qs[_0x0c96('0x34')](_0x14882c['query']['fields']));_0x23a38c[_0x0c96('0x33')]=_0x23a38c['attributes'][_0x0c96('0x35')]?_0x23a38c[_0x0c96('0x33')]:_0x1d879f[_0x0c96('0x2f')];if(_0x14882c[_0x0c96('0x31')][_0x0c96('0x40')]){_0x23a38c[_0x0c96('0x41')]=[{'all':!![]}];}_0x23a38c=_[_0x0c96('0x3d')]({},_0x23a38c,_0x14882c[_0x0c96('0x3f')]);return db['ZohoAccount']['find'](_0x23a38c)['then'](handleEntityNotFound(_0x318b6f,null))[_0x0c96('0x23')](respondWithResult(_0x318b6f,null))[_0x0c96('0x44')](handleError(_0x318b6f,null));};exports[_0x0c96('0x47')]=function(_0x299897,_0x5db11c){return db[_0x0c96('0x2a')][_0x0c96('0x47')](_0x299897[_0x0c96('0x48')],{})['then'](respondWithResult(_0x5db11c,0xc9))[_0x0c96('0x44')](handleError(_0x5db11c,null));};exports['update']=function(_0x417be2,_0x2dc5ef){if(_0x417be2[_0x0c96('0x48')]['id']){delete _0x417be2['body']['id'];}return db[_0x0c96('0x2a')][_0x0c96('0x49')]({'where':{'id':_0x417be2[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x2dc5ef,null))[_0x0c96('0x23')](saveUpdates(_0x417be2[_0x0c96('0x48')],null))[_0x0c96('0x23')](respondWithResult(_0x2dc5ef,null))[_0x0c96('0x44')](handleError(_0x2dc5ef,null));};exports['destroy']=function(_0x16311a,_0x2699f7){return db[_0x0c96('0x2a')][_0x0c96('0x49')]({'where':{'id':_0x16311a[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x2699f7,null))[_0x0c96('0x23')](removeEntity(_0x2699f7,null))[_0x0c96('0x44')](handleError(_0x2699f7,null));};exports[_0x0c96('0x4b')]=function(_0x24a002,_0x55f82c,_0x559537){var _0x2678cb={};var _0x272dc1={};var _0xdda9ee;var _0xf99101;return db[_0x0c96('0x2a')]['findOne']({'where':{'id':_0x24a002['params']['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x55f82c,null))[_0x0c96('0x23')](function(_0x31c438){if(_0x31c438){_0xdda9ee=_0x31c438;_0x272dc1['model']=_[_0x0c96('0x46')](db[_0x0c96('0x4c')][_0x0c96('0x2b')]);_0x272dc1[_0x0c96('0x31')]=_['keys'](_0x24a002[_0x0c96('0x31')]);_0x272dc1[_0x0c96('0x3a')]=_[_0x0c96('0x32')](_0x272dc1['model'],_0x272dc1[_0x0c96('0x31')]);_0x2678cb[_0x0c96('0x33')]=_['intersection'](_0x272dc1['model'],qs[_0x0c96('0x34')](_0x24a002[_0x0c96('0x31')][_0x0c96('0x34')]));_0x2678cb['attributes']=_0x2678cb['attributes'][_0x0c96('0x35')]?_0x2678cb[_0x0c96('0x33')]:_0x272dc1[_0x0c96('0x2f')];_0x2678cb[_0x0c96('0x37')]=qs[_0x0c96('0x38')](_0x24a002[_0x0c96('0x31')]['sort']);_0x2678cb[_0x0c96('0x39')]=qs[_0x0c96('0x3a')](_['pick'](_0x24a002[_0x0c96('0x31')],_0x272dc1[_0x0c96('0x3a')]));if(_0x24a002[_0x0c96('0x31')][_0x0c96('0x3c')]){_0x2678cb['where']=_[_0x0c96('0x3d')](_0x2678cb['where'],{'$or':_[_0x0c96('0x30')](_0x2678cb[_0x0c96('0x33')],function(_0x506846){var _0x389bc8={};_0x389bc8[_0x506846]={'$like':'%'+_0x24a002[_0x0c96('0x31')][_0x0c96('0x3c')]+'%'};return _0x389bc8;})});}_0x2678cb=_[_0x0c96('0x3d')]({},_0x2678cb,_0x24a002['options']);return _0xdda9ee[_0x0c96('0x4b')](_0x2678cb);}})[_0x0c96('0x23')](function(_0x50e732){if(_0x50e732){_0xf99101=_0x50e732['length'];if(!_0x24a002[_0x0c96('0x31')][_0x0c96('0x36')](_0x0c96('0x4d'))){_0x2678cb['limit']=qs[_0x0c96('0x1c')](_0x24a002[_0x0c96('0x31')][_0x0c96('0x1c')]);_0x2678cb[_0x0c96('0x1a')]=qs[_0x0c96('0x1a')](_0x24a002['query'][_0x0c96('0x1a')]);}return _0xdda9ee[_0x0c96('0x4b')](_0x2678cb);}})[_0x0c96('0x23')](function(_0x29255d){if(_0x29255d){return _0x29255d?{'count':_0xf99101,'rows':_0x29255d}:null;}})[_0x0c96('0x23')](respondWithResult(_0x55f82c,null))[_0x0c96('0x44')](handleError(_0x55f82c,null));};exports[_0x0c96('0x4e')]=function(_0x41a3f9,_0xe71953,_0x134664){if(_0x41a3f9[_0x0c96('0x48')]['id']){delete _0x41a3f9[_0x0c96('0x48')]['id'];}return db[_0x0c96('0x2a')][_0x0c96('0x4f')]({'where':{'id':_0x41a3f9[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0xe71953,null))[_0x0c96('0x23')](function(_0x45a17a){if(_0x45a17a){_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x50')]=_0x45a17a['id'];_0x41a3f9['body'][_0x0c96('0x51')]=integrations['getSubjects'](_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x52')],_0x41a3f9[_0x0c96('0x48')]['type']);_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x53')]=integrations[_0x0c96('0x54')](_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x52')],_0x41a3f9['body'][_0x0c96('0x2d')]);return db[_0x0c96('0x4c')][_0x0c96('0x47')](_0x41a3f9[_0x0c96('0x48')],{'include':[{'model':db[_0x0c96('0x55')],'as':_0x0c96('0x51')},{'model':db[_0x0c96('0x55')],'as':'Descriptions'}]});}return null;})[_0x0c96('0x23')](respondWithResult(_0xe71953,null))[_0x0c96('0x44')](handleError(_0xe71953,null));};function getAccessToken(_0x549d49){return new Promise(function(_0xb67791,_0x159c16){var _0x1777bc;switch(_0x549d49[_0x0c96('0x56')]){case'US':_0x1777bc=_0x0c96('0x57');break;case'AU':_0x1777bc=_0x0c96('0x58');break;case'EU':_0x1777bc=_0x0c96('0x59');break;case'IN':_0x1777bc=_0x0c96('0x5a');break;case'CN':_0x1777bc=_0x0c96('0x5b');break;default:_0x1777bc='https://accounts.zoho.eu';break;}var _0x3b1c37={'method':_0x0c96('0x5c'),'uri':_0x1777bc+_0x0c96('0x5d'),'qs':{'refresh_token':_0x549d49['refreshToken'],'client_id':_0x549d49[_0x0c96('0x5e')],'client_secret':_0x549d49[_0x0c96('0x5f')],'grant_type':_0x0c96('0x60')},'json':!![]};return rp(_0x3b1c37)[_0x0c96('0x23')](function(_0x10458a){if(_0x10458a[_0x0c96('0x61')]){_0xb67791(_0x10458a[_0x0c96('0x61')]);}else{_0x159c16(_0x0c96('0x62'));}})[_0x0c96('0x44')](function(_0x306576){_0x159c16(_0x306576);});});}exports[_0x0c96('0x63')]=function(_0x392e66,_0x4fbdd4,_0x18e1d5){var _0x1109e7,_0x3c5d5d,_0x540a9e,_0x4f1ac3,_0xa7a72f;return db[_0x0c96('0x2a')]['findOne']({'where':{'id':_0x392e66[_0x0c96('0x4a')]['id']},'attributes':['id','host',_0x0c96('0x56'),'clientId',_0x0c96('0x5f'),_0x0c96('0x64'),'code','refreshToken']})[_0x0c96('0x23')](handleEntityNotFound(_0x4fbdd4,null))[_0x0c96('0x23')](function(_0x1a1023){_0xa7a72f=_0x1a1023;_0x1109e7=_0xa7a72f[_0x0c96('0x65')];_0x3c5d5d=_0x1109e7===_0x0c96('0x66')?'eu':_0x0c96('0x67');_0x540a9e=_0xa7a72f[_0x0c96('0x64')];var _0x3c9043=_0x540a9e[_0x0c96('0x68')](-0x1);if(_0x3c9043==='/'||_0x3c9043==='\x5c'||_0x3c9043===':'){_0x540a9e=_0x540a9e[_0x0c96('0x69')](0x0,_0x540a9e[_0x0c96('0x6a')](_0x3c9043));}if(!_0xa7a72f['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xa7a72f);})[_0x0c96('0x23')](function(_0x5d0bd3){if(_0x5d0bd3){return rp({'method':'GET','uri':util['format'](_0x0c96('0x6b'),_0x3c5d5d),'qs':{'module':_0x0c96('0x6c')},'headers':{'Authorization':_0x0c96('0x6d')+_0x5d0bd3},'json':!![]});}})[_0x0c96('0x23')](function(_0x23615f){if(_0x23615f){if(_0x23615f[_0x0c96('0x6e')]&&_0x23615f[_0x0c96('0x6e')][_0x0c96('0x25')]){throw new Error(_0x23615f[_0x0c96('0x6e')][_0x0c96('0x25')][_0x0c96('0x6f')]);}var _0x3c1dbd=[];var _0x1b5878=[];var _0x3fd333=[_0x0c96('0x70'),'Subject',_0x0c96('0x71'),_0x0c96('0x72'),_0x0c96('0x73'),_0x0c96('0x74'),_0x0c96('0x75'),_0x0c96('0x76')];_0x1b5878=_[_0x0c96('0x77')](_0x23615f[_0x0c96('0x34')],function(_0x3cc317){return _0x3fd333[_0x0c96('0x78')](_0x3cc317[_0x0c96('0x79')]);});for(var _0xbd8eed=0x0;_0xbd8eed<_0x1b5878[_0x0c96('0x35')];_0xbd8eed++){if(_0x1b5878[_0xbd8eed][_0x0c96('0x7a')]===![]){_0x3c1dbd[_0x0c96('0x7b')]({'id':_0x1b5878[_0xbd8eed]['id'],'name':_0x1b5878[_0xbd8eed][_0x0c96('0x7c')],'custom':_0x1b5878[_0xbd8eed][_0x0c96('0x7d')],'options':_0x1b5878[_0xbd8eed][_0x0c96('0x7e')]===_0x0c96('0x7f')&&_0x1b5878[_0xbd8eed][_0x0c96('0x80')]['length']>-0x1?_[_0x0c96('0x30')](_0x1b5878[_0xbd8eed][_0x0c96('0x80')],function(_0x48eda4){return{'name':_0x48eda4,'value':_0x48eda4};}):[]});}}return{'count':_0x3c1dbd[_0x0c96('0x35')],'rows':_0x3c1dbd};}else{return{'count':0x0,'rows':[]};}})[_0x0c96('0x23')](respondWithResult(_0x4fbdd4,null))['catch'](function(_0xf3827c){var _0x461a27=_0x392e66['query'][_0x0c96('0x81')]?0x1f4:_0xf3827c[_0x0c96('0x82')]||0x1f4;logger[_0x0c96('0x25')](_0x0c96('0x83'),_0x0c96('0x63'),_0x461a27,JSON['stringify'](_0xf3827c));delete _0xf3827c[_0x0c96('0x27')];if(_0x461a27===0x191){_0x461a27=0x190;}_0x4fbdd4[_0x0c96('0x18')](_0x461a27)[_0x0c96('0x28')](_0x392e66['query'][_0x0c96('0x81')]?{'message':_0x0c96('0x84'),'statusCode':_0xf3827c[_0x0c96('0x82')]}:_0xf3827c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 128f765..4b8efa4 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 _0xdb3f=['clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','catch','util','../../config/logger','api','moment','path','../../components/integrations/configuration','exports','changed','zone','clientId'];(function(_0x346045,_0x3ce566){var _0x3d1573=function(_0x1fb641){while(--_0x1fb641){_0x346045['push'](_0x346045['shift']());}};_0x3d1573(++_0x3ce566);}(_0xdb3f,0x13a));var _0xfdb3=function(_0x2a3e30,_0x3baa8c){_0x2a3e30=_0x2a3e30-0x0;var _0x437b28=_0xdb3f[_0x2a3e30];return _0x437b28;};'use strict';var _=require('lodash');var util=require(_0xfdb3('0x0'));var logger=require(_0xfdb3('0x1'))(_0xfdb3('0x2'));var moment=require(_0xfdb3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdb3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xfdb3('0x5'));module[_0xfdb3('0x6')]=function(_0xa3cfc3,_0x3cd8eb){return _0xa3cfc3['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26e8b3,_0x27239f,_0x56093b){if(_0x26e8b3[_0xfdb3('0x7')](_0xfdb3('0x8'))||_0x26e8b3[_0xfdb3('0x7')]('serverUrl')||_0x26e8b3[_0xfdb3('0x7')](_0xfdb3('0x9'))||_0x26e8b3[_0xfdb3('0x7')](_0xfdb3('0xa'))||_0x26e8b3[_0xfdb3('0x7')](_0xfdb3('0xb'))||_0x26e8b3['changed'](_0xfdb3('0xc'))){var _0x488b9d,_0xeb9934;_0x488b9d=_0x26e8b3['serverUrl'];var _0x451b73=_0x488b9d[_0xfdb3('0xd')](-0x1);if(_0x451b73==='/'||_0x451b73==='\x5c'||_0x451b73===':'){_0x488b9d=_0x488b9d[_0xfdb3('0xe')](0x0,_0x488b9d[_0xfdb3('0xf')](_0x451b73));}switch(_0x26e8b3['zone']){case'US':_0xeb9934=_0xfdb3('0x10');break;case'AU':_0xeb9934='https://accounts.zoho.com.au';break;case'IN':_0xeb9934='https://accounts.zoho.in';break;case'CN':_0xeb9934='https://accounts.zoho.com.cn';break;default:_0xeb9934='https://accounts.zoho.eu';break;}var _0x1fc8af={'method':'POST','uri':_0xeb9934+_0xfdb3('0x11'),'form':{'grant_type':_0xfdb3('0x12'),'client_id':_0x26e8b3['clientId'],'client_secret':_0x26e8b3['clientSecret'],'redirect_uri':_0x26e8b3[_0xfdb3('0x13')],'code':_0x26e8b3['code']},'headers':{'Content-Type':_0xfdb3('0x14')}};return rp(_0x1fc8af)['then'](function(_0x409257){var _0x9edbc1=JSON[_0xfdb3('0x15')](_0x409257);if(_0x9edbc1['refresh_token']){_0x26e8b3[_0xfdb3('0x16')]=_0x9edbc1[_0xfdb3('0x17')];logger[_0xfdb3('0x18')](util[_0xfdb3('0x19')](_0xfdb3('0x1a'),_0x26e8b3[_0xfdb3('0x1b')],_0x26e8b3['id']));}else{logger[_0xfdb3('0x1c')](util[_0xfdb3('0x19')](_0xfdb3('0x1d'),_0x26e8b3['name'],_0x26e8b3['id']),util['inspect'](_0x9edbc1,{'showHidden':![],'depth':null}));}return _0x56093b(null,_0x27239f);})['catch'](function(_0x36c2ef){logger[_0xfdb3('0x1c')](util[_0xfdb3('0x19')](_0xfdb3('0x1d'),_0x26e8b3[_0xfdb3('0x1b')],_0x26e8b3['id']),util[_0xfdb3('0x1e')](parsedResult,{'showHidden':![],'depth':null}));return _0x56093b(_0x36c2ef);});}else{return _0x56093b(null,_0x27239f);}},'beforeUpdate':function(_0x18f07e,_0x3808f7,_0x1fa8bd){if(_0x18f07e[_0xfdb3('0x7')](_0xfdb3('0x8'))||_0x18f07e[_0xfdb3('0x7')](_0xfdb3('0x13'))||_0x18f07e[_0xfdb3('0x7')](_0xfdb3('0x9'))||_0x18f07e[_0xfdb3('0x7')](_0xfdb3('0xa'))||_0x18f07e[_0xfdb3('0x7')]('code')||_0x18f07e[_0xfdb3('0x7')]('host')){var _0x5a817f,_0x2fc18d;_0x5a817f=_0x18f07e[_0xfdb3('0x13')];var _0x5402c3=_0x5a817f[_0xfdb3('0xd')](-0x1);if(_0x5402c3==='/'||_0x5402c3==='\x5c'||_0x5402c3===':'){_0x5a817f=_0x5a817f[_0xfdb3('0xe')](0x0,_0x5a817f[_0xfdb3('0xf')](_0x5402c3));}switch(_0x18f07e[_0xfdb3('0x8')]){case'US':_0x2fc18d=_0xfdb3('0x10');break;case'AU':_0x2fc18d=_0xfdb3('0x1f');break;case'IN':_0x2fc18d=_0xfdb3('0x20');break;case'CN':_0x2fc18d='https://accounts.zoho.com.cn';break;default:_0x2fc18d=_0xfdb3('0x21');break;}var _0x793f96={'method':_0xfdb3('0x22'),'uri':_0x2fc18d+_0xfdb3('0x11'),'form':{'grant_type':_0xfdb3('0x12'),'client_id':_0x18f07e[_0xfdb3('0x9')],'client_secret':_0x18f07e['clientSecret'],'redirect_uri':_0x18f07e['serverUrl'],'code':_0x18f07e[_0xfdb3('0xb')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x793f96)['then'](function(_0x2f7446){var _0x5db7f7=JSON[_0xfdb3('0x15')](_0x2f7446);if(_0x5db7f7[_0xfdb3('0x17')]){_0x18f07e[_0xfdb3('0x16')]=_0x5db7f7[_0xfdb3('0x17')];logger['info'](util[_0xfdb3('0x19')](_0xfdb3('0x1a'),_0x18f07e[_0xfdb3('0x1b')],_0x18f07e['id']));}else{logger[_0xfdb3('0x1c')](util[_0xfdb3('0x19')](_0xfdb3('0x1d'),_0x18f07e['name'],_0x18f07e['id']),util[_0xfdb3('0x1e')](_0x5db7f7,{'showHidden':![],'depth':null}));}return _0x1fa8bd(null,_0x3808f7);})[_0xfdb3('0x23')](function(_0x1570d2){logger[_0xfdb3('0x1c')](util[_0xfdb3('0x19')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x18f07e[_0xfdb3('0x1b')],_0x18f07e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1fa8bd(_0x1570d2);});}else{return _0x1fa8bd(null,_0x3808f7);}}}});}; \ No newline at end of file +var _0x2e57=['clientId','clientSecret','application/x-www-form-urlencoded','parse','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','zone','https://accounts.zoho.in','then','refresh_token','refreshToken','error','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','code','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','authorization_code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e57,0x8d));var _0x72e5=function(_0x170e44,_0x3193fb){_0x170e44=_0x170e44-0x0;var _0x5c1eef=_0x2e57[_0x170e44];return _0x5c1eef;};'use strict';var _=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var logger=require(_0x72e5('0x2'))(_0x72e5('0x3'));var moment=require('moment');var BPromise=require(_0x72e5('0x4'));var rp=require(_0x72e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72e5('0x6'));var attributes=require(_0x72e5('0x7'));var integrations=require(_0x72e5('0x8'));module[_0x72e5('0x9')]=function(_0x3c0d72,_0x1f49d4){return _0x3c0d72[_0x72e5('0xa')](_0x72e5('0xb'),attributes,{'tableName':_0x72e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17e5cd,_0x551bc0,_0x5ab695){if(_0x17e5cd[_0x72e5('0xd')]('zone')||_0x17e5cd[_0x72e5('0xd')](_0x72e5('0xe'))||_0x17e5cd['changed']('clientId')||_0x17e5cd['changed']('clientSecret')||_0x17e5cd[_0x72e5('0xd')](_0x72e5('0xf'))||_0x17e5cd[_0x72e5('0xd')]('host')){var _0x2335ec,_0x1c3c56;_0x2335ec=_0x17e5cd[_0x72e5('0xe')];var _0x34c538=_0x2335ec[_0x72e5('0x10')](-0x1);if(_0x34c538==='/'||_0x34c538==='\x5c'||_0x34c538===':'){_0x2335ec=_0x2335ec[_0x72e5('0x11')](0x0,_0x2335ec[_0x72e5('0x12')](_0x34c538));}switch(_0x17e5cd['zone']){case'US':_0x1c3c56='https://accounts.zoho.com';break;case'AU':_0x1c3c56=_0x72e5('0x13');break;case'IN':_0x1c3c56='https://accounts.zoho.in';break;case'CN':_0x1c3c56=_0x72e5('0x14');break;default:_0x1c3c56='https://accounts.zoho.eu';break;}var _0x585944={'method':_0x72e5('0x15'),'uri':_0x1c3c56+'/oauth/v2/token','form':{'grant_type':_0x72e5('0x16'),'client_id':_0x17e5cd[_0x72e5('0x17')],'client_secret':_0x17e5cd[_0x72e5('0x18')],'redirect_uri':_0x17e5cd[_0x72e5('0xe')],'code':_0x17e5cd[_0x72e5('0xf')]},'headers':{'Content-Type':_0x72e5('0x19')}};return rp(_0x585944)['then'](function(_0x2d909b){var _0x5ceea2=JSON[_0x72e5('0x1a')](_0x2d909b);if(_0x5ceea2['refresh_token']){_0x17e5cd['refreshToken']=_0x5ceea2['refresh_token'];logger[_0x72e5('0x1b')](util['format'](_0x72e5('0x1c'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']));}else{logger['error'](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']),util[_0x72e5('0x20')](_0x5ceea2,{'showHidden':![],'depth':null}));}return _0x5ab695(null,_0x551bc0);})[_0x72e5('0x21')](function(_0x1112c3){logger['error'](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5ab695(_0x1112c3);});}else{return _0x5ab695(null,_0x551bc0);}},'beforeUpdate':function(_0x5af223,_0x2cdb78,_0x246bd6){if(_0x5af223[_0x72e5('0xd')]('zone')||_0x5af223[_0x72e5('0xd')](_0x72e5('0xe'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x17'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x18'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0xf'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x22'))){var _0x5f2aa2,_0xdc67c9;_0x5f2aa2=_0x5af223['serverUrl'];var _0x5e0174=_0x5f2aa2['slice'](-0x1);if(_0x5e0174==='/'||_0x5e0174==='\x5c'||_0x5e0174===':'){_0x5f2aa2=_0x5f2aa2[_0x72e5('0x11')](0x0,_0x5f2aa2[_0x72e5('0x12')](_0x5e0174));}switch(_0x5af223[_0x72e5('0x23')]){case'US':_0xdc67c9='https://accounts.zoho.com';break;case'AU':_0xdc67c9=_0x72e5('0x13');break;case'IN':_0xdc67c9=_0x72e5('0x24');break;case'CN':_0xdc67c9=_0x72e5('0x14');break;default:_0xdc67c9='https://accounts.zoho.eu';break;}var _0x4fc93e={'method':'POST','uri':_0xdc67c9+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x5af223[_0x72e5('0x17')],'client_secret':_0x5af223[_0x72e5('0x18')],'redirect_uri':_0x5af223[_0x72e5('0xe')],'code':_0x5af223['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4fc93e)[_0x72e5('0x25')](function(_0x34b377){var _0x40b0af=JSON[_0x72e5('0x1a')](_0x34b377);if(_0x40b0af[_0x72e5('0x26')]){_0x5af223[_0x72e5('0x27')]=_0x40b0af['refresh_token'];logger['info'](util[_0x72e5('0x1e')](_0x72e5('0x1c'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']));}else{logger[_0x72e5('0x28')](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']),util[_0x72e5('0x20')](_0x40b0af,{'showHidden':![],'depth':null}));}return _0x246bd6(null,_0x2cdb78);})[_0x72e5('0x21')](function(_0x5a01d9){logger[_0x72e5('0x28')](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']),util[_0x72e5('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x246bd6(_0x5a01d9);});}else{return _0x246bd6(null,_0x2cdb78);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 9f593c0..bbc3800 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 _0xa329=['then','ShowZohoAccount','ZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','findAll','options','raw','where','limit','include','model','map','attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa329,0x162));var _0x9a32=function(_0x468985,_0x44c060){_0x468985=_0x468985-0x0;var _0x1855d4=_0xa329[_0x468985];return _0x1855d4;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235b92,_0x4a8fba,_0x5b8b5e){return new BPromise(function(_0x4dc7f8,_0x344b35){return client[_0x9a32('0xa')](_0x235b92,_0x5b8b5e)['then'](function(_0x38f6cc){logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));logger[_0x9a32('0xe')](_0x9a32('0xf'),_0x4a8fba,'request\x20sent',JSON[_0x9a32('0x10')](_0x38f6cc));if(_0x38f6cc[_0x9a32('0x11')]){if(_0x38f6cc['error']['code']===0x1f4){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error']['message']);return _0x344b35(_0x38f6cc[_0x9a32('0x11')][_0x9a32('0x12')]);}logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error'][_0x9a32('0x12')]);return _0x4dc7f8(_0x38f6cc[_0x9a32('0x11')]['message']);}else{logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));_0x4dc7f8(_0x38f6cc[_0x9a32('0x13')][_0x9a32('0x12')]);}})[_0x9a32('0x14')](function(_0x4fa645){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x4fa645);_0x344b35(_0x4fa645);});});}exports[_0x9a32('0x15')]=function(_0x4cfd70){var _0x3606ab=this;return new Promise(function(_0x1448da,_0x49f517){return db['ZohoAccount'][_0x9a32('0x16')]({'raw':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70['options'][_0x9a32('0x19')]||null:null,'attributes':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')]['attributes']||null:null,'limit':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1a')]||null:null,'include':_0x4cfd70[_0x9a32('0x17')]?_0x4cfd70[_0x9a32('0x17')][_0x9a32('0x1b')]?_['map'](_0x4cfd70['options'][_0x9a32('0x1b')],function(_0x2cb1ff){return{'model':db[_0x2cb1ff[_0x9a32('0x1c')]],'as':_0x2cb1ff['as'],'attributes':_0x2cb1ff['attributes'],'include':_0x2cb1ff['include']?_[_0x9a32('0x1d')](_0x2cb1ff[_0x9a32('0x1b')],function(_0x301dac){return{'model':db[_0x301dac['model']],'as':_0x301dac['as'],'attributes':_0x301dac['attributes'],'include':_0x301dac['include']?_[_0x9a32('0x1d')](_0x301dac['include'],function(_0x527159){return{'model':db[_0x527159['model']],'as':_0x527159['as'],'attributes':_0x527159[_0x9a32('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x10edcf){logger[_0x9a32('0xb')](_0x9a32('0x15'),_0x4cfd70);logger[_0x9a32('0xe')](_0x9a32('0x15'),_0x4cfd70,JSON[_0x9a32('0x10')](_0x10edcf));_0x1448da(_0x10edcf);})[_0x9a32('0x14')](function(_0x35c1be){logger[_0x9a32('0x11')]('GetZohoAccount',_0x35c1be[_0x9a32('0x12')],_0x4cfd70);_0x49f517(_0x3606ab[_0x9a32('0x11')](0x1f4,_0x35c1be['message']));});});};exports[_0x9a32('0x20')]=function(_0x48674a){var _0x18a7b3=this;return new Promise(function(_0x227dbc,_0x416ba3){return db[_0x9a32('0x21')][_0x9a32('0x22')]({'raw':_0x48674a['options']?_0x48674a[_0x9a32('0x17')][_0x9a32('0x18')]===undefined?!![]:![]:!![],'where':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x19')]||null:null,'attributes':_0x48674a[_0x9a32('0x17')]?_0x48674a['options'][_0x9a32('0x1e')]||null:null,'include':_0x48674a[_0x9a32('0x17')]?_0x48674a[_0x9a32('0x17')][_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x48674a['options'][_0x9a32('0x1b')],function(_0x4d113c){return{'model':db[_0x4d113c[_0x9a32('0x1c')]],'as':_0x4d113c['as'],'attributes':_0x4d113c['attributes'],'include':_0x4d113c['include']?_['map'](_0x4d113c['include'],function(_0x37f0f6){return{'model':db[_0x37f0f6[_0x9a32('0x1c')]],'as':_0x37f0f6['as'],'attributes':_0x37f0f6['attributes'],'include':_0x37f0f6[_0x9a32('0x1b')]?_[_0x9a32('0x1d')](_0x37f0f6[_0x9a32('0x1b')],function(_0x20cad1){return{'model':db[_0x20cad1[_0x9a32('0x1c')]],'as':_0x20cad1['as'],'attributes':_0x20cad1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a32('0x1f')](function(_0x319985){logger[_0x9a32('0xb')](_0x9a32('0x20'),_0x48674a);logger[_0x9a32('0xe')](_0x9a32('0x20'),_0x48674a,JSON[_0x9a32('0x10')](_0x319985));_0x227dbc(_0x319985);})[_0x9a32('0x14')](function(_0x15d70f){logger['error'](_0x9a32('0x20'),_0x15d70f['message'],_0x48674a);_0x416ba3(_0x18a7b3[_0x9a32('0x11')](0x1f4,_0x15d70f[_0x9a32('0x12')]));});});}; \ No newline at end of file +var _0x672a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowZohoAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x672a,0x122));var _0xa672=function(_0x3fdd34,_0x1d612a){_0x3fdd34=_0x3fdd34-0x0;var _0x14bb56=_0x672a[_0x3fdd34];return _0x14bb56;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var moment=require(_0xa672('0x2'));var BPromise=require(_0xa672('0x3'));var rs=require(_0xa672('0x4'));var fs=require('fs');var Redis=require(_0xa672('0x5'));var db=require(_0xa672('0x6'))['db'];var utils=require(_0xa672('0x7'));var logger=require(_0xa672('0x8'))(_0xa672('0x9'));var config=require(_0xa672('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa672('0xb')][_0xa672('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a4797,_0x33dd0c,_0x13402c){return new BPromise(function(_0x3f18d8,_0x338516){return client[_0xa672('0xd')](_0x3a4797,_0x13402c)[_0xa672('0xe')](function(_0x370f20){logger[_0xa672('0xf')](_0xa672('0x10'),_0x33dd0c,_0xa672('0x11'));logger[_0xa672('0x12')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x33dd0c,_0xa672('0x11'),JSON[_0xa672('0x13')](_0x370f20));if(_0x370f20['error']){if(_0x370f20[_0xa672('0x14')][_0xa672('0x15')]===0x1f4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x338516(_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);}logger[_0xa672('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x3f18d8(_0x370f20['error']['message']);}else{logger[_0xa672('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,'request\x20sent');_0x3f18d8(_0x370f20['result'][_0xa672('0x16')]);}})['catch'](function(_0x5a98a4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x5a98a4);_0x338516(_0x5a98a4);});});}exports[_0xa672('0x17')]=function(_0xc5eeb3){var _0x929a34=this;return new Promise(function(_0x10dc1c,_0x213861){return db[_0xa672('0x18')][_0xa672('0x19')]({'raw':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3['options'][_0xa672('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1c')]||null:null,'attributes':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['attributes']||null:null,'limit':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1d')]||null:null,'include':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['include']?_[_0xa672('0x1e')](_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1f')],function(_0x47000f){return{'model':db[_0x47000f['model']],'as':_0x47000f['as'],'attributes':_0x47000f['attributes'],'include':_0x47000f[_0xa672('0x1f')]?_['map'](_0x47000f[_0xa672('0x1f')],function(_0x31f755){return{'model':db[_0x31f755[_0xa672('0x20')]],'as':_0x31f755['as'],'attributes':_0x31f755[_0xa672('0x21')],'include':_0x31f755[_0xa672('0x1f')]?_[_0xa672('0x1e')](_0x31f755['include'],function(_0x5388f1){return{'model':db[_0x5388f1[_0xa672('0x20')]],'as':_0x5388f1['as'],'attributes':_0x5388f1[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x5d3d6a){logger[_0xa672('0xf')](_0xa672('0x17'),_0xc5eeb3);logger['debug'](_0xa672('0x17'),_0xc5eeb3,JSON[_0xa672('0x13')](_0x5d3d6a));_0x10dc1c(_0x5d3d6a);})['catch'](function(_0x210c42){logger[_0xa672('0x14')](_0xa672('0x17'),_0x210c42[_0xa672('0x16')],_0xc5eeb3);_0x213861(_0x929a34[_0xa672('0x14')](0x1f4,_0x210c42[_0xa672('0x16')]));});});};exports[_0xa672('0x22')]=function(_0x1250eb){var _0x48ccf3=this;return new Promise(function(_0x89250e,_0x1bae9f){return db[_0xa672('0x18')][_0xa672('0x23')]({'raw':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options'][_0xa672('0x1c')]||null:null,'attributes':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')][_0xa672('0x21')]||null:null,'include':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options']['include']?_['map'](_0x1250eb[_0xa672('0x1a')]['include'],function(_0x1720a9){return{'model':db[_0x1720a9[_0xa672('0x20')]],'as':_0x1720a9['as'],'attributes':_0x1720a9[_0xa672('0x21')],'include':_0x1720a9[_0xa672('0x1f')]?_['map'](_0x1720a9[_0xa672('0x1f')],function(_0x10f785){return{'model':db[_0x10f785[_0xa672('0x20')]],'as':_0x10f785['as'],'attributes':_0x10f785[_0xa672('0x21')],'include':_0x10f785['include']?_['map'](_0x10f785[_0xa672('0x1f')],function(_0x23165c){return{'model':db[_0x23165c[_0xa672('0x20')]],'as':_0x23165c['as'],'attributes':_0x23165c[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x38681b){logger['info'](_0xa672('0x22'),_0x1250eb);logger['debug'](_0xa672('0x22'),_0x1250eb,JSON[_0xa672('0x13')](_0x38681b));_0x89250e(_0x38681b);})[_0xa672('0x24')](function(_0x196cbd){logger[_0xa672('0x14')](_0xa672('0x22'),_0x196cbd['message'],_0x1250eb);_0x1bae9f(_0x48ccf3['error'](0x1f4,_0x196cbd[_0xa672('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9a220b8..154be29 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 _0xb40b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x4caf0d,_0x580ea2){var _0x473297=function(_0xf159ac){while(--_0xf159ac){_0x4caf0d['push'](_0x4caf0d['shift']());}};_0x473297(++_0x580ea2);}(_0xb40b,0x1c9));var _0xbb40=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xb40b[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xbb40('0x0'));var util=require(_0xbb40('0x1'));var path=require(_0xbb40('0x2'));var timeout=require(_0xbb40('0x3'));var express=require(_0xbb40('0x4'));var router=express[_0xbb40('0x5')]();var fs_extra=require(_0xbb40('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbb40('0x7'));var config=require('../../config/environment');var controller=require(_0xbb40('0x8'));router['get']('/',auth[_0xbb40('0x9')](),controller['index']);router[_0xbb40('0xa')](_0xbb40('0xb'),auth[_0xbb40('0x9')](),controller['show']);router[_0xbb40('0xa')](_0xbb40('0xc'),auth[_0xbb40('0x9')](),controller['getFields']);router[_0xbb40('0xa')](_0xbb40('0xd'),auth[_0xbb40('0x9')](),controller[_0xbb40('0xe')]);router[_0xbb40('0xa')](_0xbb40('0xf'),auth['isAuthenticated'](),controller[_0xbb40('0x10')]);router[_0xbb40('0x11')]('/',auth['isAuthenticated'](),controller[_0xbb40('0x12')]);router[_0xbb40('0x13')](_0xbb40('0xb'),auth['isAuthenticated'](),controller[_0xbb40('0x14')]);router[_0xbb40('0x15')](_0xbb40('0xb'),auth['isAuthenticated'](),controller[_0xbb40('0x16')]);module[_0xbb40('0x17')]=router; \ No newline at end of file +var _0x0b85=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller'];(function(_0xd066c8,_0x46b223){var _0x369df2=function(_0x314fb9){while(--_0x314fb9){_0xd066c8['push'](_0xd066c8['shift']());}};_0x369df2(++_0x46b223);}(_0x0b85,0x168));var _0x50b8=function(_0x29a07c,_0x2987cd){_0x29a07c=_0x29a07c-0x0;var _0x252184=_0x0b85[_0x29a07c];return _0x252184;};'use strict';var multer=require('multer');var util=require(_0x50b8('0x0'));var path=require(_0x50b8('0x1'));var timeout=require(_0x50b8('0x2'));var express=require(_0x50b8('0x3'));var router=express[_0x50b8('0x4')]();var fs_extra=require(_0x50b8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50b8('0x6'));var controller=require(_0x50b8('0x7'));router[_0x50b8('0x8')]('/',auth[_0x50b8('0x9')](),controller[_0x50b8('0xa')]);router[_0x50b8('0x8')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0xc')]);router['get'](_0x50b8('0xd'),auth[_0x50b8('0x9')](),controller['getFields']);router[_0x50b8('0x8')](_0x50b8('0xe'),auth[_0x50b8('0x9')](),controller[_0x50b8('0xf')]);router[_0x50b8('0x8')](_0x50b8('0x10'),auth[_0x50b8('0x9')](),controller['getDescriptions']);router[_0x50b8('0x11')]('/',auth[_0x50b8('0x9')](),controller[_0x50b8('0x12')]);router[_0x50b8('0x13')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0x14')]);router[_0x50b8('0x15')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0x16')]);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 503e1ad..9772a12 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 _0x15b6=['lead','contact','nothing','ENUM','contact_lead','sequelize','STRING'];(function(_0x1036dd,_0x2b1028){var _0xd0099a=function(_0x7ebef2){while(--_0x7ebef2){_0x1036dd['push'](_0x1036dd['shift']());}};_0xd0099a(++_0x2b1028);}(_0x15b6,0x1a9));var _0x615b=function(_0x5155c8,_0x44801a){_0x5155c8=_0x5155c8-0x0;var _0x279901=_0x15b6[_0x5155c8];return _0x279901;};'use strict';var Sequelize=require(_0x615b('0x0'));module['exports']={'name':{'type':Sequelize[_0x615b('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x615b('0x2'),_0x615b('0x3'),_0x615b('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x615b('0x5')](_0x615b('0x6'),_0x615b('0x3'),_0x615b('0x2')),'defaultValue':_0x615b('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5173=['contact','sequelize','exports','STRING','lead','nothing','ENUM','contact_lead'];(function(_0xd1308,_0x3bf065){var _0x218667=function(_0x28b087){while(--_0x28b087){_0xd1308['push'](_0xd1308['shift']());}};_0x218667(++_0x3bf065);}(_0x5173,0x109));var _0x3517=function(_0x346210,_0x272323){_0x346210=_0x346210-0x0;var _0x35536c=_0x5173[_0x346210];return _0x35536c;};'use strict';var Sequelize=require(_0x3517('0x0'));module[_0x3517('0x1')]={'name':{'type':Sequelize[_0x3517('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x3517('0x3'),'contact',_0x3517('0x4')),'defaultValue':_0x3517('0x3')},'moduleSearch':{'type':Sequelize[_0x3517('0x5')](_0x3517('0x6'),_0x3517('0x7'),_0x3517('0x3')),'defaultValue':_0x3517('0x6')},'description':{'type':Sequelize[_0x3517('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c663e78..dbbf5a4 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 _0xfadc=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','ZohoConfiguration','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','show','create','body','params','find','catch','getFields','ZohoField','order','hasOwnProperty','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv'];(function(_0x3d49d0,_0x19cfa7){var _0x415d91=function(_0x2e545e){while(--_0x2e545e){_0x3d49d0['push'](_0x3d49d0['shift']());}};_0x415d91(++_0x19cfa7);}(_0xfadc,0xdb));var _0xcfad=function(_0x3b72c7,_0x438c1b){_0x3b72c7=_0x3b72c7-0x0;var _0x4080e7=_0xfadc[_0x3b72c7];return _0x4080e7;};'use strict';var emlformat=require(_0xcfad('0x0'));var rimraf=require(_0xcfad('0x1'));var zipdir=require(_0xcfad('0x2'));var jsonpatch=require(_0xcfad('0x3'));var rp=require(_0xcfad('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcfad('0x5'));var util=require(_0xcfad('0x6'));var path=require(_0xcfad('0x7'));var sox=require(_0xcfad('0x8'));var csv=require('to-csv');var ejs=require(_0xcfad('0x9'));var fs=require('fs');var fs_extra=require(_0xcfad('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcfad('0xb'));var jsforce=require(_0xcfad('0xc'));var deskjs=require(_0xcfad('0xd'));var toCsv=require(_0xcfad('0xe'));var querystring=require('querystring');var Papa=require(_0xcfad('0xf'));var Redis=require(_0xcfad('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcfad('0x11'));var as=require(_0xcfad('0x12'));var hardwareService=require(_0xcfad('0x13'));var logger=require('../../config/logger')(_0xcfad('0x14'));var utils=require('../../config/utils');var config=require(_0xcfad('0x15'));var licenseUtil=require(_0xcfad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358d98,_0x20d4d8){_0x20d4d8=_0x20d4d8||0xcc;return function(_0x4e0266){if(_0x4e0266){return _0x358d98[_0xcfad('0x17')](_0x20d4d8);}return _0x358d98[_0xcfad('0x18')](_0x20d4d8)['end']();};}function respondWithResult(_0x123ad0,_0x5b63eb){_0x5b63eb=_0x5b63eb||0xc8;return function(_0x4bc8e4){if(_0x4bc8e4){return _0x123ad0['status'](_0x5b63eb)[_0xcfad('0x19')](_0x4bc8e4);}};}function respondWithFilteredResult(_0x4652b7,_0x3803ca){return function(_0x36a019){if(_0x36a019){var _0x4ef281=typeof _0x3803ca[_0xcfad('0x1a')]===_0xcfad('0x1b')&&typeof _0x3803ca[_0xcfad('0x1c')]===_0xcfad('0x1b');var _0x4a3761=_0x36a019['count'];var _0x918499=_0x4ef281?0x0:_0x3803ca[_0xcfad('0x1a')];var _0x16584d=_0x4ef281?_0x36a019[_0xcfad('0x1d')]:_0x3803ca[_0xcfad('0x1a')]+_0x3803ca[_0xcfad('0x1c')];var _0xc2014;if(_0x16584d>=_0x4a3761){_0x16584d=_0x4a3761;_0xc2014=0xc8;}else{_0xc2014=0xce;}_0x4652b7[_0xcfad('0x18')](_0xc2014);return _0x4652b7['set'](_0xcfad('0x1e'),_0x918499+'-'+_0x16584d+'/'+_0x4a3761)[_0xcfad('0x19')](_0x36a019);}return null;};}function patchUpdates(_0x3d7341){return function(_0x46acb3){try{jsonpatch[_0xcfad('0x1f')](_0x46acb3,_0x3d7341,!![]);}catch(_0x49e95c){return BPromise[_0xcfad('0x20')](_0x49e95c);}return _0x46acb3[_0xcfad('0x21')]();};}function saveUpdates(_0x52c282,_0x5d0968){return function(_0x2bef70){if(_0x2bef70){return _0x2bef70[_0xcfad('0x22')](_0x52c282)['then'](function(_0x4a9c27){return _0x4a9c27;});}return null;};}function removeEntity(_0x13683b,_0x1823c6){return function(_0x196507){if(_0x196507){return _0x196507[_0xcfad('0x23')]()['then'](function(){_0x13683b['status'](0xcc)[_0xcfad('0x24')]();});}};}function handleEntityNotFound(_0x2e6c57,_0x538f0d){return function(_0x426a89){if(!_0x426a89){_0x2e6c57[_0xcfad('0x17')](0x194);}return _0x426a89;};}function handleError(_0x212421,_0xb81e36){_0xb81e36=_0xb81e36||0x1f4;return function(_0x3dc28e){logger['error'](_0x3dc28e[_0xcfad('0x25')]);if(_0x3dc28e[_0xcfad('0x26')]){delete _0x3dc28e[_0xcfad('0x26')];}_0x212421[_0xcfad('0x18')](_0xb81e36)[_0xcfad('0x27')](_0x3dc28e);};}exports['index']=function(_0x3fc29d,_0x1b1862){var _0x560062={},_0x5a8210={},_0x597033={'count':0x0,'rows':[]};var _0x106768=_[_0xcfad('0x28')](db[_0xcfad('0x29')][_0xcfad('0x2a')],function(_0x3e96f2){return{'name':_0x3e96f2['fieldName'],'type':_0x3e96f2[_0xcfad('0x2b')]['key']};});_0x5a8210[_0xcfad('0x2c')]=_[_0xcfad('0x28')](_0x106768,_0xcfad('0x26'));_0x5a8210['query']=_[_0xcfad('0x2d')](_0x3fc29d[_0xcfad('0x2e')]);_0x5a8210['filters']=_[_0xcfad('0x2f')](_0x5a8210[_0xcfad('0x2c')],_0x5a8210[_0xcfad('0x2e')]);_0x560062[_0xcfad('0x30')]=_[_0xcfad('0x2f')](_0x5a8210[_0xcfad('0x2c')],qs[_0xcfad('0x31')](_0x3fc29d[_0xcfad('0x2e')]['fields']));_0x560062[_0xcfad('0x30')]=_0x560062['attributes'][_0xcfad('0x32')]?_0x560062[_0xcfad('0x30')]:_0x5a8210[_0xcfad('0x2c')];if(!_0x3fc29d[_0xcfad('0x2e')]['hasOwnProperty'](_0xcfad('0x33'))){_0x560062[_0xcfad('0x1c')]=qs['limit'](_0x3fc29d[_0xcfad('0x2e')][_0xcfad('0x1c')]);_0x560062['offset']=qs['offset'](_0x3fc29d[_0xcfad('0x2e')][_0xcfad('0x1a')]);}_0x560062['order']=qs['sort'](_0x3fc29d[_0xcfad('0x2e')][_0xcfad('0x34')]);_0x560062['where']=qs[_0xcfad('0x35')](_[_0xcfad('0x36')](_0x3fc29d[_0xcfad('0x2e')],_0x5a8210[_0xcfad('0x35')]),_0x106768);if(_0x3fc29d[_0xcfad('0x2e')]['filter']){_0x560062[_0xcfad('0x37')]=_[_0xcfad('0x38')](_0x560062[_0xcfad('0x37')],{'$or':_[_0xcfad('0x28')](_0x106768,function(_0x2e1cb1){if(_0x2e1cb1['type']!==_0xcfad('0x39')){var _0x1d160f={};_0x1d160f[_0x2e1cb1[_0xcfad('0x26')]]={'$like':'%'+_0x3fc29d['query'][_0xcfad('0x3a')]+'%'};return _0x1d160f;}})});}_0x560062=_['merge']({},_0x560062,_0x3fc29d[_0xcfad('0x3b')]);var _0x4b8269={'where':_0x560062[_0xcfad('0x37')]};return db[_0xcfad('0x29')][_0xcfad('0x1d')](_0x4b8269)[_0xcfad('0x3c')](function(_0x2fffa3){_0x597033[_0xcfad('0x1d')]=_0x2fffa3;if(_0x3fc29d[_0xcfad('0x2e')][_0xcfad('0x3d')]){_0x560062[_0xcfad('0x3e')]=[{'all':!![]}];}return db[_0xcfad('0x29')][_0xcfad('0x3f')](_0x560062);})['then'](function(_0xb2916d){_0x597033[_0xcfad('0x40')]=_0xb2916d;return _0x597033;})[_0xcfad('0x3c')](respondWithFilteredResult(_0x1b1862,_0x560062))['catch'](handleError(_0x1b1862,null));};exports[_0xcfad('0x41')]=function(_0x284a88,_0x340522){var _0x521bca={'raw':![],'where':{'id':_0x284a88['params']['id']}},_0x200ccf={};_0x200ccf[_0xcfad('0x2c')]=_[_0xcfad('0x2d')](db[_0xcfad('0x29')]['rawAttributes']);_0x200ccf[_0xcfad('0x2e')]=_['keys'](_0x284a88[_0xcfad('0x2e')]);_0x200ccf[_0xcfad('0x35')]=_[_0xcfad('0x2f')](_0x200ccf[_0xcfad('0x2c')],_0x200ccf['query']);_0x521bca[_0xcfad('0x30')]=_['intersection'](_0x200ccf[_0xcfad('0x2c')],qs[_0xcfad('0x31')](_0x284a88['query']['fields']));_0x521bca[_0xcfad('0x30')]=_0x521bca[_0xcfad('0x30')][_0xcfad('0x32')]?_0x521bca['attributes']:_0x200ccf[_0xcfad('0x2c')];if(_0x284a88[_0xcfad('0x2e')][_0xcfad('0x3d')]){_0x521bca[_0xcfad('0x3e')]=[{'all':!![]}];}_0x521bca=_[_0xcfad('0x38')]({},_0x521bca,_0x284a88['options']);return db[_0xcfad('0x29')]['find'](_0x521bca)[_0xcfad('0x3c')](handleEntityNotFound(_0x340522,null))[_0xcfad('0x3c')](respondWithResult(_0x340522,null))['catch'](handleError(_0x340522,null));};exports[_0xcfad('0x42')]=function(_0x3b6678,_0x9a2172){return db[_0xcfad('0x29')][_0xcfad('0x42')](_0x3b6678[_0xcfad('0x43')],{})[_0xcfad('0x3c')](respondWithResult(_0x9a2172,0xc9))['catch'](handleError(_0x9a2172,null));};exports['update']=function(_0x89714f,_0x5edbd7){if(_0x89714f['body']['id']){delete _0x89714f[_0xcfad('0x43')]['id'];}return db[_0xcfad('0x29')]['find']({'where':{'id':_0x89714f[_0xcfad('0x44')]['id']}})['then'](handleEntityNotFound(_0x5edbd7,null))[_0xcfad('0x3c')](saveUpdates(_0x89714f[_0xcfad('0x43')],null))[_0xcfad('0x3c')](respondWithResult(_0x5edbd7,null))['catch'](handleError(_0x5edbd7,null));};exports[_0xcfad('0x23')]=function(_0x3bf82c,_0x44e0e9){return db['ZohoConfiguration'][_0xcfad('0x45')]({'where':{'id':_0x3bf82c[_0xcfad('0x44')]['id']}})[_0xcfad('0x3c')](handleEntityNotFound(_0x44e0e9,null))[_0xcfad('0x3c')](removeEntity(_0x44e0e9,null))[_0xcfad('0x46')](handleError(_0x44e0e9,null));};exports[_0xcfad('0x47')]=function(_0x4994ac,_0x2cd2aa,_0x4b5e3a){var _0x3155aa={};var _0x877a4f={};var _0x4afff1;var _0x18f043;return db[_0xcfad('0x29')]['findOne']({'where':{'id':_0x4994ac[_0xcfad('0x44')]['id']}})[_0xcfad('0x3c')](handleEntityNotFound(_0x2cd2aa,null))[_0xcfad('0x3c')](function(_0xbfc737){if(_0xbfc737){_0x4afff1=_0xbfc737;_0x877a4f[_0xcfad('0x2c')]=_['keys'](db[_0xcfad('0x48')][_0xcfad('0x2a')]);_0x877a4f['query']=_[_0xcfad('0x2d')](_0x4994ac[_0xcfad('0x2e')]);_0x877a4f[_0xcfad('0x35')]=_[_0xcfad('0x2f')](_0x877a4f[_0xcfad('0x2c')],_0x877a4f['query']);_0x3155aa[_0xcfad('0x30')]=_[_0xcfad('0x2f')](_0x877a4f['model'],qs[_0xcfad('0x31')](_0x4994ac['query'][_0xcfad('0x31')]));_0x3155aa['attributes']=_0x3155aa[_0xcfad('0x30')][_0xcfad('0x32')]?_0x3155aa[_0xcfad('0x30')]:_0x877a4f[_0xcfad('0x2c')];_0x3155aa[_0xcfad('0x49')]=qs[_0xcfad('0x34')](_0x4994ac[_0xcfad('0x2e')][_0xcfad('0x34')]);_0x3155aa[_0xcfad('0x37')]=qs['filters'](_[_0xcfad('0x36')](_0x4994ac[_0xcfad('0x2e')],_0x877a4f[_0xcfad('0x35')]));if(_0x4994ac[_0xcfad('0x2e')][_0xcfad('0x3a')]){_0x3155aa[_0xcfad('0x37')]=_[_0xcfad('0x38')](_0x3155aa['where'],{'$or':_[_0xcfad('0x28')](_0x3155aa[_0xcfad('0x30')],function(_0x297d61){var _0x18f8a1={};_0x18f8a1[_0x297d61]={'$like':'%'+_0x4994ac[_0xcfad('0x2e')][_0xcfad('0x3a')]+'%'};return _0x18f8a1;})});}_0x3155aa=_['merge']({},_0x3155aa,_0x4994ac[_0xcfad('0x3b')]);return _0x4afff1[_0xcfad('0x47')](_0x3155aa);}})['then'](function(_0x5e1817){if(_0x5e1817){_0x18f043=_0x5e1817[_0xcfad('0x32')];if(!_0x4994ac['query'][_0xcfad('0x4a')](_0xcfad('0x33'))){_0x3155aa['limit']=qs[_0xcfad('0x1c')](_0x4994ac['query'][_0xcfad('0x1c')]);_0x3155aa[_0xcfad('0x1a')]=qs['offset'](_0x4994ac['query']['offset']);}return _0x4afff1['getFields'](_0x3155aa);}})[_0xcfad('0x3c')](function(_0x58ac88){if(_0x58ac88){return _0x58ac88?{'count':_0x18f043,'rows':_0x58ac88}:null;}})[_0xcfad('0x3c')](respondWithResult(_0x2cd2aa,null))[_0xcfad('0x46')](handleError(_0x2cd2aa,null));};exports['getSubjects']=function(_0x28bee1,_0x36172f,_0x24cb5c){var _0xe6918c={};var _0x11db52={};var _0x33c60f;var _0x2cb62a;return db[_0xcfad('0x29')][_0xcfad('0x4b')]({'where':{'id':_0x28bee1['params']['id']}})[_0xcfad('0x3c')](handleEntityNotFound(_0x36172f,null))[_0xcfad('0x3c')](function(_0x3fa90b){if(_0x3fa90b){_0x33c60f=_0x3fa90b;_0x11db52[_0xcfad('0x2c')]=_[_0xcfad('0x2d')](db['ZohoField']['rawAttributes']);_0x11db52[_0xcfad('0x2e')]=_[_0xcfad('0x2d')](_0x28bee1[_0xcfad('0x2e')]);_0x11db52['filters']=_[_0xcfad('0x2f')](_0x11db52['model'],_0x11db52[_0xcfad('0x2e')]);_0xe6918c['attributes']=_['intersection'](_0x11db52['model'],qs[_0xcfad('0x31')](_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x31')]));_0xe6918c['attributes']=_0xe6918c[_0xcfad('0x30')][_0xcfad('0x32')]?_0xe6918c[_0xcfad('0x30')]:_0x11db52[_0xcfad('0x2c')];_0xe6918c[_0xcfad('0x49')]=qs[_0xcfad('0x34')](_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x34')]);_0xe6918c['where']=qs['filters'](_['pick'](_0x28bee1[_0xcfad('0x2e')],_0x11db52['filters']));if(_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x3a')]){_0xe6918c['where']=_[_0xcfad('0x38')](_0xe6918c['where'],{'$or':_[_0xcfad('0x28')](_0xe6918c[_0xcfad('0x30')],function(_0x4f75bc){var _0x42cf7e={};_0x42cf7e[_0x4f75bc]={'$like':'%'+_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x3a')]+'%'};return _0x42cf7e;})});}_0xe6918c=_['merge']({},_0xe6918c,_0x28bee1[_0xcfad('0x3b')]);return _0x33c60f[_0xcfad('0x4c')](_0xe6918c);}})[_0xcfad('0x3c')](function(_0x4fa6a1){if(_0x4fa6a1){_0x2cb62a=_0x4fa6a1[_0xcfad('0x32')];if(!_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x4a')](_0xcfad('0x33'))){_0xe6918c[_0xcfad('0x1c')]=qs[_0xcfad('0x1c')](_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x1c')]);_0xe6918c['offset']=qs['offset'](_0x28bee1[_0xcfad('0x2e')][_0xcfad('0x1a')]);}return _0x33c60f[_0xcfad('0x4c')](_0xe6918c);}})[_0xcfad('0x3c')](function(_0xf5f600){if(_0xf5f600){return _0xf5f600?{'count':_0x2cb62a,'rows':_0xf5f600}:null;}})[_0xcfad('0x3c')](respondWithResult(_0x36172f,null))[_0xcfad('0x46')](handleError(_0x36172f,null));};exports['getDescriptions']=function(_0x1bf548,_0x593a9c,_0x3ce426){var _0x34b971={};var _0x4d3727={};var _0x102786;var _0x510f4b;return db['ZohoConfiguration'][_0xcfad('0x4b')]({'where':{'id':_0x1bf548['params']['id']}})[_0xcfad('0x3c')](handleEntityNotFound(_0x593a9c,null))[_0xcfad('0x3c')](function(_0x508d88){if(_0x508d88){_0x102786=_0x508d88;_0x4d3727[_0xcfad('0x2c')]=_['keys'](db[_0xcfad('0x48')][_0xcfad('0x2a')]);_0x4d3727[_0xcfad('0x2e')]=_[_0xcfad('0x2d')](_0x1bf548[_0xcfad('0x2e')]);_0x4d3727[_0xcfad('0x35')]=_[_0xcfad('0x2f')](_0x4d3727[_0xcfad('0x2c')],_0x4d3727[_0xcfad('0x2e')]);_0x34b971[_0xcfad('0x30')]=_[_0xcfad('0x2f')](_0x4d3727[_0xcfad('0x2c')],qs[_0xcfad('0x31')](_0x1bf548[_0xcfad('0x2e')][_0xcfad('0x31')]));_0x34b971[_0xcfad('0x30')]=_0x34b971[_0xcfad('0x30')][_0xcfad('0x32')]?_0x34b971[_0xcfad('0x30')]:_0x4d3727[_0xcfad('0x2c')];_0x34b971[_0xcfad('0x49')]=qs[_0xcfad('0x34')](_0x1bf548[_0xcfad('0x2e')][_0xcfad('0x34')]);_0x34b971[_0xcfad('0x37')]=qs['filters'](_[_0xcfad('0x36')](_0x1bf548['query'],_0x4d3727['filters']));if(_0x1bf548[_0xcfad('0x2e')][_0xcfad('0x3a')]){_0x34b971[_0xcfad('0x37')]=_['merge'](_0x34b971[_0xcfad('0x37')],{'$or':_['map'](_0x34b971[_0xcfad('0x30')],function(_0x2bf083){var _0x3e5878={};_0x3e5878[_0x2bf083]={'$like':'%'+_0x1bf548[_0xcfad('0x2e')][_0xcfad('0x3a')]+'%'};return _0x3e5878;})});}_0x34b971=_[_0xcfad('0x38')]({},_0x34b971,_0x1bf548[_0xcfad('0x3b')]);return _0x102786[_0xcfad('0x4d')](_0x34b971);}})[_0xcfad('0x3c')](function(_0x20f26e){if(_0x20f26e){_0x510f4b=_0x20f26e[_0xcfad('0x32')];if(!_0x1bf548[_0xcfad('0x2e')]['hasOwnProperty'](_0xcfad('0x33'))){_0x34b971['limit']=qs[_0xcfad('0x1c')](_0x1bf548['query']['limit']);_0x34b971['offset']=qs[_0xcfad('0x1a')](_0x1bf548[_0xcfad('0x2e')]['offset']);}return _0x102786[_0xcfad('0x4d')](_0x34b971);}})['then'](function(_0x2b576e){if(_0x2b576e){return _0x2b576e?{'count':_0x510f4b,'rows':_0x2b576e}:null;}})[_0xcfad('0x3c')](respondWithResult(_0x593a9c,null))[_0xcfad('0x46')](handleError(_0x593a9c,null));}; \ No newline at end of file +var _0xf577=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0x4ffa41,_0x28b5e2){var _0x1872ce=function(_0x27d668){while(--_0x27d668){_0x4ffa41['push'](_0x4ffa41['shift']());}};_0x1872ce(++_0x28b5e2);}(_0xf577,0x1b4));var _0x7f57=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xf577[_0x1deb03];return _0x189fe7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f57('0x0'));var zipdir=require(_0x7f57('0x1'));var jsonpatch=require(_0x7f57('0x2'));var rp=require(_0x7f57('0x3'));var moment=require(_0x7f57('0x4'));var BPromise=require(_0x7f57('0x5'));var Mustache=require(_0x7f57('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7f57('0x7'));var ejs=require(_0x7f57('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f57('0x9'));var jsforce=require(_0x7f57('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f57('0xb'));var Redis=require(_0x7f57('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7f57('0xd'));var as=require(_0x7f57('0xe'));var hardwareService=require(_0x7f57('0xf'));var logger=require(_0x7f57('0x10'))('api');var utils=require(_0x7f57('0x11'));var config=require(_0x7f57('0x12'));var licenseUtil=require(_0x7f57('0x13'));var db=require(_0x7f57('0x14'))['db'];function respondWithStatusCode(_0x406d14,_0x206801){_0x206801=_0x206801||0xcc;return function(_0x346ee2){if(_0x346ee2){return _0x406d14[_0x7f57('0x15')](_0x206801);}return _0x406d14[_0x7f57('0x16')](_0x206801)[_0x7f57('0x17')]();};}function respondWithResult(_0x69e3e2,_0x35f413){_0x35f413=_0x35f413||0xc8;return function(_0x1a1fae){if(_0x1a1fae){return _0x69e3e2[_0x7f57('0x16')](_0x35f413)[_0x7f57('0x18')](_0x1a1fae);}};}function respondWithFilteredResult(_0x4523fa,_0x5a4783){return function(_0x2b12ab){if(_0x2b12ab){var _0x1c2d05=typeof _0x5a4783[_0x7f57('0x19')]==='undefined'&&typeof _0x5a4783[_0x7f57('0x1a')]===_0x7f57('0x1b');var _0x18e18d=_0x2b12ab['count'];var _0x35e937=_0x1c2d05?0x0:_0x5a4783[_0x7f57('0x19')];var _0x445442=_0x1c2d05?_0x2b12ab[_0x7f57('0x1c')]:_0x5a4783[_0x7f57('0x19')]+_0x5a4783[_0x7f57('0x1a')];var _0x8a6152;if(_0x445442>=_0x18e18d){_0x445442=_0x18e18d;_0x8a6152=0xc8;}else{_0x8a6152=0xce;}_0x4523fa[_0x7f57('0x16')](_0x8a6152);return _0x4523fa[_0x7f57('0x1d')](_0x7f57('0x1e'),_0x35e937+'-'+_0x445442+'/'+_0x18e18d)[_0x7f57('0x18')](_0x2b12ab);}return null;};}function patchUpdates(_0x27eac0){return function(_0x4c957e){try{jsonpatch[_0x7f57('0x1f')](_0x4c957e,_0x27eac0,!![]);}catch(_0x697ccf){return BPromise[_0x7f57('0x20')](_0x697ccf);}return _0x4c957e[_0x7f57('0x21')]();};}function saveUpdates(_0x369aac,_0x1961be){return function(_0x3a7c28){if(_0x3a7c28){return _0x3a7c28['update'](_0x369aac)[_0x7f57('0x22')](function(_0x475fd6){return _0x475fd6;});}return null;};}function removeEntity(_0x54ac2c,_0x41a590){return function(_0x239483){if(_0x239483){return _0x239483[_0x7f57('0x23')]()[_0x7f57('0x22')](function(){_0x54ac2c[_0x7f57('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c23db,_0x4c5f8f){return function(_0x28fc97){if(!_0x28fc97){_0x5c23db['sendStatus'](0x194);}return _0x28fc97;};}function handleError(_0x487878,_0x3da562){_0x3da562=_0x3da562||0x1f4;return function(_0x58b0b8){logger[_0x7f57('0x24')](_0x58b0b8[_0x7f57('0x25')]);if(_0x58b0b8[_0x7f57('0x26')]){delete _0x58b0b8[_0x7f57('0x26')];}_0x487878[_0x7f57('0x16')](_0x3da562)[_0x7f57('0x27')](_0x58b0b8);};}exports[_0x7f57('0x28')]=function(_0x58b78a,_0x76c4b1){var _0x1eb86f={},_0x185733={},_0x3baa65={'count':0x0,'rows':[]};var _0x4e8d06=_[_0x7f57('0x29')](db['ZohoConfiguration'][_0x7f57('0x2a')],function(_0xa270fd){return{'name':_0xa270fd[_0x7f57('0x2b')],'type':_0xa270fd[_0x7f57('0x2c')][_0x7f57('0x2d')]};});_0x185733['model']=_[_0x7f57('0x29')](_0x4e8d06,_0x7f57('0x26'));_0x185733[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x58b78a['query']);_0x185733[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x185733[_0x7f57('0x32')],_0x185733[_0x7f57('0x2e')]);_0x1eb86f[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x185733[_0x7f57('0x32')],qs['fields'](_0x58b78a['query'][_0x7f57('0x34')]));_0x1eb86f[_0x7f57('0x33')]=_0x1eb86f[_0x7f57('0x33')][_0x7f57('0x35')]?_0x1eb86f[_0x7f57('0x33')]:_0x185733['model'];if(!_0x58b78a['query'][_0x7f57('0x36')]('nolimit')){_0x1eb86f[_0x7f57('0x1a')]=qs['limit'](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x1a')]);_0x1eb86f['offset']=qs[_0x7f57('0x19')](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x19')]);}_0x1eb86f[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x1eb86f['where']=qs['filters'](_[_0x7f57('0x39')](_0x58b78a['query'],_0x185733['filters']),_0x4e8d06);if(_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x3a')]){_0x1eb86f[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x1eb86f[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x4e8d06,function(_0x1a7e2f){if(_0x1a7e2f[_0x7f57('0x2c')]!==_0x7f57('0x3d')){var _0x5c1f59={};_0x5c1f59[_0x1a7e2f[_0x7f57('0x26')]]={'$like':'%'+_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0x5c1f59;}})});}_0x1eb86f=_['merge']({},_0x1eb86f,_0x58b78a[_0x7f57('0x3e')]);var _0x23c7f4={'where':_0x1eb86f[_0x7f57('0x3b')]};return db[_0x7f57('0x3f')]['count'](_0x23c7f4)[_0x7f57('0x22')](function(_0x319614){_0x3baa65['count']=_0x319614;if(_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x40')]){_0x1eb86f[_0x7f57('0x41')]=[{'all':!![]}];}return db[_0x7f57('0x3f')][_0x7f57('0x42')](_0x1eb86f);})[_0x7f57('0x22')](function(_0x1633e4){_0x3baa65['rows']=_0x1633e4;return _0x3baa65;})[_0x7f57('0x22')](respondWithFilteredResult(_0x76c4b1,_0x1eb86f))[_0x7f57('0x43')](handleError(_0x76c4b1,null));};exports[_0x7f57('0x44')]=function(_0x4ad6e9,_0x344f0f){var _0x1b128d={'raw':![],'where':{'id':_0x4ad6e9[_0x7f57('0x45')]['id']}},_0x45e98a={};_0x45e98a[_0x7f57('0x32')]=_['keys'](db[_0x7f57('0x3f')]['rawAttributes']);_0x45e98a[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x4ad6e9['query']);_0x45e98a[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x45e98a[_0x7f57('0x32')],_0x45e98a['query']);_0x1b128d[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x45e98a[_0x7f57('0x32')],qs['fields'](_0x4ad6e9['query'][_0x7f57('0x34')]));_0x1b128d[_0x7f57('0x33')]=_0x1b128d[_0x7f57('0x33')]['length']?_0x1b128d[_0x7f57('0x33')]:_0x45e98a['model'];if(_0x4ad6e9[_0x7f57('0x2e')][_0x7f57('0x40')]){_0x1b128d[_0x7f57('0x41')]=[{'all':!![]}];}_0x1b128d=_['merge']({},_0x1b128d,_0x4ad6e9[_0x7f57('0x3e')]);return db[_0x7f57('0x3f')][_0x7f57('0x46')](_0x1b128d)[_0x7f57('0x22')](handleEntityNotFound(_0x344f0f,null))[_0x7f57('0x22')](respondWithResult(_0x344f0f,null))[_0x7f57('0x43')](handleError(_0x344f0f,null));};exports[_0x7f57('0x47')]=function(_0x52288e,_0x5d73cd){return db[_0x7f57('0x3f')][_0x7f57('0x47')](_0x52288e['body'],{})[_0x7f57('0x22')](respondWithResult(_0x5d73cd,0xc9))[_0x7f57('0x43')](handleError(_0x5d73cd,null));};exports['update']=function(_0xea0224,_0x41312f){if(_0xea0224[_0x7f57('0x48')]['id']){delete _0xea0224[_0x7f57('0x48')]['id'];}return db['ZohoConfiguration'][_0x7f57('0x46')]({'where':{'id':_0xea0224[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x41312f,null))[_0x7f57('0x22')](saveUpdates(_0xea0224[_0x7f57('0x48')],null))[_0x7f57('0x22')](respondWithResult(_0x41312f,null))[_0x7f57('0x43')](handleError(_0x41312f,null));};exports[_0x7f57('0x23')]=function(_0x5673e5,_0x35fcd2){return db['ZohoConfiguration']['find']({'where':{'id':_0x5673e5[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x35fcd2,null))[_0x7f57('0x22')](removeEntity(_0x35fcd2,null))[_0x7f57('0x43')](handleError(_0x35fcd2,null));};exports[_0x7f57('0x49')]=function(_0x151a02,_0x1b6a2b,_0xbd2934){var _0x2fd410={};var _0x5377dd={};var _0x10cc67;var _0x54af23;return db[_0x7f57('0x3f')][_0x7f57('0x4a')]({'where':{'id':_0x151a02[_0x7f57('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b6a2b,null))[_0x7f57('0x22')](function(_0x360209){if(_0x360209){_0x10cc67=_0x360209;_0x5377dd[_0x7f57('0x32')]=_[_0x7f57('0x2f')](db[_0x7f57('0x4b')][_0x7f57('0x2a')]);_0x5377dd[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x151a02['query']);_0x5377dd[_0x7f57('0x30')]=_['intersection'](_0x5377dd[_0x7f57('0x32')],_0x5377dd['query']);_0x2fd410[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x5377dd[_0x7f57('0x32')],qs[_0x7f57('0x34')](_0x151a02['query'][_0x7f57('0x34')]));_0x2fd410[_0x7f57('0x33')]=_0x2fd410[_0x7f57('0x33')][_0x7f57('0x35')]?_0x2fd410[_0x7f57('0x33')]:_0x5377dd[_0x7f57('0x32')];_0x2fd410[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x2fd410[_0x7f57('0x3b')]=qs['filters'](_[_0x7f57('0x39')](_0x151a02['query'],_0x5377dd[_0x7f57('0x30')]));if(_0x151a02[_0x7f57('0x2e')][_0x7f57('0x3a')]){_0x2fd410['where']=_[_0x7f57('0x3c')](_0x2fd410[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x2fd410[_0x7f57('0x33')],function(_0x38ee5c){var _0x2fba30={};_0x2fba30[_0x38ee5c]={'$like':'%'+_0x151a02['query'][_0x7f57('0x3a')]+'%'};return _0x2fba30;})});}_0x2fd410=_[_0x7f57('0x3c')]({},_0x2fd410,_0x151a02[_0x7f57('0x3e')]);return _0x10cc67[_0x7f57('0x49')](_0x2fd410);}})[_0x7f57('0x22')](function(_0x381be5){if(_0x381be5){_0x54af23=_0x381be5[_0x7f57('0x35')];if(!_0x151a02[_0x7f57('0x2e')]['hasOwnProperty']('nolimit')){_0x2fd410[_0x7f57('0x1a')]=qs[_0x7f57('0x1a')](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x1a')]);_0x2fd410[_0x7f57('0x19')]=qs['offset'](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x19')]);}return _0x10cc67[_0x7f57('0x49')](_0x2fd410);}})['then'](function(_0x4bd4d0){if(_0x4bd4d0){return _0x4bd4d0?{'count':_0x54af23,'rows':_0x4bd4d0}:null;}})[_0x7f57('0x22')](respondWithResult(_0x1b6a2b,null))[_0x7f57('0x43')](handleError(_0x1b6a2b,null));};exports['getSubjects']=function(_0xb1f7ee,_0x2771bf,_0x46c639){var _0x52e774={};var _0x117949={};var _0x2a06ae;var _0x365a92;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xb1f7ee[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x2771bf,null))[_0x7f57('0x22')](function(_0x122e94){if(_0x122e94){_0x2a06ae=_0x122e94;_0x117949['model']=_[_0x7f57('0x2f')](db[_0x7f57('0x4b')][_0x7f57('0x2a')]);_0x117949[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0xb1f7ee[_0x7f57('0x2e')]);_0x117949[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x117949[_0x7f57('0x32')],_0x117949[_0x7f57('0x2e')]);_0x52e774['attributes']=_['intersection'](_0x117949[_0x7f57('0x32')],qs[_0x7f57('0x34')](_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x34')]));_0x52e774[_0x7f57('0x33')]=_0x52e774[_0x7f57('0x33')][_0x7f57('0x35')]?_0x52e774[_0x7f57('0x33')]:_0x117949[_0x7f57('0x32')];_0x52e774[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x52e774[_0x7f57('0x3b')]=qs[_0x7f57('0x30')](_[_0x7f57('0x39')](_0xb1f7ee[_0x7f57('0x2e')],_0x117949[_0x7f57('0x30')]));if(_0xb1f7ee['query']['filter']){_0x52e774[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x52e774[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x52e774[_0x7f57('0x33')],function(_0x1d6be2){var _0x5c66f4={};_0x5c66f4[_0x1d6be2]={'$like':'%'+_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0x5c66f4;})});}_0x52e774=_['merge']({},_0x52e774,_0xb1f7ee['options']);return _0x2a06ae[_0x7f57('0x4c')](_0x52e774);}})[_0x7f57('0x22')](function(_0x4566bd){if(_0x4566bd){_0x365a92=_0x4566bd[_0x7f57('0x35')];if(!_0xb1f7ee[_0x7f57('0x2e')]['hasOwnProperty'](_0x7f57('0x4d'))){_0x52e774['limit']=qs[_0x7f57('0x1a')](_0xb1f7ee['query'][_0x7f57('0x1a')]);_0x52e774[_0x7f57('0x19')]=qs[_0x7f57('0x19')](_0xb1f7ee[_0x7f57('0x2e')]['offset']);}return _0x2a06ae[_0x7f57('0x4c')](_0x52e774);}})['then'](function(_0xe8b4d4){if(_0xe8b4d4){return _0xe8b4d4?{'count':_0x365a92,'rows':_0xe8b4d4}:null;}})[_0x7f57('0x22')](respondWithResult(_0x2771bf,null))[_0x7f57('0x43')](handleError(_0x2771bf,null));};exports['getDescriptions']=function(_0x422cee,_0x4708fb,_0x2be15f){var _0x302079={};var _0x4d2d38={};var _0x1f4f8b;var _0x1f3589;return db[_0x7f57('0x3f')][_0x7f57('0x4a')]({'where':{'id':_0x422cee[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x4708fb,null))[_0x7f57('0x22')](function(_0x46dc06){if(_0x46dc06){_0x1f4f8b=_0x46dc06;_0x4d2d38['model']=_[_0x7f57('0x2f')](db['ZohoField'][_0x7f57('0x2a')]);_0x4d2d38[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x422cee[_0x7f57('0x2e')]);_0x4d2d38[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x4d2d38['model'],_0x4d2d38[_0x7f57('0x2e')]);_0x302079[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x4d2d38['model'],qs['fields'](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x34')]));_0x302079['attributes']=_0x302079[_0x7f57('0x33')][_0x7f57('0x35')]?_0x302079[_0x7f57('0x33')]:_0x4d2d38[_0x7f57('0x32')];_0x302079[_0x7f57('0x37')]=qs['sort'](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x302079['where']=qs[_0x7f57('0x30')](_[_0x7f57('0x39')](_0x422cee[_0x7f57('0x2e')],_0x4d2d38[_0x7f57('0x30')]));if(_0x422cee['query'][_0x7f57('0x3a')]){_0x302079[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x302079['where'],{'$or':_['map'](_0x302079[_0x7f57('0x33')],function(_0x3c5027){var _0xc45b0b={};_0xc45b0b[_0x3c5027]={'$like':'%'+_0x422cee[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0xc45b0b;})});}_0x302079=_[_0x7f57('0x3c')]({},_0x302079,_0x422cee[_0x7f57('0x3e')]);return _0x1f4f8b['getDescriptions'](_0x302079);}})[_0x7f57('0x22')](function(_0x34679e){if(_0x34679e){_0x1f3589=_0x34679e[_0x7f57('0x35')];if(!_0x422cee[_0x7f57('0x2e')][_0x7f57('0x36')]('nolimit')){_0x302079[_0x7f57('0x1a')]=qs[_0x7f57('0x1a')](_0x422cee['query'][_0x7f57('0x1a')]);_0x302079[_0x7f57('0x19')]=qs[_0x7f57('0x19')](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x19')]);}return _0x1f4f8b[_0x7f57('0x4e')](_0x302079);}})[_0x7f57('0x22')](function(_0x273384){if(_0x273384){return _0x273384?{'count':_0x1f3589,'rows':_0x273384}:null;}})['then'](respondWithResult(_0x4708fb,null))[_0x7f57('0x43')](handleError(_0x4708fb,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7b96919..402fb9c 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 _0x1d8d=['moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x4784fc,_0x59c4af){var _0x564493=function(_0x323f6e){while(--_0x323f6e){_0x4784fc['push'](_0x4784fc['shift']());}};_0x564493(++_0x59c4af);}(_0x1d8d,0x1dd));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1d8('0x0'));var util=require(_0xd1d8('0x1'));var logger=require(_0xd1d8('0x2'))(_0xd1d8('0x3'));var moment=require(_0xd1d8('0x4'));var BPromise=require(_0xd1d8('0x5'));var rp=require(_0xd1d8('0x6'));var fs=require('fs');var path=require(_0xd1d8('0x7'));var rimraf=require('rimraf');var config=require(_0xd1d8('0x8'));var attributes=require(_0xd1d8('0x9'));module[_0xd1d8('0xa')]=function(_0x569d16,_0x17d3d9){return _0x569d16['define'](_0xd1d8('0xb'),attributes,{'tableName':_0xd1d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae3=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x472ea3,_0x105de8){var _0x16908d=function(_0x372a45){while(--_0x372a45){_0x472ea3['push'](_0x472ea3['shift']());}};_0x16908d(++_0x105de8);}(_0x1ae3,0x185));var _0x31ae=function(_0x2ca4d1,_0x148124){_0x2ca4d1=_0x2ca4d1-0x0;var _0x45589a=_0x1ae3[_0x2ca4d1];return _0x45589a;};'use strict';var _=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var logger=require(_0x31ae('0x2'))(_0x31ae('0x3'));var moment=require('moment');var BPromise=require(_0x31ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ae('0x5'));var rimraf=require(_0x31ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ae('0x7'));module[_0x31ae('0x8')]=function(_0x5703d9,_0x3c5cf0){return _0x5703d9[_0x31ae('0x9')](_0x31ae('0xa'),attributes,{'tableName':_0x31ae('0xb'),'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 113721e..2f24a94 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 _0x5cff=['then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5cff,0x1a9));var _0xf5cf=function(_0x3e55fb,_0x1cd0d7){_0x3e55fb=_0x3e55fb-0x0;var _0x25d21f=_0x5cff[_0x3e55fb];return _0x25d21f;};'use strict';var _=require(_0xf5cf('0x0'));var util=require(_0xf5cf('0x1'));var moment=require('moment');var BPromise=require(_0xf5cf('0x2'));var rs=require(_0xf5cf('0x3'));var fs=require('fs');var Redis=require(_0xf5cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5cf('0x5'));var logger=require(_0xf5cf('0x6'))('rpc');var config=require(_0xf5cf('0x7'));var jayson=require(_0xf5cf('0x8'));var client=jayson[_0xf5cf('0x9')][_0xf5cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26ed20,_0x277c16,_0x19d018){return new BPromise(function(_0x544346,_0x2968b5){return client[_0xf5cf('0xb')](_0x26ed20,_0x19d018)[_0xf5cf('0xc')](function(_0x443328){logger['info'](_0xf5cf('0xd'),_0x277c16,'request\x20sent');logger[_0xf5cf('0xe')](_0xf5cf('0xf'),_0x277c16,'request\x20sent',JSON[_0xf5cf('0x10')](_0x443328));if(_0x443328[_0xf5cf('0x11')]){if(_0x443328[_0xf5cf('0x11')][_0xf5cf('0x12')]===0x1f4){logger[_0xf5cf('0x11')](_0xf5cf('0xd'),_0x277c16,_0x443328[_0xf5cf('0x11')][_0xf5cf('0x13')]);return _0x2968b5(_0x443328[_0xf5cf('0x11')][_0xf5cf('0x13')]);}logger['error'](_0xf5cf('0xd'),_0x277c16,_0x443328[_0xf5cf('0x11')]['message']);return _0x544346(_0x443328['error'][_0xf5cf('0x13')]);}else{logger[_0xf5cf('0x14')](_0xf5cf('0xd'),_0x277c16,_0xf5cf('0x15'));_0x544346(_0x443328['result'][_0xf5cf('0x13')]);}})[_0xf5cf('0x16')](function(_0x2c33bc){logger[_0xf5cf('0x11')](_0xf5cf('0xd'),_0x277c16,_0x2c33bc);_0x2968b5(_0x2c33bc);});});} \ No newline at end of file +var _0x91a6=['catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message'];(function(_0x4364b7,_0x3bf7cd){var _0xbd9b20=function(_0x8dc270){while(--_0x8dc270){_0x4364b7['push'](_0x4364b7['shift']());}};_0xbd9b20(++_0x3bf7cd);}(_0x91a6,0x1cd));var _0x691a=function(_0x32cacc,_0x5a6409){_0x32cacc=_0x32cacc-0x0;var _0x39ecd5=_0x91a6[_0x32cacc];return _0x39ecd5;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var moment=require(_0x691a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x691a('0x3'))['db'];var utils=require(_0x691a('0x4'));var logger=require(_0x691a('0x5'))(_0x691a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x691a('0x7')][_0x691a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48f2b2,_0x3c48ca,_0x13bcb7){return new BPromise(function(_0x23619e,_0x61094){return client[_0x691a('0x9')](_0x48f2b2,_0x13bcb7)['then'](function(_0x449b42){logger[_0x691a('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x691a('0xb'));logger[_0x691a('0xc')](_0x691a('0xd'),_0x3c48ca,_0x691a('0xb'),JSON[_0x691a('0xe')](_0x449b42));if(_0x449b42[_0x691a('0xf')]){if(_0x449b42['error'][_0x691a('0x10')]===0x1f4){logger['error'](_0x691a('0x11'),_0x3c48ca,_0x449b42[_0x691a('0xf')][_0x691a('0x12')]);return _0x61094(_0x449b42[_0x691a('0xf')]['message']);}logger[_0x691a('0xf')](_0x691a('0x11'),_0x3c48ca,_0x449b42['error'][_0x691a('0x12')]);return _0x23619e(_0x449b42['error'][_0x691a('0x12')]);}else{logger[_0x691a('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x691a('0xb'));_0x23619e(_0x449b42['result'][_0x691a('0x12')]);}})[_0x691a('0x13')](function(_0x5dc0e9){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x5dc0e9);_0x61094(_0x5dc0e9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index b6acfdd..96202ea 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 _0x7385=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7385,0x188));var _0x5738=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7385[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x5738('0x0'));var util=require(_0x5738('0x1'));var path=require('path');var timeout=require(_0x5738('0x2'));var express=require(_0x5738('0x3'));var router=express[_0x5738('0x4')]();var fs_extra=require(_0x5738('0x5'));var auth=require(_0x5738('0x6'));var interaction=require(_0x5738('0x7'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x5738('0x8')](),controller[_0x5738('0x9')]);router[_0x5738('0xa')](_0x5738('0xb'),auth[_0x5738('0x8')](),controller[_0x5738('0xc')]);router[_0x5738('0xd')]('/',auth[_0x5738('0x8')](),controller['create']);router[_0x5738('0xe')](_0x5738('0xb'),auth[_0x5738('0x8')](),controller[_0x5738('0xf')]);router[_0x5738('0x10')](_0x5738('0xb'),auth[_0x5738('0x8')](),controller[_0x5738('0x11')]);module[_0x5738('0x12')]=router; \ No newline at end of file +var _0x88f2=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1a0eda,_0xa53b9e){var _0x4fad57=function(_0x25f47f){while(--_0x25f47f){_0x1a0eda['push'](_0x1a0eda['shift']());}};_0x4fad57(++_0xa53b9e);}(_0x88f2,0xd5));var _0x288f=function(_0x88a159,_0x549558){_0x88a159=_0x88a159-0x0;var _0x5139e8=_0x88f2[_0x88a159];return _0x5139e8;};'use strict';var multer=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var path=require(_0x288f('0x2'));var timeout=require(_0x288f('0x3'));var express=require(_0x288f('0x4'));var router=express[_0x288f('0x5')]();var fs_extra=require(_0x288f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x288f('0x7'));var config=require(_0x288f('0x8'));var controller=require(_0x288f('0x9'));router[_0x288f('0xa')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0xc')]);router[_0x288f('0xa')](_0x288f('0xd'),auth[_0x288f('0xb')](),controller[_0x288f('0xe')]);router[_0x288f('0xf')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0x10')]);router[_0x288f('0x11')](_0x288f('0xd'),auth['isAuthenticated'](),controller[_0x288f('0x12')]);router['delete'](_0x288f('0xd'),auth[_0x288f('0xb')](),controller[_0x288f('0x13')]);module[_0x288f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index b233e04..5231fae 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 _0x3a16=['picklist','STRING','customVariable','exports','ENUM','string','variable','keyValue'];(function(_0xead37a,_0x24fdd3){var _0x1969f3=function(_0x27b5dd){while(--_0x27b5dd){_0xead37a['push'](_0xead37a['shift']());}};_0x1969f3(++_0x24fdd3);}(_0x3a16,0xe3));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x63a1('0x0')]={'type':{'type':Sequelize[_0x63a1('0x1')](_0x63a1('0x2'),_0x63a1('0x3'),'customVariable',_0x63a1('0x4'),_0x63a1('0x5')),'defaultValue':_0x63a1('0x2')},'content':{'type':Sequelize[_0x63a1('0x6')]},'key':{'type':Sequelize[_0x63a1('0x6')]},'keyType':{'type':Sequelize[_0x63a1('0x1')]('string',_0x63a1('0x3'),_0x63a1('0x7'))},'keyContent':{'type':Sequelize[_0x63a1('0x6')]},'idField':{'type':Sequelize[_0x63a1('0x6')]},'nameField':{'type':Sequelize[_0x63a1('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x63a1('0x6')]}}; \ No newline at end of file +var _0x8342=['ENUM','customVariable','BOOLEAN','sequelize','exports','variable','keyValue','picklist','string','STRING'];(function(_0x37cb14,_0x28abe0){var _0xf304fd=function(_0x13b3f2){while(--_0x13b3f2){_0x37cb14['push'](_0x37cb14['shift']());}};_0xf304fd(++_0x28abe0);}(_0x8342,0x107));var _0x2834=function(_0x42182d,_0x125b1a){_0x42182d=_0x42182d-0x0;var _0x26459b=_0x8342[_0x42182d];return _0x26459b;};'use strict';var Sequelize=require(_0x2834('0x0'));module[_0x2834('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2834('0x2'),'customVariable',_0x2834('0x3'),_0x2834('0x4')),'defaultValue':_0x2834('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2834('0x6')]},'keyType':{'type':Sequelize[_0x2834('0x7')](_0x2834('0x5'),_0x2834('0x2'),_0x2834('0x8'))},'keyContent':{'type':Sequelize[_0x2834('0x6')]},'idField':{'type':Sequelize[_0x2834('0x6')]},'nameField':{'type':Sequelize[_0x2834('0x6')]},'customField':{'type':Sequelize[_0x2834('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2834('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 6d42583..5ef65df 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 _0x0b66=['moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ZohoField','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','request-promise'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0b66,0x1b9));var _0x60b6=function(_0x4cd070,_0x23538f){_0x4cd070=_0x4cd070-0x0;var _0xb3639a=_0x0b66[_0x4cd070];return _0xb3639a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60b6('0x0'));var zipdir=require(_0x60b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60b6('0x2'));var moment=require(_0x60b6('0x3'));var BPromise=require(_0x60b6('0x4'));var Mustache=require(_0x60b6('0x5'));var util=require(_0x60b6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x60b6('0x7'));var ejs=require(_0x60b6('0x8'));var fs=require('fs');var fs_extra=require(_0x60b6('0x9'));var _=require(_0x60b6('0xa'));var squel=require('squel');var crypto=require(_0x60b6('0xb'));var jsforce=require(_0x60b6('0xc'));var deskjs=require(_0x60b6('0xd'));var toCsv=require(_0x60b6('0x7'));var querystring=require('querystring');var Papa=require(_0x60b6('0xe'));var Redis=require(_0x60b6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x60b6('0x10'));var as=require(_0x60b6('0x11'));var hardwareService=require(_0x60b6('0x12'));var logger=require(_0x60b6('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x60b6('0x14'))['db'];function respondWithStatusCode(_0x25af0c,_0x47bc64){_0x47bc64=_0x47bc64||0xcc;return function(_0x1e2fe1){if(_0x1e2fe1){return _0x25af0c['sendStatus'](_0x47bc64);}return _0x25af0c[_0x60b6('0x15')](_0x47bc64)['end']();};}function respondWithResult(_0x39f408,_0x3d15f0){_0x3d15f0=_0x3d15f0||0xc8;return function(_0x558dc5){if(_0x558dc5){return _0x39f408['status'](_0x3d15f0)['json'](_0x558dc5);}};}function respondWithFilteredResult(_0xcf2ace,_0x1c91bb){return function(_0x58a570){if(_0x58a570){var _0x4d9f48=typeof _0x1c91bb['offset']==='undefined'&&typeof _0x1c91bb[_0x60b6('0x16')]===_0x60b6('0x17');var _0x4cdb98=_0x58a570[_0x60b6('0x18')];var _0x58c747=_0x4d9f48?0x0:_0x1c91bb['offset'];var _0x391aea=_0x4d9f48?_0x58a570[_0x60b6('0x18')]:_0x1c91bb[_0x60b6('0x19')]+_0x1c91bb[_0x60b6('0x16')];var _0x3d1f93;if(_0x391aea>=_0x4cdb98){_0x391aea=_0x4cdb98;_0x3d1f93=0xc8;}else{_0x3d1f93=0xce;}_0xcf2ace['status'](_0x3d1f93);return _0xcf2ace[_0x60b6('0x1a')](_0x60b6('0x1b'),_0x58c747+'-'+_0x391aea+'/'+_0x4cdb98)[_0x60b6('0x1c')](_0x58a570);}return null;};}function patchUpdates(_0x572de3){return function(_0x514c23){try{jsonpatch[_0x60b6('0x1d')](_0x514c23,_0x572de3,!![]);}catch(_0x4b17ae){return BPromise[_0x60b6('0x1e')](_0x4b17ae);}return _0x514c23[_0x60b6('0x1f')]();};}function saveUpdates(_0x4e1b67,_0x5d6424){return function(_0x2ee007){if(_0x2ee007){return _0x2ee007[_0x60b6('0x20')](_0x4e1b67)[_0x60b6('0x21')](function(_0xfab7de){return _0xfab7de;});}return null;};}function removeEntity(_0x395477,_0x9a48a8){return function(_0x25e544){if(_0x25e544){return _0x25e544[_0x60b6('0x22')]()[_0x60b6('0x21')](function(){_0x395477[_0x60b6('0x15')](0xcc)[_0x60b6('0x23')]();});}};}function handleEntityNotFound(_0x1472d7,_0x5b8988){return function(_0x187818){if(!_0x187818){_0x1472d7[_0x60b6('0x24')](0x194);}return _0x187818;};}function handleError(_0x407298,_0x51e90a){_0x51e90a=_0x51e90a||0x1f4;return function(_0x245305){logger[_0x60b6('0x25')](_0x245305[_0x60b6('0x26')]);if(_0x245305[_0x60b6('0x27')]){delete _0x245305[_0x60b6('0x27')];}_0x407298['status'](_0x51e90a)[_0x60b6('0x28')](_0x245305);};}exports[_0x60b6('0x29')]=function(_0x2fbc87,_0x53cd4f){var _0x2374d4={},_0x332d1a={},_0x48dfd3={'count':0x0,'rows':[]};var _0x182bfb=_[_0x60b6('0x2a')](db[_0x60b6('0x2b')][_0x60b6('0x2c')],function(_0x482dae){return{'name':_0x482dae['fieldName'],'type':_0x482dae[_0x60b6('0x2d')]['key']};});_0x332d1a[_0x60b6('0x2e')]=_[_0x60b6('0x2a')](_0x182bfb,_0x60b6('0x27'));_0x332d1a[_0x60b6('0x2f')]=_[_0x60b6('0x30')](_0x2fbc87[_0x60b6('0x2f')]);_0x332d1a[_0x60b6('0x31')]=_['intersection'](_0x332d1a['model'],_0x332d1a[_0x60b6('0x2f')]);_0x2374d4[_0x60b6('0x32')]=_[_0x60b6('0x33')](_0x332d1a[_0x60b6('0x2e')],qs['fields'](_0x2fbc87[_0x60b6('0x2f')][_0x60b6('0x34')]));_0x2374d4[_0x60b6('0x32')]=_0x2374d4[_0x60b6('0x32')][_0x60b6('0x35')]?_0x2374d4[_0x60b6('0x32')]:_0x332d1a[_0x60b6('0x2e')];if(!_0x2fbc87[_0x60b6('0x2f')][_0x60b6('0x36')](_0x60b6('0x37'))){_0x2374d4['limit']=qs[_0x60b6('0x16')](_0x2fbc87[_0x60b6('0x2f')]['limit']);_0x2374d4[_0x60b6('0x19')]=qs[_0x60b6('0x19')](_0x2fbc87[_0x60b6('0x2f')]['offset']);}_0x2374d4[_0x60b6('0x38')]=qs[_0x60b6('0x39')](_0x2fbc87['query'][_0x60b6('0x39')]);_0x2374d4[_0x60b6('0x3a')]=qs[_0x60b6('0x31')](_[_0x60b6('0x3b')](_0x2fbc87[_0x60b6('0x2f')],_0x332d1a[_0x60b6('0x31')]),_0x182bfb);if(_0x2fbc87[_0x60b6('0x2f')]['filter']){_0x2374d4[_0x60b6('0x3a')]=_[_0x60b6('0x3c')](_0x2374d4[_0x60b6('0x3a')],{'$or':_['map'](_0x182bfb,function(_0x1be5cb){if(_0x1be5cb['type']!==_0x60b6('0x3d')){var _0x12ad60={};_0x12ad60[_0x1be5cb[_0x60b6('0x27')]]={'$like':'%'+_0x2fbc87[_0x60b6('0x2f')][_0x60b6('0x3e')]+'%'};return _0x12ad60;}})});}_0x2374d4=_[_0x60b6('0x3c')]({},_0x2374d4,_0x2fbc87[_0x60b6('0x3f')]);var _0x1e2eb1={'where':_0x2374d4[_0x60b6('0x3a')]};return db[_0x60b6('0x2b')][_0x60b6('0x18')](_0x1e2eb1)[_0x60b6('0x21')](function(_0x381330){_0x48dfd3[_0x60b6('0x18')]=_0x381330;if(_0x2fbc87[_0x60b6('0x2f')][_0x60b6('0x40')]){_0x2374d4[_0x60b6('0x41')]=[{'all':!![]}];}return db[_0x60b6('0x2b')][_0x60b6('0x42')](_0x2374d4);})[_0x60b6('0x21')](function(_0x327c92){_0x48dfd3[_0x60b6('0x43')]=_0x327c92;return _0x48dfd3;})[_0x60b6('0x21')](respondWithFilteredResult(_0x53cd4f,_0x2374d4))[_0x60b6('0x44')](handleError(_0x53cd4f,null));};exports[_0x60b6('0x45')]=function(_0x286785,_0x5da36d){var _0x58d273={'raw':!![],'where':{'id':_0x286785[_0x60b6('0x46')]['id']}},_0x216a4e={};_0x216a4e[_0x60b6('0x2e')]=_[_0x60b6('0x30')](db[_0x60b6('0x2b')][_0x60b6('0x2c')]);_0x216a4e[_0x60b6('0x2f')]=_[_0x60b6('0x30')](_0x286785[_0x60b6('0x2f')]);_0x216a4e['filters']=_[_0x60b6('0x33')](_0x216a4e[_0x60b6('0x2e')],_0x216a4e[_0x60b6('0x2f')]);_0x58d273[_0x60b6('0x32')]=_[_0x60b6('0x33')](_0x216a4e['model'],qs[_0x60b6('0x34')](_0x286785[_0x60b6('0x2f')]['fields']));_0x58d273[_0x60b6('0x32')]=_0x58d273['attributes'][_0x60b6('0x35')]?_0x58d273[_0x60b6('0x32')]:_0x216a4e[_0x60b6('0x2e')];if(_0x286785['query'][_0x60b6('0x40')]){_0x58d273[_0x60b6('0x41')]=[{'all':!![]}];}_0x58d273=_[_0x60b6('0x3c')]({},_0x58d273,_0x286785[_0x60b6('0x3f')]);return db[_0x60b6('0x2b')][_0x60b6('0x47')](_0x58d273)['then'](handleEntityNotFound(_0x5da36d,null))[_0x60b6('0x21')](respondWithResult(_0x5da36d,null))['catch'](handleError(_0x5da36d,null));};exports[_0x60b6('0x48')]=function(_0x1a7335,_0x5c5160){return db[_0x60b6('0x2b')][_0x60b6('0x48')](_0x1a7335['body'],{})['then'](respondWithResult(_0x5c5160,0xc9))[_0x60b6('0x44')](handleError(_0x5c5160,null));};exports[_0x60b6('0x20')]=function(_0x2bacf9,_0x79cda8){if(_0x2bacf9['body']['id']){delete _0x2bacf9[_0x60b6('0x49')]['id'];}return db[_0x60b6('0x2b')]['find']({'where':{'id':_0x2bacf9['params']['id']}})[_0x60b6('0x21')](handleEntityNotFound(_0x79cda8,null))[_0x60b6('0x21')](saveUpdates(_0x2bacf9['body'],null))[_0x60b6('0x21')](respondWithResult(_0x79cda8,null))['catch'](handleError(_0x79cda8,null));};exports['destroy']=function(_0x3d1137,_0xcaa29c){return db[_0x60b6('0x2b')][_0x60b6('0x47')]({'where':{'id':_0x3d1137[_0x60b6('0x46')]['id']}})['then'](handleEntityNotFound(_0xcaa29c,null))[_0x60b6('0x21')](removeEntity(_0xcaa29c,null))[_0x60b6('0x44')](handleError(_0xcaa29c,null));}; \ No newline at end of file +var _0xa7c8=['to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','ZohoField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','show','keys','find','create','body','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xa7c8,0x82));var _0x8a7c=function(_0x84e25e,_0x29211f){_0x84e25e=_0x84e25e-0x0;var _0x26a3ce=_0xa7c8[_0x84e25e];return _0x26a3ce;};'use strict';var emlformat=require(_0x8a7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a7c('0x1'));var jsonpatch=require(_0x8a7c('0x2'));var rp=require(_0x8a7c('0x3'));var moment=require('moment');var BPromise=require(_0x8a7c('0x4'));var Mustache=require('mustache');var util=require(_0x8a7c('0x5'));var path=require(_0x8a7c('0x6'));var sox=require(_0x8a7c('0x7'));var csv=require(_0x8a7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a7c('0x9'));var _=require('lodash');var squel=require(_0x8a7c('0xa'));var crypto=require(_0x8a7c('0xb'));var jsforce=require(_0x8a7c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a7c('0xd'));var Papa=require(_0x8a7c('0xe'));var Redis=require(_0x8a7c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a7c('0x10'));var hardwareService=require(_0x8a7c('0x11'));var logger=require(_0x8a7c('0x12'))(_0x8a7c('0x13'));var utils=require(_0x8a7c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8a7c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa89e8e,_0x25aea2){_0x25aea2=_0x25aea2||0xcc;return function(_0x7b2382){if(_0x7b2382){return _0xa89e8e[_0x8a7c('0x16')](_0x25aea2);}return _0xa89e8e[_0x8a7c('0x17')](_0x25aea2)[_0x8a7c('0x18')]();};}function respondWithResult(_0x682348,_0x1de2e3){_0x1de2e3=_0x1de2e3||0xc8;return function(_0xca119a){if(_0xca119a){return _0x682348[_0x8a7c('0x17')](_0x1de2e3)[_0x8a7c('0x19')](_0xca119a);}};}function respondWithFilteredResult(_0x218e02,_0xe5c029){return function(_0x3ad57b){if(_0x3ad57b){var _0x509eb5=typeof _0xe5c029[_0x8a7c('0x1a')]===_0x8a7c('0x1b')&&typeof _0xe5c029['limit']===_0x8a7c('0x1b');var _0xcb241b=_0x3ad57b[_0x8a7c('0x1c')];var _0x2615ec=_0x509eb5?0x0:_0xe5c029['offset'];var _0x61dd44=_0x509eb5?_0x3ad57b[_0x8a7c('0x1c')]:_0xe5c029['offset']+_0xe5c029[_0x8a7c('0x1d')];var _0x216f44;if(_0x61dd44>=_0xcb241b){_0x61dd44=_0xcb241b;_0x216f44=0xc8;}else{_0x216f44=0xce;}_0x218e02[_0x8a7c('0x17')](_0x216f44);return _0x218e02[_0x8a7c('0x1e')](_0x8a7c('0x1f'),_0x2615ec+'-'+_0x61dd44+'/'+_0xcb241b)[_0x8a7c('0x19')](_0x3ad57b);}return null;};}function patchUpdates(_0xddcfc5){return function(_0x57170f){try{jsonpatch[_0x8a7c('0x20')](_0x57170f,_0xddcfc5,!![]);}catch(_0x1408f5){return BPromise['reject'](_0x1408f5);}return _0x57170f['save']();};}function saveUpdates(_0xc39305,_0x377d52){return function(_0x1cafeb){if(_0x1cafeb){return _0x1cafeb[_0x8a7c('0x21')](_0xc39305)[_0x8a7c('0x22')](function(_0x4b6009){return _0x4b6009;});}return null;};}function removeEntity(_0x4234ad,_0x70efdc){return function(_0x21ab6b){if(_0x21ab6b){return _0x21ab6b[_0x8a7c('0x23')]()['then'](function(){_0x4234ad[_0x8a7c('0x17')](0xcc)[_0x8a7c('0x18')]();});}};}function handleEntityNotFound(_0x1d1c6b,_0x4443c4){return function(_0x4ef459){if(!_0x4ef459){_0x1d1c6b[_0x8a7c('0x16')](0x194);}return _0x4ef459;};}function handleError(_0x2c061d,_0x3384c6){_0x3384c6=_0x3384c6||0x1f4;return function(_0x21f8d8){logger[_0x8a7c('0x24')](_0x21f8d8['stack']);if(_0x21f8d8[_0x8a7c('0x25')]){delete _0x21f8d8['name'];}_0x2c061d['status'](_0x3384c6)[_0x8a7c('0x26')](_0x21f8d8);};}exports[_0x8a7c('0x27')]=function(_0x2e0e07,_0x35acdd){var _0x5d1cb0={},_0x398305={},_0x4ba87c={'count':0x0,'rows':[]};var _0x2eccd3=_[_0x8a7c('0x28')](db[_0x8a7c('0x29')]['rawAttributes'],function(_0x5001ea){return{'name':_0x5001ea[_0x8a7c('0x2a')],'type':_0x5001ea[_0x8a7c('0x2b')][_0x8a7c('0x2c')]};});_0x398305[_0x8a7c('0x2d')]=_[_0x8a7c('0x28')](_0x2eccd3,_0x8a7c('0x25'));_0x398305[_0x8a7c('0x2e')]=_['keys'](_0x2e0e07[_0x8a7c('0x2e')]);_0x398305[_0x8a7c('0x2f')]=_[_0x8a7c('0x30')](_0x398305[_0x8a7c('0x2d')],_0x398305[_0x8a7c('0x2e')]);_0x5d1cb0[_0x8a7c('0x31')]=_[_0x8a7c('0x30')](_0x398305[_0x8a7c('0x2d')],qs[_0x8a7c('0x32')](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x32')]));_0x5d1cb0[_0x8a7c('0x31')]=_0x5d1cb0[_0x8a7c('0x31')][_0x8a7c('0x33')]?_0x5d1cb0[_0x8a7c('0x31')]:_0x398305[_0x8a7c('0x2d')];if(!_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x34')]('nolimit')){_0x5d1cb0[_0x8a7c('0x1d')]=qs['limit'](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x1d')]);_0x5d1cb0[_0x8a7c('0x1a')]=qs[_0x8a7c('0x1a')](_0x2e0e07[_0x8a7c('0x2e')]['offset']);}_0x5d1cb0[_0x8a7c('0x35')]=qs[_0x8a7c('0x36')](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x36')]);_0x5d1cb0[_0x8a7c('0x37')]=qs['filters'](_[_0x8a7c('0x38')](_0x2e0e07[_0x8a7c('0x2e')],_0x398305[_0x8a7c('0x2f')]),_0x2eccd3);if(_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x39')]){_0x5d1cb0[_0x8a7c('0x37')]=_['merge'](_0x5d1cb0[_0x8a7c('0x37')],{'$or':_[_0x8a7c('0x28')](_0x2eccd3,function(_0x7c317a){if(_0x7c317a['type']!==_0x8a7c('0x3a')){var _0x3e904e={};_0x3e904e[_0x7c317a[_0x8a7c('0x25')]]={'$like':'%'+_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x39')]+'%'};return _0x3e904e;}})});}_0x5d1cb0=_['merge']({},_0x5d1cb0,_0x2e0e07['options']);var _0x2708c9={'where':_0x5d1cb0[_0x8a7c('0x37')]};return db[_0x8a7c('0x29')]['count'](_0x2708c9)[_0x8a7c('0x22')](function(_0x4e53aa){_0x4ba87c['count']=_0x4e53aa;if(_0x2e0e07['query'][_0x8a7c('0x3b')]){_0x5d1cb0[_0x8a7c('0x3c')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x5d1cb0);})[_0x8a7c('0x22')](function(_0x464295){_0x4ba87c[_0x8a7c('0x3d')]=_0x464295;return _0x4ba87c;})['then'](respondWithFilteredResult(_0x35acdd,_0x5d1cb0))['catch'](handleError(_0x35acdd,null));};exports[_0x8a7c('0x3e')]=function(_0x4f4ae3,_0x1d28c3){var _0x339c8c={'raw':!![],'where':{'id':_0x4f4ae3['params']['id']}},_0xdc108d={};_0xdc108d[_0x8a7c('0x2d')]=_[_0x8a7c('0x3f')](db[_0x8a7c('0x29')]['rawAttributes']);_0xdc108d[_0x8a7c('0x2e')]=_[_0x8a7c('0x3f')](_0x4f4ae3['query']);_0xdc108d[_0x8a7c('0x2f')]=_['intersection'](_0xdc108d['model'],_0xdc108d[_0x8a7c('0x2e')]);_0x339c8c[_0x8a7c('0x31')]=_[_0x8a7c('0x30')](_0xdc108d['model'],qs[_0x8a7c('0x32')](_0x4f4ae3['query'][_0x8a7c('0x32')]));_0x339c8c[_0x8a7c('0x31')]=_0x339c8c['attributes'][_0x8a7c('0x33')]?_0x339c8c[_0x8a7c('0x31')]:_0xdc108d[_0x8a7c('0x2d')];if(_0x4f4ae3[_0x8a7c('0x2e')][_0x8a7c('0x3b')]){_0x339c8c[_0x8a7c('0x3c')]=[{'all':!![]}];}_0x339c8c=_['merge']({},_0x339c8c,_0x4f4ae3['options']);return db[_0x8a7c('0x29')][_0x8a7c('0x40')](_0x339c8c)['then'](handleEntityNotFound(_0x1d28c3,null))[_0x8a7c('0x22')](respondWithResult(_0x1d28c3,null))['catch'](handleError(_0x1d28c3,null));};exports[_0x8a7c('0x41')]=function(_0xdea6bb,_0x7742bd){return db['ZohoField'][_0x8a7c('0x41')](_0xdea6bb[_0x8a7c('0x42')],{})[_0x8a7c('0x22')](respondWithResult(_0x7742bd,0xc9))['catch'](handleError(_0x7742bd,null));};exports[_0x8a7c('0x21')]=function(_0x3f6173,_0x4bfa61){if(_0x3f6173[_0x8a7c('0x42')]['id']){delete _0x3f6173[_0x8a7c('0x42')]['id'];}return db[_0x8a7c('0x29')][_0x8a7c('0x40')]({'where':{'id':_0x3f6173[_0x8a7c('0x43')]['id']}})[_0x8a7c('0x22')](handleEntityNotFound(_0x4bfa61,null))[_0x8a7c('0x22')](saveUpdates(_0x3f6173[_0x8a7c('0x42')],null))[_0x8a7c('0x22')](respondWithResult(_0x4bfa61,null))[_0x8a7c('0x44')](handleError(_0x4bfa61,null));};exports['destroy']=function(_0x5b906a,_0x2779e4){return db[_0x8a7c('0x29')][_0x8a7c('0x40')]({'where':{'id':_0x5b906a['params']['id']}})['then'](handleEntityNotFound(_0x2779e4,null))[_0x8a7c('0x22')](removeEntity(_0x2779e4,null))[_0x8a7c('0x44')](handleError(_0x2779e4,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 4323026..3f64004 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 _0x32b6=['int_zoho_fields','idField','FieldId','lodash','util','api','moment','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField'];(function(_0x2e785e,_0x232c0a){var _0x230f26=function(_0x55570a){while(--_0x55570a){_0x2e785e['push'](_0x2e785e['shift']());}};_0x230f26(++_0x232c0a);}(_0x32b6,0x1d1));var _0x632b=function(_0x3d75a9,_0x589d7f){_0x3d75a9=_0x3d75a9-0x0;var _0x504c43=_0x32b6[_0x3d75a9];return _0x504c43;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x632b('0xc'),_0x632b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0xb145,0xa3));var _0x5b14=function(_0x5a532f,_0x257137){_0x5a532f=_0x5a532f-0x0;var _0x14b4e8=_0xb145[_0x5a532f];return _0x14b4e8;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'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 f377591..bfd6518 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 _0x03db=['stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x4a1cd6,_0x4b1f11){var _0x2e17c0=function(_0x4fb8fa){while(--_0x4fb8fa){_0x4a1cd6['push'](_0x4a1cd6['shift']());}};_0x2e17c0(++_0x4b1f11);}(_0x03db,0x1d2));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb03d('0x0'));var util=require(_0xb03d('0x1'));var moment=require(_0xb03d('0x2'));var BPromise=require(_0xb03d('0x3'));var rs=require(_0xb03d('0x4'));var fs=require('fs');var Redis=require(_0xb03d('0x5'));var db=require(_0xb03d('0x6'))['db'];var utils=require(_0xb03d('0x7'));var logger=require('../../config/logger')(_0xb03d('0x8'));var config=require(_0xb03d('0x9'));var jayson=require(_0xb03d('0xa'));var client=jayson[_0xb03d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c9e8,_0x37a75c,_0xedb13b){return new BPromise(function(_0x167758,_0x48d5e3){return client[_0xb03d('0xc')](_0x39c9e8,_0xedb13b)[_0xb03d('0xd')](function(_0x56e410){logger[_0xb03d('0xe')](_0xb03d('0xf'),_0x37a75c,'request\x20sent');logger['debug'](_0xb03d('0x10'),_0x37a75c,'request\x20sent',JSON[_0xb03d('0x11')](_0x56e410));if(_0x56e410[_0xb03d('0x12')]){if(_0x56e410[_0xb03d('0x12')]['code']===0x1f4){logger[_0xb03d('0x12')](_0xb03d('0xf'),_0x37a75c,_0x56e410[_0xb03d('0x12')][_0xb03d('0x13')]);return _0x48d5e3(_0x56e410[_0xb03d('0x12')]['message']);}logger[_0xb03d('0x12')]('ZohoField,\x20%s,\x20%s',_0x37a75c,_0x56e410[_0xb03d('0x12')][_0xb03d('0x13')]);return _0x167758(_0x56e410[_0xb03d('0x12')][_0xb03d('0x13')]);}else{logger[_0xb03d('0xe')](_0xb03d('0xf'),_0x37a75c,_0xb03d('0x14'));_0x167758(_0x56e410[_0xb03d('0x15')][_0xb03d('0x13')]);}})[_0xb03d('0x16')](function(_0xb1cd5f){logger[_0xb03d('0x12')](_0xb03d('0xf'),_0x37a75c,_0xb1cd5f);_0x48d5e3(_0xb1cd5f);});});} \ No newline at end of file +var _0x4a91=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x108798,_0x339779){var _0x38168d=function(_0x5deef9){while(--_0x5deef9){_0x108798['push'](_0x108798['shift']());}};_0x38168d(++_0x339779);}(_0x4a91,0x16b));var _0x14a9=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x4a91[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x14a9('0x0'));var util=require(_0x14a9('0x1'));var moment=require('moment');var BPromise=require(_0x14a9('0x2'));var rs=require(_0x14a9('0x3'));var fs=require('fs');var Redis=require(_0x14a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14a9('0x5'));var logger=require('../../config/logger')(_0x14a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x14a9('0x7'));var client=jayson[_0x14a9('0x8')][_0x14a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d294f,_0x2a2d8d,_0x27e7c0){return new BPromise(function(_0x248322,_0x17fd11){return client[_0x14a9('0xa')](_0x1d294f,_0x27e7c0)['then'](function(_0x32c105){logger['info']('ZohoField,\x20%s,\x20%s',_0x2a2d8d,_0x14a9('0xb'));logger['debug'](_0x14a9('0xc'),_0x2a2d8d,_0x14a9('0xb'),JSON['stringify'](_0x32c105));if(_0x32c105['error']){if(_0x32c105[_0x14a9('0xd')][_0x14a9('0xe')]===0x1f4){logger[_0x14a9('0xd')](_0x14a9('0xf'),_0x2a2d8d,_0x32c105['error'][_0x14a9('0x10')]);return _0x17fd11(_0x32c105[_0x14a9('0xd')]['message']);}logger[_0x14a9('0xd')](_0x14a9('0xf'),_0x2a2d8d,_0x32c105[_0x14a9('0xd')][_0x14a9('0x10')]);return _0x248322(_0x32c105[_0x14a9('0xd')]['message']);}else{logger[_0x14a9('0x11')](_0x14a9('0xf'),_0x2a2d8d,'request\x20sent');_0x248322(_0x32c105[_0x14a9('0x12')]['message']);}})[_0x14a9('0x13')](function(_0x51d499){logger[_0x14a9('0xd')]('ZohoField,\x20%s,\x20%s',_0x2a2d8d,_0x51d499);_0x17fd11(_0x51d499);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index a8d86e0..b2ea9de 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x505873,_0x4dc437){var _0x2b4580=function(_0xfcf97c){while(--_0xfcf97c){_0x505873['push'](_0x505873['shift']());}};_0x2b4580(++_0x4dc437);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0xcb91[_0x1aed80];return _0x43961e;};'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(_0xfd1945,_0x29827d){var _0x53d788=function(_0x34cbb6){while(--_0x34cbb6){_0xfd1945['push'](_0xfd1945['shift']());}};_0x53d788(++_0x29827d);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7572733..29599a3 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 _0xe3dc=['INTEGER','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x1fc070,_0x35a89a){var _0x57b79c=function(_0x5d4c5a){while(--_0x5d4c5a){_0x1fc070['push'](_0x1fc070['shift']());}};_0x57b79c(++_0x35a89a);}(_0xe3dc,0x1e7));var _0xce3d=function(_0x361395,_0x37bf8a){_0x361395=_0x361395-0x0;var _0x14cdf4=_0xe3dc[_0x361395];return _0x14cdf4;};'use strict';var Sequelize=require(_0xce3d('0x0'));module[_0xce3d('0x1')]={'name':{'type':Sequelize[_0xce3d('0x2')],'allowNull':![],'unique':_0xce3d('0x3')},'version':{'type':Sequelize[_0xce3d('0x2')],'allowNull':![],'unique':_0xce3d('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xce3d('0x4')},'filename':{'type':Sequelize[_0xce3d('0x2')]},'path':{'type':Sequelize[_0xce3d('0x2')]},'type':{'type':Sequelize[_0xce3d('0x2')]},'size':{'type':Sequelize[_0xce3d('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xce3d('0x2')]},'logo':{'type':Sequelize[_0xce3d('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xce3d('0x2')]},'title':{'type':Sequelize[_0xce3d('0x2')]},'remoteUri':{'type':Sequelize[_0xce3d('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x4c18=['INTEGER','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4c18,0x18e));var _0x84c1=function(_0x5139df,_0x8acdbf){_0x5139df=_0x5139df-0x0;var _0x1249db=_0x4c18[_0x5139df];return _0x1249db;};'use strict';var Sequelize=require(_0x84c1('0x0'));module[_0x84c1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x84c1('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x84c1('0x2')},'main':{'type':Sequelize[_0x84c1('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x84c1('0x3')]},'path':{'type':Sequelize[_0x84c1('0x3')]},'type':{'type':Sequelize[_0x84c1('0x3')]},'size':{'type':Sequelize[_0x84c1('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x84c1('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x84c1('0x5')},'description':{'type':Sequelize[_0x84c1('0x3')]},'title':{'type':Sequelize[_0x84c1('0x3')]},'remoteUri':{'type':Sequelize[_0x84c1('0x3')]},'link':{'type':Sequelize[_0x84c1('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 29344a4..1258c12 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 _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x1c254f,_0x55e5e1){var _0x38892e=function(_0x2c48cc){while(--_0x2c48cc){_0x1c254f['push'](_0x1c254f['shift']());}};_0x38892e(++_0x55e5e1);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3d1430,_0x55038e){_0x3d1430=_0x3d1430-0x0;var _0x254a2c=_0x9f0e[_0x3d1430];return _0x254a2c;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file +var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','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','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x458f18,_0x3d2e64){var _0x4afb0e=function(_0xe5c943){while(--_0xe5c943){_0x458f18['push'](_0x458f18['shift']());}};_0x4afb0e(++_0x3d2e64);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4bf37a,_0x4a1540){_0x4bf37a=_0x4bf37a-0x0;var _0x20ab3c=_0xc1c6[_0x4bf37a];return _0x20ab3c;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 4245109..57370f8 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 _0xfefd=['path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment'];(function(_0xe20fdf,_0x4790a3){var _0x5eab04=function(_0x5612db){while(--_0x5612db){_0xe20fdf['push'](_0xe20fdf['shift']());}};_0x5eab04(++_0x4790a3);}(_0xfefd,0x1f3));var _0xdfef=function(_0x45ec0b,_0x260c5d){_0x45ec0b=_0x45ec0b-0x0;var _0x99a3d8=_0xfefd[_0x45ec0b];return _0x99a3d8;};'use strict';var _=require(_0xdfef('0x0'));var util=require(_0xdfef('0x1'));var logger=require(_0xdfef('0x2'))(_0xdfef('0x3'));var moment=require(_0xdfef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfef('0x5'));var rimraf=require(_0xdfef('0x6'));var config=require('../../config/environment');var attributes=require(_0xdfef('0x7'));module[_0xdfef('0x8')]=function(_0x308c01,_0x2bfd20){return _0x308c01[_0xdfef('0x9')](_0xdfef('0xa'),attributes,{'tableName':_0xdfef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8028=['./integration.attributes','exports','Integration','integrations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2cb4e5,_0x3bf79a){var _0x547b38=function(_0x3f940e){while(--_0x3f940e){_0x2cb4e5['push'](_0x2cb4e5['shift']());}};_0x547b38(++_0x3bf79a);}(_0x8028,0x10c));var _0x8802=function(_0x30cb33,_0x47cf5d){_0x30cb33=_0x30cb33-0x0;var _0x563ee0=_0x8028[_0x30cb33];return _0x563ee0;};'use strict';var _=require('lodash');var util=require(_0x8802('0x0'));var logger=require(_0x8802('0x1'))(_0x8802('0x2'));var moment=require(_0x8802('0x3'));var BPromise=require('bluebird');var rp=require(_0x8802('0x4'));var fs=require('fs');var path=require(_0x8802('0x5'));var rimraf=require(_0x8802('0x6'));var config=require(_0x8802('0x7'));var attributes=require(_0x8802('0x8'));module[_0x8802('0x9')]=function(_0x3e1bf3,_0x1875e5){return _0x3e1bf3['define'](_0x8802('0xa'),attributes,{'tableName':_0x8802('0xb'),'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 253825b..1d28398 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 _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(_0x315066,_0x3a189d){var _0x23cc54=function(_0x473ed5){while(--_0x473ed5){_0x315066['push'](_0x315066['shift']());}};_0x23cc54(++_0x3a189d);}(_0xef0f,0x168));var _0xfef0=function(_0x391523,_0x44c9c1){_0x391523=_0x391523-0x0;var _0x52a5ca=_0xef0f[_0x391523];return _0x52a5ca;};'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 +var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x66c8e8,_0x304ead){var _0x77f6e6=function(_0x18c7ce){while(--_0x18c7ce){_0x66c8e8['push'](_0x66c8e8['shift']());}};_0x77f6e6(++_0x304ead);}(_0xd943,0x15d));var _0x3d94=function(_0x1ab78a,_0x1805d9){_0x1ab78a=_0x1ab78a-0x0;var _0x1bdc69=_0xd943[_0x1ab78a];return _0x1bdc69;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 13b436b..953ed32 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 _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0xb08fe8,_0x3d6476){var _0x165657=function(_0x6d05af){while(--_0x6d05af){_0xb08fe8['push'](_0xb08fe8['shift']());}};_0x165657(++_0x3d6476);}(_0xef0f,0x168));var _0xfef0=function(_0x54e606,_0x953c05){_0x54e606=_0x54e606-0x0;var _0x1c2dff=_0xef0f[_0x54e606];return _0x1c2dff;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x41443d,_0x3e15e0){var _0x345a9d=function(_0x4591ee){while(--_0x4591ee){_0x41443d['push'](_0x41443d['shift']());}};_0x345a9d(++_0x3e15e0);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x5fab[_0x2ade6c];return _0x2cb372;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 33fcd22..9e1cab8 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 _0x0065=['SENT','RECEIVED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x5adddd,_0x3d86b8){var _0x1e08a9=function(_0x40510b){while(--_0x40510b){_0x5adddd['push'](_0x5adddd['shift']());}};_0x1e08a9(++_0x3d86b8);}(_0x0065,0x1ba));var _0x5006=function(_0x532b00,_0x4a0f5){_0x532b00=_0x532b00-0x0;var _0x19fef5=_0x0065[_0x532b00];return _0x19fef5;};'use strict';var Sequelize=require(_0x5006('0x0'));module[_0x5006('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x5006('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x5006('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5006('0x2')]},'calleridnum':{'type':Sequelize[_0x5006('0x2')]},'calleridname':{'type':Sequelize[_0x5006('0x2')]},'queue':{'type':Sequelize[_0x5006('0x2')]},'interface':{'type':Sequelize[_0x5006('0x2')]},'membername':{'type':Sequelize[_0x5006('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5006('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5006('0x3')]},'holdtime':{'type':Sequelize[_0x5006('0x4')]},'agentcomplete':{'type':Sequelize[_0x5006('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5006('0x3')]},'talktime':{'type':Sequelize[_0x5006('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5006('0x4')]},'reason':{'type':Sequelize[_0x5006('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5006('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5006('0x3')]},'agentdump':{'type':Sequelize[_0x5006('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5006('0x3')]},'lastevent':{'type':Sequelize[_0x5006('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5006('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5006('0x2')]},'language':{'type':Sequelize[_0x5006('0x2')]},'accountcode':{'type':Sequelize[_0x5006('0x2')]},'context':{'type':Sequelize[_0x5006('0x2')]},'exten':{'type':Sequelize[_0x5006('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5006('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5006('0x2')]},'destcalleridname':{'type':Sequelize[_0x5006('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5006('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5006('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x5006('0x2')]},'destcontext':{'type':Sequelize[_0x5006('0x2')]},'destexten':{'type':Sequelize[_0x5006('0x2')]},'destpriority':{'type':Sequelize[_0x5006('0x2')]},'destuniqueid':{'type':Sequelize[_0x5006('0x2')]},'messageId':{'type':Sequelize[_0x5006('0x2')]},'inReplyTo':{'type':Sequelize[_0x5006('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x5006('0x2')]},'to':{'type':Sequelize[_0x5006('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x5006('0x6')]},'html':{'type':Sequelize[_0x5006('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x5006('0x7')](_0x5006('0x8'),'SENDING',_0x5006('0x9'),'FAILED')},'url':{'type':Sequelize[_0x5006('0x2')]},'app':{'type':Sequelize[_0x5006('0x2')]},'appdata':{'type':Sequelize[_0x5006('0x2')]},'projectId':{'type':Sequelize[_0x5006('0x4')]}}; \ No newline at end of file +var _0xe478=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x5f481b,_0x3d4f4d){var _0x2f9650=function(_0x371b13){while(--_0x371b13){_0x5f481b['push'](_0x5f481b['shift']());}};_0x2f9650(++_0x3d4f4d);}(_0xe478,0x13a));var _0x8e47=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xe478[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x8e47('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8e47('0x1')]},'exitStatus':{'type':Sequelize[_0x8e47('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8e47('0x2')]},'contacts':{'type':Sequelize[_0x8e47('0x1')]},'uniqueid':{'type':Sequelize[_0x8e47('0x1')]},'calleridnum':{'type':Sequelize[_0x8e47('0x1')]},'calleridname':{'type':Sequelize[_0x8e47('0x1')]},'queue':{'type':Sequelize[_0x8e47('0x1')]},'interface':{'type':Sequelize[_0x8e47('0x1')]},'membername':{'type':Sequelize[_0x8e47('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8e47('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8e47('0x3')]},'holdtime':{'type':Sequelize[_0x8e47('0x2')]},'agentcomplete':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8e47('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8e47('0x2')]},'reason':{'type':Sequelize[_0x8e47('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8e47('0x3')]},'agentdump':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8e47('0x3')]},'lastevent':{'type':Sequelize[_0x8e47('0x1')]},'channel':{'type':Sequelize[_0x8e47('0x1')]},'channelstate':{'type':Sequelize[_0x8e47('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8e47('0x1')]},'connectedlinename':{'type':Sequelize[_0x8e47('0x1')]},'language':{'type':Sequelize[_0x8e47('0x1')]},'accountcode':{'type':Sequelize[_0x8e47('0x1')]},'context':{'type':Sequelize[_0x8e47('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8e47('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8e47('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8e47('0x1')]},'destcalleridname':{'type':Sequelize[_0x8e47('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8e47('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8e47('0x1')]},'destaccountcode':{'type':Sequelize[_0x8e47('0x1')]},'destcontext':{'type':Sequelize[_0x8e47('0x1')]},'destexten':{'type':Sequelize[_0x8e47('0x1')]},'destpriority':{'type':Sequelize[_0x8e47('0x1')]},'destuniqueid':{'type':Sequelize[_0x8e47('0x1')]},'messageId':{'type':Sequelize[_0x8e47('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x8e47('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x8e47('0x5')]},'html':{'type':Sequelize[_0x8e47('0x5')]},'text':{'type':Sequelize[_0x8e47('0x5')]},'status':{'type':Sequelize['ENUM']('SENT',_0x8e47('0x6'),_0x8e47('0x7'),_0x8e47('0x8'))},'url':{'type':Sequelize[_0x8e47('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8e47('0x1')]},'projectId':{'type':Sequelize[_0x8e47('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 9cab459..919c8e2 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 _0xea71=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','IntegrationReport','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x58914c,_0x383f7d){var _0x34c2f4=function(_0xe841bb){while(--_0xe841bb){_0x58914c['push'](_0x58914c['shift']());}};_0x34c2f4(++_0x383f7d);}(_0xea71,0x120));var _0x1ea7=function(_0x19bea2,_0x518042){_0x19bea2=_0x19bea2-0x0;var _0x1125ae=_0xea71[_0x19bea2];return _0x1125ae;};'use strict';var emlformat=require(_0x1ea7('0x0'));var rimraf=require(_0x1ea7('0x1'));var zipdir=require(_0x1ea7('0x2'));var jsonpatch=require(_0x1ea7('0x3'));var rp=require(_0x1ea7('0x4'));var moment=require(_0x1ea7('0x5'));var BPromise=require(_0x1ea7('0x6'));var Mustache=require(_0x1ea7('0x7'));var util=require(_0x1ea7('0x8'));var path=require(_0x1ea7('0x9'));var sox=require(_0x1ea7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ea7('0xb'));var squel=require(_0x1ea7('0xc'));var crypto=require(_0x1ea7('0xd'));var jsforce=require(_0x1ea7('0xe'));var deskjs=require(_0x1ea7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1ea7('0x10'));var Papa=require('papaparse');var Redis=require(_0x1ea7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ea7('0x12'));var as=require(_0x1ea7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ea7('0x14'));var utils=require(_0x1ea7('0x15'));var config=require(_0x1ea7('0x16'));var licenseUtil=require(_0x1ea7('0x17'));var db=require(_0x1ea7('0x18'))['db'];function respondWithStatusCode(_0x67eba6,_0xe723b9){_0xe723b9=_0xe723b9||0xcc;return function(_0x368fe9){if(_0x368fe9){return _0x67eba6[_0x1ea7('0x19')](_0xe723b9);}return _0x67eba6[_0x1ea7('0x1a')](_0xe723b9)[_0x1ea7('0x1b')]();};}function respondWithResult(_0x4a9754,_0x5f4fbc){_0x5f4fbc=_0x5f4fbc||0xc8;return function(_0x48f9fa){if(_0x48f9fa){return _0x4a9754[_0x1ea7('0x1a')](_0x5f4fbc)[_0x1ea7('0x1c')](_0x48f9fa);}};}function respondWithFilteredResult(_0x22e58e,_0x5d1b95){return function(_0x1c47f6){if(_0x1c47f6){var _0x56406c=typeof _0x5d1b95[_0x1ea7('0x1d')]==='undefined'&&typeof _0x5d1b95[_0x1ea7('0x1e')]===_0x1ea7('0x1f');var _0x37f689=_0x1c47f6['count'];var _0x967c06=_0x56406c?0x0:_0x5d1b95[_0x1ea7('0x1d')];var _0x470c5a=_0x56406c?_0x1c47f6[_0x1ea7('0x20')]:_0x5d1b95[_0x1ea7('0x1d')]+_0x5d1b95[_0x1ea7('0x1e')];var _0x167d28;if(_0x470c5a>=_0x37f689){_0x470c5a=_0x37f689;_0x167d28=0xc8;}else{_0x167d28=0xce;}_0x22e58e[_0x1ea7('0x1a')](_0x167d28);return _0x22e58e[_0x1ea7('0x21')](_0x1ea7('0x22'),_0x967c06+'-'+_0x470c5a+'/'+_0x37f689)['json'](_0x1c47f6);}return null;};}function patchUpdates(_0x510bbf){return function(_0x2ed31e){try{jsonpatch[_0x1ea7('0x23')](_0x2ed31e,_0x510bbf,!![]);}catch(_0x37ab6b){return BPromise['reject'](_0x37ab6b);}return _0x2ed31e[_0x1ea7('0x24')]();};}function saveUpdates(_0x4882c5,_0x34e990){return function(_0x4c2d57){if(_0x4c2d57){return _0x4c2d57[_0x1ea7('0x25')](_0x4882c5)[_0x1ea7('0x26')](function(_0x147e48){return _0x147e48;});}return null;};}function removeEntity(_0x20df6f,_0x27997d){return function(_0x13945d){if(_0x13945d){return _0x13945d[_0x1ea7('0x27')]()[_0x1ea7('0x26')](function(){_0x20df6f[_0x1ea7('0x1a')](0xcc)[_0x1ea7('0x1b')]();});}};}function handleEntityNotFound(_0x7fefdb,_0x36c38d){return function(_0x248149){if(!_0x248149){_0x7fefdb['sendStatus'](0x194);}return _0x248149;};}function handleError(_0x42a87b,_0x1f144c){_0x1f144c=_0x1f144c||0x1f4;return function(_0xe65d8d){logger[_0x1ea7('0x28')](_0xe65d8d[_0x1ea7('0x29')]);if(_0xe65d8d[_0x1ea7('0x2a')]){delete _0xe65d8d[_0x1ea7('0x2a')];}_0x42a87b[_0x1ea7('0x1a')](_0x1f144c)[_0x1ea7('0x2b')](_0xe65d8d);};}exports[_0x1ea7('0x2c')]=function(_0x92cac6,_0x4743f1){var _0x36afed={},_0x285532={},_0x30a5b7={'count':0x0,'rows':[]};var _0x45230c=_[_0x1ea7('0x2d')](db['IntegrationReport'][_0x1ea7('0x2e')],function(_0xa800a1){return{'name':_0xa800a1[_0x1ea7('0x2f')],'type':_0xa800a1['type'][_0x1ea7('0x30')]};});_0x285532[_0x1ea7('0x31')]=_[_0x1ea7('0x2d')](_0x45230c,_0x1ea7('0x2a'));_0x285532[_0x1ea7('0x32')]=_[_0x1ea7('0x33')](_0x92cac6['query']);_0x285532[_0x1ea7('0x34')]=_['intersection'](_0x285532[_0x1ea7('0x31')],_0x285532['query']);_0x36afed[_0x1ea7('0x35')]=_['intersection'](_0x285532['model'],qs[_0x1ea7('0x36')](_0x92cac6['query'][_0x1ea7('0x36')]));_0x36afed[_0x1ea7('0x35')]=_0x36afed[_0x1ea7('0x35')][_0x1ea7('0x37')]?_0x36afed['attributes']:_0x285532[_0x1ea7('0x31')];if(!_0x92cac6[_0x1ea7('0x32')][_0x1ea7('0x38')](_0x1ea7('0x39'))){_0x36afed[_0x1ea7('0x1e')]=qs[_0x1ea7('0x1e')](_0x92cac6[_0x1ea7('0x32')][_0x1ea7('0x1e')]);_0x36afed[_0x1ea7('0x1d')]=qs[_0x1ea7('0x1d')](_0x92cac6[_0x1ea7('0x32')][_0x1ea7('0x1d')]);}_0x36afed[_0x1ea7('0x3a')]=qs[_0x1ea7('0x3b')](_0x92cac6[_0x1ea7('0x32')]['sort']);_0x36afed[_0x1ea7('0x3c')]=qs[_0x1ea7('0x34')](_[_0x1ea7('0x3d')](_0x92cac6[_0x1ea7('0x32')],_0x285532[_0x1ea7('0x34')]),_0x45230c);if(_0x92cac6['query'][_0x1ea7('0x3e')]){_0x36afed[_0x1ea7('0x3c')]=_[_0x1ea7('0x3f')](_0x36afed['where'],{'$or':_[_0x1ea7('0x2d')](_0x45230c,function(_0x10247d){if(_0x10247d['type']!=='VIRTUAL'){var _0x214819={};_0x214819[_0x10247d['name']]={'$like':'%'+_0x92cac6['query'][_0x1ea7('0x3e')]+'%'};return _0x214819;}})});}_0x36afed=_['merge']({},_0x36afed,_0x92cac6[_0x1ea7('0x40')]);var _0x404871={'where':_0x36afed['where']};return db[_0x1ea7('0x41')][_0x1ea7('0x20')](_0x404871)[_0x1ea7('0x26')](function(_0x58dbf2){_0x30a5b7[_0x1ea7('0x20')]=_0x58dbf2;if(_0x92cac6[_0x1ea7('0x32')]['includeAll']){_0x36afed[_0x1ea7('0x42')]=[{'all':!![]}];}return db[_0x1ea7('0x41')][_0x1ea7('0x43')](_0x36afed);})['then'](function(_0x178987){_0x30a5b7[_0x1ea7('0x44')]=_0x178987;return _0x30a5b7;})[_0x1ea7('0x26')](respondWithFilteredResult(_0x4743f1,_0x36afed))[_0x1ea7('0x45')](handleError(_0x4743f1,null));};exports[_0x1ea7('0x46')]=function(_0x3267d0,_0x58ea5c){var _0x1ba190={'raw':![],'where':{'id':_0x3267d0[_0x1ea7('0x47')]['id']}},_0x4e0e6a={};_0x4e0e6a[_0x1ea7('0x31')]=_[_0x1ea7('0x33')](db[_0x1ea7('0x41')]['rawAttributes']);_0x4e0e6a[_0x1ea7('0x32')]=_[_0x1ea7('0x33')](_0x3267d0['query']);_0x4e0e6a[_0x1ea7('0x34')]=_[_0x1ea7('0x48')](_0x4e0e6a['model'],_0x4e0e6a['query']);_0x1ba190[_0x1ea7('0x35')]=_[_0x1ea7('0x48')](_0x4e0e6a[_0x1ea7('0x31')],qs['fields'](_0x3267d0['query']['fields']));_0x1ba190[_0x1ea7('0x35')]=_0x1ba190['attributes'][_0x1ea7('0x37')]?_0x1ba190[_0x1ea7('0x35')]:_0x4e0e6a[_0x1ea7('0x31')];if(_0x3267d0[_0x1ea7('0x32')][_0x1ea7('0x49')]){_0x1ba190[_0x1ea7('0x42')]=[{'all':!![]}];}_0x1ba190=_[_0x1ea7('0x3f')]({},_0x1ba190,_0x3267d0[_0x1ea7('0x40')]);return db[_0x1ea7('0x41')][_0x1ea7('0x4a')](_0x1ba190)['then'](handleEntityNotFound(_0x58ea5c,null))[_0x1ea7('0x26')](respondWithResult(_0x58ea5c,null))[_0x1ea7('0x45')](handleError(_0x58ea5c,null));};exports[_0x1ea7('0x4b')]=function(_0x470706,_0x5ba36f){return db['IntegrationReport'][_0x1ea7('0x4b')](_0x470706[_0x1ea7('0x4c')],{})[_0x1ea7('0x26')](respondWithResult(_0x5ba36f,0xc9))[_0x1ea7('0x45')](handleError(_0x5ba36f,null));};exports[_0x1ea7('0x25')]=function(_0xa96a9,_0x463c16){if(_0xa96a9['body']['id']){delete _0xa96a9[_0x1ea7('0x4c')]['id'];}return db['IntegrationReport'][_0x1ea7('0x4a')]({'where':{'id':_0xa96a9[_0x1ea7('0x47')]['id']}})['then'](handleEntityNotFound(_0x463c16,null))[_0x1ea7('0x26')](saveUpdates(_0xa96a9[_0x1ea7('0x4c')],null))[_0x1ea7('0x26')](respondWithResult(_0x463c16,null))[_0x1ea7('0x45')](handleError(_0x463c16,null));};exports['destroy']=function(_0x18903d,_0x4fe02d){return db[_0x1ea7('0x41')]['find']({'where':{'id':_0x18903d[_0x1ea7('0x47')]['id']}})[_0x1ea7('0x26')](handleEntityNotFound(_0x4fe02d,null))[_0x1ea7('0x26')](removeEntity(_0x4fe02d,null))['catch'](handleError(_0x4fe02d,null));};exports['describe']=function(_0x114624,_0x37578f){return db['IntegrationReport'][_0x1ea7('0x4d')]()['then'](respondWithResult(_0x37578f,null))[_0x1ea7('0x45')](handleError(_0x37578f,null));}; \ No newline at end of file +var _0x20b8=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','params','find','describe','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x51b8ab,_0x256429){var _0x3a8abb=function(_0x2cf07a){while(--_0x2cf07a){_0x51b8ab['push'](_0x51b8ab['shift']());}};_0x3a8abb(++_0x256429);}(_0x20b8,0x152));var _0x820b=function(_0x66b4a,_0x3c651b){_0x66b4a=_0x66b4a-0x0;var _0x44c585=_0x20b8[_0x66b4a];return _0x44c585;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x820b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x820b('0x1'));var BPromise=require(_0x820b('0x2'));var Mustache=require(_0x820b('0x3'));var util=require(_0x820b('0x4'));var path=require(_0x820b('0x5'));var sox=require(_0x820b('0x6'));var csv=require(_0x820b('0x7'));var ejs=require(_0x820b('0x8'));var fs=require('fs');var fs_extra=require(_0x820b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x820b('0xa'));var jsforce=require(_0x820b('0xb'));var deskjs=require(_0x820b('0xc'));var toCsv=require(_0x820b('0x7'));var querystring=require('querystring');var Papa=require(_0x820b('0xd'));var Redis=require(_0x820b('0xe'));var authService=require(_0x820b('0xf'));var qs=require(_0x820b('0x10'));var as=require(_0x820b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x820b('0x12'))('api');var utils=require(_0x820b('0x13'));var config=require(_0x820b('0x14'));var licenseUtil=require(_0x820b('0x15'));var db=require(_0x820b('0x16'))['db'];function respondWithStatusCode(_0x3791fa,_0x3885da){_0x3885da=_0x3885da||0xcc;return function(_0x2fd4cd){if(_0x2fd4cd){return _0x3791fa[_0x820b('0x17')](_0x3885da);}return _0x3791fa[_0x820b('0x18')](_0x3885da)[_0x820b('0x19')]();};}function respondWithResult(_0x491a2c,_0x4aa38e){_0x4aa38e=_0x4aa38e||0xc8;return function(_0x234f02){if(_0x234f02){return _0x491a2c[_0x820b('0x18')](_0x4aa38e)[_0x820b('0x1a')](_0x234f02);}};}function respondWithFilteredResult(_0xeab538,_0x4bb938){return function(_0x255e3d){if(_0x255e3d){var _0x57d99c=typeof _0x4bb938[_0x820b('0x1b')]===_0x820b('0x1c')&&typeof _0x4bb938[_0x820b('0x1d')]===_0x820b('0x1c');var _0x45332b=_0x255e3d['count'];var _0x578e3b=_0x57d99c?0x0:_0x4bb938[_0x820b('0x1b')];var _0x11c7cb=_0x57d99c?_0x255e3d[_0x820b('0x1e')]:_0x4bb938[_0x820b('0x1b')]+_0x4bb938[_0x820b('0x1d')];var _0x519cd7;if(_0x11c7cb>=_0x45332b){_0x11c7cb=_0x45332b;_0x519cd7=0xc8;}else{_0x519cd7=0xce;}_0xeab538[_0x820b('0x18')](_0x519cd7);return _0xeab538[_0x820b('0x1f')](_0x820b('0x20'),_0x578e3b+'-'+_0x11c7cb+'/'+_0x45332b)[_0x820b('0x1a')](_0x255e3d);}return null;};}function patchUpdates(_0x4d67cb){return function(_0x5670bb){try{jsonpatch[_0x820b('0x21')](_0x5670bb,_0x4d67cb,!![]);}catch(_0x8b8cfb){return BPromise[_0x820b('0x22')](_0x8b8cfb);}return _0x5670bb[_0x820b('0x23')]();};}function saveUpdates(_0x1b261a,_0x18e919){return function(_0x5982fe){if(_0x5982fe){return _0x5982fe[_0x820b('0x24')](_0x1b261a)[_0x820b('0x25')](function(_0x5994d9){return _0x5994d9;});}return null;};}function removeEntity(_0x388db5,_0x5a7d25){return function(_0x4f9bab){if(_0x4f9bab){return _0x4f9bab[_0x820b('0x26')]()[_0x820b('0x25')](function(){_0x388db5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3912e7,_0x3a978a){return function(_0x59413d){if(!_0x59413d){_0x3912e7[_0x820b('0x17')](0x194);}return _0x59413d;};}function handleError(_0x43f6d7,_0x572e6c){_0x572e6c=_0x572e6c||0x1f4;return function(_0x5ac2a9){logger[_0x820b('0x27')](_0x5ac2a9[_0x820b('0x28')]);if(_0x5ac2a9[_0x820b('0x29')]){delete _0x5ac2a9['name'];}_0x43f6d7['status'](_0x572e6c)['send'](_0x5ac2a9);};}exports[_0x820b('0x2a')]=function(_0x295fd6,_0x53d324){var _0xef1e45={},_0x477e2b={},_0x2aba96={'count':0x0,'rows':[]};var _0x58bee9=_[_0x820b('0x2b')](db[_0x820b('0x2c')][_0x820b('0x2d')],function(_0x133069){return{'name':_0x133069[_0x820b('0x2e')],'type':_0x133069[_0x820b('0x2f')]['key']};});_0x477e2b[_0x820b('0x30')]=_[_0x820b('0x2b')](_0x58bee9,'name');_0x477e2b[_0x820b('0x31')]=_[_0x820b('0x32')](_0x295fd6['query']);_0x477e2b['filters']=_[_0x820b('0x33')](_0x477e2b['model'],_0x477e2b[_0x820b('0x31')]);_0xef1e45[_0x820b('0x34')]=_['intersection'](_0x477e2b[_0x820b('0x30')],qs[_0x820b('0x35')](_0x295fd6['query'][_0x820b('0x35')]));_0xef1e45[_0x820b('0x34')]=_0xef1e45[_0x820b('0x34')][_0x820b('0x36')]?_0xef1e45[_0x820b('0x34')]:_0x477e2b['model'];if(!_0x295fd6[_0x820b('0x31')]['hasOwnProperty'](_0x820b('0x37'))){_0xef1e45['limit']=qs['limit'](_0x295fd6['query'][_0x820b('0x1d')]);_0xef1e45[_0x820b('0x1b')]=qs[_0x820b('0x1b')](_0x295fd6[_0x820b('0x31')][_0x820b('0x1b')]);}_0xef1e45[_0x820b('0x38')]=qs[_0x820b('0x39')](_0x295fd6[_0x820b('0x31')][_0x820b('0x39')]);_0xef1e45[_0x820b('0x3a')]=qs[_0x820b('0x3b')](_['pick'](_0x295fd6[_0x820b('0x31')],_0x477e2b[_0x820b('0x3b')]),_0x58bee9);if(_0x295fd6[_0x820b('0x31')][_0x820b('0x3c')]){_0xef1e45['where']=_[_0x820b('0x3d')](_0xef1e45[_0x820b('0x3a')],{'$or':_['map'](_0x58bee9,function(_0x270701){if(_0x270701[_0x820b('0x2f')]!==_0x820b('0x3e')){var _0x5d93d7={};_0x5d93d7[_0x270701[_0x820b('0x29')]]={'$like':'%'+_0x295fd6[_0x820b('0x31')][_0x820b('0x3c')]+'%'};return _0x5d93d7;}})});}_0xef1e45=_[_0x820b('0x3d')]({},_0xef1e45,_0x295fd6[_0x820b('0x3f')]);var _0x3a1e08={'where':_0xef1e45[_0x820b('0x3a')]};return db[_0x820b('0x2c')]['count'](_0x3a1e08)['then'](function(_0x3898ec){_0x2aba96[_0x820b('0x1e')]=_0x3898ec;if(_0x295fd6['query'][_0x820b('0x40')]){_0xef1e45[_0x820b('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x820b('0x42')](_0xef1e45);})[_0x820b('0x25')](function(_0x1fe37c){_0x2aba96['rows']=_0x1fe37c;return _0x2aba96;})['then'](respondWithFilteredResult(_0x53d324,_0xef1e45))['catch'](handleError(_0x53d324,null));};exports[_0x820b('0x43')]=function(_0x5a3cca,_0xc16907){var _0x37df9b={'raw':![],'where':{'id':_0x5a3cca['params']['id']}},_0x1e19cf={};_0x1e19cf['model']=_['keys'](db[_0x820b('0x2c')]['rawAttributes']);_0x1e19cf[_0x820b('0x31')]=_[_0x820b('0x32')](_0x5a3cca[_0x820b('0x31')]);_0x1e19cf[_0x820b('0x3b')]=_[_0x820b('0x33')](_0x1e19cf['model'],_0x1e19cf['query']);_0x37df9b[_0x820b('0x34')]=_[_0x820b('0x33')](_0x1e19cf['model'],qs[_0x820b('0x35')](_0x5a3cca[_0x820b('0x31')][_0x820b('0x35')]));_0x37df9b[_0x820b('0x34')]=_0x37df9b[_0x820b('0x34')][_0x820b('0x36')]?_0x37df9b['attributes']:_0x1e19cf[_0x820b('0x30')];if(_0x5a3cca[_0x820b('0x31')][_0x820b('0x40')]){_0x37df9b['include']=[{'all':!![]}];}_0x37df9b=_[_0x820b('0x3d')]({},_0x37df9b,_0x5a3cca[_0x820b('0x3f')]);return db[_0x820b('0x2c')]['find'](_0x37df9b)[_0x820b('0x25')](handleEntityNotFound(_0xc16907,null))['then'](respondWithResult(_0xc16907,null))[_0x820b('0x44')](handleError(_0xc16907,null));};exports[_0x820b('0x45')]=function(_0xaa2dd6,_0xad55c6){return db[_0x820b('0x2c')][_0x820b('0x45')](_0xaa2dd6[_0x820b('0x46')],{})[_0x820b('0x25')](respondWithResult(_0xad55c6,0xc9))[_0x820b('0x44')](handleError(_0xad55c6,null));};exports[_0x820b('0x24')]=function(_0x25c87a,_0x3c9271){if(_0x25c87a[_0x820b('0x46')]['id']){delete _0x25c87a[_0x820b('0x46')]['id'];}return db[_0x820b('0x2c')]['find']({'where':{'id':_0x25c87a[_0x820b('0x47')]['id']}})[_0x820b('0x25')](handleEntityNotFound(_0x3c9271,null))[_0x820b('0x25')](saveUpdates(_0x25c87a[_0x820b('0x46')],null))[_0x820b('0x25')](respondWithResult(_0x3c9271,null))[_0x820b('0x44')](handleError(_0x3c9271,null));};exports['destroy']=function(_0x2f8399,_0x4f271d){return db[_0x820b('0x2c')][_0x820b('0x48')]({'where':{'id':_0x2f8399[_0x820b('0x47')]['id']}})[_0x820b('0x25')](handleEntityNotFound(_0x4f271d,null))['then'](removeEntity(_0x4f271d,null))[_0x820b('0x44')](handleError(_0x4f271d,null));};exports[_0x820b('0x49')]=function(_0x384650,_0x4b162d){return db[_0x820b('0x2c')]['describe']()['then'](respondWithResult(_0x4b162d,null))[_0x820b('0x44')](handleError(_0x4b162d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 380591e..1be2d9b 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 _0x918c=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','path'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x918c,0xd7));var _0xc918=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x918c[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0xc918('0x0'));var logger=require(_0xc918('0x1'))(_0xc918('0x2'));var moment=require(_0xc918('0x3'));var BPromise=require(_0xc918('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc918('0x5'));var rimraf=require(_0xc918('0x6'));var config=require(_0xc918('0x7'));var attributes=require(_0xc918('0x8'));module[_0xc918('0x9')]=function(_0x2275a6,_0x392779){return _0x2275a6[_0xc918('0xa')](_0xc918('0xb'),attributes,{'tableName':_0xc918('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfa6=['IntegrationReport','report_integration','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x3cc751,_0x38b8ff){var _0x3956a2=function(_0x237cbc){while(--_0x237cbc){_0x3cc751['push'](_0x3cc751['shift']());}};_0x3956a2(++_0x38b8ff);}(_0xdfa6,0x136));var _0x6dfa=function(_0x3cb6b7,_0x42b5f7){_0x3cb6b7=_0x3cb6b7-0x0;var _0x5c3622=_0xdfa6[_0x3cb6b7];return _0x5c3622;};'use strict';var _=require(_0x6dfa('0x0'));var util=require(_0x6dfa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6dfa('0x2'));var rp=require(_0x6dfa('0x3'));var fs=require('fs');var path=require(_0x6dfa('0x4'));var rimraf=require(_0x6dfa('0x5'));var config=require(_0x6dfa('0x6'));var attributes=require(_0x6dfa('0x7'));module[_0x6dfa('0x8')]=function(_0x3807f3,_0xcef5fc){return _0x3807f3['define'](_0x6dfa('0x9'),attributes,{'tableName':_0x6dfa('0xa'),'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 f69719d..917c369 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x53ec,0x192));var _0xc53e=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0x53ec[_0x334f9a];return _0x2b219d;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x24ead3,_0xd59aaf){var _0x3f876a=function(_0x456ba9){while(--_0x456ba9){_0x24ead3['push'](_0x24ead3['shift']());}};_0x3f876a(++_0xd59aaf);}(_0xdb28,0x106));var _0x8db2=function(_0x1c6b1e,_0x471eff){_0x1c6b1e=_0x1c6b1e-0x0;var _0x48ab00=_0xdb28[_0x1c6b1e];return _0x48ab00;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index fd69838..f369961 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 _0x71ad=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post'];(function(_0x193e3d,_0x53f65f){var _0x951c99=function(_0x286ab9){while(--_0x286ab9){_0x193e3d['push'](_0x193e3d['shift']());}};_0x951c99(++_0x53f65f);}(_0x71ad,0xee));var _0xd71a=function(_0x23c8a6,_0xac4e8){_0x23c8a6=_0x23c8a6-0x0;var _0x36d34c=_0x71ad[_0x23c8a6];return _0x36d34c;};'use strict';var multer=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var path=require('path');var timeout=require(_0xd71a('0x2'));var express=require('express');var router=express[_0xd71a('0x3')]();var fs_extra=require(_0xd71a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd71a('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xd71a('0x6')]('/',auth['isAuthenticated'](),controller[_0xd71a('0x7')]);router[_0xd71a('0x6')](_0xd71a('0x8'),auth[_0xd71a('0x9')](),controller[_0xd71a('0xa')]);router[_0xd71a('0x6')](_0xd71a('0xb'),auth['isAuthenticated'](),controller[_0xd71a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd71a('0xd')]);router[_0xd71a('0xe')](_0xd71a('0xb'),auth[_0xd71a('0x9')](),controller[_0xd71a('0xf')]);router[_0xd71a('0xe')](_0xd71a('0x10'),auth[_0xd71a('0x9')](),controller[_0xd71a('0x11')]);router[_0xd71a('0x12')]('/:id',auth[_0xd71a('0x9')](),controller[_0xd71a('0x13')]);router[_0xd71a('0x14')](_0xd71a('0x8'),auth[_0xd71a('0x9')](),controller[_0xd71a('0x15')]);module[_0xd71a('0x16')]=router; \ No newline at end of file +var _0x5d17=['put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x2e05ad,_0x2fd1c3){var _0x37f0d9=function(_0x419a10){while(--_0x419a10){_0x2e05ad['push'](_0x2e05ad['shift']());}};_0x37f0d9(++_0x2fd1c3);}(_0x5d17,0x114));var _0x75d1=function(_0x35c1c8,_0x14f618){_0x35c1c8=_0x35c1c8-0x0;var _0x3b0377=_0x5d17[_0x35c1c8];return _0x3b0377;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router[_0x75d1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x75d1('0xe')](_0x75d1('0xd'),auth['isAuthenticated'](),controller[_0x75d1('0xf')]);router[_0x75d1('0xe')](_0x75d1('0x10'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);router[_0x75d1('0x12')]('/:id',auth[_0x75d1('0xb')](),controller[_0x75d1('0x13')]);router[_0x75d1('0x14')](_0x75d1('0xa'),auth['isAuthenticated'](),controller['destroy']);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 1a85023..3fcc549 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 _0xa752=['exports','STRING','sequelize'];(function(_0x39195b,_0x3d5f81){var _0x149513=function(_0x5ead74){while(--_0x5ead74){_0x39195b['push'](_0x39195b['shift']());}};_0x149513(++_0x3d5f81);}(_0xa752,0x1c1));var _0x2a75=function(_0x5f01f0,_0x44c6f2){_0x5f01f0=_0x5f01f0-0x0;var _0x428697=_0xa752[_0x5f01f0];return _0x428697;};'use strict';var Sequelize=require(_0x2a75('0x0'));module[_0x2a75('0x1')]={'name':{'type':Sequelize[_0x2a75('0x2')]},'description':{'type':Sequelize[_0x2a75('0x2')]},'interval':{'type':Sequelize[_0x2a75('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x3460=['sequelize','exports'];(function(_0xeb850f,_0x39aadd){var _0x4be635=function(_0xbc4b05){while(--_0xbc4b05){_0xeb850f['push'](_0xeb850f['shift']());}};_0x4be635(++_0x39aadd);}(_0x3460,0x13e));var _0x0346=function(_0x2e0d80,_0x11d29f){_0x2e0d80=_0x2e0d80-0x0;var _0x333398=_0x3460[_0x2e0d80];return _0x333398;};'use strict';var Sequelize=require(_0x0346('0x0'));module[_0x0346('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index d7c1831..32089e2 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 _0xbd1b=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','getIntervals','order','addIntervals','findOne','transaction','IntervalId','bulkCreate','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x16b4e1,_0xe1ff77){var _0x2e1a58=function(_0x1e6321){while(--_0x1e6321){_0x16b4e1['push'](_0x16b4e1['shift']());}};_0x2e1a58(++_0xe1ff77);}(_0xbd1b,0xaa));var _0xbbd1=function(_0x2fc929,_0x541743){_0x2fc929=_0x2fc929-0x0;var _0x324990=_0xbd1b[_0x2fc929];return _0x324990;};'use strict';var emlformat=require(_0xbbd1('0x0'));var rimraf=require(_0xbbd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbd1('0x2'));var rp=require('request-promise');var moment=require(_0xbbd1('0x3'));var BPromise=require(_0xbbd1('0x4'));var Mustache=require('mustache');var util=require(_0xbbd1('0x5'));var path=require(_0xbbd1('0x6'));var sox=require('sox');var csv=require(_0xbbd1('0x7'));var ejs=require(_0xbbd1('0x8'));var fs=require('fs');var fs_extra=require(_0xbbd1('0x9'));var _=require(_0xbbd1('0xa'));var squel=require('squel');var crypto=require(_0xbbd1('0xb'));var jsforce=require(_0xbbd1('0xc'));var deskjs=require(_0xbbd1('0xd'));var toCsv=require(_0xbbd1('0x7'));var querystring=require(_0xbbd1('0xe'));var Papa=require(_0xbbd1('0xf'));var Redis=require(_0xbbd1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbbd1('0x11'));var as=require(_0xbbd1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbd1('0x13'))('api');var utils=require(_0xbbd1('0x14'));var config=require(_0xbbd1('0x15'));var licenseUtil=require(_0xbbd1('0x16'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4b8bd9,_0x388eb9){_0x388eb9=_0x388eb9||0xcc;return function(_0x381f9c){if(_0x381f9c){return _0x4b8bd9[_0xbbd1('0x17')](_0x388eb9);}return _0x4b8bd9[_0xbbd1('0x18')](_0x388eb9)[_0xbbd1('0x19')]();};}function respondWithResult(_0x48ed70,_0x572dad){_0x572dad=_0x572dad||0xc8;return function(_0x57085d){if(_0x57085d){return _0x48ed70[_0xbbd1('0x18')](_0x572dad)[_0xbbd1('0x1a')](_0x57085d);}};}function respondWithFilteredResult(_0x8814da,_0x10c832){return function(_0x2bc358){if(_0x2bc358){var _0x2aaed7=typeof _0x10c832['offset']===_0xbbd1('0x1b')&&typeof _0x10c832[_0xbbd1('0x1c')]===_0xbbd1('0x1b');var _0x3b22da=_0x2bc358[_0xbbd1('0x1d')];var _0x45a03f=_0x2aaed7?0x0:_0x10c832['offset'];var _0x2294c4=_0x2aaed7?_0x2bc358[_0xbbd1('0x1d')]:_0x10c832['offset']+_0x10c832[_0xbbd1('0x1c')];var _0x41abca;if(_0x2294c4>=_0x3b22da){_0x2294c4=_0x3b22da;_0x41abca=0xc8;}else{_0x41abca=0xce;}_0x8814da['status'](_0x41abca);return _0x8814da[_0xbbd1('0x1e')](_0xbbd1('0x1f'),_0x45a03f+'-'+_0x2294c4+'/'+_0x3b22da)[_0xbbd1('0x1a')](_0x2bc358);}return null;};}function patchUpdates(_0x671ad9){return function(_0x2d80b5){try{jsonpatch[_0xbbd1('0x20')](_0x2d80b5,_0x671ad9,!![]);}catch(_0x20eb6b){return BPromise[_0xbbd1('0x21')](_0x20eb6b);}return _0x2d80b5[_0xbbd1('0x22')]();};}function saveUpdates(_0x4193a4,_0xfe0579){return function(_0x2c8ed8){if(_0x2c8ed8){return _0x2c8ed8[_0xbbd1('0x23')](_0x4193a4)[_0xbbd1('0x24')](function(_0x58715a){return _0x58715a;});}return null;};}function removeEntity(_0x3b5386,_0x2f8455){return function(_0x3d865a){if(_0x3d865a){return _0x3d865a[_0xbbd1('0x25')]()[_0xbbd1('0x24')](function(){var _0x3d43c1=_0x3d865a[_0xbbd1('0x26')]({'plain':!![]});var _0x34d22b=_0xbbd1('0x27');return db[_0xbbd1('0x28')]['destroy']({'where':{'type':_0x34d22b,'resourceId':_0x3d43c1['id']}})[_0xbbd1('0x24')](function(){return _0x3d865a;});})[_0xbbd1('0x24')](function(){_0x3b5386[_0xbbd1('0x18')](0xcc)[_0xbbd1('0x19')]();});}};}function handleEntityNotFound(_0x13c967,_0x57a5b5){return function(_0x258c67){if(!_0x258c67){_0x13c967[_0xbbd1('0x17')](0x194);}return _0x258c67;};}function handleError(_0x1f8b05,_0xa1e855){_0xa1e855=_0xa1e855||0x1f4;return function(_0x3f9de5){logger[_0xbbd1('0x29')](_0x3f9de5['stack']);if(_0x3f9de5['name']){delete _0x3f9de5[_0xbbd1('0x2a')];}_0x1f8b05[_0xbbd1('0x18')](_0xa1e855)[_0xbbd1('0x2b')](_0x3f9de5);};}exports[_0xbbd1('0x2c')]=function(_0x1f9044,_0x2eb4f2){var _0x3ac266={},_0x48e0bd={},_0x2a2692={'count':0x0,'rows':[]};var _0x569fc9=_['map'](db[_0xbbd1('0x2d')][_0xbbd1('0x2e')],function(_0x111e9d){return{'name':_0x111e9d[_0xbbd1('0x2f')],'type':_0x111e9d[_0xbbd1('0x30')][_0xbbd1('0x31')]};});_0x48e0bd[_0xbbd1('0x32')]=_[_0xbbd1('0x33')](_0x569fc9,'name');_0x48e0bd[_0xbbd1('0x34')]=_[_0xbbd1('0x35')](_0x1f9044['query']);_0x48e0bd[_0xbbd1('0x36')]=_[_0xbbd1('0x37')](_0x48e0bd['model'],_0x48e0bd[_0xbbd1('0x34')]);_0x3ac266[_0xbbd1('0x38')]=_[_0xbbd1('0x37')](_0x48e0bd['model'],qs[_0xbbd1('0x39')](_0x1f9044['query'][_0xbbd1('0x39')]));_0x3ac266[_0xbbd1('0x38')]=_0x3ac266['attributes'][_0xbbd1('0x3a')]?_0x3ac266[_0xbbd1('0x38')]:_0x48e0bd[_0xbbd1('0x32')];if(!_0x1f9044[_0xbbd1('0x34')][_0xbbd1('0x3b')](_0xbbd1('0x3c'))){_0x3ac266[_0xbbd1('0x1c')]=qs[_0xbbd1('0x1c')](_0x1f9044[_0xbbd1('0x34')]['limit']);_0x3ac266[_0xbbd1('0x3d')]=qs[_0xbbd1('0x3d')](_0x1f9044[_0xbbd1('0x34')][_0xbbd1('0x3d')]);}_0x3ac266['order']=qs[_0xbbd1('0x3e')](_0x1f9044['query'][_0xbbd1('0x3e')]);_0x3ac266[_0xbbd1('0x3f')]=qs[_0xbbd1('0x36')](_['pick'](_0x1f9044[_0xbbd1('0x34')],_0x48e0bd[_0xbbd1('0x36')]),_0x569fc9);if(_0x1f9044[_0xbbd1('0x34')]['filter']){_0x3ac266[_0xbbd1('0x3f')]=_['merge'](_0x3ac266[_0xbbd1('0x3f')],{'$or':_[_0xbbd1('0x33')](_0x569fc9,function(_0x3404cf){if(_0x3404cf[_0xbbd1('0x30')]!==_0xbbd1('0x40')){var _0x4c222c={};_0x4c222c[_0x3404cf[_0xbbd1('0x2a')]]={'$like':'%'+_0x1f9044['query'][_0xbbd1('0x41')]+'%'};return _0x4c222c;}})});}_0x3ac266=_[_0xbbd1('0x42')]({},_0x3ac266,_0x1f9044[_0xbbd1('0x43')]);var _0x363f15={'where':_0x3ac266[_0xbbd1('0x3f')]};return db[_0xbbd1('0x2d')]['count'](_0x363f15)['then'](function(_0x1e16a1){_0x2a2692[_0xbbd1('0x1d')]=_0x1e16a1;if(_0x1f9044['query'][_0xbbd1('0x44')]){_0x3ac266[_0xbbd1('0x45')]=[{'all':!![]}];}return db[_0xbbd1('0x2d')][_0xbbd1('0x46')](_0x3ac266);})[_0xbbd1('0x24')](function(_0x206119){_0x2a2692[_0xbbd1('0x47')]=_0x206119;return _0x2a2692;})['then'](respondWithFilteredResult(_0x2eb4f2,_0x3ac266))[_0xbbd1('0x48')](handleError(_0x2eb4f2,null));};exports[_0xbbd1('0x49')]=function(_0x442a5c,_0x29d42a){var _0x50a6d0={'raw':!![],'where':{'id':_0x442a5c[_0xbbd1('0x4a')]['id']}},_0x4e6e77={};_0x4e6e77[_0xbbd1('0x32')]=_[_0xbbd1('0x35')](db[_0xbbd1('0x2d')][_0xbbd1('0x2e')]);_0x4e6e77[_0xbbd1('0x34')]=_['keys'](_0x442a5c[_0xbbd1('0x34')]);_0x4e6e77[_0xbbd1('0x36')]=_['intersection'](_0x4e6e77[_0xbbd1('0x32')],_0x4e6e77[_0xbbd1('0x34')]);_0x50a6d0[_0xbbd1('0x38')]=_[_0xbbd1('0x37')](_0x4e6e77[_0xbbd1('0x32')],qs[_0xbbd1('0x39')](_0x442a5c['query'][_0xbbd1('0x39')]));_0x50a6d0[_0xbbd1('0x38')]=_0x50a6d0['attributes'][_0xbbd1('0x3a')]?_0x50a6d0[_0xbbd1('0x38')]:_0x4e6e77[_0xbbd1('0x32')];if(_0x442a5c[_0xbbd1('0x34')]['includeAll']){_0x50a6d0[_0xbbd1('0x45')]=[{'all':!![]}];}_0x50a6d0=_[_0xbbd1('0x42')]({},_0x50a6d0,_0x442a5c['options']);return db[_0xbbd1('0x2d')]['find'](_0x50a6d0)[_0xbbd1('0x24')](handleEntityNotFound(_0x29d42a,null))[_0xbbd1('0x24')](respondWithResult(_0x29d42a,null))['catch'](handleError(_0x29d42a,null));};exports[_0xbbd1('0x4b')]=function(_0x19ad6d,_0x4b58b5){return db[_0xbbd1('0x2d')][_0xbbd1('0x4b')](_0x19ad6d[_0xbbd1('0x4c')],{})['then'](function(_0x43df0c){var _0x45cdff=_0x19ad6d[_0xbbd1('0x4d')][_0xbbd1('0x26')]({'plain':!![]});if(!_0x45cdff)throw new Error(_0xbbd1('0x4e'));if(_0x45cdff[_0xbbd1('0x4f')]===_0xbbd1('0x4d')){var _0x54641e=_0x43df0c[_0xbbd1('0x26')]({'plain':!![]});var _0x4ebeca='Intervals';return db[_0xbbd1('0x50')]['find']({'where':{'name':_0x4ebeca,'userProfileId':_0x45cdff[_0xbbd1('0x51')]},'raw':!![]})[_0xbbd1('0x24')](function(_0x35411b){if(_0x35411b&&_0x35411b['autoAssociation']===0x0){return db[_0xbbd1('0x28')][_0xbbd1('0x4b')]({'name':_0x54641e[_0xbbd1('0x2a')],'resourceId':_0x54641e['id'],'type':_0x35411b[_0xbbd1('0x2a')],'sectionId':_0x35411b['id']},{})['then'](function(){return _0x43df0c;});}else{return _0x43df0c;}})[_0xbbd1('0x48')](function(_0xa39fba){logger[_0xbbd1('0x29')](_0xbbd1('0x52'),_0xa39fba);throw _0xa39fba;});}return _0x43df0c;})[_0xbbd1('0x24')](respondWithResult(_0x4b58b5,0xc9))[_0xbbd1('0x48')](handleError(_0x4b58b5,null));};exports[_0xbbd1('0x23')]=function(_0x3c1d18,_0x54700e){if(_0x3c1d18['body']['id']){delete _0x3c1d18[_0xbbd1('0x4c')]['id'];}return db['Interval'][_0xbbd1('0x53')]({'where':{'id':_0x3c1d18[_0xbbd1('0x4a')]['id']}})[_0xbbd1('0x24')](handleEntityNotFound(_0x54700e,null))[_0xbbd1('0x24')](saveUpdates(_0x3c1d18[_0xbbd1('0x4c')],null))['then'](respondWithResult(_0x54700e,null))[_0xbbd1('0x48')](handleError(_0x54700e,null));};exports[_0xbbd1('0x25')]=function(_0x55878b,_0x35c4e7){return db[_0xbbd1('0x2d')][_0xbbd1('0x53')]({'where':{'id':_0x55878b['params']['id']}})[_0xbbd1('0x24')](handleEntityNotFound(_0x35c4e7,null))['then'](removeEntity(_0x35c4e7,null))[_0xbbd1('0x48')](handleError(_0x35c4e7,null));};exports[_0xbbd1('0x54')]=function(_0x38bcd4,_0x116801,_0x1f39ef){if(_0x38bcd4[_0xbbd1('0x4c')]['id']){delete _0x38bcd4[_0xbbd1('0x4c')]['id'];}return db[_0xbbd1('0x2d')]['find']({'where':{'id':_0x38bcd4['params']['id']}})[_0xbbd1('0x24')](handleEntityNotFound(_0x116801,null))[_0xbbd1('0x24')](function(_0x576687){if(_0x576687){_0x38bcd4[_0xbbd1('0x4c')]['IntervalId']=_0x576687['id'];return db[_0xbbd1('0x2d')][_0xbbd1('0x4b')](_0x38bcd4[_0xbbd1('0x4c')]);}})['then'](respondWithResult(_0x116801,null))[_0xbbd1('0x48')](handleError(_0x116801,null));};exports[_0xbbd1('0x55')]=function(_0x95cff5,_0x31234c,_0x143fbf){var _0xc4b263={};var _0x4bc139={};var _0x4bc503;var _0x1411f7;return db[_0xbbd1('0x2d')]['findOne']({'where':{'id':_0x95cff5[_0xbbd1('0x4a')]['id']}})[_0xbbd1('0x24')](handleEntityNotFound(_0x31234c,null))[_0xbbd1('0x24')](function(_0x5f5b1e){if(_0x5f5b1e){_0x4bc503=_0x5f5b1e;_0x4bc139[_0xbbd1('0x32')]=_[_0xbbd1('0x35')](db[_0xbbd1('0x2d')][_0xbbd1('0x2e')]);_0x4bc139[_0xbbd1('0x34')]=_[_0xbbd1('0x35')](_0x95cff5[_0xbbd1('0x34')]);_0x4bc139[_0xbbd1('0x36')]=_[_0xbbd1('0x37')](_0x4bc139[_0xbbd1('0x32')],_0x4bc139['query']);_0xc4b263[_0xbbd1('0x38')]=_[_0xbbd1('0x37')](_0x4bc139[_0xbbd1('0x32')],qs[_0xbbd1('0x39')](_0x95cff5[_0xbbd1('0x34')][_0xbbd1('0x39')]));_0xc4b263[_0xbbd1('0x38')]=_0xc4b263[_0xbbd1('0x38')][_0xbbd1('0x3a')]?_0xc4b263['attributes']:_0x4bc139[_0xbbd1('0x32')];_0xc4b263[_0xbbd1('0x56')]=qs[_0xbbd1('0x3e')](_0x95cff5['query'][_0xbbd1('0x3e')]);_0xc4b263[_0xbbd1('0x3f')]=qs[_0xbbd1('0x36')](_['pick'](_0x95cff5[_0xbbd1('0x34')],_0x4bc139['filters']));if(_0x95cff5[_0xbbd1('0x34')]['filter']){_0xc4b263[_0xbbd1('0x3f')]=_[_0xbbd1('0x42')](_0xc4b263[_0xbbd1('0x3f')],{'$or':_[_0xbbd1('0x33')](_0xc4b263['attributes'],function(_0x220e36){var _0x3ecb3b={};_0x3ecb3b[_0x220e36]={'$like':'%'+_0x95cff5['query']['filter']+'%'};return _0x3ecb3b;})});}_0xc4b263=_[_0xbbd1('0x42')]({},_0xc4b263,_0x95cff5[_0xbbd1('0x43')]);return _0x4bc503[_0xbbd1('0x55')](_0xc4b263);}})[_0xbbd1('0x24')](function(_0x5095bb){if(_0x5095bb){_0x1411f7=_0x5095bb[_0xbbd1('0x3a')];if(!_0x95cff5['query'][_0xbbd1('0x3b')](_0xbbd1('0x3c'))){_0xc4b263[_0xbbd1('0x1c')]=qs[_0xbbd1('0x1c')](_0x95cff5[_0xbbd1('0x34')][_0xbbd1('0x1c')]);_0xc4b263[_0xbbd1('0x3d')]=qs[_0xbbd1('0x3d')](_0x95cff5[_0xbbd1('0x34')][_0xbbd1('0x3d')]);}return _0x4bc503['getIntervals'](_0xc4b263);}})['then'](function(_0x3494a5){if(_0x3494a5){return _0x3494a5?{'count':_0x1411f7,'rows':_0x3494a5}:null;}})[_0xbbd1('0x24')](respondWithResult(_0x31234c,null))[_0xbbd1('0x48')](handleError(_0x31234c,null));};exports[_0xbbd1('0x57')]=function(_0x2a4816,_0x5476b7,_0x58063e){return db['Interval'][_0xbbd1('0x58')]({'where':{'id':_0x2a4816[_0xbbd1('0x4a')]['id']}})[_0xbbd1('0x24')](handleEntityNotFound(_0x5476b7,null))['then'](function(_0x4d099a){if(_0x4d099a){return db['sequelize'][_0xbbd1('0x59')](function(_0x3ea67d){return db[_0xbbd1('0x2d')][_0xbbd1('0x25')]({'where':{'IntervalId':_0x2a4816['params']['id']},'transaction':_0x3ea67d})[_0xbbd1('0x24')](function(_0x235976){var _0x1722bd=_[_0xbbd1('0x33')](_0x2a4816[_0xbbd1('0x4c')],function(_0x2a4107){delete _0x2a4107['id'];_0x2a4107[_0xbbd1('0x5a')]=_0x2a4816[_0xbbd1('0x4a')]['id'];return _0x2a4107;});return db[_0xbbd1('0x2d')][_0xbbd1('0x5b')](_0x1722bd,{'transaction':_0x3ea67d});});})[_0xbbd1('0x24')](function(){return db[_0xbbd1('0x2d')]['findAll']({'where':{'IntervalId':_0x2a4816[_0xbbd1('0x4a')]['id']}});});}})['then'](respondWithResult(_0x5476b7,null))[_0xbbd1('0x48')](handleError(_0x5476b7,null));}; \ No newline at end of file +var _0x048c=['keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','count','set','update','destroy','then','get','stack','name','index','Interval','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x117d03,_0xdd48c5){var _0x197cc3=function(_0x1d5039){while(--_0x1d5039){_0x117d03['push'](_0x117d03['shift']());}};_0x197cc3(++_0xdd48c5);}(_0x048c,0x7f));var _0xc048=function(_0x33d5e3,_0x5b2be2){_0x33d5e3=_0x33d5e3-0x0;var _0xb267a2=_0x048c[_0x33d5e3];return _0xb267a2;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require(_0xc048('0x1'));var zipdir=require(_0xc048('0x2'));var jsonpatch=require(_0xc048('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc048('0x4'));var Mustache=require(_0xc048('0x5'));var util=require('util');var path=require(_0xc048('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc048('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc048('0x8'));var crypto=require(_0xc048('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc048('0xa'));var toCsv=require(_0xc048('0xb'));var querystring=require(_0xc048('0xc'));var Papa=require(_0xc048('0xd'));var Redis=require('ioredis');var authService=require(_0xc048('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc048('0xf'));var hardwareService=require(_0xc048('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xc048('0x11'));var config=require(_0xc048('0x12'));var licenseUtil=require(_0xc048('0x13'));var db=require(_0xc048('0x14'))['db'];var extensions=require(_0xc048('0x15'));function respondWithStatusCode(_0x182507,_0x35731c){_0x35731c=_0x35731c||0xcc;return function(_0x21d830){if(_0x21d830){return _0x182507[_0xc048('0x16')](_0x35731c);}return _0x182507['status'](_0x35731c)[_0xc048('0x17')]();};}function respondWithResult(_0x40d050,_0x2f6b66){_0x2f6b66=_0x2f6b66||0xc8;return function(_0x11ab8a){if(_0x11ab8a){return _0x40d050[_0xc048('0x18')](_0x2f6b66)[_0xc048('0x19')](_0x11ab8a);}};}function respondWithFilteredResult(_0x4f0b6b,_0x34b5f3){return function(_0x4f951a){if(_0x4f951a){var _0x181656=typeof _0x34b5f3[_0xc048('0x1a')]===_0xc048('0x1b')&&typeof _0x34b5f3['limit']===_0xc048('0x1b');var _0x2a622b=_0x4f951a[_0xc048('0x1c')];var _0x5d9e66=_0x181656?0x0:_0x34b5f3[_0xc048('0x1a')];var _0x3b94b0=_0x181656?_0x4f951a[_0xc048('0x1c')]:_0x34b5f3['offset']+_0x34b5f3['limit'];var _0x565d0b;if(_0x3b94b0>=_0x2a622b){_0x3b94b0=_0x2a622b;_0x565d0b=0xc8;}else{_0x565d0b=0xce;}_0x4f0b6b[_0xc048('0x18')](_0x565d0b);return _0x4f0b6b[_0xc048('0x1d')]('Content-Range',_0x5d9e66+'-'+_0x3b94b0+'/'+_0x2a622b)[_0xc048('0x19')](_0x4f951a);}return null;};}function patchUpdates(_0x38ed4e){return function(_0x36c442){try{jsonpatch['apply'](_0x36c442,_0x38ed4e,!![]);}catch(_0x3b10f2){return BPromise['reject'](_0x3b10f2);}return _0x36c442['save']();};}function saveUpdates(_0x47e53d,_0x293285){return function(_0x411326){if(_0x411326){return _0x411326[_0xc048('0x1e')](_0x47e53d)['then'](function(_0x4947f4){return _0x4947f4;});}return null;};}function removeEntity(_0x493534,_0x31513a){return function(_0x39aecd){if(_0x39aecd){return _0x39aecd[_0xc048('0x1f')]()[_0xc048('0x20')](function(){var _0x5b690c=_0x39aecd[_0xc048('0x21')]({'plain':!![]});var _0x2ebf8a='Intervals';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ebf8a,'resourceId':_0x5b690c['id']}})['then'](function(){return _0x39aecd;});})[_0xc048('0x20')](function(){_0x493534[_0xc048('0x18')](0xcc)[_0xc048('0x17')]();});}};}function handleEntityNotFound(_0x2b2263,_0x41ac15){return function(_0x3c532e){if(!_0x3c532e){_0x2b2263['sendStatus'](0x194);}return _0x3c532e;};}function handleError(_0x34d426,_0x18921c){_0x18921c=_0x18921c||0x1f4;return function(_0x13b601){logger['error'](_0x13b601[_0xc048('0x22')]);if(_0x13b601[_0xc048('0x23')]){delete _0x13b601[_0xc048('0x23')];}_0x34d426[_0xc048('0x18')](_0x18921c)['send'](_0x13b601);};}exports[_0xc048('0x24')]=function(_0x3c12a6,_0x262fd6){var _0x1a540c={},_0x2e0deb={},_0x206dfc={'count':0x0,'rows':[]};var _0x94f6be=_['map'](db[_0xc048('0x25')][_0xc048('0x26')],function(_0x42b632){return{'name':_0x42b632[_0xc048('0x27')],'type':_0x42b632[_0xc048('0x28')][_0xc048('0x29')]};});_0x2e0deb[_0xc048('0x2a')]=_[_0xc048('0x2b')](_0x94f6be,_0xc048('0x23'));_0x2e0deb[_0xc048('0x2c')]=_[_0xc048('0x2d')](_0x3c12a6[_0xc048('0x2c')]);_0x2e0deb[_0xc048('0x2e')]=_[_0xc048('0x2f')](_0x2e0deb[_0xc048('0x2a')],_0x2e0deb[_0xc048('0x2c')]);_0x1a540c[_0xc048('0x30')]=_[_0xc048('0x2f')](_0x2e0deb[_0xc048('0x2a')],qs[_0xc048('0x31')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x31')]));_0x1a540c[_0xc048('0x30')]=_0x1a540c[_0xc048('0x30')][_0xc048('0x32')]?_0x1a540c[_0xc048('0x30')]:_0x2e0deb[_0xc048('0x2a')];if(!_0x3c12a6[_0xc048('0x2c')]['hasOwnProperty'](_0xc048('0x33'))){_0x1a540c['limit']=qs[_0xc048('0x34')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x34')]);_0x1a540c['offset']=qs[_0xc048('0x1a')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x1a')]);}_0x1a540c[_0xc048('0x35')]=qs[_0xc048('0x36')](_0x3c12a6['query'][_0xc048('0x36')]);_0x1a540c[_0xc048('0x37')]=qs[_0xc048('0x2e')](_[_0xc048('0x38')](_0x3c12a6[_0xc048('0x2c')],_0x2e0deb[_0xc048('0x2e')]),_0x94f6be);if(_0x3c12a6[_0xc048('0x2c')]['filter']){_0x1a540c[_0xc048('0x37')]=_['merge'](_0x1a540c['where'],{'$or':_[_0xc048('0x2b')](_0x94f6be,function(_0xbb1a66){if(_0xbb1a66[_0xc048('0x28')]!==_0xc048('0x39')){var _0x459833={};_0x459833[_0xbb1a66[_0xc048('0x23')]]={'$like':'%'+_0x3c12a6[_0xc048('0x2c')][_0xc048('0x3a')]+'%'};return _0x459833;}})});}_0x1a540c=_[_0xc048('0x3b')]({},_0x1a540c,_0x3c12a6[_0xc048('0x3c')]);var _0x55c8a7={'where':_0x1a540c[_0xc048('0x37')]};return db['Interval'][_0xc048('0x1c')](_0x55c8a7)[_0xc048('0x20')](function(_0x578f3d){_0x206dfc[_0xc048('0x1c')]=_0x578f3d;if(_0x3c12a6['query'][_0xc048('0x3d')]){_0x1a540c[_0xc048('0x3e')]=[{'all':!![]}];}return db[_0xc048('0x25')]['findAll'](_0x1a540c);})[_0xc048('0x20')](function(_0x41afa9){_0x206dfc[_0xc048('0x3f')]=_0x41afa9;return _0x206dfc;})[_0xc048('0x20')](respondWithFilteredResult(_0x262fd6,_0x1a540c))[_0xc048('0x40')](handleError(_0x262fd6,null));};exports['show']=function(_0x15c1fd,_0x19ac91){var _0x13dcd5={'raw':!![],'where':{'id':_0x15c1fd[_0xc048('0x41')]['id']}},_0xec0b69={};_0xec0b69[_0xc048('0x2a')]=_[_0xc048('0x2d')](db[_0xc048('0x25')]['rawAttributes']);_0xec0b69[_0xc048('0x2c')]=_['keys'](_0x15c1fd[_0xc048('0x2c')]);_0xec0b69[_0xc048('0x2e')]=_[_0xc048('0x2f')](_0xec0b69[_0xc048('0x2a')],_0xec0b69['query']);_0x13dcd5[_0xc048('0x30')]=_[_0xc048('0x2f')](_0xec0b69['model'],qs['fields'](_0x15c1fd['query']['fields']));_0x13dcd5[_0xc048('0x30')]=_0x13dcd5[_0xc048('0x30')][_0xc048('0x32')]?_0x13dcd5[_0xc048('0x30')]:_0xec0b69[_0xc048('0x2a')];if(_0x15c1fd[_0xc048('0x2c')][_0xc048('0x3d')]){_0x13dcd5[_0xc048('0x3e')]=[{'all':!![]}];}_0x13dcd5=_[_0xc048('0x3b')]({},_0x13dcd5,_0x15c1fd[_0xc048('0x3c')]);return db[_0xc048('0x25')]['find'](_0x13dcd5)[_0xc048('0x20')](handleEntityNotFound(_0x19ac91,null))[_0xc048('0x20')](respondWithResult(_0x19ac91,null))[_0xc048('0x40')](handleError(_0x19ac91,null));};exports[_0xc048('0x42')]=function(_0x16c45e,_0x556f70){return db[_0xc048('0x25')][_0xc048('0x42')](_0x16c45e[_0xc048('0x43')],{})[_0xc048('0x20')](function(_0x1c8585){var _0x26279e=_0x16c45e[_0xc048('0x44')][_0xc048('0x21')]({'plain':!![]});if(!_0x26279e)throw new Error(_0xc048('0x45'));if(_0x26279e[_0xc048('0x46')]===_0xc048('0x44')){var _0x168a2d=_0x1c8585['get']({'plain':!![]});var _0x10833b=_0xc048('0x47');return db[_0xc048('0x48')][_0xc048('0x49')]({'where':{'name':_0x10833b,'userProfileId':_0x26279e[_0xc048('0x4a')]},'raw':!![]})['then'](function(_0x51baed){if(_0x51baed&&_0x51baed[_0xc048('0x4b')]===0x0){return db[_0xc048('0x4c')]['create']({'name':_0x168a2d[_0xc048('0x23')],'resourceId':_0x168a2d['id'],'type':_0x51baed[_0xc048('0x23')],'sectionId':_0x51baed['id']},{})[_0xc048('0x20')](function(){return _0x1c8585;});}else{return _0x1c8585;}})[_0xc048('0x40')](function(_0xbfce70){logger[_0xc048('0x4d')](_0xc048('0x4e'),_0xbfce70);throw _0xbfce70;});}return _0x1c8585;})[_0xc048('0x20')](respondWithResult(_0x556f70,0xc9))[_0xc048('0x40')](handleError(_0x556f70,null));};exports['update']=function(_0x5c3b2e,_0x1a9a86){if(_0x5c3b2e[_0xc048('0x43')]['id']){delete _0x5c3b2e['body']['id'];}return db[_0xc048('0x25')][_0xc048('0x49')]({'where':{'id':_0x5c3b2e[_0xc048('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a9a86,null))[_0xc048('0x20')](saveUpdates(_0x5c3b2e[_0xc048('0x43')],null))[_0xc048('0x20')](respondWithResult(_0x1a9a86,null))[_0xc048('0x40')](handleError(_0x1a9a86,null));};exports[_0xc048('0x1f')]=function(_0x5be236,_0x559290){return db[_0xc048('0x25')]['find']({'where':{'id':_0x5be236['params']['id']}})['then'](handleEntityNotFound(_0x559290,null))[_0xc048('0x20')](removeEntity(_0x559290,null))[_0xc048('0x40')](handleError(_0x559290,null));};exports[_0xc048('0x4f')]=function(_0x35e56b,_0x28e860,_0x187942){if(_0x35e56b['body']['id']){delete _0x35e56b[_0xc048('0x43')]['id'];}return db[_0xc048('0x25')][_0xc048('0x49')]({'where':{'id':_0x35e56b[_0xc048('0x41')]['id']}})[_0xc048('0x20')](handleEntityNotFound(_0x28e860,null))[_0xc048('0x20')](function(_0x3a0482){if(_0x3a0482){_0x35e56b[_0xc048('0x43')][_0xc048('0x50')]=_0x3a0482['id'];return db[_0xc048('0x25')]['create'](_0x35e56b[_0xc048('0x43')]);}})[_0xc048('0x20')](respondWithResult(_0x28e860,null))[_0xc048('0x40')](handleError(_0x28e860,null));};exports[_0xc048('0x51')]=function(_0x4ad61c,_0x5e3ecc,_0x37e32c){var _0x4202d4={};var _0x92d85={};var _0x226320;var _0x8cbb27;return db[_0xc048('0x25')][_0xc048('0x52')]({'where':{'id':_0x4ad61c[_0xc048('0x41')]['id']}})[_0xc048('0x20')](handleEntityNotFound(_0x5e3ecc,null))[_0xc048('0x20')](function(_0x5cacbf){if(_0x5cacbf){_0x226320=_0x5cacbf;_0x92d85['model']=_[_0xc048('0x2d')](db[_0xc048('0x25')][_0xc048('0x26')]);_0x92d85['query']=_[_0xc048('0x2d')](_0x4ad61c[_0xc048('0x2c')]);_0x92d85['filters']=_['intersection'](_0x92d85[_0xc048('0x2a')],_0x92d85['query']);_0x4202d4[_0xc048('0x30')]=_[_0xc048('0x2f')](_0x92d85['model'],qs[_0xc048('0x31')](_0x4ad61c['query'][_0xc048('0x31')]));_0x4202d4[_0xc048('0x30')]=_0x4202d4[_0xc048('0x30')][_0xc048('0x32')]?_0x4202d4[_0xc048('0x30')]:_0x92d85[_0xc048('0x2a')];_0x4202d4['order']=qs[_0xc048('0x36')](_0x4ad61c['query'][_0xc048('0x36')]);_0x4202d4[_0xc048('0x37')]=qs['filters'](_[_0xc048('0x38')](_0x4ad61c[_0xc048('0x2c')],_0x92d85[_0xc048('0x2e')]));if(_0x4ad61c['query'][_0xc048('0x3a')]){_0x4202d4[_0xc048('0x37')]=_['merge'](_0x4202d4[_0xc048('0x37')],{'$or':_['map'](_0x4202d4['attributes'],function(_0x2bdb3d){var _0x3ee22f={};_0x3ee22f[_0x2bdb3d]={'$like':'%'+_0x4ad61c[_0xc048('0x2c')][_0xc048('0x3a')]+'%'};return _0x3ee22f;})});}_0x4202d4=_[_0xc048('0x3b')]({},_0x4202d4,_0x4ad61c['options']);return _0x226320['getIntervals'](_0x4202d4);}})[_0xc048('0x20')](function(_0xbb5d32){if(_0xbb5d32){_0x8cbb27=_0xbb5d32[_0xc048('0x32')];if(!_0x4ad61c['query'][_0xc048('0x53')](_0xc048('0x33'))){_0x4202d4[_0xc048('0x34')]=qs[_0xc048('0x34')](_0x4ad61c[_0xc048('0x2c')][_0xc048('0x34')]);_0x4202d4[_0xc048('0x1a')]=qs['offset'](_0x4ad61c['query'][_0xc048('0x1a')]);}return _0x226320[_0xc048('0x51')](_0x4202d4);}})[_0xc048('0x20')](function(_0x69b6ee){if(_0x69b6ee){return _0x69b6ee?{'count':_0x8cbb27,'rows':_0x69b6ee}:null;}})['then'](respondWithResult(_0x5e3ecc,null))[_0xc048('0x40')](handleError(_0x5e3ecc,null));};exports[_0xc048('0x54')]=function(_0x21e507,_0x4e180d,_0x57fd86){return db[_0xc048('0x25')][_0xc048('0x52')]({'where':{'id':_0x21e507[_0xc048('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e180d,null))['then'](function(_0x368025){if(_0x368025){return db['sequelize']['transaction'](function(_0x104973){return db['Interval'][_0xc048('0x1f')]({'where':{'IntervalId':_0x21e507[_0xc048('0x41')]['id']},'transaction':_0x104973})[_0xc048('0x20')](function(_0x515f05){var _0x4c32cd=_[_0xc048('0x2b')](_0x21e507[_0xc048('0x43')],function(_0x3c9a6e){delete _0x3c9a6e['id'];_0x3c9a6e[_0xc048('0x50')]=_0x21e507['params']['id'];return _0x3c9a6e;});return db[_0xc048('0x25')]['bulkCreate'](_0x4c32cd,{'transaction':_0x104973});});})[_0xc048('0x20')](function(){return db[_0xc048('0x25')][_0xc048('0x55')]({'where':{'IntervalId':_0x21e507['params']['id']}});});}})[_0xc048('0x20')](respondWithResult(_0x4e180d,null))[_0xc048('0x40')](handleError(_0x4e180d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cd92aee..e47d52d 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 _0x48e3=['lodash','api','moment','bluebird','rimraf','../../config/environment','./interval.attributes','exports','Interval','rewrite'];(function(_0x2e72c7,_0x3cefda){var _0x12f876=function(_0x286755){while(--_0x286755){_0x2e72c7['push'](_0x2e72c7['shift']());}};_0x12f876(++_0x3cefda);}(_0x48e3,0x1ea));var _0x348e=function(_0x58ebef,_0x1ebc23){_0x58ebef=_0x58ebef-0x0;var _0x373829=_0x48e3[_0x58ebef];return _0x373829;};'use strict';var _=require(_0x348e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x348e('0x1'));var moment=require(_0x348e('0x2'));var BPromise=require(_0x348e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x348e('0x4'));var config=require(_0x348e('0x5'));var attributes=require(_0x348e('0x6'));var extensions=require('../../components/extensions/rewrite');module[_0x348e('0x7')]=function(_0x9139ed,_0x2724d4){return _0x9139ed['define'](_0x348e('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x14d46a,_0x241c25){extensions['rewrite'](_0x9139ed,_0x14d46a);},'afterBulkCreate':function(_0x4b5531,_0x8ccb7a,_0x3766eb){_0x3766eb();extensions['rewrite'](_0x9139ed,_0x4b5531[0x0]);},'afterUpdate':function(_0x493a98,_0x22cc6c){extensions[_0x348e('0x9')](_0x9139ed,_0x493a98);},'afterDestroy':function(_0x55bff4,_0x31b906){extensions['rewrite'](_0x9139ed,_0x55bff4);}}});}; \ No newline at end of file +var _0xb0cb=['rewrite','util','../../config/logger','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x505f4b,_0x245f70){var _0x314a09=function(_0x26b50f){while(--_0x26b50f){_0x505f4b['push'](_0x505f4b['shift']());}};_0x314a09(++_0x245f70);}(_0xb0cb,0x1c3));var _0xbb0c=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb0cb[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0xbb0c('0x0'));var logger=require(_0xbb0c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb0c('0x2'));var rimraf=require('rimraf');var config=require(_0xbb0c('0x3'));var attributes=require(_0xbb0c('0x4'));var extensions=require(_0xbb0c('0x5'));module[_0xbb0c('0x6')]=function(_0x57f7cc,_0xff23f5){return _0x57f7cc['define'](_0xbb0c('0x7'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x574994,_0x5d10ac){extensions['rewrite'](_0x57f7cc,_0x574994);},'afterBulkCreate':function(_0x1c153a,_0x21ee65,_0x3f11bc){_0x3f11bc();extensions[_0xbb0c('0x8')](_0x57f7cc,_0x1c153a[0x0]);},'afterUpdate':function(_0x20554c,_0x18fb52){extensions[_0xbb0c('0x8')](_0x57f7cc,_0x20554c);},'afterDestroy':function(_0x3d7d8d,_0x45332d){extensions[_0xbb0c('0x8')](_0x57f7cc,_0x3d7d8d);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9335e34..c01e423 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 82e21c2..26bbd48 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0xf555be,_0xc9895e){var _0x2be994=function(_0x1a576b){while(--_0x1a576b){_0xf555be['push'](_0xf555be['shift']());}};_0x2be994(++_0xc9895e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e1be6,_0x135688){_0x1e1be6=_0x1e1be6-0x0;var _0x48db80=_0x5f2f[_0x1e1be6];return _0x48db80;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x416dd9,_0x167b0a){var _0x5e348c=function(_0x4415e8){while(--_0x4415e8){_0x416dd9['push'](_0x416dd9['shift']());}};_0x5e348c(++_0x167b0a);}(_0xdb28,0x106));var _0x8db2=function(_0x4b81c6,_0x535677){_0x4b81c6=_0x4b81c6-0x0;var _0x27fb13=_0xdb28[_0x4b81c6];return _0x27fb13;};'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 a53c18c..8d8873a 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 _0x1c51=['email','customfield_11501','oldToken','customfield_11502','customfield_11503','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','connection','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500'];(function(_0x322cbc,_0xc2c5f7){var _0x3e1bc4=function(_0x7afb97){while(--_0x7afb97){_0x322cbc['push'](_0x322cbc['shift']());}};_0x3e1bc4(++_0xc2c5f7);}(_0x1c51,0x1e1));var _0x11c5=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x1c51[_0x58e469];return _0x4c01c5;};'use strict';var BPromise=require('bluebird');var https=require(_0x11c5('0x0'));var logger=require(_0x11c5('0x1'))(_0x11c5('0x2'));var USERNAME=_0x11c5('0x3');var PASSWORD=_0x11c5('0x4');function openIssue(_0x25e03b,_0x19cce0){var _0x39eb64={'fields':{'project':{'key':_0x25e03b[_0x11c5('0x5')]||_0x11c5('0x6')},'summary':(_0x25e03b['summary']||_0x11c5('0x7'))+_0x11c5('0x8')+_0x25e03b['ip'],'description':_0x25e03b['description']||JSON[_0x11c5('0x9')](_0x25e03b),'issuetype':{'name':_0x25e03b[_0x11c5('0xa')]||_0x11c5('0xb')}}};_0x39eb64[_0x11c5('0xc')][_0x11c5('0xd')]=_0x25e03b[_0x11c5('0xe')];_0x39eb64[_0x11c5('0xc')][_0x11c5('0xf')]=_0x25e03b[_0x11c5('0x10')];_0x39eb64[_0x11c5('0xc')][_0x11c5('0x11')]=_0x25e03b['newToken'];_0x39eb64['fields'][_0x11c5('0x12')]=_0x25e03b['name'];_0x39eb64[_0x11c5('0xc')]['customfield_11504']=_0x25e03b[_0x11c5('0x13')];_0x39eb64[_0x11c5('0xc')][_0x11c5('0x14')]=_0x25e03b['ip'];var _0x37fba2={'host':_0x11c5('0x15'),'port':0x1bb,'path':_0x11c5('0x16'),'method':_0x11c5('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x11c5('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x11c5('0x19')](_0x11c5('0x1a'))}};var _0x267300=JSON[_0x11c5('0x9')](_0x39eb64);var _0x2abdd0=https[_0x11c5('0x1b')](_0x37fba2,function(_0x458591){_0x458591[_0x11c5('0x1c')]('utf8');var _0x2a615e='';_0x458591['on']('data',function(_0x34beeb){_0x2a615e+=_0x34beeb;});_0x458591['on'](_0x11c5('0x1d'),function(){if(_0x19cce0){return _0x19cce0[_0x11c5('0x1e')](_0x458591[_0x11c5('0x1f')])[_0x11c5('0x20')](JSON[_0x11c5('0x21')](_0x2a615e));}});});_0x2abdd0['on'](_0x11c5('0x22'),function(_0x281b63){if(_0x19cce0){return _0x19cce0[_0x11c5('0x1e')](0x1f4)[_0x11c5('0x20')]({'errors':[{'message':_0x11c5('0x23'),'type':'api.jira'}]});}});_0x2abdd0[_0x11c5('0x24')](_0x267300);_0x2abdd0[_0x11c5('0x1d')]();}exports[_0x11c5('0x25')]=openIssue;exports[_0x11c5('0x26')]=function(_0x590188,_0x391c06){_0x590188[_0x11c5('0x27')]['ip']=_0x590188[_0x11c5('0x28')][_0x11c5('0x29')]||_0x590188['connection'][_0x11c5('0x2a')]||_0x590188['socket'][_0x11c5('0x2a')]||_0x590188[_0x11c5('0x2b')][_0x11c5('0x2c')][_0x11c5('0x2a')];return openIssue(_0x590188[_0x11c5('0x27')],_0x391c06);}; \ No newline at end of file +var _0x7e97=['bluebird','https','api','key','MOTGUI','summary','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','base64','request','setEncoding','utf8','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress'];(function(_0x386abf,_0x3780e1){var _0x2e44c4=function(_0x28ae2c){while(--_0x28ae2c){_0x386abf['push'](_0x386abf['shift']());}};_0x2e44c4(++_0x3780e1);}(_0x7e97,0xfc));var _0x77e9=function(_0x5cfc76,_0x552fce){_0x5cfc76=_0x5cfc76-0x0;var _0xab27b5=_0x7e97[_0x5cfc76];return _0xab27b5;};'use strict';var BPromise=require(_0x77e9('0x0'));var https=require(_0x77e9('0x1'));var logger=require('../../config/logger')(_0x77e9('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x208e61,_0x397e7f){var _0x47c9e1={'fields':{'project':{'key':_0x208e61[_0x77e9('0x3')]||_0x77e9('0x4')},'summary':(_0x208e61[_0x77e9('0x5')]||'Report')+'\x20from\x20'+_0x208e61['ip'],'description':_0x208e61[_0x77e9('0x6')]||JSON[_0x77e9('0x7')](_0x208e61),'issuetype':{'name':_0x208e61[_0x77e9('0x8')]||_0x77e9('0x9')}}};_0x47c9e1['fields']['customfield_11500']=_0x208e61[_0x77e9('0xa')];_0x47c9e1[_0x77e9('0xb')][_0x77e9('0xc')]=_0x208e61[_0x77e9('0xd')];_0x47c9e1[_0x77e9('0xb')]['customfield_11502']=_0x208e61[_0x77e9('0xe')];_0x47c9e1['fields'][_0x77e9('0xf')]=_0x208e61[_0x77e9('0x10')];_0x47c9e1[_0x77e9('0xb')]['customfield_11504']=_0x208e61[_0x77e9('0x11')];_0x47c9e1[_0x77e9('0xb')][_0x77e9('0x12')]=_0x208e61['ip'];var _0x2f2fc0={'host':_0x77e9('0x13'),'port':0x1bb,'path':_0x77e9('0x14'),'method':_0x77e9('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x77e9('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x77e9('0x17'))}};var _0x532f3e=JSON[_0x77e9('0x7')](_0x47c9e1);var _0x4801e4=https[_0x77e9('0x18')](_0x2f2fc0,function(_0x2f7e59){_0x2f7e59[_0x77e9('0x19')](_0x77e9('0x1a'));var _0x5ee2af='';_0x2f7e59['on']('data',function(_0x3c4ec7){_0x5ee2af+=_0x3c4ec7;});_0x2f7e59['on']('end',function(){if(_0x397e7f){return _0x397e7f[_0x77e9('0x1b')](_0x2f7e59['statusCode'])[_0x77e9('0x1c')](JSON[_0x77e9('0x1d')](_0x5ee2af));}});});_0x4801e4['on'](_0x77e9('0x1e'),function(_0x12f7ff){if(_0x397e7f){return _0x397e7f[_0x77e9('0x1b')](0x1f4)[_0x77e9('0x1c')]({'errors':[{'message':_0x77e9('0x1f'),'type':_0x77e9('0x20')}]});}});_0x4801e4[_0x77e9('0x21')](_0x532f3e);_0x4801e4[_0x77e9('0x22')]();}exports[_0x77e9('0x23')]=openIssue;exports[_0x77e9('0x24')]=function(_0x372eef,_0x501d47){_0x372eef[_0x77e9('0x25')]['ip']=_0x372eef['headers'][_0x77e9('0x26')]||_0x372eef[_0x77e9('0x27')]['remoteAddress']||_0x372eef[_0x77e9('0x28')][_0x77e9('0x29')]||_0x372eef['connection']['socket'][_0x77e9('0x29')];return openIssue(_0x372eef[_0x77e9('0x25')],_0x501d47);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9e4ecd6..35f1d43 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 _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0x118457,_0x43089b){var _0x2a6e31=function(_0x3886f5){while(--_0x3886f5){_0x118457['push'](_0x118457['shift']());}};_0x2a6e31(++_0x43089b);}(_0x668b,0x140));var _0xb668=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0x668b[_0x20bc10];return _0x3bd5ce;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file +var _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x1046e8,_0x45086a){var _0xb4051e=function(_0x4d073c){while(--_0x4d073c){_0x1046e8['push'](_0x1046e8['shift']());}};_0xb4051e(++_0x45086a);}(_0xbec5,0xe5));var _0x5bec=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xbec5[_0x497b1e];return _0x3f72e1;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('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 fed59da..d0ffd84 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x820108,_0x579e3f){_0x820108=_0x820108-0x0;var _0x48d389=_0x7a54[_0x820108];return _0x48d389;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x5b3c4b,_0x565928){_0x5b3c4b=_0x5b3c4b-0x0;var _0x1d7c0e=_0x7a54[_0x5b3c4b];return _0x1d7c0e;};'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 6623088..07d68ff 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 _0x84e7=['path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util'];(function(_0x1af0f0,_0x4a654b){var _0x50b19c=function(_0x19f362){while(--_0x19f362){_0x1af0f0['push'](_0x1af0f0['shift']());}};_0x50b19c(++_0x4a654b);}(_0x84e7,0x122));var _0x784e=function(_0x292eeb,_0x3dd9df){_0x292eeb=_0x292eeb-0x0;var _0x4e4d59=_0x84e7[_0x292eeb];return _0x4e4d59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x784e('0x0'));var zipdir=require(_0x784e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x784e('0x2'));var moment=require(_0x784e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x784e('0x4'));var util=require(_0x784e('0x5'));var path=require(_0x784e('0x6'));var sox=require(_0x784e('0x7'));var csv=require(_0x784e('0x8'));var ejs=require(_0x784e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x784e('0xa'));var squel=require('squel');var crypto=require(_0x784e('0xb'));var jsforce=require(_0x784e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x784e('0x8'));var querystring=require(_0x784e('0xd'));var Papa=require(_0x784e('0xe'));var Redis=require(_0x784e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x784e('0x10'));var hardwareService=require(_0x784e('0x11'));var logger=require(_0x784e('0x12'))(_0x784e('0x13'));var utils=require('../../config/utils');var config=require(_0x784e('0x14'));var licenseUtil=require(_0x784e('0x15'));var db=require(_0x784e('0x16'))['db'];function respondWithStatusCode(_0x2c7227,_0x40e0d1){_0x40e0d1=_0x40e0d1||0xcc;return function(_0x208d24){if(_0x208d24){return _0x2c7227['sendStatus'](_0x40e0d1);}return _0x2c7227[_0x784e('0x17')](_0x40e0d1)['end']();};}function respondWithResult(_0x172697,_0x1f6ede){_0x1f6ede=_0x1f6ede||0xc8;return function(_0x41f993){if(_0x41f993){return _0x172697[_0x784e('0x17')](_0x1f6ede)[_0x784e('0x18')](_0x41f993);}};}function respondWithFilteredResult(_0x46bd33,_0x947397){return function(_0x39abb5){if(_0x39abb5){var _0x8a90cf=typeof _0x947397['offset']==='undefined'&&typeof _0x947397[_0x784e('0x19')]===_0x784e('0x1a');var _0x3b7d6a=_0x39abb5[_0x784e('0x1b')];var _0x3ac83=_0x8a90cf?0x0:_0x947397[_0x784e('0x1c')];var _0x1dc568=_0x8a90cf?_0x39abb5['count']:_0x947397[_0x784e('0x1c')]+_0x947397[_0x784e('0x19')];var _0x8e437a;if(_0x1dc568>=_0x3b7d6a){_0x1dc568=_0x3b7d6a;_0x8e437a=0xc8;}else{_0x8e437a=0xce;}_0x46bd33[_0x784e('0x17')](_0x8e437a);return _0x46bd33[_0x784e('0x1d')](_0x784e('0x1e'),_0x3ac83+'-'+_0x1dc568+'/'+_0x3b7d6a)[_0x784e('0x18')](_0x39abb5);}return null;};}function patchUpdates(_0x5e9b46){return function(_0x5add8f){try{jsonpatch[_0x784e('0x1f')](_0x5add8f,_0x5e9b46,!![]);}catch(_0x52bc9d){return BPromise[_0x784e('0x20')](_0x52bc9d);}return _0x5add8f[_0x784e('0x21')]();};}function saveUpdates(_0x5254c8,_0x544a1b){return function(_0x2d1d08){if(_0x2d1d08){return _0x2d1d08[_0x784e('0x22')](_0x5254c8)[_0x784e('0x23')](function(_0xfc37fb){return _0xfc37fb;});}return null;};}function removeEntity(_0x51f452,_0x4fab06){return function(_0x4dc85f){if(_0x4dc85f){return _0x4dc85f[_0x784e('0x24')]()[_0x784e('0x23')](function(){_0x51f452['status'](0xcc)[_0x784e('0x25')]();});}};}function handleEntityNotFound(_0x5e809a,_0x2d6f18){return function(_0x59f315){if(!_0x59f315){_0x5e809a[_0x784e('0x26')](0x194);}return _0x59f315;};}function handleError(_0x103a90,_0x277101){_0x277101=_0x277101||0x1f4;return function(_0x7de85b){logger['error'](_0x7de85b[_0x784e('0x27')]);if(_0x7de85b[_0x784e('0x28')]){delete _0x7de85b[_0x784e('0x28')];}_0x103a90[_0x784e('0x17')](_0x277101)['send'](_0x7de85b);};}exports[_0x784e('0x29')]=function(_0xa3603f,_0x5f3da2){var _0x5cb5a3={},_0x3c30b7={},_0x40c31b={'count':0x0,'rows':[]};var _0x17a278=_[_0x784e('0x2a')](db[_0x784e('0x2b')][_0x784e('0x2c')],function(_0x150757){return{'name':_0x150757[_0x784e('0x2d')],'type':_0x150757[_0x784e('0x2e')][_0x784e('0x2f')]};});_0x3c30b7[_0x784e('0x30')]=_[_0x784e('0x2a')](_0x17a278,_0x784e('0x28'));_0x3c30b7[_0x784e('0x31')]=_[_0x784e('0x32')](_0xa3603f['query']);_0x3c30b7[_0x784e('0x33')]=_['intersection'](_0x3c30b7[_0x784e('0x30')],_0x3c30b7[_0x784e('0x31')]);_0x5cb5a3[_0x784e('0x34')]=_['intersection'](_0x3c30b7[_0x784e('0x30')],qs['fields'](_0xa3603f[_0x784e('0x31')][_0x784e('0x35')]));_0x5cb5a3['attributes']=_0x5cb5a3[_0x784e('0x34')][_0x784e('0x36')]?_0x5cb5a3['attributes']:_0x3c30b7['model'];if(!_0xa3603f[_0x784e('0x31')][_0x784e('0x37')](_0x784e('0x38'))){_0x5cb5a3[_0x784e('0x19')]=qs[_0x784e('0x19')](_0xa3603f['query'][_0x784e('0x19')]);_0x5cb5a3[_0x784e('0x1c')]=qs['offset'](_0xa3603f[_0x784e('0x31')]['offset']);}_0x5cb5a3['order']=qs['sort'](_0xa3603f[_0x784e('0x31')][_0x784e('0x39')]);_0x5cb5a3['where']=qs[_0x784e('0x33')](_[_0x784e('0x3a')](_0xa3603f[_0x784e('0x31')],_0x3c30b7[_0x784e('0x33')]),_0x17a278);if(_0xa3603f[_0x784e('0x31')][_0x784e('0x3b')]){_0x5cb5a3['where']=_['merge'](_0x5cb5a3[_0x784e('0x3c')],{'$or':_[_0x784e('0x2a')](_0x17a278,function(_0x509d95){if(_0x509d95['type']!=='VIRTUAL'){var _0x35608e={};_0x35608e[_0x509d95[_0x784e('0x28')]]={'$like':'%'+_0xa3603f['query'][_0x784e('0x3b')]+'%'};return _0x35608e;}})});}_0x5cb5a3=_[_0x784e('0x3d')]({},_0x5cb5a3,_0xa3603f[_0x784e('0x3e')]);var _0x49e82a={'where':_0x5cb5a3[_0x784e('0x3c')]};return db['JscriptyAnswerReport'][_0x784e('0x1b')](_0x49e82a)['then'](function(_0x412ef4){_0x40c31b[_0x784e('0x1b')]=_0x412ef4;if(_0xa3603f['query']['includeAll']){_0x5cb5a3[_0x784e('0x3f')]=[{'all':!![]}];}return db[_0x784e('0x2b')][_0x784e('0x40')](_0x5cb5a3);})['then'](function(_0x2ff0ab){_0x40c31b[_0x784e('0x41')]=_0x2ff0ab;return _0x40c31b;})[_0x784e('0x23')](respondWithFilteredResult(_0x5f3da2,_0x5cb5a3))[_0x784e('0x42')](handleError(_0x5f3da2,null));};exports['show']=function(_0x444300,_0x400288){var _0x48d0f0={'raw':!![],'where':{'id':_0x444300[_0x784e('0x43')]['id']}},_0x580663={};_0x580663[_0x784e('0x30')]=_[_0x784e('0x32')](db[_0x784e('0x2b')][_0x784e('0x2c')]);_0x580663['query']=_['keys'](_0x444300['query']);_0x580663[_0x784e('0x33')]=_[_0x784e('0x44')](_0x580663[_0x784e('0x30')],_0x580663[_0x784e('0x31')]);_0x48d0f0[_0x784e('0x34')]=_['intersection'](_0x580663['model'],qs['fields'](_0x444300[_0x784e('0x31')][_0x784e('0x35')]));_0x48d0f0['attributes']=_0x48d0f0[_0x784e('0x34')][_0x784e('0x36')]?_0x48d0f0['attributes']:_0x580663[_0x784e('0x30')];if(_0x444300[_0x784e('0x31')][_0x784e('0x45')]){_0x48d0f0[_0x784e('0x3f')]=[{'all':!![]}];}_0x48d0f0=_[_0x784e('0x3d')]({},_0x48d0f0,_0x444300[_0x784e('0x3e')]);return db[_0x784e('0x2b')][_0x784e('0x46')](_0x48d0f0)['then'](handleEntityNotFound(_0x400288,null))[_0x784e('0x23')](respondWithResult(_0x400288,null))[_0x784e('0x42')](handleError(_0x400288,null));};exports['create']=function(_0x404b89,_0x473e63){return db[_0x784e('0x2b')][_0x784e('0x47')](_0x404b89[_0x784e('0x48')],{})[_0x784e('0x23')](respondWithResult(_0x473e63,0xc9))[_0x784e('0x42')](handleError(_0x473e63,null));};exports[_0x784e('0x22')]=function(_0x52438e,_0x1aded3){if(_0x52438e['body']['id']){delete _0x52438e[_0x784e('0x48')]['id'];}return db[_0x784e('0x2b')]['find']({'where':{'id':_0x52438e['params']['id']}})[_0x784e('0x23')](handleEntityNotFound(_0x1aded3,null))['then'](saveUpdates(_0x52438e[_0x784e('0x48')],null))['then'](respondWithResult(_0x1aded3,null))[_0x784e('0x42')](handleError(_0x1aded3,null));};exports[_0x784e('0x24')]=function(_0x45d046,_0x2f332b){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x45d046[_0x784e('0x43')]['id']}})[_0x784e('0x23')](handleEntityNotFound(_0x2f332b,null))[_0x784e('0x23')](removeEntity(_0x2f332b,null))[_0x784e('0x42')](handleError(_0x2f332b,null));};exports[_0x784e('0x49')]=function(_0x539359,_0x51cc27){return db[_0x784e('0x2b')][_0x784e('0x49')]()['then'](respondWithResult(_0x51cc27,null))[_0x784e('0x42')](handleError(_0x51cc27,null));}; \ No newline at end of file +var _0xd101=['then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update'];(function(_0x3ce726,_0x4a7a8d){var _0x2cdef6=function(_0x25ae93){while(--_0x25ae93){_0x3ce726['push'](_0x3ce726['shift']());}};_0x2cdef6(++_0x4a7a8d);}(_0xd101,0xc1));var _0x1d10=function(_0x2b9d88,_0x569e02){_0x2b9d88=_0x2b9d88-0x0;var _0x92ad6a=_0xd101[_0x2b9d88];return _0x92ad6a;};'use strict';var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require(_0x1d10('0x4'));var BPromise=require(_0x1d10('0x5'));var Mustache=require(_0x1d10('0x6'));var util=require(_0x1d10('0x7'));var path=require(_0x1d10('0x8'));var sox=require('sox');var csv=require(_0x1d10('0x9'));var ejs=require(_0x1d10('0xa'));var fs=require('fs');var fs_extra=require(_0x1d10('0xb'));var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0x9'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var licenseUtil=require(_0x1d10('0x1b'));var db=require(_0x1d10('0x1c'))['db'];function respondWithStatusCode(_0x268506,_0x5b71d8){_0x5b71d8=_0x5b71d8||0xcc;return function(_0x3f6bd8){if(_0x3f6bd8){return _0x268506[_0x1d10('0x1d')](_0x5b71d8);}return _0x268506[_0x1d10('0x1e')](_0x5b71d8)[_0x1d10('0x1f')]();};}function respondWithResult(_0x2224ff,_0x183bc4){_0x183bc4=_0x183bc4||0xc8;return function(_0x56bc3d){if(_0x56bc3d){return _0x2224ff[_0x1d10('0x1e')](_0x183bc4)[_0x1d10('0x20')](_0x56bc3d);}};}function respondWithFilteredResult(_0x306953,_0x2ad3c0){return function(_0x4f014a){if(_0x4f014a){var _0x3aedf7=typeof _0x2ad3c0[_0x1d10('0x21')]===_0x1d10('0x22')&&typeof _0x2ad3c0[_0x1d10('0x23')]===_0x1d10('0x22');var _0x382b37=_0x4f014a[_0x1d10('0x24')];var _0x4f3e2a=_0x3aedf7?0x0:_0x2ad3c0[_0x1d10('0x21')];var _0x1163dd=_0x3aedf7?_0x4f014a[_0x1d10('0x24')]:_0x2ad3c0[_0x1d10('0x21')]+_0x2ad3c0[_0x1d10('0x23')];var _0x5e61f8;if(_0x1163dd>=_0x382b37){_0x1163dd=_0x382b37;_0x5e61f8=0xc8;}else{_0x5e61f8=0xce;}_0x306953['status'](_0x5e61f8);return _0x306953[_0x1d10('0x25')]('Content-Range',_0x4f3e2a+'-'+_0x1163dd+'/'+_0x382b37)['json'](_0x4f014a);}return null;};}function patchUpdates(_0x5774f9){return function(_0x237b92){try{jsonpatch[_0x1d10('0x26')](_0x237b92,_0x5774f9,!![]);}catch(_0x24717c){return BPromise[_0x1d10('0x27')](_0x24717c);}return _0x237b92['save']();};}function saveUpdates(_0x5e5315,_0x140147){return function(_0x5da6cf){if(_0x5da6cf){return _0x5da6cf[_0x1d10('0x28')](_0x5e5315)[_0x1d10('0x29')](function(_0x160802){return _0x160802;});}return null;};}function removeEntity(_0x37f22d,_0x127b37){return function(_0x3601ba){if(_0x3601ba){return _0x3601ba[_0x1d10('0x2a')]()[_0x1d10('0x29')](function(){_0x37f22d[_0x1d10('0x1e')](0xcc)[_0x1d10('0x1f')]();});}};}function handleEntityNotFound(_0xf1e4c8,_0x5abc58){return function(_0x666012){if(!_0x666012){_0xf1e4c8[_0x1d10('0x1d')](0x194);}return _0x666012;};}function handleError(_0x475934,_0x15f2ee){_0x15f2ee=_0x15f2ee||0x1f4;return function(_0x18e7d9){logger[_0x1d10('0x2b')](_0x18e7d9[_0x1d10('0x2c')]);if(_0x18e7d9[_0x1d10('0x2d')]){delete _0x18e7d9['name'];}_0x475934[_0x1d10('0x1e')](_0x15f2ee)[_0x1d10('0x2e')](_0x18e7d9);};}exports['index']=function(_0x13a3dc,_0x52d514){var _0x4db221={},_0x41b5b8={},_0x597aea={'count':0x0,'rows':[]};var _0xa4e6aa=_[_0x1d10('0x2f')](db[_0x1d10('0x30')][_0x1d10('0x31')],function(_0x1a43fd){return{'name':_0x1a43fd[_0x1d10('0x32')],'type':_0x1a43fd['type']['key']};});_0x41b5b8[_0x1d10('0x33')]=_[_0x1d10('0x2f')](_0xa4e6aa,_0x1d10('0x2d'));_0x41b5b8[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x13a3dc[_0x1d10('0x34')]);_0x41b5b8[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x41b5b8[_0x1d10('0x33')],_0x41b5b8[_0x1d10('0x34')]);_0x4db221['attributes']=_[_0x1d10('0x37')](_0x41b5b8['model'],qs[_0x1d10('0x38')](_0x13a3dc[_0x1d10('0x34')]['fields']));_0x4db221[_0x1d10('0x39')]=_0x4db221['attributes'][_0x1d10('0x3a')]?_0x4db221[_0x1d10('0x39')]:_0x41b5b8[_0x1d10('0x33')];if(!_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3b')]('nolimit')){_0x4db221['limit']=qs[_0x1d10('0x23')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x23')]);_0x4db221['offset']=qs['offset'](_0x13a3dc['query'][_0x1d10('0x21')]);}_0x4db221['order']=qs[_0x1d10('0x3c')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4db221[_0x1d10('0x3d')]=qs['filters'](_['pick'](_0x13a3dc[_0x1d10('0x34')],_0x41b5b8[_0x1d10('0x36')]),_0xa4e6aa);if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4db221['where']=_[_0x1d10('0x3f')](_0x4db221['where'],{'$or':_[_0x1d10('0x2f')](_0xa4e6aa,function(_0xec1f49){if(_0xec1f49[_0x1d10('0x40')]!==_0x1d10('0x41')){var _0x38addd={};_0x38addd[_0xec1f49[_0x1d10('0x2d')]]={'$like':'%'+_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]+'%'};return _0x38addd;}})});}_0x4db221=_[_0x1d10('0x3f')]({},_0x4db221,_0x13a3dc[_0x1d10('0x42')]);var _0x1cae38={'where':_0x4db221[_0x1d10('0x3d')]};return db[_0x1d10('0x30')]['count'](_0x1cae38)['then'](function(_0x35b2e3){_0x597aea[_0x1d10('0x24')]=_0x35b2e3;if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x43')]){_0x4db221[_0x1d10('0x44')]=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4db221);})['then'](function(_0x1a67e9){_0x597aea[_0x1d10('0x46')]=_0x1a67e9;return _0x597aea;})[_0x1d10('0x29')](respondWithFilteredResult(_0x52d514,_0x4db221))['catch'](handleError(_0x52d514,null));};exports[_0x1d10('0x47')]=function(_0x427cd7,_0x2ee987){var _0x598973={'raw':!![],'where':{'id':_0x427cd7[_0x1d10('0x48')]['id']}},_0x5795f1={};_0x5795f1[_0x1d10('0x33')]=_[_0x1d10('0x35')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5795f1[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x427cd7['query']);_0x5795f1[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x5795f1['model'],_0x5795f1[_0x1d10('0x34')]);_0x598973['attributes']=_[_0x1d10('0x37')](_0x5795f1['model'],qs['fields'](_0x427cd7[_0x1d10('0x34')][_0x1d10('0x38')]));_0x598973[_0x1d10('0x39')]=_0x598973[_0x1d10('0x39')][_0x1d10('0x3a')]?_0x598973[_0x1d10('0x39')]:_0x5795f1[_0x1d10('0x33')];if(_0x427cd7[_0x1d10('0x34')][_0x1d10('0x43')]){_0x598973['include']=[{'all':!![]}];}_0x598973=_['merge']({},_0x598973,_0x427cd7[_0x1d10('0x42')]);return db[_0x1d10('0x30')][_0x1d10('0x49')](_0x598973)[_0x1d10('0x29')](handleEntityNotFound(_0x2ee987,null))[_0x1d10('0x29')](respondWithResult(_0x2ee987,null))[_0x1d10('0x4a')](handleError(_0x2ee987,null));};exports['create']=function(_0x2db27f,_0x1b8513){return db[_0x1d10('0x30')][_0x1d10('0x4b')](_0x2db27f[_0x1d10('0x4c')],{})[_0x1d10('0x29')](respondWithResult(_0x1b8513,0xc9))[_0x1d10('0x4a')](handleError(_0x1b8513,null));};exports[_0x1d10('0x28')]=function(_0x39bf64,_0x32a9a9){if(_0x39bf64[_0x1d10('0x4c')]['id']){delete _0x39bf64[_0x1d10('0x4c')]['id'];}return db[_0x1d10('0x30')][_0x1d10('0x49')]({'where':{'id':_0x39bf64['params']['id']}})['then'](handleEntityNotFound(_0x32a9a9,null))[_0x1d10('0x29')](saveUpdates(_0x39bf64['body'],null))['then'](respondWithResult(_0x32a9a9,null))[_0x1d10('0x4a')](handleError(_0x32a9a9,null));};exports[_0x1d10('0x2a')]=function(_0x375fb1,_0x35d8fb){return db[_0x1d10('0x30')]['find']({'where':{'id':_0x375fb1['params']['id']}})['then'](handleEntityNotFound(_0x35d8fb,null))['then'](removeEntity(_0x35d8fb,null))[_0x1d10('0x4a')](handleError(_0x35d8fb,null));};exports[_0x1d10('0x4d')]=function(_0x4570c4,_0x3a4167){return db['JscriptyAnswerReport'][_0x1d10('0x4d')]()[_0x1d10('0x29')](respondWithResult(_0x3a4167,null))[_0x1d10('0x4a')](handleError(_0x3a4167,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 1da55f6..0816749 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 _0x5e8e=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./jscriptyAnswerReport.attributes','exports'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5e8e,0xbd));var _0xe5e8=function(_0x49d352,_0x2fa521){_0x49d352=_0x49d352-0x0;var _0x1fdb44=_0x5e8e[_0x49d352];return _0x1fdb44;};'use strict';var _=require(_0xe5e8('0x0'));var util=require('util');var logger=require(_0xe5e8('0x1'))(_0xe5e8('0x2'));var moment=require(_0xe5e8('0x3'));var BPromise=require(_0xe5e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5e8('0x5'));var rimraf=require(_0xe5e8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe5e8('0x7'));module[_0xe5e8('0x8')]=function(_0x3eccad,_0x5d8472){return _0x3eccad['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7222=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util','../../config/logger','moment','bluebird'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7222,0xba));var _0x2722=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x7222[_0x21774b];return _0x4675b2;};'use strict';var _=require('lodash');var util=require(_0x2722('0x0'));var logger=require(_0x2722('0x1'))('api');var moment=require(_0x2722('0x2'));var BPromise=require(_0x2722('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2722('0x4'));var config=require(_0x2722('0x5'));var attributes=require(_0x2722('0x6'));module[_0x2722('0x7')]=function(_0x2e5012,_0x4bd6e8){return _0x2e5012[_0x2722('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x2722('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 7c189f7..be25416 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 _0x000b=['ioredis','../../config/utils','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x293a72,_0x35e316){var _0x13fad6=function(_0x5c2276){while(--_0x5c2276){_0x293a72['push'](_0x293a72['shift']());}};_0x13fad6(++_0x35e316);}(_0x000b,0x1d7));var _0xb000=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x000b[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0xb000('0x0'));var util=require(_0xb000('0x1'));var moment=require(_0xb000('0x2'));var BPromise=require(_0xb000('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb000('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb000('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb000('0x6'));var client=jayson[_0xb000('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e4fcc,_0x384764,_0x42df44){return new BPromise(function(_0x1899c6,_0x1db608){return client[_0xb000('0x8')](_0x3e4fcc,_0x42df44)[_0xb000('0x9')](function(_0x47a3fb){logger[_0xb000('0xa')](_0xb000('0xb'),_0x384764,_0xb000('0xc'));logger[_0xb000('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x384764,_0xb000('0xc'),JSON[_0xb000('0xe')](_0x47a3fb));if(_0x47a3fb[_0xb000('0xf')]){if(_0x47a3fb[_0xb000('0xf')][_0xb000('0x10')]===0x1f4){logger[_0xb000('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x384764,_0x47a3fb[_0xb000('0xf')][_0xb000('0x11')]);return _0x1db608(_0x47a3fb[_0xb000('0xf')]['message']);}logger[_0xb000('0xf')](_0xb000('0xb'),_0x384764,_0x47a3fb['error']['message']);return _0x1899c6(_0x47a3fb[_0xb000('0xf')][_0xb000('0x11')]);}else{logger['info'](_0xb000('0xb'),_0x384764,'request\x20sent');_0x1899c6(_0x47a3fb[_0xb000('0x12')][_0xb000('0x11')]);}})['catch'](function(_0x32b287){logger[_0xb000('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x384764,_0x32b287);_0x1db608(_0x32b287);});});} \ No newline at end of file +var _0xed66=['randomstring','ioredis','rpc','jayson/promise','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3320f2,_0xdf25b8){var _0x391217=function(_0x53367e){while(--_0x53367e){_0x3320f2['push'](_0x3320f2['shift']());}};_0x391217(++_0xdf25b8);}(_0xed66,0x1a0));var _0x6ed6=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0xed66[_0x487131];return _0xf320ff;};'use strict';var _=require(_0x6ed6('0x0'));var util=require(_0x6ed6('0x1'));var moment=require(_0x6ed6('0x2'));var BPromise=require(_0x6ed6('0x3'));var rs=require(_0x6ed6('0x4'));var fs=require('fs');var Redis=require(_0x6ed6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ed6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6ed6('0x7'));var client=jayson['client'][_0x6ed6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57fbe3,_0x1c0bce,_0x3abdfd){return new BPromise(function(_0x5b9716,_0x3806b8){return client[_0x6ed6('0x9')](_0x57fbe3,_0x3abdfd)['then'](function(_0x4633d6){logger[_0x6ed6('0xa')](_0x6ed6('0xb'),_0x1c0bce,_0x6ed6('0xc'));logger[_0x6ed6('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x1c0bce,_0x6ed6('0xc'),JSON[_0x6ed6('0xe')](_0x4633d6));if(_0x4633d6['error']){if(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x10')]===0x1f4){logger[_0x6ed6('0xf')](_0x6ed6('0xb'),_0x1c0bce,_0x4633d6[_0x6ed6('0xf')]['message']);return _0x3806b8(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x11')]);}logger[_0x6ed6('0xf')](_0x6ed6('0xb'),_0x1c0bce,_0x4633d6[_0x6ed6('0xf')]['message']);return _0x5b9716(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x11')]);}else{logger['info'](_0x6ed6('0xb'),_0x1c0bce,_0x6ed6('0xc'));_0x5b9716(_0x4633d6[_0x6ed6('0x12')][_0x6ed6('0x11')]);}})[_0x6ed6('0x13')](function(_0x5c75b9){logger['error'](_0x6ed6('0xb'),_0x1c0bce,_0x5c75b9);_0x3806b8(_0x5c75b9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 4c1b6e5..71bb869 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 _0x1a61=['post','create','/:id/clone','clone','update','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers'];(function(_0x3cdafb,_0x5b0f25){var _0x40dde1=function(_0xafa86f){while(--_0xafa86f){_0x3cdafb['push'](_0x3cdafb['shift']());}};_0x40dde1(++_0x5b0f25);}(_0x1a61,0x1ec));var _0x11a6=function(_0x357f93,_0x1587d7){_0x357f93=_0x357f93-0x0;var _0x103216=_0x1a61[_0x357f93];return _0x103216;};'use strict';var multer=require(_0x11a6('0x0'));var util=require('util');var path=require(_0x11a6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x11a6('0x2'));var auth=require(_0x11a6('0x3'));var interaction=require(_0x11a6('0x4'));var config=require(_0x11a6('0x5'));var controller=require(_0x11a6('0x6'));router[_0x11a6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x11a6('0x8'),auth[_0x11a6('0x9')](),controller[_0x11a6('0xa')]);router[_0x11a6('0x7')]('/:id/sessions',auth[_0x11a6('0x9')](),controller[_0x11a6('0xb')]);router[_0x11a6('0x7')](_0x11a6('0xc'),auth['isAuthenticated'](),controller[_0x11a6('0xd')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller['getSummary']);router[_0x11a6('0xe')]('/',auth['isAuthenticated'](),controller[_0x11a6('0xf')]);router[_0x11a6('0xe')](_0x11a6('0x10'),auth[_0x11a6('0x9')](),controller[_0x11a6('0x11')]);router['put'](_0x11a6('0x8'),auth[_0x11a6('0x9')](),controller[_0x11a6('0x12')]);router[_0x11a6('0x13')](_0x11a6('0x8'),auth['isAuthenticated'](),controller[_0x11a6('0x14')]);module[_0x11a6('0x15')]=router; \ No newline at end of file +var _0xe004=['getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','delete','destroy','multer','util','path','Router','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers'];(function(_0x30c150,_0x42da71){var _0x159181=function(_0x211f59){while(--_0x211f59){_0x30c150['push'](_0x30c150['shift']());}};_0x159181(++_0x42da71);}(_0xe004,0x143));var _0x4e00=function(_0xbc6df4,_0x50f996){_0xbc6df4=_0xbc6df4-0x0;var _0x455609=_0xe004[_0xbc6df4];return _0x455609;};'use strict';var multer=require(_0x4e00('0x0'));var util=require(_0x4e00('0x1'));var path=require(_0x4e00('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e00('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e00('0x4'));var controller=require(_0x4e00('0x5'));router[_0x4e00('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4e00('0x6')](_0x4e00('0x7'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x9')]);router[_0x4e00('0x6')](_0x4e00('0xa'),auth[_0x4e00('0x8')](),controller[_0x4e00('0xb')]);router[_0x4e00('0x6')](_0x4e00('0xc'),auth['isAuthenticated'](),controller[_0x4e00('0xd')]);router[_0x4e00('0x6')](_0x4e00('0xe'),auth[_0x4e00('0x8')](),timeout(_0x4e00('0xf')),controller[_0x4e00('0x10')]);router[_0x4e00('0x11')]('/',auth[_0x4e00('0x8')](),controller[_0x4e00('0x12')]);router[_0x4e00('0x11')](_0x4e00('0x13'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x14')]);router['put'](_0x4e00('0x7'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x15')]);router[_0x4e00('0x16')](_0x4e00('0x7'),auth['isAuthenticated'](),controller[_0x4e00('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 3cfa213..9bd7e1f 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 _0x3c70=['setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','util','STRING','TEXT','isObjectLike','formData'];(function(_0x5dbb6d,_0x52d762){var _0x109686=function(_0x536542){while(--_0x536542){_0x5dbb6d['push'](_0x5dbb6d['shift']());}};_0x109686(++_0x52d762);}(_0x3c70,0xed));var _0x03c7=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x3c70[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x03c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x03c7('0x1')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x03c7('0x2')]('long'),'set':function(_0x456642){if(_[_0x03c7('0x3')](_0x456642)){this['setDataValue'](_0x03c7('0x4'),JSON['stringify'](_0x456642));}else if(_['isString'](_0x456642)){this['setDataValue'](_0x03c7('0x4'),_0x456642);}else{this[_0x03c7('0x5')](_0x03c7('0x4'),util['format'](_0x03c7('0x6'),this[_0x03c7('0x7')](_0x03c7('0x8'))||'',this['getDataValue'](_0x03c7('0x9'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x03c7('0xa')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc124=['description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x3ebabb,_0x1cef82){var _0x3488cf=function(_0x525578){while(--_0x525578){_0x3ebabb['push'](_0x3ebabb['shift']());}};_0x3488cf(++_0x1cef82);}(_0xc124,0x102));var _0x4c12=function(_0x15c4fb,_0x16ba98){_0x15c4fb=_0x15c4fb-0x0;var _0x57bf81=_0xc124[_0x15c4fb];return _0x57bf81;};'use strict';var Sequelize=require(_0x4c12('0x0'));var _=require(_0x4c12('0x1'));var util=require(_0x4c12('0x2'));module[_0x4c12('0x3')]={'name':{'type':Sequelize[_0x4c12('0x4')],'unique':_0x4c12('0x5')},'description':{'type':Sequelize[_0x4c12('0x4')]},'formData':{'type':Sequelize[_0x4c12('0x6')](_0x4c12('0x7')),'set':function(_0x4af878){if(_[_0x4c12('0x8')](_0x4af878)){this[_0x4c12('0x9')]('formData',JSON[_0x4c12('0xa')](_0x4af878));}else if(_['isString'](_0x4af878)){this[_0x4c12('0x9')](_0x4c12('0xb'),_0x4af878);}else{this[_0x4c12('0x9')](_0x4c12('0xb'),util['format'](_0x4c12('0xc'),this[_0x4c12('0xd')](_0x4c12('0x5'))||'',this['getDataValue'](_0x4c12('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4c12('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4c12('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e129aee..f5370bc 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 _0x5269=['mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','apply','save','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','merge','autoAssociation','getSessions','JscriptySessionReport','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','eml-format','moment','bluebird'];(function(_0x1e1c0b,_0x58f5c0){var _0x196ae7=function(_0x3c7199){while(--_0x3c7199){_0x1e1c0b['push'](_0x1e1c0b['shift']());}};_0x196ae7(++_0x58f5c0);}(_0x5269,0x150));var _0x9526=function(_0x78cf2f,_0x4c2c40){_0x78cf2f=_0x78cf2f-0x0;var _0x1b1be3=_0x5269[_0x78cf2f];return _0x1b1be3;};'use strict';var emlformat=require(_0x9526('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9526('0x1'));var BPromise=require(_0x9526('0x2'));var Mustache=require(_0x9526('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9526('0x4'));var csv=require('to-csv');var ejs=require(_0x9526('0x5'));var fs=require('fs');var fs_extra=require(_0x9526('0x6'));var _=require(_0x9526('0x7'));var squel=require(_0x9526('0x8'));var crypto=require(_0x9526('0x9'));var jsforce=require(_0x9526('0xa'));var deskjs=require(_0x9526('0xb'));var toCsv=require(_0x9526('0xc'));var querystring=require(_0x9526('0xd'));var Papa=require(_0x9526('0xe'));var Redis=require(_0x9526('0xf'));var authService=require(_0x9526('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9526('0x11'));var hardwareService=require(_0x9526('0x12'));var logger=require('../../config/logger')(_0x9526('0x13'));var utils=require(_0x9526('0x14'));var config=require(_0x9526('0x15'));var licenseUtil=require(_0x9526('0x16'));var db=require(_0x9526('0x17'))['db'];function respondWithStatusCode(_0x1304f5,_0x14dde8){_0x14dde8=_0x14dde8||0xcc;return function(_0x487158){if(_0x487158){return _0x1304f5[_0x9526('0x18')](_0x14dde8);}return _0x1304f5[_0x9526('0x19')](_0x14dde8)['end']();};}function respondWithResult(_0x3f9751,_0x13ca39){_0x13ca39=_0x13ca39||0xc8;return function(_0x530a5b){if(_0x530a5b){return _0x3f9751['status'](_0x13ca39)['json'](_0x530a5b);}};}function respondWithFilteredResult(_0x271aa7,_0x5bf7ec){return function(_0x20e6c7){if(_0x20e6c7){var _0x37feda=typeof _0x5bf7ec[_0x9526('0x1a')]===_0x9526('0x1b')&&typeof _0x5bf7ec[_0x9526('0x1c')]===_0x9526('0x1b');var _0x53aace=_0x20e6c7['count'];var _0xb10ba6=_0x37feda?0x0:_0x5bf7ec[_0x9526('0x1a')];var _0x282b21=_0x37feda?_0x20e6c7['count']:_0x5bf7ec[_0x9526('0x1a')]+_0x5bf7ec['limit'];var _0x13c1c5;if(_0x282b21>=_0x53aace){_0x282b21=_0x53aace;_0x13c1c5=0xc8;}else{_0x13c1c5=0xce;}_0x271aa7[_0x9526('0x19')](_0x13c1c5);return _0x271aa7[_0x9526('0x1d')]('Content-Range',_0xb10ba6+'-'+_0x282b21+'/'+_0x53aace)['json'](_0x20e6c7);}return null;};}function patchUpdates(_0x3bb291){return function(_0x1bfb23){try{jsonpatch[_0x9526('0x1e')](_0x1bfb23,_0x3bb291,!![]);}catch(_0x3b0699){return BPromise['reject'](_0x3b0699);}return _0x1bfb23[_0x9526('0x1f')]();};}function saveUpdates(_0x552868,_0x230c4a){return function(_0x421382){if(_0x421382){return _0x421382['update'](_0x552868)['then'](function(_0x4fdc84){return _0x4fdc84;});}return null;};}function removeEntity(_0x18c11a,_0x57c330){return function(_0x12449e){if(_0x12449e){return _0x12449e[_0x9526('0x20')]()[_0x9526('0x21')](function(){var _0x578288=_0x12449e[_0x9526('0x22')]({'plain':!![]});var _0x309c99=_0x9526('0x23');return db[_0x9526('0x24')][_0x9526('0x20')]({'where':{'type':_0x309c99,'resourceId':_0x578288['id']}})[_0x9526('0x21')](function(){return _0x12449e;});})[_0x9526('0x21')](function(){_0x18c11a[_0x9526('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc01fe,_0x205cbf){return function(_0x5a8713){if(!_0x5a8713){_0xdc01fe[_0x9526('0x18')](0x194);}return _0x5a8713;};}function handleError(_0x4ae9d2,_0x2f7b4d){_0x2f7b4d=_0x2f7b4d||0x1f4;return function(_0xfd0b7c){logger[_0x9526('0x25')](_0xfd0b7c[_0x9526('0x26')]);if(_0xfd0b7c[_0x9526('0x27')]){delete _0xfd0b7c[_0x9526('0x27')];}_0x4ae9d2[_0x9526('0x19')](_0x2f7b4d)[_0x9526('0x28')](_0xfd0b7c);};}exports['index']=function(_0x5729cf,_0x4e96dd){var _0x10dd77={},_0x3fe7ce={},_0x15a091={'count':0x0,'rows':[]};var _0x9601ed=_[_0x9526('0x29')](db[_0x9526('0x2a')][_0x9526('0x2b')],function(_0x19dc25){return{'name':_0x19dc25[_0x9526('0x2c')],'type':_0x19dc25['type']['key']};});_0x3fe7ce['model']=_[_0x9526('0x29')](_0x9601ed,_0x9526('0x27'));_0x3fe7ce[_0x9526('0x2d')]=_[_0x9526('0x2e')](_0x5729cf['query']);_0x3fe7ce[_0x9526('0x2f')]=_[_0x9526('0x30')](_0x3fe7ce[_0x9526('0x31')],_0x3fe7ce[_0x9526('0x2d')]);_0x10dd77[_0x9526('0x32')]=_['intersection'](_0x3fe7ce[_0x9526('0x31')],qs[_0x9526('0x33')](_0x5729cf[_0x9526('0x2d')][_0x9526('0x33')]));_0x10dd77[_0x9526('0x32')]=_0x10dd77[_0x9526('0x32')]['length']?_0x10dd77[_0x9526('0x32')]:_0x3fe7ce['model'];if(!_0x5729cf[_0x9526('0x2d')][_0x9526('0x34')](_0x9526('0x35'))){_0x10dd77[_0x9526('0x1c')]=qs['limit'](_0x5729cf['query'][_0x9526('0x1c')]);_0x10dd77[_0x9526('0x1a')]=qs[_0x9526('0x1a')](_0x5729cf['query'][_0x9526('0x1a')]);}_0x10dd77[_0x9526('0x36')]=qs[_0x9526('0x37')](_0x5729cf[_0x9526('0x2d')][_0x9526('0x37')]);_0x10dd77[_0x9526('0x38')]=qs[_0x9526('0x2f')](_[_0x9526('0x39')](_0x5729cf[_0x9526('0x2d')],_0x3fe7ce['filters']),_0x9601ed);if(_0x5729cf[_0x9526('0x2d')][_0x9526('0x3a')]){_0x10dd77[_0x9526('0x38')]=_['merge'](_0x10dd77[_0x9526('0x38')],{'$or':_['map'](_0x9601ed,function(_0x4153d5){if(_0x4153d5['type']!==_0x9526('0x3b')){var _0x43d2b1={};_0x43d2b1[_0x4153d5['name']]={'$like':'%'+_0x5729cf[_0x9526('0x2d')]['filter']+'%'};return _0x43d2b1;}})});}_0x10dd77=_['merge']({},_0x10dd77,_0x5729cf[_0x9526('0x3c')]);var _0xbb5ff5={'where':_0x10dd77[_0x9526('0x38')]};return db[_0x9526('0x2a')][_0x9526('0x3d')](_0xbb5ff5)[_0x9526('0x21')](function(_0x209f13){_0x15a091[_0x9526('0x3d')]=_0x209f13;if(_0x5729cf['query'][_0x9526('0x3e')]){_0x10dd77[_0x9526('0x3f')]=[{'all':!![]}];}return db['JscriptyProject'][_0x9526('0x40')](_0x10dd77);})[_0x9526('0x21')](function(_0xa0ad19){_0x15a091[_0x9526('0x41')]=_0xa0ad19;return _0x15a091;})[_0x9526('0x21')](respondWithFilteredResult(_0x4e96dd,_0x10dd77))[_0x9526('0x42')](handleError(_0x4e96dd,null));};exports[_0x9526('0x43')]=function(_0x391b55,_0x423bfc){var _0x1e07c2={'raw':![],'where':{'id':_0x391b55[_0x9526('0x44')]['id']}},_0x4066c1={};_0x4066c1[_0x9526('0x31')]=_['keys'](db[_0x9526('0x2a')]['rawAttributes']);_0x4066c1[_0x9526('0x2d')]=_[_0x9526('0x2e')](_0x391b55['query']);_0x4066c1[_0x9526('0x2f')]=_[_0x9526('0x30')](_0x4066c1[_0x9526('0x31')],_0x4066c1[_0x9526('0x2d')]);_0x1e07c2['attributes']=_[_0x9526('0x30')](_0x4066c1[_0x9526('0x31')],qs[_0x9526('0x33')](_0x391b55[_0x9526('0x2d')]['fields']));_0x1e07c2[_0x9526('0x32')]=_0x1e07c2[_0x9526('0x32')][_0x9526('0x45')]?_0x1e07c2[_0x9526('0x32')]:_0x4066c1['model'];if(_0x391b55[_0x9526('0x2d')][_0x9526('0x3e')]){_0x1e07c2['include']=[{'all':!![]}];}_0x1e07c2=_['merge']({},_0x1e07c2,_0x391b55['options']);return db[_0x9526('0x2a')][_0x9526('0x46')](_0x1e07c2)['then'](handleEntityNotFound(_0x423bfc,null))[_0x9526('0x21')](respondWithResult(_0x423bfc,null))['catch'](handleError(_0x423bfc,null));};exports[_0x9526('0x47')]=function(_0xe580c9,_0x10a251){return db[_0x9526('0x2a')]['create'](_0xe580c9[_0x9526('0x48')],{})[_0x9526('0x21')](function(_0x507efe){var _0x28955a=_0xe580c9[_0x9526('0x49')][_0x9526('0x22')]({'plain':!![]});if(!_0x28955a)throw new Error(_0x9526('0x4a'));if(_0x28955a['role']===_0x9526('0x49')){var _0xc38a0=_0x507efe[_0x9526('0x22')]({'plain':!![]});var _0x36883d='Projects';return db[_0x9526('0x4b')][_0x9526('0x46')]({'where':{'name':_0x36883d,'userProfileId':_0x28955a[_0x9526('0x4c')]},'raw':!![]})[_0x9526('0x21')](function(_0x4f28d1){if(_0x4f28d1&&_0x4f28d1['autoAssociation']===0x0){return db[_0x9526('0x24')][_0x9526('0x47')]({'name':_0xc38a0[_0x9526('0x27')],'resourceId':_0xc38a0['id'],'type':_0x4f28d1[_0x9526('0x27')],'sectionId':_0x4f28d1['id']},{})[_0x9526('0x21')](function(){return _0x507efe;});}else{return _0x507efe;}})['catch'](function(_0x3a564f){logger[_0x9526('0x25')](_0x9526('0x4d'),_0x3a564f);throw _0x3a564f;});}return _0x507efe;})[_0x9526('0x21')](respondWithResult(_0x10a251,0xc9))[_0x9526('0x42')](handleError(_0x10a251,null));};exports[_0x9526('0x4e')]=function(_0x5dd686,_0x16fa4b){var _0x1be7f9={'where':{'id':_0x5dd686['params']['id']}},_0x234099={};_0x234099[_0x9526('0x31')]=_[_0x9526('0x2e')](db[_0x9526('0x2a')][_0x9526('0x2b')]);_0x1be7f9[_0x9526('0x32')]=_[_0x9526('0x30')](_0x234099['model'],qs[_0x9526('0x33')](_0x5dd686[_0x9526('0x2d')][_0x9526('0x33')]));_0x1be7f9[_0x9526('0x32')]=_0x1be7f9['attributes'][_0x9526('0x45')]?_0x1be7f9[_0x9526('0x32')]:_0x234099['model'];if(_0x5dd686[_0x9526('0x2d')]['includeAll']){_0x1be7f9[_0x9526('0x3f')]=[{'all':!![]}];}_0x1be7f9=_['merge']({},_0x1be7f9,_0x5dd686[_0x9526('0x3c')]);return db[_0x9526('0x2a')][_0x9526('0x46')](_0x1be7f9)['then'](handleEntityNotFound(_0x16fa4b,null))['then'](function(_0x4ad123){if(_0x4ad123){var _0x4b8995=_0x4ad123[_0x9526('0x22')]({'plain':!![]});_0x4b8995=qs[_0x9526('0x4f')](_0x4b8995,['id',_0x9526('0x50'),_0x9526('0x51')]);_0x5dd686['body']=_[_0x9526('0x4f')](_0x5dd686['body'],['id',_0x9526('0x50'),_0x9526('0x51')]);return db[_0x9526('0x2a')][_0x9526('0x47')](_[_0x9526('0x52')](_0x4b8995,_0x5dd686['body']),{'include':_0x5dd686[_0x9526('0x2d')][_0x9526('0x3e')]?[{'all':!![]}]:undefined})[_0x9526('0x21')](function(_0x349dc5){var _0x166b70=_0x5dd686['user'][_0x9526('0x22')]({'plain':!![]});if(!_0x166b70)throw new Error(_0x9526('0x4a'));if(_0x166b70['role']===_0x9526('0x49')){var _0x10b844=_0x349dc5[_0x9526('0x22')]({'plain':!![]});var _0x37764d=_0x9526('0x23');return db[_0x9526('0x4b')][_0x9526('0x46')]({'where':{'name':_0x37764d,'userProfileId':_0x166b70[_0x9526('0x4c')]},'raw':!![]})['then'](function(_0x1f5de9){if(_0x1f5de9&&_0x1f5de9[_0x9526('0x53')]===0x0){return db[_0x9526('0x24')][_0x9526('0x47')]({'name':_0x10b844[_0x9526('0x27')],'resourceId':_0x10b844['id'],'type':_0x1f5de9[_0x9526('0x27')],'sectionId':_0x1f5de9['id']},{})[_0x9526('0x21')](function(){return _0x349dc5;});}else{return _0x349dc5;}})[_0x9526('0x42')](function(_0x1ef7b9){logger[_0x9526('0x25')](_0x9526('0x4d'),_0x1ef7b9);throw _0x1ef7b9;});}return _0x349dc5;});}})['then'](respondWithResult(_0x16fa4b,0xc9))[_0x9526('0x42')](handleError(_0x16fa4b,null));};exports['update']=function(_0x560e10,_0x22c7f7){if(_0x560e10[_0x9526('0x48')]['id']){delete _0x560e10['body']['id'];}return db['JscriptyProject'][_0x9526('0x46')]({'where':{'id':_0x560e10['params']['id']}})['then'](handleEntityNotFound(_0x22c7f7,null))[_0x9526('0x21')](saveUpdates(_0x560e10[_0x9526('0x48')],null))[_0x9526('0x21')](respondWithResult(_0x22c7f7,null))['catch'](handleError(_0x22c7f7,null));};exports[_0x9526('0x20')]=function(_0x4eacf6,_0x361cea){return db['JscriptyProject'][_0x9526('0x46')]({'where':{'id':_0x4eacf6[_0x9526('0x44')]['id']}})[_0x9526('0x21')](handleEntityNotFound(_0x361cea,null))[_0x9526('0x21')](removeEntity(_0x361cea,null))[_0x9526('0x42')](handleError(_0x361cea,null));};exports[_0x9526('0x54')]=function(_0x55b75c,_0x283531,_0x53dff8){var _0x294979={'raw':!![],'where':{}};var _0x5c3a08={};var _0x5f21f0={'count':0x0,'rows':[]};return db[_0x9526('0x2a')]['findOne']({'where':{'id':_0x55b75c['params']['id']}})[_0x9526('0x21')](handleEntityNotFound(_0x283531,null))['then'](function(_0x4592f9){if(_0x4592f9){_0x5c3a08[_0x9526('0x31')]=_[_0x9526('0x2e')](db[_0x9526('0x55')]['rawAttributes']);_0x5c3a08[_0x9526('0x2d')]=_[_0x9526('0x2e')](_0x55b75c['query']);_0x5c3a08[_0x9526('0x2f')]=_[_0x9526('0x30')](_0x5c3a08[_0x9526('0x31')],_0x5c3a08[_0x9526('0x2d')]);_0x294979[_0x9526('0x32')]=_[_0x9526('0x30')](_0x5c3a08[_0x9526('0x31')],qs['fields'](_0x55b75c[_0x9526('0x2d')][_0x9526('0x33')]));_0x294979[_0x9526('0x32')]=_0x294979['attributes'][_0x9526('0x45')]?_0x294979[_0x9526('0x32')]:_0x5c3a08[_0x9526('0x31')];if(!_0x55b75c[_0x9526('0x2d')][_0x9526('0x34')](_0x9526('0x35'))){_0x294979[_0x9526('0x1c')]=qs['limit'](_0x55b75c[_0x9526('0x2d')][_0x9526('0x1c')]);_0x294979[_0x9526('0x1a')]=qs[_0x9526('0x1a')](_0x55b75c['query'][_0x9526('0x1a')]);}_0x294979[_0x9526('0x36')]=qs['sort'](_0x55b75c['query'][_0x9526('0x37')]);_0x294979['where']=qs[_0x9526('0x2f')](_['pick'](_0x55b75c[_0x9526('0x2d')],_0x5c3a08[_0x9526('0x2f')]));_0x294979[_0x9526('0x38')][_0x9526('0x56')]=_0x4592f9['id'];if(_0x55b75c['query'][_0x9526('0x3a')]){_0x294979[_0x9526('0x38')]=_[_0x9526('0x52')](_0x294979[_0x9526('0x38')],{'$or':_[_0x9526('0x29')](_0x294979[_0x9526('0x32')],function(_0x1cc328){var _0x3b0ec8={};_0x3b0ec8[_0x1cc328]={'$like':'%'+_0x55b75c[_0x9526('0x2d')][_0x9526('0x3a')]+'%'};return _0x3b0ec8;})});}_0x294979=_[_0x9526('0x52')]({},_0x294979,_0x55b75c[_0x9526('0x3c')]);return db['JscriptySessionReport'][_0x9526('0x3d')]({'where':_0x294979[_0x9526('0x38')]})[_0x9526('0x21')](function(_0x2d12cd){_0x5f21f0[_0x9526('0x3d')]=_0x2d12cd;if(_0x55b75c[_0x9526('0x2d')][_0x9526('0x3e')]){_0x294979[_0x9526('0x3f')]=[{'all':!![]}];}return db[_0x9526('0x55')]['findAll'](_0x294979);})[_0x9526('0x21')](function(_0xb0c8cd){_0x5f21f0[_0x9526('0x41')]=_0xb0c8cd;return _0x5f21f0;});}})[_0x9526('0x21')](respondWithFilteredResult(_0x283531,_0x294979))[_0x9526('0x42')](handleError(_0x283531,null));};exports['getAnswers']=function(_0x173260,_0x5c1f1f,_0x869f8b){var _0xc4606a={'raw':!![],'where':{}};var _0x3482bd={};var _0x2cf73f={'count':0x0,'rows':[]};return db[_0x9526('0x2a')][_0x9526('0x57')]({'where':{'id':_0x173260[_0x9526('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c1f1f,null))['then'](function(_0x336d92){if(_0x336d92){_0x3482bd[_0x9526('0x31')]=_[_0x9526('0x2e')](db[_0x9526('0x58')][_0x9526('0x2b')]);_0x3482bd['query']=_['keys'](_0x173260[_0x9526('0x2d')]);_0x3482bd[_0x9526('0x2f')]=_[_0x9526('0x30')](_0x3482bd['model'],_0x3482bd[_0x9526('0x2d')]);_0xc4606a['attributes']=_[_0x9526('0x30')](_0x3482bd['model'],qs['fields'](_0x173260[_0x9526('0x2d')]['fields']));_0xc4606a[_0x9526('0x32')]=_0xc4606a['attributes'][_0x9526('0x45')]?_0xc4606a[_0x9526('0x32')]:_0x3482bd['model'];if(!_0x173260[_0x9526('0x2d')][_0x9526('0x34')](_0x9526('0x35'))){_0xc4606a[_0x9526('0x1c')]=qs[_0x9526('0x1c')](_0x173260[_0x9526('0x2d')]['limit']);_0xc4606a['offset']=qs[_0x9526('0x1a')](_0x173260[_0x9526('0x2d')]['offset']);}_0xc4606a[_0x9526('0x36')]=qs['sort'](_0x173260[_0x9526('0x2d')][_0x9526('0x37')]);_0xc4606a[_0x9526('0x38')]=qs[_0x9526('0x2f')](_['pick'](_0x173260[_0x9526('0x2d')],_0x3482bd['filters']));_0xc4606a['where'][_0x9526('0x56')]=_0x336d92['id'];if(_0x173260[_0x9526('0x2d')][_0x9526('0x3a')]){_0xc4606a[_0x9526('0x38')]=_[_0x9526('0x52')](_0xc4606a[_0x9526('0x38')],{'$or':_[_0x9526('0x29')](_0xc4606a[_0x9526('0x32')],function(_0x2b53dc){var _0x3babdf={};_0x3babdf[_0x2b53dc]={'$like':'%'+_0x173260[_0x9526('0x2d')]['filter']+'%'};return _0x3babdf;})});}_0xc4606a=_[_0x9526('0x52')]({},_0xc4606a,_0x173260[_0x9526('0x3c')]);return db[_0x9526('0x58')][_0x9526('0x3d')]({'where':_0xc4606a['where']})['then'](function(_0xb8ef03){_0x2cf73f[_0x9526('0x3d')]=_0xb8ef03;if(_0x173260[_0x9526('0x2d')][_0x9526('0x3e')]){_0xc4606a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0xc4606a);})[_0x9526('0x21')](function(_0x4c5eb4){_0x2cf73f[_0x9526('0x41')]=_0x4c5eb4;return _0x2cf73f;});}})[_0x9526('0x21')](respondWithFilteredResult(_0x5c1f1f,_0xc4606a))[_0x9526('0x42')](handleError(_0x5c1f1f,null));};function char(_0x4e2e6f){return _0x9526('0x59')===typeof _0x4e2e6f?String[_0x9526('0x5a')][_0x9526('0x1e')](null,arguments):_0x4e2e6f;}function needsEncapsulation(_0x177337){return!!_0x177337&&(_0x177337[_0x9526('0x5b')]()['indexOf'](char(0xd))>=0x0||_0x177337[_0x9526('0x5b')]()[_0x9526('0x5c')](char(0xa))>=0x0||_0x177337[_0x9526('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x177337['toString']()[_0x9526('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x682f5a){var _0x448ba0=char(0x22),_0x3d5ecb='\x5c'+char(0x22),_0x289c88=_0x682f5a['toString']()[_0x9526('0x5d')](new RegExp(_0x448ba0,'g'),_0x3d5ecb);return _0x448ba0+_0x289c88+_0x448ba0;}exports[_0x9526('0x5e')]=function(_0x10afff,_0x5afd33,_0x2ff0a4){var _0x493535,_0x128844;var _0x5380b2={'where':{'ProjectId':_0x10afff[_0x9526('0x44')]['id']}};if(_0x10afff[_0x9526('0x2d')][_0x9526('0x5f')]){_0x5380b2[_0x9526('0x38')][_0x9526('0x60')]=JSON[_0x9526('0x61')](_0x10afff[_0x9526('0x2d')]['startTime']);}return db['JscriptySessionReport'][_0x9526('0x40')](_0x5380b2)['then'](handleEntityNotFound(_0x5afd33,null))[_0x9526('0x21')](function(_0x1f2238){if(_0x1f2238){_0x493535=_0x1f2238;return db[_0x9526('0x62')]['findAll']({'where':{'SessionId':{'$in':_[_0x9526('0x29')](_0x493535,'id')},'ProjectId':_0x10afff['params']['id']},'order':'-createdAt'});}})[_0x9526('0x21')](handleEntityNotFound(_0x5afd33,null))['then'](function(_0x1aed98){if(_0x1aed98){_0x128844=_0x1aed98;var _0x430636={};for(var _0x35cf79=0x0,_0x2c19ee=_0x128844[_0x9526('0x45')];_0x35cf79<_0x2c19ee;_0x35cf79++){if(!_0x430636[_0x9526('0x34')](_0x128844[_0x35cf79]['questionId'])){_0x430636[_0x128844[_0x35cf79][_0x9526('0x63')]]=needsEncapsulation(_0x128844[_0x35cf79]['question'])?encapsulate(_0x128844[_0x35cf79][_0x9526('0x64')]):_0x128844[_0x35cf79][_0x9526('0x64')];}}var _0x2183ec=[],_0x114f89={};for(var _0x3dc9fd=0x0,_0x425823=_0x493535[_0x9526('0x45')];_0x3dc9fd<_0x425823;_0x3dc9fd++){_0x114f89={'ProjectId':_0x10afff[_0x9526('0x44')]['id'],'SessionId':_0x493535[_0x3dc9fd]['id'],'StartTime':moment(_0x493535[_0x3dc9fd]['starttime'])[_0x9526('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x398f41=0x0,_0x2c7d9e=_0x128844[_0x9526('0x45')];_0x398f41<_0x2c7d9e;_0x398f41++){if(_0x128844[_0x398f41][_0x9526('0x66')]==_0x493535[_0x3dc9fd]['id']&&_0x430636[_0x9526('0x34')](_0x128844[_0x398f41][_0x9526('0x63')])){_0x114f89[_0x430636[_0x128844[_0x398f41][_0x9526('0x63')]]]=_0x128844[_0x398f41][_0x9526('0x67')];}}for(var _0x49ccec in _0x430636){if(!_0x114f89[_0x9526('0x34')](_0x430636[_0x49ccec])){_0x114f89[_0x430636[_0x49ccec]]=null;}}_0x2183ec[_0x9526('0x68')](_0x114f89);}return _0x2183ec;}})[_0x9526('0x21')](function(_0x4dd3f5){if(!_['isEmpty'](_0x4dd3f5)){var _0xe9e284=toCsv(_0x4dd3f5);var _0x9442d0=Date[_0x9526('0x69')]();fs[_0x9526('0x6a')](util['format'](_0x9526('0x6b'),_0x10afff[_0x9526('0x44')]['id'],_0x9442d0),_0xe9e284);_0x5afd33[_0x9526('0x6c')](_0x9526('0x6d'),_0x9526('0x6e')+util[_0x9526('0x65')]('Jscripty_Project_%d_Summary_%s.csv',_0x10afff[_0x9526('0x44')]['id'],_0x9442d0));_0x5afd33['setHeader'](_0x9526('0x6f'),'text/csv');return _0x5afd33[_0x9526('0x70')](util[_0x9526('0x65')](_0x9526('0x6b'),_0x10afff[_0x9526('0x44')]['id'],_0x9442d0));}else{return _0x5afd33[_0x9526('0x18')](0xcc);}})[_0x9526('0x42')](handleError(_0x5afd33,null));}; \ No newline at end of file +var _0x7461=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','fields','length','body','user','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','Projects','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../mysqldb','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7461,0xdb));var _0x1746=function(_0x5230eb,_0x29ec8a){_0x5230eb=_0x5230eb-0x0;var _0x23e301=_0x7461[_0x5230eb];return _0x23e301;};'use strict';var emlformat=require(_0x1746('0x0'));var rimraf=require(_0x1746('0x1'));var zipdir=require(_0x1746('0x2'));var jsonpatch=require(_0x1746('0x3'));var rp=require(_0x1746('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1746('0x5'));var sox=require(_0x1746('0x6'));var csv=require(_0x1746('0x7'));var ejs=require(_0x1746('0x8'));var fs=require('fs');var fs_extra=require(_0x1746('0x9'));var _=require(_0x1746('0xa'));var squel=require(_0x1746('0xb'));var crypto=require(_0x1746('0xc'));var jsforce=require(_0x1746('0xd'));var deskjs=require(_0x1746('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1746('0xf'));var Papa=require('papaparse');var Redis=require(_0x1746('0x10'));var authService=require(_0x1746('0x11'));var qs=require(_0x1746('0x12'));var as=require(_0x1746('0x13'));var hardwareService=require(_0x1746('0x14'));var logger=require(_0x1746('0x15'))(_0x1746('0x16'));var utils=require(_0x1746('0x17'));var config=require(_0x1746('0x18'));var licenseUtil=require(_0x1746('0x19'));var db=require(_0x1746('0x1a'))['db'];function respondWithStatusCode(_0x39b57e,_0x35f0b0){_0x35f0b0=_0x35f0b0||0xcc;return function(_0x11ea81){if(_0x11ea81){return _0x39b57e[_0x1746('0x1b')](_0x35f0b0);}return _0x39b57e[_0x1746('0x1c')](_0x35f0b0)[_0x1746('0x1d')]();};}function respondWithResult(_0x243cad,_0x2b2ec8){_0x2b2ec8=_0x2b2ec8||0xc8;return function(_0x5654d7){if(_0x5654d7){return _0x243cad[_0x1746('0x1c')](_0x2b2ec8)[_0x1746('0x1e')](_0x5654d7);}};}function respondWithFilteredResult(_0x19f09d,_0x3bb7bd){return function(_0x34880f){if(_0x34880f){var _0x32e67f=typeof _0x3bb7bd['offset']===_0x1746('0x1f')&&typeof _0x3bb7bd[_0x1746('0x20')]===_0x1746('0x1f');var _0x1f4dd5=_0x34880f[_0x1746('0x21')];var _0x47aaf4=_0x32e67f?0x0:_0x3bb7bd[_0x1746('0x22')];var _0x1545c3=_0x32e67f?_0x34880f[_0x1746('0x21')]:_0x3bb7bd[_0x1746('0x22')]+_0x3bb7bd['limit'];var _0x4461f2;if(_0x1545c3>=_0x1f4dd5){_0x1545c3=_0x1f4dd5;_0x4461f2=0xc8;}else{_0x4461f2=0xce;}_0x19f09d[_0x1746('0x1c')](_0x4461f2);return _0x19f09d[_0x1746('0x23')](_0x1746('0x24'),_0x47aaf4+'-'+_0x1545c3+'/'+_0x1f4dd5)[_0x1746('0x1e')](_0x34880f);}return null;};}function patchUpdates(_0xab2a5a){return function(_0x28ecc0){try{jsonpatch[_0x1746('0x25')](_0x28ecc0,_0xab2a5a,!![]);}catch(_0x9e1a77){return BPromise[_0x1746('0x26')](_0x9e1a77);}return _0x28ecc0[_0x1746('0x27')]();};}function saveUpdates(_0x34f0d8,_0xb87d6e){return function(_0x4b737b){if(_0x4b737b){return _0x4b737b[_0x1746('0x28')](_0x34f0d8)['then'](function(_0x16e9dc){return _0x16e9dc;});}return null;};}function removeEntity(_0x51a380,_0x3428be){return function(_0x4b9ab2){if(_0x4b9ab2){return _0x4b9ab2['destroy']()[_0x1746('0x29')](function(){var _0x188e64=_0x4b9ab2[_0x1746('0x2a')]({'plain':!![]});var _0x59fc66='Projects';return db[_0x1746('0x2b')][_0x1746('0x2c')]({'where':{'type':_0x59fc66,'resourceId':_0x188e64['id']}})[_0x1746('0x29')](function(){return _0x4b9ab2;});})['then'](function(){_0x51a380['status'](0xcc)[_0x1746('0x1d')]();});}};}function handleEntityNotFound(_0x513e31,_0x54dc1e){return function(_0x2bbbca){if(!_0x2bbbca){_0x513e31[_0x1746('0x1b')](0x194);}return _0x2bbbca;};}function handleError(_0x20dc43,_0x1c4d47){_0x1c4d47=_0x1c4d47||0x1f4;return function(_0x2124f3){logger[_0x1746('0x2d')](_0x2124f3[_0x1746('0x2e')]);if(_0x2124f3[_0x1746('0x2f')]){delete _0x2124f3['name'];}_0x20dc43[_0x1746('0x1c')](_0x1c4d47)['send'](_0x2124f3);};}exports[_0x1746('0x30')]=function(_0xaea714,_0x6e58c3){var _0x49ba0e={},_0x286396={},_0x21a2d0={'count':0x0,'rows':[]};var _0x1fff91=_[_0x1746('0x31')](db[_0x1746('0x32')][_0x1746('0x33')],function(_0xd7d9c1){return{'name':_0xd7d9c1[_0x1746('0x34')],'type':_0xd7d9c1[_0x1746('0x35')][_0x1746('0x36')]};});_0x286396[_0x1746('0x37')]=_['map'](_0x1fff91,_0x1746('0x2f'));_0x286396[_0x1746('0x38')]=_['keys'](_0xaea714[_0x1746('0x38')]);_0x286396[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x286396[_0x1746('0x37')],_0x286396['query']);_0x49ba0e['attributes']=_['intersection'](_0x286396[_0x1746('0x37')],qs['fields'](_0xaea714['query']['fields']));_0x49ba0e[_0x1746('0x3b')]=_0x49ba0e['attributes']['length']?_0x49ba0e[_0x1746('0x3b')]:_0x286396[_0x1746('0x37')];if(!_0xaea714['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x49ba0e[_0x1746('0x20')]=qs[_0x1746('0x20')](_0xaea714[_0x1746('0x38')][_0x1746('0x20')]);_0x49ba0e[_0x1746('0x22')]=qs['offset'](_0xaea714[_0x1746('0x38')][_0x1746('0x22')]);}_0x49ba0e[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0xaea714[_0x1746('0x38')][_0x1746('0x3f')]);_0x49ba0e[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0xaea714['query'],_0x286396[_0x1746('0x39')]),_0x1fff91);if(_0xaea714[_0x1746('0x38')][_0x1746('0x42')]){_0x49ba0e['where']=_[_0x1746('0x43')](_0x49ba0e[_0x1746('0x40')],{'$or':_[_0x1746('0x31')](_0x1fff91,function(_0x5a5b65){if(_0x5a5b65[_0x1746('0x35')]!==_0x1746('0x44')){var _0x25b757={};_0x25b757[_0x5a5b65[_0x1746('0x2f')]]={'$like':'%'+_0xaea714['query'][_0x1746('0x42')]+'%'};return _0x25b757;}})});}_0x49ba0e=_[_0x1746('0x43')]({},_0x49ba0e,_0xaea714[_0x1746('0x45')]);var _0x2bc28d={'where':_0x49ba0e[_0x1746('0x40')]};return db['JscriptyProject'][_0x1746('0x21')](_0x2bc28d)[_0x1746('0x29')](function(_0x33033b){_0x21a2d0[_0x1746('0x21')]=_0x33033b;if(_0xaea714[_0x1746('0x38')][_0x1746('0x46')]){_0x49ba0e[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x32')][_0x1746('0x48')](_0x49ba0e);})['then'](function(_0x1589bd){_0x21a2d0[_0x1746('0x49')]=_0x1589bd;return _0x21a2d0;})['then'](respondWithFilteredResult(_0x6e58c3,_0x49ba0e))[_0x1746('0x4a')](handleError(_0x6e58c3,null));};exports['show']=function(_0x5225ca,_0x20b9d7){var _0x24296a={'raw':![],'where':{'id':_0x5225ca['params']['id']}},_0x3eec47={};_0x3eec47['model']=_['keys'](db['JscriptyProject'][_0x1746('0x33')]);_0x3eec47[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x5225ca[_0x1746('0x38')]);_0x3eec47[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x3eec47[_0x1746('0x37')],_0x3eec47[_0x1746('0x38')]);_0x24296a['attributes']=_['intersection'](_0x3eec47[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x5225ca['query'][_0x1746('0x4c')]));_0x24296a['attributes']=_0x24296a[_0x1746('0x3b')][_0x1746('0x4d')]?_0x24296a[_0x1746('0x3b')]:_0x3eec47[_0x1746('0x37')];if(_0x5225ca[_0x1746('0x38')][_0x1746('0x46')]){_0x24296a[_0x1746('0x47')]=[{'all':!![]}];}_0x24296a=_[_0x1746('0x43')]({},_0x24296a,_0x5225ca['options']);return db[_0x1746('0x32')]['find'](_0x24296a)[_0x1746('0x29')](handleEntityNotFound(_0x20b9d7,null))[_0x1746('0x29')](respondWithResult(_0x20b9d7,null))['catch'](handleError(_0x20b9d7,null));};exports['create']=function(_0xf04149,_0x4eb440){return db[_0x1746('0x32')]['create'](_0xf04149[_0x1746('0x4e')],{})[_0x1746('0x29')](function(_0x57fdaa){var _0xb3c7ef=_0xf04149[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0xb3c7ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb3c7ef[_0x1746('0x50')]===_0x1746('0x4f')){var _0x1441bc=_0x57fdaa[_0x1746('0x2a')]({'plain':!![]});var _0x20962b='Projects';return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x20962b,'userProfileId':_0xb3c7ef[_0x1746('0x53')]},'raw':!![]})[_0x1746('0x29')](function(_0x5a5560){if(_0x5a5560&&_0x5a5560['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x1441bc[_0x1746('0x2f')],'resourceId':_0x1441bc['id'],'type':_0x5a5560[_0x1746('0x2f')],'sectionId':_0x5a5560['id']},{})[_0x1746('0x29')](function(){return _0x57fdaa;});}else{return _0x57fdaa;}})[_0x1746('0x4a')](function(_0x4a3971){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4a3971);throw _0x4a3971;});}return _0x57fdaa;})[_0x1746('0x29')](respondWithResult(_0x4eb440,0xc9))[_0x1746('0x4a')](handleError(_0x4eb440,null));};exports[_0x1746('0x56')]=function(_0x2158dc,_0x218e8c){var _0x5ae343={'where':{'id':_0x2158dc[_0x1746('0x57')]['id']}},_0x34f96e={};_0x34f96e['model']=_[_0x1746('0x4b')](db['JscriptyProject'][_0x1746('0x33')]);_0x5ae343['attributes']=_[_0x1746('0x3a')](_0x34f96e[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x2158dc['query'][_0x1746('0x4c')]));_0x5ae343[_0x1746('0x3b')]=_0x5ae343[_0x1746('0x3b')][_0x1746('0x4d')]?_0x5ae343[_0x1746('0x3b')]:_0x34f96e[_0x1746('0x37')];if(_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]){_0x5ae343[_0x1746('0x47')]=[{'all':!![]}];}_0x5ae343=_['merge']({},_0x5ae343,_0x2158dc[_0x1746('0x45')]);return db['JscriptyProject'][_0x1746('0x52')](_0x5ae343)[_0x1746('0x29')](handleEntityNotFound(_0x218e8c,null))['then'](function(_0x1c2c23){if(_0x1c2c23){var _0x14c0cf=_0x1c2c23[_0x1746('0x2a')]({'plain':!![]});_0x14c0cf=qs[_0x1746('0x58')](_0x14c0cf,['id',_0x1746('0x59'),_0x1746('0x5a')]);_0x2158dc[_0x1746('0x4e')]=_[_0x1746('0x58')](_0x2158dc['body'],['id',_0x1746('0x59'),_0x1746('0x5a')]);return db[_0x1746('0x32')][_0x1746('0x54')](_['merge'](_0x14c0cf,_0x2158dc[_0x1746('0x4e')]),{'include':_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x57cac5){var _0x248654=_0x2158dc[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0x248654)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x248654[_0x1746('0x50')]===_0x1746('0x4f')){var _0x46b111=_0x57cac5[_0x1746('0x2a')]({'plain':!![]});var _0x3b591a=_0x1746('0x5b');return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x3b591a,'userProfileId':_0x248654[_0x1746('0x53')]},'raw':!![]})['then'](function(_0x566188){if(_0x566188&&_0x566188['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x46b111[_0x1746('0x2f')],'resourceId':_0x46b111['id'],'type':_0x566188[_0x1746('0x2f')],'sectionId':_0x566188['id']},{})['then'](function(){return _0x57cac5;});}else{return _0x57cac5;}})[_0x1746('0x4a')](function(_0x4fd808){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4fd808);throw _0x4fd808;});}return _0x57cac5;});}})[_0x1746('0x29')](respondWithResult(_0x218e8c,0xc9))['catch'](handleError(_0x218e8c,null));};exports[_0x1746('0x28')]=function(_0x4b1e77,_0x42beff){if(_0x4b1e77['body']['id']){delete _0x4b1e77[_0x1746('0x4e')]['id'];}return db['JscriptyProject'][_0x1746('0x52')]({'where':{'id':_0x4b1e77['params']['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x42beff,null))[_0x1746('0x29')](saveUpdates(_0x4b1e77[_0x1746('0x4e')],null))[_0x1746('0x29')](respondWithResult(_0x42beff,null))[_0x1746('0x4a')](handleError(_0x42beff,null));};exports['destroy']=function(_0x4b641a,_0x5dd2cc){return db[_0x1746('0x32')][_0x1746('0x52')]({'where':{'id':_0x4b641a[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x5dd2cc,null))[_0x1746('0x29')](removeEntity(_0x5dd2cc,null))[_0x1746('0x4a')](handleError(_0x5dd2cc,null));};exports[_0x1746('0x5c')]=function(_0x57b391,_0x376bf0,_0x353336){var _0x797f0f={'raw':!![],'where':{}};var _0x221782={};var _0x224d07={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x57b391[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x376bf0,null))[_0x1746('0x29')](function(_0x145c23){if(_0x145c23){_0x221782['model']=_[_0x1746('0x4b')](db[_0x1746('0x5e')][_0x1746('0x33')]);_0x221782[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x57b391[_0x1746('0x38')]);_0x221782[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x221782[_0x1746('0x37')],_0x221782[_0x1746('0x38')]);_0x797f0f[_0x1746('0x3b')]=_['intersection'](_0x221782['model'],qs['fields'](_0x57b391[_0x1746('0x38')][_0x1746('0x4c')]));_0x797f0f[_0x1746('0x3b')]=_0x797f0f[_0x1746('0x3b')][_0x1746('0x4d')]?_0x797f0f[_0x1746('0x3b')]:_0x221782['model'];if(!_0x57b391[_0x1746('0x38')]['hasOwnProperty'](_0x1746('0x3d'))){_0x797f0f[_0x1746('0x20')]=qs['limit'](_0x57b391['query']['limit']);_0x797f0f[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x57b391[_0x1746('0x38')][_0x1746('0x22')]);}_0x797f0f[_0x1746('0x3e')]=qs['sort'](_0x57b391[_0x1746('0x38')][_0x1746('0x3f')]);_0x797f0f[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0x57b391['query'],_0x221782[_0x1746('0x39')]));_0x797f0f[_0x1746('0x40')][_0x1746('0x5f')]=_0x145c23['id'];if(_0x57b391['query'][_0x1746('0x42')]){_0x797f0f[_0x1746('0x40')]=_['merge'](_0x797f0f['where'],{'$or':_[_0x1746('0x31')](_0x797f0f[_0x1746('0x3b')],function(_0x255f35){var _0x27965c={};_0x27965c[_0x255f35]={'$like':'%'+_0x57b391[_0x1746('0x38')][_0x1746('0x42')]+'%'};return _0x27965c;})});}_0x797f0f=_[_0x1746('0x43')]({},_0x797f0f,_0x57b391[_0x1746('0x45')]);return db[_0x1746('0x5e')][_0x1746('0x21')]({'where':_0x797f0f[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x1054f0){_0x224d07[_0x1746('0x21')]=_0x1054f0;if(_0x57b391[_0x1746('0x38')][_0x1746('0x46')]){_0x797f0f['include']=[{'all':!![]}];}return db[_0x1746('0x5e')]['findAll'](_0x797f0f);})[_0x1746('0x29')](function(_0x16b3c6){_0x224d07[_0x1746('0x49')]=_0x16b3c6;return _0x224d07;});}})['then'](respondWithFilteredResult(_0x376bf0,_0x797f0f))[_0x1746('0x4a')](handleError(_0x376bf0,null));};exports[_0x1746('0x60')]=function(_0x12ec14,_0xa184e5,_0x506fb3){var _0x42523a={'raw':!![],'where':{}};var _0x188e7a={};var _0x491a79={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x12ec14[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0xa184e5,null))[_0x1746('0x29')](function(_0x4cb009){if(_0x4cb009){_0x188e7a[_0x1746('0x37')]=_['keys'](db[_0x1746('0x61')][_0x1746('0x33')]);_0x188e7a['query']=_[_0x1746('0x4b')](_0x12ec14[_0x1746('0x38')]);_0x188e7a[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x188e7a[_0x1746('0x37')],_0x188e7a[_0x1746('0x38')]);_0x42523a['attributes']=_[_0x1746('0x3a')](_0x188e7a['model'],qs[_0x1746('0x4c')](_0x12ec14[_0x1746('0x38')]['fields']));_0x42523a['attributes']=_0x42523a['attributes']['length']?_0x42523a[_0x1746('0x3b')]:_0x188e7a[_0x1746('0x37')];if(!_0x12ec14['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x42523a[_0x1746('0x20')]=qs[_0x1746('0x20')](_0x12ec14['query'][_0x1746('0x20')]);_0x42523a[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x12ec14[_0x1746('0x38')]['offset']);}_0x42523a[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0x12ec14['query'][_0x1746('0x3f')]);_0x42523a[_0x1746('0x40')]=qs[_0x1746('0x39')](_['pick'](_0x12ec14['query'],_0x188e7a['filters']));_0x42523a[_0x1746('0x40')][_0x1746('0x5f')]=_0x4cb009['id'];if(_0x12ec14[_0x1746('0x38')][_0x1746('0x42')]){_0x42523a[_0x1746('0x40')]=_[_0x1746('0x43')](_0x42523a['where'],{'$or':_['map'](_0x42523a[_0x1746('0x3b')],function(_0x76a9b3){var _0x114a0c={};_0x114a0c[_0x76a9b3]={'$like':'%'+_0x12ec14['query']['filter']+'%'};return _0x114a0c;})});}_0x42523a=_[_0x1746('0x43')]({},_0x42523a,_0x12ec14[_0x1746('0x45')]);return db['JscriptyAnswerReport'][_0x1746('0x21')]({'where':_0x42523a[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x4d59de){_0x491a79[_0x1746('0x21')]=_0x4d59de;if(_0x12ec14[_0x1746('0x38')][_0x1746('0x46')]){_0x42523a[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x61')]['findAll'](_0x42523a);})[_0x1746('0x29')](function(_0x583731){_0x491a79[_0x1746('0x49')]=_0x583731;return _0x491a79;});}})[_0x1746('0x29')](respondWithFilteredResult(_0xa184e5,_0x42523a))[_0x1746('0x4a')](handleError(_0xa184e5,null));};function char(_0x22f0eb){return _0x1746('0x62')===typeof _0x22f0eb?String[_0x1746('0x63')][_0x1746('0x25')](null,arguments):_0x22f0eb;}function needsEncapsulation(_0x55a4a2){return!!_0x55a4a2&&(_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0xd))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0xa))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0x22))>=0x0);}function encapsulate(_0x3568d7){var _0x1750a9=char(0x22),_0x42bd62='\x5c'+char(0x22),_0xf6928a=_0x3568d7['toString']()[_0x1746('0x66')](new RegExp(_0x1750a9,'g'),_0x42bd62);return _0x1750a9+_0xf6928a+_0x1750a9;}exports[_0x1746('0x67')]=function(_0x5c5828,_0x56058b,_0xe6ae7f){var _0x111a26,_0x246f07;var _0xbaba90={'where':{'ProjectId':_0x5c5828[_0x1746('0x57')]['id']}};if(_0x5c5828[_0x1746('0x38')][_0x1746('0x68')]){_0xbaba90[_0x1746('0x40')]['starttime']=JSON[_0x1746('0x69')](_0x5c5828['query']['startTime']);}return db[_0x1746('0x5e')][_0x1746('0x48')](_0xbaba90)['then'](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x378847){if(_0x378847){_0x111a26=_0x378847;return db[_0x1746('0x6a')][_0x1746('0x48')]({'where':{'SessionId':{'$in':_[_0x1746('0x31')](_0x111a26,'id')},'ProjectId':_0x5c5828[_0x1746('0x57')]['id']},'order':_0x1746('0x6b')});}})[_0x1746('0x29')](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x2bc6fa){if(_0x2bc6fa){_0x246f07=_0x2bc6fa;var _0x591bae={};for(var _0x37e82c=0x0,_0xe7f2e8=_0x246f07[_0x1746('0x4d')];_0x37e82c<_0xe7f2e8;_0x37e82c++){if(!_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37e82c][_0x1746('0x6c')])){_0x591bae[_0x246f07[_0x37e82c]['questionId']]=needsEncapsulation(_0x246f07[_0x37e82c][_0x1746('0x6d')])?encapsulate(_0x246f07[_0x37e82c][_0x1746('0x6d')]):_0x246f07[_0x37e82c][_0x1746('0x6d')];}}var _0x44a213=[],_0x3de2e8={};for(var _0x40dddd=0x0,_0x4956bf=_0x111a26['length'];_0x40dddd<_0x4956bf;_0x40dddd++){_0x3de2e8={'ProjectId':_0x5c5828['params']['id'],'SessionId':_0x111a26[_0x40dddd]['id'],'StartTime':moment(_0x111a26[_0x40dddd]['starttime'])[_0x1746('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x37820f=0x0,_0x21e042=_0x246f07['length'];_0x37820f<_0x21e042;_0x37820f++){if(_0x246f07[_0x37820f]['SessionId']==_0x111a26[_0x40dddd]['id']&&_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37820f][_0x1746('0x6c')])){_0x3de2e8[_0x591bae[_0x246f07[_0x37820f][_0x1746('0x6c')]]]=_0x246f07[_0x37820f][_0x1746('0x6f')];}}for(var _0x3ef419 in _0x591bae){if(!_0x3de2e8[_0x1746('0x3c')](_0x591bae[_0x3ef419])){_0x3de2e8[_0x591bae[_0x3ef419]]=null;}}_0x44a213[_0x1746('0x70')](_0x3de2e8);}return _0x44a213;}})[_0x1746('0x29')](function(_0x17e73b){if(!_[_0x1746('0x71')](_0x17e73b)){var _0x47b794=toCsv(_0x17e73b);var _0x24ca28=Date[_0x1746('0x72')]();fs[_0x1746('0x73')](util[_0x1746('0x6e')](_0x1746('0x74'),_0x5c5828['params']['id'],_0x24ca28),_0x47b794);_0x56058b[_0x1746('0x75')](_0x1746('0x76'),_0x1746('0x77')+util[_0x1746('0x6e')](_0x1746('0x78'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));_0x56058b[_0x1746('0x75')](_0x1746('0x79'),_0x1746('0x7a'));return _0x56058b[_0x1746('0x7b')](util['format'](_0x1746('0x74'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));}else{return _0x56058b['sendStatus'](0xcc);}})[_0x1746('0x4a')](handleError(_0x56058b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e7c002c..e572ea9 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 _0x8ba0=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x480686,_0x5d1ca5){_0x480686=_0x480686-0x0;var _0x111b11=_0x8ba0[_0x480686];return _0x111b11;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var logger=require(_0x08ba('0x2'))(_0x08ba('0x3'));var moment=require(_0x08ba('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ba('0x5'));var rimraf=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var attributes=require(_0x08ba('0x8'));module[_0x08ba('0x9')]=function(_0x161a9d,_0x5f29fa){return _0x161a9d[_0x08ba('0xa')](_0x08ba('0xb'),attributes,{'tableName':_0x08ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2208=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects'];(function(_0x16fe59,_0x1c6343){var _0x123472=function(_0x3cf1fd){while(--_0x3cf1fd){_0x16fe59['push'](_0x16fe59['shift']());}};_0x123472(++_0x1c6343);}(_0x2208,0x11e));var _0x8220=function(_0x44f6b7,_0x5b75af){_0x44f6b7=_0x44f6b7-0x0;var _0x5d612a=_0x2208[_0x44f6b7];return _0x5d612a;};'use strict';var _=require('lodash');var util=require(_0x8220('0x0'));var logger=require('../../config/logger')(_0x8220('0x1'));var moment=require('moment');var BPromise=require(_0x8220('0x2'));var rp=require(_0x8220('0x3'));var fs=require('fs');var path=require(_0x8220('0x4'));var rimraf=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var attributes=require(_0x8220('0x7'));module['exports']=function(_0x31a112,_0x4dd1a0){return _0x31a112[_0x8220('0x8')](_0x8220('0x9'),attributes,{'tableName':_0x8220('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index b888805..96325de 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(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5d8fe8,_0x186b6b){var _0x364d5e=function(_0x32d78f){while(--_0x32d78f){_0x5d8fe8['push'](_0x5d8fe8['shift']());}};_0x364d5e(++_0x186b6b);}(_0x70e0,0x17b));var _0x070e=function(_0x3af97b,_0x13c1c9){_0x3af97b=_0x3af97b-0x0;var _0x5ddb5e=_0x70e0[_0x3af97b];return _0x5ddb5e;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c0868d4..c350a08 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 _0xde6a=['util','path','express','Router','fs-extra','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x5d0bbe,_0x46e0d3){var _0x24720b=function(_0xae9ac3){while(--_0xae9ac3){_0x5d0bbe['push'](_0x5d0bbe['shift']());}};_0x24720b(++_0x46e0d3);}(_0xde6a,0xe9));var _0xade6=function(_0x1979d3,_0x54e5b1){_0x1979d3=_0x1979d3-0x0;var _0x44db88=_0xde6a[_0x1979d3];return _0x44db88;};'use strict';var multer=require(_0xade6('0x0'));var util=require(_0xade6('0x1'));var path=require(_0xade6('0x2'));var timeout=require('connect-timeout');var express=require(_0xade6('0x3'));var router=express[_0xade6('0x4')]();var fs_extra=require(_0xade6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xade6('0x6'));var controller=require(_0xade6('0x7'));router[_0xade6('0x8')]('/',auth[_0xade6('0x9')](),controller['index']);router[_0xade6('0x8')](_0xade6('0xa'),auth[_0xade6('0x9')](),controller['describe']);router['get'](_0xade6('0xb'),auth['isAuthenticated'](),controller[_0xade6('0xc')]);router['post']('/',auth[_0xade6('0x9')](),controller[_0xade6('0xd')]);router[_0xade6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xade6('0xf')]);router['delete'](_0xade6('0xb'),auth[_0xade6('0x9')](),controller[_0xade6('0x10')]);module[_0xade6('0x11')]=router; \ No newline at end of file +var _0xbe5c=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','show','create','put','/:id'];(function(_0x21beb4,_0x21fb6a){var _0x1c1741=function(_0xdcfe42){while(--_0xdcfe42){_0x21beb4['push'](_0x21beb4['shift']());}};_0x1c1741(++_0x21fb6a);}(_0xbe5c,0xd4));var _0xcbe5=function(_0x1f3e0e,_0x13d788){_0x1f3e0e=_0x1f3e0e-0x0;var _0x400ebe=_0xbe5c[_0x1f3e0e];return _0x400ebe;};'use strict';var multer=require(_0xcbe5('0x0'));var util=require(_0xcbe5('0x1'));var path=require(_0xcbe5('0x2'));var timeout=require(_0xcbe5('0x3'));var express=require(_0xcbe5('0x4'));var router=express['Router']();var fs_extra=require(_0xcbe5('0x5'));var auth=require(_0xcbe5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcbe5('0x7'));router[_0xcbe5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcbe5('0x8')](_0xcbe5('0x9'),auth[_0xcbe5('0xa')](),controller[_0xcbe5('0xb')]);router[_0xcbe5('0x8')]('/:id',auth[_0xcbe5('0xa')](),controller[_0xcbe5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcbe5('0xd')]);router[_0xcbe5('0xe')](_0xcbe5('0xf'),auth['isAuthenticated'](),controller[_0xcbe5('0x10')]);router[_0xcbe5('0x11')]('/:id',auth[_0xcbe5('0xa')](),controller['destroy']);module[_0xcbe5('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 45c7635..bb3238a 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x219c25,_0x4db55d){_0x219c25=_0x219c25-0x0;var _0x360ddf=_0x7a54[_0x219c25];return _0x360ddf;};'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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x27ad44,_0x51566a){_0x27ad44=_0x27ad44-0x0;var _0x575f20=_0x7a54[_0x27ad44];return _0x575f20;};'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 6665b8a..10da4e3 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 _0xc64d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x55e847,_0x17c083){var _0x53bd20=function(_0x59c0b0){while(--_0x59c0b0){_0x55e847['push'](_0x55e847['shift']());}};_0x53bd20(++_0x17c083);}(_0xc64d,0x166));var _0xdc64=function(_0x10f5ac,_0x100be9){_0x10f5ac=_0x10f5ac-0x0;var _0x4a6f68=_0xc64d[_0x10f5ac];return _0x4a6f68;};'use strict';var emlformat=require(_0xdc64('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc64('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdc64('0x2'));var Mustache=require(_0xdc64('0x3'));var util=require(_0xdc64('0x4'));var path=require(_0xdc64('0x5'));var sox=require(_0xdc64('0x6'));var csv=require(_0xdc64('0x7'));var ejs=require(_0xdc64('0x8'));var fs=require('fs');var fs_extra=require(_0xdc64('0x9'));var _=require(_0xdc64('0xa'));var squel=require(_0xdc64('0xb'));var crypto=require(_0xdc64('0xc'));var jsforce=require(_0xdc64('0xd'));var deskjs=require(_0xdc64('0xe'));var toCsv=require(_0xdc64('0x7'));var querystring=require(_0xdc64('0xf'));var Papa=require(_0xdc64('0x10'));var Redis=require(_0xdc64('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc64('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc64('0x13'));var logger=require(_0xdc64('0x14'))(_0xdc64('0x15'));var utils=require(_0xdc64('0x16'));var config=require(_0xdc64('0x17'));var licenseUtil=require(_0xdc64('0x18'));var db=require(_0xdc64('0x19'))['db'];function respondWithStatusCode(_0x52336b,_0x523ede){_0x523ede=_0x523ede||0xcc;return function(_0x560d06){if(_0x560d06){return _0x52336b[_0xdc64('0x1a')](_0x523ede);}return _0x52336b[_0xdc64('0x1b')](_0x523ede)[_0xdc64('0x1c')]();};}function respondWithResult(_0x58144f,_0x4fd338){_0x4fd338=_0x4fd338||0xc8;return function(_0x477c63){if(_0x477c63){return _0x58144f[_0xdc64('0x1b')](_0x4fd338)[_0xdc64('0x1d')](_0x477c63);}};}function respondWithFilteredResult(_0x7c3d52,_0xfac962){return function(_0x144a86){if(_0x144a86){var _0x4ff781=typeof _0xfac962[_0xdc64('0x1e')]===_0xdc64('0x1f')&&typeof _0xfac962['limit']==='undefined';var _0x2033f3=_0x144a86[_0xdc64('0x20')];var _0x283735=_0x4ff781?0x0:_0xfac962[_0xdc64('0x1e')];var _0x56f0b2=_0x4ff781?_0x144a86[_0xdc64('0x20')]:_0xfac962[_0xdc64('0x1e')]+_0xfac962[_0xdc64('0x21')];var _0x3c798e;if(_0x56f0b2>=_0x2033f3){_0x56f0b2=_0x2033f3;_0x3c798e=0xc8;}else{_0x3c798e=0xce;}_0x7c3d52[_0xdc64('0x1b')](_0x3c798e);return _0x7c3d52['set'](_0xdc64('0x22'),_0x283735+'-'+_0x56f0b2+'/'+_0x2033f3)[_0xdc64('0x1d')](_0x144a86);}return null;};}function patchUpdates(_0x373b1f){return function(_0x385c4a){try{jsonpatch[_0xdc64('0x23')](_0x385c4a,_0x373b1f,!![]);}catch(_0x49a914){return BPromise[_0xdc64('0x24')](_0x49a914);}return _0x385c4a[_0xdc64('0x25')]();};}function saveUpdates(_0x57b446,_0xeba8f8){return function(_0x225374){if(_0x225374){return _0x225374[_0xdc64('0x26')](_0x57b446)[_0xdc64('0x27')](function(_0x2ca43b){return _0x2ca43b;});}return null;};}function removeEntity(_0x2731ce,_0x4d0602){return function(_0x15cca6){if(_0x15cca6){return _0x15cca6[_0xdc64('0x28')]()['then'](function(){_0x2731ce[_0xdc64('0x1b')](0xcc)[_0xdc64('0x1c')]();});}};}function handleEntityNotFound(_0x48d181,_0x2b596d){return function(_0x406e9d){if(!_0x406e9d){_0x48d181['sendStatus'](0x194);}return _0x406e9d;};}function handleError(_0x3ce211,_0xd3da18){_0xd3da18=_0xd3da18||0x1f4;return function(_0x3a9fbe){logger[_0xdc64('0x29')](_0x3a9fbe[_0xdc64('0x2a')]);if(_0x3a9fbe[_0xdc64('0x2b')]){delete _0x3a9fbe[_0xdc64('0x2b')];}_0x3ce211['status'](_0xd3da18)['send'](_0x3a9fbe);};}exports[_0xdc64('0x2c')]=function(_0x1c0e0a,_0x76ffce){var _0x4eb607={},_0x275103={},_0x45f161={'count':0x0,'rows':[]};var _0x541a94=_[_0xdc64('0x2d')](db[_0xdc64('0x2e')][_0xdc64('0x2f')],function(_0x14612d){return{'name':_0x14612d[_0xdc64('0x30')],'type':_0x14612d[_0xdc64('0x31')][_0xdc64('0x32')]};});_0x275103['model']=_['map'](_0x541a94,'name');_0x275103[_0xdc64('0x33')]=_[_0xdc64('0x34')](_0x1c0e0a[_0xdc64('0x33')]);_0x275103['filters']=_[_0xdc64('0x35')](_0x275103[_0xdc64('0x36')],_0x275103[_0xdc64('0x33')]);_0x4eb607[_0xdc64('0x37')]=_['intersection'](_0x275103['model'],qs[_0xdc64('0x38')](_0x1c0e0a['query'][_0xdc64('0x38')]));_0x4eb607[_0xdc64('0x37')]=_0x4eb607[_0xdc64('0x37')][_0xdc64('0x39')]?_0x4eb607[_0xdc64('0x37')]:_0x275103[_0xdc64('0x36')];if(!_0x1c0e0a[_0xdc64('0x33')][_0xdc64('0x3a')](_0xdc64('0x3b'))){_0x4eb607['limit']=qs[_0xdc64('0x21')](_0x1c0e0a[_0xdc64('0x33')][_0xdc64('0x21')]);_0x4eb607[_0xdc64('0x1e')]=qs[_0xdc64('0x1e')](_0x1c0e0a[_0xdc64('0x33')][_0xdc64('0x1e')]);}_0x4eb607['order']=qs[_0xdc64('0x3c')](_0x1c0e0a[_0xdc64('0x33')]['sort']);_0x4eb607[_0xdc64('0x3d')]=qs[_0xdc64('0x3e')](_['pick'](_0x1c0e0a[_0xdc64('0x33')],_0x275103[_0xdc64('0x3e')]),_0x541a94);if(_0x1c0e0a['query'][_0xdc64('0x3f')]){_0x4eb607[_0xdc64('0x3d')]=_['merge'](_0x4eb607['where'],{'$or':_[_0xdc64('0x2d')](_0x541a94,function(_0x58c229){if(_0x58c229[_0xdc64('0x31')]!==_0xdc64('0x40')){var _0x3d2226={};_0x3d2226[_0x58c229[_0xdc64('0x2b')]]={'$like':'%'+_0x1c0e0a[_0xdc64('0x33')][_0xdc64('0x3f')]+'%'};return _0x3d2226;}})});}_0x4eb607=_['merge']({},_0x4eb607,_0x1c0e0a[_0xdc64('0x41')]);var _0x2f6edb={'where':_0x4eb607['where']};return db['JscriptyQuestionReport'][_0xdc64('0x20')](_0x2f6edb)[_0xdc64('0x27')](function(_0x4094d5){_0x45f161[_0xdc64('0x20')]=_0x4094d5;if(_0x1c0e0a[_0xdc64('0x33')]['includeAll']){_0x4eb607[_0xdc64('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xdc64('0x43')](_0x4eb607);})[_0xdc64('0x27')](function(_0x47f893){_0x45f161[_0xdc64('0x44')]=_0x47f893;return _0x45f161;})[_0xdc64('0x27')](respondWithFilteredResult(_0x76ffce,_0x4eb607))[_0xdc64('0x45')](handleError(_0x76ffce,null));};exports[_0xdc64('0x46')]=function(_0x1ac416,_0x3d9b69){var _0x4de13c={'raw':!![],'where':{'id':_0x1ac416[_0xdc64('0x47')]['id']}},_0x38d313={};_0x38d313[_0xdc64('0x36')]=_['keys'](db[_0xdc64('0x2e')][_0xdc64('0x2f')]);_0x38d313['query']=_[_0xdc64('0x34')](_0x1ac416['query']);_0x38d313[_0xdc64('0x3e')]=_[_0xdc64('0x35')](_0x38d313[_0xdc64('0x36')],_0x38d313[_0xdc64('0x33')]);_0x4de13c['attributes']=_[_0xdc64('0x35')](_0x38d313['model'],qs[_0xdc64('0x38')](_0x1ac416[_0xdc64('0x33')][_0xdc64('0x38')]));_0x4de13c[_0xdc64('0x37')]=_0x4de13c[_0xdc64('0x37')][_0xdc64('0x39')]?_0x4de13c[_0xdc64('0x37')]:_0x38d313[_0xdc64('0x36')];if(_0x1ac416[_0xdc64('0x33')]['includeAll']){_0x4de13c[_0xdc64('0x42')]=[{'all':!![]}];}_0x4de13c=_['merge']({},_0x4de13c,_0x1ac416[_0xdc64('0x41')]);return db[_0xdc64('0x2e')][_0xdc64('0x48')](_0x4de13c)[_0xdc64('0x27')](handleEntityNotFound(_0x3d9b69,null))[_0xdc64('0x27')](respondWithResult(_0x3d9b69,null))[_0xdc64('0x45')](handleError(_0x3d9b69,null));};exports['create']=function(_0x40170a,_0x37ce58){return db[_0xdc64('0x2e')][_0xdc64('0x49')](_0x40170a[_0xdc64('0x4a')],{})[_0xdc64('0x27')](respondWithResult(_0x37ce58,0xc9))[_0xdc64('0x45')](handleError(_0x37ce58,null));};exports[_0xdc64('0x26')]=function(_0x27392b,_0x457335){if(_0x27392b['body']['id']){delete _0x27392b[_0xdc64('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0xdc64('0x48')]({'where':{'id':_0x27392b[_0xdc64('0x47')]['id']}})['then'](handleEntityNotFound(_0x457335,null))[_0xdc64('0x27')](saveUpdates(_0x27392b['body'],null))[_0xdc64('0x27')](respondWithResult(_0x457335,null))[_0xdc64('0x45')](handleError(_0x457335,null));};exports['destroy']=function(_0x4a8cd3,_0x280f12){return db['JscriptyQuestionReport'][_0xdc64('0x48')]({'where':{'id':_0x4a8cd3[_0xdc64('0x47')]['id']}})[_0xdc64('0x27')](handleEntityNotFound(_0x280f12,null))['then'](removeEntity(_0x280f12,null))[_0xdc64('0x45')](handleError(_0x280f12,null));};exports[_0xdc64('0x4b')]=function(_0x5e6dc3,_0x59afe4){return db[_0xdc64('0x2e')]['describe']()[_0xdc64('0x27')](respondWithResult(_0x59afe4,null))[_0xdc64('0x45')](handleError(_0x59afe4,null));}; \ No newline at end of file +var _0x12a6=['include','findAll','catch','show','params','keys','intersection','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','JscriptyQuestionReport','count','includeAll'];(function(_0x32583a,_0x491c77){var _0x1955c2=function(_0x43dd99){while(--_0x43dd99){_0x32583a['push'](_0x32583a['shift']());}};_0x1955c2(++_0x491c77);}(_0x12a6,0x1c8));var _0x612a=function(_0x24d711,_0x3cdb28){_0x24d711=_0x24d711-0x0;var _0x3491b4=_0x12a6[_0x24d711];return _0x3491b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x612a('0x0'));var zipdir=require(_0x612a('0x1'));var jsonpatch=require(_0x612a('0x2'));var rp=require(_0x612a('0x3'));var moment=require('moment');var BPromise=require(_0x612a('0x4'));var Mustache=require(_0x612a('0x5'));var util=require(_0x612a('0x6'));var path=require(_0x612a('0x7'));var sox=require(_0x612a('0x8'));var csv=require('to-csv');var ejs=require(_0x612a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x612a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x612a('0xb'));var toCsv=require(_0x612a('0xc'));var querystring=require('querystring');var Papa=require(_0x612a('0xd'));var Redis=require(_0x612a('0xe'));var authService=require(_0x612a('0xf'));var qs=require(_0x612a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x612a('0x11'));var logger=require(_0x612a('0x12'))(_0x612a('0x13'));var utils=require(_0x612a('0x14'));var config=require(_0x612a('0x15'));var licenseUtil=require(_0x612a('0x16'));var db=require(_0x612a('0x17'))['db'];function respondWithStatusCode(_0x136751,_0x1b54c6){_0x1b54c6=_0x1b54c6||0xcc;return function(_0x283b4b){if(_0x283b4b){return _0x136751[_0x612a('0x18')](_0x1b54c6);}return _0x136751[_0x612a('0x19')](_0x1b54c6)[_0x612a('0x1a')]();};}function respondWithResult(_0x3788d1,_0x4a012a){_0x4a012a=_0x4a012a||0xc8;return function(_0x5dca6d){if(_0x5dca6d){return _0x3788d1[_0x612a('0x19')](_0x4a012a)[_0x612a('0x1b')](_0x5dca6d);}};}function respondWithFilteredResult(_0x565bcb,_0x5078ff){return function(_0x3ab782){if(_0x3ab782){var _0x4fd788=typeof _0x5078ff[_0x612a('0x1c')]===_0x612a('0x1d')&&typeof _0x5078ff['limit']===_0x612a('0x1d');var _0x4b3bcb=_0x3ab782['count'];var _0x22379c=_0x4fd788?0x0:_0x5078ff[_0x612a('0x1c')];var _0x83b8d9=_0x4fd788?_0x3ab782['count']:_0x5078ff[_0x612a('0x1c')]+_0x5078ff[_0x612a('0x1e')];var _0x1304bb;if(_0x83b8d9>=_0x4b3bcb){_0x83b8d9=_0x4b3bcb;_0x1304bb=0xc8;}else{_0x1304bb=0xce;}_0x565bcb[_0x612a('0x19')](_0x1304bb);return _0x565bcb[_0x612a('0x1f')](_0x612a('0x20'),_0x22379c+'-'+_0x83b8d9+'/'+_0x4b3bcb)[_0x612a('0x1b')](_0x3ab782);}return null;};}function patchUpdates(_0x3ef518){return function(_0x5290b7){try{jsonpatch[_0x612a('0x21')](_0x5290b7,_0x3ef518,!![]);}catch(_0x58d6f8){return BPromise[_0x612a('0x22')](_0x58d6f8);}return _0x5290b7[_0x612a('0x23')]();};}function saveUpdates(_0x28bc1b,_0x44e0c2){return function(_0x4ae33a){if(_0x4ae33a){return _0x4ae33a[_0x612a('0x24')](_0x28bc1b)[_0x612a('0x25')](function(_0x2dd574){return _0x2dd574;});}return null;};}function removeEntity(_0x275305,_0xfe5aa2){return function(_0x3e0c03){if(_0x3e0c03){return _0x3e0c03[_0x612a('0x26')]()[_0x612a('0x25')](function(){_0x275305[_0x612a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253854,_0x33c309){return function(_0x381d5b){if(!_0x381d5b){_0x253854[_0x612a('0x18')](0x194);}return _0x381d5b;};}function handleError(_0x3ca710,_0xc9f5f8){_0xc9f5f8=_0xc9f5f8||0x1f4;return function(_0x2791ab){logger[_0x612a('0x27')](_0x2791ab[_0x612a('0x28')]);if(_0x2791ab[_0x612a('0x29')]){delete _0x2791ab['name'];}_0x3ca710[_0x612a('0x19')](_0xc9f5f8)[_0x612a('0x2a')](_0x2791ab);};}exports[_0x612a('0x2b')]=function(_0x156800,_0x12bc58){var _0x36d84b={},_0x59a4c0={},_0xb77e03={'count':0x0,'rows':[]};var _0x58e030=_[_0x612a('0x2c')](db['JscriptyQuestionReport'][_0x612a('0x2d')],function(_0x1ed70b){return{'name':_0x1ed70b['fieldName'],'type':_0x1ed70b[_0x612a('0x2e')][_0x612a('0x2f')]};});_0x59a4c0[_0x612a('0x30')]=_[_0x612a('0x2c')](_0x58e030,_0x612a('0x29'));_0x59a4c0[_0x612a('0x31')]=_['keys'](_0x156800[_0x612a('0x31')]);_0x59a4c0[_0x612a('0x32')]=_['intersection'](_0x59a4c0[_0x612a('0x30')],_0x59a4c0[_0x612a('0x31')]);_0x36d84b[_0x612a('0x33')]=_['intersection'](_0x59a4c0[_0x612a('0x30')],qs[_0x612a('0x34')](_0x156800[_0x612a('0x31')][_0x612a('0x34')]));_0x36d84b[_0x612a('0x33')]=_0x36d84b[_0x612a('0x33')][_0x612a('0x35')]?_0x36d84b[_0x612a('0x33')]:_0x59a4c0['model'];if(!_0x156800['query']['hasOwnProperty'](_0x612a('0x36'))){_0x36d84b[_0x612a('0x1e')]=qs['limit'](_0x156800[_0x612a('0x31')][_0x612a('0x1e')]);_0x36d84b[_0x612a('0x1c')]=qs[_0x612a('0x1c')](_0x156800[_0x612a('0x31')][_0x612a('0x1c')]);}_0x36d84b['order']=qs[_0x612a('0x37')](_0x156800[_0x612a('0x31')][_0x612a('0x37')]);_0x36d84b[_0x612a('0x38')]=qs['filters'](_[_0x612a('0x39')](_0x156800[_0x612a('0x31')],_0x59a4c0[_0x612a('0x32')]),_0x58e030);if(_0x156800['query'][_0x612a('0x3a')]){_0x36d84b[_0x612a('0x38')]=_['merge'](_0x36d84b[_0x612a('0x38')],{'$or':_[_0x612a('0x2c')](_0x58e030,function(_0x560cb1){if(_0x560cb1[_0x612a('0x2e')]!=='VIRTUAL'){var _0x1c274a={};_0x1c274a[_0x560cb1[_0x612a('0x29')]]={'$like':'%'+_0x156800[_0x612a('0x31')][_0x612a('0x3a')]+'%'};return _0x1c274a;}})});}_0x36d84b=_['merge']({},_0x36d84b,_0x156800['options']);var _0x19d8ff={'where':_0x36d84b[_0x612a('0x38')]};return db[_0x612a('0x3b')][_0x612a('0x3c')](_0x19d8ff)['then'](function(_0x4608ee){_0xb77e03[_0x612a('0x3c')]=_0x4608ee;if(_0x156800[_0x612a('0x31')][_0x612a('0x3d')]){_0x36d84b[_0x612a('0x3e')]=[{'all':!![]}];}return db[_0x612a('0x3b')][_0x612a('0x3f')](_0x36d84b);})[_0x612a('0x25')](function(_0x5cd486){_0xb77e03['rows']=_0x5cd486;return _0xb77e03;})[_0x612a('0x25')](respondWithFilteredResult(_0x12bc58,_0x36d84b))[_0x612a('0x40')](handleError(_0x12bc58,null));};exports[_0x612a('0x41')]=function(_0x2e241b,_0x12c197){var _0xa3aa20={'raw':!![],'where':{'id':_0x2e241b[_0x612a('0x42')]['id']}},_0x24ddb5={};_0x24ddb5[_0x612a('0x30')]=_['keys'](db['JscriptyQuestionReport'][_0x612a('0x2d')]);_0x24ddb5[_0x612a('0x31')]=_[_0x612a('0x43')](_0x2e241b[_0x612a('0x31')]);_0x24ddb5[_0x612a('0x32')]=_[_0x612a('0x44')](_0x24ddb5[_0x612a('0x30')],_0x24ddb5[_0x612a('0x31')]);_0xa3aa20['attributes']=_[_0x612a('0x44')](_0x24ddb5[_0x612a('0x30')],qs[_0x612a('0x34')](_0x2e241b[_0x612a('0x31')][_0x612a('0x34')]));_0xa3aa20['attributes']=_0xa3aa20[_0x612a('0x33')][_0x612a('0x35')]?_0xa3aa20[_0x612a('0x33')]:_0x24ddb5['model'];if(_0x2e241b[_0x612a('0x31')][_0x612a('0x3d')]){_0xa3aa20[_0x612a('0x3e')]=[{'all':!![]}];}_0xa3aa20=_[_0x612a('0x45')]({},_0xa3aa20,_0x2e241b['options']);return db[_0x612a('0x3b')][_0x612a('0x46')](_0xa3aa20)[_0x612a('0x25')](handleEntityNotFound(_0x12c197,null))['then'](respondWithResult(_0x12c197,null))['catch'](handleError(_0x12c197,null));};exports[_0x612a('0x47')]=function(_0x4962ff,_0xd6458d){return db['JscriptyQuestionReport']['create'](_0x4962ff[_0x612a('0x48')],{})[_0x612a('0x25')](respondWithResult(_0xd6458d,0xc9))[_0x612a('0x40')](handleError(_0xd6458d,null));};exports[_0x612a('0x24')]=function(_0x1c8599,_0x43f7a9){if(_0x1c8599[_0x612a('0x48')]['id']){delete _0x1c8599[_0x612a('0x48')]['id'];}return db[_0x612a('0x3b')][_0x612a('0x46')]({'where':{'id':_0x1c8599['params']['id']}})[_0x612a('0x25')](handleEntityNotFound(_0x43f7a9,null))[_0x612a('0x25')](saveUpdates(_0x1c8599['body'],null))[_0x612a('0x25')](respondWithResult(_0x43f7a9,null))[_0x612a('0x40')](handleError(_0x43f7a9,null));};exports[_0x612a('0x26')]=function(_0x4bc6b1,_0x34cbbf){return db[_0x612a('0x3b')][_0x612a('0x46')]({'where':{'id':_0x4bc6b1[_0x612a('0x42')]['id']}})[_0x612a('0x25')](handleEntityNotFound(_0x34cbbf,null))[_0x612a('0x25')](removeEntity(_0x34cbbf,null))[_0x612a('0x40')](handleError(_0x34cbbf,null));};exports['describe']=function(_0x5d3174,_0x2e8cd2){return db['JscriptyQuestionReport'][_0x612a('0x49')]()[_0x612a('0x25')](respondWithResult(_0x2e8cd2,null))[_0x612a('0x40')](handleError(_0x2e8cd2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 781a5e0..0864217 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 _0xfe24=['define','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0xfe24,0x15e));var _0x4fe2=function(_0x2cbe16,_0x41928a){_0x2cbe16=_0x2cbe16-0x0;var _0x4dad69=_0xfe24[_0x2cbe16];return _0x4dad69;};'use strict';var _=require(_0x4fe2('0x0'));var util=require(_0x4fe2('0x1'));var logger=require('../../config/logger')(_0x4fe2('0x2'));var moment=require(_0x4fe2('0x3'));var BPromise=require(_0x4fe2('0x4'));var rp=require(_0x4fe2('0x5'));var fs=require('fs');var path=require(_0x4fe2('0x6'));var rimraf=require(_0x4fe2('0x7'));var config=require(_0x4fe2('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x4fe2('0x9')]=function(_0x2e66cf,_0x3c2477){return _0x2e66cf[_0x4fe2('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x4fe2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd809=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd809,0x14a));var _0x9d80=function(_0x37b63a,_0x41fbb6){_0x37b63a=_0x37b63a-0x0;var _0x52b5da=_0xd809[_0x37b63a];return _0x52b5da;};'use strict';var _=require(_0x9d80('0x0'));var util=require('util');var logger=require(_0x9d80('0x1'))(_0x9d80('0x2'));var moment=require(_0x9d80('0x3'));var BPromise=require(_0x9d80('0x4'));var rp=require(_0x9d80('0x5'));var fs=require('fs');var path=require(_0x9d80('0x6'));var rimraf=require(_0x9d80('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d80('0x8'));module[_0x9d80('0x9')]=function(_0x493f94,_0x493cff){return _0x493f94[_0x9d80('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x9d80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index b95a9d9..eba5311 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 _0x6668=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x6668,0x10d));var _0x8666=function(_0x22dfe0,_0x43613b){_0x22dfe0=_0x22dfe0-0x0;var _0x91bbfb=_0x6668[_0x22dfe0];return _0x91bbfb;};'use strict';var _=require('lodash');var util=require(_0x8666('0x0'));var moment=require(_0x8666('0x1'));var BPromise=require(_0x8666('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8666('0x3'));var db=require(_0x8666('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8666('0x5'))(_0x8666('0x6'));var config=require(_0x8666('0x7'));var jayson=require(_0x8666('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x250ed2,_0x16768d,_0x276a16){return new BPromise(function(_0x55bd3a,_0x5d2d3b){return client[_0x8666('0x9')](_0x250ed2,_0x276a16)[_0x8666('0xa')](function(_0x426b87){logger[_0x8666('0xb')](_0x8666('0xc'),_0x16768d,'request\x20sent');logger[_0x8666('0xd')](_0x8666('0xe'),_0x16768d,_0x8666('0xf'),JSON[_0x8666('0x10')](_0x426b87));if(_0x426b87[_0x8666('0x11')]){if(_0x426b87[_0x8666('0x11')][_0x8666('0x12')]===0x1f4){logger[_0x8666('0x11')](_0x8666('0xc'),_0x16768d,_0x426b87[_0x8666('0x11')]['message']);return _0x5d2d3b(_0x426b87['error'][_0x8666('0x13')]);}logger[_0x8666('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16768d,_0x426b87[_0x8666('0x11')]['message']);return _0x55bd3a(_0x426b87[_0x8666('0x11')][_0x8666('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x16768d,'request\x20sent');_0x55bd3a(_0x426b87[_0x8666('0x14')][_0x8666('0x13')]);}})[_0x8666('0x15')](function(_0x59d07f){logger[_0x8666('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16768d,_0x59d07f);_0x5d2d3b(_0x59d07f);});});} \ No newline at end of file +var _0x9922=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x58f923,_0x2ac4a7){var _0x12088c=function(_0x415533){while(--_0x415533){_0x58f923['push'](_0x58f923['shift']());}};_0x12088c(++_0x2ac4a7);}(_0x9922,0x18a));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2992('0x0'));var util=require(_0x2992('0x1'));var moment=require(_0x2992('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2992('0x3'))['db'];var utils=require(_0x2992('0x4'));var logger=require(_0x2992('0x5'))(_0x2992('0x6'));var config=require(_0x2992('0x7'));var jayson=require(_0x2992('0x8'));var client=jayson['client'][_0x2992('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4efb,_0xe5d41f,_0x28f3a1){return new BPromise(function(_0x5cc475,_0x1b17f3){return client[_0x2992('0xa')](_0x4e4efb,_0x28f3a1)[_0x2992('0xb')](function(_0x382fc8){logger[_0x2992('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe5d41f,_0x2992('0xd'));logger[_0x2992('0xe')](_0x2992('0xf'),_0xe5d41f,_0x2992('0xd'),JSON['stringify'](_0x382fc8));if(_0x382fc8[_0x2992('0x10')]){if(_0x382fc8[_0x2992('0x10')]['code']===0x1f4){logger[_0x2992('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe5d41f,_0x382fc8[_0x2992('0x10')][_0x2992('0x11')]);return _0x1b17f3(_0x382fc8[_0x2992('0x10')]['message']);}logger[_0x2992('0x10')](_0x2992('0x12'),_0xe5d41f,_0x382fc8[_0x2992('0x10')]['message']);return _0x5cc475(_0x382fc8[_0x2992('0x10')][_0x2992('0x11')]);}else{logger[_0x2992('0xc')](_0x2992('0x12'),_0xe5d41f,_0x2992('0xd'));_0x5cc475(_0x382fc8[_0x2992('0x13')]['message']);}})[_0x2992('0x14')](function(_0x3d3283){logger[_0x2992('0x10')](_0x2992('0x12'),_0xe5d41f,_0x3d3283);_0x1b17f3(_0x3d3283);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index af4e386..3d52fc5 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 _0xd549=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get','/:id','/:id/questions','getQuestions','post','create','put','exports','multer'];(function(_0x21327e,_0x1f4743){var _0x2c68c8=function(_0x1eb878){while(--_0x1eb878){_0x21327e['push'](_0x21327e['shift']());}};_0x2c68c8(++_0x1f4743);}(_0xd549,0xd0));var _0x9d54=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd549[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x9d54('0x0'));var util=require(_0x9d54('0x1'));var path=require('path');var timeout=require(_0x9d54('0x2'));var express=require(_0x9d54('0x3'));var router=express[_0x9d54('0x4')]();var fs_extra=require(_0x9d54('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d54('0x6'));var config=require(_0x9d54('0x7'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9d54('0x8')]);router['get']('/describe',auth[_0x9d54('0x9')](),controller[_0x9d54('0xa')]);router[_0x9d54('0xb')](_0x9d54('0xc'),auth[_0x9d54('0x9')](),controller['show']);router[_0x9d54('0xb')](_0x9d54('0xd'),auth['isAuthenticated'](),controller[_0x9d54('0xe')]);router[_0x9d54('0xf')]('/',auth[_0x9d54('0x9')](),controller[_0x9d54('0x10')]);router[_0x9d54('0x11')]('/:id',auth[_0x9d54('0x9')](),controller['update']);router['delete'](_0x9d54('0xc'),auth[_0x9d54('0x9')](),controller['destroy']);module[_0x9d54('0x12')]=router; \ No newline at end of file +var _0x0d3f=['/:id','getQuestions','create','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x310eb9,_0x1aed15){var _0x28915c=function(_0x457fd6){while(--_0x457fd6){_0x310eb9['push'](_0x310eb9['shift']());}};_0x28915c(++_0x1aed15);}(_0x0d3f,0x114));var _0xf0d3=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x0d3f[_0x4f4c2a];return _0xd15be6;};'use strict';var multer=require('multer');var util=require(_0xf0d3('0x0'));var path=require(_0xf0d3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0d3('0x2'));var router=express[_0xf0d3('0x3')]();var fs_extra=require(_0xf0d3('0x4'));var auth=require(_0xf0d3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf0d3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf0d3('0x7')]);router[_0xf0d3('0x8')](_0xf0d3('0x9'),auth[_0xf0d3('0xa')](),controller[_0xf0d3('0xb')]);router[_0xf0d3('0x8')](_0xf0d3('0xc'),auth[_0xf0d3('0xa')](),controller['show']);router[_0xf0d3('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0xf0d3('0xd')]);router['post']('/',auth[_0xf0d3('0xa')](),controller[_0xf0d3('0xe')]);router[_0xf0d3('0xf')](_0xf0d3('0xc'),auth[_0xf0d3('0xa')](),controller[_0xf0d3('0x10')]);router['delete'](_0xf0d3('0xc'),auth['isAuthenticated'](),controller[_0xf0d3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 99a61c5..430a72d 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 _0x781d=['moment','sequelize','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN'];(function(_0x21d9c1,_0x5327f){var _0x3b89e8=function(_0xd6be5c){while(--_0xd6be5c){_0x21d9c1['push'](_0x21d9c1['shift']());}};_0x3b89e8(++_0x5327f);}(_0x781d,0x14a));var _0xd781=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x781d[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0xd781('0x0'));var Sequelize=require(_0xd781('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0xb125bf){this[_0xd781('0x2')](_0xd781('0x3'),_0xb125bf);this[_0xd781('0x2')](_0xd781('0x4'),moment()[_0xd781('0x5')](_0xd781('0x6')));}},'endtime':{'type':Sequelize[_0xd781('0x7')]},'membername':{'type':Sequelize[_0xd781('0x8')]},'projectname':{'type':Sequelize[_0xd781('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd781('0x8')]},'calleridname':{'type':Sequelize[_0xd781('0x8')]},'calleridnum':{'type':Sequelize[_0xd781('0x8')]},'completed':{'type':Sequelize[_0xd781('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xeca5=['exports','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x4c5258,_0x3afb0f){var _0x3055db=function(_0x3edca1){while(--_0x3edca1){_0x4c5258['push'](_0x4c5258['shift']());}};_0x3055db(++_0x3afb0f);}(_0xeca5,0x1c9));var _0x5eca=function(_0x2db5a9,_0x4b3e9f){_0x2db5a9=_0x2db5a9-0x0;var _0x1e9c39=_0xeca5[_0x2db5a9];return _0x1e9c39;};'use strict';var moment=require(_0x5eca('0x0'));var Sequelize=require(_0x5eca('0x1'));module[_0x5eca('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2dee6e){this[_0x5eca('0x3')]('starttime',_0x2dee6e);this['setDataValue']('endtime',moment()[_0x5eca('0x4')](_0x5eca('0x5')));}},'endtime':{'type':Sequelize[_0x5eca('0x6')]},'membername':{'type':Sequelize[_0x5eca('0x7')]},'projectname':{'type':Sequelize[_0x5eca('0x7')]},'queue':{'type':Sequelize[_0x5eca('0x7')]},'uniqueid':{'type':Sequelize[_0x5eca('0x7')]},'calleridname':{'type':Sequelize[_0x5eca('0x7')]},'calleridnum':{'type':Sequelize[_0x5eca('0x7')]},'completed':{'type':Sequelize[_0x5eca('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 324c419..6e0f80e 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 _0x2440=['update','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','filter','rows','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','length','find','create','catch'];(function(_0x52a01f,_0x476c6a){var _0x37748f=function(_0x51ab39){while(--_0x51ab39){_0x52a01f['push'](_0x52a01f['shift']());}};_0x37748f(++_0x476c6a);}(_0x2440,0x15a));var _0x0244=function(_0x27ac1b,_0x14dc36){_0x27ac1b=_0x27ac1b-0x0;var _0x3b06f9=_0x2440[_0x27ac1b];return _0x3b06f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0244('0x0'));var zipdir=require(_0x0244('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0244('0x2'));var moment=require(_0x0244('0x3'));var BPromise=require(_0x0244('0x4'));var Mustache=require(_0x0244('0x5'));var util=require(_0x0244('0x6'));var path=require('path');var sox=require(_0x0244('0x7'));var csv=require(_0x0244('0x8'));var ejs=require(_0x0244('0x9'));var fs=require('fs');var fs_extra=require(_0x0244('0xa'));var _=require(_0x0244('0xb'));var squel=require(_0x0244('0xc'));var crypto=require(_0x0244('0xd'));var jsforce=require(_0x0244('0xe'));var deskjs=require(_0x0244('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0244('0x10'));var Papa=require(_0x0244('0x11'));var Redis=require(_0x0244('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0244('0x13'));var hardwareService=require(_0x0244('0x14'));var logger=require('../../config/logger')(_0x0244('0x15'));var utils=require(_0x0244('0x16'));var config=require(_0x0244('0x17'));var licenseUtil=require(_0x0244('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0633f,_0x2991dc){_0x2991dc=_0x2991dc||0xcc;return function(_0x4b042f){if(_0x4b042f){return _0xf0633f[_0x0244('0x19')](_0x2991dc);}return _0xf0633f[_0x0244('0x1a')](_0x2991dc)['end']();};}function respondWithResult(_0x54285e,_0x36c72d){_0x36c72d=_0x36c72d||0xc8;return function(_0x49f031){if(_0x49f031){return _0x54285e[_0x0244('0x1a')](_0x36c72d)[_0x0244('0x1b')](_0x49f031);}};}function respondWithFilteredResult(_0x274a5f,_0x14f15d){return function(_0x2a3f03){if(_0x2a3f03){var _0x8ffb47=typeof _0x14f15d[_0x0244('0x1c')]===_0x0244('0x1d')&&typeof _0x14f15d[_0x0244('0x1e')]===_0x0244('0x1d');var _0x127361=_0x2a3f03['count'];var _0x524bb0=_0x8ffb47?0x0:_0x14f15d[_0x0244('0x1c')];var _0x568340=_0x8ffb47?_0x2a3f03['count']:_0x14f15d[_0x0244('0x1c')]+_0x14f15d[_0x0244('0x1e')];var _0x592bdc;if(_0x568340>=_0x127361){_0x568340=_0x127361;_0x592bdc=0xc8;}else{_0x592bdc=0xce;}_0x274a5f[_0x0244('0x1a')](_0x592bdc);return _0x274a5f[_0x0244('0x1f')](_0x0244('0x20'),_0x524bb0+'-'+_0x568340+'/'+_0x127361)['json'](_0x2a3f03);}return null;};}function patchUpdates(_0x9a930d){return function(_0x296678){try{jsonpatch[_0x0244('0x21')](_0x296678,_0x9a930d,!![]);}catch(_0x9ed8a8){return BPromise[_0x0244('0x22')](_0x9ed8a8);}return _0x296678[_0x0244('0x23')]();};}function saveUpdates(_0x2918d5,_0x1d9cc7){return function(_0x249b2a){if(_0x249b2a){return _0x249b2a['update'](_0x2918d5)[_0x0244('0x24')](function(_0x2bcd44){return _0x2bcd44;});}return null;};}function removeEntity(_0x593fde,_0xe764a5){return function(_0x2b3a04){if(_0x2b3a04){return _0x2b3a04[_0x0244('0x25')]()[_0x0244('0x24')](function(){_0x593fde[_0x0244('0x1a')](0xcc)[_0x0244('0x26')]();});}};}function handleEntityNotFound(_0x110b60,_0x11ebbe){return function(_0x3a8099){if(!_0x3a8099){_0x110b60[_0x0244('0x19')](0x194);}return _0x3a8099;};}function handleError(_0x36fe6d,_0x41f0db){_0x41f0db=_0x41f0db||0x1f4;return function(_0x312cde){logger['error'](_0x312cde[_0x0244('0x27')]);if(_0x312cde[_0x0244('0x28')]){delete _0x312cde['name'];}_0x36fe6d[_0x0244('0x1a')](_0x41f0db)[_0x0244('0x29')](_0x312cde);};}exports[_0x0244('0x2a')]=function(_0x216fd9,_0x2065b8){var _0x533437={},_0x53f6e3={},_0x432f89={'count':0x0,'rows':[]};var _0x4d9f5f=_['map'](db[_0x0244('0x2b')][_0x0244('0x2c')],function(_0x2664bd){return{'name':_0x2664bd[_0x0244('0x2d')],'type':_0x2664bd[_0x0244('0x2e')][_0x0244('0x2f')]};});_0x53f6e3[_0x0244('0x30')]=_[_0x0244('0x31')](_0x4d9f5f,_0x0244('0x28'));_0x53f6e3[_0x0244('0x32')]=_['keys'](_0x216fd9[_0x0244('0x32')]);_0x53f6e3[_0x0244('0x33')]=_[_0x0244('0x34')](_0x53f6e3[_0x0244('0x30')],_0x53f6e3[_0x0244('0x32')]);_0x533437[_0x0244('0x35')]=_[_0x0244('0x34')](_0x53f6e3[_0x0244('0x30')],qs[_0x0244('0x36')](_0x216fd9['query'][_0x0244('0x36')]));_0x533437[_0x0244('0x35')]=_0x533437[_0x0244('0x35')]['length']?_0x533437[_0x0244('0x35')]:_0x53f6e3[_0x0244('0x30')];if(!_0x216fd9[_0x0244('0x32')]['hasOwnProperty'](_0x0244('0x37'))){_0x533437['limit']=qs[_0x0244('0x1e')](_0x216fd9[_0x0244('0x32')][_0x0244('0x1e')]);_0x533437[_0x0244('0x1c')]=qs[_0x0244('0x1c')](_0x216fd9[_0x0244('0x32')][_0x0244('0x1c')]);}_0x533437[_0x0244('0x38')]=qs[_0x0244('0x39')](_0x216fd9[_0x0244('0x32')][_0x0244('0x39')]);_0x533437[_0x0244('0x3a')]=qs[_0x0244('0x33')](_[_0x0244('0x3b')](_0x216fd9['query'],_0x53f6e3[_0x0244('0x33')]),_0x4d9f5f);if(_0x216fd9[_0x0244('0x32')]['filter']){_0x533437['where']=_[_0x0244('0x3c')](_0x533437[_0x0244('0x3a')],{'$or':_['map'](_0x4d9f5f,function(_0x5d1522){if(_0x5d1522[_0x0244('0x2e')]!==_0x0244('0x3d')){var _0x5aea66={};_0x5aea66[_0x5d1522[_0x0244('0x28')]]={'$like':'%'+_0x216fd9[_0x0244('0x32')]['filter']+'%'};return _0x5aea66;}})});}_0x533437=_['merge']({},_0x533437,_0x216fd9[_0x0244('0x3e')]);var _0x30aa84={'where':_0x533437[_0x0244('0x3a')]};return db[_0x0244('0x2b')][_0x0244('0x3f')](_0x30aa84)[_0x0244('0x24')](function(_0x3c620c){_0x432f89[_0x0244('0x3f')]=_0x3c620c;if(_0x216fd9[_0x0244('0x32')][_0x0244('0x40')]){_0x533437[_0x0244('0x41')]=[{'all':!![]}];}return db[_0x0244('0x2b')][_0x0244('0x42')](_0x533437);})[_0x0244('0x24')](function(_0x169758){_0x432f89['rows']=_0x169758;return _0x432f89;})[_0x0244('0x24')](respondWithFilteredResult(_0x2065b8,_0x533437))['catch'](handleError(_0x2065b8,null));};exports[_0x0244('0x43')]=function(_0x210dfb,_0x44c43e){var _0x4fac73={'raw':!![],'where':{'id':_0x210dfb[_0x0244('0x44')]['id']}},_0x24fa8f={};_0x24fa8f['model']=_[_0x0244('0x45')](db[_0x0244('0x2b')][_0x0244('0x2c')]);_0x24fa8f[_0x0244('0x32')]=_[_0x0244('0x45')](_0x210dfb[_0x0244('0x32')]);_0x24fa8f[_0x0244('0x33')]=_['intersection'](_0x24fa8f[_0x0244('0x30')],_0x24fa8f[_0x0244('0x32')]);_0x4fac73[_0x0244('0x35')]=_['intersection'](_0x24fa8f['model'],qs[_0x0244('0x36')](_0x210dfb['query'][_0x0244('0x36')]));_0x4fac73[_0x0244('0x35')]=_0x4fac73[_0x0244('0x35')][_0x0244('0x46')]?_0x4fac73[_0x0244('0x35')]:_0x24fa8f['model'];if(_0x210dfb[_0x0244('0x32')]['includeAll']){_0x4fac73[_0x0244('0x41')]=[{'all':!![]}];}_0x4fac73=_['merge']({},_0x4fac73,_0x210dfb[_0x0244('0x3e')]);return db[_0x0244('0x2b')][_0x0244('0x47')](_0x4fac73)[_0x0244('0x24')](handleEntityNotFound(_0x44c43e,null))[_0x0244('0x24')](respondWithResult(_0x44c43e,null))['catch'](handleError(_0x44c43e,null));};exports[_0x0244('0x48')]=function(_0x213a40,_0xb78061){return db[_0x0244('0x2b')][_0x0244('0x48')](_0x213a40['body'],{})[_0x0244('0x24')](respondWithResult(_0xb78061,0xc9))[_0x0244('0x49')](handleError(_0xb78061,null));};exports[_0x0244('0x4a')]=function(_0x440973,_0x26d3f5){if(_0x440973[_0x0244('0x4b')]['id']){delete _0x440973[_0x0244('0x4b')]['id'];}return db[_0x0244('0x2b')]['find']({'where':{'id':_0x440973['params']['id']}})[_0x0244('0x24')](handleEntityNotFound(_0x26d3f5,null))[_0x0244('0x24')](saveUpdates(_0x440973[_0x0244('0x4b')],null))[_0x0244('0x24')](respondWithResult(_0x26d3f5,null))[_0x0244('0x49')](handleError(_0x26d3f5,null));};exports[_0x0244('0x25')]=function(_0x1072d2,_0x5c1d64){return db[_0x0244('0x2b')]['find']({'where':{'id':_0x1072d2[_0x0244('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c1d64,null))[_0x0244('0x24')](removeEntity(_0x5c1d64,null))[_0x0244('0x49')](handleError(_0x5c1d64,null));};exports[_0x0244('0x4c')]=function(_0x5a7ef6,_0x299d02){return db[_0x0244('0x2b')]['describe']()['then'](respondWithResult(_0x299d02,null))[_0x0244('0x49')](handleError(_0x299d02,null));};exports[_0x0244('0x4d')]=function(_0xa270b8,_0x283b74,_0x38e1da){var _0x3e4969={'raw':!![],'where':{}};var _0x27c93e={};var _0x4b6fb3={'count':0x0,'rows':[]};return db[_0x0244('0x2b')][_0x0244('0x4e')]({'where':{'id':_0xa270b8[_0x0244('0x44')]['id']}})[_0x0244('0x24')](handleEntityNotFound(_0x283b74,null))['then'](function(_0x8a1d05){if(_0x8a1d05){_0x27c93e['model']=_[_0x0244('0x45')](db[_0x0244('0x4f')]['rawAttributes']);_0x27c93e['query']=_[_0x0244('0x45')](_0xa270b8[_0x0244('0x32')]);_0x27c93e['filters']=_[_0x0244('0x34')](_0x27c93e[_0x0244('0x30')],_0x27c93e[_0x0244('0x32')]);_0x3e4969[_0x0244('0x35')]=_[_0x0244('0x34')](_0x27c93e[_0x0244('0x30')],qs['fields'](_0xa270b8[_0x0244('0x32')]['fields']));_0x3e4969['attributes']=_0x3e4969['attributes'][_0x0244('0x46')]?_0x3e4969[_0x0244('0x35')]:_0x27c93e[_0x0244('0x30')];if(!_0xa270b8[_0x0244('0x32')][_0x0244('0x50')](_0x0244('0x37'))){_0x3e4969['limit']=qs[_0x0244('0x1e')](_0xa270b8[_0x0244('0x32')][_0x0244('0x1e')]);_0x3e4969[_0x0244('0x1c')]=qs[_0x0244('0x1c')](_0xa270b8[_0x0244('0x32')][_0x0244('0x1c')]);}_0x3e4969['order']=qs[_0x0244('0x39')](_0xa270b8[_0x0244('0x32')]['sort']);_0x3e4969[_0x0244('0x3a')]=qs['filters'](_['pick'](_0xa270b8[_0x0244('0x32')],_0x27c93e['filters']));_0x3e4969[_0x0244('0x3a')][_0x0244('0x51')]=_0x8a1d05['id'];if(_0xa270b8['query'][_0x0244('0x52')]){_0x3e4969['where']=_['merge'](_0x3e4969[_0x0244('0x3a')],{'$or':_[_0x0244('0x31')](_0x3e4969['attributes'],function(_0xd695f5){var _0x222abc={};_0x222abc[_0xd695f5]={'$like':'%'+_0xa270b8['query'][_0x0244('0x52')]+'%'};return _0x222abc;})});}_0x3e4969=_[_0x0244('0x3c')]({},_0x3e4969,_0xa270b8['options']);return db[_0x0244('0x4f')][_0x0244('0x3f')]({'where':_0x3e4969['where']})[_0x0244('0x24')](function(_0x5587c2){_0x4b6fb3[_0x0244('0x3f')]=_0x5587c2;if(_0xa270b8[_0x0244('0x32')][_0x0244('0x40')]){_0x3e4969['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0244('0x42')](_0x3e4969);})[_0x0244('0x24')](function(_0x561498){_0x4b6fb3[_0x0244('0x53')]=_0x561498;return _0x4b6fb3;});}})[_0x0244('0x24')](respondWithFilteredResult(_0x283b74,_0x3e4969))['catch'](handleError(_0x283b74,null));}; \ No newline at end of file +var _0xc6f2=['index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x1c2fd7,_0x595cf1){var _0x369e9d=function(_0x12d274){while(--_0x12d274){_0x1c2fd7['push'](_0x1c2fd7['shift']());}};_0x369e9d(++_0x595cf1);}(_0xc6f2,0x16b));var _0x2c6f=function(_0x59dcf2,_0x1d065f){_0x59dcf2=_0x59dcf2-0x0;var _0x446ebf=_0xc6f2[_0x59dcf2];return _0x446ebf;};'use strict';var emlformat=require(_0x2c6f('0x0'));var rimraf=require(_0x2c6f('0x1'));var zipdir=require(_0x2c6f('0x2'));var jsonpatch=require(_0x2c6f('0x3'));var rp=require(_0x2c6f('0x4'));var moment=require(_0x2c6f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c6f('0x6'));var util=require('util');var path=require(_0x2c6f('0x7'));var sox=require(_0x2c6f('0x8'));var csv=require('to-csv');var ejs=require(_0x2c6f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c6f('0xa'));var _=require(_0x2c6f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c6f('0xc'));var toCsv=require(_0x2c6f('0xd'));var querystring=require('querystring');var Papa=require(_0x2c6f('0xe'));var Redis=require(_0x2c6f('0xf'));var authService=require(_0x2c6f('0x10'));var qs=require(_0x2c6f('0x11'));var as=require(_0x2c6f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2c6f('0x13'));var utils=require(_0x2c6f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2c6f('0x15'));var db=require(_0x2c6f('0x16'))['db'];function respondWithStatusCode(_0x90652b,_0x969200){_0x969200=_0x969200||0xcc;return function(_0x2b742e){if(_0x2b742e){return _0x90652b[_0x2c6f('0x17')](_0x969200);}return _0x90652b[_0x2c6f('0x18')](_0x969200)[_0x2c6f('0x19')]();};}function respondWithResult(_0x4e692b,_0x510847){_0x510847=_0x510847||0xc8;return function(_0x450ab5){if(_0x450ab5){return _0x4e692b[_0x2c6f('0x18')](_0x510847)[_0x2c6f('0x1a')](_0x450ab5);}};}function respondWithFilteredResult(_0x191118,_0x13de47){return function(_0x13af24){if(_0x13af24){var _0x4a91b1=typeof _0x13de47[_0x2c6f('0x1b')]===_0x2c6f('0x1c')&&typeof _0x13de47[_0x2c6f('0x1d')]==='undefined';var _0x32c697=_0x13af24[_0x2c6f('0x1e')];var _0x3f3669=_0x4a91b1?0x0:_0x13de47[_0x2c6f('0x1b')];var _0x2efeae=_0x4a91b1?_0x13af24[_0x2c6f('0x1e')]:_0x13de47[_0x2c6f('0x1b')]+_0x13de47[_0x2c6f('0x1d')];var _0x17e6c5;if(_0x2efeae>=_0x32c697){_0x2efeae=_0x32c697;_0x17e6c5=0xc8;}else{_0x17e6c5=0xce;}_0x191118[_0x2c6f('0x18')](_0x17e6c5);return _0x191118[_0x2c6f('0x1f')](_0x2c6f('0x20'),_0x3f3669+'-'+_0x2efeae+'/'+_0x32c697)['json'](_0x13af24);}return null;};}function patchUpdates(_0x27df6f){return function(_0x3b55b3){try{jsonpatch['apply'](_0x3b55b3,_0x27df6f,!![]);}catch(_0x34566f){return BPromise[_0x2c6f('0x21')](_0x34566f);}return _0x3b55b3[_0x2c6f('0x22')]();};}function saveUpdates(_0x3c4b4f,_0x4c3cc5){return function(_0x1871b3){if(_0x1871b3){return _0x1871b3[_0x2c6f('0x23')](_0x3c4b4f)[_0x2c6f('0x24')](function(_0xe46fce){return _0xe46fce;});}return null;};}function removeEntity(_0x434667,_0x1fc666){return function(_0x4ff161){if(_0x4ff161){return _0x4ff161[_0x2c6f('0x25')]()[_0x2c6f('0x24')](function(){_0x434667[_0x2c6f('0x18')](0xcc)[_0x2c6f('0x19')]();});}};}function handleEntityNotFound(_0xa582c0,_0x22beef){return function(_0x2b20df){if(!_0x2b20df){_0xa582c0[_0x2c6f('0x17')](0x194);}return _0x2b20df;};}function handleError(_0x47be2a,_0xef77ab){_0xef77ab=_0xef77ab||0x1f4;return function(_0x3eb9f5){logger[_0x2c6f('0x26')](_0x3eb9f5[_0x2c6f('0x27')]);if(_0x3eb9f5[_0x2c6f('0x28')]){delete _0x3eb9f5[_0x2c6f('0x28')];}_0x47be2a[_0x2c6f('0x18')](_0xef77ab)[_0x2c6f('0x29')](_0x3eb9f5);};}exports[_0x2c6f('0x2a')]=function(_0x1dc7d0,_0x535414){var _0x98edce={},_0x4228d2={},_0x2d4b7b={'count':0x0,'rows':[]};var _0x48f5f2=_[_0x2c6f('0x2b')](db[_0x2c6f('0x2c')][_0x2c6f('0x2d')],function(_0x2f71b6){return{'name':_0x2f71b6[_0x2c6f('0x2e')],'type':_0x2f71b6['type'][_0x2c6f('0x2f')]};});_0x4228d2[_0x2c6f('0x30')]=_[_0x2c6f('0x2b')](_0x48f5f2,_0x2c6f('0x28'));_0x4228d2[_0x2c6f('0x31')]=_['keys'](_0x1dc7d0['query']);_0x4228d2['filters']=_[_0x2c6f('0x32')](_0x4228d2['model'],_0x4228d2[_0x2c6f('0x31')]);_0x98edce[_0x2c6f('0x33')]=_[_0x2c6f('0x32')](_0x4228d2[_0x2c6f('0x30')],qs[_0x2c6f('0x34')](_0x1dc7d0[_0x2c6f('0x31')]['fields']));_0x98edce['attributes']=_0x98edce[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x98edce[_0x2c6f('0x33')]:_0x4228d2[_0x2c6f('0x30')];if(!_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x36')](_0x2c6f('0x37'))){_0x98edce['limit']=qs[_0x2c6f('0x1d')](_0x1dc7d0['query']['limit']);_0x98edce[_0x2c6f('0x1b')]=qs[_0x2c6f('0x1b')](_0x1dc7d0['query'][_0x2c6f('0x1b')]);}_0x98edce[_0x2c6f('0x38')]=qs['sort'](_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x39')]);_0x98edce[_0x2c6f('0x3a')]=qs[_0x2c6f('0x3b')](_[_0x2c6f('0x3c')](_0x1dc7d0[_0x2c6f('0x31')],_0x4228d2[_0x2c6f('0x3b')]),_0x48f5f2);if(_0x1dc7d0[_0x2c6f('0x31')]['filter']){_0x98edce[_0x2c6f('0x3a')]=_[_0x2c6f('0x3d')](_0x98edce[_0x2c6f('0x3a')],{'$or':_[_0x2c6f('0x2b')](_0x48f5f2,function(_0x2c8402){if(_0x2c8402[_0x2c6f('0x3e')]!=='VIRTUAL'){var _0xa17a48={};_0xa17a48[_0x2c8402[_0x2c6f('0x28')]]={'$like':'%'+_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x3f')]+'%'};return _0xa17a48;}})});}_0x98edce=_[_0x2c6f('0x3d')]({},_0x98edce,_0x1dc7d0[_0x2c6f('0x40')]);var _0x309033={'where':_0x98edce['where']};return db['JscriptySessionReport'][_0x2c6f('0x1e')](_0x309033)['then'](function(_0x5769a6){_0x2d4b7b[_0x2c6f('0x1e')]=_0x5769a6;if(_0x1dc7d0['query'][_0x2c6f('0x41')]){_0x98edce[_0x2c6f('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2c6f('0x43')](_0x98edce);})[_0x2c6f('0x24')](function(_0x3d9748){_0x2d4b7b[_0x2c6f('0x44')]=_0x3d9748;return _0x2d4b7b;})[_0x2c6f('0x24')](respondWithFilteredResult(_0x535414,_0x98edce))[_0x2c6f('0x45')](handleError(_0x535414,null));};exports[_0x2c6f('0x46')]=function(_0x110b84,_0x2feb84){var _0x4a53d9={'raw':!![],'where':{'id':_0x110b84[_0x2c6f('0x47')]['id']}},_0xc7872b={};_0xc7872b[_0x2c6f('0x30')]=_[_0x2c6f('0x48')](db[_0x2c6f('0x2c')][_0x2c6f('0x2d')]);_0xc7872b[_0x2c6f('0x31')]=_[_0x2c6f('0x48')](_0x110b84[_0x2c6f('0x31')]);_0xc7872b['filters']=_[_0x2c6f('0x32')](_0xc7872b['model'],_0xc7872b[_0x2c6f('0x31')]);_0x4a53d9['attributes']=_[_0x2c6f('0x32')](_0xc7872b[_0x2c6f('0x30')],qs['fields'](_0x110b84[_0x2c6f('0x31')]['fields']));_0x4a53d9[_0x2c6f('0x33')]=_0x4a53d9[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x4a53d9[_0x2c6f('0x33')]:_0xc7872b['model'];if(_0x110b84[_0x2c6f('0x31')]['includeAll']){_0x4a53d9[_0x2c6f('0x42')]=[{'all':!![]}];}_0x4a53d9=_[_0x2c6f('0x3d')]({},_0x4a53d9,_0x110b84[_0x2c6f('0x40')]);return db[_0x2c6f('0x2c')]['find'](_0x4a53d9)[_0x2c6f('0x24')](handleEntityNotFound(_0x2feb84,null))[_0x2c6f('0x24')](respondWithResult(_0x2feb84,null))[_0x2c6f('0x45')](handleError(_0x2feb84,null));};exports[_0x2c6f('0x49')]=function(_0x3036e5,_0x4ac736){return db[_0x2c6f('0x2c')]['create'](_0x3036e5[_0x2c6f('0x4a')],{})['then'](respondWithResult(_0x4ac736,0xc9))[_0x2c6f('0x45')](handleError(_0x4ac736,null));};exports['update']=function(_0x4a4381,_0x39c124){if(_0x4a4381['body']['id']){delete _0x4a4381['body']['id'];}return db[_0x2c6f('0x2c')][_0x2c6f('0x4b')]({'where':{'id':_0x4a4381[_0x2c6f('0x47')]['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x39c124,null))[_0x2c6f('0x24')](saveUpdates(_0x4a4381[_0x2c6f('0x4a')],null))['then'](respondWithResult(_0x39c124,null))['catch'](handleError(_0x39c124,null));};exports['destroy']=function(_0x48f3b1,_0x7f41a8){return db[_0x2c6f('0x2c')][_0x2c6f('0x4b')]({'where':{'id':_0x48f3b1['params']['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x7f41a8,null))['then'](removeEntity(_0x7f41a8,null))[_0x2c6f('0x45')](handleError(_0x7f41a8,null));};exports[_0x2c6f('0x4c')]=function(_0x22fb65,_0x566df9){return db[_0x2c6f('0x2c')][_0x2c6f('0x4c')]()[_0x2c6f('0x24')](respondWithResult(_0x566df9,null))[_0x2c6f('0x45')](handleError(_0x566df9,null));};exports[_0x2c6f('0x4d')]=function(_0x4d81d4,_0x208fbc,_0x4c96d6){var _0x5e0686={'raw':!![],'where':{}};var _0x333b1c={};var _0x328fd7={'count':0x0,'rows':[]};return db[_0x2c6f('0x2c')][_0x2c6f('0x4e')]({'where':{'id':_0x4d81d4['params']['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x208fbc,null))['then'](function(_0x802c){if(_0x802c){_0x333b1c[_0x2c6f('0x30')]=_[_0x2c6f('0x48')](db[_0x2c6f('0x4f')]['rawAttributes']);_0x333b1c[_0x2c6f('0x31')]=_[_0x2c6f('0x48')](_0x4d81d4[_0x2c6f('0x31')]);_0x333b1c['filters']=_[_0x2c6f('0x32')](_0x333b1c[_0x2c6f('0x30')],_0x333b1c[_0x2c6f('0x31')]);_0x5e0686[_0x2c6f('0x33')]=_[_0x2c6f('0x32')](_0x333b1c[_0x2c6f('0x30')],qs[_0x2c6f('0x34')](_0x4d81d4['query']['fields']));_0x5e0686['attributes']=_0x5e0686[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x5e0686['attributes']:_0x333b1c[_0x2c6f('0x30')];if(!_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x36')]('nolimit')){_0x5e0686[_0x2c6f('0x1d')]=qs['limit'](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x1d')]);_0x5e0686[_0x2c6f('0x1b')]=qs[_0x2c6f('0x1b')](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x1b')]);}_0x5e0686[_0x2c6f('0x38')]=qs['sort'](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x39')]);_0x5e0686[_0x2c6f('0x3a')]=qs[_0x2c6f('0x3b')](_[_0x2c6f('0x3c')](_0x4d81d4[_0x2c6f('0x31')],_0x333b1c[_0x2c6f('0x3b')]));_0x5e0686['where'][_0x2c6f('0x50')]=_0x802c['id'];if(_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x3f')]){_0x5e0686[_0x2c6f('0x3a')]=_[_0x2c6f('0x3d')](_0x5e0686[_0x2c6f('0x3a')],{'$or':_[_0x2c6f('0x2b')](_0x5e0686[_0x2c6f('0x33')],function(_0x172054){var _0x1de2dc={};_0x1de2dc[_0x172054]={'$like':'%'+_0x4d81d4['query'][_0x2c6f('0x3f')]+'%'};return _0x1de2dc;})});}_0x5e0686=_[_0x2c6f('0x3d')]({},_0x5e0686,_0x4d81d4['options']);return db['JscriptyQuestionReport'][_0x2c6f('0x1e')]({'where':_0x5e0686[_0x2c6f('0x3a')]})['then'](function(_0x21dcce){_0x328fd7[_0x2c6f('0x1e')]=_0x21dcce;if(_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x41')]){_0x5e0686['include']=[{'all':!![]}];}return db[_0x2c6f('0x4f')]['findAll'](_0x5e0686);})[_0x2c6f('0x24')](function(_0x1de89e){_0x328fd7[_0x2c6f('0x44')]=_0x1de89e;return _0x328fd7;});}})['then'](respondWithFilteredResult(_0x208fbc,_0x5e0686))[_0x2c6f('0x45')](handleError(_0x208fbc,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 6e32647..3f111f0 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xae9024,_0x17f58e){_0xae9024=_0xae9024-0x0;var _0x23e7d3=_0x7fbe[_0xae9024];return _0x23e7d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x399841,_0x2bdcf9){var _0x227878=function(_0x160bdc){while(--_0x160bdc){_0x399841['push'](_0x399841['shift']());}};_0x227878(++_0x2bdcf9);}(_0x53ec,0x192));var _0xc53e=function(_0x52ad5f,_0x16d1a3){_0x52ad5f=_0x52ad5f-0x0;var _0xb217a2=_0x53ec[_0x52ad5f];return _0xb217a2;};'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_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3ad8b68..1d6cffb 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 _0xb091=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x1da237,_0x30771a){var _0x4e5078=function(_0x10857a){while(--_0x10857a){_0x1da237['push'](_0x1da237['shift']());}};_0x4e5078(++_0x30771a);}(_0xb091,0x16e));var _0x1b09=function(_0x3e2f09,_0x4bfc01){_0x3e2f09=_0x3e2f09-0x0;var _0x31aaad=_0xb091[_0x3e2f09];return _0x31aaad;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});} \ No newline at end of file +var _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x54783e,_0xe85a52){var _0x4b03f4=function(_0x4095ba){while(--_0x4095ba){_0x54783e['push'](_0x54783e['shift']());}};_0x4b03f4(++_0xe85a52);}(_0xa456,0x142));var _0x6a45=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa456[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f168a18..311d5fe 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 _0x536e=['get','index','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x53e9b3,_0x10ebad){var _0x1c394e=function(_0x4db673){while(--_0x4db673){_0x53e9b3['push'](_0x53e9b3['shift']());}};_0x1c394e(++_0x10ebad);}(_0x536e,0x155));var _0xe536=function(_0xae1364,_0x44863f){_0xae1364=_0xae1364-0x0;var _0x55104f=_0x536e[_0xae1364];return _0x55104f;};'use strict';var multer=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var path=require(_0xe536('0x2'));var timeout=require(_0xe536('0x3'));var express=require(_0xe536('0x4'));var router=express[_0xe536('0x5')]();var fs_extra=require(_0xe536('0x6'));var auth=require(_0xe536('0x7'));var interaction=require(_0xe536('0x8'));var config=require(_0xe536('0x9'));var controller=require(_0xe536('0xa'));router[_0xe536('0xb')]('/',controller[_0xe536('0xc')]);router[_0xe536('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe536('0xe')]);module[_0xe536('0xf')]=router; \ No newline at end of file +var _0xccc9=['index','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5dcc02,_0xbb61e5){var _0x1305f7=function(_0x3dbd66){while(--_0x3dbd66){_0x5dcc02['push'](_0x5dcc02['shift']());}};_0x1305f7(++_0xbb61e5);}(_0xccc9,0xf4));var _0x9ccc=function(_0x4ae60b,_0x703aea){_0x4ae60b=_0x4ae60b-0x0;var _0x594c6c=_0xccc9[_0x4ae60b];return _0x594c6c;};'use strict';var multer=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var path=require(_0x9ccc('0x2'));var timeout=require(_0x9ccc('0x3'));var express=require('express');var router=express[_0x9ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ccc('0x6'));var controller=require('./license.controller');router[_0x9ccc('0x7')]('/',controller[_0x9ccc('0x8')]);router[_0x9ccc('0x9')](_0x9ccc('0xa'),auth[_0x9ccc('0xb')](),controller[_0x9ccc('0xc')]);module[_0x9ccc('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 7e78a31..2eba772 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 _0x2220=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x1559a5,_0x41924e){var _0x17a783=function(_0x152c63){while(--_0x152c63){_0x1559a5['push'](_0x1559a5['shift']());}};_0x17a783(++_0x41924e);}(_0x2220,0x150));var _0x0222=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x2220[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x0222('0x0'));module[_0x0222('0x1')]={'license':{'type':Sequelize[_0x0222('0x2')]},'data1':{'type':Sequelize[_0x0222('0x3')]},'data2':{'type':Sequelize[_0x0222('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x0222('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6b0=['exports','TEXT','STRING','sequelize'];(function(_0x695712,_0x35e158){var _0x4fa678=function(_0xaaa748){while(--_0xaaa748){_0x695712['push'](_0x695712['shift']());}};_0x4fa678(++_0x35e158);}(_0xa6b0,0x13b));var _0x0a6b=function(_0x44b762,_0x191d9a){_0x44b762=_0x44b762-0x0;var _0x3c025b=_0xa6b0[_0x44b762];return _0x3c025b;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'license':{'type':Sequelize[_0x0a6b('0x2')]},'data1':{'type':Sequelize[_0x0a6b('0x3')]},'data2':{'type':Sequelize[_0x0a6b('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 767f3b6..b4eee32 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 _0x814b=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','params','get','key','demo','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','sendStatus','status','end'];(function(_0x14d21f,_0x1d781f){var _0x4d5345=function(_0x63e051){while(--_0x63e051){_0x14d21f['push'](_0x14d21f['shift']());}};_0x4d5345(++_0x1d781f);}(_0x814b,0x1a2));var _0xb814=function(_0xb02766,_0xa37d90){_0xb02766=_0xb02766-0x0;var _0x560e6c=_0x814b[_0xb02766];return _0x560e6c;};'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'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}var utilLicense=require(_0xb814('0x19'));exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={'raw':!![],'where':{'id':0x1}},_0x499f22={};_0x499f22[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['License'][_0xb814('0x30')]);_0x499f22['query']=_[_0xb814('0x2f')](_0x9008b2['query']);_0x499f22['filters']=_[_0xb814('0x31')](_0x499f22['model'],_0x499f22[_0xb814('0x32')]);_0x530744[_0xb814('0x33')]=_[_0xb814('0x31')](_0x499f22['model'],qs['fields'](_0x9008b2[_0xb814('0x32')][_0xb814('0x34')]));_0x530744['attributes']=_0x530744[_0xb814('0x33')][_0xb814('0x35')]?_0x530744[_0xb814('0x33')]:_0x499f22[_0xb814('0x2e')];_0x530744=_[_0xb814('0x36')]({},_0x530744,_0x9008b2[_0xb814('0x37')]);return utilLicense[_0xb814('0x38')](_0x530744)['then'](respondWithResult(_0x37d24d,null))[_0xb814('0x39')](handleError(_0x37d24d,null));};exports[_0xb814('0x27')]=function(_0x30de5a,_0x424e2b){if(_0x30de5a[_0xb814('0x3a')]['id']){delete _0x30de5a['body']['id'];}return db[_0xb814('0x3b')]['find']({'where':{'id':_0x30de5a[_0xb814('0x3c')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x424e2b,null))[_0xb814('0x28')](function(_0x492d5e){var _0x40b885=_0x492d5e[_0xb814('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b885,_0x30de5a[_0xb814('0x3a')][_0xb814('0x3e')]);})[_0xb814('0x28')](function(_0x1f7cd8){if(!_0x1f7cd8[_0xb814('0x3f')]){return saveUpdates(_0x30de5a[_0xb814('0x3a')],null);}return _0x1f7cd8;})['then'](respondWithResult(_0x424e2b,null))[_0xb814('0x39')](handleError(_0x424e2b,null));}; \ No newline at end of file +var _0x5fc3=['mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','model','keys','License','query','intersection','attributes','fields','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x5fc3[_0x57add2];return _0x4e3670;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}var utilLicense=require('../../config/license/util');exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={'raw':!![],'where':{'id':0x1}},_0x3735da={};_0x3735da[_0x35fc('0x29')]=_[_0x35fc('0x2a')](db[_0x35fc('0x2b')]['rawAttributes']);_0x3735da[_0x35fc('0x2c')]=_[_0x35fc('0x2a')](_0x645eac[_0x35fc('0x2c')]);_0x3735da['filters']=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],_0x3735da[_0x35fc('0x2c')]);_0x9f3c8a[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],qs[_0x35fc('0x2f')](_0x645eac[_0x35fc('0x2c')][_0x35fc('0x2f')]));_0x9f3c8a[_0x35fc('0x2e')]=_0x9f3c8a['attributes']['length']?_0x9f3c8a[_0x35fc('0x2e')]:_0x3735da['model'];_0x9f3c8a=_[_0x35fc('0x30')]({},_0x9f3c8a,_0x645eac[_0x35fc('0x31')]);return utilLicense[_0x35fc('0x32')](_0x9f3c8a)[_0x35fc('0x24')](respondWithResult(_0x383837,null))[_0x35fc('0x33')](handleError(_0x383837,null));};exports[_0x35fc('0x23')]=function(_0x4e43b4,_0x3fe193){if(_0x4e43b4[_0x35fc('0x34')]['id']){delete _0x4e43b4[_0x35fc('0x34')]['id'];}return db[_0x35fc('0x2b')][_0x35fc('0x35')]({'where':{'id':_0x4e43b4[_0x35fc('0x36')]['id']}})['then'](handleEntityNotFound(_0x3fe193,null))[_0x35fc('0x24')](function(_0x38193d){var _0x1fecdf=_0x38193d['get']({'plain':!![]});return utilLicense[_0x35fc('0x37')](_0x1fecdf,_0x4e43b4['body'][_0x35fc('0x38')]);})[_0x35fc('0x24')](function(_0x266a11){if(!_0x266a11[_0x35fc('0x39')]){return saveUpdates(_0x4e43b4['body'],null);}return _0x266a11;})['then'](respondWithResult(_0x3fe193,null))['catch'](handleError(_0x3fe193,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 4b47e0f..167d99d 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 _0xc672=['./license.attributes','exports','License','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x33dda0,_0x3ac5af){var _0x3bff1c=function(_0x5d3b0e){while(--_0x5d3b0e){_0x33dda0['push'](_0x33dda0['shift']());}};_0x3bff1c(++_0x3ac5af);}(_0xc672,0x1d7));var _0x2c67=function(_0x5c8008,_0x102e84){_0x5c8008=_0x5c8008-0x0;var _0x5cef19=_0xc672[_0x5c8008];return _0x5cef19;};'use strict';var _=require(_0x2c67('0x0'));var util=require(_0x2c67('0x1'));var logger=require(_0x2c67('0x2'))(_0x2c67('0x3'));var moment=require(_0x2c67('0x4'));var BPromise=require(_0x2c67('0x5'));var rp=require(_0x2c67('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c67('0x7'));var config=require(_0x2c67('0x8'));var attributes=require(_0x2c67('0x9'));module[_0x2c67('0xa')]=function(_0x109a11,_0x3d46ce){return _0x109a11['define'](_0x2c67('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cf9=['path','rimraf','../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2cf9,0x1c2));var _0x92cf=function(_0x2225c9,_0xe99b2e){_0x2225c9=_0x2225c9-0x0;var _0xe7b099=_0x2cf9[_0x2225c9];return _0xe7b099;};'use strict';var _=require(_0x92cf('0x0'));var util=require(_0x92cf('0x1'));var logger=require(_0x92cf('0x2'))(_0x92cf('0x3'));var moment=require(_0x92cf('0x4'));var BPromise=require('bluebird');var rp=require(_0x92cf('0x5'));var fs=require('fs');var path=require(_0x92cf('0x6'));var rimraf=require(_0x92cf('0x7'));var config=require(_0x92cf('0x8'));var attributes=require(_0x92cf('0x9'));module[_0x92cf('0xa')]=function(_0x33b32c,_0x37b775){return _0x33b32c[_0x92cf('0xb')]('License',attributes,{'tableName':'license','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 87417f3..7d824f7 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 _0xc872=['client','http','request','then','info','debug','stringify','error','code','License,\x20%s,\x20%s','message','request\x20sent','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x637c3d,_0x2aca87){var _0x598f06=function(_0x18f48d){while(--_0x18f48d){_0x637c3d['push'](_0x637c3d['shift']());}};_0x598f06(++_0x2aca87);}(_0xc872,0x171));var _0x2c87=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xc872[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x2c87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c87('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c87('0x2'));var db=require(_0x2c87('0x3'))['db'];var utils=require(_0x2c87('0x4'));var logger=require(_0x2c87('0x5'))(_0x2c87('0x6'));var config=require(_0x2c87('0x7'));var jayson=require(_0x2c87('0x8'));var client=jayson[_0x2c87('0x9')][_0x2c87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ab261,_0x226141,_0x3c5ca2){return new BPromise(function(_0x1d4e08,_0x48264f){return client[_0x2c87('0xb')](_0x1ab261,_0x3c5ca2)[_0x2c87('0xc')](function(_0x5c41ab){logger[_0x2c87('0xd')]('License,\x20%s,\x20%s',_0x226141,'request\x20sent');logger[_0x2c87('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x226141,'request\x20sent',JSON[_0x2c87('0xf')](_0x5c41ab));if(_0x5c41ab['error']){if(_0x5c41ab[_0x2c87('0x10')][_0x2c87('0x11')]===0x1f4){logger[_0x2c87('0x10')](_0x2c87('0x12'),_0x226141,_0x5c41ab[_0x2c87('0x10')]['message']);return _0x48264f(_0x5c41ab[_0x2c87('0x10')][_0x2c87('0x13')]);}logger[_0x2c87('0x10')](_0x2c87('0x12'),_0x226141,_0x5c41ab['error'][_0x2c87('0x13')]);return _0x1d4e08(_0x5c41ab['error'][_0x2c87('0x13')]);}else{logger['info'](_0x2c87('0x12'),_0x226141,_0x2c87('0x14'));_0x1d4e08(_0x5c41ab['result']['message']);}})['catch'](function(_0x3a3d84){logger[_0x2c87('0x10')](_0x2c87('0x12'),_0x226141,_0x3a3d84);_0x48264f(_0x3a3d84);});});} \ No newline at end of file +var _0xc3cc=['client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','License,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x565bde,_0x1cdb6b){var _0x43de20=function(_0x42e1cc){while(--_0x42e1cc){_0x565bde['push'](_0x565bde['shift']());}};_0x43de20(++_0x1cdb6b);}(_0xc3cc,0x97));var _0xcc3c=function(_0xe2d14f,_0x49fd0e){_0xe2d14f=_0xe2d14f-0x0;var _0x4522d2=_0xc3cc[_0xe2d14f];return _0x4522d2;};'use strict';var _=require('lodash');var util=require(_0xcc3c('0x0'));var moment=require(_0xcc3c('0x1'));var BPromise=require(_0xcc3c('0x2'));var rs=require(_0xcc3c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc3c('0x4'))['db'];var utils=require(_0xcc3c('0x5'));var logger=require(_0xcc3c('0x6'))(_0xcc3c('0x7'));var config=require(_0xcc3c('0x8'));var jayson=require(_0xcc3c('0x9'));var client=jayson[_0xcc3c('0xa')][_0xcc3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa64510,_0x42f82d,_0x4042fb){return new BPromise(function(_0x4b6fb0,_0x22c885){return client[_0xcc3c('0xc')](_0xa64510,_0x4042fb)[_0xcc3c('0xd')](function(_0x175c69){logger[_0xcc3c('0xe')]('License,\x20%s,\x20%s',_0x42f82d,'request\x20sent');logger[_0xcc3c('0xf')](_0xcc3c('0x10'),_0x42f82d,_0xcc3c('0x11'),JSON[_0xcc3c('0x12')](_0x175c69));if(_0x175c69[_0xcc3c('0x13')]){if(_0x175c69[_0xcc3c('0x13')]['code']===0x1f4){logger[_0xcc3c('0x13')](_0xcc3c('0x14'),_0x42f82d,_0x175c69['error']['message']);return _0x22c885(_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);}logger['error'](_0xcc3c('0x14'),_0x42f82d,_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);return _0x4b6fb0(_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);}else{logger['info'](_0xcc3c('0x14'),_0x42f82d,_0xcc3c('0x11'));_0x4b6fb0(_0x175c69[_0xcc3c('0x16')][_0xcc3c('0x15')]);}})['catch'](function(_0x59db0a){logger[_0xcc3c('0x13')]('License,\x20%s,\x20%s',_0x42f82d,_0x59db0a);_0x22c885(_0x59db0a);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c4a52ae..200584c 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 _0x4f62=['/:id/send','/:id/users','addAgents','put','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/dispositions','addDisposition','post','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications'];(function(_0x21fe47,_0x1ddffd){var _0x3e9216=function(_0x39a528){while(--_0x39a528){_0x21fe47['push'](_0x21fe47['shift']());}};_0x3e9216(++_0x1ddffd);}(_0x4f62,0x183));var _0x24f6=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4f62[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x24f6('0x0'));var util=require('util');var path=require(_0x24f6('0x1'));var timeout=require('connect-timeout');var express=require(_0x24f6('0x2'));var router=express[_0x24f6('0x3')]();var fs_extra=require(_0x24f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x24f6('0x5'));var config=require(_0x24f6('0x6'));var controller=require(_0x24f6('0x7'));router[_0x24f6('0x8')]('/',auth[_0x24f6('0x9')](),controller[_0x24f6('0xa')]);router['get'](_0x24f6('0xb'),auth[_0x24f6('0x9')](),controller[_0x24f6('0xc')]);router[_0x24f6('0x8')](_0x24f6('0xd'),auth[_0x24f6('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x24f6('0x9')](),controller[_0x24f6('0xe')]);router[_0x24f6('0x8')](_0x24f6('0xf'),auth['isAuthenticated'](),controller[_0x24f6('0x10')]);router['get'](_0x24f6('0x11'),auth['isAuthenticated'](),controller[_0x24f6('0x12')]);router[_0x24f6('0x8')](_0x24f6('0x13'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x14')]);router['get'](_0x24f6('0x15'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x16')]);router[_0x24f6('0x8')]('/:id/applications',auth[_0x24f6('0x9')](),controller[_0x24f6('0x17')]);router[_0x24f6('0x8')](_0x24f6('0x18'),auth['isAuthenticated'](),controller[_0x24f6('0x19')]);router[_0x24f6('0x8')]('/:id/verify',auth[_0x24f6('0x9')](),controller[_0x24f6('0x1a')]);router[_0x24f6('0x8')]('/:id/users',auth[_0x24f6('0x9')](),controller['getAgents']);router['post'](_0x24f6('0x1b'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x1c')]);router['post']('/:id/canned_answers',auth[_0x24f6('0x9')](),controller['addAnswer']);router[_0x24f6('0x1d')]('/',auth[_0x24f6('0x9')](),controller[_0x24f6('0x1e')]);router[_0x24f6('0x1d')](_0x24f6('0x11'),auth['isAuthenticated'](),controller[_0x24f6('0x1f')]);router['post'](_0x24f6('0x13'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x20')]);router[_0x24f6('0x1d')](_0x24f6('0x15'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x21')]);router['post'](_0x24f6('0x22'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x23')]);router[_0x24f6('0x1d')](_0x24f6('0x24'),auth[_0x24f6('0x9')](),controller['send']);router['post'](_0x24f6('0x25'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x26')]);router[_0x24f6('0x27')](_0x24f6('0xd'),auth[_0x24f6('0x9')](),controller['update']);router[_0x24f6('0x28')](_0x24f6('0x1b'),auth['isAuthenticated'](),controller[_0x24f6('0x29')]);router[_0x24f6('0x28')](_0x24f6('0xf'),auth[_0x24f6('0x9')](),controller['removeAnswers']);router[_0x24f6('0x28')](_0x24f6('0x11'),auth['isAuthenticated'](),controller[_0x24f6('0x2a')]);router[_0x24f6('0x28')](_0x24f6('0x13'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x2b')]);router[_0x24f6('0x28')](_0x24f6('0xd'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x2c')]);router[_0x24f6('0x28')](_0x24f6('0x25'),auth[_0x24f6('0x9')](),controller[_0x24f6('0x2d')]);module[_0x24f6('0x2e')]=router; \ No newline at end of file +var _0x5276=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','/:id/dispositions','addDisposition','create','/:id/out_servers','addSmtp','/:id/applications','/:id/send','addAgents','put','delete','removeDispositions','removeImap','destroy','removeAgents','exports','multer'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5276,0x1c2));var _0x6527=function(_0x530931,_0x4090c4){_0x530931=_0x530931-0x0;var _0x29ea44=_0x5276[_0x530931];return _0x29ea44;};'use strict';var multer=require(_0x6527('0x0'));var util=require(_0x6527('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6527('0x2')]();var fs_extra=require(_0x6527('0x3'));var auth=require(_0x6527('0x4'));var interaction=require(_0x6527('0x5'));var config=require(_0x6527('0x6'));var controller=require(_0x6527('0x7'));router[_0x6527('0x8')]('/',auth[_0x6527('0x9')](),controller['index']);router[_0x6527('0x8')](_0x6527('0xa'),auth['isAuthenticated'](),controller[_0x6527('0xb')]);router['get'](_0x6527('0xc'),auth[_0x6527('0x9')](),controller[_0x6527('0xd')]);router[_0x6527('0x8')]('/:id/dispositions',auth[_0x6527('0x9')](),controller['getDispositions']);router['get'](_0x6527('0xe'),auth['isAuthenticated'](),controller[_0x6527('0xf')]);router['get'](_0x6527('0x10'),auth[_0x6527('0x9')](),controller['getImap']);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6527('0x11')]);router[_0x6527('0x8')](_0x6527('0x12'),auth[_0x6527('0x9')](),controller[_0x6527('0x13')]);router[_0x6527('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6527('0x14')]);router[_0x6527('0x8')](_0x6527('0x15'),auth[_0x6527('0x9')](),controller[_0x6527('0x16')]);router[_0x6527('0x8')](_0x6527('0x17'),auth[_0x6527('0x9')](),controller['verifySmtp']);router['get'](_0x6527('0x18'),auth[_0x6527('0x9')](),controller['getAgents']);router[_0x6527('0x19')](_0x6527('0x1a'),auth[_0x6527('0x9')](),controller[_0x6527('0x1b')]);router[_0x6527('0x19')](_0x6527('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x6527('0x19')]('/',auth[_0x6527('0x9')](),controller[_0x6527('0x1c')]);router['post']('/:id/in_servers',auth[_0x6527('0x9')](),controller['addImap']);router[_0x6527('0x19')](_0x6527('0x1d'),auth[_0x6527('0x9')](),controller[_0x6527('0x1e')]);router[_0x6527('0x19')](_0x6527('0x12'),auth[_0x6527('0x9')](),controller['addInteraction']);router['post'](_0x6527('0x1f'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6527('0x19')](_0x6527('0x20'),auth['isAuthenticated'](),controller['send']);router[_0x6527('0x19')](_0x6527('0x18'),auth[_0x6527('0x9')](),controller[_0x6527('0x21')]);router[_0x6527('0x22')](_0x6527('0xc'),auth[_0x6527('0x9')](),controller['update']);router[_0x6527('0x23')]('/:id/dispositions',auth[_0x6527('0x9')](),controller[_0x6527('0x24')]);router[_0x6527('0x23')](_0x6527('0xe'),auth[_0x6527('0x9')](),controller['removeAnswers']);router[_0x6527('0x23')](_0x6527('0x10'),auth[_0x6527('0x9')](),controller[_0x6527('0x25')]);router[_0x6527('0x23')](_0x6527('0x1d'),auth[_0x6527('0x9')](),controller['removeSmtp']);router[_0x6527('0x23')]('/:id',auth[_0x6527('0x9')](),controller[_0x6527('0x26')]);router[_0x6527('0x23')](_0x6527('0x18'),auth[_0x6527('0x9')](),controller[_0x6527('0x27')]);module[_0x6527('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c25ffa7..81965c4 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 _0xae79=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x5e20a7,_0x4568ae){var _0x2abe1a=function(_0x580d60){while(--_0x580d60){_0x5e20a7['push'](_0x5e20a7['shift']());}};_0x2abe1a(++_0x4568ae);}(_0xae79,0x1d3));var _0x9ae7=function(_0x3ea1d5,_0x557a62){_0x3ea1d5=_0x3ea1d5-0x0;var _0x466bb4=_0xae79[_0x3ea1d5];return _0x466bb4;};'use strict';var Sequelize=require(_0x9ae7('0x0'));module[_0x9ae7('0x1')]={'description':{'type':Sequelize[_0x9ae7('0x2')]},'name':{'type':Sequelize[_0x9ae7('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9ae7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9ae7('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x9ae7('0x4')]},'markAsUnread':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9ae7('0x2')],'allowNull':![],'defaultValue':_0x9ae7('0x5')},'fontSize':{'type':Sequelize[_0x9ae7('0x6')](0x2)[_0x9ae7('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9ae7('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ae7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ae7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ae7('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9ae7('0x3')],'defaultValue':![],'comment':_0x9ae7('0x8'),'set':function(_0x26f825){if(!_0x26f825)this[_0x9ae7('0x9')](_0x9ae7('0xa'),null);this[_0x9ae7('0x9')](_0x9ae7('0xb'),_0x26f825);}}}; \ No newline at end of file +var _0x9c5a=['Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x5d445e,_0x54a89a){var _0x30e69c=function(_0x2e9a07){while(--_0x2e9a07){_0x5d445e['push'](_0x5d445e['shift']());}};_0x30e69c(++_0x54a89a);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x485355,_0x262eea){_0x485355=_0x485355-0x0;var _0x77c1a4=_0x9c5a[_0x485355];return _0x77c1a4;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa9c5('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa9c5('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa9c5('0x4')]},'markAsUnread':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa9c5('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xa9c5('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa9c5('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9c5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa9c5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9c5('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa9c5('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x38e106){if(!_0x38e106)this[_0xa9c5('0x9')](_0xa9c5('0xa'),null);this[_0xa9c5('0x9')](_0xa9c5('0xb'),_0x38e106);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 0071f6f..afb1616 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 _0x3bd8=['tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','Contacts','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','save','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','MailAccount','includeAll','include','rows','catch','show','params','Smtp','keys','fields','options','find','update','body','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','nolimit','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','user','password','pass','authentication','host','port','service','cuser','cpassword','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','Tags','color'];(function(_0x194d76,_0x4012e8){var _0x2d5708=function(_0x3d2e8f){while(--_0x3d2e8f){_0x194d76['push'](_0x194d76['shift']());}};_0x2d5708(++_0x4012e8);}(_0x3bd8,0x1bb));var _0x83bd=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0x3bd8[_0x571c1d];return _0x33c609;};'use strict';var emlformat=require(_0x83bd('0x0'));var rimraf=require(_0x83bd('0x1'));var zipdir=require(_0x83bd('0x2'));var jsonpatch=require(_0x83bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83bd('0x4'));var Mustache=require(_0x83bd('0x5'));var util=require(_0x83bd('0x6'));var path=require('path');var sox=require(_0x83bd('0x7'));var csv=require(_0x83bd('0x8'));var ejs=require(_0x83bd('0x9'));var fs=require('fs');var fs_extra=require(_0x83bd('0xa'));var _=require('lodash');var squel=require(_0x83bd('0xb'));var crypto=require('crypto');var jsforce=require(_0x83bd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83bd('0xd'));var Papa=require(_0x83bd('0xe'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require('ioredis');var authService=require(_0x83bd('0xf'));var qs=require(_0x83bd('0x10'));var as=require(_0x83bd('0x11'));var hardwareService=require(_0x83bd('0x12'));var logger=require(_0x83bd('0x13'))(_0x83bd('0x14'));var utils=require(_0x83bd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x83bd('0x16'));var db=require('../../mysqldb')['db'];config[_0x83bd('0x17')]=_['defaults'](config[_0x83bd('0x17')],{'host':_0x83bd('0x18'),'port':0x18eb});var socket=require(_0x83bd('0x19'))(new Redis(config[_0x83bd('0x17')]));require(_0x83bd('0x1a'))['register'](socket);var jayson=require(_0x83bd('0x1b'));var client=jayson[_0x83bd('0x1c')][_0x83bd('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x147a0,_0x591b77,_0x173142,_0x1879ac){return new BPromise(function(_0x510801,_0x385205){var _0x59b293=_0x1879ac||client;return _0x59b293[_0x83bd('0x1e')](_0x147a0,_0x173142)[_0x83bd('0x1f')](function(_0x3f28c3){logger[_0x83bd('0x20')](_0x83bd('0x21'),_0x591b77,_0x83bd('0x22'));logger['debug'](_0x83bd('0x23'),_0x591b77,'request\x20sent',JSON['stringify'](_0x3f28c3));if(_0x3f28c3['error']){if(_0x3f28c3[_0x83bd('0x24')][_0x83bd('0x25')]===0x1f4){logger[_0x83bd('0x24')]('MailAccount,\x20%s,\x20%s',_0x591b77,_0x3f28c3[_0x83bd('0x24')][_0x83bd('0x26')]);return _0x385205(_0x3f28c3[_0x83bd('0x24')]['message']);}logger['error'](_0x83bd('0x21'),_0x591b77,_0x3f28c3[_0x83bd('0x24')][_0x83bd('0x26')]);return _0x510801(_0x3f28c3['error'][_0x83bd('0x26')]);}else{logger[_0x83bd('0x20')](_0x83bd('0x21'),_0x591b77,_0x83bd('0x22'));_0x510801(_0x3f28c3[_0x83bd('0x27')][_0x83bd('0x26')]);}})['catch'](function(_0x523c84){logger[_0x83bd('0x24')](_0x83bd('0x21'),_0x591b77,_0x523c84);_0x385205(_0x523c84);});});}function respondWithStatusCode(_0xc7631,_0x46b84d){_0x46b84d=_0x46b84d||0xcc;return function(_0x169249){if(_0x169249){return _0xc7631[_0x83bd('0x28')](_0x46b84d);}return _0xc7631[_0x83bd('0x29')](_0x46b84d)[_0x83bd('0x2a')]();};}function respondWithResult(_0x3adc4b,_0x21d4ff){_0x21d4ff=_0x21d4ff||0xc8;return function(_0x1e4703){if(_0x1e4703){return _0x3adc4b['status'](_0x21d4ff)['json'](_0x1e4703);}};}function respondWithFilteredResult(_0x35f81a,_0x557455){return function(_0x5a054a){if(_0x5a054a){var _0x31c8df=typeof _0x557455[_0x83bd('0x2b')]===_0x83bd('0x2c')&&typeof _0x557455['limit']===_0x83bd('0x2c');var _0x3b10cf=_0x5a054a[_0x83bd('0x2d')];var _0x2574f7=_0x31c8df?0x0:_0x557455[_0x83bd('0x2b')];var _0x5c2b67=_0x31c8df?_0x5a054a[_0x83bd('0x2d')]:_0x557455[_0x83bd('0x2b')]+_0x557455['limit'];var _0x346a60;if(_0x5c2b67>=_0x3b10cf){_0x5c2b67=_0x3b10cf;_0x346a60=0xc8;}else{_0x346a60=0xce;}_0x35f81a[_0x83bd('0x29')](_0x346a60);return _0x35f81a[_0x83bd('0x2e')]('Content-Range',_0x2574f7+'-'+_0x5c2b67+'/'+_0x3b10cf)[_0x83bd('0x2f')](_0x5a054a);}return null;};}function patchUpdates(_0x320432){return function(_0x730d47){try{jsonpatch[_0x83bd('0x30')](_0x730d47,_0x320432,!![]);}catch(_0x5a3c0a){return BPromise[_0x83bd('0x31')](_0x5a3c0a);}return _0x730d47[_0x83bd('0x32')]();};}function saveUpdates(_0x2a1683,_0x84b378){return function(_0x46bd05){if(_0x46bd05){return _0x46bd05['update'](_0x2a1683)[_0x83bd('0x1f')](function(_0x1b269d){return _0x1b269d;});}return null;};}function removeEntity(_0x20ee8d,_0x2bb09a){return function(_0x418a95){if(_0x418a95){return _0x418a95[_0x83bd('0x33')]()[_0x83bd('0x1f')](function(){var _0x29e336=_0x418a95['get']({'plain':!![]});var _0x16fa41=_0x83bd('0x34');return db[_0x83bd('0x35')][_0x83bd('0x33')]({'where':{'type':_0x16fa41,'resourceId':_0x29e336['id']}})[_0x83bd('0x1f')](function(){return _0x418a95;});})[_0x83bd('0x1f')](function(){_0x20ee8d[_0x83bd('0x29')](0xcc)[_0x83bd('0x2a')]();});}};}function handleEntityNotFound(_0x216167,_0xde2b18){return function(_0x28574f){if(!_0x28574f){_0x216167[_0x83bd('0x28')](0x194);}return _0x28574f;};}function handleError(_0x2e5e05,_0xeb3386){_0xeb3386=_0xeb3386||0x1f4;return function(_0x3813a2){logger['error'](_0x3813a2[_0x83bd('0x36')]);if(_0x3813a2['name']){delete _0x3813a2[_0x83bd('0x37')];}_0x2e5e05[_0x83bd('0x29')](_0xeb3386)[_0x83bd('0x38')](_0x3813a2);};}exports[_0x83bd('0x39')]=function(_0x3ee598,_0x3e0abf){var _0x57a4e2={'include':[{'model':db[_0x83bd('0x3a')],'as':_0x83bd('0x3b')},{'model':db[_0x83bd('0x3c')],'as':'Smtp'},{'model':db[_0x83bd('0x3d')],'as':_0x83bd('0x3e')}]},_0xfb9285={},_0x405d0e={'count':0x0,'rows':[]};var _0x49640e=_[_0x83bd('0x3f')](db['MailAccount'][_0x83bd('0x40')],function(_0x2fd735){return{'name':_0x2fd735[_0x83bd('0x41')],'type':_0x2fd735['type'][_0x83bd('0x42')]};});_0xfb9285[_0x83bd('0x43')]=_['map'](_0x49640e,_0x83bd('0x37'));_0xfb9285[_0x83bd('0x44')]=_['keys'](_0x3ee598[_0x83bd('0x44')]);_0xfb9285[_0x83bd('0x45')]=_['intersection'](_0xfb9285['model'],_0xfb9285[_0x83bd('0x44')]);_0x57a4e2[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0xfb9285[_0x83bd('0x43')],qs['fields'](_0x3ee598['query']['fields']));_0x57a4e2[_0x83bd('0x46')]=_0x57a4e2['attributes'][_0x83bd('0x48')]?_0x57a4e2[_0x83bd('0x46')]:_0xfb9285[_0x83bd('0x43')];if(!_0x3ee598[_0x83bd('0x44')][_0x83bd('0x49')]('nolimit')){_0x57a4e2[_0x83bd('0x4a')]=qs[_0x83bd('0x4a')](_0x3ee598[_0x83bd('0x44')][_0x83bd('0x4a')]);_0x57a4e2['offset']=qs[_0x83bd('0x2b')](_0x3ee598[_0x83bd('0x44')][_0x83bd('0x2b')]);}_0x57a4e2[_0x83bd('0x4b')]=qs[_0x83bd('0x4c')](_0x3ee598[_0x83bd('0x44')][_0x83bd('0x4c')]);_0x57a4e2[_0x83bd('0x4d')]=qs[_0x83bd('0x45')](_['pick'](_0x3ee598[_0x83bd('0x44')],_0xfb9285[_0x83bd('0x45')]),_0x49640e);if(_0x3ee598[_0x83bd('0x44')][_0x83bd('0x4e')]){_0x57a4e2[_0x83bd('0x4d')]=_[_0x83bd('0x4f')](_0x57a4e2[_0x83bd('0x4d')],{'$or':_[_0x83bd('0x3f')](_0x49640e,function(_0x1aefd9){if(_0x1aefd9[_0x83bd('0x50')]!==_0x83bd('0x51')){var _0xf309d={};_0xf309d[_0x1aefd9[_0x83bd('0x37')]]={'$like':'%'+_0x3ee598['query'][_0x83bd('0x4e')]+'%'};return _0xf309d;}})});}_0x57a4e2=_['merge']({},_0x57a4e2,_0x3ee598['options']);var _0x3b9978={'where':_0x57a4e2['where']};return db[_0x83bd('0x52')][_0x83bd('0x2d')](_0x3b9978)['then'](function(_0x18da89){_0x405d0e[_0x83bd('0x2d')]=_0x18da89;if(_0x3ee598[_0x83bd('0x44')][_0x83bd('0x53')]){_0x57a4e2[_0x83bd('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x57a4e2);})[_0x83bd('0x1f')](function(_0x203393){_0x405d0e[_0x83bd('0x55')]=_0x203393;return _0x405d0e;})['then'](respondWithFilteredResult(_0x3e0abf,_0x57a4e2))[_0x83bd('0x56')](handleError(_0x3e0abf,null));};exports[_0x83bd('0x57')]=function(_0x376185,_0x27b033){var _0x3069d7={'raw':![],'where':{'id':_0x376185[_0x83bd('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x83bd('0x59')},{'model':db[_0x83bd('0x3d')],'as':_0x83bd('0x3e')}]},_0x5406ff={};_0x5406ff[_0x83bd('0x43')]=_[_0x83bd('0x5a')](db[_0x83bd('0x52')][_0x83bd('0x40')]);_0x5406ff[_0x83bd('0x44')]=_[_0x83bd('0x5a')](_0x376185[_0x83bd('0x44')]);_0x5406ff['filters']=_[_0x83bd('0x47')](_0x5406ff[_0x83bd('0x43')],_0x5406ff[_0x83bd('0x44')]);_0x3069d7[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0x5406ff[_0x83bd('0x43')],qs[_0x83bd('0x5b')](_0x376185[_0x83bd('0x44')][_0x83bd('0x5b')]));_0x3069d7[_0x83bd('0x46')]=_0x3069d7['attributes'][_0x83bd('0x48')]?_0x3069d7[_0x83bd('0x46')]:_0x5406ff['model'];if(_0x376185[_0x83bd('0x44')][_0x83bd('0x53')]){_0x3069d7[_0x83bd('0x54')]=[{'all':!![]}];}_0x3069d7=_[_0x83bd('0x4f')]({},_0x3069d7,_0x376185[_0x83bd('0x5c')]);return db['MailAccount'][_0x83bd('0x5d')](_0x3069d7)[_0x83bd('0x1f')](handleEntityNotFound(_0x27b033,null))[_0x83bd('0x1f')](respondWithResult(_0x27b033,null))[_0x83bd('0x56')](handleError(_0x27b033,null));};exports[_0x83bd('0x5e')]=function(_0xc00ab3,_0x5ee335){if(_0xc00ab3['body']['id']){delete _0xc00ab3[_0x83bd('0x5f')]['id'];}return db['MailAccount'][_0x83bd('0x5d')]({'where':{'id':_0xc00ab3[_0x83bd('0x58')]['id']},'include':[{'model':db[_0x83bd('0x3a')],'as':_0x83bd('0x3b')},{'model':db[_0x83bd('0x3c')],'as':_0x83bd('0x59')},{'model':db[_0x83bd('0x3d')],'as':_0x83bd('0x3e')}]})[_0x83bd('0x1f')](handleEntityNotFound(_0x5ee335,null))['then'](saveUpdates(_0xc00ab3[_0x83bd('0x5f')],null))[_0x83bd('0x1f')](function(_0x578ae5){if(_0x578ae5&&_0xc00ab3[_0x83bd('0x5f')][_0x83bd('0x3b')]){return db[_0x83bd('0x3a')]['update'](_0xc00ab3[_0x83bd('0x5f')][_0x83bd('0x3b')],{'where':{'MailAccountId':_0x578ae5['id']}})[_0x83bd('0x1f')](function(){return _0x578ae5;});}return _0x578ae5;})[_0x83bd('0x1f')](function(_0x561fe7){if(_0x561fe7&&_0xc00ab3['body']['Smtp']){return db[_0x83bd('0x3c')][_0x83bd('0x5e')](_0xc00ab3[_0x83bd('0x5f')][_0x83bd('0x59')],{'where':{'MailAccountId':_0x561fe7['id']}})[_0x83bd('0x1f')](function(){return _0x561fe7;});}return _0x561fe7;})[_0x83bd('0x1f')](respondWithResult(_0x5ee335,null))[_0x83bd('0x56')](handleError(_0x5ee335,null));};exports[_0x83bd('0x60')]=function(_0x38ff2f,_0x327df2){return db[_0x83bd('0x52')][_0x83bd('0x60')]()['then'](respondWithResult(_0x327df2,null))[_0x83bd('0x56')](handleError(_0x327df2,null));};exports[_0x83bd('0x61')]=function(_0x4dff40,_0x5636bc,_0x18778a){if(_0x4dff40['body']['id']){delete _0x4dff40[_0x83bd('0x5f')]['id'];}return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x4dff40[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x5636bc,null))['then'](function(_0x2497e2){if(_0x2497e2){_0x4dff40[_0x83bd('0x5f')][_0x83bd('0x62')]=_0x2497e2['id'];return db[_0x83bd('0x63')]['create'](_0x4dff40[_0x83bd('0x5f')]);}})['then'](respondWithResult(_0x5636bc,null))[_0x83bd('0x56')](handleError(_0x5636bc,null));};exports[_0x83bd('0x64')]=function(_0x2a9f33,_0x5f1f5f,_0x396303){var _0x28e467={'raw':![],'where':{}};var _0x3362e8={};var _0x30d3c4={'count':0x0,'rows':[]};return db[_0x83bd('0x52')][_0x83bd('0x65')]({'where':{'id':_0x2a9f33[_0x83bd('0x58')]['id']}})['then'](handleEntityNotFound(_0x5f1f5f,null))[_0x83bd('0x1f')](function(_0x1758a7){if(_0x1758a7){_0x3362e8[_0x83bd('0x43')]=_[_0x83bd('0x5a')](db[_0x83bd('0x63')][_0x83bd('0x40')]);_0x3362e8['query']=_[_0x83bd('0x5a')](_0x2a9f33[_0x83bd('0x44')]);_0x3362e8[_0x83bd('0x45')]=_['intersection'](_0x3362e8[_0x83bd('0x43')],_0x3362e8[_0x83bd('0x44')]);_0x28e467[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0x3362e8[_0x83bd('0x43')],qs[_0x83bd('0x5b')](_0x2a9f33[_0x83bd('0x44')]['fields']));_0x28e467[_0x83bd('0x46')]=_0x28e467['attributes'][_0x83bd('0x48')]?_0x28e467[_0x83bd('0x46')]:_0x3362e8[_0x83bd('0x43')];if(!_0x2a9f33[_0x83bd('0x44')]['hasOwnProperty'](_0x83bd('0x66'))){_0x28e467[_0x83bd('0x4a')]=qs['limit'](_0x2a9f33['query']['limit']);_0x28e467[_0x83bd('0x2b')]=qs[_0x83bd('0x2b')](_0x2a9f33[_0x83bd('0x44')][_0x83bd('0x2b')]);}_0x28e467[_0x83bd('0x4b')]=qs['sort'](_0x2a9f33[_0x83bd('0x44')][_0x83bd('0x4c')]);_0x28e467[_0x83bd('0x4d')]=qs[_0x83bd('0x45')](_[_0x83bd('0x67')](_0x2a9f33[_0x83bd('0x44')],_0x3362e8[_0x83bd('0x45')]));_0x28e467[_0x83bd('0x4d')]['MailAccountId']=_0x1758a7['id'];if(_0x2a9f33['query']['filter']){_0x28e467[_0x83bd('0x4d')]=_[_0x83bd('0x4f')](_0x28e467[_0x83bd('0x4d')],{'$or':_[_0x83bd('0x3f')](_0x28e467[_0x83bd('0x46')],function(_0x700df5){var _0x55e12e={};_0x55e12e[_0x700df5]={'$like':'%'+_0x2a9f33[_0x83bd('0x44')]['filter']+'%'};return _0x55e12e;})});}_0x28e467=_[_0x83bd('0x4f')]({},_0x28e467,_0x2a9f33[_0x83bd('0x5c')]);return db[_0x83bd('0x63')][_0x83bd('0x2d')]({'where':_0x28e467['where']})[_0x83bd('0x1f')](function(_0x526c99){_0x30d3c4['count']=_0x526c99;if(_0x2a9f33[_0x83bd('0x44')][_0x83bd('0x53')]){_0x28e467[_0x83bd('0x54')]=[{'all':!![]}];}return db[_0x83bd('0x63')][_0x83bd('0x68')](_0x28e467);})[_0x83bd('0x1f')](function(_0x5d3d0e){_0x30d3c4[_0x83bd('0x55')]=_0x5d3d0e;return _0x30d3c4;});}})[_0x83bd('0x1f')](respondWithFilteredResult(_0x5f1f5f,_0x28e467))[_0x83bd('0x56')](handleError(_0x5f1f5f,null));};exports[_0x83bd('0x69')]=function(_0x106a2c,_0x189ab4,_0x12b1fd){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x106a2c[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x189ab4,null))[_0x83bd('0x1f')](function(_0x1b7e37){if(_0x1b7e37){return _0x1b7e37[_0x83bd('0x69')](_0x106a2c[_0x83bd('0x44')][_0x83bd('0x6a')]);}})[_0x83bd('0x1f')](respondWithStatusCode(_0x189ab4,null))[_0x83bd('0x56')](handleError(_0x189ab4,null));};exports[_0x83bd('0x6b')]=function(_0x25dd53,_0x35b232,_0x2dc776){if(_0x25dd53[_0x83bd('0x5f')]['id']){delete _0x25dd53[_0x83bd('0x5f')]['id'];}return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x25dd53[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x35b232,null))[_0x83bd('0x1f')](function(_0x54eaef){if(_0x54eaef){_0x25dd53['body'][_0x83bd('0x62')]=_0x54eaef['id'];return db[_0x83bd('0x6c')][_0x83bd('0x6d')](_0x25dd53[_0x83bd('0x5f')]);}})[_0x83bd('0x1f')](respondWithResult(_0x35b232,null))[_0x83bd('0x56')](handleError(_0x35b232,null));};exports[_0x83bd('0x6e')]=function(_0x8e0597,_0x52e665,_0x377c15){var _0x4e204e={'raw':![],'where':{}};var _0x581222={};var _0x135a35={'count':0x0,'rows':[]};return db['MailAccount'][_0x83bd('0x65')]({'where':{'id':_0x8e0597[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x52e665,null))[_0x83bd('0x1f')](function(_0x1874a3){if(_0x1874a3){_0x581222['model']=_[_0x83bd('0x5a')](db['CannedAnswer'][_0x83bd('0x40')]);_0x581222['query']=_[_0x83bd('0x5a')](_0x8e0597[_0x83bd('0x44')]);_0x581222[_0x83bd('0x45')]=_[_0x83bd('0x47')](_0x581222[_0x83bd('0x43')],_0x581222['query']);_0x4e204e[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0x581222['model'],qs[_0x83bd('0x5b')](_0x8e0597['query']['fields']));_0x4e204e[_0x83bd('0x46')]=_0x4e204e[_0x83bd('0x46')][_0x83bd('0x48')]?_0x4e204e['attributes']:_0x581222[_0x83bd('0x43')];if(!_0x8e0597[_0x83bd('0x44')]['hasOwnProperty'](_0x83bd('0x66'))){_0x4e204e[_0x83bd('0x4a')]=qs[_0x83bd('0x4a')](_0x8e0597[_0x83bd('0x44')][_0x83bd('0x4a')]);_0x4e204e[_0x83bd('0x2b')]=qs[_0x83bd('0x2b')](_0x8e0597[_0x83bd('0x44')][_0x83bd('0x2b')]);}_0x4e204e[_0x83bd('0x4b')]=qs['sort'](_0x8e0597[_0x83bd('0x44')][_0x83bd('0x4c')]);_0x4e204e[_0x83bd('0x4d')]=qs[_0x83bd('0x45')](_['pick'](_0x8e0597[_0x83bd('0x44')],_0x581222[_0x83bd('0x45')]));_0x4e204e[_0x83bd('0x4d')][_0x83bd('0x62')]=_0x1874a3['id'];if(_0x8e0597[_0x83bd('0x44')]['filter']){_0x4e204e['where']=_[_0x83bd('0x4f')](_0x4e204e[_0x83bd('0x4d')],{'$or':_[_0x83bd('0x3f')](_0x4e204e[_0x83bd('0x46')],function(_0x48360e){var _0x57e285={};_0x57e285[_0x48360e]={'$like':'%'+_0x8e0597[_0x83bd('0x44')][_0x83bd('0x4e')]+'%'};return _0x57e285;})});}_0x4e204e=_['merge']({},_0x4e204e,_0x8e0597[_0x83bd('0x5c')]);return db[_0x83bd('0x6c')][_0x83bd('0x2d')]({'where':_0x4e204e['where']})[_0x83bd('0x1f')](function(_0x1427ba){_0x135a35['count']=_0x1427ba;if(_0x8e0597[_0x83bd('0x44')]['includeAll']){_0x4e204e[_0x83bd('0x54')]=[{'all':!![]}];}return db[_0x83bd('0x6c')]['findAll'](_0x4e204e);})[_0x83bd('0x1f')](function(_0x172aa9){_0x135a35[_0x83bd('0x55')]=_0x172aa9;return _0x135a35;});}})[_0x83bd('0x1f')](respondWithFilteredResult(_0x52e665,_0x4e204e))[_0x83bd('0x56')](handleError(_0x52e665,null));};exports[_0x83bd('0x6f')]=function(_0x3ab042,_0x1d5026,_0xdf7930){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x3ab042['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x1d5026,null))[_0x83bd('0x1f')](function(_0x3cabd8){if(_0x3cabd8){return _0x3cabd8[_0x83bd('0x6f')](_0x3ab042[_0x83bd('0x44')][_0x83bd('0x6a')]);}})['then'](respondWithStatusCode(_0x1d5026,null))[_0x83bd('0x56')](handleError(_0x1d5026,null));};exports[_0x83bd('0x6d')]=function(_0x3ba72c,_0x40474f){var _0x31c92f={'name':_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x37')],'key':_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x42')],'email':_0x3ba72c['body'][_0x83bd('0x70')],'ListId':_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x71')],'active':!_[_0x83bd('0x72')](_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x73')])?_0x3ba72c[_0x83bd('0x5f')]['active']:!![],'description':_0x3ba72c['body'][_0x83bd('0x74')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x75')])){if(_0x3ba72c[_0x83bd('0x5f')]['cauthentication']){_0x31c92f[_0x83bd('0x3b')][_0x83bd('0x76')]=_0x31c92f[_0x83bd('0x59')]['user']=_0x3ba72c[_0x83bd('0x5f')]['cuser'];_0x31c92f[_0x83bd('0x3b')][_0x83bd('0x77')]=_0x31c92f[_0x83bd('0x59')][_0x83bd('0x78')]=_0x3ba72c['body']['cpassword'];}else{_0x31c92f['Imap'][_0x83bd('0x79')]=_0x31c92f['Smtp'][_0x83bd('0x79')]=![];}_0x31c92f['Imap'][_0x83bd('0x7a')]=_0x3ba72c[_0x83bd('0x5f')]['Imap'][_0x83bd('0x7a')];_0x31c92f[_0x83bd('0x3b')][_0x83bd('0x7b')]=_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x3b')][_0x83bd('0x7b')];_0x31c92f[_0x83bd('0x59')]['host']=_0x3ba72c['body'][_0x83bd('0x59')][_0x83bd('0x7a')];_0x31c92f[_0x83bd('0x59')][_0x83bd('0x7b')]=_0x3ba72c[_0x83bd('0x5f')]['Smtp'][_0x83bd('0x7b')];}else{_0x31c92f[_0x83bd('0x3b')][_0x83bd('0x7c')]=_0x31c92f[_0x83bd('0x59')][_0x83bd('0x7c')]=_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x75')];_0x31c92f[_0x83bd('0x3b')]['user']=_0x31c92f[_0x83bd('0x59')]['user']=_0x3ba72c[_0x83bd('0x5f')][_0x83bd('0x7d')];_0x31c92f['Imap'][_0x83bd('0x77')]=_0x31c92f[_0x83bd('0x59')][_0x83bd('0x78')]=_0x3ba72c['body'][_0x83bd('0x7e')];}return db[_0x83bd('0x52')][_0x83bd('0x6d')](_0x31c92f,{'include':[{'model':db['MailServerOut'],'as':_0x83bd('0x59')},{'model':db['MailServerIn'],'as':_0x83bd('0x3b')}]})[_0x83bd('0x1f')](function(_0x25fb86){var _0x424fa1=_0x3ba72c['user'][_0x83bd('0x7f')]({'plain':!![]});if(!_0x424fa1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x424fa1['role']===_0x83bd('0x76')){var _0x33f5ae=_0x25fb86[_0x83bd('0x7f')]({'plain':!![]});return db[_0x83bd('0x80')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x424fa1['userProfileId']},'raw':!![]})[_0x83bd('0x1f')](function(_0x2711ef){if(_0x2711ef&&_0x2711ef[_0x83bd('0x81')]===0x0){return db['UserProfileResource'][_0x83bd('0x6d')]({'name':_0x33f5ae[_0x83bd('0x37')],'resourceId':_0x33f5ae['id'],'type':_0x2711ef[_0x83bd('0x37')],'sectionId':_0x2711ef['id']},{})['then'](function(){return _0x25fb86;});}else{return _0x25fb86;}})[_0x83bd('0x56')](function(_0x318ebf){logger[_0x83bd('0x24')](_0x83bd('0x82'),_0x318ebf);throw _0x318ebf;});}return _0x25fb86;})['then'](respondWithResult(_0x40474f,0xc9))[_0x83bd('0x56')](handleError(_0x40474f,null));};exports[_0x83bd('0x83')]=function(_0x180571,_0x575357,_0x10a2b4){return db[_0x83bd('0x52')][_0x83bd('0x65')]({'where':{'id':_0x180571[_0x83bd('0x58')]['id']}})['then'](handleEntityNotFound(_0x575357,null))[_0x83bd('0x1f')](function(_0x1f6f9e){if(_0x1f6f9e){return _0x1f6f9e['getImap']();}return null;})[_0x83bd('0x1f')](respondWithResult(_0x575357,null))[_0x83bd('0x56')](handleError(_0x575357,null));};exports[_0x83bd('0x84')]=function(_0x13a539,_0x3e3fd7,_0x6ebd95){if(_0x13a539['body']['id']){delete _0x13a539[_0x83bd('0x5f')]['id'];}return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x13a539[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x3e3fd7,null))[_0x83bd('0x1f')](function(_0x5321f2){if(_0x5321f2){_0x13a539['body']['MailAccountId']=_0x5321f2['id'];return db[_0x83bd('0x3a')][_0x83bd('0x6d')](_0x13a539[_0x83bd('0x5f')]);}})['then'](respondWithResult(_0x3e3fd7,null))[_0x83bd('0x56')](handleError(_0x3e3fd7,null));};exports[_0x83bd('0x85')]=function(_0x4503fa,_0x48dceb,_0x2b4664){return db[_0x83bd('0x52')][_0x83bd('0x65')]({'where':{'id':_0x4503fa[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x48dceb,null))['then'](function(_0x5d5ee){if(_0x5d5ee){return _0x5d5ee[_0x83bd('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x48dceb,null))[_0x83bd('0x56')](handleError(_0x48dceb,null));};exports[_0x83bd('0x87')]=function(_0xb8ee1,_0x35f9f6,_0xabed42){return db[_0x83bd('0x52')][_0x83bd('0x65')]({'where':{'id':_0xb8ee1[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x35f9f6,null))[_0x83bd('0x1f')](function(_0x6dcfd8){if(_0x6dcfd8){return _0x6dcfd8[_0x83bd('0x87')]();}return null;})[_0x83bd('0x1f')](respondWithResult(_0x35f9f6,null))[_0x83bd('0x56')](handleError(_0x35f9f6,null));};exports[_0x83bd('0x88')]=function(_0x28ada8,_0x32e672,_0x40ba9e){if(_0x28ada8[_0x83bd('0x5f')]['id']){delete _0x28ada8['body']['id'];}return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x28ada8['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x32e672,null))['then'](function(_0x29ce60){if(_0x29ce60){_0x28ada8[_0x83bd('0x5f')][_0x83bd('0x62')]=_0x29ce60['id'];return db['MailServerOut']['create'](_0x28ada8[_0x83bd('0x5f')]);}})[_0x83bd('0x1f')](respondWithResult(_0x32e672,null))['catch'](handleError(_0x32e672,null));};exports[_0x83bd('0x89')]=function(_0x40082f,_0x403f97,_0x383c3b){return db[_0x83bd('0x52')]['findOne']({'where':{'id':_0x40082f['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x403f97,null))[_0x83bd('0x1f')](function(_0x4fdc68){if(_0x4fdc68){return _0x4fdc68[_0x83bd('0x8a')](null);}return null;})[_0x83bd('0x1f')](respondWithStatusCode(_0x403f97,null))[_0x83bd('0x56')](handleError(_0x403f97,null));};exports[_0x83bd('0x8b')]=function(_0x339fea,_0x5d9e7f,_0x2ac269){return db[_0x83bd('0x8c')][_0x83bd('0x5d')]({'where':{'id':_0x339fea[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x5d9e7f,null))[_0x83bd('0x1f')](function(_0x31776f){if(_0x31776f){return _0x31776f[_0x83bd('0x8b')](_0x339fea['body'][_0x83bd('0x6a')],_[_0x83bd('0x8d')](_0x339fea[_0x83bd('0x5f')],[_0x83bd('0x6a'),'id'])||{});}})[_0x83bd('0x1f')](respondWithResult(_0x5d9e7f,null))[_0x83bd('0x56')](handleError(_0x5d9e7f,null));};exports[_0x83bd('0x8e')]=function(_0x1cc9c6,_0x4553e2,_0x2c3912){var _0x5b5d0e={'raw':![],'where':{}};var _0x22a2ae={};var _0x3b166e={'count':0x0,'rows':[]};return db['MailAccount'][_0x83bd('0x65')]({'where':{'id':_0x1cc9c6[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x4553e2,null))['then'](function(_0x265414){if(_0x265414){_0x22a2ae[_0x83bd('0x43')]=_['keys'](db[_0x83bd('0x8c')][_0x83bd('0x40')]);_0x22a2ae[_0x83bd('0x44')]=_[_0x83bd('0x5a')](_0x1cc9c6[_0x83bd('0x44')]);_0x22a2ae[_0x83bd('0x45')]=_['intersection'](_0x22a2ae[_0x83bd('0x43')],_0x22a2ae[_0x83bd('0x44')]);_0x5b5d0e[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0x22a2ae['model'],qs[_0x83bd('0x5b')](_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x5b')]));_0x5b5d0e[_0x83bd('0x46')]=_0x5b5d0e['attributes']['length']?_0x5b5d0e[_0x83bd('0x46')]:_0x22a2ae['model'];if(!_0x1cc9c6['query'][_0x83bd('0x49')]('nolimit')){_0x5b5d0e[_0x83bd('0x4a')]=qs[_0x83bd('0x4a')](_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x4a')]);_0x5b5d0e[_0x83bd('0x2b')]=qs[_0x83bd('0x2b')](_0x1cc9c6[_0x83bd('0x44')]['offset']);}_0x5b5d0e['order']=qs[_0x83bd('0x4c')](_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x4c')]);_0x5b5d0e[_0x83bd('0x4d')]=qs['filters'](_[_0x83bd('0x67')](_0x1cc9c6[_0x83bd('0x44')],_0x22a2ae['filters']));_0x5b5d0e[_0x83bd('0x4d')][_0x83bd('0x62')]=_0x265414['id'];if(_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x4e')]){_0x5b5d0e['where']=_[_0x83bd('0x4f')](_0x5b5d0e['where'],{'$or':_[_0x83bd('0x3f')](_0x5b5d0e[_0x83bd('0x46')],function(_0x56f2e9){var _0x3f19f7={};_0x3f19f7[_0x56f2e9]={'$like':'%'+_0x1cc9c6['query'][_0x83bd('0x4e')]+'%'};return _0x3f19f7;})});}_0x5b5d0e=_['merge']({},_0x5b5d0e,_0x1cc9c6[_0x83bd('0x5c')]);return db[_0x83bd('0x8c')]['count']({'where':_0x5b5d0e[_0x83bd('0x4d')]})[_0x83bd('0x1f')](function(_0x2c6be5){_0x3b166e[_0x83bd('0x2d')]=_0x2c6be5;if(_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x53')]){_0x5b5d0e[_0x83bd('0x54')]=[{'model':db[_0x83bd('0x8f')],'as':'Contact','required':![]},{'model':db[_0x83bd('0x90')],'as':_0x83bd('0x91'),'attributes':[_0x83bd('0x37'),_0x83bd('0x92'),_0x83bd('0x93')],'required':![]},{'model':db[_0x83bd('0x94')],'as':_0x83bd('0x95'),'attributes':['id',_0x83bd('0x37'),_0x83bd('0x96')],'where':_0x1cc9c6['query'][_0x83bd('0x97')]?{'id':_0x1cc9c6[_0x83bd('0x44')][_0x83bd('0x97')]}:undefined,'required':_0x1cc9c6[_0x83bd('0x44')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x83bd('0x68')](_0x5b5d0e);})[_0x83bd('0x1f')](function(_0x3213f7){_0x3b166e['rows']=_0x3213f7;return _0x3b166e;});}})['then'](respondWithFilteredResult(_0x4553e2,_0x5b5d0e))[_0x83bd('0x56')](handleError(_0x4553e2,null));};exports[_0x83bd('0x98')]=function(_0x58d776,_0x48ade5,_0x38a238){return db[_0x83bd('0x52')]['findOne']({'where':{'id':_0x58d776[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x48ade5,null))['then'](function(_0x25c453){if(_0x25c453){return db[_0x83bd('0x99')][_0x83bd('0x9a')](function(_0x919ca8){return db['MailApplication'][_0x83bd('0x33')]({'where':{'MailAccountId':_0x58d776[_0x83bd('0x58')]['id']},'transaction':_0x919ca8})[_0x83bd('0x1f')](function(_0x3c4cb4){var _0x2b294c=_[_0x83bd('0x3f')](_0x58d776['body'],function(_0x17f294){_0x17f294[_0x83bd('0x62')]=_0x58d776['params']['id'];return _0x17f294;});return db[_0x83bd('0x9b')]['bulkCreate'](_0x2b294c,{'transaction':_0x919ca8});});})[_0x83bd('0x1f')](function(){return db['MailApplication'][_0x83bd('0x9c')]({'where':{'MailAccountId':_0x58d776[_0x83bd('0x58')]['id']},'order':'priority'});});}})[_0x83bd('0x1f')](respondWithResult(_0x48ade5,null))[_0x83bd('0x56')](handleError(_0x48ade5,null));};exports['getApplications']=function(_0x4ac0f9,_0x4f6d6d,_0x34fad5){var _0x299c9b={};var _0xd2238a={};var _0xe9fe06;var _0x466928;return db[_0x83bd('0x52')]['findOne']({'where':{'id':_0x4ac0f9[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x4f6d6d,null))['then'](function(_0x2c620a){if(_0x2c620a){_0xe9fe06=_0x2c620a;_0xd2238a['model']=_['keys'](db[_0x83bd('0x9b')]['rawAttributes']);_0xd2238a[_0x83bd('0x44')]=_['keys'](_0x4ac0f9[_0x83bd('0x44')]);_0xd2238a[_0x83bd('0x45')]=_[_0x83bd('0x47')](_0xd2238a[_0x83bd('0x43')],_0xd2238a[_0x83bd('0x44')]);_0x299c9b[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0xd2238a[_0x83bd('0x43')],qs[_0x83bd('0x5b')](_0x4ac0f9[_0x83bd('0x44')][_0x83bd('0x5b')]));_0x299c9b[_0x83bd('0x46')]=_0x299c9b[_0x83bd('0x46')][_0x83bd('0x48')]?_0x299c9b[_0x83bd('0x46')]:_0xd2238a[_0x83bd('0x43')];_0x299c9b['order']=qs[_0x83bd('0x4c')](_0x4ac0f9[_0x83bd('0x44')]['sort']);_0x299c9b[_0x83bd('0x4d')]=qs[_0x83bd('0x45')](_[_0x83bd('0x67')](_0x4ac0f9[_0x83bd('0x44')],_0xd2238a[_0x83bd('0x45')]));if(_0x4ac0f9[_0x83bd('0x44')][_0x83bd('0x4e')]){_0x299c9b[_0x83bd('0x4d')]=_[_0x83bd('0x4f')](_0x299c9b[_0x83bd('0x4d')],{'$or':_[_0x83bd('0x3f')](_0x299c9b[_0x83bd('0x46')],function(_0x3f1caa){var _0xd02177={};_0xd02177[_0x3f1caa]={'$like':'%'+_0x4ac0f9[_0x83bd('0x44')][_0x83bd('0x4e')]+'%'};return _0xd02177;})});}_0x299c9b=_['merge']({},_0x299c9b,_0x4ac0f9[_0x83bd('0x5c')]);return _0xe9fe06[_0x83bd('0x9d')](_0x299c9b);}})[_0x83bd('0x1f')](function(_0x5bacdb){if(_0x5bacdb){_0x466928=_0x5bacdb[_0x83bd('0x48')];if(!_0x4ac0f9[_0x83bd('0x44')]['hasOwnProperty'](_0x83bd('0x66'))){_0x299c9b[_0x83bd('0x4a')]=qs[_0x83bd('0x4a')](_0x4ac0f9['query'][_0x83bd('0x4a')]);_0x299c9b[_0x83bd('0x2b')]=qs['offset'](_0x4ac0f9[_0x83bd('0x44')][_0x83bd('0x2b')]);}return _0xe9fe06[_0x83bd('0x9d')](_0x299c9b);}})[_0x83bd('0x1f')](function(_0x99de32){if(_0x99de32){return _0x99de32?{'count':_0x466928,'rows':_0x99de32}:null;}})[_0x83bd('0x1f')](respondWithResult(_0x4f6d6d,null))[_0x83bd('0x56')](handleError(_0x4f6d6d,null));};exports[_0x83bd('0x9e')]=function(_0x488766,_0x2620df,_0x37285d){var _0x3fc5a5={'raw':!![],'where':{}};var _0x48a88f={};var _0xd0e36d={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x488766['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x2620df,null))[_0x83bd('0x1f')](function(_0x27de37){if(_0x27de37){_0x48a88f[_0x83bd('0x43')]=_[_0x83bd('0x5a')](db['MailMessage']['rawAttributes']);_0x48a88f[_0x83bd('0x44')]=_['keys'](_0x488766[_0x83bd('0x44')]);_0x48a88f[_0x83bd('0x45')]=_[_0x83bd('0x47')](_0x48a88f[_0x83bd('0x43')],_0x48a88f[_0x83bd('0x44')]);_0x3fc5a5['attributes']=_[_0x83bd('0x47')](_0x48a88f['model'],qs['fields'](_0x488766[_0x83bd('0x44')]['fields']));_0x3fc5a5[_0x83bd('0x46')]=_0x3fc5a5['attributes']['length']?_0x3fc5a5[_0x83bd('0x46')]:_0x48a88f[_0x83bd('0x43')];if(!_0x488766[_0x83bd('0x44')][_0x83bd('0x49')]('nolimit')){_0x3fc5a5[_0x83bd('0x4a')]=qs[_0x83bd('0x4a')](_0x488766['query']['limit']);_0x3fc5a5[_0x83bd('0x2b')]=qs[_0x83bd('0x2b')](_0x488766[_0x83bd('0x44')]['offset']);}_0x3fc5a5[_0x83bd('0x4b')]=qs[_0x83bd('0x4c')](_0x488766[_0x83bd('0x44')]['sort']);_0x3fc5a5[_0x83bd('0x4d')]=qs['filters'](_[_0x83bd('0x67')](_0x488766['query'],_0x48a88f[_0x83bd('0x45')]));_0x3fc5a5['where'][_0x83bd('0x62')]=_0x27de37['id'];if(_0x488766[_0x83bd('0x44')][_0x83bd('0x4e')]){_0x3fc5a5[_0x83bd('0x4d')]=_[_0x83bd('0x4f')](_0x3fc5a5['where'],{'$or':_[_0x83bd('0x3f')](_0x3fc5a5[_0x83bd('0x46')],function(_0x2f9c22){var _0x66bc53={};_0x66bc53[_0x2f9c22]={'$like':'%'+_0x488766[_0x83bd('0x44')][_0x83bd('0x4e')]+'%'};return _0x66bc53;})});}if(_0x488766['query'][_0x83bd('0x9f')]){var _0x5048d1=_0x488766['query'][_0x83bd('0x9f')][_0x83bd('0xa0')](',');var _0x3a7db3={};_0x3a7db3[_0x5048d1[0x0]]={'$gte':moment(_0x5048d1[0x1])[_0x83bd('0xa1')](_0x83bd('0xa2'))};_0x3fc5a5['where']=_[_0x83bd('0x4f')](_0x3fc5a5[_0x83bd('0x4d')],_0x3a7db3);}_0x3fc5a5=_['merge']({},_0x3fc5a5,_0x488766[_0x83bd('0x5c')]);return db[_0x83bd('0xa3')][_0x83bd('0x2d')]({'where':_0x3fc5a5['where']})[_0x83bd('0x1f')](function(_0x3aac0c){_0xd0e36d[_0x83bd('0x2d')]=_0x3aac0c;if(_0x488766[_0x83bd('0x44')][_0x83bd('0x53')]){_0x3fc5a5['include']=[{'all':!![]}];}return db[_0x83bd('0xa3')][_0x83bd('0x68')](_0x3fc5a5);})['then'](function(_0x5e5878){if(_0x488766[_0x83bd('0x44')]['inlineCss']===_0x83bd('0xa4')){for(var _0x5a4c08=0x0;_0x5a4c08<_0x5e5878[_0x83bd('0x48')];_0x5a4c08++){_0x5e5878[_0x5a4c08][_0x83bd('0x5f')]=juice(_0x5e5878[_0x5a4c08][_0x83bd('0x5f')]);}}_0xd0e36d['rows']=_0x5e5878;return _0xd0e36d;});}})[_0x83bd('0x1f')](respondWithFilteredResult(_0x2620df,_0x3fc5a5))[_0x83bd('0x56')](handleError(_0x2620df,null));};exports[_0x83bd('0x38')]=function(_0xa400ed,_0x364c11,_0x3c7338){var _0x5a74f6,_0xbcd535={},_0x84f2fc;if(_0xa400ed[_0x83bd('0x5f')]['to']){_0x84f2fc=_0xa400ed[_0x83bd('0x5f')]['to'][_0x83bd('0xa0')](',')[0x0];}return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0xa400ed[_0x83bd('0x58')]['id']},'include':[{'model':db[_0x83bd('0xa5')],'as':_0x83bd('0xa6'),'include':[{'model':db[_0x83bd('0x8f')],'as':'Contacts','where':{'email':_0x84f2fc},'limit':0x1,'order':[[_0x83bd('0xa7'),_0x83bd('0xa8')]]}]},{'model':db[_0x83bd('0x3c')],'as':_0x83bd('0x59'),'raw':!![]}]})[_0x83bd('0x1f')](handleEntityNotFound(_0x364c11,null))[_0x83bd('0x1f')](function(_0x236880){if(_0x236880){_0x5a74f6=_0x236880;if(_0x236880[_0x83bd('0x59')]){if(_[_0x83bd('0x72')](_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xa9')])){_0xa400ed[_0x83bd('0x5f')]['from']=util[_0x83bd('0xa1')](_0x83bd('0xaa'),_0x236880[_0x83bd('0x37')],_0x236880[_0x83bd('0x70')]||_0x236880['Smtp'][_0x83bd('0x76')]);}if(_0xa400ed['body'][_0x83bd('0xab')]&&_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xab')][_0x83bd('0x48')]){for(var _0x47e363=0x0;_0x47e363<_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xab')][_0x83bd('0x48')];_0x47e363+=0x1){_0xa400ed[_0x83bd('0x5f')]['attachments'][_0x47e363]={'filename':_0xa400ed['body'][_0x83bd('0xab')][_0x47e363][_0x83bd('0x37')],'path':path[_0x83bd('0xac')](config[_0x83bd('0xad')],_0x83bd('0xae'),_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xab')][_0x47e363][_0x83bd('0xaf')])};}}var _0x49e808={'tls':{'rejectUnauthorized':![]}};if(_[_0x83bd('0x72')](_0x236880[_0x83bd('0x59')][_0x83bd('0x7c')])){if(_0x236880[_0x83bd('0x59')][_0x83bd('0x79')]){_0x49e808[_0x83bd('0xb0')]={'user':_0x236880[_0x83bd('0x59')][_0x83bd('0x76')],'pass':_0x236880[_0x83bd('0x59')][_0x83bd('0x78')]};}_0x49e808[_0x83bd('0x7a')]=_0x236880[_0x83bd('0x59')][_0x83bd('0x7a')];_0x49e808[_0x83bd('0x7b')]=_0x236880[_0x83bd('0x59')][_0x83bd('0x7b')];_0x49e808[_0x83bd('0xb1')]=_0x236880['Smtp'][_0x83bd('0xb1')];}else{_0x49e808[_0x83bd('0x7c')]=_0x236880[_0x83bd('0x59')][_0x83bd('0x7c')];_0x49e808[_0x83bd('0xb0')]={'user':_0x236880[_0x83bd('0x59')][_0x83bd('0x76')],'pass':_0x236880[_0x83bd('0x59')][_0x83bd('0x78')]};}return respondWithRpcPromise('SendMail',_0x83bd('0xb2'),{'account':_0x49e808,'message':_0xa400ed['body']});}else{throw new Error(_0x83bd('0xb3'));}}})[_0x83bd('0x1f')](function(_0x5829d7){if(_0x5829d7){_0xbcd535=_0x5829d7;if(_0x5a74f6[_0x83bd('0xa6')]){if(_0x5a74f6['List'][_0x83bd('0xb4')][_0x83bd('0x48')]){return _0x5a74f6[_0x83bd('0xa6')][_0x83bd('0xb4')][0x0];}else{return db[_0x83bd('0x8f')]['create'](_['defaults'](_0xa400ed['body'],{'firstName':_0xa400ed[_0x83bd('0x5f')]['to'],'email':_0xa400ed['body']['to'],'phone':_0xa400ed[_0x83bd('0x5f')]['to'],'ListId':_0x5a74f6[_0x83bd('0x71')]}));}}else{throw new Error(_0x83bd('0xb3'));}}})[_0x83bd('0x1f')](function(_0xeddc38){if(_0xeddc38){var _0x541b87={'UserId':_0xa400ed[_0x83bd('0x76')]['id'],'ContactId':_0xeddc38['id'],'MailAccountId':_0x5a74f6['id'],'inReplyTo':_0xbcd535[_0x83bd('0xb5')],'to':_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xa9')],'cc':_0xa400ed[_0x83bd('0x5f')]['cc'],'subject':_0xa400ed['body']['subject'],'attach':_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xb6')],'firstMsgDirection':_0x83bd('0xb7'),'lastMsgAt':moment()['format'](_0x83bd('0xa2')),'lastMsgDirection':_0x83bd('0xb7'),'Messages':[_['merge'](_0xa400ed[_0x83bd('0x5f')],{'messageId':_0xbcd535[_0x83bd('0xb5')],'sentAt':moment()[_0x83bd('0xa1')](_0x83bd('0xa2')),'read':!![],'MailAccountId':_0x5a74f6['id'],'UserId':_0xa400ed[_0x83bd('0x76')]['id'],'ContactId':_0xeddc38['id']})]};if(_0xa400ed[_0x83bd('0x5f')]['Interaction']){_0x541b87=_[_0x83bd('0x4f')](_0x541b87,_0xa400ed[_0x83bd('0x5f')][_0x83bd('0xb8')]);}return db[_0x83bd('0x8c')]['create'](_0x541b87,{'include':[{'model':db[_0x83bd('0xa3')],'as':_0x83bd('0xb9')}]});}})[_0x83bd('0x1f')](respondWithResult(_0x364c11,null))[_0x83bd('0x56')](handleError(_0x364c11,null));};exports[_0x83bd('0xba')]=function(_0x585b61,_0x4e6dbf,_0x9b54f8){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x585b61[_0x83bd('0x58')]['id']},'include':[{'model':db[_0x83bd('0x3c')],'as':_0x83bd('0x59'),'raw':!![]}]})[_0x83bd('0x1f')](handleEntityNotFound(_0x4e6dbf,null))[_0x83bd('0x1f')](function(_0x2c5381){if(_0x2c5381&&_0x2c5381[_0x83bd('0x59')]){var _0xe799e2={'id':_0x2c5381['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2c5381['Smtp'][_0x83bd('0x7c')]){_0xe799e2['service']=_0x2c5381['Smtp'][_0x83bd('0x7c')];}else{_0xe799e2[_0x83bd('0x7a')]=_0x2c5381[_0x83bd('0x59')][_0x83bd('0x7a')];_0xe799e2['port']=_0x2c5381['Smtp'][_0x83bd('0x7b')];_0xe799e2[_0x83bd('0xb1')]=_0x2c5381[_0x83bd('0x59')][_0x83bd('0xb1')];}if(_0x2c5381[_0x83bd('0x59')][_0x83bd('0x79')]){_0xe799e2[_0x83bd('0xb0')]={'user':_0x2c5381[_0x83bd('0x59')][_0x83bd('0x76')],'pass':_0x2c5381['Smtp'][_0x83bd('0x78')]};}return respondWithRpcPromise(_0x83bd('0xbb'),_0x83bd('0xba'),{'account':_0xe799e2});}})[_0x83bd('0x1f')](respondWithResult(_0x4e6dbf,null))[_0x83bd('0x56')](handleError(_0x4e6dbf,null));};exports[_0x83bd('0x33')]=function(_0x30e8ba,_0x3f60c0){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x30e8ba[_0x83bd('0x58')]['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x3f60c0,null))[_0x83bd('0x1f')](function(_0x18ef8f){if(_0x18ef8f&&_0x18ef8f['service']){throw new db[(_0x83bd('0xbc'))][(_0x83bd('0xbd'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x18ef8f;})['then'](removeEntity(_0x3f60c0,null))['catch'](handleError(_0x3f60c0,null));};exports[_0x83bd('0xbe')]=function(_0x179de3,_0x4b9384,_0x2bd512){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0x179de3['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x4b9384,null))[_0x83bd('0x1f')](function(_0x1f3130){if(_0x1f3130){return _0x1f3130[_0x83bd('0xbe')](_0x179de3[_0x83bd('0x5f')][_0x83bd('0x6a')],_['omit'](_0x179de3[_0x83bd('0x5f')],[_0x83bd('0x6a'),'id'])||{})[_0x83bd('0xbf')](function(_0x5951da){for(var _0xf28b78=0x0;_0xf28b78<_0x179de3['body'][_0x83bd('0x6a')]['length'];_0xf28b78+=0x1){socket['emit'](_0x83bd('0xc0'),{'UserId':Number(_0x179de3[_0x83bd('0x5f')][_0x83bd('0x6a')][_0xf28b78]),'MailAccountId':Number(_0x179de3['params']['id'])});}return _0x5951da;});}})['then'](respondWithResult(_0x4b9384,null))['catch'](handleError(_0x4b9384,null));};exports[_0x83bd('0xc1')]=function(_0xc5fc33,_0x16db44,_0x16e4be){return db[_0x83bd('0x52')][_0x83bd('0x5d')]({'where':{'id':_0xc5fc33['params']['id']}})[_0x83bd('0x1f')](handleEntityNotFound(_0x16db44,null))['then'](function(_0x2aabae){if(_0x2aabae){return _0x2aabae[_0x83bd('0xc1')](_0xc5fc33[_0x83bd('0x44')][_0x83bd('0x6a')])[_0x83bd('0x1f')](function(){if(_[_0x83bd('0xc2')](_0xc5fc33[_0x83bd('0x44')][_0x83bd('0x6a')])){for(var _0x45d387=0x0;_0x45d387<_0xc5fc33[_0x83bd('0x44')][_0x83bd('0x6a')][_0x83bd('0x48')];_0x45d387+=0x1){socket[_0x83bd('0xc3')]('userMailAccount:remove',{'UserId':Number(_0xc5fc33['query']['ids'][_0x45d387]),'MailAccountId':Number(_0xc5fc33[_0x83bd('0x58')]['id'])});}}else{socket[_0x83bd('0xc3')](_0x83bd('0xc4'),{'UserId':Number(_0xc5fc33[_0x83bd('0x44')][_0x83bd('0x6a')]),'MailAccountId':Number(_0xc5fc33[_0x83bd('0x58')]['id'])});}});}})[_0x83bd('0x1f')](respondWithStatusCode(_0x16db44,null))[_0x83bd('0x56')](handleError(_0x16db44,null));};exports['getAgents']=function(_0x38e5e4,_0xf99221,_0xdad6c6){var _0x1d2bb3={};var _0x524256={};var _0x16dbbc;var _0x3eda0e;return db[_0x83bd('0x52')][_0x83bd('0x65')]({'where':{'id':_0x38e5e4[_0x83bd('0x58')]['id']}})['then'](handleEntityNotFound(_0xf99221,null))[_0x83bd('0x1f')](function(_0x36f6fb){if(_0x36f6fb){_0x16dbbc=_0x36f6fb;_0x524256[_0x83bd('0x43')]=_['keys'](db[_0x83bd('0x90')][_0x83bd('0x40')]);_0x524256['query']=_[_0x83bd('0x5a')](_0x38e5e4['query']);_0x524256[_0x83bd('0x45')]=_[_0x83bd('0x47')](_0x524256[_0x83bd('0x43')],_0x524256[_0x83bd('0x44')]);_0x1d2bb3[_0x83bd('0x46')]=_[_0x83bd('0x47')](_0x524256[_0x83bd('0x43')],qs[_0x83bd('0x5b')](_0x38e5e4[_0x83bd('0x44')]['fields']));_0x1d2bb3[_0x83bd('0x46')]=_0x1d2bb3[_0x83bd('0x46')][_0x83bd('0x48')]?_0x1d2bb3[_0x83bd('0x46')]:_0x524256[_0x83bd('0x43')];_0x1d2bb3[_0x83bd('0x4b')]=qs[_0x83bd('0x4c')](_0x38e5e4[_0x83bd('0x44')][_0x83bd('0x4c')]);_0x1d2bb3[_0x83bd('0x4d')]=qs[_0x83bd('0x45')](_[_0x83bd('0x67')](_0x38e5e4[_0x83bd('0x44')],_0x524256[_0x83bd('0x45')]));if(_0x38e5e4[_0x83bd('0x44')][_0x83bd('0x4e')]){_0x1d2bb3[_0x83bd('0x4d')]=_['merge'](_0x1d2bb3[_0x83bd('0x4d')],{'$or':_['map'](_0x1d2bb3['attributes'],function(_0x51cf72){var _0x277e64={};_0x277e64[_0x51cf72]={'$like':'%'+_0x38e5e4[_0x83bd('0x44')][_0x83bd('0x4e')]+'%'};return _0x277e64;})});}_0x1d2bb3=_['merge']({},_0x1d2bb3,_0x38e5e4['options']);return _0x16dbbc[_0x83bd('0xc5')](_0x1d2bb3);}})['then'](function(_0x556e3a){if(_0x556e3a){_0x3eda0e=_0x556e3a[_0x83bd('0x48')];if(!_0x38e5e4[_0x83bd('0x44')]['hasOwnProperty'](_0x83bd('0x66'))){_0x1d2bb3['limit']=qs[_0x83bd('0x4a')](_0x38e5e4[_0x83bd('0x44')][_0x83bd('0x4a')]);_0x1d2bb3[_0x83bd('0x2b')]=qs[_0x83bd('0x2b')](_0x38e5e4[_0x83bd('0x44')][_0x83bd('0x2b')]);}return _0x16dbbc[_0x83bd('0xc5')](_0x1d2bb3);}})['then'](function(_0x16e72d){if(_0x16e72d){return _0x16e72d?{'count':_0x3eda0e,'rows':_0x16e72d}:null;}})[_0x83bd('0x1f')](respondWithResult(_0xf99221,null))[_0x83bd('0x56')](handleError(_0xf99221,null));}; \ No newline at end of file +var _0xbfec=['priority','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','true','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','secure','auth','SendMail','sendMail','List','defaults','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','MailAccounts','stack','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','Imap','keys','include','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','key','ListId','active','description','isNil','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','Tag','color','tag','transaction','MailApplication','destroy','bulkCreate'];(function(_0x21645a,_0x20bed3){var _0x3df4fc=function(_0x5d21e1){while(--_0x5d21e1){_0x21645a['push'](_0x21645a['shift']());}};_0x3df4fc(++_0x20bed3);}(_0xbfec,0x1b4));var _0xcbfe=function(_0x24168d,_0x1445a5){_0x24168d=_0x24168d-0x0;var _0x3ba872=_0xbfec[_0x24168d];return _0x3ba872;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbfe('0x0'));var zipdir=require(_0xcbfe('0x1'));var jsonpatch=require(_0xcbfe('0x2'));var rp=require(_0xcbfe('0x3'));var moment=require('moment');var BPromise=require(_0xcbfe('0x4'));var Mustache=require(_0xcbfe('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcbfe('0x6'));var csv=require(_0xcbfe('0x7'));var ejs=require(_0xcbfe('0x8'));var fs=require('fs');var fs_extra=require(_0xcbfe('0x9'));var _=require(_0xcbfe('0xa'));var squel=require(_0xcbfe('0xb'));var crypto=require(_0xcbfe('0xc'));var jsforce=require(_0xcbfe('0xd'));var deskjs=require(_0xcbfe('0xe'));var toCsv=require(_0xcbfe('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0xcbfe('0xf'));var juice=require(_0xcbfe('0x10'));var Redis=require(_0xcbfe('0x11'));var authService=require(_0xcbfe('0x12'));var qs=require(_0xcbfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbfe('0x14'));var logger=require('../../config/logger')(_0xcbfe('0x15'));var utils=require(_0xcbfe('0x16'));var config=require(_0xcbfe('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xcbfe('0x18')]=_['defaults'](config[_0xcbfe('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbfe('0x19'))(new Redis(config['redis']));require(_0xcbfe('0x1a'))['register'](socket);var jayson=require(_0xcbfe('0x1b'));var client=jayson[_0xcbfe('0x1c')][_0xcbfe('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x3828c7,_0x22b1cc,_0x2c7b86,_0x340311){return new BPromise(function(_0x2ebb40,_0x73798a){var _0x4c892f=_0x340311||client;return _0x4c892f[_0xcbfe('0x1e')](_0x3828c7,_0x2c7b86)['then'](function(_0x4ee437){logger[_0xcbfe('0x1f')](_0xcbfe('0x20'),_0x22b1cc,_0xcbfe('0x21'));logger[_0xcbfe('0x22')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x22b1cc,_0xcbfe('0x21'),JSON[_0xcbfe('0x23')](_0x4ee437));if(_0x4ee437[_0xcbfe('0x24')]){if(_0x4ee437['error'][_0xcbfe('0x25')]===0x1f4){logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x4ee437[_0xcbfe('0x24')][_0xcbfe('0x26')]);return _0x73798a(_0x4ee437[_0xcbfe('0x24')]['message']);}logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x4ee437[_0xcbfe('0x24')]['message']);return _0x2ebb40(_0x4ee437[_0xcbfe('0x24')]['message']);}else{logger[_0xcbfe('0x1f')](_0xcbfe('0x20'),_0x22b1cc,_0xcbfe('0x21'));_0x2ebb40(_0x4ee437[_0xcbfe('0x27')][_0xcbfe('0x26')]);}})['catch'](function(_0x331493){logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x331493);_0x73798a(_0x331493);});});}function respondWithStatusCode(_0x311ac5,_0x557482){_0x557482=_0x557482||0xcc;return function(_0x126d15){if(_0x126d15){return _0x311ac5[_0xcbfe('0x28')](_0x557482);}return _0x311ac5['status'](_0x557482)[_0xcbfe('0x29')]();};}function respondWithResult(_0x2b8aa5,_0x508b72){_0x508b72=_0x508b72||0xc8;return function(_0x4d8cc8){if(_0x4d8cc8){return _0x2b8aa5[_0xcbfe('0x2a')](_0x508b72)[_0xcbfe('0x2b')](_0x4d8cc8);}};}function respondWithFilteredResult(_0x49e081,_0x990cf1){return function(_0x3f00c1){if(_0x3f00c1){var _0xbccc73=typeof _0x990cf1[_0xcbfe('0x2c')]===_0xcbfe('0x2d')&&typeof _0x990cf1[_0xcbfe('0x2e')]===_0xcbfe('0x2d');var _0x576f12=_0x3f00c1[_0xcbfe('0x2f')];var _0x5df11a=_0xbccc73?0x0:_0x990cf1['offset'];var _0x26024f=_0xbccc73?_0x3f00c1[_0xcbfe('0x2f')]:_0x990cf1[_0xcbfe('0x2c')]+_0x990cf1[_0xcbfe('0x2e')];var _0x3eac73;if(_0x26024f>=_0x576f12){_0x26024f=_0x576f12;_0x3eac73=0xc8;}else{_0x3eac73=0xce;}_0x49e081[_0xcbfe('0x2a')](_0x3eac73);return _0x49e081[_0xcbfe('0x30')](_0xcbfe('0x31'),_0x5df11a+'-'+_0x26024f+'/'+_0x576f12)['json'](_0x3f00c1);}return null;};}function patchUpdates(_0x24afed){return function(_0x568825){try{jsonpatch[_0xcbfe('0x32')](_0x568825,_0x24afed,!![]);}catch(_0x2bc75a){return BPromise[_0xcbfe('0x33')](_0x2bc75a);}return _0x568825[_0xcbfe('0x34')]();};}function saveUpdates(_0x1cc11e,_0x3dce28){return function(_0xa08dff){if(_0xa08dff){return _0xa08dff[_0xcbfe('0x35')](_0x1cc11e)['then'](function(_0x1cbb94){return _0x1cbb94;});}return null;};}function removeEntity(_0x1ebcdc,_0x43f9ba){return function(_0x59e317){if(_0x59e317){return _0x59e317['destroy']()[_0xcbfe('0x36')](function(){var _0x3c0991=_0x59e317[_0xcbfe('0x37')]({'plain':!![]});var _0xcd9ea5=_0xcbfe('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0xcd9ea5,'resourceId':_0x3c0991['id']}})[_0xcbfe('0x36')](function(){return _0x59e317;});})[_0xcbfe('0x36')](function(){_0x1ebcdc['status'](0xcc)[_0xcbfe('0x29')]();});}};}function handleEntityNotFound(_0x309386,_0x47d618){return function(_0x12b2fc){if(!_0x12b2fc){_0x309386[_0xcbfe('0x28')](0x194);}return _0x12b2fc;};}function handleError(_0x4e5e78,_0x2f0ed4){_0x2f0ed4=_0x2f0ed4||0x1f4;return function(_0x489018){logger[_0xcbfe('0x24')](_0x489018[_0xcbfe('0x39')]);if(_0x489018[_0xcbfe('0x3a')]){delete _0x489018[_0xcbfe('0x3a')];}_0x4e5e78[_0xcbfe('0x2a')](_0x2f0ed4)[_0xcbfe('0x3b')](_0x489018);};}exports[_0xcbfe('0x3c')]=function(_0x154786,_0x592bbc){var _0x5bab0a={'include':[{'model':db[_0xcbfe('0x3d')],'as':'Imap'},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db[_0xcbfe('0x40')],'as':_0xcbfe('0x41')}]},_0x9d3a58={},_0x1773f7={'count':0x0,'rows':[]};var _0x1a5eaf=_[_0xcbfe('0x42')](db[_0xcbfe('0x43')][_0xcbfe('0x44')],function(_0x44b463){return{'name':_0x44b463[_0xcbfe('0x45')],'type':_0x44b463[_0xcbfe('0x46')]['key']};});_0x9d3a58[_0xcbfe('0x47')]=_[_0xcbfe('0x42')](_0x1a5eaf,_0xcbfe('0x3a'));_0x9d3a58[_0xcbfe('0x48')]=_['keys'](_0x154786['query']);_0x9d3a58[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x9d3a58[_0xcbfe('0x47')],_0x9d3a58['query']);_0x5bab0a[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x9d3a58['model'],qs['fields'](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x4c')]));_0x5bab0a[_0xcbfe('0x4b')]=_0x5bab0a[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x5bab0a[_0xcbfe('0x4b')]:_0x9d3a58[_0xcbfe('0x47')];if(!_0x154786[_0xcbfe('0x48')][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x5bab0a[_0xcbfe('0x2e')]=qs['limit'](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x2e')]);_0x5bab0a[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x5bab0a['order']=qs['sort'](_0x154786[_0xcbfe('0x48')]['sort']);_0x5bab0a[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x154786[_0xcbfe('0x48')],_0x9d3a58[_0xcbfe('0x49')]),_0x1a5eaf);if(_0x154786[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x5bab0a['where']=_[_0xcbfe('0x52')](_0x5bab0a['where'],{'$or':_[_0xcbfe('0x42')](_0x1a5eaf,function(_0x444082){if(_0x444082['type']!==_0xcbfe('0x53')){var _0x3b6667={};_0x3b6667[_0x444082[_0xcbfe('0x3a')]]={'$like':'%'+_0x154786['query']['filter']+'%'};return _0x3b6667;}})});}_0x5bab0a=_['merge']({},_0x5bab0a,_0x154786[_0xcbfe('0x54')]);var _0x4ddb01={'where':_0x5bab0a['where']};return db['MailAccount']['count'](_0x4ddb01)[_0xcbfe('0x36')](function(_0x460f19){_0x1773f7[_0xcbfe('0x2f')]=_0x460f19;if(_0x154786[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x5bab0a['include']=[{'all':!![]}];}return db[_0xcbfe('0x43')][_0xcbfe('0x56')](_0x5bab0a);})[_0xcbfe('0x36')](function(_0x404b9b){_0x1773f7[_0xcbfe('0x57')]=_0x404b9b;return _0x1773f7;})[_0xcbfe('0x36')](respondWithFilteredResult(_0x592bbc,_0x5bab0a))[_0xcbfe('0x58')](handleError(_0x592bbc,null));};exports[_0xcbfe('0x59')]=function(_0x4dad71,_0x4508c4){var _0x58cb72={'raw':![],'where':{'id':_0x4dad71[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0x3d')],'as':_0xcbfe('0x5b')},{'model':db[_0xcbfe('0x3e')],'as':'Smtp'},{'model':db[_0xcbfe('0x40')],'as':_0xcbfe('0x41')}]},_0x18f9ae={};_0x18f9ae[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db['MailAccount'][_0xcbfe('0x44')]);_0x18f9ae['query']=_['keys'](_0x4dad71[_0xcbfe('0x48')]);_0x18f9ae[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x18f9ae[_0xcbfe('0x47')],_0x18f9ae[_0xcbfe('0x48')]);_0x58cb72['attributes']=_[_0xcbfe('0x4a')](_0x18f9ae[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4dad71[_0xcbfe('0x48')]['fields']));_0x58cb72[_0xcbfe('0x4b')]=_0x58cb72[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x58cb72['attributes']:_0x18f9ae[_0xcbfe('0x47')];if(_0x4dad71[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x58cb72[_0xcbfe('0x5d')]=[{'all':!![]}];}_0x58cb72=_[_0xcbfe('0x52')]({},_0x58cb72,_0x4dad71['options']);return db[_0xcbfe('0x43')][_0xcbfe('0x5e')](_0x58cb72)[_0xcbfe('0x36')](handleEntityNotFound(_0x4508c4,null))[_0xcbfe('0x36')](respondWithResult(_0x4508c4,null))[_0xcbfe('0x58')](handleError(_0x4508c4,null));};exports['update']=function(_0x4b218f,_0x3185c4){if(_0x4b218f[_0xcbfe('0x5f')]['id']){delete _0x4b218f[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x4b218f['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xcbfe('0x5b')},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db['Pause'],'as':_0xcbfe('0x41')}]})[_0xcbfe('0x36')](handleEntityNotFound(_0x3185c4,null))[_0xcbfe('0x36')](saveUpdates(_0x4b218f[_0xcbfe('0x5f')],null))[_0xcbfe('0x36')](function(_0x345138){if(_0x345138&&_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x5b')]){return db['MailServerIn'][_0xcbfe('0x35')](_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x5b')],{'where':{'MailAccountId':_0x345138['id']}})[_0xcbfe('0x36')](function(){return _0x345138;});}return _0x345138;})[_0xcbfe('0x36')](function(_0x513574){if(_0x513574&&_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x3f')]){return db[_0xcbfe('0x3e')][_0xcbfe('0x35')](_0x4b218f[_0xcbfe('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x513574['id']}})[_0xcbfe('0x36')](function(){return _0x513574;});}return _0x513574;})[_0xcbfe('0x36')](respondWithResult(_0x3185c4,null))[_0xcbfe('0x58')](handleError(_0x3185c4,null));};exports[_0xcbfe('0x60')]=function(_0x15368b,_0x416510){return db[_0xcbfe('0x43')]['describe']()['then'](respondWithResult(_0x416510,null))[_0xcbfe('0x58')](handleError(_0x416510,null));};exports[_0xcbfe('0x61')]=function(_0xe6bba0,_0x29fc64,_0x3c3b54){if(_0xe6bba0[_0xcbfe('0x5f')]['id']){delete _0xe6bba0['body']['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0xe6bba0[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x29fc64,null))[_0xcbfe('0x36')](function(_0x2deccf){if(_0x2deccf){_0xe6bba0[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x2deccf['id'];return db[_0xcbfe('0x63')][_0xcbfe('0x64')](_0xe6bba0[_0xcbfe('0x5f')]);}})[_0xcbfe('0x36')](respondWithResult(_0x29fc64,null))[_0xcbfe('0x58')](handleError(_0x29fc64,null));};exports[_0xcbfe('0x65')]=function(_0x101532,_0x4e911b,_0x41f2ee){var _0x3bc9c9={'raw':![],'where':{}};var _0x44c911={};var _0x549ee9={'count':0x0,'rows':[]};return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x101532['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x4e911b,null))[_0xcbfe('0x36')](function(_0x7fb3a2){if(_0x7fb3a2){_0x44c911[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db['Disposition'][_0xcbfe('0x44')]);_0x44c911[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x101532['query']);_0x44c911[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x44c911[_0xcbfe('0x47')],_0x44c911['query']);_0x3bc9c9[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x44c911[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x4c')]));_0x3bc9c9['attributes']=_0x3bc9c9[_0xcbfe('0x4b')]['length']?_0x3bc9c9['attributes']:_0x44c911[_0xcbfe('0x47')];if(!_0x101532[_0xcbfe('0x48')][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x3bc9c9[_0xcbfe('0x2e')]=qs['limit'](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x2e')]);_0x3bc9c9[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x3bc9c9[_0xcbfe('0x67')]=qs['sort'](_0x101532[_0xcbfe('0x48')]['sort']);_0x3bc9c9[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x101532[_0xcbfe('0x48')],_0x44c911[_0xcbfe('0x49')]));_0x3bc9c9[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x7fb3a2['id'];if(_0x101532[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x3bc9c9['where']=_[_0xcbfe('0x52')](_0x3bc9c9['where'],{'$or':_[_0xcbfe('0x42')](_0x3bc9c9[_0xcbfe('0x4b')],function(_0x37feb0){var _0x812327={};_0x812327[_0x37feb0]={'$like':'%'+_0x101532[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x812327;})});}_0x3bc9c9=_[_0xcbfe('0x52')]({},_0x3bc9c9,_0x101532[_0xcbfe('0x54')]);return db[_0xcbfe('0x63')][_0xcbfe('0x2f')]({'where':_0x3bc9c9[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x2a3411){_0x549ee9['count']=_0x2a3411;if(_0x101532[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x3bc9c9['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3bc9c9);})['then'](function(_0x16ccc0){_0x549ee9[_0xcbfe('0x57')]=_0x16ccc0;return _0x549ee9;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0x4e911b,_0x3bc9c9))[_0xcbfe('0x58')](handleError(_0x4e911b,null));};exports['removeDispositions']=function(_0x25731b,_0x4715df,_0x9f384){return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x25731b[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4715df,null))[_0xcbfe('0x36')](function(_0x31ddce){if(_0x31ddce){return _0x31ddce[_0xcbfe('0x69')](_0x25731b['query'][_0xcbfe('0x6a')]);}})['then'](respondWithStatusCode(_0x4715df,null))[_0xcbfe('0x58')](handleError(_0x4715df,null));};exports[_0xcbfe('0x6b')]=function(_0x89a7b1,_0x5014ec,_0x4cb557){if(_0x89a7b1[_0xcbfe('0x5f')]['id']){delete _0x89a7b1[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x89a7b1[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x5014ec,null))[_0xcbfe('0x36')](function(_0x1fd1ed){if(_0x1fd1ed){_0x89a7b1[_0xcbfe('0x5f')]['MailAccountId']=_0x1fd1ed['id'];return db[_0xcbfe('0x6c')][_0xcbfe('0x64')](_0x89a7b1['body']);}})['then'](respondWithResult(_0x5014ec,null))[_0xcbfe('0x58')](handleError(_0x5014ec,null));};exports[_0xcbfe('0x6d')]=function(_0x4efb23,_0xd2fc7b,_0x29c39b){var _0x3bb117={'raw':![],'where':{}};var _0xf7514d={};var _0x13468a={'count':0x0,'rows':[]};return db[_0xcbfe('0x43')]['findOne']({'where':{'id':_0x4efb23['params']['id']}})['then'](handleEntityNotFound(_0xd2fc7b,null))[_0xcbfe('0x36')](function(_0x4724df){if(_0x4724df){_0xf7514d['model']=_['keys'](db[_0xcbfe('0x6c')][_0xcbfe('0x44')]);_0xf7514d['query']=_[_0xcbfe('0x5c')](_0x4efb23[_0xcbfe('0x48')]);_0xf7514d['filters']=_[_0xcbfe('0x4a')](_0xf7514d['model'],_0xf7514d[_0xcbfe('0x48')]);_0x3bb117[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0xf7514d[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4efb23[_0xcbfe('0x48')]['fields']));_0x3bb117[_0xcbfe('0x4b')]=_0x3bb117['attributes'][_0xcbfe('0x4d')]?_0x3bb117[_0xcbfe('0x4b')]:_0xf7514d[_0xcbfe('0x47')];if(!_0x4efb23['query'][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x3bb117[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x4efb23['query'][_0xcbfe('0x2e')]);_0x3bb117[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x3bb117[_0xcbfe('0x67')]=qs['sort'](_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0x3bb117[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x4efb23[_0xcbfe('0x48')],_0xf7514d[_0xcbfe('0x49')]));_0x3bb117[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x4724df['id'];if(_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x3bb117[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x3bb117[_0xcbfe('0x50')],{'$or':_['map'](_0x3bb117[_0xcbfe('0x4b')],function(_0xdbcd38){var _0x523a68={};_0x523a68[_0xdbcd38]={'$like':'%'+_0x4efb23['query']['filter']+'%'};return _0x523a68;})});}_0x3bb117=_[_0xcbfe('0x52')]({},_0x3bb117,_0x4efb23[_0xcbfe('0x54')]);return db['CannedAnswer'][_0xcbfe('0x2f')]({'where':_0x3bb117[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x44ff53){_0x13468a[_0xcbfe('0x2f')]=_0x44ff53;if(_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x3bb117[_0xcbfe('0x5d')]=[{'all':!![]}];}return db[_0xcbfe('0x6c')][_0xcbfe('0x56')](_0x3bb117);})[_0xcbfe('0x36')](function(_0x30b461){_0x13468a[_0xcbfe('0x57')]=_0x30b461;return _0x13468a;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0xd2fc7b,_0x3bb117))[_0xcbfe('0x58')](handleError(_0xd2fc7b,null));};exports[_0xcbfe('0x6f')]=function(_0x8c8642,_0x151bb3,_0x47e7fe){return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x8c8642[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x151bb3,null))[_0xcbfe('0x36')](function(_0x5a1beb){if(_0x5a1beb){return _0x5a1beb[_0xcbfe('0x6f')](_0x8c8642[_0xcbfe('0x48')][_0xcbfe('0x6a')]);}})['then'](respondWithStatusCode(_0x151bb3,null))[_0xcbfe('0x58')](handleError(_0x151bb3,null));};exports[_0xcbfe('0x64')]=function(_0x29ca55,_0x1158e1){var _0x5761de={'name':_0x29ca55[_0xcbfe('0x5f')]['name'],'key':_0x29ca55['body'][_0xcbfe('0x70')],'email':_0x29ca55['body']['email'],'ListId':_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x71')],'active':!_['isNil'](_0x29ca55['body'][_0xcbfe('0x72')])?_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x72')]:!![],'description':_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xcbfe('0x74')](_0x29ca55['body'][_0xcbfe('0x75')])){if(_0x29ca55[_0xcbfe('0x5f')]['cauthentication']){_0x5761de['Imap'][_0xcbfe('0x76')]=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x76')]=_0x29ca55['body'][_0xcbfe('0x77')];_0x5761de['Imap'][_0xcbfe('0x78')]=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x79')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x7a')];}else{_0x5761de[_0xcbfe('0x5b')]['authentication']=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x7b')]=![];}_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7c')]=_0x29ca55[_0xcbfe('0x5f')]['Imap']['host'];_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7d')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x5b')]['port'];_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x7c')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x5761de['Smtp'][_0xcbfe('0x7d')]=_0x29ca55['body']['Smtp']['port'];}else{_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7e')]=_0x5761de['Smtp'][_0xcbfe('0x7e')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x75')];_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x76')]=_0x5761de['Smtp'][_0xcbfe('0x76')]=_0x29ca55['body']['cuser'];_0x5761de[_0xcbfe('0x5b')]['password']=_0x5761de[_0xcbfe('0x3f')]['pass']=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x7a')];}return db['MailAccount'][_0xcbfe('0x64')](_0x5761de,{'include':[{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db['MailServerIn'],'as':'Imap'}]})['then'](function(_0x4c071a){var _0x3641eb=_0x29ca55[_0xcbfe('0x76')][_0xcbfe('0x37')]({'plain':!![]});if(!_0x3641eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3641eb[_0xcbfe('0x7f')]===_0xcbfe('0x76')){var _0x46d82c=_0x4c071a[_0xcbfe('0x37')]({'plain':!![]});return db[_0xcbfe('0x80')][_0xcbfe('0x5e')]({'where':{'name':_0xcbfe('0x38'),'userProfileId':_0x3641eb[_0xcbfe('0x81')]},'raw':!![]})[_0xcbfe('0x36')](function(_0x5f4227){if(_0x5f4227&&_0x5f4227[_0xcbfe('0x82')]===0x0){return db[_0xcbfe('0x83')][_0xcbfe('0x64')]({'name':_0x46d82c[_0xcbfe('0x3a')],'resourceId':_0x46d82c['id'],'type':_0x5f4227[_0xcbfe('0x3a')],'sectionId':_0x5f4227['id']},{})[_0xcbfe('0x36')](function(){return _0x4c071a;});}else{return _0x4c071a;}})[_0xcbfe('0x58')](function(_0x10cfc5){logger[_0xcbfe('0x24')](_0xcbfe('0x84'),_0x10cfc5);throw _0x10cfc5;});}return _0x4c071a;})[_0xcbfe('0x36')](respondWithResult(_0x1158e1,0xc9))[_0xcbfe('0x58')](handleError(_0x1158e1,null));};exports[_0xcbfe('0x85')]=function(_0x5992f5,_0x585dc0,_0x34ae7c){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x5992f5['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x585dc0,null))['then'](function(_0x188cfb){if(_0x188cfb){return _0x188cfb['getImap']();}return null;})[_0xcbfe('0x36')](respondWithResult(_0x585dc0,null))[_0xcbfe('0x58')](handleError(_0x585dc0,null));};exports[_0xcbfe('0x86')]=function(_0x417700,_0x5f5dd7,_0x4c2ef1){if(_0x417700[_0xcbfe('0x5f')]['id']){delete _0x417700[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x417700[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x5f5dd7,null))[_0xcbfe('0x36')](function(_0x13eeea){if(_0x13eeea){_0x417700[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x13eeea['id'];return db[_0xcbfe('0x3d')][_0xcbfe('0x64')](_0x417700[_0xcbfe('0x5f')]);}})[_0xcbfe('0x36')](respondWithResult(_0x5f5dd7,null))[_0xcbfe('0x58')](handleError(_0x5f5dd7,null));};exports[_0xcbfe('0x87')]=function(_0x2886d1,_0x58ec33,_0x44d54e){return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x2886d1[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x58ec33,null))['then'](function(_0x560e4b){if(_0x560e4b){return _0x560e4b[_0xcbfe('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x58ec33,null))[_0xcbfe('0x58')](handleError(_0x58ec33,null));};exports[_0xcbfe('0x89')]=function(_0x47dc32,_0xc9d277,_0x171265){return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x47dc32[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0xc9d277,null))[_0xcbfe('0x36')](function(_0x3f4480){if(_0x3f4480){return _0x3f4480[_0xcbfe('0x89')]();}return null;})[_0xcbfe('0x36')](respondWithResult(_0xc9d277,null))['catch'](handleError(_0xc9d277,null));};exports['addSmtp']=function(_0x178ccf,_0xe385a7,_0x5f310a){if(_0x178ccf[_0xcbfe('0x5f')]['id']){delete _0x178ccf[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x178ccf[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe385a7,null))[_0xcbfe('0x36')](function(_0x396ed2){if(_0x396ed2){_0x178ccf[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x396ed2['id'];return db[_0xcbfe('0x3e')][_0xcbfe('0x64')](_0x178ccf['body']);}})['then'](respondWithResult(_0xe385a7,null))[_0xcbfe('0x58')](handleError(_0xe385a7,null));};exports['removeSmtp']=function(_0x11f1ed,_0x41d507,_0x52b82b){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x11f1ed['params']['id']}})['then'](handleEntityNotFound(_0x41d507,null))[_0xcbfe('0x36')](function(_0x3e25e9){if(_0x3e25e9){return _0x3e25e9['setSmtp'](null);}return null;})[_0xcbfe('0x36')](respondWithStatusCode(_0x41d507,null))[_0xcbfe('0x58')](handleError(_0x41d507,null));};exports[_0xcbfe('0x8a')]=function(_0x2361cc,_0x1a015c,_0x20320f){return db[_0xcbfe('0x8b')]['find']({'where':{'id':_0x2361cc[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x1a015c,null))[_0xcbfe('0x36')](function(_0x932294){if(_0x932294){return _0x932294[_0xcbfe('0x8a')](_0x2361cc[_0xcbfe('0x5f')][_0xcbfe('0x6a')],_[_0xcbfe('0x8c')](_0x2361cc['body'],[_0xcbfe('0x6a'),'id'])||{});}})[_0xcbfe('0x36')](respondWithResult(_0x1a015c,null))[_0xcbfe('0x58')](handleError(_0x1a015c,null));};exports[_0xcbfe('0x8d')]=function(_0x34b4d7,_0x54b31c,_0x5b894a){var _0x32e26e={'raw':![],'where':{}};var _0x3c1c1c={};var _0x4ca823={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x34b4d7[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x54b31c,null))['then'](function(_0x6176e2){if(_0x6176e2){_0x3c1c1c[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db[_0xcbfe('0x8b')]['rawAttributes']);_0x3c1c1c[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x34b4d7['query']);_0x3c1c1c[_0xcbfe('0x49')]=_['intersection'](_0x3c1c1c['model'],_0x3c1c1c[_0xcbfe('0x48')]);_0x32e26e[_0xcbfe('0x4b')]=_['intersection'](_0x3c1c1c[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x34b4d7['query'][_0xcbfe('0x4c')]));_0x32e26e[_0xcbfe('0x4b')]=_0x32e26e[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x32e26e[_0xcbfe('0x4b')]:_0x3c1c1c[_0xcbfe('0x47')];if(!_0x34b4d7[_0xcbfe('0x48')]['hasOwnProperty'](_0xcbfe('0x4f'))){_0x32e26e[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x34b4d7[_0xcbfe('0x48')]['limit']);_0x32e26e[_0xcbfe('0x2c')]=qs['offset'](_0x34b4d7['query'][_0xcbfe('0x2c')]);}_0x32e26e['order']=qs[_0xcbfe('0x6e')](_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0x32e26e[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x34b4d7[_0xcbfe('0x48')],_0x3c1c1c[_0xcbfe('0x49')]));_0x32e26e[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x6176e2['id'];if(_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x32e26e[_0xcbfe('0x50')]=_['merge'](_0x32e26e[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0x32e26e['attributes'],function(_0x4b7352){var _0x51beec={};_0x51beec[_0x4b7352]={'$like':'%'+_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x51beec;})});}_0x32e26e=_[_0xcbfe('0x52')]({},_0x32e26e,_0x34b4d7['options']);return db[_0xcbfe('0x8b')][_0xcbfe('0x2f')]({'where':_0x32e26e[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x245cea){_0x4ca823[_0xcbfe('0x2f')]=_0x245cea;if(_0x34b4d7[_0xcbfe('0x48')]['includeAll']){_0x32e26e[_0xcbfe('0x5d')]=[{'model':db[_0xcbfe('0x8e')],'as':_0xcbfe('0x8f'),'required':![]},{'model':db['User'],'as':_0xcbfe('0x90'),'attributes':[_0xcbfe('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xcbfe('0x91')],'as':'Tags','attributes':['id','name',_0xcbfe('0x92')],'where':_0x34b4d7[_0xcbfe('0x48')]['tag']?{'id':_0x34b4d7['query'][_0xcbfe('0x93')]}:undefined,'required':_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x93')]?!![]:![]}];}return db[_0xcbfe('0x8b')][_0xcbfe('0x56')](_0x32e26e);})[_0xcbfe('0x36')](function(_0x2f8cc9){_0x4ca823[_0xcbfe('0x57')]=_0x2f8cc9;return _0x4ca823;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0x54b31c,_0x32e26e))['catch'](handleError(_0x54b31c,null));};exports['addApplications']=function(_0x547010,_0x43ae83,_0x546fd1){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x547010[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x43ae83,null))[_0xcbfe('0x36')](function(_0x41c499){if(_0x41c499){return db['sequelize'][_0xcbfe('0x94')](function(_0x503a7e){return db[_0xcbfe('0x95')][_0xcbfe('0x96')]({'where':{'MailAccountId':_0x547010['params']['id']},'transaction':_0x503a7e})[_0xcbfe('0x36')](function(_0x595f1c){var _0x16713e=_[_0xcbfe('0x42')](_0x547010[_0xcbfe('0x5f')],function(_0x491fd2){_0x491fd2[_0xcbfe('0x62')]=_0x547010[_0xcbfe('0x5a')]['id'];return _0x491fd2;});return db[_0xcbfe('0x95')][_0xcbfe('0x97')](_0x16713e,{'transaction':_0x503a7e});});})[_0xcbfe('0x36')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x547010['params']['id']},'order':_0xcbfe('0x98')});});}})['then'](respondWithResult(_0x43ae83,null))['catch'](handleError(_0x43ae83,null));};exports[_0xcbfe('0x99')]=function(_0x4b03e2,_0x23f08f,_0x37e5bb){var _0xf0cd77={};var _0x88b56e={};var _0x5ad7e6;var _0x88768b;return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x4b03e2[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x23f08f,null))[_0xcbfe('0x36')](function(_0x2e45d0){if(_0x2e45d0){_0x5ad7e6=_0x2e45d0;_0x88b56e['model']=_[_0xcbfe('0x5c')](db[_0xcbfe('0x95')]['rawAttributes']);_0x88b56e[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x4b03e2['query']);_0x88b56e[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x88b56e[_0xcbfe('0x47')],_0x88b56e[_0xcbfe('0x48')]);_0xf0cd77[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x88b56e[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4b03e2[_0xcbfe('0x48')]['fields']));_0xf0cd77[_0xcbfe('0x4b')]=_0xf0cd77[_0xcbfe('0x4b')]['length']?_0xf0cd77[_0xcbfe('0x4b')]:_0x88b56e[_0xcbfe('0x47')];_0xf0cd77[_0xcbfe('0x67')]=qs[_0xcbfe('0x6e')](_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0xf0cd77[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x4b03e2[_0xcbfe('0x48')],_0x88b56e[_0xcbfe('0x49')]));if(_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0xf0cd77[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0xf0cd77[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0xf0cd77[_0xcbfe('0x4b')],function(_0x1ece42){var _0x42093c={};_0x42093c[_0x1ece42]={'$like':'%'+_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x42093c;})});}_0xf0cd77=_['merge']({},_0xf0cd77,_0x4b03e2['options']);return _0x5ad7e6[_0xcbfe('0x99')](_0xf0cd77);}})[_0xcbfe('0x36')](function(_0x41281c){if(_0x41281c){_0x88768b=_0x41281c[_0xcbfe('0x4d')];if(!_0x4b03e2['query'][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0xf0cd77[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x4b03e2['query'][_0xcbfe('0x2e')]);_0xf0cd77[_0xcbfe('0x2c')]=qs['offset'](_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}return _0x5ad7e6[_0xcbfe('0x99')](_0xf0cd77);}})[_0xcbfe('0x36')](function(_0x24aaa5){if(_0x24aaa5){return _0x24aaa5?{'count':_0x88768b,'rows':_0x24aaa5}:null;}})[_0xcbfe('0x36')](respondWithResult(_0x23f08f,null))[_0xcbfe('0x58')](handleError(_0x23f08f,null));};exports[_0xcbfe('0x9a')]=function(_0x2de4a4,_0xacbce5,_0x58387f){var _0x2a6ef4={'raw':!![],'where':{}};var _0x163949={};var _0x4ab0da={'count':0x0,'rows':[]};return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x2de4a4[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0xacbce5,null))['then'](function(_0x50c227){if(_0x50c227){_0x163949[_0xcbfe('0x47')]=_['keys'](db[_0xcbfe('0x9b')][_0xcbfe('0x44')]);_0x163949[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x2de4a4['query']);_0x163949[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x163949['model'],_0x163949['query']);_0x2a6ef4[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x163949[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x2de4a4['query']['fields']));_0x2a6ef4[_0xcbfe('0x4b')]=_0x2a6ef4['attributes'][_0xcbfe('0x4d')]?_0x2a6ef4['attributes']:_0x163949[_0xcbfe('0x47')];if(!_0x2de4a4['query']['hasOwnProperty'](_0xcbfe('0x4f'))){_0x2a6ef4['limit']=qs[_0xcbfe('0x2e')](_0x2de4a4[_0xcbfe('0x48')]['limit']);_0x2a6ef4[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x2de4a4['query'][_0xcbfe('0x2c')]);}_0x2a6ef4[_0xcbfe('0x67')]=qs['sort'](_0x2de4a4['query'][_0xcbfe('0x6e')]);_0x2a6ef4[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x2de4a4[_0xcbfe('0x48')],_0x163949[_0xcbfe('0x49')]));_0x2a6ef4[_0xcbfe('0x50')]['MailAccountId']=_0x50c227['id'];if(_0x2de4a4['query']['filter']){_0x2a6ef4[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x2a6ef4[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0x2a6ef4[_0xcbfe('0x4b')],function(_0x741981){var _0x505a97={};_0x505a97[_0x741981]={'$like':'%'+_0x2de4a4[_0xcbfe('0x48')]['filter']+'%'};return _0x505a97;})});}if(_0x2de4a4['query'][_0xcbfe('0x9c')]){var _0x5866a3=_0x2de4a4[_0xcbfe('0x48')][_0xcbfe('0x9c')][_0xcbfe('0x9d')](',');var _0x2ce547={};_0x2ce547[_0x5866a3[0x0]]={'$gte':moment(_0x5866a3[0x1])[_0xcbfe('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2a6ef4['where']=_[_0xcbfe('0x52')](_0x2a6ef4[_0xcbfe('0x50')],_0x2ce547);}_0x2a6ef4=_[_0xcbfe('0x52')]({},_0x2a6ef4,_0x2de4a4[_0xcbfe('0x54')]);return db[_0xcbfe('0x9b')][_0xcbfe('0x2f')]({'where':_0x2a6ef4[_0xcbfe('0x50')]})['then'](function(_0x5b8f32){_0x4ab0da[_0xcbfe('0x2f')]=_0x5b8f32;if(_0x2de4a4[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x2a6ef4['include']=[{'all':!![]}];}return db[_0xcbfe('0x9b')][_0xcbfe('0x56')](_0x2a6ef4);})['then'](function(_0x346578){if(_0x2de4a4['query'][_0xcbfe('0x9f')]===_0xcbfe('0xa0')){for(var _0x12a9ad=0x0;_0x12a9ad<_0x346578['length'];_0x12a9ad++){_0x346578[_0x12a9ad][_0xcbfe('0x5f')]=juice(_0x346578[_0x12a9ad]['body']);}}_0x4ab0da[_0xcbfe('0x57')]=_0x346578;return _0x4ab0da;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0xacbce5,_0x2a6ef4))[_0xcbfe('0x58')](handleError(_0xacbce5,null));};exports['send']=function(_0x5282d4,_0x3891af,_0x303a1f){var _0x38cce6,_0x1c3bb5={},_0x544eac;if(_0x5282d4[_0xcbfe('0x5f')]['to']){_0x544eac=_0x5282d4[_0xcbfe('0x5f')]['to'][_0xcbfe('0x9d')](',')[0x0];}return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x5282d4[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0xa1')],'as':'List','include':[{'model':db[_0xcbfe('0x8e')],'as':_0xcbfe('0xa2'),'where':{'email':_0x544eac},'limit':0x1,'order':[[_0xcbfe('0xa3'),_0xcbfe('0xa4')]]}]},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f'),'raw':!![]}]})[_0xcbfe('0x36')](handleEntityNotFound(_0x3891af,null))['then'](function(_0x3d5739){if(_0x3d5739){_0x38cce6=_0x3d5739;if(_0x3d5739[_0xcbfe('0x3f')]){if(_[_0xcbfe('0x74')](_0x5282d4['body'][_0xcbfe('0xa5')])){_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa5')]=util[_0xcbfe('0x9e')](_0xcbfe('0xa6'),_0x3d5739[_0xcbfe('0x3a')],_0x3d5739[_0xcbfe('0xa7')]||_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x76')]);}if(_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')]&&_0x5282d4[_0xcbfe('0x5f')]['attachments']['length']){for(var _0x399822=0x0;_0x399822<_0x5282d4['body'][_0xcbfe('0xa8')][_0xcbfe('0x4d')];_0x399822+=0x1){_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')][_0x399822]={'filename':_0x5282d4['body'][_0xcbfe('0xa8')][_0x399822]['name'],'path':path[_0xcbfe('0xa9')](config[_0xcbfe('0xaa')],'server/files/attachments',_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')][_0x399822]['basename'])};}}var _0x4a6fa3={'tls':{'rejectUnauthorized':![]}};if(_[_0xcbfe('0x74')](_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x7e')])){if(_0x3d5739['Smtp'][_0xcbfe('0x7b')]){_0x4a6fa3['auth']={'user':_0x3d5739['Smtp']['user'],'pass':_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x79')]};}_0x4a6fa3[_0xcbfe('0x7c')]=_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x4a6fa3[_0xcbfe('0x7d')]=_0x3d5739['Smtp'][_0xcbfe('0x7d')];_0x4a6fa3[_0xcbfe('0xab')]=_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0xab')];}else{_0x4a6fa3[_0xcbfe('0x7e')]=_0x3d5739['Smtp']['service'];_0x4a6fa3[_0xcbfe('0xac')]={'user':_0x3d5739[_0xcbfe('0x3f')]['user'],'pass':_0x3d5739['Smtp']['pass']};}return respondWithRpcPromise(_0xcbfe('0xad'),_0xcbfe('0xae'),{'account':_0x4a6fa3,'message':_0x5282d4[_0xcbfe('0x5f')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x544753){if(_0x544753){_0x1c3bb5=_0x544753;if(_0x38cce6[_0xcbfe('0xaf')]){if(_0x38cce6[_0xcbfe('0xaf')]['Contacts'][_0xcbfe('0x4d')]){return _0x38cce6[_0xcbfe('0xaf')][_0xcbfe('0xa2')][0x0];}else{return db[_0xcbfe('0x8e')][_0xcbfe('0x64')](_[_0xcbfe('0xb0')](_0x5282d4['body'],{'firstName':_0x5282d4[_0xcbfe('0x5f')]['to'],'email':_0x5282d4[_0xcbfe('0x5f')]['to'],'phone':_0x5282d4[_0xcbfe('0x5f')]['to'],'ListId':_0x38cce6[_0xcbfe('0x71')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xcbfe('0x36')](function(_0x81d360){if(_0x81d360){var _0x38bb0d={'UserId':_0x5282d4[_0xcbfe('0x76')]['id'],'ContactId':_0x81d360['id'],'MailAccountId':_0x38cce6['id'],'inReplyTo':_0x1c3bb5[_0xcbfe('0xb1')],'to':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa5')],'cc':_0x5282d4[_0xcbfe('0x5f')]['cc'],'subject':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb2')],'attach':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xcbfe('0xb4')),'lastMsgDirection':_0xcbfe('0xb5'),'Messages':[_[_0xcbfe('0x52')](_0x5282d4['body'],{'messageId':_0x1c3bb5[_0xcbfe('0xb1')],'sentAt':moment()[_0xcbfe('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x38cce6['id'],'UserId':_0x5282d4[_0xcbfe('0x76')]['id'],'ContactId':_0x81d360['id']})]};if(_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb6')]){_0x38bb0d=_['merge'](_0x38bb0d,_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb6')]);}return db[_0xcbfe('0x8b')][_0xcbfe('0x64')](_0x38bb0d,{'include':[{'model':db[_0xcbfe('0x9b')],'as':_0xcbfe('0xb7')}]});}})[_0xcbfe('0x36')](respondWithResult(_0x3891af,null))['catch'](handleError(_0x3891af,null));};exports['verifySmtp']=function(_0x1cf5ee,_0x58f589,_0x3c2140){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x1cf5ee[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x58f589,null))[_0xcbfe('0x36')](function(_0x5c6368){if(_0x5c6368&&_0x5c6368[_0xcbfe('0x3f')]){var _0x4413d4={'id':_0x5c6368['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7e')]){_0x4413d4[_0xcbfe('0x7e')]=_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7e')];}else{_0x4413d4[_0xcbfe('0x7c')]=_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x4413d4[_0xcbfe('0x7d')]=_0x5c6368['Smtp'][_0xcbfe('0x7d')];_0x4413d4[_0xcbfe('0xab')]=_0x5c6368['Smtp']['secure'];}if(_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7b')]){_0x4413d4[_0xcbfe('0xac')]={'user':_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x76')],'pass':_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xcbfe('0xb8'),{'account':_0x4413d4});}})[_0xcbfe('0x36')](respondWithResult(_0x58f589,null))[_0xcbfe('0x58')](handleError(_0x58f589,null));};exports[_0xcbfe('0x96')]=function(_0x3880c1,_0x589e6d){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x3880c1['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x589e6d,null))['then'](function(_0x45d513){if(_0x45d513&&_0x45d513[_0xcbfe('0x7e')]){throw new db[(_0xcbfe('0xb9'))][(_0xcbfe('0xba'))](_0xcbfe('0xbb'));}return _0x45d513;})[_0xcbfe('0x36')](removeEntity(_0x589e6d,null))['catch'](handleError(_0x589e6d,null));};exports[_0xcbfe('0xbc')]=function(_0x3d374c,_0x463b5c,_0x350315){return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x3d374c['params']['id']}})['then'](handleEntityNotFound(_0x463b5c,null))['then'](function(_0x3423ef){if(_0x3423ef){return _0x3423ef[_0xcbfe('0xbc')](_0x3d374c[_0xcbfe('0x5f')][_0xcbfe('0x6a')],_[_0xcbfe('0x8c')](_0x3d374c[_0xcbfe('0x5f')],[_0xcbfe('0x6a'),'id'])||{})[_0xcbfe('0xbd')](function(_0x39e8b4){for(var _0x34b0a5=0x0;_0x34b0a5<_0x3d374c[_0xcbfe('0x5f')][_0xcbfe('0x6a')][_0xcbfe('0x4d')];_0x34b0a5+=0x1){socket[_0xcbfe('0xbe')](_0xcbfe('0xbf'),{'UserId':Number(_0x3d374c['body']['ids'][_0x34b0a5]),'MailAccountId':Number(_0x3d374c[_0xcbfe('0x5a')]['id'])});}return _0x39e8b4;});}})[_0xcbfe('0x36')](respondWithResult(_0x463b5c,null))[_0xcbfe('0x58')](handleError(_0x463b5c,null));};exports[_0xcbfe('0xc0')]=function(_0x368405,_0x208283,_0x18a0ad){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x368405[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x208283,null))[_0xcbfe('0x36')](function(_0x146b7f){if(_0x146b7f){return _0x146b7f[_0xcbfe('0xc0')](_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')])[_0xcbfe('0x36')](function(){if(_[_0xcbfe('0xc1')](_0x368405[_0xcbfe('0x48')]['ids'])){for(var _0x536405=0x0;_0x536405<_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')][_0xcbfe('0x4d')];_0x536405+=0x1){socket[_0xcbfe('0xbe')](_0xcbfe('0xc2'),{'UserId':Number(_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')][_0x536405]),'MailAccountId':Number(_0x368405[_0xcbfe('0x5a')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x368405['query'][_0xcbfe('0x6a')]),'MailAccountId':Number(_0x368405[_0xcbfe('0x5a')]['id'])});}});}})[_0xcbfe('0x36')](respondWithStatusCode(_0x208283,null))['catch'](handleError(_0x208283,null));};exports[_0xcbfe('0xc3')]=function(_0x234fe6,_0x47b539,_0x3a960d){var _0x213594={};var _0xa738cb={};var _0x14ccba;var _0x295f6d;return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x234fe6[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x47b539,null))['then'](function(_0x3a42d8){if(_0x3a42d8){_0x14ccba=_0x3a42d8;_0xa738cb[_0xcbfe('0x47')]=_['keys'](db['User'][_0xcbfe('0x44')]);_0xa738cb[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x234fe6[_0xcbfe('0x48')]);_0xa738cb[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0xa738cb[_0xcbfe('0x47')],_0xa738cb['query']);_0x213594[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0xa738cb['model'],qs['fields'](_0x234fe6[_0xcbfe('0x48')]['fields']));_0x213594[_0xcbfe('0x4b')]=_0x213594[_0xcbfe('0x4b')]['length']?_0x213594[_0xcbfe('0x4b')]:_0xa738cb['model'];_0x213594[_0xcbfe('0x67')]=qs[_0xcbfe('0x6e')](_0x234fe6['query']['sort']);_0x213594['where']=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x234fe6[_0xcbfe('0x48')],_0xa738cb['filters']));if(_0x234fe6['query'][_0xcbfe('0x51')]){_0x213594[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x213594['where'],{'$or':_[_0xcbfe('0x42')](_0x213594['attributes'],function(_0x446d3b){var _0x39c9aa={};_0x39c9aa[_0x446d3b]={'$like':'%'+_0x234fe6[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x39c9aa;})});}_0x213594=_[_0xcbfe('0x52')]({},_0x213594,_0x234fe6['options']);return _0x14ccba[_0xcbfe('0xc3')](_0x213594);}})['then'](function(_0x5c1ee3){if(_0x5c1ee3){_0x295f6d=_0x5c1ee3[_0xcbfe('0x4d')];if(!_0x234fe6['query'][_0xcbfe('0x4e')]('nolimit')){_0x213594['limit']=qs[_0xcbfe('0x2e')](_0x234fe6[_0xcbfe('0x48')]['limit']);_0x213594[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x234fe6['query'][_0xcbfe('0x2c')]);}return _0x14ccba[_0xcbfe('0xc3')](_0x213594);}})['then'](function(_0x25bccf){if(_0x25bccf){return _0x25bccf?{'count':_0x295f6d,'rows':_0x25bccf}:null;}})[_0xcbfe('0x36')](respondWithResult(_0x47b539,null))['catch'](handleError(_0x47b539,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index edcd81d..e32de0f 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 _0x53fa=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x22a57a,_0x438bfe){var _0x4ac6b2=function(_0x219935){while(--_0x219935){_0x22a57a['push'](_0x22a57a['shift']());}};_0x4ac6b2(++_0x438bfe);}(_0x53fa,0x1ac));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa53f('0x0'));var MailAccount=require(_0xa53f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa53f('0x2')](0x0);var events={'afterCreate':_0xa53f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4c79f1){return function(_0x51737a,_0x321dbd,_0x35ba40){MailAccountEvents['emit'](_0x4c79f1+':'+_0x51737a['id'],_0x51737a);MailAccountEvents['emit'](_0x4c79f1,_0x51737a);_0x35ba40(null);};}for(var e in events){if(events[_0xa53f('0x4')](e)){var event=events[e];MailAccount[_0xa53f('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xba18=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ffc6b,_0x24d65d){var _0x34ecf4=function(_0xe6ae7b){while(--_0xe6ae7b){_0x2ffc6b['push'](_0x2ffc6b['shift']());}};_0x34ecf4(++_0x24d65d);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8ba1('0x0'));var MailAccount=require(_0x8ba1('0x1'))['db'][_0x8ba1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8ba1('0x3')](0x0);var events={'afterCreate':_0x8ba1('0x4'),'afterUpdate':_0x8ba1('0x5'),'afterDestroy':_0x8ba1('0x6')};function emitEvent(_0x3b5254){return function(_0x59c54c,_0xe3bc16,_0x3136d7){MailAccountEvents[_0x8ba1('0x7')](_0x3b5254+':'+_0x59c54c['id'],_0x59c54c);MailAccountEvents[_0x8ba1('0x7')](_0x3b5254,_0x59c54c);_0x3136d7(null);};}for(var e in events){if(events[_0x8ba1('0x8')](e)){var event=events[e];MailAccount[_0x8ba1('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 62deaf0..d6674be 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 _0x6e57=['moment','request-promise','../../config/environment','exports','mail_accounts','lodash','util','api'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x6e57,0x155));var _0x76e5=function(_0x4e8bfd,_0x3a8d29){_0x4e8bfd=_0x4e8bfd-0x0;var _0x1dfe0e=_0x6e57[_0x4e8bfd];return _0x1dfe0e;};'use strict';var _=require(_0x76e5('0x0'));var util=require(_0x76e5('0x1'));var logger=require('../../config/logger')(_0x76e5('0x2'));var moment=require(_0x76e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x76e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x76e5('0x5'));var attributes=require('./mailAccount.attributes');module[_0x76e5('0x6')]=function(_0x1df960,_0x2fa9c5){return _0x1df960['define']('MailAccount',attributes,{'tableName':_0x76e5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda51=['mail_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda51,0x91));var _0x1da5=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xda51[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x1da5('0x0'));var util=require(_0x1da5('0x1'));var logger=require('../../config/logger')(_0x1da5('0x2'));var moment=require('moment');var BPromise=require(_0x1da5('0x3'));var rp=require(_0x1da5('0x4'));var fs=require('fs');var path=require(_0x1da5('0x5'));var rimraf=require(_0x1da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x1da5('0x7'));module[_0x1da5('0x8')]=function(_0x240352,_0x3e9242){return _0x240352[_0x1da5('0x9')](_0x1da5('0xa'),attributes,{'tableName':_0x1da5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index ec2f617..3bc05c0 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 _0x2218=['spread','update','format','interaction','created','MailMessage','attachments','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetMailAccount','ShowMailAccount','find','NotifyMailAccount','mail','keys','CmContact','createdAt','updatedAt','CompanyId','body','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','DESC','MailApplication','Applications','Smtp','get','omit','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','ListId','create','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found'];(function(_0x2ade66,_0x1a54d7){var _0x23d56c=function(_0x240e31){while(--_0x240e31){_0x2ade66['push'](_0x2ade66['shift']());}};_0x23d56c(++_0x1a54d7);}(_0x2218,0x1b7));var _0x8221=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x2218[_0x57db49];return _0xd0636f;};'use strict';var _=require(_0x8221('0x0'));var util=require(_0x8221('0x1'));var moment=require(_0x8221('0x2'));var BPromise=require('bluebird');var rs=require(_0x8221('0x3'));var fs=require('fs');var Redis=require(_0x8221('0x4'));var db=require(_0x8221('0x5'))['db'];var utils=require(_0x8221('0x6'));var logger=require(_0x8221('0x7'))(_0x8221('0x8'));var config=require(_0x8221('0x9'));var jayson=require(_0x8221('0xa'));var client=jayson[_0x8221('0xb')]['http']({'port':0x232c});config[_0x8221('0xc')]=_[_0x8221('0xd')](config[_0x8221('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8221('0xc')]));require(_0x8221('0xe'))[_0x8221('0xf')](socket);function respondWithRpcPromise(_0x1b1ddb,_0x20aa2d,_0x508113){return new BPromise(function(_0x1aecc1,_0x4e9e3e){return client[_0x8221('0x10')](_0x1b1ddb,_0x508113)[_0x8221('0x11')](function(_0x4803f7){logger[_0x8221('0x12')]('MailAccount,\x20%s,\x20%s',_0x20aa2d,_0x8221('0x13'));logger[_0x8221('0x14')](_0x8221('0x15'),_0x20aa2d,'request\x20sent',JSON[_0x8221('0x16')](_0x4803f7));if(_0x4803f7[_0x8221('0x17')]){if(_0x4803f7[_0x8221('0x17')][_0x8221('0x18')]===0x1f4){logger[_0x8221('0x17')]('MailAccount,\x20%s,\x20%s',_0x20aa2d,_0x4803f7[_0x8221('0x17')][_0x8221('0x19')]);return _0x4e9e3e(_0x4803f7[_0x8221('0x17')][_0x8221('0x19')]);}logger[_0x8221('0x17')](_0x8221('0x1a'),_0x20aa2d,_0x4803f7[_0x8221('0x17')][_0x8221('0x19')]);return _0x1aecc1(_0x4803f7['error']['message']);}else{logger['info'](_0x8221('0x1a'),_0x20aa2d,_0x8221('0x13'));_0x1aecc1(_0x4803f7[_0x8221('0x1b')][_0x8221('0x19')]);}})[_0x8221('0x1c')](function(_0x1fed45){logger[_0x8221('0x17')](_0x8221('0x1a'),_0x20aa2d,_0x1fed45);_0x4e9e3e(_0x1fed45);});});}exports['GetMailAccount']=function(_0x48c2af){var _0x2c6e94=this;return new Promise(function(_0x5c9fe1,_0x2876ed){return db['MailAccount'][_0x8221('0x1d')]({'raw':_0x48c2af['options']?_0x48c2af[_0x8221('0x1e')][_0x8221('0x1f')]===undefined?!![]:![]:!![],'where':_0x48c2af['options']?_0x48c2af[_0x8221('0x1e')][_0x8221('0x20')]||null:null,'attributes':_0x48c2af[_0x8221('0x1e')]?_0x48c2af['options'][_0x8221('0x21')]||null:null,'limit':_0x48c2af['options']?_0x48c2af[_0x8221('0x1e')][_0x8221('0x22')]||null:null,'include':_0x48c2af['options']?_0x48c2af[_0x8221('0x1e')][_0x8221('0x23')]?_['map'](_0x48c2af[_0x8221('0x1e')][_0x8221('0x23')],function(_0x35ddd3){return{'model':db[_0x35ddd3[_0x8221('0x24')]],'as':_0x35ddd3['as'],'attributes':_0x35ddd3[_0x8221('0x21')],'include':_0x35ddd3[_0x8221('0x23')]?_['map'](_0x35ddd3[_0x8221('0x23')],function(_0x4d5d19){return{'model':db[_0x4d5d19[_0x8221('0x24')]],'as':_0x4d5d19['as'],'attributes':_0x4d5d19[_0x8221('0x21')],'include':_0x4d5d19[_0x8221('0x23')]?_[_0x8221('0x25')](_0x4d5d19['include'],function(_0x207755){return{'model':db[_0x207755['model']],'as':_0x207755['as'],'attributes':_0x207755['attributes']};}):[]};}):[]};}):[]:[]})[_0x8221('0x11')](function(_0x4fae66){logger[_0x8221('0x12')](_0x8221('0x26'),_0x48c2af);logger[_0x8221('0x14')](_0x8221('0x26'),_0x48c2af,JSON[_0x8221('0x16')](_0x4fae66));_0x5c9fe1(_0x4fae66);})[_0x8221('0x1c')](function(_0x5941b2){logger[_0x8221('0x17')]('GetMailAccount',_0x5941b2[_0x8221('0x19')],_0x48c2af);_0x2876ed(_0x2c6e94[_0x8221('0x17')](0x1f4,_0x5941b2[_0x8221('0x19')]));});});};exports[_0x8221('0x27')]=function(_0x425002){var _0x4d8f8d=this;return new Promise(function(_0x4a9ba9,_0x4a47f3){return db['MailAccount'][_0x8221('0x28')]({'raw':_0x425002[_0x8221('0x1e')]?_0x425002[_0x8221('0x1e')][_0x8221('0x1f')]===undefined?!![]:![]:!![],'where':_0x425002['options']?_0x425002['options']['where']||null:null,'attributes':_0x425002[_0x8221('0x1e')]?_0x425002[_0x8221('0x1e')][_0x8221('0x21')]||null:null,'include':_0x425002['options']?_0x425002[_0x8221('0x1e')][_0x8221('0x23')]?_[_0x8221('0x25')](_0x425002['options'][_0x8221('0x23')],function(_0x1884ea){return{'model':db[_0x1884ea[_0x8221('0x24')]],'as':_0x1884ea['as'],'attributes':_0x1884ea[_0x8221('0x21')],'include':_0x1884ea[_0x8221('0x23')]?_[_0x8221('0x25')](_0x1884ea[_0x8221('0x23')],function(_0x87a7ce){return{'model':db[_0x87a7ce[_0x8221('0x24')]],'as':_0x87a7ce['as'],'attributes':_0x87a7ce[_0x8221('0x21')],'include':_0x87a7ce[_0x8221('0x23')]?_['map'](_0x87a7ce[_0x8221('0x23')],function(_0x19b026){return{'model':db[_0x19b026['model']],'as':_0x19b026['as'],'attributes':_0x19b026[_0x8221('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8221('0x11')](function(_0x2f49d7){logger[_0x8221('0x12')](_0x8221('0x27'),_0x425002);logger[_0x8221('0x14')]('ShowMailAccount',_0x425002,JSON['stringify'](_0x2f49d7));_0x4a9ba9(_0x2f49d7);})[_0x8221('0x1c')](function(_0x556560){logger[_0x8221('0x17')]('ShowMailAccount',_0x556560[_0x8221('0x19')],_0x425002);_0x4a47f3(_0x4d8f8d[_0x8221('0x17')](0x1f4,_0x556560[_0x8221('0x19')]));});});};exports[_0x8221('0x29')]=function(_0x24769a){var _0x3555f5=this;return new Promise(function(_0x435c71,_0x324907){var _0x1867ed={'body':_0x24769a['body'],'channel':_0x8221('0x2a')};var _0x3c3566=_['difference'](_[_0x8221('0x2b')](db[_0x8221('0x2c')]['rawAttributes']),[_0x8221('0x2d'),_0x8221('0x2e'),_0x8221('0x2f'),'ListId']);var _0x3e7350=![];if(_0x24769a[_0x8221('0x30')]['id']){delete _0x24769a[_0x8221('0x30')]['id'];}if(_[_0x8221('0x31')](_0x24769a['body'][_0x8221('0x32')])){return _0x324907(_0x3555f5['error'](0x1f4,_0x8221('0x33')));}if(_[_0x8221('0x31')](_0x24769a[_0x8221('0x30')][_0x8221('0x30')])||_0x24769a[_0x8221('0x30')]['body']===''){return _0x324907(_0x3555f5[_0x8221('0x17')](0x1f4,_0x8221('0x34')));}if(_[_0x8221('0x31')](_0x24769a[_0x8221('0x30')]['mapKey'])){return _0x324907(_0x3555f5['error'](0x1f4,_0x8221('0x35')+_0x3c3566));}if(!_['includes'](_0x3c3566,_0x24769a[_0x8221('0x30')][_0x8221('0x36')])){return _0x324907(_0x3555f5[_0x8221('0x17')](0x1f4,_0x8221('0x37')+_0x3c3566));}var _0x3a035e={};_0x3a035e[_0x24769a[_0x8221('0x30')][_0x8221('0x36')]]=_0x24769a[_0x8221('0x30')]['from'];return db['MailAccount'][_0x8221('0x28')]({'where':{'id':_0x24769a[_0x8221('0x38')]['id']},'include':[{'model':db[_0x8221('0x39')],'as':_0x8221('0x3a'),'include':[{'model':db[_0x8221('0x2c')],'as':_0x8221('0x3b'),'where':_0x3a035e,'limit':0x1,'order':[[_0x8221('0x2e'),_0x8221('0x3c')]]}]},{'model':db[_0x8221('0x3d')],'as':_0x8221('0x3e')},{'model':db['MailServerOut'],'as':_0x8221('0x3f')}]})[_0x8221('0x11')](function(_0xfd46af){if(_0xfd46af&&_0xfd46af[_0x8221('0x3a')]){var _0x3ed9b2=_0xfd46af[_0x8221('0x40')]({'plain':!![]});_0x1867ed['account']=_[_0x8221('0x41')](_0x3ed9b2,['Applications',_0x8221('0x3a')]);_0x1867ed[_0x8221('0x42')]=_0x3ed9b2[_0x8221('0x3e')];_0x1867ed['list']=_0x3ed9b2[_0x8221('0x3a')];_0x1867ed['applications']=_[_0x8221('0x43')](_0x1867ed['applications'],[_0x8221('0x44')],[_0x8221('0x45')]);if(_0x1867ed[_0x8221('0x38')]&&_0x1867ed[_0x8221('0x38')][_0x8221('0x46')]){_0x1867ed[_0x8221('0x42')][_0x8221('0x47')]({'id':0x0,'priority':_0x1867ed[_0x8221('0x42')][_0x8221('0x48')]+0x1,'app':_0x8221('0x49'),'appdata':_0x8221('0x46'),'interval':_0x8221('0x4a')});}if(_0x1867ed[_0x8221('0x38')][_0x8221('0x3e')]){delete _0x1867ed[_0x8221('0x38')][_0x8221('0x3e')];}if(_0x1867ed['account'][_0x8221('0x3a')]){delete _0x1867ed[_0x8221('0x38')][_0x8221('0x3a')];}if(_0x3ed9b2['List'][_0x8221('0x3b')][_0x8221('0x48')]){return _0x3ed9b2[_0x8221('0x3a')][_0x8221('0x3b')][0x0];}var _0x123127=_[_0x8221('0xd')](_0x24769a['body'],{'firstName':_0x24769a[_0x8221('0x30')]['from'],'ListId':_0x3ed9b2[_0x8221('0x4b')]});_0x123127[_0x24769a[_0x8221('0x30')][_0x8221('0x36')]]=_0x24769a[_0x8221('0x30')]['from'];return db['CmContact'][_0x8221('0x4c')](_0x123127);}else{throw new Error(_0x8221('0x4d'));}})[_0x8221('0x11')](function(_0x56b053){_0x1867ed['contact']=_0x56b053;if(_0x56b053){if(!_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x4e')]){_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x4e')]=rs['generate']()+'\x20'+_0x24769a['body'][_0x8221('0x19')][_0x8221('0x32')];}var _0x39e6ba={'ContactId':_0x56b053['id'],'MailAccountId':_0x24769a['account']['id'],'inReplyTo':_0x24769a['body'][_0x8221('0x19')]['messageId'],'to':_0x24769a['body']['message'][_0x8221('0x32')],'cc':_0x24769a['body'][_0x8221('0x19')]['cc'],'subject':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x4f')],'attach':_0x24769a['body']['message'][_0x8221('0x50')],'lastMsgAt':moment()['format'](_0x8221('0x51')),'lastMsgDirection':'in'};return db[_0x8221('0x52')][_0x8221('0x28')]({'where':{'closed':![],'MailAccountId':_0x24769a[_0x8221('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':_0x8221('0x53'),'attributes':[_0x8221('0x4e')],'where':{'messageId':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x54')]}}]})[_0x8221('0x11')](function(_0x11931c){if(_0x11931c){return[_0x11931c,![]];}return db['MailInteraction'][_0x8221('0x4c')](_0x39e6ba)[_0x8221('0x11')](function(_0xabb6c8){return[_0xabb6c8,!![]];});});}else{throw new Error(_0x8221('0x55'));}})[_0x8221('0x56')](function(_0x45ea14,_0x43b83f){if(_0x45ea14){_0x3e7350=_0x43b83f;if(!_0x43b83f){return _0x45ea14[_0x8221('0x57')]({'inReplyTo':_0x24769a[_0x8221('0x30')][_0x8221('0x19')]['messageId'],'to':_0x24769a['body'][_0x8221('0x19')][_0x8221('0x32')],'cc':_0x24769a[_0x8221('0x30')]['message']['cc'],'subject':_0x24769a[_0x8221('0x30')][_0x8221('0x19')]['subject'],'attach':_0x45ea14[_0x8221('0x50')]?_0x45ea14[_0x8221('0x50')]:_0x24769a[_0x8221('0x30')]['message'][_0x8221('0x50')],'substatus':null,'substatusAt':moment()[_0x8221('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x8221('0x58')](_0x8221('0x51')),'lastMsgDirection':'in'});}else{return _0x45ea14;}}})['then'](function(_0x5a3ec1){_0x1867ed['interaction']=_0x5a3ec1[_0x8221('0x40')]({'plain':!![]});_0x1867ed[_0x8221('0x59')][_0x8221('0x5a')]=_0x3e7350;return db[_0x8221('0x5b')][_0x8221('0x4c')]({'body':_0x24769a[_0x8221('0x30')][_0x8221('0x30')],'MailAccountId':_0x24769a['account']['id'],'MailInteractionId':_0x5a3ec1['id'],'direction':'in','ContactId':_0x1867ed['contact']['id'],'messageId':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x4e')],'from':_0x24769a['body']['message'][_0x8221('0x32')],'to':_0x24769a[_0x8221('0x30')][_0x8221('0x19')]['to'],'cc':_0x24769a['body'][_0x8221('0x19')]['cc'],'subject':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x4f')],'attach':_0x24769a['body'][_0x8221('0x19')][_0x8221('0x50')],'Attachments':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x5c')],'originTo':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x5d')],'originCc':_0x24769a['body'][_0x8221('0x19')][_0x8221('0x5e')],'bcc':_0x24769a[_0x8221('0x30')][_0x8221('0x19')]['bcc'],'ChatWebsiteId':_0x24769a['body'][_0x8221('0x19')]['ChatWebsiteId']||null,'originChannel':_0x24769a['body'][_0x8221('0x19')][_0x8221('0x5f')]||_0x8221('0x60'),'ChatOfflineMessageId':_0x24769a[_0x8221('0x30')][_0x8221('0x19')][_0x8221('0x61')]||null},{'include':[{'model':db[_0x8221('0x62')],'as':_0x8221('0x63')}]});})[_0x8221('0x11')](function(_0x4ac692){_0x1867ed[_0x8221('0x19')]=_0x4ac692;if(_0x1867ed[_0x8221('0x59')][_0x8221('0x64')]){return db['User']['find']({'attributes':['id',_0x8221('0x65')],'where':{'id':_0x1867ed['interaction'][_0x8221('0x64')]}})[_0x8221('0x11')](function(_0x39e349){if(_0x39e349){_0x1867ed[_0x8221('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8221('0x66'),'appdata':_0x39e349[_0x8221('0x65')]+','+(_0x1867ed[_0x8221('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x8221('0x4a')});}return respondWithRpcPromise(_0x8221('0x67'),_0x8221('0x68'),_0x1867ed);});}return respondWithRpcPromise('Start',_0x8221('0x68'),_0x1867ed);})[_0x8221('0x11')](function(_0x4733d9){_0x435c71(_0x4733d9);})[_0x8221('0x1c')](function(_0x2ff04d){_0x324907(_0x3555f5[_0x8221('0x17')](0x1f4,_0x2ff04d['message']));});});}; \ No newline at end of file +var _0x0118=['isNil','from','from\x20is\x20mandatory','mapKey','includes','account','CmList','List','Contacts','MailApplication','MailServerOut','Smtp','get','omit','applications','orderBy','priority','autoclose','push','length','close','Applications','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','Contact\x20not\x20found','spread','update','format','interaction','MailMessage','create','attachments','originTo','originChannel','Email','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','info','request\x20sent','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','model','include','debug','stringify','ShowMailAccount','find','NotifyMailAccount','body','CmContact','createdAt','updatedAt','CompanyId','ListId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0118,0x151));var _0x8011=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0118[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8011('0x0'));var util=require(_0x8011('0x1'));var moment=require('moment');var BPromise=require(_0x8011('0x2'));var rs=require(_0x8011('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8011('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8011('0x5'));var config=require(_0x8011('0x6'));var jayson=require(_0x8011('0x7'));var client=jayson[_0x8011('0x8')][_0x8011('0x9')]({'port':0x232c});config[_0x8011('0xa')]=_[_0x8011('0xb')](config[_0x8011('0xa')],{'host':_0x8011('0xc'),'port':0x18eb});var socket=require(_0x8011('0xd'))(new Redis(config[_0x8011('0xa')]));require(_0x8011('0xe'))[_0x8011('0xf')](socket);function respondWithRpcPromise(_0x3abb55,_0x2b02cf,_0x22b242){return new BPromise(function(_0x2c3923,_0x504075){return client[_0x8011('0x10')](_0x3abb55,_0x22b242)[_0x8011('0x11')](function(_0x178ac7){logger['info']('MailAccount,\x20%s,\x20%s',_0x2b02cf,'request\x20sent');logger['debug'](_0x8011('0x12'),_0x2b02cf,'request\x20sent',JSON['stringify'](_0x178ac7));if(_0x178ac7[_0x8011('0x13')]){if(_0x178ac7[_0x8011('0x13')][_0x8011('0x14')]===0x1f4){logger[_0x8011('0x13')](_0x8011('0x15'),_0x2b02cf,_0x178ac7[_0x8011('0x13')][_0x8011('0x16')]);return _0x504075(_0x178ac7[_0x8011('0x13')]['message']);}logger[_0x8011('0x13')](_0x8011('0x15'),_0x2b02cf,_0x178ac7[_0x8011('0x13')][_0x8011('0x16')]);return _0x2c3923(_0x178ac7['error'][_0x8011('0x16')]);}else{logger[_0x8011('0x17')](_0x8011('0x15'),_0x2b02cf,_0x8011('0x18'));_0x2c3923(_0x178ac7['result']['message']);}})[_0x8011('0x19')](function(_0x38cca5){logger['error'](_0x8011('0x15'),_0x2b02cf,_0x38cca5);_0x504075(_0x38cca5);});});}exports[_0x8011('0x1a')]=function(_0x2b1f0c){var _0x2f1328=this;return new Promise(function(_0x133a3e,_0x594780){return db[_0x8011('0x1b')][_0x8011('0x1c')]({'raw':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')]['where']||null:null,'attributes':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x1f')]||null:null,'limit':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x20')]||null:null,'include':_0x2b1f0c['options']?_0x2b1f0c[_0x8011('0x1d')]['include']?_[_0x8011('0x21')](_0x2b1f0c[_0x8011('0x1d')]['include'],function(_0x43f7f5){return{'model':db[_0x43f7f5[_0x8011('0x22')]],'as':_0x43f7f5['as'],'attributes':_0x43f7f5[_0x8011('0x1f')],'include':_0x43f7f5[_0x8011('0x23')]?_[_0x8011('0x21')](_0x43f7f5[_0x8011('0x23')],function(_0x5314eb){return{'model':db[_0x5314eb[_0x8011('0x22')]],'as':_0x5314eb['as'],'attributes':_0x5314eb[_0x8011('0x1f')],'include':_0x5314eb[_0x8011('0x23')]?_[_0x8011('0x21')](_0x5314eb['include'],function(_0x52a841){return{'model':db[_0x52a841['model']],'as':_0x52a841['as'],'attributes':_0x52a841[_0x8011('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4778b5){logger[_0x8011('0x17')](_0x8011('0x1a'),_0x2b1f0c);logger[_0x8011('0x24')]('GetMailAccount',_0x2b1f0c,JSON[_0x8011('0x25')](_0x4778b5));_0x133a3e(_0x4778b5);})[_0x8011('0x19')](function(_0x5ceb99){logger[_0x8011('0x13')]('GetMailAccount',_0x5ceb99[_0x8011('0x16')],_0x2b1f0c);_0x594780(_0x2f1328[_0x8011('0x13')](0x1f4,_0x5ceb99[_0x8011('0x16')]));});});};exports[_0x8011('0x26')]=function(_0x102730){var _0x3b6af8=this;return new Promise(function(_0x8da134,_0x48f20c){return db[_0x8011('0x1b')][_0x8011('0x27')]({'raw':_0x102730['options']?_0x102730[_0x8011('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x102730[_0x8011('0x1d')]?_0x102730[_0x8011('0x1d')]['where']||null:null,'attributes':_0x102730[_0x8011('0x1d')]?_0x102730[_0x8011('0x1d')]['attributes']||null:null,'include':_0x102730[_0x8011('0x1d')]?_0x102730['options'][_0x8011('0x23')]?_[_0x8011('0x21')](_0x102730[_0x8011('0x1d')][_0x8011('0x23')],function(_0x20a6ed){return{'model':db[_0x20a6ed['model']],'as':_0x20a6ed['as'],'attributes':_0x20a6ed[_0x8011('0x1f')],'include':_0x20a6ed['include']?_['map'](_0x20a6ed[_0x8011('0x23')],function(_0x1d9b27){return{'model':db[_0x1d9b27[_0x8011('0x22')]],'as':_0x1d9b27['as'],'attributes':_0x1d9b27[_0x8011('0x1f')],'include':_0x1d9b27['include']?_[_0x8011('0x21')](_0x1d9b27['include'],function(_0xb15ba1){return{'model':db[_0xb15ba1[_0x8011('0x22')]],'as':_0xb15ba1['as'],'attributes':_0xb15ba1[_0x8011('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8011('0x11')](function(_0x5df4cf){logger[_0x8011('0x17')](_0x8011('0x26'),_0x102730);logger[_0x8011('0x24')](_0x8011('0x26'),_0x102730,JSON[_0x8011('0x25')](_0x5df4cf));_0x8da134(_0x5df4cf);})[_0x8011('0x19')](function(_0x3d5b20){logger[_0x8011('0x13')]('ShowMailAccount',_0x3d5b20[_0x8011('0x16')],_0x102730);_0x48f20c(_0x3b6af8[_0x8011('0x13')](0x1f4,_0x3d5b20[_0x8011('0x16')]));});});};exports[_0x8011('0x28')]=function(_0x80479c){var _0x1ae69c=this;return new Promise(function(_0x83274f,_0x1161d6){var _0x50116a={'body':_0x80479c[_0x8011('0x29')],'channel':'mail'};var _0x174843=_['difference'](_['keys'](db[_0x8011('0x2a')]['rawAttributes']),[_0x8011('0x2b'),_0x8011('0x2c'),_0x8011('0x2d'),_0x8011('0x2e')]);var _0x586ba4=![];if(_0x80479c['body']['id']){delete _0x80479c[_0x8011('0x29')]['id'];}if(_[_0x8011('0x2f')](_0x80479c['body'][_0x8011('0x30')])){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,_0x8011('0x31')));}if(_['isNil'](_0x80479c['body'][_0x8011('0x29')])||_0x80479c[_0x8011('0x29')]['body']===''){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x80479c[_0x8011('0x29')][_0x8011('0x32')])){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x174843));}if(!_[_0x8011('0x33')](_0x174843,_0x80479c['body'][_0x8011('0x32')])){return _0x1161d6(_0x1ae69c['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x174843));}var _0x5dd79c={};_0x5dd79c[_0x80479c[_0x8011('0x29')][_0x8011('0x32')]]=_0x80479c[_0x8011('0x29')]['from'];return db['MailAccount'][_0x8011('0x27')]({'where':{'id':_0x80479c[_0x8011('0x34')]['id']},'include':[{'model':db[_0x8011('0x35')],'as':_0x8011('0x36'),'include':[{'model':db[_0x8011('0x2a')],'as':_0x8011('0x37'),'where':_0x5dd79c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8011('0x38')],'as':'Applications'},{'model':db[_0x8011('0x39')],'as':_0x8011('0x3a')}]})['then'](function(_0x8d0074){if(_0x8d0074&&_0x8d0074['List']){var _0xf62e70=_0x8d0074[_0x8011('0x3b')]({'plain':!![]});_0x50116a[_0x8011('0x34')]=_[_0x8011('0x3c')](_0xf62e70,['Applications',_0x8011('0x36')]);_0x50116a['applications']=_0xf62e70['Applications'];_0x50116a['list']=_0xf62e70['List'];_0x50116a[_0x8011('0x3d')]=_[_0x8011('0x3e')](_0x50116a['applications'],[_0x8011('0x3f')],['asc']);if(_0x50116a[_0x8011('0x34')]&&_0x50116a[_0x8011('0x34')][_0x8011('0x40')]){_0x50116a[_0x8011('0x3d')][_0x8011('0x41')]({'id':0x0,'priority':_0x50116a[_0x8011('0x3d')][_0x8011('0x42')]+0x1,'app':_0x8011('0x43'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x50116a[_0x8011('0x34')][_0x8011('0x44')]){delete _0x50116a[_0x8011('0x34')][_0x8011('0x44')];}if(_0x50116a['account'][_0x8011('0x36')]){delete _0x50116a[_0x8011('0x34')][_0x8011('0x36')];}if(_0xf62e70[_0x8011('0x36')]['Contacts'][_0x8011('0x42')]){return _0xf62e70[_0x8011('0x36')][_0x8011('0x37')][0x0];}var _0x3527e3=_[_0x8011('0xb')](_0x80479c['body'],{'firstName':_0x80479c[_0x8011('0x29')][_0x8011('0x30')],'ListId':_0xf62e70[_0x8011('0x2e')]});_0x3527e3[_0x80479c[_0x8011('0x29')][_0x8011('0x32')]]=_0x80479c[_0x8011('0x29')][_0x8011('0x30')];return db[_0x8011('0x2a')]['create'](_0x3527e3);}else{throw new Error('List\x20not\x20found');}})[_0x8011('0x11')](function(_0x56fa08){_0x50116a['contact']=_0x56fa08;if(_0x56fa08){if(!_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x45')]){_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x45')]=rs[_0x8011('0x46')]()+'\x20'+_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x30')];}var _0x4dbc5b={'ContactId':_0x56fa08['id'],'MailAccountId':_0x80479c[_0x8011('0x34')]['id'],'inReplyTo':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x45')],'to':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x30')],'cc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['cc'],'subject':_0x80479c['body'][_0x8011('0x16')][_0x8011('0x47')],'attach':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x48')],'lastMsgAt':moment()['format'](_0x8011('0x49')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x8011('0x27')]({'where':{'closed':![],'MailAccountId':_0x80479c[_0x8011('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x8011('0x4a'),'attributes':[_0x8011('0x45')],'where':{'messageId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['inReplyTo']}}]})[_0x8011('0x11')](function(_0x5acfd1){if(_0x5acfd1){return[_0x5acfd1,![]];}return db['MailInteraction']['create'](_0x4dbc5b)[_0x8011('0x11')](function(_0x5e58f7){return[_0x5e58f7,!![]];});});}else{throw new Error(_0x8011('0x4b'));}})[_0x8011('0x4c')](function(_0x5a9be3,_0x7c4ab0){if(_0x5a9be3){_0x586ba4=_0x7c4ab0;if(!_0x7c4ab0){return _0x5a9be3[_0x8011('0x4d')]({'inReplyTo':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['messageId'],'to':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['from'],'cc':_0x80479c['body'][_0x8011('0x16')]['cc'],'subject':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x47')],'attach':_0x5a9be3[_0x8011('0x48')]?_0x5a9be3[_0x8011('0x48')]:_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x48')],'substatus':null,'substatusAt':moment()[_0x8011('0x4e')](_0x8011('0x49')),'lastMsgAt':moment()[_0x8011('0x4e')](_0x8011('0x49')),'lastMsgDirection':'in'});}else{return _0x5a9be3;}}})[_0x8011('0x11')](function(_0x3543eb){_0x50116a['interaction']=_0x3543eb[_0x8011('0x3b')]({'plain':!![]});_0x50116a[_0x8011('0x4f')]['created']=_0x586ba4;return db[_0x8011('0x50')][_0x8011('0x51')]({'body':_0x80479c[_0x8011('0x29')][_0x8011('0x29')],'MailAccountId':_0x80479c[_0x8011('0x34')]['id'],'MailInteractionId':_0x3543eb['id'],'direction':'in','ContactId':_0x50116a['contact']['id'],'messageId':_0x80479c['body'][_0x8011('0x16')]['messageId'],'from':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x30')],'to':_0x80479c[_0x8011('0x29')]['message']['to'],'cc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['cc'],'subject':_0x80479c['body'][_0x8011('0x16')][_0x8011('0x47')],'attach':_0x80479c[_0x8011('0x29')]['message']['attach'],'Attachments':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x52')],'originTo':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x53')],'originCc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['originCc'],'bcc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['bcc'],'ChatWebsiteId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['ChatWebsiteId']||null,'originChannel':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x54')]||_0x8011('0x55'),'ChatOfflineMessageId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x8011('0x56')],'as':_0x8011('0x57')}]});})[_0x8011('0x11')](function(_0x308101){_0x50116a['message']=_0x308101;if(_0x50116a['interaction'][_0x8011('0x58')]){return db[_0x8011('0x59')]['find']({'attributes':['id','name'],'where':{'id':_0x50116a[_0x8011('0x4f')][_0x8011('0x58')]}})['then'](function(_0x2a7de5){if(_0x2a7de5){_0x50116a[_0x8011('0x3d')][_0x8011('0x5a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2a7de5[_0x8011('0x5b')]+','+(_0x50116a['account'][_0x8011('0x5c')]||0xa),'interval':_0x8011('0x5d')});}return respondWithRpcPromise(_0x8011('0x5e'),_0x8011('0x5f'),_0x50116a);});}return respondWithRpcPromise(_0x8011('0x5e'),_0x8011('0x5f'),_0x50116a);})['then'](function(_0xf7519f){_0x83274f(_0xf7519f);})['catch'](function(_0x1a8097){_0x1161d6(_0x1ae69c['error'](0x1f4,_0x1a8097['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4e06ba3..ffcf767 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 _0x3cbd=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x108788,_0x505107){var _0x18a52b=function(_0x55ff2e){while(--_0x55ff2e){_0x108788['push'](_0x108788['shift']());}};_0x18a52b(++_0x505107);}(_0x3cbd,0xf5));var _0xd3cb=function(_0x124fbe,_0x5a9dfe){_0x124fbe=_0x124fbe-0x0;var _0x4700d5=_0x3cbd[_0x124fbe];return _0x4700d5;};'use strict';var MailAccountEvents=require(_0xd3cb('0x0'));var events=[_0xd3cb('0x1'),_0xd3cb('0x2'),_0xd3cb('0x3')];function createListener(_0x2c5217,_0x3692de){return function(_0x3162f1){_0x3692de[_0xd3cb('0x4')](_0x2c5217,_0x3162f1);};}function removeListener(_0x24ed10,_0x12e60d){return function(){MailAccountEvents[_0xd3cb('0x5')](_0x24ed10,_0x12e60d);};}exports[_0xd3cb('0x6')]=function(_0x444852){for(var _0x41e9d4=0x0,_0x537239=events[_0xd3cb('0x7')];_0x41e9d4<_0x537239;_0x41e9d4++){var _0xfda1f1=events[_0x41e9d4];var _0x2e4d91=createListener(_0xd3cb('0x8')+_0xfda1f1,_0x444852);MailAccountEvents['on'](_0xfda1f1,_0x2e4d91);}}; \ No newline at end of file +var _0xa149=['./mailAccount.events','save','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x1deba7,_0x30f270){var _0x2dcc31=function(_0x57a708){while(--_0x57a708){_0x1deba7['push'](_0x1deba7['shift']());}};_0x2dcc31(++_0x30f270);}(_0xa149,0x18c));var _0x9a14=function(_0x7cc01d,_0x564117){_0x7cc01d=_0x7cc01d-0x0;var _0x560f5a=_0xa149[_0x7cc01d];return _0x560f5a;};'use strict';var MailAccountEvents=require(_0x9a14('0x0'));var events=[_0x9a14('0x1'),_0x9a14('0x2'),_0x9a14('0x3')];function createListener(_0x45983b,_0x46ea98){return function(_0x2bb2ac){_0x46ea98[_0x9a14('0x4')](_0x45983b,_0x2bb2ac);};}function removeListener(_0x3b061a,_0x4a8f02){return function(){MailAccountEvents[_0x9a14('0x5')](_0x3b061a,_0x4a8f02);};}exports[_0x9a14('0x6')]=function(_0x5abb12){for(var _0x417648=0x0,_0x3beb93=events[_0x9a14('0x7')];_0x417648<_0x3beb93;_0x417648++){var _0x17d2e5=events[_0x417648];var _0x109f69=createListener(_0x9a14('0x8')+_0x17d2e5,_0x5abb12);MailAccountEvents['on'](_0x17d2e5,_0x109f69);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 20ebac5..61dbb01 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 _0xe055=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller'];(function(_0x28fdd5,_0x71997b){var _0x2824fa=function(_0x532860){while(--_0x532860){_0x28fdd5['push'](_0x28fdd5['shift']());}};_0x2824fa(++_0x71997b);}(_0xe055,0x88));var _0x5e05=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0xe055[_0x114c53];return _0x4e0c14;};'use strict';var multer=require(_0x5e05('0x0'));var util=require(_0x5e05('0x1'));var path=require(_0x5e05('0x2'));var timeout=require(_0x5e05('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e05('0x4'));var auth=require(_0x5e05('0x5'));var interaction=require(_0x5e05('0x6'));var config=require('../../config/environment');var controller=require(_0x5e05('0x7'));router['get'](_0x5e05('0x8'),auth[_0x5e05('0x9')](),controller[_0x5e05('0xa')]);router[_0x5e05('0xb')](_0x5e05('0x8'),auth['isAuthenticated'](),controller[_0x5e05('0xc')]);router[_0x5e05('0xd')](_0x5e05('0x8'),auth[_0x5e05('0x9')](),controller[_0x5e05('0xe')]);module[_0x5e05('0xf')]=router; \ No newline at end of file +var _0xcd7d=['/:id','show','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x70b5cb,_0x2fe319){var _0x353b2f=function(_0x42ed17){while(--_0x42ed17){_0x70b5cb['push'](_0x70b5cb['shift']());}};_0x353b2f(++_0x2fe319);}(_0xcd7d,0x180));var _0xdcd7=function(_0x5527c3,_0x571434){_0x5527c3=_0x5527c3-0x0;var _0xed3601=_0xcd7d[_0x5527c3];return _0xed3601;};'use strict';var multer=require(_0xdcd7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcd7('0x1'));var express=require('express');var router=express[_0xdcd7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdcd7('0x3'));var config=require('../../config/environment');var controller=require(_0xdcd7('0x4'));router[_0xdcd7('0x5')](_0xdcd7('0x6'),auth['isAuthenticated'](),controller[_0xdcd7('0x7')]);router['put'](_0xdcd7('0x6'),auth[_0xdcd7('0x8')](),controller[_0xdcd7('0x9')]);router[_0xdcd7('0xa')](_0xdcd7('0x6'),auth[_0xdcd7('0x8')](),controller[_0xdcd7('0xb')]);module[_0xdcd7('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 82a9a43..f375cee 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 _0x93c0=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0x30ccd0,_0x4aa875){var _0x1a8c5f=function(_0x5b3c92){while(--_0x5b3c92){_0x30ccd0['push'](_0x30ccd0['shift']());}};_0x1a8c5f(++_0x4aa875);}(_0x93c0,0x13e));var _0x093c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x93c0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x093c('0x0'));module[_0x093c('0x1')]={'priority':{'type':Sequelize[_0x093c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x093c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x093c('0x4')]()},'description':{'type':Sequelize[_0x093c('0x3')]},'interval':{'type':Sequelize[_0x093c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7215=['STRING','noop','TEXT','sequelize','exports'];(function(_0x3ebda8,_0x5a494d){var _0x2208ba=function(_0x5cbe3b){while(--_0x5cbe3b){_0x3ebda8['push'](_0x3ebda8['shift']());}};_0x2208ba(++_0x5a494d);}(_0x7215,0xf3));var _0x5721=function(_0x3f8084,_0x1175ea){_0x3f8084=_0x3f8084-0x0;var _0x1288aa=_0x7215[_0x3f8084];return _0x1288aa;};'use strict';var Sequelize=require(_0x5721('0x0'));module[_0x5721('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5721('0x2')],'allowNull':![],'defaultValue':_0x5721('0x3')},'appdata':{'type':Sequelize[_0x5721('0x4')]()},'description':{'type':Sequelize[_0x5721('0x2')]},'interval':{'type':Sequelize[_0x5721('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7572a9f..1be55a5 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 _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3aa640,_0x430b73){var _0x1cabbc=function(_0x1d0586){while(--_0x1d0586){_0x3aa640['push'](_0x3aa640['shift']());}};_0x1cabbc(++_0x430b73);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5dbc6a,_0x55c7c6){_0x5dbc6a=_0x5dbc6a-0x0;var _0x33c9c7=_0xbdb7[_0x5dbc6a];return _0x33c9c7;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 878d532..27b013c 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 _0x0141=['bluebird','path','rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2dd863,_0x8c7b9){var _0x2bc6bf=function(_0x5c9dfd){while(--_0x5c9dfd){_0x2dd863['push'](_0x2dd863['shift']());}};_0x2bc6bf(++_0x8c7b9);}(_0x0141,0x10c));var _0x1014=function(_0x479d88,_0x35d466){_0x479d88=_0x479d88-0x0;var _0x47fa9f=_0x0141[_0x479d88];return _0x47fa9f;};'use strict';var _=require(_0x1014('0x0'));var util=require(_0x1014('0x1'));var logger=require(_0x1014('0x2'))(_0x1014('0x3'));var moment=require(_0x1014('0x4'));var BPromise=require(_0x1014('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1014('0x6'));var rimraf=require(_0x1014('0x7'));var config=require(_0x1014('0x8'));var attributes=require('./mailApplication.attributes');module[_0x1014('0x9')]=function(_0x1cdddd,_0x32889c){return _0x1cdddd[_0x1014('0xa')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1014('0xb'),'collate':_0x1014('0xc')});}; \ No newline at end of file +var _0x8010=['rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30ae2c,_0x4d5adf){var _0x57c603=function(_0x4da449){while(--_0x4da449){_0x30ae2c['push'](_0x30ae2c['shift']());}};_0x57c603(++_0x4d5adf);}(_0x8010,0x10a));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0801('0x0'));var logger=require(_0x0801('0x1'))(_0x0801('0x2'));var moment=require(_0x0801('0x3'));var BPromise=require(_0x0801('0x4'));var rp=require(_0x0801('0x5'));var fs=require('fs');var path=require(_0x0801('0x6'));var rimraf=require(_0x0801('0x7'));var config=require('../../config/environment');var attributes=require(_0x0801('0x8'));module[_0x0801('0x9')]=function(_0x376272,_0x494779){return _0x376272[_0x0801('0xa')](_0x0801('0xb'),attributes,{'tableName':_0x0801('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 eef53d3..dc6c3a2 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 _0xc600=['rpc','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x559337,_0x5759b6){var _0x1f3819=function(_0x99a849){while(--_0x99a849){_0x559337['push'](_0x559337['shift']());}};_0x1f3819(++_0x5759b6);}(_0xc600,0x11a));var _0x0c60=function(_0x36cd80,_0x2f823b){_0x36cd80=_0x36cd80-0x0;var _0x1f2de8=_0xc600[_0x36cd80];return _0x1f2de8;};'use strict';var _=require(_0x0c60('0x0'));var util=require(_0x0c60('0x1'));var moment=require(_0x0c60('0x2'));var BPromise=require(_0x0c60('0x3'));var rs=require(_0x0c60('0x4'));var fs=require('fs');var Redis=require(_0x0c60('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c60('0x6'));var logger=require(_0x0c60('0x7'))(_0x0c60('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c60('0x9')][_0x0c60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cfe1,_0x2de496,_0x31342d){return new BPromise(function(_0x3d55ef,_0x14d2cb){return client[_0x0c60('0xb')](_0x56cfe1,_0x31342d)[_0x0c60('0xc')](function(_0x25d932){logger['info'](_0x0c60('0xd'),_0x2de496,_0x0c60('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x2de496,_0x0c60('0xe'),JSON[_0x0c60('0xf')](_0x25d932));if(_0x25d932[_0x0c60('0x10')]){if(_0x25d932[_0x0c60('0x10')][_0x0c60('0x11')]===0x1f4){logger[_0x0c60('0x10')](_0x0c60('0xd'),_0x2de496,_0x25d932[_0x0c60('0x10')]['message']);return _0x14d2cb(_0x25d932[_0x0c60('0x10')][_0x0c60('0x12')]);}logger['error'](_0x0c60('0xd'),_0x2de496,_0x25d932[_0x0c60('0x10')][_0x0c60('0x12')]);return _0x3d55ef(_0x25d932[_0x0c60('0x10')][_0x0c60('0x12')]);}else{logger[_0x0c60('0x13')](_0x0c60('0xd'),_0x2de496,_0x0c60('0xe'));_0x3d55ef(_0x25d932['result']['message']);}})[_0x0c60('0x14')](function(_0x46e420){logger[_0x0c60('0x10')](_0x0c60('0xd'),_0x2de496,_0x46e420);_0x14d2cb(_0x46e420);});});}exports[_0x0c60('0x15')]=function(_0x4d3c23){var _0x4e37fa=this;return new Promise(function(_0x2bd5e8,_0x1270fa){return db[_0x0c60('0x16')][_0x0c60('0x17')](_0x4d3c23[_0x0c60('0x18')],{'raw':_0x4d3c23[_0x0c60('0x19')]?_0x4d3c23[_0x0c60('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d3c23[_0x0c60('0x19')]?_0x4d3c23[_0x0c60('0x19')]['where']||null:null,'attributes':_0x4d3c23['options']?_0x4d3c23['options'][_0x0c60('0x1a')]||null:null,'limit':_0x4d3c23['options']?_0x4d3c23[_0x0c60('0x19')][_0x0c60('0x1b')]||null:null})[_0x0c60('0xc')](function(_0x3fc885){logger[_0x0c60('0x13')](_0x0c60('0x15'),_0x4d3c23);logger[_0x0c60('0x1c')](_0x0c60('0x15'),_0x4d3c23,JSON[_0x0c60('0xf')](_0x3fc885));_0x2bd5e8(_0x3fc885);})[_0x0c60('0x14')](function(_0xc2de13){logger[_0x0c60('0x10')](_0x0c60('0x15'),_0xc2de13[_0x0c60('0x12')],_0x4d3c23);_0x1270fa(_0x4e37fa[_0x0c60('0x10')](0x1f4,_0xc2de13[_0x0c60('0x12')]));});});}; \ No newline at end of file +var _0xf938=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','options','raw','util'];(function(_0x3c0986,_0x1e284b){var _0x11c7b1=function(_0x588e62){while(--_0x588e62){_0x3c0986['push'](_0x3c0986['shift']());}};_0x11c7b1(++_0x1e284b);}(_0xf938,0x86));var _0x8f93=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0xf938[_0x426dd2];return _0x4bc76c;};'use strict';var _=require('lodash');var util=require(_0x8f93('0x0'));var moment=require(_0x8f93('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f93('0x3'))['db'];var utils=require(_0x8f93('0x4'));var logger=require(_0x8f93('0x5'))('rpc');var config=require(_0x8f93('0x6'));var jayson=require(_0x8f93('0x7'));var client=jayson[_0x8f93('0x8')][_0x8f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337804,_0x18e882,_0x2752b2){return new BPromise(function(_0x2a242c,_0x53aebc){return client[_0x8f93('0xa')](_0x337804,_0x2752b2)[_0x8f93('0xb')](function(_0x518c93){logger['info'](_0x8f93('0xc'),_0x18e882,'request\x20sent');logger[_0x8f93('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x18e882,_0x8f93('0xe'),JSON[_0x8f93('0xf')](_0x518c93));if(_0x518c93[_0x8f93('0x10')]){if(_0x518c93[_0x8f93('0x10')][_0x8f93('0x11')]===0x1f4){logger[_0x8f93('0x10')](_0x8f93('0xc'),_0x18e882,_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);return _0x53aebc(_0x518c93[_0x8f93('0x10')]['message']);}logger[_0x8f93('0x10')](_0x8f93('0xc'),_0x18e882,_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);return _0x2a242c(_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);}else{logger[_0x8f93('0x13')]('MailApplication,\x20%s,\x20%s',_0x18e882,_0x8f93('0xe'));_0x2a242c(_0x518c93[_0x8f93('0x14')][_0x8f93('0x12')]);}})[_0x8f93('0x15')](function(_0x571ac6){logger['error'](_0x8f93('0xc'),_0x18e882,_0x571ac6);_0x53aebc(_0x571ac6);});});}exports[_0x8f93('0x16')]=function(_0x3a0209){var _0x479ed5=this;return new Promise(function(_0x1023b5,_0x35ad09){return db[_0x8f93('0x17')][_0x8f93('0x18')](_0x3a0209['body'],{'raw':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')][_0x8f93('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')]['where']||null:null,'attributes':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')]['attributes']||null:null,'limit':_0x3a0209[_0x8f93('0x19')]?_0x3a0209[_0x8f93('0x19')]['limit']||null:null})['then'](function(_0x6ae32b){logger['info'](_0x8f93('0x16'),_0x3a0209);logger['debug'](_0x8f93('0x16'),_0x3a0209,JSON[_0x8f93('0xf')](_0x6ae32b));_0x1023b5(_0x6ae32b);})[_0x8f93('0x15')](function(_0x131438){logger['error'](_0x8f93('0x16'),_0x131438[_0x8f93('0x12')],_0x3a0209);_0x35ad09(_0x479ed5['error'](0x1f4,_0x131438[_0x8f93('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 7266a57..cba3a86 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 _0x289b=['post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','tracked','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x33c42e,_0x170930){var _0xfddb2b=function(_0x382a0e){while(--_0x382a0e){_0x33c42e['push'](_0x33c42e['shift']());}};_0xfddb2b(++_0x170930);}(_0x289b,0x6d));var _0xb289=function(_0x4d4e7c,_0x1a8689){_0x4d4e7c=_0x4d4e7c-0x0;var _0x408125=_0x289b[_0x4d4e7c];return _0x408125;};'use strict';var express=require(_0xb289('0x0'));var router=express[_0xb289('0x1')]();var auth=require(_0xb289('0x2'));var interaction=require(_0xb289('0x3'));var controller=require(_0xb289('0x4'));router['get']('/',auth[_0xb289('0x5')](),controller[_0xb289('0x6')]);router[_0xb289('0x7')](_0xb289('0x8'),auth[_0xb289('0x5')](),controller[_0xb289('0x9')]);router[_0xb289('0x7')](_0xb289('0xa'),auth[_0xb289('0x5')](),controller[_0xb289('0xb')]);router[_0xb289('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb289('0xc')]);router[_0xb289('0x7')](_0xb289('0xd'),auth[_0xb289('0x5')](),controller[_0xb289('0xe')]);router[_0xb289('0xf')]('/',auth['isAuthenticated'](),controller[_0xb289('0x10')]);router['post'](_0xb289('0x11'),auth['isAuthenticated'](),controller[_0xb289('0x12')]);router[_0xb289('0xf')](_0xb289('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0xb289('0x14'),_0xb289('0x15')),controller[_0xb289('0x16')]);router[_0xb289('0x17')](_0xb289('0xa'),auth[_0xb289('0x5')](),interaction['tracked'](_0xb289('0x14'),_0xb289('0x18')),controller[_0xb289('0x19')]);router[_0xb289('0x1a')](_0xb289('0xa'),auth[_0xb289('0x5')](),interaction[_0xb289('0x1b')](_0xb289('0x14'),_0xb289('0x1c')),controller[_0xb289('0x1d')]);router['delete']('/:id/tags',auth[_0xb289('0x5')](),controller['removeTags']);module[_0xb289('0x1e')]=router; \ No newline at end of file +var _0x9a07=['put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags'];(function(_0x130a00,_0x3e95a0){var _0x630677=function(_0x2a867d){while(--_0x2a867d){_0x130a00['push'](_0x130a00['shift']());}};_0x630677(++_0x3e95a0);}(_0x9a07,0xc4));var _0x79a0=function(_0x26f6e4,_0x396790){_0x26f6e4=_0x26f6e4-0x0;var _0x23280e=_0x9a07[_0x26f6e4];return _0x23280e;};'use strict';var express=require(_0x79a0('0x0'));var router=express[_0x79a0('0x1')]();var auth=require(_0x79a0('0x2'));var interaction=require(_0x79a0('0x3'));var controller=require(_0x79a0('0x4'));router['get']('/',auth[_0x79a0('0x5')](),controller['index']);router[_0x79a0('0x6')](_0x79a0('0x7'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x8')]);router[_0x79a0('0x6')](_0x79a0('0x9'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xa')]);router[_0x79a0('0x6')](_0x79a0('0xb'),auth['isAuthenticated'](),controller[_0x79a0('0xc')]);router[_0x79a0('0x6')]('/:id/download',auth[_0x79a0('0x5')](),controller['download']);router[_0x79a0('0xd')]('/',auth[_0x79a0('0x5')](),controller[_0x79a0('0xe')]);router[_0x79a0('0xd')](_0x79a0('0xb'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xf')]);router['post'](_0x79a0('0x10'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x13')),controller['addTags']);router[_0x79a0('0x14')](_0x79a0('0x9'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')]('mail','mailinteraction:update'),controller[_0x79a0('0x15')]);router[_0x79a0('0x16')]('/:id',auth[_0x79a0('0x5')](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x17')),controller[_0x79a0('0x18')]);router[_0x79a0('0x16')](_0x79a0('0x10'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x19')]);module[_0x79a0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9a4e5eb..7f29831 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 _0x54a9=['DATE','STRING','long','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0x1ad469,_0x24b617){var _0x34e5cd=function(_0x41852a){while(--_0x41852a){_0x1ad469['push'](_0x1ad469['shift']());}};_0x34e5cd(++_0x24b617);}(_0x54a9,0x186));var _0x954a=function(_0x51e130,_0x48b8c1){_0x51e130=_0x51e130-0x0;var _0x35c2ed=_0x54a9[_0x51e130];return _0x35c2ed;};'use strict';var Sequelize=require(_0x954a('0x0'));var iconv=require('iconv');module[_0x954a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x954a('0x2')]},'disposition':{'type':Sequelize[_0x954a('0x3')]},'secondDisposition':{'type':Sequelize[_0x954a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x954a('0x3')]},'note':{'type':Sequelize[_0x954a('0x3')]},'inReplyTo':{'type':Sequelize[_0x954a('0x3')](0x1fe)},'to':{'type':Sequelize[_0x954a('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x954a('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x954a('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x954a('0x2')]},'substatus':{'type':Sequelize[_0x954a('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x954a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x954a('0x6')]('in',_0x954a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x954a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x954a('0x6')]('in',_0x954a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfb15=['long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0xfb15,0x12f));var _0x5fb1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfb15[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x5fb1('0x0'));var iconv=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'closed':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5fb1('0x4')]},'disposition':{'type':Sequelize[_0x5fb1('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5fb1('0x5')]},'note':{'type':Sequelize[_0x5fb1('0x5')]},'inReplyTo':{'type':Sequelize[_0x5fb1('0x5')](0x1fe)},'to':{'type':Sequelize[_0x5fb1('0x5')]},'cc':{'type':Sequelize[_0x5fb1('0x6')](_0x5fb1('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x5fb1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5fb1('0x8')]('in',_0x5fb1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5fb1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5fb1('0x8')]('in',_0x5fb1('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index d9bf02f..afe3731 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 _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','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','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x1c0283,_0x23dd3a){var _0x505ff7=function(_0x22ce0d){while(--_0x22ce0d){_0x1c0283['push'](_0x1c0283['shift']());}};_0x505ff7(++_0x23dd3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb10b,0x12a));var _0xbb10=function(_0x953a55,_0x736d43){_0x953a55=_0x953a55-0x0;var _0x43fa9a=_0xb10b[_0x953a55];return _0x43fa9a;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 7782b48..fce1d86 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 _0x3b77=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','MailInteraction'];(function(_0x10a63c,_0x4d5085){var _0x4a7d83=function(_0x225b92){while(--_0x225b92){_0x10a63c['push'](_0x10a63c['shift']());}};_0x4a7d83(++_0x4d5085);}(_0x3b77,0x76));var _0x73b7=function(_0x587292,_0x1e0c8c){_0x587292=_0x587292-0x0;var _0x3b044a=_0x3b77[_0x587292];return _0x3b044a;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x73b7('0x0')];var MailMessage=require(_0x73b7('0x1'))['db'][_0x73b7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x73b7('0x3')](0x0);var events={'afterCreate':_0x73b7('0x4'),'afterUpdate':_0x73b7('0x5'),'afterDestroy':_0x73b7('0x6')};function emitEvent(_0x454d46){return function(_0x1621af,_0x415f08,_0x100fa3){_0x1621af[_0x73b7('0x7')]({'attributes':['id'],'raw':!![]})[_0x73b7('0x8')](function(_0x15f748){_0x1621af[_0x73b7('0x9')](_0x73b7('0xa'),_0x15f748['map'](function(_0xa2ecbd){return{'id':_0xa2ecbd['id']};}));return MailMessage[_0x73b7('0xb')]({'where':{'MailInteractionId':_0x1621af['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73b7('0x8')](function(_0x1ad456){_0x1621af[_0x73b7('0x9')](_0x73b7('0xc'),_0x1ad456['length']);MailInteractionEvents[_0x73b7('0xd')](_0x454d46+':'+_0x1621af['id'],_0x1621af);MailInteractionEvents['emit'](_0x454d46,_0x1621af);_0x100fa3(null);})[_0x73b7('0xe')](_0x100fa3(null));};}for(var e in events){if(events[_0x73b7('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x73b7('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x9646=['MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb'];(function(_0x4e832a,_0x52e7f8){var _0x6bae7d=function(_0x24bcbc){while(--_0x24bcbc){_0x4e832a['push'](_0x4e832a['shift']());}};_0x6bae7d(++_0x52e7f8);}(_0x9646,0x179));var _0x6964=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0x9646[_0x5c660a];return _0x3a77a4;};'use strict';var EventEmitter=require(_0x6964('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x6964('0x1')];var MailMessage=require(_0x6964('0x2'))['db'][_0x6964('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6964('0x4')](0x0);var events={'afterCreate':_0x6964('0x5'),'afterUpdate':_0x6964('0x6'),'afterDestroy':_0x6964('0x7')};function emitEvent(_0x9c7aa7){return function(_0x1db904,_0x2c8853,_0x4125c1){_0x1db904[_0x6964('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c740b){_0x1db904[_0x6964('0x9')](_0x6964('0xa'),_0x4c740b[_0x6964('0xb')](function(_0x3641b2){return{'id':_0x3641b2['id']};}));return MailMessage[_0x6964('0xc')]({'where':{'MailInteractionId':_0x1db904['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6964('0xd')](function(_0x4dfeaa){_0x1db904[_0x6964('0x9')]('unreadMessages',_0x4dfeaa[_0x6964('0xe')]);MailInteractionEvents[_0x6964('0xf')](_0x9c7aa7+':'+_0x1db904['id'],_0x1db904);MailInteractionEvents[_0x6964('0xf')](_0x9c7aa7,_0x1db904);_0x4125c1(null);})[_0x6964('0x10')](_0x4125c1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6964('0x11')](e,emitEvent(event));}}module[_0x6964('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1e4bd25..28c9a14 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 _0xf814=['subject','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','substatusAt','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0xa0082a,_0x389f09){var _0x437da2=function(_0x200622){while(--_0x200622){_0xa0082a['push'](_0xa0082a['shift']());}};_0x437da2(++_0x389f09);}(_0xf814,0x1c1));var _0x4f81=function(_0x36625f,_0x727bd6){_0x36625f=_0x36625f-0x0;var _0x135981=_0xf814[_0x36625f];return _0x135981;};'use strict';var _=require(_0x4f81('0x0'));var util=require(_0x4f81('0x1'));var logger=require(_0x4f81('0x2'))(_0x4f81('0x3'));var moment=require('moment');var BPromise=require(_0x4f81('0x4'));var rp=require(_0x4f81('0x5'));var fs=require('fs');var path=require(_0x4f81('0x6'));var rimraf=require(_0x4f81('0x7'));var config=require(_0x4f81('0x8'));var attributes=require(_0x4f81('0x9'));module[_0x4f81('0xa')]=function(_0x3252f4,_0x542a79){return _0x3252f4[_0x4f81('0xb')](_0x4f81('0xc'),attributes,{'tableName':_0x4f81('0xd'),'paranoid':![],'indexes':[{'name':_0x4f81('0xe'),'fields':[_0x4f81('0xf'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1cfe0d,_0x456fb6,_0xfac22){if(_0x1cfe0d['substatus']){_0x1cfe0d['substatusAt']=moment()[_0x4f81('0x10')](_0x4f81('0x11'));}if(_0x1cfe0d[_0x4f81('0x12')]){_0x1cfe0d['closedAt']=moment()[_0x4f81('0x10')](_0x4f81('0x11'));}_0xfac22(null,_0x456fb6);},'beforeUpdate':function(_0x583497,_0x560d5c,_0x2dfc43){if(_0x583497[_0x4f81('0x13')](_0x4f81('0x14'))){_0x583497['substatusAt']=_0x583497['substatus']?moment()[_0x4f81('0x10')](_0x4f81('0x11')):null;}if(_0x583497[_0x4f81('0x13')]('closed')){_0x583497['closedAt']=moment()[_0x4f81('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x583497[_0x4f81('0x14')]=null;_0x583497[_0x4f81('0x15')]=null;}_0x2dfc43(null,_0x583497);},'afterUpdate':function(_0x134955,_0x50fcd3,_0x3f0b50){var _0x1d1374=_0x3252f4[_0x4f81('0x16')];var _0x4f0fba=_0x134955[_0x4f81('0x17')]({'plain':!![]});if(_0x4f0fba[_0x4f81('0x12')]){return _0x1d1374[_0x4f81('0x18')][_0x4f81('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x4f0fba['id']}})[_0x4f81('0x1a')](function(){_0x3f0b50();})['catch'](function(_0x90be3b){_0x3f0b50(_0x90be3b);});}else{_0x3f0b50();}}},'charset':_0x4f81('0x1b'),'collate':_0x4f81('0x1c')});}; \ No newline at end of file +var _0x63d6=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x63d6,0xaf));var _0x663d=function(_0x123049,_0x2353dc){_0x123049=_0x123049-0x0;var _0x10a3cc=_0x63d6[_0x123049];return _0x10a3cc;};'use strict';var _=require('lodash');var util=require(_0x663d('0x0'));var logger=require(_0x663d('0x1'))(_0x663d('0x2'));var moment=require(_0x663d('0x3'));var BPromise=require(_0x663d('0x4'));var rp=require(_0x663d('0x5'));var fs=require('fs');var path=require(_0x663d('0x6'));var rimraf=require(_0x663d('0x7'));var config=require('../../config/environment');var attributes=require(_0x663d('0x8'));module[_0x663d('0x9')]=function(_0x48d498,_0x42718f){return _0x48d498[_0x663d('0xa')](_0x663d('0xb'),attributes,{'tableName':_0x663d('0xc'),'paranoid':![],'indexes':[{'name':_0x663d('0xd'),'fields':[_0x663d('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xb119f9,_0x20d3e3,_0x4d3842){if(_0xb119f9[_0x663d('0xf')]){_0xb119f9[_0x663d('0x10')]=moment()['format'](_0x663d('0x11'));}if(_0xb119f9[_0x663d('0x12')]){_0xb119f9[_0x663d('0x13')]=moment()[_0x663d('0x14')](_0x663d('0x11'));}_0x4d3842(null,_0x20d3e3);},'beforeUpdate':function(_0x370fc3,_0x19966e,_0x1191bf){if(_0x370fc3[_0x663d('0x15')]('substatus')){_0x370fc3[_0x663d('0x10')]=_0x370fc3['substatus']?moment()[_0x663d('0x14')](_0x663d('0x11')):null;}if(_0x370fc3[_0x663d('0x15')]('closed')){_0x370fc3[_0x663d('0x13')]=moment()['format'](_0x663d('0x11'));_0x370fc3[_0x663d('0xf')]=null;_0x370fc3['substatusAt']=null;}_0x1191bf(null,_0x370fc3);},'afterUpdate':function(_0x499b36,_0x451728,_0x42061a){var _0x58582a=_0x48d498[_0x663d('0x16')];var _0x47fa27=_0x499b36['get']({'plain':!![]});if(_0x47fa27[_0x663d('0x12')]){return _0x58582a['MailMessage'][_0x663d('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x47fa27['id']}})['then'](function(){_0x42061a();})[_0x663d('0x18')](function(_0x27441d){_0x42061a(_0x27441d);});}else{_0x42061a();}}},'charset':_0x663d('0x19'),'collate':_0x663d('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5766e42..bf0465b 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 _0x6e43=['socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','addTags','ids','spread','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x5d7fa6,_0x26faa6){var _0x5ef826=function(_0x3d79a8){while(--_0x3d79a8){_0x5d7fa6['push'](_0x5d7fa6['shift']());}};_0x5ef826(++_0x26faa6);}(_0x6e43,0x11b));var _0x36e4=function(_0xc6e96f,_0x1919a0){_0xc6e96f=_0xc6e96f-0x0;var _0x205a2e=_0x6e43[_0xc6e96f];return _0x205a2e;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var moment=require(_0x36e4('0x2'));var BPromise=require(_0x36e4('0x3'));var rs=require(_0x36e4('0x4'));var fs=require('fs');var Redis=require(_0x36e4('0x5'));var db=require(_0x36e4('0x6'))['db'];var utils=require(_0x36e4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x36e4('0x8'));var jayson=require(_0x36e4('0x9'));var client=jayson['client'][_0x36e4('0xa')]({'port':0x232a});config[_0x36e4('0xb')]=_[_0x36e4('0xc')](config[_0x36e4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x36e4('0xd'))(new Redis(config[_0x36e4('0xb')]));require('./mailInteraction.socket')[_0x36e4('0xe')](socket);function respondWithRpcPromise(_0x5f1a6b,_0x539e7c,_0x322f7a){return new BPromise(function(_0x1117a7,_0x68d6ec){return client[_0x36e4('0xf')](_0x5f1a6b,_0x322f7a)[_0x36e4('0x10')](function(_0x39f013){logger['info'](_0x36e4('0x11'),_0x539e7c,_0x36e4('0x12'));logger[_0x36e4('0x13')](_0x36e4('0x14'),_0x539e7c,'request\x20sent',JSON[_0x36e4('0x15')](_0x39f013));if(_0x39f013[_0x36e4('0x16')]){if(_0x39f013['error']['code']===0x1f4){logger[_0x36e4('0x16')]('MailInteraction,\x20%s,\x20%s',_0x539e7c,_0x39f013[_0x36e4('0x16')][_0x36e4('0x17')]);return _0x68d6ec(_0x39f013['error'][_0x36e4('0x17')]);}logger[_0x36e4('0x16')](_0x36e4('0x11'),_0x539e7c,_0x39f013[_0x36e4('0x16')]['message']);return _0x1117a7(_0x39f013[_0x36e4('0x16')]['message']);}else{logger[_0x36e4('0x18')](_0x36e4('0x11'),_0x539e7c,'request\x20sent');_0x1117a7(_0x39f013[_0x36e4('0x19')][_0x36e4('0x17')]);}})[_0x36e4('0x1a')](function(_0x28afcf){logger[_0x36e4('0x16')](_0x36e4('0x11'),_0x539e7c,_0x28afcf);_0x68d6ec(_0x28afcf);});});}exports[_0x36e4('0x1b')]=function(_0x566c98){var _0x197dec=this;return new Promise(function(_0x59b1a1,_0x6cf06e){return db[_0x36e4('0x1c')][_0x36e4('0x1d')](_0x566c98[_0x36e4('0x1e')],{'raw':_0x566c98[_0x36e4('0x1f')]?_0x566c98[_0x36e4('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566c98['options']?_0x566c98[_0x36e4('0x1f')]['where']||null:null,'attributes':_0x566c98[_0x36e4('0x1f')]?_0x566c98[_0x36e4('0x1f')][_0x36e4('0x20')]||null:null,'limit':_0x566c98[_0x36e4('0x1f')]?_0x566c98[_0x36e4('0x1f')][_0x36e4('0x21')]||null:null})['then'](function(_0x351060){logger[_0x36e4('0x18')](_0x36e4('0x1b'),_0x566c98);logger[_0x36e4('0x13')](_0x36e4('0x1b'),_0x566c98,JSON[_0x36e4('0x15')](_0x351060));_0x59b1a1(_0x351060);})[_0x36e4('0x1a')](function(_0x499603){logger[_0x36e4('0x16')]('UpdateMailInteraction',_0x499603[_0x36e4('0x17')],_0x566c98);_0x6cf06e(_0x197dec[_0x36e4('0x16')](0x1f4,_0x499603[_0x36e4('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x24b4db){return new Promise(function(_0x3610d8,_0xe34847){return db[_0x36e4('0x1c')]['find']({'where':_0x24b4db[_0x36e4('0x1f')]?_0x24b4db['options']['where']||null:null})[_0x36e4('0x10')](function(_0x2e4a9e){if(_0x2e4a9e){return _0x2e4a9e[_0x36e4('0x22')](_0x24b4db[_0x36e4('0x1e')][_0x36e4('0x23')],_['omit'](_0x24b4db[_0x36e4('0x1e')],[_0x36e4('0x23'),'id'])||{});}})[_0x36e4('0x24')](function(_0x4a56a2){logger[_0x36e4('0x18')]('AddTags',_0x24b4db);logger['debug']('AddTags',_0x24b4db,JSON[_0x36e4('0x15')](_0x4a56a2));_0x3610d8(_0x4a56a2);})[_0x36e4('0x1a')](function(_0x175c25){logger[_0x36e4('0x16')]('AddTags',_0x175c25[_0x36e4('0x17')],_0x24b4db);_0xe34847(_this[_0x36e4('0x16')](0x1f4,_0x175c25[_0x36e4('0x17')]));});});}; \ No newline at end of file +var _0x7f81=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f81,0x185));var _0x17f8=function(_0x9b3b61,_0x25734e){_0x9b3b61=_0x9b3b61-0x0;var _0x1e1df9=_0x7f81[_0x9b3b61];return _0x1e1df9;};'use strict';var _=require(_0x17f8('0x0'));var util=require(_0x17f8('0x1'));var moment=require(_0x17f8('0x2'));var BPromise=require(_0x17f8('0x3'));var rs=require(_0x17f8('0x4'));var fs=require('fs');var Redis=require(_0x17f8('0x5'));var db=require(_0x17f8('0x6'))['db'];var utils=require(_0x17f8('0x7'));var logger=require('../../config/logger')(_0x17f8('0x8'));var config=require(_0x17f8('0x9'));var jayson=require(_0x17f8('0xa'));var client=jayson[_0x17f8('0xb')][_0x17f8('0xc')]({'port':0x232a});config[_0x17f8('0xd')]=_['defaults'](config[_0x17f8('0xd')],{'host':_0x17f8('0xe'),'port':0x18eb});var socket=require(_0x17f8('0xf'))(new Redis(config[_0x17f8('0xd')]));require(_0x17f8('0x10'))[_0x17f8('0x11')](socket);function respondWithRpcPromise(_0x4e3beb,_0x1e690f,_0x24507b){return new BPromise(function(_0x58c13f,_0x11a6d1){return client['request'](_0x4e3beb,_0x24507b)[_0x17f8('0x12')](function(_0x5a4719){logger[_0x17f8('0x13')](_0x17f8('0x14'),_0x1e690f,'request\x20sent');logger[_0x17f8('0x15')](_0x17f8('0x16'),_0x1e690f,_0x17f8('0x17'),JSON['stringify'](_0x5a4719));if(_0x5a4719[_0x17f8('0x18')]){if(_0x5a4719[_0x17f8('0x18')][_0x17f8('0x19')]===0x1f4){logger[_0x17f8('0x18')]('MailInteraction,\x20%s,\x20%s',_0x1e690f,_0x5a4719[_0x17f8('0x18')][_0x17f8('0x1a')]);return _0x11a6d1(_0x5a4719[_0x17f8('0x18')][_0x17f8('0x1a')]);}logger['error'](_0x17f8('0x14'),_0x1e690f,_0x5a4719['error']['message']);return _0x58c13f(_0x5a4719[_0x17f8('0x18')]['message']);}else{logger[_0x17f8('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1e690f,_0x17f8('0x17'));_0x58c13f(_0x5a4719['result'][_0x17f8('0x1a')]);}})['catch'](function(_0x40fd55){logger[_0x17f8('0x18')](_0x17f8('0x14'),_0x1e690f,_0x40fd55);_0x11a6d1(_0x40fd55);});});}exports[_0x17f8('0x1b')]=function(_0x13b2b9){var _0x197dd4=this;return new Promise(function(_0x34a7ad,_0x38b4e8){return db[_0x17f8('0x1c')][_0x17f8('0x1d')](_0x13b2b9[_0x17f8('0x1e')],{'raw':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9['options'][_0x17f8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b2b9['options']?_0x13b2b9[_0x17f8('0x1f')][_0x17f8('0x21')]||null:null,'attributes':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9[_0x17f8('0x1f')][_0x17f8('0x22')]||null:null,'limit':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9['options'][_0x17f8('0x23')]||null:null})['then'](function(_0x1023ab){logger['info']('UpdateMailInteraction',_0x13b2b9);logger[_0x17f8('0x15')](_0x17f8('0x1b'),_0x13b2b9,JSON[_0x17f8('0x24')](_0x1023ab));_0x34a7ad(_0x1023ab);})[_0x17f8('0x25')](function(_0x595fd8){logger['error'](_0x17f8('0x1b'),_0x595fd8[_0x17f8('0x1a')],_0x13b2b9);_0x38b4e8(_0x197dd4[_0x17f8('0x18')](0x1f4,_0x595fd8[_0x17f8('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0xabf6cc){return new Promise(function(_0x2ea038,_0x2ba940){return db['MailInteraction']['find']({'where':_0xabf6cc[_0x17f8('0x1f')]?_0xabf6cc['options'][_0x17f8('0x21')]||null:null})[_0x17f8('0x12')](function(_0x35fcd7){if(_0x35fcd7){return _0x35fcd7[_0x17f8('0x26')](_0xabf6cc[_0x17f8('0x1e')]['ids'],_['omit'](_0xabf6cc[_0x17f8('0x1e')],[_0x17f8('0x27'),'id'])||{});}})['spread'](function(_0x2d984b){logger['info'](_0x17f8('0x28'),_0xabf6cc);logger[_0x17f8('0x15')](_0x17f8('0x28'),_0xabf6cc,JSON[_0x17f8('0x24')](_0x2d984b));_0x2ea038(_0x2d984b);})[_0x17f8('0x25')](function(_0x241904){logger[_0x17f8('0x18')](_0x17f8('0x28'),_0x241904[_0x17f8('0x1a')],_0xabf6cc);_0x2ba940(_this[_0x17f8('0x18')](0x1f4,_0x241904[_0x17f8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 09af3a4..57359be 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 _0x0aff=['register','length','mailInteraction:','save','remove','update','emit'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0x0aff,0x96));var _0xf0af=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x0aff[_0x1b6563];return _0xdea7b8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xf0af('0x0'),_0xf0af('0x1'),_0xf0af('0x2')];function createListener(_0x2084b7,_0xe22b9){return function(_0x34eacb){_0xe22b9[_0xf0af('0x3')](_0x2084b7,_0x34eacb);};}function removeListener(_0x375621,_0xda43d9){return function(){MailInteractionEvents['removeListener'](_0x375621,_0xda43d9);};}exports[_0xf0af('0x4')]=function(_0x41e63a){for(var _0x3fb7f7=0x0,_0x499911=events[_0xf0af('0x5')];_0x3fb7f7<_0x499911;_0x3fb7f7++){var _0x41166e=events[_0x3fb7f7];var _0x24ad51=createListener(_0xf0af('0x6')+_0x41166e,_0x41e63a);MailInteractionEvents['on'](_0x41166e,_0x24ad51);}}; \ No newline at end of file +var _0x9d05=['mailInteraction:','./mailInteraction.events','save','update','emit','register','length'];(function(_0x3ab687,_0x2f3a18){var _0x512596=function(_0x981ef2){while(--_0x981ef2){_0x3ab687['push'](_0x3ab687['shift']());}};_0x512596(++_0x2f3a18);}(_0x9d05,0x127));var _0x59d0=function(_0x5903ec,_0x5a31f0){_0x5903ec=_0x5903ec-0x0;var _0x4d84f8=_0x9d05[_0x5903ec];return _0x4d84f8;};'use strict';var MailInteractionEvents=require(_0x59d0('0x0'));var events=[_0x59d0('0x1'),'remove',_0x59d0('0x2')];function createListener(_0x284e40,_0x46cee5){return function(_0x1045fd){_0x46cee5[_0x59d0('0x3')](_0x284e40,_0x1045fd);};}function removeListener(_0xeb558a,_0x19dcad){return function(){MailInteractionEvents['removeListener'](_0xeb558a,_0x19dcad);};}exports[_0x59d0('0x4')]=function(_0x2e18a7){for(var _0xe839ea=0x0,_0x5c672b=events[_0x59d0('0x5')];_0xe839ea<_0x5c672b;_0xe839ea++){var _0x40d569=events[_0xe839ea];var _0x31db7f=createListener(_0x59d0('0x6')+_0x40d569,_0x2e18a7);MailInteractionEvents['on'](_0x40d569,_0x31db7f);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 802036d..106a5ba 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 _0x3a27=['express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','put','update','/:id/accept','/:id/reject','delete','multer','util','path','connect-timeout'];(function(_0x488f3f,_0x14d2e3){var _0x4563ad=function(_0x3d766a){while(--_0x3d766a){_0x488f3f['push'](_0x488f3f['shift']());}};_0x4563ad(++_0x14d2e3);}(_0x3a27,0x19c));var _0x73a2=function(_0x21fc3d,_0x294b6d){_0x21fc3d=_0x21fc3d-0x0;var _0x4781ff=_0x3a27[_0x21fc3d];return _0x4781ff;};'use strict';var multer=require(_0x73a2('0x0'));var util=require(_0x73a2('0x1'));var path=require(_0x73a2('0x2'));var timeout=require(_0x73a2('0x3'));var express=require(_0x73a2('0x4'));var router=express[_0x73a2('0x5')]();var fs_extra=require(_0x73a2('0x6'));var auth=require(_0x73a2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x73a2('0x8'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0x73a2('0x9')](),controller[_0x73a2('0xa')]);router[_0x73a2('0xb')](_0x73a2('0xc'),auth['isAuthenticated'](),controller[_0x73a2('0xd')]);router[_0x73a2('0xb')](_0x73a2('0xe'),auth[_0x73a2('0x9')](),controller[_0x73a2('0xf')]);router[_0x73a2('0xb')](_0x73a2('0x10'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x11')]);router[_0x73a2('0x12')]('/',auth['isAuthenticated'](),interaction[_0x73a2('0x13')]('mail',_0x73a2('0x14')),controller['create']);router[_0x73a2('0x15')](_0x73a2('0xe'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x16')]);router[_0x73a2('0x15')](_0x73a2('0x17'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x73a2('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0x73a2('0x19')]('/:id',auth[_0x73a2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9c5e=['../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x2a6ede,_0x5af3e6){var _0x39f3ab=function(_0x31e7c6){while(--_0x31e7c6){_0x2a6ede['push'](_0x2a6ede['shift']());}};_0x39f3ab(++_0x5af3e6);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x52fa21,_0x7518da){_0x52fa21=_0x52fa21-0x0;var _0x1c5195=_0x9c5e[_0x52fa21];return _0x1c5195;};'use strict';var multer=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var path=require(_0xe9c5('0x2'));var timeout=require(_0xe9c5('0x3'));var express=require(_0xe9c5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe9c5('0x5'));var config=require(_0xe9c5('0x6'));var controller=require('./mailMessage.controller');router[_0xe9c5('0x7')]('/',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x9')]);router[_0xe9c5('0x7')]('/describe',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xa')]);router[_0xe9c5('0x7')](_0xe9c5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe9c5('0x7')](_0xe9c5('0xc'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xd')]);router[_0xe9c5('0xe')]('/',auth[_0xe9c5('0x8')](),interaction[_0xe9c5('0xf')](_0xe9c5('0x10'),_0xe9c5('0x11')),controller[_0xe9c5('0x12')]);router[_0xe9c5('0x13')](_0xe9c5('0xb'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x14')]);router[_0xe9c5('0x13')](_0xe9c5('0x15'),auth['isAuthenticated'](),controller[_0xe9c5('0x16')]);router[_0xe9c5('0x13')](_0xe9c5('0x17'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x18')]);router[_0xe9c5('0x19')]('/:id',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x1a')]);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 c00398a..4c4cab0 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 _0xf2d8=['ENUM','out','STRING','long','DATE','INTEGER','Email','sequelize','lodash','TEXT','medium','BOOLEAN'];(function(_0x59ae41,_0x597093){var _0x5f2ae4=function(_0x476dd2){while(--_0x476dd2){_0x59ae41['push'](_0x59ae41['shift']());}};_0x5f2ae4(++_0x597093);}(_0xf2d8,0x103));var _0x8f2d=function(_0x3a36e4,_0x420a62){_0x3a36e4=_0x3a36e4-0x0;var _0x3e3628=_0xf2d8[_0x3a36e4];return _0x3e3628;};'use strict';var Sequelize=require(_0x8f2d('0x0'));var _=require(_0x8f2d('0x1'));module['exports']={'body':{'type':Sequelize[_0x8f2d('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8f2d('0x2')](_0x8f2d('0x3'))},'read':{'type':Sequelize[_0x8f2d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8f2d('0x5')]('in',_0x8f2d('0x6')),'defaultValue':_0x8f2d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8f2d('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8f2d('0x2')](_0x8f2d('0x8'))},'cc':{'type':Sequelize[_0x8f2d('0x2')](_0x8f2d('0x8'))},'bcc':{'type':Sequelize[_0x8f2d('0x2')](_0x8f2d('0x8'))},'subject':{'type':Sequelize[_0x8f2d('0x2')]},'sentAt':{'type':Sequelize[_0x8f2d('0x9')]},'attach':{'type':Sequelize[_0x8f2d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8f2d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8f2d('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x8f2d('0x8'))},'originCc':{'type':Sequelize[_0x8f2d('0x2')]('long')},'originChannel':{'type':Sequelize[_0x8f2d('0x5')](_0x8f2d('0xb'),'Chat'),'defaultValue':_0x8f2d('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x7aad=['Chat','sequelize','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email'];(function(_0x40fc31,_0x3e6602){var _0x4b2a4f=function(_0x2791da){while(--_0x2791da){_0x40fc31['push'](_0x40fc31['shift']());}};_0x4b2a4f(++_0x3e6602);}(_0x7aad,0x1e1));var _0xd7aa=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7aad[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xd7aa('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xd7aa('0x3'))},'read':{'type':Sequelize[_0xd7aa('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd7aa('0x5')),'defaultValue':_0xd7aa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd7aa('0x6')](0x1fe)},'from':{'type':Sequelize[_0xd7aa('0x6')]},'to':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'cc':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'bcc':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'subject':{'type':Sequelize[_0xd7aa('0x1')]},'sentAt':{'type':Sequelize[_0xd7aa('0x7')]},'attach':{'type':Sequelize[_0xd7aa('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd7aa('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'originCc':{'type':Sequelize[_0xd7aa('0x1')]('long')},'originChannel':{'type':Sequelize[_0xd7aa('0x9')](_0xd7aa('0xa'),_0xd7aa('0xb')),'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 78aecd8..e0d370f 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 _0x8dcc=['SELECT','fullname','motionChannel','download','toString','join','server','files','message-%s.eml','from','subject','createdAt','Attachment','Attachments','headers','bcc','basename','existsSync','readFileSync','build','writeFileSync','eml-format','moment','util','lodash','ioredis','html-to-text','../../components/parsers/qs','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','stringify','error','code','message','MailMessage,\x20%s,\x20%s','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','describe','create','direction','out','secret','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','agent','get','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','Sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','reject','MailInteraction','RejectMessage','ContactId','sequelize'];(function(_0x273687,_0x42ca91){var _0x32888c=function(_0x5c57e0){while(--_0x5c57e0){_0x273687['push'](_0x273687['shift']());}};_0x32888c(++_0x42ca91);}(_0x8dcc,0x151));var _0xc8dc=function(_0x1e06c0,_0x3c8d32){_0x1e06c0=_0x1e06c0-0x0;var _0x20a073=_0x8dcc[_0x1e06c0];return _0x20a073;};'use strict';var emlformat=require(_0xc8dc('0x0'));var moment=require(_0xc8dc('0x1'));var BPromise=require('bluebird');var util=require(_0xc8dc('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xc8dc('0x3'));var Redis=require(_0xc8dc('0x4'));var htmlToText=require(_0xc8dc('0x5'));var qs=require(_0xc8dc('0x6'));var logger=require('../../config/logger')(_0xc8dc('0x7'));var interaction_log=require('../../config/logger')(_0xc8dc('0x8'));var config=require(_0xc8dc('0x9'));var db=require(_0xc8dc('0xa'))['db'];config['redis']=_[_0xc8dc('0xb')](config[_0xc8dc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc8dc('0xd'))(new Redis(config['redis']));require(_0xc8dc('0xe'))[_0xc8dc('0xf')](socket);var jayson=require(_0xc8dc('0x10'));var client=jayson['client'][_0xc8dc('0x11')]({'port':0x232c});var client9003=jayson[_0xc8dc('0x12')][_0xc8dc('0x11')]({'port':0x232b});var client9002=jayson[_0xc8dc('0x12')][_0xc8dc('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x1745f9,_0x25661b,_0x6588a5,_0xe7fc66){return new BPromise(function(_0x1b0bae,_0x39c2c4){var _0x15947d=_0xe7fc66||client;return _0x15947d[_0xc8dc('0x13')](_0x1745f9,_0x6588a5)[_0xc8dc('0x14')](function(_0x45c498){logger[_0xc8dc('0x15')]('MailMessage,\x20%s,\x20%s',_0x25661b,_0xc8dc('0x16'));logger[_0xc8dc('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x25661b,'request\x20sent',JSON[_0xc8dc('0x18')](_0x45c498));if(_0x45c498[_0xc8dc('0x19')]){if(_0x45c498['error'][_0xc8dc('0x1a')]===0x1f4){logger[_0xc8dc('0x19')]('MailMessage,\x20%s,\x20%s',_0x25661b,_0x45c498[_0xc8dc('0x19')][_0xc8dc('0x1b')]);return _0x39c2c4(_0x45c498[_0xc8dc('0x19')][_0xc8dc('0x1b')]);}logger[_0xc8dc('0x19')](_0xc8dc('0x1c'),_0x25661b,_0x45c498['error'][_0xc8dc('0x1b')]);return _0x1b0bae(_0x45c498['error'][_0xc8dc('0x1b')]);}else{logger[_0xc8dc('0x15')](_0xc8dc('0x1c'),_0x25661b,_0xc8dc('0x16'));_0x1b0bae(_0x45c498['result'][_0xc8dc('0x1b')]);}})[_0xc8dc('0x1d')](function(_0x156200){logger[_0xc8dc('0x19')](_0xc8dc('0x1c'),_0x25661b,_0x156200);_0x39c2c4(_0x156200);});});}function respondWithResult(_0x354158,_0x6e71d7){_0x6e71d7=_0x6e71d7||0xc8;return function(_0x5acaf7){if(_0x5acaf7){return _0x354158[_0xc8dc('0x1e')](_0x6e71d7)['json'](_0x5acaf7);}};}function respondWithFilteredResult(_0x43e3f4,_0x10e370){return function(_0xf74cc9){if(_0xf74cc9){var _0x2972ea=typeof _0x10e370[_0xc8dc('0x1f')]===_0xc8dc('0x20')&&typeof _0x10e370[_0xc8dc('0x21')]===_0xc8dc('0x20');var _0x38a89e=_0xf74cc9['count'];var _0x56b02e=_0x2972ea?0x0:_0x10e370[_0xc8dc('0x1f')];var _0x257e49=_0x2972ea?_0xf74cc9[_0xc8dc('0x22')]:_0x10e370[_0xc8dc('0x1f')]+_0x10e370[_0xc8dc('0x21')];var _0x3e4411;if(_0x257e49>=_0x38a89e){_0x257e49=_0x38a89e;_0x3e4411=0xc8;}else{_0x3e4411=0xce;}_0x43e3f4['status'](_0x3e4411);return _0x43e3f4['set'](_0xc8dc('0x23'),_0x56b02e+'-'+_0x257e49+'/'+_0x38a89e)[_0xc8dc('0x24')](_0xf74cc9);}return null;};}function saveUpdates(_0x4853a0){return function(_0xd64c6e){if(_0xd64c6e){return _0xd64c6e[_0xc8dc('0x25')](_0x4853a0)[_0xc8dc('0x14')](function(_0x23b908){return _0x23b908;});}return null;};}function removeEntity(_0x46e91f){return function(_0x36e247){if(_0x36e247){return _0x36e247[_0xc8dc('0x26')]()[_0xc8dc('0x14')](function(){_0x46e91f[_0xc8dc('0x1e')](0xcc)[_0xc8dc('0x27')]();});}};}function handleEntityNotFound(_0xc3af6){return function(_0x5ef2e6){if(!_0x5ef2e6){_0xc3af6[_0xc8dc('0x28')](0x194);}return _0x5ef2e6;};}function handleError(_0x58f749,_0x15b446){_0x15b446=_0x15b446||0x1f4;return function(_0x45c3a2){logger[_0xc8dc('0x19')](_0x45c3a2['stack']);if(_0x45c3a2[_0xc8dc('0x29')]){delete _0x45c3a2['name'];}_0x58f749[_0xc8dc('0x1e')](_0x15b446)[_0xc8dc('0x2a')](_0x45c3a2);};}exports[_0xc8dc('0x2b')]=function(_0x16eb43,_0x100ac9){var _0x3f6edb={},_0x311e03={},_0x5edf89={'count':0x0,'rows':[]};var _0x56d953=_[_0xc8dc('0x2c')](db[_0xc8dc('0x2d')][_0xc8dc('0x2e')],function(_0x57f079){return{'name':_0x57f079[_0xc8dc('0x2f')],'type':_0x57f079['type'][_0xc8dc('0x30')]};});_0x311e03[_0xc8dc('0x31')]=_[_0xc8dc('0x2c')](_0x56d953,'name');_0x311e03[_0xc8dc('0x32')]=_[_0xc8dc('0x33')](_0x16eb43[_0xc8dc('0x32')]);_0x311e03[_0xc8dc('0x34')]=_[_0xc8dc('0x35')](_0x311e03[_0xc8dc('0x31')],_0x311e03[_0xc8dc('0x32')]);_0x3f6edb[_0xc8dc('0x36')]=_[_0xc8dc('0x35')](_0x311e03['model'],qs[_0xc8dc('0x37')](_0x16eb43[_0xc8dc('0x32')][_0xc8dc('0x37')]));_0x3f6edb[_0xc8dc('0x36')]=_0x3f6edb[_0xc8dc('0x36')][_0xc8dc('0x38')]?_0x3f6edb[_0xc8dc('0x36')]:_0x311e03[_0xc8dc('0x31')];if(!_0x16eb43[_0xc8dc('0x32')]['hasOwnProperty'](_0xc8dc('0x39'))){_0x3f6edb[_0xc8dc('0x21')]=qs['limit'](_0x16eb43['query'][_0xc8dc('0x21')]);_0x3f6edb[_0xc8dc('0x1f')]=qs['offset'](_0x16eb43[_0xc8dc('0x32')]['offset']);}_0x3f6edb['order']=qs['sort'](_0x16eb43['query'][_0xc8dc('0x3a')]);_0x3f6edb[_0xc8dc('0x3b')]=qs[_0xc8dc('0x34')](_[_0xc8dc('0x3c')](_0x16eb43[_0xc8dc('0x32')],_0x311e03['filters']),_0x56d953);if(_0x16eb43['query']['filter']){_0x3f6edb[_0xc8dc('0x3b')]=_[_0xc8dc('0x3d')](_0x3f6edb[_0xc8dc('0x3b')],{'$or':_['map'](_0x56d953,function(_0x1b2213){if(_0x1b2213[_0xc8dc('0x3e')]!==_0xc8dc('0x3f')){var _0xd9553f={};_0xd9553f[_0x1b2213[_0xc8dc('0x29')]]={'$like':'%'+_0x16eb43['query']['filter']+'%'};return _0xd9553f;}})});}_0x3f6edb=_[_0xc8dc('0x3d')]({},_0x3f6edb,_0x16eb43[_0xc8dc('0x40')]);var _0x4b8bc2={'where':_0x3f6edb[_0xc8dc('0x3b')]};return db[_0xc8dc('0x2d')][_0xc8dc('0x22')](_0x4b8bc2)[_0xc8dc('0x14')](function(_0x58d779){_0x5edf89[_0xc8dc('0x22')]=_0x58d779;if(_0x16eb43[_0xc8dc('0x32')][_0xc8dc('0x41')]){_0x3f6edb[_0xc8dc('0x42')]=[{'all':!![]}];}return db[_0xc8dc('0x2d')][_0xc8dc('0x43')](_0x3f6edb);})['then'](function(_0x3bb733){_0x5edf89['rows']=_0x3bb733;return _0x5edf89;})[_0xc8dc('0x14')](respondWithFilteredResult(_0x100ac9,_0x3f6edb))['catch'](handleError(_0x100ac9,null));};exports[_0xc8dc('0x44')]=function(_0x3c2298,_0x451086){var _0x3984ba={'raw':!![],'where':{'id':_0x3c2298[_0xc8dc('0x45')]['id']}},_0x1035d8={};_0x1035d8[_0xc8dc('0x31')]=_[_0xc8dc('0x33')](db[_0xc8dc('0x2d')][_0xc8dc('0x2e')]);_0x1035d8[_0xc8dc('0x32')]=_['keys'](_0x3c2298['query']);_0x1035d8[_0xc8dc('0x34')]=_[_0xc8dc('0x35')](_0x1035d8[_0xc8dc('0x31')],_0x1035d8[_0xc8dc('0x32')]);_0x3984ba[_0xc8dc('0x36')]=_[_0xc8dc('0x35')](_0x1035d8['model'],qs[_0xc8dc('0x37')](_0x3c2298[_0xc8dc('0x32')][_0xc8dc('0x37')]));_0x3984ba[_0xc8dc('0x36')]=_0x3984ba['attributes'][_0xc8dc('0x38')]?_0x3984ba[_0xc8dc('0x36')]:_0x1035d8[_0xc8dc('0x31')];if(_0x3c2298[_0xc8dc('0x32')][_0xc8dc('0x41')]){_0x3984ba[_0xc8dc('0x42')]=[{'all':!![]}];}_0x3984ba=_[_0xc8dc('0x3d')]({},_0x3984ba,_0x3c2298['options']);return db[_0xc8dc('0x2d')][_0xc8dc('0x46')](_0x3984ba)['then'](handleEntityNotFound(_0x451086,null))[_0xc8dc('0x14')](respondWithResult(_0x451086,null))[_0xc8dc('0x1d')](handleError(_0x451086,null));};exports[_0xc8dc('0x25')]=function(_0x234ab,_0x400937){if(_0x234ab['body']['id']){delete _0x234ab[_0xc8dc('0x47')]['id'];}return db[_0xc8dc('0x2d')][_0xc8dc('0x46')]({'where':{'id':_0x234ab[_0xc8dc('0x45')]['id']}})[_0xc8dc('0x14')](handleEntityNotFound(_0x400937,null))[_0xc8dc('0x14')](saveUpdates(_0x234ab[_0xc8dc('0x47')],null))[_0xc8dc('0x14')](respondWithResult(_0x400937,null))[_0xc8dc('0x1d')](handleError(_0x400937,null));};exports[_0xc8dc('0x26')]=function(_0xb6a2d7,_0x53e9ad){return db[_0xc8dc('0x2d')][_0xc8dc('0x46')]({'where':{'id':_0xb6a2d7['params']['id']}})[_0xc8dc('0x14')](handleEntityNotFound(_0x53e9ad,null))[_0xc8dc('0x14')](removeEntity(_0x53e9ad,null))[_0xc8dc('0x1d')](handleError(_0x53e9ad,null));};exports['describe']=function(_0x52a440,_0x2dd388){return db['MailMessage'][_0xc8dc('0x48')]()[_0xc8dc('0x14')](respondWithResult(_0x2dd388,null))['catch'](handleError(_0x2dd388,null));};exports[_0xc8dc('0x49')]=function(_0x288b72,_0x3941dd){return db[_0xc8dc('0x2d')]['create'](_0x288b72[_0xc8dc('0x47')])['then'](function(_0x136a96){if(_0x136a96){if(_0x136a96[_0xc8dc('0x4a')]===_0xc8dc('0x4b')&&!_0x136a96[_0xc8dc('0x4c')]){var _0x388e21,_0x5a8599,_0x4cd403;if(_0x288b72[_0xc8dc('0x47')]['to']){_0x5a8599=_0x288b72[_0xc8dc('0x47')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xc8dc('0x4d')]({'where':{'id':_0x136a96[_0xc8dc('0x4e')]},'include':[{'model':db[_0xc8dc('0x4f')],'as':'List','include':[{'model':db[_0xc8dc('0x50')],'as':_0xc8dc('0x51'),'where':{'email':_0x5a8599},'limit':0x1,'order':[['updatedAt',_0xc8dc('0x52')]]}]},{'model':db[_0xc8dc('0x53')],'as':_0xc8dc('0x54'),'raw':!![]}]})['then'](function(_0x54c1ca){_0x388e21=_0x54c1ca;if(_0x388e21&&_0x388e21['Smtp']){var _0x4cc6bf={'tls':{'rejectUnauthorized':![]}};if(_[_0xc8dc('0x55')](_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x56')])){_0x4cc6bf[_0xc8dc('0x57')]=_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x57')];_0x4cc6bf['port']=_0x388e21['Smtp'][_0xc8dc('0x58')];_0x4cc6bf[_0xc8dc('0x59')]=_0x388e21[_0xc8dc('0x54')]['secure'];if(_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x5a')]){_0x4cc6bf[_0xc8dc('0x5b')]={'user':_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x5c')],'pass':_0x388e21[_0xc8dc('0x54')]['pass']};}}else{_0x4cc6bf[_0xc8dc('0x56')]=_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x56')];_0x4cc6bf['auth']={'user':_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x5c')],'pass':_0x388e21[_0xc8dc('0x54')][_0xc8dc('0x5d')]};_0x4cc6bf[_0xc8dc('0x59')]=_0x388e21[_0xc8dc('0x54')]['secure'];}if(_0x288b72['body'][_0xc8dc('0x5e')]&&_0x288b72[_0xc8dc('0x47')][_0xc8dc('0x5e')][_0xc8dc('0x38')]){for(var _0x3520e3=0x0;_0x3520e3<_0x288b72['body'][_0xc8dc('0x5e')][_0xc8dc('0x38')];_0x3520e3+=0x1){_0x288b72[_0xc8dc('0x47')][_0xc8dc('0x5e')][_0x3520e3]={'filename':_0x288b72[_0xc8dc('0x47')]['attachments'][_0x3520e3]['name'],'path':path['join'](config[_0xc8dc('0x5f')],_0xc8dc('0x60'),_0x288b72[_0xc8dc('0x47')][_0xc8dc('0x5e')][_0x3520e3]['basename'])};}}_0x4cd403={'account':_0x4cc6bf,'message':_0x288b72['body']};return;}})[_0xc8dc('0x14')](function(){if(_0x388e21[_0xc8dc('0x61')]){if(_0x388e21[_0xc8dc('0x61')]['Contacts'][_0xc8dc('0x38')]){return _0x388e21[_0xc8dc('0x61')][_0xc8dc('0x51')][0x0];}else{return db[_0xc8dc('0x50')][_0xc8dc('0x49')](_[_0xc8dc('0xb')](_0x288b72['body'],{'firstName':_0x288b72['body']['to'],'email':_0x288b72[_0xc8dc('0x47')]['to'],'phone':_0x288b72[_0xc8dc('0x47')]['to'],'ListId':_0x388e21[_0xc8dc('0x62')]}));}}else{throw new Error(_0xc8dc('0x63'));}})[_0xc8dc('0x14')](function(){if(_0x4cd403){return respondWithRpcPromise(_0xc8dc('0x64'),_0xc8dc('0x65'),_0x4cd403,client9003)[_0xc8dc('0x14')](function(_0x2d9fbe){return _0x136a96[_0xc8dc('0x25')]({'read':!![],'messageId':_0x2d9fbe[_0xc8dc('0x66')],'sentAt':moment()[_0xc8dc('0x67')](_0xc8dc('0x68'))});})[_0xc8dc('0x1d')](function(_0x372142){logger[_0xc8dc('0x19')]('%s',JSON['stringify'](_0x372142));return _0x136a96;});}return _0x136a96;});}return _0x136a96;}})[_0xc8dc('0x14')](respondWithResult(_0x3941dd,0xc9))[_0xc8dc('0x1d')](handleError(_0x3941dd,null));};exports[_0xc8dc('0x69')]=function(_0x406289,_0x3745e6){var _0x536737={'agent':{},'channel':_0xc8dc('0x6a')};if(_0x406289['body']['id']){delete _0x406289[_0xc8dc('0x47')]['id'];}_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6b')]=!![];_0x406289[_0xc8dc('0x47')]['readAt']=moment()[_0xc8dc('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6c')]=_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6c')]||_0x406289[_0xc8dc('0x5c')]['id'];_0x536737[_0xc8dc('0x6d')]['id']=_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6c')];return db['MailMessage']['find']({'where':{'id':_0x406289[_0xc8dc('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3745e6,null))[_0xc8dc('0x14')](saveUpdates(_0x406289[_0xc8dc('0x47')],null))[_0xc8dc('0x14')](function(_0x4cbfa2){if(_0x4cbfa2){_0x536737[_0xc8dc('0x1b')]=_0x4cbfa2[_0xc8dc('0x6e')]({'plain':!![]});return db['MailInteraction'][_0xc8dc('0x46')]({'where':{'id':_0x4cbfa2['MailInteractionId']}});}return null;})[_0xc8dc('0x14')](handleEntityNotFound(_0x3745e6,null))[_0xc8dc('0x14')](function(_0x517f6c){if(_0x517f6c){return _0x517f6c[_0xc8dc('0x25')]({'UserId':_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6c')],'read1stAt':_[_0xc8dc('0x55')](_0x517f6c[_0xc8dc('0x6f')])?moment()[_0xc8dc('0x67')](_0xc8dc('0x68')):undefined});}return null;})['then'](function(_0x5c6b42){if(_0x5c6b42){_0x536737[_0xc8dc('0x70')]=_0x5c6b42[_0xc8dc('0x6e')]({'plain':!![]});interaction_log[_0xc8dc('0x15')](_0xc8dc('0x71'),_0x406289[_0xc8dc('0x5c')]['id'],_0x406289[_0xc8dc('0x5c')][_0xc8dc('0x29')],_0x406289['user'][_0xc8dc('0x72')],_0x536737['interaction']['id'],_0x406289[_0xc8dc('0x47')]?JSON['stringify'](_0x406289[_0xc8dc('0x47')]):_0xc8dc('0x73'));return respondWithRpcPromise(_0xc8dc('0x74'),_0xc8dc('0x75'),_0x536737);}return null;})[_0xc8dc('0x14')](function(_0x3d1b6f){var _0x106125=_0xc8dc('0x76')+_0x3d1b6f[_0xc8dc('0x1b')]['ContactId'];return db['sequelize']['query'](_0x106125,{'type':db[_0xc8dc('0x77')][_0xc8dc('0x78')]['SELECT'],'raw':!![]})[_0xc8dc('0x14')](function(_0x46678f){return _0x46678f;});})['then'](function(_0x2a9d75){if(_0x2a9d75){_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x79')]=_0x2a9d75[0x0];if(!_0x406289[_0xc8dc('0x47')]['UserId'])return;return db[_0xc8dc('0x7a')][_0xc8dc('0x46')]({'where':{'id':_0x406289[_0xc8dc('0x47')][_0xc8dc('0x6c')],'role':_0xc8dc('0x6d')},'attributes':['id',_0xc8dc('0x29'),'fullname',_0xc8dc('0x7b'),_0xc8dc('0x7c')],'raw':!![]});}return null;})[_0xc8dc('0x14')](function(_0x3e8c69){if(!_0x3e8c69)return null;_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x6d')]=_0x3e8c69;return _0x536737;})[_0xc8dc('0x14')](function(_0x109a7f){if(_0x109a7f){if(_0x406289['body'][_0xc8dc('0x7d')]){_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x7e')]=util[_0xc8dc('0x67')](_0xc8dc('0x7f'),_0x406289[_0xc8dc('0x5c')][_0xc8dc('0x29')]);_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x80')]=_0x536737[_0xc8dc('0x80')];_0x536737[_0xc8dc('0x1b')]['motionChannel']=_0x536737['channel'];_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x81')]=_0xc8dc('0x69');_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x47')]=htmlToText[_0xc8dc('0x82')](_0x536737[_0xc8dc('0x1b')][_0xc8dc('0x47')]);return respondWithRpcPromise(_0xc8dc('0x83'),_0xc8dc('0x83'),{'event':'acceptmessage','message':_0x536737[_0xc8dc('0x1b')]},client9002)['then'](function(){return _0x536737;});}return _0x536737;}return null;})['then'](respondWithResult(_0x3745e6,null))[_0xc8dc('0x1d')](handleError(_0x3745e6,null));};exports[_0xc8dc('0x84')]=function(_0x5379d9,_0x30796b){var _0x3acc9f={'agent':{},'channel':_0xc8dc('0x6a')};if(_0x5379d9[_0xc8dc('0x47')]['id']){delete _0x5379d9[_0xc8dc('0x47')]['id'];}_0x5379d9[_0xc8dc('0x47')]['UserId']=_0x5379d9[_0xc8dc('0x47')][_0xc8dc('0x6c')]||_0x5379d9[_0xc8dc('0x5c')]['id'];_0x3acc9f[_0xc8dc('0x6d')]['id']=_0x5379d9[_0xc8dc('0x47')][_0xc8dc('0x6c')];return db[_0xc8dc('0x2d')][_0xc8dc('0x46')]({'where':{'id':_0x5379d9[_0xc8dc('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30796b,null))[_0xc8dc('0x14')](function(_0xe2753){if(_0xe2753){_0x3acc9f[_0xc8dc('0x1b')]=_0xe2753['get']({'plain':!![]});return db[_0xc8dc('0x85')]['find']({'where':{'id':_0xe2753['MailInteractionId']}});}return null;})[_0xc8dc('0x14')](handleEntityNotFound(_0x30796b,null))[_0xc8dc('0x14')](function(_0x461c8c){if(_0x461c8c){_0x3acc9f[_0xc8dc('0x70')]=_0x461c8c[_0xc8dc('0x6e')]({'plain':!![]});interaction_log[_0xc8dc('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5379d9[_0xc8dc('0x5c')]['id'],_0x5379d9[_0xc8dc('0x5c')][_0xc8dc('0x29')],_0x5379d9[_0xc8dc('0x5c')][_0xc8dc('0x72')],_0x3acc9f[_0xc8dc('0x70')]['id'],_0x5379d9[_0xc8dc('0x47')]?JSON[_0xc8dc('0x18')](_0x5379d9[_0xc8dc('0x47')]):_0xc8dc('0x73'));return respondWithRpcPromise(_0xc8dc('0x86'),'rejectMessage',_0x3acc9f);}return null;})['then'](function(_0x4a9c75){var _0x10dcc0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a9c75[_0xc8dc('0x1b')][_0xc8dc('0x87')];return db[_0xc8dc('0x88')][_0xc8dc('0x32')](_0x10dcc0,{'type':db[_0xc8dc('0x77')][_0xc8dc('0x78')][_0xc8dc('0x89')],'raw':!![]})[_0xc8dc('0x14')](function(_0x351249){return _0x351249;});})['then'](function(_0x1b2c06){if(_0x1b2c06){_0x3acc9f[_0xc8dc('0x1b')][_0xc8dc('0x79')]=_0x1b2c06[0x0];if(!_0x5379d9[_0xc8dc('0x47')]['UserId'])return;return db[_0xc8dc('0x7a')][_0xc8dc('0x46')]({'where':{'id':_0x5379d9[_0xc8dc('0x47')][_0xc8dc('0x6c')],'role':'agent'},'attributes':['id',_0xc8dc('0x29'),_0xc8dc('0x8a'),_0xc8dc('0x7b'),_0xc8dc('0x7c')],'raw':!![]});}return null;})[_0xc8dc('0x14')](function(_0x527d7b){if(!_0x527d7b)return null;_0x3acc9f['message']['agent']=_0x527d7b;return _0x3acc9f;})[_0xc8dc('0x14')](function(_0x447258){if(_0x447258){_0x447258[_0xc8dc('0x1b')]['interface']=util['format'](_0xc8dc('0x7f'),_0x5379d9['user'][_0xc8dc('0x29')]);_0x447258[_0xc8dc('0x1b')][_0xc8dc('0x80')]=_0x3acc9f[_0xc8dc('0x80')];_0x447258['message'][_0xc8dc('0x8b')]=_0x3acc9f['channel'];_0x447258[_0xc8dc('0x1b')][_0xc8dc('0x81')]=_0xc8dc('0x84');_0x447258[_0xc8dc('0x1b')][_0xc8dc('0x47')]=htmlToText[_0xc8dc('0x82')](_0x3acc9f['message']['body']);respondWithRpcPromise(_0xc8dc('0x83'),'EventManager',{'event':'rejectmessage','message':_0x447258[_0xc8dc('0x1b')]},client9002);return _0x3acc9f;}return null;})[_0xc8dc('0x14')](respondWithResult(_0x30796b,null))['catch'](handleError(_0x30796b,null));};exports[_0xc8dc('0x8c')]=function(_0x77cf6e,_0x3670ed){var _0x3994a2=moment()['unix']()[_0xc8dc('0x8d')]();var _0x155703=path[_0xc8dc('0x8e')](config[_0xc8dc('0x5f')],_0xc8dc('0x8f'),_0xc8dc('0x90'),'tmp');var _0x4e4d1b=path[_0xc8dc('0x8e')](config[_0xc8dc('0x5f')],'server',_0xc8dc('0x90'),_0xc8dc('0x5e'));var _0x264d9f=util[_0xc8dc('0x67')](_0xc8dc('0x91'),_0x3994a2);return db[_0xc8dc('0x2d')][_0xc8dc('0x46')]({'where':{'id':_0x77cf6e['params']['id']},'attributes':['id',_0xc8dc('0x47'),_0xc8dc('0x92'),'to','cc','bcc',_0xc8dc('0x93'),_0xc8dc('0x94')],'include':_0x77cf6e[_0xc8dc('0x32')][_0xc8dc('0x5e')]?[{'model':db[_0xc8dc('0x95')],'as':_0xc8dc('0x96')}]:undefined})[_0xc8dc('0x14')](handleEntityNotFound(_0x3670ed,null))[_0xc8dc('0x14')](function(_0x1f72af){if(_0x1f72af){var _0x5799b2=_0x1f72af;var _0x5a4fdc={'from':_0x5799b2[_0xc8dc('0x92')],'to':_0x5799b2['to'],'subject':_0x5799b2['subject'],'html':_0x5799b2['body'],'headers':{'Date':moment(_0x5799b2[_0xc8dc('0x94')])[_0xc8dc('0x67')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1f72af['cc']){_0x5a4fdc[_0xc8dc('0x97')]['Cc']=_0x1f72af['cc'];}if(_0x1f72af[_0xc8dc('0x98')]){_0x5a4fdc['headers']['Bcc']=_0x1f72af[_0xc8dc('0x98')];}return new BPromise(function(_0x1def01,_0x5a0248){if(_0x1f72af['Attachments']){for(var _0xba0456=0x0;_0xba0456<_0x1f72af[_0xc8dc('0x96')][_0xc8dc('0x38')];_0xba0456++){var _0x52e475=_0x1f72af[_0xc8dc('0x96')][_0xba0456];var _0x6ef237=path[_0xc8dc('0x8e')](_0x4e4d1b,_0x52e475[_0xc8dc('0x99')]);if(fs[_0xc8dc('0x9a')](_0x6ef237)){_0x5a4fdc[_0xc8dc('0x5e')]['push']({'name':_0x52e475[_0xc8dc('0x29')],'contentType':_0x52e475['type'],'data':fs[_0xc8dc('0x9b')](_0x6ef237)});}}}emlformat[_0xc8dc('0x9c')](_0x5a4fdc,function(_0x3e82f8,_0x4faa70){if(_0x3e82f8)return _0x5a0248(_0x3e82f8);fs[_0xc8dc('0x9d')](path[_0xc8dc('0x8e')](_0x155703,_0x264d9f),_0x4faa70);return _0x1def01(_0x4faa70);});});}})['then'](function(_0x2ed812){if(_0x2ed812){return _0x3670ed[_0xc8dc('0x8c')](path[_0xc8dc('0x8e')](_0x155703,_0x264d9f),_0x264d9f,function(_0x36d163){if(!_0x36d163)fs['unlinkSync'](path[_0xc8dc('0x8e')](_0x155703,_0x264d9f));});}})['catch'](handleError(_0x3670ed,null));}; \ No newline at end of file +var _0x92ca=['read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','format','channel','motionChannel','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','email','event','rejectmessage','files','tmp','server','from','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','existsSync','push','readFileSync','build','download','moment','util','path','lodash','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','catch','status','json','offset','undefined','count','limit','set','Content-Range','end','sendStatus','name','send','index','MailMessage','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','show','params','keys','rawAttributes','include','find','update','body','destroy','direction','out','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','defaults','ListId','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','mail'];(function(_0x10061b,_0x51277b){var _0x672211=function(_0x5e5d0e){while(--_0x5e5d0e){_0x10061b['push'](_0x10061b['shift']());}};_0x672211(++_0x51277b);}(_0x92ca,0x16c));var _0xa92c=function(_0x3d4a2b,_0xca71a8){_0x3d4a2b=_0x3d4a2b-0x0;var _0x5c55c6=_0x92ca[_0x3d4a2b];return _0x5c55c6;};'use strict';var emlformat=require('eml-format');var moment=require(_0xa92c('0x0'));var BPromise=require('bluebird');var util=require(_0xa92c('0x1'));var path=require(_0xa92c('0x2'));var fs=require('fs');var _=require(_0xa92c('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xa92c('0x4'))(_0xa92c('0x5'));var interaction_log=require('../../config/logger')(_0xa92c('0x6'));var config=require(_0xa92c('0x7'));var db=require(_0xa92c('0x8'))['db'];config[_0xa92c('0x9')]=_['defaults'](config['redis'],{'host':_0xa92c('0xa'),'port':0x18eb});var socket=require(_0xa92c('0xb'))(new Redis(config['redis']));require(_0xa92c('0xc'))[_0xa92c('0xd')](socket);var jayson=require(_0xa92c('0xe'));var client=jayson[_0xa92c('0xf')][_0xa92c('0x10')]({'port':0x232c});var client9003=jayson[_0xa92c('0xf')][_0xa92c('0x10')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x145c12,_0x3ad3d0,_0x1a1fb4,_0x319e0c){return new BPromise(function(_0x21be49,_0x3ea74a){var _0x5476e1=_0x319e0c||client;return _0x5476e1[_0xa92c('0x11')](_0x145c12,_0x1a1fb4)[_0xa92c('0x12')](function(_0x3aa338){logger['info'](_0xa92c('0x13'),_0x3ad3d0,'request\x20sent');logger[_0xa92c('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3ad3d0,'request\x20sent',JSON['stringify'](_0x3aa338));if(_0x3aa338[_0xa92c('0x15')]){if(_0x3aa338[_0xa92c('0x15')][_0xa92c('0x16')]===0x1f4){logger[_0xa92c('0x15')](_0xa92c('0x13'),_0x3ad3d0,_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);return _0x3ea74a(_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3ad3d0,_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);return _0x21be49(_0x3aa338['error'][_0xa92c('0x17')]);}else{logger[_0xa92c('0x18')](_0xa92c('0x13'),_0x3ad3d0,_0xa92c('0x19'));_0x21be49(_0x3aa338['result']['message']);}})[_0xa92c('0x1a')](function(_0x42b18f){logger[_0xa92c('0x15')](_0xa92c('0x13'),_0x3ad3d0,_0x42b18f);_0x3ea74a(_0x42b18f);});});}function respondWithResult(_0x587384,_0xc359){_0xc359=_0xc359||0xc8;return function(_0x597bd8){if(_0x597bd8){return _0x587384[_0xa92c('0x1b')](_0xc359)[_0xa92c('0x1c')](_0x597bd8);}};}function respondWithFilteredResult(_0x53f767,_0x9c1f70){return function(_0x144acc){if(_0x144acc){var _0x31dd31=typeof _0x9c1f70[_0xa92c('0x1d')]===_0xa92c('0x1e')&&typeof _0x9c1f70['limit']===_0xa92c('0x1e');var _0xc3c557=_0x144acc[_0xa92c('0x1f')];var _0x13ea30=_0x31dd31?0x0:_0x9c1f70[_0xa92c('0x1d')];var _0x548099=_0x31dd31?_0x144acc[_0xa92c('0x1f')]:_0x9c1f70[_0xa92c('0x1d')]+_0x9c1f70[_0xa92c('0x20')];var _0x947a95;if(_0x548099>=_0xc3c557){_0x548099=_0xc3c557;_0x947a95=0xc8;}else{_0x947a95=0xce;}_0x53f767[_0xa92c('0x1b')](_0x947a95);return _0x53f767[_0xa92c('0x21')](_0xa92c('0x22'),_0x13ea30+'-'+_0x548099+'/'+_0xc3c557)[_0xa92c('0x1c')](_0x144acc);}return null;};}function saveUpdates(_0x53b001){return function(_0x4e8fe5){if(_0x4e8fe5){return _0x4e8fe5['update'](_0x53b001)[_0xa92c('0x12')](function(_0xb9bf25){return _0xb9bf25;});}return null;};}function removeEntity(_0x395b8e){return function(_0x40121a){if(_0x40121a){return _0x40121a['destroy']()['then'](function(){_0x395b8e[_0xa92c('0x1b')](0xcc)[_0xa92c('0x23')]();});}};}function handleEntityNotFound(_0x151f85){return function(_0x1fd8a0){if(!_0x1fd8a0){_0x151f85[_0xa92c('0x24')](0x194);}return _0x1fd8a0;};}function handleError(_0x3bf50c,_0x53bb95){_0x53bb95=_0x53bb95||0x1f4;return function(_0x3d52bc){logger['error'](_0x3d52bc['stack']);if(_0x3d52bc[_0xa92c('0x25')]){delete _0x3d52bc['name'];}_0x3bf50c[_0xa92c('0x1b')](_0x53bb95)[_0xa92c('0x26')](_0x3d52bc);};}exports[_0xa92c('0x27')]=function(_0x333800,_0x186681){var _0x10203a={},_0x4eb9a7={},_0x3e4ffa={'count':0x0,'rows':[]};var _0x248282=_['map'](db[_0xa92c('0x28')]['rawAttributes'],function(_0xfa5c6d){return{'name':_0xfa5c6d[_0xa92c('0x29')],'type':_0xfa5c6d[_0xa92c('0x2a')][_0xa92c('0x2b')]};});_0x4eb9a7[_0xa92c('0x2c')]=_[_0xa92c('0x2d')](_0x248282,_0xa92c('0x25'));_0x4eb9a7[_0xa92c('0x2e')]=_['keys'](_0x333800[_0xa92c('0x2e')]);_0x4eb9a7[_0xa92c('0x2f')]=_[_0xa92c('0x30')](_0x4eb9a7[_0xa92c('0x2c')],_0x4eb9a7['query']);_0x10203a[_0xa92c('0x31')]=_['intersection'](_0x4eb9a7[_0xa92c('0x2c')],qs[_0xa92c('0x32')](_0x333800[_0xa92c('0x2e')][_0xa92c('0x32')]));_0x10203a[_0xa92c('0x31')]=_0x10203a['attributes'][_0xa92c('0x33')]?_0x10203a[_0xa92c('0x31')]:_0x4eb9a7[_0xa92c('0x2c')];if(!_0x333800[_0xa92c('0x2e')]['hasOwnProperty'](_0xa92c('0x34'))){_0x10203a[_0xa92c('0x20')]=qs[_0xa92c('0x20')](_0x333800['query'][_0xa92c('0x20')]);_0x10203a['offset']=qs[_0xa92c('0x1d')](_0x333800[_0xa92c('0x2e')][_0xa92c('0x1d')]);}_0x10203a[_0xa92c('0x35')]=qs['sort'](_0x333800['query'][_0xa92c('0x36')]);_0x10203a[_0xa92c('0x37')]=qs[_0xa92c('0x2f')](_[_0xa92c('0x38')](_0x333800[_0xa92c('0x2e')],_0x4eb9a7[_0xa92c('0x2f')]),_0x248282);if(_0x333800[_0xa92c('0x2e')][_0xa92c('0x39')]){_0x10203a[_0xa92c('0x37')]=_[_0xa92c('0x3a')](_0x10203a['where'],{'$or':_[_0xa92c('0x2d')](_0x248282,function(_0x3cb221){if(_0x3cb221[_0xa92c('0x2a')]!==_0xa92c('0x3b')){var _0x35bb1e={};_0x35bb1e[_0x3cb221['name']]={'$like':'%'+_0x333800[_0xa92c('0x2e')][_0xa92c('0x39')]+'%'};return _0x35bb1e;}})});}_0x10203a=_[_0xa92c('0x3a')]({},_0x10203a,_0x333800[_0xa92c('0x3c')]);var _0x5bcae1={'where':_0x10203a[_0xa92c('0x37')]};return db[_0xa92c('0x28')][_0xa92c('0x1f')](_0x5bcae1)[_0xa92c('0x12')](function(_0x3f49ef){_0x3e4ffa[_0xa92c('0x1f')]=_0x3f49ef;if(_0x333800[_0xa92c('0x2e')]['includeAll']){_0x10203a['include']=[{'all':!![]}];}return db[_0xa92c('0x28')]['findAll'](_0x10203a);})[_0xa92c('0x12')](function(_0x4db20e){_0x3e4ffa['rows']=_0x4db20e;return _0x3e4ffa;})['then'](respondWithFilteredResult(_0x186681,_0x10203a))[_0xa92c('0x1a')](handleError(_0x186681,null));};exports[_0xa92c('0x3d')]=function(_0x334987,_0x45cd96){var _0x5e0891={'raw':!![],'where':{'id':_0x334987[_0xa92c('0x3e')]['id']}},_0x526bd6={};_0x526bd6['model']=_[_0xa92c('0x3f')](db[_0xa92c('0x28')][_0xa92c('0x40')]);_0x526bd6[_0xa92c('0x2e')]=_['keys'](_0x334987[_0xa92c('0x2e')]);_0x526bd6[_0xa92c('0x2f')]=_[_0xa92c('0x30')](_0x526bd6[_0xa92c('0x2c')],_0x526bd6[_0xa92c('0x2e')]);_0x5e0891[_0xa92c('0x31')]=_[_0xa92c('0x30')](_0x526bd6[_0xa92c('0x2c')],qs[_0xa92c('0x32')](_0x334987[_0xa92c('0x2e')]['fields']));_0x5e0891[_0xa92c('0x31')]=_0x5e0891[_0xa92c('0x31')][_0xa92c('0x33')]?_0x5e0891[_0xa92c('0x31')]:_0x526bd6['model'];if(_0x334987[_0xa92c('0x2e')]['includeAll']){_0x5e0891[_0xa92c('0x41')]=[{'all':!![]}];}_0x5e0891=_[_0xa92c('0x3a')]({},_0x5e0891,_0x334987[_0xa92c('0x3c')]);return db['MailMessage'][_0xa92c('0x42')](_0x5e0891)[_0xa92c('0x12')](handleEntityNotFound(_0x45cd96,null))[_0xa92c('0x12')](respondWithResult(_0x45cd96,null))[_0xa92c('0x1a')](handleError(_0x45cd96,null));};exports[_0xa92c('0x43')]=function(_0x59989a,_0xe8ef0e){if(_0x59989a['body']['id']){delete _0x59989a[_0xa92c('0x44')]['id'];}return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x59989a[_0xa92c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xe8ef0e,null))[_0xa92c('0x12')](saveUpdates(_0x59989a[_0xa92c('0x44')],null))[_0xa92c('0x12')](respondWithResult(_0xe8ef0e,null))[_0xa92c('0x1a')](handleError(_0xe8ef0e,null));};exports[_0xa92c('0x45')]=function(_0x55f1ad,_0x506392){return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x55f1ad[_0xa92c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x506392,null))[_0xa92c('0x12')](removeEntity(_0x506392,null))[_0xa92c('0x1a')](handleError(_0x506392,null));};exports['describe']=function(_0x2a1759,_0x3bfa89){return db[_0xa92c('0x28')]['describe']()[_0xa92c('0x12')](respondWithResult(_0x3bfa89,null))[_0xa92c('0x1a')](handleError(_0x3bfa89,null));};exports['create']=function(_0x271d4a,_0x8a3d49){return db['MailMessage']['create'](_0x271d4a[_0xa92c('0x44')])['then'](function(_0x333411){if(_0x333411){if(_0x333411[_0xa92c('0x46')]===_0xa92c('0x47')&&!_0x333411['secret']){var _0x54ed9c,_0x13d555,_0x59f37b;if(_0x271d4a[_0xa92c('0x44')]['to']){_0x13d555=_0x271d4a['body']['to'][_0xa92c('0x48')](',')[0x0];}return db['MailAccount'][_0xa92c('0x49')]({'where':{'id':_0x333411[_0xa92c('0x4a')]},'include':[{'model':db[_0xa92c('0x4b')],'as':_0xa92c('0x4c'),'include':[{'model':db[_0xa92c('0x4d')],'as':_0xa92c('0x4e'),'where':{'email':_0x13d555},'limit':0x1,'order':[[_0xa92c('0x4f'),_0xa92c('0x50')]]}]},{'model':db[_0xa92c('0x51')],'as':_0xa92c('0x52'),'raw':!![]}]})[_0xa92c('0x12')](function(_0x962048){_0x54ed9c=_0x962048;if(_0x54ed9c&&_0x54ed9c[_0xa92c('0x52')]){var _0x5a98cf={'tls':{'rejectUnauthorized':![]}};if(_[_0xa92c('0x53')](_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x54')])){_0x5a98cf[_0xa92c('0x55')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x55')];_0x5a98cf['port']=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x56')];_0x5a98cf[_0xa92c('0x57')]=_0x54ed9c['Smtp']['secure'];if(_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x58')]){_0x5a98cf[_0xa92c('0x59')]={'user':_0x54ed9c['Smtp'][_0xa92c('0x5a')],'pass':_0x54ed9c['Smtp'][_0xa92c('0x5b')]};}}else{_0x5a98cf[_0xa92c('0x54')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x54')];_0x5a98cf[_0xa92c('0x59')]={'user':_0x54ed9c[_0xa92c('0x52')]['user'],'pass':_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x5b')]};_0x5a98cf[_0xa92c('0x57')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x57')];}if(_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')]&&_0x271d4a[_0xa92c('0x44')]['attachments'][_0xa92c('0x33')]){for(var _0x23b829=0x0;_0x23b829<_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')][_0xa92c('0x33')];_0x23b829+=0x1){_0x271d4a['body'][_0xa92c('0x5c')][_0x23b829]={'filename':_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')][_0x23b829][_0xa92c('0x25')],'path':path[_0xa92c('0x5d')](config[_0xa92c('0x5e')],'server/files/attachments',_0x271d4a[_0xa92c('0x44')]['attachments'][_0x23b829]['basename'])};}}_0x59f37b={'account':_0x5a98cf,'message':_0x271d4a['body']};return;}})['then'](function(){if(_0x54ed9c[_0xa92c('0x4c')]){if(_0x54ed9c[_0xa92c('0x4c')][_0xa92c('0x4e')][_0xa92c('0x33')]){return _0x54ed9c[_0xa92c('0x4c')][_0xa92c('0x4e')][0x0];}else{return db[_0xa92c('0x4d')]['create'](_[_0xa92c('0x5f')](_0x271d4a[_0xa92c('0x44')],{'firstName':_0x271d4a[_0xa92c('0x44')]['to'],'email':_0x271d4a[_0xa92c('0x44')]['to'],'phone':_0x271d4a[_0xa92c('0x44')]['to'],'ListId':_0x54ed9c[_0xa92c('0x60')]}));}}else{throw new Error(_0xa92c('0x61'));}})[_0xa92c('0x12')](function(){if(_0x59f37b){return respondWithRpcPromise(_0xa92c('0x62'),'sendMail',_0x59f37b,client9003)[_0xa92c('0x12')](function(_0x26ed63){return _0x333411['update']({'read':!![],'messageId':_0x26ed63['messageId'],'sentAt':moment()['format'](_0xa92c('0x63'))});})[_0xa92c('0x1a')](function(_0x644b87){logger[_0xa92c('0x15')]('%s',JSON['stringify'](_0x644b87));return _0x333411;});}return _0x333411;});}return _0x333411;}})[_0xa92c('0x12')](respondWithResult(_0x8a3d49,0xc9))[_0xa92c('0x1a')](handleError(_0x8a3d49,null));};exports['accept']=function(_0xd6f76c,_0x4c8ec6){var _0x5b9917={'agent':{},'channel':_0xa92c('0x64')};if(_0xd6f76c[_0xa92c('0x44')]['id']){delete _0xd6f76c[_0xa92c('0x44')]['id'];}_0xd6f76c['body'][_0xa92c('0x65')]=!![];_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')]=_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')]||_0xd6f76c['user']['id'];_0x5b9917[_0xa92c('0x68')]['id']=_0xd6f76c['body'][_0xa92c('0x67')];return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0xd6f76c[_0xa92c('0x3e')]['id'],'UserId':null}})[_0xa92c('0x12')](handleEntityNotFound(_0x4c8ec6,null))[_0xa92c('0x12')](saveUpdates(_0xd6f76c[_0xa92c('0x44')],null))[_0xa92c('0x12')](function(_0x33ffcb){if(_0x33ffcb){_0x5b9917[_0xa92c('0x17')]=_0x33ffcb[_0xa92c('0x69')]({'plain':!![]});return db[_0xa92c('0x6a')][_0xa92c('0x42')]({'where':{'id':_0x33ffcb[_0xa92c('0x6b')]}});}return null;})[_0xa92c('0x12')](handleEntityNotFound(_0x4c8ec6,null))[_0xa92c('0x12')](function(_0x223628){if(_0x223628){return _0x223628[_0xa92c('0x43')]({'UserId':_0xd6f76c[_0xa92c('0x44')]['UserId'],'read1stAt':_[_0xa92c('0x53')](_0x223628[_0xa92c('0x6c')])?moment()['format'](_0xa92c('0x63')):undefined});}return null;})['then'](function(_0x14d782){if(_0x14d782){_0x5b9917[_0xa92c('0x6d')]=_0x14d782[_0xa92c('0x69')]({'plain':!![]});interaction_log[_0xa92c('0x18')](_0xa92c('0x6e'),_0xd6f76c[_0xa92c('0x5a')]['id'],_0xd6f76c[_0xa92c('0x5a')]['name'],_0xd6f76c[_0xa92c('0x5a')][_0xa92c('0x6f')],_0x5b9917['interaction']['id'],_0xd6f76c[_0xa92c('0x44')]?JSON[_0xa92c('0x70')](_0xd6f76c[_0xa92c('0x44')]):'null');return respondWithRpcPromise(_0xa92c('0x71'),_0xa92c('0x72'),_0x5b9917);}return null;})[_0xa92c('0x12')](function(_0x3ea24a){var _0x1f9f29=_0xa92c('0x73')+_0x3ea24a[_0xa92c('0x17')][_0xa92c('0x74')];return db[_0xa92c('0x75')][_0xa92c('0x2e')](_0x1f9f29,{'type':db[_0xa92c('0x76')][_0xa92c('0x77')][_0xa92c('0x78')],'raw':!![]})[_0xa92c('0x12')](function(_0x351af5){return _0x351af5;});})['then'](function(_0x1182b7){if(_0x1182b7){_0x5b9917[_0xa92c('0x17')][_0xa92c('0x79')]=_0x1182b7[0x0];if(!_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')])return;return db['User'][_0xa92c('0x42')]({'where':{'id':_0xd6f76c['body'][_0xa92c('0x67')],'role':'agent'},'attributes':['id',_0xa92c('0x25'),_0xa92c('0x7a'),'email',_0xa92c('0x7b')],'raw':!![]});}return null;})[_0xa92c('0x12')](function(_0x4c3b1a){if(!_0x4c3b1a)return null;_0x5b9917[_0xa92c('0x17')]['agent']=_0x4c3b1a;return _0x5b9917;})[_0xa92c('0x12')](function(_0x3d9144){if(_0x3d9144){if(_0xd6f76c['body']['manual']){_0x5b9917['message'][_0xa92c('0x7c')]=util[_0xa92c('0x7d')]('SIP/%s',_0xd6f76c[_0xa92c('0x5a')][_0xa92c('0x25')]);_0x5b9917[_0xa92c('0x17')]['channel']=_0x5b9917[_0xa92c('0x7e')];_0x5b9917[_0xa92c('0x17')][_0xa92c('0x7f')]=_0x5b9917['channel'];_0x5b9917['message']['event']='accept';_0x5b9917['message']['body']=htmlToText['fromString'](_0x5b9917[_0xa92c('0x17')]['body']);return respondWithRpcPromise(_0xa92c('0x80'),'EventManager',{'event':'acceptmessage','message':_0x5b9917['message']},client9002)[_0xa92c('0x12')](function(){return _0x5b9917;});}return _0x5b9917;}return null;})[_0xa92c('0x12')](respondWithResult(_0x4c8ec6,null))[_0xa92c('0x1a')](handleError(_0x4c8ec6,null));};exports[_0xa92c('0x81')]=function(_0x136bae,_0x4fe6b3){var _0x5e26ee={'agent':{},'channel':_0xa92c('0x64')};if(_0x136bae['body']['id']){delete _0x136bae[_0xa92c('0x44')]['id'];}_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')]=_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')]||_0x136bae[_0xa92c('0x5a')]['id'];_0x5e26ee[_0xa92c('0x68')]['id']=_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')];return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x136bae[_0xa92c('0x3e')]['id'],'UserId':null}})[_0xa92c('0x12')](handleEntityNotFound(_0x4fe6b3,null))[_0xa92c('0x12')](function(_0x953323){if(_0x953323){_0x5e26ee[_0xa92c('0x17')]=_0x953323[_0xa92c('0x69')]({'plain':!![]});return db[_0xa92c('0x6a')][_0xa92c('0x42')]({'where':{'id':_0x953323['MailInteractionId']}});}return null;})[_0xa92c('0x12')](handleEntityNotFound(_0x4fe6b3,null))[_0xa92c('0x12')](function(_0x549cdc){if(_0x549cdc){_0x5e26ee[_0xa92c('0x6d')]=_0x549cdc['get']({'plain':!![]});interaction_log[_0xa92c('0x18')](_0xa92c('0x82'),_0x136bae['user']['id'],_0x136bae[_0xa92c('0x5a')][_0xa92c('0x25')],_0x136bae[_0xa92c('0x5a')][_0xa92c('0x6f')],_0x5e26ee[_0xa92c('0x6d')]['id'],_0x136bae[_0xa92c('0x44')]?JSON[_0xa92c('0x70')](_0x136bae[_0xa92c('0x44')]):_0xa92c('0x83'));return respondWithRpcPromise(_0xa92c('0x84'),_0xa92c('0x85'),_0x5e26ee);}return null;})[_0xa92c('0x12')](function(_0x269019){var _0x20403b=_0xa92c('0x73')+_0x269019[_0xa92c('0x17')][_0xa92c('0x74')];return db[_0xa92c('0x75')][_0xa92c('0x2e')](_0x20403b,{'type':db[_0xa92c('0x76')][_0xa92c('0x77')][_0xa92c('0x78')],'raw':!![]})[_0xa92c('0x12')](function(_0x15643f){return _0x15643f;});})[_0xa92c('0x12')](function(_0x4acbb3){if(_0x4acbb3){_0x5e26ee[_0xa92c('0x17')][_0xa92c('0x79')]=_0x4acbb3[0x0];if(!_0x136bae[_0xa92c('0x44')]['UserId'])return;return db[_0xa92c('0x86')][_0xa92c('0x42')]({'where':{'id':_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')],'role':_0xa92c('0x68')},'attributes':['id',_0xa92c('0x25'),_0xa92c('0x7a'),_0xa92c('0x87'),'internal'],'raw':!![]});}return null;})[_0xa92c('0x12')](function(_0x362531){if(!_0x362531)return null;_0x5e26ee['message']['agent']=_0x362531;return _0x5e26ee;})['then'](function(_0x4a6e0c){if(_0x4a6e0c){_0x4a6e0c['message'][_0xa92c('0x7c')]=util[_0xa92c('0x7d')]('SIP/%s',_0x136bae['user'][_0xa92c('0x25')]);_0x4a6e0c['message'][_0xa92c('0x7e')]=_0x5e26ee[_0xa92c('0x7e')];_0x4a6e0c['message']['motionChannel']=_0x5e26ee[_0xa92c('0x7e')];_0x4a6e0c[_0xa92c('0x17')][_0xa92c('0x88')]=_0xa92c('0x81');_0x4a6e0c[_0xa92c('0x17')][_0xa92c('0x44')]=htmlToText['fromString'](_0x5e26ee[_0xa92c('0x17')][_0xa92c('0x44')]);respondWithRpcPromise(_0xa92c('0x80'),'EventManager',{'event':_0xa92c('0x89'),'message':_0x4a6e0c['message']},client9002);return _0x5e26ee;}return null;})['then'](respondWithResult(_0x4fe6b3,null))[_0xa92c('0x1a')](handleError(_0x4fe6b3,null));};exports['download']=function(_0xf455c4,_0x1d4b19){var _0x1dfb38=moment()['unix']()['toString']();var _0x2dcab6=path['join'](config[_0xa92c('0x5e')],'server',_0xa92c('0x8a'),_0xa92c('0x8b'));var _0x3646e9=path[_0xa92c('0x5d')](config[_0xa92c('0x5e')],_0xa92c('0x8c'),_0xa92c('0x8a'),_0xa92c('0x5c'));var _0xc5e894=util[_0xa92c('0x7d')]('message-%s.eml',_0x1dfb38);return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0xf455c4[_0xa92c('0x3e')]['id']},'attributes':['id','body',_0xa92c('0x8d'),'to','cc','bcc',_0xa92c('0x8e'),_0xa92c('0x8f')],'include':_0xf455c4['query'][_0xa92c('0x5c')]?[{'model':db['Attachment'],'as':_0xa92c('0x90')}]:undefined})[_0xa92c('0x12')](handleEntityNotFound(_0x1d4b19,null))[_0xa92c('0x12')](function(_0x3c7e89){if(_0x3c7e89){var _0x33b10f=_0x3c7e89;var _0x28db6a={'from':_0x33b10f[_0xa92c('0x8d')],'to':_0x33b10f['to'],'subject':_0x33b10f[_0xa92c('0x8e')],'html':_0x33b10f['body'],'headers':{'Date':moment(_0x33b10f[_0xa92c('0x8f')])[_0xa92c('0x7d')](_0xa92c('0x91'))},'attachments':[]};if(_0x3c7e89['cc']){_0x28db6a[_0xa92c('0x92')]['Cc']=_0x3c7e89['cc'];}if(_0x3c7e89['bcc']){_0x28db6a[_0xa92c('0x92')][_0xa92c('0x93')]=_0x3c7e89[_0xa92c('0x94')];}return new BPromise(function(_0x3b435d,_0x290ea4){if(_0x3c7e89['Attachments']){for(var _0x176461=0x0;_0x176461<_0x3c7e89[_0xa92c('0x90')][_0xa92c('0x33')];_0x176461++){var _0x35bdda=_0x3c7e89[_0xa92c('0x90')][_0x176461];var _0xc2bc0a=path[_0xa92c('0x5d')](_0x3646e9,_0x35bdda[_0xa92c('0x95')]);if(fs[_0xa92c('0x96')](_0xc2bc0a)){_0x28db6a[_0xa92c('0x5c')][_0xa92c('0x97')]({'name':_0x35bdda['name'],'contentType':_0x35bdda[_0xa92c('0x2a')],'data':fs[_0xa92c('0x98')](_0xc2bc0a)});}}}emlformat[_0xa92c('0x99')](_0x28db6a,function(_0x46025a,_0x44ad18){if(_0x46025a)return _0x290ea4(_0x46025a);fs['writeFileSync'](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894),_0x44ad18);return _0x3b435d(_0x44ad18);});});}})[_0xa92c('0x12')](function(_0xde8ee8){if(_0xde8ee8){return _0x1d4b19[_0xa92c('0x9a')](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894),_0xc5e894,function(_0x24bf76){if(!_0x24bf76)fs['unlinkSync'](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894));});}})[_0xa92c('0x1a')](handleError(_0x1d4b19,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index eb07a87..a12648c 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 _0xa72b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x12b328,_0x1d473b){var _0x3f162=function(_0x3812b6){while(--_0x3812b6){_0x12b328['push'](_0x12b328['shift']());}};_0x3f162(++_0x1d473b);}(_0xa72b,0x185));var _0xba72=function(_0x41ff62,_0x502245){_0x41ff62=_0x41ff62-0x0;var _0xd830c6=_0xa72b[_0x41ff62];return _0xd830c6;};'use strict';var EventEmitter=require(_0xba72('0x0'));var MailMessage=require(_0xba72('0x1'))['db'][_0xba72('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xba72('0x3')](0x0);var events={'afterCreate':_0xba72('0x4'),'afterUpdate':_0xba72('0x5'),'afterDestroy':_0xba72('0x6')};function emitEvent(_0x1eb9ae){return function(_0x224132,_0x376638,_0x78ed74){MailMessageEvents[_0xba72('0x7')](_0x1eb9ae+':'+_0x224132['id'],_0x224132);MailMessageEvents['emit'](_0x1eb9ae,_0x224132);_0x78ed74(null);};}for(var e in events){if(events[_0xba72('0x8')](e)){var event=events[e];MailMessage[_0xba72('0x9')](e,emitEvent(event));}}module[_0xba72('0xa')]=MailMessageEvents; \ No newline at end of file +var _0x5d33=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x5d33,0x78));var _0x35d3=function(_0x346f7c,_0x5a7108){_0x346f7c=_0x346f7c-0x0;var _0x16281c=_0x5d33[_0x346f7c];return _0x16281c;};'use strict';var EventEmitter=require(_0x35d3('0x0'));var MailMessage=require(_0x35d3('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x35d3('0x2')](0x0);var events={'afterCreate':_0x35d3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1554cf){return function(_0x195eec,_0x197332,_0x210fa1){MailMessageEvents[_0x35d3('0x4')](_0x1554cf+':'+_0x195eec['id'],_0x195eec);MailMessageEvents[_0x35d3('0x4')](_0x1554cf,_0x195eec);_0x210fa1(null);};}for(var e in events){if(events[_0x35d3('0x5')](e)){var event=events[e];MailMessage[_0x35d3('0x6')](e,emitEvent(event));}}module[_0x35d3('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 a43092d..e36184e 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 _0x20ff=['../../config/environment','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','MailInteraction','findOne','MailInteractionId','then','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x57ee7f,_0x27fb5e){var _0x23cf43=function(_0xa1f123){while(--_0xa1f123){_0x57ee7f['push'](_0x57ee7f['shift']());}};_0x23cf43(++_0x27fb5e);}(_0x20ff,0x121));var _0xf20f=function(_0x378095,_0x2899b8){_0x378095=_0x378095-0x0;var _0x54a8da=_0x20ff[_0x378095];return _0x54a8da;};'use strict';var _=require(_0xf20f('0x0'));var util=require(_0xf20f('0x1'));var logger=require(_0xf20f('0x2'))(_0xf20f('0x3'));var moment=require(_0xf20f('0x4'));var BPromise=require(_0xf20f('0x5'));var rp=require(_0xf20f('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xf20f('0x7'));var rimraf=require('rimraf');var config=require(_0xf20f('0x8'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x4d5f0a,_0x51b2c9){return _0x4d5f0a[_0xf20f('0x9')]('MailMessage',attributes,{'tableName':_0xf20f('0xa'),'paranoid':![],'indexes':[{'name':_0xf20f('0xb'),'fields':[_0xf20f('0xb')]},{'name':'fti_mail_messages','fields':[_0xf20f('0xc'),_0xf20f('0xd')],'type':_0xf20f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3bd51e,_0x16bb60,_0x89252f){if(_0x3bd51e[_0xf20f('0xf')]){_0x3bd51e[_0xf20f('0xc')]=htmlToText[_0xf20f('0x10')](_0x3bd51e['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x89252f(null,_0x16bb60);},'afterCreate':function(_0x4b1141,_0x10b7b4,_0x315297){var _0x39e8d1=_0x4d5f0a['models'];var _0xf1ab88=_0x4b1141[_0xf20f('0x11')]({'plain':!![]});if(_0xf1ab88[_0xf20f('0x12')][_0xf20f('0x13')]()==='in'||_0xf1ab88[_0xf20f('0x12')][_0xf20f('0x13')]()==='out'&&!_0xf1ab88['secret']&&!_['isNil'](_0xf1ab88['UserId'])){_0x39e8d1[_0xf20f('0x14')][_0xf20f('0x15')]({'where':{'id':_0xf1ab88[_0xf20f('0x16')]}})[_0xf20f('0x17')](function(_0x1b58de){if(_0x1b58de){_0x1b58de['update']({'lastMsgAt':_0xf1ab88['createdAt'],'lastMsgDirection':_0xf1ab88['direction']['toLowerCase']()});}})[_0xf20f('0x18')](function(_0x333745){console[_0xf20f('0x19')](_0x333745);});}_0x315297();}},'charset':_0xf20f('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x880d=['direction','toLowerCase','out','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','html-to-text','../../config/environment','exports','MailMessage','mail_messages','messageId','plainBody','body','fromString'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0x880d,0x1bd));var _0xd880=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x880d[_0x5ad771];return _0x5b5dce;};'use strict';var _=require(_0xd880('0x0'));var util=require(_0xd880('0x1'));var logger=require('../../config/logger')(_0xd880('0x2'));var moment=require('moment');var BPromise=require(_0xd880('0x3'));var rp=require(_0xd880('0x4'));var htmlToText=require(_0xd880('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd880('0x6'));var attributes=require('./mailMessage.attributes');module[_0xd880('0x7')]=function(_0x3575b9,_0x3d4780){return _0x3575b9['define'](_0xd880('0x8'),attributes,{'tableName':_0xd880('0x9'),'paranoid':![],'indexes':[{'name':_0xd880('0xa'),'fields':[_0xd880('0xa')]},{'name':'fti_mail_messages','fields':[_0xd880('0xb'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5107a4,_0x33526a,_0x28690f){if(_0x5107a4[_0xd880('0xc')]){_0x5107a4['plainBody']=htmlToText[_0xd880('0xd')](_0x5107a4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x28690f(null,_0x33526a);},'afterCreate':function(_0x37cd66,_0x2ff977,_0x23fca0){var _0x15e932=_0x3575b9['models'];var _0x340ed0=_0x37cd66['get']({'plain':!![]});if(_0x340ed0[_0xd880('0xe')][_0xd880('0xf')]()==='in'||_0x340ed0['direction']['toLowerCase']()===_0xd880('0x10')&&!_0x340ed0['secret']&&!_['isNil'](_0x340ed0[_0xd880('0x11')])){_0x15e932[_0xd880('0x12')]['findOne']({'where':{'id':_0x340ed0[_0xd880('0x13')]}})[_0xd880('0x14')](function(_0x559f72){if(_0x559f72){_0x559f72[_0xd880('0x15')]({'lastMsgAt':_0x340ed0[_0xd880('0x16')],'lastMsgDirection':_0x340ed0[_0xd880('0xe')][_0xd880('0xf')]()});}})[_0xd880('0x17')](function(_0x16f56a){console[_0xd880('0x18')](_0x16f56a);});}_0x23fca0();}},'charset':_0xd880('0x19'),'collate':_0xd880('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 34b9074..cba07a0 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaebd=['MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailMessage.socket','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x3989fd,_0xe5fc6c){_0x3989fd=_0x3989fd-0x0;var _0x316fd2=_0xaebd[_0x3989fd];return _0x316fd2;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});config[_0xdaeb('0xb')]=_[_0xdaeb('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaeb('0xd'))(new Redis(config[_0xdaeb('0xb')]));require(_0xdaeb('0xe'))['register'](socket);function respondWithRpcPromise(_0xbb4b72,_0x494d42,_0x3e83f3){return new BPromise(function(_0x4ba89d,_0x2218d6){return client['request'](_0xbb4b72,_0x3e83f3)[_0xdaeb('0xf')](function(_0x3f0e95){logger['info']('MailMessage,\x20%s,\x20%s',_0x494d42,_0xdaeb('0x10'));logger['debug'](_0xdaeb('0x11'),_0x494d42,_0xdaeb('0x10'),JSON[_0xdaeb('0x12')](_0x3f0e95));if(_0x3f0e95[_0xdaeb('0x13')]){if(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x14')]===0x1f4){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x2218d6(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x15')]);}logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x4ba89d(_0x3f0e95['error']['message']);}else{logger[_0xdaeb('0x16')](_0xdaeb('0x17'),_0x494d42,_0xdaeb('0x10'));_0x4ba89d(_0x3f0e95[_0xdaeb('0x18')][_0xdaeb('0x15')]);}})[_0xdaeb('0x19')](function(_0x501f77){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x501f77);_0x2218d6(_0x501f77);});});}exports[_0xdaeb('0x1a')]=function(_0x13b3f2){var _0x18bd81=this;return new Promise(function(_0x5360ce,_0x4e97e0){return db[_0xdaeb('0x1b')][_0xdaeb('0x1c')](_0x13b3f2[_0xdaeb('0x1d')],{'raw':_0x13b3f2[_0xdaeb('0x1e')]?_0x13b3f2[_0xdaeb('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c969d){logger[_0xdaeb('0x16')](_0xdaeb('0x1a'),_0x13b3f2);logger[_0xdaeb('0x1f')](_0xdaeb('0x1a'),_0x13b3f2,JSON['stringify'](_0x2c969d));_0x5360ce(_0x2c969d);})[_0xdaeb('0x19')](function(_0x4dc25f){logger[_0xdaeb('0x13')](_0xdaeb('0x1a'),_0x4dc25f[_0xdaeb('0x15')],_0x13b3f2);_0x4e97e0(_0x18bd81[_0xdaeb('0x13')](0x1f4,_0x4dc25f[_0xdaeb('0x15')]));});});}; \ No newline at end of file +var _0xef0f=['code','message','result','catch','CreateMailMessage','create','options','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4177fb,_0x275d43){var _0x597ce6=function(_0xb4f452){while(--_0xb4f452){_0x4177fb['push'](_0x4177fb['shift']());}};_0x597ce6(++_0x275d43);}(_0xef0f,0x168));var _0xfef0=function(_0x49c0d2,_0x2a283d){_0x49c0d2=_0x49c0d2-0x0;var _0x94bbb8=_0xef0f[_0x49c0d2];return _0x94bbb8;};'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});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['MailMessage'][_0xfef0('0x1d')](_0x4e24de['body'],{'raw':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b8b22){logger[_0xfef0('0x12')]('CreateMailMessage',_0x4e24de);logger[_0xfef0('0x1f')](_0xfef0('0x1c'),_0x4e24de,JSON[_0xfef0('0x16')](_0x4b8b22));_0x1a0aa0(_0x4b8b22);})[_0xfef0('0x1b')](function(_0x249fe4){logger[_0xfef0('0x17')]('CreateMailMessage',_0x249fe4['message'],_0x4e24de);_0x28dee1(_0x20826b[_0xfef0('0x17')](0x1f4,_0x249fe4[_0xfef0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 497acdb..093a1ea 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 _0xd1d4=['save','update','emit','removeListener','register','length','./mailMessage.events'];(function(_0x56aefc,_0x3b8f5e){var _0x429ee6=function(_0x5d8e17){while(--_0x5d8e17){_0x56aefc['push'](_0x56aefc['shift']());}};_0x429ee6(++_0x3b8f5e);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xd1d4[_0x45d3f0];return _0x314b79;};'use strict';var MailMessageEvents=require(_0x4d1d('0x0'));var events=[_0x4d1d('0x1'),'remove',_0x4d1d('0x2')];function createListener(_0x54f44c,_0x5ed209){return function(_0x2fdf2e){_0x5ed209[_0x4d1d('0x3')](_0x54f44c,_0x2fdf2e);};}function removeListener(_0x260e6a,_0x3bcfda){return function(){MailMessageEvents[_0x4d1d('0x4')](_0x260e6a,_0x3bcfda);};}exports[_0x4d1d('0x5')]=function(_0x30466a){for(var _0xb8a403=0x0,_0x1547d5=events[_0x4d1d('0x6')];_0xb8a403<_0x1547d5;_0xb8a403++){var _0x23f6c4=events[_0xb8a403];var _0x54da0f=createListener('mailMessage:'+_0x23f6c4,_0x30466a);MailMessageEvents['on'](_0x23f6c4,_0x54da0f);}}; \ No newline at end of file +var _0x5c9c=['emit','removeListener','register','./mailMessage.events','save','remove','update'];(function(_0x23ccc7,_0xb0909d){var _0x55c03f=function(_0x1121ae){while(--_0x1121ae){_0x23ccc7['push'](_0x23ccc7['shift']());}};_0x55c03f(++_0xb0909d);}(_0x5c9c,0x1d1));var _0xc5c9=function(_0x5c5a2b,_0x5606a7){_0x5c5a2b=_0x5c5a2b-0x0;var _0x161cb7=_0x5c9c[_0x5c5a2b];return _0x161cb7;};'use strict';var MailMessageEvents=require(_0xc5c9('0x0'));var events=[_0xc5c9('0x1'),_0xc5c9('0x2'),_0xc5c9('0x3')];function createListener(_0x24fc2c,_0x543896){return function(_0x1d3ab9){_0x543896[_0xc5c9('0x4')](_0x24fc2c,_0x1d3ab9);};}function removeListener(_0x3476e4,_0x3c8342){return function(){MailMessageEvents[_0xc5c9('0x5')](_0x3476e4,_0x3c8342);};}exports[_0xc5c9('0x6')]=function(_0x576fb2){for(var _0x3d7538=0x0,_0xcdf0af=events['length'];_0x3d7538<_0xcdf0af;_0x3d7538++){var _0x3ed0f5=events[_0x3d7538];var _0x527849=createListener('mailMessage:'+_0x3ed0f5,_0x576fb2);MailMessageEvents['on'](_0x3ed0f5,_0x527849);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 40e342f..3613431 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 _0xe531=['isAuthenticated','show','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','/:id','update','delete','removeTeams','removeAgents','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x239c58,_0xc6cc17){var _0x5afee3=function(_0x3b59a2){while(--_0x3b59a2){_0x239c58['push'](_0x239c58['shift']());}};_0x5afee3(++_0xc6cc17);}(_0xe531,0x1d7));var _0x1e53=function(_0x36665f,_0x4f9488){_0x36665f=_0x36665f-0x0;var _0x481d25=_0xe531[_0x36665f];return _0x481d25;};'use strict';var multer=require(_0x1e53('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e53('0x1'));var express=require('express');var router=express[_0x1e53('0x2')]();var fs_extra=require(_0x1e53('0x3'));var auth=require(_0x1e53('0x4'));var interaction=require(_0x1e53('0x5'));var config=require(_0x1e53('0x6'));var controller=require('./mailQueue.controller');router[_0x1e53('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e53('0x7')](_0x1e53('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x1e53('0x7')]('/:id',auth[_0x1e53('0x9')](),controller[_0x1e53('0xa')]);router[_0x1e53('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x1e53('0x7')](_0x1e53('0xb'),auth[_0x1e53('0x9')](),controller[_0x1e53('0xc')]);router[_0x1e53('0x7')]('/:id/users',auth[_0x1e53('0x9')](),controller[_0x1e53('0xd')]);router[_0x1e53('0xe')]('/',auth[_0x1e53('0x9')](),controller[_0x1e53('0xf')]);router['post'](_0x1e53('0xb'),auth['isAuthenticated'](),controller[_0x1e53('0x10')]);router[_0x1e53('0xe')](_0x1e53('0x11'),auth[_0x1e53('0x9')](),controller['addAgents']);router[_0x1e53('0x12')](_0x1e53('0x13'),auth[_0x1e53('0x9')](),controller[_0x1e53('0x14')]);router[_0x1e53('0x15')](_0x1e53('0x13'),auth[_0x1e53('0x9')](),controller['destroy']);router[_0x1e53('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1e53('0x16')]);router[_0x1e53('0x15')](_0x1e53('0x11'),auth['isAuthenticated'](),controller[_0x1e53('0x17')]);module['exports']=router; \ No newline at end of file +var _0x99a6=['addAgents','put','/:id','delete','destroy','removeTeams','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','/:id/users'];(function(_0x4cdb9b,_0x138fdb){var _0x5b171f=function(_0x29cfe){while(--_0x29cfe){_0x4cdb9b['push'](_0x4cdb9b['shift']());}};_0x5b171f(++_0x138fdb);}(_0x99a6,0x173));var _0x699a=function(_0x262957,_0x34c699){_0x262957=_0x262957-0x0;var _0x27e221=_0x99a6[_0x262957];return _0x27e221;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x699a('0x0'));var timeout=require(_0x699a('0x1'));var express=require('express');var router=express[_0x699a('0x2')]();var fs_extra=require(_0x699a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x699a('0x4'));var config=require(_0x699a('0x5'));var controller=require(_0x699a('0x6'));router[_0x699a('0x7')]('/',auth[_0x699a('0x8')](),controller[_0x699a('0x9')]);router[_0x699a('0x7')](_0x699a('0xa'),auth[_0x699a('0x8')](),controller[_0x699a('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x699a('0xc')]);router[_0x699a('0x7')](_0x699a('0xd'),auth[_0x699a('0x8')](),controller[_0x699a('0xe')]);router[_0x699a('0x7')]('/:id/teams',auth[_0x699a('0x8')](),controller[_0x699a('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x699a('0x10')]);router['post']('/',auth[_0x699a('0x8')](),controller[_0x699a('0x11')]);router[_0x699a('0x12')](_0x699a('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x699a('0x12')](_0x699a('0x14'),auth[_0x699a('0x8')](),controller[_0x699a('0x15')]);router[_0x699a('0x16')](_0x699a('0x17'),auth[_0x699a('0x8')](),controller['update']);router[_0x699a('0x18')](_0x699a('0x17'),auth['isAuthenticated'](),controller[_0x699a('0x19')]);router['delete'](_0x699a('0x13'),auth[_0x699a('0x8')](),controller[_0x699a('0x1a')]);router[_0x699a('0x18')](_0x699a('0x14'),auth[_0x699a('0x8')](),controller['removeAgents']);module[_0x699a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 48051be..00b3985 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 _0x2aba=['beepall','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x3aac69,_0x81d09f){var _0x38d35b=function(_0x58ef90){while(--_0x58ef90){_0x3aac69['push'](_0x3aac69['shift']());}};_0x38d35b(++_0x81d09f);}(_0x2aba,0x13f));var _0xa2ab=function(_0x5c8f62,_0xb45fa7){_0x5c8f62=_0x5c8f62-0x0;var _0x292f64=_0x2aba[_0x5c8f62];return _0x292f64;};'use strict';var Sequelize=require(_0xa2ab('0x0'));module[_0xa2ab('0x1')]={'name':{'type':Sequelize[_0xa2ab('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa2ab('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa2ab('0x3')](_0xa2ab('0x4'),_0xa2ab('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x991f=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x160351,_0x56c7da){var _0x2013d3=function(_0x25dc4e){while(--_0x25dc4e){_0x160351['push'](_0x160351['shift']());}};_0x2013d3(++_0x56c7da);}(_0x991f,0x1ca));var _0xf991=function(_0x4b7147,_0x122aff){_0x4b7147=_0x4b7147-0x0;var _0x4ba310=_0x991f[_0x4b7147];return _0x4ba310;};'use strict';var Sequelize=require(_0xf991('0x0'));module['exports']={'name':{'type':Sequelize[_0xf991('0x1')],'unique':_0xf991('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf991('0x1')]},'timeout':{'type':Sequelize[_0xf991('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf991('0x4')](_0xf991('0x5'),_0xf991('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 30b8671..64d5def 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 _0xd9dc=['join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','value','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','get','MailQueues','stack','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','MailQueue','count','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','order','MailQueueId','UserMailQueue','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_mail_queues'];(function(_0x112272,_0x1fd905){var _0x249f94=function(_0x2d7f72){while(--_0x2d7f72){_0x112272['push'](_0x112272['shift']());}};_0x249f94(++_0x1fd905);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x10037e,_0x28b6bd){_0x10037e=_0x10037e-0x0;var _0x371d49=_0xd9dc[_0x10037e];return _0x371d49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd9d('0x0'));var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9d('0x2'));var moment=require(_0xcd9d('0x3'));var BPromise=require(_0xcd9d('0x4'));var Mustache=require('mustache');var util=require(_0xcd9d('0x5'));var path=require(_0xcd9d('0x6'));var sox=require(_0xcd9d('0x7'));var csv=require(_0xcd9d('0x8'));var ejs=require(_0xcd9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9d('0xa'));var squel=require(_0xcd9d('0xb'));var crypto=require(_0xcd9d('0xc'));var jsforce=require(_0xcd9d('0xd'));var deskjs=require(_0xcd9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd9d('0xf'));var Papa=require(_0xcd9d('0x10'));var Redis=require(_0xcd9d('0x11'));var authService=require(_0xcd9d('0x12'));var qs=require(_0xcd9d('0x13'));var as=require(_0xcd9d('0x14'));var hardwareService=require(_0xcd9d('0x15'));var logger=require(_0xcd9d('0x16'))('api');var utils=require(_0xcd9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9d('0x18'));var db=require('../../mysqldb')['db'];config[_0xcd9d('0x19')]=_[_0xcd9d('0x1a')](config[_0xcd9d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd9d('0x1b'))(new Redis(config['redis']));require(_0xcd9d('0x1c'))[_0xcd9d('0x1d')](socket);function respondWithStatusCode(_0x31ddbb,_0x582a92){_0x582a92=_0x582a92||0xcc;return function(_0x12edfc){if(_0x12edfc){return _0x31ddbb[_0xcd9d('0x1e')](_0x582a92);}return _0x31ddbb['status'](_0x582a92)[_0xcd9d('0x1f')]();};}function respondWithResult(_0x5a7248,_0x3ea72c){_0x3ea72c=_0x3ea72c||0xc8;return function(_0x534c8f){if(_0x534c8f){return _0x5a7248[_0xcd9d('0x20')](_0x3ea72c)[_0xcd9d('0x21')](_0x534c8f);}};}function respondWithFilteredResult(_0x3a66af,_0xf82796){return function(_0x438169){if(_0x438169){var _0x4381e2=typeof _0xf82796[_0xcd9d('0x22')]===_0xcd9d('0x23')&&typeof _0xf82796[_0xcd9d('0x24')]===_0xcd9d('0x23');var _0x315cf7=_0x438169['count'];var _0x15fec8=_0x4381e2?0x0:_0xf82796[_0xcd9d('0x22')];var _0x3599eb=_0x4381e2?_0x438169['count']:_0xf82796[_0xcd9d('0x22')]+_0xf82796[_0xcd9d('0x24')];var _0x376e3e;if(_0x3599eb>=_0x315cf7){_0x3599eb=_0x315cf7;_0x376e3e=0xc8;}else{_0x376e3e=0xce;}_0x3a66af[_0xcd9d('0x20')](_0x376e3e);return _0x3a66af[_0xcd9d('0x25')](_0xcd9d('0x26'),_0x15fec8+'-'+_0x3599eb+'/'+_0x315cf7)[_0xcd9d('0x21')](_0x438169);}return null;};}function patchUpdates(_0x12e585){return function(_0x4ad511){try{jsonpatch['apply'](_0x4ad511,_0x12e585,!![]);}catch(_0x33d33a){return BPromise[_0xcd9d('0x27')](_0x33d33a);}return _0x4ad511[_0xcd9d('0x28')]();};}function saveUpdates(_0x474bb4,_0x58b632){return function(_0x73420){if(_0x73420){return _0x73420[_0xcd9d('0x29')](_0x474bb4)[_0xcd9d('0x2a')](function(_0xf0f632){return _0xf0f632;});}return null;};}function removeEntity(_0x32686a,_0x5ed51f){return function(_0x33aca7){if(_0x33aca7){return _0x33aca7[_0xcd9d('0x2b')]()[_0xcd9d('0x2a')](function(){var _0x4ce785=_0x33aca7[_0xcd9d('0x2c')]({'plain':!![]});var _0x3b1abd=_0xcd9d('0x2d');return db['UserProfileResource'][_0xcd9d('0x2b')]({'where':{'type':_0x3b1abd,'resourceId':_0x4ce785['id']}})[_0xcd9d('0x2a')](function(){return _0x33aca7;});})['then'](function(){_0x32686a['status'](0xcc)[_0xcd9d('0x1f')]();});}};}function handleEntityNotFound(_0x124da9,_0x5b1fd6){return function(_0xcf8b36){if(!_0xcf8b36){_0x124da9[_0xcd9d('0x1e')](0x194);}return _0xcf8b36;};}function handleError(_0x3c70de,_0x25a409){_0x25a409=_0x25a409||0x1f4;return function(_0xe0f467){logger['error'](_0xe0f467[_0xcd9d('0x2e')]);if(_0xe0f467[_0xcd9d('0x2f')]){delete _0xe0f467[_0xcd9d('0x2f')];}_0x3c70de['status'](_0x25a409)[_0xcd9d('0x30')](_0xe0f467);};}exports[_0xcd9d('0x31')]=function(_0x38e3e2,_0x4f1752){var _0x154dd8={},_0x2372e2={},_0x343835={'count':0x0,'rows':[]};var _0xa4440=_['map'](db['MailQueue'][_0xcd9d('0x32')],function(_0x4beb82){return{'name':_0x4beb82['fieldName'],'type':_0x4beb82[_0xcd9d('0x33')][_0xcd9d('0x34')]};});_0x2372e2[_0xcd9d('0x35')]=_[_0xcd9d('0x36')](_0xa4440,'name');_0x2372e2['query']=_[_0xcd9d('0x37')](_0x38e3e2[_0xcd9d('0x38')]);_0x2372e2[_0xcd9d('0x39')]=_['intersection'](_0x2372e2[_0xcd9d('0x35')],_0x2372e2[_0xcd9d('0x38')]);_0x154dd8[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x2372e2[_0xcd9d('0x35')],qs[_0xcd9d('0x3c')](_0x38e3e2[_0xcd9d('0x38')][_0xcd9d('0x3c')]));_0x154dd8[_0xcd9d('0x3a')]=_0x154dd8[_0xcd9d('0x3a')][_0xcd9d('0x3d')]?_0x154dd8[_0xcd9d('0x3a')]:_0x2372e2['model'];if(!_0x38e3e2[_0xcd9d('0x38')][_0xcd9d('0x3e')]('nolimit')){_0x154dd8['limit']=qs[_0xcd9d('0x24')](_0x38e3e2['query']['limit']);_0x154dd8[_0xcd9d('0x22')]=qs[_0xcd9d('0x22')](_0x38e3e2[_0xcd9d('0x38')][_0xcd9d('0x22')]);}_0x154dd8['order']=qs[_0xcd9d('0x3f')](_0x38e3e2[_0xcd9d('0x38')]['sort']);_0x154dd8[_0xcd9d('0x40')]=qs[_0xcd9d('0x39')](_[_0xcd9d('0x41')](_0x38e3e2[_0xcd9d('0x38')],_0x2372e2['filters']),_0xa4440);if(_0x38e3e2['query'][_0xcd9d('0x42')]){_0x154dd8['where']=_[_0xcd9d('0x43')](_0x154dd8[_0xcd9d('0x40')],{'$or':_[_0xcd9d('0x36')](_0xa4440,function(_0x5b3dc3){if(_0x5b3dc3[_0xcd9d('0x33')]!==_0xcd9d('0x44')){var _0x3077b5={};_0x3077b5[_0x5b3dc3[_0xcd9d('0x2f')]]={'$like':'%'+_0x38e3e2[_0xcd9d('0x38')][_0xcd9d('0x42')]+'%'};return _0x3077b5;}})});}_0x154dd8=_[_0xcd9d('0x43')]({},_0x154dd8,_0x38e3e2[_0xcd9d('0x45')]);var _0x127eb8={'where':_0x154dd8[_0xcd9d('0x40')]};return db[_0xcd9d('0x46')]['count'](_0x127eb8)['then'](function(_0x52b882){_0x343835[_0xcd9d('0x47')]=_0x52b882;if(_0x38e3e2[_0xcd9d('0x38')][_0xcd9d('0x48')]){_0x154dd8['include']=[{'all':!![]}];}return db[_0xcd9d('0x46')][_0xcd9d('0x49')](_0x154dd8);})['then'](function(_0x44d0ca){_0x343835['rows']=_0x44d0ca;return _0x343835;})[_0xcd9d('0x2a')](respondWithFilteredResult(_0x4f1752,_0x154dd8))[_0xcd9d('0x4a')](handleError(_0x4f1752,null));};exports['show']=function(_0x5224c1,_0x133011){var _0xe3bbe0={'raw':!![],'where':{'id':_0x5224c1[_0xcd9d('0x4b')]['id']}},_0x2c12db={};_0x2c12db[_0xcd9d('0x35')]=_[_0xcd9d('0x37')](db['MailQueue']['rawAttributes']);_0x2c12db['query']=_[_0xcd9d('0x37')](_0x5224c1[_0xcd9d('0x38')]);_0x2c12db['filters']=_[_0xcd9d('0x3b')](_0x2c12db[_0xcd9d('0x35')],_0x2c12db[_0xcd9d('0x38')]);_0xe3bbe0[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x2c12db[_0xcd9d('0x35')],qs[_0xcd9d('0x3c')](_0x5224c1[_0xcd9d('0x38')][_0xcd9d('0x3c')]));_0xe3bbe0[_0xcd9d('0x3a')]=_0xe3bbe0['attributes'][_0xcd9d('0x3d')]?_0xe3bbe0[_0xcd9d('0x3a')]:_0x2c12db[_0xcd9d('0x35')];if(_0x5224c1[_0xcd9d('0x38')][_0xcd9d('0x48')]){_0xe3bbe0[_0xcd9d('0x4c')]=[{'all':!![]}];}_0xe3bbe0=_[_0xcd9d('0x43')]({},_0xe3bbe0,_0x5224c1[_0xcd9d('0x45')]);return db['MailQueue'][_0xcd9d('0x4d')](_0xe3bbe0)[_0xcd9d('0x2a')](handleEntityNotFound(_0x133011,null))[_0xcd9d('0x2a')](respondWithResult(_0x133011,null))['catch'](handleError(_0x133011,null));};exports[_0xcd9d('0x4e')]=function(_0x38fc8d,_0x38d590){return db[_0xcd9d('0x46')][_0xcd9d('0x4e')](_0x38fc8d[_0xcd9d('0x4f')],{})[_0xcd9d('0x2a')](function(_0x346776){var _0x5c541e=_0x38fc8d[_0xcd9d('0x50')][_0xcd9d('0x2c')]({'plain':!![]});if(!_0x5c541e)throw new Error(_0xcd9d('0x51'));if(_0x5c541e[_0xcd9d('0x52')]==='user'){var _0x9d3789=_0x346776[_0xcd9d('0x2c')]({'plain':!![]});var _0x26b475=_0xcd9d('0x2d');return db['UserProfileSection'][_0xcd9d('0x4d')]({'where':{'name':_0x26b475,'userProfileId':_0x5c541e[_0xcd9d('0x53')]},'raw':!![]})[_0xcd9d('0x2a')](function(_0x425e86){if(_0x425e86&&_0x425e86[_0xcd9d('0x54')]===0x0){return db['UserProfileResource'][_0xcd9d('0x4e')]({'name':_0x9d3789[_0xcd9d('0x2f')],'resourceId':_0x9d3789['id'],'type':_0x425e86['name'],'sectionId':_0x425e86['id']},{})[_0xcd9d('0x2a')](function(){return _0x346776;});}else{return _0x346776;}})[_0xcd9d('0x4a')](function(_0x5af1b4){logger[_0xcd9d('0x55')](_0xcd9d('0x56'),_0x5af1b4);throw _0x5af1b4;});}return _0x346776;})[_0xcd9d('0x2a')](respondWithResult(_0x38d590,0xc9))[_0xcd9d('0x4a')](handleError(_0x38d590,null));};exports[_0xcd9d('0x29')]=function(_0x1db78c,_0x5ebe93){if(_0x1db78c['body']['id']){delete _0x1db78c['body']['id'];}return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x1db78c[_0xcd9d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ebe93,null))[_0xcd9d('0x2a')](saveUpdates(_0x1db78c[_0xcd9d('0x4f')],null))['then'](respondWithResult(_0x5ebe93,null))[_0xcd9d('0x4a')](handleError(_0x5ebe93,null));};exports[_0xcd9d('0x2b')]=function(_0x3187c9,_0x5abd9f){return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x3187c9['params']['id']}})[_0xcd9d('0x2a')](handleEntityNotFound(_0x5abd9f,null))['then'](removeEntity(_0x5abd9f,null))[_0xcd9d('0x4a')](handleError(_0x5abd9f,null));};exports[_0xcd9d('0x57')]=function(_0x1e350c,_0x4a4655){return db[_0xcd9d('0x46')][_0xcd9d('0x57')]()[_0xcd9d('0x2a')](respondWithResult(_0x4a4655,null))[_0xcd9d('0x4a')](handleError(_0x4a4655,null));};exports[_0xcd9d('0x58')]=function(_0x3460f9,_0x2d1b93,_0x288d3e){var _0xf9b506={'raw':!![],'where':{}},_0x542546={},_0x22a056;return db[_0xcd9d('0x46')][_0xcd9d('0x59')]({'where':{'id':_0x3460f9['params']['id']}})[_0xcd9d('0x2a')](handleEntityNotFound(_0x2d1b93,null))[_0xcd9d('0x2a')](function(_0x3f3dc0){if(_0x3f3dc0){_0x22a056=_0x3f3dc0[_0xcd9d('0x2c')]({'plain':!![]});_0x542546[_0xcd9d('0x35')]=_[_0xcd9d('0x37')](db['UserMailQueue']['rawAttributes']);_0x542546[_0xcd9d('0x38')]=_[_0xcd9d('0x37')](_0x3460f9[_0xcd9d('0x38')]);_0x542546[_0xcd9d('0x39')]=_[_0xcd9d('0x3b')](_0x542546['model'],_0x542546[_0xcd9d('0x38')]);_0xf9b506['attributes']=_[_0xcd9d('0x3b')](_0x542546['model'],qs[_0xcd9d('0x3c')](_0x3460f9['query'][_0xcd9d('0x3c')]));_0xf9b506[_0xcd9d('0x3a')]=_0xf9b506['attributes'][_0xcd9d('0x3d')]?_0xf9b506['attributes']:_0x542546[_0xcd9d('0x35')];if(!_0x3460f9[_0xcd9d('0x38')]['hasOwnProperty'](_0xcd9d('0x5a'))){_0xf9b506[_0xcd9d('0x24')]=qs[_0xcd9d('0x24')](_0x3460f9['query'][_0xcd9d('0x24')]);_0xf9b506['offset']=qs['offset'](_0x3460f9[_0xcd9d('0x38')][_0xcd9d('0x22')]);}_0xf9b506[_0xcd9d('0x5b')]=qs['sort'](_0x3460f9[_0xcd9d('0x38')][_0xcd9d('0x3f')]);_0xf9b506[_0xcd9d('0x40')]=qs[_0xcd9d('0x39')](_[_0xcd9d('0x41')](_0x3460f9[_0xcd9d('0x38')],_0x542546['filters']));_0xf9b506[_0xcd9d('0x40')][_0xcd9d('0x5c')]=_0x3f3dc0['id'];if(_0x3460f9['query'][_0xcd9d('0x42')]){_0xf9b506['where']=_[_0xcd9d('0x43')](_0xf9b506[_0xcd9d('0x40')],{'$or':_[_0xcd9d('0x36')](_0xf9b506[_0xcd9d('0x3a')],function(_0x3faeac){var _0x2e1b36={};_0x2e1b36[_0x3faeac]={'$like':'%'+_0x3460f9[_0xcd9d('0x38')][_0xcd9d('0x42')]+'%'};return _0x2e1b36;})});}_0xf9b506=_[_0xcd9d('0x43')]({},_0xf9b506,_0x3460f9['options']);return db[_0xcd9d('0x5d')]['findAll'](_0xf9b506);}})[_0xcd9d('0x2a')](function(_0x124c5d){if(_0x124c5d){return db[_0xcd9d('0x5e')][_0xcd9d('0x5f')]({'where':{'id':_[_0xcd9d('0x36')](_0x124c5d,'UserId'),'role':_0xcd9d('0x60')},'attributes':['id',_0xcd9d('0x2f'),_0xcd9d('0x61'),_0xcd9d('0x62'),_0xcd9d('0x63')]});}})['then'](function(_0x5b4a56){if(_0x5b4a56){return{'count':_0x5b4a56[_0xcd9d('0x47')],'rows':_['map'](_0x5b4a56[_0xcd9d('0x64')],function(_0x811ad4){return{'membername':_0x811ad4['name'],'UserId':_0x811ad4['id'],'queue_name':_0x22a056[_0xcd9d('0x2f')],'MailQueueId':_0x22a056['id'],'interface':util[_0xcd9d('0x65')](_0xcd9d('0x66'),_0xcd9d('0x67'),_0x811ad4['name']),'penalty':0x0,'paused':_0x811ad4[_0xcd9d('0x61')],'createdAt':_0x811ad4['createdAt'],'updatedAt':_0x811ad4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d1b93,_0xf9b506))[_0xcd9d('0x4a')](handleError(_0x2d1b93,null));};exports['getTeams']=function(_0x3d1bd0,_0x3f9a2d,_0x43374b){var _0x36e6ca={};var _0x24684b={};var _0x32a0a4;var _0x4d489f;return db[_0xcd9d('0x46')][_0xcd9d('0x59')]({'where':{'id':_0x3d1bd0[_0xcd9d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f9a2d,null))[_0xcd9d('0x2a')](function(_0xd3eb1c){if(_0xd3eb1c){_0x32a0a4=_0xd3eb1c;_0x24684b[_0xcd9d('0x35')]=_['keys'](db[_0xcd9d('0x68')]['rawAttributes']);_0x24684b[_0xcd9d('0x38')]=_[_0xcd9d('0x37')](_0x3d1bd0[_0xcd9d('0x38')]);_0x24684b[_0xcd9d('0x39')]=_[_0xcd9d('0x3b')](_0x24684b[_0xcd9d('0x35')],_0x24684b[_0xcd9d('0x38')]);_0x36e6ca[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x24684b[_0xcd9d('0x35')],qs['fields'](_0x3d1bd0['query'][_0xcd9d('0x3c')]));_0x36e6ca[_0xcd9d('0x3a')]=_0x36e6ca[_0xcd9d('0x3a')][_0xcd9d('0x3d')]?_0x36e6ca['attributes']:_0x24684b['model'];_0x36e6ca['order']=qs[_0xcd9d('0x3f')](_0x3d1bd0['query'][_0xcd9d('0x3f')]);_0x36e6ca[_0xcd9d('0x40')]=qs[_0xcd9d('0x39')](_[_0xcd9d('0x41')](_0x3d1bd0[_0xcd9d('0x38')],_0x24684b[_0xcd9d('0x39')]));if(_0x3d1bd0[_0xcd9d('0x38')][_0xcd9d('0x42')]){_0x36e6ca[_0xcd9d('0x40')]=_[_0xcd9d('0x43')](_0x36e6ca['where'],{'$or':_[_0xcd9d('0x36')](_0x36e6ca[_0xcd9d('0x3a')],function(_0x59490){var _0x1cf4d3={};_0x1cf4d3[_0x59490]={'$like':'%'+_0x3d1bd0[_0xcd9d('0x38')][_0xcd9d('0x42')]+'%'};return _0x1cf4d3;})});}_0x36e6ca=_[_0xcd9d('0x43')]({},_0x36e6ca,_0x3d1bd0[_0xcd9d('0x45')]);return _0x32a0a4[_0xcd9d('0x69')](_0x36e6ca);}})[_0xcd9d('0x2a')](function(_0x21d255){if(_0x21d255){_0x4d489f=_0x21d255['length'];if(!_0x3d1bd0[_0xcd9d('0x38')][_0xcd9d('0x3e')](_0xcd9d('0x5a'))){_0x36e6ca[_0xcd9d('0x24')]=qs[_0xcd9d('0x24')](_0x3d1bd0[_0xcd9d('0x38')]['limit']);_0x36e6ca[_0xcd9d('0x22')]=qs[_0xcd9d('0x22')](_0x3d1bd0[_0xcd9d('0x38')]['offset']);}return _0x32a0a4[_0xcd9d('0x69')](_0x36e6ca);}})['then'](function(_0x55dbdf){if(_0x55dbdf){return _0x55dbdf?{'count':_0x4d489f,'rows':_0x55dbdf}:null;}})[_0xcd9d('0x2a')](respondWithResult(_0x3f9a2d,null))['catch'](handleError(_0x3f9a2d,null));};exports[_0xcd9d('0x6a')]=function(_0x2620ac,_0x15507f,_0x47f894){var _0x4671f0=_0x2620ac[_0xcd9d('0x4f')]['ids'];return db[_0xcd9d('0x68')]['findAll']({'where':{'id':_0x4671f0},'attributes':['id'],'include':[{'model':db[_0xcd9d('0x5e')],'as':_0xcd9d('0x6b'),'attributes':['id','name',_0xcd9d('0x6c'),_0xcd9d('0x6d'),'interface'],'raw':!![]}]})[_0xcd9d('0x2a')](function(_0x20ffe1){if(_0x20ffe1){var _0x28ff60=_['flatMap'](_0x20ffe1,function(_0xa2edf8){var _0x9d2d6f=_0xa2edf8['get']({'plain':!![]});return _0x9d2d6f['Agents'];});return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x2620ac['params']['id']}})[_0xcd9d('0x2a')](function(_0x308c79){return db[_0xcd9d('0x6e')][_0xcd9d('0x6f')](function(_0x1e8e46){return _0x308c79[_0xcd9d('0x6a')](_0x4671f0,{'transaction':_0x1e8e46})['then'](function(){return BPromise[_0xcd9d('0x70')](_0x28ff60,function(_0x122a99){return db[_0xcd9d('0x5d')][_0xcd9d('0x71')]({'where':{'UserId':_0x122a99['id'],'MailQueueId':_0x2620ac[_0xcd9d('0x4b')]['id']},'transaction':_0x1e8e46});});})[_0xcd9d('0x2a')](function(){_0x28ff60[_0xcd9d('0x72')](function(_0x27797f){socket['emit'](_0xcd9d('0x73'),{'UserId':_0x27797f['id'],'MailQueueId':_0x308c79['id']});});});});});}})[_0xcd9d('0x2a')](respondWithStatusCode(_0x15507f,null))[_0xcd9d('0x4a')](handleError(_0x15507f,null));};exports[_0xcd9d('0x74')]=function(_0x6d834c,_0x3bd8a5,_0x357731){return db['Team'][_0xcd9d('0x49')]({'where':{'id':_0x6d834c[_0xcd9d('0x38')][_0xcd9d('0x75')]},'attributes':['id'],'include':[{'model':db[_0xcd9d('0x5e')],'as':_0xcd9d('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xcd9d('0x2a')](handleEntityNotFound(_0x3bd8a5,null))[_0xcd9d('0x2a')](function(_0x5d9487){var _0x24ca14=_[_0xcd9d('0x36')](_0x5d9487,'id');var _0xd87689=[];var _0x2311a2=[];var _0x475a4e=squel['select']();_0x475a4e[_0xcd9d('0x76')](_0xcd9d('0x77'))[_0xcd9d('0x78')](_0xcd9d('0x79'),'tq')[_0xcd9d('0x7a')]('user_has_teams','ut',_0xcd9d('0x7b'))['where']('MailQueueId\x20=\x20?',_0x6d834c[_0xcd9d('0x4b')]['id']);for(var _0xe7f285=0x0;_0xe7f285<_0x5d9487[_0xcd9d('0x3d')];_0xe7f285+=0x1){let _0x37b020=_0x5d9487[_0xe7f285];for(var _0x5f43a2=0x0;_0x5f43a2<_0x37b020[_0xcd9d('0x6b')]['length'];_0x5f43a2+=0x1){let _0x4e01c7=_0x37b020[_0xcd9d('0x6b')][_0x5f43a2];var _0x5c502b=_0x475a4e[_0xcd9d('0x7c')]();_0x5c502b['where'](_0xcd9d('0x7d'),_0x4e01c7['id']);_0x2311a2[_0xcd9d('0x7e')](db[_0xcd9d('0x6e')][_0xcd9d('0x38')](_0x5c502b[_0xcd9d('0x7f')](),{'type':db[_0xcd9d('0x6e')]['QueryTypes']['SELECT']})['then'](function(_0x24b5e4){if(_0x24b5e4[_0xcd9d('0x3d')]===0x1){return _0x4e01c7['id'];}else{var _0x7b04ea=_[_0xcd9d('0x80')](_[_0xcd9d('0x36')](_0x24b5e4,_0xcd9d('0x81')),function(_0x2be97e){return _[_0xcd9d('0x82')](_0x24ca14,_0x2be97e);});if(_0x7b04ea){return _0x4e01c7['id'];}}}));}}return BPromise['all'](_0x2311a2)['then'](function(_0x1d84a5){_0xd87689=_(_0xd87689)[_0xcd9d('0x83')](_0x1d84a5)[_0xcd9d('0x84')]()[_0xcd9d('0x85')]();return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x6d834c['params']['id']}})[_0xcd9d('0x2a')](function(_0x196086){return db[_0xcd9d('0x6e')]['transaction'](function(_0x42f16c){return _0x196086['removeTeams'](_0x6d834c[_0xcd9d('0x38')][_0xcd9d('0x75')],{'transaction':_0x42f16c})[_0xcd9d('0x2a')](function(){if(!_['isEmpty'](_0xd87689)){return _0x196086[_0xcd9d('0x86')](_0xd87689,{'transaction':_0x42f16c});}})['then'](function(){_0xd87689[_0xcd9d('0x72')](function(_0x157ee4){socket[_0xcd9d('0x87')](_0xcd9d('0x88'),{'UserId':_0x157ee4,'MailQueueId':_0x196086['id']});});});});});});})[_0xcd9d('0x2a')](respondWithStatusCode(_0x3bd8a5,null))['catch'](handleError(_0x3bd8a5,null));};exports[_0xcd9d('0x89')]=function(_0x19dd79,_0x7de303,_0x12a00b){return db[_0xcd9d('0x46')]['find']({'where':{'id':_0x19dd79[_0xcd9d('0x4b')]['id']}})[_0xcd9d('0x2a')](handleEntityNotFound(_0x7de303,null))[_0xcd9d('0x2a')](function(_0x28a68e){if(_0x28a68e){return _0x28a68e[_0xcd9d('0x89')](_0x19dd79[_0xcd9d('0x4f')][_0xcd9d('0x75')],_[_0xcd9d('0x8a')](_0x19dd79[_0xcd9d('0x4f')],['ids','id'])||{})[_0xcd9d('0x8b')](function(_0x2d5828){for(var _0x92e70c=0x0;_0x92e70c<_0x19dd79[_0xcd9d('0x4f')][_0xcd9d('0x75')][_0xcd9d('0x3d')];_0x92e70c+=0x1){socket[_0xcd9d('0x87')](_0xcd9d('0x73'),{'UserId':Number(_0x19dd79[_0xcd9d('0x4f')][_0xcd9d('0x75')][_0x92e70c]),'MailQueueId':Number(_0x19dd79['params']['id'])});}return _0x2d5828;});}})[_0xcd9d('0x2a')](respondWithResult(_0x7de303,null))['catch'](handleError(_0x7de303,null));};exports[_0xcd9d('0x86')]=function(_0xc8c44f,_0x1c445d,_0x363488){return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0xc8c44f[_0xcd9d('0x4b')]['id']}})[_0xcd9d('0x2a')](handleEntityNotFound(_0x1c445d,null))[_0xcd9d('0x2a')](function(_0x17d00a){if(_0x17d00a){return _0x17d00a['removeAgents'](_0xc8c44f[_0xcd9d('0x38')][_0xcd9d('0x75')])[_0xcd9d('0x2a')](function(){if(_[_0xcd9d('0x8c')](_0xc8c44f[_0xcd9d('0x38')][_0xcd9d('0x75')])){for(var _0xe51839=0x0;_0xe51839<_0xc8c44f[_0xcd9d('0x38')][_0xcd9d('0x75')][_0xcd9d('0x3d')];_0xe51839+=0x1){socket[_0xcd9d('0x87')](_0xcd9d('0x88'),{'UserId':Number(_0xc8c44f['query'][_0xcd9d('0x75')][_0xe51839]),'MailQueueId':Number(_0xc8c44f[_0xcd9d('0x4b')]['id'])});}}else{socket[_0xcd9d('0x87')](_0xcd9d('0x88'),{'UserId':Number(_0xc8c44f[_0xcd9d('0x38')]['ids']),'MailQueueId':Number(_0xc8c44f['params']['id'])});}});}})[_0xcd9d('0x2a')](respondWithStatusCode(_0x1c445d,null))[_0xcd9d('0x4a')](handleError(_0x1c445d,null));};exports['getAgents']=function(_0x582dac,_0x30c053,_0x4532fa){var _0x484af7={};var _0x3e53f5={};var _0x166730;var _0xea5d06;return db[_0xcd9d('0x46')][_0xcd9d('0x59')]({'where':{'id':_0x582dac['params']['id']}})[_0xcd9d('0x2a')](handleEntityNotFound(_0x30c053,null))[_0xcd9d('0x2a')](function(_0x4c623b){if(_0x4c623b){_0x166730=_0x4c623b;_0x3e53f5[_0xcd9d('0x35')]=_[_0xcd9d('0x37')](db['User'][_0xcd9d('0x32')]);_0x3e53f5[_0xcd9d('0x38')]=_[_0xcd9d('0x37')](_0x582dac[_0xcd9d('0x38')]);_0x3e53f5['filters']=_[_0xcd9d('0x3b')](_0x3e53f5[_0xcd9d('0x35')],_0x3e53f5[_0xcd9d('0x38')]);_0x484af7['attributes']=_[_0xcd9d('0x3b')](_0x3e53f5[_0xcd9d('0x35')],qs[_0xcd9d('0x3c')](_0x582dac['query']['fields']));_0x484af7[_0xcd9d('0x3a')]=_0x484af7[_0xcd9d('0x3a')][_0xcd9d('0x3d')]?_0x484af7[_0xcd9d('0x3a')]:_0x3e53f5[_0xcd9d('0x35')];_0x484af7[_0xcd9d('0x5b')]=qs[_0xcd9d('0x3f')](_0x582dac['query'][_0xcd9d('0x3f')]);_0x484af7[_0xcd9d('0x40')]=qs[_0xcd9d('0x39')](_[_0xcd9d('0x41')](_0x582dac['query'],_0x3e53f5[_0xcd9d('0x39')]));if(_0x582dac[_0xcd9d('0x38')][_0xcd9d('0x42')]){_0x484af7['where']=_[_0xcd9d('0x43')](_0x484af7[_0xcd9d('0x40')],{'$or':_['map'](_0x484af7[_0xcd9d('0x3a')],function(_0x162b86){var _0x5c7849={};_0x5c7849[_0x162b86]={'$like':'%'+_0x582dac[_0xcd9d('0x38')]['filter']+'%'};return _0x5c7849;})});}_0x484af7=_[_0xcd9d('0x43')]({},_0x484af7,_0x582dac[_0xcd9d('0x45')]);return _0x166730[_0xcd9d('0x8d')](_0x484af7);}})['then'](function(_0x1db24d){if(_0x1db24d){_0xea5d06=_0x1db24d[_0xcd9d('0x3d')];if(!_0x582dac[_0xcd9d('0x38')][_0xcd9d('0x3e')](_0xcd9d('0x5a'))){_0x484af7[_0xcd9d('0x24')]=qs[_0xcd9d('0x24')](_0x582dac[_0xcd9d('0x38')][_0xcd9d('0x24')]);_0x484af7['offset']=qs['offset'](_0x582dac['query'][_0xcd9d('0x22')]);}return _0x166730['getAgents'](_0x484af7);}})[_0xcd9d('0x2a')](function(_0x1ec4a3){if(_0x1ec4a3){return _0x1ec4a3?{'count':_0xea5d06,'rows':_0x1ec4a3}:null;}})[_0xcd9d('0x2a')](respondWithResult(_0x30c053,null))[_0xcd9d('0x4a')](handleError(_0x30c053,null));}; \ No newline at end of file +var _0x4065=['rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','include','rows','catch','params','model','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','pick','MailQueueId','findAll','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','online','Agents','addTeams','findOrCreate','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','transaction','ids','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue'];(function(_0x4174f9,_0x476bd6){var _0x4a6022=function(_0x2f65ce){while(--_0x2f65ce){_0x4174f9['push'](_0x4174f9['shift']());}};_0x4a6022(++_0x476bd6);}(_0x4065,0xdc));var _0x5406=function(_0x16ecf3,_0x44607e){_0x16ecf3=_0x16ecf3-0x0;var _0x35f29a=_0x4065[_0x16ecf3];return _0x35f29a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5406('0x0'));var rp=require('request-promise');var moment=require(_0x5406('0x1'));var BPromise=require(_0x5406('0x2'));var Mustache=require(_0x5406('0x3'));var util=require('util');var path=require(_0x5406('0x4'));var sox=require(_0x5406('0x5'));var csv=require('to-csv');var ejs=require(_0x5406('0x6'));var fs=require('fs');var fs_extra=require(_0x5406('0x7'));var _=require(_0x5406('0x8'));var squel=require(_0x5406('0x9'));var crypto=require(_0x5406('0xa'));var jsforce=require(_0x5406('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5406('0xc'));var querystring=require(_0x5406('0xd'));var Papa=require(_0x5406('0xe'));var Redis=require(_0x5406('0xf'));var authService=require(_0x5406('0x10'));var qs=require(_0x5406('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5406('0x12'));var logger=require(_0x5406('0x13'))(_0x5406('0x14'));var utils=require(_0x5406('0x15'));var config=require(_0x5406('0x16'));var licenseUtil=require(_0x5406('0x17'));var db=require('../../mysqldb')['db'];config[_0x5406('0x18')]=_[_0x5406('0x19')](config['redis'],{'host':_0x5406('0x1a'),'port':0x18eb});var socket=require(_0x5406('0x1b'))(new Redis(config[_0x5406('0x18')]));require(_0x5406('0x1c'))[_0x5406('0x1d')](socket);function respondWithStatusCode(_0x333e24,_0x16bf9b){_0x16bf9b=_0x16bf9b||0xcc;return function(_0x2a6603){if(_0x2a6603){return _0x333e24[_0x5406('0x1e')](_0x16bf9b);}return _0x333e24['status'](_0x16bf9b)[_0x5406('0x1f')]();};}function respondWithResult(_0x17806b,_0xb982cc){_0xb982cc=_0xb982cc||0xc8;return function(_0xb25b29){if(_0xb25b29){return _0x17806b['status'](_0xb982cc)[_0x5406('0x20')](_0xb25b29);}};}function respondWithFilteredResult(_0x1bf1f1,_0x43279d){return function(_0x22f6ba){if(_0x22f6ba){var _0x5cb4c3=typeof _0x43279d[_0x5406('0x21')]===_0x5406('0x22')&&typeof _0x43279d[_0x5406('0x23')]==='undefined';var _0x453ee5=_0x22f6ba[_0x5406('0x24')];var _0x498a7c=_0x5cb4c3?0x0:_0x43279d[_0x5406('0x21')];var _0x323442=_0x5cb4c3?_0x22f6ba[_0x5406('0x24')]:_0x43279d['offset']+_0x43279d[_0x5406('0x23')];var _0x353e89;if(_0x323442>=_0x453ee5){_0x323442=_0x453ee5;_0x353e89=0xc8;}else{_0x353e89=0xce;}_0x1bf1f1[_0x5406('0x25')](_0x353e89);return _0x1bf1f1[_0x5406('0x26')](_0x5406('0x27'),_0x498a7c+'-'+_0x323442+'/'+_0x453ee5)[_0x5406('0x20')](_0x22f6ba);}return null;};}function patchUpdates(_0x12c6b6){return function(_0x4225e7){try{jsonpatch['apply'](_0x4225e7,_0x12c6b6,!![]);}catch(_0x15aea4){return BPromise['reject'](_0x15aea4);}return _0x4225e7[_0x5406('0x28')]();};}function saveUpdates(_0x3856fa,_0x57c331){return function(_0x471032){if(_0x471032){return _0x471032[_0x5406('0x29')](_0x3856fa)[_0x5406('0x2a')](function(_0xc3e2e8){return _0xc3e2e8;});}return null;};}function removeEntity(_0x98d6fb,_0x6c96ec){return function(_0x2517ae){if(_0x2517ae){return _0x2517ae[_0x5406('0x2b')]()['then'](function(){var _0x2256bd=_0x2517ae[_0x5406('0x2c')]({'plain':!![]});var _0xfba3e7=_0x5406('0x2d');return db[_0x5406('0x2e')][_0x5406('0x2b')]({'where':{'type':_0xfba3e7,'resourceId':_0x2256bd['id']}})[_0x5406('0x2a')](function(){return _0x2517ae;});})[_0x5406('0x2a')](function(){_0x98d6fb['status'](0xcc)[_0x5406('0x1f')]();});}};}function handleEntityNotFound(_0x49a7a5,_0x1b6123){return function(_0x5cb836){if(!_0x5cb836){_0x49a7a5[_0x5406('0x1e')](0x194);}return _0x5cb836;};}function handleError(_0x3cf64f,_0x3e0b7f){_0x3e0b7f=_0x3e0b7f||0x1f4;return function(_0x24255f){logger[_0x5406('0x2f')](_0x24255f[_0x5406('0x30')]);if(_0x24255f[_0x5406('0x31')]){delete _0x24255f[_0x5406('0x31')];}_0x3cf64f['status'](_0x3e0b7f)[_0x5406('0x32')](_0x24255f);};}exports[_0x5406('0x33')]=function(_0x2e9ab9,_0x506abf){var _0x431e70={},_0x294993={},_0x565475={'count':0x0,'rows':[]};var _0x4f751c=_[_0x5406('0x34')](db[_0x5406('0x35')][_0x5406('0x36')],function(_0x1ff0d4){return{'name':_0x1ff0d4[_0x5406('0x37')],'type':_0x1ff0d4['type']['key']};});_0x294993['model']=_[_0x5406('0x34')](_0x4f751c,_0x5406('0x31'));_0x294993[_0x5406('0x38')]=_[_0x5406('0x39')](_0x2e9ab9['query']);_0x294993[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0x294993['model'],_0x294993[_0x5406('0x38')]);_0x431e70[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x294993['model'],qs[_0x5406('0x3d')](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x3d')]));_0x431e70['attributes']=_0x431e70['attributes']['length']?_0x431e70[_0x5406('0x3c')]:_0x294993['model'];if(!_0x2e9ab9['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x431e70[_0x5406('0x23')]=qs['limit'](_0x2e9ab9['query']['limit']);_0x431e70[_0x5406('0x21')]=qs[_0x5406('0x21')](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x21')]);}_0x431e70['order']=qs['sort'](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x40')]);_0x431e70[_0x5406('0x41')]=qs['filters'](_['pick'](_0x2e9ab9[_0x5406('0x38')],_0x294993['filters']),_0x4f751c);if(_0x2e9ab9[_0x5406('0x38')][_0x5406('0x42')]){_0x431e70['where']=_[_0x5406('0x43')](_0x431e70[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x4f751c,function(_0x724619){if(_0x724619[_0x5406('0x44')]!=='VIRTUAL'){var _0x238d2a={};_0x238d2a[_0x724619[_0x5406('0x31')]]={'$like':'%'+_0x2e9ab9[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x238d2a;}})});}_0x431e70=_[_0x5406('0x43')]({},_0x431e70,_0x2e9ab9[_0x5406('0x45')]);var _0x45aa06={'where':_0x431e70[_0x5406('0x41')]};return db['MailQueue'][_0x5406('0x24')](_0x45aa06)[_0x5406('0x2a')](function(_0x1f6175){_0x565475[_0x5406('0x24')]=_0x1f6175;if(_0x2e9ab9[_0x5406('0x38')]['includeAll']){_0x431e70[_0x5406('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x431e70);})['then'](function(_0x549351){_0x565475[_0x5406('0x47')]=_0x549351;return _0x565475;})[_0x5406('0x2a')](respondWithFilteredResult(_0x506abf,_0x431e70))[_0x5406('0x48')](handleError(_0x506abf,null));};exports['show']=function(_0x535e07,_0xf24d3d){var _0x1aa5d6={'raw':!![],'where':{'id':_0x535e07[_0x5406('0x49')]['id']}},_0xbd7cde={};_0xbd7cde[_0x5406('0x4a')]=_[_0x5406('0x39')](db[_0x5406('0x35')][_0x5406('0x36')]);_0xbd7cde[_0x5406('0x38')]=_[_0x5406('0x39')](_0x535e07[_0x5406('0x38')]);_0xbd7cde[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0xbd7cde[_0x5406('0x4a')],_0xbd7cde[_0x5406('0x38')]);_0x1aa5d6['attributes']=_[_0x5406('0x3b')](_0xbd7cde['model'],qs[_0x5406('0x3d')](_0x535e07[_0x5406('0x38')]['fields']));_0x1aa5d6['attributes']=_0x1aa5d6[_0x5406('0x3c')][_0x5406('0x4b')]?_0x1aa5d6[_0x5406('0x3c')]:_0xbd7cde[_0x5406('0x4a')];if(_0x535e07[_0x5406('0x38')]['includeAll']){_0x1aa5d6[_0x5406('0x46')]=[{'all':!![]}];}_0x1aa5d6=_[_0x5406('0x43')]({},_0x1aa5d6,_0x535e07[_0x5406('0x45')]);return db['MailQueue'][_0x5406('0x4c')](_0x1aa5d6)[_0x5406('0x2a')](handleEntityNotFound(_0xf24d3d,null))[_0x5406('0x2a')](respondWithResult(_0xf24d3d,null))[_0x5406('0x48')](handleError(_0xf24d3d,null));};exports['create']=function(_0x40c851,_0x1b1475){return db[_0x5406('0x35')]['create'](_0x40c851[_0x5406('0x4d')],{})['then'](function(_0xfc5264){var _0x51e7b8=_0x40c851[_0x5406('0x4e')]['get']({'plain':!![]});if(!_0x51e7b8)throw new Error(_0x5406('0x4f'));if(_0x51e7b8[_0x5406('0x50')]===_0x5406('0x4e')){var _0x27dc86=_0xfc5264[_0x5406('0x2c')]({'plain':!![]});var _0x2220b0=_0x5406('0x2d');return db[_0x5406('0x51')][_0x5406('0x4c')]({'where':{'name':_0x2220b0,'userProfileId':_0x51e7b8[_0x5406('0x52')]},'raw':!![]})[_0x5406('0x2a')](function(_0x227510){if(_0x227510&&_0x227510[_0x5406('0x53')]===0x0){return db[_0x5406('0x2e')][_0x5406('0x54')]({'name':_0x27dc86['name'],'resourceId':_0x27dc86['id'],'type':_0x227510[_0x5406('0x31')],'sectionId':_0x227510['id']},{})['then'](function(){return _0xfc5264;});}else{return _0xfc5264;}})[_0x5406('0x48')](function(_0x3934bd){logger[_0x5406('0x2f')](_0x5406('0x55'),_0x3934bd);throw _0x3934bd;});}return _0xfc5264;})['then'](respondWithResult(_0x1b1475,0xc9))[_0x5406('0x48')](handleError(_0x1b1475,null));};exports[_0x5406('0x29')]=function(_0x432c2a,_0x30d55d){if(_0x432c2a[_0x5406('0x4d')]['id']){delete _0x432c2a[_0x5406('0x4d')]['id'];}return db['MailQueue'][_0x5406('0x4c')]({'where':{'id':_0x432c2a[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x30d55d,null))[_0x5406('0x2a')](saveUpdates(_0x432c2a[_0x5406('0x4d')],null))[_0x5406('0x2a')](respondWithResult(_0x30d55d,null))[_0x5406('0x48')](handleError(_0x30d55d,null));};exports['destroy']=function(_0x4702f4,_0x409be1){return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x4702f4[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x409be1,null))[_0x5406('0x2a')](removeEntity(_0x409be1,null))['catch'](handleError(_0x409be1,null));};exports[_0x5406('0x56')]=function(_0x47faaa,_0x41b191){return db[_0x5406('0x35')][_0x5406('0x56')]()['then'](respondWithResult(_0x41b191,null))[_0x5406('0x48')](handleError(_0x41b191,null));};exports[_0x5406('0x57')]=function(_0x3e648b,_0x3ed768,_0x364340){var _0x26bdbb={'raw':!![],'where':{}},_0x558f2c={},_0x17c4cd;return db[_0x5406('0x35')][_0x5406('0x58')]({'where':{'id':_0x3e648b[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x3ed768,null))['then'](function(_0x4ff8db){if(_0x4ff8db){_0x17c4cd=_0x4ff8db[_0x5406('0x2c')]({'plain':!![]});_0x558f2c[_0x5406('0x4a')]=_['keys'](db['UserMailQueue'][_0x5406('0x36')]);_0x558f2c[_0x5406('0x38')]=_[_0x5406('0x39')](_0x3e648b[_0x5406('0x38')]);_0x558f2c[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0x558f2c[_0x5406('0x4a')],_0x558f2c['query']);_0x26bdbb[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x558f2c[_0x5406('0x4a')],qs['fields'](_0x3e648b['query'][_0x5406('0x3d')]));_0x26bdbb[_0x5406('0x3c')]=_0x26bdbb[_0x5406('0x3c')]['length']?_0x26bdbb[_0x5406('0x3c')]:_0x558f2c['model'];if(!_0x3e648b[_0x5406('0x38')]['hasOwnProperty'](_0x5406('0x3f'))){_0x26bdbb[_0x5406('0x23')]=qs['limit'](_0x3e648b[_0x5406('0x38')]['limit']);_0x26bdbb['offset']=qs[_0x5406('0x21')](_0x3e648b[_0x5406('0x38')]['offset']);}_0x26bdbb[_0x5406('0x59')]=qs['sort'](_0x3e648b['query']['sort']);_0x26bdbb['where']=qs[_0x5406('0x3a')](_[_0x5406('0x5a')](_0x3e648b[_0x5406('0x38')],_0x558f2c[_0x5406('0x3a')]));_0x26bdbb[_0x5406('0x41')][_0x5406('0x5b')]=_0x4ff8db['id'];if(_0x3e648b['query'][_0x5406('0x42')]){_0x26bdbb[_0x5406('0x41')]=_[_0x5406('0x43')](_0x26bdbb[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x26bdbb['attributes'],function(_0x38bb72){var _0x4e3726={};_0x4e3726[_0x38bb72]={'$like':'%'+_0x3e648b['query'][_0x5406('0x42')]+'%'};return _0x4e3726;})});}_0x26bdbb=_[_0x5406('0x43')]({},_0x26bdbb,_0x3e648b[_0x5406('0x45')]);return db['UserMailQueue'][_0x5406('0x5c')](_0x26bdbb);}})[_0x5406('0x2a')](function(_0x5cd5a6){if(_0x5cd5a6){return db[_0x5406('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x5cd5a6,_0x5406('0x5e')),'role':_0x5406('0x5f')},'attributes':['id',_0x5406('0x31'),_0x5406('0x60'),_0x5406('0x61'),_0x5406('0x62')]});}})[_0x5406('0x2a')](function(_0x479777){if(_0x479777){return{'count':_0x479777[_0x5406('0x24')],'rows':_[_0x5406('0x34')](_0x479777[_0x5406('0x47')],function(_0x1929c5){return{'membername':_0x1929c5[_0x5406('0x31')],'UserId':_0x1929c5['id'],'queue_name':_0x17c4cd['name'],'MailQueueId':_0x17c4cd['id'],'interface':util[_0x5406('0x63')](_0x5406('0x64'),_0x5406('0x65'),_0x1929c5[_0x5406('0x31')]),'penalty':0x0,'paused':_0x1929c5[_0x5406('0x60')],'createdAt':_0x1929c5['createdAt'],'updatedAt':_0x1929c5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5406('0x2a')](respondWithFilteredResult(_0x3ed768,_0x26bdbb))[_0x5406('0x48')](handleError(_0x3ed768,null));};exports['getTeams']=function(_0x211eb7,_0x655fca,_0x46cb82){var _0x19c43b={};var _0x1c1f1e={};var _0x19dab2;var _0x275fa8;return db[_0x5406('0x35')][_0x5406('0x58')]({'where':{'id':_0x211eb7[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x655fca,null))[_0x5406('0x2a')](function(_0x333b4d){if(_0x333b4d){_0x19dab2=_0x333b4d;_0x1c1f1e[_0x5406('0x4a')]=_[_0x5406('0x39')](db[_0x5406('0x66')][_0x5406('0x36')]);_0x1c1f1e[_0x5406('0x38')]=_[_0x5406('0x39')](_0x211eb7[_0x5406('0x38')]);_0x1c1f1e['filters']=_[_0x5406('0x3b')](_0x1c1f1e['model'],_0x1c1f1e[_0x5406('0x38')]);_0x19c43b[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x1c1f1e['model'],qs[_0x5406('0x3d')](_0x211eb7['query']['fields']));_0x19c43b[_0x5406('0x3c')]=_0x19c43b[_0x5406('0x3c')][_0x5406('0x4b')]?_0x19c43b[_0x5406('0x3c')]:_0x1c1f1e[_0x5406('0x4a')];_0x19c43b['order']=qs[_0x5406('0x40')](_0x211eb7[_0x5406('0x38')]['sort']);_0x19c43b[_0x5406('0x41')]=qs['filters'](_[_0x5406('0x5a')](_0x211eb7[_0x5406('0x38')],_0x1c1f1e[_0x5406('0x3a')]));if(_0x211eb7[_0x5406('0x38')][_0x5406('0x42')]){_0x19c43b[_0x5406('0x41')]=_[_0x5406('0x43')](_0x19c43b[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x19c43b[_0x5406('0x3c')],function(_0x2ae2df){var _0x193e46={};_0x193e46[_0x2ae2df]={'$like':'%'+_0x211eb7[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x193e46;})});}_0x19c43b=_[_0x5406('0x43')]({},_0x19c43b,_0x211eb7[_0x5406('0x45')]);return _0x19dab2[_0x5406('0x67')](_0x19c43b);}})[_0x5406('0x2a')](function(_0x30dfe9){if(_0x30dfe9){_0x275fa8=_0x30dfe9[_0x5406('0x4b')];if(!_0x211eb7['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x19c43b['limit']=qs['limit'](_0x211eb7[_0x5406('0x38')][_0x5406('0x23')]);_0x19c43b[_0x5406('0x21')]=qs[_0x5406('0x21')](_0x211eb7[_0x5406('0x38')][_0x5406('0x21')]);}return _0x19dab2['getTeams'](_0x19c43b);}})[_0x5406('0x2a')](function(_0x5ae9b6){if(_0x5ae9b6){return _0x5ae9b6?{'count':_0x275fa8,'rows':_0x5ae9b6}:null;}})[_0x5406('0x2a')](respondWithResult(_0x655fca,null))['catch'](handleError(_0x655fca,null));};exports['addTeams']=function(_0x1c1387,_0x404697,_0x4f2c21){var _0x3dcda3=_0x1c1387[_0x5406('0x4d')]['ids'];return db[_0x5406('0x66')][_0x5406('0x5c')]({'where':{'id':_0x3dcda3},'attributes':['id'],'include':[{'model':db[_0x5406('0x5d')],'as':'Agents','attributes':['id',_0x5406('0x31'),_0x5406('0x68'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x165903){if(_0x165903){var _0x2f0100=_['flatMap'](_0x165903,function(_0x2e28f0){var _0xe3cd44=_0x2e28f0[_0x5406('0x2c')]({'plain':!![]});return _0xe3cd44[_0x5406('0x69')];});return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x1c1387[_0x5406('0x49')]['id']}})['then'](function(_0x282acb){return db['sequelize']['transaction'](function(_0x316ef5){return _0x282acb[_0x5406('0x6a')](_0x3dcda3,{'transaction':_0x316ef5})[_0x5406('0x2a')](function(){return BPromise['each'](_0x2f0100,function(_0x144b8e){return db['UserMailQueue'][_0x5406('0x6b')]({'where':{'UserId':_0x144b8e['id'],'MailQueueId':_0x1c1387[_0x5406('0x49')]['id']},'transaction':_0x316ef5});});})[_0x5406('0x2a')](function(){_0x2f0100['forEach'](function(_0x8b6299){socket['emit'](_0x5406('0x6c'),{'UserId':_0x8b6299['id'],'MailQueueId':_0x282acb['id']});});});});});}})[_0x5406('0x2a')](respondWithStatusCode(_0x404697,null))['catch'](handleError(_0x404697,null));};exports[_0x5406('0x6d')]=function(_0x1a0bdf,_0x353e76,_0x1abbbd){return db['Team']['findAll']({'where':{'id':_0x1a0bdf['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x5406('0x5d')],'as':_0x5406('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x353e76,null))[_0x5406('0x2a')](function(_0x26b2bd){var _0x552ca3=_[_0x5406('0x34')](_0x26b2bd,'id');var _0x1b42e7=[];var _0x29dd39=[];var _0x344d79=squel[_0x5406('0x6e')]();_0x344d79[_0x5406('0x6f')]('tq.TeamId')['from'](_0x5406('0x70'),'tq')[_0x5406('0x71')](_0x5406('0x72'),'ut',_0x5406('0x73'))['where']('MailQueueId\x20=\x20?',_0x1a0bdf['params']['id']);for(var _0x3be0d9=0x0;_0x3be0d9<_0x26b2bd[_0x5406('0x4b')];_0x3be0d9+=0x1){let _0x5b234d=_0x26b2bd[_0x3be0d9];for(var _0x277dcf=0x0;_0x277dcf<_0x5b234d[_0x5406('0x69')][_0x5406('0x4b')];_0x277dcf+=0x1){let _0x5e6c8f=_0x5b234d[_0x5406('0x69')][_0x277dcf];var _0x32515f=_0x344d79[_0x5406('0x74')]();_0x32515f[_0x5406('0x41')]('ut.UserId\x20=\x20?',_0x5e6c8f['id']);_0x29dd39['push'](db[_0x5406('0x75')][_0x5406('0x38')](_0x32515f[_0x5406('0x76')](),{'type':db[_0x5406('0x75')][_0x5406('0x77')]['SELECT']})[_0x5406('0x2a')](function(_0x367211){if(_0x367211[_0x5406('0x4b')]===0x1){return _0x5e6c8f['id'];}else{var _0x455b16=_[_0x5406('0x78')](_[_0x5406('0x34')](_0x367211,_0x5406('0x79')),function(_0xcfc136){return _['includes'](_0x552ca3,_0xcfc136);});if(_0x455b16){return _0x5e6c8f['id'];}}}));}}return BPromise[_0x5406('0x7a')](_0x29dd39)[_0x5406('0x2a')](function(_0x5cbbb0){_0x1b42e7=_(_0x1b42e7)[_0x5406('0x7b')](_0x5cbbb0)[_0x5406('0x7c')]()['value']();return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x1a0bdf[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](function(_0x97936){return db[_0x5406('0x75')][_0x5406('0x7d')](function(_0x5d95ec){return _0x97936[_0x5406('0x6d')](_0x1a0bdf[_0x5406('0x38')][_0x5406('0x7e')],{'transaction':_0x5d95ec})[_0x5406('0x2a')](function(){if(!_[_0x5406('0x7f')](_0x1b42e7)){return _0x97936[_0x5406('0x80')](_0x1b42e7,{'transaction':_0x5d95ec});}})[_0x5406('0x2a')](function(){_0x1b42e7[_0x5406('0x81')](function(_0x2cbf12){socket[_0x5406('0x82')](_0x5406('0x83'),{'UserId':_0x2cbf12,'MailQueueId':_0x97936['id']});});});});});});})['then'](respondWithStatusCode(_0x353e76,null))['catch'](handleError(_0x353e76,null));};exports[_0x5406('0x84')]=function(_0x4965c1,_0x20f8a3,_0x27c479){return db[_0x5406('0x35')]['find']({'where':{'id':_0x4965c1[_0x5406('0x49')]['id']}})['then'](handleEntityNotFound(_0x20f8a3,null))[_0x5406('0x2a')](function(_0x47d9a1){if(_0x47d9a1){return _0x47d9a1[_0x5406('0x84')](_0x4965c1[_0x5406('0x4d')][_0x5406('0x7e')],_[_0x5406('0x85')](_0x4965c1[_0x5406('0x4d')],['ids','id'])||{})[_0x5406('0x86')](function(_0x16bc35){for(var _0x4e80a0=0x0;_0x4e80a0<_0x4965c1['body'][_0x5406('0x7e')][_0x5406('0x4b')];_0x4e80a0+=0x1){socket[_0x5406('0x82')](_0x5406('0x6c'),{'UserId':Number(_0x4965c1[_0x5406('0x4d')][_0x5406('0x7e')][_0x4e80a0]),'MailQueueId':Number(_0x4965c1[_0x5406('0x49')]['id'])});}return _0x16bc35;});}})[_0x5406('0x2a')](respondWithResult(_0x20f8a3,null))['catch'](handleError(_0x20f8a3,null));};exports[_0x5406('0x80')]=function(_0x2b0fb1,_0x21f6a3,_0x4a535d){return db['MailQueue']['find']({'where':{'id':_0x2b0fb1['params']['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x21f6a3,null))[_0x5406('0x2a')](function(_0x579a53){if(_0x579a53){return _0x579a53[_0x5406('0x80')](_0x2b0fb1['query']['ids'])['then'](function(){if(_[_0x5406('0x87')](_0x2b0fb1[_0x5406('0x38')]['ids'])){for(var _0x259f7d=0x0;_0x259f7d<_0x2b0fb1[_0x5406('0x38')]['ids'][_0x5406('0x4b')];_0x259f7d+=0x1){socket['emit'](_0x5406('0x83'),{'UserId':Number(_0x2b0fb1[_0x5406('0x38')][_0x5406('0x7e')][_0x259f7d]),'MailQueueId':Number(_0x2b0fb1[_0x5406('0x49')]['id'])});}}else{socket[_0x5406('0x82')]('userMailQueue:remove',{'UserId':Number(_0x2b0fb1[_0x5406('0x38')][_0x5406('0x7e')]),'MailQueueId':Number(_0x2b0fb1[_0x5406('0x49')]['id'])});}});}})[_0x5406('0x2a')](respondWithStatusCode(_0x21f6a3,null))[_0x5406('0x48')](handleError(_0x21f6a3,null));};exports[_0x5406('0x88')]=function(_0xfce2bb,_0x4d83c9,_0x453df0){var _0x1587fa={};var _0x37128d={};var _0x251067;var _0x2a1153;return db[_0x5406('0x35')]['findOne']({'where':{'id':_0xfce2bb['params']['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x4d83c9,null))['then'](function(_0x8fcb90){if(_0x8fcb90){_0x251067=_0x8fcb90;_0x37128d['model']=_['keys'](db[_0x5406('0x5d')]['rawAttributes']);_0x37128d[_0x5406('0x38')]=_['keys'](_0xfce2bb[_0x5406('0x38')]);_0x37128d['filters']=_[_0x5406('0x3b')](_0x37128d['model'],_0x37128d[_0x5406('0x38')]);_0x1587fa[_0x5406('0x3c')]=_['intersection'](_0x37128d[_0x5406('0x4a')],qs[_0x5406('0x3d')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x3d')]));_0x1587fa[_0x5406('0x3c')]=_0x1587fa[_0x5406('0x3c')][_0x5406('0x4b')]?_0x1587fa[_0x5406('0x3c')]:_0x37128d['model'];_0x1587fa[_0x5406('0x59')]=qs[_0x5406('0x40')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x40')]);_0x1587fa['where']=qs['filters'](_[_0x5406('0x5a')](_0xfce2bb[_0x5406('0x38')],_0x37128d[_0x5406('0x3a')]));if(_0xfce2bb[_0x5406('0x38')][_0x5406('0x42')]){_0x1587fa['where']=_['merge'](_0x1587fa[_0x5406('0x41')],{'$or':_['map'](_0x1587fa[_0x5406('0x3c')],function(_0x537abe){var _0x3b79dc={};_0x3b79dc[_0x537abe]={'$like':'%'+_0xfce2bb[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x3b79dc;})});}_0x1587fa=_[_0x5406('0x43')]({},_0x1587fa,_0xfce2bb[_0x5406('0x45')]);return _0x251067[_0x5406('0x88')](_0x1587fa);}})[_0x5406('0x2a')](function(_0x1a58cf){if(_0x1a58cf){_0x2a1153=_0x1a58cf[_0x5406('0x4b')];if(!_0xfce2bb['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x1587fa[_0x5406('0x23')]=qs[_0x5406('0x23')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x23')]);_0x1587fa['offset']=qs[_0x5406('0x21')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x21')]);}return _0x251067[_0x5406('0x88')](_0x1587fa);}})['then'](function(_0x5e92ed){if(_0x5e92ed){return _0x5e92ed?{'count':_0x2a1153,'rows':_0x5e92ed}:null;}})[_0x5406('0x2a')](respondWithResult(_0x4d83c9,null))['catch'](handleError(_0x4d83c9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 9ed239a..a42b3dd 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 _0x4fdb=['hook','exports','../../mysqldb','MailQueue','remove','emit'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x4fdb,0x164));var _0xb4fd=function(_0x3b4769,_0xef57da){_0x3b4769=_0x3b4769-0x0;var _0x3e69f3=_0x4fdb[_0x3b4769];return _0x3e69f3;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xb4fd('0x0'))['db'][_0xb4fd('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb4fd('0x2')};function emitEvent(_0x5b2450){return function(_0x3f8ecd,_0x56e2bd,_0xdf0ee1){MailQueueEvents[_0xb4fd('0x3')](_0x5b2450+':'+_0x3f8ecd['id'],_0x3f8ecd);MailQueueEvents[_0xb4fd('0x3')](_0x5b2450,_0x3f8ecd);_0xdf0ee1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xb4fd('0x4')](e,emitEvent(event));}}module[_0xb4fd('0x5')]=MailQueueEvents; \ No newline at end of file +var _0x30a5=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d7f76,_0x464b31){var _0x289613=function(_0x5a3689){while(--_0x5a3689){_0x3d7f76['push'](_0x3d7f76['shift']());}};_0x289613(++_0x464b31);}(_0x30a5,0xcc));var _0x530a=function(_0x29d4b5,_0x1913e2){_0x29d4b5=_0x29d4b5-0x0;var _0x3fbb01=_0x30a5[_0x29d4b5];return _0x3fbb01;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x530a('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x530a('0x1')};function emitEvent(_0x3c5e55){return function(_0x11a5d5,_0x1fb39d,_0x10aec4){MailQueueEvents[_0x530a('0x2')](_0x3c5e55+':'+_0x11a5d5['id'],_0x11a5d5);MailQueueEvents['emit'](_0x3c5e55,_0x11a5d5);_0x10aec4(null);};}for(var e in events){if(events[_0x530a('0x3')](e)){var event=events[e];MailQueue[_0x530a('0x4')](e,emitEvent(event));}}module[_0x530a('0x5')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9d13dbd..7850a27 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 _0x368c=['bluebird','path','rimraf','../../config/environment','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x368c,0xcf));var _0xc368=function(_0x3a3549,_0x100a87){_0x3a3549=_0x3a3549-0x0;var _0x339f12=_0x368c[_0x3a3549];return _0x339f12;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc368('0x0'))(_0xc368('0x1'));var moment=require(_0xc368('0x2'));var BPromise=require(_0xc368('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc368('0x4'));var rimraf=require(_0xc368('0x5'));var config=require(_0xc368('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x565531,_0xfee9bc){return _0x565531['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d04=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','../../config/logger'];(function(_0x2257c3,_0x38dc9b){var _0x53638c=function(_0x26bcdb){while(--_0x26bcdb){_0x2257c3['push'](_0x2257c3['shift']());}};_0x53638c(++_0x38dc9b);}(_0x1d04,0x15f));var _0x41d0=function(_0x3bee55,_0x4e25c8){_0x3bee55=_0x3bee55-0x0;var _0x5649d2=_0x1d04[_0x3bee55];return _0x5649d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41d0('0x0'))(_0x41d0('0x1'));var moment=require(_0x41d0('0x2'));var BPromise=require(_0x41d0('0x3'));var rp=require(_0x41d0('0x4'));var fs=require('fs');var path=require(_0x41d0('0x5'));var rimraf=require(_0x41d0('0x6'));var config=require(_0x41d0('0x7'));var attributes=require(_0x41d0('0x8'));module['exports']=function(_0x55771c,_0x58cb4c){return _0x55771c[_0x41d0('0x9')](_0x41d0('0xa'),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 9bb31b2..d4a1413 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 _0xe729=['request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','find','info','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xe729,0x1e4));var _0x9e72=function(_0x188415,_0x2c2124){_0x188415=_0x188415-0x0;var _0x1aad44=_0xe729[_0x188415];return _0x1aad44;};'use strict';var _=require(_0x9e72('0x0'));var util=require(_0x9e72('0x1'));var moment=require(_0x9e72('0x2'));var BPromise=require(_0x9e72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e72('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e72('0x5'));var logger=require(_0x9e72('0x6'))(_0x9e72('0x7'));var config=require(_0x9e72('0x8'));var jayson=require(_0x9e72('0x9'));var client=jayson[_0x9e72('0xa')]['http']({'port':0x232a});config[_0x9e72('0xb')]=_[_0x9e72('0xc')](config['redis'],{'host':_0x9e72('0xd'),'port':0x18eb});var socket=require(_0x9e72('0xe'))(new Redis(config[_0x9e72('0xb')]));require(_0x9e72('0xf'))[_0x9e72('0x10')](socket);function respondWithRpcPromise(_0x53e2d8,_0x6451b2,_0x32174f){return new BPromise(function(_0x305434,_0xe2bef9){return client[_0x9e72('0x11')](_0x53e2d8,_0x32174f)[_0x9e72('0x12')](function(_0x1353d3){logger['info'](_0x9e72('0x13'),_0x6451b2,_0x9e72('0x14'));logger['debug'](_0x9e72('0x15'),_0x6451b2,'request\x20sent',JSON['stringify'](_0x1353d3));if(_0x1353d3[_0x9e72('0x16')]){if(_0x1353d3[_0x9e72('0x16')][_0x9e72('0x17')]===0x1f4){logger[_0x9e72('0x16')](_0x9e72('0x13'),_0x6451b2,_0x1353d3[_0x9e72('0x16')][_0x9e72('0x18')]);return _0xe2bef9(_0x1353d3[_0x9e72('0x16')]['message']);}logger[_0x9e72('0x16')](_0x9e72('0x13'),_0x6451b2,_0x1353d3[_0x9e72('0x16')][_0x9e72('0x18')]);return _0x305434(_0x1353d3[_0x9e72('0x16')][_0x9e72('0x18')]);}else{logger['info'](_0x9e72('0x13'),_0x6451b2,_0x9e72('0x14'));_0x305434(_0x1353d3[_0x9e72('0x19')][_0x9e72('0x18')]);}})[_0x9e72('0x1a')](function(_0x165f23){logger[_0x9e72('0x16')](_0x9e72('0x13'),_0x6451b2,_0x165f23);_0xe2bef9(_0x165f23);});});}exports['GetMailQueue']=function(_0x2420ca){var _0x484c5d=this;return new Promise(function(_0x2ecc23,_0x1c98f1){return db[_0x9e72('0x1b')][_0x9e72('0x1c')]({'raw':_0x2420ca[_0x9e72('0x1d')]?_0x2420ca[_0x9e72('0x1d')][_0x9e72('0x1e')]===undefined?!![]:![]:!![],'where':_0x2420ca['options']?_0x2420ca[_0x9e72('0x1d')][_0x9e72('0x1f')]||null:null,'attributes':_0x2420ca[_0x9e72('0x1d')]?_0x2420ca[_0x9e72('0x1d')][_0x9e72('0x20')]||null:null,'limit':_0x2420ca['options']?_0x2420ca[_0x9e72('0x1d')][_0x9e72('0x21')]||null:null,'include':_0x2420ca[_0x9e72('0x1d')]?_0x2420ca[_0x9e72('0x1d')][_0x9e72('0x22')]?_['map'](_0x2420ca[_0x9e72('0x1d')]['include'],function(_0x1195a6){return{'model':db[_0x1195a6[_0x9e72('0x23')]],'as':_0x1195a6['as'],'attributes':_0x1195a6[_0x9e72('0x20')],'include':_0x1195a6[_0x9e72('0x22')]?_[_0x9e72('0x24')](_0x1195a6[_0x9e72('0x22')],function(_0x1ad19a){return{'model':db[_0x1ad19a[_0x9e72('0x23')]],'as':_0x1ad19a['as'],'attributes':_0x1ad19a[_0x9e72('0x20')],'include':_0x1ad19a['include']?_['map'](_0x1ad19a['include'],function(_0x4dcb65){return{'model':db[_0x4dcb65[_0x9e72('0x23')]],'as':_0x4dcb65['as'],'attributes':_0x4dcb65[_0x9e72('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9e72('0x12')](function(_0x495e2b){logger['info'](_0x9e72('0x25'),_0x2420ca);logger['debug'](_0x9e72('0x25'),_0x2420ca,JSON['stringify'](_0x495e2b));_0x2ecc23(_0x495e2b);})[_0x9e72('0x1a')](function(_0x2a1f45){logger[_0x9e72('0x16')](_0x9e72('0x25'),_0x2a1f45['message'],_0x2420ca);_0x1c98f1(_0x484c5d[_0x9e72('0x16')](0x1f4,_0x2a1f45[_0x9e72('0x18')]));});});};exports[_0x9e72('0x26')]=function(_0x51a791){var _0x50ad2b=this;return new Promise(function(_0x11d09f,_0xb41c35){return db['MailQueue'][_0x9e72('0x27')]({'raw':_0x51a791['options']?_0x51a791[_0x9e72('0x1d')][_0x9e72('0x1e')]===undefined?!![]:![]:!![],'where':_0x51a791[_0x9e72('0x1d')]?_0x51a791[_0x9e72('0x1d')]['where']||null:null,'attributes':_0x51a791[_0x9e72('0x1d')]?_0x51a791[_0x9e72('0x1d')][_0x9e72('0x20')]||null:null,'include':_0x51a791[_0x9e72('0x1d')]?_0x51a791[_0x9e72('0x1d')][_0x9e72('0x22')]?_[_0x9e72('0x24')](_0x51a791[_0x9e72('0x1d')]['include'],function(_0xcf3331){return{'model':db[_0xcf3331['model']],'as':_0xcf3331['as'],'attributes':_0xcf3331['attributes'],'include':_0xcf3331[_0x9e72('0x22')]?_[_0x9e72('0x24')](_0xcf3331['include'],function(_0x5b2257){return{'model':db[_0x5b2257[_0x9e72('0x23')]],'as':_0x5b2257['as'],'attributes':_0x5b2257[_0x9e72('0x20')],'include':_0x5b2257['include']?_[_0x9e72('0x24')](_0x5b2257[_0x9e72('0x22')],function(_0x56b67d){return{'model':db[_0x56b67d['model']],'as':_0x56b67d['as'],'attributes':_0x56b67d[_0x9e72('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9e72('0x12')](function(_0x2f1c0e){logger[_0x9e72('0x28')](_0x9e72('0x26'),_0x51a791);logger[_0x9e72('0x29')]('ShowMailQueue',_0x51a791,JSON['stringify'](_0x2f1c0e));_0x11d09f(_0x2f1c0e);})[_0x9e72('0x1a')](function(_0x9fd987){logger['error']('ShowMailQueue',_0x9fd987['message'],_0x51a791);_0xb41c35(_0x50ad2b[_0x9e72('0x16')](0x1f4,_0x9fd987[_0x9e72('0x18')]));});});}; \ No newline at end of file +var _0xda79=['request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','GetMailQueue','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register'];(function(_0x10c634,_0x406922){var _0x57390b=function(_0x2bce24){while(--_0x2bce24){_0x10c634['push'](_0x10c634['shift']());}};_0x57390b(++_0x406922);}(_0xda79,0x6f));var _0x9da7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xda79[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9da7('0x0'));var util=require(_0x9da7('0x1'));var moment=require(_0x9da7('0x2'));var BPromise=require(_0x9da7('0x3'));var rs=require(_0x9da7('0x4'));var fs=require('fs');var Redis=require(_0x9da7('0x5'));var db=require(_0x9da7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da7('0x7'))(_0x9da7('0x8'));var config=require(_0x9da7('0x9'));var jayson=require(_0x9da7('0xa'));var client=jayson['client'][_0x9da7('0xb')]({'port':0x232a});config[_0x9da7('0xc')]=_[_0x9da7('0xd')](config[_0x9da7('0xc')],{'host':_0x9da7('0xe'),'port':0x18eb});var socket=require(_0x9da7('0xf'))(new Redis(config['redis']));require(_0x9da7('0x10'))[_0x9da7('0x11')](socket);function respondWithRpcPromise(_0x50f34c,_0x536e44,_0xc49400){return new BPromise(function(_0xeceba8,_0x220c52){return client[_0x9da7('0x12')](_0x50f34c,_0xc49400)['then'](function(_0x3b368a){logger[_0x9da7('0x13')](_0x9da7('0x14'),_0x536e44,_0x9da7('0x15'));logger[_0x9da7('0x16')](_0x9da7('0x17'),_0x536e44,_0x9da7('0x15'),JSON[_0x9da7('0x18')](_0x3b368a));if(_0x3b368a[_0x9da7('0x19')]){if(_0x3b368a[_0x9da7('0x19')]['code']===0x1f4){logger[_0x9da7('0x19')](_0x9da7('0x14'),_0x536e44,_0x3b368a['error']['message']);return _0x220c52(_0x3b368a[_0x9da7('0x19')][_0x9da7('0x1a')]);}logger[_0x9da7('0x19')](_0x9da7('0x14'),_0x536e44,_0x3b368a['error'][_0x9da7('0x1a')]);return _0xeceba8(_0x3b368a[_0x9da7('0x19')][_0x9da7('0x1a')]);}else{logger['info'](_0x9da7('0x14'),_0x536e44,_0x9da7('0x15'));_0xeceba8(_0x3b368a[_0x9da7('0x1b')][_0x9da7('0x1a')]);}})[_0x9da7('0x1c')](function(_0x57574d){logger['error'](_0x9da7('0x14'),_0x536e44,_0x57574d);_0x220c52(_0x57574d);});});}exports['GetMailQueue']=function(_0x2502e7){var _0x466a08=this;return new Promise(function(_0x425fb5,_0x168d4d){return db[_0x9da7('0x1d')][_0x9da7('0x1e')]({'raw':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x20')]===undefined?!![]:![]:!![],'where':_0x2502e7['options']?_0x2502e7['options'][_0x9da7('0x21')]||null:null,'attributes':_0x2502e7[_0x9da7('0x1f')]?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x22')]||null:null,'limit':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x23')]||null:null,'include':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')]['include']?_[_0x9da7('0x24')](_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x25')],function(_0x4eacef){return{'model':db[_0x4eacef[_0x9da7('0x26')]],'as':_0x4eacef['as'],'attributes':_0x4eacef[_0x9da7('0x22')],'include':_0x4eacef[_0x9da7('0x25')]?_[_0x9da7('0x24')](_0x4eacef[_0x9da7('0x25')],function(_0x5a7ca3){return{'model':db[_0x5a7ca3['model']],'as':_0x5a7ca3['as'],'attributes':_0x5a7ca3['attributes'],'include':_0x5a7ca3[_0x9da7('0x25')]?_[_0x9da7('0x24')](_0x5a7ca3[_0x9da7('0x25')],function(_0x78f36){return{'model':db[_0x78f36[_0x9da7('0x26')]],'as':_0x78f36['as'],'attributes':_0x78f36[_0x9da7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9da7('0x27')](function(_0x4b39de){logger['info'](_0x9da7('0x28'),_0x2502e7);logger[_0x9da7('0x16')](_0x9da7('0x28'),_0x2502e7,JSON[_0x9da7('0x18')](_0x4b39de));_0x425fb5(_0x4b39de);})['catch'](function(_0x1df677){logger[_0x9da7('0x19')](_0x9da7('0x28'),_0x1df677[_0x9da7('0x1a')],_0x2502e7);_0x168d4d(_0x466a08['error'](0x1f4,_0x1df677[_0x9da7('0x1a')]));});});};exports['ShowMailQueue']=function(_0x29ccf7){var _0x20ea0a=this;return new Promise(function(_0xb5c9bc,_0x33f8dc){return db[_0x9da7('0x1d')][_0x9da7('0x29')]({'raw':_0x29ccf7[_0x9da7('0x1f')]?_0x29ccf7[_0x9da7('0x1f')][_0x9da7('0x20')]===undefined?!![]:![]:!![],'where':_0x29ccf7['options']?_0x29ccf7[_0x9da7('0x1f')][_0x9da7('0x21')]||null:null,'attributes':_0x29ccf7['options']?_0x29ccf7['options'][_0x9da7('0x22')]||null:null,'include':_0x29ccf7['options']?_0x29ccf7[_0x9da7('0x1f')]['include']?_[_0x9da7('0x24')](_0x29ccf7['options']['include'],function(_0x1a98b1){return{'model':db[_0x1a98b1[_0x9da7('0x26')]],'as':_0x1a98b1['as'],'attributes':_0x1a98b1[_0x9da7('0x22')],'include':_0x1a98b1[_0x9da7('0x25')]?_['map'](_0x1a98b1['include'],function(_0x597597){return{'model':db[_0x597597[_0x9da7('0x26')]],'as':_0x597597['as'],'attributes':_0x597597[_0x9da7('0x22')],'include':_0x597597[_0x9da7('0x25')]?_['map'](_0x597597['include'],function(_0x352929){return{'model':db[_0x352929[_0x9da7('0x26')]],'as':_0x352929['as'],'attributes':_0x352929[_0x9da7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9da7('0x27')](function(_0x1ae417){logger[_0x9da7('0x13')]('ShowMailQueue',_0x29ccf7);logger[_0x9da7('0x16')](_0x9da7('0x2a'),_0x29ccf7,JSON[_0x9da7('0x18')](_0x1ae417));_0xb5c9bc(_0x1ae417);})['catch'](function(_0x3e5543){logger['error'](_0x9da7('0x2a'),_0x3e5543[_0x9da7('0x1a')],_0x29ccf7);_0x33f8dc(_0x20ea0a['error'](0x1f4,_0x3e5543[_0x9da7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 11b017a..a32da40 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 _0x832c=['register','length','mailQueue:','save','remove','update','emit','removeListener'];(function(_0x15d99e,_0x26b329){var _0x2daa81=function(_0x5972fd){while(--_0x5972fd){_0x15d99e['push'](_0x15d99e['shift']());}};_0x2daa81(++_0x26b329);}(_0x832c,0x193));var _0xc832=function(_0x42264a,_0x4ca086){_0x42264a=_0x42264a-0x0;var _0xd7733a=_0x832c[_0x42264a];return _0xd7733a;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xc832('0x0'),_0xc832('0x1'),_0xc832('0x2')];function createListener(_0x910488,_0x39cfec){return function(_0x303b8c){_0x39cfec[_0xc832('0x3')](_0x910488,_0x303b8c);};}function removeListener(_0x7c544d,_0x3799e6){return function(){MailQueueEvents[_0xc832('0x4')](_0x7c544d,_0x3799e6);};}exports[_0xc832('0x5')]=function(_0x584901){for(var _0x57253b=0x0,_0x4b7b6f=events[_0xc832('0x6')];_0x57253b<_0x4b7b6f;_0x57253b++){var _0x341f46=events[_0x57253b];var _0x227627=createListener(_0xc832('0x7')+_0x341f46,_0x584901);MailQueueEvents['on'](_0x341f46,_0x227627);}}; \ No newline at end of file +var _0xb846=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x419450,_0x1c50e4){var _0x26584f=function(_0x546559){while(--_0x546559){_0x419450['push'](_0x419450['shift']());}};_0x26584f(++_0x1c50e4);}(_0xb846,0x145));var _0x6b84=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb846[_0x1beef3];return _0x5af964;};'use strict';var MailQueueEvents=require(_0x6b84('0x0'));var events=[_0x6b84('0x1'),_0x6b84('0x2'),_0x6b84('0x3')];function createListener(_0x4e4a7f,_0x56696f){return function(_0x4abc20){_0x56696f[_0x6b84('0x4')](_0x4e4a7f,_0x4abc20);};}function removeListener(_0x3a6ddd,_0x14f110){return function(){MailQueueEvents[_0x6b84('0x5')](_0x3a6ddd,_0x14f110);};}exports[_0x6b84('0x6')]=function(_0x5ef7c1){for(var _0x42609a=0x0,_0x10509e=events[_0x6b84('0x7')];_0x42609a<_0x10509e;_0x42609a++){var _0x4d158f=events[_0x42609a];var _0x1a488a=createListener(_0x6b84('0x8')+_0x4d158f,_0x5ef7c1);MailQueueEvents['on'](_0x4d158f,_0x1a488a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 87c3908..415e9f5 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 _0x1e67=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','update','delete','exports','multer','connect-timeout'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x1e67,0xc2));var _0x71e6=function(_0x5f316e,_0x13618a){_0x5f316e=_0x5f316e-0x0;var _0x30805c=_0x1e67[_0x5f316e];return _0x30805c;};'use strict';var multer=require(_0x71e6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x71e6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71e6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x71e6('0x3'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x71e6('0x4')]('/',auth[_0x71e6('0x5')](),controller[_0x71e6('0x6')]);router['get'](_0x71e6('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x71e6('0x4')](_0x71e6('0x8'),auth[_0x71e6('0x5')](),controller[_0x71e6('0x9')]);router[_0x71e6('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x71e6('0x5')](),controller[_0x71e6('0xb')]);router[_0x71e6('0xc')](_0x71e6('0x8'),auth[_0x71e6('0x5')](),controller['destroy']);module[_0x71e6('0xd')]=router; \ No newline at end of file +var _0x6725=['/:id','post','create','put','update','destroy','exports','util','path','express','Router','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get'];(function(_0x2a55b1,_0x1bde59){var _0x422256=function(_0x551bfd){while(--_0x551bfd){_0x2a55b1['push'](_0x2a55b1['shift']());}};_0x422256(++_0x1bde59);}(_0x6725,0x67));var _0x5672=function(_0xf4dc7e,_0x3a9746){_0xf4dc7e=_0xf4dc7e-0x0;var _0x330d3e=_0x6725[_0xf4dc7e];return _0x330d3e;};'use strict';var multer=require('multer');var util=require(_0x5672('0x0'));var path=require(_0x5672('0x1'));var timeout=require('connect-timeout');var express=require(_0x5672('0x2'));var router=express[_0x5672('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5672('0x4'));var config=require('../../config/environment');var controller=require(_0x5672('0x5'));router['get']('/',auth[_0x5672('0x6')](),controller[_0x5672('0x7')]);router[_0x5672('0x8')]('/describe',auth[_0x5672('0x6')](),controller['describe']);router[_0x5672('0x8')](_0x5672('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5672('0xa')]('/',auth[_0x5672('0x6')](),controller[_0x5672('0xb')]);router[_0x5672('0xc')](_0x5672('0x9'),auth[_0x5672('0x6')](),controller[_0x5672('0xd')]);router['delete'](_0x5672('0x9'),auth[_0x5672('0x6')](),controller[_0x5672('0xe')]);module[_0x5672('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 532df55..7fa979d 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 _0xb99c=['DATE','moment','sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb99c,0x1a9));var _0xcb99=function(_0x320bc6,_0x363139){_0x320bc6=_0x320bc6-0x0;var _0xe0e060=_0xb99c[_0x320bc6];return _0xe0e060;};'use strict';var moment=require(_0xcb99('0x0'));var Sequelize=require(_0xcb99('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xcb99('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcb99('0x2')]},'joinAt':{'type':Sequelize[_0xcb99('0x3')]},'leaveAt':{'type':Sequelize[_0xcb99('0x3')]},'acceptAt':{'type':Sequelize[_0xcb99('0x3')]},'exitAt':{'type':Sequelize[_0xcb99('0x3')]},'reason':{'type':Sequelize[_0xcb99('0x2')]}}; \ No newline at end of file +var _0x0698=['moment','sequelize','STRING','DATE'];(function(_0x52c408,_0x35f852){var _0x31ad08=function(_0x42da3f){while(--_0x42da3f){_0x52c408['push'](_0x52c408['shift']());}};_0x31ad08(++_0x35f852);}(_0x0698,0xc4));var _0x8069=function(_0x46dd35,_0x20fb64){_0x46dd35=_0x46dd35-0x0;var _0x3a3708=_0x0698[_0x46dd35];return _0x3a3708;};'use strict';var moment=require(_0x8069('0x0'));var Sequelize=require(_0x8069('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8069('0x2')]},'joinAt':{'type':Sequelize[_0x8069('0x3')]},'leaveAt':{'type':Sequelize[_0x8069('0x3')]},'acceptAt':{'type':Sequelize[_0x8069('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3930d0e..e872cf5 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x6a6465,_0x110484){var _0x17960e=function(_0x5e7155){while(--_0x5e7155){_0x6a6465['push'](_0x6a6465['shift']());}};_0x17960e(++_0x110484);}(_0x6050,0x196));var _0x0605=function(_0x2bf9ec,_0x3c8a42){_0x2bf9ec=_0x2bf9ec-0x0;var _0x4c4789=_0x6050[_0x2bf9ec];return _0x4c4789;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file +var _0x160f=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','type','key','map','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','MailQueueReport','include','findAll','rows','show','params','keys','fields','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a4a8a,_0x27ce9e){var _0x4d8f00=function(_0x5a05b7){while(--_0x5a05b7){_0x1a4a8a['push'](_0x1a4a8a['shift']());}};_0x4d8f00(++_0x27ce9e);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x4a8003,_0x487c0c){return function(_0x168a09){if(!_0x168a09){_0x4a8003[_0xf160('0x17')](0x194);}return _0x168a09;};}function handleError(_0x39c0e3,_0x4c0c51){_0x4c0c51=_0x4c0c51||0x1f4;return function(_0xcfa9bd){logger[_0xf160('0x27')](_0xcfa9bd[_0xf160('0x28')]);if(_0xcfa9bd[_0xf160('0x29')]){delete _0xcfa9bd[_0xf160('0x29')];}_0x39c0e3[_0xf160('0x19')](_0x4c0c51)['send'](_0xcfa9bd);};}exports['index']=function(_0x48145e,_0x26e7b9){var _0x16a5fa={},_0xcaab39={},_0x26e06b={'count':0x0,'rows':[]};var _0x399cce=_['map'](db['MailQueueReport'][_0xf160('0x2a')],function(_0x558596){return{'name':_0x558596['fieldName'],'type':_0x558596[_0xf160('0x2b')][_0xf160('0x2c')]};});_0xcaab39['model']=_[_0xf160('0x2d')](_0x399cce,_0xf160('0x29'));_0xcaab39['query']=_['keys'](_0x48145e['query']);_0xcaab39['filters']=_[_0xf160('0x2e')](_0xcaab39[_0xf160('0x2f')],_0xcaab39[_0xf160('0x30')]);_0x16a5fa[_0xf160('0x31')]=_[_0xf160('0x2e')](_0xcaab39[_0xf160('0x2f')],qs['fields'](_0x48145e['query']['fields']));_0x16a5fa[_0xf160('0x31')]=_0x16a5fa['attributes']['length']?_0x16a5fa[_0xf160('0x31')]:_0xcaab39[_0xf160('0x2f')];if(!_0x48145e['query'][_0xf160('0x32')](_0xf160('0x33'))){_0x16a5fa[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x48145e[_0xf160('0x30')]['limit']);_0x16a5fa[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x48145e[_0xf160('0x30')]['offset']);}_0x16a5fa[_0xf160('0x34')]=qs[_0xf160('0x35')](_0x48145e[_0xf160('0x30')][_0xf160('0x35')]);_0x16a5fa[_0xf160('0x36')]=qs[_0xf160('0x37')](_['pick'](_0x48145e['query'],_0xcaab39[_0xf160('0x37')]),_0x399cce);if(_0x48145e[_0xf160('0x30')][_0xf160('0x38')]){_0x16a5fa[_0xf160('0x36')]=_[_0xf160('0x39')](_0x16a5fa[_0xf160('0x36')],{'$or':_[_0xf160('0x2d')](_0x399cce,function(_0x38a33e){if(_0x38a33e[_0xf160('0x2b')]!==_0xf160('0x3a')){var _0x1e65d4={};_0x1e65d4[_0x38a33e[_0xf160('0x29')]]={'$like':'%'+_0x48145e[_0xf160('0x30')][_0xf160('0x38')]+'%'};return _0x1e65d4;}})});}_0x16a5fa=_[_0xf160('0x39')]({},_0x16a5fa,_0x48145e[_0xf160('0x3b')]);var _0x161f06={'where':_0x16a5fa[_0xf160('0x36')]};return db[_0xf160('0x3c')][_0xf160('0x1e')](_0x161f06)[_0xf160('0x25')](function(_0x8fe1de){_0x26e06b[_0xf160('0x1e')]=_0x8fe1de;if(_0x48145e[_0xf160('0x30')]['includeAll']){_0x16a5fa[_0xf160('0x3d')]=[{'all':!![]}];}return db[_0xf160('0x3c')][_0xf160('0x3e')](_0x16a5fa);})[_0xf160('0x25')](function(_0x3d273d){_0x26e06b[_0xf160('0x3f')]=_0x3d273d;return _0x26e06b;})[_0xf160('0x25')](respondWithFilteredResult(_0x26e7b9,_0x16a5fa))['catch'](handleError(_0x26e7b9,null));};exports[_0xf160('0x40')]=function(_0x5be7ce,_0xa80a5f){var _0x477ded={'raw':!![],'where':{'id':_0x5be7ce[_0xf160('0x41')]['id']}},_0x530fc5={};_0x530fc5[_0xf160('0x2f')]=_[_0xf160('0x42')](db[_0xf160('0x3c')][_0xf160('0x2a')]);_0x530fc5[_0xf160('0x30')]=_[_0xf160('0x42')](_0x5be7ce['query']);_0x530fc5[_0xf160('0x37')]=_[_0xf160('0x2e')](_0x530fc5[_0xf160('0x2f')],_0x530fc5[_0xf160('0x30')]);_0x477ded[_0xf160('0x31')]=_[_0xf160('0x2e')](_0x530fc5[_0xf160('0x2f')],qs[_0xf160('0x43')](_0x5be7ce[_0xf160('0x30')][_0xf160('0x43')]));_0x477ded[_0xf160('0x31')]=_0x477ded['attributes']['length']?_0x477ded[_0xf160('0x31')]:_0x530fc5[_0xf160('0x2f')];if(_0x5be7ce[_0xf160('0x30')][_0xf160('0x44')]){_0x477ded[_0xf160('0x3d')]=[{'all':!![]}];}_0x477ded=_[_0xf160('0x39')]({},_0x477ded,_0x5be7ce['options']);return db[_0xf160('0x3c')]['find'](_0x477ded)['then'](handleEntityNotFound(_0xa80a5f,null))[_0xf160('0x25')](respondWithResult(_0xa80a5f,null))[_0xf160('0x45')](handleError(_0xa80a5f,null));};exports['create']=function(_0x5ea49d,_0x2f1648){return db[_0xf160('0x3c')][_0xf160('0x46')](_0x5ea49d[_0xf160('0x47')],{})['then'](respondWithResult(_0x2f1648,0xc9))['catch'](handleError(_0x2f1648,null));};exports['update']=function(_0x50a97d,_0x406494){if(_0x50a97d['body']['id']){delete _0x50a97d[_0xf160('0x47')]['id'];}return db[_0xf160('0x3c')][_0xf160('0x48')]({'where':{'id':_0x50a97d[_0xf160('0x41')]['id']}})['then'](handleEntityNotFound(_0x406494,null))[_0xf160('0x25')](saveUpdates(_0x50a97d[_0xf160('0x47')],null))[_0xf160('0x25')](respondWithResult(_0x406494,null))['catch'](handleError(_0x406494,null));};exports[_0xf160('0x26')]=function(_0x40f855,_0x87ad7e){return db['MailQueueReport'][_0xf160('0x48')]({'where':{'id':_0x40f855[_0xf160('0x41')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x87ad7e,null))[_0xf160('0x25')](removeEntity(_0x87ad7e,null))[_0xf160('0x45')](handleError(_0x87ad7e,null));};exports['describe']=function(_0x4c90ab,_0x3c8765){return db['MailQueueReport'][_0xf160('0x49')]()[_0xf160('0x25')](respondWithResult(_0x3c8765,null))['catch'](handleError(_0x3c8765,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d199580..6fdd90d 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 _0x29dd=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29dd,0x1d3));var _0xd29d=function(_0x24e1f8,_0x36a945){_0x24e1f8=_0x24e1f8-0x0;var _0x10140d=_0x29dd[_0x24e1f8];return _0x10140d;};'use strict';var _=require('lodash');var util=require(_0xd29d('0x0'));var logger=require(_0xd29d('0x1'))('api');var moment=require(_0xd29d('0x2'));var BPromise=require(_0xd29d('0x3'));var rp=require(_0xd29d('0x4'));var fs=require('fs');var path=require(_0xd29d('0x5'));var rimraf=require('rimraf');var config=require(_0xd29d('0x6'));var attributes=require(_0xd29d('0x7'));module[_0xd29d('0x8')]=function(_0x176588,_0x52b7f8){return _0x176588[_0xd29d('0x9')](_0xd29d('0xa'),attributes,{'tableName':_0xd29d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd29d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3a6=['path','rimraf','../../config/environment','exports','define','MailQueueReport','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x436851,_0x2aa809){var _0x1c2829=function(_0x29aea7){while(--_0x29aea7){_0x436851['push'](_0x436851['shift']());}};_0x1c2829(++_0x2aa809);}(_0xa3a6,0x10f));var _0x6a3a=function(_0x3a39eb,_0x2fae4b){_0x3a39eb=_0x3a39eb-0x0;var _0x58f629=_0xa3a6[_0x3a39eb];return _0x58f629;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a3a('0x0'))(_0x6a3a('0x1'));var moment=require(_0x6a3a('0x2'));var BPromise=require(_0x6a3a('0x3'));var rp=require(_0x6a3a('0x4'));var fs=require('fs');var path=require(_0x6a3a('0x5'));var rimraf=require(_0x6a3a('0x6'));var config=require(_0x6a3a('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x6a3a('0x8')]=function(_0x4f75e4,_0x43dd6a){return _0x4f75e4[_0x6a3a('0x9')](_0x6a3a('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x6a3a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 5d579e1..998a044 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x1fd5e7,_0x5b3aac){var _0x36be7a=function(_0x304e22){while(--_0x304e22){_0x1fd5e7['push'](_0x1fd5e7['shift']());}};_0x36be7a(++_0x5b3aac);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x56da85,_0x48cc39){var _0x166a0c=function(_0x1f9e19){while(--_0x1f9e19){_0x56da85['push'](_0x56da85['shift']());}};_0x166a0c(++_0x48cc39);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5f3f,_0x330371){_0x4a5f3f=_0x4a5f3f-0x0;var _0x4508ee=_0x7a54[_0x4a5f3f];return _0x4508ee;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 6cffe5d..a2c578e 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index eb2ba4f..f188f2c 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 _0xa571=['exports','STRING','INTEGER','sequelize'];(function(_0x3f4027,_0x221cbb){var _0x4aea2e=function(_0x29bcbb){while(--_0x29bcbb){_0x3f4027['push'](_0x3f4027['shift']());}};_0x4aea2e(++_0x221cbb);}(_0xa571,0x107));var _0x1a57=function(_0x1fb2e9,_0x240de2){_0x1fb2e9=_0x1fb2e9-0x0;var _0x327c7c=_0xa571[_0x1fb2e9];return _0x327c7c;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'description':{'type':Sequelize[_0x1a57('0x2')]},'host':{'type':Sequelize[_0x1a57('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x1a57('0x2')]},'password':{'type':Sequelize[_0x1a57('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x1a57('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1a57('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1a57('0x2')]}}; \ No newline at end of file +var _0x8caf=['INBOX','INTEGER','exports','STRING','BOOLEAN'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3f3b97,_0x395d93){_0x3f3b97=_0x3f3b97-0x0;var _0xb6ab0c=_0x8caf[_0x3f3b97];return _0xb6ab0c;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'description':{'type':Sequelize[_0xf8ca('0x1')]},'host':{'type':Sequelize[_0xf8ca('0x1')]},'authentication':{'type':Sequelize[_0xf8ca('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf8ca('0x1')]},'password':{'type':Sequelize[_0xf8ca('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xf8ca('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':_0xf8ca('0x3')},'connTimeout':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf8ca('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e95fc08..ff9b08b 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 _0x5ef6=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailServerIn','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5ef6,0xa3));var _0x65ef=function(_0x40c58d,_0xca539f){_0x40c58d=_0x40c58d-0x0;var _0x2a8381=_0x5ef6[_0x40c58d];return _0x2a8381;};'use strict';var _=require(_0x65ef('0x0'));var util=require(_0x65ef('0x1'));var logger=require(_0x65ef('0x2'))('api');var moment=require(_0x65ef('0x3'));var BPromise=require(_0x65ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65ef('0x5'));var rimraf=require(_0x65ef('0x6'));var config=require(_0x65ef('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x65ef('0x8')]=function(_0x5e254d,_0x4fa88d){return _0x5e254d[_0x65ef('0x9')](_0x65ef('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x791a=['./mailServerIn.attributes','exports','define','lodash','moment','bluebird','request-promise','path'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x791a,0x1c3));var _0xa791=function(_0x4aad3f,_0x21fc56){_0x4aad3f=_0x4aad3f-0x0;var _0x2ac128=_0x791a[_0x4aad3f];return _0x2ac128;};'use strict';var _=require(_0xa791('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa791('0x1'));var BPromise=require(_0xa791('0x2'));var rp=require(_0xa791('0x3'));var fs=require('fs');var path=require(_0xa791('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa791('0x5'));module[_0xa791('0x6')]=function(_0xb6f4c1,_0x10c471){return _0xb6f4c1[_0xa791('0x7')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 19f6200..0b49087 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 _0xd73a=['debug','request\x20sent','error','code','message','result','catch','MailServerIn','findAll','options','raw','where','attributes','include','map','model','GetMailServerIn','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s'];(function(_0x2c8e68,_0x4cb0c5){var _0x4655f4=function(_0x5c46ca){while(--_0x5c46ca){_0x2c8e68['push'](_0x2c8e68['shift']());}};_0x4655f4(++_0x4cb0c5);}(_0xd73a,0x171));var _0xad73=function(_0x1ac007,_0x5cdfe8){_0x1ac007=_0x1ac007-0x0;var _0x137c73=_0xd73a[_0x1ac007];return _0x137c73;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var moment=require(_0xad73('0x2'));var BPromise=require(_0xad73('0x3'));var rs=require(_0xad73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad73('0x5'));var logger=require(_0xad73('0x6'))(_0xad73('0x7'));var config=require(_0xad73('0x8'));var jayson=require(_0xad73('0x9'));var client=jayson[_0xad73('0xa')][_0xad73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4736,_0x24d620,_0x15cf28){return new BPromise(function(_0x1352b3,_0x524324){return client[_0xad73('0xc')](_0x2f4736,_0x15cf28)['then'](function(_0x3c07fa){logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,'request\x20sent');logger[_0xad73('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x24d620,_0xad73('0x10'),JSON['stringify'](_0x3c07fa));if(_0x3c07fa[_0xad73('0x11')]){if(_0x3c07fa[_0xad73('0x11')][_0xad73('0x12')]===0x1f4){logger['error'](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')]['message']);return _0x524324(_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);}logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);return _0x1352b3(_0x3c07fa['error'][_0xad73('0x13')]);}else{logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,_0xad73('0x10'));_0x1352b3(_0x3c07fa[_0xad73('0x14')][_0xad73('0x13')]);}})[_0xad73('0x15')](function(_0x367a5d){logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x367a5d);_0x524324(_0x367a5d);});});}exports['GetMailServerIn']=function(_0x47381a){var _0x4cafad=this;return new Promise(function(_0x5bd242,_0x28bd73){return db[_0xad73('0x16')][_0xad73('0x17')]({'raw':_0x47381a['options']?_0x47381a[_0xad73('0x18')][_0xad73('0x19')]===undefined?!![]:![]:!![],'where':_0x47381a['options']?_0x47381a[_0xad73('0x18')][_0xad73('0x1a')]||null:null,'attributes':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')][_0xad73('0x1b')]||null:null,'limit':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')]['limit']||null:null,'include':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')][_0xad73('0x1c')]?_[_0xad73('0x1d')](_0x47381a[_0xad73('0x18')][_0xad73('0x1c')],function(_0xbfb297){return{'model':db[_0xbfb297[_0xad73('0x1e')]],'as':_0xbfb297['as'],'attributes':_0xbfb297[_0xad73('0x1b')],'include':_0xbfb297[_0xad73('0x1c')]?_[_0xad73('0x1d')](_0xbfb297[_0xad73('0x1c')],function(_0x182805){return{'model':db[_0x182805[_0xad73('0x1e')]],'as':_0x182805['as'],'attributes':_0x182805[_0xad73('0x1b')],'include':_0x182805[_0xad73('0x1c')]?_[_0xad73('0x1d')](_0x182805[_0xad73('0x1c')],function(_0xb7700c){return{'model':db[_0xb7700c[_0xad73('0x1e')]],'as':_0xb7700c['as'],'attributes':_0xb7700c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cd6a6){logger[_0xad73('0xd')](_0xad73('0x1f'),_0x47381a);logger['debug'](_0xad73('0x1f'),_0x47381a,JSON['stringify'](_0x5cd6a6));_0x5bd242(_0x5cd6a6);})['catch'](function(_0x1f826c){logger[_0xad73('0x11')](_0xad73('0x1f'),_0x1f826c[_0xad73('0x13')],_0x47381a);_0x28bd73(_0x4cafad['error'](0x1f4,_0x1f826c[_0xad73('0x13')]));});});}; \ No newline at end of file +var _0x1094=['rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x500512,_0x172eeb){var _0x2ab71c=function(_0x1ca762){while(--_0x1ca762){_0x500512['push'](_0x500512['shift']());}};_0x2ab71c(++_0x172eeb);}(_0x1094,0x143));var _0x4109=function(_0x15a26e,_0x334582){_0x15a26e=_0x15a26e-0x0;var _0x25bef6=_0x1094[_0x15a26e];return _0x25bef6;};'use strict';var _=require(_0x4109('0x0'));var util=require(_0x4109('0x1'));var moment=require('moment');var BPromise=require(_0x4109('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4109('0x3'));var db=require(_0x4109('0x4'))['db'];var utils=require(_0x4109('0x5'));var logger=require(_0x4109('0x6'))(_0x4109('0x7'));var config=require('../../config/environment');var jayson=require(_0x4109('0x8'));var client=jayson[_0x4109('0x9')][_0x4109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c3e9,_0xd2df16,_0x2c34f){return new BPromise(function(_0x5512e8,_0x5b4ecf){return client[_0x4109('0xb')](_0x36c3e9,_0x2c34f)[_0x4109('0xc')](function(_0x2fa1d8){logger[_0x4109('0xd')]('MailServerIn,\x20%s,\x20%s',_0xd2df16,'request\x20sent');logger[_0x4109('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xd2df16,_0x4109('0xf'),JSON[_0x4109('0x10')](_0x2fa1d8));if(_0x2fa1d8[_0x4109('0x11')]){if(_0x2fa1d8['error'][_0x4109('0x12')]===0x1f4){logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')][_0x4109('0x14')]);return _0x5b4ecf(_0x2fa1d8['error'][_0x4109('0x14')]);}logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')]['message']);return _0x5512e8(_0x2fa1d8['error'][_0x4109('0x14')]);}else{logger[_0x4109('0xd')](_0x4109('0x13'),_0xd2df16,_0x4109('0xf'));_0x5512e8(_0x2fa1d8[_0x4109('0x15')][_0x4109('0x14')]);}})[_0x4109('0x16')](function(_0x3c6542){logger['error']('MailServerIn,\x20%s,\x20%s',_0xd2df16,_0x3c6542);_0x5b4ecf(_0x3c6542);});});}exports[_0x4109('0x17')]=function(_0x328f1c){var _0x6945ae=this;return new Promise(function(_0x2e3fd6,_0x415e48){return db[_0x4109('0x18')][_0x4109('0x19')]({'raw':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['where']||null:null,'attributes':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['attributes']||null:null,'limit':_0x328f1c['options']?_0x328f1c[_0x4109('0x1a')]['limit']||null:null,'include':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')][_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x328f1c['options'][_0x4109('0x1b')],function(_0x438f4f){return{'model':db[_0x438f4f[_0x4109('0x1d')]],'as':_0x438f4f['as'],'attributes':_0x438f4f['attributes'],'include':_0x438f4f[_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x438f4f[_0x4109('0x1b')],function(_0x57768e){return{'model':db[_0x57768e['model']],'as':_0x57768e['as'],'attributes':_0x57768e['attributes'],'include':_0x57768e[_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x57768e[_0x4109('0x1b')],function(_0x1ef8fb){return{'model':db[_0x1ef8fb[_0x4109('0x1d')]],'as':_0x1ef8fb['as'],'attributes':_0x1ef8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x4109('0xc')](function(_0x357ce6){logger['info'](_0x4109('0x17'),_0x328f1c);logger['debug'](_0x4109('0x17'),_0x328f1c,JSON[_0x4109('0x10')](_0x357ce6));_0x2e3fd6(_0x357ce6);})[_0x4109('0x16')](function(_0x3165c5){logger[_0x4109('0x11')]('GetMailServerIn',_0x3165c5[_0x4109('0x14')],_0x328f1c);_0x415e48(_0x6945ae['error'](0x1f4,_0x3165c5[_0x4109('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 131880a..70a8c5b 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(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7a54,0x106));var _0x47a5=function(_0x2906c1,_0x56f5d3){_0x2906c1=_0x2906c1-0x0;var _0x5da463=_0x7a54[_0x2906c1];return _0x5da463;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 872dfec..9ed282e 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 _0x2ad4=['exports','INTEGER','BOOLEAN','STRING','sequelize'];(function(_0x42c017,_0x353763){var _0x5646af=function(_0x5ee194){while(--_0x5ee194){_0x42c017['push'](_0x42c017['shift']());}};_0x5646af(++_0x353763);}(_0x2ad4,0xbd));var _0x42ad=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x2ad4[_0x1221e8];return _0x3f3041;};'use strict';var Sequelize=require(_0x42ad('0x0'));module[_0x42ad('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x42ad('0x2')]},'secure':{'type':Sequelize[_0x42ad('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x42ad('0x4')]},'authentication':{'type':Sequelize[_0x42ad('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1edd=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1edd,0x111));var _0xd1ed=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1edd[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xd1ed('0x0'));module[_0xd1ed('0x1')]={'description':{'type':Sequelize[_0xd1ed('0x2')]},'host':{'type':Sequelize[_0xd1ed('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xd1ed('0x2')]},'port':{'type':Sequelize[_0xd1ed('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xd1ed('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 02c5fc6..aac8bf7 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 _0x97d0=['../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x21e998,_0x2f6509){var _0x53d6b8=function(_0x2fce04){while(--_0x2fce04){_0x21e998['push'](_0x21e998['shift']());}};_0x53d6b8(++_0x2f6509);}(_0x97d0,0x14b));var _0x097d=function(_0x999630,_0x55b1a6){_0x999630=_0x999630-0x0;var _0x17608d=_0x97d0[_0x999630];return _0x17608d;};'use strict';var emlformat=require(_0x097d('0x0'));var rimraf=require(_0x097d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x097d('0x2'));var moment=require('moment');var BPromise=require(_0x097d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x097d('0x4'));var sox=require('sox');var csv=require(_0x097d('0x5'));var ejs=require(_0x097d('0x6'));var fs=require('fs');var fs_extra=require(_0x097d('0x7'));var _=require(_0x097d('0x8'));var squel=require(_0x097d('0x9'));var crypto=require('crypto');var jsforce=require(_0x097d('0xa'));var deskjs=require(_0x097d('0xb'));var toCsv=require(_0x097d('0x5'));var querystring=require('querystring');var Papa=require(_0x097d('0xc'));var Redis=require('ioredis');var authService=require(_0x097d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x097d('0xe'));var logger=require(_0x097d('0xf'))(_0x097d('0x10'));var utils=require(_0x097d('0x11'));var config=require(_0x097d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x097d('0x13'))['db'];function respondWithStatusCode(_0x513871,_0x12ea49){_0x12ea49=_0x12ea49||0xcc;return function(_0x4bf67a){if(_0x4bf67a){return _0x513871['sendStatus'](_0x12ea49);}return _0x513871[_0x097d('0x14')](_0x12ea49)['end']();};}function respondWithResult(_0xc8a575,_0x3e62d5){_0x3e62d5=_0x3e62d5||0xc8;return function(_0xfeef8a){if(_0xfeef8a){return _0xc8a575[_0x097d('0x14')](_0x3e62d5)[_0x097d('0x15')](_0xfeef8a);}};}function respondWithFilteredResult(_0x2b58fe,_0x79aa0e){return function(_0x55ac47){if(_0x55ac47){var _0x1cab55=typeof _0x79aa0e[_0x097d('0x16')]===_0x097d('0x17')&&typeof _0x79aa0e[_0x097d('0x18')]===_0x097d('0x17');var _0x3c6ede=_0x55ac47[_0x097d('0x19')];var _0x1c2ac0=_0x1cab55?0x0:_0x79aa0e[_0x097d('0x16')];var _0xc7787f=_0x1cab55?_0x55ac47[_0x097d('0x19')]:_0x79aa0e['offset']+_0x79aa0e['limit'];var _0x519ceb;if(_0xc7787f>=_0x3c6ede){_0xc7787f=_0x3c6ede;_0x519ceb=0xc8;}else{_0x519ceb=0xce;}_0x2b58fe[_0x097d('0x14')](_0x519ceb);return _0x2b58fe[_0x097d('0x1a')](_0x097d('0x1b'),_0x1c2ac0+'-'+_0xc7787f+'/'+_0x3c6ede)[_0x097d('0x15')](_0x55ac47);}return null;};}function patchUpdates(_0x2bc470){return function(_0x221921){try{jsonpatch[_0x097d('0x1c')](_0x221921,_0x2bc470,!![]);}catch(_0x401df6){return BPromise['reject'](_0x401df6);}return _0x221921[_0x097d('0x1d')]();};}function saveUpdates(_0x33343e,_0x444573){return function(_0x1347d0){if(_0x1347d0){return _0x1347d0[_0x097d('0x1e')](_0x33343e)[_0x097d('0x1f')](function(_0x1d6291){return _0x1d6291;});}return null;};}function removeEntity(_0xdded14,_0x1932c9){return function(_0x210c75){if(_0x210c75){return _0x210c75[_0x097d('0x20')]()['then'](function(){_0xdded14['status'](0xcc)[_0x097d('0x21')]();});}};}function handleEntityNotFound(_0x27232d,_0xbc7ea5){return function(_0x18607c){if(!_0x18607c){_0x27232d[_0x097d('0x22')](0x194);}return _0x18607c;};}function handleError(_0x351bb6,_0x7408e4){_0x7408e4=_0x7408e4||0x1f4;return function(_0x2e899d){logger[_0x097d('0x23')](_0x2e899d[_0x097d('0x24')]);if(_0x2e899d[_0x097d('0x25')]){delete _0x2e899d['name'];}_0x351bb6[_0x097d('0x14')](_0x7408e4)[_0x097d('0x26')](_0x2e899d);};}exports[_0x097d('0x27')]=function(_0x4f7980,_0x17d6b1){var _0x3bdde5={},_0x37eca9={},_0x24c54d={'count':0x0,'rows':[]};var _0x395bea=_[_0x097d('0x28')](db[_0x097d('0x29')][_0x097d('0x2a')],function(_0x1990ae){return{'name':_0x1990ae[_0x097d('0x2b')],'type':_0x1990ae[_0x097d('0x2c')][_0x097d('0x2d')]};});_0x37eca9[_0x097d('0x2e')]=_[_0x097d('0x28')](_0x395bea,_0x097d('0x25'));_0x37eca9['query']=_[_0x097d('0x2f')](_0x4f7980['query']);_0x37eca9[_0x097d('0x30')]=_[_0x097d('0x31')](_0x37eca9[_0x097d('0x2e')],_0x37eca9[_0x097d('0x32')]);_0x3bdde5[_0x097d('0x33')]=_[_0x097d('0x31')](_0x37eca9['model'],qs[_0x097d('0x34')](_0x4f7980[_0x097d('0x32')]['fields']));_0x3bdde5[_0x097d('0x33')]=_0x3bdde5[_0x097d('0x33')][_0x097d('0x35')]?_0x3bdde5[_0x097d('0x33')]:_0x37eca9[_0x097d('0x2e')];if(!_0x4f7980[_0x097d('0x32')][_0x097d('0x36')](_0x097d('0x37'))){_0x3bdde5[_0x097d('0x18')]=qs[_0x097d('0x18')](_0x4f7980[_0x097d('0x32')]['limit']);_0x3bdde5['offset']=qs['offset'](_0x4f7980['query'][_0x097d('0x16')]);}_0x3bdde5[_0x097d('0x38')]=qs[_0x097d('0x39')](_0x4f7980[_0x097d('0x32')][_0x097d('0x39')]);_0x3bdde5[_0x097d('0x3a')]=qs[_0x097d('0x30')](_['pick'](_0x4f7980[_0x097d('0x32')],_0x37eca9[_0x097d('0x30')]),_0x395bea);if(_0x4f7980['query']['filter']){_0x3bdde5['where']=_[_0x097d('0x3b')](_0x3bdde5[_0x097d('0x3a')],{'$or':_['map'](_0x395bea,function(_0x351954){if(_0x351954['type']!==_0x097d('0x3c')){var _0x306792={};_0x306792[_0x351954['name']]={'$like':'%'+_0x4f7980[_0x097d('0x32')]['filter']+'%'};return _0x306792;}})});}_0x3bdde5=_[_0x097d('0x3b')]({},_0x3bdde5,_0x4f7980[_0x097d('0x3d')]);var _0xbfb54b={'where':_0x3bdde5[_0x097d('0x3a')]};return db[_0x097d('0x29')][_0x097d('0x19')](_0xbfb54b)[_0x097d('0x1f')](function(_0x51a25a){_0x24c54d[_0x097d('0x19')]=_0x51a25a;if(_0x4f7980[_0x097d('0x32')][_0x097d('0x3e')]){_0x3bdde5[_0x097d('0x3f')]=[{'all':!![]}];}return db[_0x097d('0x29')]['findAll'](_0x3bdde5);})[_0x097d('0x1f')](function(_0x4c5bc8){_0x24c54d['rows']=_0x4c5bc8;return _0x24c54d;})[_0x097d('0x1f')](respondWithFilteredResult(_0x17d6b1,_0x3bdde5))[_0x097d('0x40')](handleError(_0x17d6b1,null));};exports[_0x097d('0x41')]=function(_0x380114,_0x4c022d){var _0x45703d={'raw':!![],'where':{'id':_0x380114[_0x097d('0x42')]['id']}},_0x480478={};_0x480478[_0x097d('0x2e')]=_['keys'](db[_0x097d('0x29')]['rawAttributes']);_0x480478[_0x097d('0x32')]=_[_0x097d('0x2f')](_0x380114[_0x097d('0x32')]);_0x480478['filters']=_[_0x097d('0x31')](_0x480478[_0x097d('0x2e')],_0x480478[_0x097d('0x32')]);_0x45703d[_0x097d('0x33')]=_['intersection'](_0x480478[_0x097d('0x2e')],qs['fields'](_0x380114[_0x097d('0x32')]['fields']));_0x45703d[_0x097d('0x33')]=_0x45703d['attributes']['length']?_0x45703d['attributes']:_0x480478[_0x097d('0x2e')];if(_0x380114[_0x097d('0x32')][_0x097d('0x3e')]){_0x45703d[_0x097d('0x3f')]=[{'all':!![]}];}_0x45703d=_['merge']({},_0x45703d,_0x380114[_0x097d('0x3d')]);return db[_0x097d('0x29')][_0x097d('0x43')](_0x45703d)[_0x097d('0x1f')](handleEntityNotFound(_0x4c022d,null))['then'](respondWithResult(_0x4c022d,null))['catch'](handleError(_0x4c022d,null));};exports['create']=function(_0x31f428,_0x17bef7){return db[_0x097d('0x29')][_0x097d('0x44')](_0x31f428[_0x097d('0x45')],{})[_0x097d('0x1f')](respondWithResult(_0x17bef7,0xc9))[_0x097d('0x40')](handleError(_0x17bef7,null));};exports[_0x097d('0x1e')]=function(_0x119c73,_0x741f5a){if(_0x119c73['body']['id']){delete _0x119c73['body']['id'];}return db[_0x097d('0x29')][_0x097d('0x43')]({'where':{'id':_0x119c73[_0x097d('0x42')]['id']}})[_0x097d('0x1f')](handleEntityNotFound(_0x741f5a,null))['then'](saveUpdates(_0x119c73['body'],null))[_0x097d('0x1f')](respondWithResult(_0x741f5a,null))['catch'](handleError(_0x741f5a,null));};exports[_0x097d('0x20')]=function(_0x42e307,_0x2b0c5e){return db[_0x097d('0x29')][_0x097d('0x43')]({'where':{'id':_0x42e307['params']['id']}})[_0x097d('0x1f')](handleEntityNotFound(_0x2b0c5e,null))[_0x097d('0x1f')](removeEntity(_0x2b0c5e,null))[_0x097d('0x40')](handleError(_0x2b0c5e,null));}; \ No newline at end of file +var _0x288f=['limit','count','offset','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined'];(function(_0x568e85,_0x2dcfb7){var _0x262688=function(_0x335586){while(--_0x335586){_0x568e85['push'](_0x568e85['shift']());}};_0x262688(++_0x2dcfb7);}(_0x288f,0xbe));var _0xf288=function(_0x52b828,_0x359d0f){_0x52b828=_0x52b828-0x0;var _0x2721d8=_0x288f[_0x52b828];return _0x2721d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf288('0x0'));var zipdir=require(_0xf288('0x1'));var jsonpatch=require(_0xf288('0x2'));var rp=require('request-promise');var moment=require(_0xf288('0x3'));var BPromise=require(_0xf288('0x4'));var Mustache=require(_0xf288('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf288('0x6'));var ejs=require(_0xf288('0x7'));var fs=require('fs');var fs_extra=require(_0xf288('0x8'));var _=require('lodash');var squel=require(_0xf288('0x9'));var crypto=require(_0xf288('0xa'));var jsforce=require(_0xf288('0xb'));var deskjs=require(_0xf288('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf288('0xd'));var Papa=require(_0xf288('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf288('0xf'));var hardwareService=require(_0xf288('0x10'));var logger=require(_0xf288('0x11'))(_0xf288('0x12'));var utils=require(_0xf288('0x13'));var config=require(_0xf288('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf288('0x15'))['db'];function respondWithStatusCode(_0x5f01e6,_0x4de63e){_0x4de63e=_0x4de63e||0xcc;return function(_0x2fe7ab){if(_0x2fe7ab){return _0x5f01e6[_0xf288('0x16')](_0x4de63e);}return _0x5f01e6['status'](_0x4de63e)['end']();};}function respondWithResult(_0x46ad3e,_0x3c8f4e){_0x3c8f4e=_0x3c8f4e||0xc8;return function(_0x9b93fe){if(_0x9b93fe){return _0x46ad3e[_0xf288('0x17')](_0x3c8f4e)[_0xf288('0x18')](_0x9b93fe);}};}function respondWithFilteredResult(_0x62ce61,_0x56e910){return function(_0x17fc31){if(_0x17fc31){var _0x57839d=typeof _0x56e910['offset']===_0xf288('0x19')&&typeof _0x56e910[_0xf288('0x1a')]===_0xf288('0x19');var _0x19319b=_0x17fc31[_0xf288('0x1b')];var _0xd1aff0=_0x57839d?0x0:_0x56e910[_0xf288('0x1c')];var _0x4582fc=_0x57839d?_0x17fc31['count']:_0x56e910[_0xf288('0x1c')]+_0x56e910[_0xf288('0x1a')];var _0x2d35a1;if(_0x4582fc>=_0x19319b){_0x4582fc=_0x19319b;_0x2d35a1=0xc8;}else{_0x2d35a1=0xce;}_0x62ce61['status'](_0x2d35a1);return _0x62ce61[_0xf288('0x1d')](_0xf288('0x1e'),_0xd1aff0+'-'+_0x4582fc+'/'+_0x19319b)[_0xf288('0x18')](_0x17fc31);}return null;};}function patchUpdates(_0x4720a2){return function(_0x334853){try{jsonpatch[_0xf288('0x1f')](_0x334853,_0x4720a2,!![]);}catch(_0x25d840){return BPromise['reject'](_0x25d840);}return _0x334853['save']();};}function saveUpdates(_0x521cf9,_0xcaa6b8){return function(_0x25ba65){if(_0x25ba65){return _0x25ba65[_0xf288('0x20')](_0x521cf9)[_0xf288('0x21')](function(_0x310e62){return _0x310e62;});}return null;};}function removeEntity(_0x2df471,_0x1e47d5){return function(_0x52ee2c){if(_0x52ee2c){return _0x52ee2c[_0xf288('0x22')]()[_0xf288('0x21')](function(){_0x2df471['status'](0xcc)[_0xf288('0x23')]();});}};}function handleEntityNotFound(_0x34d8cd,_0x59df19){return function(_0x67387){if(!_0x67387){_0x34d8cd[_0xf288('0x16')](0x194);}return _0x67387;};}function handleError(_0x48afe0,_0x267dc1){_0x267dc1=_0x267dc1||0x1f4;return function(_0xa6d28f){logger['error'](_0xa6d28f[_0xf288('0x24')]);if(_0xa6d28f['name']){delete _0xa6d28f[_0xf288('0x25')];}_0x48afe0[_0xf288('0x17')](_0x267dc1)[_0xf288('0x26')](_0xa6d28f);};}exports['index']=function(_0x1f4719,_0x3fa91a){var _0x192585={},_0x3585f8={},_0x4c8e4a={'count':0x0,'rows':[]};var _0x29dae2=_[_0xf288('0x27')](db[_0xf288('0x28')]['rawAttributes'],function(_0xf705e4){return{'name':_0xf705e4[_0xf288('0x29')],'type':_0xf705e4[_0xf288('0x2a')][_0xf288('0x2b')]};});_0x3585f8[_0xf288('0x2c')]=_[_0xf288('0x27')](_0x29dae2,'name');_0x3585f8[_0xf288('0x2d')]=_[_0xf288('0x2e')](_0x1f4719['query']);_0x3585f8[_0xf288('0x2f')]=_[_0xf288('0x30')](_0x3585f8[_0xf288('0x2c')],_0x3585f8[_0xf288('0x2d')]);_0x192585[_0xf288('0x31')]=_[_0xf288('0x30')](_0x3585f8['model'],qs[_0xf288('0x32')](_0x1f4719['query'][_0xf288('0x32')]));_0x192585[_0xf288('0x31')]=_0x192585[_0xf288('0x31')]['length']?_0x192585[_0xf288('0x31')]:_0x3585f8['model'];if(!_0x1f4719['query'][_0xf288('0x33')](_0xf288('0x34'))){_0x192585[_0xf288('0x1a')]=qs['limit'](_0x1f4719[_0xf288('0x2d')][_0xf288('0x1a')]);_0x192585[_0xf288('0x1c')]=qs[_0xf288('0x1c')](_0x1f4719[_0xf288('0x2d')][_0xf288('0x1c')]);}_0x192585[_0xf288('0x35')]=qs['sort'](_0x1f4719[_0xf288('0x2d')][_0xf288('0x36')]);_0x192585[_0xf288('0x37')]=qs['filters'](_[_0xf288('0x38')](_0x1f4719[_0xf288('0x2d')],_0x3585f8[_0xf288('0x2f')]),_0x29dae2);if(_0x1f4719[_0xf288('0x2d')][_0xf288('0x39')]){_0x192585[_0xf288('0x37')]=_[_0xf288('0x3a')](_0x192585[_0xf288('0x37')],{'$or':_[_0xf288('0x27')](_0x29dae2,function(_0x54ad1e){if(_0x54ad1e[_0xf288('0x2a')]!==_0xf288('0x3b')){var _0x2b9176={};_0x2b9176[_0x54ad1e[_0xf288('0x25')]]={'$like':'%'+_0x1f4719['query'][_0xf288('0x39')]+'%'};return _0x2b9176;}})});}_0x192585=_[_0xf288('0x3a')]({},_0x192585,_0x1f4719[_0xf288('0x3c')]);var _0x237e70={'where':_0x192585['where']};return db[_0xf288('0x28')][_0xf288('0x1b')](_0x237e70)['then'](function(_0x5df566){_0x4c8e4a[_0xf288('0x1b')]=_0x5df566;if(_0x1f4719[_0xf288('0x2d')][_0xf288('0x3d')]){_0x192585[_0xf288('0x3e')]=[{'all':!![]}];}return db[_0xf288('0x28')][_0xf288('0x3f')](_0x192585);})[_0xf288('0x21')](function(_0x1813ae){_0x4c8e4a[_0xf288('0x40')]=_0x1813ae;return _0x4c8e4a;})[_0xf288('0x21')](respondWithFilteredResult(_0x3fa91a,_0x192585))[_0xf288('0x41')](handleError(_0x3fa91a,null));};exports[_0xf288('0x42')]=function(_0x2c03d9,_0x4bb307){var _0x424150={'raw':!![],'where':{'id':_0x2c03d9[_0xf288('0x43')]['id']}},_0x58ea29={};_0x58ea29[_0xf288('0x2c')]=_[_0xf288('0x2e')](db[_0xf288('0x28')][_0xf288('0x44')]);_0x58ea29[_0xf288('0x2d')]=_[_0xf288('0x2e')](_0x2c03d9['query']);_0x58ea29['filters']=_[_0xf288('0x30')](_0x58ea29['model'],_0x58ea29[_0xf288('0x2d')]);_0x424150[_0xf288('0x31')]=_[_0xf288('0x30')](_0x58ea29[_0xf288('0x2c')],qs[_0xf288('0x32')](_0x2c03d9['query'][_0xf288('0x32')]));_0x424150[_0xf288('0x31')]=_0x424150[_0xf288('0x31')]['length']?_0x424150[_0xf288('0x31')]:_0x58ea29[_0xf288('0x2c')];if(_0x2c03d9[_0xf288('0x2d')][_0xf288('0x3d')]){_0x424150[_0xf288('0x3e')]=[{'all':!![]}];}_0x424150=_[_0xf288('0x3a')]({},_0x424150,_0x2c03d9[_0xf288('0x3c')]);return db['MailServerOut'][_0xf288('0x45')](_0x424150)[_0xf288('0x21')](handleEntityNotFound(_0x4bb307,null))[_0xf288('0x21')](respondWithResult(_0x4bb307,null))[_0xf288('0x41')](handleError(_0x4bb307,null));};exports[_0xf288('0x46')]=function(_0x20a847,_0x3f5299){return db['MailServerOut'][_0xf288('0x46')](_0x20a847['body'],{})[_0xf288('0x21')](respondWithResult(_0x3f5299,0xc9))[_0xf288('0x41')](handleError(_0x3f5299,null));};exports['update']=function(_0x1c5d15,_0x2b9d7b){if(_0x1c5d15[_0xf288('0x47')]['id']){delete _0x1c5d15['body']['id'];}return db[_0xf288('0x28')][_0xf288('0x45')]({'where':{'id':_0x1c5d15['params']['id']}})[_0xf288('0x21')](handleEntityNotFound(_0x2b9d7b,null))[_0xf288('0x21')](saveUpdates(_0x1c5d15[_0xf288('0x47')],null))[_0xf288('0x21')](respondWithResult(_0x2b9d7b,null))[_0xf288('0x41')](handleError(_0x2b9d7b,null));};exports[_0xf288('0x22')]=function(_0x3d5328,_0x38bae7){return db[_0xf288('0x28')][_0xf288('0x45')]({'where':{'id':_0x3d5328[_0xf288('0x43')]['id']}})[_0xf288('0x21')](handleEntityNotFound(_0x38bae7,null))[_0xf288('0x21')](removeEntity(_0x38bae7,null))['catch'](handleError(_0x38bae7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 60951c3..9c36ad5 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 _0xa58a=['../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','api','moment','bluebird','request-promise'];(function(_0x3eb736,_0x12037e){var _0x316295=function(_0x264b36){while(--_0x264b36){_0x3eb736['push'](_0x3eb736['shift']());}};_0x316295(++_0x12037e);}(_0xa58a,0x1ef));var _0xaa58=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0xa58a[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0xaa58('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa58('0x1'));var moment=require(_0xaa58('0x2'));var BPromise=require(_0xaa58('0x3'));var rp=require(_0xaa58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa58('0x5'));var attributes=require('./mailServerOut.attributes');module[_0xaa58('0x6')]=function(_0x3c1373,_0x144fe0){return _0x3c1373[_0xaa58('0x7')](_0xaa58('0x8'),attributes,{'tableName':_0xaa58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13e6=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','MailServerOut','mail_servers_out','lodash','util'];(function(_0x1e369b,_0x674ecd){var _0x1b493d=function(_0x31306a){while(--_0x31306a){_0x1e369b['push'](_0x1e369b['shift']());}};_0x1b493d(++_0x674ecd);}(_0x13e6,0x10c));var _0x613e=function(_0x17c650,_0x57dc03){_0x17c650=_0x17c650-0x0;var _0x3100bb=_0x13e6[_0x17c650];return _0x3100bb;};'use strict';var _=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var logger=require(_0x613e('0x2'))(_0x613e('0x3'));var moment=require(_0x613e('0x4'));var BPromise=require('bluebird');var rp=require(_0x613e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613e('0x6'));var config=require(_0x613e('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x2c7349,_0x32056a){return _0x2c7349['define'](_0x613e('0x8'),attributes,{'tableName':_0x613e('0x9'),'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 a1b81b1..6b3f133 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5cf1e6,_0x4d9ffa){var _0x1960c5=function(_0x3eb18a){while(--_0x3eb18a){_0x5cf1e6['push'](_0x5cf1e6['shift']());}};_0x1960c5(++_0x4d9ffa);}(_0xdb28,0x106));var _0x8db2=function(_0x3afc35,_0x332d97){_0x3afc35=_0x3afc35-0x0;var _0x1bba6f=_0xdb28[_0x3afc35];return _0x1bba6f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +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(_0x470ea4,_0x76804f){var _0x9c7b1a=function(_0x133af1){while(--_0x133af1){_0x470ea4['push'](_0x470ea4['shift']());}};_0x9c7b1a(++_0x76804f);}(_0x1261,0x144));var _0x1126=function(_0x16b561,_0x5a914f){_0x16b561=_0x16b561-0x0;var _0x22599f=_0x1261[_0x16b561];return _0x22599f;};'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 0042cc8..e7c960b 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 _0x45a3=['index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2a2840,_0x19c9a2){var _0xecebc9=function(_0x1777af){while(--_0x1777af){_0x2a2840['push'](_0x2a2840['shift']());}};_0xecebc9(++_0x19c9a2);}(_0x45a3,0x124));var _0x345a=function(_0x52523c,_0x25ebc2){_0x52523c=_0x52523c-0x0;var _0x2e01cb=_0x45a3[_0x52523c];return _0x2e01cb;};'use strict';var multer=require(_0x345a('0x0'));var util=require('util');var path=require(_0x345a('0x1'));var timeout=require('connect-timeout');var express=require(_0x345a('0x2'));var router=express['Router']();var fs_extra=require(_0x345a('0x3'));var auth=require(_0x345a('0x4'));var interaction=require(_0x345a('0x5'));var config=require(_0x345a('0x6'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x345a('0x7')](),controller[_0x345a('0x8')]);router[_0x345a('0x9')](_0x345a('0xa'),auth[_0x345a('0x7')](),controller[_0x345a('0xb')]);router[_0x345a('0x9')]('/:id',auth[_0x345a('0x7')](),controller[_0x345a('0xc')]);router[_0x345a('0xd')]('/',auth[_0x345a('0x7')](),controller['create']);router[_0x345a('0xe')](_0x345a('0xf'),auth[_0x345a('0x7')](),controller[_0x345a('0x10')]);router[_0x345a('0x11')](_0x345a('0xf'),auth['isAuthenticated'](),controller[_0x345a('0x12')]);module[_0x345a('0x13')]=router; \ No newline at end of file +var _0x4f3d=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x391932,_0x3c1b9f){var _0x49ca90=function(_0x589776){while(--_0x589776){_0x391932['push'](_0x391932['shift']());}};_0x49ca90(++_0x3c1b9f);}(_0x4f3d,0x8c));var _0xd4f3=function(_0x4730e3,_0x3e5620){_0x4730e3=_0x4730e3-0x0;var _0x59d9ee=_0x4f3d[_0x4730e3];return _0x59d9ee;};'use strict';var multer=require(_0xd4f3('0x0'));var util=require('util');var path=require(_0xd4f3('0x1'));var timeout=require(_0xd4f3('0x2'));var express=require(_0xd4f3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4f3('0x4'));var interaction=require(_0xd4f3('0x5'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0xd4f3('0x6')]('/',auth[_0xd4f3('0x7')](),controller[_0xd4f3('0x8')]);router[_0xd4f3('0x6')](_0xd4f3('0x9'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xa')]);router['get'](_0xd4f3('0xb'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xc')]);router[_0xd4f3('0xd')]('/',auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd4f3('0xf')](_0xd4f3('0xb'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0x10')]);module[_0xd4f3('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f2d5b6a..69dd8d2 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 _0xc21e=['STRING','name','exports'];(function(_0x897476,_0x4d98be){var _0x1390da=function(_0x2c7387){while(--_0x2c7387){_0x897476['push'](_0x897476['shift']());}};_0x1390da(++_0x4d98be);}(_0xc21e,0x1ca));var _0xec21=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc21e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xec21('0x0')]={'name':{'type':Sequelize[_0xec21('0x1')],'unique':_0xec21('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xec21('0x1')]}}; \ No newline at end of file +var _0xaf1b=['STRING','name','sequelize','exports'];(function(_0x5924e7,_0x4a398e){var _0x4b6d1f=function(_0x165654){while(--_0x165654){_0x5924e7['push'](_0x5924e7['shift']());}};_0x4b6d1f(++_0x4a398e);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x10ffd0,_0x1d108c){_0x10ffd0=_0x10ffd0-0x0;var _0x427351=_0xaf1b[_0x10ffd0];return _0x427351;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'name':{'type':Sequelize[_0xbaf1('0x2')],'unique':_0xbaf1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbaf1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d2eacc1..3217d90 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 _0x4984=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x4984,0x142));var _0x4498=function(_0x554c31,_0x526a69){_0x554c31=_0x554c31-0x0;var _0x16ea66=_0x4984[_0x554c31];return _0x16ea66;};'use strict';var emlformat=require(_0x4498('0x0'));var rimraf=require(_0x4498('0x1'));var zipdir=require(_0x4498('0x2'));var jsonpatch=require(_0x4498('0x3'));var rp=require(_0x4498('0x4'));var moment=require(_0x4498('0x5'));var BPromise=require(_0x4498('0x6'));var Mustache=require(_0x4498('0x7'));var util=require('util');var path=require(_0x4498('0x8'));var sox=require('sox');var csv=require(_0x4498('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4498('0xa'));var _=require(_0x4498('0xb'));var squel=require(_0x4498('0xc'));var crypto=require('crypto');var jsforce=require(_0x4498('0xd'));var deskjs=require(_0x4498('0xe'));var toCsv=require(_0x4498('0x9'));var querystring=require(_0x4498('0xf'));var Papa=require('papaparse');var Redis=require(_0x4498('0x10'));var authService=require(_0x4498('0x11'));var qs=require(_0x4498('0x12'));var as=require(_0x4498('0x13'));var hardwareService=require(_0x4498('0x14'));var logger=require(_0x4498('0x15'))(_0x4498('0x16'));var utils=require(_0x4498('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4498('0x18'))['db'];function respondWithStatusCode(_0x388b40,_0x31cbcf){_0x31cbcf=_0x31cbcf||0xcc;return function(_0x2170fc){if(_0x2170fc){return _0x388b40[_0x4498('0x19')](_0x31cbcf);}return _0x388b40[_0x4498('0x1a')](_0x31cbcf)['end']();};}function respondWithResult(_0x4d41c5,_0x31e778){_0x31e778=_0x31e778||0xc8;return function(_0x452823){if(_0x452823){return _0x4d41c5[_0x4498('0x1a')](_0x31e778)[_0x4498('0x1b')](_0x452823);}};}function respondWithFilteredResult(_0x1cd9bd,_0x119811){return function(_0xa9ac19){if(_0xa9ac19){var _0x25460f=typeof _0x119811[_0x4498('0x1c')]==='undefined'&&typeof _0x119811[_0x4498('0x1d')]==='undefined';var _0x28fdf2=_0xa9ac19[_0x4498('0x1e')];var _0xbd6a15=_0x25460f?0x0:_0x119811[_0x4498('0x1c')];var _0x32f8e3=_0x25460f?_0xa9ac19[_0x4498('0x1e')]:_0x119811[_0x4498('0x1c')]+_0x119811['limit'];var _0x104349;if(_0x32f8e3>=_0x28fdf2){_0x32f8e3=_0x28fdf2;_0x104349=0xc8;}else{_0x104349=0xce;}_0x1cd9bd[_0x4498('0x1a')](_0x104349);return _0x1cd9bd[_0x4498('0x1f')](_0x4498('0x20'),_0xbd6a15+'-'+_0x32f8e3+'/'+_0x28fdf2)[_0x4498('0x1b')](_0xa9ac19);}return null;};}function patchUpdates(_0x543e71){return function(_0x21e9a4){try{jsonpatch[_0x4498('0x21')](_0x21e9a4,_0x543e71,!![]);}catch(_0x27ea02){return BPromise[_0x4498('0x22')](_0x27ea02);}return _0x21e9a4[_0x4498('0x23')]();};}function saveUpdates(_0x253141,_0x445483){return function(_0xf6c8c2){if(_0xf6c8c2){return _0xf6c8c2[_0x4498('0x24')](_0x253141)[_0x4498('0x25')](function(_0x2ad4f8){return _0x2ad4f8;});}return null;};}function removeEntity(_0x398f50,_0xb1b40){return function(_0x503e79){if(_0x503e79){return _0x503e79['destroy']()[_0x4498('0x25')](function(){_0x398f50[_0x4498('0x1a')](0xcc)[_0x4498('0x26')]();});}};}function handleEntityNotFound(_0x6c8f4d,_0x25a4bd){return function(_0x2440b6){if(!_0x2440b6){_0x6c8f4d['sendStatus'](0x194);}return _0x2440b6;};}function handleError(_0x23b36b,_0x195457){_0x195457=_0x195457||0x1f4;return function(_0x2b43f7){logger[_0x4498('0x27')](_0x2b43f7[_0x4498('0x28')]);if(_0x2b43f7[_0x4498('0x29')]){delete _0x2b43f7[_0x4498('0x29')];}_0x23b36b[_0x4498('0x1a')](_0x195457)[_0x4498('0x2a')](_0x2b43f7);};}exports[_0x4498('0x2b')]=function(_0x30efd7,_0x23ebcb){var _0x5ed47d={},_0x4776bb={},_0x5d97e0={'count':0x0,'rows':[]};var _0x35ddd1=_[_0x4498('0x2c')](db[_0x4498('0x2d')]['rawAttributes'],function(_0x24a1da){return{'name':_0x24a1da[_0x4498('0x2e')],'type':_0x24a1da[_0x4498('0x2f')][_0x4498('0x30')]};});_0x4776bb[_0x4498('0x31')]=_['map'](_0x35ddd1,_0x4498('0x29'));_0x4776bb[_0x4498('0x32')]=_[_0x4498('0x33')](_0x30efd7[_0x4498('0x32')]);_0x4776bb[_0x4498('0x34')]=_['intersection'](_0x4776bb['model'],_0x4776bb['query']);_0x5ed47d['attributes']=_[_0x4498('0x35')](_0x4776bb['model'],qs[_0x4498('0x36')](_0x30efd7[_0x4498('0x32')][_0x4498('0x36')]));_0x5ed47d[_0x4498('0x37')]=_0x5ed47d[_0x4498('0x37')]['length']?_0x5ed47d[_0x4498('0x37')]:_0x4776bb['model'];if(!_0x30efd7[_0x4498('0x32')][_0x4498('0x38')]('nolimit')){_0x5ed47d[_0x4498('0x1d')]=qs[_0x4498('0x1d')](_0x30efd7[_0x4498('0x32')][_0x4498('0x1d')]);_0x5ed47d[_0x4498('0x1c')]=qs[_0x4498('0x1c')](_0x30efd7['query'][_0x4498('0x1c')]);}_0x5ed47d['order']=qs[_0x4498('0x39')](_0x30efd7['query'][_0x4498('0x39')]);_0x5ed47d[_0x4498('0x3a')]=qs[_0x4498('0x34')](_[_0x4498('0x3b')](_0x30efd7[_0x4498('0x32')],_0x4776bb[_0x4498('0x34')]),_0x35ddd1);if(_0x30efd7[_0x4498('0x32')][_0x4498('0x3c')]){_0x5ed47d[_0x4498('0x3a')]=_[_0x4498('0x3d')](_0x5ed47d['where'],{'$or':_[_0x4498('0x2c')](_0x35ddd1,function(_0x2f1e42){if(_0x2f1e42[_0x4498('0x2f')]!==_0x4498('0x3e')){var _0x34f279={};_0x34f279[_0x2f1e42[_0x4498('0x29')]]={'$like':'%'+_0x30efd7[_0x4498('0x32')][_0x4498('0x3c')]+'%'};return _0x34f279;}})});}_0x5ed47d=_[_0x4498('0x3d')]({},_0x5ed47d,_0x30efd7[_0x4498('0x3f')]);var _0x956560={'where':_0x5ed47d[_0x4498('0x3a')]};return db[_0x4498('0x2d')][_0x4498('0x1e')](_0x956560)[_0x4498('0x25')](function(_0x45f9e5){_0x5d97e0[_0x4498('0x1e')]=_0x45f9e5;if(_0x30efd7[_0x4498('0x32')][_0x4498('0x40')]){_0x5ed47d[_0x4498('0x41')]=[{'all':!![]}];}return db[_0x4498('0x2d')][_0x4498('0x42')](_0x5ed47d);})['then'](function(_0x475df3){_0x5d97e0['rows']=_0x475df3;return _0x5d97e0;})['then'](respondWithFilteredResult(_0x23ebcb,_0x5ed47d))[_0x4498('0x43')](handleError(_0x23ebcb,null));};exports[_0x4498('0x44')]=function(_0x5173e2,_0x15b536){var _0x1e0cb5={'raw':!![],'where':{'id':_0x5173e2['params']['id']}},_0x80a6d2={};_0x80a6d2[_0x4498('0x31')]=_[_0x4498('0x33')](db['MailSubstatus'][_0x4498('0x45')]);_0x80a6d2[_0x4498('0x32')]=_['keys'](_0x5173e2['query']);_0x80a6d2[_0x4498('0x34')]=_[_0x4498('0x35')](_0x80a6d2[_0x4498('0x31')],_0x80a6d2[_0x4498('0x32')]);_0x1e0cb5[_0x4498('0x37')]=_['intersection'](_0x80a6d2[_0x4498('0x31')],qs['fields'](_0x5173e2[_0x4498('0x32')]['fields']));_0x1e0cb5[_0x4498('0x37')]=_0x1e0cb5[_0x4498('0x37')][_0x4498('0x46')]?_0x1e0cb5[_0x4498('0x37')]:_0x80a6d2[_0x4498('0x31')];if(_0x5173e2[_0x4498('0x32')][_0x4498('0x40')]){_0x1e0cb5['include']=[{'all':!![]}];}_0x1e0cb5=_[_0x4498('0x3d')]({},_0x1e0cb5,_0x5173e2[_0x4498('0x3f')]);return db[_0x4498('0x2d')]['find'](_0x1e0cb5)[_0x4498('0x25')](handleEntityNotFound(_0x15b536,null))[_0x4498('0x25')](respondWithResult(_0x15b536,null))['catch'](handleError(_0x15b536,null));};exports['create']=function(_0x5f12ac,_0x3f07d1){return db['MailSubstatus'][_0x4498('0x47')](_0x5f12ac['body'],{})['then'](respondWithResult(_0x3f07d1,0xc9))[_0x4498('0x43')](handleError(_0x3f07d1,null));};exports[_0x4498('0x24')]=function(_0x34a713,_0xd22fd7){if(_0x34a713['body']['id']){delete _0x34a713[_0x4498('0x48')]['id'];}return db[_0x4498('0x2d')][_0x4498('0x49')]({'where':{'id':_0x34a713[_0x4498('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd22fd7,null))['then'](saveUpdates(_0x34a713['body'],null))[_0x4498('0x25')](respondWithResult(_0xd22fd7,null))['catch'](handleError(_0xd22fd7,null));};exports['destroy']=function(_0x15513c,_0x4f2a3f){return db[_0x4498('0x2d')]['find']({'where':{'id':_0x15513c['params']['id']}})[_0x4498('0x25')](handleEntityNotFound(_0x4f2a3f,null))[_0x4498('0x25')](removeEntity(_0x4f2a3f,null))[_0x4498('0x43')](handleError(_0x4f2a3f,null));};exports[_0x4498('0x4b')]=function(_0x71e104,_0x187cd2){return db[_0x4498('0x2d')][_0x4498('0x4b')]()[_0x4498('0x25')](respondWithResult(_0x187cd2,null))[_0x4498('0x43')](handleError(_0x187cd2,null));}; \ No newline at end of file +var _0x8707=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','moment','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/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','name','send','index','map','MailSubstatus','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x45583c,_0x45dfe3){var _0x4adb26=function(_0x1e5b3e){while(--_0x1e5b3e){_0x45583c['push'](_0x45583c['shift']());}};_0x4adb26(++_0x45dfe3);}(_0x8707,0xa1));var _0x7870=function(_0x5ac475,_0x669c3){_0x5ac475=_0x5ac475-0x0;var _0x1caba5=_0x8707[_0x5ac475];return _0x1caba5;};'use strict';var emlformat=require(_0x7870('0x0'));var rimraf=require(_0x7870('0x1'));var zipdir=require(_0x7870('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7870('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7870('0x4'));var path=require(_0x7870('0x5'));var sox=require(_0x7870('0x6'));var csv=require(_0x7870('0x7'));var ejs=require(_0x7870('0x8'));var fs=require('fs');var fs_extra=require(_0x7870('0x9'));var _=require(_0x7870('0xa'));var squel=require(_0x7870('0xb'));var crypto=require(_0x7870('0xc'));var jsforce=require(_0x7870('0xd'));var deskjs=require(_0x7870('0xe'));var toCsv=require(_0x7870('0x7'));var querystring=require(_0x7870('0xf'));var Papa=require(_0x7870('0x10'));var Redis=require(_0x7870('0x11'));var authService=require(_0x7870('0x12'));var qs=require(_0x7870('0x13'));var as=require(_0x7870('0x14'));var hardwareService=require(_0x7870('0x15'));var logger=require('../../config/logger')(_0x7870('0x16'));var utils=require(_0x7870('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7870('0x18'));var db=require(_0x7870('0x19'))['db'];function respondWithStatusCode(_0x330da6,_0x1fa717){_0x1fa717=_0x1fa717||0xcc;return function(_0x2b05e2){if(_0x2b05e2){return _0x330da6[_0x7870('0x1a')](_0x1fa717);}return _0x330da6[_0x7870('0x1b')](_0x1fa717)[_0x7870('0x1c')]();};}function respondWithResult(_0x16e356,_0x5a036a){_0x5a036a=_0x5a036a||0xc8;return function(_0x16a218){if(_0x16a218){return _0x16e356['status'](_0x5a036a)['json'](_0x16a218);}};}function respondWithFilteredResult(_0x3ced68,_0x4d79c8){return function(_0x3b5adb){if(_0x3b5adb){var _0x118f57=typeof _0x4d79c8[_0x7870('0x1d')]===_0x7870('0x1e')&&typeof _0x4d79c8[_0x7870('0x1f')]===_0x7870('0x1e');var _0x32fb14=_0x3b5adb[_0x7870('0x20')];var _0x57a305=_0x118f57?0x0:_0x4d79c8[_0x7870('0x1d')];var _0x31d840=_0x118f57?_0x3b5adb[_0x7870('0x20')]:_0x4d79c8[_0x7870('0x1d')]+_0x4d79c8[_0x7870('0x1f')];var _0x252373;if(_0x31d840>=_0x32fb14){_0x31d840=_0x32fb14;_0x252373=0xc8;}else{_0x252373=0xce;}_0x3ced68[_0x7870('0x1b')](_0x252373);return _0x3ced68['set'](_0x7870('0x21'),_0x57a305+'-'+_0x31d840+'/'+_0x32fb14)['json'](_0x3b5adb);}return null;};}function patchUpdates(_0x2d341f){return function(_0x2b43a6){try{jsonpatch['apply'](_0x2b43a6,_0x2d341f,!![]);}catch(_0x33ab4e){return BPromise[_0x7870('0x22')](_0x33ab4e);}return _0x2b43a6[_0x7870('0x23')]();};}function saveUpdates(_0x586e8e,_0x40eae1){return function(_0x107c57){if(_0x107c57){return _0x107c57[_0x7870('0x24')](_0x586e8e)[_0x7870('0x25')](function(_0x2d2351){return _0x2d2351;});}return null;};}function removeEntity(_0x32dd3d,_0x483051){return function(_0x18ccda){if(_0x18ccda){return _0x18ccda['destroy']()[_0x7870('0x25')](function(){_0x32dd3d[_0x7870('0x1b')](0xcc)[_0x7870('0x1c')]();});}};}function handleEntityNotFound(_0x2c0931,_0x586d8d){return function(_0x1163f){if(!_0x1163f){_0x2c0931[_0x7870('0x1a')](0x194);}return _0x1163f;};}function handleError(_0x5cd2a0,_0x2fc039){_0x2fc039=_0x2fc039||0x1f4;return function(_0x19418a){logger[_0x7870('0x26')](_0x19418a['stack']);if(_0x19418a['name']){delete _0x19418a[_0x7870('0x27')];}_0x5cd2a0[_0x7870('0x1b')](_0x2fc039)[_0x7870('0x28')](_0x19418a);};}exports[_0x7870('0x29')]=function(_0x34d298,_0x356706){var _0x5847c6={},_0x52019a={},_0x10f07e={'count':0x0,'rows':[]};var _0x1f53c5=_[_0x7870('0x2a')](db[_0x7870('0x2b')]['rawAttributes'],function(_0x3aeab3){return{'name':_0x3aeab3['fieldName'],'type':_0x3aeab3[_0x7870('0x2c')]['key']};});_0x52019a[_0x7870('0x2d')]=_[_0x7870('0x2a')](_0x1f53c5,_0x7870('0x27'));_0x52019a[_0x7870('0x2e')]=_['keys'](_0x34d298['query']);_0x52019a[_0x7870('0x2f')]=_[_0x7870('0x30')](_0x52019a[_0x7870('0x2d')],_0x52019a[_0x7870('0x2e')]);_0x5847c6[_0x7870('0x31')]=_[_0x7870('0x30')](_0x52019a['model'],qs[_0x7870('0x32')](_0x34d298['query'][_0x7870('0x32')]));_0x5847c6[_0x7870('0x31')]=_0x5847c6[_0x7870('0x31')][_0x7870('0x33')]?_0x5847c6[_0x7870('0x31')]:_0x52019a['model'];if(!_0x34d298[_0x7870('0x2e')][_0x7870('0x34')](_0x7870('0x35'))){_0x5847c6[_0x7870('0x1f')]=qs[_0x7870('0x1f')](_0x34d298['query']['limit']);_0x5847c6['offset']=qs[_0x7870('0x1d')](_0x34d298[_0x7870('0x2e')][_0x7870('0x1d')]);}_0x5847c6['order']=qs[_0x7870('0x36')](_0x34d298[_0x7870('0x2e')]['sort']);_0x5847c6[_0x7870('0x37')]=qs[_0x7870('0x2f')](_[_0x7870('0x38')](_0x34d298[_0x7870('0x2e')],_0x52019a[_0x7870('0x2f')]),_0x1f53c5);if(_0x34d298[_0x7870('0x2e')][_0x7870('0x39')]){_0x5847c6[_0x7870('0x37')]=_[_0x7870('0x3a')](_0x5847c6[_0x7870('0x37')],{'$or':_['map'](_0x1f53c5,function(_0x54dc16){if(_0x54dc16['type']!==_0x7870('0x3b')){var _0x51f41a={};_0x51f41a[_0x54dc16[_0x7870('0x27')]]={'$like':'%'+_0x34d298[_0x7870('0x2e')][_0x7870('0x39')]+'%'};return _0x51f41a;}})});}_0x5847c6=_[_0x7870('0x3a')]({},_0x5847c6,_0x34d298[_0x7870('0x3c')]);var _0x2379fd={'where':_0x5847c6[_0x7870('0x37')]};return db[_0x7870('0x2b')][_0x7870('0x20')](_0x2379fd)[_0x7870('0x25')](function(_0x2f0d6d){_0x10f07e['count']=_0x2f0d6d;if(_0x34d298[_0x7870('0x2e')][_0x7870('0x3d')]){_0x5847c6[_0x7870('0x3e')]=[{'all':!![]}];}return db[_0x7870('0x2b')][_0x7870('0x3f')](_0x5847c6);})[_0x7870('0x25')](function(_0x5a33db){_0x10f07e[_0x7870('0x40')]=_0x5a33db;return _0x10f07e;})[_0x7870('0x25')](respondWithFilteredResult(_0x356706,_0x5847c6))[_0x7870('0x41')](handleError(_0x356706,null));};exports['show']=function(_0x319674,_0x340458){var _0x2894ee={'raw':!![],'where':{'id':_0x319674[_0x7870('0x42')]['id']}},_0x41efbe={};_0x41efbe[_0x7870('0x2d')]=_[_0x7870('0x43')](db[_0x7870('0x2b')][_0x7870('0x44')]);_0x41efbe[_0x7870('0x2e')]=_[_0x7870('0x43')](_0x319674[_0x7870('0x2e')]);_0x41efbe[_0x7870('0x2f')]=_['intersection'](_0x41efbe[_0x7870('0x2d')],_0x41efbe[_0x7870('0x2e')]);_0x2894ee[_0x7870('0x31')]=_[_0x7870('0x30')](_0x41efbe['model'],qs[_0x7870('0x32')](_0x319674[_0x7870('0x2e')][_0x7870('0x32')]));_0x2894ee[_0x7870('0x31')]=_0x2894ee[_0x7870('0x31')][_0x7870('0x33')]?_0x2894ee[_0x7870('0x31')]:_0x41efbe[_0x7870('0x2d')];if(_0x319674[_0x7870('0x2e')][_0x7870('0x3d')]){_0x2894ee[_0x7870('0x3e')]=[{'all':!![]}];}_0x2894ee=_[_0x7870('0x3a')]({},_0x2894ee,_0x319674['options']);return db[_0x7870('0x2b')][_0x7870('0x45')](_0x2894ee)[_0x7870('0x25')](handleEntityNotFound(_0x340458,null))[_0x7870('0x25')](respondWithResult(_0x340458,null))[_0x7870('0x41')](handleError(_0x340458,null));};exports[_0x7870('0x46')]=function(_0x2693fb,_0x3beb73){return db[_0x7870('0x2b')][_0x7870('0x46')](_0x2693fb[_0x7870('0x47')],{})[_0x7870('0x25')](respondWithResult(_0x3beb73,0xc9))[_0x7870('0x41')](handleError(_0x3beb73,null));};exports[_0x7870('0x24')]=function(_0x111f6e,_0x173ea7){if(_0x111f6e[_0x7870('0x47')]['id']){delete _0x111f6e[_0x7870('0x47')]['id'];}return db[_0x7870('0x2b')][_0x7870('0x45')]({'where':{'id':_0x111f6e['params']['id']}})[_0x7870('0x25')](handleEntityNotFound(_0x173ea7,null))[_0x7870('0x25')](saveUpdates(_0x111f6e[_0x7870('0x47')],null))['then'](respondWithResult(_0x173ea7,null))[_0x7870('0x41')](handleError(_0x173ea7,null));};exports['destroy']=function(_0x3d2352,_0x17f337){return db[_0x7870('0x2b')][_0x7870('0x45')]({'where':{'id':_0x3d2352['params']['id']}})[_0x7870('0x25')](handleEntityNotFound(_0x17f337,null))[_0x7870('0x25')](removeEntity(_0x17f337,null))[_0x7870('0x41')](handleError(_0x17f337,null));};exports[_0x7870('0x48')]=function(_0x194eac,_0x350c6e){return db[_0x7870('0x2b')]['describe']()[_0x7870('0x25')](respondWithResult(_0x350c6e,null))[_0x7870('0x41')](handleError(_0x350c6e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 419d58b..36bea07 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 _0xbfca=['hasOwnProperty','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x37a151,_0x9cd98c){var _0x1a0709=function(_0x46767a){while(--_0x46767a){_0x37a151['push'](_0x37a151['shift']());}};_0x1a0709(++_0x9cd98c);}(_0xbfca,0x1a2));var _0xabfc=function(_0x3ca325,_0x370081){_0x3ca325=_0x3ca325-0x0;var _0x1ee6a4=_0xbfca[_0x3ca325];return _0x1ee6a4;};'use strict';var EventEmitter=require(_0xabfc('0x0'));var MailSubstatus=require(_0xabfc('0x1'))['db'][_0xabfc('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xabfc('0x3')](0x0);var events={'afterUpdate':_0xabfc('0x4')};function emitEvent(_0x5f2085){return function(_0x34f5dc,_0xf93d98,_0x574ee2){MailSubstatusEvents[_0xabfc('0x5')](_0x5f2085+':'+_0x34f5dc['id'],_0x34f5dc);MailSubstatusEvents[_0xabfc('0x5')](_0x5f2085,_0x34f5dc);_0x574ee2(null);};}for(var e in events){if(events[_0xabfc('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xabfc('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x709d=['events','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x709d,0x122));var _0xd709=function(_0x4b4da7,_0x34ea60){_0x4b4da7=_0x4b4da7-0x0;var _0x29b00e=_0x709d[_0x4b4da7];return _0x29b00e;};'use strict';var EventEmitter=require(_0xd709('0x0'));var MailSubstatus=require(_0xd709('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xd709('0x2')};function emitEvent(_0x5131e8){return function(_0x2828fd,_0x14e202,_0xf55c0c){MailSubstatusEvents['emit'](_0x5131e8+':'+_0x2828fd['id'],_0x2828fd);MailSubstatusEvents[_0xd709('0x3')](_0x5131e8,_0x2828fd);_0xf55c0c(null);};}for(var e in events){if(events[_0xd709('0x4')](e)){var event=events[e];MailSubstatus['hook'](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 6342a27..be41fce 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 _0xaa22=['mail_substatuses','Condition','update','name','_previousDataValues','models','define','MailSubstatus'];(function(_0x38e177,_0x59ec9f){var _0x1faf15=function(_0x4cf149){while(--_0x4cf149){_0x38e177['push'](_0x38e177['shift']());}};_0x1faf15(++_0x59ec9f);}(_0xaa22,0x1dd));var _0x2aa2=function(_0x3dab86,_0x42c669){_0x3dab86=_0x3dab86-0x0;var _0x4449fa=_0xaa22[_0x3dab86];return _0x4449fa;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x4532ae){var _0x54c0bb=_0x4532ae[_0x2aa2('0x0')];return _0x4532ae[_0x2aa2('0x1')](_0x2aa2('0x2'),attributes,{'tableName':_0x2aa2('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x240208,_0x5a791c,_0x496b6a){return _0x54c0bb[_0x2aa2('0x4')][_0x2aa2('0x5')]({'value':_0x240208[_0x2aa2('0x6')]},{'where':{'field':'mailSubstatus','value':_0x240208[_0x2aa2('0x7')][_0x2aa2('0x6')]}})['then'](function(){_0x496b6a();})['catch'](function(_0x4d8427){_0x496b6a(_0x4d8427);});}}});}; \ No newline at end of file +var _0x9d44=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x12b1c2,_0x2bb3ab){var _0x30c2ed=function(_0xf1d5dd){while(--_0xf1d5dd){_0x12b1c2['push'](_0x12b1c2['shift']());}};_0x30c2ed(++_0x2bb3ab);}(_0x9d44,0x1af));var _0x49d4=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x9d44[_0x421791];return _0x495838;};'use strict';var attributes=require(_0x49d4('0x0'));module[_0x49d4('0x1')]=function(_0x2d4b23){var _0x259700=_0x2d4b23[_0x49d4('0x2')];return _0x2d4b23[_0x49d4('0x3')](_0x49d4('0x4'),attributes,{'tableName':_0x49d4('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x247382,_0x686b51,_0x3827ca){return _0x259700[_0x49d4('0x6')][_0x49d4('0x7')]({'value':_0x247382['name']},{'where':{'field':_0x49d4('0x8'),'value':_0x247382[_0x49d4('0x9')][_0x49d4('0xa')]}})[_0x49d4('0xb')](function(){_0x3827ca();})[_0x49d4('0xc')](function(_0x9b09de){_0x3827ca(_0x9b09de);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index bab1260..fd9e2ff 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 _0xde5f=['request','then','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x36e624,_0x3a7a1d){var _0xc263c6=function(_0x375cf8){while(--_0x375cf8){_0x36e624['push'](_0x36e624['shift']());}};_0xc263c6(++_0x3a7a1d);}(_0xde5f,0x1df));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfde5('0x0'));var util=require('util');var moment=require(_0xfde5('0x1'));var BPromise=require(_0xfde5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfde5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfde5('0x4'))('rpc');var config=require(_0xfde5('0x5'));var jayson=require(_0xfde5('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52b300,_0x30171e,_0x2e5cee){return new BPromise(function(_0x7cf2ed,_0x465fb9){return client[_0xfde5('0x7')](_0x52b300,_0x2e5cee)[_0xfde5('0x8')](function(_0x553297){logger['info'](_0xfde5('0x9'),_0x30171e,'request\x20sent');logger['debug'](_0xfde5('0xa'),_0x30171e,_0xfde5('0xb'),JSON[_0xfde5('0xc')](_0x553297));if(_0x553297[_0xfde5('0xd')]){if(_0x553297[_0xfde5('0xd')]['code']===0x1f4){logger['error'](_0xfde5('0x9'),_0x30171e,_0x553297['error'][_0xfde5('0xe')]);return _0x465fb9(_0x553297[_0xfde5('0xd')]['message']);}logger[_0xfde5('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x30171e,_0x553297[_0xfde5('0xd')][_0xfde5('0xe')]);return _0x7cf2ed(_0x553297['error'][_0xfde5('0xe')]);}else{logger[_0xfde5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x30171e,'request\x20sent');_0x7cf2ed(_0x553297[_0xfde5('0x10')][_0xfde5('0xe')]);}})[_0xfde5('0x11')](function(_0x32b204){logger[_0xfde5('0xd')](_0xfde5('0x9'),_0x30171e,_0x32b204);_0x465fb9(_0x32b204);});});} \ No newline at end of file +var _0x6935=['client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1892f6,_0x2b1675){var _0x5dc2b9=function(_0x2a6711){while(--_0x2a6711){_0x1892f6['push'](_0x1892f6['shift']());}};_0x5dc2b9(++_0x2b1675);}(_0x6935,0x1c5));var _0x5693=function(_0x3bda74,_0x138905){_0x3bda74=_0x3bda74-0x0;var _0x1de48a=_0x6935[_0x3bda74];return _0x1de48a;};'use strict';var _=require(_0x5693('0x0'));var util=require(_0x5693('0x1'));var moment=require(_0x5693('0x2'));var BPromise=require(_0x5693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5693('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5693('0x5'));var logger=require(_0x5693('0x6'))(_0x5693('0x7'));var config=require(_0x5693('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5693('0x9')][_0x5693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42c296,_0x36fb31,_0x12d7be){return new BPromise(function(_0x1e9483,_0x479543){return client['request'](_0x42c296,_0x12d7be)[_0x5693('0xb')](function(_0x535233){logger[_0x5693('0xc')](_0x5693('0xd'),_0x36fb31,_0x5693('0xe'));logger[_0x5693('0xf')](_0x5693('0x10'),_0x36fb31,_0x5693('0xe'),JSON[_0x5693('0x11')](_0x535233));if(_0x535233['error']){if(_0x535233[_0x5693('0x12')][_0x5693('0x13')]===0x1f4){logger[_0x5693('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x36fb31,_0x535233[_0x5693('0x12')][_0x5693('0x14')]);return _0x479543(_0x535233[_0x5693('0x12')][_0x5693('0x14')]);}logger[_0x5693('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x36fb31,_0x535233['error']['message']);return _0x1e9483(_0x535233[_0x5693('0x12')]['message']);}else{logger[_0x5693('0xc')](_0x5693('0xd'),_0x36fb31,_0x5693('0xe'));_0x1e9483(_0x535233[_0x5693('0x15')]['message']);}})['catch'](function(_0x4d75ee){logger[_0x5693('0x12')](_0x5693('0xd'),_0x36fb31,_0x4d75ee);_0x479543(_0x4d75ee);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index de75704..aafece6 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 _0xb963=['create','put','update','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x3948ec,_0x3dfb10){var _0x2ad8f4=function(_0x4282fb){while(--_0x4282fb){_0x3948ec['push'](_0x3948ec['shift']());}};_0x2ad8f4(++_0x3dfb10);}(_0xb963,0xb9));var _0x3b96=function(_0x3f496a,_0x242230){_0x3f496a=_0x3f496a-0x0;var _0x36b839=_0xb963[_0x3f496a];return _0x36b839;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b96('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b96('0x1')]();var fs_extra=require(_0x3b96('0x2'));var auth=require(_0x3b96('0x3'));var interaction=require(_0x3b96('0x4'));var config=require('../../config/environment');var controller=require(_0x3b96('0x5'));router[_0x3b96('0x6')]('/',auth[_0x3b96('0x7')](),controller[_0x3b96('0x8')]);router[_0x3b96('0x6')](_0x3b96('0x9'),auth[_0x3b96('0x7')](),controller['describe']);router['get'](_0x3b96('0xa'),auth[_0x3b96('0x7')](),controller[_0x3b96('0xb')]);router[_0x3b96('0xc')]('/',auth[_0x3b96('0x7')](),controller[_0x3b96('0xd')]);router[_0x3b96('0xe')]('/:id',auth[_0x3b96('0x7')](),controller[_0x3b96('0xf')]);router[_0x3b96('0x10')](_0x3b96('0xa'),auth[_0x3b96('0x7')](),controller[_0x3b96('0x11')]);module['exports']=router; \ No newline at end of file +var _0x08f0=['get','isAuthenticated','index','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x463d36,_0x407ae7){var _0x454c7c=function(_0x3565e5){while(--_0x3565e5){_0x463d36['push'](_0x463d36['shift']());}};_0x454c7c(++_0x407ae7);}(_0x08f0,0x19b));var _0x008f=function(_0x477b98,_0x8e913){_0x477b98=_0x477b98-0x0;var _0x2f5ce5=_0x08f0[_0x477b98];return _0x2f5ce5;};'use strict';var multer=require(_0x008f('0x0'));var util=require(_0x008f('0x1'));var path=require(_0x008f('0x2'));var timeout=require('connect-timeout');var express=require(_0x008f('0x3'));var router=express[_0x008f('0x4')]();var fs_extra=require(_0x008f('0x5'));var auth=require(_0x008f('0x6'));var interaction=require(_0x008f('0x7'));var config=require(_0x008f('0x8'));var controller=require('./mailTransferReport.controller');router[_0x008f('0x9')]('/',auth[_0x008f('0xa')](),controller[_0x008f('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x008f('0xc')]);router[_0x008f('0x9')](_0x008f('0xd'),auth[_0x008f('0xa')](),controller['show']);router[_0x008f('0xe')]('/',auth[_0x008f('0xa')](),controller[_0x008f('0xf')]);router['put'](_0x008f('0xd'),auth[_0x008f('0xa')](),controller[_0x008f('0x10')]);router[_0x008f('0x11')](_0x008f('0xd'),auth['isAuthenticated'](),controller[_0x008f('0x12')]);module[_0x008f('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 860768e..49eaddc 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5ed7f7,_0x164449){var _0x136781=function(_0x399ba6){while(--_0x399ba6){_0x5ed7f7['push'](_0x5ed7f7['shift']());}};_0x136781(++_0x164449);}(_0xf4eb,0xec));var _0xbf4e=function(_0x30dcb1,_0x1102c7){_0x30dcb1=_0x30dcb1-0x0;var _0x3183c5=_0xf4eb[_0x30dcb1];return _0x3183c5;};'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(_0x3bcf7e,_0x130804){var _0x4f7684=function(_0xdd51d4){while(--_0xdd51d4){_0x3bcf7e['push'](_0x3bcf7e['shift']());}};_0x4f7684(++_0x130804);}(_0xf4eb,0xec));var _0xbf4e=function(_0x449f60,_0x55787b){_0x449f60=_0x449f60-0x0;var _0x2dde9e=_0xf4eb[_0x449f60];return _0x2dde9e;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2cad7c9..e85c0a8 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 _0x714c=['../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','order','where','filter','type','VIRTUAL','merge','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x49e142,_0x46f948){var _0x5a9daf=function(_0x19f06b){while(--_0x19f06b){_0x49e142['push'](_0x49e142['shift']());}};_0x5a9daf(++_0x46f948);}(_0x714c,0x1d6));var _0xc714=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x714c[_0x9c3c56];return _0x2dd782;};'use strict';var emlformat=require(_0xc714('0x0'));var rimraf=require(_0xc714('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc714('0x2'));var rp=require('request-promise');var moment=require(_0xc714('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc714('0x4'));var util=require(_0xc714('0x5'));var path=require(_0xc714('0x6'));var sox=require(_0xc714('0x7'));var csv=require(_0xc714('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc714('0x9'));var squel=require('squel');var crypto=require(_0xc714('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc714('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc714('0xc'));var Papa=require(_0xc714('0xd'));var Redis=require(_0xc714('0xe'));var authService=require(_0xc714('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc714('0x10'));var logger=require(_0xc714('0x11'))(_0xc714('0x12'));var utils=require(_0xc714('0x13'));var config=require(_0xc714('0x14'));var licenseUtil=require(_0xc714('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x439ef6,_0x584667){_0x584667=_0x584667||0xcc;return function(_0x35942e){if(_0x35942e){return _0x439ef6[_0xc714('0x16')](_0x584667);}return _0x439ef6[_0xc714('0x17')](_0x584667)[_0xc714('0x18')]();};}function respondWithResult(_0x580d4f,_0x255451){_0x255451=_0x255451||0xc8;return function(_0x59b8e3){if(_0x59b8e3){return _0x580d4f[_0xc714('0x17')](_0x255451)['json'](_0x59b8e3);}};}function respondWithFilteredResult(_0x4ac3c6,_0x18825a){return function(_0x201cb3){if(_0x201cb3){var _0x324e48=typeof _0x18825a[_0xc714('0x19')]===_0xc714('0x1a')&&typeof _0x18825a['limit']===_0xc714('0x1a');var _0x1f10a6=_0x201cb3[_0xc714('0x1b')];var _0x167402=_0x324e48?0x0:_0x18825a[_0xc714('0x19')];var _0x2f1221=_0x324e48?_0x201cb3[_0xc714('0x1b')]:_0x18825a[_0xc714('0x19')]+_0x18825a[_0xc714('0x1c')];var _0x1e76a6;if(_0x2f1221>=_0x1f10a6){_0x2f1221=_0x1f10a6;_0x1e76a6=0xc8;}else{_0x1e76a6=0xce;}_0x4ac3c6['status'](_0x1e76a6);return _0x4ac3c6[_0xc714('0x1d')]('Content-Range',_0x167402+'-'+_0x2f1221+'/'+_0x1f10a6)[_0xc714('0x1e')](_0x201cb3);}return null;};}function patchUpdates(_0x4eef8f){return function(_0xd8e5f3){try{jsonpatch[_0xc714('0x1f')](_0xd8e5f3,_0x4eef8f,!![]);}catch(_0x2d241c){return BPromise[_0xc714('0x20')](_0x2d241c);}return _0xd8e5f3[_0xc714('0x21')]();};}function saveUpdates(_0x17685e,_0x50d9d5){return function(_0x4cffbf){if(_0x4cffbf){return _0x4cffbf[_0xc714('0x22')](_0x17685e)[_0xc714('0x23')](function(_0x427401){return _0x427401;});}return null;};}function removeEntity(_0x28a556,_0x51ff75){return function(_0x12d740){if(_0x12d740){return _0x12d740[_0xc714('0x24')]()[_0xc714('0x23')](function(){_0x28a556[_0xc714('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5033c0,_0x4eb82c){return function(_0x339c7f){if(!_0x339c7f){_0x5033c0['sendStatus'](0x194);}return _0x339c7f;};}function handleError(_0x4a08a6,_0x45ee8f){_0x45ee8f=_0x45ee8f||0x1f4;return function(_0x48a12e){logger[_0xc714('0x25')](_0x48a12e[_0xc714('0x26')]);if(_0x48a12e[_0xc714('0x27')]){delete _0x48a12e[_0xc714('0x27')];}_0x4a08a6[_0xc714('0x17')](_0x45ee8f)['send'](_0x48a12e);};}exports[_0xc714('0x28')]=function(_0x48e854,_0x5a9d83){var _0x3c9ce9={},_0xfb7930={},_0x43a366={'count':0x0,'rows':[]};var _0x47f46d=_[_0xc714('0x29')](db['MailTransferReport'][_0xc714('0x2a')],function(_0x17f057){return{'name':_0x17f057[_0xc714('0x2b')],'type':_0x17f057['type']['key']};});_0xfb7930[_0xc714('0x2c')]=_['map'](_0x47f46d,_0xc714('0x27'));_0xfb7930[_0xc714('0x2d')]=_['keys'](_0x48e854[_0xc714('0x2d')]);_0xfb7930[_0xc714('0x2e')]=_[_0xc714('0x2f')](_0xfb7930[_0xc714('0x2c')],_0xfb7930[_0xc714('0x2d')]);_0x3c9ce9['attributes']=_[_0xc714('0x2f')](_0xfb7930[_0xc714('0x2c')],qs[_0xc714('0x30')](_0x48e854[_0xc714('0x2d')][_0xc714('0x30')]));_0x3c9ce9[_0xc714('0x31')]=_0x3c9ce9[_0xc714('0x31')][_0xc714('0x32')]?_0x3c9ce9['attributes']:_0xfb7930[_0xc714('0x2c')];if(!_0x48e854[_0xc714('0x2d')]['hasOwnProperty']('nolimit')){_0x3c9ce9[_0xc714('0x1c')]=qs['limit'](_0x48e854[_0xc714('0x2d')][_0xc714('0x1c')]);_0x3c9ce9[_0xc714('0x19')]=qs[_0xc714('0x19')](_0x48e854[_0xc714('0x2d')][_0xc714('0x19')]);}_0x3c9ce9[_0xc714('0x33')]=qs['sort'](_0x48e854[_0xc714('0x2d')]['sort']);_0x3c9ce9[_0xc714('0x34')]=qs['filters'](_['pick'](_0x48e854[_0xc714('0x2d')],_0xfb7930['filters']),_0x47f46d);if(_0x48e854['query'][_0xc714('0x35')]){_0x3c9ce9[_0xc714('0x34')]=_['merge'](_0x3c9ce9[_0xc714('0x34')],{'$or':_[_0xc714('0x29')](_0x47f46d,function(_0x2f91b7){if(_0x2f91b7[_0xc714('0x36')]!==_0xc714('0x37')){var _0x5a6511={};_0x5a6511[_0x2f91b7['name']]={'$like':'%'+_0x48e854[_0xc714('0x2d')][_0xc714('0x35')]+'%'};return _0x5a6511;}})});}_0x3c9ce9=_[_0xc714('0x38')]({},_0x3c9ce9,_0x48e854['options']);var _0x549b5a={'where':_0x3c9ce9[_0xc714('0x34')]};return db[_0xc714('0x39')][_0xc714('0x1b')](_0x549b5a)[_0xc714('0x23')](function(_0x381d1c){_0x43a366[_0xc714('0x1b')]=_0x381d1c;if(_0x48e854[_0xc714('0x2d')][_0xc714('0x3a')]){_0x3c9ce9[_0xc714('0x3b')]=[{'all':!![]}];}return db[_0xc714('0x39')][_0xc714('0x3c')](_0x3c9ce9);})[_0xc714('0x23')](function(_0x3ae53e){_0x43a366[_0xc714('0x3d')]=_0x3ae53e;return _0x43a366;})['then'](respondWithFilteredResult(_0x5a9d83,_0x3c9ce9))[_0xc714('0x3e')](handleError(_0x5a9d83,null));};exports[_0xc714('0x3f')]=function(_0x492147,_0x45a91c){var _0x164d29={'raw':!![],'where':{'id':_0x492147[_0xc714('0x40')]['id']}},_0x5bca0e={};_0x5bca0e[_0xc714('0x2c')]=_['keys'](db[_0xc714('0x39')][_0xc714('0x2a')]);_0x5bca0e[_0xc714('0x2d')]=_[_0xc714('0x41')](_0x492147[_0xc714('0x2d')]);_0x5bca0e[_0xc714('0x2e')]=_[_0xc714('0x2f')](_0x5bca0e[_0xc714('0x2c')],_0x5bca0e[_0xc714('0x2d')]);_0x164d29[_0xc714('0x31')]=_['intersection'](_0x5bca0e['model'],qs[_0xc714('0x30')](_0x492147[_0xc714('0x2d')][_0xc714('0x30')]));_0x164d29['attributes']=_0x164d29[_0xc714('0x31')][_0xc714('0x32')]?_0x164d29[_0xc714('0x31')]:_0x5bca0e[_0xc714('0x2c')];if(_0x492147['query'][_0xc714('0x3a')]){_0x164d29[_0xc714('0x3b')]=[{'all':!![]}];}_0x164d29=_[_0xc714('0x38')]({},_0x164d29,_0x492147['options']);return db[_0xc714('0x39')]['find'](_0x164d29)[_0xc714('0x23')](handleEntityNotFound(_0x45a91c,null))[_0xc714('0x23')](respondWithResult(_0x45a91c,null))[_0xc714('0x3e')](handleError(_0x45a91c,null));};exports[_0xc714('0x42')]=function(_0x149550,_0x244490){return db[_0xc714('0x39')]['create'](_0x149550[_0xc714('0x43')],{})[_0xc714('0x23')](respondWithResult(_0x244490,0xc9))[_0xc714('0x3e')](handleError(_0x244490,null));};exports[_0xc714('0x22')]=function(_0x29063c,_0x4ced42){if(_0x29063c[_0xc714('0x43')]['id']){delete _0x29063c['body']['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x29063c[_0xc714('0x40')]['id']}})[_0xc714('0x23')](handleEntityNotFound(_0x4ced42,null))[_0xc714('0x23')](saveUpdates(_0x29063c['body'],null))['then'](respondWithResult(_0x4ced42,null))['catch'](handleError(_0x4ced42,null));};exports[_0xc714('0x24')]=function(_0x197d10,_0x253c84){return db[_0xc714('0x39')][_0xc714('0x44')]({'where':{'id':_0x197d10[_0xc714('0x40')]['id']}})[_0xc714('0x23')](handleEntityNotFound(_0x253c84,null))['then'](removeEntity(_0x253c84,null))[_0xc714('0x3e')](handleError(_0x253c84,null));};exports[_0xc714('0x45')]=function(_0x45e85c,_0x16d676){return db[_0xc714('0x39')][_0xc714('0x45')]()[_0xc714('0x23')](respondWithResult(_0x16d676,null))[_0xc714('0x3e')](handleError(_0x16d676,null));}; \ No newline at end of file +var _0x9753=['create','body','catch','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9753,0x1af));var _0x3975=function(_0x3407be,_0x3ad78b){_0x3407be=_0x3407be-0x0;var _0x1743e2=_0x9753[_0x3407be];return _0x1743e2;};'use strict';var emlformat=require(_0x3975('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3975('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3975('0x2'));var moment=require(_0x3975('0x3'));var BPromise=require(_0x3975('0x4'));var Mustache=require(_0x3975('0x5'));var util=require(_0x3975('0x6'));var path=require('path');var sox=require(_0x3975('0x7'));var csv=require('to-csv');var ejs=require(_0x3975('0x8'));var fs=require('fs');var fs_extra=require(_0x3975('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3975('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3975('0xb'));var querystring=require('querystring');var Papa=require(_0x3975('0xc'));var Redis=require(_0x3975('0xd'));var authService=require(_0x3975('0xe'));var qs=require(_0x3975('0xf'));var as=require(_0x3975('0x10'));var hardwareService=require(_0x3975('0x11'));var logger=require(_0x3975('0x12'))(_0x3975('0x13'));var utils=require(_0x3975('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3975('0x15'));var db=require(_0x3975('0x16'))['db'];function respondWithStatusCode(_0x1c566c,_0x59e48d){_0x59e48d=_0x59e48d||0xcc;return function(_0x5347fc){if(_0x5347fc){return _0x1c566c[_0x3975('0x17')](_0x59e48d);}return _0x1c566c[_0x3975('0x18')](_0x59e48d)[_0x3975('0x19')]();};}function respondWithResult(_0x2408f0,_0x1c1bb2){_0x1c1bb2=_0x1c1bb2||0xc8;return function(_0x48140a){if(_0x48140a){return _0x2408f0[_0x3975('0x18')](_0x1c1bb2)[_0x3975('0x1a')](_0x48140a);}};}function respondWithFilteredResult(_0x2685c9,_0x30cc67){return function(_0x3c985d){if(_0x3c985d){var _0x49adda=typeof _0x30cc67[_0x3975('0x1b')]===_0x3975('0x1c')&&typeof _0x30cc67['limit']===_0x3975('0x1c');var _0x4fa085=_0x3c985d[_0x3975('0x1d')];var _0x330443=_0x49adda?0x0:_0x30cc67[_0x3975('0x1b')];var _0x7cc97a=_0x49adda?_0x3c985d['count']:_0x30cc67[_0x3975('0x1b')]+_0x30cc67[_0x3975('0x1e')];var _0x232939;if(_0x7cc97a>=_0x4fa085){_0x7cc97a=_0x4fa085;_0x232939=0xc8;}else{_0x232939=0xce;}_0x2685c9['status'](_0x232939);return _0x2685c9['set'](_0x3975('0x1f'),_0x330443+'-'+_0x7cc97a+'/'+_0x4fa085)[_0x3975('0x1a')](_0x3c985d);}return null;};}function patchUpdates(_0x32193e){return function(_0x2ff303){try{jsonpatch[_0x3975('0x20')](_0x2ff303,_0x32193e,!![]);}catch(_0x38064d){return BPromise['reject'](_0x38064d);}return _0x2ff303[_0x3975('0x21')]();};}function saveUpdates(_0x2147d7,_0xd0088a){return function(_0x5d42b2){if(_0x5d42b2){return _0x5d42b2[_0x3975('0x22')](_0x2147d7)[_0x3975('0x23')](function(_0xec0eb7){return _0xec0eb7;});}return null;};}function removeEntity(_0x312a57,_0x53e8e6){return function(_0x3178cb){if(_0x3178cb){return _0x3178cb['destroy']()[_0x3975('0x23')](function(){_0x312a57[_0x3975('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57c197,_0x133eea){return function(_0x170335){if(!_0x170335){_0x57c197[_0x3975('0x17')](0x194);}return _0x170335;};}function handleError(_0x244bb0,_0x58ef68){_0x58ef68=_0x58ef68||0x1f4;return function(_0x559f19){logger['error'](_0x559f19['stack']);if(_0x559f19['name']){delete _0x559f19[_0x3975('0x24')];}_0x244bb0[_0x3975('0x18')](_0x58ef68)[_0x3975('0x25')](_0x559f19);};}exports[_0x3975('0x26')]=function(_0x364ada,_0x1cfa59){var _0x11238b={},_0x43ae16={},_0x445d17={'count':0x0,'rows':[]};var _0x5e270c=_[_0x3975('0x27')](db[_0x3975('0x28')][_0x3975('0x29')],function(_0x525960){return{'name':_0x525960[_0x3975('0x2a')],'type':_0x525960[_0x3975('0x2b')][_0x3975('0x2c')]};});_0x43ae16[_0x3975('0x2d')]=_[_0x3975('0x27')](_0x5e270c,_0x3975('0x24'));_0x43ae16['query']=_[_0x3975('0x2e')](_0x364ada[_0x3975('0x2f')]);_0x43ae16[_0x3975('0x30')]=_[_0x3975('0x31')](_0x43ae16[_0x3975('0x2d')],_0x43ae16[_0x3975('0x2f')]);_0x11238b[_0x3975('0x32')]=_[_0x3975('0x31')](_0x43ae16[_0x3975('0x2d')],qs[_0x3975('0x33')](_0x364ada['query'][_0x3975('0x33')]));_0x11238b[_0x3975('0x32')]=_0x11238b['attributes'][_0x3975('0x34')]?_0x11238b[_0x3975('0x32')]:_0x43ae16[_0x3975('0x2d')];if(!_0x364ada[_0x3975('0x2f')]['hasOwnProperty'](_0x3975('0x35'))){_0x11238b['limit']=qs[_0x3975('0x1e')](_0x364ada[_0x3975('0x2f')][_0x3975('0x1e')]);_0x11238b[_0x3975('0x1b')]=qs[_0x3975('0x1b')](_0x364ada[_0x3975('0x2f')]['offset']);}_0x11238b[_0x3975('0x36')]=qs['sort'](_0x364ada['query']['sort']);_0x11238b[_0x3975('0x37')]=qs[_0x3975('0x30')](_['pick'](_0x364ada[_0x3975('0x2f')],_0x43ae16[_0x3975('0x30')]),_0x5e270c);if(_0x364ada[_0x3975('0x2f')][_0x3975('0x38')]){_0x11238b['where']=_[_0x3975('0x39')](_0x11238b[_0x3975('0x37')],{'$or':_['map'](_0x5e270c,function(_0x27b4f3){if(_0x27b4f3[_0x3975('0x2b')]!=='VIRTUAL'){var _0x18b599={};_0x18b599[_0x27b4f3[_0x3975('0x24')]]={'$like':'%'+_0x364ada[_0x3975('0x2f')][_0x3975('0x38')]+'%'};return _0x18b599;}})});}_0x11238b=_[_0x3975('0x39')]({},_0x11238b,_0x364ada[_0x3975('0x3a')]);var _0x518a28={'where':_0x11238b[_0x3975('0x37')]};return db[_0x3975('0x28')][_0x3975('0x1d')](_0x518a28)[_0x3975('0x23')](function(_0x4d5dfe){_0x445d17[_0x3975('0x1d')]=_0x4d5dfe;if(_0x364ada[_0x3975('0x2f')][_0x3975('0x3b')]){_0x11238b['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x3975('0x3c')](_0x11238b);})[_0x3975('0x23')](function(_0x559065){_0x445d17[_0x3975('0x3d')]=_0x559065;return _0x445d17;})[_0x3975('0x23')](respondWithFilteredResult(_0x1cfa59,_0x11238b))['catch'](handleError(_0x1cfa59,null));};exports[_0x3975('0x3e')]=function(_0xb08160,_0x857ef2){var _0x41f5ef={'raw':!![],'where':{'id':_0xb08160[_0x3975('0x3f')]['id']}},_0x442530={};_0x442530[_0x3975('0x2d')]=_[_0x3975('0x2e')](db['MailTransferReport'][_0x3975('0x29')]);_0x442530[_0x3975('0x2f')]=_[_0x3975('0x2e')](_0xb08160[_0x3975('0x2f')]);_0x442530[_0x3975('0x30')]=_[_0x3975('0x31')](_0x442530[_0x3975('0x2d')],_0x442530[_0x3975('0x2f')]);_0x41f5ef[_0x3975('0x32')]=_['intersection'](_0x442530['model'],qs[_0x3975('0x33')](_0xb08160[_0x3975('0x2f')][_0x3975('0x33')]));_0x41f5ef['attributes']=_0x41f5ef['attributes'][_0x3975('0x34')]?_0x41f5ef[_0x3975('0x32')]:_0x442530['model'];if(_0xb08160[_0x3975('0x2f')][_0x3975('0x3b')]){_0x41f5ef[_0x3975('0x40')]=[{'all':!![]}];}_0x41f5ef=_[_0x3975('0x39')]({},_0x41f5ef,_0xb08160['options']);return db[_0x3975('0x28')][_0x3975('0x41')](_0x41f5ef)[_0x3975('0x23')](handleEntityNotFound(_0x857ef2,null))[_0x3975('0x23')](respondWithResult(_0x857ef2,null))['catch'](handleError(_0x857ef2,null));};exports[_0x3975('0x42')]=function(_0x530bb4,_0x506e7e){return db[_0x3975('0x28')][_0x3975('0x42')](_0x530bb4[_0x3975('0x43')],{})[_0x3975('0x23')](respondWithResult(_0x506e7e,0xc9))[_0x3975('0x44')](handleError(_0x506e7e,null));};exports[_0x3975('0x22')]=function(_0x18bd81,_0x32ca7c){if(_0x18bd81[_0x3975('0x43')]['id']){delete _0x18bd81[_0x3975('0x43')]['id'];}return db[_0x3975('0x28')]['find']({'where':{'id':_0x18bd81[_0x3975('0x3f')]['id']}})['then'](handleEntityNotFound(_0x32ca7c,null))[_0x3975('0x23')](saveUpdates(_0x18bd81[_0x3975('0x43')],null))[_0x3975('0x23')](respondWithResult(_0x32ca7c,null))['catch'](handleError(_0x32ca7c,null));};exports[_0x3975('0x45')]=function(_0x3ce8d4,_0x59be87){return db[_0x3975('0x28')][_0x3975('0x41')]({'where':{'id':_0x3ce8d4[_0x3975('0x3f')]['id']}})[_0x3975('0x23')](handleEntityNotFound(_0x59be87,null))[_0x3975('0x23')](removeEntity(_0x59be87,null))[_0x3975('0x44')](handleError(_0x59be87,null));};exports[_0x3975('0x46')]=function(_0x4bfcd3,_0x5b65ab){return db[_0x3975('0x28')][_0x3975('0x46')]()[_0x3975('0x23')](respondWithResult(_0x5b65ab,null))[_0x3975('0x44')](handleError(_0x5b65ab,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e63acd6..ae90aeb 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 _0x1e6c=['../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a1b12,_0x4f7b74){var _0x57fb4d=function(_0x5a1f65){while(--_0x5a1f65){_0x3a1b12['push'](_0x3a1b12['shift']());}};_0x57fb4d(++_0x4f7b74);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x1b7ad0,_0x25c5c3){_0x1b7ad0=_0x1b7ad0-0x0;var _0x424a5a=_0x1e6c[_0x1b7ad0];return _0x424a5a;};'use strict';var _=require(_0xc1e6('0x0'));var util=require('util');var logger=require(_0xc1e6('0x1'))(_0xc1e6('0x2'));var moment=require(_0xc1e6('0x3'));var BPromise=require(_0xc1e6('0x4'));var rp=require(_0xc1e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc1e6('0x6'));var attributes=require(_0xc1e6('0x7'));module[_0xc1e6('0x8')]=function(_0x157b8d,_0x36968b){return _0x157b8d[_0xc1e6('0x9')](_0xc1e6('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xc1e6('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8aaa=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x405911,_0xcd61ab){var _0x33b1ff=function(_0x1f8815){while(--_0x1f8815){_0x405911['push'](_0x405911['shift']());}};_0x33b1ff(++_0xcd61ab);}(_0x8aaa,0x64));var _0xa8aa=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8aaa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var logger=require(_0xa8aa('0x2'))('api');var moment=require(_0xa8aa('0x3'));var BPromise=require(_0xa8aa('0x4'));var rp=require(_0xa8aa('0x5'));var fs=require('fs');var path=require(_0xa8aa('0x6'));var rimraf=require(_0xa8aa('0x7'));var config=require(_0xa8aa('0x8'));var attributes=require(_0xa8aa('0x9'));module[_0xa8aa('0xa')]=function(_0x5db8ce,_0x1aa721){return _0x5db8ce['define']('MailTransferReport',attributes,{'tableName':_0xa8aa('0xb'),'paranoid':![],'indexes':[{'name':_0xa8aa('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index eae74eb..4e5c135 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 _0x417e=['stringify','error','code','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4de5c7,_0x4c0d03){var _0x180ccc=function(_0x7f13e){while(--_0x7f13e){_0x4de5c7['push'](_0x4de5c7['shift']());}};_0x180ccc(++_0x4c0d03);}(_0x417e,0xe2));var _0xe417=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x417e[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require('lodash');var util=require(_0xe417('0x0'));var moment=require(_0xe417('0x1'));var BPromise=require(_0xe417('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe417('0x3'))['db'];var utils=require(_0xe417('0x4'));var logger=require(_0xe417('0x5'))('rpc');var config=require(_0xe417('0x6'));var jayson=require(_0xe417('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51cee2,_0x15ba00,_0x5ecaa){return new BPromise(function(_0x1d5fe6,_0x4aec96){return client['request'](_0x51cee2,_0x5ecaa)['then'](function(_0x3b4be4){logger[_0xe417('0x8')](_0xe417('0x9'),_0x15ba00,'request\x20sent');logger[_0xe417('0xa')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x15ba00,_0xe417('0xb'),JSON[_0xe417('0xc')](_0x3b4be4));if(_0x3b4be4[_0xe417('0xd')]){if(_0x3b4be4[_0xe417('0xd')][_0xe417('0xe')]===0x1f4){logger[_0xe417('0xd')](_0xe417('0x9'),_0x15ba00,_0x3b4be4[_0xe417('0xd')]['message']);return _0x4aec96(_0x3b4be4['error'][_0xe417('0xf')]);}logger[_0xe417('0xd')](_0xe417('0x9'),_0x15ba00,_0x3b4be4['error'][_0xe417('0xf')]);return _0x1d5fe6(_0x3b4be4[_0xe417('0xd')][_0xe417('0xf')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x15ba00,_0xe417('0xb'));_0x1d5fe6(_0x3b4be4['result']['message']);}})[_0xe417('0x10')](function(_0x26c12d){logger[_0xe417('0xd')](_0xe417('0x9'),_0x15ba00,_0x26c12d);_0x4aec96(_0x26c12d);});});} \ No newline at end of file +var _0xc17f=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0xa99103,_0x4d30a2){var _0x4021f5=function(_0x34d886){while(--_0x34d886){_0xa99103['push'](_0xa99103['shift']());}};_0x4021f5(++_0x4d30a2);}(_0xc17f,0x8c));var _0xfc17=function(_0x2e7426,_0x21caa7){_0x2e7426=_0x2e7426-0x0;var _0x4ddeb6=_0xc17f[_0x2e7426];return _0x4ddeb6;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc17('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc17('0x3'))(_0xfc17('0x4'));var config=require(_0xfc17('0x5'));var jayson=require(_0xfc17('0x6'));var client=jayson[_0xfc17('0x7')][_0xfc17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d3682,_0xf2f206,_0x1dba10){return new BPromise(function(_0x4097d5,_0x40d438){return client['request'](_0x1d3682,_0x1dba10)[_0xfc17('0x9')](function(_0x1630c9){logger[_0xfc17('0xa')](_0xfc17('0xb'),_0xf2f206,'request\x20sent');logger[_0xfc17('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xf2f206,_0xfc17('0xd'),JSON[_0xfc17('0xe')](_0x1630c9));if(_0x1630c9['error']){if(_0x1630c9[_0xfc17('0xf')][_0xfc17('0x10')]===0x1f4){logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x1630c9[_0xfc17('0xf')][_0xfc17('0x11')]);return _0x40d438(_0x1630c9[_0xfc17('0xf')][_0xfc17('0x11')]);}logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x1630c9['error'][_0xfc17('0x11')]);return _0x4097d5(_0x1630c9[_0xfc17('0xf')]['message']);}else{logger[_0xfc17('0xa')](_0xfc17('0xb'),_0xf2f206,_0xfc17('0xd'));_0x4097d5(_0x1630c9['result']['message']);}})[_0xfc17('0x12')](function(_0x124aad){logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x124aad);_0x40d438(_0x124aad);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index fc9f278..e71fdbf 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 _0x3f83=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1baac6,_0x38af03){var _0x37af75=function(_0x24692e){while(--_0x24692e){_0x1baac6['push'](_0x1baac6['shift']());}};_0x37af75(++_0x38af03);}(_0x3f83,0xcd));var _0x33f8=function(_0x3879a0,_0x14cdb4){_0x3879a0=_0x3879a0-0x0;var _0x23e93d=_0x3f83[_0x3879a0];return _0x23e93d;};'use strict';var multer=require(_0x33f8('0x0'));var util=require(_0x33f8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x33f8('0x2'));var router=express[_0x33f8('0x3')]();var fs_extra=require(_0x33f8('0x4'));var auth=require(_0x33f8('0x5'));var interaction=require(_0x33f8('0x6'));var config=require(_0x33f8('0x7'));var controller=require(_0x33f8('0x8'));router[_0x33f8('0x9')]('/',auth['isAuthenticated'](),controller[_0x33f8('0xa')]);router[_0x33f8('0x9')](_0x33f8('0xb'),auth[_0x33f8('0xc')](),controller[_0x33f8('0xd')]);router['get'](_0x33f8('0xe'),auth[_0x33f8('0xc')](),controller[_0x33f8('0xf')]);router[_0x33f8('0x10')]('/',auth[_0x33f8('0xc')](),controller[_0x33f8('0x11')]);router[_0x33f8('0x12')](_0x33f8('0xe'),auth['isAuthenticated'](),controller[_0x33f8('0x13')]);router[_0x33f8('0x14')](_0x33f8('0xe'),auth[_0x33f8('0xc')](),controller[_0x33f8('0x15')]);module[_0x33f8('0x16')]=router; \ No newline at end of file +var _0xb61f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','destroy','exports'];(function(_0x59bece,_0x102ed9){var _0x42468b=function(_0x22ce1a){while(--_0x22ce1a){_0x59bece['push'](_0x59bece['shift']());}};_0x42468b(++_0x102ed9);}(_0xb61f,0x84));var _0xfb61=function(_0x4a7d9d,_0x46e1dd){_0x4a7d9d=_0x4a7d9d-0x0;var _0x4ecabf=_0xb61f[_0x4a7d9d];return _0x4ecabf;};'use strict';var multer=require(_0xfb61('0x0'));var util=require(_0xfb61('0x1'));var path=require(_0xfb61('0x2'));var timeout=require(_0xfb61('0x3'));var express=require(_0xfb61('0x4'));var router=express[_0xfb61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfb61('0x6'));var interaction=require(_0xfb61('0x7'));var config=require(_0xfb61('0x8'));var controller=require(_0xfb61('0x9'));router[_0xfb61('0xa')]('/',auth[_0xfb61('0xb')](),controller[_0xfb61('0xc')]);router[_0xfb61('0xa')](_0xfb61('0xd'),auth[_0xfb61('0xb')](),controller[_0xfb61('0xe')]);router[_0xfb61('0xa')]('/:id',auth[_0xfb61('0xb')](),controller['show']);router[_0xfb61('0xf')]('/',auth[_0xfb61('0xb')](),controller[_0xfb61('0x10')]);router[_0xfb61('0x11')](_0xfb61('0x12'),auth[_0xfb61('0xb')](),controller[_0xfb61('0x13')]);router['delete'](_0xfb61('0x12'),auth[_0xfb61('0xb')](),controller[_0xfb61('0x14')]);module[_0xfb61('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 0f18a1f..c3bac9f 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 _0x7eb9=['exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','seconds','setDataValue'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x7eb9,0xd9));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x97eb('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x97eb('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x97eb('0x1')]},'type':{'type':Sequelize[_0x97eb('0x1')],'defaultValue':_0x97eb('0x2'),'comment':_0x97eb('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x97eb('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5f78f4){var _0x5327d4=moment(_0x5f78f4);var _0x44595e=moment(this['getDataValue']('enterAt'));var _0x429ed6=_0x5327d4['diff'](_0x44595e,_0x97eb('0x5'));this[_0x97eb('0x6')](_0x97eb('0x7'),_0x5f78f4);this[_0x97eb('0x6')](_0x97eb('0x8'),_0x429ed6||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x97eb('0x1')],'comment':_0x97eb('0x9')},'data3':{'type':Sequelize[_0x97eb('0x1')],'comment':_0x97eb('0xa')},'data4':{'type':Sequelize[_0x97eb('0x1')],'comment':_0x97eb('0xb')},'data5':{'type':Sequelize[_0x97eb('0x1')],'comment':_0x97eb('0xc')},'role':{'type':Sequelize[_0x97eb('0x1')]},'internal':{'type':Sequelize[_0x97eb('0xd')]},'uniqueid':{'type':Sequelize[_0x97eb('0x1')]}}; \ No newline at end of file +var _0xc090=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','setDataValue','exitAt'];(function(_0x381ad2,_0x2d8ecb){var _0x3b1869=function(_0x1fd403){while(--_0x1fd403){_0x381ad2['push'](_0x381ad2['shift']());}};_0x3b1869(++_0x2d8ecb);}(_0xc090,0x112));var _0x0c09=function(_0x15af07,_0xf00420){_0x15af07=_0x15af07-0x0;var _0x102765=_0xc090[_0x15af07];return _0x102765;};'use strict';var Sequelize=require(_0x0c09('0x0'));var moment=require(_0x0c09('0x1'));module[_0x0c09('0x2')]={'channel':{'type':Sequelize[_0x0c09('0x3')]},'membername':{'type':Sequelize[_0x0c09('0x3')]},'interface':{'type':Sequelize[_0x0c09('0x3')]},'type':{'type':Sequelize[_0x0c09('0x3')],'defaultValue':_0x0c09('0x4'),'comment':_0x0c09('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0c09('0x6')]},'exitAt':{'type':Sequelize[_0x0c09('0x6')],'set':function(_0x4f3f48){var _0x49a403=moment(_0x4f3f48);var _0x4c2143=moment(this['getDataValue'](_0x0c09('0x7')));var _0x2854d8=_0x49a403[_0x0c09('0x8')](_0x4c2143,'seconds');this[_0x0c09('0x9')](_0x0c09('0xa'),_0x4f3f48);this['setDataValue'](_0x0c09('0xb'),_0x2854d8||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x0c09('0xc')},'data2':{'type':Sequelize[_0x0c09('0x3')],'comment':_0x0c09('0xd')},'data3':{'type':Sequelize[_0x0c09('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x0c09('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0c09('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e07cd91..787e122 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xedd9,0xfc));var _0x9edd=function(_0x42181c,_0x267642){_0x42181c=_0x42181c-0x0;var _0x2e2e20=_0xedd9[_0x42181c];return _0x2e2e20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x34e8,0x12c));var _0x834e=function(_0x27146e,_0x15519e){_0x27146e=_0x27146e-0x0;var _0x219597=_0x34e8[_0x27146e];return _0x219597;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 12c49f7..ae60372 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 _0xc7e7=['report_member','interface','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x30b69b,_0x20cd55){var _0x4d0b11=function(_0x57416b){while(--_0x57416b){_0x30b69b['push'](_0x30b69b['shift']());}};_0x4d0b11(++_0x20cd55);}(_0xc7e7,0x13a));var _0x7c7e=function(_0x3e6081,_0x51251b){_0x3e6081=_0x3e6081-0x0;var _0x2aa856=_0xc7e7[_0x3e6081];return _0x2aa856;};'use strict';var _=require('lodash');var util=require(_0x7c7e('0x0'));var logger=require(_0x7c7e('0x1'))('api');var moment=require(_0x7c7e('0x2'));var BPromise=require(_0x7c7e('0x3'));var rp=require(_0x7c7e('0x4'));var fs=require('fs');var path=require(_0x7c7e('0x5'));var rimraf=require('rimraf');var config=require(_0x7c7e('0x6'));var attributes=require(_0x7c7e('0x7'));module['exports']=function(_0x17eaca,_0x1b7286){return _0x17eaca[_0x7c7e('0x8')](_0x7c7e('0x9'),attributes,{'tableName':_0x7c7e('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x7c7e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91f8=['define','report_member','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x91f8,0x13f));var _0x891f=function(_0x18a71e,_0x1887ec){_0x18a71e=_0x18a71e-0x0;var _0x6a2ef7=_0x91f8[_0x18a71e];return _0x6a2ef7;};'use strict';var _=require(_0x891f('0x0'));var util=require(_0x891f('0x1'));var logger=require(_0x891f('0x2'))(_0x891f('0x3'));var moment=require(_0x891f('0x4'));var BPromise=require(_0x891f('0x5'));var rp=require(_0x891f('0x6'));var fs=require('fs');var path=require(_0x891f('0x7'));var rimraf=require('rimraf');var config=require(_0x891f('0x8'));var attributes=require(_0x891f('0x9'));module[_0x891f('0xa')]=function(_0x892594,_0x59a2e4){return _0x892594[_0x891f('0xb')]('MemberReport',attributes,{'tableName':_0x891f('0xc'),'paranoid':![],'indexes':[{'name':_0x891f('0xd'),'fields':[_0x891f('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bf80b9b..015df99 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 _0x9b97=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','options','raw','where','limit','include','map','model','attributes','body','CreateMemberReport','UpdateMemberReport','MemberReport','lodash','moment'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x9b97,0x11e));var _0x79b9=function(_0x3c12c1,_0x3bc687){_0x3c12c1=_0x3c12c1-0x0;var _0x1e0c5a=_0x9b97[_0x3c12c1];return _0x1e0c5a;};'use strict';var _=require(_0x79b9('0x0'));var util=require('util');var moment=require(_0x79b9('0x1'));var BPromise=require(_0x79b9('0x2'));var rs=require(_0x79b9('0x3'));var fs=require('fs');var Redis=require(_0x79b9('0x4'));var db=require(_0x79b9('0x5'))['db'];var utils=require(_0x79b9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79b9('0x7'));var jayson=require(_0x79b9('0x8'));var client=jayson[_0x79b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2312c8,_0x234e33,_0x581e1d){return new BPromise(function(_0x35c2c9,_0x305dc8){return client[_0x79b9('0xa')](_0x2312c8,_0x581e1d)[_0x79b9('0xb')](function(_0x35d45a){logger['info']('MemberReport,\x20%s,\x20%s',_0x234e33,_0x79b9('0xc'));logger[_0x79b9('0xd')](_0x79b9('0xe'),_0x234e33,_0x79b9('0xc'),JSON[_0x79b9('0xf')](_0x35d45a));if(_0x35d45a[_0x79b9('0x10')]){if(_0x35d45a[_0x79b9('0x10')][_0x79b9('0x11')]===0x1f4){logger[_0x79b9('0x10')](_0x79b9('0x12'),_0x234e33,_0x35d45a[_0x79b9('0x10')]['message']);return _0x305dc8(_0x35d45a[_0x79b9('0x10')][_0x79b9('0x13')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x234e33,_0x35d45a['error'][_0x79b9('0x13')]);return _0x35c2c9(_0x35d45a[_0x79b9('0x10')][_0x79b9('0x13')]);}else{logger[_0x79b9('0x14')](_0x79b9('0x12'),_0x234e33,'request\x20sent');_0x35c2c9(_0x35d45a[_0x79b9('0x15')][_0x79b9('0x13')]);}})[_0x79b9('0x16')](function(_0x4720ec){logger[_0x79b9('0x10')](_0x79b9('0x12'),_0x234e33,_0x4720ec);_0x305dc8(_0x4720ec);});});}exports[_0x79b9('0x17')]=function(_0x621505){var _0x47c6e6=this;return new Promise(function(_0x54dc9d,_0x341281){return db['MemberReport']['findAll']({'raw':_0x621505['options']?_0x621505[_0x79b9('0x18')][_0x79b9('0x19')]===undefined?!![]:![]:!![],'where':_0x621505['options']?_0x621505[_0x79b9('0x18')][_0x79b9('0x1a')]||null:null,'attributes':_0x621505[_0x79b9('0x18')]?_0x621505[_0x79b9('0x18')]['attributes']||null:null,'limit':_0x621505[_0x79b9('0x18')]?_0x621505[_0x79b9('0x18')][_0x79b9('0x1b')]||null:null,'include':_0x621505[_0x79b9('0x18')]?_0x621505[_0x79b9('0x18')][_0x79b9('0x1c')]?_[_0x79b9('0x1d')](_0x621505['options'][_0x79b9('0x1c')],function(_0x2399fa){return{'model':db[_0x2399fa['model']],'as':_0x2399fa['as'],'attributes':_0x2399fa['attributes'],'include':_0x2399fa[_0x79b9('0x1c')]?_[_0x79b9('0x1d')](_0x2399fa[_0x79b9('0x1c')],function(_0x59ae09){return{'model':db[_0x59ae09[_0x79b9('0x1e')]],'as':_0x59ae09['as'],'attributes':_0x59ae09[_0x79b9('0x1f')],'include':_0x59ae09[_0x79b9('0x1c')]?_[_0x79b9('0x1d')](_0x59ae09[_0x79b9('0x1c')],function(_0x186764){return{'model':db[_0x186764[_0x79b9('0x1e')]],'as':_0x186764['as'],'attributes':_0x186764[_0x79b9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x79b9('0xb')](function(_0x1872b5){logger[_0x79b9('0x14')](_0x79b9('0x17'),_0x621505);logger[_0x79b9('0xd')](_0x79b9('0x17'),_0x621505,JSON[_0x79b9('0xf')](_0x1872b5));_0x54dc9d(_0x1872b5);})[_0x79b9('0x16')](function(_0x12d87e){logger[_0x79b9('0x10')]('GetMemberReport',_0x12d87e[_0x79b9('0x13')],_0x621505);_0x341281(_0x47c6e6['error'](0x1f4,_0x12d87e['message']));});});};exports['CreateMemberReport']=function(_0x468e49){var _0x53fc11=this;return new Promise(function(_0x45795a,_0x165fcf){return db['MemberReport']['create'](_0x468e49[_0x79b9('0x20')],{'raw':_0x468e49['options']?_0x468e49['options'][_0x79b9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d98d2){logger[_0x79b9('0x14')]('CreateMemberReport',_0x468e49);logger['debug'](_0x79b9('0x21'),_0x468e49,JSON[_0x79b9('0xf')](_0x1d98d2));_0x45795a(_0x1d98d2);})[_0x79b9('0x16')](function(_0x2822d9){logger[_0x79b9('0x10')]('CreateMemberReport',_0x2822d9['message'],_0x468e49);_0x165fcf(_0x53fc11['error'](0x1f4,_0x2822d9[_0x79b9('0x13')]));});});};exports[_0x79b9('0x22')]=function(_0x2a2de7){var _0x23794e=this;return new Promise(function(_0x156d5d,_0x3dc41c){return db[_0x79b9('0x23')]['update'](_0x2a2de7[_0x79b9('0x20')],{'raw':_0x2a2de7['options']?_0x2a2de7[_0x79b9('0x18')][_0x79b9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2de7[_0x79b9('0x18')]?_0x2a2de7['options'][_0x79b9('0x1a')]||null:null,'attributes':_0x2a2de7[_0x79b9('0x18')]?_0x2a2de7[_0x79b9('0x18')][_0x79b9('0x1f')]||null:null,'limit':_0x2a2de7['options']?_0x2a2de7['options'][_0x79b9('0x1b')]||null:null})[_0x79b9('0xb')](function(_0x2bbca3){logger[_0x79b9('0x14')]('UpdateMemberReport',_0x2a2de7);logger[_0x79b9('0xd')]('UpdateMemberReport',_0x2a2de7,JSON['stringify'](_0x2bbca3));_0x156d5d(_0x2bbca3);})[_0x79b9('0x16')](function(_0x2c1814){logger['error'](_0x79b9('0x22'),_0x2c1814[_0x79b9('0x13')],_0x2a2de7);_0x3dc41c(_0x23794e[_0x79b9('0x10')](0x1f4,_0x2c1814[_0x79b9('0x13')]));});});}; \ No newline at end of file +var _0xdcf6=['model','include','map','stringify','CreateMemberReport','create','UpdateMemberReport','update','body','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0xdcf6[_0x3b87f4];return _0x63d16e;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5abd79,_0x56fdb2,_0x5766db){return new BPromise(function(_0x34517a,_0x4e2877){return client[_0x6dcf('0xb')](_0x5abd79,_0x5766db)[_0x6dcf('0xc')](function(_0x304a75){logger['info']('MemberReport,\x20%s,\x20%s',_0x56fdb2,'request\x20sent');logger[_0x6dcf('0xd')](_0x6dcf('0xe'),_0x56fdb2,_0x6dcf('0xf'),JSON['stringify'](_0x304a75));if(_0x304a75[_0x6dcf('0x10')]){if(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x11')]===0x1f4){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x4e2877(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x34517a(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}else{logger[_0x6dcf('0x14')](_0x6dcf('0x12'),_0x56fdb2,'request\x20sent');_0x34517a(_0x304a75[_0x6dcf('0x15')][_0x6dcf('0x13')]);}})[_0x6dcf('0x16')](function(_0x4874ff){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x4874ff);_0x4e2877(_0x4874ff);});});}exports[_0x6dcf('0x17')]=function(_0x40b6ac){var _0x821c86=this;return new Promise(function(_0x83da87,_0x1bed56){return db[_0x6dcf('0x18')]['findAll']({'raw':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![],'where':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac['options'][_0x6dcf('0x1c')]||null:null,'limit':_0x40b6ac['options']?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1d')]||null:null,'include':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')]['include']?_['map'](_0x40b6ac[_0x6dcf('0x19')]['include'],function(_0x1df874){return{'model':db[_0x1df874[_0x6dcf('0x1e')]],'as':_0x1df874['as'],'attributes':_0x1df874[_0x6dcf('0x1c')],'include':_0x1df874[_0x6dcf('0x1f')]?_['map'](_0x1df874[_0x6dcf('0x1f')],function(_0x2b6dbe){return{'model':db[_0x2b6dbe[_0x6dcf('0x1e')]],'as':_0x2b6dbe['as'],'attributes':_0x2b6dbe[_0x6dcf('0x1c')],'include':_0x2b6dbe['include']?_[_0x6dcf('0x20')](_0x2b6dbe[_0x6dcf('0x1f')],function(_0x2dc909){return{'model':db[_0x2dc909[_0x6dcf('0x1e')]],'as':_0x2dc909['as'],'attributes':_0x2dc909[_0x6dcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6dcf('0xc')](function(_0x3fad7e){logger[_0x6dcf('0x14')](_0x6dcf('0x17'),_0x40b6ac);logger[_0x6dcf('0xd')](_0x6dcf('0x17'),_0x40b6ac,JSON[_0x6dcf('0x21')](_0x3fad7e));_0x83da87(_0x3fad7e);})['catch'](function(_0x3a4356){logger[_0x6dcf('0x10')]('GetMemberReport',_0x3a4356['message'],_0x40b6ac);_0x1bed56(_0x821c86['error'](0x1f4,_0x3a4356['message']));});});};exports[_0x6dcf('0x22')]=function(_0x356ad1){var _0x4c106c=this;return new Promise(function(_0x3d4615,_0x271c8e){return db[_0x6dcf('0x18')][_0x6dcf('0x23')](_0x356ad1['body'],{'raw':_0x356ad1[_0x6dcf('0x19')]?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![]})[_0x6dcf('0xc')](function(_0x1dd58c){logger[_0x6dcf('0x14')](_0x6dcf('0x22'),_0x356ad1);logger[_0x6dcf('0xd')](_0x6dcf('0x22'),_0x356ad1,JSON[_0x6dcf('0x21')](_0x1dd58c));_0x3d4615(_0x1dd58c);})[_0x6dcf('0x16')](function(_0x20f59d){logger[_0x6dcf('0x10')]('CreateMemberReport',_0x20f59d[_0x6dcf('0x13')],_0x356ad1);_0x271c8e(_0x4c106c[_0x6dcf('0x10')](0x1f4,_0x20f59d['message']));});});};exports[_0x6dcf('0x24')]=function(_0x212475){var _0x40587e=this;return new Promise(function(_0x9ed57e,_0x2d9d12){return db[_0x6dcf('0x18')][_0x6dcf('0x25')](_0x212475[_0x6dcf('0x26')],{'raw':_0x212475['options']?_0x212475[_0x6dcf('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212475[_0x6dcf('0x19')]?_0x212475[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x212475[_0x6dcf('0x19')]?_0x212475[_0x6dcf('0x19')][_0x6dcf('0x1c')]||null:null,'limit':_0x212475['options']?_0x212475[_0x6dcf('0x19')]['limit']||null:null})[_0x6dcf('0xc')](function(_0x59f505){logger[_0x6dcf('0x14')](_0x6dcf('0x24'),_0x212475);logger[_0x6dcf('0xd')]('UpdateMemberReport',_0x212475,JSON[_0x6dcf('0x21')](_0x59f505));_0x9ed57e(_0x59f505);})['catch'](function(_0x310c79){logger['error'](_0x6dcf('0x24'),_0x310c79['message'],_0x212475);_0x2d9d12(_0x40587e[_0x6dcf('0x10')](0x1f4,_0x310c79[_0x6dcf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2d0f492..4d0a446 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 _0x9485=['fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','Router'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x9485,0x8b));var _0x5948=function(_0xa8ec52,_0x7ed88f){_0xa8ec52=_0xa8ec52-0x0;var _0x575bcf=_0x9485[_0xa8ec52];return _0x575bcf;};'use strict';var multer=require(_0x5948('0x0'));var util=require(_0x5948('0x1'));var path=require(_0x5948('0x2'));var timeout=require(_0x5948('0x3'));var express=require('express');var router=express[_0x5948('0x4')]();var fs_extra=require(_0x5948('0x5'));var auth=require(_0x5948('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5948('0x7'));var controller=require(_0x5948('0x8'));router[_0x5948('0x9')]('/',controller[_0x5948('0xa')]);module[_0x5948('0xb')]=router; \ No newline at end of file +var _0x607c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','util'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x607c,0x1dc));var _0xc607=function(_0x1c6d5f,_0x1a9b2c){_0x1c6d5f=_0x1c6d5f-0x0;var _0x26a3f8=_0x607c[_0x1c6d5f];return _0x26a3f8;};'use strict';var multer=require('multer');var util=require(_0xc607('0x0'));var path=require(_0xc607('0x1'));var timeout=require('connect-timeout');var express=require(_0xc607('0x2'));var router=express[_0xc607('0x3')]();var fs_extra=require(_0xc607('0x4'));var auth=require(_0xc607('0x5'));var interaction=require(_0xc607('0x6'));var config=require('../../config/environment');var controller=require(_0xc607('0x7'));router[_0xc607('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index a385e8e..0af50ff 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 _0x03a9=['STRING','sequelize'];(function(_0x2bda9c,_0x1c4105){var _0x265b54=function(_0x549ffc){while(--_0x549ffc){_0x2bda9c['push'](_0x2bda9c['shift']());}};_0x265b54(++_0x1c4105);}(_0x03a9,0x1c9));var _0x903a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x03a9[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x903a('0x0'));module['exports']={'version':{'type':Sequelize[_0x903a('0x1')],'unique':'version'}}; \ No newline at end of file +var _0xac31=['STRING','exports'];(function(_0x5c58cb,_0x421722){var _0x35964f=function(_0x24b7f7){while(--_0x24b7f7){_0x5c58cb['push'](_0x5c58cb['shift']());}};_0x35964f(++_0x421722);}(_0xac31,0x16f));var _0x1ac3=function(_0x54309e,_0x3f8984){_0x54309e=_0x54309e-0x0;var _0x1ebb41=_0xac31[_0x54309e];return _0x1ebb41;};'use strict';var Sequelize=require('sequelize');module[_0x1ac3('0x0')]={'version':{'type':Sequelize[_0x1ac3('0x1')],'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 7014d0c..28ca9bc 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 _0x04f3=['set','apply','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','Migration','findAll','rows','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit'];(function(_0x43e783,_0xce12e4){var _0x15d49d=function(_0x4db403){while(--_0x4db403){_0x43e783['push'](_0x43e783['shift']());}};_0x15d49d(++_0xce12e4);}(_0x04f3,0x181));var _0x304f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x04f3[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x304f('0x0'));var rimraf=require(_0x304f('0x1'));var zipdir=require(_0x304f('0x2'));var jsonpatch=require(_0x304f('0x3'));var rp=require(_0x304f('0x4'));var moment=require(_0x304f('0x5'));var BPromise=require(_0x304f('0x6'));var Mustache=require('mustache');var util=require(_0x304f('0x7'));var path=require(_0x304f('0x8'));var sox=require('sox');var csv=require(_0x304f('0x9'));var ejs=require(_0x304f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x304f('0xb'));var squel=require(_0x304f('0xc'));var crypto=require(_0x304f('0xd'));var jsforce=require(_0x304f('0xe'));var deskjs=require(_0x304f('0xf'));var toCsv=require(_0x304f('0x9'));var querystring=require(_0x304f('0x10'));var Papa=require(_0x304f('0x11'));var Redis=require(_0x304f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x304f('0x13'));var as=require(_0x304f('0x14'));var hardwareService=require(_0x304f('0x15'));var logger=require(_0x304f('0x16'))(_0x304f('0x17'));var utils=require(_0x304f('0x18'));var config=require(_0x304f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x304f('0x1a'))['db'];function respondWithStatusCode(_0x19fae8,_0x4cb17c){_0x4cb17c=_0x4cb17c||0xcc;return function(_0x108b02){if(_0x108b02){return _0x19fae8[_0x304f('0x1b')](_0x4cb17c);}return _0x19fae8['status'](_0x4cb17c)[_0x304f('0x1c')]();};}function respondWithResult(_0x462771,_0xfe1311){_0xfe1311=_0xfe1311||0xc8;return function(_0x21ce09){if(_0x21ce09){return _0x462771[_0x304f('0x1d')](_0xfe1311)[_0x304f('0x1e')](_0x21ce09);}};}function respondWithFilteredResult(_0x56bc2a,_0x3f970c){return function(_0x2c8a65){if(_0x2c8a65){var _0x2c1bbd=typeof _0x3f970c[_0x304f('0x1f')]===_0x304f('0x20')&&typeof _0x3f970c['limit']===_0x304f('0x20');var _0x867b6e=_0x2c8a65[_0x304f('0x21')];var _0x2193e5=_0x2c1bbd?0x0:_0x3f970c[_0x304f('0x1f')];var _0x114d35=_0x2c1bbd?_0x2c8a65['count']:_0x3f970c[_0x304f('0x1f')]+_0x3f970c[_0x304f('0x22')];var _0x45f19e;if(_0x114d35>=_0x867b6e){_0x114d35=_0x867b6e;_0x45f19e=0xc8;}else{_0x45f19e=0xce;}_0x56bc2a['status'](_0x45f19e);return _0x56bc2a[_0x304f('0x23')]('Content-Range',_0x2193e5+'-'+_0x114d35+'/'+_0x867b6e)[_0x304f('0x1e')](_0x2c8a65);}return null;};}function patchUpdates(_0xbb5484){return function(_0x492f03){try{jsonpatch[_0x304f('0x24')](_0x492f03,_0xbb5484,!![]);}catch(_0x4ba3b4){return BPromise['reject'](_0x4ba3b4);}return _0x492f03[_0x304f('0x25')]();};}function saveUpdates(_0x5a2c91,_0x5a38fd){return function(_0x330104){if(_0x330104){return _0x330104[_0x304f('0x26')](_0x5a2c91)['then'](function(_0x2cb8fe){return _0x2cb8fe;});}return null;};}function removeEntity(_0x14938e,_0x45c34b){return function(_0x5829d0){if(_0x5829d0){return _0x5829d0[_0x304f('0x27')]()['then'](function(){_0x14938e[_0x304f('0x1d')](0xcc)[_0x304f('0x1c')]();});}};}function handleEntityNotFound(_0x7ec137,_0x363a2d){return function(_0x5ebfa8){if(!_0x5ebfa8){_0x7ec137[_0x304f('0x1b')](0x194);}return _0x5ebfa8;};}function handleError(_0x74e683,_0x14e999){_0x14e999=_0x14e999||0x1f4;return function(_0xf356b4){logger[_0x304f('0x28')](_0xf356b4[_0x304f('0x29')]);if(_0xf356b4[_0x304f('0x2a')]){delete _0xf356b4[_0x304f('0x2a')];}_0x74e683[_0x304f('0x1d')](_0x14e999)[_0x304f('0x2b')](_0xf356b4);};}exports['index']=function(_0xbb79b2,_0x429bf9){var _0x4e31ec={},_0x387a2d={},_0x2b22ba={'count':0x0,'rows':[]};var _0x353ef0=_[_0x304f('0x2c')](db['Migration'][_0x304f('0x2d')],function(_0x18abe9){return{'name':_0x18abe9[_0x304f('0x2e')],'type':_0x18abe9[_0x304f('0x2f')][_0x304f('0x30')]};});_0x387a2d[_0x304f('0x31')]=_[_0x304f('0x2c')](_0x353ef0,_0x304f('0x2a'));_0x387a2d[_0x304f('0x32')]=_[_0x304f('0x33')](_0xbb79b2['query']);_0x387a2d[_0x304f('0x34')]=_[_0x304f('0x35')](_0x387a2d[_0x304f('0x31')],_0x387a2d['query']);_0x4e31ec[_0x304f('0x36')]=_[_0x304f('0x35')](_0x387a2d['model'],qs[_0x304f('0x37')](_0xbb79b2[_0x304f('0x32')][_0x304f('0x37')]));_0x4e31ec[_0x304f('0x36')]=_0x4e31ec[_0x304f('0x36')]['length']?_0x4e31ec[_0x304f('0x36')]:_0x387a2d[_0x304f('0x31')];if(!_0xbb79b2[_0x304f('0x32')][_0x304f('0x38')](_0x304f('0x39'))){_0x4e31ec[_0x304f('0x22')]=qs['limit'](_0xbb79b2['query'][_0x304f('0x22')]);_0x4e31ec[_0x304f('0x1f')]=qs[_0x304f('0x1f')](_0xbb79b2[_0x304f('0x32')]['offset']);}_0x4e31ec[_0x304f('0x3a')]=qs[_0x304f('0x3b')](_0xbb79b2[_0x304f('0x32')][_0x304f('0x3b')]);_0x4e31ec['where']=qs[_0x304f('0x34')](_['pick'](_0xbb79b2[_0x304f('0x32')],_0x387a2d[_0x304f('0x34')]),_0x353ef0);if(_0xbb79b2['query'][_0x304f('0x3c')]){_0x4e31ec[_0x304f('0x3d')]=_[_0x304f('0x3e')](_0x4e31ec['where'],{'$or':_[_0x304f('0x2c')](_0x353ef0,function(_0x11ca9f){if(_0x11ca9f['type']!=='VIRTUAL'){var _0x439613={};_0x439613[_0x11ca9f[_0x304f('0x2a')]]={'$like':'%'+_0xbb79b2[_0x304f('0x32')][_0x304f('0x3c')]+'%'};return _0x439613;}})});}_0x4e31ec=_['merge']({},_0x4e31ec,_0xbb79b2[_0x304f('0x3f')]);var _0x11bfc6={'where':_0x4e31ec[_0x304f('0x3d')]};return db['Migration'][_0x304f('0x21')](_0x11bfc6)['then'](function(_0x5b3c27){_0x2b22ba[_0x304f('0x21')]=_0x5b3c27;if(_0xbb79b2[_0x304f('0x32')][_0x304f('0x40')]){_0x4e31ec['include']=[{'all':!![]}];}return db[_0x304f('0x41')][_0x304f('0x42')](_0x4e31ec);})['then'](function(_0x46635){_0x2b22ba[_0x304f('0x43')]=_0x46635;return _0x2b22ba;})[_0x304f('0x44')](respondWithFilteredResult(_0x429bf9,_0x4e31ec))[_0x304f('0x45')](handleError(_0x429bf9,null));}; \ No newline at end of file +var _0xb48d=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','Migration','fieldName','type','key','model','map','query'];(function(_0x25c533,_0x3da107){var _0x232d71=function(_0x127428){while(--_0x127428){_0x25c533['push'](_0x25c533['shift']());}};_0x232d71(++_0x3da107);}(_0xb48d,0xdb));var _0xdb48=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb48d[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb48('0x0'));var zipdir=require(_0xdb48('0x1'));var jsonpatch=require(_0xdb48('0x2'));var rp=require(_0xdb48('0x3'));var moment=require('moment');var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require(_0xdb48('0x6'));var path=require('path');var sox=require(_0xdb48('0x7'));var csv=require(_0xdb48('0x8'));var ejs=require(_0xdb48('0x9'));var fs=require('fs');var fs_extra=require(_0xdb48('0xa'));var _=require('lodash');var squel=require(_0xdb48('0xb'));var crypto=require(_0xdb48('0xc'));var jsforce=require(_0xdb48('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb48('0xe'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb48('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0x11'));var logger=require(_0xdb48('0x12'))(_0xdb48('0x13'));var utils=require(_0xdb48('0x14'));var config=require(_0xdb48('0x15'));var licenseUtil=require(_0xdb48('0x16'));var db=require(_0xdb48('0x17'))['db'];function respondWithStatusCode(_0x4b670f,_0xfa9623){_0xfa9623=_0xfa9623||0xcc;return function(_0x5e7453){if(_0x5e7453){return _0x4b670f['sendStatus'](_0xfa9623);}return _0x4b670f[_0xdb48('0x18')](_0xfa9623)[_0xdb48('0x19')]();};}function respondWithResult(_0x583b01,_0x5585cc){_0x5585cc=_0x5585cc||0xc8;return function(_0x47cc34){if(_0x47cc34){return _0x583b01[_0xdb48('0x18')](_0x5585cc)[_0xdb48('0x1a')](_0x47cc34);}};}function respondWithFilteredResult(_0x51748e,_0x41e7a0){return function(_0x448aa5){if(_0x448aa5){var _0x27d514=typeof _0x41e7a0[_0xdb48('0x1b')]===_0xdb48('0x1c')&&typeof _0x41e7a0[_0xdb48('0x1d')]==='undefined';var _0x970286=_0x448aa5['count'];var _0x93a085=_0x27d514?0x0:_0x41e7a0['offset'];var _0x24deb5=_0x27d514?_0x448aa5[_0xdb48('0x1e')]:_0x41e7a0['offset']+_0x41e7a0['limit'];var _0x4888fb;if(_0x24deb5>=_0x970286){_0x24deb5=_0x970286;_0x4888fb=0xc8;}else{_0x4888fb=0xce;}_0x51748e[_0xdb48('0x18')](_0x4888fb);return _0x51748e[_0xdb48('0x1f')](_0xdb48('0x20'),_0x93a085+'-'+_0x24deb5+'/'+_0x970286)[_0xdb48('0x1a')](_0x448aa5);}return null;};}function patchUpdates(_0x59a880){return function(_0x419e62){try{jsonpatch[_0xdb48('0x21')](_0x419e62,_0x59a880,!![]);}catch(_0x41b2bb){return BPromise['reject'](_0x41b2bb);}return _0x419e62['save']();};}function saveUpdates(_0x3a0250,_0x10be1a){return function(_0x52e2bf){if(_0x52e2bf){return _0x52e2bf[_0xdb48('0x22')](_0x3a0250)[_0xdb48('0x23')](function(_0x26bfee){return _0x26bfee;});}return null;};}function removeEntity(_0x303716,_0x2738d5){return function(_0x589519){if(_0x589519){return _0x589519[_0xdb48('0x24')]()[_0xdb48('0x23')](function(){_0x303716[_0xdb48('0x18')](0xcc)[_0xdb48('0x19')]();});}};}function handleEntityNotFound(_0x34f506,_0x36e641){return function(_0x45b160){if(!_0x45b160){_0x34f506[_0xdb48('0x25')](0x194);}return _0x45b160;};}function handleError(_0x107bac,_0x5ed5f6){_0x5ed5f6=_0x5ed5f6||0x1f4;return function(_0xb4bc3e){logger[_0xdb48('0x26')](_0xb4bc3e[_0xdb48('0x27')]);if(_0xb4bc3e[_0xdb48('0x28')]){delete _0xb4bc3e[_0xdb48('0x28')];}_0x107bac[_0xdb48('0x18')](_0x5ed5f6)[_0xdb48('0x29')](_0xb4bc3e);};}exports['index']=function(_0x8e9b85,_0x2db54b){var _0x466088={},_0x585520={},_0x555c39={'count':0x0,'rows':[]};var _0x3ebef9=_['map'](db[_0xdb48('0x2a')]['rawAttributes'],function(_0x1184d0){return{'name':_0x1184d0[_0xdb48('0x2b')],'type':_0x1184d0[_0xdb48('0x2c')][_0xdb48('0x2d')]};});_0x585520[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x3ebef9,_0xdb48('0x28'));_0x585520[_0xdb48('0x30')]=_['keys'](_0x8e9b85[_0xdb48('0x30')]);_0x585520[_0xdb48('0x31')]=_[_0xdb48('0x32')](_0x585520['model'],_0x585520[_0xdb48('0x30')]);_0x466088[_0xdb48('0x33')]=_['intersection'](_0x585520[_0xdb48('0x2e')],qs[_0xdb48('0x34')](_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x34')]));_0x466088[_0xdb48('0x33')]=_0x466088['attributes'][_0xdb48('0x35')]?_0x466088[_0xdb48('0x33')]:_0x585520[_0xdb48('0x2e')];if(!_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x36')]('nolimit')){_0x466088[_0xdb48('0x1d')]=qs[_0xdb48('0x1d')](_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x1d')]);_0x466088['offset']=qs[_0xdb48('0x1b')](_0x8e9b85['query'][_0xdb48('0x1b')]);}_0x466088[_0xdb48('0x37')]=qs[_0xdb48('0x38')](_0x8e9b85[_0xdb48('0x30')]['sort']);_0x466088[_0xdb48('0x39')]=qs[_0xdb48('0x31')](_[_0xdb48('0x3a')](_0x8e9b85[_0xdb48('0x30')],_0x585520[_0xdb48('0x31')]),_0x3ebef9);if(_0x8e9b85[_0xdb48('0x30')]['filter']){_0x466088[_0xdb48('0x39')]=_['merge'](_0x466088[_0xdb48('0x39')],{'$or':_[_0xdb48('0x2f')](_0x3ebef9,function(_0x84488d){if(_0x84488d[_0xdb48('0x2c')]!==_0xdb48('0x3b')){var _0x5e94d0={};_0x5e94d0[_0x84488d['name']]={'$like':'%'+_0x8e9b85['query'][_0xdb48('0x3c')]+'%'};return _0x5e94d0;}})});}_0x466088=_[_0xdb48('0x3d')]({},_0x466088,_0x8e9b85[_0xdb48('0x3e')]);var _0x1267a5={'where':_0x466088[_0xdb48('0x39')]};return db[_0xdb48('0x2a')][_0xdb48('0x1e')](_0x1267a5)[_0xdb48('0x23')](function(_0x14983f){_0x555c39['count']=_0x14983f;if(_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x3f')]){_0x466088['include']=[{'all':!![]}];}return db[_0xdb48('0x2a')][_0xdb48('0x40')](_0x466088);})['then'](function(_0x373141){_0x555c39[_0xdb48('0x41')]=_0x373141;return _0x555c39;})[_0xdb48('0x23')](respondWithFilteredResult(_0x2db54b,_0x466088))[_0xdb48('0x42')](handleError(_0x2db54b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 95ca13c..535aeba 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 _0x1309=['moment','request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x5d9b65,_0x31f572){var _0x4d6737=function(_0x554178){while(--_0x554178){_0x5d9b65['push'](_0x5d9b65['shift']());}};_0x4d6737(++_0x31f572);}(_0x1309,0x14e));var _0x9130=function(_0x2cdcdd,_0x458335){_0x2cdcdd=_0x2cdcdd-0x0;var _0x9b6469=_0x1309[_0x2cdcdd];return _0x9b6469;};'use strict';var _=require(_0x9130('0x0'));var util=require(_0x9130('0x1'));var logger=require(_0x9130('0x2'))(_0x9130('0x3'));var moment=require(_0x9130('0x4'));var BPromise=require('bluebird');var rp=require(_0x9130('0x5'));var fs=require('fs');var path=require(_0x9130('0x6'));var rimraf=require('rimraf');var config=require(_0x9130('0x7'));var attributes=require(_0x9130('0x8'));module[_0x9130('0x9')]=function(_0x547512,_0x1d7db0){return _0x547512[_0x9130('0xa')](_0x9130('0xb'),attributes,{'tableName':_0x9130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb18=['Migration','migrations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x52261b,_0x3060e2){var _0x4e2ff6=function(_0x2ca4c1){while(--_0x2ca4c1){_0x52261b['push'](_0x52261b['shift']());}};_0x4e2ff6(++_0x3060e2);}(_0xcb18,0x1a6));var _0x8cb1=function(_0x27bb2e,_0x248bfa){_0x27bb2e=_0x27bb2e-0x0;var _0x169a48=_0xcb18[_0x27bb2e];return _0x169a48;};'use strict';var _=require(_0x8cb1('0x0'));var util=require(_0x8cb1('0x1'));var logger=require(_0x8cb1('0x2'))(_0x8cb1('0x3'));var moment=require(_0x8cb1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cb1('0x5'));var rimraf=require(_0x8cb1('0x6'));var config=require(_0x8cb1('0x7'));var attributes=require('./migration.attributes');module[_0x8cb1('0x8')]=function(_0xe66b17,_0x5f3dd2){return _0xe66b17[_0x8cb1('0x9')](_0x8cb1('0xa'),attributes,{'tableName':_0x8cb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index c0f5305..e4b9fcf 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 _0xfc65=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x2b0226,_0x4200fa){var _0x3d0c55=function(_0x148556){while(--_0x148556){_0x2b0226['push'](_0x2b0226['shift']());}};_0x3d0c55(++_0x4200fa);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x1f94ec,_0x29bc55){_0x1f94ec=_0x1f94ec-0x0;var _0x530215=_0xfc65[_0x1f94ec];return _0x530215;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rs=require(_0x5fc6('0x4'));var fs=require('fs');var Redis=require(_0x5fc6('0x5'));var db=require(_0x5fc6('0x6'))['db'];var utils=require(_0x5fc6('0x7'));var logger=require(_0x5fc6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26d89e,_0x1360cb,_0x5c93f7){return new BPromise(function(_0x5a47c1,_0x467f6b){return client[_0x5fc6('0xc')](_0x26d89e,_0x5c93f7)[_0x5fc6('0xd')](function(_0x52f28c){logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1360cb,'request\x20sent');logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x1360cb,'request\x20sent',JSON['stringify'](_0x52f28c));if(_0x52f28c[_0x5fc6('0x12')]){if(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x13')]===0x1f4){logger['error'](_0x5fc6('0xf'),_0x1360cb,_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);return _0x467f6b(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);}logger[_0x5fc6('0x12')]('Migration,\x20%s,\x20%s',_0x1360cb,_0x52f28c[_0x5fc6('0x12')]['message']);return _0x5a47c1(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);}else{logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1360cb,'request\x20sent');_0x5a47c1(_0x52f28c[_0x5fc6('0x15')]['message']);}})[_0x5fc6('0x16')](function(_0x585f13){logger['error'](_0x5fc6('0xf'),_0x1360cb,_0x585f13);_0x467f6b(_0x585f13);});});} \ No newline at end of file +var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xa902,0x8d));var _0x2a90=function(_0x2d14fc,_0x3dacaa){_0x2d14fc=_0x2d14fc-0x0;var _0x30eda2=_0xa902[_0x2d14fc];return _0x30eda2;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('Migration,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('Migration,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b2f7176..d5d2242 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 _0x4c60=['path','connect-timeout','Router','./network.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x434dbd,_0x32b69d){var _0x364516=function(_0x2fb8fd){while(--_0x2fb8fd){_0x434dbd['push'](_0x434dbd['shift']());}};_0x364516(++_0x32b69d);}(_0x4c60,0xc1));var _0x04c6=function(_0x426a28,_0x1625db){_0x426a28=_0x426a28-0x0;var _0x2e7211=_0x4c60[_0x426a28];return _0x2e7211;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['show']);router[_0x04c6('0xa')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router[_0x04c6('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x04c6('0xd')]('/:id',auth[_0x04c6('0x7')](),controller[_0x04c6('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7795=['update','delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put'];(function(_0xccb9a3,_0x35b7b9){var _0x516bf6=function(_0x4b7b3a){while(--_0x4b7b3a){_0xccb9a3['push'](_0xccb9a3['shift']());}};_0x516bf6(++_0x35b7b9);}(_0x7795,0x1a4));var _0x5779=function(_0x3d6373,_0x33e4a6){_0x3d6373=_0x3d6373-0x0;var _0x2d99c7=_0x7795[_0x3d6373];return _0x2d99c7;};'use strict';var multer=require('multer');var util=require(_0x5779('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5779('0x1'));var router=express[_0x5779('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5779('0x3'));var config=require(_0x5779('0x4'));var controller=require('./network.controller');router[_0x5779('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5779('0x5')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0x8')]);router[_0x5779('0x9')]('/',auth['isAuthenticated'](),controller[_0x5779('0xa')]);router[_0x5779('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5779('0xc')]);router[_0x5779('0xd')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0xe')]);module[_0x5779('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d841bb5..cade893 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 _0xaa86=['turn','STRING','exports','ENUM','localnet','externip','stun'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaa86,0x191));var _0x6aa8=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xaa86[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require('sequelize');module[_0x6aa8('0x0')]={'type':{'type':Sequelize[_0x6aa8('0x1')](_0x6aa8('0x2'),_0x6aa8('0x3'),_0x6aa8('0x4'),_0x6aa8('0x5'))},'value':{'type':Sequelize[_0x6aa8('0x6')]},'username':{'type':Sequelize[_0x6aa8('0x6')]},'password':{'type':Sequelize[_0x6aa8('0x6')]}}; \ No newline at end of file +var _0x5f49=['localnet','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x5f49,0x193));var _0x95f4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5f49[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x95f4('0x0'));module[_0x95f4('0x1')]={'type':{'type':Sequelize[_0x95f4('0x2')](_0x95f4('0x3'),'externip',_0x95f4('0x4'),_0x95f4('0x5'))},'value':{'type':Sequelize[_0x95f4('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x95f4('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 25a088f..6433daf 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 _0xd78e=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','limit','undefined','offset','count','apply','reject','save','destroy','stack','name','send','index','Network','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','includeAll','include','findAll','rows','show','fields','length','options','find','sequelize','transaction','create','body','toUpperCase','STUN','join','root','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','params','server/files/templates/stun_multiple.ejs','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x23800d,_0x511b26){var _0x22cf13=function(_0x144643){while(--_0x144643){_0x23800d['push'](_0x23800d['shift']());}};_0x22cf13(++_0x511b26);}(_0xd78e,0xc1));var _0xed78=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xd78e[_0x119629];return _0x49a771;};'use strict';var emlformat=require(_0xed78('0x0'));var rimraf=require(_0xed78('0x1'));var zipdir=require(_0xed78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xed78('0x3'));var BPromise=require(_0xed78('0x4'));var Mustache=require(_0xed78('0x5'));var util=require(_0xed78('0x6'));var path=require(_0xed78('0x7'));var sox=require(_0xed78('0x8'));var csv=require(_0xed78('0x9'));var ejs=require(_0xed78('0xa'));var fs=require('fs');var fs_extra=require(_0xed78('0xb'));var _=require(_0xed78('0xc'));var squel=require('squel');var crypto=require(_0xed78('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xed78('0xe'));var toCsv=require(_0xed78('0x9'));var querystring=require(_0xed78('0xf'));var Papa=require(_0xed78('0x10'));var Redis=require(_0xed78('0x11'));var authService=require(_0xed78('0x12'));var qs=require(_0xed78('0x13'));var as=require(_0xed78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed78('0x15'))('api');var utils=require(_0xed78('0x16'));var config=require(_0xed78('0x17'));var licenseUtil=require(_0xed78('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xed78('0x19'));var client=jayson[_0xed78('0x1a')][_0xed78('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x47cf3b,_0x4f5c96,_0x5c0874,_0x5ab926){return new BPromise(function(_0x1d27b9,_0x1466ff){var _0x5f2d0b=_0x5ab926||client;return _0x5f2d0b[_0xed78('0x1c')](_0x47cf3b,_0x5c0874)[_0xed78('0x1d')](function(_0x3eb5ad){logger[_0xed78('0x1e')](_0xed78('0x1f'),_0x4f5c96,'request\x20sent');logger[_0xed78('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0x4f5c96,_0xed78('0x21'),JSON[_0xed78('0x22')](_0x3eb5ad));if(_0x3eb5ad[_0xed78('0x23')]){if(_0x3eb5ad[_0xed78('0x23')]['code']===0x1f4){logger[_0xed78('0x23')]('Network,\x20%s,\x20%s',_0x4f5c96,_0x3eb5ad['error'][_0xed78('0x24')]);return _0x1466ff(_0x3eb5ad[_0xed78('0x23')][_0xed78('0x24')]);}logger['error']('Network,\x20%s,\x20%s',_0x4f5c96,_0x3eb5ad[_0xed78('0x23')]['message']);return _0x1d27b9(_0x3eb5ad[_0xed78('0x23')][_0xed78('0x24')]);}else{logger[_0xed78('0x1e')](_0xed78('0x1f'),_0x4f5c96,_0xed78('0x21'));_0x1d27b9(_0x3eb5ad[_0xed78('0x25')][_0xed78('0x24')]);}})[_0xed78('0x26')](function(_0x388f69){logger['error']('Network,\x20%s,\x20%s',_0x4f5c96,_0x388f69);_0x1466ff(_0x388f69);});});}function respondWithStatusCode(_0x594a4a,_0x3c14ad){_0x3c14ad=_0x3c14ad||0xcc;return function(_0x502404){if(_0x502404){return _0x594a4a[_0xed78('0x27')](_0x3c14ad);}return _0x594a4a[_0xed78('0x28')](_0x3c14ad)[_0xed78('0x29')]();};}function respondWithResult(_0x2541b5,_0x23ace8){_0x23ace8=_0x23ace8||0xc8;return function(_0x538ff3){if(_0x538ff3){return _0x2541b5['status'](_0x23ace8)[_0xed78('0x2a')](_0x538ff3);}};}function respondWithFilteredResult(_0x2fa96f,_0x4d1744){return function(_0x2415dd){if(_0x2415dd){var _0x41617a=typeof _0x4d1744['offset']==='undefined'&&typeof _0x4d1744[_0xed78('0x2b')]===_0xed78('0x2c');var _0x2f2650=_0x2415dd['count'];var _0x58a124=_0x41617a?0x0:_0x4d1744[_0xed78('0x2d')];var _0x3e43c0=_0x41617a?_0x2415dd[_0xed78('0x2e')]:_0x4d1744[_0xed78('0x2d')]+_0x4d1744[_0xed78('0x2b')];var _0x1ad39d;if(_0x3e43c0>=_0x2f2650){_0x3e43c0=_0x2f2650;_0x1ad39d=0xc8;}else{_0x1ad39d=0xce;}_0x2fa96f[_0xed78('0x28')](_0x1ad39d);return _0x2fa96f['set']('Content-Range',_0x58a124+'-'+_0x3e43c0+'/'+_0x2f2650)[_0xed78('0x2a')](_0x2415dd);}return null;};}function patchUpdates(_0x26fc8d){return function(_0xb24255){try{jsonpatch[_0xed78('0x2f')](_0xb24255,_0x26fc8d,!![]);}catch(_0x3d2049){return BPromise[_0xed78('0x30')](_0x3d2049);}return _0xb24255[_0xed78('0x31')]();};}function saveUpdates(_0x51bf93,_0x6ef04d){return function(_0x2862e3){if(_0x2862e3){return _0x2862e3['update'](_0x51bf93)[_0xed78('0x1d')](function(_0x36428b){return _0x36428b;});}return null;};}function removeEntity(_0x133fb6,_0x551639){return function(_0x1b3e94){if(_0x1b3e94){return _0x1b3e94[_0xed78('0x32')]()[_0xed78('0x1d')](function(){_0x133fb6[_0xed78('0x28')](0xcc)[_0xed78('0x29')]();});}};}function handleEntityNotFound(_0x2a307b,_0x346ed0){return function(_0x411915){if(!_0x411915){_0x2a307b[_0xed78('0x27')](0x194);}return _0x411915;};}function handleError(_0x14db76,_0x5ab674){_0x5ab674=_0x5ab674||0x1f4;return function(_0x6e202b){logger[_0xed78('0x23')](_0x6e202b[_0xed78('0x33')]);if(_0x6e202b[_0xed78('0x34')]){delete _0x6e202b[_0xed78('0x34')];}_0x14db76[_0xed78('0x28')](_0x5ab674)[_0xed78('0x35')](_0x6e202b);};}exports[_0xed78('0x36')]=function(_0x1b5ca9,_0x330497){var _0x4fe648={},_0x20ca17={},_0x3affbc={'count':0x0,'rows':[]};var _0x29c43e=_['map'](db[_0xed78('0x37')]['rawAttributes'],function(_0xa4ec1f){return{'name':_0xa4ec1f['fieldName'],'type':_0xa4ec1f[_0xed78('0x38')][_0xed78('0x39')]};});_0x20ca17[_0xed78('0x3a')]=_['map'](_0x29c43e,'name');_0x20ca17[_0xed78('0x3b')]=_[_0xed78('0x3c')](_0x1b5ca9[_0xed78('0x3b')]);_0x20ca17[_0xed78('0x3d')]=_[_0xed78('0x3e')](_0x20ca17[_0xed78('0x3a')],_0x20ca17['query']);_0x4fe648['attributes']=_[_0xed78('0x3e')](_0x20ca17[_0xed78('0x3a')],qs['fields'](_0x1b5ca9[_0xed78('0x3b')]['fields']));_0x4fe648['attributes']=_0x4fe648[_0xed78('0x3f')]['length']?_0x4fe648[_0xed78('0x3f')]:_0x20ca17['model'];if(!_0x1b5ca9[_0xed78('0x3b')][_0xed78('0x40')](_0xed78('0x41'))){_0x4fe648[_0xed78('0x2b')]=qs[_0xed78('0x2b')](_0x1b5ca9[_0xed78('0x3b')][_0xed78('0x2b')]);_0x4fe648['offset']=qs['offset'](_0x1b5ca9[_0xed78('0x3b')]['offset']);}_0x4fe648[_0xed78('0x42')]=qs['sort'](_0x1b5ca9[_0xed78('0x3b')][_0xed78('0x43')]);_0x4fe648[_0xed78('0x44')]=qs[_0xed78('0x3d')](_['pick'](_0x1b5ca9[_0xed78('0x3b')],_0x20ca17[_0xed78('0x3d')]),_0x29c43e);if(_0x1b5ca9[_0xed78('0x3b')][_0xed78('0x45')]){_0x4fe648[_0xed78('0x44')]=_[_0xed78('0x46')](_0x4fe648[_0xed78('0x44')],{'$or':_[_0xed78('0x47')](_0x29c43e,function(_0x3ea0d1){if(_0x3ea0d1[_0xed78('0x38')]!=='VIRTUAL'){var _0x319ffd={};_0x319ffd[_0x3ea0d1[_0xed78('0x34')]]={'$like':'%'+_0x1b5ca9['query'][_0xed78('0x45')]+'%'};return _0x319ffd;}})});}_0x4fe648=_[_0xed78('0x46')]({},_0x4fe648,_0x1b5ca9['options']);var _0x78ce6a={'where':_0x4fe648['where']};return db['Network'][_0xed78('0x2e')](_0x78ce6a)[_0xed78('0x1d')](function(_0x3a2f66){_0x3affbc[_0xed78('0x2e')]=_0x3a2f66;if(_0x1b5ca9[_0xed78('0x3b')][_0xed78('0x48')]){_0x4fe648[_0xed78('0x49')]=[{'all':!![]}];}return db['Network'][_0xed78('0x4a')](_0x4fe648);})[_0xed78('0x1d')](function(_0x153a19){_0x3affbc[_0xed78('0x4b')]=_0x153a19;return _0x3affbc;})[_0xed78('0x1d')](respondWithFilteredResult(_0x330497,_0x4fe648))[_0xed78('0x26')](handleError(_0x330497,null));};exports[_0xed78('0x4c')]=function(_0x19ccb7,_0x264b73){var _0x44fbb3={'raw':!![],'where':{'id':_0x19ccb7['params']['id']}},_0x13954d={};_0x13954d[_0xed78('0x3a')]=_['keys'](db['Network']['rawAttributes']);_0x13954d['query']=_['keys'](_0x19ccb7['query']);_0x13954d['filters']=_[_0xed78('0x3e')](_0x13954d[_0xed78('0x3a')],_0x13954d[_0xed78('0x3b')]);_0x44fbb3[_0xed78('0x3f')]=_[_0xed78('0x3e')](_0x13954d[_0xed78('0x3a')],qs[_0xed78('0x4d')](_0x19ccb7[_0xed78('0x3b')][_0xed78('0x4d')]));_0x44fbb3[_0xed78('0x3f')]=_0x44fbb3[_0xed78('0x3f')][_0xed78('0x4e')]?_0x44fbb3[_0xed78('0x3f')]:_0x13954d[_0xed78('0x3a')];if(_0x19ccb7['query']['includeAll']){_0x44fbb3[_0xed78('0x49')]=[{'all':!![]}];}_0x44fbb3=_[_0xed78('0x46')]({},_0x44fbb3,_0x19ccb7[_0xed78('0x4f')]);return db['Network'][_0xed78('0x50')](_0x44fbb3)[_0xed78('0x1d')](handleEntityNotFound(_0x264b73,null))[_0xed78('0x1d')](respondWithResult(_0x264b73,null))[_0xed78('0x26')](handleError(_0x264b73,null));};exports['create']=function(_0x4e05cd,_0x4a1810,_0x345720){var _0x133624;return db[_0xed78('0x51')][_0xed78('0x52')](function(_0x4ac0ac){return db[_0xed78('0x37')][_0xed78('0x53')](_0x4e05cd[_0xed78('0x54')],{'raw':!![]})[_0xed78('0x1d')](function(_0x5d9945){_0x133624=_0x5d9945;return db[_0xed78('0x37')][_0xed78('0x4a')]({'where':{'type':_0x4e05cd[_0xed78('0x54')][_0xed78('0x38')]},'raw':!![]});})['then'](function(_0x50d2b1){if(_0x133624['type'][_0xed78('0x55')]()==_0xed78('0x56')){var _0x5db54b=fs['readFileSync'](path[_0xed78('0x57')](config[_0xed78('0x58')],'server/files/templates/stun_multiple.ejs'),_0xed78('0x59'));var _0x3e459f=ejs[_0xed78('0x5a')](_0x5db54b,{'networks':_0x50d2b1||[]});fs['writeFileSync'](_0xed78('0x5b'),_0x3e459f);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x53'),{'module':_0xed78('0x5d')});}else if(_0x133624['type'][_0xed78('0x55')]()==_0xed78('0x5e')){var _0x441534=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config[_0xed78('0x58')],_0xed78('0x60')),'utf8');var _0x27c869=ejs[_0xed78('0x5a')](_0x441534,{'networks':_0x50d2b1||[]});fs[_0xed78('0x61')](_0xed78('0x62'),_0x27c869);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x53'),{'module':_0xed78('0x5d')});}else{var _0x51b1e9=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config['root'],_0xed78('0x63')),_0xed78('0x59'));var _0x2928b9=ejs['render'](_0x51b1e9,{'networks':_0x50d2b1||[]});fs['writeFileSync'](util[_0xed78('0x64')](_0xed78('0x65'),_0x4e05cd['body']['type']['toLowerCase']()),_0x2928b9);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x53'),{'module':_0xed78('0x66')});}return null;})[_0xed78('0x1d')](function(){return _0x133624;});})[_0xed78('0x1d')](respondWithResult(_0x4a1810,0xc9))[_0xed78('0x26')](handleError(_0x4a1810,null));};exports[_0xed78('0x67')]=function(_0x53be8a,_0x47aa45,_0x40d35b){var _0x3a245e;return db['sequelize'][_0xed78('0x52')](function(_0x4cbb0f){return db[_0xed78('0x37')]['find']({'where':{'id':_0x53be8a[_0xed78('0x68')]['id']}})[_0xed78('0x1d')](handleEntityNotFound(_0x47aa45,null))[_0xed78('0x1d')](saveUpdates(_0x53be8a['body'],null))[_0xed78('0x1d')](function(_0x517c78){if(_0x517c78){_0x3a245e=_0x517c78;return db[_0xed78('0x37')][_0xed78('0x4a')]({'where':{'type':_0x3a245e[_0xed78('0x38')]},'raw':!![]});}return null;})['then'](function(_0x152c2e){if(_0x3a245e[_0xed78('0x38')][_0xed78('0x55')]()=='STUN'){var _0x75645c=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config['root'],_0xed78('0x69')),_0xed78('0x59'));var _0x3d903c=ejs[_0xed78('0x5a')](_0x75645c,{'networks':_0x152c2e||[]});fs[_0xed78('0x61')](_0xed78('0x5b'),_0x3d903c);return respondWithRpcPromise('Reload','update',{'module':_0xed78('0x5d')});}else if(_0x3a245e[_0xed78('0x38')]['toUpperCase']()==_0xed78('0x5e')){var _0x45b2a4=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config[_0xed78('0x58')],_0xed78('0x60')),_0xed78('0x59'));var _0x471f65=ejs[_0xed78('0x5a')](_0x45b2a4,{'networks':_0x152c2e||[]});fs[_0xed78('0x61')](_0xed78('0x62'),_0x471f65);return respondWithRpcPromise(_0xed78('0x5c'),'update',{'module':_0xed78('0x5d')});}else{var _0x3b4002=fs[_0xed78('0x5f')](path['join'](config[_0xed78('0x58')],_0xed78('0x63')),_0xed78('0x59'));var _0x1d9bb2=ejs[_0xed78('0x5a')](_0x3b4002,{'networks':_0x152c2e||[]});fs[_0xed78('0x61')](util[_0xed78('0x64')](_0xed78('0x65'),_0x53be8a['body'][_0xed78('0x38')]['toLowerCase']()),_0x1d9bb2);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x67'),{'module':_0xed78('0x66')});}return null;})[_0xed78('0x1d')](function(_0x5c2580){if(_0x5c2580){return _0x3a245e;}return null;});})['then'](respondWithResult(_0x47aa45,null))[_0xed78('0x26')](handleError(_0x47aa45,null));};exports[_0xed78('0x32')]=function(_0x11227c,_0xe8bdd9,_0x4d0e0f){var _0x16c578;return db[_0xed78('0x37')]['find']({'where':{'id':_0x11227c['params']['id']}})[_0xed78('0x1d')](function(_0x2f3600){_0x16c578=_0x2f3600;return _0x2f3600;})[_0xed78('0x1d')](handleEntityNotFound(_0xe8bdd9,null))['then'](removeEntity(_0xe8bdd9,null))[_0xed78('0x1d')](function(){if(_0x16c578){return db[_0xed78('0x37')]['findAll']({'where':{'type':_0x16c578['type']},'raw':!![]});}})[_0xed78('0x1d')](function(_0x3c92cc){if(_0x16c578[_0xed78('0x38')][_0xed78('0x55')]()==_0xed78('0x56')){var _0x2328d4=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config[_0xed78('0x58')],_0xed78('0x69')),_0xed78('0x59'));var _0x3fcc28=ejs[_0xed78('0x5a')](_0x2328d4,{'networks':_0x3c92cc||[]});fs[_0xed78('0x61')]('/etc/asterisk/stun_xcally.conf',_0x3fcc28);return respondWithRpcPromise('Reload','destroy',{'module':_0xed78('0x5d')});}else if(_0x16c578[_0xed78('0x38')][_0xed78('0x55')]()==_0xed78('0x5e')){var _0x31255c=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config[_0xed78('0x58')],_0xed78('0x60')),_0xed78('0x59'));var _0x90b003=ejs[_0xed78('0x5a')](_0x31255c,{'networks':_0x3c92cc||[]});fs['writeFileSync'](_0xed78('0x62'),_0x90b003);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x32'),{'module':'res_stun_monitor.so'});}else{var _0x4819a6=fs[_0xed78('0x5f')](path[_0xed78('0x57')](config['root'],_0xed78('0x63')),_0xed78('0x59'));var _0x41bfb5=ejs[_0xed78('0x5a')](_0x4819a6,{'networks':_0x3c92cc||[]});fs[_0xed78('0x61')](util['format'](_0xed78('0x65'),_0x11227c[_0xed78('0x54')][_0xed78('0x38')][_0xed78('0x6a')]()),_0x41bfb5);return respondWithRpcPromise(_0xed78('0x5c'),_0xed78('0x32'),{'module':_0xed78('0x66')});}return null;})[_0xed78('0x26')](handleError(_0xe8bdd9,null));}; \ No newline at end of file +var _0x5b8a=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','type','key','model','map','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Network','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','transaction','body','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','STUN','server/files/templates/stun_multiple.ejs'];(function(_0x3026fb,_0x4154d4){var _0x5cd212=function(_0x5474a2){while(--_0x5474a2){_0x3026fb['push'](_0x3026fb['shift']());}};_0x5cd212(++_0x4154d4);}(_0x5b8a,0x14d));var _0xa5b8=function(_0x1ffef0,_0x4f71f1){_0x1ffef0=_0x1ffef0-0x0;var _0x1434cd=_0x5b8a[_0x1ffef0];return _0x1434cd;};'use strict';var emlformat=require(_0xa5b8('0x0'));var rimraf=require(_0xa5b8('0x1'));var zipdir=require(_0xa5b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5b8('0x3'));var moment=require(_0xa5b8('0x4'));var BPromise=require(_0xa5b8('0x5'));var Mustache=require(_0xa5b8('0x6'));var util=require(_0xa5b8('0x7'));var path=require(_0xa5b8('0x8'));var sox=require(_0xa5b8('0x9'));var csv=require('to-csv');var ejs=require(_0xa5b8('0xa'));var fs=require('fs');var fs_extra=require(_0xa5b8('0xb'));var _=require(_0xa5b8('0xc'));var squel=require(_0xa5b8('0xd'));var crypto=require('crypto');var jsforce=require(_0xa5b8('0xe'));var deskjs=require(_0xa5b8('0xf'));var toCsv=require(_0xa5b8('0x10'));var querystring=require('querystring');var Papa=require(_0xa5b8('0x11'));var Redis=require('ioredis');var authService=require(_0xa5b8('0x12'));var qs=require(_0xa5b8('0x13'));var as=require(_0xa5b8('0x14'));var hardwareService=require(_0xa5b8('0x15'));var logger=require('../../config/logger')(_0xa5b8('0x16'));var utils=require(_0xa5b8('0x17'));var config=require(_0xa5b8('0x18'));var licenseUtil=require(_0xa5b8('0x19'));var db=require(_0xa5b8('0x1a'))['db'];var jayson=require(_0xa5b8('0x1b'));var client=jayson[_0xa5b8('0x1c')][_0xa5b8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x17db49,_0x254379,_0x212363,_0x551925){return new BPromise(function(_0x589e67,_0x168b4f){var _0x128765=_0x551925||client;return _0x128765[_0xa5b8('0x1e')](_0x17db49,_0x212363)[_0xa5b8('0x1f')](function(_0x469149){logger['info'](_0xa5b8('0x20'),_0x254379,_0xa5b8('0x21'));logger[_0xa5b8('0x22')](_0xa5b8('0x23'),_0x254379,_0xa5b8('0x21'),JSON[_0xa5b8('0x24')](_0x469149));if(_0x469149[_0xa5b8('0x25')]){if(_0x469149[_0xa5b8('0x25')][_0xa5b8('0x26')]===0x1f4){logger[_0xa5b8('0x25')](_0xa5b8('0x20'),_0x254379,_0x469149['error'][_0xa5b8('0x27')]);return _0x168b4f(_0x469149['error'][_0xa5b8('0x27')]);}logger[_0xa5b8('0x25')](_0xa5b8('0x20'),_0x254379,_0x469149[_0xa5b8('0x25')][_0xa5b8('0x27')]);return _0x589e67(_0x469149[_0xa5b8('0x25')]['message']);}else{logger[_0xa5b8('0x28')](_0xa5b8('0x20'),_0x254379,_0xa5b8('0x21'));_0x589e67(_0x469149['result'][_0xa5b8('0x27')]);}})[_0xa5b8('0x29')](function(_0x5c658c){logger['error']('Network,\x20%s,\x20%s',_0x254379,_0x5c658c);_0x168b4f(_0x5c658c);});});}function respondWithStatusCode(_0x26a4db,_0xf32250){_0xf32250=_0xf32250||0xcc;return function(_0x32222e){if(_0x32222e){return _0x26a4db[_0xa5b8('0x2a')](_0xf32250);}return _0x26a4db[_0xa5b8('0x2b')](_0xf32250)[_0xa5b8('0x2c')]();};}function respondWithResult(_0x13ee6e,_0x4546a1){_0x4546a1=_0x4546a1||0xc8;return function(_0xef3731){if(_0xef3731){return _0x13ee6e[_0xa5b8('0x2b')](_0x4546a1)['json'](_0xef3731);}};}function respondWithFilteredResult(_0x23924e,_0x30826c){return function(_0x13ff25){if(_0x13ff25){var _0x8158a6=typeof _0x30826c[_0xa5b8('0x2d')]===_0xa5b8('0x2e')&&typeof _0x30826c['limit']===_0xa5b8('0x2e');var _0x3dc432=_0x13ff25[_0xa5b8('0x2f')];var _0x2609f8=_0x8158a6?0x0:_0x30826c[_0xa5b8('0x2d')];var _0x2f11f7=_0x8158a6?_0x13ff25[_0xa5b8('0x2f')]:_0x30826c[_0xa5b8('0x2d')]+_0x30826c[_0xa5b8('0x30')];var _0x3dbc94;if(_0x2f11f7>=_0x3dc432){_0x2f11f7=_0x3dc432;_0x3dbc94=0xc8;}else{_0x3dbc94=0xce;}_0x23924e[_0xa5b8('0x2b')](_0x3dbc94);return _0x23924e[_0xa5b8('0x31')]('Content-Range',_0x2609f8+'-'+_0x2f11f7+'/'+_0x3dc432)[_0xa5b8('0x32')](_0x13ff25);}return null;};}function patchUpdates(_0x2ef2da){return function(_0x3e6c88){try{jsonpatch[_0xa5b8('0x33')](_0x3e6c88,_0x2ef2da,!![]);}catch(_0x4eab89){return BPromise[_0xa5b8('0x34')](_0x4eab89);}return _0x3e6c88[_0xa5b8('0x35')]();};}function saveUpdates(_0x13b150,_0x4e56fc){return function(_0x14c4b1){if(_0x14c4b1){return _0x14c4b1[_0xa5b8('0x36')](_0x13b150)[_0xa5b8('0x1f')](function(_0x218b37){return _0x218b37;});}return null;};}function removeEntity(_0x105925,_0x3bf589){return function(_0x53eca1){if(_0x53eca1){return _0x53eca1[_0xa5b8('0x37')]()[_0xa5b8('0x1f')](function(){_0x105925['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6b9f9,_0x59d3a3){return function(_0x545a0a){if(!_0x545a0a){_0xf6b9f9[_0xa5b8('0x2a')](0x194);}return _0x545a0a;};}function handleError(_0x34399c,_0x566dad){_0x566dad=_0x566dad||0x1f4;return function(_0x43fd44){logger[_0xa5b8('0x25')](_0x43fd44[_0xa5b8('0x38')]);if(_0x43fd44['name']){delete _0x43fd44[_0xa5b8('0x39')];}_0x34399c[_0xa5b8('0x2b')](_0x566dad)[_0xa5b8('0x3a')](_0x43fd44);};}exports[_0xa5b8('0x3b')]=function(_0x110dd7,_0x4fd84a){var _0xffe16a={},_0x2b1778={},_0x5c0736={'count':0x0,'rows':[]};var _0xdc06cd=_['map'](db['Network']['rawAttributes'],function(_0x4f6c93){return{'name':_0x4f6c93['fieldName'],'type':_0x4f6c93[_0xa5b8('0x3c')][_0xa5b8('0x3d')]};});_0x2b1778[_0xa5b8('0x3e')]=_[_0xa5b8('0x3f')](_0xdc06cd,_0xa5b8('0x39'));_0x2b1778['query']=_[_0xa5b8('0x40')](_0x110dd7[_0xa5b8('0x41')]);_0x2b1778[_0xa5b8('0x42')]=_['intersection'](_0x2b1778['model'],_0x2b1778[_0xa5b8('0x41')]);_0xffe16a[_0xa5b8('0x43')]=_[_0xa5b8('0x44')](_0x2b1778['model'],qs[_0xa5b8('0x45')](_0x110dd7[_0xa5b8('0x41')][_0xa5b8('0x45')]));_0xffe16a[_0xa5b8('0x43')]=_0xffe16a[_0xa5b8('0x43')]['length']?_0xffe16a['attributes']:_0x2b1778[_0xa5b8('0x3e')];if(!_0x110dd7['query']['hasOwnProperty'](_0xa5b8('0x46'))){_0xffe16a['limit']=qs['limit'](_0x110dd7[_0xa5b8('0x41')]['limit']);_0xffe16a['offset']=qs[_0xa5b8('0x2d')](_0x110dd7['query'][_0xa5b8('0x2d')]);}_0xffe16a[_0xa5b8('0x47')]=qs['sort'](_0x110dd7['query'][_0xa5b8('0x48')]);_0xffe16a[_0xa5b8('0x49')]=qs[_0xa5b8('0x42')](_[_0xa5b8('0x4a')](_0x110dd7[_0xa5b8('0x41')],_0x2b1778['filters']),_0xdc06cd);if(_0x110dd7[_0xa5b8('0x41')][_0xa5b8('0x4b')]){_0xffe16a['where']=_['merge'](_0xffe16a[_0xa5b8('0x49')],{'$or':_['map'](_0xdc06cd,function(_0x225eee){if(_0x225eee[_0xa5b8('0x3c')]!==_0xa5b8('0x4c')){var _0x111175={};_0x111175[_0x225eee['name']]={'$like':'%'+_0x110dd7[_0xa5b8('0x41')]['filter']+'%'};return _0x111175;}})});}_0xffe16a=_['merge']({},_0xffe16a,_0x110dd7[_0xa5b8('0x4d')]);var _0x50a365={'where':_0xffe16a[_0xa5b8('0x49')]};return db[_0xa5b8('0x4e')][_0xa5b8('0x2f')](_0x50a365)[_0xa5b8('0x1f')](function(_0x27c70b){_0x5c0736[_0xa5b8('0x2f')]=_0x27c70b;if(_0x110dd7[_0xa5b8('0x41')]['includeAll']){_0xffe16a[_0xa5b8('0x4f')]=[{'all':!![]}];}return db['Network'][_0xa5b8('0x50')](_0xffe16a);})[_0xa5b8('0x1f')](function(_0x370a8e){_0x5c0736[_0xa5b8('0x51')]=_0x370a8e;return _0x5c0736;})[_0xa5b8('0x1f')](respondWithFilteredResult(_0x4fd84a,_0xffe16a))['catch'](handleError(_0x4fd84a,null));};exports[_0xa5b8('0x52')]=function(_0x51f194,_0x432109){var _0x111aef={'raw':!![],'where':{'id':_0x51f194[_0xa5b8('0x53')]['id']}},_0x6b807={};_0x6b807['model']=_[_0xa5b8('0x40')](db[_0xa5b8('0x4e')][_0xa5b8('0x54')]);_0x6b807[_0xa5b8('0x41')]=_[_0xa5b8('0x40')](_0x51f194[_0xa5b8('0x41')]);_0x6b807[_0xa5b8('0x42')]=_['intersection'](_0x6b807[_0xa5b8('0x3e')],_0x6b807[_0xa5b8('0x41')]);_0x111aef['attributes']=_[_0xa5b8('0x44')](_0x6b807[_0xa5b8('0x3e')],qs[_0xa5b8('0x45')](_0x51f194[_0xa5b8('0x41')]['fields']));_0x111aef[_0xa5b8('0x43')]=_0x111aef[_0xa5b8('0x43')]['length']?_0x111aef[_0xa5b8('0x43')]:_0x6b807[_0xa5b8('0x3e')];if(_0x51f194[_0xa5b8('0x41')][_0xa5b8('0x55')]){_0x111aef[_0xa5b8('0x4f')]=[{'all':!![]}];}_0x111aef=_['merge']({},_0x111aef,_0x51f194[_0xa5b8('0x4d')]);return db[_0xa5b8('0x4e')][_0xa5b8('0x56')](_0x111aef)[_0xa5b8('0x1f')](handleEntityNotFound(_0x432109,null))[_0xa5b8('0x1f')](respondWithResult(_0x432109,null))[_0xa5b8('0x29')](handleError(_0x432109,null));};exports[_0xa5b8('0x57')]=function(_0x1d7a49,_0x5492b5,_0xbf7a20){var _0x2d8f98;return db['sequelize'][_0xa5b8('0x58')](function(_0x5231ee){return db[_0xa5b8('0x4e')][_0xa5b8('0x57')](_0x1d7a49[_0xa5b8('0x59')],{'raw':!![]})[_0xa5b8('0x1f')](function(_0x45fa6c){_0x2d8f98=_0x45fa6c;return db[_0xa5b8('0x4e')]['findAll']({'where':{'type':_0x1d7a49[_0xa5b8('0x59')]['type']},'raw':!![]});})[_0xa5b8('0x1f')](function(_0x9b0f3f){if(_0x2d8f98[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()=='STUN'){var _0x3679a9=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],'server/files/templates/stun_multiple.ejs'),_0xa5b8('0x5d'));var _0x5ec47c=ejs[_0xa5b8('0x5e')](_0x3679a9,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x60'),_0x5ec47c);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x57'),{'module':_0xa5b8('0x62')});}else if(_0x2d8f98[_0xa5b8('0x3c')]['toUpperCase']()==_0xa5b8('0x63')){var _0x4cdd86=fs[_0xa5b8('0x64')](path['join'](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),'utf8');var _0x30796c=ejs['render'](_0x4cdd86,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x30796c);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x57'),{'module':_0xa5b8('0x62')});}else{var _0x40ded8=fs[_0xa5b8('0x64')](path['join'](config['root'],_0xa5b8('0x67')),_0xa5b8('0x5d'));var _0x45114d=ejs[_0xa5b8('0x5e')](_0x40ded8,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x1d7a49[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x45114d);return respondWithRpcPromise('Reload',_0xa5b8('0x57'),{'module':_0xa5b8('0x6b')});}return null;})['then'](function(){return _0x2d8f98;});})[_0xa5b8('0x1f')](respondWithResult(_0x5492b5,0xc9))[_0xa5b8('0x29')](handleError(_0x5492b5,null));};exports[_0xa5b8('0x36')]=function(_0x391f30,_0x5d90b2,_0x3054ba){var _0x2f9628;return db[_0xa5b8('0x6c')]['transaction'](function(_0x58623f){return db[_0xa5b8('0x4e')][_0xa5b8('0x56')]({'where':{'id':_0x391f30[_0xa5b8('0x53')]['id']}})[_0xa5b8('0x1f')](handleEntityNotFound(_0x5d90b2,null))[_0xa5b8('0x1f')](saveUpdates(_0x391f30[_0xa5b8('0x59')],null))[_0xa5b8('0x1f')](function(_0x4c8e5e){if(_0x4c8e5e){_0x2f9628=_0x4c8e5e;return db[_0xa5b8('0x4e')]['findAll']({'where':{'type':_0x2f9628['type']},'raw':!![]});}return null;})[_0xa5b8('0x1f')](function(_0x5492f6){if(_0x2f9628[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()==_0xa5b8('0x6d')){var _0x5a9f9e=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x6e')),_0xa5b8('0x5d'));var _0x16af9e=ejs[_0xa5b8('0x5e')](_0x5a9f9e,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x60'),_0x16af9e);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x36'),{'module':_0xa5b8('0x62')});}else if(_0x2f9628[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()==_0xa5b8('0x63')){var _0x266de2=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),_0xa5b8('0x5d'));var _0x5c401d=ejs['render'](_0x266de2,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x5c401d);return respondWithRpcPromise(_0xa5b8('0x61'),'update',{'module':_0xa5b8('0x62')});}else{var _0x4b8f21=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x164ee6=ejs[_0xa5b8('0x5e')](_0x4b8f21,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x391f30[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x164ee6);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x36'),{'module':_0xa5b8('0x6b')});}return null;})[_0xa5b8('0x1f')](function(_0x2bae2c){if(_0x2bae2c){return _0x2f9628;}return null;});})[_0xa5b8('0x1f')](respondWithResult(_0x5d90b2,null))[_0xa5b8('0x29')](handleError(_0x5d90b2,null));};exports['destroy']=function(_0x1f2d00,_0x1593b4,_0x1bb596){var _0x2440c1;return db[_0xa5b8('0x4e')]['find']({'where':{'id':_0x1f2d00[_0xa5b8('0x53')]['id']}})[_0xa5b8('0x1f')](function(_0x4fdc0f){_0x2440c1=_0x4fdc0f;return _0x4fdc0f;})[_0xa5b8('0x1f')](handleEntityNotFound(_0x1593b4,null))[_0xa5b8('0x1f')](removeEntity(_0x1593b4,null))['then'](function(){if(_0x2440c1){return db[_0xa5b8('0x4e')][_0xa5b8('0x50')]({'where':{'type':_0x2440c1['type']},'raw':!![]});}})[_0xa5b8('0x1f')](function(_0x501917){if(_0x2440c1[_0xa5b8('0x3c')]['toUpperCase']()=='STUN'){var _0x5b6690=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x6e')),_0xa5b8('0x5d'));var _0x537b9a=ejs[_0xa5b8('0x5e')](_0x5b6690,{'networks':_0x501917||[]});fs['writeFileSync'](_0xa5b8('0x60'),_0x537b9a);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x37'),{'module':_0xa5b8('0x62')});}else if(_0x2440c1[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()=='TURN'){var _0x222224=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),_0xa5b8('0x5d'));var _0x40c493=ejs[_0xa5b8('0x5e')](_0x222224,{'networks':_0x501917||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x40c493);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x37'),{'module':_0xa5b8('0x62')});}else{var _0x498747=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x67')),_0xa5b8('0x5d'));var _0x3c7a8b=ejs[_0xa5b8('0x5e')](_0x498747,{'networks':_0x501917||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x1f2d00[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x3c7a8b);return respondWithRpcPromise(_0xa5b8('0x61'),'destroy',{'module':_0xa5b8('0x6b')});}return null;})[_0xa5b8('0x29')](handleError(_0x1593b4,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 11043d5..c08f549 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 _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x2b032f,_0x4757bd){var _0x4b46a4=function(_0x550cb1){while(--_0x550cb1){_0x2b032f['push'](_0x2b032f['shift']());}};_0x4b46a4(++_0x4757bd);}(_0xee5b,0x1f4));var _0xbee5=function(_0x41cc80,_0x3e84a0){_0x41cc80=_0x41cc80-0x0;var _0x4b3c19=_0xee5b[_0x41cc80];return _0x4b3c19;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a2ec2,_0x26533e){var _0x2c040c=function(_0x46769f){while(--_0x46769f){_0x1a2ec2['push'](_0x1a2ec2['shift']());}};_0x2c040c(++_0x26533e);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x2a864c,_0x16307b){_0x2a864c=_0x2a864c-0x0;var _0x1866a2=_0x7a2c[_0x2a864c];return _0x1866a2;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 9736ef0..37388ff 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x3d0afe,_0x582490){_0x3d0afe=_0x3d0afe-0x0;var _0x4fa33d=_0x7a54[_0x3d0afe];return _0x4fa33d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3eb559,_0x375066){_0x3eb559=_0x3eb559-0x0;var _0x2716ee=_0x7a54[_0x3eb559];return _0x2716ee;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 277a3ce..4e8fe4d 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 _0xf654=['getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','/:id/dispositions','addDisposition','post','/:id/notify','notify','addAgents','/:id/send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x19cc5d,_0x4f5cc4){var _0xd2c764=function(_0x2ef996){while(--_0x2ef996){_0x19cc5d['push'](_0x19cc5d['shift']());}};_0xd2c764(++_0x4f5cc4);}(_0xf654,0x101));var _0x4f65=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf654[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4f65('0x0'));var util=require(_0x4f65('0x1'));var path=require(_0x4f65('0x2'));var timeout=require(_0x4f65('0x3'));var express=require(_0x4f65('0x4'));var router=express[_0x4f65('0x5')]();var fs_extra=require(_0x4f65('0x6'));var auth=require(_0x4f65('0x7'));var interaction=require(_0x4f65('0x8'));var config=require(_0x4f65('0x9'));var controller=require('./openchannelAccount.controller');router[_0x4f65('0xa')]('/',auth[_0x4f65('0xb')](),controller[_0x4f65('0xc')]);router[_0x4f65('0xa')]('/describe',auth[_0x4f65('0xb')](),controller[_0x4f65('0xd')]);router['get'](_0x4f65('0xe'),auth[_0x4f65('0xb')](),controller[_0x4f65('0xf')]);router['get']('/:id/dispositions',auth[_0x4f65('0xb')](),controller[_0x4f65('0x10')]);router[_0x4f65('0xa')](_0x4f65('0x11'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x12')]);router[_0x4f65('0xa')](_0x4f65('0x13'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x14')]);router[_0x4f65('0xa')](_0x4f65('0x15'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x16')]);router[_0x4f65('0xa')](_0x4f65('0x17'),auth['isAuthenticated'](),controller[_0x4f65('0x18')]);router['post']('/',auth[_0x4f65('0xb')](),controller['create']);router['post'](_0x4f65('0x19'),auth['isAuthenticated'](),controller[_0x4f65('0x1a')]);router['post'](_0x4f65('0x11'),auth[_0x4f65('0xb')](),controller['addAnswer']);router[_0x4f65('0x1b')](_0x4f65('0x1c'),controller[_0x4f65('0x1d')]);router[_0x4f65('0x1b')]('/:id/applications',auth[_0x4f65('0xb')](),controller['addApplications']);router[_0x4f65('0x1b')](_0x4f65('0x17'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x1e')]);router[_0x4f65('0x1b')](_0x4f65('0x1f'),auth[_0x4f65('0xb')](),controller['send']);router[_0x4f65('0x20')](_0x4f65('0xe'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x21')]);router['delete'](_0x4f65('0xe'),auth[_0x4f65('0xb')](),controller['destroy']);router[_0x4f65('0x22')](_0x4f65('0x19'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x23')]);router['delete'](_0x4f65('0x11'),auth[_0x4f65('0xb')](),controller[_0x4f65('0x24')]);router[_0x4f65('0x22')](_0x4f65('0x17'),auth['isAuthenticated'](),controller[_0x4f65('0x25')]);module[_0x4f65('0x26')]=router; \ No newline at end of file +var _0x4db3=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAgents'];(function(_0x4087cc,_0x2b2f48){var _0x52874a=function(_0x563a4e){while(--_0x563a4e){_0x4087cc['push'](_0x4087cc['shift']());}};_0x52874a(++_0x2b2f48);}(_0x4db3,0x1b1));var _0x34db=function(_0x3c5013,_0x3e326a){_0x3c5013=_0x3c5013-0x0;var _0x28ccb1=_0x4db3[_0x3c5013];return _0x28ccb1;};'use strict';var multer=require(_0x34db('0x0'));var util=require(_0x34db('0x1'));var path=require(_0x34db('0x2'));var timeout=require(_0x34db('0x3'));var express=require('express');var router=express[_0x34db('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34db('0x5'));var config=require(_0x34db('0x6'));var controller=require('./openchannelAccount.controller');router[_0x34db('0x7')]('/',auth[_0x34db('0x8')](),controller[_0x34db('0x9')]);router[_0x34db('0x7')]('/describe',auth[_0x34db('0x8')](),controller[_0x34db('0xa')]);router['get'](_0x34db('0xb'),auth[_0x34db('0x8')](),controller[_0x34db('0xc')]);router[_0x34db('0x7')](_0x34db('0xd'),auth['isAuthenticated'](),controller[_0x34db('0xe')]);router['get'](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['getAnswers']);router[_0x34db('0x7')](_0x34db('0x10'),auth[_0x34db('0x8')](),controller[_0x34db('0x11')]);router[_0x34db('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x34db('0x12')]);router[_0x34db('0x7')](_0x34db('0x13'),auth[_0x34db('0x8')](),controller[_0x34db('0x14')]);router[_0x34db('0x15')]('/',auth['isAuthenticated'](),controller[_0x34db('0x16')]);router[_0x34db('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x34db('0x17')]);router[_0x34db('0x15')](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['addAnswer']);router['post'](_0x34db('0x18'),controller[_0x34db('0x19')]);router[_0x34db('0x15')]('/:id/applications',auth['isAuthenticated'](),controller[_0x34db('0x1a')]);router[_0x34db('0x15')](_0x34db('0x13'),auth['isAuthenticated'](),controller[_0x34db('0x1b')]);router[_0x34db('0x15')]('/:id/send',auth[_0x34db('0x8')](),controller[_0x34db('0x1c')]);router[_0x34db('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x34db('0x1e')]);router[_0x34db('0x1f')](_0x34db('0xb'),auth['isAuthenticated'](),controller[_0x34db('0x20')]);router[_0x34db('0x1f')]('/:id/dispositions',auth[_0x34db('0x8')](),controller[_0x34db('0x21')]);router[_0x34db('0x1f')](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['removeAnswers']);router[_0x34db('0x1f')]('/:id/users',auth[_0x34db('0x8')](),controller[_0x34db('0x22')]);module[_0x34db('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 7c7ea90..ecf9c5a 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 _0x6bbd=['setDataValue','mandatoryDispositionPauseId','sequelize','name','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x6bbd,0xc0));var _0xd6bb=function(_0x37b529,_0x6724e7){_0x37b529=_0x37b529-0x0;var _0x116152=_0x6bbd[_0x37b529];return _0x116152;};'use strict';var Sequelize=require(_0xd6bb('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd6bb('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xd6bb('0x2')]},'token':{'type':Sequelize[_0xd6bb('0x2')],'defaultValue':function(){return rs[_0xd6bb('0x3')]();}},'replyUri':{'type':Sequelize[_0xd6bb('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd6bb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd6bb('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd6bb('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6bb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd6bb('0x2')]},'queueTransfer':{'type':Sequelize[_0xd6bb('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd6bb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6bb('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd6bb('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a969b){if(!_0x5a969b)this[_0xd6bb('0x8')](_0xd6bb('0x9'),null);this[_0xd6bb('0x8')]('mandatoryDisposition',_0x5a969b);}}}; \ No newline at end of file +var _0xb86f=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb86f,0x141));var _0xfb86=function(_0x181030,_0x210b2f){_0x181030=_0x181030-0x0;var _0x458a57=_0xb86f[_0x181030];return _0x458a57;};'use strict';var Sequelize=require(_0xfb86('0x0'));var rs=require(_0xfb86('0x1'));module['exports']={'name':{'type':Sequelize[_0xfb86('0x2')],'unique':_0xfb86('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xfb86('0x2')],'defaultValue':function(){return rs[_0xfb86('0x4')]();}},'replyUri':{'type':Sequelize[_0xfb86('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfb86('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb86('0x5')],'defaultValue':function(){return _0xfb86('0x6');}},'notificationSound':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfb86('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb86('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb86('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xfb86('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':![],'comment':_0xfb86('0xa'),'set':function(_0x468abd){if(!_0x468abd)this[_0xfb86('0xb')](_0xfb86('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x468abd);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index dc4e4d8..6253e3f 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 _0x5d9e=['set','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','rows','show','keys','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','getDispositions','Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmContact','Contacts','DESC','OpenchannelApplication','List','applications','list','orderBy','priority','asc','account','Applications','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','internal','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','CmList','dataValues','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4b809b,_0x5de1c6){var _0x338f37=function(_0x189771){while(--_0x189771){_0x4b809b['push'](_0x4b809b['shift']());}};_0x338f37(++_0x5de1c6);}(_0x5d9e,0x13f));var _0xe5d9=function(_0xa43998,_0x2d117c){_0xa43998=_0xa43998-0x0;var _0x7c6f41=_0x5d9e[_0xa43998];return _0x7c6f41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5d9('0x0'));var zipdir=require(_0xe5d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5d9('0x2'));var moment=require('moment');var BPromise=require(_0xe5d9('0x3'));var Mustache=require('mustache');var util=require(_0xe5d9('0x4'));var path=require(_0xe5d9('0x5'));var sox=require('sox');var csv=require(_0xe5d9('0x6'));var ejs=require(_0xe5d9('0x7'));var fs=require('fs');var fs_extra=require(_0xe5d9('0x8'));var _=require('lodash');var squel=require(_0xe5d9('0x9'));var crypto=require(_0xe5d9('0xa'));var jsforce=require(_0xe5d9('0xb'));var deskjs=require(_0xe5d9('0xc'));var toCsv=require(_0xe5d9('0x6'));var querystring=require(_0xe5d9('0xd'));var Papa=require(_0xe5d9('0xe'));var Redis=require('ioredis');var authService=require(_0xe5d9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe5d9('0x10'));var hardwareService=require(_0xe5d9('0x11'));var logger=require(_0xe5d9('0x12'))(_0xe5d9('0x13'));var utils=require(_0xe5d9('0x14'));var config=require(_0xe5d9('0x15'));var licenseUtil=require(_0xe5d9('0x16'));var db=require(_0xe5d9('0x17'))['db'];config[_0xe5d9('0x18')]=_[_0xe5d9('0x19')](config[_0xe5d9('0x18')],{'host':_0xe5d9('0x1a'),'port':0x18eb});var socket=require(_0xe5d9('0x1b'))(new Redis(config['redis']));require(_0xe5d9('0x1c'))[_0xe5d9('0x1d')](socket);var jayson=require(_0xe5d9('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe5d9('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e35d2,_0x5474a3,_0x46c0c1,_0x55e77f){return new BPromise(function(_0x1220a1,_0x51947c){var _0x55c1ea=_0x55e77f||client;return _0x55c1ea[_0xe5d9('0x20')](_0x4e35d2,_0x46c0c1)[_0xe5d9('0x21')](function(_0x3d7d3d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5474a3,_0xe5d9('0x22'));logger[_0xe5d9('0x23')](_0xe5d9('0x24'),_0x5474a3,_0xe5d9('0x22'),JSON[_0xe5d9('0x25')](_0x3d7d3d));if(_0x3d7d3d[_0xe5d9('0x26')]){if(_0x3d7d3d[_0xe5d9('0x26')][_0xe5d9('0x27')]===0x1f4){logger[_0xe5d9('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5474a3,_0x3d7d3d[_0xe5d9('0x26')][_0xe5d9('0x28')]);return _0x51947c(_0x3d7d3d[_0xe5d9('0x26')][_0xe5d9('0x28')]);}logger[_0xe5d9('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5474a3,_0x3d7d3d[_0xe5d9('0x26')][_0xe5d9('0x28')]);return _0x1220a1(_0x3d7d3d[_0xe5d9('0x26')][_0xe5d9('0x28')]);}else{logger[_0xe5d9('0x29')](_0xe5d9('0x2a'),_0x5474a3,_0xe5d9('0x22'));_0x1220a1(_0x3d7d3d[_0xe5d9('0x2b')][_0xe5d9('0x28')]);}})[_0xe5d9('0x2c')](function(_0x3b16bf){logger[_0xe5d9('0x26')](_0xe5d9('0x2a'),_0x5474a3,_0x3b16bf);_0x51947c(_0x3b16bf);});});}function respondWithStatusCode(_0x274604,_0x5e888a){_0x5e888a=_0x5e888a||0xcc;return function(_0x5c5ad5){if(_0x5c5ad5){return _0x274604[_0xe5d9('0x2d')](_0x5e888a);}return _0x274604[_0xe5d9('0x2e')](_0x5e888a)[_0xe5d9('0x2f')]();};}function respondWithResult(_0x1681d1,_0xb4f0da){_0xb4f0da=_0xb4f0da||0xc8;return function(_0x61bf2c){if(_0x61bf2c){return _0x1681d1['status'](_0xb4f0da)[_0xe5d9('0x30')](_0x61bf2c);}};}function respondWithFilteredResult(_0xa5df4e,_0x18fc2c){return function(_0x2c2d14){if(_0x2c2d14){var _0x3bc000=typeof _0x18fc2c[_0xe5d9('0x31')]===_0xe5d9('0x32')&&typeof _0x18fc2c['limit']===_0xe5d9('0x32');var _0x191cf9=_0x2c2d14[_0xe5d9('0x33')];var _0xb1c190=_0x3bc000?0x0:_0x18fc2c[_0xe5d9('0x31')];var _0x19b5d0=_0x3bc000?_0x2c2d14[_0xe5d9('0x33')]:_0x18fc2c['offset']+_0x18fc2c[_0xe5d9('0x34')];var _0xe449f8;if(_0x19b5d0>=_0x191cf9){_0x19b5d0=_0x191cf9;_0xe449f8=0xc8;}else{_0xe449f8=0xce;}_0xa5df4e[_0xe5d9('0x2e')](_0xe449f8);return _0xa5df4e[_0xe5d9('0x35')]('Content-Range',_0xb1c190+'-'+_0x19b5d0+'/'+_0x191cf9)[_0xe5d9('0x30')](_0x2c2d14);}return null;};}function patchUpdates(_0xb0581){return function(_0x2a0373){try{jsonpatch['apply'](_0x2a0373,_0xb0581,!![]);}catch(_0x573d05){return BPromise[_0xe5d9('0x36')](_0x573d05);}return _0x2a0373[_0xe5d9('0x37')]();};}function saveUpdates(_0x1009c9,_0x290529){return function(_0x4bac62){if(_0x4bac62){return _0x4bac62[_0xe5d9('0x38')](_0x1009c9)[_0xe5d9('0x21')](function(_0x5d92f4){return _0x5d92f4;});}return null;};}function removeEntity(_0x19e875,_0x211ed8){return function(_0x4a80c8){if(_0x4a80c8){return _0x4a80c8[_0xe5d9('0x39')]()['then'](function(){var _0x33f08a=_0x4a80c8[_0xe5d9('0x3a')]({'plain':!![]});var _0x4642fa=_0xe5d9('0x3b');return db[_0xe5d9('0x3c')][_0xe5d9('0x39')]({'where':{'type':_0x4642fa,'resourceId':_0x33f08a['id']}})[_0xe5d9('0x21')](function(){return _0x4a80c8;});})[_0xe5d9('0x21')](function(){_0x19e875[_0xe5d9('0x2e')](0xcc)[_0xe5d9('0x2f')]();});}};}function handleEntityNotFound(_0x544c2e,_0x5e0563){return function(_0x3ebc13){if(!_0x3ebc13){_0x544c2e['sendStatus'](0x194);}return _0x3ebc13;};}function handleError(_0x5868c1,_0x3b572b){_0x3b572b=_0x3b572b||0x1f4;return function(_0x46dd76){logger[_0xe5d9('0x26')](_0x46dd76[_0xe5d9('0x3d')]);if(_0x46dd76['name']){delete _0x46dd76[_0xe5d9('0x3e')];}_0x5868c1[_0xe5d9('0x2e')](_0x3b572b)[_0xe5d9('0x3f')](_0x46dd76);};}exports['index']=function(_0x2fd991,_0x4547c9){var _0x23dbd7={'include':[{'model':db[_0xe5d9('0x40')],'as':_0xe5d9('0x41')}]},_0x5c09eb={},_0x25de43={'count':0x0,'rows':[]};var _0x42194a=_[_0xe5d9('0x42')](db[_0xe5d9('0x43')][_0xe5d9('0x44')],function(_0x2703d4){return{'name':_0x2703d4[_0xe5d9('0x45')],'type':_0x2703d4['type'][_0xe5d9('0x46')]};});_0x5c09eb[_0xe5d9('0x47')]=_[_0xe5d9('0x42')](_0x42194a,_0xe5d9('0x3e'));_0x5c09eb[_0xe5d9('0x48')]=_['keys'](_0x2fd991[_0xe5d9('0x48')]);_0x5c09eb[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0x5c09eb[_0xe5d9('0x47')],_0x5c09eb[_0xe5d9('0x48')]);_0x23dbd7[_0xe5d9('0x4b')]=_[_0xe5d9('0x4a')](_0x5c09eb[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x2fd991['query'][_0xe5d9('0x4c')]));_0x23dbd7[_0xe5d9('0x4b')]=_0x23dbd7[_0xe5d9('0x4b')]['length']?_0x23dbd7['attributes']:_0x5c09eb[_0xe5d9('0x47')];if(!_0x2fd991[_0xe5d9('0x48')][_0xe5d9('0x4d')]('nolimit')){_0x23dbd7[_0xe5d9('0x34')]=qs[_0xe5d9('0x34')](_0x2fd991['query'][_0xe5d9('0x34')]);_0x23dbd7[_0xe5d9('0x31')]=qs[_0xe5d9('0x31')](_0x2fd991['query'][_0xe5d9('0x31')]);}_0x23dbd7[_0xe5d9('0x4e')]=qs[_0xe5d9('0x4f')](_0x2fd991['query'][_0xe5d9('0x4f')]);_0x23dbd7['where']=qs[_0xe5d9('0x49')](_[_0xe5d9('0x50')](_0x2fd991[_0xe5d9('0x48')],_0x5c09eb[_0xe5d9('0x49')]),_0x42194a);if(_0x2fd991['query'][_0xe5d9('0x51')]){_0x23dbd7['where']=_[_0xe5d9('0x52')](_0x23dbd7[_0xe5d9('0x53')],{'$or':_[_0xe5d9('0x42')](_0x42194a,function(_0x1a9f72){if(_0x1a9f72[_0xe5d9('0x54')]!==_0xe5d9('0x55')){var _0x23ab60={};_0x23ab60[_0x1a9f72['name']]={'$like':'%'+_0x2fd991[_0xe5d9('0x48')][_0xe5d9('0x51')]+'%'};return _0x23ab60;}})});}_0x23dbd7=_['merge']({},_0x23dbd7,_0x2fd991[_0xe5d9('0x56')]);var _0x506ed2={'where':_0x23dbd7[_0xe5d9('0x53')]};return db['OpenchannelAccount']['count'](_0x506ed2)[_0xe5d9('0x21')](function(_0x34b168){_0x25de43[_0xe5d9('0x33')]=_0x34b168;if(_0x2fd991[_0xe5d9('0x48')][_0xe5d9('0x57')]){_0x23dbd7['include']=[{'all':!![]}];}return db[_0xe5d9('0x43')]['findAll'](_0x23dbd7);})[_0xe5d9('0x21')](function(_0x5abca6){_0x25de43[_0xe5d9('0x58')]=_0x5abca6;return _0x25de43;})[_0xe5d9('0x21')](respondWithFilteredResult(_0x4547c9,_0x23dbd7))['catch'](handleError(_0x4547c9,null));};exports[_0xe5d9('0x59')]=function(_0x511687,_0x44831d){var _0x3a12e1={'raw':![],'where':{'id':_0x511687['params']['id']},'include':[{'model':db[_0xe5d9('0x40')],'as':_0xe5d9('0x41')}]},_0x369594={};_0x369594[_0xe5d9('0x47')]=_[_0xe5d9('0x5a')](db['OpenchannelAccount'][_0xe5d9('0x44')]);_0x369594['query']=_['keys'](_0x511687[_0xe5d9('0x48')]);_0x369594[_0xe5d9('0x49')]=_['intersection'](_0x369594[_0xe5d9('0x47')],_0x369594[_0xe5d9('0x48')]);_0x3a12e1['attributes']=_['intersection'](_0x369594['model'],qs[_0xe5d9('0x4c')](_0x511687['query'][_0xe5d9('0x4c')]));_0x3a12e1[_0xe5d9('0x4b')]=_0x3a12e1[_0xe5d9('0x4b')][_0xe5d9('0x5b')]?_0x3a12e1['attributes']:_0x369594[_0xe5d9('0x47')];if(_0x511687[_0xe5d9('0x48')]['includeAll']){_0x3a12e1[_0xe5d9('0x5c')]=[{'all':!![]}];}_0x3a12e1=_[_0xe5d9('0x52')]({},_0x3a12e1,_0x511687[_0xe5d9('0x56')]);return db['OpenchannelAccount']['find'](_0x3a12e1)[_0xe5d9('0x21')](handleEntityNotFound(_0x44831d,null))[_0xe5d9('0x21')](respondWithResult(_0x44831d,null))[_0xe5d9('0x2c')](handleError(_0x44831d,null));};exports[_0xe5d9('0x5d')]=function(_0x21e9db,_0x2d791a){return db[_0xe5d9('0x43')][_0xe5d9('0x5d')](_0x21e9db[_0xe5d9('0x5e')],{})['then'](function(_0x1ab712){var _0x48dfec=_0x21e9db[_0xe5d9('0x5f')][_0xe5d9('0x3a')]({'plain':!![]});if(!_0x48dfec)throw new Error(_0xe5d9('0x60'));if(_0x48dfec[_0xe5d9('0x61')]==='user'){var _0x14065f=_0x1ab712[_0xe5d9('0x3a')]({'plain':!![]});var _0x414a38=_0xe5d9('0x3b');return db['UserProfileSection'][_0xe5d9('0x62')]({'where':{'name':_0x414a38,'userProfileId':_0x48dfec[_0xe5d9('0x63')]},'raw':!![]})[_0xe5d9('0x21')](function(_0x502af0){if(_0x502af0&&_0x502af0[_0xe5d9('0x64')]===0x0){return db[_0xe5d9('0x3c')][_0xe5d9('0x5d')]({'name':_0x14065f[_0xe5d9('0x3e')],'resourceId':_0x14065f['id'],'type':_0x502af0[_0xe5d9('0x3e')],'sectionId':_0x502af0['id']},{})[_0xe5d9('0x21')](function(){return _0x1ab712;});}else{return _0x1ab712;}})[_0xe5d9('0x2c')](function(_0x5e2f2a){logger['error'](_0xe5d9('0x65'),_0x5e2f2a);throw _0x5e2f2a;});}return _0x1ab712;})[_0xe5d9('0x21')](respondWithResult(_0x2d791a,0xc9))[_0xe5d9('0x2c')](handleError(_0x2d791a,null));};exports['update']=function(_0x18706d,_0x2131f1){if(_0x18706d[_0xe5d9('0x5e')]['id']){delete _0x18706d[_0xe5d9('0x5e')]['id'];}return db[_0xe5d9('0x43')][_0xe5d9('0x62')]({'where':{'id':_0x18706d[_0xe5d9('0x66')]['id']},'include':[{'model':db['Pause'],'as':_0xe5d9('0x41')}]})[_0xe5d9('0x21')](handleEntityNotFound(_0x2131f1,null))['then'](saveUpdates(_0x18706d[_0xe5d9('0x5e')],null))[_0xe5d9('0x21')](respondWithResult(_0x2131f1,null))[_0xe5d9('0x2c')](handleError(_0x2131f1,null));};exports[_0xe5d9('0x39')]=function(_0x53966c,_0x4e75ca){return db[_0xe5d9('0x43')][_0xe5d9('0x62')]({'where':{'id':_0x53966c['params']['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x4e75ca,null))['then'](removeEntity(_0x4e75ca,null))[_0xe5d9('0x2c')](handleError(_0x4e75ca,null));};exports[_0xe5d9('0x67')]=function(_0x185391,_0x33eeb9){return db[_0xe5d9('0x43')][_0xe5d9('0x67')]()['then'](respondWithResult(_0x33eeb9,null))['catch'](handleError(_0x33eeb9,null));};exports['addDisposition']=function(_0x10680f,_0x483ae7,_0x468570){if(_0x10680f[_0xe5d9('0x5e')]['id']){delete _0x10680f['body']['id'];}return db[_0xe5d9('0x43')][_0xe5d9('0x62')]({'where':{'id':_0x10680f[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x483ae7,null))['then'](function(_0x1ad5a0){if(_0x1ad5a0){_0x10680f[_0xe5d9('0x5e')][_0xe5d9('0x68')]=_0x1ad5a0['id'];return db['Disposition'][_0xe5d9('0x5d')](_0x10680f[_0xe5d9('0x5e')]);}})[_0xe5d9('0x21')](respondWithResult(_0x483ae7,null))[_0xe5d9('0x2c')](handleError(_0x483ae7,null));};exports[_0xe5d9('0x69')]=function(_0x917b1d,_0x104ae8,_0x220330){var _0x1f1ef0={'raw':![],'where':{}};var _0x556bbf={};var _0x3d7801={'count':0x0,'rows':[]};return db[_0xe5d9('0x43')]['findOne']({'where':{'id':_0x917b1d[_0xe5d9('0x66')]['id']}})['then'](handleEntityNotFound(_0x104ae8,null))[_0xe5d9('0x21')](function(_0x4ad5d5){if(_0x4ad5d5){_0x556bbf[_0xe5d9('0x47')]=_['keys'](db[_0xe5d9('0x6a')][_0xe5d9('0x44')]);_0x556bbf[_0xe5d9('0x48')]=_[_0xe5d9('0x5a')](_0x917b1d[_0xe5d9('0x48')]);_0x556bbf[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0x556bbf[_0xe5d9('0x47')],_0x556bbf['query']);_0x1f1ef0[_0xe5d9('0x4b')]=_[_0xe5d9('0x4a')](_0x556bbf[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x917b1d[_0xe5d9('0x48')]['fields']));_0x1f1ef0[_0xe5d9('0x4b')]=_0x1f1ef0[_0xe5d9('0x4b')][_0xe5d9('0x5b')]?_0x1f1ef0[_0xe5d9('0x4b')]:_0x556bbf['model'];if(!_0x917b1d[_0xe5d9('0x48')][_0xe5d9('0x4d')](_0xe5d9('0x6b'))){_0x1f1ef0['limit']=qs['limit'](_0x917b1d[_0xe5d9('0x48')][_0xe5d9('0x34')]);_0x1f1ef0[_0xe5d9('0x31')]=qs[_0xe5d9('0x31')](_0x917b1d[_0xe5d9('0x48')]['offset']);}_0x1f1ef0[_0xe5d9('0x4e')]=qs[_0xe5d9('0x4f')](_0x917b1d[_0xe5d9('0x48')]['sort']);_0x1f1ef0[_0xe5d9('0x53')]=qs[_0xe5d9('0x49')](_[_0xe5d9('0x50')](_0x917b1d[_0xe5d9('0x48')],_0x556bbf[_0xe5d9('0x49')]));_0x1f1ef0[_0xe5d9('0x53')][_0xe5d9('0x68')]=_0x4ad5d5['id'];if(_0x917b1d[_0xe5d9('0x48')][_0xe5d9('0x51')]){_0x1f1ef0['where']=_[_0xe5d9('0x52')](_0x1f1ef0[_0xe5d9('0x53')],{'$or':_[_0xe5d9('0x42')](_0x1f1ef0[_0xe5d9('0x4b')],function(_0x4c8bca){var _0x39fe2b={};_0x39fe2b[_0x4c8bca]={'$like':'%'+_0x917b1d[_0xe5d9('0x48')]['filter']+'%'};return _0x39fe2b;})});}_0x1f1ef0=_[_0xe5d9('0x52')]({},_0x1f1ef0,_0x917b1d[_0xe5d9('0x56')]);return db[_0xe5d9('0x6a')][_0xe5d9('0x33')]({'where':_0x1f1ef0[_0xe5d9('0x53')]})['then'](function(_0x5c0b76){_0x3d7801[_0xe5d9('0x33')]=_0x5c0b76;if(_0x917b1d[_0xe5d9('0x48')][_0xe5d9('0x57')]){_0x1f1ef0[_0xe5d9('0x5c')]=[{'all':!![]}];}return db[_0xe5d9('0x6a')]['findAll'](_0x1f1ef0);})[_0xe5d9('0x21')](function(_0x369db9){_0x3d7801[_0xe5d9('0x58')]=_0x369db9;return _0x3d7801;});}})[_0xe5d9('0x21')](respondWithFilteredResult(_0x104ae8,_0x1f1ef0))['catch'](handleError(_0x104ae8,null));};exports[_0xe5d9('0x6c')]=function(_0x54dee1,_0x2a8fce,_0x248983){return db[_0xe5d9('0x43')]['find']({'where':{'id':_0x54dee1['params']['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x2a8fce,null))[_0xe5d9('0x21')](function(_0x15fb89){if(_0x15fb89){return _0x15fb89[_0xe5d9('0x6c')](_0x54dee1['query'][_0xe5d9('0x6d')]);}})[_0xe5d9('0x21')](respondWithStatusCode(_0x2a8fce,null))[_0xe5d9('0x2c')](handleError(_0x2a8fce,null));};exports[_0xe5d9('0x6e')]=function(_0x381238,_0x4e39f1,_0x1c6d70){if(_0x381238['body']['id']){delete _0x381238[_0xe5d9('0x5e')]['id'];}return db['OpenchannelAccount'][_0xe5d9('0x62')]({'where':{'id':_0x381238[_0xe5d9('0x66')]['id']}})['then'](handleEntityNotFound(_0x4e39f1,null))[_0xe5d9('0x21')](function(_0x14d1f2){if(_0x14d1f2){_0x381238[_0xe5d9('0x5e')][_0xe5d9('0x68')]=_0x14d1f2['id'];return db[_0xe5d9('0x6f')][_0xe5d9('0x5d')](_0x381238['body']);}})[_0xe5d9('0x21')](respondWithResult(_0x4e39f1,null))[_0xe5d9('0x2c')](handleError(_0x4e39f1,null));};exports[_0xe5d9('0x70')]=function(_0x3573b6,_0x342bea,_0x26b02b){var _0x13e81f={'raw':![],'where':{}};var _0x200a9e={};var _0x16a892={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe5d9('0x71')]({'where':{'id':_0x3573b6[_0xe5d9('0x66')]['id']}})['then'](handleEntityNotFound(_0x342bea,null))['then'](function(_0x30488e){if(_0x30488e){_0x200a9e[_0xe5d9('0x47')]=_[_0xe5d9('0x5a')](db[_0xe5d9('0x6f')]['rawAttributes']);_0x200a9e['query']=_['keys'](_0x3573b6[_0xe5d9('0x48')]);_0x200a9e[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0x200a9e[_0xe5d9('0x47')],_0x200a9e[_0xe5d9('0x48')]);_0x13e81f[_0xe5d9('0x4b')]=_[_0xe5d9('0x4a')](_0x200a9e[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x3573b6[_0xe5d9('0x48')][_0xe5d9('0x4c')]));_0x13e81f['attributes']=_0x13e81f[_0xe5d9('0x4b')][_0xe5d9('0x5b')]?_0x13e81f[_0xe5d9('0x4b')]:_0x200a9e[_0xe5d9('0x47')];if(!_0x3573b6[_0xe5d9('0x48')]['hasOwnProperty'](_0xe5d9('0x6b'))){_0x13e81f[_0xe5d9('0x34')]=qs[_0xe5d9('0x34')](_0x3573b6['query']['limit']);_0x13e81f[_0xe5d9('0x31')]=qs[_0xe5d9('0x31')](_0x3573b6[_0xe5d9('0x48')][_0xe5d9('0x31')]);}_0x13e81f['order']=qs[_0xe5d9('0x4f')](_0x3573b6[_0xe5d9('0x48')][_0xe5d9('0x4f')]);_0x13e81f[_0xe5d9('0x53')]=qs[_0xe5d9('0x49')](_[_0xe5d9('0x50')](_0x3573b6['query'],_0x200a9e[_0xe5d9('0x49')]));_0x13e81f[_0xe5d9('0x53')][_0xe5d9('0x68')]=_0x30488e['id'];if(_0x3573b6[_0xe5d9('0x48')][_0xe5d9('0x51')]){_0x13e81f[_0xe5d9('0x53')]=_[_0xe5d9('0x52')](_0x13e81f['where'],{'$or':_[_0xe5d9('0x42')](_0x13e81f[_0xe5d9('0x4b')],function(_0x115cbc){var _0x5d35ff={};_0x5d35ff[_0x115cbc]={'$like':'%'+_0x3573b6['query'][_0xe5d9('0x51')]+'%'};return _0x5d35ff;})});}_0x13e81f=_['merge']({},_0x13e81f,_0x3573b6['options']);return db['CannedAnswer']['count']({'where':_0x13e81f['where']})[_0xe5d9('0x21')](function(_0xa7007a){_0x16a892[_0xe5d9('0x33')]=_0xa7007a;if(_0x3573b6[_0xe5d9('0x48')][_0xe5d9('0x57')]){_0x13e81f[_0xe5d9('0x5c')]=[{'all':!![]}];}return db[_0xe5d9('0x6f')][_0xe5d9('0x72')](_0x13e81f);})[_0xe5d9('0x21')](function(_0x48449b){_0x16a892[_0xe5d9('0x58')]=_0x48449b;return _0x16a892;});}})[_0xe5d9('0x21')](respondWithFilteredResult(_0x342bea,_0x13e81f))[_0xe5d9('0x2c')](handleError(_0x342bea,null));};exports['removeAnswers']=function(_0x1b21a3,_0x58425c,_0x5e9676){return db[_0xe5d9('0x43')]['find']({'where':{'id':_0x1b21a3[_0xe5d9('0x66')]['id']}})['then'](handleEntityNotFound(_0x58425c,null))[_0xe5d9('0x21')](function(_0x203b24){if(_0x203b24){return _0x203b24[_0xe5d9('0x73')](_0x1b21a3['query']['ids']);}})[_0xe5d9('0x21')](respondWithStatusCode(_0x58425c,null))[_0xe5d9('0x2c')](handleError(_0x58425c,null));};exports[_0xe5d9('0x74')]=function(_0x5a06d4,_0x3e65b9,_0x2a1c2a){var _0x9a5f4d={'body':_0x5a06d4[_0xe5d9('0x5e')],'channel':_0xe5d9('0x75')};var _0xf06f98=[];var _0xb8dd1d=[];var _0x207110={};var _0x3752a8=![];return db['CmContact'][_0xe5d9('0x67')]()[_0xe5d9('0x21')](function(_0x4617c){if(!_0x4617c){throw new db[(_0xe5d9('0x76'))][(_0xe5d9('0x77'))](_0xe5d9('0x78'));}_0xf06f98=_[_0xe5d9('0x79')](_['keys'](_0x4617c),[_0xe5d9('0x7a'),'updatedAt']);_0xb8dd1d=_[_0xe5d9('0x79')](_[_0xe5d9('0x5a')](_0x4617c),[_0xe5d9('0x7a'),_0xe5d9('0x7b'),'CompanyId',_0xe5d9('0x7c')]);if(_0x5a06d4[_0xe5d9('0x5e')]['id']){delete _0x5a06d4[_0xe5d9('0x5e')]['id'];}if(_[_0xe5d9('0x7d')](_0x5a06d4['body']['from'])){throw new db['Sequelize'][(_0xe5d9('0x77'))]('from\x20is\x20mandatory');}if(_[_0xe5d9('0x7d')](_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x5e')])||_0x5a06d4['body'][_0xe5d9('0x5e')]===''){throw new db['Sequelize']['ValidationError'](_0xe5d9('0x7e'));}if(_['isNil'](_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x7f')])){throw new db['Sequelize']['ValidationError'](_0xe5d9('0x80')+_0xb8dd1d);}if(!_[_0xe5d9('0x81')](_0xb8dd1d,_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x7f')])){throw new db['Sequelize'][(_0xe5d9('0x77'))](_0xe5d9('0x82')+_0xb8dd1d);}_0x207110[_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x7f')]]=_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x83')];})[_0xe5d9('0x21')](function(){return db[_0xe5d9('0x43')][_0xe5d9('0x62')]({'where':{'id':_0x5a06d4[_0xe5d9('0x66')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xe5d9('0x84')],'as':_0xe5d9('0x85'),'where':_0x207110,'limit':0x1,'order':[[_0xe5d9('0x7b'),_0xe5d9('0x86')]]}]},{'model':db[_0xe5d9('0x87')],'as':'Applications'}]});})[_0xe5d9('0x21')](handleEntityNotFound(_0x3e65b9,null))[_0xe5d9('0x21')](function(_0xa8260b){if(_0xa8260b&&_0xa8260b[_0xe5d9('0x88')]){_0x9a5f4d['account']=_0xa8260b;_0x9a5f4d[_0xe5d9('0x89')]=_0xa8260b['Applications'];_0x9a5f4d[_0xe5d9('0x8a')]=_0xa8260b['List'];_0x9a5f4d['applications']=_[_0xe5d9('0x8b')](_0x9a5f4d[_0xe5d9('0x89')],[_0xe5d9('0x8c')],[_0xe5d9('0x8d')]);if(_0x9a5f4d[_0xe5d9('0x8e')][_0xe5d9('0x8f')]){delete _0x9a5f4d[_0xe5d9('0x8e')][_0xe5d9('0x8f')];}if(_0x9a5f4d[_0xe5d9('0x8e')][_0xe5d9('0x88')]&&_0x9a5f4d[_0xe5d9('0x8e')][_0xe5d9('0x88')][_0xe5d9('0x85')][_0xe5d9('0x5b')]){return _0x9a5f4d[_0xe5d9('0x8e')]['List'][_0xe5d9('0x85')][0x0];}var _0x5cc2a3=_['defaults'](_0x5a06d4[_0xe5d9('0x5e')],{'firstName':_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x83')],'ListId':_0xa8260b[_0xe5d9('0x7c')]});_0x5cc2a3[_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x7f')]]=_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x83')];return db[_0xe5d9('0x84')]['create'](_0x5cc2a3,{'fields':_0xf06f98,'raw':!![]});}})[_0xe5d9('0x21')](handleEntityNotFound(_0x3e65b9,null))[_0xe5d9('0x21')](function(_0x26b7c4){_0x9a5f4d[_0xe5d9('0x90')]=_0x26b7c4;if(_0x26b7c4){var _0x5cc8a5={'ContactId':_0x26b7c4['id'],'OpenchannelAccountId':_0x5a06d4[_0xe5d9('0x66')]['id'],'from':(_0x26b7c4[_0xe5d9('0x91')]||'')+'\x20'+(_0x26b7c4[_0xe5d9('0x92')]||'')};var _0xf5d083={'OpenchannelAccountId':_0x5a06d4['params']['id'],'closed':![]};if(_0x5a06d4['body'][_0xe5d9('0x93')]){_0xf5d083[_0xe5d9('0x93')]=_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x93')];return db['OpenchannelInteraction'][_0xe5d9('0x62')]({'where':_0xf5d083})[_0xe5d9('0x21')](function(_0x2ed949){if(_0x2ed949){return[_0x2ed949,![]];}_0x5cc8a5[_0xe5d9('0x93')]=_0x5a06d4[_0xe5d9('0x5e')]['threadId'];_0x5cc8a5[_0xe5d9('0x94')]=_0x5a06d4[_0xe5d9('0x5e')]['externalUrl'];return db[_0xe5d9('0x95')][_0xe5d9('0x5d')](_0x5cc8a5)[_0xe5d9('0x21')](function(_0x420784){return[_0x420784,!![]];});});}else{_0xf5d083[_0xe5d9('0x93')]=null;}_0xf5d083[_0xe5d9('0x96')]=_0x26b7c4['id'];return db[_0xe5d9('0x95')][_0xe5d9('0x62')]({'where':_0xf5d083})[_0xe5d9('0x21')](function(_0x39d61a){if(_0x39d61a){return[_0x39d61a,![]];}return db[_0xe5d9('0x95')]['create'](_0x5cc8a5)[_0xe5d9('0x21')](function(_0x57f80b){return[_0x57f80b,!![]];});});}})[_0xe5d9('0x97')](function(_0x54f042,_0x5e2af2){if(_0x54f042){_0x3752a8=_0x5e2af2;if(!_0x5e2af2){var _0x2776d9={'from':(_0x9a5f4d[_0xe5d9('0x90')][_0xe5d9('0x91')]||'')+'\x20'+(_0x9a5f4d[_0xe5d9('0x90')][_0xe5d9('0x92')]||'')};if(_0x5a06d4['body'][_0xe5d9('0x93')]&&_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x98')]&&_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x93')]!=_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x98')]){_0x2776d9[_0xe5d9('0x93')]=_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x98')];}return _0x54f042[_0xe5d9('0x38')](_0x2776d9);}else{return _0x54f042;}}})[_0xe5d9('0x21')](function(_0x19b622){_0x9a5f4d[_0xe5d9('0x99')]=_0x19b622[_0xe5d9('0x3a')]({'plain':!![]});_0x9a5f4d['interaction'][_0xe5d9('0x9a')]=_0x3752a8;if(_0x9a5f4d['interaction'][_0xe5d9('0x9a')]){if(_0x9a5f4d['account'][_0xe5d9('0x9b')]){_0x9a5f4d[_0xe5d9('0x89')][_0xe5d9('0x9c')]({'id':0x0,'priority':_0x9a5f4d[_0xe5d9('0x89')][_0xe5d9('0x5b')]+0x1,'app':_0xe5d9('0x9d'),'appdata':'unmanaged','interval':_0xe5d9('0x9e')});}}return db['OpenchannelMessage'][_0xe5d9('0x5d')]({'body':_0x5a06d4[_0xe5d9('0x5e')]['body'],'OpenchannelAccountId':_0x5a06d4[_0xe5d9('0x66')]['id'],'OpenchannelInteractionId':_0x19b622['id'],'direction':'in','ContactId':_0x9a5f4d[_0xe5d9('0x90')]['id'],'AttachmentId':_0x5a06d4[_0xe5d9('0x5e')][_0xe5d9('0x9f')]});})['then'](function(_0x2959f0){_0x9a5f4d[_0xe5d9('0x28')]=_0x2959f0;if(_0x9a5f4d[_0xe5d9('0x99')][_0xe5d9('0xa0')]){return db[_0xe5d9('0xa1')]['find']({'attributes':['id',_0xe5d9('0x3e')],'where':{'id':_0x9a5f4d[_0xe5d9('0x99')][_0xe5d9('0xa0')]}})[_0xe5d9('0x21')](function(_0x54402d){if(_0x54402d){_0x9a5f4d[_0xe5d9('0x89')][_0xe5d9('0xa2')]({'id':0x0,'priority':0x0,'app':_0xe5d9('0xa3'),'appdata':_0x54402d['name']+','+(_0x9a5f4d['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x9a5f4d[_0xe5d9('0xa4')]=![];}return respondWithRpcPromise('Start','startRouting',_0x9a5f4d);});}return respondWithRpcPromise(_0xe5d9('0xa5'),'startRouting',_0x9a5f4d);})[_0xe5d9('0x21')](function(_0x37ee69){respondWithRpcPromise('EventManager',_0xe5d9('0xa6'),{'event':_0xe5d9('0x74'),'message':_0x37ee69},client9002);return _0x37ee69;})[_0xe5d9('0x21')](respondWithResult(_0x3e65b9,null))[_0xe5d9('0x2c')](handleError(_0x3e65b9,null));};exports[_0xe5d9('0xa7')]=function(_0x5c095d,_0x779657,_0x1bf0f2){return db[_0xe5d9('0x43')][_0xe5d9('0x71')]({'where':{'id':_0x5c095d['params']['id']}})['then'](handleEntityNotFound(_0x779657,null))[_0xe5d9('0x21')](function(_0x5564ad){if(_0x5564ad){return db['sequelize'][_0xe5d9('0xa8')](function(_0x21911c){return db[_0xe5d9('0x87')][_0xe5d9('0x39')]({'where':{'OpenchannelAccountId':_0x5c095d['params']['id']},'transaction':_0x21911c})[_0xe5d9('0x21')](function(_0x3889e7){var _0x4f263d=_[_0xe5d9('0x42')](_0x5c095d[_0xe5d9('0x5e')],function(_0x245d02){_0x245d02[_0xe5d9('0x68')]=_0x5c095d[_0xe5d9('0x66')]['id'];return _0x245d02;});return db[_0xe5d9('0x87')][_0xe5d9('0xa9')](_0x4f263d,{'transaction':_0x21911c});});})[_0xe5d9('0x21')](function(){return db['OpenchannelApplication'][_0xe5d9('0xaa')]({'where':{'OpenchannelAccountId':_0x5c095d[_0xe5d9('0x66')]['id']},'order':_0xe5d9('0x8c')});});}})[_0xe5d9('0x21')](respondWithResult(_0x779657,null))[_0xe5d9('0x2c')](handleError(_0x779657,null));};exports[_0xe5d9('0xab')]=function(_0x584e78,_0x396c52,_0x279903){var _0x1426f9={};var _0xc66ee2={};var _0x38039f;var _0x4a911a;return db[_0xe5d9('0x43')][_0xe5d9('0x71')]({'where':{'id':_0x584e78[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x396c52,null))[_0xe5d9('0x21')](function(_0x4431bc){if(_0x4431bc){_0x38039f=_0x4431bc;_0xc66ee2[_0xe5d9('0x47')]=_[_0xe5d9('0x5a')](db[_0xe5d9('0x87')][_0xe5d9('0x44')]);_0xc66ee2[_0xe5d9('0x48')]=_['keys'](_0x584e78[_0xe5d9('0x48')]);_0xc66ee2[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0xc66ee2[_0xe5d9('0x47')],_0xc66ee2[_0xe5d9('0x48')]);_0x1426f9[_0xe5d9('0x4b')]=_[_0xe5d9('0x4a')](_0xc66ee2[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x584e78[_0xe5d9('0x48')][_0xe5d9('0x4c')]));_0x1426f9['attributes']=_0x1426f9['attributes']['length']?_0x1426f9[_0xe5d9('0x4b')]:_0xc66ee2[_0xe5d9('0x47')];_0x1426f9[_0xe5d9('0x4e')]=qs[_0xe5d9('0x4f')](_0x584e78[_0xe5d9('0x48')]['sort']);_0x1426f9[_0xe5d9('0x53')]=qs['filters'](_['pick'](_0x584e78[_0xe5d9('0x48')],_0xc66ee2['filters']));if(_0x584e78[_0xe5d9('0x48')][_0xe5d9('0x51')]){_0x1426f9['where']=_[_0xe5d9('0x52')](_0x1426f9[_0xe5d9('0x53')],{'$or':_['map'](_0x1426f9['attributes'],function(_0xefdeb2){var _0x73b82e={};_0x73b82e[_0xefdeb2]={'$like':'%'+_0x584e78['query']['filter']+'%'};return _0x73b82e;})});}_0x1426f9=_[_0xe5d9('0x52')]({},_0x1426f9,_0x584e78[_0xe5d9('0x56')]);return _0x38039f[_0xe5d9('0xab')](_0x1426f9);}})[_0xe5d9('0x21')](function(_0x2476a5){if(_0x2476a5){_0x4a911a=_0x2476a5[_0xe5d9('0x5b')];if(!_0x584e78[_0xe5d9('0x48')][_0xe5d9('0x4d')](_0xe5d9('0x6b'))){_0x1426f9[_0xe5d9('0x34')]=qs[_0xe5d9('0x34')](_0x584e78[_0xe5d9('0x48')]['limit']);_0x1426f9[_0xe5d9('0x31')]=qs['offset'](_0x584e78[_0xe5d9('0x48')]['offset']);}return _0x38039f[_0xe5d9('0xab')](_0x1426f9);}})[_0xe5d9('0x21')](function(_0x12cb8d){if(_0x12cb8d){return _0x12cb8d?{'count':_0x4a911a,'rows':_0x12cb8d}:null;}})[_0xe5d9('0x21')](respondWithResult(_0x396c52,null))[_0xe5d9('0x2c')](handleError(_0x396c52,null));};exports['getInteractions']=function(_0x3f65f1,_0x325822,_0x2c3467){var _0x3151dd={'raw':![],'where':{}};var _0x17778d={};var _0x9122b3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe5d9('0x71')]({'where':{'id':_0x3f65f1[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x325822,null))['then'](function(_0x1f7267){if(_0x1f7267){_0x17778d[_0xe5d9('0x47')]=_[_0xe5d9('0x5a')](db['OpenchannelInteraction'][_0xe5d9('0x44')]);_0x17778d[_0xe5d9('0x48')]=_[_0xe5d9('0x5a')](_0x3f65f1[_0xe5d9('0x48')]);_0x17778d[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0x17778d[_0xe5d9('0x47')],_0x17778d[_0xe5d9('0x48')]);_0x3151dd['attributes']=_[_0xe5d9('0x4a')](_0x17778d[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x3f65f1[_0xe5d9('0x48')][_0xe5d9('0x4c')]));_0x3151dd[_0xe5d9('0x4b')]=_0x3151dd[_0xe5d9('0x4b')][_0xe5d9('0x5b')]?_0x3151dd[_0xe5d9('0x4b')]:_0x17778d[_0xe5d9('0x47')];if(!_0x3f65f1['query'][_0xe5d9('0x4d')]('nolimit')){_0x3151dd[_0xe5d9('0x34')]=qs[_0xe5d9('0x34')](_0x3f65f1[_0xe5d9('0x48')]['limit']);_0x3151dd[_0xe5d9('0x31')]=qs['offset'](_0x3f65f1[_0xe5d9('0x48')][_0xe5d9('0x31')]);}_0x3151dd['order']=qs['sort'](_0x3f65f1[_0xe5d9('0x48')]['sort']);_0x3151dd[_0xe5d9('0x53')]=qs[_0xe5d9('0x49')](_[_0xe5d9('0x50')](_0x3f65f1[_0xe5d9('0x48')],_0x17778d[_0xe5d9('0x49')]));_0x3151dd[_0xe5d9('0x53')][_0xe5d9('0x68')]=_0x1f7267['id'];if(_0x3f65f1['query'][_0xe5d9('0x51')]){_0x3151dd[_0xe5d9('0x53')]=_[_0xe5d9('0x52')](_0x3151dd[_0xe5d9('0x53')],{'$or':_[_0xe5d9('0x42')](_0x3151dd['attributes'],function(_0x5d8d81){var _0x3e5b0a={};_0x3e5b0a[_0x5d8d81]={'$like':'%'+_0x3f65f1[_0xe5d9('0x48')]['filter']+'%'};return _0x3e5b0a;})});}_0x3151dd=_[_0xe5d9('0x52')]({},_0x3151dd,_0x3f65f1[_0xe5d9('0x56')]);return db[_0xe5d9('0x95')][_0xe5d9('0x33')]({'where':_0x3151dd['where']})[_0xe5d9('0x21')](function(_0x524179){_0x9122b3[_0xe5d9('0x33')]=_0x524179;if(_0x3f65f1[_0xe5d9('0x48')][_0xe5d9('0x57')]){_0x3151dd[_0xe5d9('0x5c')]=[{'model':db['CmContact'],'as':_0xe5d9('0xac'),'required':![]},{'model':db[_0xe5d9('0xa1')],'as':_0xe5d9('0xad'),'attributes':['name','fullname',_0xe5d9('0xae')],'required':![]},{'model':db[_0xe5d9('0xaf')],'as':'Tags','attributes':['id',_0xe5d9('0x3e'),'color'],'where':_0x3f65f1[_0xe5d9('0x48')][_0xe5d9('0xb0')]?{'id':_0x3f65f1['query'][_0xe5d9('0xb0')]}:undefined,'required':_0x3f65f1['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xe5d9('0x72')](_0x3151dd);})[_0xe5d9('0x21')](function(_0x5469ee){_0x9122b3[_0xe5d9('0x58')]=_0x5469ee;return _0x9122b3;});}})[_0xe5d9('0x21')](respondWithFilteredResult(_0x325822,_0x3151dd))['catch'](handleError(_0x325822,null));};exports['addAgents']=function(_0x5e7f4d,_0x505b14,_0x33c6b1){return db['OpenchannelAccount'][_0xe5d9('0x62')]({'where':{'id':_0x5e7f4d[_0xe5d9('0x66')]['id']}})['then'](handleEntityNotFound(_0x505b14,null))[_0xe5d9('0x21')](function(_0x5bafea){if(_0x5bafea){return _0x5bafea[_0xe5d9('0xb1')](_0x5e7f4d['body'][_0xe5d9('0x6d')],_[_0xe5d9('0xb2')](_0x5e7f4d[_0xe5d9('0x5e')],[_0xe5d9('0x6d'),'id'])||{})['spread'](function(_0x50563b){for(var _0x16461c=0x0;_0x16461c<_0x5e7f4d[_0xe5d9('0x5e')][_0xe5d9('0x6d')][_0xe5d9('0x5b')];_0x16461c+=0x1){socket[_0xe5d9('0xb3')](_0xe5d9('0xb4'),{'UserId':Number(_0x5e7f4d[_0xe5d9('0x5e')][_0xe5d9('0x6d')][_0x16461c]),'OpenchannelAccountId':Number(_0x5e7f4d[_0xe5d9('0x66')]['id'])});}return _0x50563b;});}})['then'](respondWithResult(_0x505b14,null))[_0xe5d9('0x2c')](handleError(_0x505b14,null));};exports['removeAgents']=function(_0x137888,_0x52d55d,_0x3845db){return db[_0xe5d9('0x43')][_0xe5d9('0x62')]({'where':{'id':_0x137888[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x52d55d,null))[_0xe5d9('0x21')](function(_0x24a8c8){if(_0x24a8c8){return _0x24a8c8['removeAgents'](_0x137888['query']['ids'])[_0xe5d9('0x21')](function(){if(_[_0xe5d9('0xb5')](_0x137888[_0xe5d9('0x48')]['ids'])){for(var _0x41aac0=0x0;_0x41aac0<_0x137888['query'][_0xe5d9('0x6d')][_0xe5d9('0x5b')];_0x41aac0+=0x1){socket[_0xe5d9('0xb3')](_0xe5d9('0xb6'),{'UserId':Number(_0x137888[_0xe5d9('0x48')][_0xe5d9('0x6d')][_0x41aac0]),'OpenchannelAccountId':Number(_0x137888[_0xe5d9('0x66')]['id'])});}}else{socket['emit'](_0xe5d9('0xb6'),{'UserId':Number(_0x137888['query'][_0xe5d9('0x6d')]),'OpenchannelAccountId':Number(_0x137888[_0xe5d9('0x66')]['id'])});}});}})[_0xe5d9('0x21')](respondWithStatusCode(_0x52d55d,null))['catch'](handleError(_0x52d55d,null));};exports[_0xe5d9('0xb7')]=function(_0x196a5a,_0x447c3f,_0x349f50){var _0x3c56be={};var _0x32f7f6={};var _0x3ecb64;var _0x30d106;return db[_0xe5d9('0x43')][_0xe5d9('0x71')]({'where':{'id':_0x196a5a[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x447c3f,null))['then'](function(_0x17b9a5){if(_0x17b9a5){_0x3ecb64=_0x17b9a5;_0x32f7f6[_0xe5d9('0x47')]=_['keys'](db[_0xe5d9('0xa1')][_0xe5d9('0x44')]);_0x32f7f6[_0xe5d9('0x48')]=_[_0xe5d9('0x5a')](_0x196a5a[_0xe5d9('0x48')]);_0x32f7f6[_0xe5d9('0x49')]=_[_0xe5d9('0x4a')](_0x32f7f6[_0xe5d9('0x47')],_0x32f7f6['query']);_0x3c56be['attributes']=_['intersection'](_0x32f7f6[_0xe5d9('0x47')],qs[_0xe5d9('0x4c')](_0x196a5a['query']['fields']));_0x3c56be[_0xe5d9('0x4b')]=_0x3c56be[_0xe5d9('0x4b')][_0xe5d9('0x5b')]?_0x3c56be[_0xe5d9('0x4b')]:_0x32f7f6[_0xe5d9('0x47')];_0x3c56be[_0xe5d9('0x4e')]=qs[_0xe5d9('0x4f')](_0x196a5a['query'][_0xe5d9('0x4f')]);_0x3c56be[_0xe5d9('0x53')]=qs[_0xe5d9('0x49')](_[_0xe5d9('0x50')](_0x196a5a[_0xe5d9('0x48')],_0x32f7f6[_0xe5d9('0x49')]));if(_0x196a5a['query'][_0xe5d9('0x51')]){_0x3c56be[_0xe5d9('0x53')]=_[_0xe5d9('0x52')](_0x3c56be[_0xe5d9('0x53')],{'$or':_[_0xe5d9('0x42')](_0x3c56be[_0xe5d9('0x4b')],function(_0x5b5358){var _0x2216df={};_0x2216df[_0x5b5358]={'$like':'%'+_0x196a5a['query']['filter']+'%'};return _0x2216df;})});}_0x3c56be=_['merge']({},_0x3c56be,_0x196a5a[_0xe5d9('0x56')]);return _0x3ecb64[_0xe5d9('0xb7')](_0x3c56be);}})[_0xe5d9('0x21')](function(_0xcfe289){if(_0xcfe289){_0x30d106=_0xcfe289[_0xe5d9('0x5b')];if(!_0x196a5a['query'][_0xe5d9('0x4d')](_0xe5d9('0x6b'))){_0x3c56be['limit']=qs['limit'](_0x196a5a[_0xe5d9('0x48')]['limit']);_0x3c56be[_0xe5d9('0x31')]=qs[_0xe5d9('0x31')](_0x196a5a[_0xe5d9('0x48')]['offset']);}return _0x3ecb64[_0xe5d9('0xb7')](_0x3c56be);}})[_0xe5d9('0x21')](function(_0x8c54dc){if(_0x8c54dc){return _0x8c54dc?{'count':_0x30d106,'rows':_0x8c54dc}:null;}})[_0xe5d9('0x21')](respondWithResult(_0x447c3f,null))[_0xe5d9('0x2c')](handleError(_0x447c3f,null));};exports[_0xe5d9('0x3f')]=function(_0x5a3e76,_0x4b8654,_0x31169f){var _0x4c898e,_0x54d36e,_0x4c8aba;if(_[_0xe5d9('0x7d')](_0x5a3e76[_0xe5d9('0x5e')][_0xe5d9('0x5e')])||_0x5a3e76[_0xe5d9('0x5e')][_0xe5d9('0x5e')]===''){throw new db[(_0xe5d9('0x76'))][(_0xe5d9('0x77'))](_0xe5d9('0x7e'));}if(_[_0xe5d9('0x7d')](_0x5a3e76['body']['to'])){}_0x4c898e=_0x5a3e76[_0xe5d9('0x5e')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5a3e76[_0xe5d9('0x66')]['id']}})[_0xe5d9('0x21')](handleEntityNotFound(_0x4b8654,null))[_0xe5d9('0x21')](function(_0x288e98){if(_0x288e98){return db[_0xe5d9('0x43')]['find']({'where':{'id':_0x288e98['id']},'include':[{'model':db[_0xe5d9('0xb8')],'as':'List','include':[{'model':db[_0xe5d9('0x84')],'as':_0xe5d9('0x85'),'where':{[_0x288e98[_0xe5d9('0x7f')]]:_0x4c898e},'limit':0x1,'order':[[_0xe5d9('0x7b'),_0xe5d9('0x86')]]}]}]})['then'](handleEntityNotFound(_0x4b8654,null))[_0xe5d9('0x21')](function(_0xe0e4a5){if(_0xe0e4a5&&_0xe0e4a5[_0xe5d9('0x88')]){_0x54d36e=_0xe0e4a5['get']({'plain':!![]});if(_0x54d36e[_0xe5d9('0x88')]&&_0x54d36e['List'][_0xe5d9('0x85')][_0xe5d9('0x5b')]){return _0x54d36e[_0xe5d9('0x88')][_0xe5d9('0x85')][0x0];}return db[_0xe5d9('0x84')][_0xe5d9('0x5d')](_['defaults'](_0x5a3e76[_0xe5d9('0x5e')],{'firstName':_0x4c898e,[_0xe0e4a5['mapKey']]:_0x4c898e,'phone':_0x4c898e,'ListId':_0x54d36e[_0xe5d9('0x7c')]}));}})[_0xe5d9('0x21')](handleEntityNotFound(_0x4b8654,null))[_0xe5d9('0x21')](function(_0x3ec86d){if(_0x3ec86d){_0x4c8aba=_0x3ec86d;return db['OpenchannelInteraction'][_0xe5d9('0x62')]({'where':{'ContactId':_0x4c8aba['id'],'closed':![],'OpenchannelAccountId':_0x54d36e['id']}})['then'](function(_0x349b15){if(_0x349b15){return[_0x349b15,![]];}return db[_0xe5d9('0x95')][_0xe5d9('0x5d')]({'UserId':_0x5a3e76[_0xe5d9('0x5f')]['id'],'ContactId':_0x4c8aba['id'],'OpenchannelAccountId':_0x54d36e['id'],'lastMsgDirection':'out','Messages':[_[_0xe5d9('0x52')](_0x5a3e76[_0xe5d9('0x5e')],{'read':![],'body':_0x5a3e76[_0xe5d9('0x5e')][_0xe5d9('0x5e')],'OpenchannelAccountId':_0x54d36e['id'],'UserId':_0x5a3e76[_0xe5d9('0x5f')]['id'],'ContactId':_0x4c8aba['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xe5d9('0x21')](function(_0x53baac){return[_0x53baac,!![]];});});}})[_0xe5d9('0x97')](function(_0x1e0623,_0x41ab90){if(_0x41ab90){return _0x1e0623;}return db['OpenchannelMessage']['create'](_[_0xe5d9('0x52')](_0x5a3e76[_0xe5d9('0x5e')],{'read':![],'body':_0x5a3e76[_0xe5d9('0x5e')][_0xe5d9('0x5e')],'OpenchannelAccountId':_0x54d36e['id'],'OpenchannelInteractionId':_0x1e0623['id'],'UserId':_0x5a3e76[_0xe5d9('0x5f')]['id'],'ContactId':_0x4c8aba['id']}))[_0xe5d9('0x21')](function(_0x1da0c6){_0x1e0623[_0xe5d9('0xb9')]['Messages']=[];_0x1e0623[_0xe5d9('0xb9')]['Messages']['push'](_0x1da0c6[_0xe5d9('0xb9')]);return _0x1e0623;});});}})[_0xe5d9('0x21')](respondWithResult(_0x4b8654,null))['catch'](handleError(_0x4b8654,null));}; \ No newline at end of file +var _0xac38=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','Owner','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','dataValues','Messages','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','model','query'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac38,0x135));var _0x8ac3=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xac38[_0x9cfe28];return _0x54a1d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ac3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ac3('0x1'));var moment=require(_0x8ac3('0x2'));var BPromise=require(_0x8ac3('0x3'));var Mustache=require(_0x8ac3('0x4'));var util=require('util');var path=require(_0x8ac3('0x5'));var sox=require(_0x8ac3('0x6'));var csv=require(_0x8ac3('0x7'));var ejs=require(_0x8ac3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ac3('0x9'));var jsforce=require(_0x8ac3('0xa'));var deskjs=require(_0x8ac3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8ac3('0xc'));var Papa=require(_0x8ac3('0xd'));var Redis=require(_0x8ac3('0xe'));var authService=require(_0x8ac3('0xf'));var qs=require(_0x8ac3('0x10'));var as=require(_0x8ac3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ac3('0x12'))(_0x8ac3('0x13'));var utils=require(_0x8ac3('0x14'));var config=require(_0x8ac3('0x15'));var licenseUtil=require(_0x8ac3('0x16'));var db=require('../../mysqldb')['db'];config[_0x8ac3('0x17')]=_[_0x8ac3('0x18')](config[_0x8ac3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ac3('0x19'))(new Redis(config[_0x8ac3('0x17')]));require(_0x8ac3('0x1a'))['register'](socket);var jayson=require(_0x8ac3('0x1b'));var client=jayson[_0x8ac3('0x1c')][_0x8ac3('0x1d')]({'port':0x232c});var client9002=jayson[_0x8ac3('0x1c')][_0x8ac3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x46dfc5,_0x522911,_0x3063c2,_0x4221a5){return new BPromise(function(_0x597eb4,_0x3ed33c){var _0x3f0b67=_0x4221a5||client;return _0x3f0b67['request'](_0x46dfc5,_0x3063c2)[_0x8ac3('0x1e')](function(_0x12f501){logger[_0x8ac3('0x1f')](_0x8ac3('0x20'),_0x522911,'request\x20sent');logger[_0x8ac3('0x21')](_0x8ac3('0x22'),_0x522911,_0x8ac3('0x23'),JSON[_0x8ac3('0x24')](_0x12f501));if(_0x12f501['error']){if(_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x26')]===0x1f4){logger['error'](_0x8ac3('0x20'),_0x522911,_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x27')]);return _0x3ed33c(_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x27')]);}logger['error'](_0x8ac3('0x20'),_0x522911,_0x12f501[_0x8ac3('0x25')]['message']);return _0x597eb4(_0x12f501[_0x8ac3('0x25')]['message']);}else{logger[_0x8ac3('0x1f')](_0x8ac3('0x20'),_0x522911,_0x8ac3('0x23'));_0x597eb4(_0x12f501['result']['message']);}})[_0x8ac3('0x28')](function(_0xdb6fa1){logger[_0x8ac3('0x25')](_0x8ac3('0x20'),_0x522911,_0xdb6fa1);_0x3ed33c(_0xdb6fa1);});});}function respondWithStatusCode(_0x30ef15,_0x57cd69){_0x57cd69=_0x57cd69||0xcc;return function(_0x348529){if(_0x348529){return _0x30ef15[_0x8ac3('0x29')](_0x57cd69);}return _0x30ef15[_0x8ac3('0x2a')](_0x57cd69)[_0x8ac3('0x2b')]();};}function respondWithResult(_0x14dfb0,_0x330e05){_0x330e05=_0x330e05||0xc8;return function(_0x4a26e3){if(_0x4a26e3){return _0x14dfb0[_0x8ac3('0x2a')](_0x330e05)['json'](_0x4a26e3);}};}function respondWithFilteredResult(_0x833d95,_0x535729){return function(_0x5d8a07){if(_0x5d8a07){var _0x4dd187=typeof _0x535729[_0x8ac3('0x2c')]===_0x8ac3('0x2d')&&typeof _0x535729['limit']==='undefined';var _0x2ef800=_0x5d8a07[_0x8ac3('0x2e')];var _0x344d6d=_0x4dd187?0x0:_0x535729['offset'];var _0x4873e0=_0x4dd187?_0x5d8a07[_0x8ac3('0x2e')]:_0x535729[_0x8ac3('0x2c')]+_0x535729['limit'];var _0x3bde32;if(_0x4873e0>=_0x2ef800){_0x4873e0=_0x2ef800;_0x3bde32=0xc8;}else{_0x3bde32=0xce;}_0x833d95['status'](_0x3bde32);return _0x833d95[_0x8ac3('0x2f')](_0x8ac3('0x30'),_0x344d6d+'-'+_0x4873e0+'/'+_0x2ef800)[_0x8ac3('0x31')](_0x5d8a07);}return null;};}function patchUpdates(_0xfcd3d7){return function(_0x2356c6){try{jsonpatch[_0x8ac3('0x32')](_0x2356c6,_0xfcd3d7,!![]);}catch(_0xe7c3dd){return BPromise[_0x8ac3('0x33')](_0xe7c3dd);}return _0x2356c6[_0x8ac3('0x34')]();};}function saveUpdates(_0x5eb0ee,_0x37bee2){return function(_0x449167){if(_0x449167){return _0x449167[_0x8ac3('0x35')](_0x5eb0ee)[_0x8ac3('0x1e')](function(_0x3b872b){return _0x3b872b;});}return null;};}function removeEntity(_0x57073f,_0x3338bc){return function(_0x4115a5){if(_0x4115a5){return _0x4115a5[_0x8ac3('0x36')]()['then'](function(){var _0x1b0d6c=_0x4115a5[_0x8ac3('0x37')]({'plain':!![]});var _0x32e763=_0x8ac3('0x38');return db[_0x8ac3('0x39')][_0x8ac3('0x36')]({'where':{'type':_0x32e763,'resourceId':_0x1b0d6c['id']}})[_0x8ac3('0x1e')](function(){return _0x4115a5;});})[_0x8ac3('0x1e')](function(){_0x57073f[_0x8ac3('0x2a')](0xcc)[_0x8ac3('0x2b')]();});}};}function handleEntityNotFound(_0x594134,_0x2d71ce){return function(_0x3ef094){if(!_0x3ef094){_0x594134[_0x8ac3('0x29')](0x194);}return _0x3ef094;};}function handleError(_0x1bc4b1,_0x4b058a){_0x4b058a=_0x4b058a||0x1f4;return function(_0x453ef0){logger['error'](_0x453ef0[_0x8ac3('0x3a')]);if(_0x453ef0['name']){delete _0x453ef0[_0x8ac3('0x3b')];}_0x1bc4b1[_0x8ac3('0x2a')](_0x4b058a)[_0x8ac3('0x3c')](_0x453ef0);};}exports[_0x8ac3('0x3d')]=function(_0x3e5ccf,_0x1f353c){var _0x3e60ca={'include':[{'model':db['Pause'],'as':_0x8ac3('0x3e')}]},_0x5dd3df={},_0x2aa319={'count':0x0,'rows':[]};var _0xbe7c75=_[_0x8ac3('0x3f')](db[_0x8ac3('0x40')][_0x8ac3('0x41')],function(_0x5e74c3){return{'name':_0x5e74c3['fieldName'],'type':_0x5e74c3['type'][_0x8ac3('0x42')]};});_0x5dd3df[_0x8ac3('0x43')]=_[_0x8ac3('0x3f')](_0xbe7c75,_0x8ac3('0x3b'));_0x5dd3df[_0x8ac3('0x44')]=_['keys'](_0x3e5ccf[_0x8ac3('0x44')]);_0x5dd3df[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x5dd3df['model'],_0x5dd3df['query']);_0x3e60ca['attributes']=_[_0x8ac3('0x46')](_0x5dd3df[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x3e5ccf[_0x8ac3('0x44')]['fields']));_0x3e60ca[_0x8ac3('0x48')]=_0x3e60ca[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x3e60ca['attributes']:_0x5dd3df[_0x8ac3('0x43')];if(!_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0x3e60ca[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x3e5ccf['query'][_0x8ac3('0x4c')]);_0x3e60ca[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x3e60ca[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x3e60ca[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x3e5ccf['query'],_0x5dd3df[_0x8ac3('0x45')]),_0xbe7c75);if(_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x3e60ca[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x3e60ca[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0xbe7c75,function(_0x4a30ad){if(_0x4a30ad[_0x8ac3('0x53')]!==_0x8ac3('0x54')){var _0x177bdb={};_0x177bdb[_0x4a30ad[_0x8ac3('0x3b')]]={'$like':'%'+_0x3e5ccf[_0x8ac3('0x44')]['filter']+'%'};return _0x177bdb;}})});}_0x3e60ca=_['merge']({},_0x3e60ca,_0x3e5ccf[_0x8ac3('0x55')]);var _0x4fc844={'where':_0x3e60ca['where']};return db[_0x8ac3('0x40')]['count'](_0x4fc844)[_0x8ac3('0x1e')](function(_0x6f40b4){_0x2aa319[_0x8ac3('0x2e')]=_0x6f40b4;if(_0x3e5ccf['query'][_0x8ac3('0x56')]){_0x3e60ca[_0x8ac3('0x57')]=[{'all':!![]}];}return db[_0x8ac3('0x40')][_0x8ac3('0x58')](_0x3e60ca);})[_0x8ac3('0x1e')](function(_0x57c706){_0x2aa319['rows']=_0x57c706;return _0x2aa319;})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x1f353c,_0x3e60ca))['catch'](handleError(_0x1f353c,null));};exports[_0x8ac3('0x59')]=function(_0x1a013f,_0x4c1be9){var _0x2c5ec1={'raw':![],'where':{'id':_0x1a013f['params']['id']},'include':[{'model':db['Pause'],'as':_0x8ac3('0x3e')}]},_0x5a6265={};_0x5a6265[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db['OpenchannelAccount'][_0x8ac3('0x41')]);_0x5a6265['query']=_[_0x8ac3('0x5a')](_0x1a013f['query']);_0x5a6265[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x5a6265[_0x8ac3('0x43')],_0x5a6265['query']);_0x2c5ec1[_0x8ac3('0x48')]=_[_0x8ac3('0x46')](_0x5a6265[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x1a013f[_0x8ac3('0x44')][_0x8ac3('0x47')]));_0x2c5ec1[_0x8ac3('0x48')]=_0x2c5ec1[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x2c5ec1[_0x8ac3('0x48')]:_0x5a6265['model'];if(_0x1a013f[_0x8ac3('0x44')]['includeAll']){_0x2c5ec1[_0x8ac3('0x57')]=[{'all':!![]}];}_0x2c5ec1=_[_0x8ac3('0x52')]({},_0x2c5ec1,_0x1a013f[_0x8ac3('0x55')]);return db[_0x8ac3('0x40')][_0x8ac3('0x5b')](_0x2c5ec1)['then'](handleEntityNotFound(_0x4c1be9,null))[_0x8ac3('0x1e')](respondWithResult(_0x4c1be9,null))[_0x8ac3('0x28')](handleError(_0x4c1be9,null));};exports[_0x8ac3('0x5c')]=function(_0x329c06,_0x1b7cac){return db[_0x8ac3('0x40')][_0x8ac3('0x5c')](_0x329c06[_0x8ac3('0x5d')],{})['then'](function(_0x385920){var _0x192006=_0x329c06[_0x8ac3('0x5e')][_0x8ac3('0x37')]({'plain':!![]});if(!_0x192006)throw new Error(_0x8ac3('0x5f'));if(_0x192006[_0x8ac3('0x60')]===_0x8ac3('0x5e')){var _0x953f9c=_0x385920['get']({'plain':!![]});var _0x5f2889=_0x8ac3('0x38');return db['UserProfileSection'][_0x8ac3('0x5b')]({'where':{'name':_0x5f2889,'userProfileId':_0x192006[_0x8ac3('0x61')]},'raw':!![]})[_0x8ac3('0x1e')](function(_0x36a556){if(_0x36a556&&_0x36a556[_0x8ac3('0x62')]===0x0){return db[_0x8ac3('0x39')]['create']({'name':_0x953f9c[_0x8ac3('0x3b')],'resourceId':_0x953f9c['id'],'type':_0x36a556[_0x8ac3('0x3b')],'sectionId':_0x36a556['id']},{})[_0x8ac3('0x1e')](function(){return _0x385920;});}else{return _0x385920;}})[_0x8ac3('0x28')](function(_0x336956){logger[_0x8ac3('0x25')](_0x8ac3('0x63'),_0x336956);throw _0x336956;});}return _0x385920;})['then'](respondWithResult(_0x1b7cac,0xc9))['catch'](handleError(_0x1b7cac,null));};exports[_0x8ac3('0x35')]=function(_0x173991,_0x4c8143){if(_0x173991[_0x8ac3('0x5d')]['id']){delete _0x173991[_0x8ac3('0x5d')]['id'];}return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x173991[_0x8ac3('0x64')]['id']},'include':[{'model':db[_0x8ac3('0x65')],'as':'mandatoryDispositionPause'}]})[_0x8ac3('0x1e')](handleEntityNotFound(_0x4c8143,null))[_0x8ac3('0x1e')](saveUpdates(_0x173991[_0x8ac3('0x5d')],null))[_0x8ac3('0x1e')](respondWithResult(_0x4c8143,null))[_0x8ac3('0x28')](handleError(_0x4c8143,null));};exports[_0x8ac3('0x36')]=function(_0x1da4e3,_0x45cc57){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x1da4e3['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x45cc57,null))[_0x8ac3('0x1e')](removeEntity(_0x45cc57,null))['catch'](handleError(_0x45cc57,null));};exports[_0x8ac3('0x66')]=function(_0x5d552e,_0x4d031d){return db[_0x8ac3('0x40')][_0x8ac3('0x66')]()[_0x8ac3('0x1e')](respondWithResult(_0x4d031d,null))[_0x8ac3('0x28')](handleError(_0x4d031d,null));};exports['addDisposition']=function(_0x3e1118,_0x2ebb02,_0x2c5761){if(_0x3e1118['body']['id']){delete _0x3e1118['body']['id'];}return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x3e1118['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x2ebb02,null))[_0x8ac3('0x1e')](function(_0x5cc5f5){if(_0x5cc5f5){_0x3e1118[_0x8ac3('0x5d')][_0x8ac3('0x67')]=_0x5cc5f5['id'];return db[_0x8ac3('0x68')][_0x8ac3('0x5c')](_0x3e1118['body']);}})[_0x8ac3('0x1e')](respondWithResult(_0x2ebb02,null))[_0x8ac3('0x28')](handleError(_0x2ebb02,null));};exports[_0x8ac3('0x69')]=function(_0x1c3bd8,_0x12c73f,_0x19c6d9){var _0x31126b={'raw':![],'where':{}};var _0x21d57d={};var _0x277607={'count':0x0,'rows':[]};return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x1c3bd8[_0x8ac3('0x64')]['id']}})['then'](handleEntityNotFound(_0x12c73f,null))[_0x8ac3('0x1e')](function(_0x36598e){if(_0x36598e){_0x21d57d['model']=_[_0x8ac3('0x5a')](db[_0x8ac3('0x68')][_0x8ac3('0x41')]);_0x21d57d[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x1c3bd8[_0x8ac3('0x44')]);_0x21d57d['filters']=_[_0x8ac3('0x46')](_0x21d57d[_0x8ac3('0x43')],_0x21d57d[_0x8ac3('0x44')]);_0x31126b[_0x8ac3('0x48')]=_[_0x8ac3('0x46')](_0x21d57d['model'],qs['fields'](_0x1c3bd8['query'][_0x8ac3('0x47')]));_0x31126b['attributes']=_0x31126b[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x31126b[_0x8ac3('0x48')]:_0x21d57d[_0x8ac3('0x43')];if(!_0x1c3bd8['query'][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0x31126b[_0x8ac3('0x4c')]=qs['limit'](_0x1c3bd8[_0x8ac3('0x44')]['limit']);_0x31126b[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x31126b[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x31126b[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x1c3bd8[_0x8ac3('0x44')],_0x21d57d[_0x8ac3('0x45')]));_0x31126b[_0x8ac3('0x4f')]['OpenchannelAccountId']=_0x36598e['id'];if(_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x31126b[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x31126b[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x31126b['attributes'],function(_0x51bde4){var _0x2f50e3={};_0x2f50e3[_0x51bde4]={'$like':'%'+_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x51')]+'%'};return _0x2f50e3;})});}_0x31126b=_['merge']({},_0x31126b,_0x1c3bd8[_0x8ac3('0x55')]);return db[_0x8ac3('0x68')][_0x8ac3('0x2e')]({'where':_0x31126b[_0x8ac3('0x4f')]})[_0x8ac3('0x1e')](function(_0x2f0216){_0x277607['count']=_0x2f0216;if(_0x1c3bd8['query'][_0x8ac3('0x56')]){_0x31126b[_0x8ac3('0x57')]=[{'all':!![]}];}return db[_0x8ac3('0x68')][_0x8ac3('0x58')](_0x31126b);})[_0x8ac3('0x1e')](function(_0x228c20){_0x277607[_0x8ac3('0x6b')]=_0x228c20;return _0x277607;});}})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x12c73f,_0x31126b))[_0x8ac3('0x28')](handleError(_0x12c73f,null));};exports['removeDispositions']=function(_0xf696f7,_0x3dba62,_0x28bb92){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0xf696f7['params']['id']}})['then'](handleEntityNotFound(_0x3dba62,null))['then'](function(_0x29df84){if(_0x29df84){return _0x29df84[_0x8ac3('0x6c')](_0xf696f7[_0x8ac3('0x44')][_0x8ac3('0x6d')]);}})['then'](respondWithStatusCode(_0x3dba62,null))[_0x8ac3('0x28')](handleError(_0x3dba62,null));};exports[_0x8ac3('0x6e')]=function(_0x40b544,_0xa781c2,_0x14fe07){if(_0x40b544['body']['id']){delete _0x40b544[_0x8ac3('0x5d')]['id'];}return db['OpenchannelAccount'][_0x8ac3('0x5b')]({'where':{'id':_0x40b544[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xa781c2,null))['then'](function(_0x156a0f){if(_0x156a0f){_0x40b544[_0x8ac3('0x5d')][_0x8ac3('0x67')]=_0x156a0f['id'];return db[_0x8ac3('0x6f')][_0x8ac3('0x5c')](_0x40b544[_0x8ac3('0x5d')]);}})['then'](respondWithResult(_0xa781c2,null))['catch'](handleError(_0xa781c2,null));};exports[_0x8ac3('0x70')]=function(_0x1b19a8,_0x57298d,_0x347b24){var _0x31c3d8={'raw':![],'where':{}};var _0x37c724={};var _0x5e71cc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8ac3('0x6a')]({'where':{'id':_0x1b19a8[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x57298d,null))[_0x8ac3('0x1e')](function(_0x5cc5a2){if(_0x5cc5a2){_0x37c724[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db[_0x8ac3('0x6f')][_0x8ac3('0x41')]);_0x37c724['query']=_['keys'](_0x1b19a8[_0x8ac3('0x44')]);_0x37c724['filters']=_[_0x8ac3('0x46')](_0x37c724[_0x8ac3('0x43')],_0x37c724[_0x8ac3('0x44')]);_0x31c3d8['attributes']=_[_0x8ac3('0x46')](_0x37c724[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x1b19a8[_0x8ac3('0x44')]['fields']));_0x31c3d8[_0x8ac3('0x48')]=_0x31c3d8[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x31c3d8[_0x8ac3('0x48')]:_0x37c724[_0x8ac3('0x43')];if(!_0x1b19a8[_0x8ac3('0x44')]['hasOwnProperty'](_0x8ac3('0x4b'))){_0x31c3d8[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x4c')]);_0x31c3d8[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x31c3d8[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x31c3d8['where']=qs['filters'](_[_0x8ac3('0x50')](_0x1b19a8[_0x8ac3('0x44')],_0x37c724[_0x8ac3('0x45')]));_0x31c3d8[_0x8ac3('0x4f')]['OpenchannelAccountId']=_0x5cc5a2['id'];if(_0x1b19a8[_0x8ac3('0x44')]['filter']){_0x31c3d8[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x31c3d8[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x31c3d8[_0x8ac3('0x48')],function(_0x47e536){var _0xc1988b={};_0xc1988b[_0x47e536]={'$like':'%'+_0x1b19a8['query'][_0x8ac3('0x51')]+'%'};return _0xc1988b;})});}_0x31c3d8=_[_0x8ac3('0x52')]({},_0x31c3d8,_0x1b19a8[_0x8ac3('0x55')]);return db[_0x8ac3('0x6f')]['count']({'where':_0x31c3d8[_0x8ac3('0x4f')]})['then'](function(_0x26be20){_0x5e71cc[_0x8ac3('0x2e')]=_0x26be20;if(_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x56')]){_0x31c3d8['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8ac3('0x58')](_0x31c3d8);})[_0x8ac3('0x1e')](function(_0x8786a2){_0x5e71cc['rows']=_0x8786a2;return _0x5e71cc;});}})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x57298d,_0x31c3d8))[_0x8ac3('0x28')](handleError(_0x57298d,null));};exports[_0x8ac3('0x71')]=function(_0x29d00c,_0x2ca4ab,_0x3ff0ea){return db['OpenchannelAccount']['find']({'where':{'id':_0x29d00c[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x2ca4ab,null))[_0x8ac3('0x1e')](function(_0x3a0c69){if(_0x3a0c69){return _0x3a0c69[_0x8ac3('0x71')](_0x29d00c[_0x8ac3('0x44')][_0x8ac3('0x6d')]);}})[_0x8ac3('0x1e')](respondWithStatusCode(_0x2ca4ab,null))[_0x8ac3('0x28')](handleError(_0x2ca4ab,null));};exports[_0x8ac3('0x72')]=function(_0x4b8fd4,_0xc412ab,_0x2825b4){var _0x345d81={'body':_0x4b8fd4[_0x8ac3('0x5d')],'channel':_0x8ac3('0x73')};var _0x310c3f=[];var _0x179b07=[];var _0x2ee4c7={};var _0x577b75=![];return db['CmContact'][_0x8ac3('0x66')]()[_0x8ac3('0x1e')](function(_0x3ff56d){if(!_0x3ff56d){throw new db[(_0x8ac3('0x74'))]['ValidationError'](_0x8ac3('0x75'));}_0x310c3f=_['difference'](_[_0x8ac3('0x5a')](_0x3ff56d),[_0x8ac3('0x76'),_0x8ac3('0x77')]);_0x179b07=_[_0x8ac3('0x78')](_[_0x8ac3('0x5a')](_0x3ff56d),['createdAt',_0x8ac3('0x77'),_0x8ac3('0x79'),'ListId']);if(_0x4b8fd4[_0x8ac3('0x5d')]['id']){delete _0x4b8fd4['body']['id'];}if(_[_0x8ac3('0x7a')](_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')])){throw new db[(_0x8ac3('0x74'))]['ValidationError'](_0x8ac3('0x7c'));}if(_[_0x8ac3('0x7a')](_0x4b8fd4['body'][_0x8ac3('0x5d')])||_0x4b8fd4[_0x8ac3('0x5d')]['body']===''){throw new db['Sequelize'][(_0x8ac3('0x7d'))](_0x8ac3('0x7e'));}if(_[_0x8ac3('0x7a')](_0x4b8fd4[_0x8ac3('0x5d')]['mapKey'])){throw new db[(_0x8ac3('0x74'))][(_0x8ac3('0x7d'))](_0x8ac3('0x7f')+_0x179b07);}if(!_[_0x8ac3('0x80')](_0x179b07,_0x4b8fd4['body'][_0x8ac3('0x81')])){throw new db[(_0x8ac3('0x74'))][(_0x8ac3('0x7d'))](_0x8ac3('0x82')+_0x179b07);}_0x2ee4c7[_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x81')]]=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')];})[_0x8ac3('0x1e')](function(){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x4b8fd4[_0x8ac3('0x64')]['id']},'include':[{'model':db[_0x8ac3('0x83')],'as':_0x8ac3('0x84'),'include':[{'model':db[_0x8ac3('0x85')],'as':_0x8ac3('0x86'),'where':_0x2ee4c7,'limit':0x1,'order':[[_0x8ac3('0x77'),_0x8ac3('0x87')]]}]},{'model':db[_0x8ac3('0x88')],'as':_0x8ac3('0x89')}]});})[_0x8ac3('0x1e')](handleEntityNotFound(_0xc412ab,null))['then'](function(_0x456be8){if(_0x456be8&&_0x456be8['List']){_0x345d81[_0x8ac3('0x8a')]=_0x456be8;_0x345d81[_0x8ac3('0x8b')]=_0x456be8['Applications'];_0x345d81[_0x8ac3('0x8c')]=_0x456be8[_0x8ac3('0x84')];_0x345d81[_0x8ac3('0x8b')]=_['orderBy'](_0x345d81['applications'],['priority'],[_0x8ac3('0x8d')]);if(_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x89')]){delete _0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x89')];}if(_0x345d81[_0x8ac3('0x8a')]['List']&&_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x84')][_0x8ac3('0x86')][_0x8ac3('0x49')]){return _0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x84')][_0x8ac3('0x86')][0x0];}var _0x46b3fd=_[_0x8ac3('0x18')](_0x4b8fd4['body'],{'firstName':_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')],'ListId':_0x456be8[_0x8ac3('0x8e')]});_0x46b3fd[_0x4b8fd4['body'][_0x8ac3('0x81')]]=_0x4b8fd4['body']['from'];return db[_0x8ac3('0x85')][_0x8ac3('0x5c')](_0x46b3fd,{'fields':_0x310c3f,'raw':!![]});}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xc412ab,null))['then'](function(_0x2909c5){_0x345d81[_0x8ac3('0x8f')]=_0x2909c5;if(_0x2909c5){var _0x429e3f={'ContactId':_0x2909c5['id'],'OpenchannelAccountId':_0x4b8fd4[_0x8ac3('0x64')]['id'],'from':(_0x2909c5[_0x8ac3('0x90')]||'')+'\x20'+(_0x2909c5[_0x8ac3('0x91')]||'')};var _0x252c61={'OpenchannelAccountId':_0x4b8fd4['params']['id'],'closed':![]};if(_0x4b8fd4[_0x8ac3('0x5d')]['threadId']){_0x252c61['threadId']=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')];return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':_0x252c61})['then'](function(_0x2ecdf5){if(_0x2ecdf5){return[_0x2ecdf5,![]];}_0x429e3f[_0x8ac3('0x92')]=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')];_0x429e3f['externalUrl']=_0x4b8fd4[_0x8ac3('0x5d')]['externalUrl'];return db['OpenchannelInteraction'][_0x8ac3('0x5c')](_0x429e3f)[_0x8ac3('0x1e')](function(_0x3f4a0c){return[_0x3f4a0c,!![]];});});}else{_0x252c61['threadId']=null;}_0x252c61[_0x8ac3('0x94')]=_0x2909c5['id'];return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':_0x252c61})[_0x8ac3('0x1e')](function(_0x35fafe){if(_0x35fafe){return[_0x35fafe,![]];}return db[_0x8ac3('0x93')]['create'](_0x429e3f)[_0x8ac3('0x1e')](function(_0x345910){return[_0x345910,!![]];});});}})[_0x8ac3('0x95')](function(_0x4367f8,_0x4d3d42){if(_0x4367f8){_0x577b75=_0x4d3d42;if(!_0x4d3d42){var _0x315af={'from':(_0x345d81[_0x8ac3('0x8f')]['firstName']||'')+'\x20'+(_0x345d81['contact'][_0x8ac3('0x91')]||'')};if(_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')]&&_0x4b8fd4[_0x8ac3('0x5d')]['messageId']&&_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')]!=_0x4b8fd4[_0x8ac3('0x5d')]['messageId']){_0x315af[_0x8ac3('0x92')]=_0x4b8fd4['body'][_0x8ac3('0x96')];}return _0x4367f8[_0x8ac3('0x35')](_0x315af);}else{return _0x4367f8;}}})[_0x8ac3('0x1e')](function(_0x5022fc){_0x345d81[_0x8ac3('0x97')]=_0x5022fc[_0x8ac3('0x37')]({'plain':!![]});_0x345d81[_0x8ac3('0x97')]['created']=_0x577b75;if(_0x345d81[_0x8ac3('0x97')][_0x8ac3('0x98')]){if(_0x345d81['account'][_0x8ac3('0x99')]){_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0x9a')]({'id':0x0,'priority':_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0x49')]+0x1,'app':_0x8ac3('0x9b'),'appdata':_0x8ac3('0x9c'),'interval':_0x8ac3('0x9d')});}}return db['OpenchannelMessage'][_0x8ac3('0x5c')]({'body':_0x4b8fd4['body'][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x4b8fd4[_0x8ac3('0x64')]['id'],'OpenchannelInteractionId':_0x5022fc['id'],'direction':'in','ContactId':_0x345d81['contact']['id'],'AttachmentId':_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x9e')]});})[_0x8ac3('0x1e')](function(_0x11b2a8){_0x345d81['message']=_0x11b2a8;if(_0x345d81[_0x8ac3('0x97')][_0x8ac3('0x9f')]){return db[_0x8ac3('0xa0')][_0x8ac3('0x5b')]({'attributes':['id',_0x8ac3('0x3b')],'where':{'id':_0x345d81['interaction']['UserId']}})[_0x8ac3('0x1e')](function(_0x5b9805){if(_0x5b9805){_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b9805['name']+','+(_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0xa2')]||0xa),'interval':_0x8ac3('0x9d')});_0x345d81[_0x8ac3('0xa3')]=![];}return respondWithRpcPromise(_0x8ac3('0xa4'),_0x8ac3('0xa5'),_0x345d81);});}return respondWithRpcPromise(_0x8ac3('0xa4'),_0x8ac3('0xa5'),_0x345d81);})['then'](function(_0x468999){respondWithRpcPromise(_0x8ac3('0xa6'),_0x8ac3('0xa6'),{'event':'notify','message':_0x468999},client9002);return _0x468999;})[_0x8ac3('0x1e')](respondWithResult(_0xc412ab,null))['catch'](handleError(_0xc412ab,null));};exports[_0x8ac3('0xa7')]=function(_0x4afb1d,_0xdac845,_0x2de1ae){return db['OpenchannelAccount'][_0x8ac3('0x6a')]({'where':{'id':_0x4afb1d['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xdac845,null))[_0x8ac3('0x1e')](function(_0x61e40){if(_0x61e40){return db[_0x8ac3('0xa8')][_0x8ac3('0xa9')](function(_0x13e9b7){return db[_0x8ac3('0x88')][_0x8ac3('0x36')]({'where':{'OpenchannelAccountId':_0x4afb1d[_0x8ac3('0x64')]['id']},'transaction':_0x13e9b7})[_0x8ac3('0x1e')](function(_0x14a710){var _0x1d0f09=_[_0x8ac3('0x3f')](_0x4afb1d[_0x8ac3('0x5d')],function(_0x126068){_0x126068['OpenchannelAccountId']=_0x4afb1d[_0x8ac3('0x64')]['id'];return _0x126068;});return db[_0x8ac3('0x88')][_0x8ac3('0xaa')](_0x1d0f09,{'transaction':_0x13e9b7});});})[_0x8ac3('0x1e')](function(){return db[_0x8ac3('0x88')][_0x8ac3('0xab')]({'where':{'OpenchannelAccountId':_0x4afb1d[_0x8ac3('0x64')]['id']},'order':_0x8ac3('0xac')});});}})[_0x8ac3('0x1e')](respondWithResult(_0xdac845,null))[_0x8ac3('0x28')](handleError(_0xdac845,null));};exports[_0x8ac3('0xad')]=function(_0x5c9227,_0x567215,_0x1ed4b2){var _0x1f9a8e={};var _0x182ce9={};var _0x27793c;var _0x5c45dd;return db[_0x8ac3('0x40')]['findOne']({'where':{'id':_0x5c9227['params']['id']}})['then'](handleEntityNotFound(_0x567215,null))[_0x8ac3('0x1e')](function(_0x1ec22a){if(_0x1ec22a){_0x27793c=_0x1ec22a;_0x182ce9[_0x8ac3('0x43')]=_['keys'](db[_0x8ac3('0x88')][_0x8ac3('0x41')]);_0x182ce9[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x5c9227[_0x8ac3('0x44')]);_0x182ce9[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x182ce9[_0x8ac3('0x43')],_0x182ce9[_0x8ac3('0x44')]);_0x1f9a8e[_0x8ac3('0x48')]=_['intersection'](_0x182ce9[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x5c9227['query'][_0x8ac3('0x47')]));_0x1f9a8e['attributes']=_0x1f9a8e[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x1f9a8e[_0x8ac3('0x48')]:_0x182ce9[_0x8ac3('0x43')];_0x1f9a8e[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x5c9227['query'][_0x8ac3('0x4e')]);_0x1f9a8e[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x5c9227[_0x8ac3('0x44')],_0x182ce9[_0x8ac3('0x45')]));if(_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x1f9a8e[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x1f9a8e[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x1f9a8e[_0x8ac3('0x48')],function(_0x4d9cf0){var _0x4d5a02={};_0x4d5a02[_0x4d9cf0]={'$like':'%'+_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x51')]+'%'};return _0x4d5a02;})});}_0x1f9a8e=_[_0x8ac3('0x52')]({},_0x1f9a8e,_0x5c9227['options']);return _0x27793c[_0x8ac3('0xad')](_0x1f9a8e);}})[_0x8ac3('0x1e')](function(_0x238280){if(_0x238280){_0x5c45dd=_0x238280[_0x8ac3('0x49')];if(!_0x5c9227['query']['hasOwnProperty'](_0x8ac3('0x4b'))){_0x1f9a8e[_0x8ac3('0x4c')]=qs['limit'](_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x4c')]);_0x1f9a8e[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}return _0x27793c[_0x8ac3('0xad')](_0x1f9a8e);}})[_0x8ac3('0x1e')](function(_0x1aff59){if(_0x1aff59){return _0x1aff59?{'count':_0x5c45dd,'rows':_0x1aff59}:null;}})['then'](respondWithResult(_0x567215,null))[_0x8ac3('0x28')](handleError(_0x567215,null));};exports['getInteractions']=function(_0x207e60,_0x1cf5f7,_0x3fc1e1){var _0xb95eaf={'raw':![],'where':{}};var _0x2d5e46={};var _0x43cd85={'count':0x0,'rows':[]};return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x207e60['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x1cf5f7,null))['then'](function(_0x1b839a){if(_0x1b839a){_0x2d5e46['model']=_['keys'](db[_0x8ac3('0x93')][_0x8ac3('0x41')]);_0x2d5e46[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x207e60[_0x8ac3('0x44')]);_0x2d5e46[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x2d5e46[_0x8ac3('0x43')],_0x2d5e46['query']);_0xb95eaf[_0x8ac3('0x48')]=_['intersection'](_0x2d5e46[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x207e60[_0x8ac3('0x44')]['fields']));_0xb95eaf['attributes']=_0xb95eaf['attributes'][_0x8ac3('0x49')]?_0xb95eaf[_0x8ac3('0x48')]:_0x2d5e46[_0x8ac3('0x43')];if(!_0x207e60['query'][_0x8ac3('0x4a')]('nolimit')){_0xb95eaf[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x207e60[_0x8ac3('0x44')]['limit']);_0xb95eaf[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x207e60['query']['offset']);}_0xb95eaf[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x207e60[_0x8ac3('0x44')]['sort']);_0xb95eaf[_0x8ac3('0x4f')]=qs['filters'](_[_0x8ac3('0x50')](_0x207e60[_0x8ac3('0x44')],_0x2d5e46['filters']));_0xb95eaf[_0x8ac3('0x4f')][_0x8ac3('0x67')]=_0x1b839a['id'];if(_0x207e60[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0xb95eaf[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0xb95eaf[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0xb95eaf['attributes'],function(_0x15fc9b){var _0x5364fe={};_0x5364fe[_0x15fc9b]={'$like':'%'+_0x207e60['query'][_0x8ac3('0x51')]+'%'};return _0x5364fe;})});}_0xb95eaf=_[_0x8ac3('0x52')]({},_0xb95eaf,_0x207e60[_0x8ac3('0x55')]);return db['OpenchannelInteraction'][_0x8ac3('0x2e')]({'where':_0xb95eaf[_0x8ac3('0x4f')]})[_0x8ac3('0x1e')](function(_0x16e08c){_0x43cd85['count']=_0x16e08c;if(_0x207e60[_0x8ac3('0x44')]['includeAll']){_0xb95eaf[_0x8ac3('0x57')]=[{'model':db[_0x8ac3('0x85')],'as':'Contact','required':![]},{'model':db[_0x8ac3('0xa0')],'as':_0x8ac3('0xae'),'attributes':[_0x8ac3('0x3b'),_0x8ac3('0xaf'),_0x8ac3('0xb0')],'required':![]},{'model':db['Tag'],'as':_0x8ac3('0xb1'),'attributes':['id','name',_0x8ac3('0xb2')],'where':_0x207e60['query'][_0x8ac3('0xb3')]?{'id':_0x207e60[_0x8ac3('0x44')][_0x8ac3('0xb3')]}:undefined,'required':_0x207e60[_0x8ac3('0x44')]['tag']?!![]:![]}];}return db[_0x8ac3('0x93')][_0x8ac3('0x58')](_0xb95eaf);})[_0x8ac3('0x1e')](function(_0x379df3){_0x43cd85[_0x8ac3('0x6b')]=_0x379df3;return _0x43cd85;});}})['then'](respondWithFilteredResult(_0x1cf5f7,_0xb95eaf))[_0x8ac3('0x28')](handleError(_0x1cf5f7,null));};exports['addAgents']=function(_0x590d23,_0xe2d227,_0x513ea1){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x590d23['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xe2d227,null))['then'](function(_0x1ac428){if(_0x1ac428){return _0x1ac428[_0x8ac3('0xb4')](_0x590d23[_0x8ac3('0x5d')]['ids'],_['omit'](_0x590d23[_0x8ac3('0x5d')],[_0x8ac3('0x6d'),'id'])||{})[_0x8ac3('0x95')](function(_0x304812){for(var _0x3fbec3=0x0;_0x3fbec3<_0x590d23['body']['ids'][_0x8ac3('0x49')];_0x3fbec3+=0x1){socket[_0x8ac3('0xb5')](_0x8ac3('0xb6'),{'UserId':Number(_0x590d23[_0x8ac3('0x5d')][_0x8ac3('0x6d')][_0x3fbec3]),'OpenchannelAccountId':Number(_0x590d23[_0x8ac3('0x64')]['id'])});}return _0x304812;});}})[_0x8ac3('0x1e')](respondWithResult(_0xe2d227,null))[_0x8ac3('0x28')](handleError(_0xe2d227,null));};exports[_0x8ac3('0xb7')]=function(_0xfd5e85,_0x32fe70,_0x46b556){return db['OpenchannelAccount']['find']({'where':{'id':_0xfd5e85[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x32fe70,null))[_0x8ac3('0x1e')](function(_0x4c6bab){if(_0x4c6bab){return _0x4c6bab[_0x8ac3('0xb7')](_0xfd5e85[_0x8ac3('0x44')]['ids'])[_0x8ac3('0x1e')](function(){if(_['isArray'](_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')])){for(var _0x124974=0x0;_0x124974<_0xfd5e85[_0x8ac3('0x44')]['ids'][_0x8ac3('0x49')];_0x124974+=0x1){socket[_0x8ac3('0xb5')](_0x8ac3('0xb8'),{'UserId':Number(_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')][_0x124974]),'OpenchannelAccountId':Number(_0xfd5e85[_0x8ac3('0x64')]['id'])});}}else{socket['emit'](_0x8ac3('0xb8'),{'UserId':Number(_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')]),'OpenchannelAccountId':Number(_0xfd5e85[_0x8ac3('0x64')]['id'])});}});}})[_0x8ac3('0x1e')](respondWithStatusCode(_0x32fe70,null))['catch'](handleError(_0x32fe70,null));};exports[_0x8ac3('0xb9')]=function(_0xac860,_0x115746,_0x4f4065){var _0xab61d3={};var _0x44704a={};var _0xbeeb96;var _0x24de10;return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0xac860['params']['id']}})['then'](handleEntityNotFound(_0x115746,null))[_0x8ac3('0x1e')](function(_0x45a03e){if(_0x45a03e){_0xbeeb96=_0x45a03e;_0x44704a[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db[_0x8ac3('0xa0')]['rawAttributes']);_0x44704a['query']=_[_0x8ac3('0x5a')](_0xac860[_0x8ac3('0x44')]);_0x44704a['filters']=_['intersection'](_0x44704a[_0x8ac3('0x43')],_0x44704a['query']);_0xab61d3[_0x8ac3('0x48')]=_['intersection'](_0x44704a[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0xac860[_0x8ac3('0x44')][_0x8ac3('0x47')]));_0xab61d3[_0x8ac3('0x48')]=_0xab61d3[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0xab61d3[_0x8ac3('0x48')]:_0x44704a[_0x8ac3('0x43')];_0xab61d3[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0xac860[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0xab61d3[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0xac860[_0x8ac3('0x44')],_0x44704a[_0x8ac3('0x45')]));if(_0xac860[_0x8ac3('0x44')]['filter']){_0xab61d3[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0xab61d3[_0x8ac3('0x4f')],{'$or':_['map'](_0xab61d3[_0x8ac3('0x48')],function(_0x21c28c){var _0xb3dab3={};_0xb3dab3[_0x21c28c]={'$like':'%'+_0xac860[_0x8ac3('0x44')]['filter']+'%'};return _0xb3dab3;})});}_0xab61d3=_['merge']({},_0xab61d3,_0xac860['options']);return _0xbeeb96[_0x8ac3('0xb9')](_0xab61d3);}})[_0x8ac3('0x1e')](function(_0x4e5016){if(_0x4e5016){_0x24de10=_0x4e5016[_0x8ac3('0x49')];if(!_0xac860['query'][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0xab61d3[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0xac860['query'][_0x8ac3('0x4c')]);_0xab61d3[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0xac860['query'][_0x8ac3('0x2c')]);}return _0xbeeb96[_0x8ac3('0xb9')](_0xab61d3);}})[_0x8ac3('0x1e')](function(_0x2db70c){if(_0x2db70c){return _0x2db70c?{'count':_0x24de10,'rows':_0x2db70c}:null;}})[_0x8ac3('0x1e')](respondWithResult(_0x115746,null))[_0x8ac3('0x28')](handleError(_0x115746,null));};exports[_0x8ac3('0x3c')]=function(_0x2d17a6,_0x21a53b,_0x3640fe){var _0x37ddff,_0x24cc8f,_0x3a37cd;if(_[_0x8ac3('0x7a')](_0x2d17a6['body'][_0x8ac3('0x5d')])||_0x2d17a6['body']['body']===''){throw new db['Sequelize'][(_0x8ac3('0x7d'))](_0x8ac3('0x7e'));}if(_['isNil'](_0x2d17a6[_0x8ac3('0x5d')]['to'])){}_0x37ddff=_0x2d17a6[_0x8ac3('0x5d')]['to'];return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x2d17a6[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))[_0x8ac3('0x1e')](function(_0x598e03){if(_0x598e03){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x598e03['id']},'include':[{'model':db[_0x8ac3('0x83')],'as':_0x8ac3('0x84'),'include':[{'model':db[_0x8ac3('0x85')],'as':_0x8ac3('0x86'),'where':{[_0x598e03[_0x8ac3('0x81')]]:_0x37ddff},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))[_0x8ac3('0x1e')](function(_0x456fc5){if(_0x456fc5&&_0x456fc5[_0x8ac3('0x84')]){_0x24cc8f=_0x456fc5['get']({'plain':!![]});if(_0x24cc8f[_0x8ac3('0x84')]&&_0x24cc8f['List']['Contacts'][_0x8ac3('0x49')]){return _0x24cc8f['List'][_0x8ac3('0x86')][0x0];}return db[_0x8ac3('0x85')][_0x8ac3('0x5c')](_[_0x8ac3('0x18')](_0x2d17a6[_0x8ac3('0x5d')],{'firstName':_0x37ddff,[_0x456fc5['mapKey']]:_0x37ddff,'phone':_0x37ddff,'ListId':_0x24cc8f[_0x8ac3('0x8e')]}));}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))['then'](function(_0x326908){if(_0x326908){_0x3a37cd=_0x326908;return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':{'ContactId':_0x3a37cd['id'],'closed':![],'OpenchannelAccountId':_0x24cc8f['id']}})[_0x8ac3('0x1e')](function(_0x4ef50d){if(_0x4ef50d){return[_0x4ef50d,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x2d17a6[_0x8ac3('0x5e')]['id'],'ContactId':_0x3a37cd['id'],'OpenchannelAccountId':_0x24cc8f['id'],'lastMsgDirection':'out','Messages':[_[_0x8ac3('0x52')](_0x2d17a6[_0x8ac3('0x5d')],{'read':![],'body':_0x2d17a6[_0x8ac3('0x5d')][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x24cc8f['id'],'UserId':_0x2d17a6[_0x8ac3('0x5e')]['id'],'ContactId':_0x3a37cd['id']})]},{'include':[{'model':db[_0x8ac3('0xba')],'as':'Messages'}]})[_0x8ac3('0x1e')](function(_0x547812){return[_0x547812,!![]];});});}})[_0x8ac3('0x95')](function(_0x5f564e,_0x49f0f1){if(_0x49f0f1){return _0x5f564e;}return db[_0x8ac3('0xba')][_0x8ac3('0x5c')](_[_0x8ac3('0x52')](_0x2d17a6['body'],{'read':![],'body':_0x2d17a6[_0x8ac3('0x5d')][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x24cc8f['id'],'OpenchannelInteractionId':_0x5f564e['id'],'UserId':_0x2d17a6['user']['id'],'ContactId':_0x3a37cd['id']}))[_0x8ac3('0x1e')](function(_0x5376ad){_0x5f564e[_0x8ac3('0xbb')][_0x8ac3('0xbc')]=[];_0x5f564e[_0x8ac3('0xbb')][_0x8ac3('0xbc')][_0x8ac3('0x9a')](_0x5376ad[_0x8ac3('0xbb')]);return _0x5f564e;});});}})[_0x8ac3('0x1e')](respondWithResult(_0x21a53b,null))[_0x8ac3('0x28')](handleError(_0x21a53b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index b95dc7f..37eef11 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 _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xda55,0x6d));var _0x5da5=function(_0x1fddfd,_0x153a74){_0x1fddfd=_0x1fddfd-0x0;var _0x595b32=_0xda55[_0x1fddfd];return _0x595b32;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4483,0x1a3));var _0x3448=function(_0x220333,_0x350bdb){_0x220333=_0x220333-0x0;var _0x2be9fb=_0x4483[_0x220333];return _0x2be9fb;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index bf6590a..f34408a 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(_0x15108c,_0x12795a){var _0x5e66ee=function(_0x5de6f3){while(--_0x5de6f3){_0x15108c['push'](_0x15108c['shift']());}};_0x5e66ee(++_0x12795a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x335ac6,_0xeaeed6){var _0x5f2582=function(_0x2e5435){while(--_0x2e5435){_0x335ac6['push'](_0x335ac6['shift']());}};_0x5f2582(++_0xeaeed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 6f0fe25..2db0776 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 _0x0647=['jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x0647,0xd0));var _0x7064=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x0647[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});config[_0x7064('0xb')]=_['defaults'](config['redis'],{'host':_0x7064('0xc'),'port':0x18eb});var socket=require(_0x7064('0xd'))(new Redis(config[_0x7064('0xb')]));require('./openchannelAccount.socket')[_0x7064('0xe')](socket);function respondWithRpcPromise(_0x3f3bdd,_0x5f4ba5,_0xd2aec9){return new BPromise(function(_0x1465bd,_0x3fc84f){return client['request'](_0x3f3bdd,_0xd2aec9)[_0x7064('0xf')](function(_0x17a558){logger[_0x7064('0x10')](_0x7064('0x11'),_0x5f4ba5,'request\x20sent');logger[_0x7064('0x12')](_0x7064('0x13'),_0x5f4ba5,_0x7064('0x14'),JSON[_0x7064('0x15')](_0x17a558));if(_0x17a558[_0x7064('0x16')]){if(_0x17a558[_0x7064('0x16')][_0x7064('0x17')]===0x1f4){logger[_0x7064('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5f4ba5,_0x17a558['error']['message']);return _0x3fc84f(_0x17a558[_0x7064('0x16')][_0x7064('0x18')]);}logger[_0x7064('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5f4ba5,_0x17a558[_0x7064('0x16')][_0x7064('0x18')]);return _0x1465bd(_0x17a558['error'][_0x7064('0x18')]);}else{logger[_0x7064('0x10')](_0x7064('0x11'),_0x5f4ba5,_0x7064('0x14'));_0x1465bd(_0x17a558[_0x7064('0x19')][_0x7064('0x18')]);}})[_0x7064('0x1a')](function(_0x3e8d73){logger[_0x7064('0x16')](_0x7064('0x11'),_0x5f4ba5,_0x3e8d73);_0x3fc84f(_0x3e8d73);});});} \ No newline at end of file +var _0xbaf0=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','debug'];(function(_0x70e5f7,_0x5572b4){var _0xdc2a76=function(_0x3d60c6){while(--_0x3d60c6){_0x70e5f7['push'](_0x70e5f7['shift']());}};_0xdc2a76(++_0x5572b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index f03d489..bdead1f 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 _0x4156=['emit','removeListener','register','./openchannelAccount.events','save','remove','update'];(function(_0x1c1ace,_0x3af020){var _0x39bb1d=function(_0x13dd75){while(--_0x13dd75){_0x1c1ace['push'](_0x1c1ace['shift']());}};_0x39bb1d(++_0x3af020);}(_0x4156,0xf1));var _0x6415=function(_0x28ca90,_0x58f09c){_0x28ca90=_0x28ca90-0x0;var _0x3f37c7=_0x4156[_0x28ca90];return _0x3f37c7;};'use strict';var OpenchannelAccountEvents=require(_0x6415('0x0'));var events=[_0x6415('0x1'),_0x6415('0x2'),_0x6415('0x3')];function createListener(_0x9e13c0,_0x5438c5){return function(_0x138d73){_0x5438c5[_0x6415('0x4')](_0x9e13c0,_0x138d73);};}function removeListener(_0xfd06c2,_0x25732f){return function(){OpenchannelAccountEvents[_0x6415('0x5')](_0xfd06c2,_0x25732f);};}exports[_0x6415('0x6')]=function(_0x192a98){for(var _0x496a42=0x0,_0x24cb0=events['length'];_0x496a42<_0x24cb0;_0x496a42++){var _0x4045ec=events[_0x496a42];var _0x266237=createListener('openchannelAccount:'+_0x4045ec,_0x192a98);OpenchannelAccountEvents['on'](_0x4045ec,_0x266237);}}; \ No newline at end of file +var _0xbc8b=['emit','removeListener','register','save','update'];(function(_0x4f0f25,_0x5f5bdf){var _0x30e140=function(_0xa34e54){while(--_0xa34e54){_0x4f0f25['push'](_0x4f0f25['shift']());}};_0x30e140(++_0x5f5bdf);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xbc8b[_0x4dcc2d];return _0x1bbd79;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xbbc8('0x0'),'remove',_0xbbc8('0x1')];function createListener(_0x258371,_0x472e52){return function(_0x1bb600){_0x472e52[_0xbbc8('0x2')](_0x258371,_0x1bb600);};}function removeListener(_0x8abfdb,_0x49218a){return function(){OpenchannelAccountEvents[_0xbbc8('0x3')](_0x8abfdb,_0x49218a);};}exports[_0xbbc8('0x4')]=function(_0x15cdc6){for(var _0x21f15a=0x0,_0x18c3d7=events['length'];_0x21f15a<_0x18c3d7;_0x21f15a++){var _0x396aa2=events[_0x21f15a];var _0x313a01=createListener('openchannelAccount:'+_0x396aa2,_0x15cdc6);OpenchannelAccountEvents['on'](_0x396aa2,_0x313a01);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e32cd9e..cf44ee6 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 _0x07e8=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','show','post','create','put','/:id'];(function(_0x540ca7,_0x440def){var _0x12b30d=function(_0x2da2e6){while(--_0x2da2e6){_0x540ca7['push'](_0x540ca7['shift']());}};_0x12b30d(++_0x440def);}(_0x07e8,0x180));var _0x807e=function(_0x470eb0,_0xe2ea7){_0x470eb0=_0x470eb0-0x0;var _0x568183=_0x07e8[_0x470eb0];return _0x568183;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require('path');var timeout=require(_0x807e('0x2'));var express=require(_0x807e('0x3'));var router=express[_0x807e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x807e('0x5'));var config=require(_0x807e('0x6'));var controller=require(_0x807e('0x7'));router['get']('/',auth[_0x807e('0x8')](),controller['index']);router[_0x807e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x807e('0xa')]);router[_0x807e('0xb')]('/',auth['isAuthenticated'](),controller[_0x807e('0xc')]);router[_0x807e('0xd')](_0x807e('0xe'),auth[_0x807e('0x8')](),controller[_0x807e('0xf')]);router[_0x807e('0x10')](_0x807e('0xe'),auth[_0x807e('0x8')](),controller[_0x807e('0x11')]);module[_0x807e('0x12')]=router; \ No newline at end of file +var _0x49ae=['./openchannelApplication.controller','get','isAuthenticated','index','post','put','update','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24b81e,_0xfdf544){var _0x11ab4d=function(_0x5874a0){while(--_0x5874a0){_0x24b81e['push'](_0x24b81e['shift']());}};_0x11ab4d(++_0xfdf544);}(_0x49ae,0x196));var _0xe49a=function(_0x31a810,_0x32cbb){_0x31a810=_0x31a810-0x0;var _0x272fe7=_0x49ae[_0x31a810];return _0x272fe7;};'use strict';var multer=require('multer');var util=require(_0xe49a('0x0'));var path=require('path');var timeout=require(_0xe49a('0x1'));var express=require(_0xe49a('0x2'));var router=express[_0xe49a('0x3')]();var fs_extra=require(_0xe49a('0x4'));var auth=require(_0xe49a('0x5'));var interaction=require(_0xe49a('0x6'));var config=require(_0xe49a('0x7'));var controller=require(_0xe49a('0x8'));router[_0xe49a('0x9')]('/',auth[_0xe49a('0xa')](),controller[_0xe49a('0xb')]);router['get']('/:id',auth[_0xe49a('0xa')](),controller['show']);router[_0xe49a('0xc')]('/',auth[_0xe49a('0xa')](),controller['create']);router[_0xe49a('0xd')]('/:id',auth[_0xe49a('0xa')](),controller[_0xe49a('0xe')]);router['delete'](_0xe49a('0xf'),auth[_0xe49a('0xa')](),controller[_0xe49a('0x10')]);module[_0xe49a('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index ea333fb..3c1d4f9 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 _0xc76c=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0xc76c,0x1b4));var _0xcc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcc76('0x0')]={'priority':{'type':Sequelize[_0xcc76('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcc76('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcc76('0x3')]()},'description':{'type':Sequelize[_0xcc76('0x2')]},'interval':{'type':Sequelize[_0xcc76('0x2')],'defaultValue':_0xcc76('0x4')}}; \ No newline at end of file +var _0x6c9b=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6c9b,0x149));var _0xb6c9=function(_0x27278c,_0x2862ad){_0x27278c=_0x27278c-0x0;var _0x404579=_0x6c9b[_0x27278c];return _0x404579;};'use strict';var Sequelize=require('sequelize');module[_0xb6c9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb6c9('0x1')],'allowNull':![],'defaultValue':_0xb6c9('0x2')},'appdata':{'type':Sequelize[_0xb6c9('0x3')]()},'description':{'type':Sequelize[_0xb6c9('0x1')]},'interval':{'type':Sequelize[_0xb6c9('0x1')],'defaultValue':_0xb6c9('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8a47f4b..636b342 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 _0xe873=['model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','type'];(function(_0x23ac23,_0xca3bec){var _0x1b86a1=function(_0x151c3b){while(--_0x151c3b){_0x23ac23['push'](_0x23ac23['shift']());}};_0x1b86a1(++_0xca3bec);}(_0xe873,0x1bf));var _0x3e87=function(_0x7b4048,_0x35da93){_0x7b4048=_0x7b4048-0x0;var _0x30c7b9=_0xe873[_0x7b4048];return _0x30c7b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e87('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e87('0x1'));var rp=require(_0x3e87('0x2'));var moment=require(_0x3e87('0x3'));var BPromise=require(_0x3e87('0x4'));var Mustache=require('mustache');var util=require(_0x3e87('0x5'));var path=require(_0x3e87('0x6'));var sox=require(_0x3e87('0x7'));var csv=require(_0x3e87('0x8'));var ejs=require(_0x3e87('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e87('0xa'));var squel=require('squel');var crypto=require(_0x3e87('0xb'));var jsforce=require(_0x3e87('0xc'));var deskjs=require(_0x3e87('0xd'));var toCsv=require(_0x3e87('0x8'));var querystring=require('querystring');var Papa=require(_0x3e87('0xe'));var Redis=require(_0x3e87('0xf'));var authService=require(_0x3e87('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e87('0x11'))('api');var utils=require(_0x3e87('0x12'));var config=require(_0x3e87('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e87('0x14'))['db'];function respondWithStatusCode(_0xee1b2,_0x52d3b7){_0x52d3b7=_0x52d3b7||0xcc;return function(_0x34a004){if(_0x34a004){return _0xee1b2['sendStatus'](_0x52d3b7);}return _0xee1b2[_0x3e87('0x15')](_0x52d3b7)['end']();};}function respondWithResult(_0x5890de,_0xcb9b3c){_0xcb9b3c=_0xcb9b3c||0xc8;return function(_0x35367f){if(_0x35367f){return _0x5890de['status'](_0xcb9b3c)['json'](_0x35367f);}};}function respondWithFilteredResult(_0x27a76b,_0x407920){return function(_0x18f480){if(_0x18f480){var _0x2ac2a1=typeof _0x407920[_0x3e87('0x16')]===_0x3e87('0x17')&&typeof _0x407920[_0x3e87('0x18')]===_0x3e87('0x17');var _0x57acba=_0x18f480[_0x3e87('0x19')];var _0x5df0f4=_0x2ac2a1?0x0:_0x407920[_0x3e87('0x16')];var _0xc84c9c=_0x2ac2a1?_0x18f480['count']:_0x407920[_0x3e87('0x16')]+_0x407920[_0x3e87('0x18')];var _0x5e1c11;if(_0xc84c9c>=_0x57acba){_0xc84c9c=_0x57acba;_0x5e1c11=0xc8;}else{_0x5e1c11=0xce;}_0x27a76b[_0x3e87('0x15')](_0x5e1c11);return _0x27a76b[_0x3e87('0x1a')](_0x3e87('0x1b'),_0x5df0f4+'-'+_0xc84c9c+'/'+_0x57acba)[_0x3e87('0x1c')](_0x18f480);}return null;};}function patchUpdates(_0x18cc84){return function(_0x56b379){try{jsonpatch[_0x3e87('0x1d')](_0x56b379,_0x18cc84,!![]);}catch(_0x3e7b9b){return BPromise[_0x3e87('0x1e')](_0x3e7b9b);}return _0x56b379[_0x3e87('0x1f')]();};}function saveUpdates(_0x4ea147,_0x48783d){return function(_0x4526f2){if(_0x4526f2){return _0x4526f2[_0x3e87('0x20')](_0x4ea147)[_0x3e87('0x21')](function(_0x5aa728){return _0x5aa728;});}return null;};}function removeEntity(_0x1317ba,_0x3f326e){return function(_0x305813){if(_0x305813){return _0x305813[_0x3e87('0x22')]()[_0x3e87('0x21')](function(){_0x1317ba[_0x3e87('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7092c,_0x28cb4c){return function(_0x469838){if(!_0x469838){_0xf7092c[_0x3e87('0x23')](0x194);}return _0x469838;};}function handleError(_0x33dd36,_0x5744d5){_0x5744d5=_0x5744d5||0x1f4;return function(_0x12e200){logger[_0x3e87('0x24')](_0x12e200[_0x3e87('0x25')]);if(_0x12e200[_0x3e87('0x26')]){delete _0x12e200[_0x3e87('0x26')];}_0x33dd36[_0x3e87('0x15')](_0x5744d5)['send'](_0x12e200);};}exports[_0x3e87('0x27')]=function(_0xeb033d,_0x231daa){var _0x561ee0={},_0x2159e8={},_0x1f5db8={'count':0x0,'rows':[]};var _0x4f3289=_[_0x3e87('0x28')](db['OpenchannelApplication']['rawAttributes'],function(_0x46b745){return{'name':_0x46b745[_0x3e87('0x29')],'type':_0x46b745[_0x3e87('0x2a')]['key']};});_0x2159e8[_0x3e87('0x2b')]=_[_0x3e87('0x28')](_0x4f3289,_0x3e87('0x26'));_0x2159e8[_0x3e87('0x2c')]=_[_0x3e87('0x2d')](_0xeb033d[_0x3e87('0x2c')]);_0x2159e8[_0x3e87('0x2e')]=_['intersection'](_0x2159e8[_0x3e87('0x2b')],_0x2159e8[_0x3e87('0x2c')]);_0x561ee0['attributes']=_[_0x3e87('0x2f')](_0x2159e8[_0x3e87('0x2b')],qs[_0x3e87('0x30')](_0xeb033d[_0x3e87('0x2c')][_0x3e87('0x30')]));_0x561ee0[_0x3e87('0x31')]=_0x561ee0[_0x3e87('0x31')]['length']?_0x561ee0[_0x3e87('0x31')]:_0x2159e8['model'];if(!_0xeb033d[_0x3e87('0x2c')][_0x3e87('0x32')](_0x3e87('0x33'))){_0x561ee0[_0x3e87('0x18')]=qs[_0x3e87('0x18')](_0xeb033d[_0x3e87('0x2c')][_0x3e87('0x18')]);_0x561ee0[_0x3e87('0x16')]=qs[_0x3e87('0x16')](_0xeb033d[_0x3e87('0x2c')]['offset']);}_0x561ee0['order']=qs[_0x3e87('0x34')](_0xeb033d[_0x3e87('0x2c')][_0x3e87('0x34')]);_0x561ee0[_0x3e87('0x35')]=qs[_0x3e87('0x2e')](_['pick'](_0xeb033d['query'],_0x2159e8['filters']),_0x4f3289);if(_0xeb033d[_0x3e87('0x2c')]['filter']){_0x561ee0[_0x3e87('0x35')]=_[_0x3e87('0x36')](_0x561ee0[_0x3e87('0x35')],{'$or':_[_0x3e87('0x28')](_0x4f3289,function(_0x3ba2db){if(_0x3ba2db[_0x3e87('0x2a')]!==_0x3e87('0x37')){var _0x1bdc8f={};_0x1bdc8f[_0x3ba2db[_0x3e87('0x26')]]={'$like':'%'+_0xeb033d[_0x3e87('0x2c')][_0x3e87('0x38')]+'%'};return _0x1bdc8f;}})});}_0x561ee0=_[_0x3e87('0x36')]({},_0x561ee0,_0xeb033d[_0x3e87('0x39')]);var _0x163f39={'where':_0x561ee0[_0x3e87('0x35')]};return db[_0x3e87('0x3a')]['count'](_0x163f39)['then'](function(_0x2bd889){_0x1f5db8[_0x3e87('0x19')]=_0x2bd889;if(_0xeb033d['query'][_0x3e87('0x3b')]){_0x561ee0[_0x3e87('0x3c')]=[{'all':!![]}];}return db[_0x3e87('0x3a')][_0x3e87('0x3d')](_0x561ee0);})['then'](function(_0x391cb6){_0x1f5db8['rows']=_0x391cb6;return _0x1f5db8;})[_0x3e87('0x21')](respondWithFilteredResult(_0x231daa,_0x561ee0))[_0x3e87('0x3e')](handleError(_0x231daa,null));};exports[_0x3e87('0x3f')]=function(_0x3ca8ed,_0x3c39a8){var _0x39fb27={'raw':!![],'where':{'id':_0x3ca8ed[_0x3e87('0x40')]['id']}},_0x876acf={};_0x876acf[_0x3e87('0x2b')]=_[_0x3e87('0x2d')](db[_0x3e87('0x3a')][_0x3e87('0x41')]);_0x876acf[_0x3e87('0x2c')]=_[_0x3e87('0x2d')](_0x3ca8ed[_0x3e87('0x2c')]);_0x876acf[_0x3e87('0x2e')]=_['intersection'](_0x876acf['model'],_0x876acf['query']);_0x39fb27[_0x3e87('0x31')]=_[_0x3e87('0x2f')](_0x876acf[_0x3e87('0x2b')],qs[_0x3e87('0x30')](_0x3ca8ed[_0x3e87('0x2c')][_0x3e87('0x30')]));_0x39fb27['attributes']=_0x39fb27[_0x3e87('0x31')][_0x3e87('0x42')]?_0x39fb27[_0x3e87('0x31')]:_0x876acf['model'];if(_0x3ca8ed[_0x3e87('0x2c')]['includeAll']){_0x39fb27['include']=[{'all':!![]}];}_0x39fb27=_[_0x3e87('0x36')]({},_0x39fb27,_0x3ca8ed[_0x3e87('0x39')]);return db[_0x3e87('0x3a')][_0x3e87('0x43')](_0x39fb27)[_0x3e87('0x21')](handleEntityNotFound(_0x3c39a8,null))['then'](respondWithResult(_0x3c39a8,null))[_0x3e87('0x3e')](handleError(_0x3c39a8,null));};exports[_0x3e87('0x44')]=function(_0x2c63aa,_0x5247ca){return db[_0x3e87('0x3a')][_0x3e87('0x44')](_0x2c63aa['body'],{})[_0x3e87('0x21')](respondWithResult(_0x5247ca,0xc9))[_0x3e87('0x3e')](handleError(_0x5247ca,null));};exports['update']=function(_0x27bc55,_0x527756){if(_0x27bc55[_0x3e87('0x45')]['id']){delete _0x27bc55[_0x3e87('0x45')]['id'];}return db['OpenchannelApplication'][_0x3e87('0x43')]({'where':{'id':_0x27bc55[_0x3e87('0x40')]['id']}})[_0x3e87('0x21')](handleEntityNotFound(_0x527756,null))['then'](saveUpdates(_0x27bc55[_0x3e87('0x45')],null))['then'](respondWithResult(_0x527756,null))[_0x3e87('0x3e')](handleError(_0x527756,null));};exports['destroy']=function(_0x38b121,_0x4715e6){return db[_0x3e87('0x3a')][_0x3e87('0x43')]({'where':{'id':_0x38b121[_0x3e87('0x40')]['id']}})[_0x3e87('0x21')](handleEntityNotFound(_0x4715e6,null))[_0x3e87('0x21')](removeEntity(_0x4715e6,null))[_0x3e87('0x3e')](handleError(_0x4715e6,null));}; \ No newline at end of file +var _0x5d74=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','keys','includeAll','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x3960c1,_0x25b449){var _0x57d66a=function(_0x346707){while(--_0x346707){_0x3960c1['push'](_0x3960c1['shift']());}};_0x57d66a(++_0x25b449);}(_0x5d74,0x82));var _0x45d7=function(_0x2c00ee,_0x5d89cc){_0x2c00ee=_0x2c00ee-0x0;var _0x3a52d6=_0x5d74[_0x2c00ee];return _0x3a52d6;};'use strict';var emlformat=require(_0x45d7('0x0'));var rimraf=require(_0x45d7('0x1'));var zipdir=require(_0x45d7('0x2'));var jsonpatch=require(_0x45d7('0x3'));var rp=require(_0x45d7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x45d7('0x5'));var path=require(_0x45d7('0x6'));var sox=require(_0x45d7('0x7'));var csv=require(_0x45d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45d7('0x9'));var squel=require('squel');var crypto=require(_0x45d7('0xa'));var jsforce=require(_0x45d7('0xb'));var deskjs=require(_0x45d7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x45d7('0xd'));var Redis=require(_0x45d7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x45d7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x45d7('0x10'))(_0x45d7('0x11'));var utils=require(_0x45d7('0x12'));var config=require(_0x45d7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x45d7('0x14'))['db'];function respondWithStatusCode(_0x45455a,_0x31056e){_0x31056e=_0x31056e||0xcc;return function(_0x4a6d60){if(_0x4a6d60){return _0x45455a[_0x45d7('0x15')](_0x31056e);}return _0x45455a[_0x45d7('0x16')](_0x31056e)[_0x45d7('0x17')]();};}function respondWithResult(_0x56ea6b,_0x335192){_0x335192=_0x335192||0xc8;return function(_0xbeff03){if(_0xbeff03){return _0x56ea6b['status'](_0x335192)['json'](_0xbeff03);}};}function respondWithFilteredResult(_0x44e8a6,_0x433863){return function(_0x4f138d){if(_0x4f138d){var _0x5d46e9=typeof _0x433863[_0x45d7('0x18')]===_0x45d7('0x19')&&typeof _0x433863[_0x45d7('0x1a')]===_0x45d7('0x19');var _0x475239=_0x4f138d[_0x45d7('0x1b')];var _0x4bb2f6=_0x5d46e9?0x0:_0x433863[_0x45d7('0x18')];var _0x225da6=_0x5d46e9?_0x4f138d[_0x45d7('0x1b')]:_0x433863[_0x45d7('0x18')]+_0x433863[_0x45d7('0x1a')];var _0x320cee;if(_0x225da6>=_0x475239){_0x225da6=_0x475239;_0x320cee=0xc8;}else{_0x320cee=0xce;}_0x44e8a6[_0x45d7('0x16')](_0x320cee);return _0x44e8a6[_0x45d7('0x1c')](_0x45d7('0x1d'),_0x4bb2f6+'-'+_0x225da6+'/'+_0x475239)[_0x45d7('0x1e')](_0x4f138d);}return null;};}function patchUpdates(_0x54aa59){return function(_0x386a1a){try{jsonpatch[_0x45d7('0x1f')](_0x386a1a,_0x54aa59,!![]);}catch(_0x274edd){return BPromise['reject'](_0x274edd);}return _0x386a1a[_0x45d7('0x20')]();};}function saveUpdates(_0x5eb1b1,_0x5566ed){return function(_0x3f25d8){if(_0x3f25d8){return _0x3f25d8['update'](_0x5eb1b1)[_0x45d7('0x21')](function(_0x20fd2a){return _0x20fd2a;});}return null;};}function removeEntity(_0x3adde6,_0x41286d){return function(_0x373f8f){if(_0x373f8f){return _0x373f8f[_0x45d7('0x22')]()[_0x45d7('0x21')](function(){_0x3adde6[_0x45d7('0x16')](0xcc)[_0x45d7('0x17')]();});}};}function handleEntityNotFound(_0xc9584b,_0x3e4436){return function(_0x557cb2){if(!_0x557cb2){_0xc9584b[_0x45d7('0x15')](0x194);}return _0x557cb2;};}function handleError(_0x25b75a,_0x461cf9){_0x461cf9=_0x461cf9||0x1f4;return function(_0x4cae1a){logger[_0x45d7('0x23')](_0x4cae1a[_0x45d7('0x24')]);if(_0x4cae1a[_0x45d7('0x25')]){delete _0x4cae1a[_0x45d7('0x25')];}_0x25b75a[_0x45d7('0x16')](_0x461cf9)[_0x45d7('0x26')](_0x4cae1a);};}exports[_0x45d7('0x27')]=function(_0x191d2d,_0x365052){var _0x5e3892={},_0x2c91c3={},_0x308dcd={'count':0x0,'rows':[]};var _0x1d371b=_[_0x45d7('0x28')](db[_0x45d7('0x29')][_0x45d7('0x2a')],function(_0x439bb2){return{'name':_0x439bb2[_0x45d7('0x2b')],'type':_0x439bb2[_0x45d7('0x2c')][_0x45d7('0x2d')]};});_0x2c91c3[_0x45d7('0x2e')]=_[_0x45d7('0x28')](_0x1d371b,_0x45d7('0x25'));_0x2c91c3[_0x45d7('0x2f')]=_['keys'](_0x191d2d[_0x45d7('0x2f')]);_0x2c91c3[_0x45d7('0x30')]=_['intersection'](_0x2c91c3['model'],_0x2c91c3['query']);_0x5e3892['attributes']=_[_0x45d7('0x31')](_0x2c91c3[_0x45d7('0x2e')],qs['fields'](_0x191d2d['query'][_0x45d7('0x32')]));_0x5e3892[_0x45d7('0x33')]=_0x5e3892[_0x45d7('0x33')][_0x45d7('0x34')]?_0x5e3892[_0x45d7('0x33')]:_0x2c91c3[_0x45d7('0x2e')];if(!_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x35')](_0x45d7('0x36'))){_0x5e3892[_0x45d7('0x1a')]=qs[_0x45d7('0x1a')](_0x191d2d[_0x45d7('0x2f')]['limit']);_0x5e3892['offset']=qs[_0x45d7('0x18')](_0x191d2d[_0x45d7('0x2f')]['offset']);}_0x5e3892['order']=qs[_0x45d7('0x37')](_0x191d2d[_0x45d7('0x2f')]['sort']);_0x5e3892[_0x45d7('0x38')]=qs[_0x45d7('0x30')](_['pick'](_0x191d2d[_0x45d7('0x2f')],_0x2c91c3[_0x45d7('0x30')]),_0x1d371b);if(_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x39')]){_0x5e3892[_0x45d7('0x38')]=_[_0x45d7('0x3a')](_0x5e3892[_0x45d7('0x38')],{'$or':_['map'](_0x1d371b,function(_0x583779){if(_0x583779[_0x45d7('0x2c')]!==_0x45d7('0x3b')){var _0x322479={};_0x322479[_0x583779[_0x45d7('0x25')]]={'$like':'%'+_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x39')]+'%'};return _0x322479;}})});}_0x5e3892=_['merge']({},_0x5e3892,_0x191d2d[_0x45d7('0x3c')]);var _0x9de60f={'where':_0x5e3892['where']};return db[_0x45d7('0x29')][_0x45d7('0x1b')](_0x9de60f)[_0x45d7('0x21')](function(_0x43f7a7){_0x308dcd[_0x45d7('0x1b')]=_0x43f7a7;if(_0x191d2d['query']['includeAll']){_0x5e3892[_0x45d7('0x3d')]=[{'all':!![]}];}return db[_0x45d7('0x29')][_0x45d7('0x3e')](_0x5e3892);})['then'](function(_0x54053d){_0x308dcd[_0x45d7('0x3f')]=_0x54053d;return _0x308dcd;})[_0x45d7('0x21')](respondWithFilteredResult(_0x365052,_0x5e3892))[_0x45d7('0x40')](handleError(_0x365052,null));};exports['show']=function(_0xeb8d02,_0x186506){var _0x3274ea={'raw':!![],'where':{'id':_0xeb8d02['params']['id']}},_0x189699={};_0x189699[_0x45d7('0x2e')]=_[_0x45d7('0x41')](db['OpenchannelApplication'][_0x45d7('0x2a')]);_0x189699[_0x45d7('0x2f')]=_[_0x45d7('0x41')](_0xeb8d02[_0x45d7('0x2f')]);_0x189699[_0x45d7('0x30')]=_[_0x45d7('0x31')](_0x189699[_0x45d7('0x2e')],_0x189699[_0x45d7('0x2f')]);_0x3274ea['attributes']=_['intersection'](_0x189699[_0x45d7('0x2e')],qs[_0x45d7('0x32')](_0xeb8d02[_0x45d7('0x2f')][_0x45d7('0x32')]));_0x3274ea[_0x45d7('0x33')]=_0x3274ea[_0x45d7('0x33')][_0x45d7('0x34')]?_0x3274ea[_0x45d7('0x33')]:_0x189699[_0x45d7('0x2e')];if(_0xeb8d02[_0x45d7('0x2f')][_0x45d7('0x42')]){_0x3274ea[_0x45d7('0x3d')]=[{'all':!![]}];}_0x3274ea=_[_0x45d7('0x3a')]({},_0x3274ea,_0xeb8d02[_0x45d7('0x3c')]);return db[_0x45d7('0x29')]['find'](_0x3274ea)[_0x45d7('0x21')](handleEntityNotFound(_0x186506,null))[_0x45d7('0x21')](respondWithResult(_0x186506,null))[_0x45d7('0x40')](handleError(_0x186506,null));};exports['create']=function(_0x230cc2,_0x5915e4){return db['OpenchannelApplication'][_0x45d7('0x43')](_0x230cc2['body'],{})[_0x45d7('0x21')](respondWithResult(_0x5915e4,0xc9))[_0x45d7('0x40')](handleError(_0x5915e4,null));};exports[_0x45d7('0x44')]=function(_0x408fe9,_0x2bc4e1){if(_0x408fe9[_0x45d7('0x45')]['id']){delete _0x408fe9[_0x45d7('0x45')]['id'];}return db['OpenchannelApplication'][_0x45d7('0x46')]({'where':{'id':_0x408fe9[_0x45d7('0x47')]['id']}})[_0x45d7('0x21')](handleEntityNotFound(_0x2bc4e1,null))[_0x45d7('0x21')](saveUpdates(_0x408fe9[_0x45d7('0x45')],null))[_0x45d7('0x21')](respondWithResult(_0x2bc4e1,null))[_0x45d7('0x40')](handleError(_0x2bc4e1,null));};exports['destroy']=function(_0xee1005,_0x3bb668){return db[_0x45d7('0x29')]['find']({'where':{'id':_0xee1005['params']['id']}})[_0x45d7('0x21')](handleEntityNotFound(_0x3bb668,null))[_0x45d7('0x21')](removeEntity(_0x3bb668,null))['catch'](handleError(_0x3bb668,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a335479..36d5920 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 _0xd0d1=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','OpenchannelApplication'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xd0d1,0xaa));var _0x1d0d=function(_0x5c6aa9,_0x2f4026){_0x5c6aa9=_0x5c6aa9-0x0;var _0x5b527f=_0xd0d1[_0x5c6aa9];return _0x5b527f;};'use strict';var _=require(_0x1d0d('0x0'));var util=require(_0x1d0d('0x1'));var logger=require('../../config/logger')(_0x1d0d('0x2'));var moment=require(_0x1d0d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1d0d('0x4'));var fs=require('fs');var path=require(_0x1d0d('0x5'));var rimraf=require(_0x1d0d('0x6'));var config=require(_0x1d0d('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x1d0d('0x8')]=function(_0x28aebe,_0x2bb570){return _0x28aebe['define'](_0x1d0d('0x9'),attributes,{'tableName':_0x1d0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1d0d('0xb')});}; \ No newline at end of file +var _0xc12c=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./openchannelApplication.attributes'];(function(_0x412a61,_0x3aa608){var _0xb283e5=function(_0x2087ca){while(--_0x2087ca){_0x412a61['push'](_0x412a61['shift']());}};_0xb283e5(++_0x3aa608);}(_0xc12c,0x191));var _0xcc12=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc12c[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xcc12('0x0'));var util=require(_0xcc12('0x1'));var logger=require('../../config/logger')(_0xcc12('0x2'));var moment=require(_0xcc12('0x3'));var BPromise=require(_0xcc12('0x4'));var rp=require(_0xcc12('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc12('0x6'));module[_0xcc12('0x7')]=function(_0x2458b0,_0x2dafff){return _0x2458b0[_0xcc12('0x8')](_0xcc12('0x9'),attributes,{'tableName':_0xcc12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc12('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 6cb228b..9d8d44a 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 _0xac51=['UpdateOpenchannelApplication','OpenchannelApplication','update','options','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch'];(function(_0xdde798,_0xf77fd9){var _0x24fa0d=function(_0x122d31){while(--_0x122d31){_0xdde798['push'](_0xdde798['shift']());}};_0x24fa0d(++_0xf77fd9);}(_0xac51,0x127));var _0x1ac5=function(_0x1c2d01,_0x55590b){_0x1c2d01=_0x1c2d01-0x0;var _0x2fe07e=_0xac51[_0x1c2d01];return _0x2fe07e;};'use strict';var _=require(_0x1ac5('0x0'));var util=require('util');var moment=require(_0x1ac5('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ac5('0x2'));var fs=require('fs');var Redis=require(_0x1ac5('0x3'));var db=require(_0x1ac5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac5('0x5'))(_0x1ac5('0x6'));var config=require(_0x1ac5('0x7'));var jayson=require(_0x1ac5('0x8'));var client=jayson[_0x1ac5('0x9')][_0x1ac5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55ab77,_0x3cd71d,_0x207a13){return new BPromise(function(_0x20dce8,_0x56ec0b){return client[_0x1ac5('0xb')](_0x55ab77,_0x207a13)[_0x1ac5('0xc')](function(_0x487a8f){logger[_0x1ac5('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x3cd71d,_0x1ac5('0xe'));logger[_0x1ac5('0xf')](_0x1ac5('0x10'),_0x3cd71d,_0x1ac5('0xe'),JSON[_0x1ac5('0x11')](_0x487a8f));if(_0x487a8f['error']){if(_0x487a8f[_0x1ac5('0x12')][_0x1ac5('0x13')]===0x1f4){logger[_0x1ac5('0x12')](_0x1ac5('0x14'),_0x3cd71d,_0x487a8f[_0x1ac5('0x12')][_0x1ac5('0x15')]);return _0x56ec0b(_0x487a8f[_0x1ac5('0x12')][_0x1ac5('0x15')]);}logger[_0x1ac5('0x12')](_0x1ac5('0x14'),_0x3cd71d,_0x487a8f[_0x1ac5('0x12')]['message']);return _0x20dce8(_0x487a8f[_0x1ac5('0x12')][_0x1ac5('0x15')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x3cd71d,_0x1ac5('0xe'));_0x20dce8(_0x487a8f[_0x1ac5('0x16')][_0x1ac5('0x15')]);}})[_0x1ac5('0x17')](function(_0x3b256a){logger[_0x1ac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x3cd71d,_0x3b256a);_0x56ec0b(_0x3b256a);});});}exports[_0x1ac5('0x18')]=function(_0x4eec9b){var _0x3c381c=this;return new Promise(function(_0x415f30,_0x7d2aac){return db[_0x1ac5('0x19')][_0x1ac5('0x1a')](_0x4eec9b['body'],{'raw':_0x4eec9b[_0x1ac5('0x1b')]?_0x4eec9b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eec9b[_0x1ac5('0x1b')]?_0x4eec9b['options']['where']||null:null,'attributes':_0x4eec9b[_0x1ac5('0x1b')]?_0x4eec9b[_0x1ac5('0x1b')][_0x1ac5('0x1c')]||null:null,'limit':_0x4eec9b[_0x1ac5('0x1b')]?_0x4eec9b[_0x1ac5('0x1b')]['limit']||null:null})[_0x1ac5('0xc')](function(_0x567d3f){logger['info'](_0x1ac5('0x18'),_0x4eec9b);logger[_0x1ac5('0xf')]('UpdateOpenchannelApplication',_0x4eec9b,JSON[_0x1ac5('0x11')](_0x567d3f));_0x415f30(_0x567d3f);})['catch'](function(_0x10c6aa){logger[_0x1ac5('0x12')](_0x1ac5('0x18'),_0x10c6aa[_0x1ac5('0x15')],_0x4eec9b);_0x7d2aac(_0x3c381c[_0x1ac5('0x12')](0x1f4,_0x10c6aa[_0x1ac5('0x15')]));});});}; \ No newline at end of file +var _0x8e14=['request\x20sent','debug','stringify','error','message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x8e14,0xa5));var _0x48e1=function(_0x1bbbac,_0x5b2538){_0x1bbbac=_0x1bbbac-0x0;var _0xcbf2ea=_0x8e14[_0x1bbbac];return _0xcbf2ea;};'use strict';var _=require(_0x48e1('0x0'));var util=require(_0x48e1('0x1'));var moment=require(_0x48e1('0x2'));var BPromise=require(_0x48e1('0x3'));var rs=require(_0x48e1('0x4'));var fs=require('fs');var Redis=require(_0x48e1('0x5'));var db=require(_0x48e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x48e1('0x7'))(_0x48e1('0x8'));var config=require(_0x48e1('0x9'));var jayson=require(_0x48e1('0xa'));var client=jayson[_0x48e1('0xb')][_0x48e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e43bc,_0x39fbe5,_0x1be8da){return new BPromise(function(_0x4c9480,_0x33058a){return client['request'](_0x4e43bc,_0x1be8da)[_0x48e1('0xd')](function(_0x5cb7eb){logger['info'](_0x48e1('0xe'),_0x39fbe5,_0x48e1('0xf'));logger[_0x48e1('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x39fbe5,_0x48e1('0xf'),JSON[_0x48e1('0x11')](_0x5cb7eb));if(_0x5cb7eb[_0x48e1('0x12')]){if(_0x5cb7eb[_0x48e1('0x12')]['code']===0x1f4){logger[_0x48e1('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x39fbe5,_0x5cb7eb[_0x48e1('0x12')][_0x48e1('0x13')]);return _0x33058a(_0x5cb7eb[_0x48e1('0x12')]['message']);}logger['error'](_0x48e1('0xe'),_0x39fbe5,_0x5cb7eb[_0x48e1('0x12')][_0x48e1('0x13')]);return _0x4c9480(_0x5cb7eb[_0x48e1('0x12')]['message']);}else{logger[_0x48e1('0x14')](_0x48e1('0xe'),_0x39fbe5,'request\x20sent');_0x4c9480(_0x5cb7eb[_0x48e1('0x15')]['message']);}})[_0x48e1('0x16')](function(_0x2d681a){logger[_0x48e1('0x12')](_0x48e1('0xe'),_0x39fbe5,_0x2d681a);_0x33058a(_0x2d681a);});});}exports[_0x48e1('0x17')]=function(_0x409957){var _0x1ded76=this;return new Promise(function(_0x5764f7,_0x3ca98b){return db['OpenchannelApplication']['update'](_0x409957[_0x48e1('0x18')],{'raw':_0x409957[_0x48e1('0x19')]?_0x409957[_0x48e1('0x19')][_0x48e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409957[_0x48e1('0x19')]?_0x409957['options'][_0x48e1('0x1b')]||null:null,'attributes':_0x409957[_0x48e1('0x19')]?_0x409957[_0x48e1('0x19')][_0x48e1('0x1c')]||null:null,'limit':_0x409957['options']?_0x409957[_0x48e1('0x19')][_0x48e1('0x1d')]||null:null})[_0x48e1('0xd')](function(_0x3c5f36){logger[_0x48e1('0x14')](_0x48e1('0x17'),_0x409957);logger[_0x48e1('0x10')]('UpdateOpenchannelApplication',_0x409957,JSON[_0x48e1('0x11')](_0x3c5f36));_0x5764f7(_0x3c5f36);})[_0x48e1('0x16')](function(_0x88b15e){logger[_0x48e1('0x12')]('UpdateOpenchannelApplication',_0x88b15e[_0x48e1('0x13')],_0x409957);_0x3ca98b(_0x1ded76[_0x48e1('0x12')](0x1f4,_0x88b15e[_0x48e1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a26ed05..83c5481 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 _0x08e9=['isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','post','create','addMessage','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','removeTags','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x46fc1b,_0x3fd182){var _0x3dffd6=function(_0x352828){while(--_0x352828){_0x46fc1b['push'](_0x46fc1b['shift']());}};_0x3dffd6(++_0x3fd182);}(_0x08e9,0x9f));var _0x908e=function(_0x2577f2,_0x52a299){_0x2577f2=_0x2577f2-0x0;var _0x1b0666=_0x08e9[_0x2577f2];return _0x1b0666;};'use strict';var multer=require(_0x908e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x908e('0x1'));var express=require(_0x908e('0x2'));var router=express['Router']();var fs_extra=require(_0x908e('0x3'));var auth=require(_0x908e('0x4'));var interaction=require(_0x908e('0x5'));var config=require(_0x908e('0x6'));var controller=require(_0x908e('0x7'));router[_0x908e('0x8')]('/',auth[_0x908e('0x9')](),controller[_0x908e('0xa')]);router[_0x908e('0x8')](_0x908e('0xb'),auth[_0x908e('0x9')](),controller[_0x908e('0xc')]);router[_0x908e('0x8')](_0x908e('0xd'),auth[_0x908e('0x9')](),controller['show']);router[_0x908e('0x8')](_0x908e('0xe'),auth[_0x908e('0x9')](),controller['getMessages']);router[_0x908e('0x8')](_0x908e('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x908e('0x10')]('/',auth[_0x908e('0x9')](),controller[_0x908e('0x11')]);router['post'](_0x908e('0xe'),auth[_0x908e('0x9')](),controller[_0x908e('0x12')]);router[_0x908e('0x10')]('/:id/tags',auth[_0x908e('0x9')](),interaction['tracked'](_0x908e('0x13'),_0x908e('0x14')),controller[_0x908e('0x15')]);router[_0x908e('0x16')](_0x908e('0xd'),auth[_0x908e('0x9')](),interaction[_0x908e('0x17')]('openchannel',_0x908e('0x18')),controller[_0x908e('0x19')]);router[_0x908e('0x1a')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x908e('0x13'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x908e('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x908e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x243e=['/:id/tags','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','destroy'];(function(_0x4978bb,_0x1f558a){var _0x53b6f4=function(_0x21294a){while(--_0x21294a){_0x4978bb['push'](_0x4978bb['shift']());}};_0x53b6f4(++_0x1f558a);}(_0x243e,0x1c3));var _0xe243=function(_0xb21926,_0x13739d){_0xb21926=_0xb21926-0x0;var _0x44864a=_0x243e[_0xb21926];return _0x44864a;};'use strict';var multer=require(_0xe243('0x0'));var util=require(_0xe243('0x1'));var path=require('path');var timeout=require(_0xe243('0x2'));var express=require('express');var router=express[_0xe243('0x3')]();var fs_extra=require(_0xe243('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe243('0x5'));var config=require(_0xe243('0x6'));var controller=require(_0xe243('0x7'));router[_0xe243('0x8')]('/',auth[_0xe243('0x9')](),controller[_0xe243('0xa')]);router[_0xe243('0x8')](_0xe243('0xb'),auth[_0xe243('0x9')](),controller['describe']);router[_0xe243('0x8')](_0xe243('0xc'),auth['isAuthenticated'](),controller[_0xe243('0xd')]);router[_0xe243('0x8')](_0xe243('0xe'),auth[_0xe243('0x9')](),controller[_0xe243('0xf')]);router[_0xe243('0x8')](_0xe243('0x10'),auth[_0xe243('0x9')](),controller['download']);router[_0xe243('0x11')]('/',auth[_0xe243('0x9')](),controller[_0xe243('0x12')]);router['post']('/:id/messages',auth[_0xe243('0x9')](),controller[_0xe243('0x13')]);router[_0xe243('0x11')]('/:id/tags',auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),_0xe243('0x16')),controller[_0xe243('0x17')]);router[_0xe243('0x18')](_0xe243('0xc'),auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),_0xe243('0x19')),controller[_0xe243('0x1a')]);router[_0xe243('0x1b')](_0xe243('0xc'),auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),'openchannelinteraction:destroy'),controller[_0xe243('0x1c')]);router['delete'](_0xe243('0x1d'),auth[_0xe243('0x9')](),controller[_0xe243('0x1e')]);module[_0xe243('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6a066bb..4fe8df7 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 _0x3b59=['STRING','ENUM','sequelize','BOOLEAN','DATE'];(function(_0x808d5c,_0x2d5ed4){var _0x493b26=function(_0x254464){while(--_0x254464){_0x808d5c['push'](_0x808d5c['shift']());}};_0x493b26(++_0x2d5ed4);}(_0x3b59,0xc0));var _0x93b5=function(_0x1e94cc,_0x406860){_0x1e94cc=_0x1e94cc-0x0;var _0x47a54b=_0x3b59[_0x1e94cc];return _0x47a54b;};'use strict';var Sequelize=require(_0x93b5('0x0'));module['exports']={'closed':{'type':Sequelize[_0x93b5('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x93b5('0x2')]},'disposition':{'type':Sequelize[_0x93b5('0x3')]},'secondDisposition':{'type':Sequelize[_0x93b5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x93b5('0x3')]},'note':{'type':Sequelize[_0x93b5('0x3')]},'read1stAt':{'type':Sequelize[_0x93b5('0x2')]},'threadId':{'type':Sequelize[_0x93b5('0x3')]},'externalUrl':{'type':Sequelize[_0x93b5('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x93b5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x93b5('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x93b5('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xfaba=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x14adfa,_0x4bb7e8){var _0x139619=function(_0x2e21a6){while(--_0x2e21a6){_0x14adfa['push'](_0x14adfa['shift']());}};_0x139619(++_0x4bb7e8);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xafab('0x0'));module[_0xafab('0x1')]={'closed':{'type':Sequelize[_0xafab('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xafab('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xafab('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xafab('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xafab('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xafab('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xafab('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xafab('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 717ae9f..39b9736 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 _0x8260=['contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','sequelize','groupBy','OpenchannelInteractionId','all','rows','show','params','rawAttributes','includeAll','create','describe','addMessage','OpenchannelMessage','omit','findOne','filter','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','setTags','ids','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','files','tmp','join','attachments','format','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','OpenchannelInteraction','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','i.id'];(function(_0x5af86d,_0xca3ea3){var _0x1b9d05=function(_0x216ef0){while(--_0x216ef0){_0x5af86d['push'](_0x5af86d['shift']());}};_0x1b9d05(++_0xca3ea3);}(_0x8260,0x158));var _0x0826=function(_0x42446c,_0x106c25){_0x42446c=_0x42446c-0x0;var _0x29059d=_0x8260[_0x42446c];return _0x29059d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0826('0x0'));var zipdir=require(_0x0826('0x1'));var jsonpatch=require(_0x0826('0x2'));var rp=require(_0x0826('0x3'));var moment=require(_0x0826('0x4'));var BPromise=require(_0x0826('0x5'));var Mustache=require('mustache');var util=require(_0x0826('0x6'));var path=require('path');var sox=require(_0x0826('0x7'));var csv=require('to-csv');var ejs=require(_0x0826('0x8'));var fs=require('fs');var fs_extra=require(_0x0826('0x9'));var _=require(_0x0826('0xa'));var squel=require(_0x0826('0xb'));var crypto=require(_0x0826('0xc'));var jsforce=require(_0x0826('0xd'));var deskjs=require(_0x0826('0xe'));var toCsv=require(_0x0826('0xf'));var querystring=require(_0x0826('0x10'));var Papa=require(_0x0826('0x11'));var Redis=require(_0x0826('0x12'));var authService=require(_0x0826('0x13'));var qs=require(_0x0826('0x14'));var as=require(_0x0826('0x15'));var pdf=require(_0x0826('0x16'));var hardwareService=require(_0x0826('0x17'));var logger=require(_0x0826('0x18'))(_0x0826('0x19'));var utils=require(_0x0826('0x1a'));var config=require(_0x0826('0x1b'));var licenseUtil=require(_0x0826('0x1c'));var db=require(_0x0826('0x1d'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0826('0x1e'),'port':0x18eb});var socket=require(_0x0826('0x1f'))(new Redis(config[_0x0826('0x20')]));require(_0x0826('0x21'))['register'](socket);function respondWithStatusCode(_0x1e006c,_0xb0d36){_0xb0d36=_0xb0d36||0xcc;return function(_0x44988a){if(_0x44988a){return _0x1e006c[_0x0826('0x22')](_0xb0d36);}return _0x1e006c[_0x0826('0x23')](_0xb0d36)[_0x0826('0x24')]();};}function respondWithResult(_0x54bf0f,_0x2f04e5){_0x2f04e5=_0x2f04e5||0xc8;return function(_0x31a001){if(_0x31a001){return _0x54bf0f[_0x0826('0x23')](_0x2f04e5)[_0x0826('0x25')](_0x31a001);}};}function respondWithFilteredResult(_0x509493,_0x211d7b){return function(_0x3326c4){if(_0x3326c4){var _0x20b228=typeof _0x211d7b['offset']==='undefined'&&typeof _0x211d7b[_0x0826('0x26')]===_0x0826('0x27');var _0x779426=_0x3326c4[_0x0826('0x28')];var _0x4182e4=_0x20b228?0x0:_0x211d7b['offset'];var _0x2576d2=_0x20b228?_0x3326c4[_0x0826('0x28')]:_0x211d7b[_0x0826('0x29')]+_0x211d7b['limit'];var _0x1661d;if(_0x2576d2>=_0x779426){_0x2576d2=_0x779426;_0x1661d=0xc8;}else{_0x1661d=0xce;}_0x509493[_0x0826('0x23')](_0x1661d);return _0x509493[_0x0826('0x2a')]('Content-Range',_0x4182e4+'-'+_0x2576d2+'/'+_0x779426)[_0x0826('0x25')](_0x3326c4);}return null;};}function patchUpdates(_0x565a24){return function(_0x34bc7c){try{jsonpatch[_0x0826('0x2b')](_0x34bc7c,_0x565a24,!![]);}catch(_0x348ae7){return BPromise[_0x0826('0x2c')](_0x348ae7);}return _0x34bc7c[_0x0826('0x2d')]();};}function saveUpdates(_0x219d6c,_0x41f63a){return function(_0x2b0e8e){if(_0x2b0e8e){return _0x2b0e8e[_0x0826('0x2e')](_0x219d6c)[_0x0826('0x2f')](function(_0x1aa9dc){return _0x1aa9dc;});}return null;};}function removeEntity(_0x59605d,_0x2f8c24){return function(_0x1e8c21){if(_0x1e8c21){return _0x1e8c21[_0x0826('0x30')]()[_0x0826('0x2f')](function(){_0x59605d['status'](0xcc)[_0x0826('0x24')]();});}};}function handleEntityNotFound(_0x46a7fd,_0x182223){return function(_0x1ee637){if(!_0x1ee637){_0x46a7fd['sendStatus'](0x194);}return _0x1ee637;};}function handleError(_0x316240,_0x1ca03f){_0x1ca03f=_0x1ca03f||0x1f4;return function(_0x3fba3d){logger[_0x0826('0x31')](_0x3fba3d['stack']);if(_0x3fba3d['name']){delete _0x3fba3d[_0x0826('0x32')];}_0x316240[_0x0826('0x23')](_0x1ca03f)[_0x0826('0x33')](_0x3fba3d);};}function getInteractionUsers(_0x2e9e3f,_0x36ae9e){return new BPromise(function(_0x32bfd7,_0x3bce07){try{if(_0x36ae9e[_0x2e9e3f['id']]){_0x2e9e3f[_0x0826('0x34')]=_[_0x0826('0x35')](_0x36ae9e[_0x2e9e3f['id']],function(_0xebd159){return{'id':_0xebd159['id'],'fullname':_0xebd159[_0x0826('0x36')]};});}}catch(_0xa368b5){_0x3bce07(_0xa368b5);}_0x32bfd7(_0x2e9e3f);});}function getInteractionTags(_0x289571,_0x5f0db9){return new BPromise(function(_0x1413a8,_0x5ae8d6){try{if(_0x289571['TagIds']){_0x289571[_0x0826('0x37')]=[];_0x289571[_0x0826('0x38')][_0x0826('0x39')](',')[_0x0826('0x3a')](function(_0x4bbd79){_0x289571[_0x0826('0x37')][_0x0826('0x3b')](_0x5f0db9[_0x4bbd79]);});}delete _0x289571[_0x0826('0x38')];}catch(_0x3e0b25){_0x5ae8d6(_0x3e0b25);}_0x1413a8(_0x289571);});}function updateOpenchannelInteraction(_0x66c226,_0x2e614f,_0x48bd8e){return new BPromise(function(_0x718207,_0x187623){return getInteractionUsers(_0x66c226,_0x48bd8e)[_0x0826('0x2f')](function(_0x21c352){return getInteractionTags(_0x21c352,_0x2e614f);})['then'](function(_0x5ae9b8){_0x718207(_0x5ae9b8);})[_0x0826('0x3c')](function(_0x2efab0){_0x187623(_0x2efab0);});});}exports['index']=function(_0x5be701,_0x31ecb9){var _0x4e9db7={},_0x442a9a={},_0x5824d9={'count':0x0,'rows':[]};var _0x5d9628=_[_0x0826('0x35')](db[_0x0826('0x3d')]['rawAttributes'],function(_0x22634c){return{'name':_0x22634c[_0x0826('0x3e')],'type':_0x22634c[_0x0826('0x3f')][_0x0826('0x40')]};});_0x442a9a[_0x0826('0x41')]=_[_0x0826('0x35')](_0x5d9628,'name');_0x442a9a['query']=_[_0x0826('0x42')](_0x5be701[_0x0826('0x43')]);_0x442a9a['filters']=_['intersection'](_0x442a9a[_0x0826('0x41')],_0x442a9a[_0x0826('0x43')]);_0x4e9db7[_0x0826('0x44')]=_[_0x0826('0x45')](_0x442a9a[_0x0826('0x41')],qs[_0x0826('0x46')](_0x5be701[_0x0826('0x43')][_0x0826('0x46')]));_0x4e9db7[_0x0826('0x44')]=_0x4e9db7[_0x0826('0x44')][_0x0826('0x47')]?_0x4e9db7[_0x0826('0x44')]:_0x442a9a[_0x0826('0x41')];if(!_0x5be701['query'][_0x0826('0x48')](_0x0826('0x49'))){_0x4e9db7[_0x0826('0x26')]=qs[_0x0826('0x26')](_0x5be701[_0x0826('0x43')][_0x0826('0x26')]);_0x4e9db7[_0x0826('0x29')]=qs[_0x0826('0x29')](_0x5be701[_0x0826('0x43')][_0x0826('0x29')]);}_0x4e9db7[_0x0826('0x4a')]=qs['sort'](_0x5be701[_0x0826('0x43')][_0x0826('0x4b')]);_0x4e9db7[_0x0826('0x4c')]=qs[_0x0826('0x4d')](_[_0x0826('0x4e')](_0x5be701['query'],_0x442a9a['filters']),_0x5d9628);var _0x490ff9=[];var _0x1dc553=squel[_0x0826('0x4f')]()[_0x0826('0x50')]('id')[_0x0826('0x50')]('name')[_0x0826('0x50')](_0x0826('0x51'))['from'](_0x0826('0x52'));var _0x164e9a=squel['select']()[_0x0826('0x50')](_0x0826('0x53'))[_0x0826('0x50')]('u.fullname')['field']('ui.OpenchannelInteractionId')[_0x0826('0x54')](_0x0826('0x55'),'ui')[_0x0826('0x56')](_0x0826('0x57'),'u',_0x0826('0x58'));var _0x34230a=squel[_0x0826('0x4f')]()[_0x0826('0x54')](_0x0826('0x59'),'i')[_0x0826('0x56')](_0x0826('0x5a'),'c',_0x0826('0x5b'))[_0x0826('0x56')](_0x0826('0x57'),'o',_0x0826('0x5c'))[_0x0826('0x56')](_0x0826('0x5d'),'a',_0x0826('0x5e'))[_0x0826('0x56')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x0826('0x56')]('openchannel_interaction_has_tags','it',_0x0826('0x5f'))[_0x0826('0x56')](_0x0826('0x52'),'t',_0x0826('0x60'));var _0x18dc4c=squel['expr']();var _0xf10dc1=[];var _0x13bd28=squel[_0x0826('0x61')]();var _0x229952;if(_0x5be701[_0x0826('0x43')][_0x0826('0x62')]){_0x229952=as['parseSearch'](_0x5be701[_0x0826('0x43')][_0x0826('0x62')]);var _0x3d79eb=_0x229952['sqlOperator'];for(var _0x3e072d=0x0;_0x3e072d<_0x229952[_0x0826('0x63')][_0x0826('0x47')];_0x3e072d++){var _0xdac94=_0x229952[_0x0826('0x63')][_0x3e072d];var _0x35b087='i';var _0x16a8e0=_['find'](_0x5d9628,[_0x0826('0x32'),_0xdac94[_0x0826('0x50')]]);if(!_0x16a8e0){switch(_0xdac94['field']){case _0x0826('0x64'):if(_0xdac94[_0x0826('0x65')]==0x1){_0x34230a[_0x0826('0x66')]('`'+_0xdac94[_0x0826('0x50')]+_0x0826('0x67'));}else{_0x34230a[_0x0826('0x66')]('`'+_0xdac94[_0x0826('0x50')]+_0x0826('0x68'));}break;case _0x0826('0x69'):if(_0xdac94['operator']===_0x0826('0x6a')){if(_0xdac94[_0x0826('0x65')][_0x0826('0x39')]('\x20')[_0x0826('0x47')]>0x1){_0x18dc4c[_0x3d79eb](_0x0826('0x6b'),qs[_0x0826('0x6c')](_0xdac94[_0x0826('0x65')]),null);}else{var _0x2beef5='%'+_0xdac94[_0x0826('0x65')]+'%';_0x18dc4c[_0x3d79eb](_0x0826('0x6d'),_0x2beef5,_0x2beef5,_0x2beef5);}}else{_0x16a8e0=_[_0x0826('0x6e')](_0x5d9628,['name',_0x0826('0x6f')]);_0xdac94[_0x0826('0x50')]=_0x0826('0x6f');_0x51ae23=as[_0x0826('0x70')](_0x35b087,_0x16a8e0[_0x0826('0x3f')],_0xdac94);_0x18dc4c[_0x3d79eb](_0x51ae23['text'],_0x51ae23[_0x0826('0x65')][_0x0826('0x71')],_0x51ae23[_0x0826('0x65')][_0x0826('0x24')]);}break;case _0x0826('0x72'):var _0x5276e9=_0xdac94[_0x0826('0x65')][_0x0826('0x39')](',')[_0x0826('0x35')](function(_0x2232a6){return Number(_0x2232a6);});_0x5276e9[_0x0826('0x3a')](function(_0x5331cb){_0x13bd28['or'](_0x0826('0x73'),'%,'+_0x5331cb+',%');});_0xf10dc1=_[_0x0826('0x74')](_0xf10dc1,_0x5276e9);break;case _0x0826('0x75'):if(_0xdac94[_0x0826('0x76')]==='$substring'){_0x18dc4c[_0x3d79eb](_0x0826('0x77'),'%'+_0xdac94['value']+'%',null);}else{_0x16a8e0=_[_0x0826('0x6e')](_0x5d9628,[_0x0826('0x32'),_0x0826('0x78')]);_0xdac94[_0x0826('0x50')]=_0x0826('0x78');_0x51ae23=as[_0x0826('0x70')](_0x35b087,_0x16a8e0[_0x0826('0x3f')],_0xdac94);_0x18dc4c[_0x3d79eb](_0x51ae23[_0x0826('0x79')],_0x51ae23[_0x0826('0x65')][_0x0826('0x71')],_0x51ae23[_0x0826('0x65')][_0x0826('0x24')]);}break;case _0x0826('0x7a'):_0x51ae23=as['buildExpression']('me',null,_0xdac94);_0x18dc4c[_0x3d79eb](_0x51ae23[_0x0826('0x79')],_0x51ae23['value'][_0x0826('0x71')],_0x51ae23[_0x0826('0x65')]['end']);break;}}else{var _0x51ae23=as[_0x0826('0x70')](_0x35b087,_0x16a8e0[_0x0826('0x3f')],_0xdac94);_0x18dc4c[_0x3d79eb](_0x51ae23[_0x0826('0x79')],_0x51ae23[_0x0826('0x65')][_0x0826('0x71')],_0x51ae23['value']['end']);}}}else{var _0x462c3d=_(_0x5be701[_0x0826('0x43')])[_0x0826('0x42')]()[_0x0826('0x35')](function(_0x5240f9){return _[_0x0826('0x7b')](_0x5d9628,['name',_0x5240f9])?_0x5240f9:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x462c3d)){_0x462c3d[_0x0826('0x3a')](function(_0x227487){if(_0x227487===_0x0826('0x7c')){_0x34230a['where'](_0x0826('0x7d'),[][_0x0826('0x7e')](_0x5be701['query'][_0x227487]));}else if(_0x227487===_0x0826('0x7f')){var _0x2e3c28=JSON[_0x0826('0x80')](_0x5be701[_0x0826('0x43')][_0x227487])[_0x0826('0x81')];var _0x5c27dd=JSON[_0x0826('0x80')](_0x5be701[_0x0826('0x43')][_0x227487])[_0x0826('0x82')];_0x34230a[_0x0826('0x4c')](_0x0826('0x83'),_0x2e3c28,_0x5c27dd);}else{if(_0x5be701[_0x0826('0x43')][_0x227487]===_0x0826('0x84')){_0x34230a[_0x0826('0x4c')]('i.'+_0x227487+_0x0826('0x85'));}else{_0x34230a['where']('i.'+_0x227487+_0x0826('0x86'),_0x5be701['query'][_0x227487]);}}});}if(_0x5be701[_0x0826('0x43')]['read']){if(_0x5be701['query'][_0x0826('0x87')]==0x1){_0x34230a['having'](_0x0826('0x88'));}else{_0x34230a[_0x0826('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x5be701[_0x0826('0x43')][_0x0826('0x89')]){_0xf10dc1=_[_0x0826('0x8a')](_0x5be701['query'][_0x0826('0x89')])?_0x5be701[_0x0826('0x43')][_0x0826('0x89')]:new Array(_0x5be701[_0x0826('0x43')][_0x0826('0x89')]);_0xf10dc1['forEach'](function(_0x31ad5c){_0x13bd28['or'](_0x0826('0x73'),'%,'+_0x31ad5c+',%');});}if(_0x5be701[_0x0826('0x43')]['filter']){var _0x4f23c8=_0x5be701[_0x0826('0x43')]['filter'][_0x0826('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0826('0x8c')](_0x4f23c8)){_0x18dc4c['or'](_0x0826('0x8d'),_0x4f23c8+'%');}else{_0x18dc4c['or'](_0x0826('0x8e'),qs[_0x0826('0x6c')](_0x4f23c8))['or']('i.from\x20LIKE\x20?',_0x4f23c8+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4f23c8+'%');}}}_0x34230a['where'](_0x18dc4c);_0x34230a['group']('i.id');var _0x562ace={'type':db[_0x0826('0x8f')][_0x0826('0x90')]['SELECT'],'raw':!![]};var _0x3694ae=_0x34230a['clone']();_0x3694ae[_0x0826('0x50')](_0x0826('0x91'));_0x3694ae[_0x0826('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0826('0x64'));if(_0x4e9db7[_0x0826('0x4a')]){_0x4e9db7['order']['forEach'](function(_0x34e297){var _0x5c5c64=_0x34e297[0x0]===_0x0826('0x92')?_0x34e297[0x0]:'i.'+_0x34e297[0x0];_0x34230a[_0x0826('0x4a')](_0x5c5c64,_0x34e297[0x1]===_0x0826('0x93')?![]:!![]);});}if(!_[_0x0826('0x94')](_0xf10dc1)){_0x34230a[_0x0826('0x66')](_0x13bd28);_0x3694ae[_0x0826('0x4c')](_0x0826('0x95'),_0xf10dc1);}BPromise[_0x0826('0x96')]()['then'](function(){if(!_0x229952){if(_0x5be701['query'][_0x0826('0x7c')])return;_0x3694ae[_0x0826('0x4c')](_0x0826('0x97'));_0x34230a[_0x0826('0x4c')](_0x0826('0x97'));return;}if(_0x5be701[_0x0826('0x98')]['role']!==_0x0826('0x99'))return;return _0x5be701[_0x0826('0x98')][_0x0826('0x9a')]({'attributes':['id'],'raw':!![]})[_0x0826('0x2f')](function(_0x63eb31){if(_[_0x0826('0x94')](_0x63eb31)){_0x3694ae[_0x0826('0x4c')](_0x0826('0x9b'));_0x34230a['where'](_0x0826('0x9b'));}else{_0x3694ae[_0x0826('0x4c')](_0x0826('0x7d'),_[_0x0826('0x35')](_0x63eb31,'id'));_0x34230a[_0x0826('0x4c')](_0x0826('0x7d'),_[_0x0826('0x35')](_0x63eb31,'id'));}});})[_0x0826('0x2f')](function(){if(_0x5be701[_0x0826('0x98')][_0x0826('0x9c')]===_0x0826('0x99')&&!_0x229952&&!_0x5be701[_0x0826('0x43')]['OpenchannelAccountId'])return[];return db['sequelize'][_0x0826('0x43')](_0x3694ae[_0x0826('0x9d')](),_0x562ace);})[_0x0826('0x2f')](function(_0x491ffc){_0x5824d9[_0x0826('0x28')]=_0x491ffc[_0x0826('0x47')];if(_0x5824d9[_0x0826('0x28')]===0x0)return[];return db['sequelize'][_0x0826('0x43')](_0x1dc553[_0x0826('0x9d')](),_0x562ace)[_0x0826('0x2f')](function(_0x4dafd7){_0x490ff9=_['keyBy'](_0x4dafd7,'id');_0x562ace=_[_0x0826('0x9e')](_0x562ace,{'model':db[_0x0826('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5be701[_0x0826('0x43')][_0x0826('0x46')]){_0x4e9db7[_0x0826('0x44')][_0x0826('0x3a')](function(_0x38507e){_0x34230a[_0x0826('0x50')]('i.'+_0x38507e);});}else{_0x34230a[_0x0826('0x50')](_0x0826('0x9f'),_0x0826('0x64'));_0x34230a[_0x0826('0x50')](_0x0826('0xa0'),_0x0826('0xa1'));_0x34230a['field'](_0x0826('0xa2'),_0x0826('0xa3'));_0x34230a[_0x0826('0x50')](_0x0826('0xa4'),'contactName');_0x34230a['field'](_0x0826('0xa5'));_0x34230a[_0x0826('0x50')](_0x0826('0xa6'),'Contact.firstName');_0x34230a[_0x0826('0x50')](_0x0826('0xa7'),_0x0826('0xa8'));_0x34230a[_0x0826('0x50')](_0x0826('0xa9'),'Contact.email');_0x34230a[_0x0826('0x50')]('c.phone',_0x0826('0xaa'));_0x34230a[_0x0826('0x50')](_0x0826('0xab'),_0x0826('0xac'));_0x34230a[_0x0826('0x50')](_0x0826('0xad'),_0x0826('0xae'));_0x34230a[_0x0826('0x50')](_0x0826('0xaf'),'Owner.fullname');_0x34230a[_0x0826('0x50')](_0x0826('0xb0'),_0x0826('0xb1'));_0x34230a[_0x0826('0x50')](_0x0826('0xb2'),_0x0826('0x38'));}if(_0x4e9db7['limit'])_0x34230a[_0x0826('0x26')](_0x4e9db7[_0x0826('0x26')]);if(_0x4e9db7['offset'])_0x34230a[_0x0826('0x29')](_0x4e9db7[_0x0826('0x29')]);return db['sequelize'][_0x0826('0x43')](_0x34230a[_0x0826('0x9d')](),_0x562ace);})[_0x0826('0x2f')](function(_0x1a616f){if(_0x1a616f[_0x0826('0x47')]>0x0)_0x164e9a[_0x0826('0x4c')](_0x0826('0xb3'),_[_0x0826('0x35')](_0x1a616f,'id'));return db[_0x0826('0xb4')][_0x0826('0x43')](_0x164e9a[_0x0826('0x9d')](),_0x562ace)[_0x0826('0x2f')](function(_0x39f1de){var _0x2a25dc=_[_0x0826('0xb5')](_0x39f1de,_0x0826('0xb6'));var _0x12c844=[];_0x1a616f['forEach'](function(_0x166860){_0x12c844[_0x0826('0x3b')](updateOpenchannelInteraction(_0x166860,_0x490ff9,_0x2a25dc));});return BPromise[_0x0826('0xb7')](_0x12c844);});});})[_0x0826('0x2f')](function(_0x58bc06){_0x5824d9[_0x0826('0xb8')]=_0x58bc06;return _0x5824d9;})[_0x0826('0x2f')](respondWithFilteredResult(_0x31ecb9,_0x4e9db7))[_0x0826('0x3c')](handleError(_0x31ecb9,null));};exports[_0x0826('0xb9')]=function(_0x4ed3ea,_0x5277f2){var _0x2f1230={};if(_0x4ed3ea[_0x0826('0x43')][_0x0826('0x3f')]&&_0x4ed3ea[_0x0826('0x43')][_0x0826('0x3f')]==='from'){_0x2f1230['from']=_0x4ed3ea[_0x0826('0xba')]['id'];}else{_0x2f1230['id']=_0x4ed3ea[_0x0826('0xba')]['id'];}var _0x4cc727={'raw':![],'where':_0x2f1230},_0x489635={};_0x489635[_0x0826('0x41')]=_[_0x0826('0x42')](db['OpenchannelInteraction'][_0x0826('0xbb')]);_0x489635[_0x0826('0x43')]=_[_0x0826('0x42')](_0x4ed3ea[_0x0826('0x43')]);_0x489635[_0x0826('0x4d')]=_[_0x0826('0x45')](_0x489635[_0x0826('0x41')],_0x489635[_0x0826('0x43')]);_0x4cc727[_0x0826('0x44')]=_[_0x0826('0x45')](_0x489635[_0x0826('0x41')],qs['fields'](_0x4ed3ea['query'][_0x0826('0x46')]));_0x4cc727[_0x0826('0x44')]=_0x4cc727[_0x0826('0x44')][_0x0826('0x47')]?_0x4cc727['attributes']:_0x489635[_0x0826('0x41')];if(_0x4ed3ea[_0x0826('0x43')][_0x0826('0xbc')]){_0x4cc727['include']=[{'all':!![]}];}_0x4cc727=_[_0x0826('0x9e')]({},_0x4cc727,_0x4ed3ea['options']);return db[_0x0826('0x3d')]['find'](_0x4cc727)['then'](handleEntityNotFound(_0x5277f2,null))['then'](respondWithResult(_0x5277f2,null))['catch'](handleError(_0x5277f2,null));};exports['create']=function(_0x30a00f,_0x185fd5){return db[_0x0826('0x3d')][_0x0826('0xbd')](_0x30a00f[_0x0826('0x7a')],{})['then'](respondWithResult(_0x185fd5,0xc9))[_0x0826('0x3c')](handleError(_0x185fd5,null));};exports['update']=function(_0x58a222,_0x5d98fe){if(_0x58a222[_0x0826('0x7a')]['id']){delete _0x58a222[_0x0826('0x7a')]['id'];}return db[_0x0826('0x3d')]['find']({'where':{'id':_0x58a222[_0x0826('0xba')]['id']}})['then'](handleEntityNotFound(_0x5d98fe,null))[_0x0826('0x2f')](saveUpdates(_0x58a222[_0x0826('0x7a')],null))[_0x0826('0x2f')](respondWithResult(_0x5d98fe,null))[_0x0826('0x3c')](handleError(_0x5d98fe,null));};exports[_0x0826('0x30')]=function(_0x45261f,_0x1aa3df){return db[_0x0826('0x3d')][_0x0826('0x6e')]({'where':{'id':_0x45261f[_0x0826('0xba')]['id']}})[_0x0826('0x2f')](handleEntityNotFound(_0x1aa3df,null))[_0x0826('0x2f')](removeEntity(_0x1aa3df,null))[_0x0826('0x3c')](handleError(_0x1aa3df,null));};exports[_0x0826('0xbe')]=function(_0x367652,_0x319b86){return db[_0x0826('0x3d')][_0x0826('0xbe')]()[_0x0826('0x2f')](respondWithResult(_0x319b86,null))[_0x0826('0x3c')](handleError(_0x319b86,null));};exports[_0x0826('0xbf')]=function(_0x575360,_0x158e72,_0x95f9ec){return db[_0x0826('0xc0')]['find']({'where':{'id':_0x575360['params']['id']}})['then'](handleEntityNotFound(_0x158e72,null))[_0x0826('0x2f')](function(_0x113b6f){if(_0x113b6f){return _0x113b6f['addMessage'](_0x575360[_0x0826('0x7a')]['ids'],_[_0x0826('0xc1')](_0x575360[_0x0826('0x7a')],['ids','id'])||{});}})[_0x0826('0x2f')](respondWithResult(_0x158e72,null))[_0x0826('0x3c')](handleError(_0x158e72,null));};exports['getMessages']=function(_0x486f22,_0x402043,_0x1079f7){var _0x22d4db={'raw':![],'where':{}};var _0x445a18={};var _0x24692d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x0826('0xc2')]({'where':{'id':_0x486f22[_0x0826('0xba')]['id']}})[_0x0826('0x2f')](handleEntityNotFound(_0x402043,null))['then'](function(_0x22644f){if(_0x22644f){_0x445a18['model']=_[_0x0826('0x42')](db[_0x0826('0xc0')][_0x0826('0xbb')]);_0x445a18['query']=_[_0x0826('0x42')](_0x486f22[_0x0826('0x43')]);_0x445a18[_0x0826('0x4d')]=_[_0x0826('0x45')](_0x445a18[_0x0826('0x41')],_0x445a18['query']);_0x22d4db[_0x0826('0x44')]=_['intersection'](_0x445a18[_0x0826('0x41')],qs[_0x0826('0x46')](_0x486f22['query'][_0x0826('0x46')]));_0x22d4db[_0x0826('0x44')]=_0x22d4db[_0x0826('0x44')][_0x0826('0x47')]?_0x22d4db[_0x0826('0x44')]:_0x445a18[_0x0826('0x41')];if(!_0x486f22[_0x0826('0x43')][_0x0826('0x48')](_0x0826('0x49'))){_0x22d4db['limit']=qs['limit'](_0x486f22['query']['limit']);_0x22d4db[_0x0826('0x29')]=qs[_0x0826('0x29')](_0x486f22[_0x0826('0x43')][_0x0826('0x29')]);}_0x22d4db[_0x0826('0x4a')]=qs[_0x0826('0x4b')](_0x486f22[_0x0826('0x43')][_0x0826('0x4b')]);_0x22d4db[_0x0826('0x4c')]=qs['filters'](_[_0x0826('0x4e')](_0x486f22[_0x0826('0x43')],_0x445a18[_0x0826('0x4d')]));_0x22d4db[_0x0826('0x4c')][_0x0826('0xb6')]=_0x22644f['id'];if(_0x486f22[_0x0826('0x43')][_0x0826('0xc3')]){_0x22d4db[_0x0826('0x4c')]=_['merge'](_0x22d4db[_0x0826('0x4c')],{'$or':_[_0x0826('0x35')](_0x22d4db[_0x0826('0x44')],function(_0xa53ff5){var _0x17e7cb={};_0x17e7cb[_0xa53ff5]={'$like':'%'+_0x486f22['query']['filter']+'%'};return _0x17e7cb;})});}if(_0x486f22[_0x0826('0x43')][_0x0826('0x81')]){var _0x46f0ab=_0x486f22[_0x0826('0x43')][_0x0826('0x81')]['split'](',');var _0x2ecd3a={};_0x2ecd3a[_0x46f0ab[0x0]]={'$gte':moment(_0x46f0ab[0x1])['format'](_0x0826('0xc4'))};_0x22d4db[_0x0826('0x4c')]=_['merge'](_0x22d4db[_0x0826('0x4c')],_0x2ecd3a);}_0x22d4db=_[_0x0826('0x9e')]({},_0x22d4db,_0x486f22[_0x0826('0xc5')]);return db['OpenchannelMessage'][_0x0826('0x28')]({'where':_0x22d4db[_0x0826('0x4c')]})[_0x0826('0x2f')](function(_0x4feb06){_0x24692d[_0x0826('0x28')]=_0x4feb06;if(_0x486f22[_0x0826('0x43')]['includeAll']){_0x22d4db[_0x0826('0xc6')]=[{'all':!![]}];}return db[_0x0826('0xc0')][_0x0826('0xc7')](_0x22d4db);})[_0x0826('0x2f')](function(_0x8f707d){_0x24692d[_0x0826('0xb8')]=_0x8f707d;return _0x24692d;});}})[_0x0826('0x2f')](respondWithFilteredResult(_0x402043,_0x22d4db))['catch'](handleError(_0x402043,null));};exports[_0x0826('0xc8')]=function(_0x363481,_0x5e8cf4,_0x80a5ca){return db[_0x0826('0x3d')][_0x0826('0x6e')]({'where':{'id':_0x363481[_0x0826('0xba')]['id']}})['then'](handleEntityNotFound(_0x5e8cf4,null))[_0x0826('0x2f')](function(_0x2ceb5d){if(_0x2ceb5d){return _0x2ceb5d[_0x0826('0xc9')](_0x363481[_0x0826('0x7a')][_0x0826('0xca')],_['omit'](_0x363481[_0x0826('0x7a')],[_0x0826('0xca'),'id'])||{})[_0x0826('0xcb')](function(){return db[_0x0826('0x72')][_0x0826('0xc7')]({'attributes':['id',_0x0826('0x32'),_0x0826('0x51')],'where':{'id':_0x363481[_0x0826('0x7a')][_0x0826('0xca')]}});})[_0x0826('0x2f')](function(_0x5c2770){socket[_0x0826('0xcc')](_0x0826('0xcd'),{'id':Number(_0x363481[_0x0826('0xba')]['id']),'tags':_0x5c2770||[]});return{'id':Number(_0x363481[_0x0826('0xba')]['id']),'tags':_0x5c2770||[]};});}})[_0x0826('0x2f')](respondWithResult(_0x5e8cf4,null))[_0x0826('0x3c')](handleError(_0x5e8cf4,null));};exports[_0x0826('0xce')]=function(_0x181e1f,_0x2f9e8e,_0x5e2669){return db['OpenchannelInteraction'][_0x0826('0x6e')]({'where':{'id':_0x181e1f[_0x0826('0xba')]['id']}})[_0x0826('0x2f')](handleEntityNotFound(_0x2f9e8e,null))[_0x0826('0x2f')](function(_0x3ff730){if(_0x3ff730){return _0x3ff730[_0x0826('0xce')](_0x181e1f['query']['ids']);}})[_0x0826('0x2f')](respondWithStatusCode(_0x2f9e8e,null))['catch'](handleError(_0x2f9e8e,null));};exports[_0x0826('0xcf')]=function(_0x2a4a25,_0x8afe9b){var _0x206d62=moment()[_0x0826('0xd0')]()[_0x0826('0x9d')]();var _0x390062=path['join'](config[_0x0826('0xd1')],'server',_0x0826('0xd2'),_0x0826('0xd3'));var _0x5038da=path[_0x0826('0xd4')](config[_0x0826('0xd1')],'server',_0x0826('0xd2'),_0x0826('0xd5'));var _0x314c8e=path['join'](_0x390062,_0x206d62);var _0x143fdb=util[_0x0826('0xd6')]('transcript-%d-%s.zip',_0x2a4a25[_0x0826('0xba')]['id'],_0x206d62);var _0x1c83a4=path[_0x0826('0xd4')](_0x390062,_0x143fdb);var _0x8892c2=[];_0x8892c2[_0x0826('0x3b')]({'model':db[_0x0826('0x75')],'as':'User','attributes':['id',_0x0826('0x36')],'raw':!![]});_0x8892c2[_0x0826('0x3b')]({'model':db[_0x0826('0xd7')],'as':'Contact','attributes':['id','firstName',_0x0826('0xd8')],'raw':!![]});if(_0x2a4a25[_0x0826('0x43')][_0x0826('0xd5')]){_0x8892c2[_0x0826('0x3b')]({'model':db[_0x0826('0xd9')],'as':_0x0826('0xd9'),'raw':!![]});}var _0x459be0=[{'model':db[_0x0826('0xc0')],'as':_0x0826('0xda'),'attributes':['id',_0x0826('0x7a'),_0x0826('0x7f'),_0x0826('0xdb'),_0x0826('0xdc'),_0x0826('0x87')],'include':_0x8892c2}];_0x459be0['push']({'model':db[_0x0826('0xdd')],'as':_0x0826('0xde'),'attributes':['id',_0x0826('0x32')]});_0x459be0['push']({'model':db[_0x0826('0x75')],'as':_0x0826('0xdf'),'attributes':['id',_0x0826('0x36')]});return db[_0x0826('0x3d')][_0x0826('0x6e')]({'where':{'id':_0x2a4a25[_0x0826('0xba')]['id']},'include':_0x459be0})[_0x0826('0x2f')](handleEntityNotFound(_0x8afe9b,null))['then'](function(_0x595913){if(_0x595913){var _0x1b9ae3=_0x595913[_0x0826('0xe0')]({'plain':!![]});fs[_0x0826('0xe1')](_0x314c8e);var _0x4c10f4={'channel':_0x0826('0xe2'),'account':_0x1b9ae3[_0x0826('0xde')]['name'],'agent':_0x1b9ae3[_0x0826('0xdf')]?_0x1b9ae3[_0x0826('0xdf')]['fullname']:_0x0826('0xe3'),'createdAt':moment(_0x1b9ae3[_0x0826('0x7f')])[_0x0826('0xd6')](_0x0826('0xc4'))[_0x0826('0x9d')](),'closedAt':_0x1b9ae3[_0x0826('0xe4')]?moment(_0x1b9ae3[_0x0826('0xe5')])[_0x0826('0xd6')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1b9ae3[_0x0826('0xe6')],'visibility':_0x1b9ae3[_0x0826('0xe7')]?_0x0826('0xe8'):_0x0826('0xe9'),'messages':_(_0x1b9ae3['Messages'])[_0x0826('0xc3')]({'secret':![]})['map'](function(_0x5a8079){if(_0x5a8079[_0x0826('0xd9')]){var _0x2c99f3=path[_0x0826('0xd4')](_0x5038da,_0x5a8079[_0x0826('0xd9')][_0x0826('0xea')]);if(fs['existsSync'](_0x2c99f3)){fs[_0x0826('0xeb')](_0x2c99f3)[_0x0826('0xec')](fs[_0x0826('0xed')](path[_0x0826('0xd4')](_0x314c8e,_0x5a8079[_0x0826('0xd9')][_0x0826('0xea')])));}}return{'date':moment(_0x5a8079[_0x0826('0x7f')])['format'](_0x0826('0xc4'))[_0x0826('0x9d')](),'sender':_0x5a8079['direction']===_0x0826('0xee')?_0x5a8079[_0x0826('0x75')]?_0x5a8079[_0x0826('0x75')]['fullname']:'System':_0x5a8079[_0x0826('0x69')]['firstName']+(_0x5a8079[_0x0826('0x69')]['lastName']?'\x20'+_0x5a8079[_0x0826('0x69')][_0x0826('0xd8')]:''),'body':_0x5a8079['Attachment']?_0x5a8079[_0x0826('0xd9')]['basename']:_0x5a8079[_0x0826('0x7a')],'direction':_0x5a8079['direction']===_0x0826('0xee')?'A':'C','secret':_0x5a8079['secret'],'read':_0x5a8079[_0x0826('0x87')],'attachment':_0x5a8079[_0x0826('0xd9')]};})[_0x0826('0x65')]()};return ejs[_0x0826('0xef')](path['join'](config['root'],'server','views',_0x0826('0xf0')),{'interaction':_0x4c10f4})['then'](function(_0x5d47dd){var _0x3336fe=path[_0x0826('0xd4')](_0x314c8e,_0x0826('0xf1')+_0x1b9ae3['id']+'-'+_0x206d62+_0x0826('0xf2'));var _0x93aa54={'path':_0x3336fe,'channel':_0x0826('0xe2'),'interactionId':_0x1b9ae3['id']};return pdf[_0x0826('0xf3')](_0x5d47dd,_0x93aa54);})[_0x0826('0x2f')](function(){return new BPromise(function(_0x1dd153,_0x3dfe32){zipdir(_0x314c8e,{'saveTo':_0x1c83a4},function(_0x5df98b,_0x2d82a1){if(_0x5df98b)return _0x3dfe32(_0x5df98b);return _0x1dd153(_0x2d82a1);});})[_0x0826('0x2f')](function(){return new BPromise(function(_0x2a1c58,_0x5a496c){rimraf(_0x314c8e,function(_0x386baa){if(_0x386baa)_0x5a496c(_0x386baa);return _0x2a1c58();});});})[_0x0826('0x2f')](function(){return _0x8afe9b['download'](_0x1c83a4,_0x143fdb,function(_0x319c0b){if(_0x319c0b){console[_0x0826('0xf4')]('err',_0x319c0b);}else{fs['unlinkSync'](_0x1c83a4);}});});});}else{return _0x8afe9b['sendStatus'](0xc8);}})['catch'](handleError(_0x8afe9b,null));}; \ No newline at end of file +var _0xa3e5=['getMessages','format','options','findAll','addTags','setTags','omit','spread','color','openchannelInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','createReadStream','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','System','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','fullname','TagIds','Tags','split','forEach','push','catch','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','users','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','create','describe','addMessage','OpenchannelMessage','ids'];(function(_0x5ce25c,_0x2a2b55){var _0x3a2958=function(_0x34d516){while(--_0x34d516){_0x5ce25c['push'](_0x5ce25c['shift']());}};_0x3a2958(++_0x2a2b55);}(_0xa3e5,0x11f));var _0x5a3e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa3e5[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a3e('0x0'));var zipdir=require(_0x5a3e('0x1'));var jsonpatch=require(_0x5a3e('0x2'));var rp=require('request-promise');var moment=require(_0x5a3e('0x3'));var BPromise=require(_0x5a3e('0x4'));var Mustache=require(_0x5a3e('0x5'));var util=require('util');var path=require(_0x5a3e('0x6'));var sox=require(_0x5a3e('0x7'));var csv=require('to-csv');var ejs=require(_0x5a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x5a3e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a3e('0xa'));var jsforce=require(_0x5a3e('0xb'));var deskjs=require(_0x5a3e('0xc'));var toCsv=require(_0x5a3e('0xd'));var querystring=require(_0x5a3e('0xe'));var Papa=require(_0x5a3e('0xf'));var Redis=require(_0x5a3e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a3e('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5a3e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a3e('0x13'))['db'];config[_0x5a3e('0x14')]=_[_0x5a3e('0x15')](config['redis'],{'host':_0x5a3e('0x16'),'port':0x18eb});var socket=require(_0x5a3e('0x17'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x5a3e('0x18')](socket);function respondWithStatusCode(_0x30fa0,_0x17a0ce){_0x17a0ce=_0x17a0ce||0xcc;return function(_0x1dc1c1){if(_0x1dc1c1){return _0x30fa0[_0x5a3e('0x19')](_0x17a0ce);}return _0x30fa0[_0x5a3e('0x1a')](_0x17a0ce)[_0x5a3e('0x1b')]();};}function respondWithResult(_0x122cee,_0x125984){_0x125984=_0x125984||0xc8;return function(_0x241276){if(_0x241276){return _0x122cee[_0x5a3e('0x1a')](_0x125984)[_0x5a3e('0x1c')](_0x241276);}};}function respondWithFilteredResult(_0x3a957a,_0x5d864b){return function(_0x3cf367){if(_0x3cf367){var _0x5ed9c0=typeof _0x5d864b[_0x5a3e('0x1d')]===_0x5a3e('0x1e')&&typeof _0x5d864b[_0x5a3e('0x1f')]===_0x5a3e('0x1e');var _0xc48c3f=_0x3cf367['count'];var _0x76f603=_0x5ed9c0?0x0:_0x5d864b[_0x5a3e('0x1d')];var _0x2120f4=_0x5ed9c0?_0x3cf367[_0x5a3e('0x20')]:_0x5d864b[_0x5a3e('0x1d')]+_0x5d864b[_0x5a3e('0x1f')];var _0x1cd2f7;if(_0x2120f4>=_0xc48c3f){_0x2120f4=_0xc48c3f;_0x1cd2f7=0xc8;}else{_0x1cd2f7=0xce;}_0x3a957a['status'](_0x1cd2f7);return _0x3a957a[_0x5a3e('0x21')](_0x5a3e('0x22'),_0x76f603+'-'+_0x2120f4+'/'+_0xc48c3f)[_0x5a3e('0x1c')](_0x3cf367);}return null;};}function patchUpdates(_0x2129f1){return function(_0x3a67a8){try{jsonpatch['apply'](_0x3a67a8,_0x2129f1,!![]);}catch(_0x208ff7){return BPromise['reject'](_0x208ff7);}return _0x3a67a8[_0x5a3e('0x23')]();};}function saveUpdates(_0xbf5a7,_0x25b33a){return function(_0xd725aa){if(_0xd725aa){return _0xd725aa[_0x5a3e('0x24')](_0xbf5a7)[_0x5a3e('0x25')](function(_0x1fe3bd){return _0x1fe3bd;});}return null;};}function removeEntity(_0x2d25bd,_0x5ac5e7){return function(_0xd770a5){if(_0xd770a5){return _0xd770a5[_0x5a3e('0x26')]()['then'](function(){_0x2d25bd[_0x5a3e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fccca,_0x9f2ed){return function(_0x5eabd2){if(!_0x5eabd2){_0x2fccca['sendStatus'](0x194);}return _0x5eabd2;};}function handleError(_0x1e0c2a,_0x42cae9){_0x42cae9=_0x42cae9||0x1f4;return function(_0xf24e4){logger[_0x5a3e('0x27')](_0xf24e4[_0x5a3e('0x28')]);if(_0xf24e4[_0x5a3e('0x29')]){delete _0xf24e4[_0x5a3e('0x29')];}_0x1e0c2a['status'](_0x42cae9)['send'](_0xf24e4);};}function getInteractionUsers(_0x143273,_0x12a0ce){return new BPromise(function(_0x5e4879,_0x3b4d42){try{if(_0x12a0ce[_0x143273['id']]){_0x143273['Users']=_['map'](_0x12a0ce[_0x143273['id']],function(_0x599d81){return{'id':_0x599d81['id'],'fullname':_0x599d81[_0x5a3e('0x2a')]};});}}catch(_0x2a8211){_0x3b4d42(_0x2a8211);}_0x5e4879(_0x143273);});}function getInteractionTags(_0x2c128f,_0x13cf88){return new BPromise(function(_0x1b9d84,_0x5de877){try{if(_0x2c128f[_0x5a3e('0x2b')]){_0x2c128f[_0x5a3e('0x2c')]=[];_0x2c128f[_0x5a3e('0x2b')][_0x5a3e('0x2d')](',')[_0x5a3e('0x2e')](function(_0x985c02){_0x2c128f['Tags'][_0x5a3e('0x2f')](_0x13cf88[_0x985c02]);});}delete _0x2c128f['TagIds'];}catch(_0xc52931){_0x5de877(_0xc52931);}_0x1b9d84(_0x2c128f);});}function updateOpenchannelInteraction(_0x55bacf,_0x40c2f6,_0x15fb27){return new BPromise(function(_0x5570cf,_0x5a0efc){return getInteractionUsers(_0x55bacf,_0x15fb27)[_0x5a3e('0x25')](function(_0x34660a){return getInteractionTags(_0x34660a,_0x40c2f6);})[_0x5a3e('0x25')](function(_0x3e353a){_0x5570cf(_0x3e353a);})[_0x5a3e('0x30')](function(_0x4383d8){_0x5a0efc(_0x4383d8);});});}exports['index']=function(_0x1857f4,_0x34c0ff){var _0x3210f1={},_0x525da5={},_0x39c24a={'count':0x0,'rows':[]};var _0x1d0ce9=_[_0x5a3e('0x31')](db[_0x5a3e('0x32')][_0x5a3e('0x33')],function(_0x3d357e){return{'name':_0x3d357e[_0x5a3e('0x34')],'type':_0x3d357e[_0x5a3e('0x35')][_0x5a3e('0x36')]};});_0x525da5['model']=_['map'](_0x1d0ce9,_0x5a3e('0x29'));_0x525da5[_0x5a3e('0x37')]=_[_0x5a3e('0x38')](_0x1857f4[_0x5a3e('0x37')]);_0x525da5[_0x5a3e('0x39')]=_[_0x5a3e('0x3a')](_0x525da5[_0x5a3e('0x3b')],_0x525da5[_0x5a3e('0x37')]);_0x3210f1['attributes']=_['intersection'](_0x525da5[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x1857f4['query'][_0x5a3e('0x3c')]));_0x3210f1[_0x5a3e('0x3d')]=_0x3210f1[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3210f1[_0x5a3e('0x3d')]:_0x525da5[_0x5a3e('0x3b')];if(!_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x3f')](_0x5a3e('0x40'))){_0x3210f1[_0x5a3e('0x1f')]=qs[_0x5a3e('0x1f')](_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x1f')]);_0x3210f1[_0x5a3e('0x1d')]=qs[_0x5a3e('0x1d')](_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x1d')]);}_0x3210f1[_0x5a3e('0x41')]=qs[_0x5a3e('0x42')](_0x1857f4['query'][_0x5a3e('0x42')]);_0x3210f1[_0x5a3e('0x43')]=qs[_0x5a3e('0x39')](_[_0x5a3e('0x44')](_0x1857f4[_0x5a3e('0x37')],_0x525da5[_0x5a3e('0x39')]),_0x1d0ce9);var _0x58e7f0=[];var _0x4c771d=squel[_0x5a3e('0x45')]()[_0x5a3e('0x46')]('id')['field']('name')[_0x5a3e('0x46')]('color')[_0x5a3e('0x47')](_0x5a3e('0x48'));var _0x4e8ef3=squel[_0x5a3e('0x45')]()['field']('u.id')['field'](_0x5a3e('0x49'))[_0x5a3e('0x46')](_0x5a3e('0x4a'))[_0x5a3e('0x47')]('user_has_openchannel_interactions','ui')['left_join'](_0x5a3e('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0xa3ba85=squel[_0x5a3e('0x45')]()[_0x5a3e('0x47')](_0x5a3e('0x4c'),'i')[_0x5a3e('0x4d')]('cm_contacts','c',_0x5a3e('0x4e'))[_0x5a3e('0x4d')]('users','o',_0x5a3e('0x4f'))[_0x5a3e('0x4d')](_0x5a3e('0x50'),'a',_0x5a3e('0x51'))[_0x5a3e('0x4d')](_0x5a3e('0x52'),'me',_0x5a3e('0x53'))[_0x5a3e('0x4d')](_0x5a3e('0x54'),'it',_0x5a3e('0x55'))[_0x5a3e('0x4d')]('tools_tags','t',_0x5a3e('0x56'));var _0x5eb561=squel['expr']();var _0x57bf75=[];var _0x16c7fe=squel['expr']();var _0xb630e5;if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x57')]){_0xb630e5=as[_0x5a3e('0x58')](_0x1857f4['query'][_0x5a3e('0x57')]);var _0x3ad528=_0xb630e5[_0x5a3e('0x59')];for(var _0x3ac8d9=0x0;_0x3ac8d9<_0xb630e5[_0x5a3e('0x5a')]['length'];_0x3ac8d9++){var _0x330e0f=_0xb630e5['conditions'][_0x3ac8d9];var _0x1e8c78='i';var _0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,['name',_0x330e0f[_0x5a3e('0x46')]]);if(!_0x3582ec){switch(_0x330e0f['field']){case'unreadMessages':if(_0x330e0f[_0x5a3e('0x5c')]==0x1){_0xa3ba85['having']('`'+_0x330e0f[_0x5a3e('0x46')]+'`\x20=\x200');}else{_0xa3ba85[_0x5a3e('0x5d')]('`'+_0x330e0f[_0x5a3e('0x46')]+_0x5a3e('0x5e'));}break;case _0x5a3e('0x5f'):if(_0x330e0f[_0x5a3e('0x60')]===_0x5a3e('0x61')){if(_0x330e0f['value'][_0x5a3e('0x2d')]('\x20')[_0x5a3e('0x3e')]>0x1){_0x5eb561[_0x3ad528](_0x5a3e('0x62'),qs[_0x5a3e('0x63')](_0x330e0f[_0x5a3e('0x5c')]),null);}else{var _0x48b9fc='%'+_0x330e0f[_0x5a3e('0x5c')]+'%';_0x5eb561[_0x3ad528](_0x5a3e('0x64'),_0x48b9fc,_0x48b9fc,_0x48b9fc);}}else{_0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,[_0x5a3e('0x29'),'ContactId']);_0x330e0f['field']='ContactId';_0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1['value']['start'],_0x1ca5a1[_0x5a3e('0x5c')]['end']);}break;case _0x5a3e('0x67'):var _0x5ac68e=_0x330e0f[_0x5a3e('0x5c')][_0x5a3e('0x2d')](',')['map'](function(_0x1b9017){return Number(_0x1b9017);});_0x5ac68e[_0x5a3e('0x2e')](function(_0x1e1ced){_0x16c7fe['or'](_0x5a3e('0x68'),'%,'+_0x1e1ced+',%');});_0x57bf75=_[_0x5a3e('0x69')](_0x57bf75,_0x5ac68e);break;case _0x5a3e('0x6a'):if(_0x330e0f[_0x5a3e('0x60')]===_0x5a3e('0x61')){_0x5eb561[_0x3ad528](_0x5a3e('0x6b'),'%'+_0x330e0f[_0x5a3e('0x5c')]+'%',null);}else{_0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,[_0x5a3e('0x29'),_0x5a3e('0x6c')]);_0x330e0f['field']=_0x5a3e('0x6c');_0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1['text'],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);}break;case _0x5a3e('0x6e'):_0x1ca5a1=as[_0x5a3e('0x65')]('me',null,_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);break;}}else{var _0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);}}}else{var _0x4925a3=_(_0x1857f4[_0x5a3e('0x37')])[_0x5a3e('0x38')]()[_0x5a3e('0x31')](function(_0x4fe9ea){return _[_0x5a3e('0x6f')](_0x1d0ce9,[_0x5a3e('0x29'),_0x4fe9ea])?_0x4fe9ea:undefined;})[_0x5a3e('0x70')]()['value']();if(!_[_0x5a3e('0x71')](_0x4925a3)){_0x4925a3[_0x5a3e('0x2e')](function(_0x108161){if(_0x108161===_0x5a3e('0x72')){_0xa3ba85['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x5a3e('0x73')](_0x1857f4[_0x5a3e('0x37')][_0x108161]));}else if(_0x108161===_0x5a3e('0x74')){var _0x35533c=JSON[_0x5a3e('0x75')](_0x1857f4['query'][_0x108161])[_0x5a3e('0x76')];var _0x4d2f0c=JSON[_0x5a3e('0x75')](_0x1857f4[_0x5a3e('0x37')][_0x108161])[_0x5a3e('0x77')];_0xa3ba85[_0x5a3e('0x43')](_0x5a3e('0x78'),_0x35533c,_0x4d2f0c);}else{if(_0x1857f4[_0x5a3e('0x37')][_0x108161]==='null'){_0xa3ba85[_0x5a3e('0x43')]('i.'+_0x108161+_0x5a3e('0x79'));}else{_0xa3ba85[_0x5a3e('0x43')]('i.'+_0x108161+_0x5a3e('0x7a'),_0x1857f4[_0x5a3e('0x37')][_0x108161]);}}});}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7b')]){if(_0x1857f4['query'][_0x5a3e('0x7b')]==0x1){_0xa3ba85[_0x5a3e('0x5d')](_0x5a3e('0x7c'));}else{_0xa3ba85['having'](_0x5a3e('0x7d'));}}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7e')]){_0x57bf75=_[_0x5a3e('0x7f')](_0x1857f4['query'][_0x5a3e('0x7e')])?_0x1857f4[_0x5a3e('0x37')]['tag']:new Array(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7e')]);_0x57bf75[_0x5a3e('0x2e')](function(_0x2bf07e){_0x16c7fe['or'](_0x5a3e('0x68'),'%,'+_0x2bf07e+',%');});}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x80')]){var _0xa87a0c=_0x1857f4['query'][_0x5a3e('0x80')][_0x5a3e('0x81')]('\x5c','\x5c\x5c')[_0x5a3e('0x81')](/'/g,'\x27\x27');if(qs[_0x5a3e('0x82')](_0xa87a0c)){_0x5eb561['or'](_0x5a3e('0x83'),_0xa87a0c+'%');}else{_0x5eb561['or'](_0x5a3e('0x84'),qs[_0x5a3e('0x63')](_0xa87a0c))['or'](_0x5a3e('0x85'),_0xa87a0c+'%')['or'](_0x5a3e('0x86'),_0xa87a0c+'%');}}}_0xa3ba85[_0x5a3e('0x43')](_0x5eb561);_0xa3ba85[_0x5a3e('0x87')]('i.id');var _0x2586fe={'type':db[_0x5a3e('0x88')][_0x5a3e('0x89')]['SELECT'],'raw':!![]};var _0x332a7f=_0xa3ba85['clone']();_0x332a7f['field'](_0x5a3e('0x8a'));_0x332a7f['field'](_0x5a3e('0x8b'),_0x5a3e('0x8c'));if(_0x3210f1['order']){_0x3210f1['order'][_0x5a3e('0x2e')](function(_0xfb5a51){var _0xd749ff=_0xfb5a51[0x0]===_0x5a3e('0x8d')?_0xfb5a51[0x0]:'i.'+_0xfb5a51[0x0];_0xa3ba85['order'](_0xd749ff,_0xfb5a51[0x1]===_0x5a3e('0x8e')?![]:!![]);});}if(!_[_0x5a3e('0x71')](_0x57bf75)){_0xa3ba85[_0x5a3e('0x5d')](_0x16c7fe);_0x332a7f[_0x5a3e('0x43')](_0x5a3e('0x8f'),_0x57bf75);}BPromise[_0x5a3e('0x90')]()['then'](function(){if(!_0xb630e5){if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x72')])return;_0x332a7f[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0xa3ba85[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x92')]!==_0x5a3e('0x93'))return;return _0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x94')]({'attributes':['id'],'raw':!![]})[_0x5a3e('0x25')](function(_0x3bf5d5){if(_[_0x5a3e('0x71')](_0x3bf5d5)){_0x332a7f[_0x5a3e('0x43')](_0x5a3e('0x95'));_0xa3ba85['where'](_0x5a3e('0x95'));}else{_0x332a7f[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x5a3e('0x31')](_0x3bf5d5,'id'));_0xa3ba85[_0x5a3e('0x43')](_0x5a3e('0x96'),_[_0x5a3e('0x31')](_0x3bf5d5,'id'));}});})[_0x5a3e('0x25')](function(){if(_0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x92')]===_0x5a3e('0x93')&&!_0xb630e5&&!_0x1857f4['query'][_0x5a3e('0x72')])return[];return db['sequelize'][_0x5a3e('0x37')](_0x332a7f[_0x5a3e('0x97')](),_0x2586fe);})['then'](function(_0x3c827e){_0x39c24a[_0x5a3e('0x20')]=_0x3c827e['length'];if(_0x39c24a['count']===0x0)return[];return db[_0x5a3e('0x98')][_0x5a3e('0x37')](_0x4c771d[_0x5a3e('0x97')](),_0x2586fe)[_0x5a3e('0x25')](function(_0x35286c){_0x58e7f0=_[_0x5a3e('0x99')](_0x35286c,'id');_0x2586fe=_[_0x5a3e('0x9a')](_0x2586fe,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1857f4[_0x5a3e('0x37')]['fields']){_0x3210f1['attributes'][_0x5a3e('0x2e')](function(_0x310e54){_0xa3ba85[_0x5a3e('0x46')]('i.'+_0x310e54);});}else{_0xa3ba85['field'](_0x5a3e('0x8b'),_0x5a3e('0x8c'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9b'),_0x5a3e('0x9c'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9d'),_0x5a3e('0x9e'));_0xa3ba85[_0x5a3e('0x46')]('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',_0x5a3e('0x8d'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9f'));_0xa3ba85['field'](_0x5a3e('0xa0'),_0x5a3e('0xa1'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa2'),'Contact.lastName');_0xa3ba85['field']('c.email','Contact.email');_0xa3ba85['field'](_0x5a3e('0xa3'),_0x5a3e('0xa4'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa5'),_0x5a3e('0xa6'));_0xa3ba85['field']('c.fax',_0x5a3e('0xa7'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa8'),_0x5a3e('0xa9'));_0xa3ba85['field'](_0x5a3e('0xaa'),_0x5a3e('0xab'));_0xa3ba85['field'](_0x5a3e('0xac'),_0x5a3e('0x2b'));}if(_0x3210f1[_0x5a3e('0x1f')])_0xa3ba85[_0x5a3e('0x1f')](_0x3210f1[_0x5a3e('0x1f')]);if(_0x3210f1[_0x5a3e('0x1d')])_0xa3ba85[_0x5a3e('0x1d')](_0x3210f1[_0x5a3e('0x1d')]);return db[_0x5a3e('0x98')][_0x5a3e('0x37')](_0xa3ba85[_0x5a3e('0x97')](),_0x2586fe);})['then'](function(_0x436fb5){if(_0x436fb5[_0x5a3e('0x3e')]>0x0)_0x4e8ef3['where'](_0x5a3e('0xad'),_[_0x5a3e('0x31')](_0x436fb5,'id'));return db[_0x5a3e('0x98')]['query'](_0x4e8ef3[_0x5a3e('0x97')](),_0x2586fe)[_0x5a3e('0x25')](function(_0x257ca0){var _0x133b28=_[_0x5a3e('0xae')](_0x257ca0,_0x5a3e('0xaf'));var _0x4f10c5=[];_0x436fb5[_0x5a3e('0x2e')](function(_0x4709f9){_0x4f10c5[_0x5a3e('0x2f')](updateOpenchannelInteraction(_0x4709f9,_0x58e7f0,_0x133b28));});return BPromise[_0x5a3e('0xb0')](_0x4f10c5);});});})['then'](function(_0x3f55a7){_0x39c24a[_0x5a3e('0xb1')]=_0x3f55a7;return _0x39c24a;})[_0x5a3e('0x25')](respondWithFilteredResult(_0x34c0ff,_0x3210f1))[_0x5a3e('0x30')](handleError(_0x34c0ff,null));};exports[_0x5a3e('0xb2')]=function(_0x552879,_0x6bff64){var _0x3c0cda={};if(_0x552879[_0x5a3e('0x37')][_0x5a3e('0x35')]&&_0x552879[_0x5a3e('0x37')][_0x5a3e('0x35')]==='from'){_0x3c0cda[_0x5a3e('0x47')]=_0x552879[_0x5a3e('0xb3')]['id'];}else{_0x3c0cda['id']=_0x552879[_0x5a3e('0xb3')]['id'];}var _0x3645aa={'raw':![],'where':_0x3c0cda},_0x4840a4={};_0x4840a4['model']=_[_0x5a3e('0x38')](db[_0x5a3e('0x32')][_0x5a3e('0x33')]);_0x4840a4[_0x5a3e('0x37')]=_['keys'](_0x552879[_0x5a3e('0x37')]);_0x4840a4['filters']=_[_0x5a3e('0x3a')](_0x4840a4['model'],_0x4840a4[_0x5a3e('0x37')]);_0x3645aa[_0x5a3e('0x3d')]=_['intersection'](_0x4840a4[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x552879[_0x5a3e('0x37')]['fields']));_0x3645aa['attributes']=_0x3645aa[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3645aa['attributes']:_0x4840a4[_0x5a3e('0x3b')];if(_0x552879[_0x5a3e('0x37')][_0x5a3e('0xb4')]){_0x3645aa[_0x5a3e('0xb5')]=[{'all':!![]}];}_0x3645aa=_[_0x5a3e('0x9a')]({},_0x3645aa,_0x552879['options']);return db['OpenchannelInteraction'][_0x5a3e('0x5b')](_0x3645aa)[_0x5a3e('0x25')](handleEntityNotFound(_0x6bff64,null))[_0x5a3e('0x25')](respondWithResult(_0x6bff64,null))['catch'](handleError(_0x6bff64,null));};exports[_0x5a3e('0xb6')]=function(_0x5d7db,_0x17a376){return db[_0x5a3e('0x32')][_0x5a3e('0xb6')](_0x5d7db['body'],{})['then'](respondWithResult(_0x17a376,0xc9))[_0x5a3e('0x30')](handleError(_0x17a376,null));};exports['update']=function(_0x3d12da,_0x535486){if(_0x3d12da['body']['id']){delete _0x3d12da['body']['id'];}return db['OpenchannelInteraction'][_0x5a3e('0x5b')]({'where':{'id':_0x3d12da[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x535486,null))[_0x5a3e('0x25')](saveUpdates(_0x3d12da[_0x5a3e('0x6e')],null))[_0x5a3e('0x25')](respondWithResult(_0x535486,null))['catch'](handleError(_0x535486,null));};exports[_0x5a3e('0x26')]=function(_0x5ad313,_0x35c681){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x5ad313[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x35c681,null))['then'](removeEntity(_0x35c681,null))[_0x5a3e('0x30')](handleError(_0x35c681,null));};exports[_0x5a3e('0xb7')]=function(_0x18b1b1,_0x53d21e){return db[_0x5a3e('0x32')][_0x5a3e('0xb7')]()['then'](respondWithResult(_0x53d21e,null))[_0x5a3e('0x30')](handleError(_0x53d21e,null));};exports[_0x5a3e('0xb8')]=function(_0x4d1866,_0x56a2a5,_0x512e68){return db[_0x5a3e('0xb9')][_0x5a3e('0x5b')]({'where':{'id':_0x4d1866[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x56a2a5,null))['then'](function(_0x12ec41){if(_0x12ec41){return _0x12ec41['addMessage'](_0x4d1866['body'][_0x5a3e('0xba')],_['omit'](_0x4d1866[_0x5a3e('0x6e')],[_0x5a3e('0xba'),'id'])||{});}})[_0x5a3e('0x25')](respondWithResult(_0x56a2a5,null))[_0x5a3e('0x30')](handleError(_0x56a2a5,null));};exports[_0x5a3e('0xbb')]=function(_0x2c71fc,_0x4b1fa5,_0x32493b){var _0x3bbfee={'raw':![],'where':{}};var _0x246458={};var _0x275e95={'count':0x0,'rows':[]};return db[_0x5a3e('0x32')]['findOne']({'where':{'id':_0x2c71fc[_0x5a3e('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4b1fa5,null))[_0x5a3e('0x25')](function(_0x372771){if(_0x372771){_0x246458[_0x5a3e('0x3b')]=_['keys'](db[_0x5a3e('0xb9')]['rawAttributes']);_0x246458[_0x5a3e('0x37')]=_['keys'](_0x2c71fc['query']);_0x246458[_0x5a3e('0x39')]=_[_0x5a3e('0x3a')](_0x246458['model'],_0x246458[_0x5a3e('0x37')]);_0x3bbfee[_0x5a3e('0x3d')]=_['intersection'](_0x246458[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x3c')]));_0x3bbfee['attributes']=_0x3bbfee[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3bbfee[_0x5a3e('0x3d')]:_0x246458[_0x5a3e('0x3b')];if(!_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x3f')](_0x5a3e('0x40'))){_0x3bbfee[_0x5a3e('0x1f')]=qs[_0x5a3e('0x1f')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x1f')]);_0x3bbfee[_0x5a3e('0x1d')]=qs['offset'](_0x2c71fc['query']['offset']);}_0x3bbfee[_0x5a3e('0x41')]=qs[_0x5a3e('0x42')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x42')]);_0x3bbfee[_0x5a3e('0x43')]=qs[_0x5a3e('0x39')](_['pick'](_0x2c71fc[_0x5a3e('0x37')],_0x246458['filters']));_0x3bbfee[_0x5a3e('0x43')]['OpenchannelInteractionId']=_0x372771['id'];if(_0x2c71fc[_0x5a3e('0x37')]['filter']){_0x3bbfee[_0x5a3e('0x43')]=_[_0x5a3e('0x9a')](_0x3bbfee[_0x5a3e('0x43')],{'$or':_[_0x5a3e('0x31')](_0x3bbfee[_0x5a3e('0x3d')],function(_0x46bc8e){var _0x187c19={};_0x187c19[_0x46bc8e]={'$like':'%'+_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x80')]+'%'};return _0x187c19;})});}if(_0x2c71fc['query']['$gte']){var _0x10b1f0=_0x2c71fc['query']['$gte']['split'](',');var _0x1d763a={};_0x1d763a[_0x10b1f0[0x0]]={'$gte':moment(_0x10b1f0[0x1])[_0x5a3e('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bbfee['where']=_[_0x5a3e('0x9a')](_0x3bbfee['where'],_0x1d763a);}_0x3bbfee=_[_0x5a3e('0x9a')]({},_0x3bbfee,_0x2c71fc[_0x5a3e('0xbd')]);return db[_0x5a3e('0xb9')]['count']({'where':_0x3bbfee['where']})[_0x5a3e('0x25')](function(_0x5d1391){_0x275e95[_0x5a3e('0x20')]=_0x5d1391;if(_0x2c71fc['query']['includeAll']){_0x3bbfee[_0x5a3e('0xb5')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5a3e('0xbe')](_0x3bbfee);})[_0x5a3e('0x25')](function(_0x29645a){_0x275e95['rows']=_0x29645a;return _0x275e95;});}})[_0x5a3e('0x25')](respondWithFilteredResult(_0x4b1fa5,_0x3bbfee))[_0x5a3e('0x30')](handleError(_0x4b1fa5,null));};exports[_0x5a3e('0xbf')]=function(_0x182d73,_0x56df00,_0x47b03e){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x182d73['params']['id']}})['then'](handleEntityNotFound(_0x56df00,null))[_0x5a3e('0x25')](function(_0xe75b6f){if(_0xe75b6f){return _0xe75b6f[_0x5a3e('0xc0')](_0x182d73[_0x5a3e('0x6e')]['ids'],_[_0x5a3e('0xc1')](_0x182d73[_0x5a3e('0x6e')],[_0x5a3e('0xba'),'id'])||{})[_0x5a3e('0xc2')](function(){return db[_0x5a3e('0x67')][_0x5a3e('0xbe')]({'attributes':['id',_0x5a3e('0x29'),_0x5a3e('0xc3')],'where':{'id':_0x182d73['body']['ids']}});})['then'](function(_0x342aa0){socket['emit'](_0x5a3e('0xc4'),{'id':Number(_0x182d73[_0x5a3e('0xb3')]['id']),'tags':_0x342aa0||[]});return{'id':Number(_0x182d73[_0x5a3e('0xb3')]['id']),'tags':_0x342aa0||[]};});}})[_0x5a3e('0x25')](respondWithResult(_0x56df00,null))[_0x5a3e('0x30')](handleError(_0x56df00,null));};exports[_0x5a3e('0xc5')]=function(_0x373e6a,_0x4a9c49,_0x33a948){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x373e6a[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x4a9c49,null))[_0x5a3e('0x25')](function(_0x507695){if(_0x507695){return _0x507695[_0x5a3e('0xc5')](_0x373e6a['query'][_0x5a3e('0xba')]);}})[_0x5a3e('0x25')](respondWithStatusCode(_0x4a9c49,null))[_0x5a3e('0x30')](handleError(_0x4a9c49,null));};exports['download']=function(_0x22ac10,_0x4fc971){var _0x408f1a=moment()[_0x5a3e('0xc6')]()[_0x5a3e('0x97')]();var _0x4db313=path[_0x5a3e('0xc7')](config[_0x5a3e('0xc8')],'server',_0x5a3e('0xc9'),_0x5a3e('0xca'));var _0x363d6f=path[_0x5a3e('0xc7')](config[_0x5a3e('0xc8')],_0x5a3e('0xcb'),'files',_0x5a3e('0xcc'));var _0x42906e=path[_0x5a3e('0xc7')](_0x4db313,_0x408f1a);var _0x414b2f=util[_0x5a3e('0xbc')]('transcript-%d-%s.zip',_0x22ac10['params']['id'],_0x408f1a);var _0x2a1c2f=path['join'](_0x4db313,_0x414b2f);var _0x5702cb=[];_0x5702cb[_0x5a3e('0x2f')]({'model':db[_0x5a3e('0x6a')],'as':_0x5a3e('0x6a'),'attributes':['id',_0x5a3e('0x2a')],'raw':!![]});_0x5702cb['push']({'model':db['CmContact'],'as':_0x5a3e('0x5f'),'attributes':['id','firstName',_0x5a3e('0xcd')],'raw':!![]});if(_0x22ac10['query'][_0x5a3e('0xcc')]){_0x5702cb[_0x5a3e('0x2f')]({'model':db['Attachment'],'as':_0x5a3e('0xce'),'raw':!![]});}var _0x2a571a=[{'model':db[_0x5a3e('0xb9')],'as':_0x5a3e('0xcf'),'attributes':['id',_0x5a3e('0x6e'),'createdAt',_0x5a3e('0xd0'),_0x5a3e('0xd1'),_0x5a3e('0x7b')],'include':_0x5702cb}];_0x2a571a['push']({'model':db[_0x5a3e('0xd2')],'as':_0x5a3e('0xd3'),'attributes':['id',_0x5a3e('0x29')]});_0x2a571a[_0x5a3e('0x2f')]({'model':db[_0x5a3e('0x6a')],'as':_0x5a3e('0xd4'),'attributes':['id',_0x5a3e('0x2a')]});return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x22ac10[_0x5a3e('0xb3')]['id']},'include':_0x2a571a})[_0x5a3e('0x25')](handleEntityNotFound(_0x4fc971,null))[_0x5a3e('0x25')](function(_0x536cb7){if(_0x536cb7){var _0x29a58=_0x536cb7[_0x5a3e('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x42906e);var _0x4a51cd={'channel':_0x5a3e('0xd6'),'account':_0x29a58[_0x5a3e('0xd3')][_0x5a3e('0x29')],'agent':_0x29a58['Owner']?_0x29a58[_0x5a3e('0xd4')][_0x5a3e('0x2a')]:_0x5a3e('0xd7'),'createdAt':moment(_0x29a58[_0x5a3e('0x74')])[_0x5a3e('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5a3e('0x97')](),'closedAt':_0x29a58['closed']?moment(_0x29a58[_0x5a3e('0xd8')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5a3e('0x97')]():'','disposition':_0x29a58[_0x5a3e('0xd9')],'visibility':_0x29a58[_0x5a3e('0xda')]?_0x5a3e('0xdb'):_0x5a3e('0xdc'),'messages':_(_0x29a58[_0x5a3e('0xcf')])[_0x5a3e('0x80')]({'secret':![]})[_0x5a3e('0x31')](function(_0x899a65){if(_0x899a65[_0x5a3e('0xce')]){var _0x4ea106=path[_0x5a3e('0xc7')](_0x363d6f,_0x899a65['Attachment'][_0x5a3e('0xdd')]);if(fs['existsSync'](_0x4ea106)){fs[_0x5a3e('0xde')](_0x4ea106)['pipe'](fs[_0x5a3e('0xdf')](path[_0x5a3e('0xc7')](_0x42906e,_0x899a65[_0x5a3e('0xce')]['basename'])));}}return{'date':moment(_0x899a65[_0x5a3e('0x74')])[_0x5a3e('0xbc')](_0x5a3e('0xe0'))['toString'](),'sender':_0x899a65['direction']===_0x5a3e('0xe1')?_0x899a65['User']?_0x899a65[_0x5a3e('0x6a')][_0x5a3e('0x2a')]:_0x5a3e('0xe2'):_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xe3')]+(_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xcd')]?'\x20'+_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xcd')]:''),'body':_0x899a65['Attachment']?_0x899a65[_0x5a3e('0xce')][_0x5a3e('0xdd')]:_0x899a65[_0x5a3e('0x6e')],'direction':_0x899a65[_0x5a3e('0xd0')]==='out'?'A':'C','secret':_0x899a65[_0x5a3e('0xd1')],'read':_0x899a65[_0x5a3e('0x7b')],'attachment':_0x899a65[_0x5a3e('0xce')]};})[_0x5a3e('0x5c')]()};return ejs[_0x5a3e('0xe4')](path[_0x5a3e('0xc7')](config['root'],_0x5a3e('0xcb'),'views',_0x5a3e('0xe5')),{'interaction':_0x4a51cd})[_0x5a3e('0x25')](function(_0x1a9377){var _0x48c445=path['join'](_0x42906e,_0x5a3e('0xe6')+_0x29a58['id']+'-'+_0x408f1a+_0x5a3e('0xe7'));var _0xe3da17={'path':_0x48c445,'channel':_0x5a3e('0xd6'),'interactionId':_0x29a58['id']};return pdf[_0x5a3e('0xe8')](_0x1a9377,_0xe3da17);})[_0x5a3e('0x25')](function(){return new BPromise(function(_0x144465,_0x4837fc){zipdir(_0x42906e,{'saveTo':_0x2a1c2f},function(_0xe3ecb3,_0x52bbf1){if(_0xe3ecb3)return _0x4837fc(_0xe3ecb3);return _0x144465(_0x52bbf1);});})[_0x5a3e('0x25')](function(){return new BPromise(function(_0x1e7f98,_0x3f1c9c){rimraf(_0x42906e,function(_0x4ffde6){if(_0x4ffde6)_0x3f1c9c(_0x4ffde6);return _0x1e7f98();});});})[_0x5a3e('0x25')](function(){return _0x4fc971[_0x5a3e('0xe9')](_0x2a1c2f,_0x414b2f,function(_0x51d083){if(_0x51d083){console[_0x5a3e('0xea')](_0x5a3e('0xeb'),_0x51d083);}else{fs[_0x5a3e('0xec')](_0x2a1c2f);}});});});}else{return _0x4fc971['sendStatus'](0xc8);}})['catch'](handleError(_0x4fc971,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3879a06..0ccf239 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 _0x27e8=['OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','map','findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x27e8,0x1ed));var _0x827e=function(_0xcbe1bf,_0x25ce41){_0xcbe1bf=_0xcbe1bf-0x0;var _0x4b712e=_0x27e8[_0xcbe1bf];return _0x4b712e;};'use strict';var EventEmitter=require(_0x827e('0x0'));var OpenchannelInteraction=require(_0x827e('0x1'))['db'][_0x827e('0x2')];var OpenchannelMessage=require(_0x827e('0x1'))['db'][_0x827e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x827e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x827e('0x5'),'afterDestroy':_0x827e('0x6')};function emitEvent(_0x4466a3){return function(_0x4cafab,_0x859b94,_0x244d73){_0x4cafab[_0x827e('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x466961){_0x4cafab[_0x827e('0x8')]('Users',_0x466961[_0x827e('0x9')](function(_0x28e816){return{'id':_0x28e816['id']};}));return OpenchannelMessage[_0x827e('0xa')]({'where':{'OpenchannelInteractionId':_0x4cafab['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x522503){_0x4cafab[_0x827e('0x8')](_0x827e('0xb'),_0x522503[_0x827e('0xc')]);OpenchannelInteractionEvents['emit'](_0x4466a3+':'+_0x4cafab['id'],_0x4cafab);OpenchannelInteractionEvents[_0x827e('0xd')](_0x4466a3,_0x4cafab);_0x244d73(null);})['catch'](_0x244d73(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x827e('0xe')](e,emitEvent(event));}}module[_0x827e('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5bb1=['getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','save','update','remove'];(function(_0x2a0a73,_0x3046e4){var _0x4e451b=function(_0x5d23b2){while(--_0x5d23b2){_0x2a0a73['push'](_0x2a0a73['shift']());}};_0x4e451b(++_0x3046e4);}(_0x5bb1,0x1d6));var _0x15bb=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5bb1[_0x39c734];return _0xb2a2f9;};'use strict';var EventEmitter=require(_0x15bb('0x0'));var OpenchannelInteraction=require(_0x15bb('0x1'))['db'][_0x15bb('0x2')];var OpenchannelMessage=require(_0x15bb('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15bb('0x3'),'afterUpdate':_0x15bb('0x4'),'afterDestroy':_0x15bb('0x5')};function emitEvent(_0x4a03de){return function(_0x1267c2,_0x48572b,_0x14e214){_0x1267c2[_0x15bb('0x6')]({'attributes':['id'],'raw':!![]})[_0x15bb('0x7')](function(_0x15c0b4){_0x1267c2[_0x15bb('0x8')]('Users',_0x15c0b4['map'](function(_0x452424){return{'id':_0x452424['id']};}));return OpenchannelMessage[_0x15bb('0x9')]({'where':{'OpenchannelInteractionId':_0x1267c2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4624ca){_0x1267c2[_0x15bb('0x8')](_0x15bb('0xa'),_0x4624ca[_0x15bb('0xb')]);OpenchannelInteractionEvents[_0x15bb('0xc')](_0x4a03de+':'+_0x1267c2['id'],_0x1267c2);OpenchannelInteractionEvents[_0x15bb('0xc')](_0x4a03de,_0x1267c2);_0x14e214(null);})[_0x15bb('0xd')](_0x14e214(null));};}for(var e in events){if(events[_0x15bb('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x15bb('0xf')](e,emitEvent(event));}}module[_0x15bb('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8d4b261..5fe2d77 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 _0x7ad9=['../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x39f76e,_0x5633e2){var _0x5b6545=function(_0x19ad80){while(--_0x19ad80){_0x39f76e['push'](_0x39f76e['shift']());}};_0x5b6545(++_0x5633e2);}(_0x7ad9,0x16f));var _0x97ad=function(_0x3caf9f,_0x214152){_0x3caf9f=_0x3caf9f-0x0;var _0x5a303b=_0x7ad9[_0x3caf9f];return _0x5a303b;};'use strict';var _=require(_0x97ad('0x0'));var util=require(_0x97ad('0x1'));var logger=require('../../config/logger')(_0x97ad('0x2'));var moment=require(_0x97ad('0x3'));var BPromise=require(_0x97ad('0x4'));var rp=require(_0x97ad('0x5'));var fs=require('fs');var path=require(_0x97ad('0x6'));var rimraf=require('rimraf');var config=require(_0x97ad('0x7'));var attributes=require(_0x97ad('0x8'));module['exports']=function(_0x28a6ab,_0x2cf030){return _0x28a6ab[_0x97ad('0x9')](_0x97ad('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x97ad('0xb'),'collate':_0x97ad('0xc'),'hooks':{'beforeUpdate':function(_0x144ad4,_0x559ec0,_0x48c36b){if(_0x144ad4[_0x97ad('0xd')](_0x97ad('0xe'))){_0x144ad4[_0x97ad('0xf')]=moment()[_0x97ad('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x48c36b(null,_0x144ad4);}}});}; \ No newline at end of file +var _0xc05e=['../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x45be7e,_0x34cef8){var _0x2ec7ce=function(_0x3ec04e){while(--_0x3ec04e){_0x45be7e['push'](_0x45be7e['shift']());}};_0x2ec7ce(++_0x34cef8);}(_0xc05e,0x17f));var _0xec05=function(_0x353600,_0xfa13f5){_0x353600=_0x353600-0x0;var _0x4c7337=_0xc05e[_0x353600];return _0x4c7337;};'use strict';var _=require(_0xec05('0x0'));var util=require(_0xec05('0x1'));var logger=require(_0xec05('0x2'))('api');var moment=require(_0xec05('0x3'));var BPromise=require('bluebird');var rp=require(_0xec05('0x4'));var fs=require('fs');var path=require(_0xec05('0x5'));var rimraf=require(_0xec05('0x6'));var config=require(_0xec05('0x7'));var attributes=require(_0xec05('0x8'));module[_0xec05('0x9')]=function(_0xc0240f,_0x19f035){return _0xc0240f['define'](_0xec05('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec05('0xb'),'collate':_0xec05('0xc'),'hooks':{'beforeUpdate':function(_0x1ffb42,_0x11a283,_0x555b9f){if(_0x1ffb42['changed']('closed')){_0x1ffb42['closedAt']=moment()[_0xec05('0xd')](_0xec05('0xe'));}_0x555b9f(null,_0x1ffb42);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7e7a027..a5d181d 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 _0xb4b9=['request','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register'];(function(_0x643b2,_0x14e495){var _0x2e5346=function(_0x3ed065){while(--_0x3ed065){_0x643b2['push'](_0x643b2['shift']());}};_0x2e5346(++_0x14e495);}(_0xb4b9,0x147));var _0x9b4b=function(_0x10327d,_0x4ab37a){_0x10327d=_0x10327d-0x0;var _0x849011=_0xb4b9[_0x10327d];return _0x849011;};'use strict';var _=require(_0x9b4b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b4b('0x1'));var rs=require(_0x9b4b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b4b('0x3'));var logger=require(_0x9b4b('0x4'))(_0x9b4b('0x5'));var config=require('../../config/environment');var jayson=require(_0x9b4b('0x6'));var client=jayson[_0x9b4b('0x7')][_0x9b4b('0x8')]({'port':0x232a});config[_0x9b4b('0x9')]=_[_0x9b4b('0xa')](config[_0x9b4b('0x9')],{'host':_0x9b4b('0xb'),'port':0x18eb});var socket=require(_0x9b4b('0xc'))(new Redis(config[_0x9b4b('0x9')]));require(_0x9b4b('0xd'))[_0x9b4b('0xe')](socket);function respondWithRpcPromise(_0x338e7b,_0xd6af4,_0x49329d){return new BPromise(function(_0x26841c,_0x4ff2ac){return client[_0x9b4b('0xf')](_0x338e7b,_0x49329d)[_0x9b4b('0x10')](function(_0x41e22b){logger[_0x9b4b('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd6af4,'request\x20sent');logger[_0x9b4b('0x12')](_0x9b4b('0x13'),_0xd6af4,'request\x20sent',JSON['stringify'](_0x41e22b));if(_0x41e22b[_0x9b4b('0x14')]){if(_0x41e22b[_0x9b4b('0x14')]['code']===0x1f4){logger[_0x9b4b('0x14')](_0x9b4b('0x15'),_0xd6af4,_0x41e22b[_0x9b4b('0x14')]['message']);return _0x4ff2ac(_0x41e22b[_0x9b4b('0x14')][_0x9b4b('0x16')]);}logger[_0x9b4b('0x14')](_0x9b4b('0x15'),_0xd6af4,_0x41e22b[_0x9b4b('0x14')][_0x9b4b('0x16')]);return _0x26841c(_0x41e22b[_0x9b4b('0x14')][_0x9b4b('0x16')]);}else{logger[_0x9b4b('0x11')](_0x9b4b('0x15'),_0xd6af4,'request\x20sent');_0x26841c(_0x41e22b['result'][_0x9b4b('0x16')]);}})[_0x9b4b('0x17')](function(_0x1d8493){logger[_0x9b4b('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0xd6af4,_0x1d8493);_0x4ff2ac(_0x1d8493);});});}exports[_0x9b4b('0x18')]=function(_0x43d51e){var _0x16cf1e=this;return new Promise(function(_0x8c55f2,_0x5f3ee4){return db[_0x9b4b('0x19')]['update'](_0x43d51e[_0x9b4b('0x1a')],{'raw':_0x43d51e['options']?_0x43d51e[_0x9b4b('0x1b')][_0x9b4b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43d51e[_0x9b4b('0x1b')]?_0x43d51e[_0x9b4b('0x1b')][_0x9b4b('0x1d')]||null:null,'attributes':_0x43d51e[_0x9b4b('0x1b')]?_0x43d51e['options']['attributes']||null:null,'limit':_0x43d51e[_0x9b4b('0x1b')]?_0x43d51e[_0x9b4b('0x1b')]['limit']||null:null})[_0x9b4b('0x10')](function(_0x190b30){logger['info']('UpdateOpenchannelInteraction',_0x43d51e);logger[_0x9b4b('0x12')]('UpdateOpenchannelInteraction',_0x43d51e,JSON[_0x9b4b('0x1e')](_0x190b30));_0x8c55f2(_0x190b30);})[_0x9b4b('0x17')](function(_0x51e377){logger[_0x9b4b('0x14')]('UpdateOpenchannelInteraction',_0x51e377[_0x9b4b('0x16')],_0x43d51e);_0x5f3ee4(_0x16cf1e['error'](0x1f4,_0x51e377[_0x9b4b('0x16')]));});});};exports[_0x9b4b('0x1f')]=function(_0x4d347b){return new Promise(function(_0x15c69c,_0x24f607){return db[_0x9b4b('0x19')][_0x9b4b('0x20')]({'where':_0x4d347b[_0x9b4b('0x1b')]?_0x4d347b[_0x9b4b('0x1b')][_0x9b4b('0x1d')]||null:null})[_0x9b4b('0x10')](function(_0x195826){if(_0x195826){return _0x195826[_0x9b4b('0x21')](_0x4d347b[_0x9b4b('0x1a')][_0x9b4b('0x22')],_[_0x9b4b('0x23')](_0x4d347b[_0x9b4b('0x1a')],[_0x9b4b('0x22'),'id'])||{});}})[_0x9b4b('0x24')](function(_0x20686f){logger['info'](_0x9b4b('0x25'),_0x4d347b);logger['debug'](_0x9b4b('0x25'),_0x4d347b,JSON['stringify'](_0x20686f));_0x15c69c(_0x20686f);})[_0x9b4b('0x17')](function(_0x586a98){logger[_0x9b4b('0x14')]('AddTags',_0x586a98[_0x9b4b('0x16')],_0x4d347b);_0x24f607(_this[_0x9b4b('0x14')](0x1f4,_0x586a98[_0x9b4b('0x16')]));});});}; \ No newline at end of file +var _0x6daa=['omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x4f217f,_0x313163){var _0x3b583a=function(_0x334971){while(--_0x334971){_0x4f217f['push'](_0x4f217f['shift']());}};_0x3b583a(++_0x313163);}(_0x6daa,0x1d1));var _0xa6da=function(_0x191d49,_0xcac38b){_0x191d49=_0x191d49-0x0;var _0x31a14b=_0x6daa[_0x191d49];return _0x31a14b;};'use strict';var _=require(_0xa6da('0x0'));var util=require(_0xa6da('0x1'));var moment=require(_0xa6da('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6da('0x4'))['db'];var utils=require(_0xa6da('0x5'));var logger=require(_0xa6da('0x6'))(_0xa6da('0x7'));var config=require('../../config/environment');var jayson=require(_0xa6da('0x8'));var client=jayson[_0xa6da('0x9')][_0xa6da('0xa')]({'port':0x232a});config[_0xa6da('0xb')]=_[_0xa6da('0xc')](config[_0xa6da('0xb')],{'host':_0xa6da('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6da('0xb')]));require(_0xa6da('0xe'))[_0xa6da('0xf')](socket);function respondWithRpcPromise(_0x142ce2,_0x1e7dd9,_0x5baeaa){return new BPromise(function(_0x2341f7,_0x15be74){return client['request'](_0x142ce2,_0x5baeaa)[_0xa6da('0x10')](function(_0x25d87d){logger[_0xa6da('0x11')](_0xa6da('0x12'),_0x1e7dd9,'request\x20sent');logger[_0xa6da('0x13')](_0xa6da('0x14'),_0x1e7dd9,_0xa6da('0x15'),JSON[_0xa6da('0x16')](_0x25d87d));if(_0x25d87d[_0xa6da('0x17')]){if(_0x25d87d['error'][_0xa6da('0x18')]===0x1f4){logger[_0xa6da('0x17')](_0xa6da('0x12'),_0x1e7dd9,_0x25d87d[_0xa6da('0x17')]['message']);return _0x15be74(_0x25d87d[_0xa6da('0x17')][_0xa6da('0x19')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1e7dd9,_0x25d87d[_0xa6da('0x17')]['message']);return _0x2341f7(_0x25d87d['error'][_0xa6da('0x19')]);}else{logger[_0xa6da('0x11')](_0xa6da('0x12'),_0x1e7dd9,'request\x20sent');_0x2341f7(_0x25d87d[_0xa6da('0x1a')][_0xa6da('0x19')]);}})[_0xa6da('0x1b')](function(_0xe804f0){logger[_0xa6da('0x17')](_0xa6da('0x12'),_0x1e7dd9,_0xe804f0);_0x15be74(_0xe804f0);});});}exports['UpdateOpenchannelInteraction']=function(_0x3a1827){var _0xfb7984=this;return new Promise(function(_0x2e0ac4,_0x4f7025){return db[_0xa6da('0x1c')][_0xa6da('0x1d')](_0x3a1827[_0xa6da('0x1e')],{'raw':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827['options'][_0xa6da('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')]['where']||null:null,'attributes':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')][_0xa6da('0x21')]||null:null,'limit':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')]['limit']||null:null})[_0xa6da('0x10')](function(_0x2665e5){logger[_0xa6da('0x11')](_0xa6da('0x22'),_0x3a1827);logger[_0xa6da('0x13')]('UpdateOpenchannelInteraction',_0x3a1827,JSON[_0xa6da('0x16')](_0x2665e5));_0x2e0ac4(_0x2665e5);})[_0xa6da('0x1b')](function(_0x466151){logger[_0xa6da('0x17')]('UpdateOpenchannelInteraction',_0x466151[_0xa6da('0x19')],_0x3a1827);_0x4f7025(_0xfb7984[_0xa6da('0x17')](0x1f4,_0x466151[_0xa6da('0x19')]));});});};exports[_0xa6da('0x23')]=function(_0x5af580){return new Promise(function(_0x545927,_0x4d874a){return db['OpenchannelInteraction'][_0xa6da('0x24')]({'where':_0x5af580[_0xa6da('0x1f')]?_0x5af580['options']['where']||null:null})[_0xa6da('0x10')](function(_0x58281a){if(_0x58281a){return _0x58281a[_0xa6da('0x25')](_0x5af580[_0xa6da('0x1e')][_0xa6da('0x26')],_[_0xa6da('0x27')](_0x5af580[_0xa6da('0x1e')],['ids','id'])||{});}})[_0xa6da('0x28')](function(_0x40113d){logger[_0xa6da('0x11')]('AddTags',_0x5af580);logger[_0xa6da('0x13')]('AddTags',_0x5af580,JSON[_0xa6da('0x16')](_0x40113d));_0x545927(_0x40113d);})[_0xa6da('0x1b')](function(_0x86050d){logger[_0xa6da('0x17')](_0xa6da('0x29'),_0x86050d[_0xa6da('0x19')],_0x5af580);_0x4d874a(_this[_0xa6da('0x17')](0x1f4,_0x86050d[_0xa6da('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 162d11a..23d893e 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 _0xf2ca=['length','openchannelInteraction:','./openchannelInteraction.events','remove','removeListener'];(function(_0x5734b6,_0x546cf3){var _0x1335ed=function(_0x3f2574){while(--_0x3f2574){_0x5734b6['push'](_0x5734b6['shift']());}};_0x1335ed(++_0x546cf3);}(_0xf2ca,0x1ba));var _0xaf2c=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0xf2ca[_0x4369ef];return _0x5b6913;};'use strict';var OpenchannelInteractionEvents=require(_0xaf2c('0x0'));var events=['save',_0xaf2c('0x1'),'update'];function createListener(_0x49a56d,_0x436f0b){return function(_0x5a706e){_0x436f0b['emit'](_0x49a56d,_0x5a706e);};}function removeListener(_0x1cf97,_0x22f401){return function(){OpenchannelInteractionEvents[_0xaf2c('0x2')](_0x1cf97,_0x22f401);};}exports['register']=function(_0x57d4e6){for(var _0xcba14c=0x0,_0x2b8233=events[_0xaf2c('0x3')];_0xcba14c<_0x2b8233;_0xcba14c++){var _0x5e6d07=events[_0xcba14c];var _0x13f750=createListener(_0xaf2c('0x4')+_0x5e6d07,_0x57d4e6);OpenchannelInteractionEvents['on'](_0x5e6d07,_0x13f750);}}; \ No newline at end of file +var _0x8884=['save','update','emit','register','length','./openchannelInteraction.events'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8884,0x83));var _0x4888=function(_0x1b1ade,_0x327971){_0x1b1ade=_0x1b1ade-0x0;var _0x50cac0=_0x8884[_0x1b1ade];return _0x50cac0;};'use strict';var OpenchannelInteractionEvents=require(_0x4888('0x0'));var events=[_0x4888('0x1'),'remove',_0x4888('0x2')];function createListener(_0x5061c4,_0x4c005f){return function(_0x2472fb){_0x4c005f[_0x4888('0x3')](_0x5061c4,_0x2472fb);};}function removeListener(_0x4bb01a,_0x3d61c2){return function(){OpenchannelInteractionEvents['removeListener'](_0x4bb01a,_0x3d61c2);};}exports[_0x4888('0x4')]=function(_0x352b0a){for(var _0x3cb27a=0x0,_0x2337dd=events[_0x4888('0x5')];_0x3cb27a<_0x2337dd;_0x3cb27a++){var _0xcc7577=events[_0x3cb27a];var _0x2ee283=createListener('openchannelInteraction:'+_0xcc7577,_0x352b0a);OpenchannelInteractionEvents['on'](_0xcc7577,_0x2ee283);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 413f1d8..0326bf9 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x3a14f5,_0x30d994){var _0xfd6a1=function(_0x57e502){while(--_0x57e502){_0x3a14f5['push'](_0x3a14f5['shift']());}};_0xfd6a1(++_0x30d994);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _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(_0x3bd019,_0x126b7c){var _0x136936=function(_0x569f9a){while(--_0x569f9a){_0x3bd019['push'](_0x3bd019['shift']());}};_0x136936(++_0x126b7c);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 42f2513..97c18d7 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 _0x2ca5=['medium','BOOLEAN','out','DATE','STRING','exports','TEXT'];(function(_0x285f08,_0x5e225b){var _0x5e77c4=function(_0x1e7dcf){while(--_0x1e7dcf){_0x285f08['push'](_0x285f08['shift']());}};_0x5e77c4(++_0x5e225b);}(_0x2ca5,0x108));var _0x52ca=function(_0x4633f9,_0x91b9a9){_0x4633f9=_0x4633f9-0x0;var _0x2404ee=_0x2ca5[_0x4633f9];return _0x2404ee;};'use strict';var Sequelize=require('sequelize');module[_0x52ca('0x0')]={'body':{'type':Sequelize[_0x52ca('0x1')](_0x52ca('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x52ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x52ca('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x52ca('0x5')]},'providerName':{'type':Sequelize[_0x52ca('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2f3a=['medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x18d426,_0x36b0ef){var _0x22e5db=function(_0x216b62){while(--_0x216b62){_0x18d426['push'](_0x18d426['shift']());}};_0x22e5db(++_0x36b0ef);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x1adba8,_0x5eebcb){_0x1adba8=_0x1adba8-0x0;var _0x69cfe7=_0x2f3a[_0x1adba8];return _0x69cfe7;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa2f3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa2f3('0x3')]('in',_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa2f3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index df9fb00..b069a4c 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 _0xe3f6=['interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','contact','interface','SIP/%s','rejectmessage','rimraf','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','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','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','reject','save','stack','name','index','map','OpenchannelMessage','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','merge','find','create','body','update','params','destroy','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xe3f6,0x9e));var _0x6e3f=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xe3f6[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e3f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6e3f('0x1'));var moment=require('moment');var BPromise=require(_0x6e3f('0x2'));var Mustache=require(_0x6e3f('0x3'));var util=require(_0x6e3f('0x4'));var path=require(_0x6e3f('0x5'));var sox=require(_0x6e3f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e3f('0x7'));var _=require('lodash');var squel=require(_0x6e3f('0x8'));var crypto=require(_0x6e3f('0x9'));var jsforce=require(_0x6e3f('0xa'));var deskjs=require(_0x6e3f('0xb'));var toCsv=require(_0x6e3f('0xc'));var querystring=require('querystring');var Papa=require(_0x6e3f('0xd'));var Redis=require('ioredis');var authService=require(_0x6e3f('0xe'));var qs=require(_0x6e3f('0xf'));var as=require(_0x6e3f('0x10'));var hardwareService=require(_0x6e3f('0x11'));var logger=require(_0x6e3f('0x12'))(_0x6e3f('0x13'));var utils=require(_0x6e3f('0x14'));var config=require(_0x6e3f('0x15'));var licenseUtil=require(_0x6e3f('0x16'));var db=require(_0x6e3f('0x17'))['db'];config[_0x6e3f('0x18')]=_[_0x6e3f('0x19')](config[_0x6e3f('0x18')],{'host':_0x6e3f('0x1a'),'port':0x18eb});var socket=require(_0x6e3f('0x1b'))(new Redis(config[_0x6e3f('0x18')]));require(_0x6e3f('0x1c'))[_0x6e3f('0x1d')](socket);var jayson=require(_0x6e3f('0x1e'));var client=jayson['client'][_0x6e3f('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x6e3f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2e34ea,_0xf193f2,_0x1a8e0a,_0x3f37de){return new BPromise(function(_0x1826af,_0xb20ff0){var _0x5d0e8e=_0x3f37de||client;return _0x5d0e8e[_0x6e3f('0x20')](_0x2e34ea,_0x1a8e0a)[_0x6e3f('0x21')](function(_0xa85464){logger[_0x6e3f('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xf193f2,_0x6e3f('0x23'));logger[_0x6e3f('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xf193f2,_0x6e3f('0x23'),JSON['stringify'](_0xa85464));if(_0xa85464[_0x6e3f('0x25')]){if(_0xa85464[_0x6e3f('0x25')][_0x6e3f('0x26')]===0x1f4){logger[_0x6e3f('0x25')](_0x6e3f('0x27'),_0xf193f2,_0xa85464['error'][_0x6e3f('0x28')]);return _0xb20ff0(_0xa85464[_0x6e3f('0x25')][_0x6e3f('0x28')]);}logger['error'](_0x6e3f('0x27'),_0xf193f2,_0xa85464[_0x6e3f('0x25')]['message']);return _0x1826af(_0xa85464[_0x6e3f('0x25')][_0x6e3f('0x28')]);}else{logger[_0x6e3f('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xf193f2,_0x6e3f('0x23'));_0x1826af(_0xa85464['result']['message']);}})[_0x6e3f('0x29')](function(_0xd11102){logger[_0x6e3f('0x25')](_0x6e3f('0x27'),_0xf193f2,_0xd11102);_0xb20ff0(_0xd11102);});});}function respondWithStatusCode(_0x25b6a8,_0x30b227){_0x30b227=_0x30b227||0xcc;return function(_0x27af4c){if(_0x27af4c){return _0x25b6a8[_0x6e3f('0x2a')](_0x30b227);}return _0x25b6a8['status'](_0x30b227)[_0x6e3f('0x2b')]();};}function respondWithResult(_0x5c3106,_0x5cfb16){_0x5cfb16=_0x5cfb16||0xc8;return function(_0x2be87e){if(_0x2be87e){return _0x5c3106['status'](_0x5cfb16)['json'](_0x2be87e);}};}function respondWithFilteredResult(_0x64cdc9,_0x12bab5){return function(_0x17357a){if(_0x17357a){var _0x279ea9=typeof _0x12bab5[_0x6e3f('0x2c')]===_0x6e3f('0x2d')&&typeof _0x12bab5['limit']===_0x6e3f('0x2d');var _0x3b07a2=_0x17357a[_0x6e3f('0x2e')];var _0x3a457d=_0x279ea9?0x0:_0x12bab5[_0x6e3f('0x2c')];var _0x569c3b=_0x279ea9?_0x17357a[_0x6e3f('0x2e')]:_0x12bab5[_0x6e3f('0x2c')]+_0x12bab5[_0x6e3f('0x2f')];var _0x40f806;if(_0x569c3b>=_0x3b07a2){_0x569c3b=_0x3b07a2;_0x40f806=0xc8;}else{_0x40f806=0xce;}_0x64cdc9[_0x6e3f('0x30')](_0x40f806);return _0x64cdc9[_0x6e3f('0x31')](_0x6e3f('0x32'),_0x3a457d+'-'+_0x569c3b+'/'+_0x3b07a2)[_0x6e3f('0x33')](_0x17357a);}return null;};}function patchUpdates(_0x370f1a){return function(_0x481dc6){try{jsonpatch['apply'](_0x481dc6,_0x370f1a,!![]);}catch(_0x564e7e){return BPromise[_0x6e3f('0x34')](_0x564e7e);}return _0x481dc6[_0x6e3f('0x35')]();};}function saveUpdates(_0x3f5ccb,_0x1e16ba){return function(_0x5ad6e1){if(_0x5ad6e1){return _0x5ad6e1['update'](_0x3f5ccb)[_0x6e3f('0x21')](function(_0x2f5438){return _0x2f5438;});}return null;};}function removeEntity(_0x9953d2,_0x24e270){return function(_0x28b20e){if(_0x28b20e){return _0x28b20e['destroy']()[_0x6e3f('0x21')](function(){_0x9953d2[_0x6e3f('0x30')](0xcc)[_0x6e3f('0x2b')]();});}};}function handleEntityNotFound(_0x1fd679,_0xa70088){return function(_0x53c353){if(!_0x53c353){_0x1fd679[_0x6e3f('0x2a')](0x194);}return _0x53c353;};}function handleError(_0x185e01,_0x5541fc){_0x5541fc=_0x5541fc||0x1f4;return function(_0x2f3c65){logger['error'](_0x2f3c65[_0x6e3f('0x36')]);if(_0x2f3c65[_0x6e3f('0x37')]){delete _0x2f3c65[_0x6e3f('0x37')];}_0x185e01[_0x6e3f('0x30')](_0x5541fc)['send'](_0x2f3c65);};}exports[_0x6e3f('0x38')]=function(_0x19373b,_0x38d908){var _0x296317={},_0x45c946={},_0x19c5bf={'count':0x0,'rows':[]};var _0x4941ef=_[_0x6e3f('0x39')](db[_0x6e3f('0x3a')]['rawAttributes'],function(_0x2679fa){return{'name':_0x2679fa['fieldName'],'type':_0x2679fa['type'][_0x6e3f('0x3b')]};});_0x45c946['model']=_['map'](_0x4941ef,_0x6e3f('0x37'));_0x45c946['query']=_[_0x6e3f('0x3c')](_0x19373b['query']);_0x45c946[_0x6e3f('0x3d')]=_['intersection'](_0x45c946[_0x6e3f('0x3e')],_0x45c946[_0x6e3f('0x3f')]);_0x296317[_0x6e3f('0x40')]=_[_0x6e3f('0x41')](_0x45c946[_0x6e3f('0x3e')],qs[_0x6e3f('0x42')](_0x19373b[_0x6e3f('0x3f')]['fields']));_0x296317['attributes']=_0x296317[_0x6e3f('0x40')][_0x6e3f('0x43')]?_0x296317['attributes']:_0x45c946[_0x6e3f('0x3e')];if(!_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x44')]('nolimit')){_0x296317[_0x6e3f('0x2f')]=qs[_0x6e3f('0x2f')](_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x2f')]);_0x296317['offset']=qs[_0x6e3f('0x2c')](_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x2c')]);}_0x296317[_0x6e3f('0x45')]=qs[_0x6e3f('0x46')](_0x19373b['query'][_0x6e3f('0x46')]);_0x296317['where']=qs[_0x6e3f('0x3d')](_[_0x6e3f('0x47')](_0x19373b['query'],_0x45c946[_0x6e3f('0x3d')]),_0x4941ef);if(_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x48')]){_0x296317['where']=_['merge'](_0x296317[_0x6e3f('0x49')],{'$or':_[_0x6e3f('0x39')](_0x4941ef,function(_0x18f19f){if(_0x18f19f[_0x6e3f('0x4a')]!==_0x6e3f('0x4b')){var _0x2498f1={};_0x2498f1[_0x18f19f[_0x6e3f('0x37')]]={'$like':'%'+_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x48')]+'%'};return _0x2498f1;}})});}_0x296317=_['merge']({},_0x296317,_0x19373b[_0x6e3f('0x4c')]);var _0x4013ad={'where':_0x296317['where']};return db[_0x6e3f('0x3a')][_0x6e3f('0x2e')](_0x4013ad)[_0x6e3f('0x21')](function(_0x4b1a72){_0x19c5bf[_0x6e3f('0x2e')]=_0x4b1a72;if(_0x19373b[_0x6e3f('0x3f')][_0x6e3f('0x4d')]){_0x296317[_0x6e3f('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6e3f('0x4f')](_0x296317);})[_0x6e3f('0x21')](function(_0x28d067){_0x19c5bf[_0x6e3f('0x50')]=_0x28d067;return _0x19c5bf;})[_0x6e3f('0x21')](respondWithFilteredResult(_0x38d908,_0x296317))['catch'](handleError(_0x38d908,null));};exports['show']=function(_0x3c85fc,_0x6c030b){var _0x1101e0={'raw':!![],'where':{'id':_0x3c85fc['params']['id']}},_0x49d12e={};_0x49d12e[_0x6e3f('0x3e')]=_[_0x6e3f('0x3c')](db[_0x6e3f('0x3a')]['rawAttributes']);_0x49d12e[_0x6e3f('0x3f')]=_[_0x6e3f('0x3c')](_0x3c85fc[_0x6e3f('0x3f')]);_0x49d12e['filters']=_['intersection'](_0x49d12e[_0x6e3f('0x3e')],_0x49d12e['query']);_0x1101e0[_0x6e3f('0x40')]=_[_0x6e3f('0x41')](_0x49d12e[_0x6e3f('0x3e')],qs[_0x6e3f('0x42')](_0x3c85fc[_0x6e3f('0x3f')][_0x6e3f('0x42')]));_0x1101e0[_0x6e3f('0x40')]=_0x1101e0[_0x6e3f('0x40')][_0x6e3f('0x43')]?_0x1101e0['attributes']:_0x49d12e[_0x6e3f('0x3e')];if(_0x3c85fc[_0x6e3f('0x3f')][_0x6e3f('0x4d')]){_0x1101e0[_0x6e3f('0x4e')]=[{'all':!![]}];}_0x1101e0=_[_0x6e3f('0x51')]({},_0x1101e0,_0x3c85fc['options']);return db['OpenchannelMessage'][_0x6e3f('0x52')](_0x1101e0)['then'](handleEntityNotFound(_0x6c030b,null))[_0x6e3f('0x21')](respondWithResult(_0x6c030b,null))[_0x6e3f('0x29')](handleError(_0x6c030b,null));};exports[_0x6e3f('0x53')]=function(_0x22f9f9,_0x51c0db){return db[_0x6e3f('0x3a')][_0x6e3f('0x53')](_0x22f9f9[_0x6e3f('0x54')],{})['then'](respondWithResult(_0x51c0db,0xc9))[_0x6e3f('0x29')](handleError(_0x51c0db,null));};exports[_0x6e3f('0x55')]=function(_0x296229,_0x4e5636){if(_0x296229[_0x6e3f('0x54')]['id']){delete _0x296229[_0x6e3f('0x54')]['id'];}return db[_0x6e3f('0x3a')][_0x6e3f('0x52')]({'where':{'id':_0x296229[_0x6e3f('0x56')]['id']}})[_0x6e3f('0x21')](handleEntityNotFound(_0x4e5636,null))[_0x6e3f('0x21')](saveUpdates(_0x296229['body'],null))[_0x6e3f('0x21')](respondWithResult(_0x4e5636,null))[_0x6e3f('0x29')](handleError(_0x4e5636,null));};exports[_0x6e3f('0x57')]=function(_0x5c08aa,_0x1dd31f){return db[_0x6e3f('0x3a')]['find']({'where':{'id':_0x5c08aa[_0x6e3f('0x56')]['id']}})[_0x6e3f('0x21')](handleEntityNotFound(_0x1dd31f,null))[_0x6e3f('0x21')](removeEntity(_0x1dd31f,null))['catch'](handleError(_0x1dd31f,null));};exports['describe']=function(_0x441ce9,_0x3a8e6f){return db[_0x6e3f('0x3a')][_0x6e3f('0x58')]()[_0x6e3f('0x21')](respondWithResult(_0x3a8e6f,null))['catch'](handleError(_0x3a8e6f,null));};var interaction_log=require(_0x6e3f('0x12'))(_0x6e3f('0x59'));exports['accept']=function(_0x5b2fe7,_0x4ca6cd,_0x302b78){var _0x1fa169={'agent':{},'channel':_0x6e3f('0x5a')};if(_0x5b2fe7[_0x6e3f('0x54')]['id']){delete _0x5b2fe7['body']['id'];}_0x5b2fe7[_0x6e3f('0x54')]['read']=!![];_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x5b')]=moment()[_0x6e3f('0x5c')](_0x6e3f('0x5d'));_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x5e')]=_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x5e')]||_0x5b2fe7[_0x6e3f('0x5f')]['id'];_0x1fa169['agent']['id']=_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x5e')];return db['OpenchannelMessage'][_0x6e3f('0x52')]({'where':{'id':_0x5b2fe7[_0x6e3f('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ca6cd,null))['then'](saveUpdates(_0x5b2fe7[_0x6e3f('0x54')],null))[_0x6e3f('0x21')](function(_0x254d66){if(_0x254d66){_0x1fa169[_0x6e3f('0x28')]=_0x254d66[_0x6e3f('0x60')]({'plain':!![]});return db[_0x6e3f('0x61')][_0x6e3f('0x52')]({'where':{'id':_0x254d66['OpenchannelInteractionId']}});}return null;})[_0x6e3f('0x21')](handleEntityNotFound(_0x4ca6cd,null))[_0x6e3f('0x21')](function(_0x653530){if(_0x653530){return _0x653530['update']({'UserId':_0x5b2fe7['body'][_0x6e3f('0x5e')],'read1stAt':_[_0x6e3f('0x62')](_0x653530[_0x6e3f('0x63')])?moment()[_0x6e3f('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6e3f('0x21')](function(_0x9bffcc){if(_0x9bffcc){_0x1fa169['interaction']=_0x9bffcc[_0x6e3f('0x60')]({'plain':!![]});interaction_log[_0x6e3f('0x22')](_0x6e3f('0x64'),_0x5b2fe7['user']['id'],_0x5b2fe7[_0x6e3f('0x5f')][_0x6e3f('0x37')],_0x5b2fe7[_0x6e3f('0x5f')][_0x6e3f('0x65')],_0x1fa169[_0x6e3f('0x66')]['id'],_0x5b2fe7['body']?JSON['stringify'](_0x5b2fe7[_0x6e3f('0x54')]):_0x6e3f('0x67'));return respondWithRpcPromise(_0x6e3f('0x68'),_0x6e3f('0x69'),_0x1fa169);}return null;})['then'](function(_0x29b136){var _0x638b7=_0x6e3f('0x6a')+_0x29b136[_0x6e3f('0x28')][_0x6e3f('0x6b')];return db[_0x6e3f('0x6c')][_0x6e3f('0x3f')](_0x638b7,{'type':db[_0x6e3f('0x6d')][_0x6e3f('0x6e')][_0x6e3f('0x6f')],'raw':!![]})['then'](function(_0x3b2f58){return _0x3b2f58;});})[_0x6e3f('0x21')](function(_0x588011){if(_0x588011){_0x1fa169[_0x6e3f('0x28')]['contact']=_0x588011[0x0];if(!_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x5e')])return;return db[_0x6e3f('0x70')][_0x6e3f('0x52')]({'where':{'id':_0x5b2fe7[_0x6e3f('0x54')]['UserId'],'role':_0x6e3f('0x71')},'attributes':['id',_0x6e3f('0x37'),_0x6e3f('0x72'),_0x6e3f('0x73'),_0x6e3f('0x74')],'raw':!![]});}return null;})[_0x6e3f('0x21')](function(_0x565755){if(!_0x565755)return null;_0x1fa169[_0x6e3f('0x28')][_0x6e3f('0x71')]=_0x565755;return _0x1fa169;})[_0x6e3f('0x21')](function(_0x3d005f){if(_0x3d005f){if(_0x5b2fe7[_0x6e3f('0x54')][_0x6e3f('0x75')]){_0x1fa169[_0x6e3f('0x28')]['interface']=util[_0x6e3f('0x5c')]('SIP/%s',_0x5b2fe7[_0x6e3f('0x5f')][_0x6e3f('0x37')]);_0x1fa169[_0x6e3f('0x28')][_0x6e3f('0x76')]=_0x1fa169[_0x6e3f('0x76')];_0x1fa169[_0x6e3f('0x28')][_0x6e3f('0x77')]=_0x1fa169['channel'];_0x1fa169[_0x6e3f('0x28')][_0x6e3f('0x78')]='accept';return respondWithRpcPromise('EventManager',_0x6e3f('0x79'),{'event':_0x6e3f('0x7a'),'message':_0x1fa169['message']},client9002)['then'](function(){return _0x1fa169;});}return _0x1fa169;}return null;})['then'](respondWithResult(_0x4ca6cd,null))[_0x6e3f('0x29')](handleError(_0x4ca6cd,null));};var interaction_log=require(_0x6e3f('0x12'))('openchannel-interactions');exports[_0x6e3f('0x34')]=function(_0x1a8099,_0x352967,_0x3453c7){var _0x158865={'agent':{},'channel':_0x6e3f('0x5a')};if(_0x1a8099[_0x6e3f('0x54')]['id']){delete _0x1a8099[_0x6e3f('0x54')]['id'];}_0x1a8099[_0x6e3f('0x54')]['UserId']=_0x1a8099['body'][_0x6e3f('0x5e')]||_0x1a8099[_0x6e3f('0x5f')]['id'];_0x158865[_0x6e3f('0x71')]['id']=_0x1a8099[_0x6e3f('0x54')][_0x6e3f('0x5e')];return db['OpenchannelMessage'][_0x6e3f('0x52')]({'where':{'id':_0x1a8099['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x352967,null))[_0x6e3f('0x21')](function(_0xf0edee){if(_0xf0edee){_0x158865[_0x6e3f('0x28')]=_0xf0edee[_0x6e3f('0x60')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xf0edee['OpenchannelInteractionId']}});}return null;})[_0x6e3f('0x21')](handleEntityNotFound(_0x352967,null))[_0x6e3f('0x21')](function(_0x2c59ec){if(_0x2c59ec){_0x158865['interaction']=_0x2c59ec['get']({'plain':!![]});interaction_log[_0x6e3f('0x22')](_0x6e3f('0x7b'),_0x1a8099[_0x6e3f('0x5f')]['id'],_0x1a8099[_0x6e3f('0x5f')]['name'],_0x1a8099[_0x6e3f('0x5f')][_0x6e3f('0x65')],_0x158865[_0x6e3f('0x66')]['id'],_0x1a8099[_0x6e3f('0x54')]?JSON[_0x6e3f('0x7c')](_0x1a8099[_0x6e3f('0x54')]):_0x6e3f('0x67'));return respondWithRpcPromise('RejectMessage',_0x6e3f('0x7d'),_0x158865);}return null;})['then'](function(_0x531b19){var _0x125b6a=_0x6e3f('0x6a')+_0x531b19['message'][_0x6e3f('0x6b')];return db[_0x6e3f('0x6c')][_0x6e3f('0x3f')](_0x125b6a,{'type':db[_0x6e3f('0x6d')][_0x6e3f('0x6e')][_0x6e3f('0x6f')],'raw':!![]})[_0x6e3f('0x21')](function(_0x3b8e2c){return _0x3b8e2c;});})[_0x6e3f('0x21')](function(_0x15585b){if(_0x15585b){_0x158865[_0x6e3f('0x28')][_0x6e3f('0x7e')]=_0x15585b[0x0];if(!_0x1a8099[_0x6e3f('0x54')]['UserId'])return;return db['User'][_0x6e3f('0x52')]({'where':{'id':_0x1a8099[_0x6e3f('0x54')][_0x6e3f('0x5e')],'role':_0x6e3f('0x71')},'attributes':['id','name',_0x6e3f('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x6e3f('0x21')](function(_0x6b7fb9){if(!_0x6b7fb9)return null;_0x158865[_0x6e3f('0x28')][_0x6e3f('0x71')]=_0x6b7fb9;return _0x158865;})[_0x6e3f('0x21')](function(_0xff494c){if(_0xff494c){_0xff494c[_0x6e3f('0x28')][_0x6e3f('0x7f')]=util[_0x6e3f('0x5c')](_0x6e3f('0x80'),_0x1a8099[_0x6e3f('0x5f')][_0x6e3f('0x37')]);_0xff494c[_0x6e3f('0x28')][_0x6e3f('0x76')]=_0x158865[_0x6e3f('0x76')];_0xff494c['message'][_0x6e3f('0x77')]=_0x158865[_0x6e3f('0x76')];_0xff494c[_0x6e3f('0x28')][_0x6e3f('0x78')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x6e3f('0x81'),'message':_0xff494c[_0x6e3f('0x28')]},client9002);return _0x158865;}return null;})[_0x6e3f('0x21')](respondWithResult(_0x352967,null))[_0x6e3f('0x29')](handleError(_0x352967,null));}; \ No newline at end of file +var _0x24fb=['interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','event','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','include','options','find','create','body','describe','../../config/logger','accept','openchannel','read','readAt','format','UserId','user','params','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x40f4c1,_0x3490b9){var _0x31a93e=function(_0xf56258){while(--_0xf56258){_0x40f4c1['push'](_0x40f4c1['shift']());}};_0x31a93e(++_0x3490b9);}(_0x24fb,0x121));var _0xb24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb24f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb24f('0x1'));var rp=require(_0xb24f('0x2'));var moment=require(_0xb24f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb24f('0x4'));var path=require('path');var sox=require(_0xb24f('0x5'));var csv=require(_0xb24f('0x6'));var ejs=require(_0xb24f('0x7'));var fs=require('fs');var fs_extra=require(_0xb24f('0x8'));var _=require(_0xb24f('0x9'));var squel=require('squel');var crypto=require(_0xb24f('0xa'));var jsforce=require(_0xb24f('0xb'));var deskjs=require(_0xb24f('0xc'));var toCsv=require(_0xb24f('0x6'));var querystring=require(_0xb24f('0xd'));var Papa=require(_0xb24f('0xe'));var Redis=require(_0xb24f('0xf'));var authService=require(_0xb24f('0x10'));var qs=require(_0xb24f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb24f('0x12'));var utils=require(_0xb24f('0x13'));var config=require(_0xb24f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb24f('0x15'))['db'];config['redis']=_[_0xb24f('0x16')](config[_0xb24f('0x17')],{'host':_0xb24f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb24f('0x17')]));require(_0xb24f('0x19'))[_0xb24f('0x1a')](socket);var jayson=require(_0xb24f('0x1b'));var client=jayson[_0xb24f('0x1c')][_0xb24f('0x1d')]({'port':0x232c});var client9002=jayson[_0xb24f('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1342fd,_0x59c238,_0x2d4bdd,_0x4b1418){return new BPromise(function(_0x294441,_0x9b4cba){var _0x5bcf4b=_0x4b1418||client;return _0x5bcf4b['request'](_0x1342fd,_0x2d4bdd)[_0xb24f('0x1e')](function(_0x4a80f7){logger[_0xb24f('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0xb24f('0x20'));logger['debug'](_0xb24f('0x21'),_0x59c238,_0xb24f('0x20'),JSON[_0xb24f('0x22')](_0x4a80f7));if(_0x4a80f7[_0xb24f('0x23')]){if(_0x4a80f7[_0xb24f('0x23')]['code']===0x1f4){logger[_0xb24f('0x23')](_0xb24f('0x24'),_0x59c238,_0x4a80f7[_0xb24f('0x23')]['message']);return _0x9b4cba(_0x4a80f7[_0xb24f('0x23')]['message']);}logger[_0xb24f('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0x4a80f7[_0xb24f('0x23')][_0xb24f('0x25')]);return _0x294441(_0x4a80f7[_0xb24f('0x23')]['message']);}else{logger[_0xb24f('0x1f')](_0xb24f('0x24'),_0x59c238,_0xb24f('0x20'));_0x294441(_0x4a80f7[_0xb24f('0x26')]['message']);}})[_0xb24f('0x27')](function(_0x309c17){logger[_0xb24f('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0x309c17);_0x9b4cba(_0x309c17);});});}function respondWithStatusCode(_0x488268,_0x996e82){_0x996e82=_0x996e82||0xcc;return function(_0x76bb66){if(_0x76bb66){return _0x488268['sendStatus'](_0x996e82);}return _0x488268['status'](_0x996e82)[_0xb24f('0x28')]();};}function respondWithResult(_0x4dda34,_0x5ddf95){_0x5ddf95=_0x5ddf95||0xc8;return function(_0x5e38f0){if(_0x5e38f0){return _0x4dda34[_0xb24f('0x29')](_0x5ddf95)[_0xb24f('0x2a')](_0x5e38f0);}};}function respondWithFilteredResult(_0xcd6a5c,_0x59558c){return function(_0xc9d402){if(_0xc9d402){var _0x5333c0=typeof _0x59558c[_0xb24f('0x2b')]===_0xb24f('0x2c')&&typeof _0x59558c[_0xb24f('0x2d')]===_0xb24f('0x2c');var _0x558ffb=_0xc9d402[_0xb24f('0x2e')];var _0x13f9e9=_0x5333c0?0x0:_0x59558c[_0xb24f('0x2b')];var _0x242713=_0x5333c0?_0xc9d402['count']:_0x59558c[_0xb24f('0x2b')]+_0x59558c[_0xb24f('0x2d')];var _0x2ac4da;if(_0x242713>=_0x558ffb){_0x242713=_0x558ffb;_0x2ac4da=0xc8;}else{_0x2ac4da=0xce;}_0xcd6a5c['status'](_0x2ac4da);return _0xcd6a5c[_0xb24f('0x2f')](_0xb24f('0x30'),_0x13f9e9+'-'+_0x242713+'/'+_0x558ffb)[_0xb24f('0x2a')](_0xc9d402);}return null;};}function patchUpdates(_0xf306f3){return function(_0xb1a09b){try{jsonpatch['apply'](_0xb1a09b,_0xf306f3,!![]);}catch(_0x37f434){return BPromise[_0xb24f('0x31')](_0x37f434);}return _0xb1a09b[_0xb24f('0x32')]();};}function saveUpdates(_0x3d0501,_0x715d34){return function(_0x1669ff){if(_0x1669ff){return _0x1669ff[_0xb24f('0x33')](_0x3d0501)['then'](function(_0x328eb0){return _0x328eb0;});}return null;};}function removeEntity(_0x246ee5,_0x4e59f6){return function(_0x1c7fe5){if(_0x1c7fe5){return _0x1c7fe5[_0xb24f('0x34')]()['then'](function(){_0x246ee5[_0xb24f('0x29')](0xcc)[_0xb24f('0x28')]();});}};}function handleEntityNotFound(_0x8d4808,_0xa9567b){return function(_0x3be407){if(!_0x3be407){_0x8d4808[_0xb24f('0x35')](0x194);}return _0x3be407;};}function handleError(_0xac6251,_0x2c2b04){_0x2c2b04=_0x2c2b04||0x1f4;return function(_0x35b2d9){logger[_0xb24f('0x23')](_0x35b2d9[_0xb24f('0x36')]);if(_0x35b2d9['name']){delete _0x35b2d9[_0xb24f('0x37')];}_0xac6251[_0xb24f('0x29')](_0x2c2b04)['send'](_0x35b2d9);};}exports[_0xb24f('0x38')]=function(_0xd85ff8,_0x4fb4d0){var _0x4dcfe2={},_0x6b6fe4={},_0x4c6e1e={'count':0x0,'rows':[]};var _0x443098=_[_0xb24f('0x39')](db[_0xb24f('0x3a')][_0xb24f('0x3b')],function(_0x373b2d){return{'name':_0x373b2d[_0xb24f('0x3c')],'type':_0x373b2d[_0xb24f('0x3d')][_0xb24f('0x3e')]};});_0x6b6fe4[_0xb24f('0x3f')]=_[_0xb24f('0x39')](_0x443098,_0xb24f('0x37'));_0x6b6fe4['query']=_[_0xb24f('0x40')](_0xd85ff8[_0xb24f('0x41')]);_0x6b6fe4[_0xb24f('0x42')]=_[_0xb24f('0x43')](_0x6b6fe4[_0xb24f('0x3f')],_0x6b6fe4['query']);_0x4dcfe2[_0xb24f('0x44')]=_[_0xb24f('0x43')](_0x6b6fe4['model'],qs[_0xb24f('0x45')](_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x45')]));_0x4dcfe2['attributes']=_0x4dcfe2[_0xb24f('0x44')][_0xb24f('0x46')]?_0x4dcfe2[_0xb24f('0x44')]:_0x6b6fe4[_0xb24f('0x3f')];if(!_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x47')](_0xb24f('0x48'))){_0x4dcfe2[_0xb24f('0x2d')]=qs[_0xb24f('0x2d')](_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x2d')]);_0x4dcfe2[_0xb24f('0x2b')]=qs['offset'](_0xd85ff8['query'][_0xb24f('0x2b')]);}_0x4dcfe2[_0xb24f('0x49')]=qs[_0xb24f('0x4a')](_0xd85ff8[_0xb24f('0x41')]['sort']);_0x4dcfe2[_0xb24f('0x4b')]=qs[_0xb24f('0x42')](_[_0xb24f('0x4c')](_0xd85ff8[_0xb24f('0x41')],_0x6b6fe4['filters']),_0x443098);if(_0xd85ff8['query'][_0xb24f('0x4d')]){_0x4dcfe2[_0xb24f('0x4b')]=_[_0xb24f('0x4e')](_0x4dcfe2['where'],{'$or':_[_0xb24f('0x39')](_0x443098,function(_0x110e65){if(_0x110e65[_0xb24f('0x3d')]!==_0xb24f('0x4f')){var _0x1d3a62={};_0x1d3a62[_0x110e65[_0xb24f('0x37')]]={'$like':'%'+_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x4d')]+'%'};return _0x1d3a62;}})});}_0x4dcfe2=_['merge']({},_0x4dcfe2,_0xd85ff8['options']);var _0x31a605={'where':_0x4dcfe2[_0xb24f('0x4b')]};return db['OpenchannelMessage'][_0xb24f('0x2e')](_0x31a605)[_0xb24f('0x1e')](function(_0x1efc2a){_0x4c6e1e['count']=_0x1efc2a;if(_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x50')]){_0x4dcfe2['include']=[{'all':!![]}];}return db[_0xb24f('0x3a')][_0xb24f('0x51')](_0x4dcfe2);})[_0xb24f('0x1e')](function(_0x33ce44){_0x4c6e1e['rows']=_0x33ce44;return _0x4c6e1e;})[_0xb24f('0x1e')](respondWithFilteredResult(_0x4fb4d0,_0x4dcfe2))[_0xb24f('0x27')](handleError(_0x4fb4d0,null));};exports[_0xb24f('0x52')]=function(_0x48e3d9,_0xfcf1e2){var _0x1eb121={'raw':!![],'where':{'id':_0x48e3d9['params']['id']}},_0x46ec47={};_0x46ec47['model']=_[_0xb24f('0x40')](db['OpenchannelMessage'][_0xb24f('0x3b')]);_0x46ec47[_0xb24f('0x41')]=_[_0xb24f('0x40')](_0x48e3d9[_0xb24f('0x41')]);_0x46ec47['filters']=_[_0xb24f('0x43')](_0x46ec47[_0xb24f('0x3f')],_0x46ec47[_0xb24f('0x41')]);_0x1eb121[_0xb24f('0x44')]=_['intersection'](_0x46ec47[_0xb24f('0x3f')],qs[_0xb24f('0x45')](_0x48e3d9[_0xb24f('0x41')]['fields']));_0x1eb121['attributes']=_0x1eb121[_0xb24f('0x44')]['length']?_0x1eb121[_0xb24f('0x44')]:_0x46ec47[_0xb24f('0x3f')];if(_0x48e3d9[_0xb24f('0x41')][_0xb24f('0x50')]){_0x1eb121[_0xb24f('0x53')]=[{'all':!![]}];}_0x1eb121=_[_0xb24f('0x4e')]({},_0x1eb121,_0x48e3d9[_0xb24f('0x54')]);return db['OpenchannelMessage'][_0xb24f('0x55')](_0x1eb121)[_0xb24f('0x1e')](handleEntityNotFound(_0xfcf1e2,null))[_0xb24f('0x1e')](respondWithResult(_0xfcf1e2,null))['catch'](handleError(_0xfcf1e2,null));};exports[_0xb24f('0x56')]=function(_0x22d058,_0x233047){return db['OpenchannelMessage'][_0xb24f('0x56')](_0x22d058[_0xb24f('0x57')],{})[_0xb24f('0x1e')](respondWithResult(_0x233047,0xc9))['catch'](handleError(_0x233047,null));};exports[_0xb24f('0x33')]=function(_0x422cf9,_0xdccb48){if(_0x422cf9[_0xb24f('0x57')]['id']){delete _0x422cf9['body']['id'];}return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x422cf9['params']['id']}})[_0xb24f('0x1e')](handleEntityNotFound(_0xdccb48,null))[_0xb24f('0x1e')](saveUpdates(_0x422cf9[_0xb24f('0x57')],null))[_0xb24f('0x1e')](respondWithResult(_0xdccb48,null))['catch'](handleError(_0xdccb48,null));};exports[_0xb24f('0x34')]=function(_0x532c22,_0x53da7b){return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x532c22['params']['id']}})['then'](handleEntityNotFound(_0x53da7b,null))[_0xb24f('0x1e')](removeEntity(_0x53da7b,null))[_0xb24f('0x27')](handleError(_0x53da7b,null));};exports[_0xb24f('0x58')]=function(_0x558a79,_0x106836){return db[_0xb24f('0x3a')][_0xb24f('0x58')]()[_0xb24f('0x1e')](respondWithResult(_0x106836,null))[_0xb24f('0x27')](handleError(_0x106836,null));};var interaction_log=require(_0xb24f('0x59'))('openchannel-interactions');exports[_0xb24f('0x5a')]=function(_0x5891f0,_0x107723,_0x4f4cc1){var _0x4f4a4f={'agent':{},'channel':_0xb24f('0x5b')};if(_0x5891f0[_0xb24f('0x57')]['id']){delete _0x5891f0[_0xb24f('0x57')]['id'];}_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5c')]=!![];_0x5891f0['body'][_0xb24f('0x5d')]=moment()[_0xb24f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')]=_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')]||_0x5891f0[_0xb24f('0x60')]['id'];_0x4f4a4f['agent']['id']=_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')];return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x5891f0[_0xb24f('0x61')]['id'],'UserId':null}})[_0xb24f('0x1e')](handleEntityNotFound(_0x107723,null))['then'](saveUpdates(_0x5891f0['body'],null))[_0xb24f('0x1e')](function(_0x31e94e){if(_0x31e94e){_0x4f4a4f[_0xb24f('0x25')]=_0x31e94e[_0xb24f('0x62')]({'plain':!![]});return db[_0xb24f('0x63')][_0xb24f('0x55')]({'where':{'id':_0x31e94e['OpenchannelInteractionId']}});}return null;})[_0xb24f('0x1e')](handleEntityNotFound(_0x107723,null))[_0xb24f('0x1e')](function(_0x5585da){if(_0x5585da){return _0x5585da[_0xb24f('0x33')]({'UserId':_0x5891f0[_0xb24f('0x57')]['UserId'],'read1stAt':_[_0xb24f('0x64')](_0x5585da[_0xb24f('0x65')])?moment()[_0xb24f('0x5e')](_0xb24f('0x66')):undefined});}return null;})[_0xb24f('0x1e')](function(_0xa47ada){if(_0xa47ada){_0x4f4a4f['interaction']=_0xa47ada[_0xb24f('0x62')]({'plain':!![]});interaction_log[_0xb24f('0x1f')](_0xb24f('0x67'),_0x5891f0[_0xb24f('0x60')]['id'],_0x5891f0[_0xb24f('0x60')]['name'],_0x5891f0[_0xb24f('0x60')]['role'],_0x4f4a4f[_0xb24f('0x68')]['id'],_0x5891f0[_0xb24f('0x57')]?JSON['stringify'](_0x5891f0[_0xb24f('0x57')]):_0xb24f('0x69'));return respondWithRpcPromise(_0xb24f('0x6a'),_0xb24f('0x6b'),_0x4f4a4f);}return null;})[_0xb24f('0x1e')](function(_0xdfd0b9){var _0x29ca4f=_0xb24f('0x6c')+_0xdfd0b9['message'][_0xb24f('0x6d')];return db[_0xb24f('0x6e')]['query'](_0x29ca4f,{'type':db[_0xb24f('0x6f')][_0xb24f('0x70')][_0xb24f('0x71')],'raw':!![]})[_0xb24f('0x1e')](function(_0x510a9c){return _0x510a9c;});})['then'](function(_0x16e1f6){if(_0x16e1f6){_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x72')]=_0x16e1f6[0x0];if(!_0x5891f0['body']['UserId'])return;return db['User'][_0xb24f('0x55')]({'where':{'id':_0x5891f0['body'][_0xb24f('0x5f')],'role':_0xb24f('0x73')},'attributes':['id','name',_0xb24f('0x74'),_0xb24f('0x75'),_0xb24f('0x76')],'raw':!![]});}return null;})[_0xb24f('0x1e')](function(_0x31a007){if(!_0x31a007)return null;_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x73')]=_0x31a007;return _0x4f4a4f;})[_0xb24f('0x1e')](function(_0x5e013f){if(_0x5e013f){if(_0x5891f0['body'][_0xb24f('0x77')]){_0x4f4a4f['message'][_0xb24f('0x78')]=util['format']('SIP/%s',_0x5891f0[_0xb24f('0x60')][_0xb24f('0x37')]);_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x79')]=_0x4f4a4f['channel'];_0x4f4a4f['message'][_0xb24f('0x7a')]=_0x4f4a4f['channel'];_0x4f4a4f[_0xb24f('0x25')]['event']=_0xb24f('0x5a');return respondWithRpcPromise(_0xb24f('0x7b'),_0xb24f('0x7b'),{'event':'acceptmessage','message':_0x4f4a4f[_0xb24f('0x25')]},client9002)[_0xb24f('0x1e')](function(){return _0x4f4a4f;});}return _0x4f4a4f;}return null;})[_0xb24f('0x1e')](respondWithResult(_0x107723,null))['catch'](handleError(_0x107723,null));};var interaction_log=require(_0xb24f('0x59'))('openchannel-interactions');exports[_0xb24f('0x31')]=function(_0x575237,_0x4a161b,_0x376c71){var _0x29845b={'agent':{},'channel':'openchannel'};if(_0x575237[_0xb24f('0x57')]['id']){delete _0x575237[_0xb24f('0x57')]['id'];}_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')]=_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')]||_0x575237[_0xb24f('0x60')]['id'];_0x29845b['agent']['id']=_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')];return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x575237[_0xb24f('0x61')]['id'],'UserId':null}})[_0xb24f('0x1e')](handleEntityNotFound(_0x4a161b,null))[_0xb24f('0x1e')](function(_0x1d6012){if(_0x1d6012){_0x29845b[_0xb24f('0x25')]=_0x1d6012['get']({'plain':!![]});return db[_0xb24f('0x63')]['find']({'where':{'id':_0x1d6012[_0xb24f('0x7c')]}});}return null;})[_0xb24f('0x1e')](handleEntityNotFound(_0x4a161b,null))[_0xb24f('0x1e')](function(_0x36529e){if(_0x36529e){_0x29845b['interaction']=_0x36529e[_0xb24f('0x62')]({'plain':!![]});interaction_log[_0xb24f('0x1f')](_0xb24f('0x7d'),_0x575237[_0xb24f('0x60')]['id'],_0x575237[_0xb24f('0x60')][_0xb24f('0x37')],_0x575237[_0xb24f('0x60')][_0xb24f('0x7e')],_0x29845b[_0xb24f('0x68')]['id'],_0x575237['body']?JSON['stringify'](_0x575237[_0xb24f('0x57')]):_0xb24f('0x69'));return respondWithRpcPromise(_0xb24f('0x7f'),_0xb24f('0x80'),_0x29845b);}return null;})['then'](function(_0x480936){var _0x320e9f=_0xb24f('0x6c')+_0x480936[_0xb24f('0x25')]['ContactId'];return db[_0xb24f('0x6e')][_0xb24f('0x41')](_0x320e9f,{'type':db[_0xb24f('0x6f')]['QueryTypes'][_0xb24f('0x71')],'raw':!![]})[_0xb24f('0x1e')](function(_0x373c67){return _0x373c67;});})[_0xb24f('0x1e')](function(_0x39f452){if(_0x39f452){_0x29845b[_0xb24f('0x25')][_0xb24f('0x72')]=_0x39f452[0x0];if(!_0x575237['body']['UserId'])return;return db['User'][_0xb24f('0x55')]({'where':{'id':_0x575237['body'][_0xb24f('0x5f')],'role':_0xb24f('0x73')},'attributes':['id',_0xb24f('0x37'),_0xb24f('0x74'),_0xb24f('0x75'),_0xb24f('0x76')],'raw':!![]});}return null;})[_0xb24f('0x1e')](function(_0x4dd493){if(!_0x4dd493)return null;_0x29845b[_0xb24f('0x25')][_0xb24f('0x73')]=_0x4dd493;return _0x29845b;})[_0xb24f('0x1e')](function(_0x14867d){if(_0x14867d){_0x14867d[_0xb24f('0x25')]['interface']=util[_0xb24f('0x5e')](_0xb24f('0x81'),_0x575237[_0xb24f('0x60')][_0xb24f('0x37')]);_0x14867d[_0xb24f('0x25')]['channel']=_0x29845b[_0xb24f('0x79')];_0x14867d['message'][_0xb24f('0x7a')]=_0x29845b['channel'];_0x14867d['message'][_0xb24f('0x82')]=_0xb24f('0x31');respondWithRpcPromise(_0xb24f('0x7b'),_0xb24f('0x7b'),{'event':'rejectmessage','message':_0x14867d[_0xb24f('0x25')]},client9002);return _0x29845b;}return null;})[_0xb24f('0x1e')](respondWithResult(_0x4a161b,null))['catch'](handleError(_0x4a161b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index b9d5c06..7ebc72c 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 _0x7074=['save','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x381bfa,_0x20954a){var _0x4ae8b4=function(_0x3a9801){while(--_0x3a9801){_0x381bfa['push'](_0x381bfa['shift']());}};_0x4ae8b4(++_0x20954a);}(_0x7074,0xdc));var _0x4707=function(_0x103d33,_0x221a0f){_0x103d33=_0x103d33-0x0;var _0x3af91c=_0x7074[_0x103d33];return _0x3af91c;};'use strict';var EventEmitter=require(_0x4707('0x0'));var OpenchannelMessage=require(_0x4707('0x1'))['db'][_0x4707('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4707('0x3')](0x0);var events={'afterCreate':_0x4707('0x4'),'afterUpdate':'update','afterDestroy':_0x4707('0x5')};function emitEvent(_0x1bbb40){return function(_0x1aaa90,_0x2ee1f4,_0x541505){OpenchannelMessageEvents['emit'](_0x1bbb40+':'+_0x1aaa90['id'],_0x1aaa90);OpenchannelMessageEvents['emit'](_0x1bbb40,_0x1aaa90);_0x541505(null);};}for(var e in events){if(events[_0x4707('0x6')](e)){var event=events[e];OpenchannelMessage[_0x4707('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x1e7f=['hook','OpenchannelMessage','setMaxListeners','update','remove','emit'];(function(_0x2693b8,_0x5f52ef){var _0x2a4684=function(_0x26e72c){while(--_0x26e72c){_0x2693b8['push'](_0x2693b8['shift']());}};_0x2a4684(++_0x5f52ef);}(_0x1e7f,0x14b));var _0xf1e7=function(_0x5f56dd,_0x440faa){_0x5f56dd=_0x5f56dd-0x0;var _0x34eebb=_0x1e7f[_0x5f56dd];return _0x34eebb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xf1e7('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf1e7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1e7('0x2'),'afterDestroy':_0xf1e7('0x3')};function emitEvent(_0x5a1ae4){return function(_0x100ec3,_0x24ef06,_0x107a18){OpenchannelMessageEvents[_0xf1e7('0x4')](_0x5a1ae4+':'+_0x100ec3['id'],_0x100ec3);OpenchannelMessageEvents[_0xf1e7('0x4')](_0x5a1ae4,_0x100ec3);_0x107a18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xf1e7('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2982536..93bad60 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 _0xb688=['then','replyUri','info','format','length','Interaction','omit','Contact','POST','threadId','update','OpenchannelMessage,\x20%s,\x20%s','afterCreate','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb688,0xcf));var _0x8b68=function(_0x49506e,_0x26c246){_0x49506e=_0x49506e-0x0;var _0x300bce=_0xb688[_0x49506e];return _0x300bce;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[{'name':_0x8b68('0xc'),'fields':[_0x8b68('0xd')],'type':_0x8b68('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f9685,_0x261753,_0x21d944){var _0x24e0b0=_0x583d16[_0x8b68('0xf')];var _0x418775=_0x3f9685[_0x8b68('0x10')]({'plain':!![]});if(_0x418775[_0x8b68('0x11')]['toLowerCase']()==='in'||_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()===_0x8b68('0x13')&&!_0x418775[_0x8b68('0x14')]&&!_[_0x8b68('0x15')](_0x418775[_0x8b68('0x16')])){_0x24e0b0[_0x8b68('0x17')][_0x8b68('0x18')]({'where':{'id':_0x418775[_0x8b68('0x19')]}})['then'](function(_0xb2df35){if(_0xb2df35){_0xb2df35['update']({'lastMsgAt':_0x418775['createdAt'],'lastMsgDirection':_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()});}})[_0x8b68('0x1a')](function(_0x5d3468){console['error'](_0x5d3468);});}if(_0x418775[_0x8b68('0x11')]==='out'&&!_0x418775[_0x8b68('0x14')]){var _0xb44923;_0x24e0b0[_0x8b68('0x1b')][_0x8b68('0x1c')]()['then'](function(_0xd17693){return _0x24e0b0[_0x8b68('0x1d')]['find']({'where':{'id':_0x418775[_0x8b68('0x1e')]},'include':[{'model':_0x24e0b0[_0x8b68('0x17')],'as':_0x8b68('0x1f'),'where':{'id':_0x418775[_0x8b68('0x19')]},'limit':0x1,'include':[{'model':_0x24e0b0[_0x8b68('0x1b')],'as':'Contact','attributes':_[_0x8b68('0x20')](_0xd17693)}]}]});})[_0x8b68('0x21')](function(_0x59e9b1){_0xb44923=_0x59e9b1[_0x8b68('0x10')]({'plain':!![]});if(_0xb44923&&_0xb44923[_0x8b68('0x22')]){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0xb44923[_0x8b68('0x1f')]&&_0xb44923[_0x8b68('0x1f')][_0x8b68('0x25')]){_0x418775[_0x8b68('0x26')]=_[_0x8b68('0x27')](_0xb44923['Interactions'][0x0],_0x8b68('0x28'));_0x418775[_0x8b68('0x28')]=_0xb44923['Interactions'][0x0][_0x8b68('0x28')];}var _0x261753={'method':_0x8b68('0x29'),'uri':encodeURI(_0xb44923['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x261753['method']){case'GET':_0x261753['qs']=_0x418775;break;case _0x8b68('0x29'):_0x261753[_0x8b68('0xd')]=_0x418775;break;}return rp(_0x261753)[_0x8b68('0x21')](function(_0x583476){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0x583476[_0x8b68('0xd')]['threadId']&&_0x583476['body'][_0x8b68('0x2a')]!=_0x418775[_0x8b68('0x26')][_0x8b68('0x2a')]){return _0x24e0b0[_0x8b68('0x17')][_0x8b68('0x2b')]({'threadId':_0x583476[_0x8b68('0xd')][_0x8b68('0x2a')]},{'logging':!![],'where':{'id':_0x418775['Interaction']['id']}});}else{return;}})[_0x8b68('0x21')](function(){return _0x3f9685['update']({'read':!![]});})[_0x8b68('0x1a')](function(_0x133b75){logger['error'](_0x8b68('0x2c'),_0x8b68('0x2d'),util[_0x8b68('0x2e')](_0x133b75,{'showHidden':![],'depth':null}));_0x21d944();});}else{_0x21d944();}})['finally'](function(){_0x21d944();});}else{_0x21d944();}}},'charset':'utf8mb4','collate':_0x8b68('0x2f')});}; \ No newline at end of file +var _0x4fc2=['length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x1f6704,_0x106f36){var _0x4acab6=function(_0x398633){while(--_0x398633){_0x1f6704['push'](_0x1f6704['shift']());}};_0x4acab6(++_0x106f36);}(_0x4fc2,0x111));var _0x24fc=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0x4fc2[_0x217ecd];return _0x50b480;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[{'name':_0x24fc('0xb'),'fields':[_0x24fc('0xc')],'type':_0x24fc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47349b,_0x5afdf1,_0x44caca){var _0x1819a5=_0x26fcc6[_0x24fc('0xe')];var _0x133438=_0x47349b[_0x24fc('0xf')]({'plain':!![]});if(_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()==='in'||_0x133438[_0x24fc('0x10')]['toLowerCase']()===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]&&!_['isNil'](_0x133438[_0x24fc('0x14')])){_0x1819a5[_0x24fc('0x15')][_0x24fc('0x16')]({'where':{'id':_0x133438[_0x24fc('0x17')]}})[_0x24fc('0x18')](function(_0x326276){if(_0x326276){_0x326276['update']({'lastMsgAt':_0x133438[_0x24fc('0x19')],'lastMsgDirection':_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()});}})[_0x24fc('0x1a')](function(_0x4acd36){console[_0x24fc('0x1b')](_0x4acd36);});}if(_0x133438['direction']===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]){var _0x218fb6;_0x1819a5[_0x24fc('0x1c')][_0x24fc('0x1d')]()['then'](function(_0x23873c){return _0x1819a5[_0x24fc('0x1e')][_0x24fc('0x1f')]({'where':{'id':_0x133438[_0x24fc('0x20')]},'include':[{'model':_0x1819a5['OpenchannelInteraction'],'as':_0x24fc('0x21'),'where':{'id':_0x133438[_0x24fc('0x17')]},'limit':0x1,'include':[{'model':_0x1819a5[_0x24fc('0x1c')],'as':'Contact','attributes':_[_0x24fc('0x22')](_0x23873c)}]}]});})[_0x24fc('0x18')](function(_0xbf1d6b){_0x218fb6=_0xbf1d6b[_0x24fc('0xf')]({'plain':!![]});if(_0x218fb6&&_0x218fb6['replyUri']){logger[_0x24fc('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x24fc('0x24'),util['format'](_0x24fc('0x25'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x218fb6[_0x24fc('0x21')]&&_0x218fb6['Interactions'][_0x24fc('0x27')]){_0x133438['Interaction']=_[_0x24fc('0x28')](_0x218fb6[_0x24fc('0x21')][0x0],_0x24fc('0x29'));_0x133438[_0x24fc('0x29')]=_0x218fb6[_0x24fc('0x21')][0x0][_0x24fc('0x29')];}var _0x5afdf1={'method':_0x24fc('0x2a'),'uri':encodeURI(_0x218fb6[_0x24fc('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5afdf1[_0x24fc('0x2b')]){case'GET':_0x5afdf1['qs']=_0x133438;break;case _0x24fc('0x2a'):_0x5afdf1[_0x24fc('0xc')]=_0x133438;break;}return rp(_0x5afdf1)[_0x24fc('0x18')](function(_0x5bb4c8){logger[_0x24fc('0x23')](_0x24fc('0x2c'),_0x24fc('0x24'),util[_0x24fc('0x2d')](_0x24fc('0x2e'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x5bb4c8['body'][_0x24fc('0x2f')]&&_0x5bb4c8[_0x24fc('0xc')][_0x24fc('0x2f')]!=_0x133438[_0x24fc('0x30')][_0x24fc('0x2f')]){return _0x1819a5['OpenchannelInteraction']['update']({'threadId':_0x5bb4c8['body'][_0x24fc('0x2f')]},{'logging':!![],'where':{'id':_0x133438['Interaction']['id']}});}else{return;}})[_0x24fc('0x18')](function(){return _0x47349b[_0x24fc('0x31')]({'read':!![]});})[_0x24fc('0x1a')](function(_0x2086c0){logger['error'](_0x24fc('0x2c'),_0x24fc('0x24'),util['inspect'](_0x2086c0,{'showHidden':![],'depth':null}));_0x44caca();});}else{_0x44caca();}})[_0x24fc('0x32')](function(){_0x44caca();});}else{_0x44caca();}}},'charset':_0x24fc('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c5752ed..d7174e5 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x472b1f,_0x4178c9){var _0x4efcc9=function(_0x2fe450){while(--_0x2fe450){_0x472b1f['push'](_0x472b1f['shift']());}};_0x4efcc9(++_0x4178c9);}(_0xadb5,0xad));var _0x5adb=function(_0x3cd3e0,_0x23ba9c){_0x3cd3e0=_0x3cd3e0-0x0;var _0x135d9a=_0xadb5[_0x3cd3e0];return _0x135d9a;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a9b11,_0xb6c98){var _0x5e6324=function(_0x18058d){while(--_0x18058d){_0x3a9b11['push'](_0x3a9b11['shift']());}};_0x5e6324(++_0xb6c98);}(_0x1261,0x144));var _0x1126=function(_0x5263d2,_0x476862){_0x5263d2=_0x5263d2-0x0;var _0x2363a0=_0x1261[_0x5263d2];return _0x2363a0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c512d6c..5e23120 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 _0x52a0=['save','remove','update','register','./openchannelMessage.events'];(function(_0x406125,_0x360a00){var _0x525307=function(_0x4bb436){while(--_0x4bb436){_0x406125['push'](_0x406125['shift']());}};_0x525307(++_0x360a00);}(_0x52a0,0x149));var _0x052a=function(_0x3e06dd,_0x55694f){_0x3e06dd=_0x3e06dd-0x0;var _0x4bbb8b=_0x52a0[_0x3e06dd];return _0x4bbb8b;};'use strict';var OpenchannelMessageEvents=require(_0x052a('0x0'));var events=[_0x052a('0x1'),_0x052a('0x2'),_0x052a('0x3')];function createListener(_0x2696b1,_0x2808e0){return function(_0x35de49){_0x2808e0['emit'](_0x2696b1,_0x35de49);};}function removeListener(_0x65cee1,_0xa3d3fd){return function(){OpenchannelMessageEvents['removeListener'](_0x65cee1,_0xa3d3fd);};}exports[_0x052a('0x4')]=function(_0x348874){for(var _0x37a42f=0x0,_0x3be434=events['length'];_0x37a42f<_0x3be434;_0x37a42f++){var _0x218e70=events[_0x37a42f];var _0x2d3f74=createListener('openchannelMessage:'+_0x218e70,_0x348874);OpenchannelMessageEvents['on'](_0x218e70,_0x2d3f74);}}; \ No newline at end of file +var _0xe64b=['save','remove','emit','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x3574f7,_0x1d8e89){var _0x2a554f=function(_0x1d231a){while(--_0x1d231a){_0x3574f7['push'](_0x3574f7['shift']());}};_0x2a554f(++_0x1d8e89);}(_0xe64b,0x1a3));var _0xbe64=function(_0x5c47f9,_0x23861e){_0x5c47f9=_0x5c47f9-0x0;var _0x3f9439=_0xe64b[_0x5c47f9];return _0x3f9439;};'use strict';var OpenchannelMessageEvents=require(_0xbe64('0x0'));var events=[_0xbe64('0x1'),_0xbe64('0x2'),'update'];function createListener(_0x65fcae,_0xadf1c5){return function(_0x4d5ff8){_0xadf1c5[_0xbe64('0x3')](_0x65fcae,_0x4d5ff8);};}function removeListener(_0x24e586,_0x4e62da){return function(){OpenchannelMessageEvents['removeListener'](_0x24e586,_0x4e62da);};}exports[_0xbe64('0x4')]=function(_0x4286e3){for(var _0x37a226=0x0,_0x56f0cc=events['length'];_0x37a226<_0x56f0cc;_0x37a226++){var _0xe3eabc=events[_0x37a226];var _0x1b4025=createListener(_0xbe64('0x5')+_0xe3eabc,_0x4286e3);OpenchannelMessageEvents['on'](_0xe3eabc,_0x1b4025);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c83b46e..e608c70 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 _0xab0f=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','removeTeams','delete','removeAgents','exports','multer','util','path'];(function(_0x2c6360,_0x2189e8){var _0x3ac9e8=function(_0x42a3af){while(--_0x42a3af){_0x2c6360['push'](_0x2c6360['shift']());}};_0x3ac9e8(++_0x2189e8);}(_0xab0f,0x126));var _0xfab0=function(_0xe6cf2e,_0x373880){_0xe6cf2e=_0xe6cf2e-0x0;var _0x135c05=_0xab0f[_0xe6cf2e];return _0x135c05;};'use strict';var multer=require(_0xfab0('0x0'));var util=require(_0xfab0('0x1'));var path=require(_0xfab0('0x2'));var timeout=require(_0xfab0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfab0('0x4'));var interaction=require(_0xfab0('0x5'));var config=require(_0xfab0('0x6'));var controller=require(_0xfab0('0x7'));router[_0xfab0('0x8')]('/',auth[_0xfab0('0x9')](),controller['index']);router[_0xfab0('0x8')](_0xfab0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xfab0('0x8')](_0xfab0('0xb'),auth[_0xfab0('0x9')](),controller[_0xfab0('0xc')]);router[_0xfab0('0x8')]('/:id/members',auth[_0xfab0('0x9')](),controller[_0xfab0('0xd')]);router[_0xfab0('0x8')]('/:id/teams',auth[_0xfab0('0x9')](),controller[_0xfab0('0xe')]);router[_0xfab0('0x8')](_0xfab0('0xf'),auth[_0xfab0('0x9')](),controller[_0xfab0('0x10')]);router[_0xfab0('0x11')]('/',auth[_0xfab0('0x9')](),controller[_0xfab0('0x12')]);router[_0xfab0('0x11')](_0xfab0('0x13'),auth[_0xfab0('0x9')](),controller[_0xfab0('0x14')]);router['post'](_0xfab0('0xf'),auth[_0xfab0('0x9')](),controller[_0xfab0('0x15')]);router['put']('/:id',auth[_0xfab0('0x9')](),controller[_0xfab0('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth[_0xfab0('0x9')](),controller[_0xfab0('0x17')]);router[_0xfab0('0x18')](_0xfab0('0xf'),auth[_0xfab0('0x9')](),controller[_0xfab0('0x19')]);module[_0xfab0('0x1a')]=router; \ No newline at end of file +var _0xd2f6=['create','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd2f6,0x173));var _0x6d2f=function(_0x44dbaf,_0x45cc41){_0x44dbaf=_0x44dbaf-0x0;var _0x34c7b8=_0xd2f6[_0x44dbaf];return _0x34c7b8;};'use strict';var multer=require(_0x6d2f('0x0'));var util=require('util');var path=require(_0x6d2f('0x1'));var timeout=require(_0x6d2f('0x2'));var express=require(_0x6d2f('0x3'));var router=express[_0x6d2f('0x4')]();var fs_extra=require(_0x6d2f('0x5'));var auth=require(_0x6d2f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d2f('0x7'));var controller=require(_0x6d2f('0x8'));router[_0x6d2f('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d2f('0xa')]);router['get']('/describe',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0xc')]);router['get']('/:id',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0xd')]);router[_0x6d2f('0x9')](_0x6d2f('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x6d2f('0x9')](_0x6d2f('0xf'),auth['isAuthenticated'](),controller[_0x6d2f('0x10')]);router[_0x6d2f('0x9')](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x12')]);router['post']('/',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x13')]);router[_0x6d2f('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6d2f('0x15')]);router['post'](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x16')]);router[_0x6d2f('0x17')](_0x6d2f('0x18'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x19')]);router[_0x6d2f('0x1a')](_0x6d2f('0x18'),auth[_0x6d2f('0xb')](),controller['destroy']);router[_0x6d2f('0x1a')](_0x6d2f('0xf'),auth['isAuthenticated'](),controller[_0x6d2f('0x1b')]);router[_0x6d2f('0x1a')](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x1c')]);module[_0x6d2f('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4e8f173..5e22aa2 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 _0xd347=['ENUM','rrmemory','exports','name','STRING'];(function(_0x4f9428,_0x4af466){var _0x355237=function(_0xb719a3){while(--_0xb719a3){_0x4f9428['push'](_0x4f9428['shift']());}};_0x355237(++_0x4af466);}(_0xd347,0x1b0));var _0x7d34=function(_0x191c3f,_0x154cdf){_0x191c3f=_0x191c3f-0x0;var _0x44cb0e=_0xd347[_0x191c3f];return _0x44cb0e;};'use strict';var Sequelize=require('sequelize');module[_0x7d34('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7d34('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d34('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d34('0x3')](_0x7d34('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x51e7=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x279841,_0x4e9e3b){var _0x4d3a9f=function(_0x261c2d){while(--_0x261c2d){_0x279841['push'](_0x279841['shift']());}};_0x4d3a9f(++_0x4e9e3b);}(_0x51e7,0x179));var _0x751e=function(_0x2d25ed,_0x1527f7){_0x2d25ed=_0x2d25ed-0x0;var _0x58ba35=_0x51e7[_0x2d25ed];return _0x58ba35;};'use strict';var Sequelize=require(_0x751e('0x0'));module[_0x751e('0x1')]={'name':{'type':Sequelize[_0x751e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x751e('0x2')]},'timeout':{'type':Sequelize[_0x751e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x751e('0x4')](_0x751e('0x5'),_0x751e('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 206cee0..d27263f 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 _0xdb36=['util','sox','to-csv','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','OpenchannelQueues','UserProfileResource','destroy','stack','name','index','map','OpenchannelQueue','type','key','model','query','keys','intersection','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','params','describe','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','options','User','findAndCountAll','UserId','agent','openchannelPause','%s/%s','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdb36,0x7d));var _0x6db3=function(_0x2a8f41,_0x3afda5){_0x2a8f41=_0x2a8f41-0x0;var _0x141b4b=_0xdb36[_0x2a8f41];return _0x141b4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6db3('0x0'));var jsonpatch=require(_0x6db3('0x1'));var rp=require(_0x6db3('0x2'));var moment=require('moment');var BPromise=require(_0x6db3('0x3'));var Mustache=require('mustache');var util=require(_0x6db3('0x4'));var path=require('path');var sox=require(_0x6db3('0x5'));var csv=require(_0x6db3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6db3('0x7'));var squel=require('squel');var crypto=require(_0x6db3('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6db3('0x9'));var Redis=require(_0x6db3('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x6db3('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6db3('0xc'));var logger=require(_0x6db3('0xd'))(_0x6db3('0xe'));var utils=require(_0x6db3('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x6db3('0x10'));var db=require(_0x6db3('0x11'))['db'];config['redis']=_[_0x6db3('0x12')](config[_0x6db3('0x13')],{'host':_0x6db3('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6db3('0x13')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x13c4af,_0x28331f){_0x28331f=_0x28331f||0xcc;return function(_0x55e285){if(_0x55e285){return _0x13c4af[_0x6db3('0x15')](_0x28331f);}return _0x13c4af[_0x6db3('0x16')](_0x28331f)[_0x6db3('0x17')]();};}function respondWithResult(_0x463852,_0x14e492){_0x14e492=_0x14e492||0xc8;return function(_0x4254fd){if(_0x4254fd){return _0x463852[_0x6db3('0x16')](_0x14e492)['json'](_0x4254fd);}};}function respondWithFilteredResult(_0x2efed4,_0x36435b){return function(_0x88a364){if(_0x88a364){var _0x2ba1db=typeof _0x36435b[_0x6db3('0x18')]===_0x6db3('0x19')&&typeof _0x36435b['limit']===_0x6db3('0x19');var _0x189c27=_0x88a364[_0x6db3('0x1a')];var _0x41236f=_0x2ba1db?0x0:_0x36435b['offset'];var _0x56cab4=_0x2ba1db?_0x88a364[_0x6db3('0x1a')]:_0x36435b[_0x6db3('0x18')]+_0x36435b[_0x6db3('0x1b')];var _0x2126f1;if(_0x56cab4>=_0x189c27){_0x56cab4=_0x189c27;_0x2126f1=0xc8;}else{_0x2126f1=0xce;}_0x2efed4[_0x6db3('0x16')](_0x2126f1);return _0x2efed4[_0x6db3('0x1c')](_0x6db3('0x1d'),_0x41236f+'-'+_0x56cab4+'/'+_0x189c27)[_0x6db3('0x1e')](_0x88a364);}return null;};}function patchUpdates(_0x650931){return function(_0x438564){try{jsonpatch['apply'](_0x438564,_0x650931,!![]);}catch(_0x269eb3){return BPromise[_0x6db3('0x1f')](_0x269eb3);}return _0x438564['save']();};}function saveUpdates(_0x46d070,_0x3c7ee1){return function(_0x4e788b){if(_0x4e788b){return _0x4e788b[_0x6db3('0x20')](_0x46d070)[_0x6db3('0x21')](function(_0x56629d){return _0x56629d;});}return null;};}function removeEntity(_0x1db480,_0x4e0972){return function(_0x7461c9){if(_0x7461c9){return _0x7461c9['destroy']()[_0x6db3('0x21')](function(){var _0xba0cb6=_0x7461c9['get']({'plain':!![]});var _0xc6ebd8=_0x6db3('0x22');return db[_0x6db3('0x23')][_0x6db3('0x24')]({'where':{'type':_0xc6ebd8,'resourceId':_0xba0cb6['id']}})[_0x6db3('0x21')](function(){return _0x7461c9;});})[_0x6db3('0x21')](function(){_0x1db480[_0x6db3('0x16')](0xcc)[_0x6db3('0x17')]();});}};}function handleEntityNotFound(_0x346387,_0x34508a){return function(_0xb4cd89){if(!_0xb4cd89){_0x346387[_0x6db3('0x15')](0x194);}return _0xb4cd89;};}function handleError(_0x170321,_0x1fa101){_0x1fa101=_0x1fa101||0x1f4;return function(_0x254683){logger['error'](_0x254683[_0x6db3('0x25')]);if(_0x254683[_0x6db3('0x26')]){delete _0x254683[_0x6db3('0x26')];}_0x170321[_0x6db3('0x16')](_0x1fa101)['send'](_0x254683);};}exports[_0x6db3('0x27')]=function(_0x1d73b5,_0x5e1e2b){var _0x3c23e5={},_0x31f21d={},_0x142da5={'count':0x0,'rows':[]};var _0x16f462=_[_0x6db3('0x28')](db[_0x6db3('0x29')]['rawAttributes'],function(_0x11b7e9){return{'name':_0x11b7e9['fieldName'],'type':_0x11b7e9[_0x6db3('0x2a')][_0x6db3('0x2b')]};});_0x31f21d[_0x6db3('0x2c')]=_[_0x6db3('0x28')](_0x16f462,_0x6db3('0x26'));_0x31f21d[_0x6db3('0x2d')]=_[_0x6db3('0x2e')](_0x1d73b5[_0x6db3('0x2d')]);_0x31f21d['filters']=_[_0x6db3('0x2f')](_0x31f21d[_0x6db3('0x2c')],_0x31f21d[_0x6db3('0x2d')]);_0x3c23e5[_0x6db3('0x30')]=_[_0x6db3('0x2f')](_0x31f21d[_0x6db3('0x2c')],qs['fields'](_0x1d73b5['query']['fields']));_0x3c23e5[_0x6db3('0x30')]=_0x3c23e5['attributes'][_0x6db3('0x31')]?_0x3c23e5['attributes']:_0x31f21d[_0x6db3('0x2c')];if(!_0x1d73b5[_0x6db3('0x2d')]['hasOwnProperty']('nolimit')){_0x3c23e5[_0x6db3('0x1b')]=qs['limit'](_0x1d73b5[_0x6db3('0x2d')][_0x6db3('0x1b')]);_0x3c23e5[_0x6db3('0x18')]=qs[_0x6db3('0x18')](_0x1d73b5['query']['offset']);}_0x3c23e5[_0x6db3('0x32')]=qs[_0x6db3('0x33')](_0x1d73b5[_0x6db3('0x2d')][_0x6db3('0x33')]);_0x3c23e5[_0x6db3('0x34')]=qs[_0x6db3('0x35')](_[_0x6db3('0x36')](_0x1d73b5[_0x6db3('0x2d')],_0x31f21d[_0x6db3('0x35')]),_0x16f462);if(_0x1d73b5[_0x6db3('0x2d')][_0x6db3('0x37')]){_0x3c23e5[_0x6db3('0x34')]=_['merge'](_0x3c23e5[_0x6db3('0x34')],{'$or':_[_0x6db3('0x28')](_0x16f462,function(_0x346d2b){if(_0x346d2b['type']!==_0x6db3('0x38')){var _0x1898bd={};_0x1898bd[_0x346d2b[_0x6db3('0x26')]]={'$like':'%'+_0x1d73b5[_0x6db3('0x2d')][_0x6db3('0x37')]+'%'};return _0x1898bd;}})});}_0x3c23e5=_[_0x6db3('0x39')]({},_0x3c23e5,_0x1d73b5['options']);var _0x2fba4f={'where':_0x3c23e5['where']};return db['OpenchannelQueue'][_0x6db3('0x1a')](_0x2fba4f)[_0x6db3('0x21')](function(_0x30b127){_0x142da5[_0x6db3('0x1a')]=_0x30b127;if(_0x1d73b5['query']['includeAll']){_0x3c23e5[_0x6db3('0x3a')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x6db3('0x3b')](_0x3c23e5);})['then'](function(_0x26b21a){_0x142da5[_0x6db3('0x3c')]=_0x26b21a;return _0x142da5;})[_0x6db3('0x21')](respondWithFilteredResult(_0x5e1e2b,_0x3c23e5))[_0x6db3('0x3d')](handleError(_0x5e1e2b,null));};exports[_0x6db3('0x3e')]=function(_0x210833,_0x37e66d){var _0x1ff031={'raw':!![],'where':{'id':_0x210833['params']['id']}},_0x2960f0={};_0x2960f0[_0x6db3('0x2c')]=_['keys'](db[_0x6db3('0x29')][_0x6db3('0x3f')]);_0x2960f0['query']=_[_0x6db3('0x2e')](_0x210833[_0x6db3('0x2d')]);_0x2960f0['filters']=_[_0x6db3('0x2f')](_0x2960f0[_0x6db3('0x2c')],_0x2960f0[_0x6db3('0x2d')]);_0x1ff031[_0x6db3('0x30')]=_['intersection'](_0x2960f0[_0x6db3('0x2c')],qs[_0x6db3('0x40')](_0x210833['query'][_0x6db3('0x40')]));_0x1ff031['attributes']=_0x1ff031[_0x6db3('0x30')][_0x6db3('0x31')]?_0x1ff031['attributes']:_0x2960f0['model'];if(_0x210833[_0x6db3('0x2d')][_0x6db3('0x41')]){_0x1ff031[_0x6db3('0x3a')]=[{'all':!![]}];}_0x1ff031=_['merge']({},_0x1ff031,_0x210833['options']);return db[_0x6db3('0x29')][_0x6db3('0x42')](_0x1ff031)[_0x6db3('0x21')](handleEntityNotFound(_0x37e66d,null))[_0x6db3('0x21')](respondWithResult(_0x37e66d,null))['catch'](handleError(_0x37e66d,null));};exports['create']=function(_0x2ddd43,_0x41ea8f){return db[_0x6db3('0x29')]['create'](_0x2ddd43[_0x6db3('0x43')],{})[_0x6db3('0x21')](function(_0xdbb045){var _0x47f560=_0x2ddd43[_0x6db3('0x44')][_0x6db3('0x45')]({'plain':!![]});if(!_0x47f560)throw new Error(_0x6db3('0x46'));if(_0x47f560['role']===_0x6db3('0x44')){var _0x3222c9=_0xdbb045[_0x6db3('0x45')]({'plain':!![]});var _0x537bf8=_0x6db3('0x22');return db[_0x6db3('0x47')][_0x6db3('0x42')]({'where':{'name':_0x537bf8,'userProfileId':_0x47f560[_0x6db3('0x48')]},'raw':!![]})[_0x6db3('0x21')](function(_0x170bb1){if(_0x170bb1&&_0x170bb1[_0x6db3('0x49')]===0x0){return db[_0x6db3('0x23')][_0x6db3('0x4a')]({'name':_0x3222c9[_0x6db3('0x26')],'resourceId':_0x3222c9['id'],'type':_0x170bb1[_0x6db3('0x26')],'sectionId':_0x170bb1['id']},{})[_0x6db3('0x21')](function(){return _0xdbb045;});}else{return _0xdbb045;}})['catch'](function(_0xe1a55f){logger[_0x6db3('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe1a55f);throw _0xe1a55f;});}return _0xdbb045;})[_0x6db3('0x21')](respondWithResult(_0x41ea8f,0xc9))[_0x6db3('0x3d')](handleError(_0x41ea8f,null));};exports[_0x6db3('0x20')]=function(_0x387b6a,_0xe65e69){if(_0x387b6a[_0x6db3('0x43')]['id']){delete _0x387b6a[_0x6db3('0x43')]['id'];}return db[_0x6db3('0x29')][_0x6db3('0x42')]({'where':{'id':_0x387b6a[_0x6db3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe65e69,null))[_0x6db3('0x21')](saveUpdates(_0x387b6a[_0x6db3('0x43')],null))[_0x6db3('0x21')](respondWithResult(_0xe65e69,null))['catch'](handleError(_0xe65e69,null));};exports[_0x6db3('0x24')]=function(_0x1dae3d,_0x3ec757){return db[_0x6db3('0x29')]['find']({'where':{'id':_0x1dae3d[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](handleEntityNotFound(_0x3ec757,null))[_0x6db3('0x21')](removeEntity(_0x3ec757,null))[_0x6db3('0x3d')](handleError(_0x3ec757,null));};exports[_0x6db3('0x4d')]=function(_0x394d15,_0x1c5f94){return db[_0x6db3('0x29')][_0x6db3('0x4d')]()[_0x6db3('0x21')](respondWithResult(_0x1c5f94,null))[_0x6db3('0x3d')](handleError(_0x1c5f94,null));};exports['getMembers']=function(_0x3120db,_0x12a9ff,_0x462a38){var _0x1b3d1c={'raw':!![],'where':{}},_0x305abe={},_0x25852a;return db['OpenchannelQueue'][_0x6db3('0x4e')]({'where':{'id':_0x3120db[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](handleEntityNotFound(_0x12a9ff,null))[_0x6db3('0x21')](function(_0x12fc51){if(_0x12fc51){_0x25852a=_0x12fc51[_0x6db3('0x45')]({'plain':!![]});_0x305abe[_0x6db3('0x2c')]=_['keys'](db[_0x6db3('0x4f')][_0x6db3('0x3f')]);_0x305abe['query']=_['keys'](_0x3120db[_0x6db3('0x2d')]);_0x305abe[_0x6db3('0x35')]=_[_0x6db3('0x2f')](_0x305abe[_0x6db3('0x2c')],_0x305abe[_0x6db3('0x2d')]);_0x1b3d1c['attributes']=_[_0x6db3('0x2f')](_0x305abe['model'],qs[_0x6db3('0x40')](_0x3120db[_0x6db3('0x2d')][_0x6db3('0x40')]));_0x1b3d1c[_0x6db3('0x30')]=_0x1b3d1c[_0x6db3('0x30')][_0x6db3('0x31')]?_0x1b3d1c[_0x6db3('0x30')]:_0x305abe[_0x6db3('0x2c')];if(!_0x3120db[_0x6db3('0x2d')][_0x6db3('0x50')]('nolimit')){_0x1b3d1c[_0x6db3('0x1b')]=qs[_0x6db3('0x1b')](_0x3120db[_0x6db3('0x2d')][_0x6db3('0x1b')]);_0x1b3d1c['offset']=qs[_0x6db3('0x18')](_0x3120db[_0x6db3('0x2d')]['offset']);}_0x1b3d1c[_0x6db3('0x32')]=qs[_0x6db3('0x33')](_0x3120db[_0x6db3('0x2d')][_0x6db3('0x33')]);_0x1b3d1c[_0x6db3('0x34')]=qs[_0x6db3('0x35')](_[_0x6db3('0x36')](_0x3120db[_0x6db3('0x2d')],_0x305abe[_0x6db3('0x35')]));_0x1b3d1c[_0x6db3('0x34')][_0x6db3('0x51')]=_0x12fc51['id'];if(_0x3120db['query']['filter']){_0x1b3d1c['where']=_[_0x6db3('0x39')](_0x1b3d1c[_0x6db3('0x34')],{'$or':_[_0x6db3('0x28')](_0x1b3d1c[_0x6db3('0x30')],function(_0x436b2){var _0x484012={};_0x484012[_0x436b2]={'$like':'%'+_0x3120db[_0x6db3('0x2d')][_0x6db3('0x37')]+'%'};return _0x484012;})});}_0x1b3d1c=_[_0x6db3('0x39')]({},_0x1b3d1c,_0x3120db[_0x6db3('0x52')]);return db[_0x6db3('0x4f')]['findAll'](_0x1b3d1c);}})[_0x6db3('0x21')](function(_0x25edd9){if(_0x25edd9){return db[_0x6db3('0x53')][_0x6db3('0x54')]({'where':{'id':_['map'](_0x25edd9,_0x6db3('0x55')),'role':_0x6db3('0x56')},'attributes':['id',_0x6db3('0x26'),_0x6db3('0x57'),'updatedAt','createdAt']});}})[_0x6db3('0x21')](function(_0x161ac9){if(_0x161ac9){return{'count':_0x161ac9['count'],'rows':_['map'](_0x161ac9[_0x6db3('0x3c')],function(_0x1e0b63){return{'membername':_0x1e0b63[_0x6db3('0x26')],'UserId':_0x1e0b63['id'],'queue_name':_0x25852a[_0x6db3('0x26')],'OpenchannelQueueId':_0x25852a['id'],'interface':util['format'](_0x6db3('0x58'),'SIP',_0x1e0b63[_0x6db3('0x26')]),'penalty':0x0,'paused':_0x1e0b63[_0x6db3('0x57')],'createdAt':_0x1e0b63['createdAt'],'updatedAt':_0x1e0b63['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6db3('0x21')](respondWithFilteredResult(_0x12a9ff,_0x1b3d1c))['catch'](handleError(_0x12a9ff,null));};exports[_0x6db3('0x59')]=function(_0x5c93d6,_0x577649,_0x4c5d85){var _0x12377f={};var _0x1f24b6={};var _0x32d84d;var _0x1e2e6a;return db[_0x6db3('0x29')][_0x6db3('0x4e')]({'where':{'id':_0x5c93d6[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](handleEntityNotFound(_0x577649,null))['then'](function(_0x3ed821){if(_0x3ed821){_0x32d84d=_0x3ed821;_0x1f24b6[_0x6db3('0x2c')]=_['keys'](db[_0x6db3('0x5a')]['rawAttributes']);_0x1f24b6[_0x6db3('0x2d')]=_[_0x6db3('0x2e')](_0x5c93d6[_0x6db3('0x2d')]);_0x1f24b6[_0x6db3('0x35')]=_[_0x6db3('0x2f')](_0x1f24b6[_0x6db3('0x2c')],_0x1f24b6[_0x6db3('0x2d')]);_0x12377f[_0x6db3('0x30')]=_[_0x6db3('0x2f')](_0x1f24b6[_0x6db3('0x2c')],qs[_0x6db3('0x40')](_0x5c93d6[_0x6db3('0x2d')]['fields']));_0x12377f[_0x6db3('0x30')]=_0x12377f[_0x6db3('0x30')][_0x6db3('0x31')]?_0x12377f[_0x6db3('0x30')]:_0x1f24b6['model'];_0x12377f[_0x6db3('0x32')]=qs[_0x6db3('0x33')](_0x5c93d6[_0x6db3('0x2d')]['sort']);_0x12377f['where']=qs[_0x6db3('0x35')](_[_0x6db3('0x36')](_0x5c93d6[_0x6db3('0x2d')],_0x1f24b6[_0x6db3('0x35')]));if(_0x5c93d6[_0x6db3('0x2d')][_0x6db3('0x37')]){_0x12377f[_0x6db3('0x34')]=_[_0x6db3('0x39')](_0x12377f['where'],{'$or':_[_0x6db3('0x28')](_0x12377f['attributes'],function(_0x8833af){var _0x234189={};_0x234189[_0x8833af]={'$like':'%'+_0x5c93d6[_0x6db3('0x2d')][_0x6db3('0x37')]+'%'};return _0x234189;})});}_0x12377f=_[_0x6db3('0x39')]({},_0x12377f,_0x5c93d6[_0x6db3('0x52')]);return _0x32d84d[_0x6db3('0x59')](_0x12377f);}})['then'](function(_0x241bab){if(_0x241bab){_0x1e2e6a=_0x241bab[_0x6db3('0x31')];if(!_0x5c93d6['query'][_0x6db3('0x50')](_0x6db3('0x5b'))){_0x12377f[_0x6db3('0x1b')]=qs[_0x6db3('0x1b')](_0x5c93d6[_0x6db3('0x2d')][_0x6db3('0x1b')]);_0x12377f[_0x6db3('0x18')]=qs[_0x6db3('0x18')](_0x5c93d6[_0x6db3('0x2d')]['offset']);}return _0x32d84d[_0x6db3('0x59')](_0x12377f);}})[_0x6db3('0x21')](function(_0x30eab1){if(_0x30eab1){return _0x30eab1?{'count':_0x1e2e6a,'rows':_0x30eab1}:null;}})['then'](respondWithResult(_0x577649,null))[_0x6db3('0x3d')](handleError(_0x577649,null));};exports[_0x6db3('0x5c')]=function(_0x43ba63,_0x1721ec,_0x7b9a3d){var _0x126e41=_0x43ba63[_0x6db3('0x43')][_0x6db3('0x5d')];return db['Team'][_0x6db3('0x3b')]({'where':{'id':_0x126e41},'attributes':['id'],'include':[{'model':db[_0x6db3('0x53')],'as':_0x6db3('0x5e'),'attributes':['id',_0x6db3('0x26'),'online',_0x6db3('0x5f'),'interface'],'raw':!![]}]})[_0x6db3('0x21')](function(_0x5a42cf){if(_0x5a42cf){var _0x5e5176=_[_0x6db3('0x60')](_0x5a42cf,function(_0x353bc8){var _0x151bcb=_0x353bc8['get']({'plain':!![]});return _0x151bcb[_0x6db3('0x5e')];});return db[_0x6db3('0x29')][_0x6db3('0x42')]({'where':{'id':_0x43ba63[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](function(_0x4340de){return db[_0x6db3('0x61')][_0x6db3('0x62')](function(_0x5e7e9b){return _0x4340de['addTeams'](_0x126e41,{'transaction':_0x5e7e9b})[_0x6db3('0x21')](function(){return BPromise[_0x6db3('0x63')](_0x5e5176,function(_0x162c21){return db[_0x6db3('0x4f')][_0x6db3('0x64')]({'where':{'UserId':_0x162c21['id'],'OpenchannelQueueId':_0x43ba63[_0x6db3('0x4c')]['id']},'transaction':_0x5e7e9b});});})[_0x6db3('0x21')](function(){_0x5e5176[_0x6db3('0x65')](function(_0x87f8fd){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x87f8fd['id'],'OpenchannelQueueId':_0x4340de['id']});});});});});}})[_0x6db3('0x21')](respondWithStatusCode(_0x1721ec,null))['catch'](handleError(_0x1721ec,null));};exports[_0x6db3('0x66')]=function(_0x2ff675,_0x54cb7e,_0x4a6efa){return db['Team'][_0x6db3('0x3b')]({'where':{'id':_0x2ff675['query'][_0x6db3('0x5d')]},'attributes':['id'],'include':[{'model':db[_0x6db3('0x53')],'as':_0x6db3('0x5e'),'attributes':['id'],'raw':!![]}]})[_0x6db3('0x21')](handleEntityNotFound(_0x54cb7e,null))[_0x6db3('0x21')](function(_0x399f0e){var _0x27ffd8=_[_0x6db3('0x28')](_0x399f0e,'id');var _0xa3a498=[];var _0x2178f9=[];var _0x4dad30=squel[_0x6db3('0x67')]();_0x4dad30[_0x6db3('0x68')](_0x6db3('0x69'))['from']('team_has_openchannel_queues','tq')[_0x6db3('0x6a')](_0x6db3('0x6b'),'ut',_0x6db3('0x6c'))[_0x6db3('0x34')]('OpenchannelQueueId\x20=\x20?',_0x2ff675['params']['id']);for(var _0x67c04a=0x0;_0x67c04a<_0x399f0e[_0x6db3('0x31')];_0x67c04a+=0x1){let _0x14772c=_0x399f0e[_0x67c04a];for(var _0x1eb0f4=0x0;_0x1eb0f4<_0x14772c['Agents']['length'];_0x1eb0f4+=0x1){let _0xadf58b=_0x14772c[_0x6db3('0x5e')][_0x1eb0f4];var _0x29f2c3=_0x4dad30[_0x6db3('0x6d')]();_0x29f2c3[_0x6db3('0x34')](_0x6db3('0x6e'),_0xadf58b['id']);_0x2178f9[_0x6db3('0x6f')](db[_0x6db3('0x61')][_0x6db3('0x2d')](_0x29f2c3[_0x6db3('0x70')](),{'type':db[_0x6db3('0x61')][_0x6db3('0x71')][_0x6db3('0x72')]})['then'](function(_0x13ccaa){if(_0x13ccaa[_0x6db3('0x31')]===0x1){return _0xadf58b['id'];}else{var _0x10188c=_[_0x6db3('0x73')](_[_0x6db3('0x28')](_0x13ccaa,_0x6db3('0x74')),function(_0x5040a2){return _['includes'](_0x27ffd8,_0x5040a2);});if(_0x10188c){return _0xadf58b['id'];}}}));}}return BPromise[_0x6db3('0x75')](_0x2178f9)[_0x6db3('0x21')](function(_0x3ae116){_0xa3a498=_(_0xa3a498)[_0x6db3('0x76')](_0x3ae116)[_0x6db3('0x77')]()[_0x6db3('0x78')]();return db[_0x6db3('0x29')]['find']({'where':{'id':_0x2ff675[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](function(_0xfa6609){return db[_0x6db3('0x61')][_0x6db3('0x62')](function(_0x1f9373){return _0xfa6609[_0x6db3('0x66')](_0x2ff675[_0x6db3('0x2d')]['ids'],{'transaction':_0x1f9373})[_0x6db3('0x21')](function(){if(!_['isEmpty'](_0xa3a498)){return _0xfa6609[_0x6db3('0x79')](_0xa3a498,{'transaction':_0x1f9373});}})[_0x6db3('0x21')](function(){_0xa3a498[_0x6db3('0x65')](function(_0x5c50f6){socket[_0x6db3('0x7a')](_0x6db3('0x7b'),{'UserId':_0x5c50f6,'OpenchannelQueueId':_0xfa6609['id']});});});});});});})[_0x6db3('0x21')](respondWithStatusCode(_0x54cb7e,null))[_0x6db3('0x3d')](handleError(_0x54cb7e,null));};exports[_0x6db3('0x7c')]=function(_0x574086,_0x4a6b43,_0x4baf11){return db[_0x6db3('0x29')]['find']({'where':{'id':_0x574086['params']['id']}})['then'](handleEntityNotFound(_0x4a6b43,null))[_0x6db3('0x21')](function(_0x36dbce){if(_0x36dbce){return _0x36dbce[_0x6db3('0x7c')](_0x574086[_0x6db3('0x43')]['ids'],_['omit'](_0x574086[_0x6db3('0x43')],['ids','id'])||{})[_0x6db3('0x7d')](function(_0x225920){for(var _0x193b68=0x0;_0x193b68<_0x574086[_0x6db3('0x43')][_0x6db3('0x5d')][_0x6db3('0x31')];_0x193b68+=0x1){socket['emit'](_0x6db3('0x7e'),{'UserId':Number(_0x574086[_0x6db3('0x43')]['ids'][_0x193b68]),'OpenchannelQueueId':Number(_0x574086['params']['id'])});}return _0x225920;});}})[_0x6db3('0x21')](respondWithResult(_0x4a6b43,null))['catch'](handleError(_0x4a6b43,null));};exports['removeAgents']=function(_0x1c7615,_0x1fbc99,_0x3c0c37){return db['OpenchannelQueue'][_0x6db3('0x42')]({'where':{'id':_0x1c7615[_0x6db3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1fbc99,null))[_0x6db3('0x21')](function(_0x260245){if(_0x260245){return _0x260245[_0x6db3('0x79')](_0x1c7615[_0x6db3('0x2d')][_0x6db3('0x5d')])[_0x6db3('0x21')](function(){if(_[_0x6db3('0x7f')](_0x1c7615[_0x6db3('0x2d')]['ids'])){for(var _0x10bb7a=0x0;_0x10bb7a<_0x1c7615[_0x6db3('0x2d')][_0x6db3('0x5d')][_0x6db3('0x31')];_0x10bb7a+=0x1){socket[_0x6db3('0x7a')](_0x6db3('0x7b'),{'UserId':Number(_0x1c7615[_0x6db3('0x2d')][_0x6db3('0x5d')][_0x10bb7a]),'OpenchannelQueueId':Number(_0x1c7615[_0x6db3('0x4c')]['id'])});}}else{socket[_0x6db3('0x7a')](_0x6db3('0x7b'),{'UserId':Number(_0x1c7615['query'][_0x6db3('0x5d')]),'OpenchannelQueueId':Number(_0x1c7615[_0x6db3('0x4c')]['id'])});}});}})[_0x6db3('0x21')](respondWithStatusCode(_0x1fbc99,null))[_0x6db3('0x3d')](handleError(_0x1fbc99,null));};exports[_0x6db3('0x80')]=function(_0x208fd0,_0x561051,_0x15e3c5){var _0x19711c={};var _0x3f6975={};var _0x3b729f;var _0x2eca53;return db[_0x6db3('0x29')][_0x6db3('0x4e')]({'where':{'id':_0x208fd0[_0x6db3('0x4c')]['id']}})[_0x6db3('0x21')](handleEntityNotFound(_0x561051,null))['then'](function(_0xc2bd1e){if(_0xc2bd1e){_0x3b729f=_0xc2bd1e;_0x3f6975[_0x6db3('0x2c')]=_[_0x6db3('0x2e')](db[_0x6db3('0x53')][_0x6db3('0x3f')]);_0x3f6975[_0x6db3('0x2d')]=_['keys'](_0x208fd0[_0x6db3('0x2d')]);_0x3f6975['filters']=_[_0x6db3('0x2f')](_0x3f6975[_0x6db3('0x2c')],_0x3f6975[_0x6db3('0x2d')]);_0x19711c[_0x6db3('0x30')]=_['intersection'](_0x3f6975[_0x6db3('0x2c')],qs[_0x6db3('0x40')](_0x208fd0['query'][_0x6db3('0x40')]));_0x19711c[_0x6db3('0x30')]=_0x19711c['attributes'][_0x6db3('0x31')]?_0x19711c[_0x6db3('0x30')]:_0x3f6975['model'];_0x19711c[_0x6db3('0x32')]=qs[_0x6db3('0x33')](_0x208fd0[_0x6db3('0x2d')][_0x6db3('0x33')]);_0x19711c[_0x6db3('0x34')]=qs[_0x6db3('0x35')](_[_0x6db3('0x36')](_0x208fd0[_0x6db3('0x2d')],_0x3f6975[_0x6db3('0x35')]));if(_0x208fd0['query'][_0x6db3('0x37')]){_0x19711c[_0x6db3('0x34')]=_[_0x6db3('0x39')](_0x19711c[_0x6db3('0x34')],{'$or':_[_0x6db3('0x28')](_0x19711c[_0x6db3('0x30')],function(_0x16d419){var _0x386faa={};_0x386faa[_0x16d419]={'$like':'%'+_0x208fd0[_0x6db3('0x2d')][_0x6db3('0x37')]+'%'};return _0x386faa;})});}_0x19711c=_[_0x6db3('0x39')]({},_0x19711c,_0x208fd0[_0x6db3('0x52')]);return _0x3b729f[_0x6db3('0x80')](_0x19711c);}})[_0x6db3('0x21')](function(_0x25eff2){if(_0x25eff2){_0x2eca53=_0x25eff2[_0x6db3('0x31')];if(!_0x208fd0[_0x6db3('0x2d')]['hasOwnProperty'](_0x6db3('0x5b'))){_0x19711c[_0x6db3('0x1b')]=qs['limit'](_0x208fd0['query'][_0x6db3('0x1b')]);_0x19711c[_0x6db3('0x18')]=qs[_0x6db3('0x18')](_0x208fd0[_0x6db3('0x2d')][_0x6db3('0x18')]);}return _0x3b729f['getAgents'](_0x19711c);}})[_0x6db3('0x21')](function(_0x20be68){if(_0x20be68){return _0x20be68?{'count':_0x2eca53,'rows':_0x20be68}:null;}})[_0x6db3('0x21')](respondWithResult(_0x561051,null))[_0x6db3('0x3d')](handleError(_0x561051,null));}; \ No newline at end of file +var _0x9081=['OpenchannelQueue','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','openchannelPause','updatedAt','format','Team','getTeams','ids','findAll','online','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','Agents','select','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','SELECT','every','includes','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','spread','getAgents','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','destroy','error','name','send','map'];(function(_0x1ccf4f,_0x18ce33){var _0x3f747c=function(_0x166f08){while(--_0x166f08){_0x1ccf4f['push'](_0x1ccf4f['shift']());}};_0x3f747c(++_0x18ce33);}(_0x9081,0x16c));var _0x1908=function(_0x528cbc,_0x2d5422){_0x528cbc=_0x528cbc-0x0;var _0x5bb7e7=_0x9081[_0x528cbc];return _0x5bb7e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1908('0x0'));var zipdir=require(_0x1908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1908('0x2'));var moment=require(_0x1908('0x3'));var BPromise=require(_0x1908('0x4'));var Mustache=require(_0x1908('0x5'));var util=require(_0x1908('0x6'));var path=require(_0x1908('0x7'));var sox=require(_0x1908('0x8'));var csv=require('to-csv');var ejs=require(_0x1908('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1908('0xa'));var squel=require(_0x1908('0xb'));var crypto=require(_0x1908('0xc'));var jsforce=require(_0x1908('0xd'));var deskjs=require(_0x1908('0xe'));var toCsv=require(_0x1908('0xf'));var querystring=require(_0x1908('0x10'));var Papa=require(_0x1908('0x11'));var Redis=require(_0x1908('0x12'));var authService=require(_0x1908('0x13'));var qs=require(_0x1908('0x14'));var as=require(_0x1908('0x15'));var hardwareService=require(_0x1908('0x16'));var logger=require(_0x1908('0x17'))(_0x1908('0x18'));var utils=require(_0x1908('0x19'));var config=require(_0x1908('0x1a'));var licenseUtil=require(_0x1908('0x1b'));var db=require(_0x1908('0x1c'))['db'];config[_0x1908('0x1d')]=_['defaults'](config[_0x1908('0x1d')],{'host':_0x1908('0x1e'),'port':0x18eb});var socket=require(_0x1908('0x1f'))(new Redis(config[_0x1908('0x1d')]));require(_0x1908('0x20'))[_0x1908('0x21')](socket);function respondWithStatusCode(_0x42c1c2,_0x3d8604){_0x3d8604=_0x3d8604||0xcc;return function(_0xf64bb8){if(_0xf64bb8){return _0x42c1c2[_0x1908('0x22')](_0x3d8604);}return _0x42c1c2['status'](_0x3d8604)[_0x1908('0x23')]();};}function respondWithResult(_0x133fe5,_0xbc8c7a){_0xbc8c7a=_0xbc8c7a||0xc8;return function(_0x41b7e8){if(_0x41b7e8){return _0x133fe5[_0x1908('0x24')](_0xbc8c7a)[_0x1908('0x25')](_0x41b7e8);}};}function respondWithFilteredResult(_0x57ba37,_0x4091cd){return function(_0x345a82){if(_0x345a82){var _0x1d5cbd=typeof _0x4091cd[_0x1908('0x26')]===_0x1908('0x27')&&typeof _0x4091cd[_0x1908('0x28')]===_0x1908('0x27');var _0x37d394=_0x345a82[_0x1908('0x29')];var _0x25ee03=_0x1d5cbd?0x0:_0x4091cd[_0x1908('0x26')];var _0x5bdeb0=_0x1d5cbd?_0x345a82[_0x1908('0x29')]:_0x4091cd[_0x1908('0x26')]+_0x4091cd['limit'];var _0x2b0275;if(_0x5bdeb0>=_0x37d394){_0x5bdeb0=_0x37d394;_0x2b0275=0xc8;}else{_0x2b0275=0xce;}_0x57ba37[_0x1908('0x24')](_0x2b0275);return _0x57ba37[_0x1908('0x2a')](_0x1908('0x2b'),_0x25ee03+'-'+_0x5bdeb0+'/'+_0x37d394)['json'](_0x345a82);}return null;};}function patchUpdates(_0xdba86d){return function(_0x2fdf29){try{jsonpatch['apply'](_0x2fdf29,_0xdba86d,!![]);}catch(_0x3b8932){return BPromise[_0x1908('0x2c')](_0x3b8932);}return _0x2fdf29['save']();};}function saveUpdates(_0x5aeeb0,_0x4c82ae){return function(_0x4142f1){if(_0x4142f1){return _0x4142f1[_0x1908('0x2d')](_0x5aeeb0)[_0x1908('0x2e')](function(_0x26ec73){return _0x26ec73;});}return null;};}function removeEntity(_0x5e434e,_0x4ef7a8){return function(_0x1d24f1){if(_0x1d24f1){return _0x1d24f1['destroy']()[_0x1908('0x2e')](function(){var _0x1c10ad=_0x1d24f1[_0x1908('0x2f')]({'plain':!![]});var _0x412226='OpenchannelQueues';return db['UserProfileResource'][_0x1908('0x30')]({'where':{'type':_0x412226,'resourceId':_0x1c10ad['id']}})[_0x1908('0x2e')](function(){return _0x1d24f1;});})[_0x1908('0x2e')](function(){_0x5e434e['status'](0xcc)[_0x1908('0x23')]();});}};}function handleEntityNotFound(_0x4d7bb2,_0x2f1669){return function(_0x10404c){if(!_0x10404c){_0x4d7bb2[_0x1908('0x22')](0x194);}return _0x10404c;};}function handleError(_0x372efb,_0x497082){_0x497082=_0x497082||0x1f4;return function(_0x398d32){logger[_0x1908('0x31')](_0x398d32['stack']);if(_0x398d32[_0x1908('0x32')]){delete _0x398d32['name'];}_0x372efb[_0x1908('0x24')](_0x497082)[_0x1908('0x33')](_0x398d32);};}exports['index']=function(_0x16295f,_0x21a6ad){var _0x14e25c={},_0x52c8b8={},_0xf6a66e={'count':0x0,'rows':[]};var _0xfa3959=_[_0x1908('0x34')](db[_0x1908('0x35')]['rawAttributes'],function(_0x36f22c){return{'name':_0x36f22c[_0x1908('0x36')],'type':_0x36f22c[_0x1908('0x37')]['key']};});_0x52c8b8['model']=_[_0x1908('0x34')](_0xfa3959,_0x1908('0x32'));_0x52c8b8[_0x1908('0x38')]=_['keys'](_0x16295f[_0x1908('0x38')]);_0x52c8b8[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x52c8b8['model'],_0x52c8b8[_0x1908('0x38')]);_0x14e25c[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x52c8b8[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x16295f[_0x1908('0x38')]['fields']));_0x14e25c[_0x1908('0x3b')]=_0x14e25c[_0x1908('0x3b')][_0x1908('0x3e')]?_0x14e25c[_0x1908('0x3b')]:_0x52c8b8[_0x1908('0x3c')];if(!_0x16295f[_0x1908('0x38')][_0x1908('0x3f')]('nolimit')){_0x14e25c[_0x1908('0x28')]=qs[_0x1908('0x28')](_0x16295f[_0x1908('0x38')][_0x1908('0x28')]);_0x14e25c[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x16295f['query']['offset']);}_0x14e25c[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x16295f[_0x1908('0x38')][_0x1908('0x41')]);_0x14e25c[_0x1908('0x42')]=qs[_0x1908('0x39')](_[_0x1908('0x43')](_0x16295f[_0x1908('0x38')],_0x52c8b8[_0x1908('0x39')]),_0xfa3959);if(_0x16295f[_0x1908('0x38')][_0x1908('0x44')]){_0x14e25c['where']=_[_0x1908('0x45')](_0x14e25c[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0xfa3959,function(_0x190778){if(_0x190778[_0x1908('0x37')]!==_0x1908('0x46')){var _0x295dde={};_0x295dde[_0x190778['name']]={'$like':'%'+_0x16295f[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x295dde;}})});}_0x14e25c=_['merge']({},_0x14e25c,_0x16295f[_0x1908('0x47')]);var _0x4dbe95={'where':_0x14e25c[_0x1908('0x42')]};return db[_0x1908('0x35')]['count'](_0x4dbe95)['then'](function(_0x82bffc){_0xf6a66e[_0x1908('0x29')]=_0x82bffc;if(_0x16295f['query'][_0x1908('0x48')]){_0x14e25c[_0x1908('0x49')]=[{'all':!![]}];}return db[_0x1908('0x35')]['findAll'](_0x14e25c);})[_0x1908('0x2e')](function(_0xb118d4){_0xf6a66e[_0x1908('0x4a')]=_0xb118d4;return _0xf6a66e;})[_0x1908('0x2e')](respondWithFilteredResult(_0x21a6ad,_0x14e25c))[_0x1908('0x4b')](handleError(_0x21a6ad,null));};exports[_0x1908('0x4c')]=function(_0x2f57c4,_0x56e241){var _0xef3d7b={'raw':!![],'where':{'id':_0x2f57c4[_0x1908('0x4d')]['id']}},_0x3f0823={};_0x3f0823[_0x1908('0x3c')]=_[_0x1908('0x4e')](db['OpenchannelQueue'][_0x1908('0x4f')]);_0x3f0823[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x2f57c4[_0x1908('0x38')]);_0x3f0823[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x3f0823[_0x1908('0x3c')],_0x3f0823[_0x1908('0x38')]);_0xef3d7b[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x3f0823['model'],qs['fields'](_0x2f57c4['query'][_0x1908('0x3d')]));_0xef3d7b[_0x1908('0x3b')]=_0xef3d7b[_0x1908('0x3b')][_0x1908('0x3e')]?_0xef3d7b['attributes']:_0x3f0823[_0x1908('0x3c')];if(_0x2f57c4[_0x1908('0x38')][_0x1908('0x48')]){_0xef3d7b['include']=[{'all':!![]}];}_0xef3d7b=_[_0x1908('0x45')]({},_0xef3d7b,_0x2f57c4[_0x1908('0x47')]);return db['OpenchannelQueue'][_0x1908('0x50')](_0xef3d7b)[_0x1908('0x2e')](handleEntityNotFound(_0x56e241,null))[_0x1908('0x2e')](respondWithResult(_0x56e241,null))[_0x1908('0x4b')](handleError(_0x56e241,null));};exports[_0x1908('0x51')]=function(_0x5d9c46,_0x454d29){return db[_0x1908('0x35')][_0x1908('0x51')](_0x5d9c46['body'],{})['then'](function(_0x5086f8){var _0x30f971=_0x5d9c46[_0x1908('0x52')][_0x1908('0x2f')]({'plain':!![]});if(!_0x30f971)throw new Error(_0x1908('0x53'));if(_0x30f971['role']===_0x1908('0x52')){var _0x388538=_0x5086f8[_0x1908('0x2f')]({'plain':!![]});var _0x151cd4='OpenchannelQueues';return db[_0x1908('0x54')][_0x1908('0x50')]({'where':{'name':_0x151cd4,'userProfileId':_0x30f971[_0x1908('0x55')]},'raw':!![]})[_0x1908('0x2e')](function(_0x4ce019){if(_0x4ce019&&_0x4ce019[_0x1908('0x56')]===0x0){return db[_0x1908('0x57')][_0x1908('0x51')]({'name':_0x388538[_0x1908('0x32')],'resourceId':_0x388538['id'],'type':_0x4ce019[_0x1908('0x32')],'sectionId':_0x4ce019['id']},{})[_0x1908('0x2e')](function(){return _0x5086f8;});}else{return _0x5086f8;}})['catch'](function(_0x23de8f){logger['error'](_0x1908('0x58'),_0x23de8f);throw _0x23de8f;});}return _0x5086f8;})[_0x1908('0x2e')](respondWithResult(_0x454d29,0xc9))[_0x1908('0x4b')](handleError(_0x454d29,null));};exports[_0x1908('0x2d')]=function(_0x5955a1,_0x5124fc){if(_0x5955a1[_0x1908('0x59')]['id']){delete _0x5955a1[_0x1908('0x59')]['id'];}return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x5955a1[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x5124fc,null))['then'](saveUpdates(_0x5955a1[_0x1908('0x59')],null))[_0x1908('0x2e')](respondWithResult(_0x5124fc,null))[_0x1908('0x4b')](handleError(_0x5124fc,null));};exports[_0x1908('0x30')]=function(_0x59426e,_0x3b45ec){return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x59426e[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x3b45ec,null))[_0x1908('0x2e')](removeEntity(_0x3b45ec,null))['catch'](handleError(_0x3b45ec,null));};exports[_0x1908('0x5a')]=function(_0x576d4c,_0x3bb13f){return db['OpenchannelQueue'][_0x1908('0x5a')]()[_0x1908('0x2e')](respondWithResult(_0x3bb13f,null))[_0x1908('0x4b')](handleError(_0x3bb13f,null));};exports[_0x1908('0x5b')]=function(_0x4ac411,_0x5984a0,_0xf4d457){var _0x250009={'raw':!![],'where':{}},_0x4647c7={},_0x4eb6ac;return db['OpenchannelQueue'][_0x1908('0x5c')]({'where':{'id':_0x4ac411[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x5984a0,null))[_0x1908('0x2e')](function(_0x58d2ea){if(_0x58d2ea){_0x4eb6ac=_0x58d2ea[_0x1908('0x2f')]({'plain':!![]});_0x4647c7[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x5d')]['rawAttributes']);_0x4647c7[_0x1908('0x38')]=_['keys'](_0x4ac411['query']);_0x4647c7[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x4647c7[_0x1908('0x3c')],_0x4647c7[_0x1908('0x38')]);_0x250009[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x4647c7[_0x1908('0x3c')],qs['fields'](_0x4ac411[_0x1908('0x38')]['fields']));_0x250009[_0x1908('0x3b')]=_0x250009['attributes']['length']?_0x250009[_0x1908('0x3b')]:_0x4647c7['model'];if(!_0x4ac411[_0x1908('0x38')]['hasOwnProperty']('nolimit')){_0x250009[_0x1908('0x28')]=qs[_0x1908('0x28')](_0x4ac411[_0x1908('0x38')]['limit']);_0x250009[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x4ac411['query'][_0x1908('0x26')]);}_0x250009[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x4ac411['query'][_0x1908('0x41')]);_0x250009['where']=qs['filters'](_['pick'](_0x4ac411[_0x1908('0x38')],_0x4647c7[_0x1908('0x39')]));_0x250009[_0x1908('0x42')][_0x1908('0x5e')]=_0x58d2ea['id'];if(_0x4ac411[_0x1908('0x38')][_0x1908('0x44')]){_0x250009[_0x1908('0x42')]=_[_0x1908('0x45')](_0x250009[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0x250009['attributes'],function(_0x272a27){var _0x2e11ac={};_0x2e11ac[_0x272a27]={'$like':'%'+_0x4ac411[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x2e11ac;})});}_0x250009=_[_0x1908('0x45')]({},_0x250009,_0x4ac411[_0x1908('0x47')]);return db[_0x1908('0x5d')]['findAll'](_0x250009);}})[_0x1908('0x2e')](function(_0x313793){if(_0x313793){return db[_0x1908('0x5f')]['findAndCountAll']({'where':{'id':_[_0x1908('0x34')](_0x313793,_0x1908('0x60')),'role':_0x1908('0x61')},'attributes':['id','name',_0x1908('0x62'),_0x1908('0x63'),'createdAt']});}})[_0x1908('0x2e')](function(_0x5724c5){if(_0x5724c5){return{'count':_0x5724c5[_0x1908('0x29')],'rows':_['map'](_0x5724c5[_0x1908('0x4a')],function(_0x18aed1){return{'membername':_0x18aed1[_0x1908('0x32')],'UserId':_0x18aed1['id'],'queue_name':_0x4eb6ac[_0x1908('0x32')],'OpenchannelQueueId':_0x4eb6ac['id'],'interface':util[_0x1908('0x64')]('%s/%s','SIP',_0x18aed1['name']),'penalty':0x0,'paused':_0x18aed1[_0x1908('0x62')],'createdAt':_0x18aed1['createdAt'],'updatedAt':_0x18aed1[_0x1908('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5984a0,_0x250009))[_0x1908('0x4b')](handleError(_0x5984a0,null));};exports['getTeams']=function(_0x1d8fc5,_0x58f4d8,_0x4b3d84){var _0x501e2c={};var _0x308494={};var _0x38c84b;var _0xb28ff0;return db[_0x1908('0x35')][_0x1908('0x5c')]({'where':{'id':_0x1d8fc5[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x58f4d8,null))[_0x1908('0x2e')](function(_0xab4236){if(_0xab4236){_0x38c84b=_0xab4236;_0x308494[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x65')][_0x1908('0x4f')]);_0x308494[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x1d8fc5[_0x1908('0x38')]);_0x308494[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x308494[_0x1908('0x3c')],_0x308494[_0x1908('0x38')]);_0x501e2c[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x308494[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x1d8fc5['query'][_0x1908('0x3d')]));_0x501e2c[_0x1908('0x3b')]=_0x501e2c[_0x1908('0x3b')][_0x1908('0x3e')]?_0x501e2c[_0x1908('0x3b')]:_0x308494[_0x1908('0x3c')];_0x501e2c[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x41')]);_0x501e2c[_0x1908('0x42')]=qs[_0x1908('0x39')](_['pick'](_0x1d8fc5[_0x1908('0x38')],_0x308494[_0x1908('0x39')]));if(_0x1d8fc5[_0x1908('0x38')][_0x1908('0x44')]){_0x501e2c['where']=_[_0x1908('0x45')](_0x501e2c['where'],{'$or':_[_0x1908('0x34')](_0x501e2c[_0x1908('0x3b')],function(_0x1b17bd){var _0x1d8b45={};_0x1d8b45[_0x1b17bd]={'$like':'%'+_0x1d8fc5[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x1d8b45;})});}_0x501e2c=_[_0x1908('0x45')]({},_0x501e2c,_0x1d8fc5['options']);return _0x38c84b[_0x1908('0x66')](_0x501e2c);}})['then'](function(_0x590256){if(_0x590256){_0xb28ff0=_0x590256[_0x1908('0x3e')];if(!_0x1d8fc5[_0x1908('0x38')]['hasOwnProperty']('nolimit')){_0x501e2c['limit']=qs[_0x1908('0x28')](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x28')]);_0x501e2c[_0x1908('0x26')]=qs['offset'](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x26')]);}return _0x38c84b['getTeams'](_0x501e2c);}})[_0x1908('0x2e')](function(_0x31e034){if(_0x31e034){return _0x31e034?{'count':_0xb28ff0,'rows':_0x31e034}:null;}})[_0x1908('0x2e')](respondWithResult(_0x58f4d8,null))[_0x1908('0x4b')](handleError(_0x58f4d8,null));};exports['addTeams']=function(_0x16a64e,_0x4f9338,_0x12de9b){var _0x302605=_0x16a64e[_0x1908('0x59')][_0x1908('0x67')];return db['Team'][_0x1908('0x68')]({'where':{'id':_0x302605},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1908('0x32'),_0x1908('0x69'),_0x1908('0x6a'),_0x1908('0x6b')],'raw':!![]}]})[_0x1908('0x2e')](function(_0x2700b8){if(_0x2700b8){var _0x320543=_[_0x1908('0x6c')](_0x2700b8,function(_0x9bac96){var _0x12e2ab=_0x9bac96[_0x1908('0x2f')]({'plain':!![]});return _0x12e2ab['Agents'];});return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x16a64e['params']['id']}})[_0x1908('0x2e')](function(_0x266c01){return db['sequelize'][_0x1908('0x6d')](function(_0x72fea9){return _0x266c01[_0x1908('0x6e')](_0x302605,{'transaction':_0x72fea9})[_0x1908('0x2e')](function(){return BPromise['each'](_0x320543,function(_0x9fdf8b){return db[_0x1908('0x5d')][_0x1908('0x6f')]({'where':{'UserId':_0x9fdf8b['id'],'OpenchannelQueueId':_0x16a64e['params']['id']},'transaction':_0x72fea9});});})[_0x1908('0x2e')](function(){_0x320543[_0x1908('0x70')](function(_0x52a810){socket['emit'](_0x1908('0x71'),{'UserId':_0x52a810['id'],'OpenchannelQueueId':_0x266c01['id']});});});});});}})[_0x1908('0x2e')](respondWithStatusCode(_0x4f9338,null))[_0x1908('0x4b')](handleError(_0x4f9338,null));};exports[_0x1908('0x72')]=function(_0x4212f2,_0x76ecf,_0x4672d2){return db[_0x1908('0x65')][_0x1908('0x68')]({'where':{'id':_0x4212f2[_0x1908('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1908('0x5f')],'as':_0x1908('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x76ecf,null))[_0x1908('0x2e')](function(_0x243fe0){var _0xb375bc=_[_0x1908('0x34')](_0x243fe0,'id');var _0x3ef94e=[];var _0x79b8f=[];var _0x40e7f5=squel[_0x1908('0x74')]();_0x40e7f5['field']('tq.TeamId')[_0x1908('0x75')]('team_has_openchannel_queues','tq')[_0x1908('0x76')]('user_has_teams','ut',_0x1908('0x77'))[_0x1908('0x42')](_0x1908('0x78'),_0x4212f2['params']['id']);for(var _0x296ada=0x0;_0x296ada<_0x243fe0[_0x1908('0x3e')];_0x296ada+=0x1){let _0x4a2afb=_0x243fe0[_0x296ada];for(var _0x26bdee=0x0;_0x26bdee<_0x4a2afb['Agents'][_0x1908('0x3e')];_0x26bdee+=0x1){let _0x2dd02b=_0x4a2afb[_0x1908('0x73')][_0x26bdee];var _0x4dcfe1=_0x40e7f5[_0x1908('0x79')]();_0x4dcfe1[_0x1908('0x42')]('ut.UserId\x20=\x20?',_0x2dd02b['id']);_0x79b8f[_0x1908('0x7a')](db['sequelize']['query'](_0x4dcfe1[_0x1908('0x7b')](),{'type':db[_0x1908('0x7c')][_0x1908('0x7d')][_0x1908('0x7e')]})[_0x1908('0x2e')](function(_0x40270f){if(_0x40270f[_0x1908('0x3e')]===0x1){return _0x2dd02b['id'];}else{var _0x41a4c6=_[_0x1908('0x7f')](_[_0x1908('0x34')](_0x40270f,'TeamId'),function(_0x501959){return _[_0x1908('0x80')](_0xb375bc,_0x501959);});if(_0x41a4c6){return _0x2dd02b['id'];}}}));}}return BPromise['all'](_0x79b8f)[_0x1908('0x2e')](function(_0x2db4bd){_0x3ef94e=_(_0x3ef94e)['union'](_0x2db4bd)[_0x1908('0x81')]()[_0x1908('0x82')]();return db['OpenchannelQueue'][_0x1908('0x50')]({'where':{'id':_0x4212f2[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](function(_0x29382b){return db[_0x1908('0x7c')][_0x1908('0x6d')](function(_0xa74963){return _0x29382b[_0x1908('0x72')](_0x4212f2[_0x1908('0x38')]['ids'],{'transaction':_0xa74963})['then'](function(){if(!_[_0x1908('0x83')](_0x3ef94e)){return _0x29382b[_0x1908('0x84')](_0x3ef94e,{'transaction':_0xa74963});}})[_0x1908('0x2e')](function(){_0x3ef94e['forEach'](function(_0x5bfec8){socket[_0x1908('0x85')](_0x1908('0x86'),{'UserId':_0x5bfec8,'OpenchannelQueueId':_0x29382b['id']});});});});});});})[_0x1908('0x2e')](respondWithStatusCode(_0x76ecf,null))[_0x1908('0x4b')](handleError(_0x76ecf,null));};exports['addAgents']=function(_0x3cf40c,_0xb059a2,_0x5270ac){return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x3cf40c[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0xb059a2,null))[_0x1908('0x2e')](function(_0x65536){if(_0x65536){return _0x65536['addAgents'](_0x3cf40c['body'][_0x1908('0x67')],_[_0x1908('0x87')](_0x3cf40c[_0x1908('0x59')],[_0x1908('0x67'),'id'])||{})[_0x1908('0x88')](function(_0x5b6e53){for(var _0x2888c5=0x0;_0x2888c5<_0x3cf40c[_0x1908('0x59')][_0x1908('0x67')][_0x1908('0x3e')];_0x2888c5+=0x1){socket[_0x1908('0x85')](_0x1908('0x71'),{'UserId':Number(_0x3cf40c[_0x1908('0x59')][_0x1908('0x67')][_0x2888c5]),'OpenchannelQueueId':Number(_0x3cf40c[_0x1908('0x4d')]['id'])});}return _0x5b6e53;});}})['then'](respondWithResult(_0xb059a2,null))[_0x1908('0x4b')](handleError(_0xb059a2,null));};exports[_0x1908('0x84')]=function(_0x582127,_0x281f22,_0x5be263){return db[_0x1908('0x35')]['find']({'where':{'id':_0x582127[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x281f22,null))[_0x1908('0x2e')](function(_0x5f1b24){if(_0x5f1b24){return _0x5f1b24[_0x1908('0x84')](_0x582127['query'][_0x1908('0x67')])[_0x1908('0x2e')](function(){if(_['isArray'](_0x582127[_0x1908('0x38')][_0x1908('0x67')])){for(var _0x31f9fc=0x0;_0x31f9fc<_0x582127[_0x1908('0x38')]['ids'][_0x1908('0x3e')];_0x31f9fc+=0x1){socket[_0x1908('0x85')](_0x1908('0x86'),{'UserId':Number(_0x582127[_0x1908('0x38')][_0x1908('0x67')][_0x31f9fc]),'OpenchannelQueueId':Number(_0x582127['params']['id'])});}}else{socket[_0x1908('0x85')]('userOpenchannelQueue:remove',{'UserId':Number(_0x582127[_0x1908('0x38')][_0x1908('0x67')]),'OpenchannelQueueId':Number(_0x582127[_0x1908('0x4d')]['id'])});}});}})[_0x1908('0x2e')](respondWithStatusCode(_0x281f22,null))[_0x1908('0x4b')](handleError(_0x281f22,null));};exports[_0x1908('0x89')]=function(_0x2c1b45,_0x14f0fb,_0x32727b){var _0x44e76a={};var _0x475849={};var _0x5638fb;var _0x412bcb;return db[_0x1908('0x35')][_0x1908('0x5c')]({'where':{'id':_0x2c1b45[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x14f0fb,null))[_0x1908('0x2e')](function(_0x34c81e){if(_0x34c81e){_0x5638fb=_0x34c81e;_0x475849[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x5f')][_0x1908('0x4f')]);_0x475849[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x2c1b45[_0x1908('0x38')]);_0x475849[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x475849[_0x1908('0x3c')],_0x475849[_0x1908('0x38')]);_0x44e76a[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x475849[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x2c1b45[_0x1908('0x38')]['fields']));_0x44e76a['attributes']=_0x44e76a[_0x1908('0x3b')][_0x1908('0x3e')]?_0x44e76a[_0x1908('0x3b')]:_0x475849['model'];_0x44e76a[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x41')]);_0x44e76a[_0x1908('0x42')]=qs['filters'](_[_0x1908('0x43')](_0x2c1b45['query'],_0x475849[_0x1908('0x39')]));if(_0x2c1b45[_0x1908('0x38')][_0x1908('0x44')]){_0x44e76a[_0x1908('0x42')]=_[_0x1908('0x45')](_0x44e76a[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0x44e76a['attributes'],function(_0x133938){var _0x4e162f={};_0x4e162f[_0x133938]={'$like':'%'+_0x2c1b45[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x4e162f;})});}_0x44e76a=_['merge']({},_0x44e76a,_0x2c1b45[_0x1908('0x47')]);return _0x5638fb[_0x1908('0x89')](_0x44e76a);}})[_0x1908('0x2e')](function(_0x649cd2){if(_0x649cd2){_0x412bcb=_0x649cd2[_0x1908('0x3e')];if(!_0x2c1b45['query'][_0x1908('0x3f')](_0x1908('0x8a'))){_0x44e76a['limit']=qs[_0x1908('0x28')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x28')]);_0x44e76a[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x26')]);}return _0x5638fb[_0x1908('0x89')](_0x44e76a);}})[_0x1908('0x2e')](function(_0x21d18b){if(_0x21d18b){return _0x21d18b?{'count':_0x412bcb,'rows':_0x21d18b}:null;}})[_0x1908('0x2e')](respondWithResult(_0x14f0fb,null))[_0x1908('0x4b')](handleError(_0x14f0fb,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 587815f..5e6cfe4 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 _0xe779=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3cb6f0,_0x2aebf4){var _0x31c3d4=function(_0x52dafd){while(--_0x52dafd){_0x3cb6f0['push'](_0x3cb6f0['shift']());}};_0x31c3d4(++_0x2aebf4);}(_0xe779,0x18f));var _0x9e77=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe779[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0x9e77('0x0'));var OpenchannelQueue=require(_0x9e77('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9e77('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e77('0x3'),'afterDestroy':_0x9e77('0x4')};function emitEvent(_0x1c2de0){return function(_0x250941,_0x29a63c,_0x2182e5){OpenchannelQueueEvents['emit'](_0x1c2de0+':'+_0x250941['id'],_0x250941);OpenchannelQueueEvents[_0x9e77('0x5')](_0x1c2de0,_0x250941);_0x2182e5(null);};}for(var e in events){if(events[_0x9e77('0x6')](e)){var event=events[e];OpenchannelQueue[_0x9e77('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x38d1=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x349c60,_0x39cec6){var _0x4e1f90=function(_0x45efab){while(--_0x45efab){_0x349c60['push'](_0x349c60['shift']());}};_0x4e1f90(++_0x39cec6);}(_0x38d1,0x162));var _0x138d=function(_0x19522b,_0x3bb69b){_0x19522b=_0x19522b-0x0;var _0x16129d=_0x38d1[_0x19522b];return _0x16129d;};'use strict';var EventEmitter=require(_0x138d('0x0'));var OpenchannelQueue=require(_0x138d('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x138d('0x2'),'afterUpdate':_0x138d('0x3'),'afterDestroy':_0x138d('0x4')};function emitEvent(_0x1b6e88){return function(_0x1fdcb9,_0x49de4c,_0x1fd05c){OpenchannelQueueEvents[_0x138d('0x5')](_0x1b6e88+':'+_0x1fdcb9['id'],_0x1fdcb9);OpenchannelQueueEvents[_0x138d('0x5')](_0x1b6e88,_0x1fdcb9);_0x1fd05c(null);};}for(var e in events){if(events[_0x138d('0x6')](e)){var event=events[e];OpenchannelQueue[_0x138d('0x7')](e,emitEvent(event));}}module[_0x138d('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 90cdb5d..98d8cf2 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 _0x981e=['../../config/environment','exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x9274dc,_0x2ea58b){var _0x4d9662=function(_0x621f0c){while(--_0x621f0c){_0x9274dc['push'](_0x9274dc['shift']());}};_0x4d9662(++_0x2ea58b);}(_0x981e,0x143));var _0xe981=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x981e[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xe981('0x0'));var logger=require(_0xe981('0x1'))(_0xe981('0x2'));var moment=require(_0xe981('0x3'));var BPromise=require('bluebird');var rp=require(_0xe981('0x4'));var fs=require('fs');var path=require(_0xe981('0x5'));var rimraf=require(_0xe981('0x6'));var config=require(_0xe981('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xe981('0x8')]=function(_0x2d6527,_0x53d4b4){return _0x2d6527[_0xe981('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc21f=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xc21f,0x9c));var _0xfc21=function(_0xffa5aa,_0x43acda){_0xffa5aa=_0xffa5aa-0x0;var _0x40abaa=_0xc21f[_0xffa5aa];return _0x40abaa;};'use strict';var _=require(_0xfc21('0x0'));var util=require(_0xfc21('0x1'));var logger=require('../../config/logger')(_0xfc21('0x2'));var moment=require(_0xfc21('0x3'));var BPromise=require(_0xfc21('0x4'));var rp=require(_0xfc21('0x5'));var fs=require('fs');var path=require(_0xfc21('0x6'));var rimraf=require(_0xfc21('0x7'));var config=require(_0xfc21('0x8'));var attributes=require(_0xfc21('0x9'));module[_0xfc21('0xa')]=function(_0x218e82,_0x29b084){return _0x218e82[_0xfc21('0xb')]('OpenchannelQueue',attributes,{'tableName':_0xfc21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 819402d..0b291aa 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 _0x46d0=['catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','find','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result'];(function(_0x540600,_0x53d2da){var _0x5eae09=function(_0x505ff5){while(--_0x505ff5){_0x540600['push'](_0x540600['shift']());}};_0x5eae09(++_0x53d2da);}(_0x46d0,0x1a9));var _0x046d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46d0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x046d('0x0'));var util=require(_0x046d('0x1'));var moment=require('moment');var BPromise=require(_0x046d('0x2'));var rs=require(_0x046d('0x3'));var fs=require('fs');var Redis=require(_0x046d('0x4'));var db=require(_0x046d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x046d('0x6'))(_0x046d('0x7'));var config=require(_0x046d('0x8'));var jayson=require(_0x046d('0x9'));var client=jayson['client'][_0x046d('0xa')]({'port':0x232a});config[_0x046d('0xb')]=_[_0x046d('0xc')](config[_0x046d('0xb')],{'host':_0x046d('0xd'),'port':0x18eb});var socket=require(_0x046d('0xe'))(new Redis(config[_0x046d('0xb')]));require(_0x046d('0xf'))['register'](socket);function respondWithRpcPromise(_0x693a27,_0xe24279,_0x530dc5){return new BPromise(function(_0x6918aa,_0x28e988){return client['request'](_0x693a27,_0x530dc5)['then'](function(_0xe75f7f){logger[_0x046d('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0xe24279,_0x046d('0x11'));logger[_0x046d('0x12')](_0x046d('0x13'),_0xe24279,'request\x20sent',JSON[_0x046d('0x14')](_0xe75f7f));if(_0xe75f7f[_0x046d('0x15')]){if(_0xe75f7f[_0x046d('0x15')][_0x046d('0x16')]===0x1f4){logger[_0x046d('0x15')](_0x046d('0x17'),_0xe24279,_0xe75f7f[_0x046d('0x15')]['message']);return _0x28e988(_0xe75f7f[_0x046d('0x15')][_0x046d('0x18')]);}logger['error'](_0x046d('0x17'),_0xe24279,_0xe75f7f[_0x046d('0x15')][_0x046d('0x18')]);return _0x6918aa(_0xe75f7f[_0x046d('0x15')][_0x046d('0x18')]);}else{logger['info'](_0x046d('0x17'),_0xe24279,'request\x20sent');_0x6918aa(_0xe75f7f[_0x046d('0x19')][_0x046d('0x18')]);}})[_0x046d('0x1a')](function(_0x5cde35){logger[_0x046d('0x15')](_0x046d('0x17'),_0xe24279,_0x5cde35);_0x28e988(_0x5cde35);});});}exports[_0x046d('0x1b')]=function(_0xa52f5){var _0x4f1ebd=this;return new Promise(function(_0x291684,_0x4f51fd){return db[_0x046d('0x1c')][_0x046d('0x1d')]({'raw':_0xa52f5[_0x046d('0x1e')]?_0xa52f5[_0x046d('0x1e')][_0x046d('0x1f')]===undefined?!![]:![]:!![],'where':_0xa52f5['options']?_0xa52f5[_0x046d('0x1e')][_0x046d('0x20')]||null:null,'attributes':_0xa52f5[_0x046d('0x1e')]?_0xa52f5[_0x046d('0x1e')]['attributes']||null:null,'limit':_0xa52f5[_0x046d('0x1e')]?_0xa52f5[_0x046d('0x1e')][_0x046d('0x21')]||null:null,'include':_0xa52f5[_0x046d('0x1e')]?_0xa52f5[_0x046d('0x1e')][_0x046d('0x22')]?_[_0x046d('0x23')](_0xa52f5[_0x046d('0x1e')][_0x046d('0x22')],function(_0x251ee9){return{'model':db[_0x251ee9[_0x046d('0x24')]],'as':_0x251ee9['as'],'attributes':_0x251ee9[_0x046d('0x25')],'include':_0x251ee9[_0x046d('0x22')]?_['map'](_0x251ee9[_0x046d('0x22')],function(_0x35b981){return{'model':db[_0x35b981[_0x046d('0x24')]],'as':_0x35b981['as'],'attributes':_0x35b981[_0x046d('0x25')],'include':_0x35b981['include']?_[_0x046d('0x23')](_0x35b981[_0x046d('0x22')],function(_0x1433c8){return{'model':db[_0x1433c8[_0x046d('0x24')]],'as':_0x1433c8['as'],'attributes':_0x1433c8[_0x046d('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1898b1){logger['info'](_0x046d('0x1b'),_0xa52f5);logger['debug'](_0x046d('0x1b'),_0xa52f5,JSON['stringify'](_0x1898b1));_0x291684(_0x1898b1);})[_0x046d('0x1a')](function(_0xc8c170){logger['error'](_0x046d('0x1b'),_0xc8c170[_0x046d('0x18')],_0xa52f5);_0x4f51fd(_0x4f1ebd[_0x046d('0x15')](0x1f4,_0xc8c170['message']));});});};exports[_0x046d('0x26')]=function(_0x38a0ad){var _0xb4d0fd=this;return new Promise(function(_0x2d33fa,_0x2e9bd0){return db[_0x046d('0x1c')][_0x046d('0x27')]({'raw':_0x38a0ad['options']?_0x38a0ad[_0x046d('0x1e')][_0x046d('0x1f')]===undefined?!![]:![]:!![],'where':_0x38a0ad[_0x046d('0x1e')]?_0x38a0ad[_0x046d('0x1e')][_0x046d('0x20')]||null:null,'attributes':_0x38a0ad['options']?_0x38a0ad[_0x046d('0x1e')][_0x046d('0x25')]||null:null,'include':_0x38a0ad[_0x046d('0x1e')]?_0x38a0ad['options'][_0x046d('0x22')]?_[_0x046d('0x23')](_0x38a0ad['options']['include'],function(_0x42eba3){return{'model':db[_0x42eba3[_0x046d('0x24')]],'as':_0x42eba3['as'],'attributes':_0x42eba3[_0x046d('0x25')],'include':_0x42eba3[_0x046d('0x22')]?_[_0x046d('0x23')](_0x42eba3[_0x046d('0x22')],function(_0x56a6c6){return{'model':db[_0x56a6c6[_0x046d('0x24')]],'as':_0x56a6c6['as'],'attributes':_0x56a6c6[_0x046d('0x25')],'include':_0x56a6c6[_0x046d('0x22')]?_[_0x046d('0x23')](_0x56a6c6['include'],function(_0x5df8f7){return{'model':db[_0x5df8f7[_0x046d('0x24')]],'as':_0x5df8f7['as'],'attributes':_0x5df8f7[_0x046d('0x25')]};}):[]};}):[]};}):[]:[]})[_0x046d('0x28')](function(_0x3f9caf){logger[_0x046d('0x10')](_0x046d('0x26'),_0x38a0ad);logger[_0x046d('0x12')](_0x046d('0x26'),_0x38a0ad,JSON[_0x046d('0x14')](_0x3f9caf));_0x2d33fa(_0x3f9caf);})[_0x046d('0x1a')](function(_0x3458bd){logger[_0x046d('0x15')](_0x046d('0x26'),_0x3458bd[_0x046d('0x18')],_0x38a0ad);_0x2e9bd0(_0xb4d0fd['error'](0x1f4,_0x3458bd[_0x046d('0x18')]));});});}; \ No newline at end of file +var _0xe221=['raw','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','register','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','OpenchannelQueue','findAll','options','where','limit','include','map','model','attributes','GetOpenchannelQueue','find'];(function(_0x25c2ce,_0x529639){var _0x5baa45=function(_0x5ab8db){while(--_0x5ab8db){_0x25c2ce['push'](_0x25c2ce['shift']());}};_0x5baa45(++_0x529639);}(_0xe221,0x174));var _0x1e22=function(_0x1a4712,_0x54c083){_0x1a4712=_0x1a4712-0x0;var _0xdb6ed7=_0xe221[_0x1a4712];return _0xdb6ed7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e22('0x0'));var BPromise=require(_0x1e22('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e22('0x2'));var db=require(_0x1e22('0x3'))['db'];var utils=require(_0x1e22('0x4'));var logger=require(_0x1e22('0x5'))(_0x1e22('0x6'));var config=require(_0x1e22('0x7'));var jayson=require(_0x1e22('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1e22('0x9')]=_[_0x1e22('0xa')](config[_0x1e22('0x9')],{'host':_0x1e22('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x1e22('0xc')](socket);function respondWithRpcPromise(_0x2a5912,_0x351431,_0x35d918){return new BPromise(function(_0x540979,_0x290d5c){return client[_0x1e22('0xd')](_0x2a5912,_0x35d918)['then'](function(_0x5d61be){logger[_0x1e22('0xe')](_0x1e22('0xf'),_0x351431,'request\x20sent');logger[_0x1e22('0x10')](_0x1e22('0x11'),_0x351431,_0x1e22('0x12'),JSON[_0x1e22('0x13')](_0x5d61be));if(_0x5d61be[_0x1e22('0x14')]){if(_0x5d61be['error'][_0x1e22('0x15')]===0x1f4){logger['error'](_0x1e22('0xf'),_0x351431,_0x5d61be[_0x1e22('0x14')]['message']);return _0x290d5c(_0x5d61be[_0x1e22('0x14')]['message']);}logger[_0x1e22('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x351431,_0x5d61be[_0x1e22('0x14')][_0x1e22('0x16')]);return _0x540979(_0x5d61be[_0x1e22('0x14')][_0x1e22('0x16')]);}else{logger[_0x1e22('0xe')](_0x1e22('0xf'),_0x351431,_0x1e22('0x12'));_0x540979(_0x5d61be['result'][_0x1e22('0x16')]);}})[_0x1e22('0x17')](function(_0x2b2008){logger[_0x1e22('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x351431,_0x2b2008);_0x290d5c(_0x2b2008);});});}exports['GetOpenchannelQueue']=function(_0x39a716){var _0x2cda2a=this;return new Promise(function(_0x4c72de,_0x1a3742){return db[_0x1e22('0x18')][_0x1e22('0x19')]({'raw':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1b')]||null:null,'attributes':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')]['attributes']||null:null,'limit':_0x39a716[_0x1e22('0x1a')]?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1c')]||null:null,'include':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x39a716['options'][_0x1e22('0x1d')],function(_0x466954){return{'model':db[_0x466954[_0x1e22('0x1f')]],'as':_0x466954['as'],'attributes':_0x466954[_0x1e22('0x20')],'include':_0x466954[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x466954[_0x1e22('0x1d')],function(_0x40acb3){return{'model':db[_0x40acb3[_0x1e22('0x1f')]],'as':_0x40acb3['as'],'attributes':_0x40acb3[_0x1e22('0x20')],'include':_0x40acb3[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x40acb3[_0x1e22('0x1d')],function(_0x437b12){return{'model':db[_0x437b12['model']],'as':_0x437b12['as'],'attributes':_0x437b12[_0x1e22('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42fc5a){logger[_0x1e22('0xe')](_0x1e22('0x21'),_0x39a716);logger['debug'](_0x1e22('0x21'),_0x39a716,JSON['stringify'](_0x42fc5a));_0x4c72de(_0x42fc5a);})['catch'](function(_0x2323f4){logger[_0x1e22('0x14')](_0x1e22('0x21'),_0x2323f4[_0x1e22('0x16')],_0x39a716);_0x1a3742(_0x2cda2a[_0x1e22('0x14')](0x1f4,_0x2323f4[_0x1e22('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x554b43){var _0x27ac2b=this;return new Promise(function(_0x25e034,_0x10547e){return db['OpenchannelQueue'][_0x1e22('0x22')]({'raw':_0x554b43['options']?_0x554b43[_0x1e22('0x1a')][_0x1e22('0x23')]===undefined?!![]:![]:!![],'where':_0x554b43[_0x1e22('0x1a')]?_0x554b43[_0x1e22('0x1a')]['where']||null:null,'attributes':_0x554b43[_0x1e22('0x1a')]?_0x554b43['options'][_0x1e22('0x20')]||null:null,'include':_0x554b43[_0x1e22('0x1a')]?_0x554b43[_0x1e22('0x1a')][_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x554b43[_0x1e22('0x1a')][_0x1e22('0x1d')],function(_0x7364ed){return{'model':db[_0x7364ed['model']],'as':_0x7364ed['as'],'attributes':_0x7364ed['attributes'],'include':_0x7364ed[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x7364ed[_0x1e22('0x1d')],function(_0x4ac20c){return{'model':db[_0x4ac20c[_0x1e22('0x1f')]],'as':_0x4ac20c['as'],'attributes':_0x4ac20c[_0x1e22('0x20')],'include':_0x4ac20c[_0x1e22('0x1d')]?_['map'](_0x4ac20c[_0x1e22('0x1d')],function(_0x275b7a){return{'model':db[_0x275b7a[_0x1e22('0x1f')]],'as':_0x275b7a['as'],'attributes':_0x275b7a[_0x1e22('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae907){logger[_0x1e22('0xe')](_0x1e22('0x24'),_0x554b43);logger[_0x1e22('0x10')]('ShowOpenchannelQueue',_0x554b43,JSON[_0x1e22('0x13')](_0x4ae907));_0x25e034(_0x4ae907);})[_0x1e22('0x17')](function(_0x5a4f7c){logger[_0x1e22('0x14')](_0x1e22('0x24'),_0x5a4f7c[_0x1e22('0x16')],_0x554b43);_0x10547e(_0x27ac2b[_0x1e22('0x14')](0x1f4,_0x5a4f7c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 79e1dd8..8bd8ed6 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 _0xd523=['emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0x3a2aab,_0x47b12d){var _0x404775=function(_0x259a19){while(--_0x259a19){_0x3a2aab['push'](_0x3a2aab['shift']());}};_0x404775(++_0x47b12d);}(_0xd523,0xa4));var _0x3d52=function(_0x54d008,_0x378c02){_0x54d008=_0x54d008-0x0;var _0x9c4ce5=_0xd523[_0x54d008];return _0x9c4ce5;};'use strict';var OpenchannelQueueEvents=require(_0x3d52('0x0'));var events=[_0x3d52('0x1'),_0x3d52('0x2'),_0x3d52('0x3')];function createListener(_0x3acbb3,_0x79baac){return function(_0x317efc){_0x79baac[_0x3d52('0x4')](_0x3acbb3,_0x317efc);};}function removeListener(_0x4895bb,_0x4bbc8d){return function(){OpenchannelQueueEvents[_0x3d52('0x5')](_0x4895bb,_0x4bbc8d);};}exports['register']=function(_0x3b86a5){for(var _0x108743=0x0,_0x59e4d5=events[_0x3d52('0x6')];_0x108743<_0x59e4d5;_0x108743++){var _0x18acbb=events[_0x108743];var _0x296e7c=createListener(_0x3d52('0x7')+_0x18acbb,_0x3b86a5);OpenchannelQueueEvents['on'](_0x18acbb,_0x296e7c);}}; \ No newline at end of file +var _0x29be=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x29be,0x1dc));var _0xe29b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x29be[_0x618414];return _0x21c19a;};'use strict';var OpenchannelQueueEvents=require(_0xe29b('0x0'));var events=[_0xe29b('0x1'),_0xe29b('0x2'),_0xe29b('0x3')];function createListener(_0x4b1981,_0x1c318f){return function(_0x16639e){_0x1c318f[_0xe29b('0x4')](_0x4b1981,_0x16639e);};}function removeListener(_0x1d8594,_0x1c4d03){return function(){OpenchannelQueueEvents[_0xe29b('0x5')](_0x1d8594,_0x1c4d03);};}exports[_0xe29b('0x6')]=function(_0x4667ca){for(var _0x1cfac4=0x0,_0x4f3a0a=events[_0xe29b('0x7')];_0x1cfac4<_0x4f3a0a;_0x1cfac4++){var _0x289910=events[_0x1cfac4];var _0x1bb6da=createListener(_0xe29b('0x8')+_0x289910,_0x4667ca);OpenchannelQueueEvents['on'](_0x289910,_0x1bb6da);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index e1cdfee..c9fae1e 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 _0x0c24=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','multer','util','path','connect-timeout','express'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x0c24,0x1db));var _0x40c2=function(_0x3ced9d,_0x18daa5){_0x3ced9d=_0x3ced9d-0x0;var _0xa06cbb=_0x0c24[_0x3ced9d];return _0xa06cbb;};'use strict';var multer=require(_0x40c2('0x0'));var util=require(_0x40c2('0x1'));var path=require(_0x40c2('0x2'));var timeout=require(_0x40c2('0x3'));var express=require(_0x40c2('0x4'));var router=express[_0x40c2('0x5')]();var fs_extra=require(_0x40c2('0x6'));var auth=require(_0x40c2('0x7'));var interaction=require(_0x40c2('0x8'));var config=require(_0x40c2('0x9'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x40c2('0xa')](),controller[_0x40c2('0xb')]);router['get'](_0x40c2('0xc'),auth[_0x40c2('0xa')](),controller[_0x40c2('0xd')]);router['get']('/:id',auth[_0x40c2('0xa')](),controller[_0x40c2('0xe')]);router[_0x40c2('0xf')]('/',auth[_0x40c2('0xa')](),controller[_0x40c2('0x10')]);router[_0x40c2('0x11')](_0x40c2('0x12'),auth[_0x40c2('0xa')](),controller[_0x40c2('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe0e7=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0e7,0x1d1));var _0x7e0e=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xe0e7[_0x301dab];return _0x2500a2;};'use strict';var multer=require('multer');var util=require(_0x7e0e('0x0'));var path=require(_0x7e0e('0x1'));var timeout=require(_0x7e0e('0x2'));var express=require(_0x7e0e('0x3'));var router=express[_0x7e0e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7e0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7e0e('0x6'));var controller=require(_0x7e0e('0x7'));router[_0x7e0e('0x8')]('/',auth[_0x7e0e('0x9')](),controller['index']);router[_0x7e0e('0x8')](_0x7e0e('0xa'),auth[_0x7e0e('0x9')](),controller[_0x7e0e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7e0e('0xc')]);router[_0x7e0e('0xd')]('/',auth[_0x7e0e('0x9')](),controller[_0x7e0e('0xe')]);router[_0x7e0e('0xf')](_0x7e0e('0x10'),auth['isAuthenticated'](),controller[_0x7e0e('0x11')]);router[_0x7e0e('0x12')](_0x7e0e('0x10'),auth[_0x7e0e('0x9')](),controller[_0x7e0e('0x13')]);module[_0x7e0e('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 0c0c05f..db0933e 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 _0xdd5d=['exports','STRING','DATE','moment','sequelize'];(function(_0x1968ee,_0xca16fa){var _0x4b5376=function(_0x5f5203){while(--_0x5f5203){_0x1968ee['push'](_0x1968ee['shift']());}};_0x4b5376(++_0xca16fa);}(_0xdd5d,0xd5));var _0xddd5=function(_0xcc93f,_0x57f5b1){_0xcc93f=_0xcc93f-0x0;var _0x227e16=_0xdd5d[_0xcc93f];return _0x227e16;};'use strict';var moment=require(_0xddd5('0x0'));var Sequelize=require(_0xddd5('0x1'));module[_0xddd5('0x2')]={'uniqueid':{'type':Sequelize[_0xddd5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xddd5('0x3')]},'joinAt':{'type':Sequelize[_0xddd5('0x4')]},'leaveAt':{'type':Sequelize[_0xddd5('0x4')]},'acceptAt':{'type':Sequelize[_0xddd5('0x4')]},'exitAt':{'type':Sequelize[_0xddd5('0x4')]},'reason':{'type':Sequelize[_0xddd5('0x3')]}}; \ No newline at end of file +var _0xfd5f=['sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd5f,0x7b));var _0xffd5=function(_0x3c6f97,_0x295580){_0x3c6f97=_0x3c6f97-0x0;var _0xde4c43=_0xfd5f[_0x3c6f97];return _0xde4c43;};'use strict';var moment=require('moment');var Sequelize=require(_0xffd5('0x0'));module[_0xffd5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xffd5('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xffd5('0x2')]},'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 7b6d385..49d1710 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 _0x5bb1=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','then','includeAll','rows','catch','show','params','include','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2877a8,_0x1741b2){var _0x2c969e=function(_0xa73f18){while(--_0xa73f18){_0x2877a8['push'](_0x2877a8['shift']());}};_0x2c969e(++_0x1741b2);}(_0x5bb1,0x12a));var _0x15bb=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x5bb1[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x15bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15bb('0x1'));var jsonpatch=require(_0x15bb('0x2'));var rp=require('request-promise');var moment=require(_0x15bb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x15bb('0x4'));var util=require(_0x15bb('0x5'));var path=require(_0x15bb('0x6'));var sox=require(_0x15bb('0x7'));var csv=require('to-csv');var ejs=require(_0x15bb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15bb('0x9'));var squel=require(_0x15bb('0xa'));var crypto=require(_0x15bb('0xb'));var jsforce=require(_0x15bb('0xc'));var deskjs=require(_0x15bb('0xd'));var toCsv=require(_0x15bb('0xe'));var querystring=require(_0x15bb('0xf'));var Papa=require(_0x15bb('0x10'));var Redis=require(_0x15bb('0x11'));var authService=require(_0x15bb('0x12'));var qs=require(_0x15bb('0x13'));var as=require(_0x15bb('0x14'));var hardwareService=require(_0x15bb('0x15'));var logger=require(_0x15bb('0x16'))(_0x15bb('0x17'));var utils=require(_0x15bb('0x18'));var config=require(_0x15bb('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c3322,_0x2e1551){_0x2e1551=_0x2e1551||0xcc;return function(_0x12d468){if(_0x12d468){return _0x5c3322[_0x15bb('0x1a')](_0x2e1551);}return _0x5c3322['status'](_0x2e1551)[_0x15bb('0x1b')]();};}function respondWithResult(_0x3cf958,_0x32eb13){_0x32eb13=_0x32eb13||0xc8;return function(_0x548b8f){if(_0x548b8f){return _0x3cf958['status'](_0x32eb13)[_0x15bb('0x1c')](_0x548b8f);}};}function respondWithFilteredResult(_0x17493f,_0x136824){return function(_0x55882f){if(_0x55882f){var _0x53719e=typeof _0x136824[_0x15bb('0x1d')]===_0x15bb('0x1e')&&typeof _0x136824['limit']===_0x15bb('0x1e');var _0x684419=_0x55882f[_0x15bb('0x1f')];var _0x1e97f4=_0x53719e?0x0:_0x136824[_0x15bb('0x1d')];var _0x5a16e5=_0x53719e?_0x55882f[_0x15bb('0x1f')]:_0x136824[_0x15bb('0x1d')]+_0x136824[_0x15bb('0x20')];var _0x47fd2b;if(_0x5a16e5>=_0x684419){_0x5a16e5=_0x684419;_0x47fd2b=0xc8;}else{_0x47fd2b=0xce;}_0x17493f[_0x15bb('0x21')](_0x47fd2b);return _0x17493f[_0x15bb('0x22')](_0x15bb('0x23'),_0x1e97f4+'-'+_0x5a16e5+'/'+_0x684419)[_0x15bb('0x1c')](_0x55882f);}return null;};}function patchUpdates(_0x114b7b){return function(_0x3b8a96){try{jsonpatch[_0x15bb('0x24')](_0x3b8a96,_0x114b7b,!![]);}catch(_0x58ad70){return BPromise['reject'](_0x58ad70);}return _0x3b8a96['save']();};}function saveUpdates(_0x33f2c1,_0x1c621c){return function(_0x187715){if(_0x187715){return _0x187715[_0x15bb('0x25')](_0x33f2c1)['then'](function(_0x5914c4){return _0x5914c4;});}return null;};}function removeEntity(_0x4c67a7,_0x1eddb9){return function(_0x549842){if(_0x549842){return _0x549842[_0x15bb('0x26')]()['then'](function(){_0x4c67a7[_0x15bb('0x21')](0xcc)[_0x15bb('0x1b')]();});}};}function handleEntityNotFound(_0x5add4a,_0x4efd46){return function(_0x5bb04c){if(!_0x5bb04c){_0x5add4a['sendStatus'](0x194);}return _0x5bb04c;};}function handleError(_0x3df0f6,_0x46c471){_0x46c471=_0x46c471||0x1f4;return function(_0x35d5e3){logger[_0x15bb('0x27')](_0x35d5e3[_0x15bb('0x28')]);if(_0x35d5e3[_0x15bb('0x29')]){delete _0x35d5e3[_0x15bb('0x29')];}_0x3df0f6[_0x15bb('0x21')](_0x46c471)[_0x15bb('0x2a')](_0x35d5e3);};}exports[_0x15bb('0x2b')]=function(_0x41904d,_0x314928){var _0x1012f3={},_0x4e2db9={},_0x38f959={'count':0x0,'rows':[]};var _0x4a3e81=_[_0x15bb('0x2c')](db[_0x15bb('0x2d')][_0x15bb('0x2e')],function(_0x2a0efb){return{'name':_0x2a0efb[_0x15bb('0x2f')],'type':_0x2a0efb[_0x15bb('0x30')][_0x15bb('0x31')]};});_0x4e2db9[_0x15bb('0x32')]=_[_0x15bb('0x2c')](_0x4a3e81,'name');_0x4e2db9[_0x15bb('0x33')]=_[_0x15bb('0x34')](_0x41904d[_0x15bb('0x33')]);_0x4e2db9[_0x15bb('0x35')]=_['intersection'](_0x4e2db9[_0x15bb('0x32')],_0x4e2db9[_0x15bb('0x33')]);_0x1012f3[_0x15bb('0x36')]=_[_0x15bb('0x37')](_0x4e2db9[_0x15bb('0x32')],qs[_0x15bb('0x38')](_0x41904d['query'][_0x15bb('0x38')]));_0x1012f3[_0x15bb('0x36')]=_0x1012f3[_0x15bb('0x36')][_0x15bb('0x39')]?_0x1012f3[_0x15bb('0x36')]:_0x4e2db9[_0x15bb('0x32')];if(!_0x41904d[_0x15bb('0x33')][_0x15bb('0x3a')](_0x15bb('0x3b'))){_0x1012f3[_0x15bb('0x20')]=qs[_0x15bb('0x20')](_0x41904d[_0x15bb('0x33')]['limit']);_0x1012f3[_0x15bb('0x1d')]=qs[_0x15bb('0x1d')](_0x41904d['query']['offset']);}_0x1012f3[_0x15bb('0x3c')]=qs['sort'](_0x41904d['query'][_0x15bb('0x3d')]);_0x1012f3['where']=qs['filters'](_[_0x15bb('0x3e')](_0x41904d[_0x15bb('0x33')],_0x4e2db9[_0x15bb('0x35')]),_0x4a3e81);if(_0x41904d['query'][_0x15bb('0x3f')]){_0x1012f3['where']=_['merge'](_0x1012f3[_0x15bb('0x40')],{'$or':_[_0x15bb('0x2c')](_0x4a3e81,function(_0x49ff3e){if(_0x49ff3e['type']!=='VIRTUAL'){var _0x1868f0={};_0x1868f0[_0x49ff3e['name']]={'$like':'%'+_0x41904d[_0x15bb('0x33')][_0x15bb('0x3f')]+'%'};return _0x1868f0;}})});}_0x1012f3=_['merge']({},_0x1012f3,_0x41904d[_0x15bb('0x41')]);var _0x2f4de0={'where':_0x1012f3['where']};return db[_0x15bb('0x2d')][_0x15bb('0x1f')](_0x2f4de0)[_0x15bb('0x42')](function(_0x1d390e){_0x38f959[_0x15bb('0x1f')]=_0x1d390e;if(_0x41904d['query'][_0x15bb('0x43')]){_0x1012f3['include']=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x1012f3);})['then'](function(_0x17877a){_0x38f959[_0x15bb('0x44')]=_0x17877a;return _0x38f959;})[_0x15bb('0x42')](respondWithFilteredResult(_0x314928,_0x1012f3))[_0x15bb('0x45')](handleError(_0x314928,null));};exports[_0x15bb('0x46')]=function(_0x56d457,_0x142347){var _0x22d275={'raw':!![],'where':{'id':_0x56d457[_0x15bb('0x47')]['id']}},_0x3cfb60={};_0x3cfb60[_0x15bb('0x32')]=_[_0x15bb('0x34')](db[_0x15bb('0x2d')][_0x15bb('0x2e')]);_0x3cfb60['query']=_[_0x15bb('0x34')](_0x56d457[_0x15bb('0x33')]);_0x3cfb60[_0x15bb('0x35')]=_[_0x15bb('0x37')](_0x3cfb60['model'],_0x3cfb60['query']);_0x22d275['attributes']=_[_0x15bb('0x37')](_0x3cfb60[_0x15bb('0x32')],qs[_0x15bb('0x38')](_0x56d457[_0x15bb('0x33')]['fields']));_0x22d275[_0x15bb('0x36')]=_0x22d275[_0x15bb('0x36')][_0x15bb('0x39')]?_0x22d275['attributes']:_0x3cfb60[_0x15bb('0x32')];if(_0x56d457[_0x15bb('0x33')][_0x15bb('0x43')]){_0x22d275[_0x15bb('0x48')]=[{'all':!![]}];}_0x22d275=_[_0x15bb('0x49')]({},_0x22d275,_0x56d457['options']);return db['OpenchannelQueueReport'][_0x15bb('0x4a')](_0x22d275)[_0x15bb('0x42')](handleEntityNotFound(_0x142347,null))['then'](respondWithResult(_0x142347,null))[_0x15bb('0x45')](handleError(_0x142347,null));};exports[_0x15bb('0x4b')]=function(_0x1fbd38,_0x248171){return db['OpenchannelQueueReport']['create'](_0x1fbd38[_0x15bb('0x4c')],{})['then'](respondWithResult(_0x248171,0xc9))[_0x15bb('0x45')](handleError(_0x248171,null));};exports['update']=function(_0x267f9a,_0x43f86f){if(_0x267f9a['body']['id']){delete _0x267f9a[_0x15bb('0x4c')]['id'];}return db[_0x15bb('0x2d')][_0x15bb('0x4a')]({'where':{'id':_0x267f9a[_0x15bb('0x47')]['id']}})[_0x15bb('0x42')](handleEntityNotFound(_0x43f86f,null))['then'](saveUpdates(_0x267f9a[_0x15bb('0x4c')],null))[_0x15bb('0x42')](respondWithResult(_0x43f86f,null))['catch'](handleError(_0x43f86f,null));};exports[_0x15bb('0x26')]=function(_0x5670ed,_0x1aed7a){return db[_0x15bb('0x2d')][_0x15bb('0x4a')]({'where':{'id':_0x5670ed['params']['id']}})['then'](handleEntityNotFound(_0x1aed7a,null))['then'](removeEntity(_0x1aed7a,null))[_0x15bb('0x45')](handleError(_0x1aed7a,null));};exports[_0x15bb('0x4d')]=function(_0x1a703d,_0x4e0c55){return db[_0x15bb('0x2d')][_0x15bb('0x4d')]()['then'](respondWithResult(_0x4e0c55,null))[_0x15bb('0x45')](handleError(_0x4e0c55,null));}; \ No newline at end of file +var _0x6786=['count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0x6786,0x19d));var _0x6678=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x6786[_0x2ff739];return _0x12dc13;};'use strict';var emlformat=require(_0x6678('0x0'));var rimraf=require(_0x6678('0x1'));var zipdir=require(_0x6678('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6678('0x3'));var moment=require(_0x6678('0x4'));var BPromise=require(_0x6678('0x5'));var Mustache=require(_0x6678('0x6'));var util=require(_0x6678('0x7'));var path=require(_0x6678('0x8'));var sox=require('sox');var csv=require(_0x6678('0x9'));var ejs=require(_0x6678('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6678('0xb'));var squel=require(_0x6678('0xc'));var crypto=require('crypto');var jsforce=require(_0x6678('0xd'));var deskjs=require(_0x6678('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6678('0xf'));var Papa=require(_0x6678('0x10'));var Redis=require(_0x6678('0x11'));var authService=require(_0x6678('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6678('0x13'));var hardwareService=require(_0x6678('0x14'));var logger=require(_0x6678('0x15'))(_0x6678('0x16'));var utils=require('../../config/utils');var config=require(_0x6678('0x17'));var licenseUtil=require(_0x6678('0x18'));var db=require(_0x6678('0x19'))['db'];function respondWithStatusCode(_0x1773f1,_0x39645d){_0x39645d=_0x39645d||0xcc;return function(_0x68ccec){if(_0x68ccec){return _0x1773f1[_0x6678('0x1a')](_0x39645d);}return _0x1773f1[_0x6678('0x1b')](_0x39645d)[_0x6678('0x1c')]();};}function respondWithResult(_0x50e157,_0x26c073){_0x26c073=_0x26c073||0xc8;return function(_0x2002c3){if(_0x2002c3){return _0x50e157['status'](_0x26c073)['json'](_0x2002c3);}};}function respondWithFilteredResult(_0x3453ea,_0x55957b){return function(_0x256f3d){if(_0x256f3d){var _0x56999b=typeof _0x55957b[_0x6678('0x1d')]===_0x6678('0x1e')&&typeof _0x55957b['limit']==='undefined';var _0x16963a=_0x256f3d[_0x6678('0x1f')];var _0x4bbed3=_0x56999b?0x0:_0x55957b[_0x6678('0x1d')];var _0x2db7ec=_0x56999b?_0x256f3d[_0x6678('0x1f')]:_0x55957b[_0x6678('0x1d')]+_0x55957b[_0x6678('0x20')];var _0x3b0fee;if(_0x2db7ec>=_0x16963a){_0x2db7ec=_0x16963a;_0x3b0fee=0xc8;}else{_0x3b0fee=0xce;}_0x3453ea['status'](_0x3b0fee);return _0x3453ea[_0x6678('0x21')](_0x6678('0x22'),_0x4bbed3+'-'+_0x2db7ec+'/'+_0x16963a)[_0x6678('0x23')](_0x256f3d);}return null;};}function patchUpdates(_0x19099a){return function(_0x3ae2d2){try{jsonpatch[_0x6678('0x24')](_0x3ae2d2,_0x19099a,!![]);}catch(_0x5281ef){return BPromise[_0x6678('0x25')](_0x5281ef);}return _0x3ae2d2['save']();};}function saveUpdates(_0x2bf70e,_0x4e2446){return function(_0x1ece31){if(_0x1ece31){return _0x1ece31[_0x6678('0x26')](_0x2bf70e)[_0x6678('0x27')](function(_0x11b7e7){return _0x11b7e7;});}return null;};}function removeEntity(_0x3f596a,_0x474bc1){return function(_0x4d48b1){if(_0x4d48b1){return _0x4d48b1[_0x6678('0x28')]()[_0x6678('0x27')](function(){_0x3f596a[_0x6678('0x1b')](0xcc)[_0x6678('0x1c')]();});}};}function handleEntityNotFound(_0x401663,_0x2e13a2){return function(_0x547515){if(!_0x547515){_0x401663['sendStatus'](0x194);}return _0x547515;};}function handleError(_0x376a20,_0x40e324){_0x40e324=_0x40e324||0x1f4;return function(_0x496a93){logger[_0x6678('0x29')](_0x496a93[_0x6678('0x2a')]);if(_0x496a93[_0x6678('0x2b')]){delete _0x496a93['name'];}_0x376a20[_0x6678('0x1b')](_0x40e324)[_0x6678('0x2c')](_0x496a93);};}exports['index']=function(_0x5ab783,_0x58861d){var _0x6da8f1={},_0x4f9bc7={},_0xc4af83={'count':0x0,'rows':[]};var _0x351916=_['map'](db[_0x6678('0x2d')][_0x6678('0x2e')],function(_0xe215c7){return{'name':_0xe215c7[_0x6678('0x2f')],'type':_0xe215c7[_0x6678('0x30')][_0x6678('0x31')]};});_0x4f9bc7[_0x6678('0x32')]=_[_0x6678('0x33')](_0x351916,_0x6678('0x2b'));_0x4f9bc7[_0x6678('0x34')]=_[_0x6678('0x35')](_0x5ab783['query']);_0x4f9bc7[_0x6678('0x36')]=_[_0x6678('0x37')](_0x4f9bc7[_0x6678('0x32')],_0x4f9bc7['query']);_0x6da8f1[_0x6678('0x38')]=_[_0x6678('0x37')](_0x4f9bc7[_0x6678('0x32')],qs[_0x6678('0x39')](_0x5ab783[_0x6678('0x34')][_0x6678('0x39')]));_0x6da8f1[_0x6678('0x38')]=_0x6da8f1[_0x6678('0x38')][_0x6678('0x3a')]?_0x6da8f1[_0x6678('0x38')]:_0x4f9bc7[_0x6678('0x32')];if(!_0x5ab783[_0x6678('0x34')]['hasOwnProperty']('nolimit')){_0x6da8f1[_0x6678('0x20')]=qs[_0x6678('0x20')](_0x5ab783['query'][_0x6678('0x20')]);_0x6da8f1['offset']=qs[_0x6678('0x1d')](_0x5ab783[_0x6678('0x34')][_0x6678('0x1d')]);}_0x6da8f1['order']=qs['sort'](_0x5ab783['query'][_0x6678('0x3b')]);_0x6da8f1[_0x6678('0x3c')]=qs[_0x6678('0x36')](_['pick'](_0x5ab783[_0x6678('0x34')],_0x4f9bc7[_0x6678('0x36')]),_0x351916);if(_0x5ab783['query'][_0x6678('0x3d')]){_0x6da8f1[_0x6678('0x3c')]=_[_0x6678('0x3e')](_0x6da8f1[_0x6678('0x3c')],{'$or':_[_0x6678('0x33')](_0x351916,function(_0x510dc4){if(_0x510dc4[_0x6678('0x30')]!==_0x6678('0x3f')){var _0x112088={};_0x112088[_0x510dc4[_0x6678('0x2b')]]={'$like':'%'+_0x5ab783[_0x6678('0x34')][_0x6678('0x3d')]+'%'};return _0x112088;}})});}_0x6da8f1=_[_0x6678('0x3e')]({},_0x6da8f1,_0x5ab783[_0x6678('0x40')]);var _0x21cc59={'where':_0x6da8f1['where']};return db['OpenchannelQueueReport'][_0x6678('0x1f')](_0x21cc59)[_0x6678('0x27')](function(_0x7b8f65){_0xc4af83[_0x6678('0x1f')]=_0x7b8f65;if(_0x5ab783[_0x6678('0x34')][_0x6678('0x41')]){_0x6da8f1['include']=[{'all':!![]}];}return db[_0x6678('0x2d')]['findAll'](_0x6da8f1);})[_0x6678('0x27')](function(_0x55cffe){_0xc4af83[_0x6678('0x42')]=_0x55cffe;return _0xc4af83;})[_0x6678('0x27')](respondWithFilteredResult(_0x58861d,_0x6da8f1))[_0x6678('0x43')](handleError(_0x58861d,null));};exports[_0x6678('0x44')]=function(_0x176587,_0x17ad5f){var _0x3b65e4={'raw':!![],'where':{'id':_0x176587['params']['id']}},_0x17efba={};_0x17efba['model']=_[_0x6678('0x35')](db[_0x6678('0x2d')][_0x6678('0x2e')]);_0x17efba[_0x6678('0x34')]=_[_0x6678('0x35')](_0x176587[_0x6678('0x34')]);_0x17efba[_0x6678('0x36')]=_[_0x6678('0x37')](_0x17efba[_0x6678('0x32')],_0x17efba['query']);_0x3b65e4[_0x6678('0x38')]=_['intersection'](_0x17efba[_0x6678('0x32')],qs['fields'](_0x176587[_0x6678('0x34')][_0x6678('0x39')]));_0x3b65e4[_0x6678('0x38')]=_0x3b65e4[_0x6678('0x38')]['length']?_0x3b65e4[_0x6678('0x38')]:_0x17efba[_0x6678('0x32')];if(_0x176587[_0x6678('0x34')][_0x6678('0x41')]){_0x3b65e4[_0x6678('0x45')]=[{'all':!![]}];}_0x3b65e4=_[_0x6678('0x3e')]({},_0x3b65e4,_0x176587[_0x6678('0x40')]);return db[_0x6678('0x2d')][_0x6678('0x46')](_0x3b65e4)[_0x6678('0x27')](handleEntityNotFound(_0x17ad5f,null))[_0x6678('0x27')](respondWithResult(_0x17ad5f,null))['catch'](handleError(_0x17ad5f,null));};exports[_0x6678('0x47')]=function(_0x4c7620,_0x4e4e5f){return db['OpenchannelQueueReport'][_0x6678('0x47')](_0x4c7620[_0x6678('0x48')],{})[_0x6678('0x27')](respondWithResult(_0x4e4e5f,0xc9))[_0x6678('0x43')](handleError(_0x4e4e5f,null));};exports['update']=function(_0xb952e0,_0x5e550f){if(_0xb952e0[_0x6678('0x48')]['id']){delete _0xb952e0['body']['id'];}return db[_0x6678('0x2d')][_0x6678('0x46')]({'where':{'id':_0xb952e0['params']['id']}})['then'](handleEntityNotFound(_0x5e550f,null))[_0x6678('0x27')](saveUpdates(_0xb952e0[_0x6678('0x48')],null))[_0x6678('0x27')](respondWithResult(_0x5e550f,null))[_0x6678('0x43')](handleError(_0x5e550f,null));};exports[_0x6678('0x28')]=function(_0x497e72,_0x55dc84){return db[_0x6678('0x2d')][_0x6678('0x46')]({'where':{'id':_0x497e72['params']['id']}})['then'](handleEntityNotFound(_0x55dc84,null))[_0x6678('0x27')](removeEntity(_0x55dc84,null))[_0x6678('0x43')](handleError(_0x55dc84,null));};exports['describe']=function(_0x2cdafd,_0x3ff394){return db[_0x6678('0x2d')][_0x6678('0x49')]()['then'](respondWithResult(_0x3ff394,null))['catch'](handleError(_0x3ff394,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 9967099..1bb8d31 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x4147b2,_0x562a36){var _0x52d621=function(_0x5f4d02){while(--_0x5f4d02){_0x4147b2['push'](_0x4147b2['shift']());}};_0x52d621(++_0x562a36);}(_0x7a54,0x106));var _0x47a5=function(_0x132061,_0x417087){_0x132061=_0x132061-0x0;var _0x29c201=_0x7a54[_0x132061];return _0x29c201;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x814b,0x1a2));var _0xb814=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x814b[_0x1e05c1];return _0x15f1ca;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index a3d0da8..0f46f86 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 _0x5464=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x61f557,_0x22591a){var _0x31678=function(_0x2f5989){while(--_0x2f5989){_0x61f557['push'](_0x61f557['shift']());}};_0x31678(++_0x22591a);}(_0x5464,0x15d));var _0x4546=function(_0x4fcaa3,_0x3a1841){_0x4fcaa3=_0x4fcaa3-0x0;var _0x2c30af=_0x5464[_0x4fcaa3];return _0x2c30af;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![]})[_0x4546('0xa')](function(_0x4034a5){logger[_0x4546('0xb')]('CreateOpenchannelQueueReport',_0x57d8de);logger[_0x4546('0xd')](_0x4546('0x14'),_0x57d8de,JSON['stringify'](_0x4034a5));_0x5780a7(_0x4034a5);})[_0x4546('0x13')](function(_0x437f55){logger[_0x4546('0x10')](_0x4546('0x14'),_0x437f55[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x437f55['message']));});});};exports[_0x4546('0x1a')]=function(_0x2cca8b){var _0x4f9fcf=this;return new Promise(function(_0x824698,_0x4618a6){return db[_0x4546('0x15')][_0x4546('0x1b')](_0x2cca8b[_0x4546('0x17')],{'raw':_0x2cca8b['options']?_0x2cca8b[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b['options']['where']||null:null,'attributes':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1c')]||null:null,'limit':_0x2cca8b[_0x4546('0x18')]?_0x2cca8b[_0x4546('0x18')][_0x4546('0x1d')]||null:null})[_0x4546('0xa')](function(_0x586ff1){logger[_0x4546('0xb')]('UpdateOpenchannelQueueReport',_0x2cca8b);logger[_0x4546('0xd')](_0x4546('0x1a'),_0x2cca8b,JSON['stringify'](_0x586ff1));_0x824698(_0x586ff1);})['catch'](function(_0xf7a95b){logger['error'](_0x4546('0x1a'),_0xf7a95b[_0x4546('0x12')],_0x2cca8b);_0x4618a6(_0x4f9fcf['error'](0x1f4,_0xf7a95b['message']));});});}; \ No newline at end of file +var _0xdc91=['stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x18215f,_0x3bbe0b){var _0x4652ee=function(_0x1d45d9){while(--_0x1d45d9){_0x18215f['push'](_0x18215f['shift']());}};_0x4652ee(++_0x3bbe0b);}(_0xdc91,0x8b));var _0x1dc9=function(_0xfc0237,_0x197303){_0xfc0237=_0xfc0237-0x0;var _0x72aaf3=_0xdc91[_0xfc0237];return _0x72aaf3;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}exports[_0x1dc9('0x15')]=function(_0x197bcd){var _0x335590=this;return new Promise(function(_0x1e845a,_0x2442d0){return db[_0x1dc9('0x16')][_0x1dc9('0x17')](_0x197bcd[_0x1dc9('0x18')],{'raw':_0x197bcd[_0x1dc9('0x19')]?_0x197bcd[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x49bd5b){logger[_0x1dc9('0xc')]('CreateOpenchannelQueueReport',_0x197bcd);logger['debug']('CreateOpenchannelQueueReport',_0x197bcd,JSON[_0x1dc9('0x10')](_0x49bd5b));_0x1e845a(_0x49bd5b);})[_0x1dc9('0x14')](function(_0x277499){logger[_0x1dc9('0x11')](_0x1dc9('0x15'),_0x277499[_0x1dc9('0x13')],_0x197bcd);_0x2442d0(_0x335590[_0x1dc9('0x11')](0x1f4,_0x277499['message']));});});};exports[_0x1dc9('0x1b')]=function(_0x2a4740){var _0x14181d=this;return new Promise(function(_0x4c6e65,_0x39f3f7){return db[_0x1dc9('0x16')][_0x1dc9('0x1c')](_0x2a4740[_0x1dc9('0x18')],{'raw':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')]['where']||null:null,'attributes':_0x2a4740['options']?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1d')]||null:null,'limit':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1e')]||null:null})[_0x1dc9('0xb')](function(_0x10123d){logger[_0x1dc9('0xc')](_0x1dc9('0x1b'),_0x2a4740);logger['debug'](_0x1dc9('0x1b'),_0x2a4740,JSON[_0x1dc9('0x10')](_0x10123d));_0x4c6e65(_0x10123d);})[_0x1dc9('0x14')](function(_0x2d75bc){logger[_0x1dc9('0x11')](_0x1dc9('0x1b'),_0x2d75bc['message'],_0x2a4740);_0x39f3f7(_0x14181d['error'](0x1f4,_0x2d75bc[_0x1dc9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ff51bbc..272f6e8 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 _0x5644=['create','put','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','describe','/:id','show','post'];(function(_0x98fe2a,_0x399b98){var _0x3f41da=function(_0x256892){while(--_0x256892){_0x98fe2a['push'](_0x98fe2a['shift']());}};_0x3f41da(++_0x399b98);}(_0x5644,0x70));var _0x4564=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x5644[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require('multer');var util=require(_0x4564('0x0'));var path=require(_0x4564('0x1'));var timeout=require('connect-timeout');var express=require(_0x4564('0x2'));var router=express[_0x4564('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4564('0x4'));var interaction=require(_0x4564('0x5'));var config=require(_0x4564('0x6'));var controller=require(_0x4564('0x7'));router['get']('/',auth[_0x4564('0x8')](),controller['index']);router[_0x4564('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x4564('0xa')]);router[_0x4564('0x9')](_0x4564('0xb'),auth['isAuthenticated'](),controller[_0x4564('0xc')]);router[_0x4564('0xd')]('/',auth[_0x4564('0x8')](),controller[_0x4564('0xe')]);router[_0x4564('0xf')](_0x4564('0xb'),auth[_0x4564('0x8')](),controller['update']);router[_0x4564('0x10')](_0x4564('0xb'),auth[_0x4564('0x8')](),controller[_0x4564('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd49d=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated','describe','create','put','/:id','update'];(function(_0x47b9c9,_0x3ffeb3){var _0x2587f6=function(_0x43c79){while(--_0x43c79){_0x47b9c9['push'](_0x47b9c9['shift']());}};_0x2587f6(++_0x3ffeb3);}(_0xd49d,0x16a));var _0xdd49=function(_0x1867c0,_0x359504){_0x1867c0=_0x1867c0-0x0;var _0x26d2a8=_0xd49d[_0x1867c0];return _0x26d2a8;};'use strict';var multer=require(_0xdd49('0x0'));var util=require(_0xdd49('0x1'));var path=require(_0xdd49('0x2'));var timeout=require(_0xdd49('0x3'));var express=require(_0xdd49('0x4'));var router=express['Router']();var fs_extra=require(_0xdd49('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd49('0x6'));var config=require(_0xdd49('0x7'));var controller=require(_0xdd49('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd49('0x9')]);router[_0xdd49('0xa')](_0xdd49('0xb'),auth[_0xdd49('0xc')](),controller[_0xdd49('0xd')]);router[_0xdd49('0xa')]('/:id',auth[_0xdd49('0xc')](),controller['show']);router['post']('/',auth[_0xdd49('0xc')](),controller[_0xdd49('0xe')]);router[_0xdd49('0xf')](_0xdd49('0x10'),auth['isAuthenticated'](),controller[_0xdd49('0x11')]);router[_0xdd49('0x12')](_0xdd49('0x10'),auth[_0xdd49('0xc')](),controller['destroy']);module[_0xdd49('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index c488885..585b9bb 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4c878e,_0x46f075){var _0x4e0109=function(_0x5657ce){while(--_0x5657ce){_0x4c878e['push'](_0x4c878e['shift']());}};_0x4e0109(++_0x46f075);}(_0xaa88,0x137));var _0x8aa8=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xaa88[_0x122096];return _0x3d1966;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0x34e8,0x12c));var _0x834e=function(_0x47f32a,_0x404221){_0x47f32a=_0x47f32a-0x0;var _0x26e10c=_0x34e8[_0x47f32a];return _0x26e10c;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ba999b3..f4f8b02 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 _0x90b5=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4ad03b,_0x2eafc0){var _0x28ea7f=function(_0x3790ab){while(--_0x3790ab){_0x4ad03b['push'](_0x4ad03b['shift']());}};_0x28ea7f(++_0x2eafc0);}(_0x90b5,0x1b9));var _0x590b=function(_0x48e342,_0x17da10){_0x48e342=_0x48e342-0x0;var _0x732570=_0x90b5[_0x48e342];return _0x732570;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require(_0x590b('0x1'));var zipdir=require(_0x590b('0x2'));var jsonpatch=require(_0x590b('0x3'));var rp=require('request-promise');var moment=require(_0x590b('0x4'));var BPromise=require(_0x590b('0x5'));var Mustache=require(_0x590b('0x6'));var util=require(_0x590b('0x7'));var path=require('path');var sox=require(_0x590b('0x8'));var csv=require(_0x590b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x590b('0xa'));var _=require(_0x590b('0xb'));var squel=require(_0x590b('0xc'));var crypto=require(_0x590b('0xd'));var jsforce=require(_0x590b('0xe'));var deskjs=require(_0x590b('0xf'));var toCsv=require(_0x590b('0x9'));var querystring=require(_0x590b('0x10'));var Papa=require('papaparse');var Redis=require(_0x590b('0x11'));var authService=require(_0x590b('0x12'));var qs=require(_0x590b('0x13'));var as=require(_0x590b('0x14'));var hardwareService=require(_0x590b('0x15'));var logger=require('../../config/logger')(_0x590b('0x16'));var utils=require(_0x590b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x590b('0x18'));var db=require(_0x590b('0x19'))['db'];function respondWithStatusCode(_0x586a25,_0x4a2303){_0x4a2303=_0x4a2303||0xcc;return function(_0x291794){if(_0x291794){return _0x586a25['sendStatus'](_0x4a2303);}return _0x586a25['status'](_0x4a2303)[_0x590b('0x1a')]();};}function respondWithResult(_0x5f2d7b,_0x24565f){_0x24565f=_0x24565f||0xc8;return function(_0x4a27b0){if(_0x4a27b0){return _0x5f2d7b[_0x590b('0x1b')](_0x24565f)[_0x590b('0x1c')](_0x4a27b0);}};}function respondWithFilteredResult(_0x387cc1,_0x8821fa){return function(_0x271bd8){if(_0x271bd8){var _0x658fe9=typeof _0x8821fa[_0x590b('0x1d')]===_0x590b('0x1e')&&typeof _0x8821fa[_0x590b('0x1f')]===_0x590b('0x1e');var _0x22c578=_0x271bd8[_0x590b('0x20')];var _0x5590ca=_0x658fe9?0x0:_0x8821fa[_0x590b('0x1d')];var _0xbacdbf=_0x658fe9?_0x271bd8['count']:_0x8821fa[_0x590b('0x1d')]+_0x8821fa[_0x590b('0x1f')];var _0x82c1d7;if(_0xbacdbf>=_0x22c578){_0xbacdbf=_0x22c578;_0x82c1d7=0xc8;}else{_0x82c1d7=0xce;}_0x387cc1[_0x590b('0x1b')](_0x82c1d7);return _0x387cc1['set'](_0x590b('0x21'),_0x5590ca+'-'+_0xbacdbf+'/'+_0x22c578)[_0x590b('0x1c')](_0x271bd8);}return null;};}function patchUpdates(_0x23cf77){return function(_0x39cf16){try{jsonpatch['apply'](_0x39cf16,_0x23cf77,!![]);}catch(_0x2c02d4){return BPromise[_0x590b('0x22')](_0x2c02d4);}return _0x39cf16[_0x590b('0x23')]();};}function saveUpdates(_0x9b178d,_0x54a483){return function(_0x2d6045){if(_0x2d6045){return _0x2d6045[_0x590b('0x24')](_0x9b178d)[_0x590b('0x25')](function(_0x1eb561){return _0x1eb561;});}return null;};}function removeEntity(_0x27d4c5,_0x579037){return function(_0xa6407d){if(_0xa6407d){return _0xa6407d[_0x590b('0x26')]()['then'](function(){_0x27d4c5[_0x590b('0x1b')](0xcc)[_0x590b('0x1a')]();});}};}function handleEntityNotFound(_0x4204a4,_0x36c6b8){return function(_0x27c7f5){if(!_0x27c7f5){_0x4204a4['sendStatus'](0x194);}return _0x27c7f5;};}function handleError(_0x567bf2,_0x19a598){_0x19a598=_0x19a598||0x1f4;return function(_0x5a9b0c){logger[_0x590b('0x27')](_0x5a9b0c[_0x590b('0x28')]);if(_0x5a9b0c[_0x590b('0x29')]){delete _0x5a9b0c[_0x590b('0x29')];}_0x567bf2[_0x590b('0x1b')](_0x19a598)[_0x590b('0x2a')](_0x5a9b0c);};}exports[_0x590b('0x2b')]=function(_0x271c72,_0x36e55b){var _0xd872db={},_0x533547={},_0x13d18c={'count':0x0,'rows':[]};var _0x13c8d2=_[_0x590b('0x2c')](db[_0x590b('0x2d')][_0x590b('0x2e')],function(_0x7feae3){return{'name':_0x7feae3[_0x590b('0x2f')],'type':_0x7feae3['type'][_0x590b('0x30')]};});_0x533547[_0x590b('0x31')]=_[_0x590b('0x2c')](_0x13c8d2,_0x590b('0x29'));_0x533547[_0x590b('0x32')]=_[_0x590b('0x33')](_0x271c72['query']);_0x533547[_0x590b('0x34')]=_[_0x590b('0x35')](_0x533547[_0x590b('0x31')],_0x533547[_0x590b('0x32')]);_0xd872db[_0x590b('0x36')]=_[_0x590b('0x35')](_0x533547[_0x590b('0x31')],qs[_0x590b('0x37')](_0x271c72[_0x590b('0x32')]['fields']));_0xd872db[_0x590b('0x36')]=_0xd872db[_0x590b('0x36')][_0x590b('0x38')]?_0xd872db['attributes']:_0x533547[_0x590b('0x31')];if(!_0x271c72[_0x590b('0x32')][_0x590b('0x39')](_0x590b('0x3a'))){_0xd872db['limit']=qs['limit'](_0x271c72[_0x590b('0x32')][_0x590b('0x1f')]);_0xd872db[_0x590b('0x1d')]=qs['offset'](_0x271c72['query']['offset']);}_0xd872db[_0x590b('0x3b')]=qs[_0x590b('0x3c')](_0x271c72[_0x590b('0x32')][_0x590b('0x3c')]);_0xd872db[_0x590b('0x3d')]=qs[_0x590b('0x34')](_['pick'](_0x271c72[_0x590b('0x32')],_0x533547[_0x590b('0x34')]),_0x13c8d2);if(_0x271c72['query'][_0x590b('0x3e')]){_0xd872db[_0x590b('0x3d')]=_[_0x590b('0x3f')](_0xd872db[_0x590b('0x3d')],{'$or':_[_0x590b('0x2c')](_0x13c8d2,function(_0x208ac0){if(_0x208ac0[_0x590b('0x40')]!==_0x590b('0x41')){var _0x3fdc8e={};_0x3fdc8e[_0x208ac0[_0x590b('0x29')]]={'$like':'%'+_0x271c72[_0x590b('0x32')][_0x590b('0x3e')]+'%'};return _0x3fdc8e;}})});}_0xd872db=_[_0x590b('0x3f')]({},_0xd872db,_0x271c72[_0x590b('0x42')]);var _0x4b0fc2={'where':_0xd872db[_0x590b('0x3d')]};return db[_0x590b('0x2d')][_0x590b('0x20')](_0x4b0fc2)['then'](function(_0x47699f){_0x13d18c[_0x590b('0x20')]=_0x47699f;if(_0x271c72[_0x590b('0x32')][_0x590b('0x43')]){_0xd872db['include']=[{'all':!![]}];}return db[_0x590b('0x2d')][_0x590b('0x44')](_0xd872db);})[_0x590b('0x25')](function(_0x22b303){_0x13d18c['rows']=_0x22b303;return _0x13d18c;})[_0x590b('0x25')](respondWithFilteredResult(_0x36e55b,_0xd872db))[_0x590b('0x45')](handleError(_0x36e55b,null));};exports[_0x590b('0x46')]=function(_0xe0a4a,_0x1de0e6){var _0x35c817={'raw':!![],'where':{'id':_0xe0a4a[_0x590b('0x47')]['id']}},_0x4b21dc={};_0x4b21dc['model']=_[_0x590b('0x33')](db[_0x590b('0x2d')][_0x590b('0x2e')]);_0x4b21dc[_0x590b('0x32')]=_[_0x590b('0x33')](_0xe0a4a[_0x590b('0x32')]);_0x4b21dc[_0x590b('0x34')]=_[_0x590b('0x35')](_0x4b21dc['model'],_0x4b21dc[_0x590b('0x32')]);_0x35c817[_0x590b('0x36')]=_[_0x590b('0x35')](_0x4b21dc['model'],qs[_0x590b('0x37')](_0xe0a4a['query'][_0x590b('0x37')]));_0x35c817[_0x590b('0x36')]=_0x35c817[_0x590b('0x36')][_0x590b('0x38')]?_0x35c817[_0x590b('0x36')]:_0x4b21dc[_0x590b('0x31')];if(_0xe0a4a[_0x590b('0x32')][_0x590b('0x43')]){_0x35c817[_0x590b('0x48')]=[{'all':!![]}];}_0x35c817=_[_0x590b('0x3f')]({},_0x35c817,_0xe0a4a[_0x590b('0x42')]);return db[_0x590b('0x2d')][_0x590b('0x49')](_0x35c817)[_0x590b('0x25')](handleEntityNotFound(_0x1de0e6,null))[_0x590b('0x25')](respondWithResult(_0x1de0e6,null))[_0x590b('0x45')](handleError(_0x1de0e6,null));};exports['create']=function(_0x12f3f3,_0x17691b){return db[_0x590b('0x2d')]['create'](_0x12f3f3['body'],{})[_0x590b('0x25')](respondWithResult(_0x17691b,0xc9))[_0x590b('0x45')](handleError(_0x17691b,null));};exports[_0x590b('0x24')]=function(_0x408f61,_0x2ed690){if(_0x408f61[_0x590b('0x4a')]['id']){delete _0x408f61['body']['id'];}return db[_0x590b('0x2d')][_0x590b('0x49')]({'where':{'id':_0x408f61[_0x590b('0x47')]['id']}})[_0x590b('0x25')](handleEntityNotFound(_0x2ed690,null))['then'](saveUpdates(_0x408f61[_0x590b('0x4a')],null))[_0x590b('0x25')](respondWithResult(_0x2ed690,null))['catch'](handleError(_0x2ed690,null));};exports[_0x590b('0x26')]=function(_0x49c72e,_0x557218){return db[_0x590b('0x2d')][_0x590b('0x49')]({'where':{'id':_0x49c72e[_0x590b('0x47')]['id']}})['then'](handleEntityNotFound(_0x557218,null))[_0x590b('0x25')](removeEntity(_0x557218,null))[_0x590b('0x45')](handleError(_0x557218,null));};exports[_0x590b('0x4b')]=function(_0x419313,_0x487992){return db[_0x590b('0x2d')][_0x590b('0x4b')]()[_0x590b('0x25')](respondWithResult(_0x487992,null))[_0x590b('0x45')](handleError(_0x487992,null));}; \ No newline at end of file +var _0xd466=['order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters','attributes','fields'];(function(_0x277208,_0x57ab06){var _0x3e2c03=function(_0x22d743){while(--_0x22d743){_0x277208['push'](_0x277208['shift']());}};_0x3e2c03(++_0x57ab06);}(_0xd466,0xf5));var _0x6d46=function(_0x48fddb,_0x37a2d3){_0x48fddb=_0x48fddb-0x0;var _0x22dad1=_0xd466[_0x48fddb];return _0x22dad1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d46('0x0'));var zipdir=require(_0x6d46('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d46('0x2'));var moment=require(_0x6d46('0x3'));var BPromise=require(_0x6d46('0x4'));var Mustache=require(_0x6d46('0x5'));var util=require(_0x6d46('0x6'));var path=require(_0x6d46('0x7'));var sox=require(_0x6d46('0x8'));var csv=require(_0x6d46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d46('0xa'));var _=require(_0x6d46('0xb'));var squel=require(_0x6d46('0xc'));var crypto=require(_0x6d46('0xd'));var jsforce=require(_0x6d46('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d46('0x9'));var querystring=require(_0x6d46('0xf'));var Papa=require(_0x6d46('0x10'));var Redis=require('ioredis');var authService=require(_0x6d46('0x11'));var qs=require(_0x6d46('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d46('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6d46('0x14'));var config=require(_0x6d46('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137eb5,_0x2965a5){_0x2965a5=_0x2965a5||0xcc;return function(_0x494ea9){if(_0x494ea9){return _0x137eb5['sendStatus'](_0x2965a5);}return _0x137eb5[_0x6d46('0x16')](_0x2965a5)[_0x6d46('0x17')]();};}function respondWithResult(_0x19b67c,_0x10a5be){_0x10a5be=_0x10a5be||0xc8;return function(_0x5bc6b7){if(_0x5bc6b7){return _0x19b67c[_0x6d46('0x16')](_0x10a5be)[_0x6d46('0x18')](_0x5bc6b7);}};}function respondWithFilteredResult(_0x403a28,_0x4f4e13){return function(_0x4e18c2){if(_0x4e18c2){var _0xbebee6=typeof _0x4f4e13['offset']==='undefined'&&typeof _0x4f4e13['limit']===_0x6d46('0x19');var _0x391a84=_0x4e18c2[_0x6d46('0x1a')];var _0x9fe945=_0xbebee6?0x0:_0x4f4e13[_0x6d46('0x1b')];var _0x1c7790=_0xbebee6?_0x4e18c2[_0x6d46('0x1a')]:_0x4f4e13[_0x6d46('0x1b')]+_0x4f4e13[_0x6d46('0x1c')];var _0x30fa;if(_0x1c7790>=_0x391a84){_0x1c7790=_0x391a84;_0x30fa=0xc8;}else{_0x30fa=0xce;}_0x403a28[_0x6d46('0x16')](_0x30fa);return _0x403a28[_0x6d46('0x1d')]('Content-Range',_0x9fe945+'-'+_0x1c7790+'/'+_0x391a84)[_0x6d46('0x18')](_0x4e18c2);}return null;};}function patchUpdates(_0x14b7c4){return function(_0x4ce173){try{jsonpatch[_0x6d46('0x1e')](_0x4ce173,_0x14b7c4,!![]);}catch(_0x3d5f92){return BPromise[_0x6d46('0x1f')](_0x3d5f92);}return _0x4ce173[_0x6d46('0x20')]();};}function saveUpdates(_0x55ce19,_0x46e1be){return function(_0x1b50cb){if(_0x1b50cb){return _0x1b50cb[_0x6d46('0x21')](_0x55ce19)[_0x6d46('0x22')](function(_0x5b46cc){return _0x5b46cc;});}return null;};}function removeEntity(_0x36d138,_0x4679db){return function(_0x5e90d3){if(_0x5e90d3){return _0x5e90d3['destroy']()[_0x6d46('0x22')](function(){_0x36d138['status'](0xcc)[_0x6d46('0x17')]();});}};}function handleEntityNotFound(_0xabb83b,_0x341018){return function(_0x547ff5){if(!_0x547ff5){_0xabb83b[_0x6d46('0x23')](0x194);}return _0x547ff5;};}function handleError(_0x32d471,_0x528519){_0x528519=_0x528519||0x1f4;return function(_0x4498cb){logger[_0x6d46('0x24')](_0x4498cb[_0x6d46('0x25')]);if(_0x4498cb['name']){delete _0x4498cb[_0x6d46('0x26')];}_0x32d471[_0x6d46('0x16')](_0x528519)[_0x6d46('0x27')](_0x4498cb);};}exports[_0x6d46('0x28')]=function(_0x4756f9,_0x294dee){var _0x1c36a9={},_0x184d9d={},_0x341a3f={'count':0x0,'rows':[]};var _0x6499f7=_[_0x6d46('0x29')](db[_0x6d46('0x2a')][_0x6d46('0x2b')],function(_0x2c7c34){return{'name':_0x2c7c34['fieldName'],'type':_0x2c7c34['type'][_0x6d46('0x2c')]};});_0x184d9d[_0x6d46('0x2d')]=_[_0x6d46('0x29')](_0x6499f7,'name');_0x184d9d[_0x6d46('0x2e')]=_[_0x6d46('0x2f')](_0x4756f9['query']);_0x184d9d[_0x6d46('0x30')]=_['intersection'](_0x184d9d['model'],_0x184d9d[_0x6d46('0x2e')]);_0x1c36a9[_0x6d46('0x31')]=_['intersection'](_0x184d9d['model'],qs[_0x6d46('0x32')](_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x32')]));_0x1c36a9[_0x6d46('0x31')]=_0x1c36a9[_0x6d46('0x31')]['length']?_0x1c36a9[_0x6d46('0x31')]:_0x184d9d['model'];if(!_0x4756f9[_0x6d46('0x2e')]['hasOwnProperty']('nolimit')){_0x1c36a9[_0x6d46('0x1c')]=qs[_0x6d46('0x1c')](_0x4756f9['query'][_0x6d46('0x1c')]);_0x1c36a9[_0x6d46('0x1b')]=qs[_0x6d46('0x1b')](_0x4756f9[_0x6d46('0x2e')]['offset']);}_0x1c36a9[_0x6d46('0x33')]=qs[_0x6d46('0x34')](_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x34')]);_0x1c36a9['where']=qs['filters'](_[_0x6d46('0x35')](_0x4756f9['query'],_0x184d9d[_0x6d46('0x30')]),_0x6499f7);if(_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x36')]){_0x1c36a9[_0x6d46('0x37')]=_[_0x6d46('0x38')](_0x1c36a9[_0x6d46('0x37')],{'$or':_[_0x6d46('0x29')](_0x6499f7,function(_0xd74845){if(_0xd74845[_0x6d46('0x39')]!==_0x6d46('0x3a')){var _0x4523d4={};_0x4523d4[_0xd74845['name']]={'$like':'%'+_0x4756f9['query'][_0x6d46('0x36')]+'%'};return _0x4523d4;}})});}_0x1c36a9=_[_0x6d46('0x38')]({},_0x1c36a9,_0x4756f9[_0x6d46('0x3b')]);var _0x45c434={'where':_0x1c36a9[_0x6d46('0x37')]};return db[_0x6d46('0x2a')][_0x6d46('0x1a')](_0x45c434)[_0x6d46('0x22')](function(_0x3f97db){_0x341a3f['count']=_0x3f97db;if(_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x3c')]){_0x1c36a9[_0x6d46('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x6d46('0x3e')](_0x1c36a9);})[_0x6d46('0x22')](function(_0x396877){_0x341a3f[_0x6d46('0x3f')]=_0x396877;return _0x341a3f;})[_0x6d46('0x22')](respondWithFilteredResult(_0x294dee,_0x1c36a9))[_0x6d46('0x40')](handleError(_0x294dee,null));};exports[_0x6d46('0x41')]=function(_0x63645d,_0x183db0){var _0x3f5bda={'raw':!![],'where':{'id':_0x63645d[_0x6d46('0x42')]['id']}},_0x6443a={};_0x6443a[_0x6d46('0x2d')]=_[_0x6d46('0x2f')](db[_0x6d46('0x2a')][_0x6d46('0x2b')]);_0x6443a[_0x6d46('0x2e')]=_[_0x6d46('0x2f')](_0x63645d['query']);_0x6443a[_0x6d46('0x30')]=_[_0x6d46('0x43')](_0x6443a[_0x6d46('0x2d')],_0x6443a[_0x6d46('0x2e')]);_0x3f5bda[_0x6d46('0x31')]=_[_0x6d46('0x43')](_0x6443a[_0x6d46('0x2d')],qs[_0x6d46('0x32')](_0x63645d[_0x6d46('0x2e')][_0x6d46('0x32')]));_0x3f5bda[_0x6d46('0x31')]=_0x3f5bda[_0x6d46('0x31')][_0x6d46('0x44')]?_0x3f5bda['attributes']:_0x6443a[_0x6d46('0x2d')];if(_0x63645d[_0x6d46('0x2e')][_0x6d46('0x3c')]){_0x3f5bda[_0x6d46('0x3d')]=[{'all':!![]}];}_0x3f5bda=_[_0x6d46('0x38')]({},_0x3f5bda,_0x63645d[_0x6d46('0x3b')]);return db[_0x6d46('0x2a')][_0x6d46('0x45')](_0x3f5bda)[_0x6d46('0x22')](handleEntityNotFound(_0x183db0,null))[_0x6d46('0x22')](respondWithResult(_0x183db0,null))['catch'](handleError(_0x183db0,null));};exports[_0x6d46('0x46')]=function(_0x37a613,_0x43cf55){return db[_0x6d46('0x2a')]['create'](_0x37a613[_0x6d46('0x47')],{})[_0x6d46('0x22')](respondWithResult(_0x43cf55,0xc9))[_0x6d46('0x40')](handleError(_0x43cf55,null));};exports[_0x6d46('0x21')]=function(_0x44b049,_0x2df449){if(_0x44b049[_0x6d46('0x47')]['id']){delete _0x44b049[_0x6d46('0x47')]['id'];}return db[_0x6d46('0x2a')]['find']({'where':{'id':_0x44b049[_0x6d46('0x42')]['id']}})[_0x6d46('0x22')](handleEntityNotFound(_0x2df449,null))[_0x6d46('0x22')](saveUpdates(_0x44b049[_0x6d46('0x47')],null))[_0x6d46('0x22')](respondWithResult(_0x2df449,null))[_0x6d46('0x40')](handleError(_0x2df449,null));};exports[_0x6d46('0x48')]=function(_0x3ad673,_0x5a9fb6){return db['OpenchannelTransferReport'][_0x6d46('0x45')]({'where':{'id':_0x3ad673['params']['id']}})[_0x6d46('0x22')](handleEntityNotFound(_0x5a9fb6,null))['then'](removeEntity(_0x5a9fb6,null))['catch'](handleError(_0x5a9fb6,null));};exports['describe']=function(_0x17a07d,_0x9ec017){return db[_0x6d46('0x2a')][_0x6d46('0x49')]()[_0x6d46('0x22')](respondWithResult(_0x9ec017,null))[_0x6d46('0x40')](handleError(_0x9ec017,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 849f1df..a96671c 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 _0xb48a=['moment','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','api'];(function(_0x28f41a,_0x3240e3){var _0x41bfa8=function(_0xc5e3dc){while(--_0xc5e3dc){_0x28f41a['push'](_0x28f41a['shift']());}};_0x41bfa8(++_0x3240e3);}(_0xb48a,0xbe));var _0xab48=function(_0x4c5022,_0x4c1972){_0x4c5022=_0x4c5022-0x0;var _0x4b7545=_0xb48a[_0x4c5022];return _0x4b7545;};'use strict';var _=require(_0xab48('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab48('0x1'));var moment=require(_0xab48('0x2'));var BPromise=require(_0xab48('0x3'));var rp=require(_0xab48('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab48('0x5'));var attributes=require(_0xab48('0x6'));module[_0xab48('0x7')]=function(_0x45750d,_0x1749f6){return _0x45750d[_0xab48('0x8')](_0xab48('0x9'),attributes,{'tableName':_0xab48('0xa'),'paranoid':![],'indexes':[{'name':_0xab48('0xb'),'fields':[_0xab48('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd99e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer'];(function(_0x59dbc3,_0xfc1f22){var _0x1ba735=function(_0x5bc380){while(--_0x5bc380){_0x59dbc3['push'](_0x59dbc3['shift']());}};_0x1ba735(++_0xfc1f22);}(_0xd99e,0x68));var _0xed99=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xd99e[_0x333767];return _0x51661b;};'use strict';var _=require(_0xed99('0x0'));var util=require(_0xed99('0x1'));var logger=require(_0xed99('0x2'))(_0xed99('0x3'));var moment=require(_0xed99('0x4'));var BPromise=require(_0xed99('0x5'));var rp=require(_0xed99('0x6'));var fs=require('fs');var path=require(_0xed99('0x7'));var rimraf=require(_0xed99('0x8'));var config=require(_0xed99('0x9'));var attributes=require(_0xed99('0xa'));module['exports']=function(_0x412c4b,_0x23e052){return _0x412c4b[_0xed99('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0xed99('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','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 24cf0ad..67a86e6 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 _0x432b=['http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client'];(function(_0x214fe8,_0x3eea5e){var _0x405a51=function(_0x52ebe1){while(--_0x52ebe1){_0x214fe8['push'](_0x214fe8['shift']());}};_0x405a51(++_0x3eea5e);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb432('0x0'));var util=require('util');var moment=require(_0xb432('0x1'));var BPromise=require(_0xb432('0x2'));var rs=require(_0xb432('0x3'));var fs=require('fs');var Redis=require(_0xb432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb432('0x5'))('rpc');var config=require(_0xb432('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb432('0x7')][_0xb432('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x274447,_0x45f857,_0x14fed4){return new BPromise(function(_0x6833df,_0x198b71){return client[_0xb432('0x9')](_0x274447,_0x14fed4)['then'](function(_0x12adbe){logger[_0xb432('0xa')](_0xb432('0xb'),_0x45f857,_0xb432('0xc'));logger[_0xb432('0xd')](_0xb432('0xe'),_0x45f857,'request\x20sent',JSON['stringify'](_0x12adbe));if(_0x12adbe[_0xb432('0xf')]){if(_0x12adbe[_0xb432('0xf')]['code']===0x1f4){logger[_0xb432('0xf')](_0xb432('0xb'),_0x45f857,_0x12adbe[_0xb432('0xf')]['message']);return _0x198b71(_0x12adbe[_0xb432('0xf')][_0xb432('0x10')]);}logger['error'](_0xb432('0xb'),_0x45f857,_0x12adbe[_0xb432('0xf')][_0xb432('0x10')]);return _0x6833df(_0x12adbe[_0xb432('0xf')][_0xb432('0x10')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x45f857,_0xb432('0xc'));_0x6833df(_0x12adbe[_0xb432('0x11')][_0xb432('0x10')]);}})[_0xb432('0x12')](function(_0x27365c){logger[_0xb432('0xf')](_0xb432('0xb'),_0x45f857,_0x27365c);_0x198b71(_0x27365c);});});} \ No newline at end of file +var _0x04f9=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f9,0xb3));var _0x904f=function(_0x58d66a,_0x167ce5){_0x58d66a=_0x58d66a-0x0;var _0x55aeb6=_0x04f9[_0x58d66a];return _0x55aeb6;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var moment=require(_0x904f('0x1'));var BPromise=require(_0x904f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x904f('0x3'));var db=require(_0x904f('0x4'))['db'];var utils=require(_0x904f('0x5'));var logger=require(_0x904f('0x6'))(_0x904f('0x7'));var config=require(_0x904f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x904f('0x9')][_0x904f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175c38,_0x21dce4,_0x34cbd7){return new BPromise(function(_0x506239,_0xa90c3f){return client[_0x904f('0xb')](_0x175c38,_0x34cbd7)[_0x904f('0xc')](function(_0x4f8d32){logger[_0x904f('0xd')](_0x904f('0xe'),_0x21dce4,_0x904f('0xf'));logger[_0x904f('0x10')](_0x904f('0x11'),_0x21dce4,_0x904f('0xf'),JSON[_0x904f('0x12')](_0x4f8d32));if(_0x4f8d32[_0x904f('0x13')]){if(_0x4f8d32[_0x904f('0x13')][_0x904f('0x14')]===0x1f4){logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0xa90c3f(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0x506239(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}else{logger[_0x904f('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x21dce4,'request\x20sent');_0x506239(_0x4f8d32[_0x904f('0x16')][_0x904f('0x15')]);}})['catch'](function(_0x58c4d6){logger['error'](_0x904f('0xe'),_0x21dce4,_0x58c4d6);_0xa90c3f(_0x58c4d6);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 96e06ed..a7f35e9 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 _0x59e8=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x38bf74,_0x1164bd){var _0x414e5b=function(_0x2e0cc4){while(--_0x2e0cc4){_0x38bf74['push'](_0x38bf74['shift']());}};_0x414e5b(++_0x1164bd);}(_0x59e8,0x142));var _0x859e=function(_0x45c6dd,_0x5d8455){_0x45c6dd=_0x45c6dd-0x0;var _0x334f53=_0x59e8[_0x45c6dd];return _0x334f53;};'use strict';var multer=require(_0x859e('0x0'));var util=require('util');var path=require(_0x859e('0x1'));var timeout=require('connect-timeout');var express=require(_0x859e('0x2'));var router=express[_0x859e('0x3')]();var fs_extra=require(_0x859e('0x4'));var auth=require(_0x859e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x859e('0x6'));var controller=require(_0x859e('0x7'));router['get']('/',auth[_0x859e('0x8')](),controller['index']);router[_0x859e('0x9')]('/:id',auth[_0x859e('0x8')](),controller[_0x859e('0xa')]);router[_0x859e('0xb')]('/',auth[_0x859e('0x8')](),controller[_0x859e('0xc')]);router[_0x859e('0xd')](_0x859e('0xe'),auth[_0x859e('0x8')](),controller[_0x859e('0xf')]);router[_0x859e('0x10')](_0x859e('0xe'),auth[_0x859e('0x8')](),controller[_0x859e('0x11')]);module[_0x859e('0x12')]=router; \ No newline at end of file +var _0x0817=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post','create'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0x0817,0x90));var _0x7081=function(_0x1b262b,_0x10c7c6){_0x1b262b=_0x1b262b-0x0;var _0x54ac1f=_0x0817[_0x1b262b];return _0x54ac1f;};'use strict';var multer=require(_0x7081('0x0'));var util=require('util');var path=require(_0x7081('0x1'));var timeout=require(_0x7081('0x2'));var express=require(_0x7081('0x3'));var router=express[_0x7081('0x4')]();var fs_extra=require(_0x7081('0x5'));var auth=require(_0x7081('0x6'));var interaction=require(_0x7081('0x7'));var config=require(_0x7081('0x8'));var controller=require(_0x7081('0x9'));router[_0x7081('0xa')]('/',auth[_0x7081('0xb')](),controller[_0x7081('0xc')]);router[_0x7081('0xa')]('/:id',auth[_0x7081('0xb')](),controller[_0x7081('0xd')]);router[_0x7081('0xe')]('/',auth['isAuthenticated'](),controller[_0x7081('0xf')]);router['put']('/:id',auth[_0x7081('0xb')](),controller[_0x7081('0x10')]);router[_0x7081('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7081('0x12')]);module[_0x7081('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f7d5a6e..5aa0aca 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 _0x2e20=['sequelize','exports','STRING','name'];(function(_0x4aa6ea,_0x2d4844){var _0x1aa876=function(_0x4facf8){while(--_0x4facf8){_0x4aa6ea['push'](_0x4aa6ea['shift']());}};_0x1aa876(++_0x2d4844);}(_0x2e20,0xc0));var _0x02e2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x2e20[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x02e2('0x0'));module[_0x02e2('0x1')]={'name':{'type':Sequelize[_0x02e2('0x2')],'unique':_0x02e2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x02e2('0x2')]}}; \ No newline at end of file +var _0xe0f1=['exports','STRING','name'];(function(_0x4104d6,_0x208918){var _0x1026af=function(_0x42c2d6){while(--_0x42c2d6){_0x4104d6['push'](_0x4104d6['shift']());}};_0x1026af(++_0x208918);}(_0xe0f1,0xa5));var _0x1e0f=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xe0f1[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require('sequelize');module[_0x1e0f('0x0')]={'name':{'type':Sequelize[_0x1e0f('0x1')],'unique':_0x1e0f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1e0f('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index b7db95e..aa67548 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 _0xeccf=['filter','merge','VIRTUAL','options','Pause','includeAll','findAll','catch','keys','include','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','get','Pauses','UserProfileResource','destroy','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','sort','where','pick'];(function(_0x2b4988,_0x3be027){var _0x1f57d2=function(_0x3976f3){while(--_0x3976f3){_0x2b4988['push'](_0x2b4988['shift']());}};_0x1f57d2(++_0x3be027);}(_0xeccf,0x105));var _0xfecc=function(_0xac3476,_0x1f77b7){_0xac3476=_0xac3476-0x0;var _0x489529=_0xeccf[_0xac3476];return _0x489529;};'use strict';var emlformat=require(_0xfecc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfecc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfecc('0x2'));var moment=require('moment');var BPromise=require(_0xfecc('0x3'));var Mustache=require(_0xfecc('0x4'));var util=require(_0xfecc('0x5'));var path=require(_0xfecc('0x6'));var sox=require('sox');var csv=require(_0xfecc('0x7'));var ejs=require(_0xfecc('0x8'));var fs=require('fs');var fs_extra=require(_0xfecc('0x9'));var _=require(_0xfecc('0xa'));var squel=require(_0xfecc('0xb'));var crypto=require(_0xfecc('0xc'));var jsforce=require(_0xfecc('0xd'));var deskjs=require(_0xfecc('0xe'));var toCsv=require(_0xfecc('0x7'));var querystring=require(_0xfecc('0xf'));var Papa=require(_0xfecc('0x10'));var Redis=require(_0xfecc('0x11'));var authService=require(_0xfecc('0x12'));var qs=require(_0xfecc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfecc('0x14'));var logger=require(_0xfecc('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xfecc('0x16'));var licenseUtil=require(_0xfecc('0x17'));var db=require(_0xfecc('0x18'))['db'];function respondWithStatusCode(_0x554f2f,_0x3b8eb0){_0x3b8eb0=_0x3b8eb0||0xcc;return function(_0x22317b){if(_0x22317b){return _0x554f2f[_0xfecc('0x19')](_0x3b8eb0);}return _0x554f2f[_0xfecc('0x1a')](_0x3b8eb0)['end']();};}function respondWithResult(_0x144ca6,_0x477cfc){_0x477cfc=_0x477cfc||0xc8;return function(_0x440d97){if(_0x440d97){return _0x144ca6['status'](_0x477cfc)[_0xfecc('0x1b')](_0x440d97);}};}function respondWithFilteredResult(_0x3280b2,_0x5e5c9e){return function(_0x5926ad){if(_0x5926ad){var _0x25e90f=typeof _0x5e5c9e[_0xfecc('0x1c')]===_0xfecc('0x1d')&&typeof _0x5e5c9e[_0xfecc('0x1e')]===_0xfecc('0x1d');var _0x52d5e4=_0x5926ad[_0xfecc('0x1f')];var _0x2f0c55=_0x25e90f?0x0:_0x5e5c9e[_0xfecc('0x1c')];var _0x49f962=_0x25e90f?_0x5926ad[_0xfecc('0x1f')]:_0x5e5c9e[_0xfecc('0x1c')]+_0x5e5c9e[_0xfecc('0x1e')];var _0x303416;if(_0x49f962>=_0x52d5e4){_0x49f962=_0x52d5e4;_0x303416=0xc8;}else{_0x303416=0xce;}_0x3280b2[_0xfecc('0x1a')](_0x303416);return _0x3280b2['set']('Content-Range',_0x2f0c55+'-'+_0x49f962+'/'+_0x52d5e4)[_0xfecc('0x1b')](_0x5926ad);}return null;};}function patchUpdates(_0x1cb32d){return function(_0x4c3713){try{jsonpatch[_0xfecc('0x20')](_0x4c3713,_0x1cb32d,!![]);}catch(_0x950628){return BPromise['reject'](_0x950628);}return _0x4c3713[_0xfecc('0x21')]();};}function saveUpdates(_0x275d19,_0x34fff0){return function(_0x3a3361){if(_0x3a3361){return _0x3a3361[_0xfecc('0x22')](_0x275d19)[_0xfecc('0x23')](function(_0x5319ac){return _0x5319ac;});}return null;};}function removeEntity(_0x2d718d,_0x4b0e84){return function(_0x9e37b9){if(_0x9e37b9){return _0x9e37b9['destroy']()['then'](function(){var _0xe36d2b=_0x9e37b9[_0xfecc('0x24')]({'plain':!![]});var _0xeea356=_0xfecc('0x25');return db[_0xfecc('0x26')][_0xfecc('0x27')]({'where':{'type':_0xeea356,'resourceId':_0xe36d2b['id']}})[_0xfecc('0x23')](function(){return _0x9e37b9;});})[_0xfecc('0x23')](function(){_0x2d718d[_0xfecc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d6cb8,_0x385156){return function(_0x307672){if(!_0x307672){_0x5d6cb8[_0xfecc('0x19')](0x194);}return _0x307672;};}function handleError(_0x30051e,_0x2afecc){_0x2afecc=_0x2afecc||0x1f4;return function(_0x5747a2){logger['error'](_0x5747a2[_0xfecc('0x28')]);if(_0x5747a2['name']){delete _0x5747a2['name'];}_0x30051e[_0xfecc('0x1a')](_0x2afecc)[_0xfecc('0x29')](_0x5747a2);};}exports[_0xfecc('0x2a')]=function(_0x46de78,_0x437127){var _0x27d3fd={},_0x2081a7={},_0x29f587={'count':0x0,'rows':[]};var _0x129634=_[_0xfecc('0x2b')](db['Pause'][_0xfecc('0x2c')],function(_0x2d5de7){return{'name':_0x2d5de7[_0xfecc('0x2d')],'type':_0x2d5de7[_0xfecc('0x2e')][_0xfecc('0x2f')]};});_0x2081a7[_0xfecc('0x30')]=_['map'](_0x129634,_0xfecc('0x31'));_0x2081a7[_0xfecc('0x32')]=_['keys'](_0x46de78[_0xfecc('0x32')]);_0x2081a7[_0xfecc('0x33')]=_['intersection'](_0x2081a7[_0xfecc('0x30')],_0x2081a7[_0xfecc('0x32')]);_0x27d3fd[_0xfecc('0x34')]=_[_0xfecc('0x35')](_0x2081a7[_0xfecc('0x30')],qs[_0xfecc('0x36')](_0x46de78[_0xfecc('0x32')]['fields']));_0x27d3fd[_0xfecc('0x34')]=_0x27d3fd[_0xfecc('0x34')][_0xfecc('0x37')]?_0x27d3fd[_0xfecc('0x34')]:_0x2081a7['model'];if(!_0x46de78[_0xfecc('0x32')]['hasOwnProperty']('nolimit')){_0x27d3fd['limit']=qs[_0xfecc('0x1e')](_0x46de78[_0xfecc('0x32')][_0xfecc('0x1e')]);_0x27d3fd[_0xfecc('0x1c')]=qs[_0xfecc('0x1c')](_0x46de78['query'][_0xfecc('0x1c')]);}_0x27d3fd['order']=qs[_0xfecc('0x38')](_0x46de78[_0xfecc('0x32')][_0xfecc('0x38')]);_0x27d3fd[_0xfecc('0x39')]=qs[_0xfecc('0x33')](_[_0xfecc('0x3a')](_0x46de78[_0xfecc('0x32')],_0x2081a7[_0xfecc('0x33')]),_0x129634);if(_0x46de78[_0xfecc('0x32')][_0xfecc('0x3b')]){_0x27d3fd[_0xfecc('0x39')]=_[_0xfecc('0x3c')](_0x27d3fd['where'],{'$or':_[_0xfecc('0x2b')](_0x129634,function(_0x50a189){if(_0x50a189[_0xfecc('0x2e')]!==_0xfecc('0x3d')){var _0x5470c4={};_0x5470c4[_0x50a189[_0xfecc('0x31')]]={'$like':'%'+_0x46de78[_0xfecc('0x32')]['filter']+'%'};return _0x5470c4;}})});}_0x27d3fd=_[_0xfecc('0x3c')]({},_0x27d3fd,_0x46de78[_0xfecc('0x3e')]);var _0x24b34f={'where':_0x27d3fd[_0xfecc('0x39')]};return db[_0xfecc('0x3f')][_0xfecc('0x1f')](_0x24b34f)[_0xfecc('0x23')](function(_0x379ea6){_0x29f587[_0xfecc('0x1f')]=_0x379ea6;if(_0x46de78[_0xfecc('0x32')][_0xfecc('0x40')]){_0x27d3fd['include']=[{'all':!![]}];}return db[_0xfecc('0x3f')][_0xfecc('0x41')](_0x27d3fd);})['then'](function(_0xab9058){_0x29f587['rows']=_0xab9058;return _0x29f587;})[_0xfecc('0x23')](respondWithFilteredResult(_0x437127,_0x27d3fd))[_0xfecc('0x42')](handleError(_0x437127,null));};exports['show']=function(_0x5f2042,_0x1148bd){var _0x27094e={'raw':!![],'where':{'id':_0x5f2042['params']['id']}},_0x149b55={};_0x149b55[_0xfecc('0x30')]=_[_0xfecc('0x43')](db[_0xfecc('0x3f')][_0xfecc('0x2c')]);_0x149b55[_0xfecc('0x32')]=_[_0xfecc('0x43')](_0x5f2042[_0xfecc('0x32')]);_0x149b55[_0xfecc('0x33')]=_[_0xfecc('0x35')](_0x149b55['model'],_0x149b55[_0xfecc('0x32')]);_0x27094e[_0xfecc('0x34')]=_[_0xfecc('0x35')](_0x149b55[_0xfecc('0x30')],qs['fields'](_0x5f2042[_0xfecc('0x32')][_0xfecc('0x36')]));_0x27094e[_0xfecc('0x34')]=_0x27094e['attributes'][_0xfecc('0x37')]?_0x27094e['attributes']:_0x149b55[_0xfecc('0x30')];if(_0x5f2042['query'][_0xfecc('0x40')]){_0x27094e[_0xfecc('0x44')]=[{'all':!![]}];}_0x27094e=_[_0xfecc('0x3c')]({},_0x27094e,_0x5f2042['options']);return db[_0xfecc('0x3f')]['find'](_0x27094e)[_0xfecc('0x23')](handleEntityNotFound(_0x1148bd,null))[_0xfecc('0x23')](respondWithResult(_0x1148bd,null))['catch'](handleError(_0x1148bd,null));};exports['create']=function(_0x288645,_0xc92f41){return db['Pause'][_0xfecc('0x45')](_0x288645[_0xfecc('0x46')],{})[_0xfecc('0x23')](function(_0x25d6d0){var _0x2223ea=_0x288645['user']['get']({'plain':!![]});if(!_0x2223ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2223ea[_0xfecc('0x47')]===_0xfecc('0x48')){var _0x16aa5a=_0x25d6d0['get']({'plain':!![]});var _0x4ac51a=_0xfecc('0x25');return db[_0xfecc('0x49')][_0xfecc('0x4a')]({'where':{'name':_0x4ac51a,'userProfileId':_0x2223ea[_0xfecc('0x4b')]},'raw':!![]})[_0xfecc('0x23')](function(_0x2b269c){if(_0x2b269c&&_0x2b269c[_0xfecc('0x4c')]===0x0){return db[_0xfecc('0x26')][_0xfecc('0x45')]({'name':_0x16aa5a[_0xfecc('0x31')],'resourceId':_0x16aa5a['id'],'type':_0x2b269c[_0xfecc('0x31')],'sectionId':_0x2b269c['id']},{})[_0xfecc('0x23')](function(){return _0x25d6d0;});}else{return _0x25d6d0;}})[_0xfecc('0x42')](function(_0x32626c){logger[_0xfecc('0x4d')](_0xfecc('0x4e'),_0x32626c);throw _0x32626c;});}return _0x25d6d0;})[_0xfecc('0x23')](respondWithResult(_0xc92f41,0xc9))['catch'](handleError(_0xc92f41,null));};exports['update']=function(_0x4ac207,_0x27574c){if(_0x4ac207[_0xfecc('0x46')]['id']){delete _0x4ac207[_0xfecc('0x46')]['id'];}return db[_0xfecc('0x3f')][_0xfecc('0x4a')]({'where':{'id':_0x4ac207[_0xfecc('0x4f')]['id']}})[_0xfecc('0x23')](handleEntityNotFound(_0x27574c,null))[_0xfecc('0x23')](saveUpdates(_0x4ac207[_0xfecc('0x46')],null))[_0xfecc('0x23')](respondWithResult(_0x27574c,null))[_0xfecc('0x42')](handleError(_0x27574c,null));};exports[_0xfecc('0x27')]=function(_0x5c95ac,_0x3bd099){return db[_0xfecc('0x3f')][_0xfecc('0x4a')]({'where':{'id':_0x5c95ac['params']['id']}})[_0xfecc('0x23')](handleEntityNotFound(_0x3bd099,null))[_0xfecc('0x23')](removeEntity(_0x3bd099,null))['catch'](handleError(_0x3bd099,null));}; \ No newline at end of file +var _0x7049=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','get','Pauses','then','end','stack','name','index','map','Pause','rawAttributes','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x1590e6,_0x5cb128){var _0x42b188=function(_0x21b4e3){while(--_0x21b4e3){_0x1590e6['push'](_0x1590e6['shift']());}};_0x42b188(++_0x5cb128);}(_0x7049,0x1d9));var _0x9704=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x7049[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x9704('0x0'));var rimraf=require(_0x9704('0x1'));var zipdir=require(_0x9704('0x2'));var jsonpatch=require(_0x9704('0x3'));var rp=require(_0x9704('0x4'));var moment=require(_0x9704('0x5'));var BPromise=require(_0x9704('0x6'));var Mustache=require(_0x9704('0x7'));var util=require(_0x9704('0x8'));var path=require(_0x9704('0x9'));var sox=require(_0x9704('0xa'));var csv=require('to-csv');var ejs=require(_0x9704('0xb'));var fs=require('fs');var fs_extra=require(_0x9704('0xc'));var _=require(_0x9704('0xd'));var squel=require(_0x9704('0xe'));var crypto=require(_0x9704('0xf'));var jsforce=require(_0x9704('0x10'));var deskjs=require(_0x9704('0x11'));var toCsv=require(_0x9704('0x12'));var querystring=require(_0x9704('0x13'));var Papa=require(_0x9704('0x14'));var Redis=require(_0x9704('0x15'));var authService=require(_0x9704('0x16'));var qs=require(_0x9704('0x17'));var as=require(_0x9704('0x18'));var hardwareService=require(_0x9704('0x19'));var logger=require(_0x9704('0x1a'))('api');var utils=require(_0x9704('0x1b'));var config=require(_0x9704('0x1c'));var licenseUtil=require(_0x9704('0x1d'));var db=require(_0x9704('0x1e'))['db'];function respondWithStatusCode(_0x3450c4,_0x50ee8f){_0x50ee8f=_0x50ee8f||0xcc;return function(_0x4df36a){if(_0x4df36a){return _0x3450c4[_0x9704('0x1f')](_0x50ee8f);}return _0x3450c4[_0x9704('0x20')](_0x50ee8f)['end']();};}function respondWithResult(_0x34044a,_0x3372c2){_0x3372c2=_0x3372c2||0xc8;return function(_0xaad760){if(_0xaad760){return _0x34044a['status'](_0x3372c2)[_0x9704('0x21')](_0xaad760);}};}function respondWithFilteredResult(_0x9759d5,_0x2cf223){return function(_0x26faeb){if(_0x26faeb){var _0x50a515=typeof _0x2cf223[_0x9704('0x22')]==='undefined'&&typeof _0x2cf223[_0x9704('0x23')]===_0x9704('0x24');var _0x1fe47f=_0x26faeb[_0x9704('0x25')];var _0x7529f7=_0x50a515?0x0:_0x2cf223[_0x9704('0x22')];var _0xc99256=_0x50a515?_0x26faeb[_0x9704('0x25')]:_0x2cf223[_0x9704('0x22')]+_0x2cf223[_0x9704('0x23')];var _0xd5930d;if(_0xc99256>=_0x1fe47f){_0xc99256=_0x1fe47f;_0xd5930d=0xc8;}else{_0xd5930d=0xce;}_0x9759d5[_0x9704('0x20')](_0xd5930d);return _0x9759d5[_0x9704('0x26')]('Content-Range',_0x7529f7+'-'+_0xc99256+'/'+_0x1fe47f)[_0x9704('0x21')](_0x26faeb);}return null;};}function patchUpdates(_0x24121d){return function(_0x3caff5){try{jsonpatch[_0x9704('0x27')](_0x3caff5,_0x24121d,!![]);}catch(_0x330ef6){return BPromise[_0x9704('0x28')](_0x330ef6);}return _0x3caff5[_0x9704('0x29')]();};}function saveUpdates(_0x3d32c7,_0x313e58){return function(_0x798bab){if(_0x798bab){return _0x798bab[_0x9704('0x2a')](_0x3d32c7)['then'](function(_0x35c9df){return _0x35c9df;});}return null;};}function removeEntity(_0x18f8b2,_0x7dcd77){return function(_0x41f560){if(_0x41f560){return _0x41f560[_0x9704('0x2b')]()['then'](function(){var _0x1be6a5=_0x41f560[_0x9704('0x2c')]({'plain':!![]});var _0x8af3c9=_0x9704('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x8af3c9,'resourceId':_0x1be6a5['id']}})[_0x9704('0x2e')](function(){return _0x41f560;});})[_0x9704('0x2e')](function(){_0x18f8b2[_0x9704('0x20')](0xcc)[_0x9704('0x2f')]();});}};}function handleEntityNotFound(_0x4ae470,_0x54f8ac){return function(_0x4e2b66){if(!_0x4e2b66){_0x4ae470['sendStatus'](0x194);}return _0x4e2b66;};}function handleError(_0x5da6a7,_0x502bef){_0x502bef=_0x502bef||0x1f4;return function(_0x10e9b9){logger['error'](_0x10e9b9[_0x9704('0x30')]);if(_0x10e9b9[_0x9704('0x31')]){delete _0x10e9b9['name'];}_0x5da6a7['status'](_0x502bef)['send'](_0x10e9b9);};}exports[_0x9704('0x32')]=function(_0x236392,_0x35c634){var _0x82c005={},_0x1fdc96={},_0x4347f9={'count':0x0,'rows':[]};var _0x581ae1=_[_0x9704('0x33')](db[_0x9704('0x34')][_0x9704('0x35')],function(_0x324282){return{'name':_0x324282['fieldName'],'type':_0x324282[_0x9704('0x36')]['key']};});_0x1fdc96[_0x9704('0x37')]=_[_0x9704('0x33')](_0x581ae1,_0x9704('0x31'));_0x1fdc96['query']=_[_0x9704('0x38')](_0x236392[_0x9704('0x39')]);_0x1fdc96[_0x9704('0x3a')]=_[_0x9704('0x3b')](_0x1fdc96[_0x9704('0x37')],_0x1fdc96[_0x9704('0x39')]);_0x82c005[_0x9704('0x3c')]=_[_0x9704('0x3b')](_0x1fdc96['model'],qs['fields'](_0x236392['query']['fields']));_0x82c005[_0x9704('0x3c')]=_0x82c005['attributes'][_0x9704('0x3d')]?_0x82c005['attributes']:_0x1fdc96[_0x9704('0x37')];if(!_0x236392[_0x9704('0x39')][_0x9704('0x3e')]('nolimit')){_0x82c005[_0x9704('0x23')]=qs[_0x9704('0x23')](_0x236392[_0x9704('0x39')]['limit']);_0x82c005[_0x9704('0x22')]=qs['offset'](_0x236392[_0x9704('0x39')]['offset']);}_0x82c005[_0x9704('0x3f')]=qs[_0x9704('0x40')](_0x236392[_0x9704('0x39')][_0x9704('0x40')]);_0x82c005[_0x9704('0x41')]=qs[_0x9704('0x3a')](_[_0x9704('0x42')](_0x236392[_0x9704('0x39')],_0x1fdc96[_0x9704('0x3a')]),_0x581ae1);if(_0x236392[_0x9704('0x39')][_0x9704('0x43')]){_0x82c005['where']=_[_0x9704('0x44')](_0x82c005[_0x9704('0x41')],{'$or':_[_0x9704('0x33')](_0x581ae1,function(_0x3f301e){if(_0x3f301e['type']!==_0x9704('0x45')){var _0x5d0ffb={};_0x5d0ffb[_0x3f301e[_0x9704('0x31')]]={'$like':'%'+_0x236392[_0x9704('0x39')]['filter']+'%'};return _0x5d0ffb;}})});}_0x82c005=_[_0x9704('0x44')]({},_0x82c005,_0x236392[_0x9704('0x46')]);var _0xcc6c74={'where':_0x82c005[_0x9704('0x41')]};return db[_0x9704('0x34')][_0x9704('0x25')](_0xcc6c74)[_0x9704('0x2e')](function(_0x4e24d5){_0x4347f9[_0x9704('0x25')]=_0x4e24d5;if(_0x236392[_0x9704('0x39')][_0x9704('0x47')]){_0x82c005[_0x9704('0x48')]=[{'all':!![]}];}return db['Pause'][_0x9704('0x49')](_0x82c005);})['then'](function(_0x159020){_0x4347f9[_0x9704('0x4a')]=_0x159020;return _0x4347f9;})[_0x9704('0x2e')](respondWithFilteredResult(_0x35c634,_0x82c005))[_0x9704('0x4b')](handleError(_0x35c634,null));};exports[_0x9704('0x4c')]=function(_0x4612ac,_0x35948b){var _0x1043e4={'raw':!![],'where':{'id':_0x4612ac[_0x9704('0x4d')]['id']}},_0x5c30c8={};_0x5c30c8[_0x9704('0x37')]=_[_0x9704('0x38')](db[_0x9704('0x34')][_0x9704('0x35')]);_0x5c30c8[_0x9704('0x39')]=_[_0x9704('0x38')](_0x4612ac[_0x9704('0x39')]);_0x5c30c8['filters']=_[_0x9704('0x3b')](_0x5c30c8[_0x9704('0x37')],_0x5c30c8['query']);_0x1043e4[_0x9704('0x3c')]=_[_0x9704('0x3b')](_0x5c30c8['model'],qs[_0x9704('0x4e')](_0x4612ac[_0x9704('0x39')]['fields']));_0x1043e4[_0x9704('0x3c')]=_0x1043e4[_0x9704('0x3c')][_0x9704('0x3d')]?_0x1043e4[_0x9704('0x3c')]:_0x5c30c8[_0x9704('0x37')];if(_0x4612ac[_0x9704('0x39')][_0x9704('0x47')]){_0x1043e4[_0x9704('0x48')]=[{'all':!![]}];}_0x1043e4=_['merge']({},_0x1043e4,_0x4612ac[_0x9704('0x46')]);return db[_0x9704('0x34')][_0x9704('0x4f')](_0x1043e4)[_0x9704('0x2e')](handleEntityNotFound(_0x35948b,null))[_0x9704('0x2e')](respondWithResult(_0x35948b,null))[_0x9704('0x4b')](handleError(_0x35948b,null));};exports[_0x9704('0x50')]=function(_0x3cf7d3,_0x7a07a0){return db['Pause']['create'](_0x3cf7d3[_0x9704('0x51')],{})[_0x9704('0x2e')](function(_0x1fb8cc){var _0x9d0bc=_0x3cf7d3[_0x9704('0x52')][_0x9704('0x2c')]({'plain':!![]});if(!_0x9d0bc)throw new Error(_0x9704('0x53'));if(_0x9d0bc[_0x9704('0x54')]==='user'){var _0x13505c=_0x1fb8cc['get']({'plain':!![]});var _0x537298=_0x9704('0x2d');return db[_0x9704('0x55')]['find']({'where':{'name':_0x537298,'userProfileId':_0x9d0bc[_0x9704('0x56')]},'raw':!![]})[_0x9704('0x2e')](function(_0x3b5d5c){if(_0x3b5d5c&&_0x3b5d5c[_0x9704('0x57')]===0x0){return db[_0x9704('0x58')][_0x9704('0x50')]({'name':_0x13505c[_0x9704('0x31')],'resourceId':_0x13505c['id'],'type':_0x3b5d5c[_0x9704('0x31')],'sectionId':_0x3b5d5c['id']},{})[_0x9704('0x2e')](function(){return _0x1fb8cc;});}else{return _0x1fb8cc;}})[_0x9704('0x4b')](function(_0x228779){logger[_0x9704('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x228779);throw _0x228779;});}return _0x1fb8cc;})[_0x9704('0x2e')](respondWithResult(_0x7a07a0,0xc9))[_0x9704('0x4b')](handleError(_0x7a07a0,null));};exports[_0x9704('0x2a')]=function(_0x1171f8,_0x559d39){if(_0x1171f8[_0x9704('0x51')]['id']){delete _0x1171f8['body']['id'];}return db['Pause'][_0x9704('0x4f')]({'where':{'id':_0x1171f8[_0x9704('0x4d')]['id']}})[_0x9704('0x2e')](handleEntityNotFound(_0x559d39,null))[_0x9704('0x2e')](saveUpdates(_0x1171f8[_0x9704('0x51')],null))[_0x9704('0x2e')](respondWithResult(_0x559d39,null))['catch'](handleError(_0x559d39,null));};exports[_0x9704('0x2b')]=function(_0x5f4fa2,_0x56be80){return db['Pause']['find']({'where':{'id':_0x5f4fa2[_0x9704('0x4d')]['id']}})[_0x9704('0x2e')](handleEntityNotFound(_0x56be80,null))[_0x9704('0x2e')](removeEntity(_0x56be80,null))[_0x9704('0x4b')](handleError(_0x56be80,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 62bfd3e..11e0300 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xa6df0f,_0x43b79f){var _0x22d8d8=function(_0x178e16){while(--_0x178e16){_0xa6df0f['push'](_0xa6df0f['shift']());}};_0x22d8d8(++_0x43b79f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x46a5b6,_0xdae092){_0x46a5b6=_0x46a5b6-0x0;var _0x5f5c9a=_0x1cb9[_0x46a5b6];return _0x5f5c9a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x307877,_0x54ff05){var _0x4bcc90=function(_0x2b86c6){while(--_0x2b86c6){_0x307877['push'](_0x307877['shift']());}};_0x4bcc90(++_0x54ff05);}(_0x814b,0x1a2));var _0xb814=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x814b[_0xb8cfbe];return _0x227d51;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c5c9093..2f428ff 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x27840a,_0xc317b8){var _0x4da9fa=function(_0x18a280){while(--_0x18a280){_0x27840a['push'](_0x27840a['shift']());}};_0x4da9fa(++_0xc317b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c0ee1,_0x3702ce){_0x3c0ee1=_0x3c0ee1-0x0;var _0x35d80f=_0xb10b[_0x3c0ee1];return _0x35d80f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x14b412,_0x18a129){var _0x1c1352=function(_0x24b680){while(--_0x24b680){_0x14b412['push'](_0x14b412['shift']());}};_0x1c1352(++_0x18a129);}(_0xb10b,0x12a));var _0xbb10=function(_0x1786e0,_0x19dc8c){_0x1786e0=_0x1786e0-0x0;var _0x4a6229=_0xb10b[_0x1786e0];return _0x4a6229;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 605f962..cc950c4 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 _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0xac9d,0x14d));var _0xdac9=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xac9d[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xac9d,0x14d));var _0xdac9=function(_0x2f965f,_0x100aca){_0x2f965f=_0x2f965f-0x0;var _0x73f2b9=_0xac9d[_0x2f965f];return _0x73f2b9;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 174db52..6128dff 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 _0x2dd9=['html','script','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM'];(function(_0x2ac9c4,_0x2edf32){var _0x5c2ea8=function(_0xd74c76){while(--_0xd74c76){_0x2ac9c4['push'](_0x2ac9c4['shift']());}};_0x5c2ea8(++_0x2edf32);}(_0x2dd9,0x177));var _0x92dd=function(_0x9d0ca3,_0x9cb1f3){_0x9d0ca3=_0x9d0ca3-0x0;var _0xa320ca=_0x2dd9[_0x9d0ca3];return _0xa320ca;};'use strict';var Sequelize=require(_0x92dd('0x0'));module[_0x92dd('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x92dd('0x2')](_0x92dd('0x3'),_0x92dd('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x92dd('0x5')],'comment':_0x92dd('0x6')},'active':{'type':Sequelize[_0x92dd('0x7')],'defaultValue':0x0,'comment':_0x92dd('0x8')},'sidebar':{'type':Sequelize[_0x92dd('0x2')](_0x92dd('0x9'),_0x92dd('0xa'),_0x92dd('0xb'),_0x92dd('0xc')),'defaultValue':_0x92dd('0xb'),'comment':_0x92dd('0xd')},'icon':{'type':Sequelize[_0x92dd('0x5')]},'adminUrl':{'type':Sequelize[_0x92dd('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x92dd('0x5')]}}; \ No newline at end of file +var _0x3aff=['TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','html'];(function(_0x4d8728,_0x541ab7){var _0x5d81aa=function(_0x586257){while(--_0x586257){_0x4d8728['push'](_0x4d8728['shift']());}};_0x5d81aa(++_0x541ab7);}(_0x3aff,0x148));var _0xf3af=function(_0x18b5c2,_0x1a7f3f){_0x18b5c2=_0x18b5c2-0x0;var _0x3ffdbd=_0x3aff[_0x18b5c2];return _0x3ffdbd;};'use strict';var Sequelize=require(_0xf3af('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xf3af('0x1'),'script')},'description':{'type':Sequelize[_0xf3af('0x2')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xf3af('0x3')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xf3af('0x4')],'defaultValue':0x0,'comment':_0xf3af('0x5')},'sidebar':{'type':Sequelize[_0xf3af('0x6')](_0xf3af('0x7'),_0xf3af('0x8'),'always',_0xf3af('0x9')),'defaultValue':'always','comment':_0xf3af('0xa')},'icon':{'type':Sequelize[_0xf3af('0x3')]},'adminUrl':{'type':Sequelize[_0xf3af('0x3')]},'agentUrl':{'type':Sequelize[_0xf3af('0x3')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf3af('0x3')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2c1edd4..3a2eccb 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 _0x326d=['resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','jsforce','querystring','papaparse','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','end','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','download','find','root','server/files/plugins','format','basename','path','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','join','dirname','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','delete'];(function(_0x23b825,_0x252bd8){var _0x2f111a=function(_0x166292){while(--_0x166292){_0x23b825['push'](_0x23b825['shift']());}};_0x2f111a(++_0x252bd8);}(_0x326d,0x1f2));var _0xd326=function(_0x2ea4ee,_0xce62a5){_0x2ea4ee=_0x2ea4ee-0x0;var _0x2d4b03=_0x326d[_0x2ea4ee];return _0x2d4b03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd326('0x0'));var zipdir=require(_0xd326('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd326('0x2'));var moment=require(_0xd326('0x3'));var BPromise=require(_0xd326('0x4'));var Mustache=require(_0xd326('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd326('0x6'));var ejs=require(_0xd326('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd326('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xd326('0x6'));var querystring=require(_0xd326('0x9'));var Papa=require(_0xd326('0xa'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xd326('0xb'));var Redis=require(_0xd326('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd326('0xd'));var as=require(_0xd326('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd326('0xf'))('api');var utils=require(_0xd326('0x10'));var config=require(_0xd326('0x11'));var licenseUtil=require(_0xd326('0x12'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd326('0x13')](config[_0xd326('0x14')],{'host':_0xd326('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd326('0x14')]));require('./plugin.socket')[_0xd326('0x16')](socket);function respondWithStatusCode(_0x4e9a9c,_0x2bd498){_0x2bd498=_0x2bd498||0xcc;return function(_0x40a876){if(_0x40a876){return _0x4e9a9c[_0xd326('0x17')](_0x2bd498);}return _0x4e9a9c[_0xd326('0x18')](_0x2bd498)['end']();};}function respondWithResult(_0x509388,_0x59ecfc){_0x59ecfc=_0x59ecfc||0xc8;return function(_0x313d41){if(_0x313d41){return _0x509388[_0xd326('0x18')](_0x59ecfc)['json'](_0x313d41);}};}function respondWithFilteredResult(_0x1be635,_0x1d2393){return function(_0x3fe37f){if(_0x3fe37f){var _0x56e4b8=typeof _0x1d2393[_0xd326('0x19')]==='undefined'&&typeof _0x1d2393[_0xd326('0x1a')]===_0xd326('0x1b');var _0x1be763=_0x3fe37f[_0xd326('0x1c')];var _0x1129ec=_0x56e4b8?0x0:_0x1d2393['offset'];var _0x5d40d5=_0x56e4b8?_0x3fe37f['count']:_0x1d2393[_0xd326('0x19')]+_0x1d2393[_0xd326('0x1a')];var _0x48e322;if(_0x5d40d5>=_0x1be763){_0x5d40d5=_0x1be763;_0x48e322=0xc8;}else{_0x48e322=0xce;}_0x1be635[_0xd326('0x18')](_0x48e322);return _0x1be635[_0xd326('0x1d')](_0xd326('0x1e'),_0x1129ec+'-'+_0x5d40d5+'/'+_0x1be763)[_0xd326('0x1f')](_0x3fe37f);}return null;};}function patchUpdates(_0x39bb2b){return function(_0x2a5b97){try{jsonpatch[_0xd326('0x20')](_0x2a5b97,_0x39bb2b,!![]);}catch(_0x2867ee){return BPromise[_0xd326('0x21')](_0x2867ee);}return _0x2a5b97[_0xd326('0x22')]();};}function saveUpdates(_0x43eb3e,_0x2ff5aa){return function(_0x2f1b53){if(_0x2f1b53){return _0x2f1b53[_0xd326('0x23')](_0x43eb3e)[_0xd326('0x24')](function(_0x25f6c0){return _0x25f6c0;});}return null;};}function removeEntity(_0x2ee910,_0x86ce56){return function(_0x4838d3){if(_0x4838d3){return _0x4838d3[_0xd326('0x25')]()['then'](function(){var _0x160709=_0x4838d3['get']({'plain':!![]});var _0x38e791=_0xd326('0x26');return db[_0xd326('0x27')][_0xd326('0x25')]({'where':{'type':_0x38e791,'resourceId':_0x160709['id']}})[_0xd326('0x24')](function(){return _0x4838d3;});})['then'](function(){_0x2ee910[_0xd326('0x18')](0xcc)[_0xd326('0x28')]();});}};}function handleEntityNotFound(_0x532439,_0x2b8d0d){return function(_0x3cd63e){if(!_0x3cd63e){_0x532439['sendStatus'](0x194);}return _0x3cd63e;};}function handleError(_0x1344f2,_0x92268){_0x92268=_0x92268||0x1f4;return function(_0x4212d8){logger[_0xd326('0x29')](_0x4212d8[_0xd326('0x2a')]);if(_0x4212d8[_0xd326('0x2b')]){delete _0x4212d8[_0xd326('0x2b')];}_0x1344f2['status'](_0x92268)['send'](_0x4212d8);};}exports[_0xd326('0x2c')]=function(_0x173e31,_0x109df7){var _0x122bcf={},_0x1a6562={},_0x57f11e={'count':0x0,'rows':[]};var _0x3001cc=_[_0xd326('0x2d')](db[_0xd326('0x2e')][_0xd326('0x2f')],function(_0x4676c8){return{'name':_0x4676c8[_0xd326('0x30')],'type':_0x4676c8[_0xd326('0x31')][_0xd326('0x32')]};});_0x1a6562[_0xd326('0x33')]=_['map'](_0x3001cc,_0xd326('0x2b'));_0x1a6562[_0xd326('0x34')]=_['keys'](_0x173e31['query']);_0x1a6562['filters']=_[_0xd326('0x35')](_0x1a6562['model'],_0x1a6562[_0xd326('0x34')]);_0x122bcf[_0xd326('0x36')]=_['intersection'](_0x1a6562[_0xd326('0x33')],qs['fields'](_0x173e31[_0xd326('0x34')][_0xd326('0x37')]));_0x122bcf[_0xd326('0x36')]=_0x122bcf[_0xd326('0x36')][_0xd326('0x38')]?_0x122bcf[_0xd326('0x36')]:_0x1a6562[_0xd326('0x33')];if(!_0x173e31['query'][_0xd326('0x39')](_0xd326('0x3a'))){_0x122bcf[_0xd326('0x1a')]=qs[_0xd326('0x1a')](_0x173e31[_0xd326('0x34')][_0xd326('0x1a')]);_0x122bcf[_0xd326('0x19')]=qs[_0xd326('0x19')](_0x173e31[_0xd326('0x34')][_0xd326('0x19')]);}_0x122bcf[_0xd326('0x3b')]=qs[_0xd326('0x3c')](_0x173e31[_0xd326('0x34')][_0xd326('0x3c')]);_0x122bcf['where']=qs[_0xd326('0x3d')](_[_0xd326('0x3e')](_0x173e31['query'],_0x1a6562['filters']),_0x3001cc);if(_0x173e31[_0xd326('0x34')][_0xd326('0x3f')]){_0x122bcf[_0xd326('0x40')]=_[_0xd326('0x41')](_0x122bcf[_0xd326('0x40')],{'$or':_[_0xd326('0x2d')](_0x3001cc,function(_0x301dac){if(_0x301dac[_0xd326('0x31')]!=='VIRTUAL'){var _0x37fe1b={};_0x37fe1b[_0x301dac[_0xd326('0x2b')]]={'$like':'%'+_0x173e31[_0xd326('0x34')][_0xd326('0x3f')]+'%'};return _0x37fe1b;}})});}_0x122bcf=_['merge']({},_0x122bcf,_0x173e31[_0xd326('0x42')]);var _0x524482={'where':_0x122bcf[_0xd326('0x40')]};return db[_0xd326('0x2e')][_0xd326('0x1c')](_0x524482)[_0xd326('0x24')](function(_0x15dc7f){_0x57f11e[_0xd326('0x1c')]=_0x15dc7f;if(_0x173e31['query'][_0xd326('0x43')]){_0x122bcf[_0xd326('0x44')]=[{'all':!![]}];}return db[_0xd326('0x2e')][_0xd326('0x45')](_0x122bcf);})[_0xd326('0x24')](function(_0x3facb1){_0x57f11e[_0xd326('0x46')]=_0x3facb1;return _0x57f11e;})['then'](respondWithFilteredResult(_0x109df7,_0x122bcf))[_0xd326('0x47')](handleError(_0x109df7,null));};exports[_0xd326('0x48')]=function(_0x354ac1,_0x5ddfca){var _0x28a465={'raw':!![],'where':{'id':_0x354ac1[_0xd326('0x49')]['id']}},_0x4fa0ec={};_0x4fa0ec[_0xd326('0x33')]=_[_0xd326('0x4a')](db[_0xd326('0x2e')][_0xd326('0x2f')]);_0x4fa0ec['query']=_[_0xd326('0x4a')](_0x354ac1['query']);_0x4fa0ec[_0xd326('0x3d')]=_[_0xd326('0x35')](_0x4fa0ec[_0xd326('0x33')],_0x4fa0ec[_0xd326('0x34')]);_0x28a465[_0xd326('0x36')]=_[_0xd326('0x35')](_0x4fa0ec[_0xd326('0x33')],qs[_0xd326('0x37')](_0x354ac1[_0xd326('0x34')][_0xd326('0x37')]));_0x28a465[_0xd326('0x36')]=_0x28a465[_0xd326('0x36')][_0xd326('0x38')]?_0x28a465[_0xd326('0x36')]:_0x4fa0ec['model'];if(_0x354ac1[_0xd326('0x34')][_0xd326('0x43')]){_0x28a465['include']=[{'all':!![]}];}_0x28a465=_[_0xd326('0x41')]({},_0x28a465,_0x354ac1[_0xd326('0x42')]);return db[_0xd326('0x2e')]['find'](_0x28a465)[_0xd326('0x24')](handleEntityNotFound(_0x5ddfca,null))[_0xd326('0x24')](respondWithResult(_0x5ddfca,null))['catch'](handleError(_0x5ddfca,null));};exports[_0xd326('0x4b')]=function(_0x30cb4b,_0x4296a6,_0x4c361b){return db['Plugin'][_0xd326('0x4c')]({'where':{'id':_0x30cb4b[_0xd326('0x49')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0x4296a6,null))[_0xd326('0x24')](function(_0x4fbc27){if(_0x4fbc27){var _0x487c8b=path['join'](config[_0xd326('0x4d')],_0xd326('0x4e'),util[_0xd326('0x4f')]('%s.zip',path[_0xd326('0x50')](_0x4fbc27[_0xd326('0x51')])));var _0x16d137=fs['createWriteStream'](_0x487c8b);var _0x7e5bc0=archiver('zip',{'zlib':{'level':0x9}});_0x7e5bc0['on']('warning',function(_0x39781d){if(_0x39781d['code']===_0xd326('0x52')){logger[_0xd326('0x29')](_0x39781d);}else{throw new db[(_0xd326('0x53'))][(_0xd326('0x54'))](_0xd326('0x55'));}});_0x7e5bc0['on'](_0xd326('0x29'),function(_0x540e34){throw new db['Sequelize']['Error'](_0xd326('0x55'));});_0x7e5bc0['pipe'](_0x16d137);_0x7e5bc0[_0xd326('0x56')]('**/*',{'cwd':path[_0xd326('0x57')](config[_0xd326('0x4d')],_0xd326('0x4e'),path[_0xd326('0x58')](_0x4fbc27['path'])),'ignore':[path[_0xd326('0x57')](path[_0xd326('0x50')](_0x4fbc27['path']),_0xd326('0x59')),path[_0xd326('0x57')](path[_0xd326('0x50')](_0x4fbc27[_0xd326('0x51')]),'attachments/**/*')],'nodir':!![]})[_0xd326('0x5a')]();_0x16d137['on']('close',function(){if(!fs[_0xd326('0x5b')](_0x487c8b)){throw new db[(_0xd326('0x53'))][(_0xd326('0x54'))](_0xd326('0x5c'));}return _0x4296a6['download'](_0x487c8b,util[_0xd326('0x4f')](_0xd326('0x5d'),path[_0xd326('0x50')](_0x4fbc27[_0xd326('0x51')])),function(_0x58a17d){if(_0x58a17d){throw new db['Sequelize']['Error'](_0xd326('0x5e'));}fs['unlinkSync'](_0x487c8b);logger[_0xd326('0x5f')](_0xd326('0x60'));logger[_0xd326('0x5f')](_0xd326('0x61'));});});}return null;})['catch'](handleError(_0x4296a6,null));};exports[_0xd326('0x62')]=function(_0x5a80cd,_0x59cf45,_0x50748f){var _0x1fcc01=path['basename'](_0x5a80cd[_0xd326('0x63')]['filename'],path['extname'](_0x5a80cd['file'][_0xd326('0x64')]));var _0x2df3b9=path[_0xd326('0x57')](config[_0xd326('0x4d')],_0xd326('0x4e'),_0x5a80cd[_0xd326('0x63')][_0xd326('0x64')]);var _0x22adbd=path[_0xd326('0x57')](config[_0xd326('0x4d')],_0xd326('0x4e'),_0x1fcc01);logger['info'](_0xd326('0x65'),_0x2df3b9);logger[_0xd326('0x5f')](_0xd326('0x66'),_0x22adbd);try{fs['chmodSync'](_0x2df3b9,parseInt(_0xd326('0x67'),0x8));extract(_0x2df3b9,{'dir':_0x22adbd},function(_0x399b06){if(_0x399b06){logger['error'](_0x399b06);handleError(_0x399b06,!![]);};var _0x5115be=fs[_0xd326('0x68')](_0x22adbd);if(_0x5115be[_0xd326('0x38')]>0x1){removeReferences(_0x2df3b9,_0x22adbd);logger[_0xd326('0x29')](_0xd326('0x69'));return _0x50748f(new Error(_0xd326('0x69')));}var _0x42a9d7=fs[_0xd326('0x6a')](path[_0xd326('0x57')](_0x22adbd,_0x5115be[0x0]));if(_0x42a9d7[_0xd326('0x6b')]()){removeReferences(_0x2df3b9,_0x22adbd);logger[_0xd326('0x29')](_0xd326('0x69'));return _0x50748f(new Error('Invalid\x20plugin\x20structure'));}if(_0x42a9d7['isDirectory']()){var _0x133bb4=fs['readdirSync'](path[_0xd326('0x57')](_0x22adbd,_0x5115be[0x0]));if(_0x133bb4[_0xd326('0x38')]===0x0){removeReferences(_0x2df3b9,_0x22adbd);logger[_0xd326('0x29')](_0xd326('0x69'));return _0x50748f(new Error(_0xd326('0x69')));}var _0x57726f=_0x133bb4['some'](function(_0x223013){return _0x223013===_0xd326('0x6c');});if(!_0x57726f){return _0x50748f(new Error('Plugin\x20manifest\x20missing'));}var _0x1ff81a=fs[_0xd326('0x6d')](path[_0xd326('0x57')](_0x22adbd,_0x5115be[0x0],_0xd326('0x6c')));var _0x346aff=JSON[_0xd326('0x6e')](_0x1ff81a);if('undefined'==typeof _0x346aff['name']){return _0x50748f(new Error(_0xd326('0x6f')));}if(_0xd326('0x1b')==typeof _0x346aff[_0xd326('0x31')]){return _0x50748f(new Error(_0xd326('0x70')));}if(_0xd326('0x1b')==typeof _0x346aff['version']){return _0x50748f(new Error(_0xd326('0x71')));}if('undefined'==typeof _0x346aff['parameters']){return _0x50748f(new Error(_0xd326('0x72')));}if(_0x346aff[_0xd326('0x31')]===_0xd326('0x73')){if('undefined'==typeof _0x346aff[_0xd326('0x74')][_0xd326('0x75')]){return _0x50748f(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xd326('0x1b')==typeof _0x346aff[_0xd326('0x74')]['views'][_0xd326('0x76')]&&_0xd326('0x1b')==typeof _0x346aff[_0xd326('0x74')][_0xd326('0x75')]['agent']){return _0x50748f(new Error(_0xd326('0x77')));}}else if(_0x346aff[_0xd326('0x31')]===_0xd326('0x78')){if('undefined'==typeof _0x346aff[_0xd326('0x74')]['scriptName']){return _0x50748f(new Error(_0xd326('0x79')));}if(_0xd326('0x1b')==typeof _0x346aff[_0xd326('0x74')][_0xd326('0x7a')]){return _0x50748f(new Error(_0xd326('0x7b')));}}else{return _0x50748f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x12bdc1=_0x346aff[_0xd326('0x2b')];var _0x40456f=_0x346aff['description'];var _0x114619=_0x346aff['type'];var _0x4f7c26=_0x346aff['sidebar']?_0x346aff[_0xd326('0x7c')]:_0xd326('0x7d');var _0x5ee169=_0x346aff[_0xd326('0x7e')]?_0x346aff[_0xd326('0x7e')]:_0xd326('0x7f');var _0x874d1e='';var _0x44fe35='';var _0x4683a4='';var _0x3c4c5a='';var _0x72d4ea=_0x346aff['version'];if(_0x114619===_0xd326('0x73')){if(_0xd326('0x1b')!=typeof _0x346aff[_0xd326('0x74')]['views']['admin']){var _0x5acd11=_0x346aff[_0xd326('0x74')][_0xd326('0x75')][_0xd326('0x76')];if(!/^(f|ht)tps?:\/\//i[_0xd326('0x80')](_0x5acd11)){_0x874d1e=path['join'](_0xd326('0x81'),_0x1fcc01,_0x5115be[0x0],_0x5acd11);}else{_0x874d1e=_0x5acd11;}}else{logger[_0xd326('0x5f')](_0xd326('0x82'));}if(_0xd326('0x1b')!=typeof _0x346aff[_0xd326('0x74')][_0xd326('0x75')][_0xd326('0x83')]){var _0x14f491=_0x346aff[_0xd326('0x74')]['views'][_0xd326('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd326('0x80')](_0x14f491)){_0x44fe35=path['join'](_0xd326('0x81'),_0x1fcc01,_0x5115be[0x0],_0x14f491);}else{_0x44fe35=_0x14f491;}}else{logger[_0xd326('0x5f')](_0xd326('0x84'));}}else if(_0x114619===_0xd326('0x78')){_0x4683a4=_0x346aff[_0xd326('0x74')][_0xd326('0x85')];_0x3c4c5a=_0x346aff['parameters'][_0xd326('0x7a')];if('undefined'!=typeof _0x346aff['parameters'][_0xd326('0x75')]){if(_0xd326('0x1b')!=typeof _0x346aff[_0xd326('0x74')][_0xd326('0x75')]['admin']){var _0x5acd11=_0x346aff['parameters'][_0xd326('0x75')][_0xd326('0x76')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5acd11)){_0x874d1e=path[_0xd326('0x57')](_0xd326('0x81'),_0x1fcc01,_0x5115be[0x0],_0x5acd11);}else{_0x874d1e=_0x5acd11;}}if(_0xd326('0x1b')!=typeof _0x346aff[_0xd326('0x74')]['views'][_0xd326('0x83')]){var _0x14f491=_0x346aff[_0xd326('0x74')][_0xd326('0x75')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd326('0x80')](_0x14f491)){_0x44fe35=path[_0xd326('0x57')]('plugins',_0x1fcc01,_0x5115be[0x0],_0x14f491);}else{_0x44fe35=_0x14f491;}}}}var _0xaafbbb={'name':_0x12bdc1,'description':_0x40456f,'path':path[_0xd326('0x57')](_0x1fcc01,_0x5115be[0x0]),'type':_0x114619,'sidebar':_0x4f7c26,'icon':_0x5ee169,'adminUrl':_0x874d1e,'agentUrl':_0x44fe35,'scriptName':_0x4683a4,'scriptPath':_0x3c4c5a,'version':_0x72d4ea};removeReferences(_0x2df3b9,null);return db[_0xd326('0x2e')]['create'](_0xaafbbb)[_0xd326('0x24')](function(_0x44ee6f){var _0x4b6a4d={'role':_0x5a80cd['body'][_0xd326('0x86')],'userProfileId':_0x5a80cd[_0xd326('0x87')][_0xd326('0x88')]};if(!_0x4b6a4d)throw new Error(_0xd326('0x89'));if(_0x4b6a4d[_0xd326('0x86')]===_0xd326('0x8a')){var _0x23b88e=_0x44ee6f[_0xd326('0x8b')]({'plain':!![]});return db[_0xd326('0x8c')][_0xd326('0x4c')]({'where':{'name':'Plugins','userProfileId':_0x4b6a4d[_0xd326('0x88')]},'raw':!![]})['then'](function(_0x1359f0){if(_0x1359f0&&_0x1359f0[_0xd326('0x8d')]===0x0){return db[_0xd326('0x27')]['create']({'name':_0x23b88e['name'],'resourceId':_0x23b88e['id'],'type':_0x1359f0['name'],'sectionId':_0x1359f0['id']},{})[_0xd326('0x24')](function(){return _0x44ee6f;});}else{return _0x44ee6f;}})['catch'](function(_0x36878e){logger[_0xd326('0x29')](_0xd326('0x8e'),_0x36878e);throw _0x36878e;});}return _0x44ee6f;})['then'](respondWithResult(_0x59cf45,null))[_0xd326('0x47')](handleError(_0x59cf45,null));}});}catch(_0x21d5c8){_0x59cf45[_0xd326('0x18')](0x1f4)['send'](_0x21d5c8);}};function removeReferences(_0x5952c5,_0x4ec7d8){try{if(_0x5952c5){fs[_0xd326('0x8f')](_0x5952c5);logger[_0xd326('0x5f')]('Zip\x20archive\x20removed');}if(_0x4ec7d8){rimraf(_0x4ec7d8,function(){});logger[_0xd326('0x5f')](_0xd326('0x90'));}}catch(_0x23d538){logger[_0xd326('0x29')](_0x23d538);}}exports['update']=function(_0x1fb35b,_0x451cd6,_0x448520){return db[_0xd326('0x2e')]['find']({'where':{'id':_0x1fb35b[_0xd326('0x49')]['id']}})[_0xd326('0x24')](handleEntityNotFound(_0x451cd6,null))['then'](saveUpdates(_0x1fb35b[_0xd326('0x87')],null))['then'](respondWithResult(_0x451cd6,null))['catch'](handleError(_0x451cd6,null));};exports[_0xd326('0x91')]=function(_0x390913,_0x2f85c8,_0x34580f){return db['Plugin']['find']({'where':{'id':_0x390913[_0xd326('0x49')]['id']}})[_0xd326('0x24')](function(_0x4deb2a){if(_0x4deb2a){return _0x4deb2a[_0xd326('0x25')]();}})[_0xd326('0x24')](function(_0x1fa39c){rimraf(path[_0xd326('0x57')](config[_0xd326('0x4d')],_0xd326('0x4e'),path[_0xd326('0x58')](_0x1fa39c[_0xd326('0x51')])),function(){});return _0x1fa39c;})['then'](handleEntityNotFound(_0x2f85c8,null))[_0xd326('0x24')](respondWithStatusCode(_0x2f85c8,null))['catch'](handleError(_0x2f85c8,null));};exports['webhookGet']=function(_0x5a59a4,_0x1e16e3,_0xde9b7e){return BPromise[_0xd326('0x92')]()[_0xd326('0x24')](function(){if(!_0x5a59a4[_0xd326('0x34')][_0xd326('0x51')]){throw new Error(_0xd326('0x93'));}if(!_0x5a59a4[_0xd326('0x34')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1a07cf=_0x5a59a4[_0xd326('0x34')][_0xd326('0x94')]?_0x5a59a4[_0xd326('0x34')][_0xd326('0x94')]+':'+_0x5a59a4[_0xd326('0x34')][_0xd326('0x95')]:_0xd326('0x96')+_0x5a59a4[_0xd326('0x34')]['port'];var _0x2cffb6=_0x5a59a4[_0xd326('0x34')]['json']?_0x5a59a4[_0xd326('0x34')][_0xd326('0x1f')]:!![];var _0x4749f8=_0x5a59a4['query'][_0xd326('0x97')]?_0x5a59a4[_0xd326('0x34')]['encoding']:null;var _0x5c531e={'method':_0x5a59a4[_0xd326('0x98')],'uri':util['format'](_0xd326('0x99'),_0x1a07cf,_0x5a59a4[_0xd326('0x34')]['path']),'json':_0x2cffb6,'resolveWithFullResponse':!![],'encoding':_0x4749f8,'qs':_0x5a59a4['query']};if(_0x5a59a4[_0xd326('0x9a')]){_0x5c531e['headers']=_0x5a59a4['headers'];if(_0x5c531e[_0xd326('0x9a')][_0xd326('0x9b')]){delete _0x5c531e[_0xd326('0x9a')]['content-length'];}}if(_0x5c531e[_0xd326('0x9a')][_0xd326('0x9c')]){delete _0x5c531e[_0xd326('0x9a')][_0xd326('0x9c')];}return rp(_0x5c531e);})[_0xd326('0x24')](function(_0x491a00){if(_0x491a00){_0x1e16e3[_0xd326('0x1d')](_0x491a00[_0xd326('0x9a')]);logger[_0xd326('0x5f')](_0x491a00['body']);if(_[_0xd326('0x9d')](_0x5a59a4[_0xd326('0x34')]['path'],_0xd326('0x4b'))&&_0x491a00[_0xd326('0x9e')]==0x1f4){return _0x1e16e3[_0xd326('0x17')](_0x491a00['statusCode']);}else{return _0x1e16e3[_0xd326('0x18')](_0x491a00['statusCode'])['send'](_0x491a00['body']);}}else{return _0x1e16e3[_0xd326('0x17')](0xc8);}})[_0xd326('0x47')](handleError(_0x1e16e3,null));};exports[_0xd326('0x9f')]=function(_0x34514d,_0x144426,_0x181eeb){return BPromise[_0xd326('0x92')]()[_0xd326('0x24')](function(){if(!_0x34514d[_0xd326('0x34')]['path']){throw new Error(_0xd326('0x93'));}if(!_0x34514d[_0xd326('0x34')][_0xd326('0x95')]){throw new Error(_0xd326('0xa0'));}var _0x1e7018=_0x34514d['query']['hostname']?_0x34514d[_0xd326('0x34')][_0xd326('0x94')]+':'+_0x34514d['query']['port']:_0xd326('0x96')+_0x34514d[_0xd326('0x34')]['port'];var _0xb10dc3=_0x34514d[_0xd326('0x34')][_0xd326('0x1f')]?_0x34514d[_0xd326('0x34')][_0xd326('0x1f')]:!![];var _0x142a6d=_0x34514d[_0xd326('0x34')][_0xd326('0x97')]?_0x34514d[_0xd326('0x34')][_0xd326('0x97')]:null;var _0x349056={'method':_0x34514d[_0xd326('0x98')],'uri':util['format']('%s%s',_0x1e7018,_0x34514d[_0xd326('0x34')][_0xd326('0x51')]),'json':_0xb10dc3,'resolveWithFullResponse':!![],'encoding':_0x142a6d,'body':_0x34514d[_0xd326('0x87')]};if(_0x34514d['headers']){_0x349056[_0xd326('0x9a')]=_0x34514d[_0xd326('0x9a')];if(_0x349056[_0xd326('0x9a')][_0xd326('0x9b')]){delete _0x349056[_0xd326('0x9a')]['content-length'];}}if(_0x349056[_0xd326('0x9a')][_0xd326('0x9c')]){delete _0x349056[_0xd326('0x9a')][_0xd326('0x9c')];}return rp(_0x349056);})[_0xd326('0x24')](function(_0x1404f7){if(_0x1404f7){_0x144426[_0xd326('0x1d')](_0x1404f7[_0xd326('0x9a')]);logger[_0xd326('0x5f')](_0x1404f7[_0xd326('0x87')]);return _0x144426[_0xd326('0x18')](_0x1404f7[_0xd326('0x9e')])['send'](_0x1404f7[_0xd326('0x87')]);}else{return _0x144426['sendStatus'](0xc8);}})['catch'](handleError(_0x144426,null));}; \ No newline at end of file +var _0x678f=['Invalid\x20plugin\x20structure','isFile','isDirectory','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','type','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','method','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','Plugins','end','error','name','send','index','map','Plugin','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','model','keys','includeAll','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','ENOENT','Sequelize','Error','pipe','glob','dirname','node_modules/**/*','attachments/**/*','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync'];(function(_0x27862e,_0xb096be){var _0x413eed=function(_0x1b884e){while(--_0x1b884e){_0x27862e['push'](_0x27862e['shift']());}};_0x413eed(++_0xb096be);}(_0x678f,0x181));var _0xf678=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x678f[_0x33c1b1];return _0x2c2037;};'use strict';var emlformat=require(_0xf678('0x0'));var rimraf=require(_0xf678('0x1'));var zipdir=require(_0xf678('0x2'));var jsonpatch=require(_0xf678('0x3'));var rp=require('request-promise');var moment=require(_0xf678('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf678('0x5'));var util=require(_0xf678('0x6'));var path=require('path');var sox=require(_0xf678('0x7'));var csv=require(_0xf678('0x8'));var ejs=require(_0xf678('0x9'));var fs=require('fs');var fs_extra=require(_0xf678('0xa'));var _=require(_0xf678('0xb'));var squel=require('squel');var crypto=require(_0xf678('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf678('0xd'));var toCsv=require(_0xf678('0x8'));var querystring=require(_0xf678('0xe'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xf678('0x1'));var archiver=require('archiver');var Redis=require(_0xf678('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf678('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf678('0x11'));var logger=require(_0xf678('0x12'))(_0xf678('0x13'));var utils=require(_0xf678('0x14'));var config=require(_0xf678('0x15'));var licenseUtil=require(_0xf678('0x16'));var db=require(_0xf678('0x17'))['db'];config[_0xf678('0x18')]=_[_0xf678('0x19')](config[_0xf678('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf678('0x1a'))(new Redis(config[_0xf678('0x18')]));require(_0xf678('0x1b'))['register'](socket);function respondWithStatusCode(_0x5a553e,_0x3350f7){_0x3350f7=_0x3350f7||0xcc;return function(_0x58da78){if(_0x58da78){return _0x5a553e[_0xf678('0x1c')](_0x3350f7);}return _0x5a553e[_0xf678('0x1d')](_0x3350f7)['end']();};}function respondWithResult(_0x3801be,_0x8b0f64){_0x8b0f64=_0x8b0f64||0xc8;return function(_0x61652d){if(_0x61652d){return _0x3801be[_0xf678('0x1d')](_0x8b0f64)[_0xf678('0x1e')](_0x61652d);}};}function respondWithFilteredResult(_0x27ece7,_0x198308){return function(_0x520f4b){if(_0x520f4b){var _0x5f1195=typeof _0x198308[_0xf678('0x1f')]==='undefined'&&typeof _0x198308[_0xf678('0x20')]===_0xf678('0x21');var _0x15d540=_0x520f4b[_0xf678('0x22')];var _0x3c655d=_0x5f1195?0x0:_0x198308[_0xf678('0x1f')];var _0x51d249=_0x5f1195?_0x520f4b[_0xf678('0x22')]:_0x198308[_0xf678('0x1f')]+_0x198308['limit'];var _0x57dc9c;if(_0x51d249>=_0x15d540){_0x51d249=_0x15d540;_0x57dc9c=0xc8;}else{_0x57dc9c=0xce;}_0x27ece7[_0xf678('0x1d')](_0x57dc9c);return _0x27ece7[_0xf678('0x23')](_0xf678('0x24'),_0x3c655d+'-'+_0x51d249+'/'+_0x15d540)[_0xf678('0x1e')](_0x520f4b);}return null;};}function patchUpdates(_0x32880f){return function(_0x3464a6){try{jsonpatch['apply'](_0x3464a6,_0x32880f,!![]);}catch(_0x5d66e1){return BPromise['reject'](_0x5d66e1);}return _0x3464a6[_0xf678('0x25')]();};}function saveUpdates(_0x58fbd2,_0x5c1330){return function(_0x77a13f){if(_0x77a13f){return _0x77a13f['update'](_0x58fbd2)[_0xf678('0x26')](function(_0x35c072){return _0x35c072;});}return null;};}function removeEntity(_0x56f569,_0x5e6892){return function(_0x2b6e2d){if(_0x2b6e2d){return _0x2b6e2d[_0xf678('0x27')]()['then'](function(){var _0x5f264a=_0x2b6e2d['get']({'plain':!![]});var _0x2abc13=_0xf678('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2abc13,'resourceId':_0x5f264a['id']}})[_0xf678('0x26')](function(){return _0x2b6e2d;});})['then'](function(){_0x56f569[_0xf678('0x1d')](0xcc)[_0xf678('0x29')]();});}};}function handleEntityNotFound(_0x5738ea,_0x223174){return function(_0x510dd1){if(!_0x510dd1){_0x5738ea['sendStatus'](0x194);}return _0x510dd1;};}function handleError(_0x252a50,_0x5c0cb1){_0x5c0cb1=_0x5c0cb1||0x1f4;return function(_0x3ac800){logger[_0xf678('0x2a')](_0x3ac800['stack']);if(_0x3ac800['name']){delete _0x3ac800[_0xf678('0x2b')];}_0x252a50[_0xf678('0x1d')](_0x5c0cb1)[_0xf678('0x2c')](_0x3ac800);};}exports[_0xf678('0x2d')]=function(_0x1a2f1d,_0x240ce6){var _0x598458={},_0x2b4928={},_0x39d22e={'count':0x0,'rows':[]};var _0x16127f=_[_0xf678('0x2e')](db[_0xf678('0x2f')][_0xf678('0x30')],function(_0x5876a9){return{'name':_0x5876a9['fieldName'],'type':_0x5876a9['type'][_0xf678('0x31')]};});_0x2b4928['model']=_[_0xf678('0x2e')](_0x16127f,'name');_0x2b4928[_0xf678('0x32')]=_['keys'](_0x1a2f1d[_0xf678('0x32')]);_0x2b4928[_0xf678('0x33')]=_['intersection'](_0x2b4928['model'],_0x2b4928[_0xf678('0x32')]);_0x598458[_0xf678('0x34')]=_[_0xf678('0x35')](_0x2b4928['model'],qs[_0xf678('0x36')](_0x1a2f1d[_0xf678('0x32')][_0xf678('0x36')]));_0x598458['attributes']=_0x598458[_0xf678('0x34')][_0xf678('0x37')]?_0x598458['attributes']:_0x2b4928['model'];if(!_0x1a2f1d['query'][_0xf678('0x38')](_0xf678('0x39'))){_0x598458[_0xf678('0x20')]=qs[_0xf678('0x20')](_0x1a2f1d[_0xf678('0x32')]['limit']);_0x598458['offset']=qs[_0xf678('0x1f')](_0x1a2f1d['query']['offset']);}_0x598458[_0xf678('0x3a')]=qs['sort'](_0x1a2f1d[_0xf678('0x32')]['sort']);_0x598458[_0xf678('0x3b')]=qs[_0xf678('0x33')](_[_0xf678('0x3c')](_0x1a2f1d[_0xf678('0x32')],_0x2b4928['filters']),_0x16127f);if(_0x1a2f1d[_0xf678('0x32')][_0xf678('0x3d')]){_0x598458[_0xf678('0x3b')]=_[_0xf678('0x3e')](_0x598458[_0xf678('0x3b')],{'$or':_[_0xf678('0x2e')](_0x16127f,function(_0x12b7be){if(_0x12b7be['type']!=='VIRTUAL'){var _0x5a32ec={};_0x5a32ec[_0x12b7be[_0xf678('0x2b')]]={'$like':'%'+_0x1a2f1d['query']['filter']+'%'};return _0x5a32ec;}})});}_0x598458=_[_0xf678('0x3e')]({},_0x598458,_0x1a2f1d[_0xf678('0x3f')]);var _0x31957c={'where':_0x598458[_0xf678('0x3b')]};return db[_0xf678('0x2f')][_0xf678('0x22')](_0x31957c)[_0xf678('0x26')](function(_0x4cc6d5){_0x39d22e['count']=_0x4cc6d5;if(_0x1a2f1d[_0xf678('0x32')]['includeAll']){_0x598458[_0xf678('0x40')]=[{'all':!![]}];}return db[_0xf678('0x2f')][_0xf678('0x41')](_0x598458);})[_0xf678('0x26')](function(_0x506e33){_0x39d22e[_0xf678('0x42')]=_0x506e33;return _0x39d22e;})[_0xf678('0x26')](respondWithFilteredResult(_0x240ce6,_0x598458))[_0xf678('0x43')](handleError(_0x240ce6,null));};exports[_0xf678('0x44')]=function(_0x4edf7b,_0xcb17e8){var _0x343747={'raw':!![],'where':{'id':_0x4edf7b[_0xf678('0x45')]['id']}},_0x4ddc23={};_0x4ddc23[_0xf678('0x46')]=_[_0xf678('0x47')](db[_0xf678('0x2f')]['rawAttributes']);_0x4ddc23[_0xf678('0x32')]=_['keys'](_0x4edf7b[_0xf678('0x32')]);_0x4ddc23[_0xf678('0x33')]=_[_0xf678('0x35')](_0x4ddc23[_0xf678('0x46')],_0x4ddc23[_0xf678('0x32')]);_0x343747[_0xf678('0x34')]=_[_0xf678('0x35')](_0x4ddc23['model'],qs[_0xf678('0x36')](_0x4edf7b[_0xf678('0x32')]['fields']));_0x343747[_0xf678('0x34')]=_0x343747['attributes'][_0xf678('0x37')]?_0x343747[_0xf678('0x34')]:_0x4ddc23[_0xf678('0x46')];if(_0x4edf7b[_0xf678('0x32')][_0xf678('0x48')]){_0x343747['include']=[{'all':!![]}];}_0x343747=_[_0xf678('0x3e')]({},_0x343747,_0x4edf7b[_0xf678('0x3f')]);return db[_0xf678('0x2f')][_0xf678('0x49')](_0x343747)[_0xf678('0x26')](handleEntityNotFound(_0xcb17e8,null))['then'](respondWithResult(_0xcb17e8,null))[_0xf678('0x43')](handleError(_0xcb17e8,null));};exports[_0xf678('0x4a')]=function(_0x2878f7,_0x561d43,_0x52e1e3){return db[_0xf678('0x2f')]['find']({'where':{'id':_0x2878f7[_0xf678('0x45')]['id']},'attributes':[_0xf678('0x2b'),_0xf678('0x4b')],'raw':!![]})[_0xf678('0x26')](handleEntityNotFound(_0x561d43,null))[_0xf678('0x26')](function(_0x49c4ff){if(_0x49c4ff){var _0x119947=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),util[_0xf678('0x4f')](_0xf678('0x50'),path[_0xf678('0x51')](_0x49c4ff[_0xf678('0x4b')])));var _0x129cb1=fs['createWriteStream'](_0x119947);var _0x58b597=archiver(_0xf678('0x52'),{'zlib':{'level':0x9}});_0x58b597['on'](_0xf678('0x53'),function(_0x48fd9a){if(_0x48fd9a['code']===_0xf678('0x54')){logger['error'](_0x48fd9a);}else{throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x58b597['on']('error',function(_0x2aba65){throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x58b597[_0xf678('0x57')](_0x129cb1);_0x58b597[_0xf678('0x58')]('**/*',{'cwd':path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),path[_0xf678('0x59')](_0x49c4ff[_0xf678('0x4b')])),'ignore':[path[_0xf678('0x4c')](path['basename'](_0x49c4ff[_0xf678('0x4b')]),_0xf678('0x5a')),path[_0xf678('0x4c')](path['basename'](_0x49c4ff[_0xf678('0x4b')]),_0xf678('0x5b'))],'nodir':!![]})['finalize']();_0x129cb1['on']('close',function(){if(!fs['existsSync'](_0x119947)){throw new db['Sequelize'][(_0xf678('0x56'))]('Plugin\x20not\x20found');}return _0x561d43[_0xf678('0x4a')](_0x119947,util['format'](_0xf678('0x50'),path['basename'](_0x49c4ff[_0xf678('0x4b')])),function(_0x3fbfbf){if(_0x3fbfbf){throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))](_0xf678('0x5c'));}fs['unlinkSync'](_0x119947);logger[_0xf678('0x5d')](_0xf678('0x5e'));logger['info'](_0xf678('0x5f'));});});}return null;})[_0xf678('0x43')](handleError(_0x561d43,null));};exports[_0xf678('0x60')]=function(_0x557efc,_0x57d8db,_0x2f940a){var _0x4a0c89=path['basename'](_0x557efc[_0xf678('0x61')][_0xf678('0x62')],path[_0xf678('0x63')](_0x557efc[_0xf678('0x61')][_0xf678('0x62')]));var _0x41d4c7=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),_0x557efc[_0xf678('0x61')][_0xf678('0x62')]);var _0x441c58=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),_0x4a0c89);logger['info'](_0xf678('0x64'),_0x41d4c7);logger[_0xf678('0x5d')]('Plugin\x20upload\x20destination:\x20%s',_0x441c58);try{fs[_0xf678('0x65')](_0x41d4c7,parseInt(_0xf678('0x66'),0x8));extract(_0x41d4c7,{'dir':_0x441c58},function(_0x534d5d){if(_0x534d5d){logger['error'](_0x534d5d);handleError(_0x534d5d,!![]);};var _0x16162c=fs[_0xf678('0x67')](_0x441c58);if(_0x16162c['length']>0x1){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error(_0xf678('0x68')));}var _0x34bfdc=fs['lstatSync'](path['join'](_0x441c58,_0x16162c[0x0]));if(_0x34bfdc[_0xf678('0x69')]()){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error('Invalid\x20plugin\x20structure'));}if(_0x34bfdc[_0xf678('0x6a')]()){var _0x1fa2cb=fs[_0xf678('0x67')](path[_0xf678('0x4c')](_0x441c58,_0x16162c[0x0]));if(_0x1fa2cb[_0xf678('0x37')]===0x0){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error(_0xf678('0x68')));}var _0x34763c=_0x1fa2cb['some'](function(_0xb09bab){return _0xb09bab==='manifest.json';});if(!_0x34763c){return _0x2f940a(new Error('Plugin\x20manifest\x20missing'));}var _0x4699ec=fs[_0xf678('0x6b')](path[_0xf678('0x4c')](_0x441c58,_0x16162c[0x0],_0xf678('0x6c')));var _0x46f318=JSON[_0xf678('0x6d')](_0x4699ec);if('undefined'==typeof _0x46f318['name']){return _0x2f940a(new Error(_0xf678('0x6e')));}if(_0xf678('0x21')==typeof _0x46f318['type']){return _0x2f940a(new Error(_0xf678('0x6f')));}if('undefined'==typeof _0x46f318[_0xf678('0x70')]){return _0x2f940a(new Error(_0xf678('0x71')));}if(_0xf678('0x21')==typeof _0x46f318[_0xf678('0x72')]){return _0x2f940a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x46f318[_0xf678('0x73')]===_0xf678('0x74')){if(_0xf678('0x21')==typeof _0x46f318['parameters']['views']){return _0x2f940a(new Error(_0xf678('0x75')));}if('undefined'==typeof _0x46f318['parameters'][_0xf678('0x76')]['admin']&&'undefined'==typeof _0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x77')]){return _0x2f940a(new Error(_0xf678('0x78')));}}else if(_0x46f318[_0xf678('0x73')]==='script'){if(_0xf678('0x21')==typeof _0x46f318[_0xf678('0x72')]['scriptName']){return _0x2f940a(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x46f318['parameters'][_0xf678('0x79')]){return _0x2f940a(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2f940a(new Error(_0xf678('0x7a')));}var _0x52ec75=_0x46f318[_0xf678('0x2b')];var _0x2e7ec0=_0x46f318[_0xf678('0x7b')];var _0x255010=_0x46f318[_0xf678('0x73')];var _0x3162bb=_0x46f318[_0xf678('0x7c')]?_0x46f318[_0xf678('0x7c')]:_0xf678('0x7d');var _0x46858d=_0x46f318[_0xf678('0x7e')]?_0x46f318['icon']:_0xf678('0x7f');var _0x2c1a21='';var _0x337a78='';var _0x298153='';var _0x277ed7='';var _0x470f61=_0x46f318[_0xf678('0x70')];if(_0x255010===_0xf678('0x74')){if('undefined'!=typeof _0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x80')]){var _0x5b5272=_0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x5b5272)){_0x2c1a21=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x5b5272);}else{_0x2c1a21=_0x5b5272;}}else{logger[_0xf678('0x5d')](_0xf678('0x83'));}if('undefined'!=typeof _0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x77')]){var _0x2545de=_0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x2545de)){_0x337a78=path['join'](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x2545de);}else{_0x337a78=_0x2545de;}}else{logger[_0xf678('0x5d')](_0xf678('0x84'));}}else if(_0x255010==='script'){_0x298153=_0x46f318[_0xf678('0x72')][_0xf678('0x85')];_0x277ed7=_0x46f318[_0xf678('0x72')][_0xf678('0x79')];if('undefined'!=typeof _0x46f318['parameters'][_0xf678('0x76')]){if('undefined'!=typeof _0x46f318[_0xf678('0x72')]['views'][_0xf678('0x80')]){var _0x5b5272=_0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x5b5272)){_0x2c1a21=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x5b5272);}else{_0x2c1a21=_0x5b5272;}}if('undefined'!=typeof _0x46f318[_0xf678('0x72')]['views'][_0xf678('0x77')]){var _0x2545de=_0x46f318[_0xf678('0x72')]['views'][_0xf678('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x2545de)){_0x337a78=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x2545de);}else{_0x337a78=_0x2545de;}}}}var _0xbdf932={'name':_0x52ec75,'description':_0x2e7ec0,'path':path[_0xf678('0x4c')](_0x4a0c89,_0x16162c[0x0]),'type':_0x255010,'sidebar':_0x3162bb,'icon':_0x46858d,'adminUrl':_0x2c1a21,'agentUrl':_0x337a78,'scriptName':_0x298153,'scriptPath':_0x277ed7,'version':_0x470f61};removeReferences(_0x41d4c7,null);return db['Plugin'][_0xf678('0x86')](_0xbdf932)[_0xf678('0x26')](function(_0x39117e){var _0x14cbca={'role':_0x557efc['body']['role'],'userProfileId':_0x557efc[_0xf678('0x87')][_0xf678('0x88')]};if(!_0x14cbca)throw new Error(_0xf678('0x89'));if(_0x14cbca[_0xf678('0x8a')]===_0xf678('0x8b')){var _0x4f0ed4=_0x39117e[_0xf678('0x8c')]({'plain':!![]});return db[_0xf678('0x8d')][_0xf678('0x49')]({'where':{'name':_0xf678('0x28'),'userProfileId':_0x14cbca[_0xf678('0x88')]},'raw':!![]})['then'](function(_0x582262){if(_0x582262&&_0x582262['autoAssociation']===0x0){return db[_0xf678('0x8e')]['create']({'name':_0x4f0ed4['name'],'resourceId':_0x4f0ed4['id'],'type':_0x582262[_0xf678('0x2b')],'sectionId':_0x582262['id']},{})[_0xf678('0x26')](function(){return _0x39117e;});}else{return _0x39117e;}})[_0xf678('0x43')](function(_0x10cbec){logger[_0xf678('0x2a')](_0xf678('0x8f'),_0x10cbec);throw _0x10cbec;});}return _0x39117e;})[_0xf678('0x26')](respondWithResult(_0x57d8db,null))[_0xf678('0x43')](handleError(_0x57d8db,null));}});}catch(_0x13d46c){_0x57d8db[_0xf678('0x1d')](0x1f4)[_0xf678('0x2c')](_0x13d46c);}};function removeReferences(_0x121d40,_0x3c2f37){try{if(_0x121d40){fs[_0xf678('0x90')](_0x121d40);logger['info']('Zip\x20archive\x20removed');}if(_0x3c2f37){rimraf(_0x3c2f37,function(){});logger['info'](_0xf678('0x91'));}}catch(_0x5d3141){logger[_0xf678('0x2a')](_0x5d3141);}}exports[_0xf678('0x92')]=function(_0x299725,_0x6b051,_0x446537){return db[_0xf678('0x2f')][_0xf678('0x49')]({'where':{'id':_0x299725[_0xf678('0x45')]['id']}})['then'](handleEntityNotFound(_0x6b051,null))[_0xf678('0x26')](saveUpdates(_0x299725[_0xf678('0x87')],null))[_0xf678('0x26')](respondWithResult(_0x6b051,null))[_0xf678('0x43')](handleError(_0x6b051,null));};exports[_0xf678('0x93')]=function(_0x1cc65d,_0x304b77,_0x12794d){return db['Plugin'][_0xf678('0x49')]({'where':{'id':_0x1cc65d['params']['id']}})[_0xf678('0x26')](function(_0x3e4778){if(_0x3e4778){return _0x3e4778[_0xf678('0x27')]();}})['then'](function(_0x22a688){rimraf(path['join'](config['root'],_0xf678('0x4e'),path[_0xf678('0x59')](_0x22a688['path'])),function(){});return _0x22a688;})[_0xf678('0x26')](handleEntityNotFound(_0x304b77,null))[_0xf678('0x26')](respondWithStatusCode(_0x304b77,null))[_0xf678('0x43')](handleError(_0x304b77,null));};exports[_0xf678('0x94')]=function(_0xd1acd0,_0x78e99b,_0x3c5de0){return BPromise[_0xf678('0x95')]()[_0xf678('0x26')](function(){if(!_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')]){throw new Error(_0xf678('0x96'));}if(!_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')]){throw new Error(_0xf678('0x98'));}var _0x2dfb86=_0xd1acd0[_0xf678('0x32')]['hostname']?_0xd1acd0[_0xf678('0x32')][_0xf678('0x99')]+':'+_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')]:_0xf678('0x9a')+_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')];var _0x6033cd=_0xd1acd0[_0xf678('0x32')][_0xf678('0x1e')]?_0xd1acd0[_0xf678('0x32')][_0xf678('0x1e')]:!![];var _0x5a7d60=_0xd1acd0[_0xf678('0x32')][_0xf678('0x9b')]?_0xd1acd0[_0xf678('0x32')][_0xf678('0x9b')]:null;var _0x5e03a4={'method':_0xd1acd0['method'],'uri':util[_0xf678('0x4f')](_0xf678('0x9c'),_0x2dfb86,_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')]),'json':_0x6033cd,'resolveWithFullResponse':!![],'encoding':_0x5a7d60,'qs':_0xd1acd0['query']};if(_0xd1acd0[_0xf678('0x9d')]){_0x5e03a4[_0xf678('0x9d')]=_0xd1acd0['headers'];if(_0x5e03a4[_0xf678('0x9d')]['content-length']){delete _0x5e03a4[_0xf678('0x9d')][_0xf678('0x9e')];}}if(_0x5e03a4[_0xf678('0x9d')][_0xf678('0x9f')]){delete _0x5e03a4['headers'][_0xf678('0x9f')];}return rp(_0x5e03a4);})[_0xf678('0x26')](function(_0x513092){if(_0x513092){_0x78e99b[_0xf678('0x23')](_0x513092[_0xf678('0x9d')]);logger['info'](_0x513092[_0xf678('0x87')]);if(_[_0xf678('0xa0')](_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')],_0xf678('0x4a'))&&_0x513092[_0xf678('0xa1')]==0x1f4){return _0x78e99b['sendStatus'](_0x513092[_0xf678('0xa1')]);}else{return _0x78e99b[_0xf678('0x1d')](_0x513092['statusCode'])[_0xf678('0x2c')](_0x513092[_0xf678('0x87')]);}}else{return _0x78e99b['sendStatus'](0xc8);}})['catch'](handleError(_0x78e99b,null));};exports['webhookPost']=function(_0x309f5d,_0x5d48ea,_0x3dcef4){return BPromise[_0xf678('0x95')]()[_0xf678('0x26')](function(){if(!_0x309f5d[_0xf678('0x32')][_0xf678('0x4b')]){throw new Error(_0xf678('0x96'));}if(!_0x309f5d[_0xf678('0x32')][_0xf678('0x97')]){throw new Error(_0xf678('0x98'));}var _0x1250cc=_0x309f5d[_0xf678('0x32')]['hostname']?_0x309f5d['query']['hostname']+':'+_0x309f5d[_0xf678('0x32')][_0xf678('0x97')]:_0xf678('0x9a')+_0x309f5d['query'][_0xf678('0x97')];var _0x536da2=_0x309f5d[_0xf678('0x32')][_0xf678('0x1e')]?_0x309f5d[_0xf678('0x32')]['json']:!![];var _0x12fcef=_0x309f5d['query'][_0xf678('0x9b')]?_0x309f5d['query'][_0xf678('0x9b')]:null;var _0x5dc269={'method':_0x309f5d[_0xf678('0xa2')],'uri':util[_0xf678('0x4f')](_0xf678('0x9c'),_0x1250cc,_0x309f5d['query'][_0xf678('0x4b')]),'json':_0x536da2,'resolveWithFullResponse':!![],'encoding':_0x12fcef,'body':_0x309f5d[_0xf678('0x87')]};if(_0x309f5d[_0xf678('0x9d')]){_0x5dc269['headers']=_0x309f5d['headers'];if(_0x5dc269['headers'][_0xf678('0x9e')]){delete _0x5dc269[_0xf678('0x9d')][_0xf678('0x9e')];}}if(_0x5dc269[_0xf678('0x9d')][_0xf678('0x9f')]){delete _0x5dc269[_0xf678('0x9d')][_0xf678('0x9f')];}return rp(_0x5dc269);})['then'](function(_0x4710a8){if(_0x4710a8){_0x5d48ea['set'](_0x4710a8[_0xf678('0x9d')]);logger['info'](_0x4710a8[_0xf678('0x87')]);return _0x5d48ea['status'](_0x4710a8[_0xf678('0xa1')])[_0xf678('0x2c')](_0x4710a8[_0xf678('0x87')]);}else{return _0x5d48ea[_0xf678('0x1c')](0xc8);}})[_0xf678('0x43')](handleError(_0x5d48ea,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index d4e7bae..8793aea 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 _0x0d4d=['events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x40da7f,_0x454e9e){var _0xb07a33=function(_0x39b58c){while(--_0x39b58c){_0x40da7f['push'](_0x40da7f['shift']());}};_0xb07a33(++_0x454e9e);}(_0x0d4d,0x132));var _0xd0d4=function(_0x465864,_0x6aec51){_0x465864=_0x465864-0x0;var _0x20cf49=_0x0d4d[_0x465864];return _0x20cf49;};'use strict';var EventEmitter=require(_0xd0d4('0x0'));var Plugin=require(_0xd0d4('0x1'))['db'][_0xd0d4('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd0d4('0x3')](0x0);var events={'afterCreate':_0xd0d4('0x4'),'afterUpdate':_0xd0d4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x984664){return function(_0x58909f,_0x2e99ee,_0x3787f4){PluginEvents['emit'](_0x984664+':'+_0x58909f['id'],_0x58909f);PluginEvents[_0xd0d4('0x6')](_0x984664,_0x58909f);_0x3787f4(null);};}for(var e in events){if(events[_0xd0d4('0x7')](e)){var event=events[e];Plugin[_0xd0d4('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x9b69=['hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','update','emit'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9b69,0xa3));var _0x99b6=function(_0x44d20f,_0x292582){_0x44d20f=_0x44d20f-0x0;var _0x509a0b=_0x9b69[_0x44d20f];return _0x509a0b;};'use strict';var EventEmitter=require(_0x99b6('0x0'));var Plugin=require(_0x99b6('0x1'))['db'][_0x99b6('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x99b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2d5904){return function(_0x3a05b4,_0x293e09,_0x4a62c6){PluginEvents[_0x99b6('0x4')](_0x2d5904+':'+_0x3a05b4['id'],_0x3a05b4);PluginEvents['emit'](_0x2d5904,_0x3a05b4);_0x4a62c6(null);};}for(var e in events){if(events[_0x99b6('0x5')](e)){var event=events[e];Plugin[_0x99b6('0x6')](e,emitEvent(event));}}module[_0x99b6('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9b2922d..5ccafa7 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 _0x1793=['../../config/environment','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x1793,0x1ce));var _0x3179=function(_0x2c5b89,_0x17f52f){_0x2c5b89=_0x2c5b89-0x0;var _0x47e4b6=_0x1793[_0x2c5b89];return _0x47e4b6;};'use strict';var _=require(_0x3179('0x0'));var util=require(_0x3179('0x1'));var logger=require(_0x3179('0x2'))(_0x3179('0x3'));var moment=require('moment');var BPromise=require(_0x3179('0x4'));var rp=require(_0x3179('0x5'));var fs=require('fs');var path=require(_0x3179('0x6'));var rimraf=require(_0x3179('0x7'));var config=require(_0x3179('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0x43ee6e,_0x2e6158){return _0x43ee6e['define']('Plugin',attributes,{'tableName':_0x3179('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe002=['Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0xf9d98e,_0x234354){var _0x2053eb=function(_0x20e6fb){while(--_0x20e6fb){_0xf9d98e['push'](_0xf9d98e['shift']());}};_0x2053eb(++_0x234354);}(_0xe002,0x15f));var _0x2e00=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0xe002[_0xf04c6d];return _0x4a804e;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fs=require('fs');var path=require(_0x2e00('0x7'));var rimraf=require(_0x2e00('0x8'));var config=require(_0x2e00('0x9'));var attributes=require(_0x2e00('0xa'));module[_0x2e00('0xb')]=function(_0x4f57ac,_0x50555c){return _0x4f57ac[_0x2e00('0xc')](_0x2e00('0xd'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 8816cbf..b5ee139 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 _0xb675=['redis','localhost','socket.io-emitter','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options','raw','CreatePlugin','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3efea6,_0x129f0){var _0x46f3f0=function(_0x5f0804){while(--_0x5f0804){_0x3efea6['push'](_0x3efea6['shift']());}};_0x46f3f0(++_0x129f0);}(_0xb675,0xe6));var _0x5b67=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0xb675[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require(_0x5b67('0x0'));var util=require('util');var moment=require(_0x5b67('0x1'));var BPromise=require(_0x5b67('0x2'));var rs=require(_0x5b67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b67('0x4'))['db'];var utils=require(_0x5b67('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5b67('0x6'));var jayson=require(_0x5b67('0x7'));var client=jayson[_0x5b67('0x8')][_0x5b67('0x9')]({'port':0x232a});config[_0x5b67('0xa')]=_['defaults'](config[_0x5b67('0xa')],{'host':_0x5b67('0xb'),'port':0x18eb});var socket=require(_0x5b67('0xc'))(new Redis(config[_0x5b67('0xa')]));require('./plugin.socket')[_0x5b67('0xd')](socket);function respondWithRpcPromise(_0x704304,_0x983810,_0x29a0cd){return new BPromise(function(_0x36b898,_0x518899){return client[_0x5b67('0xe')](_0x704304,_0x29a0cd)['then'](function(_0x185e3b){logger[_0x5b67('0xf')](_0x5b67('0x10'),_0x983810,_0x5b67('0x11'));logger['debug'](_0x5b67('0x12'),_0x983810,_0x5b67('0x11'),JSON['stringify'](_0x185e3b));if(_0x185e3b[_0x5b67('0x13')]){if(_0x185e3b[_0x5b67('0x13')][_0x5b67('0x14')]===0x1f4){logger['error'](_0x5b67('0x10'),_0x983810,_0x185e3b[_0x5b67('0x13')]['message']);return _0x518899(_0x185e3b[_0x5b67('0x13')][_0x5b67('0x15')]);}logger[_0x5b67('0x13')](_0x5b67('0x10'),_0x983810,_0x185e3b[_0x5b67('0x13')][_0x5b67('0x15')]);return _0x36b898(_0x185e3b[_0x5b67('0x13')]['message']);}else{logger['info'](_0x5b67('0x10'),_0x983810,_0x5b67('0x11'));_0x36b898(_0x185e3b[_0x5b67('0x16')]['message']);}})[_0x5b67('0x17')](function(_0x5db569){logger['error'](_0x5b67('0x10'),_0x983810,_0x5db569);_0x518899(_0x5db569);});});}exports['CreatePlugin']=function(_0x1a3322){var _0x4c23ef=this;return new Promise(function(_0x30c82f,_0x357706){return db['Plugin'][_0x5b67('0x18')](_0x1a3322[_0x5b67('0x19')],{'raw':_0x1a3322[_0x5b67('0x1a')]?_0x1a3322[_0x5b67('0x1a')][_0x5b67('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4eb196){logger[_0x5b67('0xf')](_0x5b67('0x1c'),_0x1a3322);logger['debug'](_0x5b67('0x1c'),_0x1a3322,JSON[_0x5b67('0x1d')](_0x4eb196));_0x30c82f(_0x4eb196);})[_0x5b67('0x17')](function(_0x55aced){logger[_0x5b67('0x13')](_0x5b67('0x1c'),_0x55aced[_0x5b67('0x15')],_0x1a3322);_0x357706(_0x4c23ef[_0x5b67('0x13')](0x1f4,_0x55aced['message']));});});}; \ No newline at end of file +var _0x37c0=['defaults','localhost','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','create','options','raw','CreatePlugin','debug','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x56274c,_0xa76dc0){var _0x47a265=function(_0x4e87ce){while(--_0x4e87ce){_0x56274c['push'](_0x56274c['shift']());}};_0x47a265(++_0xa76dc0);}(_0x37c0,0x18b));var _0x037c=function(_0x2ea736,_0x32d4ad){_0x2ea736=_0x2ea736-0x0;var _0x3a2024=_0x37c0[_0x2ea736];return _0x3a2024;};'use strict';var _=require(_0x037c('0x0'));var util=require(_0x037c('0x1'));var moment=require(_0x037c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x037c('0x3'));var db=require(_0x037c('0x4'))['db'];var utils=require(_0x037c('0x5'));var logger=require(_0x037c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x037c('0x7'));var client=jayson[_0x037c('0x8')][_0x037c('0x9')]({'port':0x232a});config[_0x037c('0xa')]=_[_0x037c('0xb')](config[_0x037c('0xa')],{'host':_0x037c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x037c('0xa')]));require(_0x037c('0xd'))[_0x037c('0xe')](socket);function respondWithRpcPromise(_0x3fb5dd,_0x54090d,_0x1aaea8){return new BPromise(function(_0x48eb56,_0x337375){return client['request'](_0x3fb5dd,_0x1aaea8)['then'](function(_0xd950ff){logger[_0x037c('0xf')](_0x037c('0x10'),_0x54090d,_0x037c('0x11'));logger['debug'](_0x037c('0x12'),_0x54090d,_0x037c('0x11'),JSON[_0x037c('0x13')](_0xd950ff));if(_0xd950ff[_0x037c('0x14')]){if(_0xd950ff[_0x037c('0x14')][_0x037c('0x15')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x54090d,_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);return _0x337375(_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);}logger['error'](_0x037c('0x10'),_0x54090d,_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);return _0x48eb56(_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);}else{logger[_0x037c('0xf')]('Plugin,\x20%s,\x20%s',_0x54090d,_0x037c('0x11'));_0x48eb56(_0xd950ff['result'][_0x037c('0x16')]);}})['catch'](function(_0x190283){logger['error'](_0x037c('0x10'),_0x54090d,_0x190283);_0x337375(_0x190283);});});}exports['CreatePlugin']=function(_0x4f9701){var _0x26a915=this;return new Promise(function(_0x253242,_0x2c1ed7){return db['Plugin'][_0x037c('0x17')](_0x4f9701['body'],{'raw':_0x4f9701[_0x037c('0x18')]?_0x4f9701[_0x037c('0x18')][_0x037c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2940d2){logger[_0x037c('0xf')](_0x037c('0x1a'),_0x4f9701);logger[_0x037c('0x1b')]('CreatePlugin',_0x4f9701,JSON[_0x037c('0x13')](_0x2940d2));_0x253242(_0x2940d2);})[_0x037c('0x1c')](function(_0x441c7d){logger[_0x037c('0x14')]('CreatePlugin',_0x441c7d[_0x037c('0x16')],_0x4f9701);_0x2c1ed7(_0x26a915['error'](0x1f4,_0x441c7d[_0x037c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 058342b..937cccb 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 _0x1867=['length','./plugin.events','save','remove','update','removeListener','register'];(function(_0x602436,_0xbf433){var _0x504c33=function(_0x4770a0){while(--_0x4770a0){_0x602436['push'](_0x602436['shift']());}};_0x504c33(++_0xbf433);}(_0x1867,0x104));var _0x7186=function(_0x36afe8,_0x26391b){_0x36afe8=_0x36afe8-0x0;var _0x57de4c=_0x1867[_0x36afe8];return _0x57de4c;};'use strict';var PluginEvents=require(_0x7186('0x0'));var events=[_0x7186('0x1'),_0x7186('0x2'),_0x7186('0x3')];function createListener(_0x3712b5,_0x2eb906){return function(_0x43860c){_0x2eb906['emit'](_0x3712b5,_0x43860c);};}function removeListener(_0xc07530,_0x285fd0){return function(){PluginEvents[_0x7186('0x4')](_0xc07530,_0x285fd0);};}exports[_0x7186('0x5')]=function(_0x114b25){for(var _0x42e85c=0x0,_0x177912=events[_0x7186('0x6')];_0x42e85c<_0x177912;_0x42e85c++){var _0x5b0302=events[_0x42e85c];var _0x363815=createListener('plugin:'+_0x5b0302,_0x114b25);PluginEvents['on'](_0x5b0302,_0x363815);}}; \ No newline at end of file +var _0xfaa4=['plugin:','./plugin.events','update','emit','removeListener','register'];(function(_0x551bc4,_0x330316){var _0x5af907=function(_0x41d277){while(--_0x41d277){_0x551bc4['push'](_0x551bc4['shift']());}};_0x5af907(++_0x330316);}(_0xfaa4,0x169));var _0x4faa=function(_0x402b25,_0xd52516){_0x402b25=_0x402b25-0x0;var _0x55152b=_0xfaa4[_0x402b25];return _0x55152b;};'use strict';var PluginEvents=require(_0x4faa('0x0'));var events=['save','remove',_0x4faa('0x1')];function createListener(_0x42c79f,_0x5af106){return function(_0x1f8145){_0x5af106[_0x4faa('0x2')](_0x42c79f,_0x1f8145);};}function removeListener(_0x25ef57,_0x57b4df){return function(){PluginEvents[_0x4faa('0x3')](_0x25ef57,_0x57b4df);};}exports[_0x4faa('0x4')]=function(_0x8ce165){for(var _0x26aa59=0x0,_0x28ec9f=events['length'];_0x26aa59<_0x28ec9f;_0x26aa59++){var _0x1bf5f2=events[_0x26aa59];var _0x264fbf=createListener(_0x4faa('0x5')+_0x1bf5f2,_0x8ce165);PluginEvents['on'](_0x1bf5f2,_0x264fbf);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ffb5124..0918536 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(_0x1fe532,_0x5d4153){var _0x30b068=function(_0x468d99){while(--_0x468d99){_0x1fe532['push'](_0x1fe532['shift']());}};_0x30b068(++_0x5d4153);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x5d2143,_0x485800){var _0x260617=function(_0x42a7b2){while(--_0x42a7b2){_0x5d2143['push'](_0x5d2143['shift']());}};_0x260617(++_0x485800);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 d597d20..5d65a0e 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 _0x04b8=['join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','params','delete','dump','Unknown\x20id','../../config/pm2','api','path','exec','bluebird','sendStatus','status','error','stack','name','npm\x20install','info','index','list','reject','express','length','catch','show','describe','then','create','body','script'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x04b8,0x159));var _0x804b=function(_0x197191,_0x412830){_0x197191=_0x197191-0x0;var _0x15d150=_0x04b8[_0x197191];return _0x15d150;};'use strict';var _=require('lodash');var pm2=require(_0x804b('0x0'));var logger=require('../../config/logger')(_0x804b('0x1'));var path=require(_0x804b('0x2'));var exec=require('child_process')[_0x804b('0x3')];var BPromise=require(_0x804b('0x4'));function handleEntityNotFound(_0x5857dc,_0x3530f6){return function(_0x1c3474){if(!_0x1c3474){_0x5857dc[_0x804b('0x5')](0x194);;}return _0x1c3474;};}function respondWithResult(_0x5a8a5b,_0x2c22e3){_0x2c22e3=_0x2c22e3||0xc8;return function(_0x3c5404){if(_0x3c5404){return _0x5a8a5b[_0x804b('0x6')](_0x2c22e3)['json'](_0x3c5404);}return null;};}function handleError(_0x27e950,_0x1071b4){_0x1071b4=_0x1071b4||0x1f4;return function(_0x592e14){logger[_0x804b('0x7')](_0x592e14[_0x804b('0x8')]);if(_0x592e14[_0x804b('0x9')]){delete _0x592e14[_0x804b('0x9')];}_0x27e950[_0x804b('0x6')](_0x1071b4)['send'](_0x592e14);};}function execChildProcess(){return new BPromise(function(_0x22c98d,_0x3338ba){exec(_0x804b('0xa'),function(_0x7029e7,_0x2d13ba,_0x12e7b4){logger['info'](_0x2d13ba);logger[_0x804b('0xb')](_0x12e7b4);if(_0x7029e7){logger['error'](_0x7029e7);return _0x3338ba(_0x7029e7);}return _0x22c98d(_0x2d13ba);});});}exports[_0x804b('0xc')]=function(_0x3a2702,_0xfa2ddd){return pm2[_0x804b('0xd')]()['then'](function(_0x215825){if(_0x215825){var _0x1b01a7=_[_0x804b('0xe')](_0x215825,function(_0x236a85){return _0x236a85['name']===_0x804b('0xf')||_0x236a85[_0x804b('0x9')]==='motion2';});return{'rows':_0x1b01a7,'count':_0x1b01a7[_0x804b('0x10')]};}return null;})['then'](respondWithResult(_0xfa2ddd,null))[_0x804b('0x11')](handleError(_0xfa2ddd,null));};exports[_0x804b('0x12')]=function(_0x13662e,_0x1760f8){return pm2[_0x804b('0x13')](_0x13662e['params']['id'])[_0x804b('0x14')](respondWithResult(_0x1760f8,null))['then'](handleEntityNotFound(_0x1760f8,null))[_0x804b('0x11')](handleError(_0x1760f8,null));};exports[_0x804b('0x15')]=function(_0x42cceb,_0x469251){if(_0x42cceb['body'][_0x804b('0x9')]&&_0x42cceb[_0x804b('0x16')][_0x804b('0x17')]){var _0x11eaf6=path[_0x804b('0x18')](__dirname,_0x804b('0x19'),_0x42cceb[_0x804b('0x16')][_0x804b('0x17')]);var _0xaa9521=process[_0x804b('0x1a')]();process[_0x804b('0x1b')](path['dirname'](_0x11eaf6));return execChildProcess()[_0x804b('0x14')](function(_0x5a77e0){process['chdir'](_0xaa9521);return pm2[_0x804b('0x1c')]({'name':_0x42cceb[_0x804b('0x16')][_0x804b('0x9')],'script':_0x11eaf6});})[_0x804b('0x14')](function(_0x9080c2){pm2['dump']();return _0x9080c2[0x0];})[_0x804b('0x14')](respondWithResult(_0x469251,0xc9))[_0x804b('0x11')](handleError(_0x469251,null));}else{return _0x469251['status'](0x1f4)[_0x804b('0x1d')]({'message':_0x804b('0x1e')});}};exports[_0x804b('0x1f')]=function(_0x27d5ec,_0x2d88da){if(_0x27d5ec['body']['id']){delete _0x27d5ec[_0x804b('0x16')]['id'];}var _0x22f822={'online':_0x804b('0x20'),'stopped':_0x804b('0x21')};if(_0x22f822[_0x804b('0x22')](_0x27d5ec['body'][_0x804b('0x6')])){return pm2[_0x22f822[_0x27d5ec[_0x804b('0x16')][_0x804b('0x6')]]](_0x27d5ec['params']['id'])[_0x804b('0x14')](respondWithResult(_0x2d88da,0xc8))[_0x804b('0x11')](handleError(_0x2d88da,null));}else{return _0x2d88da[_0x804b('0x6')](0x1f4)['send']({'message':_0x804b('0x23')});}};exports[_0x804b('0x24')]=function(_0x5e8f85,_0x391376){if(_0x5e8f85[_0x804b('0x16')]['id']){delete _0x5e8f85[_0x804b('0x16')]['id'];}if(_0x5e8f85[_0x804b('0x25')]['id']){return pm2[_0x804b('0x26')](_0x5e8f85[_0x804b('0x25')]['id'])['then'](function(_0x3b0692){pm2[_0x804b('0x27')]();return _0x3b0692[0x0];})[_0x804b('0x14')](respondWithResult(_0x391376,null))[_0x804b('0x11')](handleError(_0x391376,null));}else{return _0x391376[_0x804b('0x6')](0x1f4)[_0x804b('0x1d')]({'message':_0x804b('0x28')});}}; \ No newline at end of file +var _0xdace=['path','exec','bluebird','sendStatus','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','express','length','catch','show','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','params','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/logger','api'];(function(_0xd0d7da,_0x2ccf94){var _0x281ba5=function(_0x3f2519){while(--_0x3f2519){_0xd0d7da['push'](_0xd0d7da['shift']());}};_0x281ba5(++_0x2ccf94);}(_0xdace,0xc5));var _0xedac=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xdace[_0x18d631];return _0x50d708;};'use strict';var _=require(_0xedac('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var path=require(_0xedac('0x3'));var exec=require('child_process')[_0xedac('0x4')];var BPromise=require(_0xedac('0x5'));function handleEntityNotFound(_0x15d3bd,_0xefb142){return function(_0x5a97c0){if(!_0x5a97c0){_0x15d3bd[_0xedac('0x6')](0x194);;}return _0x5a97c0;};}function respondWithResult(_0x1cba89,_0x39328a){_0x39328a=_0x39328a||0xc8;return function(_0x5ecbd3){if(_0x5ecbd3){return _0x1cba89[_0xedac('0x7')](_0x39328a)[_0xedac('0x8')](_0x5ecbd3);}return null;};}function handleError(_0x162eea,_0x53fa43){_0x53fa43=_0x53fa43||0x1f4;return function(_0x27243f){logger[_0xedac('0x9')](_0x27243f[_0xedac('0xa')]);if(_0x27243f['name']){delete _0x27243f['name'];}_0x162eea[_0xedac('0x7')](_0x53fa43)[_0xedac('0xb')](_0x27243f);};}function execChildProcess(){return new BPromise(function(_0x57e1bf,_0x4d6a29){exec(_0xedac('0xc'),function(_0x25395d,_0x57f637,_0x261401){logger['info'](_0x57f637);logger[_0xedac('0xd')](_0x261401);if(_0x25395d){logger[_0xedac('0x9')](_0x25395d);return _0x4d6a29(_0x25395d);}return _0x57e1bf(_0x57f637);});});}exports[_0xedac('0xe')]=function(_0x342186,_0x9a79a0){return pm2[_0xedac('0xf')]()[_0xedac('0x10')](function(_0x11f0b0){if(_0x11f0b0){var _0x593030=_[_0xedac('0x11')](_0x11f0b0,function(_0x4651d4){return _0x4651d4[_0xedac('0x12')]===_0xedac('0x13')||_0x4651d4[_0xedac('0x12')]==='motion2';});return{'rows':_0x593030,'count':_0x593030[_0xedac('0x14')]};}return null;})['then'](respondWithResult(_0x9a79a0,null))[_0xedac('0x15')](handleError(_0x9a79a0,null));};exports[_0xedac('0x16')]=function(_0xdad128,_0xba0c93){return pm2['describe'](_0xdad128['params']['id'])[_0xedac('0x10')](respondWithResult(_0xba0c93,null))[_0xedac('0x10')](handleEntityNotFound(_0xba0c93,null))[_0xedac('0x15')](handleError(_0xba0c93,null));};exports[_0xedac('0x17')]=function(_0x5a5438,_0x4a699b){if(_0x5a5438[_0xedac('0x18')][_0xedac('0x12')]&&_0x5a5438[_0xedac('0x18')][_0xedac('0x19')]){var _0x2f5eee=path[_0xedac('0x1a')](__dirname,_0xedac('0x1b'),_0x5a5438[_0xedac('0x18')]['script']);var _0x4593e8=process['cwd']();process[_0xedac('0x1c')](path[_0xedac('0x1d')](_0x2f5eee));return execChildProcess()['then'](function(_0x46e09d){process[_0xedac('0x1c')](_0x4593e8);return pm2[_0xedac('0x1e')]({'name':_0x5a5438[_0xedac('0x18')][_0xedac('0x12')],'script':_0x2f5eee});})[_0xedac('0x10')](function(_0x5d7c31){pm2[_0xedac('0x1f')]();return _0x5d7c31[0x0];})[_0xedac('0x10')](respondWithResult(_0x4a699b,0xc9))[_0xedac('0x15')](handleError(_0x4a699b,null));}else{return _0x4a699b[_0xedac('0x7')](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x20')});}};exports[_0xedac('0x21')]=function(_0x26c6f7,_0x409825){if(_0x26c6f7[_0xedac('0x18')]['id']){delete _0x26c6f7['body']['id'];}var _0x25d7f5={'online':_0xedac('0x22'),'stopped':_0xedac('0x23')};if(_0x25d7f5['hasOwnProperty'](_0x26c6f7[_0xedac('0x18')]['status'])){return pm2[_0x25d7f5[_0x26c6f7['body'][_0xedac('0x7')]]](_0x26c6f7[_0xedac('0x24')]['id'])[_0xedac('0x10')](respondWithResult(_0x409825,0xc8))[_0xedac('0x15')](handleError(_0x409825,null));}else{return _0x409825['status'](0x1f4)['send']({'message':_0xedac('0x25')});}};exports[_0xedac('0x26')]=function(_0x24b182,_0x2ee8d7){if(_0x24b182[_0xedac('0x18')]['id']){delete _0x24b182[_0xedac('0x18')]['id'];}if(_0x24b182[_0xedac('0x24')]['id']){return pm2['delete'](_0x24b182[_0xedac('0x24')]['id'])[_0xedac('0x10')](function(_0x2cbe33){pm2['dump']();return _0x2cbe33[0x0];})[_0xedac('0x10')](respondWithResult(_0x2ee8d7,null))[_0xedac('0x15')](handleError(_0x2ee8d7,null));}else{return _0x2ee8d7['status'](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 95c6cd1..bbd3d07 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 _0x2d12=['Router','get','/queues','isAuthenticated','getQueues','exports'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x2d12,0x198));var _0x22d1=function(_0x1b3554,_0x1a8d71){_0x1b3554=_0x1b3554-0x0;var _0x294a52=_0x2d12[_0x1b3554];return _0x294a52;};'use strict';var express=require('express');var router=express[_0x22d1('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x22d1('0x1')](_0x22d1('0x2'),auth[_0x22d1('0x3')](),controller[_0x22d1('0x4')]);module[_0x22d1('0x5')]=router; \ No newline at end of file +var _0x5a13=['get','/queues','isAuthenticated','getQueues','exports','express','Router','./realtime.controller'];(function(_0x482e60,_0x5b40b2){var _0x315451=function(_0x3c5195){while(--_0x3c5195){_0x482e60['push'](_0x482e60['shift']());}};_0x315451(++_0x5b40b2);}(_0x5a13,0x145));var _0x35a1=function(_0x48f7a8,_0x2664ba){_0x48f7a8=_0x48f7a8-0x0;var _0xbfa9e0=_0x5a13[_0x48f7a8];return _0xbfa9e0;};'use strict';var express=require(_0x35a1('0x0'));var router=express[_0x35a1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x35a1('0x2'));router[_0x35a1('0x3')](_0x35a1('0x4'),auth[_0x35a1('0x5')](),controller[_0x35a1('0x6')]);module[_0x35a1('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 bc3225b..8464841 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 _0xd046=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','get','paused','loggedInDb','pTalking','getAgents','online','getMembers','find','UserId','agents','User','Pause','QueueId','findAll','agent','length','rows','catch','lodash','jayson/promise','../../components/parsers/qs','api','http','limit','undefined','status','set','Content-Range','error','stack','name','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','getResources','findAndCountAll','then','count','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xd046,0x129));var _0x6d04=function(_0x48d94e,_0xfbb342){_0x48d94e=_0x48d94e-0x0;var _0x1fd8e8=_0xd046[_0x48d94e];return _0x1fd8e8;};'use strict';var util=require('util');var _=require(_0x6d04('0x0'));var jayson=require(_0x6d04('0x1'));var qs=require(_0x6d04('0x2'));var logger=require('../../config/logger')(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var client=jayson['client'][_0x6d04('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x6d04('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4a1d47,_0x4bacb1){return function(_0xf3b4e7){if(_0xf3b4e7){var _0x1968c4=typeof _0x4bacb1['offset']==='undefined'&&typeof _0x4bacb1[_0x6d04('0x5')]===_0x6d04('0x6');var _0x52fc0c=_0xf3b4e7['count'];var _0x27a3d6=_0x1968c4?0x0:_0x4bacb1['offset'];var _0x38bce9=_0x1968c4?_0xf3b4e7['count']:_0x4bacb1['offset']+_0x4bacb1['limit'];var _0x36ae3e;if(_0x38bce9>=_0x52fc0c){_0x38bce9=_0x52fc0c;_0x36ae3e=0xc8;}else{_0x36ae3e=0xce;}_0x4a1d47[_0x6d04('0x7')](_0x36ae3e);return _0x4a1d47[_0x6d04('0x8')](_0x6d04('0x9'),_0x27a3d6+'-'+_0x38bce9+'/'+_0x52fc0c)['json'](_0xf3b4e7);}return null;};}function handleError(_0x26a6ab,_0x103593){_0x103593=_0x103593||0x1f4;return function(_0x39156e){logger[_0x6d04('0xa')](_0x39156e[_0x6d04('0xb')]);if(_0x39156e[_0x6d04('0xc')]){delete _0x39156e[_0x6d04('0xc')];}_0x26a6ab[_0x6d04('0x7')](_0x103593)[_0x6d04('0xd')](_0x39156e);};}exports[_0x6d04('0xe')]=function(_0x252eee,_0x43f451){var _0x165b23=[_0x6d04('0xf'),_0x6d04('0x10'),_0x6d04('0x11'),_0x6d04('0x12'),_0x6d04('0x13'),_0x6d04('0x14'),_0x6d04('0x15')];var _0x14190b={'count':0x0,'rows':[]},_0x41dc21={},_0x2bc798;Promise[_0x6d04('0x16')]()['then'](function(){if(_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')]){if(!_[_0x6d04('0x19')](_0x165b23,_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')][_0x6d04('0x1a')]()))throw new Error(_0x6d04('0x1b'));_0x2bc798=_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')][_0x6d04('0x1a')]();}var _0xbddecb=_[_0x6d04('0x1c')](_0x2bc798)+_0x6d04('0x1d');var _0x5bda3a=_[_0x6d04('0x1e')](db[_0xbddecb][_0x6d04('0x1f')],function(_0x54cf0e){return{'name':_0x54cf0e['fieldName'],'type':_0x54cf0e[_0x6d04('0x20')][_0x6d04('0x21')]};});_0x41dc21=qs[_0x6d04('0x22')](_0x5bda3a,_0x252eee);if(_0x252eee[_0x6d04('0x23')][_0x6d04('0x24')]===_0x6d04('0x23')){var _0x325c71={'params':{'id':_0x252eee[_0x6d04('0x23')][_0x6d04('0x25')]},'query':{'section':_0x2bc798===_0x6d04('0x15')&&_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')?_0x6d04('0x27'):_['startCase'](_0x2bc798)+_0x6d04('0x28'),'type':_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')],'nolimit':!![],'sort':_0x6d04('0xc'),'filter':_0x252eee[_0x6d04('0x17')][_0x6d04('0x29')]}};return db['UserProfile'][_0x6d04('0x2a')](_0x325c71);}return db[_0xbddecb][_0x6d04('0x2b')](_0x41dc21);})[_0x6d04('0x2c')](function(_0x40b9e6){_0x14190b[_0x6d04('0x2d')]=_0x40b9e6['count'];var _0x5d1033=_0x2bc798==='voice'?client:routingClient;return _0x5d1033['request'](_[_0x6d04('0x1c')](_0x2bc798)+'Queues',_0x252eee)[_0x6d04('0x2c')](function(_0x4ed123){if(_0x4ed123[_0x6d04('0xa')])throw new Error(util[_0x6d04('0x2e')](_0x6d04('0x2f'),_0x2bc798));var _0x9a95df=_0x4ed123[_0x6d04('0x30')];var _0x228b65=[_0x6d04('0x31'),_0x6d04('0x32'),_0x6d04('0x33'),_0x6d04('0x34'),'paused'];if(_0x2bc798==='voice'&&_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')){_0x228b65[_0x6d04('0x35')]('pTalking',_0x6d04('0x36'),_0x6d04('0x37'),_0x6d04('0x38'),_0x6d04('0x39'),'Trunk',_0x6d04('0x3a'),_0x6d04('0x3b'),_0x6d04('0x3c'),_0x6d04('0x3d'),_0x6d04('0x3e'),_0x6d04('0x3f'),_0x6d04('0x40'),_0x6d04('0x41'),_0x6d04('0x42'),_0x6d04('0x43'),_0x6d04('0x44'),_0x6d04('0x45'),_0x6d04('0x46'),_0x6d04('0x47'),_0x6d04('0x48'),'predictiveIntervalAvgTalktime');}var _0x4dc327=_0x40b9e6['rows'][_0x6d04('0x1e')](function(_0x2f7498){var _0x4c1908=_0x2f7498[_0x6d04('0x49')]({'plain':!![]});_0x4c1908[_0x6d04('0x4a')]=0x0;_0x4c1908[_0x6d04('0x4b')]=0x0;_0x4c1908[_0x6d04('0x31')]=0x0;_0x4c1908[_0x6d04('0x32')]=0x0;_0x4c1908[_0x6d04('0x4a')]=0x0;_0x4c1908[_0x6d04('0x33')]=0x0;if(_0x2bc798===_0x6d04('0x15')){_0x4c1908['talking']=0x0;if(_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')){_0x4c1908[_0x6d04('0x4c')]=0x0;_0x4c1908[_0x6d04('0x36')]=0x0;}}_0x4c1908['agents']=[];var _0x259313=_['find'](_0x9a95df['rows'],['id',_0x4c1908['id']]);if(_0x259313)_['merge'](_0x4c1908,_['pick'](_0x259313,_0x228b65));if(_0x2bc798==='voice'){return _0x2f7498[_0x6d04('0x4d')]({'attributes':['id','name',_0x6d04('0x4e')],'joinTableAttributes':[],'raw':!![]})[_0x6d04('0x2c')](function(_0x114025){return _0x2f7498[_0x6d04('0x4f')]({'raw':!![]})['then'](function(_0x282e7a){for(var _0x15bf70=0x0;_0x15bf70<_0x114025['length'];_0x15bf70++){var _0x22305f=_[_0x6d04('0x50')](_0x282e7a,[_0x6d04('0x51'),_0x114025[_0x15bf70]['id']]);var _0x44a27d={'id':_0x114025[_0x15bf70]['id'],'name':_0x114025[_0x15bf70][_0x6d04('0xc')],'online':Boolean(_0x114025[_0x15bf70][_0x6d04('0x4e')]),'paused':_0x22305f?Boolean(_0x22305f[_0x6d04('0x4a')]):![]};if(_0x44a27d['online'])_0x4c1908[_0x6d04('0x4b')]++;if(_0x44a27d['paused'])_0x4c1908['paused']++;_0x4c1908[_0x6d04('0x52')]['push'](_0x44a27d);}return _0x4c1908;});});}else{var _0x430722=_0x6d04('0x53')+_['startCase'](_0x2bc798)+_0x6d04('0x1d');var _0x416d46=_0x2bc798+_0x6d04('0x54');return db[_0x430722]['findAll']({'where':{[_['startCase'](_0x2bc798)+_0x6d04('0x55')]:_0x2f7498['id']},'raw':!![]})[_0x6d04('0x2c')](function(_0x31550c){return db[_0x6d04('0x53')][_0x6d04('0x56')]({'attributes':['id','name',_0x6d04('0x4e'),_0x416d46],'where':{'id':_[_0x6d04('0x1e')](_0x31550c,_0x6d04('0x51')),'role':_0x6d04('0x57')},'raw':!![]});})[_0x6d04('0x2c')](function(_0x3d3c66){for(var _0x491de4=0x0;_0x491de4<_0x3d3c66[_0x6d04('0x58')];_0x491de4++){var _0x291514={'id':_0x3d3c66[_0x491de4]['id'],'name':_0x3d3c66[_0x491de4][_0x6d04('0xc')],'online':Boolean(_0x3d3c66[_0x491de4]['online']),'paused':Boolean(_0x3d3c66[_0x491de4][_0x416d46])};if(_0x291514['online'])_0x4c1908[_0x6d04('0x4b')]++;if(_0x291514[_0x6d04('0x4a')])_0x4c1908['paused']++;_0x4c1908['agents']['push'](_0x291514);}return _0x4c1908;});}});return Promise['all'](_0x4dc327);});})['then'](function(_0x4b0349){_0x14190b[_0x6d04('0x59')]=_0x4b0349;return _0x14190b;})[_0x6d04('0x2c')](respondWithFilteredResult(_0x43f451,_0x41dc21))[_0x6d04('0x5a')](handleError(_0x43f451,null));}; \ No newline at end of file +var _0x7046=['fieldName','type','key','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','loggedInDb','agents','find','merge','pick','online','getMembers','UserId','User','Pause','findAll','agent','length','all','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','count','limit','status','Content-Range','json','error','stack','name','send','getQueues','mail','sms','openchannel','fax','whatsapp','voice','resolve','then','query','includes','channel','toLowerCase','Invalid\x20channel','startCase','Queue','rawAttributes'];(function(_0x27b49f,_0x5609d2){var _0x1b75c2=function(_0x4908ae){while(--_0x4908ae){_0x27b49f['push'](_0x27b49f['shift']());}};_0x1b75c2(++_0x5609d2);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var util=require(_0x6704('0x0'));var _=require(_0x6704('0x1'));var jayson=require(_0x6704('0x2'));var qs=require(_0x6704('0x3'));var logger=require('../../config/logger')(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var client=jayson[_0x6704('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x6704('0x6')][_0x6704('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x3f4169,_0x626a14){return function(_0x2917be){if(_0x2917be){var _0x4badf8=typeof _0x626a14[_0x6704('0x8')]==='undefined'&&typeof _0x626a14['limit']===_0x6704('0x9');var _0x510221=_0x2917be['count'];var _0x3ca599=_0x4badf8?0x0:_0x626a14[_0x6704('0x8')];var _0x37a1ad=_0x4badf8?_0x2917be[_0x6704('0xa')]:_0x626a14[_0x6704('0x8')]+_0x626a14[_0x6704('0xb')];var _0x3dfda4;if(_0x37a1ad>=_0x510221){_0x37a1ad=_0x510221;_0x3dfda4=0xc8;}else{_0x3dfda4=0xce;}_0x3f4169[_0x6704('0xc')](_0x3dfda4);return _0x3f4169['set'](_0x6704('0xd'),_0x3ca599+'-'+_0x37a1ad+'/'+_0x510221)[_0x6704('0xe')](_0x2917be);}return null;};}function handleError(_0x575aa6,_0x2feb52){_0x2feb52=_0x2feb52||0x1f4;return function(_0x1db0ad){logger[_0x6704('0xf')](_0x1db0ad[_0x6704('0x10')]);if(_0x1db0ad[_0x6704('0x11')]){delete _0x1db0ad[_0x6704('0x11')];}_0x575aa6[_0x6704('0xc')](_0x2feb52)[_0x6704('0x12')](_0x1db0ad);};}exports[_0x6704('0x13')]=function(_0x49048f,_0x168258){var _0x1752bc=[_0x6704('0x14'),'chat',_0x6704('0x15'),_0x6704('0x16'),_0x6704('0x17'),_0x6704('0x18'),_0x6704('0x19')];var _0x5adb35={'count':0x0,'rows':[]},_0x1e5f6e={},_0x31d732;Promise[_0x6704('0x1a')]()[_0x6704('0x1b')](function(){if(_0x49048f[_0x6704('0x1c')]['channel']){if(!_[_0x6704('0x1d')](_0x1752bc,_0x49048f[_0x6704('0x1c')][_0x6704('0x1e')][_0x6704('0x1f')]()))throw new Error(_0x6704('0x20'));_0x31d732=_0x49048f[_0x6704('0x1c')][_0x6704('0x1e')]['toLowerCase']();}var _0x1df6d7=_[_0x6704('0x21')](_0x31d732)+_0x6704('0x22');var _0x59dc43=_['map'](db[_0x1df6d7][_0x6704('0x23')],function(_0x3e183b){return{'name':_0x3e183b[_0x6704('0x24')],'type':_0x3e183b[_0x6704('0x25')][_0x6704('0x26')]};});_0x1e5f6e=qs['getOptions'](_0x59dc43,_0x49048f);if(_0x49048f[_0x6704('0x27')][_0x6704('0x28')]===_0x6704('0x27')){var _0x348fcb={'params':{'id':_0x49048f[_0x6704('0x27')][_0x6704('0x29')]},'query':{'section':_0x31d732===_0x6704('0x19')&&_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')?_0x6704('0x2b'):_[_0x6704('0x21')](_0x31d732)+_0x6704('0x2c'),'type':_0x49048f['query']['type'],'nolimit':!![],'sort':_0x6704('0x11'),'filter':_0x49048f[_0x6704('0x1c')][_0x6704('0x2d')]}};return db[_0x6704('0x2e')]['getResources'](_0x348fcb);}return db[_0x1df6d7][_0x6704('0x2f')](_0x1e5f6e);})[_0x6704('0x1b')](function(_0x5c229d){_0x5adb35['count']=_0x5c229d[_0x6704('0xa')];var _0x5363c9=_0x31d732===_0x6704('0x19')?client:routingClient;return _0x5363c9['request'](_['startCase'](_0x31d732)+_0x6704('0x2c'),_0x49048f)[_0x6704('0x1b')](function(_0x45a286){if(_0x45a286['error'])throw new Error(util[_0x6704('0x30')](_0x6704('0x31'),_0x31d732));var _0x3c8263=_0x45a286[_0x6704('0x32')];var _0x920914=[_0x6704('0x33'),_0x6704('0x34'),_0x6704('0x35'),_0x6704('0x36'),_0x6704('0x37')];if(_0x31d732===_0x6704('0x19')&&_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')){_0x920914[_0x6704('0x38')](_0x6704('0x39'),_0x6704('0x3a'),_0x6704('0x3b'),_0x6704('0x3c'),_0x6704('0x3d'),_0x6704('0x3e'),_0x6704('0x3f'),_0x6704('0x40'),_0x6704('0x41'),_0x6704('0x42'),'erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval',_0x6704('0x43'),_0x6704('0x44'),_0x6704('0x45'),'predictiveIntervalTotalCalls',_0x6704('0x46'),'predictiveIntervalDroppedCallsTimeout',_0x6704('0x47'),_0x6704('0x48'),_0x6704('0x49'));}var _0x18a118=_0x5c229d[_0x6704('0x4a')][_0x6704('0x4b')](function(_0x39d92c){var _0x2fba31=_0x39d92c['get']({'plain':!![]});_0x2fba31['paused']=0x0;_0x2fba31[_0x6704('0x4c')]=0x0;_0x2fba31[_0x6704('0x33')]=0x0;_0x2fba31['available']=0x0;_0x2fba31['paused']=0x0;_0x2fba31[_0x6704('0x35')]=0x0;if(_0x31d732==='voice'){_0x2fba31[_0x6704('0x36')]=0x0;if(_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')){_0x2fba31['pTalking']=0x0;_0x2fba31[_0x6704('0x3a')]=0x0;}}_0x2fba31[_0x6704('0x4d')]=[];var _0x5630b7=_[_0x6704('0x4e')](_0x3c8263['rows'],['id',_0x2fba31['id']]);if(_0x5630b7)_[_0x6704('0x4f')](_0x2fba31,_[_0x6704('0x50')](_0x5630b7,_0x920914));if(_0x31d732===_0x6704('0x19')){return _0x39d92c['getAgents']({'attributes':['id',_0x6704('0x11'),_0x6704('0x51')],'joinTableAttributes':[],'raw':!![]})[_0x6704('0x1b')](function(_0x5c04fe){return _0x39d92c[_0x6704('0x52')]({'raw':!![]})[_0x6704('0x1b')](function(_0x336ef2){for(var _0xf12c3f=0x0;_0xf12c3f<_0x5c04fe['length'];_0xf12c3f++){var _0x29ad03=_['find'](_0x336ef2,[_0x6704('0x53'),_0x5c04fe[_0xf12c3f]['id']]);var _0x45a217={'id':_0x5c04fe[_0xf12c3f]['id'],'name':_0x5c04fe[_0xf12c3f][_0x6704('0x11')],'online':Boolean(_0x5c04fe[_0xf12c3f][_0x6704('0x51')]),'paused':_0x29ad03?Boolean(_0x29ad03['paused']):![]};if(_0x45a217['online'])_0x2fba31['loggedInDb']++;if(_0x45a217[_0x6704('0x37')])_0x2fba31['paused']++;_0x2fba31[_0x6704('0x4d')]['push'](_0x45a217);}return _0x2fba31;});});}else{var _0x3e8e48=_0x6704('0x54')+_['startCase'](_0x31d732)+_0x6704('0x22');var _0x19ddb9=_0x31d732+_0x6704('0x55');return db[_0x3e8e48][_0x6704('0x56')]({'where':{[_[_0x6704('0x21')](_0x31d732)+'QueueId']:_0x39d92c['id']},'raw':!![]})[_0x6704('0x1b')](function(_0x4ff7a8){return db[_0x6704('0x54')][_0x6704('0x56')]({'attributes':['id',_0x6704('0x11'),'online',_0x19ddb9],'where':{'id':_[_0x6704('0x4b')](_0x4ff7a8,'UserId'),'role':_0x6704('0x57')},'raw':!![]});})[_0x6704('0x1b')](function(_0x2ee518){for(var _0x207595=0x0;_0x207595<_0x2ee518[_0x6704('0x58')];_0x207595++){var _0x50f5da={'id':_0x2ee518[_0x207595]['id'],'name':_0x2ee518[_0x207595][_0x6704('0x11')],'online':Boolean(_0x2ee518[_0x207595][_0x6704('0x51')]),'paused':Boolean(_0x2ee518[_0x207595][_0x19ddb9])};if(_0x50f5da['online'])_0x2fba31[_0x6704('0x4c')]++;if(_0x50f5da[_0x6704('0x37')])_0x2fba31[_0x6704('0x37')]++;_0x2fba31[_0x6704('0x4d')][_0x6704('0x38')](_0x50f5da);}return _0x2fba31;});}});return Promise[_0x6704('0x59')](_0x18a118);});})['then'](function(_0x237f59){_0x5adb35['rows']=_0x237f59;return _0x5adb35;})[_0x6704('0x1b')](respondWithFilteredResult(_0x168258,_0x1e5f6e))['catch'](handleError(_0x168258,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6f4309c..43a02b1 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x43ec4f,_0xd438e7){var _0x5c533c=function(_0x455941){while(--_0x455941){_0x43ec4f['push'](_0x43ec4f['shift']());}};_0x5c533c(++_0xd438e7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xcb91[_0x4b6830];return _0x239e4a;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3468d3,_0x5f0f55){var _0x549184=function(_0x11c8a1){while(--_0x11c8a1){_0x3468d3['push'](_0x3468d3['shift']());}};_0x549184(++_0x5f0f55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f05212f..6af8255 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 _0xf446=['sequelize','INTEGER','STRING','DATE'];(function(_0x1dc2e0,_0x1af381){var _0x984108=function(_0x3d5163){while(--_0x3d5163){_0x1dc2e0['push'](_0x1dc2e0['shift']());}};_0x984108(++_0x1af381);}(_0xf446,0x1c0));var _0x6f44=function(_0x3d7b25,_0xa542aa){_0x3d7b25=_0x3d7b25-0x0;var _0x2e1040=_0xf446[_0x3d7b25];return _0x2e1040;};'use strict';var Sequelize=require(_0x6f44('0x0'));module['exports']={'state':{'type':Sequelize[_0x6f44('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6f44('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x6f44('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6f44('0x3')]},'ringtime':{'type':Sequelize[_0x6f44('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6f44('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9fe7=['exports','STRING','DATE','sequelize'];(function(_0x2237e6,_0x28cb0c){var _0x42124e=function(_0x55b6e3){while(--_0x55b6e3){_0x2237e6['push'](_0x2237e6['shift']());}};_0x42124e(++_0x28cb0c);}(_0x9fe7,0x1df));var _0x79fe=function(_0x281022,_0x39a6fe){_0x281022=_0x281022-0x0;var _0x544fd6=_0x9fe7[_0x281022];return _0x544fd6;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x79fe('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x79fe('0x2')]},'starttime':{'type':Sequelize[_0x79fe('0x3')]},'responsetime':{'type':Sequelize[_0x79fe('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x79fe('0x2')]},'campaigntype':{'type':Sequelize[_0x79fe('0x2')]},'membername':{'type':Sequelize[_0x79fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 25f61fc..541ed32 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 _0xe0bf=['request-promise','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','lodash','util','api','moment','bluebird'];(function(_0x497b2c,_0x166fdc){var _0x535805=function(_0xa72825){while(--_0xa72825){_0x497b2c['push'](_0x497b2c['shift']());}};_0x535805(++_0x166fdc);}(_0xe0bf,0xf7));var _0xfe0b=function(_0x19b194,_0x1d3bca){_0x19b194=_0x19b194-0x0;var _0x2465c5=_0xe0bf[_0x19b194];return _0x2465c5;};'use strict';var _=require(_0xfe0b('0x0'));var util=require(_0xfe0b('0x1'));var logger=require('../../config/logger')(_0xfe0b('0x2'));var moment=require(_0xfe0b('0x3'));var BPromise=require(_0xfe0b('0x4'));var rp=require(_0xfe0b('0x5'));var fs=require('fs');var path=require(_0xfe0b('0x6'));var rimraf=require(_0xfe0b('0x7'));var config=require(_0xfe0b('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xfe0b('0x9')]=function(_0x490482,_0x47471e){return _0x490482[_0xfe0b('0xa')](_0xfe0b('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe315=['api','moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x9ae99e,_0x2ac9e7){var _0x281db5=function(_0x44f834){while(--_0x44f834){_0x9ae99e['push'](_0x9ae99e['shift']());}};_0x281db5(++_0x2ac9e7);}(_0xe315,0xdd));var _0x5e31=function(_0x630504,_0x12ec6e){_0x630504=_0x630504-0x0;var _0x41c7d0=_0xe315[_0x630504];return _0x41c7d0;};'use strict';var _=require(_0x5e31('0x0'));var util=require(_0x5e31('0x1'));var logger=require(_0x5e31('0x2'))(_0x5e31('0x3'));var moment=require(_0x5e31('0x4'));var BPromise=require(_0x5e31('0x5'));var rp=require(_0x5e31('0x6'));var fs=require('fs');var path=require(_0x5e31('0x7'));var rimraf=require(_0x5e31('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e31('0x9'));module[_0x5e31('0xa')]=function(_0x47de8a,_0xcaba59){return _0x47de8a[_0x5e31('0xb')](_0x5e31('0xc'),attributes,{'tableName':_0x5e31('0xd'),'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 ba40c47..ccd3d9f 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 _0x7940=['message','result','CreateReportAgentPreview','ReportAgentPreview','options','raw','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x255ce4,_0x336cde){var _0x4843c9=function(_0x95fac7){while(--_0x95fac7){_0x255ce4['push'](_0x255ce4['shift']());}};_0x4843c9(++_0x336cde);}(_0x7940,0x1ee));var _0x0794=function(_0x36f343,_0x23736e){_0x36f343=_0x36f343-0x0;var _0x5cff2e=_0x7940[_0x36f343];return _0x5cff2e;};'use strict';var _=require(_0x0794('0x0'));var util=require('util');var moment=require(_0x0794('0x1'));var BPromise=require(_0x0794('0x2'));var rs=require(_0x0794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0794('0x4'))['db'];var utils=require(_0x0794('0x5'));var logger=require(_0x0794('0x6'))(_0x0794('0x7'));var config=require('../../config/environment');var jayson=require(_0x0794('0x8'));var client=jayson[_0x0794('0x9')][_0x0794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc61194,_0x10b4e9,_0x46f141){return new BPromise(function(_0xbdc4ac,_0x597be5){return client['request'](_0xc61194,_0x46f141)[_0x0794('0xb')](function(_0x46c26a){logger[_0x0794('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x10b4e9,_0x0794('0xd'));logger['debug'](_0x0794('0xe'),_0x10b4e9,_0x0794('0xd'),JSON[_0x0794('0xf')](_0x46c26a));if(_0x46c26a[_0x0794('0x10')]){if(_0x46c26a[_0x0794('0x10')][_0x0794('0x11')]===0x1f4){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0x597be5(_0x46c26a[_0x0794('0x10')]['message']);}logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0xbdc4ac(_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);}else{logger['info'](_0x0794('0x12'),_0x10b4e9,'request\x20sent');_0xbdc4ac(_0x46c26a[_0x0794('0x14')][_0x0794('0x13')]);}})['catch'](function(_0x66d7dd){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x66d7dd);_0x597be5(_0x66d7dd);});});}exports[_0x0794('0x15')]=function(_0x15c1d8){var _0x36696f=this;return new Promise(function(_0x53be9c,_0x23e1eb){return db[_0x0794('0x16')]['create'](_0x15c1d8['body'],{'raw':_0x15c1d8[_0x0794('0x17')]?_0x15c1d8[_0x0794('0x17')][_0x0794('0x18')]===undefined?!![]:![]:!![]})[_0x0794('0xb')](function(_0x2a425a){logger[_0x0794('0xc')]('CreateReportAgentPreview',_0x15c1d8);logger[_0x0794('0x19')](_0x0794('0x15'),_0x15c1d8,JSON[_0x0794('0xf')](_0x2a425a));_0x53be9c(_0x2a425a);})[_0x0794('0x1a')](function(_0x3d7a85){logger[_0x0794('0x10')](_0x0794('0x15'),_0x3d7a85[_0x0794('0x13')],_0x15c1d8);_0x23e1eb(_0x36696f[_0x0794('0x10')](0x1f4,_0x3d7a85[_0x0794('0x13')]));});});}; \ No newline at end of file +var _0xc345=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result','catch','ReportAgentPreview','create','options','CreateReportAgentPreview','lodash','moment','bluebird','../../mysqldb'];(function(_0x4a21d4,_0x10963d){var _0x469f78=function(_0x1a0d75){while(--_0x1a0d75){_0x4a21d4['push'](_0x4a21d4['shift']());}};_0x469f78(++_0x10963d);}(_0xc345,0x173));var _0x5c34=function(_0x1cfba1,_0xceafc){_0x1cfba1=_0x1cfba1-0x0;var _0x4fd6aa=_0xc345[_0x1cfba1];return _0x4fd6aa;};'use strict';var _=require(_0x5c34('0x0'));var util=require('util');var moment=require(_0x5c34('0x1'));var BPromise=require(_0x5c34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c34('0x3'))['db'];var utils=require(_0x5c34('0x4'));var logger=require(_0x5c34('0x5'))(_0x5c34('0x6'));var config=require(_0x5c34('0x7'));var jayson=require(_0x5c34('0x8'));var client=jayson['client'][_0x5c34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27b35f,_0x45a182,_0x28b4aa){return new BPromise(function(_0x8d3329,_0x207ab5){return client[_0x5c34('0xa')](_0x27b35f,_0x28b4aa)[_0x5c34('0xb')](function(_0x4b7381){logger[_0x5c34('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,'request\x20sent');logger['debug'](_0x5c34('0xd'),_0x45a182,'request\x20sent',JSON[_0x5c34('0xe')](_0x4b7381));if(_0x4b7381[_0x5c34('0xf')]){if(_0x4b7381[_0x5c34('0xf')]['code']===0x1f4){logger[_0x5c34('0xf')](_0x5c34('0x10'),_0x45a182,_0x4b7381[_0x5c34('0xf')][_0x5c34('0x11')]);return _0x207ab5(_0x4b7381['error'][_0x5c34('0x11')]);}logger[_0x5c34('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x4b7381['error']['message']);return _0x8d3329(_0x4b7381[_0x5c34('0xf')][_0x5c34('0x11')]);}else{logger[_0x5c34('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x5c34('0x12'));_0x8d3329(_0x4b7381[_0x5c34('0x13')][_0x5c34('0x11')]);}})[_0x5c34('0x14')](function(_0x496d68){logger[_0x5c34('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x496d68);_0x207ab5(_0x496d68);});});}exports['CreateReportAgentPreview']=function(_0x40be64){var _0x299fbb=this;return new Promise(function(_0x53c302,_0xc19d3a){return db[_0x5c34('0x15')][_0x5c34('0x16')](_0x40be64['body'],{'raw':_0x40be64[_0x5c34('0x17')]?_0x40be64['options']['raw']===undefined?!![]:![]:!![]})[_0x5c34('0xb')](function(_0x353794){logger[_0x5c34('0xc')]('CreateReportAgentPreview',_0x40be64);logger['debug'](_0x5c34('0x18'),_0x40be64,JSON[_0x5c34('0xe')](_0x353794));_0x53c302(_0x353794);})[_0x5c34('0x14')](function(_0x3c8c7e){logger[_0x5c34('0xf')](_0x5c34('0x18'),_0x3c8c7e[_0x5c34('0x11')],_0x40be64);_0xc19d3a(_0x299fbb[_0x5c34('0xf')](0x1f4,_0x3c8c7e['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index be05772..f2243bf 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 _0xb5cb=['/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues'];(function(_0xd17b07,_0x44f56e){var _0x398564=function(_0x5d926f){while(--_0x5d926f){_0xd17b07['push'](_0xd17b07['shift']());}};_0x398564(++_0x44f56e);}(_0xb5cb,0x17e));var _0xbb5c=function(_0x179680,_0x20804f){_0x179680=_0x179680-0x0;var _0x5ec304=_0xb5cb[_0x179680];return _0x5ec304;};'use strict';var multer=require(_0xbb5c('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0xbb5c('0x1')]();var auth=require(_0xbb5c('0x2'));var controller=require(_0xbb5c('0x3'));router[_0xbb5c('0x4')](_0xbb5c('0x5'),auth[_0xbb5c('0x6')](),controller['voiceChannels']);router[_0xbb5c('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xbb5c('0x7')]);router[_0xbb5c('0x4')](_0xbb5c('0x8'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xbb5c('0x4')](_0xbb5c('0x9'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0xa')]);router[_0xbb5c('0x4')](_0xbb5c('0xb'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0xc')]);router['get'](_0xbb5c('0xd'),auth[_0xbb5c('0x6')](),controller['mailQueues']);router[_0xbb5c('0x4')](_0xbb5c('0xe'),auth['isAuthenticated'](),controller[_0xbb5c('0xf')]);router['get'](_0xbb5c('0x10'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x11')]);router[_0xbb5c('0x4')]('/sms/queues',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x12')]);router[_0xbb5c('0x4')]('/whatsapp/queues',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x13')]);router[_0xbb5c('0x4')](_0xbb5c('0x14'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x15')]);router[_0xbb5c('0x4')]('/voice/queues/preview/:id',auth[_0xbb5c('0x6')](),controller['voiceQueuesPreview']);router[_0xbb5c('0x4')](_0xbb5c('0x16'),auth[_0xbb5c('0x6')](),controller['voiceQueuesChannels']);router[_0xbb5c('0x4')](_0xbb5c('0x17'),auth['isAuthenticated'](),controller[_0xbb5c('0x18')]);router[_0xbb5c('0x4')](_0xbb5c('0x19'),auth[_0xbb5c('0x6')](),controller['voiceQueuesChannelHangup']);router['get'](_0xbb5c('0x1a'),auth['isAuthenticated'](),controller[_0xbb5c('0x1b')]);router[_0xbb5c('0x4')](_0xbb5c('0x1c'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x1d')]);router[_0xbb5c('0x1e')](_0xbb5c('0x1c'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x1f')]);router[_0xbb5c('0x4')](_0xbb5c('0x20'),auth['isAuthenticated'](),controller[_0xbb5c('0x21')]);router[_0xbb5c('0x4')](_0xbb5c('0x22'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x23')]);router[_0xbb5c('0x4')](_0xbb5c('0x24'),auth['isAuthenticated'](),controller['agents']);router[_0xbb5c('0x1e')](_0xbb5c('0x25'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x26')]);router['get'](_0xbb5c('0x27'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x28')]);router[_0xbb5c('0x4')]('/trunks',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x29')]);router[_0xbb5c('0x4')]('/campaigns',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x2a')]);router[_0xbb5c('0x4')](_0xbb5c('0x2b'),auth['isAuthenticated'](),controller[_0xbb5c('0x2c')]);router[_0xbb5c('0x4')]('/chat/queues/waitinginteractions',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x2d')]);router[_0xbb5c('0x4')]('/mail/queues/waitinginteractions',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x2e')]);router[_0xbb5c('0x4')](_0xbb5c('0x2f'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x30')]);router[_0xbb5c('0x4')](_0xbb5c('0x31'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x32')]);router[_0xbb5c('0x4')](_0xbb5c('0x33'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xbb5c('0x4')](_0xbb5c('0x34'),auth['isAuthenticated'](),controller[_0xbb5c('0x35')]);router[_0xbb5c('0x4')](_0xbb5c('0x36'),auth['isAuthenticated'](),controller[_0xbb5c('0x37')]);router[_0xbb5c('0x38')](_0xbb5c('0x39'),auth['isAuthenticated'](),controller[_0xbb5c('0x3a')]('mail'));router[_0xbb5c('0x4')](_0xbb5c('0x3b'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x3c')]);router[_0xbb5c('0x38')](_0xbb5c('0x3d'),auth[_0xbb5c('0x6')](),controller['queueNotify'](_0xbb5c('0x3e')));router[_0xbb5c('0x4')](_0xbb5c('0x3f'),auth['isAuthenticated'](),controller[_0xbb5c('0x40')]);router[_0xbb5c('0x38')](_0xbb5c('0x41'),auth[_0xbb5c('0x6')](),controller['queueNotify'](_0xbb5c('0x42')));router[_0xbb5c('0x4')](_0xbb5c('0x43'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x44')]);router[_0xbb5c('0x38')](_0xbb5c('0x45'),auth['isAuthenticated'](),controller[_0xbb5c('0x3a')]('openchannel'));router[_0xbb5c('0x4')](_0xbb5c('0x46'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x47')]);router[_0xbb5c('0x38')](_0xbb5c('0x48'),auth['isAuthenticated'](),controller[_0xbb5c('0x3a')](_0xbb5c('0x49')));router['post']('/whatsapp/queues/:id/notify',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x3a')](_0xbb5c('0x4a')));router[_0xbb5c('0x4')]('/sms/queues/:id',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x4b')]);router[_0xbb5c('0x4')]('/whatsapp/queues/:id',auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x4c')]);router[_0xbb5c('0x38')](_0xbb5c('0x4d'),auth[_0xbb5c('0x6')](),controller[_0xbb5c('0x4e')]);module['exports']=router; \ No newline at end of file +var _0x96d2=['/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts'];(function(_0x573542,_0x415977){var _0x27834b=function(_0xbfdf8d){while(--_0xbfdf8d){_0x573542['push'](_0x573542['shift']());}};_0x27834b(++_0x415977);}(_0x96d2,0x10d));var _0x296d=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x96d2[_0x479509];return _0x382da8;};'use strict';var multer=require(_0x296d('0x0'));var util=require('util');var path=require(_0x296d('0x1'));var express=require(_0x296d('0x2'));var router=express['Router']();var auth=require(_0x296d('0x3'));var controller=require(_0x296d('0x4'));router[_0x296d('0x5')](_0x296d('0x6'),auth[_0x296d('0x7')](),controller[_0x296d('0x8')]);router[_0x296d('0x5')](_0x296d('0x9'),auth[_0x296d('0x7')](),controller['voiceChannelMixMonitor']);router[_0x296d('0x5')](_0x296d('0xa'),auth['isAuthenticated'](),controller[_0x296d('0xb')]);router[_0x296d('0x5')]('/voice/queues',auth[_0x296d('0x7')](),controller[_0x296d('0xc')]);router['get'](_0x296d('0xd'),auth[_0x296d('0x7')](),controller['chatQueues']);router[_0x296d('0x5')]('/mail/queues',auth[_0x296d('0x7')](),controller[_0x296d('0xe')]);router[_0x296d('0x5')](_0x296d('0xf'),auth[_0x296d('0x7')](),controller[_0x296d('0x10')]);router[_0x296d('0x5')](_0x296d('0x11'),auth[_0x296d('0x7')](),controller[_0x296d('0x12')]);router[_0x296d('0x5')](_0x296d('0x13'),auth[_0x296d('0x7')](),controller[_0x296d('0x14')]);router['get'](_0x296d('0x15'),auth[_0x296d('0x7')](),controller[_0x296d('0x16')]);router[_0x296d('0x5')](_0x296d('0x17'),auth[_0x296d('0x7')](),controller['faxQueues']);router[_0x296d('0x5')](_0x296d('0x18'),auth[_0x296d('0x7')](),controller[_0x296d('0x19')]);router[_0x296d('0x5')](_0x296d('0x1a'),auth['isAuthenticated'](),controller[_0x296d('0x1b')]);router[_0x296d('0x5')](_0x296d('0x1c'),auth['isAuthenticated'](),controller[_0x296d('0x1d')]);router[_0x296d('0x5')](_0x296d('0x1e'),auth[_0x296d('0x7')](),controller[_0x296d('0x1f')]);router[_0x296d('0x5')](_0x296d('0x20'),auth[_0x296d('0x7')](),controller[_0x296d('0x21')]);router['get'](_0x296d('0x22'),auth[_0x296d('0x7')](),controller[_0x296d('0x23')]);router[_0x296d('0x24')](_0x296d('0x22'),auth[_0x296d('0x7')](),controller[_0x296d('0x25')]);router['get'](_0x296d('0x26'),auth[_0x296d('0x7')](),controller[_0x296d('0x27')]);router[_0x296d('0x5')](_0x296d('0x28'),auth[_0x296d('0x7')](),controller[_0x296d('0x29')]);router[_0x296d('0x5')]('/agents',auth[_0x296d('0x7')](),controller[_0x296d('0x2a')]);router[_0x296d('0x24')](_0x296d('0x2b'),auth[_0x296d('0x7')](),controller['agentCapacity']);router[_0x296d('0x5')](_0x296d('0x2c'),auth['isAuthenticated'](),controller[_0x296d('0x2d')]);router[_0x296d('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0x296d('0x2e')]);router[_0x296d('0x5')](_0x296d('0x2f'),auth[_0x296d('0x7')](),controller[_0x296d('0x30')]);router[_0x296d('0x5')](_0x296d('0x31'),auth[_0x296d('0x7')](),controller[_0x296d('0x32')]);router[_0x296d('0x5')](_0x296d('0x33'),auth[_0x296d('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x34'),auth[_0x296d('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x35'),auth[_0x296d('0x7')](),controller[_0x296d('0x36')]);router['get'](_0x296d('0x37'),auth['isAuthenticated'](),controller[_0x296d('0x38')]);router[_0x296d('0x5')]('/sms/queues/waitinginteractions',auth[_0x296d('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x39'),auth[_0x296d('0x7')](),controller[_0x296d('0x3a')]);router[_0x296d('0x5')](_0x296d('0x3b'),auth[_0x296d('0x7')](),controller[_0x296d('0x3c')]);router[_0x296d('0x3d')](_0x296d('0x3e'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')]('mail'));router['get'](_0x296d('0x40'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x296d('0x3d')](_0x296d('0x41'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')](_0x296d('0x42')));router['get']('/chat/queues/:id',auth[_0x296d('0x7')](),controller[_0x296d('0x43')]);router[_0x296d('0x3d')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x296d('0x44')));router[_0x296d('0x5')](_0x296d('0x45'),auth[_0x296d('0x7')](),controller['showFaxQueues']);router[_0x296d('0x3d')]('/openchannel/queues/:id/notify',auth[_0x296d('0x7')](),controller[_0x296d('0x3f')](_0x296d('0x46')));router[_0x296d('0x5')](_0x296d('0x47'),auth[_0x296d('0x7')](),controller[_0x296d('0x48')]);router[_0x296d('0x3d')](_0x296d('0x49'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')]('sms'));router[_0x296d('0x3d')](_0x296d('0x4a'),auth['isAuthenticated'](),controller[_0x296d('0x3f')]('whatsapp'));router[_0x296d('0x5')]('/sms/queues/:id',auth[_0x296d('0x7')](),controller[_0x296d('0x4b')]);router[_0x296d('0x5')](_0x296d('0x4c'),auth[_0x296d('0x7')](),controller['showWhatsappQueues']);router['post'](_0x296d('0x4d'),auth[_0x296d('0x7')](),controller[_0x296d('0x4e')]);module[_0x296d('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5b20da4..30be244 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 _0xeec6=['YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','SIP/%s','interface'];(function(_0x46d281,_0x3404cd){var _0x5db1b6=function(_0x3668e9){while(--_0x3668e9){_0x46d281['push'](_0x46d281['shift']());}};_0x5db1b6(++_0x3404cd);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2aeca6,_0x565154){_0x2aeca6=_0x2aeca6-0x0;var _0x48c8c9=_0xeec6[_0x2aeca6];return _0x48c8c9;};'use strict';var BPromise=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var _=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var jayson=require(_0x6eec('0x6'));var amiClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232a});var mailClient=jayson[_0x6eec('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){var _0x56e849=_0x1c810e?_0x1c810e:amiClient;return _0x56e849[_0x6eec('0x9')](_0x48064a,_0x5a5e47)[_0x6eec('0xa')](function(_0x1c774d){if(_0x1c774d['error']){if(_0x1c774d['error']['code']===0x1f4){return _0x834c2(_0x1c774d[_0x6eec('0xb')][_0x6eec('0xc')]);}return _0x3443c2(_0x1c774d['error']['message']);}else{_0x3443c2(_0x1c774d[_0x6eec('0xd')]);}})['catch'](function(_0x3091d0){_0x834c2(_0x3091d0);});});}function respondWithResult(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xc8;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0xe')](_0x162db1)['json'](_0x3fe94b);}return _0x3387c2[_0x6eec('0xf')](0x194);};}function handleError(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0x1f4;return function(_0xc35914){logger[_0x6eec('0xb')](_0xc35914[_0x6eec('0x10')]);if(_0xc35914[_0x6eec('0x11')]){delete _0xc35914[_0x6eec('0x11')];}_0x3b2972[_0x6eec('0xe')](_0x462dbb)[_0x6eec('0x12')](_0xc35914);};}function findById(_0x5e2a9b){return function(_0x3c0c1b){if(!_['isNil'](_0x5e2a9b)&&!_[_0x6eec('0x13')](_0x3c0c1b)&&!_[_0x6eec('0x13')](_0x3c0c1b['rows'])){return _[_0x6eec('0x14')](_0x3c0c1b[_0x6eec('0x15')],function(_0xb1eab7){return _0xb1eab7['id']==_0x5e2a9b;});}return null;};}exports['voiceChannels']=function(_0x87f3be,_0x1ed94c){return respondWithRpcPromise(_0x6eec('0x16'),_0x87f3be[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1ed94c,null))[_0x6eec('0x18')](handleError(_0x1ed94c,null));};exports['voiceChannelMixMonitor']=function(_0x328693,_0x2f843e){return respondWithRpcPromise(_0x6eec('0x19'),_[_0x6eec('0x1a')](_0x328693[_0x6eec('0x17')],_0x328693[_0x6eec('0x1b')]))['then'](respondWithResult(_0x2f843e,null))[_0x6eec('0x18')](handleError(_0x2f843e,null));};exports[_0x6eec('0x1c')]=function(_0x285d41,_0x27785a){return respondWithRpcPromise(_0x6eec('0x1d'),_[_0x6eec('0x1a')](_0x285d41['query'],_0x285d41[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x27785a,null))[_0x6eec('0x18')](handleError(_0x27785a,null));};exports[_0x6eec('0x1e')]=function(_0x1d2be9,_0x1f386c){return respondWithRpcPromise(_0x6eec('0x1f'),_0x1d2be9[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1f386c,null))['catch'](handleError(_0x1f386c,null));};exports[_0x6eec('0x20')]=function(_0x44b31c,_0x30eb98){return respondWithRpcPromise(_0x6eec('0x1f'),_0x44b31c['query'])[_0x6eec('0xa')](findById(_0x44b31c[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0x30eb98,null))['catch'](handleError(_0x30eb98,null));};exports[_0x6eec('0x21')]=function(_0x47ed95,_0x20a130){return respondWithRpcPromise(_0x6eec('0x22'),_[_0x6eec('0x1a')](_0x47ed95[_0x6eec('0x23')],_0x47ed95[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x20a130,null))[_0x6eec('0x18')](handleError(_0x20a130,null));};exports[_0x6eec('0x24')]=function(_0x1abd19,_0x414f5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6eec('0x1a')](_0x1abd19['query'],_0x1abd19[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x414f5b,null))[_0x6eec('0x18')](handleError(_0x414f5b,null));};exports['voiceQueuesChannels']=function(_0x57b40b,_0x508735){return respondWithRpcPromise(_0x6eec('0x25'),_0x57b40b[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x508735,null))[_0x6eec('0x18')](handleError(_0x508735,null));};exports[_0x6eec('0x26')]=function(_0x23547d,_0x22e0cb){return respondWithRpcPromise(_0x6eec('0x27'),_[_0x6eec('0x1a')](_0x23547d[_0x6eec('0x17')],_0x23547d[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x22e0cb,null))['catch'](handleError(_0x22e0cb,null));};exports[_0x6eec('0x28')]=function(_0x361ab7,_0x2c83d1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x6eec('0x1a')](_0x361ab7[_0x6eec('0x17')],_0x361ab7[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x2c83d1,null))[_0x6eec('0x18')](handleError(_0x2c83d1,null));};exports[_0x6eec('0x29')]=function(_0x4a7699,_0x45cfb6){return respondWithRpcPromise(_0x6eec('0x2a'),_[_0x6eec('0x1a')](_0x4a7699['query'],_0x4a7699['params']))[_0x6eec('0xa')](respondWithResult(_0x45cfb6,null))[_0x6eec('0x18')](handleError(_0x45cfb6,null));};exports[_0x6eec('0x2b')]=function(_0x3f79d1,_0x402bac){return respondWithRpcPromise('Outbound',_0x3f79d1[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x402bac,null))[_0x6eec('0x18')](handleError(_0x402bac,null));};exports[_0x6eec('0x2c')]=function(_0x15918c,_0x2be999){return respondWithRpcPromise(_0x6eec('0x2d'),_0x15918c[_0x6eec('0x17')])['then'](respondWithResult(_0x2be999,null))[_0x6eec('0x18')](handleError(_0x2be999,null));};exports[_0x6eec('0x2e')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0;return respondWithRpcPromise(_0x6eec('0x2f'),_0x4d30c9[_0x6eec('0x17')])[_0x6eec('0xa')](function(_0x4cb50e){_0x160fc0=_0x4cb50e;return respondWithRpcPromise('Agents',_0x4d30c9[_0x6eec('0x17')],routingClient);})['then'](function(_0x5ac8b2){return _[_0x6eec('0x1a')]({},_0x5ac8b2,_0x160fc0);})[_0x6eec('0xa')](respondWithResult(_0x5b3283,null))[_0x6eec('0x18')](handleError(_0x5b3283,null));};exports[_0x6eec('0x30')]=function(_0x25d3f3,_0x58dfe7){if(_0x25d3f3[_0x6eec('0x23')]&&_0x25d3f3[_0x6eec('0x23')]['interaction']&&_0x25d3f3[_0x6eec('0x31')]&&_0x25d3f3[_0x6eec('0x31')]['name']){for(var _0x2d39bf in _0x25d3f3[_0x6eec('0x23')]['interaction']){if(_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x6eec('0x33')](_0x2d39bf)){db[_0x6eec('0x34')]['findAll']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'type':_0x6eec('0x35'),'exitAt':null,'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]&&_0x25d3f3['body']['interaction'][_0x2d39bf][_0x6eec('0x36')]?{'$notIn':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]}:{'$ne':null}}})[_0x6eec('0xa')](function(_0x44c7b8){var _0x59d7a7=moment()[_0x6eec('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20524a=0x0,_0x408295=_0x44c7b8[_0x6eec('0x36')];_0x20524a<_0x408295;_0x20524a+=0x1){_0x44c7b8[_0x20524a]['updateAttributes']({'exitAt':_0x59d7a7});}});for(var _0x2b83f2=0x0;_0x2b83f2<_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x6eec('0x36')];_0x2b83f2+=0x1){db[_0x6eec('0x34')]['findOrCreate']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')]['name'],'type':'INTERACTION','uniqueid':_0x25d3f3[_0x6eec('0x23')]['interaction'][_0x2d39bf][_0x2b83f2],'exitAt':null},'defaults':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'interface':_[_0x6eec('0x13')](_0x25d3f3['user']['interface'])?util[_0x6eec('0x37')](_0x6eec('0x38'),_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')]):_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x39')],'type':_0x6eec('0x35'),'enterAt':moment()[_0x6eec('0x37')](_0x6eec('0x3a')),'role':_0x6eec('0x3b'),'internal':_0x25d3f3['user']['internal'],'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x2b83f2]}});}}}}return respondWithRpcPromise(_0x6eec('0x3c'),{'id':_0x25d3f3['params']['id'],'capacity':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x3d')]},routingClient)[_0x6eec('0xa')](respondWithResult(_0x58dfe7,null))[_0x6eec('0x18')](handleError(_0x58dfe7,null));};exports[_0x6eec('0x3e')]=function(_0x43f77a,_0x10c10a){return respondWithRpcPromise(_0x6eec('0x3f'),_0x43f77a['query'])[_0x6eec('0xa')](respondWithResult(_0x10c10a,null))[_0x6eec('0x18')](handleError(_0x10c10a,null));};exports[_0x6eec('0x40')]=function(_0x3e77f3,_0x490d27){return respondWithRpcPromise('Trunks',_0x3e77f3['query'])[_0x6eec('0xa')](respondWithResult(_0x490d27,null))[_0x6eec('0x18')](handleError(_0x490d27,null));};exports[_0x6eec('0x41')]=function(_0x1de626,_0x5178f5){return respondWithRpcPromise('Campaigns',_0x1de626[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x5178f5,null))[_0x6eec('0x18')](handleError(_0x5178f5,null));};exports['chatQueues']=function(_0x238605,_0x35f411){return respondWithRpcPromise(_0x6eec('0x42'),_0x238605[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x35f411,null))[_0x6eec('0x18')](handleError(_0x35f411,null));};exports[_0x6eec('0x43')]=function(_0x19fe55,_0x45fed3){return respondWithRpcPromise('ChatQueues',_0x19fe55[_0x6eec('0x17')],routingClient)['then'](findById(_0x19fe55[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x45fed3,null))[_0x6eec('0x18')](handleError(_0x45fed3,null));};exports[_0x6eec('0x44')]=function(_0x248d76,_0x360176){return respondWithRpcPromise(_0x6eec('0x45'),_0x248d76['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x360176,null))['catch'](handleError(_0x360176,null));};exports[_0x6eec('0x46')]=function(_0x5c905f,_0x237324){return respondWithRpcPromise(_0x6eec('0x45'),_0x5c905f[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5c905f[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x237324,null))[_0x6eec('0x18')](handleError(_0x237324,null));};exports[_0x6eec('0x47')]=function(_0x130002,_0x4114d1){return respondWithRpcPromise('MailAccounts',_0x130002['query'],mailClient)[_0x6eec('0xa')](respondWithResult(_0x4114d1,null))[_0x6eec('0x18')](handleError(_0x4114d1,null));};exports[_0x6eec('0x48')]=function(_0x2c0644,_0x20b040){return respondWithRpcPromise('OpenchannelQueues',_0x2c0644[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x20b040,null))['catch'](handleError(_0x20b040,null));};exports['showOpenchannelQueues']=function(_0x5dc8b3,_0xaa2a15){return respondWithRpcPromise(_0x6eec('0x49'),_0x5dc8b3['query'],routingClient)[_0x6eec('0xa')](findById(_0x5dc8b3[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0xaa2a15,null))[_0x6eec('0x18')](handleError(_0xaa2a15,null));};exports[_0x6eec('0x4a')]=function(_0xc852b3,_0x3c1f77){return respondWithRpcPromise('SmsQueues',_0xc852b3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x3c1f77,null))[_0x6eec('0x18')](handleError(_0x3c1f77,null));};exports[_0x6eec('0x4b')]=function(_0x19ca46,_0x34c4b4){return respondWithRpcPromise(_0x6eec('0x4c'),_0x19ca46[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x19ca46[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x34c4b4,null))[_0x6eec('0x18')](handleError(_0x34c4b4,null));};exports[_0x6eec('0x4d')]=function(_0x2799ca,_0x386a67){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2799ca[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x386a67,null))['catch'](handleError(_0x386a67,null));};exports[_0x6eec('0x4f')]=function(_0x2236f7,_0x48bb52){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2236f7[_0x6eec('0x17')],routingClient)['then'](findById(_0x2236f7[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x48bb52,null))[_0x6eec('0x18')](handleError(_0x48bb52,null));};exports[_0x6eec('0x50')]=function(_0x4c73f2,_0x40a81a){return respondWithRpcPromise(_0x6eec('0x51'),_0x4c73f2[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x40a81a,null))[_0x6eec('0x18')](handleError(_0x40a81a,null));};exports[_0x6eec('0x52')]=function(_0x5ae0a0,_0x1ed47e){return respondWithRpcPromise('FaxQueues',_0x5ae0a0[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5ae0a0[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x1ed47e,null))[_0x6eec('0x18')](handleError(_0x1ed47e,null));};exports[_0x6eec('0x53')]=function(_0x404b64,_0x2ea7fe){return respondWithRpcPromise(_0x6eec('0x54'),_0x404b64['query'])[_0x6eec('0xa')](respondWithResult(_0x2ea7fe,null))[_0x6eec('0x18')](handleError(_0x2ea7fe,null));};exports[_0x6eec('0x55')]=function(_0x4eef6e,_0x19f8e2){return respondWithRpcPromise(_0x6eec('0x56'),_0x4eef6e['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x19f8e2,null))[_0x6eec('0x18')](handleError(_0x19f8e2,null));};exports[_0x6eec('0x57')]=function(_0x18e62b,_0x266689){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18e62b[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x266689,null))[_0x6eec('0x18')](handleError(_0x266689,null));};exports[_0x6eec('0x58')]=function(_0x3894dc,_0x56483b){return respondWithRpcPromise(_0x6eec('0x59'),_0x3894dc[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x56483b,null))[_0x6eec('0x18')](handleError(_0x56483b,null));};exports[_0x6eec('0x5a')]=function(_0x232b3a,_0x7dd5d1){return respondWithRpcPromise(_0x6eec('0x59'),_0x232b3a['query'],routingClient)[_0x6eec('0xa')](function(_0x59341a){if(_0x232b3a[_0x6eec('0x17')][_0x6eec('0x5b')]!==undefined){var _0x7a7288=_(_0x59341a[_0x6eec('0x15')])['filter']([_0x232b3a[_0x6eec('0x17')]['type'],_0x232b3a[_0x6eec('0x1b')]['id']])[_0x6eec('0x5c')](_0x6eec('0x5d'))[_0x6eec('0x5e')]()['value']();return _0x59341a['rows']['filter'](function(_0x1158b1){return _0x7a7288[_0x6eec('0x5f')](_0x1158b1[_0x6eec('0x5d')])>-0x1;});}else{return _0x59341a[_0x6eec('0x15')]['filter'](function(_0x44302a){return _0x44302a['queue_id']===parseInt(_0x232b3a[_0x6eec('0x1b')]['id']);});}})[_0x6eec('0xa')](respondWithResult(_0x7dd5d1,null))['catch'](handleError(_0x7dd5d1,null));};exports[_0x6eec('0x60')]=function(_0x2f9e8a,_0x333280){return respondWithRpcPromise(_0x6eec('0x61'),_0x2f9e8a[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x333280,null))['catch'](handleError(_0x333280,null));};exports[_0x6eec('0x62')]=function(_0x5aa2f3,_0x64c2ef){return respondWithRpcPromise(_0x6eec('0x63'),_0x5aa2f3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x64c2ef,null))['catch'](handleError(_0x64c2ef,null));};exports[_0x6eec('0x64')]=function(_0x1d1683,_0x8a4166){return respondWithRpcPromise(_0x6eec('0x65'),_0x1d1683['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x8a4166,null))['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x66')]=function(_0x2c0a85){return function(_0x51560c,_0x3dcf9d){var _0x435562,_0x3a90cd;var _0x328f28=_[_0x6eec('0x67')](_0x2c0a85);var _0x514e15=_0x2c0a85===_0x6eec('0x68')?_0x6eec('0x69'):_0x6eec('0x6a');return db[_0x328f28+_0x6eec('0x6b')][_0x6eec('0x6c')]({'raw':!![],'where':{'id':_0x51560c[_0x6eec('0x1b')]['id']}})['then'](function(_0x4a3af3){if(_[_0x6eec('0x13')](_0x4a3af3)){throw new Error(_0x328f28+_0x6eec('0x6d'));}_0x435562=_0x4a3af3;return db[_0x328f28+'Message']['findOne']({'where':{'id':_0x51560c[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0x328f28+'Interaction'],'as':_0x6eec('0x6f')},{'model':db[_0x328f28+_0x514e15],'as':_0x6eec('0x6a')}]});})[_0x6eec('0xa')](function(_0x5042a0){if(_[_0x6eec('0x13')](_0x5042a0)){throw new Error(_0x328f28+'\x20Message\x20not\x20found');}_0x3a90cd=_0x5042a0;return _0x5042a0[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6eec('0xa')](function(){var _0x585432={'uniqueid':_0x2c0a85+'.'+_0x3a90cd['id']+'.'+_0x3a90cd[_0x6eec('0x6f')]['id'],'FromUserId':_0x51560c[_0x6eec('0x31')]['id'],'type':_0x6eec('0x71')};_0x585432[_0x328f28+'MessageId']=_0x3a90cd['id'];_0x585432[_0x328f28+_0x6eec('0x72')]=_0x3a90cd[_0x6eec('0x6f')]['id'];_0x585432[_0x6eec('0x73')+_0x328f28+_0x514e15+'Id']=_0x3a90cd[_0x6eec('0x6a')]['id'];_0x585432['To'+_0x328f28+_0x6eec('0x74')]=_0x435562['id'];return db[_0x328f28+_0x6eec('0x75')]['create'](_0x585432);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0x2c0a85,'interaction':_0x3a90cd[_0x6eec('0x6f')],'message':_0x3a90cd,'account':_0x3a90cd[_0x6eec('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6eec('0x71'),'appdata':_0x435562[_0x6eec('0x11')]+','+(_0x3a90cd[_0x6eec('0x6a')][_0x6eec('0x77')]||0x12c),'interval':_0x6eec('0x78')}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x3dcf9d,null))[_0x6eec('0x18')](handleError(_0x3dcf9d,null));};};exports[_0x6eec('0x79')]=function(_0x56043a,_0x1419e0){var _0x1d6604,_0x10fad1;if(_[_0x6eec('0x13')](_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')])){throw new Error(_0x6eec('0x7b'));}var _0xa94ada=_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')];var _0xaddba4=_[_0x6eec('0x67')](_0xa94ada);var _0x89aace=_0xa94ada===_0x6eec('0x68')?_0x6eec('0x69'):'Account';return db[_0x6eec('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x56043a[_0x6eec('0x1b')]['id'],'role':_0x6eec('0x3b')}})[_0x6eec('0xa')](function(_0x2607ca){if(_['isNil'](_0x2607ca)){throw new Error(_0x6eec('0x7d'));}_0x1d6604=_0x2607ca;return db[_0xaddba4+'Message'][_0x6eec('0x6c')]({'where':{'id':_0x56043a[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0xaddba4+_0x6eec('0x6f')],'as':_0x6eec('0x6f')},{'model':db[_0xaddba4+_0x89aace],'as':_0x6eec('0x6a')}]});})['then'](function(_0x2888f4){if(_[_0x6eec('0x13')](_0x2888f4)){throw new Error(_0xaddba4+_0x6eec('0x7e'));}_0x10fad1=_0x2888f4;return _0x2888f4[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5229db={'uniqueid':_0xa94ada+'.'+_0x10fad1['id']+'.'+_0x10fad1[_0x6eec('0x6f')]['id'],'FromUserId':_0x56043a[_0x6eec('0x31')]['id'],'type':'queue','ToUserId':_0x1d6604['id']};_0x5229db[_0xaddba4+'MessageId']=_0x10fad1['id'];_0x5229db[_0xaddba4+_0x6eec('0x72')]=_0x10fad1[_0x6eec('0x6f')]['id'];_0x5229db['From'+_0xaddba4+_0x89aace+'Id']=_0x10fad1[_0x6eec('0x6a')]['id'];return db[_0xaddba4+_0x6eec('0x75')]['create'](_0x5229db);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0xa94ada,'interaction':_0x10fad1[_0x6eec('0x6f')],'message':_0x10fad1,'account':_0x10fad1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1d6604['name']+','+(_0x10fad1[_0x6eec('0x6a')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x1419e0,null))['catch'](handleError(_0x1419e0,null));}; \ No newline at end of file +var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x3da41e,_0x2ce6a3){var _0x147480=function(_0x47c3d3){while(--_0x47c3d3){_0x3da41e['push'](_0x3da41e['shift']());}};_0x147480(++_0x2ce6a3);}(_0x6f47,0xc7));var _0x76f4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x6f47[_0xd1d19a];return _0x52a79d;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ae0d43e..4c5b9b7 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 _0x734f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','index','get','/:id','show','/:id/run','run','post','isAuthenticated','create','put','update','delete','exports','util','path','express','Router'];(function(_0x5ea24f,_0x3bd868){var _0x112afb=function(_0x530fda){while(--_0x530fda){_0x5ea24f['push'](_0x5ea24f['shift']());}};_0x112afb(++_0x3bd868);}(_0x734f,0x6a));var _0xf734=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x734f[_0x967959];return _0x5c4489;};'use strict';var multer=require('multer');var util=require(_0xf734('0x0'));var path=require(_0xf734('0x1'));var timeout=require('connect-timeout');var express=require(_0xf734('0x2'));var router=express[_0xf734('0x3')]();var fs_extra=require(_0xf734('0x4'));var auth=require(_0xf734('0x5'));var interaction=require(_0xf734('0x6'));var config=require(_0xf734('0x7'));var controller=require(_0xf734('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf734('0x9')]);router[_0xf734('0xa')](_0xf734('0xb'),auth['isAuthenticated'](),controller[_0xf734('0xc')]);router['get'](_0xf734('0xd'),auth['isAuthenticated'](),controller[_0xf734('0xe')]);router[_0xf734('0xf')]('/',auth[_0xf734('0x10')](),controller[_0xf734('0x11')]);router[_0xf734('0x12')](_0xf734('0xb'),auth[_0xf734('0x10')](),controller[_0xf734('0x13')]);router[_0xf734('0x14')](_0xf734('0xb'),auth[_0xf734('0x10')](),controller['destroy']);module[_0xf734('0x15')]=router; \ No newline at end of file +var _0xd4f4=['destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','put'];(function(_0x354df6,_0x4fb714){var _0x3b8676=function(_0x5a0296){while(--_0x5a0296){_0x354df6['push'](_0x354df6['shift']());}};_0x3b8676(++_0x4fb714);}(_0xd4f4,0x1b1));var _0x4d4f=function(_0x582220,_0x56d24b){_0x582220=_0x582220-0x0;var _0x555614=_0xd4f4[_0x582220];return _0x555614;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require('util');var path=require(_0x4d4f('0x1'));var timeout=require(_0x4d4f('0x2'));var express=require(_0x4d4f('0x3'));var router=express[_0x4d4f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4d4f('0x5'));var config=require(_0x4d4f('0x6'));var controller=require(_0x4d4f('0x7'));router['get']('/',auth[_0x4d4f('0x8')](),controller[_0x4d4f('0x9')]);router[_0x4d4f('0xa')](_0x4d4f('0xb'),auth['isAuthenticated'](),controller[_0x4d4f('0xc')]);router[_0x4d4f('0xa')](_0x4d4f('0xd'),auth['isAuthenticated'](),controller[_0x4d4f('0xe')]);router[_0x4d4f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4d4f('0x10')]('/:id',auth[_0x4d4f('0x8')](),controller['update']);router['delete']('/:id',auth[_0x4d4f('0x8')](),controller[_0x4d4f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 7340115..3b5db80 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 _0x4f45=['BOOLEAN','TEXT','sequelize','exports','STRING','DATE','INTEGER','ENUM','years','months','weeks','days','hours','minutes','csv','xlsx','custom'];(function(_0x518e9c,_0x33d1b8){var _0x4faa2b=function(_0x5d4c96){while(--_0x5d4c96){_0x518e9c['push'](_0x518e9c['shift']());}};_0x4faa2b(++_0x33d1b8);}(_0x4f45,0x112));var _0x54f4=function(_0x1867d5,_0x4b7d7a){_0x1867d5=_0x1867d5-0x0;var _0x3d0691=_0x4f45[_0x1867d5];return _0x3d0691;};'use strict';var Sequelize=require(_0x54f4('0x0'));module[_0x54f4('0x1')]={'name':{'type':Sequelize[_0x54f4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x54f4('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x54f4('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x54f4('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x54f4('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x54f4('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x54f4('0x5')](_0x54f4('0x6'),'quarters',_0x54f4('0x7'),_0x54f4('0x8'),_0x54f4('0x9'),_0x54f4('0xa'),_0x54f4('0xb')),'allowNull':![],'defaultValue':_0x54f4('0x9')},'output':{'type':Sequelize[_0x54f4('0x5')](_0x54f4('0xc'),'pdf',_0x54f4('0xd')),'allowNull':![],'defaultValue':_0x54f4('0xc')},'type':{'type':Sequelize[_0x54f4('0x5')](_0x54f4('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x54f4('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x54f4('0x2')]},'cc':{'type':Sequelize[_0x54f4('0x10')]},'bcc':{'type':Sequelize[_0x54f4('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xed05=['csv','xlsx','default','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','ENUM','years','weeks','days','minutes'];(function(_0x154a2b,_0x253064){var _0x3bdb5f=function(_0x1cfe46){while(--_0x1cfe46){_0x154a2b['push'](_0x154a2b['shift']());}};_0x3bdb5f(++_0x253064);}(_0xed05,0x75));var _0x5ed0=function(_0x1704e5,_0x160461){_0x1704e5=_0x1704e5-0x0;var _0x5328f3=_0xed05[_0x1704e5];return _0x5328f3;};'use strict';var Sequelize=require(_0x5ed0('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ed0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5ed0('0x1')]},'active':{'type':Sequelize[_0x5ed0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5ed0('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x5ed0('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5ed0('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5ed0('0x4')](_0x5ed0('0x5'),'quarters','months',_0x5ed0('0x6'),_0x5ed0('0x7'),'hours',_0x5ed0('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x5ed0('0x4')](_0x5ed0('0x9'),'pdf',_0x5ed0('0xa')),'allowNull':![],'defaultValue':_0x5ed0('0x9')},'type':{'type':Sequelize['ENUM']('custom',_0x5ed0('0xb')),'allowNull':![],'defaultValue':_0x5ed0('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x5ed0('0xd')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x5ed0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6eda737..700d517 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 _0xc020=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','create','body','user','get','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x19e8ee,_0x4a03cb){var _0x20bfd8=function(_0x3418ba){while(--_0x3418ba){_0x19e8ee['push'](_0x19e8ee['shift']());}};_0x20bfd8(++_0x4a03cb);}(_0xc020,0x1db));var _0x0c02=function(_0xc4ea75,_0x273753){_0xc4ea75=_0xc4ea75-0x0;var _0x52ea5e=_0xc020[_0xc4ea75];return _0x52ea5e;};'use strict';var emlformat=require(_0x0c02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c02('0x2'));var moment=require(_0x0c02('0x3'));var BPromise=require(_0x0c02('0x4'));var Mustache=require('mustache');var util=require(_0x0c02('0x5'));var path=require(_0x0c02('0x6'));var sox=require(_0x0c02('0x7'));var csv=require(_0x0c02('0x8'));var ejs=require(_0x0c02('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c02('0xa'));var squel=require(_0x0c02('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c02('0xc'));var deskjs=require(_0x0c02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0c02('0xe'));var Papa=require(_0x0c02('0xf'));var Redis=require(_0x0c02('0x10'));var authService=require(_0x0c02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0c02('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c02('0x13'))('api');var utils=require(_0x0c02('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0c02('0x15'));var db=require(_0x0c02('0x16'))['db'];function respondWithStatusCode(_0x113891,_0xe7c3bf){_0xe7c3bf=_0xe7c3bf||0xcc;return function(_0x56deb0){if(_0x56deb0){return _0x113891[_0x0c02('0x17')](_0xe7c3bf);}return _0x113891[_0x0c02('0x18')](_0xe7c3bf)[_0x0c02('0x19')]();};}function respondWithResult(_0x7cdf3,_0x248e59){_0x248e59=_0x248e59||0xc8;return function(_0x4e2f04){if(_0x4e2f04){return _0x7cdf3[_0x0c02('0x18')](_0x248e59)[_0x0c02('0x1a')](_0x4e2f04);}};}function respondWithFilteredResult(_0x54f301,_0x12c245){return function(_0x54e902){if(_0x54e902){var _0x2f9d3a=typeof _0x12c245[_0x0c02('0x1b')]===_0x0c02('0x1c')&&typeof _0x12c245[_0x0c02('0x1d')]===_0x0c02('0x1c');var _0x493640=_0x54e902[_0x0c02('0x1e')];var _0x399a6a=_0x2f9d3a?0x0:_0x12c245[_0x0c02('0x1b')];var _0x410b32=_0x2f9d3a?_0x54e902[_0x0c02('0x1e')]:_0x12c245[_0x0c02('0x1b')]+_0x12c245[_0x0c02('0x1d')];var _0x157412;if(_0x410b32>=_0x493640){_0x410b32=_0x493640;_0x157412=0xc8;}else{_0x157412=0xce;}_0x54f301[_0x0c02('0x18')](_0x157412);return _0x54f301['set'](_0x0c02('0x1f'),_0x399a6a+'-'+_0x410b32+'/'+_0x493640)['json'](_0x54e902);}return null;};}function patchUpdates(_0x472513){return function(_0x271ff4){try{jsonpatch['apply'](_0x271ff4,_0x472513,!![]);}catch(_0x5d20a0){return BPromise[_0x0c02('0x20')](_0x5d20a0);}return _0x271ff4[_0x0c02('0x21')]();};}function saveUpdates(_0x3f497e,_0x488543){return function(_0x4a7972){if(_0x4a7972){return _0x4a7972[_0x0c02('0x22')](_0x3f497e)[_0x0c02('0x23')](function(_0x2316a1){return _0x2316a1;});}return null;};}function removeEntity(_0x467a8a,_0x557ee5){return function(_0x25bbe4){if(_0x25bbe4){return _0x25bbe4[_0x0c02('0x24')]()[_0x0c02('0x23')](function(){var _0x30bc33=_0x25bbe4['get']({'plain':!![]});var _0x22feba=_0x0c02('0x25');return db[_0x0c02('0x26')]['destroy']({'where':{'type':_0x22feba,'resourceId':_0x30bc33['id']}})[_0x0c02('0x23')](function(){return _0x25bbe4;});})[_0x0c02('0x23')](function(){_0x467a8a[_0x0c02('0x18')](0xcc)[_0x0c02('0x19')]();});}};}function handleEntityNotFound(_0x47944e,_0x2ec298){return function(_0x55c4a8){if(!_0x55c4a8){_0x47944e['sendStatus'](0x194);}return _0x55c4a8;};}function handleError(_0x55884f,_0x122a4e){_0x122a4e=_0x122a4e||0x1f4;return function(_0x40a236){logger[_0x0c02('0x27')](_0x40a236[_0x0c02('0x28')]);if(_0x40a236[_0x0c02('0x29')]){delete _0x40a236['name'];}_0x55884f[_0x0c02('0x18')](_0x122a4e)[_0x0c02('0x2a')](_0x40a236);};}exports[_0x0c02('0x2b')]=function(_0x1f8601,_0x561b27){var _0x2900f0={},_0x3ad768={},_0x58cfc4={'count':0x0,'rows':[]};var _0x3c2d1c=_[_0x0c02('0x2c')](db[_0x0c02('0x2d')][_0x0c02('0x2e')],function(_0x2b520c){return{'name':_0x2b520c[_0x0c02('0x2f')],'type':_0x2b520c[_0x0c02('0x30')][_0x0c02('0x31')]};});_0x3ad768[_0x0c02('0x32')]=_[_0x0c02('0x2c')](_0x3c2d1c,'name');_0x3ad768[_0x0c02('0x33')]=_['keys'](_0x1f8601[_0x0c02('0x33')]);_0x3ad768[_0x0c02('0x34')]=_[_0x0c02('0x35')](_0x3ad768[_0x0c02('0x32')],_0x3ad768['query']);_0x2900f0[_0x0c02('0x36')]=_[_0x0c02('0x35')](_0x3ad768[_0x0c02('0x32')],qs['fields'](_0x1f8601[_0x0c02('0x33')][_0x0c02('0x37')]));_0x2900f0[_0x0c02('0x36')]=_0x2900f0['attributes'][_0x0c02('0x38')]?_0x2900f0[_0x0c02('0x36')]:_0x3ad768[_0x0c02('0x32')];if(!_0x1f8601[_0x0c02('0x33')]['hasOwnProperty'](_0x0c02('0x39'))){_0x2900f0[_0x0c02('0x1d')]=qs['limit'](_0x1f8601[_0x0c02('0x33')][_0x0c02('0x1d')]);_0x2900f0['offset']=qs[_0x0c02('0x1b')](_0x1f8601[_0x0c02('0x33')][_0x0c02('0x1b')]);}_0x2900f0[_0x0c02('0x3a')]=qs['sort'](_0x1f8601[_0x0c02('0x33')]['sort']);_0x2900f0['where']=qs[_0x0c02('0x34')](_['pick'](_0x1f8601['query'],_0x3ad768[_0x0c02('0x34')]),_0x3c2d1c);if(_0x1f8601[_0x0c02('0x33')]['filter']){_0x2900f0['where']=_[_0x0c02('0x3b')](_0x2900f0[_0x0c02('0x3c')],{'$or':_[_0x0c02('0x2c')](_0x3c2d1c,function(_0x259eca){if(_0x259eca[_0x0c02('0x30')]!==_0x0c02('0x3d')){var _0x2aceaf={};_0x2aceaf[_0x259eca[_0x0c02('0x29')]]={'$like':'%'+_0x1f8601[_0x0c02('0x33')][_0x0c02('0x3e')]+'%'};return _0x2aceaf;}})});}_0x2900f0=_[_0x0c02('0x3b')]({},_0x2900f0,_0x1f8601[_0x0c02('0x3f')]);var _0x1e99ec={'where':_0x2900f0['where']};return db['Schedule'][_0x0c02('0x1e')](_0x1e99ec)[_0x0c02('0x23')](function(_0x2c0481){_0x58cfc4[_0x0c02('0x1e')]=_0x2c0481;if(_0x1f8601['query'][_0x0c02('0x40')]){_0x2900f0['include']=[{'all':!![]}];}return db[_0x0c02('0x2d')][_0x0c02('0x41')](_0x2900f0);})[_0x0c02('0x23')](function(_0x1dffd9){_0x58cfc4[_0x0c02('0x42')]=_0x1dffd9;return _0x58cfc4;})['then'](respondWithFilteredResult(_0x561b27,_0x2900f0))[_0x0c02('0x43')](handleError(_0x561b27,null));};exports[_0x0c02('0x44')]=function(_0x55dd65,_0x3166f8){var _0x87c30b={'raw':![],'where':{'id':_0x55dd65[_0x0c02('0x45')]['id']}},_0x290352={};_0x290352['model']=_[_0x0c02('0x46')](db[_0x0c02('0x2d')][_0x0c02('0x2e')]);_0x290352[_0x0c02('0x33')]=_[_0x0c02('0x46')](_0x55dd65['query']);_0x290352['filters']=_[_0x0c02('0x35')](_0x290352['model'],_0x290352[_0x0c02('0x33')]);_0x87c30b[_0x0c02('0x36')]=_[_0x0c02('0x35')](_0x290352['model'],qs['fields'](_0x55dd65[_0x0c02('0x33')][_0x0c02('0x37')]));_0x87c30b[_0x0c02('0x36')]=_0x87c30b[_0x0c02('0x36')][_0x0c02('0x38')]?_0x87c30b[_0x0c02('0x36')]:_0x290352[_0x0c02('0x32')];if(_0x55dd65['query'][_0x0c02('0x40')]){_0x87c30b['include']=[{'all':!![]}];}_0x87c30b=_[_0x0c02('0x3b')]({},_0x87c30b,_0x55dd65[_0x0c02('0x3f')]);return db['Schedule']['find'](_0x87c30b)[_0x0c02('0x23')](handleEntityNotFound(_0x3166f8,null))['then'](respondWithResult(_0x3166f8,null))[_0x0c02('0x43')](handleError(_0x3166f8,null));};exports[_0x0c02('0x47')]=function(_0x55d2a4,_0x78f583){return db['Schedule']['create'](_0x55d2a4[_0x0c02('0x48')],{})['then'](function(_0x231e7b){var _0x2844ee=_0x55d2a4[_0x0c02('0x49')][_0x0c02('0x4a')]({'plain':!![]});if(!_0x2844ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2844ee[_0x0c02('0x4b')]==='user'){var _0x5b9604=_0x231e7b[_0x0c02('0x4a')]({'plain':!![]});var _0x538b61=_0x0c02('0x25');return db[_0x0c02('0x4c')][_0x0c02('0x4d')]({'where':{'name':_0x538b61,'userProfileId':_0x2844ee['userProfileId']},'raw':!![]})[_0x0c02('0x23')](function(_0x575d19){if(_0x575d19&&_0x575d19[_0x0c02('0x4e')]===0x0){return db[_0x0c02('0x26')][_0x0c02('0x47')]({'name':_0x5b9604[_0x0c02('0x29')],'resourceId':_0x5b9604['id'],'type':_0x575d19['name'],'sectionId':_0x575d19['id']},{})['then'](function(){return _0x231e7b;});}else{return _0x231e7b;}})['catch'](function(_0x38f06b){logger[_0x0c02('0x27')](_0x0c02('0x4f'),_0x38f06b);throw _0x38f06b;});}return _0x231e7b;})[_0x0c02('0x23')](respondWithResult(_0x78f583,0xc9))[_0x0c02('0x43')](handleError(_0x78f583,null));};exports[_0x0c02('0x22')]=function(_0x147fc5,_0x2891a9){if(_0x147fc5[_0x0c02('0x48')]['id']){delete _0x147fc5['body']['id'];}return db[_0x0c02('0x2d')][_0x0c02('0x4d')]({'where':{'id':_0x147fc5[_0x0c02('0x45')]['id']}})[_0x0c02('0x23')](handleEntityNotFound(_0x2891a9,null))[_0x0c02('0x23')](saveUpdates(_0x147fc5['body'],null))[_0x0c02('0x23')](respondWithResult(_0x2891a9,null))[_0x0c02('0x43')](handleError(_0x2891a9,null));};exports['destroy']=function(_0x54371c,_0x3a558){return db[_0x0c02('0x2d')][_0x0c02('0x4d')]({'where':{'id':_0x54371c[_0x0c02('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a558,null))[_0x0c02('0x23')](removeEntity(_0x3a558,null))[_0x0c02('0x43')](handleError(_0x3a558,null));};exports['run']=function(_0x4bf153,_0x2971c8,_0x23bdc4){var _0x251ca5=require(_0x0c02('0x50'));return db[_0x0c02('0x2d')][_0x0c02('0x4d')]({'where':{'id':_0x4bf153[_0x0c02('0x45')]['id']},'raw':!![]})[_0x0c02('0x23')](handleEntityNotFound(_0x2971c8,null))[_0x0c02('0x23')](function(){_0x251ca5['run'](_0x4bf153[_0x0c02('0x45')]['id']);})['then'](respondWithStatusCode(_0x2971c8,null))[_0x0c02('0x43')](handleError(_0x2971c8,null));}; \ No newline at end of file +var _0xc18c=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Schedule','rows','catch','fields','find'];(function(_0x1a773e,_0x251779){var _0x33103b=function(_0x53b5a2){while(--_0x53b5a2){_0x1a773e['push'](_0x1a773e['shift']());}};_0x33103b(++_0x251779);}(_0xc18c,0x1f2));var _0xcc18=function(_0x3d4227,_0x5bb4ca){_0x3d4227=_0x3d4227-0x0;var _0x36f169=_0xc18c[_0x3d4227];return _0x36f169;};'use strict';var emlformat=require(_0xcc18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc18('0x1'));var jsonpatch=require(_0xcc18('0x2'));var rp=require(_0xcc18('0x3'));var moment=require(_0xcc18('0x4'));var BPromise=require(_0xcc18('0x5'));var Mustache=require(_0xcc18('0x6'));var util=require(_0xcc18('0x7'));var path=require('path');var sox=require(_0xcc18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc18('0x9'));var squel=require(_0xcc18('0xa'));var crypto=require(_0xcc18('0xb'));var jsforce=require(_0xcc18('0xc'));var deskjs=require(_0xcc18('0xd'));var toCsv=require(_0xcc18('0xe'));var querystring=require(_0xcc18('0xf'));var Papa=require('papaparse');var Redis=require(_0xcc18('0x10'));var authService=require(_0xcc18('0x11'));var qs=require(_0xcc18('0x12'));var as=require(_0xcc18('0x13'));var hardwareService=require(_0xcc18('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcc18('0x15'));var licenseUtil=require(_0xcc18('0x16'));var db=require(_0xcc18('0x17'))['db'];function respondWithStatusCode(_0xf074a1,_0x5233ed){_0x5233ed=_0x5233ed||0xcc;return function(_0x41a592){if(_0x41a592){return _0xf074a1[_0xcc18('0x18')](_0x5233ed);}return _0xf074a1[_0xcc18('0x19')](_0x5233ed)[_0xcc18('0x1a')]();};}function respondWithResult(_0x296f49,_0x146ab0){_0x146ab0=_0x146ab0||0xc8;return function(_0x298e75){if(_0x298e75){return _0x296f49[_0xcc18('0x19')](_0x146ab0)[_0xcc18('0x1b')](_0x298e75);}};}function respondWithFilteredResult(_0x2264ed,_0x3f75c8){return function(_0x31e771){if(_0x31e771){var _0x5ed030=typeof _0x3f75c8[_0xcc18('0x1c')]==='undefined'&&typeof _0x3f75c8[_0xcc18('0x1d')]==='undefined';var _0x57d075=_0x31e771[_0xcc18('0x1e')];var _0x59ead8=_0x5ed030?0x0:_0x3f75c8[_0xcc18('0x1c')];var _0xceade2=_0x5ed030?_0x31e771[_0xcc18('0x1e')]:_0x3f75c8[_0xcc18('0x1c')]+_0x3f75c8[_0xcc18('0x1d')];var _0x511688;if(_0xceade2>=_0x57d075){_0xceade2=_0x57d075;_0x511688=0xc8;}else{_0x511688=0xce;}_0x2264ed['status'](_0x511688);return _0x2264ed[_0xcc18('0x1f')](_0xcc18('0x20'),_0x59ead8+'-'+_0xceade2+'/'+_0x57d075)[_0xcc18('0x1b')](_0x31e771);}return null;};}function patchUpdates(_0x50a59c){return function(_0x545009){try{jsonpatch[_0xcc18('0x21')](_0x545009,_0x50a59c,!![]);}catch(_0x2e3f75){return BPromise['reject'](_0x2e3f75);}return _0x545009['save']();};}function saveUpdates(_0x371b4e,_0x47ad4c){return function(_0x25fd11){if(_0x25fd11){return _0x25fd11[_0xcc18('0x22')](_0x371b4e)[_0xcc18('0x23')](function(_0x1406a7){return _0x1406a7;});}return null;};}function removeEntity(_0x398e22,_0x2f7a4d){return function(_0x138124){if(_0x138124){return _0x138124[_0xcc18('0x24')]()['then'](function(){var _0x14a09a=_0x138124[_0xcc18('0x25')]({'plain':!![]});var _0x307bb4='Scheduler';return db['UserProfileResource'][_0xcc18('0x24')]({'where':{'type':_0x307bb4,'resourceId':_0x14a09a['id']}})['then'](function(){return _0x138124;});})[_0xcc18('0x23')](function(){_0x398e22[_0xcc18('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1a773,_0x290585){return function(_0xdac357){if(!_0xdac357){_0xf1a773[_0xcc18('0x18')](0x194);}return _0xdac357;};}function handleError(_0x463fda,_0x2d25cd){_0x2d25cd=_0x2d25cd||0x1f4;return function(_0xa10c28){logger[_0xcc18('0x26')](_0xa10c28[_0xcc18('0x27')]);if(_0xa10c28[_0xcc18('0x28')]){delete _0xa10c28[_0xcc18('0x28')];}_0x463fda[_0xcc18('0x19')](_0x2d25cd)[_0xcc18('0x29')](_0xa10c28);};}exports[_0xcc18('0x2a')]=function(_0x3337e8,_0x3a8f0a){var _0x35a9bc={},_0x412227={},_0xe92a25={'count':0x0,'rows':[]};var _0x27bc49=_[_0xcc18('0x2b')](db['Schedule'][_0xcc18('0x2c')],function(_0x32b8e4){return{'name':_0x32b8e4['fieldName'],'type':_0x32b8e4[_0xcc18('0x2d')][_0xcc18('0x2e')]};});_0x412227[_0xcc18('0x2f')]=_[_0xcc18('0x2b')](_0x27bc49,_0xcc18('0x28'));_0x412227['query']=_[_0xcc18('0x30')](_0x3337e8['query']);_0x412227[_0xcc18('0x31')]=_[_0xcc18('0x32')](_0x412227[_0xcc18('0x2f')],_0x412227[_0xcc18('0x33')]);_0x35a9bc[_0xcc18('0x34')]=_[_0xcc18('0x32')](_0x412227[_0xcc18('0x2f')],qs['fields'](_0x3337e8[_0xcc18('0x33')]['fields']));_0x35a9bc[_0xcc18('0x34')]=_0x35a9bc[_0xcc18('0x34')][_0xcc18('0x35')]?_0x35a9bc[_0xcc18('0x34')]:_0x412227[_0xcc18('0x2f')];if(!_0x3337e8[_0xcc18('0x33')][_0xcc18('0x36')]('nolimit')){_0x35a9bc['limit']=qs[_0xcc18('0x1d')](_0x3337e8[_0xcc18('0x33')][_0xcc18('0x1d')]);_0x35a9bc[_0xcc18('0x1c')]=qs['offset'](_0x3337e8['query'][_0xcc18('0x1c')]);}_0x35a9bc[_0xcc18('0x37')]=qs[_0xcc18('0x38')](_0x3337e8[_0xcc18('0x33')][_0xcc18('0x38')]);_0x35a9bc[_0xcc18('0x39')]=qs['filters'](_[_0xcc18('0x3a')](_0x3337e8['query'],_0x412227[_0xcc18('0x31')]),_0x27bc49);if(_0x3337e8['query'][_0xcc18('0x3b')]){_0x35a9bc['where']=_[_0xcc18('0x3c')](_0x35a9bc[_0xcc18('0x39')],{'$or':_[_0xcc18('0x2b')](_0x27bc49,function(_0x3a57dc){if(_0x3a57dc[_0xcc18('0x2d')]!==_0xcc18('0x3d')){var _0x259f22={};_0x259f22[_0x3a57dc[_0xcc18('0x28')]]={'$like':'%'+_0x3337e8['query'][_0xcc18('0x3b')]+'%'};return _0x259f22;}})});}_0x35a9bc=_[_0xcc18('0x3c')]({},_0x35a9bc,_0x3337e8[_0xcc18('0x3e')]);var _0x55d6f6={'where':_0x35a9bc[_0xcc18('0x39')]};return db['Schedule'][_0xcc18('0x1e')](_0x55d6f6)['then'](function(_0x25ae1b){_0xe92a25[_0xcc18('0x1e')]=_0x25ae1b;if(_0x3337e8['query']['includeAll']){_0x35a9bc[_0xcc18('0x3f')]=[{'all':!![]}];}return db[_0xcc18('0x40')]['findAll'](_0x35a9bc);})[_0xcc18('0x23')](function(_0x2b6d60){_0xe92a25[_0xcc18('0x41')]=_0x2b6d60;return _0xe92a25;})[_0xcc18('0x23')](respondWithFilteredResult(_0x3a8f0a,_0x35a9bc))[_0xcc18('0x42')](handleError(_0x3a8f0a,null));};exports['show']=function(_0x75f4c2,_0x457e63){var _0x4e37a7={'raw':![],'where':{'id':_0x75f4c2['params']['id']}},_0x1faa45={};_0x1faa45[_0xcc18('0x2f')]=_[_0xcc18('0x30')](db[_0xcc18('0x40')][_0xcc18('0x2c')]);_0x1faa45['query']=_[_0xcc18('0x30')](_0x75f4c2[_0xcc18('0x33')]);_0x1faa45[_0xcc18('0x31')]=_['intersection'](_0x1faa45[_0xcc18('0x2f')],_0x1faa45['query']);_0x4e37a7[_0xcc18('0x34')]=_[_0xcc18('0x32')](_0x1faa45['model'],qs[_0xcc18('0x43')](_0x75f4c2['query'][_0xcc18('0x43')]));_0x4e37a7[_0xcc18('0x34')]=_0x4e37a7['attributes']['length']?_0x4e37a7[_0xcc18('0x34')]:_0x1faa45[_0xcc18('0x2f')];if(_0x75f4c2[_0xcc18('0x33')]['includeAll']){_0x4e37a7[_0xcc18('0x3f')]=[{'all':!![]}];}_0x4e37a7=_[_0xcc18('0x3c')]({},_0x4e37a7,_0x75f4c2[_0xcc18('0x3e')]);return db['Schedule'][_0xcc18('0x44')](_0x4e37a7)['then'](handleEntityNotFound(_0x457e63,null))['then'](respondWithResult(_0x457e63,null))[_0xcc18('0x42')](handleError(_0x457e63,null));};exports[_0xcc18('0x45')]=function(_0x549cce,_0x1a3210){return db[_0xcc18('0x40')][_0xcc18('0x45')](_0x549cce['body'],{})[_0xcc18('0x23')](function(_0x5775b1){var _0x14268b=_0x549cce['user'][_0xcc18('0x25')]({'plain':!![]});if(!_0x14268b)throw new Error(_0xcc18('0x46'));if(_0x14268b[_0xcc18('0x47')]===_0xcc18('0x48')){var _0x273b9d=_0x5775b1[_0xcc18('0x25')]({'plain':!![]});var _0x4f5f55=_0xcc18('0x49');return db[_0xcc18('0x4a')][_0xcc18('0x44')]({'where':{'name':_0x4f5f55,'userProfileId':_0x14268b['userProfileId']},'raw':!![]})[_0xcc18('0x23')](function(_0x5a9a92){if(_0x5a9a92&&_0x5a9a92['autoAssociation']===0x0){return db[_0xcc18('0x4b')][_0xcc18('0x45')]({'name':_0x273b9d[_0xcc18('0x28')],'resourceId':_0x273b9d['id'],'type':_0x5a9a92['name'],'sectionId':_0x5a9a92['id']},{})[_0xcc18('0x23')](function(){return _0x5775b1;});}else{return _0x5775b1;}})['catch'](function(_0x38309b){logger[_0xcc18('0x26')](_0xcc18('0x4c'),_0x38309b);throw _0x38309b;});}return _0x5775b1;})[_0xcc18('0x23')](respondWithResult(_0x1a3210,0xc9))['catch'](handleError(_0x1a3210,null));};exports[_0xcc18('0x22')]=function(_0xdb6d06,_0x44a821){if(_0xdb6d06[_0xcc18('0x4d')]['id']){delete _0xdb6d06['body']['id'];}return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0xdb6d06[_0xcc18('0x4e')]['id']}})[_0xcc18('0x23')](handleEntityNotFound(_0x44a821,null))[_0xcc18('0x23')](saveUpdates(_0xdb6d06[_0xcc18('0x4d')],null))['then'](respondWithResult(_0x44a821,null))[_0xcc18('0x42')](handleError(_0x44a821,null));};exports[_0xcc18('0x24')]=function(_0x221f9f,_0x456313){return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0x221f9f[_0xcc18('0x4e')]['id']}})[_0xcc18('0x23')](handleEntityNotFound(_0x456313,null))[_0xcc18('0x23')](removeEntity(_0x456313,null))[_0xcc18('0x42')](handleError(_0x456313,null));};exports[_0xcc18('0x4f')]=function(_0x28c1f9,_0x21996b,_0x331b60){var _0x2eae43=require(_0xcc18('0x50'));return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0x28c1f9[_0xcc18('0x4e')]['id']},'raw':!![]})[_0xcc18('0x23')](handleEntityNotFound(_0x21996b,null))[_0xcc18('0x23')](function(){_0x2eae43[_0xcc18('0x4f')](_0x28c1f9[_0xcc18('0x4e')]['id']);})['then'](respondWithStatusCode(_0x21996b,null))[_0xcc18('0x42')](handleError(_0x21996b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f4eab98..73fecca 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 _0xe911=['bluebird','request-promise','path','../../config/environment','define','lodash','util','moment'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0xe911,0x185));var _0x1e91=function(_0x203b4b,_0x2247d3){_0x203b4b=_0x203b4b-0x0;var _0x445f0b=_0xe911[_0x203b4b];return _0x445f0b;};'use strict';var _=require(_0x1e91('0x0'));var util=require(_0x1e91('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e91('0x2'));var BPromise=require(_0x1e91('0x3'));var rp=require(_0x1e91('0x4'));var fs=require('fs');var path=require(_0x1e91('0x5'));var rimraf=require('rimraf');var config=require(_0x1e91('0x6'));var attributes=require('./schedule.attributes');module['exports']=function(_0x1e0b2f,_0x449eb2){return _0x1e0b2f[_0x1e91('0x7')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe956=['moment','bluebird','rimraf','./schedule.attributes','exports','define','tools_schedules','lodash','../../config/logger','api'];(function(_0x4b14b8,_0x312731){var _0x298396=function(_0x498c1d){while(--_0x498c1d){_0x4b14b8['push'](_0x4b14b8['shift']());}};_0x298396(++_0x312731);}(_0xe956,0xa7));var _0x6e95=function(_0x3eec3b,_0x544f37){_0x3eec3b=_0x3eec3b-0x0;var _0x2b283f=_0xe956[_0x3eec3b];return _0x2b283f;};'use strict';var _=require(_0x6e95('0x0'));var util=require('util');var logger=require(_0x6e95('0x1'))(_0x6e95('0x2'));var moment=require(_0x6e95('0x3'));var BPromise=require(_0x6e95('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e95('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e95('0x6'));module[_0x6e95('0x7')]=function(_0x3093ff,_0x4a4fa9){return _0x3093ff[_0x6e95('0x8')]('Schedule',attributes,{'tableName':_0x6e95('0x9'),'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 1d8561b..ae27092 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 _0x2b62=['../../mysqldb','../../config/logger','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x2b62,0x18b));var _0x22b6=function(_0x58723c,_0x51cd6b){_0x58723c=_0x58723c-0x0;var _0x2bfb14=_0x2b62[_0x58723c];return _0x2bfb14;};'use strict';var _=require(_0x22b6('0x0'));var util=require(_0x22b6('0x1'));var moment=require('moment');var BPromise=require(_0x22b6('0x2'));var rs=require(_0x22b6('0x3'));var fs=require('fs');var Redis=require(_0x22b6('0x4'));var db=require(_0x22b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22b6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x22b6('0x7')][_0x22b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5751f3,_0x3096c1,_0x2503fe){return new BPromise(function(_0x3d2736,_0x15af16){return client[_0x22b6('0x9')](_0x5751f3,_0x2503fe)[_0x22b6('0xa')](function(_0x158664){logger[_0x22b6('0xb')](_0x22b6('0xc'),_0x3096c1,_0x22b6('0xd'));logger[_0x22b6('0xe')](_0x22b6('0xf'),_0x3096c1,'request\x20sent',JSON['stringify'](_0x158664));if(_0x158664['error']){if(_0x158664[_0x22b6('0x10')][_0x22b6('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x3096c1,_0x158664['error'][_0x22b6('0x12')]);return _0x15af16(_0x158664[_0x22b6('0x10')]['message']);}logger[_0x22b6('0x10')]('Schedule,\x20%s,\x20%s',_0x3096c1,_0x158664[_0x22b6('0x10')][_0x22b6('0x12')]);return _0x3d2736(_0x158664[_0x22b6('0x10')][_0x22b6('0x12')]);}else{logger[_0x22b6('0xb')]('Schedule,\x20%s,\x20%s',_0x3096c1,_0x22b6('0xd'));_0x3d2736(_0x158664['result'][_0x22b6('0x12')]);}})[_0x22b6('0x13')](function(_0x477247){logger[_0x22b6('0x10')](_0x22b6('0xc'),_0x3096c1,_0x477247);_0x15af16(_0x477247);});});} \ No newline at end of file +var _0x6c1b=['http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3d3ddd,_0x59b504){var _0x52a4f9=function(_0x349a69){while(--_0x349a69){_0x3d3ddd['push'](_0x3d3ddd['shift']());}};_0x52a4f9(++_0x59b504);}(_0x6c1b,0xee));var _0xb6c1=function(_0xe2ed88,_0x2dd704){_0xe2ed88=_0xe2ed88-0x0;var _0x194e53=_0x6c1b[_0xe2ed88];return _0x194e53;};'use strict';var _=require(_0xb6c1('0x0'));var util=require(_0xb6c1('0x1'));var moment=require(_0xb6c1('0x2'));var BPromise=require(_0xb6c1('0x3'));var rs=require(_0xb6c1('0x4'));var fs=require('fs');var Redis=require(_0xb6c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6c1('0x6'));var logger=require(_0xb6c1('0x7'))(_0xb6c1('0x8'));var config=require(_0xb6c1('0x9'));var jayson=require(_0xb6c1('0xa'));var client=jayson[_0xb6c1('0xb')][_0xb6c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbdcd21,_0x39e369,_0x3ab61c){return new BPromise(function(_0x232fc5,_0xb9740e){return client[_0xb6c1('0xd')](_0xbdcd21,_0x3ab61c)[_0xb6c1('0xe')](function(_0x48819f){logger[_0xb6c1('0xf')](_0xb6c1('0x10'),_0x39e369,_0xb6c1('0x11'));logger[_0xb6c1('0x12')](_0xb6c1('0x13'),_0x39e369,_0xb6c1('0x11'),JSON[_0xb6c1('0x14')](_0x48819f));if(_0x48819f['error']){if(_0x48819f['error'][_0xb6c1('0x15')]===0x1f4){logger[_0xb6c1('0x16')](_0xb6c1('0x10'),_0x39e369,_0x48819f['error'][_0xb6c1('0x17')]);return _0xb9740e(_0x48819f[_0xb6c1('0x16')][_0xb6c1('0x17')]);}logger['error'](_0xb6c1('0x10'),_0x39e369,_0x48819f[_0xb6c1('0x16')][_0xb6c1('0x17')]);return _0x232fc5(_0x48819f['error'][_0xb6c1('0x17')]);}else{logger[_0xb6c1('0xf')](_0xb6c1('0x10'),_0x39e369,_0xb6c1('0x11'));_0x232fc5(_0x48819f['result'][_0xb6c1('0x17')]);}})[_0xb6c1('0x18')](function(_0x4294e4){logger['error'](_0xb6c1('0x10'),_0x39e369,_0x4294e4);_0xb9740e(_0x4294e4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index cedab1a..08efd6e 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 _0xc1d2=['describe','/:id/download','download','post','put','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','/describe'];(function(_0x48d589,_0x29db1a){var _0x5d1e97=function(_0x1412ee){while(--_0x1412ee){_0x48d589['push'](_0x48d589['shift']());}};_0x5d1e97(++_0x29db1a);}(_0xc1d2,0x10d));var _0x2c1d=function(_0x59467a,_0x2aa568){_0x59467a=_0x59467a-0x0;var _0x165e08=_0xc1d2[_0x59467a];return _0x165e08;};'use strict';var multer=require('multer');var util=require(_0x2c1d('0x0'));var path=require(_0x2c1d('0x1'));var timeout=require(_0x2c1d('0x2'));var express=require('express');var router=express[_0x2c1d('0x3')]();var fs_extra=require(_0x2c1d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2c1d('0x5'));var config=require('../../config/environment');var controller=require(_0x2c1d('0x6'));router['get']('/',auth[_0x2c1d('0x7')](),controller[_0x2c1d('0x8')]);router[_0x2c1d('0x9')](_0x2c1d('0xa'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0xb')]);router[_0x2c1d('0x9')]('/:id',auth[_0x2c1d('0x7')](),controller['show']);router['get'](_0x2c1d('0xc'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0xd')]);router[_0x2c1d('0xe')]('/',auth[_0x2c1d('0x7')](),controller['create']);router[_0x2c1d('0xf')](_0x2c1d('0x10'),auth[_0x2c1d('0x7')](),controller[_0x2c1d('0x11')]);router[_0x2c1d('0x12')](_0x2c1d('0x10'),auth[_0x2c1d('0x7')](),controller['destroy']);module[_0x2c1d('0x13')]=router; \ No newline at end of file +var _0x21c2=['get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./screenRecording.controller'];(function(_0x44511f,_0x1eed33){var _0xa1dd0d=function(_0x1b1069){while(--_0x1b1069){_0x44511f['push'](_0x44511f['shift']());}};_0xa1dd0d(++_0x1eed33);}(_0x21c2,0x86));var _0x221c=function(_0x2b10d7,_0x33db4f){_0x2b10d7=_0x2b10d7-0x0;var _0x47c1c3=_0x21c2[_0x2b10d7];return _0x47c1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x221c('0x0'));var timeout=require('connect-timeout');var express=require(_0x221c('0x1'));var router=express[_0x221c('0x2')]();var fs_extra=require(_0x221c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x221c('0x4'));var controller=require(_0x221c('0x5'));router[_0x221c('0x6')]('/',auth[_0x221c('0x7')](),controller[_0x221c('0x8')]);router[_0x221c('0x6')](_0x221c('0x9'),auth[_0x221c('0x7')](),controller['describe']);router[_0x221c('0x6')](_0x221c('0xa'),auth[_0x221c('0x7')](),controller['show']);router[_0x221c('0x6')](_0x221c('0xb'),auth[_0x221c('0x7')](),controller[_0x221c('0xc')]);router[_0x221c('0xd')]('/',auth['isAuthenticated'](),controller[_0x221c('0xe')]);router[_0x221c('0xf')](_0x221c('0xa'),auth[_0x221c('0x7')](),controller[_0x221c('0x10')]);router[_0x221c('0x11')](_0x221c('0xa'),auth['isAuthenticated'](),controller[_0x221c('0x12')]);module[_0x221c('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 131dcc1..34d4e54 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 _0x964b=['updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','extname','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','DATE','getDataValue','format','toString','MM-DD-YYYY\x20HH:mm','createdAt'];(function(_0x4ccb2e,_0x40ffc5){var _0x2e1c99=function(_0x1e7eda){while(--_0x1e7eda){_0x4ccb2e['push'](_0x4ccb2e['shift']());}};_0x2e1c99(++_0x40ffc5);}(_0x964b,0x112));var _0xb964=function(_0x30580d,_0x3e9c8b){_0x30580d=_0x30580d-0x0;var _0x1d7198=_0x964b[_0x30580d];return _0x1d7198;};'use strict';var Sequelize=require(_0xb964('0x0'));var moment=require(_0xb964('0x1'));var path=require('path');var config=require(_0xb964('0x2'));module[_0xb964('0x3')]={'format':{'type':Sequelize[_0xb964('0x4')],'get':function(){return this['getDataValue']('value')?path[_0xb964('0x5')](this['getDataValue'](_0xb964('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb964('0x7')]},'channel':{'type':Sequelize[_0xb964('0x7')]},'value':{'type':Sequelize[_0xb964('0x7')],'set':function(_0x204c7d){var _0xde47d5=_0x204c7d[_0xb964('0x8')](/\\/g,'/');this['setDataValue']('value',_0xde47d5);}},'rating':{'type':Sequelize[_0xb964('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x55e697){this[_0xb964('0xa')](_0xb964('0xb'),moment()[_0xb964('0xc')](_0x55e697,'ms'));this[_0xb964('0xa')](_0xb964('0xd'),moment());this[_0xb964('0xa')]('duration',_0x55e697);}},'startedAt':{'type':Sequelize[_0xb964('0xe')],'get':function(){return moment(this[_0xb964('0xf')](_0xb964('0xb')))[_0xb964('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xb964('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xb964('0xd')))[_0xb964('0x10')](_0xb964('0x12'))[_0xb964('0x11')]();}},'createdAt':{'type':Sequelize[_0xb964('0xe')],'get':function(){return moment(this[_0xb964('0xf')](_0xb964('0x13')))['format'](_0xb964('0x12'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb964('0xf')](_0xb964('0x14')))[_0xb964('0x10')](_0xb964('0x12'))[_0xb964('0x11')]();}}}; \ No newline at end of file +var _0xcefd=['subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x178dfe,_0x23a6b3){var _0x16e620=function(_0x4cbe78){while(--_0x4cbe78){_0x178dfe['push'](_0x178dfe['shift']());}};_0x16e620(++_0x23a6b3);}(_0xcefd,0x1bd));var _0xdcef=function(_0x17a29e,_0x242d8c){_0x17a29e=_0x17a29e-0x0;var _0x26f32e=_0xcefd[_0x17a29e];return _0x26f32e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdcef('0x0'));var path=require(_0xdcef('0x1'));var config=require(_0xdcef('0x2'));module[_0xdcef('0x3')]={'format':{'type':Sequelize[_0xdcef('0x4')],'get':function(){return this[_0xdcef('0x5')](_0xdcef('0x6'))?path['extname'](this[_0xdcef('0x5')](_0xdcef('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xdcef('0x7')]},'channel':{'type':Sequelize[_0xdcef('0x7')]},'value':{'type':Sequelize[_0xdcef('0x7')],'set':function(_0x4ba458){var _0x3b9fec=_0x4ba458[_0xdcef('0x8')](/\\/g,'/');this[_0xdcef('0x9')](_0xdcef('0x6'),_0x3b9fec);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdcef('0xa')],'set':function(_0xbb7067){this[_0xdcef('0x9')]('startedAt',moment()[_0xdcef('0xb')](_0xbb7067,'ms'));this['setDataValue'](_0xdcef('0xc'),moment());this[_0xdcef('0x9')](_0xdcef('0xd'),_0xbb7067);}},'startedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this[_0xdcef('0x5')]('startedAt'))[_0xdcef('0xf')](_0xdcef('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this['getDataValue'](_0xdcef('0xc')))[_0xdcef('0xf')](_0xdcef('0x10'))[_0xdcef('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdcef('0x5')](_0xdcef('0x12')))['format'](_0xdcef('0x10'))[_0xdcef('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xdcef('0xf')](_0xdcef('0x10'))[_0xdcef('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9d087f1..2dda225 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 _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0x424ec6,_0x33ed26){var _0x151c2d=function(_0x36f007){while(--_0x36f007){_0x424ec6['push'](_0x424ec6['shift']());}};_0x151c2d(++_0x33ed26);}(_0xac9d,0x14d));var _0xdac9=function(_0x9ba57c,_0x5ecc0d){_0x9ba57c=_0x9ba57c-0x0;var _0x627a6e=_0xac9d[_0x9ba57c];return _0x627a6e;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));}; \ No newline at end of file +var _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x392c38,_0x520ad2){var _0x1deca8=function(_0x4980e8){while(--_0x4980e8){_0x392c38['push'](_0x392c38['shift']());}};_0x1deca8(++_0x520ad2);}(_0x2bd8,0x130));var _0x82bd=function(_0x1bd591,_0x58c7af){_0x1bd591=_0x1bd591-0x0;var _0x17745d=_0x2bd8[_0x1bd591];return _0x17745d;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 06860ca..aefa413 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 _0xe3ad=['../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x557c05,_0xb01d90){var _0x4e0379=function(_0x6b9058){while(--_0x6b9058){_0x557c05['push'](_0x557c05['shift']());}};_0x4e0379(++_0xb01d90);}(_0xe3ad,0x88));var _0xde3a=function(_0x429784,_0x1b4aef){_0x429784=_0x429784-0x0;var _0x2fcac6=_0xe3ad[_0x429784];return _0x2fcac6;};'use strict';var _=require(_0xde3a('0x0'));var util=require(_0xde3a('0x1'));var logger=require(_0xde3a('0x2'))(_0xde3a('0x3'));var moment=require(_0xde3a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xde3a('0x5'));var rimraf=require(_0xde3a('0x6'));var config=require(_0xde3a('0x7'));var attributes=require('./screenRecording.attributes');module[_0xde3a('0x8')]=function(_0x286bb9,_0x5cb096){return _0x286bb9[_0xde3a('0x9')](_0xde3a('0xa'),attributes,{'tableName':_0xde3a('0xb'),'paranoid':![],'indexes':[{'name':_0xde3a('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf063=['api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','../../config/logger'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0xf063,0x128));var _0x3f06=function(_0x5afd8c,_0x18d15f){_0x5afd8c=_0x5afd8c-0x0;var _0x12a75e=_0xf063[_0x5afd8c];return _0x12a75e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f06('0x0'))(_0x3f06('0x1'));var moment=require(_0x3f06('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f06('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f06('0x4'));var config=require(_0x3f06('0x5'));var attributes=require(_0x3f06('0x6'));module[_0x3f06('0x7')]=function(_0x844235,_0x3c0b64){return _0x844235['define'](_0x3f06('0x8'),attributes,{'tableName':_0x3f06('0x9'),'paranoid':![],'indexes':[{'name':_0x3f06('0xa'),'fields':[_0x3f06('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 13d90d5..d9696bc 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 _0x5f7c=['http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x29f445,_0x4dac92){var _0x2265d1=function(_0x3d77ba){while(--_0x3d77ba){_0x29f445['push'](_0x29f445['shift']());}};_0x2265d1(++_0x4dac92);}(_0x5f7c,0x1ee));var _0xc5f7=function(_0x7470bd,_0x5e5732){_0x7470bd=_0x7470bd-0x0;var _0x53fbef=_0x5f7c[_0x7470bd];return _0x53fbef;};'use strict';var _=require(_0xc5f7('0x0'));var util=require(_0xc5f7('0x1'));var moment=require(_0xc5f7('0x2'));var BPromise=require(_0xc5f7('0x3'));var rs=require(_0xc5f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5f7('0x6'))(_0xc5f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5f7('0x8'));var client=jayson[_0xc5f7('0x9')][_0xc5f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cc817,_0x4c57f4,_0x380274){return new BPromise(function(_0x1d0d43,_0x11b101){return client[_0xc5f7('0xb')](_0x1cc817,_0x380274)[_0xc5f7('0xc')](function(_0xad0b0e){logger[_0xc5f7('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4c57f4,_0xc5f7('0xe'));logger[_0xc5f7('0xf')](_0xc5f7('0x10'),_0x4c57f4,_0xc5f7('0xe'),JSON[_0xc5f7('0x11')](_0xad0b0e));if(_0xad0b0e['error']){if(_0xad0b0e[_0xc5f7('0x12')][_0xc5f7('0x13')]===0x1f4){logger[_0xc5f7('0x12')](_0xc5f7('0x14'),_0x4c57f4,_0xad0b0e[_0xc5f7('0x12')]['message']);return _0x11b101(_0xad0b0e[_0xc5f7('0x12')][_0xc5f7('0x15')]);}logger['error'](_0xc5f7('0x14'),_0x4c57f4,_0xad0b0e[_0xc5f7('0x12')][_0xc5f7('0x15')]);return _0x1d0d43(_0xad0b0e[_0xc5f7('0x12')][_0xc5f7('0x15')]);}else{logger[_0xc5f7('0xd')](_0xc5f7('0x14'),_0x4c57f4,'request\x20sent');_0x1d0d43(_0xad0b0e[_0xc5f7('0x16')][_0xc5f7('0x15')]);}})[_0xc5f7('0x17')](function(_0x50918f){logger['error'](_0xc5f7('0x14'),_0x4c57f4,_0x50918f);_0x11b101(_0x50918f);});});} \ No newline at end of file +var _0xff2e=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56560e,_0x554ced){var _0x302ec3=function(_0x1b04be){while(--_0x1b04be){_0x56560e['push'](_0x56560e['shift']());}};_0x302ec3(++_0x554ced);}(_0xff2e,0x1ec));var _0xeff2=function(_0x1ed4e1,_0xb792d6){_0x1ed4e1=_0x1ed4e1-0x0;var _0x5cade3=_0xff2e[_0x1ed4e1];return _0x5cade3;};'use strict';var _=require(_0xeff2('0x0'));var util=require('util');var moment=require(_0xeff2('0x1'));var BPromise=require(_0xeff2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeff2('0x3'));var db=require(_0xeff2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeff2('0x5'))(_0xeff2('0x6'));var config=require(_0xeff2('0x7'));var jayson=require(_0xeff2('0x8'));var client=jayson[_0xeff2('0x9')][_0xeff2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x336463,_0x1e0246,_0x3fdbe8){return new BPromise(function(_0x1b0776,_0x2bfcde){return client['request'](_0x336463,_0x3fdbe8)['then'](function(_0x2064bf){logger['info'](_0xeff2('0xb'),_0x1e0246,_0xeff2('0xc'));logger[_0xeff2('0xd')](_0xeff2('0xe'),_0x1e0246,_0xeff2('0xc'),JSON[_0xeff2('0xf')](_0x2064bf));if(_0x2064bf[_0xeff2('0x10')]){if(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x11')]===0x1f4){logger[_0xeff2('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x1e0246,_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);return _0x2bfcde(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);}logger[_0xeff2('0x10')](_0xeff2('0xb'),_0x1e0246,_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);return _0x1b0776(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);}else{logger[_0xeff2('0x13')](_0xeff2('0xb'),_0x1e0246,_0xeff2('0xc'));_0x1b0776(_0x2064bf[_0xeff2('0x14')]['message']);}})[_0xeff2('0x15')](function(_0x62688a){logger[_0xeff2('0x10')](_0xeff2('0xb'),_0x1e0246,_0x62688a);_0x2bfcde(_0x62688a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e62818f..4f89236 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 _0x2b89=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/preferred','getPreferred','/:id/favicon','getFavicon','root','server/files/images/logos/','logo','originalname','post','single','file','addLogo','diskStorage','format','%s%s','logologin','extname','join','preferred','favicon','addFavicon','put'];(function(_0x3b8573,_0x1ee370){var _0x5abca9=function(_0x48158b){while(--_0x48158b){_0x3b8573['push'](_0x3b8573['shift']());}};_0x5abca9(++_0x1ee370);}(_0x2b89,0xce));var _0x92b8=function(_0x1957ee,_0x27ee1e){_0x1957ee=_0x1957ee-0x0;var _0x34acb4=_0x2b89[_0x1957ee];return _0x34acb4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x92b8('0x0'));var timeout=require(_0x92b8('0x1'));var express=require(_0x92b8('0x2'));var router=express[_0x92b8('0x3')]();var fs_extra=require(_0x92b8('0x4'));var auth=require(_0x92b8('0x5'));var interaction=require(_0x92b8('0x6'));var config=require('../../config/environment');var controller=require(_0x92b8('0x7'));router['get']('/',auth[_0x92b8('0x8')](),controller[_0x92b8('0x9')]);router[_0x92b8('0xa')](_0x92b8('0xb'),controller[_0x92b8('0xc')]);router[_0x92b8('0xa')](_0x92b8('0xd'),controller['show']);router[_0x92b8('0xa')](_0x92b8('0xe'),controller[_0x92b8('0xf')]);router[_0x92b8('0xa')](_0x92b8('0x10'),controller[_0x92b8('0x11')]);router[_0x92b8('0xa')]('/:id/gdpr',controller['gdpr']);router['get'](_0x92b8('0x12'),controller[_0x92b8('0x13')]);router[_0x92b8('0xa')](_0x92b8('0x14'),controller[_0x92b8('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fe4a5,_0x5347a0,_0x4bcb3f){_0x4bcb3f(null,path['join'](config[_0x92b8('0x16')],_0x92b8('0x17')));},'filename':function(_0x476454,_0x1951c6,_0x4f2843){_0x4f2843(null,util['format']('%s%s',_0x92b8('0x18'),path['extname'](_0x1951c6[_0x92b8('0x19')])));}})});router[_0x92b8('0x1a')](_0x92b8('0xe'),upload[_0x92b8('0x1b')](_0x92b8('0x1c')),controller[_0x92b8('0x1d')]);var upload=multer({'storage':multer[_0x92b8('0x1e')]({'destination':function(_0x56b42f,_0x271a0c,_0x38754b){_0x38754b(null,path['join'](config[_0x92b8('0x16')],'server/files/images/logos/'));},'filename':function(_0x3af70c,_0x1864d6,_0x8eef3b){_0x8eef3b(null,util[_0x92b8('0x1f')](_0x92b8('0x20'),_0x92b8('0x21'),path[_0x92b8('0x22')](_0x1864d6[_0x92b8('0x19')])));}})});router[_0x92b8('0x1a')](_0x92b8('0x10'),upload[_0x92b8('0x1b')](_0x92b8('0x1c')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x92b8('0x1e')]({'destination':function(_0x11813b,_0x5a03f8,_0x584f67){_0x584f67(null,path[_0x92b8('0x23')](config[_0x92b8('0x16')],_0x92b8('0x17')));},'filename':function(_0x1b223e,_0xde37ec,_0x2896fc){_0x2896fc(null,util['format'](_0x92b8('0x20'),_0x92b8('0x24'),path[_0x92b8('0x22')](_0xde37ec[_0x92b8('0x19')])));}})});router[_0x92b8('0x1a')](_0x92b8('0x12'),upload[_0x92b8('0x1b')](_0x92b8('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer[_0x92b8('0x1e')]({'destination':function(_0xe6e816,_0x5d8d3e,_0x4da1d0){_0x4da1d0(null,path['join'](config[_0x92b8('0x16')],_0x92b8('0x17')));},'filename':function(_0x2670fb,_0x4a4cd1,_0x21945f){_0x21945f(null,util['format'](_0x92b8('0x20'),_0x92b8('0x25'),path[_0x92b8('0x22')](_0x4a4cd1[_0x92b8('0x19')])));}})});router[_0x92b8('0x1a')](_0x92b8('0x14'),upload[_0x92b8('0x1b')](_0x92b8('0x1c')),controller[_0x92b8('0x26')]);router[_0x92b8('0x27')](_0x92b8('0xd'),auth[_0x92b8('0x8')](),controller['update']);module[_0x92b8('0x28')]=router; \ No newline at end of file +var _0x5840=['isAuthenticated','index','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./setting.controller'];(function(_0x3a5882,_0x11bc32){var _0x2ae703=function(_0x4877d0){while(--_0x4877d0){_0x3a5882['push'](_0x3a5882['shift']());}};_0x2ae703(++_0x11bc32);}(_0x5840,0x1e7));var _0x0584=function(_0x173366,_0x492151){_0x173366=_0x173366-0x0;var _0x2ccdfa=_0x5840[_0x173366];return _0x2ccdfa;};'use strict';var multer=require(_0x0584('0x0'));var util=require(_0x0584('0x1'));var path=require(_0x0584('0x2'));var timeout=require(_0x0584('0x3'));var express=require('express');var router=express[_0x0584('0x4')]();var fs_extra=require(_0x0584('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0584('0x6'));var config=require('../../config/environment');var controller=require(_0x0584('0x7'));router['get']('/',auth[_0x0584('0x8')](),controller[_0x0584('0x9')]);router[_0x0584('0xa')](_0x0584('0xb'),controller['getDate']);router[_0x0584('0xa')](_0x0584('0xc'),controller[_0x0584('0xd')]);router[_0x0584('0xa')](_0x0584('0xe'),controller[_0x0584('0xf')]);router[_0x0584('0xa')](_0x0584('0x10'),controller[_0x0584('0x11')]);router[_0x0584('0xa')](_0x0584('0x12'),controller[_0x0584('0x13')]);router['get']('/:id/preferred',controller[_0x0584('0x14')]);router[_0x0584('0xa')](_0x0584('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x27e87a,_0x565f6a,_0x89cd8d){_0x89cd8d(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x543ced,_0x4ba6f9,_0x5c6d5a){_0x5c6d5a(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x1c'),path[_0x0584('0x1d')](_0x4ba6f9[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0xe'),upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x62c688,_0x551370,_0xfb2a2){_0xfb2a2(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x12f466,_0x23e791,_0x51f92e){_0x51f92e(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x23'),path['extname'](_0x23e791[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0x10'),upload['single'](_0x0584('0x21')),controller[_0x0584('0x24')]);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x10e5d3,_0x24cade,_0x5ce199){_0x5ce199(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x522ba9,_0x5bf18a,_0x392bb2){_0x392bb2(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x25'),path[_0x0584('0x1d')](_0x5bf18a[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0x26'),upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x27')]);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x43b13e,_0x2efdfb,_0x31f925){_0x31f925(null,path[_0x0584('0x17')](config[_0x0584('0x18')],'server/files/images/logos/'));},'filename':function(_0x3359a4,_0x172d71,_0x290cae){_0x290cae(null,util['format'](_0x0584('0x1b'),_0x0584('0x28'),path[_0x0584('0x1d')](_0x172d71['originalname'])));}})});router[_0x0584('0x1f')]('/:id/favicon',upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x29')]);router[_0x0584('0x2a')](_0x0584('0xc'),auth[_0x0584('0x8')](),controller[_0x0584('0x2b')]);module[_0x0584('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4ad71aa..b2f7920 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 _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x3f4292,_0x4c49d4){var _0x5802ce=function(_0x4b8e83){while(--_0x4b8e83){_0x3f4292['push'](_0x3f4292['shift']());}};_0x5802ce(++_0x4c49d4);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x0b0e[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0xadb5,0xad));var _0x5adb=function(_0x198481,_0x396d48){_0x198481=_0x198481-0x0;var _0x11072f=_0xadb5[_0x198481];return _0x11072f;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index d65400c..e8c93e1 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 _0x34aa=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','send','index','map','Setting','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','logo','loginLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','custom','root','Sequelize','ValidationError','getLogoLogin','getLicense','defaultLogo','default_loginLogo.svg','upperFirst','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x40bd56,_0x2491d1){var _0x20947d=function(_0x26a39c){while(--_0x26a39c){_0x40bd56['push'](_0x40bd56['shift']());}};_0x20947d(++_0x2491d1);}(_0x34aa,0x171));var _0xa34a=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x34aa[_0x1d80be];return _0xf9a4f3;};'use strict';var emlformat=require(_0xa34a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa34a('0x1'));var jsonpatch=require(_0xa34a('0x2'));var rp=require(_0xa34a('0x3'));var moment=require(_0xa34a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa34a('0x5'));var util=require(_0xa34a('0x6'));var path=require(_0xa34a('0x7'));var sox=require(_0xa34a('0x8'));var csv=require(_0xa34a('0x9'));var ejs=require(_0xa34a('0xa'));var fs=require('fs');var fs_extra=require(_0xa34a('0xb'));var _=require(_0xa34a('0xc'));var squel=require(_0xa34a('0xd'));var crypto=require(_0xa34a('0xe'));var jsforce=require(_0xa34a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa34a('0x9'));var querystring=require(_0xa34a('0x10'));var Papa=require(_0xa34a('0x11'));var Redis=require(_0xa34a('0x12'));var authService=require(_0xa34a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa34a('0x14'));var hardwareService=require(_0xa34a('0x15'));var logger=require(_0xa34a('0x16'))(_0xa34a('0x17'));var utils=require(_0xa34a('0x18'));var config=require(_0xa34a('0x19'));var licenseUtil=require(_0xa34a('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa34a('0x1b'));var client=jayson[_0xa34a('0x1c')][_0xa34a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5ca87f,_0xc08e6,_0x441a7f,_0x525eff){return new BPromise(function(_0x2f5ded,_0x3d5926){var _0x5af32c=_0x525eff||client;return _0x5af32c[_0xa34a('0x1e')](_0x5ca87f,_0x441a7f)[_0xa34a('0x1f')](function(_0x19580a){logger[_0xa34a('0x20')](_0xa34a('0x21'),_0xc08e6,'request\x20sent');logger[_0xa34a('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0xc08e6,_0xa34a('0x23'),JSON[_0xa34a('0x24')](_0x19580a));if(_0x19580a[_0xa34a('0x25')]){if(_0x19580a[_0xa34a('0x25')]['code']===0x1f4){logger[_0xa34a('0x25')](_0xa34a('0x21'),_0xc08e6,_0x19580a[_0xa34a('0x25')][_0xa34a('0x26')]);return _0x3d5926(_0x19580a[_0xa34a('0x25')]['message']);}logger[_0xa34a('0x25')](_0xa34a('0x21'),_0xc08e6,_0x19580a[_0xa34a('0x25')]['message']);return _0x2f5ded(_0x19580a[_0xa34a('0x25')][_0xa34a('0x26')]);}else{logger[_0xa34a('0x20')](_0xa34a('0x21'),_0xc08e6,_0xa34a('0x23'));_0x2f5ded(_0x19580a[_0xa34a('0x27')]['message']);}})[_0xa34a('0x28')](function(_0x2afffe){logger['error'](_0xa34a('0x21'),_0xc08e6,_0x2afffe);_0x3d5926(_0x2afffe);});});}function respondWithStatusCode(_0x377c4a,_0x746078){_0x746078=_0x746078||0xcc;return function(_0x254b75){if(_0x254b75){return _0x377c4a[_0xa34a('0x29')](_0x746078);}return _0x377c4a[_0xa34a('0x2a')](_0x746078)[_0xa34a('0x2b')]();};}function respondWithResult(_0x54f08d,_0x351b9e){_0x351b9e=_0x351b9e||0xc8;return function(_0xb314d2){if(_0xb314d2){return _0x54f08d[_0xa34a('0x2a')](_0x351b9e)[_0xa34a('0x2c')](_0xb314d2);}};}function respondWithFilteredResult(_0x502b4d,_0x1ab30a){return function(_0x7ecf44){if(_0x7ecf44){var _0x30c843=typeof _0x1ab30a[_0xa34a('0x2d')]==='undefined'&&typeof _0x1ab30a[_0xa34a('0x2e')]===_0xa34a('0x2f');var _0x429d14=_0x7ecf44[_0xa34a('0x30')];var _0x48e428=_0x30c843?0x0:_0x1ab30a[_0xa34a('0x2d')];var _0x82350e=_0x30c843?_0x7ecf44[_0xa34a('0x30')]:_0x1ab30a[_0xa34a('0x2d')]+_0x1ab30a['limit'];var _0x1034d3;if(_0x82350e>=_0x429d14){_0x82350e=_0x429d14;_0x1034d3=0xc8;}else{_0x1034d3=0xce;}_0x502b4d[_0xa34a('0x2a')](_0x1034d3);return _0x502b4d['set'](_0xa34a('0x31'),_0x48e428+'-'+_0x82350e+'/'+_0x429d14)[_0xa34a('0x2c')](_0x7ecf44);}return null;};}function patchUpdates(_0x554cf6){return function(_0x5f4a05){try{jsonpatch[_0xa34a('0x32')](_0x5f4a05,_0x554cf6,!![]);}catch(_0x3e882b){return BPromise[_0xa34a('0x33')](_0x3e882b);}return _0x5f4a05[_0xa34a('0x34')]();};}function saveUpdates(_0xa8890c,_0x248324){return function(_0x5e490b){if(_0x5e490b){return _0x5e490b[_0xa34a('0x35')](_0xa8890c)[_0xa34a('0x1f')](function(_0x4d60de){return _0x4d60de;});}return null;};}function removeEntity(_0x120717,_0x3349c){return function(_0x39f804){if(_0x39f804){return _0x39f804[_0xa34a('0x36')]()['then'](function(){_0x120717[_0xa34a('0x2a')](0xcc)[_0xa34a('0x2b')]();});}};}function handleEntityNotFound(_0x457903,_0x5c5bf9){return function(_0xf9dd20){if(!_0xf9dd20){_0x457903[_0xa34a('0x29')](0x194);}return _0xf9dd20;};}function handleError(_0x38d3b2,_0xc93711){_0xc93711=_0xc93711||0x1f4;return function(_0x40db44){logger[_0xa34a('0x25')](_0x40db44['stack']);if(_0x40db44['name']){delete _0x40db44['name'];}_0x38d3b2[_0xa34a('0x2a')](_0xc93711)[_0xa34a('0x37')](_0x40db44);};}exports[_0xa34a('0x38')]=function(_0x46dc84,_0x2fede6){var _0xc74618={},_0x58b8ba={},_0x40b0d2={'count':0x0,'rows':[]};var _0xb4f345=_[_0xa34a('0x39')](db[_0xa34a('0x3a')][_0xa34a('0x3b')],function(_0x16e8f0){return{'name':_0x16e8f0['fieldName'],'type':_0x16e8f0[_0xa34a('0x3c')][_0xa34a('0x3d')]};});_0x58b8ba['model']=_[_0xa34a('0x39')](_0xb4f345,'name');_0x58b8ba[_0xa34a('0x3e')]=_[_0xa34a('0x3f')](_0x46dc84[_0xa34a('0x3e')]);_0x58b8ba[_0xa34a('0x40')]=_[_0xa34a('0x41')](_0x58b8ba[_0xa34a('0x42')],_0x58b8ba[_0xa34a('0x3e')]);_0xc74618[_0xa34a('0x43')]=_[_0xa34a('0x41')](_0x58b8ba['model'],qs['fields'](_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x44')]));_0xc74618['attributes']=_0xc74618[_0xa34a('0x43')][_0xa34a('0x45')]?_0xc74618[_0xa34a('0x43')]:_0x58b8ba[_0xa34a('0x42')];if(!_0x46dc84['query'][_0xa34a('0x46')](_0xa34a('0x47'))){_0xc74618[_0xa34a('0x2e')]=qs[_0xa34a('0x2e')](_0x46dc84['query']['limit']);_0xc74618['offset']=qs[_0xa34a('0x2d')](_0x46dc84['query'][_0xa34a('0x2d')]);}_0xc74618[_0xa34a('0x48')]=qs[_0xa34a('0x49')](_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x49')]);_0xc74618['where']=qs[_0xa34a('0x40')](_[_0xa34a('0x4a')](_0x46dc84[_0xa34a('0x3e')],_0x58b8ba[_0xa34a('0x40')]),_0xb4f345);if(_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x4b')]){_0xc74618['where']=_[_0xa34a('0x4c')](_0xc74618[_0xa34a('0x4d')],{'$or':_[_0xa34a('0x39')](_0xb4f345,function(_0x63d3ca){if(_0x63d3ca[_0xa34a('0x3c')]!==_0xa34a('0x4e')){var _0x5914dc={};_0x5914dc[_0x63d3ca[_0xa34a('0x4f')]]={'$like':'%'+_0x46dc84['query'][_0xa34a('0x4b')]+'%'};return _0x5914dc;}})});}_0xc74618=_[_0xa34a('0x4c')]({},_0xc74618,_0x46dc84[_0xa34a('0x50')]);var _0x4d5834={'where':_0xc74618[_0xa34a('0x4d')]};return db['Setting'][_0xa34a('0x30')](_0x4d5834)['then'](function(_0x3d0b24){_0x40b0d2[_0xa34a('0x30')]=_0x3d0b24;if(_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x51')]){_0xc74618[_0xa34a('0x52')]=[{'all':!![]}];}return db['Setting'][_0xa34a('0x53')](_0xc74618);})['then'](function(_0x87b76d){_0x40b0d2[_0xa34a('0x54')]=_0x87b76d;return _0x40b0d2;})[_0xa34a('0x1f')](respondWithFilteredResult(_0x2fede6,_0xc74618))[_0xa34a('0x28')](handleError(_0x2fede6,null));};exports[_0xa34a('0x55')]=function(_0xfe1d93,_0x30d59a){var _0xde8a7={'raw':![],'where':{'id':_0xfe1d93[_0xa34a('0x56')]['id']}},_0x4be0d0={};_0x4be0d0['model']=_['keys'](db['Setting'][_0xa34a('0x3b')]);_0x4be0d0['query']=_[_0xa34a('0x3f')](_0xfe1d93[_0xa34a('0x3e')]);_0x4be0d0['filters']=_[_0xa34a('0x41')](_0x4be0d0['model'],_0x4be0d0[_0xa34a('0x3e')]);_0xde8a7[_0xa34a('0x43')]=_[_0xa34a('0x41')](_0x4be0d0[_0xa34a('0x42')],qs['fields'](_0xfe1d93['query'][_0xa34a('0x44')]));_0xde8a7[_0xa34a('0x43')]=_0xde8a7[_0xa34a('0x43')][_0xa34a('0x45')]?_0xde8a7[_0xa34a('0x43')]:_0x4be0d0[_0xa34a('0x42')];if(_0xfe1d93[_0xa34a('0x3e')][_0xa34a('0x51')]){_0xde8a7[_0xa34a('0x52')]=[{'all':!![]}];}_0xde8a7=_[_0xa34a('0x4c')]({},_0xde8a7,_0xfe1d93['options']);return db[_0xa34a('0x3a')][_0xa34a('0x57')](_0xde8a7)[_0xa34a('0x1f')](handleEntityNotFound(_0x30d59a,null))['then'](respondWithResult(_0x30d59a,null))[_0xa34a('0x28')](handleError(_0x30d59a,null));};exports[_0xa34a('0x35')]=function(_0x4f80e5,_0x56ba98){if(_0x4f80e5[_0xa34a('0x58')]['id']){delete _0x4f80e5[_0xa34a('0x58')]['id'];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x4f80e5[_0xa34a('0x56')]['id']}})['then'](handleEntityNotFound(_0x56ba98,null))[_0xa34a('0x1f')](saveUpdates(_0x4f80e5[_0xa34a('0x58')],null))[_0xa34a('0x1f')](respondWithResult(_0x56ba98,null))[_0xa34a('0x28')](handleError(_0x56ba98,null));};exports[_0xa34a('0x59')]=function(_0x5dd258,_0xd5dd6a,_0x3e9cf7){if(_0x5dd258[_0xa34a('0x5a')]&&_0x5dd258[_0xa34a('0x5a')][_0xa34a('0x5b')]){_0x5dd258['body'][_0xa34a('0x5c')]=_0x5dd258['file'][_0xa34a('0x5b')];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x5dd258[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0xd5dd6a,null))['then'](saveUpdates(_0x5dd258[_0xa34a('0x58')],null))['then'](respondWithResult(_0xd5dd6a,null))[_0xa34a('0x28')](handleError(_0xd5dd6a,null));};exports['addLogoLogin']=function(_0x42c73d,_0x1f2255,_0x4dca47){if(_0x42c73d[_0xa34a('0x5a')]&&_0x42c73d[_0xa34a('0x5a')]['filename']){_0x42c73d[_0xa34a('0x58')][_0xa34a('0x5d')]=_0x42c73d['file']['filename'];}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x42c73d['params']['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x1f2255,null))[_0xa34a('0x1f')](saveUpdates(_0x42c73d[_0xa34a('0x58')],null))[_0xa34a('0x1f')](respondWithResult(_0x1f2255,null))[_0xa34a('0x28')](handleError(_0x1f2255,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x3de1de,_0x3f7a96,_0x5977ea){var _0x5a990d=_0xa34a('0x5e');var _0x25c6cb={'custom':![]};return utilLicense['getLicense']()[_0xa34a('0x1f')](function(_0x3dd354){if(_0x3dd354){_0x25c6cb=_0x3dd354;}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x3de1de[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),_0xa34a('0x60'),'defaultLogo',_0xa34a('0x61'),_0xa34a('0x62'),_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x3f7a96,null))['then'](function(_0x459ba7){if(_0x459ba7){var _0x5de8e3=_0x459ba7[_0xa34a('0x5c')]&&fs[_0xa34a('0x64')](path['join'](config['root'],_0x5a990d,_['toLower'](_0x459ba7[_0xa34a('0x5c')])))?path[_0xa34a('0x65')](config['root'],_0x5a990d,_[_0xa34a('0x66')](_0x459ba7[_0xa34a('0x5c')])):path[_0xa34a('0x65')](config['root'],_0x5a990d,_[_0xa34a('0x66')](_0xa34a('0x67')));var _0x2f6f52=_0xa34a('0x68')+_['upperFirst'](_0xa34a('0x5c'));if(_0x459ba7[_0x2f6f52]||!_0x25c6cb[_0xa34a('0x69')]){_0x5de8e3=path['join'](config[_0xa34a('0x6a')],_0x5a990d,_[_0xa34a('0x66')](_0xa34a('0x67')));}if(!fs[_0xa34a('0x64')](_0x5de8e3)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_['upperFirst'](_0xa34a('0x5c'))+'\x20not\x20found');}return _0x3f7a96['download'](_0x5de8e3);}})[_0xa34a('0x28')](handleError(_0x3f7a96,null));};var utilLicense=require('../../config/license/util');exports[_0xa34a('0x6d')]=function(_0x1f1a07,_0x49f6fe,_0x52bf0a){var _0x81216a=_0xa34a('0x5e');var _0x480f5f={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x354264){if(_0x354264){_0x480f5f=_0x354264;}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x1f1a07[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),'favicon',_0xa34a('0x6f'),_0xa34a('0x61'),'defaultPreferred',_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x49f6fe,null))['then'](function(_0x564093){if(_0x564093){var _0x2a6dfd=_0x564093[_0xa34a('0x5d')]&&fs[_0xa34a('0x64')](path[_0xa34a('0x65')](config['root'],_0x81216a,_['toLower'](_0x564093[_0xa34a('0x5d')])))?path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x81216a,_['toLower'](_0x564093[_0xa34a('0x5d')])):path['join'](config[_0xa34a('0x6a')],_0x81216a,_[_0xa34a('0x66')](_0xa34a('0x70')));var _0x3ede65=_0xa34a('0x68')+_[_0xa34a('0x71')](_0xa34a('0x5d'));if(_0x564093[_0x3ede65]||!_0x480f5f['custom']){_0x2a6dfd=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x81216a,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x2a6dfd)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_[_0xa34a('0x71')](_0xa34a('0x5d'))+'\x20not\x20found');}return _0x49f6fe[_0xa34a('0x72')](_0x2a6dfd);}})[_0xa34a('0x28')](handleError(_0x49f6fe,null));};exports[_0xa34a('0x73')]=function(_0x5e846b,_0x17d795){return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x5e846b['params']['id']},'attributes':[_0xa34a('0x74')]})[_0xa34a('0x1f')](respondWithResult(_0x17d795,null))[_0xa34a('0x28')](handleError(_0x17d795,null));};exports[_0xa34a('0x75')]=function(_0x3008b,_0x3c5ec4,_0x53e3e5){if(_0x3008b[_0xa34a('0x5a')]&&_0x3008b[_0xa34a('0x5a')]['filename']){_0x3008b[_0xa34a('0x58')][_0xa34a('0x5f')]=_0x3008b[_0xa34a('0x5a')][_0xa34a('0x5b')];}return db['Setting'][_0xa34a('0x57')]({'where':{'id':_0x3008b[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x3c5ec4,null))['then'](saveUpdates(_0x3008b['body'],null))[_0xa34a('0x1f')](respondWithResult(_0x3c5ec4,null))['catch'](handleError(_0x3c5ec4,null));};var utilLicense=require(_0xa34a('0x1a'));exports[_0xa34a('0x76')]=function(_0x36682b,_0x464168,_0x208536){var _0x4a4a3f=_0xa34a('0x5e');var _0x5e51e7={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x163407){if(_0x163407){_0x5e51e7=_0x163407;}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x36682b['params']['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),_0xa34a('0x60'),_0xa34a('0x6f'),_0xa34a('0x61'),_0xa34a('0x62'),'defaultFavicon'],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x464168,null))[_0xa34a('0x1f')](function(_0x230ba4){if(_0x230ba4){var _0x4a7f08=_0x230ba4[_0xa34a('0x5f')]&&fs[_0xa34a('0x64')](path[_0xa34a('0x65')](config['root'],_0x4a4a3f,_[_0xa34a('0x66')](_0x230ba4[_0xa34a('0x5f')])))?path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x4a4a3f,_['toLower'](_0x230ba4[_0xa34a('0x5f')])):path['join'](config['root'],_0x4a4a3f,_['toLower']('default_preferred.png'));var _0x284ad9=_0xa34a('0x68')+_[_0xa34a('0x71')]('preferred');if(_0x230ba4[_0x284ad9]||!_0x5e51e7['custom']||!_0x5e51e7[_0xa34a('0x5f')]){_0x4a7f08=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x4a4a3f,_[_0xa34a('0x66')](_0xa34a('0x77')));}if(!fs[_0xa34a('0x64')](_0x4a7f08)){throw new db[(_0xa34a('0x6b'))]['ValidationError'](_[_0xa34a('0x71')](_0xa34a('0x5f'))+_0xa34a('0x78'));}return _0x464168['download'](_0x4a7f08);}})['catch'](handleError(_0x464168,null));};exports[_0xa34a('0x79')]=function(_0x285bc1,_0x1b6a6a,_0x2c0c2a){if(_0x285bc1[_0xa34a('0x5a')]&&_0x285bc1[_0xa34a('0x5a')][_0xa34a('0x5b')]){_0x285bc1[_0xa34a('0x58')][_0xa34a('0x60')]=_0x285bc1[_0xa34a('0x5a')][_0xa34a('0x5b')];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x285bc1[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x1b6a6a,null))[_0xa34a('0x1f')](saveUpdates(_0x285bc1[_0xa34a('0x58')],null))['then'](respondWithResult(_0x1b6a6a,null))[_0xa34a('0x28')](handleError(_0x1b6a6a,null));};var utilLicense=require(_0xa34a('0x1a'));exports[_0xa34a('0x7a')]=function(_0xc28100,_0x2ff4a7,_0x379c76){var _0x256867='server/files/images/logos';var _0x1fa6a1={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x47364d){if(_0x47364d){_0x1fa6a1=_0x47364d;}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0xc28100[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),'preferred',_0xa34a('0x60'),_0xa34a('0x6f'),_0xa34a('0x61'),_0xa34a('0x62'),_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x2ff4a7,null))[_0xa34a('0x1f')](function(_0x3c854d){if(_0x3c854d){var _0xbe197d=_0x3c854d['favicon']&&fs['existsSync'](path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0x3c854d[_0xa34a('0x60')])))?path['join'](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0x3c854d[_0xa34a('0x60')])):path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_['toLower'](_0xa34a('0x7b')));var _0x4b3a13=_0xa34a('0x68')+_['upperFirst'](_0xa34a('0x60'));if(_0x3c854d[_0x4b3a13]||!_0x1fa6a1[_0xa34a('0x69')]){_0xbe197d=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0xa34a('0x7b')));}if(!fs['existsSync'](_0xbe197d)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_[_0xa34a('0x71')](_0xa34a('0x60'))+_0xa34a('0x78'));}return _0x2ff4a7[_0xa34a('0x72')](_0xbe197d);}})[_0xa34a('0x28')](handleError(_0x2ff4a7,null));};exports['getDate']=function(_0x47c328,_0x5d1634){var _0xe77593={'offset':moment()['utcOffset']()};_0xe77593[_0xa34a('0x7c')]=moment()[_0xa34a('0x7d')](_0xe77593[_0xa34a('0x2d')])[_0xa34a('0x7e')](_0xa34a('0x7f'));return _0x5d1634['status'](0xc8)[_0xa34a('0x37')](_0xe77593);}; \ No newline at end of file +var _0x6334=['defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','join','default_logo.svg','default','upperFirst','custom','root','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','Setting','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','show','keys','length','includeAll','body','find','params','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon'];(function(_0x28b0b2,_0x723ba5){var _0x40cfe2=function(_0x4f5b00){while(--_0x4f5b00){_0x28b0b2['push'](_0x28b0b2['shift']());}};_0x40cfe2(++_0x723ba5);}(_0x6334,0x119));var _0x4633=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x6334[_0x4d8dc3];return _0x9b03d9;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require(_0x4633('0x1'));var zipdir=require(_0x4633('0x2'));var jsonpatch=require(_0x4633('0x3'));var rp=require(_0x4633('0x4'));var moment=require(_0x4633('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4633('0x6'));var util=require(_0x4633('0x7'));var path=require(_0x4633('0x8'));var sox=require(_0x4633('0x9'));var csv=require(_0x4633('0xa'));var ejs=require(_0x4633('0xb'));var fs=require('fs');var fs_extra=require(_0x4633('0xc'));var _=require('lodash');var squel=require(_0x4633('0xd'));var crypto=require('crypto');var jsforce=require(_0x4633('0xe'));var deskjs=require(_0x4633('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4633('0x10'));var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4633('0x13'));var as=require(_0x4633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x15'))(_0x4633('0x16'));var utils=require(_0x4633('0x17'));var config=require(_0x4633('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4633('0x19'))['db'];var jayson=require(_0x4633('0x1a'));var client=jayson[_0x4633('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0b96,_0x49f5c3,_0x28e2bc,_0x1fd00c){return new BPromise(function(_0x579229,_0x52955e){var _0x1d967e=_0x1fd00c||client;return _0x1d967e['request'](_0x4d0b96,_0x28e2bc)[_0x4633('0x1c')](function(_0x33b6e7){logger[_0x4633('0x1d')](_0x4633('0x1e'),_0x49f5c3,'request\x20sent');logger[_0x4633('0x1f')](_0x4633('0x20'),_0x49f5c3,_0x4633('0x21'),JSON['stringify'](_0x33b6e7));if(_0x33b6e7[_0x4633('0x22')]){if(_0x33b6e7[_0x4633('0x22')][_0x4633('0x23')]===0x1f4){logger[_0x4633('0x22')](_0x4633('0x1e'),_0x49f5c3,_0x33b6e7['error'][_0x4633('0x24')]);return _0x52955e(_0x33b6e7[_0x4633('0x22')]['message']);}logger['error'](_0x4633('0x1e'),_0x49f5c3,_0x33b6e7['error'][_0x4633('0x24')]);return _0x579229(_0x33b6e7['error']['message']);}else{logger[_0x4633('0x1d')](_0x4633('0x1e'),_0x49f5c3,_0x4633('0x21'));_0x579229(_0x33b6e7[_0x4633('0x25')][_0x4633('0x24')]);}})[_0x4633('0x26')](function(_0x513fe5){logger[_0x4633('0x22')]('Setting,\x20%s,\x20%s',_0x49f5c3,_0x513fe5);_0x52955e(_0x513fe5);});});}function respondWithStatusCode(_0x22d9c1,_0xcfac3f){_0xcfac3f=_0xcfac3f||0xcc;return function(_0xe77cfc){if(_0xe77cfc){return _0x22d9c1[_0x4633('0x27')](_0xcfac3f);}return _0x22d9c1[_0x4633('0x28')](_0xcfac3f)['end']();};}function respondWithResult(_0x3af747,_0x399220){_0x399220=_0x399220||0xc8;return function(_0x37e3c4){if(_0x37e3c4){return _0x3af747[_0x4633('0x28')](_0x399220)[_0x4633('0x29')](_0x37e3c4);}};}function respondWithFilteredResult(_0x471d13,_0x1ba1ed){return function(_0x368582){if(_0x368582){var _0xef2ecf=typeof _0x1ba1ed[_0x4633('0x2a')]===_0x4633('0x2b')&&typeof _0x1ba1ed[_0x4633('0x2c')]===_0x4633('0x2b');var _0x2970a6=_0x368582[_0x4633('0x2d')];var _0x3f03aa=_0xef2ecf?0x0:_0x1ba1ed[_0x4633('0x2a')];var _0x139e5e=_0xef2ecf?_0x368582['count']:_0x1ba1ed[_0x4633('0x2a')]+_0x1ba1ed[_0x4633('0x2c')];var _0x393639;if(_0x139e5e>=_0x2970a6){_0x139e5e=_0x2970a6;_0x393639=0xc8;}else{_0x393639=0xce;}_0x471d13[_0x4633('0x28')](_0x393639);return _0x471d13[_0x4633('0x2e')](_0x4633('0x2f'),_0x3f03aa+'-'+_0x139e5e+'/'+_0x2970a6)['json'](_0x368582);}return null;};}function patchUpdates(_0x23c33c){return function(_0x52fc85){try{jsonpatch[_0x4633('0x30')](_0x52fc85,_0x23c33c,!![]);}catch(_0x20aa07){return BPromise[_0x4633('0x31')](_0x20aa07);}return _0x52fc85[_0x4633('0x32')]();};}function saveUpdates(_0xf32012,_0x1c4652){return function(_0x43e23f){if(_0x43e23f){return _0x43e23f[_0x4633('0x33')](_0xf32012)[_0x4633('0x1c')](function(_0x2c5505){return _0x2c5505;});}return null;};}function removeEntity(_0xa6d4db,_0x53eeea){return function(_0x37ce05){if(_0x37ce05){return _0x37ce05[_0x4633('0x34')]()['then'](function(){_0xa6d4db['status'](0xcc)[_0x4633('0x35')]();});}};}function handleEntityNotFound(_0x26625a,_0x5177f2){return function(_0x34b211){if(!_0x34b211){_0x26625a[_0x4633('0x27')](0x194);}return _0x34b211;};}function handleError(_0x439005,_0x3dd3be){_0x3dd3be=_0x3dd3be||0x1f4;return function(_0x483c5d){logger[_0x4633('0x22')](_0x483c5d['stack']);if(_0x483c5d[_0x4633('0x36')]){delete _0x483c5d[_0x4633('0x36')];}_0x439005[_0x4633('0x28')](_0x3dd3be)[_0x4633('0x37')](_0x483c5d);};}exports[_0x4633('0x38')]=function(_0x343bd3,_0x15c02e){var _0x439a04={},_0x546390={},_0x29b0b5={'count':0x0,'rows':[]};var _0x107616=_['map'](db[_0x4633('0x39')][_0x4633('0x3a')],function(_0x11fb61){return{'name':_0x11fb61[_0x4633('0x3b')],'type':_0x11fb61['type']['key']};});_0x546390[_0x4633('0x3c')]=_['map'](_0x107616,'name');_0x546390[_0x4633('0x3d')]=_['keys'](_0x343bd3['query']);_0x546390[_0x4633('0x3e')]=_[_0x4633('0x3f')](_0x546390[_0x4633('0x3c')],_0x546390[_0x4633('0x3d')]);_0x439a04[_0x4633('0x40')]=_['intersection'](_0x546390[_0x4633('0x3c')],qs['fields'](_0x343bd3[_0x4633('0x3d')][_0x4633('0x41')]));_0x439a04[_0x4633('0x40')]=_0x439a04[_0x4633('0x40')]['length']?_0x439a04[_0x4633('0x40')]:_0x546390['model'];if(!_0x343bd3[_0x4633('0x3d')][_0x4633('0x42')](_0x4633('0x43'))){_0x439a04[_0x4633('0x2c')]=qs[_0x4633('0x2c')](_0x343bd3['query']['limit']);_0x439a04[_0x4633('0x2a')]=qs[_0x4633('0x2a')](_0x343bd3[_0x4633('0x3d')][_0x4633('0x2a')]);}_0x439a04[_0x4633('0x44')]=qs['sort'](_0x343bd3[_0x4633('0x3d')]['sort']);_0x439a04[_0x4633('0x45')]=qs['filters'](_[_0x4633('0x46')](_0x343bd3['query'],_0x546390[_0x4633('0x3e')]),_0x107616);if(_0x343bd3[_0x4633('0x3d')][_0x4633('0x47')]){_0x439a04[_0x4633('0x45')]=_[_0x4633('0x48')](_0x439a04[_0x4633('0x45')],{'$or':_[_0x4633('0x49')](_0x107616,function(_0x4649d1){if(_0x4649d1[_0x4633('0x4a')]!==_0x4633('0x4b')){var _0x2e6b11={};_0x2e6b11[_0x4649d1[_0x4633('0x36')]]={'$like':'%'+_0x343bd3[_0x4633('0x3d')][_0x4633('0x47')]+'%'};return _0x2e6b11;}})});}_0x439a04=_[_0x4633('0x48')]({},_0x439a04,_0x343bd3[_0x4633('0x4c')]);var _0x13ffa5={'where':_0x439a04[_0x4633('0x45')]};return db[_0x4633('0x39')][_0x4633('0x2d')](_0x13ffa5)[_0x4633('0x1c')](function(_0x486c29){_0x29b0b5['count']=_0x486c29;if(_0x343bd3[_0x4633('0x3d')]['includeAll']){_0x439a04['include']=[{'all':!![]}];}return db['Setting'][_0x4633('0x4d')](_0x439a04);})[_0x4633('0x1c')](function(_0x5cb4cc){_0x29b0b5[_0x4633('0x4e')]=_0x5cb4cc;return _0x29b0b5;})[_0x4633('0x1c')](respondWithFilteredResult(_0x15c02e,_0x439a04))[_0x4633('0x26')](handleError(_0x15c02e,null));};exports[_0x4633('0x4f')]=function(_0x3c752b,_0x1273f6){var _0x4d3cf4={'raw':![],'where':{'id':_0x3c752b['params']['id']}},_0x4ca3d6={};_0x4ca3d6[_0x4633('0x3c')]=_[_0x4633('0x50')](db[_0x4633('0x39')]['rawAttributes']);_0x4ca3d6[_0x4633('0x3d')]=_[_0x4633('0x50')](_0x3c752b['query']);_0x4ca3d6[_0x4633('0x3e')]=_[_0x4633('0x3f')](_0x4ca3d6[_0x4633('0x3c')],_0x4ca3d6['query']);_0x4d3cf4['attributes']=_[_0x4633('0x3f')](_0x4ca3d6[_0x4633('0x3c')],qs[_0x4633('0x41')](_0x3c752b[_0x4633('0x3d')][_0x4633('0x41')]));_0x4d3cf4['attributes']=_0x4d3cf4[_0x4633('0x40')][_0x4633('0x51')]?_0x4d3cf4[_0x4633('0x40')]:_0x4ca3d6[_0x4633('0x3c')];if(_0x3c752b[_0x4633('0x3d')][_0x4633('0x52')]){_0x4d3cf4['include']=[{'all':!![]}];}_0x4d3cf4=_[_0x4633('0x48')]({},_0x4d3cf4,_0x3c752b['options']);return db['Setting']['find'](_0x4d3cf4)[_0x4633('0x1c')](handleEntityNotFound(_0x1273f6,null))[_0x4633('0x1c')](respondWithResult(_0x1273f6,null))[_0x4633('0x26')](handleError(_0x1273f6,null));};exports[_0x4633('0x33')]=function(_0x555b7c,_0x13fe90){if(_0x555b7c['body']['id']){delete _0x555b7c[_0x4633('0x53')]['id'];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x555b7c[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x13fe90,null))[_0x4633('0x1c')](saveUpdates(_0x555b7c[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x13fe90,null))['catch'](handleError(_0x13fe90,null));};exports[_0x4633('0x56')]=function(_0x5ebb5a,_0x413707,_0x22ed63){if(_0x5ebb5a[_0x4633('0x57')]&&_0x5ebb5a[_0x4633('0x57')][_0x4633('0x58')]){_0x5ebb5a[_0x4633('0x53')][_0x4633('0x59')]=_0x5ebb5a[_0x4633('0x57')][_0x4633('0x58')];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x5ebb5a[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x413707,null))['then'](saveUpdates(_0x5ebb5a[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x413707,null))[_0x4633('0x26')](handleError(_0x413707,null));};exports[_0x4633('0x5a')]=function(_0x11050c,_0x19b192,_0x219aad){if(_0x11050c[_0x4633('0x57')]&&_0x11050c[_0x4633('0x57')][_0x4633('0x58')]){_0x11050c[_0x4633('0x53')]['loginLogo']=_0x11050c['file'][_0x4633('0x58')];}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0x11050c[_0x4633('0x55')]['id']}})['then'](handleEntityNotFound(_0x19b192,null))[_0x4633('0x1c')](saveUpdates(_0x11050c[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x19b192,null))[_0x4633('0x26')](handleError(_0x19b192,null));};var utilLicense=require(_0x4633('0x5b'));exports['getLogo']=function(_0x22271a,_0x3eab58,_0x3f2bf2){var _0x2adc7c=_0x4633('0x5c');var _0x4fba21={'custom':![]};return utilLicense[_0x4633('0x5d')]()[_0x4633('0x1c')](function(_0xd29fcb){if(_0xd29fcb){_0x4fba21=_0xd29fcb;}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0x22271a[_0x4633('0x55')]['id']},'attributes':[_0x4633('0x59'),_0x4633('0x5e'),_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x3eab58,null))['then'](function(_0x4e11cd){if(_0x4e11cd){var _0x144ae3=_0x4e11cd[_0x4633('0x59')]&&fs[_0x4633('0x65')](path['join'](config['root'],_0x2adc7c,_[_0x4633('0x66')](_0x4e11cd[_0x4633('0x59')])))?path[_0x4633('0x67')](config['root'],_0x2adc7c,_[_0x4633('0x66')](_0x4e11cd[_0x4633('0x59')])):path[_0x4633('0x67')](config['root'],_0x2adc7c,_['toLower'](_0x4633('0x68')));var _0x5e8efc=_0x4633('0x69')+_[_0x4633('0x6a')]('logo');if(_0x4e11cd[_0x5e8efc]||!_0x4fba21[_0x4633('0x6b')]){_0x144ae3=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x2adc7c,_[_0x4633('0x66')]('default_logo.svg'));}if(!fs[_0x4633('0x65')](_0x144ae3)){throw new db[(_0x4633('0x6d'))][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x59'))+_0x4633('0x6f'));}return _0x3eab58[_0x4633('0x70')](_0x144ae3);}})['catch'](handleError(_0x3eab58,null));};var utilLicense=require(_0x4633('0x5b'));exports[_0x4633('0x71')]=function(_0x91a8fe,_0x2fa28f,_0x5507d9){var _0x51453e=_0x4633('0x5c');var _0x4a4470={'custom':![]};return utilLicense[_0x4633('0x5d')]()['then'](function(_0x48ca0f){if(_0x48ca0f){_0x4a4470=_0x48ca0f;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x91a8fe['params']['id']},'attributes':[_0x4633('0x59'),_0x4633('0x5e'),_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x2fa28f,null))[_0x4633('0x1c')](function(_0x5c52e6){if(_0x5c52e6){var _0x1ba99d=_0x5c52e6['loginLogo']&&fs[_0x4633('0x65')](path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x51453e,_[_0x4633('0x66')](_0x5c52e6[_0x4633('0x5e')])))?path[_0x4633('0x67')](config['root'],_0x51453e,_[_0x4633('0x66')](_0x5c52e6[_0x4633('0x5e')])):path[_0x4633('0x67')](config['root'],_0x51453e,_[_0x4633('0x66')](_0x4633('0x72')));var _0xf8dbcf=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x5e'));if(_0x5c52e6[_0xf8dbcf]||!_0x4a4470['custom']){_0x1ba99d=path['join'](config[_0x4633('0x6c')],_0x51453e,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1ba99d)){throw new db['Sequelize'][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x5e'))+_0x4633('0x6f'));}return _0x2fa28f[_0x4633('0x70')](_0x1ba99d);}})['catch'](handleError(_0x2fa28f,null));};exports[_0x4633('0x73')]=function(_0x303b7e,_0x24be82){return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x303b7e[_0x4633('0x55')]['id']},'attributes':['securePassword']})[_0x4633('0x1c')](respondWithResult(_0x24be82,null))['catch'](handleError(_0x24be82,null));};exports[_0x4633('0x74')]=function(_0xec89db,_0x53b7ca,_0x2ee435){if(_0xec89db[_0x4633('0x57')]&&_0xec89db['file'][_0x4633('0x58')]){_0xec89db[_0x4633('0x53')][_0x4633('0x5f')]=_0xec89db['file']['filename'];}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0xec89db['params']['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x53b7ca,null))['then'](saveUpdates(_0xec89db[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x53b7ca,null))[_0x4633('0x26')](handleError(_0x53b7ca,null));};var utilLicense=require(_0x4633('0x5b'));exports[_0x4633('0x75')]=function(_0x40e4ae,_0x37a8d1,_0x3b44c9){var _0x7c187c=_0x4633('0x5c');var _0x2be991={'custom':![]};return utilLicense['getLicense']()[_0x4633('0x1c')](function(_0x43a9e7){if(_0x43a9e7){_0x2be991=_0x43a9e7;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x40e4ae[_0x4633('0x55')]['id']},'attributes':[_0x4633('0x59'),'loginLogo',_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x37a8d1,null))['then'](function(_0x4e820a){if(_0x4e820a){var _0x479679=_0x4e820a['preferred']&&fs['existsSync'](path[_0x4633('0x67')](config['root'],_0x7c187c,_['toLower'](_0x4e820a[_0x4633('0x5f')])))?path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x7c187c,_[_0x4633('0x66')](_0x4e820a[_0x4633('0x5f')])):path[_0x4633('0x67')](config['root'],_0x7c187c,_[_0x4633('0x66')](_0x4633('0x76')));var _0x519447=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x5f'));if(_0x4e820a[_0x519447]||!_0x2be991[_0x4633('0x6b')]||!_0x2be991[_0x4633('0x5f')]){_0x479679=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x7c187c,_['toLower'](_0x4633('0x76')));}if(!fs[_0x4633('0x65')](_0x479679)){throw new db['Sequelize'][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x5f'))+_0x4633('0x6f'));}return _0x37a8d1['download'](_0x479679);}})[_0x4633('0x26')](handleError(_0x37a8d1,null));};exports[_0x4633('0x77')]=function(_0x15d271,_0x2ed130,_0x44d7b6){if(_0x15d271[_0x4633('0x57')]&&_0x15d271[_0x4633('0x57')]['filename']){_0x15d271[_0x4633('0x53')][_0x4633('0x60')]=_0x15d271[_0x4633('0x57')][_0x4633('0x58')];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x15d271[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x2ed130,null))['then'](saveUpdates(_0x15d271['body'],null))[_0x4633('0x1c')](respondWithResult(_0x2ed130,null))[_0x4633('0x26')](handleError(_0x2ed130,null));};var utilLicense=require('../../config/license/util');exports[_0x4633('0x78')]=function(_0x277a4b,_0x24d05c,_0x9157bd){var _0x4275f8=_0x4633('0x5c');var _0x35b95d={'custom':![]};return utilLicense[_0x4633('0x5d')]()[_0x4633('0x1c')](function(_0x28d397){if(_0x28d397){_0x35b95d=_0x28d397;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x277a4b['params']['id']},'attributes':[_0x4633('0x59'),'loginLogo',_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x24d05c,null))['then'](function(_0x125d90){if(_0x125d90){var _0x220415=_0x125d90['favicon']&&fs[_0x4633('0x65')](path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x4275f8,_[_0x4633('0x66')](_0x125d90[_0x4633('0x60')])))?path[_0x4633('0x67')](config['root'],_0x4275f8,_[_0x4633('0x66')](_0x125d90['favicon'])):path['join'](config[_0x4633('0x6c')],_0x4275f8,_[_0x4633('0x66')](_0x4633('0x79')));var _0xcbd3a3=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x60'));if(_0x125d90[_0xcbd3a3]||!_0x35b95d[_0x4633('0x6b')]){_0x220415=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x4275f8,_['toLower'](_0x4633('0x79')));}if(!fs['existsSync'](_0x220415)){throw new db[(_0x4633('0x6d'))][(_0x4633('0x6e'))](_[_0x4633('0x6a')]('favicon')+_0x4633('0x6f'));}return _0x24d05c[_0x4633('0x70')](_0x220415);}})[_0x4633('0x26')](handleError(_0x24d05c,null));};exports[_0x4633('0x7a')]=function(_0x2a9c3b,_0x38712e){var _0x50bbf7={'offset':moment()[_0x4633('0x7b')]()};_0x50bbf7[_0x4633('0x7c')]=moment()[_0x4633('0x7b')](_0x50bbf7['offset'])['format'](_0x4633('0x7d'));return _0x38712e[_0x4633('0x28')](0xc8)['send'](_0x50bbf7);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9afbafe..b9b8f91 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x008c,0x188));var _0xc008=function(_0x5da107,_0x10357c){_0x5da107=_0x5da107-0x0;var _0x224f15=_0x008c[_0x5da107];return _0x224f15;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x008c,0x188));var _0xc008=function(_0x575783,_0x4f66f6){_0x575783=_0x575783-0x0;var _0x1aeae0=_0x008c[_0x575783];return _0x1aeae0;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index e48d36a..95069bc 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 _0xc2a0=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSetting','Setting','options','raw','where','attributes','include','model','map','lodash'];(function(_0x4cfaf7,_0x57c866){var _0x3776bf=function(_0x17c62a){while(--_0x17c62a){_0x4cfaf7['push'](_0x4cfaf7['shift']());}};_0x3776bf(++_0x57c866);}(_0xc2a0,0x192));var _0x0c2a=function(_0x2efc38,_0x2d6e24){_0x2efc38=_0x2efc38-0x0;var _0x28d506=_0xc2a0[_0x2efc38];return _0x28d506;};'use strict';var _=require(_0x0c2a('0x0'));var util=require('util');var moment=require(_0x0c2a('0x1'));var BPromise=require(_0x0c2a('0x2'));var rs=require(_0x0c2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c2a('0x4'));var logger=require(_0x0c2a('0x5'))(_0x0c2a('0x6'));var config=require(_0x0c2a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c2a('0x8')][_0x0c2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19217e,_0x5742d1,_0x4981db){return new BPromise(function(_0x12d5e7,_0x503811){return client[_0x0c2a('0xa')](_0x19217e,_0x4981db)[_0x0c2a('0xb')](function(_0x538ed7){logger[_0x0c2a('0xc')](_0x0c2a('0xd'),_0x5742d1,'request\x20sent');logger[_0x0c2a('0xe')](_0x0c2a('0xf'),_0x5742d1,_0x0c2a('0x10'),JSON[_0x0c2a('0x11')](_0x538ed7));if(_0x538ed7['error']){if(_0x538ed7[_0x0c2a('0x12')][_0x0c2a('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x5742d1,_0x538ed7['error'][_0x0c2a('0x14')]);return _0x503811(_0x538ed7[_0x0c2a('0x12')][_0x0c2a('0x14')]);}logger[_0x0c2a('0x12')]('Setting,\x20%s,\x20%s',_0x5742d1,_0x538ed7[_0x0c2a('0x12')][_0x0c2a('0x14')]);return _0x12d5e7(_0x538ed7[_0x0c2a('0x12')][_0x0c2a('0x14')]);}else{logger[_0x0c2a('0xc')](_0x0c2a('0xd'),_0x5742d1,_0x0c2a('0x10'));_0x12d5e7(_0x538ed7['result']['message']);}})[_0x0c2a('0x15')](function(_0x1f608f){logger['error'](_0x0c2a('0xd'),_0x5742d1,_0x1f608f);_0x503811(_0x1f608f);});});}exports[_0x0c2a('0x16')]=function(_0x6d6919){var _0x2a2209=this;return new Promise(function(_0x29c184,_0x4ee42e){return db[_0x0c2a('0x17')]['find']({'raw':_0x6d6919[_0x0c2a('0x18')]?_0x6d6919[_0x0c2a('0x18')][_0x0c2a('0x19')]===undefined?!![]:![]:!![],'where':_0x6d6919[_0x0c2a('0x18')]?_0x6d6919['options'][_0x0c2a('0x1a')]||null:null,'attributes':_0x6d6919[_0x0c2a('0x18')]?_0x6d6919[_0x0c2a('0x18')][_0x0c2a('0x1b')]||null:null,'include':_0x6d6919[_0x0c2a('0x18')]?_0x6d6919[_0x0c2a('0x18')][_0x0c2a('0x1c')]?_['map'](_0x6d6919[_0x0c2a('0x18')][_0x0c2a('0x1c')],function(_0xc67757){return{'model':db[_0xc67757[_0x0c2a('0x1d')]],'as':_0xc67757['as'],'attributes':_0xc67757['attributes'],'include':_0xc67757[_0x0c2a('0x1c')]?_[_0x0c2a('0x1e')](_0xc67757[_0x0c2a('0x1c')],function(_0x460f6a){return{'model':db[_0x460f6a[_0x0c2a('0x1d')]],'as':_0x460f6a['as'],'attributes':_0x460f6a['attributes'],'include':_0x460f6a['include']?_[_0x0c2a('0x1e')](_0x460f6a[_0x0c2a('0x1c')],function(_0xb2fd00){return{'model':db[_0xb2fd00[_0x0c2a('0x1d')]],'as':_0xb2fd00['as'],'attributes':_0xb2fd00[_0x0c2a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55f44c){logger[_0x0c2a('0xc')]('ShowSetting',_0x6d6919);logger['debug'](_0x0c2a('0x16'),_0x6d6919,JSON[_0x0c2a('0x11')](_0x55f44c));_0x29c184(_0x55f44c);})[_0x0c2a('0x15')](function(_0x526553){logger[_0x0c2a('0x12')](_0x0c2a('0x16'),_0x526553['message'],_0x6d6919);_0x4ee42e(_0x2a2209[_0x0c2a('0x12')](0x1f4,_0x526553['message']));});});}; \ No newline at end of file +var _0x6cf1=['code','Setting,\x20%s,\x20%s','message','result','Setting','options','raw','attributes','map','include','model','ShowSetting','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ec385,_0x59b5f2){var _0x272dba=function(_0x10cca8){while(--_0x10cca8){_0x5ec385['push'](_0x5ec385['shift']());}};_0x272dba(++_0x59b5f2);}(_0x6cf1,0x99));var _0x16cf=function(_0x369546,_0x41aecb){_0x369546=_0x369546-0x0;var _0x4d8690=_0x6cf1[_0x369546];return _0x4d8690;};'use strict';var _=require(_0x16cf('0x0'));var util=require('util');var moment=require(_0x16cf('0x1'));var BPromise=require(_0x16cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16cf('0x3'));var db=require(_0x16cf('0x4'))['db'];var utils=require(_0x16cf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16cf('0x6'));var jayson=require(_0x16cf('0x7'));var client=jayson[_0x16cf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7b69,_0x1653ba,_0x4b869b){return new BPromise(function(_0x318833,_0x1bed9e){return client['request'](_0x5d7b69,_0x4b869b)['then'](function(_0x245229){logger[_0x16cf('0x9')]('Setting,\x20%s,\x20%s',_0x1653ba,_0x16cf('0xa'));logger[_0x16cf('0xb')](_0x16cf('0xc'),_0x1653ba,'request\x20sent',JSON[_0x16cf('0xd')](_0x245229));if(_0x245229[_0x16cf('0xe')]){if(_0x245229['error'][_0x16cf('0xf')]===0x1f4){logger[_0x16cf('0xe')](_0x16cf('0x10'),_0x1653ba,_0x245229['error'][_0x16cf('0x11')]);return _0x1bed9e(_0x245229[_0x16cf('0xe')][_0x16cf('0x11')]);}logger['error'](_0x16cf('0x10'),_0x1653ba,_0x245229[_0x16cf('0xe')][_0x16cf('0x11')]);return _0x318833(_0x245229['error'][_0x16cf('0x11')]);}else{logger[_0x16cf('0x9')](_0x16cf('0x10'),_0x1653ba,_0x16cf('0xa'));_0x318833(_0x245229[_0x16cf('0x12')][_0x16cf('0x11')]);}})['catch'](function(_0x5c2c01){logger[_0x16cf('0xe')](_0x16cf('0x10'),_0x1653ba,_0x5c2c01);_0x1bed9e(_0x5c2c01);});});}exports['ShowSetting']=function(_0x537d84){var _0x4dc1af=this;return new Promise(function(_0x405747,_0x511d38){return db[_0x16cf('0x13')]['find']({'raw':_0x537d84[_0x16cf('0x14')]?_0x537d84[_0x16cf('0x14')][_0x16cf('0x15')]===undefined?!![]:![]:!![],'where':_0x537d84[_0x16cf('0x14')]?_0x537d84['options']['where']||null:null,'attributes':_0x537d84['options']?_0x537d84['options'][_0x16cf('0x16')]||null:null,'include':_0x537d84[_0x16cf('0x14')]?_0x537d84['options']['include']?_[_0x16cf('0x17')](_0x537d84[_0x16cf('0x14')][_0x16cf('0x18')],function(_0x33e2ac){return{'model':db[_0x33e2ac[_0x16cf('0x19')]],'as':_0x33e2ac['as'],'attributes':_0x33e2ac[_0x16cf('0x16')],'include':_0x33e2ac['include']?_['map'](_0x33e2ac[_0x16cf('0x18')],function(_0x57ad3d){return{'model':db[_0x57ad3d[_0x16cf('0x19')]],'as':_0x57ad3d['as'],'attributes':_0x57ad3d['attributes'],'include':_0x57ad3d[_0x16cf('0x18')]?_['map'](_0x57ad3d['include'],function(_0x336757){return{'model':db[_0x336757[_0x16cf('0x19')]],'as':_0x336757['as'],'attributes':_0x336757['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21a5d3){logger[_0x16cf('0x9')](_0x16cf('0x1a'),_0x537d84);logger['debug'](_0x16cf('0x1a'),_0x537d84,JSON[_0x16cf('0xd')](_0x21a5d3));_0x405747(_0x21a5d3);})[_0x16cf('0x1b')](function(_0x475c15){logger[_0x16cf('0xe')]('ShowSetting',_0x475c15[_0x16cf('0x11')],_0x537d84);_0x511d38(_0x4dc1af[_0x16cf('0xe')](0x1f4,_0x475c15['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index eb904e6..2e7cfe9 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 _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x4302e5,_0xf6fb28){var _0x4e4ffa=function(_0x2ab6eb){while(--_0x2ab6eb){_0x4302e5['push'](_0x4302e5['shift']());}};_0x4e4ffa(++_0xf6fb28);}(_0x53ec,0x192));var _0xc53e=function(_0x5b0b0f,_0x522c30){_0x5b0b0f=_0x5b0b0f-0x0;var _0x42ea47=_0x53ec[_0x5b0b0f];return _0x42ea47;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x2487cd,_0x299728){var _0x1956f1=function(_0x48bb65){while(--_0x48bb65){_0x2487cd['push'](_0x2487cd['shift']());}};_0x1956f1(++_0x299728);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 11d1742..dbb9958 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 _0xf863=['twilio','skebby','connectel','clicksend','bandwidth','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate'];(function(_0xfca40f,_0x8aedea){var _0x363fd4=function(_0x243d71){while(--_0x243d71){_0xfca40f['push'](_0xfca40f['shift']());}};_0x363fd4(++_0x8aedea);}(_0xf863,0x1ef));var _0x3f86=function(_0x370eeb,_0x247806){_0x370eeb=_0x370eeb-0x0;var _0x1001e8=_0xf863[_0x370eeb];return _0x1001e8;};'use strict';var Sequelize=require(_0x3f86('0x0'));var rs=require('randomstring');module[_0x3f86('0x1')]={'name':{'type':Sequelize[_0x3f86('0x2')],'unique':_0x3f86('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x3f86('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3f86('0x2')],'defaultValue':function(){return rs[_0x3f86('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x3f86('0x5'),_0x3f86('0x6'),_0x3f86('0x7'),_0x3f86('0x8'),'plivo','clickatell',_0x3f86('0x9'),_0x3f86('0xa'),_0x3f86('0xb'),_0x3f86('0xc'))},'accountSid':{'type':Sequelize[_0x3f86('0x2')]},'authId':{'type':Sequelize[_0x3f86('0x2')]},'authToken':{'type':Sequelize[_0x3f86('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x3f86('0x2')]},'password':{'type':Sequelize[_0x3f86('0x2')]},'apiKey':{'type':Sequelize[_0x3f86('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x3f86('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3f86('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3f86('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3f86('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3f86('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3f86('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3f86('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3f86('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3f86('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x3f86('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3f86('0x10'),'set':function(_0x345ae3){if(!_0x345ae3)this[_0x3f86('0x11')](_0x3f86('0x12'),null);this['setDataValue'](_0x3f86('0x13'),_0x345ae3);}}}; \ No newline at end of file +var _0x9a18=['twilio','skebby','connectel','clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x3d0fe1,_0x1d72cc){var _0x2999fa=function(_0x42fc41){while(--_0x42fc41){_0x3d0fe1['push'](_0x3d0fe1['shift']());}};_0x2999fa(++_0x1d72cc);}(_0x9a18,0x1b1));var _0x89a1=function(_0x3114df,_0x1cc087){_0x3114df=_0x3114df-0x0;var _0x82ddad=_0x9a18[_0x3114df];return _0x82ddad;};'use strict';var Sequelize=require(_0x89a1('0x0'));var rs=require(_0x89a1('0x1'));module[_0x89a1('0x2')]={'name':{'type':Sequelize[_0x89a1('0x3')],'unique':_0x89a1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x89a1('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x89a1('0x3')],'defaultValue':function(){return rs[_0x89a1('0x5')]();}},'phone':{'type':Sequelize[_0x89a1('0x3')]},'type':{'type':Sequelize[_0x89a1('0x6')](_0x89a1('0x7'),_0x89a1('0x8'),_0x89a1('0x9'),_0x89a1('0xa'),'plivo',_0x89a1('0xb'),'bandwidth',_0x89a1('0xc'),_0x89a1('0xd'),_0x89a1('0xe'))},'accountSid':{'type':Sequelize[_0x89a1('0x3')]},'authId':{'type':Sequelize[_0x89a1('0x3')]},'authToken':{'type':Sequelize[_0x89a1('0x3')]},'smsMethod':{'type':Sequelize[_0x89a1('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x89a1('0x3')]},'password':{'type':Sequelize[_0x89a1('0x3')]},'apiKey':{'type':Sequelize[_0x89a1('0x3')]},'applicationId':{'type':Sequelize[_0x89a1('0x3')]},'accountId':{'type':Sequelize[_0x89a1('0x3')]},'senderString':{'type':Sequelize[_0x89a1('0x3')]},'deliveryReport':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x89a1('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x89a1('0x10');}},'notificationSound':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x89a1('0x11')],'comment':_0x89a1('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![],'comment':_0x89a1('0x13'),'set':function(_0x593e30){if(!_0x593e30)this[_0x89a1('0x14')]('mandatoryDispositionPauseId',null);this[_0x89a1('0x14')](_0x89a1('0x15'),_0x593e30);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cf919b2..a4fa7a0 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 _0xee70=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','Pause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','notify','sms','SmsApplication','Applications','account','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','text','connectel','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','SmsInteraction','interaction','created','autoclose','push','applications','close','unmanaged','SmsMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','bulkCreate','findAndCountAll','getApplications','getInteractions','Tags','tag','to\x20is\x20mandatory','List','out','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','infobip','DELIVERED','groupName','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','ACCEPTD','message-id','state','addAgents','omit','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xee70,0xdd));var _0x0ee7=function(_0x581018,_0x3aa713){_0x581018=_0x581018-0x0;var _0x57bb29=_0xee70[_0x581018];return _0x57bb29;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ee7('0x0'));var jsonpatch=require(_0x0ee7('0x1'));var rp=require(_0x0ee7('0x2'));var moment=require(_0x0ee7('0x3'));var BPromise=require(_0x0ee7('0x4'));var Mustache=require(_0x0ee7('0x5'));var util=require(_0x0ee7('0x6'));var path=require(_0x0ee7('0x7'));var sox=require(_0x0ee7('0x8'));var csv=require(_0x0ee7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ee7('0xa'));var _=require(_0x0ee7('0xb'));var squel=require(_0x0ee7('0xc'));var crypto=require(_0x0ee7('0xd'));var jsforce=require(_0x0ee7('0xe'));var deskjs=require(_0x0ee7('0xf'));var toCsv=require(_0x0ee7('0x9'));var querystring=require('querystring');var Papa=require(_0x0ee7('0x10'));var Redis=require('ioredis');var authService=require(_0x0ee7('0x11'));var qs=require(_0x0ee7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ee7('0x13'));var logger=require(_0x0ee7('0x14'))(_0x0ee7('0x15'));var utils=require(_0x0ee7('0x16'));var config=require(_0x0ee7('0x17'));var licenseUtil=require(_0x0ee7('0x18'));var db=require(_0x0ee7('0x19'))['db'];config['redis']=_[_0x0ee7('0x1a')](config[_0x0ee7('0x1b')],{'host':_0x0ee7('0x1c'),'port':0x18eb});var socket=require(_0x0ee7('0x1d'))(new Redis(config['redis']));require(_0x0ee7('0x1e'))[_0x0ee7('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0ee7('0x20')][_0x0ee7('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2a923e,_0x2a1006,_0x119463,_0x511b31){return new BPromise(function(_0x14eb83,_0x55e7ee){var _0x444fcf=_0x511b31||client;return _0x444fcf['request'](_0x2a923e,_0x119463)[_0x0ee7('0x22')](function(_0x55f220){logger[_0x0ee7('0x23')]('SmsAccount,\x20%s,\x20%s',_0x2a1006,_0x0ee7('0x24'));logger[_0x0ee7('0x25')](_0x0ee7('0x26'),_0x2a1006,_0x0ee7('0x24'),JSON[_0x0ee7('0x27')](_0x55f220));if(_0x55f220[_0x0ee7('0x28')]){if(_0x55f220['error'][_0x0ee7('0x29')]===0x1f4){logger[_0x0ee7('0x28')](_0x0ee7('0x2a'),_0x2a1006,_0x55f220[_0x0ee7('0x28')]['message']);return _0x55e7ee(_0x55f220[_0x0ee7('0x28')][_0x0ee7('0x2b')]);}logger[_0x0ee7('0x28')](_0x0ee7('0x2a'),_0x2a1006,_0x55f220['error'][_0x0ee7('0x2b')]);return _0x14eb83(_0x55f220[_0x0ee7('0x28')][_0x0ee7('0x2b')]);}else{logger[_0x0ee7('0x23')](_0x0ee7('0x2a'),_0x2a1006,_0x0ee7('0x24'));_0x14eb83(_0x55f220[_0x0ee7('0x2c')][_0x0ee7('0x2b')]);}})[_0x0ee7('0x2d')](function(_0x4f617b){logger[_0x0ee7('0x28')](_0x0ee7('0x2a'),_0x2a1006,_0x4f617b);_0x55e7ee(_0x4f617b);});});}function respondWithStatusCode(_0x31db2c,_0x140926){_0x140926=_0x140926||0xcc;return function(_0x361f2b){if(_0x361f2b){return _0x31db2c[_0x0ee7('0x2e')](_0x140926);}return _0x31db2c[_0x0ee7('0x2f')](_0x140926)[_0x0ee7('0x30')]();};}function respondWithResult(_0x5d7f0f,_0x4e8e40){_0x4e8e40=_0x4e8e40||0xc8;return function(_0x5981ed){if(_0x5981ed){return _0x5d7f0f['status'](_0x4e8e40)[_0x0ee7('0x31')](_0x5981ed);}};}function respondWithFilteredResult(_0x35e6e6,_0x12b5ad){return function(_0x41e764){if(_0x41e764){var _0xd48b5e=typeof _0x12b5ad[_0x0ee7('0x32')]===_0x0ee7('0x33')&&typeof _0x12b5ad[_0x0ee7('0x34')]===_0x0ee7('0x33');var _0x4e814b=_0x41e764[_0x0ee7('0x35')];var _0x670e14=_0xd48b5e?0x0:_0x12b5ad[_0x0ee7('0x32')];var _0x576e13=_0xd48b5e?_0x41e764['count']:_0x12b5ad[_0x0ee7('0x32')]+_0x12b5ad[_0x0ee7('0x34')];var _0x1ce324;if(_0x576e13>=_0x4e814b){_0x576e13=_0x4e814b;_0x1ce324=0xc8;}else{_0x1ce324=0xce;}_0x35e6e6[_0x0ee7('0x2f')](_0x1ce324);return _0x35e6e6[_0x0ee7('0x36')](_0x0ee7('0x37'),_0x670e14+'-'+_0x576e13+'/'+_0x4e814b)[_0x0ee7('0x31')](_0x41e764);}return null;};}function patchUpdates(_0x1100d1){return function(_0x1b2932){try{jsonpatch['apply'](_0x1b2932,_0x1100d1,!![]);}catch(_0x452ffb){return BPromise[_0x0ee7('0x38')](_0x452ffb);}return _0x1b2932['save']();};}function saveUpdates(_0x1cd995,_0x1e352a){return function(_0x277495){if(_0x277495){return _0x277495['update'](_0x1cd995)[_0x0ee7('0x22')](function(_0x54a1f6){return _0x54a1f6;});}return null;};}function removeEntity(_0x33f9c7,_0x3eb3ec){return function(_0x54739a){if(_0x54739a){return _0x54739a[_0x0ee7('0x39')]()[_0x0ee7('0x22')](function(){var _0x4a2ece=_0x54739a[_0x0ee7('0x3a')]({'plain':!![]});var _0x2bb235='SmsAccounts';return db[_0x0ee7('0x3b')]['destroy']({'where':{'type':_0x2bb235,'resourceId':_0x4a2ece['id']}})[_0x0ee7('0x22')](function(){return _0x54739a;});})['then'](function(){_0x33f9c7[_0x0ee7('0x2f')](0xcc)[_0x0ee7('0x30')]();});}};}function handleEntityNotFound(_0x26e66b,_0x5a1885){return function(_0x1fb8e3){if(!_0x1fb8e3){_0x26e66b[_0x0ee7('0x2e')](0x194);}return _0x1fb8e3;};}function handleError(_0x115799,_0x2302bf){_0x2302bf=_0x2302bf||0x1f4;return function(_0x3e7baf){logger[_0x0ee7('0x28')](_0x3e7baf[_0x0ee7('0x3c')]);if(_0x3e7baf['name']){delete _0x3e7baf[_0x0ee7('0x3d')];}_0x115799[_0x0ee7('0x2f')](_0x2302bf)[_0x0ee7('0x3e')](_0x3e7baf);};}exports[_0x0ee7('0x3f')]=function(_0x1278cc,_0x224ca0){var _0x441cd4={'include':[{'model':db['Pause'],'as':_0x0ee7('0x40')}]},_0x1bc40c={},_0x8d877d={'count':0x0,'rows':[]};var _0x428575=_['map'](db[_0x0ee7('0x41')][_0x0ee7('0x42')],function(_0x2d37ef){return{'name':_0x2d37ef['fieldName'],'type':_0x2d37ef[_0x0ee7('0x43')][_0x0ee7('0x44')]};});_0x1bc40c[_0x0ee7('0x45')]=_[_0x0ee7('0x46')](_0x428575,_0x0ee7('0x3d'));_0x1bc40c[_0x0ee7('0x47')]=_[_0x0ee7('0x48')](_0x1278cc[_0x0ee7('0x47')]);_0x1bc40c['filters']=_['intersection'](_0x1bc40c[_0x0ee7('0x45')],_0x1bc40c[_0x0ee7('0x47')]);_0x441cd4[_0x0ee7('0x49')]=_[_0x0ee7('0x4a')](_0x1bc40c[_0x0ee7('0x45')],qs[_0x0ee7('0x4b')](_0x1278cc[_0x0ee7('0x47')]['fields']));_0x441cd4['attributes']=_0x441cd4['attributes'][_0x0ee7('0x4c')]?_0x441cd4[_0x0ee7('0x49')]:_0x1bc40c[_0x0ee7('0x45')];if(!_0x1278cc[_0x0ee7('0x47')][_0x0ee7('0x4d')](_0x0ee7('0x4e'))){_0x441cd4[_0x0ee7('0x34')]=qs['limit'](_0x1278cc[_0x0ee7('0x47')][_0x0ee7('0x34')]);_0x441cd4['offset']=qs['offset'](_0x1278cc['query'][_0x0ee7('0x32')]);}_0x441cd4[_0x0ee7('0x4f')]=qs[_0x0ee7('0x50')](_0x1278cc['query'][_0x0ee7('0x50')]);_0x441cd4[_0x0ee7('0x51')]=qs[_0x0ee7('0x52')](_[_0x0ee7('0x53')](_0x1278cc[_0x0ee7('0x47')],_0x1bc40c[_0x0ee7('0x52')]),_0x428575);if(_0x1278cc[_0x0ee7('0x47')]['filter']){_0x441cd4[_0x0ee7('0x51')]=_[_0x0ee7('0x54')](_0x441cd4[_0x0ee7('0x51')],{'$or':_[_0x0ee7('0x46')](_0x428575,function(_0x1c3af2){if(_0x1c3af2[_0x0ee7('0x43')]!==_0x0ee7('0x55')){var _0x2779bf={};_0x2779bf[_0x1c3af2[_0x0ee7('0x3d')]]={'$like':'%'+_0x1278cc['query'][_0x0ee7('0x56')]+'%'};return _0x2779bf;}})});}_0x441cd4=_[_0x0ee7('0x54')]({},_0x441cd4,_0x1278cc[_0x0ee7('0x57')]);var _0x43adb8={'where':_0x441cd4[_0x0ee7('0x51')]};return db[_0x0ee7('0x41')][_0x0ee7('0x35')](_0x43adb8)['then'](function(_0x295ccb){_0x8d877d[_0x0ee7('0x35')]=_0x295ccb;if(_0x1278cc[_0x0ee7('0x47')]['includeAll']){_0x441cd4[_0x0ee7('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x0ee7('0x59')](_0x441cd4);})[_0x0ee7('0x22')](function(_0x52866c){_0x8d877d['rows']=_0x52866c;return _0x8d877d;})[_0x0ee7('0x22')](respondWithFilteredResult(_0x224ca0,_0x441cd4))[_0x0ee7('0x2d')](handleError(_0x224ca0,null));};exports[_0x0ee7('0x5a')]=function(_0x3d6a9a,_0x1710bc){var _0xb183f9={'raw':![],'where':{'id':_0x3d6a9a[_0x0ee7('0x5b')]['id']},'include':[{'model':db[_0x0ee7('0x5c')],'as':'mandatoryDispositionPause'}]},_0x29782c={};_0x29782c[_0x0ee7('0x45')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x29782c['query']=_[_0x0ee7('0x48')](_0x3d6a9a[_0x0ee7('0x47')]);_0x29782c[_0x0ee7('0x52')]=_[_0x0ee7('0x4a')](_0x29782c[_0x0ee7('0x45')],_0x29782c[_0x0ee7('0x47')]);_0xb183f9[_0x0ee7('0x49')]=_['intersection'](_0x29782c['model'],qs[_0x0ee7('0x4b')](_0x3d6a9a['query'][_0x0ee7('0x4b')]));_0xb183f9[_0x0ee7('0x49')]=_0xb183f9[_0x0ee7('0x49')][_0x0ee7('0x4c')]?_0xb183f9[_0x0ee7('0x49')]:_0x29782c[_0x0ee7('0x45')];if(_0x3d6a9a[_0x0ee7('0x47')][_0x0ee7('0x5d')]){_0xb183f9[_0x0ee7('0x58')]=[{'all':!![]}];}_0xb183f9=_[_0x0ee7('0x54')]({},_0xb183f9,_0x3d6a9a[_0x0ee7('0x57')]);return db['SmsAccount'][_0x0ee7('0x5e')](_0xb183f9)['then'](handleEntityNotFound(_0x1710bc,null))[_0x0ee7('0x22')](respondWithResult(_0x1710bc,null))[_0x0ee7('0x2d')](handleError(_0x1710bc,null));};exports[_0x0ee7('0x5f')]=function(_0x25b9e9,_0x349986){return db['SmsAccount']['create'](_0x25b9e9[_0x0ee7('0x60')],{})[_0x0ee7('0x22')](function(_0x5e7419){var _0x439bba=_0x25b9e9[_0x0ee7('0x61')][_0x0ee7('0x3a')]({'plain':!![]});if(!_0x439bba)throw new Error(_0x0ee7('0x62'));if(_0x439bba[_0x0ee7('0x63')]===_0x0ee7('0x61')){var _0x2b23b2=_0x5e7419[_0x0ee7('0x3a')]({'plain':!![]});var _0x5e96a4='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x5e96a4,'userProfileId':_0x439bba[_0x0ee7('0x64')]},'raw':!![]})[_0x0ee7('0x22')](function(_0x9ece65){if(_0x9ece65&&_0x9ece65['autoAssociation']===0x0){return db[_0x0ee7('0x3b')][_0x0ee7('0x5f')]({'name':_0x2b23b2[_0x0ee7('0x3d')],'resourceId':_0x2b23b2['id'],'type':_0x9ece65[_0x0ee7('0x3d')],'sectionId':_0x9ece65['id']},{})[_0x0ee7('0x22')](function(){return _0x5e7419;});}else{return _0x5e7419;}})[_0x0ee7('0x2d')](function(_0x507e6b){logger[_0x0ee7('0x28')](_0x0ee7('0x65'),_0x507e6b);throw _0x507e6b;});}return _0x5e7419;})[_0x0ee7('0x22')](respondWithResult(_0x349986,0xc9))[_0x0ee7('0x2d')](handleError(_0x349986,null));};exports[_0x0ee7('0x66')]=function(_0x36101c,_0x5b627b){if(_0x36101c[_0x0ee7('0x60')]['id']){delete _0x36101c[_0x0ee7('0x60')]['id'];}return db[_0x0ee7('0x41')]['find']({'where':{'id':_0x36101c[_0x0ee7('0x5b')]['id']},'include':[{'model':db[_0x0ee7('0x5c')],'as':_0x0ee7('0x40')}]})['then'](handleEntityNotFound(_0x5b627b,null))[_0x0ee7('0x22')](saveUpdates(_0x36101c[_0x0ee7('0x60')],null))[_0x0ee7('0x22')](respondWithResult(_0x5b627b,null))['catch'](handleError(_0x5b627b,null));};exports[_0x0ee7('0x39')]=function(_0x404b81,_0x3cf75b){return db['SmsAccount'][_0x0ee7('0x5e')]({'where':{'id':_0x404b81[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x3cf75b,null))[_0x0ee7('0x22')](removeEntity(_0x3cf75b,null))[_0x0ee7('0x2d')](handleError(_0x3cf75b,null));};exports[_0x0ee7('0x67')]=function(_0xa0466f,_0x591b7c){return db[_0x0ee7('0x41')][_0x0ee7('0x67')]()[_0x0ee7('0x22')](respondWithResult(_0x591b7c,null))[_0x0ee7('0x2d')](handleError(_0x591b7c,null));};exports[_0x0ee7('0x68')]=function(_0x43793c,_0x259255,_0x2824d9){if(_0x43793c[_0x0ee7('0x60')]['id']){delete _0x43793c[_0x0ee7('0x60')]['id'];}return db[_0x0ee7('0x41')]['find']({'where':{'id':_0x43793c[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x259255,null))['then'](function(_0x2e8203){if(_0x2e8203){_0x43793c[_0x0ee7('0x60')][_0x0ee7('0x69')]=_0x2e8203['id'];return db[_0x0ee7('0x6a')][_0x0ee7('0x5f')](_0x43793c[_0x0ee7('0x60')]);}})[_0x0ee7('0x22')](respondWithResult(_0x259255,null))[_0x0ee7('0x2d')](handleError(_0x259255,null));};exports[_0x0ee7('0x6b')]=function(_0xab657a,_0x5c0235,_0x5ecee){var _0x58440f={'raw':![],'where':{}};var _0x3bf81e={};var _0x4c43e4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0ee7('0x6c')]({'where':{'id':_0xab657a['params']['id']}})['then'](handleEntityNotFound(_0x5c0235,null))[_0x0ee7('0x22')](function(_0x4e954b){if(_0x4e954b){_0x3bf81e[_0x0ee7('0x45')]=_[_0x0ee7('0x48')](db[_0x0ee7('0x6a')][_0x0ee7('0x42')]);_0x3bf81e[_0x0ee7('0x47')]=_[_0x0ee7('0x48')](_0xab657a[_0x0ee7('0x47')]);_0x3bf81e[_0x0ee7('0x52')]=_[_0x0ee7('0x4a')](_0x3bf81e[_0x0ee7('0x45')],_0x3bf81e[_0x0ee7('0x47')]);_0x58440f['attributes']=_['intersection'](_0x3bf81e[_0x0ee7('0x45')],qs['fields'](_0xab657a[_0x0ee7('0x47')][_0x0ee7('0x4b')]));_0x58440f[_0x0ee7('0x49')]=_0x58440f[_0x0ee7('0x49')][_0x0ee7('0x4c')]?_0x58440f['attributes']:_0x3bf81e[_0x0ee7('0x45')];if(!_0xab657a[_0x0ee7('0x47')]['hasOwnProperty'](_0x0ee7('0x4e'))){_0x58440f[_0x0ee7('0x34')]=qs[_0x0ee7('0x34')](_0xab657a[_0x0ee7('0x47')][_0x0ee7('0x34')]);_0x58440f[_0x0ee7('0x32')]=qs[_0x0ee7('0x32')](_0xab657a['query'][_0x0ee7('0x32')]);}_0x58440f[_0x0ee7('0x4f')]=qs[_0x0ee7('0x50')](_0xab657a[_0x0ee7('0x47')][_0x0ee7('0x50')]);_0x58440f[_0x0ee7('0x51')]=qs['filters'](_[_0x0ee7('0x53')](_0xab657a[_0x0ee7('0x47')],_0x3bf81e['filters']));_0x58440f[_0x0ee7('0x51')]['SmsAccountId']=_0x4e954b['id'];if(_0xab657a[_0x0ee7('0x47')][_0x0ee7('0x56')]){_0x58440f[_0x0ee7('0x51')]=_['merge'](_0x58440f[_0x0ee7('0x51')],{'$or':_['map'](_0x58440f[_0x0ee7('0x49')],function(_0x5e4710){var _0x4e123e={};_0x4e123e[_0x5e4710]={'$like':'%'+_0xab657a[_0x0ee7('0x47')]['filter']+'%'};return _0x4e123e;})});}_0x58440f=_[_0x0ee7('0x54')]({},_0x58440f,_0xab657a[_0x0ee7('0x57')]);return db[_0x0ee7('0x6a')][_0x0ee7('0x35')]({'where':_0x58440f[_0x0ee7('0x51')]})[_0x0ee7('0x22')](function(_0x6e04d9){_0x4c43e4['count']=_0x6e04d9;if(_0xab657a[_0x0ee7('0x47')][_0x0ee7('0x5d')]){_0x58440f['include']=[{'all':!![]}];}return db[_0x0ee7('0x6a')][_0x0ee7('0x59')](_0x58440f);})[_0x0ee7('0x22')](function(_0xaacf){_0x4c43e4['rows']=_0xaacf;return _0x4c43e4;});}})['then'](respondWithFilteredResult(_0x5c0235,_0x58440f))[_0x0ee7('0x2d')](handleError(_0x5c0235,null));};exports[_0x0ee7('0x6d')]=function(_0x45d572,_0x42b74c,_0x1a0b6a){return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x45d572[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x42b74c,null))[_0x0ee7('0x22')](function(_0x169d6d){if(_0x169d6d){return _0x169d6d[_0x0ee7('0x6d')](_0x45d572[_0x0ee7('0x47')][_0x0ee7('0x6e')]);}})['then'](respondWithStatusCode(_0x42b74c,null))['catch'](handleError(_0x42b74c,null));};exports['addAnswer']=function(_0x32f856,_0x397130,_0x4243b7){if(_0x32f856['body']['id']){delete _0x32f856['body']['id'];}return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x32f856[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x397130,null))[_0x0ee7('0x22')](function(_0x3bda8e){if(_0x3bda8e){_0x32f856[_0x0ee7('0x60')][_0x0ee7('0x69')]=_0x3bda8e['id'];return db[_0x0ee7('0x6f')]['create'](_0x32f856[_0x0ee7('0x60')]);}})[_0x0ee7('0x22')](respondWithResult(_0x397130,null))[_0x0ee7('0x2d')](handleError(_0x397130,null));};exports[_0x0ee7('0x70')]=function(_0x5f4cb1,_0x30d830,_0x2184ef){var _0x3c3e51={'raw':![],'where':{}};var _0x952df2={};var _0x1780b5={'count':0x0,'rows':[]};return db[_0x0ee7('0x41')][_0x0ee7('0x6c')]({'where':{'id':_0x5f4cb1[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x30d830,null))[_0x0ee7('0x22')](function(_0x8f6bd){if(_0x8f6bd){_0x952df2[_0x0ee7('0x45')]=_[_0x0ee7('0x48')](db['CannedAnswer'][_0x0ee7('0x42')]);_0x952df2[_0x0ee7('0x47')]=_[_0x0ee7('0x48')](_0x5f4cb1[_0x0ee7('0x47')]);_0x952df2[_0x0ee7('0x52')]=_[_0x0ee7('0x4a')](_0x952df2['model'],_0x952df2[_0x0ee7('0x47')]);_0x3c3e51['attributes']=_[_0x0ee7('0x4a')](_0x952df2[_0x0ee7('0x45')],qs[_0x0ee7('0x4b')](_0x5f4cb1[_0x0ee7('0x47')][_0x0ee7('0x4b')]));_0x3c3e51[_0x0ee7('0x49')]=_0x3c3e51[_0x0ee7('0x49')]['length']?_0x3c3e51[_0x0ee7('0x49')]:_0x952df2[_0x0ee7('0x45')];if(!_0x5f4cb1[_0x0ee7('0x47')]['hasOwnProperty']('nolimit')){_0x3c3e51[_0x0ee7('0x34')]=qs[_0x0ee7('0x34')](_0x5f4cb1[_0x0ee7('0x47')][_0x0ee7('0x34')]);_0x3c3e51[_0x0ee7('0x32')]=qs[_0x0ee7('0x32')](_0x5f4cb1[_0x0ee7('0x47')]['offset']);}_0x3c3e51['order']=qs[_0x0ee7('0x50')](_0x5f4cb1[_0x0ee7('0x47')][_0x0ee7('0x50')]);_0x3c3e51['where']=qs[_0x0ee7('0x52')](_[_0x0ee7('0x53')](_0x5f4cb1[_0x0ee7('0x47')],_0x952df2[_0x0ee7('0x52')]));_0x3c3e51['where']['SmsAccountId']=_0x8f6bd['id'];if(_0x5f4cb1[_0x0ee7('0x47')]['filter']){_0x3c3e51['where']=_['merge'](_0x3c3e51[_0x0ee7('0x51')],{'$or':_[_0x0ee7('0x46')](_0x3c3e51[_0x0ee7('0x49')],function(_0x4e109b){var _0x3dd554={};_0x3dd554[_0x4e109b]={'$like':'%'+_0x5f4cb1[_0x0ee7('0x47')][_0x0ee7('0x56')]+'%'};return _0x3dd554;})});}_0x3c3e51=_['merge']({},_0x3c3e51,_0x5f4cb1['options']);return db[_0x0ee7('0x6f')][_0x0ee7('0x35')]({'where':_0x3c3e51[_0x0ee7('0x51')]})[_0x0ee7('0x22')](function(_0x5a8315){_0x1780b5[_0x0ee7('0x35')]=_0x5a8315;if(_0x5f4cb1[_0x0ee7('0x47')][_0x0ee7('0x5d')]){_0x3c3e51[_0x0ee7('0x58')]=[{'all':!![]}];}return db[_0x0ee7('0x6f')][_0x0ee7('0x59')](_0x3c3e51);})[_0x0ee7('0x22')](function(_0x2d8ffb){_0x1780b5[_0x0ee7('0x71')]=_0x2d8ffb;return _0x1780b5;});}})[_0x0ee7('0x22')](respondWithFilteredResult(_0x30d830,_0x3c3e51))[_0x0ee7('0x2d')](handleError(_0x30d830,null));};exports[_0x0ee7('0x72')]=function(_0x26f015,_0x4bd4f0,_0x190ed0){return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x26f015[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x4bd4f0,null))['then'](function(_0x460e2b){if(_0x460e2b){return _0x460e2b[_0x0ee7('0x72')](_0x26f015['query']['ids']);}})[_0x0ee7('0x22')](respondWithStatusCode(_0x4bd4f0,null))[_0x0ee7('0x2d')](handleError(_0x4bd4f0,null));};exports[_0x0ee7('0x73')]=function(_0x207535,_0x2ed47,_0x2b48bf){var _0x245267={'channel':_0x0ee7('0x74')};var _0x20431d=[];var _0x3da853=[];var _0x544d5d={};return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x207535[_0x0ee7('0x5b')]['id']},'include':[{'model':db[_0x0ee7('0x75')],'as':_0x0ee7('0x76')}]})[_0x0ee7('0x22')](handleEntityNotFound(_0x2ed47,null))['then'](function(_0x1bf987){_0x245267[_0x0ee7('0x77')]=_0x1bf987;_0x245267['applications']=_['orderBy'](_0x1bf987[_0x0ee7('0x76')],[_0x0ee7('0x78')],[_0x0ee7('0x79')]);if(_0x245267[_0x0ee7('0x77')][_0x0ee7('0x76')]){delete _0x245267[_0x0ee7('0x77')][_0x0ee7('0x76')];}return db[_0x0ee7('0x7a')][_0x0ee7('0x67')]();})[_0x0ee7('0x22')](function(_0x12f58f){if(!_0x12f58f){throw new db[(_0x0ee7('0x7b'))][(_0x0ee7('0x7c'))](_0x0ee7('0x7d'));}_0x20431d=_[_0x0ee7('0x7e')](_['keys'](_0x12f58f),[_0x0ee7('0x7f'),'updatedAt']);_0x3da853=_['difference'](_[_0x0ee7('0x48')](_0x12f58f),['createdAt',_0x0ee7('0x80'),_0x0ee7('0x81'),'ListId']);_0x245267[_0x0ee7('0x60')]={'mapKey':_0x0ee7('0x82')};if(_0x245267[_0x0ee7('0x77')][_0x0ee7('0x43')]){switch(_0x245267[_0x0ee7('0x77')][_0x0ee7('0x43')]){case _0x0ee7('0x83'):_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]=_0x207535['body'][_0x0ee7('0x85')];_0x245267[_0x0ee7('0x60')]['body']=_0x207535['body'][_0x0ee7('0x86')];_0x245267['body'][_0x0ee7('0x87')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x88')];break;case'skebby':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]='+'+_0x207535[_0x0ee7('0x60')][_0x0ee7('0x89')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535['body'][_0x0ee7('0x8a')];break;case _0x0ee7('0x8b'):_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x84')];_0x245267['body'][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x2b')];break;case'clicksend':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x84')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x60')];_0x245267[_0x0ee7('0x60')]['messageId']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x8c')];break;case _0x0ee7('0x8d'):_0x245267['body'][_0x0ee7('0x84')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x85')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x8e')];_0x245267[_0x0ee7('0x60')]['messageId']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x8f')];break;case'infobip':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]='+'+_0x207535[_0x0ee7('0x60')][_0x0ee7('0x90')][0x0][_0x0ee7('0x84')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535['body'][_0x0ee7('0x90')][0x0][_0x0ee7('0x8a')];_0x245267['body']['messageId']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x90')][0x0][_0x0ee7('0x87')];break;case _0x0ee7('0x91'):_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')]=_0x207535['body'][_0x0ee7('0x92')];_0x245267['body'][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x93')]['message'];break;case _0x0ee7('0x94'):_0x245267[_0x0ee7('0x60')]['from']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x95')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')]['text'];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x87')]=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x96')];break;case _0x0ee7('0x97'):_0x245267['body']['messageId']=_0x207535['body'][0x0]['message']['id'];_0x245267['body']['from']=_0x207535[_0x0ee7('0x60')][0x0]['message'][_0x0ee7('0x84')];_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')]=_0x207535[_0x0ee7('0x60')][0x0][_0x0ee7('0x2b')][_0x0ee7('0x8a')];break;case'intelepeer':_0x245267['body']['from']=_0x207535['body']['from'];_0x245267[_0x0ee7('0x60')]['body']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x2b')];_0x245267[_0x0ee7('0x60')]['messageId']=_0x207535[_0x0ee7('0x60')][_0x0ee7('0x98')];break;}}if(_0x245267[_0x0ee7('0x60')]['id']){delete _0x245267[_0x0ee7('0x60')]['id'];}if(_[_0x0ee7('0x99')](_0x245267[_0x0ee7('0x60')]['from'])){throw new db[(_0x0ee7('0x7b'))]['ValidationError'](_0x0ee7('0x9a'));}if(_['isNil'](_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')])||_0x245267['body'][_0x0ee7('0x60')]===''){throw new db[(_0x0ee7('0x7b'))][(_0x0ee7('0x7c'))](_0x0ee7('0x9b'));}if(_[_0x0ee7('0x99')](_0x245267[_0x0ee7('0x60')][_0x0ee7('0x9c')])){throw new db[(_0x0ee7('0x7b'))][(_0x0ee7('0x7c'))](_0x0ee7('0x9d')+_0x3da853);}if(!_['includes'](_0x3da853,_0x245267[_0x0ee7('0x60')][_0x0ee7('0x9c')])){throw new db['Sequelize'][(_0x0ee7('0x7c'))](_0x0ee7('0x9e')+_0x3da853);}_0x544d5d[_0x245267[_0x0ee7('0x60')][_0x0ee7('0x9c')]]=_0x245267[_0x0ee7('0x60')]['from'];return db[_0x0ee7('0x9f')][_0x0ee7('0x5e')]({'where':{'id':_0x245267[_0x0ee7('0x77')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x0ee7('0xa0'),'where':_0x544d5d,'limit':0x1,'order':[['updatedAt',_0x0ee7('0xa1')]]}]});})[_0x0ee7('0x22')](handleEntityNotFound(_0x2ed47,null))[_0x0ee7('0x22')](function(_0x2ed1fa){if(_0x2ed1fa){_0x245267[_0x0ee7('0xa2')]=_['omit'](_0x2ed1fa,['Contacts']);if(_0x2ed1fa['Contacts'][_0x0ee7('0x4c')]){return _0x2ed1fa['Contacts'][0x0];}var _0x153dab=_[_0x0ee7('0x1a')](_0x245267[_0x0ee7('0x60')],{'firstName':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')],'ListId':_0x2ed1fa['id']});_0x153dab[_0x245267[_0x0ee7('0x60')][_0x0ee7('0x9c')]]=_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')];return db[_0x0ee7('0x7a')][_0x0ee7('0x5f')](_0x153dab,{'fields':_0x20431d,'raw':!![]});}})[_0x0ee7('0x22')](handleEntityNotFound(_0x2ed47,null))[_0x0ee7('0x22')](function(_0x4b6c3a){if(_0x4b6c3a){_0x245267[_0x0ee7('0xa3')]=_0x4b6c3a;var _0x261b4e={'ContactId':_0x4b6c3a['id'],'phone':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x84')],'SmsAccountId':_0x207535[_0x0ee7('0x5b')]['id']};var _0x19964c={'ContactId':_0x4b6c3a['id'],'SmsAccountId':_0x207535[_0x0ee7('0x5b')]['id'],'closed':![]};return db['SmsInteraction'][_0x0ee7('0x5e')]({'where':_0x19964c})[_0x0ee7('0x22')](function(_0x2dc64a){if(_0x2dc64a){return[_0x2dc64a,![]];}return db[_0x0ee7('0xa4')][_0x0ee7('0x5f')](_0x261b4e)['then'](function(_0x69ad3b){return[_0x69ad3b,!![]];});});}})['spread'](function(_0x30095f,_0x2203ee){_0x245267[_0x0ee7('0xa5')]=_0x30095f['get']({'plain':!![]});_0x245267[_0x0ee7('0xa5')][_0x0ee7('0xa6')]=![];if(_0x2203ee){if(_0x245267[_0x0ee7('0x77')][_0x0ee7('0xa7')]){_0x245267['applications'][_0x0ee7('0xa8')]({'id':0x0,'priority':_0x245267[_0x0ee7('0xa9')][_0x0ee7('0x4c')]+0x1,'app':_0x0ee7('0xaa'),'appdata':_0x0ee7('0xab'),'interval':'*,*,*,*'});}_0x245267[_0x0ee7('0xa5')][_0x0ee7('0xa6')]=!![];}return db[_0x0ee7('0xac')][_0x0ee7('0x5f')]({'phone':_0x245267['body'][_0x0ee7('0x84')],'messageId':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x87')],'body':_0x245267[_0x0ee7('0x60')][_0x0ee7('0x60')],'SmsAccountId':_0x207535[_0x0ee7('0x5b')]['id'],'SmsInteractionId':_0x30095f['id'],'direction':'in','ContactId':_0x30095f['ContactId'],'AttachmentId':_0x245267[_0x0ee7('0x60')][_0x0ee7('0xad')]});})['then'](function(_0x1a959e){_0x245267[_0x0ee7('0x2b')]=_0x1a959e;if(_0x245267[_0x0ee7('0xa5')][_0x0ee7('0xae')]){return db['User'][_0x0ee7('0x5e')]({'attributes':['id','name'],'where':{'id':_0x245267[_0x0ee7('0xa5')]['UserId']}})[_0x0ee7('0x22')](function(_0x30c8f9){if(_0x30c8f9){_0x245267[_0x0ee7('0xa9')][_0x0ee7('0xaf')]({'id':0x0,'priority':0x0,'app':_0x0ee7('0xb0'),'appdata':_0x30c8f9['name']+','+(_0x245267['account'][_0x0ee7('0xb1')]||0xa),'interval':_0x0ee7('0xb2')});}return respondWithRpcPromise(_0x0ee7('0xb3'),'startRouting',_0x245267);});}return respondWithRpcPromise('Start',_0x0ee7('0xb4'),_0x245267);})[_0x0ee7('0x22')](function(_0x364cd1){if(_0x364cd1){var _0x5137d3=0xc8;var _0x1e414f='receiveMessage';logger[_0x0ee7('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1e414f,_0x5137d3,'entity\x20found');logger[_0x0ee7('0x25')](_0x0ee7('0xb5'),_0x1e414f,_0x5137d3,_0x0ee7('0xb6'),JSON[_0x0ee7('0x27')](_0x364cd1));if(_0x245267[_0x0ee7('0x77')][_0x0ee7('0x43')]===_0x0ee7('0x83')){return _0x2ed47[_0x0ee7('0x2f')](_0x5137d3)['set'](_0x0ee7('0xb7'),_0x0ee7('0xb8'))[_0x0ee7('0x3e')](_0x0ee7('0xb9'));}else{return _0x2ed47[_0x0ee7('0x2f')](_0x5137d3)[_0x0ee7('0x31')](_0x364cd1);}}})[_0x0ee7('0x2d')](handleError(_0x2ed47,null));};exports[_0x0ee7('0xba')]=function(_0x4b8e75,_0x9f281d,_0xc12684){return db['SmsAccount']['findOne']({'where':{'id':_0x4b8e75[_0x0ee7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9f281d,null))['then'](function(_0x3c4910){if(_0x3c4910){return db['sequelize']['transaction'](function(_0x25d34f){return db[_0x0ee7('0x75')]['destroy']({'where':{'SmsAccountId':_0x4b8e75['params']['id']},'transaction':_0x25d34f})['then'](function(_0x22656c){var _0x133d40=_[_0x0ee7('0x46')](_0x4b8e75['body'],function(_0x4b0fd1){_0x4b0fd1[_0x0ee7('0x69')]=_0x4b8e75[_0x0ee7('0x5b')]['id'];return _0x4b0fd1;});return db[_0x0ee7('0x75')][_0x0ee7('0xbb')](_0x133d40,{'transaction':_0x25d34f});});})[_0x0ee7('0x22')](function(){return db[_0x0ee7('0x75')][_0x0ee7('0xbc')]({'where':{'SmsAccountId':_0x4b8e75['params']['id']},'order':'priority'});});}})[_0x0ee7('0x22')](respondWithResult(_0x9f281d,null))['catch'](handleError(_0x9f281d,null));};exports['getApplications']=function(_0xc3ce5b,_0x36c34d,_0x39bb11){var _0x12a52b={};var _0x246bb1={};var _0x52ed1d;var _0x10714b;return db['SmsAccount'][_0x0ee7('0x6c')]({'where':{'id':_0xc3ce5b[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x36c34d,null))[_0x0ee7('0x22')](function(_0x470bed){if(_0x470bed){_0x52ed1d=_0x470bed;_0x246bb1['model']=_['keys'](db['SmsApplication'][_0x0ee7('0x42')]);_0x246bb1['query']=_['keys'](_0xc3ce5b[_0x0ee7('0x47')]);_0x246bb1[_0x0ee7('0x52')]=_['intersection'](_0x246bb1[_0x0ee7('0x45')],_0x246bb1[_0x0ee7('0x47')]);_0x12a52b[_0x0ee7('0x49')]=_[_0x0ee7('0x4a')](_0x246bb1['model'],qs[_0x0ee7('0x4b')](_0xc3ce5b['query'][_0x0ee7('0x4b')]));_0x12a52b[_0x0ee7('0x49')]=_0x12a52b[_0x0ee7('0x49')][_0x0ee7('0x4c')]?_0x12a52b[_0x0ee7('0x49')]:_0x246bb1[_0x0ee7('0x45')];_0x12a52b[_0x0ee7('0x4f')]=qs[_0x0ee7('0x50')](_0xc3ce5b['query']['sort']);_0x12a52b[_0x0ee7('0x51')]=qs[_0x0ee7('0x52')](_[_0x0ee7('0x53')](_0xc3ce5b[_0x0ee7('0x47')],_0x246bb1[_0x0ee7('0x52')]));if(_0xc3ce5b['query'][_0x0ee7('0x56')]){_0x12a52b[_0x0ee7('0x51')]=_[_0x0ee7('0x54')](_0x12a52b['where'],{'$or':_[_0x0ee7('0x46')](_0x12a52b[_0x0ee7('0x49')],function(_0x5aed04){var _0x119ddd={};_0x119ddd[_0x5aed04]={'$like':'%'+_0xc3ce5b[_0x0ee7('0x47')][_0x0ee7('0x56')]+'%'};return _0x119ddd;})});}_0x12a52b=_['merge']({},_0x12a52b,_0xc3ce5b[_0x0ee7('0x57')]);return _0x52ed1d[_0x0ee7('0xbd')](_0x12a52b);}})['then'](function(_0x2038a8){if(_0x2038a8){_0x10714b=_0x2038a8['length'];if(!_0xc3ce5b[_0x0ee7('0x47')][_0x0ee7('0x4d')](_0x0ee7('0x4e'))){_0x12a52b[_0x0ee7('0x34')]=qs['limit'](_0xc3ce5b[_0x0ee7('0x47')]['limit']);_0x12a52b['offset']=qs[_0x0ee7('0x32')](_0xc3ce5b[_0x0ee7('0x47')][_0x0ee7('0x32')]);}return _0x52ed1d[_0x0ee7('0xbd')](_0x12a52b);}})['then'](function(_0x12579b){if(_0x12579b){return _0x12579b?{'count':_0x10714b,'rows':_0x12579b}:null;}})[_0x0ee7('0x22')](respondWithResult(_0x36c34d,null))[_0x0ee7('0x2d')](handleError(_0x36c34d,null));};exports[_0x0ee7('0xbe')]=function(_0x5aadf1,_0x531cf4,_0x52e68a){var _0x185192={'raw':![],'where':{}};var _0x427fc9={};var _0x1b3321={'count':0x0,'rows':[]};return db[_0x0ee7('0x41')][_0x0ee7('0x6c')]({'where':{'id':_0x5aadf1[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x531cf4,null))[_0x0ee7('0x22')](function(_0x867854){if(_0x867854){_0x427fc9[_0x0ee7('0x45')]=_[_0x0ee7('0x48')](db[_0x0ee7('0xa4')]['rawAttributes']);_0x427fc9[_0x0ee7('0x47')]=_[_0x0ee7('0x48')](_0x5aadf1[_0x0ee7('0x47')]);_0x427fc9['filters']=_[_0x0ee7('0x4a')](_0x427fc9[_0x0ee7('0x45')],_0x427fc9[_0x0ee7('0x47')]);_0x185192[_0x0ee7('0x49')]=_['intersection'](_0x427fc9[_0x0ee7('0x45')],qs[_0x0ee7('0x4b')](_0x5aadf1['query'][_0x0ee7('0x4b')]));_0x185192[_0x0ee7('0x49')]=_0x185192[_0x0ee7('0x49')][_0x0ee7('0x4c')]?_0x185192[_0x0ee7('0x49')]:_0x427fc9['model'];if(!_0x5aadf1[_0x0ee7('0x47')][_0x0ee7('0x4d')](_0x0ee7('0x4e'))){_0x185192[_0x0ee7('0x34')]=qs['limit'](_0x5aadf1['query'][_0x0ee7('0x34')]);_0x185192[_0x0ee7('0x32')]=qs['offset'](_0x5aadf1['query'][_0x0ee7('0x32')]);}_0x185192['order']=qs['sort'](_0x5aadf1[_0x0ee7('0x47')]['sort']);_0x185192[_0x0ee7('0x51')]=qs[_0x0ee7('0x52')](_['pick'](_0x5aadf1[_0x0ee7('0x47')],_0x427fc9[_0x0ee7('0x52')]));_0x185192[_0x0ee7('0x51')]['SmsAccountId']=_0x867854['id'];if(_0x5aadf1[_0x0ee7('0x47')][_0x0ee7('0x56')]){_0x185192[_0x0ee7('0x51')]=_[_0x0ee7('0x54')](_0x185192[_0x0ee7('0x51')],{'$or':_['map'](_0x185192[_0x0ee7('0x49')],function(_0xd4a7ca){var _0x9eac0a={};_0x9eac0a[_0xd4a7ca]={'$like':'%'+_0x5aadf1[_0x0ee7('0x47')][_0x0ee7('0x56')]+'%'};return _0x9eac0a;})});}_0x185192=_[_0x0ee7('0x54')]({},_0x185192,_0x5aadf1[_0x0ee7('0x57')]);return db[_0x0ee7('0xa4')][_0x0ee7('0x35')]({'where':_0x185192[_0x0ee7('0x51')]})['then'](function(_0x150e49){_0x1b3321['count']=_0x150e49;if(_0x5aadf1['query'][_0x0ee7('0x5d')]){_0x185192['include']=[{'model':db[_0x0ee7('0x7a')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x0ee7('0x3d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x0ee7('0xbf'),'attributes':['id','name','color'],'where':_0x5aadf1[_0x0ee7('0x47')][_0x0ee7('0xc0')]?{'id':_0x5aadf1[_0x0ee7('0x47')]['tag']}:undefined,'required':_0x5aadf1[_0x0ee7('0x47')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x0ee7('0x59')](_0x185192);})[_0x0ee7('0x22')](function(_0x1568ef){_0x1b3321[_0x0ee7('0x71')]=_0x1568ef;return _0x1b3321;});}})[_0x0ee7('0x22')](respondWithFilteredResult(_0x531cf4,_0x185192))[_0x0ee7('0x2d')](handleError(_0x531cf4,null));};exports[_0x0ee7('0x3e')]=function(_0x397af7,_0x5354a9,_0x47ef5d){var _0x52ed9f,_0x5ca4a5,_0x9064f7;if(_[_0x0ee7('0x99')](_0x397af7[_0x0ee7('0x60')][_0x0ee7('0x60')])||_0x397af7[_0x0ee7('0x60')][_0x0ee7('0x60')]===''){throw new db[(_0x0ee7('0x7b'))][(_0x0ee7('0x7c'))](_0x0ee7('0x9b'));}if(_[_0x0ee7('0x99')](_0x397af7[_0x0ee7('0x60')]['to'])){throw new db[(_0x0ee7('0x7b'))][(_0x0ee7('0x7c'))](_0x0ee7('0xc1'));}_0x52ed9f=_0x397af7[_0x0ee7('0x60')]['to'];return db[_0x0ee7('0x41')]['find']({'where':{'id':_0x397af7[_0x0ee7('0x5b')]['id']},'include':[{'model':db[_0x0ee7('0x9f')],'as':_0x0ee7('0xc2'),'include':[{'model':db[_0x0ee7('0x7a')],'as':_0x0ee7('0xa0'),'where':{'mobile':_0x52ed9f},'limit':0x1,'order':[[_0x0ee7('0x80'),_0x0ee7('0xa1')]]}]}]})['then'](handleEntityNotFound(_0x5354a9,null))[_0x0ee7('0x22')](function(_0x3d45df){if(_0x3d45df&&_0x3d45df[_0x0ee7('0xc2')]){_0x5ca4a5=_0x3d45df[_0x0ee7('0x3a')]({'plain':!![]});if(_0x5ca4a5['List']&&_0x5ca4a5[_0x0ee7('0xc2')][_0x0ee7('0xa0')]['length']){return _0x5ca4a5[_0x0ee7('0xc2')][_0x0ee7('0xa0')][0x0];}return db[_0x0ee7('0x7a')]['create'](_[_0x0ee7('0x1a')](_0x397af7['body'],{'firstName':_0x52ed9f,'mobile':_0x52ed9f,'phone':_0x52ed9f,'ListId':_0x5ca4a5['ListId']}));}})[_0x0ee7('0x22')](handleEntityNotFound(_0x5354a9,null))[_0x0ee7('0x22')](function(_0x20df3f){if(_0x20df3f){_0x9064f7=_0x20df3f;return db[_0x0ee7('0xa4')][_0x0ee7('0x5e')]({'where':{'ContactId':_0x9064f7['id'],'closed':![],'SmsAccountId':_0x5ca4a5['id']}})[_0x0ee7('0x22')](function(_0x2629cf){if(_0x2629cf){return[_0x2629cf,![]];}return db[_0x0ee7('0xa4')][_0x0ee7('0x5f')]({'UserId':_0x397af7['user']['id'],'ContactId':_0x9064f7['id'],'SmsAccountId':_0x5ca4a5['id'],'phone':_0x52ed9f,'firstMsgDirection':_0x0ee7('0xc3'),'Messages':[_['merge'](_0x397af7[_0x0ee7('0x60')],{'read':![],'body':_0x397af7[_0x0ee7('0x60')][_0x0ee7('0x60')],'phone':_0x52ed9f,'SmsAccountId':_0x5ca4a5['id'],'UserId':_0x397af7['user']['id'],'ContactId':_0x9064f7['id']})]},{'include':[{'model':db[_0x0ee7('0xac')],'as':'Messages'}]})[_0x0ee7('0x22')](function(_0x7a2ae){return[_0x7a2ae,!![]];});});}})[_0x0ee7('0xc4')](function(_0x3abd04,_0x17419a){if(_0x17419a){return _0x3abd04;}return db[_0x0ee7('0xac')]['create'](_[_0x0ee7('0x54')](_0x397af7[_0x0ee7('0x60')],{'read':![],'body':_0x397af7[_0x0ee7('0x60')][_0x0ee7('0x60')],'phone':_0x52ed9f,'SmsAccountId':_0x5ca4a5['id'],'SmsInteractionId':_0x3abd04['id'],'UserId':_0x397af7[_0x0ee7('0x61')]['id'],'ContactId':_0x9064f7['id']}))['then'](function(_0x3e7717){_0x3abd04[_0x0ee7('0xc5')]['Messages']=[];_0x3abd04[_0x0ee7('0xc5')]['Messages']['push'](_0x3e7717['dataValues']);return _0x3abd04;});})[_0x0ee7('0x22')](respondWithResult(_0x5354a9,null))[_0x0ee7('0x2d')](handleError(_0x5354a9,null));};exports[_0x0ee7('0x2f')]=function(_0x373f8b,_0x2de524,_0x1e785f){if(_0x373f8b['body']['id']){delete _0x373f8b[_0x0ee7('0x60')]['id'];}var _0xdb565f,_0x5b76aa,_0x10534f;return db[_0x0ee7('0x41')]['find']({'where':{'id':_0x373f8b['params']['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x2de524,null))[_0x0ee7('0x22')](function(_0x40dbc2){if(_0x40dbc2){_0x10534f=_0x40dbc2;logger[_0x0ee7('0x25')](_0x0ee7('0x26'),_0x0ee7('0x2f'),_0x0ee7('0xc6'),_0x40dbc2[_0x0ee7('0x43')],util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));switch(_0x40dbc2[_0x0ee7('0x43')]){case _0x0ee7('0xc8'):if(_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xc9')]&&_0x373f8b[_0x0ee7('0x60')]['status']){_0x5b76aa=_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x2f')];return db[_0x0ee7('0xac')]['find']({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xc9')]}});}break;case _0x0ee7('0x8b'):if(_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xca')]&&_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xcb')]){_0x5b76aa=_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xcb')];return db[_0x0ee7('0xac')]['find']({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xca')]}});}break;case _0x0ee7('0xcc'):if(_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x8c')]&&_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xcd')]){_0x5b76aa=_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xcd')];return db[_0x0ee7('0xac')][_0x0ee7('0x5e')]({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')]['message_id']}});}break;case _0x0ee7('0xce'):var _0x434308=_0x373f8b[_0x0ee7('0x60')]['results'][0x0];if(_0x434308['messageId']&&_0x434308[_0x0ee7('0x2f')]['groupName']===_0x0ee7('0xcf')){_0x5b76aa=_0x434308[_0x0ee7('0x2f')][_0x0ee7('0xd0')];return db[_0x0ee7('0xac')][_0x0ee7('0x5e')]({'where':{'messageId':_0x434308[_0x0ee7('0x87')]}});}break;case'clickatell':if(_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x87')]&&_0x373f8b[_0x0ee7('0x60')]['status']){_0x5b76aa=_0x373f8b['body']['status'];return db[_0x0ee7('0xac')][_0x0ee7('0x5e')]({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')]['messageId']}});}break;case'bandwidth':if(_0x373f8b[_0x0ee7('0x60')][0x0]['message']['id']){_0x5b76aa=_0x373f8b[_0x0ee7('0x60')][0x0][_0x0ee7('0x43')];return db[_0x0ee7('0xac')][_0x0ee7('0x5e')]({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')][0x0]['message']['id']}});}break;case _0x0ee7('0xd1'):if(_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xd2')]&&_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x2f')]){_0x5b76aa=_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x2f')];return db[_0x0ee7('0xac')]['find']({'where':{'messageId':_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xd2')]}});}break;}}})[_0x0ee7('0x22')](handleEntityNotFound(_0x2de524,null))['then'](function(_0x1a51d0){if(_0x1a51d0){_0xdb565f=_0x1a51d0;switch(_0x10534f[_0x0ee7('0x43')]){case _0x0ee7('0xc8'):if(_0x5b76aa===_0x0ee7('0xcf')){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),'status','skebby',util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0ee7('0x8b'):if(_0x5b76aa==='1'){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util['inspect'](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0ee7('0xcc'):if(!_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0xd3')]&&_0x5b76aa>=0xc8&&_0x5b76aa<=0xce){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),_0x0ee7('0x2f'),_0x0ee7('0xcc'),util['inspect'](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0ee7('0xce'):var _0x1758e3=_0x373f8b[_0x0ee7('0x60')][_0x0ee7('0x90')][0x0];if(_0x1758e3[_0x0ee7('0x2f')][_0x0ee7('0xd0')]===_0x0ee7('0xcf')){return _0xdb565f['update']({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),_0x0ee7('0x2f'),_0x0ee7('0xce'),util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5b76aa=='DELIVERED_TO_GATEWAY'||_0x5b76aa==_0x0ee7('0xd4')){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),_0x0ee7('0x2f'),_0x0ee7('0x94'),util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0ee7('0x97'):if(_0x5b76aa=='message-delivered'){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),'status',_0x0ee7('0x97'),util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0ee7('0xd1'):if(_0x5b76aa==='DELIVRD'||_0x5b76aa===_0x0ee7('0xd5')){return _0xdb565f[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),'status','intelepeer',util[_0x0ee7('0xc7')](_0x373f8b[_0x0ee7('0x60')],{'showHidden':![],'depth':null}));}break;}return _0xdb565f;}})[_0x0ee7('0x22')](respondWithResult(_0x2de524,null))[_0x0ee7('0x2d')](handleError(_0x2de524,null));};exports['statusGet']=function(_0x21eca3,_0x3fc6f2,_0x27c8a1){var _0x526a40,_0x48676d,_0x5a3398;return db[_0x0ee7('0x41')]['find']({'where':{'id':_0x21eca3[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x3fc6f2,null))[_0x0ee7('0x22')](function(_0x1296f2){if(_0x1296f2){_0x5a3398=_0x1296f2;logger[_0x0ee7('0x25')](_0x0ee7('0x26'),_0x0ee7('0x2f'),_0x0ee7('0xc6'),_0x1296f2[_0x0ee7('0x43')],util[_0x0ee7('0xc7')](_0x21eca3[_0x0ee7('0x47')],{'showHidden':![],'depth':null}));switch(_0x1296f2[_0x0ee7('0x43')]){case _0x0ee7('0x91'):if(_0x21eca3['query'][_0x0ee7('0xd6')]&&_0x21eca3[_0x0ee7('0x47')][_0x0ee7('0xd7')]){_0x48676d=_0x21eca3[_0x0ee7('0x47')][_0x0ee7('0xd7')];return db[_0x0ee7('0xac')][_0x0ee7('0x5e')]({'where':{'messageId':_0x21eca3['query'][_0x0ee7('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x3fc6f2,null))[_0x0ee7('0x22')](function(_0xac374f){if(_0xac374f){_0x526a40=_0xac374f;switch(_0x5a3398[_0x0ee7('0x43')]){case _0x0ee7('0x91'):if(_0x48676d==='2'||_0x48676d==='6'){return _0x526a40[_0x0ee7('0x66')]({'read':!![]});}else{logger[_0x0ee7('0x28')](_0x0ee7('0x26'),_0x0ee7('0x2f'),'csc',util[_0x0ee7('0xc7')](_0x21eca3[_0x0ee7('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x526a40;}})[_0x0ee7('0x22')](respondWithResult(_0x3fc6f2,null))[_0x0ee7('0x2d')](handleError(_0x3fc6f2,null));};exports['addAgents']=function(_0x40a526,_0x45e01d,_0x1296ad){return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x40a526['params']['id']}})['then'](handleEntityNotFound(_0x45e01d,null))[_0x0ee7('0x22')](function(_0x1dff63){if(_0x1dff63){return _0x1dff63[_0x0ee7('0xd8')](_0x40a526[_0x0ee7('0x60')][_0x0ee7('0x6e')],_[_0x0ee7('0xd9')](_0x40a526[_0x0ee7('0x60')],[_0x0ee7('0x6e'),'id'])||{})[_0x0ee7('0xc4')](function(_0x2baf55){for(var _0x1312ae=0x0;_0x1312ae<_0x40a526[_0x0ee7('0x60')]['ids']['length'];_0x1312ae+=0x1){socket['emit'](_0x0ee7('0xda'),{'UserId':Number(_0x40a526[_0x0ee7('0x60')][_0x0ee7('0x6e')][_0x1312ae]),'SmsAccountId':Number(_0x40a526[_0x0ee7('0x5b')]['id'])});}return _0x2baf55;});}})[_0x0ee7('0x22')](respondWithResult(_0x45e01d,null))[_0x0ee7('0x2d')](handleError(_0x45e01d,null));};exports['removeAgents']=function(_0x2b15a1,_0x5c2217,_0x222945){return db[_0x0ee7('0x41')][_0x0ee7('0x5e')]({'where':{'id':_0x2b15a1[_0x0ee7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5c2217,null))[_0x0ee7('0x22')](function(_0x19c270){if(_0x19c270){return _0x19c270[_0x0ee7('0xdb')](_0x2b15a1['query'][_0x0ee7('0x6e')])[_0x0ee7('0x22')](function(){if(_[_0x0ee7('0xdc')](_0x2b15a1[_0x0ee7('0x47')][_0x0ee7('0x6e')])){for(var _0x27803f=0x0;_0x27803f<_0x2b15a1[_0x0ee7('0x47')][_0x0ee7('0x6e')][_0x0ee7('0x4c')];_0x27803f+=0x1){socket[_0x0ee7('0xdd')](_0x0ee7('0xde'),{'UserId':Number(_0x2b15a1[_0x0ee7('0x47')][_0x0ee7('0x6e')][_0x27803f]),'SmsAccountId':Number(_0x2b15a1[_0x0ee7('0x5b')]['id'])});}}else{socket[_0x0ee7('0xdd')](_0x0ee7('0xde'),{'UserId':Number(_0x2b15a1[_0x0ee7('0x47')]['ids']),'SmsAccountId':Number(_0x2b15a1['params']['id'])});}});}})[_0x0ee7('0x22')](respondWithStatusCode(_0x5c2217,null))[_0x0ee7('0x2d')](handleError(_0x5c2217,null));};exports[_0x0ee7('0xdf')]=function(_0x3d156c,_0x2eb7e7,_0x491a08){var _0x4b3e10={};var _0x36ee15={};var _0x201233;var _0x7403dc;return db['SmsAccount'][_0x0ee7('0x6c')]({'where':{'id':_0x3d156c[_0x0ee7('0x5b')]['id']}})[_0x0ee7('0x22')](handleEntityNotFound(_0x2eb7e7,null))['then'](function(_0x34933d){if(_0x34933d){_0x201233=_0x34933d;_0x36ee15[_0x0ee7('0x45')]=_['keys'](db[_0x0ee7('0xe0')]['rawAttributes']);_0x36ee15[_0x0ee7('0x47')]=_['keys'](_0x3d156c['query']);_0x36ee15[_0x0ee7('0x52')]=_['intersection'](_0x36ee15[_0x0ee7('0x45')],_0x36ee15[_0x0ee7('0x47')]);_0x4b3e10[_0x0ee7('0x49')]=_[_0x0ee7('0x4a')](_0x36ee15[_0x0ee7('0x45')],qs[_0x0ee7('0x4b')](_0x3d156c[_0x0ee7('0x47')][_0x0ee7('0x4b')]));_0x4b3e10[_0x0ee7('0x49')]=_0x4b3e10[_0x0ee7('0x49')]['length']?_0x4b3e10[_0x0ee7('0x49')]:_0x36ee15[_0x0ee7('0x45')];_0x4b3e10[_0x0ee7('0x4f')]=qs[_0x0ee7('0x50')](_0x3d156c['query'][_0x0ee7('0x50')]);_0x4b3e10[_0x0ee7('0x51')]=qs['filters'](_[_0x0ee7('0x53')](_0x3d156c[_0x0ee7('0x47')],_0x36ee15[_0x0ee7('0x52')]));if(_0x3d156c[_0x0ee7('0x47')][_0x0ee7('0x56')]){_0x4b3e10[_0x0ee7('0x51')]=_['merge'](_0x4b3e10['where'],{'$or':_[_0x0ee7('0x46')](_0x4b3e10[_0x0ee7('0x49')],function(_0x16b3ca){var _0x4cb98f={};_0x4cb98f[_0x16b3ca]={'$like':'%'+_0x3d156c[_0x0ee7('0x47')]['filter']+'%'};return _0x4cb98f;})});}_0x4b3e10=_[_0x0ee7('0x54')]({},_0x4b3e10,_0x3d156c[_0x0ee7('0x57')]);return _0x201233[_0x0ee7('0xdf')](_0x4b3e10);}})[_0x0ee7('0x22')](function(_0x154d9c){if(_0x154d9c){_0x7403dc=_0x154d9c[_0x0ee7('0x4c')];if(!_0x3d156c['query']['hasOwnProperty'](_0x0ee7('0x4e'))){_0x4b3e10[_0x0ee7('0x34')]=qs[_0x0ee7('0x34')](_0x3d156c[_0x0ee7('0x47')][_0x0ee7('0x34')]);_0x4b3e10[_0x0ee7('0x32')]=qs[_0x0ee7('0x32')](_0x3d156c[_0x0ee7('0x47')][_0x0ee7('0x32')]);}return _0x201233[_0x0ee7('0xdf')](_0x4b3e10);}})[_0x0ee7('0x22')](function(_0xccbfe1){if(_0xccbfe1){return _0xccbfe1?{'count':_0x7403dc,'rows':_0xccbfe1}:null;}})[_0x0ee7('0x22')](respondWithResult(_0x2eb7e7,null))['catch'](handleError(_0x2eb7e7,null));}; \ No newline at end of file +var _0x652f=['http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','type','VIRTUAL','merge','include','show','params','keys','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','findAll','rows','ids','CannedAnswer','removeAnswers','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','connectel','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','omit','SmsInteraction','spread','interaction','autoclose','push','close','created','SmsMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','\x0a','json','addApplications','transaction','getApplications','getInteractions','User','Owner','fullname','internal','Tags','color','tag','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','client'];(function(_0x4fb605,_0x4f098b){var _0x4ff438=function(_0x35e8c4){while(--_0x35e8c4){_0x4fb605['push'](_0x4fb605['shift']());}};_0x4ff438(++_0x4f098b);}(_0x652f,0xbe));var _0xf652=function(_0x1d1357,_0x203a07){_0x1d1357=_0x1d1357-0x0;var _0x4422ba=_0x652f[_0x1d1357];return _0x4422ba;};'use strict';var emlformat=require(_0xf652('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf652('0x1'));var jsonpatch=require(_0xf652('0x2'));var rp=require('request-promise');var moment=require(_0xf652('0x3'));var BPromise=require(_0xf652('0x4'));var Mustache=require(_0xf652('0x5'));var util=require(_0xf652('0x6'));var path=require(_0xf652('0x7'));var sox=require(_0xf652('0x8'));var csv=require(_0xf652('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf652('0xa'));var _=require(_0xf652('0xb'));var squel=require(_0xf652('0xc'));var crypto=require(_0xf652('0xd'));var jsforce=require(_0xf652('0xe'));var deskjs=require(_0xf652('0xf'));var toCsv=require(_0xf652('0x9'));var querystring=require(_0xf652('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf652('0x11'));var qs=require(_0xf652('0x12'));var as=require(_0xf652('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf652('0x14'))(_0xf652('0x15'));var utils=require(_0xf652('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf652('0x17'))['db'];config['redis']=_[_0xf652('0x18')](config[_0xf652('0x19')],{'host':_0xf652('0x1a'),'port':0x18eb});var socket=require(_0xf652('0x1b'))(new Redis(config['redis']));require(_0xf652('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf652('0x1d')][_0xf652('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3a6b00,_0x9465c3,_0x41d4a0,_0x1535bb){return new BPromise(function(_0x3bfb56,_0x18afe5){var _0x390a22=_0x1535bb||client;return _0x390a22[_0xf652('0x1f')](_0x3a6b00,_0x41d4a0)[_0xf652('0x20')](function(_0x51d214){logger[_0xf652('0x21')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,_0xf652('0x22'));logger['debug'](_0xf652('0x23'),_0x9465c3,'request\x20sent',JSON[_0xf652('0x24')](_0x51d214));if(_0x51d214[_0xf652('0x25')]){if(_0x51d214['error']['code']===0x1f4){logger[_0xf652('0x25')](_0xf652('0x26'),_0x9465c3,_0x51d214[_0xf652('0x25')]['message']);return _0x18afe5(_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);}logger[_0xf652('0x25')](_0xf652('0x26'),_0x9465c3,_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);return _0x3bfb56(_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);}else{logger[_0xf652('0x21')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,'request\x20sent');_0x3bfb56(_0x51d214['result'][_0xf652('0x27')]);}})[_0xf652('0x28')](function(_0x4193ae){logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,_0x4193ae);_0x18afe5(_0x4193ae);});});}function respondWithStatusCode(_0x3b6e2c,_0x404ce2){_0x404ce2=_0x404ce2||0xcc;return function(_0x16f650){if(_0x16f650){return _0x3b6e2c[_0xf652('0x29')](_0x404ce2);}return _0x3b6e2c[_0xf652('0x2a')](_0x404ce2)[_0xf652('0x2b')]();};}function respondWithResult(_0x29bd14,_0x125119){_0x125119=_0x125119||0xc8;return function(_0x3bcf5f){if(_0x3bcf5f){return _0x29bd14[_0xf652('0x2a')](_0x125119)['json'](_0x3bcf5f);}};}function respondWithFilteredResult(_0x174ce6,_0x2a7201){return function(_0x446660){if(_0x446660){var _0x2c06c9=typeof _0x2a7201[_0xf652('0x2c')]==='undefined'&&typeof _0x2a7201[_0xf652('0x2d')]===_0xf652('0x2e');var _0x4a4f37=_0x446660[_0xf652('0x2f')];var _0x14b7ce=_0x2c06c9?0x0:_0x2a7201[_0xf652('0x2c')];var _0x2d4881=_0x2c06c9?_0x446660[_0xf652('0x2f')]:_0x2a7201[_0xf652('0x2c')]+_0x2a7201[_0xf652('0x2d')];var _0x1efd5e;if(_0x2d4881>=_0x4a4f37){_0x2d4881=_0x4a4f37;_0x1efd5e=0xc8;}else{_0x1efd5e=0xce;}_0x174ce6['status'](_0x1efd5e);return _0x174ce6[_0xf652('0x30')](_0xf652('0x31'),_0x14b7ce+'-'+_0x2d4881+'/'+_0x4a4f37)['json'](_0x446660);}return null;};}function patchUpdates(_0x1d0962){return function(_0x3cd82e){try{jsonpatch[_0xf652('0x32')](_0x3cd82e,_0x1d0962,!![]);}catch(_0x53af55){return BPromise[_0xf652('0x33')](_0x53af55);}return _0x3cd82e[_0xf652('0x34')]();};}function saveUpdates(_0x930582,_0x37891d){return function(_0x46a893){if(_0x46a893){return _0x46a893[_0xf652('0x35')](_0x930582)[_0xf652('0x20')](function(_0x35cfc4){return _0x35cfc4;});}return null;};}function removeEntity(_0x61a6c4,_0x497403){return function(_0x398513){if(_0x398513){return _0x398513[_0xf652('0x36')]()[_0xf652('0x20')](function(){var _0xf53598=_0x398513[_0xf652('0x37')]({'plain':!![]});var _0xb289bc=_0xf652('0x38');return db[_0xf652('0x39')][_0xf652('0x36')]({'where':{'type':_0xb289bc,'resourceId':_0xf53598['id']}})['then'](function(){return _0x398513;});})[_0xf652('0x20')](function(){_0x61a6c4[_0xf652('0x2a')](0xcc)[_0xf652('0x2b')]();});}};}function handleEntityNotFound(_0x5c4b23,_0x39b017){return function(_0x125a11){if(!_0x125a11){_0x5c4b23[_0xf652('0x29')](0x194);}return _0x125a11;};}function handleError(_0x4264f2,_0x1e631f){_0x1e631f=_0x1e631f||0x1f4;return function(_0x3d88a9){logger[_0xf652('0x25')](_0x3d88a9[_0xf652('0x3a')]);if(_0x3d88a9[_0xf652('0x3b')]){delete _0x3d88a9[_0xf652('0x3b')];}_0x4264f2[_0xf652('0x2a')](_0x1e631f)[_0xf652('0x3c')](_0x3d88a9);};}exports[_0xf652('0x3d')]=function(_0x1e272d,_0x37f22c){var _0x773c1={'include':[{'model':db[_0xf652('0x3e')],'as':_0xf652('0x3f')}]},_0x5ab5cd={},_0x4b0512={'count':0x0,'rows':[]};var _0x42050c=_[_0xf652('0x40')](db[_0xf652('0x41')]['rawAttributes'],function(_0x695c4a){return{'name':_0x695c4a[_0xf652('0x42')],'type':_0x695c4a['type'][_0xf652('0x43')]};});_0x5ab5cd[_0xf652('0x44')]=_[_0xf652('0x40')](_0x42050c,_0xf652('0x3b'));_0x5ab5cd[_0xf652('0x45')]=_['keys'](_0x1e272d['query']);_0x5ab5cd[_0xf652('0x46')]=_[_0xf652('0x47')](_0x5ab5cd[_0xf652('0x44')],_0x5ab5cd['query']);_0x773c1[_0xf652('0x48')]=_[_0xf652('0x47')](_0x5ab5cd['model'],qs['fields'](_0x1e272d['query'][_0xf652('0x49')]));_0x773c1['attributes']=_0x773c1[_0xf652('0x48')][_0xf652('0x4a')]?_0x773c1[_0xf652('0x48')]:_0x5ab5cd['model'];if(!_0x1e272d[_0xf652('0x45')]['hasOwnProperty'](_0xf652('0x4b'))){_0x773c1[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x1e272d[_0xf652('0x45')][_0xf652('0x2d')]);_0x773c1[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x1e272d[_0xf652('0x45')][_0xf652('0x2c')]);}_0x773c1['order']=qs[_0xf652('0x4c')](_0x1e272d[_0xf652('0x45')][_0xf652('0x4c')]);_0x773c1['where']=qs['filters'](_['pick'](_0x1e272d[_0xf652('0x45')],_0x5ab5cd['filters']),_0x42050c);if(_0x1e272d['query'][_0xf652('0x4d')]){_0x773c1[_0xf652('0x4e')]=_['merge'](_0x773c1[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x42050c,function(_0x5d2de7){if(_0x5d2de7[_0xf652('0x4f')]!==_0xf652('0x50')){var _0xfbfbb5={};_0xfbfbb5[_0x5d2de7[_0xf652('0x3b')]]={'$like':'%'+_0x1e272d[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0xfbfbb5;}})});}_0x773c1=_[_0xf652('0x51')]({},_0x773c1,_0x1e272d['options']);var _0x564a8c={'where':_0x773c1[_0xf652('0x4e')]};return db[_0xf652('0x41')][_0xf652('0x2f')](_0x564a8c)[_0xf652('0x20')](function(_0x363f7b){_0x4b0512[_0xf652('0x2f')]=_0x363f7b;if(_0x1e272d[_0xf652('0x45')]['includeAll']){_0x773c1[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x41')]['findAll'](_0x773c1);})[_0xf652('0x20')](function(_0x408fee){_0x4b0512['rows']=_0x408fee;return _0x4b0512;})['then'](respondWithFilteredResult(_0x37f22c,_0x773c1))[_0xf652('0x28')](handleError(_0x37f22c,null));};exports[_0xf652('0x53')]=function(_0x1be00f,_0x58d642){var _0x42ad1b={'raw':![],'where':{'id':_0x1be00f[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x3e')],'as':_0xf652('0x3f')}]},_0x47f06f={};_0x47f06f['model']=_[_0xf652('0x55')](db[_0xf652('0x41')][_0xf652('0x56')]);_0x47f06f[_0xf652('0x45')]=_[_0xf652('0x55')](_0x1be00f[_0xf652('0x45')]);_0x47f06f[_0xf652('0x46')]=_[_0xf652('0x47')](_0x47f06f[_0xf652('0x44')],_0x47f06f['query']);_0x42ad1b[_0xf652('0x48')]=_[_0xf652('0x47')](_0x47f06f[_0xf652('0x44')],qs['fields'](_0x1be00f[_0xf652('0x45')][_0xf652('0x49')]));_0x42ad1b['attributes']=_0x42ad1b[_0xf652('0x48')][_0xf652('0x4a')]?_0x42ad1b[_0xf652('0x48')]:_0x47f06f[_0xf652('0x44')];if(_0x1be00f['query'][_0xf652('0x57')]){_0x42ad1b[_0xf652('0x52')]=[{'all':!![]}];}_0x42ad1b=_[_0xf652('0x51')]({},_0x42ad1b,_0x1be00f[_0xf652('0x58')]);return db[_0xf652('0x41')][_0xf652('0x59')](_0x42ad1b)['then'](handleEntityNotFound(_0x58d642,null))['then'](respondWithResult(_0x58d642,null))[_0xf652('0x28')](handleError(_0x58d642,null));};exports[_0xf652('0x5a')]=function(_0x413444,_0xe542ec){return db[_0xf652('0x41')][_0xf652('0x5a')](_0x413444[_0xf652('0x5b')],{})[_0xf652('0x20')](function(_0x4b92b5){var _0x30e484=_0x413444[_0xf652('0x5c')][_0xf652('0x37')]({'plain':!![]});if(!_0x30e484)throw new Error(_0xf652('0x5d'));if(_0x30e484[_0xf652('0x5e')]==='user'){var _0x742ae3=_0x4b92b5[_0xf652('0x37')]({'plain':!![]});var _0x204f9f=_0xf652('0x38');return db[_0xf652('0x5f')][_0xf652('0x59')]({'where':{'name':_0x204f9f,'userProfileId':_0x30e484[_0xf652('0x60')]},'raw':!![]})['then'](function(_0x10acf8){if(_0x10acf8&&_0x10acf8[_0xf652('0x61')]===0x0){return db[_0xf652('0x39')][_0xf652('0x5a')]({'name':_0x742ae3[_0xf652('0x3b')],'resourceId':_0x742ae3['id'],'type':_0x10acf8[_0xf652('0x3b')],'sectionId':_0x10acf8['id']},{})[_0xf652('0x20')](function(){return _0x4b92b5;});}else{return _0x4b92b5;}})[_0xf652('0x28')](function(_0xe1d16c){logger[_0xf652('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe1d16c);throw _0xe1d16c;});}return _0x4b92b5;})['then'](respondWithResult(_0xe542ec,0xc9))[_0xf652('0x28')](handleError(_0xe542ec,null));};exports[_0xf652('0x35')]=function(_0x2bf890,_0x6487a1){if(_0x2bf890[_0xf652('0x5b')]['id']){delete _0x2bf890[_0xf652('0x5b')]['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x2bf890[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x6487a1,null))[_0xf652('0x20')](saveUpdates(_0x2bf890[_0xf652('0x5b')],null))[_0xf652('0x20')](respondWithResult(_0x6487a1,null))[_0xf652('0x28')](handleError(_0x6487a1,null));};exports[_0xf652('0x36')]=function(_0x5a5863,_0x3482cb){return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x5a5863[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x3482cb,null))[_0xf652('0x20')](removeEntity(_0x3482cb,null))[_0xf652('0x28')](handleError(_0x3482cb,null));};exports[_0xf652('0x62')]=function(_0x599beb,_0xaf4443){return db[_0xf652('0x41')][_0xf652('0x62')]()[_0xf652('0x20')](respondWithResult(_0xaf4443,null))[_0xf652('0x28')](handleError(_0xaf4443,null));};exports[_0xf652('0x63')]=function(_0x21313f,_0x3693a6,_0x3877f2){if(_0x21313f[_0xf652('0x5b')]['id']){delete _0x21313f['body']['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x21313f[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3693a6,null))[_0xf652('0x20')](function(_0x2fb947){if(_0x2fb947){_0x21313f[_0xf652('0x5b')][_0xf652('0x64')]=_0x2fb947['id'];return db[_0xf652('0x65')][_0xf652('0x5a')](_0x21313f[_0xf652('0x5b')]);}})['then'](respondWithResult(_0x3693a6,null))[_0xf652('0x28')](handleError(_0x3693a6,null));};exports[_0xf652('0x66')]=function(_0x2f8a83,_0x25bb85,_0x2ae2e8){var _0x9cd01c={'raw':![],'where':{}};var _0x1eed4f={};var _0x4da976={'count':0x0,'rows':[]};return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x2f8a83['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x25bb85,null))['then'](function(_0xd67ab3){if(_0xd67ab3){_0x1eed4f[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0x65')][_0xf652('0x56')]);_0x1eed4f['query']=_['keys'](_0x2f8a83[_0xf652('0x45')]);_0x1eed4f['filters']=_[_0xf652('0x47')](_0x1eed4f[_0xf652('0x44')],_0x1eed4f[_0xf652('0x45')]);_0x9cd01c[_0xf652('0x48')]=_[_0xf652('0x47')](_0x1eed4f['model'],qs[_0xf652('0x49')](_0x2f8a83[_0xf652('0x45')]['fields']));_0x9cd01c[_0xf652('0x48')]=_0x9cd01c[_0xf652('0x48')][_0xf652('0x4a')]?_0x9cd01c['attributes']:_0x1eed4f[_0xf652('0x44')];if(!_0x2f8a83[_0xf652('0x45')][_0xf652('0x68')](_0xf652('0x4b'))){_0x9cd01c[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x2f8a83[_0xf652('0x45')][_0xf652('0x2d')]);_0x9cd01c['offset']=qs[_0xf652('0x2c')](_0x2f8a83['query'][_0xf652('0x2c')]);}_0x9cd01c[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x2f8a83['query']['sort']);_0x9cd01c[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x2f8a83[_0xf652('0x45')],_0x1eed4f[_0xf652('0x46')]));_0x9cd01c[_0xf652('0x4e')][_0xf652('0x64')]=_0xd67ab3['id'];if(_0x2f8a83[_0xf652('0x45')][_0xf652('0x4d')]){_0x9cd01c[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x9cd01c['where'],{'$or':_[_0xf652('0x40')](_0x9cd01c['attributes'],function(_0x568a7a){var _0x1f1fa4={};_0x1f1fa4[_0x568a7a]={'$like':'%'+_0x2f8a83[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1f1fa4;})});}_0x9cd01c=_[_0xf652('0x51')]({},_0x9cd01c,_0x2f8a83['options']);return db[_0xf652('0x65')][_0xf652('0x2f')]({'where':_0x9cd01c['where']})['then'](function(_0x263d2e){_0x4da976[_0xf652('0x2f')]=_0x263d2e;if(_0x2f8a83['query']['includeAll']){_0x9cd01c[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x65')][_0xf652('0x6b')](_0x9cd01c);})[_0xf652('0x20')](function(_0x222796){_0x4da976[_0xf652('0x6c')]=_0x222796;return _0x4da976;});}})[_0xf652('0x20')](respondWithFilteredResult(_0x25bb85,_0x9cd01c))[_0xf652('0x28')](handleError(_0x25bb85,null));};exports['removeDispositions']=function(_0x29b61c,_0x22cc29,_0x14234d){return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x29b61c[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x22cc29,null))[_0xf652('0x20')](function(_0x1a7707){if(_0x1a7707){return _0x1a7707['removeDispositions'](_0x29b61c[_0xf652('0x45')][_0xf652('0x6d')]);}})['then'](respondWithStatusCode(_0x22cc29,null))['catch'](handleError(_0x22cc29,null));};exports['addAnswer']=function(_0x17430c,_0x53ea75,_0x450312){if(_0x17430c['body']['id']){delete _0x17430c[_0xf652('0x5b')]['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x17430c['params']['id']}})['then'](handleEntityNotFound(_0x53ea75,null))[_0xf652('0x20')](function(_0x13063c){if(_0x13063c){_0x17430c[_0xf652('0x5b')]['SmsAccountId']=_0x13063c['id'];return db[_0xf652('0x6e')][_0xf652('0x5a')](_0x17430c[_0xf652('0x5b')]);}})[_0xf652('0x20')](respondWithResult(_0x53ea75,null))[_0xf652('0x28')](handleError(_0x53ea75,null));};exports['getAnswers']=function(_0x14ee61,_0xd99051,_0x203573){var _0x772075={'raw':![],'where':{}};var _0x362b3f={};var _0x507efd={'count':0x0,'rows':[]};return db[_0xf652('0x41')]['findOne']({'where':{'id':_0x14ee61['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0xd99051,null))[_0xf652('0x20')](function(_0x1b4f48){if(_0x1b4f48){_0x362b3f[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0x6e')][_0xf652('0x56')]);_0x362b3f[_0xf652('0x45')]=_[_0xf652('0x55')](_0x14ee61[_0xf652('0x45')]);_0x362b3f[_0xf652('0x46')]=_[_0xf652('0x47')](_0x362b3f[_0xf652('0x44')],_0x362b3f[_0xf652('0x45')]);_0x772075[_0xf652('0x48')]=_[_0xf652('0x47')](_0x362b3f[_0xf652('0x44')],qs['fields'](_0x14ee61[_0xf652('0x45')][_0xf652('0x49')]));_0x772075[_0xf652('0x48')]=_0x772075[_0xf652('0x48')]['length']?_0x772075[_0xf652('0x48')]:_0x362b3f[_0xf652('0x44')];if(!_0x14ee61[_0xf652('0x45')][_0xf652('0x68')](_0xf652('0x4b'))){_0x772075[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x14ee61[_0xf652('0x45')][_0xf652('0x2d')]);_0x772075[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x14ee61['query'][_0xf652('0x2c')]);}_0x772075[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x14ee61[_0xf652('0x45')][_0xf652('0x4c')]);_0x772075[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x14ee61['query'],_0x362b3f[_0xf652('0x46')]));_0x772075[_0xf652('0x4e')][_0xf652('0x64')]=_0x1b4f48['id'];if(_0x14ee61['query'][_0xf652('0x4d')]){_0x772075['where']=_[_0xf652('0x51')](_0x772075[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x772075[_0xf652('0x48')],function(_0x27359e){var _0x1493e6={};_0x1493e6[_0x27359e]={'$like':'%'+_0x14ee61[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1493e6;})});}_0x772075=_[_0xf652('0x51')]({},_0x772075,_0x14ee61[_0xf652('0x58')]);return db[_0xf652('0x6e')][_0xf652('0x2f')]({'where':_0x772075[_0xf652('0x4e')]})[_0xf652('0x20')](function(_0x58c01a){_0x507efd[_0xf652('0x2f')]=_0x58c01a;if(_0x14ee61[_0xf652('0x45')][_0xf652('0x57')]){_0x772075[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x6e')]['findAll'](_0x772075);})[_0xf652('0x20')](function(_0x394b47){_0x507efd['rows']=_0x394b47;return _0x507efd;});}})['then'](respondWithFilteredResult(_0xd99051,_0x772075))[_0xf652('0x28')](handleError(_0xd99051,null));};exports['removeAnswers']=function(_0x4ad1ed,_0x31301e,_0x3d2188){return db['SmsAccount'][_0xf652('0x59')]({'where':{'id':_0x4ad1ed[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x31301e,null))['then'](function(_0x2aea75){if(_0x2aea75){return _0x2aea75[_0xf652('0x6f')](_0x4ad1ed[_0xf652('0x45')][_0xf652('0x6d')]);}})[_0xf652('0x20')](respondWithStatusCode(_0x31301e,null))['catch'](handleError(_0x31301e,null));};exports['notify']=function(_0x1f0071,_0xb23822,_0x292ff1){var _0x288f2a={'channel':'sms'};var _0x3555f1=[];var _0x5aa30f=[];var _0x550b08={};return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x1f0071[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x70')],'as':_0xf652('0x71')}]})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x3c51f2){_0x288f2a['account']=_0x3c51f2;_0x288f2a[_0xf652('0x72')]=_[_0xf652('0x73')](_0x3c51f2['Applications'],[_0xf652('0x74')],[_0xf652('0x75')]);if(_0x288f2a[_0xf652('0x76')][_0xf652('0x71')]){delete _0x288f2a[_0xf652('0x76')][_0xf652('0x71')];}return db[_0xf652('0x77')][_0xf652('0x62')]();})['then'](function(_0x58b9c2){if(!_0x58b9c2){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))](_0xf652('0x7a'));}_0x3555f1=_[_0xf652('0x7b')](_[_0xf652('0x55')](_0x58b9c2),[_0xf652('0x7c'),'updatedAt']);_0x5aa30f=_[_0xf652('0x7b')](_[_0xf652('0x55')](_0x58b9c2),[_0xf652('0x7c'),'updatedAt',_0xf652('0x7d'),_0xf652('0x7e')]);_0x288f2a[_0xf652('0x5b')]={'mapKey':_0xf652('0x7f')};if(_0x288f2a[_0xf652('0x76')][_0xf652('0x4f')]){switch(_0x288f2a[_0xf652('0x76')]['type']){case _0xf652('0x80'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x82')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x83')];_0x288f2a['body'][_0xf652('0x84')]=_0x1f0071['body']['MessageSid'];break;case _0xf652('0x85'):_0x288f2a['body'][_0xf652('0x81')]='+'+_0x1f0071[_0xf652('0x5b')][_0xf652('0x86')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x87')];break;case _0xf652('0x88'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071['body'][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x27')];break;case'clicksend':_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')]['body']=_0x1f0071['body'][_0xf652('0x5b')];_0x288f2a[_0xf652('0x5b')]['messageId']=_0x1f0071['body'][_0xf652('0x89')];break;case _0xf652('0x8a'):_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x82')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')]['Text'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x8b')];break;case _0xf652('0x8c'):_0x288f2a['body'][_0xf652('0x81')]='+'+_0x1f0071[_0xf652('0x5b')][_0xf652('0x8d')][0x0][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071['body'][_0xf652('0x8d')][0x0][_0xf652('0x87')];_0x288f2a['body'][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')]['results'][0x0][_0xf652('0x84')];break;case _0xf652('0x8e'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x8f')];_0x288f2a['body'][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')]['segmentedMessage']['message'];break;case _0xf652('0x90'):_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')]['fromNumber'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x87')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x91')];break;case _0xf652('0x92'):_0x288f2a[_0xf652('0x5b')]['messageId']=_0x1f0071[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][0x0][_0xf652('0x27')]['from'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][0x0]['message'][_0xf652('0x87')];break;case'intelepeer':_0x288f2a['body']['from']=_0x1f0071[_0xf652('0x5b')][_0xf652('0x81')];_0x288f2a['body'][_0xf652('0x5b')]=_0x1f0071['body'][_0xf652('0x27')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x93')];break;}}if(_0x288f2a[_0xf652('0x5b')]['id']){delete _0x288f2a[_0xf652('0x5b')]['id'];}if(_[_0xf652('0x94')](_0x288f2a['body'][_0xf652('0x81')])){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))](_0xf652('0x95'));}if(_[_0xf652('0x94')](_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')])||_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]===''){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf652('0x94')](_0x288f2a[_0xf652('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0xf652('0x79'))](_0xf652('0x96')+_0x5aa30f);}if(!_[_0xf652('0x97')](_0x5aa30f,_0x288f2a[_0xf652('0x5b')][_0xf652('0x98')])){throw new db['Sequelize']['ValidationError'](_0xf652('0x99')+_0x5aa30f);}_0x550b08[_0x288f2a[_0xf652('0x5b')]['mapKey']]=_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')];return db[_0xf652('0x9a')]['find']({'where':{'id':_0x288f2a[_0xf652('0x76')][_0xf652('0x7e')]},'include':[{'model':db[_0xf652('0x77')],'as':_0xf652('0x9b'),'where':_0x550b08,'limit':0x1,'order':[[_0xf652('0x9c'),_0xf652('0x9d')]]}]});})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x3f0e7d){if(_0x3f0e7d){_0x288f2a['list']=_[_0xf652('0x9e')](_0x3f0e7d,[_0xf652('0x9b')]);if(_0x3f0e7d[_0xf652('0x9b')][_0xf652('0x4a')]){return _0x3f0e7d[_0xf652('0x9b')][0x0];}var _0x24b160=_[_0xf652('0x18')](_0x288f2a[_0xf652('0x5b')],{'firstName':_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')],'ListId':_0x3f0e7d['id']});_0x24b160[_0x288f2a[_0xf652('0x5b')][_0xf652('0x98')]]=_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')];return db[_0xf652('0x77')][_0xf652('0x5a')](_0x24b160,{'fields':_0x3555f1,'raw':!![]});}})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x442bd9){if(_0x442bd9){_0x288f2a['contact']=_0x442bd9;var _0x50ea52={'ContactId':_0x442bd9['id'],'phone':_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id']};var _0x5a2546={'ContactId':_0x442bd9['id'],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0xf652('0x59')]({'where':_0x5a2546})[_0xf652('0x20')](function(_0x18eefc){if(_0x18eefc){return[_0x18eefc,![]];}return db[_0xf652('0x9f')][_0xf652('0x5a')](_0x50ea52)['then'](function(_0x1ceb6d){return[_0x1ceb6d,!![]];});});}})[_0xf652('0xa0')](function(_0x23466c,_0x1f90a5){_0x288f2a[_0xf652('0xa1')]=_0x23466c[_0xf652('0x37')]({'plain':!![]});_0x288f2a[_0xf652('0xa1')]['created']=![];if(_0x1f90a5){if(_0x288f2a[_0xf652('0x76')][_0xf652('0xa2')]){_0x288f2a['applications'][_0xf652('0xa3')]({'id':0x0,'priority':_0x288f2a[_0xf652('0x72')]['length']+0x1,'app':_0xf652('0xa4'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x288f2a[_0xf652('0xa1')][_0xf652('0xa5')]=!![];}return db[_0xf652('0xa6')][_0xf652('0x5a')]({'phone':_0x288f2a[_0xf652('0x5b')]['from'],'messageId':_0x288f2a[_0xf652('0x5b')]['messageId'],'body':_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id'],'SmsInteractionId':_0x23466c['id'],'direction':'in','ContactId':_0x23466c[_0xf652('0xa7')],'AttachmentId':_0x288f2a[_0xf652('0x5b')][_0xf652('0xa8')]});})[_0xf652('0x20')](function(_0x2d007c){_0x288f2a[_0xf652('0x27')]=_0x2d007c;if(_0x288f2a['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0xf652('0x3b')],'where':{'id':_0x288f2a['interaction'][_0xf652('0xa9')]}})[_0xf652('0x20')](function(_0xe9fdf5){if(_0xe9fdf5){_0x288f2a[_0xf652('0x72')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf652('0xaa'),'appdata':_0xe9fdf5[_0xf652('0x3b')]+','+(_0x288f2a[_0xf652('0x76')][_0xf652('0xab')]||0xa),'interval':_0xf652('0xac')});}return respondWithRpcPromise(_0xf652('0xad'),_0xf652('0xae'),_0x288f2a);});}return respondWithRpcPromise(_0xf652('0xad'),_0xf652('0xae'),_0x288f2a);})[_0xf652('0x20')](function(_0xb826d3){if(_0xb826d3){var _0x38486c=0xc8;var _0xebb768=_0xf652('0xaf');logger['info'](_0xf652('0x23'),_0xebb768,_0x38486c,_0xf652('0xb0'));logger[_0xf652('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xebb768,_0x38486c,'entity\x20found',JSON[_0xf652('0x24')](_0xb826d3));if(_0x288f2a[_0xf652('0x76')][_0xf652('0x4f')]===_0xf652('0x80')){return _0xb23822['status'](_0x38486c)[_0xf652('0x30')](_0xf652('0xb2'),_0xf652('0xb3'))[_0xf652('0x3c')](_0xf652('0xb4'));}else{return _0xb23822['status'](_0x38486c)[_0xf652('0xb5')](_0xb826d3);}}})[_0xf652('0x28')](handleError(_0xb23822,null));};exports[_0xf652('0xb6')]=function(_0x45e114,_0x1dde17,_0x4151af){return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x45e114['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x1dde17,null))[_0xf652('0x20')](function(_0x101335){if(_0x101335){return db['sequelize'][_0xf652('0xb7')](function(_0x2a6686){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x45e114[_0xf652('0x54')]['id']},'transaction':_0x2a6686})[_0xf652('0x20')](function(_0x335e49){var _0x16fb63=_['map'](_0x45e114[_0xf652('0x5b')],function(_0x4a9d5d){_0x4a9d5d['SmsAccountId']=_0x45e114[_0xf652('0x54')]['id'];return _0x4a9d5d;});return db[_0xf652('0x70')]['bulkCreate'](_0x16fb63,{'transaction':_0x2a6686});});})['then'](function(){return db[_0xf652('0x70')]['findAndCountAll']({'where':{'SmsAccountId':_0x45e114['params']['id']},'order':_0xf652('0x74')});});}})[_0xf652('0x20')](respondWithResult(_0x1dde17,null))[_0xf652('0x28')](handleError(_0x1dde17,null));};exports[_0xf652('0xb8')]=function(_0xa3d32c,_0x45da90,_0x51ea97){var _0x3d3f91={};var _0x3797bc={};var _0x33469a;var _0x11116c;return db['SmsAccount']['findOne']({'where':{'id':_0xa3d32c[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x45da90,null))['then'](function(_0x2e85d5){if(_0x2e85d5){_0x33469a=_0x2e85d5;_0x3797bc[_0xf652('0x44')]=_[_0xf652('0x55')](db['SmsApplication'][_0xf652('0x56')]);_0x3797bc[_0xf652('0x45')]=_[_0xf652('0x55')](_0xa3d32c['query']);_0x3797bc[_0xf652('0x46')]=_[_0xf652('0x47')](_0x3797bc[_0xf652('0x44')],_0x3797bc['query']);_0x3d3f91[_0xf652('0x48')]=_[_0xf652('0x47')](_0x3797bc[_0xf652('0x44')],qs[_0xf652('0x49')](_0xa3d32c['query'][_0xf652('0x49')]));_0x3d3f91[_0xf652('0x48')]=_0x3d3f91[_0xf652('0x48')][_0xf652('0x4a')]?_0x3d3f91[_0xf652('0x48')]:_0x3797bc[_0xf652('0x44')];_0x3d3f91[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0xa3d32c[_0xf652('0x45')][_0xf652('0x4c')]);_0x3d3f91[_0xf652('0x4e')]=qs[_0xf652('0x46')](_['pick'](_0xa3d32c[_0xf652('0x45')],_0x3797bc['filters']));if(_0xa3d32c[_0xf652('0x45')][_0xf652('0x4d')]){_0x3d3f91[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x3d3f91[_0xf652('0x4e')],{'$or':_['map'](_0x3d3f91[_0xf652('0x48')],function(_0x579657){var _0x466106={};_0x466106[_0x579657]={'$like':'%'+_0xa3d32c['query'][_0xf652('0x4d')]+'%'};return _0x466106;})});}_0x3d3f91=_[_0xf652('0x51')]({},_0x3d3f91,_0xa3d32c[_0xf652('0x58')]);return _0x33469a[_0xf652('0xb8')](_0x3d3f91);}})[_0xf652('0x20')](function(_0x594eca){if(_0x594eca){_0x11116c=_0x594eca[_0xf652('0x4a')];if(!_0xa3d32c['query'][_0xf652('0x68')](_0xf652('0x4b'))){_0x3d3f91[_0xf652('0x2d')]=qs['limit'](_0xa3d32c['query'][_0xf652('0x2d')]);_0x3d3f91[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0xa3d32c['query'][_0xf652('0x2c')]);}return _0x33469a[_0xf652('0xb8')](_0x3d3f91);}})[_0xf652('0x20')](function(_0x34dfb0){if(_0x34dfb0){return _0x34dfb0?{'count':_0x11116c,'rows':_0x34dfb0}:null;}})[_0xf652('0x20')](respondWithResult(_0x45da90,null))[_0xf652('0x28')](handleError(_0x45da90,null));};exports[_0xf652('0xb9')]=function(_0x52c5a2,_0x2f34e6,_0x2c2a50){var _0x3789da={'raw':![],'where':{}};var _0x2b7d85={};var _0x1ad058={'count':0x0,'rows':[]};return db[_0xf652('0x41')]['findOne']({'where':{'id':_0x52c5a2[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x2f34e6,null))[_0xf652('0x20')](function(_0x547073){if(_0x547073){_0x2b7d85[_0xf652('0x44')]=_['keys'](db[_0xf652('0x9f')][_0xf652('0x56')]);_0x2b7d85[_0xf652('0x45')]=_['keys'](_0x52c5a2[_0xf652('0x45')]);_0x2b7d85[_0xf652('0x46')]=_[_0xf652('0x47')](_0x2b7d85[_0xf652('0x44')],_0x2b7d85['query']);_0x3789da[_0xf652('0x48')]=_['intersection'](_0x2b7d85['model'],qs[_0xf652('0x49')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x49')]));_0x3789da['attributes']=_0x3789da[_0xf652('0x48')][_0xf652('0x4a')]?_0x3789da['attributes']:_0x2b7d85[_0xf652('0x44')];if(!_0x52c5a2[_0xf652('0x45')]['hasOwnProperty']('nolimit')){_0x3789da[_0xf652('0x2d')]=qs['limit'](_0x52c5a2[_0xf652('0x45')][_0xf652('0x2d')]);_0x3789da[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x2c')]);}_0x3789da[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x4c')]);_0x3789da[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x52c5a2[_0xf652('0x45')],_0x2b7d85[_0xf652('0x46')]));_0x3789da[_0xf652('0x4e')][_0xf652('0x64')]=_0x547073['id'];if(_0x52c5a2[_0xf652('0x45')]['filter']){_0x3789da[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x3789da[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x3789da[_0xf652('0x48')],function(_0x27cfc8){var _0x19df9a={};_0x19df9a[_0x27cfc8]={'$like':'%'+_0x52c5a2[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x19df9a;})});}_0x3789da=_[_0xf652('0x51')]({},_0x3789da,_0x52c5a2[_0xf652('0x58')]);return db[_0xf652('0x9f')][_0xf652('0x2f')]({'where':_0x3789da['where']})[_0xf652('0x20')](function(_0x306944){_0x1ad058[_0xf652('0x2f')]=_0x306944;if(_0x52c5a2[_0xf652('0x45')][_0xf652('0x57')]){_0x3789da[_0xf652('0x52')]=[{'model':db[_0xf652('0x77')],'as':'Contact','required':![]},{'model':db[_0xf652('0xba')],'as':_0xf652('0xbb'),'attributes':[_0xf652('0x3b'),_0xf652('0xbc'),_0xf652('0xbd')],'required':![]},{'model':db['Tag'],'as':_0xf652('0xbe'),'attributes':['id',_0xf652('0x3b'),_0xf652('0xbf')],'where':_0x52c5a2[_0xf652('0x45')][_0xf652('0xc0')]?{'id':_0x52c5a2['query'][_0xf652('0xc0')]}:undefined,'required':_0x52c5a2[_0xf652('0x45')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0xf652('0x6b')](_0x3789da);})['then'](function(_0x44c26f){_0x1ad058[_0xf652('0x6c')]=_0x44c26f;return _0x1ad058;});}})['then'](respondWithFilteredResult(_0x2f34e6,_0x3789da))[_0xf652('0x28')](handleError(_0x2f34e6,null));};exports[_0xf652('0x3c')]=function(_0x4b25d7,_0x3896af,_0x36edce){var _0x43fed3,_0x4832f3,_0xef4b80;if(_[_0xf652('0x94')](_0x4b25d7[_0xf652('0x5b')]['body'])||_0x4b25d7[_0xf652('0x5b')]['body']===''){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf652('0x94')](_0x4b25d7['body']['to'])){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('to\x20is\x20mandatory');}_0x43fed3=_0x4b25d7[_0xf652('0x5b')]['to'];return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x4b25d7[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x9a')],'as':_0xf652('0xc1'),'include':[{'model':db[_0xf652('0x77')],'as':_0xf652('0x9b'),'where':{'mobile':_0x43fed3},'limit':0x1,'order':[['updatedAt',_0xf652('0x9d')]]}]}]})[_0xf652('0x20')](handleEntityNotFound(_0x3896af,null))[_0xf652('0x20')](function(_0x68c4ee){if(_0x68c4ee&&_0x68c4ee[_0xf652('0xc1')]){_0x4832f3=_0x68c4ee[_0xf652('0x37')]({'plain':!![]});if(_0x4832f3['List']&&_0x4832f3['List'][_0xf652('0x9b')]['length']){return _0x4832f3[_0xf652('0xc1')][_0xf652('0x9b')][0x0];}return db['CmContact'][_0xf652('0x5a')](_['defaults'](_0x4b25d7['body'],{'firstName':_0x43fed3,'mobile':_0x43fed3,'phone':_0x43fed3,'ListId':_0x4832f3[_0xf652('0x7e')]}));}})['then'](handleEntityNotFound(_0x3896af,null))[_0xf652('0x20')](function(_0x5de004){if(_0x5de004){_0xef4b80=_0x5de004;return db[_0xf652('0x9f')][_0xf652('0x59')]({'where':{'ContactId':_0xef4b80['id'],'closed':![],'SmsAccountId':_0x4832f3['id']}})['then'](function(_0x278476){if(_0x278476){return[_0x278476,![]];}return db[_0xf652('0x9f')]['create']({'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id'],'SmsAccountId':_0x4832f3['id'],'phone':_0x43fed3,'firstMsgDirection':'out','Messages':[_['merge'](_0x4b25d7[_0xf652('0x5b')],{'read':![],'body':_0x4b25d7[_0xf652('0x5b')][_0xf652('0x5b')],'phone':_0x43fed3,'SmsAccountId':_0x4832f3['id'],'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id']})]},{'include':[{'model':db[_0xf652('0xa6')],'as':_0xf652('0xc2')}]})[_0xf652('0x20')](function(_0x1f4fbc){return[_0x1f4fbc,!![]];});});}})[_0xf652('0xa0')](function(_0x4fc023,_0x81a1b3){if(_0x81a1b3){return _0x4fc023;}return db['SmsMessage']['create'](_['merge'](_0x4b25d7[_0xf652('0x5b')],{'read':![],'body':_0x4b25d7['body'][_0xf652('0x5b')],'phone':_0x43fed3,'SmsAccountId':_0x4832f3['id'],'SmsInteractionId':_0x4fc023['id'],'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id']}))[_0xf652('0x20')](function(_0x5ec18b){_0x4fc023[_0xf652('0xc3')][_0xf652('0xc2')]=[];_0x4fc023[_0xf652('0xc3')]['Messages']['push'](_0x5ec18b[_0xf652('0xc3')]);return _0x4fc023;});})[_0xf652('0x20')](respondWithResult(_0x3896af,null))[_0xf652('0x28')](handleError(_0x3896af,null));};exports[_0xf652('0x2a')]=function(_0x4802c0,_0x2be6f8,_0x1ac163){if(_0x4802c0[_0xf652('0x5b')]['id']){delete _0x4802c0[_0xf652('0x5b')]['id'];}var _0x2b4f05,_0x3d4481,_0x2864bd;return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x4802c0['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x2be6f8,null))[_0xf652('0x20')](function(_0x133b90){if(_0x133b90){_0x2864bd=_0x133b90;logger[_0xf652('0xb1')](_0xf652('0x23'),'status',_0xf652('0xc4'),_0x133b90[_0xf652('0x4f')],util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));switch(_0x133b90[_0xf652('0x4f')]){case _0xf652('0x85'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0xc6')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0['body'][_0xf652('0x2a')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0xc6')]}});}break;case _0xf652('0x88'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0xc7')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0xc8')]){_0x3d4481=_0x4802c0['body'][_0xf652('0xc8')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0xc7')]}});}break;case _0xf652('0xc9'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0x89')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0xca')]){_0x3d4481=_0x4802c0['body']['status_code'];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0x89')]}});}break;case'infobip':var _0x553da6=_0x4802c0[_0xf652('0x5b')][_0xf652('0x8d')][0x0];if(_0x553da6['messageId']&&_0x553da6['status'][_0xf652('0xcb')]===_0xf652('0xcc')){_0x3d4481=_0x553da6[_0xf652('0x2a')][_0xf652('0xcb')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x553da6[_0xf652('0x84')]}});}break;case _0xf652('0x90'):if(_0x4802c0['body'][_0xf652('0x84')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0['body']['status'];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][_0xf652('0x84')]}});}break;case'bandwidth':if(_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id']){_0x3d4481=_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x4f')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id']}});}break;case _0xf652('0xcd'):if(_0x4802c0['body']['redif']&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][_0xf652('0xce')]}});}break;}}})[_0xf652('0x20')](handleEntityNotFound(_0x2be6f8,null))[_0xf652('0x20')](function(_0x50c8ed){if(_0x50c8ed){_0x2b4f05=_0x50c8ed;switch(_0x2864bd[_0xf652('0x4f')]){case _0xf652('0x85'):if(_0x3d4481===_0xf652('0xcc')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util['inspect'](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0x88'):if(_0x3d4481==='1'){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf652('0x2a'),'skebby',util['inspect'](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0xc9'):if(!_0x4802c0['body'][_0xf652('0xcf')]&&_0x3d4481>=0xc8&&_0x3d4481<=0xce){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf652('0x2a'),'clicksend',util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3875e1=_0x4802c0[_0xf652('0x5b')][_0xf652('0x8d')][0x0];if(_0x3875e1[_0xf652('0x2a')][_0xf652('0xcb')]===_0xf652('0xcc')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x8c'),util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0x90'):if(_0x3d4481=='DELIVERED_TO_GATEWAY'||_0x3d4481==_0xf652('0xd0')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x90'),util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));}break;case _0xf652('0x92'):if(_0x3d4481==_0xf652('0xd1')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x92'),util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0xcd'):if(_0x3d4481===_0xf652('0xd2')||_0x3d4481==='ACCEPTD'){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0xcd'),util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));}break;}return _0x2b4f05;}})[_0xf652('0x20')](respondWithResult(_0x2be6f8,null))[_0xf652('0x28')](handleError(_0x2be6f8,null));};exports[_0xf652('0xd3')]=function(_0x141b0d,_0x3d3470,_0x343084){var _0x2427f8,_0x2e3f74,_0x1b5232;return db['SmsAccount'][_0xf652('0x59')]({'where':{'id':_0x141b0d[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d3470,null))[_0xf652('0x20')](function(_0x450738){if(_0x450738){_0x1b5232=_0x450738;logger[_0xf652('0xb1')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0xc4'),_0x450738[_0xf652('0x4f')],util[_0xf652('0xc5')](_0x141b0d[_0xf652('0x45')],{'showHidden':![],'depth':null}));switch(_0x450738[_0xf652('0x4f')]){case'csc':if(_0x141b0d[_0xf652('0x45')]['message-id']&&_0x141b0d['query'][_0xf652('0xd4')]){_0x2e3f74=_0x141b0d['query'][_0xf652('0xd4')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x141b0d[_0xf652('0x45')][_0xf652('0xd5')]}});}break;}}})[_0xf652('0x20')](handleEntityNotFound(_0x3d3470,null))[_0xf652('0x20')](function(_0x2524f9){if(_0x2524f9){_0x2427f8=_0x2524f9;switch(_0x1b5232['type']){case'csc':if(_0x2e3f74==='2'||_0x2e3f74==='6'){return _0x2427f8[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x8e'),util['inspect'](_0x141b0d[_0xf652('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x2427f8;}})['then'](respondWithResult(_0x3d3470,null))['catch'](handleError(_0x3d3470,null));};exports['addAgents']=function(_0x10eac2,_0x3494f,_0x11230b){return db[_0xf652('0x41')]['find']({'where':{'id':_0x10eac2[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3494f,null))[_0xf652('0x20')](function(_0x46c63e){if(_0x46c63e){return _0x46c63e[_0xf652('0xd6')](_0x10eac2[_0xf652('0x5b')][_0xf652('0x6d')],_[_0xf652('0x9e')](_0x10eac2['body'],[_0xf652('0x6d'),'id'])||{})[_0xf652('0xa0')](function(_0x168187){for(var _0x4d8dad=0x0;_0x4d8dad<_0x10eac2[_0xf652('0x5b')][_0xf652('0x6d')]['length'];_0x4d8dad+=0x1){socket['emit'](_0xf652('0xd7'),{'UserId':Number(_0x10eac2[_0xf652('0x5b')]['ids'][_0x4d8dad]),'SmsAccountId':Number(_0x10eac2[_0xf652('0x54')]['id'])});}return _0x168187;});}})[_0xf652('0x20')](respondWithResult(_0x3494f,null))[_0xf652('0x28')](handleError(_0x3494f,null));};exports['removeAgents']=function(_0x5acc64,_0x56db32,_0x1d5b2f){return db[_0xf652('0x41')]['find']({'where':{'id':_0x5acc64[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x56db32,null))[_0xf652('0x20')](function(_0x27348e){if(_0x27348e){return _0x27348e[_0xf652('0xd8')](_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')])[_0xf652('0x20')](function(){if(_[_0xf652('0xd9')](_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')])){for(var _0x24b926=0x0;_0x24b926<_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')][_0xf652('0x4a')];_0x24b926+=0x1){socket[_0xf652('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x5acc64['query'][_0xf652('0x6d')][_0x24b926]),'SmsAccountId':Number(_0x5acc64['params']['id'])});}}else{socket[_0xf652('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x5acc64[_0xf652('0x45')]['ids']),'SmsAccountId':Number(_0x5acc64[_0xf652('0x54')]['id'])});}});}})[_0xf652('0x20')](respondWithStatusCode(_0x56db32,null))[_0xf652('0x28')](handleError(_0x56db32,null));};exports[_0xf652('0xdb')]=function(_0x3af8b7,_0x3db549,_0x3b8798){var _0x4da8b3={};var _0x37418b={};var _0x176ccc;var _0x13b37e;return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x3af8b7[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3db549,null))[_0xf652('0x20')](function(_0x2e6a21){if(_0x2e6a21){_0x176ccc=_0x2e6a21;_0x37418b[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0xba')][_0xf652('0x56')]);_0x37418b[_0xf652('0x45')]=_['keys'](_0x3af8b7[_0xf652('0x45')]);_0x37418b[_0xf652('0x46')]=_['intersection'](_0x37418b[_0xf652('0x44')],_0x37418b['query']);_0x4da8b3[_0xf652('0x48')]=_['intersection'](_0x37418b[_0xf652('0x44')],qs[_0xf652('0x49')](_0x3af8b7[_0xf652('0x45')][_0xf652('0x49')]));_0x4da8b3[_0xf652('0x48')]=_0x4da8b3[_0xf652('0x48')][_0xf652('0x4a')]?_0x4da8b3['attributes']:_0x37418b[_0xf652('0x44')];_0x4da8b3[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x3af8b7[_0xf652('0x45')]['sort']);_0x4da8b3['where']=qs['filters'](_[_0xf652('0x6a')](_0x3af8b7['query'],_0x37418b[_0xf652('0x46')]));if(_0x3af8b7[_0xf652('0x45')]['filter']){_0x4da8b3[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x4da8b3['where'],{'$or':_[_0xf652('0x40')](_0x4da8b3[_0xf652('0x48')],function(_0x35d28b){var _0x1ec7ca={};_0x1ec7ca[_0x35d28b]={'$like':'%'+_0x3af8b7[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1ec7ca;})});}_0x4da8b3=_['merge']({},_0x4da8b3,_0x3af8b7[_0xf652('0x58')]);return _0x176ccc[_0xf652('0xdb')](_0x4da8b3);}})['then'](function(_0x42e572){if(_0x42e572){_0x13b37e=_0x42e572[_0xf652('0x4a')];if(!_0x3af8b7[_0xf652('0x45')]['hasOwnProperty'](_0xf652('0x4b'))){_0x4da8b3[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x3af8b7[_0xf652('0x45')]['limit']);_0x4da8b3[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x3af8b7[_0xf652('0x45')]['offset']);}return _0x176ccc[_0xf652('0xdb')](_0x4da8b3);}})[_0xf652('0x20')](function(_0x5c32f5){if(_0x5c32f5){return _0x5c32f5?{'count':_0x13b37e,'rows':_0x5c32f5}:null;}})[_0xf652('0x20')](respondWithResult(_0x3db549,null))[_0xf652('0x28')](handleError(_0x3db549,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 656aaa3..61f86fe 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 _0x79d7=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x418cfc,_0x51c32f){var _0x5140fa=function(_0x21de68){while(--_0x21de68){_0x418cfc['push'](_0x418cfc['shift']());}};_0x5140fa(++_0x51c32f);}(_0x79d7,0x18c));var _0x779d=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x79d7[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x779d('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x779d('0x1'),'afterUpdate':_0x779d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x41aed6){return function(_0x520cbf,_0x4283fd,_0x42b4d7){SmsAccountEvents[_0x779d('0x3')](_0x41aed6+':'+_0x520cbf['id'],_0x520cbf);SmsAccountEvents['emit'](_0x41aed6,_0x520cbf);_0x42b4d7(null);};}for(var e in events){if(events[_0x779d('0x4')](e)){var event=events[e];SmsAccount[_0x779d('0x5')](e,emitEvent(event));}}module[_0x779d('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0xa861=['events','SmsAccount','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xa861,0xa8));var _0x1a86=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xa861[_0x31a938];return _0x1bf341;};'use strict';var EventEmitter=require(_0x1a86('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x1a86('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a86('0x2'),'afterUpdate':_0x1a86('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2cf4f6){return function(_0x21cce8,_0x3491ec,_0x4a3b3b){SmsAccountEvents[_0x1a86('0x4')](_0x2cf4f6+':'+_0x21cce8['id'],_0x21cce8);SmsAccountEvents['emit'](_0x2cf4f6,_0x21cce8);_0x4a3b3b(null);};}for(var e in events){if(events[_0x1a86('0x5')](e)){var event=events[e];SmsAccount[_0x1a86('0x6')](e,emitEvent(event));}}module[_0x1a86('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 1daa240..1d0f833 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 _0x9f37=['rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','request-promise'];(function(_0x24abef,_0x516031){var _0x4352b1=function(_0x46457d){while(--_0x46457d){_0x24abef['push'](_0x24abef['shift']());}};_0x4352b1(++_0x516031);}(_0x9f37,0xb6));var _0x79f3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9f37[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require(_0x79f3('0x2'))('api');var moment=require(_0x79f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x79f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x1ca94e,_0x4ee7f1){return _0x1ca94e[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e36=['bluebird','request-promise','rimraf','exports','SmsAccount','lodash','util','../../config/logger','api','moment'];(function(_0x2e5a33,_0x2e768c){var _0x1f5221=function(_0x29f9df){while(--_0x29f9df){_0x2e5a33['push'](_0x2e5a33['shift']());}};_0x1f5221(++_0x2e768c);}(_0x6e36,0xeb));var _0x66e3=function(_0x217f30,_0x214ec2){_0x217f30=_0x217f30-0x0;var _0x551715=_0x6e36[_0x217f30];return _0x551715;};'use strict';var _=require(_0x66e3('0x0'));var util=require(_0x66e3('0x1'));var logger=require(_0x66e3('0x2'))(_0x66e3('0x3'));var moment=require(_0x66e3('0x4'));var BPromise=require(_0x66e3('0x5'));var rp=require(_0x66e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66e3('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x66e3('0x8')]=function(_0x3d1465,_0x45698c){return _0x3d1465['define'](_0x66e3('0x9'),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 800da6c..16e4ef4 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 _0x318b=['debug','error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x18be13,_0x346167){var _0x123dc8=function(_0x2f8436){while(--_0x2f8436){_0x18be13['push'](_0x18be13['shift']());}};_0x123dc8(++_0x346167);}(_0x318b,0x10e));var _0xb318=function(_0x2bf8f2,_0x27c758){_0x2bf8f2=_0x2bf8f2-0x0;var _0x1ba2fa=_0x318b[_0x2bf8f2];return _0x1ba2fa;};'use strict';var _=require(_0xb318('0x0'));var util=require(_0xb318('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb318('0x2'));var fs=require('fs');var Redis=require(_0xb318('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb318('0x4'));var logger=require('../../config/logger')(_0xb318('0x5'));var config=require(_0xb318('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb318('0x7')][_0xb318('0x8')]({'port':0x232a});config[_0xb318('0x9')]=_[_0xb318('0xa')](config[_0xb318('0x9')],{'host':_0xb318('0xb'),'port':0x18eb});var socket=require(_0xb318('0xc'))(new Redis(config[_0xb318('0x9')]));require(_0xb318('0xd'))['register'](socket);function respondWithRpcPromise(_0x410757,_0xaa652,_0x416dd4){return new BPromise(function(_0x5f2a42,_0x44ea6f){return client['request'](_0x410757,_0x416dd4)[_0xb318('0xe')](function(_0x22af09){logger[_0xb318('0xf')](_0xb318('0x10'),_0xaa652,_0xb318('0x11'));logger[_0xb318('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa652,_0xb318('0x11'),JSON['stringify'](_0x22af09));if(_0x22af09[_0xb318('0x13')]){if(_0x22af09['error'][_0xb318('0x14')]===0x1f4){logger['error'](_0xb318('0x10'),_0xaa652,_0x22af09[_0xb318('0x13')][_0xb318('0x15')]);return _0x44ea6f(_0x22af09[_0xb318('0x13')][_0xb318('0x15')]);}logger[_0xb318('0x13')](_0xb318('0x10'),_0xaa652,_0x22af09['error'][_0xb318('0x15')]);return _0x5f2a42(_0x22af09['error']['message']);}else{logger['info'](_0xb318('0x10'),_0xaa652,_0xb318('0x11'));_0x5f2a42(_0x22af09['result'][_0xb318('0x15')]);}})['catch'](function(_0x45c4a8){logger['error'](_0xb318('0x10'),_0xaa652,_0x45c4a8);_0x44ea6f(_0x45c4a8);});});}exports[_0xb318('0x16')]=function(_0x5d9c50){var _0x215a96=this;return new Promise(function(_0x261212,_0x341109){return db[_0xb318('0x17')][_0xb318('0x18')]({'raw':_0x5d9c50[_0xb318('0x19')]?_0x5d9c50['options'][_0xb318('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d9c50['options']?_0x5d9c50[_0xb318('0x19')][_0xb318('0x1b')]||null:null,'attributes':_0x5d9c50[_0xb318('0x19')]?_0x5d9c50['options'][_0xb318('0x1c')]||null:null,'include':_0x5d9c50[_0xb318('0x19')]?_0x5d9c50[_0xb318('0x19')][_0xb318('0x1d')]?_[_0xb318('0x1e')](_0x5d9c50['options'][_0xb318('0x1d')],function(_0x5b68b3){return{'model':db[_0x5b68b3['model']],'as':_0x5b68b3['as'],'attributes':_0x5b68b3[_0xb318('0x1c')],'include':_0x5b68b3['include']?_[_0xb318('0x1e')](_0x5b68b3[_0xb318('0x1d')],function(_0xb4255c){return{'model':db[_0xb4255c[_0xb318('0x1f')]],'as':_0xb4255c['as'],'attributes':_0xb4255c[_0xb318('0x1c')],'include':_0xb4255c[_0xb318('0x1d')]?_[_0xb318('0x1e')](_0xb4255c['include'],function(_0xbb6e44){return{'model':db[_0xbb6e44[_0xb318('0x1f')]],'as':_0xbb6e44['as'],'attributes':_0xbb6e44[_0xb318('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb318('0xe')](function(_0x1b1b67){logger['info']('ShowSmsAccount',_0x5d9c50);logger[_0xb318('0x12')]('ShowSmsAccount',_0x5d9c50,JSON['stringify'](_0x1b1b67));_0x261212(_0x1b1b67);})['catch'](function(_0x399230){logger['error'](_0xb318('0x16'),_0x399230[_0xb318('0x15')],_0x5d9c50);_0x341109(_0x215a96['error'](0x1f4,_0x399230[_0xb318('0x15')]));});});}; \ No newline at end of file +var _0xe71a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','model','attributes','map','util','moment','bluebird','randomstring'];(function(_0x2170e3,_0x39d8c4){var _0x4b1363=function(_0x1dd4c1){while(--_0x1dd4c1){_0x2170e3['push'](_0x2170e3['shift']());}};_0x4b1363(++_0x39d8c4);}(_0xe71a,0xf1));var _0xae71=function(_0x552e90,_0x55534a){_0x552e90=_0x552e90-0x0;var _0x151c86=_0xe71a[_0x552e90];return _0x151c86;};'use strict';var _=require('lodash');var util=require(_0xae71('0x0'));var moment=require(_0xae71('0x1'));var BPromise=require(_0xae71('0x2'));var rs=require(_0xae71('0x3'));var fs=require('fs');var Redis=require(_0xae71('0x4'));var db=require(_0xae71('0x5'))['db'];var utils=require(_0xae71('0x6'));var logger=require(_0xae71('0x7'))('rpc');var config=require(_0xae71('0x8'));var jayson=require(_0xae71('0x9'));var client=jayson[_0xae71('0xa')][_0xae71('0xb')]({'port':0x232a});config[_0xae71('0xc')]=_[_0xae71('0xd')](config[_0xae71('0xc')],{'host':_0xae71('0xe'),'port':0x18eb});var socket=require(_0xae71('0xf'))(new Redis(config[_0xae71('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x5e3a04,_0x324fcf,_0x1e65cc){return new BPromise(function(_0x29bc08,_0x48baff){return client['request'](_0x5e3a04,_0x1e65cc)[_0xae71('0x10')](function(_0x115bd7){logger[_0xae71('0x11')]('SmsAccount,\x20%s,\x20%s',_0x324fcf,_0xae71('0x12'));logger[_0xae71('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x324fcf,_0xae71('0x12'),JSON[_0xae71('0x14')](_0x115bd7));if(_0x115bd7['error']){if(_0x115bd7['error']['code']===0x1f4){logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x115bd7[_0xae71('0x15')][_0xae71('0x17')]);return _0x48baff(_0x115bd7['error'][_0xae71('0x17')]);}logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x115bd7[_0xae71('0x15')][_0xae71('0x17')]);return _0x29bc08(_0x115bd7[_0xae71('0x15')]['message']);}else{logger[_0xae71('0x11')](_0xae71('0x16'),_0x324fcf,_0xae71('0x12'));_0x29bc08(_0x115bd7['result'][_0xae71('0x17')]);}})[_0xae71('0x18')](function(_0x4d7380){logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x4d7380);_0x48baff(_0x4d7380);});});}exports[_0xae71('0x19')]=function(_0x29314e){var _0x3d4559=this;return new Promise(function(_0x89cf84,_0x3cba90){return db[_0xae71('0x1a')][_0xae71('0x1b')]({'raw':_0x29314e['options']?_0x29314e[_0xae71('0x1c')][_0xae71('0x1d')]===undefined?!![]:![]:!![],'where':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')][_0xae71('0x1e')]||null:null,'attributes':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')]['attributes']||null:null,'include':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')]['include']?_['map'](_0x29314e[_0xae71('0x1c')][_0xae71('0x1f')],function(_0x3c8579){return{'model':db[_0x3c8579[_0xae71('0x20')]],'as':_0x3c8579['as'],'attributes':_0x3c8579[_0xae71('0x21')],'include':_0x3c8579[_0xae71('0x1f')]?_[_0xae71('0x22')](_0x3c8579[_0xae71('0x1f')],function(_0x1e3279){return{'model':db[_0x1e3279[_0xae71('0x20')]],'as':_0x1e3279['as'],'attributes':_0x1e3279['attributes'],'include':_0x1e3279['include']?_[_0xae71('0x22')](_0x1e3279['include'],function(_0x409135){return{'model':db[_0x409135[_0xae71('0x20')]],'as':_0x409135['as'],'attributes':_0x409135[_0xae71('0x21')]};}):[]};}):[]};}):[]:[]})[_0xae71('0x10')](function(_0x47549e){logger[_0xae71('0x11')](_0xae71('0x19'),_0x29314e);logger[_0xae71('0x13')](_0xae71('0x19'),_0x29314e,JSON[_0xae71('0x14')](_0x47549e));_0x89cf84(_0x47549e);})[_0xae71('0x18')](function(_0x58da19){logger[_0xae71('0x15')](_0xae71('0x19'),_0x58da19[_0xae71('0x17')],_0x29314e);_0x3cba90(_0x3d4559['error'](0x1f4,_0x58da19[_0xae71('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 800497b..f4d8032 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 83596ea..4e73372 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 _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(_0x30a2bb,_0x54f4b4){var _0x202654=function(_0x199202){while(--_0x199202){_0x30a2bb['push'](_0x30a2bb['shift']());}};_0x202654(++_0x54f4b4);}(_0xedd9,0xfc));var _0x9edd=function(_0x27a900,_0x1cc305){_0x27a900=_0x27a900-0x0;var _0xea9b1f=_0xedd9[_0x27a900];return _0xea9b1f;};'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 +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1fd5c3,_0x101259){var _0x5666a2=function(_0x2299b5){while(--_0x2299b5){_0x1fd5c3['push'](_0x1fd5c3['shift']());}};_0x5666a2(++_0x101259);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9aa2a94..3bf84ca 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 _0xef9e=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xef9e,0xf7));var _0xeef9=function(_0x475a97,_0x140c42){_0x475a97=_0x475a97-0x0;var _0x346351=_0xef9e[_0x475a97];return _0x346351;};'use strict';var Sequelize=require('sequelize');module[_0xeef9('0x0')]={'priority':{'type':Sequelize[_0xeef9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xeef9('0x2')],'allowNull':![],'defaultValue':_0xeef9('0x3')},'appdata':{'type':Sequelize[_0xeef9('0x4')]()},'description':{'type':Sequelize[_0xeef9('0x2')]},'interval':{'type':Sequelize[_0xeef9('0x2')],'defaultValue':_0xeef9('0x5')}}; \ No newline at end of file +var _0x139c=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x478225,_0x1fc818){var _0x42116c=function(_0x409b9e){while(--_0x409b9e){_0x478225['push'](_0x478225['shift']());}};_0x42116c(++_0x1fc818);}(_0x139c,0x11b));var _0xc139=function(_0x5dee7f,_0x41f933){_0x5dee7f=_0x5dee7f-0x0;var _0x12f9eb=_0x139c[_0x5dee7f];return _0x12f9eb;};'use strict';var Sequelize=require('sequelize');module[_0xc139('0x0')]={'priority':{'type':Sequelize[_0xc139('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc139('0x2')],'allowNull':![],'defaultValue':_0xc139('0x3')},'appdata':{'type':Sequelize[_0xc139('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc139('0x2')],'defaultValue':_0xc139('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 3415e58..ac6203e 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 _0xfeae=['reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','length','find','catch','body','params','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','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x6376e8,_0x55c8d0){var _0x5e1094=function(_0x7c0194){while(--_0x7c0194){_0x6376e8['push'](_0x6376e8['shift']());}};_0x5e1094(++_0x55c8d0);}(_0xfeae,0x19e));var _0xefea=function(_0x103446,_0xee6de9){_0x103446=_0x103446-0x0;var _0x3fda82=_0xfeae[_0x103446];return _0x3fda82;};'use strict';var emlformat=require(_0xefea('0x0'));var rimraf=require(_0xefea('0x1'));var zipdir=require(_0xefea('0x2'));var jsonpatch=require(_0xefea('0x3'));var rp=require(_0xefea('0x4'));var moment=require(_0xefea('0x5'));var BPromise=require(_0xefea('0x6'));var Mustache=require(_0xefea('0x7'));var util=require(_0xefea('0x8'));var path=require(_0xefea('0x9'));var sox=require(_0xefea('0xa'));var csv=require(_0xefea('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefea('0xc'));var _=require(_0xefea('0xd'));var squel=require(_0xefea('0xe'));var crypto=require(_0xefea('0xf'));var jsforce=require(_0xefea('0x10'));var deskjs=require(_0xefea('0x11'));var toCsv=require(_0xefea('0xb'));var querystring=require(_0xefea('0x12'));var Papa=require(_0xefea('0x13'));var Redis=require(_0xefea('0x14'));var authService=require(_0xefea('0x15'));var qs=require(_0xefea('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefea('0x17'));var logger=require(_0xefea('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xefea('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xefea('0x1a'))['db'];function respondWithStatusCode(_0x44044d,_0x2b3ce7){_0x2b3ce7=_0x2b3ce7||0xcc;return function(_0x57f749){if(_0x57f749){return _0x44044d[_0xefea('0x1b')](_0x2b3ce7);}return _0x44044d[_0xefea('0x1c')](_0x2b3ce7)[_0xefea('0x1d')]();};}function respondWithResult(_0x5f0546,_0x51452c){_0x51452c=_0x51452c||0xc8;return function(_0x4c1fde){if(_0x4c1fde){return _0x5f0546[_0xefea('0x1c')](_0x51452c)[_0xefea('0x1e')](_0x4c1fde);}};}function respondWithFilteredResult(_0x14cfab,_0x11c333){return function(_0xe3c57b){if(_0xe3c57b){var _0x52f80f=typeof _0x11c333[_0xefea('0x1f')]==='undefined'&&typeof _0x11c333[_0xefea('0x20')]===_0xefea('0x21');var _0x495d69=_0xe3c57b[_0xefea('0x22')];var _0x1d6b9c=_0x52f80f?0x0:_0x11c333[_0xefea('0x1f')];var _0xe2323c=_0x52f80f?_0xe3c57b[_0xefea('0x22')]:_0x11c333[_0xefea('0x1f')]+_0x11c333[_0xefea('0x20')];var _0x49061c;if(_0xe2323c>=_0x495d69){_0xe2323c=_0x495d69;_0x49061c=0xc8;}else{_0x49061c=0xce;}_0x14cfab['status'](_0x49061c);return _0x14cfab['set'](_0xefea('0x23'),_0x1d6b9c+'-'+_0xe2323c+'/'+_0x495d69)[_0xefea('0x1e')](_0xe3c57b);}return null;};}function patchUpdates(_0x11d4aa){return function(_0xa635e0){try{jsonpatch['apply'](_0xa635e0,_0x11d4aa,!![]);}catch(_0x61930a){return BPromise[_0xefea('0x24')](_0x61930a);}return _0xa635e0['save']();};}function saveUpdates(_0x30898f,_0x2d05df){return function(_0x4b0643){if(_0x4b0643){return _0x4b0643[_0xefea('0x25')](_0x30898f)[_0xefea('0x26')](function(_0x52f376){return _0x52f376;});}return null;};}function removeEntity(_0x23a6ce,_0x5224f6){return function(_0x53cbe3){if(_0x53cbe3){return _0x53cbe3[_0xefea('0x27')]()[_0xefea('0x26')](function(){_0x23a6ce[_0xefea('0x1c')](0xcc)[_0xefea('0x1d')]();});}};}function handleEntityNotFound(_0x3ebab3,_0x347833){return function(_0x39268f){if(!_0x39268f){_0x3ebab3[_0xefea('0x1b')](0x194);}return _0x39268f;};}function handleError(_0x249d89,_0x4fc572){_0x4fc572=_0x4fc572||0x1f4;return function(_0x413688){logger[_0xefea('0x28')](_0x413688[_0xefea('0x29')]);if(_0x413688[_0xefea('0x2a')]){delete _0x413688[_0xefea('0x2a')];}_0x249d89['status'](_0x4fc572)[_0xefea('0x2b')](_0x413688);};}exports[_0xefea('0x2c')]=function(_0x2ae5b4,_0xc22d17){var _0x45ee95={},_0x3869d1={},_0x418810={'count':0x0,'rows':[]};var _0x5d1903=_[_0xefea('0x2d')](db[_0xefea('0x2e')][_0xefea('0x2f')],function(_0x47ab2d){return{'name':_0x47ab2d[_0xefea('0x30')],'type':_0x47ab2d[_0xefea('0x31')][_0xefea('0x32')]};});_0x3869d1['model']=_[_0xefea('0x2d')](_0x5d1903,_0xefea('0x2a'));_0x3869d1[_0xefea('0x33')]=_[_0xefea('0x34')](_0x2ae5b4['query']);_0x3869d1[_0xefea('0x35')]=_[_0xefea('0x36')](_0x3869d1[_0xefea('0x37')],_0x3869d1['query']);_0x45ee95[_0xefea('0x38')]=_['intersection'](_0x3869d1[_0xefea('0x37')],qs[_0xefea('0x39')](_0x2ae5b4['query'][_0xefea('0x39')]));_0x45ee95['attributes']=_0x45ee95[_0xefea('0x38')]['length']?_0x45ee95['attributes']:_0x3869d1[_0xefea('0x37')];if(!_0x2ae5b4[_0xefea('0x33')][_0xefea('0x3a')](_0xefea('0x3b'))){_0x45ee95[_0xefea('0x20')]=qs[_0xefea('0x20')](_0x2ae5b4['query'][_0xefea('0x20')]);_0x45ee95[_0xefea('0x1f')]=qs[_0xefea('0x1f')](_0x2ae5b4['query']['offset']);}_0x45ee95['order']=qs[_0xefea('0x3c')](_0x2ae5b4[_0xefea('0x33')][_0xefea('0x3c')]);_0x45ee95[_0xefea('0x3d')]=qs[_0xefea('0x35')](_['pick'](_0x2ae5b4['query'],_0x3869d1['filters']),_0x5d1903);if(_0x2ae5b4[_0xefea('0x33')][_0xefea('0x3e')]){_0x45ee95[_0xefea('0x3d')]=_['merge'](_0x45ee95[_0xefea('0x3d')],{'$or':_['map'](_0x5d1903,function(_0x5ed399){if(_0x5ed399[_0xefea('0x31')]!==_0xefea('0x3f')){var _0x59a9d6={};_0x59a9d6[_0x5ed399['name']]={'$like':'%'+_0x2ae5b4[_0xefea('0x33')][_0xefea('0x3e')]+'%'};return _0x59a9d6;}})});}_0x45ee95=_[_0xefea('0x40')]({},_0x45ee95,_0x2ae5b4[_0xefea('0x41')]);var _0x2f0192={'where':_0x45ee95[_0xefea('0x3d')]};return db['SmsApplication']['count'](_0x2f0192)[_0xefea('0x26')](function(_0x1f399b){_0x418810[_0xefea('0x22')]=_0x1f399b;if(_0x2ae5b4['query'][_0xefea('0x42')]){_0x45ee95[_0xefea('0x43')]=[{'all':!![]}];}return db[_0xefea('0x2e')][_0xefea('0x44')](_0x45ee95);})['then'](function(_0xc82b69){_0x418810['rows']=_0xc82b69;return _0x418810;})[_0xefea('0x26')](respondWithFilteredResult(_0xc22d17,_0x45ee95))['catch'](handleError(_0xc22d17,null));};exports[_0xefea('0x45')]=function(_0x44a9c9,_0x78cfc){var _0x119d6b={'raw':!![],'where':{'id':_0x44a9c9['params']['id']}},_0xad292={};_0xad292['model']=_[_0xefea('0x34')](db[_0xefea('0x2e')][_0xefea('0x2f')]);_0xad292[_0xefea('0x33')]=_[_0xefea('0x34')](_0x44a9c9[_0xefea('0x33')]);_0xad292[_0xefea('0x35')]=_[_0xefea('0x36')](_0xad292[_0xefea('0x37')],_0xad292['query']);_0x119d6b[_0xefea('0x38')]=_[_0xefea('0x36')](_0xad292[_0xefea('0x37')],qs[_0xefea('0x39')](_0x44a9c9['query']['fields']));_0x119d6b['attributes']=_0x119d6b[_0xefea('0x38')][_0xefea('0x46')]?_0x119d6b[_0xefea('0x38')]:_0xad292[_0xefea('0x37')];if(_0x44a9c9[_0xefea('0x33')][_0xefea('0x42')]){_0x119d6b[_0xefea('0x43')]=[{'all':!![]}];}_0x119d6b=_[_0xefea('0x40')]({},_0x119d6b,_0x44a9c9['options']);return db[_0xefea('0x2e')][_0xefea('0x47')](_0x119d6b)['then'](handleEntityNotFound(_0x78cfc,null))[_0xefea('0x26')](respondWithResult(_0x78cfc,null))[_0xefea('0x48')](handleError(_0x78cfc,null));};exports['create']=function(_0x55fbe3,_0xa4f216){return db['SmsApplication']['create'](_0x55fbe3[_0xefea('0x49')],{})[_0xefea('0x26')](respondWithResult(_0xa4f216,0xc9))[_0xefea('0x48')](handleError(_0xa4f216,null));};exports[_0xefea('0x25')]=function(_0x162a86,_0x5d992e){if(_0x162a86['body']['id']){delete _0x162a86[_0xefea('0x49')]['id'];}return db[_0xefea('0x2e')][_0xefea('0x47')]({'where':{'id':_0x162a86[_0xefea('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d992e,null))[_0xefea('0x26')](saveUpdates(_0x162a86[_0xefea('0x49')],null))[_0xefea('0x26')](respondWithResult(_0x5d992e,null))[_0xefea('0x48')](handleError(_0x5d992e,null));};exports['destroy']=function(_0x2498c1,_0x508b17){return db[_0xefea('0x2e')][_0xefea('0x47')]({'where':{'id':_0x2498c1[_0xefea('0x4a')]['id']}})[_0xefea('0x26')](handleEntityNotFound(_0x508b17,null))['then'](removeEntity(_0x508b17,null))[_0xefea('0x48')](handleError(_0x508b17,null));}; \ No newline at end of file +var _0xd2a7=['SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','sendStatus','error','stack','name','map'];(function(_0x1ac41c,_0x1dacbf){var _0x561d64=function(_0x2654df){while(--_0x2654df){_0x1ac41c['push'](_0x1ac41c['shift']());}};_0x561d64(++_0x1dacbf);}(_0xd2a7,0x14d));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d2a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d2a('0x1'));var moment=require(_0x7d2a('0x2'));var BPromise=require(_0x7d2a('0x3'));var Mustache=require('mustache');var util=require(_0x7d2a('0x4'));var path=require(_0x7d2a('0x5'));var sox=require(_0x7d2a('0x6'));var csv=require(_0x7d2a('0x7'));var ejs=require(_0x7d2a('0x8'));var fs=require('fs');var fs_extra=require(_0x7d2a('0x9'));var _=require(_0x7d2a('0xa'));var squel=require(_0x7d2a('0xb'));var crypto=require(_0x7d2a('0xc'));var jsforce=require(_0x7d2a('0xd'));var deskjs=require(_0x7d2a('0xe'));var toCsv=require(_0x7d2a('0x7'));var querystring=require(_0x7d2a('0xf'));var Papa=require(_0x7d2a('0x10'));var Redis=require(_0x7d2a('0x11'));var authService=require(_0x7d2a('0x12'));var qs=require(_0x7d2a('0x13'));var as=require(_0x7d2a('0x14'));var hardwareService=require(_0x7d2a('0x15'));var logger=require(_0x7d2a('0x16'))('api');var utils=require(_0x7d2a('0x17'));var config=require(_0x7d2a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd0da,_0x2c1457){_0x2c1457=_0x2c1457||0xcc;return function(_0x18b0bf){if(_0x18b0bf){return _0x5dd0da['sendStatus'](_0x2c1457);}return _0x5dd0da['status'](_0x2c1457)[_0x7d2a('0x19')]();};}function respondWithResult(_0x54a589,_0x5da6a8){_0x5da6a8=_0x5da6a8||0xc8;return function(_0x8624bf){if(_0x8624bf){return _0x54a589[_0x7d2a('0x1a')](_0x5da6a8)['json'](_0x8624bf);}};}function respondWithFilteredResult(_0x5c59d7,_0x5cc022){return function(_0x5d3c5e){if(_0x5d3c5e){var _0x14d66b=typeof _0x5cc022[_0x7d2a('0x1b')]===_0x7d2a('0x1c')&&typeof _0x5cc022['limit']===_0x7d2a('0x1c');var _0x40cfff=_0x5d3c5e[_0x7d2a('0x1d')];var _0x54a470=_0x14d66b?0x0:_0x5cc022['offset'];var _0x4b4d0d=_0x14d66b?_0x5d3c5e[_0x7d2a('0x1d')]:_0x5cc022[_0x7d2a('0x1b')]+_0x5cc022[_0x7d2a('0x1e')];var _0x306ff9;if(_0x4b4d0d>=_0x40cfff){_0x4b4d0d=_0x40cfff;_0x306ff9=0xc8;}else{_0x306ff9=0xce;}_0x5c59d7[_0x7d2a('0x1a')](_0x306ff9);return _0x5c59d7[_0x7d2a('0x1f')]('Content-Range',_0x54a470+'-'+_0x4b4d0d+'/'+_0x40cfff)[_0x7d2a('0x20')](_0x5d3c5e);}return null;};}function patchUpdates(_0x4bfa4f){return function(_0x10766e){try{jsonpatch['apply'](_0x10766e,_0x4bfa4f,!![]);}catch(_0x5bdc3f){return BPromise[_0x7d2a('0x21')](_0x5bdc3f);}return _0x10766e[_0x7d2a('0x22')]();};}function saveUpdates(_0x505d1b,_0x16321a){return function(_0x5850fb){if(_0x5850fb){return _0x5850fb[_0x7d2a('0x23')](_0x505d1b)['then'](function(_0x2de4b6){return _0x2de4b6;});}return null;};}function removeEntity(_0x4aad0e,_0x39dcf1){return function(_0x8301d3){if(_0x8301d3){return _0x8301d3[_0x7d2a('0x24')]()['then'](function(){_0x4aad0e[_0x7d2a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4277a7,_0x565568){return function(_0x1a2e43){if(!_0x1a2e43){_0x4277a7[_0x7d2a('0x25')](0x194);}return _0x1a2e43;};}function handleError(_0x1e0301,_0x1f095a){_0x1f095a=_0x1f095a||0x1f4;return function(_0x2b583c){logger[_0x7d2a('0x26')](_0x2b583c[_0x7d2a('0x27')]);if(_0x2b583c[_0x7d2a('0x28')]){delete _0x2b583c['name'];}_0x1e0301[_0x7d2a('0x1a')](_0x1f095a)['send'](_0x2b583c);};}exports['index']=function(_0x117f2d,_0x33292d){var _0x37c1c4={},_0x27a474={},_0x4a3fc1={'count':0x0,'rows':[]};var _0x29f7bd=_[_0x7d2a('0x29')](db[_0x7d2a('0x2a')][_0x7d2a('0x2b')],function(_0x105aeb){return{'name':_0x105aeb[_0x7d2a('0x2c')],'type':_0x105aeb[_0x7d2a('0x2d')][_0x7d2a('0x2e')]};});_0x27a474[_0x7d2a('0x2f')]=_[_0x7d2a('0x29')](_0x29f7bd,_0x7d2a('0x28'));_0x27a474[_0x7d2a('0x30')]=_['keys'](_0x117f2d['query']);_0x27a474[_0x7d2a('0x31')]=_[_0x7d2a('0x32')](_0x27a474[_0x7d2a('0x2f')],_0x27a474[_0x7d2a('0x30')]);_0x37c1c4['attributes']=_[_0x7d2a('0x32')](_0x27a474[_0x7d2a('0x2f')],qs[_0x7d2a('0x33')](_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x33')]));_0x37c1c4[_0x7d2a('0x34')]=_0x37c1c4['attributes'][_0x7d2a('0x35')]?_0x37c1c4[_0x7d2a('0x34')]:_0x27a474[_0x7d2a('0x2f')];if(!_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x36')]('nolimit')){_0x37c1c4[_0x7d2a('0x1e')]=qs[_0x7d2a('0x1e')](_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x1e')]);_0x37c1c4[_0x7d2a('0x1b')]=qs[_0x7d2a('0x1b')](_0x117f2d[_0x7d2a('0x30')]['offset']);}_0x37c1c4[_0x7d2a('0x37')]=qs[_0x7d2a('0x38')](_0x117f2d[_0x7d2a('0x30')]['sort']);_0x37c1c4['where']=qs[_0x7d2a('0x31')](_[_0x7d2a('0x39')](_0x117f2d[_0x7d2a('0x30')],_0x27a474['filters']),_0x29f7bd);if(_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x3a')]){_0x37c1c4[_0x7d2a('0x3b')]=_[_0x7d2a('0x3c')](_0x37c1c4[_0x7d2a('0x3b')],{'$or':_[_0x7d2a('0x29')](_0x29f7bd,function(_0x12218b){if(_0x12218b[_0x7d2a('0x2d')]!==_0x7d2a('0x3d')){var _0xf5c165={};_0xf5c165[_0x12218b['name']]={'$like':'%'+_0x117f2d[_0x7d2a('0x30')]['filter']+'%'};return _0xf5c165;}})});}_0x37c1c4=_[_0x7d2a('0x3c')]({},_0x37c1c4,_0x117f2d[_0x7d2a('0x3e')]);var _0x162555={'where':_0x37c1c4['where']};return db[_0x7d2a('0x2a')][_0x7d2a('0x1d')](_0x162555)[_0x7d2a('0x3f')](function(_0x8c60d8){_0x4a3fc1[_0x7d2a('0x1d')]=_0x8c60d8;if(_0x117f2d['query'][_0x7d2a('0x40')]){_0x37c1c4[_0x7d2a('0x41')]=[{'all':!![]}];}return db[_0x7d2a('0x2a')][_0x7d2a('0x42')](_0x37c1c4);})[_0x7d2a('0x3f')](function(_0x1ac859){_0x4a3fc1[_0x7d2a('0x43')]=_0x1ac859;return _0x4a3fc1;})[_0x7d2a('0x3f')](respondWithFilteredResult(_0x33292d,_0x37c1c4))[_0x7d2a('0x44')](handleError(_0x33292d,null));};exports[_0x7d2a('0x45')]=function(_0x2393d5,_0x4bda58){var _0x5eeb96={'raw':!![],'where':{'id':_0x2393d5[_0x7d2a('0x46')]['id']}},_0x52ba1a={};_0x52ba1a[_0x7d2a('0x2f')]=_['keys'](db['SmsApplication'][_0x7d2a('0x2b')]);_0x52ba1a['query']=_[_0x7d2a('0x47')](_0x2393d5[_0x7d2a('0x30')]);_0x52ba1a['filters']=_[_0x7d2a('0x32')](_0x52ba1a[_0x7d2a('0x2f')],_0x52ba1a[_0x7d2a('0x30')]);_0x5eeb96['attributes']=_[_0x7d2a('0x32')](_0x52ba1a[_0x7d2a('0x2f')],qs[_0x7d2a('0x33')](_0x2393d5[_0x7d2a('0x30')][_0x7d2a('0x33')]));_0x5eeb96['attributes']=_0x5eeb96[_0x7d2a('0x34')][_0x7d2a('0x35')]?_0x5eeb96[_0x7d2a('0x34')]:_0x52ba1a[_0x7d2a('0x2f')];if(_0x2393d5[_0x7d2a('0x30')]['includeAll']){_0x5eeb96['include']=[{'all':!![]}];}_0x5eeb96=_[_0x7d2a('0x3c')]({},_0x5eeb96,_0x2393d5[_0x7d2a('0x3e')]);return db[_0x7d2a('0x2a')][_0x7d2a('0x48')](_0x5eeb96)[_0x7d2a('0x3f')](handleEntityNotFound(_0x4bda58,null))[_0x7d2a('0x3f')](respondWithResult(_0x4bda58,null))[_0x7d2a('0x44')](handleError(_0x4bda58,null));};exports[_0x7d2a('0x49')]=function(_0x202bc2,_0x1766c8){return db['SmsApplication'][_0x7d2a('0x49')](_0x202bc2['body'],{})['then'](respondWithResult(_0x1766c8,0xc9))[_0x7d2a('0x44')](handleError(_0x1766c8,null));};exports[_0x7d2a('0x23')]=function(_0x246861,_0x4b96ef){if(_0x246861[_0x7d2a('0x4a')]['id']){delete _0x246861[_0x7d2a('0x4a')]['id'];}return db[_0x7d2a('0x2a')][_0x7d2a('0x48')]({'where':{'id':_0x246861['params']['id']}})[_0x7d2a('0x3f')](handleEntityNotFound(_0x4b96ef,null))[_0x7d2a('0x3f')](saveUpdates(_0x246861['body'],null))[_0x7d2a('0x3f')](respondWithResult(_0x4b96ef,null))['catch'](handleError(_0x4b96ef,null));};exports[_0x7d2a('0x24')]=function(_0x4ba5d3,_0x38e03d){return db[_0x7d2a('0x2a')][_0x7d2a('0x48')]({'where':{'id':_0x4ba5d3['params']['id']}})['then'](handleEntityNotFound(_0x38e03d,null))[_0x7d2a('0x3f')](removeEntity(_0x38e03d,null))[_0x7d2a('0x44')](handleError(_0x38e03d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c8cc40e..d268c06 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 _0xd931=['util','api','moment','bluebird','request-promise','path','exports','define','SmsApplication','utf8mb4','lodash'];(function(_0x2e48a5,_0x260758){var _0x5cb67d=function(_0x55d201){while(--_0x55d201){_0x2e48a5['push'](_0x2e48a5['shift']());}};_0x5cb67d(++_0x260758);}(_0xd931,0xa4));var _0x1d93=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0xd931[_0x32358b];return _0x58c21d;};'use strict';var _=require(_0x1d93('0x0'));var util=require(_0x1d93('0x1'));var logger=require('../../config/logger')(_0x1d93('0x2'));var moment=require(_0x1d93('0x3'));var BPromise=require(_0x1d93('0x4'));var rp=require(_0x1d93('0x5'));var fs=require('fs');var path=require(_0x1d93('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x1d93('0x7')]=function(_0x42e9ac,_0x54053c){return _0x42e9ac[_0x1d93('0x8')](_0x1d93('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d93('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd268=['../../config/environment','./smsApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x340eb6,_0x1eac76){var _0x4d833c=function(_0x1d2115){while(--_0x1d2115){_0x340eb6['push'](_0x340eb6['shift']());}};_0x4d833c(++_0x1eac76);}(_0xd268,0x123));var _0x8d26=function(_0x15ee63,_0x43b48c){_0x15ee63=_0x15ee63-0x0;var _0x39d87a=_0xd268[_0x15ee63];return _0x39d87a;};'use strict';var _=require(_0x8d26('0x0'));var util=require('util');var logger=require(_0x8d26('0x1'))(_0x8d26('0x2'));var moment=require(_0x8d26('0x3'));var BPromise=require(_0x8d26('0x4'));var rp=require(_0x8d26('0x5'));var fs=require('fs');var path=require(_0x8d26('0x6'));var rimraf=require(_0x8d26('0x7'));var config=require(_0x8d26('0x8'));var attributes=require(_0x8d26('0x9'));module[_0x8d26('0xa')]=function(_0x48b92c,_0x465fd0){return _0x48b92c['define']('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8d26('0xb'),'collate':_0x8d26('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index fd1dd49..a204e16 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 _0x3419=['then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3e6d85,_0x286841){var _0x4ec3c3=function(_0x142b6e){while(--_0x142b6e){_0x3e6d85['push'](_0x3e6d85['shift']());}};_0x4ec3c3(++_0x286841);}(_0x3419,0xb3));var _0x9341=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x3419[_0x13c70c];return _0x50f0f2;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var BPromise=require(_0x9341('0x3'));var rs=require(_0x9341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9341('0x5'))['db'];var utils=require(_0x9341('0x6'));var logger=require(_0x9341('0x7'))(_0x9341('0x8'));var config=require(_0x9341('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9341('0xa')][_0x9341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3e79,_0x2efc5a,_0x1c30cf){return new BPromise(function(_0x188d3b,_0x3b736e){return client[_0x9341('0xc')](_0x5e3e79,_0x1c30cf)[_0x9341('0xd')](function(_0x51826c){logger[_0x9341('0xe')]('SmsApplication,\x20%s,\x20%s',_0x2efc5a,_0x9341('0xf'));logger[_0x9341('0x10')](_0x9341('0x11'),_0x2efc5a,'request\x20sent',JSON[_0x9341('0x12')](_0x51826c));if(_0x51826c['error']){if(_0x51826c[_0x9341('0x13')][_0x9341('0x14')]===0x1f4){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x3b736e(_0x51826c['error']['message']);}logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x188d3b(_0x51826c[_0x9341('0x13')]['message']);}else{logger[_0x9341('0xe')](_0x9341('0x15'),_0x2efc5a,_0x9341('0xf'));_0x188d3b(_0x51826c['result'][_0x9341('0x16')]);}})[_0x9341('0x17')](function(_0x256b0f){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x256b0f);_0x3b736e(_0x256b0f);});});} \ No newline at end of file +var _0x5276=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','SmsApplication,\x20%s,\x20%s','info','moment','bluebird'];(function(_0x2cb946,_0x320302){var _0x4ded31=function(_0x9ee79a){while(--_0x9ee79a){_0x2cb946['push'](_0x2cb946['shift']());}};_0x4ded31(++_0x320302);}(_0x5276,0x163));var _0x6527=function(_0x54d01f,_0x1f19e4){_0x54d01f=_0x54d01f-0x0;var _0x4c1529=_0x5276[_0x54d01f];return _0x4c1529;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6527('0x0'));var BPromise=require(_0x6527('0x1'));var rs=require(_0x6527('0x2'));var fs=require('fs');var Redis=require(_0x6527('0x3'));var db=require(_0x6527('0x4'))['db'];var utils=require(_0x6527('0x5'));var logger=require(_0x6527('0x6'))(_0x6527('0x7'));var config=require(_0x6527('0x8'));var jayson=require(_0x6527('0x9'));var client=jayson[_0x6527('0xa')][_0x6527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188c61,_0x50fd9d,_0x2b27ec){return new BPromise(function(_0x5a739d,_0x295871){return client[_0x6527('0xc')](_0x188c61,_0x2b27ec)['then'](function(_0x598649){logger['info']('SmsApplication,\x20%s,\x20%s',_0x50fd9d,_0x6527('0xd'));logger[_0x6527('0xe')](_0x6527('0xf'),_0x50fd9d,_0x6527('0xd'),JSON['stringify'](_0x598649));if(_0x598649['error']){if(_0x598649[_0x6527('0x10')][_0x6527('0x11')]===0x1f4){logger[_0x6527('0x10')]('SmsApplication,\x20%s,\x20%s',_0x50fd9d,_0x598649['error']['message']);return _0x295871(_0x598649[_0x6527('0x10')][_0x6527('0x12')]);}logger['error'](_0x6527('0x13'),_0x50fd9d,_0x598649['error'][_0x6527('0x12')]);return _0x5a739d(_0x598649[_0x6527('0x10')][_0x6527('0x12')]);}else{logger[_0x6527('0x14')](_0x6527('0x13'),_0x50fd9d,_0x6527('0xd'));_0x5a739d(_0x598649['result'][_0x6527('0x12')]);}})['catch'](function(_0x7df46a){logger[_0x6527('0x10')](_0x6527('0x13'),_0x50fd9d,_0x7df46a);_0x295871(_0x7df46a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e0c9bc0..c94efe5 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 _0xf4f4=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy'];(function(_0x330a51,_0x42c33b){var _0x55aa63=function(_0x5ddc09){while(--_0x5ddc09){_0x330a51['push'](_0x330a51['shift']());}};_0x55aa63(++_0x42c33b);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x32c92a,_0x26ec67){_0x32c92a=_0x32c92a-0x0;var _0x130f0b=_0xf4f4[_0x32c92a];return _0x130f0b;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./smsInteraction.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x4f4f('0x11')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x11')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['addMessage']);router[_0x4f4f('0x11')]('/:id/tags',auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x15')),controller['addTags']);router[_0x4f4f('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4f4f('0x14'),_0x4f4f('0x17')),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x1b')),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);module[_0x4f4f('0x1f')]=router; \ No newline at end of file +var _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x21c589,_0x4ccb0d){var _0x394114=function(_0x7afb63){while(--_0x7afb63){_0x21c589['push'](_0x21c589['shift']());}};_0x394114(++_0x4ccb0d);}(_0x13f6,0x124));var _0x613f=function(_0x1f357d,_0x58ba15){_0x1f357d=_0x1f357d-0x0;var _0x2d56e6=_0x13f6[_0x1f357d];return _0x2d56e6;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3455fa3..3206ec5 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 _0x251b=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x18e2c6,_0x34bd37){var _0x3fb47e=function(_0x385852){while(--_0x385852){_0x18e2c6['push'](_0x18e2c6['shift']());}};_0x3fb47e(++_0x34bd37);}(_0x251b,0x185));var _0xb251=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x251b[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0xb251('0x0'));var moment=require(_0xb251('0x1'));module[_0xb251('0x2')]={'closed':{'type':Sequelize[_0xb251('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb251('0x4')]},'disposition':{'type':Sequelize[_0xb251('0x5')]},'secondDisposition':{'type':Sequelize[_0xb251('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb251('0x5')]},'note':{'type':Sequelize[_0xb251('0x5')]},'phone':{'type':Sequelize[_0xb251('0x5')]},'read1stAt':{'type':Sequelize[_0xb251('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb251('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb251('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb251('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb251('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcb66=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcb66,0x19f));var _0x6cb6=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xcb66[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6cb6('0x0'));module[_0x6cb6('0x1')]={'closed':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6cb6('0x3')]},'disposition':{'type':Sequelize[_0x6cb6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6cb6('0x4')]},'note':{'type':Sequelize[_0x6cb6('0x4')]},'phone':{'type':Sequelize[_0x6cb6('0x4')]},'read1stAt':{'type':Sequelize[_0x6cb6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in',_0x6cb6('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ebfb9f2..6ac9708 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 _0xb237=['sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','length','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?','buildExpression','type','text','start','forEach','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','$gte','parse','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','SmsInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','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','c.email','Contact.email','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','includeAll','include','options','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','server','tmp','root','files','firstName','lastName','Messages','direction','secret','Account','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','System','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','Users','fullname','Tags','TagIds','push','catch','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId'];(function(_0x4d40c1,_0x51cbe5){var _0x38ea3d=function(_0x8575f0){while(--_0x8575f0){_0x4d40c1['push'](_0x4d40c1['shift']());}};_0x38ea3d(++_0x51cbe5);}(_0xb237,0x178));var _0x7b23=function(_0x4b0ad3,_0x20dc72){_0x4b0ad3=_0x4b0ad3-0x0;var _0x510001=_0xb237[_0x4b0ad3];return _0x510001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b23('0x0'));var zipdir=require(_0x7b23('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b23('0x2'));var moment=require('moment');var BPromise=require(_0x7b23('0x3'));var Mustache=require(_0x7b23('0x4'));var util=require(_0x7b23('0x5'));var path=require(_0x7b23('0x6'));var sox=require(_0x7b23('0x7'));var csv=require(_0x7b23('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b23('0x9'));var squel=require(_0x7b23('0xa'));var crypto=require(_0x7b23('0xb'));var jsforce=require(_0x7b23('0xc'));var deskjs=require(_0x7b23('0xd'));var toCsv=require(_0x7b23('0x8'));var querystring=require(_0x7b23('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b23('0xf'));var qs=require(_0x7b23('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7b23('0x11'));var hardwareService=require(_0x7b23('0x12'));var logger=require(_0x7b23('0x13'))(_0x7b23('0x14'));var utils=require(_0x7b23('0x15'));var config=require(_0x7b23('0x16'));var licenseUtil=require(_0x7b23('0x17'));var db=require(_0x7b23('0x18'))['db'];config[_0x7b23('0x19')]=_[_0x7b23('0x1a')](config[_0x7b23('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b23('0x19')]));require(_0x7b23('0x1b'))[_0x7b23('0x1c')](socket);function respondWithStatusCode(_0x2e31c6,_0x15b9c8){_0x15b9c8=_0x15b9c8||0xcc;return function(_0x3ac353){if(_0x3ac353){return _0x2e31c6[_0x7b23('0x1d')](_0x15b9c8);}return _0x2e31c6[_0x7b23('0x1e')](_0x15b9c8)[_0x7b23('0x1f')]();};}function respondWithResult(_0x4157b3,_0x390e89){_0x390e89=_0x390e89||0xc8;return function(_0x1d8949){if(_0x1d8949){return _0x4157b3['status'](_0x390e89)['json'](_0x1d8949);}};}function respondWithFilteredResult(_0x27f0fc,_0x20d468){return function(_0x3bea45){if(_0x3bea45){var _0x4a35c2=typeof _0x20d468[_0x7b23('0x20')]===_0x7b23('0x21')&&typeof _0x20d468[_0x7b23('0x22')]===_0x7b23('0x21');var _0x5d6432=_0x3bea45[_0x7b23('0x23')];var _0x55f840=_0x4a35c2?0x0:_0x20d468['offset'];var _0x6a30d6=_0x4a35c2?_0x3bea45[_0x7b23('0x23')]:_0x20d468[_0x7b23('0x20')]+_0x20d468[_0x7b23('0x22')];var _0x5ec9a8;if(_0x6a30d6>=_0x5d6432){_0x6a30d6=_0x5d6432;_0x5ec9a8=0xc8;}else{_0x5ec9a8=0xce;}_0x27f0fc[_0x7b23('0x1e')](_0x5ec9a8);return _0x27f0fc[_0x7b23('0x24')]('Content-Range',_0x55f840+'-'+_0x6a30d6+'/'+_0x5d6432)[_0x7b23('0x25')](_0x3bea45);}return null;};}function patchUpdates(_0xcbf8d){return function(_0x10e796){try{jsonpatch[_0x7b23('0x26')](_0x10e796,_0xcbf8d,!![]);}catch(_0x23459c){return BPromise[_0x7b23('0x27')](_0x23459c);}return _0x10e796[_0x7b23('0x28')]();};}function saveUpdates(_0x131d6c,_0x3b7924){return function(_0x2871c2){if(_0x2871c2){return _0x2871c2[_0x7b23('0x29')](_0x131d6c)['then'](function(_0x12c0a8){return _0x12c0a8;});}return null;};}function removeEntity(_0x3f11c0,_0x3f72a6){return function(_0x7761c6){if(_0x7761c6){return _0x7761c6[_0x7b23('0x2a')]()[_0x7b23('0x2b')](function(){_0x3f11c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30effa,_0x5a2cf6){return function(_0x4c34f2){if(!_0x4c34f2){_0x30effa['sendStatus'](0x194);}return _0x4c34f2;};}function handleError(_0x3b5e65,_0x440bd2){_0x440bd2=_0x440bd2||0x1f4;return function(_0x2a2b0f){logger[_0x7b23('0x2c')](_0x2a2b0f[_0x7b23('0x2d')]);if(_0x2a2b0f['name']){delete _0x2a2b0f[_0x7b23('0x2e')];}_0x3b5e65[_0x7b23('0x1e')](_0x440bd2)['send'](_0x2a2b0f);};}function getInteractionUsers(_0x1d9523,_0x40bd68){return new BPromise(function(_0x54d264,_0x33d5e2){try{if(_0x40bd68[_0x1d9523['id']]){_0x1d9523[_0x7b23('0x2f')]=_['map'](_0x40bd68[_0x1d9523['id']],function(_0x5960c3){return{'id':_0x5960c3['id'],'fullname':_0x5960c3[_0x7b23('0x30')]};});}}catch(_0x20d30b){_0x33d5e2(_0x20d30b);}_0x54d264(_0x1d9523);});}function getInteractionTags(_0x428815,_0x9ed878){return new BPromise(function(_0x1b3734,_0x4efd15){try{if(_0x428815['TagIds']){_0x428815[_0x7b23('0x31')]=[];_0x428815[_0x7b23('0x32')]['split'](',')['forEach'](function(_0x13f36f){_0x428815[_0x7b23('0x31')][_0x7b23('0x33')](_0x9ed878[_0x13f36f]);});}delete _0x428815['TagIds'];}catch(_0x1cd98f){_0x4efd15(_0x1cd98f);}_0x1b3734(_0x428815);});}function updateSmsInteraction(_0x526426,_0x5d54e7,_0xb50803){return new BPromise(function(_0x1ec6a5,_0x5a54f6){return getInteractionUsers(_0x526426,_0xb50803)[_0x7b23('0x2b')](function(_0x7dc90){return getInteractionTags(_0x7dc90,_0x5d54e7);})[_0x7b23('0x2b')](function(_0x368be1){_0x1ec6a5(_0x368be1);})[_0x7b23('0x34')](function(_0x760edd){_0x5a54f6(_0x760edd);});});}exports['index']=function(_0x211a4d,_0x4a5a53){var _0x960179={},_0xea87c8={},_0x2fc475={'count':0x0,'rows':[]};var _0x4728ac=_['map'](db['SmsInteraction'][_0x7b23('0x35')],function(_0xfbdd7e){return{'name':_0xfbdd7e[_0x7b23('0x36')],'type':_0xfbdd7e['type'][_0x7b23('0x37')]};});_0xea87c8['model']=_[_0x7b23('0x38')](_0x4728ac,_0x7b23('0x2e'));_0xea87c8[_0x7b23('0x39')]=_[_0x7b23('0x3a')](_0x211a4d[_0x7b23('0x39')]);_0xea87c8[_0x7b23('0x3b')]=_[_0x7b23('0x3c')](_0xea87c8[_0x7b23('0x3d')],_0xea87c8[_0x7b23('0x39')]);_0x960179[_0x7b23('0x3e')]=_['intersection'](_0xea87c8[_0x7b23('0x3d')],qs[_0x7b23('0x3f')](_0x211a4d[_0x7b23('0x39')][_0x7b23('0x3f')]));_0x960179[_0x7b23('0x3e')]=_0x960179['attributes']['length']?_0x960179[_0x7b23('0x3e')]:_0xea87c8[_0x7b23('0x3d')];if(!_0x211a4d[_0x7b23('0x39')][_0x7b23('0x40')](_0x7b23('0x41'))){_0x960179[_0x7b23('0x22')]=qs['limit'](_0x211a4d[_0x7b23('0x39')]['limit']);_0x960179[_0x7b23('0x20')]=qs[_0x7b23('0x20')](_0x211a4d[_0x7b23('0x39')][_0x7b23('0x20')]);}_0x960179[_0x7b23('0x42')]=qs[_0x7b23('0x43')](_0x211a4d[_0x7b23('0x39')]['sort']);_0x960179['where']=qs[_0x7b23('0x3b')](_[_0x7b23('0x44')](_0x211a4d['query'],_0xea87c8[_0x7b23('0x3b')]),_0x4728ac);var _0xaa3d97=[];var _0x5ce5dd=squel['select']()['field']('id')[_0x7b23('0x45')](_0x7b23('0x2e'))['field'](_0x7b23('0x46'))['from'](_0x7b23('0x47'));var _0x1261e5=squel['select']()['field'](_0x7b23('0x48'))[_0x7b23('0x45')](_0x7b23('0x49'))[_0x7b23('0x45')](_0x7b23('0x4a'))[_0x7b23('0x4b')](_0x7b23('0x4c'),'ui')[_0x7b23('0x4d')](_0x7b23('0x4e'),'u',_0x7b23('0x4f'));var _0x2ee9ba=squel[_0x7b23('0x50')]()[_0x7b23('0x4b')]('sms_interactions','i')['left_join'](_0x7b23('0x51'),'c',_0x7b23('0x52'))['left_join'](_0x7b23('0x4e'),'o',_0x7b23('0x53'))[_0x7b23('0x4d')](_0x7b23('0x54'),'a',_0x7b23('0x55'))[_0x7b23('0x4d')](_0x7b23('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x7b23('0x4d')](_0x7b23('0x57'),'it',_0x7b23('0x58'))[_0x7b23('0x4d')](_0x7b23('0x47'),'t',_0x7b23('0x59'));var _0x3eea0c=squel[_0x7b23('0x5a')]();var _0x245421=[];var _0x4a873c=squel[_0x7b23('0x5a')]();var _0xd963fe;if(_0x211a4d['query'][_0x7b23('0x5b')]){_0xd963fe=as['parseSearch'](_0x211a4d[_0x7b23('0x39')][_0x7b23('0x5b')]);var _0x29d3dd=_0xd963fe[_0x7b23('0x5c')];for(var _0x1c4e5d=0x0;_0x1c4e5d<_0xd963fe[_0x7b23('0x5d')]['length'];_0x1c4e5d++){var _0x381676=_0xd963fe['conditions'][_0x1c4e5d];var _0xe13fe2='i';var _0x17382a=_[_0x7b23('0x5e')](_0x4728ac,[_0x7b23('0x2e'),_0x381676[_0x7b23('0x45')]]);if(!_0x17382a){switch(_0x381676[_0x7b23('0x45')]){case _0x7b23('0x5f'):if(_0x381676[_0x7b23('0x60')]==0x1){_0x2ee9ba[_0x7b23('0x61')]('`'+_0x381676['field']+'`\x20=\x200');}else{_0x2ee9ba[_0x7b23('0x61')]('`'+_0x381676[_0x7b23('0x45')]+_0x7b23('0x62'));}break;case _0x7b23('0x63'):if(_0x381676[_0x7b23('0x64')]===_0x7b23('0x65')){if(_0x381676[_0x7b23('0x60')][_0x7b23('0x66')]('\x20')[_0x7b23('0x67')]>0x1){_0x3eea0c[_0x29d3dd](_0x7b23('0x68'),qs['getFullTextValue'](_0x381676['value']),null);}else{var _0x5d53f6='%'+_0x381676[_0x7b23('0x60')]+'%';_0x3eea0c[_0x29d3dd](_0x7b23('0x69'),_0x5d53f6,_0x5d53f6,_0x5d53f6);}}else{_0x17382a=_[_0x7b23('0x5e')](_0x4728ac,[_0x7b23('0x2e'),'ContactId']);_0x381676['field']='ContactId';_0x3d9a3a=as[_0x7b23('0x6a')](_0xe13fe2,_0x17382a[_0x7b23('0x6b')],_0x381676);_0x3eea0c[_0x29d3dd](_0x3d9a3a[_0x7b23('0x6c')],_0x3d9a3a[_0x7b23('0x60')][_0x7b23('0x6d')],_0x3d9a3a[_0x7b23('0x60')][_0x7b23('0x1f')]);}break;case'Tag':var _0x47080d=_0x381676[_0x7b23('0x60')][_0x7b23('0x66')](',')[_0x7b23('0x38')](function(_0x40814f){return Number(_0x40814f);});_0x47080d[_0x7b23('0x6e')](function(_0x4c4d2f){_0x4a873c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c4d2f+',%');});_0x245421=_['union'](_0x245421,_0x47080d);break;case _0x7b23('0x6f'):if(_0x381676[_0x7b23('0x64')]===_0x7b23('0x65')){_0x3eea0c[_0x29d3dd](_0x7b23('0x70'),'%'+_0x381676[_0x7b23('0x60')]+'%',null);}else{_0x17382a=_[_0x7b23('0x5e')](_0x4728ac,[_0x7b23('0x2e'),_0x7b23('0x71')]);_0x381676[_0x7b23('0x45')]=_0x7b23('0x71');_0x3d9a3a=as[_0x7b23('0x6a')](_0xe13fe2,_0x17382a[_0x7b23('0x6b')],_0x381676);_0x3eea0c[_0x29d3dd](_0x3d9a3a[_0x7b23('0x6c')],_0x3d9a3a[_0x7b23('0x60')]['start'],_0x3d9a3a[_0x7b23('0x60')][_0x7b23('0x1f')]);}break;case'body':_0x3d9a3a=as[_0x7b23('0x6a')]('me',null,_0x381676);_0x3eea0c[_0x29d3dd](_0x3d9a3a[_0x7b23('0x6c')],_0x3d9a3a[_0x7b23('0x60')][_0x7b23('0x6d')],_0x3d9a3a['value'][_0x7b23('0x1f')]);break;}}else{var _0x3d9a3a=as['buildExpression'](_0xe13fe2,_0x17382a['type'],_0x381676);_0x3eea0c[_0x29d3dd](_0x3d9a3a[_0x7b23('0x6c')],_0x3d9a3a[_0x7b23('0x60')][_0x7b23('0x6d')],_0x3d9a3a['value'][_0x7b23('0x1f')]);}}}else{var _0x3acc6a=_(_0x211a4d[_0x7b23('0x39')])[_0x7b23('0x3a')]()[_0x7b23('0x38')](function(_0x42d5f9){return _[_0x7b23('0x72')](_0x4728ac,[_0x7b23('0x2e'),_0x42d5f9])?_0x42d5f9:undefined;})[_0x7b23('0x73')]()[_0x7b23('0x60')]();if(!_[_0x7b23('0x74')](_0x3acc6a)){_0x3acc6a[_0x7b23('0x6e')](function(_0x5f3194){if(_0x5f3194===_0x7b23('0x75')){_0x2ee9ba['where'](_0x7b23('0x76'),[]['concat'](_0x211a4d[_0x7b23('0x39')][_0x5f3194]));}else if(_0x5f3194===_0x7b23('0x77')){var _0x47bbde=JSON['parse'](_0x211a4d[_0x7b23('0x39')][_0x5f3194])[_0x7b23('0x78')];var _0x54e573=JSON[_0x7b23('0x79')](_0x211a4d[_0x7b23('0x39')][_0x5f3194])['$lte'];_0x2ee9ba[_0x7b23('0x7a')](_0x7b23('0x7b'),_0x47bbde,_0x54e573);}else{if(_0x211a4d[_0x7b23('0x39')][_0x5f3194]==='null'){_0x2ee9ba[_0x7b23('0x7a')]('i.'+_0x5f3194+_0x7b23('0x7c'));}else{_0x2ee9ba['where']('i.'+_0x5f3194+_0x7b23('0x7d'),_0x211a4d[_0x7b23('0x39')][_0x5f3194]);}}});}if(_0x211a4d[_0x7b23('0x39')][_0x7b23('0x7e')]){if(_0x211a4d['query'][_0x7b23('0x7e')]==0x1){_0x2ee9ba['having']('`unreadMessages`\x20=\x200');}else{_0x2ee9ba['having'](_0x7b23('0x7f'));}}if(_0x211a4d[_0x7b23('0x39')][_0x7b23('0x80')]){_0x245421=_[_0x7b23('0x81')](_0x211a4d['query'][_0x7b23('0x80')])?_0x211a4d[_0x7b23('0x39')][_0x7b23('0x80')]:new Array(_0x211a4d[_0x7b23('0x39')][_0x7b23('0x80')]);_0x245421['forEach'](function(_0x7c1bbc){_0x4a873c['or'](_0x7b23('0x82'),'%,'+_0x7c1bbc+',%');});}if(_0x211a4d['query'][_0x7b23('0x83')]){var _0xf087dc=_0x211a4d[_0x7b23('0x39')][_0x7b23('0x83')]['replace']('\x5c','\x5c\x5c')[_0x7b23('0x84')](/'/g,'\x27\x27');if(qs[_0x7b23('0x85')](_0xf087dc)){_0x3eea0c['or']('i.id\x20LIKE\x20?',_0xf087dc+'%')['or'](_0x7b23('0x86'),_0xf087dc+'%');}else{_0x3eea0c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7b23('0x87')](_0xf087dc))['or'](_0x7b23('0x88'),_0xf087dc+'%');}}}_0x2ee9ba[_0x7b23('0x7a')](_0x3eea0c);_0x2ee9ba[_0x7b23('0x89')](_0x7b23('0x8a'));var _0x3d5846={'type':db[_0x7b23('0x8b')][_0x7b23('0x8c')][_0x7b23('0x8d')],'raw':!![]};var _0x450a6e=_0x2ee9ba[_0x7b23('0x8e')]();_0x450a6e[_0x7b23('0x45')](_0x7b23('0x8a'));_0x450a6e[_0x7b23('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7b23('0x5f'));if(_0x960179['order']){_0x960179[_0x7b23('0x42')]['forEach'](function(_0x497b0f){var _0x432059=_0x497b0f[0x0]===_0x7b23('0x8f')?_0x497b0f[0x0]:'i.'+_0x497b0f[0x0];_0x2ee9ba['order'](_0x432059,_0x497b0f[0x1]===_0x7b23('0x90')?![]:!![]);});}if(!_[_0x7b23('0x74')](_0x245421)){_0x2ee9ba['having'](_0x4a873c);_0x450a6e[_0x7b23('0x7a')](_0x7b23('0x91'),_0x245421);}BPromise[_0x7b23('0x92')]()[_0x7b23('0x2b')](function(){if(!_0xd963fe){if(_0x211a4d[_0x7b23('0x39')]['SmsAccountId'])return;_0x450a6e[_0x7b23('0x7a')](_0x7b23('0x93'));_0x2ee9ba[_0x7b23('0x7a')](_0x7b23('0x93'));return;}if(_0x211a4d[_0x7b23('0x94')]['role']!=='agent')return;return _0x211a4d[_0x7b23('0x94')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x7b23('0x2b')](function(_0x4f23d1){if(_[_0x7b23('0x74')](_0x4f23d1)){_0x450a6e[_0x7b23('0x7a')]('i.SmsAccountId\x20IS\x20NULL');_0x2ee9ba[_0x7b23('0x7a')](_0x7b23('0x95'));}else{_0x450a6e['where'](_0x7b23('0x76'),_[_0x7b23('0x38')](_0x4f23d1,'id'));_0x2ee9ba[_0x7b23('0x7a')](_0x7b23('0x76'),_[_0x7b23('0x38')](_0x4f23d1,'id'));}});})[_0x7b23('0x2b')](function(){if(_0x211a4d['user'][_0x7b23('0x96')]===_0x7b23('0x97')&&!_0xd963fe&&!_0x211a4d[_0x7b23('0x39')]['SmsAccountId'])return[];return db[_0x7b23('0x98')][_0x7b23('0x39')](_0x450a6e[_0x7b23('0x99')](),_0x3d5846);})[_0x7b23('0x2b')](function(_0x443ca5){_0x2fc475[_0x7b23('0x23')]=_0x443ca5[_0x7b23('0x67')];if(_0x2fc475[_0x7b23('0x23')]===0x0)return[];return db['sequelize'][_0x7b23('0x39')](_0x5ce5dd[_0x7b23('0x99')](),_0x3d5846)['then'](function(_0x2e69f6){_0xaa3d97=_[_0x7b23('0x9a')](_0x2e69f6,'id');_0x3d5846=_[_0x7b23('0x9b')](_0x3d5846,{'model':db[_0x7b23('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x211a4d[_0x7b23('0x39')][_0x7b23('0x3f')]){_0x960179['attributes'][_0x7b23('0x6e')](function(_0x524fd2){_0x2ee9ba[_0x7b23('0x45')]('i.'+_0x524fd2);});}else{_0x2ee9ba['field'](_0x7b23('0x9d'),_0x7b23('0x5f'));_0x2ee9ba['field'](_0x7b23('0x9e'),_0x7b23('0x9f'));_0x2ee9ba['field']('a.mandatoryDisposition',_0x7b23('0xa0'));_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xa1'),'contactName');_0x2ee9ba['field'](_0x7b23('0xa2'));_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xa3'),_0x7b23('0xa4'));_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xa5'),'Contact.lastName');_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xa6'),_0x7b23('0xa7'));_0x2ee9ba[_0x7b23('0x45')]('c.phone','Contact.phone');_0x2ee9ba['field'](_0x7b23('0xa8'),_0x7b23('0xa9'));_0x2ee9ba[_0x7b23('0x45')]('c.fax',_0x7b23('0xaa'));_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xab'),_0x7b23('0xac'));_0x2ee9ba['field'](_0x7b23('0xad'),_0x7b23('0xae'));_0x2ee9ba[_0x7b23('0x45')](_0x7b23('0xaf'),_0x7b23('0x32'));}if(_0x960179[_0x7b23('0x22')])_0x2ee9ba[_0x7b23('0x22')](_0x960179[_0x7b23('0x22')]);if(_0x960179['offset'])_0x2ee9ba[_0x7b23('0x20')](_0x960179[_0x7b23('0x20')]);return db[_0x7b23('0x98')][_0x7b23('0x39')](_0x2ee9ba['toString'](),_0x3d5846);})[_0x7b23('0x2b')](function(_0x1052a7){if(_0x1052a7['length']>0x0)_0x1261e5['where'](_0x7b23('0xb0'),_['map'](_0x1052a7,'id'));return db[_0x7b23('0x98')][_0x7b23('0x39')](_0x1261e5['toString'](),_0x3d5846)[_0x7b23('0x2b')](function(_0xa93cc8){var _0x3b22ef=_[_0x7b23('0xb1')](_0xa93cc8,_0x7b23('0xb2'));var _0xd1c6ff=[];_0x1052a7[_0x7b23('0x6e')](function(_0x4d16b3){_0xd1c6ff[_0x7b23('0x33')](updateSmsInteraction(_0x4d16b3,_0xaa3d97,_0x3b22ef));});return BPromise[_0x7b23('0xb3')](_0xd1c6ff);});});})[_0x7b23('0x2b')](function(_0x3abcfa){_0x2fc475[_0x7b23('0xb4')]=_0x3abcfa;return _0x2fc475;})['then'](respondWithFilteredResult(_0x4a5a53,_0x960179))['catch'](handleError(_0x4a5a53,null));};exports[_0x7b23('0xb5')]=function(_0x345bed,_0x5dbeef){var _0x1b86d8={'raw':![],'where':{'id':_0x345bed['params']['id']}},_0x34bb07={};_0x34bb07[_0x7b23('0x3d')]=_['keys'](db[_0x7b23('0x9c')][_0x7b23('0x35')]);_0x34bb07['query']=_[_0x7b23('0x3a')](_0x345bed['query']);_0x34bb07['filters']=_['intersection'](_0x34bb07[_0x7b23('0x3d')],_0x34bb07[_0x7b23('0x39')]);_0x1b86d8['attributes']=_[_0x7b23('0x3c')](_0x34bb07[_0x7b23('0x3d')],qs[_0x7b23('0x3f')](_0x345bed[_0x7b23('0x39')][_0x7b23('0x3f')]));_0x1b86d8['attributes']=_0x1b86d8[_0x7b23('0x3e')][_0x7b23('0x67')]?_0x1b86d8[_0x7b23('0x3e')]:_0x34bb07[_0x7b23('0x3d')];if(_0x345bed[_0x7b23('0x39')][_0x7b23('0xb6')]){_0x1b86d8[_0x7b23('0xb7')]=[{'all':!![]}];}_0x1b86d8=_['merge']({},_0x1b86d8,_0x345bed[_0x7b23('0xb8')]);return db['SmsInteraction'][_0x7b23('0x5e')](_0x1b86d8)[_0x7b23('0x2b')](handleEntityNotFound(_0x5dbeef,null))[_0x7b23('0x2b')](respondWithResult(_0x5dbeef,null))[_0x7b23('0x34')](handleError(_0x5dbeef,null));};exports[_0x7b23('0xb9')]=function(_0x789cf0,_0x44b449){return db[_0x7b23('0x9c')][_0x7b23('0xb9')](_0x789cf0[_0x7b23('0xba')],{})[_0x7b23('0x2b')](respondWithResult(_0x44b449,0xc9))[_0x7b23('0x34')](handleError(_0x44b449,null));};exports[_0x7b23('0x29')]=function(_0x17fcce,_0x45272f){if(_0x17fcce['body']['id']){delete _0x17fcce[_0x7b23('0xba')]['id'];}return db[_0x7b23('0x9c')]['find']({'where':{'id':_0x17fcce[_0x7b23('0xbb')]['id']}})[_0x7b23('0x2b')](handleEntityNotFound(_0x45272f,null))[_0x7b23('0x2b')](saveUpdates(_0x17fcce[_0x7b23('0xba')],null))['then'](respondWithResult(_0x45272f,null))[_0x7b23('0x34')](handleError(_0x45272f,null));};exports[_0x7b23('0x2a')]=function(_0xcb55fb,_0x5838a9){return db[_0x7b23('0x9c')][_0x7b23('0x5e')]({'where':{'id':_0xcb55fb[_0x7b23('0xbb')]['id']}})[_0x7b23('0x2b')](handleEntityNotFound(_0x5838a9,null))[_0x7b23('0x2b')](removeEntity(_0x5838a9,null))[_0x7b23('0x34')](handleError(_0x5838a9,null));};exports[_0x7b23('0xbc')]=function(_0x1464a0,_0xe25be9){return db[_0x7b23('0x9c')][_0x7b23('0xbc')]()[_0x7b23('0x2b')](respondWithResult(_0xe25be9,null))['catch'](handleError(_0xe25be9,null));};exports[_0x7b23('0xbd')]=function(_0x331d8b,_0x482556,_0x1b2cfe){return db[_0x7b23('0xbe')][_0x7b23('0x5e')]({'where':{'id':_0x331d8b['params']['id']}})[_0x7b23('0x2b')](handleEntityNotFound(_0x482556,null))[_0x7b23('0x2b')](function(_0xc7bf28){if(_0xc7bf28){return _0xc7bf28[_0x7b23('0xbd')](_0x331d8b[_0x7b23('0xba')][_0x7b23('0xbf')],_[_0x7b23('0xc0')](_0x331d8b['body'],['ids','id'])||{});}})[_0x7b23('0x2b')](respondWithResult(_0x482556,null))[_0x7b23('0x34')](handleError(_0x482556,null));};exports[_0x7b23('0xc1')]=function(_0x217263,_0x1ddff3,_0x33e32c){var _0x5d6686={'raw':![],'where':{}};var _0x16c6f9={};var _0x3fbf90={'count':0x0,'rows':[]};return db[_0x7b23('0x9c')][_0x7b23('0xc2')]({'where':{'id':_0x217263[_0x7b23('0xbb')]['id']}})[_0x7b23('0x2b')](handleEntityNotFound(_0x1ddff3,null))['then'](function(_0x31bd64){if(_0x31bd64){_0x16c6f9['model']=_[_0x7b23('0x3a')](db[_0x7b23('0xbe')]['rawAttributes']);_0x16c6f9[_0x7b23('0x39')]=_[_0x7b23('0x3a')](_0x217263[_0x7b23('0x39')]);_0x16c6f9[_0x7b23('0x3b')]=_['intersection'](_0x16c6f9[_0x7b23('0x3d')],_0x16c6f9[_0x7b23('0x39')]);_0x5d6686[_0x7b23('0x3e')]=_[_0x7b23('0x3c')](_0x16c6f9[_0x7b23('0x3d')],qs[_0x7b23('0x3f')](_0x217263[_0x7b23('0x39')][_0x7b23('0x3f')]));_0x5d6686[_0x7b23('0x3e')]=_0x5d6686[_0x7b23('0x3e')][_0x7b23('0x67')]?_0x5d6686[_0x7b23('0x3e')]:_0x16c6f9['model'];if(!_0x217263[_0x7b23('0x39')][_0x7b23('0x40')](_0x7b23('0x41'))){_0x5d6686['limit']=qs[_0x7b23('0x22')](_0x217263['query']['limit']);_0x5d6686[_0x7b23('0x20')]=qs[_0x7b23('0x20')](_0x217263['query']['offset']);}_0x5d6686['order']=qs[_0x7b23('0x43')](_0x217263[_0x7b23('0x39')][_0x7b23('0x43')]);_0x5d6686[_0x7b23('0x7a')]=qs[_0x7b23('0x3b')](_[_0x7b23('0x44')](_0x217263['query'],_0x16c6f9[_0x7b23('0x3b')]));_0x5d6686[_0x7b23('0x7a')]['SmsInteractionId']=_0x31bd64['id'];if(_0x217263['query']['filter']){_0x5d6686[_0x7b23('0x7a')]=_[_0x7b23('0x9b')](_0x5d6686[_0x7b23('0x7a')],{'$or':_['map'](_0x5d6686[_0x7b23('0x3e')],function(_0x259938){var _0x5160d7={};_0x5160d7[_0x259938]={'$like':'%'+_0x217263[_0x7b23('0x39')][_0x7b23('0x83')]+'%'};return _0x5160d7;})});}if(_0x217263[_0x7b23('0x39')][_0x7b23('0x78')]){var _0x2cba44=_0x217263[_0x7b23('0x39')]['$gte'][_0x7b23('0x66')](',');var _0x580526={};_0x580526[_0x2cba44[0x0]]={'$gte':moment(_0x2cba44[0x1])[_0x7b23('0xc3')](_0x7b23('0xc4'))};_0x5d6686[_0x7b23('0x7a')]=_['merge'](_0x5d6686[_0x7b23('0x7a')],_0x580526);}_0x5d6686=_[_0x7b23('0x9b')]({},_0x5d6686,_0x217263[_0x7b23('0xb8')]);return db[_0x7b23('0xbe')][_0x7b23('0x23')]({'where':_0x5d6686[_0x7b23('0x7a')]})[_0x7b23('0x2b')](function(_0x3df5fb){_0x3fbf90[_0x7b23('0x23')]=_0x3df5fb;if(_0x217263[_0x7b23('0x39')]['includeAll']){_0x5d6686['include']=[{'all':!![]}];}return db[_0x7b23('0xbe')][_0x7b23('0xc5')](_0x5d6686);})['then'](function(_0x1b4743){_0x3fbf90[_0x7b23('0xb4')]=_0x1b4743;return _0x3fbf90;});}})['then'](respondWithFilteredResult(_0x1ddff3,_0x5d6686))['catch'](handleError(_0x1ddff3,null));};exports['addTags']=function(_0x3d9291,_0x28153f,_0x5d4148){return db[_0x7b23('0x9c')][_0x7b23('0x5e')]({'where':{'id':_0x3d9291[_0x7b23('0xbb')]['id']}})[_0x7b23('0x2b')](handleEntityNotFound(_0x28153f,null))[_0x7b23('0x2b')](function(_0x168dbd){if(_0x168dbd){return _0x168dbd[_0x7b23('0xc6')](_0x3d9291[_0x7b23('0xba')][_0x7b23('0xbf')],_['omit'](_0x3d9291[_0x7b23('0xba')],[_0x7b23('0xbf'),'id'])||{})[_0x7b23('0xc7')](function(){return db['Tag'][_0x7b23('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x3d9291[_0x7b23('0xba')]['ids']}});})['then'](function(_0x289918){socket[_0x7b23('0xc8')](_0x7b23('0xc9'),{'id':Number(_0x3d9291[_0x7b23('0xbb')]['id']),'tags':_0x289918||[]});return{'id':Number(_0x3d9291[_0x7b23('0xbb')]['id']),'tags':_0x289918||[]};});}})[_0x7b23('0x2b')](respondWithResult(_0x28153f,null))[_0x7b23('0x34')](handleError(_0x28153f,null));};exports[_0x7b23('0xca')]=function(_0x986313,_0x21668e,_0x129315){return db['SmsInteraction'][_0x7b23('0x5e')]({'where':{'id':_0x986313[_0x7b23('0xbb')]['id']}})['then'](handleEntityNotFound(_0x21668e,null))[_0x7b23('0x2b')](function(_0x37c999){if(_0x37c999){return _0x37c999[_0x7b23('0xca')](_0x986313['query']['ids']);}})['then'](respondWithStatusCode(_0x21668e,null))[_0x7b23('0x34')](handleError(_0x21668e,null));};exports[_0x7b23('0xcb')]=function(_0x40a123,_0xeaa321){var _0x1df3f0=moment()['unix']()[_0x7b23('0x99')]();var _0x5249d9=path[_0x7b23('0xcc')](config['root'],_0x7b23('0xcd'),'files',_0x7b23('0xce'));var _0x21d215=path['join'](config[_0x7b23('0xcf')],_0x7b23('0xcd'),_0x7b23('0xd0'),'attachments');var _0xaea790=path[_0x7b23('0xcc')](_0x5249d9,_0x1df3f0);var _0x3fc244=util[_0x7b23('0xc3')]('transcript-%d-%s.zip',_0x40a123[_0x7b23('0xbb')]['id'],_0x1df3f0);var _0x2bea64=path[_0x7b23('0xcc')](_0x5249d9,_0x3fc244);var _0x202b07=[];_0x202b07[_0x7b23('0x33')]({'model':db[_0x7b23('0x6f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x202b07[_0x7b23('0x33')]({'model':db['CmContact'],'as':_0x7b23('0x63'),'attributes':['id',_0x7b23('0xd1'),_0x7b23('0xd2')],'raw':!![]});var _0x33e99c=[{'model':db[_0x7b23('0xbe')],'as':_0x7b23('0xd3'),'attributes':['id',_0x7b23('0xba'),_0x7b23('0x77'),_0x7b23('0xd4'),_0x7b23('0xd5'),'read'],'include':_0x202b07}];_0x33e99c[_0x7b23('0x33')]({'model':db['SmsAccount'],'as':_0x7b23('0xd6'),'attributes':['id',_0x7b23('0x2e')]});_0x33e99c['push']({'model':db[_0x7b23('0x6f')],'as':_0x7b23('0xd7'),'attributes':['id',_0x7b23('0x30')]});return db['SmsInteraction'][_0x7b23('0x5e')]({'where':{'id':_0x40a123[_0x7b23('0xbb')]['id']},'include':_0x33e99c})[_0x7b23('0x2b')](handleEntityNotFound(_0xeaa321,null))[_0x7b23('0x2b')](function(_0x4fe90d){if(_0x4fe90d){var _0x158294=_0x4fe90d[_0x7b23('0xd8')]({'plain':!![]});fs[_0x7b23('0xd9')](_0xaea790);var _0x5ee3f6={'channel':_0x7b23('0xda'),'account':_0x158294[_0x7b23('0xd6')][_0x7b23('0x2e')],'agent':_0x158294['Owner']?_0x158294[_0x7b23('0xd7')][_0x7b23('0x30')]:_0x7b23('0xdb'),'createdAt':moment(_0x158294[_0x7b23('0x77')])[_0x7b23('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7b23('0x99')](),'closedAt':_0x158294[_0x7b23('0xdc')]?moment(_0x158294[_0x7b23('0xdd')])['format'](_0x7b23('0xc4'))[_0x7b23('0x99')]():'','disposition':_0x158294['disposition'],'messages':_(_0x158294[_0x7b23('0xd3')])[_0x7b23('0x83')]({'secret':![]})[_0x7b23('0x38')](function(_0x46631c){return{'date':moment(_0x46631c[_0x7b23('0x77')])[_0x7b23('0xc3')](_0x7b23('0xc4'))[_0x7b23('0x99')](),'sender':_0x46631c['direction']==='out'?_0x46631c[_0x7b23('0x6f')]?_0x46631c[_0x7b23('0x6f')][_0x7b23('0x30')]:_0x7b23('0xde'):_0x46631c[_0x7b23('0x63')][_0x7b23('0xd1')]+(_0x46631c['Contact']['lastName']?'\x20'+_0x46631c['Contact']['lastName']:''),'body':_0x46631c['body'],'direction':_0x46631c['direction']===_0x7b23('0xdf')?'A':'C','secret':_0x46631c[_0x7b23('0xd5')],'read':_0x46631c[_0x7b23('0x7e')]};})[_0x7b23('0x60')]()};return ejs[_0x7b23('0xe0')](path['join'](config[_0x7b23('0xcf')],'server',_0x7b23('0xe1'),_0x7b23('0xe2')),{'interaction':_0x5ee3f6})['then'](function(_0x5125bd){var _0x1871ee=path[_0x7b23('0xcc')](_0xaea790,_0x7b23('0xe3')+_0x158294['id']+'-'+_0x1df3f0+'.pdf');var _0x339405={'path':_0x1871ee,'channel':_0x7b23('0xda'),'interactionId':_0x158294['id']};return pdf[_0x7b23('0xe4')](_0x5125bd,_0x339405);})[_0x7b23('0x2b')](function(){return new BPromise(function(_0x278d97,_0x3d559c){zipdir(_0xaea790,{'saveTo':_0x2bea64},function(_0x5a82af,_0x175a38){if(_0x5a82af)return _0x3d559c(_0x5a82af);return _0x278d97(_0x175a38);});})[_0x7b23('0x2b')](function(){return new BPromise(function(_0x358c37,_0x2ebc3d){rimraf(_0xaea790,function(_0x4c2470){if(_0x4c2470)_0x2ebc3d(_0x4c2470);return _0x358c37();});});})[_0x7b23('0x2b')](function(){return _0xeaa321[_0x7b23('0xcb')](_0x2bea64,_0x3fc244,function(_0x35fc37){if(_0x35fc37){console[_0x7b23('0xe5')](_0x7b23('0xe6'),_0x35fc37);}else{fs['unlinkSync'](_0x2bea64);}});});});}else{return _0xeaa321['sendStatus'](0xc8);}})[_0x7b23('0x34')](handleError(_0xeaa321,null));}; \ No newline at end of file +var _0xcf5f=['get','mkdirSync','N.A.','closed','closedAt','disposition','out','System','renderFile','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','name','send','map','Tags','TagIds','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','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','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','resolve','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','catch','show','params','includeAll','include','options','create','update','describe','addMessage','SmsMessage','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','join','server','files','tmp','root','format','fullname','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner'];(function(_0x299acf,_0x3a215d){var _0x3cf11b=function(_0x2cc86e){while(--_0x2cc86e){_0x299acf['push'](_0x299acf['shift']());}};_0x3cf11b(++_0x3a215d);}(_0xcf5f,0xfe));var _0xfcf5=function(_0x55c37e,_0x229490){_0x55c37e=_0x55c37e-0x0;var _0x10d6ab=_0xcf5f[_0x55c37e];return _0x10d6ab;};'use strict';var emlformat=require(_0xfcf5('0x0'));var rimraf=require(_0xfcf5('0x1'));var zipdir=require(_0xfcf5('0x2'));var jsonpatch=require(_0xfcf5('0x3'));var rp=require(_0xfcf5('0x4'));var moment=require(_0xfcf5('0x5'));var BPromise=require(_0xfcf5('0x6'));var Mustache=require(_0xfcf5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfcf5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcf5('0x9'));var _=require(_0xfcf5('0xa'));var squel=require(_0xfcf5('0xb'));var crypto=require(_0xfcf5('0xc'));var jsforce=require(_0xfcf5('0xd'));var deskjs=require(_0xfcf5('0xe'));var toCsv=require(_0xfcf5('0x8'));var querystring=require(_0xfcf5('0xf'));var Papa=require(_0xfcf5('0x10'));var Redis=require(_0xfcf5('0x11'));var authService=require(_0xfcf5('0x12'));var qs=require(_0xfcf5('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfcf5('0x14'));var hardwareService=require(_0xfcf5('0x15'));var logger=require(_0xfcf5('0x16'))(_0xfcf5('0x17'));var utils=require(_0xfcf5('0x18'));var config=require(_0xfcf5('0x19'));var licenseUtil=require(_0xfcf5('0x1a'));var db=require(_0xfcf5('0x1b'))['db'];config[_0xfcf5('0x1c')]=_['defaults'](config[_0xfcf5('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcf5('0x1d'))(new Redis(config[_0xfcf5('0x1c')]));require(_0xfcf5('0x1e'))['register'](socket);function respondWithStatusCode(_0x585590,_0x2adfab){_0x2adfab=_0x2adfab||0xcc;return function(_0x1ad672){if(_0x1ad672){return _0x585590[_0xfcf5('0x1f')](_0x2adfab);}return _0x585590[_0xfcf5('0x20')](_0x2adfab)[_0xfcf5('0x21')]();};}function respondWithResult(_0x3455e1,_0xdc6c27){_0xdc6c27=_0xdc6c27||0xc8;return function(_0x50f70c){if(_0x50f70c){return _0x3455e1[_0xfcf5('0x20')](_0xdc6c27)[_0xfcf5('0x22')](_0x50f70c);}};}function respondWithFilteredResult(_0x1f68be,_0x43969c){return function(_0x3dd71e){if(_0x3dd71e){var _0x5efbd9=typeof _0x43969c[_0xfcf5('0x23')]===_0xfcf5('0x24')&&typeof _0x43969c[_0xfcf5('0x25')]===_0xfcf5('0x24');var _0x1e4aa0=_0x3dd71e[_0xfcf5('0x26')];var _0x4d4c4f=_0x5efbd9?0x0:_0x43969c['offset'];var _0x4491ea=_0x5efbd9?_0x3dd71e[_0xfcf5('0x26')]:_0x43969c[_0xfcf5('0x23')]+_0x43969c['limit'];var _0x4729b6;if(_0x4491ea>=_0x1e4aa0){_0x4491ea=_0x1e4aa0;_0x4729b6=0xc8;}else{_0x4729b6=0xce;}_0x1f68be[_0xfcf5('0x20')](_0x4729b6);return _0x1f68be[_0xfcf5('0x27')]('Content-Range',_0x4d4c4f+'-'+_0x4491ea+'/'+_0x1e4aa0)[_0xfcf5('0x22')](_0x3dd71e);}return null;};}function patchUpdates(_0x2d1502){return function(_0x19fe3b){try{jsonpatch[_0xfcf5('0x28')](_0x19fe3b,_0x2d1502,!![]);}catch(_0xc25dfe){return BPromise[_0xfcf5('0x29')](_0xc25dfe);}return _0x19fe3b['save']();};}function saveUpdates(_0x587e8e,_0x4befef){return function(_0x4d35f5){if(_0x4d35f5){return _0x4d35f5['update'](_0x587e8e)[_0xfcf5('0x2a')](function(_0x1eb8b8){return _0x1eb8b8;});}return null;};}function removeEntity(_0x436ac5,_0x492d4f){return function(_0x70c5ff){if(_0x70c5ff){return _0x70c5ff[_0xfcf5('0x2b')]()['then'](function(){_0x436ac5['status'](0xcc)[_0xfcf5('0x21')]();});}};}function handleEntityNotFound(_0x24c194,_0x5d4c92){return function(_0x43f5b7){if(!_0x43f5b7){_0x24c194[_0xfcf5('0x1f')](0x194);}return _0x43f5b7;};}function handleError(_0xec6934,_0x597de4){_0x597de4=_0x597de4||0x1f4;return function(_0xdb9f0c){logger['error'](_0xdb9f0c['stack']);if(_0xdb9f0c[_0xfcf5('0x2c')]){delete _0xdb9f0c[_0xfcf5('0x2c')];}_0xec6934[_0xfcf5('0x20')](_0x597de4)[_0xfcf5('0x2d')](_0xdb9f0c);};}function getInteractionUsers(_0x1362f9,_0x5d3060){return new BPromise(function(_0x22ce6c,_0x5ceec8){try{if(_0x5d3060[_0x1362f9['id']]){_0x1362f9['Users']=_[_0xfcf5('0x2e')](_0x5d3060[_0x1362f9['id']],function(_0x40d0aa){return{'id':_0x40d0aa['id'],'fullname':_0x40d0aa['fullname']};});}}catch(_0x1bf046){_0x5ceec8(_0x1bf046);}_0x22ce6c(_0x1362f9);});}function getInteractionTags(_0x40482b,_0x1db199){return new BPromise(function(_0x1b0e4a,_0x5cd7f5){try{if(_0x40482b['TagIds']){_0x40482b[_0xfcf5('0x2f')]=[];_0x40482b[_0xfcf5('0x30')][_0xfcf5('0x31')](',')[_0xfcf5('0x32')](function(_0x5ceb05){_0x40482b[_0xfcf5('0x2f')][_0xfcf5('0x33')](_0x1db199[_0x5ceb05]);});}delete _0x40482b[_0xfcf5('0x30')];}catch(_0x4a6b33){_0x5cd7f5(_0x4a6b33);}_0x1b0e4a(_0x40482b);});}function updateSmsInteraction(_0x416caa,_0x2a689b,_0x45e1d9){return new BPromise(function(_0x2a6c78,_0x50aa26){return getInteractionUsers(_0x416caa,_0x45e1d9)['then'](function(_0x5c5d55){return getInteractionTags(_0x5c5d55,_0x2a689b);})[_0xfcf5('0x2a')](function(_0x4ddbe5){_0x2a6c78(_0x4ddbe5);})['catch'](function(_0x5d681d){_0x50aa26(_0x5d681d);});});}exports[_0xfcf5('0x34')]=function(_0x282d59,_0x9ae8d1){var _0x487745={},_0x54a4b3={},_0x34b714={'count':0x0,'rows':[]};var _0x4abb7d=_[_0xfcf5('0x2e')](db[_0xfcf5('0x35')][_0xfcf5('0x36')],function(_0x76f666){return{'name':_0x76f666[_0xfcf5('0x37')],'type':_0x76f666[_0xfcf5('0x38')]['key']};});_0x54a4b3['model']=_['map'](_0x4abb7d,_0xfcf5('0x2c'));_0x54a4b3[_0xfcf5('0x39')]=_[_0xfcf5('0x3a')](_0x282d59['query']);_0x54a4b3[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x54a4b3[_0xfcf5('0x3d')],_0x54a4b3[_0xfcf5('0x39')]);_0x487745[_0xfcf5('0x3e')]=_[_0xfcf5('0x3c')](_0x54a4b3[_0xfcf5('0x3d')],qs['fields'](_0x282d59[_0xfcf5('0x39')]['fields']));_0x487745[_0xfcf5('0x3e')]=_0x487745['attributes'][_0xfcf5('0x3f')]?_0x487745[_0xfcf5('0x3e')]:_0x54a4b3['model'];if(!_0x282d59['query'][_0xfcf5('0x40')](_0xfcf5('0x41'))){_0x487745[_0xfcf5('0x25')]=qs['limit'](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x25')]);_0x487745[_0xfcf5('0x23')]=qs['offset'](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x23')]);}_0x487745['order']=qs[_0xfcf5('0x42')](_0x282d59['query'][_0xfcf5('0x42')]);_0x487745['where']=qs[_0xfcf5('0x3b')](_[_0xfcf5('0x43')](_0x282d59['query'],_0x54a4b3[_0xfcf5('0x3b')]),_0x4abb7d);var _0x2092e0=[];var _0x16cd88=squel[_0xfcf5('0x44')]()[_0xfcf5('0x45')]('id')['field'](_0xfcf5('0x2c'))[_0xfcf5('0x45')](_0xfcf5('0x46'))['from'](_0xfcf5('0x47'));var _0x8a79df=squel[_0xfcf5('0x44')]()['field'](_0xfcf5('0x48'))[_0xfcf5('0x45')](_0xfcf5('0x49'))[_0xfcf5('0x45')](_0xfcf5('0x4a'))[_0xfcf5('0x4b')](_0xfcf5('0x4c'),'ui')[_0xfcf5('0x4d')]('users','u',_0xfcf5('0x4e'));var _0x27514b=squel[_0xfcf5('0x44')]()[_0xfcf5('0x4b')]('sms_interactions','i')['left_join'](_0xfcf5('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xfcf5('0x50'),'o',_0xfcf5('0x51'))[_0xfcf5('0x4d')](_0xfcf5('0x52'),'a',_0xfcf5('0x53'))[_0xfcf5('0x4d')](_0xfcf5('0x54'),'me',_0xfcf5('0x55'))['left_join']('sms_interaction_has_tags','it',_0xfcf5('0x56'))['left_join'](_0xfcf5('0x47'),'t',_0xfcf5('0x57'));var _0x504e1c=squel[_0xfcf5('0x58')]();var _0x234364=[];var _0x3d90cd=squel[_0xfcf5('0x58')]();var _0xa1efb9;if(_0x282d59['query'][_0xfcf5('0x59')]){_0xa1efb9=as[_0xfcf5('0x5a')](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x59')]);var _0x2a9dc4=_0xa1efb9[_0xfcf5('0x5b')];for(var _0x4e5f49=0x0;_0x4e5f49<_0xa1efb9[_0xfcf5('0x5c')][_0xfcf5('0x3f')];_0x4e5f49++){var _0x127383=_0xa1efb9[_0xfcf5('0x5c')][_0x4e5f49];var _0x1cc827='i';var _0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0x127383[_0xfcf5('0x45')]]);if(!_0x5290f6){switch(_0x127383[_0xfcf5('0x45')]){case _0xfcf5('0x5e'):if(_0x127383[_0xfcf5('0x5f')]==0x1){_0x27514b[_0xfcf5('0x60')]('`'+_0x127383[_0xfcf5('0x45')]+_0xfcf5('0x61'));}else{_0x27514b[_0xfcf5('0x60')]('`'+_0x127383[_0xfcf5('0x45')]+_0xfcf5('0x62'));}break;case _0xfcf5('0x63'):if(_0x127383[_0xfcf5('0x64')]==='$substring'){if(_0x127383['value'][_0xfcf5('0x31')]('\x20')[_0xfcf5('0x3f')]>0x1){_0x504e1c[_0x2a9dc4](_0xfcf5('0x65'),qs['getFullTextValue'](_0x127383[_0xfcf5('0x5f')]),null);}else{var _0x2dc4c4='%'+_0x127383[_0xfcf5('0x5f')]+'%';_0x504e1c[_0x2a9dc4](_0xfcf5('0x66'),_0x2dc4c4,_0x2dc4c4,_0x2dc4c4);}}else{_0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0xfcf5('0x67')]);_0x127383[_0xfcf5('0x45')]=_0xfcf5('0x67');_0x4c643c=as[_0xfcf5('0x68')](_0x1cc827,_0x5290f6[_0xfcf5('0x38')],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c['value'][_0xfcf5('0x21')]);}break;case'Tag':var _0x3fafde=_0x127383[_0xfcf5('0x5f')][_0xfcf5('0x31')](',')[_0xfcf5('0x2e')](function(_0x3d2b11){return Number(_0x3d2b11);});_0x3fafde[_0xfcf5('0x32')](function(_0x57f991){_0x3d90cd['or'](_0xfcf5('0x6b'),'%,'+_0x57f991+',%');});_0x234364=_['union'](_0x234364,_0x3fafde);break;case _0xfcf5('0x6c'):if(_0x127383[_0xfcf5('0x64')]===_0xfcf5('0x6d')){_0x504e1c[_0x2a9dc4](_0xfcf5('0x6e'),'%'+_0x127383[_0xfcf5('0x5f')]+'%',null);}else{_0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0xfcf5('0x6f')]);_0x127383[_0xfcf5('0x45')]='UserId';_0x4c643c=as['buildExpression'](_0x1cc827,_0x5290f6['type'],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c[_0xfcf5('0x5f')][_0xfcf5('0x6a')],_0x4c643c['value']['end']);}break;case _0xfcf5('0x70'):_0x4c643c=as[_0xfcf5('0x68')]('me',null,_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c[_0xfcf5('0x5f')]['end']);break;}}else{var _0x4c643c=as[_0xfcf5('0x68')](_0x1cc827,_0x5290f6['type'],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c[_0xfcf5('0x5f')][_0xfcf5('0x21')]);}}}else{var _0xed261c=_(_0x282d59[_0xfcf5('0x39')])[_0xfcf5('0x3a')]()[_0xfcf5('0x2e')](function(_0x233812){return _[_0xfcf5('0x71')](_0x4abb7d,[_0xfcf5('0x2c'),_0x233812])?_0x233812:undefined;})[_0xfcf5('0x72')]()[_0xfcf5('0x5f')]();if(!_[_0xfcf5('0x73')](_0xed261c)){_0xed261c[_0xfcf5('0x32')](function(_0x4b66a9){if(_0x4b66a9===_0xfcf5('0x74')){_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x76'),[][_0xfcf5('0x77')](_0x282d59[_0xfcf5('0x39')][_0x4b66a9]));}else if(_0x4b66a9===_0xfcf5('0x78')){var _0x1cde82=JSON[_0xfcf5('0x79')](_0x282d59[_0xfcf5('0x39')][_0x4b66a9])[_0xfcf5('0x7a')];var _0xff4ac3=JSON['parse'](_0x282d59[_0xfcf5('0x39')][_0x4b66a9])[_0xfcf5('0x7b')];_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x7c'),_0x1cde82,_0xff4ac3);}else{if(_0x282d59[_0xfcf5('0x39')][_0x4b66a9]==='null'){_0x27514b[_0xfcf5('0x75')]('i.'+_0x4b66a9+'\x20IS\x20NULL');}else{_0x27514b[_0xfcf5('0x75')]('i.'+_0x4b66a9+_0xfcf5('0x7d'),_0x282d59[_0xfcf5('0x39')][_0x4b66a9]);}}});}if(_0x282d59[_0xfcf5('0x39')]['read']){if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x7e')]==0x1){_0x27514b[_0xfcf5('0x60')](_0xfcf5('0x7f'));}else{_0x27514b[_0xfcf5('0x60')](_0xfcf5('0x80'));}}if(_0x282d59['query'][_0xfcf5('0x81')]){_0x234364=_[_0xfcf5('0x82')](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x81')])?_0x282d59['query'][_0xfcf5('0x81')]:new Array(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x81')]);_0x234364['forEach'](function(_0x5e7e42){_0x3d90cd['or'](_0xfcf5('0x6b'),'%,'+_0x5e7e42+',%');});}if(_0x282d59[_0xfcf5('0x39')]['filter']){var _0x49968c=_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x83')][_0xfcf5('0x84')]('\x5c','\x5c\x5c')[_0xfcf5('0x84')](/'/g,'\x27\x27');if(qs[_0xfcf5('0x85')](_0x49968c)){_0x504e1c['or'](_0xfcf5('0x86'),_0x49968c+'%')['or'](_0xfcf5('0x87'),_0x49968c+'%');}else{_0x504e1c['or'](_0xfcf5('0x88'),qs[_0xfcf5('0x89')](_0x49968c))['or'](_0xfcf5('0x8a'),_0x49968c+'%');}}}_0x27514b['where'](_0x504e1c);_0x27514b[_0xfcf5('0x8b')]('i.id');var _0x538274={'type':db[_0xfcf5('0x8c')][_0xfcf5('0x8d')][_0xfcf5('0x8e')],'raw':!![]};var _0x610ac=_0x27514b['clone']();_0x610ac['field'](_0xfcf5('0x8f'));_0x610ac['field'](_0xfcf5('0x90'),_0xfcf5('0x5e'));if(_0x487745['order']){_0x487745[_0xfcf5('0x91')][_0xfcf5('0x32')](function(_0x548c6a){var _0x5505a0=_0x548c6a[0x0]==='contactName'?_0x548c6a[0x0]:'i.'+_0x548c6a[0x0];_0x27514b[_0xfcf5('0x91')](_0x5505a0,_0x548c6a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfcf5('0x73')](_0x234364)){_0x27514b[_0xfcf5('0x60')](_0x3d90cd);_0x610ac['where'](_0xfcf5('0x92'),_0x234364);}BPromise[_0xfcf5('0x93')]()[_0xfcf5('0x2a')](function(){if(!_0xa1efb9){if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x74')])return;_0x610ac[_0xfcf5('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x27514b[_0xfcf5('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x282d59[_0xfcf5('0x94')][_0xfcf5('0x95')]!=='agent')return;return _0x282d59[_0xfcf5('0x94')][_0xfcf5('0x96')]({'attributes':['id'],'raw':!![]})[_0xfcf5('0x2a')](function(_0x1c443f){if(_['isEmpty'](_0x1c443f)){_0x610ac[_0xfcf5('0x75')](_0xfcf5('0x97'));_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x97'));}else{_0x610ac['where'](_0xfcf5('0x76'),_[_0xfcf5('0x2e')](_0x1c443f,'id'));_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x76'),_[_0xfcf5('0x2e')](_0x1c443f,'id'));}});})['then'](function(){if(_0x282d59[_0xfcf5('0x94')]['role']===_0xfcf5('0x98')&&!_0xa1efb9&&!_0x282d59[_0xfcf5('0x39')]['SmsAccountId'])return[];return db['sequelize']['query'](_0x610ac['toString'](),_0x538274);})['then'](function(_0x34beff){_0x34b714[_0xfcf5('0x26')]=_0x34beff[_0xfcf5('0x3f')];if(_0x34b714[_0xfcf5('0x26')]===0x0)return[];return db['sequelize'][_0xfcf5('0x39')](_0x16cd88['toString'](),_0x538274)['then'](function(_0x265da3){_0x2092e0=_[_0xfcf5('0x99')](_0x265da3,'id');_0x538274=_[_0xfcf5('0x9a')](_0x538274,{'model':db[_0xfcf5('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x9b')]){_0x487745[_0xfcf5('0x3e')][_0xfcf5('0x32')](function(_0x1d9817){_0x27514b[_0xfcf5('0x45')]('i.'+_0x1d9817);});}else{_0x27514b[_0xfcf5('0x45')](_0xfcf5('0x90'),'unreadMessages');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0x9c'),_0xfcf5('0x9d'));_0x27514b['field'](_0xfcf5('0x9e'),_0xfcf5('0x9f'));_0x27514b['field'](_0xfcf5('0xa0'),_0xfcf5('0xa1'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa2'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa3'),_0xfcf5('0xa4'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa5'),_0xfcf5('0xa6'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa7'),_0xfcf5('0xa8'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa9'),'Contact.phone');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xaa'),'Contact.mobile');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xab'),_0xfcf5('0xac'));_0x27514b['field'](_0xfcf5('0xad'),'Owner.fullname');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xae'),_0xfcf5('0xaf'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xb0'),_0xfcf5('0x30'));}if(_0x487745[_0xfcf5('0x25')])_0x27514b['limit'](_0x487745['limit']);if(_0x487745['offset'])_0x27514b[_0xfcf5('0x23')](_0x487745[_0xfcf5('0x23')]);return db[_0xfcf5('0xb1')][_0xfcf5('0x39')](_0x27514b[_0xfcf5('0xb2')](),_0x538274);})[_0xfcf5('0x2a')](function(_0x981360){if(_0x981360[_0xfcf5('0x3f')]>0x0)_0x8a79df['where'](_0xfcf5('0xb3'),_[_0xfcf5('0x2e')](_0x981360,'id'));return db['sequelize'][_0xfcf5('0x39')](_0x8a79df[_0xfcf5('0xb2')](),_0x538274)[_0xfcf5('0x2a')](function(_0x3035c4){var _0x11da02=_[_0xfcf5('0xb4')](_0x3035c4,_0xfcf5('0xb5'));var _0x45ba07=[];_0x981360[_0xfcf5('0x32')](function(_0xe6eb0d){_0x45ba07['push'](updateSmsInteraction(_0xe6eb0d,_0x2092e0,_0x11da02));});return BPromise['all'](_0x45ba07);});});})['then'](function(_0x19ffa0){_0x34b714[_0xfcf5('0xb6')]=_0x19ffa0;return _0x34b714;})[_0xfcf5('0x2a')](respondWithFilteredResult(_0x9ae8d1,_0x487745))[_0xfcf5('0xb7')](handleError(_0x9ae8d1,null));};exports[_0xfcf5('0xb8')]=function(_0x4f39b0,_0x27719a){var _0x336d5d={'raw':![],'where':{'id':_0x4f39b0[_0xfcf5('0xb9')]['id']}},_0x3e2221={};_0x3e2221[_0xfcf5('0x3d')]=_[_0xfcf5('0x3a')](db[_0xfcf5('0x35')][_0xfcf5('0x36')]);_0x3e2221[_0xfcf5('0x39')]=_[_0xfcf5('0x3a')](_0x4f39b0[_0xfcf5('0x39')]);_0x3e2221[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x3e2221[_0xfcf5('0x3d')],_0x3e2221['query']);_0x336d5d[_0xfcf5('0x3e')]=_['intersection'](_0x3e2221[_0xfcf5('0x3d')],qs[_0xfcf5('0x9b')](_0x4f39b0[_0xfcf5('0x39')]['fields']));_0x336d5d[_0xfcf5('0x3e')]=_0x336d5d[_0xfcf5('0x3e')][_0xfcf5('0x3f')]?_0x336d5d[_0xfcf5('0x3e')]:_0x3e2221[_0xfcf5('0x3d')];if(_0x4f39b0['query'][_0xfcf5('0xba')]){_0x336d5d[_0xfcf5('0xbb')]=[{'all':!![]}];}_0x336d5d=_[_0xfcf5('0x9a')]({},_0x336d5d,_0x4f39b0[_0xfcf5('0xbc')]);return db[_0xfcf5('0x35')][_0xfcf5('0x5d')](_0x336d5d)['then'](handleEntityNotFound(_0x27719a,null))[_0xfcf5('0x2a')](respondWithResult(_0x27719a,null))['catch'](handleError(_0x27719a,null));};exports[_0xfcf5('0xbd')]=function(_0xdd8763,_0x2153bd){return db[_0xfcf5('0x35')][_0xfcf5('0xbd')](_0xdd8763['body'],{})[_0xfcf5('0x2a')](respondWithResult(_0x2153bd,0xc9))['catch'](handleError(_0x2153bd,null));};exports[_0xfcf5('0xbe')]=function(_0x5d33e2,_0x5ef6af){if(_0x5d33e2[_0xfcf5('0x70')]['id']){delete _0x5d33e2[_0xfcf5('0x70')]['id'];}return db[_0xfcf5('0x35')]['find']({'where':{'id':_0x5d33e2[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x5ef6af,null))[_0xfcf5('0x2a')](saveUpdates(_0x5d33e2[_0xfcf5('0x70')],null))[_0xfcf5('0x2a')](respondWithResult(_0x5ef6af,null))[_0xfcf5('0xb7')](handleError(_0x5ef6af,null));};exports[_0xfcf5('0x2b')]=function(_0x3211da,_0x184425){return db['SmsInteraction']['find']({'where':{'id':_0x3211da[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x184425,null))[_0xfcf5('0x2a')](removeEntity(_0x184425,null))[_0xfcf5('0xb7')](handleError(_0x184425,null));};exports[_0xfcf5('0xbf')]=function(_0x22a931,_0x48e0b3){return db[_0xfcf5('0x35')]['describe']()[_0xfcf5('0x2a')](respondWithResult(_0x48e0b3,null))[_0xfcf5('0xb7')](handleError(_0x48e0b3,null));};exports[_0xfcf5('0xc0')]=function(_0x10754f,_0x46efac,_0x3a5714){return db[_0xfcf5('0xc1')][_0xfcf5('0x5d')]({'where':{'id':_0x10754f['params']['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x46efac,null))[_0xfcf5('0x2a')](function(_0xf1b0ef){if(_0xf1b0ef){return _0xf1b0ef[_0xfcf5('0xc0')](_0x10754f['body']['ids'],_[_0xfcf5('0xc2')](_0x10754f[_0xfcf5('0x70')],[_0xfcf5('0xc3'),'id'])||{});}})[_0xfcf5('0x2a')](respondWithResult(_0x46efac,null))[_0xfcf5('0xb7')](handleError(_0x46efac,null));};exports[_0xfcf5('0xc4')]=function(_0x294734,_0x5812f9,_0x4ec187){var _0x1873e9={'raw':![],'where':{}};var _0x2dd177={};var _0x26cc25={'count':0x0,'rows':[]};return db[_0xfcf5('0x35')]['findOne']({'where':{'id':_0x294734[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x5812f9,null))[_0xfcf5('0x2a')](function(_0x43fd77){if(_0x43fd77){_0x2dd177[_0xfcf5('0x3d')]=_[_0xfcf5('0x3a')](db[_0xfcf5('0xc1')][_0xfcf5('0x36')]);_0x2dd177['query']=_[_0xfcf5('0x3a')](_0x294734[_0xfcf5('0x39')]);_0x2dd177[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x2dd177['model'],_0x2dd177['query']);_0x1873e9[_0xfcf5('0x3e')]=_[_0xfcf5('0x3c')](_0x2dd177[_0xfcf5('0x3d')],qs[_0xfcf5('0x9b')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x9b')]));_0x1873e9[_0xfcf5('0x3e')]=_0x1873e9[_0xfcf5('0x3e')][_0xfcf5('0x3f')]?_0x1873e9['attributes']:_0x2dd177[_0xfcf5('0x3d')];if(!_0x294734[_0xfcf5('0x39')][_0xfcf5('0x40')](_0xfcf5('0x41'))){_0x1873e9[_0xfcf5('0x25')]=qs[_0xfcf5('0x25')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x25')]);_0x1873e9['offset']=qs['offset'](_0x294734['query'][_0xfcf5('0x23')]);}_0x1873e9[_0xfcf5('0x91')]=qs[_0xfcf5('0x42')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x42')]);_0x1873e9[_0xfcf5('0x75')]=qs['filters'](_[_0xfcf5('0x43')](_0x294734[_0xfcf5('0x39')],_0x2dd177['filters']));_0x1873e9[_0xfcf5('0x75')][_0xfcf5('0xb5')]=_0x43fd77['id'];if(_0x294734[_0xfcf5('0x39')][_0xfcf5('0x83')]){_0x1873e9[_0xfcf5('0x75')]=_[_0xfcf5('0x9a')](_0x1873e9[_0xfcf5('0x75')],{'$or':_['map'](_0x1873e9[_0xfcf5('0x3e')],function(_0x55736f){var _0x32aa90={};_0x32aa90[_0x55736f]={'$like':'%'+_0x294734[_0xfcf5('0x39')][_0xfcf5('0x83')]+'%'};return _0x32aa90;})});}if(_0x294734['query'][_0xfcf5('0x7a')]){var _0x1c9f14=_0x294734[_0xfcf5('0x39')][_0xfcf5('0x7a')]['split'](',');var _0x4df2ad={};_0x4df2ad[_0x1c9f14[0x0]]={'$gte':moment(_0x1c9f14[0x1])['format'](_0xfcf5('0xc5'))};_0x1873e9[_0xfcf5('0x75')]=_[_0xfcf5('0x9a')](_0x1873e9[_0xfcf5('0x75')],_0x4df2ad);}_0x1873e9=_[_0xfcf5('0x9a')]({},_0x1873e9,_0x294734[_0xfcf5('0xbc')]);return db[_0xfcf5('0xc1')][_0xfcf5('0x26')]({'where':_0x1873e9['where']})[_0xfcf5('0x2a')](function(_0x138d19){_0x26cc25[_0xfcf5('0x26')]=_0x138d19;if(_0x294734[_0xfcf5('0x39')][_0xfcf5('0xba')]){_0x1873e9[_0xfcf5('0xbb')]=[{'all':!![]}];}return db[_0xfcf5('0xc1')][_0xfcf5('0xc6')](_0x1873e9);})[_0xfcf5('0x2a')](function(_0xa08f6c){_0x26cc25['rows']=_0xa08f6c;return _0x26cc25;});}})[_0xfcf5('0x2a')](respondWithFilteredResult(_0x5812f9,_0x1873e9))[_0xfcf5('0xb7')](handleError(_0x5812f9,null));};exports[_0xfcf5('0xc7')]=function(_0x3dca25,_0x5e6b97,_0x1b6443){return db['SmsInteraction']['find']({'where':{'id':_0x3dca25[_0xfcf5('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5e6b97,null))[_0xfcf5('0x2a')](function(_0x162a11){if(_0x162a11){return _0x162a11[_0xfcf5('0xc8')](_0x3dca25[_0xfcf5('0x70')]['ids'],_[_0xfcf5('0xc2')](_0x3dca25['body'],[_0xfcf5('0xc3'),'id'])||{})[_0xfcf5('0xc9')](function(){return db[_0xfcf5('0xca')][_0xfcf5('0xc6')]({'attributes':['id',_0xfcf5('0x2c'),_0xfcf5('0x46')],'where':{'id':_0x3dca25[_0xfcf5('0x70')][_0xfcf5('0xc3')]}});})['then'](function(_0x29b7f6){socket[_0xfcf5('0xcb')](_0xfcf5('0xcc'),{'id':Number(_0x3dca25[_0xfcf5('0xb9')]['id']),'tags':_0x29b7f6||[]});return{'id':Number(_0x3dca25[_0xfcf5('0xb9')]['id']),'tags':_0x29b7f6||[]};});}})['then'](respondWithResult(_0x5e6b97,null))[_0xfcf5('0xb7')](handleError(_0x5e6b97,null));};exports['removeTags']=function(_0x4d3728,_0x2ce438,_0x5de7fe){return db[_0xfcf5('0x35')][_0xfcf5('0x5d')]({'where':{'id':_0x4d3728['params']['id']}})['then'](handleEntityNotFound(_0x2ce438,null))[_0xfcf5('0x2a')](function(_0x14e0f6){if(_0x14e0f6){return _0x14e0f6[_0xfcf5('0xcd')](_0x4d3728[_0xfcf5('0x39')][_0xfcf5('0xc3')]);}})['then'](respondWithStatusCode(_0x2ce438,null))[_0xfcf5('0xb7')](handleError(_0x2ce438,null));};exports['download']=function(_0x5667f0,_0x175ba7){var _0xd6be95=moment()['unix']()['toString']();var _0x265238=path[_0xfcf5('0xce')](config['root'],_0xfcf5('0xcf'),_0xfcf5('0xd0'),_0xfcf5('0xd1'));var _0x519ae3=path[_0xfcf5('0xce')](config[_0xfcf5('0xd2')],'server','files','attachments');var _0x179ed6=path['join'](_0x265238,_0xd6be95);var _0x55a27c=util[_0xfcf5('0xd3')]('transcript-%d-%s.zip',_0x5667f0[_0xfcf5('0xb9')]['id'],_0xd6be95);var _0x74618e=path[_0xfcf5('0xce')](_0x265238,_0x55a27c);var _0x19c7b9=[];_0x19c7b9[_0xfcf5('0x33')]({'model':db['User'],'as':_0xfcf5('0x6c'),'attributes':['id',_0xfcf5('0xd4')],'raw':!![]});_0x19c7b9['push']({'model':db[_0xfcf5('0xd5')],'as':_0xfcf5('0x63'),'attributes':['id',_0xfcf5('0xd6'),_0xfcf5('0xd7')],'raw':!![]});var _0x9b32e2=[{'model':db[_0xfcf5('0xc1')],'as':_0xfcf5('0xd8'),'attributes':['id',_0xfcf5('0x70'),_0xfcf5('0x78'),_0xfcf5('0xd9'),_0xfcf5('0xda'),_0xfcf5('0x7e')],'include':_0x19c7b9}];_0x9b32e2['push']({'model':db[_0xfcf5('0xdb')],'as':_0xfcf5('0xdc'),'attributes':['id','name']});_0x9b32e2['push']({'model':db[_0xfcf5('0x6c')],'as':_0xfcf5('0xdd'),'attributes':['id',_0xfcf5('0xd4')]});return db[_0xfcf5('0x35')][_0xfcf5('0x5d')]({'where':{'id':_0x5667f0[_0xfcf5('0xb9')]['id']},'include':_0x9b32e2})[_0xfcf5('0x2a')](handleEntityNotFound(_0x175ba7,null))[_0xfcf5('0x2a')](function(_0x488b72){if(_0x488b72){var _0x1720dc=_0x488b72[_0xfcf5('0xde')]({'plain':!![]});fs[_0xfcf5('0xdf')](_0x179ed6);var _0x4771dd={'channel':'Sms','account':_0x1720dc[_0xfcf5('0xdc')][_0xfcf5('0x2c')],'agent':_0x1720dc['Owner']?_0x1720dc[_0xfcf5('0xdd')][_0xfcf5('0xd4')]:_0xfcf5('0xe0'),'createdAt':moment(_0x1720dc['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xfcf5('0xb2')](),'closedAt':_0x1720dc[_0xfcf5('0xe1')]?moment(_0x1720dc[_0xfcf5('0xe2')])[_0xfcf5('0xd3')](_0xfcf5('0xc5'))[_0xfcf5('0xb2')]():'','disposition':_0x1720dc[_0xfcf5('0xe3')],'messages':_(_0x1720dc[_0xfcf5('0xd8')])[_0xfcf5('0x83')]({'secret':![]})[_0xfcf5('0x2e')](function(_0x292a21){return{'date':moment(_0x292a21['createdAt'])[_0xfcf5('0xd3')](_0xfcf5('0xc5'))[_0xfcf5('0xb2')](),'sender':_0x292a21[_0xfcf5('0xd9')]===_0xfcf5('0xe4')?_0x292a21[_0xfcf5('0x6c')]?_0x292a21[_0xfcf5('0x6c')][_0xfcf5('0xd4')]:_0xfcf5('0xe5'):_0x292a21[_0xfcf5('0x63')][_0xfcf5('0xd6')]+(_0x292a21[_0xfcf5('0x63')]['lastName']?'\x20'+_0x292a21[_0xfcf5('0x63')][_0xfcf5('0xd7')]:''),'body':_0x292a21[_0xfcf5('0x70')],'direction':_0x292a21[_0xfcf5('0xd9')]===_0xfcf5('0xe4')?'A':'C','secret':_0x292a21[_0xfcf5('0xda')],'read':_0x292a21[_0xfcf5('0x7e')]};})['value']()};return ejs[_0xfcf5('0xe6')](path[_0xfcf5('0xce')](config[_0xfcf5('0xd2')],_0xfcf5('0xcf'),'views',_0xfcf5('0xe7')),{'interaction':_0x4771dd})[_0xfcf5('0x2a')](function(_0x2f5fad){var _0x341686=path[_0xfcf5('0xce')](_0x179ed6,_0xfcf5('0xe8')+_0x1720dc['id']+'-'+_0xd6be95+'.pdf');var _0x41320b={'path':_0x341686,'channel':_0xfcf5('0xe9'),'interactionId':_0x1720dc['id']};return pdf[_0xfcf5('0xea')](_0x2f5fad,_0x41320b);})[_0xfcf5('0x2a')](function(){return new BPromise(function(_0x413962,_0x2a6dd0){zipdir(_0x179ed6,{'saveTo':_0x74618e},function(_0x2ff14c,_0x5706d9){if(_0x2ff14c)return _0x2a6dd0(_0x2ff14c);return _0x413962(_0x5706d9);});})[_0xfcf5('0x2a')](function(){return new BPromise(function(_0x29b92f,_0x351560){rimraf(_0x179ed6,function(_0x5e15d4){if(_0x5e15d4)_0x351560(_0x5e15d4);return _0x29b92f();});});})['then'](function(){return _0x175ba7[_0xfcf5('0xeb')](_0x74618e,_0x55a27c,function(_0x3f8b7e){if(_0x3f8b7e){console['log'](_0xfcf5('0xec'),_0x3f8b7e);}else{fs[_0xfcf5('0xed')](_0x74618e);}});});});}else{return _0x175ba7[_0xfcf5('0x1f')](0xc8);}})['catch'](handleError(_0x175ba7,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ee3dbb2..3231c7f 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 _0x32b6=['exports','events','../../mysqldb','SmsMessage','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x21e590,_0xabe65b){var _0x27fa65=function(_0x91be70){while(--_0x91be70){_0x21e590['push'](_0x21e590['shift']());}};_0x27fa65(++_0xabe65b);}(_0x32b6,0x1d1));var _0x632b=function(_0xcd2be,_0xa083a4){_0xcd2be=_0xcd2be-0x0;var _0x478ed6=_0x32b6[_0xcd2be];return _0x478ed6;};'use strict';var EventEmitter=require(_0x632b('0x0'));var SmsInteraction=require(_0x632b('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x632b('0x1'))['db'][_0x632b('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x632b('0x3'),'afterDestroy':_0x632b('0x4')};function emitEvent(_0x3ba3a7){return function(_0x3a0e0e,_0x1adfe6,_0x122768){_0x3a0e0e[_0x632b('0x5')]({'attributes':['id'],'raw':!![]})[_0x632b('0x6')](function(_0x3bbf43){_0x3a0e0e[_0x632b('0x7')]('Users',_0x3bbf43[_0x632b('0x8')](function(_0x173270){return{'id':_0x173270['id']};}));return SmsMessage[_0x632b('0x9')]({'where':{'SmsInteractionId':_0x3a0e0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x632b('0x6')](function(_0x4961b1){_0x3a0e0e['setDataValue']('unreadMessages',_0x4961b1[_0x632b('0xa')]);SmsInteractionEvents['emit'](_0x3ba3a7+':'+_0x3a0e0e['id'],_0x3a0e0e);SmsInteractionEvents[_0x632b('0xb')](_0x3ba3a7,_0x3a0e0e);_0x122768(null);})[_0x632b('0xc')](_0x122768(null));};}for(var e in events){if(events[_0x632b('0xd')](e)){var event=events[e];SmsInteraction[_0x632b('0xe')](e,emitEvent(event));}}module[_0x632b('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x5204=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x57d225,_0xc0ebf6){var _0x23f7e5=function(_0x458e8e){while(--_0x458e8e){_0x57d225['push'](_0x57d225['shift']());}};_0x23f7e5(++_0xc0ebf6);}(_0x5204,0xdf));var _0x4520=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x5204[_0x2adfb1];return _0xa52d45;};'use strict';var EventEmitter=require(_0x4520('0x0'));var SmsInteraction=require(_0x4520('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4520('0x1'))['db'][_0x4520('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4520('0x3')](0x0);var events={'afterCreate':_0x4520('0x4'),'afterUpdate':_0x4520('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41d89c){return function(_0x58b8a8,_0x180174,_0x209381){_0x58b8a8[_0x4520('0x6')]({'attributes':['id'],'raw':!![]})[_0x4520('0x7')](function(_0x396d29){_0x58b8a8[_0x4520('0x8')](_0x4520('0x9'),_0x396d29['map'](function(_0x297f0a){return{'id':_0x297f0a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x58b8a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4520('0x7')](function(_0x37a617){_0x58b8a8[_0x4520('0x8')](_0x4520('0xa'),_0x37a617[_0x4520('0xb')]);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c+':'+_0x58b8a8['id'],_0x58b8a8);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c,_0x58b8a8);_0x209381(null);})[_0x4520('0xd')](_0x209381(null));};}for(var e in events){if(events[_0x4520('0xe')](e)){var event=events[e];SmsInteraction[_0x4520('0xf')](e,emitEvent(event));}}module[_0x4520('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 7e5e3c2..169a0c5 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 _0xcb42=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','SmsInteraction','changed'];(function(_0x10f059,_0xb56fdd){var _0x4ab4ed=function(_0x4419b9){while(--_0x4419b9){_0x10f059['push'](_0x10f059['shift']());}};_0x4ab4ed(++_0xb56fdd);}(_0xcb42,0x1b7));var _0x2cb4=function(_0x3bf4d5,_0x366a37){_0x3bf4d5=_0x3bf4d5-0x0;var _0x48fdea=_0xcb42[_0x3bf4d5];return _0x48fdea;};'use strict';var _=require(_0x2cb4('0x0'));var util=require(_0x2cb4('0x1'));var logger=require(_0x2cb4('0x2'))(_0x2cb4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cb4('0x4'));var rimraf=require(_0x2cb4('0x5'));var config=require(_0x2cb4('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x2cb4('0x7')]=function(_0x592048,_0x283bcd){return _0x592048[_0x2cb4('0x8')](_0x2cb4('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e6db9,_0x51142c,_0x33869c){if(_0x4e6db9[_0x2cb4('0xa')](_0x2cb4('0xb'))){_0x4e6db9[_0x2cb4('0xc')]=moment()[_0x2cb4('0xd')](_0x2cb4('0xe'));}_0x33869c(null,_0x4e6db9);}}});}; \ No newline at end of file +var _0x7397=['sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsInteraction.attributes','SmsInteraction'];(function(_0x3022dd,_0x470d35){var _0x28647a=function(_0xff47be){while(--_0xff47be){_0x3022dd['push'](_0x3022dd['shift']());}};_0x28647a(++_0x470d35);}(_0x7397,0x162));var _0x7739=function(_0x2e527e,_0x282675){_0x2e527e=_0x2e527e-0x0;var _0x1f80aa=_0x7397[_0x2e527e];return _0x1f80aa;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var logger=require(_0x7739('0x2'))(_0x7739('0x3'));var moment=require(_0x7739('0x4'));var BPromise=require('bluebird');var rp=require(_0x7739('0x5'));var fs=require('fs');var path=require(_0x7739('0x6'));var rimraf=require(_0x7739('0x7'));var config=require('../../config/environment');var attributes=require(_0x7739('0x8'));module['exports']=function(_0x5a0802,_0x365d68){return _0x5a0802['define'](_0x7739('0x9'),attributes,{'tableName':_0x7739('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x70a86c,_0x6002,_0x123b33){if(_0x70a86c['changed'](_0x7739('0xb'))){_0x70a86c[_0x7739('0xc')]=moment()['format'](_0x7739('0xd'));}_0x123b33(null,_0x70a86c);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a7ca0d9..f35ff01 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 _0x451e=['SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','raw','options','where','limit','debug','find','addTags','body','ids','omit','AddTags','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./smsInteraction.socket','register','request','then','info'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x451e,0x1c4));var _0xe451=function(_0x541aa1,_0x518c74){_0x541aa1=_0x541aa1-0x0;var _0x3e82b0=_0x451e[_0x541aa1];return _0x3e82b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe451('0x0'));var BPromise=require(_0xe451('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe451('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe451('0x3'))(_0xe451('0x4'));var config=require(_0xe451('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe451('0x6')][_0xe451('0x7')]({'port':0x232a});config['redis']=_[_0xe451('0x8')](config[_0xe451('0x9')],{'host':_0xe451('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe451('0x9')]));require(_0xe451('0xb'))[_0xe451('0xc')](socket);function respondWithRpcPromise(_0x5de0b8,_0x2d5c78,_0x1bacc7){return new BPromise(function(_0x421a3a,_0x2b5bd9){return client[_0xe451('0xd')](_0x5de0b8,_0x1bacc7)[_0xe451('0xe')](function(_0x219bd9){logger[_0xe451('0xf')](_0xe451('0x10'),_0x2d5c78,'request\x20sent');logger['debug'](_0xe451('0x11'),_0x2d5c78,_0xe451('0x12'),JSON[_0xe451('0x13')](_0x219bd9));if(_0x219bd9[_0xe451('0x14')]){if(_0x219bd9[_0xe451('0x14')][_0xe451('0x15')]===0x1f4){logger[_0xe451('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2d5c78,_0x219bd9[_0xe451('0x14')][_0xe451('0x16')]);return _0x2b5bd9(_0x219bd9[_0xe451('0x14')][_0xe451('0x16')]);}logger[_0xe451('0x14')](_0xe451('0x10'),_0x2d5c78,_0x219bd9[_0xe451('0x14')]['message']);return _0x421a3a(_0x219bd9[_0xe451('0x14')]['message']);}else{logger['info'](_0xe451('0x10'),_0x2d5c78,_0xe451('0x12'));_0x421a3a(_0x219bd9[_0xe451('0x17')][_0xe451('0x16')]);}})[_0xe451('0x18')](function(_0x1f2d13){logger[_0xe451('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2d5c78,_0x1f2d13);_0x2b5bd9(_0x1f2d13);});});}exports[_0xe451('0x19')]=function(_0x1da493){var _0x8c4870=this;return new Promise(function(_0x592946,_0x5e5ba5){return db[_0xe451('0x1a')][_0xe451('0x1b')](_0x1da493['body'],{'raw':_0x1da493['options']?_0x1da493['options'][_0xe451('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1da493[_0xe451('0x1d')]?_0x1da493[_0xe451('0x1d')][_0xe451('0x1e')]||null:null,'attributes':_0x1da493[_0xe451('0x1d')]?_0x1da493[_0xe451('0x1d')]['attributes']||null:null,'limit':_0x1da493[_0xe451('0x1d')]?_0x1da493['options'][_0xe451('0x1f')]||null:null})['then'](function(_0x2ed43f){logger['info']('UpdateSmsInteraction',_0x1da493);logger[_0xe451('0x20')](_0xe451('0x19'),_0x1da493,JSON['stringify'](_0x2ed43f));_0x592946(_0x2ed43f);})[_0xe451('0x18')](function(_0xd28f5f){logger['error'](_0xe451('0x19'),_0xd28f5f['message'],_0x1da493);_0x5e5ba5(_0x8c4870['error'](0x1f4,_0xd28f5f[_0xe451('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x2531f0){return new Promise(function(_0x4ecf83,_0x403af7){return db[_0xe451('0x1a')][_0xe451('0x21')]({'where':_0x2531f0[_0xe451('0x1d')]?_0x2531f0[_0xe451('0x1d')]['where']||null:null})[_0xe451('0xe')](function(_0x1dfbfb){if(_0x1dfbfb){return _0x1dfbfb[_0xe451('0x22')](_0x2531f0[_0xe451('0x23')][_0xe451('0x24')],_[_0xe451('0x25')](_0x2531f0[_0xe451('0x23')],[_0xe451('0x24'),'id'])||{});}})['spread'](function(_0x4fcc34){logger[_0xe451('0xf')](_0xe451('0x26'),_0x2531f0);logger[_0xe451('0x20')]('AddTags',_0x2531f0,JSON[_0xe451('0x13')](_0x4fcc34));_0x4ecf83(_0x4fcc34);})['catch'](function(_0x224a00){logger[_0xe451('0x14')](_0xe451('0x26'),_0x224a00[_0xe451('0x16')],_0x2531f0);_0x403af7(_this[_0xe451('0x14')](0x1f4,_0x224a00[_0xe451('0x16')]));});});}; \ No newline at end of file +var _0x8cf7=['message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x8cf7,0xcb));var _0x78cf=function(_0x47654c,_0x45c6f0){_0x47654c=_0x47654c-0x0;var _0x28004e=_0x8cf7[_0x47654c];return _0x28004e;};'use strict';var _=require(_0x78cf('0x0'));var util=require(_0x78cf('0x1'));var moment=require(_0x78cf('0x2'));var BPromise=require(_0x78cf('0x3'));var rs=require(_0x78cf('0x4'));var fs=require('fs');var Redis=require(_0x78cf('0x5'));var db=require(_0x78cf('0x6'))['db'];var utils=require(_0x78cf('0x7'));var logger=require(_0x78cf('0x8'))(_0x78cf('0x9'));var config=require('../../config/environment');var jayson=require(_0x78cf('0xa'));var client=jayson[_0x78cf('0xb')]['http']({'port':0x232a});config[_0x78cf('0xc')]=_[_0x78cf('0xd')](config[_0x78cf('0xc')],{'host':_0x78cf('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78cf('0xc')]));require(_0x78cf('0xf'))[_0x78cf('0x10')](socket);function respondWithRpcPromise(_0x55e87f,_0x34173e,_0x481468){return new BPromise(function(_0x5b37ba,_0x148d6d){return client[_0x78cf('0x11')](_0x55e87f,_0x481468)[_0x78cf('0x12')](function(_0x4b8591){logger[_0x78cf('0x13')](_0x78cf('0x14'),_0x34173e,_0x78cf('0x15'));logger[_0x78cf('0x16')](_0x78cf('0x17'),_0x34173e,_0x78cf('0x15'),JSON[_0x78cf('0x18')](_0x4b8591));if(_0x4b8591[_0x78cf('0x19')]){if(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1a')]===0x1f4){logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x4b8591['error'][_0x78cf('0x1b')]);return _0x148d6d(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);}logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);return _0x5b37ba(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);}else{logger[_0x78cf('0x13')](_0x78cf('0x14'),_0x34173e,_0x78cf('0x15'));_0x5b37ba(_0x4b8591[_0x78cf('0x1c')][_0x78cf('0x1b')]);}})[_0x78cf('0x1d')](function(_0x6b0c5e){logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x6b0c5e);_0x148d6d(_0x6b0c5e);});});}exports[_0x78cf('0x1e')]=function(_0xb0a2a5){var _0x52c8a8=this;return new Promise(function(_0x19aaa2,_0xa5a375){return db[_0x78cf('0x1f')][_0x78cf('0x20')](_0xb0a2a5[_0x78cf('0x21')],{'raw':_0xb0a2a5[_0x78cf('0x22')]?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0a2a5[_0x78cf('0x22')]?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x24')]||null:null,'attributes':_0xb0a2a5['options']?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x25')]||null:null,'limit':_0xb0a2a5['options']?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x26')]||null:null})[_0x78cf('0x12')](function(_0x7e0157){logger[_0x78cf('0x13')](_0x78cf('0x1e'),_0xb0a2a5);logger[_0x78cf('0x16')](_0x78cf('0x1e'),_0xb0a2a5,JSON[_0x78cf('0x18')](_0x7e0157));_0x19aaa2(_0x7e0157);})[_0x78cf('0x1d')](function(_0x43d314){logger[_0x78cf('0x19')](_0x78cf('0x1e'),_0x43d314[_0x78cf('0x1b')],_0xb0a2a5);_0xa5a375(_0x52c8a8[_0x78cf('0x19')](0x1f4,_0x43d314[_0x78cf('0x1b')]));});});};exports[_0x78cf('0x27')]=function(_0x5b0f9d){return new Promise(function(_0x13ecf0,_0x50b8fb){return db[_0x78cf('0x1f')][_0x78cf('0x28')]({'where':_0x5b0f9d['options']?_0x5b0f9d[_0x78cf('0x22')][_0x78cf('0x24')]||null:null})[_0x78cf('0x12')](function(_0x3a91b3){if(_0x3a91b3){return _0x3a91b3[_0x78cf('0x29')](_0x5b0f9d['body'][_0x78cf('0x2a')],_[_0x78cf('0x2b')](_0x5b0f9d['body'],[_0x78cf('0x2a'),'id'])||{});}})[_0x78cf('0x2c')](function(_0x413dee){logger['info'](_0x78cf('0x2d'),_0x5b0f9d);logger[_0x78cf('0x16')](_0x78cf('0x2d'),_0x5b0f9d,JSON[_0x78cf('0x18')](_0x413dee));_0x13ecf0(_0x413dee);})[_0x78cf('0x1d')](function(_0x48872d){logger[_0x78cf('0x19')](_0x78cf('0x2d'),_0x48872d['message'],_0x5b0f9d);_0x50b8fb(_this[_0x78cf('0x19')](0x1f4,_0x48872d[_0x78cf('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2df0d86..b316e42 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 _0x10ab=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x16927e,_0x536f35){var _0x1d8cab=function(_0xf3b6c6){while(--_0xf3b6c6){_0x16927e['push'](_0x16927e['shift']());}};_0x1d8cab(++_0x536f35);}(_0x10ab,0x16b));var _0xb10a=function(_0x358bf3,_0x40ec1f){_0x358bf3=_0x358bf3-0x0;var _0x248106=_0x10ab[_0x358bf3];return _0x248106;};'use strict';var SmsInteractionEvents=require(_0xb10a('0x0'));var events=['save','remove',_0xb10a('0x1')];function createListener(_0x1599ea,_0x17e020){return function(_0xa9866){_0x17e020[_0xb10a('0x2')](_0x1599ea,_0xa9866);};}function removeListener(_0x20f3ba,_0x3a706e){return function(){SmsInteractionEvents[_0xb10a('0x3')](_0x20f3ba,_0x3a706e);};}exports[_0xb10a('0x4')]=function(_0x423c1a){for(var _0xb2c850=0x0,_0x3fa37f=events[_0xb10a('0x5')];_0xb2c850<_0x3fa37f;_0xb2c850++){var _0xcb073f=events[_0xb2c850];var _0x269177=createListener(_0xb10a('0x6')+_0xcb073f,_0x423c1a);SmsInteractionEvents['on'](_0xcb073f,_0x269177);}}; \ No newline at end of file +var _0x2477=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x2477,0x1be));var _0x7247=function(_0x369534,_0x5557c4){_0x369534=_0x369534-0x0;var _0x524bf9=_0x2477[_0x369534];return _0x524bf9;};'use strict';var SmsInteractionEvents=require(_0x7247('0x0'));var events=[_0x7247('0x1'),_0x7247('0x2'),_0x7247('0x3')];function createListener(_0x1185b1,_0x50bf36){return function(_0x2988ad){_0x50bf36[_0x7247('0x4')](_0x1185b1,_0x2988ad);};}function removeListener(_0x75967a,_0x469d04){return function(){SmsInteractionEvents[_0x7247('0x5')](_0x75967a,_0x469d04);};}exports[_0x7247('0x6')]=function(_0x47fa88){for(var _0x391a64=0x0,_0x68986b=events[_0x7247('0x7')];_0x391a64<_0x68986b;_0x391a64++){var _0x450af1=events[_0x391a64];var _0x4d54ab=createListener(_0x7247('0x8')+_0x450af1,_0x47fa88);SmsInteractionEvents['on'](_0x450af1,_0x4d54ab);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 3dd9b62..44c4a19 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 _0xd6d8=['create','/:id/status','status','update','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create'];(function(_0x3b2ee8,_0x199c39){var _0x365ae8=function(_0x6c87e9){while(--_0x6c87e9){_0x3b2ee8['push'](_0x3b2ee8['shift']());}};_0x365ae8(++_0x199c39);}(_0xd6d8,0x1a8));var _0x8d6d=function(_0x15fc07,_0x41cc0c){_0x15fc07=_0x15fc07-0x0;var _0x3d2c0f=_0xd6d8[_0x15fc07];return _0x3d2c0f;};'use strict';var multer=require(_0x8d6d('0x0'));var util=require(_0x8d6d('0x1'));var path=require(_0x8d6d('0x2'));var timeout=require(_0x8d6d('0x3'));var express=require(_0x8d6d('0x4'));var router=express[_0x8d6d('0x5')]();var fs_extra=require(_0x8d6d('0x6'));var auth=require(_0x8d6d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8d6d('0x8'));var controller=require('./smsMessage.controller');router[_0x8d6d('0x9')]('/',auth['isAuthenticated'](),controller[_0x8d6d('0xa')]);router[_0x8d6d('0x9')]('/describe',auth[_0x8d6d('0xb')](),controller[_0x8d6d('0xc')]);router[_0x8d6d('0x9')](_0x8d6d('0xd'),auth[_0x8d6d('0xb')](),controller[_0x8d6d('0xe')]);router[_0x8d6d('0xf')]('/',auth[_0x8d6d('0xb')](),interaction['tracked'](_0x8d6d('0x10'),_0x8d6d('0x11')),controller[_0x8d6d('0x12')]);router[_0x8d6d('0xf')](_0x8d6d('0x13'),controller[_0x8d6d('0x14')]);router['put'](_0x8d6d('0xd'),auth[_0x8d6d('0xb')](),controller[_0x8d6d('0x15')]);router['put']('/:id/accept',auth[_0x8d6d('0xb')](),controller[_0x8d6d('0x16')]);router['put']('/:id/reject',auth[_0x8d6d('0xb')](),controller[_0x8d6d('0x17')]);router['delete'](_0x8d6d('0xd'),auth['isAuthenticated'](),controller[_0x8d6d('0x18')]);module[_0x8d6d('0x19')]=router; \ No newline at end of file +var _0x0344=['smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms'];(function(_0x7762d6,_0x1934b7){var _0x2627c3=function(_0x2fcf01){while(--_0x2fcf01){_0x7762d6['push'](_0x7762d6['shift']());}};_0x2627c3(++_0x1934b7);}(_0x0344,0x14b));var _0x4034=function(_0xe5851f,_0x4dec24){_0xe5851f=_0xe5851f-0x0;var _0x52a62d=_0x0344[_0xe5851f];return _0x52a62d;};'use strict';var multer=require(_0x4034('0x0'));var util=require(_0x4034('0x1'));var path=require('path');var timeout=require(_0x4034('0x2'));var express=require(_0x4034('0x3'));var router=express[_0x4034('0x4')]();var fs_extra=require(_0x4034('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4034('0x6'));var config=require('../../config/environment');var controller=require(_0x4034('0x7'));router[_0x4034('0x8')]('/',auth[_0x4034('0x9')](),controller[_0x4034('0xa')]);router[_0x4034('0x8')](_0x4034('0xb'),auth['isAuthenticated'](),controller[_0x4034('0xc')]);router['get'](_0x4034('0xd'),auth[_0x4034('0x9')](),controller[_0x4034('0xe')]);router[_0x4034('0xf')]('/',auth[_0x4034('0x9')](),interaction['tracked'](_0x4034('0x10'),_0x4034('0x11')),controller[_0x4034('0x12')]);router[_0x4034('0xf')](_0x4034('0x13'),controller[_0x4034('0x14')]);router[_0x4034('0x15')](_0x4034('0xd'),auth[_0x4034('0x9')](),controller[_0x4034('0x16')]);router[_0x4034('0x15')](_0x4034('0x17'),auth[_0x4034('0x9')](),controller[_0x4034('0x18')]);router[_0x4034('0x15')](_0x4034('0x19'),auth[_0x4034('0x9')](),controller[_0x4034('0x1a')]);router[_0x4034('0x1b')](_0x4034('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4034('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index fdf1662..73037ce 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 _0x58f0=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x6bd238,_0x43f7e6){var _0x4c9c63=function(_0x16c53f){while(--_0x16c53f){_0x6bd238['push'](_0x6bd238['shift']());}};_0x4c9c63(++_0x43f7e6);}(_0x58f0,0x1a6));var _0x058f=function(_0x4876da,_0x5a93a6){_0x4876da=_0x4876da-0x0;var _0x5594f0=_0x58f0[_0x4876da];return _0x5594f0;};'use strict';var Sequelize=require(_0x058f('0x0'));module[_0x058f('0x1')]={'body':{'type':Sequelize[_0x058f('0x2')](_0x058f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x058f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x058f('0x5')]('in',_0x058f('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x058f('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x058f('0x8')]},'secret':{'type':Sequelize[_0x058f('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x058f('0x7')]},'providerResponse':{'type':Sequelize[_0x058f('0x2')]}}; \ No newline at end of file +var _0x808f=['BOOLEAN','ENUM','out','STRING','exports','TEXT'];(function(_0x2694bd,_0x17ec8c){var _0x16d8e1=function(_0x4243e0){while(--_0x4243e0){_0x2694bd['push'](_0x2694bd['shift']());}};_0x16d8e1(++_0x17ec8c);}(_0x808f,0x1ea));var _0xf808=function(_0x414b18,_0x52bfdf){_0x414b18=_0x414b18-0x0;var _0x88d2d2=_0x808f[_0x414b18];return _0x88d2d2;};'use strict';var Sequelize=require('sequelize');module[_0xf808('0x0')]={'body':{'type':Sequelize[_0xf808('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf808('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf808('0x3')]('in','out'),'defaultValue':_0xf808('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf808('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xf808('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf808('0x5')]},'providerResponse':{'type':Sequelize[_0xf808('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 54a547f..4acaa93 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 _0x2dd8=['contact','User','agent','fullname','email','internal','SIP/%s','motionChannel','channel','event','accept','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','SmsMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','rows','params','find','create','body','update','describe','sms','readAt','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','user','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x82dd('0x0'));var rimraf=require(_0x82dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82dd('0x2'));var moment=require(_0x82dd('0x3'));var BPromise=require(_0x82dd('0x4'));var Mustache=require(_0x82dd('0x5'));var util=require(_0x82dd('0x6'));var path=require(_0x82dd('0x7'));var sox=require(_0x82dd('0x8'));var csv=require('to-csv');var ejs=require(_0x82dd('0x9'));var fs=require('fs');var fs_extra=require(_0x82dd('0xa'));var _=require(_0x82dd('0xb'));var squel=require(_0x82dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x82dd('0xd'));var deskjs=require(_0x82dd('0xe'));var toCsv=require(_0x82dd('0xf'));var querystring=require(_0x82dd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82dd('0x12'));var hardwareService=require(_0x82dd('0x13'));var logger=require(_0x82dd('0x14'))(_0x82dd('0x15'));var utils=require(_0x82dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x82dd('0x17'));var db=require(_0x82dd('0x18'))['db'];config[_0x82dd('0x19')]=_[_0x82dd('0x1a')](config[_0x82dd('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82dd('0x19')]));require(_0x82dd('0x1b'))[_0x82dd('0x1c')](socket);var jayson=require(_0x82dd('0x1d'));var client=jayson[_0x82dd('0x1e')][_0x82dd('0x1f')]({'port':0x232c});var client9002=jayson[_0x82dd('0x1e')][_0x82dd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x101eb7,_0x1b90e0,_0x3d7664,_0x466fd3){return new BPromise(function(_0x1bdd14,_0x51d2a9){var _0x352400=_0x466fd3||client;return _0x352400[_0x82dd('0x20')](_0x101eb7,_0x3d7664)[_0x82dd('0x21')](function(_0x40a47a){logger[_0x82dd('0x22')](_0x82dd('0x23'),_0x1b90e0,_0x82dd('0x24'));logger[_0x82dd('0x25')](_0x82dd('0x26'),_0x1b90e0,_0x82dd('0x24'),JSON[_0x82dd('0x27')](_0x40a47a));if(_0x40a47a[_0x82dd('0x28')]){if(_0x40a47a[_0x82dd('0x28')]['code']===0x1f4){logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);return _0x51d2a9(_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);}logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x40a47a['error']['message']);return _0x1bdd14(_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x1b90e0,_0x82dd('0x24'));_0x1bdd14(_0x40a47a[_0x82dd('0x2a')][_0x82dd('0x29')]);}})[_0x82dd('0x2b')](function(_0x4609c1){logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x4609c1);_0x51d2a9(_0x4609c1);});});}function respondWithStatusCode(_0x1374e3,_0x1ae382){_0x1ae382=_0x1ae382||0xcc;return function(_0x1d27f1){if(_0x1d27f1){return _0x1374e3[_0x82dd('0x2c')](_0x1ae382);}return _0x1374e3[_0x82dd('0x2d')](_0x1ae382)[_0x82dd('0x2e')]();};}function respondWithResult(_0x242e59,_0x5543c2){_0x5543c2=_0x5543c2||0xc8;return function(_0x17531e){if(_0x17531e){return _0x242e59[_0x82dd('0x2d')](_0x5543c2)[_0x82dd('0x2f')](_0x17531e);}};}function respondWithFilteredResult(_0x53965f,_0x15da13){return function(_0x5238a2){if(_0x5238a2){var _0x15f31f=typeof _0x15da13[_0x82dd('0x30')]===_0x82dd('0x31')&&typeof _0x15da13['limit']===_0x82dd('0x31');var _0x212720=_0x5238a2['count'];var _0x5cfdee=_0x15f31f?0x0:_0x15da13[_0x82dd('0x30')];var _0x3ae12a=_0x15f31f?_0x5238a2['count']:_0x15da13[_0x82dd('0x30')]+_0x15da13[_0x82dd('0x32')];var _0x2d2b7b;if(_0x3ae12a>=_0x212720){_0x3ae12a=_0x212720;_0x2d2b7b=0xc8;}else{_0x2d2b7b=0xce;}_0x53965f['status'](_0x2d2b7b);return _0x53965f[_0x82dd('0x33')](_0x82dd('0x34'),_0x5cfdee+'-'+_0x3ae12a+'/'+_0x212720)['json'](_0x5238a2);}return null;};}function patchUpdates(_0x571cfb){return function(_0x1b3c04){try{jsonpatch[_0x82dd('0x35')](_0x1b3c04,_0x571cfb,!![]);}catch(_0x50d230){return BPromise[_0x82dd('0x36')](_0x50d230);}return _0x1b3c04[_0x82dd('0x37')]();};}function saveUpdates(_0xac506c,_0x5af437){return function(_0x31e34c){if(_0x31e34c){return _0x31e34c['update'](_0xac506c)[_0x82dd('0x21')](function(_0x140d7b){return _0x140d7b;});}return null;};}function removeEntity(_0x4bec1e,_0x304284){return function(_0x40998a){if(_0x40998a){return _0x40998a[_0x82dd('0x38')]()[_0x82dd('0x21')](function(){_0x4bec1e['status'](0xcc)[_0x82dd('0x2e')]();});}};}function handleEntityNotFound(_0x2605f6,_0x38bbc9){return function(_0x2f57d9){if(!_0x2f57d9){_0x2605f6[_0x82dd('0x2c')](0x194);}return _0x2f57d9;};}function handleError(_0x24e0c5,_0x2b9c94){_0x2b9c94=_0x2b9c94||0x1f4;return function(_0x9173c8){logger['error'](_0x9173c8[_0x82dd('0x39')]);if(_0x9173c8['name']){delete _0x9173c8[_0x82dd('0x3a')];}_0x24e0c5[_0x82dd('0x2d')](_0x2b9c94)[_0x82dd('0x3b')](_0x9173c8);};}exports['index']=function(_0x26f682,_0x457d44){var _0x1517d8={},_0x2608ef={},_0x47dcb3={'count':0x0,'rows':[]};var _0x5e6d7e=_[_0x82dd('0x3c')](db[_0x82dd('0x3d')][_0x82dd('0x3e')],function(_0x19c736){return{'name':_0x19c736['fieldName'],'type':_0x19c736['type'][_0x82dd('0x3f')]};});_0x2608ef[_0x82dd('0x40')]=_['map'](_0x5e6d7e,_0x82dd('0x3a'));_0x2608ef[_0x82dd('0x41')]=_[_0x82dd('0x42')](_0x26f682[_0x82dd('0x41')]);_0x2608ef[_0x82dd('0x43')]=_[_0x82dd('0x44')](_0x2608ef[_0x82dd('0x40')],_0x2608ef[_0x82dd('0x41')]);_0x1517d8[_0x82dd('0x45')]=_[_0x82dd('0x44')](_0x2608ef[_0x82dd('0x40')],qs[_0x82dd('0x46')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x46')]));_0x1517d8[_0x82dd('0x45')]=_0x1517d8[_0x82dd('0x45')][_0x82dd('0x47')]?_0x1517d8[_0x82dd('0x45')]:_0x2608ef[_0x82dd('0x40')];if(!_0x26f682['query'][_0x82dd('0x48')]('nolimit')){_0x1517d8['limit']=qs[_0x82dd('0x32')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x32')]);_0x1517d8['offset']=qs[_0x82dd('0x30')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x30')]);}_0x1517d8[_0x82dd('0x49')]=qs[_0x82dd('0x4a')](_0x26f682[_0x82dd('0x41')]['sort']);_0x1517d8[_0x82dd('0x4b')]=qs[_0x82dd('0x43')](_[_0x82dd('0x4c')](_0x26f682[_0x82dd('0x41')],_0x2608ef[_0x82dd('0x43')]),_0x5e6d7e);if(_0x26f682['query'][_0x82dd('0x4d')]){_0x1517d8[_0x82dd('0x4b')]=_['merge'](_0x1517d8[_0x82dd('0x4b')],{'$or':_[_0x82dd('0x3c')](_0x5e6d7e,function(_0x1ed29a){if(_0x1ed29a[_0x82dd('0x4e')]!==_0x82dd('0x4f')){var _0x3d5606={};_0x3d5606[_0x1ed29a['name']]={'$like':'%'+_0x26f682[_0x82dd('0x41')][_0x82dd('0x4d')]+'%'};return _0x3d5606;}})});}_0x1517d8=_[_0x82dd('0x50')]({},_0x1517d8,_0x26f682[_0x82dd('0x51')]);var _0x4de57f={'where':_0x1517d8[_0x82dd('0x4b')]};return db[_0x82dd('0x3d')][_0x82dd('0x52')](_0x4de57f)['then'](function(_0x5e8a07){_0x47dcb3[_0x82dd('0x52')]=_0x5e8a07;if(_0x26f682[_0x82dd('0x41')][_0x82dd('0x53')]){_0x1517d8[_0x82dd('0x54')]=[{'all':!![]}];}return db[_0x82dd('0x3d')]['findAll'](_0x1517d8);})['then'](function(_0x47389c){_0x47dcb3[_0x82dd('0x55')]=_0x47389c;return _0x47dcb3;})['then'](respondWithFilteredResult(_0x457d44,_0x1517d8))['catch'](handleError(_0x457d44,null));};exports['show']=function(_0x676ebd,_0x489f38){var _0x2805a0={'raw':!![],'where':{'id':_0x676ebd[_0x82dd('0x56')]['id']}},_0x4b269f={};_0x4b269f[_0x82dd('0x40')]=_[_0x82dd('0x42')](db[_0x82dd('0x3d')][_0x82dd('0x3e')]);_0x4b269f[_0x82dd('0x41')]=_[_0x82dd('0x42')](_0x676ebd['query']);_0x4b269f[_0x82dd('0x43')]=_[_0x82dd('0x44')](_0x4b269f[_0x82dd('0x40')],_0x4b269f[_0x82dd('0x41')]);_0x2805a0[_0x82dd('0x45')]=_[_0x82dd('0x44')](_0x4b269f[_0x82dd('0x40')],qs[_0x82dd('0x46')](_0x676ebd['query'][_0x82dd('0x46')]));_0x2805a0[_0x82dd('0x45')]=_0x2805a0[_0x82dd('0x45')][_0x82dd('0x47')]?_0x2805a0[_0x82dd('0x45')]:_0x4b269f[_0x82dd('0x40')];if(_0x676ebd[_0x82dd('0x41')]['includeAll']){_0x2805a0[_0x82dd('0x54')]=[{'all':!![]}];}_0x2805a0=_[_0x82dd('0x50')]({},_0x2805a0,_0x676ebd['options']);return db[_0x82dd('0x3d')][_0x82dd('0x57')](_0x2805a0)[_0x82dd('0x21')](handleEntityNotFound(_0x489f38,null))['then'](respondWithResult(_0x489f38,null))[_0x82dd('0x2b')](handleError(_0x489f38,null));};exports['create']=function(_0x4707a1,_0x12b7a0){return db[_0x82dd('0x3d')][_0x82dd('0x58')](_0x4707a1[_0x82dd('0x59')],{})[_0x82dd('0x21')](respondWithResult(_0x12b7a0,0xc9))[_0x82dd('0x2b')](handleError(_0x12b7a0,null));};exports[_0x82dd('0x5a')]=function(_0x186db4,_0x4d00e5){if(_0x186db4[_0x82dd('0x59')]['id']){delete _0x186db4[_0x82dd('0x59')]['id'];}return db[_0x82dd('0x3d')]['find']({'where':{'id':_0x186db4[_0x82dd('0x56')]['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x4d00e5,null))[_0x82dd('0x21')](saveUpdates(_0x186db4[_0x82dd('0x59')],null))['then'](respondWithResult(_0x4d00e5,null))[_0x82dd('0x2b')](handleError(_0x4d00e5,null));};exports[_0x82dd('0x38')]=function(_0x20110c,_0x249272){return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x20110c['params']['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x249272,null))[_0x82dd('0x21')](removeEntity(_0x249272,null))[_0x82dd('0x2b')](handleError(_0x249272,null));};exports[_0x82dd('0x5b')]=function(_0x493000,_0x29afdf){return db['SmsMessage'][_0x82dd('0x5b')]()[_0x82dd('0x21')](respondWithResult(_0x29afdf,null))['catch'](handleError(_0x29afdf,null));};var interaction_log=require(_0x82dd('0x14'))('sms-interactions');exports['accept']=function(_0x33854f,_0x48d67c,_0x3265f7){var _0x5b3581={'agent':{},'channel':_0x82dd('0x5c')};if(_0x33854f[_0x82dd('0x59')]['id']){delete _0x33854f['body']['id'];}_0x33854f['body']['read']=!![];_0x33854f[_0x82dd('0x59')][_0x82dd('0x5d')]=moment()[_0x82dd('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')]=_0x33854f['body'][_0x82dd('0x5f')]||_0x33854f['user']['id'];_0x5b3581['agent']['id']=_0x33854f[_0x82dd('0x59')]['UserId'];return db[_0x82dd('0x3d')]['find']({'where':{'id':_0x33854f[_0x82dd('0x56')]['id'],'UserId':null}})[_0x82dd('0x21')](handleEntityNotFound(_0x48d67c,null))['then'](saveUpdates(_0x33854f[_0x82dd('0x59')],null))['then'](function(_0x1d22a9){if(_0x1d22a9){_0x5b3581[_0x82dd('0x29')]=_0x1d22a9[_0x82dd('0x60')]({'plain':!![]});return db[_0x82dd('0x61')][_0x82dd('0x57')]({'where':{'id':_0x1d22a9[_0x82dd('0x62')]}});}return null;})[_0x82dd('0x21')](handleEntityNotFound(_0x48d67c,null))[_0x82dd('0x21')](function(_0x403c52){if(_0x403c52){return _0x403c52['update']({'UserId':_0x33854f['body'][_0x82dd('0x5f')],'read1stAt':_[_0x82dd('0x63')](_0x403c52['read1stAt'])?moment()[_0x82dd('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x82dd('0x21')](function(_0x13b0be){if(_0x13b0be){_0x5b3581['interaction']=_0x13b0be[_0x82dd('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33854f[_0x82dd('0x64')]['id'],_0x33854f[_0x82dd('0x64')][_0x82dd('0x3a')],_0x33854f[_0x82dd('0x64')]['role'],_0x5b3581[_0x82dd('0x65')]['id'],_0x33854f[_0x82dd('0x59')]?JSON['stringify'](_0x33854f[_0x82dd('0x59')]):_0x82dd('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5b3581);}return null;})[_0x82dd('0x21')](function(_0x559404){var _0x22f52f=_0x82dd('0x67')+_0x559404[_0x82dd('0x29')][_0x82dd('0x68')];return db[_0x82dd('0x69')][_0x82dd('0x41')](_0x22f52f,{'type':db[_0x82dd('0x6a')][_0x82dd('0x6b')][_0x82dd('0x6c')],'raw':!![]})[_0x82dd('0x21')](function(_0x2683c9){return _0x2683c9;});})[_0x82dd('0x21')](function(_0xb7d43e){if(_0xb7d43e){_0x5b3581[_0x82dd('0x29')][_0x82dd('0x6d')]=_0xb7d43e[0x0];if(!_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')])return;return db[_0x82dd('0x6e')][_0x82dd('0x57')]({'where':{'id':_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')],'role':_0x82dd('0x6f')},'attributes':['id','name',_0x82dd('0x70'),_0x82dd('0x71'),_0x82dd('0x72')],'raw':!![]});}return null;})[_0x82dd('0x21')](function(_0x24c8e0){if(!_0x24c8e0)return null;_0x5b3581['message'][_0x82dd('0x6f')]=_0x24c8e0;return _0x5b3581;})[_0x82dd('0x21')](function(_0x42abd2){if(_0x42abd2){if(_0x33854f[_0x82dd('0x59')]['manual']){_0x5b3581['message']['interface']=util[_0x82dd('0x5e')](_0x82dd('0x73'),_0x33854f[_0x82dd('0x64')][_0x82dd('0x3a')]);_0x5b3581[_0x82dd('0x29')]['channel']=_0x5b3581['channel'];_0x5b3581[_0x82dd('0x29')][_0x82dd('0x74')]=_0x5b3581[_0x82dd('0x75')];_0x5b3581['message'][_0x82dd('0x76')]=_0x82dd('0x77');return respondWithRpcPromise(_0x82dd('0x78'),_0x82dd('0x78'),{'event':'acceptmessage','message':_0x5b3581[_0x82dd('0x29')]},client9002)[_0x82dd('0x21')](function(){return _0x5b3581;});}return _0x5b3581;}return null;})[_0x82dd('0x21')](respondWithResult(_0x48d67c,null))[_0x82dd('0x2b')](handleError(_0x48d67c,null));};var interaction_log=require(_0x82dd('0x14'))(_0x82dd('0x79'));exports['reject']=function(_0x2d7aec,_0x5398da,_0x356954){var _0x586160={'agent':{},'channel':_0x82dd('0x5c')};if(_0x2d7aec[_0x82dd('0x59')]['id']){delete _0x2d7aec['body']['id'];}_0x2d7aec['body'][_0x82dd('0x5f')]=_0x2d7aec[_0x82dd('0x59')]['UserId']||_0x2d7aec[_0x82dd('0x64')]['id'];_0x586160[_0x82dd('0x6f')]['id']=_0x2d7aec['body'][_0x82dd('0x5f')];return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x2d7aec[_0x82dd('0x56')]['id'],'UserId':null}})[_0x82dd('0x21')](handleEntityNotFound(_0x5398da,null))[_0x82dd('0x21')](function(_0x37c65b){if(_0x37c65b){_0x586160[_0x82dd('0x29')]=_0x37c65b[_0x82dd('0x60')]({'plain':!![]});return db[_0x82dd('0x61')][_0x82dd('0x57')]({'where':{'id':_0x37c65b[_0x82dd('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5398da,null))[_0x82dd('0x21')](function(_0xc39215){if(_0xc39215){_0x586160['interaction']=_0xc39215['get']({'plain':!![]});interaction_log['info'](_0x82dd('0x7a'),_0x2d7aec[_0x82dd('0x64')]['id'],_0x2d7aec[_0x82dd('0x64')][_0x82dd('0x3a')],_0x2d7aec[_0x82dd('0x64')]['role'],_0x586160[_0x82dd('0x65')]['id'],_0x2d7aec[_0x82dd('0x59')]?JSON['stringify'](_0x2d7aec['body']):_0x82dd('0x66'));return respondWithRpcPromise('RejectMessage',_0x82dd('0x7b'),_0x586160);}return null;})['then'](function(_0x4bd420){var _0x5b4613='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4bd420[_0x82dd('0x29')][_0x82dd('0x68')];return db['sequelize']['query'](_0x5b4613,{'type':db[_0x82dd('0x6a')][_0x82dd('0x6b')][_0x82dd('0x6c')],'raw':!![]})['then'](function(_0x2770eb){return _0x2770eb;});})[_0x82dd('0x21')](function(_0x183d04){if(_0x183d04){_0x586160[_0x82dd('0x29')][_0x82dd('0x6d')]=_0x183d04[0x0];if(!_0x2d7aec[_0x82dd('0x59')][_0x82dd('0x5f')])return;return db[_0x82dd('0x6e')]['find']({'where':{'id':_0x2d7aec['body'][_0x82dd('0x5f')],'role':_0x82dd('0x6f')},'attributes':['id',_0x82dd('0x3a'),_0x82dd('0x70'),_0x82dd('0x71'),'internal'],'raw':!![]});}return null;})[_0x82dd('0x21')](function(_0x33c16a){if(!_0x33c16a)return null;_0x586160[_0x82dd('0x29')]['agent']=_0x33c16a;return _0x586160;})['then'](function(_0x49360b){if(_0x49360b){_0x49360b[_0x82dd('0x29')][_0x82dd('0x7c')]=util[_0x82dd('0x5e')]('SIP/%s',_0x2d7aec[_0x82dd('0x64')]['name']);_0x49360b[_0x82dd('0x29')][_0x82dd('0x75')]=_0x586160['channel'];_0x49360b[_0x82dd('0x29')][_0x82dd('0x74')]=_0x586160[_0x82dd('0x75')];_0x49360b[_0x82dd('0x29')]['event']='reject';respondWithRpcPromise('EventManager',_0x82dd('0x78'),{'event':_0x82dd('0x7d'),'message':_0x49360b[_0x82dd('0x29')]},client9002);return _0x586160;}return null;})[_0x82dd('0x21')](respondWithResult(_0x5398da,null))[_0x82dd('0x2b')](handleError(_0x5398da,null));};exports[_0x82dd('0x2d')]=function(_0x4a1599,_0x30db33,_0x3f1f41){if(_0x4a1599[_0x82dd('0x59')]['id']){delete _0x4a1599[_0x82dd('0x59')]['id'];}var _0x4db1b9;return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x4a1599[_0x82dd('0x56')]['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x30db33,null))['then'](function(_0x1f4781){if(_0x1f4781){_0x4db1b9=_0x1f4781;return db[_0x82dd('0x7e')]['find']({'where':{'id':_0x1f4781[_0x82dd('0x7f')]}});}})[_0x82dd('0x21')](handleEntityNotFound(_0x30db33,null))[_0x82dd('0x21')](function(_0x1e4dd0){if(_0x1e4dd0){logger[_0x82dd('0x25')](_0x82dd('0x26'),'status','received\x20delivery\x20report\x20from',_0x1e4dd0['type'],util['inspect'](_0x4a1599['body'],{'showHidden':![],'depth':null}));switch(_0x1e4dd0['type']){case _0x82dd('0x80'):if(_0x4a1599[_0x82dd('0x59')][_0x82dd('0x81')]&&_0x4a1599['body'][_0x82dd('0x81')]===_0x4db1b9[_0x82dd('0x82')]){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x80'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;case _0x82dd('0x85'):if(_0x4a1599[_0x82dd('0x59')][_0x82dd('0x86')]&&_0x4a1599['body'][_0x82dd('0x86')]===_0x4db1b9[_0x82dd('0x82')]&&_[_0x82dd('0x87')]([_0x82dd('0x88'),_0x82dd('0x89')],_0x4a1599['body'][_0x82dd('0x8a')])>=0x0){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x8b'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;case _0x82dd('0x8c'):var _0x21fcf9=_0x4a1599[_0x82dd('0x59')][_0x82dd('0x8d')][0x0];if(_0x21fcf9[_0x82dd('0x2d')][_0x82dd('0x8e')]===_0x82dd('0x8f')){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x8c'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x4db1b9;}})[_0x82dd('0x21')](respondWithResult(_0x30db33,null))[_0x82dd('0x2b')](handleError(_0x30db33,null));}; \ No newline at end of file +var _0x6a0b=['set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','fullname','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','infobip','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x52b1ed,_0x12fcfa){_0x52b1ed=_0x52b1ed-0x0;var _0xaecb5a=_0x6a0b[_0x52b1ed];return _0xaecb5a;};'use strict';var emlformat=require(_0xb6a0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a0('0x1'));var rp=require(_0xb6a0('0x2'));var moment=require('moment');var BPromise=require(_0xb6a0('0x3'));var Mustache=require(_0xb6a0('0x4'));var util=require(_0xb6a0('0x5'));var path=require(_0xb6a0('0x6'));var sox=require(_0xb6a0('0x7'));var csv=require('to-csv');var ejs=require(_0xb6a0('0x8'));var fs=require('fs');var fs_extra=require(_0xb6a0('0x9'));var _=require(_0xb6a0('0xa'));var squel=require(_0xb6a0('0xb'));var crypto=require(_0xb6a0('0xc'));var jsforce=require(_0xb6a0('0xd'));var deskjs=require(_0xb6a0('0xe'));var toCsv=require(_0xb6a0('0xf'));var querystring=require(_0xb6a0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6a0('0x11'));var logger=require('../../config/logger')(_0xb6a0('0x12'));var utils=require(_0xb6a0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb6a0('0x14'));var db=require(_0xb6a0('0x15'))['db'];config[_0xb6a0('0x16')]=_[_0xb6a0('0x17')](config[_0xb6a0('0x16')],{'host':_0xb6a0('0x18'),'port':0x18eb});var socket=require(_0xb6a0('0x19'))(new Redis(config[_0xb6a0('0x16')]));require(_0xb6a0('0x1a'))[_0xb6a0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb6a0('0x1c')][_0xb6a0('0x1d')]({'port':0x232c});var client9002=jayson[_0xb6a0('0x1c')][_0xb6a0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x45a4df,_0x242694,_0x374b74,_0xb864a1){return new BPromise(function(_0x1cb284,_0x4a242e){var _0x390330=_0xb864a1||client;return _0x390330[_0xb6a0('0x1e')](_0x45a4df,_0x374b74)[_0xb6a0('0x1f')](function(_0x5db250){logger[_0xb6a0('0x20')](_0xb6a0('0x21'),_0x242694,_0xb6a0('0x22'));logger[_0xb6a0('0x23')](_0xb6a0('0x24'),_0x242694,'request\x20sent',JSON['stringify'](_0x5db250));if(_0x5db250[_0xb6a0('0x25')]){if(_0x5db250[_0xb6a0('0x25')]['code']===0x1f4){logger[_0xb6a0('0x25')]('SmsMessage,\x20%s,\x20%s',_0x242694,_0x5db250[_0xb6a0('0x25')][_0xb6a0('0x26')]);return _0x4a242e(_0x5db250[_0xb6a0('0x25')]['message']);}logger[_0xb6a0('0x25')](_0xb6a0('0x21'),_0x242694,_0x5db250[_0xb6a0('0x25')]['message']);return _0x1cb284(_0x5db250[_0xb6a0('0x25')][_0xb6a0('0x26')]);}else{logger['info'](_0xb6a0('0x21'),_0x242694,'request\x20sent');_0x1cb284(_0x5db250['result'][_0xb6a0('0x26')]);}})['catch'](function(_0x814060){logger[_0xb6a0('0x25')](_0xb6a0('0x21'),_0x242694,_0x814060);_0x4a242e(_0x814060);});});}function respondWithStatusCode(_0x40e911,_0x2aa557){_0x2aa557=_0x2aa557||0xcc;return function(_0x27bb68){if(_0x27bb68){return _0x40e911[_0xb6a0('0x27')](_0x2aa557);}return _0x40e911['status'](_0x2aa557)[_0xb6a0('0x28')]();};}function respondWithResult(_0x29dbb9,_0xd6e536){_0xd6e536=_0xd6e536||0xc8;return function(_0x17274){if(_0x17274){return _0x29dbb9[_0xb6a0('0x29')](_0xd6e536)['json'](_0x17274);}};}function respondWithFilteredResult(_0x28f593,_0x5d8caf){return function(_0x25ed03){if(_0x25ed03){var _0x261ed7=typeof _0x5d8caf[_0xb6a0('0x2a')]===_0xb6a0('0x2b')&&typeof _0x5d8caf[_0xb6a0('0x2c')]===_0xb6a0('0x2b');var _0x5a2137=_0x25ed03['count'];var _0x31ce9a=_0x261ed7?0x0:_0x5d8caf[_0xb6a0('0x2a')];var _0x1fc80b=_0x261ed7?_0x25ed03[_0xb6a0('0x2d')]:_0x5d8caf[_0xb6a0('0x2a')]+_0x5d8caf['limit'];var _0x56c69c;if(_0x1fc80b>=_0x5a2137){_0x1fc80b=_0x5a2137;_0x56c69c=0xc8;}else{_0x56c69c=0xce;}_0x28f593[_0xb6a0('0x29')](_0x56c69c);return _0x28f593[_0xb6a0('0x2e')](_0xb6a0('0x2f'),_0x31ce9a+'-'+_0x1fc80b+'/'+_0x5a2137)[_0xb6a0('0x30')](_0x25ed03);}return null;};}function patchUpdates(_0x5a6a37){return function(_0x4bb109){try{jsonpatch[_0xb6a0('0x31')](_0x4bb109,_0x5a6a37,!![]);}catch(_0x16f681){return BPromise[_0xb6a0('0x32')](_0x16f681);}return _0x4bb109[_0xb6a0('0x33')]();};}function saveUpdates(_0x1e4849,_0x4ad056){return function(_0x4b9fbf){if(_0x4b9fbf){return _0x4b9fbf[_0xb6a0('0x34')](_0x1e4849)[_0xb6a0('0x1f')](function(_0x3daa1a){return _0x3daa1a;});}return null;};}function removeEntity(_0x1db231,_0x3b1d35){return function(_0x15984e){if(_0x15984e){return _0x15984e[_0xb6a0('0x35')]()['then'](function(){_0x1db231[_0xb6a0('0x29')](0xcc)[_0xb6a0('0x28')]();});}};}function handleEntityNotFound(_0x88a1a1,_0x56cbe5){return function(_0x2f81a8){if(!_0x2f81a8){_0x88a1a1[_0xb6a0('0x27')](0x194);}return _0x2f81a8;};}function handleError(_0x518139,_0x2c05b0){_0x2c05b0=_0x2c05b0||0x1f4;return function(_0x31106a){logger[_0xb6a0('0x25')](_0x31106a[_0xb6a0('0x36')]);if(_0x31106a[_0xb6a0('0x37')]){delete _0x31106a[_0xb6a0('0x37')];}_0x518139['status'](_0x2c05b0)[_0xb6a0('0x38')](_0x31106a);};}exports[_0xb6a0('0x39')]=function(_0x2a5516,_0x512877){var _0x4befc3={},_0x107b7f={},_0x317ad4={'count':0x0,'rows':[]};var _0x2501f5=_[_0xb6a0('0x3a')](db[_0xb6a0('0x3b')][_0xb6a0('0x3c')],function(_0x30c35f){return{'name':_0x30c35f['fieldName'],'type':_0x30c35f[_0xb6a0('0x3d')]['key']};});_0x107b7f[_0xb6a0('0x3e')]=_[_0xb6a0('0x3a')](_0x2501f5,'name');_0x107b7f[_0xb6a0('0x3f')]=_['keys'](_0x2a5516['query']);_0x107b7f[_0xb6a0('0x40')]=_['intersection'](_0x107b7f[_0xb6a0('0x3e')],_0x107b7f['query']);_0x4befc3['attributes']=_[_0xb6a0('0x41')](_0x107b7f[_0xb6a0('0x3e')],qs[_0xb6a0('0x42')](_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x42')]));_0x4befc3[_0xb6a0('0x43')]=_0x4befc3[_0xb6a0('0x43')][_0xb6a0('0x44')]?_0x4befc3[_0xb6a0('0x43')]:_0x107b7f[_0xb6a0('0x3e')];if(!_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x45')](_0xb6a0('0x46'))){_0x4befc3[_0xb6a0('0x2c')]=qs[_0xb6a0('0x2c')](_0x2a5516[_0xb6a0('0x3f')]['limit']);_0x4befc3[_0xb6a0('0x2a')]=qs['offset'](_0x2a5516['query'][_0xb6a0('0x2a')]);}_0x4befc3[_0xb6a0('0x47')]=qs[_0xb6a0('0x48')](_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x48')]);_0x4befc3[_0xb6a0('0x49')]=qs[_0xb6a0('0x40')](_[_0xb6a0('0x4a')](_0x2a5516[_0xb6a0('0x3f')],_0x107b7f[_0xb6a0('0x40')]),_0x2501f5);if(_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x4b')]){_0x4befc3[_0xb6a0('0x49')]=_[_0xb6a0('0x4c')](_0x4befc3[_0xb6a0('0x49')],{'$or':_[_0xb6a0('0x3a')](_0x2501f5,function(_0x43eeb2){if(_0x43eeb2[_0xb6a0('0x3d')]!=='VIRTUAL'){var _0x109066={};_0x109066[_0x43eeb2[_0xb6a0('0x37')]]={'$like':'%'+_0x2a5516[_0xb6a0('0x3f')]['filter']+'%'};return _0x109066;}})});}_0x4befc3=_[_0xb6a0('0x4c')]({},_0x4befc3,_0x2a5516[_0xb6a0('0x4d')]);var _0x557a59={'where':_0x4befc3[_0xb6a0('0x49')]};return db['SmsMessage'][_0xb6a0('0x2d')](_0x557a59)[_0xb6a0('0x1f')](function(_0x379a96){_0x317ad4['count']=_0x379a96;if(_0x2a5516[_0xb6a0('0x3f')]['includeAll']){_0x4befc3[_0xb6a0('0x4e')]=[{'all':!![]}];}return db[_0xb6a0('0x3b')][_0xb6a0('0x4f')](_0x4befc3);})[_0xb6a0('0x1f')](function(_0x5e8d5e){_0x317ad4[_0xb6a0('0x50')]=_0x5e8d5e;return _0x317ad4;})[_0xb6a0('0x1f')](respondWithFilteredResult(_0x512877,_0x4befc3))['catch'](handleError(_0x512877,null));};exports[_0xb6a0('0x51')]=function(_0x14c75d,_0x433917){var _0x1379b9={'raw':!![],'where':{'id':_0x14c75d[_0xb6a0('0x52')]['id']}},_0x373aac={};_0x373aac[_0xb6a0('0x3e')]=_[_0xb6a0('0x53')](db['SmsMessage']['rawAttributes']);_0x373aac[_0xb6a0('0x3f')]=_[_0xb6a0('0x53')](_0x14c75d[_0xb6a0('0x3f')]);_0x373aac[_0xb6a0('0x40')]=_[_0xb6a0('0x41')](_0x373aac[_0xb6a0('0x3e')],_0x373aac['query']);_0x1379b9[_0xb6a0('0x43')]=_[_0xb6a0('0x41')](_0x373aac[_0xb6a0('0x3e')],qs['fields'](_0x14c75d[_0xb6a0('0x3f')][_0xb6a0('0x42')]));_0x1379b9[_0xb6a0('0x43')]=_0x1379b9['attributes'][_0xb6a0('0x44')]?_0x1379b9[_0xb6a0('0x43')]:_0x373aac[_0xb6a0('0x3e')];if(_0x14c75d[_0xb6a0('0x3f')][_0xb6a0('0x54')]){_0x1379b9['include']=[{'all':!![]}];}_0x1379b9=_[_0xb6a0('0x4c')]({},_0x1379b9,_0x14c75d['options']);return db[_0xb6a0('0x3b')][_0xb6a0('0x55')](_0x1379b9)[_0xb6a0('0x1f')](handleEntityNotFound(_0x433917,null))[_0xb6a0('0x1f')](respondWithResult(_0x433917,null))[_0xb6a0('0x56')](handleError(_0x433917,null));};exports[_0xb6a0('0x57')]=function(_0x29e835,_0x18e723){return db[_0xb6a0('0x3b')][_0xb6a0('0x57')](_0x29e835['body'],{})['then'](respondWithResult(_0x18e723,0xc9))[_0xb6a0('0x56')](handleError(_0x18e723,null));};exports[_0xb6a0('0x34')]=function(_0x469f7d,_0x43482c){if(_0x469f7d[_0xb6a0('0x58')]['id']){delete _0x469f7d['body']['id'];}return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0x469f7d[_0xb6a0('0x52')]['id']}})['then'](handleEntityNotFound(_0x43482c,null))['then'](saveUpdates(_0x469f7d[_0xb6a0('0x58')],null))['then'](respondWithResult(_0x43482c,null))['catch'](handleError(_0x43482c,null));};exports['destroy']=function(_0x43fd79,_0xab87f8){return db['SmsMessage'][_0xb6a0('0x55')]({'where':{'id':_0x43fd79[_0xb6a0('0x52')]['id']}})[_0xb6a0('0x1f')](handleEntityNotFound(_0xab87f8,null))['then'](removeEntity(_0xab87f8,null))[_0xb6a0('0x56')](handleError(_0xab87f8,null));};exports['describe']=function(_0x3d5ca1,_0x4d3a00){return db[_0xb6a0('0x3b')][_0xb6a0('0x59')]()[_0xb6a0('0x1f')](respondWithResult(_0x4d3a00,null))[_0xb6a0('0x56')](handleError(_0x4d3a00,null));};var interaction_log=require('../../config/logger')(_0xb6a0('0x5a'));exports[_0xb6a0('0x5b')]=function(_0x207f6b,_0x1ce0a4,_0x5ac8af){var _0x3712c6={'agent':{},'channel':_0xb6a0('0x5c')};if(_0x207f6b[_0xb6a0('0x58')]['id']){delete _0x207f6b[_0xb6a0('0x58')]['id'];}_0x207f6b['body'][_0xb6a0('0x5d')]=!![];_0x207f6b['body'][_0xb6a0('0x5e')]=moment()[_0xb6a0('0x5f')](_0xb6a0('0x60'));_0x207f6b['body']['UserId']=_0x207f6b['body'][_0xb6a0('0x61')]||_0x207f6b[_0xb6a0('0x62')]['id'];_0x3712c6[_0xb6a0('0x63')]['id']=_0x207f6b[_0xb6a0('0x58')][_0xb6a0('0x61')];return db['SmsMessage'][_0xb6a0('0x55')]({'where':{'id':_0x207f6b[_0xb6a0('0x52')]['id'],'UserId':null}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x1ce0a4,null))[_0xb6a0('0x1f')](saveUpdates(_0x207f6b[_0xb6a0('0x58')],null))[_0xb6a0('0x1f')](function(_0x14f7f7){if(_0x14f7f7){_0x3712c6[_0xb6a0('0x26')]=_0x14f7f7[_0xb6a0('0x64')]({'plain':!![]});return db[_0xb6a0('0x65')]['find']({'where':{'id':_0x14f7f7[_0xb6a0('0x66')]}});}return null;})[_0xb6a0('0x1f')](handleEntityNotFound(_0x1ce0a4,null))[_0xb6a0('0x1f')](function(_0x357bae){if(_0x357bae){return _0x357bae[_0xb6a0('0x34')]({'UserId':_0x207f6b['body'][_0xb6a0('0x61')],'read1stAt':_['isNil'](_0x357bae[_0xb6a0('0x67')])?moment()['format'](_0xb6a0('0x60')):undefined});}return null;})[_0xb6a0('0x1f')](function(_0x37759c){if(_0x37759c){_0x3712c6[_0xb6a0('0x68')]=_0x37759c['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x207f6b[_0xb6a0('0x62')]['id'],_0x207f6b[_0xb6a0('0x62')]['name'],_0x207f6b['user'][_0xb6a0('0x69')],_0x3712c6[_0xb6a0('0x68')]['id'],_0x207f6b[_0xb6a0('0x58')]?JSON[_0xb6a0('0x6a')](_0x207f6b[_0xb6a0('0x58')]):_0xb6a0('0x6b'));return respondWithRpcPromise(_0xb6a0('0x6c'),_0xb6a0('0x6d'),_0x3712c6);}return null;})[_0xb6a0('0x1f')](function(_0x5204ed){var _0x5ea09e=_0xb6a0('0x6e')+_0x5204ed[_0xb6a0('0x26')][_0xb6a0('0x6f')];return db[_0xb6a0('0x70')]['query'](_0x5ea09e,{'type':db['Sequelize']['QueryTypes'][_0xb6a0('0x71')],'raw':!![]})[_0xb6a0('0x1f')](function(_0x44af5d){return _0x44af5d;});})[_0xb6a0('0x1f')](function(_0x1a23ca){if(_0x1a23ca){_0x3712c6[_0xb6a0('0x26')][_0xb6a0('0x72')]=_0x1a23ca[0x0];if(!_0x207f6b['body'][_0xb6a0('0x61')])return;return db[_0xb6a0('0x73')]['find']({'where':{'id':_0x207f6b[_0xb6a0('0x58')]['UserId'],'role':_0xb6a0('0x63')},'attributes':['id','name','fullname',_0xb6a0('0x74'),_0xb6a0('0x75')],'raw':!![]});}return null;})[_0xb6a0('0x1f')](function(_0x2977eb){if(!_0x2977eb)return null;_0x3712c6['message'][_0xb6a0('0x63')]=_0x2977eb;return _0x3712c6;})[_0xb6a0('0x1f')](function(_0x181287){if(_0x181287){if(_0x207f6b[_0xb6a0('0x58')][_0xb6a0('0x76')]){_0x3712c6['message'][_0xb6a0('0x77')]=util[_0xb6a0('0x5f')](_0xb6a0('0x78'),_0x207f6b[_0xb6a0('0x62')][_0xb6a0('0x37')]);_0x3712c6[_0xb6a0('0x26')][_0xb6a0('0x79')]=_0x3712c6['channel'];_0x3712c6['message'][_0xb6a0('0x7a')]=_0x3712c6['channel'];_0x3712c6['message'][_0xb6a0('0x7b')]=_0xb6a0('0x5b');return respondWithRpcPromise(_0xb6a0('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x3712c6['message']},client9002)[_0xb6a0('0x1f')](function(){return _0x3712c6;});}return _0x3712c6;}return null;})[_0xb6a0('0x1f')](respondWithResult(_0x1ce0a4,null))[_0xb6a0('0x56')](handleError(_0x1ce0a4,null));};var interaction_log=require(_0xb6a0('0x7d'))(_0xb6a0('0x5a'));exports[_0xb6a0('0x32')]=function(_0x3e6fb1,_0x5a0d70,_0x89cce2){var _0x56d20c={'agent':{},'channel':'sms'};if(_0x3e6fb1[_0xb6a0('0x58')]['id']){delete _0x3e6fb1[_0xb6a0('0x58')]['id'];}_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')]=_0x3e6fb1[_0xb6a0('0x58')]['UserId']||_0x3e6fb1['user']['id'];_0x56d20c['agent']['id']=_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')];return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0x3e6fb1[_0xb6a0('0x52')]['id'],'UserId':null}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x5a0d70,null))[_0xb6a0('0x1f')](function(_0x125ce6){if(_0x125ce6){_0x56d20c[_0xb6a0('0x26')]=_0x125ce6['get']({'plain':!![]});return db[_0xb6a0('0x65')][_0xb6a0('0x55')]({'where':{'id':_0x125ce6[_0xb6a0('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5a0d70,null))['then'](function(_0x3e2971){if(_0x3e2971){_0x56d20c['interaction']=_0x3e2971[_0xb6a0('0x64')]({'plain':!![]});interaction_log[_0xb6a0('0x20')](_0xb6a0('0x7e'),_0x3e6fb1[_0xb6a0('0x62')]['id'],_0x3e6fb1[_0xb6a0('0x62')][_0xb6a0('0x37')],_0x3e6fb1[_0xb6a0('0x62')][_0xb6a0('0x69')],_0x56d20c[_0xb6a0('0x68')]['id'],_0x3e6fb1['body']?JSON[_0xb6a0('0x6a')](_0x3e6fb1[_0xb6a0('0x58')]):_0xb6a0('0x6b'));return respondWithRpcPromise(_0xb6a0('0x7f'),_0xb6a0('0x80'),_0x56d20c);}return null;})[_0xb6a0('0x1f')](function(_0x9f2334){var _0x2e6468='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9f2334[_0xb6a0('0x26')][_0xb6a0('0x6f')];return db[_0xb6a0('0x70')]['query'](_0x2e6468,{'type':db['Sequelize'][_0xb6a0('0x81')][_0xb6a0('0x71')],'raw':!![]})['then'](function(_0x18b03d){return _0x18b03d;});})[_0xb6a0('0x1f')](function(_0x362ffe){if(_0x362ffe){_0x56d20c['message'][_0xb6a0('0x72')]=_0x362ffe[0x0];if(!_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')])return;return db[_0xb6a0('0x73')]['find']({'where':{'id':_0x3e6fb1['body'][_0xb6a0('0x61')],'role':_0xb6a0('0x63')},'attributes':['id',_0xb6a0('0x37'),_0xb6a0('0x82'),_0xb6a0('0x74'),_0xb6a0('0x75')],'raw':!![]});}return null;})[_0xb6a0('0x1f')](function(_0x1155f9){if(!_0x1155f9)return null;_0x56d20c[_0xb6a0('0x26')][_0xb6a0('0x63')]=_0x1155f9;return _0x56d20c;})[_0xb6a0('0x1f')](function(_0x6d75f1){if(_0x6d75f1){_0x6d75f1[_0xb6a0('0x26')]['interface']=util['format']('SIP/%s',_0x3e6fb1['user'][_0xb6a0('0x37')]);_0x6d75f1[_0xb6a0('0x26')]['channel']=_0x56d20c['channel'];_0x6d75f1[_0xb6a0('0x26')][_0xb6a0('0x7a')]=_0x56d20c[_0xb6a0('0x79')];_0x6d75f1[_0xb6a0('0x26')][_0xb6a0('0x7b')]=_0xb6a0('0x32');respondWithRpcPromise(_0xb6a0('0x7c'),_0xb6a0('0x7c'),{'event':'rejectmessage','message':_0x6d75f1[_0xb6a0('0x26')]},client9002);return _0x56d20c;}return null;})[_0xb6a0('0x1f')](respondWithResult(_0x5a0d70,null))['catch'](handleError(_0x5a0d70,null));};exports['status']=function(_0xdee8fc,_0x3ecf5d,_0x47b365){if(_0xdee8fc[_0xb6a0('0x58')]['id']){delete _0xdee8fc[_0xb6a0('0x58')]['id'];}var _0x3c002a;return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0xdee8fc['params']['id']}})['then'](handleEntityNotFound(_0x3ecf5d,null))[_0xb6a0('0x1f')](function(_0x406d96){if(_0x406d96){_0x3c002a=_0x406d96;return db['SmsAccount']['find']({'where':{'id':_0x406d96[_0xb6a0('0x83')]}});}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x3ecf5d,null))[_0xb6a0('0x1f')](function(_0x74640c){if(_0x74640c){logger[_0xb6a0('0x23')](_0xb6a0('0x24'),'status',_0xb6a0('0x84'),_0x74640c[_0xb6a0('0x3d')],util[_0xb6a0('0x85')](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));switch(_0x74640c[_0xb6a0('0x3d')]){case _0xb6a0('0x86'):if(_0xdee8fc[_0xb6a0('0x58')]['MessageSid']&&_0xdee8fc[_0xb6a0('0x58')][_0xb6a0('0x87')]===_0x3c002a[_0xb6a0('0x88')]){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger[_0xb6a0('0x25')](_0xb6a0('0x89'),_0xb6a0('0x29'),_0xb6a0('0x86'),util[_0xb6a0('0x85')](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb6a0('0x8a'):if(_0xdee8fc['body'][_0xb6a0('0x8b')]&&_0xdee8fc['body'][_0xb6a0('0x8b')]===_0x3c002a['messageId']&&_[_0xb6a0('0x8c')](['sent',_0xb6a0('0x8d')],_0xdee8fc['body'][_0xb6a0('0x8e')])>=0x0){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger[_0xb6a0('0x25')](_0xb6a0('0x89'),_0xb6a0('0x29'),'plivio',util['inspect'](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x426740=_0xdee8fc[_0xb6a0('0x58')][_0xb6a0('0x8f')][0x0];if(_0x426740[_0xb6a0('0x29')][_0xb6a0('0x90')]==='DELIVERED'){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb6a0('0x29'),_0xb6a0('0x91'),util[_0xb6a0('0x85')](_0xdee8fc['body'],{'showHidden':![],'depth':null}));}break;}return _0x3c002a;}})[_0xb6a0('0x1f')](respondWithResult(_0x3ecf5d,null))[_0xb6a0('0x56')](handleError(_0x3ecf5d,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 540147c..291a8b8 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 _0xfabf=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xa07895,_0x30a1c3){var _0x367763=function(_0x3d43c9){while(--_0x3d43c9){_0xa07895['push'](_0xa07895['shift']());}};_0x367763(++_0x30a1c3);}(_0xfabf,0x7e));var _0xffab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfabf[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xffab('0x0'));var SmsMessage=require(_0xffab('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xffab('0x2')](0x0);var events={'afterCreate':_0xffab('0x3'),'afterUpdate':_0xffab('0x4'),'afterDestroy':_0xffab('0x5')};function emitEvent(_0x11e22f){return function(_0x5da837,_0x37bafc,_0x1bd10b){SmsMessageEvents[_0xffab('0x6')](_0x11e22f+':'+_0x5da837['id'],_0x5da837);SmsMessageEvents['emit'](_0x11e22f,_0x5da837);_0x1bd10b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xffab('0x7')](e,emitEvent(event));}}module[_0xffab('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x73d3=['SmsMessage','setMaxListeners','save','remove','emit','hook','../../mysqldb'];(function(_0x5512bf,_0x31ed23){var _0x317e8b=function(_0x3e1cf8){while(--_0x3e1cf8){_0x5512bf['push'](_0x5512bf['shift']());}};_0x317e8b(++_0x31ed23);}(_0x73d3,0xc3));var _0x373d=function(_0x1d56ca,_0x2e3a76){_0x1d56ca=_0x1d56ca-0x0;var _0x4747d2=_0x73d3[_0x1d56ca];return _0x4747d2;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x373d('0x0'))['db'][_0x373d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x373d('0x2')](0x0);var events={'afterCreate':_0x373d('0x3'),'afterUpdate':'update','afterDestroy':_0x373d('0x4')};function emitEvent(_0x13d1ec){return function(_0x579195,_0x40cad6,_0x1ad940){SmsMessageEvents[_0x373d('0x5')](_0x13d1ec+':'+_0x579195['id'],_0x579195);SmsMessageEvents[_0x373d('0x5')](_0x13d1ec,_0x579195);_0x1ad940(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x373d('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index bf6881f..fac2f5e 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 _0x0c5d=['direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','&password=','password','GET','sms','user_key','session_key','internal_order_id','deliveryReport','POST','https://smsapi.connectel.se/api/v2/send/','requestid','read','connectel','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','base64','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','body','FULLTEXT','models','get'];(function(_0x3f40ee,_0x2992d4){var _0x161aeb=function(_0x581153){while(--_0x581153){_0x3f40ee['push'](_0x3f40ee['shift']());}};_0x161aeb(++_0x2992d4);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x4f21f6,_0x1fd20f){_0x4f21f6=_0x4f21f6-0x0;var _0xa43c9a=_0x0c5d[_0x4f21f6];return _0xa43c9a;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var logger=require('../../config/logger')(_0xd0c5('0x2'));var moment=require('moment');var BPromise=require(_0xd0c5('0x3'));var rp=require(_0xd0c5('0x4'));var fs=require('fs');var path=require(_0xd0c5('0x5'));var rimraf=require(_0xd0c5('0x6'));var config=require(_0xd0c5('0x7'));var attributes=require(_0xd0c5('0x8'));module[_0xd0c5('0x9')]=function(_0x121911,_0x569992){return _0x121911[_0xd0c5('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd0c5('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xd0c5('0xc')],'type':_0xd0c5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50ed33,_0x33a77b,_0x3d53ab){var _0x5ae844=_0x121911[_0xd0c5('0xe')];var _0x410037=_0x50ed33[_0xd0c5('0xf')]({'plain':!![]});if(_0x410037[_0xd0c5('0x10')][_0xd0c5('0x11')]()==='in'||_0x410037[_0xd0c5('0x10')][_0xd0c5('0x11')]()===_0xd0c5('0x12')&&!_0x410037[_0xd0c5('0x13')]&&!_[_0xd0c5('0x14')](_0x410037[_0xd0c5('0x15')])){_0x5ae844[_0xd0c5('0x16')]['findOne']({'where':{'id':_0x410037[_0xd0c5('0x17')]}})[_0xd0c5('0x18')](function(_0x1fc98d){if(_0x1fc98d){_0x1fc98d[_0xd0c5('0x19')]({'lastMsgAt':_0x410037['createdAt'],'lastMsgDirection':_0x410037[_0xd0c5('0x10')][_0xd0c5('0x11')]()});}})[_0xd0c5('0x1a')](function(_0x639e72){console['error'](_0x639e72);});}if(_0x410037[_0xd0c5('0x10')]==='out'&&!_0x410037[_0xd0c5('0x13')]){var _0x57c76a;_0x5ae844[_0xd0c5('0x1b')][_0xd0c5('0x1c')]({'where':{'id':_0x410037[_0xd0c5('0x1d')]},'raw':!![]})[_0xd0c5('0x18')](function(_0xfda75c){_0x57c76a=_0xfda75c;if(_0x57c76a&&_0x57c76a[_0xd0c5('0x1e')]){switch(_0x57c76a[_0xd0c5('0x1e')]){case _0xd0c5('0x1f'):var _0x4e302a=require(_0xd0c5('0x1f'));if(_0x57c76a[_0xd0c5('0x20')]&&_0x57c76a['authToken']&&_0x57c76a[_0xd0c5('0x21')]){var _0x30f548=new _0x4e302a(_0x57c76a[_0xd0c5('0x20')],_0x57c76a[_0xd0c5('0x22')]);_0x30f548[_0xd0c5('0x23')][_0xd0c5('0x24')]({'body':_0x410037[_0xd0c5('0xc')],'to':_0x410037['phone'],'from':_0x57c76a['phone'],'statusCallback':_0x57c76a[_0xd0c5('0x25')]+_0xd0c5('0x26')+_0x410037['id']+_0xd0c5('0x27')+_0x57c76a[_0xd0c5('0x28')]})['then'](function(_0x185e33){if(_0x185e33['sid']){return _0x50ed33['update']({'messageId':_0x185e33[_0xd0c5('0x29')]});}})[_0xd0c5('0x1a')](function(_0x364963){logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x1f'),util[_0xd0c5('0x2d')](_0x364963,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x1f'),_0xd0c5('0x2e'));}break;case _0xd0c5('0x2f'):var _0x1df662=_0xd0c5('0x30');if(_0x57c76a[_0xd0c5('0x31')]&&_0x57c76a['password']){var _0x39284e={'recipient':[_0x410037[_0xd0c5('0x21')]],'message':_0x410037[_0xd0c5('0xc')],'message_type':_0x57c76a[_0xd0c5('0x32')]};if(_0x57c76a[_0xd0c5('0x32')]&&_0x57c76a[_0xd0c5('0x32')]!=='SI'){_0x39284e[_0xd0c5('0x33')]=_0x57c76a['phone'];}var _0x246793={'url':_0x1df662+'login?username='+_0x57c76a[_0xd0c5('0x31')]+_0xd0c5('0x34')+_0x57c76a[_0xd0c5('0x35')],'method':_0xd0c5('0x36')};rp(_0x246793)[_0xd0c5('0x18')](function(_0x3144b3){var _0x46f394=_0x3144b3['split'](';');var _0x560853={'user_key':_0x46f394[0x0],'session_key':_0x46f394[0x1]};_0x246793={'url':_0x1df662+_0xd0c5('0x37'),'method':'POST','headers':{'user_key':_0x560853[_0xd0c5('0x38')],'Session_key':_0x560853[_0xd0c5('0x39')]},'json':!![],'body':_0x39284e};return rp(_0x246793);})[_0xd0c5('0x18')](function(_0x211805){if(_0x211805['total_sent']>=0x1){var _0x307504={'messageId':_0x211805[_0xd0c5('0x3a')]};if(_0x57c76a['smsMethod']!=='GP'||!_0x57c76a[_0xd0c5('0x3b')]){_0x307504['read']=!![];}return _0x50ed33[_0xd0c5('0x19')](_0x307504);}else{return logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),'afterCreate',_0xd0c5('0x2f'),util[_0xd0c5('0x2d')](_0x211805,{'showHidden':![],'depth':null}));}})[_0xd0c5('0x1a')](function(_0x3650b8){return logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x2f'),util[_0xd0c5('0x2d')](_0x3650b8,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x57c76a[_0xd0c5('0x22')]){var _0x1dd3aa={'recipient':_0x410037[_0xd0c5('0x21')],'message':_0x410037[_0xd0c5('0xc')],'sender':_0x57c76a['senderString']||_0x57c76a[_0xd0c5('0x21')],'authorization':_0x57c76a[_0xd0c5('0x22')]};var _0x33a77b={'method':_0xd0c5('0x3c'),'uri':_0xd0c5('0x3d'),'body':_0x1dd3aa,'json':!![]};rp(_0x33a77b)[_0xd0c5('0x18')](function(_0x444a21){var _0xd7d03a={'messageId':_0x444a21[_0xd0c5('0x3e')]};if(!_0x57c76a[_0xd0c5('0x3b')]){_0xd7d03a[_0xd0c5('0x3f')]=!![];}return _0x50ed33[_0xd0c5('0x19')](_0xd7d03a);})[_0xd0c5('0x1a')](function(_0x8ef77f){logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),'afterCreate',_0xd0c5('0x40'),util[_0xd0c5('0x2d')](_0x8ef77f,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xd0c5('0x41'):if(_0x57c76a[_0xd0c5('0x31')]&&_0x57c76a[_0xd0c5('0x35')]){var _0x1dd3aa={'messages':[{'source':'xCALLY\x20Motion','to':_0x410037[_0xd0c5('0x21')],'body':_0x410037[_0xd0c5('0xc')],'from':_0x57c76a[_0xd0c5('0x42')]||_0x57c76a[_0xd0c5('0x21')]}]};var _0x464989=util[_0xd0c5('0x43')](_0xd0c5('0x44'),_0x57c76a['username'],_0x57c76a[_0xd0c5('0x35')]);var _0x33a77b={'method':'POST','uri':_0xd0c5('0x45'),'body':_0x1dd3aa,'headers':{'Authorization':util[_0xd0c5('0x43')](_0xd0c5('0x46'),new Buffer(_0x464989)['toString']('base64'))},'json':!![]};rp(_0x33a77b)['then'](function(_0x4a4b14){if(_0x4a4b14[_0xd0c5('0x47')]>=0xc8&&_0x4a4b14['http_code']<=0xce){if(_0x4a4b14[_0xd0c5('0x48')]&&_0x4a4b14['data'][_0xd0c5('0x49')]>0x0){var _0x5a1857=_[_0xd0c5('0x4a')](_0x4a4b14[_0xd0c5('0x48')][_0xd0c5('0x23')]);var _0x2b939e={'messageId':_0x5a1857[_0xd0c5('0x4b')]};if(!_0x57c76a['deliveryReport']){_0x2b939e[_0xd0c5('0x3f')]=!![];}return _0x50ed33[_0xd0c5('0x19')](_0x2b939e);}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x4c'),util['inspect'](_0x4a4b14,{'showHidden':![],'depth':null}));}}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x4c'),util['inspect'](_0x4a4b14,{'showHidden':![],'depth':null}));}})[_0xd0c5('0x1a')](function(_0x1b1b26){logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x4c'),util[_0xd0c5('0x2d')](_0x1b1b26,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x4c'),_0xd0c5('0x4d'));}break;case'plivo':if(_0x57c76a['authId']&&_0x57c76a[_0xd0c5('0x22')]){var _0x1dd3aa={'dst':_0x410037[_0xd0c5('0x21')],'text':_0x410037[_0xd0c5('0xc')],'src':_0x57c76a[_0xd0c5('0x42')]||_0x57c76a[_0xd0c5('0x21')],'url':_0x57c76a['remote']+_0xd0c5('0x26')+_0x410037['id']+_0xd0c5('0x27')+_0x57c76a[_0xd0c5('0x28')]};var _0x464989=util[_0xd0c5('0x43')](_0xd0c5('0x44'),_0x57c76a[_0xd0c5('0x4e')],_0x57c76a[_0xd0c5('0x22')]);var _0x33a77b={'method':_0xd0c5('0x3c'),'uri':util[_0xd0c5('0x43')](_0xd0c5('0x4f'),_0x57c76a[_0xd0c5('0x4e')]),'body':_0x1dd3aa,'headers':{'Authorization':util['format'](_0xd0c5('0x46'),new Buffer(_0x464989)[_0xd0c5('0x50')]('base64'))},'json':!![]};rp(_0x33a77b)[_0xd0c5('0x18')](function(_0x4a9356){var _0x588347={'messageId':_0x4a9356[_0xd0c5('0x51')][0x0]};return _0x50ed33[_0xd0c5('0x19')](_0x588347);})[_0xd0c5('0x1a')](function(_0x1ce80d){logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x52'),util[_0xd0c5('0x2d')](_0x1ce80d,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x52'),_0xd0c5('0x53'));}break;case _0xd0c5('0x54'):if(_0x57c76a[_0xd0c5('0x31')]&&_0x57c76a[_0xd0c5('0x35')]){if(_0x57c76a['baseUrl']){var _0x4bdb47={'method':_0xd0c5('0x3c'),'uri':_0x57c76a[_0xd0c5('0x55')]+'/auth/1/session','body':{'username':_0x57c76a['username'],'password':_0x57c76a[_0xd0c5('0x35')]},'json':!![]};return rp(_0x4bdb47)[_0xd0c5('0x18')](function(_0x3a5bf9){var _0x164646={'method':_0xd0c5('0x3c'),'uri':_0x57c76a[_0xd0c5('0x55')]+_0xd0c5('0x56'),'body':{'messages':[{'from':_0x57c76a[_0xd0c5('0x21')],'destinations':[{'to':_0x410037[_0xd0c5('0x21')]}],'text':_0x410037['body'],'notifyUrl':_0x57c76a[_0xd0c5('0x25')]+_0xd0c5('0x26')+_0x410037['id']+'/status?token='+_0x57c76a[_0xd0c5('0x28')],'notifyContentType':'application/json','callbackData':_0x57c76a[_0xd0c5('0x21')]+';'+_0x410037['body']}]},'headers':{'Authorization':_0xd0c5('0x57')+_0x3a5bf9['token']},'json':!![]};return rp(_0x164646)[_0xd0c5('0x18')](function(_0x339710){if(_0x339710[_0xd0c5('0x23')]){var _0x5655a0={'messageId':_0x339710[_0xd0c5('0x23')][0x0][_0xd0c5('0xb')]};if(!_0x57c76a[_0xd0c5('0x3b')]){_0x5655a0[_0xd0c5('0x3f')]=!![];}return _0x50ed33[_0xd0c5('0x19')](_0x5655a0);}else{return logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),'infobip',util[_0xd0c5('0x2d')](_0x339710,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2ed9ba){return logger[_0xd0c5('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd0c5('0x2c'),_0xd0c5('0x54'),util[_0xd0c5('0x2d')](_0x2ed9ba,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),'infobip',_0xd0c5('0x58'));}}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),'infobip',_0xd0c5('0x4d'));}break;case _0xd0c5('0x59'):var _0x23783c=require(_0xd0c5('0x5a'));if(_0x57c76a[_0xd0c5('0x5b')]){var _0x376cf0={};_0x376cf0[_0xd0c5('0x5c')]=_0x57c76a[_0xd0c5('0x31')];_0x376cf0[_0xd0c5('0x21')]=_0x410037[_0xd0c5('0x21')];_0x376cf0['sender']=_0x57c76a[_0xd0c5('0x21')];_0x376cf0[_0xd0c5('0x5d')]=_0x410037[_0xd0c5('0xc')];_0x376cf0[_0xd0c5('0x5e')]=+new Date();var _0x383e7c='';var _0xed6cca='';var _0x4ebf38=Object[_0xd0c5('0x5f')](_0x376cf0);_0x4ebf38['sort']();for(var _0x278bcd=0x0;_0x278bcd<_0x4ebf38[_0xd0c5('0x60')];_0x278bcd++){if(_0x383e7c!=''){_0x383e7c+='&';}_0x383e7c+=_0x4ebf38[_0x278bcd]+'='+encodeURIComponent(_0x376cf0[_0x4ebf38[_0x278bcd]]);_0xed6cca+=_0x376cf0[_0x4ebf38[_0x278bcd]];}_0xed6cca+=_0x57c76a[_0xd0c5('0x5b')];_0xed6cca=_0x23783c[_0xd0c5('0x61')](_0xd0c5('0x62'))['update'](_0xed6cca)['digest'](_0xd0c5('0x63'));if(_0x383e7c!==''){_0x383e7c+='&';}_0x383e7c+=_0xd0c5('0x64')+_0xed6cca;var _0x246793={'method':_0xd0c5('0x36'),'uri':_0x57c76a[_0xd0c5('0x55')]+_0xd0c5('0x65')+_0x383e7c,'json':!![]};return rp(_0x246793)[_0xd0c5('0x18')](function(_0x381362){var _0x3d4f41=Object[_0xd0c5('0x5f')](_0x381362);if(_0x381362[_0x3d4f41[0x0]][_0xd0c5('0x2a')]&&parseInt(_0x381362[_0x3d4f41[0x0]][_0xd0c5('0x2a')])===0x0){var _0xc4e75d={'messageId':_0x381362[_0x3d4f41[0x0]][_0xd0c5('0x66')]};if(!_0x57c76a[_0xd0c5('0x3b')]){_0xc4e75d[_0xd0c5('0x3f')]=!![];}return _0x50ed33[_0xd0c5('0x19')](_0xc4e75d);}else{return logger['error'](_0xd0c5('0x2b'),'afterCreate',_0xd0c5('0x59'),util[_0xd0c5('0x2d')](_0x381362['error'],{'showHidden':![],'depth':null}));}})[_0xd0c5('0x1a')](function(_0x3d4785){return logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x59'),util[_0xd0c5('0x2d')](_0x3d4785,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),'afterCreate','csc',_0xd0c5('0x67'));}break;case'clickatell':if(_0x57c76a['apiKey']){var _0x42803f={'method':_0xd0c5('0x3c'),'uri':_0xd0c5('0x68'),'headers':{'Authorization':_0x57c76a[_0xd0c5('0x5b')]},'body':{'content':_0x410037[_0xd0c5('0xc')],'to':[_0x410037['phone']],'from':_0x57c76a['phone'],'binary':![],'clientMessageId':_0xd0c5('0x69'),'charset':_0xd0c5('0x6a')},'json':!![]};rp(_0x42803f)[_0xd0c5('0x18')](function(_0x3afa97){if(!_0x3afa97[_0xd0c5('0x2a')]){var _0x3eecb6={'messageId':_0x3afa97[_0xd0c5('0x23')][0x0]['apiMessageId']};if(!_0x57c76a[_0xd0c5('0x3b')]){_0x3eecb6[_0xd0c5('0x3f')]=!![];}return _0x50ed33[_0xd0c5('0x19')](_0x3eecb6);}else{return logger[_0xd0c5('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd0c5('0x2c'),'clickatell',util[_0xd0c5('0x2d')](_0x3afa97[_0xd0c5('0x2a')],{'showHidden':![],'depth':null}));}})[_0xd0c5('0x1a')](function(_0x3595f3){return logger[_0xd0c5('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd0c5('0x2c'),_0xd0c5('0x6b'),util[_0xd0c5('0x2d')](_0x3595f3,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),'clickatell',_0xd0c5('0x67'));}break;case'bandwidth':if(_0x57c76a[_0xd0c5('0x31')]&&_0x57c76a[_0xd0c5('0x35')]){var _0x464989=util[_0xd0c5('0x43')](_0xd0c5('0x44'),_0x57c76a[_0xd0c5('0x31')],_0x57c76a[_0xd0c5('0x35')]);var _0x33a77b={'method':'POST','uri':_0xd0c5('0x6c')+_0x57c76a['accountId']+_0xd0c5('0x6d'),'body':{'to':[_0x410037[_0xd0c5('0x21')]],'text':_0x410037[_0xd0c5('0xc')],'from':_0x57c76a[_0xd0c5('0x21')],'applicationId':_0x57c76a[_0xd0c5('0x6e')]},'headers':{'Authorization':util[_0xd0c5('0x43')](_0xd0c5('0x46'),new Buffer(_0x464989)[_0xd0c5('0x50')](_0xd0c5('0x6f')))},'json':!![]};rp(_0x33a77b)['then'](function(_0x325458){if(_0x325458['id']){var _0x28ea50={'messageId':_0x325458['id']};return _0x50ed33[_0xd0c5('0x19')](_0x28ea50);}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),'afterCreate',_0xd0c5('0x70'),util[_0xd0c5('0x2d')](_0x325458,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3d66e3){logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x70'),util[_0xd0c5('0x2d')](_0x3d66e3,{'showHidden':![],'depth':null}));});}else{logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x70'),_0xd0c5('0x4d'));}break;case _0xd0c5('0x71'):if(_0x57c76a['apiKey']){var _0xd0c69e={};var _0x246793={'method':_0xd0c5('0x3c'),'uri':_0xd0c5('0x72'),'headers':{'Authorization':_0xd0c5('0x73')+_0x57c76a[_0xd0c5('0x5b')],'Content-Type':_0xd0c5('0x74')},'body':{'from':_0x57c76a[_0xd0c5('0x21')],'to':_0x410037[_0xd0c5('0x21')],'text':_0x410037[_0xd0c5('0xc')]},'json':!![]};return rp(_0x246793)['then'](function(_0x2fdb9c){if(_0x2fdb9c['code']==0xca){_0xd0c69e[_0xd0c5('0x75')]=_0x2fdb9c;var _0x233bde={'method':_0xd0c5('0x3c'),'uri':_0xd0c5('0x76'),'headers':{'Authorization':_0xd0c5('0x73')+_0x57c76a[_0xd0c5('0x5b')],'Content-Type':_0xd0c5('0x74')},'body':{'refid':_0xd0c69e[_0xd0c5('0x75')][_0xd0c5('0x77')]},'json':!![]};return rp(_0x233bde)['then'](function(_0x485662){_0xd0c69e[_0xd0c5('0x78')]=_0x485662;var _0x15f29b={'messageId':_0xd0c69e[_0xd0c5('0x75')][_0xd0c5('0x77')],'read':!![]};return _0x50ed33[_0xd0c5('0x19')](_0x15f29b);});}else{return logger[_0xd0c5('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd0c5('0x2c'),_0xd0c5('0x71'),util['inspect'](_0x2fdb9c,{'showHidden':![],'depth':null}));}})[_0xd0c5('0x1a')](function(_0x2c3ae8){return logger[_0xd0c5('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd0c5('0x2c'),_0xd0c5('0x71'),util[_0xd0c5('0x2d')](_0x2c3ae8,{'showHidden':![],'depth':null}));});}else{return logger[_0xd0c5('0x2a')](_0xd0c5('0x2b'),_0xd0c5('0x2c'),_0xd0c5('0x71'),_0xd0c5('0x79'));}break;}}})[_0xd0c5('0x7a')](function(){_0x3d53ab();});}else{_0x3d53ab();}}},'charset':_0xd0c5('0x7b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1542=['hex','signature=','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','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','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','createdAt','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','phone','/status?token=','token','update','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','read','error','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x116));var _0x2154=function(_0xcf22a8,_0x35d51c){_0xcf22a8=_0xcf22a8-0x0;var _0x1137eb=_0x1542[_0xcf22a8];return _0x1137eb;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var logger=require(_0x2154('0x2'))(_0x2154('0x3'));var moment=require(_0x2154('0x4'));var BPromise=require('bluebird');var rp=require(_0x2154('0x5'));var fs=require('fs');var path=require(_0x2154('0x6'));var rimraf=require(_0x2154('0x7'));var config=require('../../config/environment');var attributes=require(_0x2154('0x8'));module[_0x2154('0x9')]=function(_0x5406f9,_0x13d9c2){return _0x5406f9[_0x2154('0xa')](_0x2154('0xb'),attributes,{'tableName':_0x2154('0xc'),'paranoid':![],'indexes':[{'name':_0x2154('0xd'),'fields':[_0x2154('0xd')]},{'name':_0x2154('0xe'),'fields':[_0x2154('0xf')],'type':_0x2154('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a5489,_0x4fcde5,_0xe2c6bd){var _0x388079=_0x5406f9[_0x2154('0x11')];var _0x5a4858=_0x1a5489['get']({'plain':!![]});if(_0x5a4858[_0x2154('0x12')][_0x2154('0x13')]()==='in'||_0x5a4858['direction'][_0x2154('0x13')]()===_0x2154('0x14')&&!_0x5a4858[_0x2154('0x15')]&&!_[_0x2154('0x16')](_0x5a4858[_0x2154('0x17')])){_0x388079[_0x2154('0x18')][_0x2154('0x19')]({'where':{'id':_0x5a4858['SmsInteractionId']}})['then'](function(_0x160517){if(_0x160517){_0x160517['update']({'lastMsgAt':_0x5a4858[_0x2154('0x1a')],'lastMsgDirection':_0x5a4858['direction']['toLowerCase']()});}})['catch'](function(_0x46c995){console['error'](_0x46c995);});}if(_0x5a4858[_0x2154('0x12')]==='out'&&!_0x5a4858[_0x2154('0x15')]){var _0x369ab6;_0x388079[_0x2154('0x1b')][_0x2154('0x1c')]({'where':{'id':_0x5a4858[_0x2154('0x1d')]},'raw':!![]})[_0x2154('0x1e')](function(_0x15c197){_0x369ab6=_0x15c197;if(_0x369ab6&&_0x369ab6[_0x2154('0x1f')]){switch(_0x369ab6[_0x2154('0x1f')]){case _0x2154('0x20'):var _0x50ed9b=require(_0x2154('0x20'));if(_0x369ab6[_0x2154('0x21')]&&_0x369ab6[_0x2154('0x22')]&&_0x369ab6['phone']){var _0x2af3dd=new _0x50ed9b(_0x369ab6[_0x2154('0x21')],_0x369ab6[_0x2154('0x22')]);_0x2af3dd[_0x2154('0x23')]['create']({'body':_0x5a4858[_0x2154('0xf')],'to':_0x5a4858[_0x2154('0x24')],'from':_0x369ab6[_0x2154('0x24')],'statusCallback':_0x369ab6['remote']+'/api/sms/messages/'+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]})[_0x2154('0x1e')](function(_0x4ef4f7){if(_0x4ef4f7['sid']){return _0x1a5489[_0x2154('0x27')]({'messageId':_0x4ef4f7[_0x2154('0x28')]});}})[_0x2154('0x29')](function(_0x3b4fa8){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),util['inspect'](_0x3b4fa8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2154('0x2c'):var _0xd780d=_0x2154('0x2d');if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x5cd152={'recipient':[_0x5a4858[_0x2154('0x24')]],'message':_0x5a4858[_0x2154('0xf')],'message_type':_0x369ab6[_0x2154('0x30')]};if(_0x369ab6[_0x2154('0x30')]&&_0x369ab6[_0x2154('0x30')]!=='SI'){_0x5cd152[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];}var _0x133f98={'url':_0xd780d+_0x2154('0x32')+_0x369ab6[_0x2154('0x2e')]+'&password='+_0x369ab6[_0x2154('0x2f')],'method':'GET'};rp(_0x133f98)['then'](function(_0x883503){var _0x106d3e=_0x883503[_0x2154('0x33')](';');var _0x5a701e={'user_key':_0x106d3e[0x0],'session_key':_0x106d3e[0x1]};_0x133f98={'url':_0xd780d+_0x2154('0x34'),'method':_0x2154('0x35'),'headers':{'user_key':_0x5a701e[_0x2154('0x36')],'Session_key':_0x5a701e[_0x2154('0x37')]},'json':!![],'body':_0x5cd152};return rp(_0x133f98);})[_0x2154('0x1e')](function(_0x3a252a){if(_0x3a252a[_0x2154('0x38')]>=0x1){var _0x3d38f3={'messageId':_0x3a252a['internal_order_id']};if(_0x369ab6[_0x2154('0x30')]!=='GP'||!_0x369ab6['deliveryReport']){_0x3d38f3[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x3d38f3);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',util['inspect'](_0x3a252a,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ff05a){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x2c'),util[_0x2154('0x3b')](_0x3ff05a,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',_0x2154('0x3c'));}break;case'connectel':if(_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'recipient':_0x5a4858[_0x2154('0x24')],'message':_0x5a4858[_0x2154('0xf')],'sender':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')],'authorization':_0x369ab6['authToken']};var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x3e'),'body':_0x2a1edb,'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x1a4167){var _0x12e7c5={'messageId':_0x1a4167[_0x2154('0x3f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x12e7c5[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x12e7c5);})['catch'](function(_0x5d77b0){logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x41'),util[_0x2154('0x3b')](_0x5d77b0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x2154('0x42'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x2a1edb={'messages':[{'source':_0x2154('0x43'),'to':_0x5a4858[_0x2154('0x24')],'body':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')]}]};var _0x61a813=util[_0x2154('0x44')]('%s:%s',_0x369ab6['username'],_0x369ab6[_0x2154('0x2f')]);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x45'),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x243dc0){if(_0x243dc0[_0x2154('0x48')]>=0xc8&&_0x243dc0[_0x2154('0x48')]<=0xce){if(_0x243dc0[_0x2154('0x49')]&&_0x243dc0['data']['queued_count']>0x0){var _0x4dbc52=_[_0x2154('0x4a')](_0x243dc0['data']['messages']);var _0x18f0ba={'messageId':_0x4dbc52[_0x2154('0x4b')]};if(!_0x369ab6[_0x2154('0x40')]){_0x18f0ba[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x18f0ba);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate','clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ab5aa){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),util[_0x2154('0x3b')](_0x3ab5aa,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x4d'):if(_0x369ab6[_0x2154('0x4e')]&&_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'dst':_0x5a4858['phone'],'text':_0x5a4858[_0x2154('0xf')],'src':_0x369ab6['senderString']||_0x369ab6['phone'],'url':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]};var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x4e')],_0x369ab6[_0x2154('0x22')]);var _0x4fcde5={'method':'POST','uri':util['format'](_0x2154('0x52'),_0x369ab6['authId']),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')]('Basic\x20%s',new Buffer(_0x61a813)[_0x2154('0x53')](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x3b948c){var _0xfa774b={'messageId':_0x3b948c[_0x2154('0x54')][0x0]};return _0x1a5489[_0x2154('0x27')](_0xfa774b);})[_0x2154('0x29')](function(_0x3a7f71){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4d'),util[_0x2154('0x3b')](_0x3a7f71,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x4d'),_0x2154('0x55'));}break;case _0x2154('0x56'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6['password']){if(_0x369ab6['baseUrl']){var _0x5a7f97={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x58'),'body':{'username':_0x369ab6[_0x2154('0x2e')],'password':_0x369ab6['password']},'json':!![]};return rp(_0x5a7f97)[_0x2154('0x1e')](function(_0x420702){var _0x186040={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x369ab6[_0x2154('0x24')],'destinations':[{'to':_0x5a4858['phone']}],'text':_0x5a4858[_0x2154('0xf')],'notifyUrl':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')],'notifyContentType':_0x2154('0x59'),'callbackData':_0x369ab6['phone']+';'+_0x5a4858[_0x2154('0xf')]}]},'headers':{'Authorization':_0x2154('0x5a')+_0x420702[_0x2154('0x26')]},'json':!![]};return rp(_0x186040)[_0x2154('0x1e')](function(_0xae4338){if(_0xae4338[_0x2154('0x23')]){var _0xc1c1a4={'messageId':_0xae4338['messages'][0x0][_0x2154('0xd')]};if(!_0x369ab6[_0x2154('0x40')]){_0xc1c1a4[_0x2154('0x39')]=!![];}return _0x1a5489['update'](_0xc1c1a4);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'infobip',util[_0x2154('0x3b')](_0xae4338,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x49c55a){return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x56'),util[_0x2154('0x3b')](_0x49c55a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),'afterCreate','infobip',_0x2154('0x5b'));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x5c'):var _0x5cdc86=require(_0x2154('0x5d'));if(_0x369ab6[_0x2154('0x5e')]){var _0xc1dd4f={};_0xc1dd4f[_0x2154('0x5f')]=_0x369ab6['username'];_0xc1dd4f[_0x2154('0x24')]=_0x5a4858['phone'];_0xc1dd4f[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];_0xc1dd4f['text']=_0x5a4858[_0x2154('0xf')];_0xc1dd4f[_0x2154('0x60')]=+new Date();var _0x3c148d='';var _0x5730bc='';var _0x5076bd=Object[_0x2154('0x61')](_0xc1dd4f);_0x5076bd[_0x2154('0x62')]();for(var _0x589c4a=0x0;_0x589c4a<_0x5076bd[_0x2154('0x63')];_0x589c4a++){if(_0x3c148d!=''){_0x3c148d+='&';}_0x3c148d+=_0x5076bd[_0x589c4a]+'='+encodeURIComponent(_0xc1dd4f[_0x5076bd[_0x589c4a]]);_0x5730bc+=_0xc1dd4f[_0x5076bd[_0x589c4a]];}_0x5730bc+=_0x369ab6[_0x2154('0x5e')];_0x5730bc=_0x5cdc86[_0x2154('0x64')](_0x2154('0x65'))[_0x2154('0x27')](_0x5730bc)[_0x2154('0x66')](_0x2154('0x67'));if(_0x3c148d!==''){_0x3c148d+='&';}_0x3c148d+=_0x2154('0x68')+_0x5730bc;var _0x133f98={'method':_0x2154('0x69'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x6a')+_0x3c148d,'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x305b09){var _0x170113=Object[_0x2154('0x61')](_0x305b09);if(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')]&&parseInt(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')])===0x0){var _0x106df9={'messageId':_0x305b09[_0x170113[0x0]]['id_sms']};if(!_0x369ab6[_0x2154('0x40')]){_0x106df9[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x106df9);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'csc',util['inspect'](_0x305b09['error'],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0xea4ecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'csc',util[_0x2154('0x3b')](_0xea4ecb,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x5c'),_0x2154('0x6b'));}break;case _0x2154('0x6c'):if(_0x369ab6[_0x2154('0x5e')]){var _0x50021b={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x369ab6['apiKey']},'body':{'content':_0x5a4858[_0x2154('0xf')],'to':[_0x5a4858[_0x2154('0x24')]],'from':_0x369ab6['phone'],'binary':![],'clientMessageId':_0x2154('0x6d'),'charset':_0x2154('0x6e')},'json':!![]};rp(_0x50021b)[_0x2154('0x1e')](function(_0x4eac49){if(!_0x4eac49[_0x2154('0x3a')]){var _0x380a61={'messageId':_0x4eac49['messages'][0x0][_0x2154('0x6f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x380a61[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x380a61);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),util[_0x2154('0x3b')](_0x4eac49[_0x2154('0x3a')],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x152691){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickatell',util[_0x2154('0x3b')](_0x152691,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),_0x2154('0x6b'));}break;case _0x2154('0x70'):if(_0x369ab6['username']&&_0x369ab6[_0x2154('0x2f')]){var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x2e')],_0x369ab6['password']);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x71')+_0x369ab6[_0x2154('0x72')]+'/messages','body':{'to':[_0x5a4858[_0x2154('0x24')]],'text':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6['phone'],'applicationId':_0x369ab6[_0x2154('0x73')]},'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x4c422c){if(_0x4c422c['id']){var _0x1feca3={'messageId':_0x4c422c['id']};return _0x1a5489['update'](_0x1feca3);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x4c422c,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x33ffb7){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x33ffb7,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x74'):if(_0x369ab6[_0x2154('0x5e')]){var _0x5f3da9={};var _0x133f98={'method':_0x2154('0x35'),'uri':_0x2154('0x75'),'headers':{'Authorization':_0x2154('0x76')+_0x369ab6[_0x2154('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x369ab6[_0x2154('0x24')],'to':_0x5a4858[_0x2154('0x24')],'text':_0x5a4858[_0x2154('0xf')]},'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x357414){if(_0x357414[_0x2154('0x77')]==0xca){_0x5f3da9[_0x2154('0x78')]=_0x357414;var _0x3a559e={'method':_0x2154('0x35'),'uri':_0x2154('0x79'),'headers':{'Authorization':'Bearer\x20'+_0x369ab6[_0x2154('0x5e')],'Content-Type':_0x2154('0x59')},'body':{'refid':_0x5f3da9[_0x2154('0x78')][_0x2154('0x7a')]},'json':!![]};return rp(_0x3a559e)[_0x2154('0x1e')](function(_0x405dd6){_0x5f3da9[_0x2154('0x7b')]=_0x405dd6;var _0x143be5={'messageId':_0x5f3da9[_0x2154('0x78')]['refid'],'read':!![]};return _0x1a5489[_0x2154('0x27')](_0x143be5);});}else{return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x357414,{'showHidden':![],'depth':null}));}})['catch'](function(_0x30cecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x30cecb,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),_0x2154('0x7c'));}break;}}})[_0x2154('0x7d')](function(){_0xe2c6bd();});}else{_0xe2c6bd();}}},'charset':_0x2154('0x7e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3b2c9f9..c41d908 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 _0x5132=['body','options','raw','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','create'];(function(_0x4c3460,_0xa0c36a){var _0x920115=function(_0x4b3a87){while(--_0x4b3a87){_0x4c3460['push'](_0x4c3460['shift']());}};_0x920115(++_0xa0c36a);}(_0x5132,0x1a5));var _0x2513=function(_0x29f566,_0xefe978){_0x29f566=_0x29f566-0x0;var _0x230ed2=_0x5132[_0x29f566];return _0x230ed2;};'use strict';var _=require(_0x2513('0x0'));var util=require('util');var moment=require(_0x2513('0x1'));var BPromise=require(_0x2513('0x2'));var rs=require(_0x2513('0x3'));var fs=require('fs');var Redis=require(_0x2513('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2513('0x5'));var logger=require(_0x2513('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2513('0x7'));var client=jayson[_0x2513('0x8')][_0x2513('0x9')]({'port':0x232a});config[_0x2513('0xa')]=_['defaults'](config[_0x2513('0xa')],{'host':_0x2513('0xb'),'port':0x18eb});var socket=require(_0x2513('0xc'))(new Redis(config[_0x2513('0xa')]));require(_0x2513('0xd'))['register'](socket);function respondWithRpcPromise(_0x3a84d1,_0x3d3d9f,_0x4453c7){return new BPromise(function(_0x2afe40,_0x19dfc1){return client[_0x2513('0xe')](_0x3a84d1,_0x4453c7)[_0x2513('0xf')](function(_0x673518){logger[_0x2513('0x10')](_0x2513('0x11'),_0x3d3d9f,_0x2513('0x12'));logger['debug'](_0x2513('0x13'),_0x3d3d9f,_0x2513('0x12'),JSON[_0x2513('0x14')](_0x673518));if(_0x673518['error']){if(_0x673518[_0x2513('0x15')][_0x2513('0x16')]===0x1f4){logger[_0x2513('0x15')](_0x2513('0x11'),_0x3d3d9f,_0x673518[_0x2513('0x15')][_0x2513('0x17')]);return _0x19dfc1(_0x673518[_0x2513('0x15')][_0x2513('0x17')]);}logger[_0x2513('0x15')](_0x2513('0x11'),_0x3d3d9f,_0x673518['error'][_0x2513('0x17')]);return _0x2afe40(_0x673518[_0x2513('0x15')]['message']);}else{logger[_0x2513('0x10')](_0x2513('0x11'),_0x3d3d9f,_0x2513('0x12'));_0x2afe40(_0x673518[_0x2513('0x18')][_0x2513('0x17')]);}})['catch'](function(_0x429891){logger[_0x2513('0x15')](_0x2513('0x11'),_0x3d3d9f,_0x429891);_0x19dfc1(_0x429891);});});}exports[_0x2513('0x19')]=function(_0x2b692b){var _0x32699b=this;return new Promise(function(_0x444e0a,_0x4c4a3){return db['SmsMessage'][_0x2513('0x1a')](_0x2b692b[_0x2513('0x1b')],{'raw':_0x2b692b[_0x2513('0x1c')]?_0x2b692b['options'][_0x2513('0x1d')]===undefined?!![]:![]:!![]})[_0x2513('0xf')](function(_0x5315e3){logger[_0x2513('0x10')](_0x2513('0x19'),_0x2b692b);logger[_0x2513('0x1e')](_0x2513('0x19'),_0x2b692b,JSON[_0x2513('0x14')](_0x5315e3));_0x444e0a(_0x5315e3);})[_0x2513('0x1f')](function(_0xe8cf07){logger[_0x2513('0x15')]('CreateSmsMessage',_0xe8cf07[_0x2513('0x17')],_0x2b692b);_0x4c4a3(_0x32699b[_0x2513('0x15')](0x1f4,_0xe8cf07[_0x2513('0x17')]));});});}; \ No newline at end of file +var _0xd179=['jayson/promise','client','http','defaults','redis','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsMessage','body','options','raw','then','CreateSmsMessage','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x509c71,_0x15734b){var _0x32e44c=function(_0x10e513){while(--_0x10e513){_0x509c71['push'](_0x509c71['shift']());}};_0x32e44c(++_0x15734b);}(_0xd179,0x132));var _0x9d17=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xd179[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x9d17('0x0'));var util=require(_0x9d17('0x1'));var moment=require('moment');var BPromise=require(_0x9d17('0x2'));var rs=require(_0x9d17('0x3'));var fs=require('fs');var Redis=require(_0x9d17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d17('0x5'));var logger=require(_0x9d17('0x6'))(_0x9d17('0x7'));var config=require(_0x9d17('0x8'));var jayson=require(_0x9d17('0x9'));var client=jayson[_0x9d17('0xa')][_0x9d17('0xb')]({'port':0x232a});config['redis']=_[_0x9d17('0xc')](config[_0x9d17('0xd')],{'host':_0x9d17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d17('0xf'))[_0x9d17('0x10')](socket);function respondWithRpcPromise(_0x41c788,_0x4d2fd3,_0x3b79b9){return new BPromise(function(_0x41a5ad,_0x258dac){return client[_0x9d17('0x11')](_0x41c788,_0x3b79b9)['then'](function(_0x444164){logger[_0x9d17('0x12')](_0x9d17('0x13'),_0x4d2fd3,_0x9d17('0x14'));logger[_0x9d17('0x15')](_0x9d17('0x16'),_0x4d2fd3,_0x9d17('0x14'),JSON[_0x9d17('0x17')](_0x444164));if(_0x444164[_0x9d17('0x18')]){if(_0x444164[_0x9d17('0x18')][_0x9d17('0x19')]===0x1f4){logger[_0x9d17('0x18')]('SmsMessage,\x20%s,\x20%s',_0x4d2fd3,_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);return _0x258dac(_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);}logger[_0x9d17('0x18')](_0x9d17('0x13'),_0x4d2fd3,_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);return _0x41a5ad(_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);}else{logger['info'](_0x9d17('0x13'),_0x4d2fd3,'request\x20sent');_0x41a5ad(_0x444164[_0x9d17('0x1b')]['message']);}})[_0x9d17('0x1c')](function(_0x50f687){logger[_0x9d17('0x18')](_0x9d17('0x13'),_0x4d2fd3,_0x50f687);_0x258dac(_0x50f687);});});}exports['CreateSmsMessage']=function(_0xbf331d){var _0x40dca3=this;return new Promise(function(_0x3b7c2f,_0x5599fe){return db[_0x9d17('0x1d')]['create'](_0xbf331d[_0x9d17('0x1e')],{'raw':_0xbf331d[_0x9d17('0x1f')]?_0xbf331d[_0x9d17('0x1f')][_0x9d17('0x20')]===undefined?!![]:![]:!![]})[_0x9d17('0x21')](function(_0x163f99){logger[_0x9d17('0x12')](_0x9d17('0x22'),_0xbf331d);logger[_0x9d17('0x15')]('CreateSmsMessage',_0xbf331d,JSON[_0x9d17('0x17')](_0x163f99));_0x3b7c2f(_0x163f99);})[_0x9d17('0x1c')](function(_0x1ad328){logger[_0x9d17('0x18')](_0x9d17('0x22'),_0x1ad328[_0x9d17('0x1a')],_0xbf331d);_0x5599fe(_0x40dca3[_0x9d17('0x18')](0x1f4,_0x1ad328[_0x9d17('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b45ade9..37aedfa 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 _0x5f44=['remove','update','emit','register','smsMessage:','./smsMessage.events','save'];(function(_0x271b1f,_0xdf4ebb){var _0x9a53a1=function(_0x2b5889){while(--_0x2b5889){_0x271b1f['push'](_0x271b1f['shift']());}};_0x9a53a1(++_0xdf4ebb);}(_0x5f44,0x178));var _0x45f4=function(_0x48dce4,_0x1e70ee){_0x48dce4=_0x48dce4-0x0;var _0x2d8f06=_0x5f44[_0x48dce4];return _0x2d8f06;};'use strict';var SmsMessageEvents=require(_0x45f4('0x0'));var events=[_0x45f4('0x1'),_0x45f4('0x2'),_0x45f4('0x3')];function createListener(_0x393b9c,_0x5b7352){return function(_0x271b8c){_0x5b7352[_0x45f4('0x4')](_0x393b9c,_0x271b8c);};}function removeListener(_0x35d9a9,_0x5b2dfd){return function(){SmsMessageEvents['removeListener'](_0x35d9a9,_0x5b2dfd);};}exports[_0x45f4('0x5')]=function(_0x2cd97f){for(var _0x1effe6=0x0,_0x3e99a7=events['length'];_0x1effe6<_0x3e99a7;_0x1effe6++){var _0x350af8=events[_0x1effe6];var _0x30a1b3=createListener(_0x45f4('0x6')+_0x350af8,_0x2cd97f);SmsMessageEvents['on'](_0x350af8,_0x30a1b3);}}; \ No newline at end of file +var _0xed40=['length','smsMessage:','remove','update','emit','removeListener'];(function(_0x19f040,_0x4b2d63){var _0x3ea60d=function(_0x1e093d){while(--_0x1e093d){_0x19f040['push'](_0x19f040['shift']());}};_0x3ea60d(++_0x4b2d63);}(_0xed40,0xec));var _0x0ed4=function(_0x41be5a,_0x2fa5a3){_0x41be5a=_0x41be5a-0x0;var _0x7eb7b=_0xed40[_0x41be5a];return _0x7eb7b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x0ed4('0x0'),_0x0ed4('0x1')];function createListener(_0x512178,_0x1523a8){return function(_0x26830c){_0x1523a8[_0x0ed4('0x2')](_0x512178,_0x26830c);};}function removeListener(_0xab7c4,_0x4ac282){return function(){SmsMessageEvents[_0x0ed4('0x3')](_0xab7c4,_0x4ac282);};}exports['register']=function(_0x559a63){for(var _0x4ce8f6=0x0,_0x306399=events[_0x0ed4('0x4')];_0x4ce8f6<_0x306399;_0x4ce8f6++){var _0x5a05c1=events[_0x4ce8f6];var _0x28a789=createListener(_0x0ed4('0x5')+_0x5a05c1,_0x559a63);SmsMessageEvents['on'](_0x5a05c1,_0x28a789);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 35b4ff2..8590657 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 _0xb928=['fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','Router'];(function(_0x2d9070,_0x472e9f){var _0x4bc726=function(_0x1a15b1){while(--_0x1a15b1){_0x2d9070['push'](_0x2d9070['shift']());}};_0x4bc726(++_0x472e9f);}(_0xb928,0xb0));var _0x8b92=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xb928[_0x13137e];return _0x346261;};'use strict';var multer=require(_0x8b92('0x0'));var util=require(_0x8b92('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8b92('0x2'));var router=express[_0x8b92('0x3')]();var fs_extra=require(_0x8b92('0x4'));var auth=require(_0x8b92('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b92('0x6'));var controller=require(_0x8b92('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8b92('0x8')](_0x8b92('0x9'),auth[_0x8b92('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8b92('0xb')]);router['get'](_0x8b92('0xc'),auth['isAuthenticated'](),controller[_0x8b92('0xd')]);router['get']('/:id/teams',auth[_0x8b92('0xa')](),controller[_0x8b92('0xe')]);router[_0x8b92('0x8')](_0x8b92('0xf'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x10')]);router[_0x8b92('0x11')]('/',auth[_0x8b92('0xa')](),controller[_0x8b92('0x12')]);router[_0x8b92('0x11')](_0x8b92('0x13'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x14')]);router[_0x8b92('0x11')](_0x8b92('0xf'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x15')]);router[_0x8b92('0x16')](_0x8b92('0x17'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x18')]);router[_0x8b92('0x19')](_0x8b92('0x17'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x1a')]);router[_0x8b92('0x19')](_0x8b92('0x13'),auth['isAuthenticated'](),controller[_0x8b92('0x1b')]);router[_0x8b92('0x19')](_0x8b92('0xf'),auth[_0x8b92('0xa')](),controller[_0x8b92('0x1c')]);module[_0x8b92('0x1d')]=router; \ No newline at end of file +var _0xf95a=['isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addAgents','put','delete','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5cb1e1,_0x16a838){var _0x32947a=function(_0x149fcb){while(--_0x149fcb){_0x5cb1e1['push'](_0x5cb1e1['shift']());}};_0x32947a(++_0x16a838);}(_0xf95a,0x1ca));var _0xaf95=function(_0xfaeca1,_0x250140){_0xfaeca1=_0xfaeca1-0x0;var _0x587458=_0xf95a[_0xfaeca1];return _0x587458;};'use strict';var multer=require(_0xaf95('0x0'));var util=require('util');var path=require(_0xaf95('0x1'));var timeout=require(_0xaf95('0x2'));var express=require(_0xaf95('0x3'));var router=express[_0xaf95('0x4')]();var fs_extra=require(_0xaf95('0x5'));var auth=require(_0xaf95('0x6'));var interaction=require(_0xaf95('0x7'));var config=require(_0xaf95('0x8'));var controller=require('./smsQueue.controller');router[_0xaf95('0x9')]('/',auth[_0xaf95('0xa')](),controller['index']);router['get'](_0xaf95('0xb'),auth[_0xaf95('0xa')](),controller[_0xaf95('0xc')]);router['get'](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller[_0xaf95('0xe')]);router[_0xaf95('0x9')](_0xaf95('0xf'),auth['isAuthenticated'](),controller[_0xaf95('0x10')]);router[_0xaf95('0x9')]('/:id/teams',auth[_0xaf95('0xa')](),controller[_0xaf95('0x11')]);router['get'](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller['getAgents']);router[_0xaf95('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xaf95('0x14'),auth[_0xaf95('0xa')](),controller['addTeams']);router[_0xaf95('0x13')](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller[_0xaf95('0x15')]);router[_0xaf95('0x16')](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller['update']);router[_0xaf95('0x17')](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller['destroy']);router[_0xaf95('0x17')](_0xaf95('0x14'),auth['isAuthenticated'](),controller[_0xaf95('0x18')]);router['delete'](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller['removeAgents']);module[_0xaf95('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 9650b57..5c4e3a5 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 _0x7f24=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x35c43e,_0x2b91ac){var _0x3fc0e7=function(_0x22acee){while(--_0x22acee){_0x35c43e['push'](_0x35c43e['shift']());}};_0x3fc0e7(++_0x2b91ac);}(_0x7f24,0xcf));var _0x47f2=function(_0x580a59,_0x21266c){_0x580a59=_0x580a59-0x0;var _0x19da51=_0x7f24[_0x580a59];return _0x19da51;};'use strict';var Sequelize=require(_0x47f2('0x0'));module[_0x47f2('0x1')]={'name':{'type':Sequelize[_0x47f2('0x2')],'unique':_0x47f2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x47f2('0x2')]},'timeout':{'type':Sequelize[_0x47f2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x47f2('0x5')](_0x47f2('0x6'),_0x47f2('0x7'),_0x47f2('0x8'))}}; \ No newline at end of file +var _0xb198=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x6a3f00,_0x334350){var _0x5a5f5e=function(_0xedceb1){while(--_0xedceb1){_0x6a3f00['push'](_0x6a3f00['shift']());}};_0x5a5f5e(++_0x334350);}(_0xb198,0x141));var _0x8b19=function(_0x44c4dc,_0x3cf883){_0x44c4dc=_0x44c4dc-0x0;var _0x18ccc3=_0xb198[_0x44c4dc];return _0x18ccc3;};'use strict';var Sequelize=require(_0x8b19('0x0'));module[_0x8b19('0x1')]={'name':{'type':Sequelize[_0x8b19('0x2')],'unique':_0x8b19('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b19('0x2')]},'timeout':{'type':Sequelize[_0x8b19('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b19('0x5')](_0x8b19('0x6'),_0x8b19('0x7'),_0x8b19('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index ee0505b..01c3211 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 _0x553a=['ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','removeAgents','emit','userSmsQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','options','includeAll','include','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','findAll','User','UserId','agent','updatedAt','rows','format','%s/%s','smsPause','createdAt','getTeams','Team','addTeams'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x553a,0x141));var _0xa553=function(_0x1d0764,_0x2beb7c){_0x1d0764=_0x1d0764-0x0;var _0x423f49=_0x553a[_0x1d0764];return _0x423f49;};'use strict';var emlformat=require(_0xa553('0x0'));var rimraf=require(_0xa553('0x1'));var zipdir=require(_0xa553('0x2'));var jsonpatch=require(_0xa553('0x3'));var rp=require(_0xa553('0x4'));var moment=require(_0xa553('0x5'));var BPromise=require(_0xa553('0x6'));var Mustache=require(_0xa553('0x7'));var util=require(_0xa553('0x8'));var path=require('path');var sox=require(_0xa553('0x9'));var csv=require('to-csv');var ejs=require(_0xa553('0xa'));var fs=require('fs');var fs_extra=require(_0xa553('0xb'));var _=require('lodash');var squel=require(_0xa553('0xc'));var crypto=require('crypto');var jsforce=require(_0xa553('0xd'));var deskjs=require(_0xa553('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa553('0xf'));var Papa=require(_0xa553('0x10'));var Redis=require(_0xa553('0x11'));var authService=require(_0xa553('0x12'));var qs=require(_0xa553('0x13'));var as=require(_0xa553('0x14'));var hardwareService=require(_0xa553('0x15'));var logger=require(_0xa553('0x16'))(_0xa553('0x17'));var utils=require('../../config/utils');var config=require(_0xa553('0x18'));var licenseUtil=require(_0xa553('0x19'));var db=require(_0xa553('0x1a'))['db'];config[_0xa553('0x1b')]=_[_0xa553('0x1c')](config[_0xa553('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa553('0x1d'))(new Redis(config[_0xa553('0x1b')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x363bae,_0x1bdcd6){_0x1bdcd6=_0x1bdcd6||0xcc;return function(_0x5cfda0){if(_0x5cfda0){return _0x363bae[_0xa553('0x1e')](_0x1bdcd6);}return _0x363bae[_0xa553('0x1f')](_0x1bdcd6)[_0xa553('0x20')]();};}function respondWithResult(_0x453415,_0x496a6b){_0x496a6b=_0x496a6b||0xc8;return function(_0x4e0576){if(_0x4e0576){return _0x453415[_0xa553('0x1f')](_0x496a6b)['json'](_0x4e0576);}};}function respondWithFilteredResult(_0x2aea88,_0x480bb9){return function(_0x5c3c1b){if(_0x5c3c1b){var _0x16538c=typeof _0x480bb9[_0xa553('0x21')]===_0xa553('0x22')&&typeof _0x480bb9[_0xa553('0x23')]===_0xa553('0x22');var _0x5d0351=_0x5c3c1b[_0xa553('0x24')];var _0x54b5ea=_0x16538c?0x0:_0x480bb9[_0xa553('0x21')];var _0x2ec8fa=_0x16538c?_0x5c3c1b[_0xa553('0x24')]:_0x480bb9[_0xa553('0x21')]+_0x480bb9['limit'];var _0xe923e3;if(_0x2ec8fa>=_0x5d0351){_0x2ec8fa=_0x5d0351;_0xe923e3=0xc8;}else{_0xe923e3=0xce;}_0x2aea88[_0xa553('0x1f')](_0xe923e3);return _0x2aea88[_0xa553('0x25')](_0xa553('0x26'),_0x54b5ea+'-'+_0x2ec8fa+'/'+_0x5d0351)['json'](_0x5c3c1b);}return null;};}function patchUpdates(_0x3ec7e2){return function(_0xbd0963){try{jsonpatch[_0xa553('0x27')](_0xbd0963,_0x3ec7e2,!![]);}catch(_0x3b0aa5){return BPromise[_0xa553('0x28')](_0x3b0aa5);}return _0xbd0963[_0xa553('0x29')]();};}function saveUpdates(_0x38b768,_0x1e4880){return function(_0xf1fc3){if(_0xf1fc3){return _0xf1fc3[_0xa553('0x2a')](_0x38b768)[_0xa553('0x2b')](function(_0x4b89c3){return _0x4b89c3;});}return null;};}function removeEntity(_0xbc227f,_0x558f69){return function(_0x4eadee){if(_0x4eadee){return _0x4eadee[_0xa553('0x2c')]()[_0xa553('0x2b')](function(){var _0x239ccc=_0x4eadee['get']({'plain':!![]});var _0x52f288=_0xa553('0x2d');return db[_0xa553('0x2e')]['destroy']({'where':{'type':_0x52f288,'resourceId':_0x239ccc['id']}})['then'](function(){return _0x4eadee;});})[_0xa553('0x2b')](function(){_0xbc227f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ecc92,_0x436311){return function(_0x1f9482){if(!_0x1f9482){_0x5ecc92[_0xa553('0x1e')](0x194);}return _0x1f9482;};}function handleError(_0x2d80c9,_0x1e88a3){_0x1e88a3=_0x1e88a3||0x1f4;return function(_0x100b5a){logger[_0xa553('0x2f')](_0x100b5a[_0xa553('0x30')]);if(_0x100b5a['name']){delete _0x100b5a[_0xa553('0x31')];}_0x2d80c9[_0xa553('0x1f')](_0x1e88a3)[_0xa553('0x32')](_0x100b5a);};}exports[_0xa553('0x33')]=function(_0x4f32bb,_0xaf3a8b){var _0x1b2605={},_0x4c1d62={},_0x42d071={'count':0x0,'rows':[]};var _0x4e658f=_['map'](db[_0xa553('0x34')]['rawAttributes'],function(_0x293dd8){return{'name':_0x293dd8[_0xa553('0x35')],'type':_0x293dd8['type'][_0xa553('0x36')]};});_0x4c1d62[_0xa553('0x37')]=_[_0xa553('0x38')](_0x4e658f,_0xa553('0x31'));_0x4c1d62[_0xa553('0x39')]=_[_0xa553('0x3a')](_0x4f32bb['query']);_0x4c1d62[_0xa553('0x3b')]=_[_0xa553('0x3c')](_0x4c1d62[_0xa553('0x37')],_0x4c1d62[_0xa553('0x39')]);_0x1b2605[_0xa553('0x3d')]=_[_0xa553('0x3c')](_0x4c1d62[_0xa553('0x37')],qs[_0xa553('0x3e')](_0x4f32bb['query'][_0xa553('0x3e')]));_0x1b2605[_0xa553('0x3d')]=_0x1b2605[_0xa553('0x3d')][_0xa553('0x3f')]?_0x1b2605[_0xa553('0x3d')]:_0x4c1d62[_0xa553('0x37')];if(!_0x4f32bb[_0xa553('0x39')][_0xa553('0x40')](_0xa553('0x41'))){_0x1b2605[_0xa553('0x23')]=qs[_0xa553('0x23')](_0x4f32bb[_0xa553('0x39')][_0xa553('0x23')]);_0x1b2605[_0xa553('0x21')]=qs[_0xa553('0x21')](_0x4f32bb['query'][_0xa553('0x21')]);}_0x1b2605[_0xa553('0x42')]=qs['sort'](_0x4f32bb[_0xa553('0x39')]['sort']);_0x1b2605[_0xa553('0x43')]=qs['filters'](_[_0xa553('0x44')](_0x4f32bb['query'],_0x4c1d62[_0xa553('0x3b')]),_0x4e658f);if(_0x4f32bb[_0xa553('0x39')][_0xa553('0x45')]){_0x1b2605[_0xa553('0x43')]=_['merge'](_0x1b2605['where'],{'$or':_[_0xa553('0x38')](_0x4e658f,function(_0x573f27){if(_0x573f27[_0xa553('0x46')]!=='VIRTUAL'){var _0x303bfe={};_0x303bfe[_0x573f27[_0xa553('0x31')]]={'$like':'%'+_0x4f32bb[_0xa553('0x39')]['filter']+'%'};return _0x303bfe;}})});}_0x1b2605=_[_0xa553('0x47')]({},_0x1b2605,_0x4f32bb[_0xa553('0x48')]);var _0xde5f2d={'where':_0x1b2605[_0xa553('0x43')]};return db[_0xa553('0x34')][_0xa553('0x24')](_0xde5f2d)[_0xa553('0x2b')](function(_0x34c12f){_0x42d071[_0xa553('0x24')]=_0x34c12f;if(_0x4f32bb['query'][_0xa553('0x49')]){_0x1b2605[_0xa553('0x4a')]=[{'all':!![]}];}return db[_0xa553('0x34')]['findAll'](_0x1b2605);})[_0xa553('0x2b')](function(_0x3125a1){_0x42d071['rows']=_0x3125a1;return _0x42d071;})[_0xa553('0x2b')](respondWithFilteredResult(_0xaf3a8b,_0x1b2605))[_0xa553('0x4b')](handleError(_0xaf3a8b,null));};exports[_0xa553('0x4c')]=function(_0x36c226,_0x116cca){var _0x452589={'raw':!![],'where':{'id':_0x36c226[_0xa553('0x4d')]['id']}},_0x596bb9={};_0x596bb9[_0xa553('0x37')]=_['keys'](db[_0xa553('0x34')][_0xa553('0x4e')]);_0x596bb9[_0xa553('0x39')]=_[_0xa553('0x3a')](_0x36c226[_0xa553('0x39')]);_0x596bb9[_0xa553('0x3b')]=_['intersection'](_0x596bb9['model'],_0x596bb9['query']);_0x452589[_0xa553('0x3d')]=_[_0xa553('0x3c')](_0x596bb9[_0xa553('0x37')],qs[_0xa553('0x3e')](_0x36c226['query']['fields']));_0x452589['attributes']=_0x452589['attributes'][_0xa553('0x3f')]?_0x452589[_0xa553('0x3d')]:_0x596bb9[_0xa553('0x37')];if(_0x36c226[_0xa553('0x39')][_0xa553('0x49')]){_0x452589['include']=[{'all':!![]}];}_0x452589=_[_0xa553('0x47')]({},_0x452589,_0x36c226['options']);return db['SmsQueue']['find'](_0x452589)[_0xa553('0x2b')](handleEntityNotFound(_0x116cca,null))[_0xa553('0x2b')](respondWithResult(_0x116cca,null))['catch'](handleError(_0x116cca,null));};exports[_0xa553('0x4f')]=function(_0x3f1a02,_0x293b69){return db['SmsQueue']['create'](_0x3f1a02[_0xa553('0x50')],{})[_0xa553('0x2b')](function(_0xdd0b15){var _0x4aecca=_0x3f1a02[_0xa553('0x51')][_0xa553('0x52')]({'plain':!![]});if(!_0x4aecca)throw new Error(_0xa553('0x53'));if(_0x4aecca[_0xa553('0x54')]==='user'){var _0x447a98=_0xdd0b15['get']({'plain':!![]});var _0x1881c1='SmsQueues';return db[_0xa553('0x55')][_0xa553('0x56')]({'where':{'name':_0x1881c1,'userProfileId':_0x4aecca[_0xa553('0x57')]},'raw':!![]})[_0xa553('0x2b')](function(_0x3b057c){if(_0x3b057c&&_0x3b057c['autoAssociation']===0x0){return db[_0xa553('0x2e')][_0xa553('0x4f')]({'name':_0x447a98['name'],'resourceId':_0x447a98['id'],'type':_0x3b057c[_0xa553('0x31')],'sectionId':_0x3b057c['id']},{})['then'](function(){return _0xdd0b15;});}else{return _0xdd0b15;}})[_0xa553('0x4b')](function(_0x44c3dc){logger[_0xa553('0x2f')](_0xa553('0x58'),_0x44c3dc);throw _0x44c3dc;});}return _0xdd0b15;})[_0xa553('0x2b')](respondWithResult(_0x293b69,0xc9))[_0xa553('0x4b')](handleError(_0x293b69,null));};exports[_0xa553('0x2a')]=function(_0x30c3ee,_0x3d2553){if(_0x30c3ee[_0xa553('0x50')]['id']){delete _0x30c3ee[_0xa553('0x50')]['id'];}return db[_0xa553('0x34')][_0xa553('0x56')]({'where':{'id':_0x30c3ee[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x3d2553,null))[_0xa553('0x2b')](saveUpdates(_0x30c3ee[_0xa553('0x50')],null))['then'](respondWithResult(_0x3d2553,null))[_0xa553('0x4b')](handleError(_0x3d2553,null));};exports[_0xa553('0x2c')]=function(_0x5bb8b1,_0x3dba5b){return db[_0xa553('0x34')][_0xa553('0x56')]({'where':{'id':_0x5bb8b1[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x3dba5b,null))[_0xa553('0x2b')](removeEntity(_0x3dba5b,null))[_0xa553('0x4b')](handleError(_0x3dba5b,null));};exports[_0xa553('0x59')]=function(_0x4906f7,_0xfe3d97){return db[_0xa553('0x34')][_0xa553('0x59')]()['then'](respondWithResult(_0xfe3d97,null))['catch'](handleError(_0xfe3d97,null));};exports[_0xa553('0x5a')]=function(_0x2bfff0,_0x5487b8,_0x2b2a0a){var _0x46afa3={'raw':!![],'where':{}},_0x3d0861={},_0x479d88;return db[_0xa553('0x34')][_0xa553('0x5b')]({'where':{'id':_0x2bfff0[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x5487b8,null))['then'](function(_0xcd515){if(_0xcd515){_0x479d88=_0xcd515[_0xa553('0x52')]({'plain':!![]});_0x3d0861[_0xa553('0x37')]=_[_0xa553('0x3a')](db[_0xa553('0x5c')]['rawAttributes']);_0x3d0861['query']=_[_0xa553('0x3a')](_0x2bfff0[_0xa553('0x39')]);_0x3d0861['filters']=_[_0xa553('0x3c')](_0x3d0861[_0xa553('0x37')],_0x3d0861[_0xa553('0x39')]);_0x46afa3[_0xa553('0x3d')]=_[_0xa553('0x3c')](_0x3d0861[_0xa553('0x37')],qs[_0xa553('0x3e')](_0x2bfff0[_0xa553('0x39')][_0xa553('0x3e')]));_0x46afa3[_0xa553('0x3d')]=_0x46afa3['attributes'][_0xa553('0x3f')]?_0x46afa3[_0xa553('0x3d')]:_0x3d0861[_0xa553('0x37')];if(!_0x2bfff0[_0xa553('0x39')][_0xa553('0x40')](_0xa553('0x41'))){_0x46afa3[_0xa553('0x23')]=qs['limit'](_0x2bfff0[_0xa553('0x39')][_0xa553('0x23')]);_0x46afa3[_0xa553('0x21')]=qs['offset'](_0x2bfff0['query'][_0xa553('0x21')]);}_0x46afa3['order']=qs[_0xa553('0x5d')](_0x2bfff0[_0xa553('0x39')]['sort']);_0x46afa3[_0xa553('0x43')]=qs[_0xa553('0x3b')](_[_0xa553('0x44')](_0x2bfff0[_0xa553('0x39')],_0x3d0861[_0xa553('0x3b')]));_0x46afa3['where'][_0xa553('0x5e')]=_0xcd515['id'];if(_0x2bfff0[_0xa553('0x39')][_0xa553('0x45')]){_0x46afa3['where']=_[_0xa553('0x47')](_0x46afa3['where'],{'$or':_[_0xa553('0x38')](_0x46afa3[_0xa553('0x3d')],function(_0x197d0f){var _0x5cd068={};_0x5cd068[_0x197d0f]={'$like':'%'+_0x2bfff0[_0xa553('0x39')]['filter']+'%'};return _0x5cd068;})});}_0x46afa3=_[_0xa553('0x47')]({},_0x46afa3,_0x2bfff0[_0xa553('0x48')]);return db[_0xa553('0x5c')][_0xa553('0x5f')](_0x46afa3);}})[_0xa553('0x2b')](function(_0x5c5fed){if(_0x5c5fed){return db[_0xa553('0x60')]['findAndCountAll']({'where':{'id':_[_0xa553('0x38')](_0x5c5fed,_0xa553('0x61')),'role':_0xa553('0x62')},'attributes':['id',_0xa553('0x31'),'smsPause',_0xa553('0x63'),'createdAt']});}})[_0xa553('0x2b')](function(_0x436ee0){if(_0x436ee0){return{'count':_0x436ee0[_0xa553('0x24')],'rows':_['map'](_0x436ee0[_0xa553('0x64')],function(_0x945ae7){return{'membername':_0x945ae7[_0xa553('0x31')],'UserId':_0x945ae7['id'],'queue_name':_0x479d88[_0xa553('0x31')],'SmsQueueId':_0x479d88['id'],'interface':util[_0xa553('0x65')](_0xa553('0x66'),'SIP',_0x945ae7[_0xa553('0x31')]),'penalty':0x0,'paused':_0x945ae7[_0xa553('0x67')],'createdAt':_0x945ae7[_0xa553('0x68')],'updatedAt':_0x945ae7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa553('0x2b')](respondWithFilteredResult(_0x5487b8,_0x46afa3))[_0xa553('0x4b')](handleError(_0x5487b8,null));};exports[_0xa553('0x69')]=function(_0x27b8c4,_0x319e38,_0x4662fb){var _0x1633eb={};var _0x1124be={};var _0x2d71f2;var _0x8239;return db[_0xa553('0x34')][_0xa553('0x5b')]({'where':{'id':_0x27b8c4[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x319e38,null))[_0xa553('0x2b')](function(_0x57f371){if(_0x57f371){_0x2d71f2=_0x57f371;_0x1124be[_0xa553('0x37')]=_[_0xa553('0x3a')](db[_0xa553('0x6a')][_0xa553('0x4e')]);_0x1124be[_0xa553('0x39')]=_[_0xa553('0x3a')](_0x27b8c4['query']);_0x1124be[_0xa553('0x3b')]=_[_0xa553('0x3c')](_0x1124be[_0xa553('0x37')],_0x1124be['query']);_0x1633eb[_0xa553('0x3d')]=_[_0xa553('0x3c')](_0x1124be[_0xa553('0x37')],qs[_0xa553('0x3e')](_0x27b8c4['query'][_0xa553('0x3e')]));_0x1633eb[_0xa553('0x3d')]=_0x1633eb[_0xa553('0x3d')][_0xa553('0x3f')]?_0x1633eb[_0xa553('0x3d')]:_0x1124be[_0xa553('0x37')];_0x1633eb[_0xa553('0x42')]=qs[_0xa553('0x5d')](_0x27b8c4[_0xa553('0x39')][_0xa553('0x5d')]);_0x1633eb[_0xa553('0x43')]=qs[_0xa553('0x3b')](_[_0xa553('0x44')](_0x27b8c4[_0xa553('0x39')],_0x1124be[_0xa553('0x3b')]));if(_0x27b8c4[_0xa553('0x39')][_0xa553('0x45')]){_0x1633eb['where']=_[_0xa553('0x47')](_0x1633eb[_0xa553('0x43')],{'$or':_[_0xa553('0x38')](_0x1633eb['attributes'],function(_0x2ae670){var _0x5bc866={};_0x5bc866[_0x2ae670]={'$like':'%'+_0x27b8c4[_0xa553('0x39')][_0xa553('0x45')]+'%'};return _0x5bc866;})});}_0x1633eb=_[_0xa553('0x47')]({},_0x1633eb,_0x27b8c4[_0xa553('0x48')]);return _0x2d71f2['getTeams'](_0x1633eb);}})[_0xa553('0x2b')](function(_0x385ac7){if(_0x385ac7){_0x8239=_0x385ac7[_0xa553('0x3f')];if(!_0x27b8c4[_0xa553('0x39')][_0xa553('0x40')](_0xa553('0x41'))){_0x1633eb[_0xa553('0x23')]=qs['limit'](_0x27b8c4[_0xa553('0x39')][_0xa553('0x23')]);_0x1633eb[_0xa553('0x21')]=qs[_0xa553('0x21')](_0x27b8c4['query'][_0xa553('0x21')]);}return _0x2d71f2[_0xa553('0x69')](_0x1633eb);}})[_0xa553('0x2b')](function(_0x3293ae){if(_0x3293ae){return _0x3293ae?{'count':_0x8239,'rows':_0x3293ae}:null;}})[_0xa553('0x2b')](respondWithResult(_0x319e38,null))['catch'](handleError(_0x319e38,null));};exports[_0xa553('0x6b')]=function(_0x11c3c4,_0x4706fe,_0x39c9bf){var _0xc3c884=_0x11c3c4['body'][_0xa553('0x6c')];return db[_0xa553('0x6a')][_0xa553('0x5f')]({'where':{'id':_0xc3c884},'attributes':['id'],'include':[{'model':db[_0xa553('0x60')],'as':'Agents','attributes':['id',_0xa553('0x31'),_0xa553('0x6d'),_0xa553('0x6e'),_0xa553('0x6f')],'raw':!![]}]})['then'](function(_0x55c3df){if(_0x55c3df){var _0x5b3dd1=_[_0xa553('0x70')](_0x55c3df,function(_0x4966ec){var _0x465d9e=_0x4966ec[_0xa553('0x52')]({'plain':!![]});return _0x465d9e[_0xa553('0x71')];});return db[_0xa553('0x34')][_0xa553('0x56')]({'where':{'id':_0x11c3c4[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](function(_0x2297ec){return db[_0xa553('0x72')][_0xa553('0x73')](function(_0x3561cf){return _0x2297ec['addTeams'](_0xc3c884,{'transaction':_0x3561cf})[_0xa553('0x2b')](function(){return BPromise[_0xa553('0x74')](_0x5b3dd1,function(_0x183e1a){return db[_0xa553('0x5c')][_0xa553('0x75')]({'where':{'UserId':_0x183e1a['id'],'SmsQueueId':_0x11c3c4[_0xa553('0x4d')]['id']},'transaction':_0x3561cf});});})[_0xa553('0x2b')](function(){_0x5b3dd1[_0xa553('0x76')](function(_0x661f6){socket['emit']('userSmsQueue:save',{'UserId':_0x661f6['id'],'SmsQueueId':_0x2297ec['id']});});});});});}})['then'](respondWithStatusCode(_0x4706fe,null))[_0xa553('0x4b')](handleError(_0x4706fe,null));};exports[_0xa553('0x77')]=function(_0x5056e8,_0x111cd6,_0x5d2c14){return db[_0xa553('0x6a')][_0xa553('0x5f')]({'where':{'id':_0x5056e8[_0xa553('0x39')][_0xa553('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa553('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x111cd6,null))[_0xa553('0x2b')](function(_0x5f7c51){var _0x2301de=_[_0xa553('0x38')](_0x5f7c51,'id');var _0x22222f=[];var _0x6a64f8=[];var _0x55d506=squel[_0xa553('0x78')]();_0x55d506['field'](_0xa553('0x79'))['from'](_0xa553('0x7a'),'tq')[_0xa553('0x7b')](_0xa553('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa553('0x43')](_0xa553('0x7d'),_0x5056e8[_0xa553('0x4d')]['id']);for(var _0x399dfe=0x0;_0x399dfe<_0x5f7c51['length'];_0x399dfe+=0x1){let _0x533c2c=_0x5f7c51[_0x399dfe];for(var _0x37bdaa=0x0;_0x37bdaa<_0x533c2c[_0xa553('0x71')]['length'];_0x37bdaa+=0x1){let _0x29c403=_0x533c2c[_0xa553('0x71')][_0x37bdaa];var _0x283b73=_0x55d506['clone']();_0x283b73[_0xa553('0x43')](_0xa553('0x7e'),_0x29c403['id']);_0x6a64f8[_0xa553('0x7f')](db[_0xa553('0x72')][_0xa553('0x39')](_0x283b73['toString'](),{'type':db[_0xa553('0x72')][_0xa553('0x80')][_0xa553('0x81')]})[_0xa553('0x2b')](function(_0x2df379){if(_0x2df379[_0xa553('0x3f')]===0x1){return _0x29c403['id'];}else{var _0x20c78a=_[_0xa553('0x82')](_[_0xa553('0x38')](_0x2df379,'TeamId'),function(_0x1df6c3){return _[_0xa553('0x83')](_0x2301de,_0x1df6c3);});if(_0x20c78a){return _0x29c403['id'];}}}));}}return BPromise[_0xa553('0x84')](_0x6a64f8)[_0xa553('0x2b')](function(_0x366dba){_0x22222f=_(_0x22222f)[_0xa553('0x85')](_0x366dba)[_0xa553('0x86')]()[_0xa553('0x87')]();return db[_0xa553('0x34')][_0xa553('0x56')]({'where':{'id':_0x5056e8[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](function(_0x12792e){return db[_0xa553('0x72')][_0xa553('0x73')](function(_0x5b5ae1){return _0x12792e[_0xa553('0x77')](_0x5056e8[_0xa553('0x39')]['ids'],{'transaction':_0x5b5ae1})[_0xa553('0x2b')](function(){if(!_['isEmpty'](_0x22222f)){return _0x12792e[_0xa553('0x88')](_0x22222f,{'transaction':_0x5b5ae1});}})[_0xa553('0x2b')](function(){_0x22222f[_0xa553('0x76')](function(_0x255919){socket[_0xa553('0x89')](_0xa553('0x8a'),{'UserId':_0x255919,'SmsQueueId':_0x12792e['id']});});});});});});})['then'](respondWithStatusCode(_0x111cd6,null))[_0xa553('0x4b')](handleError(_0x111cd6,null));};exports['addAgents']=function(_0x4b72ef,_0x513b98,_0x2c18ba){return db['SmsQueue'][_0xa553('0x56')]({'where':{'id':_0x4b72ef['params']['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x513b98,null))[_0xa553('0x2b')](function(_0x491373){if(_0x491373){return _0x491373['addAgents'](_0x4b72ef[_0xa553('0x50')]['ids'],_[_0xa553('0x8b')](_0x4b72ef['body'],[_0xa553('0x6c'),'id'])||{})[_0xa553('0x8c')](function(_0x18b56f){for(var _0x5430fd=0x0;_0x5430fd<_0x4b72ef['body'][_0xa553('0x6c')][_0xa553('0x3f')];_0x5430fd+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x4b72ef['body'][_0xa553('0x6c')][_0x5430fd]),'SmsQueueId':Number(_0x4b72ef[_0xa553('0x4d')]['id'])});}return _0x18b56f;});}})[_0xa553('0x2b')](respondWithResult(_0x513b98,null))[_0xa553('0x4b')](handleError(_0x513b98,null));};exports[_0xa553('0x88')]=function(_0x107b37,_0x2765e3,_0x2b0990){return db['SmsQueue']['find']({'where':{'id':_0x107b37[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x2765e3,null))[_0xa553('0x2b')](function(_0x58cef9){if(_0x58cef9){return _0x58cef9['removeAgents'](_0x107b37[_0xa553('0x39')]['ids'])['then'](function(){if(_[_0xa553('0x8d')](_0x107b37['query'][_0xa553('0x6c')])){for(var _0x367796=0x0;_0x367796<_0x107b37[_0xa553('0x39')]['ids'][_0xa553('0x3f')];_0x367796+=0x1){socket[_0xa553('0x89')](_0xa553('0x8a'),{'UserId':Number(_0x107b37['query'][_0xa553('0x6c')][_0x367796]),'SmsQueueId':Number(_0x107b37['params']['id'])});}}else{socket['emit'](_0xa553('0x8a'),{'UserId':Number(_0x107b37[_0xa553('0x39')][_0xa553('0x6c')]),'SmsQueueId':Number(_0x107b37[_0xa553('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2765e3,null))[_0xa553('0x4b')](handleError(_0x2765e3,null));};exports['getAgents']=function(_0x2ce739,_0x1f241c,_0x3d16e7){var _0x548d76={};var _0x22eee8={};var _0x3ed478;var _0x61fe37;return db[_0xa553('0x34')][_0xa553('0x5b')]({'where':{'id':_0x2ce739[_0xa553('0x4d')]['id']}})[_0xa553('0x2b')](handleEntityNotFound(_0x1f241c,null))[_0xa553('0x2b')](function(_0x1a134f){if(_0x1a134f){_0x3ed478=_0x1a134f;_0x22eee8[_0xa553('0x37')]=_[_0xa553('0x3a')](db['User']['rawAttributes']);_0x22eee8[_0xa553('0x39')]=_[_0xa553('0x3a')](_0x2ce739['query']);_0x22eee8[_0xa553('0x3b')]=_[_0xa553('0x3c')](_0x22eee8[_0xa553('0x37')],_0x22eee8[_0xa553('0x39')]);_0x548d76[_0xa553('0x3d')]=_[_0xa553('0x3c')](_0x22eee8['model'],qs['fields'](_0x2ce739[_0xa553('0x39')][_0xa553('0x3e')]));_0x548d76['attributes']=_0x548d76[_0xa553('0x3d')][_0xa553('0x3f')]?_0x548d76[_0xa553('0x3d')]:_0x22eee8[_0xa553('0x37')];_0x548d76['order']=qs['sort'](_0x2ce739['query'][_0xa553('0x5d')]);_0x548d76[_0xa553('0x43')]=qs[_0xa553('0x3b')](_[_0xa553('0x44')](_0x2ce739[_0xa553('0x39')],_0x22eee8[_0xa553('0x3b')]));if(_0x2ce739[_0xa553('0x39')][_0xa553('0x45')]){_0x548d76['where']=_[_0xa553('0x47')](_0x548d76[_0xa553('0x43')],{'$or':_['map'](_0x548d76[_0xa553('0x3d')],function(_0xbea23d){var _0x4a15ee={};_0x4a15ee[_0xbea23d]={'$like':'%'+_0x2ce739[_0xa553('0x39')][_0xa553('0x45')]+'%'};return _0x4a15ee;})});}_0x548d76=_[_0xa553('0x47')]({},_0x548d76,_0x2ce739[_0xa553('0x48')]);return _0x3ed478['getAgents'](_0x548d76);}})[_0xa553('0x2b')](function(_0x25f611){if(_0x25f611){_0x61fe37=_0x25f611[_0xa553('0x3f')];if(!_0x2ce739[_0xa553('0x39')][_0xa553('0x40')](_0xa553('0x41'))){_0x548d76[_0xa553('0x23')]=qs['limit'](_0x2ce739[_0xa553('0x39')][_0xa553('0x23')]);_0x548d76['offset']=qs[_0xa553('0x21')](_0x2ce739['query']['offset']);}return _0x3ed478[_0xa553('0x8e')](_0x548d76);}})[_0xa553('0x2b')](function(_0x4a691c){if(_0x4a691c){return _0x4a691c?{'count':_0x61fe37,'rows':_0x4a691c}:null;}})[_0xa553('0x2b')](respondWithResult(_0x1f241c,null))[_0xa553('0x4b')](handleError(_0x1f241c,null));}; \ No newline at end of file +var _0x594e=['forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','TeamId','all','union','compact','value','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','get','SmsQueues','UserProfileResource','destroy','send','index','map','SmsQueue','rawAttributes','fieldName','type','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','findOne','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','createdAt','format','%s/%s','SIP','smsPause','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each'];(function(_0x3d0c12,_0x2304fb){var _0x16d3d8=function(_0x3974ed){while(--_0x3974ed){_0x3d0c12['push'](_0x3d0c12['shift']());}};_0x16d3d8(++_0x2304fb);}(_0x594e,0x11e));var _0xe594=function(_0x11c5ef,_0x1e2cb7){_0x11c5ef=_0x11c5ef-0x0;var _0x3a334c=_0x594e[_0x11c5ef];return _0x3a334c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe594('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe594('0x1'));var moment=require('moment');var BPromise=require(_0xe594('0x2'));var Mustache=require(_0xe594('0x3'));var util=require(_0xe594('0x4'));var path=require(_0xe594('0x5'));var sox=require('sox');var csv=require(_0xe594('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe594('0x7'));var squel=require(_0xe594('0x8'));var crypto=require('crypto');var jsforce=require(_0xe594('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe594('0x6'));var querystring=require('querystring');var Papa=require(_0xe594('0xa'));var Redis=require(_0xe594('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xe594('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe594('0xd'));var logger=require('../../config/logger')(_0xe594('0xe'));var utils=require(_0xe594('0xf'));var config=require(_0xe594('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xe594('0x11'))['db'];config[_0xe594('0x12')]=_[_0xe594('0x13')](config[_0xe594('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe594('0x12')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x39dbd8,_0x48c28a){_0x48c28a=_0x48c28a||0xcc;return function(_0x1d6694){if(_0x1d6694){return _0x39dbd8[_0xe594('0x14')](_0x48c28a);}return _0x39dbd8[_0xe594('0x15')](_0x48c28a)[_0xe594('0x16')]();};}function respondWithResult(_0x2d66b4,_0x348d10){_0x348d10=_0x348d10||0xc8;return function(_0x3b1519){if(_0x3b1519){return _0x2d66b4['status'](_0x348d10)[_0xe594('0x17')](_0x3b1519);}};}function respondWithFilteredResult(_0x2d8f66,_0xd29778){return function(_0x21fd14){if(_0x21fd14){var _0x298ce4=typeof _0xd29778[_0xe594('0x18')]===_0xe594('0x19')&&typeof _0xd29778[_0xe594('0x1a')]==='undefined';var _0x4be8a1=_0x21fd14[_0xe594('0x1b')];var _0x788a9e=_0x298ce4?0x0:_0xd29778[_0xe594('0x18')];var _0x2ab6e8=_0x298ce4?_0x21fd14['count']:_0xd29778['offset']+_0xd29778[_0xe594('0x1a')];var _0x975349;if(_0x2ab6e8>=_0x4be8a1){_0x2ab6e8=_0x4be8a1;_0x975349=0xc8;}else{_0x975349=0xce;}_0x2d8f66[_0xe594('0x15')](_0x975349);return _0x2d8f66['set'](_0xe594('0x1c'),_0x788a9e+'-'+_0x2ab6e8+'/'+_0x4be8a1)[_0xe594('0x17')](_0x21fd14);}return null;};}function patchUpdates(_0x27f3e0){return function(_0x3cb664){try{jsonpatch['apply'](_0x3cb664,_0x27f3e0,!![]);}catch(_0x170b22){return BPromise['reject'](_0x170b22);}return _0x3cb664[_0xe594('0x1d')]();};}function saveUpdates(_0x3c5537,_0x44b902){return function(_0x492d50){if(_0x492d50){return _0x492d50['update'](_0x3c5537)['then'](function(_0x3b4bc6){return _0x3b4bc6;});}return null;};}function removeEntity(_0x2ef1a7,_0xfcf22d){return function(_0x24b9f3){if(_0x24b9f3){return _0x24b9f3['destroy']()[_0xe594('0x1e')](function(){var _0x518be5=_0x24b9f3[_0xe594('0x1f')]({'plain':!![]});var _0x22d844=_0xe594('0x20');return db[_0xe594('0x21')][_0xe594('0x22')]({'where':{'type':_0x22d844,'resourceId':_0x518be5['id']}})['then'](function(){return _0x24b9f3;});})['then'](function(){_0x2ef1a7[_0xe594('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x862cbe,_0x472b21){return function(_0x1452f4){if(!_0x1452f4){_0x862cbe[_0xe594('0x14')](0x194);}return _0x1452f4;};}function handleError(_0x3971ac,_0x27a2b8){_0x27a2b8=_0x27a2b8||0x1f4;return function(_0x117c94){logger['error'](_0x117c94['stack']);if(_0x117c94['name']){delete _0x117c94['name'];}_0x3971ac[_0xe594('0x15')](_0x27a2b8)[_0xe594('0x23')](_0x117c94);};}exports[_0xe594('0x24')]=function(_0x6765c8,_0xc146f4){var _0x5c2b7c={},_0x41f953={},_0x18ddca={'count':0x0,'rows':[]};var _0xd61b05=_[_0xe594('0x25')](db[_0xe594('0x26')][_0xe594('0x27')],function(_0x42e2fa){return{'name':_0x42e2fa[_0xe594('0x28')],'type':_0x42e2fa[_0xe594('0x29')]['key']};});_0x41f953['model']=_[_0xe594('0x25')](_0xd61b05,_0xe594('0x2a'));_0x41f953[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x6765c8[_0xe594('0x2b')]);_0x41f953['filters']=_[_0xe594('0x2d')](_0x41f953[_0xe594('0x2e')],_0x41f953['query']);_0x5c2b7c[_0xe594('0x2f')]=_[_0xe594('0x2d')](_0x41f953['model'],qs[_0xe594('0x30')](_0x6765c8['query'][_0xe594('0x30')]));_0x5c2b7c[_0xe594('0x2f')]=_0x5c2b7c[_0xe594('0x2f')]['length']?_0x5c2b7c['attributes']:_0x41f953[_0xe594('0x2e')];if(!_0x6765c8['query'][_0xe594('0x31')](_0xe594('0x32'))){_0x5c2b7c[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0x6765c8['query']['limit']);_0x5c2b7c[_0xe594('0x18')]=qs['offset'](_0x6765c8[_0xe594('0x2b')][_0xe594('0x18')]);}_0x5c2b7c[_0xe594('0x33')]=qs[_0xe594('0x34')](_0x6765c8[_0xe594('0x2b')][_0xe594('0x34')]);_0x5c2b7c[_0xe594('0x35')]=qs[_0xe594('0x36')](_[_0xe594('0x37')](_0x6765c8['query'],_0x41f953[_0xe594('0x36')]),_0xd61b05);if(_0x6765c8[_0xe594('0x2b')][_0xe594('0x38')]){_0x5c2b7c['where']=_['merge'](_0x5c2b7c[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0xd61b05,function(_0x51a313){if(_0x51a313[_0xe594('0x29')]!==_0xe594('0x39')){var _0x4272fd={};_0x4272fd[_0x51a313['name']]={'$like':'%'+_0x6765c8[_0xe594('0x2b')][_0xe594('0x38')]+'%'};return _0x4272fd;}})});}_0x5c2b7c=_['merge']({},_0x5c2b7c,_0x6765c8['options']);var _0x469186={'where':_0x5c2b7c['where']};return db[_0xe594('0x26')][_0xe594('0x1b')](_0x469186)[_0xe594('0x1e')](function(_0xd89499){_0x18ddca[_0xe594('0x1b')]=_0xd89499;if(_0x6765c8[_0xe594('0x2b')][_0xe594('0x3a')]){_0x5c2b7c['include']=[{'all':!![]}];}return db[_0xe594('0x26')][_0xe594('0x3b')](_0x5c2b7c);})[_0xe594('0x1e')](function(_0x2c432f){_0x18ddca[_0xe594('0x3c')]=_0x2c432f;return _0x18ddca;})[_0xe594('0x1e')](respondWithFilteredResult(_0xc146f4,_0x5c2b7c))[_0xe594('0x3d')](handleError(_0xc146f4,null));};exports[_0xe594('0x3e')]=function(_0xb684eb,_0xe866f){var _0x4285a1={'raw':!![],'where':{'id':_0xb684eb[_0xe594('0x3f')]['id']}},_0x3a51dc={};_0x3a51dc[_0xe594('0x2e')]=_[_0xe594('0x2c')](db['SmsQueue']['rawAttributes']);_0x3a51dc[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0xb684eb[_0xe594('0x2b')]);_0x3a51dc['filters']=_[_0xe594('0x2d')](_0x3a51dc['model'],_0x3a51dc['query']);_0x4285a1['attributes']=_['intersection'](_0x3a51dc['model'],qs[_0xe594('0x30')](_0xb684eb[_0xe594('0x2b')]['fields']));_0x4285a1[_0xe594('0x2f')]=_0x4285a1[_0xe594('0x2f')][_0xe594('0x40')]?_0x4285a1[_0xe594('0x2f')]:_0x3a51dc[_0xe594('0x2e')];if(_0xb684eb[_0xe594('0x2b')]['includeAll']){_0x4285a1['include']=[{'all':!![]}];}_0x4285a1=_[_0xe594('0x41')]({},_0x4285a1,_0xb684eb[_0xe594('0x42')]);return db[_0xe594('0x26')][_0xe594('0x43')](_0x4285a1)[_0xe594('0x1e')](handleEntityNotFound(_0xe866f,null))[_0xe594('0x1e')](respondWithResult(_0xe866f,null))['catch'](handleError(_0xe866f,null));};exports[_0xe594('0x44')]=function(_0x537f96,_0x2c7610){return db['SmsQueue'][_0xe594('0x44')](_0x537f96[_0xe594('0x45')],{})[_0xe594('0x1e')](function(_0x4e1178){var _0x1b1044=_0x537f96[_0xe594('0x46')][_0xe594('0x1f')]({'plain':!![]});if(!_0x1b1044)throw new Error(_0xe594('0x47'));if(_0x1b1044[_0xe594('0x48')]===_0xe594('0x46')){var _0x3da005=_0x4e1178[_0xe594('0x1f')]({'plain':!![]});var _0x2e0c95='SmsQueues';return db[_0xe594('0x49')][_0xe594('0x43')]({'where':{'name':_0x2e0c95,'userProfileId':_0x1b1044[_0xe594('0x4a')]},'raw':!![]})[_0xe594('0x1e')](function(_0x81d74e){if(_0x81d74e&&_0x81d74e[_0xe594('0x4b')]===0x0){return db[_0xe594('0x21')]['create']({'name':_0x3da005[_0xe594('0x2a')],'resourceId':_0x3da005['id'],'type':_0x81d74e[_0xe594('0x2a')],'sectionId':_0x81d74e['id']},{})[_0xe594('0x1e')](function(){return _0x4e1178;});}else{return _0x4e1178;}})['catch'](function(_0x141c76){logger[_0xe594('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x141c76);throw _0x141c76;});}return _0x4e1178;})['then'](respondWithResult(_0x2c7610,0xc9))[_0xe594('0x3d')](handleError(_0x2c7610,null));};exports['update']=function(_0x1e52df,_0x5551f5){if(_0x1e52df[_0xe594('0x45')]['id']){delete _0x1e52df[_0xe594('0x45')]['id'];}return db['SmsQueue'][_0xe594('0x43')]({'where':{'id':_0x1e52df[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x5551f5,null))[_0xe594('0x1e')](saveUpdates(_0x1e52df[_0xe594('0x45')],null))[_0xe594('0x1e')](respondWithResult(_0x5551f5,null))[_0xe594('0x3d')](handleError(_0x5551f5,null));};exports['destroy']=function(_0x369591,_0x3d01b5){return db[_0xe594('0x26')][_0xe594('0x43')]({'where':{'id':_0x369591['params']['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x3d01b5,null))[_0xe594('0x1e')](removeEntity(_0x3d01b5,null))[_0xe594('0x3d')](handleError(_0x3d01b5,null));};exports['describe']=function(_0x6179ee,_0x507897){return db[_0xe594('0x26')][_0xe594('0x4d')]()[_0xe594('0x1e')](respondWithResult(_0x507897,null))[_0xe594('0x3d')](handleError(_0x507897,null));};exports['getMembers']=function(_0xafd0a9,_0x37745d,_0x2e1228){var _0x4b800c={'raw':!![],'where':{}},_0x114b77={},_0x1b3066;return db[_0xe594('0x26')][_0xe594('0x4e')]({'where':{'id':_0xafd0a9[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x37745d,null))['then'](function(_0x15ff7d){if(_0x15ff7d){_0x1b3066=_0x15ff7d[_0xe594('0x1f')]({'plain':!![]});_0x114b77['model']=_[_0xe594('0x2c')](db['UserSmsQueue'][_0xe594('0x27')]);_0x114b77['query']=_[_0xe594('0x2c')](_0xafd0a9[_0xe594('0x2b')]);_0x114b77[_0xe594('0x36')]=_['intersection'](_0x114b77['model'],_0x114b77[_0xe594('0x2b')]);_0x4b800c[_0xe594('0x2f')]=_[_0xe594('0x2d')](_0x114b77[_0xe594('0x2e')],qs[_0xe594('0x30')](_0xafd0a9[_0xe594('0x2b')]['fields']));_0x4b800c[_0xe594('0x2f')]=_0x4b800c[_0xe594('0x2f')][_0xe594('0x40')]?_0x4b800c['attributes']:_0x114b77[_0xe594('0x2e')];if(!_0xafd0a9[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x4b800c[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0xafd0a9['query'][_0xe594('0x1a')]);_0x4b800c[_0xe594('0x18')]=qs['offset'](_0xafd0a9['query'][_0xe594('0x18')]);}_0x4b800c[_0xe594('0x33')]=qs[_0xe594('0x34')](_0xafd0a9[_0xe594('0x2b')][_0xe594('0x34')]);_0x4b800c[_0xe594('0x35')]=qs[_0xe594('0x36')](_['pick'](_0xafd0a9[_0xe594('0x2b')],_0x114b77['filters']));_0x4b800c[_0xe594('0x35')][_0xe594('0x4f')]=_0x15ff7d['id'];if(_0xafd0a9[_0xe594('0x2b')][_0xe594('0x38')]){_0x4b800c[_0xe594('0x35')]=_['merge'](_0x4b800c['where'],{'$or':_['map'](_0x4b800c[_0xe594('0x2f')],function(_0x149d5d){var _0x5310e8={};_0x5310e8[_0x149d5d]={'$like':'%'+_0xafd0a9[_0xe594('0x2b')][_0xe594('0x38')]+'%'};return _0x5310e8;})});}_0x4b800c=_[_0xe594('0x41')]({},_0x4b800c,_0xafd0a9['options']);return db[_0xe594('0x50')]['findAll'](_0x4b800c);}})[_0xe594('0x1e')](function(_0x29467f){if(_0x29467f){return db[_0xe594('0x51')][_0xe594('0x52')]({'where':{'id':_[_0xe594('0x25')](_0x29467f,_0xe594('0x53')),'role':'agent'},'attributes':['id','name','smsPause','updatedAt',_0xe594('0x54')]});}})[_0xe594('0x1e')](function(_0x33e275){if(_0x33e275){return{'count':_0x33e275[_0xe594('0x1b')],'rows':_[_0xe594('0x25')](_0x33e275[_0xe594('0x3c')],function(_0x4eab99){return{'membername':_0x4eab99[_0xe594('0x2a')],'UserId':_0x4eab99['id'],'queue_name':_0x1b3066[_0xe594('0x2a')],'SmsQueueId':_0x1b3066['id'],'interface':util[_0xe594('0x55')](_0xe594('0x56'),_0xe594('0x57'),_0x4eab99[_0xe594('0x2a')]),'penalty':0x0,'paused':_0x4eab99[_0xe594('0x58')],'createdAt':_0x4eab99[_0xe594('0x54')],'updatedAt':_0x4eab99[_0xe594('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe594('0x1e')](respondWithFilteredResult(_0x37745d,_0x4b800c))['catch'](handleError(_0x37745d,null));};exports[_0xe594('0x5a')]=function(_0x27cea7,_0x707682,_0x59b518){var _0x41efbb={};var _0x558059={};var _0x572999;var _0x4ea37c;return db[_0xe594('0x26')]['findOne']({'where':{'id':_0x27cea7[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x707682,null))[_0xe594('0x1e')](function(_0x224cfc){if(_0x224cfc){_0x572999=_0x224cfc;_0x558059[_0xe594('0x2e')]=_['keys'](db[_0xe594('0x5b')][_0xe594('0x27')]);_0x558059[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x27cea7[_0xe594('0x2b')]);_0x558059[_0xe594('0x36')]=_[_0xe594('0x2d')](_0x558059['model'],_0x558059[_0xe594('0x2b')]);_0x41efbb['attributes']=_[_0xe594('0x2d')](_0x558059['model'],qs[_0xe594('0x30')](_0x27cea7[_0xe594('0x2b')][_0xe594('0x30')]));_0x41efbb[_0xe594('0x2f')]=_0x41efbb[_0xe594('0x2f')]['length']?_0x41efbb['attributes']:_0x558059['model'];_0x41efbb[_0xe594('0x33')]=qs['sort'](_0x27cea7['query'][_0xe594('0x34')]);_0x41efbb[_0xe594('0x35')]=qs[_0xe594('0x36')](_['pick'](_0x27cea7[_0xe594('0x2b')],_0x558059['filters']));if(_0x27cea7[_0xe594('0x2b')][_0xe594('0x38')]){_0x41efbb[_0xe594('0x35')]=_[_0xe594('0x41')](_0x41efbb[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0x41efbb[_0xe594('0x2f')],function(_0x926d4c){var _0x22961a={};_0x22961a[_0x926d4c]={'$like':'%'+_0x27cea7['query'][_0xe594('0x38')]+'%'};return _0x22961a;})});}_0x41efbb=_[_0xe594('0x41')]({},_0x41efbb,_0x27cea7[_0xe594('0x42')]);return _0x572999[_0xe594('0x5a')](_0x41efbb);}})[_0xe594('0x1e')](function(_0x4cb8f9){if(_0x4cb8f9){_0x4ea37c=_0x4cb8f9['length'];if(!_0x27cea7[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x41efbb[_0xe594('0x1a')]=qs['limit'](_0x27cea7[_0xe594('0x2b')][_0xe594('0x1a')]);_0x41efbb['offset']=qs[_0xe594('0x18')](_0x27cea7[_0xe594('0x2b')][_0xe594('0x18')]);}return _0x572999[_0xe594('0x5a')](_0x41efbb);}})[_0xe594('0x1e')](function(_0x3ea9c1){if(_0x3ea9c1){return _0x3ea9c1?{'count':_0x4ea37c,'rows':_0x3ea9c1}:null;}})['then'](respondWithResult(_0x707682,null))[_0xe594('0x3d')](handleError(_0x707682,null));};exports[_0xe594('0x5c')]=function(_0x3092b2,_0x3895c2,_0x245d36){var _0x4418c1=_0x3092b2[_0xe594('0x45')][_0xe594('0x5d')];return db[_0xe594('0x5b')][_0xe594('0x3b')]({'where':{'id':_0x4418c1},'attributes':['id'],'include':[{'model':db[_0xe594('0x51')],'as':_0xe594('0x5e'),'attributes':['id',_0xe594('0x2a'),_0xe594('0x5f'),_0xe594('0x60'),_0xe594('0x61')],'raw':!![]}]})['then'](function(_0x314bc2){if(_0x314bc2){var _0xe76edc=_['flatMap'](_0x314bc2,function(_0x556aeb){var _0x174921=_0x556aeb[_0xe594('0x1f')]({'plain':!![]});return _0x174921[_0xe594('0x5e')];});return db[_0xe594('0x26')][_0xe594('0x43')]({'where':{'id':_0x3092b2[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](function(_0x415ede){return db[_0xe594('0x62')][_0xe594('0x63')](function(_0x5d07b9){return _0x415ede[_0xe594('0x5c')](_0x4418c1,{'transaction':_0x5d07b9})[_0xe594('0x1e')](function(){return BPromise[_0xe594('0x64')](_0xe76edc,function(_0xbd3fc9){return db[_0xe594('0x50')]['findOrCreate']({'where':{'UserId':_0xbd3fc9['id'],'SmsQueueId':_0x3092b2[_0xe594('0x3f')]['id']},'transaction':_0x5d07b9});});})[_0xe594('0x1e')](function(){_0xe76edc[_0xe594('0x65')](function(_0x3f10ab){socket[_0xe594('0x66')](_0xe594('0x67'),{'UserId':_0x3f10ab['id'],'SmsQueueId':_0x415ede['id']});});});});});}})[_0xe594('0x1e')](respondWithStatusCode(_0x3895c2,null))[_0xe594('0x3d')](handleError(_0x3895c2,null));};exports[_0xe594('0x68')]=function(_0xbe9ad5,_0x1fec2d,_0x46d440){return db[_0xe594('0x5b')][_0xe594('0x3b')]({'where':{'id':_0xbe9ad5[_0xe594('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe594('0x51')],'as':_0xe594('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fec2d,null))[_0xe594('0x1e')](function(_0xa3c307){var _0x592554=_[_0xe594('0x25')](_0xa3c307,'id');var _0x49fa1c=[];var _0x1ec49b=[];var _0x2bd07c=squel[_0xe594('0x69')]();_0x2bd07c[_0xe594('0x6a')](_0xe594('0x6b'))[_0xe594('0x6c')](_0xe594('0x6d'),'tq')[_0xe594('0x6e')](_0xe594('0x6f'),'ut',_0xe594('0x70'))[_0xe594('0x35')](_0xe594('0x71'),_0xbe9ad5[_0xe594('0x3f')]['id']);for(var _0x4c0888=0x0;_0x4c0888<_0xa3c307['length'];_0x4c0888+=0x1){let _0x46046f=_0xa3c307[_0x4c0888];for(var _0x1fd00f=0x0;_0x1fd00f<_0x46046f[_0xe594('0x5e')][_0xe594('0x40')];_0x1fd00f+=0x1){let _0xaf4ee9=_0x46046f[_0xe594('0x5e')][_0x1fd00f];var _0xf2be15=_0x2bd07c[_0xe594('0x72')]();_0xf2be15[_0xe594('0x35')](_0xe594('0x73'),_0xaf4ee9['id']);_0x1ec49b['push'](db[_0xe594('0x62')][_0xe594('0x2b')](_0xf2be15['toString'](),{'type':db[_0xe594('0x62')]['QueryTypes'][_0xe594('0x74')]})[_0xe594('0x1e')](function(_0x216711){if(_0x216711[_0xe594('0x40')]===0x1){return _0xaf4ee9['id'];}else{var _0x3029b0=_['every'](_['map'](_0x216711,_0xe594('0x75')),function(_0x79653e){return _['includes'](_0x592554,_0x79653e);});if(_0x3029b0){return _0xaf4ee9['id'];}}}));}}return BPromise[_0xe594('0x76')](_0x1ec49b)[_0xe594('0x1e')](function(_0xbff98b){_0x49fa1c=_(_0x49fa1c)[_0xe594('0x77')](_0xbff98b)[_0xe594('0x78')]()[_0xe594('0x79')]();return db['SmsQueue'][_0xe594('0x43')]({'where':{'id':_0xbe9ad5[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](function(_0x2f1b2b){return db['sequelize'][_0xe594('0x63')](function(_0x3f9dbb){return _0x2f1b2b[_0xe594('0x68')](_0xbe9ad5[_0xe594('0x2b')][_0xe594('0x5d')],{'transaction':_0x3f9dbb})[_0xe594('0x1e')](function(){if(!_['isEmpty'](_0x49fa1c)){return _0x2f1b2b['removeAgents'](_0x49fa1c,{'transaction':_0x3f9dbb});}})[_0xe594('0x1e')](function(){_0x49fa1c['forEach'](function(_0x5b37bb){socket['emit'](_0xe594('0x7a'),{'UserId':_0x5b37bb,'SmsQueueId':_0x2f1b2b['id']});});});});});});})['then'](respondWithStatusCode(_0x1fec2d,null))[_0xe594('0x3d')](handleError(_0x1fec2d,null));};exports[_0xe594('0x7b')]=function(_0x38db50,_0x1b6e44,_0x20cdf4){return db[_0xe594('0x26')]['find']({'where':{'id':_0x38db50[_0xe594('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1b6e44,null))[_0xe594('0x1e')](function(_0x2ad526){if(_0x2ad526){return _0x2ad526[_0xe594('0x7b')](_0x38db50['body'][_0xe594('0x5d')],_[_0xe594('0x7c')](_0x38db50[_0xe594('0x45')],[_0xe594('0x5d'),'id'])||{})[_0xe594('0x7d')](function(_0x47bfab){for(var _0x2275ed=0x0;_0x2275ed<_0x38db50['body']['ids'][_0xe594('0x40')];_0x2275ed+=0x1){socket['emit'](_0xe594('0x67'),{'UserId':Number(_0x38db50[_0xe594('0x45')][_0xe594('0x5d')][_0x2275ed]),'SmsQueueId':Number(_0x38db50['params']['id'])});}return _0x47bfab;});}})[_0xe594('0x1e')](respondWithResult(_0x1b6e44,null))[_0xe594('0x3d')](handleError(_0x1b6e44,null));};exports['removeAgents']=function(_0x42b3e9,_0x48fd86,_0x17b2bd){return db[_0xe594('0x26')]['find']({'where':{'id':_0x42b3e9[_0xe594('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48fd86,null))[_0xe594('0x1e')](function(_0x4be99d){if(_0x4be99d){return _0x4be99d[_0xe594('0x7e')](_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')])[_0xe594('0x1e')](function(){if(_[_0xe594('0x7f')](_0x42b3e9['query']['ids'])){for(var _0xe2140d=0x0;_0xe2140d<_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')][_0xe594('0x40')];_0xe2140d+=0x1){socket[_0xe594('0x66')](_0xe594('0x7a'),{'UserId':Number(_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')][_0xe2140d]),'SmsQueueId':Number(_0x42b3e9['params']['id'])});}}else{socket[_0xe594('0x66')](_0xe594('0x7a'),{'UserId':Number(_0x42b3e9[_0xe594('0x2b')]['ids']),'SmsQueueId':Number(_0x42b3e9[_0xe594('0x3f')]['id'])});}});}})['then'](respondWithStatusCode(_0x48fd86,null))[_0xe594('0x3d')](handleError(_0x48fd86,null));};exports[_0xe594('0x80')]=function(_0x421d30,_0x1545d9,_0x3db486){var _0x246576={};var _0x47eade={};var _0x3128d4;var _0x336ba8;return db['SmsQueue'][_0xe594('0x4e')]({'where':{'id':_0x421d30[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x1545d9,null))[_0xe594('0x1e')](function(_0x2415e2){if(_0x2415e2){_0x3128d4=_0x2415e2;_0x47eade[_0xe594('0x2e')]=_[_0xe594('0x2c')](db[_0xe594('0x51')][_0xe594('0x27')]);_0x47eade[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x421d30[_0xe594('0x2b')]);_0x47eade[_0xe594('0x36')]=_[_0xe594('0x2d')](_0x47eade[_0xe594('0x2e')],_0x47eade[_0xe594('0x2b')]);_0x246576['attributes']=_[_0xe594('0x2d')](_0x47eade[_0xe594('0x2e')],qs[_0xe594('0x30')](_0x421d30['query'][_0xe594('0x30')]));_0x246576[_0xe594('0x2f')]=_0x246576['attributes'][_0xe594('0x40')]?_0x246576['attributes']:_0x47eade[_0xe594('0x2e')];_0x246576[_0xe594('0x33')]=qs[_0xe594('0x34')](_0x421d30[_0xe594('0x2b')][_0xe594('0x34')]);_0x246576['where']=qs['filters'](_[_0xe594('0x37')](_0x421d30[_0xe594('0x2b')],_0x47eade[_0xe594('0x36')]));if(_0x421d30[_0xe594('0x2b')][_0xe594('0x38')]){_0x246576['where']=_['merge'](_0x246576[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0x246576['attributes'],function(_0x385673){var _0x101d53={};_0x101d53[_0x385673]={'$like':'%'+_0x421d30[_0xe594('0x2b')]['filter']+'%'};return _0x101d53;})});}_0x246576=_[_0xe594('0x41')]({},_0x246576,_0x421d30[_0xe594('0x42')]);return _0x3128d4[_0xe594('0x80')](_0x246576);}})[_0xe594('0x1e')](function(_0x5be93c){if(_0x5be93c){_0x336ba8=_0x5be93c[_0xe594('0x40')];if(!_0x421d30[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x246576[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0x421d30[_0xe594('0x2b')]['limit']);_0x246576[_0xe594('0x18')]=qs[_0xe594('0x18')](_0x421d30[_0xe594('0x2b')]['offset']);}return _0x3128d4[_0xe594('0x80')](_0x246576);}})['then'](function(_0x3d4b8d){if(_0x3d4b8d){return _0x3d4b8d?{'count':_0x336ba8,'rows':_0x3d4b8d}:null;}})['then'](respondWithResult(_0x1545d9,null))[_0xe594('0x3d')](handleError(_0x1545d9,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4b7e93e..df7232d 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 _0x427a=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb','SmsQueue'];(function(_0x49de6e,_0x5496f8){var _0xd85fcd=function(_0x5b5484){while(--_0x5b5484){_0x49de6e['push'](_0x49de6e['shift']());}};_0xd85fcd(++_0x5496f8);}(_0x427a,0xf6));var _0xa427=function(_0x16f34e,_0x16b6ce){_0x16f34e=_0x16f34e-0x0;var _0x1c9042=_0x427a[_0x16f34e];return _0x1c9042;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xa427('0x0'))['db'][_0xa427('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa427('0x2')](0x0);var events={'afterCreate':_0xa427('0x3'),'afterUpdate':'update','afterDestroy':_0xa427('0x4')};function emitEvent(_0x5a8116){return function(_0xf3fb02,_0xff9d17,_0x9abe02){SmsQueueEvents[_0xa427('0x5')](_0x5a8116+':'+_0xf3fb02['id'],_0xf3fb02);SmsQueueEvents[_0xa427('0x5')](_0x5a8116,_0xf3fb02);_0x9abe02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xa427('0x6')](e,emitEvent(event));}}module[_0xa427('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x30cb=['SmsQueue','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x30cb,0xb7));var _0xb30c=function(_0x5d11d3,_0x91dd5d){_0x5d11d3=_0x5d11d3-0x0;var _0x1f86f9=_0x30cb[_0x5d11d3];return _0x1f86f9;};'use strict';var EventEmitter=require(_0xb30c('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xb30c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb30c('0x2')](0x0);var events={'afterCreate':_0xb30c('0x3'),'afterUpdate':_0xb30c('0x4'),'afterDestroy':_0xb30c('0x5')};function emitEvent(_0x52d7fe){return function(_0x240c8a,_0x33393c,_0x25d95d){SmsQueueEvents[_0xb30c('0x6')](_0x52d7fe+':'+_0x240c8a['id'],_0x240c8a);SmsQueueEvents[_0xb30c('0x6')](_0x52d7fe,_0x240c8a);_0x25d95d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xb30c('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 4da2cf0..c1ca27a 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 _0x33e7=['api','moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger'];(function(_0x5d3dc3,_0x282563){var _0x3e8464=function(_0x44a6d3){while(--_0x44a6d3){_0x5d3dc3['push'](_0x5d3dc3['shift']());}};_0x3e8464(++_0x282563);}(_0x33e7,0x189));var _0x733e=function(_0x3d5235,_0xf16fab){_0x3d5235=_0x3d5235-0x0;var _0x2e2f2d=_0x33e7[_0x3d5235];return _0x2e2f2d;};'use strict';var _=require(_0x733e('0x0'));var util=require(_0x733e('0x1'));var logger=require(_0x733e('0x2'))(_0x733e('0x3'));var moment=require(_0x733e('0x4'));var BPromise=require(_0x733e('0x5'));var rp=require(_0x733e('0x6'));var fs=require('fs');var path=require(_0x733e('0x7'));var rimraf=require(_0x733e('0x8'));var config=require('../../config/environment');var attributes=require(_0x733e('0x9'));module['exports']=function(_0x18956c,_0x56c7fe){return _0x18956c[_0x733e('0xa')](_0x733e('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5646=['bluebird','path','rimraf','./smsQueue.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x519d24,_0x181f31){var _0x1a1fa5=function(_0x5ab6ca){while(--_0x5ab6ca){_0x519d24['push'](_0x519d24['shift']());}};_0x1a1fa5(++_0x181f31);}(_0x5646,0xcd));var _0x6564=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x5646[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x6564('0x0'));var util=require(_0x6564('0x1'));var logger=require(_0x6564('0x2'))(_0x6564('0x3'));var moment=require(_0x6564('0x4'));var BPromise=require(_0x6564('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6564('0x6'));var rimraf=require(_0x6564('0x7'));var config=require('../../config/environment');var attributes=require(_0x6564('0x8'));module[_0x6564('0x9')]=function(_0x447126,_0x1d5907){return _0x447126['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 9420bf2..3cabe94 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 _0xc1ee=['include','map','model','then','GetSmsQueue','where','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','SmsQueue','options','raw','attributes','limit'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0xc1ee,0x76));var _0xec1e=function(_0x400473,_0x3d2897){_0x400473=_0x400473-0x0;var _0x24e340=_0xc1ee[_0x400473];return _0x24e340;};'use strict';var _=require(_0xec1e('0x0'));var util=require(_0xec1e('0x1'));var moment=require(_0xec1e('0x2'));var BPromise=require(_0xec1e('0x3'));var rs=require(_0xec1e('0x4'));var fs=require('fs');var Redis=require(_0xec1e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec1e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xec1e('0x7'));var jayson=require(_0xec1e('0x8'));var client=jayson[_0xec1e('0x9')][_0xec1e('0xa')]({'port':0x232a});config[_0xec1e('0xb')]=_[_0xec1e('0xc')](config[_0xec1e('0xb')],{'host':_0xec1e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec1e('0xb')]));require('./smsQueue.socket')[_0xec1e('0xe')](socket);function respondWithRpcPromise(_0x13e461,_0x470089,_0x2d3bf4){return new BPromise(function(_0xd2d09b,_0x43e411){return client[_0xec1e('0xf')](_0x13e461,_0x2d3bf4)['then'](function(_0x22639e){logger[_0xec1e('0x10')](_0xec1e('0x11'),_0x470089,_0xec1e('0x12'));logger[_0xec1e('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x470089,'request\x20sent',JSON[_0xec1e('0x14')](_0x22639e));if(_0x22639e[_0xec1e('0x15')]){if(_0x22639e[_0xec1e('0x15')][_0xec1e('0x16')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x470089,_0x22639e[_0xec1e('0x15')][_0xec1e('0x17')]);return _0x43e411(_0x22639e[_0xec1e('0x15')][_0xec1e('0x17')]);}logger[_0xec1e('0x15')]('SmsQueue,\x20%s,\x20%s',_0x470089,_0x22639e[_0xec1e('0x15')][_0xec1e('0x17')]);return _0xd2d09b(_0x22639e[_0xec1e('0x15')][_0xec1e('0x17')]);}else{logger[_0xec1e('0x10')](_0xec1e('0x11'),_0x470089,_0xec1e('0x12'));_0xd2d09b(_0x22639e['result'][_0xec1e('0x17')]);}})[_0xec1e('0x18')](function(_0x51ae26){logger[_0xec1e('0x15')](_0xec1e('0x11'),_0x470089,_0x51ae26);_0x43e411(_0x51ae26);});});}exports['GetSmsQueue']=function(_0x1409c7){var _0x4a0ad6=this;return new Promise(function(_0x38a8df,_0x13cb88){return db[_0xec1e('0x19')]['findAll']({'raw':_0x1409c7[_0xec1e('0x1a')]?_0x1409c7[_0xec1e('0x1a')][_0xec1e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1409c7[_0xec1e('0x1a')]?_0x1409c7['options']['where']||null:null,'attributes':_0x1409c7['options']?_0x1409c7[_0xec1e('0x1a')][_0xec1e('0x1c')]||null:null,'limit':_0x1409c7[_0xec1e('0x1a')]?_0x1409c7[_0xec1e('0x1a')][_0xec1e('0x1d')]||null:null,'include':_0x1409c7[_0xec1e('0x1a')]?_0x1409c7[_0xec1e('0x1a')][_0xec1e('0x1e')]?_[_0xec1e('0x1f')](_0x1409c7[_0xec1e('0x1a')]['include'],function(_0x5b601e){return{'model':db[_0x5b601e[_0xec1e('0x20')]],'as':_0x5b601e['as'],'attributes':_0x5b601e[_0xec1e('0x1c')],'include':_0x5b601e['include']?_[_0xec1e('0x1f')](_0x5b601e['include'],function(_0x26d86a){return{'model':db[_0x26d86a['model']],'as':_0x26d86a['as'],'attributes':_0x26d86a[_0xec1e('0x1c')],'include':_0x26d86a[_0xec1e('0x1e')]?_[_0xec1e('0x1f')](_0x26d86a['include'],function(_0x368596){return{'model':db[_0x368596[_0xec1e('0x20')]],'as':_0x368596['as'],'attributes':_0x368596[_0xec1e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xec1e('0x21')](function(_0x15118d){logger[_0xec1e('0x10')](_0xec1e('0x22'),_0x1409c7);logger['debug']('GetSmsQueue',_0x1409c7,JSON[_0xec1e('0x14')](_0x15118d));_0x38a8df(_0x15118d);})['catch'](function(_0x2ecae4){logger['error'](_0xec1e('0x22'),_0x2ecae4[_0xec1e('0x17')],_0x1409c7);_0x13cb88(_0x4a0ad6['error'](0x1f4,_0x2ecae4['message']));});});};exports['ShowSmsQueue']=function(_0x15441d){var _0x3fa451=this;return new Promise(function(_0x34ce15,_0x53948c){return db[_0xec1e('0x19')]['find']({'raw':_0x15441d[_0xec1e('0x1a')]?_0x15441d[_0xec1e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x15441d[_0xec1e('0x1a')]?_0x15441d[_0xec1e('0x1a')][_0xec1e('0x23')]||null:null,'attributes':_0x15441d[_0xec1e('0x1a')]?_0x15441d[_0xec1e('0x1a')][_0xec1e('0x1c')]||null:null,'include':_0x15441d[_0xec1e('0x1a')]?_0x15441d[_0xec1e('0x1a')]['include']?_[_0xec1e('0x1f')](_0x15441d[_0xec1e('0x1a')][_0xec1e('0x1e')],function(_0x474182){return{'model':db[_0x474182[_0xec1e('0x20')]],'as':_0x474182['as'],'attributes':_0x474182[_0xec1e('0x1c')],'include':_0x474182[_0xec1e('0x1e')]?_[_0xec1e('0x1f')](_0x474182['include'],function(_0x14fed5){return{'model':db[_0x14fed5['model']],'as':_0x14fed5['as'],'attributes':_0x14fed5[_0xec1e('0x1c')],'include':_0x14fed5[_0xec1e('0x1e')]?_[_0xec1e('0x1f')](_0x14fed5[_0xec1e('0x1e')],function(_0x4d8c31){return{'model':db[_0x4d8c31[_0xec1e('0x20')]],'as':_0x4d8c31['as'],'attributes':_0x4d8c31[_0xec1e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168a59){logger[_0xec1e('0x10')](_0xec1e('0x24'),_0x15441d);logger[_0xec1e('0x13')]('ShowSmsQueue',_0x15441d,JSON['stringify'](_0x168a59));_0x34ce15(_0x168a59);})[_0xec1e('0x18')](function(_0xc42a10){logger['error'](_0xec1e('0x24'),_0xc42a10[_0xec1e('0x17')],_0x15441d);_0x53948c(_0x3fa451['error'](0x1f4,_0xc42a10[_0xec1e('0x17')]));});});}; \ No newline at end of file +var _0xdf2b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','catch','ShowSmsQueue'];(function(_0xc8bc46,_0x554ee3){var _0xc67cc=function(_0x4258cc){while(--_0x4258cc){_0xc8bc46['push'](_0xc8bc46['shift']());}};_0xc67cc(++_0x554ee3);}(_0xdf2b,0x168));var _0xbdf2=function(_0x550071,_0x9ba498){_0x550071=_0x550071-0x0;var _0x3c7b4c=_0xdf2b[_0x550071];return _0x3c7b4c;};'use strict';var _=require(_0xbdf2('0x0'));var util=require(_0xbdf2('0x1'));var moment=require(_0xbdf2('0x2'));var BPromise=require(_0xbdf2('0x3'));var rs=require(_0xbdf2('0x4'));var fs=require('fs');var Redis=require(_0xbdf2('0x5'));var db=require(_0xbdf2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdf2('0x7'))(_0xbdf2('0x8'));var config=require(_0xbdf2('0x9'));var jayson=require(_0xbdf2('0xa'));var client=jayson[_0xbdf2('0xb')]['http']({'port':0x232a});config[_0xbdf2('0xc')]=_[_0xbdf2('0xd')](config[_0xbdf2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbdf2('0xe'))(new Redis(config[_0xbdf2('0xc')]));require('./smsQueue.socket')[_0xbdf2('0xf')](socket);function respondWithRpcPromise(_0x4e7b38,_0x5b76c1,_0x45b85d){return new BPromise(function(_0x582b03,_0x202f84){return client[_0xbdf2('0x10')](_0x4e7b38,_0x45b85d)['then'](function(_0x3c05be){logger[_0xbdf2('0x11')](_0xbdf2('0x12'),_0x5b76c1,'request\x20sent');logger[_0xbdf2('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5b76c1,_0xbdf2('0x14'),JSON[_0xbdf2('0x15')](_0x3c05be));if(_0x3c05be[_0xbdf2('0x16')]){if(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x17')]===0x1f4){logger[_0xbdf2('0x16')](_0xbdf2('0x12'),_0x5b76c1,_0x3c05be[_0xbdf2('0x16')]['message']);return _0x202f84(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);}logger[_0xbdf2('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5b76c1,_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);return _0x582b03(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);}else{logger[_0xbdf2('0x11')](_0xbdf2('0x12'),_0x5b76c1,_0xbdf2('0x14'));_0x582b03(_0x3c05be[_0xbdf2('0x19')][_0xbdf2('0x18')]);}})['catch'](function(_0x3ea7d1){logger[_0xbdf2('0x16')](_0xbdf2('0x12'),_0x5b76c1,_0x3ea7d1);_0x202f84(_0x3ea7d1);});});}exports[_0xbdf2('0x1a')]=function(_0x32692e){var _0x3812ec=this;return new Promise(function(_0x2430b4,_0x90927b){return db[_0xbdf2('0x1b')][_0xbdf2('0x1c')]({'raw':_0x32692e[_0xbdf2('0x1d')]?_0x32692e['options'][_0xbdf2('0x1e')]===undefined?!![]:![]:!![],'where':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x1f')]||null:null,'attributes':_0x32692e['options']?_0x32692e[_0xbdf2('0x1d')]['attributes']||null:null,'limit':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x20')]||null:null,'include':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x21')],function(_0x11f268){return{'model':db[_0x11f268['model']],'as':_0x11f268['as'],'attributes':_0x11f268[_0xbdf2('0x23')],'include':_0x11f268['include']?_[_0xbdf2('0x22')](_0x11f268['include'],function(_0x3bbefb){return{'model':db[_0x3bbefb[_0xbdf2('0x24')]],'as':_0x3bbefb['as'],'attributes':_0x3bbefb[_0xbdf2('0x23')],'include':_0x3bbefb[_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x3bbefb['include'],function(_0x475eb3){return{'model':db[_0x475eb3[_0xbdf2('0x24')]],'as':_0x475eb3['as'],'attributes':_0x475eb3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdf2('0x25')](function(_0x1717a8){logger[_0xbdf2('0x11')](_0xbdf2('0x1a'),_0x32692e);logger[_0xbdf2('0x13')]('GetSmsQueue',_0x32692e,JSON[_0xbdf2('0x15')](_0x1717a8));_0x2430b4(_0x1717a8);})[_0xbdf2('0x26')](function(_0x34d853){logger[_0xbdf2('0x16')](_0xbdf2('0x1a'),_0x34d853['message'],_0x32692e);_0x90927b(_0x3812ec[_0xbdf2('0x16')](0x1f4,_0x34d853[_0xbdf2('0x18')]));});});};exports[_0xbdf2('0x27')]=function(_0x45e068){var _0x2fef1a=this;return new Promise(function(_0x37a04f,_0x16c37c){return db[_0xbdf2('0x1b')]['find']({'raw':_0x45e068['options']?_0x45e068[_0xbdf2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x45e068[_0xbdf2('0x1d')]?_0x45e068['options'][_0xbdf2('0x1f')]||null:null,'attributes':_0x45e068[_0xbdf2('0x1d')]?_0x45e068[_0xbdf2('0x1d')][_0xbdf2('0x23')]||null:null,'include':_0x45e068[_0xbdf2('0x1d')]?_0x45e068['options'][_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x45e068[_0xbdf2('0x1d')][_0xbdf2('0x21')],function(_0x175cad){return{'model':db[_0x175cad['model']],'as':_0x175cad['as'],'attributes':_0x175cad[_0xbdf2('0x23')],'include':_0x175cad[_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x175cad[_0xbdf2('0x21')],function(_0xe28dfe){return{'model':db[_0xe28dfe[_0xbdf2('0x24')]],'as':_0xe28dfe['as'],'attributes':_0xe28dfe['attributes'],'include':_0xe28dfe[_0xbdf2('0x21')]?_['map'](_0xe28dfe['include'],function(_0x3fd9f1){return{'model':db[_0x3fd9f1['model']],'as':_0x3fd9f1['as'],'attributes':_0x3fd9f1[_0xbdf2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbdf2('0x25')](function(_0x59b510){logger['info'](_0xbdf2('0x27'),_0x45e068);logger[_0xbdf2('0x13')](_0xbdf2('0x27'),_0x45e068,JSON[_0xbdf2('0x15')](_0x59b510));_0x37a04f(_0x59b510);})['catch'](function(_0x1adcd9){logger[_0xbdf2('0x16')](_0xbdf2('0x27'),_0x1adcd9['message'],_0x45e068);_0x16c37c(_0x2fef1a[_0xbdf2('0x16')](0x1f4,_0x1adcd9[_0xbdf2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 03e5c04..218b3e0 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 _0x9451=['register','length','smsQueue:','save','remove','update','emit','removeListener'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9451,0x1e3));var _0x1945=function(_0x1341ee,_0x2ce5c0){_0x1341ee=_0x1341ee-0x0;var _0x24f3c5=_0x9451[_0x1341ee];return _0x24f3c5;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x1945('0x0'),_0x1945('0x1'),_0x1945('0x2')];function createListener(_0x2ef4b8,_0x3b5937){return function(_0x1de3c3){_0x3b5937[_0x1945('0x3')](_0x2ef4b8,_0x1de3c3);};}function removeListener(_0x42769,_0x35bed8){return function(){SmsQueueEvents[_0x1945('0x4')](_0x42769,_0x35bed8);};}exports[_0x1945('0x5')]=function(_0x18580e){for(var _0x58d9a7=0x0,_0x138288=events[_0x1945('0x6')];_0x58d9a7<_0x138288;_0x58d9a7++){var _0x133d62=events[_0x58d9a7];var _0x8c9e1=createListener(_0x1945('0x7')+_0x133d62,_0x18580e);SmsQueueEvents['on'](_0x133d62,_0x8c9e1);}}; \ No newline at end of file +var _0xc362=['emit','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4ed3ee,_0x5bbe4f){var _0x5bafe2=function(_0x3d798b){while(--_0x3d798b){_0x4ed3ee['push'](_0x4ed3ee['shift']());}};_0x5bafe2(++_0x5bbe4f);}(_0xc362,0xc4));var _0x2c36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc362[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require(_0x2c36('0x0'));var events=[_0x2c36('0x1'),_0x2c36('0x2'),_0x2c36('0x3')];function createListener(_0x4cfd5c,_0x5ddae4){return function(_0x2ad9b1){_0x5ddae4[_0x2c36('0x4')](_0x4cfd5c,_0x2ad9b1);};}function removeListener(_0x245878,_0x3fb4a9){return function(){SmsQueueEvents['removeListener'](_0x245878,_0x3fb4a9);};}exports[_0x2c36('0x5')]=function(_0x5d5644){for(var _0x240be1=0x0,_0x74b6e7=events[_0x2c36('0x6')];_0x240be1<_0x74b6e7;_0x240be1++){var _0x50060a=events[_0x240be1];var _0x53a1a3=createListener(_0x2c36('0x7')+_0x50060a,_0x5d5644);SmsQueueEvents['on'](_0x50060a,_0x53a1a3);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 508d7bf..a1f4ac3 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 _0xa366=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports'];(function(_0x59fd0a,_0x2b79c2){var _0x21a1c8=function(_0x645792){while(--_0x645792){_0x59fd0a['push'](_0x59fd0a['shift']());}};_0x21a1c8(++_0x2b79c2);}(_0xa366,0x1e0));var _0x6a36=function(_0x3ac9dd,_0x47fca1){_0x3ac9dd=_0x3ac9dd-0x0;var _0x5a1c89=_0xa366[_0x3ac9dd];return _0x5a1c89;};'use strict';var multer=require(_0x6a36('0x0'));var util=require('util');var path=require(_0x6a36('0x1'));var timeout=require(_0x6a36('0x2'));var express=require(_0x6a36('0x3'));var router=express[_0x6a36('0x4')]();var fs_extra=require(_0x6a36('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a36('0x6'));var config=require(_0x6a36('0x7'));var controller=require(_0x6a36('0x8'));router['get']('/',auth[_0x6a36('0x9')](),controller[_0x6a36('0xa')]);router['get'](_0x6a36('0xb'),auth[_0x6a36('0x9')](),controller[_0x6a36('0xc')]);router['get'](_0x6a36('0xd'),auth[_0x6a36('0x9')](),controller[_0x6a36('0xe')]);router[_0x6a36('0xf')]('/',auth['isAuthenticated'](),controller[_0x6a36('0x10')]);router[_0x6a36('0x11')](_0x6a36('0xd'),auth[_0x6a36('0x9')](),controller['update']);router[_0x6a36('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6a36('0x13')]=router; \ No newline at end of file +var _0x776f=['fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x2b0b8a,_0x232980){var _0x492a12=function(_0x4a9705){while(--_0x4a9705){_0x2b0b8a['push'](_0x2b0b8a['shift']());}};_0x492a12(++_0x232980);}(_0x776f,0x68));var _0xf776=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x776f[_0x3e8f4d];return _0x590a2e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf776('0x0'));var timeout=require(_0xf776('0x1'));var express=require(_0xf776('0x2'));var router=express[_0xf776('0x3')]();var fs_extra=require(_0xf776('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf776('0x5'));var config=require('../../config/environment');var controller=require(_0xf776('0x6'));router[_0xf776('0x7')]('/',auth['isAuthenticated'](),controller[_0xf776('0x8')]);router[_0xf776('0x7')]('/describe',auth[_0xf776('0x9')](),controller[_0xf776('0xa')]);router['get'](_0xf776('0xb'),auth[_0xf776('0x9')](),controller['show']);router[_0xf776('0xc')]('/',auth['isAuthenticated'](),controller[_0xf776('0xd')]);router[_0xf776('0xe')](_0xf776('0xb'),auth[_0xf776('0x9')](),controller[_0xf776('0xf')]);router[_0xf776('0x10')]('/:id',auth[_0xf776('0x9')](),controller['destroy']);module[_0xf776('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index aa1d2ff..49f3a98 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 _0x4ff6=['DATE','sequelize','exports','STRING'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0x4ff6,0xd5));var _0x64ff=function(_0x3fc48c,_0x3c34c8){_0x3fc48c=_0x3fc48c-0x0;var _0x3b3fe3=_0x4ff6[_0x3fc48c];return _0x3b3fe3;};'use strict';var moment=require('moment');var Sequelize=require(_0x64ff('0x0'));module[_0x64ff('0x1')]={'uniqueid':{'type':Sequelize[_0x64ff('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x64ff('0x2')]},'joinAt':{'type':Sequelize[_0x64ff('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x64ff('0x3')]},'exitAt':{'type':Sequelize[_0x64ff('0x3')]},'reason':{'type':Sequelize[_0x64ff('0x2')]}}; \ No newline at end of file +var _0x3dff=['STRING','DATE'];(function(_0x3b6833,_0x235a55){var _0x56c54f=function(_0x54bb18){while(--_0x54bb18){_0x3b6833['push'](_0x3b6833['shift']());}};_0x56c54f(++_0x235a55);}(_0x3dff,0x1bc));var _0xf3df=function(_0x6fdb05,_0x126f86){_0x6fdb05=_0x6fdb05-0x0;var _0x400f4f=_0x3dff[_0x6fdb05];return _0x400f4f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf3df('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf3df('0x1')]},'leaveAt':{'type':Sequelize[_0xf3df('0x1')]},'acceptAt':{'type':Sequelize[_0xf3df('0x1')]},'exitAt':{'type':Sequelize[_0xf3df('0x1')]},'reason':{'type':Sequelize[_0xf3df('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 98a5f7f..e8c5083 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 _0x7170=['moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','fieldName','key','model','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','catch','show','params','rawAttributes','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2d5678,_0xdfb48f){var _0x4ad11a=function(_0x474ad3){while(--_0x474ad3){_0x2d5678['push'](_0x2d5678['shift']());}};_0x4ad11a(++_0xdfb48f);}(_0x7170,0x190));var _0x0717=function(_0x4f377e,_0x461206){_0x4f377e=_0x4f377e-0x0;var _0x3008cc=_0x7170[_0x4f377e];return _0x3008cc;};'use strict';var emlformat=require(_0x0717('0x0'));var rimraf=require(_0x0717('0x1'));var zipdir=require(_0x0717('0x2'));var jsonpatch=require(_0x0717('0x3'));var rp=require(_0x0717('0x4'));var moment=require(_0x0717('0x5'));var BPromise=require(_0x0717('0x6'));var Mustache=require('mustache');var util=require(_0x0717('0x7'));var path=require(_0x0717('0x8'));var sox=require('sox');var csv=require(_0x0717('0x9'));var ejs=require(_0x0717('0xa'));var fs=require('fs');var fs_extra=require(_0x0717('0xb'));var _=require(_0x0717('0xc'));var squel=require(_0x0717('0xd'));var crypto=require(_0x0717('0xe'));var jsforce=require(_0x0717('0xf'));var deskjs=require(_0x0717('0x10'));var toCsv=require(_0x0717('0x9'));var querystring=require(_0x0717('0x11'));var Papa=require(_0x0717('0x12'));var Redis=require(_0x0717('0x13'));var authService=require(_0x0717('0x14'));var qs=require(_0x0717('0x15'));var as=require(_0x0717('0x16'));var hardwareService=require(_0x0717('0x17'));var logger=require(_0x0717('0x18'))(_0x0717('0x19'));var utils=require('../../config/utils');var config=require(_0x0717('0x1a'));var licenseUtil=require(_0x0717('0x1b'));var db=require(_0x0717('0x1c'))['db'];function respondWithStatusCode(_0x43a793,_0x45dfbb){_0x45dfbb=_0x45dfbb||0xcc;return function(_0x196782){if(_0x196782){return _0x43a793['sendStatus'](_0x45dfbb);}return _0x43a793[_0x0717('0x1d')](_0x45dfbb)[_0x0717('0x1e')]();};}function respondWithResult(_0x2f2f37,_0x4ce546){_0x4ce546=_0x4ce546||0xc8;return function(_0x5937c5){if(_0x5937c5){return _0x2f2f37[_0x0717('0x1d')](_0x4ce546)[_0x0717('0x1f')](_0x5937c5);}};}function respondWithFilteredResult(_0x157fe4,_0x7a01d2){return function(_0x19d9e1){if(_0x19d9e1){var _0x49d3fa=typeof _0x7a01d2[_0x0717('0x20')]===_0x0717('0x21')&&typeof _0x7a01d2['limit']===_0x0717('0x21');var _0xb75690=_0x19d9e1['count'];var _0x463534=_0x49d3fa?0x0:_0x7a01d2[_0x0717('0x20')];var _0x2859ae=_0x49d3fa?_0x19d9e1[_0x0717('0x22')]:_0x7a01d2[_0x0717('0x20')]+_0x7a01d2[_0x0717('0x23')];var _0x3fcdd4;if(_0x2859ae>=_0xb75690){_0x2859ae=_0xb75690;_0x3fcdd4=0xc8;}else{_0x3fcdd4=0xce;}_0x157fe4['status'](_0x3fcdd4);return _0x157fe4[_0x0717('0x24')](_0x0717('0x25'),_0x463534+'-'+_0x2859ae+'/'+_0xb75690)[_0x0717('0x1f')](_0x19d9e1);}return null;};}function patchUpdates(_0x5d03a1){return function(_0x4ec69f){try{jsonpatch[_0x0717('0x26')](_0x4ec69f,_0x5d03a1,!![]);}catch(_0x537519){return BPromise[_0x0717('0x27')](_0x537519);}return _0x4ec69f[_0x0717('0x28')]();};}function saveUpdates(_0x2f0ece,_0x22be17){return function(_0x2ceaa1){if(_0x2ceaa1){return _0x2ceaa1[_0x0717('0x29')](_0x2f0ece)[_0x0717('0x2a')](function(_0xc85980){return _0xc85980;});}return null;};}function removeEntity(_0x1ce0b4,_0x47c533){return function(_0xd7e38b){if(_0xd7e38b){return _0xd7e38b[_0x0717('0x2b')]()[_0x0717('0x2a')](function(){_0x1ce0b4['status'](0xcc)[_0x0717('0x1e')]();});}};}function handleEntityNotFound(_0x5e85d0,_0x375619){return function(_0x2c991d){if(!_0x2c991d){_0x5e85d0[_0x0717('0x2c')](0x194);}return _0x2c991d;};}function handleError(_0x3aa50a,_0x363502){_0x363502=_0x363502||0x1f4;return function(_0x253198){logger['error'](_0x253198['stack']);if(_0x253198[_0x0717('0x2d')]){delete _0x253198[_0x0717('0x2d')];}_0x3aa50a[_0x0717('0x1d')](_0x363502)[_0x0717('0x2e')](_0x253198);};}exports[_0x0717('0x2f')]=function(_0x3d6757,_0x3452d5){var _0x6a3f84={},_0x2f178a={},_0x3d5c70={'count':0x0,'rows':[]};var _0x3670fa=_[_0x0717('0x30')](db['SmsQueueReport']['rawAttributes'],function(_0x1953ab){return{'name':_0x1953ab[_0x0717('0x31')],'type':_0x1953ab['type'][_0x0717('0x32')]};});_0x2f178a[_0x0717('0x33')]=_[_0x0717('0x30')](_0x3670fa,_0x0717('0x2d'));_0x2f178a['query']=_['keys'](_0x3d6757['query']);_0x2f178a[_0x0717('0x34')]=_[_0x0717('0x35')](_0x2f178a[_0x0717('0x33')],_0x2f178a['query']);_0x6a3f84[_0x0717('0x36')]=_[_0x0717('0x35')](_0x2f178a[_0x0717('0x33')],qs[_0x0717('0x37')](_0x3d6757[_0x0717('0x38')][_0x0717('0x37')]));_0x6a3f84[_0x0717('0x36')]=_0x6a3f84['attributes'][_0x0717('0x39')]?_0x6a3f84[_0x0717('0x36')]:_0x2f178a['model'];if(!_0x3d6757[_0x0717('0x38')]['hasOwnProperty'](_0x0717('0x3a'))){_0x6a3f84[_0x0717('0x23')]=qs[_0x0717('0x23')](_0x3d6757['query'][_0x0717('0x23')]);_0x6a3f84[_0x0717('0x20')]=qs[_0x0717('0x20')](_0x3d6757['query'][_0x0717('0x20')]);}_0x6a3f84[_0x0717('0x3b')]=qs[_0x0717('0x3c')](_0x3d6757[_0x0717('0x38')][_0x0717('0x3c')]);_0x6a3f84[_0x0717('0x3d')]=qs[_0x0717('0x34')](_[_0x0717('0x3e')](_0x3d6757['query'],_0x2f178a[_0x0717('0x34')]),_0x3670fa);if(_0x3d6757['query'][_0x0717('0x3f')]){_0x6a3f84[_0x0717('0x3d')]=_[_0x0717('0x40')](_0x6a3f84['where'],{'$or':_[_0x0717('0x30')](_0x3670fa,function(_0x4cc804){if(_0x4cc804[_0x0717('0x41')]!==_0x0717('0x42')){var _0x46caef={};_0x46caef[_0x4cc804['name']]={'$like':'%'+_0x3d6757['query'][_0x0717('0x3f')]+'%'};return _0x46caef;}})});}_0x6a3f84=_[_0x0717('0x40')]({},_0x6a3f84,_0x3d6757[_0x0717('0x43')]);var _0x4667f5={'where':_0x6a3f84[_0x0717('0x3d')]};return db[_0x0717('0x44')][_0x0717('0x22')](_0x4667f5)[_0x0717('0x2a')](function(_0x59563f){_0x3d5c70[_0x0717('0x22')]=_0x59563f;if(_0x3d6757['query'][_0x0717('0x45')]){_0x6a3f84[_0x0717('0x46')]=[{'all':!![]}];}return db[_0x0717('0x44')][_0x0717('0x47')](_0x6a3f84);})[_0x0717('0x2a')](function(_0x2222c7){_0x3d5c70['rows']=_0x2222c7;return _0x3d5c70;})[_0x0717('0x2a')](respondWithFilteredResult(_0x3452d5,_0x6a3f84))[_0x0717('0x48')](handleError(_0x3452d5,null));};exports[_0x0717('0x49')]=function(_0x57de75,_0x1b52e8){var _0x189eb0={'raw':!![],'where':{'id':_0x57de75[_0x0717('0x4a')]['id']}},_0x5dea14={};_0x5dea14['model']=_['keys'](db[_0x0717('0x44')][_0x0717('0x4b')]);_0x5dea14[_0x0717('0x38')]=_[_0x0717('0x4c')](_0x57de75['query']);_0x5dea14[_0x0717('0x34')]=_[_0x0717('0x35')](_0x5dea14[_0x0717('0x33')],_0x5dea14[_0x0717('0x38')]);_0x189eb0[_0x0717('0x36')]=_[_0x0717('0x35')](_0x5dea14['model'],qs['fields'](_0x57de75['query'][_0x0717('0x37')]));_0x189eb0[_0x0717('0x36')]=_0x189eb0[_0x0717('0x36')][_0x0717('0x39')]?_0x189eb0[_0x0717('0x36')]:_0x5dea14[_0x0717('0x33')];if(_0x57de75[_0x0717('0x38')][_0x0717('0x45')]){_0x189eb0[_0x0717('0x46')]=[{'all':!![]}];}_0x189eb0=_[_0x0717('0x40')]({},_0x189eb0,_0x57de75[_0x0717('0x43')]);return db[_0x0717('0x44')]['find'](_0x189eb0)[_0x0717('0x2a')](handleEntityNotFound(_0x1b52e8,null))[_0x0717('0x2a')](respondWithResult(_0x1b52e8,null))[_0x0717('0x48')](handleError(_0x1b52e8,null));};exports[_0x0717('0x4d')]=function(_0x2bcf6b,_0x3358df){return db[_0x0717('0x44')]['create'](_0x2bcf6b[_0x0717('0x4e')],{})[_0x0717('0x2a')](respondWithResult(_0x3358df,0xc9))['catch'](handleError(_0x3358df,null));};exports['update']=function(_0x29f097,_0x591eec){if(_0x29f097[_0x0717('0x4e')]['id']){delete _0x29f097[_0x0717('0x4e')]['id'];}return db[_0x0717('0x44')]['find']({'where':{'id':_0x29f097[_0x0717('0x4a')]['id']}})[_0x0717('0x2a')](handleEntityNotFound(_0x591eec,null))[_0x0717('0x2a')](saveUpdates(_0x29f097[_0x0717('0x4e')],null))[_0x0717('0x2a')](respondWithResult(_0x591eec,null))[_0x0717('0x48')](handleError(_0x591eec,null));};exports[_0x0717('0x2b')]=function(_0x57e319,_0xbf1fa1){return db['SmsQueueReport'][_0x0717('0x4f')]({'where':{'id':_0x57e319[_0x0717('0x4a')]['id']}})[_0x0717('0x2a')](handleEntityNotFound(_0xbf1fa1,null))[_0x0717('0x2a')](removeEntity(_0xbf1fa1,null))['catch'](handleError(_0xbf1fa1,null));};exports[_0x0717('0x50')]=function(_0x111e71,_0x107c05){return db['SmsQueueReport'][_0x0717('0x50')]()[_0x0717('0x2a')](respondWithResult(_0x107c05,null))[_0x0717('0x48')](handleError(_0x107c05,null));}; \ No newline at end of file +var _0xc25a=['show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','rows'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xc25a,0x13c));var _0xac25=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc25a[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0xac25('0x0'));var rimraf=require(_0xac25('0x1'));var zipdir=require(_0xac25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac25('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac25('0x4'));var util=require(_0xac25('0x5'));var path=require(_0xac25('0x6'));var sox=require(_0xac25('0x7'));var csv=require(_0xac25('0x8'));var ejs=require(_0xac25('0x9'));var fs=require('fs');var fs_extra=require(_0xac25('0xa'));var _=require('lodash');var squel=require(_0xac25('0xb'));var crypto=require(_0xac25('0xc'));var jsforce=require(_0xac25('0xd'));var deskjs=require(_0xac25('0xe'));var toCsv=require(_0xac25('0x8'));var querystring=require(_0xac25('0xf'));var Papa=require(_0xac25('0x10'));var Redis=require(_0xac25('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xac25('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xac25('0x13'))(_0xac25('0x14'));var utils=require(_0xac25('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xac25('0x16'));var db=require(_0xac25('0x17'))['db'];function respondWithStatusCode(_0xaa12,_0x830b36){_0x830b36=_0x830b36||0xcc;return function(_0x20966c){if(_0x20966c){return _0xaa12[_0xac25('0x18')](_0x830b36);}return _0xaa12[_0xac25('0x19')](_0x830b36)['end']();};}function respondWithResult(_0x233acd,_0x430f19){_0x430f19=_0x430f19||0xc8;return function(_0x282c86){if(_0x282c86){return _0x233acd[_0xac25('0x19')](_0x430f19)[_0xac25('0x1a')](_0x282c86);}};}function respondWithFilteredResult(_0xc226ed,_0x5d6254){return function(_0x33499b){if(_0x33499b){var _0x4eadef=typeof _0x5d6254[_0xac25('0x1b')]===_0xac25('0x1c')&&typeof _0x5d6254['limit']===_0xac25('0x1c');var _0x824b9f=_0x33499b[_0xac25('0x1d')];var _0x3054bf=_0x4eadef?0x0:_0x5d6254[_0xac25('0x1b')];var _0x2d514b=_0x4eadef?_0x33499b['count']:_0x5d6254[_0xac25('0x1b')]+_0x5d6254[_0xac25('0x1e')];var _0x6f697f;if(_0x2d514b>=_0x824b9f){_0x2d514b=_0x824b9f;_0x6f697f=0xc8;}else{_0x6f697f=0xce;}_0xc226ed[_0xac25('0x19')](_0x6f697f);return _0xc226ed[_0xac25('0x1f')](_0xac25('0x20'),_0x3054bf+'-'+_0x2d514b+'/'+_0x824b9f)['json'](_0x33499b);}return null;};}function patchUpdates(_0x168ab6){return function(_0x591e6c){try{jsonpatch[_0xac25('0x21')](_0x591e6c,_0x168ab6,!![]);}catch(_0x392820){return BPromise[_0xac25('0x22')](_0x392820);}return _0x591e6c[_0xac25('0x23')]();};}function saveUpdates(_0x3530dc,_0x13c889){return function(_0x237a16){if(_0x237a16){return _0x237a16[_0xac25('0x24')](_0x3530dc)[_0xac25('0x25')](function(_0x37c17e){return _0x37c17e;});}return null;};}function removeEntity(_0x3b9cac,_0x36188b){return function(_0x2d6fe8){if(_0x2d6fe8){return _0x2d6fe8['destroy']()[_0xac25('0x25')](function(){_0x3b9cac[_0xac25('0x19')](0xcc)[_0xac25('0x26')]();});}};}function handleEntityNotFound(_0x20fe97,_0x3e5c28){return function(_0x712067){if(!_0x712067){_0x20fe97[_0xac25('0x18')](0x194);}return _0x712067;};}function handleError(_0x27060c,_0x13b7b9){_0x13b7b9=_0x13b7b9||0x1f4;return function(_0x4fc0af){logger[_0xac25('0x27')](_0x4fc0af['stack']);if(_0x4fc0af[_0xac25('0x28')]){delete _0x4fc0af[_0xac25('0x28')];}_0x27060c[_0xac25('0x19')](_0x13b7b9)[_0xac25('0x29')](_0x4fc0af);};}exports['index']=function(_0x2db825,_0x2e1631){var _0x5298fa={},_0x4dcaff={},_0x351fd3={'count':0x0,'rows':[]};var _0x212abc=_[_0xac25('0x2a')](db['SmsQueueReport'][_0xac25('0x2b')],function(_0x46d1d4){return{'name':_0x46d1d4[_0xac25('0x2c')],'type':_0x46d1d4['type'][_0xac25('0x2d')]};});_0x4dcaff['model']=_[_0xac25('0x2a')](_0x212abc,'name');_0x4dcaff['query']=_[_0xac25('0x2e')](_0x2db825[_0xac25('0x2f')]);_0x4dcaff[_0xac25('0x30')]=_[_0xac25('0x31')](_0x4dcaff['model'],_0x4dcaff['query']);_0x5298fa[_0xac25('0x32')]=_['intersection'](_0x4dcaff[_0xac25('0x33')],qs[_0xac25('0x34')](_0x2db825['query']['fields']));_0x5298fa[_0xac25('0x32')]=_0x5298fa[_0xac25('0x32')][_0xac25('0x35')]?_0x5298fa[_0xac25('0x32')]:_0x4dcaff[_0xac25('0x33')];if(!_0x2db825[_0xac25('0x2f')][_0xac25('0x36')](_0xac25('0x37'))){_0x5298fa[_0xac25('0x1e')]=qs[_0xac25('0x1e')](_0x2db825['query'][_0xac25('0x1e')]);_0x5298fa[_0xac25('0x1b')]=qs[_0xac25('0x1b')](_0x2db825[_0xac25('0x2f')]['offset']);}_0x5298fa[_0xac25('0x38')]=qs['sort'](_0x2db825['query'][_0xac25('0x39')]);_0x5298fa[_0xac25('0x3a')]=qs[_0xac25('0x30')](_[_0xac25('0x3b')](_0x2db825['query'],_0x4dcaff['filters']),_0x212abc);if(_0x2db825[_0xac25('0x2f')][_0xac25('0x3c')]){_0x5298fa[_0xac25('0x3a')]=_[_0xac25('0x3d')](_0x5298fa[_0xac25('0x3a')],{'$or':_[_0xac25('0x2a')](_0x212abc,function(_0x436e20){if(_0x436e20[_0xac25('0x3e')]!==_0xac25('0x3f')){var _0x428463={};_0x428463[_0x436e20[_0xac25('0x28')]]={'$like':'%'+_0x2db825[_0xac25('0x2f')][_0xac25('0x3c')]+'%'};return _0x428463;}})});}_0x5298fa=_[_0xac25('0x3d')]({},_0x5298fa,_0x2db825[_0xac25('0x40')]);var _0x5430b5={'where':_0x5298fa['where']};return db[_0xac25('0x41')][_0xac25('0x1d')](_0x5430b5)[_0xac25('0x25')](function(_0x2d2761){_0x351fd3[_0xac25('0x1d')]=_0x2d2761;if(_0x2db825[_0xac25('0x2f')][_0xac25('0x42')]){_0x5298fa[_0xac25('0x43')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x5298fa);})[_0xac25('0x25')](function(_0x2d8074){_0x351fd3[_0xac25('0x44')]=_0x2d8074;return _0x351fd3;})[_0xac25('0x25')](respondWithFilteredResult(_0x2e1631,_0x5298fa))['catch'](handleError(_0x2e1631,null));};exports[_0xac25('0x45')]=function(_0x541452,_0x13ac45){var _0x1dfeb1={'raw':!![],'where':{'id':_0x541452[_0xac25('0x46')]['id']}},_0x5339f7={};_0x5339f7['model']=_[_0xac25('0x2e')](db[_0xac25('0x41')][_0xac25('0x2b')]);_0x5339f7[_0xac25('0x2f')]=_['keys'](_0x541452['query']);_0x5339f7['filters']=_[_0xac25('0x31')](_0x5339f7[_0xac25('0x33')],_0x5339f7[_0xac25('0x2f')]);_0x1dfeb1[_0xac25('0x32')]=_[_0xac25('0x31')](_0x5339f7['model'],qs[_0xac25('0x34')](_0x541452['query'][_0xac25('0x34')]));_0x1dfeb1[_0xac25('0x32')]=_0x1dfeb1[_0xac25('0x32')][_0xac25('0x35')]?_0x1dfeb1['attributes']:_0x5339f7['model'];if(_0x541452[_0xac25('0x2f')][_0xac25('0x42')]){_0x1dfeb1[_0xac25('0x43')]=[{'all':!![]}];}_0x1dfeb1=_[_0xac25('0x3d')]({},_0x1dfeb1,_0x541452[_0xac25('0x40')]);return db[_0xac25('0x41')][_0xac25('0x47')](_0x1dfeb1)[_0xac25('0x25')](handleEntityNotFound(_0x13ac45,null))[_0xac25('0x25')](respondWithResult(_0x13ac45,null))['catch'](handleError(_0x13ac45,null));};exports[_0xac25('0x48')]=function(_0x159e3d,_0x3ee394){return db[_0xac25('0x41')][_0xac25('0x48')](_0x159e3d[_0xac25('0x49')],{})['then'](respondWithResult(_0x3ee394,0xc9))['catch'](handleError(_0x3ee394,null));};exports[_0xac25('0x24')]=function(_0x3a0c02,_0x24f42d){if(_0x3a0c02[_0xac25('0x49')]['id']){delete _0x3a0c02[_0xac25('0x49')]['id'];}return db[_0xac25('0x41')][_0xac25('0x47')]({'where':{'id':_0x3a0c02[_0xac25('0x46')]['id']}})[_0xac25('0x25')](handleEntityNotFound(_0x24f42d,null))[_0xac25('0x25')](saveUpdates(_0x3a0c02['body'],null))['then'](respondWithResult(_0x24f42d,null))[_0xac25('0x4a')](handleError(_0x24f42d,null));};exports[_0xac25('0x4b')]=function(_0x50ad94,_0x49a3db){return db[_0xac25('0x41')]['find']({'where':{'id':_0x50ad94[_0xac25('0x46')]['id']}})[_0xac25('0x25')](handleEntityNotFound(_0x49a3db,null))[_0xac25('0x25')](removeEntity(_0x49a3db,null))[_0xac25('0x4a')](handleError(_0x49a3db,null));};exports[_0xac25('0x4c')]=function(_0xe4795b,_0x29844b){return db['SmsQueueReport'][_0xac25('0x4c')]()[_0xac25('0x25')](respondWithResult(_0x29844b,null))['catch'](handleError(_0x29844b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index fa91e5f..0b488b6 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x170426,_0x25e354){var _0x527e79=function(_0xfe7474){while(--_0xfe7474){_0x170426['push'](_0x170426['shift']());}};_0x527e79(++_0x25e354);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x2b9fde,_0x40d273){var _0xda9dd7=function(_0x10f441){while(--_0x10f441){_0x2b9fde['push'](_0x2b9fde['shift']());}};_0xda9dd7(++_0x40d273);}(_0x70e0,0x17b));var _0x070e=function(_0x318e91,_0x3b4416){_0x318e91=_0x318e91-0x0;var _0x44fa35=_0x70e0[_0x318e91];return _0x44fa35;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 4807e06..efadfcd 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 _0x25dd=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','then','stringify','UpdateSmsQueueReport','update','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x25dd,0xc6));var _0xd25d=function(_0x5c53c2,_0x47cca5){_0x5c53c2=_0x5c53c2-0x0;var _0x55b3eb=_0x25dd[_0x5c53c2];return _0x55b3eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd25d('0x0'));var BPromise=require(_0xd25d('0x1'));var rs=require(_0xd25d('0x2'));var fs=require('fs');var Redis=require(_0xd25d('0x3'));var db=require(_0xd25d('0x4'))['db'];var utils=require(_0xd25d('0x5'));var logger=require(_0xd25d('0x6'))(_0xd25d('0x7'));var config=require(_0xd25d('0x8'));var jayson=require(_0xd25d('0x9'));var client=jayson[_0xd25d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x597819,_0x1e1836,_0x5931e0){return new BPromise(function(_0x9b767a,_0x4371e0){return client['request'](_0x597819,_0x5931e0)['then'](function(_0x5c3250){logger[_0xd25d('0xb')](_0xd25d('0xc'),_0x1e1836,_0xd25d('0xd'));logger[_0xd25d('0xe')](_0xd25d('0xf'),_0x1e1836,_0xd25d('0xd'),JSON['stringify'](_0x5c3250));if(_0x5c3250[_0xd25d('0x10')]){if(_0x5c3250[_0xd25d('0x10')][_0xd25d('0x11')]===0x1f4){logger['error'](_0xd25d('0xc'),_0x1e1836,_0x5c3250[_0xd25d('0x10')][_0xd25d('0x12')]);return _0x4371e0(_0x5c3250[_0xd25d('0x10')][_0xd25d('0x12')]);}logger[_0xd25d('0x10')](_0xd25d('0xc'),_0x1e1836,_0x5c3250[_0xd25d('0x10')][_0xd25d('0x12')]);return _0x9b767a(_0x5c3250['error']['message']);}else{logger[_0xd25d('0xb')](_0xd25d('0xc'),_0x1e1836,_0xd25d('0xd'));_0x9b767a(_0x5c3250['result']['message']);}})[_0xd25d('0x13')](function(_0x25d829){logger[_0xd25d('0x10')](_0xd25d('0xc'),_0x1e1836,_0x25d829);_0x4371e0(_0x25d829);});});}exports[_0xd25d('0x14')]=function(_0x3b5c36){var _0x44f2f0=this;return new Promise(function(_0x20fa55,_0x2c7170){return db[_0xd25d('0x15')]['create'](_0x3b5c36[_0xd25d('0x16')],{'raw':_0x3b5c36[_0xd25d('0x17')]?_0x3b5c36[_0xd25d('0x17')][_0xd25d('0x18')]===undefined?!![]:![]:!![]})[_0xd25d('0x19')](function(_0x23499f){logger[_0xd25d('0xb')]('CreateSmsQueueReport',_0x3b5c36);logger[_0xd25d('0xe')](_0xd25d('0x14'),_0x3b5c36,JSON[_0xd25d('0x1a')](_0x23499f));_0x20fa55(_0x23499f);})[_0xd25d('0x13')](function(_0x16c45a){logger[_0xd25d('0x10')](_0xd25d('0x14'),_0x16c45a['message'],_0x3b5c36);_0x2c7170(_0x44f2f0[_0xd25d('0x10')](0x1f4,_0x16c45a[_0xd25d('0x12')]));});});};exports[_0xd25d('0x1b')]=function(_0x24b5eb){var _0x380348=this;return new Promise(function(_0x2f67b8,_0x18caa5){return db['SmsQueueReport'][_0xd25d('0x1c')](_0x24b5eb[_0xd25d('0x16')],{'raw':_0x24b5eb[_0xd25d('0x17')]?_0x24b5eb[_0xd25d('0x17')][_0xd25d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b5eb[_0xd25d('0x17')]?_0x24b5eb[_0xd25d('0x17')][_0xd25d('0x1d')]||null:null,'attributes':_0x24b5eb[_0xd25d('0x17')]?_0x24b5eb[_0xd25d('0x17')]['attributes']||null:null,'limit':_0x24b5eb[_0xd25d('0x17')]?_0x24b5eb[_0xd25d('0x17')]['limit']||null:null})[_0xd25d('0x19')](function(_0x21ad99){logger[_0xd25d('0xb')]('UpdateSmsQueueReport',_0x24b5eb);logger[_0xd25d('0xe')](_0xd25d('0x1b'),_0x24b5eb,JSON['stringify'](_0x21ad99));_0x2f67b8(_0x21ad99);})['catch'](function(_0x32e971){logger[_0xd25d('0x10')]('UpdateSmsQueueReport',_0x32e971[_0xd25d('0x12')],_0x24b5eb);_0x18caa5(_0x380348[_0xd25d('0x10')](0x1f4,_0x32e971['message']));});});}; \ No newline at end of file +var _0x0161=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSmsQueueReport','create','body','options','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes'];(function(_0x4e2861,_0x199be0){var _0x2265e3=function(_0x469693){while(--_0x469693){_0x4e2861['push'](_0x4e2861['shift']());}};_0x2265e3(++_0x199be0);}(_0x0161,0x1c8));var _0x1016=function(_0x21a7ee,_0x3726d3){_0x21a7ee=_0x21a7ee-0x0;var _0x3257ce=_0x0161[_0x21a7ee];return _0x3257ce;};'use strict';var _=require(_0x1016('0x0'));var util=require(_0x1016('0x1'));var moment=require(_0x1016('0x2'));var BPromise=require(_0x1016('0x3'));var rs=require(_0x1016('0x4'));var fs=require('fs');var Redis=require(_0x1016('0x5'));var db=require(_0x1016('0x6'))['db'];var utils=require(_0x1016('0x7'));var logger=require(_0x1016('0x8'))(_0x1016('0x9'));var config=require(_0x1016('0xa'));var jayson=require(_0x1016('0xb'));var client=jayson[_0x1016('0xc')][_0x1016('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ab644,_0x514b78,_0xbcb67f){return new BPromise(function(_0x410f7c,_0x52372d){return client['request'](_0x2ab644,_0xbcb67f)[_0x1016('0xe')](function(_0x444f27){logger[_0x1016('0xf')](_0x1016('0x10'),_0x514b78,'request\x20sent');logger[_0x1016('0x11')](_0x1016('0x12'),_0x514b78,_0x1016('0x13'),JSON['stringify'](_0x444f27));if(_0x444f27[_0x1016('0x14')]){if(_0x444f27['error']['code']===0x1f4){logger[_0x1016('0x14')](_0x1016('0x10'),_0x514b78,_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);return _0x52372d(_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x514b78,_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);return _0x410f7c(_0x444f27[_0x1016('0x14')]['message']);}else{logger[_0x1016('0xf')](_0x1016('0x10'),_0x514b78,_0x1016('0x13'));_0x410f7c(_0x444f27[_0x1016('0x16')][_0x1016('0x15')]);}})[_0x1016('0x17')](function(_0x576849){logger[_0x1016('0x14')](_0x1016('0x10'),_0x514b78,_0x576849);_0x52372d(_0x576849);});});}exports[_0x1016('0x18')]=function(_0x509bf3){var _0x3c78bb=this;return new Promise(function(_0x145245,_0xc5ce08){return db['SmsQueueReport'][_0x1016('0x19')](_0x509bf3[_0x1016('0x1a')],{'raw':_0x509bf3[_0x1016('0x1b')]?_0x509bf3[_0x1016('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53c6f8){logger[_0x1016('0xf')]('CreateSmsQueueReport',_0x509bf3);logger['debug']('CreateSmsQueueReport',_0x509bf3,JSON[_0x1016('0x1c')](_0x53c6f8));_0x145245(_0x53c6f8);})[_0x1016('0x17')](function(_0x2b1ae7){logger[_0x1016('0x14')](_0x1016('0x18'),_0x2b1ae7[_0x1016('0x15')],_0x509bf3);_0xc5ce08(_0x3c78bb[_0x1016('0x14')](0x1f4,_0x2b1ae7['message']));});});};exports[_0x1016('0x1d')]=function(_0x105d2f){var _0x569b28=this;return new Promise(function(_0xe6c79c,_0xdd82c5){return db[_0x1016('0x1e')][_0x1016('0x1f')](_0x105d2f[_0x1016('0x1a')],{'raw':_0x105d2f['options']?_0x105d2f[_0x1016('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105d2f[_0x1016('0x1b')]?_0x105d2f['options'][_0x1016('0x20')]||null:null,'attributes':_0x105d2f[_0x1016('0x1b')]?_0x105d2f['options'][_0x1016('0x21')]||null:null,'limit':_0x105d2f[_0x1016('0x1b')]?_0x105d2f[_0x1016('0x1b')][_0x1016('0x22')]||null:null})['then'](function(_0x54f2a7){logger[_0x1016('0xf')](_0x1016('0x1d'),_0x105d2f);logger[_0x1016('0x11')](_0x1016('0x1d'),_0x105d2f,JSON[_0x1016('0x1c')](_0x54f2a7));_0xe6c79c(_0x54f2a7);})[_0x1016('0x17')](function(_0x39d83c){logger[_0x1016('0x14')](_0x1016('0x1d'),_0x39d83c[_0x1016('0x15')],_0x105d2f);_0xdd82c5(_0x569b28[_0x1016('0x14')](0x1f4,_0x39d83c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index cab8d3a..ec58e96 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 _0x5577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5577,0x1b4));var _0x7557=function(_0xd864a4,_0x170ee4){_0xd864a4=_0xd864a4-0x0;var _0x4b38d1=_0x5577[_0xd864a4];return _0x4b38d1;};'use strict';var multer=require(_0x7557('0x0'));var util=require('util');var path=require(_0x7557('0x1'));var timeout=require(_0x7557('0x2'));var express=require('express');var router=express[_0x7557('0x3')]();var fs_extra=require(_0x7557('0x4'));var auth=require(_0x7557('0x5'));var interaction=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var controller=require(_0x7557('0x8'));router['get']('/',auth[_0x7557('0x9')](),controller[_0x7557('0xa')]);router[_0x7557('0xb')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0xd')]);router[_0x7557('0xb')](_0x7557('0xe'),auth[_0x7557('0x9')](),controller[_0x7557('0xf')]);router[_0x7557('0x10')]('/',auth[_0x7557('0x9')](),controller[_0x7557('0x11')]);router[_0x7557('0x12')](_0x7557('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x7557('0x13')](_0x7557('0xe'),auth[_0x7557('0x9')](),controller[_0x7557('0x14')]);module[_0x7557('0x15')]=router; \ No newline at end of file +var _0x43fd=['create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post'];(function(_0x208c26,_0xd03b50){var _0x160b08=function(_0x43770d){while(--_0x43770d){_0x208c26['push'](_0x208c26['shift']());}};_0x160b08(++_0xd03b50);}(_0x43fd,0x1ec));var _0xd43f=function(_0x262f1f,_0x2a4464){_0x262f1f=_0x262f1f-0x0;var _0xa190e9=_0x43fd[_0x262f1f];return _0xa190e9;};'use strict';var multer=require('multer');var util=require(_0xd43f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd43f('0x1'));var router=express[_0xd43f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd43f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd43f('0x4'));var controller=require(_0xd43f('0x5'));router[_0xd43f('0x6')]('/',auth[_0xd43f('0x7')](),controller['index']);router[_0xd43f('0x6')](_0xd43f('0x8'),auth[_0xd43f('0x7')](),controller[_0xd43f('0x9')]);router['get'](_0xd43f('0xa'),auth[_0xd43f('0x7')](),controller['show']);router[_0xd43f('0xb')]('/',auth[_0xd43f('0x7')](),controller[_0xd43f('0xc')]);router[_0xd43f('0xd')](_0xd43f('0xa'),auth['isAuthenticated'](),controller[_0xd43f('0xe')]);router[_0xd43f('0xf')](_0xd43f('0xa'),auth[_0xd43f('0x7')](),controller[_0xd43f('0x10')]);module[_0xd43f('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index d2cd213..3527444 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5a8315,_0x9ef47d){var _0x5cc037=function(_0x4fe62e){while(--_0x4fe62e){_0x5a8315['push'](_0x5a8315['shift']());}};_0x5cc037(++_0x9ef47d);}(_0x54ef,0x112));var _0xf54e=function(_0x56a9be,_0x22fb0b){_0x56a9be=_0x56a9be-0x0;var _0x5279de=_0x54ef[_0x56a9be];return _0x5279de;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x32dd80,_0x30bb55){var _0x40e39f=function(_0x514de6){while(--_0x514de6){_0x32dd80['push'](_0x32dd80['shift']());}};_0x40e39f(++_0x30bb55);}(_0xedd9,0xfc));var _0x9edd=function(_0x5be392,_0x4f864f){_0x5be392=_0x5be392-0x0;var _0x2fa68b=_0xedd9[_0x5be392];return _0x2fa68b;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 31a0cbe..9dd06ef 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 _0x9cf7=['limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','../../mysqldb','sendStatus','end','status','undefined'];(function(_0x447387,_0x2a3538){var _0x3c64e7=function(_0x5c9dfb){while(--_0x5c9dfb){_0x447387['push'](_0x447387['shift']());}};_0x3c64e7(++_0x2a3538);}(_0x9cf7,0x163));var _0x79cf=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x9cf7[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x79cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79cf('0x1'));var jsonpatch=require(_0x79cf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x79cf('0x3'));var Mustache=require(_0x79cf('0x4'));var util=require(_0x79cf('0x5'));var path=require(_0x79cf('0x6'));var sox=require(_0x79cf('0x7'));var csv=require('to-csv');var ejs=require(_0x79cf('0x8'));var fs=require('fs');var fs_extra=require(_0x79cf('0x9'));var _=require(_0x79cf('0xa'));var squel=require(_0x79cf('0xb'));var crypto=require(_0x79cf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x79cf('0xd'));var toCsv=require(_0x79cf('0xe'));var querystring=require('querystring');var Papa=require(_0x79cf('0xf'));var Redis=require(_0x79cf('0x10'));var authService=require(_0x79cf('0x11'));var qs=require(_0x79cf('0x12'));var as=require(_0x79cf('0x13'));var hardwareService=require(_0x79cf('0x14'));var logger=require(_0x79cf('0x15'))(_0x79cf('0x16'));var utils=require(_0x79cf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x79cf('0x18'));var db=require(_0x79cf('0x19'))['db'];function respondWithStatusCode(_0x32c261,_0x26be68){_0x26be68=_0x26be68||0xcc;return function(_0x31d064){if(_0x31d064){return _0x32c261[_0x79cf('0x1a')](_0x26be68);}return _0x32c261['status'](_0x26be68)[_0x79cf('0x1b')]();};}function respondWithResult(_0x268b3d,_0x4d33ec){_0x4d33ec=_0x4d33ec||0xc8;return function(_0xc8898c){if(_0xc8898c){return _0x268b3d[_0x79cf('0x1c')](_0x4d33ec)['json'](_0xc8898c);}};}function respondWithFilteredResult(_0x21b7e8,_0x1d70ba){return function(_0xa8f1d5){if(_0xa8f1d5){var _0x73960b=typeof _0x1d70ba['offset']===_0x79cf('0x1d')&&typeof _0x1d70ba[_0x79cf('0x1e')]===_0x79cf('0x1d');var _0x550fb5=_0xa8f1d5[_0x79cf('0x1f')];var _0x27c4a5=_0x73960b?0x0:_0x1d70ba[_0x79cf('0x20')];var _0x497e98=_0x73960b?_0xa8f1d5['count']:_0x1d70ba['offset']+_0x1d70ba[_0x79cf('0x1e')];var _0x42d104;if(_0x497e98>=_0x550fb5){_0x497e98=_0x550fb5;_0x42d104=0xc8;}else{_0x42d104=0xce;}_0x21b7e8[_0x79cf('0x1c')](_0x42d104);return _0x21b7e8[_0x79cf('0x21')](_0x79cf('0x22'),_0x27c4a5+'-'+_0x497e98+'/'+_0x550fb5)['json'](_0xa8f1d5);}return null;};}function patchUpdates(_0x5a121a){return function(_0x431d90){try{jsonpatch[_0x79cf('0x23')](_0x431d90,_0x5a121a,!![]);}catch(_0x49a1fb){return BPromise['reject'](_0x49a1fb);}return _0x431d90['save']();};}function saveUpdates(_0x1c87ee,_0x518179){return function(_0x44cf21){if(_0x44cf21){return _0x44cf21[_0x79cf('0x24')](_0x1c87ee)[_0x79cf('0x25')](function(_0x486c53){return _0x486c53;});}return null;};}function removeEntity(_0x2f9933,_0x2f2847){return function(_0xce764b){if(_0xce764b){return _0xce764b[_0x79cf('0x26')]()[_0x79cf('0x25')](function(){_0x2f9933['status'](0xcc)[_0x79cf('0x1b')]();});}};}function handleEntityNotFound(_0x218190,_0x3fda5f){return function(_0x50b6bf){if(!_0x50b6bf){_0x218190[_0x79cf('0x1a')](0x194);}return _0x50b6bf;};}function handleError(_0x21a327,_0x2b13c0){_0x2b13c0=_0x2b13c0||0x1f4;return function(_0x25ec96){logger[_0x79cf('0x27')](_0x25ec96[_0x79cf('0x28')]);if(_0x25ec96[_0x79cf('0x29')]){delete _0x25ec96[_0x79cf('0x29')];}_0x21a327[_0x79cf('0x1c')](_0x2b13c0)[_0x79cf('0x2a')](_0x25ec96);};}exports[_0x79cf('0x2b')]=function(_0x444038,_0xd5a7f5){var _0x2c3526={},_0x90f96c={},_0x2dd3f2={'count':0x0,'rows':[]};var _0x307cff=_[_0x79cf('0x2c')](db[_0x79cf('0x2d')]['rawAttributes'],function(_0x53e988){return{'name':_0x53e988[_0x79cf('0x2e')],'type':_0x53e988[_0x79cf('0x2f')][_0x79cf('0x30')]};});_0x90f96c[_0x79cf('0x31')]=_[_0x79cf('0x2c')](_0x307cff,_0x79cf('0x29'));_0x90f96c[_0x79cf('0x32')]=_[_0x79cf('0x33')](_0x444038[_0x79cf('0x32')]);_0x90f96c[_0x79cf('0x34')]=_[_0x79cf('0x35')](_0x90f96c[_0x79cf('0x31')],_0x90f96c[_0x79cf('0x32')]);_0x2c3526[_0x79cf('0x36')]=_['intersection'](_0x90f96c['model'],qs[_0x79cf('0x37')](_0x444038[_0x79cf('0x32')][_0x79cf('0x37')]));_0x2c3526['attributes']=_0x2c3526[_0x79cf('0x36')][_0x79cf('0x38')]?_0x2c3526[_0x79cf('0x36')]:_0x90f96c['model'];if(!_0x444038[_0x79cf('0x32')][_0x79cf('0x39')](_0x79cf('0x3a'))){_0x2c3526[_0x79cf('0x1e')]=qs['limit'](_0x444038[_0x79cf('0x32')][_0x79cf('0x1e')]);_0x2c3526[_0x79cf('0x20')]=qs[_0x79cf('0x20')](_0x444038[_0x79cf('0x32')][_0x79cf('0x20')]);}_0x2c3526['order']=qs[_0x79cf('0x3b')](_0x444038[_0x79cf('0x32')][_0x79cf('0x3b')]);_0x2c3526[_0x79cf('0x3c')]=qs[_0x79cf('0x34')](_[_0x79cf('0x3d')](_0x444038['query'],_0x90f96c[_0x79cf('0x34')]),_0x307cff);if(_0x444038['query'][_0x79cf('0x3e')]){_0x2c3526[_0x79cf('0x3c')]=_[_0x79cf('0x3f')](_0x2c3526[_0x79cf('0x3c')],{'$or':_[_0x79cf('0x2c')](_0x307cff,function(_0x3d4c4b){if(_0x3d4c4b['type']!==_0x79cf('0x40')){var _0x246ee3={};_0x246ee3[_0x3d4c4b['name']]={'$like':'%'+_0x444038[_0x79cf('0x32')]['filter']+'%'};return _0x246ee3;}})});}_0x2c3526=_[_0x79cf('0x3f')]({},_0x2c3526,_0x444038[_0x79cf('0x41')]);var _0x4cccbf={'where':_0x2c3526[_0x79cf('0x3c')]};return db[_0x79cf('0x2d')]['count'](_0x4cccbf)[_0x79cf('0x25')](function(_0x3905d8){_0x2dd3f2[_0x79cf('0x1f')]=_0x3905d8;if(_0x444038[_0x79cf('0x32')][_0x79cf('0x42')]){_0x2c3526[_0x79cf('0x43')]=[{'all':!![]}];}return db[_0x79cf('0x2d')]['findAll'](_0x2c3526);})[_0x79cf('0x25')](function(_0x13ecf0){_0x2dd3f2[_0x79cf('0x44')]=_0x13ecf0;return _0x2dd3f2;})[_0x79cf('0x25')](respondWithFilteredResult(_0xd5a7f5,_0x2c3526))[_0x79cf('0x45')](handleError(_0xd5a7f5,null));};exports[_0x79cf('0x46')]=function(_0x3e407e,_0x5c257f){var _0x28d70f={'raw':!![],'where':{'id':_0x3e407e['params']['id']}},_0x35714e={};_0x35714e['model']=_[_0x79cf('0x33')](db[_0x79cf('0x2d')][_0x79cf('0x47')]);_0x35714e[_0x79cf('0x32')]=_[_0x79cf('0x33')](_0x3e407e[_0x79cf('0x32')]);_0x35714e[_0x79cf('0x34')]=_[_0x79cf('0x35')](_0x35714e['model'],_0x35714e[_0x79cf('0x32')]);_0x28d70f[_0x79cf('0x36')]=_[_0x79cf('0x35')](_0x35714e['model'],qs[_0x79cf('0x37')](_0x3e407e[_0x79cf('0x32')][_0x79cf('0x37')]));_0x28d70f[_0x79cf('0x36')]=_0x28d70f[_0x79cf('0x36')][_0x79cf('0x38')]?_0x28d70f[_0x79cf('0x36')]:_0x35714e[_0x79cf('0x31')];if(_0x3e407e[_0x79cf('0x32')]['includeAll']){_0x28d70f['include']=[{'all':!![]}];}_0x28d70f=_[_0x79cf('0x3f')]({},_0x28d70f,_0x3e407e[_0x79cf('0x41')]);return db[_0x79cf('0x2d')][_0x79cf('0x48')](_0x28d70f)[_0x79cf('0x25')](handleEntityNotFound(_0x5c257f,null))[_0x79cf('0x25')](respondWithResult(_0x5c257f,null))[_0x79cf('0x45')](handleError(_0x5c257f,null));};exports[_0x79cf('0x49')]=function(_0x30990b,_0x248aa5){return db[_0x79cf('0x2d')][_0x79cf('0x49')](_0x30990b[_0x79cf('0x4a')],{})['then'](respondWithResult(_0x248aa5,0xc9))[_0x79cf('0x45')](handleError(_0x248aa5,null));};exports[_0x79cf('0x24')]=function(_0x281a61,_0x4246e9){if(_0x281a61[_0x79cf('0x4a')]['id']){delete _0x281a61['body']['id'];}return db[_0x79cf('0x2d')][_0x79cf('0x48')]({'where':{'id':_0x281a61[_0x79cf('0x4b')]['id']}})[_0x79cf('0x25')](handleEntityNotFound(_0x4246e9,null))[_0x79cf('0x25')](saveUpdates(_0x281a61['body'],null))['then'](respondWithResult(_0x4246e9,null))[_0x79cf('0x45')](handleError(_0x4246e9,null));};exports[_0x79cf('0x26')]=function(_0x59d9fe,_0x2e1883){return db[_0x79cf('0x2d')]['find']({'where':{'id':_0x59d9fe[_0x79cf('0x4b')]['id']}})[_0x79cf('0x25')](handleEntityNotFound(_0x2e1883,null))[_0x79cf('0x25')](removeEntity(_0x2e1883,null))[_0x79cf('0x45')](handleError(_0x2e1883,null));};exports[_0x79cf('0x4c')]=function(_0x55dcdc,_0x46eb0e){return db[_0x79cf('0x2d')][_0x79cf('0x4c')]()[_0x79cf('0x25')](respondWithResult(_0x46eb0e,null))[_0x79cf('0x45')](handleError(_0x46eb0e,null));}; \ No newline at end of file +var _0x1b21=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SmsTransferReport','include','findAll','catch','show','keys','includeAll','create','update','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','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','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0x1b21,0x1cf));var _0x11b2=function(_0x2dfa3a,_0x39e02d){_0x2dfa3a=_0x2dfa3a-0x0;var _0x5116a8=_0x1b21[_0x2dfa3a];return _0x5116a8;};'use strict';var emlformat=require(_0x11b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11b2('0x1'));var jsonpatch=require(_0x11b2('0x2'));var rp=require(_0x11b2('0x3'));var moment=require('moment');var BPromise=require(_0x11b2('0x4'));var Mustache=require(_0x11b2('0x5'));var util=require('util');var path=require(_0x11b2('0x6'));var sox=require(_0x11b2('0x7'));var csv=require(_0x11b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11b2('0x9'));var _=require('lodash');var squel=require(_0x11b2('0xa'));var crypto=require(_0x11b2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x11b2('0xc'));var toCsv=require(_0x11b2('0x8'));var querystring=require('querystring');var Papa=require(_0x11b2('0xd'));var Redis=require(_0x11b2('0xe'));var authService=require(_0x11b2('0xf'));var qs=require(_0x11b2('0x10'));var as=require(_0x11b2('0x11'));var hardwareService=require(_0x11b2('0x12'));var logger=require(_0x11b2('0x13'))('api');var utils=require(_0x11b2('0x14'));var config=require(_0x11b2('0x15'));var licenseUtil=require(_0x11b2('0x16'));var db=require(_0x11b2('0x17'))['db'];function respondWithStatusCode(_0x28015a,_0x404819){_0x404819=_0x404819||0xcc;return function(_0x1677d2){if(_0x1677d2){return _0x28015a[_0x11b2('0x18')](_0x404819);}return _0x28015a[_0x11b2('0x19')](_0x404819)['end']();};}function respondWithResult(_0x5628b9,_0x3494ca){_0x3494ca=_0x3494ca||0xc8;return function(_0x289c12){if(_0x289c12){return _0x5628b9[_0x11b2('0x19')](_0x3494ca)[_0x11b2('0x1a')](_0x289c12);}};}function respondWithFilteredResult(_0x35ad39,_0x5cca04){return function(_0x17ab40){if(_0x17ab40){var _0x50f801=typeof _0x5cca04['offset']===_0x11b2('0x1b')&&typeof _0x5cca04[_0x11b2('0x1c')]==='undefined';var _0x454f4a=_0x17ab40[_0x11b2('0x1d')];var _0x5203cd=_0x50f801?0x0:_0x5cca04[_0x11b2('0x1e')];var _0x4f5a98=_0x50f801?_0x17ab40[_0x11b2('0x1d')]:_0x5cca04[_0x11b2('0x1e')]+_0x5cca04[_0x11b2('0x1c')];var _0x4fc636;if(_0x4f5a98>=_0x454f4a){_0x4f5a98=_0x454f4a;_0x4fc636=0xc8;}else{_0x4fc636=0xce;}_0x35ad39[_0x11b2('0x19')](_0x4fc636);return _0x35ad39['set'](_0x11b2('0x1f'),_0x5203cd+'-'+_0x4f5a98+'/'+_0x454f4a)[_0x11b2('0x1a')](_0x17ab40);}return null;};}function patchUpdates(_0x53d4d4){return function(_0x240734){try{jsonpatch[_0x11b2('0x20')](_0x240734,_0x53d4d4,!![]);}catch(_0x2814d1){return BPromise['reject'](_0x2814d1);}return _0x240734[_0x11b2('0x21')]();};}function saveUpdates(_0x57d5b5,_0x31f612){return function(_0x59c370){if(_0x59c370){return _0x59c370['update'](_0x57d5b5)[_0x11b2('0x22')](function(_0xaa175a){return _0xaa175a;});}return null;};}function removeEntity(_0x1e16c3,_0x4a121b){return function(_0x1a7008){if(_0x1a7008){return _0x1a7008[_0x11b2('0x23')]()[_0x11b2('0x22')](function(){_0x1e16c3[_0x11b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402f21,_0x1005d3){return function(_0x2fc0ef){if(!_0x2fc0ef){_0x402f21[_0x11b2('0x18')](0x194);}return _0x2fc0ef;};}function handleError(_0x417f89,_0x5364f8){_0x5364f8=_0x5364f8||0x1f4;return function(_0x15e400){logger[_0x11b2('0x24')](_0x15e400[_0x11b2('0x25')]);if(_0x15e400[_0x11b2('0x26')]){delete _0x15e400[_0x11b2('0x26')];}_0x417f89['status'](_0x5364f8)[_0x11b2('0x27')](_0x15e400);};}exports[_0x11b2('0x28')]=function(_0x240de2,_0x5d5add){var _0x529443={},_0x1495c4={},_0xa569d8={'count':0x0,'rows':[]};var _0x3805d2=_[_0x11b2('0x29')](db['SmsTransferReport']['rawAttributes'],function(_0x116bca){return{'name':_0x116bca[_0x11b2('0x2a')],'type':_0x116bca[_0x11b2('0x2b')][_0x11b2('0x2c')]};});_0x1495c4[_0x11b2('0x2d')]=_[_0x11b2('0x29')](_0x3805d2,'name');_0x1495c4[_0x11b2('0x2e')]=_['keys'](_0x240de2['query']);_0x1495c4[_0x11b2('0x2f')]=_[_0x11b2('0x30')](_0x1495c4[_0x11b2('0x2d')],_0x1495c4[_0x11b2('0x2e')]);_0x529443[_0x11b2('0x31')]=_['intersection'](_0x1495c4['model'],qs[_0x11b2('0x32')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x32')]));_0x529443[_0x11b2('0x31')]=_0x529443[_0x11b2('0x31')][_0x11b2('0x33')]?_0x529443[_0x11b2('0x31')]:_0x1495c4[_0x11b2('0x2d')];if(!_0x240de2['query'][_0x11b2('0x34')](_0x11b2('0x35'))){_0x529443[_0x11b2('0x1c')]=qs[_0x11b2('0x1c')](_0x240de2['query'][_0x11b2('0x1c')]);_0x529443[_0x11b2('0x1e')]=qs[_0x11b2('0x1e')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x1e')]);}_0x529443[_0x11b2('0x36')]=qs[_0x11b2('0x37')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x37')]);_0x529443[_0x11b2('0x38')]=qs[_0x11b2('0x2f')](_['pick'](_0x240de2[_0x11b2('0x2e')],_0x1495c4['filters']),_0x3805d2);if(_0x240de2[_0x11b2('0x2e')][_0x11b2('0x39')]){_0x529443[_0x11b2('0x38')]=_[_0x11b2('0x3a')](_0x529443['where'],{'$or':_['map'](_0x3805d2,function(_0x59c73e){if(_0x59c73e[_0x11b2('0x2b')]!=='VIRTUAL'){var _0x208523={};_0x208523[_0x59c73e[_0x11b2('0x26')]]={'$like':'%'+_0x240de2[_0x11b2('0x2e')][_0x11b2('0x39')]+'%'};return _0x208523;}})});}_0x529443=_[_0x11b2('0x3a')]({},_0x529443,_0x240de2[_0x11b2('0x3b')]);var _0x345771={'where':_0x529443['where']};return db[_0x11b2('0x3c')][_0x11b2('0x1d')](_0x345771)[_0x11b2('0x22')](function(_0x141aed){_0xa569d8['count']=_0x141aed;if(_0x240de2[_0x11b2('0x2e')]['includeAll']){_0x529443[_0x11b2('0x3d')]=[{'all':!![]}];}return db[_0x11b2('0x3c')][_0x11b2('0x3e')](_0x529443);})[_0x11b2('0x22')](function(_0x210205){_0xa569d8['rows']=_0x210205;return _0xa569d8;})['then'](respondWithFilteredResult(_0x5d5add,_0x529443))[_0x11b2('0x3f')](handleError(_0x5d5add,null));};exports[_0x11b2('0x40')]=function(_0xb5e7ac,_0x214e2b){var _0x50f073={'raw':!![],'where':{'id':_0xb5e7ac['params']['id']}},_0x55b768={};_0x55b768[_0x11b2('0x2d')]=_[_0x11b2('0x41')](db[_0x11b2('0x3c')]['rawAttributes']);_0x55b768['query']=_[_0x11b2('0x41')](_0xb5e7ac['query']);_0x55b768[_0x11b2('0x2f')]=_[_0x11b2('0x30')](_0x55b768[_0x11b2('0x2d')],_0x55b768[_0x11b2('0x2e')]);_0x50f073[_0x11b2('0x31')]=_['intersection'](_0x55b768[_0x11b2('0x2d')],qs[_0x11b2('0x32')](_0xb5e7ac[_0x11b2('0x2e')][_0x11b2('0x32')]));_0x50f073[_0x11b2('0x31')]=_0x50f073[_0x11b2('0x31')]['length']?_0x50f073['attributes']:_0x55b768['model'];if(_0xb5e7ac[_0x11b2('0x2e')][_0x11b2('0x42')]){_0x50f073[_0x11b2('0x3d')]=[{'all':!![]}];}_0x50f073=_[_0x11b2('0x3a')]({},_0x50f073,_0xb5e7ac[_0x11b2('0x3b')]);return db[_0x11b2('0x3c')]['find'](_0x50f073)[_0x11b2('0x22')](handleEntityNotFound(_0x214e2b,null))[_0x11b2('0x22')](respondWithResult(_0x214e2b,null))[_0x11b2('0x3f')](handleError(_0x214e2b,null));};exports[_0x11b2('0x43')]=function(_0x3bc807,_0x2e0830){return db[_0x11b2('0x3c')][_0x11b2('0x43')](_0x3bc807['body'],{})[_0x11b2('0x22')](respondWithResult(_0x2e0830,0xc9))[_0x11b2('0x3f')](handleError(_0x2e0830,null));};exports[_0x11b2('0x44')]=function(_0x4a1703,_0x482c90){if(_0x4a1703['body']['id']){delete _0x4a1703[_0x11b2('0x45')]['id'];}return db[_0x11b2('0x3c')]['find']({'where':{'id':_0x4a1703['params']['id']}})['then'](handleEntityNotFound(_0x482c90,null))[_0x11b2('0x22')](saveUpdates(_0x4a1703['body'],null))[_0x11b2('0x22')](respondWithResult(_0x482c90,null))['catch'](handleError(_0x482c90,null));};exports['destroy']=function(_0x328a61,_0x1dcaa4){return db['SmsTransferReport'][_0x11b2('0x46')]({'where':{'id':_0x328a61[_0x11b2('0x47')]['id']}})[_0x11b2('0x22')](handleEntityNotFound(_0x1dcaa4,null))[_0x11b2('0x22')](removeEntity(_0x1dcaa4,null))['catch'](handleError(_0x1dcaa4,null));};exports[_0x11b2('0x48')]=function(_0x1c0936,_0x276409){return db['SmsTransferReport'][_0x11b2('0x48')]()[_0x11b2('0x22')](respondWithResult(_0x276409,null))[_0x11b2('0x3f')](handleError(_0x276409,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e702460..0de5f2a 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 _0xc6e6=['path','./smsTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4d3ca6,_0xc33ee5){var _0x46c604=function(_0x6c13fd){while(--_0x6c13fd){_0x4d3ca6['push'](_0x4d3ca6['shift']());}};_0x46c604(++_0xc33ee5);}(_0xc6e6,0xc2));var _0x6c6e=function(_0x2dbb09,_0x259bd4){_0x2dbb09=_0x2dbb09-0x0;var _0x37970d=_0xc6e6[_0x2dbb09];return _0x37970d;};'use strict';var _=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var logger=require(_0x6c6e('0x2'))(_0x6c6e('0x3'));var moment=require('moment');var BPromise=require(_0x6c6e('0x4'));var rp=require(_0x6c6e('0x5'));var fs=require('fs');var path=require(_0x6c6e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c6e('0x7'));module[_0x6c6e('0x8')]=function(_0x4d2b66,_0x32c759){return _0x4d2b66['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6c6e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf463=['../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xf463,0x94));var _0x3f46=function(_0x4880be,_0x44da38){_0x4880be=_0x4880be-0x0;var _0x4516b7=_0xf463[_0x4880be];return _0x4516b7;};'use strict';var _=require('lodash');var util=require(_0x3f46('0x0'));var logger=require('../../config/logger')(_0x3f46('0x1'));var moment=require(_0x3f46('0x2'));var BPromise=require(_0x3f46('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f46('0x4'));var rimraf=require(_0x3f46('0x5'));var config=require(_0x3f46('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x3f46('0x7')]=function(_0x2aa42d,_0x3d1c05){return _0x2aa42d['define'](_0x3f46('0x8'),attributes,{'tableName':_0x3f46('0x9'),'paranoid':![],'indexes':[{'name':_0x3f46('0xa'),'fields':[_0x3f46('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 74b27f6..a9010f5 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 _0x815b=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x815b,0xb4));var _0xb815=function(_0x5961de,_0xb2f911){_0x5961de=_0x5961de-0x0;var _0xc960c8=_0x815b[_0x5961de];return _0xc960c8;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var moment=require(_0xb815('0x2'));var BPromise=require(_0xb815('0x3'));var rs=require(_0xb815('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb815('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb815('0x6'));var config=require(_0xb815('0x7'));var jayson=require(_0xb815('0x8'));var client=jayson['client'][_0xb815('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f7a40,_0x4930f6,_0xeba45d){return new BPromise(function(_0x479b09,_0x4d0873){return client[_0xb815('0xa')](_0x3f7a40,_0xeba45d)[_0xb815('0xb')](function(_0x3f8c27){logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));logger[_0xb815('0xf')](_0xb815('0x10'),_0x4930f6,'request\x20sent',JSON[_0xb815('0x11')](_0x3f8c27));if(_0x3f8c27[_0xb815('0x12')]){if(_0x3f8c27[_0xb815('0x12')][_0xb815('0x13')]===0x1f4){logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')]['message']);return _0x4d0873(_0x3f8c27['error'][_0xb815('0x14')]);}logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);return _0x479b09(_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);}else{logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));_0x479b09(_0x3f8c27[_0xb815('0x15')][_0xb815('0x14')]);}})[_0xb815('0x16')](function(_0x52d8dd){logger['error'](_0xb815('0xd'),_0x4930f6,_0x52d8dd);_0x4d0873(_0x52d8dd);});});} \ No newline at end of file +var _0x88d5=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','SmsTransferReport,\x20%s,\x20%s','lodash','util'];(function(_0x828f36,_0x3c0e02){var _0x4c9141=function(_0xd5b013){while(--_0xd5b013){_0x828f36['push'](_0x828f36['shift']());}};_0x4c9141(++_0x3c0e02);}(_0x88d5,0x76));var _0x588d=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x88d5[_0x27beea];return _0x122645;};'use strict';var _=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var moment=require(_0x588d('0x2'));var BPromise=require(_0x588d('0x3'));var rs=require(_0x588d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x588d('0x5'))['db'];var utils=require(_0x588d('0x6'));var logger=require('../../config/logger')(_0x588d('0x7'));var config=require(_0x588d('0x8'));var jayson=require(_0x588d('0x9'));var client=jayson[_0x588d('0xa')][_0x588d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413748,_0x579dca,_0x57699a){return new BPromise(function(_0x41ddf3,_0x141982){return client[_0x588d('0xc')](_0x413748,_0x57699a)[_0x588d('0xd')](function(_0x51c1d3){logger[_0x588d('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'));logger[_0x588d('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'),JSON[_0x588d('0x11')](_0x51c1d3));if(_0x51c1d3[_0x588d('0x12')]){if(_0x51c1d3['error'][_0x588d('0x13')]===0x1f4){logger[_0x588d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);return _0x141982(_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);}logger[_0x588d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x51c1d3['error'][_0x588d('0x14')]);return _0x41ddf3(_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'));_0x41ddf3(_0x51c1d3[_0x588d('0x15')]['message']);}})[_0x588d('0x16')](function(_0x73302d){logger[_0x588d('0x12')](_0x588d('0x17'),_0x579dca,_0x73302d);_0x141982(_0x73302d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 244d3e0..5b6c404 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 _0xfc5c=['originalname','replace','basename','now','file','create','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','/:id/download','join','root'];(function(_0x43d053,_0x3148ba){var _0x30151e=function(_0x1f5553){while(--_0x1f5553){_0x43d053['push'](_0x43d053['shift']());}};_0x30151e(++_0x3148ba);}(_0xfc5c,0x181));var _0xcfc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc5c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcfc5('0x0'));var timeout=require(_0xcfc5('0x1'));var express=require(_0xcfc5('0x2'));var router=express[_0xcfc5('0x3')]();var fs_extra=require(_0xcfc5('0x4'));var auth=require(_0xcfc5('0x5'));var interaction=require(_0xcfc5('0x6'));var config=require('../../config/environment');var controller=require(_0xcfc5('0x7'));router[_0xcfc5('0x8')]('/',auth[_0xcfc5('0x9')](),controller[_0xcfc5('0xa')]);router['get']('/:id',auth[_0xcfc5('0x9')](),controller[_0xcfc5('0xb')]);router[_0xcfc5('0x8')](_0xcfc5('0xc'),auth[_0xcfc5('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a9956,_0x2cbbed,_0x58ea6a){_0x58ea6a(null,path[_0xcfc5('0xd')](config[_0xcfc5('0xe')],'server/files/sounds/original/'));},'filename':function(_0x39f2b3,_0x4b64b9,_0x5d2c65){_0x4b64b9[_0xcfc5('0xf')]=_0x4b64b9[_0xcfc5('0xf')][_0xcfc5('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d2c65(null,util['format']('%s-%s%s',path[_0xcfc5('0x11')](_0x4b64b9[_0xcfc5('0xf')],path['extname'](_0x4b64b9[_0xcfc5('0xf')])),Date[_0xcfc5('0x12')](),path['extname'](_0x4b64b9[_0xcfc5('0xf')])));}})});router['post']('/',upload['single'](_0xcfc5('0x13')),controller[_0xcfc5('0x14')]);router['put'](_0xcfc5('0x15'),auth['isAuthenticated'](),controller[_0xcfc5('0x16')]);router[_0xcfc5('0x17')]('/:id',auth[_0xcfc5('0x9')](),controller[_0xcfc5('0x17')]);module[_0xcfc5('0x18')]=router; \ No newline at end of file +var _0xfffe=['../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','post','single','file','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x4a6901,_0x104c2c){var _0x97c469=function(_0x47c532){while(--_0x47c532){_0x4a6901['push'](_0x4a6901['shift']());}};_0x97c469(++_0x104c2c);}(_0xfffe,0xb4));var _0xefff=function(_0x128ba5,_0x4533c0){_0x128ba5=_0x128ba5-0x0;var _0x2ccfbb=_0xfffe[_0x128ba5];return _0x2ccfbb;};'use strict';var multer=require(_0xefff('0x0'));var util=require(_0xefff('0x1'));var path=require(_0xefff('0x2'));var timeout=require(_0xefff('0x3'));var express=require(_0xefff('0x4'));var router=express[_0xefff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xefff('0x6'));var interaction=require(_0xefff('0x7'));var config=require('../../config/environment');var controller=require(_0xefff('0x8'));router[_0xefff('0x9')]('/',auth[_0xefff('0xa')](),controller[_0xefff('0xb')]);router[_0xefff('0x9')]('/:id',auth[_0xefff('0xa')](),controller[_0xefff('0xc')]);router['get']('/:id/download',auth[_0xefff('0xa')](),controller[_0xefff('0xd')]);var upload=multer({'storage':multer[_0xefff('0xe')]({'destination':function(_0x130a7f,_0x3e43b0,_0x5e2deb){_0x5e2deb(null,path[_0xefff('0xf')](config[_0xefff('0x10')],'server/files/sounds/original/'));},'filename':function(_0x544961,_0x3e507d,_0x20f931){_0x3e507d[_0xefff('0x11')]=_0x3e507d[_0xefff('0x11')][_0xefff('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20f931(null,util[_0xefff('0x13')]('%s-%s%s',path[_0xefff('0x14')](_0x3e507d['originalname'],path['extname'](_0x3e507d[_0xefff('0x11')])),Date[_0xefff('0x15')](),path[_0xefff('0x16')](_0x3e507d[_0xefff('0x11')])));}})});router[_0xefff('0x17')]('/',upload[_0xefff('0x18')](_0xefff('0x19')),controller[_0xefff('0x1a')]);router[_0xefff('0x1b')](_0xefff('0x1c'),auth[_0xefff('0xa')](),controller[_0xefff('0x1d')]);router[_0xefff('0x1e')](_0xefff('0x1c'),auth[_0xefff('0xa')](),controller[_0xefff('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 8bae649..9b841f8 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 _0xb5dd=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0xb4f968,_0x123836){var _0x30008a=function(_0x2a6e26){while(--_0x2a6e26){_0xb4f968['push'](_0xb4f968['shift']());}};_0x30008a(++_0x123836);}(_0xb5dd,0x16d));var _0xdb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdb5d('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb5d('0x1')],'unique':_0xdb5d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xdb5d('0x1')]},'display_name':{'type':Sequelize[_0xdb5d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xdb5d('0x1')]},'original_format':{'type':Sequelize[_0xdb5d('0x1')]},'original_duration':{'type':Sequelize[_0xdb5d('0x3')]},'original_sampleCount':{'type':Sequelize[_0xdb5d('0x4')]},'original_channelCount':{'type':Sequelize[_0xdb5d('0x5')]},'original_bitRate':{'type':Sequelize[_0xdb5d('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xdb5d('0x1')]},'converted_duration':{'type':Sequelize[_0xdb5d('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xdb5d('0x4')]},'converted_channelCount':{'type':Sequelize[_0xdb5d('0x5')]},'converted_bitRate':{'type':Sequelize[_0xdb5d('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xdb5d('0x5')]}}; \ No newline at end of file +var _0x6293=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x3c785a,_0x50965b){var _0x2e8af4=function(_0x4d3ad4){while(--_0x4d3ad4){_0x3c785a['push'](_0x3c785a['shift']());}};_0x2e8af4(++_0x50965b);}(_0x6293,0x1ae));var _0x3629=function(_0x5e6fca,_0x540568){_0x5e6fca=_0x5e6fca-0x0;var _0x505941=_0x6293[_0x5e6fca];return _0x505941;};'use strict';var Sequelize=require(_0x3629('0x0'));module['exports']={'name':{'type':Sequelize[_0x3629('0x1')],'unique':_0x3629('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x3629('0x1')]},'original_format':{'type':Sequelize[_0x3629('0x1')]},'original_duration':{'type':Sequelize[_0x3629('0x3')]},'original_sampleCount':{'type':Sequelize[_0x3629('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x3629('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3629('0x5')]},'converted_format':{'type':Sequelize[_0x3629('0x1')]},'converted_duration':{'type':Sequelize[_0x3629('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x3629('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3629('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 59bc22f..fcaa23a 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 _0x5f6f=['end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Sound','includeAll','include','catch','show','keys','find','params','save_name','join','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','download','root','%s.%s','format','file','originalname','extname','basename','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','create','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status'];(function(_0x236f0a,_0xdda8f1){var _0x1b7512=function(_0xad2e46){while(--_0xad2e46){_0x236f0a['push'](_0x236f0a['shift']());}};_0x1b7512(++_0xdda8f1);}(_0x5f6f,0x1d6));var _0xf5f6=function(_0x239013,_0x4b6af3){_0x239013=_0x239013-0x0;var _0x1f80af=_0x5f6f[_0x239013];return _0x1f80af;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5f6('0x1'));var jsonpatch=require(_0xf5f6('0x2'));var rp=require(_0xf5f6('0x3'));var moment=require(_0xf5f6('0x4'));var BPromise=require(_0xf5f6('0x5'));var Mustache=require('mustache');var util=require(_0xf5f6('0x6'));var path=require(_0xf5f6('0x7'));var sox=require(_0xf5f6('0x8'));var csv=require(_0xf5f6('0x9'));var ejs=require(_0xf5f6('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f6('0xb'));var _=require(_0xf5f6('0xc'));var squel=require(_0xf5f6('0xd'));var crypto=require(_0xf5f6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf5f6('0xf'));var toCsv=require(_0xf5f6('0x9'));var querystring=require(_0xf5f6('0x10'));var Papa=require(_0xf5f6('0x11'));var Redis=require(_0xf5f6('0x12'));var authService=require(_0xf5f6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5f6('0x14'));var logger=require(_0xf5f6('0x15'))(_0xf5f6('0x16'));var utils=require(_0xf5f6('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1911ac,_0x2214c0){_0x2214c0=_0x2214c0||0xcc;return function(_0x3e04c4){if(_0x3e04c4){return _0x1911ac[_0xf5f6('0x18')](_0x2214c0);}return _0x1911ac[_0xf5f6('0x19')](_0x2214c0)[_0xf5f6('0x1a')]();};}function respondWithResult(_0x50d310,_0x2c7b3b){_0x2c7b3b=_0x2c7b3b||0xc8;return function(_0x439101){if(_0x439101){return _0x50d310['status'](_0x2c7b3b)[_0xf5f6('0x1b')](_0x439101);}};}function respondWithFilteredResult(_0x1ce4db,_0x5556e9){return function(_0x5ed2d4){if(_0x5ed2d4){var _0x19cf10=typeof _0x5556e9[_0xf5f6('0x1c')]==='undefined'&&typeof _0x5556e9[_0xf5f6('0x1d')]===_0xf5f6('0x1e');var _0x201805=_0x5ed2d4[_0xf5f6('0x1f')];var _0x2f16f1=_0x19cf10?0x0:_0x5556e9['offset'];var _0x24c35b=_0x19cf10?_0x5ed2d4[_0xf5f6('0x1f')]:_0x5556e9[_0xf5f6('0x1c')]+_0x5556e9[_0xf5f6('0x1d')];var _0xdab42d;if(_0x24c35b>=_0x201805){_0x24c35b=_0x201805;_0xdab42d=0xc8;}else{_0xdab42d=0xce;}_0x1ce4db['status'](_0xdab42d);return _0x1ce4db['set'](_0xf5f6('0x20'),_0x2f16f1+'-'+_0x24c35b+'/'+_0x201805)[_0xf5f6('0x1b')](_0x5ed2d4);}return null;};}function patchUpdates(_0x480532){return function(_0x1586ce){try{jsonpatch[_0xf5f6('0x21')](_0x1586ce,_0x480532,!![]);}catch(_0x199154){return BPromise[_0xf5f6('0x22')](_0x199154);}return _0x1586ce[_0xf5f6('0x23')]();};}function saveUpdates(_0xb6f2a6,_0x3a6c2e){return function(_0x1c6bcf){if(_0x1c6bcf){return _0x1c6bcf[_0xf5f6('0x24')](_0xb6f2a6)[_0xf5f6('0x25')](function(_0x113ec8){return _0x113ec8;});}return null;};}function removeEntity(_0x4cba1a,_0x2ecd5f){return function(_0x3ceedb){if(_0x3ceedb){return _0x3ceedb['destroy']()[_0xf5f6('0x25')](function(){var _0x414d76=_0x3ceedb[_0xf5f6('0x26')]({'plain':!![]});var _0x2d1f62=_0xf5f6('0x27');return db[_0xf5f6('0x28')][_0xf5f6('0x29')]({'where':{'type':_0x2d1f62,'resourceId':_0x414d76['id']}})[_0xf5f6('0x25')](function(){return _0x3ceedb;});})[_0xf5f6('0x25')](function(){_0x4cba1a[_0xf5f6('0x19')](0xcc)[_0xf5f6('0x1a')]();});}};}function handleEntityNotFound(_0x1de7ec,_0x49ed63){return function(_0x43c3ee){if(!_0x43c3ee){_0x1de7ec[_0xf5f6('0x18')](0x194);}return _0x43c3ee;};}function handleError(_0x2f9282,_0x56b9bb){_0x56b9bb=_0x56b9bb||0x1f4;return function(_0x25b0b4){logger[_0xf5f6('0x2a')](_0x25b0b4[_0xf5f6('0x2b')]);if(_0x25b0b4[_0xf5f6('0x2c')]){delete _0x25b0b4[_0xf5f6('0x2c')];}_0x2f9282[_0xf5f6('0x19')](_0x56b9bb)[_0xf5f6('0x2d')](_0x25b0b4);};}exports[_0xf5f6('0x2e')]=function(_0x57dae8,_0x5addfe){var _0x366005={},_0x2549b2={},_0xc5d12f={'count':0x0,'rows':[]};var _0x5a1350=_['map'](db['Sound'][_0xf5f6('0x2f')],function(_0x4232e4){return{'name':_0x4232e4[_0xf5f6('0x30')],'type':_0x4232e4[_0xf5f6('0x31')]['key']};});_0x2549b2[_0xf5f6('0x32')]=_[_0xf5f6('0x33')](_0x5a1350,'name');_0x2549b2[_0xf5f6('0x34')]=_['keys'](_0x57dae8[_0xf5f6('0x34')]);_0x2549b2[_0xf5f6('0x35')]=_[_0xf5f6('0x36')](_0x2549b2[_0xf5f6('0x32')],_0x2549b2['query']);_0x366005[_0xf5f6('0x37')]=_[_0xf5f6('0x36')](_0x2549b2[_0xf5f6('0x32')],qs['fields'](_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x38')]));_0x366005[_0xf5f6('0x37')]=_0x366005[_0xf5f6('0x37')][_0xf5f6('0x39')]?_0x366005[_0xf5f6('0x37')]:_0x2549b2[_0xf5f6('0x32')];if(!_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x3a')](_0xf5f6('0x3b'))){_0x366005[_0xf5f6('0x1d')]=qs[_0xf5f6('0x1d')](_0x57dae8['query']['limit']);_0x366005[_0xf5f6('0x1c')]=qs[_0xf5f6('0x1c')](_0x57dae8[_0xf5f6('0x34')]['offset']);}_0x366005[_0xf5f6('0x3c')]=qs['sort'](_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x3d')]);_0x366005[_0xf5f6('0x3e')]=qs['filters'](_[_0xf5f6('0x3f')](_0x57dae8[_0xf5f6('0x34')],_0x2549b2['filters']),_0x5a1350);if(_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x40')]){_0x366005['where']=_['merge'](_0x366005['where'],{'$or':_['map'](_0x5a1350,function(_0x584069){if(_0x584069[_0xf5f6('0x31')]!==_0xf5f6('0x41')){var _0x2bd634={};_0x2bd634[_0x584069[_0xf5f6('0x2c')]]={'$like':'%'+_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x40')]+'%'};return _0x2bd634;}})});}_0x366005=_[_0xf5f6('0x42')]({},_0x366005,_0x57dae8[_0xf5f6('0x43')]);var _0x439fd5={'where':_0x366005[_0xf5f6('0x3e')]};return db[_0xf5f6('0x44')][_0xf5f6('0x1f')](_0x439fd5)[_0xf5f6('0x25')](function(_0x1c0f41){_0xc5d12f[_0xf5f6('0x1f')]=_0x1c0f41;if(_0x57dae8[_0xf5f6('0x34')][_0xf5f6('0x45')]){_0x366005[_0xf5f6('0x46')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x366005);})['then'](function(_0x17a451){_0xc5d12f['rows']=_0x17a451;return _0xc5d12f;})['then'](respondWithFilteredResult(_0x5addfe,_0x366005))[_0xf5f6('0x47')](handleError(_0x5addfe,null));};exports[_0xf5f6('0x48')]=function(_0x3a18b1,_0x3eab8d){var _0x3f93b4={'raw':!![],'where':{'id':_0x3a18b1['params']['id']}},_0x2b1d27={};_0x2b1d27[_0xf5f6('0x32')]=_[_0xf5f6('0x49')](db[_0xf5f6('0x44')]['rawAttributes']);_0x2b1d27[_0xf5f6('0x34')]=_[_0xf5f6('0x49')](_0x3a18b1[_0xf5f6('0x34')]);_0x2b1d27[_0xf5f6('0x35')]=_[_0xf5f6('0x36')](_0x2b1d27[_0xf5f6('0x32')],_0x2b1d27['query']);_0x3f93b4['attributes']=_['intersection'](_0x2b1d27[_0xf5f6('0x32')],qs[_0xf5f6('0x38')](_0x3a18b1[_0xf5f6('0x34')]['fields']));_0x3f93b4[_0xf5f6('0x37')]=_0x3f93b4[_0xf5f6('0x37')][_0xf5f6('0x39')]?_0x3f93b4[_0xf5f6('0x37')]:_0x2b1d27[_0xf5f6('0x32')];if(_0x3a18b1['query'][_0xf5f6('0x45')]){_0x3f93b4[_0xf5f6('0x46')]=[{'all':!![]}];}_0x3f93b4=_['merge']({},_0x3f93b4,_0x3a18b1[_0xf5f6('0x43')]);return db['Sound'][_0xf5f6('0x4a')](_0x3f93b4)[_0xf5f6('0x25')](handleEntityNotFound(_0x3eab8d,null))[_0xf5f6('0x25')](respondWithResult(_0x3eab8d,null))['catch'](handleError(_0x3eab8d,null));};exports['download']=function(_0x155b3c,_0x20e6ac,_0xcfeab3){return db[_0xf5f6('0x44')]['find']({'where':{'id':_0x155b3c[_0xf5f6('0x4b')]['id']},'attributes':[_0xf5f6('0x2c'),_0xf5f6('0x4c'),'converted_format'],'raw':!![]})[_0xf5f6('0x25')](handleEntityNotFound(_0x20e6ac,null))[_0xf5f6('0x25')](function(_0x57d1b1){if(_0x57d1b1){if(!fs['existsSync'](path[_0xf5f6('0x4d')](config['root'],_0xf5f6('0x4e'),_0x57d1b1['save_name']+'.'+_0x57d1b1[_0xf5f6('0x4f')]))){throw new db['Sequelize'][(_0xf5f6('0x50'))](_0xf5f6('0x51'));}return _0x20e6ac[_0xf5f6('0x52')](path[_0xf5f6('0x4d')](config[_0xf5f6('0x53')],_0xf5f6('0x4e'),util['format'](_0xf5f6('0x54'),_0x57d1b1['save_name'],_0x57d1b1[_0xf5f6('0x4f')])),util[_0xf5f6('0x55')]('%s.%s',_0x57d1b1[_0xf5f6('0x2c')],_0x57d1b1['converted_format']));}return null;})['catch'](handleError(_0x20e6ac,null));};exports['create']=function(_0x4210f3,_0x1965a6,_0x1ecfca){var _0x44a88b={'name':path['basename'](_0x4210f3[_0xf5f6('0x56')][_0xf5f6('0x57')],path[_0xf5f6('0x58')](_0x4210f3[_0xf5f6('0x56')][_0xf5f6('0x57')])),'save_name':path[_0xf5f6('0x59')](_0x4210f3['file'][_0xf5f6('0x5a')],path[_0xf5f6('0x58')](_0x4210f3[_0xf5f6('0x56')][_0xf5f6('0x5a')])),'original_format':path[_0xf5f6('0x58')](_0x4210f3['file'][_0xf5f6('0x57')])['substring'](0x1),'converted_format':'wav'};var _0x7b9e46=path[_0xf5f6('0x4d')](config['root'],_0xf5f6('0x5b'),_0x4210f3[_0xf5f6('0x56')][_0xf5f6('0x5a')]);var _0x4ef088=path[_0xf5f6('0x4d')](config[_0xf5f6('0x53')],_0xf5f6('0x4e'),util[_0xf5f6('0x55')](_0xf5f6('0x54'),path[_0xf5f6('0x59')](_0x4210f3['file'][_0xf5f6('0x5a')],path['extname'](_0x4210f3[_0xf5f6('0x56')][_0xf5f6('0x5a')])),_0x44a88b['converted_format']));logger[_0xf5f6('0x5c')](_0xf5f6('0x5d'),_0x7b9e46);logger[_0xf5f6('0x5c')](_0xf5f6('0x5e'),_0x4ef088);try{fs[_0xf5f6('0x5f')](_0x7b9e46,parseInt(_0xf5f6('0x60'),0x8));var _0x2cfb0f=sox[_0xf5f6('0x61')](_0x7b9e46,_0x4ef088,{'sampleRate':0x1f40,'format':_0xf5f6('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2cfb0f['on'](_0xf5f6('0x2a'),function(_0x223a67){fs[_0xf5f6('0x63')](_0x7b9e46);_0x1965a6[_0xf5f6('0x19')](0x1f4)['send'](_0x223a67);});_0x2cfb0f['on'](_0xf5f6('0x64'),function(_0x54166d){_0x44a88b[_0xf5f6('0x65')]=isNaN(_0x54166d[_0xf5f6('0x66')])?null:_0x54166d[_0xf5f6('0x66')]*0x3e8;_0x44a88b['original_sampleCount']=isNaN(_0x54166d[_0xf5f6('0x67')])?null:_0x54166d[_0xf5f6('0x67')];_0x44a88b['original_channelCount']=isNaN(_0x54166d[_0xf5f6('0x68')])?null:_0x54166d[_0xf5f6('0x68')];_0x44a88b[_0xf5f6('0x69')]=isNaN(_0x54166d['bitRate'])?null:_0x54166d[_0xf5f6('0x6a')];_0x44a88b[_0xf5f6('0x6b')]=isNaN(_0x54166d[_0xf5f6('0x6c')])?null:_0x54166d[_0xf5f6('0x6c')];});_0x2cfb0f['on']('dest',function(_0x12434a){_0x44a88b[_0xf5f6('0x6d')]=isNaN(_0x12434a['duration'])?null:_0x12434a[_0xf5f6('0x66')]*0x3e8;_0x44a88b[_0xf5f6('0x6e')]=isNaN(_0x12434a[_0xf5f6('0x67')])?null:_0x12434a['sampleCount'];_0x44a88b[_0xf5f6('0x6f')]=isNaN(_0x12434a[_0xf5f6('0x68')])?null:_0x12434a[_0xf5f6('0x68')];_0x44a88b[_0xf5f6('0x70')]=isNaN(_0x12434a[_0xf5f6('0x6a')])?null:_0x12434a['bitRate'];_0x44a88b['converted_sampleRate']=isNaN(_0x12434a['sampleRate'])?null:_0x12434a[_0xf5f6('0x6c')];});_0x2cfb0f['on'](_0xf5f6('0x1a'),function(){fs['chmodSync'](_0x4ef088,parseInt(_0xf5f6('0x60'),0x8));return db[_0xf5f6('0x44')][_0xf5f6('0x71')](_0x44a88b)[_0xf5f6('0x25')](function(_0x25ffa8){var _0x249238={'role':_0x4210f3['body'][_0xf5f6('0x72')],'userProfileId':_0x4210f3['body'][_0xf5f6('0x73')]};if(!_0x249238)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x249238[_0xf5f6('0x72')]===_0xf5f6('0x74')){var _0x4954f9=_0x25ffa8['get']({'plain':!![]});return db[_0xf5f6('0x75')][_0xf5f6('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x249238[_0xf5f6('0x73')]},'raw':!![]})['then'](function(_0xa9fdd8){if(_0xa9fdd8&&_0xa9fdd8[_0xf5f6('0x76')]===0x0){return db[_0xf5f6('0x28')][_0xf5f6('0x71')]({'name':_0x4954f9[_0xf5f6('0x2c')],'resourceId':_0x4954f9['id'],'type':_0xa9fdd8['name'],'sectionId':_0xa9fdd8['id']},{})[_0xf5f6('0x25')](function(){return _0x25ffa8;});}else{return _0x25ffa8;}})[_0xf5f6('0x47')](function(_0x2d3d6b){logger['error'](_0xf5f6('0x77'),_0x2d3d6b);throw _0x2d3d6b;});}return _0x25ffa8;})[_0xf5f6('0x25')](respondWithResult(_0x1965a6,null))[_0xf5f6('0x47')](handleError(_0x1965a6,null));});_0x2cfb0f['start']();}catch(_0x130789){_0x1965a6[_0xf5f6('0x19')](0x1f4)[_0xf5f6('0x2d')](_0x130789);}};exports[_0xf5f6('0x24')]=function(_0x2b40a5,_0x45a146,_0x326069){return db[_0xf5f6('0x44')]['find']({'where':{'id':_0x2b40a5[_0xf5f6('0x4b')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x45a146,null))[_0xf5f6('0x25')](saveUpdates(_[_0xf5f6('0x3f')](_0x2b40a5[_0xf5f6('0x78')],[_0xf5f6('0x2c'),_0xf5f6('0x79')]),null))[_0xf5f6('0x25')](respondWithResult(_0x45a146,null))[_0xf5f6('0x47')](handleError(_0x45a146,null));};exports[_0xf5f6('0x7a')]=function(_0x42f8d9,_0x315cd9,_0x3db681){return db[_0xf5f6('0x44')][_0xf5f6('0x4a')]({'where':{'id':_0x42f8d9[_0xf5f6('0x4b')]['id']}})[_0xf5f6('0x25')](function(_0x5e2a45){if(_0x5e2a45){return _0x5e2a45[_0xf5f6('0x29')]();}})[_0xf5f6('0x25')](function(_0x4db926){var _0x192632=path['join'](config['root'],_0xf5f6('0x5b'),util['format']('%s.%s',_0x4db926[_0xf5f6('0x4c')],_0x4db926[_0xf5f6('0x7b')]));var _0x9c929e=path['join'](config[_0xf5f6('0x53')],_0xf5f6('0x4e'),util['format']('%s.%s',_0x4db926[_0xf5f6('0x4c')],_0x4db926[_0xf5f6('0x4f')]));fs[_0xf5f6('0x63')](_0x192632);fs[_0xf5f6('0x63')](_0x9c929e);return _0x4db926;})[_0xf5f6('0x25')](function(_0x371033){if(_0x371033){return _0x315cd9['status'](0xcc)[_0xf5f6('0x1a')]();}})[_0xf5f6('0x25')](handleEntityNotFound(_0x315cd9,null))['catch'](handleError(_0x315cd9,null));}; \ No newline at end of file +var _0x0bf1=['save','update','then','destroy','Sounds','UserProfileResource','error','send','index','map','Sound','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','rawAttributes','find','save_name','converted_format','existsSync','root','server/files/sounds/converted','download','%s.%s','format','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','join','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0xb0444e,_0x3da35a){var _0x363b43=function(_0x1b3e68){while(--_0x1b3e68){_0xb0444e['push'](_0xb0444e['shift']());}};_0x363b43(++_0x3da35a);}(_0x0bf1,0x1d0));var _0x10bf=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0bf1[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x10bf('0x0'));var rimraf=require(_0x10bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10bf('0x2'));var rp=require('request-promise');var moment=require(_0x10bf('0x3'));var BPromise=require(_0x10bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x10bf('0x5'));var csv=require(_0x10bf('0x6'));var ejs=require(_0x10bf('0x7'));var fs=require('fs');var fs_extra=require(_0x10bf('0x8'));var _=require(_0x10bf('0x9'));var squel=require(_0x10bf('0xa'));var crypto=require('crypto');var jsforce=require(_0x10bf('0xb'));var deskjs=require(_0x10bf('0xc'));var toCsv=require(_0x10bf('0x6'));var querystring=require(_0x10bf('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10bf('0xe'));var qs=require(_0x10bf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10bf('0x10'));var logger=require(_0x10bf('0x11'))('api');var utils=require(_0x10bf('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x10bf('0x13'));var db=require(_0x10bf('0x14'))['db'];function respondWithStatusCode(_0xef7465,_0x52b07f){_0x52b07f=_0x52b07f||0xcc;return function(_0x21f31f){if(_0x21f31f){return _0xef7465[_0x10bf('0x15')](_0x52b07f);}return _0xef7465[_0x10bf('0x16')](_0x52b07f)[_0x10bf('0x17')]();};}function respondWithResult(_0x21995a,_0x25c815){_0x25c815=_0x25c815||0xc8;return function(_0x141ab5){if(_0x141ab5){return _0x21995a[_0x10bf('0x16')](_0x25c815)[_0x10bf('0x18')](_0x141ab5);}};}function respondWithFilteredResult(_0x2b8aa9,_0x100dda){return function(_0x3ea4d9){if(_0x3ea4d9){var _0x226e00=typeof _0x100dda[_0x10bf('0x19')]===_0x10bf('0x1a')&&typeof _0x100dda[_0x10bf('0x1b')]==='undefined';var _0x40c60f=_0x3ea4d9['count'];var _0xe730b9=_0x226e00?0x0:_0x100dda[_0x10bf('0x19')];var _0x3cecca=_0x226e00?_0x3ea4d9[_0x10bf('0x1c')]:_0x100dda[_0x10bf('0x19')]+_0x100dda[_0x10bf('0x1b')];var _0x4dbc9d;if(_0x3cecca>=_0x40c60f){_0x3cecca=_0x40c60f;_0x4dbc9d=0xc8;}else{_0x4dbc9d=0xce;}_0x2b8aa9['status'](_0x4dbc9d);return _0x2b8aa9[_0x10bf('0x1d')](_0x10bf('0x1e'),_0xe730b9+'-'+_0x3cecca+'/'+_0x40c60f)['json'](_0x3ea4d9);}return null;};}function patchUpdates(_0x5c1adb){return function(_0x4b378d){try{jsonpatch['apply'](_0x4b378d,_0x5c1adb,!![]);}catch(_0x4f666a){return BPromise[_0x10bf('0x1f')](_0x4f666a);}return _0x4b378d[_0x10bf('0x20')]();};}function saveUpdates(_0x54279d,_0x315096){return function(_0x536243){if(_0x536243){return _0x536243[_0x10bf('0x21')](_0x54279d)[_0x10bf('0x22')](function(_0x1c4ce5){return _0x1c4ce5;});}return null;};}function removeEntity(_0x1cf312,_0x4f8d89){return function(_0x1efc08){if(_0x1efc08){return _0x1efc08[_0x10bf('0x23')]()[_0x10bf('0x22')](function(){var _0xb98576=_0x1efc08['get']({'plain':!![]});var _0x3159c3=_0x10bf('0x24');return db[_0x10bf('0x25')][_0x10bf('0x23')]({'where':{'type':_0x3159c3,'resourceId':_0xb98576['id']}})[_0x10bf('0x22')](function(){return _0x1efc08;});})[_0x10bf('0x22')](function(){_0x1cf312['status'](0xcc)[_0x10bf('0x17')]();});}};}function handleEntityNotFound(_0x38ef58,_0x1c0322){return function(_0x33c787){if(!_0x33c787){_0x38ef58[_0x10bf('0x15')](0x194);}return _0x33c787;};}function handleError(_0x594c4d,_0x1a56c3){_0x1a56c3=_0x1a56c3||0x1f4;return function(_0x21d50f){logger[_0x10bf('0x26')](_0x21d50f['stack']);if(_0x21d50f['name']){delete _0x21d50f['name'];}_0x594c4d[_0x10bf('0x16')](_0x1a56c3)[_0x10bf('0x27')](_0x21d50f);};}exports[_0x10bf('0x28')]=function(_0xd40365,_0x497298){var _0x501786={},_0x3f1440={},_0x1c90fb={'count':0x0,'rows':[]};var _0x56a8ce=_[_0x10bf('0x29')](db[_0x10bf('0x2a')]['rawAttributes'],function(_0x39825d){return{'name':_0x39825d[_0x10bf('0x2b')],'type':_0x39825d[_0x10bf('0x2c')][_0x10bf('0x2d')]};});_0x3f1440['model']=_[_0x10bf('0x29')](_0x56a8ce,'name');_0x3f1440[_0x10bf('0x2e')]=_[_0x10bf('0x2f')](_0xd40365[_0x10bf('0x2e')]);_0x3f1440[_0x10bf('0x30')]=_['intersection'](_0x3f1440[_0x10bf('0x31')],_0x3f1440[_0x10bf('0x2e')]);_0x501786[_0x10bf('0x32')]=_[_0x10bf('0x33')](_0x3f1440['model'],qs[_0x10bf('0x34')](_0xd40365['query'][_0x10bf('0x34')]));_0x501786[_0x10bf('0x32')]=_0x501786[_0x10bf('0x32')][_0x10bf('0x35')]?_0x501786[_0x10bf('0x32')]:_0x3f1440[_0x10bf('0x31')];if(!_0xd40365['query'][_0x10bf('0x36')](_0x10bf('0x37'))){_0x501786['limit']=qs[_0x10bf('0x1b')](_0xd40365[_0x10bf('0x2e')]['limit']);_0x501786['offset']=qs[_0x10bf('0x19')](_0xd40365[_0x10bf('0x2e')]['offset']);}_0x501786[_0x10bf('0x38')]=qs[_0x10bf('0x39')](_0xd40365[_0x10bf('0x2e')]['sort']);_0x501786[_0x10bf('0x3a')]=qs[_0x10bf('0x30')](_[_0x10bf('0x3b')](_0xd40365[_0x10bf('0x2e')],_0x3f1440[_0x10bf('0x30')]),_0x56a8ce);if(_0xd40365[_0x10bf('0x2e')][_0x10bf('0x3c')]){_0x501786[_0x10bf('0x3a')]=_[_0x10bf('0x3d')](_0x501786[_0x10bf('0x3a')],{'$or':_[_0x10bf('0x29')](_0x56a8ce,function(_0x25b97c){if(_0x25b97c[_0x10bf('0x2c')]!==_0x10bf('0x3e')){var _0x1b5b07={};_0x1b5b07[_0x25b97c[_0x10bf('0x3f')]]={'$like':'%'+_0xd40365[_0x10bf('0x2e')][_0x10bf('0x3c')]+'%'};return _0x1b5b07;}})});}_0x501786=_['merge']({},_0x501786,_0xd40365[_0x10bf('0x40')]);var _0x45205a={'where':_0x501786[_0x10bf('0x3a')]};return db[_0x10bf('0x2a')][_0x10bf('0x1c')](_0x45205a)[_0x10bf('0x22')](function(_0x8458e3){_0x1c90fb[_0x10bf('0x1c')]=_0x8458e3;if(_0xd40365['query'][_0x10bf('0x41')]){_0x501786[_0x10bf('0x42')]=[{'all':!![]}];}return db[_0x10bf('0x2a')]['findAll'](_0x501786);})[_0x10bf('0x22')](function(_0x56761c){_0x1c90fb[_0x10bf('0x43')]=_0x56761c;return _0x1c90fb;})['then'](respondWithFilteredResult(_0x497298,_0x501786))[_0x10bf('0x44')](handleError(_0x497298,null));};exports[_0x10bf('0x45')]=function(_0x143a49,_0x1be988){var _0x5773fd={'raw':!![],'where':{'id':_0x143a49[_0x10bf('0x46')]['id']}},_0x2b5a9c={};_0x2b5a9c[_0x10bf('0x31')]=_[_0x10bf('0x2f')](db[_0x10bf('0x2a')][_0x10bf('0x47')]);_0x2b5a9c[_0x10bf('0x2e')]=_[_0x10bf('0x2f')](_0x143a49['query']);_0x2b5a9c[_0x10bf('0x30')]=_[_0x10bf('0x33')](_0x2b5a9c[_0x10bf('0x31')],_0x2b5a9c[_0x10bf('0x2e')]);_0x5773fd[_0x10bf('0x32')]=_[_0x10bf('0x33')](_0x2b5a9c[_0x10bf('0x31')],qs['fields'](_0x143a49['query'][_0x10bf('0x34')]));_0x5773fd[_0x10bf('0x32')]=_0x5773fd[_0x10bf('0x32')][_0x10bf('0x35')]?_0x5773fd[_0x10bf('0x32')]:_0x2b5a9c[_0x10bf('0x31')];if(_0x143a49['query'][_0x10bf('0x41')]){_0x5773fd[_0x10bf('0x42')]=[{'all':!![]}];}_0x5773fd=_[_0x10bf('0x3d')]({},_0x5773fd,_0x143a49['options']);return db[_0x10bf('0x2a')][_0x10bf('0x48')](_0x5773fd)[_0x10bf('0x22')](handleEntityNotFound(_0x1be988,null))[_0x10bf('0x22')](respondWithResult(_0x1be988,null))[_0x10bf('0x44')](handleError(_0x1be988,null));};exports['download']=function(_0x50626f,_0x41c8bb,_0x42131f){return db[_0x10bf('0x2a')][_0x10bf('0x48')]({'where':{'id':_0x50626f['params']['id']},'attributes':['name',_0x10bf('0x49'),_0x10bf('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x41c8bb,null))[_0x10bf('0x22')](function(_0x13e934){if(_0x13e934){if(!fs[_0x10bf('0x4b')](path['join'](config[_0x10bf('0x4c')],_0x10bf('0x4d'),_0x13e934[_0x10bf('0x49')]+'.'+_0x13e934[_0x10bf('0x4a')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x41c8bb[_0x10bf('0x4e')](path['join'](config[_0x10bf('0x4c')],_0x10bf('0x4d'),util['format'](_0x10bf('0x4f'),_0x13e934[_0x10bf('0x49')],_0x13e934[_0x10bf('0x4a')])),util[_0x10bf('0x50')]('%s.%s',_0x13e934[_0x10bf('0x3f')],_0x13e934[_0x10bf('0x4a')]));}return null;})['catch'](handleError(_0x41c8bb,null));};exports['create']=function(_0x3a2615,_0x2c705b,_0x301fa0){var _0x5bcc76={'name':path[_0x10bf('0x51')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x53')],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x53')])),'save_name':path[_0x10bf('0x51')](_0x3a2615['file']['filename'],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')])),'original_format':path['extname'](_0x3a2615[_0x10bf('0x52')]['originalname'])[_0x10bf('0x56')](0x1),'converted_format':_0x10bf('0x57')};var _0x6a5382=path['join'](config[_0x10bf('0x4c')],_0x10bf('0x58'),_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')]);var _0x3dc390=path[_0x10bf('0x59')](config[_0x10bf('0x4c')],_0x10bf('0x4d'),util[_0x10bf('0x50')](_0x10bf('0x4f'),path[_0x10bf('0x51')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')]['filename'])),_0x5bcc76[_0x10bf('0x4a')]));logger[_0x10bf('0x5a')](_0x10bf('0x5b'),_0x6a5382);logger[_0x10bf('0x5a')](_0x10bf('0x5c'),_0x3dc390);try{fs[_0x10bf('0x5d')](_0x6a5382,parseInt('0777',0x8));var _0x3a25b3=sox[_0x10bf('0x5e')](_0x6a5382,_0x3dc390,{'sampleRate':0x1f40,'format':_0x10bf('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a25b3['on'](_0x10bf('0x26'),function(_0x4ff09d){fs[_0x10bf('0x5f')](_0x6a5382);_0x2c705b['status'](0x1f4)[_0x10bf('0x27')](_0x4ff09d);});_0x3a25b3['on'](_0x10bf('0x60'),function(_0x395e3a){_0x5bcc76['original_duration']=isNaN(_0x395e3a['duration'])?null:_0x395e3a[_0x10bf('0x61')]*0x3e8;_0x5bcc76[_0x10bf('0x62')]=isNaN(_0x395e3a[_0x10bf('0x63')])?null:_0x395e3a[_0x10bf('0x63')];_0x5bcc76[_0x10bf('0x64')]=isNaN(_0x395e3a['channelCount'])?null:_0x395e3a[_0x10bf('0x65')];_0x5bcc76['original_bitRate']=isNaN(_0x395e3a[_0x10bf('0x66')])?null:_0x395e3a['bitRate'];_0x5bcc76[_0x10bf('0x67')]=isNaN(_0x395e3a[_0x10bf('0x68')])?null:_0x395e3a['sampleRate'];});_0x3a25b3['on'](_0x10bf('0x69'),function(_0x2ecf82){_0x5bcc76[_0x10bf('0x6a')]=isNaN(_0x2ecf82[_0x10bf('0x61')])?null:_0x2ecf82[_0x10bf('0x61')]*0x3e8;_0x5bcc76[_0x10bf('0x6b')]=isNaN(_0x2ecf82[_0x10bf('0x63')])?null:_0x2ecf82[_0x10bf('0x63')];_0x5bcc76[_0x10bf('0x6c')]=isNaN(_0x2ecf82[_0x10bf('0x65')])?null:_0x2ecf82['channelCount'];_0x5bcc76[_0x10bf('0x6d')]=isNaN(_0x2ecf82['bitRate'])?null:_0x2ecf82['bitRate'];_0x5bcc76[_0x10bf('0x6e')]=isNaN(_0x2ecf82[_0x10bf('0x68')])?null:_0x2ecf82['sampleRate'];});_0x3a25b3['on'](_0x10bf('0x17'),function(){fs[_0x10bf('0x5d')](_0x3dc390,parseInt('0777',0x8));return db[_0x10bf('0x2a')][_0x10bf('0x6f')](_0x5bcc76)['then'](function(_0x2c88ee){var _0x2a51ac={'role':_0x3a2615[_0x10bf('0x70')]['role'],'userProfileId':_0x3a2615[_0x10bf('0x70')][_0x10bf('0x71')]};if(!_0x2a51ac)throw new Error(_0x10bf('0x72'));if(_0x2a51ac['role']===_0x10bf('0x73')){var _0x509a45=_0x2c88ee[_0x10bf('0x74')]({'plain':!![]});return db[_0x10bf('0x75')][_0x10bf('0x48')]({'where':{'name':_0x10bf('0x24'),'userProfileId':_0x2a51ac[_0x10bf('0x71')]},'raw':!![]})['then'](function(_0x2e442e){if(_0x2e442e&&_0x2e442e[_0x10bf('0x76')]===0x0){return db[_0x10bf('0x25')][_0x10bf('0x6f')]({'name':_0x509a45[_0x10bf('0x3f')],'resourceId':_0x509a45['id'],'type':_0x2e442e[_0x10bf('0x3f')],'sectionId':_0x2e442e['id']},{})[_0x10bf('0x22')](function(){return _0x2c88ee;});}else{return _0x2c88ee;}})[_0x10bf('0x44')](function(_0x417a37){logger[_0x10bf('0x26')](_0x10bf('0x77'),_0x417a37);throw _0x417a37;});}return _0x2c88ee;})['then'](respondWithResult(_0x2c705b,null))[_0x10bf('0x44')](handleError(_0x2c705b,null));});_0x3a25b3[_0x10bf('0x78')]();}catch(_0x1cadd5){_0x2c705b[_0x10bf('0x16')](0x1f4)[_0x10bf('0x27')](_0x1cadd5);}};exports[_0x10bf('0x21')]=function(_0x5b0915,_0x2aa256,_0x195803){return db[_0x10bf('0x2a')]['find']({'where':{'id':_0x5b0915[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x2aa256,null))[_0x10bf('0x22')](saveUpdates(_['pick'](_0x5b0915[_0x10bf('0x70')],[_0x10bf('0x3f'),_0x10bf('0x79')]),null))['then'](respondWithResult(_0x2aa256,null))[_0x10bf('0x44')](handleError(_0x2aa256,null));};exports[_0x10bf('0x7a')]=function(_0x534e10,_0xa2ca30,_0x87280b){return db['Sound'][_0x10bf('0x48')]({'where':{'id':_0x534e10['params']['id']}})[_0x10bf('0x22')](function(_0x1daa7f){if(_0x1daa7f){return _0x1daa7f[_0x10bf('0x23')]();}})[_0x10bf('0x22')](function(_0x7bcde7){var _0xfcff26=path['join'](config[_0x10bf('0x4c')],_0x10bf('0x58'),util[_0x10bf('0x50')](_0x10bf('0x4f'),_0x7bcde7[_0x10bf('0x49')],_0x7bcde7[_0x10bf('0x7b')]));var _0xaeb2f1=path[_0x10bf('0x59')](config['root'],_0x10bf('0x4d'),util[_0x10bf('0x50')](_0x10bf('0x4f'),_0x7bcde7[_0x10bf('0x49')],_0x7bcde7[_0x10bf('0x4a')]));fs[_0x10bf('0x5f')](_0xfcff26);fs[_0x10bf('0x5f')](_0xaeb2f1);return _0x7bcde7;})[_0x10bf('0x22')](function(_0x8c128e){if(_0x8c128e){return _0xa2ca30[_0x10bf('0x16')](0xcc)[_0x10bf('0x17')]();}})['then'](handleEntityNotFound(_0xa2ca30,null))[_0x10bf('0x44')](handleError(_0xa2ca30,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f59548c..12e9dff 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 _0x677e=['util','../../config/logger','api','moment','bluebird','request-promise','./sound.attributes','exports','define','tools_sounds','lodash'];(function(_0x376da1,_0x1f6ef0){var _0x23e2ac=function(_0x574820){while(--_0x574820){_0x376da1['push'](_0x376da1['shift']());}};_0x23e2ac(++_0x1f6ef0);}(_0x677e,0x107));var _0xe677=function(_0x1caf4f,_0xd0b32d){_0x1caf4f=_0x1caf4f-0x0;var _0x11b9e2=_0x677e[_0x1caf4f];return _0x11b9e2;};'use strict';var _=require(_0xe677('0x0'));var util=require(_0xe677('0x1'));var logger=require(_0xe677('0x2'))(_0xe677('0x3'));var moment=require(_0xe677('0x4'));var BPromise=require(_0xe677('0x5'));var rp=require(_0xe677('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe677('0x7'));module[_0xe677('0x8')]=function(_0x27efe7,_0x45db47){return _0x27efe7[_0xe677('0x9')]('Sound',attributes,{'tableName':_0xe677('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe35=['moment','request-promise','path','exports','define','Sound','tools_sounds','lodash','util','api'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xfe35,0x1dd));var _0x5fe3=function(_0x400d9b,_0x2782c1){_0x400d9b=_0x400d9b-0x0;var _0x5bf8d7=_0xfe35[_0x400d9b];return _0x5bf8d7;};'use strict';var _=require(_0x5fe3('0x0'));var util=require(_0x5fe3('0x1'));var logger=require('../../config/logger')(_0x5fe3('0x2'));var moment=require(_0x5fe3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fe3('0x4'));var fs=require('fs');var path=require(_0x5fe3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x5fe3('0x6')]=function(_0x23fc82,_0x120b91){return _0x23fc82[_0x5fe3('0x7')](_0x5fe3('0x8'),attributes,{'tableName':_0x5fe3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 5b24381..0bc5b7a 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 _0x28fd=['../../config/logger','rpc','jayson/promise','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSound','Sound','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x28fd,0xb4));var _0xd28f=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x28fd[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xd28f('0x0'));var util=require('util');var moment=require(_0xd28f('0x1'));var BPromise=require(_0xd28f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd28f('0x3'));var db=require(_0xd28f('0x4'))['db'];var utils=require(_0xd28f('0x5'));var logger=require(_0xd28f('0x6'))(_0xd28f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd28f('0x8'));var client=jayson['client'][_0xd28f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf636fc,_0x192752,_0x4b010b){return new BPromise(function(_0x481546,_0xb2a67f){return client[_0xd28f('0xa')](_0xf636fc,_0x4b010b)[_0xd28f('0xb')](function(_0x4217cc){logger['info'](_0xd28f('0xc'),_0x192752,_0xd28f('0xd'));logger[_0xd28f('0xe')](_0xd28f('0xf'),_0x192752,_0xd28f('0xd'),JSON[_0xd28f('0x10')](_0x4217cc));if(_0x4217cc[_0xd28f('0x11')]){if(_0x4217cc[_0xd28f('0x11')]['code']===0x1f4){logger[_0xd28f('0x11')]('Sound,\x20%s,\x20%s',_0x192752,_0x4217cc[_0xd28f('0x11')][_0xd28f('0x12')]);return _0xb2a67f(_0x4217cc[_0xd28f('0x11')][_0xd28f('0x12')]);}logger['error'](_0xd28f('0xc'),_0x192752,_0x4217cc[_0xd28f('0x11')]['message']);return _0x481546(_0x4217cc[_0xd28f('0x11')][_0xd28f('0x12')]);}else{logger[_0xd28f('0x13')](_0xd28f('0xc'),_0x192752,_0xd28f('0xd'));_0x481546(_0x4217cc[_0xd28f('0x14')][_0xd28f('0x12')]);}})['catch'](function(_0x45885f){logger[_0xd28f('0x11')](_0xd28f('0xc'),_0x192752,_0x45885f);_0xb2a67f(_0x45885f);});});}exports[_0xd28f('0x15')]=function(_0x156048){var _0x333678=this;return new Promise(function(_0x3a9e69,_0x2e168d){return db[_0xd28f('0x16')]['find']({'raw':_0x156048[_0xd28f('0x17')]?_0x156048[_0xd28f('0x17')][_0xd28f('0x18')]===undefined?!![]:![]:!![],'where':_0x156048[_0xd28f('0x17')]?_0x156048['options'][_0xd28f('0x19')]||null:null,'attributes':_0x156048['options']?_0x156048[_0xd28f('0x17')][_0xd28f('0x1a')]||null:null,'include':_0x156048[_0xd28f('0x17')]?_0x156048[_0xd28f('0x17')][_0xd28f('0x1b')]?_[_0xd28f('0x1c')](_0x156048['options'][_0xd28f('0x1b')],function(_0x4385df){return{'model':db[_0x4385df[_0xd28f('0x1d')]],'as':_0x4385df['as'],'attributes':_0x4385df['attributes'],'include':_0x4385df['include']?_[_0xd28f('0x1c')](_0x4385df[_0xd28f('0x1b')],function(_0x748c59){return{'model':db[_0x748c59['model']],'as':_0x748c59['as'],'attributes':_0x748c59['attributes'],'include':_0x748c59[_0xd28f('0x1b')]?_['map'](_0x748c59[_0xd28f('0x1b')],function(_0x19b4bd){return{'model':db[_0x19b4bd['model']],'as':_0x19b4bd['as'],'attributes':_0x19b4bd[_0xd28f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd28f('0xb')](function(_0xf43a19){logger[_0xd28f('0x13')]('ShowSound',_0x156048);logger[_0xd28f('0xe')]('ShowSound',_0x156048,JSON['stringify'](_0xf43a19));_0x3a9e69(_0xf43a19);})[_0xd28f('0x1e')](function(_0x7519fe){logger['error'](_0xd28f('0x15'),_0x7519fe[_0xd28f('0x12')],_0x156048);_0x2e168d(_0x333678[_0xd28f('0x11')](0x1f4,_0x7519fe[_0xd28f('0x12')]));});});}; \ No newline at end of file +var _0x838c=['find','options','raw','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','Sound'];(function(_0x2b5318,_0x1dcff0){var _0x16e75b=function(_0xbe8e45){while(--_0xbe8e45){_0x2b5318['push'](_0x2b5318['shift']());}};_0x16e75b(++_0x1dcff0);}(_0x838c,0x64));var _0xc838=function(_0x5a0549,_0x4fedd6){_0x5a0549=_0x5a0549-0x0;var _0x424f3a=_0x838c[_0x5a0549];return _0x424f3a;};'use strict';var _=require(_0xc838('0x0'));var util=require(_0xc838('0x1'));var moment=require(_0xc838('0x2'));var BPromise=require('bluebird');var rs=require(_0xc838('0x3'));var fs=require('fs');var Redis=require(_0xc838('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc838('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc838('0x6'));var jayson=require(_0xc838('0x7'));var client=jayson[_0xc838('0x8')][_0xc838('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fbcbc,_0x3635a8,_0xdad79c){return new BPromise(function(_0x4be78d,_0x4e4f71){return client[_0xc838('0xa')](_0x2fbcbc,_0xdad79c)[_0xc838('0xb')](function(_0x407e8d){logger[_0xc838('0xc')](_0xc838('0xd'),_0x3635a8,_0xc838('0xe'));logger[_0xc838('0xf')](_0xc838('0x10'),_0x3635a8,_0xc838('0xe'),JSON[_0xc838('0x11')](_0x407e8d));if(_0x407e8d[_0xc838('0x12')]){if(_0x407e8d[_0xc838('0x12')]['code']===0x1f4){logger[_0xc838('0x12')](_0xc838('0xd'),_0x3635a8,_0x407e8d['error'][_0xc838('0x13')]);return _0x4e4f71(_0x407e8d['error'][_0xc838('0x13')]);}logger[_0xc838('0x12')](_0xc838('0xd'),_0x3635a8,_0x407e8d['error'][_0xc838('0x13')]);return _0x4be78d(_0x407e8d[_0xc838('0x12')][_0xc838('0x13')]);}else{logger[_0xc838('0xc')](_0xc838('0xd'),_0x3635a8,_0xc838('0xe'));_0x4be78d(_0x407e8d[_0xc838('0x14')]['message']);}})[_0xc838('0x15')](function(_0x25fe5f){logger['error']('Sound,\x20%s,\x20%s',_0x3635a8,_0x25fe5f);_0x4e4f71(_0x25fe5f);});});}exports[_0xc838('0x16')]=function(_0x493dcc){var _0x4df3f0=this;return new Promise(function(_0x530d55,_0x11be9f){return db[_0xc838('0x17')][_0xc838('0x18')]({'raw':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1a')]===undefined?!![]:![]:!![],'where':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')]['where']||null:null,'attributes':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1b')]||null:null,'include':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1c')]?_[_0xc838('0x1d')](_0x493dcc['options'][_0xc838('0x1c')],function(_0x4a1eb3){return{'model':db[_0x4a1eb3['model']],'as':_0x4a1eb3['as'],'attributes':_0x4a1eb3[_0xc838('0x1b')],'include':_0x4a1eb3[_0xc838('0x1c')]?_[_0xc838('0x1d')](_0x4a1eb3[_0xc838('0x1c')],function(_0xda7670){return{'model':db[_0xda7670[_0xc838('0x1e')]],'as':_0xda7670['as'],'attributes':_0xda7670[_0xc838('0x1b')],'include':_0xda7670[_0xc838('0x1c')]?_[_0xc838('0x1d')](_0xda7670['include'],function(_0x38178f){return{'model':db[_0x38178f[_0xc838('0x1e')]],'as':_0x38178f['as'],'attributes':_0x38178f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x158ed5){logger[_0xc838('0xc')](_0xc838('0x16'),_0x493dcc);logger[_0xc838('0xf')](_0xc838('0x16'),_0x493dcc,JSON['stringify'](_0x158ed5));_0x530d55(_0x158ed5);})[_0xc838('0x15')](function(_0x5b83d9){logger[_0xc838('0x12')](_0xc838('0x16'),_0x5b83d9[_0xc838('0x13')],_0x493dcc);_0x11be9f(_0x4df3f0[_0xc838('0x12')](0x1f4,_0x5b83d9[_0xc838('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 72062fe..4da8398 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x4fc2,0x111));var _0x24fc=function(_0x48ff3c,_0x516bb9){_0x48ff3c=_0x48ff3c-0x0;var _0x20c8db=_0x4fc2[_0x48ff3c];return _0x20c8db;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1d98bb,_0x2331a4){var _0xde77f6=function(_0x5df43d){while(--_0x5df43d){_0x1d98bb['push'](_0x1d98bb['shift']());}};_0xde77f6(++_0x2331a4);}(_0xac4a,0x13f));var _0xaac4=function(_0xdc17c4,_0x54aa8c){_0xdc17c4=_0xdc17c4-0x0;var _0x2ab467=_0xac4a[_0xdc17c4];return _0x2ab467;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 9439871..6d444ef 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 _0x5ff2=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x5ff2,0x1d7));var _0x25ff=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x5ff2[_0x3f6c29];return _0x4af959;};'use strict';var Sequelize=require('sequelize');module[_0x25ff('0x0')]={'uniqueid':{'type':Sequelize[_0x25ff('0x1')]},'body':{'type':Sequelize[_0x25ff('0x2')](_0x25ff('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x25ff('0x4')]('in','out'),'defaultValue':_0x25ff('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x25ff('0x1')]},'providerResponse':{'type':Sequelize[_0x25ff('0x2')]}}; \ No newline at end of file +var _0xc572=['ENUM','out','STRING','TEXT','sequelize','exports','medium'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0xc572,0x131));var _0x2c57=function(_0x43eec6,_0x14d3f3){_0x43eec6=_0x43eec6-0x0;var _0x338e15=_0xc572[_0x43eec6];return _0x338e15;};'use strict';var Sequelize=require(_0x2c57('0x0'));module[_0x2c57('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x2c57('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2c57('0x3')]('in',_0x2c57('0x4')),'defaultValue':_0x2c57('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2c57('0x5')]},'providerResponse':{'type':Sequelize[_0x2c57('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 03ffc94..b9278ac 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 _0x5b2e=['sort','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0xb39122,_0x1c4f04){var _0x4126c7=function(_0x5d0871){while(--_0x5d0871){_0xb39122['push'](_0xb39122['shift']());}};_0x4126c7(++_0x1c4f04);}(_0x5b2e,0x147));var _0xe5b2=function(_0x143105,_0x252066){_0x143105=_0x143105-0x0;var _0x984d1f=_0x5b2e[_0x143105];return _0x984d1f;};'use strict';var emlformat=require(_0xe5b2('0x0'));var rimraf=require(_0xe5b2('0x1'));var zipdir=require(_0xe5b2('0x2'));var jsonpatch=require(_0xe5b2('0x3'));var rp=require(_0xe5b2('0x4'));var moment=require(_0xe5b2('0x5'));var BPromise=require(_0xe5b2('0x6'));var Mustache=require(_0xe5b2('0x7'));var util=require(_0xe5b2('0x8'));var path=require(_0xe5b2('0x9'));var sox=require('sox');var csv=require(_0xe5b2('0xa'));var ejs=require(_0xe5b2('0xb'));var fs=require('fs');var fs_extra=require(_0xe5b2('0xc'));var _=require('lodash');var squel=require(_0xe5b2('0xd'));var crypto=require(_0xe5b2('0xe'));var jsforce=require(_0xe5b2('0xf'));var deskjs=require(_0xe5b2('0x10'));var toCsv=require(_0xe5b2('0xa'));var querystring=require(_0xe5b2('0x11'));var Papa=require('papaparse');var Redis=require(_0xe5b2('0x12'));var authService=require(_0xe5b2('0x13'));var qs=require(_0xe5b2('0x14'));var as=require(_0xe5b2('0x15'));var hardwareService=require(_0xe5b2('0x16'));var logger=require(_0xe5b2('0x17'))(_0xe5b2('0x18'));var utils=require(_0xe5b2('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe5b2('0x1a'));var db=require(_0xe5b2('0x1b'))['db'];function respondWithStatusCode(_0x1ca9b2,_0x261916){_0x261916=_0x261916||0xcc;return function(_0x3a8d40){if(_0x3a8d40){return _0x1ca9b2[_0xe5b2('0x1c')](_0x261916);}return _0x1ca9b2[_0xe5b2('0x1d')](_0x261916)[_0xe5b2('0x1e')]();};}function respondWithResult(_0x13bf10,_0x3fe008){_0x3fe008=_0x3fe008||0xc8;return function(_0x2a38d7){if(_0x2a38d7){return _0x13bf10[_0xe5b2('0x1d')](_0x3fe008)['json'](_0x2a38d7);}};}function respondWithFilteredResult(_0x57932b,_0xff036d){return function(_0x658c65){if(_0x658c65){var _0x929558=typeof _0xff036d[_0xe5b2('0x1f')]===_0xe5b2('0x20')&&typeof _0xff036d[_0xe5b2('0x21')]==='undefined';var _0x1287e5=_0x658c65[_0xe5b2('0x22')];var _0xc8d5e8=_0x929558?0x0:_0xff036d['offset'];var _0x1579a3=_0x929558?_0x658c65[_0xe5b2('0x22')]:_0xff036d[_0xe5b2('0x1f')]+_0xff036d[_0xe5b2('0x21')];var _0xcf1ca6;if(_0x1579a3>=_0x1287e5){_0x1579a3=_0x1287e5;_0xcf1ca6=0xc8;}else{_0xcf1ca6=0xce;}_0x57932b[_0xe5b2('0x1d')](_0xcf1ca6);return _0x57932b[_0xe5b2('0x23')](_0xe5b2('0x24'),_0xc8d5e8+'-'+_0x1579a3+'/'+_0x1287e5)[_0xe5b2('0x25')](_0x658c65);}return null;};}function patchUpdates(_0x4d711f){return function(_0x7cae5f){try{jsonpatch[_0xe5b2('0x26')](_0x7cae5f,_0x4d711f,!![]);}catch(_0x1184ff){return BPromise['reject'](_0x1184ff);}return _0x7cae5f[_0xe5b2('0x27')]();};}function saveUpdates(_0x41bcdb,_0x5ab60a){return function(_0x4eeb1d){if(_0x4eeb1d){return _0x4eeb1d[_0xe5b2('0x28')](_0x41bcdb)[_0xe5b2('0x29')](function(_0x406d58){return _0x406d58;});}return null;};}function removeEntity(_0xc8b2f6,_0x6f263d){return function(_0x44acf6){if(_0x44acf6){return _0x44acf6[_0xe5b2('0x2a')]()[_0xe5b2('0x29')](function(){_0xc8b2f6[_0xe5b2('0x1d')](0xcc)[_0xe5b2('0x1e')]();});}};}function handleEntityNotFound(_0x57f425,_0x11b0c7){return function(_0x428b36){if(!_0x428b36){_0x57f425[_0xe5b2('0x1c')](0x194);}return _0x428b36;};}function handleError(_0x5b5520,_0x2d1a3d){_0x2d1a3d=_0x2d1a3d||0x1f4;return function(_0x54478b){logger[_0xe5b2('0x2b')](_0x54478b[_0xe5b2('0x2c')]);if(_0x54478b[_0xe5b2('0x2d')]){delete _0x54478b['name'];}_0x5b5520['status'](_0x2d1a3d)[_0xe5b2('0x2e')](_0x54478b);};}exports[_0xe5b2('0x2f')]=function(_0x4d58b0,_0x2b52e6){var _0x17b752={},_0x44168e={},_0x5095c3={'count':0x0,'rows':[]};var _0x383e2e=_[_0xe5b2('0x30')](db[_0xe5b2('0x31')][_0xe5b2('0x32')],function(_0x4618dd){return{'name':_0x4618dd['fieldName'],'type':_0x4618dd[_0xe5b2('0x33')]['key']};});_0x44168e[_0xe5b2('0x34')]=_[_0xe5b2('0x30')](_0x383e2e,_0xe5b2('0x2d'));_0x44168e['query']=_[_0xe5b2('0x35')](_0x4d58b0[_0xe5b2('0x36')]);_0x44168e[_0xe5b2('0x37')]=_[_0xe5b2('0x38')](_0x44168e[_0xe5b2('0x34')],_0x44168e[_0xe5b2('0x36')]);_0x17b752['attributes']=_[_0xe5b2('0x38')](_0x44168e[_0xe5b2('0x34')],qs[_0xe5b2('0x39')](_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x39')]));_0x17b752[_0xe5b2('0x3a')]=_0x17b752[_0xe5b2('0x3a')][_0xe5b2('0x3b')]?_0x17b752[_0xe5b2('0x3a')]:_0x44168e[_0xe5b2('0x34')];if(!_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x3c')](_0xe5b2('0x3d'))){_0x17b752[_0xe5b2('0x21')]=qs[_0xe5b2('0x21')](_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x21')]);_0x17b752[_0xe5b2('0x1f')]=qs['offset'](_0x4d58b0['query'][_0xe5b2('0x1f')]);}_0x17b752[_0xe5b2('0x3e')]=qs[_0xe5b2('0x3f')](_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x3f')]);_0x17b752['where']=qs[_0xe5b2('0x37')](_['pick'](_0x4d58b0[_0xe5b2('0x36')],_0x44168e[_0xe5b2('0x37')]),_0x383e2e);if(_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x40')]){_0x17b752[_0xe5b2('0x41')]=_[_0xe5b2('0x42')](_0x17b752[_0xe5b2('0x41')],{'$or':_[_0xe5b2('0x30')](_0x383e2e,function(_0x533d66){if(_0x533d66[_0xe5b2('0x33')]!==_0xe5b2('0x43')){var _0x4c47f4={};_0x4c47f4[_0x533d66[_0xe5b2('0x2d')]]={'$like':'%'+_0x4d58b0[_0xe5b2('0x36')][_0xe5b2('0x40')]+'%'};return _0x4c47f4;}})});}_0x17b752=_[_0xe5b2('0x42')]({},_0x17b752,_0x4d58b0['options']);var _0x10f68d={'where':_0x17b752[_0xe5b2('0x41')]};return db['SquareMessage'][_0xe5b2('0x22')](_0x10f68d)[_0xe5b2('0x29')](function(_0x58c93f){_0x5095c3[_0xe5b2('0x22')]=_0x58c93f;if(_0x4d58b0['query']['includeAll']){_0x17b752[_0xe5b2('0x44')]=[{'all':!![]}];}return db[_0xe5b2('0x31')][_0xe5b2('0x45')](_0x17b752);})['then'](function(_0x31d992){_0x5095c3['rows']=_0x31d992;return _0x5095c3;})[_0xe5b2('0x29')](respondWithFilteredResult(_0x2b52e6,_0x17b752))[_0xe5b2('0x46')](handleError(_0x2b52e6,null));};exports[_0xe5b2('0x47')]=function(_0x4958d9,_0x3af485){var _0x4cadb1={'raw':!![],'where':{'id':_0x4958d9[_0xe5b2('0x48')]['id']}},_0x91928b={};_0x91928b['model']=_[_0xe5b2('0x35')](db[_0xe5b2('0x31')][_0xe5b2('0x32')]);_0x91928b['query']=_[_0xe5b2('0x35')](_0x4958d9[_0xe5b2('0x36')]);_0x91928b[_0xe5b2('0x37')]=_[_0xe5b2('0x38')](_0x91928b[_0xe5b2('0x34')],_0x91928b[_0xe5b2('0x36')]);_0x4cadb1['attributes']=_[_0xe5b2('0x38')](_0x91928b['model'],qs[_0xe5b2('0x39')](_0x4958d9['query'][_0xe5b2('0x39')]));_0x4cadb1[_0xe5b2('0x3a')]=_0x4cadb1[_0xe5b2('0x3a')][_0xe5b2('0x3b')]?_0x4cadb1[_0xe5b2('0x3a')]:_0x91928b[_0xe5b2('0x34')];if(_0x4958d9[_0xe5b2('0x36')][_0xe5b2('0x49')]){_0x4cadb1[_0xe5b2('0x44')]=[{'all':!![]}];}_0x4cadb1=_['merge']({},_0x4cadb1,_0x4958d9[_0xe5b2('0x4a')]);return db[_0xe5b2('0x31')][_0xe5b2('0x4b')](_0x4cadb1)[_0xe5b2('0x29')](handleEntityNotFound(_0x3af485,null))['then'](respondWithResult(_0x3af485,null))['catch'](handleError(_0x3af485,null));};exports['create']=function(_0x3190b9,_0x5a647f){return db[_0xe5b2('0x31')][_0xe5b2('0x4c')](_0x3190b9[_0xe5b2('0x4d')],{})['then'](respondWithResult(_0x5a647f,0xc9))[_0xe5b2('0x46')](handleError(_0x5a647f,null));};exports[_0xe5b2('0x28')]=function(_0xf4fd84,_0x28a7b4){if(_0xf4fd84[_0xe5b2('0x4d')]['id']){delete _0xf4fd84['body']['id'];}return db[_0xe5b2('0x31')][_0xe5b2('0x4b')]({'where':{'id':_0xf4fd84['params']['id']}})[_0xe5b2('0x29')](handleEntityNotFound(_0x28a7b4,null))['then'](saveUpdates(_0xf4fd84['body'],null))['then'](respondWithResult(_0x28a7b4,null))[_0xe5b2('0x46')](handleError(_0x28a7b4,null));};exports[_0xe5b2('0x2a')]=function(_0x561577,_0x38c366){return db[_0xe5b2('0x31')][_0xe5b2('0x4b')]({'where':{'id':_0x561577[_0xe5b2('0x48')]['id']}})[_0xe5b2('0x29')](handleEntityNotFound(_0x38c366,null))[_0xe5b2('0x29')](removeEntity(_0x38c366,null))['catch'](handleError(_0x38c366,null));}; \ No newline at end of file +var _0x639a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','error','name','send','index','map','SquareMessage','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','catch','destroy','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x29b326,_0x9889d8){var _0x323dd8=function(_0x41950f){while(--_0x41950f){_0x29b326['push'](_0x29b326['shift']());}};_0x323dd8(++_0x9889d8);}(_0x639a,0x1e8));var _0xa639=function(_0x568b45,_0x4ccd6a){_0x568b45=_0x568b45-0x0;var _0x41475e=_0x639a[_0x568b45];return _0x41475e;};'use strict';var emlformat=require(_0xa639('0x0'));var rimraf=require(_0xa639('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa639('0x4'));var util=require(_0xa639('0x5'));var path=require(_0xa639('0x6'));var sox=require(_0xa639('0x7'));var csv=require('to-csv');var ejs=require(_0xa639('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa639('0x9'));var squel=require(_0xa639('0xa'));var crypto=require(_0xa639('0xb'));var jsforce=require(_0xa639('0xc'));var deskjs=require(_0xa639('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa639('0xe'));var Papa=require(_0xa639('0xf'));var Redis=require(_0xa639('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa639('0x11'));var as=require(_0xa639('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa639('0x13'))(_0xa639('0x14'));var utils=require('../../config/utils');var config=require(_0xa639('0x15'));var licenseUtil=require(_0xa639('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450aa7,_0x1a666e){_0x1a666e=_0x1a666e||0xcc;return function(_0x110488){if(_0x110488){return _0x450aa7[_0xa639('0x17')](_0x1a666e);}return _0x450aa7[_0xa639('0x18')](_0x1a666e)[_0xa639('0x19')]();};}function respondWithResult(_0x3dc4b5,_0x56fa87){_0x56fa87=_0x56fa87||0xc8;return function(_0x15605d){if(_0x15605d){return _0x3dc4b5[_0xa639('0x18')](_0x56fa87)[_0xa639('0x1a')](_0x15605d);}};}function respondWithFilteredResult(_0x28f05c,_0x19436b){return function(_0x7ec7ce){if(_0x7ec7ce){var _0x10c096=typeof _0x19436b[_0xa639('0x1b')]===_0xa639('0x1c')&&typeof _0x19436b['limit']===_0xa639('0x1c');var _0x1d4f47=_0x7ec7ce['count'];var _0x15002b=_0x10c096?0x0:_0x19436b[_0xa639('0x1b')];var _0x200a65=_0x10c096?_0x7ec7ce[_0xa639('0x1d')]:_0x19436b['offset']+_0x19436b[_0xa639('0x1e')];var _0x108005;if(_0x200a65>=_0x1d4f47){_0x200a65=_0x1d4f47;_0x108005=0xc8;}else{_0x108005=0xce;}_0x28f05c[_0xa639('0x18')](_0x108005);return _0x28f05c[_0xa639('0x1f')]('Content-Range',_0x15002b+'-'+_0x200a65+'/'+_0x1d4f47)[_0xa639('0x1a')](_0x7ec7ce);}return null;};}function patchUpdates(_0x4509df){return function(_0x32d216){try{jsonpatch[_0xa639('0x20')](_0x32d216,_0x4509df,!![]);}catch(_0x20c03d){return BPromise['reject'](_0x20c03d);}return _0x32d216[_0xa639('0x21')]();};}function saveUpdates(_0x1180f1,_0x107a5d){return function(_0x917ed4){if(_0x917ed4){return _0x917ed4['update'](_0x1180f1)[_0xa639('0x22')](function(_0x597397){return _0x597397;});}return null;};}function removeEntity(_0x40954e,_0x11299b){return function(_0x3442cd){if(_0x3442cd){return _0x3442cd['destroy']()[_0xa639('0x22')](function(){_0x40954e['status'](0xcc)[_0xa639('0x19')]();});}};}function handleEntityNotFound(_0x127fa9,_0x10ff2b){return function(_0x14a86d){if(!_0x14a86d){_0x127fa9['sendStatus'](0x194);}return _0x14a86d;};}function handleError(_0x3e4b0b,_0x176dcf){_0x176dcf=_0x176dcf||0x1f4;return function(_0x1414be){logger[_0xa639('0x23')](_0x1414be['stack']);if(_0x1414be[_0xa639('0x24')]){delete _0x1414be[_0xa639('0x24')];}_0x3e4b0b[_0xa639('0x18')](_0x176dcf)[_0xa639('0x25')](_0x1414be);};}exports[_0xa639('0x26')]=function(_0x343360,_0x4cf740){var _0x4cbf18={},_0x43c236={},_0x2cf80a={'count':0x0,'rows':[]};var _0x3a82b5=_[_0xa639('0x27')](db[_0xa639('0x28')]['rawAttributes'],function(_0x5151a1){return{'name':_0x5151a1[_0xa639('0x29')],'type':_0x5151a1['type'][_0xa639('0x2a')]};});_0x43c236['model']=_[_0xa639('0x27')](_0x3a82b5,_0xa639('0x24'));_0x43c236[_0xa639('0x2b')]=_[_0xa639('0x2c')](_0x343360[_0xa639('0x2b')]);_0x43c236[_0xa639('0x2d')]=_[_0xa639('0x2e')](_0x43c236[_0xa639('0x2f')],_0x43c236['query']);_0x4cbf18[_0xa639('0x30')]=_['intersection'](_0x43c236[_0xa639('0x2f')],qs[_0xa639('0x31')](_0x343360['query'][_0xa639('0x31')]));_0x4cbf18[_0xa639('0x30')]=_0x4cbf18['attributes']['length']?_0x4cbf18[_0xa639('0x30')]:_0x43c236[_0xa639('0x2f')];if(!_0x343360[_0xa639('0x2b')][_0xa639('0x32')](_0xa639('0x33'))){_0x4cbf18[_0xa639('0x1e')]=qs['limit'](_0x343360['query'][_0xa639('0x1e')]);_0x4cbf18[_0xa639('0x1b')]=qs['offset'](_0x343360[_0xa639('0x2b')][_0xa639('0x1b')]);}_0x4cbf18[_0xa639('0x34')]=qs[_0xa639('0x35')](_0x343360['query'][_0xa639('0x35')]);_0x4cbf18[_0xa639('0x36')]=qs[_0xa639('0x2d')](_[_0xa639('0x37')](_0x343360['query'],_0x43c236[_0xa639('0x2d')]),_0x3a82b5);if(_0x343360[_0xa639('0x2b')][_0xa639('0x38')]){_0x4cbf18[_0xa639('0x36')]=_[_0xa639('0x39')](_0x4cbf18[_0xa639('0x36')],{'$or':_[_0xa639('0x27')](_0x3a82b5,function(_0x78f94e){if(_0x78f94e[_0xa639('0x3a')]!==_0xa639('0x3b')){var _0x1256a1={};_0x1256a1[_0x78f94e[_0xa639('0x24')]]={'$like':'%'+_0x343360[_0xa639('0x2b')][_0xa639('0x38')]+'%'};return _0x1256a1;}})});}_0x4cbf18=_[_0xa639('0x39')]({},_0x4cbf18,_0x343360[_0xa639('0x3c')]);var _0x563c70={'where':_0x4cbf18[_0xa639('0x36')]};return db[_0xa639('0x28')][_0xa639('0x1d')](_0x563c70)['then'](function(_0x12dd1b){_0x2cf80a[_0xa639('0x1d')]=_0x12dd1b;if(_0x343360[_0xa639('0x2b')][_0xa639('0x3d')]){_0x4cbf18[_0xa639('0x3e')]=[{'all':!![]}];}return db[_0xa639('0x28')][_0xa639('0x3f')](_0x4cbf18);})['then'](function(_0x379143){_0x2cf80a[_0xa639('0x40')]=_0x379143;return _0x2cf80a;})[_0xa639('0x22')](respondWithFilteredResult(_0x4cf740,_0x4cbf18))['catch'](handleError(_0x4cf740,null));};exports['show']=function(_0x571963,_0x16e342){var _0x153aee={'raw':!![],'where':{'id':_0x571963['params']['id']}},_0x6c7dd7={};_0x6c7dd7['model']=_[_0xa639('0x2c')](db[_0xa639('0x28')]['rawAttributes']);_0x6c7dd7[_0xa639('0x2b')]=_['keys'](_0x571963['query']);_0x6c7dd7[_0xa639('0x2d')]=_[_0xa639('0x2e')](_0x6c7dd7['model'],_0x6c7dd7[_0xa639('0x2b')]);_0x153aee[_0xa639('0x30')]=_[_0xa639('0x2e')](_0x6c7dd7[_0xa639('0x2f')],qs[_0xa639('0x31')](_0x571963[_0xa639('0x2b')][_0xa639('0x31')]));_0x153aee[_0xa639('0x30')]=_0x153aee[_0xa639('0x30')][_0xa639('0x41')]?_0x153aee[_0xa639('0x30')]:_0x6c7dd7['model'];if(_0x571963[_0xa639('0x2b')]['includeAll']){_0x153aee[_0xa639('0x3e')]=[{'all':!![]}];}_0x153aee=_[_0xa639('0x39')]({},_0x153aee,_0x571963[_0xa639('0x3c')]);return db[_0xa639('0x28')][_0xa639('0x42')](_0x153aee)[_0xa639('0x22')](handleEntityNotFound(_0x16e342,null))[_0xa639('0x22')](respondWithResult(_0x16e342,null))['catch'](handleError(_0x16e342,null));};exports['create']=function(_0x4d0edd,_0x34dac5){return db[_0xa639('0x28')][_0xa639('0x43')](_0x4d0edd['body'],{})[_0xa639('0x22')](respondWithResult(_0x34dac5,0xc9))['catch'](handleError(_0x34dac5,null));};exports['update']=function(_0x267551,_0xb805cc){if(_0x267551[_0xa639('0x44')]['id']){delete _0x267551[_0xa639('0x44')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x267551['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0xb805cc,null))['then'](saveUpdates(_0x267551[_0xa639('0x44')],null))[_0xa639('0x22')](respondWithResult(_0xb805cc,null))[_0xa639('0x45')](handleError(_0xb805cc,null));};exports[_0xa639('0x46')]=function(_0x303f5a,_0x381990){return db[_0xa639('0x28')][_0xa639('0x42')]({'where':{'id':_0x303f5a['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x381990,null))[_0xa639('0x22')](removeEntity(_0x381990,null))[_0xa639('0x45')](handleError(_0x381990,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2a32001..4f0bac1 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 _0x033b=['bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','api','moment'];(function(_0x139332,_0x439e5f){var _0x208fd9=function(_0x7e3bd3){while(--_0x7e3bd3){_0x139332['push'](_0x139332['shift']());}};_0x208fd9(++_0x439e5f);}(_0x033b,0x18e));var _0xb033=function(_0x3d3062,_0x5a57e9){_0x3d3062=_0x3d3062-0x0;var _0x5743df=_0x033b[_0x3d3062];return _0x5743df;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb033('0x0'));var moment=require(_0xb033('0x1'));var BPromise=require(_0xb033('0x2'));var rp=require(_0xb033('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb033('0x4'));var attributes=require(_0xb033('0x5'));module[_0xb033('0x6')]=function(_0x1efc86,_0x123aed){return _0x1efc86[_0xb033('0x7')](_0xb033('0x8'),attributes,{'tableName':_0xb033('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1db=['util','../../config/logger','moment','bluebird','./squareMessage.attributes','exports','SquareMessage','square_messages'];(function(_0x537ae5,_0x467295){var _0x2d518e=function(_0x83b7f6){while(--_0x83b7f6){_0x537ae5['push'](_0x537ae5['shift']());}};_0x2d518e(++_0x467295);}(_0xa1db,0x1c8));var _0xba1d=function(_0x9117ad,_0x386be4){_0x9117ad=_0x9117ad-0x0;var _0x540f0c=_0xa1db[_0x9117ad];return _0x540f0c;};'use strict';var _=require('lodash');var util=require(_0xba1d('0x0'));var logger=require(_0xba1d('0x1'))('api');var moment=require(_0xba1d('0x2'));var BPromise=require(_0xba1d('0x3'));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(_0xba1d('0x4'));module[_0xba1d('0x5')]=function(_0x3e7808,_0x125a3e){return _0x3e7808['define'](_0xba1d('0x6'),attributes,{'tableName':_0xba1d('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 adb3a84..89ee697 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 _0xb5ad=['message','info','result','catch','SquareMessage','options','raw','CreateSquareMessage','lodash','util','randomstring','../../config/logger','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x376776,_0xa77043){var _0x356cdc=function(_0x4c1fe7){while(--_0x4c1fe7){_0x376776['push'](_0x376776['shift']());}};_0x356cdc(++_0xa77043);}(_0xb5ad,0x17e));var _0xdb5a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb5ad[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xdb5a('0x0'));var util=require(_0xdb5a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdb5a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb5a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdb5a('0x4'));var client=jayson[_0xdb5a('0x5')][_0xdb5a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1dd3ec,_0x4ebc63,_0x5d26d4){return new BPromise(function(_0x59f7f4,_0x3a9a65){return client['request'](_0x1dd3ec,_0x5d26d4)[_0xdb5a('0x7')](function(_0x52079d){logger['info']('SquareMessage,\x20%s,\x20%s',_0x4ebc63,_0xdb5a('0x8'));logger[_0xdb5a('0x9')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4ebc63,_0xdb5a('0x8'),JSON[_0xdb5a('0xa')](_0x52079d));if(_0x52079d[_0xdb5a('0xb')]){if(_0x52079d[_0xdb5a('0xb')][_0xdb5a('0xc')]===0x1f4){logger['error'](_0xdb5a('0xd'),_0x4ebc63,_0x52079d[_0xdb5a('0xb')][_0xdb5a('0xe')]);return _0x3a9a65(_0x52079d[_0xdb5a('0xb')][_0xdb5a('0xe')]);}logger[_0xdb5a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x4ebc63,_0x52079d[_0xdb5a('0xb')][_0xdb5a('0xe')]);return _0x59f7f4(_0x52079d['error']['message']);}else{logger[_0xdb5a('0xf')]('SquareMessage,\x20%s,\x20%s',_0x4ebc63,_0xdb5a('0x8'));_0x59f7f4(_0x52079d[_0xdb5a('0x10')][_0xdb5a('0xe')]);}})[_0xdb5a('0x11')](function(_0x8f348){logger[_0xdb5a('0xb')](_0xdb5a('0xd'),_0x4ebc63,_0x8f348);_0x3a9a65(_0x8f348);});});}exports['CreateSquareMessage']=function(_0x3f97de){var _0x666cc8=this;return new Promise(function(_0x344963,_0x3dd6ef){return db[_0xdb5a('0x12')]['create'](_0x3f97de['body'],{'raw':_0x3f97de[_0xdb5a('0x13')]?_0x3f97de[_0xdb5a('0x13')][_0xdb5a('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x199fd1){logger[_0xdb5a('0xf')](_0xdb5a('0x15'),_0x3f97de);logger[_0xdb5a('0x9')](_0xdb5a('0x15'),_0x3f97de,JSON[_0xdb5a('0xa')](_0x199fd1));_0x344963(_0x199fd1);})['catch'](function(_0x628c64){logger[_0xdb5a('0xb')]('CreateSquareMessage',_0x628c64[_0xdb5a('0xe')],_0x3f97de);_0x3dd6ef(_0x666cc8[_0xdb5a('0xb')](0x1f4,_0x628c64[_0xdb5a('0xe')]));});});}; \ No newline at end of file +var _0x45bc=['options','raw','CreateSquareMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SquareMessage','create','body'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x45bc,0xb8));var _0xc45b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x45bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc45b('0x0'));var util=require(_0xc45b('0x1'));var moment=require(_0xc45b('0x2'));var BPromise=require(_0xc45b('0x3'));var rs=require(_0xc45b('0x4'));var fs=require('fs');var Redis=require(_0xc45b('0x5'));var db=require(_0xc45b('0x6'))['db'];var utils=require(_0xc45b('0x7'));var logger=require('../../config/logger')(_0xc45b('0x8'));var config=require(_0xc45b('0x9'));var jayson=require(_0xc45b('0xa'));var client=jayson[_0xc45b('0xb')][_0xc45b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2573a2,_0x18db46,_0x185037){return new BPromise(function(_0x49ed89,_0x241f31){return client['request'](_0x2573a2,_0x185037)[_0xc45b('0xd')](function(_0x3f24e6){logger[_0xc45b('0xe')](_0xc45b('0xf'),_0x18db46,_0xc45b('0x10'));logger[_0xc45b('0x11')](_0xc45b('0x12'),_0x18db46,_0xc45b('0x10'),JSON[_0xc45b('0x13')](_0x3f24e6));if(_0x3f24e6[_0xc45b('0x14')]){if(_0x3f24e6[_0xc45b('0x14')]['code']===0x1f4){logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x3f24e6[_0xc45b('0x14')][_0xc45b('0x15')]);return _0x241f31(_0x3f24e6[_0xc45b('0x14')]['message']);}logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x3f24e6['error'][_0xc45b('0x15')]);return _0x49ed89(_0x3f24e6['error'][_0xc45b('0x15')]);}else{logger[_0xc45b('0xe')](_0xc45b('0xf'),_0x18db46,_0xc45b('0x10'));_0x49ed89(_0x3f24e6[_0xc45b('0x16')]['message']);}})['catch'](function(_0x231137){logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x231137);_0x241f31(_0x231137);});});}exports['CreateSquareMessage']=function(_0xb26c77){var _0x2dbd97=this;return new Promise(function(_0x109a9d,_0x283fc1){return db[_0xc45b('0x17')][_0xc45b('0x18')](_0xb26c77[_0xc45b('0x19')],{'raw':_0xb26c77[_0xc45b('0x1a')]?_0xb26c77['options'][_0xc45b('0x1b')]===undefined?!![]:![]:!![]})[_0xc45b('0xd')](function(_0x39e651){logger['info'](_0xc45b('0x1c'),_0xb26c77);logger[_0xc45b('0x11')](_0xc45b('0x1c'),_0xb26c77,JSON[_0xc45b('0x13')](_0x39e651));_0x109a9d(_0x39e651);})[_0xc45b('0x1d')](function(_0xe3ca76){logger['error'](_0xc45b('0x1c'),_0xe3ca76[_0xc45b('0x15')],_0xb26c77);_0x283fc1(_0x2dbd97[_0xc45b('0x14')](0x1f4,_0xe3ca76[_0xc45b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index b574d0c..17aba8f 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 _0xbea8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','express','fs-extra'];(function(_0x3993f5,_0x239e2f){var _0x14e825=function(_0x2b3141){while(--_0x2b3141){_0x3993f5['push'](_0x3993f5['shift']());}};_0x14e825(++_0x239e2f);}(_0xbea8,0x189));var _0x8bea=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0xbea8[_0x399849];return _0xfbb04;};'use strict';var multer=require(_0x8bea('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8bea('0x1'));var router=express['Router']();var fs_extra=require(_0x8bea('0x2'));var auth=require(_0x8bea('0x3'));var interaction=require(_0x8bea('0x4'));var config=require(_0x8bea('0x5'));var controller=require(_0x8bea('0x6'));router[_0x8bea('0x7')]('/',auth[_0x8bea('0x8')](),controller[_0x8bea('0x9')]);router[_0x8bea('0x7')](_0x8bea('0xa'),auth['isAuthenticated'](),controller[_0x8bea('0xb')]);router[_0x8bea('0x7')](_0x8bea('0xc'),auth['isAuthenticated'](),timeout(_0x8bea('0xd')),controller[_0x8bea('0xe')]);router[_0x8bea('0xf')]('/',auth[_0x8bea('0x8')](),controller[_0x8bea('0x10')]);router[_0x8bea('0x11')](_0x8bea('0xa'),auth[_0x8bea('0x8')](),controller[_0x8bea('0x12')]);router[_0x8bea('0x13')](_0x8bea('0xa'),auth[_0x8bea('0x8')](),controller[_0x8bea('0x14')]);module[_0x8bea('0x15')]=router; \ No newline at end of file +var _0x3651=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','post','create','put','update','destroy','exports','multer'];(function(_0x688920,_0x43afd1){var _0x3df9fe=function(_0x45c4f0){while(--_0x45c4f0){_0x688920['push'](_0x688920['shift']());}};_0x3df9fe(++_0x43afd1);}(_0x3651,0x14f));var _0x1365=function(_0x553e9f,_0x4534ea){_0x553e9f=_0x553e9f-0x0;var _0x22c930=_0x3651[_0x553e9f];return _0x22c930;};'use strict';var multer=require(_0x1365('0x0'));var util=require('util');var path=require(_0x1365('0x1'));var timeout=require('connect-timeout');var express=require(_0x1365('0x2'));var router=express[_0x1365('0x3')]();var fs_extra=require(_0x1365('0x4'));var auth=require(_0x1365('0x5'));var interaction=require(_0x1365('0x6'));var config=require(_0x1365('0x7'));var controller=require(_0x1365('0x8'));router[_0x1365('0x9')]('/',auth[_0x1365('0xa')](),controller['index']);router['get'](_0x1365('0xb'),auth['isAuthenticated'](),controller[_0x1365('0xc')]);router[_0x1365('0x9')](_0x1365('0xd'),auth[_0x1365('0xa')](),timeout(_0x1365('0xe')),controller['test']);router[_0x1365('0xf')]('/',auth[_0x1365('0xa')](),controller[_0x1365('0x10')]);router[_0x1365('0x11')](_0x1365('0xb'),auth[_0x1365('0xa')](),controller[_0x1365('0x12')]);router['delete'](_0x1365('0xb'),auth[_0x1365('0xa')](),controller[_0x1365('0x13')]);module[_0x1365('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c86f199..73ed779 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 _0x5114=['STRING','name','sequelize'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x5114,0xe6));var _0x4511=function(_0x434a4c,_0x25ec72){_0x434a4c=_0x434a4c-0x0;var _0x58668e=_0x5114[_0x434a4c];return _0x58668e;};'use strict';var Sequelize=require(_0x4511('0x0'));module['exports']={'name':{'type':Sequelize[_0x4511('0x1')],'unique':_0x4511('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4511('0x1')]},'description':{'type':Sequelize[_0x4511('0x1')]}}; \ No newline at end of file +var _0x8778=['STRING','name'];(function(_0x336f07,_0x34070d){var _0x6f7368=function(_0x4e7912){while(--_0x4e7912){_0x336f07['push'](_0x336f07['shift']());}};_0x6f7368(++_0x34070d);}(_0x8778,0x1af));var _0x8877=function(_0x411a41,_0xf3dc99){_0x411a41=_0x411a41-0x0;var _0x547fb2=_0x8778[_0x411a41];return _0x547fb2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8877('0x0'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8877('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 93b7b18..b8197c8 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 _0x2acc=['where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort'];(function(_0x78c99f,_0xadba1c){var _0x295ce3=function(_0x325be1){while(--_0x325be1){_0x78c99f['push'](_0x78c99f['shift']());}};_0x295ce3(++_0xadba1c);}(_0x2acc,0x124));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc2ac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc2ac('0x1'));var rp=require(_0xc2ac('0x2'));var moment=require(_0xc2ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc2ac('0x4'));var util=require(_0xc2ac('0x5'));var path=require(_0xc2ac('0x6'));var sox=require(_0xc2ac('0x7'));var csv=require('to-csv');var ejs=require(_0xc2ac('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc2ac('0x9'));var crypto=require(_0xc2ac('0xa'));var jsforce=require(_0xc2ac('0xb'));var deskjs=require(_0xc2ac('0xc'));var toCsv=require(_0xc2ac('0xd'));var querystring=require(_0xc2ac('0xe'));var Papa=require(_0xc2ac('0xf'));var Redis=require('ioredis');var authService=require(_0xc2ac('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2ac('0x11'));var logger=require(_0xc2ac('0x12'))(_0xc2ac('0x13'));var utils=require(_0xc2ac('0x14'));var config=require(_0xc2ac('0x15'));var licenseUtil=require(_0xc2ac('0x16'));var db=require(_0xc2ac('0x17'))['db'];function respondWithStatusCode(_0x275e18,_0x5a54a4){_0x5a54a4=_0x5a54a4||0xcc;return function(_0x550c5d){if(_0x550c5d){return _0x275e18[_0xc2ac('0x18')](_0x5a54a4);}return _0x275e18[_0xc2ac('0x19')](_0x5a54a4)[_0xc2ac('0x1a')]();};}function respondWithResult(_0x367df3,_0x430920){_0x430920=_0x430920||0xc8;return function(_0xcf29b9){if(_0xcf29b9){return _0x367df3['status'](_0x430920)[_0xc2ac('0x1b')](_0xcf29b9);}};}function respondWithFilteredResult(_0x21fd69,_0x48fd94){return function(_0x176c47){if(_0x176c47){var _0x38ac0a=typeof _0x48fd94[_0xc2ac('0x1c')]===_0xc2ac('0x1d')&&typeof _0x48fd94[_0xc2ac('0x1e')]===_0xc2ac('0x1d');var _0x2be929=_0x176c47[_0xc2ac('0x1f')];var _0x9d9483=_0x38ac0a?0x0:_0x48fd94['offset'];var _0x3a8952=_0x38ac0a?_0x176c47[_0xc2ac('0x1f')]:_0x48fd94[_0xc2ac('0x1c')]+_0x48fd94[_0xc2ac('0x1e')];var _0x5a790f;if(_0x3a8952>=_0x2be929){_0x3a8952=_0x2be929;_0x5a790f=0xc8;}else{_0x5a790f=0xce;}_0x21fd69[_0xc2ac('0x19')](_0x5a790f);return _0x21fd69[_0xc2ac('0x20')](_0xc2ac('0x21'),_0x9d9483+'-'+_0x3a8952+'/'+_0x2be929)[_0xc2ac('0x1b')](_0x176c47);}return null;};}function patchUpdates(_0x9eecbb){return function(_0x1f0430){try{jsonpatch[_0xc2ac('0x22')](_0x1f0430,_0x9eecbb,!![]);}catch(_0x3b7c12){return BPromise[_0xc2ac('0x23')](_0x3b7c12);}return _0x1f0430[_0xc2ac('0x24')]();};}function saveUpdates(_0x1d35c2,_0x282de8){return function(_0x1d78c0){if(_0x1d78c0){return _0x1d78c0[_0xc2ac('0x25')](_0x1d35c2)[_0xc2ac('0x26')](function(_0x5605ce){return _0x5605ce;});}return null;};}function removeEntity(_0x12e5ea,_0x2382fd){return function(_0x215a45){if(_0x215a45){return _0x215a45[_0xc2ac('0x27')]()['then'](function(){var _0x3f6f60=_0x215a45['get']({'plain':!![]});var _0x4060db='ODBC';return db[_0xc2ac('0x28')]['destroy']({'where':{'type':_0x4060db,'resourceId':_0x3f6f60['id']}})[_0xc2ac('0x26')](function(){return _0x215a45;});})[_0xc2ac('0x26')](function(){_0x12e5ea[_0xc2ac('0x19')](0xcc)[_0xc2ac('0x1a')]();});}};}function handleEntityNotFound(_0x565156,_0x171431){return function(_0x3b968a){if(!_0x3b968a){_0x565156['sendStatus'](0x194);}return _0x3b968a;};}function handleError(_0x55f41f,_0x39e92c){_0x39e92c=_0x39e92c||0x1f4;return function(_0x1e0e20){logger['error'](_0x1e0e20[_0xc2ac('0x29')]);if(_0x1e0e20['name']){delete _0x1e0e20[_0xc2ac('0x2a')];}_0x55f41f[_0xc2ac('0x19')](_0x39e92c)[_0xc2ac('0x2b')](_0x1e0e20);};}exports['index']=function(_0x524a1d,_0x41454d){var _0x557219={},_0x5aeada={},_0x4a4ef3={'count':0x0,'rows':[]};var _0x119f0f=_['map'](db[_0xc2ac('0x2c')][_0xc2ac('0x2d')],function(_0xa43099){return{'name':_0xa43099[_0xc2ac('0x2e')],'type':_0xa43099[_0xc2ac('0x2f')][_0xc2ac('0x30')]};});_0x5aeada[_0xc2ac('0x31')]=_[_0xc2ac('0x32')](_0x119f0f,_0xc2ac('0x2a'));_0x5aeada[_0xc2ac('0x33')]=_[_0xc2ac('0x34')](_0x524a1d[_0xc2ac('0x33')]);_0x5aeada[_0xc2ac('0x35')]=_[_0xc2ac('0x36')](_0x5aeada[_0xc2ac('0x31')],_0x5aeada[_0xc2ac('0x33')]);_0x557219['attributes']=_[_0xc2ac('0x36')](_0x5aeada[_0xc2ac('0x31')],qs[_0xc2ac('0x37')](_0x524a1d[_0xc2ac('0x33')][_0xc2ac('0x37')]));_0x557219['attributes']=_0x557219[_0xc2ac('0x38')][_0xc2ac('0x39')]?_0x557219[_0xc2ac('0x38')]:_0x5aeada[_0xc2ac('0x31')];if(!_0x524a1d['query']['hasOwnProperty']('nolimit')){_0x557219[_0xc2ac('0x1e')]=qs[_0xc2ac('0x1e')](_0x524a1d[_0xc2ac('0x33')][_0xc2ac('0x1e')]);_0x557219[_0xc2ac('0x1c')]=qs[_0xc2ac('0x1c')](_0x524a1d[_0xc2ac('0x33')][_0xc2ac('0x1c')]);}_0x557219[_0xc2ac('0x3a')]=qs[_0xc2ac('0x3b')](_0x524a1d[_0xc2ac('0x33')]['sort']);_0x557219[_0xc2ac('0x3c')]=qs[_0xc2ac('0x35')](_['pick'](_0x524a1d[_0xc2ac('0x33')],_0x5aeada['filters']),_0x119f0f);if(_0x524a1d['query']['filter']){_0x557219[_0xc2ac('0x3c')]=_[_0xc2ac('0x3d')](_0x557219[_0xc2ac('0x3c')],{'$or':_['map'](_0x119f0f,function(_0x53a8c1){if(_0x53a8c1['type']!==_0xc2ac('0x3e')){var _0x780991={};_0x780991[_0x53a8c1[_0xc2ac('0x2a')]]={'$like':'%'+_0x524a1d[_0xc2ac('0x33')][_0xc2ac('0x3f')]+'%'};return _0x780991;}})});}_0x557219=_[_0xc2ac('0x3d')]({},_0x557219,_0x524a1d[_0xc2ac('0x40')]);var _0x232af5={'where':_0x557219[_0xc2ac('0x3c')]};return db[_0xc2ac('0x2c')][_0xc2ac('0x1f')](_0x232af5)[_0xc2ac('0x26')](function(_0x313c1b){_0x4a4ef3['count']=_0x313c1b;if(_0x524a1d[_0xc2ac('0x33')][_0xc2ac('0x41')]){_0x557219['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xc2ac('0x42')](_0x557219);})['then'](function(_0x4b25aa){_0x4a4ef3[_0xc2ac('0x43')]=_0x4b25aa;return _0x4a4ef3;})[_0xc2ac('0x26')](respondWithFilteredResult(_0x41454d,_0x557219))[_0xc2ac('0x44')](handleError(_0x41454d,null));};exports[_0xc2ac('0x45')]=function(_0x53b655,_0x90209a){var _0x200140={'raw':!![],'where':{'id':_0x53b655[_0xc2ac('0x46')]['id']}},_0x57ae3f={};_0x57ae3f[_0xc2ac('0x31')]=_[_0xc2ac('0x34')](db['SquareOdbc'][_0xc2ac('0x2d')]);_0x57ae3f[_0xc2ac('0x33')]=_[_0xc2ac('0x34')](_0x53b655['query']);_0x57ae3f[_0xc2ac('0x35')]=_['intersection'](_0x57ae3f[_0xc2ac('0x31')],_0x57ae3f['query']);_0x200140['attributes']=_[_0xc2ac('0x36')](_0x57ae3f[_0xc2ac('0x31')],qs[_0xc2ac('0x37')](_0x53b655['query'][_0xc2ac('0x37')]));_0x200140[_0xc2ac('0x38')]=_0x200140[_0xc2ac('0x38')][_0xc2ac('0x39')]?_0x200140[_0xc2ac('0x38')]:_0x57ae3f['model'];if(_0x53b655['query']['includeAll']){_0x200140[_0xc2ac('0x47')]=[{'all':!![]}];}_0x200140=_[_0xc2ac('0x3d')]({},_0x200140,_0x53b655[_0xc2ac('0x40')]);return db[_0xc2ac('0x2c')][_0xc2ac('0x48')](_0x200140)[_0xc2ac('0x26')](handleEntityNotFound(_0x90209a,null))[_0xc2ac('0x26')](respondWithResult(_0x90209a,null))[_0xc2ac('0x44')](handleError(_0x90209a,null));};exports[_0xc2ac('0x49')]=function(_0x21a051,_0x8078f5){return db[_0xc2ac('0x2c')][_0xc2ac('0x49')](_0x21a051['body'],{})[_0xc2ac('0x26')](function(_0x31443f){var _0x1c2bd8=_0x21a051['user'][_0xc2ac('0x4a')]({'plain':!![]});if(!_0x1c2bd8)throw new Error(_0xc2ac('0x4b'));if(_0x1c2bd8[_0xc2ac('0x4c')]==='user'){var _0x3cd33a=_0x31443f['get']({'plain':!![]});var _0x27f0f5=_0xc2ac('0x4d');return db['UserProfileSection'][_0xc2ac('0x48')]({'where':{'name':_0x27f0f5,'userProfileId':_0x1c2bd8[_0xc2ac('0x4e')]},'raw':!![]})[_0xc2ac('0x26')](function(_0x87696d){if(_0x87696d&&_0x87696d[_0xc2ac('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3cd33a[_0xc2ac('0x2a')],'resourceId':_0x3cd33a['id'],'type':_0x87696d[_0xc2ac('0x2a')],'sectionId':_0x87696d['id']},{})[_0xc2ac('0x26')](function(){return _0x31443f;});}else{return _0x31443f;}})[_0xc2ac('0x44')](function(_0x1cdbf7){logger[_0xc2ac('0x50')](_0xc2ac('0x51'),_0x1cdbf7);throw _0x1cdbf7;});}return _0x31443f;})[_0xc2ac('0x26')](respondWithResult(_0x8078f5,0xc9))[_0xc2ac('0x44')](handleError(_0x8078f5,null));};exports[_0xc2ac('0x25')]=function(_0x318373,_0x3ff32b){if(_0x318373[_0xc2ac('0x52')]['id']){delete _0x318373[_0xc2ac('0x52')]['id'];}return db[_0xc2ac('0x2c')][_0xc2ac('0x48')]({'where':{'id':_0x318373[_0xc2ac('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ff32b,null))[_0xc2ac('0x26')](saveUpdates(_0x318373[_0xc2ac('0x52')],null))[_0xc2ac('0x26')](respondWithResult(_0x3ff32b,null))[_0xc2ac('0x44')](handleError(_0x3ff32b,null));};exports[_0xc2ac('0x27')]=function(_0xebee92,_0x388a03){return db[_0xc2ac('0x2c')][_0xc2ac('0x48')]({'where':{'id':_0xebee92['params']['id']}})[_0xc2ac('0x26')](handleEntityNotFound(_0x388a03,null))['then'](removeEntity(_0x388a03,null))[_0xc2ac('0x44')](handleError(_0x388a03,null));};exports[_0xc2ac('0x53')]=function(_0x5a3b43,_0x3e5ede,_0xf96407){var _0x182c6d;return db[_0xc2ac('0x2c')][_0xc2ac('0x48')]({'where':{'id':_0x5a3b43['params']['id']},'attributes':['id',_0xc2ac('0x54')]})[_0xc2ac('0x26')](handleEntityNotFound(_0x3e5ede,null))[_0xc2ac('0x26')](function(_0x4dafb9){if(_0x4dafb9){var _0x572fdf=require(_0xc2ac('0x55'))();_0x572fdf[_0xc2ac('0x56')](_0x4dafb9[_0xc2ac('0x54')]);_0x572fdf[_0xc2ac('0x57')]();return _0x4dafb9;}})[_0xc2ac('0x26')](respondWithResult(_0x3e5ede,null))[_0xc2ac('0x44')](handleError(_0x3e5ede,null));}; \ No newline at end of file +var _0x4681=['destroy','ODBC','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then'];(function(_0x824091,_0x4f687c){var _0xac432c=function(_0x2bed55){while(--_0x2bed55){_0x824091['push'](_0x824091['shift']());}};_0xac432c(++_0x4f687c);}(_0x4681,0x1f3));var _0x1468=function(_0x11b7ae,_0x2db03e){_0x11b7ae=_0x11b7ae-0x0;var _0x52874a=_0x4681[_0x11b7ae];return _0x52874a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1468('0x0'));var zipdir=require(_0x1468('0x1'));var jsonpatch=require(_0x1468('0x2'));var rp=require(_0x1468('0x3'));var moment=require(_0x1468('0x4'));var BPromise=require(_0x1468('0x5'));var Mustache=require(_0x1468('0x6'));var util=require(_0x1468('0x7'));var path=require('path');var sox=require(_0x1468('0x8'));var csv=require(_0x1468('0x9'));var ejs=require(_0x1468('0xa'));var fs=require('fs');var fs_extra=require(_0x1468('0xb'));var _=require(_0x1468('0xc'));var squel=require(_0x1468('0xd'));var crypto=require(_0x1468('0xe'));var jsforce=require(_0x1468('0xf'));var deskjs=require(_0x1468('0x10'));var toCsv=require(_0x1468('0x9'));var querystring=require(_0x1468('0x11'));var Papa=require(_0x1468('0x12'));var Redis=require(_0x1468('0x13'));var authService=require(_0x1468('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1468('0x15'));var hardwareService=require(_0x1468('0x16'));var logger=require(_0x1468('0x17'))('api');var utils=require(_0x1468('0x18'));var config=require(_0x1468('0x19'));var licenseUtil=require(_0x1468('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1685af,_0x490c3d){_0x490c3d=_0x490c3d||0xcc;return function(_0x30ebc4){if(_0x30ebc4){return _0x1685af[_0x1468('0x1b')](_0x490c3d);}return _0x1685af[_0x1468('0x1c')](_0x490c3d)[_0x1468('0x1d')]();};}function respondWithResult(_0xbba144,_0x24ad10){_0x24ad10=_0x24ad10||0xc8;return function(_0x19d453){if(_0x19d453){return _0xbba144[_0x1468('0x1c')](_0x24ad10)['json'](_0x19d453);}};}function respondWithFilteredResult(_0x13526d,_0x1855aa){return function(_0x1aa05e){if(_0x1aa05e){var _0x37fff9=typeof _0x1855aa[_0x1468('0x1e')]===_0x1468('0x1f')&&typeof _0x1855aa[_0x1468('0x20')]===_0x1468('0x1f');var _0x4bacb7=_0x1aa05e[_0x1468('0x21')];var _0x57826e=_0x37fff9?0x0:_0x1855aa[_0x1468('0x1e')];var _0x340881=_0x37fff9?_0x1aa05e[_0x1468('0x21')]:_0x1855aa[_0x1468('0x1e')]+_0x1855aa[_0x1468('0x20')];var _0x211258;if(_0x340881>=_0x4bacb7){_0x340881=_0x4bacb7;_0x211258=0xc8;}else{_0x211258=0xce;}_0x13526d[_0x1468('0x1c')](_0x211258);return _0x13526d['set'](_0x1468('0x22'),_0x57826e+'-'+_0x340881+'/'+_0x4bacb7)[_0x1468('0x23')](_0x1aa05e);}return null;};}function patchUpdates(_0x372e99){return function(_0x212bec){try{jsonpatch[_0x1468('0x24')](_0x212bec,_0x372e99,!![]);}catch(_0x5e0c42){return BPromise[_0x1468('0x25')](_0x5e0c42);}return _0x212bec[_0x1468('0x26')]();};}function saveUpdates(_0x8288f4,_0x1a1c8a){return function(_0x988ac8){if(_0x988ac8){return _0x988ac8[_0x1468('0x27')](_0x8288f4)[_0x1468('0x28')](function(_0x8d6c9d){return _0x8d6c9d;});}return null;};}function removeEntity(_0x1cd43d,_0x494fff){return function(_0x58ea00){if(_0x58ea00){return _0x58ea00[_0x1468('0x29')]()[_0x1468('0x28')](function(){var _0x2851c3=_0x58ea00['get']({'plain':!![]});var _0x4a0330=_0x1468('0x2a');return db[_0x1468('0x2b')][_0x1468('0x29')]({'where':{'type':_0x4a0330,'resourceId':_0x2851c3['id']}})['then'](function(){return _0x58ea00;});})[_0x1468('0x28')](function(){_0x1cd43d[_0x1468('0x1c')](0xcc)[_0x1468('0x1d')]();});}};}function handleEntityNotFound(_0x2c4a04,_0x4318ab){return function(_0xd1dada){if(!_0xd1dada){_0x2c4a04[_0x1468('0x1b')](0x194);}return _0xd1dada;};}function handleError(_0x4e4a39,_0x24053f){_0x24053f=_0x24053f||0x1f4;return function(_0x390f66){logger[_0x1468('0x2c')](_0x390f66[_0x1468('0x2d')]);if(_0x390f66['name']){delete _0x390f66[_0x1468('0x2e')];}_0x4e4a39['status'](_0x24053f)[_0x1468('0x2f')](_0x390f66);};}exports[_0x1468('0x30')]=function(_0x108ace,_0x2576ef){var _0x5604c2={},_0x27c20d={},_0x36b781={'count':0x0,'rows':[]};var _0x41463c=_[_0x1468('0x31')](db['SquareOdbc'][_0x1468('0x32')],function(_0x45fdc0){return{'name':_0x45fdc0[_0x1468('0x33')],'type':_0x45fdc0[_0x1468('0x34')]['key']};});_0x27c20d[_0x1468('0x35')]=_['map'](_0x41463c,_0x1468('0x2e'));_0x27c20d['query']=_['keys'](_0x108ace[_0x1468('0x36')]);_0x27c20d[_0x1468('0x37')]=_[_0x1468('0x38')](_0x27c20d['model'],_0x27c20d[_0x1468('0x36')]);_0x5604c2[_0x1468('0x39')]=_[_0x1468('0x38')](_0x27c20d['model'],qs[_0x1468('0x3a')](_0x108ace[_0x1468('0x36')][_0x1468('0x3a')]));_0x5604c2[_0x1468('0x39')]=_0x5604c2['attributes']['length']?_0x5604c2[_0x1468('0x39')]:_0x27c20d[_0x1468('0x35')];if(!_0x108ace[_0x1468('0x36')][_0x1468('0x3b')](_0x1468('0x3c'))){_0x5604c2[_0x1468('0x20')]=qs[_0x1468('0x20')](_0x108ace['query'][_0x1468('0x20')]);_0x5604c2[_0x1468('0x1e')]=qs[_0x1468('0x1e')](_0x108ace[_0x1468('0x36')][_0x1468('0x1e')]);}_0x5604c2[_0x1468('0x3d')]=qs[_0x1468('0x3e')](_0x108ace[_0x1468('0x36')][_0x1468('0x3e')]);_0x5604c2[_0x1468('0x3f')]=qs[_0x1468('0x37')](_[_0x1468('0x40')](_0x108ace[_0x1468('0x36')],_0x27c20d[_0x1468('0x37')]),_0x41463c);if(_0x108ace[_0x1468('0x36')][_0x1468('0x41')]){_0x5604c2[_0x1468('0x3f')]=_[_0x1468('0x42')](_0x5604c2['where'],{'$or':_[_0x1468('0x31')](_0x41463c,function(_0x1db7a0){if(_0x1db7a0['type']!==_0x1468('0x43')){var _0x18ab83={};_0x18ab83[_0x1db7a0[_0x1468('0x2e')]]={'$like':'%'+_0x108ace[_0x1468('0x36')]['filter']+'%'};return _0x18ab83;}})});}_0x5604c2=_[_0x1468('0x42')]({},_0x5604c2,_0x108ace[_0x1468('0x44')]);var _0x2077b5={'where':_0x5604c2[_0x1468('0x3f')]};return db[_0x1468('0x45')][_0x1468('0x21')](_0x2077b5)[_0x1468('0x28')](function(_0x425aac){_0x36b781[_0x1468('0x21')]=_0x425aac;if(_0x108ace[_0x1468('0x36')][_0x1468('0x46')]){_0x5604c2[_0x1468('0x47')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x5604c2);})['then'](function(_0x5a6654){_0x36b781['rows']=_0x5a6654;return _0x36b781;})[_0x1468('0x28')](respondWithFilteredResult(_0x2576ef,_0x5604c2))[_0x1468('0x48')](handleError(_0x2576ef,null));};exports[_0x1468('0x49')]=function(_0x17ea00,_0x54bbe4){var _0xb5c0e1={'raw':!![],'where':{'id':_0x17ea00[_0x1468('0x4a')]['id']}},_0x2ebbb0={};_0x2ebbb0[_0x1468('0x35')]=_[_0x1468('0x4b')](db[_0x1468('0x45')]['rawAttributes']);_0x2ebbb0['query']=_[_0x1468('0x4b')](_0x17ea00[_0x1468('0x36')]);_0x2ebbb0[_0x1468('0x37')]=_[_0x1468('0x38')](_0x2ebbb0[_0x1468('0x35')],_0x2ebbb0[_0x1468('0x36')]);_0xb5c0e1[_0x1468('0x39')]=_[_0x1468('0x38')](_0x2ebbb0['model'],qs[_0x1468('0x3a')](_0x17ea00['query'][_0x1468('0x3a')]));_0xb5c0e1[_0x1468('0x39')]=_0xb5c0e1[_0x1468('0x39')][_0x1468('0x4c')]?_0xb5c0e1[_0x1468('0x39')]:_0x2ebbb0[_0x1468('0x35')];if(_0x17ea00[_0x1468('0x36')][_0x1468('0x46')]){_0xb5c0e1[_0x1468('0x47')]=[{'all':!![]}];}_0xb5c0e1=_[_0x1468('0x42')]({},_0xb5c0e1,_0x17ea00['options']);return db[_0x1468('0x45')][_0x1468('0x4d')](_0xb5c0e1)[_0x1468('0x28')](handleEntityNotFound(_0x54bbe4,null))['then'](respondWithResult(_0x54bbe4,null))['catch'](handleError(_0x54bbe4,null));};exports['create']=function(_0x33d404,_0x319707){return db[_0x1468('0x45')][_0x1468('0x4e')](_0x33d404[_0x1468('0x4f')],{})[_0x1468('0x28')](function(_0x4b2172){var _0xd09e56=_0x33d404[_0x1468('0x50')][_0x1468('0x51')]({'plain':!![]});if(!_0xd09e56)throw new Error(_0x1468('0x52'));if(_0xd09e56[_0x1468('0x53')]===_0x1468('0x50')){var _0x14e878=_0x4b2172['get']({'plain':!![]});var _0x5e418d='ODBC';return db['UserProfileSection'][_0x1468('0x4d')]({'where':{'name':_0x5e418d,'userProfileId':_0xd09e56[_0x1468('0x54')]},'raw':!![]})['then'](function(_0x5557d9){if(_0x5557d9&&_0x5557d9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x14e878[_0x1468('0x2e')],'resourceId':_0x14e878['id'],'type':_0x5557d9[_0x1468('0x2e')],'sectionId':_0x5557d9['id']},{})['then'](function(){return _0x4b2172;});}else{return _0x4b2172;}})[_0x1468('0x48')](function(_0x118873){logger[_0x1468('0x2c')](_0x1468('0x55'),_0x118873);throw _0x118873;});}return _0x4b2172;})[_0x1468('0x28')](respondWithResult(_0x319707,0xc9))['catch'](handleError(_0x319707,null));};exports[_0x1468('0x27')]=function(_0x8bbcd6,_0x3a8804){if(_0x8bbcd6[_0x1468('0x4f')]['id']){delete _0x8bbcd6[_0x1468('0x4f')]['id'];}return db[_0x1468('0x45')][_0x1468('0x4d')]({'where':{'id':_0x8bbcd6[_0x1468('0x4a')]['id']}})[_0x1468('0x28')](handleEntityNotFound(_0x3a8804,null))[_0x1468('0x28')](saveUpdates(_0x8bbcd6[_0x1468('0x4f')],null))[_0x1468('0x28')](respondWithResult(_0x3a8804,null))[_0x1468('0x48')](handleError(_0x3a8804,null));};exports[_0x1468('0x29')]=function(_0x46134f,_0x229b2a){return db[_0x1468('0x45')]['find']({'where':{'id':_0x46134f[_0x1468('0x4a')]['id']}})[_0x1468('0x28')](handleEntityNotFound(_0x229b2a,null))[_0x1468('0x28')](removeEntity(_0x229b2a,null))[_0x1468('0x48')](handleError(_0x229b2a,null));};exports[_0x1468('0x56')]=function(_0x235524,_0x17c28e,_0x569b43){var _0x5e6d0f;return db['SquareOdbc'][_0x1468('0x4d')]({'where':{'id':_0x235524[_0x1468('0x4a')]['id']},'attributes':['id','dsn']})[_0x1468('0x28')](handleEntityNotFound(_0x17c28e,null))[_0x1468('0x28')](function(_0x510153){if(_0x510153){var _0x1efd8d=require(_0x1468('0x57'))();_0x1efd8d['openSync'](_0x510153[_0x1468('0x58')]);_0x1efd8d[_0x1468('0x59')]();return _0x510153;}})[_0x1468('0x28')](respondWithResult(_0x17c28e,null))['catch'](handleError(_0x17c28e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6de7580..6014005 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 _0x7976=['path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5e5ab2,_0x233155){var _0x55fa57=function(_0xb47022){while(--_0xb47022){_0x5e5ab2['push'](_0x5e5ab2['shift']());}};_0x55fa57(++_0x233155);}(_0x7976,0x180));var _0x6797=function(_0x30c9f3,_0x25135b){_0x30c9f3=_0x30c9f3-0x0;var _0x29664f=_0x7976[_0x30c9f3];return _0x29664f;};'use strict';var _=require(_0x6797('0x0'));var util=require(_0x6797('0x1'));var logger=require(_0x6797('0x2'))(_0x6797('0x3'));var moment=require(_0x6797('0x4'));var BPromise=require(_0x6797('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6797('0x6'));var rimraf=require(_0x6797('0x7'));var config=require('../../config/environment');var attributes=require(_0x6797('0x8'));module[_0x6797('0x9')]=function(_0x1da6a9,_0x45174){return _0x1da6a9[_0x6797('0xa')](_0x6797('0xb'),attributes,{'tableName':_0x6797('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb067=['rimraf','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xb067,0xa1));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7b06('0x0'));var util=require(_0x7b06('0x1'));var logger=require(_0x7b06('0x2'))('api');var moment=require(_0x7b06('0x3'));var BPromise=require(_0x7b06('0x4'));var rp=require(_0x7b06('0x5'));var fs=require('fs');var path=require(_0x7b06('0x6'));var rimraf=require(_0x7b06('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b06('0x8'));module[_0x7b06('0x9')]=function(_0x5c3449,_0x2cb4fd){return _0x5c3449[_0x7b06('0xa')]('SquareOdbc',attributes,{'tableName':_0x7b06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index d65d43f..27d2702 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 _0x9556=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model'];(function(_0x574a03,_0x54515d){var _0x2eb536=function(_0x45dd82){while(--_0x45dd82){_0x574a03['push'](_0x574a03['shift']());}};_0x2eb536(++_0x54515d);}(_0x9556,0x16c));var _0x6955=function(_0x9e4d1f,_0x4d8695){_0x9e4d1f=_0x9e4d1f-0x0;var _0x3647a5=_0x9556[_0x9e4d1f];return _0x3647a5;};'use strict';var _=require(_0x6955('0x0'));var util=require(_0x6955('0x1'));var moment=require(_0x6955('0x2'));var BPromise=require('bluebird');var rs=require(_0x6955('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6955('0x4'))['db'];var utils=require(_0x6955('0x5'));var logger=require(_0x6955('0x6'))(_0x6955('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6955('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x540ad5,_0xb84d12,_0x358267){return new BPromise(function(_0x53a5f8,_0x9d939b){return client[_0x6955('0x9')](_0x540ad5,_0x358267)[_0x6955('0xa')](function(_0x413e27){logger['info'](_0x6955('0xb'),_0xb84d12,_0x6955('0xc'));logger[_0x6955('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xb84d12,'request\x20sent',JSON['stringify'](_0x413e27));if(_0x413e27[_0x6955('0xe')]){if(_0x413e27[_0x6955('0xe')][_0x6955('0xf')]===0x1f4){logger[_0x6955('0xe')](_0x6955('0xb'),_0xb84d12,_0x413e27['error'][_0x6955('0x10')]);return _0x9d939b(_0x413e27[_0x6955('0xe')][_0x6955('0x10')]);}logger['error'](_0x6955('0xb'),_0xb84d12,_0x413e27['error'][_0x6955('0x10')]);return _0x53a5f8(_0x413e27[_0x6955('0xe')][_0x6955('0x10')]);}else{logger[_0x6955('0x11')](_0x6955('0xb'),_0xb84d12,_0x6955('0xc'));_0x53a5f8(_0x413e27['result']['message']);}})[_0x6955('0x12')](function(_0x34e8cf){logger[_0x6955('0xe')](_0x6955('0xb'),_0xb84d12,_0x34e8cf);_0x9d939b(_0x34e8cf);});});}exports[_0x6955('0x13')]=function(_0x3b9714){var _0x14c5bb=this;return new Promise(function(_0x47be47,_0x22f3d5){return db[_0x6955('0x14')][_0x6955('0x15')]({'raw':_0x3b9714['options']?_0x3b9714[_0x6955('0x16')][_0x6955('0x17')]===undefined?!![]:![]:!![],'where':_0x3b9714['options']?_0x3b9714[_0x6955('0x16')]['where']||null:null,'attributes':_0x3b9714[_0x6955('0x16')]?_0x3b9714[_0x6955('0x16')][_0x6955('0x18')]||null:null,'include':_0x3b9714[_0x6955('0x16')]?_0x3b9714[_0x6955('0x16')][_0x6955('0x19')]?_[_0x6955('0x1a')](_0x3b9714[_0x6955('0x16')][_0x6955('0x19')],function(_0x14190b){return{'model':db[_0x14190b[_0x6955('0x1b')]],'as':_0x14190b['as'],'attributes':_0x14190b[_0x6955('0x18')],'include':_0x14190b['include']?_[_0x6955('0x1a')](_0x14190b[_0x6955('0x19')],function(_0x2282cf){return{'model':db[_0x2282cf[_0x6955('0x1b')]],'as':_0x2282cf['as'],'attributes':_0x2282cf[_0x6955('0x18')],'include':_0x2282cf['include']?_[_0x6955('0x1a')](_0x2282cf[_0x6955('0x19')],function(_0x23cea5){return{'model':db[_0x23cea5[_0x6955('0x1b')]],'as':_0x23cea5['as'],'attributes':_0x23cea5[_0x6955('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1635ec){logger[_0x6955('0x11')](_0x6955('0x13'),_0x3b9714);logger[_0x6955('0xd')]('ShowSquareOdbc',_0x3b9714,JSON['stringify'](_0x1635ec));_0x47be47(_0x1635ec);})[_0x6955('0x12')](function(_0xba7947){logger['error'](_0x6955('0x13'),_0xba7947['message'],_0x3b9714);_0x22f3d5(_0x14c5bb[_0x6955('0xe')](0x1f4,_0xba7947[_0x6955('0x10')]));});});}; \ No newline at end of file +var _0x0c15=['util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','stringify'];(function(_0x3205e7,_0x30e56f){var _0x33910d=function(_0x1e9648){while(--_0x1e9648){_0x3205e7['push'](_0x3205e7['shift']());}};_0x33910d(++_0x30e56f);}(_0x0c15,0x70));var _0x50c1=function(_0x559d85,_0x5cbcba){_0x559d85=_0x559d85-0x0;var _0x1acc1a=_0x0c15[_0x559d85];return _0x1acc1a;};'use strict';var _=require('lodash');var util=require(_0x50c1('0x0'));var moment=require(_0x50c1('0x1'));var BPromise=require(_0x50c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50c1('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x50c1('0x5'));var client=jayson[_0x50c1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255105,_0x368660,_0x58dda7){return new BPromise(function(_0x2b8027,_0x88e2e0){return client[_0x50c1('0x7')](_0x255105,_0x58dda7)[_0x50c1('0x8')](function(_0x26c137){logger[_0x50c1('0x9')](_0x50c1('0xa'),_0x368660,_0x50c1('0xb'));logger[_0x50c1('0xc')](_0x50c1('0xd'),_0x368660,'request\x20sent',JSON['stringify'](_0x26c137));if(_0x26c137[_0x50c1('0xe')]){if(_0x26c137[_0x50c1('0xe')][_0x50c1('0xf')]===0x1f4){logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x26c137[_0x50c1('0xe')]['message']);return _0x88e2e0(_0x26c137[_0x50c1('0xe')][_0x50c1('0x10')]);}logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x26c137['error'][_0x50c1('0x10')]);return _0x2b8027(_0x26c137['error']['message']);}else{logger[_0x50c1('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x368660,_0x50c1('0xb'));_0x2b8027(_0x26c137['result'][_0x50c1('0x10')]);}})[_0x50c1('0x11')](function(_0x419db9){logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x419db9);_0x88e2e0(_0x419db9);});});}exports[_0x50c1('0x12')]=function(_0x16a944){var _0x53d65b=this;return new Promise(function(_0x2fa835,_0x5a58f2){return db['SquareOdbc'][_0x50c1('0x13')]({'raw':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x15')]===undefined?!![]:![]:!![],'where':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x16')]||null:null,'attributes':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x17')]||null:null,'include':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x16a944[_0x50c1('0x14')][_0x50c1('0x18')],function(_0x5db2bd){return{'model':db[_0x5db2bd[_0x50c1('0x1a')]],'as':_0x5db2bd['as'],'attributes':_0x5db2bd['attributes'],'include':_0x5db2bd[_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x5db2bd[_0x50c1('0x18')],function(_0x5af65a){return{'model':db[_0x5af65a[_0x50c1('0x1a')]],'as':_0x5af65a['as'],'attributes':_0x5af65a[_0x50c1('0x17')],'include':_0x5af65a[_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x5af65a[_0x50c1('0x18')],function(_0x51d682){return{'model':db[_0x51d682[_0x50c1('0x1a')]],'as':_0x51d682['as'],'attributes':_0x51d682[_0x50c1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x181559){logger[_0x50c1('0x9')](_0x50c1('0x12'),_0x16a944);logger[_0x50c1('0xc')]('ShowSquareOdbc',_0x16a944,JSON[_0x50c1('0x1b')](_0x181559));_0x2fa835(_0x181559);})[_0x50c1('0x11')](function(_0x22fbc9){logger[_0x50c1('0xe')](_0x50c1('0x12'),_0x22fbc9[_0x50c1('0x10')],_0x16a944);_0x5a58f2(_0x53d65b[_0x50c1('0xe')](0x1f4,_0x22fbc9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 96362d9..fd8fcea 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 _0x9666=['put','destroy','removeUsers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x9666,0x17a));var _0x6966=function(_0x2324bb,_0x177d52){_0x2324bb=_0x2324bb-0x0;var _0x5d7e03=_0x9666[_0x2324bb];return _0x5d7e03;};'use strict';var multer=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var path=require(_0x6966('0x2'));var timeout=require(_0x6966('0x3'));var express=require('express');var router=express[_0x6966('0x4')]();var fs_extra=require(_0x6966('0x5'));var auth=require(_0x6966('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6966('0x7'));router[_0x6966('0x8')]('/',auth[_0x6966('0x9')](),controller[_0x6966('0xa')]);router[_0x6966('0x8')](_0x6966('0xb'),auth['isAuthenticated'](),controller[_0x6966('0xc')]);router[_0x6966('0x8')](_0x6966('0xd'),auth['isAuthenticated'](),controller[_0x6966('0xe')]);router[_0x6966('0xf')]('/',auth[_0x6966('0x9')](),controller[_0x6966('0x10')]);router[_0x6966('0xf')](_0x6966('0xd'),auth[_0x6966('0x9')](),controller[_0x6966('0x11')]);router[_0x6966('0x12')](_0x6966('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6966('0xb'),auth[_0x6966('0x9')](),controller[_0x6966('0x13')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x6966('0x14')]);module[_0x6966('0x15')]=router; \ No newline at end of file +var _0x1a37=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a37,0x127));var _0x71a3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1a37[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require(_0x71a3('0xa'));router[_0x71a3('0xb')]('/',auth[_0x71a3('0xc')](),controller[_0x71a3('0xd')]);router[_0x71a3('0xb')](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0xf')]);router[_0x71a3('0xb')](_0x71a3('0x10'),auth['isAuthenticated'](),controller[_0x71a3('0x11')]);router[_0x71a3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x71a3('0x12')]('/:id/users',auth[_0x71a3('0xc')](),controller[_0x71a3('0x13')]);router[_0x71a3('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x71a3('0x15')](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0x16')]);router[_0x71a3('0x15')](_0x71a3('0x10'),auth[_0x71a3('0xc')](),controller[_0x71a3('0x17')]);module[_0x71a3('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cfbbc0d..e34fc88 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 _0x5bf7=['STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0xbe2c41,_0x21c0c0){var _0x55374f=function(_0x171fa1){while(--_0x171fa1){_0xbe2c41['push'](_0xbe2c41['shift']());}};_0x55374f(++_0x21c0c0);}(_0x5bf7,0xb4));var _0x75bf=function(_0x48f147,_0x51df56){_0x48f147=_0x48f147-0x0;var _0x4e6cf7=_0x5bf7[_0x48f147];return _0x4e6cf7;};'use strict';var Sequelize=require(_0x75bf('0x0'));module[_0x75bf('0x1')]={'name':{'type':Sequelize[_0x75bf('0x2')],'unique':_0x75bf('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x75bf('0x4')]},'preproduction':{'type':Sequelize[_0x75bf('0x5')](_0x75bf('0x6')),'get':function(){if(this[_0x75bf('0x7')](_0x75bf('0x8'))){return this[_0x75bf('0x7')](_0x75bf('0x8'))[_0x75bf('0x9')](_0x75bf('0xa'));}}},'production':{'type':Sequelize[_0x75bf('0x5')](_0x75bf('0x6')),'get':function(){if(this[_0x75bf('0x7')](_0x75bf('0xb'))){return this[_0x75bf('0x7')](_0x75bf('0xb'))[_0x75bf('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x75bf('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x2517=['production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x2517,0xfe));var _0x7251=function(_0x5a2349,_0x1f0cd4){_0x5a2349=_0x5a2349-0x0;var _0x2a3468=_0x2517[_0x5a2349];return _0x2a3468;};'use strict';var Sequelize=require(_0x7251('0x0'));module[_0x7251('0x1')]={'name':{'type':Sequelize[_0x7251('0x2')],'unique':_0x7251('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7251('0x2')]},'notes':{'type':Sequelize[_0x7251('0x4')]},'preproduction':{'type':Sequelize[_0x7251('0x5')](_0x7251('0x6')),'get':function(){if(this[_0x7251('0x7')]('preproduction')){return this[_0x7251('0x7')](_0x7251('0x8'))[_0x7251('0x9')]('utf8');}}},'production':{'type':Sequelize[_0x7251('0x5')](_0x7251('0x6')),'get':function(){if(this[_0x7251('0x7')](_0x7251('0xa'))){return this[_0x7251('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x7251('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index e1b2922..45c7baa 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 _0x7951=['findOne','User','sort','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','status','send','index','map','SquareProject','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0x7951,0xc6));var _0x1795=function(_0x7275ac,_0x31c0b7){_0x7275ac=_0x7275ac-0x0;var _0x5974e1=_0x7951[_0x7275ac];return _0x5974e1;};'use strict';var emlformat=require(_0x1795('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1795('0x1'));var jsonpatch=require(_0x1795('0x2'));var rp=require(_0x1795('0x3'));var moment=require(_0x1795('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1795('0x5'));var sox=require(_0x1795('0x6'));var csv=require(_0x1795('0x7'));var ejs=require(_0x1795('0x8'));var fs=require('fs');var fs_extra=require(_0x1795('0x9'));var _=require('lodash');var squel=require(_0x1795('0xa'));var crypto=require(_0x1795('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1795('0x7'));var querystring=require(_0x1795('0xc'));var Papa=require(_0x1795('0xd'));var Redis=require(_0x1795('0xe'));var authService=require(_0x1795('0xf'));var qs=require(_0x1795('0x10'));var as=require(_0x1795('0x11'));var hardwareService=require(_0x1795('0x12'));var logger=require(_0x1795('0x13'))('api');var utils=require(_0x1795('0x14'));var config=require(_0x1795('0x15'));var licenseUtil=require(_0x1795('0x16'));var db=require(_0x1795('0x17'))['db'];config[_0x1795('0x18')]=_[_0x1795('0x19')](config[_0x1795('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1795('0x18')]));require(_0x1795('0x1a'))[_0x1795('0x1b')](socket);function respondWithStatusCode(_0x3f2ab7,_0x1ba0c2){_0x1ba0c2=_0x1ba0c2||0xcc;return function(_0x197183){if(_0x197183){return _0x3f2ab7[_0x1795('0x1c')](_0x1ba0c2);}return _0x3f2ab7['status'](_0x1ba0c2)[_0x1795('0x1d')]();};}function respondWithResult(_0x14626a,_0x496a4c){_0x496a4c=_0x496a4c||0xc8;return function(_0x4d1ea9){if(_0x4d1ea9){return _0x14626a['status'](_0x496a4c)['json'](_0x4d1ea9);}};}function respondWithFilteredResult(_0x27b8a4,_0xdb2287){return function(_0x1382fb){if(_0x1382fb){var _0x1a61e8=typeof _0xdb2287[_0x1795('0x1e')]===_0x1795('0x1f')&&typeof _0xdb2287['limit']===_0x1795('0x1f');var _0xc91f72=_0x1382fb[_0x1795('0x20')];var _0x2ca4de=_0x1a61e8?0x0:_0xdb2287[_0x1795('0x1e')];var _0x14b113=_0x1a61e8?_0x1382fb[_0x1795('0x20')]:_0xdb2287[_0x1795('0x1e')]+_0xdb2287[_0x1795('0x21')];var _0x1e07d9;if(_0x14b113>=_0xc91f72){_0x14b113=_0xc91f72;_0x1e07d9=0xc8;}else{_0x1e07d9=0xce;}_0x27b8a4['status'](_0x1e07d9);return _0x27b8a4[_0x1795('0x22')](_0x1795('0x23'),_0x2ca4de+'-'+_0x14b113+'/'+_0xc91f72)[_0x1795('0x24')](_0x1382fb);}return null;};}function patchUpdates(_0x4426af){return function(_0x5d9177){try{jsonpatch['apply'](_0x5d9177,_0x4426af,!![]);}catch(_0x26c821){return BPromise[_0x1795('0x25')](_0x26c821);}return _0x5d9177[_0x1795('0x26')]();};}function saveUpdates(_0x45ed5b,_0xcc7ca4){return function(_0x14eaf5){if(_0x14eaf5){return _0x14eaf5[_0x1795('0x27')](_0x45ed5b)[_0x1795('0x28')](function(_0x263b09){return _0x263b09;});}return null;};}function removeEntity(_0x423ade,_0x257b8f){return function(_0x483714){if(_0x483714){return _0x483714[_0x1795('0x29')]()[_0x1795('0x28')](function(){var _0x4917e0=_0x483714[_0x1795('0x2a')]({'plain':!![]});var _0x5f7c45='SquareProjects';return db[_0x1795('0x2b')][_0x1795('0x29')]({'where':{'type':_0x5f7c45,'resourceId':_0x4917e0['id']}})[_0x1795('0x28')](function(){return _0x483714;});})['then'](function(){_0x423ade['status'](0xcc)[_0x1795('0x1d')]();});}};}function handleEntityNotFound(_0x6c38b3,_0x6e785c){return function(_0x5e6d7a){if(!_0x5e6d7a){_0x6c38b3[_0x1795('0x1c')](0x194);}return _0x5e6d7a;};}function handleError(_0x160739,_0x46f900){_0x46f900=_0x46f900||0x1f4;return function(_0x43cc12){logger[_0x1795('0x2c')](_0x43cc12[_0x1795('0x2d')]);if(_0x43cc12[_0x1795('0x2e')]){delete _0x43cc12[_0x1795('0x2e')];}_0x160739[_0x1795('0x2f')](_0x46f900)[_0x1795('0x30')](_0x43cc12);};}exports[_0x1795('0x31')]=function(_0x1ad57a,_0x46a459){var _0x2e4174={},_0xa18b={},_0x56d1f5={'count':0x0,'rows':[]};var _0x5b1fe4=_[_0x1795('0x32')](db[_0x1795('0x33')]['rawAttributes'],function(_0x41f63f){return{'name':_0x41f63f[_0x1795('0x34')],'type':_0x41f63f[_0x1795('0x35')]['key']};});_0xa18b[_0x1795('0x36')]=_['map'](_0x5b1fe4,'name');_0xa18b[_0x1795('0x37')]=_[_0x1795('0x38')](_0x1ad57a[_0x1795('0x37')]);_0xa18b['filters']=_[_0x1795('0x39')](_0xa18b[_0x1795('0x36')],_0xa18b[_0x1795('0x37')]);_0x2e4174[_0x1795('0x3a')]=_[_0x1795('0x39')](_0xa18b['model'],qs['fields'](_0x1ad57a[_0x1795('0x37')][_0x1795('0x3b')]));_0x2e4174[_0x1795('0x3a')]=_0x2e4174[_0x1795('0x3a')][_0x1795('0x3c')]?_0x2e4174[_0x1795('0x3a')]:_0xa18b[_0x1795('0x36')];if(!_0x1ad57a['query'][_0x1795('0x3d')](_0x1795('0x3e'))){_0x2e4174[_0x1795('0x21')]=qs[_0x1795('0x21')](_0x1ad57a[_0x1795('0x37')][_0x1795('0x21')]);_0x2e4174[_0x1795('0x1e')]=qs['offset'](_0x1ad57a['query'][_0x1795('0x1e')]);}_0x2e4174[_0x1795('0x3f')]=qs['sort'](_0x1ad57a[_0x1795('0x37')]['sort']);_0x2e4174[_0x1795('0x40')]=qs[_0x1795('0x41')](_['pick'](_0x1ad57a[_0x1795('0x37')],_0xa18b[_0x1795('0x41')]),_0x5b1fe4);if(_0x1ad57a[_0x1795('0x37')][_0x1795('0x42')]){_0x2e4174['where']=_[_0x1795('0x43')](_0x2e4174[_0x1795('0x40')],{'$or':_[_0x1795('0x32')](_0x5b1fe4,function(_0x1f2e44){if(_0x1f2e44[_0x1795('0x35')]!=='VIRTUAL'){var _0x3725eb={};_0x3725eb[_0x1f2e44['name']]={'$like':'%'+_0x1ad57a[_0x1795('0x37')]['filter']+'%'};return _0x3725eb;}})});}_0x2e4174=_[_0x1795('0x43')]({},_0x2e4174,_0x1ad57a[_0x1795('0x44')]);var _0x23bebb={'where':_0x2e4174[_0x1795('0x40')]};return db[_0x1795('0x33')]['count'](_0x23bebb)[_0x1795('0x28')](function(_0x195e03){_0x56d1f5[_0x1795('0x20')]=_0x195e03;if(_0x1ad57a[_0x1795('0x37')][_0x1795('0x45')]){_0x2e4174['include']=[{'all':!![]}];}return db[_0x1795('0x33')][_0x1795('0x46')](_0x2e4174);})[_0x1795('0x28')](function(_0x2f93fa){_0x56d1f5[_0x1795('0x47')]=_0x2f93fa;return _0x56d1f5;})['then'](respondWithFilteredResult(_0x46a459,_0x2e4174))[_0x1795('0x48')](handleError(_0x46a459,null));};exports[_0x1795('0x49')]=function(_0x2c7f55,_0x1536c5){var _0x58f53b={'raw':![],'where':{'id':_0x2c7f55[_0x1795('0x4a')]['id']}},_0x15e789={};_0x15e789['model']=_[_0x1795('0x38')](db['SquareProject']['rawAttributes']);_0x15e789['query']=_[_0x1795('0x38')](_0x2c7f55[_0x1795('0x37')]);_0x15e789[_0x1795('0x41')]=_[_0x1795('0x39')](_0x15e789['model'],_0x15e789[_0x1795('0x37')]);_0x58f53b[_0x1795('0x3a')]=_['intersection'](_0x15e789[_0x1795('0x36')],qs[_0x1795('0x3b')](_0x2c7f55[_0x1795('0x37')][_0x1795('0x3b')]));_0x58f53b[_0x1795('0x3a')]=_0x58f53b[_0x1795('0x3a')][_0x1795('0x3c')]?_0x58f53b[_0x1795('0x3a')]:_0x15e789[_0x1795('0x36')];if(_0x2c7f55[_0x1795('0x37')][_0x1795('0x45')]){_0x58f53b[_0x1795('0x4b')]=[{'all':!![]}];}_0x58f53b=_[_0x1795('0x43')]({},_0x58f53b,_0x2c7f55['options']);return db[_0x1795('0x33')][_0x1795('0x4c')](_0x58f53b)[_0x1795('0x28')](handleEntityNotFound(_0x1536c5,null))[_0x1795('0x28')](respondWithResult(_0x1536c5,null))[_0x1795('0x48')](handleError(_0x1536c5,null));};exports['create']=function(_0x2b155e,_0x538035){return db[_0x1795('0x33')][_0x1795('0x4d')](_0x2b155e[_0x1795('0x4e')],{})['then'](function(_0x314ac3){var _0x3ece2f=_0x2b155e[_0x1795('0x4f')][_0x1795('0x2a')]({'plain':!![]});if(!_0x3ece2f)throw new Error(_0x1795('0x50'));if(_0x3ece2f['role']==='user'){var _0x51e0e3=_0x314ac3[_0x1795('0x2a')]({'plain':!![]});var _0x37c6c3=_0x1795('0x51');return db[_0x1795('0x52')][_0x1795('0x4c')]({'where':{'name':_0x37c6c3,'userProfileId':_0x3ece2f['userProfileId']},'raw':!![]})[_0x1795('0x28')](function(_0x103a8a){if(_0x103a8a&&_0x103a8a[_0x1795('0x53')]===0x0){return db[_0x1795('0x2b')][_0x1795('0x4d')]({'name':_0x51e0e3[_0x1795('0x2e')],'resourceId':_0x51e0e3['id'],'type':_0x103a8a[_0x1795('0x2e')],'sectionId':_0x103a8a['id']},{})['then'](function(){return _0x314ac3;});}else{return _0x314ac3;}})['catch'](function(_0x5b5e48){logger[_0x1795('0x2c')](_0x1795('0x54'),_0x5b5e48);throw _0x5b5e48;});}return _0x314ac3;})[_0x1795('0x28')](respondWithResult(_0x538035,0xc9))[_0x1795('0x48')](handleError(_0x538035,null));};exports['update']=function(_0x49fc04,_0x5f158a){if(_0x49fc04[_0x1795('0x4e')]['id']){delete _0x49fc04[_0x1795('0x4e')]['id'];}return db[_0x1795('0x33')][_0x1795('0x4c')]({'where':{'id':_0x49fc04[_0x1795('0x4a')]['id']}})[_0x1795('0x28')](handleEntityNotFound(_0x5f158a,null))['then'](saveUpdates(_0x49fc04['body'],null))[_0x1795('0x28')](respondWithResult(_0x5f158a,null))['catch'](handleError(_0x5f158a,null));};exports[_0x1795('0x29')]=function(_0x2f55b3,_0x4864ac){return db['SquareProject'][_0x1795('0x4c')]({'where':{'id':_0x2f55b3[_0x1795('0x4a')]['id']}})[_0x1795('0x28')](handleEntityNotFound(_0x4864ac,null))[_0x1795('0x28')](removeEntity(_0x4864ac,null))[_0x1795('0x48')](handleError(_0x4864ac,null));};exports['addUsers']=function(_0x4c5b21,_0x5a0e8f,_0x1f2dbe){return db[_0x1795('0x33')][_0x1795('0x4c')]({'where':{'id':_0x4c5b21[_0x1795('0x4a')]['id']}})[_0x1795('0x28')](handleEntityNotFound(_0x5a0e8f,null))['then'](function(_0x53bb05){if(_0x53bb05){return _0x53bb05[_0x1795('0x55')](_0x4c5b21['body'][_0x1795('0x56')],_[_0x1795('0x57')](_0x4c5b21[_0x1795('0x4e')],[_0x1795('0x56'),'id'])||{});}})[_0x1795('0x28')](respondWithResult(_0x5a0e8f,null))['catch'](handleError(_0x5a0e8f,null));};exports[_0x1795('0x58')]=function(_0x7ad6b8,_0x1c4e31,_0x18942d){return db['SquareProject'][_0x1795('0x4c')]({'where':{'id':_0x7ad6b8[_0x1795('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c4e31,null))['then'](function(_0x34db5c){if(_0x34db5c){return _0x34db5c[_0x1795('0x58')](_0x7ad6b8[_0x1795('0x37')][_0x1795('0x56')])['then'](function(){if(_[_0x1795('0x59')](_0x7ad6b8[_0x1795('0x37')][_0x1795('0x56')])){for(var _0x2ac6b1=0x0;_0x2ac6b1<_0x7ad6b8[_0x1795('0x37')][_0x1795('0x56')][_0x1795('0x3c')];_0x2ac6b1+=0x1){socket[_0x1795('0x5a')](_0x1795('0x5b'),{'UserId':Number(_0x7ad6b8['query']['ids'][_0x2ac6b1]),'SquareProjectId':Number(_0x7ad6b8[_0x1795('0x4a')]['id'])});}}else{socket[_0x1795('0x5a')](_0x1795('0x5b'),{'UserId':Number(_0x7ad6b8[_0x1795('0x37')][_0x1795('0x56')]),'SquareProjectId':Number(_0x7ad6b8[_0x1795('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c4e31,null))[_0x1795('0x48')](handleError(_0x1c4e31,null));};exports[_0x1795('0x5c')]=function(_0xb582ef,_0x56451f,_0x5034c1){var _0x328bb3={};var _0x39f6ba={};var _0x8da95d;var _0x316a5d;return db[_0x1795('0x33')][_0x1795('0x5d')]({'where':{'id':_0xb582ef[_0x1795('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56451f,null))[_0x1795('0x28')](function(_0x298b7d){if(_0x298b7d){_0x8da95d=_0x298b7d;_0x39f6ba[_0x1795('0x36')]=_[_0x1795('0x38')](db[_0x1795('0x5e')]['rawAttributes']);_0x39f6ba['query']=_[_0x1795('0x38')](_0xb582ef['query']);_0x39f6ba[_0x1795('0x41')]=_[_0x1795('0x39')](_0x39f6ba[_0x1795('0x36')],_0x39f6ba[_0x1795('0x37')]);_0x328bb3[_0x1795('0x3a')]=_[_0x1795('0x39')](_0x39f6ba[_0x1795('0x36')],qs[_0x1795('0x3b')](_0xb582ef['query'][_0x1795('0x3b')]));_0x328bb3[_0x1795('0x3a')]=_0x328bb3[_0x1795('0x3a')][_0x1795('0x3c')]?_0x328bb3['attributes']:_0x39f6ba[_0x1795('0x36')];_0x328bb3[_0x1795('0x3f')]=qs['sort'](_0xb582ef[_0x1795('0x37')][_0x1795('0x5f')]);_0x328bb3[_0x1795('0x40')]=qs[_0x1795('0x41')](_[_0x1795('0x60')](_0xb582ef[_0x1795('0x37')],_0x39f6ba[_0x1795('0x41')]));if(_0xb582ef[_0x1795('0x37')][_0x1795('0x42')]){_0x328bb3[_0x1795('0x40')]=_[_0x1795('0x43')](_0x328bb3[_0x1795('0x40')],{'$or':_[_0x1795('0x32')](_0x328bb3[_0x1795('0x3a')],function(_0x4d6e4b){var _0x4df2b5={};_0x4df2b5[_0x4d6e4b]={'$like':'%'+_0xb582ef[_0x1795('0x37')][_0x1795('0x42')]+'%'};return _0x4df2b5;})});}_0x328bb3=_[_0x1795('0x43')]({},_0x328bb3,_0xb582ef[_0x1795('0x44')]);return _0x8da95d[_0x1795('0x5c')](_0x328bb3);}})['then'](function(_0x40ea98){if(_0x40ea98){_0x316a5d=_0x40ea98[_0x1795('0x3c')];if(!_0xb582ef[_0x1795('0x37')][_0x1795('0x3d')](_0x1795('0x3e'))){_0x328bb3['limit']=qs[_0x1795('0x21')](_0xb582ef[_0x1795('0x37')][_0x1795('0x21')]);_0x328bb3[_0x1795('0x1e')]=qs[_0x1795('0x1e')](_0xb582ef['query'][_0x1795('0x1e')]);}return _0x8da95d[_0x1795('0x5c')](_0x328bb3);}})[_0x1795('0x28')](function(_0x10b89a){if(_0x10b89a){return _0x10b89a?{'count':_0x316a5d,'rows':_0x10b89a}:null;}})[_0x1795('0x28')](respondWithResult(_0x56451f,null))[_0x1795('0x48')](handleError(_0x56451f,null));}; \ No newline at end of file +var _0x1c7d=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','keys','User','nolimit','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','get','UserProfileResource','destroy','end','error','name','send','index','map','SquareProject','rawAttributes','type','key','query','filters','intersection','attributes','fields','length','model'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x1c7d,0x13b));var _0xd1c7=function(_0x34db7f,_0x3e22f8){_0x34db7f=_0x34db7f-0x0;var _0x509554=_0x1c7d[_0x34db7f];return _0x509554;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd1c7('0x0'));var rp=require('request-promise');var moment=require(_0xd1c7('0x1'));var BPromise=require(_0xd1c7('0x2'));var Mustache=require(_0xd1c7('0x3'));var util=require('util');var path=require(_0xd1c7('0x4'));var sox=require('sox');var csv=require(_0xd1c7('0x5'));var ejs=require(_0xd1c7('0x6'));var fs=require('fs');var fs_extra=require(_0xd1c7('0x7'));var _=require(_0xd1c7('0x8'));var squel=require(_0xd1c7('0x9'));var crypto=require(_0xd1c7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd1c7('0xb'));var toCsv=require(_0xd1c7('0x5'));var querystring=require('querystring');var Papa=require(_0xd1c7('0xc'));var Redis=require(_0xd1c7('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd1c7('0xe'));var hardwareService=require(_0xd1c7('0xf'));var logger=require(_0xd1c7('0x10'))(_0xd1c7('0x11'));var utils=require(_0xd1c7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd1c7('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd1c7('0x14')](config[_0xd1c7('0x15')],{'host':_0xd1c7('0x16'),'port':0x18eb});var socket=require(_0xd1c7('0x17'))(new Redis(config[_0xd1c7('0x15')]));require(_0xd1c7('0x18'))[_0xd1c7('0x19')](socket);function respondWithStatusCode(_0x4d38a7,_0x150edb){_0x150edb=_0x150edb||0xcc;return function(_0x16cce8){if(_0x16cce8){return _0x4d38a7[_0xd1c7('0x1a')](_0x150edb);}return _0x4d38a7[_0xd1c7('0x1b')](_0x150edb)['end']();};}function respondWithResult(_0x4db6bc,_0x47704c){_0x47704c=_0x47704c||0xc8;return function(_0x4f8ebf){if(_0x4f8ebf){return _0x4db6bc[_0xd1c7('0x1b')](_0x47704c)[_0xd1c7('0x1c')](_0x4f8ebf);}};}function respondWithFilteredResult(_0x15870e,_0x293f5e){return function(_0xb091da){if(_0xb091da){var _0x2902b6=typeof _0x293f5e[_0xd1c7('0x1d')]==='undefined'&&typeof _0x293f5e[_0xd1c7('0x1e')]===_0xd1c7('0x1f');var _0x204d92=_0xb091da[_0xd1c7('0x20')];var _0x52ea2a=_0x2902b6?0x0:_0x293f5e['offset'];var _0x558512=_0x2902b6?_0xb091da[_0xd1c7('0x20')]:_0x293f5e['offset']+_0x293f5e[_0xd1c7('0x1e')];var _0x1323d5;if(_0x558512>=_0x204d92){_0x558512=_0x204d92;_0x1323d5=0xc8;}else{_0x1323d5=0xce;}_0x15870e[_0xd1c7('0x1b')](_0x1323d5);return _0x15870e[_0xd1c7('0x21')]('Content-Range',_0x52ea2a+'-'+_0x558512+'/'+_0x204d92)['json'](_0xb091da);}return null;};}function patchUpdates(_0x1c6428){return function(_0x568448){try{jsonpatch[_0xd1c7('0x22')](_0x568448,_0x1c6428,!![]);}catch(_0x17edae){return BPromise['reject'](_0x17edae);}return _0x568448[_0xd1c7('0x23')]();};}function saveUpdates(_0x42297e,_0x1f3c57){return function(_0x39c13e){if(_0x39c13e){return _0x39c13e[_0xd1c7('0x24')](_0x42297e)['then'](function(_0x5ed1e8){return _0x5ed1e8;});}return null;};}function removeEntity(_0xa098a9,_0x4b5f15){return function(_0x5c5c2c){if(_0x5c5c2c){return _0x5c5c2c['destroy']()['then'](function(){var _0x20dbf8=_0x5c5c2c[_0xd1c7('0x25')]({'plain':!![]});var _0x514a00='SquareProjects';return db[_0xd1c7('0x26')][_0xd1c7('0x27')]({'where':{'type':_0x514a00,'resourceId':_0x20dbf8['id']}})['then'](function(){return _0x5c5c2c;});})['then'](function(){_0xa098a9[_0xd1c7('0x1b')](0xcc)[_0xd1c7('0x28')]();});}};}function handleEntityNotFound(_0x27662b,_0x58336e){return function(_0x1eb860){if(!_0x1eb860){_0x27662b[_0xd1c7('0x1a')](0x194);}return _0x1eb860;};}function handleError(_0x301c1d,_0x2d41d0){_0x2d41d0=_0x2d41d0||0x1f4;return function(_0x2e78a9){logger[_0xd1c7('0x29')](_0x2e78a9['stack']);if(_0x2e78a9[_0xd1c7('0x2a')]){delete _0x2e78a9[_0xd1c7('0x2a')];}_0x301c1d['status'](_0x2d41d0)[_0xd1c7('0x2b')](_0x2e78a9);};}exports[_0xd1c7('0x2c')]=function(_0x1478d0,_0x421916){var _0x1d609b={},_0x562635={},_0x2c76cd={'count':0x0,'rows':[]};var _0x5801ea=_[_0xd1c7('0x2d')](db[_0xd1c7('0x2e')][_0xd1c7('0x2f')],function(_0x5ca939){return{'name':_0x5ca939['fieldName'],'type':_0x5ca939[_0xd1c7('0x30')][_0xd1c7('0x31')]};});_0x562635['model']=_[_0xd1c7('0x2d')](_0x5801ea,_0xd1c7('0x2a'));_0x562635[_0xd1c7('0x32')]=_['keys'](_0x1478d0[_0xd1c7('0x32')]);_0x562635[_0xd1c7('0x33')]=_[_0xd1c7('0x34')](_0x562635['model'],_0x562635[_0xd1c7('0x32')]);_0x1d609b[_0xd1c7('0x35')]=_[_0xd1c7('0x34')](_0x562635['model'],qs[_0xd1c7('0x36')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x1d609b[_0xd1c7('0x35')]=_0x1d609b[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x1d609b['attributes']:_0x562635[_0xd1c7('0x38')];if(!_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x39')]('nolimit')){_0x1d609b[_0xd1c7('0x1e')]=qs[_0xd1c7('0x1e')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x1e')]);_0x1d609b['offset']=qs['offset'](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x1d')]);}_0x1d609b[_0xd1c7('0x3a')]=qs[_0xd1c7('0x3b')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3b')]);_0x1d609b[_0xd1c7('0x3c')]=qs[_0xd1c7('0x33')](_[_0xd1c7('0x3d')](_0x1478d0[_0xd1c7('0x32')],_0x562635['filters']),_0x5801ea);if(_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3e')]){_0x1d609b[_0xd1c7('0x3c')]=_[_0xd1c7('0x3f')](_0x1d609b[_0xd1c7('0x3c')],{'$or':_['map'](_0x5801ea,function(_0x4afd67){if(_0x4afd67[_0xd1c7('0x30')]!==_0xd1c7('0x40')){var _0x4edfd0={};_0x4edfd0[_0x4afd67[_0xd1c7('0x2a')]]={'$like':'%'+_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3e')]+'%'};return _0x4edfd0;}})});}_0x1d609b=_['merge']({},_0x1d609b,_0x1478d0[_0xd1c7('0x41')]);var _0x46d05b={'where':_0x1d609b[_0xd1c7('0x3c')]};return db['SquareProject'][_0xd1c7('0x20')](_0x46d05b)[_0xd1c7('0x42')](function(_0x2da2fe){_0x2c76cd['count']=_0x2da2fe;if(_0x1478d0[_0xd1c7('0x32')]['includeAll']){_0x1d609b['include']=[{'all':!![]}];}return db[_0xd1c7('0x2e')][_0xd1c7('0x43')](_0x1d609b);})[_0xd1c7('0x42')](function(_0x124485){_0x2c76cd['rows']=_0x124485;return _0x2c76cd;})[_0xd1c7('0x42')](respondWithFilteredResult(_0x421916,_0x1d609b))[_0xd1c7('0x44')](handleError(_0x421916,null));};exports[_0xd1c7('0x45')]=function(_0x7dcf48,_0x19392c){var _0x3e3237={'raw':![],'where':{'id':_0x7dcf48[_0xd1c7('0x46')]['id']}},_0x2a84f5={};_0x2a84f5[_0xd1c7('0x38')]=_['keys'](db['SquareProject']['rawAttributes']);_0x2a84f5[_0xd1c7('0x32')]=_['keys'](_0x7dcf48[_0xd1c7('0x32')]);_0x2a84f5[_0xd1c7('0x33')]=_['intersection'](_0x2a84f5[_0xd1c7('0x38')],_0x2a84f5[_0xd1c7('0x32')]);_0x3e3237['attributes']=_[_0xd1c7('0x34')](_0x2a84f5[_0xd1c7('0x38')],qs['fields'](_0x7dcf48[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x3e3237[_0xd1c7('0x35')]=_0x3e3237[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x3e3237[_0xd1c7('0x35')]:_0x2a84f5[_0xd1c7('0x38')];if(_0x7dcf48[_0xd1c7('0x32')][_0xd1c7('0x47')]){_0x3e3237[_0xd1c7('0x48')]=[{'all':!![]}];}_0x3e3237=_['merge']({},_0x3e3237,_0x7dcf48[_0xd1c7('0x41')]);return db[_0xd1c7('0x2e')][_0xd1c7('0x49')](_0x3e3237)[_0xd1c7('0x42')](handleEntityNotFound(_0x19392c,null))[_0xd1c7('0x42')](respondWithResult(_0x19392c,null))[_0xd1c7('0x44')](handleError(_0x19392c,null));};exports[_0xd1c7('0x4a')]=function(_0x564bf0,_0x479c71){return db[_0xd1c7('0x2e')]['create'](_0x564bf0[_0xd1c7('0x4b')],{})[_0xd1c7('0x42')](function(_0x3eb836){var _0x3a2a12=_0x564bf0['user'][_0xd1c7('0x25')]({'plain':!![]});if(!_0x3a2a12)throw new Error(_0xd1c7('0x4c'));if(_0x3a2a12['role']===_0xd1c7('0x4d')){var _0x1b5824=_0x3eb836['get']({'plain':!![]});var _0x2747ca=_0xd1c7('0x4e');return db[_0xd1c7('0x4f')][_0xd1c7('0x49')]({'where':{'name':_0x2747ca,'userProfileId':_0x3a2a12[_0xd1c7('0x50')]},'raw':!![]})[_0xd1c7('0x42')](function(_0x9c0a48){if(_0x9c0a48&&_0x9c0a48['autoAssociation']===0x0){return db[_0xd1c7('0x26')][_0xd1c7('0x4a')]({'name':_0x1b5824[_0xd1c7('0x2a')],'resourceId':_0x1b5824['id'],'type':_0x9c0a48[_0xd1c7('0x2a')],'sectionId':_0x9c0a48['id']},{})['then'](function(){return _0x3eb836;});}else{return _0x3eb836;}})[_0xd1c7('0x44')](function(_0x97752f){logger[_0xd1c7('0x29')](_0xd1c7('0x51'),_0x97752f);throw _0x97752f;});}return _0x3eb836;})[_0xd1c7('0x42')](respondWithResult(_0x479c71,0xc9))['catch'](handleError(_0x479c71,null));};exports[_0xd1c7('0x24')]=function(_0x4a44b1,_0x1f0365){if(_0x4a44b1[_0xd1c7('0x4b')]['id']){delete _0x4a44b1[_0xd1c7('0x4b')]['id'];}return db['SquareProject'][_0xd1c7('0x49')]({'where':{'id':_0x4a44b1['params']['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x1f0365,null))[_0xd1c7('0x42')](saveUpdates(_0x4a44b1[_0xd1c7('0x4b')],null))['then'](respondWithResult(_0x1f0365,null))['catch'](handleError(_0x1f0365,null));};exports[_0xd1c7('0x27')]=function(_0x396b9b,_0x1c9214){return db['SquareProject'][_0xd1c7('0x49')]({'where':{'id':_0x396b9b['params']['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x1c9214,null))['then'](removeEntity(_0x1c9214,null))[_0xd1c7('0x44')](handleError(_0x1c9214,null));};exports[_0xd1c7('0x52')]=function(_0x34f7f9,_0x351cff,_0x85a699){return db['SquareProject']['find']({'where':{'id':_0x34f7f9[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x351cff,null))[_0xd1c7('0x42')](function(_0x37a651){if(_0x37a651){return _0x37a651[_0xd1c7('0x52')](_0x34f7f9['body']['ids'],_[_0xd1c7('0x53')](_0x34f7f9[_0xd1c7('0x4b')],[_0xd1c7('0x54'),'id'])||{});}})[_0xd1c7('0x42')](respondWithResult(_0x351cff,null))[_0xd1c7('0x44')](handleError(_0x351cff,null));};exports[_0xd1c7('0x55')]=function(_0x13e0f6,_0x330de1,_0x25adee){return db[_0xd1c7('0x2e')][_0xd1c7('0x49')]({'where':{'id':_0x13e0f6[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x330de1,null))[_0xd1c7('0x42')](function(_0x9b12d5){if(_0x9b12d5){return _0x9b12d5['removeUsers'](_0x13e0f6[_0xd1c7('0x32')]['ids'])[_0xd1c7('0x42')](function(){if(_['isArray'](_0x13e0f6['query'][_0xd1c7('0x54')])){for(var _0xcb29c=0x0;_0xcb29c<_0x13e0f6[_0xd1c7('0x32')][_0xd1c7('0x54')]['length'];_0xcb29c+=0x1){socket[_0xd1c7('0x56')](_0xd1c7('0x57'),{'UserId':Number(_0x13e0f6['query'][_0xd1c7('0x54')][_0xcb29c]),'SquareProjectId':Number(_0x13e0f6[_0xd1c7('0x46')]['id'])});}}else{socket[_0xd1c7('0x56')](_0xd1c7('0x57'),{'UserId':Number(_0x13e0f6['query'][_0xd1c7('0x54')]),'SquareProjectId':Number(_0x13e0f6[_0xd1c7('0x46')]['id'])});}});}})[_0xd1c7('0x42')](respondWithStatusCode(_0x330de1,null))['catch'](handleError(_0x330de1,null));};exports[_0xd1c7('0x58')]=function(_0x19f4ea,_0x16ae7d,_0x5c8820){var _0x4a7d08={};var _0x494d73={};var _0x38f853;var _0x33f095;return db['SquareProject'][_0xd1c7('0x59')]({'where':{'id':_0x19f4ea[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x16ae7d,null))['then'](function(_0x1d073a){if(_0x1d073a){_0x38f853=_0x1d073a;_0x494d73[_0xd1c7('0x38')]=_[_0xd1c7('0x5a')](db[_0xd1c7('0x5b')]['rawAttributes']);_0x494d73[_0xd1c7('0x32')]=_['keys'](_0x19f4ea[_0xd1c7('0x32')]);_0x494d73[_0xd1c7('0x33')]=_[_0xd1c7('0x34')](_0x494d73['model'],_0x494d73[_0xd1c7('0x32')]);_0x4a7d08[_0xd1c7('0x35')]=_[_0xd1c7('0x34')](_0x494d73['model'],qs[_0xd1c7('0x36')](_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x4a7d08[_0xd1c7('0x35')]=_0x4a7d08[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x4a7d08['attributes']:_0x494d73['model'];_0x4a7d08[_0xd1c7('0x3a')]=qs[_0xd1c7('0x3b')](_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3b')]);_0x4a7d08[_0xd1c7('0x3c')]=qs['filters'](_[_0xd1c7('0x3d')](_0x19f4ea[_0xd1c7('0x32')],_0x494d73[_0xd1c7('0x33')]));if(_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3e')]){_0x4a7d08[_0xd1c7('0x3c')]=_[_0xd1c7('0x3f')](_0x4a7d08[_0xd1c7('0x3c')],{'$or':_[_0xd1c7('0x2d')](_0x4a7d08['attributes'],function(_0x168962){var _0x5b890f={};_0x5b890f[_0x168962]={'$like':'%'+_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3e')]+'%'};return _0x5b890f;})});}_0x4a7d08=_[_0xd1c7('0x3f')]({},_0x4a7d08,_0x19f4ea[_0xd1c7('0x41')]);return _0x38f853[_0xd1c7('0x58')](_0x4a7d08);}})[_0xd1c7('0x42')](function(_0x5ae102){if(_0x5ae102){_0x33f095=_0x5ae102['length'];if(!_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x39')](_0xd1c7('0x5c'))){_0x4a7d08[_0xd1c7('0x1e')]=qs[_0xd1c7('0x1e')](_0x19f4ea[_0xd1c7('0x32')]['limit']);_0x4a7d08['offset']=qs['offset'](_0x19f4ea[_0xd1c7('0x32')]['offset']);}return _0x38f853[_0xd1c7('0x58')](_0x4a7d08);}})[_0xd1c7('0x42')](function(_0x531763){if(_0x531763){return _0x531763?{'count':_0x33f095,'rows':_0x531763}:null;}})[_0xd1c7('0x42')](respondWithResult(_0x16ae7d,null))[_0xd1c7('0x44')](handleError(_0x16ae7d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e88795d..d879fa6 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 _0x9aab=['setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb','SquareProject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9aab,0x136));var _0xb9aa=function(_0x4a1395,_0x1f4c7c){_0x4a1395=_0x4a1395-0x0;var _0x589111=_0x9aab[_0x4a1395];return _0x589111;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb9aa('0x0'))['db'][_0xb9aa('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb9aa('0x2')](0x0);var events={'afterCreate':_0xb9aa('0x3'),'afterUpdate':_0xb9aa('0x4'),'afterDestroy':'remove'};function emitEvent(_0x283357){return function(_0x26045d,_0xb8a487,_0x115846){SquareProjectEvents[_0xb9aa('0x5')](_0x283357+':'+_0x26045d['id'],_0x26045d);SquareProjectEvents[_0xb9aa('0x5')](_0x283357,_0x26045d);_0x115846(null);};}for(var e in events){if(events[_0xb9aa('0x6')](e)){var event=events[e];SquareProject[_0xb9aa('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x5841=['events','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x5841,0xb4));var _0x1584=function(_0x5d5729,_0x41e56c){_0x5d5729=_0x5d5729-0x0;var _0x84e642=_0x5841[_0x5d5729];return _0x84e642;};'use strict';var EventEmitter=require(_0x1584('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x1584('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1584('0x2')](0x0);var events={'afterCreate':_0x1584('0x3'),'afterUpdate':_0x1584('0x4'),'afterDestroy':_0x1584('0x5')};function emitEvent(_0x411aea){return function(_0x578fa1,_0x5d8896,_0x4e51ce){SquareProjectEvents['emit'](_0x411aea+':'+_0x578fa1['id'],_0x578fa1);SquareProjectEvents[_0x1584('0x6')](_0x411aea,_0x578fa1);_0x4e51ce(null);};}for(var e in events){if(events[_0x1584('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x1584('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c2e824b..e1aedb1 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 _0x3d9c=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed'];(function(_0x4ca5d1,_0x32839f){var _0x58862e=function(_0x6a622d){while(--_0x6a622d){_0x4ca5d1['push'](_0x4ca5d1['shift']());}};_0x58862e(++_0x32839f);}(_0x3d9c,0x123));var _0xc3d9=function(_0x1336a6,_0x3a3331){_0x1336a6=_0x1336a6-0x0;var _0x1b6ea6=_0x3d9c[_0x1336a6];return _0x1b6ea6;};'use strict';var _=require(_0xc3d9('0x0'));var util=require(_0xc3d9('0x1'));var logger=require(_0xc3d9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3d9('0x3'));var rp=require(_0xc3d9('0x4'));var fs=require('fs');var path=require(_0xc3d9('0x5'));var rimraf=require(_0xc3d9('0x6'));var config=require(_0xc3d9('0x7'));var attributes=require(_0xc3d9('0x8'));module['exports']=function(_0x49b981,_0xc768f7){return _0x49b981[_0xc3d9('0x9')](_0xc3d9('0xa'),attributes,{'tableName':_0xc3d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57d336,_0x590572,_0x4c95db){if(_0x57d336[_0xc3d9('0xc')](_0xc3d9('0xd'))){_0x57d336[_0xc3d9('0xe')]=moment()[_0xc3d9('0xf')](_0xc3d9('0x10'));}if(_0x57d336[_0xc3d9('0xc')](_0xc3d9('0x11'))){_0x57d336[_0xc3d9('0x12')]=moment()[_0xc3d9('0xf')](_0xc3d9('0x10'));}_0x4c95db(null,_0x57d336);}}});}; \ No newline at end of file +var _0x02b5=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareProject','square_projects'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x02b5,0x137));var _0x502b=function(_0x4e3b0f,_0x42ddb7){_0x4e3b0f=_0x4e3b0f-0x0;var _0x1d6059=_0x02b5[_0x4e3b0f];return _0x1d6059;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var logger=require('../../config/logger')(_0x502b('0x2'));var moment=require(_0x502b('0x3'));var BPromise=require(_0x502b('0x4'));var rp=require(_0x502b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x502b('0x6'));var config=require(_0x502b('0x7'));var attributes=require('./squareProject.attributes');module[_0x502b('0x8')]=function(_0x1bae7a,_0x18905e){return _0x1bae7a[_0x502b('0x9')](_0x502b('0xa'),attributes,{'tableName':_0x502b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ba83a,_0x270b32,_0x7be9f3){if(_0x1ba83a[_0x502b('0xc')](_0x502b('0xd'))){_0x1ba83a[_0x502b('0xe')]=moment()[_0x502b('0xf')](_0x502b('0x10'));}if(_0x1ba83a[_0x502b('0xc')](_0x502b('0x11'))){_0x1ba83a[_0x502b('0x12')]=moment()[_0x502b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7be9f3(null,_0x1ba83a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 46cd833..84165db 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 _0xf755=['../../mysqldb','../../config/logger','jayson/promise','http','defaults','redis','localhost','./squareProject.socket','register','request','then','info','request\x20sent','debug','error','code','message','SquareProject,\x20%s,\x20%s','result','ShowSquareProject','SquareProject','options','raw','where','include','map','model','attributes','stringify','util'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xf755,0x95));var _0x5f75=function(_0x36d851,_0x58e79a){_0x36d851=_0x36d851-0x0;var _0x7f4b6b=_0xf755[_0x36d851];return _0x7f4b6b;};'use strict';var _=require('lodash');var util=require(_0x5f75('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f75('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f75('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f75('0x3'));var client=jayson['client'][_0x5f75('0x4')]({'port':0x232a});config['redis']=_[_0x5f75('0x5')](config[_0x5f75('0x6')],{'host':_0x5f75('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f75('0x6')]));require(_0x5f75('0x8'))[_0x5f75('0x9')](socket);function respondWithRpcPromise(_0x1f4a0b,_0x206522,_0x258b38){return new BPromise(function(_0x1eb49f,_0x3ce1f8){return client[_0x5f75('0xa')](_0x1f4a0b,_0x258b38)[_0x5f75('0xb')](function(_0x12203e){logger[_0x5f75('0xc')]('SquareProject,\x20%s,\x20%s',_0x206522,_0x5f75('0xd'));logger[_0x5f75('0xe')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x206522,_0x5f75('0xd'),JSON['stringify'](_0x12203e));if(_0x12203e[_0x5f75('0xf')]){if(_0x12203e[_0x5f75('0xf')][_0x5f75('0x10')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x206522,_0x12203e['error'][_0x5f75('0x11')]);return _0x3ce1f8(_0x12203e[_0x5f75('0xf')][_0x5f75('0x11')]);}logger[_0x5f75('0xf')](_0x5f75('0x12'),_0x206522,_0x12203e[_0x5f75('0xf')]['message']);return _0x1eb49f(_0x12203e['error'][_0x5f75('0x11')]);}else{logger[_0x5f75('0xc')](_0x5f75('0x12'),_0x206522,'request\x20sent');_0x1eb49f(_0x12203e[_0x5f75('0x13')][_0x5f75('0x11')]);}})['catch'](function(_0xf91298){logger[_0x5f75('0xf')]('SquareProject,\x20%s,\x20%s',_0x206522,_0xf91298);_0x3ce1f8(_0xf91298);});});}exports[_0x5f75('0x14')]=function(_0x50c408){var _0x35cd4c=this;return new Promise(function(_0x6e72aa,_0x5475ac){return db[_0x5f75('0x15')]['find']({'raw':_0x50c408[_0x5f75('0x16')]?_0x50c408[_0x5f75('0x16')][_0x5f75('0x17')]===undefined?!![]:![]:!![],'where':_0x50c408[_0x5f75('0x16')]?_0x50c408[_0x5f75('0x16')][_0x5f75('0x18')]||null:null,'attributes':_0x50c408[_0x5f75('0x16')]?_0x50c408[_0x5f75('0x16')]['attributes']||null:null,'include':_0x50c408['options']?_0x50c408[_0x5f75('0x16')][_0x5f75('0x19')]?_[_0x5f75('0x1a')](_0x50c408[_0x5f75('0x16')]['include'],function(_0x375550){return{'model':db[_0x375550[_0x5f75('0x1b')]],'as':_0x375550['as'],'attributes':_0x375550[_0x5f75('0x1c')],'include':_0x375550[_0x5f75('0x19')]?_[_0x5f75('0x1a')](_0x375550[_0x5f75('0x19')],function(_0x1e9d8c){return{'model':db[_0x1e9d8c['model']],'as':_0x1e9d8c['as'],'attributes':_0x1e9d8c[_0x5f75('0x1c')],'include':_0x1e9d8c[_0x5f75('0x19')]?_[_0x5f75('0x1a')](_0x1e9d8c['include'],function(_0x250ea9){return{'model':db[_0x250ea9[_0x5f75('0x1b')]],'as':_0x250ea9['as'],'attributes':_0x250ea9[_0x5f75('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5f75('0xb')](function(_0x30fdb4){logger[_0x5f75('0xc')]('ShowSquareProject',_0x50c408);logger['debug']('ShowSquareProject',_0x50c408,JSON[_0x5f75('0x1d')](_0x30fdb4));_0x6e72aa(_0x30fdb4);})['catch'](function(_0x20212a){logger[_0x5f75('0xf')]('ShowSquareProject',_0x20212a[_0x5f75('0x11')],_0x50c408);_0x5475ac(_0x35cd4c[_0x5f75('0xf')](0x1f4,_0x20212a[_0x5f75('0x11')]));});});}; \ No newline at end of file +var _0x6378=['defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x23415f,_0x415f79){var _0x1e977f=function(_0x2da5b3){while(--_0x2da5b3){_0x23415f['push'](_0x23415f['shift']());}};_0x1e977f(++_0x415f79);}(_0x6378,0x184));var _0x8637=function(_0x1149aa,_0x41ff45){_0x1149aa=_0x1149aa-0x0;var _0x337d31=_0x6378[_0x1149aa];return _0x337d31;};'use strict';var _=require(_0x8637('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8637('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8637('0x2'));var db=require(_0x8637('0x3'))['db'];var utils=require(_0x8637('0x4'));var logger=require(_0x8637('0x5'))(_0x8637('0x6'));var config=require(_0x8637('0x7'));var jayson=require(_0x8637('0x8'));var client=jayson[_0x8637('0x9')][_0x8637('0xa')]({'port':0x232a});config[_0x8637('0xb')]=_[_0x8637('0xc')](config[_0x8637('0xb')],{'host':_0x8637('0xd'),'port':0x18eb});var socket=require(_0x8637('0xe'))(new Redis(config[_0x8637('0xb')]));require(_0x8637('0xf'))[_0x8637('0x10')](socket);function respondWithRpcPromise(_0x2f16e6,_0x952a5,_0x2cbcaf){return new BPromise(function(_0x12bdc9,_0x48e18d){return client[_0x8637('0x11')](_0x2f16e6,_0x2cbcaf)['then'](function(_0x449f51){logger[_0x8637('0x12')](_0x8637('0x13'),_0x952a5,_0x8637('0x14'));logger['debug'](_0x8637('0x15'),_0x952a5,_0x8637('0x14'),JSON[_0x8637('0x16')](_0x449f51));if(_0x449f51[_0x8637('0x17')]){if(_0x449f51[_0x8637('0x17')][_0x8637('0x18')]===0x1f4){logger[_0x8637('0x17')]('SquareProject,\x20%s,\x20%s',_0x952a5,_0x449f51['error']['message']);return _0x48e18d(_0x449f51['error'][_0x8637('0x19')]);}logger[_0x8637('0x17')]('SquareProject,\x20%s,\x20%s',_0x952a5,_0x449f51[_0x8637('0x17')][_0x8637('0x19')]);return _0x12bdc9(_0x449f51['error'][_0x8637('0x19')]);}else{logger[_0x8637('0x12')]('SquareProject,\x20%s,\x20%s',_0x952a5,'request\x20sent');_0x12bdc9(_0x449f51[_0x8637('0x1a')][_0x8637('0x19')]);}})[_0x8637('0x1b')](function(_0x2b345a){logger[_0x8637('0x17')](_0x8637('0x13'),_0x952a5,_0x2b345a);_0x48e18d(_0x2b345a);});});}exports[_0x8637('0x1c')]=function(_0x4dd473){var _0x3240da=this;return new Promise(function(_0x259706,_0xff42d5){return db[_0x8637('0x1d')][_0x8637('0x1e')]({'raw':_0x4dd473[_0x8637('0x1f')]?_0x4dd473[_0x8637('0x1f')][_0x8637('0x20')]===undefined?!![]:![]:!![],'where':_0x4dd473['options']?_0x4dd473[_0x8637('0x1f')][_0x8637('0x21')]||null:null,'attributes':_0x4dd473[_0x8637('0x1f')]?_0x4dd473[_0x8637('0x1f')][_0x8637('0x22')]||null:null,'include':_0x4dd473[_0x8637('0x1f')]?_0x4dd473['options'][_0x8637('0x23')]?_[_0x8637('0x24')](_0x4dd473[_0x8637('0x1f')][_0x8637('0x23')],function(_0x56c1c5){return{'model':db[_0x56c1c5[_0x8637('0x25')]],'as':_0x56c1c5['as'],'attributes':_0x56c1c5[_0x8637('0x22')],'include':_0x56c1c5['include']?_[_0x8637('0x24')](_0x56c1c5[_0x8637('0x23')],function(_0x165e70){return{'model':db[_0x165e70[_0x8637('0x25')]],'as':_0x165e70['as'],'attributes':_0x165e70[_0x8637('0x22')],'include':_0x165e70[_0x8637('0x23')]?_[_0x8637('0x24')](_0x165e70['include'],function(_0x4b0039){return{'model':db[_0x4b0039[_0x8637('0x25')]],'as':_0x4b0039['as'],'attributes':_0x4b0039[_0x8637('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8637('0x26')](function(_0x4a5163){logger[_0x8637('0x12')](_0x8637('0x1c'),_0x4dd473);logger[_0x8637('0x27')]('ShowSquareProject',_0x4dd473,JSON[_0x8637('0x16')](_0x4a5163));_0x259706(_0x4a5163);})[_0x8637('0x1b')](function(_0x290825){logger[_0x8637('0x17')]('ShowSquareProject',_0x290825['message'],_0x4dd473);_0xff42d5(_0x3240da['error'](0x1f4,_0x290825['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index eb005e2..4419c7c 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 _0x52de=['register','length','squareProject:','remove','update','emit'];(function(_0x5dbfe5,_0x1e00fc){var _0x3bb340=function(_0x303f9e){while(--_0x303f9e){_0x5dbfe5['push'](_0x5dbfe5['shift']());}};_0x3bb340(++_0x1e00fc);}(_0x52de,0x183));var _0xe52d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x52de[_0x321bb2];return _0x9c12ed;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xe52d('0x0'),_0xe52d('0x1')];function createListener(_0x5bac06,_0x5cc0a7){return function(_0x590eb7){_0x5cc0a7[_0xe52d('0x2')](_0x5bac06,_0x590eb7);};}function removeListener(_0x58294b,_0x35e4ad){return function(){SquareProjectEvents['removeListener'](_0x58294b,_0x35e4ad);};}exports[_0xe52d('0x3')]=function(_0x420b33){for(var _0x70a1c9=0x0,_0x5c33d1=events[_0xe52d('0x4')];_0x70a1c9<_0x5c33d1;_0x70a1c9++){var _0x204d85=events[_0x70a1c9];var _0x749a1=createListener(_0xe52d('0x5')+_0x204d85,_0x420b33);SquareProjectEvents['on'](_0x204d85,_0x749a1);}}; \ No newline at end of file +var _0x7b2e=['emit','register','length','squareProject:','./squareProject.events','save','update'];(function(_0x953b57,_0x11dd4e){var _0x258479=function(_0x3dbc3b){while(--_0x3dbc3b){_0x953b57['push'](_0x953b57['shift']());}};_0x258479(++_0x11dd4e);}(_0x7b2e,0x162));var _0xe7b2=function(_0x266ec6,_0x44e3ca){_0x266ec6=_0x266ec6-0x0;var _0x5f1f59=_0x7b2e[_0x266ec6];return _0x5f1f59;};'use strict';var SquareProjectEvents=require(_0xe7b2('0x0'));var events=[_0xe7b2('0x1'),'remove',_0xe7b2('0x2')];function createListener(_0x17ac6d,_0x3f6f2c){return function(_0x22f4c6){_0x3f6f2c[_0xe7b2('0x3')](_0x17ac6d,_0x22f4c6);};}function removeListener(_0x281bea,_0x1b370a){return function(){SquareProjectEvents['removeListener'](_0x281bea,_0x1b370a);};}exports[_0xe7b2('0x4')]=function(_0x4940e8){for(var _0x498dfa=0x0,_0xd26ef1=events[_0xe7b2('0x5')];_0x498dfa<_0xd26ef1;_0x498dfa++){var _0x58e499=events[_0x498dfa];var _0x1004a4=createListener(_0xe7b2('0x6')+_0x58e499,_0x4940e8);SquareProjectEvents['on'](_0x58e499,_0x1004a4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 32a5f2c..5816053 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x404195,_0x39420e){var _0x557115=function(_0xa530c3){while(--_0xa530c3){_0x404195['push'](_0x404195['shift']());}};_0x557115(++_0x39420e);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x1a9e9e,_0x4e02c0){var _0x461061=function(_0x595613){while(--_0x595613){_0x1a9e9e['push'](_0x1a9e9e['shift']());}};_0x461061(++_0x4e02c0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1f808f,_0x172b10){_0x1f808f=_0x1f808f-0x0;var _0x282348=_0x7fbe[_0x1f808f];return _0x282348;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 7cda615..aec6bcf 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x3da51a,_0x34cc0d){var _0x19298e=function(_0x20eb13){while(--_0x20eb13){_0x3da51a['push'](_0x3da51a['shift']());}};_0x19298e(++_0x34cc0d);}(_0x425d,0x1e0));var _0xd425=function(_0x1548a5,_0x3c1871){_0x1548a5=_0x1548a5-0x0;var _0x2ff71e=_0x425d[_0x1548a5];return _0x2ff71e;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}}; \ No newline at end of file +var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x1e2669,_0x5eb884){var _0x1415db=function(_0x51ad17){while(--_0x51ad17){_0x1e2669['push'](_0x1e2669['shift']());}};_0x1415db(++_0x5eb884);}(_0x425d,0x1e0));var _0xd425=function(_0x1146f7,_0x475356){_0x1146f7=_0x1146f7-0x0;var _0x2e5725=_0x425d[_0x1146f7];return _0x2e5725;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3711efc..c28522b 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 _0xa934=['pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','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','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','SquareRecording','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x442995,_0x27b5b1){var _0x1970d6=function(_0x2f27a6){while(--_0x2f27a6){_0x442995['push'](_0x442995['shift']());}};_0x1970d6(++_0x27b5b1);}(_0xa934,0x1b8));var _0x4a93=function(_0xda18ea,_0x1a544f){_0xda18ea=_0xda18ea-0x0;var _0x167f0a=_0xa934[_0xda18ea];return _0x167f0a;};'use strict';var emlformat=require(_0x4a93('0x0'));var rimraf=require(_0x4a93('0x1'));var zipdir=require(_0x4a93('0x2'));var jsonpatch=require(_0x4a93('0x3'));var rp=require(_0x4a93('0x4'));var moment=require(_0x4a93('0x5'));var BPromise=require(_0x4a93('0x6'));var Mustache=require(_0x4a93('0x7'));var util=require(_0x4a93('0x8'));var path=require(_0x4a93('0x9'));var sox=require(_0x4a93('0xa'));var csv=require(_0x4a93('0xb'));var ejs=require(_0x4a93('0xc'));var fs=require('fs');var fs_extra=require(_0x4a93('0xd'));var _=require('lodash');var squel=require(_0x4a93('0xe'));var crypto=require(_0x4a93('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4a93('0x10'));var toCsv=require(_0x4a93('0xb'));var querystring=require(_0x4a93('0x11'));var Papa=require(_0x4a93('0x12'));var Redis=require(_0x4a93('0x13'));var authService=require(_0x4a93('0x14'));var qs=require(_0x4a93('0x15'));var as=require(_0x4a93('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a93('0x17'));var utils=require(_0x4a93('0x18'));var config=require(_0x4a93('0x19'));var licenseUtil=require(_0x4a93('0x1a'));var db=require(_0x4a93('0x1b'))['db'];function respondWithStatusCode(_0x37caa2,_0x2d0471){_0x2d0471=_0x2d0471||0xcc;return function(_0xec46ff){if(_0xec46ff){return _0x37caa2[_0x4a93('0x1c')](_0x2d0471);}return _0x37caa2[_0x4a93('0x1d')](_0x2d0471)[_0x4a93('0x1e')]();};}function respondWithResult(_0x4690f5,_0x451c60){_0x451c60=_0x451c60||0xc8;return function(_0x4fe73c){if(_0x4fe73c){return _0x4690f5[_0x4a93('0x1d')](_0x451c60)[_0x4a93('0x1f')](_0x4fe73c);}};}function respondWithFilteredResult(_0x2d58f4,_0x4bcafa){return function(_0x561a0c){if(_0x561a0c){var _0x4ad52c=typeof _0x4bcafa[_0x4a93('0x20')]===_0x4a93('0x21')&&typeof _0x4bcafa[_0x4a93('0x22')]===_0x4a93('0x21');var _0x13f4a5=_0x561a0c[_0x4a93('0x23')];var _0x4763a8=_0x4ad52c?0x0:_0x4bcafa[_0x4a93('0x20')];var _0x5b31b1=_0x4ad52c?_0x561a0c[_0x4a93('0x23')]:_0x4bcafa[_0x4a93('0x20')]+_0x4bcafa[_0x4a93('0x22')];var _0x3131d8;if(_0x5b31b1>=_0x13f4a5){_0x5b31b1=_0x13f4a5;_0x3131d8=0xc8;}else{_0x3131d8=0xce;}_0x2d58f4[_0x4a93('0x1d')](_0x3131d8);return _0x2d58f4[_0x4a93('0x24')](_0x4a93('0x25'),_0x4763a8+'-'+_0x5b31b1+'/'+_0x13f4a5)[_0x4a93('0x1f')](_0x561a0c);}return null;};}function patchUpdates(_0x42553f){return function(_0x2d13d0){try{jsonpatch[_0x4a93('0x26')](_0x2d13d0,_0x42553f,!![]);}catch(_0x518fed){return BPromise[_0x4a93('0x27')](_0x518fed);}return _0x2d13d0[_0x4a93('0x28')]();};}function saveUpdates(_0xc9051c,_0x292448){return function(_0x3dd97b){if(_0x3dd97b){return _0x3dd97b[_0x4a93('0x29')](_0xc9051c)[_0x4a93('0x2a')](function(_0x4f8783){return _0x4f8783;});}return null;};}function removeEntity(_0x86b3b1,_0x3c24b8){return function(_0x4765fe){if(_0x4765fe){return _0x4765fe['destroy']()[_0x4a93('0x2a')](function(){_0x86b3b1['status'](0xcc)[_0x4a93('0x1e')]();});}};}function handleEntityNotFound(_0x5d06a6,_0x69d880){return function(_0x3295a3){if(!_0x3295a3){_0x5d06a6['sendStatus'](0x194);}return _0x3295a3;};}function handleError(_0x5c38e8,_0x4bb830){_0x4bb830=_0x4bb830||0x1f4;return function(_0xfc21a1){logger[_0x4a93('0x2b')](_0xfc21a1['stack']);if(_0xfc21a1[_0x4a93('0x2c')]){delete _0xfc21a1[_0x4a93('0x2c')];}_0x5c38e8['status'](_0x4bb830)[_0x4a93('0x2d')](_0xfc21a1);};}exports['index']=function(_0x29eda0,_0x38550a){var _0x253173={},_0x56fc25={},_0x3545c1={'count':0x0,'rows':[]};var _0x1e10fa=_['map'](db[_0x4a93('0x2e')][_0x4a93('0x2f')],function(_0x45879d){return{'name':_0x45879d[_0x4a93('0x30')],'type':_0x45879d[_0x4a93('0x31')][_0x4a93('0x32')]};});_0x56fc25[_0x4a93('0x33')]=_[_0x4a93('0x34')](_0x1e10fa,_0x4a93('0x2c'));_0x56fc25['query']=_[_0x4a93('0x35')](_0x29eda0[_0x4a93('0x36')]);_0x56fc25[_0x4a93('0x37')]=_[_0x4a93('0x38')](_0x56fc25['model'],_0x56fc25[_0x4a93('0x36')]);_0x253173[_0x4a93('0x39')]=_['intersection'](_0x56fc25[_0x4a93('0x33')],qs[_0x4a93('0x3a')](_0x29eda0[_0x4a93('0x36')][_0x4a93('0x3a')]));_0x253173[_0x4a93('0x39')]=_0x253173[_0x4a93('0x39')][_0x4a93('0x3b')]?_0x253173[_0x4a93('0x39')]:_0x56fc25[_0x4a93('0x33')];if(!_0x29eda0['query'][_0x4a93('0x3c')](_0x4a93('0x3d'))){_0x253173[_0x4a93('0x22')]=qs['limit'](_0x29eda0[_0x4a93('0x36')]['limit']);_0x253173['offset']=qs[_0x4a93('0x20')](_0x29eda0[_0x4a93('0x36')][_0x4a93('0x20')]);}_0x253173[_0x4a93('0x3e')]=qs['sort'](_0x29eda0[_0x4a93('0x36')][_0x4a93('0x3f')]);_0x253173[_0x4a93('0x40')]=qs[_0x4a93('0x37')](_[_0x4a93('0x41')](_0x29eda0[_0x4a93('0x36')],_0x56fc25['filters']),_0x1e10fa);if(_0x29eda0[_0x4a93('0x36')][_0x4a93('0x42')]){_0x253173[_0x4a93('0x40')]=_['merge'](_0x253173[_0x4a93('0x40')],{'$or':_[_0x4a93('0x34')](_0x1e10fa,function(_0x29a915){if(_0x29a915[_0x4a93('0x31')]!==_0x4a93('0x43')){var _0x1ca47f={};_0x1ca47f[_0x29a915[_0x4a93('0x2c')]]={'$like':'%'+_0x29eda0[_0x4a93('0x36')][_0x4a93('0x42')]+'%'};return _0x1ca47f;}})});}_0x253173=_[_0x4a93('0x44')]({},_0x253173,_0x29eda0[_0x4a93('0x45')]);var _0x398fa3={'where':_0x253173[_0x4a93('0x40')]};return db[_0x4a93('0x2e')][_0x4a93('0x23')](_0x398fa3)[_0x4a93('0x2a')](function(_0x5debf0){_0x3545c1[_0x4a93('0x23')]=_0x5debf0;if(_0x29eda0['query'][_0x4a93('0x46')]){_0x253173[_0x4a93('0x47')]=[{'all':!![]}];}return db['SquareRecording'][_0x4a93('0x48')](_0x253173);})[_0x4a93('0x2a')](function(_0x5423a7){_0x3545c1[_0x4a93('0x49')]=_0x5423a7;return _0x3545c1;})[_0x4a93('0x2a')](respondWithFilteredResult(_0x38550a,_0x253173))[_0x4a93('0x4a')](handleError(_0x38550a,null));};exports[_0x4a93('0x4b')]=function(_0x35d330,_0x4239b6){var _0x1999ac={'raw':!![],'where':{'id':_0x35d330[_0x4a93('0x4c')]['id']}},_0x541b87={};_0x541b87[_0x4a93('0x33')]=_[_0x4a93('0x35')](db['SquareRecording']['rawAttributes']);_0x541b87[_0x4a93('0x36')]=_[_0x4a93('0x35')](_0x35d330[_0x4a93('0x36')]);_0x541b87['filters']=_[_0x4a93('0x38')](_0x541b87['model'],_0x541b87[_0x4a93('0x36')]);_0x1999ac[_0x4a93('0x39')]=_[_0x4a93('0x38')](_0x541b87[_0x4a93('0x33')],qs[_0x4a93('0x3a')](_0x35d330[_0x4a93('0x36')][_0x4a93('0x3a')]));_0x1999ac[_0x4a93('0x39')]=_0x1999ac[_0x4a93('0x39')][_0x4a93('0x3b')]?_0x1999ac[_0x4a93('0x39')]:_0x541b87[_0x4a93('0x33')];if(_0x35d330[_0x4a93('0x36')][_0x4a93('0x46')]){_0x1999ac[_0x4a93('0x47')]=[{'all':!![]}];}_0x1999ac=_[_0x4a93('0x44')]({},_0x1999ac,_0x35d330[_0x4a93('0x45')]);return db[_0x4a93('0x2e')][_0x4a93('0x4d')](_0x1999ac)['then'](handleEntityNotFound(_0x4239b6,null))['then'](respondWithResult(_0x4239b6,null))[_0x4a93('0x4a')](handleError(_0x4239b6,null));};exports[_0x4a93('0x4e')]=function(_0x210705,_0x5be075){return db['SquareRecording'][_0x4a93('0x4e')](_0x210705[_0x4a93('0x4f')],{})[_0x4a93('0x2a')](respondWithResult(_0x5be075,0xc9))[_0x4a93('0x4a')](handleError(_0x5be075,null));};exports[_0x4a93('0x29')]=function(_0x1f0b52,_0x5d0824){if(_0x1f0b52['body']['id']){delete _0x1f0b52[_0x4a93('0x4f')]['id'];}return db[_0x4a93('0x2e')]['find']({'where':{'id':_0x1f0b52[_0x4a93('0x4c')]['id']}})[_0x4a93('0x2a')](handleEntityNotFound(_0x5d0824,null))[_0x4a93('0x2a')](saveUpdates(_0x1f0b52[_0x4a93('0x4f')],null))[_0x4a93('0x2a')](respondWithResult(_0x5d0824,null))[_0x4a93('0x4a')](handleError(_0x5d0824,null));};exports[_0x4a93('0x50')]=function(_0xbe79bb,_0x59da05,_0xe77ca){var _0x15443b=require('../../components/encryptor');var _0x4ac568=![];var _0xdfd679={};if(_0xbe79bb['query'][_0x4a93('0x31')]&&_0xbe79bb[_0x4a93('0x36')]['type']===_0x4a93('0x51')){_0xdfd679[_0x4a93('0x51')]=_0xbe79bb['params']['id'];}else{_0xdfd679['id']=_0xbe79bb[_0x4a93('0x4c')]['id'];}return db[_0x4a93('0x2e')][_0x4a93('0x4d')]({'where':_0xdfd679,'attributes':['id',_0x4a93('0x52'),_0x4a93('0x53')],'raw':!![]})[_0x4a93('0x2a')](handleEntityNotFound(_0x59da05,null))[_0x4a93('0x2a')](function(_0x174e2d){if(_0x174e2d){var _0x210a10=_0x174e2d[_0x4a93('0x52')];var _0x6e2b31=util['format'](_0x4a93('0x54'),_0x210a10);if(fs[_0x4a93('0x55')](_0x6e2b31)){_0x4ac568=!![];return _0x15443b[_0x4a93('0x56')](_0x6e2b31,_0x210a10,config['secrets'][_0x4a93('0x57')])['then'](function(){return _0x174e2d;});}return _0x174e2d;}})[_0x4a93('0x2a')](function(_0x518ee6){if(_0x518ee6){var _0x36c22f=_0x518ee6[_0x4a93('0x52')];if(!fs['existsSync'](_0x36c22f)){throw new db[(_0x4a93('0x58'))][(_0x4a93('0x59'))](_0x4a93('0x5a'));}if(_0x518ee6['filename']){return _0x59da05[_0x4a93('0x50')](_0x36c22f,_0x518ee6[_0x4a93('0x53')]+path[_0x4a93('0x5b')](_0x36c22f),function(){if(_0x4ac568){fs[_0x4a93('0x5c')](_0x36c22f);}});}else{return _0x59da05[_0x4a93('0x50')](_0x36c22f,function(_0x4f2046){if(_0x4ac568){fs['unlink'](_0x36c22f);}});}}})[_0x4a93('0x4a')](function(_0x3bcac3){if(_0x3bcac3[_0x4a93('0x5d')]===_0x4a93('0x5a')){_0x59da05['status'](0x194)[_0x4a93('0x2d')](_0x4a93('0x5e'));}else{return handleError(_0x59da05,null);}});};exports[_0x4a93('0x5f')]=function(_0x55b1eb,_0x3d402a){return db[_0x4a93('0x2e')]['find']({'where':{'id':_0x55b1eb['params']['id']}})['then'](function(_0x3f5ef0){if(_[_0x4a93('0x60')](_0x3f5ef0)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3f5ef0;})[_0x4a93('0x2a')](function(_0x20481f){var _0x5cb2ce=_0x20481f[_0x4a93('0x52')];logger[_0x4a93('0x61')]('cancellazione\x20fisica\x20documento\x20%s',_0x5cb2ce);if(!_[_0x4a93('0x60')](_0x20481f['savePath'])&&fs['existsSync'](_0x5cb2ce)){logger[_0x4a93('0x61')]('File:\x20\x22'+_0x5cb2ce+_0x4a93('0x62'));fs[_0x4a93('0x63')](_0x5cb2ce);}_0x5cb2ce=_0x5cb2ce+'.cypher';if(!_[_0x4a93('0x60')](_0x20481f['savePath'])&&fs[_0x4a93('0x55')](_0x5cb2ce)){logger[_0x4a93('0x61')](_0x4a93('0x64')+_0x5cb2ce+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5cb2ce);}return _0x20481f;})[_0x4a93('0x2a')](function(_0x46c254){if(!_0x46c254)throw new InternalError();return _0x46c254[_0x4a93('0x5f')]();})[_0x4a93('0x2a')](function(){_0x3d402a[_0x4a93('0x1d')](0xcc)[_0x4a93('0x1e')]();})['catch'](handleError(_0x3d402a,null));}; \ No newline at end of file +var _0x4b0c=['body','find','uniqueid','savePath','filename','format','decryptFile','secrets','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','catch','show','params','length','create'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x4b0c,0x13d));var _0xc4b0=function(_0x5c34fc,_0x21a6d8){_0x5c34fc=_0x5c34fc-0x0;var _0x2cd351=_0x4b0c[_0x5c34fc];return _0x2cd351;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4b0('0x0'));var zipdir=require(_0xc4b0('0x1'));var jsonpatch=require(_0xc4b0('0x2'));var rp=require(_0xc4b0('0x3'));var moment=require(_0xc4b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4b0('0x5'));var util=require(_0xc4b0('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4b0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4b0('0x8'));var squel=require(_0xc4b0('0x9'));var crypto=require(_0xc4b0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc4b0('0xb'));var toCsv=require(_0xc4b0('0xc'));var querystring=require(_0xc4b0('0xd'));var Papa=require(_0xc4b0('0xe'));var Redis=require('ioredis');var authService=require(_0xc4b0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4b0('0x10'));var logger=require('../../config/logger')(_0xc4b0('0x11'));var utils=require(_0xc4b0('0x12'));var config=require(_0xc4b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4b0('0x14'))['db'];function respondWithStatusCode(_0x48a05a,_0x4d6882){_0x4d6882=_0x4d6882||0xcc;return function(_0x1476fd){if(_0x1476fd){return _0x48a05a[_0xc4b0('0x15')](_0x4d6882);}return _0x48a05a['status'](_0x4d6882)['end']();};}function respondWithResult(_0x3c59dc,_0x657480){_0x657480=_0x657480||0xc8;return function(_0x300195){if(_0x300195){return _0x3c59dc[_0xc4b0('0x16')](_0x657480)['json'](_0x300195);}};}function respondWithFilteredResult(_0x430552,_0x5c3f81){return function(_0x1d85b0){if(_0x1d85b0){var _0x53a7cc=typeof _0x5c3f81[_0xc4b0('0x17')]==='undefined'&&typeof _0x5c3f81[_0xc4b0('0x18')]===_0xc4b0('0x19');var _0x1dadf1=_0x1d85b0[_0xc4b0('0x1a')];var _0x379ea9=_0x53a7cc?0x0:_0x5c3f81[_0xc4b0('0x17')];var _0x3762a7=_0x53a7cc?_0x1d85b0[_0xc4b0('0x1a')]:_0x5c3f81['offset']+_0x5c3f81[_0xc4b0('0x18')];var _0x9a88f7;if(_0x3762a7>=_0x1dadf1){_0x3762a7=_0x1dadf1;_0x9a88f7=0xc8;}else{_0x9a88f7=0xce;}_0x430552[_0xc4b0('0x16')](_0x9a88f7);return _0x430552[_0xc4b0('0x1b')](_0xc4b0('0x1c'),_0x379ea9+'-'+_0x3762a7+'/'+_0x1dadf1)[_0xc4b0('0x1d')](_0x1d85b0);}return null;};}function patchUpdates(_0x90d37e){return function(_0x19f212){try{jsonpatch['apply'](_0x19f212,_0x90d37e,!![]);}catch(_0x41910b){return BPromise[_0xc4b0('0x1e')](_0x41910b);}return _0x19f212[_0xc4b0('0x1f')]();};}function saveUpdates(_0x598839,_0x551c28){return function(_0x59f3cc){if(_0x59f3cc){return _0x59f3cc[_0xc4b0('0x20')](_0x598839)[_0xc4b0('0x21')](function(_0x53e27a){return _0x53e27a;});}return null;};}function removeEntity(_0x48acd7,_0x346ace){return function(_0x412e2d){if(_0x412e2d){return _0x412e2d[_0xc4b0('0x22')]()[_0xc4b0('0x21')](function(){_0x48acd7['status'](0xcc)[_0xc4b0('0x23')]();});}};}function handleEntityNotFound(_0x43d5c5,_0x4e884d){return function(_0x3862ec){if(!_0x3862ec){_0x43d5c5[_0xc4b0('0x15')](0x194);}return _0x3862ec;};}function handleError(_0x20bfbd,_0x134213){_0x134213=_0x134213||0x1f4;return function(_0x515a4f){logger['error'](_0x515a4f[_0xc4b0('0x24')]);if(_0x515a4f[_0xc4b0('0x25')]){delete _0x515a4f['name'];}_0x20bfbd['status'](_0x134213)['send'](_0x515a4f);};}exports[_0xc4b0('0x26')]=function(_0x116eda,_0x537f7b){var _0x348596={},_0x4270a1={},_0x5dc884={'count':0x0,'rows':[]};var _0x238f1f=_[_0xc4b0('0x27')](db['SquareRecording'][_0xc4b0('0x28')],function(_0x30d031){return{'name':_0x30d031[_0xc4b0('0x29')],'type':_0x30d031[_0xc4b0('0x2a')][_0xc4b0('0x2b')]};});_0x4270a1['model']=_[_0xc4b0('0x27')](_0x238f1f,'name');_0x4270a1['query']=_[_0xc4b0('0x2c')](_0x116eda['query']);_0x4270a1[_0xc4b0('0x2d')]=_[_0xc4b0('0x2e')](_0x4270a1[_0xc4b0('0x2f')],_0x4270a1[_0xc4b0('0x30')]);_0x348596[_0xc4b0('0x31')]=_[_0xc4b0('0x2e')](_0x4270a1[_0xc4b0('0x2f')],qs[_0xc4b0('0x32')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x32')]));_0x348596[_0xc4b0('0x31')]=_0x348596[_0xc4b0('0x31')]['length']?_0x348596[_0xc4b0('0x31')]:_0x4270a1[_0xc4b0('0x2f')];if(!_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x33')](_0xc4b0('0x34'))){_0x348596[_0xc4b0('0x18')]=qs[_0xc4b0('0x18')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x18')]);_0x348596[_0xc4b0('0x17')]=qs[_0xc4b0('0x17')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x17')]);}_0x348596[_0xc4b0('0x35')]=qs[_0xc4b0('0x36')](_0x116eda['query'][_0xc4b0('0x36')]);_0x348596[_0xc4b0('0x37')]=qs[_0xc4b0('0x2d')](_[_0xc4b0('0x38')](_0x116eda[_0xc4b0('0x30')],_0x4270a1[_0xc4b0('0x2d')]),_0x238f1f);if(_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x39')]){_0x348596[_0xc4b0('0x37')]=_[_0xc4b0('0x3a')](_0x348596['where'],{'$or':_['map'](_0x238f1f,function(_0x4489f9){if(_0x4489f9[_0xc4b0('0x2a')]!==_0xc4b0('0x3b')){var _0xfffd10={};_0xfffd10[_0x4489f9[_0xc4b0('0x25')]]={'$like':'%'+_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x39')]+'%'};return _0xfffd10;}})});}_0x348596=_[_0xc4b0('0x3a')]({},_0x348596,_0x116eda[_0xc4b0('0x3c')]);var _0x15c587={'where':_0x348596['where']};return db['SquareRecording'][_0xc4b0('0x1a')](_0x15c587)['then'](function(_0x5ca4cf){_0x5dc884[_0xc4b0('0x1a')]=_0x5ca4cf;if(_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x3d')]){_0x348596[_0xc4b0('0x3e')]=[{'all':!![]}];}return db[_0xc4b0('0x3f')][_0xc4b0('0x40')](_0x348596);})[_0xc4b0('0x21')](function(_0x2be837){_0x5dc884[_0xc4b0('0x41')]=_0x2be837;return _0x5dc884;})[_0xc4b0('0x21')](respondWithFilteredResult(_0x537f7b,_0x348596))[_0xc4b0('0x42')](handleError(_0x537f7b,null));};exports[_0xc4b0('0x43')]=function(_0x1559c9,_0x49bdf3){var _0x22910d={'raw':!![],'where':{'id':_0x1559c9[_0xc4b0('0x44')]['id']}},_0x9b3671={};_0x9b3671['model']=_[_0xc4b0('0x2c')](db[_0xc4b0('0x3f')][_0xc4b0('0x28')]);_0x9b3671[_0xc4b0('0x30')]=_[_0xc4b0('0x2c')](_0x1559c9[_0xc4b0('0x30')]);_0x9b3671[_0xc4b0('0x2d')]=_[_0xc4b0('0x2e')](_0x9b3671[_0xc4b0('0x2f')],_0x9b3671['query']);_0x22910d[_0xc4b0('0x31')]=_[_0xc4b0('0x2e')](_0x9b3671[_0xc4b0('0x2f')],qs[_0xc4b0('0x32')](_0x1559c9['query'][_0xc4b0('0x32')]));_0x22910d[_0xc4b0('0x31')]=_0x22910d['attributes'][_0xc4b0('0x45')]?_0x22910d[_0xc4b0('0x31')]:_0x9b3671[_0xc4b0('0x2f')];if(_0x1559c9[_0xc4b0('0x30')][_0xc4b0('0x3d')]){_0x22910d[_0xc4b0('0x3e')]=[{'all':!![]}];}_0x22910d=_[_0xc4b0('0x3a')]({},_0x22910d,_0x1559c9[_0xc4b0('0x3c')]);return db['SquareRecording']['find'](_0x22910d)[_0xc4b0('0x21')](handleEntityNotFound(_0x49bdf3,null))[_0xc4b0('0x21')](respondWithResult(_0x49bdf3,null))[_0xc4b0('0x42')](handleError(_0x49bdf3,null));};exports['create']=function(_0x21fc72,_0x1a8e23){return db[_0xc4b0('0x3f')][_0xc4b0('0x46')](_0x21fc72[_0xc4b0('0x47')],{})[_0xc4b0('0x21')](respondWithResult(_0x1a8e23,0xc9))[_0xc4b0('0x42')](handleError(_0x1a8e23,null));};exports[_0xc4b0('0x20')]=function(_0x5d90f6,_0x384c60){if(_0x5d90f6[_0xc4b0('0x47')]['id']){delete _0x5d90f6[_0xc4b0('0x47')]['id'];}return db['SquareRecording'][_0xc4b0('0x48')]({'where':{'id':_0x5d90f6[_0xc4b0('0x44')]['id']}})[_0xc4b0('0x21')](handleEntityNotFound(_0x384c60,null))[_0xc4b0('0x21')](saveUpdates(_0x5d90f6[_0xc4b0('0x47')],null))[_0xc4b0('0x21')](respondWithResult(_0x384c60,null))[_0xc4b0('0x42')](handleError(_0x384c60,null));};exports['download']=function(_0x1eb367,_0x582fd4,_0x5253da){var _0x1540e5=require('../../components/encryptor');var _0x4180ea=![];var _0x3b91ab={};if(_0x1eb367[_0xc4b0('0x30')]['type']&&_0x1eb367[_0xc4b0('0x30')][_0xc4b0('0x2a')]===_0xc4b0('0x49')){_0x3b91ab[_0xc4b0('0x49')]=_0x1eb367['params']['id'];}else{_0x3b91ab['id']=_0x1eb367[_0xc4b0('0x44')]['id'];}return db[_0xc4b0('0x3f')][_0xc4b0('0x48')]({'where':_0x3b91ab,'attributes':['id',_0xc4b0('0x4a'),_0xc4b0('0x4b')],'raw':!![]})[_0xc4b0('0x21')](handleEntityNotFound(_0x582fd4,null))[_0xc4b0('0x21')](function(_0x3d11de){if(_0x3d11de){var _0x45c0d1=_0x3d11de[_0xc4b0('0x4a')];var _0x45d14f=util[_0xc4b0('0x4c')]('%s.cypher',_0x45c0d1);if(fs['existsSync'](_0x45d14f)){_0x4180ea=!![];return _0x1540e5[_0xc4b0('0x4d')](_0x45d14f,_0x45c0d1,config[_0xc4b0('0x4e')][_0xc4b0('0x4f')])[_0xc4b0('0x21')](function(){return _0x3d11de;});}return _0x3d11de;}})[_0xc4b0('0x21')](function(_0xd8cdd){if(_0xd8cdd){var _0x590543=_0xd8cdd[_0xc4b0('0x4a')];if(!fs[_0xc4b0('0x50')](_0x590543)){throw new db[(_0xc4b0('0x51'))]['ValidationError'](_0xc4b0('0x52'));}if(_0xd8cdd[_0xc4b0('0x4b')]){return _0x582fd4[_0xc4b0('0x53')](_0x590543,_0xd8cdd[_0xc4b0('0x4b')]+path[_0xc4b0('0x54')](_0x590543),function(){if(_0x4180ea){fs[_0xc4b0('0x55')](_0x590543);}});}else{return _0x582fd4[_0xc4b0('0x53')](_0x590543,function(_0x420b65){if(_0x4180ea){fs[_0xc4b0('0x55')](_0x590543);}});}}})[_0xc4b0('0x42')](function(_0x1d6bc3){if(_0x1d6bc3[_0xc4b0('0x56')]===_0xc4b0('0x52')){_0x582fd4[_0xc4b0('0x16')](0x194)[_0xc4b0('0x57')](_0xc4b0('0x58'));}else{return handleError(_0x582fd4,null);}});};exports['destroy']=function(_0x51d3e7,_0x440a3c){return db[_0xc4b0('0x3f')][_0xc4b0('0x48')]({'where':{'id':_0x51d3e7[_0xc4b0('0x44')]['id']}})[_0xc4b0('0x21')](function(_0x3fc107){if(_[_0xc4b0('0x59')](_0x3fc107)){throw new ReferenceError(_0xc4b0('0x5a'));}return _0x3fc107;})[_0xc4b0('0x21')](function(_0x55f890){var _0x19b15b=_0x55f890[_0xc4b0('0x4a')];logger[_0xc4b0('0x5b')](_0xc4b0('0x5c'),_0x19b15b);if(!_[_0xc4b0('0x59')](_0x55f890['savePath'])&&fs['existsSync'](_0x19b15b)){logger['info'](_0xc4b0('0x5d')+_0x19b15b+_0xc4b0('0x5e'));fs[_0xc4b0('0x5f')](_0x19b15b);}_0x19b15b=_0x19b15b+_0xc4b0('0x60');if(!_['isNil'](_0x55f890[_0xc4b0('0x4a')])&&fs[_0xc4b0('0x50')](_0x19b15b)){logger['info'](_0xc4b0('0x5d')+_0x19b15b+_0xc4b0('0x5e'));fs[_0xc4b0('0x5f')](_0x19b15b);}return _0x55f890;})['then'](function(_0x2ba8b8){if(!_0x2ba8b8)throw new InternalError();return _0x2ba8b8[_0xc4b0('0x22')]();})[_0xc4b0('0x21')](function(){_0x440a3c[_0xc4b0('0x16')](0xcc)['end']();})[_0xc4b0('0x42')](handleError(_0x440a3c,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 9be46ab..ded6261 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 _0x1b9b=['SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3a23df,_0x279ebd){var _0x5ba930=function(_0x2a5f2c){while(--_0x2a5f2c){_0x3a23df['push'](_0x3a23df['shift']());}};_0x5ba930(++_0x279ebd);}(_0x1b9b,0x89));var _0xb1b9=function(_0x22ee06,_0xcee777){_0x22ee06=_0x22ee06-0x0;var _0x5c8982=_0x1b9b[_0x22ee06];return _0x5c8982;};'use strict';var _=require(_0xb1b9('0x0'));var util=require('util');var logger=require(_0xb1b9('0x1'))(_0xb1b9('0x2'));var moment=require(_0xb1b9('0x3'));var BPromise=require(_0xb1b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1b9('0x5'));var rimraf=require(_0xb1b9('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x442466,_0x334ccf){return _0x442466['define'](_0xb1b9('0x7'),attributes,{'tableName':_0xb1b9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x1011ae,_0x447133){var _0x314fb=function(_0x166933){while(--_0x166933){_0x1011ae['push'](_0x1011ae['shift']());}};_0x314fb(++_0x447133);}(_0xba34,0x119));var _0x4ba3=function(_0x4e5253,_0x254a3f){_0x4e5253=_0x4e5253-0x0;var _0x5bafb7=_0xba34[_0x4e5253];return _0x5bafb7;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('SquareRecording',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index c1cbb7b..134bcbe 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 _0xd09a=['CreateSquareRecording','SquareRecording','create','options','raw','debug','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0xd09a,0xd6));var _0xad09=function(_0x214093,_0x4dcc8a){_0x214093=_0x214093-0x0;var _0x3e6196=_0xd09a[_0x214093];return _0x3e6196;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad09('0x0'));var BPromise=require(_0xad09('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad09('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xad09('0x3'));var logger=require(_0xad09('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad09('0x5'));var client=jayson[_0xad09('0x6')][_0xad09('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1dd068,_0x385c2e,_0x28f10f){return new BPromise(function(_0x27e15b,_0x542db4){return client[_0xad09('0x8')](_0x1dd068,_0x28f10f)[_0xad09('0x9')](function(_0xb1d6d3){logger['info'](_0xad09('0xa'),_0x385c2e,_0xad09('0xb'));logger['debug'](_0xad09('0xc'),_0x385c2e,'request\x20sent',JSON[_0xad09('0xd')](_0xb1d6d3));if(_0xb1d6d3[_0xad09('0xe')]){if(_0xb1d6d3[_0xad09('0xe')][_0xad09('0xf')]===0x1f4){logger[_0xad09('0xe')](_0xad09('0xa'),_0x385c2e,_0xb1d6d3[_0xad09('0xe')][_0xad09('0x10')]);return _0x542db4(_0xb1d6d3[_0xad09('0xe')][_0xad09('0x10')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x385c2e,_0xb1d6d3[_0xad09('0xe')][_0xad09('0x10')]);return _0x27e15b(_0xb1d6d3[_0xad09('0xe')][_0xad09('0x10')]);}else{logger[_0xad09('0x11')](_0xad09('0xa'),_0x385c2e,'request\x20sent');_0x27e15b(_0xb1d6d3[_0xad09('0x12')][_0xad09('0x10')]);}})[_0xad09('0x13')](function(_0x4812e){logger[_0xad09('0xe')](_0xad09('0xa'),_0x385c2e,_0x4812e);_0x542db4(_0x4812e);});});}exports[_0xad09('0x14')]=function(_0x3add95){var _0x5d28f3=this;return new Promise(function(_0x262ee0,_0x432343){return db[_0xad09('0x15')][_0xad09('0x16')](_0x3add95['body'],{'raw':_0x3add95[_0xad09('0x17')]?_0x3add95[_0xad09('0x17')][_0xad09('0x18')]===undefined?!![]:![]:!![]})[_0xad09('0x9')](function(_0x1e11fc){logger[_0xad09('0x11')]('CreateSquareRecording',_0x3add95);logger[_0xad09('0x19')](_0xad09('0x14'),_0x3add95,JSON[_0xad09('0xd')](_0x1e11fc));_0x262ee0(_0x1e11fc);})['catch'](function(_0xc387f3){logger['error'](_0xad09('0x14'),_0xc387f3['message'],_0x3add95);_0x432343(_0x5d28f3['error'](0x1f4,_0xc387f3['message']));});});}; \ No newline at end of file +var _0x481a=['code','SquareRecording,\x20%s,\x20%s','message','info','catch','CreateSquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x5f0714,_0x305ed3){var _0x7dee55=function(_0x21dc3a){while(--_0x21dc3a){_0x5f0714['push'](_0x5f0714['shift']());}};_0x7dee55(++_0x305ed3);}(_0x481a,0x1a0));var _0xa481=function(_0xb5d151,_0x4535bb){_0xb5d151=_0xb5d151-0x0;var _0x22fa8d=_0x481a[_0xb5d151];return _0x22fa8d;};'use strict';var _=require(_0xa481('0x0'));var util=require(_0xa481('0x1'));var moment=require(_0xa481('0x2'));var BPromise=require(_0xa481('0x3'));var rs=require(_0xa481('0x4'));var fs=require('fs');var Redis=require(_0xa481('0x5'));var db=require(_0xa481('0x6'))['db'];var utils=require(_0xa481('0x7'));var logger=require(_0xa481('0x8'))(_0xa481('0x9'));var config=require(_0xa481('0xa'));var jayson=require(_0xa481('0xb'));var client=jayson[_0xa481('0xc')][_0xa481('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20232a,_0x105b13,_0x58a526){return new BPromise(function(_0x1a1ac1,_0x1de77d){return client[_0xa481('0xe')](_0x20232a,_0x58a526)[_0xa481('0xf')](function(_0xd5e9d2){logger['info']('SquareRecording,\x20%s,\x20%s',_0x105b13,_0xa481('0x10'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x105b13,_0xa481('0x10'),JSON[_0xa481('0x11')](_0xd5e9d2));if(_0xd5e9d2[_0xa481('0x12')]){if(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x13')]===0x1f4){logger['error'](_0xa481('0x14'),_0x105b13,_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);return _0x1de77d(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);}logger[_0xa481('0x12')](_0xa481('0x14'),_0x105b13,_0xd5e9d2['error'][_0xa481('0x15')]);return _0x1a1ac1(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);}else{logger[_0xa481('0x16')](_0xa481('0x14'),_0x105b13,_0xa481('0x10'));_0x1a1ac1(_0xd5e9d2['result'][_0xa481('0x15')]);}})[_0xa481('0x17')](function(_0xc8b4c3){logger['error'](_0xa481('0x14'),_0x105b13,_0xc8b4c3);_0x1de77d(_0xc8b4c3);});});}exports[_0xa481('0x18')]=function(_0x39bb08){var _0x3337a1=this;return new Promise(function(_0x4d25a8,_0x2958f3){return db['SquareRecording'][_0xa481('0x19')](_0x39bb08[_0xa481('0x1a')],{'raw':_0x39bb08[_0xa481('0x1b')]?_0x39bb08['options'][_0xa481('0x1c')]===undefined?!![]:![]:!![]})[_0xa481('0xf')](function(_0x1fb155){logger[_0xa481('0x16')]('CreateSquareRecording',_0x39bb08);logger['debug'](_0xa481('0x18'),_0x39bb08,JSON[_0xa481('0x11')](_0x1fb155));_0x4d25a8(_0x1fb155);})['catch'](function(_0x49ade0){logger[_0xa481('0x12')](_0xa481('0x18'),_0x49ade0[_0xa481('0x15')],_0x39bb08);_0x2958f3(_0x3337a1[_0xa481('0x12')](0x1f4,_0x49ade0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b6c684e..caac053 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4882c4,_0x11492a){var _0x1887d6=function(_0x27ffbf){while(--_0x27ffbf){_0x4882c4['push'](_0x4882c4['shift']());}};_0x1887d6(++_0x11492a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a023f,_0x3a0789){_0x3a023f=_0x3a023f-0x0;var _0x1de363=_0xb10b[_0x3a023f];return _0x1de363;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9e96865..313ccc0 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 _0xa52d=['STRING','DATE','sequelize'];(function(_0x3d1bb9,_0x28c985){var _0x30395f=function(_0xa6a427){while(--_0xa6a427){_0x3d1bb9['push'](_0x3d1bb9['shift']());}};_0x30395f(++_0x28c985);}(_0xa52d,0x6e));var _0xda52=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xa52d[_0x3cb30b];return _0x2ca717;};'use strict';var Sequelize=require(_0xda52('0x0'));module['exports']={'network':{'type':Sequelize[_0xda52('0x1')]},'network_script':{'type':Sequelize[_0xda52('0x1')]},'request':{'type':Sequelize[_0xda52('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xda52('0x1')]},'type':{'type':Sequelize[_0xda52('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xda52('0x1')]},'callingpres':{'type':Sequelize[_0xda52('0x1')]},'callingani2':{'type':Sequelize[_0xda52('0x1')]},'callington':{'type':Sequelize[_0xda52('0x1')]},'callingtns':{'type':Sequelize[_0xda52('0x1')]},'dnid':{'type':Sequelize[_0xda52('0x1')]},'rdnis':{'type':Sequelize[_0xda52('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xda52('0x1')]},'accountcode':{'type':Sequelize[_0xda52('0x1')]},'threadid':{'type':Sequelize[_0xda52('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xda52('0x2')]},'leaveAt':{'type':Sequelize[_0xda52('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x832a=['exports','STRING','DATE','BOOLEAN'];(function(_0x2d2639,_0x333c5f){var _0x580999=function(_0x6d5347){while(--_0x6d5347){_0x2d2639['push'](_0x2d2639['shift']());}};_0x580999(++_0x333c5f);}(_0x832a,0x158));var _0xa832=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0x832a[_0x5f4902];return _0x743933;};'use strict';var Sequelize=require('sequelize');module[_0xa832('0x0')]={'network':{'type':Sequelize[_0xa832('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa832('0x1')]},'language':{'type':Sequelize[_0xa832('0x1')]},'type':{'type':Sequelize[_0xa832('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xa832('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa832('0x1')]},'callingpres':{'type':Sequelize[_0xa832('0x1')]},'callingani2':{'type':Sequelize[_0xa832('0x1')]},'callington':{'type':Sequelize[_0xa832('0x1')]},'callingtns':{'type':Sequelize[_0xa832('0x1')]},'dnid':{'type':Sequelize[_0xa832('0x1')]},'rdnis':{'type':Sequelize[_0xa832('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa832('0x1')]},'priority':{'type':Sequelize[_0xa832('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa832('0x1')]},'threadid':{'type':Sequelize[_0xa832('0x1')]},'project_name':{'type':Sequelize[_0xa832('0x1')]},'joinAt':{'type':Sequelize[_0xa832('0x2')]},'leaveAt':{'type':Sequelize[_0xa832('0x2')]},'bot':{'type':Sequelize[_0xa832('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 4f91ff9..af21353 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 _0x1349=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x997c06,_0xaefc56){var _0x13a192=function(_0x3780c4){while(--_0x3780c4){_0x997c06['push'](_0x997c06['shift']());}};_0x13a192(++_0xaefc56);}(_0x1349,0x170));var _0x9134=function(_0x33d596,_0x9c29e5){_0x33d596=_0x33d596-0x0;var _0x29362d=_0x1349[_0x33d596];return _0x29362d;};'use strict';var emlformat=require(_0x9134('0x0'));var rimraf=require(_0x9134('0x1'));var zipdir=require(_0x9134('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9134('0x3'));var moment=require(_0x9134('0x4'));var BPromise=require(_0x9134('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9134('0x6'));var sox=require(_0x9134('0x7'));var csv=require(_0x9134('0x8'));var ejs=require(_0x9134('0x9'));var fs=require('fs');var fs_extra=require(_0x9134('0xa'));var _=require(_0x9134('0xb'));var squel=require(_0x9134('0xc'));var crypto=require(_0x9134('0xd'));var jsforce=require(_0x9134('0xe'));var deskjs=require(_0x9134('0xf'));var toCsv=require(_0x9134('0x8'));var querystring=require(_0x9134('0x10'));var Papa=require('papaparse');var Redis=require(_0x9134('0x11'));var authService=require(_0x9134('0x12'));var qs=require(_0x9134('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9134('0x14'));var logger=require(_0x9134('0x15'))('api');var utils=require(_0x9134('0x16'));var config=require(_0x9134('0x17'));var licenseUtil=require(_0x9134('0x18'));var db=require(_0x9134('0x19'))['db'];function respondWithStatusCode(_0x7a2edb,_0x562534){_0x562534=_0x562534||0xcc;return function(_0x134400){if(_0x134400){return _0x7a2edb[_0x9134('0x1a')](_0x562534);}return _0x7a2edb[_0x9134('0x1b')](_0x562534)['end']();};}function respondWithResult(_0x428f1f,_0x4488f1){_0x4488f1=_0x4488f1||0xc8;return function(_0x436033){if(_0x436033){return _0x428f1f['status'](_0x4488f1)[_0x9134('0x1c')](_0x436033);}};}function respondWithFilteredResult(_0x18e94d,_0xb1c16d){return function(_0x18c4c3){if(_0x18c4c3){var _0x4a3e55=typeof _0xb1c16d[_0x9134('0x1d')]===_0x9134('0x1e')&&typeof _0xb1c16d[_0x9134('0x1f')]===_0x9134('0x1e');var _0x646f95=_0x18c4c3['count'];var _0x2e35b2=_0x4a3e55?0x0:_0xb1c16d[_0x9134('0x1d')];var _0x50e629=_0x4a3e55?_0x18c4c3[_0x9134('0x20')]:_0xb1c16d[_0x9134('0x1d')]+_0xb1c16d[_0x9134('0x1f')];var _0x371f6b;if(_0x50e629>=_0x646f95){_0x50e629=_0x646f95;_0x371f6b=0xc8;}else{_0x371f6b=0xce;}_0x18e94d['status'](_0x371f6b);return _0x18e94d[_0x9134('0x21')](_0x9134('0x22'),_0x2e35b2+'-'+_0x50e629+'/'+_0x646f95)[_0x9134('0x1c')](_0x18c4c3);}return null;};}function patchUpdates(_0x5ce027){return function(_0x5479ef){try{jsonpatch[_0x9134('0x23')](_0x5479ef,_0x5ce027,!![]);}catch(_0x334501){return BPromise[_0x9134('0x24')](_0x334501);}return _0x5479ef[_0x9134('0x25')]();};}function saveUpdates(_0x35b303,_0x2cc066){return function(_0x397135){if(_0x397135){return _0x397135[_0x9134('0x26')](_0x35b303)[_0x9134('0x27')](function(_0x571bb5){return _0x571bb5;});}return null;};}function removeEntity(_0x2c41da,_0x14cd8f){return function(_0x151a07){if(_0x151a07){return _0x151a07[_0x9134('0x28')]()[_0x9134('0x27')](function(){_0x2c41da[_0x9134('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a429a,_0x2c39fe){return function(_0x253189){if(!_0x253189){_0x3a429a[_0x9134('0x1a')](0x194);}return _0x253189;};}function handleError(_0x176a53,_0x59e080){_0x59e080=_0x59e080||0x1f4;return function(_0x15b4d4){logger[_0x9134('0x29')](_0x15b4d4['stack']);if(_0x15b4d4[_0x9134('0x2a')]){delete _0x15b4d4[_0x9134('0x2a')];}_0x176a53[_0x9134('0x1b')](_0x59e080)[_0x9134('0x2b')](_0x15b4d4);};}exports[_0x9134('0x2c')]=function(_0x57c012,_0x181322){var _0x84cdb2={},_0x2c5d6f={},_0xeee9ec={'count':0x0,'rows':[]};var _0x440457=_['map'](db[_0x9134('0x2d')][_0x9134('0x2e')],function(_0xdc5863){return{'name':_0xdc5863[_0x9134('0x2f')],'type':_0xdc5863[_0x9134('0x30')]['key']};});_0x2c5d6f[_0x9134('0x31')]=_['map'](_0x440457,'name');_0x2c5d6f['query']=_['keys'](_0x57c012[_0x9134('0x32')]);_0x2c5d6f[_0x9134('0x33')]=_[_0x9134('0x34')](_0x2c5d6f['model'],_0x2c5d6f[_0x9134('0x32')]);_0x84cdb2[_0x9134('0x35')]=_[_0x9134('0x34')](_0x2c5d6f[_0x9134('0x31')],qs[_0x9134('0x36')](_0x57c012[_0x9134('0x32')]['fields']));_0x84cdb2[_0x9134('0x35')]=_0x84cdb2[_0x9134('0x35')][_0x9134('0x37')]?_0x84cdb2[_0x9134('0x35')]:_0x2c5d6f['model'];if(!_0x57c012['query']['hasOwnProperty'](_0x9134('0x38'))){_0x84cdb2[_0x9134('0x1f')]=qs[_0x9134('0x1f')](_0x57c012[_0x9134('0x32')][_0x9134('0x1f')]);_0x84cdb2[_0x9134('0x1d')]=qs[_0x9134('0x1d')](_0x57c012[_0x9134('0x32')][_0x9134('0x1d')]);}_0x84cdb2['order']=qs[_0x9134('0x39')](_0x57c012['query'][_0x9134('0x39')]);_0x84cdb2['where']=qs['filters'](_[_0x9134('0x3a')](_0x57c012[_0x9134('0x32')],_0x2c5d6f[_0x9134('0x33')]),_0x440457);if(_0x57c012[_0x9134('0x32')][_0x9134('0x3b')]){_0x84cdb2[_0x9134('0x3c')]=_[_0x9134('0x3d')](_0x84cdb2['where'],{'$or':_[_0x9134('0x3e')](_0x440457,function(_0x3f8f93){if(_0x3f8f93['type']!==_0x9134('0x3f')){var _0x126d11={};_0x126d11[_0x3f8f93[_0x9134('0x2a')]]={'$like':'%'+_0x57c012[_0x9134('0x32')][_0x9134('0x3b')]+'%'};return _0x126d11;}})});}_0x84cdb2=_[_0x9134('0x3d')]({},_0x84cdb2,_0x57c012[_0x9134('0x40')]);var _0x56d556={'where':_0x84cdb2['where']};return db[_0x9134('0x2d')][_0x9134('0x20')](_0x56d556)[_0x9134('0x27')](function(_0x5c15dc){_0xeee9ec[_0x9134('0x20')]=_0x5c15dc;if(_0x57c012[_0x9134('0x32')][_0x9134('0x41')]){_0x84cdb2[_0x9134('0x42')]=[{'all':!![]}];}return db['SquareReport'][_0x9134('0x43')](_0x84cdb2);})[_0x9134('0x27')](function(_0x5a77b7){_0xeee9ec[_0x9134('0x44')]=_0x5a77b7;return _0xeee9ec;})['then'](respondWithFilteredResult(_0x181322,_0x84cdb2))[_0x9134('0x45')](handleError(_0x181322,null));};exports[_0x9134('0x46')]=function(_0x3c1582,_0x202481){var _0x10c95d={'raw':!![],'where':{'id':_0x3c1582[_0x9134('0x47')]['id']}},_0x13a283={};_0x13a283[_0x9134('0x31')]=_[_0x9134('0x48')](db[_0x9134('0x2d')][_0x9134('0x2e')]);_0x13a283[_0x9134('0x32')]=_[_0x9134('0x48')](_0x3c1582['query']);_0x13a283[_0x9134('0x33')]=_[_0x9134('0x34')](_0x13a283[_0x9134('0x31')],_0x13a283[_0x9134('0x32')]);_0x10c95d[_0x9134('0x35')]=_['intersection'](_0x13a283[_0x9134('0x31')],qs[_0x9134('0x36')](_0x3c1582[_0x9134('0x32')][_0x9134('0x36')]));_0x10c95d[_0x9134('0x35')]=_0x10c95d['attributes']['length']?_0x10c95d[_0x9134('0x35')]:_0x13a283[_0x9134('0x31')];if(_0x3c1582[_0x9134('0x32')][_0x9134('0x41')]){_0x10c95d[_0x9134('0x42')]=[{'all':!![]}];}_0x10c95d=_[_0x9134('0x3d')]({},_0x10c95d,_0x3c1582[_0x9134('0x40')]);return db['SquareReport'][_0x9134('0x49')](_0x10c95d)['then'](handleEntityNotFound(_0x202481,null))['then'](respondWithResult(_0x202481,null))[_0x9134('0x45')](handleError(_0x202481,null));};exports[_0x9134('0x4a')]=function(_0x50c8a4,_0x534f74){return db[_0x9134('0x2d')][_0x9134('0x4a')](_0x50c8a4[_0x9134('0x4b')],{})[_0x9134('0x27')](respondWithResult(_0x534f74,0xc9))['catch'](handleError(_0x534f74,null));};exports['update']=function(_0x1df96f,_0x1fe98c){if(_0x1df96f['body']['id']){delete _0x1df96f[_0x9134('0x4b')]['id'];}return db[_0x9134('0x2d')][_0x9134('0x49')]({'where':{'id':_0x1df96f[_0x9134('0x47')]['id']}})[_0x9134('0x27')](handleEntityNotFound(_0x1fe98c,null))[_0x9134('0x27')](saveUpdates(_0x1df96f['body'],null))[_0x9134('0x27')](respondWithResult(_0x1fe98c,null))[_0x9134('0x45')](handleError(_0x1fe98c,null));};exports[_0x9134('0x28')]=function(_0x23cba5,_0x4071c3){return db['SquareReport'][_0x9134('0x49')]({'where':{'id':_0x23cba5[_0x9134('0x47')]['id']}})['then'](handleEntityNotFound(_0x4071c3,null))['then'](removeEntity(_0x4071c3,null))[_0x9134('0x45')](handleError(_0x4071c3,null));};exports[_0x9134('0x4c')]=function(_0x133b72,_0xc96d1f){return db['SquareReport']['describe']()[_0x9134('0x27')](respondWithResult(_0xc96d1f,null))[_0x9134('0x45')](handleError(_0xc96d1f,null));}; \ No newline at end of file +var _0x89c7=['rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe'];(function(_0xe217f9,_0x5148b6){var _0x30f830=function(_0xa68075){while(--_0xa68075){_0xe217f9['push'](_0xe217f9['shift']());}};_0x30f830(++_0x5148b6);}(_0x89c7,0x134));var _0x789c=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x89c7[_0x3a9815];return _0x188653;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x789c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x789c('0x1'));var rp=require('request-promise');var moment=require(_0x789c('0x2'));var BPromise=require(_0x789c('0x3'));var Mustache=require(_0x789c('0x4'));var util=require('util');var path=require(_0x789c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x789c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x789c('0x7'));var squel=require(_0x789c('0x8'));var crypto=require(_0x789c('0x9'));var jsforce=require(_0x789c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x789c('0xb'));var querystring=require(_0x789c('0xc'));var Papa=require(_0x789c('0xd'));var Redis=require(_0x789c('0xe'));var authService=require(_0x789c('0xf'));var qs=require(_0x789c('0x10'));var as=require(_0x789c('0x11'));var hardwareService=require(_0x789c('0x12'));var logger=require(_0x789c('0x13'))(_0x789c('0x14'));var utils=require(_0x789c('0x15'));var config=require(_0x789c('0x16'));var licenseUtil=require(_0x789c('0x17'));var db=require(_0x789c('0x18'))['db'];function respondWithStatusCode(_0x4008e2,_0x3279e8){_0x3279e8=_0x3279e8||0xcc;return function(_0x37d8df){if(_0x37d8df){return _0x4008e2[_0x789c('0x19')](_0x3279e8);}return _0x4008e2[_0x789c('0x1a')](_0x3279e8)[_0x789c('0x1b')]();};}function respondWithResult(_0x433255,_0x3b227b){_0x3b227b=_0x3b227b||0xc8;return function(_0x594c85){if(_0x594c85){return _0x433255[_0x789c('0x1a')](_0x3b227b)['json'](_0x594c85);}};}function respondWithFilteredResult(_0x416c65,_0x4174a9){return function(_0x35560e){if(_0x35560e){var _0x404294=typeof _0x4174a9[_0x789c('0x1c')]===_0x789c('0x1d')&&typeof _0x4174a9['limit']==='undefined';var _0x30dbf7=_0x35560e[_0x789c('0x1e')];var _0x1e7cad=_0x404294?0x0:_0x4174a9[_0x789c('0x1c')];var _0x267c24=_0x404294?_0x35560e[_0x789c('0x1e')]:_0x4174a9[_0x789c('0x1c')]+_0x4174a9[_0x789c('0x1f')];var _0x4d5a95;if(_0x267c24>=_0x30dbf7){_0x267c24=_0x30dbf7;_0x4d5a95=0xc8;}else{_0x4d5a95=0xce;}_0x416c65['status'](_0x4d5a95);return _0x416c65[_0x789c('0x20')](_0x789c('0x21'),_0x1e7cad+'-'+_0x267c24+'/'+_0x30dbf7)[_0x789c('0x22')](_0x35560e);}return null;};}function patchUpdates(_0x111d81){return function(_0x4d46a1){try{jsonpatch[_0x789c('0x23')](_0x4d46a1,_0x111d81,!![]);}catch(_0x52f9d1){return BPromise[_0x789c('0x24')](_0x52f9d1);}return _0x4d46a1[_0x789c('0x25')]();};}function saveUpdates(_0x2234a1,_0x52d178){return function(_0x5ebe72){if(_0x5ebe72){return _0x5ebe72[_0x789c('0x26')](_0x2234a1)[_0x789c('0x27')](function(_0x552185){return _0x552185;});}return null;};}function removeEntity(_0x56e1ad,_0x59ee1e){return function(_0x2e2b53){if(_0x2e2b53){return _0x2e2b53['destroy']()[_0x789c('0x27')](function(){_0x56e1ad[_0x789c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30136b,_0x5eb028){return function(_0x1b8b53){if(!_0x1b8b53){_0x30136b['sendStatus'](0x194);}return _0x1b8b53;};}function handleError(_0x35a8a8,_0x35285b){_0x35285b=_0x35285b||0x1f4;return function(_0x48ce23){logger[_0x789c('0x28')](_0x48ce23[_0x789c('0x29')]);if(_0x48ce23[_0x789c('0x2a')]){delete _0x48ce23[_0x789c('0x2a')];}_0x35a8a8[_0x789c('0x1a')](_0x35285b)['send'](_0x48ce23);};}exports[_0x789c('0x2b')]=function(_0x3935de,_0x38c101){var _0x3d4430={},_0x49aa5e={},_0x172c9f={'count':0x0,'rows':[]};var _0x187a81=_['map'](db[_0x789c('0x2c')][_0x789c('0x2d')],function(_0x408982){return{'name':_0x408982[_0x789c('0x2e')],'type':_0x408982[_0x789c('0x2f')][_0x789c('0x30')]};});_0x49aa5e['model']=_[_0x789c('0x31')](_0x187a81,_0x789c('0x2a'));_0x49aa5e[_0x789c('0x32')]=_['keys'](_0x3935de[_0x789c('0x32')]);_0x49aa5e[_0x789c('0x33')]=_[_0x789c('0x34')](_0x49aa5e[_0x789c('0x35')],_0x49aa5e[_0x789c('0x32')]);_0x3d4430[_0x789c('0x36')]=_[_0x789c('0x34')](_0x49aa5e[_0x789c('0x35')],qs[_0x789c('0x37')](_0x3935de[_0x789c('0x32')][_0x789c('0x37')]));_0x3d4430[_0x789c('0x36')]=_0x3d4430[_0x789c('0x36')][_0x789c('0x38')]?_0x3d4430[_0x789c('0x36')]:_0x49aa5e[_0x789c('0x35')];if(!_0x3935de[_0x789c('0x32')][_0x789c('0x39')](_0x789c('0x3a'))){_0x3d4430[_0x789c('0x1f')]=qs[_0x789c('0x1f')](_0x3935de[_0x789c('0x32')][_0x789c('0x1f')]);_0x3d4430[_0x789c('0x1c')]=qs[_0x789c('0x1c')](_0x3935de['query'][_0x789c('0x1c')]);}_0x3d4430[_0x789c('0x3b')]=qs['sort'](_0x3935de[_0x789c('0x32')]['sort']);_0x3d4430['where']=qs['filters'](_[_0x789c('0x3c')](_0x3935de['query'],_0x49aa5e[_0x789c('0x33')]),_0x187a81);if(_0x3935de['query']['filter']){_0x3d4430[_0x789c('0x3d')]=_[_0x789c('0x3e')](_0x3d4430[_0x789c('0x3d')],{'$or':_[_0x789c('0x31')](_0x187a81,function(_0x4dfe79){if(_0x4dfe79[_0x789c('0x2f')]!==_0x789c('0x3f')){var _0x74a7df={};_0x74a7df[_0x4dfe79[_0x789c('0x2a')]]={'$like':'%'+_0x3935de[_0x789c('0x32')]['filter']+'%'};return _0x74a7df;}})});}_0x3d4430=_[_0x789c('0x3e')]({},_0x3d4430,_0x3935de['options']);var _0x3a6cc4={'where':_0x3d4430[_0x789c('0x3d')]};return db[_0x789c('0x2c')][_0x789c('0x1e')](_0x3a6cc4)[_0x789c('0x27')](function(_0x21a771){_0x172c9f[_0x789c('0x1e')]=_0x21a771;if(_0x3935de['query'][_0x789c('0x40')]){_0x3d4430[_0x789c('0x41')]=[{'all':!![]}];}return db[_0x789c('0x2c')][_0x789c('0x42')](_0x3d4430);})[_0x789c('0x27')](function(_0x3b9083){_0x172c9f[_0x789c('0x43')]=_0x3b9083;return _0x172c9f;})[_0x789c('0x27')](respondWithFilteredResult(_0x38c101,_0x3d4430))[_0x789c('0x44')](handleError(_0x38c101,null));};exports[_0x789c('0x45')]=function(_0x231915,_0x1b29d6){var _0x25864f={'raw':!![],'where':{'id':_0x231915[_0x789c('0x46')]['id']}},_0x2cb75e={};_0x2cb75e['model']=_[_0x789c('0x47')](db['SquareReport'][_0x789c('0x2d')]);_0x2cb75e[_0x789c('0x32')]=_[_0x789c('0x47')](_0x231915['query']);_0x2cb75e[_0x789c('0x33')]=_[_0x789c('0x34')](_0x2cb75e[_0x789c('0x35')],_0x2cb75e['query']);_0x25864f[_0x789c('0x36')]=_['intersection'](_0x2cb75e[_0x789c('0x35')],qs[_0x789c('0x37')](_0x231915[_0x789c('0x32')]['fields']));_0x25864f[_0x789c('0x36')]=_0x25864f[_0x789c('0x36')][_0x789c('0x38')]?_0x25864f[_0x789c('0x36')]:_0x2cb75e[_0x789c('0x35')];if(_0x231915['query'][_0x789c('0x40')]){_0x25864f[_0x789c('0x41')]=[{'all':!![]}];}_0x25864f=_[_0x789c('0x3e')]({},_0x25864f,_0x231915[_0x789c('0x48')]);return db[_0x789c('0x2c')][_0x789c('0x49')](_0x25864f)[_0x789c('0x27')](handleEntityNotFound(_0x1b29d6,null))[_0x789c('0x27')](respondWithResult(_0x1b29d6,null))[_0x789c('0x44')](handleError(_0x1b29d6,null));};exports[_0x789c('0x4a')]=function(_0x36faf7,_0x56eb34){return db[_0x789c('0x2c')]['create'](_0x36faf7['body'],{})[_0x789c('0x27')](respondWithResult(_0x56eb34,0xc9))[_0x789c('0x44')](handleError(_0x56eb34,null));};exports[_0x789c('0x26')]=function(_0x3347a6,_0x10bd45){if(_0x3347a6['body']['id']){delete _0x3347a6[_0x789c('0x4b')]['id'];}return db['SquareReport'][_0x789c('0x49')]({'where':{'id':_0x3347a6[_0x789c('0x46')]['id']}})[_0x789c('0x27')](handleEntityNotFound(_0x10bd45,null))[_0x789c('0x27')](saveUpdates(_0x3347a6[_0x789c('0x4b')],null))['then'](respondWithResult(_0x10bd45,null))[_0x789c('0x44')](handleError(_0x10bd45,null));};exports['destroy']=function(_0x3e6394,_0x226877){return db[_0x789c('0x2c')]['find']({'where':{'id':_0x3e6394['params']['id']}})[_0x789c('0x27')](handleEntityNotFound(_0x226877,null))[_0x789c('0x27')](removeEntity(_0x226877,null))[_0x789c('0x44')](handleError(_0x226877,null));};exports[_0x789c('0x4c')]=function(_0x241eab,_0x388403){return db['SquareReport'][_0x789c('0x4c')]()[_0x789c('0x27')](respondWithResult(_0x388403,null))['catch'](handleError(_0x388403,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5f75f4e..d6aa17b 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 _0x4d63=['bluebird','rimraf','exports','define','report_square','uid_pname','uniqueid','util','../../config/logger','api','moment'];(function(_0x514816,_0x57c091){var _0x5c3a43=function(_0xd4a413){while(--_0xd4a413){_0x514816['push'](_0x514816['shift']());}};_0x5c3a43(++_0x57c091);}(_0x4d63,0x1eb));var _0x34d6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4d63[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x34d6('0x0'));var logger=require(_0x34d6('0x1'))(_0x34d6('0x2'));var moment=require(_0x34d6('0x3'));var BPromise=require(_0x34d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x34d6('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x34d6('0x6')]=function(_0xebf78f,_0x5a8687){return _0xebf78f[_0x34d6('0x7')]('SquareReport',attributes,{'tableName':_0x34d6('0x8'),'paranoid':![],'indexes':[{'name':_0x34d6('0x9'),'fields':[_0x34d6('0xa'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb34=['report_square','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport'];(function(_0xb879fa,_0x264b04){var _0x1548b8=function(_0x504845){while(--_0x504845){_0xb879fa['push'](_0xb879fa['shift']());}};_0x1548b8(++_0x264b04);}(_0xcb34,0x9d));var _0x4cb3=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xcb34[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x4cb3('0x0'));var util=require(_0x4cb3('0x1'));var logger=require(_0x4cb3('0x2'))('api');var moment=require(_0x4cb3('0x3'));var BPromise=require(_0x4cb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cb3('0x5'));var rimraf=require(_0x4cb3('0x6'));var config=require(_0x4cb3('0x7'));var attributes=require(_0x4cb3('0x8'));module['exports']=function(_0x2cf8bd,_0x8f65d8){return _0x2cf8bd[_0x4cb3('0x9')](_0x4cb3('0xa'),attributes,{'tableName':_0x4cb3('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x4cb3('0xc')]},{'name':_0x4cb3('0xd'),'fields':[_0x4cb3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 34d4f89..56907b8 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 _0x1968=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareReport','create','options','UpdateSquareReport','SquareReport','body','where','limit','stringify','lodash','util','moment'];(function(_0x2a185a,_0x174d25){var _0x51c78d=function(_0x57a332){while(--_0x57a332){_0x2a185a['push'](_0x2a185a['shift']());}};_0x51c78d(++_0x174d25);}(_0x1968,0x1cb));var _0x8196=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x1968[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x8196('0x0'));var util=require(_0x8196('0x1'));var moment=require(_0x8196('0x2'));var BPromise=require(_0x8196('0x3'));var rs=require(_0x8196('0x4'));var fs=require('fs');var Redis=require(_0x8196('0x5'));var db=require(_0x8196('0x6'))['db'];var utils=require(_0x8196('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x8196('0x8'));var jayson=require(_0x8196('0x9'));var client=jayson[_0x8196('0xa')][_0x8196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1857f6,_0x4fde75,_0x483bad){return new BPromise(function(_0x3ba076,_0x5b4831){return client[_0x8196('0xc')](_0x1857f6,_0x483bad)[_0x8196('0xd')](function(_0xdd3853){logger['info'](_0x8196('0xe'),_0x4fde75,_0x8196('0xf'));logger[_0x8196('0x10')](_0x8196('0x11'),_0x4fde75,'request\x20sent',JSON['stringify'](_0xdd3853));if(_0xdd3853[_0x8196('0x12')]){if(_0xdd3853[_0x8196('0x12')][_0x8196('0x13')]===0x1f4){logger[_0x8196('0x12')]('SquareReport,\x20%s,\x20%s',_0x4fde75,_0xdd3853[_0x8196('0x12')][_0x8196('0x14')]);return _0x5b4831(_0xdd3853[_0x8196('0x12')]['message']);}logger[_0x8196('0x12')]('SquareReport,\x20%s,\x20%s',_0x4fde75,_0xdd3853[_0x8196('0x12')]['message']);return _0x3ba076(_0xdd3853[_0x8196('0x12')][_0x8196('0x14')]);}else{logger[_0x8196('0x15')]('SquareReport,\x20%s,\x20%s',_0x4fde75,_0x8196('0xf'));_0x3ba076(_0xdd3853[_0x8196('0x16')][_0x8196('0x14')]);}})[_0x8196('0x17')](function(_0xfe5e91){logger[_0x8196('0x12')]('SquareReport,\x20%s,\x20%s',_0x4fde75,_0xfe5e91);_0x5b4831(_0xfe5e91);});});}exports[_0x8196('0x18')]=function(_0x257236){var _0xbeb822=this;return new Promise(function(_0x2d26b8,_0x1e84fe){return db['SquareReport'][_0x8196('0x19')](_0x257236['body'],{'raw':_0x257236[_0x8196('0x1a')]?_0x257236[_0x8196('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x951824){logger[_0x8196('0x15')](_0x8196('0x18'),_0x257236);logger[_0x8196('0x10')](_0x8196('0x18'),_0x257236,JSON['stringify'](_0x951824));_0x2d26b8(_0x951824);})[_0x8196('0x17')](function(_0x55607d){logger[_0x8196('0x12')](_0x8196('0x18'),_0x55607d[_0x8196('0x14')],_0x257236);_0x1e84fe(_0xbeb822[_0x8196('0x12')](0x1f4,_0x55607d[_0x8196('0x14')]));});});};exports[_0x8196('0x1b')]=function(_0xa5adc4){var _0x6a91e0=this;return new Promise(function(_0x299e33,_0x386d81){return db[_0x8196('0x1c')]['update'](_0xa5adc4[_0x8196('0x1d')],{'raw':_0xa5adc4[_0x8196('0x1a')]?_0xa5adc4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5adc4['options']?_0xa5adc4[_0x8196('0x1a')][_0x8196('0x1e')]||null:null,'attributes':_0xa5adc4['options']?_0xa5adc4[_0x8196('0x1a')]['attributes']||null:null,'limit':_0xa5adc4[_0x8196('0x1a')]?_0xa5adc4[_0x8196('0x1a')][_0x8196('0x1f')]||null:null})['then'](function(_0x36850d){logger[_0x8196('0x15')]('UpdateSquareReport',_0xa5adc4);logger[_0x8196('0x10')]('UpdateSquareReport',_0xa5adc4,JSON[_0x8196('0x20')](_0x36850d));_0x299e33(_0x36850d);})[_0x8196('0x17')](function(_0x5040d8){logger[_0x8196('0x12')](_0x8196('0x1b'),_0x5040d8[_0x8196('0x14')],_0xa5adc4);_0x386d81(_0x6a91e0[_0x8196('0x12')](0x1f4,_0x5040d8[_0x8196('0x14')]));});});}; \ No newline at end of file +var _0xc9df=['message','info','request\x20sent','result','catch','SquareReport','create','body','options','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0xc9df,0x159));var _0xfc9d=function(_0x56d124,_0xe2886f){_0x56d124=_0x56d124-0x0;var _0x5aff5f=_0xc9df[_0x56d124];return _0x5aff5f;};'use strict';var _=require('lodash');var util=require(_0xfc9d('0x0'));var moment=require('moment');var BPromise=require(_0xfc9d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc9d('0x2'));var db=require(_0xfc9d('0x3'))['db'];var utils=require(_0xfc9d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc9d('0x5'));var jayson=require(_0xfc9d('0x6'));var client=jayson['client'][_0xfc9d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38affc,_0x2ceba9,_0x488e57){return new BPromise(function(_0x4b1446,_0x39ba81){return client[_0xfc9d('0x8')](_0x38affc,_0x488e57)[_0xfc9d('0x9')](function(_0x4efc57){logger['info']('SquareReport,\x20%s,\x20%s',_0x2ceba9,'request\x20sent');logger[_0xfc9d('0xa')](_0xfc9d('0xb'),_0x2ceba9,'request\x20sent',JSON[_0xfc9d('0xc')](_0x4efc57));if(_0x4efc57[_0xfc9d('0xd')]){if(_0x4efc57[_0xfc9d('0xd')]['code']===0x1f4){logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x4efc57[_0xfc9d('0xd')][_0xfc9d('0xf')]);return _0x39ba81(_0x4efc57[_0xfc9d('0xd')]['message']);}logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x4efc57[_0xfc9d('0xd')][_0xfc9d('0xf')]);return _0x4b1446(_0x4efc57['error'][_0xfc9d('0xf')]);}else{logger[_0xfc9d('0x10')](_0xfc9d('0xe'),_0x2ceba9,_0xfc9d('0x11'));_0x4b1446(_0x4efc57[_0xfc9d('0x12')]['message']);}})[_0xfc9d('0x13')](function(_0x3f5bfb){logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x3f5bfb);_0x39ba81(_0x3f5bfb);});});}exports['CreateSquareReport']=function(_0x232513){var _0x3b821c=this;return new Promise(function(_0x3a2636,_0x466ae7){return db[_0xfc9d('0x14')][_0xfc9d('0x15')](_0x232513[_0xfc9d('0x16')],{'raw':_0x232513[_0xfc9d('0x17')]?_0x232513[_0xfc9d('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b6d37){logger[_0xfc9d('0x10')](_0xfc9d('0x18'),_0x232513);logger[_0xfc9d('0xa')](_0xfc9d('0x18'),_0x232513,JSON[_0xfc9d('0xc')](_0x5b6d37));_0x3a2636(_0x5b6d37);})[_0xfc9d('0x13')](function(_0x398b26){logger[_0xfc9d('0xd')](_0xfc9d('0x18'),_0x398b26['message'],_0x232513);_0x466ae7(_0x3b821c[_0xfc9d('0xd')](0x1f4,_0x398b26['message']));});});};exports[_0xfc9d('0x19')]=function(_0x599c1d){var _0x500315=this;return new Promise(function(_0x31d597,_0x157e30){return db[_0xfc9d('0x14')][_0xfc9d('0x1a')](_0x599c1d[_0xfc9d('0x16')],{'raw':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1b')]||null:null,'attributes':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1c')]||null:null,'limit':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1d')]||null:null})[_0xfc9d('0x9')](function(_0x52d8ca){logger[_0xfc9d('0x10')]('UpdateSquareReport',_0x599c1d);logger['debug'](_0xfc9d('0x19'),_0x599c1d,JSON['stringify'](_0x52d8ca));_0x31d597(_0x52d8ca);})[_0xfc9d('0x13')](function(_0x59d88f){logger[_0xfc9d('0xd')](_0xfc9d('0x19'),_0x59d88f['message'],_0x599c1d);_0x157e30(_0x500315[_0xfc9d('0xd')](0x1f4,_0x59d88f[_0xfc9d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 06139e7..8150b95 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 _0xa2d5=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xa2d5,0x1a5));var _0x5a2d=function(_0x36b068,_0x1cbb12){_0x36b068=_0x36b068-0x0;var _0x5cdab=_0xa2d5[_0x36b068];return _0x5cdab;};'use strict';var multer=require(_0x5a2d('0x0'));var util=require(_0x5a2d('0x1'));var path=require(_0x5a2d('0x2'));var timeout=require(_0x5a2d('0x3'));var express=require(_0x5a2d('0x4'));var router=express[_0x5a2d('0x5')]();var fs_extra=require(_0x5a2d('0x6'));var auth=require(_0x5a2d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a2d('0x8'));var controller=require(_0x5a2d('0x9'));router['get']('/',auth[_0x5a2d('0xa')](),controller[_0x5a2d('0xb')]);router[_0x5a2d('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x5a2d('0xd')]);router[_0x5a2d('0xc')](_0x5a2d('0xe'),auth[_0x5a2d('0xa')](),controller[_0x5a2d('0xf')]);router[_0x5a2d('0x10')]('/',auth[_0x5a2d('0xa')](),controller[_0x5a2d('0x11')]);router[_0x5a2d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5a2d('0x13')]);router[_0x5a2d('0x14')](_0x5a2d('0xe'),auth[_0x5a2d('0xa')](),controller[_0x5a2d('0x15')]);module[_0x5a2d('0x16')]=router; \ No newline at end of file +var _0xdb12=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xdb12,0x100));var _0x2db1=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0xdb12[_0x7abd7];return _0x3a2577;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2db1('0x0'));var express=require(_0x2db1('0x1'));var router=express[_0x2db1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2db1('0x3'));var interaction=require(_0x2db1('0x4'));var config=require(_0x2db1('0x5'));var controller=require(_0x2db1('0x6'));router[_0x2db1('0x7')]('/',auth[_0x2db1('0x8')](),controller[_0x2db1('0x9')]);router[_0x2db1('0x7')](_0x2db1('0xa'),auth[_0x2db1('0x8')](),controller['describe']);router[_0x2db1('0x7')](_0x2db1('0xb'),auth[_0x2db1('0x8')](),controller[_0x2db1('0xc')]);router['post']('/',auth[_0x2db1('0x8')](),controller[_0x2db1('0xd')]);router[_0x2db1('0xe')]('/:id',auth[_0x2db1('0x8')](),controller['update']);router[_0x2db1('0xf')](_0x2db1('0xb'),auth[_0x2db1('0x8')](),controller['destroy']);module[_0x2db1('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8a06b59..c49b788 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 _0xbfb7=['STRING','exports'];(function(_0x89da83,_0x31d009){var _0x39a06a=function(_0x35c013){while(--_0x35c013){_0x89da83['push'](_0x89da83['shift']());}};_0x39a06a(++_0x31d009);}(_0xbfb7,0x1af));var _0x7bfb=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0xbfb7[_0x19e928];return _0x4e941f;};'use strict';var Sequelize=require('sequelize');module[_0x7bfb('0x0')]={'uniqueid':{'type':Sequelize[_0x7bfb('0x1')]},'node':{'type':Sequelize[_0x7bfb('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x7bfb('0x1')]},'callerid':{'type':Sequelize[_0x7bfb('0x1')]}}; \ No newline at end of file +var _0x6964=['exports','STRING','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x6964,0x1ca));var _0x4696=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x6964[_0x2bf888];return _0x3038d6;};'use strict';var Sequelize=require(_0x4696('0x0'));module[_0x4696('0x1')]={'uniqueid':{'type':Sequelize[_0x4696('0x2')]},'node':{'type':Sequelize[_0x4696('0x2')]},'application':{'type':Sequelize[_0x4696('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4696('0x2')]},'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 6233ec5..dc53176 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 _0x89b2=['lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','error','stack','name','send','map','rawAttributes','fieldName','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','then','rows','show','params','length','create','body','catch','update','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x34f5e8,_0x508de0){var _0x55c7fa=function(_0x5ae479){while(--_0x5ae479){_0x34f5e8['push'](_0x34f5e8['shift']());}};_0x55c7fa(++_0x508de0);}(_0x89b2,0x124));var _0x289b=function(_0x44b057,_0x4f87f2){_0x44b057=_0x44b057-0x0;var _0x440a12=_0x89b2[_0x44b057];return _0x440a12;};'use strict';var emlformat=require(_0x289b('0x0'));var rimraf=require(_0x289b('0x1'));var zipdir=require(_0x289b('0x2'));var jsonpatch=require(_0x289b('0x3'));var rp=require('request-promise');var moment=require(_0x289b('0x4'));var BPromise=require(_0x289b('0x5'));var Mustache=require(_0x289b('0x6'));var util=require(_0x289b('0x7'));var path=require(_0x289b('0x8'));var sox=require(_0x289b('0x9'));var csv=require('to-csv');var ejs=require(_0x289b('0xa'));var fs=require('fs');var fs_extra=require(_0x289b('0xb'));var _=require(_0x289b('0xc'));var squel=require(_0x289b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x289b('0xe'));var Papa=require(_0x289b('0xf'));var Redis=require('ioredis');var authService=require(_0x289b('0x10'));var qs=require(_0x289b('0x11'));var as=require(_0x289b('0x12'));var hardwareService=require(_0x289b('0x13'));var logger=require(_0x289b('0x14'))('api');var utils=require(_0x289b('0x15'));var config=require(_0x289b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x289b('0x17'))['db'];function respondWithStatusCode(_0x16d7ae,_0x839169){_0x839169=_0x839169||0xcc;return function(_0x17280d){if(_0x17280d){return _0x16d7ae[_0x289b('0x18')](_0x839169);}return _0x16d7ae['status'](_0x839169)[_0x289b('0x19')]();};}function respondWithResult(_0x4c8961,_0x525a8b){_0x525a8b=_0x525a8b||0xc8;return function(_0x5cd2d8){if(_0x5cd2d8){return _0x4c8961[_0x289b('0x1a')](_0x525a8b)[_0x289b('0x1b')](_0x5cd2d8);}};}function respondWithFilteredResult(_0x154874,_0x108e33){return function(_0x45ae69){if(_0x45ae69){var _0x158ef6=typeof _0x108e33[_0x289b('0x1c')]===_0x289b('0x1d')&&typeof _0x108e33[_0x289b('0x1e')]===_0x289b('0x1d');var _0x125f06=_0x45ae69[_0x289b('0x1f')];var _0x55e7f4=_0x158ef6?0x0:_0x108e33[_0x289b('0x1c')];var _0x11a0b1=_0x158ef6?_0x45ae69[_0x289b('0x1f')]:_0x108e33[_0x289b('0x1c')]+_0x108e33[_0x289b('0x1e')];var _0x26836e;if(_0x11a0b1>=_0x125f06){_0x11a0b1=_0x125f06;_0x26836e=0xc8;}else{_0x26836e=0xce;}_0x154874[_0x289b('0x1a')](_0x26836e);return _0x154874[_0x289b('0x20')](_0x289b('0x21'),_0x55e7f4+'-'+_0x11a0b1+'/'+_0x125f06)[_0x289b('0x1b')](_0x45ae69);}return null;};}function patchUpdates(_0x619bae){return function(_0x17506f){try{jsonpatch['apply'](_0x17506f,_0x619bae,!![]);}catch(_0x44039e){return BPromise[_0x289b('0x22')](_0x44039e);}return _0x17506f[_0x289b('0x23')]();};}function saveUpdates(_0x36360b,_0x40a02b){return function(_0xbda1df){if(_0xbda1df){return _0xbda1df['update'](_0x36360b)['then'](function(_0x29f49e){return _0x29f49e;});}return null;};}function removeEntity(_0x917c83,_0x57840d){return function(_0x2b3261){if(_0x2b3261){return _0x2b3261['destroy']()['then'](function(){_0x917c83['status'](0xcc)[_0x289b('0x19')]();});}};}function handleEntityNotFound(_0x4de40a,_0x37e5ea){return function(_0x227396){if(!_0x227396){_0x4de40a[_0x289b('0x18')](0x194);}return _0x227396;};}function handleError(_0x912c61,_0x4dbd3a){_0x4dbd3a=_0x4dbd3a||0x1f4;return function(_0x4e48f9){logger[_0x289b('0x24')](_0x4e48f9[_0x289b('0x25')]);if(_0x4e48f9['name']){delete _0x4e48f9[_0x289b('0x26')];}_0x912c61[_0x289b('0x1a')](_0x4dbd3a)[_0x289b('0x27')](_0x4e48f9);};}exports['index']=function(_0x45dd54,_0x5bfb64){var _0x596977={},_0x4e6d31={},_0x50601d={'count':0x0,'rows':[]};var _0x2053cb=_[_0x289b('0x28')](db['SquareDetailsReport'][_0x289b('0x29')],function(_0x22f4b9){return{'name':_0x22f4b9[_0x289b('0x2a')],'type':_0x22f4b9['type']['key']};});_0x4e6d31['model']=_[_0x289b('0x28')](_0x2053cb,'name');_0x4e6d31['query']=_[_0x289b('0x2b')](_0x45dd54[_0x289b('0x2c')]);_0x4e6d31['filters']=_[_0x289b('0x2d')](_0x4e6d31[_0x289b('0x2e')],_0x4e6d31[_0x289b('0x2c')]);_0x596977['attributes']=_[_0x289b('0x2d')](_0x4e6d31[_0x289b('0x2e')],qs[_0x289b('0x2f')](_0x45dd54[_0x289b('0x2c')][_0x289b('0x2f')]));_0x596977[_0x289b('0x30')]=_0x596977[_0x289b('0x30')]['length']?_0x596977[_0x289b('0x30')]:_0x4e6d31[_0x289b('0x2e')];if(!_0x45dd54[_0x289b('0x2c')][_0x289b('0x31')](_0x289b('0x32'))){_0x596977['limit']=qs[_0x289b('0x1e')](_0x45dd54[_0x289b('0x2c')][_0x289b('0x1e')]);_0x596977[_0x289b('0x1c')]=qs[_0x289b('0x1c')](_0x45dd54['query'][_0x289b('0x1c')]);}_0x596977['order']=qs[_0x289b('0x33')](_0x45dd54['query'][_0x289b('0x33')]);_0x596977['where']=qs[_0x289b('0x34')](_[_0x289b('0x35')](_0x45dd54[_0x289b('0x2c')],_0x4e6d31[_0x289b('0x34')]),_0x2053cb);if(_0x45dd54[_0x289b('0x2c')][_0x289b('0x36')]){_0x596977[_0x289b('0x37')]=_[_0x289b('0x38')](_0x596977[_0x289b('0x37')],{'$or':_[_0x289b('0x28')](_0x2053cb,function(_0x1baf28){if(_0x1baf28[_0x289b('0x39')]!==_0x289b('0x3a')){var _0x3aa3fe={};_0x3aa3fe[_0x1baf28['name']]={'$like':'%'+_0x45dd54[_0x289b('0x2c')][_0x289b('0x36')]+'%'};return _0x3aa3fe;}})});}_0x596977=_[_0x289b('0x38')]({},_0x596977,_0x45dd54[_0x289b('0x3b')]);var _0x234561={'where':_0x596977['where']};return db[_0x289b('0x3c')][_0x289b('0x1f')](_0x234561)['then'](function(_0x2c0146){_0x50601d[_0x289b('0x1f')]=_0x2c0146;if(_0x45dd54[_0x289b('0x2c')][_0x289b('0x3d')]){_0x596977[_0x289b('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x289b('0x3f')](_0x596977);})[_0x289b('0x40')](function(_0x9eef36){_0x50601d[_0x289b('0x41')]=_0x9eef36;return _0x50601d;})[_0x289b('0x40')](respondWithFilteredResult(_0x5bfb64,_0x596977))['catch'](handleError(_0x5bfb64,null));};exports[_0x289b('0x42')]=function(_0x28cff4,_0xcc6c4c){var _0x10a29e={'raw':!![],'where':{'id':_0x28cff4[_0x289b('0x43')]['id']}},_0x2a14b1={};_0x2a14b1['model']=_[_0x289b('0x2b')](db['SquareDetailsReport'][_0x289b('0x29')]);_0x2a14b1['query']=_[_0x289b('0x2b')](_0x28cff4[_0x289b('0x2c')]);_0x2a14b1[_0x289b('0x34')]=_[_0x289b('0x2d')](_0x2a14b1[_0x289b('0x2e')],_0x2a14b1[_0x289b('0x2c')]);_0x10a29e[_0x289b('0x30')]=_[_0x289b('0x2d')](_0x2a14b1[_0x289b('0x2e')],qs[_0x289b('0x2f')](_0x28cff4[_0x289b('0x2c')]['fields']));_0x10a29e['attributes']=_0x10a29e[_0x289b('0x30')][_0x289b('0x44')]?_0x10a29e[_0x289b('0x30')]:_0x2a14b1[_0x289b('0x2e')];if(_0x28cff4['query'][_0x289b('0x3d')]){_0x10a29e[_0x289b('0x3e')]=[{'all':!![]}];}_0x10a29e=_[_0x289b('0x38')]({},_0x10a29e,_0x28cff4[_0x289b('0x3b')]);return db['SquareDetailsReport']['find'](_0x10a29e)[_0x289b('0x40')](handleEntityNotFound(_0xcc6c4c,null))[_0x289b('0x40')](respondWithResult(_0xcc6c4c,null))['catch'](handleError(_0xcc6c4c,null));};exports[_0x289b('0x45')]=function(_0x38e08b,_0x45fa31){return db[_0x289b('0x3c')]['create'](_0x38e08b[_0x289b('0x46')],{})[_0x289b('0x40')](respondWithResult(_0x45fa31,0xc9))[_0x289b('0x47')](handleError(_0x45fa31,null));};exports[_0x289b('0x48')]=function(_0x35e3db,_0x432298){if(_0x35e3db[_0x289b('0x46')]['id']){delete _0x35e3db[_0x289b('0x46')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x35e3db[_0x289b('0x43')]['id']}})[_0x289b('0x40')](handleEntityNotFound(_0x432298,null))[_0x289b('0x40')](saveUpdates(_0x35e3db['body'],null))[_0x289b('0x40')](respondWithResult(_0x432298,null))[_0x289b('0x47')](handleError(_0x432298,null));};exports[_0x289b('0x49')]=function(_0xd3db6c,_0x33f752){return db[_0x289b('0x3c')][_0x289b('0x4a')]({'where':{'id':_0xd3db6c[_0x289b('0x43')]['id']}})[_0x289b('0x40')](handleEntityNotFound(_0x33f752,null))[_0x289b('0x40')](removeEntity(_0x33f752,null))[_0x289b('0x47')](handleError(_0x33f752,null));};exports[_0x289b('0x4b')]=function(_0x35bd27,_0x46641c){return db[_0x289b('0x3c')][_0x289b('0x4b')]()[_0x289b('0x40')](respondWithResult(_0x46641c,null))[_0x289b('0x47')](handleError(_0x46641c,null));}; \ No newline at end of file +var _0xff2a=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','apply','reject','save','then','error','stack','send','index','map','SquareDetailsReport','rawAttributes','fieldName','name','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','type','filter','includeAll','include','rows','catch','show','params','options','find','create','body','update','describe'];(function(_0xe1b2a8,_0x38f786){var _0x554804=function(_0x412030){while(--_0x412030){_0xe1b2a8['push'](_0xe1b2a8['shift']());}};_0x554804(++_0x38f786);}(_0xff2a,0x8e));var _0xaff2=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xff2a[_0x79b649];return _0x1af9b1;};'use strict';var emlformat=require(_0xaff2('0x0'));var rimraf=require(_0xaff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaff2('0x2'));var rp=require(_0xaff2('0x3'));var moment=require(_0xaff2('0x4'));var BPromise=require(_0xaff2('0x5'));var Mustache=require(_0xaff2('0x6'));var util=require(_0xaff2('0x7'));var path=require(_0xaff2('0x8'));var sox=require(_0xaff2('0x9'));var csv=require('to-csv');var ejs=require(_0xaff2('0xa'));var fs=require('fs');var fs_extra=require(_0xaff2('0xb'));var _=require(_0xaff2('0xc'));var squel=require(_0xaff2('0xd'));var crypto=require('crypto');var jsforce=require(_0xaff2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaff2('0xf'));var querystring=require(_0xaff2('0x10'));var Papa=require(_0xaff2('0x11'));var Redis=require(_0xaff2('0x12'));var authService=require(_0xaff2('0x13'));var qs=require(_0xaff2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaff2('0x15'))('api');var utils=require(_0xaff2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaff2('0x17'));var db=require(_0xaff2('0x18'))['db'];function respondWithStatusCode(_0x40a4b5,_0x5b893c){_0x5b893c=_0x5b893c||0xcc;return function(_0x5b1376){if(_0x5b1376){return _0x40a4b5[_0xaff2('0x19')](_0x5b893c);}return _0x40a4b5[_0xaff2('0x1a')](_0x5b893c)[_0xaff2('0x1b')]();};}function respondWithResult(_0x1a9bd5,_0x30e22f){_0x30e22f=_0x30e22f||0xc8;return function(_0x41a1f7){if(_0x41a1f7){return _0x1a9bd5[_0xaff2('0x1a')](_0x30e22f)[_0xaff2('0x1c')](_0x41a1f7);}};}function respondWithFilteredResult(_0x2c6c47,_0x36a581){return function(_0x3a9579){if(_0x3a9579){var _0x2e9fca=typeof _0x36a581[_0xaff2('0x1d')]==='undefined'&&typeof _0x36a581['limit']==='undefined';var _0x5b73fb=_0x3a9579[_0xaff2('0x1e')];var _0x19cd51=_0x2e9fca?0x0:_0x36a581[_0xaff2('0x1d')];var _0x5b56f4=_0x2e9fca?_0x3a9579['count']:_0x36a581['offset']+_0x36a581[_0xaff2('0x1f')];var _0xe3be72;if(_0x5b56f4>=_0x5b73fb){_0x5b56f4=_0x5b73fb;_0xe3be72=0xc8;}else{_0xe3be72=0xce;}_0x2c6c47['status'](_0xe3be72);return _0x2c6c47['set']('Content-Range',_0x19cd51+'-'+_0x5b56f4+'/'+_0x5b73fb)['json'](_0x3a9579);}return null;};}function patchUpdates(_0x33296b){return function(_0x559c49){try{jsonpatch[_0xaff2('0x20')](_0x559c49,_0x33296b,!![]);}catch(_0x556b57){return BPromise[_0xaff2('0x21')](_0x556b57);}return _0x559c49[_0xaff2('0x22')]();};}function saveUpdates(_0x4aebd9,_0x1c0df7){return function(_0x3bd522){if(_0x3bd522){return _0x3bd522['update'](_0x4aebd9)[_0xaff2('0x23')](function(_0x342537){return _0x342537;});}return null;};}function removeEntity(_0x54e96c,_0x5899cc){return function(_0x1f3021){if(_0x1f3021){return _0x1f3021['destroy']()[_0xaff2('0x23')](function(){_0x54e96c[_0xaff2('0x1a')](0xcc)[_0xaff2('0x1b')]();});}};}function handleEntityNotFound(_0x59a997,_0x596d9d){return function(_0x27310b){if(!_0x27310b){_0x59a997[_0xaff2('0x19')](0x194);}return _0x27310b;};}function handleError(_0x27cfa6,_0x5b2576){_0x5b2576=_0x5b2576||0x1f4;return function(_0x134c3b){logger[_0xaff2('0x24')](_0x134c3b[_0xaff2('0x25')]);if(_0x134c3b['name']){delete _0x134c3b['name'];}_0x27cfa6[_0xaff2('0x1a')](_0x5b2576)[_0xaff2('0x26')](_0x134c3b);};}exports[_0xaff2('0x27')]=function(_0xfcf072,_0x52d656){var _0x5659fc={},_0x26721a={},_0x1ae760={'count':0x0,'rows':[]};var _0x32e91b=_[_0xaff2('0x28')](db[_0xaff2('0x29')][_0xaff2('0x2a')],function(_0x156589){return{'name':_0x156589[_0xaff2('0x2b')],'type':_0x156589['type']['key']};});_0x26721a['model']=_[_0xaff2('0x28')](_0x32e91b,_0xaff2('0x2c'));_0x26721a[_0xaff2('0x2d')]=_[_0xaff2('0x2e')](_0xfcf072['query']);_0x26721a[_0xaff2('0x2f')]=_['intersection'](_0x26721a[_0xaff2('0x30')],_0x26721a[_0xaff2('0x2d')]);_0x5659fc[_0xaff2('0x31')]=_[_0xaff2('0x32')](_0x26721a[_0xaff2('0x30')],qs[_0xaff2('0x33')](_0xfcf072['query']['fields']));_0x5659fc['attributes']=_0x5659fc[_0xaff2('0x31')]['length']?_0x5659fc['attributes']:_0x26721a[_0xaff2('0x30')];if(!_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x34')]('nolimit')){_0x5659fc[_0xaff2('0x1f')]=qs[_0xaff2('0x1f')](_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x1f')]);_0x5659fc['offset']=qs[_0xaff2('0x1d')](_0xfcf072['query'][_0xaff2('0x1d')]);}_0x5659fc[_0xaff2('0x35')]=qs[_0xaff2('0x36')](_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x36')]);_0x5659fc[_0xaff2('0x37')]=qs[_0xaff2('0x2f')](_['pick'](_0xfcf072[_0xaff2('0x2d')],_0x26721a[_0xaff2('0x2f')]),_0x32e91b);if(_0xfcf072[_0xaff2('0x2d')]['filter']){_0x5659fc[_0xaff2('0x37')]=_[_0xaff2('0x38')](_0x5659fc[_0xaff2('0x37')],{'$or':_['map'](_0x32e91b,function(_0x799b1d){if(_0x799b1d[_0xaff2('0x39')]!=='VIRTUAL'){var _0x581a97={};_0x581a97[_0x799b1d[_0xaff2('0x2c')]]={'$like':'%'+_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x3a')]+'%'};return _0x581a97;}})});}_0x5659fc=_[_0xaff2('0x38')]({},_0x5659fc,_0xfcf072['options']);var _0x48bcf9={'where':_0x5659fc[_0xaff2('0x37')]};return db['SquareDetailsReport'][_0xaff2('0x1e')](_0x48bcf9)[_0xaff2('0x23')](function(_0x23b41){_0x1ae760[_0xaff2('0x1e')]=_0x23b41;if(_0xfcf072['query'][_0xaff2('0x3b')]){_0x5659fc[_0xaff2('0x3c')]=[{'all':!![]}];}return db[_0xaff2('0x29')]['findAll'](_0x5659fc);})[_0xaff2('0x23')](function(_0x3b36bf){_0x1ae760[_0xaff2('0x3d')]=_0x3b36bf;return _0x1ae760;})[_0xaff2('0x23')](respondWithFilteredResult(_0x52d656,_0x5659fc))[_0xaff2('0x3e')](handleError(_0x52d656,null));};exports[_0xaff2('0x3f')]=function(_0x58278d,_0x24a908){var _0x4ba2ea={'raw':!![],'where':{'id':_0x58278d[_0xaff2('0x40')]['id']}},_0x5e6dc5={};_0x5e6dc5[_0xaff2('0x30')]=_[_0xaff2('0x2e')](db[_0xaff2('0x29')]['rawAttributes']);_0x5e6dc5['query']=_['keys'](_0x58278d[_0xaff2('0x2d')]);_0x5e6dc5[_0xaff2('0x2f')]=_[_0xaff2('0x32')](_0x5e6dc5[_0xaff2('0x30')],_0x5e6dc5['query']);_0x4ba2ea['attributes']=_[_0xaff2('0x32')](_0x5e6dc5[_0xaff2('0x30')],qs[_0xaff2('0x33')](_0x58278d['query'][_0xaff2('0x33')]));_0x4ba2ea['attributes']=_0x4ba2ea[_0xaff2('0x31')]['length']?_0x4ba2ea[_0xaff2('0x31')]:_0x5e6dc5['model'];if(_0x58278d[_0xaff2('0x2d')][_0xaff2('0x3b')]){_0x4ba2ea[_0xaff2('0x3c')]=[{'all':!![]}];}_0x4ba2ea=_[_0xaff2('0x38')]({},_0x4ba2ea,_0x58278d[_0xaff2('0x41')]);return db['SquareDetailsReport'][_0xaff2('0x42')](_0x4ba2ea)[_0xaff2('0x23')](handleEntityNotFound(_0x24a908,null))[_0xaff2('0x23')](respondWithResult(_0x24a908,null))[_0xaff2('0x3e')](handleError(_0x24a908,null));};exports['create']=function(_0x5d713f,_0x3c5586){return db['SquareDetailsReport'][_0xaff2('0x43')](_0x5d713f[_0xaff2('0x44')],{})[_0xaff2('0x23')](respondWithResult(_0x3c5586,0xc9))[_0xaff2('0x3e')](handleError(_0x3c5586,null));};exports[_0xaff2('0x45')]=function(_0xe8e605,_0x2a739e){if(_0xe8e605[_0xaff2('0x44')]['id']){delete _0xe8e605[_0xaff2('0x44')]['id'];}return db[_0xaff2('0x29')][_0xaff2('0x42')]({'where':{'id':_0xe8e605['params']['id']}})[_0xaff2('0x23')](handleEntityNotFound(_0x2a739e,null))[_0xaff2('0x23')](saveUpdates(_0xe8e605[_0xaff2('0x44')],null))['then'](respondWithResult(_0x2a739e,null))[_0xaff2('0x3e')](handleError(_0x2a739e,null));};exports['destroy']=function(_0x1d106b,_0x4a9fff){return db['SquareDetailsReport'][_0xaff2('0x42')]({'where':{'id':_0x1d106b[_0xaff2('0x40')]['id']}})[_0xaff2('0x23')](handleEntityNotFound(_0x4a9fff,null))['then'](removeEntity(_0x4a9fff,null))['catch'](handleError(_0x4a9fff,null));};exports[_0xaff2('0x46')]=function(_0x26595c,_0x35a8b0){return db[_0xaff2('0x29')][_0xaff2('0x46')]()[_0xaff2('0x23')](respondWithResult(_0x35a8b0,null))[_0xaff2('0x3e')](handleError(_0x35a8b0,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f0ac4ab..8feb4b1 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 _0xbf5c=['moment','bluebird','path','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x41fb61,_0x266570){var _0x6e0a3e=function(_0x223636){while(--_0x223636){_0x41fb61['push'](_0x41fb61['shift']());}};_0x6e0a3e(++_0x266570);}(_0xbf5c,0x151));var _0xcbf5=function(_0x13b65c,_0x1aa36f){_0x13b65c=_0x13b65c-0x0;var _0xb7b670=_0xbf5c[_0x13b65c];return _0xb7b670;};'use strict';var _=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var logger=require(_0xcbf5('0x2'))(_0xcbf5('0x3'));var moment=require(_0xcbf5('0x4'));var BPromise=require(_0xcbf5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbf5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbf5('0x7'));module['exports']=function(_0x292865,_0x360792){return _0x292865[_0xcbf5('0x8')](_0xcbf5('0x9'),attributes,{'tableName':_0xcbf5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd60d=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareDetailsReport'];(function(_0x433324,_0x38cb6e){var _0x5d90cc=function(_0x3751e2){while(--_0x3751e2){_0x433324['push'](_0x433324['shift']());}};_0x5d90cc(++_0x38cb6e);}(_0xd60d,0x14d));var _0xdd60=function(_0x2ba242,_0x16fc85){_0x2ba242=_0x2ba242-0x0;var _0x173940=_0xd60d[_0x2ba242];return _0x173940;};'use strict';var _=require(_0xdd60('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdd60('0x1'));var BPromise=require(_0xdd60('0x2'));var rp=require(_0xdd60('0x3'));var fs=require('fs');var path=require(_0xdd60('0x4'));var rimraf=require(_0xdd60('0x5'));var config=require(_0xdd60('0x6'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x99b6e3,_0x354881){return _0x99b6e3[_0xdd60('0x7')](_0xdd60('0x8'),attributes,{'tableName':'report_square_details','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 04968cd..dad4d9a 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 _0xeb74=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x662ebb,_0x397ec4){var _0x3b2a8e=function(_0x1b13e3){while(--_0x1b13e3){_0x662ebb['push'](_0x662ebb['shift']());}};_0x3b2a8e(++_0x397ec4);}(_0xeb74,0xe3));var _0x4eb7=function(_0xe788e,_0x290fe5){_0xe788e=_0xe788e-0x0;var _0x5d97ab=_0xeb74[_0xe788e];return _0x5d97ab;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')](_0x3b6d41['body'],{'raw':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![]})[_0x4eb7('0xc')](function(_0x32f0f5){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger['debug'](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x1c')](_0x32f0f5));_0x302e16(_0x32f0f5);})[_0x4eb7('0x16')](function(_0x164515){logger[_0x4eb7('0x11')](_0x4eb7('0x17'),_0x164515[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478[_0x4eb7('0x11')](0x1f4,_0x164515[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0x3070=['code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3070,0x75));var _0x0307=function(_0x1e6d9c,_0x16eed6){_0x1e6d9c=_0x1e6d9c-0x0;var _0x226f5e=_0x3070[_0x1e6d9c];return _0x226f5e;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dc51,_0x4fbe3e,_0x3ecfb6){return new BPromise(function(_0x41e638,_0x53e6b7){return client[_0x0307('0xa')](_0xc1dc51,_0x3ecfb6)[_0x0307('0xb')](function(_0x187fb3){logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,_0x0307('0xe'));logger[_0x0307('0xf')](_0x0307('0x10'),_0x4fbe3e,_0x0307('0xe'),JSON['stringify'](_0x187fb3));if(_0x187fb3[_0x0307('0x11')]){if(_0x187fb3['error'][_0x0307('0x12')]===0x1f4){logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x53e6b7(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x41e638(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}else{logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,'request\x20sent');_0x41e638(_0x187fb3[_0x0307('0x14')][_0x0307('0x13')]);}})[_0x0307('0x15')](function(_0x5f11a5){logger['error'](_0x0307('0xd'),_0x4fbe3e,_0x5f11a5);_0x53e6b7(_0x5f11a5);});});}exports[_0x0307('0x16')]=function(_0x38dfd6){var _0x1402ab=this;return new Promise(function(_0x1e1654,_0x16433e){return db[_0x0307('0x17')]['create'](_0x38dfd6[_0x0307('0x18')],{'raw':_0x38dfd6['options']?_0x38dfd6[_0x0307('0x19')][_0x0307('0x1a')]===undefined?!![]:![]:!![]})[_0x0307('0xb')](function(_0x31ac5){logger['info'](_0x0307('0x16'),_0x38dfd6);logger[_0x0307('0xf')](_0x0307('0x16'),_0x38dfd6,JSON['stringify'](_0x31ac5));_0x1e1654(_0x31ac5);})['catch'](function(_0x9c1223){logger[_0x0307('0x11')]('CreateSquareDetailsReport',_0x9c1223[_0x0307('0x13')],_0x38dfd6);_0x16433e(_0x1402ab['error'](0x1f4,_0x9c1223[_0x0307('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a4fc1c9..a1461af 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 _0x315c=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x315c,0x1b5));var _0xc315=function(_0x4feb43,_0x4fb55f){_0x4feb43=_0x4feb43-0x0;var _0x241472=_0x315c[_0x4feb43];return _0x241472;};'use strict';var express=require(_0xc315('0x0'));var router=express[_0xc315('0x1')]();var auth=require(_0xc315('0x2'));var controller=require('./system.controller');router[_0xc315('0x3')]('/',auth[_0xc315('0x4')](),controller[_0xc315('0x5')]);router[_0xc315('0x3')](_0xc315('0x6'),auth[_0xc315('0x4')](),controller[_0xc315('0x7')]);module[_0xc315('0x8')]=router; \ No newline at end of file +var _0xaddb=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','get','index'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xaddb,0xa6));var _0xbadd=function(_0x2d68c9,_0x411beb){_0x2d68c9=_0x2d68c9-0x0;var _0x59a7b6=_0xaddb[_0x2d68c9];return _0x59a7b6;};'use strict';var express=require(_0xbadd('0x0'));var router=express[_0xbadd('0x1')]();var auth=require(_0xbadd('0x2'));var controller=require('./system.controller');router[_0xbadd('0x3')]('/',auth['isAuthenticated'](),controller[_0xbadd('0x4')]);router['get'](_0xbadd('0x5'),auth[_0xbadd('0x6')](),controller[_0xbadd('0x7')]);module[_0xbadd('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0eff8fc..140a993 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 _0x29d4=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','then','json','catch'];(function(_0x41bb45,_0x119772){var _0x1315d3=function(_0x13241c){while(--_0x13241c){_0x41bb45['push'](_0x41bb45['shift']());}};_0x1315d3(++_0x119772);}(_0x29d4,0xe3));var _0x429d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x29d4[_0x6131cd];return _0x47e916;};'use strict';var info=require(_0x429d('0x0'));var exec=require(_0x429d('0x1'))['exec'];var logger=require('../../config/logger')('api');var util=require(_0x429d('0x2'));var BPromise=require(_0x429d('0x3'));var _=require('lodash');function handleError(_0xec902f,_0x5c85b4,_0xb4430f){_0x5c85b4=_0x5c85b4||0x1f4;return function(_0x4f66b7){logger[_0x429d('0x4')](_0x429d('0x5'),_0xb4430f,_0x5c85b4,util['inspect'](_0x4f66b7,{'showHidden':![],'depth':null}));delete _0x4f66b7[_0x429d('0x6')];_0xec902f[_0x429d('0x7')](_0x5c85b4)[_0x429d('0x8')](_0x4f66b7);};}exports[_0x429d('0x9')]=function(_0x72535e,_0x3c77ba){return info['getAllData']()[_0x429d('0xa')](function(_0x1dbb7a){return _0x3c77ba['status'](0xc8)[_0x429d('0xb')](_0x1dbb7a);})[_0x429d('0xc')](function(_0x38f059){return _0x3c77ba[_0x429d('0x7')](0x1f4)['json'](_0x38f059);});};exports['killProcess']=function(_0x33b53e,_0x5786ab){var _0x489573=[_0x429d('0xd')];return new BPromise(function(_0x1f0155,_0x31c4c7){return exec(util[_0x429d('0xe')](_0x429d('0xf'),_0x33b53e[_0x429d('0x10')][_0x429d('0x11')]),function(_0xe33956,_0x1b549a,_0x3ccf23){if(_0xe33956){return _0x31c4c7(_0xe33956);}return _0x1f0155(_0x1b549a);});})['then'](function(_0x254739){var _0x575c80=![];var _0x202f3d=_0x254739['split'](/\n/);for(var _0x696433=0x0,_0x4e2c3d=_0x489573[_0x429d('0x12')];_0x696433<_0x4e2c3d,_0x575c80===![];_0x696433+=0x1){if(_0x254739[_0x429d('0x13')](_0x489573[_0x696433])>=0x0){_0x575c80=!![];}}if(!_0x575c80){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x33b53e['params'][_0x429d('0x11')]));}process[_0x429d('0x14')](_0x33b53e['params'][_0x429d('0x11')],_0x429d('0x15'));return _0x5786ab[_0x429d('0x7')](0xc8)[_0x429d('0xb')]({'message':util[_0x429d('0xe')](_0x429d('0x16'),_0x33b53e['params'][_0x429d('0x11')])});})['catch'](handleError(_0x5786ab,null,_0x429d('0x17')));}; \ No newline at end of file +var _0xda1e=['exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda1e,0x1c0));var _0xeda1=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xda1e[_0x301dab];return _0x2500a2;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xeda1('0x0')];var logger=require(_0xeda1('0x1'))(_0xeda1('0x2'));var util=require(_0xeda1('0x3'));var BPromise=require(_0xeda1('0x4'));var _=require(_0xeda1('0x5'));function handleError(_0x4eb837,_0x204ca9,_0xf9fb25){_0x204ca9=_0x204ca9||0x1f4;return function(_0x158161){logger[_0xeda1('0x6')](_0xeda1('0x7'),_0xf9fb25,_0x204ca9,util[_0xeda1('0x8')](_0x158161,{'showHidden':![],'depth':null}));delete _0x158161[_0xeda1('0x9')];_0x4eb837[_0xeda1('0xa')](_0x204ca9)['send'](_0x158161);};}exports[_0xeda1('0xb')]=function(_0xe34d9a,_0x1eed43){return info[_0xeda1('0xc')]()[_0xeda1('0xd')](function(_0x1d4b63){return _0x1eed43[_0xeda1('0xa')](0xc8)[_0xeda1('0xe')](_0x1d4b63);})[_0xeda1('0xf')](function(_0x202b05){return _0x1eed43[_0xeda1('0xa')](0x1f4)['json'](_0x202b05);});};exports[_0xeda1('0x10')]=function(_0xabea28,_0x2ae19c){var _0x101d32=['components/import/cm'];return new BPromise(function(_0x5bbd55,_0x3ab23d){return exec(util[_0xeda1('0x11')](_0xeda1('0x12'),_0xabea28[_0xeda1('0x13')]['pid']),function(_0x35d4ed,_0x141fbd,_0x560228){if(_0x35d4ed){return _0x3ab23d(_0x35d4ed);}return _0x5bbd55(_0x141fbd);});})[_0xeda1('0xd')](function(_0x233eb4){var _0x3f1e19=![];var _0x4f7f4b=_0x233eb4[_0xeda1('0x14')](/\n/);for(var _0x2fc2df=0x0,_0x521898=_0x101d32[_0xeda1('0x15')];_0x2fc2df<_0x521898,_0x3f1e19===![];_0x2fc2df+=0x1){if(_0x233eb4[_0xeda1('0x16')](_0x101d32[_0x2fc2df])>=0x0){_0x3f1e19=!![];}}if(!_0x3f1e19){throw new Error(util[_0xeda1('0x11')](_0xeda1('0x17'),_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')]));}process[_0xeda1('0x19')](_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')],_0xeda1('0x1a'));return _0x2ae19c['status'](0xc8)[_0xeda1('0xe')]({'message':util[_0xeda1('0x11')](_0xeda1('0x1b'),_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')])});})['catch'](handleError(_0x2ae19c,null,_0xeda1('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b4c8b9c..3a306af 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 _0x7008=['index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x7008,0x185));var _0x8700=function(_0x12182e,_0x2a3858){_0x12182e=_0x12182e-0x0;var _0x42d444=_0x7008[_0x12182e];return _0x42d444;};'use strict';var multer=require(_0x8700('0x0'));var util=require(_0x8700('0x1'));var path=require(_0x8700('0x2'));var timeout=require(_0x8700('0x3'));var express=require('express');var router=express[_0x8700('0x4')]();var fs_extra=require(_0x8700('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8700('0x6'));var config=require(_0x8700('0x7'));var controller=require(_0x8700('0x8'));router[_0x8700('0x9')]('/',auth[_0x8700('0xa')](),controller[_0x8700('0xb')]);router[_0x8700('0x9')]('/:id',auth[_0x8700('0xa')](),controller[_0x8700('0xc')]);router[_0x8700('0xd')]('/',auth[_0x8700('0xa')](),controller[_0x8700('0xe')]);router[_0x8700('0xf')](_0x8700('0x10'),auth[_0x8700('0xa')](),controller[_0x8700('0x11')]);router[_0x8700('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8700('0x13')]);module['exports']=router; \ No newline at end of file +var _0x23b6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','/:id','post','isAuthenticated','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x23b6,0xd7));var _0x623b=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x23b6[_0x2caaef];return _0xd011f8;};'use strict';var multer=require(_0x623b('0x0'));var util=require(_0x623b('0x1'));var path=require('path');var timeout=require(_0x623b('0x2'));var express=require(_0x623b('0x3'));var router=express[_0x623b('0x4')]();var fs_extra=require(_0x623b('0x5'));var auth=require(_0x623b('0x6'));var interaction=require(_0x623b('0x7'));var config=require(_0x623b('0x8'));var controller=require(_0x623b('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x623b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x623b('0xb')]('/',auth[_0x623b('0xc')](),controller['create']);router[_0x623b('0xd')](_0x623b('0xa'),auth['isAuthenticated'](),controller[_0x623b('0xe')]);router[_0x623b('0xf')]('/:id',auth[_0x623b('0xc')](),controller['destroy']);module[_0x623b('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c8654b4..24c34b2 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 _0x1678=['exports','STRING','name','sequelize'];(function(_0x5d7583,_0x48a446){var _0x1e615c=function(_0x145946){while(--_0x145946){_0x5d7583['push'](_0x5d7583['shift']());}};_0x1e615c(++_0x48a446);}(_0x1678,0x17b));var _0x8167=function(_0x4fb200,_0x17e31b){_0x4fb200=_0x4fb200-0x0;var _0x22fa43=_0x1678[_0x4fb200];return _0x22fa43;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'name':{'type':Sequelize[_0x8167('0x2')],'unique':_0x8167('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8167('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x01d3=['name','#0091EA','sequelize','exports','STRING'];(function(_0x5d6a7f,_0x109e9b){var _0x24dec8=function(_0x59848a){while(--_0x59848a){_0x5d6a7f['push'](_0x5d6a7f['shift']());}};_0x24dec8(++_0x109e9b);}(_0x01d3,0xa2));var _0x301d=function(_0x331f07,_0x4aa829){_0x331f07=_0x331f07-0x0;var _0x49e12f=_0x01d3[_0x331f07];return _0x49e12f;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'name':{'type':Sequelize[_0x301d('0x2')],'unique':_0x301d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x301d('0x4')},'description':{'type':Sequelize[_0x301d('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 410f8b2..b8b0584 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 _0x0624=['count','offset','set','json','apply','reject','save','then','get','Tags','UserProfileResource','destroy','end','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','Tag','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit'];(function(_0x305963,_0x10cea5){var _0x30fb3b=function(_0x3f6db0){while(--_0x3f6db0){_0x305963['push'](_0x305963['shift']());}};_0x30fb3b(++_0x10cea5);}(_0x0624,0x132));var _0x4062=function(_0x516afb,_0xa6286f){_0x516afb=_0x516afb-0x0;var _0x4778e3=_0x0624[_0x516afb];return _0x4778e3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4062('0x0'));var moment=require(_0x4062('0x1'));var BPromise=require(_0x4062('0x2'));var Mustache=require(_0x4062('0x3'));var util=require(_0x4062('0x4'));var path=require(_0x4062('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4062('0x6'));var fs=require('fs');var fs_extra=require(_0x4062('0x7'));var _=require(_0x4062('0x8'));var squel=require(_0x4062('0x9'));var crypto=require(_0x4062('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4062('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4062('0xc'));var Papa=require(_0x4062('0xd'));var Redis=require(_0x4062('0xe'));var authService=require(_0x4062('0xf'));var qs=require(_0x4062('0x10'));var as=require(_0x4062('0x11'));var hardwareService=require(_0x4062('0x12'));var logger=require('../../config/logger')(_0x4062('0x13'));var utils=require('../../config/utils');var config=require(_0x4062('0x14'));var licenseUtil=require(_0x4062('0x15'));var db=require(_0x4062('0x16'))['db'];function respondWithStatusCode(_0x3146e2,_0x160b6d){_0x160b6d=_0x160b6d||0xcc;return function(_0x57e04b){if(_0x57e04b){return _0x3146e2[_0x4062('0x17')](_0x160b6d);}return _0x3146e2[_0x4062('0x18')](_0x160b6d)['end']();};}function respondWithResult(_0x32ced6,_0x42859d){_0x42859d=_0x42859d||0xc8;return function(_0x95bb42){if(_0x95bb42){return _0x32ced6['status'](_0x42859d)['json'](_0x95bb42);}};}function respondWithFilteredResult(_0x25a717,_0x467ac7){return function(_0x48ea2b){if(_0x48ea2b){var _0x4d7166=typeof _0x467ac7['offset']==='undefined'&&typeof _0x467ac7[_0x4062('0x19')]==='undefined';var _0x2efc3c=_0x48ea2b[_0x4062('0x1a')];var _0x3d14bb=_0x4d7166?0x0:_0x467ac7[_0x4062('0x1b')];var _0x2a04c7=_0x4d7166?_0x48ea2b[_0x4062('0x1a')]:_0x467ac7[_0x4062('0x1b')]+_0x467ac7['limit'];var _0x324bb3;if(_0x2a04c7>=_0x2efc3c){_0x2a04c7=_0x2efc3c;_0x324bb3=0xc8;}else{_0x324bb3=0xce;}_0x25a717['status'](_0x324bb3);return _0x25a717[_0x4062('0x1c')]('Content-Range',_0x3d14bb+'-'+_0x2a04c7+'/'+_0x2efc3c)[_0x4062('0x1d')](_0x48ea2b);}return null;};}function patchUpdates(_0x31777f){return function(_0x12c6a3){try{jsonpatch[_0x4062('0x1e')](_0x12c6a3,_0x31777f,!![]);}catch(_0x3cb45d){return BPromise[_0x4062('0x1f')](_0x3cb45d);}return _0x12c6a3[_0x4062('0x20')]();};}function saveUpdates(_0x341310,_0xc6c0ba){return function(_0x53648a){if(_0x53648a){return _0x53648a['update'](_0x341310)[_0x4062('0x21')](function(_0xc5e4a0){return _0xc5e4a0;});}return null;};}function removeEntity(_0x23f81c,_0x1fa194){return function(_0x59d19f){if(_0x59d19f){return _0x59d19f['destroy']()['then'](function(){var _0x11e837=_0x59d19f[_0x4062('0x22')]({'plain':!![]});var _0x11b962=_0x4062('0x23');return db[_0x4062('0x24')][_0x4062('0x25')]({'where':{'type':_0x11b962,'resourceId':_0x11e837['id']}})['then'](function(){return _0x59d19f;});})[_0x4062('0x21')](function(){_0x23f81c[_0x4062('0x18')](0xcc)[_0x4062('0x26')]();});}};}function handleEntityNotFound(_0x28e9e4,_0xb7f7c7){return function(_0x5934d2){if(!_0x5934d2){_0x28e9e4[_0x4062('0x17')](0x194);}return _0x5934d2;};}function handleError(_0x4a0312,_0x4de5c0){_0x4de5c0=_0x4de5c0||0x1f4;return function(_0x391065){logger['error'](_0x391065[_0x4062('0x27')]);if(_0x391065[_0x4062('0x28')]){delete _0x391065[_0x4062('0x28')];}_0x4a0312[_0x4062('0x18')](_0x4de5c0)[_0x4062('0x29')](_0x391065);};}exports[_0x4062('0x2a')]=function(_0xd818bc,_0x253bcf){var _0x5f569c={},_0x592fca={},_0x51de11={'count':0x0,'rows':[]};var _0x70dfdc=_[_0x4062('0x2b')](db['Tag'][_0x4062('0x2c')],function(_0x5ad1a3){return{'name':_0x5ad1a3['fieldName'],'type':_0x5ad1a3['type'][_0x4062('0x2d')]};});_0x592fca[_0x4062('0x2e')]=_[_0x4062('0x2b')](_0x70dfdc,_0x4062('0x28'));_0x592fca[_0x4062('0x2f')]=_[_0x4062('0x30')](_0xd818bc[_0x4062('0x2f')]);_0x592fca[_0x4062('0x31')]=_[_0x4062('0x32')](_0x592fca[_0x4062('0x2e')],_0x592fca[_0x4062('0x2f')]);_0x5f569c[_0x4062('0x33')]=_['intersection'](_0x592fca[_0x4062('0x2e')],qs['fields'](_0xd818bc[_0x4062('0x2f')][_0x4062('0x34')]));_0x5f569c[_0x4062('0x33')]=_0x5f569c['attributes'][_0x4062('0x35')]?_0x5f569c[_0x4062('0x33')]:_0x592fca[_0x4062('0x2e')];if(!_0xd818bc[_0x4062('0x2f')][_0x4062('0x36')](_0x4062('0x37'))){_0x5f569c[_0x4062('0x19')]=qs[_0x4062('0x19')](_0xd818bc[_0x4062('0x2f')]['limit']);_0x5f569c[_0x4062('0x1b')]=qs[_0x4062('0x1b')](_0xd818bc[_0x4062('0x2f')][_0x4062('0x1b')]);}_0x5f569c[_0x4062('0x38')]=qs[_0x4062('0x39')](_0xd818bc['query'][_0x4062('0x39')]);_0x5f569c[_0x4062('0x3a')]=qs[_0x4062('0x31')](_[_0x4062('0x3b')](_0xd818bc[_0x4062('0x2f')],_0x592fca['filters']),_0x70dfdc);if(_0xd818bc['query'][_0x4062('0x3c')]){_0x5f569c[_0x4062('0x3a')]=_['merge'](_0x5f569c[_0x4062('0x3a')],{'$or':_[_0x4062('0x2b')](_0x70dfdc,function(_0x3d4fab){if(_0x3d4fab[_0x4062('0x3d')]!==_0x4062('0x3e')){var _0x218864={};_0x218864[_0x3d4fab[_0x4062('0x28')]]={'$like':'%'+_0xd818bc[_0x4062('0x2f')][_0x4062('0x3c')]+'%'};return _0x218864;}})});}_0x5f569c=_[_0x4062('0x3f')]({},_0x5f569c,_0xd818bc['options']);var _0x32debb={'where':_0x5f569c[_0x4062('0x3a')]};return db['Tag']['count'](_0x32debb)['then'](function(_0x3e903b){_0x51de11[_0x4062('0x1a')]=_0x3e903b;if(_0xd818bc[_0x4062('0x2f')][_0x4062('0x40')]){_0x5f569c['include']=[{'all':!![]}];}return db['Tag'][_0x4062('0x41')](_0x5f569c);})[_0x4062('0x21')](function(_0x39c9ef){_0x51de11[_0x4062('0x42')]=_0x39c9ef;return _0x51de11;})['then'](respondWithFilteredResult(_0x253bcf,_0x5f569c))['catch'](handleError(_0x253bcf,null));};exports[_0x4062('0x43')]=function(_0x2ac3b5,_0x1c4259){var _0x1b3897={'raw':!![],'where':{'id':_0x2ac3b5[_0x4062('0x44')]['id']}},_0x9ab8ac={};_0x9ab8ac[_0x4062('0x2e')]=_[_0x4062('0x30')](db['Tag'][_0x4062('0x2c')]);_0x9ab8ac[_0x4062('0x2f')]=_[_0x4062('0x30')](_0x2ac3b5['query']);_0x9ab8ac[_0x4062('0x31')]=_['intersection'](_0x9ab8ac['model'],_0x9ab8ac[_0x4062('0x2f')]);_0x1b3897[_0x4062('0x33')]=_['intersection'](_0x9ab8ac[_0x4062('0x2e')],qs[_0x4062('0x34')](_0x2ac3b5[_0x4062('0x2f')][_0x4062('0x34')]));_0x1b3897[_0x4062('0x33')]=_0x1b3897['attributes']['length']?_0x1b3897[_0x4062('0x33')]:_0x9ab8ac[_0x4062('0x2e')];if(_0x2ac3b5[_0x4062('0x2f')]['includeAll']){_0x1b3897[_0x4062('0x45')]=[{'all':!![]}];}_0x1b3897=_[_0x4062('0x3f')]({},_0x1b3897,_0x2ac3b5['options']);return db[_0x4062('0x46')][_0x4062('0x47')](_0x1b3897)['then'](handleEntityNotFound(_0x1c4259,null))['then'](respondWithResult(_0x1c4259,null))['catch'](handleError(_0x1c4259,null));};exports[_0x4062('0x48')]=function(_0x560b20,_0x58921a){return db[_0x4062('0x46')]['create'](_0x560b20['body'],{})[_0x4062('0x21')](function(_0x15819a){var _0x1f6df9=_0x560b20['user'][_0x4062('0x22')]({'plain':!![]});if(!_0x1f6df9)throw new Error(_0x4062('0x49'));if(_0x1f6df9[_0x4062('0x4a')]==='user'){var _0x5c75b6=_0x15819a[_0x4062('0x22')]({'plain':!![]});var _0x1e9b7a='Tags';return db[_0x4062('0x4b')][_0x4062('0x47')]({'where':{'name':_0x1e9b7a,'userProfileId':_0x1f6df9[_0x4062('0x4c')]},'raw':!![]})['then'](function(_0x53729d){if(_0x53729d&&_0x53729d[_0x4062('0x4d')]===0x0){return db[_0x4062('0x24')][_0x4062('0x48')]({'name':_0x5c75b6[_0x4062('0x28')],'resourceId':_0x5c75b6['id'],'type':_0x53729d[_0x4062('0x28')],'sectionId':_0x53729d['id']},{})['then'](function(){return _0x15819a;});}else{return _0x15819a;}})['catch'](function(_0x6797c6){logger[_0x4062('0x4e')](_0x4062('0x4f'),_0x6797c6);throw _0x6797c6;});}return _0x15819a;})[_0x4062('0x21')](respondWithResult(_0x58921a,0xc9))[_0x4062('0x50')](handleError(_0x58921a,null));};exports[_0x4062('0x51')]=function(_0x2180ae,_0x2afcc7){if(_0x2180ae[_0x4062('0x52')]['id']){delete _0x2180ae[_0x4062('0x52')]['id'];}return db[_0x4062('0x46')][_0x4062('0x47')]({'where':{'id':_0x2180ae['params']['id']}})[_0x4062('0x21')](handleEntityNotFound(_0x2afcc7,null))[_0x4062('0x21')](saveUpdates(_0x2180ae['body'],null))[_0x4062('0x21')](respondWithResult(_0x2afcc7,null))[_0x4062('0x50')](handleError(_0x2afcc7,null));};exports['destroy']=function(_0x24e98c,_0x5c76e7){return db['Tag'][_0x4062('0x47')]({'where':{'id':_0x24e98c[_0x4062('0x44')]['id']}})[_0x4062('0x21')](handleEntityNotFound(_0x5c76e7,null))[_0x4062('0x21')](removeEntity(_0x5c76e7,null))[_0x4062('0x50')](handleError(_0x5c76e7,null));}; \ No newline at end of file +var _0xf4eb=['body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create'];(function(_0x423995,_0x34d28e){var _0x54c52a=function(_0x344157){while(--_0x344157){_0x423995['push'](_0x423995['shift']());}};_0x54c52a(++_0x34d28e);}(_0xf4eb,0xec));var _0xbf4e=function(_0xe29510,_0x583d05){_0xe29510=_0xe29510-0x0;var _0x334d79=_0xf4eb[_0xe29510];return _0x334d79;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['Tag'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0480608..57c804a 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 _0x6a8f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define','tools_tags','util'];(function(_0x4fb570,_0x21803a){var _0x2d0958=function(_0x54ee71){while(--_0x54ee71){_0x4fb570['push'](_0x4fb570['shift']());}};_0x2d0958(++_0x21803a);}(_0x6a8f,0x167));var _0xf6a8=function(_0x129d52,_0x1beadf){_0x129d52=_0x129d52-0x0;var _0x79ef89=_0x6a8f[_0x129d52];return _0x79ef89;};'use strict';var _=require('lodash');var util=require(_0xf6a8('0x0'));var logger=require(_0xf6a8('0x1'))(_0xf6a8('0x2'));var moment=require(_0xf6a8('0x3'));var BPromise=require(_0xf6a8('0x4'));var rp=require(_0xf6a8('0x5'));var fs=require('fs');var path=require(_0xf6a8('0x6'));var rimraf=require('rimraf');var config=require(_0xf6a8('0x7'));var attributes=require(_0xf6a8('0x8'));module[_0xf6a8('0x9')]=function(_0x2fe263,_0x5250e8){return _0x2fe263[_0xf6a8('0xa')]('Tag',attributes,{'tableName':_0xf6a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','define'];(function(_0x38ead1,_0x305199){var _0x4cad8a=function(_0x31d3bc){while(--_0x31d3bc){_0x38ead1['push'](_0x38ead1['shift']());}};_0x4cad8a(++_0x305199);}(_0x12c9,0x1c9));var _0x912c=function(_0x148c42,_0x57fb9d){_0x148c42=_0x148c42-0x0;var _0x583f8a=_0x12c9[_0x148c42];return _0x583f8a;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require(_0x912c('0x2'))(_0x912c('0x3'));var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var rp=require(_0x912c('0x5'));var fs=require('fs');var path=require(_0x912c('0x6'));var rimraf=require(_0x912c('0x7'));var config=require(_0x912c('0x8'));var attributes=require(_0x912c('0x9'));module['exports']=function(_0x584a27,_0xe29019){return _0x584a27[_0x912c('0xa')](_0x912c('0xb'),attributes,{'tableName':_0x912c('0xc'),'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 b191476..feea605 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 _0xdace=['request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdace,0xc5));var _0xedac=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xdace[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('Tag,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0x9567=['info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x9567,0xdc));var _0x7956=function(_0x4304f2,_0x2854a8){_0x4304f2=_0x4304f2-0x0;var _0x2b54f2=_0x9567[_0x4304f2];return _0x2b54f2;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Tag,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 96d8ffa..61c265f 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 174e4e2..0b4ee4d 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 _0x757a=['exports','STRING'];(function(_0x4b934b,_0x7062ad){var _0x44b8e5=function(_0x4ff97d){while(--_0x4ff97d){_0x4b934b['push'](_0x4b934b['shift']());}};_0x44b8e5(++_0x7062ad);}(_0x757a,0xde));var _0xa757=function(_0x538849,_0x183722){_0x538849=_0x538849-0x0;var _0x4571dd=_0x757a[_0x538849];return _0x4571dd;};'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 _0xd8b0=['exports','sequelize'];(function(_0x24ceb8,_0x4c9149){var _0x5dd3ba=function(_0xb385b9){while(--_0xb385b9){_0x24ceb8['push'](_0x24ceb8['shift']());}};_0x5dd3ba(++_0x4c9149);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 1206c1b..12139b0 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 _0xedd9=['localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','offset','limit','undefined','Content-Range','json','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','add','ids','ValidationError','remove','addAgents','isArray','Voice','Mail','Sms','Fax','Whatsapp','sequelize','transaction','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','user','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Openchannel','Queue:remove','getAgents','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x5049bc,_0xc10321){var _0x3ade8c=function(_0x5ad119){while(--_0x5ad119){_0x5049bc['push'](_0x5049bc['shift']());}};_0x3ade8c(++_0xc10321);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c96e5,_0x2315eb){_0x4c96e5=_0x4c96e5-0x0;var _0x5e6890=_0xedd9[_0x4c96e5];return _0x5e6890;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];config[_0x9edd('0x18')]=_[_0x9edd('0x19')](config[_0x9edd('0x18')],{'host':_0x9edd('0x1a'),'port':0x18eb});var socket=require(_0x9edd('0x1b'))(new Redis(config['redis']));require(_0x9edd('0x1c'))[_0x9edd('0x1d')](socket);function respondWithStatusCode(_0x891832,_0x4d9a7){_0x4d9a7=_0x4d9a7||0xcc;return function(_0x13b6b6){if(_0x13b6b6){return _0x891832[_0x9edd('0x1e')](_0x4d9a7);}return _0x891832[_0x9edd('0x1f')](_0x4d9a7)[_0x9edd('0x20')]();};}function respondWithResult(_0x4ea60f,_0x5f5bf4){_0x5f5bf4=_0x5f5bf4||0xc8;return function(_0x448996){if(_0x448996){return _0x4ea60f[_0x9edd('0x1f')](_0x5f5bf4)['json'](_0x448996);}};}function respondWithFilteredResult(_0x1b54c0,_0x35f454){return function(_0x40ba32){if(_0x40ba32){var _0x4d8f33=typeof _0x35f454[_0x9edd('0x21')]==='undefined'&&typeof _0x35f454[_0x9edd('0x22')]===_0x9edd('0x23');var _0x4bdb88=_0x40ba32['count'];var _0x45c3ab=_0x4d8f33?0x0:_0x35f454['offset'];var _0x27a95a=_0x4d8f33?_0x40ba32['count']:_0x35f454['offset']+_0x35f454[_0x9edd('0x22')];var _0x1c46a8;if(_0x27a95a>=_0x4bdb88){_0x27a95a=_0x4bdb88;_0x1c46a8=0xc8;}else{_0x1c46a8=0xce;}_0x1b54c0['status'](_0x1c46a8);return _0x1b54c0['set'](_0x9edd('0x24'),_0x45c3ab+'-'+_0x27a95a+'/'+_0x4bdb88)[_0x9edd('0x25')](_0x40ba32);}return null;};}function patchUpdates(_0x477878){return function(_0x542172){try{jsonpatch[_0x9edd('0x26')](_0x542172,_0x477878,!![]);}catch(_0x1dca43){return BPromise[_0x9edd('0x27')](_0x1dca43);}return _0x542172[_0x9edd('0x28')]();};}function saveUpdates(_0x339a0d,_0x4c75d2){return function(_0x46c383){if(_0x46c383){return _0x46c383[_0x9edd('0x29')](_0x339a0d)[_0x9edd('0x2a')](function(_0x2f9f86){return _0x2f9f86;});}return null;};}function removeEntity(_0x310a4d,_0x4d507f){return function(_0x4b3d1b){if(_0x4b3d1b){return _0x4b3d1b[_0x9edd('0x2b')]()[_0x9edd('0x2a')](function(){var _0x8d67aa=_0x4b3d1b[_0x9edd('0x2c')]({'plain':!![]});var _0x3c2227='Teams';return db['UserProfileResource'][_0x9edd('0x2b')]({'where':{'type':_0x3c2227,'resourceId':_0x8d67aa['id']}})[_0x9edd('0x2a')](function(){return _0x4b3d1b;});})[_0x9edd('0x2a')](function(){_0x310a4d['status'](0xcc)[_0x9edd('0x20')]();});}};}function handleEntityNotFound(_0x28cfae,_0x2ae8dd){return function(_0x41af53){if(!_0x41af53){_0x28cfae['sendStatus'](0x194);}return _0x41af53;};}function handleError(_0x2155a1,_0x3fb556){_0x3fb556=_0x3fb556||0x1f4;return function(_0xbe87e1){logger[_0x9edd('0x2d')](_0xbe87e1[_0x9edd('0x2e')]);if(_0xbe87e1[_0x9edd('0x2f')]){delete _0xbe87e1[_0x9edd('0x2f')];}_0x2155a1[_0x9edd('0x1f')](_0x3fb556)[_0x9edd('0x30')](_0xbe87e1);};}exports[_0x9edd('0x31')]=function(_0x4fd03f,_0x138002){var _0x6907a5={},_0xa55906={},_0x1a6c23={'count':0x0,'rows':[]};var _0x5af178=_[_0x9edd('0x32')](db[_0x9edd('0x33')][_0x9edd('0x34')],function(_0x5d1707){return{'name':_0x5d1707[_0x9edd('0x35')],'type':_0x5d1707[_0x9edd('0x36')][_0x9edd('0x37')]};});_0xa55906[_0x9edd('0x38')]=_[_0x9edd('0x32')](_0x5af178,_0x9edd('0x2f'));_0xa55906[_0x9edd('0x39')]=_[_0x9edd('0x3a')](_0x4fd03f[_0x9edd('0x39')]);_0xa55906[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0xa55906[_0x9edd('0x38')],_0xa55906[_0x9edd('0x39')]);_0x6907a5[_0x9edd('0x3d')]=_['intersection'](_0xa55906[_0x9edd('0x38')],qs['fields'](_0x4fd03f[_0x9edd('0x39')][_0x9edd('0x3e')]));_0x6907a5[_0x9edd('0x3d')]=_0x6907a5[_0x9edd('0x3d')][_0x9edd('0x3f')]?_0x6907a5['attributes']:_0xa55906[_0x9edd('0x38')];if(!_0x4fd03f[_0x9edd('0x39')][_0x9edd('0x40')](_0x9edd('0x41'))){_0x6907a5[_0x9edd('0x22')]=qs[_0x9edd('0x22')](_0x4fd03f[_0x9edd('0x39')][_0x9edd('0x22')]);_0x6907a5[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x4fd03f['query'][_0x9edd('0x21')]);}_0x6907a5['order']=qs[_0x9edd('0x42')](_0x4fd03f['query'][_0x9edd('0x42')]);_0x6907a5[_0x9edd('0x43')]=qs[_0x9edd('0x3b')](_['pick'](_0x4fd03f[_0x9edd('0x39')],_0xa55906[_0x9edd('0x3b')]),_0x5af178);if(_0x4fd03f[_0x9edd('0x39')]['filter']){_0x6907a5[_0x9edd('0x43')]=_['merge'](_0x6907a5[_0x9edd('0x43')],{'$or':_[_0x9edd('0x32')](_0x5af178,function(_0x50be2c){if(_0x50be2c[_0x9edd('0x36')]!==_0x9edd('0x44')){var _0x389f51={};_0x389f51[_0x50be2c[_0x9edd('0x2f')]]={'$like':'%'+_0x4fd03f['query'][_0x9edd('0x45')]+'%'};return _0x389f51;}})});}_0x6907a5=_['merge']({},_0x6907a5,_0x4fd03f[_0x9edd('0x46')]);var _0xc1e657={'where':_0x6907a5['where']};return db[_0x9edd('0x33')]['count'](_0xc1e657)['then'](function(_0x369b69){_0x1a6c23[_0x9edd('0x47')]=_0x369b69;if(_0x4fd03f[_0x9edd('0x39')][_0x9edd('0x48')]){_0x6907a5[_0x9edd('0x49')]=[{'all':!![]}];}return db[_0x9edd('0x33')][_0x9edd('0x4a')](_0x6907a5);})[_0x9edd('0x2a')](function(_0x18c149){_0x1a6c23[_0x9edd('0x4b')]=_0x18c149;return _0x1a6c23;})[_0x9edd('0x2a')](respondWithFilteredResult(_0x138002,_0x6907a5))[_0x9edd('0x4c')](handleError(_0x138002,null));};exports[_0x9edd('0x4d')]=function(_0xbbe8fc,_0x46e9f4){var _0x5416f8={'raw':![],'where':{'id':_0xbbe8fc[_0x9edd('0x4e')]['id']}},_0x13197d={};_0x13197d[_0x9edd('0x38')]=_[_0x9edd('0x3a')](db[_0x9edd('0x33')][_0x9edd('0x34')]);_0x13197d[_0x9edd('0x39')]=_['keys'](_0xbbe8fc['query']);_0x13197d['filters']=_[_0x9edd('0x3c')](_0x13197d['model'],_0x13197d[_0x9edd('0x39')]);_0x5416f8[_0x9edd('0x3d')]=_[_0x9edd('0x3c')](_0x13197d[_0x9edd('0x38')],qs[_0x9edd('0x3e')](_0xbbe8fc['query'][_0x9edd('0x3e')]));_0x5416f8[_0x9edd('0x3d')]=_0x5416f8[_0x9edd('0x3d')]['length']?_0x5416f8[_0x9edd('0x3d')]:_0x13197d[_0x9edd('0x38')];if(_0xbbe8fc[_0x9edd('0x39')][_0x9edd('0x48')]){_0x5416f8[_0x9edd('0x49')]=[{'all':!![]}];}_0x5416f8=_[_0x9edd('0x4f')]({},_0x5416f8,_0xbbe8fc['options']);return db[_0x9edd('0x33')][_0x9edd('0x50')](_0x5416f8)['then'](handleEntityNotFound(_0x46e9f4,null))[_0x9edd('0x2a')](respondWithResult(_0x46e9f4,null))[_0x9edd('0x4c')](handleError(_0x46e9f4,null));};exports['create']=function(_0x2bd089,_0x8134cd){return db[_0x9edd('0x33')]['create'](_0x2bd089[_0x9edd('0x51')],{})[_0x9edd('0x2a')](function(_0x317a60){var _0x28c7bd=_0x2bd089['user'][_0x9edd('0x2c')]({'plain':!![]});if(!_0x28c7bd)throw new Error(_0x9edd('0x52'));if(_0x28c7bd[_0x9edd('0x53')]==='user'){var _0x16951a=_0x317a60[_0x9edd('0x2c')]({'plain':!![]});var _0x57db43=_0x9edd('0x54');return db['UserProfileSection'][_0x9edd('0x50')]({'where':{'name':_0x57db43,'userProfileId':_0x28c7bd[_0x9edd('0x55')]},'raw':!![]})[_0x9edd('0x2a')](function(_0x3fcdf5){if(_0x3fcdf5&&_0x3fcdf5[_0x9edd('0x56')]===0x0){return db[_0x9edd('0x57')][_0x9edd('0x58')]({'name':_0x16951a[_0x9edd('0x2f')],'resourceId':_0x16951a['id'],'type':_0x3fcdf5[_0x9edd('0x2f')],'sectionId':_0x3fcdf5['id']},{})[_0x9edd('0x2a')](function(){return _0x317a60;});}else{return _0x317a60;}})[_0x9edd('0x4c')](function(_0x5a3b1d){logger[_0x9edd('0x2d')](_0x9edd('0x59'),_0x5a3b1d);throw _0x5a3b1d;});}return _0x317a60;})[_0x9edd('0x2a')](respondWithResult(_0x8134cd,0xc9))['catch'](handleError(_0x8134cd,null));};exports[_0x9edd('0x29')]=function(_0x54a704,_0x54d83d){if(_0x54a704['body']['id']){delete _0x54a704[_0x9edd('0x51')]['id'];}return db[_0x9edd('0x33')][_0x9edd('0x50')]({'where':{'id':_0x54a704[_0x9edd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x54d83d,null))['then'](saveUpdates(_0x54a704['body'],null))[_0x9edd('0x2a')](respondWithResult(_0x54d83d,null))[_0x9edd('0x4c')](handleError(_0x54d83d,null));};exports[_0x9edd('0x2b')]=function(_0x1091ff,_0x2e2920){return db[_0x9edd('0x33')][_0x9edd('0x50')]({'where':{'id':_0x1091ff[_0x9edd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e2920,null))[_0x9edd('0x2a')](removeEntity(_0x2e2920,null))['catch'](handleError(_0x2e2920,null));};exports[_0x9edd('0x5a')]=function(_0x6a1cfc,_0x4b7e68,_0x22b91a){return db[_0x9edd('0x33')][_0x9edd('0x5b')]({'where':{'id':_0x6a1cfc['params']['id']}})[_0x9edd('0x2a')](handleEntityNotFound(_0x4b7e68,null))[_0x9edd('0x2a')](function(_0x430eb4){if(!_0x6a1cfc[_0x9edd('0x39')][_0x9edd('0x5c')]||!utils[_0x9edd('0x5d')](_0x6a1cfc['query']['channel'])){throw new db[(_0x9edd('0x5e'))]['ValidationError'](_0x9edd('0x5f'));}var _0x3e9a3e={};var _0x439083={};_0x439083[_0x9edd('0x38')]=_['keys'](db[_[_0x9edd('0x60')](_0x6a1cfc['query'][_0x9edd('0x5c')][_0x9edd('0x61')]())+_0x9edd('0x62')]['rawAttributes']);_0x439083[_0x9edd('0x39')]=_['keys'](_0x6a1cfc[_0x9edd('0x39')]);_0x439083[_0x9edd('0x3b')]=_['intersection'](_0x439083[_0x9edd('0x38')],_0x439083['query']);_0x3e9a3e[_0x9edd('0x3d')]=_[_0x9edd('0x3c')](_0x439083[_0x9edd('0x38')],qs['fields'](_0x6a1cfc[_0x9edd('0x39')][_0x9edd('0x3e')]));_0x3e9a3e[_0x9edd('0x3d')]=_0x3e9a3e[_0x9edd('0x3d')][_0x9edd('0x3f')]?_0x3e9a3e['attributes']:_0x439083['model'];_0x3e9a3e[_0x9edd('0x22')]=qs[_0x9edd('0x22')](_0x6a1cfc['query']['limit']);_0x3e9a3e['offset']=qs[_0x9edd('0x21')](_0x6a1cfc['query']['offset']);_0x3e9a3e[_0x9edd('0x63')]=qs[_0x9edd('0x42')](_0x6a1cfc['query'][_0x9edd('0x42')]);_0x3e9a3e[_0x9edd('0x43')]=qs[_0x9edd('0x3b')](_['pick'](_0x6a1cfc[_0x9edd('0x39')],_0x439083['filters']));_0x3e9a3e=_[_0x9edd('0x4f')]({},_0x3e9a3e,_0x6a1cfc[_0x9edd('0x46')]);return _0x430eb4['get'+_[_0x9edd('0x60')](_0x6a1cfc[_0x9edd('0x39')]['channel'][_0x9edd('0x61')]())+_0x9edd('0x64')](_0x3e9a3e);})[_0x9edd('0x2a')](respondWithResult(_0x4b7e68,null))[_0x9edd('0x4c')](handleError(_0x4b7e68,null));};exports['addQueues']=function(_0x366b04,_0x58330c,_0x1a618c){return db[_0x9edd('0x33')][_0x9edd('0x5b')]({'where':{'id':_0x366b04['params']['id']}})[_0x9edd('0x2a')](function(_0x286593){if(_0x286593){if(!_0x366b04[_0x9edd('0x51')][_0x9edd('0x5c')]||!utils[_0x9edd('0x5d')](_0x366b04[_0x9edd('0x51')][_0x9edd('0x5c')])){throw new db['Sequelize']['ValidationError'](_0x9edd('0x5f'));}return _0x286593[_0x9edd('0x65')+_[_0x9edd('0x60')](_0x366b04[_0x9edd('0x51')][_0x9edd('0x5c')]['toLowerCase']())+_0x9edd('0x64')](_0x366b04[_0x9edd('0x51')][_0x9edd('0x66')]);}return null;})['then'](handleEntityNotFound(_0x58330c,null))[_0x9edd('0x2a')](respondWithStatusCode(_0x58330c,null))[_0x9edd('0x4c')](handleError(_0x58330c,null));};exports['removeQueues']=function(_0x3f3093,_0x3801c4,_0x58c839){return db[_0x9edd('0x33')][_0x9edd('0x5b')]({'where':{'id':_0x3f3093['params']['id']}})[_0x9edd('0x2a')](function(_0x4b8cbc){if(_0x4b8cbc){if(!_0x3f3093['query'][_0x9edd('0x5c')]||!utils[_0x9edd('0x5d')](_0x3f3093[_0x9edd('0x39')]['channel'])){throw new db[(_0x9edd('0x5e'))][(_0x9edd('0x67'))]('Unknown\x20channel');}return _0x4b8cbc[_0x9edd('0x68')+_[_0x9edd('0x60')](_0x3f3093[_0x9edd('0x39')][_0x9edd('0x5c')]['toLowerCase']())+'Queues'](_0x3f3093[_0x9edd('0x39')]['ids']);}return null;})[_0x9edd('0x2a')](handleEntityNotFound(_0x3801c4,null))[_0x9edd('0x2a')](respondWithStatusCode(_0x3801c4,null))[_0x9edd('0x4c')](handleError(_0x3801c4,null));};exports[_0x9edd('0x69')]=function(_0x195921,_0x4786f8){var _0x1eabcd=_[_0x9edd('0x6a')](_0x195921[_0x9edd('0x51')]['ids'])?_0x195921[_0x9edd('0x51')][_0x9edd('0x66')]:[_0x195921[_0x9edd('0x51')][_0x9edd('0x66')]];var _0x206131=_0x195921[_0x9edd('0x4e')]['id'];return db[_0x9edd('0x33')]['find']({'where':{'id':_0x206131}})[_0x9edd('0x2a')](handleEntityNotFound(_0x4786f8,null))[_0x9edd('0x2a')](function(_0x4f44e2){if(_0x4f44e2){var _0x26c11a=[_0x9edd('0x6b'),'Chat',_0x9edd('0x6c'),_0x9edd('0x6d'),_0x9edd('0x6e'),'Openchannel',_0x9edd('0x6f')];return db[_0x9edd('0x70')][_0x9edd('0x71')](function(_0x5a7de3){var _0x5d9cc5=_['map'](_0x26c11a,function(_0x56e981){var _0x3db9db={'attributes':['id',_0x9edd('0x2f')]};if(_0x56e981===_0x9edd('0x6b')){_0x3db9db['through']={'attributes':['penalty']};}return _0x4f44e2['get'+_0x56e981+_0x9edd('0x64')](_0x3db9db)[_0x9edd('0x2a')](function(_0x20762d){var _0x35c7d4=_[_0x9edd('0x32')](_0x20762d,function(_0x18b25e){var _0x3ed0cf=_[_0x9edd('0x32')](_0x1eabcd,function(_0x6a01d1){var _0x2f2c34={'where':{'UserId':_0x6a01d1,[_0x56e981+_0x9edd('0x72')]:_0x18b25e['id']},'transaction':_0x5a7de3};if(_0x56e981===_0x9edd('0x6b')){_0x2f2c34['defaults']={'penalty':_0x18b25e[_0x9edd('0x73')][_0x9edd('0x74')]};}return db[_0x9edd('0x75')+_0x56e981+_0x9edd('0x62')][_0x9edd('0x76')](_0x2f2c34)[_0x9edd('0x2a')](function(){socket[_0x9edd('0x77')](_0x9edd('0x78')+_0x56e981+'Queue:save',{'UserId':_0x6a01d1,[_0x56e981+'QueueId']:_0x18b25e['id']});if(_0x56e981!==_0x9edd('0x6b')){return;}return db['User'][_0x9edd('0x4a')]({'where':{'id':_0x1eabcd,'online':0x1},'attributes':['id','name',_0x9edd('0x79'),_0x9edd('0x7a'),'interface'],'raw':!![]})[_0x9edd('0x2a')](function(_0x411134){var _0x593649=_[_0x9edd('0x32')](_0x411134,function(_0x3d1294){return db[_0x9edd('0x7b')][_0x9edd('0x7c')]({'membername':_0x3d1294[_0x9edd('0x2f')],'UserId':_0x3d1294['id'],'queue_name':_0x18b25e['name'],'VoiceQueueId':_0x18b25e['id'],'interface':_[_0x9edd('0x7d')](_0x3d1294[_0x9edd('0x7e')])?util[_0x9edd('0x7f')](_0x9edd('0x80'),_0x3d1294[_0x9edd('0x2f')]):_0x3d1294['interface'],'paused':_0x3d1294['voicePause']||![],'penalty':_0x18b25e['TeamVoiceQueue']['penalty']},{'transaction':_0x5a7de3});});return Promise['all'](_0x593649);});});});return Promise[_0x9edd('0x81')](_0x3ed0cf);});return Promise['all'](_0x35c7d4);})['then'](function(){return db[_0x9edd('0x82')][_0x9edd('0x5b')]({'where':{'teamId':_0x206131}})[_0x9edd('0x2a')](function(_0x10e427){if(_0x10e427){var _0x27785b=_[_0x9edd('0x32')](_0x1eabcd,function(_0x23e213){db[_0x9edd('0x83')][_0x9edd('0x7c')]({'UserId':_0x23e213,'VoicePrefixId':_0x10e427[_0x9edd('0x84')]});});return Promise['all'](_0x27785b);}});});});return Promise[_0x9edd('0x81')](_0x5d9cc5)[_0x9edd('0x2a')](function(){return _0x4f44e2[_0x9edd('0x69')](_0x1eabcd,{'transaction':_0x5a7de3})[_0x9edd('0x85')](function(_0x27c993){return _0x27c993;});});});}})[_0x9edd('0x2a')](respondWithResult(_0x4786f8,null))[_0x9edd('0x4c')](handleError(_0x4786f8,null));};exports[_0x9edd('0x86')]=function(_0x50d937,_0x49a69b){var _0x401ad3=_[_0x9edd('0x6a')](_0x50d937[_0x9edd('0x39')][_0x9edd('0x66')])?_0x50d937[_0x9edd('0x39')][_0x9edd('0x66')]:[_0x50d937[_0x9edd('0x39')][_0x9edd('0x66')]];var _0x93fef1=_0x50d937[_0x9edd('0x4e')]['id'];return db[_0x9edd('0x33')][_0x9edd('0x50')]({'where':{'id':_0x93fef1}})[_0x9edd('0x2a')](handleEntityNotFound(_0x49a69b,null))[_0x9edd('0x2a')](function(_0x55bc19){if(_0x55bc19){var _0x43b19e=[_0x9edd('0x6b'),'Chat',_0x9edd('0x6c'),_0x9edd('0x6d'),_0x9edd('0x6e'),_0x9edd('0x87'),'Whatsapp'];return db[_0x9edd('0x70')][_0x9edd('0x71')](function(_0xbb5202){var _0x2c96f1=_[_0x9edd('0x32')](_0x43b19e,function(_0x5a23d0){var _0x2fe939={'attributes':['id',_0x9edd('0x2f')]};return _0x55bc19[_0x9edd('0x2c')+_0x5a23d0+_0x9edd('0x64')](_0x2fe939)[_0x9edd('0x2a')](function(_0x59927d){var _0x4d0734=_[_0x9edd('0x32')](_0x59927d,function(_0x5435e3){return _0x5435e3[_0x9edd('0x86')](_0x401ad3,{'transaction':_0xbb5202})['then'](function(){var _0xe9ab48=_[_0x9edd('0x32')](_0x401ad3,function(_0x39c037){socket[_0x9edd('0x77')](_0x9edd('0x78')+_0x5a23d0+_0x9edd('0x88'),{'UserId':Number(_0x39c037),[_0x5a23d0+'QueueId']:_0x5435e3['id']});if(_0x5a23d0!==_0x9edd('0x6b')){return;}return db[_0x9edd('0x7b')][_0x9edd('0x2b')]({'where':{'VoiceQueueId':_0x5435e3['id'],'UserId':_0x39c037},'transaction':_0xbb5202});});return Promise[_0x9edd('0x81')](_0xe9ab48);});});return Promise[_0x9edd('0x81')](_0x4d0734);});});return Promise[_0x9edd('0x81')](_0x2c96f1)[_0x9edd('0x2a')](function(){return _0x55bc19[_0x9edd('0x86')](_0x401ad3,{'transaction':_0xbb5202});})['then'](function(){return db[_0x9edd('0x82')][_0x9edd('0x5b')]({'where':{'teamId':_0x93fef1}})[_0x9edd('0x2a')](function(_0x150f7a){if(_0x150f7a){var _0x385814=_[_0x9edd('0x32')](_0x401ad3,function(_0x3ce64e){db[_0x9edd('0x83')][_0x9edd('0x2b')]({'where':{'UserId':_0x3ce64e,'VoicePrefixId':_0x150f7a[_0x9edd('0x84')]}});});return Promise[_0x9edd('0x81')](_0x385814);}});});});}})[_0x9edd('0x2a')](respondWithStatusCode(_0x49a69b,null))[_0x9edd('0x4c')](handleError(_0x49a69b,null));};exports[_0x9edd('0x89')]=function(_0x299c69,_0x14b9e7,_0x203211){var _0x1c1852={};var _0x39c27f={};var _0x423662;var _0x220701;return db['Team'][_0x9edd('0x5b')]({'where':{'id':_0x299c69['params']['id']}})['then'](handleEntityNotFound(_0x14b9e7,null))[_0x9edd('0x2a')](function(_0x108244){if(_0x108244){_0x423662=_0x108244;_0x39c27f[_0x9edd('0x38')]=_[_0x9edd('0x3a')](db[_0x9edd('0x75')][_0x9edd('0x34')]);_0x39c27f[_0x9edd('0x39')]=_[_0x9edd('0x3a')](_0x299c69[_0x9edd('0x39')]);_0x39c27f[_0x9edd('0x3b')]=_['intersection'](_0x39c27f[_0x9edd('0x38')],_0x39c27f[_0x9edd('0x39')]);_0x1c1852['attributes']=_['intersection'](_0x39c27f[_0x9edd('0x38')],qs[_0x9edd('0x3e')](_0x299c69[_0x9edd('0x39')][_0x9edd('0x3e')]));_0x1c1852['attributes']=_0x1c1852['attributes'][_0x9edd('0x3f')]?_0x1c1852['attributes']:_0x39c27f[_0x9edd('0x38')];_0x1c1852[_0x9edd('0x63')]=qs[_0x9edd('0x42')](_0x299c69['query']['sort']);_0x1c1852['where']=qs[_0x9edd('0x3b')](_[_0x9edd('0x8a')](_0x299c69[_0x9edd('0x39')],_0x39c27f['filters']));if(_0x299c69[_0x9edd('0x39')][_0x9edd('0x45')]){_0x1c1852['where']=_[_0x9edd('0x4f')](_0x1c1852[_0x9edd('0x43')],{'$or':_['map'](_0x1c1852['attributes'],function(_0x427db2){var _0x81cf58={};_0x81cf58[_0x427db2]={'$like':'%'+_0x299c69['query'][_0x9edd('0x45')]+'%'};return _0x81cf58;})});}_0x1c1852=_[_0x9edd('0x4f')]({},_0x1c1852,_0x299c69['options']);return _0x423662[_0x9edd('0x89')](_0x1c1852);}})['then'](function(_0x308a0f){if(_0x308a0f){_0x220701=_0x308a0f[_0x9edd('0x3f')];if(!_0x299c69[_0x9edd('0x39')][_0x9edd('0x40')](_0x9edd('0x41'))){_0x1c1852[_0x9edd('0x22')]=qs['limit'](_0x299c69[_0x9edd('0x39')][_0x9edd('0x22')]);_0x1c1852[_0x9edd('0x21')]=qs['offset'](_0x299c69[_0x9edd('0x39')]['offset']);}return _0x423662[_0x9edd('0x89')](_0x1c1852);}})[_0x9edd('0x2a')](function(_0x25da04){if(_0x25da04){return _0x25da04?{'count':_0x220701,'rows':_0x25da04}:null;}})[_0x9edd('0x2a')](respondWithResult(_0x14b9e7,null))['catch'](handleError(_0x14b9e7,null));}; \ No newline at end of file +var _0x9c44=['redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','reject','save','then','destroy','UserProfileResource','error','stack','name','index','map','Team','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','update','channel','isValidChannel','Sequelize','ValidationError','capitalize','length','toLowerCase','Queues','addQueues','findOne','add','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Voice','Mail','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','User','findOrCreate','Queue:save','QueueId','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','UserVoicePrefix','spread','removeAgents','Sms','emit','Queue:remove','VoicePrefixId','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults'];(function(_0xc78a2b,_0x3c7b2c){var _0x4c08c2=function(_0x1a4bd6){while(--_0x1a4bd6){_0xc78a2b['push'](_0xc78a2b['shift']());}};_0x4c08c2(++_0x3c7b2c);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];config['redis']=_[_0x49c4('0x16')](config[_0x49c4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0x18'))(new Redis(config[_0x49c4('0x17')]));require(_0x49c4('0x19'))[_0x49c4('0x1a')](socket);function respondWithStatusCode(_0x12777c,_0x18211c){_0x18211c=_0x18211c||0xcc;return function(_0x75ea8){if(_0x75ea8){return _0x12777c[_0x49c4('0x1b')](_0x18211c);}return _0x12777c['status'](_0x18211c)[_0x49c4('0x1c')]();};}function respondWithResult(_0x141003,_0x13a2db){_0x13a2db=_0x13a2db||0xc8;return function(_0x81e831){if(_0x81e831){return _0x141003[_0x49c4('0x1d')](_0x13a2db)['json'](_0x81e831);}};}function respondWithFilteredResult(_0x44e607,_0x2891f4){return function(_0x4c3253){if(_0x4c3253){var _0x512650=typeof _0x2891f4[_0x49c4('0x1e')]===_0x49c4('0x1f')&&typeof _0x2891f4[_0x49c4('0x20')]==='undefined';var _0x24856d=_0x4c3253['count'];var _0x2cbd50=_0x512650?0x0:_0x2891f4[_0x49c4('0x1e')];var _0xe31fcc=_0x512650?_0x4c3253[_0x49c4('0x21')]:_0x2891f4[_0x49c4('0x1e')]+_0x2891f4[_0x49c4('0x20')];var _0x280893;if(_0xe31fcc>=_0x24856d){_0xe31fcc=_0x24856d;_0x280893=0xc8;}else{_0x280893=0xce;}_0x44e607[_0x49c4('0x1d')](_0x280893);return _0x44e607[_0x49c4('0x22')]('Content-Range',_0x2cbd50+'-'+_0xe31fcc+'/'+_0x24856d)['json'](_0x4c3253);}return null;};}function patchUpdates(_0x57f502){return function(_0x1c99b1){try{jsonpatch['apply'](_0x1c99b1,_0x57f502,!![]);}catch(_0x592bb8){return BPromise[_0x49c4('0x23')](_0x592bb8);}return _0x1c99b1[_0x49c4('0x24')]();};}function saveUpdates(_0x26c640,_0xd335e4){return function(_0x4811c4){if(_0x4811c4){return _0x4811c4['update'](_0x26c640)[_0x49c4('0x25')](function(_0x9cb797){return _0x9cb797;});}return null;};}function removeEntity(_0x565423,_0x207358){return function(_0x43e014){if(_0x43e014){return _0x43e014[_0x49c4('0x26')]()[_0x49c4('0x25')](function(){var _0x531d92=_0x43e014['get']({'plain':!![]});var _0x449960='Teams';return db[_0x49c4('0x27')][_0x49c4('0x26')]({'where':{'type':_0x449960,'resourceId':_0x531d92['id']}})[_0x49c4('0x25')](function(){return _0x43e014;});})[_0x49c4('0x25')](function(){_0x565423['status'](0xcc)[_0x49c4('0x1c')]();});}};}function handleEntityNotFound(_0x2b2793,_0x46e04d){return function(_0x4f28a2){if(!_0x4f28a2){_0x2b2793[_0x49c4('0x1b')](0x194);}return _0x4f28a2;};}function handleError(_0x29f835,_0x26ba17){_0x26ba17=_0x26ba17||0x1f4;return function(_0x427b26){logger[_0x49c4('0x28')](_0x427b26[_0x49c4('0x29')]);if(_0x427b26[_0x49c4('0x2a')]){delete _0x427b26['name'];}_0x29f835['status'](_0x26ba17)['send'](_0x427b26);};}exports[_0x49c4('0x2b')]=function(_0x7ee704,_0x1eb035){var _0x27e467={},_0x28eb47={},_0x574fd3={'count':0x0,'rows':[]};var _0x38ad77=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x58e252){return{'name':_0x58e252['fieldName'],'type':_0x58e252[_0x49c4('0x2f')][_0x49c4('0x30')]};});_0x28eb47[_0x49c4('0x31')]=_[_0x49c4('0x2c')](_0x38ad77,_0x49c4('0x2a'));_0x28eb47['query']=_[_0x49c4('0x32')](_0x7ee704[_0x49c4('0x33')]);_0x28eb47[_0x49c4('0x34')]=_['intersection'](_0x28eb47['model'],_0x28eb47[_0x49c4('0x33')]);_0x27e467[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x28eb47[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x37')]));_0x27e467[_0x49c4('0x35')]=_0x27e467[_0x49c4('0x35')]['length']?_0x27e467[_0x49c4('0x35')]:_0x28eb47['model'];if(!_0x7ee704[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x27e467[_0x49c4('0x20')]=qs['limit'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x20')]);_0x27e467[_0x49c4('0x1e')]=qs['offset'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x1e')]);}_0x27e467[_0x49c4('0x3a')]=qs[_0x49c4('0x3b')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x27e467[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x7ee704[_0x49c4('0x33')],_0x28eb47[_0x49c4('0x34')]),_0x38ad77);if(_0x7ee704['query'][_0x49c4('0x3e')]){_0x27e467[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x27e467[_0x49c4('0x3c')],{'$or':_[_0x49c4('0x2c')](_0x38ad77,function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x2f')]!==_0x49c4('0x40')){var _0x248c0a={};_0x248c0a[_0x29dd5d[_0x49c4('0x2a')]]={'$like':'%'+_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3e')]+'%'};return _0x248c0a;}})});}_0x27e467=_[_0x49c4('0x3f')]({},_0x27e467,_0x7ee704['options']);var _0x212366={'where':_0x27e467['where']};return db[_0x49c4('0x2d')][_0x49c4('0x21')](_0x212366)[_0x49c4('0x25')](function(_0x1480da){_0x574fd3[_0x49c4('0x21')]=_0x1480da;if(_0x7ee704[_0x49c4('0x33')]['includeAll']){_0x27e467['include']=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x41')](_0x27e467);})[_0x49c4('0x25')](function(_0x117151){_0x574fd3['rows']=_0x117151;return _0x574fd3;})[_0x49c4('0x25')](respondWithFilteredResult(_0x1eb035,_0x27e467))[_0x49c4('0x42')](handleError(_0x1eb035,null));};exports[_0x49c4('0x43')]=function(_0x444270,_0x81a674){var _0x3bde49={'raw':![],'where':{'id':_0x444270[_0x49c4('0x44')]['id']}},_0x1a9593={};_0x1a9593[_0x49c4('0x31')]=_['keys'](db[_0x49c4('0x2d')]['rawAttributes']);_0x1a9593[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x444270[_0x49c4('0x33')]);_0x1a9593[_0x49c4('0x34')]=_[_0x49c4('0x36')](_0x1a9593['model'],_0x1a9593[_0x49c4('0x33')]);_0x3bde49[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x1a9593[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x444270[_0x49c4('0x33')][_0x49c4('0x37')]));_0x3bde49['attributes']=_0x3bde49[_0x49c4('0x35')]['length']?_0x3bde49[_0x49c4('0x35')]:_0x1a9593[_0x49c4('0x31')];if(_0x444270[_0x49c4('0x33')][_0x49c4('0x45')]){_0x3bde49[_0x49c4('0x46')]=[{'all':!![]}];}_0x3bde49=_[_0x49c4('0x3f')]({},_0x3bde49,_0x444270[_0x49c4('0x47')]);return db['Team'][_0x49c4('0x48')](_0x3bde49)[_0x49c4('0x25')](handleEntityNotFound(_0x81a674,null))['then'](respondWithResult(_0x81a674,null))[_0x49c4('0x42')](handleError(_0x81a674,null));};exports[_0x49c4('0x49')]=function(_0xfbe179,_0x242afc){return db['Team']['create'](_0xfbe179[_0x49c4('0x4a')],{})['then'](function(_0x4597c3){var _0x1f941f=_0xfbe179[_0x49c4('0x4b')][_0x49c4('0x4c')]({'plain':!![]});if(!_0x1f941f)throw new Error(_0x49c4('0x4d'));if(_0x1f941f[_0x49c4('0x4e')]===_0x49c4('0x4b')){var _0x563f0b=_0x4597c3[_0x49c4('0x4c')]({'plain':!![]});var _0x1550ce=_0x49c4('0x4f');return db[_0x49c4('0x50')][_0x49c4('0x48')]({'where':{'name':_0x1550ce,'userProfileId':_0x1f941f[_0x49c4('0x51')]},'raw':!![]})[_0x49c4('0x25')](function(_0x25d174){if(_0x25d174&&_0x25d174[_0x49c4('0x52')]===0x0){return db[_0x49c4('0x27')]['create']({'name':_0x563f0b['name'],'resourceId':_0x563f0b['id'],'type':_0x25d174[_0x49c4('0x2a')],'sectionId':_0x25d174['id']},{})[_0x49c4('0x25')](function(){return _0x4597c3;});}else{return _0x4597c3;}})['catch'](function(_0x59a8bc){logger[_0x49c4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59a8bc);throw _0x59a8bc;});}return _0x4597c3;})['then'](respondWithResult(_0x242afc,0xc9))[_0x49c4('0x42')](handleError(_0x242afc,null));};exports[_0x49c4('0x53')]=function(_0x4a0a93,_0x38c480){if(_0x4a0a93[_0x49c4('0x4a')]['id']){delete _0x4a0a93[_0x49c4('0x4a')]['id'];}return db[_0x49c4('0x2d')]['find']({'where':{'id':_0x4a0a93[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x38c480,null))[_0x49c4('0x25')](saveUpdates(_0x4a0a93[_0x49c4('0x4a')],null))[_0x49c4('0x25')](respondWithResult(_0x38c480,null))[_0x49c4('0x42')](handleError(_0x38c480,null));};exports['destroy']=function(_0x5c7ddd,_0x1ef0c1){return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x5c7ddd[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x1ef0c1,null))[_0x49c4('0x25')](removeEntity(_0x1ef0c1,null))[_0x49c4('0x42')](handleError(_0x1ef0c1,null));};exports['getQueues']=function(_0x45d715,_0x33c9a6,_0x4ba4eb){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x45d715[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x33c9a6,null))[_0x49c4('0x25')](function(_0x2fe89a){if(!_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x45d715[_0x49c4('0x33')]['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}var _0x10dec7={};var _0x299e74={};_0x299e74['model']=_[_0x49c4('0x32')](db[_[_0x49c4('0x58')](_0x45d715['query']['channel']['toLowerCase']())+'Queue'][_0x49c4('0x2e')]);_0x299e74['query']=_[_0x49c4('0x32')](_0x45d715[_0x49c4('0x33')]);_0x299e74['filters']=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],_0x299e74['query']);_0x10dec7[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x45d715['query'][_0x49c4('0x37')]));_0x10dec7[_0x49c4('0x35')]=_0x10dec7[_0x49c4('0x35')][_0x49c4('0x59')]?_0x10dec7['attributes']:_0x299e74[_0x49c4('0x31')];_0x10dec7['limit']=qs['limit'](_0x45d715['query']['limit']);_0x10dec7[_0x49c4('0x1e')]=qs[_0x49c4('0x1e')](_0x45d715[_0x49c4('0x33')][_0x49c4('0x1e')]);_0x10dec7['order']=qs['sort'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x10dec7[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x45d715[_0x49c4('0x33')],_0x299e74[_0x49c4('0x34')]));_0x10dec7=_[_0x49c4('0x3f')]({},_0x10dec7,_0x45d715['options']);return _0x2fe89a[_0x49c4('0x4c')+_['capitalize'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x10dec7);})[_0x49c4('0x25')](respondWithResult(_0x33c9a6,null))[_0x49c4('0x42')](handleError(_0x33c9a6,null));};exports[_0x49c4('0x5c')]=function(_0x3feb0b,_0x13d951,_0x1743d0){return db[_0x49c4('0x2d')][_0x49c4('0x5d')]({'where':{'id':_0x3feb0b[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x2d5f63){if(_0x2d5f63){if(!_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x3feb0b['body']['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}return _0x2d5f63[_0x49c4('0x5e')+_[_0x49c4('0x58')](_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]['toLowerCase']())+'Queues'](_0x3feb0b['body'][_0x49c4('0x5f')]);}return null;})[_0x49c4('0x25')](handleEntityNotFound(_0x13d951,null))[_0x49c4('0x25')](respondWithStatusCode(_0x13d951,null))[_0x49c4('0x42')](handleError(_0x13d951,null));};exports[_0x49c4('0x60')]=function(_0x146706,_0x191afb,_0x3692a4){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x146706[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x342f8f){if(_0x342f8f){if(!_0x146706['query'][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))](_0x49c4('0x61'));}return _0x342f8f[_0x49c4('0x62')+_['capitalize'](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x146706[_0x49c4('0x33')]['ids']);}return null;})['then'](handleEntityNotFound(_0x191afb,null))[_0x49c4('0x25')](respondWithStatusCode(_0x191afb,null))['catch'](handleError(_0x191afb,null));};exports[_0x49c4('0x63')]=function(_0x558880,_0x23516e){var _0x27b77d=_[_0x49c4('0x64')](_0x558880[_0x49c4('0x4a')]['ids'])?_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]:[_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]];var _0x100bc4=_0x558880[_0x49c4('0x44')]['id'];return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x100bc4}})[_0x49c4('0x25')](handleEntityNotFound(_0x23516e,null))[_0x49c4('0x25')](function(_0x5e7f45){if(_0x5e7f45){var _0x228189=[_0x49c4('0x65'),'Chat',_0x49c4('0x66'),'Sms',_0x49c4('0x67'),_0x49c4('0x68'),_0x49c4('0x69')];return db[_0x49c4('0x6a')][_0x49c4('0x6b')](function(_0x58b90c){var _0x16f618=_[_0x49c4('0x2c')](_0x228189,function(_0x596a9e){var _0x2b5136={'attributes':['id',_0x49c4('0x2a')]};if(_0x596a9e==='Voice'){_0x2b5136[_0x49c4('0x6c')]={'attributes':[_0x49c4('0x6d')]};}return _0x5e7f45['get'+_0x596a9e+_0x49c4('0x5b')](_0x2b5136)[_0x49c4('0x25')](function(_0x25989a){var _0x33dc39=_['map'](_0x25989a,function(_0x999ae2){var _0x7212ce=_['map'](_0x27b77d,function(_0x45df7c){var _0x5f0188={'where':{'UserId':_0x45df7c,[_0x596a9e+'QueueId']:_0x999ae2['id']},'transaction':_0x58b90c};if(_0x596a9e===_0x49c4('0x65')){_0x5f0188['defaults']={'penalty':_0x999ae2['TeamVoiceQueue'][_0x49c4('0x6d')]};}return db[_0x49c4('0x6e')+_0x596a9e+'Queue'][_0x49c4('0x6f')](_0x5f0188)['then'](function(){socket['emit']('user'+_0x596a9e+_0x49c4('0x70'),{'UserId':_0x45df7c,[_0x596a9e+_0x49c4('0x71')]:_0x999ae2['id']});if(_0x596a9e!==_0x49c4('0x65')){return;}return db[_0x49c4('0x6e')]['findAll']({'where':{'id':_0x27b77d,'online':0x1},'attributes':['id','name',_0x49c4('0x72'),'voicePause',_0x49c4('0x73')],'raw':!![]})['then'](function(_0x4e381c){var _0x10a048=_[_0x49c4('0x2c')](_0x4e381c,function(_0x1076be){return db[_0x49c4('0x74')][_0x49c4('0x75')]({'membername':_0x1076be[_0x49c4('0x2a')],'UserId':_0x1076be['id'],'queue_name':_0x999ae2['name'],'VoiceQueueId':_0x999ae2['id'],'interface':_[_0x49c4('0x76')](_0x1076be[_0x49c4('0x73')])?util[_0x49c4('0x77')](_0x49c4('0x78'),_0x1076be[_0x49c4('0x2a')]):_0x1076be['interface'],'paused':_0x1076be[_0x49c4('0x79')]||![],'penalty':_0x999ae2[_0x49c4('0x7a')][_0x49c4('0x6d')]},{'transaction':_0x58b90c});});return Promise['all'](_0x10a048);});});});return Promise['all'](_0x7212ce);});return Promise[_0x49c4('0x7b')](_0x33dc39);})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')][_0x49c4('0x5d')]({'where':{'teamId':_0x100bc4}})[_0x49c4('0x25')](function(_0x4e1c71){if(_0x4e1c71){var _0x83b5f2=_[_0x49c4('0x2c')](_0x27b77d,function(_0x191974){db[_0x49c4('0x7d')]['upsert']({'UserId':_0x191974,'VoicePrefixId':_0x4e1c71['VoicePrefixId']});});return Promise[_0x49c4('0x7b')](_0x83b5f2);}});});});return Promise[_0x49c4('0x7b')](_0x16f618)[_0x49c4('0x25')](function(){return _0x5e7f45[_0x49c4('0x63')](_0x27b77d,{'transaction':_0x58b90c})[_0x49c4('0x7e')](function(_0x5413d8){return _0x5413d8;});});});}})[_0x49c4('0x25')](respondWithResult(_0x23516e,null))[_0x49c4('0x42')](handleError(_0x23516e,null));};exports[_0x49c4('0x7f')]=function(_0x1b0111,_0x2cddc1){var _0x8f37e5=_['isArray'](_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')])?_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')]:[_0x1b0111['query']['ids']];var _0xa96f53=_0x1b0111['params']['id'];return db[_0x49c4('0x2d')]['find']({'where':{'id':_0xa96f53}})[_0x49c4('0x25')](handleEntityNotFound(_0x2cddc1,null))[_0x49c4('0x25')](function(_0x25afc3){if(_0x25afc3){var _0x20bec7=['Voice','Chat',_0x49c4('0x66'),_0x49c4('0x80'),_0x49c4('0x67'),'Openchannel','Whatsapp'];return db[_0x49c4('0x6a')]['transaction'](function(_0x5c4742){var _0x1b9473=_['map'](_0x20bec7,function(_0x22668b){var _0x3cfa95={'attributes':['id','name']};return _0x25afc3[_0x49c4('0x4c')+_0x22668b+_0x49c4('0x5b')](_0x3cfa95)['then'](function(_0x5428a9){var _0xdb9820=_['map'](_0x5428a9,function(_0x43fe1c){return _0x43fe1c[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742})[_0x49c4('0x25')](function(){var _0x352733=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x4483fc){socket[_0x49c4('0x81')]('user'+_0x22668b+_0x49c4('0x82'),{'UserId':Number(_0x4483fc),[_0x22668b+_0x49c4('0x71')]:_0x43fe1c['id']});if(_0x22668b!==_0x49c4('0x65')){return;}return db[_0x49c4('0x74')][_0x49c4('0x26')]({'where':{'VoiceQueueId':_0x43fe1c['id'],'UserId':_0x4483fc},'transaction':_0x5c4742});});return Promise['all'](_0x352733);});});return Promise[_0x49c4('0x7b')](_0xdb9820);});});return Promise['all'](_0x1b9473)[_0x49c4('0x25')](function(){return _0x25afc3[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742});})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')]['findOne']({'where':{'teamId':_0xa96f53}})[_0x49c4('0x25')](function(_0x139696){if(_0x139696){var _0x312b02=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x332173){db[_0x49c4('0x7d')]['destroy']({'where':{'UserId':_0x332173,'VoicePrefixId':_0x139696[_0x49c4('0x83')]}});});return Promise['all'](_0x312b02);}});});});}})[_0x49c4('0x25')](respondWithStatusCode(_0x2cddc1,null))[_0x49c4('0x42')](handleError(_0x2cddc1,null));};exports[_0x49c4('0x84')]=function(_0x2722fe,_0x5d864b,_0x46eaa1){var _0x17e7c6={};var _0x5829bc={};var _0x1e0b7d;var _0x3c321f;return db['Team']['findOne']({'where':{'id':_0x2722fe[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x5d864b,null))[_0x49c4('0x25')](function(_0x1aa3a3){if(_0x1aa3a3){_0x1e0b7d=_0x1aa3a3;_0x5829bc[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x6e')][_0x49c4('0x2e')]);_0x5829bc[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x2722fe[_0x49c4('0x33')]);_0x5829bc['filters']=_['intersection'](_0x5829bc[_0x49c4('0x31')],_0x5829bc[_0x49c4('0x33')]);_0x17e7c6[_0x49c4('0x35')]=_['intersection'](_0x5829bc[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x2722fe['query'][_0x49c4('0x37')]));_0x17e7c6['attributes']=_0x17e7c6[_0x49c4('0x35')][_0x49c4('0x59')]?_0x17e7c6[_0x49c4('0x35')]:_0x5829bc[_0x49c4('0x31')];_0x17e7c6['order']=qs[_0x49c4('0x3b')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x17e7c6[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_['pick'](_0x2722fe['query'],_0x5829bc['filters']));if(_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3e')]){_0x17e7c6[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x17e7c6[_0x49c4('0x3c')],{'$or':_['map'](_0x17e7c6[_0x49c4('0x35')],function(_0x41ef7c){var _0x265dc3={};_0x265dc3[_0x41ef7c]={'$like':'%'+_0x2722fe[_0x49c4('0x33')]['filter']+'%'};return _0x265dc3;})});}_0x17e7c6=_[_0x49c4('0x3f')]({},_0x17e7c6,_0x2722fe[_0x49c4('0x47')]);return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x2fda4f){if(_0x2fda4f){_0x3c321f=_0x2fda4f['length'];if(!_0x2722fe[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x17e7c6['limit']=qs[_0x49c4('0x20')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x20')]);_0x17e7c6['offset']=qs[_0x49c4('0x1e')](_0x2722fe['query']['offset']);}return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x4ef4aa){if(_0x4ef4aa){return _0x4ef4aa?{'count':_0x3c321f,'rows':_0x4ef4aa}:null;}})[_0x49c4('0x25')](respondWithResult(_0x5d864b,null))[_0x49c4('0x42')](handleError(_0x5d864b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f056a66..5e7c848 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 _0x5b55=['emit','hasOwnProperty','hook','exports','events','Team','setMaxListeners','update','remove'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5b55,0x1e1));var _0x55b5=function(_0x11cbbd,_0x5d4106){_0x11cbbd=_0x11cbbd-0x0;var _0x153af2=_0x5b55[_0x11cbbd];return _0x153af2;};'use strict';var EventEmitter=require(_0x55b5('0x0'));var Team=require('../../mysqldb')['db'][_0x55b5('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x55b5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x55b5('0x3'),'afterDestroy':_0x55b5('0x4')};function emitEvent(_0x1f6e4f){return function(_0x2ee1,_0x1e97fb,_0x44cca2){TeamEvents[_0x55b5('0x5')](_0x1f6e4f+':'+_0x2ee1['id'],_0x2ee1);TeamEvents[_0x55b5('0x5')](_0x1f6e4f,_0x2ee1);_0x44cca2(null);};}for(var e in events){if(events[_0x55b5('0x6')](e)){var event=events[e];Team[_0x55b5('0x7')](e,emitEvent(event));}}module[_0x55b5('0x8')]=TeamEvents; \ No newline at end of file +var _0xa36e=['remove','emit','hook','exports','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x200dbd,_0x2d0e00){var _0x17b9bb=function(_0x351ca9){while(--_0x351ca9){_0x200dbd['push'](_0x200dbd['shift']());}};_0x17b9bb(++_0x2d0e00);}(_0xa36e,0xee));var _0xea36=function(_0x282ba3,_0x336593){_0x282ba3=_0x282ba3-0x0;var _0x4d454b=_0xa36e[_0x282ba3];return _0x4d454b;};'use strict';var EventEmitter=require('events');var Team=require(_0xea36('0x0'))['db'][_0xea36('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xea36('0x2')](0x0);var events={'afterCreate':_0xea36('0x3'),'afterUpdate':_0xea36('0x4'),'afterDestroy':_0xea36('0x5')};function emitEvent(_0x3dc011){return function(_0xb52a07,_0x865628,_0x430c24){TeamEvents[_0xea36('0x6')](_0x3dc011+':'+_0xb52a07['id'],_0xb52a07);TeamEvents['emit'](_0x3dc011,_0xb52a07);_0x430c24(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xea36('0x7')](e,emitEvent(event));}}module[_0xea36('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 83c6f7f..d044b6e 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 _0x7119=['api','request-promise','path','../../config/environment','exports','define','Team','teams','lodash','util','../../config/logger'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x7119,0x194));var _0x9711=function(_0x2c3bd9,_0x45f815){_0x2c3bd9=_0x2c3bd9-0x0;var _0x112e55=_0x7119[_0x2c3bd9];return _0x112e55;};'use strict';var _=require(_0x9711('0x0'));var util=require(_0x9711('0x1'));var logger=require(_0x9711('0x2'))(_0x9711('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9711('0x4'));var fs=require('fs');var path=require(_0x9711('0x5'));var rimraf=require('rimraf');var config=require(_0x9711('0x6'));var attributes=require('./team.attributes');module[_0x9711('0x7')]=function(_0x50fae0,_0x5019e1){return _0x50fae0[_0x9711('0x8')](_0x9711('0x9'),attributes,{'tableName':_0x9711('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x126b=['bluebird','request-promise','path','rimraf','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','api'];(function(_0x43caa2,_0x1ffb73){var _0x51b342=function(_0x288f85){while(--_0x288f85){_0x43caa2['push'](_0x43caa2['shift']());}};_0x51b342(++_0x1ffb73);}(_0x126b,0x1b6));var _0xb126=function(_0xe16058,_0x1b1898){_0xe16058=_0xe16058-0x0;var _0xc80b5b=_0x126b[_0xe16058];return _0xc80b5b;};'use strict';var _=require(_0xb126('0x0'));var util=require(_0xb126('0x1'));var logger=require(_0xb126('0x2'))(_0xb126('0x3'));var moment=require('moment');var BPromise=require(_0xb126('0x4'));var rp=require(_0xb126('0x5'));var fs=require('fs');var path=require(_0xb126('0x6'));var rimraf=require(_0xb126('0x7'));var config=require('../../config/environment');var attributes=require(_0xb126('0x8'));module[_0xb126('0x9')]=function(_0x444474,_0x404eb0){return _0x444474[_0xb126('0xa')](_0xb126('0xb'),attributes,{'tableName':_0xb126('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a338719..24e575b 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 _0x7cbf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x7cbf,0xcc));var _0xf7cb=function(_0x3166f5,_0x560038){_0x3166f5=_0x3166f5-0x0;var _0x52d731=_0x7cbf[_0x3166f5];return _0x52d731;};'use strict';var _=require('lodash');var util=require(_0xf7cb('0x0'));var moment=require(_0xf7cb('0x1'));var BPromise=require('bluebird');var rs=require(_0xf7cb('0x2'));var fs=require('fs');var Redis=require(_0xf7cb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7cb('0x4'));var logger=require(_0xf7cb('0x5'))(_0xf7cb('0x6'));var config=require(_0xf7cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7cb('0x8')]['http']({'port':0x232a});config[_0xf7cb('0x9')]=_['defaults'](config[_0xf7cb('0x9')],{'host':_0xf7cb('0xa'),'port':0x18eb});var socket=require(_0xf7cb('0xb'))(new Redis(config['redis']));require(_0xf7cb('0xc'))[_0xf7cb('0xd')](socket);function respondWithRpcPromise(_0x432feb,_0x42b876,_0x1f1393){return new BPromise(function(_0x5e7998,_0x464fd1){return client[_0xf7cb('0xe')](_0x432feb,_0x1f1393)[_0xf7cb('0xf')](function(_0xfc1f88){logger[_0xf7cb('0x10')](_0xf7cb('0x11'),_0x42b876,_0xf7cb('0x12'));logger[_0xf7cb('0x13')](_0xf7cb('0x14'),_0x42b876,_0xf7cb('0x12'),JSON[_0xf7cb('0x15')](_0xfc1f88));if(_0xfc1f88['error']){if(_0xfc1f88[_0xf7cb('0x16')]['code']===0x1f4){logger['error'](_0xf7cb('0x11'),_0x42b876,_0xfc1f88[_0xf7cb('0x16')][_0xf7cb('0x17')]);return _0x464fd1(_0xfc1f88['error']['message']);}logger['error'](_0xf7cb('0x11'),_0x42b876,_0xfc1f88[_0xf7cb('0x16')][_0xf7cb('0x17')]);return _0x5e7998(_0xfc1f88[_0xf7cb('0x16')][_0xf7cb('0x17')]);}else{logger[_0xf7cb('0x10')](_0xf7cb('0x11'),_0x42b876,_0xf7cb('0x12'));_0x5e7998(_0xfc1f88[_0xf7cb('0x18')]['message']);}})[_0xf7cb('0x19')](function(_0x12af5d){logger[_0xf7cb('0x16')](_0xf7cb('0x11'),_0x42b876,_0x12af5d);_0x464fd1(_0x12af5d);});});} \ No newline at end of file +var _0x1a64=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3bb0db,_0x203203){var _0x22b0d7=function(_0x2a752b){while(--_0x2a752b){_0x3bb0db['push'](_0x3bb0db['shift']());}};_0x22b0d7(++_0x203203);}(_0x1a64,0x1d6));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41a6('0x0'));var util=require(_0x41a6('0x1'));var moment=require(_0x41a6('0x2'));var BPromise=require(_0x41a6('0x3'));var rs=require(_0x41a6('0x4'));var fs=require('fs');var Redis=require(_0x41a6('0x5'));var db=require(_0x41a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x41a6('0x7')]({'port':0x232a});config[_0x41a6('0x8')]=_[_0x41a6('0x9')](config['redis'],{'host':_0x41a6('0xa'),'port':0x18eb});var socket=require(_0x41a6('0xb'))(new Redis(config['redis']));require(_0x41a6('0xc'))[_0x41a6('0xd')](socket);function respondWithRpcPromise(_0x4b7899,_0x539c69,_0x1b777c){return new BPromise(function(_0x2f3c74,_0x152c19){return client[_0x41a6('0xe')](_0x4b7899,_0x1b777c)[_0x41a6('0xf')](function(_0x5242a3){logger[_0x41a6('0x10')](_0x41a6('0x11'),_0x539c69,_0x41a6('0x12'));logger[_0x41a6('0x13')](_0x41a6('0x14'),_0x539c69,_0x41a6('0x12'),JSON[_0x41a6('0x15')](_0x5242a3));if(_0x5242a3['error']){if(_0x5242a3[_0x41a6('0x16')][_0x41a6('0x17')]===0x1f4){logger[_0x41a6('0x16')]('Team,\x20%s,\x20%s',_0x539c69,_0x5242a3[_0x41a6('0x16')]['message']);return _0x152c19(_0x5242a3[_0x41a6('0x16')]['message']);}logger[_0x41a6('0x16')](_0x41a6('0x11'),_0x539c69,_0x5242a3[_0x41a6('0x16')][_0x41a6('0x18')]);return _0x2f3c74(_0x5242a3[_0x41a6('0x16')]['message']);}else{logger[_0x41a6('0x10')](_0x41a6('0x11'),_0x539c69,_0x41a6('0x12'));_0x2f3c74(_0x5242a3['result'][_0x41a6('0x18')]);}})[_0x41a6('0x19')](function(_0x36e27d){logger['error'](_0x41a6('0x11'),_0x539c69,_0x36e27d);_0x152c19(_0x36e27d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e275d73..4bdded5 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 _0x6f7a=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x19dce0,_0x619412){var _0x2b5665=function(_0x5b86cc){while(--_0x5b86cc){_0x19dce0['push'](_0x19dce0['shift']());}};_0x2b5665(++_0x619412);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5adccc,_0x2afc27){_0x5adccc=_0x5adccc-0x0;var _0x500b7e=_0x6f7a[_0x5adccc];return _0x500b7e;};'use strict';var TeamEvents=require(_0xa6f7('0x0'));var events=[_0xa6f7('0x1'),_0xa6f7('0x2'),_0xa6f7('0x3')];function createListener(_0x4dd99d,_0x93614a){return function(_0x407de3){_0x93614a[_0xa6f7('0x4')](_0x4dd99d,_0x407de3);};}function removeListener(_0x1da6dc,_0x22e529){return function(){TeamEvents[_0xa6f7('0x5')](_0x1da6dc,_0x22e529);};}exports[_0xa6f7('0x6')]=function(_0x20cccd){for(var _0x1fdd5f=0x0,_0x335aaa=events[_0xa6f7('0x7')];_0x1fdd5f<_0x335aaa;_0x1fdd5f++){var _0x481a8c=events[_0x1fdd5f];var _0x4b4f9e=createListener(_0xa6f7('0x8')+_0x481a8c,_0x20cccd);TeamEvents['on'](_0x481a8c,_0x4b4f9e);}}; \ No newline at end of file +var _0xa83a=['emit','removeListener','register','team:','save','remove'];(function(_0x2f6e14,_0x1338a5){var _0x3faf04=function(_0x512036){while(--_0x512036){_0x2f6e14['push'](_0x2f6e14['shift']());}};_0x3faf04(++_0x1338a5);}(_0xa83a,0x88));var _0xaa83=function(_0x45a837,_0x5710da){_0x45a837=_0x45a837-0x0;var _0x4852be=_0xa83a[_0x45a837];return _0x4852be;};'use strict';var TeamEvents=require('./team.events');var events=[_0xaa83('0x0'),_0xaa83('0x1'),'update'];function createListener(_0x4b12fa,_0x17a8bd){return function(_0x1f3808){_0x17a8bd[_0xaa83('0x2')](_0x4b12fa,_0x1f3808);};}function removeListener(_0x46b692,_0x57f849){return function(){TeamEvents[_0xaa83('0x3')](_0x46b692,_0x57f849);};}exports[_0xaa83('0x4')]=function(_0x280637){for(var _0x9c332d=0x0,_0x31d733=events['length'];_0x9c332d<_0x31d733;_0x9c332d++){var _0x5d5a47=events[_0x9c332d];var _0x582edf=createListener(_0xaa83('0x5')+_0x5d5a47,_0x280637);TeamEvents['on'](_0x5d5a47,_0x582edf);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 9ad318a..cfac2d6 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 _0x5f01=['exports','INTEGER','sequelize'];(function(_0x4bfa07,_0x594942){var _0xf705c7=function(_0x2b70b7){while(--_0x2b70b7){_0x4bfa07['push'](_0x4bfa07['shift']());}};_0xf705c7(++_0x594942);}(_0x5f01,0x9e));var _0x15f0=function(_0x211232,_0x31210b){_0x211232=_0x211232-0x0;var _0x4a1780=_0x5f01[_0x211232];return _0x4a1780;};'use strict';var Sequelize=require(_0x15f0('0x0'));module[_0x15f0('0x1')]={'TeamId':{'type':Sequelize[_0x15f0('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x15f0('0x2')]}}; \ No newline at end of file +var _0x8164=['exports','INTEGER','sequelize'];(function(_0x3c4848,_0xa78bb6){var _0x5f4039=function(_0x49e409){while(--_0x49e409){_0x3c4848['push'](_0x3c4848['shift']());}};_0x5f4039(++_0xa78bb6);}(_0x8164,0x170));var _0x4816=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0x8164[_0x3cd133];return _0x2512c8;};'use strict';var Sequelize=require(_0x4816('0x0'));module[_0x4816('0x1')]={'TeamId':{'type':Sequelize[_0x4816('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 5656ab8..a773609 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 _0x1df7=['rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34d70b,_0x47c4cf){var _0x2cb7d3=function(_0x284ede){while(--_0x284ede){_0x34d70b['push'](_0x34d70b['shift']());}};_0x2cb7d3(++_0x47c4cf);}(_0x1df7,0x6e));var _0x71df=function(_0x39e9b9,_0x1490f9){_0x39e9b9=_0x39e9b9-0x0;var _0x23dd9a=_0x1df7[_0x39e9b9];return _0x23dd9a;};'use strict';var _=require('lodash');var util=require(_0x71df('0x0'));var logger=require(_0x71df('0x1'))(_0x71df('0x2'));var moment=require(_0x71df('0x3'));var BPromise=require(_0x71df('0x4'));var rp=require(_0x71df('0x5'));var fs=require('fs');var path=require(_0x71df('0x6'));var rimraf=require(_0x71df('0x7'));var config=require(_0x71df('0x8'));var attributes=require(_0x71df('0x9'));module[_0x71df('0xa')]=function(_0x4364ea,_0x481a2f){return _0x4364ea[_0x71df('0xb')]('TeamVoicePrefix',attributes,{'tableName':_0x71df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe5=['path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','moment','bluebird','request-promise'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x2fe5,0x14b));var _0x52fe=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2fe5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rp=require(_0x52fe('0x4'));var fs=require('fs');var path=require(_0x52fe('0x5'));var rimraf=require(_0x52fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x7'));module[_0x52fe('0x8')]=function(_0x584af7,_0x2efcaa){return _0x584af7[_0x52fe('0x9')](_0x52fe('0xa'),attributes,{'tableName':_0x52fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index f83776b..f553189 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x117cba,_0x278373){var _0x34629e=function(_0x22c684){while(--_0x22c684){_0x117cba['push'](_0x117cba['shift']());}};_0x34629e(++_0x278373);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x12b532,_0x5582a6){var _0x1dcc33=function(_0x36471b){while(--_0x36471b){_0x12b532['push'](_0x12b532['shift']());}};_0x1dcc33(++_0x5582a6);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c61a6e0..9c6b626 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 _0x0ffd=['exports','INTEGER','sequelize'];(function(_0x16705d,_0x12694e){var _0x56b101=function(_0x1e233a){while(--_0x1e233a){_0x16705d['push'](_0x16705d['shift']());}};_0x56b101(++_0x12694e);}(_0x0ffd,0xa4));var _0xd0ff=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x0ffd[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xd0ff('0x0'));module[_0xd0ff('0x1')]={'penalty':{'type':Sequelize[_0xd0ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e18=['exports'];(function(_0x172b7b,_0x1ea56a){var _0x30e2cb=function(_0x4d2f02){while(--_0x4d2f02){_0x172b7b['push'](_0x172b7b['shift']());}};_0x30e2cb(++_0x1ea56a);}(_0x8e18,0x1ba));var _0x88e1=function(_0x39d13c,_0x49a880){_0x39d13c=_0x39d13c-0x0;var _0xf69c4f=_0x8e18[_0x39d13c];return _0xf69c4f;};'use strict';var Sequelize=require('sequelize');module[_0x88e1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 6ea0a7b..5f8191a 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 _0x8664=['moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x320aec,_0x265e48){var _0x454780=function(_0x177180){while(--_0x177180){_0x320aec['push'](_0x320aec['shift']());}};_0x454780(++_0x265e48);}(_0x8664,0x11a));var _0x4866=function(_0x13310c,_0x1efe01){_0x13310c=_0x13310c-0x0;var _0x149348=_0x8664[_0x13310c];return _0x149348;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var logger=require(_0x4866('0x2'))(_0x4866('0x3'));var moment=require(_0x4866('0x4'));var BPromise=require(_0x4866('0x5'));var rp=require(_0x4866('0x6'));var fs=require('fs');var path=require(_0x4866('0x7'));var rimraf=require(_0x4866('0x8'));var config=require('../../config/environment');var attributes=require(_0x4866('0x9'));module['exports']=function(_0x66b444,_0x3eb6f9){return _0x66b444[_0x4866('0xa')](_0x4866('0xb'),attributes,{'tableName':_0x4866('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1738=['exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','request-promise','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1738,0x1bc));var _0x8173=function(_0x599a76,_0x2274cd){_0x599a76=_0x599a76-0x0;var _0x585753=_0x1738[_0x599a76];return _0x585753;};'use strict';var _=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8173('0x2'));var BPromise=require(_0x8173('0x3'));var rp=require(_0x8173('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8173('0x5'));var attributes=require(_0x8173('0x6'));module[_0x8173('0x7')]=function(_0x3cf9ac,_0x2220fd){return _0x3cf9ac[_0x8173('0x8')](_0x8173('0x9'),attributes,{'tableName':_0x8173('0xa'),'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 74e0155..06df734 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 _0xdab2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x5ba24b,_0x4ae1a5){var _0x39d28c=function(_0x367ef5){while(--_0x367ef5){_0x5ba24b['push'](_0x5ba24b['shift']());}};_0x39d28c(++_0x4ae1a5);}(_0xdab2,0x15c));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var moment=require(_0x2dab('0x2'));var BPromise=require(_0x2dab('0x3'));var rs=require(_0x2dab('0x4'));var fs=require('fs');var Redis=require(_0x2dab('0x5'));var db=require(_0x2dab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dab('0x7'))(_0x2dab('0x8'));var config=require(_0x2dab('0x9'));var jayson=require(_0x2dab('0xa'));var client=jayson[_0x2dab('0xb')][_0x2dab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47deae,_0x5b70fb,_0x54cec5){return new BPromise(function(_0x4cc451,_0x1e06ca){return client['request'](_0x47deae,_0x54cec5)['then'](function(_0x5dad03){logger['info'](_0x2dab('0xd'),_0x5b70fb,_0x2dab('0xe'));logger[_0x2dab('0xf')](_0x2dab('0x10'),_0x5b70fb,_0x2dab('0xe'),JSON[_0x2dab('0x11')](_0x5dad03));if(_0x5dad03[_0x2dab('0x12')]){if(_0x5dad03[_0x2dab('0x12')][_0x2dab('0x13')]===0x1f4){logger['error'](_0x2dab('0xd'),_0x5b70fb,_0x5dad03['error'][_0x2dab('0x14')]);return _0x1e06ca(_0x5dad03[_0x2dab('0x12')]['message']);}logger['error'](_0x2dab('0xd'),_0x5b70fb,_0x5dad03[_0x2dab('0x12')][_0x2dab('0x14')]);return _0x4cc451(_0x5dad03['error'][_0x2dab('0x14')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x5b70fb,'request\x20sent');_0x4cc451(_0x5dad03['result']['message']);}})[_0x2dab('0x15')](function(_0x3c1512){logger[_0x2dab('0x12')](_0x2dab('0xd'),_0x5b70fb,_0x3c1512);_0x1e06ca(_0x3c1512);});});} \ No newline at end of file +var _0xfccd=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x5a85fa,_0x11b386){var _0x5053d2=function(_0x406682){while(--_0x406682){_0x5a85fa['push'](_0x5a85fa['shift']());}};_0x5053d2(++_0x11b386);}(_0xfccd,0xc2));var _0xdfcc=function(_0x4f9baf,_0x17a0a1){_0x4f9baf=_0x4f9baf-0x0;var _0x5dd2dd=_0xfccd[_0x4f9baf];return _0x5dd2dd;};'use strict';var _=require(_0xdfcc('0x0'));var util=require(_0xdfcc('0x1'));var moment=require(_0xdfcc('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfcc('0x3'));var fs=require('fs');var Redis=require(_0xdfcc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfcc('0x5'));var logger=require(_0xdfcc('0x6'))('rpc');var config=require(_0xdfcc('0x7'));var jayson=require(_0xdfcc('0x8'));var client=jayson[_0xdfcc('0x9')][_0xdfcc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be107,_0x4217e9,_0x1668fe){return new BPromise(function(_0x521846,_0x568a99){return client[_0xdfcc('0xb')](_0x1be107,_0x1668fe)[_0xdfcc('0xc')](function(_0x1286f0){logger[_0xdfcc('0xd')](_0xdfcc('0xe'),_0x4217e9,_0xdfcc('0xf'));logger[_0xdfcc('0x10')](_0xdfcc('0x11'),_0x4217e9,_0xdfcc('0xf'),JSON['stringify'](_0x1286f0));if(_0x1286f0['error']){if(_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x13')]===0x1f4){logger[_0xdfcc('0x12')](_0xdfcc('0xe'),_0x4217e9,_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x14')]);return _0x568a99(_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x14')]);}logger[_0xdfcc('0x12')](_0xdfcc('0xe'),_0x4217e9,_0x1286f0[_0xdfcc('0x12')]['message']);return _0x521846(_0x1286f0['error'][_0xdfcc('0x14')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4217e9,_0xdfcc('0xf'));_0x521846(_0x1286f0[_0xdfcc('0x15')][_0xdfcc('0x14')]);}})['catch'](function(_0x4daa65){logger[_0xdfcc('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4217e9,_0x4daa65);_0x568a99(_0x4daa65);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9653d9d..ff26d19 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 _0xca6e=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3cd97d,_0x400ff2){var _0x54ac9a=function(_0x595018){while(--_0x595018){_0x3cd97d['push'](_0x3cd97d['shift']());}};_0x54ac9a(++_0x400ff2);}(_0xca6e,0x1c1));var _0xeca6=function(_0x581f75,_0x3c824b){_0x581f75=_0x581f75-0x0;var _0xf0b13d=_0xca6e[_0x581f75];return _0xf0b13d;};'use strict';var multer=require(_0xeca6('0x0'));var util=require(_0xeca6('0x1'));var path=require(_0xeca6('0x2'));var timeout=require(_0xeca6('0x3'));var express=require(_0xeca6('0x4'));var router=express['Router']();var fs_extra=require(_0xeca6('0x5'));var auth=require(_0xeca6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeca6('0x7'));var controller=require('./template.controller');router[_0xeca6('0x8')]('/',auth[_0xeca6('0x9')](),controller[_0xeca6('0xa')]);router['get'](_0xeca6('0xb'),auth['isAuthenticated'](),controller[_0xeca6('0xc')]);router[_0xeca6('0xd')]('/',auth[_0xeca6('0x9')](),controller[_0xeca6('0xe')]);router[_0xeca6('0xf')]('/:id',auth[_0xeca6('0x9')](),controller[_0xeca6('0x10')]);router[_0xeca6('0x11')](_0xeca6('0xb'),auth[_0xeca6('0x9')](),controller['destroy']);module[_0xeca6('0x12')]=router; \ No newline at end of file +var _0x7880=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer'];(function(_0x42195f,_0xac78a5){var _0x2243a2=function(_0x152be8){while(--_0x152be8){_0x42195f['push'](_0x42195f['shift']());}};_0x2243a2(++_0xac78a5);}(_0x7880,0x10f));var _0x0788=function(_0x56857c,_0x4868cb){_0x56857c=_0x56857c-0x0;var _0x4027e7=_0x7880[_0x56857c];return _0x4027e7;};'use strict';var multer=require(_0x0788('0x0'));var util=require('util');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('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require('./template.controller');router[_0x0788('0x7')]('/',auth[_0x0788('0x8')](),controller[_0x0788('0x9')]);router['get'](_0x0788('0xa'),auth[_0x0788('0x8')](),controller['show']);router[_0x0788('0xb')]('/',auth[_0x0788('0x8')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')](_0x0788('0xa'),auth[_0x0788('0x8')](),controller[_0x0788('0xe')]);router[_0x0788('0xf')](_0x0788('0xa'),auth[_0x0788('0x8')](),controller[_0x0788('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index e61b0db..10ed69a 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 _0x3a80=['sequelize','exports','STRING'];(function(_0x37715d,_0xdb0d52){var _0x2caac8=function(_0x4a18e9){while(--_0x4a18e9){_0x37715d['push'](_0x37715d['shift']());}};_0x2caac8(++_0xdb0d52);}(_0x3a80,0xc6));var _0x03a8=function(_0x3b29f5,_0x1ce972){_0x3b29f5=_0x3b29f5-0x0;var _0x242f98=_0x3a80[_0x3b29f5];return _0x242f98;};'use strict';var Sequelize=require(_0x03a8('0x0'));module[_0x03a8('0x1')]={'name':{'type':Sequelize[_0x03a8('0x2')]},'description':{'type':Sequelize[_0x03a8('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe824=['sequelize','exports','STRING','TEXT'];(function(_0x45c1b5,_0x382aba){var _0x36bf16=function(_0x10f142){while(--_0x10f142){_0x45c1b5['push'](_0x45c1b5['shift']());}};_0x36bf16(++_0x382aba);}(_0xe824,0xa4));var _0x4e82=function(_0x4cfe90,_0x3da8fb){_0x4cfe90=_0x4cfe90-0x0;var _0x13591e=_0xe824[_0x4cfe90];return _0x13591e;};'use strict';var Sequelize=require(_0x4e82('0x0'));module[_0x4e82('0x1')]={'name':{'type':Sequelize[_0x4e82('0x2')]},'description':{'type':Sequelize[_0x4e82('0x2')]},'html':{'type':Sequelize[_0x4e82('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index bd581c1..4a35fe5 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 _0xda43=['limit','count','set','Content-Range','reject','update','then','destroy','get','Templates','UserProfileResource','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','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','undefined'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0xda43,0xdc));var _0x3da4=function(_0x42eee6,_0x35f745){_0x42eee6=_0x42eee6-0x0;var _0x4981dd=_0xda43[_0x42eee6];return _0x4981dd;};'use strict';var emlformat=require(_0x3da4('0x0'));var rimraf=require(_0x3da4('0x1'));var zipdir=require(_0x3da4('0x2'));var jsonpatch=require(_0x3da4('0x3'));var rp=require(_0x3da4('0x4'));var moment=require(_0x3da4('0x5'));var BPromise=require(_0x3da4('0x6'));var Mustache=require(_0x3da4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3da4('0x8'));var csv=require(_0x3da4('0x9'));var ejs=require(_0x3da4('0xa'));var fs=require('fs');var fs_extra=require(_0x3da4('0xb'));var _=require(_0x3da4('0xc'));var squel=require('squel');var crypto=require(_0x3da4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3da4('0xe'));var toCsv=require(_0x3da4('0x9'));var querystring=require(_0x3da4('0xf'));var Papa=require(_0x3da4('0x10'));var Redis=require(_0x3da4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3da4('0x12'));var as=require(_0x3da4('0x13'));var hardwareService=require(_0x3da4('0x14'));var logger=require(_0x3da4('0x15'))(_0x3da4('0x16'));var utils=require(_0x3da4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3da4('0x18'));var db=require(_0x3da4('0x19'))['db'];function respondWithStatusCode(_0x23a768,_0x1b3b67){_0x1b3b67=_0x1b3b67||0xcc;return function(_0x1f5f41){if(_0x1f5f41){return _0x23a768[_0x3da4('0x1a')](_0x1b3b67);}return _0x23a768[_0x3da4('0x1b')](_0x1b3b67)[_0x3da4('0x1c')]();};}function respondWithResult(_0x10d3e6,_0xdd5308){_0xdd5308=_0xdd5308||0xc8;return function(_0x298278){if(_0x298278){return _0x10d3e6[_0x3da4('0x1b')](_0xdd5308)[_0x3da4('0x1d')](_0x298278);}};}function respondWithFilteredResult(_0x256dac,_0x497f11){return function(_0xe6996b){if(_0xe6996b){var _0x42c00f=typeof _0x497f11[_0x3da4('0x1e')]===_0x3da4('0x1f')&&typeof _0x497f11[_0x3da4('0x20')]==='undefined';var _0x1516eb=_0xe6996b[_0x3da4('0x21')];var _0x459a65=_0x42c00f?0x0:_0x497f11[_0x3da4('0x1e')];var _0x2a1bfe=_0x42c00f?_0xe6996b[_0x3da4('0x21')]:_0x497f11[_0x3da4('0x1e')]+_0x497f11[_0x3da4('0x20')];var _0x32ccb0;if(_0x2a1bfe>=_0x1516eb){_0x2a1bfe=_0x1516eb;_0x32ccb0=0xc8;}else{_0x32ccb0=0xce;}_0x256dac[_0x3da4('0x1b')](_0x32ccb0);return _0x256dac[_0x3da4('0x22')](_0x3da4('0x23'),_0x459a65+'-'+_0x2a1bfe+'/'+_0x1516eb)['json'](_0xe6996b);}return null;};}function patchUpdates(_0x5f0314){return function(_0x4b839e){try{jsonpatch['apply'](_0x4b839e,_0x5f0314,!![]);}catch(_0xd95537){return BPromise[_0x3da4('0x24')](_0xd95537);}return _0x4b839e['save']();};}function saveUpdates(_0x1917dc,_0x126394){return function(_0x4e26e3){if(_0x4e26e3){return _0x4e26e3[_0x3da4('0x25')](_0x1917dc)[_0x3da4('0x26')](function(_0x124991){return _0x124991;});}return null;};}function removeEntity(_0x498593,_0x2a8a33){return function(_0x55d7b9){if(_0x55d7b9){return _0x55d7b9[_0x3da4('0x27')]()[_0x3da4('0x26')](function(){var _0x47fddf=_0x55d7b9[_0x3da4('0x28')]({'plain':!![]});var _0x212230=_0x3da4('0x29');return db[_0x3da4('0x2a')][_0x3da4('0x27')]({'where':{'type':_0x212230,'resourceId':_0x47fddf['id']}})[_0x3da4('0x26')](function(){return _0x55d7b9;});})[_0x3da4('0x26')](function(){_0x498593['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x96db34,_0x406dd3){return function(_0x51e942){if(!_0x51e942){_0x96db34[_0x3da4('0x1a')](0x194);}return _0x51e942;};}function handleError(_0x13fd7e,_0x1df792){_0x1df792=_0x1df792||0x1f4;return function(_0x361872){logger['error'](_0x361872['stack']);if(_0x361872[_0x3da4('0x2b')]){delete _0x361872[_0x3da4('0x2b')];}_0x13fd7e['status'](_0x1df792)[_0x3da4('0x2c')](_0x361872);};}exports[_0x3da4('0x2d')]=function(_0x5d2a17,_0x3c0527){var _0x1a62bb={},_0x47e143={},_0x4ccb41={'count':0x0,'rows':[]};var _0x1bc4ec=_['map'](db['Template'][_0x3da4('0x2e')],function(_0x22da8b){return{'name':_0x22da8b[_0x3da4('0x2f')],'type':_0x22da8b[_0x3da4('0x30')]['key']};});_0x47e143['model']=_[_0x3da4('0x31')](_0x1bc4ec,_0x3da4('0x2b'));_0x47e143[_0x3da4('0x32')]=_[_0x3da4('0x33')](_0x5d2a17[_0x3da4('0x32')]);_0x47e143[_0x3da4('0x34')]=_[_0x3da4('0x35')](_0x47e143[_0x3da4('0x36')],_0x47e143[_0x3da4('0x32')]);_0x1a62bb[_0x3da4('0x37')]=_[_0x3da4('0x35')](_0x47e143[_0x3da4('0x36')],qs[_0x3da4('0x38')](_0x5d2a17[_0x3da4('0x32')]['fields']));_0x1a62bb[_0x3da4('0x37')]=_0x1a62bb['attributes'][_0x3da4('0x39')]?_0x1a62bb[_0x3da4('0x37')]:_0x47e143[_0x3da4('0x36')];if(!_0x5d2a17['query'][_0x3da4('0x3a')](_0x3da4('0x3b'))){_0x1a62bb[_0x3da4('0x20')]=qs[_0x3da4('0x20')](_0x5d2a17[_0x3da4('0x32')][_0x3da4('0x20')]);_0x1a62bb['offset']=qs['offset'](_0x5d2a17[_0x3da4('0x32')][_0x3da4('0x1e')]);}_0x1a62bb[_0x3da4('0x3c')]=qs[_0x3da4('0x3d')](_0x5d2a17['query'][_0x3da4('0x3d')]);_0x1a62bb[_0x3da4('0x3e')]=qs[_0x3da4('0x34')](_[_0x3da4('0x3f')](_0x5d2a17[_0x3da4('0x32')],_0x47e143[_0x3da4('0x34')]),_0x1bc4ec);if(_0x5d2a17[_0x3da4('0x32')][_0x3da4('0x40')]){_0x1a62bb[_0x3da4('0x3e')]=_[_0x3da4('0x41')](_0x1a62bb[_0x3da4('0x3e')],{'$or':_[_0x3da4('0x31')](_0x1bc4ec,function(_0x51b751){if(_0x51b751['type']!==_0x3da4('0x42')){var _0x5c433b={};_0x5c433b[_0x51b751[_0x3da4('0x2b')]]={'$like':'%'+_0x5d2a17['query']['filter']+'%'};return _0x5c433b;}})});}_0x1a62bb=_[_0x3da4('0x41')]({},_0x1a62bb,_0x5d2a17[_0x3da4('0x43')]);var _0xe26b4={'where':_0x1a62bb[_0x3da4('0x3e')]};return db[_0x3da4('0x44')][_0x3da4('0x21')](_0xe26b4)['then'](function(_0x481c90){_0x4ccb41[_0x3da4('0x21')]=_0x481c90;if(_0x5d2a17[_0x3da4('0x32')][_0x3da4('0x45')]){_0x1a62bb[_0x3da4('0x46')]=[{'all':!![]}];}return db[_0x3da4('0x44')][_0x3da4('0x47')](_0x1a62bb);})[_0x3da4('0x26')](function(_0x3ea430){_0x4ccb41[_0x3da4('0x48')]=_0x3ea430;return _0x4ccb41;})[_0x3da4('0x26')](respondWithFilteredResult(_0x3c0527,_0x1a62bb))[_0x3da4('0x49')](handleError(_0x3c0527,null));};exports[_0x3da4('0x4a')]=function(_0x3902aa,_0x4f7802){var _0x5479a1={'raw':!![],'where':{'id':_0x3902aa['params']['id']}},_0x53bb53={};_0x53bb53[_0x3da4('0x36')]=_[_0x3da4('0x33')](db[_0x3da4('0x44')][_0x3da4('0x2e')]);_0x53bb53['query']=_[_0x3da4('0x33')](_0x3902aa[_0x3da4('0x32')]);_0x53bb53[_0x3da4('0x34')]=_[_0x3da4('0x35')](_0x53bb53[_0x3da4('0x36')],_0x53bb53[_0x3da4('0x32')]);_0x5479a1[_0x3da4('0x37')]=_[_0x3da4('0x35')](_0x53bb53['model'],qs[_0x3da4('0x38')](_0x3902aa[_0x3da4('0x32')][_0x3da4('0x38')]));_0x5479a1[_0x3da4('0x37')]=_0x5479a1[_0x3da4('0x37')][_0x3da4('0x39')]?_0x5479a1[_0x3da4('0x37')]:_0x53bb53['model'];if(_0x3902aa['query'][_0x3da4('0x45')]){_0x5479a1[_0x3da4('0x46')]=[{'all':!![]}];}_0x5479a1=_[_0x3da4('0x41')]({},_0x5479a1,_0x3902aa['options']);return db[_0x3da4('0x44')][_0x3da4('0x4b')](_0x5479a1)[_0x3da4('0x26')](handleEntityNotFound(_0x4f7802,null))['then'](respondWithResult(_0x4f7802,null))[_0x3da4('0x49')](handleError(_0x4f7802,null));};exports['create']=function(_0x3ac945,_0x5e1511){return db['Template'][_0x3da4('0x4c')](_0x3ac945[_0x3da4('0x4d')],{})['then'](function(_0x506739){var _0x36d92c=_0x3ac945['user'][_0x3da4('0x28')]({'plain':!![]});if(!_0x36d92c)throw new Error(_0x3da4('0x4e'));if(_0x36d92c['role']===_0x3da4('0x4f')){var _0x5544f9=_0x506739[_0x3da4('0x28')]({'plain':!![]});var _0x395c9c=_0x3da4('0x29');return db[_0x3da4('0x50')]['find']({'where':{'name':_0x395c9c,'userProfileId':_0x36d92c['userProfileId']},'raw':!![]})[_0x3da4('0x26')](function(_0x56c6bf){if(_0x56c6bf&&_0x56c6bf['autoAssociation']===0x0){return db[_0x3da4('0x2a')][_0x3da4('0x4c')]({'name':_0x5544f9[_0x3da4('0x2b')],'resourceId':_0x5544f9['id'],'type':_0x56c6bf[_0x3da4('0x2b')],'sectionId':_0x56c6bf['id']},{})[_0x3da4('0x26')](function(){return _0x506739;});}else{return _0x506739;}})[_0x3da4('0x49')](function(_0x571569){logger[_0x3da4('0x51')](_0x3da4('0x52'),_0x571569);throw _0x571569;});}return _0x506739;})['then'](respondWithResult(_0x5e1511,0xc9))['catch'](handleError(_0x5e1511,null));};exports['update']=function(_0x25c569,_0x40af76){if(_0x25c569[_0x3da4('0x4d')]['id']){delete _0x25c569[_0x3da4('0x4d')]['id'];}return db[_0x3da4('0x44')][_0x3da4('0x4b')]({'where':{'id':_0x25c569[_0x3da4('0x53')]['id']}})[_0x3da4('0x26')](handleEntityNotFound(_0x40af76,null))['then'](saveUpdates(_0x25c569['body'],null))['then'](respondWithResult(_0x40af76,null))[_0x3da4('0x49')](handleError(_0x40af76,null));};exports[_0x3da4('0x27')]=function(_0xcf02fa,_0x2b1707){return db['Template'][_0x3da4('0x4b')]({'where':{'id':_0xcf02fa[_0x3da4('0x53')]['id']}})[_0x3da4('0x26')](handleEntityNotFound(_0x2b1707,null))[_0x3da4('0x26')](removeEntity(_0x2b1707,null))[_0x3da4('0x49')](handleError(_0x2b1707,null));}; \ No newline at end of file +var _0xffee=['apply','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xffee,0x178));var _0xeffe=function(_0x45d496,_0x38600e){_0x45d496=_0x45d496-0x0;var _0x179479=_0xffee[_0x45d496];return _0x179479;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeffe('0x0'));var zipdir=require(_0xeffe('0x1'));var jsonpatch=require(_0xeffe('0x2'));var rp=require(_0xeffe('0x3'));var moment=require(_0xeffe('0x4'));var BPromise=require(_0xeffe('0x5'));var Mustache=require(_0xeffe('0x6'));var util=require(_0xeffe('0x7'));var path=require(_0xeffe('0x8'));var sox=require(_0xeffe('0x9'));var csv=require(_0xeffe('0xa'));var ejs=require(_0xeffe('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeffe('0xc'));var squel=require('squel');var crypto=require(_0xeffe('0xd'));var jsforce=require(_0xeffe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xeffe('0xa'));var querystring=require(_0xeffe('0xf'));var Papa=require(_0xeffe('0x10'));var Redis=require(_0xeffe('0x11'));var authService=require(_0xeffe('0x12'));var qs=require(_0xeffe('0x13'));var as=require(_0xeffe('0x14'));var hardwareService=require(_0xeffe('0x15'));var logger=require(_0xeffe('0x16'))(_0xeffe('0x17'));var utils=require(_0xeffe('0x18'));var config=require(_0xeffe('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xeffe('0x1a'))['db'];function respondWithStatusCode(_0x4595e2,_0x2bbf4d){_0x2bbf4d=_0x2bbf4d||0xcc;return function(_0x4ac15e){if(_0x4ac15e){return _0x4595e2['sendStatus'](_0x2bbf4d);}return _0x4595e2[_0xeffe('0x1b')](_0x2bbf4d)['end']();};}function respondWithResult(_0x517839,_0x50a831){_0x50a831=_0x50a831||0xc8;return function(_0x5de9f2){if(_0x5de9f2){return _0x517839['status'](_0x50a831)[_0xeffe('0x1c')](_0x5de9f2);}};}function respondWithFilteredResult(_0x1dcb4f,_0x17b8de){return function(_0x5a21a3){if(_0x5a21a3){var _0x2e5c07=typeof _0x17b8de['offset']===_0xeffe('0x1d')&&typeof _0x17b8de['limit']===_0xeffe('0x1d');var _0x9aef79=_0x5a21a3[_0xeffe('0x1e')];var _0x282242=_0x2e5c07?0x0:_0x17b8de[_0xeffe('0x1f')];var _0x51f536=_0x2e5c07?_0x5a21a3[_0xeffe('0x1e')]:_0x17b8de[_0xeffe('0x1f')]+_0x17b8de[_0xeffe('0x20')];var _0x4d96af;if(_0x51f536>=_0x9aef79){_0x51f536=_0x9aef79;_0x4d96af=0xc8;}else{_0x4d96af=0xce;}_0x1dcb4f[_0xeffe('0x1b')](_0x4d96af);return _0x1dcb4f[_0xeffe('0x21')]('Content-Range',_0x282242+'-'+_0x51f536+'/'+_0x9aef79)[_0xeffe('0x1c')](_0x5a21a3);}return null;};}function patchUpdates(_0x5c2839){return function(_0x2ec2da){try{jsonpatch[_0xeffe('0x22')](_0x2ec2da,_0x5c2839,!![]);}catch(_0x2790a2){return BPromise['reject'](_0x2790a2);}return _0x2ec2da[_0xeffe('0x23')]();};}function saveUpdates(_0x131954,_0x123ed6){return function(_0x4455ec){if(_0x4455ec){return _0x4455ec[_0xeffe('0x24')](_0x131954)['then'](function(_0x278e10){return _0x278e10;});}return null;};}function removeEntity(_0x508909,_0x4c8a00){return function(_0x5274f4){if(_0x5274f4){return _0x5274f4[_0xeffe('0x25')]()[_0xeffe('0x26')](function(){var _0x34c18a=_0x5274f4[_0xeffe('0x27')]({'plain':!![]});var _0x1a1bec=_0xeffe('0x28');return db[_0xeffe('0x29')]['destroy']({'where':{'type':_0x1a1bec,'resourceId':_0x34c18a['id']}})[_0xeffe('0x26')](function(){return _0x5274f4;});})[_0xeffe('0x26')](function(){_0x508909['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c369f,_0x239a8c){return function(_0x356ee4){if(!_0x356ee4){_0x2c369f['sendStatus'](0x194);}return _0x356ee4;};}function handleError(_0x1e6de0,_0xd93f44){_0xd93f44=_0xd93f44||0x1f4;return function(_0x4c1d52){logger[_0xeffe('0x2a')](_0x4c1d52[_0xeffe('0x2b')]);if(_0x4c1d52['name']){delete _0x4c1d52[_0xeffe('0x2c')];}_0x1e6de0['status'](_0xd93f44)[_0xeffe('0x2d')](_0x4c1d52);};}exports[_0xeffe('0x2e')]=function(_0x34811e,_0x31271c){var _0x41d3e6={},_0x35c4e4={},_0x2e0f12={'count':0x0,'rows':[]};var _0x23ef28=_[_0xeffe('0x2f')](db[_0xeffe('0x30')][_0xeffe('0x31')],function(_0x59287e){return{'name':_0x59287e[_0xeffe('0x32')],'type':_0x59287e[_0xeffe('0x33')][_0xeffe('0x34')]};});_0x35c4e4[_0xeffe('0x35')]=_[_0xeffe('0x2f')](_0x23ef28,'name');_0x35c4e4[_0xeffe('0x36')]=_[_0xeffe('0x37')](_0x34811e[_0xeffe('0x36')]);_0x35c4e4[_0xeffe('0x38')]=_['intersection'](_0x35c4e4[_0xeffe('0x35')],_0x35c4e4[_0xeffe('0x36')]);_0x41d3e6[_0xeffe('0x39')]=_[_0xeffe('0x3a')](_0x35c4e4[_0xeffe('0x35')],qs[_0xeffe('0x3b')](_0x34811e[_0xeffe('0x36')][_0xeffe('0x3b')]));_0x41d3e6['attributes']=_0x41d3e6[_0xeffe('0x39')][_0xeffe('0x3c')]?_0x41d3e6[_0xeffe('0x39')]:_0x35c4e4['model'];if(!_0x34811e[_0xeffe('0x36')][_0xeffe('0x3d')](_0xeffe('0x3e'))){_0x41d3e6['limit']=qs['limit'](_0x34811e[_0xeffe('0x36')]['limit']);_0x41d3e6[_0xeffe('0x1f')]=qs[_0xeffe('0x1f')](_0x34811e['query'][_0xeffe('0x1f')]);}_0x41d3e6[_0xeffe('0x3f')]=qs[_0xeffe('0x40')](_0x34811e[_0xeffe('0x36')][_0xeffe('0x40')]);_0x41d3e6[_0xeffe('0x41')]=qs[_0xeffe('0x38')](_[_0xeffe('0x42')](_0x34811e[_0xeffe('0x36')],_0x35c4e4[_0xeffe('0x38')]),_0x23ef28);if(_0x34811e[_0xeffe('0x36')][_0xeffe('0x43')]){_0x41d3e6[_0xeffe('0x41')]=_['merge'](_0x41d3e6[_0xeffe('0x41')],{'$or':_[_0xeffe('0x2f')](_0x23ef28,function(_0x4a7df0){if(_0x4a7df0[_0xeffe('0x33')]!=='VIRTUAL'){var _0x1c3773={};_0x1c3773[_0x4a7df0[_0xeffe('0x2c')]]={'$like':'%'+_0x34811e[_0xeffe('0x36')][_0xeffe('0x43')]+'%'};return _0x1c3773;}})});}_0x41d3e6=_[_0xeffe('0x44')]({},_0x41d3e6,_0x34811e[_0xeffe('0x45')]);var _0x292cec={'where':_0x41d3e6[_0xeffe('0x41')]};return db[_0xeffe('0x30')][_0xeffe('0x1e')](_0x292cec)[_0xeffe('0x26')](function(_0x574f92){_0x2e0f12[_0xeffe('0x1e')]=_0x574f92;if(_0x34811e[_0xeffe('0x36')][_0xeffe('0x46')]){_0x41d3e6[_0xeffe('0x47')]=[{'all':!![]}];}return db[_0xeffe('0x30')]['findAll'](_0x41d3e6);})[_0xeffe('0x26')](function(_0x3a5f41){_0x2e0f12['rows']=_0x3a5f41;return _0x2e0f12;})['then'](respondWithFilteredResult(_0x31271c,_0x41d3e6))[_0xeffe('0x48')](handleError(_0x31271c,null));};exports[_0xeffe('0x49')]=function(_0x45a7e0,_0x7dfbe2){var _0xec64e7={'raw':!![],'where':{'id':_0x45a7e0['params']['id']}},_0x59ac36={};_0x59ac36[_0xeffe('0x35')]=_[_0xeffe('0x37')](db['Template']['rawAttributes']);_0x59ac36[_0xeffe('0x36')]=_[_0xeffe('0x37')](_0x45a7e0[_0xeffe('0x36')]);_0x59ac36[_0xeffe('0x38')]=_[_0xeffe('0x3a')](_0x59ac36[_0xeffe('0x35')],_0x59ac36[_0xeffe('0x36')]);_0xec64e7[_0xeffe('0x39')]=_[_0xeffe('0x3a')](_0x59ac36[_0xeffe('0x35')],qs['fields'](_0x45a7e0['query'][_0xeffe('0x3b')]));_0xec64e7[_0xeffe('0x39')]=_0xec64e7[_0xeffe('0x39')][_0xeffe('0x3c')]?_0xec64e7['attributes']:_0x59ac36[_0xeffe('0x35')];if(_0x45a7e0[_0xeffe('0x36')][_0xeffe('0x46')]){_0xec64e7[_0xeffe('0x47')]=[{'all':!![]}];}_0xec64e7=_[_0xeffe('0x44')]({},_0xec64e7,_0x45a7e0['options']);return db[_0xeffe('0x30')]['find'](_0xec64e7)['then'](handleEntityNotFound(_0x7dfbe2,null))[_0xeffe('0x26')](respondWithResult(_0x7dfbe2,null))[_0xeffe('0x48')](handleError(_0x7dfbe2,null));};exports[_0xeffe('0x4a')]=function(_0x398275,_0xc526d1){return db[_0xeffe('0x30')]['create'](_0x398275[_0xeffe('0x4b')],{})[_0xeffe('0x26')](function(_0x5cb3df){var _0x2c53b3=_0x398275['user']['get']({'plain':!![]});if(!_0x2c53b3)throw new Error(_0xeffe('0x4c'));if(_0x2c53b3['role']===_0xeffe('0x4d')){var _0x37fa45=_0x5cb3df['get']({'plain':!![]});var _0x585a8a=_0xeffe('0x28');return db['UserProfileSection'][_0xeffe('0x4e')]({'where':{'name':_0x585a8a,'userProfileId':_0x2c53b3['userProfileId']},'raw':!![]})[_0xeffe('0x26')](function(_0x2a05c9){if(_0x2a05c9&&_0x2a05c9[_0xeffe('0x4f')]===0x0){return db['UserProfileResource'][_0xeffe('0x4a')]({'name':_0x37fa45['name'],'resourceId':_0x37fa45['id'],'type':_0x2a05c9[_0xeffe('0x2c')],'sectionId':_0x2a05c9['id']},{})[_0xeffe('0x26')](function(){return _0x5cb3df;});}else{return _0x5cb3df;}})[_0xeffe('0x48')](function(_0x2bc5bd){logger[_0xeffe('0x2a')](_0xeffe('0x50'),_0x2bc5bd);throw _0x2bc5bd;});}return _0x5cb3df;})['then'](respondWithResult(_0xc526d1,0xc9))[_0xeffe('0x48')](handleError(_0xc526d1,null));};exports[_0xeffe('0x24')]=function(_0x4e084b,_0x31c3de){if(_0x4e084b[_0xeffe('0x4b')]['id']){delete _0x4e084b['body']['id'];}return db[_0xeffe('0x30')]['find']({'where':{'id':_0x4e084b[_0xeffe('0x51')]['id']}})[_0xeffe('0x26')](handleEntityNotFound(_0x31c3de,null))['then'](saveUpdates(_0x4e084b[_0xeffe('0x4b')],null))[_0xeffe('0x26')](respondWithResult(_0x31c3de,null))[_0xeffe('0x48')](handleError(_0x31c3de,null));};exports[_0xeffe('0x25')]=function(_0x1efcad,_0x382070){return db['Template'][_0xeffe('0x4e')]({'where':{'id':_0x1efcad[_0xeffe('0x51')]['id']}})[_0xeffe('0x26')](handleEntityNotFound(_0x382070,null))['then'](removeEntity(_0x382070,null))[_0xeffe('0x48')](handleError(_0x382070,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 73c96fb..ab2ca87 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 _0x8fa3=['util','../../config/logger','moment','bluebird','request-promise','path','./template.attributes','exports','Template','tools_templates','lodash'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x8fa3,0x128));var _0x38fa=function(_0xec7ea,_0xc94414){_0xec7ea=_0xec7ea-0x0;var _0x4af2dd=_0x8fa3[_0xec7ea];return _0x4af2dd;};'use strict';var _=require(_0x38fa('0x0'));var util=require(_0x38fa('0x1'));var logger=require(_0x38fa('0x2'))('api');var moment=require(_0x38fa('0x3'));var BPromise=require(_0x38fa('0x4'));var rp=require(_0x38fa('0x5'));var fs=require('fs');var path=require(_0x38fa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x38fa('0x7'));module[_0x38fa('0x8')]=function(_0x18c50b,_0x5cdceb){return _0x18c50b['define'](_0x38fa('0x9'),attributes,{'tableName':_0x38fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d0b=['define','Template','tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x322b80,_0x22185f){var _0x371f7c=function(_0x2608df){while(--_0x2608df){_0x322b80['push'](_0x322b80['shift']());}};_0x371f7c(++_0x22185f);}(_0x0d0b,0x8f));var _0xb0d0=function(_0x120929,_0xb02eab){_0x120929=_0x120929-0x0;var _0x11af74=_0x0d0b[_0x120929];return _0x11af74;};'use strict';var _=require('lodash');var util=require(_0xb0d0('0x0'));var logger=require(_0xb0d0('0x1'))(_0xb0d0('0x2'));var moment=require(_0xb0d0('0x3'));var BPromise=require(_0xb0d0('0x4'));var rp=require(_0xb0d0('0x5'));var fs=require('fs');var path=require(_0xb0d0('0x6'));var rimraf=require(_0xb0d0('0x7'));var config=require(_0xb0d0('0x8'));var attributes=require(_0xb0d0('0x9'));module[_0xb0d0('0xa')]=function(_0xcd7245,_0x598af8){return _0xcd7245[_0xb0d0('0xb')](_0xb0d0('0xc'),attributes,{'tableName':_0xb0d0('0xd'),'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 7cee2aa..08c1403 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 _0x9f98=['result','catch','GetTemplate','Template','findAll','options','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x2dba07,_0x169ba0){var _0x1ca3dd=function(_0x547ff6){while(--_0x547ff6){_0x2dba07['push'](_0x2dba07['shift']());}};_0x1ca3dd(++_0x169ba0);}(_0x9f98,0xac));var _0x89f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9f98[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x89f9('0x0'));var util=require(_0x89f9('0x1'));var moment=require(_0x89f9('0x2'));var BPromise=require(_0x89f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89f9('0x4'));var db=require(_0x89f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89f9('0x6'))(_0x89f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x89f9('0x8'));var client=jayson[_0x89f9('0x9')][_0x89f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x150d1b,_0x3bce01,_0x18dc85){return new BPromise(function(_0x401975,_0x57cab8){return client['request'](_0x150d1b,_0x18dc85)[_0x89f9('0xb')](function(_0xac5126){logger['info'](_0x89f9('0xc'),_0x3bce01,_0x89f9('0xd'));logger[_0x89f9('0xe')](_0x89f9('0xf'),_0x3bce01,_0x89f9('0xd'),JSON['stringify'](_0xac5126));if(_0xac5126[_0x89f9('0x10')]){if(_0xac5126[_0x89f9('0x10')][_0x89f9('0x11')]===0x1f4){logger[_0x89f9('0x10')](_0x89f9('0xc'),_0x3bce01,_0xac5126[_0x89f9('0x10')][_0x89f9('0x12')]);return _0x57cab8(_0xac5126[_0x89f9('0x10')][_0x89f9('0x12')]);}logger[_0x89f9('0x10')](_0x89f9('0xc'),_0x3bce01,_0xac5126['error'][_0x89f9('0x12')]);return _0x401975(_0xac5126[_0x89f9('0x10')][_0x89f9('0x12')]);}else{logger[_0x89f9('0x13')](_0x89f9('0xc'),_0x3bce01,_0x89f9('0xd'));_0x401975(_0xac5126[_0x89f9('0x14')][_0x89f9('0x12')]);}})[_0x89f9('0x15')](function(_0x423cee){logger[_0x89f9('0x10')](_0x89f9('0xc'),_0x3bce01,_0x423cee);_0x57cab8(_0x423cee);});});}exports[_0x89f9('0x16')]=function(_0x5e5c89){var _0x232aee=this;return new Promise(function(_0x5a31ee,_0x3fdc3){return db[_0x89f9('0x17')][_0x89f9('0x18')]({'raw':_0x5e5c89['options']?_0x5e5c89[_0x89f9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5e5c89['options']?_0x5e5c89[_0x89f9('0x19')]['where']||null:null,'attributes':_0x5e5c89[_0x89f9('0x19')]?_0x5e5c89[_0x89f9('0x19')][_0x89f9('0x1a')]||null:null,'limit':_0x5e5c89[_0x89f9('0x19')]?_0x5e5c89[_0x89f9('0x19')][_0x89f9('0x1b')]||null:null,'include':_0x5e5c89['options']?_0x5e5c89[_0x89f9('0x19')]['include']?_['map'](_0x5e5c89[_0x89f9('0x19')][_0x89f9('0x1c')],function(_0x4bfd3c){return{'model':db[_0x4bfd3c[_0x89f9('0x1d')]],'as':_0x4bfd3c['as'],'attributes':_0x4bfd3c[_0x89f9('0x1a')],'include':_0x4bfd3c[_0x89f9('0x1c')]?_[_0x89f9('0x1e')](_0x4bfd3c['include'],function(_0x168ee0){return{'model':db[_0x168ee0[_0x89f9('0x1d')]],'as':_0x168ee0['as'],'attributes':_0x168ee0[_0x89f9('0x1a')],'include':_0x168ee0['include']?_['map'](_0x168ee0[_0x89f9('0x1c')],function(_0x3346cc){return{'model':db[_0x3346cc['model']],'as':_0x3346cc['as'],'attributes':_0x3346cc[_0x89f9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x89f9('0xb')](function(_0x3f5be1){logger['info'](_0x89f9('0x16'),_0x5e5c89);logger[_0x89f9('0xe')](_0x89f9('0x16'),_0x5e5c89,JSON[_0x89f9('0x1f')](_0x3f5be1));_0x5a31ee(_0x3f5be1);})[_0x89f9('0x15')](function(_0x271663){logger[_0x89f9('0x10')](_0x89f9('0x16'),_0x271663['message'],_0x5e5c89);_0x3fdc3(_0x232aee['error'](0x1f4,_0x271663[_0x89f9('0x12')]));});});}; \ No newline at end of file +var _0x8dfe=['options','include','attributes','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x8dfe,0x65));var _0xe8df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8dfe[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var moment=require(_0xe8df('0x2'));var BPromise=require(_0xe8df('0x3'));var rs=require(_0xe8df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8df('0x5'))['db'];var utils=require(_0xe8df('0x6'));var logger=require('../../config/logger')(_0xe8df('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8df('0x8'));var client=jayson[_0xe8df('0x9')][_0xe8df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22991e,_0x2ebb51,_0xb44c97){return new BPromise(function(_0xe32ea6,_0x4ae9b3){return client[_0xe8df('0xb')](_0x22991e,_0xb44c97)[_0xe8df('0xc')](function(_0x46291d){logger[_0xe8df('0xd')](_0xe8df('0xe'),_0x2ebb51,'request\x20sent');logger[_0xe8df('0xf')](_0xe8df('0x10'),_0x2ebb51,_0xe8df('0x11'),JSON[_0xe8df('0x12')](_0x46291d));if(_0x46291d['error']){if(_0x46291d[_0xe8df('0x13')][_0xe8df('0x14')]===0x1f4){logger[_0xe8df('0x13')]('Template,\x20%s,\x20%s',_0x2ebb51,_0x46291d['error'][_0xe8df('0x15')]);return _0x4ae9b3(_0x46291d[_0xe8df('0x13')]['message']);}logger[_0xe8df('0x13')](_0xe8df('0xe'),_0x2ebb51,_0x46291d[_0xe8df('0x13')]['message']);return _0xe32ea6(_0x46291d[_0xe8df('0x13')][_0xe8df('0x15')]);}else{logger[_0xe8df('0xd')]('Template,\x20%s,\x20%s',_0x2ebb51,_0xe8df('0x11'));_0xe32ea6(_0x46291d[_0xe8df('0x16')][_0xe8df('0x15')]);}})[_0xe8df('0x17')](function(_0x3b68d3){logger[_0xe8df('0x13')]('Template,\x20%s,\x20%s',_0x2ebb51,_0x3b68d3);_0x4ae9b3(_0x3b68d3);});});}exports[_0xe8df('0x18')]=function(_0x71982c){var _0x33b93f=this;return new Promise(function(_0x1cc6b7,_0x2c8961){return db[_0xe8df('0x19')][_0xe8df('0x1a')]({'raw':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')]['where']||null:null,'attributes':_0x71982c[_0xe8df('0x1b')]?_0x71982c['options']['attributes']||null:null,'limit':_0x71982c['options']?_0x71982c[_0xe8df('0x1b')]['limit']||null:null,'include':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')][_0xe8df('0x1c')]?_['map'](_0x71982c[_0xe8df('0x1b')][_0xe8df('0x1c')],function(_0xfe8277){return{'model':db[_0xfe8277['model']],'as':_0xfe8277['as'],'attributes':_0xfe8277[_0xe8df('0x1d')],'include':_0xfe8277[_0xe8df('0x1c')]?_[_0xe8df('0x1e')](_0xfe8277[_0xe8df('0x1c')],function(_0x51c637){return{'model':db[_0x51c637[_0xe8df('0x1f')]],'as':_0x51c637['as'],'attributes':_0x51c637['attributes'],'include':_0x51c637[_0xe8df('0x1c')]?_[_0xe8df('0x1e')](_0x51c637[_0xe8df('0x1c')],function(_0x142d89){return{'model':db[_0x142d89[_0xe8df('0x1f')]],'as':_0x142d89['as'],'attributes':_0x142d89['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8df('0xc')](function(_0x1978e8){logger[_0xe8df('0xd')](_0xe8df('0x18'),_0x71982c);logger['debug'](_0xe8df('0x18'),_0x71982c,JSON['stringify'](_0x1978e8));_0x1cc6b7(_0x1978e8);})['catch'](function(_0x26f8be){logger['error']('GetTemplate',_0x26f8be[_0xe8df('0x15')],_0x71982c);_0x2c8961(_0x33b93f[_0xe8df('0x13')](0x1f4,_0x26f8be[_0xe8df('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index edb4f68..887507b 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 _0xb1ba=['delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','update'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xb1ba,0x152));var _0xab1b=function(_0x34546e,_0x4260d6){_0x34546e=_0x34546e-0x0;var _0x595e5c=_0xb1ba[_0x34546e];return _0x595e5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab1b('0x0'));var timeout=require(_0xab1b('0x1'));var express=require(_0xab1b('0x2'));var router=express[_0xab1b('0x3')]();var fs_extra=require(_0xab1b('0x4'));var auth=require(_0xab1b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab1b('0x6'));router['get']('/',auth[_0xab1b('0x7')](),controller[_0xab1b('0x8')]);router[_0xab1b('0x9')](_0xab1b('0xa'),auth[_0xab1b('0x7')](),controller[_0xab1b('0xb')]);router['get'](_0xab1b('0xc'),auth[_0xab1b('0x7')](),controller['getAllConditions']);router[_0xab1b('0x9')](_0xab1b('0xd'),auth[_0xab1b('0x7')](),controller[_0xab1b('0xe')]);router['get'](_0xab1b('0xf'),auth['isAuthenticated'](),controller[_0xab1b('0x10')]);router[_0xab1b('0x11')]('/',auth[_0xab1b('0x7')](),controller[_0xab1b('0x12')]);router[_0xab1b('0x11')]('/:id/all_conditions',auth[_0xab1b('0x7')](),controller['addAllCondition']);router[_0xab1b('0x11')](_0xab1b('0xd'),auth['isAuthenticated'](),controller[_0xab1b('0x13')]);router[_0xab1b('0x11')](_0xab1b('0xf'),auth[_0xab1b('0x7')](),controller[_0xab1b('0x14')]);router['put'](_0xab1b('0xa'),auth[_0xab1b('0x7')](),controller[_0xab1b('0x15')]);router[_0xab1b('0x16')](_0xab1b('0xa'),auth[_0xab1b('0x7')](),controller['destroy']);module[_0xab1b('0x17')]=router; \ No newline at end of file +var _0x1159=['/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions'];(function(_0x4e6ed0,_0xb3182){var _0x8b5d6=function(_0x334942){while(--_0x334942){_0x4e6ed0['push'](_0x4e6ed0['shift']());}};_0x8b5d6(++_0xb3182);}(_0x1159,0x119));var _0x9115=function(_0x29c1f2,_0x23f7c2){_0x29c1f2=_0x29c1f2-0x0;var _0x21dd30=_0x1159[_0x29c1f2];return _0x21dd30;};'use strict';var multer=require(_0x9115('0x0'));var util=require(_0x9115('0x1'));var path=require(_0x9115('0x2'));var timeout=require(_0x9115('0x3'));var express=require(_0x9115('0x4'));var router=express['Router']();var fs_extra=require(_0x9115('0x5'));var auth=require(_0x9115('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9115('0x7'));router['get']('/',auth[_0x9115('0x8')](),controller[_0x9115('0x9')]);router[_0x9115('0xa')](_0x9115('0xb'),auth[_0x9115('0x8')](),controller[_0x9115('0xc')]);router[_0x9115('0xa')](_0x9115('0xd'),auth[_0x9115('0x8')](),controller[_0x9115('0xe')]);router['get']('/:id/any_conditions',auth[_0x9115('0x8')](),controller[_0x9115('0xf')]);router[_0x9115('0xa')](_0x9115('0x10'),auth[_0x9115('0x8')](),controller['getActions']);router[_0x9115('0x11')]('/',auth['isAuthenticated'](),controller[_0x9115('0x12')]);router[_0x9115('0x11')](_0x9115('0xd'),auth['isAuthenticated'](),controller[_0x9115('0x13')]);router[_0x9115('0x11')](_0x9115('0x14'),auth[_0x9115('0x8')](),controller[_0x9115('0x15')]);router['post'](_0x9115('0x10'),auth[_0x9115('0x8')](),controller[_0x9115('0x16')]);router[_0x9115('0x17')](_0x9115('0xb'),auth[_0x9115('0x8')](),controller['update']);router[_0x9115('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x9115('0x19')]);module[_0x9115('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index c9b1052..545f303 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 _0x5959=['BOOLEAN','sequelize','exports','STRING'];(function(_0xb3339d,_0x8803d){var _0x4dce04=function(_0x42ead0){while(--_0x42ead0){_0xb3339d['push'](_0xb3339d['shift']());}};_0x4dce04(++_0x8803d);}(_0x5959,0x95));var _0x9595=function(_0x41eb8b,_0x8e630f){_0x41eb8b=_0x41eb8b-0x0;var _0x57f6be=_0x5959[_0x41eb8b];return _0x57f6be;};'use strict';var Sequelize=require(_0x9595('0x0'));module[_0x9595('0x1')]={'name':{'type':Sequelize[_0x9595('0x2')]},'channel':{'type':Sequelize[_0x9595('0x2')]},'description':{'type':Sequelize[_0x9595('0x2')]},'status':{'type':Sequelize[_0x9595('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2118=['sequelize','STRING'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x2118,0x15e));var _0x8211=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2118[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x8211('0x0'));module['exports']={'name':{'type':Sequelize[_0x8211('0x1')]},'channel':{'type':Sequelize[_0x8211('0x1')]},'description':{'type':Sequelize[_0x8211('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 8729a9c..33e1c7a 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 _0x5a13=['destroy','stack','name','send','index','map','Trigger','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','length','getAllConditions','findOne','rawAttributes','pick','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','reject','save','update','then','get','Triggers'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x5a13,0xf0));var _0x35a1=function(_0x2ff074,_0x228e83){_0x2ff074=_0x2ff074-0x0;var _0x17df42=_0x5a13[_0x2ff074];return _0x17df42;};'use strict';var emlformat=require(_0x35a1('0x0'));var rimraf=require(_0x35a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35a1('0x2'));var rp=require(_0x35a1('0x3'));var moment=require(_0x35a1('0x4'));var BPromise=require(_0x35a1('0x5'));var Mustache=require(_0x35a1('0x6'));var util=require('util');var path=require(_0x35a1('0x7'));var sox=require('sox');var csv=require(_0x35a1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35a1('0x9'));var _=require('lodash');var squel=require(_0x35a1('0xa'));var crypto=require(_0x35a1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35a1('0xc'));var toCsv=require(_0x35a1('0x8'));var querystring=require(_0x35a1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35a1('0xe'));var qs=require(_0x35a1('0xf'));var as=require(_0x35a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35a1('0x11'))(_0x35a1('0x12'));var utils=require(_0x35a1('0x13'));var config=require(_0x35a1('0x14'));var licenseUtil=require(_0x35a1('0x15'));var db=require(_0x35a1('0x16'))['db'];function respondWithStatusCode(_0x324bf6,_0x4523fe){_0x4523fe=_0x4523fe||0xcc;return function(_0x29baf2){if(_0x29baf2){return _0x324bf6[_0x35a1('0x17')](_0x4523fe);}return _0x324bf6['status'](_0x4523fe)[_0x35a1('0x18')]();};}function respondWithResult(_0x2e1cf0,_0x12c72f){_0x12c72f=_0x12c72f||0xc8;return function(_0x44ef3a){if(_0x44ef3a){return _0x2e1cf0['status'](_0x12c72f)[_0x35a1('0x19')](_0x44ef3a);}};}function respondWithFilteredResult(_0x55338e,_0x5aca88){return function(_0x5ec818){if(_0x5ec818){var _0x167d0f=typeof _0x5aca88['offset']==='undefined'&&typeof _0x5aca88[_0x35a1('0x1a')]===_0x35a1('0x1b');var _0x16ccf5=_0x5ec818['count'];var _0x161bc7=_0x167d0f?0x0:_0x5aca88['offset'];var _0x49e9dd=_0x167d0f?_0x5ec818[_0x35a1('0x1c')]:_0x5aca88[_0x35a1('0x1d')]+_0x5aca88[_0x35a1('0x1a')];var _0x129f6c;if(_0x49e9dd>=_0x16ccf5){_0x49e9dd=_0x16ccf5;_0x129f6c=0xc8;}else{_0x129f6c=0xce;}_0x55338e[_0x35a1('0x1e')](_0x129f6c);return _0x55338e['set'](_0x35a1('0x1f'),_0x161bc7+'-'+_0x49e9dd+'/'+_0x16ccf5)[_0x35a1('0x19')](_0x5ec818);}return null;};}function patchUpdates(_0x56fba8){return function(_0x4f2e64){try{jsonpatch[_0x35a1('0x20')](_0x4f2e64,_0x56fba8,!![]);}catch(_0x152a26){return BPromise[_0x35a1('0x21')](_0x152a26);}return _0x4f2e64[_0x35a1('0x22')]();};}function saveUpdates(_0x57f18e,_0x149af7){return function(_0x4ba7e7){if(_0x4ba7e7){return _0x4ba7e7[_0x35a1('0x23')](_0x57f18e)[_0x35a1('0x24')](function(_0x2e371c){return _0x2e371c;});}return null;};}function removeEntity(_0x126635,_0x1c1d3d){return function(_0x46b578){if(_0x46b578){return _0x46b578['destroy']()[_0x35a1('0x24')](function(){var _0x45bd8c=_0x46b578[_0x35a1('0x25')]({'plain':!![]});var _0x23022d=_0x35a1('0x26');return db['UserProfileResource'][_0x35a1('0x27')]({'where':{'type':_0x23022d,'resourceId':_0x45bd8c['id']}})[_0x35a1('0x24')](function(){return _0x46b578;});})[_0x35a1('0x24')](function(){_0x126635[_0x35a1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48d2fc,_0x24c473){return function(_0xafbef9){if(!_0xafbef9){_0x48d2fc['sendStatus'](0x194);}return _0xafbef9;};}function handleError(_0x3defbd,_0x295093){_0x295093=_0x295093||0x1f4;return function(_0x46fe2f){logger['error'](_0x46fe2f[_0x35a1('0x28')]);if(_0x46fe2f[_0x35a1('0x29')]){delete _0x46fe2f['name'];}_0x3defbd[_0x35a1('0x1e')](_0x295093)[_0x35a1('0x2a')](_0x46fe2f);};}exports[_0x35a1('0x2b')]=function(_0x426c98,_0x554b36){var _0x8314c9={},_0x1e5c1c={},_0x3cf98c={'count':0x0,'rows':[]};var _0x2d9997=_[_0x35a1('0x2c')](db[_0x35a1('0x2d')]['rawAttributes'],function(_0x4d5b3e){return{'name':_0x4d5b3e['fieldName'],'type':_0x4d5b3e[_0x35a1('0x2e')][_0x35a1('0x2f')]};});_0x1e5c1c[_0x35a1('0x30')]=_[_0x35a1('0x2c')](_0x2d9997,'name');_0x1e5c1c[_0x35a1('0x31')]=_[_0x35a1('0x32')](_0x426c98[_0x35a1('0x31')]);_0x1e5c1c['filters']=_[_0x35a1('0x33')](_0x1e5c1c[_0x35a1('0x30')],_0x1e5c1c[_0x35a1('0x31')]);_0x8314c9[_0x35a1('0x34')]=_[_0x35a1('0x33')](_0x1e5c1c[_0x35a1('0x30')],qs['fields'](_0x426c98['query']['fields']));_0x8314c9[_0x35a1('0x34')]=_0x8314c9[_0x35a1('0x34')]['length']?_0x8314c9[_0x35a1('0x34')]:_0x1e5c1c['model'];if(!_0x426c98[_0x35a1('0x31')][_0x35a1('0x35')](_0x35a1('0x36'))){_0x8314c9['limit']=qs[_0x35a1('0x1a')](_0x426c98[_0x35a1('0x31')][_0x35a1('0x1a')]);_0x8314c9[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x426c98['query']['offset']);}_0x8314c9[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_0x426c98['query'][_0x35a1('0x38')]);_0x8314c9[_0x35a1('0x39')]=qs[_0x35a1('0x3a')](_['pick'](_0x426c98['query'],_0x1e5c1c[_0x35a1('0x3a')]),_0x2d9997);if(_0x426c98[_0x35a1('0x31')][_0x35a1('0x3b')]){_0x8314c9['where']=_[_0x35a1('0x3c')](_0x8314c9[_0x35a1('0x39')],{'$or':_[_0x35a1('0x2c')](_0x2d9997,function(_0x1dcebc){if(_0x1dcebc[_0x35a1('0x2e')]!=='VIRTUAL'){var _0xf911ec={};_0xf911ec[_0x1dcebc['name']]={'$like':'%'+_0x426c98['query']['filter']+'%'};return _0xf911ec;}})});}_0x8314c9=_['merge']({},_0x8314c9,_0x426c98[_0x35a1('0x3d')]);var _0x4506f5={'where':_0x8314c9[_0x35a1('0x39')]};return db[_0x35a1('0x2d')][_0x35a1('0x1c')](_0x4506f5)[_0x35a1('0x24')](function(_0x1da379){_0x3cf98c[_0x35a1('0x1c')]=_0x1da379;if(_0x426c98[_0x35a1('0x31')][_0x35a1('0x3e')]){_0x8314c9[_0x35a1('0x3f')]=[{'all':!![]}];}return db[_0x35a1('0x2d')][_0x35a1('0x40')](_0x8314c9);})[_0x35a1('0x24')](function(_0x38600d){_0x3cf98c['rows']=_0x38600d;return _0x3cf98c;})[_0x35a1('0x24')](respondWithFilteredResult(_0x554b36,_0x8314c9))[_0x35a1('0x41')](handleError(_0x554b36,null));};exports[_0x35a1('0x42')]=function(_0x1c53ff,_0x51b587){var _0xa0e9ca={'raw':![],'where':{'id':_0x1c53ff[_0x35a1('0x43')]['id']}},_0xc3d189={};_0xc3d189[_0x35a1('0x30')]=_[_0x35a1('0x32')](db[_0x35a1('0x2d')]['rawAttributes']);_0xc3d189[_0x35a1('0x31')]=_['keys'](_0x1c53ff[_0x35a1('0x31')]);_0xc3d189[_0x35a1('0x3a')]=_[_0x35a1('0x33')](_0xc3d189[_0x35a1('0x30')],_0xc3d189[_0x35a1('0x31')]);_0xa0e9ca['attributes']=_['intersection'](_0xc3d189['model'],qs[_0x35a1('0x44')](_0x1c53ff[_0x35a1('0x31')]['fields']));_0xa0e9ca[_0x35a1('0x34')]=_0xa0e9ca['attributes']['length']?_0xa0e9ca[_0x35a1('0x34')]:_0xc3d189['model'];if(_0x1c53ff[_0x35a1('0x31')][_0x35a1('0x3e')]){_0xa0e9ca[_0x35a1('0x3f')]=[{'all':!![]}];}_0xa0e9ca=_[_0x35a1('0x3c')]({},_0xa0e9ca,_0x1c53ff[_0x35a1('0x3d')]);return db[_0x35a1('0x2d')][_0x35a1('0x45')](_0xa0e9ca)['then'](handleEntityNotFound(_0x51b587,null))[_0x35a1('0x24')](respondWithResult(_0x51b587,null))[_0x35a1('0x41')](handleError(_0x51b587,null));};exports[_0x35a1('0x46')]=function(_0x7ffbb9,_0x255609){return db[_0x35a1('0x2d')][_0x35a1('0x46')](_0x7ffbb9['body'],{})[_0x35a1('0x24')](function(_0x4cc1bb){var _0x382a9d=_0x7ffbb9['user'][_0x35a1('0x25')]({'plain':!![]});if(!_0x382a9d)throw new Error(_0x35a1('0x47'));if(_0x382a9d['role']==='user'){var _0x16adb1=_0x4cc1bb[_0x35a1('0x25')]({'plain':!![]});var _0x52c79f=_0x35a1('0x26');return db[_0x35a1('0x48')][_0x35a1('0x45')]({'where':{'name':_0x52c79f,'userProfileId':_0x382a9d[_0x35a1('0x49')]},'raw':!![]})[_0x35a1('0x24')](function(_0x446639){if(_0x446639&&_0x446639[_0x35a1('0x4a')]===0x0){return db[_0x35a1('0x4b')]['create']({'name':_0x16adb1[_0x35a1('0x29')],'resourceId':_0x16adb1['id'],'type':_0x446639['name'],'sectionId':_0x446639['id']},{})[_0x35a1('0x24')](function(){return _0x4cc1bb;});}else{return _0x4cc1bb;}})[_0x35a1('0x41')](function(_0x58c59a){logger[_0x35a1('0x4c')](_0x35a1('0x4d'),_0x58c59a);throw _0x58c59a;});}return _0x4cc1bb;})[_0x35a1('0x24')](respondWithResult(_0x255609,0xc9))[_0x35a1('0x41')](handleError(_0x255609,null));};exports[_0x35a1('0x23')]=function(_0x446c6d,_0xdbf043){if(_0x446c6d[_0x35a1('0x4e')]['id']){delete _0x446c6d['body']['id'];}return db[_0x35a1('0x2d')][_0x35a1('0x45')]({'where':{'id':_0x446c6d['params']['id']}})[_0x35a1('0x24')](handleEntityNotFound(_0xdbf043,null))[_0x35a1('0x24')](saveUpdates(_0x446c6d[_0x35a1('0x4e')],null))[_0x35a1('0x24')](respondWithResult(_0xdbf043,null))[_0x35a1('0x41')](handleError(_0xdbf043,null));};exports[_0x35a1('0x27')]=function(_0x48a29d,_0xaf9fe7){return db[_0x35a1('0x2d')][_0x35a1('0x45')]({'where':{'id':_0x48a29d[_0x35a1('0x43')]['id']}})[_0x35a1('0x24')](handleEntityNotFound(_0xaf9fe7,null))[_0x35a1('0x24')](removeEntity(_0xaf9fe7,null))[_0x35a1('0x41')](handleError(_0xaf9fe7,null));};exports[_0x35a1('0x4f')]=function(_0x50f3d2,_0x319b04,_0x42d8ee){if(_0x50f3d2[_0x35a1('0x4e')]['id']){delete _0x50f3d2['body']['id'];}return db[_0x35a1('0x2d')][_0x35a1('0x45')]({'where':{'id':_0x50f3d2['params']['id']}})['then'](handleEntityNotFound(_0x319b04,null))[_0x35a1('0x24')](function(_0x37e183){if(_0x37e183){_0x50f3d2[_0x35a1('0x4e')][_0x35a1('0x50')]=_0x37e183['id'];return db[_0x35a1('0x51')][_0x35a1('0x46')](_0x50f3d2[_0x35a1('0x4e')]);}})[_0x35a1('0x24')](respondWithResult(_0x319b04,null))['catch'](handleError(_0x319b04,null));};exports[_0x35a1('0x52')]=function(_0x4a9cbe,_0x5c95e7,_0x410aba){if(_0x4a9cbe[_0x35a1('0x4e')]['id']){delete _0x4a9cbe['body']['id'];}return db[_0x35a1('0x2d')][_0x35a1('0x45')]({'where':{'id':_0x4a9cbe[_0x35a1('0x43')]['id']}})[_0x35a1('0x24')](handleEntityNotFound(_0x5c95e7,null))[_0x35a1('0x24')](function(_0x344c9d){if(_0x344c9d){_0x4a9cbe[_0x35a1('0x4e')][_0x35a1('0x53')]=_0x344c9d['id'];return db[_0x35a1('0x51')][_0x35a1('0x46')](_0x4a9cbe[_0x35a1('0x4e')]);}})[_0x35a1('0x24')](respondWithResult(_0x5c95e7,null))[_0x35a1('0x41')](handleError(_0x5c95e7,null));};exports['getAllConditions']=function(_0x208176,_0x50ff99,_0x32908c){var _0x58651c={};var _0x1d0186={};var _0x115247;var _0x51b1ff;return db[_0x35a1('0x2d')]['findOne']({'where':{'id':_0x208176[_0x35a1('0x43')]['id']}})['then'](handleEntityNotFound(_0x50ff99,null))[_0x35a1('0x24')](function(_0x3963d7){if(_0x3963d7){_0x115247=_0x3963d7;_0x1d0186['model']=_['keys'](db['Condition']['rawAttributes']);_0x1d0186['query']=_['keys'](_0x208176[_0x35a1('0x31')]);_0x1d0186['filters']=_[_0x35a1('0x33')](_0x1d0186[_0x35a1('0x30')],_0x1d0186[_0x35a1('0x31')]);_0x58651c[_0x35a1('0x34')]=_[_0x35a1('0x33')](_0x1d0186[_0x35a1('0x30')],qs['fields'](_0x208176[_0x35a1('0x31')][_0x35a1('0x44')]));_0x58651c[_0x35a1('0x34')]=_0x58651c[_0x35a1('0x34')][_0x35a1('0x54')]?_0x58651c[_0x35a1('0x34')]:_0x1d0186[_0x35a1('0x30')];_0x58651c[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_0x208176[_0x35a1('0x31')][_0x35a1('0x38')]);_0x58651c['where']=qs[_0x35a1('0x3a')](_['pick'](_0x208176[_0x35a1('0x31')],_0x1d0186['filters']));if(_0x208176[_0x35a1('0x31')][_0x35a1('0x3b')]){_0x58651c[_0x35a1('0x39')]=_[_0x35a1('0x3c')](_0x58651c[_0x35a1('0x39')],{'$or':_[_0x35a1('0x2c')](_0x58651c[_0x35a1('0x34')],function(_0x29c92a){var _0x411ef2={};_0x411ef2[_0x29c92a]={'$like':'%'+_0x208176[_0x35a1('0x31')][_0x35a1('0x3b')]+'%'};return _0x411ef2;})});}_0x58651c=_[_0x35a1('0x3c')]({},_0x58651c,_0x208176[_0x35a1('0x3d')]);return _0x115247[_0x35a1('0x55')](_0x58651c);}})[_0x35a1('0x24')](function(_0x587863){if(_0x587863){_0x51b1ff=_0x587863[_0x35a1('0x54')];if(!_0x208176[_0x35a1('0x31')][_0x35a1('0x35')](_0x35a1('0x36'))){_0x58651c[_0x35a1('0x1a')]=qs[_0x35a1('0x1a')](_0x208176[_0x35a1('0x31')][_0x35a1('0x1a')]);_0x58651c[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x208176[_0x35a1('0x31')][_0x35a1('0x1d')]);}return _0x115247[_0x35a1('0x55')](_0x58651c);}})[_0x35a1('0x24')](function(_0x4ed158){if(_0x4ed158){return _0x4ed158?{'count':_0x51b1ff,'rows':_0x4ed158}:null;}})[_0x35a1('0x24')](respondWithResult(_0x50ff99,null))[_0x35a1('0x41')](handleError(_0x50ff99,null));};exports['getAnyConditions']=function(_0x4cda92,_0x3ed9fd,_0x4536f2){var _0x3f18f6={};var _0x1d60b2={};var _0x5904f4;var _0x5589f6;return db['Trigger'][_0x35a1('0x56')]({'where':{'id':_0x4cda92[_0x35a1('0x43')]['id']}})[_0x35a1('0x24')](handleEntityNotFound(_0x3ed9fd,null))[_0x35a1('0x24')](function(_0x5da80d){if(_0x5da80d){_0x5904f4=_0x5da80d;_0x1d60b2[_0x35a1('0x30')]=_[_0x35a1('0x32')](db[_0x35a1('0x51')][_0x35a1('0x57')]);_0x1d60b2[_0x35a1('0x31')]=_['keys'](_0x4cda92[_0x35a1('0x31')]);_0x1d60b2[_0x35a1('0x3a')]=_[_0x35a1('0x33')](_0x1d60b2[_0x35a1('0x30')],_0x1d60b2[_0x35a1('0x31')]);_0x3f18f6['attributes']=_['intersection'](_0x1d60b2[_0x35a1('0x30')],qs['fields'](_0x4cda92['query'][_0x35a1('0x44')]));_0x3f18f6[_0x35a1('0x34')]=_0x3f18f6[_0x35a1('0x34')][_0x35a1('0x54')]?_0x3f18f6[_0x35a1('0x34')]:_0x1d60b2['model'];_0x3f18f6[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_0x4cda92[_0x35a1('0x31')]['sort']);_0x3f18f6[_0x35a1('0x39')]=qs['filters'](_[_0x35a1('0x58')](_0x4cda92[_0x35a1('0x31')],_0x1d60b2[_0x35a1('0x3a')]));if(_0x4cda92[_0x35a1('0x31')]['filter']){_0x3f18f6[_0x35a1('0x39')]=_['merge'](_0x3f18f6[_0x35a1('0x39')],{'$or':_[_0x35a1('0x2c')](_0x3f18f6['attributes'],function(_0x2ba5c0){var _0x6597b8={};_0x6597b8[_0x2ba5c0]={'$like':'%'+_0x4cda92[_0x35a1('0x31')][_0x35a1('0x3b')]+'%'};return _0x6597b8;})});}_0x3f18f6=_[_0x35a1('0x3c')]({},_0x3f18f6,_0x4cda92[_0x35a1('0x3d')]);return _0x5904f4[_0x35a1('0x59')](_0x3f18f6);}})[_0x35a1('0x24')](function(_0xa3afd){if(_0xa3afd){_0x5589f6=_0xa3afd['length'];if(!_0x4cda92[_0x35a1('0x31')][_0x35a1('0x35')](_0x35a1('0x36'))){_0x3f18f6[_0x35a1('0x1a')]=qs[_0x35a1('0x1a')](_0x4cda92[_0x35a1('0x31')][_0x35a1('0x1a')]);_0x3f18f6[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x4cda92[_0x35a1('0x31')][_0x35a1('0x1d')]);}return _0x5904f4[_0x35a1('0x59')](_0x3f18f6);}})[_0x35a1('0x24')](function(_0x6b7a4d){if(_0x6b7a4d){return _0x6b7a4d?{'count':_0x5589f6,'rows':_0x6b7a4d}:null;}})[_0x35a1('0x24')](respondWithResult(_0x3ed9fd,null))[_0x35a1('0x41')](handleError(_0x3ed9fd,null));};exports[_0x35a1('0x5a')]=function(_0x13e79f,_0x7eb257,_0x2c902e){if(_0x13e79f[_0x35a1('0x4e')]['id']){delete _0x13e79f[_0x35a1('0x4e')]['id'];}return db[_0x35a1('0x2d')]['find']({'where':{'id':_0x13e79f['params']['id']}})['then'](handleEntityNotFound(_0x7eb257,null))[_0x35a1('0x24')](function(_0x3e9ecc){if(_0x3e9ecc){_0x13e79f[_0x35a1('0x4e')]['TriggerId']=_0x3e9ecc['id'];return db[_0x35a1('0x5b')][_0x35a1('0x46')](_0x13e79f[_0x35a1('0x4e')]);}})['then'](respondWithResult(_0x7eb257,null))[_0x35a1('0x41')](handleError(_0x7eb257,null));};exports[_0x35a1('0x5c')]=function(_0x29b545,_0x5b9702,_0x36a59d){var _0x20b8f4={};var _0x53f691={};var _0x59a7a2;var _0x59e76e;return db[_0x35a1('0x2d')][_0x35a1('0x56')]({'where':{'id':_0x29b545[_0x35a1('0x43')]['id']}})[_0x35a1('0x24')](handleEntityNotFound(_0x5b9702,null))[_0x35a1('0x24')](function(_0x418902){if(_0x418902){_0x59a7a2=_0x418902;_0x53f691[_0x35a1('0x30')]=_[_0x35a1('0x32')](db[_0x35a1('0x5b')][_0x35a1('0x57')]);_0x53f691['query']=_[_0x35a1('0x32')](_0x29b545[_0x35a1('0x31')]);_0x53f691[_0x35a1('0x3a')]=_['intersection'](_0x53f691[_0x35a1('0x30')],_0x53f691[_0x35a1('0x31')]);_0x20b8f4[_0x35a1('0x34')]=_[_0x35a1('0x33')](_0x53f691[_0x35a1('0x30')],qs[_0x35a1('0x44')](_0x29b545[_0x35a1('0x31')]['fields']));_0x20b8f4['attributes']=_0x20b8f4['attributes']['length']?_0x20b8f4[_0x35a1('0x34')]:_0x53f691[_0x35a1('0x30')];_0x20b8f4[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_0x29b545[_0x35a1('0x31')]['sort']);_0x20b8f4[_0x35a1('0x39')]=qs[_0x35a1('0x3a')](_[_0x35a1('0x58')](_0x29b545['query'],_0x53f691[_0x35a1('0x3a')]));if(_0x29b545['query'][_0x35a1('0x3b')]){_0x20b8f4[_0x35a1('0x39')]=_[_0x35a1('0x3c')](_0x20b8f4[_0x35a1('0x39')],{'$or':_[_0x35a1('0x2c')](_0x20b8f4[_0x35a1('0x34')],function(_0x3aedff){var _0x269196={};_0x269196[_0x3aedff]={'$like':'%'+_0x29b545[_0x35a1('0x31')][_0x35a1('0x3b')]+'%'};return _0x269196;})});}_0x20b8f4=_[_0x35a1('0x3c')]({},_0x20b8f4,_0x29b545['options']);return _0x59a7a2[_0x35a1('0x5c')](_0x20b8f4);}})['then'](function(_0x5bd3cb){if(_0x5bd3cb){_0x59e76e=_0x5bd3cb['length'];if(!_0x29b545['query'][_0x35a1('0x35')](_0x35a1('0x36'))){_0x20b8f4[_0x35a1('0x1a')]=qs['limit'](_0x29b545[_0x35a1('0x31')][_0x35a1('0x1a')]);_0x20b8f4[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x29b545['query'][_0x35a1('0x1d')]);}return _0x59a7a2['getActions'](_0x20b8f4);}})[_0x35a1('0x24')](function(_0x43fd29){if(_0x43fd29){return _0x43fd29?{'count':_0x59e76e,'rows':_0x43fd29}:null;}})[_0x35a1('0x24')](respondWithResult(_0x5b9702,null))[_0x35a1('0x41')](handleError(_0x5b9702,null));}; \ No newline at end of file +var _0x755c=['TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../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','limit','undefined','count','offset','set','reject','save','update','Triggers','then','error','stack','send','index','Trigger','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','name','options','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','length','filter','hasOwnProperty','nolimit','addAction'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x755c,0x120));var _0xc755=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x755c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc755('0x0'));var rimraf=require(_0xc755('0x1'));var zipdir=require(_0xc755('0x2'));var jsonpatch=require(_0xc755('0x3'));var rp=require(_0xc755('0x4'));var moment=require(_0xc755('0x5'));var BPromise=require(_0xc755('0x6'));var Mustache=require(_0xc755('0x7'));var util=require(_0xc755('0x8'));var path=require(_0xc755('0x9'));var sox=require('sox');var csv=require(_0xc755('0xa'));var ejs=require(_0xc755('0xb'));var fs=require('fs');var fs_extra=require(_0xc755('0xc'));var _=require(_0xc755('0xd'));var squel=require(_0xc755('0xe'));var crypto=require(_0xc755('0xf'));var jsforce=require(_0xc755('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc755('0x11'));var qs=require(_0xc755('0x12'));var as=require(_0xc755('0x13'));var hardwareService=require(_0xc755('0x14'));var logger=require(_0xc755('0x15'))('api');var utils=require(_0xc755('0x16'));var config=require(_0xc755('0x17'));var licenseUtil=require(_0xc755('0x18'));var db=require(_0xc755('0x19'))['db'];function respondWithStatusCode(_0x5d2eb0,_0x17a1a3){_0x17a1a3=_0x17a1a3||0xcc;return function(_0x28e253){if(_0x28e253){return _0x5d2eb0[_0xc755('0x1a')](_0x17a1a3);}return _0x5d2eb0[_0xc755('0x1b')](_0x17a1a3)[_0xc755('0x1c')]();};}function respondWithResult(_0x1fb135,_0xb720f8){_0xb720f8=_0xb720f8||0xc8;return function(_0x481e5c){if(_0x481e5c){return _0x1fb135['status'](_0xb720f8)[_0xc755('0x1d')](_0x481e5c);}};}function respondWithFilteredResult(_0x5dcb56,_0x183cad){return function(_0x1e6fbe){if(_0x1e6fbe){var _0x3249e2=typeof _0x183cad['offset']==='undefined'&&typeof _0x183cad[_0xc755('0x1e')]===_0xc755('0x1f');var _0x343bf0=_0x1e6fbe[_0xc755('0x20')];var _0x16917a=_0x3249e2?0x0:_0x183cad[_0xc755('0x21')];var _0x382306=_0x3249e2?_0x1e6fbe[_0xc755('0x20')]:_0x183cad['offset']+_0x183cad[_0xc755('0x1e')];var _0x55f9fd;if(_0x382306>=_0x343bf0){_0x382306=_0x343bf0;_0x55f9fd=0xc8;}else{_0x55f9fd=0xce;}_0x5dcb56[_0xc755('0x1b')](_0x55f9fd);return _0x5dcb56[_0xc755('0x22')]('Content-Range',_0x16917a+'-'+_0x382306+'/'+_0x343bf0)['json'](_0x1e6fbe);}return null;};}function patchUpdates(_0x1359aa){return function(_0x4e89f7){try{jsonpatch['apply'](_0x4e89f7,_0x1359aa,!![]);}catch(_0xe3c9fa){return BPromise[_0xc755('0x23')](_0xe3c9fa);}return _0x4e89f7[_0xc755('0x24')]();};}function saveUpdates(_0x3046dc,_0xe5e967){return function(_0x373419){if(_0x373419){return _0x373419[_0xc755('0x25')](_0x3046dc)['then'](function(_0x1771f3){return _0x1771f3;});}return null;};}function removeEntity(_0x1fad92,_0x64078){return function(_0xfc7a5f){if(_0xfc7a5f){return _0xfc7a5f['destroy']()['then'](function(){var _0x134f9b=_0xfc7a5f['get']({'plain':!![]});var _0x56c0db=_0xc755('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x56c0db,'resourceId':_0x134f9b['id']}})['then'](function(){return _0xfc7a5f;});})[_0xc755('0x27')](function(){_0x1fad92[_0xc755('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3227dc,_0x1a016f){return function(_0x41c3a7){if(!_0x41c3a7){_0x3227dc['sendStatus'](0x194);}return _0x41c3a7;};}function handleError(_0x1740d2,_0x2a036f){_0x2a036f=_0x2a036f||0x1f4;return function(_0x3eecc4){logger[_0xc755('0x28')](_0x3eecc4[_0xc755('0x29')]);if(_0x3eecc4['name']){delete _0x3eecc4['name'];}_0x1740d2['status'](_0x2a036f)[_0xc755('0x2a')](_0x3eecc4);};}exports[_0xc755('0x2b')]=function(_0x29c7fe,_0x1fcc6f){var _0x194839={},_0xc25c0e={},_0x162a90={'count':0x0,'rows':[]};var _0x2e9af4=_['map'](db[_0xc755('0x2c')][_0xc755('0x2d')],function(_0xe49ca9){return{'name':_0xe49ca9[_0xc755('0x2e')],'type':_0xe49ca9['type'][_0xc755('0x2f')]};});_0xc25c0e[_0xc755('0x30')]=_[_0xc755('0x31')](_0x2e9af4,'name');_0xc25c0e['query']=_[_0xc755('0x32')](_0x29c7fe[_0xc755('0x33')]);_0xc25c0e[_0xc755('0x34')]=_[_0xc755('0x35')](_0xc25c0e[_0xc755('0x30')],_0xc25c0e[_0xc755('0x33')]);_0x194839[_0xc755('0x36')]=_[_0xc755('0x35')](_0xc25c0e[_0xc755('0x30')],qs[_0xc755('0x37')](_0x29c7fe[_0xc755('0x33')][_0xc755('0x37')]));_0x194839[_0xc755('0x36')]=_0x194839['attributes']['length']?_0x194839[_0xc755('0x36')]:_0xc25c0e[_0xc755('0x30')];if(!_0x29c7fe['query']['hasOwnProperty']('nolimit')){_0x194839[_0xc755('0x1e')]=qs['limit'](_0x29c7fe['query']['limit']);_0x194839['offset']=qs[_0xc755('0x21')](_0x29c7fe[_0xc755('0x33')]['offset']);}_0x194839[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x29c7fe['query'][_0xc755('0x39')]);_0x194839[_0xc755('0x3a')]=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x29c7fe[_0xc755('0x33')],_0xc25c0e[_0xc755('0x34')]),_0x2e9af4);if(_0x29c7fe['query']['filter']){_0x194839['where']=_[_0xc755('0x3c')](_0x194839[_0xc755('0x3a')],{'$or':_['map'](_0x2e9af4,function(_0x2c98bb){if(_0x2c98bb['type']!==_0xc755('0x3d')){var _0x5510ca={};_0x5510ca[_0x2c98bb[_0xc755('0x3e')]]={'$like':'%'+_0x29c7fe[_0xc755('0x33')]['filter']+'%'};return _0x5510ca;}})});}_0x194839=_[_0xc755('0x3c')]({},_0x194839,_0x29c7fe[_0xc755('0x3f')]);var _0x557bdf={'where':_0x194839[_0xc755('0x3a')]};return db['Trigger'][_0xc755('0x20')](_0x557bdf)[_0xc755('0x27')](function(_0x3e8114){_0x162a90[_0xc755('0x20')]=_0x3e8114;if(_0x29c7fe[_0xc755('0x33')]['includeAll']){_0x194839[_0xc755('0x40')]=[{'all':!![]}];}return db[_0xc755('0x2c')][_0xc755('0x41')](_0x194839);})[_0xc755('0x27')](function(_0x4ba4f8){_0x162a90[_0xc755('0x42')]=_0x4ba4f8;return _0x162a90;})['then'](respondWithFilteredResult(_0x1fcc6f,_0x194839))['catch'](handleError(_0x1fcc6f,null));};exports[_0xc755('0x43')]=function(_0x43cc4d,_0x2d26b1){var _0x4aef37={'raw':![],'where':{'id':_0x43cc4d[_0xc755('0x44')]['id']}},_0x4a34bb={};_0x4a34bb[_0xc755('0x30')]=_[_0xc755('0x32')](db[_0xc755('0x2c')][_0xc755('0x2d')]);_0x4a34bb[_0xc755('0x33')]=_[_0xc755('0x32')](_0x43cc4d[_0xc755('0x33')]);_0x4a34bb[_0xc755('0x34')]=_[_0xc755('0x35')](_0x4a34bb[_0xc755('0x30')],_0x4a34bb[_0xc755('0x33')]);_0x4aef37[_0xc755('0x36')]=_[_0xc755('0x35')](_0x4a34bb['model'],qs[_0xc755('0x37')](_0x43cc4d[_0xc755('0x33')][_0xc755('0x37')]));_0x4aef37[_0xc755('0x36')]=_0x4aef37[_0xc755('0x36')]['length']?_0x4aef37[_0xc755('0x36')]:_0x4a34bb['model'];if(_0x43cc4d[_0xc755('0x33')]['includeAll']){_0x4aef37[_0xc755('0x40')]=[{'all':!![]}];}_0x4aef37=_['merge']({},_0x4aef37,_0x43cc4d[_0xc755('0x3f')]);return db[_0xc755('0x2c')]['find'](_0x4aef37)['then'](handleEntityNotFound(_0x2d26b1,null))['then'](respondWithResult(_0x2d26b1,null))[_0xc755('0x45')](handleError(_0x2d26b1,null));};exports[_0xc755('0x46')]=function(_0x49ee5a,_0x30cc61){return db['Trigger'][_0xc755('0x46')](_0x49ee5a[_0xc755('0x47')],{})['then'](function(_0x4f095c){var _0x21ca00=_0x49ee5a[_0xc755('0x48')]['get']({'plain':!![]});if(!_0x21ca00)throw new Error(_0xc755('0x49'));if(_0x21ca00['role']===_0xc755('0x48')){var _0x34714c=_0x4f095c[_0xc755('0x4a')]({'plain':!![]});var _0x3e264b='Triggers';return db[_0xc755('0x4b')][_0xc755('0x4c')]({'where':{'name':_0x3e264b,'userProfileId':_0x21ca00[_0xc755('0x4d')]},'raw':!![]})['then'](function(_0x2c328c){if(_0x2c328c&&_0x2c328c[_0xc755('0x4e')]===0x0){return db[_0xc755('0x4f')][_0xc755('0x46')]({'name':_0x34714c[_0xc755('0x3e')],'resourceId':_0x34714c['id'],'type':_0x2c328c[_0xc755('0x3e')],'sectionId':_0x2c328c['id']},{})[_0xc755('0x27')](function(){return _0x4f095c;});}else{return _0x4f095c;}})[_0xc755('0x45')](function(_0x254707){logger[_0xc755('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x254707);throw _0x254707;});}return _0x4f095c;})[_0xc755('0x27')](respondWithResult(_0x30cc61,0xc9))[_0xc755('0x45')](handleError(_0x30cc61,null));};exports['update']=function(_0x174f6f,_0x4f980d){if(_0x174f6f[_0xc755('0x47')]['id']){delete _0x174f6f[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x174f6f[_0xc755('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f980d,null))['then'](saveUpdates(_0x174f6f[_0xc755('0x47')],null))[_0xc755('0x27')](respondWithResult(_0x4f980d,null))[_0xc755('0x45')](handleError(_0x4f980d,null));};exports[_0xc755('0x50')]=function(_0x317bd1,_0x38b088){return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x317bd1[_0xc755('0x44')]['id']}})['then'](handleEntityNotFound(_0x38b088,null))[_0xc755('0x27')](removeEntity(_0x38b088,null))[_0xc755('0x45')](handleError(_0x38b088,null));};exports[_0xc755('0x51')]=function(_0x3bfb49,_0x2a4e30,_0x10bd2f){if(_0x3bfb49[_0xc755('0x47')]['id']){delete _0x3bfb49[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x3bfb49[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x2a4e30,null))['then'](function(_0x545277){if(_0x545277){_0x3bfb49['body'][_0xc755('0x52')]=_0x545277['id'];return db[_0xc755('0x53')][_0xc755('0x46')](_0x3bfb49['body']);}})[_0xc755('0x27')](respondWithResult(_0x2a4e30,null))[_0xc755('0x45')](handleError(_0x2a4e30,null));};exports[_0xc755('0x54')]=function(_0x2ba72d,_0x2329e8,_0x4ec346){if(_0x2ba72d['body']['id']){delete _0x2ba72d[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x2ba72d['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x2329e8,null))['then'](function(_0x5786ad){if(_0x5786ad){_0x2ba72d[_0xc755('0x47')]['TriggerAnyId']=_0x5786ad['id'];return db['Condition']['create'](_0x2ba72d['body']);}})[_0xc755('0x27')](respondWithResult(_0x2329e8,null))['catch'](handleError(_0x2329e8,null));};exports[_0xc755('0x55')]=function(_0x4e7ad7,_0x306c38,_0x55c52e){var _0x4718ef={};var _0x31d792={};var _0x54fd2d;var _0x2afe08;return db[_0xc755('0x2c')][_0xc755('0x56')]({'where':{'id':_0x4e7ad7['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x306c38,null))[_0xc755('0x27')](function(_0x5530a9){if(_0x5530a9){_0x54fd2d=_0x5530a9;_0x31d792['model']=_['keys'](db[_0xc755('0x53')]['rawAttributes']);_0x31d792['query']=_[_0xc755('0x32')](_0x4e7ad7[_0xc755('0x33')]);_0x31d792[_0xc755('0x34')]=_['intersection'](_0x31d792[_0xc755('0x30')],_0x31d792[_0xc755('0x33')]);_0x4718ef['attributes']=_[_0xc755('0x35')](_0x31d792[_0xc755('0x30')],qs[_0xc755('0x37')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x37')]));_0x4718ef[_0xc755('0x36')]=_0x4718ef['attributes'][_0xc755('0x57')]?_0x4718ef[_0xc755('0x36')]:_0x31d792[_0xc755('0x30')];_0x4718ef[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x39')]);_0x4718ef[_0xc755('0x3a')]=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x4e7ad7[_0xc755('0x33')],_0x31d792[_0xc755('0x34')]));if(_0x4e7ad7['query'][_0xc755('0x58')]){_0x4718ef[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x4718ef[_0xc755('0x3a')],{'$or':_['map'](_0x4718ef[_0xc755('0x36')],function(_0x57204f){var _0x2b6a47={};_0x2b6a47[_0x57204f]={'$like':'%'+_0x4e7ad7[_0xc755('0x33')]['filter']+'%'};return _0x2b6a47;})});}_0x4718ef=_[_0xc755('0x3c')]({},_0x4718ef,_0x4e7ad7[_0xc755('0x3f')]);return _0x54fd2d['getAllConditions'](_0x4718ef);}})[_0xc755('0x27')](function(_0x347c81){if(_0x347c81){_0x2afe08=_0x347c81[_0xc755('0x57')];if(!_0x4e7ad7[_0xc755('0x33')][_0xc755('0x59')](_0xc755('0x5a'))){_0x4718ef['limit']=qs['limit'](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x1e')]);_0x4718ef[_0xc755('0x21')]=qs[_0xc755('0x21')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x21')]);}return _0x54fd2d['getAllConditions'](_0x4718ef);}})[_0xc755('0x27')](function(_0x208df4){if(_0x208df4){return _0x208df4?{'count':_0x2afe08,'rows':_0x208df4}:null;}})[_0xc755('0x27')](respondWithResult(_0x306c38,null))[_0xc755('0x45')](handleError(_0x306c38,null));};exports['getAnyConditions']=function(_0x6301c4,_0x46d99f,_0x189f87){var _0x2dab80={};var _0x434fc0={};var _0x524353;var _0x311fe0;return db[_0xc755('0x2c')]['findOne']({'where':{'id':_0x6301c4[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x46d99f,null))[_0xc755('0x27')](function(_0x5b1459){if(_0x5b1459){_0x524353=_0x5b1459;_0x434fc0[_0xc755('0x30')]=_[_0xc755('0x32')](db['Condition'][_0xc755('0x2d')]);_0x434fc0[_0xc755('0x33')]=_[_0xc755('0x32')](_0x6301c4[_0xc755('0x33')]);_0x434fc0[_0xc755('0x34')]=_[_0xc755('0x35')](_0x434fc0[_0xc755('0x30')],_0x434fc0[_0xc755('0x33')]);_0x2dab80['attributes']=_[_0xc755('0x35')](_0x434fc0[_0xc755('0x30')],qs[_0xc755('0x37')](_0x6301c4[_0xc755('0x33')][_0xc755('0x37')]));_0x2dab80[_0xc755('0x36')]=_0x2dab80['attributes'][_0xc755('0x57')]?_0x2dab80['attributes']:_0x434fc0[_0xc755('0x30')];_0x2dab80[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x6301c4['query'][_0xc755('0x39')]);_0x2dab80['where']=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x6301c4['query'],_0x434fc0['filters']));if(_0x6301c4[_0xc755('0x33')][_0xc755('0x58')]){_0x2dab80[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x2dab80[_0xc755('0x3a')],{'$or':_[_0xc755('0x31')](_0x2dab80[_0xc755('0x36')],function(_0x50709e){var _0x50acd6={};_0x50acd6[_0x50709e]={'$like':'%'+_0x6301c4[_0xc755('0x33')][_0xc755('0x58')]+'%'};return _0x50acd6;})});}_0x2dab80=_[_0xc755('0x3c')]({},_0x2dab80,_0x6301c4[_0xc755('0x3f')]);return _0x524353['getAnyConditions'](_0x2dab80);}})[_0xc755('0x27')](function(_0x1cb37f){if(_0x1cb37f){_0x311fe0=_0x1cb37f[_0xc755('0x57')];if(!_0x6301c4[_0xc755('0x33')][_0xc755('0x59')]('nolimit')){_0x2dab80[_0xc755('0x1e')]=qs[_0xc755('0x1e')](_0x6301c4[_0xc755('0x33')][_0xc755('0x1e')]);_0x2dab80['offset']=qs['offset'](_0x6301c4[_0xc755('0x33')]['offset']);}return _0x524353['getAnyConditions'](_0x2dab80);}})[_0xc755('0x27')](function(_0x2c3d15){if(_0x2c3d15){return _0x2c3d15?{'count':_0x311fe0,'rows':_0x2c3d15}:null;}})[_0xc755('0x27')](respondWithResult(_0x46d99f,null))[_0xc755('0x45')](handleError(_0x46d99f,null));};exports[_0xc755('0x5b')]=function(_0x3eca73,_0x445677,_0x2c474a){if(_0x3eca73[_0xc755('0x47')]['id']){delete _0x3eca73[_0xc755('0x47')]['id'];}return db['Trigger'][_0xc755('0x4c')]({'where':{'id':_0x3eca73[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x445677,null))[_0xc755('0x27')](function(_0x528fa6){if(_0x528fa6){_0x3eca73['body'][_0xc755('0x5c')]=_0x528fa6['id'];return db[_0xc755('0x5d')]['create'](_0x3eca73[_0xc755('0x47')]);}})[_0xc755('0x27')](respondWithResult(_0x445677,null))[_0xc755('0x45')](handleError(_0x445677,null));};exports[_0xc755('0x5e')]=function(_0x59d0bf,_0x17803a,_0x418610){var _0x13a57c={};var _0x26625c={};var _0x2698af;var _0x50e5a0;return db[_0xc755('0x2c')][_0xc755('0x56')]({'where':{'id':_0x59d0bf['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x17803a,null))['then'](function(_0x170291){if(_0x170291){_0x2698af=_0x170291;_0x26625c[_0xc755('0x30')]=_[_0xc755('0x32')](db[_0xc755('0x5d')][_0xc755('0x2d')]);_0x26625c[_0xc755('0x33')]=_[_0xc755('0x32')](_0x59d0bf[_0xc755('0x33')]);_0x26625c[_0xc755('0x34')]=_[_0xc755('0x35')](_0x26625c[_0xc755('0x30')],_0x26625c[_0xc755('0x33')]);_0x13a57c[_0xc755('0x36')]=_[_0xc755('0x35')](_0x26625c['model'],qs['fields'](_0x59d0bf[_0xc755('0x33')][_0xc755('0x37')]));_0x13a57c['attributes']=_0x13a57c['attributes'][_0xc755('0x57')]?_0x13a57c[_0xc755('0x36')]:_0x26625c[_0xc755('0x30')];_0x13a57c[_0xc755('0x38')]=qs['sort'](_0x59d0bf[_0xc755('0x33')][_0xc755('0x39')]);_0x13a57c[_0xc755('0x3a')]=qs[_0xc755('0x34')](_['pick'](_0x59d0bf[_0xc755('0x33')],_0x26625c[_0xc755('0x34')]));if(_0x59d0bf['query'][_0xc755('0x58')]){_0x13a57c[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x13a57c[_0xc755('0x3a')],{'$or':_['map'](_0x13a57c[_0xc755('0x36')],function(_0x5eb060){var _0x6d95ce={};_0x6d95ce[_0x5eb060]={'$like':'%'+_0x59d0bf[_0xc755('0x33')][_0xc755('0x58')]+'%'};return _0x6d95ce;})});}_0x13a57c=_[_0xc755('0x3c')]({},_0x13a57c,_0x59d0bf[_0xc755('0x3f')]);return _0x2698af[_0xc755('0x5e')](_0x13a57c);}})[_0xc755('0x27')](function(_0x49f376){if(_0x49f376){_0x50e5a0=_0x49f376['length'];if(!_0x59d0bf[_0xc755('0x33')]['hasOwnProperty'](_0xc755('0x5a'))){_0x13a57c[_0xc755('0x1e')]=qs[_0xc755('0x1e')](_0x59d0bf[_0xc755('0x33')][_0xc755('0x1e')]);_0x13a57c[_0xc755('0x21')]=qs[_0xc755('0x21')](_0x59d0bf[_0xc755('0x33')][_0xc755('0x21')]);}return _0x2698af['getActions'](_0x13a57c);}})[_0xc755('0x27')](function(_0x18f2c3){if(_0x18f2c3){return _0x18f2c3?{'count':_0x50e5a0,'rows':_0x18f2c3}:null;}})['then'](respondWithResult(_0x17803a,null))[_0xc755('0x45')](handleError(_0x17803a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f8a5441..5c80d28 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 _0x0506=['tools_triggers','lodash','util','../../config/logger','path','../../config/environment','define','Trigger'];(function(_0x4c83fb,_0x5c8c48){var _0xd8ab84=function(_0x43d5b4){while(--_0x43d5b4){_0x4c83fb['push'](_0x4c83fb['shift']());}};_0xd8ab84(++_0x5c8c48);}(_0x0506,0x1d1));var _0x6050=function(_0x231b69,_0x1b0a39){_0x231b69=_0x231b69-0x0;var _0x21f1ae=_0x0506[_0x231b69];return _0x21f1ae;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var logger=require(_0x6050('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6050('0x3'));var rimraf=require('rimraf');var config=require(_0x6050('0x4'));var attributes=require('./trigger.attributes');module['exports']=function(_0xfd44cc,_0x269be3){return _0xfd44cc[_0x6050('0x5')](_0x6050('0x6'),attributes,{'tableName':_0x6050('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57d4=['exports','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x57d4,0x78));var _0x457d=function(_0x5f1b1f,_0x543a83){_0x5f1b1f=_0x5f1b1f-0x0;var _0x5cfc62=_0x57d4[_0x5f1b1f];return _0x5cfc62;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var logger=require('../../config/logger')(_0x457d('0x2'));var moment=require(_0x457d('0x3'));var BPromise=require(_0x457d('0x4'));var rp=require(_0x457d('0x5'));var fs=require('fs');var path=require(_0x457d('0x6'));var rimraf=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var attributes=require(_0x457d('0x9'));module[_0x457d('0xa')]=function(_0x247ec7,_0x3fd867){return _0x247ec7['define'](_0x457d('0xb'),attributes,{'tableName':_0x457d('0xc'),'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 484528c..05461f6 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 _0x846a=['../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetTrigger','findAll','options','attributes','limit','include','map','model','ShowTrigger','find','raw','where','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x846a,0x120));var _0xa846=function(_0x4d16a7,_0x3b8a63){_0x4d16a7=_0x4d16a7-0x0;var _0xb6af5b=_0x846a[_0x4d16a7];return _0xb6af5b;};'use strict';var _=require(_0xa846('0x0'));var util=require(_0xa846('0x1'));var moment=require(_0xa846('0x2'));var BPromise=require('bluebird');var rs=require(_0xa846('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa846('0x4'))['db'];var utils=require(_0xa846('0x5'));var logger=require(_0xa846('0x6'))(_0xa846('0x7'));var config=require(_0xa846('0x8'));var jayson=require(_0xa846('0x9'));var client=jayson[_0xa846('0xa')][_0xa846('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbdf92d,_0x2989d8,_0x2d1c18){return new BPromise(function(_0x506db3,_0x1b8aa0){return client[_0xa846('0xc')](_0xbdf92d,_0x2d1c18)[_0xa846('0xd')](function(_0x4a8030){logger[_0xa846('0xe')](_0xa846('0xf'),_0x2989d8,_0xa846('0x10'));logger[_0xa846('0x11')](_0xa846('0x12'),_0x2989d8,_0xa846('0x10'),JSON['stringify'](_0x4a8030));if(_0x4a8030['error']){if(_0x4a8030['error'][_0xa846('0x13')]===0x1f4){logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x4a8030[_0xa846('0x14')][_0xa846('0x15')]);return _0x1b8aa0(_0x4a8030['error'][_0xa846('0x15')]);}logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x4a8030['error'][_0xa846('0x15')]);return _0x506db3(_0x4a8030[_0xa846('0x14')]['message']);}else{logger[_0xa846('0xe')](_0xa846('0xf'),_0x2989d8,_0xa846('0x10'));_0x506db3(_0x4a8030[_0xa846('0x16')]['message']);}})[_0xa846('0x17')](function(_0x37d005){logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x37d005);_0x1b8aa0(_0x37d005);});});}exports[_0xa846('0x18')]=function(_0x24031f){var _0x540b50=this;return new Promise(function(_0xf5c724,_0x2a218e){return db['Trigger'][_0xa846('0x19')]({'raw':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24031f[_0xa846('0x1a')]?_0x24031f['options']['where']||null:null,'attributes':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1b')]||null:null,'limit':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1c')]||null:null,'include':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x24031f['options']['include'],function(_0x57b647){return{'model':db[_0x57b647[_0xa846('0x1f')]],'as':_0x57b647['as'],'attributes':_0x57b647['attributes'],'include':_0x57b647[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x57b647[_0xa846('0x1d')],function(_0x539527){return{'model':db[_0x539527[_0xa846('0x1f')]],'as':_0x539527['as'],'attributes':_0x539527[_0xa846('0x1b')],'include':_0x539527[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x539527[_0xa846('0x1d')],function(_0x47f533){return{'model':db[_0x47f533[_0xa846('0x1f')]],'as':_0x47f533['as'],'attributes':_0x47f533[_0xa846('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa846('0xd')](function(_0x48a4c8){logger[_0xa846('0xe')](_0xa846('0x18'),_0x24031f);logger['debug']('GetTrigger',_0x24031f,JSON['stringify'](_0x48a4c8));_0xf5c724(_0x48a4c8);})['catch'](function(_0x585567){logger[_0xa846('0x14')](_0xa846('0x18'),_0x585567[_0xa846('0x15')],_0x24031f);_0x2a218e(_0x540b50[_0xa846('0x14')](0x1f4,_0x585567[_0xa846('0x15')]));});});};exports[_0xa846('0x20')]=function(_0xbb1cdb){var _0x18612b=this;return new Promise(function(_0x20dfbb,_0x28e4ce){return db['Trigger'][_0xa846('0x21')]({'raw':_0xbb1cdb[_0xa846('0x1a')]?_0xbb1cdb['options'][_0xa846('0x22')]===undefined?!![]:![]:!![],'where':_0xbb1cdb['options']?_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x23')]||null:null,'attributes':_0xbb1cdb['options']?_0xbb1cdb['options']['attributes']||null:null,'include':_0xbb1cdb[_0xa846('0x1a')]?_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x1d')]?_['map'](_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x1d')],function(_0x338539){return{'model':db[_0x338539[_0xa846('0x1f')]],'as':_0x338539['as'],'attributes':_0x338539[_0xa846('0x1b')],'include':_0x338539[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x338539[_0xa846('0x1d')],function(_0x54368d){return{'model':db[_0x54368d[_0xa846('0x1f')]],'as':_0x54368d['as'],'attributes':_0x54368d[_0xa846('0x1b')],'include':_0x54368d[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x54368d[_0xa846('0x1d')],function(_0x40b1af){return{'model':db[_0x40b1af[_0xa846('0x1f')]],'as':_0x40b1af['as'],'attributes':_0x40b1af['attributes']};}):[]};}):[]};}):[]:[]})[_0xa846('0xd')](function(_0x11d204){logger[_0xa846('0xe')](_0xa846('0x20'),_0xbb1cdb);logger[_0xa846('0x11')](_0xa846('0x20'),_0xbb1cdb,JSON[_0xa846('0x24')](_0x11d204));_0x20dfbb(_0x11d204);})[_0xa846('0x17')](function(_0x1fc6b1){logger[_0xa846('0x14')](_0xa846('0x20'),_0x1fc6b1[_0xa846('0x15')],_0xbb1cdb);_0x28e4ce(_0x18612b[_0xa846('0x14')](0x1f4,_0x1fc6b1[_0xa846('0x15')]));});});}; \ No newline at end of file +var _0x8650=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowTrigger','Trigger','find','lodash'];(function(_0x5c3e11,_0x4dd35b){var _0x4e9064=function(_0x5ae0cf){while(--_0x5ae0cf){_0x5c3e11['push'](_0x5c3e11['shift']());}};_0x4e9064(++_0x4dd35b);}(_0x8650,0x15d));var _0x0865=function(_0x4a39af,_0x57894f){_0x4a39af=_0x4a39af-0x0;var _0x4ffb41=_0x8650[_0x4a39af];return _0x4ffb41;};'use strict';var _=require(_0x0865('0x0'));var util=require(_0x0865('0x1'));var moment=require(_0x0865('0x2'));var BPromise=require(_0x0865('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0865('0x4'));var logger=require(_0x0865('0x5'))(_0x0865('0x6'));var config=require(_0x0865('0x7'));var jayson=require(_0x0865('0x8'));var client=jayson[_0x0865('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b4d9,_0x4632b1,_0x2c3779){return new BPromise(function(_0x19d8cb,_0x591cc7){return client[_0x0865('0xa')](_0x27b4d9,_0x2c3779)[_0x0865('0xb')](function(_0x2431be){logger[_0x0865('0xc')](_0x0865('0xd'),_0x4632b1,_0x0865('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4632b1,_0x0865('0xe'),JSON[_0x0865('0xf')](_0x2431be));if(_0x2431be[_0x0865('0x10')]){if(_0x2431be['error'][_0x0865('0x11')]===0x1f4){logger['error'](_0x0865('0xd'),_0x4632b1,_0x2431be[_0x0865('0x10')][_0x0865('0x12')]);return _0x591cc7(_0x2431be['error'][_0x0865('0x12')]);}logger['error'](_0x0865('0xd'),_0x4632b1,_0x2431be['error'][_0x0865('0x12')]);return _0x19d8cb(_0x2431be[_0x0865('0x10')]['message']);}else{logger[_0x0865('0xc')](_0x0865('0xd'),_0x4632b1,_0x0865('0xe'));_0x19d8cb(_0x2431be[_0x0865('0x13')][_0x0865('0x12')]);}})[_0x0865('0x14')](function(_0x344113){logger['error'](_0x0865('0xd'),_0x4632b1,_0x344113);_0x591cc7(_0x344113);});});}exports[_0x0865('0x15')]=function(_0x449522){var _0x48591e=this;return new Promise(function(_0x6d0ae5,_0xbc076c){return db['Trigger'][_0x0865('0x16')]({'raw':_0x449522['options']?_0x449522[_0x0865('0x17')][_0x0865('0x18')]===undefined?!![]:![]:!![],'where':_0x449522['options']?_0x449522[_0x0865('0x17')][_0x0865('0x19')]||null:null,'attributes':_0x449522[_0x0865('0x17')]?_0x449522['options'][_0x0865('0x1a')]||null:null,'limit':_0x449522[_0x0865('0x17')]?_0x449522['options'][_0x0865('0x1b')]||null:null,'include':_0x449522['options']?_0x449522['options']['include']?_[_0x0865('0x1c')](_0x449522['options'][_0x0865('0x1d')],function(_0x31984d){return{'model':db[_0x31984d[_0x0865('0x1e')]],'as':_0x31984d['as'],'attributes':_0x31984d[_0x0865('0x1a')],'include':_0x31984d[_0x0865('0x1d')]?_[_0x0865('0x1c')](_0x31984d['include'],function(_0x2eff03){return{'model':db[_0x2eff03[_0x0865('0x1e')]],'as':_0x2eff03['as'],'attributes':_0x2eff03[_0x0865('0x1a')],'include':_0x2eff03['include']?_[_0x0865('0x1c')](_0x2eff03[_0x0865('0x1d')],function(_0x2d99d0){return{'model':db[_0x2d99d0[_0x0865('0x1e')]],'as':_0x2d99d0['as'],'attributes':_0x2d99d0[_0x0865('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0865('0xb')](function(_0x5bfe39){logger[_0x0865('0xc')](_0x0865('0x15'),_0x449522);logger[_0x0865('0x1f')](_0x0865('0x15'),_0x449522,JSON['stringify'](_0x5bfe39));_0x6d0ae5(_0x5bfe39);})[_0x0865('0x14')](function(_0x578171){logger[_0x0865('0x10')](_0x0865('0x15'),_0x578171[_0x0865('0x12')],_0x449522);_0xbc076c(_0x48591e[_0x0865('0x10')](0x1f4,_0x578171[_0x0865('0x12')]));});});};exports[_0x0865('0x20')]=function(_0x5e40ef){var _0x22b102=this;return new Promise(function(_0x233d3c,_0x388a3c){return db[_0x0865('0x21')][_0x0865('0x22')]({'raw':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')][_0x0865('0x19')]||null:null,'attributes':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')]['attributes']||null:null,'include':_0x5e40ef['options']?_0x5e40ef[_0x0865('0x17')][_0x0865('0x1d')]?_['map'](_0x5e40ef[_0x0865('0x17')]['include'],function(_0x224821){return{'model':db[_0x224821[_0x0865('0x1e')]],'as':_0x224821['as'],'attributes':_0x224821[_0x0865('0x1a')],'include':_0x224821[_0x0865('0x1d')]?_[_0x0865('0x1c')](_0x224821[_0x0865('0x1d')],function(_0x567ada){return{'model':db[_0x567ada[_0x0865('0x1e')]],'as':_0x567ada['as'],'attributes':_0x567ada[_0x0865('0x1a')],'include':_0x567ada['include']?_[_0x0865('0x1c')](_0x567ada[_0x0865('0x1d')],function(_0x4d7313){return{'model':db[_0x4d7313['model']],'as':_0x4d7313['as'],'attributes':_0x4d7313['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ef00){logger['info'](_0x0865('0x20'),_0x5e40ef);logger[_0x0865('0x1f')](_0x0865('0x20'),_0x5e40ef,JSON[_0x0865('0xf')](_0x50ef00));_0x233d3c(_0x50ef00);})[_0x0865('0x14')](function(_0x44c11e){logger[_0x0865('0x10')](_0x0865('0x20'),_0x44c11e[_0x0865('0x12')],_0x5e40ef);_0x388a3c(_0x22b102['error'](0x1f4,_0x44c11e[_0x0865('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 65972fe..5e407d2 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 _0xee5f=['post','/:id/clone','clone','create','put','update','delete','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show'];(function(_0xe721f4,_0x11232c){var _0x462583=function(_0x81bba1){while(--_0x81bba1){_0xe721f4['push'](_0xe721f4['shift']());}};_0x462583(++_0x11232c);}(_0xee5f,0x13a));var _0xfee5=function(_0x50d145,_0x4bab6e){_0x50d145=_0x50d145-0x0;var _0x549748=_0xee5f[_0x50d145];return _0x549748;};'use strict';var multer=require('multer');var util=require(_0xfee5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfee5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfee5('0x2'));var interaction=require(_0xfee5('0x3'));var config=require(_0xfee5('0x4'));var controller=require(_0xfee5('0x5'));router[_0xfee5('0x6')]('/',auth[_0xfee5('0x7')](),controller['index']);router['get'](_0xfee5('0x8'),auth[_0xfee5('0x7')](),controller[_0xfee5('0x9')]);router[_0xfee5('0xa')](_0xfee5('0xb'),auth['isAuthenticated'](),controller[_0xfee5('0xc')]);router[_0xfee5('0xa')]('/',auth[_0xfee5('0x7')](),controller[_0xfee5('0xd')]);router[_0xfee5('0xe')](_0xfee5('0x8'),auth[_0xfee5('0x7')](),controller[_0xfee5('0xf')]);router[_0xfee5('0x10')](_0xfee5('0x8'),auth[_0xfee5('0x7')](),controller['destroy']);module[_0xfee5('0x11')]=router; \ No newline at end of file +var _0x4436=['get','isAuthenticated','/:id','clone','post','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0x4ef29c,_0x34b9fd){var _0x3f4ce1=function(_0x429442){while(--_0x429442){_0x4ef29c['push'](_0x4ef29c['shift']());}};_0x3f4ce1(++_0x34b9fd);}(_0x4436,0x127));var _0x6443=function(_0xab85b4,_0x4f2e8b){_0xab85b4=_0xab85b4-0x0;var _0x4cb733=_0x4436[_0xab85b4];return _0x4cb733;};'use strict';var multer=require('multer');var util=require(_0x6443('0x0'));var path=require('path');var timeout=require(_0x6443('0x1'));var express=require(_0x6443('0x2'));var router=express[_0x6443('0x3')]();var fs_extra=require(_0x6443('0x4'));var auth=require(_0x6443('0x5'));var interaction=require(_0x6443('0x6'));var config=require(_0x6443('0x7'));var controller=require(_0x6443('0x8'));router[_0x6443('0x9')]('/',auth[_0x6443('0xa')](),controller['index']);router['get'](_0x6443('0xb'),auth[_0x6443('0xa')](),controller['show']);router['post']('/:id/clone',auth[_0x6443('0xa')](),controller[_0x6443('0xc')]);router[_0x6443('0xd')]('/',auth[_0x6443('0xa')](),controller[_0x6443('0xe')]);router[_0x6443('0xf')](_0x6443('0xb'),auth['isAuthenticated'](),controller[_0x6443('0x10')]);router['delete'](_0x6443('0xb'),auth[_0x6443('0xa')](),controller[_0x6443('0x11')]);module[_0x6443('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b411fea..c21a3ed 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 _0x1e0a=['shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','nonat','update,nonat','BOOLEAN','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x2e1b2b,_0x146d74){var _0x3e53e0=function(_0x120dbe){while(--_0x120dbe){_0x2e1b2b['push'](_0x2e1b2b['shift']());}};_0x3e53e0(++_0x146d74);}(_0x1e0a,0x191));var _0xa1e0=function(_0x4f957f,_0x5a1315){_0x4f957f=_0x4f957f-0x0;var _0x35a559=_0x1e0a[_0x4f957f];return _0x35a559;};'use strict';var Sequelize=require('sequelize');module[_0xa1e0('0x0')]={'name':{'type':Sequelize[_0xa1e0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x3'),_0xa1e0('0x4'),_0xa1e0('0x5')),'allowNull':![],'defaultValue':_0xa1e0('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa1e0('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xa1e0('0x7'),_0xa1e0('0x8'),_0xa1e0('0x9'),_0xa1e0('0xa'),_0xa1e0('0xb'),_0xa1e0('0xc'),_0xa1e0('0xd'),_0xa1e0('0xe'))},'deny':{'type':Sequelize[_0xa1e0('0x1')]},'permit':{'type':Sequelize[_0xa1e0('0x1')]},'secret':{'type':Sequelize[_0xa1e0('0x1')]},'md5secret':{'type':Sequelize[_0xa1e0('0x1')]},'remotesecret':{'type':Sequelize[_0xa1e0('0x1')]},'transport':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':'udp','set':function(_0x5d5994){this[_0xa1e0('0xf')](_0xa1e0('0x10'),_0x5d5994?_0x5d5994[_0xa1e0('0x11')](','):null);},'get':function(){return this[_0xa1e0('0x12')](_0xa1e0('0x10'))?this[_0xa1e0('0x12')](_0xa1e0('0x10'))[_0xa1e0('0x13')](','):null;},'comment':_0xa1e0('0x14')},'dtmfmode':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x15'),_0xa1e0('0x16'),_0xa1e0('0x17'),_0xa1e0('0x18'),_0xa1e0('0x19')),'defaultValue':_0xa1e0('0x15')},'directmedia':{'type':Sequelize[_0xa1e0('0x2')]('yes','no','nonat',_0xa1e0('0x1a'),_0xa1e0('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':_0xa1e0('0x1d'),'set':function(_0x2425b4){this[_0xa1e0('0xf')](_0xa1e0('0x1e'),_0x2425b4?_0x2425b4['join'](','):null);},'get':function(){return this[_0xa1e0('0x12')]('nat')?this[_0xa1e0('0x12')](_0xa1e0('0x1e'))[_0xa1e0('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa1e0('0x1')]},'namedcallgroup':{'type':Sequelize[_0xa1e0('0x1')]},'pickupgroup':{'type':Sequelize[_0xa1e0('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa1e0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':_0xa1e0('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa1e0('0x20'),'set':function(_0x27c451){this[_0xa1e0('0xf')]('allow',_0x27c451?_0x27c451[_0xa1e0('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xa1e0('0x12')](_0xa1e0('0x21'))?this[_0xa1e0('0x12')](_0xa1e0('0x21'))[_0xa1e0('0x13')](';'):null;},'comment':_0xa1e0('0x22')},'autoframing':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'insecure':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':_0xa1e0('0x23'),'set':function(_0x5815cb){this['setDataValue'](_0xa1e0('0x24'),_0x5815cb?_0x5815cb['join'](','):null);},'get':function(){return this['getDataValue'](_0xa1e0('0x24'))?this[_0xa1e0('0x12')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xa1e0('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa1e0('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no',_0xa1e0('0x25'))},'promiscredir':{'type':Sequelize[_0xa1e0('0x2')]('yes','no')},'useclientcode':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'accountcode':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'setvar':{'type':Sequelize[_0xa1e0('0x1')]},'callerid':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':_0xa1e0('0x27')},'amaflags':{'type':Sequelize[_0xa1e0('0x1')]},'callcounter':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no'),'defaultValue':_0xa1e0('0x1c')},'busylevel':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xa1e0('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0xa1e0('0x1c'),'no',_0xa1e0('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'mailbox':{'type':Sequelize[_0xa1e0('0x1')]},'session_timers':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x29'),_0xa1e0('0x2a'),_0xa1e0('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x2c'),_0xa1e0('0x2d')),'defaultValue':_0xa1e0('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xa1e0('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xa1e0('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa1e0('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xa1e0('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xa1e0('0x1')]},'rtptimeout':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xa1e0('0x2')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa1e0('0x1')]},'contactacl':{'type':Sequelize[_0xa1e0('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xa1e0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xa1e0('0x1')]},'maxforwards':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa1e0('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'force_avp':{'type':Sequelize[_0xa1e0('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no')},'dtlsverify':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no',_0xa1e0('0x2e'),_0xa1e0('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xa1e0('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa1e0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xa1e0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xa1e0('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x30'),_0xa1e0('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa1e0('0x1')]},'usereqphone':{'type':Sequelize[_0xa1e0('0x2')](_0xa1e0('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa1e0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa1e0('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xa1e0('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0xa1e0('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa1e0('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xa1e0('0x2')]('yes','no',_0xa1e0('0x32'),'update',_0xa1e0('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa1e0('0x1')]},'otherFields':{'type':Sequelize[_0xa1e0('0x1')]},'active':{'type':Sequelize[_0xa1e0('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa1e0('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1bb1=['originate','uac','uas','pai','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','user','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse'];(function(_0x15fb84,_0x5f0b76){var _0x30c87c=function(_0x2c1312){while(--_0x2c1312){_0x15fb84['push'](_0x15fb84['shift']());}};_0x30c87c(++_0x5f0b76);}(_0x1bb1,0x16e));var _0x11bb=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1bb1[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x11bb('0x0'));module[_0x11bb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x3'),_0x11bb('0x4'),_0x11bb('0x5')),'allowNull':![],'defaultValue':_0x11bb('0x3')},'context':{'type':Sequelize[_0x11bb('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x11bb('0x7'),'ALLOWED_FAILED_SCREEN',_0x11bb('0x8'),_0x11bb('0x9'),_0x11bb('0xa'),_0x11bb('0xb'),_0x11bb('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x11bb('0x6')]},'secret':{'type':Sequelize[_0x11bb('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x11bb('0x6')]},'transport':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':'udp','set':function(_0x277c1c){this[_0x11bb('0xd')](_0x11bb('0xe'),_0x277c1c?_0x277c1c[_0x11bb('0xf')](','):null);},'get':function(){return this[_0x11bb('0x10')]('transport')?this[_0x11bb('0x10')](_0x11bb('0xe'))[_0x11bb('0x11')](','):null;},'comment':_0x11bb('0x12')},'dtmfmode':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x13'),_0x11bb('0x14'),'shortinfo',_0x11bb('0x15'),_0x11bb('0x16')),'defaultValue':_0x11bb('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no',_0x11bb('0x18'),_0x11bb('0x19'),_0x11bb('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x11bb('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x11bb('0x6')]},'directmediadeny':{'type':Sequelize[_0x11bb('0x6')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x11bb('0x1b'),'set':function(_0x1b20d9){this[_0x11bb('0xd')](_0x11bb('0x1c'),_0x1b20d9?_0x1b20d9[_0x11bb('0xf')](','):null);},'get':function(){return this[_0x11bb('0x10')](_0x11bb('0x1c'))?this[_0x11bb('0x10')](_0x11bb('0x1c'))['split'](','):null;},'comment':_0x11bb('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x11bb('0x6')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x11bb('0x6')]},'language':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x11bb('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11bb('0x1f'),'set':function(_0x5317a6){this['setDataValue']('allow',_0x5317a6?_0x5317a6['join'](';'):_0x11bb('0x1f'));},'get':function(){return this[_0x11bb('0x10')]('allow')?this[_0x11bb('0x10')]('allow')[_0x11bb('0x11')](';'):null;},'comment':_0x11bb('0x20')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x11bb('0x21'),'set':function(_0x3982e3){this[_0x11bb('0xd')](_0x11bb('0x22'),_0x3982e3?_0x3982e3['join'](','):null);},'get':function(){return this[_0x11bb('0x10')](_0x11bb('0x22'))?this[_0x11bb('0x10')](_0x11bb('0x22'))['split'](','):null;},'comment':_0x11bb('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x24'))},'promiscredir':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'accountcode':{'type':Sequelize[_0x11bb('0x25')](0xb)},'setvar':{'type':Sequelize[_0x11bb('0x6')]},'callerid':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x26')},'amaflags':{'type':Sequelize[_0x11bb('0x6')]},'callcounter':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':_0x11bb('0x17')},'busylevel':{'type':Sequelize[_0x11bb('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x11bb('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x11bb('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x11bb('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x11bb('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0x11bb('0x28'),_0x11bb('0x29'),_0x11bb('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x2b'),'uas'),'defaultValue':_0x11bb('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x11bb('0x6')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x11bb('0x6')]},'fromuser':{'type':Sequelize[_0x11bb('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x11bb('0x2')]('yes','no'),'defaultValue':_0x11bb('0x17')},'keepalive':{'type':Sequelize[_0x11bb('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x11bb('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x11bb('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x11bb('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x11bb('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x11bb('0x25')](0xb)},'timerb':{'type':Sequelize[_0x11bb('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x11bb('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x11bb('0x6')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x11bb('0x6')]},'maxforwards':{'type':Sequelize[_0x11bb('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'force_avp':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x11bb('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x11bb('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x11bb('0x6')]},'dtlscipher':{'type':Sequelize[_0x11bb('0x6')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x11bb('0x6')]},'dtlssetup':{'type':Sequelize[_0x11bb('0x2')]('active',_0x11bb('0x2e'),_0x11bb('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x11bb('0x6')]},'usereqphone':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x11bb('0x6')]},'recordofffeature':{'type':Sequelize[_0x11bb('0x6')]},'call_limit':{'type':Sequelize[_0x11bb('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x11bb('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x11bb('0x6')]},'description':{'type':Sequelize[_0x11bb('0x6')]},'host':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x30')},'canreinvite':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x18'),_0x11bb('0x19'),_0x11bb('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x11bb('0x6')]},'active':{'type':Sequelize[_0x11bb('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x11bb('0x6')],'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 f120ffa..a173783 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x9f62,0x154));var _0x29f6=function(_0x1f6f9d,_0x13112d){_0x1f6f9d=_0x1f6f9d-0x0;var _0x4cbf9f=_0x9f62[_0x1f6f9d];return _0x4cbf9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0xf1d63,_0x5a3021){var _0x1d702d=function(_0x1c527e){while(--_0x1c527e){_0xf1d63['push'](_0xf1d63['shift']());}};_0x1d702d(++_0x5a3021);}(_0x54ef,0x112));var _0xf54e=function(_0x2ffb1f,_0x1242e2){_0x2ffb1f=_0x2ffb1f-0x0;var _0x1eb104=_0x54ef[_0x2ffb1f];return _0x1eb104;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a9437e9..359261b 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 _0xcbe5=['api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','Trunk','tools_trunks','lodash','../../config/logger'];(function(_0x58e191,_0x1f3dc5){var _0x5a3877=function(_0x239a3f){while(--_0x239a3f){_0x58e191['push'](_0x58e191['shift']());}};_0x5a3877(++_0x1f3dc5);}(_0xcbe5,0x1ed));var _0x5cbe=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcbe5[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5cbe('0x0'));var util=require('util');var logger=require(_0x5cbe('0x1'))(_0x5cbe('0x2'));var moment=require(_0x5cbe('0x3'));var BPromise=require('bluebird');var rp=require(_0x5cbe('0x4'));var fs=require('fs');var path=require(_0x5cbe('0x5'));var rimraf=require(_0x5cbe('0x6'));var config=require(_0x5cbe('0x7'));var attributes=require(_0x5cbe('0x8'));module['exports']=function(_0x3e93a3,_0x4ee05d){return _0x3e93a3['define'](_0x5cbe('0x9'),attributes,{'tableName':_0x5cbe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7399=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','../../config/logger'];(function(_0x5c2829,_0x2e1482){var _0x4d6544=function(_0x63b01e){while(--_0x63b01e){_0x5c2829['push'](_0x5c2829['shift']());}};_0x4d6544(++_0x2e1482);}(_0x7399,0x1dc));var _0x9739=function(_0x2c0a00,_0x3548e4){_0x2c0a00=_0x2c0a00-0x0;var _0x119901=_0x7399[_0x2c0a00];return _0x119901;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9739('0x0'))('api');var moment=require(_0x9739('0x1'));var BPromise=require(_0x9739('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9739('0x3'));var rimraf=require(_0x9739('0x4'));var config=require(_0x9739('0x5'));var attributes=require(_0x9739('0x6'));module[_0x9739('0x7')]=function(_0x5669f2,_0x148ee7){return _0x5669f2['define'](_0x9739('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 15c6faa..8efa0d0 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 _0xd3f3=['stringify','error','code','message','info','result','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowTrunk','Trunk','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x293374,_0x44caf5){var _0x3900a2=function(_0x4152a8){while(--_0x4152a8){_0x293374['push'](_0x293374['shift']());}};_0x3900a2(++_0x44caf5);}(_0xd3f3,0x81));var _0x3d3f=function(_0x147e5c,_0x29a549){_0x147e5c=_0x147e5c-0x0;var _0x3d28d7=_0xd3f3[_0x147e5c];return _0x3d28d7;};'use strict';var _=require(_0x3d3f('0x0'));var util=require('util');var moment=require(_0x3d3f('0x1'));var BPromise=require(_0x3d3f('0x2'));var rs=require(_0x3d3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d3f('0x5'))(_0x3d3f('0x6'));var config=require(_0x3d3f('0x7'));var jayson=require(_0x3d3f('0x8'));var client=jayson[_0x3d3f('0x9')][_0x3d3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afd78,_0x3204cd,_0x2cc573){return new BPromise(function(_0x457141,_0xa4b2f8){return client['request'](_0x5afd78,_0x2cc573)[_0x3d3f('0xb')](function(_0x14dde2){logger['info'](_0x3d3f('0xc'),_0x3204cd,_0x3d3f('0xd'));logger['debug'](_0x3d3f('0xe'),_0x3204cd,_0x3d3f('0xd'),JSON[_0x3d3f('0xf')](_0x14dde2));if(_0x14dde2['error']){if(_0x14dde2[_0x3d3f('0x10')][_0x3d3f('0x11')]===0x1f4){logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x14dde2['error'][_0x3d3f('0x12')]);return _0xa4b2f8(_0x14dde2[_0x3d3f('0x10')]['message']);}logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x14dde2[_0x3d3f('0x10')][_0x3d3f('0x12')]);return _0x457141(_0x14dde2['error'][_0x3d3f('0x12')]);}else{logger[_0x3d3f('0x13')]('Trunk,\x20%s,\x20%s',_0x3204cd,'request\x20sent');_0x457141(_0x14dde2[_0x3d3f('0x14')][_0x3d3f('0x12')]);}})[_0x3d3f('0x15')](function(_0x1d6e0a){logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x1d6e0a);_0xa4b2f8(_0x1d6e0a);});});}exports[_0x3d3f('0x16')]=function(_0xb1cbee){var _0x2c68b4=this;return new Promise(function(_0x3ecfc9,_0xea065d){return db['Trunk'][_0x3d3f('0x17')]({'raw':_0xb1cbee[_0x3d3f('0x18')]?_0xb1cbee['options'][_0x3d3f('0x19')]===undefined?!![]:![]:!![],'where':_0xb1cbee[_0x3d3f('0x18')]?_0xb1cbee[_0x3d3f('0x18')][_0x3d3f('0x1a')]||null:null,'attributes':_0xb1cbee[_0x3d3f('0x18')]?_0xb1cbee['options'][_0x3d3f('0x1b')]||null:null,'limit':_0xb1cbee[_0x3d3f('0x18')]?_0xb1cbee[_0x3d3f('0x18')][_0x3d3f('0x1c')]||null:null,'include':_0xb1cbee[_0x3d3f('0x18')]?_0xb1cbee[_0x3d3f('0x18')][_0x3d3f('0x1d')]?_['map'](_0xb1cbee[_0x3d3f('0x18')]['include'],function(_0x27f200){return{'model':db[_0x27f200[_0x3d3f('0x1e')]],'as':_0x27f200['as'],'attributes':_0x27f200[_0x3d3f('0x1b')],'include':_0x27f200[_0x3d3f('0x1d')]?_['map'](_0x27f200[_0x3d3f('0x1d')],function(_0x38e23f){return{'model':db[_0x38e23f[_0x3d3f('0x1e')]],'as':_0x38e23f['as'],'attributes':_0x38e23f[_0x3d3f('0x1b')],'include':_0x38e23f[_0x3d3f('0x1d')]?_[_0x3d3f('0x1f')](_0x38e23f[_0x3d3f('0x1d')],function(_0x4db895){return{'model':db[_0x4db895[_0x3d3f('0x1e')]],'as':_0x4db895['as'],'attributes':_0x4db895[_0x3d3f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x191512){logger['info'](_0x3d3f('0x16'),_0xb1cbee);logger[_0x3d3f('0x20')]('GetTrunk',_0xb1cbee,JSON['stringify'](_0x191512));_0x3ecfc9(_0x191512);})[_0x3d3f('0x15')](function(_0x452b8e){logger[_0x3d3f('0x10')](_0x3d3f('0x16'),_0x452b8e['message'],_0xb1cbee);_0xea065d(_0x2c68b4[_0x3d3f('0x10')](0x1f4,_0x452b8e['message']));});});};exports[_0x3d3f('0x21')]=function(_0x3f1471){var _0x53d55b=this;return new Promise(function(_0xa375f4,_0x4365d5){return db[_0x3d3f('0x22')][_0x3d3f('0x23')]({'raw':_0x3f1471[_0x3d3f('0x18')]?_0x3f1471[_0x3d3f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f1471['options']?_0x3f1471[_0x3d3f('0x18')][_0x3d3f('0x1a')]||null:null,'attributes':_0x3f1471['options']?_0x3f1471[_0x3d3f('0x18')][_0x3d3f('0x1b')]||null:null,'include':_0x3f1471['options']?_0x3f1471[_0x3d3f('0x18')]['include']?_[_0x3d3f('0x1f')](_0x3f1471['options'][_0x3d3f('0x1d')],function(_0x3d5e9c){return{'model':db[_0x3d5e9c[_0x3d3f('0x1e')]],'as':_0x3d5e9c['as'],'attributes':_0x3d5e9c[_0x3d3f('0x1b')],'include':_0x3d5e9c[_0x3d3f('0x1d')]?_[_0x3d3f('0x1f')](_0x3d5e9c['include'],function(_0x41133b){return{'model':db[_0x41133b[_0x3d3f('0x1e')]],'as':_0x41133b['as'],'attributes':_0x41133b['attributes'],'include':_0x41133b[_0x3d3f('0x1d')]?_[_0x3d3f('0x1f')](_0x41133b[_0x3d3f('0x1d')],function(_0x32eb7d){return{'model':db[_0x32eb7d['model']],'as':_0x32eb7d['as'],'attributes':_0x32eb7d[_0x3d3f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3d3f('0xb')](function(_0x1d2792){logger['info'](_0x3d3f('0x21'),_0x3f1471);logger[_0x3d3f('0x20')]('ShowTrunk',_0x3f1471,JSON[_0x3d3f('0xf')](_0x1d2792));_0xa375f4(_0x1d2792);})['catch'](function(_0x54708b){logger[_0x3d3f('0x10')](_0x3d3f('0x21'),_0x54708b[_0x3d3f('0x12')],_0x3f1471);_0x4365d5(_0x53d55b[_0x3d3f('0x10')](0x1f4,_0x54708b[_0x3d3f('0x12')]));});});}; \ No newline at end of file +var _0xa730=['jayson/promise','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xa730,0x10f));var _0x0a73=function(_0x552fa5,_0x16235a){_0x552fa5=_0x552fa5-0x0;var _0x26559d=_0xa730[_0x552fa5];return _0x26559d;};'use strict';var _=require(_0x0a73('0x0'));var util=require(_0x0a73('0x1'));var moment=require(_0x0a73('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a73('0x3'));var fs=require('fs');var Redis=require(_0x0a73('0x4'));var db=require(_0x0a73('0x5'))['db'];var utils=require(_0x0a73('0x6'));var logger=require('../../config/logger')(_0x0a73('0x7'));var config=require(_0x0a73('0x8'));var jayson=require(_0x0a73('0x9'));var client=jayson['client'][_0x0a73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a9539,_0x166046,_0x5c00b6){return new BPromise(function(_0x544382,_0x498b53){return client[_0x0a73('0xb')](_0x4a9539,_0x5c00b6)['then'](function(_0x308364){logger[_0x0a73('0xc')](_0x0a73('0xd'),_0x166046,_0x0a73('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x166046,_0x0a73('0xe'),JSON['stringify'](_0x308364));if(_0x308364[_0x0a73('0xf')]){if(_0x308364[_0x0a73('0xf')][_0x0a73('0x10')]===0x1f4){logger[_0x0a73('0xf')](_0x0a73('0xd'),_0x166046,_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);return _0x498b53(_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);}logger[_0x0a73('0xf')](_0x0a73('0xd'),_0x166046,_0x308364[_0x0a73('0xf')]['message']);return _0x544382(_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);}else{logger[_0x0a73('0xc')](_0x0a73('0xd'),_0x166046,_0x0a73('0xe'));_0x544382(_0x308364['result']['message']);}})[_0x0a73('0x12')](function(_0x198068){logger['error']('Trunk,\x20%s,\x20%s',_0x166046,_0x198068);_0x498b53(_0x198068);});});}exports[_0x0a73('0x13')]=function(_0x32b676){var _0x12c1b3=this;return new Promise(function(_0x1b1f08,_0x2381c5){return db[_0x0a73('0x14')][_0x0a73('0x15')]({'raw':_0x32b676['options']?_0x32b676[_0x0a73('0x16')][_0x0a73('0x17')]===undefined?!![]:![]:!![],'where':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x18')]||null:null,'attributes':_0x32b676[_0x0a73('0x16')]?_0x32b676['options'][_0x0a73('0x19')]||null:null,'limit':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x1a')]||null:null,'include':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x32b676[_0x0a73('0x16')][_0x0a73('0x1b')],function(_0x24820f){return{'model':db[_0x24820f[_0x0a73('0x1d')]],'as':_0x24820f['as'],'attributes':_0x24820f['attributes'],'include':_0x24820f[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x24820f[_0x0a73('0x1b')],function(_0x3fe447){return{'model':db[_0x3fe447['model']],'as':_0x3fe447['as'],'attributes':_0x3fe447[_0x0a73('0x19')],'include':_0x3fe447[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x3fe447[_0x0a73('0x1b')],function(_0x2b098d){return{'model':db[_0x2b098d['model']],'as':_0x2b098d['as'],'attributes':_0x2b098d[_0x0a73('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a73('0x1e')](function(_0x34f9ca){logger[_0x0a73('0xc')](_0x0a73('0x13'),_0x32b676);logger[_0x0a73('0x1f')](_0x0a73('0x13'),_0x32b676,JSON[_0x0a73('0x20')](_0x34f9ca));_0x1b1f08(_0x34f9ca);})[_0x0a73('0x12')](function(_0x2d707f){logger[_0x0a73('0xf')](_0x0a73('0x13'),_0x2d707f['message'],_0x32b676);_0x2381c5(_0x12c1b3[_0x0a73('0xf')](0x1f4,_0x2d707f[_0x0a73('0x11')]));});});};exports['ShowTrunk']=function(_0x22c9e3){var _0x43d925=this;return new Promise(function(_0x11373e,_0x3e5397){return db[_0x0a73('0x14')][_0x0a73('0x21')]({'raw':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3['options']['raw']===undefined?!![]:![]:!![],'where':_0x22c9e3['options']?_0x22c9e3['options'][_0x0a73('0x18')]||null:null,'attributes':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x19')]||null:null,'include':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x1b')],function(_0x5e5fd8){return{'model':db[_0x5e5fd8[_0x0a73('0x1d')]],'as':_0x5e5fd8['as'],'attributes':_0x5e5fd8[_0x0a73('0x19')],'include':_0x5e5fd8[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x5e5fd8[_0x0a73('0x1b')],function(_0x2ddbe0){return{'model':db[_0x2ddbe0[_0x0a73('0x1d')]],'as':_0x2ddbe0['as'],'attributes':_0x2ddbe0[_0x0a73('0x19')],'include':_0x2ddbe0[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x2ddbe0['include'],function(_0x322777){return{'model':db[_0x322777[_0x0a73('0x1d')]],'as':_0x322777['as'],'attributes':_0x322777[_0x0a73('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a73('0x1e')](function(_0x51547c){logger[_0x0a73('0xc')](_0x0a73('0x22'),_0x22c9e3);logger[_0x0a73('0x1f')](_0x0a73('0x22'),_0x22c9e3,JSON[_0x0a73('0x20')](_0x51547c));_0x11373e(_0x51547c);})[_0x0a73('0x12')](function(_0x11dd50){logger['error'](_0x0a73('0x22'),_0x11dd50[_0x0a73('0x11')],_0x22c9e3);_0x3e5397(_0x43d925[_0x0a73('0xf')](0x1f4,_0x11dd50[_0x0a73('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 08ea827..2f2030c 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 _0x13d8=['changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','/:id/api_key','removeApiKey','exports','multer','util','path','express','fs-extra','../../components/auth/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getGroups','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id','update','/:id/password'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x13d8,0x84));var _0x813d=function(_0x4d0e70,_0x2e3f71){_0x4d0e70=_0x4d0e70-0x0;var _0x5c8226=_0x13d8[_0x4d0e70];return _0x5c8226;};'use strict';var multer=require(_0x813d('0x0'));var util=require(_0x813d('0x1'));var path=require(_0x813d('0x2'));var timeout=require('connect-timeout');var express=require(_0x813d('0x3'));var router=express['Router']();var fs_extra=require(_0x813d('0x4'));var auth=require(_0x813d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x813d('0x6'));router[_0x813d('0x7')]('/',auth[_0x813d('0x8')](),controller[_0x813d('0x9')]);router['get'](_0x813d('0xa'),auth[_0x813d('0x8')](),controller[_0x813d('0xb')]);router[_0x813d('0x7')](_0x813d('0xc'),auth[_0x813d('0x8')](),controller[_0x813d('0xd')]);router[_0x813d('0x7')](_0x813d('0xe'),auth[_0x813d('0x8')](),controller[_0x813d('0xf')]);router[_0x813d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x813d('0x10')]);router[_0x813d('0x7')]('/:id/avatar',controller[_0x813d('0x11')]);router[_0x813d('0x7')](_0x813d('0x12'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x813d('0x7')](_0x813d('0x13'),auth[_0x813d('0x8')](),controller[_0x813d('0x14')]);router[_0x813d('0x7')](_0x813d('0x15'),auth['isAuthenticated'](),controller[_0x813d('0x16')]);router[_0x813d('0x7')](_0x813d('0x17'),auth[_0x813d('0x8')](),controller['getVoiceQueuesRt']);router[_0x813d('0x7')]('/:id/groups',auth[_0x813d('0x8')](),controller[_0x813d('0x18')]);router['get']('/:id/recordings',auth[_0x813d('0x8')](),controller[_0x813d('0x19')]);router['get']('/:id/screen_recordings',auth[_0x813d('0x8')](),controller['getScreenRecordings']);router[_0x813d('0x7')](_0x813d('0x1a'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0x813d('0x1b'),auth['isAuthenticated'](),controller[_0x813d('0x1c')]);router[_0x813d('0x7')](_0x813d('0x1d'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x813d('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x813d('0x1e')]);router[_0x813d('0x7')](_0x813d('0x1f'),auth[_0x813d('0x8')](),controller['getFaxInteractions']);router[_0x813d('0x7')]('/:id/whatsapp/interactions',auth[_0x813d('0x8')](),controller[_0x813d('0x20')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x813d('0x21')]);router[_0x813d('0x7')](_0x813d('0x22'),auth[_0x813d('0x8')](),controller[_0x813d('0x23')]);router[_0x813d('0x7')](_0x813d('0x24'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x813d('0x25'),auth[_0x813d('0x8')](),controller['getVoicePrefixes']);router[_0x813d('0x7')](_0x813d('0x26'),auth[_0x813d('0x8')](),controller[_0x813d('0x27')]);router['get']('/:id/mail_accounts',auth[_0x813d('0x8')](),controller[_0x813d('0x28')]);router[_0x813d('0x7')](_0x813d('0x29'),auth[_0x813d('0x8')](),controller[_0x813d('0x2a')]);router[_0x813d('0x7')](_0x813d('0x2b'),auth[_0x813d('0x8')](),controller['getSmsAccounts']);router[_0x813d('0x7')](_0x813d('0x2c'),auth[_0x813d('0x8')](),controller[_0x813d('0x2d')]);router['get'](_0x813d('0x2e'),auth[_0x813d('0x8')](),controller[_0x813d('0x2f')]);router['get'](_0x813d('0x30'),auth[_0x813d('0x8')](),controller[_0x813d('0x31')]);router[_0x813d('0x7')](_0x813d('0x32'),auth[_0x813d('0x8')](),controller[_0x813d('0x33')]);router[_0x813d('0x7')]('/:id/api_key',auth[_0x813d('0x8')](),controller['getApiKey']);router['post'](_0x813d('0x13'),auth['isAuthenticated'](),controller[_0x813d('0x34')]);router[_0x813d('0x35')]('/',auth['isAuthenticated'](),controller[_0x813d('0x36')]);router[_0x813d('0x35')](_0x813d('0x37'),auth['isAuthenticated'](),controller[_0x813d('0x38')]);router['post'](_0x813d('0x15'),auth[_0x813d('0x8')](),controller[_0x813d('0x39')]);var upload=multer({'storage':multer[_0x813d('0x3a')]({'destination':function(_0x59f416,_0x2c153f,_0x25becd){_0x25becd(null,path[_0x813d('0x3b')](config[_0x813d('0x3c')],_0x813d('0x3d')));},'filename':function(_0x48f0d5,_0x2aea42,_0x4cd055){_0x4cd055(null,util[_0x813d('0x3e')](_0x813d('0x3f'),Date[_0x813d('0x40')](),_0x2aea42[_0x813d('0x41')]));}})});router['post'](_0x813d('0x42'),upload[_0x813d('0x43')](_0x813d('0x44')),controller[_0x813d('0x45')]);router[_0x813d('0x35')](_0x813d('0x46'),auth['isAuthenticated'](),controller[_0x813d('0x47')]);router['post']('/:id/logout',auth[_0x813d('0x8')](),controller[_0x813d('0x48')]);router[_0x813d('0x35')](_0x813d('0x49'),auth[_0x813d('0x8')](),controller[_0x813d('0x4a')]);router[_0x813d('0x35')](_0x813d('0x4b'),auth['isAuthenticated'](),controller[_0x813d('0x4c')]);router['post'](_0x813d('0x4d'),auth[_0x813d('0x8')](),controller[_0x813d('0x4e')]);router[_0x813d('0x35')](_0x813d('0x4f'),auth[_0x813d('0x8')](),controller[_0x813d('0x50')]);router['post'](_0x813d('0x51'),auth[_0x813d('0x8')](),controller[_0x813d('0x52')]);router[_0x813d('0x35')](_0x813d('0x53'),auth[_0x813d('0x8')](),controller[_0x813d('0x54')]);router['post'](_0x813d('0x55'),auth[_0x813d('0x8')](),controller['addSmsInteractions']);router[_0x813d('0x35')](_0x813d('0x56'),auth[_0x813d('0x8')](),controller[_0x813d('0x57')]);router[_0x813d('0x35')](_0x813d('0x58'),auth[_0x813d('0x8')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x813d('0x8')](),controller[_0x813d('0x59')]);router[_0x813d('0x35')](_0x813d('0x5a'),auth[_0x813d('0x8')](),controller[_0x813d('0x5b')]);router[_0x813d('0x35')](_0x813d('0x29'),auth[_0x813d('0x8')](),controller[_0x813d('0x5c')]);router['post'](_0x813d('0x2b'),auth[_0x813d('0x8')](),controller[_0x813d('0x5d')]);router[_0x813d('0x35')](_0x813d('0x2c'),auth[_0x813d('0x8')](),controller[_0x813d('0x5e')]);router[_0x813d('0x35')](_0x813d('0x2e'),auth['isAuthenticated'](),controller[_0x813d('0x5f')]);router[_0x813d('0x35')]('/:id/square_projects',auth[_0x813d('0x8')](),controller[_0x813d('0x60')]);router['post']('/:id/api_key',auth[_0x813d('0x8')](),controller['createApiKey']);router['put'](_0x813d('0x61'),auth[_0x813d('0x8')](),controller[_0x813d('0x62')]);router['put'](_0x813d('0x63'),auth[_0x813d('0x8')](),controller[_0x813d('0x64')]);router[_0x813d('0x65')](_0x813d('0x15'),auth[_0x813d('0x8')](),controller[_0x813d('0x66')]);router[_0x813d('0x65')](_0x813d('0x4d'),auth[_0x813d('0x8')](),controller[_0x813d('0x67')]);router[_0x813d('0x65')]('/:id',auth['isAuthenticated'](),controller[_0x813d('0x68')]);router[_0x813d('0x65')](_0x813d('0x4f'),auth[_0x813d('0x8')](),controller[_0x813d('0x69')]);router[_0x813d('0x65')](_0x813d('0x51'),auth[_0x813d('0x8')](),controller[_0x813d('0x6a')]);router['delete']('/:id/fax_interactions',auth[_0x813d('0x8')](),controller['removeFaxInteractions']);router[_0x813d('0x65')](_0x813d('0x55'),auth[_0x813d('0x8')](),controller[_0x813d('0x6b')]);router['delete'](_0x813d('0x56'),auth[_0x813d('0x8')](),controller[_0x813d('0x6c')]);router[_0x813d('0x65')](_0x813d('0x58'),auth[_0x813d('0x8')](),controller['removeWhatsappInteractions']);router[_0x813d('0x65')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x813d('0x65')]('/:id/mail_accounts',auth[_0x813d('0x8')](),controller[_0x813d('0x6d')]);router[_0x813d('0x65')](_0x813d('0x29'),auth[_0x813d('0x8')](),controller[_0x813d('0x6e')]);router[_0x813d('0x65')](_0x813d('0x2b'),auth[_0x813d('0x8')](),controller['removeSmsAccounts']);router['delete'](_0x813d('0x2c'),auth[_0x813d('0x8')](),controller[_0x813d('0x6f')]);router[_0x813d('0x65')](_0x813d('0x2e'),auth[_0x813d('0x8')](),controller['removeWhatsappAccounts']);router['delete'](_0x813d('0x30'),auth['isAuthenticated'](),controller[_0x813d('0x70')]);router[_0x813d('0x65')](_0x813d('0x71'),auth[_0x813d('0x8')](),controller[_0x813d('0x72')]);module[_0x813d('0x73')]=router; \ No newline at end of file +var _0xe042=['logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/whoami','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xe042,0x115));var _0x2e04=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xe042[_0x1a1b6e];return _0x571e2c;};'use strict';var multer=require(_0x2e04('0x0'));var util=require(_0x2e04('0x1'));var path=require(_0x2e04('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e04('0x3'));var router=express[_0x2e04('0x4')]();var fs_extra=require(_0x2e04('0x5'));var auth=require(_0x2e04('0x6'));var interaction=require(_0x2e04('0x7'));var config=require(_0x2e04('0x8'));var controller=require('./user.controller');router[_0x2e04('0x9')]('/',auth[_0x2e04('0xa')](),controller['index']);router[_0x2e04('0x9')]('/describe',auth[_0x2e04('0xa')](),controller[_0x2e04('0xb')]);router[_0x2e04('0x9')](_0x2e04('0xc'),auth[_0x2e04('0xa')](),controller['whoami']);router[_0x2e04('0x9')]('/presence',auth[_0x2e04('0xa')](),controller['getPresence']);router[_0x2e04('0x9')](_0x2e04('0xd'),auth['isAuthenticated'](),controller[_0x2e04('0xe')]);router[_0x2e04('0x9')]('/:id/avatar',controller[_0x2e04('0xf')]);router[_0x2e04('0x9')]('/:id/open_tabs',auth[_0x2e04('0xa')](),controller[_0x2e04('0x10')]);router[_0x2e04('0x9')](_0x2e04('0x11'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x12')]);router[_0x2e04('0x9')](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['getQueues']);router['get'](_0x2e04('0x14'),auth['isAuthenticated'](),controller[_0x2e04('0x15')]);router['get'](_0x2e04('0x16'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x17')]);router[_0x2e04('0x9')](_0x2e04('0x18'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x19')]);router[_0x2e04('0x9')](_0x2e04('0x1a'),auth[_0x2e04('0xa')](),controller['getScreenRecordings']);router[_0x2e04('0x9')](_0x2e04('0x1b'),auth['isAuthenticated'](),controller[_0x2e04('0x1c')]);router[_0x2e04('0x9')](_0x2e04('0x1d'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x1e')]);router[_0x2e04('0x9')]('/:id/mail/interactions',auth[_0x2e04('0xa')](),controller[_0x2e04('0x1f')]);router['get'](_0x2e04('0x20'),auth[_0x2e04('0xa')](),controller['getSmsInteractions']);router[_0x2e04('0x9')](_0x2e04('0x21'),auth['isAuthenticated'](),controller[_0x2e04('0x22')]);router['get'](_0x2e04('0x23'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x24')]);router[_0x2e04('0x9')](_0x2e04('0x25'),auth['isAuthenticated'](),controller[_0x2e04('0x26')]);router[_0x2e04('0x9')](_0x2e04('0x27'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x28')]);router['get'](_0x2e04('0x29'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x2a')]);router[_0x2e04('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x2e04('0x2b')]);router[_0x2e04('0x9')](_0x2e04('0x2c'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x2d')]);router[_0x2e04('0x9')]('/:id/mail_accounts',auth[_0x2e04('0xa')](),controller[_0x2e04('0x2e')]);router[_0x2e04('0x9')](_0x2e04('0x2f'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x30')]);router[_0x2e04('0x9')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x32')]);router['get'](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x34')]);router[_0x2e04('0x9')]('/:id/whatsapp_accounts',auth[_0x2e04('0xa')](),controller['getWhatsappAccounts']);router[_0x2e04('0x9')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller['getSquareProjects']);router['get'](_0x2e04('0x36'),auth['isAuthenticated'](),controller[_0x2e04('0x37')]);router[_0x2e04('0x9')](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller['getApiKey']);router['post'](_0x2e04('0x11'),auth['isAuthenticated'](),controller[_0x2e04('0x39')]);router[_0x2e04('0x3a')]('/',auth[_0x2e04('0xa')](),controller[_0x2e04('0x3b')]);router[_0x2e04('0x3a')](_0x2e04('0x3c'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x3d')]);router['post'](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2e04('0x3e')]({'destination':function(_0x30da4e,_0x118401,_0x54d3e9){_0x54d3e9(null,path[_0x2e04('0x3f')](config[_0x2e04('0x40')],_0x2e04('0x41')));},'filename':function(_0x373f9b,_0x8781da,_0x44adf2){_0x44adf2(null,util[_0x2e04('0x42')](_0x2e04('0x43'),Date[_0x2e04('0x44')](),_0x8781da[_0x2e04('0x45')]));}})});router['post'](_0x2e04('0x46'),upload[_0x2e04('0x47')](_0x2e04('0x48')),controller[_0x2e04('0x49')]);router['post'](_0x2e04('0x4a'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x4b')]);router[_0x2e04('0x3a')](_0x2e04('0x4c'),auth['isAuthenticated'](),controller[_0x2e04('0x4d')]);router[_0x2e04('0x3a')](_0x2e04('0x4e'),auth['isAuthenticated'](),controller['pause']);router['post'](_0x2e04('0x4f'),auth[_0x2e04('0xa')](),controller['unpause']);router[_0x2e04('0x3a')](_0x2e04('0x25'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x50')]);router[_0x2e04('0x3a')](_0x2e04('0x51'),auth[_0x2e04('0xa')](),controller['addChatInteractions']);router[_0x2e04('0x3a')](_0x2e04('0x52'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x53')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x2e04('0x54')]);router[_0x2e04('0x3a')](_0x2e04('0x55'),auth[_0x2e04('0xa')](),controller['addSmsInteractions']);router[_0x2e04('0x3a')](_0x2e04('0x56'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x57')]);router[_0x2e04('0x3a')](_0x2e04('0x58'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x59')]);router['post']('/:id/fax_accounts',auth[_0x2e04('0xa')](),controller[_0x2e04('0x5a')]);router[_0x2e04('0x3a')](_0x2e04('0x5b'),auth['isAuthenticated'](),controller[_0x2e04('0x5c')]);router[_0x2e04('0x3a')](_0x2e04('0x2f'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5d')]);router[_0x2e04('0x3a')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5e')]);router[_0x2e04('0x3a')](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5f')]);router[_0x2e04('0x3a')](_0x2e04('0x60'),auth['isAuthenticated'](),controller[_0x2e04('0x61')]);router[_0x2e04('0x3a')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x62')]);router[_0x2e04('0x3a')](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x63')]);router['put'](_0x2e04('0xd'),auth['isAuthenticated'](),controller[_0x2e04('0x64')]);router['put'](_0x2e04('0x65'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x66')]);router[_0x2e04('0x67')](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['removeQueues']);router[_0x2e04('0x67')]('/:id/teams',auth[_0x2e04('0xa')](),controller[_0x2e04('0x68')]);router[_0x2e04('0x67')](_0x2e04('0xd'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x69')]);router[_0x2e04('0x67')](_0x2e04('0x51'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6a')]);router['delete'](_0x2e04('0x52'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6b')]);router['delete'](_0x2e04('0x6c'),auth['isAuthenticated'](),controller[_0x2e04('0x6d')]);router[_0x2e04('0x67')](_0x2e04('0x55'),auth['isAuthenticated'](),controller[_0x2e04('0x6e')]);router[_0x2e04('0x67')](_0x2e04('0x56'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6f')]);router[_0x2e04('0x67')](_0x2e04('0x58'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x70')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2e04('0x71')]);router[_0x2e04('0x67')](_0x2e04('0x5b'),auth[_0x2e04('0xa')](),controller['removeMailAccounts']);router[_0x2e04('0x67')]('/:id/openchannel_accounts',auth[_0x2e04('0xa')](),controller['removeOpenchannelAccounts']);router[_0x2e04('0x67')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x72')]);router[_0x2e04('0x67')](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x73')]);router[_0x2e04('0x67')](_0x2e04('0x60'),auth['isAuthenticated'](),controller[_0x2e04('0x74')]);router[_0x2e04('0x67')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x75')]);router['delete'](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4fa66cc..4e7fde9 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 _0x9bdb=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','rfc2833','yes','nonat','update','outgoing','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','actpass','showWebBar','get','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','local','accountcode','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split'];(function(_0x4726bf,_0x13b166){var _0x2ac637=function(_0x2a29f4){while(--_0x2a29f4){_0x4726bf['push'](_0x4726bf['shift']());}};_0x2ac637(++_0x13b166);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x12bdc8,_0x51083b){_0x12bdc8=_0x12bdc8-0x0;var _0x3f81ee=_0x9bdb[_0x12bdc8];return _0x3f81ee;};'use strict';var Sequelize=require(_0xb9bd('0x0'));var moment=require(_0xb9bd('0x1'));var util=require(_0xb9bd('0x2'));var _=require(_0xb9bd('0x3'));module['exports']={'name':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':![],'unique':_0xb9bd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3f1592){this[_0xb9bd('0x6')](_0xb9bd('0x5'),_0x3f1592);this[_0xb9bd('0x6')](_0xb9bd('0x7'),_0x3f1592);},'comment':_0xb9bd('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x446081){this['setDataValue']('fullname',_0x446081);this[_0xb9bd('0x6')](_0xb9bd('0x9'),util['format'](_0xb9bd('0xa'),_0x446081,this[_0xb9bd('0xb')](_0xb9bd('0xc'))));}},'alias':{'type':Sequelize[_0xb9bd('0x4')]},'email':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4ff96c){if(_0x4ff96c){this[_0xb9bd('0x6')](_0xb9bd('0xd'),_0x4ff96c[_0xb9bd('0xe')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xb9bd('0xf'),_0xb9bd('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':_0xb9bd('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xb9bd('0xc'),'set':function(_0x8bc329){this[_0xb9bd('0x6')]('internal',_0x8bc329);this['setDataValue'](_0xb9bd('0x12'),_0x8bc329);this['setDataValue'](_0xb9bd('0x9'),util['format'](_0xb9bd('0xa'),this[_0xb9bd('0xb')](_0xb9bd('0x13')),_0x8bc329));}},'salt':{'type':Sequelize[_0xb9bd('0x4')]},'phone':{'type':Sequelize[_0xb9bd('0x4')]},'mobile':{'type':Sequelize[_0xb9bd('0x4')]},'address':{'type':Sequelize[_0xb9bd('0x4')]},'zipcode':{'type':Sequelize[_0xb9bd('0x4')]},'userpic':{'type':Sequelize[_0xb9bd('0x4')]},'city':{'type':Sequelize[_0xb9bd('0x4')]},'country':{'type':Sequelize[_0xb9bd('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':_0xb9bd('0x15')},'lastPauseAt':{'type':Sequelize[_0xb9bd('0x16')]},'chatCapacity':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![],'defaultValue':_0xb9bd('0x18')},'ipaddr':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xb9bd('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb9bd('0x19')]('friend','user',_0xb9bd('0x1a')),'allowNull':!![],'defaultValue':_0xb9bd('0x1b')},'context':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![],'defaultValue':_0xb9bd('0x1c')},'callingpres':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x1d'),_0xb9bd('0x1e'),_0xb9bd('0x1f'),_0xb9bd('0x20'),'PROHIB_NOT_SCREENED',_0xb9bd('0x21'),_0xb9bd('0x22'),_0xb9bd('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![],'defaultValue':_0xb9bd('0x24'),'set':function(_0x2b38a8){this[_0xb9bd('0x6')](_0xb9bd('0x25'),_0x2b38a8?_0x2b38a8[_0xb9bd('0x26')](','):null);},'get':function(){return this[_0xb9bd('0xb')](_0xb9bd('0x25'))?this[_0xb9bd('0xb')](_0xb9bd('0x25'))[_0xb9bd('0x27')](','):null;},'comment':_0xb9bd('0x28')},'dtmfmode':{'type':Sequelize[_0xb9bd('0x19')]('rfc2833','info',_0xb9bd('0x29'),'inband','auto'),'allowNull':!![],'defaultValue':_0xb9bd('0x2a')},'directmedia':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no',_0xb9bd('0x2c'),_0xb9bd('0x2d'),_0xb9bd('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x197194){this[_0xb9bd('0x6')](_0xb9bd('0x2f'),_0x197194?_0x197194[_0xb9bd('0x26')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xb9bd('0xb')](_0xb9bd('0x2f'))[_0xb9bd('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xb9bd('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xb9bd('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xb9bd('0x4')]},'language':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb9bd('0x4')]},'disallow':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':![],'defaultValue':_0xb9bd('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb9bd('0x31'),'set':function(_0x2e10b5){this[_0xb9bd('0x6')](_0xb9bd('0x32'),_0x2e10b5?_0x2e10b5[_0xb9bd('0x26')](';'):_0xb9bd('0x31'));},'get':function(){return this[_0xb9bd('0xb')](_0xb9bd('0x32'))?this['getDataValue'](_0xb9bd('0x32'))[_0xb9bd('0x27')](';'):null;},'comment':_0xb9bd('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x91b5e7){this[_0xb9bd('0x6')](_0xb9bd('0x34'),_0x91b5e7?_0x91b5e7[_0xb9bd('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xb9bd('0x34'))?this[_0xb9bd('0xb')](_0xb9bd('0x34'))[_0xb9bd('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb9bd('0x35')},'amaflags':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xb9bd('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xb9bd('0x2b')},'busylevel':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no',_0xb9bd('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x37'),_0xb9bd('0x38'),_0xb9bd('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x3a'),_0xb9bd('0x3b')),'allowNull':!![],'defaultValue':_0xb9bd('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xb9bd('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xb9bd('0x2b')},'keepalive':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no',_0xb9bd('0x3c'),_0xb9bd('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb9bd('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb9bd('0x19')]('active','passive',_0xb9bd('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb9bd('0x19')](_0xb9bd('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb9bd('0x19')]('yes','no','nonat',_0xb9bd('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb9bd('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xb9bd('0x16')]},'passwordResetAt':{'type':Sequelize[_0xb9bd('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0,'set':function(_0xeb559f){this['setDataValue'](_0xb9bd('0x3f'),_0xeb559f);var _0x4c3d40=this[_0xb9bd('0x40')]({'plain':!![]});switch(_0xeb559f){case 0x0:case 0x1:var _0x10cffb=_0x4c3d40[_0xb9bd('0x25')]?_['isArray'](_0x4c3d40['transport'])?_0x4c3d40[_0xb9bd('0x25')][_0xb9bd('0x26')]():_0x4c3d40[_0xb9bd('0x25')]:_0xb9bd('0x24');if(_0x10cffb===_0xb9bd('0x41')){_0x10cffb='udp';}this[_0xb9bd('0x6')]('transport',_0x10cffb);this[_0xb9bd('0x6')]('encryption','no');this[_0xb9bd('0x6')](_0xb9bd('0x42'),null);this[_0xb9bd('0x6')](_0xb9bd('0x43'),null);this[_0xb9bd('0x6')](_0xb9bd('0x44'),null);this['setDataValue'](_0xb9bd('0x45'),null);this[_0xb9bd('0x6')](_0xb9bd('0x46'),null);this[_0xb9bd('0x6')](_0xb9bd('0x47'),null);this['setDataValue'](_0xb9bd('0x48'),null);this[_0xb9bd('0x6')](_0xb9bd('0x49'),null);this[_0xb9bd('0x6')](_0xb9bd('0x4a'),'no');break;case 0x2:this[_0xb9bd('0x6')]('transport',_0xb9bd('0x41'));this[_0xb9bd('0x6')](_0xb9bd('0x4b'),_0xb9bd('0x2b'));this['setDataValue'](_0xb9bd('0x42'),_0xb9bd('0x2b'));this[_0xb9bd('0x6')](_0xb9bd('0x43'),'yes');this[_0xb9bd('0x6')](_0xb9bd('0x44'),_0xb9bd('0x2b'));this[_0xb9bd('0x6')]('dtlsenable','yes');this[_0xb9bd('0x6')](_0xb9bd('0x46'),'no');this[_0xb9bd('0x6')](_0xb9bd('0x47'),_0xb9bd('0x3e'));this['setDataValue'](_0xb9bd('0x48'),_0x4c3d40['dtlscertfile']||_0xb9bd('0x4c'));this[_0xb9bd('0x6')](_0xb9bd('0x49'),_0x4c3d40[_0xb9bd('0x49')]||_0xb9bd('0x4d'));this['setDataValue']('rtcp_mux',_0xb9bd('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xb9bd('0x4e')],'set':function(_0x18ed77){this[_0xb9bd('0x6')](_0xb9bd('0x4f'),_0x18ed77?_0x18ed77[_0xb9bd('0x26')](','):[]);},'get':function(){return this[_0xb9bd('0xb')](_0xb9bd('0x4f'))?_[_0xb9bd('0x50')](this['getDataValue'](_0xb9bd('0x4f'))[_0xb9bd('0x27')](','),function(_0x1a2398){return parseInt(_0x1a2398,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb9bd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xb9bd('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb9bd('0x19')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb9bd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb9bd('0xb')](_0xb9bd('0x51'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb9bd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb9bd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![],'set':function(_0x1fd960){if(typeof _0x1fd960===_0xb9bd('0x52')){var _0x4caef7=_0x1fd960==='1'?!![]:_0x1fd960==='0'?![]:_0x1fd960===_0xb9bd('0x53')?!![]:_0x1fd960===_0xb9bd('0x54')?![]:![];this[_0xb9bd('0x6')](_0xb9bd('0x55'),_0x4caef7);}else{this['setDataValue'](_0xb9bd('0x55'),_0x1fd960);}}},'blocked':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':![],'set':function(_0x3a5878){this[_0xb9bd('0x6')](_0xb9bd('0x56'),_0x3a5878);if(_0x3a5878===!![]){this['setDataValue'](_0xb9bd('0x57'),moment());this[_0xb9bd('0x6')]('loginAttempts',0x0);}else{this[_0xb9bd('0x6')](_0xb9bd('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xb9bd('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb9bd('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xb9bd('0x17')](0x5)[_0xb9bd('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb9bd('0x14')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4300=['blockedAt','loginAttempts','sequelize','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','nonat','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','rtcp_mux','avpf','dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x4300,0x1a6));var _0x0430=function(_0x1192c5,_0x448d1d){_0x1192c5=_0x1192c5-0x0;var _0x2ef876=_0x4300[_0x1192c5];return _0x2ef876;};'use strict';var Sequelize=require(_0x0430('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'unique':_0x0430('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1c139f){this[_0x0430('0x3')](_0x0430('0x2'),_0x1c139f);this['setDataValue'](_0x0430('0x4'),_0x1c139f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'set':function(_0x5b03ef){this[_0x0430('0x3')](_0x0430('0x5'),_0x5b03ef);this[_0x0430('0x3')](_0x0430('0x6'),util[_0x0430('0x7')](_0x0430('0x8'),_0x5b03ef,this[_0x0430('0x9')](_0x0430('0xa'))));}},'alias':{'type':Sequelize[_0x0430('0x1')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0430('0xb'),'validate':{'isEmail':!![]},'set':function(_0x364f7f){if(_0x364f7f){this[_0x0430('0x3')](_0x0430('0xb'),_0x364f7f[_0x0430('0xc')]());}}},'role':{'type':Sequelize[_0x0430('0xd')](_0x0430('0xe'),_0x0430('0xf'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0430('0x1')],'defaultValue':_0x0430('0x10')},'internal':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':![],'unique':_0x0430('0xa'),'set':function(_0x39d4e2){this[_0x0430('0x3')]('internal',_0x39d4e2);this[_0x0430('0x3')](_0x0430('0x12'),_0x39d4e2);this[_0x0430('0x3')](_0x0430('0x6'),util['format']('\x22%s\x22\x20<%s>',this['getDataValue'](_0x0430('0x5')),_0x39d4e2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0430('0x1')]},'address':{'type':Sequelize[_0x0430('0x1')]},'zipcode':{'type':Sequelize[_0x0430('0x1')]},'userpic':{'type':Sequelize[_0x0430('0x1')]},'city':{'type':Sequelize[_0x0430('0x1')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0430('0x13')]},'voicePause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0430('0x1')],'defaultValue':_0x0430('0x15')},'lastPauseAt':{'type':Sequelize[_0x0430('0x13')]},'chatCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0430('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0430('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0430('0x16')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x17'),_0x0430('0xf'),_0x0430('0x18')),'allowNull':!![],'defaultValue':_0x0430('0x17')},'context':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':_0x0430('0x19')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x0430('0x1a'),'ALLOWED',_0x0430('0x1b'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x0430('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':_0x0430('0x1d'),'set':function(_0x530a09){this['setDataValue'](_0x0430('0x1e'),_0x530a09?_0x530a09[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x1e'))?this[_0x0430('0x9')](_0x0430('0x1e'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x21')},'dtmfmode':{'type':Sequelize[_0x0430('0xd')]('rfc2833',_0x0430('0x22'),_0x0430('0x23'),_0x0430('0x24'),'auto'),'allowNull':!![],'defaultValue':_0x0430('0x25')},'directmedia':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no','nonat','update',_0x0430('0x27')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x659aca){this[_0x0430('0x3')](_0x0430('0x28'),_0x659aca?_0x659aca[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x28'))?this[_0x0430('0x9')](_0x0430('0x28'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x29')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0430('0x1')]},'pickupgroup':{'type':Sequelize[_0x0430('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x0430('0x1')]},'language':{'type':Sequelize[_0x0430('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0430('0x1')]},'disallow':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'defaultValue':_0x0430('0x2a'),'set':function(_0x50cdcd){this[_0x0430('0x3')](_0x0430('0x2b'),_0x50cdcd?_0x50cdcd[_0x0430('0x1f')](';'):_0x0430('0x2a'));},'get':function(){return this[_0x0430('0x9')](_0x0430('0x2b'))?this[_0x0430('0x9')](_0x0430('0x2b'))[_0x0430('0x20')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'set':function(_0x3f5218){this['setDataValue'](_0x0430('0x2c'),_0x3f5218?_0x3f5218[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x2c'))?this[_0x0430('0x9')](_0x0430('0x2c'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x2d')},'trustrpid':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0430('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'template':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x2e'),_0x0430('0x2f'),_0x0430('0x30')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x31'),_0x0430('0x32')),'allowNull':!![],'defaultValue':_0x0430('0x32')},'t38pt_usertpsource':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':_0x0430('0x26')},'keepalive':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no','fingerprint',_0x0430('0x33')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x34'),_0x0430('0x35'),_0x0430('0x36')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no',_0x0430('0x37'),_0x0430('0x38'),_0x0430('0x39')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0430('0x1')]},'resetPasswordExpires':{'type':Sequelize[_0x0430('0x13')]},'passwordResetAt':{'type':Sequelize[_0x0430('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0430('0x3a')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2dbf77){this[_0x0430('0x3')](_0x0430('0x3b'),_0x2dbf77);var _0x83683a=this[_0x0430('0x3c')]({'plain':!![]});switch(_0x2dbf77){case 0x0:case 0x1:var _0x693d30=_0x83683a[_0x0430('0x1e')]?_[_0x0430('0x3d')](_0x83683a[_0x0430('0x1e')])?_0x83683a[_0x0430('0x1e')][_0x0430('0x1f')]():_0x83683a[_0x0430('0x1e')]:_0x0430('0x1d');if(_0x693d30===_0x0430('0x3e')){_0x693d30='udp';}this[_0x0430('0x3')](_0x0430('0x1e'),_0x693d30);this[_0x0430('0x3')](_0x0430('0x3f'),'no');this[_0x0430('0x3')]('avpf',null);this['setDataValue'](_0x0430('0x40'),null);this[_0x0430('0x3')](_0x0430('0x41'),null);this[_0x0430('0x3')](_0x0430('0x42'),null);this['setDataValue'](_0x0430('0x43'),null);this[_0x0430('0x3')]('dtlssetup',null);this[_0x0430('0x3')](_0x0430('0x44'),null);this[_0x0430('0x3')]('dtlsprivatekey',null);this[_0x0430('0x3')](_0x0430('0x45'),'no');break;case 0x2:this[_0x0430('0x3')](_0x0430('0x1e'),_0x0430('0x3e'));this[_0x0430('0x3')](_0x0430('0x3f'),_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x46'),_0x0430('0x26'));this['setDataValue'](_0x0430('0x40'),_0x0430('0x26'));this[_0x0430('0x3')]('icesupport',_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x42'),_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x43'),'no');this[_0x0430('0x3')](_0x0430('0x47'),_0x0430('0x36'));this[_0x0430('0x3')](_0x0430('0x44'),_0x83683a[_0x0430('0x44')]||_0x0430('0x48'));this[_0x0430('0x3')](_0x0430('0x49'),_0x83683a[_0x0430('0x49')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x0430('0x45'),_0x0430('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x0430('0x3a')],'set':function(_0x526673){this[_0x0430('0x3')]('permissions',_0x526673?_0x526673[_0x0430('0x1f')](','):[]);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x4a'))?_[_0x0430('0x4b')](this['getDataValue'](_0x0430('0x4a'))['split'](','),function(_0x13197a){return parseInt(_0x13197a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarUnconditional':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0430('0x1')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0430('0x1')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0430('0x4c')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x0430('0x4d')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0430('0x1')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![],'set':function(_0x4f4abc){if(typeof _0x4f4abc==='string'){var _0x23ee1a=_0x4f4abc==='1'?!![]:_0x4f4abc==='0'?![]:_0x4f4abc===_0x0430('0x4e')?!![]:_0x4f4abc===_0x0430('0x4f')?![]:![];this[_0x0430('0x3')]('screenrecording',_0x23ee1a);}else{this[_0x0430('0x3')](_0x0430('0x50'),_0x4f4abc);}}},'blocked':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![],'set':function(_0x528ef3){this['setDataValue'](_0x0430('0x51'),_0x528ef3);if(_0x528ef3===!![]){this[_0x0430('0x3')](_0x0430('0x52'),moment());this[_0x0430('0x3')](_0x0430('0x53'),0x0);}else{this[_0x0430('0x3')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x0430('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0430('0x11')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c608b40..35f286a 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 _0xf7d9=['108','109','111','115','create','user','Unauthorized','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','map','telephone','compact','changePassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','previousPasswords','addQueues','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','interface','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','Queue:remove','voice','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','server/files/images/','download','mail','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','WhatsappOpenTabs','WHATSAPP','CmContact','order','sort','pick','where','hasOwnProperty','CmList','List','Tag','tag','getContacts','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','getChannels','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','PAUSE','MemberReport','concat','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','flatten','sequelize','transaction','addAgent','getDataValue','UserVoicePrefix','removeTeams','getFaxQueues','Fax','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lte','$ne','$not','$notBetween','$notIn','$like','$iLike','$notILike','$contains','$any','lastName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','queues','teams','inbound','lower','col','toString','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','voiceStatus','busy','slice','charAt','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','moment','bluebird','util','path','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','redis','./user.socket','register','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','role','admin','Users','Agents','agent','Telephones','filter','ignore','value','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','includes','password','salt','getOptions','includeAll','attributes','push','findAll','rows','query','openTabs','length','chat','dataValues','fax','openchannel','all','show','params','model','keys','filters','intersection','fields','include','merge','options','true','sms','whatsapp','catch','body','describe','addContacts','ids','omit','internal','Setting','securePassword','validatePasswordPattern','min_internal','isNil','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)','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','104','105','106'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf7d9,0x122));var _0x9f7d=function(_0x181c64,_0x457940){_0x181c64=_0x181c64-0x0;var _0x4a93d7=_0xf7d9[_0x181c64];return _0x4a93d7;};'use strict';var moment=require(_0x9f7d('0x0'));var BPromise=require(_0x9f7d('0x1'));var util=require(_0x9f7d('0x2'));var path=require(_0x9f7d('0x3'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var jayson=require(_0x9f7d('0x4'));var Redis=require('ioredis');var authService=require(_0x9f7d('0x5'));var qs=require(_0x9f7d('0x6'));var logger=require(_0x9f7d('0x7'))(_0x9f7d('0x8'));var utils=require(_0x9f7d('0x9'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f7d('0xa'))['db'];var socket=require(_0x9f7d('0xb'))(new Redis(config[_0x9f7d('0xc')]));require(_0x9f7d('0xd'))[_0x9f7d('0xe')](socket);config[_0x9f7d('0xc')]=_['defaults'](config[_0x9f7d('0xc')],{'host':_0x9f7d('0xf'),'port':0x18eb});var client=jayson['client'][_0x9f7d('0x10')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2227e3,_0x370669,_0x52d680,_0x43a48e){return new BPromise(function(_0x26e026,_0x1c10e4){var _0x55737b=_0x43a48e||client;return _0x55737b[_0x9f7d('0x11')](_0x2227e3,_0x52d680)[_0x9f7d('0x12')](function(_0x5b449f){logger[_0x9f7d('0x13')](_0x9f7d('0x14'),_0x370669,_0x9f7d('0x15'));logger[_0x9f7d('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x370669,_0x9f7d('0x15'),JSON[_0x9f7d('0x17')](_0x5b449f));if(_0x5b449f[_0x9f7d('0x18')]){if(_0x5b449f[_0x9f7d('0x18')][_0x9f7d('0x19')]===0x1f4){logger[_0x9f7d('0x18')](_0x9f7d('0x14'),_0x370669,_0x5b449f['error']['message']);return _0x1c10e4(_0x5b449f[_0x9f7d('0x18')][_0x9f7d('0x1a')]);}logger[_0x9f7d('0x18')](_0x9f7d('0x14'),_0x370669,_0x5b449f[_0x9f7d('0x18')][_0x9f7d('0x1a')]);return _0x26e026(_0x5b449f[_0x9f7d('0x18')][_0x9f7d('0x1a')]);}else{logger[_0x9f7d('0x13')]('User,\x20%s,\x20%s',_0x370669,_0x9f7d('0x15'));_0x26e026(_0x5b449f[_0x9f7d('0x1b')]['message']);}})['catch'](function(_0x5b17ad){logger[_0x9f7d('0x18')](_0x9f7d('0x14'),_0x370669,_0x5b17ad);_0x1c10e4(_0x5b17ad);});});}function respondWithStatusCode(_0x1b69f2,_0x524827){_0x524827=_0x524827||0xcc;return function(_0x49c23c){if(_0x49c23c){return _0x1b69f2[_0x9f7d('0x1c')](_0x524827);}return _0x1b69f2[_0x9f7d('0x1d')](_0x524827)[_0x9f7d('0x1e')]();};}function respondWithResult(_0x1d0717,_0x3e045c){_0x3e045c=_0x3e045c||0xc8;return function(_0x13b125){if(_0x13b125){return _0x1d0717['status'](_0x3e045c)[_0x9f7d('0x1f')](_0x13b125);}};}function respondWithFilteredResult(_0x4e10a7,_0x34275a){return function(_0x4d7542){if(_0x4d7542){var _0x4b0607=typeof _0x34275a[_0x9f7d('0x20')]==='undefined'&&typeof _0x34275a['limit']===_0x9f7d('0x21');var _0xe2ada9=_0x4d7542[_0x9f7d('0x22')];var _0x3600d4=_0x4b0607?0x0:_0x34275a['offset'];var _0x48ea1b=_0x4b0607?_0x4d7542[_0x9f7d('0x22')]:_0x34275a[_0x9f7d('0x20')]+_0x34275a[_0x9f7d('0x23')];var _0x290ef9;if(_0x48ea1b>=_0xe2ada9){_0x48ea1b=_0xe2ada9;_0x290ef9=0xc8;}else{_0x290ef9=0xce;}_0x4e10a7['status'](_0x290ef9);return _0x4e10a7[_0x9f7d('0x24')](_0x9f7d('0x25'),_0x3600d4+'-'+_0x48ea1b+'/'+_0xe2ada9)[_0x9f7d('0x1f')](_0x4d7542);}return null;};}function saveUpdates(_0x2e61a3){return function(_0x4673bc){if(_0x4673bc){return _0x4673bc[_0x9f7d('0x26')](_0x2e61a3)[_0x9f7d('0x12')](function(_0x40a100){return _0x40a100;});}return null;};}function removeEntity(_0x5b2d2c){return function(_0x55950a){if(_0x55950a){return _0x55950a[_0x9f7d('0x27')]()[_0x9f7d('0x12')](function(){var _0x1ca5cb=_0x55950a[_0x9f7d('0x28')]({'plain':!![]});if(_0x1ca5cb[_0x9f7d('0x29')]===_0x9f7d('0x2a'))return;var _0xf73bf6=[{'name':_0x9f7d('0x2b'),'value':'user','ignore':!![]},{'name':_0x9f7d('0x2c'),'value':_0x9f7d('0x2d'),'ignore':![]},{'name':_0x9f7d('0x2e'),'value':'telephone','ignore':![]}];var _0x2c27fd=_(_0xf73bf6)[_0x9f7d('0x2f')](_0x9f7d('0x30'))['map'](_0x9f7d('0x31'))[_0x9f7d('0x31')]();if(_['includes'](_0x2c27fd,_0x1ca5cb[_0x9f7d('0x29')])){return;}var _0x3fe022=_[_0x9f7d('0x32')](_0xf73bf6,['value',_0x1ca5cb['role']])[_0x9f7d('0x33')];return db[_0x9f7d('0x34')][_0x9f7d('0x27')]({'where':{'type':_0x3fe022,'resourceId':_0x1ca5cb['id']}})[_0x9f7d('0x12')](function(){return _0x55950a;});})[_0x9f7d('0x12')](function(){_0x5b2d2c[_0x9f7d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5d1b){return function(_0x578222){if(!_0x578222){_0x4b5d1b['sendStatus'](0x194);}return _0x578222;};}function handleError(_0x4856da,_0x33c070){_0x33c070=_0x33c070||0x1f4;return function(_0x2dd9ff){logger[_0x9f7d('0x18')](_0x2dd9ff[_0x9f7d('0x35')]);if(_0x2dd9ff['name']){delete _0x2dd9ff[_0x9f7d('0x33')];}_0x4856da['status'](_0x33c070)[_0x9f7d('0x36')](_0x2dd9ff);};}exports[_0x9f7d('0x37')]=function(_0x9df2d0,_0x3ef0ba){var _0x4bb270={},_0x328ac9={'count':0x0,'rows':[]};var _0x250fe5=_(db[_0x9f7d('0x38')][_0x9f7d('0x39')])['map'](function(_0xcc8c94){return{'name':_0xcc8c94[_0x9f7d('0x3a')],'type':_0xcc8c94[_0x9f7d('0x3b')][_0x9f7d('0x3c')]};})[_0x9f7d('0x2f')](function(_0x3b0d33){return!_[_0x9f7d('0x3d')]([_0x9f7d('0x3e'),_0x9f7d('0x3f')],_0x3b0d33[_0x9f7d('0x33')]);})['value']();_0x4bb270=qs[_0x9f7d('0x40')](_0x250fe5,_0x9df2d0);var _0x58cffc={'where':_0x4bb270['where']};return db[_0x9f7d('0x38')][_0x9f7d('0x22')](_0x58cffc)['then'](function(_0x2a172a){_0x328ac9[_0x9f7d('0x22')]=_0x2a172a;if(_0x9df2d0['query'][_0x9f7d('0x41')]){_0x4bb270['include']=[{'all':!![]}];}if(!_['includes'](_0x4bb270[_0x9f7d('0x42')],'id')){_0x4bb270[_0x9f7d('0x42')][_0x9f7d('0x43')]('id');}return db[_0x9f7d('0x38')][_0x9f7d('0x44')](_0x4bb270);})[_0x9f7d('0x12')](function(_0x506d63){_0x328ac9[_0x9f7d('0x45')]=_0x506d63;if(_0x9df2d0[_0x9f7d('0x46')][_0x9f7d('0x47')]==='true'){var _0x58c023=[];for(var _0xf1359=0x0;_0xf1359<_0x328ac9[_0x9f7d('0x45')][_0x9f7d('0x48')];_0xf1359++){_0x58c023[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x49'),_0x328ac9[_0x9f7d('0x45')][_0xf1359][_0x9f7d('0x4a')]));_0x58c023[_0x9f7d('0x43')](get_open_tabs('sms',_0x328ac9[_0x9f7d('0x45')][_0xf1359][_0x9f7d('0x4a')]));_0x58c023[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x4b'),_0x328ac9[_0x9f7d('0x45')][_0xf1359][_0x9f7d('0x4a')]));_0x58c023[_0x9f7d('0x43')](get_open_tabs('mail',_0x328ac9[_0x9f7d('0x45')][_0xf1359]['dataValues']));_0x58c023[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x4c'),_0x328ac9[_0x9f7d('0x45')][_0xf1359]['dataValues']));_0x58c023[_0x9f7d('0x43')](get_open_tabs('whatsapp',_0x328ac9[_0x9f7d('0x45')][_0xf1359][_0x9f7d('0x4a')]));}return BPromise[_0x9f7d('0x4d')](_0x58c023)[_0x9f7d('0x12')](function(_0x4631a5){return _0x328ac9;});}else{return _0x328ac9;}})[_0x9f7d('0x12')](respondWithFilteredResult(_0x3ef0ba,_0x4bb270))['catch'](handleError(_0x3ef0ba,null));};exports[_0x9f7d('0x4e')]=function(_0x2b1f0f,_0xc0d16e){var _0x4f995f={'raw':![],'where':{'id':_0x2b1f0f[_0x9f7d('0x4f')]['id']}},_0x48a2ec={};_0x48a2ec[_0x9f7d('0x50')]=_['differenceBy'](_[_0x9f7d('0x51')](db['User'][_0x9f7d('0x39')]),[_0x9f7d('0x3e'),_0x9f7d('0x3f')]);_0x48a2ec[_0x9f7d('0x46')]=_[_0x9f7d('0x51')](_0x2b1f0f['query']);_0x48a2ec[_0x9f7d('0x52')]=_['intersection'](_0x48a2ec[_0x9f7d('0x50')],_0x48a2ec[_0x9f7d('0x46')]);_0x4f995f[_0x9f7d('0x42')]=_[_0x9f7d('0x53')](_0x48a2ec[_0x9f7d('0x50')],qs[_0x9f7d('0x54')](_0x2b1f0f[_0x9f7d('0x46')][_0x9f7d('0x54')]));_0x4f995f[_0x9f7d('0x42')]=_0x4f995f['attributes'][_0x9f7d('0x48')]?_0x4f995f['attributes']:_0x48a2ec[_0x9f7d('0x50')];if(_0x2b1f0f[_0x9f7d('0x46')]['includeAll']){_0x4f995f[_0x9f7d('0x55')]=[{'all':!![]}];}_0x4f995f=_[_0x9f7d('0x56')]({},_0x4f995f,_0x2b1f0f[_0x9f7d('0x57')]);if(!_[_0x9f7d('0x3d')](_0x4f995f[_0x9f7d('0x42')],'id')){_0x4f995f[_0x9f7d('0x42')][_0x9f7d('0x43')]('id');}return db[_0x9f7d('0x38')][_0x9f7d('0x32')](_0x4f995f)[_0x9f7d('0x12')](handleEntityNotFound(_0xc0d16e,null))[_0x9f7d('0x12')](function(_0x31e4ab){var _0x29fee1=[];values=_0x31e4ab;if(_0x2b1f0f[_0x9f7d('0x46')]['openTabs']===_0x9f7d('0x58')){_0x29fee1[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x49'),_0x31e4ab[_0x9f7d('0x4a')]));_0x29fee1['push'](get_open_tabs(_0x9f7d('0x59'),_0x31e4ab[_0x9f7d('0x4a')]));_0x29fee1[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x4c'),_0x31e4ab[_0x9f7d('0x4a')]));_0x29fee1[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x5a'),_0x31e4ab['dataValues']));_0x29fee1[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x4b'),_0x31e4ab[_0x9f7d('0x4a')]));_0x29fee1[_0x9f7d('0x43')](get_open_tabs('mail',_0x31e4ab[_0x9f7d('0x4a')]));return BPromise['all'](_0x29fee1);}else{return values;}})['then'](function(_0x34e20b){return values;})['then'](respondWithResult(_0xc0d16e,null))[_0x9f7d('0x5b')](handleError(_0xc0d16e,null));};exports[_0x9f7d('0x26')]=function(_0x254def,_0x2ab590){if(_0x254def[_0x9f7d('0x5c')]['id']){delete _0x254def[_0x9f7d('0x5c')]['id'];}delete _0x254def[_0x9f7d('0x5c')]['role'];return db[_0x9f7d('0x38')][_0x9f7d('0x32')]({'where':{'id':_0x254def['params']['id']}})[_0x9f7d('0x12')](handleEntityNotFound(_0x2ab590,null))[_0x9f7d('0x12')](saveUpdates(_0x254def[_0x9f7d('0x5c')],null))[_0x9f7d('0x12')](respondWithResult(_0x2ab590,null))[_0x9f7d('0x5b')](handleError(_0x2ab590,null));};exports['describe']=function(_0x427d6c,_0x58893e){return db[_0x9f7d('0x38')][_0x9f7d('0x5d')]()[_0x9f7d('0x12')](respondWithResult(_0x58893e,null))[_0x9f7d('0x5b')](handleError(_0x58893e,null));};exports[_0x9f7d('0x5e')]=function(_0x27fe57,_0x4fe99d){return db[_0x9f7d('0x38')]['find']({'where':{'id':_0x27fe57[_0x9f7d('0x4f')]['id']}})[_0x9f7d('0x12')](handleEntityNotFound(_0x4fe99d,null))['then'](function(_0x4076b8){if(_0x4076b8){return _0x4076b8['addContacts'](_0x27fe57[_0x9f7d('0x5c')][_0x9f7d('0x5f')],_[_0x9f7d('0x60')](_0x27fe57[_0x9f7d('0x5c')],[_0x9f7d('0x5f'),'id'])||{});}})[_0x9f7d('0x12')](respondWithResult(_0x4fe99d,null))[_0x9f7d('0x5b')](handleError(_0x4fe99d,null));};function validateUser(_0x424e45){return new BPromise(function(_0x1ff5d7,_0x106f95){if(_0x424e45[_0x9f7d('0x61')])return _0x1ff5d7(_0x424e45);return db[_0x9f7d('0x62')]['findById'](0x1)[_0x9f7d('0x12')](function(_0x2af20a){if(_0x2af20a[_0x9f7d('0x63')])authService[_0x9f7d('0x64')](_0x424e45['password']);db[_0x9f7d('0x38')]['max'](_0x9f7d('0x61'))[_0x9f7d('0x12')](function(_0x506454){if(_['isNil'](_0x506454)){_0x424e45['internal']=_0x2af20a[_0x9f7d('0x65')]||0x1;return;}if(_[_0x9f7d('0x66')](_0x2af20a[_0x9f7d('0x65')])||_0x2af20a['min_internal']===_0x506454){_0x424e45['internal']=_0x506454+0x1;return;}if(_0x2af20a[_0x9f7d('0x65')]>_0x506454){_0x424e45[_0x9f7d('0x61')]=_0x2af20a[_0x9f7d('0x65')];return;}return db['sequelize'][_0x9f7d('0x46')](_0x9f7d('0x67'),{'type':db['sequelize']['QueryTypes'][_0x9f7d('0x68')]})[_0x9f7d('0x12')](function(_0x3e5b19){if(_0x3e5b19&&_0x3e5b19[_0x9f7d('0x48')]){for(var _0x16890a=0x0,_0x1c48f8=_0x3e5b19[_0x9f7d('0x48')];_0x16890a<_0x1c48f8&&_[_0x9f7d('0x66')](_0x424e45[_0x9f7d('0x61')]);_0x16890a++){if(_0x2af20a[_0x9f7d('0x65')]<=_0x3e5b19[_0x16890a]['from']){_0x424e45[_0x9f7d('0x61')]=_0x3e5b19[_0x16890a][_0x9f7d('0x69')];}else if(_0x2af20a['min_internal']>_0x3e5b19[_0x16890a][_0x9f7d('0x69')]&&_0x2af20a[_0x9f7d('0x65')]<=_0x3e5b19[_0x16890a]['to']){_0x424e45[_0x9f7d('0x61')]=_0x2af20a['min_internal'];}}}if(_['isNil'](_0x424e45[_0x9f7d('0x61')])){_0x424e45[_0x9f7d('0x61')]=_0x506454+0x1;}return _0x1ff5d7(_0x424e45);});});})[_0x9f7d('0x5b')](function(_0x217acb){_0x106f95(_0x217acb);});});}function updateUser(_0x3ae5a6){return new BPromise(function(_0x2d39d6,_0x5a1f08){try{if(_0x3ae5a6[_0x9f7d('0x6a')]){_0x3ae5a6[_0x9f7d('0x6b')]=_0x3ae5a6['internal'];_0x3ae5a6[_0x9f7d('0x6c')]={'mailbox':_0x3ae5a6['internal'],'password':_0x3ae5a6[_0x9f7d('0x3e')],'fullname':_0x3ae5a6[_0x9f7d('0x6d')],'email':_0x3ae5a6['email']};}if(_0x3ae5a6[_0x9f7d('0x29')]==='agent'){if(!_0x3ae5a6[_0x9f7d('0x6e')])_0x3ae5a6[_0x9f7d('0x6e')]=[_0x9f7d('0x6f'),_0x9f7d('0x70'),_0x9f7d('0x71'),'113','110',_0x9f7d('0x72'),_0x9f7d('0x73'),_0x9f7d('0x74'),'107',_0x9f7d('0x75'),_0x9f7d('0x76'),'100',_0x9f7d('0x77'),'114',_0x9f7d('0x78')];}_0x2d39d6(_0x3ae5a6);}catch(_0x481673){_0x5a1f08(_0x481673);}});}exports[_0x9f7d('0x79')]=function(_0x5bab3d,_0x170f5c){if(_0x5bab3d[_0x9f7d('0x7a')][_0x9f7d('0x29')]===_0x9f7d('0x2d'))throw new Error(_0x9f7d('0x7b'));if(_0x5bab3d[_0x9f7d('0x5c')]['role']===_0x9f7d('0x7a')&&_0x5bab3d[_0x9f7d('0x7a')][_0x9f7d('0x29')]!==_0x9f7d('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5bab3d['body'][_0x9f7d('0x29')]===_0x9f7d('0x2a')&&_0x5bab3d['user']['role']!==_0x9f7d('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x9f7d('0x7c')]([_0x5bab3d['body']])[_0x9f7d('0x12')](function(){return validateUser(_0x5bab3d[_0x9f7d('0x5c')]);})[_0x9f7d('0x12')](function(_0x22fedd){return updateUser(_0x22fedd)[_0x9f7d('0x12')](function(_0x7da0f0){if(_0x7da0f0['role']===_0x9f7d('0x2a')){_0x7da0f0[_0x9f7d('0x7d')]=_0x5bab3d[_0x9f7d('0x7a')][_0x9f7d('0x7d')];delete _0x7da0f0[_0x9f7d('0x7e')];}return _0x7da0f0;});})[_0x9f7d('0x12')](function(_0xaf8d55){return db[_0x9f7d('0x38')]['create'](_0xaf8d55,{'include':[{'model':db[_0x9f7d('0x6c')],'as':_0x9f7d('0x6c')}]});})[_0x9f7d('0x12')](function(_0x505a3d){if(_0x5bab3d[_0x9f7d('0x5c')]['role']===_0x9f7d('0x7a'))return _0x505a3d;if(_0x5bab3d['user']['role']!==_0x9f7d('0x7a'))return _0x505a3d;return db[_0x9f7d('0x7f')]['find']({'where':{'name':_0x505a3d[_0x9f7d('0x29')]===_0x9f7d('0x2d')?'Agents':_0x9f7d('0x2e'),'userProfileId':_0x5bab3d[_0x9f7d('0x7a')][_0x9f7d('0x7e')]},'raw':!![]})[_0x9f7d('0x12')](function(_0x25111c){if(!_0x25111c||_0x25111c[_0x9f7d('0x80')]!=0x0)return _0x505a3d;return db['UserProfileResource'][_0x9f7d('0x79')]({'name':_0x505a3d[_0x9f7d('0x33')],'resourceId':_0x505a3d['id'],'type':_0x25111c[_0x9f7d('0x33')],'sectionId':_0x25111c['id']},{})[_0x9f7d('0x12')](function(){return _0x505a3d;});})[_0x9f7d('0x5b')](function(_0x116dce){logger['error'](_0x9f7d('0x81'),_0x116dce);throw _0x116dce;});})[_0x9f7d('0x12')](respondWithResult(_0x170f5c,0xc9))[_0x9f7d('0x5b')](handleError(_0x170f5c,null));};exports[_0x9f7d('0x82')]=function(_0x1fd602,_0x56d1ae){var _0x599ee5=_0x1fd602[_0x9f7d('0x5c')];var _0x1ac404=[];if(_0x1fd602['user']['role']===_0x9f7d('0x2d'))throw new Error(_0x9f7d('0x7b'));if(_[_0x9f7d('0x83')](_0x599ee5,['role',_0x9f7d('0x7a')])&&_0x1fd602[_0x9f7d('0x7a')][_0x9f7d('0x29')]!==_0x9f7d('0x2a')){throw new Error(_0x9f7d('0x84'));}if(_[_0x9f7d('0x83')](_0x599ee5,[_0x9f7d('0x29'),_0x9f7d('0x2a')])&&_0x1fd602[_0x9f7d('0x7a')][_0x9f7d('0x29')]!=='admin'){throw new Error(_0x9f7d('0x85'));}return licenseUtil[_0x9f7d('0x7c')](_0x599ee5)[_0x9f7d('0x12')](function(){return validateUser(_0x599ee5[0x0]);})[_0x9f7d('0x12')](function(){for(var _0x15e0b8=0x1;_0x15e0b8<_0x599ee5[_0x9f7d('0x48')];_0x15e0b8++){var _0xec650a=_0x599ee5[_0x15e0b8-0x1]['internal'];if(!_0x599ee5[_0x15e0b8]['internal'])_0x599ee5[_0x15e0b8][_0x9f7d('0x61')]=_0xec650a+0x1;_0x1ac404[_0x9f7d('0x43')](validateUser(_0x599ee5[_0x15e0b8]));}return BPromise[_0x9f7d('0x4d')](_0x1ac404);})[_0x9f7d('0x12')](function(){_0x1ac404=[];for(var _0x102f02=0x0;_0x102f02<_0x599ee5[_0x9f7d('0x48')];_0x102f02++){_0x1ac404[_0x9f7d('0x43')](updateUser(_0x599ee5[_0x102f02]));}return BPromise[_0x9f7d('0x4d')](_0x1ac404);})[_0x9f7d('0x12')](function(){return BPromise[_0x9f7d('0x86')](_0x599ee5,function(_0xd4c363){return db[_0x9f7d('0x38')][_0x9f7d('0x79')](_0xd4c363,{'include':[{'model':db[_0x9f7d('0x6c')],'as':_0x9f7d('0x6c')}]})[_0x9f7d('0x12')](function(_0x235fd2){_0xd4c363['id']=_0x235fd2['id'];return _0xd4c363;});});})['then'](function(_0x54f24c){if(_0x1fd602[_0x9f7d('0x5c')][_0x9f7d('0x29')]===_0x9f7d('0x7a'))return _0x54f24c;if(_0x1fd602[_0x9f7d('0x7a')][_0x9f7d('0x29')]!=='user')return _0x54f24c;var _0x3a3f96=_[_0x9f7d('0x83')](_0x54f24c,function(_0x39e68d){return _0x39e68d[_0x9f7d('0x29')]==='agent'||_0x39e68d[_0x9f7d('0x29')]==='telephone';});if(!_0x3a3f96)return _0x54f24c;return db['UserProfileSection'][_0x9f7d('0x44')]({'where':{'name':{'$or':[_0x9f7d('0x2c'),_0x9f7d('0x2e')]},'userProfileId':_0x1fd602['user']['userProfileId']},'raw':!![]})[_0x9f7d('0x12')](function(_0x4194df){if(_[_0x9f7d('0x87')](_0x4194df)||!_['some'](_0x4194df,[_0x9f7d('0x80'),0x0]))return _0x54f24c;_0x1ac404=[];var _0x82d00a=_(_0x4194df)[_0x9f7d('0x88')](function(_0x53ddf9){if(_0x53ddf9[_0x9f7d('0x80')]===0x1)return;return _0x53ddf9[_0x9f7d('0x33')]===_0x9f7d('0x2c')?'agent':_0x9f7d('0x89');})[_0x9f7d('0x8a')]()[_0x9f7d('0x31')]();for(var _0x2b9561=0x0;_0x2b9561<_0x54f24c[_0x9f7d('0x48')];_0x2b9561++){if(!_['includes'](_0x82d00a,_0x54f24c[_0x2b9561][_0x9f7d('0x29')]))return;var _0x5e8aa6=_0x54f24c[_0x2b9561][_0x9f7d('0x29')]===_0x9f7d('0x2d')?_0x9f7d('0x2c'):_0x9f7d('0x2e');_0x1ac404[_0x9f7d('0x43')](db[_0x9f7d('0x34')][_0x9f7d('0x79')]({'name':_0x54f24c[_0x2b9561][_0x9f7d('0x33')],'resourceId':_0x54f24c[_0x2b9561]['id'],'type':_0x5e8aa6,'sectionId':_[_0x9f7d('0x32')](_0x4194df,[_0x9f7d('0x33'),_0x5e8aa6])['id']},{}));}return BPromise[_0x9f7d('0x4d')](_0x1ac404);});})[_0x9f7d('0x12')](respondWithResult(_0x56d1ae,0xc9))[_0x9f7d('0x5b')](handleError(_0x56d1ae,null));};exports[_0x9f7d('0x8b')]=function(_0x1aefd2,_0x16bd6a){if(_0x1aefd2['body']['id']){delete _0x1aefd2['body']['id'];}return db[_0x9f7d('0x38')][_0x9f7d('0x32')]({'where':{'id':_0x1aefd2[_0x9f7d('0x4f')]['id']}})[_0x9f7d('0x12')](function(_0x5a11ee){if(!_0x5a11ee)return null;if(_0x5a11ee['id']===_0x1aefd2[_0x9f7d('0x7a')]['id']){if(!_0x1aefd2[_0x9f7d('0x5c')]['oldPassword']||!_0x1aefd2[_0x9f7d('0x5c')]['newPassword']){throw new db[(_0x9f7d('0x8c'))][(_0x9f7d('0x8d'))](_0x9f7d('0x8e'));}if(!_0x5a11ee['authenticate'](_0x1aefd2[_0x9f7d('0x5c')][_0x9f7d('0x8f')])){throw new db[(_0x9f7d('0x8c'))][(_0x9f7d('0x8d'))](_0x9f7d('0x90'));}if(_0x1aefd2[_0x9f7d('0x5c')][_0x9f7d('0x8f')]===_0x1aefd2['body'][_0x9f7d('0x91')]){throw new db['Sequelize'][(_0x9f7d('0x8d'))](_0x9f7d('0x92'));}}else if(_0x1aefd2['user'][_0x9f7d('0x29')]===_0x9f7d('0x2a')){if(!_0x1aefd2[_0x9f7d('0x5c')]['newPassword']){throw new db[(_0x9f7d('0x8c'))][(_0x9f7d('0x8d'))](_0x9f7d('0x93'));}}else if(_0x1aefd2[_0x9f7d('0x7a')][_0x9f7d('0x29')]===_0x9f7d('0x7a')){if(!_0x1aefd2[_0x9f7d('0x5c')][_0x9f7d('0x91')]){throw new db[(_0x9f7d('0x8c'))]['ValidationError'](_0x9f7d('0x93'));}if(_0x5a11ee['role']!==_0x9f7d('0x2d')){throw new db[(_0x9f7d('0x8c'))][(_0x9f7d('0x8d'))](_0x9f7d('0x7b'));}}else{throw new db[(_0x9f7d('0x8c'))][(_0x9f7d('0x8d'))]('Unauthorized');}return _0x5a11ee;})[_0x9f7d('0x12')](handleEntityNotFound(_0x16bd6a,null))[_0x9f7d('0x12')](function(_0x4da15b){return db['Setting'][_0x9f7d('0x94')]({'attributes':['id',_0x9f7d('0x63'),'enforcePasswordHistory',_0x9f7d('0x95')]})[_0x9f7d('0x12')](function(_0x36237a){if(_0x36237a['securePassword'])authService['validatePasswordPattern'](_0x1aefd2['body'][_0x9f7d('0x91')]);if(!_0x36237a[_0x9f7d('0x96')]||!_0x4da15b['previousPasswords'])return _0x4da15b;authService[_0x9f7d('0x97')](_0x1aefd2[_0x9f7d('0x5c')][_0x9f7d('0x91')],_0x4da15b['previousPasswords'],_0x36237a['passwordHistoryLimit']);return _0x4da15b;})['then'](saveUpdates({'password':_0x1aefd2['body'][_0x9f7d('0x91')],'passwordResetAt':_0x1aefd2['user']['id']==_0x1aefd2['params']['id']?moment():null,'previousPasswords':authService[_0x9f7d('0x98')](_0x1aefd2[_0x9f7d('0x5c')]['newPassword'],_0x4da15b[_0x9f7d('0x99')])},null));})[_0x9f7d('0x12')](respondWithResult(_0x16bd6a,null))['catch'](handleError(_0x16bd6a,null));};exports[_0x9f7d('0x9a')]=function(_0x1a4419,_0x4bcd56){var _0x460ba2=_0x1a4419[_0x9f7d('0x5c')]['channel'];return db[_0x9f7d('0x38')]['find']({'where':{'id':_0x1a4419[_0x9f7d('0x4f')]['id']},'attributes':['id',_0x9f7d('0x33'),_0x9f7d('0x29'),_0x9f7d('0x9b'),_0x9f7d('0x9c'),_0x9f7d('0x9d'),'interface']})[_0x9f7d('0x12')](handleEntityNotFound(_0x4bcd56,null))[_0x9f7d('0x12')](function(_0x1dd2a7){if(_0x1dd2a7){if(!utils[_0x9f7d('0x9e')](_0x460ba2)){throw new db[(_0x9f7d('0x8c'))]['ValidationError'](_0x9f7d('0x9f'));}return _0x1dd2a7[_0x9f7d('0xa0')+_[_0x9f7d('0xa1')](_0x460ba2[_0x9f7d('0xa2')]())+_0x9f7d('0xa3')](_0x1a4419['body']['ids'],{'penalty':_0x1a4419[_0x9f7d('0x5c')]['penalty']||0x0})[_0x9f7d('0xa4')](function(_0xcf6c66){for(var _0x547040=0x0;_0x547040<_0x1a4419[_0x9f7d('0x5c')][_0x9f7d('0x5f')][_0x9f7d('0x48')];_0x547040+=0x1){var _0x19a580={'UserId':Number(_0x1a4419[_0x9f7d('0x4f')]['id'])};_0x19a580[_[_0x9f7d('0xa1')](_0x460ba2['toLowerCase']())+_0x9f7d('0xa5')]=Number(_0x1a4419[_0x9f7d('0x5c')][_0x9f7d('0x5f')][_0x547040]);socket[_0x9f7d('0xa6')]('user'+_['capitalize'](_0x460ba2[_0x9f7d('0xa2')]())+_0x9f7d('0xa7'),_0x19a580);}return _0xcf6c66;})[_0x9f7d('0x12')](function(){if(_0x460ba2==='voice'){return db['VoiceQueue'][_0x9f7d('0x44')]({'where':{'id':_0x1a4419['body'][_0x9f7d('0x5f')]||[]},'raw':!![],'attributes':['id',_0x9f7d('0x33')]});}})[_0x9f7d('0x12')](function(_0x207306){var _0x3955da=_0x1dd2a7[_0x9f7d('0x28')]({'plain':!![]});var _0x38f334=[];if(_0x460ba2==='voice'&&_0x3955da['role']==='agent'&&_0x3955da[_0x9f7d('0x9b')]){for(var _0x11628c=0x0;_0x11628c<_0x207306[_0x9f7d('0x48')];_0x11628c+=0x1){_0x38f334[_0x9f7d('0x43')]({'membername':_0x3955da['name'],'UserId':_0x3955da['id'],'queue_name':_0x207306[_0x11628c][_0x9f7d('0x33')],'VoiceQueueId':_0x207306[_0x11628c]['id'],'interface':_['isNil'](_0x3955da[_0x9f7d('0xa8')])?util['format'](_0x9f7d('0xa9'),_0x3955da[_0x9f7d('0x33')]):_0x3955da[_0x9f7d('0xa8')],'paused':_0x3955da[_0x9f7d('0x9d')]||![],'penalty':_0x1a4419[_0x9f7d('0x5c')][_0x9f7d('0xaa')]||0x0});}return BPromise['each'](_0x38f334,function(_0x1e835c){return db[_0x9f7d('0xab')][_0x9f7d('0xac')](_0x1e835c);});}return _0x1dd2a7;});}})[_0x9f7d('0x12')](respondWithStatusCode(_0x4bcd56,null))[_0x9f7d('0x5b')](handleError(_0x4bcd56,null));};exports[_0x9f7d('0xad')]=function(_0xca00ea,_0x73efd3){var _0x55fc5b;return db[_0x9f7d('0x38')][_0x9f7d('0x32')]({'where':{'id':_0xca00ea[_0x9f7d('0x4f')]['id']},'attributes':['id','name',_0x9f7d('0x29')]})[_0x9f7d('0x12')](handleEntityNotFound(_0x73efd3,null))[_0x9f7d('0x12')](function(_0x4eaef0){if(_0x4eaef0){_0x55fc5b=_0x4eaef0;if(!_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0xae')]||!utils['isValidChannel'](_0xca00ea[_0x9f7d('0x46')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x4eaef0[_0x9f7d('0xaf')+_[_0x9f7d('0xa1')](_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0xae')][_0x9f7d('0xa2')]())+_0x9f7d('0xa3')](_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0x5f')]);}})[_0x9f7d('0x12')](function(_0xf13d93){if(_[_0x9f7d('0xb0')](_0xca00ea['query'][_0x9f7d('0x5f')])){for(var _0x5d8c44=0x0;_0x5d8c44<_0xca00ea['query'][_0x9f7d('0x5f')]['length'];_0x5d8c44+=0x1){var _0x1a038b={'UserId':Number(_0xca00ea['params']['id'])};_0x1a038b[_['capitalize'](_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0xae')][_0x9f7d('0xa2')]())+_0x9f7d('0xa5')]=Number(_0xca00ea[_0x9f7d('0x46')]['ids'][_0x5d8c44]);socket['emit'](_0x9f7d('0x7a')+_['capitalize'](_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0xae')][_0x9f7d('0xa2')]())+_0x9f7d('0xb1'),_0x1a038b);}}else{var _0x1a038b={'UserId':Number(_0xca00ea['params']['id'])};_0x1a038b[_[_0x9f7d('0xa1')](_0xca00ea[_0x9f7d('0x46')]['channel'][_0x9f7d('0xa2')]())+'QueueId']=Number(_0xca00ea[_0x9f7d('0x46')]['ids']);socket[_0x9f7d('0xa6')]('user'+_['capitalize'](_0xca00ea[_0x9f7d('0x46')]['channel'][_0x9f7d('0xa2')]())+'Queue:remove',_0x1a038b);}return _0xf13d93;})[_0x9f7d('0x12')](function(){if(_0xca00ea['query'][_0x9f7d('0xae')]===_0x9f7d('0xb2')){return db[_0x9f7d('0xab')]['destroy']({'where':{'UserId':_0xca00ea['params']['id'],'VoiceQueueId':_0xca00ea[_0x9f7d('0x46')][_0x9f7d('0x5f')]},'individualHooks':!![]})[_0x9f7d('0x12')](function(){return _0x55fc5b;});}return _0x55fc5b;})[_0x9f7d('0x12')](respondWithStatusCode(_0x73efd3,null))[_0x9f7d('0x5b')](handleError(_0x73efd3,null));};exports['addAvatar']=function(_0x4d26aa,_0x14b8e3){_0x4d26aa[_0x9f7d('0x5c')]['userpic']=_0x4d26aa[_0x9f7d('0xb3')][_0x9f7d('0xb4')];return db[_0x9f7d('0x38')][_0x9f7d('0x32')]({'where':{'id':_0x4d26aa['params']['id']}})[_0x9f7d('0x12')](handleEntityNotFound(_0x14b8e3,null))['then'](saveUpdates(_0x4d26aa[_0x9f7d('0x5c')],null))['then'](respondWithResult(_0x14b8e3,null))[_0x9f7d('0x5b')](handleError(_0x14b8e3,null));};exports[_0x9f7d('0xb5')]=function(_0x4b594a,_0x250291){var _0x46a884=path[_0x9f7d('0xb6')](config[_0x9f7d('0xb7')],_0x9f7d('0xb8'));return db[_0x9f7d('0x38')]['find']({'where':{'id':_0x4b594a[_0x9f7d('0x4f')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x9f7d('0x12')](handleEntityNotFound(_0x250291,null))[_0x9f7d('0x12')](function(_0xa6c8a1){if(_0xa6c8a1){if(_[_0x9f7d('0x66')](_0xa6c8a1[_0x9f7d('0xb9')])){return _0x250291['download'](_0x46a884);}else{if(!fs['existsSync'](path[_0x9f7d('0xb6')](config[_0x9f7d('0xb7')],_0x9f7d('0xba'),_0xa6c8a1[_0x9f7d('0xb9')]))){return _0x250291[_0x9f7d('0xbb')](_0x46a884);}return _0x250291[_0x9f7d('0xbb')](path[_0x9f7d('0xb6')](config[_0x9f7d('0xb7')],_0x9f7d('0xba'),_0xa6c8a1[_0x9f7d('0xb9')]));}}})[_0x9f7d('0x5b')](handleError(_0x250291,null));};exports['getOpenTabs']=function(_0x133083,_0x2b1731){return db[_0x9f7d('0x38')][_0x9f7d('0x32')]({'where':{'id':_0x133083[_0x9f7d('0x4f')]['id']},'attributes':['id']})[_0x9f7d('0x12')](handleEntityNotFound(_0x2b1731,null))[_0x9f7d('0x12')](function(_0x5b0377){var _0x36e0d2=[];values=_0x5b0377[_0x9f7d('0x4a')];_0x36e0d2[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x49'),_0x5b0377[_0x9f7d('0x4a')]));_0x36e0d2[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x59'),_0x5b0377['dataValues']));_0x36e0d2[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x4c'),_0x5b0377[_0x9f7d('0x4a')]));_0x36e0d2[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0x5a'),_0x5b0377[_0x9f7d('0x4a')]));_0x36e0d2[_0x9f7d('0x43')](get_open_tabs('fax',_0x5b0377[_0x9f7d('0x4a')]));_0x36e0d2[_0x9f7d('0x43')](get_open_tabs(_0x9f7d('0xbc'),_0x5b0377[_0x9f7d('0x4a')]));return BPromise['all'](_0x36e0d2);})['then'](function(_0x307502){var _0x33a80f=[];if(_0x307502){for(var _0x1a8d3a=0x0;_0x1a8d3a=_0x136452){_0xa846d8=_0x136452;_0x220efb=0xc8;}else{_0x220efb=0xce;}_0x51243c[_0x6b01('0x19')](_0x220efb);return _0x51243c[_0x6b01('0x20')](_0x6b01('0x21'),_0x152dda+'-'+_0xa846d8+'/'+_0x136452)['json'](_0x70a1c0);}return null;};}function saveUpdates(_0x54f030){return function(_0x3fae61){if(_0x3fae61){return _0x3fae61[_0x6b01('0x22')](_0x54f030)[_0x6b01('0xf')](function(_0x8883d1){return _0x8883d1;});}return null;};}function removeEntity(_0x2a894e){return function(_0x25d38d){if(_0x25d38d){return _0x25d38d['destroy']()[_0x6b01('0xf')](function(){var _0x5482a8=_0x25d38d[_0x6b01('0x23')]({'plain':!![]});if(_0x5482a8['role']===_0x6b01('0x24'))return;var _0xa6b2b6=[{'name':_0x6b01('0x25'),'value':_0x6b01('0x26'),'ignore':!![]},{'name':_0x6b01('0x27'),'value':'agent','ignore':![]},{'name':_0x6b01('0x28'),'value':_0x6b01('0x29'),'ignore':![]}];var _0x3bb4b1=_(_0xa6b2b6)['filter']('ignore')[_0x6b01('0x2a')]('value')[_0x6b01('0x2b')]();if(_[_0x6b01('0x2c')](_0x3bb4b1,_0x5482a8[_0x6b01('0x2d')])){return;}var _0x536641=_[_0x6b01('0x2e')](_0xa6b2b6,[_0x6b01('0x2b'),_0x5482a8[_0x6b01('0x2d')]])['name'];return db[_0x6b01('0x2f')][_0x6b01('0x30')]({'where':{'type':_0x536641,'resourceId':_0x5482a8['id']}})[_0x6b01('0xf')](function(){return _0x25d38d;});})[_0x6b01('0xf')](function(){_0x2a894e[_0x6b01('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa041ea){return function(_0x20ee6d){if(!_0x20ee6d){_0xa041ea[_0x6b01('0x18')](0x194);}return _0x20ee6d;};}function handleError(_0x5269c7,_0xce4545){_0xce4545=_0xce4545||0x1f4;return function(_0xc644f2){logger[_0x6b01('0x13')](_0xc644f2[_0x6b01('0x31')]);if(_0xc644f2['name']){delete _0xc644f2[_0x6b01('0x32')];}_0x5269c7['status'](_0xce4545)[_0x6b01('0x33')](_0xc644f2);};}exports[_0x6b01('0x34')]=function(_0x1baac5,_0x318b8b){var _0x167d08={},_0x457c93={'count':0x0,'rows':[]};var _0x3df1d8=_(db['User'][_0x6b01('0x35')])[_0x6b01('0x2a')](function(_0x2c3385){return{'name':_0x2c3385[_0x6b01('0x36')],'type':_0x2c3385[_0x6b01('0x37')][_0x6b01('0x38')]};})[_0x6b01('0x39')](function(_0x44bf46){return!_['includes']([_0x6b01('0x3a'),'salt'],_0x44bf46[_0x6b01('0x32')]);})[_0x6b01('0x2b')]();_0x167d08=qs['getOptions'](_0x3df1d8,_0x1baac5);var _0x37ae5d={'where':_0x167d08[_0x6b01('0x3b')]};return db[_0x6b01('0x3c')][_0x6b01('0x1f')](_0x37ae5d)[_0x6b01('0xf')](function(_0x33a9ea){_0x457c93[_0x6b01('0x1f')]=_0x33a9ea;if(_0x1baac5[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x167d08[_0x6b01('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x167d08[_0x6b01('0x40')],'id')){_0x167d08[_0x6b01('0x40')]['push']('id');}return db['User'][_0x6b01('0x41')](_0x167d08);})[_0x6b01('0xf')](function(_0x558ec1){_0x457c93[_0x6b01('0x42')]=_0x558ec1;if(_0x1baac5[_0x6b01('0x3d')]['openTabs']===_0x6b01('0x43')){var _0x5e6f28=[];for(var _0x2ab117=0x0;_0x2ab117<_0x457c93[_0x6b01('0x42')][_0x6b01('0x44')];_0x2ab117++){_0x5e6f28['push'](get_open_tabs(_0x6b01('0x45'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28['push'](get_open_tabs('sms',_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28['push'](get_open_tabs(_0x6b01('0x49'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x4a'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28[_0x6b01('0x47')](get_open_tabs('whatsapp',_0x457c93['rows'][_0x2ab117][_0x6b01('0x46')]));}return BPromise[_0x6b01('0x4b')](_0x5e6f28)['then'](function(_0x408bb0){return _0x457c93;});}else{return _0x457c93;}})[_0x6b01('0xf')](respondWithFilteredResult(_0x318b8b,_0x167d08))[_0x6b01('0x17')](handleError(_0x318b8b,null));};exports['show']=function(_0x51eec0,_0x5545f6){var _0x24b860={'raw':![],'where':{'id':_0x51eec0['params']['id']}},_0x12160f={};_0x12160f[_0x6b01('0x4c')]=_['differenceBy'](_['keys'](db['User'][_0x6b01('0x35')]),[_0x6b01('0x3a'),'salt']);_0x12160f['query']=_[_0x6b01('0x4d')](_0x51eec0['query']);_0x12160f[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x12160f[_0x6b01('0x4c')],_0x12160f[_0x6b01('0x3d')]);_0x24b860[_0x6b01('0x40')]=_['intersection'](_0x12160f[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x51eec0[_0x6b01('0x3d')]['fields']));_0x24b860[_0x6b01('0x40')]=_0x24b860[_0x6b01('0x40')]['length']?_0x24b860[_0x6b01('0x40')]:_0x12160f[_0x6b01('0x4c')];if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x24b860['include']=[{'all':!![]}];}_0x24b860=_['merge']({},_0x24b860,_0x51eec0[_0x6b01('0x51')]);if(!_['includes'](_0x24b860['attributes'],'id')){_0x24b860[_0x6b01('0x40')][_0x6b01('0x47')]('id');}return db['User'][_0x6b01('0x2e')](_0x24b860)[_0x6b01('0xf')](handleEntityNotFound(_0x5545f6,null))['then'](function(_0x1bd851){var _0x1ce46d=[];values=_0x1bd851;if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x52')]===_0x6b01('0x43')){_0x1ce46d['push'](get_open_tabs(_0x6b01('0x45'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x53'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs(_0x6b01('0x4a'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x54'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs('mail',_0x1bd851[_0x6b01('0x46')]));return BPromise[_0x6b01('0x4b')](_0x1ce46d);}else{return values;}})[_0x6b01('0xf')](function(_0x4e1702){return values;})[_0x6b01('0xf')](respondWithResult(_0x5545f6,null))[_0x6b01('0x17')](handleError(_0x5545f6,null));};exports[_0x6b01('0x22')]=function(_0x5459d5,_0x54b3ae){if(_0x5459d5[_0x6b01('0x55')]['id']){delete _0x5459d5[_0x6b01('0x55')]['id'];}delete _0x5459d5['body'][_0x6b01('0x2d')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5459d5[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x54b3ae,null))[_0x6b01('0xf')](saveUpdates(_0x5459d5[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x54b3ae,null))[_0x6b01('0x17')](handleError(_0x54b3ae,null));};exports['describe']=function(_0x2aa892,_0x204a9a){return db[_0x6b01('0x3c')][_0x6b01('0x57')]()[_0x6b01('0xf')](respondWithResult(_0x204a9a,null))[_0x6b01('0x17')](handleError(_0x204a9a,null));};exports[_0x6b01('0x58')]=function(_0x289294,_0x281e55){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x289294[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x281e55,null))[_0x6b01('0xf')](function(_0xef971f){if(_0xef971f){return _0xef971f[_0x6b01('0x58')](_0x289294['body']['ids'],_[_0x6b01('0x59')](_0x289294[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x281e55,null))[_0x6b01('0x17')](handleError(_0x281e55,null));};function validateUser(_0x41e8dc){return new BPromise(function(_0x59bf90,_0x2bd87d){if(_0x41e8dc[_0x6b01('0x5b')])return _0x59bf90(_0x41e8dc);return db[_0x6b01('0x5c')][_0x6b01('0x5d')](0x1)[_0x6b01('0xf')](function(_0xf31bfa){if(_0xf31bfa[_0x6b01('0x5e')])authService['validatePasswordPattern'](_0x41e8dc[_0x6b01('0x3a')]);db['User'][_0x6b01('0x5f')](_0x6b01('0x5b'))[_0x6b01('0xf')](function(_0x48bfcd){if(_[_0x6b01('0x60')](_0x48bfcd)){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')]||0x1;return;}if(_[_0x6b01('0x60')](_0xf31bfa[_0x6b01('0x61')])||_0xf31bfa[_0x6b01('0x61')]===_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0x48bfcd+0x1;return;}if(_0xf31bfa[_0x6b01('0x61')]>_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];return;}return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x6b01('0x63'),{'type':db[_0x6b01('0x62')][_0x6b01('0x64')][_0x6b01('0x65')]})[_0x6b01('0xf')](function(_0x3f077f){if(_0x3f077f&&_0x3f077f[_0x6b01('0x44')]){for(var _0x4a8fcb=0x0,_0x27526f=_0x3f077f[_0x6b01('0x44')];_0x4a8fcb<_0x27526f&&_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')]);_0x4a8fcb++){if(_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]){_0x41e8dc[_0x6b01('0x5b')]=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')];}else if(_0xf31bfa[_0x6b01('0x61')]>_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]&&_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb]['to']){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];}}}if(_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')])){_0x41e8dc['internal']=_0x48bfcd+0x1;}return _0x59bf90(_0x41e8dc);});});})[_0x6b01('0x17')](function(_0x2d42ec){_0x2bd87d(_0x2d42ec);});});}function updateUser(_0x19a6d9){return new BPromise(function(_0x3ec668,_0x191348){try{if(_0x19a6d9[_0x6b01('0x67')]){_0x19a6d9[_0x6b01('0x68')]=_0x19a6d9[_0x6b01('0x5b')];_0x19a6d9[_0x6b01('0x69')]={'mailbox':_0x19a6d9[_0x6b01('0x5b')],'password':_0x19a6d9[_0x6b01('0x3a')],'fullname':_0x19a6d9[_0x6b01('0x6a')],'email':_0x19a6d9[_0x6b01('0x6b')]};}if(_0x19a6d9[_0x6b01('0x2d')]===_0x6b01('0x6c')){if(!_0x19a6d9[_0x6b01('0x6d')])_0x19a6d9[_0x6b01('0x6d')]=[_0x6b01('0x6e'),_0x6b01('0x6f'),_0x6b01('0x70'),'113','110','104','105',_0x6b01('0x71'),'107','108','109',_0x6b01('0x72'),'111',_0x6b01('0x73'),_0x6b01('0x74')];}_0x3ec668(_0x19a6d9);}catch(_0x44ac98){_0x191348(_0x44ac98);}});}exports[_0x6b01('0x75')]=function(_0x3bd5d3,_0x59f807){if(_0x3bd5d3['user'][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_0x3bd5d3['body'][_0x6b01('0x2d')]===_0x6b01('0x26')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bd5d3[_0x6b01('0x55')]['role']===_0x6b01('0x24')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x77'));}return licenseUtil['checkUserLimits']([_0x3bd5d3[_0x6b01('0x55')]])[_0x6b01('0xf')](function(){return validateUser(_0x3bd5d3[_0x6b01('0x55')]);})[_0x6b01('0xf')](function(_0x4dbd69){return updateUser(_0x4dbd69)[_0x6b01('0xf')](function(_0x27c738){if(_0x27c738[_0x6b01('0x2d')]===_0x6b01('0x24')){_0x27c738[_0x6b01('0x78')]=_0x3bd5d3[_0x6b01('0x26')]['settingsEnabled'];delete _0x27c738['userProfileId'];}return _0x27c738;});})['then'](function(_0x16fa3b){return db[_0x6b01('0x3c')]['create'](_0x16fa3b,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]});})[_0x6b01('0xf')](function(_0x2c2c1c){if(_0x3bd5d3['body'][_0x6b01('0x2d')]==='user')return _0x2c2c1c;if(_0x3bd5d3[_0x6b01('0x26')]['role']!==_0x6b01('0x26'))return _0x2c2c1c;return db['UserProfileSection'][_0x6b01('0x2e')]({'where':{'name':_0x2c2c1c[_0x6b01('0x2d')]===_0x6b01('0x6c')?_0x6b01('0x27'):_0x6b01('0x28'),'userProfileId':_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})['then'](function(_0xc8f10){if(!_0xc8f10||_0xc8f10['autoAssociation']!=0x0)return _0x2c2c1c;return db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x2c2c1c[_0x6b01('0x32')],'resourceId':_0x2c2c1c['id'],'type':_0xc8f10[_0x6b01('0x32')],'sectionId':_0xc8f10['id']},{})[_0x6b01('0xf')](function(){return _0x2c2c1c;});})[_0x6b01('0x17')](function(_0x30ac0c){logger[_0x6b01('0x13')](_0x6b01('0x7a'),_0x30ac0c);throw _0x30ac0c;});})[_0x6b01('0xf')](respondWithResult(_0x59f807,0xc9))[_0x6b01('0x17')](handleError(_0x59f807,null));};exports['bulkCreate']=function(_0x1e9300,_0x4091a8){var _0x197c8d=_0x1e9300[_0x6b01('0x55')];var _0x5ac0b6=[];if(_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_[_0x6b01('0x7b')](_0x197c8d,['role',_0x6b01('0x26')])&&_0x1e9300['user'][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7c'));}if(_[_0x6b01('0x7b')](_0x197c8d,[_0x6b01('0x2d'),_0x6b01('0x24')])&&_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7d'));}return licenseUtil[_0x6b01('0x7e')](_0x197c8d)[_0x6b01('0xf')](function(){return validateUser(_0x197c8d[0x0]);})[_0x6b01('0xf')](function(){for(var _0x748219=0x1;_0x748219<_0x197c8d['length'];_0x748219++){var _0x2f180=_0x197c8d[_0x748219-0x1]['internal'];if(!_0x197c8d[_0x748219]['internal'])_0x197c8d[_0x748219][_0x6b01('0x5b')]=_0x2f180+0x1;_0x5ac0b6[_0x6b01('0x47')](validateUser(_0x197c8d[_0x748219]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})[_0x6b01('0xf')](function(){_0x5ac0b6=[];for(var _0x5dc77c=0x0;_0x5dc77c<_0x197c8d[_0x6b01('0x44')];_0x5dc77c++){_0x5ac0b6[_0x6b01('0x47')](updateUser(_0x197c8d[_0x5dc77c]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})['then'](function(){return BPromise[_0x6b01('0x7f')](_0x197c8d,function(_0x327f31){return db[_0x6b01('0x3c')][_0x6b01('0x75')](_0x327f31,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]})[_0x6b01('0xf')](function(_0x21b294){_0x327f31['id']=_0x21b294['id'];return _0x327f31;});});})['then'](function(_0x135aeb){if(_0x1e9300[_0x6b01('0x55')][_0x6b01('0x2d')]===_0x6b01('0x26'))return _0x135aeb;if(_0x1e9300['user']['role']!==_0x6b01('0x26'))return _0x135aeb;var _0x191fc0=_[_0x6b01('0x7b')](_0x135aeb,function(_0xcd8de3){return _0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x6c')||_0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x29');});if(!_0x191fc0)return _0x135aeb;return db['UserProfileSection'][_0x6b01('0x41')]({'where':{'name':{'$or':[_0x6b01('0x27'),_0x6b01('0x28')]},'userProfileId':_0x1e9300[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})[_0x6b01('0xf')](function(_0x188010){if(_['isEmpty'](_0x188010)||!_[_0x6b01('0x7b')](_0x188010,['autoAssociation',0x0]))return _0x135aeb;_0x5ac0b6=[];var _0xe9de3b=_(_0x188010)[_0x6b01('0x2a')](function(_0x16f234){if(_0x16f234[_0x6b01('0x80')]===0x1)return;return _0x16f234[_0x6b01('0x32')]==='Agents'?_0x6b01('0x6c'):'telephone';})[_0x6b01('0x81')]()[_0x6b01('0x2b')]();for(var _0x59141e=0x0;_0x59141e<_0x135aeb[_0x6b01('0x44')];_0x59141e++){if(!_[_0x6b01('0x2c')](_0xe9de3b,_0x135aeb[_0x59141e][_0x6b01('0x2d')]))return;var _0x2cc3eb=_0x135aeb[_0x59141e][_0x6b01('0x2d')]==='agent'?'Agents':_0x6b01('0x28');_0x5ac0b6[_0x6b01('0x47')](db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x135aeb[_0x59141e][_0x6b01('0x32')],'resourceId':_0x135aeb[_0x59141e]['id'],'type':_0x2cc3eb,'sectionId':_[_0x6b01('0x2e')](_0x188010,[_0x6b01('0x32'),_0x2cc3eb])['id']},{}));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);});})[_0x6b01('0xf')](respondWithResult(_0x4091a8,0xc9))['catch'](handleError(_0x4091a8,null));};exports[_0x6b01('0x82')]=function(_0x5ee5ed,_0x7ac756){if(_0x5ee5ed['body']['id']){delete _0x5ee5ed[_0x6b01('0x55')]['id'];}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5ee5ed['params']['id']}})[_0x6b01('0xf')](function(_0xa9cd5f){if(!_0xa9cd5f)return null;if(_0xa9cd5f['id']===_0x5ee5ed[_0x6b01('0x26')]['id']){if(!_0x5ee5ed['body'][_0x6b01('0x83')]||!_0x5ee5ed[_0x6b01('0x55')]['newPassword']){throw new db[(_0x6b01('0x84'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xa9cd5f[_0x6b01('0x85')](_0x5ee5ed[_0x6b01('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Wrong\x20credentials');}if(_0x5ee5ed['body'][_0x6b01('0x83')]===_0x5ee5ed['body'][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x88'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x24')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x26')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}if(_0xa9cd5f[_0x6b01('0x2d')]!=='agent'){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}return _0xa9cd5f;})[_0x6b01('0xf')](handleEntityNotFound(_0x7ac756,null))[_0x6b01('0xf')](function(_0x5736fe){return db[_0x6b01('0x5c')][_0x6b01('0x8a')]({'attributes':['id','securePassword',_0x6b01('0x8b'),_0x6b01('0x8c')]})[_0x6b01('0xf')](function(_0x51f42e){if(_0x51f42e[_0x6b01('0x5e')])authService[_0x6b01('0x8d')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]);if(!_0x51f42e['enforcePasswordHistory']||!_0x5736fe['previousPasswords'])return _0x5736fe;authService[_0x6b01('0x8e')](_0x5ee5ed[_0x6b01('0x55')]['newPassword'],_0x5736fe[_0x6b01('0x8f')],_0x51f42e[_0x6b01('0x8c')]);return _0x5736fe;})[_0x6b01('0xf')](saveUpdates({'password':_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],'passwordResetAt':_0x5ee5ed[_0x6b01('0x26')]['id']==_0x5ee5ed['params']['id']?moment():null,'previousPasswords':authService[_0x6b01('0x90')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],_0x5736fe[_0x6b01('0x8f')])},null));})[_0x6b01('0xf')](respondWithResult(_0x7ac756,null))[_0x6b01('0x17')](handleError(_0x7ac756,null));};exports['addQueues']=function(_0x471015,_0x3db037){var _0x59cdd1=_0x471015[_0x6b01('0x55')][_0x6b01('0x91')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x471015[_0x6b01('0x56')]['id']},'attributes':['id','name',_0x6b01('0x2d'),_0x6b01('0x92'),_0x6b01('0x93'),_0x6b01('0x94'),_0x6b01('0x95')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3db037,null))[_0x6b01('0xf')](function(_0x19167c){if(_0x19167c){if(!utils[_0x6b01('0x96')](_0x59cdd1)){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}return _0x19167c[_0x6b01('0x98')+_[_0x6b01('0x99')](_0x59cdd1[_0x6b01('0x9a')]())+'Queues'](_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')],{'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0})[_0x6b01('0x9b')](function(_0x2877ea){for(var _0x424865=0x0;_0x424865<_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x424865+=0x1){var _0x4ade00={'UserId':Number(_0x471015['params']['id'])};_0x4ade00[_['capitalize'](_0x59cdd1['toLowerCase']())+_0x6b01('0x9c')]=Number(_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x424865]);socket['emit'](_0x6b01('0x26')+_['capitalize'](_0x59cdd1[_0x6b01('0x9a')]())+'Queue:save',_0x4ade00);}return _0x2877ea;})[_0x6b01('0xf')](function(){if(_0x59cdd1===_0x6b01('0x9d')){return db[_0x6b01('0x9e')][_0x6b01('0x41')]({'where':{'id':_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')]||[]},'raw':!![],'attributes':['id',_0x6b01('0x32')]});}})[_0x6b01('0xf')](function(_0x353f84){var _0x4ad87a=_0x19167c['get']({'plain':!![]});var _0x40aaaa=[];if(_0x59cdd1===_0x6b01('0x9d')&&_0x4ad87a[_0x6b01('0x2d')]==='agent'&&_0x4ad87a['online']){for(var _0x446b91=0x0;_0x446b91<_0x353f84['length'];_0x446b91+=0x1){_0x40aaaa[_0x6b01('0x47')]({'membername':_0x4ad87a[_0x6b01('0x32')],'UserId':_0x4ad87a['id'],'queue_name':_0x353f84[_0x446b91][_0x6b01('0x32')],'VoiceQueueId':_0x353f84[_0x446b91]['id'],'interface':_[_0x6b01('0x60')](_0x4ad87a[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x4ad87a[_0x6b01('0x32')]):_0x4ad87a[_0x6b01('0x95')],'paused':_0x4ad87a[_0x6b01('0x94')]||![],'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0});}return BPromise[_0x6b01('0x7f')](_0x40aaaa,function(_0x52d6b4){return db['UserVoiceQueueRt']['upsert'](_0x52d6b4);});}return _0x19167c;});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3db037,null))['catch'](handleError(_0x3db037,null));};exports[_0x6b01('0xa1')]=function(_0x33b13f,_0x3a8609){var _0x26aa9b;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x33b13f[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3a8609,null))[_0x6b01('0xf')](function(_0x14df77){if(_0x14df77){_0x26aa9b=_0x14df77;if(!_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]||!utils[_0x6b01('0x96')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Unknown\x20channel');}return _0x14df77[_0x6b01('0xa2')+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]['toLowerCase']())+'Queues'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](function(_0x34adde){if(_[_0x6b01('0xa3')](_0x33b13f[_0x6b01('0x3d')]['ids'])){for(var _0x5a7af0=0x0;_0x5a7af0<_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5a7af0+=0x1){var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+'QueueId']=Number(_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x5a7af0]);socket[_0x6b01('0xa4')](_0x6b01('0x26')+_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel']['toLowerCase']())+'Queue:remove',_0x293fc0);}}else{var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel'][_0x6b01('0x9a')]())+_0x6b01('0x9c')]=Number(_0x33b13f['query'][_0x6b01('0x5a')]);socket['emit']('user'+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+_0x6b01('0xa5'),_0x293fc0);}return _0x34adde;})['then'](function(){if(_0x33b13f['query'][_0x6b01('0x91')]===_0x6b01('0x9d')){return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'UserId':_0x33b13f['params']['id'],'VoiceQueueId':_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]},'individualHooks':!![]})[_0x6b01('0xf')](function(){return _0x26aa9b;});}return _0x26aa9b;})[_0x6b01('0xf')](respondWithStatusCode(_0x3a8609,null))[_0x6b01('0x17')](handleError(_0x3a8609,null));};exports['addAvatar']=function(_0x5175a7,_0x490a27){_0x5175a7['body'][_0x6b01('0xa7')]=_0x5175a7[_0x6b01('0xa8')][_0x6b01('0xa9')];return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5175a7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x490a27,null))[_0x6b01('0xf')](saveUpdates(_0x5175a7[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x490a27,null))[_0x6b01('0x17')](handleError(_0x490a27,null));};exports['getAvatar']=function(_0x1b8867,_0x7e66c2){var _0x141cfc=path[_0x6b01('0xaa')](config[_0x6b01('0xab')],'server/files/images/logos/default_profile.png');return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1b8867[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0xa7')],'raw':!![]})[_0x6b01('0xf')](handleEntityNotFound(_0x7e66c2,null))['then'](function(_0x34b8b4){if(_0x34b8b4){if(_[_0x6b01('0x60')](_0x34b8b4[_0x6b01('0xa7')])){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}else{if(!fs[_0x6b01('0xad')](path['join'](config[_0x6b01('0xab')],'server/files/images/',_0x34b8b4[_0x6b01('0xa7')]))){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}return _0x7e66c2['download'](path[_0x6b01('0xaa')](config[_0x6b01('0xab')],_0x6b01('0xae'),_0x34b8b4[_0x6b01('0xa7')]));}}})['catch'](handleError(_0x7e66c2,null));};exports[_0x6b01('0xaf')]=function(_0x2dcae8,_0x5bab46){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x2dcae8[_0x6b01('0x56')]['id']},'attributes':['id']})[_0x6b01('0xf')](handleEntityNotFound(_0x5bab46,null))[_0x6b01('0xf')](function(_0x45f78f){var _0x463454=[];values=_0x45f78f[_0x6b01('0x46')];_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x45'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('sms',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('openchannel',_0x45f78f[_0x6b01('0x46')]));_0x463454['push'](get_open_tabs('whatsapp',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x49'),_0x45f78f['dataValues']));return BPromise[_0x6b01('0x4b')](_0x463454);})['then'](function(_0x1b2744){var _0x24d53f=[];if(_0x1b2744){for(var _0x3f782a=0x0;_0x3f782a=_0x3cd938[_0x289b('0x55')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x289b('0x23')](function(){if(_0x362e2b){return db['UserVoiceQueueRt'][_0x289b('0x4e')]({'where':{'membername':_0x362e2b[_0x289b('0x2f')]},'individualHooks':!![]});}})[_0x289b('0x23')](function(){if(_0x362e2b){return _0x362e2b['getVoiceQueues']({'raw':!![]});}})[_0x289b('0x23')](function(_0x4c689b){if(_0x362e2b){if(_0x4c689b){var _0x5722bb=[];_0x2a3a48=_0x4c689b;if(_0x2a3a48['length']){for(var _0x4643bb=0x0;_0x4643bb<_0x2a3a48[_0x289b('0x31')];_0x4643bb++){_0x5722bb['push'](db[_0x289b('0x2c')][_0x289b('0x56')]({'membername':_0x362e2b[_0x289b('0x2f')],'UserId':_0x362e2b['id'],'queue_name':_0x2a3a48[_0x4643bb][_0x289b('0x2f')],'VoiceQueueId':_0x2a3a48[_0x4643bb]['id'],'interface':_0x30ae80,'paused':_0x362e2b['loginInPause']||![],'penalty':_0x2a3a48[_0x4643bb][_0x289b('0x57')]||0x0}));}return BPromise[_0x289b('0x4f')](_0x5722bb);}}}})['then'](function(){if(_0x362e2b){return db[_0x289b('0x2e')][_0x289b('0x1a')]({'where':{'membername':_0x362e2b[_0x289b('0x2f')],'exitAt':null}});}})[_0x289b('0x23')](function(_0x537fec){if(_0x362e2b){if(_0x537fec&&_0x537fec[_0x289b('0x31')]){var _0x3ba631=[];_0x537fec[_0x289b('0x36')](function(_0xd5b783){_0x3ba631[_0x289b('0x37')](_0xd5b783[_0x289b('0x2d')]({'exitAt':moment()[_0x289b('0x32')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x289b('0x4f')](_0x3ba631);}}})[_0x289b('0x23')](function(_0x57eeaf){if(_0x362e2b){var _0x25e846=[];var _0x130331=[];var _0x127429=utils[_0x289b('0x35')]();var _0x1c5956={'membername':_0x362e2b['name'],'interface':_0x30ae80,'enterAt':moment()[_0x289b('0x32')](_0x289b('0x33')),'role':_0x362e2b[_0x289b('0x29')],'internal':_0x362e2b[_0x289b('0x2a')]};_0x127429[_0x289b('0x36')](function(_0xb15225){_0x25e846['push'](_[_0x289b('0x58')]({'channel':_0xb15225,'type':_0x289b('0x59'),'data1':'callysquare','data2':_0x30ae80},_0x1c5956));if(_0x362e2b[_0x289b('0x52')]){_0x130331['push'](_['merge']({'channel':_0xb15225,'type':_0x289b('0x30'),'data1':_0x289b('0x5a')},_0x1c5956));}});return db[_0x289b('0x2e')]['bulkCreate'](_0x25e846[_0x289b('0x5b')](_0x130331),{'individualHooks':!![]});}})[_0x289b('0x23')](function(){if(_0x362e2b){return _0x362e2b['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x362e2b[_0x289b('0x52')]||![],'mailPause':_0x362e2b[_0x289b('0x52')]||![],'chatPause':_0x362e2b[_0x289b('0x52')]||![],'faxPause':_0x362e2b[_0x289b('0x52')]||![],'smsPause':_0x362e2b[_0x289b('0x52')]||![],'openchannelPause':_0x362e2b[_0x289b('0x52')]||![],'pauseType':_0x362e2b['loginInPause']?_0x289b('0x5a'):null,'lastPauseAt':moment()[_0x289b('0x32')](_0x289b('0x33')),'interface':_0x30ae80});}})[_0x289b('0x23')](function(_0x3ff56a){_0x4e1316(_0x3ff56a);})[_0x289b('0x18')](function(_0x2f864c){_0x4d7864(_0x3af0ff[_0x289b('0x13')](0x1f4,_0x2f864c[_0x289b('0x15')]));});});}; \ No newline at end of file +var _0xe173=['count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','User','findAll','options','raw','where','limit','include','map','model','attributes','GetUser','ShowUser','find','catch','name','role','internal','UserVoiceQueueRt','update','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','interface','PAUSE','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','Unknown\x20channel','MemberReport','system','mail','chat','sms','openchannel','Pause','all','LogoutUser','destroy','length','LoginUser','mobile','phone'];(function(_0x56c758,_0x540591){var _0x9bb0db=function(_0xdaa197){while(--_0xdaa197){_0x56c758['push'](_0x56c758['shift']());}};_0x9bb0db(++_0x540591);}(_0xe173,0x16a));var _0x3e17=function(_0x4d76d4,_0x880d92){_0x4d76d4=_0x4d76d4-0x0;var _0x32004a=_0xe173[_0x4d76d4];return _0x32004a;};'use strict';var _=require(_0x3e17('0x0'));var util=require(_0x3e17('0x1'));var moment=require(_0x3e17('0x2'));var BPromise=require(_0x3e17('0x3'));var rs=require(_0x3e17('0x4'));var fs=require('fs');var Redis=require(_0x3e17('0x5'));var db=require(_0x3e17('0x6'))['db'];var utils=require(_0x3e17('0x7'));var logger=require(_0x3e17('0x8'))(_0x3e17('0x9'));var config=require(_0x3e17('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e17('0xb')]({'port':0x232a});config[_0x3e17('0xc')]=_[_0x3e17('0xd')](config['redis'],{'host':_0x3e17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e17('0xc')]));require(_0x3e17('0xf'))['register'](socket);function respondWithRpcPromise(_0x586fe7,_0x1c007e,_0x1af69f){return new BPromise(function(_0x23b4a4,_0xc1df88){return client[_0x3e17('0x10')](_0x586fe7,_0x1af69f)[_0x3e17('0x11')](function(_0x3fc0d2){logger[_0x3e17('0x12')](_0x3e17('0x13'),_0x1c007e,_0x3e17('0x14'));logger[_0x3e17('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x1c007e,_0x3e17('0x14'),JSON[_0x3e17('0x16')](_0x3fc0d2));if(_0x3fc0d2[_0x3e17('0x17')]){if(_0x3fc0d2['error']['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x1c007e,_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);return _0xc1df88(_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);}logger[_0x3e17('0x17')](_0x3e17('0x13'),_0x1c007e,_0x3fc0d2[_0x3e17('0x17')]['message']);return _0x23b4a4(_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);}else{logger[_0x3e17('0x12')]('User,\x20%s,\x20%s',_0x1c007e,_0x3e17('0x14'));_0x23b4a4(_0x3fc0d2[_0x3e17('0x19')]['message']);}})['catch'](function(_0x359fc6){logger[_0x3e17('0x17')]('User,\x20%s,\x20%s',_0x1c007e,_0x359fc6);_0xc1df88(_0x359fc6);});});}exports['GetUser']=function(_0x2cf92e){var _0x1f3ee0=this;return new Promise(function(_0x348eb8,_0x3ed43b){return db[_0x3e17('0x1a')][_0x3e17('0x1b')]({'raw':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e['options'][_0x3e17('0x1e')]||null:null,'attributes':_0x2cf92e['options']?_0x2cf92e['options']['attributes']||null:null,'limit':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x1f')]||null:null,'include':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x2cf92e['options'][_0x3e17('0x20')],function(_0x259aec){return{'model':db[_0x259aec['model']],'as':_0x259aec['as'],'attributes':_0x259aec['attributes'],'include':_0x259aec[_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x259aec[_0x3e17('0x20')],function(_0x1adfd9){return{'model':db[_0x1adfd9[_0x3e17('0x22')]],'as':_0x1adfd9['as'],'attributes':_0x1adfd9[_0x3e17('0x23')],'include':_0x1adfd9[_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x1adfd9['include'],function(_0x35e5e0){return{'model':db[_0x35e5e0['model']],'as':_0x35e5e0['as'],'attributes':_0x35e5e0[_0x3e17('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3e17('0x11')](function(_0x3ce745){logger[_0x3e17('0x12')](_0x3e17('0x24'),_0x2cf92e);logger[_0x3e17('0x15')](_0x3e17('0x24'),_0x2cf92e,JSON[_0x3e17('0x16')](_0x3ce745));_0x348eb8(_0x3ce745);})['catch'](function(_0x1bb1da){logger[_0x3e17('0x17')](_0x3e17('0x24'),_0x1bb1da['message'],_0x2cf92e);_0x3ed43b(_0x1f3ee0['error'](0x1f4,_0x1bb1da[_0x3e17('0x18')]));});});};exports[_0x3e17('0x25')]=function(_0x51cefa){var _0x303ff3=this;return new Promise(function(_0xe79e69,_0x51403b){return db['User'][_0x3e17('0x26')]({'raw':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa['options'][_0x3e17('0x1d')]===undefined?!![]:![]:!![],'where':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x1e')]||null:null,'attributes':_0x51cefa['options']?_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x23')]||null:null,'include':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa[_0x3e17('0x1c')]['include']?_[_0x3e17('0x21')](_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x20')],function(_0x1b2e82){return{'model':db[_0x1b2e82[_0x3e17('0x22')]],'as':_0x1b2e82['as'],'attributes':_0x1b2e82[_0x3e17('0x23')],'include':_0x1b2e82[_0x3e17('0x20')]?_['map'](_0x1b2e82[_0x3e17('0x20')],function(_0x2a013b){return{'model':db[_0x2a013b[_0x3e17('0x22')]],'as':_0x2a013b['as'],'attributes':_0x2a013b['attributes'],'include':_0x2a013b['include']?_[_0x3e17('0x21')](_0x2a013b['include'],function(_0x851c80){return{'model':db[_0x851c80[_0x3e17('0x22')]],'as':_0x851c80['as'],'attributes':_0x851c80[_0x3e17('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3e17('0x11')](function(_0x19cc7d){logger[_0x3e17('0x12')]('ShowUser',_0x51cefa);logger['debug']('ShowUser',_0x51cefa,JSON[_0x3e17('0x16')](_0x19cc7d));_0xe79e69(_0x19cc7d);})[_0x3e17('0x27')](function(_0x819926){logger['error'](_0x3e17('0x25'),_0x819926[_0x3e17('0x18')],_0x51cefa);_0x51403b(_0x303ff3['error'](0x1f4,_0x819926[_0x3e17('0x18')]));});});};exports['PauseUser']=function(_0x4426e6){var _0x349a4e=this;return new Promise(function(_0x1acaba,_0x19faca){var _0x5d1063;return db[_0x3e17('0x1a')]['find']({'where':_0x4426e6[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28'),_0x3e17('0x29'),_0x3e17('0x2a'),'interface']})[_0x3e17('0x11')](function(_0x55b33b){if(_0x55b33b){_0x5d1063=_0x55b33b;return db[_0x3e17('0x2b')][_0x3e17('0x2c')]({'paused':0x1},{'where':{'UserId':_0x5d1063['id']},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x5d1063){return db['MemberReport'][_0x3e17('0x1b')]({'where':{'membername':_0x5d1063[_0x3e17('0x28')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x461445){if(_0x5d1063){if(_0x461445&&_0x461445['length']){var _0x2a4922=moment()[_0x3e17('0x2d')](_0x3e17('0x2e'));for(var _0x5a8f9f=0x0,_0x4d9b39=_0x461445['length'];_0x5a8f9f<_0x4d9b39;_0x5a8f9f++){_0x461445[_0x5a8f9f][_0x3e17('0x2f')]({'exitAt':_0x2a4922});}}}})['then'](function(){if(_0x5d1063){var _0x9a3d80=[];var _0x43b695=utils[_0x3e17('0x30')]();_0x43b695[_0x3e17('0x31')](function(_0x2eedce){_0x9a3d80[_0x3e17('0x32')]({'channel':_0x2eedce,'membername':_0x5d1063[_0x3e17('0x28')],'interface':_[_0x3e17('0x33')](_0x5d1063['interface'])?util['format'](_0x3e17('0x34'),_0x5d1063['name']):_0x5d1063[_0x3e17('0x35')],'type':_0x3e17('0x36'),'enterAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data1':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x38')]||'DEFAULT\x20PAUSE','role':_0x5d1063[_0x3e17('0x29')],'internal':_0x5d1063['internal'],'uniqueid':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x39')]||null});});return db['MemberReport'][_0x3e17('0x3a')](_0x9a3d80,{'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x5d1063){return _0x5d1063[_0x3e17('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x38')]||_0x3e17('0x3b'),'lastPauseAt':moment()[_0x3e17('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x3e17('0x11')](function(_0x2492b9){_0x1acaba(_0x2492b9);})[_0x3e17('0x27')](function(_0x4f8e57){_0x19faca(_0x349a4e[_0x3e17('0x17')](0x1f4,_0x4f8e57['message']));});});};exports[_0x3e17('0x3c')]=function(_0x3d6598){var _0x4770b9=this;return new Promise(function(_0x403613,_0x48ce3f){var _0x5e4339;return db[_0x3e17('0x1a')][_0x3e17('0x3d')]({'where':_0x3d6598['options'][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28')]})[_0x3e17('0x11')](function(_0x48136c){if(_0x48136c){_0x5e4339=_0x48136c;if(_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')]&&!utils['isValidChannel'](_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')])){throw new Error(_0x3e17('0x3f'));}switch(_0x3d6598['body']['channel']){case'voice':return db[_0x3e17('0x2b')][_0x3e17('0x2c')]({'paused':0x0},{'where':{'UserId':_0x5e4339['id']}})[_0x3e17('0x11')](function(){return db[_0x3e17('0x40')][_0x3e17('0x26')]({'where':{'channel':_0x3d6598[_0x3e17('0x37')]['channel'],'membername':_0x5e4339[_0x3e17('0x28')],'type':_0x3e17('0x36'),'exitAt':null}});})['then'](function(_0x53fb16){if(_0x53fb16){return _0x53fb16[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data2':_0x3e17('0x41')},{'individualHooks':!![]});}return null;})[_0x3e17('0x11')](function(){return _0x5e4339[_0x3e17('0x2c')]({'voicePause':![]});});case _0x3e17('0x42'):case _0x3e17('0x43'):case'fax':case _0x3e17('0x44'):case _0x3e17('0x45'):case'whatsapp':return db[_0x3e17('0x40')][_0x3e17('0x26')]({'where':{'channel':_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')],'membername':_0x5e4339[_0x3e17('0x28')],'type':_0x3e17('0x36'),'exitAt':null}})[_0x3e17('0x11')](function(_0x516b7d){return _0x516b7d['update']({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data2':'system'},{'individualHooks':!![]});})[_0x3e17('0x11')](function(){var _0x5caa37={};_['set'](_0x5caa37,util[_0x3e17('0x2d')]('%s%s',_0x3d6598[_0x3e17('0x37')]['channel'],_0x3e17('0x46')),![]);return _0x5e4339[_0x3e17('0x2c')](_0x5caa37);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x5e4339['id']}})[_0x3e17('0x11')](function(){return db[_0x3e17('0x40')][_0x3e17('0x1b')]({'where':{'membername':_0x5e4339[_0x3e17('0x28')],'type':'PAUSE','exitAt':null}});})[_0x3e17('0x11')](function(_0x1a69f4){var _0x1681c7=[];_0x1a69f4[_0x3e17('0x31')](function(_0x272305){_0x1681c7[_0x3e17('0x32')](_0x272305[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0x3e17('0x47')](_0x1681c7);})[_0x3e17('0x11')](function(){return _0x5e4339['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x3e17('0x11')](function(_0x2d83e7){_0x403613(_0x2d83e7);})[_0x3e17('0x27')](function(_0x586547){_0x48ce3f(_0x4770b9[_0x3e17('0x17')](0x1f4,_0x586547[_0x3e17('0x18')]));});});};exports[_0x3e17('0x48')]=function(_0x1380eb){var _0x4d447d=this;return new Promise(function(_0x3a9167,_0x1f2d1d){var _0x4c5159;return db[_0x3e17('0x1a')]['findOne']({'where':_0x1380eb[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28')]})[_0x3e17('0x11')](function(_0x2c7146){if(_0x2c7146){_0x4c5159=_0x2c7146;return db[_0x3e17('0x2b')][_0x3e17('0x49')]({'where':{'membername':_0x4c5159[_0x3e17('0x28')]},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x4c5159){return db[_0x3e17('0x40')][_0x3e17('0x1b')]({'where':{'membername':_0x4c5159[_0x3e17('0x28')],'exitAt':null}});}})[_0x3e17('0x11')](function(_0x44d68b){if(_0x4c5159){if(_0x44d68b&&_0x44d68b[_0x3e17('0x4a')]){var _0x4563a6=[];_0x44d68b[_0x3e17('0x31')](function(_0x51a565){_0x4563a6[_0x3e17('0x32')](_0x51a565['update']({'exitAt':moment()['format'](_0x3e17('0x2e'))}));});return BPromise[_0x3e17('0x47')](_0x4563a6);}}})['then'](function(){if(_0x4c5159){return _0x4c5159[_0x3e17('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x3e17('0x11')](function(_0x5a755e){_0x3a9167(_0x5a755e);})[_0x3e17('0x27')](function(_0x19eb50){_0x1f2d1d(_0x4d447d['error'](0x1f4,_0x19eb50['message']));});});};exports[_0x3e17('0x4b')]=function(_0x3e6a2e){var _0xb18c01=this;return new Promise(function(_0x5b200c,_0x54da93){var _0x1bc347;var _0x50436e;var _0x2e361b;var _0x5ef91f;return db[_0x3e17('0x1a')]['findOne']({'where':_0x3e6a2e[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id','name',_0x3e17('0x29'),_0x3e17('0x4c'),_0x3e17('0x4d'),_0x3e17('0x2a'),'loginInPause',_0x3e17('0x35')]})[_0x3e17('0x11')](function(_0x445c03){if(_0x445c03){_0x1bc347=_0x445c03;_0x5ef91f=_0x3e6a2e[_0x3e17('0x37')][_0x3e17('0x35')]?_0x3e6a2e['body'][_0x3e17('0x35')]:util[_0x3e17('0x2d')]('SIP/%s',_0x1bc347['name']);return db['User'][_0x3e17('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1bc347['id']}}});}})[_0x3e17('0x11')](function(_0x141c17){if(_0x141c17){_0x2e361b=_0x141c17;return require(_0x3e17('0x4f'))[_0x3e17('0x50')]();}})['then'](function(_0x516ecd){if(_0x516ecd&&_0x516ecd[_0x3e17('0x51')]&&_0x2e361b>=_0x516ecd[_0x3e17('0x51')]){throw new Error(_0x3e17('0x52'));}})['then'](function(){if(_0x1bc347){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x1bc347[_0x3e17('0x28')]},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x1bc347){return _0x1bc347[_0x3e17('0x53')]({'raw':!![]});}})[_0x3e17('0x11')](function(_0x1cfb5d){if(_0x1bc347){if(_0x1cfb5d){var _0x295ff0=[];_0x50436e=_0x1cfb5d;if(_0x50436e[_0x3e17('0x4a')]){for(var _0x3ccd16=0x0;_0x3ccd16<_0x50436e['length'];_0x3ccd16++){_0x295ff0[_0x3e17('0x32')](db[_0x3e17('0x2b')]['upsert']({'membername':_0x1bc347[_0x3e17('0x28')],'UserId':_0x1bc347['id'],'queue_name':_0x50436e[_0x3ccd16]['name'],'VoiceQueueId':_0x50436e[_0x3ccd16]['id'],'interface':_0x5ef91f,'paused':_0x1bc347[_0x3e17('0x54')]||![],'penalty':_0x50436e[_0x3ccd16]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x3e17('0x47')](_0x295ff0);}}}})['then'](function(){if(_0x1bc347){return db[_0x3e17('0x40')]['findAll']({'where':{'membername':_0x1bc347[_0x3e17('0x28')],'exitAt':null}});}})[_0x3e17('0x11')](function(_0x3d183e){if(_0x1bc347){if(_0x3d183e&&_0x3d183e[_0x3e17('0x4a')]){var _0x38de2e=[];_0x3d183e['forEach'](function(_0x1714e4){_0x38de2e['push'](_0x1714e4[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e'))}));});return BPromise['all'](_0x38de2e);}}})[_0x3e17('0x11')](function(_0x19de30){if(_0x1bc347){var _0x10fe54=[];var _0x4a2366=[];var _0x3bc336=utils['getChannels']();var _0x1f3d7f={'membername':_0x1bc347[_0x3e17('0x28')],'interface':_0x5ef91f,'enterAt':moment()['format'](_0x3e17('0x2e')),'role':_0x1bc347[_0x3e17('0x29')],'internal':_0x1bc347[_0x3e17('0x2a')]};_0x3bc336[_0x3e17('0x31')](function(_0x5a9063){_0x10fe54[_0x3e17('0x32')](_['merge']({'channel':_0x5a9063,'type':'LOGIN','data1':'callysquare','data2':_0x5ef91f},_0x1f3d7f));if(_0x1bc347[_0x3e17('0x54')]){_0x4a2366[_0x3e17('0x32')](_[_0x3e17('0x55')]({'channel':_0x5a9063,'type':_0x3e17('0x36'),'data1':_0x3e17('0x56')},_0x1f3d7f));}});return db['MemberReport'][_0x3e17('0x3a')](_0x10fe54[_0x3e17('0x57')](_0x4a2366),{'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x1bc347){return _0x1bc347[_0x3e17('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x3e17('0x2e')),'voicePause':_0x1bc347[_0x3e17('0x54')]||![],'mailPause':_0x1bc347['loginInPause']||![],'chatPause':_0x1bc347[_0x3e17('0x54')]||![],'faxPause':_0x1bc347[_0x3e17('0x54')]||![],'smsPause':_0x1bc347[_0x3e17('0x54')]||![],'openchannelPause':_0x1bc347[_0x3e17('0x54')]||![],'pauseType':_0x1bc347[_0x3e17('0x54')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5ef91f});}})['then'](function(_0x3341cd){_0x5b200c(_0x3341cd);})[_0x3e17('0x27')](function(_0x2606cd){_0x54da93(_0xb18c01['error'](0x1f4,_0x2606cd['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 174722d..7b63703 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 _0xa8f7=['update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x212bd1,_0x114b38){var _0x5dc71f=function(_0x2673e3){while(--_0x2673e3){_0x212bd1['push'](_0x212bd1['shift']());}};_0x5dc71f(++_0x114b38);}(_0xa8f7,0x106));var _0x7a8f=function(_0x1e8d26,_0x593746){_0x1e8d26=_0x1e8d26-0x0;var _0x409f77=_0xa8f7[_0x1e8d26];return _0x409f77;};'use strict';var UserEvents=require(_0x7a8f('0x0'));var events=[_0x7a8f('0x1'),'remove',_0x7a8f('0x2')];function createListener(_0x3bae7a,_0x4704da){return function(_0x147d3e){_0x4704da[_0x7a8f('0x3')](_0x3bae7a,_0x147d3e);};}function removeListener(_0x1b377f,_0x19b74b){return function(){UserEvents[_0x7a8f('0x4')](_0x1b377f,_0x19b74b);};}exports[_0x7a8f('0x5')]=function(_0x203400){for(var _0x5bb36f=0x0,_0x54b284=events[_0x7a8f('0x6')];_0x5bb36f<_0x54b284;_0x5bb36f++){var _0xfcadbd=events[_0x5bb36f];var _0x4e3335=createListener(_0x7a8f('0x7')+_0xfcadbd,_0x203400);UserEvents['on'](_0xfcadbd,_0x4e3335);}}; \ No newline at end of file +var _0x34c5=['removeListener','length','user:','./user.events','save','remove','update','emit'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x34c5,0x12b));var _0x534c=function(_0x4ae12c,_0x3e7740){_0x4ae12c=_0x4ae12c-0x0;var _0x6bb4bc=_0x34c5[_0x4ae12c];return _0x6bb4bc;};'use strict';var UserEvents=require(_0x534c('0x0'));var events=[_0x534c('0x1'),_0x534c('0x2'),_0x534c('0x3')];function createListener(_0x3f94e6,_0x575e8c){return function(_0x5a7587){_0x575e8c[_0x534c('0x4')](_0x3f94e6,_0x5a7587);};}function removeListener(_0x4eb3c3,_0x44051c){return function(){UserEvents[_0x534c('0x5')](_0x4eb3c3,_0x44051c);};}exports['register']=function(_0x406e9d){for(var _0x4a962f=0x0,_0xed17d7=events[_0x534c('0x6')];_0x4a962f<_0xed17d7;_0x4a962f++){var _0x48c3fa=events[_0x4a962f];var _0x184014=createListener(_0x534c('0x7')+_0x48c3fa,_0x406e9d);UserEvents['on'](_0x48c3fa,_0x184014);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 13991ef..d9b21a1 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x28e27c,_0x2216ff){var _0x45ae93=function(_0x15f539){while(--_0x15f539){_0x28e27c['push'](_0x28e27c['shift']());}};_0x45ae93(++_0x2216ff);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8073e09..d401ea0 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 _0x26e1=['exports','INTEGER','sequelize'];(function(_0x5663df,_0x40500e){var _0x4cc917=function(_0x128739){while(--_0x128739){_0x5663df['push'](_0x5663df['shift']());}};_0x4cc917(++_0x40500e);}(_0x26e1,0x6b));var _0x126e=function(_0x42d7ab,_0x5896f5){_0x42d7ab=_0x42d7ab-0x0;var _0x46b4b6=_0x26e1[_0x42d7ab];return _0x46b4b6;};'use strict';var Sequelize=require(_0x126e('0x0'));module[_0x126e('0x1')]={'penalty':{'type':Sequelize[_0x126e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b31=['exports','INTEGER','sequelize'];(function(_0x21ae7e,_0x2f4e96){var _0x5d44d5=function(_0x4ae811){while(--_0x4ae811){_0x21ae7e['push'](_0x21ae7e['shift']());}};_0x5d44d5(++_0x2f4e96);}(_0x4b31,0x1c4));var _0x14b3=function(_0x2d98c6,_0x89828e){_0x2d98c6=_0x2d98c6-0x0;var _0x1081eb=_0x4b31[_0x2d98c6];return _0x1081eb;};'use strict';var Sequelize=require(_0x14b3('0x0'));module[_0x14b3('0x1')]={'penalty':{'type':Sequelize[_0x14b3('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 823c6b9..af72ccb 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 _0x345c=['../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x345c,0x191));var _0xc345=function(_0x66897f,_0x6bc9c){_0x66897f=_0x66897f-0x0;var _0x158c32=_0x345c[_0x66897f];return _0x158c32;};'use strict';var _=require(_0xc345('0x0'));var util=require(_0xc345('0x1'));var logger=require(_0xc345('0x2'))(_0xc345('0x3'));var moment=require(_0xc345('0x4'));var BPromise=require('bluebird');var rp=require(_0xc345('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc345('0x6'));var config=require(_0xc345('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xc345('0x8')]=function(_0x3caf0f,_0x1e9400){return _0x3caf0f[_0xc345('0x9')](_0xc345('0xa'),attributes,{'tableName':_0xc345('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfaa3=['../../config/environment','define','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0xfaa3,0xe2));var _0x3faa=function(_0x56ab09,_0x652793){_0x56ab09=_0x56ab09-0x0;var _0x1da1f0=_0xfaa3[_0x56ab09];return _0x1da1f0;};'use strict';var _=require(_0x3faa('0x0'));var util=require(_0x3faa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3faa('0x2'));var BPromise=require(_0x3faa('0x3'));var rp=require(_0x3faa('0x4'));var fs=require('fs');var path=require(_0x3faa('0x5'));var rimraf=require('rimraf');var config=require(_0x3faa('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x55d06a,_0x15c0ff){return _0x55d06a[_0x3faa('0x7')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 1933f72..586636e 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 _0x2d30=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x303400,_0x4dd611){var _0x11ac86=function(_0xd176c1){while(--_0xd176c1){_0x303400['push'](_0x303400['shift']());}};_0x11ac86(++_0x4dd611);}(_0x2d30,0xd1));var _0x02d3=function(_0x52c8e8,_0x5ee20d){_0x52c8e8=_0x52c8e8-0x0;var _0x31bb1a=_0x2d30[_0x52c8e8];return _0x31bb1a;};'use strict';var _=require(_0x02d3('0x0'));var util=require('util');var moment=require(_0x02d3('0x1'));var BPromise=require(_0x02d3('0x2'));var rs=require(_0x02d3('0x3'));var fs=require('fs');var Redis=require(_0x02d3('0x4'));var db=require(_0x02d3('0x5'))['db'];var utils=require(_0x02d3('0x6'));var logger=require(_0x02d3('0x7'))(_0x02d3('0x8'));var config=require(_0x02d3('0x9'));var jayson=require(_0x02d3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29a3b6,_0x31a9bf,_0x416a00){return new BPromise(function(_0x1231a3,_0xd1d3b1){return client[_0x02d3('0xb')](_0x29a3b6,_0x416a00)[_0x02d3('0xc')](function(_0x567e81){logger[_0x02d3('0xd')](_0x02d3('0xe'),_0x31a9bf,_0x02d3('0xf'));logger[_0x02d3('0x10')](_0x02d3('0x11'),_0x31a9bf,'request\x20sent',JSON['stringify'](_0x567e81));if(_0x567e81['error']){if(_0x567e81[_0x02d3('0x12')][_0x02d3('0x13')]===0x1f4){logger[_0x02d3('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x31a9bf,_0x567e81['error'][_0x02d3('0x14')]);return _0xd1d3b1(_0x567e81['error'][_0x02d3('0x14')]);}logger[_0x02d3('0x12')](_0x02d3('0xe'),_0x31a9bf,_0x567e81[_0x02d3('0x12')][_0x02d3('0x14')]);return _0x1231a3(_0x567e81[_0x02d3('0x12')][_0x02d3('0x14')]);}else{logger[_0x02d3('0xd')](_0x02d3('0xe'),_0x31a9bf,_0x02d3('0xf'));_0x1231a3(_0x567e81['result'][_0x02d3('0x14')]);}})[_0x02d3('0x15')](function(_0xe42a57){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x31a9bf,_0xe42a57);_0xd1d3b1(_0xe42a57);});});} \ No newline at end of file +var _0x4055=['then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x28261c,_0x4a2cc7){var _0x4f05be=function(_0x49276a){while(--_0x49276a){_0x28261c['push'](_0x28261c['shift']());}};_0x4f05be(++_0x4a2cc7);}(_0x4055,0x19b));var _0x5405=function(_0x24df15,_0x22cb23){_0x24df15=_0x24df15-0x0;var _0x260f07=_0x4055[_0x24df15];return _0x260f07;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5405('0x0'));var rs=require(_0x5405('0x1'));var fs=require('fs');var Redis=require(_0x5405('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5405('0x3'));var logger=require(_0x5405('0x4'))(_0x5405('0x5'));var config=require('../../config/environment');var jayson=require(_0x5405('0x6'));var client=jayson[_0x5405('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c617a,_0x5c8117,_0xe3dd80){return new BPromise(function(_0x4d749d,_0x3ca22e){return client[_0x5405('0x8')](_0x3c617a,_0xe3dd80)[_0x5405('0x9')](function(_0x634b41){logger[_0x5405('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x5c8117,_0x5405('0xb'));logger[_0x5405('0xc')](_0x5405('0xd'),_0x5c8117,_0x5405('0xb'),JSON['stringify'](_0x634b41));if(_0x634b41[_0x5405('0xe')]){if(_0x634b41[_0x5405('0xe')][_0x5405('0xf')]===0x1f4){logger['error'](_0x5405('0x10'),_0x5c8117,_0x634b41[_0x5405('0xe')][_0x5405('0x11')]);return _0x3ca22e(_0x634b41[_0x5405('0xe')]['message']);}logger[_0x5405('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x5c8117,_0x634b41[_0x5405('0xe')][_0x5405('0x11')]);return _0x4d749d(_0x634b41[_0x5405('0xe')]['message']);}else{logger[_0x5405('0xa')](_0x5405('0x10'),_0x5c8117,_0x5405('0xb'));_0x4d749d(_0x634b41[_0x5405('0x12')][_0x5405('0x11')]);}})[_0x5405('0x13')](function(_0x4db0de){logger[_0x5405('0xe')](_0x5405('0x10'),_0x5c8117,_0x4db0de);_0x3ca22e(_0x4db0de);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2523a84..3197a6e 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2c1aee,_0x1a494f){var _0x5e3b51=function(_0x4f3703){while(--_0x4f3703){_0x2c1aee['push'](_0x2c1aee['shift']());}};_0x5e3b51(++_0x1a494f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x51070b,_0x39c85d){var _0x153240=function(_0x7c02f2){while(--_0x7c02f2){_0x51070b['push'](_0x51070b['shift']());}};_0x153240(++_0x39c85d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f7b1a22..fde2f51 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 _0x3a3d=['exports','INTEGER','sequelize'];(function(_0x292bb3,_0x42f74a){var _0x471a07=function(_0x5f45e6){while(--_0x5f45e6){_0x292bb3['push'](_0x292bb3['shift']());}};_0x471a07(++_0x42f74a);}(_0x3a3d,0x146));var _0xd3a3=function(_0x31a14c,_0x5413ed){_0x31a14c=_0x31a14c-0x0;var _0x3e69e0=_0x3a3d[_0x31a14c];return _0x3e69e0;};'use strict';var Sequelize=require(_0xd3a3('0x0'));module[_0xd3a3('0x1')]={'penalty':{'type':Sequelize[_0xd3a3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40de=['exports','INTEGER','sequelize'];(function(_0x4d93c3,_0x375dd5){var _0x453776=function(_0x387449){while(--_0x387449){_0x4d93c3['push'](_0x4d93c3['shift']());}};_0x453776(++_0x375dd5);}(_0x40de,0x101));var _0xe40d=function(_0x4527d8,_0x59e349){_0x4527d8=_0x4527d8-0x0;var _0x1ec91d=_0x40de[_0x4527d8];return _0x1ec91d;};'use strict';var Sequelize=require(_0xe40d('0x0'));module[_0xe40d('0x1')]={'penalty':{'type':Sequelize[_0xe40d('0x2')],'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 6d34187..4a9518a 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 _0xc246=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x1ff59e,_0x57271d){var _0x20f749=function(_0x53e867){while(--_0x53e867){_0x1ff59e['push'](_0x1ff59e['shift']());}};_0x20f749(++_0x57271d);}(_0xc246,0x9f));var _0x6c24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc246[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c24('0x0'));var util=require(_0x6c24('0x1'));var logger=require(_0x6c24('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c24('0x3'));var rp=require(_0x6c24('0x4'));var fs=require('fs');var path=require(_0x6c24('0x5'));var rimraf=require(_0x6c24('0x6'));var config=require(_0x6c24('0x7'));var attributes=require(_0x6c24('0x8'));module[_0x6c24('0x9')]=function(_0x4e21e5,_0x4a3a32){return _0x4e21e5[_0x6c24('0xa')](_0x6c24('0xb'),attributes,{'tableName':_0x6c24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d86=['../../config/environment','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x6d86,0x163));var _0x66d8=function(_0x4d9b93,_0x104f78){_0x4d9b93=_0x4d9b93-0x0;var _0x4bb062=_0x6d86[_0x4d9b93];return _0x4bb062;};'use strict';var _=require(_0x66d8('0x0'));var util=require(_0x66d8('0x1'));var logger=require(_0x66d8('0x2'))(_0x66d8('0x3'));var moment=require(_0x66d8('0x4'));var BPromise=require(_0x66d8('0x5'));var rp=require(_0x66d8('0x6'));var fs=require('fs');var path=require(_0x66d8('0x7'));var rimraf=require(_0x66d8('0x8'));var config=require(_0x66d8('0x9'));var attributes=require(_0x66d8('0xa'));module[_0x66d8('0xb')]=function(_0x89c70,_0x2e8ed0){return _0x89c70['define']('UserFaxQueue',attributes,{'tableName':_0x66d8('0xc'),'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 af9e3ee..1c3903a 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 _0x5ca0=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x5ca0,0x76));var _0x05ca=function(_0x3d3ca0,_0x5f4869){_0x3d3ca0=_0x3d3ca0-0x0;var _0x23d918=_0x5ca0[_0x3d3ca0];return _0x23d918;};'use strict';var _=require('lodash');var util=require(_0x05ca('0x0'));var moment=require(_0x05ca('0x1'));var BPromise=require(_0x05ca('0x2'));var rs=require(_0x05ca('0x3'));var fs=require('fs');var Redis=require(_0x05ca('0x4'));var db=require(_0x05ca('0x5'))['db'];var utils=require(_0x05ca('0x6'));var logger=require('../../config/logger')(_0x05ca('0x7'));var config=require(_0x05ca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x05ca('0x9')][_0x05ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x124fd7,_0x2d247a,_0x55fe2f){return new BPromise(function(_0xfedfb1,_0x21696b){return client[_0x05ca('0xb')](_0x124fd7,_0x55fe2f)[_0x05ca('0xc')](function(_0x2d4987){logger[_0x05ca('0xd')](_0x05ca('0xe'),_0x2d247a,_0x05ca('0xf'));logger[_0x05ca('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2d247a,_0x05ca('0xf'),JSON[_0x05ca('0x11')](_0x2d4987));if(_0x2d4987[_0x05ca('0x12')]){if(_0x2d4987[_0x05ca('0x12')][_0x05ca('0x13')]===0x1f4){logger[_0x05ca('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x2d247a,_0x2d4987[_0x05ca('0x12')][_0x05ca('0x14')]);return _0x21696b(_0x2d4987[_0x05ca('0x12')][_0x05ca('0x14')]);}logger[_0x05ca('0x12')](_0x05ca('0xe'),_0x2d247a,_0x2d4987['error'][_0x05ca('0x14')]);return _0xfedfb1(_0x2d4987[_0x05ca('0x12')][_0x05ca('0x14')]);}else{logger[_0x05ca('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x2d247a,_0x05ca('0xf'));_0xfedfb1(_0x2d4987[_0x05ca('0x15')][_0x05ca('0x14')]);}})[_0x05ca('0x16')](function(_0x5a10f6){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2d247a,_0x5a10f6);_0x21696b(_0x5a10f6);});});} \ No newline at end of file +var _0x0e87=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0x0e87,0xd9));var _0x70e8=function(_0x2f3c4b,_0x1d124e){_0x2f3c4b=_0x2f3c4b-0x0;var _0x479baf=_0x0e87[_0x2f3c4b];return _0x479baf;};'use strict';var _=require(_0x70e8('0x0'));var util=require(_0x70e8('0x1'));var moment=require(_0x70e8('0x2'));var BPromise=require(_0x70e8('0x3'));var rs=require(_0x70e8('0x4'));var fs=require('fs');var Redis=require(_0x70e8('0x5'));var db=require(_0x70e8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x70e8('0x7'))('rpc');var config=require(_0x70e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x70e8('0x9')][_0x70e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dce5b,_0xc30eb9,_0x3168e1){return new BPromise(function(_0x98c2eb,_0x29d806){return client[_0x70e8('0xb')](_0x5dce5b,_0x3168e1)['then'](function(_0x28d5c1){logger[_0x70e8('0xc')](_0x70e8('0xd'),_0xc30eb9,_0x70e8('0xe'));logger[_0x70e8('0xf')](_0x70e8('0x10'),_0xc30eb9,_0x70e8('0xe'),JSON[_0x70e8('0x11')](_0x28d5c1));if(_0x28d5c1[_0x70e8('0x12')]){if(_0x28d5c1[_0x70e8('0x12')][_0x70e8('0x13')]===0x1f4){logger['error'](_0x70e8('0xd'),_0xc30eb9,_0x28d5c1['error']['message']);return _0x29d806(_0x28d5c1[_0x70e8('0x12')][_0x70e8('0x14')]);}logger[_0x70e8('0x12')](_0x70e8('0xd'),_0xc30eb9,_0x28d5c1[_0x70e8('0x12')]['message']);return _0x98c2eb(_0x28d5c1[_0x70e8('0x12')]['message']);}else{logger[_0x70e8('0xc')](_0x70e8('0xd'),_0xc30eb9,_0x70e8('0xe'));_0x98c2eb(_0x28d5c1['result']['message']);}})[_0x70e8('0x15')](function(_0x148c65){logger[_0x70e8('0x12')](_0x70e8('0xd'),_0xc30eb9,_0x148c65);_0x29d806(_0x148c65);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2413f65..7f786dc 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2a2ef3,_0x25cbea){var _0x50c9e4=function(_0x41c0e5){while(--_0x41c0e5){_0x2a2ef3['push'](_0x2a2ef3['shift']());}};_0x50c9e4(++_0x25cbea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b619f,_0xbb6a60){var _0x3c4888=function(_0x1f47e5){while(--_0x1f47e5){_0x3b619f['push'](_0x3b619f['shift']());}};_0x3c4888(++_0xbb6a60);}(_0x70e0,0x17b));var _0x070e=function(_0x562960,_0xa32ae2){_0x562960=_0x562960-0x0;var _0xbb8642=_0x70e0[_0x562960];return _0xbb8642;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e50c01b..8dcd57f 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 _0x135c=['sequelize','exports'];(function(_0x1e47ea,_0x5944f2){var _0x2cdde9=function(_0x476d09){while(--_0x476d09){_0x1e47ea['push'](_0x1e47ea['shift']());}};_0x2cdde9(++_0x5944f2);}(_0x135c,0xda));var _0xc135=function(_0x43b94d,_0x3e2ea6){_0x43b94d=_0x43b94d-0x0;var _0x16ff97=_0x135c[_0x43b94d];return _0x16ff97;};'use strict';var Sequelize=require(_0xc135('0x0'));module[_0xc135('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe8c6=['exports','sequelize'];(function(_0x272170,_0x2e99b2){var _0x202407=function(_0x794b29){while(--_0x794b29){_0x272170['push'](_0x272170['shift']());}};_0x202407(++_0x2e99b2);}(_0xe8c6,0x16b));var _0x6e8c=function(_0x21904f,_0x469d29){_0x21904f=_0x21904f-0x0;var _0x259d09=_0xe8c6[_0x21904f];return _0x259d09;};'use strict';var Sequelize=require(_0x6e8c('0x0'));module[_0x6e8c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 131e30a..6a88283 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 _0x0b46=['define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x202780,_0x4889b5){var _0x386548=function(_0x334391){while(--_0x334391){_0x202780['push'](_0x202780['shift']());}};_0x386548(++_0x4889b5);}(_0x0b46,0x93));var _0x60b4=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0x0b46[_0x1fd675];return _0x521d1c;};'use strict';var _=require(_0x60b4('0x0'));var util=require(_0x60b4('0x1'));var logger=require(_0x60b4('0x2'))('api');var moment=require(_0x60b4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x60b4('0x4'));var rimraf=require(_0x60b4('0x5'));var config=require(_0x60b4('0x6'));var attributes=require(_0x60b4('0x7'));module[_0x60b4('0x8')]=function(_0x4cffde,_0x45240a){return _0x4cffde[_0x60b4('0x9')](_0x60b4('0xa'),attributes,{'tableName':_0x60b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b36=['request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b36,0x1b7));var _0x63b3=function(_0x103d1b,_0x3f34a7){_0x103d1b=_0x103d1b-0x0;var _0x428497=_0x3b36[_0x103d1b];return _0x428497;};'use strict';var _=require(_0x63b3('0x0'));var util=require(_0x63b3('0x1'));var logger=require('../../config/logger')(_0x63b3('0x2'));var moment=require(_0x63b3('0x3'));var BPromise=require(_0x63b3('0x4'));var rp=require(_0x63b3('0x5'));var fs=require('fs');var path=require(_0x63b3('0x6'));var rimraf=require('rimraf');var config=require(_0x63b3('0x7'));var attributes=require(_0x63b3('0x8'));module['exports']=function(_0x2fb838,_0x10af71){return _0x2fb838[_0x63b3('0x9')](_0x63b3('0xa'),attributes,{'tableName':_0x63b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 0eda786..3844d8d 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\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(_0x229985,_0x38cae3){var _0x5e39b5=function(_0x1d6d38){while(--_0x1d6d38){_0x229985['push'](_0x229985['shift']());}};_0x5e39b5(++_0x38cae3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x536076,_0x4c5460){_0x536076=_0x536076-0x0;var _0x246902=_0x7fbe[_0x536076];return _0x246902;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40c886,_0x1a8be4){var _0x19dbd7=function(_0x11c581){while(--_0x11c581){_0x40c886['push'](_0x40c886['shift']());}};_0x19dbd7(++_0x1a8be4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58ed73,_0x5d37b1){_0x58ed73=_0x58ed73-0x0;var _0x1d217c=_0x8ef6[_0x58ed73];return _0x1d217c;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index d2005ad..4f1628f 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 _0xff86=['./userNotification.controller','post','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40d43a,_0x37f8eb){var _0x22d124=function(_0xf7d90a){while(--_0xf7d90a){_0x40d43a['push'](_0x40d43a['shift']());}};_0x22d124(++_0x37f8eb);}(_0xff86,0x116));var _0x6ff8=function(_0x4f5895,_0x8a7e98){_0x4f5895=_0x4f5895-0x0;var _0x3b8878=_0xff86[_0x4f5895];return _0x3b8878;};'use strict';var multer=require(_0x6ff8('0x0'));var util=require(_0x6ff8('0x1'));var path=require('path');var timeout=require(_0x6ff8('0x2'));var express=require(_0x6ff8('0x3'));var router=express[_0x6ff8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ff8('0x5'));var interaction=require(_0x6ff8('0x6'));var config=require(_0x6ff8('0x7'));var controller=require(_0x6ff8('0x8'));router[_0x6ff8('0x9')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0x6ff8('0xa')]=router; \ No newline at end of file +var _0x7cf7=['multer','path','connect-timeout','express','Router','../../components/interaction/service','./userNotification.controller','post','sendUserNotification','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7cf7,0xa0));var _0x77cf=function(_0x3890aa,_0x322574){_0x3890aa=_0x3890aa-0x0;var _0x68f281=_0x7cf7[_0x3890aa];return _0x68f281;};'use strict';var multer=require(_0x77cf('0x0'));var util=require('util');var path=require(_0x77cf('0x1'));var timeout=require(_0x77cf('0x2'));var express=require(_0x77cf('0x3'));var router=express[_0x77cf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x77cf('0x5'));var config=require('../../config/environment');var controller=require(_0x77cf('0x6'));router[_0x77cf('0x7')]('/',auth['isAuthenticated'](),controller[_0x77cf('0x8')]);module[_0x77cf('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index f78cf5c..770753f 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 _0x62fd=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3b142a,_0x21eba7){var _0x54525d=function(_0x46759d){while(--_0x46759d){_0x3b142a['push'](_0x3b142a['shift']());}};_0x54525d(++_0x21eba7);}(_0x62fd,0x184));var _0xd62f=function(_0x2fa996,_0x26e244){_0x2fa996=_0x2fa996-0x0;var _0x302927=_0x62fd[_0x2fa996];return _0x302927;};'use strict';var Sequelize=require('sequelize');module[_0xd62f('0x0')]={'body':{'type':Sequelize[_0xd62f('0x1')]},'senderName':{'type':Sequelize[_0xd62f('0x2')]},'recipientsId':{'type':Sequelize[_0xd62f('0x1')]},'recipientsDescription':{'type':Sequelize[_0xd62f('0x2')]},'beep':{'type':Sequelize[_0xd62f('0x3')]}}; \ No newline at end of file +var _0x29b0=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x29b0,0x18c));var _0x029b=function(_0x436ea9,_0x3c8974){_0x436ea9=_0x436ea9-0x0;var _0x266ae6=_0x29b0[_0x436ea9];return _0x266ae6;};'use strict';var Sequelize=require(_0x029b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x029b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x029b('0x2')]},'beep':{'type':Sequelize[_0x029b('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a716765..48a2e64 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 _0xc1bb=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','Queue','push','flatten','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xc1bb,0x16d));var _0xbc1b=function(_0x4b9806,_0x1517c0){_0x4b9806=_0x4b9806-0x0;var _0x12f4d4=_0xc1bb[_0x4b9806];return _0x12f4d4;};'use strict';var emlformat=require(_0xbc1b('0x0'));var rimraf=require(_0xbc1b('0x1'));var zipdir=require(_0xbc1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc1b('0x3'));var moment=require(_0xbc1b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc1b('0x5'));var util=require(_0xbc1b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbc1b('0x7'));var ejs=require(_0xbc1b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc1b('0x9'));var squel=require(_0xbc1b('0xa'));var crypto=require(_0xbc1b('0xb'));var jsforce=require(_0xbc1b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbc1b('0x7'));var querystring=require(_0xbc1b('0xd'));var Papa=require('papaparse');var Redis=require(_0xbc1b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbc1b('0xf'));var as=require(_0xbc1b('0x10'));var hardwareService=require(_0xbc1b('0x11'));var logger=require(_0xbc1b('0x12'))(_0xbc1b('0x13'));var utils=require(_0xbc1b('0x14'));var config=require(_0xbc1b('0x15'));var licenseUtil=require(_0xbc1b('0x16'));var db=require(_0xbc1b('0x17'))['db'];config['redis']=_[_0xbc1b('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbc1b('0x19'))(new Redis(config['redis']));require(_0xbc1b('0x1a'))[_0xbc1b('0x1b')](socket);function respondWithStatusCode(_0x36aa7d,_0x4948f8){_0x4948f8=_0x4948f8||0xcc;return function(_0x40d2e2){if(_0x40d2e2){return _0x36aa7d[_0xbc1b('0x1c')](_0x4948f8);}return _0x36aa7d[_0xbc1b('0x1d')](_0x4948f8)['end']();};}function respondWithResult(_0x47aa3c,_0x5029d8){_0x5029d8=_0x5029d8||0xc8;return function(_0x225b49){if(_0x225b49){return _0x47aa3c[_0xbc1b('0x1d')](_0x5029d8)[_0xbc1b('0x1e')](_0x225b49);}};}function respondWithFilteredResult(_0x40c70b,_0x10d749){return function(_0x25c569){if(_0x25c569){var _0x33c6ca=typeof _0x10d749[_0xbc1b('0x1f')]===_0xbc1b('0x20')&&typeof _0x10d749[_0xbc1b('0x21')]==='undefined';var _0x1b66a5=_0x25c569[_0xbc1b('0x22')];var _0x536329=_0x33c6ca?0x0:_0x10d749[_0xbc1b('0x1f')];var _0x3ed167=_0x33c6ca?_0x25c569[_0xbc1b('0x22')]:_0x10d749[_0xbc1b('0x1f')]+_0x10d749[_0xbc1b('0x21')];var _0x4961f7;if(_0x3ed167>=_0x1b66a5){_0x3ed167=_0x1b66a5;_0x4961f7=0xc8;}else{_0x4961f7=0xce;}_0x40c70b['status'](_0x4961f7);return _0x40c70b[_0xbc1b('0x23')](_0xbc1b('0x24'),_0x536329+'-'+_0x3ed167+'/'+_0x1b66a5)[_0xbc1b('0x1e')](_0x25c569);}return null;};}function patchUpdates(_0x20d458){return function(_0x4c8156){try{jsonpatch[_0xbc1b('0x25')](_0x4c8156,_0x20d458,!![]);}catch(_0x5b9159){return BPromise[_0xbc1b('0x26')](_0x5b9159);}return _0x4c8156[_0xbc1b('0x27')]();};}function saveUpdates(_0x143f01,_0x125294){return function(_0x4579c5){if(_0x4579c5){return _0x4579c5[_0xbc1b('0x28')](_0x143f01)['then'](function(_0x57529d){return _0x57529d;});}return null;};}function removeEntity(_0x2d5ce9,_0x191af0){return function(_0x441161){if(_0x441161){return _0x441161[_0xbc1b('0x29')]()[_0xbc1b('0x2a')](function(){_0x2d5ce9[_0xbc1b('0x1d')](0xcc)[_0xbc1b('0x2b')]();});}};}function handleEntityNotFound(_0x3d9929,_0x4a5de0){return function(_0x1328f2){if(!_0x1328f2){_0x3d9929[_0xbc1b('0x1c')](0x194);}return _0x1328f2;};}function handleError(_0x18f789,_0x3ed62d){_0x3ed62d=_0x3ed62d||0x1f4;return function(_0x57ac3d){logger[_0xbc1b('0x2c')](_0x57ac3d[_0xbc1b('0x2d')]);if(_0x57ac3d['name']){delete _0x57ac3d[_0xbc1b('0x2e')];}_0x18f789[_0xbc1b('0x1d')](_0x3ed62d)[_0xbc1b('0x2f')](_0x57ac3d);};}exports[_0xbc1b('0x30')]=function(_0x6937c0,_0x3dc620,_0x88d1c1){if(!_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x32')](_0xbc1b('0x33'))&&!_0x6937c0[_0xbc1b('0x31')]['hasOwnProperty'](_0xbc1b('0x34'))){throw new db[(_0xbc1b('0x35'))][(_0xbc1b('0x36'))](_0xbc1b('0x37'));}else{if(_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x32')](_0xbc1b('0x34'))&&!_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x32')](_0xbc1b('0x38'))){throw new db[(_0xbc1b('0x35'))][(_0xbc1b('0x36'))](_0xbc1b('0x39'));}if(!_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x32')](_0xbc1b('0x3a'))){throw new db[(_0xbc1b('0x35'))][(_0xbc1b('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x1be327=JSON['parse'](_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x3a')]);}catch(_0x269305){logger[_0xbc1b('0x2c')](_0x269305);throw new db[(_0xbc1b('0x35'))][(_0xbc1b('0x36'))](_0xbc1b('0x3b'));}var _0x447d76=['chatqueue',_0xbc1b('0x3c'),_0xbc1b('0x3d'),_0xbc1b('0x3e'),_0xbc1b('0x3f'),'voicequeue',_0xbc1b('0x40'),_0xbc1b('0x41'),'user'];if(_[_0xbc1b('0x42')](_0x1be327,function(_0xecd06){return!_[_0xbc1b('0x43')](_0x447d76,_0xecd06[_0xbc1b('0x44')][_0xbc1b('0x45')]());})){throw new db[(_0xbc1b('0x35'))][(_0xbc1b('0x36'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5a66ee={};_0x5a66ee[_0xbc1b('0x46')]=_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x32')](_0xbc1b('0x46'))?_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x46')]:_0x6937c0['user'][_0xbc1b('0x47')];_0x5a66ee[_0xbc1b('0x48')]=_[_0xbc1b('0x49')](_0x6937c0['body']['recipientsDescription'])?null:_0x6937c0['body']['recipientsDescription'];_0x5a66ee[_0xbc1b('0x4a')]=_0x6937c0[_0xbc1b('0x31')][_0xbc1b('0x4a')]||![];_0x5a66ee[_0xbc1b('0x4b')]=_0x6937c0['user']['id'];return getContent(_0x6937c0[_0xbc1b('0x31')])[_0xbc1b('0x2a')](function(_0x150bd7){_0x5a66ee[_0xbc1b('0x31')]=_0x150bd7;return getRecipients(_0x1be327);})[_0xbc1b('0x2a')](function(_0x2260ed){_0x5a66ee[_0xbc1b('0x4c')]=_[_0xbc1b('0x4d')](_0x2260ed)['join'](',');return db['sequelize'][_0xbc1b('0x4e')](function(_0x51f22d){return db[_0xbc1b('0x4f')]['create'](_0x5a66ee,{'raw':!![],'transaction':_0x51f22d})['then'](function(_0x3e3c80){var _0x16b3ff={'sender':_0x5a66ee[_0xbc1b('0x46')],'description':_0x5a66ee[_0xbc1b('0x48')],'content':_0x5a66ee['body'],'beep':_0x5a66ee[_0xbc1b('0x4a')]};_0x2260ed[_0xbc1b('0x50')](function(_0x27a63e){_0x16b3ff[_0xbc1b('0x51')]=_0x27a63e;socket[_0xbc1b('0x52')](_0xbc1b('0x53'),_0x16b3ff);});return _0x3e3c80;});});})[_0xbc1b('0x2a')](respondWithResult(_0x3dc620,0xc9))[_0xbc1b('0x54')](handleError(_0x3dc620,null));};function getContent(_0x5dc5fb){return new BPromise(function(_0x4903cb,_0x705e3c){if(_0x5dc5fb['text']){_0x4903cb(_0x5dc5fb['text']);return;}return db['Template'][_0xbc1b('0x55')]({'attributes':[_0xbc1b('0x56')],'where':{'id':_0x5dc5fb[_0xbc1b('0x34')]},'raw':!![]})['then'](function(_0x426139){if(!_0x426139)throw new db['Sequelize'][(_0xbc1b('0x36'))](_0xbc1b('0x57'));var _0x4d113c=Mustache[_0xbc1b('0x58')](_0x426139[_0xbc1b('0x56')],_0x5dc5fb[_0xbc1b('0x38')]);_0x4903cb(_0x4d113c);})[_0xbc1b('0x54')](function(_0x50a748){_0x705e3c(_0x50a748);});});}function getRecipients(_0x3a0097){return new BPromise(function(_0xbfe544,_0x11888d){var _0x1407e8=[];var _0xbf645a=[];_0x3a0097['forEach'](function(_0xfd4081){var _0x3bcee9=_[_0xbc1b('0x59')](_0xfd4081[_0xbc1b('0x44')][_0xbc1b('0x45')]());if(_0x3bcee9===_0xbc1b('0x5a')){_0x1407e8=_[_0xbc1b('0x5b')](_0x1407e8,_0xfd4081[_0xbc1b('0x5c')]);}else{if(_[_0xbc1b('0x43')](_0x3bcee9,_0xbc1b('0x5d')))_0x3bcee9=_0x3bcee9[_0xbc1b('0x5e')]('queue',_0xbc1b('0x5f'));_0xfd4081[_0xbc1b('0x5c')][_0xbc1b('0x50')](function(_0x3048c3){_0xbf645a[_0xbc1b('0x60')](getAgents(_0x3bcee9,_0x3048c3));});}});return BPromise['all'](_0xbf645a)[_0xbc1b('0x2a')](function(_0x3bdf53){_0x1407e8=_[_0xbc1b('0x5b')](_0x1407e8,_[_0xbc1b('0x61')](_0x3bdf53));_0xbfe544(_0x1407e8);})[_0xbc1b('0x54')](function(_0x233c27){_0x11888d(_0x233c27);});});}function getAgents(_0x1e79a6,_0x345932){return new BPromise(function(_0x27bd65,_0x2bcb41){return db[_0x1e79a6][_0xbc1b('0x55')]({'where':{'id':_0x345932}})[_0xbc1b('0x2a')](function(_0x376365){return _0x376365[_0xbc1b('0x62')]({'attributes':['id'],'raw':!![]})[_0xbc1b('0x2a')](function(_0xfdd516){var _0x405f23=_['map'](_0xfdd516,'id');_0x27bd65(_0x405f23);});})[_0xbc1b('0x54')](function(_0x476021){_0x2bcb41(_0x476021);});});} \ No newline at end of file +var _0x6165=['Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','voicequeue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','includes','queue','replace','Queue','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','end','stack','name','sendUserNotification','hasOwnProperty','text','body'];(function(_0x316b0e,_0x63f55e){var _0x3a4432=function(_0x34da51){while(--_0x34da51){_0x316b0e['push'](_0x316b0e['shift']());}};_0x3a4432(++_0x63f55e);}(_0x6165,0x15e));var _0x5616=function(_0x29eada,_0x1bf697){_0x29eada=_0x29eada-0x0;var _0x506b2d=_0x6165[_0x29eada];return _0x506b2d;};'use strict';var emlformat=require(_0x5616('0x0'));var rimraf=require(_0x5616('0x1'));var zipdir=require(_0x5616('0x2'));var jsonpatch=require(_0x5616('0x3'));var rp=require('request-promise');var moment=require(_0x5616('0x4'));var BPromise=require(_0x5616('0x5'));var Mustache=require(_0x5616('0x6'));var util=require(_0x5616('0x7'));var path=require(_0x5616('0x8'));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(_0x5616('0x9'));var squel=require(_0x5616('0xa'));var crypto=require(_0x5616('0xb'));var jsforce=require(_0x5616('0xc'));var deskjs=require(_0x5616('0xd'));var toCsv=require(_0x5616('0xe'));var querystring=require('querystring');var Papa=require(_0x5616('0xf'));var Redis=require(_0x5616('0x10'));var authService=require(_0x5616('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5616('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5616('0x13'))('api');var utils=require(_0x5616('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5616('0x15'));var db=require(_0x5616('0x16'))['db'];config[_0x5616('0x17')]=_[_0x5616('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5616('0x19'))(new Redis(config[_0x5616('0x17')]));require(_0x5616('0x1a'))[_0x5616('0x1b')](socket);function respondWithStatusCode(_0xbb4e7,_0x241a07){_0x241a07=_0x241a07||0xcc;return function(_0x4c38ca){if(_0x4c38ca){return _0xbb4e7[_0x5616('0x1c')](_0x241a07);}return _0xbb4e7[_0x5616('0x1d')](_0x241a07)['end']();};}function respondWithResult(_0x1e48c3,_0x44a500){_0x44a500=_0x44a500||0xc8;return function(_0x6fa58c){if(_0x6fa58c){return _0x1e48c3['status'](_0x44a500)[_0x5616('0x1e')](_0x6fa58c);}};}function respondWithFilteredResult(_0x304205,_0x4b8744){return function(_0x2413cc){if(_0x2413cc){var _0x51e1f9=typeof _0x4b8744[_0x5616('0x1f')]===_0x5616('0x20')&&typeof _0x4b8744[_0x5616('0x21')]==='undefined';var _0x22f066=_0x2413cc[_0x5616('0x22')];var _0xcd16c5=_0x51e1f9?0x0:_0x4b8744[_0x5616('0x1f')];var _0x2463f4=_0x51e1f9?_0x2413cc['count']:_0x4b8744[_0x5616('0x1f')]+_0x4b8744[_0x5616('0x21')];var _0x13c77b;if(_0x2463f4>=_0x22f066){_0x2463f4=_0x22f066;_0x13c77b=0xc8;}else{_0x13c77b=0xce;}_0x304205[_0x5616('0x1d')](_0x13c77b);return _0x304205['set'](_0x5616('0x23'),_0xcd16c5+'-'+_0x2463f4+'/'+_0x22f066)[_0x5616('0x1e')](_0x2413cc);}return null;};}function patchUpdates(_0x15646b){return function(_0x3f1c2c){try{jsonpatch['apply'](_0x3f1c2c,_0x15646b,!![]);}catch(_0x450af8){return BPromise[_0x5616('0x24')](_0x450af8);}return _0x3f1c2c[_0x5616('0x25')]();};}function saveUpdates(_0x945d30,_0x353e29){return function(_0x1608db){if(_0x1608db){return _0x1608db['update'](_0x945d30)[_0x5616('0x26')](function(_0x2987e1){return _0x2987e1;});}return null;};}function removeEntity(_0xb5dbf6,_0x91502f){return function(_0x1c0663){if(_0x1c0663){return _0x1c0663['destroy']()['then'](function(){_0xb5dbf6[_0x5616('0x1d')](0xcc)[_0x5616('0x27')]();});}};}function handleEntityNotFound(_0x55eb77,_0x17e5c6){return function(_0x4ef214){if(!_0x4ef214){_0x55eb77['sendStatus'](0x194);}return _0x4ef214;};}function handleError(_0x1b3051,_0x18577b){_0x18577b=_0x18577b||0x1f4;return function(_0x2fc229){logger['error'](_0x2fc229[_0x5616('0x28')]);if(_0x2fc229['name']){delete _0x2fc229[_0x5616('0x29')];}_0x1b3051[_0x5616('0x1d')](_0x18577b)['send'](_0x2fc229);};}exports[_0x5616('0x2a')]=function(_0x5372ba,_0x57dfcc,_0xa9dbf5){if(!_0x5372ba['body'][_0x5616('0x2b')](_0x5616('0x2c'))&&!_0x5372ba[_0x5616('0x2d')]['hasOwnProperty']('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x5616('0x2e'));}else{if(_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')](_0x5616('0x2f'))&&!_0x5372ba[_0x5616('0x2d')]['hasOwnProperty'](_0x5616('0x30'))){throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x33'));}if(!_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')](_0x5616('0x34'))){throw new db['Sequelize']['ValidationError'](_0x5616('0x35'));}else{try{var _0x508dd8=JSON['parse'](_0x5372ba[_0x5616('0x2d')][_0x5616('0x34')]);}catch(_0x4761db){logger[_0x5616('0x36')](_0x4761db);throw new db['Sequelize'][(_0x5616('0x32'))](_0x5616('0x37'));}var _0x53ebe2=[_0x5616('0x38'),_0x5616('0x39'),'mailqueue','openchannelqueue',_0x5616('0x3a'),_0x5616('0x3b'),'whatsappqueue',_0x5616('0x3c'),_0x5616('0x3d')];if(_[_0x5616('0x3e')](_0x508dd8,function(_0x1f2d48){return!_['includes'](_0x53ebe2,_0x1f2d48[_0x5616('0x3f')][_0x5616('0x40')]());})){throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x41'));}}}var _0x4fedc9={};_0x4fedc9[_0x5616('0x42')]=_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')]('senderName')?_0x5372ba['body'][_0x5616('0x42')]:_0x5372ba['user'][_0x5616('0x43')];_0x4fedc9[_0x5616('0x44')]=_[_0x5616('0x45')](_0x5372ba[_0x5616('0x2d')]['recipientsDescription'])?null:_0x5372ba[_0x5616('0x2d')]['recipientsDescription'];_0x4fedc9['beep']=_0x5372ba['body'][_0x5616('0x46')]||![];_0x4fedc9[_0x5616('0x47')]=_0x5372ba['user']['id'];return getContent(_0x5372ba[_0x5616('0x2d')])[_0x5616('0x26')](function(_0x47b000){_0x4fedc9[_0x5616('0x2d')]=_0x47b000;return getRecipients(_0x508dd8);})['then'](function(_0x10b611){_0x4fedc9[_0x5616('0x48')]=_[_0x5616('0x49')](_0x10b611)[_0x5616('0x4a')](',');return db[_0x5616('0x4b')][_0x5616('0x4c')](function(_0x78eafa){return db[_0x5616('0x4d')][_0x5616('0x4e')](_0x4fedc9,{'raw':!![],'transaction':_0x78eafa})[_0x5616('0x26')](function(_0x1ba602){var _0x296272={'sender':_0x4fedc9[_0x5616('0x42')],'description':_0x4fedc9[_0x5616('0x44')],'content':_0x4fedc9[_0x5616('0x2d')],'beep':_0x4fedc9[_0x5616('0x46')]};_0x10b611[_0x5616('0x4f')](function(_0x4f194d){_0x296272[_0x5616('0x50')]=_0x4f194d;socket[_0x5616('0x51')](_0x5616('0x52'),_0x296272);});return _0x1ba602;});});})[_0x5616('0x26')](respondWithResult(_0x57dfcc,0xc9))[_0x5616('0x53')](handleError(_0x57dfcc,null));};function getContent(_0x582eed){return new BPromise(function(_0x57b2bc,_0x4cb23b){if(_0x582eed['text']){_0x57b2bc(_0x582eed[_0x5616('0x2c')]);return;}return db[_0x5616('0x54')][_0x5616('0x55')]({'attributes':[_0x5616('0x56')],'where':{'id':_0x582eed[_0x5616('0x2f')]},'raw':!![]})[_0x5616('0x26')](function(_0x270656){if(!_0x270656)throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x57'));var _0x5eca6e=Mustache[_0x5616('0x58')](_0x270656['html'],_0x582eed[_0x5616('0x30')]);_0x57b2bc(_0x5eca6e);})[_0x5616('0x53')](function(_0x3f64f4){_0x4cb23b(_0x3f64f4);});});}function getRecipients(_0x2dc0f8){return new BPromise(function(_0x16145b,_0x5b2cf4){var _0x4f5d1f=[];var _0x58e5ea=[];_0x2dc0f8['forEach'](function(_0x41761d){var _0x300362=_[_0x5616('0x59')](_0x41761d[_0x5616('0x3f')][_0x5616('0x40')]());if(_0x300362==='User'){_0x4f5d1f=_[_0x5616('0x5a')](_0x4f5d1f,_0x41761d[_0x5616('0x5b')]);}else{if(_[_0x5616('0x5c')](_0x300362,_0x5616('0x5d')))_0x300362=_0x300362[_0x5616('0x5e')](_0x5616('0x5d'),_0x5616('0x5f'));_0x41761d[_0x5616('0x5b')][_0x5616('0x4f')](function(_0xebde9a){_0x58e5ea['push'](getAgents(_0x300362,_0xebde9a));});}});return BPromise[_0x5616('0x60')](_0x58e5ea)[_0x5616('0x26')](function(_0x4020cc){_0x4f5d1f=_[_0x5616('0x5a')](_0x4f5d1f,_[_0x5616('0x61')](_0x4020cc));_0x16145b(_0x4f5d1f);})['catch'](function(_0x576d47){_0x5b2cf4(_0x576d47);});});}function getAgents(_0x451ff4,_0x4bfe52){return new BPromise(function(_0x149a2f,_0x4f5e9b){return db[_0x451ff4][_0x5616('0x55')]({'where':{'id':_0x4bfe52}})[_0x5616('0x26')](function(_0x11bf9c){return _0x11bf9c['getAgents']({'attributes':['id'],'raw':!![]})[_0x5616('0x26')](function(_0xf235b){var _0x2acf67=_[_0x5616('0x62')](_0xf235b,'id');_0x149a2f(_0x2acf67);});})[_0x5616('0x53')](function(_0x5aa700){_0x4f5e9b(_0x5aa700);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 1eab0a4..71d02d8 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 _0x16b6=['../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x16b6,0x1ea));var _0x616b=function(_0xb09b51,_0x5c3cd7){_0xb09b51=_0xb09b51-0x0;var _0x34e8c9=_0x16b6[_0xb09b51];return _0x34e8c9;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x616b('0x0'))['db'][_0x616b('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x616b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x616b('0x3'),'afterDestroy':_0x616b('0x4')};function emitEvent(_0x54948d){return function(_0x38595d,_0x2c638e,_0x2bd376){UserNotificationEvents[_0x616b('0x5')](_0x54948d+':'+_0x38595d['id'],_0x38595d);UserNotificationEvents['emit'](_0x54948d,_0x38595d);_0x2bd376(null);};}for(var e in events){if(events[_0x616b('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x7935=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x54e8a3,_0x25653d){var _0x332fca=function(_0x3b456d){while(--_0x3b456d){_0x54e8a3['push'](_0x54e8a3['shift']());}};_0x332fca(++_0x25653d);}(_0x7935,0x1c2));var _0x5793=function(_0xdac678,_0x5d1714){_0xdac678=_0xdac678-0x0;var _0x92c2fe=_0x7935[_0xdac678];return _0x92c2fe;};'use strict';var EventEmitter=require(_0x5793('0x0'));var UserNotification=require(_0x5793('0x1'))['db'][_0x5793('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5793('0x3')](0x0);var events={'afterCreate':_0x5793('0x4'),'afterUpdate':_0x5793('0x5'),'afterDestroy':'remove'};function emitEvent(_0x356011){return function(_0x2b851a,_0x3631f3,_0x3732a2){UserNotificationEvents[_0x5793('0x6')](_0x356011+':'+_0x2b851a['id'],_0x2b851a);UserNotificationEvents['emit'](_0x356011,_0x2b851a);_0x3732a2(null);};}for(var e in events){if(events[_0x5793('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x5793('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 4fdd226..ed661d5 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 _0x99f6=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x54848c,_0x509fae){var _0x3a1fe3=function(_0x4b493a){while(--_0x4b493a){_0x54848c['push'](_0x54848c['shift']());}};_0x3a1fe3(++_0x509fae);}(_0x99f6,0x160));var _0x699f=function(_0x5a0e32,_0x347ae2){_0x5a0e32=_0x5a0e32-0x0;var _0xea8f24=_0x99f6[_0x5a0e32];return _0xea8f24;};'use strict';var _=require(_0x699f('0x0'));var util=require(_0x699f('0x1'));var logger=require(_0x699f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x699f('0x3'));var fs=require('fs');var path=require(_0x699f('0x4'));var rimraf=require(_0x699f('0x5'));var config=require(_0x699f('0x6'));var attributes=require(_0x699f('0x7'));module[_0x699f('0x8')]=function(_0x2b4a1c,_0x38fbe3){return _0x2b4a1c[_0x699f('0x9')](_0x699f('0xa'),attributes,{'tableName':_0x699f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x699f('0xc'),'collate':_0x699f('0xd')});}; \ No newline at end of file +var _0xd1b7=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4'];(function(_0x557886,_0x525a5e){var _0x3026ba=function(_0x212587){while(--_0x212587){_0x557886['push'](_0x557886['shift']());}};_0x3026ba(++_0x525a5e);}(_0xd1b7,0x9b));var _0x7d1b=function(_0x243a85,_0x1272cc){_0x243a85=_0x243a85-0x0;var _0x5c7f4a=_0xd1b7[_0x243a85];return _0x5c7f4a;};'use strict';var _=require(_0x7d1b('0x0'));var util=require(_0x7d1b('0x1'));var logger=require(_0x7d1b('0x2'))(_0x7d1b('0x3'));var moment=require(_0x7d1b('0x4'));var BPromise=require(_0x7d1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d1b('0x6'));var rimraf=require(_0x7d1b('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d1b('0x8'));module['exports']=function(_0x5b9b08,_0x4e28ae){return _0x5b9b08[_0x7d1b('0x9')](_0x7d1b('0xa'),attributes,{'tableName':_0x7d1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d1b('0xc'),'collate':_0x7d1b('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 32e6b86..588706a 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 _0x168f=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','then','info','request\x20sent'];(function(_0x7b3b6d,_0x55d83a){var _0x5bf1f4=function(_0x3bc2f1){while(--_0x3bc2f1){_0x7b3b6d['push'](_0x7b3b6d['shift']());}};_0x5bf1f4(++_0x55d83a);}(_0x168f,0x1cf));var _0xf168=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x168f[_0x4551f6];return _0x581dc2;};'use strict';var _=require(_0xf168('0x0'));var util=require(_0xf168('0x1'));var moment=require('moment');var BPromise=require(_0xf168('0x2'));var rs=require(_0xf168('0x3'));var fs=require('fs');var Redis=require(_0xf168('0x4'));var db=require(_0xf168('0x5'))['db'];var utils=require(_0xf168('0x6'));var logger=require(_0xf168('0x7'))('rpc');var config=require(_0xf168('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf168('0x9')][_0xf168('0xa')]({'port':0x232a});config[_0xf168('0xb')]=_[_0xf168('0xc')](config[_0xf168('0xb')],{'host':_0xf168('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf168('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x4bdd59,_0x4868d7,_0x996b5a){return new BPromise(function(_0x44fb33,_0x471712){return client['request'](_0x4bdd59,_0x996b5a)[_0xf168('0xe')](function(_0x2a9a37){logger[_0xf168('0xf')]('UserNotification,\x20%s,\x20%s',_0x4868d7,_0xf168('0x10'));logger['debug'](_0xf168('0x11'),_0x4868d7,_0xf168('0x10'),JSON[_0xf168('0x12')](_0x2a9a37));if(_0x2a9a37[_0xf168('0x13')]){if(_0x2a9a37[_0xf168('0x13')]['code']===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x4868d7,_0x2a9a37[_0xf168('0x13')][_0xf168('0x14')]);return _0x471712(_0x2a9a37[_0xf168('0x13')][_0xf168('0x14')]);}logger['error'](_0xf168('0x15'),_0x4868d7,_0x2a9a37[_0xf168('0x13')][_0xf168('0x14')]);return _0x44fb33(_0x2a9a37[_0xf168('0x13')]['message']);}else{logger[_0xf168('0xf')](_0xf168('0x15'),_0x4868d7,_0xf168('0x10'));_0x44fb33(_0x2a9a37[_0xf168('0x16')]['message']);}})[_0xf168('0x17')](function(_0x3afb12){logger[_0xf168('0x13')](_0xf168('0x15'),_0x4868d7,_0x3afb12);_0x471712(_0x3afb12);});});} \ No newline at end of file +var _0xdd92=['UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xdd92,0x82));var _0x2dd9=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xdd92[_0xda464c];return _0x19e222;};'use strict';var _=require('lodash');var util=require(_0x2dd9('0x0'));var moment=require(_0x2dd9('0x1'));var BPromise=require('bluebird');var rs=require(_0x2dd9('0x2'));var fs=require('fs');var Redis=require(_0x2dd9('0x3'));var db=require(_0x2dd9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dd9('0x5'))(_0x2dd9('0x6'));var config=require(_0x2dd9('0x7'));var jayson=require(_0x2dd9('0x8'));var client=jayson[_0x2dd9('0x9')][_0x2dd9('0xa')]({'port':0x232a});config['redis']=_[_0x2dd9('0xb')](config[_0x2dd9('0xc')],{'host':_0x2dd9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2dd9('0xc')]));require(_0x2dd9('0xe'))[_0x2dd9('0xf')](socket);function respondWithRpcPromise(_0x281d4f,_0x336431,_0x30e0fd){return new BPromise(function(_0x3c0127,_0x2e95e8){return client[_0x2dd9('0x10')](_0x281d4f,_0x30e0fd)['then'](function(_0x4a5a4e){logger[_0x2dd9('0x11')](_0x2dd9('0x12'),_0x336431,_0x2dd9('0x13'));logger['debug'](_0x2dd9('0x14'),_0x336431,'request\x20sent',JSON['stringify'](_0x4a5a4e));if(_0x4a5a4e['error']){if(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x16')]===0x1f4){logger[_0x2dd9('0x15')](_0x2dd9('0x12'),_0x336431,_0x4a5a4e['error'][_0x2dd9('0x17')]);return _0x2e95e8(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);}logger[_0x2dd9('0x15')]('UserNotification,\x20%s,\x20%s',_0x336431,_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);return _0x3c0127(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);}else{logger['info'](_0x2dd9('0x12'),_0x336431,'request\x20sent');_0x3c0127(_0x4a5a4e['result'][_0x2dd9('0x17')]);}})[_0x2dd9('0x18')](function(_0x56379c){logger[_0x2dd9('0x15')]('UserNotification,\x20%s,\x20%s',_0x336431,_0x56379c);_0x2e95e8(_0x56379c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index bfa9cf5..fa3f7e9 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 _0x8345=['save','remove','update','emit','length','./userNotification.events'];(function(_0x397744,_0x1bef9c){var _0x4f5ac9=function(_0x292a54){while(--_0x292a54){_0x397744['push'](_0x397744['shift']());}};_0x4f5ac9(++_0x1bef9c);}(_0x8345,0xb9));var _0x5834=function(_0x22de84,_0x56142b){_0x22de84=_0x22de84-0x0;var _0x54fc49=_0x8345[_0x22de84];return _0x54fc49;};'use strict';var UserNotificationEvents=require(_0x5834('0x0'));var events=[_0x5834('0x1'),_0x5834('0x2'),_0x5834('0x3')];function createListener(_0x12cfa6,_0x3fe1e6){return function(_0x42ffa9){_0x3fe1e6[_0x5834('0x4')](_0x12cfa6,_0x42ffa9);};}function removeListener(_0x123984,_0x27c342){return function(){UserNotificationEvents['removeListener'](_0x123984,_0x27c342);};}exports['register']=function(_0x210df0){for(var _0xd89484=0x0,_0x1d16b9=events[_0x5834('0x5')];_0xd89484<_0x1d16b9;_0xd89484++){var _0x3f96b3=events[_0xd89484];var _0x4d5c1f=createListener('userNotification:'+_0x3f96b3,_0x210df0);UserNotificationEvents['on'](_0x3f96b3,_0x4d5c1f);}}; \ No newline at end of file +var _0xd7af=['update','emit','register','userNotification:','./userNotification.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7af,0xac));var _0xfd7a=function(_0x29d05d,_0x458c96){_0x29d05d=_0x29d05d-0x0;var _0x386037=_0xd7af[_0x29d05d];return _0x386037;};'use strict';var UserNotificationEvents=require(_0xfd7a('0x0'));var events=[_0xfd7a('0x1'),_0xfd7a('0x2'),_0xfd7a('0x3')];function createListener(_0x1ba025,_0x21169c){return function(_0x4560d3){_0x21169c[_0xfd7a('0x4')](_0x1ba025,_0x4560d3);};}function removeListener(_0x443781,_0x41d6b0){return function(){UserNotificationEvents['removeListener'](_0x443781,_0x41d6b0);};}exports[_0xfd7a('0x5')]=function(_0x2f927f){for(var _0x4da5bb=0x0,_0xd01ca7=events['length'];_0x4da5bb<_0xd01ca7;_0x4da5bb++){var _0x5a3c64=events[_0x4da5bb];var _0x5a282a=createListener(_0xfd7a('0x6')+_0x5a3c64,_0x2f927f);UserNotificationEvents['on'](_0x5a3c64,_0x5a282a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a1193bc..3c90a6e 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17c21e,_0x2abc24){var _0x4518a6=function(_0x50baff){while(--_0x50baff){_0x17c21e['push'](_0x17c21e['shift']());}};_0x4518a6(++_0x2abc24);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 5fe4a10..f722c56 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 _0x7b06=['exports','INTEGER','sequelize'];(function(_0x525798,_0x77a707){var _0x57da9a=function(_0x20837b){while(--_0x20837b){_0x525798['push'](_0x525798['shift']());}};_0x57da9a(++_0x77a707);}(_0x7b06,0x173));var _0x67b0=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0x7b06[_0x197065];return _0x3d9404;};'use strict';var Sequelize=require(_0x67b0('0x0'));module[_0x67b0('0x1')]={'penalty':{'type':Sequelize[_0x67b0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe66d=['exports','sequelize'];(function(_0x294bd2,_0x3bee98){var _0x2c1244=function(_0x498844){while(--_0x498844){_0x294bd2['push'](_0x294bd2['shift']());}};_0x2c1244(++_0x3bee98);}(_0xe66d,0xfb));var _0xde66=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xe66d[_0xf8886b];return _0x321bd5;};'use strict';var Sequelize=require(_0xde66('0x0'));module[_0xde66('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 7356331..fc970b9 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 _0x5eca=['moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x8b3205,_0x1dfbab){var _0x1a6c00=function(_0xeaa816){while(--_0xeaa816){_0x8b3205['push'](_0x8b3205['shift']());}};_0x1a6c00(++_0x1dfbab);}(_0x5eca,0x1b9));var _0xa5ec=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5eca[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xa5ec('0x0'));var util=require('util');var logger=require(_0xa5ec('0x1'))(_0xa5ec('0x2'));var moment=require(_0xa5ec('0x3'));var BPromise=require(_0xa5ec('0x4'));var rp=require(_0xa5ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5ec('0x6'));var config=require(_0xa5ec('0x7'));var attributes=require(_0xa5ec('0x8'));module['exports']=function(_0x582de4,_0x3c803e){return _0x582de4[_0xa5ec('0x9')](_0xa5ec('0xa'),attributes,{'tableName':_0xa5ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x423b=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ee051,_0x417c1a){var _0x5b5fea=function(_0x77777f){while(--_0x77777f){_0x1ee051['push'](_0x1ee051['shift']());}};_0x5b5fea(++_0x417c1a);}(_0x423b,0xad));var _0xb423=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x423b[_0x556bb1];return _0x45455f;};'use strict';var _=require('lodash');var util=require(_0xb423('0x0'));var logger=require(_0xb423('0x1'))(_0xb423('0x2'));var moment=require(_0xb423('0x3'));var BPromise=require(_0xb423('0x4'));var rp=require(_0xb423('0x5'));var fs=require('fs');var path=require(_0xb423('0x6'));var rimraf=require(_0xb423('0x7'));var config=require(_0xb423('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xb423('0x9')]=function(_0x1c1bd5,_0x547e37){return _0x1c1bd5[_0xb423('0xa')](_0xb423('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 0a66563..d332fc2 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 _0x05c0=['ioredis','rpc','jayson/promise','client','http','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x100770,_0x2a6617){var _0x26c777=function(_0x58174d){while(--_0x58174d){_0x100770['push'](_0x100770['shift']());}};_0x26c777(++_0x2a6617);}(_0x05c0,0x94));var _0x005c=function(_0x246514,_0x2fbcec){_0x246514=_0x246514-0x0;var _0x3ae199=_0x05c0[_0x246514];return _0x3ae199;};'use strict';var _=require(_0x005c('0x0'));var util=require(_0x005c('0x1'));var moment=require('moment');var BPromise=require(_0x005c('0x2'));var rs=require(_0x005c('0x3'));var fs=require('fs');var Redis=require(_0x005c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x005c('0x5'));var config=require('../../config/environment');var jayson=require(_0x005c('0x6'));var client=jayson[_0x005c('0x7')][_0x005c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x442826,_0x21604b,_0x2e8403){return new BPromise(function(_0x53e33b,_0x449cba){return client['request'](_0x442826,_0x2e8403)['then'](function(_0x39aaff){logger['info'](_0x005c('0x9'),_0x21604b,_0x005c('0xa'));logger[_0x005c('0xb')](_0x005c('0xc'),_0x21604b,_0x005c('0xa'),JSON[_0x005c('0xd')](_0x39aaff));if(_0x39aaff['error']){if(_0x39aaff[_0x005c('0xe')][_0x005c('0xf')]===0x1f4){logger[_0x005c('0xe')](_0x005c('0x9'),_0x21604b,_0x39aaff['error'][_0x005c('0x10')]);return _0x449cba(_0x39aaff[_0x005c('0xe')][_0x005c('0x10')]);}logger[_0x005c('0xe')](_0x005c('0x9'),_0x21604b,_0x39aaff['error'][_0x005c('0x10')]);return _0x53e33b(_0x39aaff[_0x005c('0xe')]['message']);}else{logger['info'](_0x005c('0x9'),_0x21604b,_0x005c('0xa'));_0x53e33b(_0x39aaff[_0x005c('0x11')][_0x005c('0x10')]);}})[_0x005c('0x12')](function(_0x11f0ec){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x21604b,_0x11f0ec);_0x449cba(_0x11f0ec);});});} \ No newline at end of file +var _0x0520=['request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x1275da,_0x49bb85){var _0x58c058=function(_0x5db789){while(--_0x5db789){_0x1275da['push'](_0x1275da['shift']());}};_0x58c058(++_0x49bb85);}(_0x0520,0x184));var _0x0052=function(_0x3b2537,_0x20b0df){_0x3b2537=_0x3b2537-0x0;var _0x567752=_0x0520[_0x3b2537];return _0x567752;};'use strict';var _=require(_0x0052('0x0'));var util=require('util');var moment=require(_0x0052('0x1'));var BPromise=require(_0x0052('0x2'));var rs=require(_0x0052('0x3'));var fs=require('fs');var Redis=require(_0x0052('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0052('0x5'));var logger=require(_0x0052('0x6'))(_0x0052('0x7'));var config=require(_0x0052('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0052('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f81f,_0x7a812b,_0x6d32ed){return new BPromise(function(_0x3e5e19,_0x5dd997){return client[_0x0052('0xa')](_0x35f81f,_0x6d32ed)['then'](function(_0x5d46a1){logger[_0x0052('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x7a812b,_0x0052('0xc'));logger[_0x0052('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x7a812b,_0x0052('0xc'),JSON[_0x0052('0xe')](_0x5d46a1));if(_0x5d46a1[_0x0052('0xf')]){if(_0x5d46a1['error'][_0x0052('0x10')]===0x1f4){logger[_0x0052('0xf')](_0x0052('0x11'),_0x7a812b,_0x5d46a1['error'][_0x0052('0x12')]);return _0x5dd997(_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);}logger[_0x0052('0xf')](_0x0052('0x11'),_0x7a812b,_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);return _0x3e5e19(_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);}else{logger[_0x0052('0xb')](_0x0052('0x11'),_0x7a812b,_0x0052('0xc'));_0x3e5e19(_0x5d46a1[_0x0052('0x13')]['message']);}})['catch'](function(_0x477f9c){logger['error'](_0x0052('0x11'),_0x7a812b,_0x477f9c);_0x5dd997(_0x477f9c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f85218c..06306aa 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 _0x5e3f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','multer','util'];(function(_0x405fd7,_0x3c57e9){var _0x245b89=function(_0xc900e2){while(--_0xc900e2){_0x405fd7['push'](_0x405fd7['shift']());}};_0x245b89(++_0x3c57e9);}(_0x5e3f,0xfe));var _0xf5e3=function(_0x4aebd2,_0x56146a){_0x4aebd2=_0x4aebd2-0x0;var _0xfb742=_0x5e3f[_0x4aebd2];return _0xfb742;};'use strict';var multer=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var path=require(_0xf5e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5e3('0x3'));var router=express[_0xf5e3('0x4')]();var fs_extra=require(_0xf5e3('0x5'));var auth=require(_0xf5e3('0x6'));var interaction=require(_0xf5e3('0x7'));var config=require(_0xf5e3('0x8'));var controller=require(_0xf5e3('0x9'));router[_0xf5e3('0xa')]('/',auth[_0xf5e3('0xb')](),controller[_0xf5e3('0xc')]);router['get'](_0xf5e3('0xd'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0xe')]);router[_0xf5e3('0xa')](_0xf5e3('0xf'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x10')]);router[_0xf5e3('0xa')](_0xf5e3('0x11'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x12')]);router[_0xf5e3('0xa')](_0xf5e3('0x13'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x14')]);router[_0xf5e3('0x15')]('/',auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x16')]);router[_0xf5e3('0x15')](_0xf5e3('0x17'),auth[_0xf5e3('0xb')](),controller['clone']);router[_0xf5e3('0x15')]('/:id/sections',auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x18')]);router['post'](_0xf5e3('0x13'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x19')]);router[_0xf5e3('0x1a')](_0xf5e3('0xf'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x1b')]);router[_0xf5e3('0x1c')](_0xf5e3('0xf'),auth['isAuthenticated'](),controller[_0xf5e3('0x1d')]);router[_0xf5e3('0x1c')](_0xf5e3('0x11'),auth[_0xf5e3('0xb')](),controller[_0xf5e3('0x1e')]);router[_0xf5e3('0x1c')](_0xf5e3('0x13'),auth[_0xf5e3('0xb')](),controller['removeResources']);module[_0xf5e3('0x1f')]=router; \ No newline at end of file +var _0x2c61=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id/sections','post','/:id/clone','clone','/:id/resources','addResources','put','update','delete','/:id','removeSections','removeResources','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c61,0x141));var _0x12c6=function(_0x2ce2bb,_0x5b3eb2){_0x2ce2bb=_0x2ce2bb-0x0;var _0x50aaba=_0x2c61[_0x2ce2bb];return _0x50aaba;};'use strict';var multer=require(_0x12c6('0x0'));var util=require(_0x12c6('0x1'));var path=require(_0x12c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x12c6('0x3'));var router=express[_0x12c6('0x4')]();var fs_extra=require(_0x12c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x12c6('0x6'));var config=require(_0x12c6('0x7'));var controller=require(_0x12c6('0x8'));router[_0x12c6('0x9')]('/',auth[_0x12c6('0xa')](),controller[_0x12c6('0xb')]);router['get'](_0x12c6('0xc'),auth[_0x12c6('0xa')](),controller[_0x12c6('0xd')]);router['get']('/:id',auth[_0x12c6('0xa')](),controller['show']);router[_0x12c6('0x9')](_0x12c6('0xe'),auth['isAuthenticated'](),controller['getSections']);router['get']('/:id/resources',auth[_0x12c6('0xa')](),controller['getResources']);router[_0x12c6('0xf')]('/',auth[_0x12c6('0xa')](),controller['create']);router[_0x12c6('0xf')](_0x12c6('0x10'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x11')]);router[_0x12c6('0xf')](_0x12c6('0xe'),auth['isAuthenticated'](),controller['addSections']);router[_0x12c6('0xf')](_0x12c6('0x12'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x13')]);router[_0x12c6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x12c6('0x15')]);router[_0x12c6('0x16')](_0x12c6('0x17'),auth[_0x12c6('0xa')](),controller['destroy']);router[_0x12c6('0x16')](_0x12c6('0xe'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x18')]);router[_0x12c6('0x16')]('/:id/resources',auth[_0x12c6('0xa')](),controller[_0x12c6('0x19')]);module[_0x12c6('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 83cc0b0..a7419a9 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 _0x6fec=['BOOLEAN','STRING','name','setDataValue','join','getDataValue','split'];(function(_0x1bc989,_0x4130ce){var _0x488ead=function(_0xf5c90c){while(--_0xf5c90c){_0x1bc989['push'](_0x1bc989['shift']());}};_0x488ead(++_0x4130ce);}(_0x6fec,0x189));var _0xc6fe=function(_0x21d1f2,_0x140ab0){_0x21d1f2=_0x21d1f2-0x0;var _0x1df5ec=_0x6fec[_0x21d1f2];return _0x1df5ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc6fe('0x0')],'allowNull':![],'unique':_0xc6fe('0x1')},'crudPermissions':{'type':Sequelize[_0xc6fe('0x0')],'set':function(_0x4c23fb){this[_0xc6fe('0x2')]('crudPermissions',_0x4c23fb?_0x4c23fb[_0xc6fe('0x3')](''):[]);},'get':function(){return this[_0xc6fe('0x4')]('crudPermissions')?this[_0xc6fe('0x4')]('crudPermissions')[_0xc6fe('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc6fe('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc6fe('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc6fe('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc6fe('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc6fe('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4d21=['exports','name','setDataValue','crudPermissions','join','getDataValue','STRING','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d21,0xc5));var _0x14d2=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x4d21[_0x5b87ce];return _0x597aa7;};'use strict';var Sequelize=require(_0x14d2('0x0'));module[_0x14d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x14d2('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2e666d){this[_0x14d2('0x3')](_0x14d2('0x4'),_0x2e666d?_0x2e666d[_0x14d2('0x5')](''):[]);},'get':function(){return this[_0x14d2('0x6')](_0x14d2('0x4'))?this[_0x14d2('0x6')](_0x14d2('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x14d2('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'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 d0c3914..80e3673 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 _0x1921=['isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./userProfile.socket','register','status','end','json','offset','undefined','count','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','create','body','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','autoAssociation','userProfileId','UserProfileResource','Resources','update','describe','sequelize','sectionId','push','removeSections','ids','getSections','enabled','includes'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x1921,0xf2));var _0x1192=function(_0x119011,_0x1e1877){_0x119011=_0x119011-0x0;var _0x3f495c=_0x1921[_0x119011];return _0x3f495c;};'use strict';var emlformat=require(_0x1192('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1192('0x1'));var jsonpatch=require(_0x1192('0x2'));var rp=require(_0x1192('0x3'));var moment=require(_0x1192('0x4'));var BPromise=require(_0x1192('0x5'));var Mustache=require(_0x1192('0x6'));var util=require(_0x1192('0x7'));var path=require(_0x1192('0x8'));var sox=require(_0x1192('0x9'));var csv=require(_0x1192('0xa'));var ejs=require(_0x1192('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1192('0xc'));var crypto=require(_0x1192('0xd'));var jsforce=require(_0x1192('0xe'));var deskjs=require(_0x1192('0xf'));var toCsv=require(_0x1192('0xa'));var querystring=require(_0x1192('0x10'));var Papa=require(_0x1192('0x11'));var Redis=require(_0x1192('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1192('0x13'));var hardwareService=require(_0x1192('0x14'));var logger=require(_0x1192('0x15'))(_0x1192('0x16'));var utils=require(_0x1192('0x17'));var config=require(_0x1192('0x18'));var licenseUtil=require(_0x1192('0x19'));var db=require('../../mysqldb')['db'];config[_0x1192('0x1a')]=_['defaults'](config[_0x1192('0x1a')],{'host':_0x1192('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1192('0x1a')]));require(_0x1192('0x1c'))[_0x1192('0x1d')](socket);function respondWithStatusCode(_0x4c17d3,_0x938cb5){_0x938cb5=_0x938cb5||0xcc;return function(_0x195c7c){if(_0x195c7c){return _0x4c17d3['sendStatus'](_0x938cb5);}return _0x4c17d3[_0x1192('0x1e')](_0x938cb5)[_0x1192('0x1f')]();};}function respondWithResult(_0x2a162b,_0x4823d0){_0x4823d0=_0x4823d0||0xc8;return function(_0x230cc3){if(_0x230cc3){return _0x2a162b['status'](_0x4823d0)[_0x1192('0x20')](_0x230cc3);}};}function respondWithFilteredResult(_0x4757bb,_0x113be1){return function(_0x13a5ca){if(_0x13a5ca){var _0x30d58f=typeof _0x113be1[_0x1192('0x21')]==='undefined'&&typeof _0x113be1['limit']===_0x1192('0x22');var _0x1b46e2=_0x13a5ca[_0x1192('0x23')];var _0xb7f4f0=_0x30d58f?0x0:_0x113be1['offset'];var _0x3c48fa=_0x30d58f?_0x13a5ca[_0x1192('0x23')]:_0x113be1[_0x1192('0x21')]+_0x113be1['limit'];var _0x1cfcd6;if(_0x3c48fa>=_0x1b46e2){_0x3c48fa=_0x1b46e2;_0x1cfcd6=0xc8;}else{_0x1cfcd6=0xce;}_0x4757bb[_0x1192('0x1e')](_0x1cfcd6);return _0x4757bb['set'](_0x1192('0x24'),_0xb7f4f0+'-'+_0x3c48fa+'/'+_0x1b46e2)[_0x1192('0x20')](_0x13a5ca);}return null;};}function patchUpdates(_0x402e64){return function(_0x2230fa){try{jsonpatch['apply'](_0x2230fa,_0x402e64,!![]);}catch(_0x4ad6b4){return BPromise[_0x1192('0x25')](_0x4ad6b4);}return _0x2230fa['save']();};}function saveUpdates(_0x3cc973,_0x4cf20c){return function(_0x1a56b2){if(_0x1a56b2){return _0x1a56b2['update'](_0x3cc973)[_0x1192('0x26')](function(_0x18e4cc){return _0x18e4cc;});}return null;};}function removeEntity(_0x572d29,_0x40bdb5){return function(_0x3f74ee){if(_0x3f74ee){return _0x3f74ee[_0x1192('0x27')]()[_0x1192('0x26')](function(){_0x572d29[_0x1192('0x1e')](0xcc)[_0x1192('0x1f')]();});}};}function handleEntityNotFound(_0x52967f,_0x2586c8){return function(_0x799f71){if(!_0x799f71){_0x52967f[_0x1192('0x28')](0x194);}return _0x799f71;};}function handleError(_0x2ca953,_0x29bd1c){_0x29bd1c=_0x29bd1c||0x1f4;return function(_0x3a0736){logger[_0x1192('0x29')](_0x3a0736[_0x1192('0x2a')]);if(_0x3a0736[_0x1192('0x2b')]){delete _0x3a0736[_0x1192('0x2b')];}_0x2ca953['status'](_0x29bd1c)[_0x1192('0x2c')](_0x3a0736);};}exports['index']=function(_0x47f933,_0x7218dc){var _0x1f855e={},_0x1a2ba1={},_0x475102={'count':0x0,'rows':[]};var _0x6a603f=_[_0x1192('0x2d')](db[_0x1192('0x2e')][_0x1192('0x2f')],function(_0x26c4a2){return{'name':_0x26c4a2[_0x1192('0x30')],'type':_0x26c4a2[_0x1192('0x31')][_0x1192('0x32')]};});_0x1a2ba1[_0x1192('0x33')]=_[_0x1192('0x2d')](_0x6a603f,_0x1192('0x2b'));_0x1a2ba1[_0x1192('0x34')]=_[_0x1192('0x35')](_0x47f933[_0x1192('0x34')]);_0x1a2ba1[_0x1192('0x36')]=_[_0x1192('0x37')](_0x1a2ba1[_0x1192('0x33')],_0x1a2ba1['query']);_0x1f855e['attributes']=_['intersection'](_0x1a2ba1[_0x1192('0x33')],qs[_0x1192('0x38')](_0x47f933[_0x1192('0x34')][_0x1192('0x38')]));_0x1f855e['attributes']=_0x1f855e[_0x1192('0x39')][_0x1192('0x3a')]?_0x1f855e[_0x1192('0x39')]:_0x1a2ba1[_0x1192('0x33')];if(!_0x47f933[_0x1192('0x34')][_0x1192('0x3b')](_0x1192('0x3c'))){_0x1f855e[_0x1192('0x3d')]=qs['limit'](_0x47f933['query'][_0x1192('0x3d')]);_0x1f855e[_0x1192('0x21')]=qs[_0x1192('0x21')](_0x47f933[_0x1192('0x34')][_0x1192('0x21')]);}_0x1f855e[_0x1192('0x3e')]=qs['sort'](_0x47f933[_0x1192('0x34')][_0x1192('0x3f')]);_0x1f855e[_0x1192('0x40')]=qs[_0x1192('0x36')](_[_0x1192('0x41')](_0x47f933[_0x1192('0x34')],_0x1a2ba1['filters']),_0x6a603f);if(_0x47f933[_0x1192('0x34')][_0x1192('0x42')]){_0x1f855e['where']=_[_0x1192('0x43')](_0x1f855e[_0x1192('0x40')],{'$or':_[_0x1192('0x2d')](_0x6a603f,function(_0x4e5387){if(_0x4e5387['type']!=='VIRTUAL'){var _0x282851={};_0x282851[_0x4e5387[_0x1192('0x2b')]]={'$like':'%'+_0x47f933['query'][_0x1192('0x42')]+'%'};return _0x282851;}})});}_0x1f855e=_[_0x1192('0x43')]({},_0x1f855e,_0x47f933[_0x1192('0x44')]);var _0x406f56={'where':_0x1f855e[_0x1192('0x40')]};return db[_0x1192('0x2e')][_0x1192('0x23')](_0x406f56)[_0x1192('0x26')](function(_0x1c4198){_0x475102[_0x1192('0x23')]=_0x1c4198;if(_0x47f933[_0x1192('0x34')][_0x1192('0x45')]){_0x1f855e[_0x1192('0x46')]=[{'all':!![]}];}return db[_0x1192('0x2e')][_0x1192('0x47')](_0x1f855e);})[_0x1192('0x26')](function(_0x553896){_0x475102['rows']=_0x553896;return _0x475102;})[_0x1192('0x26')](respondWithFilteredResult(_0x7218dc,_0x1f855e))[_0x1192('0x48')](handleError(_0x7218dc,null));};exports[_0x1192('0x49')]=function(_0x5600f6,_0x3fb5f5){var _0x21bba8={'raw':![],'where':{'id':_0x5600f6['params']['id']}},_0x420103={};_0x420103[_0x1192('0x33')]=_[_0x1192('0x35')](db['UserProfile'][_0x1192('0x2f')]);_0x420103[_0x1192('0x34')]=_[_0x1192('0x35')](_0x5600f6['query']);_0x420103[_0x1192('0x36')]=_[_0x1192('0x37')](_0x420103[_0x1192('0x33')],_0x420103[_0x1192('0x34')]);_0x21bba8[_0x1192('0x39')]=_['intersection'](_0x420103['model'],qs[_0x1192('0x38')](_0x5600f6['query'][_0x1192('0x38')]));_0x21bba8[_0x1192('0x39')]=_0x21bba8[_0x1192('0x39')][_0x1192('0x3a')]?_0x21bba8['attributes']:_0x420103[_0x1192('0x33')];if(_0x5600f6[_0x1192('0x34')][_0x1192('0x45')]){_0x21bba8[_0x1192('0x46')]=[{'all':!![]}];}_0x21bba8=_[_0x1192('0x43')]({},_0x21bba8,_0x5600f6[_0x1192('0x44')]);return db[_0x1192('0x2e')]['find'](_0x21bba8)[_0x1192('0x26')](handleEntityNotFound(_0x3fb5f5,null))[_0x1192('0x26')](respondWithResult(_0x3fb5f5,null))['catch'](handleError(_0x3fb5f5,null));};exports[_0x1192('0x4a')]=function(_0x2ad1cf,_0x2822f8){return db[_0x1192('0x2e')][_0x1192('0x4a')](_0x2ad1cf[_0x1192('0x4b')],{})[_0x1192('0x26')](respondWithResult(_0x2822f8,0xc9))['catch'](handleError(_0x2822f8,null));};exports[_0x1192('0x4c')]=function(_0x1799a1,_0x20fc45){var _0x572fbe={'where':{'id':_0x1799a1[_0x1192('0x4d')]['id']}},_0x30708a={};_0x30708a[_0x1192('0x33')]=_['keys'](db['UserProfile']['rawAttributes']);_0x572fbe[_0x1192('0x39')]=_[_0x1192('0x37')](_0x30708a[_0x1192('0x33')],qs['fields'](_0x1799a1['query'][_0x1192('0x38')]));_0x572fbe[_0x1192('0x39')]=_0x572fbe['attributes'][_0x1192('0x3a')]?_0x572fbe[_0x1192('0x39')]:_0x30708a[_0x1192('0x33')];if(_0x1799a1[_0x1192('0x34')]['includeAll']){_0x572fbe[_0x1192('0x46')]=[{'all':!![]}];}_0x572fbe=_[_0x1192('0x43')]({},_0x572fbe,_0x1799a1[_0x1192('0x44')]);return db['UserProfile'][_0x1192('0x4e')](_0x572fbe)['then'](handleEntityNotFound(_0x20fc45,null))[_0x1192('0x26')](function(_0x21b48d){if(_0x21b48d){var _0x405584=_0x21b48d[_0x1192('0x4f')]({'plain':!![]});_0x405584=qs[_0x1192('0x50')](_0x405584,['id',_0x1192('0x51'),_0x1192('0x52'),_0x1192('0x53')]);_0x1799a1['body']=_[_0x1192('0x50')](_0x1799a1['body'],['id',_0x1192('0x51'),_0x1192('0x52')]);return db['sequelize'][_0x1192('0x54')](function(_0xb6f25e){return db[_0x1192('0x2e')][_0x1192('0x4a')](_[_0x1192('0x43')](_0x405584,_0x1799a1['body']),{'include':_0x1799a1[_0x1192('0x34')][_0x1192('0x45')]?[{'all':!![]}]:undefined,'transaction':_0xb6f25e})[_0x1192('0x26')](function(_0x1cfc92){var _0x5b3556=_0x1cfc92['get']({'plain':!![]});return db[_0x1192('0x55')][_0x1192('0x47')]({'where':{'userProfileId':_0x1799a1['params']['id']},'raw':!![]})['then'](function(_0x6c825d){if(_0x6c825d){return BPromise['each'](_0x6c825d,function(_0x45fb56){return new BPromise(function(_0x247ad1,_0x4f4016){if(_0x45fb56[_0x1192('0x56')]===null||_0x45fb56[_0x1192('0x56')]===0x1)_0x247ad1(null);return db['UserProfileResource'][_0x1192('0x47')]({'where':{'sectionId':_0x45fb56['id']},'raw':!![]})[_0x1192('0x26')](function(_0x73209){var _0x376217=_[_0x1192('0x2d')](_0x73209,function(_0x4b14db){return qs[_0x1192('0x50')](_0x4b14db,['id',_0x1192('0x51'),_0x1192('0x52'),'sectionId']);});_0x247ad1(_0x376217);})[_0x1192('0x48')](function(_0x80bd74){_0x4f4016(_0x80bd74);});})[_0x1192('0x26')](function(_0x2ad5ba){var _0x372800=qs[_0x1192('0x50')](_0x45fb56,['id',_0x1192('0x51'),_0x1192('0x52')]);_0x372800[_0x1192('0x57')]=_0x5b3556['id'];if(_0x2ad5ba)_0x372800['Resources']=_0x2ad5ba;return _0x372800;})[_0x1192('0x26')](function(_0x1797d4){return db[_0x1192('0x55')][_0x1192('0x4a')](_0x1797d4,{'include':[{'model':db[_0x1192('0x58')],'as':_0x1192('0x59')}],'raw':!![],'transaction':_0xb6f25e});});})[_0x1192('0x26')](function(){return _0x5b3556;});}});});});}})[_0x1192('0x26')](respondWithResult(_0x20fc45,0xc9))[_0x1192('0x48')](handleError(_0x20fc45,null));};exports[_0x1192('0x5a')]=function(_0x21803d,_0x5182e6){if(_0x21803d[_0x1192('0x4b')]['id']){delete _0x21803d[_0x1192('0x4b')]['id'];}return db[_0x1192('0x2e')][_0x1192('0x4e')]({'where':{'id':_0x21803d[_0x1192('0x4d')]['id']}})[_0x1192('0x26')](handleEntityNotFound(_0x5182e6,null))[_0x1192('0x26')](saveUpdates(_0x21803d[_0x1192('0x4b')],null))[_0x1192('0x26')](respondWithResult(_0x5182e6,null))[_0x1192('0x48')](handleError(_0x5182e6,null));};exports['destroy']=function(_0x24dff5,_0x49343d){return db[_0x1192('0x2e')][_0x1192('0x4e')]({'where':{'id':_0x24dff5['params']['id']}})['then'](handleEntityNotFound(_0x49343d,null))[_0x1192('0x26')](removeEntity(_0x49343d,null))[_0x1192('0x48')](handleError(_0x49343d,null));};exports[_0x1192('0x5b')]=function(_0x29a08c,_0x342ff9){return db[_0x1192('0x2e')][_0x1192('0x5b')]()[_0x1192('0x26')](respondWithResult(_0x342ff9,null))[_0x1192('0x48')](handleError(_0x342ff9,null));};exports['addSections']=function(_0x120e2a,_0x427094){var _0x20ed6e=_0x120e2a[_0x1192('0x4b')];return db['UserProfile']['find']({'where':{'id':_0x120e2a[_0x1192('0x4d')]['id']}})['then'](handleEntityNotFound(_0x427094,null))[_0x1192('0x26')](function(_0x3e83a){if(_0x3e83a){return db[_0x1192('0x5c')][_0x1192('0x54')](function(_0x4f0e92){return db[_0x1192('0x55')][_0x1192('0x27')]({'where':{'userProfileId':_0x120e2a['params']['id'],'sectionId':_['map'](_0x20ed6e,function(_0x1ceab4){return _0x1ceab4[_0x1192('0x5d')];})},'transaction':_0x4f0e92})[_0x1192('0x26')](function(){var _0x5a1837=_['map'](_0x20ed6e,function(_0x94e66f){_0x94e66f['userProfileId']=_0x120e2a['params']['id'];return _0x94e66f;});var _0x31ab55=[];return BPromise['each'](_0x5a1837,function(_0xdc905c){return db[_0x1192('0x55')]['create'](_0xdc905c,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4f0e92})[_0x1192('0x26')](function(_0xb70c55){_0x31ab55[_0x1192('0x5e')](_0xb70c55['get']({'plain':!![]}));});})[_0x1192('0x26')](function(){return _0x31ab55;});});});}})['then'](function(_0x3ca37e){return _0x3ca37e;})[_0x1192('0x26')](respondWithResult(_0x427094,null))['catch'](handleError(_0x427094,null));};exports[_0x1192('0x5f')]=function(_0xbffb55,_0x1a0672){var _0xe06b07;return db['UserProfile']['find']({'where':{'id':_0xbffb55[_0x1192('0x4d')]['id']},'attributes':['id',_0x1192('0x2b')]})[_0x1192('0x26')](handleEntityNotFound(_0x1a0672,null))[_0x1192('0x26')](function(_0x167514){if(_0x167514){_0xe06b07=_0x167514;return db['UserProfileSection'][_0x1192('0x27')]({'where':{'userProfileId':_0xbffb55['params']['id'],'sectionId':_0xbffb55[_0x1192('0x34')][_0x1192('0x60')]}});}})[_0x1192('0x26')](function(){return _0xe06b07;})[_0x1192('0x26')](respondWithStatusCode(_0x1a0672,null))[_0x1192('0x48')](handleError(_0x1a0672,null));};exports[_0x1192('0x61')]=function(_0x2f1d84,_0x552ae4){var _0x571f1e=[];var _0x13fa90=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2f1d84[_0x1192('0x4d')]['id']},'raw':!![]})[_0x1192('0x26')](function(_0x4c48c9){_0x571f1e=_['filter'](_0x4c48c9,function(_0x4978cb){return _0x4978cb[_0x1192('0x62')]===0x1||_[_0x1192('0x63')]([0x3eb,0x709],_0x4978cb[_0x1192('0x5d')]);});if(!_[_0x1192('0x64')](_0x571f1e)){return _[_0x1192('0x2d')](_0x571f1e,function(_0x47247f){return _0x47247f[_0x1192('0x5d')];});}else{return;}})['then'](function(_0x452e8e){if(_0x452e8e)_0x13fa90=_0x452e8e;if(_[_0x1192('0x63')](_0x13fa90,0x64)){var _0x43435e=_[_0x1192('0x4e')](_0x571f1e,{'sectionId':0x64});return hasDefaultDashboard(_0x43435e)[_0x1192('0x26')](function(_0x3c3dce){return _['map'](_0x571f1e,function(_0x3a36e9){if(_0x3a36e9[_0x1192('0x5d')]===0x64){_0x3a36e9[_0x1192('0x65')]=_0x3c3dce;}return _0x3a36e9;});});}else{return;}})[_0x1192('0x26')](function(_0x47e9ec){if(_0x47e9ec)_0x571f1e=_0x47e9ec;if(_['includes'](_0x13fa90,0x3eb)){var _0x2fd738=_[_0x1192('0x4e')](_0x571f1e,{'sectionId':0x3eb});return getCustomDashboards(_0x2fd738)[_0x1192('0x26')](function(_0x12461b){return _[_0x1192('0x2d')](_0x571f1e,function(_0x25c6d4){if(_0x2fd738[_0x1192('0x62')]){if(_0x25c6d4['sectionId']===0x3eb){_0x25c6d4['subsections']=_0x12461b;}}else{if(_0x25c6d4['sectionId']===0x64){_0x25c6d4['subsections']=_0x12461b;}}return _0x25c6d4;});});}else{return;}})[_0x1192('0x26')](function(_0x245e19){if(_0x245e19)_0x571f1e=_0x245e19;if(_[_0x1192('0x63')](_0x13fa90,0x709)){var _0x34c361=_[_0x1192('0x4e')](_0x571f1e,{'sectionId':0x709});return getPlugins(_0x34c361)[_0x1192('0x26')](function(_0x1ee739){if(_0x34c361[_0x1192('0x62')]){return _[_0x1192('0x2d')](_0x571f1e,function(_0x317ad7){if(_0x317ad7[_0x1192('0x5d')]===0x709){_0x317ad7[_0x1192('0x65')]=_0x1ee739;}return _0x317ad7;});}else{var _0x5a794e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ee739};var _0xc15b9=_[_0x1192('0x2d')](_0x571f1e);_0xc15b9[_0x1192('0x5e')](_0x5a794e);return _0xc15b9;}});}else{return;}})[_0x1192('0x26')](function(_0x43de83){if(_0x43de83)_0x571f1e=_0x43de83;return _[_0x1192('0x42')](_0x571f1e,[_0x1192('0x62'),0x1]);})[_0x1192('0x26')](respondWithResult(_0x552ae4,null))['catch'](handleError(_0x552ae4,null));};function hasDefaultDashboard(_0xe36429){var _0x440502=[0x65];return new BPromise(function(_0x3e8958,_0x40d00a){try{if(_0xe36429['autoAssociation']){_0x3e8958(_0x440502);}else{return db[_0x1192('0x58')][_0x1192('0x66')]({'where':{'sectionId':_0xe36429['id']},'raw':!![]})['then'](function(_0x4c8a2f){_0x4c8a2f?_0x3e8958(_0x440502):_0x3e8958();});}}catch(_0x3fdb66){_0x40d00a(_0x3fdb66);}});}function getCustomDashboards(_0x5d0142){var _0x969d74=[];return new BPromise(function(_0x1e4df2,_0x83690){try{if(_0x5d0142[_0x1192('0x56')]){return db[_0x1192('0x67')][_0x1192('0x47')]({'raw':!![]})[_0x1192('0x26')](function(_0x33c361){_0x33c361[_0x1192('0x68')](function(_0x32e81a){_0x969d74['push'](_0x32e81a['id']+0x1869f);});_0x1e4df2(_0x969d74);});}else{return db[_0x1192('0x58')][_0x1192('0x47')]({'where':{'sectionId':_0x5d0142['id']},'raw':!![]})[_0x1192('0x26')](function(_0x1d630b){_0x1d630b[_0x1192('0x68')](function(_0x3b5174){_0x969d74['push'](_0x3b5174[_0x1192('0x69')]+0x1869f);});_0x1e4df2(_0x969d74);});}}catch(_0x72a34c){_0x83690(_0x72a34c);}});}function getPlugins(_0x2a3b0d){var _0x49532e=[];return new BPromise(function(_0x489882,_0xb60951){try{if(_0x2a3b0d[_0x1192('0x56')]){return db[_0x1192('0x6a')][_0x1192('0x47')]({'raw':!![]})[_0x1192('0x26')](function(_0x5d0750){_0x5d0750[_0x1192('0x68')](function(_0x45a6c5){_0x49532e['push'](_0x45a6c5['id']+0x15b38);});_0x489882(_0x49532e);});}else{return db['UserProfileResource'][_0x1192('0x47')]({'where':{'sectionId':_0x2a3b0d['id']},'raw':!![]})[_0x1192('0x26')](function(_0x490ade){_0x490ade[_0x1192('0x68')](function(_0x562d56){_0x49532e[_0x1192('0x5e')](_0x562d56['resourceId']+0x15b38);});_0x489882(_0x49532e);});}}catch(_0x35d2ff){_0xb60951(_0x35d2ff);}});}exports[_0x1192('0x6b')]=function(_0x1a2a27,_0xee4dac){return db['UserProfile'][_0x1192('0x4e')]({'where':{'id':_0x1a2a27[_0x1192('0x4d')]['id']}})['then'](handleEntityNotFound(_0xee4dac,null))[_0x1192('0x26')](function(_0x4650ba){if(_0x4650ba){return db[_0x1192('0x5c')]['transaction'](function(_0x586a1e){return db[_0x1192('0x55')]['findAll']({'where':{'userProfileId':_0x1a2a27[_0x1192('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x1192('0x26')](function(_0x272470){if(_0x272470){return db[_0x1192('0x55')][_0x1192('0x27')]({'where':{'userProfileId':_0x1a2a27[_0x1192('0x4d')]['id'],'id':_[_0x1192('0x2d')](_0x272470,function(_0x362239){return _0x362239['id'];})},'transaction':_0x586a1e});}})[_0x1192('0x26')](function(_0x8d2050){var _0x33c7fc=_['map'](_0x1a2a27['body'],function(_0x349f29){_0x349f29['userProfileId']=_0x1a2a27['params']['id'];return _0x349f29;});return db[_0x1192('0x55')][_0x1192('0x6c')](_0x33c7fc,{'raw':!![],'transaction':_0x586a1e});})[_0x1192('0x26')](function(_0x3675b5){var _0x220acb=_['filter'](_[_0x1192('0x2d')](_0x3675b5,function(_0x23469d){return _0x23469d[_0x1192('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x220acb){return db[_0x1192('0x55')][_0x1192('0x47')]({'where':{'userProfileId':_0x1a2a27['params']['id'],'sectionId':_[_0x1192('0x2d')](_0x220acb,function(_0x4812cb){return _0x4812cb[_0x1192('0x5d')];})},'attributes':['id',_0x1192('0x5d')],'raw':!![]})[_0x1192('0x26')](function(_0x1f5f5d){var _0x998567=_[_0x1192('0x2d')](_0x1a2a27['body'],function(_0xc05096){_0xc05096['userProfileId']=_0x1a2a27[_0x1192('0x4d')]['id'];return _0xc05096;});return db[_0x1192('0x58')][_0x1192('0x6c')](_0x998567,{'raw':!![],'transaction':_0x586a1e});});}})[_0x1192('0x48')](handleError(_0xee4dac,null));});}})[_0x1192('0x26')](function(_0x3943dd){var _0xaa82e4=_['map'](_0x3943dd,function(_0x43c8e3){return _0x43c8e3[_0x1192('0x4f')]({'plain':!![]});});})[_0x1192('0x26')](respondWithResult(_0xee4dac,null))[_0x1192('0x48')](handleError(_0xee4dac,null));};exports[_0x1192('0x6d')]=function(_0x2c00f0,_0x5117bd,_0x385d2a){return db['UserProfile'][_0x1192('0x4e')]({'where':{'id':_0x2c00f0[_0x1192('0x4d')]['id']}})[_0x1192('0x26')](handleEntityNotFound(_0x5117bd,null))[_0x1192('0x26')](function(_0x48fca6){if(_0x48fca6){return _0x48fca6[_0x1192('0x6d')](_0x2c00f0['query']['ids']);}})[_0x1192('0x26')](respondWithStatusCode(_0x5117bd,null))['catch'](handleError(_0x5117bd,null));};exports[_0x1192('0x6e')]=function(_0x2b0b01,_0x13cd35){var _0x40e56b={};if(!_0x2b0b01[_0x1192('0x34')][_0x1192('0x6f')])throw new Error(_0x1192('0x70'));if(!_0x2b0b01[_0x1192('0x34')][_0x1192('0x3b')](_0x1192('0x3c'))){_0x40e56b['limit']=qs[_0x1192('0x3d')](_0x2b0b01['query'][_0x1192('0x3d')]);_0x40e56b[_0x1192('0x21')]=qs[_0x1192('0x21')](_0x2b0b01[_0x1192('0x34')][_0x1192('0x21')]);}return db['UserProfile'][_0x1192('0x4e')]({'where':{'id':_0x2b0b01[_0x1192('0x4d')]['id']}})[_0x1192('0x26')](function(_0x20557a){if(!_0x20557a)throw new Error(_0x1192('0x71')+_0x2b0b01[_0x1192('0x4d')]['id']);return db['UserProfile'][_0x1192('0x6e')](_0x2b0b01);})[_0x1192('0x26')](respondWithFilteredResult(_0x13cd35,_0x40e56b))[_0x1192('0x48')](handleError(_0x13cd35,null));}; \ No newline at end of file +var _0x96d8=['removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','index','UserProfile','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','params','include','find','create','body','clone','rawAttributes','get','omit','updatedAt','createdAt','sequelize','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','UserProfileSection','destroy','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','autoAssociation','Plugin','addResources','bulkCreate'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x96d8,0x1e2));var _0x896d=function(_0x2a6318,_0x2c94c0){_0x2a6318=_0x2a6318-0x0;var _0x1e782b=_0x96d8[_0x2a6318];return _0x1e782b;};'use strict';var emlformat=require(_0x896d('0x0'));var rimraf=require(_0x896d('0x1'));var zipdir=require(_0x896d('0x2'));var jsonpatch=require(_0x896d('0x3'));var rp=require(_0x896d('0x4'));var moment=require(_0x896d('0x5'));var BPromise=require(_0x896d('0x6'));var Mustache=require(_0x896d('0x7'));var util=require(_0x896d('0x8'));var path=require(_0x896d('0x9'));var sox=require(_0x896d('0xa'));var csv=require(_0x896d('0xb'));var ejs=require(_0x896d('0xc'));var fs=require('fs');var fs_extra=require(_0x896d('0xd'));var _=require('lodash');var squel=require(_0x896d('0xe'));var crypto=require(_0x896d('0xf'));var jsforce=require(_0x896d('0x10'));var deskjs=require(_0x896d('0x11'));var toCsv=require(_0x896d('0xb'));var querystring=require(_0x896d('0x12'));var Papa=require(_0x896d('0x13'));var Redis=require(_0x896d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x896d('0x15'));var as=require(_0x896d('0x16'));var hardwareService=require(_0x896d('0x17'));var logger=require(_0x896d('0x18'))(_0x896d('0x19'));var utils=require('../../config/utils');var config=require(_0x896d('0x1a'));var licenseUtil=require(_0x896d('0x1b'));var db=require(_0x896d('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x896d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x896d('0x1e')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x10cf46,_0x10d472){_0x10d472=_0x10d472||0xcc;return function(_0x5a3674){if(_0x5a3674){return _0x10cf46[_0x896d('0x1f')](_0x10d472);}return _0x10cf46[_0x896d('0x20')](_0x10d472)[_0x896d('0x21')]();};}function respondWithResult(_0x332eba,_0x1cd959){_0x1cd959=_0x1cd959||0xc8;return function(_0x28514a){if(_0x28514a){return _0x332eba[_0x896d('0x20')](_0x1cd959)[_0x896d('0x22')](_0x28514a);}};}function respondWithFilteredResult(_0x28be1e,_0x50c5ff){return function(_0x34732b){if(_0x34732b){var _0x26d64e=typeof _0x50c5ff['offset']===_0x896d('0x23')&&typeof _0x50c5ff[_0x896d('0x24')]===_0x896d('0x23');var _0x598cd9=_0x34732b[_0x896d('0x25')];var _0x446838=_0x26d64e?0x0:_0x50c5ff[_0x896d('0x26')];var _0xa41442=_0x26d64e?_0x34732b['count']:_0x50c5ff[_0x896d('0x26')]+_0x50c5ff[_0x896d('0x24')];var _0x3e626a;if(_0xa41442>=_0x598cd9){_0xa41442=_0x598cd9;_0x3e626a=0xc8;}else{_0x3e626a=0xce;}_0x28be1e[_0x896d('0x20')](_0x3e626a);return _0x28be1e[_0x896d('0x27')](_0x896d('0x28'),_0x446838+'-'+_0xa41442+'/'+_0x598cd9)[_0x896d('0x22')](_0x34732b);}return null;};}function patchUpdates(_0x235bbc){return function(_0xdf2542){try{jsonpatch[_0x896d('0x29')](_0xdf2542,_0x235bbc,!![]);}catch(_0x4c8264){return BPromise[_0x896d('0x2a')](_0x4c8264);}return _0xdf2542[_0x896d('0x2b')]();};}function saveUpdates(_0x2d550c,_0xcd926){return function(_0x262e6a){if(_0x262e6a){return _0x262e6a['update'](_0x2d550c)['then'](function(_0x1ed355){return _0x1ed355;});}return null;};}function removeEntity(_0x5acbea,_0x49985f){return function(_0x46e762){if(_0x46e762){return _0x46e762['destroy']()['then'](function(){_0x5acbea[_0x896d('0x20')](0xcc)[_0x896d('0x21')]();});}};}function handleEntityNotFound(_0x36a04e,_0x2a58a4){return function(_0x2b3d4){if(!_0x2b3d4){_0x36a04e[_0x896d('0x1f')](0x194);}return _0x2b3d4;};}function handleError(_0x1428a3,_0x5ecab6){_0x5ecab6=_0x5ecab6||0x1f4;return function(_0x390b16){logger[_0x896d('0x2c')](_0x390b16[_0x896d('0x2d')]);if(_0x390b16[_0x896d('0x2e')]){delete _0x390b16['name'];}_0x1428a3[_0x896d('0x20')](_0x5ecab6)[_0x896d('0x2f')](_0x390b16);};}exports[_0x896d('0x30')]=function(_0xc97104,_0x221545){var _0xfb9d38={},_0x469f1f={},_0x4aa97b={'count':0x0,'rows':[]};var _0x5bf090=_['map'](db[_0x896d('0x31')]['rawAttributes'],function(_0xde98cb){return{'name':_0xde98cb[_0x896d('0x32')],'type':_0xde98cb[_0x896d('0x33')][_0x896d('0x34')]};});_0x469f1f['model']=_[_0x896d('0x35')](_0x5bf090,_0x896d('0x2e'));_0x469f1f[_0x896d('0x36')]=_[_0x896d('0x37')](_0xc97104[_0x896d('0x36')]);_0x469f1f[_0x896d('0x38')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],_0x469f1f[_0x896d('0x36')]);_0xfb9d38[_0x896d('0x3b')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0xc97104['query'][_0x896d('0x3c')]));_0xfb9d38[_0x896d('0x3b')]=_0xfb9d38['attributes'][_0x896d('0x3d')]?_0xfb9d38[_0x896d('0x3b')]:_0x469f1f[_0x896d('0x3a')];if(!_0xc97104['query']['hasOwnProperty'](_0x896d('0x3e'))){_0xfb9d38[_0x896d('0x24')]=qs[_0x896d('0x24')](_0xc97104['query'][_0x896d('0x24')]);_0xfb9d38[_0x896d('0x26')]=qs[_0x896d('0x26')](_0xc97104[_0x896d('0x36')][_0x896d('0x26')]);}_0xfb9d38[_0x896d('0x3f')]=qs[_0x896d('0x40')](_0xc97104[_0x896d('0x36')][_0x896d('0x40')]);_0xfb9d38['where']=qs['filters'](_['pick'](_0xc97104[_0x896d('0x36')],_0x469f1f[_0x896d('0x38')]),_0x5bf090);if(_0xc97104[_0x896d('0x36')][_0x896d('0x41')]){_0xfb9d38['where']=_['merge'](_0xfb9d38[_0x896d('0x42')],{'$or':_[_0x896d('0x35')](_0x5bf090,function(_0x4f32d7){if(_0x4f32d7['type']!==_0x896d('0x43')){var _0x416180={};_0x416180[_0x4f32d7['name']]={'$like':'%'+_0xc97104[_0x896d('0x36')][_0x896d('0x41')]+'%'};return _0x416180;}})});}_0xfb9d38=_[_0x896d('0x44')]({},_0xfb9d38,_0xc97104[_0x896d('0x45')]);var _0x4419cf={'where':_0xfb9d38[_0x896d('0x42')]};return db['UserProfile']['count'](_0x4419cf)[_0x896d('0x46')](function(_0x698a1d){_0x4aa97b[_0x896d('0x25')]=_0x698a1d;if(_0xc97104['query'][_0x896d('0x47')]){_0xfb9d38['include']=[{'all':!![]}];}return db[_0x896d('0x31')][_0x896d('0x48')](_0xfb9d38);})[_0x896d('0x46')](function(_0x4a4c90){_0x4aa97b[_0x896d('0x49')]=_0x4a4c90;return _0x4aa97b;})[_0x896d('0x46')](respondWithFilteredResult(_0x221545,_0xfb9d38))[_0x896d('0x4a')](handleError(_0x221545,null));};exports['show']=function(_0x209f35,_0x519151){var _0x13bdee={'raw':![],'where':{'id':_0x209f35[_0x896d('0x4b')]['id']}},_0x241685={};_0x241685[_0x896d('0x3a')]=_[_0x896d('0x37')](db[_0x896d('0x31')]['rawAttributes']);_0x241685[_0x896d('0x36')]=_[_0x896d('0x37')](_0x209f35[_0x896d('0x36')]);_0x241685['filters']=_[_0x896d('0x39')](_0x241685['model'],_0x241685[_0x896d('0x36')]);_0x13bdee['attributes']=_[_0x896d('0x39')](_0x241685[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0x209f35[_0x896d('0x36')][_0x896d('0x3c')]));_0x13bdee[_0x896d('0x3b')]=_0x13bdee[_0x896d('0x3b')][_0x896d('0x3d')]?_0x13bdee[_0x896d('0x3b')]:_0x241685[_0x896d('0x3a')];if(_0x209f35[_0x896d('0x36')][_0x896d('0x47')]){_0x13bdee[_0x896d('0x4c')]=[{'all':!![]}];}_0x13bdee=_[_0x896d('0x44')]({},_0x13bdee,_0x209f35[_0x896d('0x45')]);return db['UserProfile'][_0x896d('0x4d')](_0x13bdee)[_0x896d('0x46')](handleEntityNotFound(_0x519151,null))[_0x896d('0x46')](respondWithResult(_0x519151,null))[_0x896d('0x4a')](handleError(_0x519151,null));};exports[_0x896d('0x4e')]=function(_0x46d25c,_0x1a14aa){return db[_0x896d('0x31')][_0x896d('0x4e')](_0x46d25c[_0x896d('0x4f')],{})[_0x896d('0x46')](respondWithResult(_0x1a14aa,0xc9))[_0x896d('0x4a')](handleError(_0x1a14aa,null));};exports[_0x896d('0x50')]=function(_0x16372c,_0x58e5a4){var _0x4c3651={'where':{'id':_0x16372c[_0x896d('0x4b')]['id']}},_0x42a187={};_0x42a187['model']=_[_0x896d('0x37')](db[_0x896d('0x31')][_0x896d('0x51')]);_0x4c3651['attributes']=_[_0x896d('0x39')](_0x42a187[_0x896d('0x3a')],qs['fields'](_0x16372c[_0x896d('0x36')][_0x896d('0x3c')]));_0x4c3651[_0x896d('0x3b')]=_0x4c3651[_0x896d('0x3b')][_0x896d('0x3d')]?_0x4c3651['attributes']:_0x42a187[_0x896d('0x3a')];if(_0x16372c[_0x896d('0x36')][_0x896d('0x47')]){_0x4c3651['include']=[{'all':!![]}];}_0x4c3651=_[_0x896d('0x44')]({},_0x4c3651,_0x16372c[_0x896d('0x45')]);return db[_0x896d('0x31')][_0x896d('0x4d')](_0x4c3651)[_0x896d('0x46')](handleEntityNotFound(_0x58e5a4,null))[_0x896d('0x46')](function(_0x50d040){if(_0x50d040){var _0x7a4d5f=_0x50d040[_0x896d('0x52')]({'plain':!![]});_0x7a4d5f=qs[_0x896d('0x53')](_0x7a4d5f,['id','createdAt',_0x896d('0x54'),'crudPermissions']);_0x16372c[_0x896d('0x4f')]=_[_0x896d('0x53')](_0x16372c[_0x896d('0x4f')],['id',_0x896d('0x55'),_0x896d('0x54')]);return db[_0x896d('0x56')]['transaction'](function(_0x5c47ea){return db[_0x896d('0x31')][_0x896d('0x4e')](_['merge'](_0x7a4d5f,_0x16372c['body']),{'include':_0x16372c['query'][_0x896d('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x5c47ea})['then'](function(_0x2c32ee){var _0x4fce76=_0x2c32ee[_0x896d('0x52')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x16372c[_0x896d('0x4b')]['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2d8f18){if(_0x2d8f18){return BPromise['each'](_0x2d8f18,function(_0x1fae73){return new BPromise(function(_0x23503b,_0x3de1a3){if(_0x1fae73['autoAssociation']===null||_0x1fae73['autoAssociation']===0x1)_0x23503b(null);return db[_0x896d('0x57')][_0x896d('0x48')]({'where':{'sectionId':_0x1fae73['id']},'raw':!![]})[_0x896d('0x46')](function(_0x4fea65){var _0x32f46f=_[_0x896d('0x35')](_0x4fea65,function(_0x3c6f8c){return qs['omit'](_0x3c6f8c,['id',_0x896d('0x55'),_0x896d('0x54'),_0x896d('0x58')]);});_0x23503b(_0x32f46f);})['catch'](function(_0x97d82a){_0x3de1a3(_0x97d82a);});})[_0x896d('0x46')](function(_0xf3bf59){var _0x137acc=qs[_0x896d('0x53')](_0x1fae73,['id',_0x896d('0x55'),_0x896d('0x54')]);_0x137acc[_0x896d('0x59')]=_0x4fce76['id'];if(_0xf3bf59)_0x137acc['Resources']=_0xf3bf59;return _0x137acc;})[_0x896d('0x46')](function(_0x45c153){return db['UserProfileSection'][_0x896d('0x4e')](_0x45c153,{'include':[{'model':db[_0x896d('0x57')],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x5c47ea});});})['then'](function(){return _0x4fce76;});}});});});}})['then'](respondWithResult(_0x58e5a4,0xc9))[_0x896d('0x4a')](handleError(_0x58e5a4,null));};exports[_0x896d('0x5b')]=function(_0x3dfff2,_0x5ca1c8){if(_0x3dfff2['body']['id']){delete _0x3dfff2[_0x896d('0x4f')]['id'];}return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3dfff2[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x5ca1c8,null))[_0x896d('0x46')](saveUpdates(_0x3dfff2['body'],null))[_0x896d('0x46')](respondWithResult(_0x5ca1c8,null))[_0x896d('0x4a')](handleError(_0x5ca1c8,null));};exports['destroy']=function(_0x1a37f7,_0x1dee4d){return db[_0x896d('0x31')]['find']({'where':{'id':_0x1a37f7[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x1dee4d,null))[_0x896d('0x46')](removeEntity(_0x1dee4d,null))[_0x896d('0x4a')](handleError(_0x1dee4d,null));};exports[_0x896d('0x5c')]=function(_0x126c83,_0x5869d2){return db[_0x896d('0x31')][_0x896d('0x5c')]()[_0x896d('0x46')](respondWithResult(_0x5869d2,null))['catch'](handleError(_0x5869d2,null));};exports[_0x896d('0x5d')]=function(_0x3bf464,_0x33facf){var _0x3da584=_0x3bf464[_0x896d('0x4f')];return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3bf464[_0x896d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33facf,null))[_0x896d('0x46')](function(_0x35eac9){if(_0x35eac9){return db[_0x896d('0x56')]['transaction'](function(_0x417cfe){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3bf464['params']['id'],'sectionId':_[_0x896d('0x35')](_0x3da584,function(_0x3029e7){return _0x3029e7[_0x896d('0x58')];})},'transaction':_0x417cfe})[_0x896d('0x46')](function(){var _0x2cf00e=_['map'](_0x3da584,function(_0x21d48d){_0x21d48d['userProfileId']=_0x3bf464[_0x896d('0x4b')]['id'];return _0x21d48d;});var _0x30eaa6=[];return BPromise[_0x896d('0x60')](_0x2cf00e,function(_0x580562){return db[_0x896d('0x5e')][_0x896d('0x4e')](_0x580562,{'include':[{'model':db['UserProfileResource'],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x417cfe})[_0x896d('0x46')](function(_0x5cc826){_0x30eaa6[_0x896d('0x61')](_0x5cc826[_0x896d('0x52')]({'plain':!![]}));});})[_0x896d('0x46')](function(){return _0x30eaa6;});});});}})['then'](function(_0x2a668f){return _0x2a668f;})['then'](respondWithResult(_0x33facf,null))[_0x896d('0x4a')](handleError(_0x33facf,null));};exports[_0x896d('0x62')]=function(_0x98243d,_0x5d356a){var _0x523d97;return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x98243d[_0x896d('0x4b')]['id']},'attributes':['id',_0x896d('0x2e')]})[_0x896d('0x46')](handleEntityNotFound(_0x5d356a,null))[_0x896d('0x46')](function(_0x4fba9a){if(_0x4fba9a){_0x523d97=_0x4fba9a;return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x98243d[_0x896d('0x4b')]['id'],'sectionId':_0x98243d['query'][_0x896d('0x63')]}});}})[_0x896d('0x46')](function(){return _0x523d97;})[_0x896d('0x46')](respondWithStatusCode(_0x5d356a,null))['catch'](handleError(_0x5d356a,null));};exports[_0x896d('0x64')]=function(_0x12cbb5,_0x2296d4){var _0x3185c1=[];var _0x399962=[];return db[_0x896d('0x5e')][_0x896d('0x48')]({'where':{'userProfileId':_0x12cbb5['params']['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2e448a){_0x3185c1=_[_0x896d('0x41')](_0x2e448a,function(_0x37b0d7){return _0x37b0d7[_0x896d('0x65')]===0x1||_[_0x896d('0x66')]([0x3eb,0x709],_0x37b0d7[_0x896d('0x58')]);});if(!_[_0x896d('0x67')](_0x3185c1)){return _[_0x896d('0x35')](_0x3185c1,function(_0x252eca){return _0x252eca['sectionId'];});}else{return;}})[_0x896d('0x46')](function(_0x539407){if(_0x539407)_0x399962=_0x539407;if(_[_0x896d('0x66')](_0x399962,0x64)){var _0x59bca2=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x64});return hasDefaultDashboard(_0x59bca2)[_0x896d('0x46')](function(_0x915ea7){return _['map'](_0x3185c1,function(_0x2c9792){if(_0x2c9792[_0x896d('0x58')]===0x64){_0x2c9792['subsections']=_0x915ea7;}return _0x2c9792;});});}else{return;}})['then'](function(_0x167b16){if(_0x167b16)_0x3185c1=_0x167b16;if(_[_0x896d('0x66')](_0x399962,0x3eb)){var _0x2aa49c=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x3eb});return getCustomDashboards(_0x2aa49c)[_0x896d('0x46')](function(_0x276c79){return _[_0x896d('0x35')](_0x3185c1,function(_0x224827){if(_0x2aa49c[_0x896d('0x65')]){if(_0x224827[_0x896d('0x58')]===0x3eb){_0x224827[_0x896d('0x68')]=_0x276c79;}}else{if(_0x224827['sectionId']===0x64){_0x224827['subsections']=_0x276c79;}}return _0x224827;});});}else{return;}})[_0x896d('0x46')](function(_0x134c94){if(_0x134c94)_0x3185c1=_0x134c94;if(_['includes'](_0x399962,0x709)){var _0x484499=_['find'](_0x3185c1,{'sectionId':0x709});return getPlugins(_0x484499)['then'](function(_0x927b11){if(_0x484499['enabled']){return _[_0x896d('0x35')](_0x3185c1,function(_0x412dc8){if(_0x412dc8[_0x896d('0x58')]===0x709){_0x412dc8['subsections']=_0x927b11;}return _0x412dc8;});}else{var _0xe15c3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x927b11};var _0x2e0912=_[_0x896d('0x35')](_0x3185c1);_0x2e0912[_0x896d('0x61')](_0xe15c3);return _0x2e0912;}});}else{return;}})[_0x896d('0x46')](function(_0x7f003a){if(_0x7f003a)_0x3185c1=_0x7f003a;return _[_0x896d('0x41')](_0x3185c1,[_0x896d('0x65'),0x1]);})[_0x896d('0x46')](respondWithResult(_0x2296d4,null))[_0x896d('0x4a')](handleError(_0x2296d4,null));};function hasDefaultDashboard(_0x984fa7){var _0x555714=[0x65];return new BPromise(function(_0x59d980,_0x35b9df){try{if(_0x984fa7['autoAssociation']){_0x59d980(_0x555714);}else{return db['UserProfileResource'][_0x896d('0x69')]({'where':{'sectionId':_0x984fa7['id']},'raw':!![]})['then'](function(_0x112981){_0x112981?_0x59d980(_0x555714):_0x59d980();});}}catch(_0x50524e){_0x35b9df(_0x50524e);}});}function getCustomDashboards(_0x3188e4){var _0x291b16=[];return new BPromise(function(_0xc5d2d1,_0x32933e){try{if(_0x3188e4['autoAssociation']){return db[_0x896d('0x6a')]['findAll']({'raw':!![]})[_0x896d('0x46')](function(_0x576240){_0x576240[_0x896d('0x6b')](function(_0x9e8272){_0x291b16[_0x896d('0x61')](_0x9e8272['id']+0x1869f);});_0xc5d2d1(_0x291b16);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3188e4['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3fd8b7){_0x3fd8b7[_0x896d('0x6b')](function(_0x11c658){_0x291b16[_0x896d('0x61')](_0x11c658[_0x896d('0x6c')]+0x1869f);});_0xc5d2d1(_0x291b16);});}}catch(_0x218c64){_0x32933e(_0x218c64);}});}function getPlugins(_0x2b80cc){var _0x5220ce=[];return new BPromise(function(_0xeebbb6,_0x47679e){try{if(_0x2b80cc[_0x896d('0x6d')]){return db[_0x896d('0x6e')]['findAll']({'raw':!![]})['then'](function(_0x56659e){_0x56659e[_0x896d('0x6b')](function(_0x17cfd5){_0x5220ce[_0x896d('0x61')](_0x17cfd5['id']+0x15b38);});_0xeebbb6(_0x5220ce);});}else{return db['UserProfileResource'][_0x896d('0x48')]({'where':{'sectionId':_0x2b80cc['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3c2265){_0x3c2265[_0x896d('0x6b')](function(_0x50ff46){_0x5220ce[_0x896d('0x61')](_0x50ff46[_0x896d('0x6c')]+0x15b38);});_0xeebbb6(_0x5220ce);});}}catch(_0x3e4d7c){_0x47679e(_0x3e4d7c);}});}exports[_0x896d('0x6f')]=function(_0x3e9c43,_0x357b00){return db['UserProfile']['find']({'where':{'id':_0x3e9c43[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x357b00,null))[_0x896d('0x46')](function(_0x34ac88){if(_0x34ac88){return db[_0x896d('0x56')]['transaction'](function(_0x1753bd){return db['UserProfileSection'][_0x896d('0x48')]({'where':{'userProfileId':_0x3e9c43['params']['id']},'attributes':['id'],'raw':!![]})[_0x896d('0x46')](function(_0x4c8f24){if(_0x4c8f24){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'id':_[_0x896d('0x35')](_0x4c8f24,function(_0x482aef){return _0x482aef['id'];})},'transaction':_0x1753bd});}})[_0x896d('0x46')](function(_0x3e0e93){var _0x361c53=_[_0x896d('0x35')](_0x3e9c43[_0x896d('0x4f')],function(_0x421f85){_0x421f85['userProfileId']=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x421f85;});return db[_0x896d('0x5e')]['bulkCreate'](_0x361c53,{'raw':!![],'transaction':_0x1753bd});})['then'](function(_0x1f810b){var _0x107562=_['filter'](_['map'](_0x1f810b,function(_0x390a67){return _0x390a67['get']({'plain':!![]});}),{'includeAll':![]});if(_0x107562){return db[_0x896d('0x5e')]['findAll']({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'sectionId':_[_0x896d('0x35')](_0x107562,function(_0x2499bf){return _0x2499bf[_0x896d('0x58')];})},'attributes':['id',_0x896d('0x58')],'raw':!![]})[_0x896d('0x46')](function(_0x2ef50a){var _0x1db74c=_['map'](_0x3e9c43[_0x896d('0x4f')],function(_0x1bbf89){_0x1bbf89[_0x896d('0x59')]=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x1bbf89;});return db[_0x896d('0x57')][_0x896d('0x70')](_0x1db74c,{'raw':!![],'transaction':_0x1753bd});});}})[_0x896d('0x4a')](handleError(_0x357b00,null));});}})['then'](function(_0x4f0636){var _0x20e882=_['map'](_0x4f0636,function(_0x17c39b){return _0x17c39b['get']({'plain':!![]});});})[_0x896d('0x46')](respondWithResult(_0x357b00,null))[_0x896d('0x4a')](handleError(_0x357b00,null));};exports[_0x896d('0x71')]=function(_0x36cbd8,_0xa22e50,_0x255926){return db[_0x896d('0x31')]['find']({'where':{'id':_0x36cbd8[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0xa22e50,null))[_0x896d('0x46')](function(_0x589ba2){if(_0x589ba2){return _0x589ba2[_0x896d('0x71')](_0x36cbd8[_0x896d('0x36')][_0x896d('0x63')]);}})[_0x896d('0x46')](respondWithStatusCode(_0xa22e50,null))[_0x896d('0x4a')](handleError(_0xa22e50,null));};exports['getResources']=function(_0x12d0e7,_0x1849ab){var _0x4231e9={};if(!_0x12d0e7['query'][_0x896d('0x72')])throw new Error(_0x896d('0x73'));if(!_0x12d0e7['query'][_0x896d('0x74')](_0x896d('0x3e'))){_0x4231e9['limit']=qs[_0x896d('0x24')](_0x12d0e7['query'][_0x896d('0x24')]);_0x4231e9[_0x896d('0x26')]=qs[_0x896d('0x26')](_0x12d0e7[_0x896d('0x36')][_0x896d('0x26')]);}return db['UserProfile'][_0x896d('0x4d')]({'where':{'id':_0x12d0e7[_0x896d('0x4b')]['id']}})['then'](function(_0xf75441){if(!_0xf75441)throw new Error(_0x896d('0x75')+_0x12d0e7[_0x896d('0x4b')]['id']);return db[_0x896d('0x31')][_0x896d('0x76')](_0x12d0e7);})[_0x896d('0x46')](respondWithFilteredResult(_0x1849ab,_0x4231e9))[_0x896d('0x4a')](handleError(_0x1849ab,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index de2045a..cf71658 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 _0x5fdc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fdc,0x127));var _0xc5fd=function(_0x3ea7f6,_0x34b5f1){_0x3ea7f6=_0x3ea7f6-0x0;var _0xf7cc0f=_0x5fdc[_0x3ea7f6];return _0xf7cc0f;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var UserProfile=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc5fd('0x3')](0x0);var events={'afterCreate':_0xc5fd('0x4'),'afterUpdate':_0xc5fd('0x5'),'afterDestroy':_0xc5fd('0x6')};function emitEvent(_0x4d015c){return function(_0xfdf928,_0x1b6205,_0xca27a0){UserProfileEvents[_0xc5fd('0x7')](_0x4d015c+':'+_0xfdf928['id'],_0xfdf928);UserProfileEvents[_0xc5fd('0x7')](_0x4d015c,_0xfdf928);_0xca27a0(null);};}for(var e in events){if(events[_0xc5fd('0x8')](e)){var event=events[e];UserProfile[_0xc5fd('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x202a=['update','hasOwnProperty','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa202('0x0'))['db'][_0xa202('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4878f5){return function(_0x595945,_0x32f8b7,_0x1ce932){UserProfileEvents['emit'](_0x4878f5+':'+_0x595945['id'],_0x595945);UserProfileEvents['emit'](_0x4878f5,_0x595945);_0x1ce932(null);};}for(var e in events){if(events[_0xa202('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7f5380a..e1fb043 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 _0x187d=['chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','membername','Telephones','User','telephone','queue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','VoiceQueue','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','union','ignore','push','rawAttributes','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','DefaultReports','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue'];(function(_0x36229e,_0x3309cd){var _0x2155ed=function(_0x1be3bb){while(--_0x1be3bb){_0x36229e['push'](_0x36229e['shift']());}};_0x2155ed(++_0x3309cd);}(_0x187d,0x93));var _0xd187=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x187d[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0xd187('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd187('0x1'));var squel=require(_0xd187('0x2'));module[_0xd187('0x3')]=function(_0x1cb41f){var _0x18498b=_0x1cb41f[_0xd187('0x4')];function _0x58622a(_0x28fa0b,_0x163807){return new Promise(function(_0x4ebc8d,_0x1d2533){if(!_0x163807)return _0x4ebc8d(null);var _0x58ee7=_0x163807[_0xd187('0x5')]?{[_0x163807[_0xd187('0x5')][_0xd187('0x6')]]:_0x163807[_0xd187('0x5')][_0xd187('0x7')]}:undefined;return _0x18498b[_0x28fa0b][_0xd187('0x8')]({'where':_0x58ee7,'raw':!![]})['then'](function(_0x342539){_0x163807[_0xd187('0x9')]=_[_0xd187('0xa')](_0x342539,'id');_0x4ebc8d(_0x163807);})[_0xd187('0xb')](function(_0x33ca45){_0x1d2533(_0x33ca45);});});}function _0x2a61a4(_0x59c194,_0x10d467){return new Promise(function(_0x412ccf,_0x18237b){var _0x5e6180=_0x59c194[_0xd187('0x5')]?{[_0x59c194[_0xd187('0x5')][_0xd187('0x6')]]:_0x59c194['filter'][_0xd187('0x7')]}:undefined;return _0x18498b[_0x59c194[_0xd187('0xc')]][_0xd187('0x8')]({'where':_0x5e6180,'raw':!![]})[_0xd187('0xd')](function(_0x517b25){_0x10d467[_0xd187('0x9')]=_[_0xd187('0xa')](_0x517b25,function(_0x45ab10){return _0x45ab10[_0xd187('0xe')];});_0x412ccf(_0x10d467);})['catch'](function(_0x245d3e){_0x18237b(_0x245d3e);});});}function _0x52a208(_0x5cf218,_0x40ed84,_0x5a4986){if(!_0x40ed84)return Promise['resolve'](null);return new Promise(function(_0x207b36,_0x2b3290){return _0x18498b[_0xd187('0xf')][_0xd187('0x8')]({'where':{'sectionId':_0x40ed84['id']},'raw':!![]})[_0xd187('0xd')](function(_0x253a7e){if(_0x5cf218[_0xd187('0x6')]&&_0x5cf218[_0xd187('0x6')]!=='id'){_0x40ed84[_0xd187('0x9')]=_[_0xd187('0xa')](_0x253a7e,function(_0x170d5c){return _0x170d5c[_0x5cf218[_0xd187('0x6')]];});}else{if(_0x5a4986===_0xd187('0x10')){_0x40ed84['associatedResources']=_[_0xd187('0xa')](_0x253a7e,function(_0x81b988){return{'id':_0x81b988[_0xd187('0x11')],'type':_0x81b988['type']};});}else{_0x40ed84['associatedResources']=_['map'](_0x253a7e,function(_0x435d94){return _0x435d94[_0xd187('0x11')];});}}_0x207b36(_0x40ed84);})[_0xd187('0xb')](function(_0x4f62c8){_0x2b3290(_0x4f62c8);});});}function _0x2c07c8(_0x57186b,_0x145771){var _0x5a7a23={'parentSections':[]};switch(_0x57186b[_0xd187('0x12')]()){case'squareprojects':_0x5a7a23['childModel']=_0xd187('0x13');break;case'odbc':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x15');break;case'squarerecordings':_0x5a7a23['childModel']=_0xd187('0x16');_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x18'),'field':_0xd187('0xe'),'foreignKey':'projectName'}];break;case _0xd187('0x19'):_0x5a7a23[_0xd187('0x14')]='JscriptyProject';break;case _0xd187('0x1a'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1b');_0x5a7a23['parentSections']=[{'name':_0xd187('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd187('0x1d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1e');break;case _0xd187('0x1f'):_0x5a7a23['childModel']=_0xd187('0x20');break;case _0xd187('0x21'):_0x5a7a23['childModel']='CmCustomField';break;case _0xd187('0x22'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x23');break;case _0xd187('0x24'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x25');break;case _0xd187('0x26'):_0x5a7a23[_0xd187('0x14')]='FaxQueue';break;case _0xd187('0x27'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x28');break;case'inboundroutes':case _0xd187('0x29'):case'outboundroutes':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2a');break;case _0xd187('0x2b'):_0x5a7a23['childModel']='VoiceContext';break;case _0xd187('0x2c'):_0x5a7a23[_0xd187('0x14')]='VoiceMail';break;case _0xd187('0x2d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2e');_0x5a7a23['parentSections']=[{'name':'Agents','field':_0xd187('0xe'),'foreignKey':_0xd187('0x2f'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xd187('0x30'),'field':'name','foreignKey':_0xd187('0x2f'),'model':_0xd187('0x31'),'filter':{'field':'role','value':[_0xd187('0x32')]}},{'name':'VoiceQueues','field':_0xd187('0xe'),'foreignKey':_0xd187('0x33'),'model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x35')]}},{'name':'QueueCampaigns','field':_0xd187('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x36')]}}];break;case _0xd187('0x37'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x38');break;case'chanspies':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x39');break;case _0xd187('0x3a'):_0x5a7a23['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5a7a23['childModel']=_0xd187('0x3b');break;case _0xd187('0x3c'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3d');break;case _0xd187('0x3e'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3f');break;case _0xd187('0x40'):_0x5a7a23['childModel']=_0xd187('0x41');break;case _0xd187('0x42'):_0x5a7a23[_0xd187('0x14')]='OpenchannelQueue';break;case _0xd187('0x43'):_0x5a7a23['childModel']=_0xd187('0x44');break;case _0xd187('0x45'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x46');break;case _0xd187('0x47'):_0x5a7a23['childModel']=_0xd187('0x48');break;case _0xd187('0x49'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4a');break;case'whatsappaccounts':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4b');break;case'teams':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4c');break;case'voicequeues':case'queuecampaigns':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4d');if(_0x145771){_0x5a7a23['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xd187('0x4e'):case _0xd187('0x4f'):case _0xd187('0x50'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x31');if(_0x145771){_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x51'),'filter':{'field':'role','value':[_0xd187('0x52'),_0xd187('0x53')]},'ignore':!![]},{'name':_0xd187('0x54')},{'name':_0xd187('0x30')}];}break;case _0xd187('0x55'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x56');break;case _0xd187('0x57'):_0x5a7a23['childModel']=_0xd187('0x58');break;case _0xd187('0x59'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x5a');break;case _0xd187('0x5b'):_0x5a7a23['childModel']=_0xd187('0x5c');break;case _0xd187('0x5d'):_0x5a7a23['childModel']=_0xd187('0x5e');break;case _0xd187('0x5f'):_0x5a7a23['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x5a7a23['childModel']=_0xd187('0x31');break;case _0xd187('0x60'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x61');break;case _0xd187('0x62'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x63');break;case'customdashboards':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x64');break;case _0xd187('0x65'):_0x5a7a23[_0xd187('0x14')]='Interval';break;case _0xd187('0x66'):_0x5a7a23['childModel']='Pause';break;case _0xd187('0x67'):_0x5a7a23['childModel']=_0xd187('0x68');break;case _0xd187('0x69'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6a');break;case _0xd187('0x6b'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6c');break;case _0xd187('0x6d'):_0x5a7a23[_0xd187('0x14')]='Template';break;case _0xd187('0x6e'):_0x5a7a23[_0xd187('0x14')]='Trigger';break;case _0xd187('0x6f'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x70');break;case'variables':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x71');break;case'plugins':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x72');break;case'extractedreports':_0x5a7a23[_0xd187('0x14')]='AnalyticExtractedReport';_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x73'),'field':'id','foreignKey':_0xd187('0x74')}];break;case _0xd187('0x75'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x76');break;}return _0x5a7a23;}function _0x1675d9(_0x4eddd5,_0xcef6ca){var _0x298b46=_0x4eddd5[_0xd187('0x77')](0x0)['toUpperCase']()+_0x4eddd5[_0xd187('0x78')](0x1);var _0x23428f={'type':_0x18498b[_0xd187('0x79')][_0xd187('0x7a')][_0xd187('0x7b')],'raw':!![]};return new Promise(function(_0x2c4f4d,_0x10ebf4){var _0x202f73=squel[_0xd187('0x7c')]()[_0xd187('0x6')](_0xd187('0x7d')+_0x298b46+_0xd187('0x7e'),'id')[_0xd187('0x6')](_0xd187('0x7f'))[_0xd187('0x80')](_0xd187('0x81')+_0x4eddd5+_0xd187('0x82'),'ui')[_0xd187('0x83')](_0xd187('0x84'),_0xcef6ca['id']);return _0x18498b[_0xd187('0x85')]['query'](_0x202f73[_0xd187('0x86')](),_0x23428f)['then'](function(_0x13d118){_0xcef6ca[_0x298b46+_0xd187('0x87')]=_0x13d118;_0x2c4f4d(_0x13d118);})[_0xd187('0xb')](function(_0x4225e6){_0x10ebf4(_0x4225e6);});});}return _0x1cb41f['define'](_0xd187('0x88'),attributes,{'tableName':_0xd187('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f89a6){var _0x509815={'raw':![],'where':{}};var _0x3613ee={};var _0x2c2a62={'count':0x0,'rows':[]};var _0x2870ad=_0x4f89a6[_0xd187('0x8a')]['section'];var _0x2c1df4=_0x4f89a6['query'][_0xd187('0x8b')]||![];var _0x2f6a72=_0x2c07c8(_0x2870ad,_0x2c1df4);if(!_0x2f6a72[_0xd187('0x14')])throw new Error(_0xd187('0x8c')+_0x2870ad+'\x27');var _0x57cad7=[{'name':_0x2870ad}];if(!_[_0xd187('0x8d')](_0x2f6a72[_0xd187('0x17')]))_0x57cad7=_0x2f6a72[_0xd187('0x17')];var _0x9e82c=[];for(var _0x151f3c=0x0;_0x151f3c<_0x57cad7['length'];_0x151f3c++){_0x9e82c['push'](_0x18498b[_0xd187('0x8e')][_0xd187('0x8f')]({'where':{'userProfileId':_0x4f89a6[_0xd187('0x90')]['id'],'name':_0x57cad7[_0x151f3c][_0xd187('0xe')]},'raw':!![]}));}return Promise[_0xd187('0x91')](_0x9e82c)[_0xd187('0xd')](function(_0x2dccff){var _0x1291cc=_[_0xd187('0x5')](_0x2dccff,function(_0x3765b0){return _0x3765b0?_0x3765b0:undefined;});var _0x379e89=_[_0xd187('0x5')](_0x57cad7,['ignore',!![]]);var _0x35df1e=_[_0xd187('0x8d')](_0x1291cc)&&_['isEmpty'](_0x379e89)?null:_[_0xd187('0x92')](_0x379e89,_0x1291cc);if(!_0x35df1e)return null;var _0x1a9979=[];for(var _0x4bec3e=0x0;_0x4bec3e<_0x35df1e['length'];_0x4bec3e++){var _0x32ba2a=_[_0xd187('0x8f')](_0x57cad7,function(_0x2ac56f){return _0x35df1e[_0x4bec3e]?_0x2ac56f[_0xd187('0xe')]===_0x35df1e[_0x4bec3e]['name']:null;});if(_0x32ba2a){if(_0x35df1e[_0x4bec3e][_0xd187('0x93')]){_0x1a9979[_0xd187('0x94')](_0x58622a(_0x2f6a72['childModel'],_0x35df1e[_0x4bec3e]));}else{if(!_0x35df1e[_0x4bec3e]['autoAssociation']){_0x1a9979[_0xd187('0x94')](_0x52a208(_0x32ba2a,_0x35df1e[_0x4bec3e],_0x2f6a72['childModel']));}else{if(_0x32ba2a[_0xd187('0xc')]){_0x1a9979[_0xd187('0x94')](_0x2a61a4(_0x32ba2a,_0x35df1e[_0x4bec3e]));}}}}}return Promise['all'](_0x1a9979);})[_0xd187('0xd')](function(_0x570c1c){var _0x317bc3=_0x570c1c;var _0x4f2875=null;if(_0x317bc3){_0x4f2875=_0x317bc3['length']===0x1?_0x317bc3[0x0]:null;}if(!_0x4f2875&&!_0x317bc3)return _0x2c2a62;var _0x4a1988=_0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x95')];_0x3613ee[_0xd187('0xc')]=_[_0xd187('0x96')](_0x4a1988);_0x3613ee[_0xd187('0x8a')]=_[_0xd187('0x96')](_0x4f89a6[_0xd187('0x8a')]);_0x3613ee[_0xd187('0x97')]=_['intersection'](_0x3613ee[_0xd187('0xc')],_0x3613ee[_0xd187('0x8a')]);_0x509815[_0xd187('0x98')]=_['intersection'](_0x3613ee[_0xd187('0xc')],qs[_0xd187('0x99')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0x99')]));_0x509815['attributes']=_0x509815[_0xd187('0x98')][_0xd187('0x9a')]?_0x509815['attributes']:_0x3613ee[_0xd187('0xc')];if(!_0x4f89a6[_0xd187('0x8a')][_0xd187('0x9b')](_0xd187('0x9c'))){_0x509815['limit']=qs[_0xd187('0x9d')](_0x4f89a6[_0xd187('0x8a')]['limit']);_0x509815[_0xd187('0x9e')]=qs['offset'](_0x4f89a6['query']['offset']);}_0x509815[_0xd187('0x9f')]=qs[_0xd187('0xa0')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0xa0')]);_0x509815[_0xd187('0x83')]=qs[_0xd187('0x97')](_['pick'](_0x4f89a6[_0xd187('0x8a')],_0x3613ee[_0xd187('0x97')]));if(_0x4f89a6['query']['filter']){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$or':_[_0xd187('0xa')](_0x4a1988,function(_0x3fe450){if(_0x3fe450[_0xd187('0x34')]['key']!==_0xd187('0xa2')){var _0x134cc2={};_0x134cc2[_0x3fe450[_0xd187('0x6')]]={'$like':'%'+_0x4f89a6[_0xd187('0x8a')][_0xd187('0x5')]+'%'};return _0x134cc2;}})});}var _0x2879ff=[];var _0x1982cd=null;var _0x1e58d4={};if(_0x4f2875){_0x1982cd=_[_0xd187('0x8f')](_0x57cad7,[_0xd187('0xe'),_0x4f2875[_0xd187('0xe')]]);if(_0x1982cd[_0xd187('0x6')]){_0x1e58d4={};if(_0x2f6a72['childModel']==='AnalyticExtractedReport'){_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_[_0xd187('0xa')](_0x4f2875[_0xd187('0x9')],'id');}else{_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x4f2875[_0xd187('0x9')];}_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{_0x509815['where']['id']=_0x4f2875[_0xd187('0x9')];}}else{for(var _0x5541ef=0x0;_0x5541ef<_0x317bc3[_0xd187('0x9a')];_0x5541ef++){_0x1982cd=_['find'](_0x57cad7,['name',_0x317bc3[_0x5541ef][_0xd187('0xe')]]);if(_0x1982cd['field']){_0x1e58d4={};_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x317bc3[_0x5541ef][_0xd187('0x9')];_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{if(!_0x509815[_0xd187('0x83')]['id'])_0x509815[_0xd187('0x83')]['id']=[];_0x317bc3[_0x5541ef][_0xd187('0x9')][_0xd187('0xa4')](function(_0x37fd5a){_0x509815[_0xd187('0x83')]['id'][_0xd187('0x94')](_0x37fd5a);});}}}if(!_[_0xd187('0x8d')](_0x2879ff)){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$and':{'$or':_0x2879ff}});}_0x509815=_[_0xd187('0xa1')]({},_0x509815,_0x4f89a6['options']);if(_0x4f2875&&!_0x4f2875[_0xd187('0xa5')]&&_0x2f6a72[_0xd187('0x14')]===_0xd187('0x10')){if(_0x4f89a6[_0xd187('0x8a')]['includeAll']){_0x509815[_0xd187('0xa6')]=[{'all':!![]}];}return _0x18498b[_0x2f6a72[_0xd187('0x14')]]['findAll'](_0x509815)['then'](function(_0x20b680){var _0x3c993a=[];_0x20b680[_0xd187('0xa4')](function(_0x435fe8){var _0x371869;switch(_0x435fe8[_0xd187('0xa7')]){case'default':_0x371869=_[_0xd187('0x8f')](_0x4f2875[_0xd187('0x9')],function(_0x5b7870){return _0x5b7870['id']===_0x435fe8[_0xd187('0x74')]&&_0x5b7870[_0xd187('0x34')]===_0xd187('0xa8');});break;case _0xd187('0xa9'):_0x371869=_['find'](_0x4f2875['associatedResources'],function(_0x18d48d){return _0x18d48d['id']===_0x435fe8[_0xd187('0x74')]&&_0x18d48d[_0xd187('0x34')]==='CustomReports';});break;}if(_0x371869)_0x3c993a[_0xd187('0x94')](_0x435fe8);});_0x2c2a62[_0xd187('0xaa')]=_0x3c993a[_0xd187('0x9a')];_0x2c2a62[_0xd187('0xab')]=_0x3c993a;return _0x2c2a62;});}else{return _0x18498b[_0x2f6a72['childModel']][_0xd187('0xaa')]({'where':_0x509815['where']})['then'](function(_0x4a9310){_0x2c2a62['count']=_0x4a9310;if(_0x4f89a6['query']['includeAll']){if(_0x2f6a72['childModel']===_0xd187('0x1b')){_0x509815[_0xd187('0xa6')]=[{'model':_0x18498b['Tag'],'as':_0xd187('0xac'),'attributes':['id',_0xd187('0xe'),_0xd187('0xad')],'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]},{'model':_0x18498b['Tag'],'as':_0xd187('0xaf'),'attributes':['id','name',_0xd187('0xad')],'through':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?{'attributes':[],'where':{'TagId':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]||undefined}}:{},'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]}];}else{_0x509815['include']=[{'all':!![]}];}}return _0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x8')](_0x509815);})['then'](function(_0x2afb14){_0x2c2a62[_0xd187('0xab')]=_0x2afb14;if(_0x2870ad==='Agents'&&_0x4f89a6[_0xd187('0x8a')][_0xd187('0xb0')]===_0xd187('0xb1')){var _0x45b522=[];for(var _0x78604d=0x0;_0x78604d<_0x2c2a62[_0xd187('0xab')][_0xd187('0x9a')];_0x78604d++){_0x45b522[_0xd187('0x94')](_0x1675d9('chat',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb3'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9('fax',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9(_0xd187('0xb4'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb5'),_0x2c2a62[_0xd187('0xab')][_0x78604d]['dataValues']));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb6'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));}return Promise[_0xd187('0x91')](_0x45b522)[_0xd187('0xd')](function(){return _0x2c2a62;});}return _0x2c2a62;});}});}}});}; \ No newline at end of file +var _0x57ca=['templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','section','mergeResources','length','push','UserProfileSection','params','all','ignore','isEmpty','union','find','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','count','color','ThroughTags','tag','openTabs','chat','rows','sms','fax','dataValues','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','findAll','associatedResources','catch','model','then','map','name','resolve','UserProfileResource','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','Lists','lists','CmList','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','user','Agents','zendeskaccounts','ZendeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','Schedule','sounds','tags'];(function(_0x410482,_0x26f1fc){var _0x31816b=function(_0x5a7708){while(--_0x5a7708){_0x410482['push'](_0x410482['shift']());}};_0x31816b(++_0x26f1fc);}(_0x57ca,0x108));var _0xa57c=function(_0x4d1162,_0x456c5c){_0x4d1162=_0x4d1162-0x0;var _0x184f3c=_0x57ca[_0x4d1162];return _0x184f3c;};'use strict';var _=require('lodash');var attributes=require(_0xa57c('0x0'));var qs=require(_0xa57c('0x1'));var squel=require('squel');module[_0xa57c('0x2')]=function(_0x396613){var _0x1d38e7=_0x396613[_0xa57c('0x3')];function _0x1da469(_0x48be2d,_0x40ba22){return new Promise(function(_0x1c3e31,_0x113dcf){if(!_0x40ba22)return _0x1c3e31(null);var _0x19473f=_0x40ba22[_0xa57c('0x4')]?{[_0x40ba22[_0xa57c('0x4')][_0xa57c('0x5')]]:_0x40ba22[_0xa57c('0x4')]['value']}:undefined;return _0x1d38e7[_0x48be2d][_0xa57c('0x6')]({'where':_0x19473f,'raw':!![]})['then'](function(_0x46ba92){_0x40ba22[_0xa57c('0x7')]=_['map'](_0x46ba92,'id');_0x1c3e31(_0x40ba22);})[_0xa57c('0x8')](function(_0x51f287){_0x113dcf(_0x51f287);});});}function _0x554101(_0x44b221,_0x58e6b6){return new Promise(function(_0x2ed4c6,_0x5a8952){var _0x4200c1=_0x44b221[_0xa57c('0x4')]?{[_0x44b221[_0xa57c('0x4')][_0xa57c('0x5')]]:_0x44b221[_0xa57c('0x4')]['value']}:undefined;return _0x1d38e7[_0x44b221[_0xa57c('0x9')]]['findAll']({'where':_0x4200c1,'raw':!![]})[_0xa57c('0xa')](function(_0x3d5995){_0x58e6b6[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x3d5995,function(_0x3238ff){return _0x3238ff[_0xa57c('0xc')];});_0x2ed4c6(_0x58e6b6);})[_0xa57c('0x8')](function(_0x4b4bdb){_0x5a8952(_0x4b4bdb);});});}function _0x26607a(_0xdf7ff6,_0x261725,_0x5a6024){if(!_0x261725)return Promise[_0xa57c('0xd')](null);return new Promise(function(_0x5f33f1,_0x3e7afa){return _0x1d38e7[_0xa57c('0xe')][_0xa57c('0x6')]({'where':{'sectionId':_0x261725['id']},'raw':!![]})[_0xa57c('0xa')](function(_0x1fd0d8){if(_0xdf7ff6[_0xa57c('0x5')]&&_0xdf7ff6[_0xa57c('0x5')]!=='id'){_0x261725[_0xa57c('0x7')]=_['map'](_0x1fd0d8,function(_0x8a8856){return _0x8a8856[_0xdf7ff6['field']];});}else{if(_0x5a6024==='AnalyticExtractedReport'){_0x261725[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x1fd0d8,function(_0x3eee75){return{'id':_0x3eee75[_0xa57c('0xf')],'type':_0x3eee75['type']};});}else{_0x261725[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x1fd0d8,function(_0x34d1bc){return _0x34d1bc[_0xa57c('0xf')];});}}_0x5f33f1(_0x261725);})[_0xa57c('0x8')](function(_0x1404fd){_0x3e7afa(_0x1404fd);});});}function _0x1e0192(_0x42038e,_0x2e99ed){var _0xdf65dd={'parentSections':[]};switch(_0x42038e[_0xa57c('0x10')]()){case _0xa57c('0x11'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x13');break;case _0xa57c('0x14'):_0xdf65dd['childModel']=_0xa57c('0x15');break;case _0xa57c('0x16'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x17');_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x19'),'field':_0xa57c('0xc'),'foreignKey':_0xa57c('0x1a')}];break;case _0xa57c('0x1b'):_0xdf65dd[_0xa57c('0x12')]='JscriptyProject';break;case _0xa57c('0x1c'):_0xdf65dd['childModel']='CmContact';_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0xa57c('0x1e'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x1f');break;case'companies':_0xdf65dd[_0xa57c('0x12')]='CmCompany';break;case _0xa57c('0x20'):_0xdf65dd['childModel']=_0xa57c('0x21');break;case'chatqueues':_0xdf65dd[_0xa57c('0x12')]='ChatQueue';break;case _0xa57c('0x22'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x23');break;case _0xa57c('0x24'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x25');break;case _0xa57c('0x26'):_0xdf65dd['childModel']=_0xa57c('0x27');break;case'inboundroutes':case _0xa57c('0x28'):case _0xa57c('0x29'):_0xdf65dd[_0xa57c('0x12')]='VoiceExtension';break;case _0xa57c('0x2a'):_0xdf65dd['childModel']=_0xa57c('0x2b');break;case'voicemails':_0xdf65dd[_0xa57c('0x12')]='VoiceMail';break;case _0xa57c('0x2c'):_0xdf65dd[_0xa57c('0x12')]='VoiceRecording';_0xdf65dd[_0xa57c('0x18')]=[{'name':'Agents','field':_0xa57c('0xc'),'foreignKey':'membername','model':_0xa57c('0x2d'),'filter':{'field':_0xa57c('0x2e'),'value':[_0xa57c('0x2f')]}},{'name':_0xa57c('0x30'),'field':_0xa57c('0xc'),'foreignKey':_0xa57c('0x31'),'model':'User','filter':{'field':'role','value':[_0xa57c('0x32')]}},{'name':_0xa57c('0x33'),'field':_0xa57c('0xc'),'foreignKey':'queue','model':_0xa57c('0x34'),'filter':{'field':'type','value':[_0xa57c('0x35')]}},{'name':_0xa57c('0x36'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xa57c('0x37'),'value':[_0xa57c('0x38')]}}];break;case _0xa57c('0x39'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x3a');break;case _0xa57c('0x3b'):_0xdf65dd['childModel']=_0xa57c('0x3c');break;case _0xa57c('0x3d'):_0xdf65dd['childModel']='VoicePrefix';break;case _0xa57c('0x3e'):_0xdf65dd[_0xa57c('0x12')]='Campaign';break;case _0xa57c('0x3f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x40');break;case _0xa57c('0x41'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x42');break;case'mailsubstatuses':_0xdf65dd[_0xa57c('0x12')]='MailSubstatus';break;case'openchannelqueues':_0xdf65dd['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x43');break;case _0xa57c('0x44'):_0xdf65dd['childModel']='SmsQueue';break;case'smsaccounts':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x45');break;case _0xa57c('0x46'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x47');break;case _0xa57c('0x48'):_0xdf65dd['childModel']=_0xa57c('0x49');break;case _0xa57c('0x4a'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x4b');break;case _0xa57c('0x4c'):case _0xa57c('0x4d'):_0xdf65dd['childModel']=_0xa57c('0x34');if(_0x2e99ed){_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x33')},{'name':_0xa57c('0x36')}];}break;case _0xa57c('0x4e'):case'agents':case _0xa57c('0x4f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x2d');if(_0x2e99ed){_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x50'),'filter':{'field':_0xa57c('0x2e'),'value':['admin',_0xa57c('0x51')]},'ignore':!![]},{'name':_0xa57c('0x52')},{'name':_0xa57c('0x30')}];}break;case _0xa57c('0x53'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x54');break;case'salesforceaccounts':_0xdf65dd['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0xdf65dd[_0xa57c('0x12')]='FreshdeskAccount';break;case _0xa57c('0x55'):_0xdf65dd[_0xa57c('0x12')]='SugarcrmAccount';break;case _0xa57c('0x56'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x57');break;case _0xa57c('0x58'):_0xdf65dd[_0xa57c('0x12')]='ZohoAccount';break;case _0xa57c('0x59'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x2d');break;case _0xa57c('0x5a'):_0xdf65dd[_0xa57c('0x12')]='CannedAnswer';break;case _0xa57c('0x5b'):_0xdf65dd['childModel']='Disposition';break;case _0xa57c('0x5c'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x5d');break;case'intervals':_0xdf65dd['childModel']=_0xa57c('0x5e');break;case _0xa57c('0x5f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x60');break;case'scheduler':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x61');break;case _0xa57c('0x62'):_0xdf65dd['childModel']='Sound';break;case _0xa57c('0x63'):_0xdf65dd[_0xa57c('0x12')]='Tag';break;case _0xa57c('0x64'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x65');break;case _0xa57c('0x66'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x67');break;case _0xa57c('0x68'):_0xdf65dd['childModel']='Trunk';break;case _0xa57c('0x69'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x6a');break;case _0xa57c('0x6b'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x6c');break;case _0xa57c('0x6d'):_0xdf65dd[_0xa57c('0x12')]='AnalyticExtractedReport';_0xdf65dd['parentSections']=[{'name':_0xa57c('0x6e'),'field':'id','foreignKey':'reportId'}];break;case _0xa57c('0x6f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x70');break;}return _0xdf65dd;}function _0x563da6(_0xea62f0,_0x5b3bf0){var _0x21b00a=_0xea62f0['charAt'](0x0)[_0xa57c('0x71')]()+_0xea62f0[_0xa57c('0x72')](0x1);var _0x398743={'type':_0x1d38e7[_0xa57c('0x73')]['QueryTypes'][_0xa57c('0x74')],'raw':!![]};return new Promise(function(_0x2f8d23,_0x3bd25a){var _0x2b6535=squel[_0xa57c('0x75')]()['field'](_0xa57c('0x76')+_0x21b00a+_0xa57c('0x77'),'id')[_0xa57c('0x5')](_0xa57c('0x78'))[_0xa57c('0x79')](_0xa57c('0x7a')+_0xea62f0+_0xa57c('0x7b'),'ui')[_0xa57c('0x7c')](_0xa57c('0x7d'),_0x5b3bf0['id']);return _0x1d38e7[_0xa57c('0x7e')]['query'](_0x2b6535[_0xa57c('0x7f')](),_0x398743)[_0xa57c('0xa')](function(_0x1bc70b){_0x5b3bf0[_0x21b00a+_0xa57c('0x80')]=_0x1bc70b;_0x2f8d23(_0x1bc70b);})[_0xa57c('0x8')](function(_0x3b286d){_0x3bd25a(_0x3b286d);});});}return _0x396613['define'](_0xa57c('0x81'),attributes,{'tableName':_0xa57c('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x521acc){var _0xb164af={'raw':![],'where':{}};var _0x3f5c19={};var _0x29c66f={'count':0x0,'rows':[]};var _0xa78a75=_0x521acc[_0xa57c('0x83')][_0xa57c('0x84')];var _0x24efa0=_0x521acc['query'][_0xa57c('0x85')]||![];var _0x5a5653=_0x1e0192(_0xa78a75,_0x24efa0);if(!_0x5a5653[_0xa57c('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0xa78a75+'\x27');var _0x1a8686=[{'name':_0xa78a75}];if(!_['isEmpty'](_0x5a5653[_0xa57c('0x18')]))_0x1a8686=_0x5a5653[_0xa57c('0x18')];var _0x5d99e4=[];for(var _0x165f04=0x0;_0x165f04<_0x1a8686[_0xa57c('0x86')];_0x165f04++){_0x5d99e4[_0xa57c('0x87')](_0x1d38e7[_0xa57c('0x88')]['find']({'where':{'userProfileId':_0x521acc[_0xa57c('0x89')]['id'],'name':_0x1a8686[_0x165f04][_0xa57c('0xc')]},'raw':!![]}));}return Promise[_0xa57c('0x8a')](_0x5d99e4)[_0xa57c('0xa')](function(_0x3fdaac){var _0x3d766a=_[_0xa57c('0x4')](_0x3fdaac,function(_0x2a5983){return _0x2a5983?_0x2a5983:undefined;});var _0x11c13e=_[_0xa57c('0x4')](_0x1a8686,[_0xa57c('0x8b'),!![]]);var _0x399968=_[_0xa57c('0x8c')](_0x3d766a)&&_[_0xa57c('0x8c')](_0x11c13e)?null:_[_0xa57c('0x8d')](_0x11c13e,_0x3d766a);if(!_0x399968)return null;var _0x1e286e=[];for(var _0x49545f=0x0;_0x49545f<_0x399968[_0xa57c('0x86')];_0x49545f++){var _0x521503=_[_0xa57c('0x8e')](_0x1a8686,function(_0x24b09a){return _0x399968[_0x49545f]?_0x24b09a[_0xa57c('0xc')]===_0x399968[_0x49545f]['name']:null;});if(_0x521503){if(_0x399968[_0x49545f][_0xa57c('0x8b')]){_0x1e286e[_0xa57c('0x87')](_0x1da469(_0x5a5653[_0xa57c('0x12')],_0x399968[_0x49545f]));}else{if(!_0x399968[_0x49545f]['autoAssociation']){_0x1e286e['push'](_0x26607a(_0x521503,_0x399968[_0x49545f],_0x5a5653[_0xa57c('0x12')]));}else{if(_0x521503[_0xa57c('0x9')]){_0x1e286e[_0xa57c('0x87')](_0x554101(_0x521503,_0x399968[_0x49545f]));}}}}}return Promise[_0xa57c('0x8a')](_0x1e286e);})[_0xa57c('0xa')](function(_0x39411b){var _0x2a7aab=_0x39411b;var _0x33f20e=null;if(_0x2a7aab){_0x33f20e=_0x2a7aab[_0xa57c('0x86')]===0x1?_0x2a7aab[0x0]:null;}if(!_0x33f20e&&!_0x2a7aab)return _0x29c66f;var _0x57b6a3=_0x1d38e7[_0x5a5653[_0xa57c('0x12')]][_0xa57c('0x8f')];_0x3f5c19['model']=_[_0xa57c('0x90')](_0x57b6a3);_0x3f5c19[_0xa57c('0x83')]=_[_0xa57c('0x90')](_0x521acc[_0xa57c('0x83')]);_0x3f5c19[_0xa57c('0x91')]=_[_0xa57c('0x92')](_0x3f5c19[_0xa57c('0x9')],_0x3f5c19[_0xa57c('0x83')]);_0xb164af['attributes']=_[_0xa57c('0x92')](_0x3f5c19[_0xa57c('0x9')],qs['fields'](_0x521acc[_0xa57c('0x83')][_0xa57c('0x93')]));_0xb164af['attributes']=_0xb164af['attributes'][_0xa57c('0x86')]?_0xb164af[_0xa57c('0x94')]:_0x3f5c19[_0xa57c('0x9')];if(!_0x521acc[_0xa57c('0x83')][_0xa57c('0x95')]('nolimit')){_0xb164af[_0xa57c('0x96')]=qs[_0xa57c('0x96')](_0x521acc[_0xa57c('0x83')]['limit']);_0xb164af[_0xa57c('0x97')]=qs['offset'](_0x521acc[_0xa57c('0x83')][_0xa57c('0x97')]);}_0xb164af[_0xa57c('0x98')]=qs[_0xa57c('0x99')](_0x521acc['query'][_0xa57c('0x99')]);_0xb164af[_0xa57c('0x7c')]=qs[_0xa57c('0x91')](_[_0xa57c('0x9a')](_0x521acc['query'],_0x3f5c19[_0xa57c('0x91')]));if(_0x521acc[_0xa57c('0x83')][_0xa57c('0x4')]){_0xb164af['where']=_[_0xa57c('0x9b')](_0xb164af[_0xa57c('0x7c')],{'$or':_[_0xa57c('0xb')](_0x57b6a3,function(_0x5f267d){if(_0x5f267d[_0xa57c('0x37')][_0xa57c('0x9c')]!==_0xa57c('0x9d')){var _0x173f16={};_0x173f16[_0x5f267d['field']]={'$like':'%'+_0x521acc[_0xa57c('0x83')][_0xa57c('0x4')]+'%'};return _0x173f16;}})});}var _0x5c92ec=[];var _0x2dac12=null;var _0x1157ea={};if(_0x33f20e){_0x2dac12=_['find'](_0x1a8686,[_0xa57c('0xc'),_0x33f20e['name']]);if(_0x2dac12[_0xa57c('0x5')]){_0x1157ea={};if(_0x5a5653[_0xa57c('0x12')]===_0xa57c('0x9e')){_0x1157ea[_0x2dac12[_0xa57c('0x9f')]]=_['map'](_0x33f20e[_0xa57c('0x7')],'id');}else{_0x1157ea[_0x2dac12[_0xa57c('0x9f')]]=_0x33f20e[_0xa57c('0x7')];}_0x5c92ec[_0xa57c('0x87')](_0x1157ea);}else{_0xb164af[_0xa57c('0x7c')]['id']=_0x33f20e[_0xa57c('0x7')];}}else{for(var _0x18b36e=0x0;_0x18b36e<_0x2a7aab[_0xa57c('0x86')];_0x18b36e++){_0x2dac12=_[_0xa57c('0x8e')](_0x1a8686,[_0xa57c('0xc'),_0x2a7aab[_0x18b36e][_0xa57c('0xc')]]);if(_0x2dac12['field']){_0x1157ea={};_0x1157ea[_0x2dac12['foreignKey']]=_0x2a7aab[_0x18b36e]['associatedResources'];_0x5c92ec[_0xa57c('0x87')](_0x1157ea);}else{if(!_0xb164af['where']['id'])_0xb164af[_0xa57c('0x7c')]['id']=[];_0x2a7aab[_0x18b36e][_0xa57c('0x7')][_0xa57c('0xa0')](function(_0x4c543a){_0xb164af[_0xa57c('0x7c')]['id'][_0xa57c('0x87')](_0x4c543a);});}}}if(!_[_0xa57c('0x8c')](_0x5c92ec)){_0xb164af[_0xa57c('0x7c')]=_[_0xa57c('0x9b')](_0xb164af[_0xa57c('0x7c')],{'$and':{'$or':_0x5c92ec}});}_0xb164af=_[_0xa57c('0x9b')]({},_0xb164af,_0x521acc['options']);if(_0x33f20e&&!_0x33f20e[_0xa57c('0xa1')]&&_0x5a5653[_0xa57c('0x12')]==='AnalyticExtractedReport'){if(_0x521acc['query'][_0xa57c('0xa2')]){_0xb164af[_0xa57c('0xa3')]=[{'all':!![]}];}return _0x1d38e7[_0x5a5653['childModel']]['findAll'](_0xb164af)[_0xa57c('0xa')](function(_0x4962ae){var _0x3726ee=[];_0x4962ae[_0xa57c('0xa0')](function(_0x4962c9){var _0x1cda66;switch(_0x4962c9[_0xa57c('0xa4')]){case _0xa57c('0xa5'):_0x1cda66=_[_0xa57c('0x8e')](_0x33f20e[_0xa57c('0x7')],function(_0x4dd551){return _0x4dd551['id']===_0x4962c9[_0xa57c('0xa6')]&&_0x4dd551['type']===_0xa57c('0xa7');});break;case _0xa57c('0xa8'):_0x1cda66=_['find'](_0x33f20e['associatedResources'],function(_0x4925da){return _0x4925da['id']===_0x4962c9[_0xa57c('0xa6')]&&_0x4925da['type']==='CustomReports';});break;}if(_0x1cda66)_0x3726ee[_0xa57c('0x87')](_0x4962c9);});_0x29c66f[_0xa57c('0xa9')]=_0x3726ee[_0xa57c('0x86')];_0x29c66f['rows']=_0x3726ee;return _0x29c66f;});}else{return _0x1d38e7[_0x5a5653[_0xa57c('0x12')]][_0xa57c('0xa9')]({'where':_0xb164af[_0xa57c('0x7c')]})['then'](function(_0x4b8228){_0x29c66f[_0xa57c('0xa9')]=_0x4b8228;if(_0x521acc['query'][_0xa57c('0xa2')]){if(_0x5a5653[_0xa57c('0x12')]==='CmContact'){_0xb164af[_0xa57c('0xa3')]=[{'model':_0x1d38e7['Tag'],'as':'Tags','attributes':['id','name',_0xa57c('0xaa')],'required':_0x521acc['query']['tag']?!![]:![]},{'model':_0x1d38e7['Tag'],'as':_0xa57c('0xab'),'attributes':['id',_0xa57c('0xc'),'color'],'through':_0x521acc[_0xa57c('0x83')][_0xa57c('0xac')]?{'attributes':[],'where':{'TagId':_0x521acc[_0xa57c('0x83')]['tag']||undefined}}:{},'required':_0x521acc[_0xa57c('0x83')][_0xa57c('0xac')]?!![]:![]}];}else{_0xb164af[_0xa57c('0xa3')]=[{'all':!![]}];}}return _0x1d38e7[_0x5a5653[_0xa57c('0x12')]]['findAll'](_0xb164af);})['then'](function(_0x8391f9){_0x29c66f['rows']=_0x8391f9;if(_0xa78a75===_0xa57c('0x52')&&_0x521acc[_0xa57c('0x83')][_0xa57c('0xad')]==='true'){var _0x138c4e=[];for(var _0x513f24=0x0;_0x513f24<_0x29c66f['rows'][_0xa57c('0x86')];_0x513f24++){_0x138c4e['push'](_0x563da6(_0xa57c('0xae'),_0x29c66f[_0xa57c('0xaf')][_0x513f24]['dataValues']));_0x138c4e['push'](_0x563da6(_0xa57c('0xb0'),_0x29c66f[_0xa57c('0xaf')][_0x513f24]['dataValues']));_0x138c4e['push'](_0x563da6(_0xa57c('0xb1'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e['push'](_0x563da6(_0xa57c('0xb3'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e[_0xa57c('0x87')](_0x563da6(_0xa57c('0xb4'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e[_0xa57c('0x87')](_0x563da6(_0xa57c('0xb5'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));}return Promise[_0xa57c('0x8a')](_0x138c4e)[_0xa57c('0xa')](function(){return _0x29c66f;});}return _0x29c66f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index dd6add6..b3c40e9 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 _0xd08d=['error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xe808f0,_0x310601){var _0x126403=function(_0x15eb7e){while(--_0x15eb7e){_0xe808f0['push'](_0xe808f0['shift']());}};_0x126403(++_0x310601);}(_0xd08d,0x81));var _0xdd08=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0xd08d[_0x1562a2];return _0x39a636;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});config[_0xdd08('0xa')]=_[_0xdd08('0xb')](config[_0xdd08('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd08('0xc'))(new Redis(config[_0xdd08('0xa')]));require(_0xdd08('0xd'))['register'](socket);function respondWithRpcPromise(_0x2d4433,_0x2e9c8d,_0x2ca1cc){return new BPromise(function(_0x19b253,_0xe0a892){return client[_0xdd08('0xe')](_0x2d4433,_0x2ca1cc)[_0xdd08('0xf')](function(_0x43a927){logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));logger[_0xdd08('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2e9c8d,_0xdd08('0x12'),JSON[_0xdd08('0x14')](_0x43a927));if(_0x43a927[_0xdd08('0x15')]){if(_0x43a927[_0xdd08('0x15')][_0xdd08('0x16')]===0x1f4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0xe0a892(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0x19b253(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}else{logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));_0x19b253(_0x43a927[_0xdd08('0x18')]['message']);}})['catch'](function(_0x435dc4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x435dc4);_0xe0a892(_0x435dc4);});});} \ No newline at end of file +var _0xd7d5=['localhost','socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x435f2d,_0x1843f9){var _0x5992a7=function(_0x42d25e){while(--_0x42d25e){_0x435f2d['push'](_0x435f2d['shift']());}};_0x5992a7(++_0x1843f9);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x392508,_0x40c9c9){_0x392508=_0x392508-0x0;var _0xedc37e=_0xd7d5[_0x392508];return _0xedc37e;};'use strict';var _=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var moment=require(_0x5d7d('0x2'));var BPromise=require(_0x5d7d('0x3'));var rs=require(_0x5d7d('0x4'));var fs=require('fs');var Redis=require(_0x5d7d('0x5'));var db=require(_0x5d7d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d7d('0x7'))('rpc');var config=require(_0x5d7d('0x8'));var jayson=require(_0x5d7d('0x9'));var client=jayson[_0x5d7d('0xa')][_0x5d7d('0xb')]({'port':0x232a});config[_0x5d7d('0xc')]=_[_0x5d7d('0xd')](config[_0x5d7d('0xc')],{'host':_0x5d7d('0xe'),'port':0x18eb});var socket=require(_0x5d7d('0xf'))(new Redis(config[_0x5d7d('0xc')]));require('./userProfile.socket')[_0x5d7d('0x10')](socket);function respondWithRpcPromise(_0x2d1bc4,_0x32bf2c,_0x307eb8){return new BPromise(function(_0x4b890d,_0x17512e){return client[_0x5d7d('0x11')](_0x2d1bc4,_0x307eb8)[_0x5d7d('0x12')](function(_0x139664){logger['info'](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));logger[_0x5d7d('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x32bf2c,_0x5d7d('0x14'),JSON['stringify'](_0x139664));if(_0x139664['error']){if(_0x139664['error'][_0x5d7d('0x16')]===0x1f4){logger[_0x5d7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x32bf2c,_0x139664['error'][_0x5d7d('0x18')]);return _0x17512e(_0x139664[_0x5d7d('0x17')][_0x5d7d('0x18')]);}logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x139664['error']['message']);return _0x4b890d(_0x139664['error'][_0x5d7d('0x18')]);}else{logger[_0x5d7d('0x19')](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));_0x4b890d(_0x139664[_0x5d7d('0x1a')][_0x5d7d('0x18')]);}})[_0x5d7d('0x1b')](function(_0x36edec){logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x36edec);_0x17512e(_0x36edec);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index bda4009..d74eca6 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 _0x342c=['removeListener','register','length','./userProfile.events','save','remove','update','emit'];(function(_0x3bc320,_0x197ac5){var _0x2dd12a=function(_0x7ff85d){while(--_0x7ff85d){_0x3bc320['push'](_0x3bc320['shift']());}};_0x2dd12a(++_0x197ac5);}(_0x342c,0x18b));var _0xc342=function(_0x4cee42,_0x5a7a77){_0x4cee42=_0x4cee42-0x0;var _0x12fd23=_0x342c[_0x4cee42];return _0x12fd23;};'use strict';var UserProfileEvents=require(_0xc342('0x0'));var events=[_0xc342('0x1'),_0xc342('0x2'),_0xc342('0x3')];function createListener(_0x2d5fa6,_0x3b2512){return function(_0x4f5299){_0x3b2512[_0xc342('0x4')](_0x2d5fa6,_0x4f5299);};}function removeListener(_0x428291,_0x24c2ac){return function(){UserProfileEvents[_0xc342('0x5')](_0x428291,_0x24c2ac);};}exports[_0xc342('0x6')]=function(_0x1a5d36){for(var _0x4d3ecb=0x0,_0x221628=events[_0xc342('0x7')];_0x4d3ecb<_0x221628;_0x4d3ecb++){var _0xe275b=events[_0x4d3ecb];var _0x413430=createListener('userProfile:'+_0xe275b,_0x1a5d36);UserProfileEvents['on'](_0xe275b,_0x413430);}}; \ No newline at end of file +var _0x3951=['./userProfile.events','save','remove','emit','register'];(function(_0x5a885f,_0x40d956){var _0x5b06ee=function(_0x134a45){while(--_0x134a45){_0x5a885f['push'](_0x5a885f['shift']());}};_0x5b06ee(++_0x40d956);}(_0x3951,0x177));var _0x1395=function(_0xeb0ac0,_0x59d6a1){_0xeb0ac0=_0xeb0ac0-0x0;var _0x59e1ea=_0x3951[_0xeb0ac0];return _0x59e1ea;};'use strict';var UserProfileEvents=require(_0x1395('0x0'));var events=[_0x1395('0x1'),_0x1395('0x2'),'update'];function createListener(_0x3ca37a,_0x2025b3){return function(_0x28781a){_0x2025b3[_0x1395('0x3')](_0x3ca37a,_0x28781a);};}function removeListener(_0x26ed90,_0x1bcb45){return function(){UserProfileEvents['removeListener'](_0x26ed90,_0x1bcb45);};}exports[_0x1395('0x4')]=function(_0x1f6e8d){for(var _0x2bba15=0x0,_0x56abc3=events['length'];_0x2bba15<_0x56abc3;_0x2bba15++){var _0x242c84=events[_0x2bba15];var _0x38087c=createListener('userProfile:'+_0x242c84,_0x1f6e8d);UserProfileEvents['on'](_0x242c84,_0x38087c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 258c039..053854f 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 _0xb82b=['put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','create'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0xb82b,0x8c));var _0xbb82=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb82b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xbb82('0x0'));var path=require('path');var timeout=require(_0xbb82('0x1'));var express=require(_0xbb82('0x2'));var router=express[_0xbb82('0x3')]();var fs_extra=require(_0xbb82('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb82('0x5'));var config=require('../../config/environment');var controller=require(_0xbb82('0x6'));router[_0xbb82('0x7')]('/',auth[_0xbb82('0x8')](),controller['index']);router[_0xbb82('0x7')](_0xbb82('0x9'),auth[_0xbb82('0x8')](),controller[_0xbb82('0xa')]);router['get'](_0xbb82('0xb'),auth[_0xbb82('0x8')](),controller['show']);router['post']('/',auth[_0xbb82('0x8')](),controller[_0xbb82('0xc')]);router[_0xbb82('0xd')](_0xbb82('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbb82('0xe')](_0xbb82('0xb'),auth[_0xbb82('0x8')](),controller[_0xbb82('0xf')]);module[_0xbb82('0x10')]=router; \ No newline at end of file +var _0xb6e5=['/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','show','post','create','put'];(function(_0xb55578,_0x2304c8){var _0xe81b7b=function(_0x393203){while(--_0x393203){_0xb55578['push'](_0xb55578['shift']());}};_0xe81b7b(++_0x2304c8);}(_0xb6e5,0x81));var _0x5b6e=function(_0x325abc,_0x3b3a95){_0x325abc=_0x325abc-0x0;var _0x451802=_0xb6e5[_0x325abc];return _0x451802;};'use strict';var multer=require(_0x5b6e('0x0'));var util=require(_0x5b6e('0x1'));var path=require(_0x5b6e('0x2'));var timeout=require(_0x5b6e('0x3'));var express=require(_0x5b6e('0x4'));var router=express[_0x5b6e('0x5')]();var fs_extra=require(_0x5b6e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b6e('0x7'));var config=require(_0x5b6e('0x8'));var controller=require(_0x5b6e('0x9'));router['get']('/',auth[_0x5b6e('0xa')](),controller['index']);router[_0x5b6e('0xb')](_0x5b6e('0xc'),auth[_0x5b6e('0xa')](),controller[_0x5b6e('0xd')]);router[_0x5b6e('0xb')]('/:id',auth[_0x5b6e('0xa')](),controller[_0x5b6e('0xe')]);router[_0x5b6e('0xf')]('/',auth[_0x5b6e('0xa')](),controller[_0x5b6e('0x10')]);router[_0x5b6e('0x11')](_0x5b6e('0x12'),auth[_0x5b6e('0xa')](),controller[_0x5b6e('0x13')]);router['delete'](_0x5b6e('0x12'),auth['isAuthenticated'](),controller[_0x5b6e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 16098b5..b1d50fd 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 _0xf4f6=['exports','STRING','INTEGER','sequelize'];(function(_0x56cb93,_0x1740a9){var _0x3d0dd3=function(_0x44b8f7){while(--_0x44b8f7){_0x56cb93['push'](_0x56cb93['shift']());}};_0x3d0dd3(++_0x1740a9);}(_0xf4f6,0x1d3));var _0x6f4f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf4f6[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6f4f('0x0'));module[_0x6f4f('0x1')]={'name':{'type':Sequelize[_0x6f4f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6f4f('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xe3cf=['sequelize','STRING','INTEGER'];(function(_0x108338,_0x24314f){var _0x4c585c=function(_0x2c6aab){while(--_0x2c6aab){_0x108338['push'](_0x108338['shift']());}};_0x4c585c(++_0x24314f);}(_0xe3cf,0x1cb));var _0xfe3c=function(_0xde5af2,_0x49d189){_0xde5af2=_0xde5af2-0x0;var _0x5ad92a=_0xe3cf[_0xde5af2];return _0x5ad92a;};'use strict';var Sequelize=require(_0xfe3c('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe3c('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfe3c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 5ea119e..6911322 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 _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x57ca,0x108));var _0xa57c=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x57ca[_0x4849f6];return _0x1a3dcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x3bbd82,_0x1997d9){var _0x47cb2e=function(_0x45945b){while(--_0x45945b){_0x3bbd82['push'](_0x3bbd82['shift']());}};_0x47cb2e(++_0x1997d9);}(_0x47c5,0x165));var _0x547c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x47c5[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4d5df01..377c0bd 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 _0x6f51=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','sectionId','../../config/logger','moment','bluebird'];(function(_0x229949,_0x458f0c){var _0x3655b8=function(_0x7782d3){while(--_0x7782d3){_0x229949['push'](_0x229949['shift']());}};_0x3655b8(++_0x458f0c);}(_0x6f51,0xda));var _0x16f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f51[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x16f5('0x0'))('api');var moment=require(_0x16f5('0x1'));var BPromise=require(_0x16f5('0x2'));var rp=require(_0x16f5('0x3'));var fs=require('fs');var path=require(_0x16f5('0x4'));var rimraf=require(_0x16f5('0x5'));var config=require(_0x16f5('0x6'));var attributes=require(_0x16f5('0x7'));module[_0x16f5('0x8')]=function(_0x3c0c24,_0x6b3d17){return _0x3c0c24['define'](_0x16f5('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x16f5('0xa'),'fields':[_0x16f5('0xb'),_0x16f5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4d4=['resourceId','sectionId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources'];(function(_0x3a2c4a,_0x57fac8){var _0x39a1bb=function(_0x267842){while(--_0x267842){_0x3a2c4a['push'](_0x3a2c4a['shift']());}};_0x39a1bb(++_0x57fac8);}(_0xe4d4,0x161));var _0x4e4d=function(_0x22c33a,_0x4d4575){_0x22c33a=_0x22c33a-0x0;var _0x3d0d08=_0xe4d4[_0x22c33a];return _0x3d0d08;};'use strict';var _=require(_0x4e4d('0x0'));var util=require('util');var logger=require(_0x4e4d('0x1'))(_0x4e4d('0x2'));var moment=require(_0x4e4d('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e4d('0x5'));var config=require(_0x4e4d('0x6'));var attributes=require(_0x4e4d('0x7'));module[_0x4e4d('0x8')]=function(_0x310176,_0x579f42){return _0x310176['define'](_0x4e4d('0x9'),attributes,{'tableName':_0x4e4d('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4e4d('0xb'),_0x4e4d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 2991829..0de40a7 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 _0x561a=['rpc','../../config/environment','jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x561a,0x102));var _0xa561=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0x561a[_0x8b3778];return _0x53bdc8;};'use strict';var _=require('lodash');var util=require(_0xa561('0x0'));var moment=require(_0xa561('0x1'));var BPromise=require('bluebird');var rs=require(_0xa561('0x2'));var fs=require('fs');var Redis=require(_0xa561('0x3'));var db=require(_0xa561('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa561('0x5'))(_0xa561('0x6'));var config=require(_0xa561('0x7'));var jayson=require(_0xa561('0x8'));var client=jayson[_0xa561('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8abc,_0x36f8da,_0x23f490){return new BPromise(function(_0x34e78b,_0x2ec0a6){return client[_0xa561('0xa')](_0x2d8abc,_0x23f490)[_0xa561('0xb')](function(_0x1353cd){logger['info'](_0xa561('0xc'),_0x36f8da,_0xa561('0xd'));logger[_0xa561('0xe')](_0xa561('0xf'),_0x36f8da,_0xa561('0xd'),JSON[_0xa561('0x10')](_0x1353cd));if(_0x1353cd[_0xa561('0x11')]){if(_0x1353cd['error'][_0xa561('0x12')]===0x1f4){logger[_0xa561('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x36f8da,_0x1353cd[_0xa561('0x11')][_0xa561('0x13')]);return _0x2ec0a6(_0x1353cd[_0xa561('0x11')][_0xa561('0x13')]);}logger[_0xa561('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x36f8da,_0x1353cd[_0xa561('0x11')]['message']);return _0x34e78b(_0x1353cd['error'][_0xa561('0x13')]);}else{logger['info'](_0xa561('0xc'),_0x36f8da,_0xa561('0xd'));_0x34e78b(_0x1353cd[_0xa561('0x14')][_0xa561('0x13')]);}})[_0xa561('0x15')](function(_0x315a2a){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x36f8da,_0x315a2a);_0x2ec0a6(_0x315a2a);});});} \ No newline at end of file +var _0x0b0e=['UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x0b0e[_0x4b5813];return _0x423465;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index cd52ead..30b08e2 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 _0x3a11=['path','connect-timeout','express','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','multer'];(function(_0xa3a075,_0xe09a8e){var _0x5ef8e0=function(_0x57d746){while(--_0x57d746){_0xa3a075['push'](_0xa3a075['shift']());}};_0x5ef8e0(++_0xe09a8e);}(_0x3a11,0xff));var _0x13a1=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0x3a11[_0x52b24f];return _0x46ea6b;};'use strict';var multer=require(_0x13a1('0x0'));var util=require('util');var path=require(_0x13a1('0x1'));var timeout=require(_0x13a1('0x2'));var express=require(_0x13a1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x13a1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13a1('0x5'));router[_0x13a1('0x6')]('/',auth[_0x13a1('0x7')](),controller[_0x13a1('0x8')]);router[_0x13a1('0x6')](_0x13a1('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x13a1('0xa'),auth['isAuthenticated'](),controller[_0x13a1('0xb')]);router[_0x13a1('0xc')]('/',auth[_0x13a1('0x7')](),controller[_0x13a1('0xd')]);router[_0x13a1('0xe')](_0x13a1('0xa'),auth[_0x13a1('0x7')](),controller[_0x13a1('0xf')]);router['delete'](_0x13a1('0xa'),auth[_0x13a1('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa67c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xa67c,0xec));var _0xca67=function(_0x5962ce,_0x518c67){_0x5962ce=_0x5962ce-0x0;var _0x25d782=_0xa67c[_0x5962ce];return _0x25d782;};'use strict';var multer=require(_0xca67('0x0'));var util=require(_0xca67('0x1'));var path=require(_0xca67('0x2'));var timeout=require(_0xca67('0x3'));var express=require(_0xca67('0x4'));var router=express[_0xca67('0x5')]();var fs_extra=require(_0xca67('0x6'));var auth=require(_0xca67('0x7'));var interaction=require(_0xca67('0x8'));var config=require(_0xca67('0x9'));var controller=require(_0xca67('0xa'));router[_0xca67('0xb')]('/',auth[_0xca67('0xc')](),controller[_0xca67('0xd')]);router[_0xca67('0xb')]('/describe',auth[_0xca67('0xc')](),controller[_0xca67('0xe')]);router[_0xca67('0xb')](_0xca67('0xf'),auth[_0xca67('0xc')](),controller[_0xca67('0x10')]);router[_0xca67('0x11')]('/',auth[_0xca67('0xc')](),controller['create']);router[_0xca67('0x12')](_0xca67('0xf'),auth[_0xca67('0xc')](),controller[_0xca67('0x13')]);router[_0xca67('0x14')](_0xca67('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xca67('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index fc5a266..9dea99a 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 _0xeffd=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xeffd,0x6b));var _0xdeff=function(_0x34d5a4,_0x4cbc38){_0x34d5a4=_0x34d5a4-0x0;var _0x31d4a9=_0xeffd[_0x34d5a4];return _0x31d4a9;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'name':{'type':Sequelize[_0xdeff('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xdeff('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdeff('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xdeff('0x1')],'set':function(_0x298274){this[_0xdeff('0x4')](_0xdeff('0x5'),_0x298274?_0x298274[_0xdeff('0x6')](''):[]);},'get':function(){return this[_0xdeff('0x7')](_0xdeff('0x5'))?this[_0xdeff('0x7')](_0xdeff('0x5'))[_0xdeff('0x8')](''):[];}}}; \ No newline at end of file +var _0x2032=['split','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3fdefe,_0x13f1cf){var _0x51fa33=function(_0x393e80){while(--_0x393e80){_0x3fdefe['push'](_0x3fdefe['shift']());}};_0x51fa33(++_0x13f1cf);}(_0x2032,0xd9));var _0x2203=function(_0x5d070c,_0x1b8b4c){_0x5d070c=_0x5d070c-0x0;var _0x20f0f5=_0x2032[_0x5d070c];return _0x20f0f5;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x46c49a){this[_0x2203('0x3')](_0x2203('0x4'),_0x46c49a?_0x46c49a[_0x2203('0x5')](''):[]);},'get':function(){return this[_0x2203('0x6')](_0x2203('0x4'))?this[_0x2203('0x6')](_0x2203('0x4'))[_0x2203('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index be9cfd4..351af30 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 _0xfea7=['order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','json','apply','reject','save','update','destroy','then','stack','name','send','map','UserProfileSection','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty'];(function(_0x36af57,_0x3b906a){var _0x1c1be3=function(_0x5e37eb){while(--_0x5e37eb){_0x36af57['push'](_0x36af57['shift']());}};_0x1c1be3(++_0x3b906a);}(_0xfea7,0xa8));var _0x7fea=function(_0x57c47a,_0x32b318){_0x57c47a=_0x57c47a-0x0;var _0x32d993=_0xfea7[_0x57c47a];return _0x32d993;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fea('0x0'));var zipdir=require(_0x7fea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fea('0x2'));var Mustache=require(_0x7fea('0x3'));var util=require(_0x7fea('0x4'));var path=require(_0x7fea('0x5'));var sox=require('sox');var csv=require(_0x7fea('0x6'));var ejs=require(_0x7fea('0x7'));var fs=require('fs');var fs_extra=require(_0x7fea('0x8'));var _=require('lodash');var squel=require(_0x7fea('0x9'));var crypto=require(_0x7fea('0xa'));var jsforce=require(_0x7fea('0xb'));var deskjs=require(_0x7fea('0xc'));var toCsv=require(_0x7fea('0x6'));var querystring=require(_0x7fea('0xd'));var Papa=require(_0x7fea('0xe'));var Redis=require(_0x7fea('0xf'));var authService=require(_0x7fea('0x10'));var qs=require(_0x7fea('0x11'));var as=require(_0x7fea('0x12'));var hardwareService=require(_0x7fea('0x13'));var logger=require('../../config/logger')(_0x7fea('0x14'));var utils=require(_0x7fea('0x15'));var config=require(_0x7fea('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fea('0x17'))['db'];function respondWithStatusCode(_0x18b389,_0x506023){_0x506023=_0x506023||0xcc;return function(_0x5cd557){if(_0x5cd557){return _0x18b389[_0x7fea('0x18')](_0x506023);}return _0x18b389['status'](_0x506023)[_0x7fea('0x19')]();};}function respondWithResult(_0x2bee6b,_0x1dcb5b){_0x1dcb5b=_0x1dcb5b||0xc8;return function(_0x3956b4){if(_0x3956b4){return _0x2bee6b[_0x7fea('0x1a')](_0x1dcb5b)['json'](_0x3956b4);}};}function respondWithFilteredResult(_0x542d6e,_0xc24acd){return function(_0x1d5cb2){if(_0x1d5cb2){var _0x355cfe=typeof _0xc24acd[_0x7fea('0x1b')]===_0x7fea('0x1c')&&typeof _0xc24acd['limit']===_0x7fea('0x1c');var _0x4267e6=_0x1d5cb2['count'];var _0x35b3b1=_0x355cfe?0x0:_0xc24acd[_0x7fea('0x1b')];var _0x1a3979=_0x355cfe?_0x1d5cb2['count']:_0xc24acd['offset']+_0xc24acd[_0x7fea('0x1d')];var _0x2fa25f;if(_0x1a3979>=_0x4267e6){_0x1a3979=_0x4267e6;_0x2fa25f=0xc8;}else{_0x2fa25f=0xce;}_0x542d6e[_0x7fea('0x1a')](_0x2fa25f);return _0x542d6e[_0x7fea('0x1e')]('Content-Range',_0x35b3b1+'-'+_0x1a3979+'/'+_0x4267e6)[_0x7fea('0x1f')](_0x1d5cb2);}return null;};}function patchUpdates(_0x35d6f0){return function(_0x2555db){try{jsonpatch[_0x7fea('0x20')](_0x2555db,_0x35d6f0,!![]);}catch(_0x4269d0){return BPromise[_0x7fea('0x21')](_0x4269d0);}return _0x2555db[_0x7fea('0x22')]();};}function saveUpdates(_0x1fe8d9,_0x6f2e12){return function(_0x71e4db){if(_0x71e4db){return _0x71e4db[_0x7fea('0x23')](_0x1fe8d9)['then'](function(_0x10a751){return _0x10a751;});}return null;};}function removeEntity(_0x57e2fe,_0x4d3a57){return function(_0xb01be7){if(_0xb01be7){return _0xb01be7[_0x7fea('0x24')]()[_0x7fea('0x25')](function(){_0x57e2fe[_0x7fea('0x1a')](0xcc)[_0x7fea('0x19')]();});}};}function handleEntityNotFound(_0x3949d7,_0x102902){return function(_0x134de9){if(!_0x134de9){_0x3949d7[_0x7fea('0x18')](0x194);}return _0x134de9;};}function handleError(_0x122617,_0x509eff){_0x509eff=_0x509eff||0x1f4;return function(_0x22564d){logger['error'](_0x22564d[_0x7fea('0x26')]);if(_0x22564d[_0x7fea('0x27')]){delete _0x22564d[_0x7fea('0x27')];}_0x122617[_0x7fea('0x1a')](_0x509eff)[_0x7fea('0x28')](_0x22564d);};}exports['index']=function(_0x32b637,_0x159066){var _0xa2aed3={},_0x50b017={},_0xc7c2eb={'count':0x0,'rows':[]};var _0x1c56e1=_[_0x7fea('0x29')](db[_0x7fea('0x2a')][_0x7fea('0x2b')],function(_0x46ed8){return{'name':_0x46ed8['fieldName'],'type':_0x46ed8[_0x7fea('0x2c')][_0x7fea('0x2d')]};});_0x50b017['model']=_[_0x7fea('0x29')](_0x1c56e1,_0x7fea('0x27'));_0x50b017['query']=_[_0x7fea('0x2e')](_0x32b637[_0x7fea('0x2f')]);_0x50b017[_0x7fea('0x30')]=_[_0x7fea('0x31')](_0x50b017[_0x7fea('0x32')],_0x50b017[_0x7fea('0x2f')]);_0xa2aed3[_0x7fea('0x33')]=_[_0x7fea('0x31')](_0x50b017[_0x7fea('0x32')],qs['fields'](_0x32b637['query']['fields']));_0xa2aed3[_0x7fea('0x33')]=_0xa2aed3[_0x7fea('0x33')][_0x7fea('0x34')]?_0xa2aed3[_0x7fea('0x33')]:_0x50b017[_0x7fea('0x32')];if(!_0x32b637[_0x7fea('0x2f')][_0x7fea('0x35')]('nolimit')){_0xa2aed3[_0x7fea('0x1d')]=qs['limit'](_0x32b637[_0x7fea('0x2f')][_0x7fea('0x1d')]);_0xa2aed3['offset']=qs[_0x7fea('0x1b')](_0x32b637[_0x7fea('0x2f')][_0x7fea('0x1b')]);}_0xa2aed3[_0x7fea('0x36')]=qs['sort'](_0x32b637[_0x7fea('0x2f')][_0x7fea('0x37')]);_0xa2aed3['where']=qs[_0x7fea('0x30')](_['pick'](_0x32b637[_0x7fea('0x2f')],_0x50b017[_0x7fea('0x30')]),_0x1c56e1);if(_0x32b637[_0x7fea('0x2f')][_0x7fea('0x38')]){_0xa2aed3[_0x7fea('0x39')]=_[_0x7fea('0x3a')](_0xa2aed3[_0x7fea('0x39')],{'$or':_[_0x7fea('0x29')](_0x1c56e1,function(_0x3c4e07){if(_0x3c4e07[_0x7fea('0x2c')]!==_0x7fea('0x3b')){var _0x34c2da={};_0x34c2da[_0x3c4e07[_0x7fea('0x27')]]={'$like':'%'+_0x32b637[_0x7fea('0x2f')]['filter']+'%'};return _0x34c2da;}})});}_0xa2aed3=_['merge']({},_0xa2aed3,_0x32b637[_0x7fea('0x3c')]);var _0x426583={'where':_0xa2aed3[_0x7fea('0x39')]};return db['UserProfileSection']['count'](_0x426583)[_0x7fea('0x25')](function(_0x24cd91){_0xc7c2eb[_0x7fea('0x3d')]=_0x24cd91;if(_0x32b637[_0x7fea('0x2f')][_0x7fea('0x3e')]){_0xa2aed3[_0x7fea('0x3f')]=[{'all':!![]}];}return db[_0x7fea('0x2a')][_0x7fea('0x40')](_0xa2aed3);})[_0x7fea('0x25')](function(_0xfe904d){_0xc7c2eb[_0x7fea('0x41')]=_0xfe904d;return _0xc7c2eb;})[_0x7fea('0x25')](respondWithFilteredResult(_0x159066,_0xa2aed3))[_0x7fea('0x42')](handleError(_0x159066,null));};exports[_0x7fea('0x43')]=function(_0x4a1827,_0x3c9d91){var _0x37dae4={'raw':![],'where':{'id':_0x4a1827[_0x7fea('0x44')]['id']}},_0x106306={};_0x106306['model']=_[_0x7fea('0x2e')](db['UserProfileSection'][_0x7fea('0x2b')]);_0x106306[_0x7fea('0x2f')]=_['keys'](_0x4a1827[_0x7fea('0x2f')]);_0x106306['filters']=_[_0x7fea('0x31')](_0x106306[_0x7fea('0x32')],_0x106306['query']);_0x37dae4[_0x7fea('0x33')]=_['intersection'](_0x106306['model'],qs[_0x7fea('0x45')](_0x4a1827['query'][_0x7fea('0x45')]));_0x37dae4[_0x7fea('0x33')]=_0x37dae4['attributes'][_0x7fea('0x34')]?_0x37dae4[_0x7fea('0x33')]:_0x106306[_0x7fea('0x32')];if(_0x4a1827[_0x7fea('0x2f')][_0x7fea('0x3e')]){_0x37dae4['include']=[{'all':!![]}];}_0x37dae4=_['merge']({},_0x37dae4,_0x4a1827[_0x7fea('0x3c')]);return db[_0x7fea('0x2a')]['find'](_0x37dae4)[_0x7fea('0x25')](handleEntityNotFound(_0x3c9d91,null))[_0x7fea('0x25')](respondWithResult(_0x3c9d91,null))[_0x7fea('0x42')](handleError(_0x3c9d91,null));};exports['create']=function(_0x5c9c0e,_0xf82cb){return db[_0x7fea('0x2a')][_0x7fea('0x46')](_0x5c9c0e['body'],{})[_0x7fea('0x25')](respondWithResult(_0xf82cb,0xc9))[_0x7fea('0x42')](handleError(_0xf82cb,null));};exports[_0x7fea('0x23')]=function(_0x57e49c,_0x1cd0c8){if(_0x57e49c[_0x7fea('0x47')]['id']){delete _0x57e49c[_0x7fea('0x47')]['id'];}return db[_0x7fea('0x2a')][_0x7fea('0x48')]({'where':{'id':_0x57e49c[_0x7fea('0x44')]['id']}})[_0x7fea('0x25')](handleEntityNotFound(_0x1cd0c8,null))[_0x7fea('0x25')](saveUpdates(_0x57e49c[_0x7fea('0x47')],null))[_0x7fea('0x25')](respondWithResult(_0x1cd0c8,null))[_0x7fea('0x42')](handleError(_0x1cd0c8,null));};exports[_0x7fea('0x24')]=function(_0xe47107,_0x1791c3){return db[_0x7fea('0x2a')][_0x7fea('0x48')]({'where':{'id':_0xe47107['params']['id']}})[_0x7fea('0x25')](handleEntityNotFound(_0x1791c3,null))['then'](removeEntity(_0x1791c3,null))[_0x7fea('0x42')](handleError(_0x1791c3,null));};exports[_0x7fea('0x49')]=function(_0x35d1b1,_0x560e8b){return db[_0x7fea('0x2a')][_0x7fea('0x49')]()['then'](respondWithResult(_0x560e8b,null))['catch'](handleError(_0x560e8b,null));}; \ No newline at end of file +var _0x4ea6=['name','map','UserProfileSection','fieldName','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','filters','pick','where','merge','rows','show','params','rawAttributes','length','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x5797da,_0x44b0bd){var _0x21bb4c=function(_0x4c98a8){while(--_0x4c98a8){_0x5797da['push'](_0x5797da['shift']());}};_0x21bb4c(++_0x44b0bd);}(_0x4ea6,0xad));var _0x64ea=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x4ea6[_0x5b740b];return _0x6f8f4e;};'use strict';var emlformat=require(_0x64ea('0x0'));var rimraf=require(_0x64ea('0x1'));var zipdir=require(_0x64ea('0x2'));var jsonpatch=require(_0x64ea('0x3'));var rp=require('request-promise');var moment=require(_0x64ea('0x4'));var BPromise=require(_0x64ea('0x5'));var Mustache=require(_0x64ea('0x6'));var util=require(_0x64ea('0x7'));var path=require(_0x64ea('0x8'));var sox=require('sox');var csv=require(_0x64ea('0x9'));var ejs=require(_0x64ea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x64ea('0xb'));var crypto=require(_0x64ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x64ea('0xd'));var toCsv=require(_0x64ea('0x9'));var querystring=require(_0x64ea('0xe'));var Papa=require(_0x64ea('0xf'));var Redis=require(_0x64ea('0x10'));var authService=require(_0x64ea('0x11'));var qs=require(_0x64ea('0x12'));var as=require(_0x64ea('0x13'));var hardwareService=require(_0x64ea('0x14'));var logger=require(_0x64ea('0x15'))(_0x64ea('0x16'));var utils=require(_0x64ea('0x17'));var config=require(_0x64ea('0x18'));var licenseUtil=require(_0x64ea('0x19'));var db=require(_0x64ea('0x1a'))['db'];function respondWithStatusCode(_0x40538f,_0x309248){_0x309248=_0x309248||0xcc;return function(_0x1b76ff){if(_0x1b76ff){return _0x40538f[_0x64ea('0x1b')](_0x309248);}return _0x40538f[_0x64ea('0x1c')](_0x309248)[_0x64ea('0x1d')]();};}function respondWithResult(_0x34da6f,_0x4d82f8){_0x4d82f8=_0x4d82f8||0xc8;return function(_0x11f6e2){if(_0x11f6e2){return _0x34da6f[_0x64ea('0x1c')](_0x4d82f8)[_0x64ea('0x1e')](_0x11f6e2);}};}function respondWithFilteredResult(_0x278d40,_0x5f3e7e){return function(_0x696cc){if(_0x696cc){var _0x4c0299=typeof _0x5f3e7e[_0x64ea('0x1f')]==='undefined'&&typeof _0x5f3e7e['limit']==='undefined';var _0x11e471=_0x696cc[_0x64ea('0x20')];var _0x2e0cd6=_0x4c0299?0x0:_0x5f3e7e['offset'];var _0x229702=_0x4c0299?_0x696cc['count']:_0x5f3e7e[_0x64ea('0x1f')]+_0x5f3e7e[_0x64ea('0x21')];var _0x4cb443;if(_0x229702>=_0x11e471){_0x229702=_0x11e471;_0x4cb443=0xc8;}else{_0x4cb443=0xce;}_0x278d40['status'](_0x4cb443);return _0x278d40[_0x64ea('0x22')](_0x64ea('0x23'),_0x2e0cd6+'-'+_0x229702+'/'+_0x11e471)['json'](_0x696cc);}return null;};}function patchUpdates(_0x55f126){return function(_0x3d1a3e){try{jsonpatch['apply'](_0x3d1a3e,_0x55f126,!![]);}catch(_0x4f7e4d){return BPromise[_0x64ea('0x24')](_0x4f7e4d);}return _0x3d1a3e[_0x64ea('0x25')]();};}function saveUpdates(_0x51f7d2,_0x1f0f78){return function(_0x4397bc){if(_0x4397bc){return _0x4397bc[_0x64ea('0x26')](_0x51f7d2)[_0x64ea('0x27')](function(_0x45226f){return _0x45226f;});}return null;};}function removeEntity(_0x6984ad,_0x49a6c0){return function(_0x48d0e6){if(_0x48d0e6){return _0x48d0e6[_0x64ea('0x28')]()[_0x64ea('0x27')](function(){_0x6984ad[_0x64ea('0x1c')](0xcc)[_0x64ea('0x1d')]();});}};}function handleEntityNotFound(_0x181764,_0x18efb3){return function(_0x404e09){if(!_0x404e09){_0x181764[_0x64ea('0x1b')](0x194);}return _0x404e09;};}function handleError(_0x118f84,_0x4c7147){_0x4c7147=_0x4c7147||0x1f4;return function(_0x502179){logger[_0x64ea('0x29')](_0x502179[_0x64ea('0x2a')]);if(_0x502179[_0x64ea('0x2b')]){delete _0x502179[_0x64ea('0x2b')];}_0x118f84['status'](_0x4c7147)['send'](_0x502179);};}exports['index']=function(_0x2055e4,_0x111c8c){var _0xec592f={},_0x5d25b4={},_0xf7fcd5={'count':0x0,'rows':[]};var _0x2da83b=_[_0x64ea('0x2c')](db[_0x64ea('0x2d')]['rawAttributes'],function(_0x13d8b5){return{'name':_0x13d8b5[_0x64ea('0x2e')],'type':_0x13d8b5['type']['key']};});_0x5d25b4['model']=_['map'](_0x2da83b,'name');_0x5d25b4[_0x64ea('0x2f')]=_[_0x64ea('0x30')](_0x2055e4[_0x64ea('0x2f')]);_0x5d25b4['filters']=_[_0x64ea('0x31')](_0x5d25b4['model'],_0x5d25b4[_0x64ea('0x2f')]);_0xec592f[_0x64ea('0x32')]=_[_0x64ea('0x31')](_0x5d25b4['model'],qs['fields'](_0x2055e4['query'][_0x64ea('0x33')]));_0xec592f[_0x64ea('0x32')]=_0xec592f[_0x64ea('0x32')]['length']?_0xec592f[_0x64ea('0x32')]:_0x5d25b4[_0x64ea('0x34')];if(!_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x35')]('nolimit')){_0xec592f[_0x64ea('0x21')]=qs[_0x64ea('0x21')](_0x2055e4['query'][_0x64ea('0x21')]);_0xec592f[_0x64ea('0x1f')]=qs['offset'](_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x1f')]);}_0xec592f[_0x64ea('0x36')]=qs[_0x64ea('0x37')](_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x37')]);_0xec592f['where']=qs[_0x64ea('0x38')](_[_0x64ea('0x39')](_0x2055e4['query'],_0x5d25b4[_0x64ea('0x38')]),_0x2da83b);if(_0x2055e4[_0x64ea('0x2f')]['filter']){_0xec592f[_0x64ea('0x3a')]=_['merge'](_0xec592f[_0x64ea('0x3a')],{'$or':_[_0x64ea('0x2c')](_0x2da83b,function(_0x4b25be){if(_0x4b25be['type']!=='VIRTUAL'){var _0x24acc2={};_0x24acc2[_0x4b25be[_0x64ea('0x2b')]]={'$like':'%'+_0x2055e4['query']['filter']+'%'};return _0x24acc2;}})});}_0xec592f=_[_0x64ea('0x3b')]({},_0xec592f,_0x2055e4['options']);var _0x592c31={'where':_0xec592f[_0x64ea('0x3a')]};return db[_0x64ea('0x2d')][_0x64ea('0x20')](_0x592c31)[_0x64ea('0x27')](function(_0x21a23e){_0xf7fcd5[_0x64ea('0x20')]=_0x21a23e;if(_0x2055e4[_0x64ea('0x2f')]['includeAll']){_0xec592f['include']=[{'all':!![]}];}return db[_0x64ea('0x2d')]['findAll'](_0xec592f);})[_0x64ea('0x27')](function(_0x30a8a1){_0xf7fcd5[_0x64ea('0x3c')]=_0x30a8a1;return _0xf7fcd5;})[_0x64ea('0x27')](respondWithFilteredResult(_0x111c8c,_0xec592f))['catch'](handleError(_0x111c8c,null));};exports[_0x64ea('0x3d')]=function(_0x2ab744,_0x102a05){var _0x4b32ec={'raw':![],'where':{'id':_0x2ab744[_0x64ea('0x3e')]['id']}},_0x4cf010={};_0x4cf010[_0x64ea('0x34')]=_[_0x64ea('0x30')](db[_0x64ea('0x2d')][_0x64ea('0x3f')]);_0x4cf010['query']=_[_0x64ea('0x30')](_0x2ab744['query']);_0x4cf010[_0x64ea('0x38')]=_[_0x64ea('0x31')](_0x4cf010[_0x64ea('0x34')],_0x4cf010[_0x64ea('0x2f')]);_0x4b32ec[_0x64ea('0x32')]=_['intersection'](_0x4cf010[_0x64ea('0x34')],qs['fields'](_0x2ab744['query'][_0x64ea('0x33')]));_0x4b32ec['attributes']=_0x4b32ec['attributes'][_0x64ea('0x40')]?_0x4b32ec[_0x64ea('0x32')]:_0x4cf010[_0x64ea('0x34')];if(_0x2ab744['query']['includeAll']){_0x4b32ec[_0x64ea('0x41')]=[{'all':!![]}];}_0x4b32ec=_[_0x64ea('0x3b')]({},_0x4b32ec,_0x2ab744[_0x64ea('0x42')]);return db[_0x64ea('0x2d')][_0x64ea('0x43')](_0x4b32ec)[_0x64ea('0x27')](handleEntityNotFound(_0x102a05,null))[_0x64ea('0x27')](respondWithResult(_0x102a05,null))[_0x64ea('0x44')](handleError(_0x102a05,null));};exports[_0x64ea('0x45')]=function(_0x52e28f,_0x5812e4){return db['UserProfileSection'][_0x64ea('0x45')](_0x52e28f[_0x64ea('0x46')],{})['then'](respondWithResult(_0x5812e4,0xc9))[_0x64ea('0x44')](handleError(_0x5812e4,null));};exports['update']=function(_0x37d0c0,_0x40f2bf){if(_0x37d0c0[_0x64ea('0x46')]['id']){delete _0x37d0c0[_0x64ea('0x46')]['id'];}return db[_0x64ea('0x2d')][_0x64ea('0x43')]({'where':{'id':_0x37d0c0[_0x64ea('0x3e')]['id']}})[_0x64ea('0x27')](handleEntityNotFound(_0x40f2bf,null))[_0x64ea('0x27')](saveUpdates(_0x37d0c0[_0x64ea('0x46')],null))['then'](respondWithResult(_0x40f2bf,null))[_0x64ea('0x44')](handleError(_0x40f2bf,null));};exports[_0x64ea('0x28')]=function(_0x1ce1e6,_0xd498c){return db[_0x64ea('0x2d')][_0x64ea('0x43')]({'where':{'id':_0x1ce1e6[_0x64ea('0x3e')]['id']}})[_0x64ea('0x27')](handleEntityNotFound(_0xd498c,null))[_0x64ea('0x27')](removeEntity(_0xd498c,null))[_0x64ea('0x44')](handleError(_0xd498c,null));};exports[_0x64ea('0x47')]=function(_0x5ad5cd,_0x42435c){return db[_0x64ea('0x2d')]['describe']()[_0x64ea('0x27')](respondWithResult(_0x42435c,null))[_0x64ea('0x44')](handleError(_0x42435c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 4b890ce..b025b74 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 _0x0558=['./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x542a3e,_0x1bb56b){var _0x2f3cce=function(_0x1e94f7){while(--_0x1e94f7){_0x542a3e['push'](_0x542a3e['shift']());}};_0x2f3cce(++_0x1bb56b);}(_0x0558,0x18d));var _0x8055=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0x0558[_0x2ceba7];return _0x5348eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8055('0x0'))('api');var moment=require(_0x8055('0x1'));var BPromise=require('bluebird');var rp=require(_0x8055('0x2'));var fs=require('fs');var path=require(_0x8055('0x3'));var rimraf=require(_0x8055('0x4'));var config=require(_0x8055('0x5'));var attributes=require(_0x8055('0x6'));module[_0x8055('0x7')]=function(_0x3b6065,_0x1f49e4){return _0x3b6065['define'](_0x8055('0x8'),attributes,{'tableName':_0x8055('0x9'),'paranoid':![],'indexes':[{'name':_0x8055('0xa'),'fields':[_0x8055('0xb'),_0x8055('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9df5=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','moment','bluebird','path','rimraf','./userProfileSection.attributes'];(function(_0x4a6b79,_0x444f6){var _0x5bb128=function(_0x294230){while(--_0x294230){_0x4a6b79['push'](_0x4a6b79['shift']());}};_0x5bb128(++_0x444f6);}(_0x9df5,0x165));var _0x59df=function(_0x46dadf,_0x3cfe11){_0x46dadf=_0x46dadf-0x0;var _0x3541cc=_0x9df5[_0x46dadf];return _0x3541cc;};'use strict';var _=require('lodash');var util=require(_0x59df('0x0'));var logger=require(_0x59df('0x1'))('api');var moment=require(_0x59df('0x2'));var BPromise=require(_0x59df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59df('0x4'));var rimraf=require(_0x59df('0x5'));var config=require('../../config/environment');var attributes=require(_0x59df('0x6'));module[_0x59df('0x7')]=function(_0x771f60,_0x5d6317){return _0x771f60[_0x59df('0x8')](_0x59df('0x9'),attributes,{'tableName':_0x59df('0xa'),'paranoid':![],'indexes':[{'name':_0x59df('0xb'),'fields':[_0x59df('0xc'),_0x59df('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 9738967..4200bf8 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 _0x5101=['message','UserProfileSection,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2834d9,_0x2069f7){var _0x142582=function(_0xae727d){while(--_0xae727d){_0x2834d9['push'](_0x2834d9['shift']());}};_0x142582(++_0x2069f7);}(_0x5101,0x137));var _0x1510=function(_0x12cb77,_0x292624){_0x12cb77=_0x12cb77-0x0;var _0x39b8c5=_0x5101[_0x12cb77];return _0x39b8c5;};'use strict';var _=require(_0x1510('0x0'));var util=require(_0x1510('0x1'));var moment=require(_0x1510('0x2'));var BPromise=require('bluebird');var rs=require(_0x1510('0x3'));var fs=require('fs');var Redis=require(_0x1510('0x4'));var db=require(_0x1510('0x5'))['db'];var utils=require(_0x1510('0x6'));var logger=require(_0x1510('0x7'))('rpc');var config=require(_0x1510('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1510('0x9')][_0x1510('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cdf9e,_0x35a5ec,_0xf45269){return new BPromise(function(_0x47d489,_0x5d9c2f){return client[_0x1510('0xb')](_0x2cdf9e,_0xf45269)[_0x1510('0xc')](function(_0x898b63){logger[_0x1510('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x35a5ec,_0x1510('0xe'));logger['debug'](_0x1510('0xf'),_0x35a5ec,_0x1510('0xe'),JSON[_0x1510('0x10')](_0x898b63));if(_0x898b63[_0x1510('0x11')]){if(_0x898b63[_0x1510('0x11')][_0x1510('0x12')]===0x1f4){logger[_0x1510('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x35a5ec,_0x898b63[_0x1510('0x11')][_0x1510('0x13')]);return _0x5d9c2f(_0x898b63[_0x1510('0x11')]['message']);}logger[_0x1510('0x11')](_0x1510('0x14'),_0x35a5ec,_0x898b63[_0x1510('0x11')][_0x1510('0x13')]);return _0x47d489(_0x898b63['error']['message']);}else{logger[_0x1510('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x35a5ec,_0x1510('0xe'));_0x47d489(_0x898b63[_0x1510('0x15')][_0x1510('0x13')]);}})['catch'](function(_0xc205a8){logger[_0x1510('0x11')](_0x1510('0x14'),_0x35a5ec,_0xc205a8);_0x5d9c2f(_0xc205a8);});});} \ No newline at end of file +var _0xb815=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x35ecfc,_0xa522ae){var _0x5d759d=function(_0x51bf48){while(--_0x51bf48){_0x35ecfc['push'](_0x35ecfc['shift']());}};_0x5d759d(++_0xa522ae);}(_0xb815,0x160));var _0x5b81=function(_0x2963b3,_0x179f6d){_0x2963b3=_0x2963b3-0x0;var _0x333b8e=_0xb815[_0x2963b3];return _0x333b8e;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x340970,_0xcbaa80,_0x682c3e){return new BPromise(function(_0x13b3a2,_0x1bbd92){return client[_0x5b81('0xa')](_0x340970,_0x682c3e)[_0x5b81('0xb')](function(_0x382cb7){logger[_0x5b81('0xc')](_0x5b81('0xd'),_0xcbaa80,'request\x20sent');logger[_0x5b81('0xe')](_0x5b81('0xf'),_0xcbaa80,'request\x20sent',JSON[_0x5b81('0x10')](_0x382cb7));if(_0x382cb7[_0x5b81('0x11')]){if(_0x382cb7[_0x5b81('0x11')]['code']===0x1f4){logger[_0x5b81('0x11')](_0x5b81('0xd'),_0xcbaa80,_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);return _0x1bbd92(_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);}logger[_0x5b81('0x11')]('UserProfileSection,\x20%s,\x20%s',_0xcbaa80,_0x382cb7[_0x5b81('0x11')]['message']);return _0x13b3a2(_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);}else{logger[_0x5b81('0xc')](_0x5b81('0xd'),_0xcbaa80,_0x5b81('0x13'));_0x13b3a2(_0x382cb7[_0x5b81('0x14')][_0x5b81('0x12')]);}})[_0x5b81('0x15')](function(_0x3e32a2){logger[_0x5b81('0x11')](_0x5b81('0xd'),_0xcbaa80,_0x3e32a2);_0x1bbd92(_0x3e32a2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 325a306..03ee095 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5997d9,_0x1aa8a4){var _0x2eb07=function(_0x2ba417){while(--_0x2ba417){_0x5997d9['push'](_0x5997d9['shift']());}};_0x2eb07(++_0x1aa8a4);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x18517c,_0x16c20f){var _0x4f4727=function(_0x4214a7){while(--_0x4214a7){_0x18517c['push'](_0x18517c['shift']());}};_0x4f4727(++_0x16c20f);}(_0xe706,0xa3));var _0x6e70=function(_0x5998d0,_0x24ad81){_0x5998d0=_0x5998d0-0x0;var _0x47149d=_0xe706[_0x5998d0];return _0x47149d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2cf8be2..d3819fe 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 _0x4ba1=['exports'];(function(_0x1d209c,_0x633e4a){var _0x33c332=function(_0x444188){while(--_0x444188){_0x1d209c['push'](_0x1d209c['shift']());}};_0x33c332(++_0x633e4a);}(_0x4ba1,0x79));var _0x14ba=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4ba1[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module[_0x14ba('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6efc=['exports','INTEGER','sequelize'];(function(_0x2bb735,_0x62f050){var _0x17f252=function(_0x46046e){while(--_0x46046e){_0x2bb735['push'](_0x2bb735['shift']());}};_0x17f252(++_0x62f050);}(_0x6efc,0xec));var _0xc6ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6efc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc6ef('0x0'));module[_0xc6ef('0x1')]={'penalty':{'type':Sequelize[_0xc6ef('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 f20939e..96c08c0 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9f1fb1,_0x4c7ade){var _0x45477d=function(_0x2d7b41){while(--_0x2d7b41){_0x9f1fb1['push'](_0x9f1fb1['shift']());}};_0x45477d(++_0x4c7ade);}(_0x1883,0xab));var _0x3188=function(_0x2e0e60,_0x39712b){_0x2e0e60=_0x2e0e60-0x0;var _0x51fcd1=_0x1883[_0x2e0e60];return _0x51fcd1;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b29=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b29,0x163));var _0x92b2=function(_0x125e5f,_0x39482a){_0x125e5f=_0x125e5f-0x0;var _0x211482=_0x2b29[_0x125e5f];return _0x211482;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var logger=require(_0x92b2('0x1'))(_0x92b2('0x2'));var moment=require(_0x92b2('0x3'));var BPromise=require('bluebird');var rp=require(_0x92b2('0x4'));var fs=require('fs');var path=require(_0x92b2('0x5'));var rimraf=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var attributes=require(_0x92b2('0x8'));module[_0x92b2('0x9')]=function(_0x47c522,_0xb1d856){return _0x47c522['define'](_0x92b2('0xa'),attributes,{'tableName':_0x92b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 93097c1..672f328 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 _0x0714=['http','request','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3fb743,_0x2b6886){var _0x135901=function(_0x5adc16){while(--_0x5adc16){_0x3fb743['push'](_0x3fb743['shift']());}};_0x135901(++_0x2b6886);}(_0x0714,0xbe));var _0x4071=function(_0x53cb26,_0x172da8){_0x53cb26=_0x53cb26-0x0;var _0x131f65=_0x0714[_0x53cb26];return _0x131f65;};'use strict';var _=require(_0x4071('0x0'));var util=require('util');var moment=require(_0x4071('0x1'));var BPromise=require(_0x4071('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4071('0x3'));var db=require(_0x4071('0x4'))['db'];var utils=require(_0x4071('0x5'));var logger=require('../../config/logger')(_0x4071('0x6'));var config=require(_0x4071('0x7'));var jayson=require(_0x4071('0x8'));var client=jayson[_0x4071('0x9')][_0x4071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c5203,_0xababe6,_0x3413d4){return new BPromise(function(_0x796c7e,_0x16ee01){return client[_0x4071('0xb')](_0x3c5203,_0x3413d4)['then'](function(_0x17d1a9){logger['info'](_0x4071('0xc'),_0xababe6,'request\x20sent');logger['debug'](_0x4071('0xd'),_0xababe6,'request\x20sent',JSON[_0x4071('0xe')](_0x17d1a9));if(_0x17d1a9[_0x4071('0xf')]){if(_0x17d1a9[_0x4071('0xf')][_0x4071('0x10')]===0x1f4){logger[_0x4071('0xf')](_0x4071('0xc'),_0xababe6,_0x17d1a9[_0x4071('0xf')][_0x4071('0x11')]);return _0x16ee01(_0x17d1a9[_0x4071('0xf')][_0x4071('0x11')]);}logger['error'](_0x4071('0xc'),_0xababe6,_0x17d1a9[_0x4071('0xf')][_0x4071('0x11')]);return _0x796c7e(_0x17d1a9[_0x4071('0xf')]['message']);}else{logger[_0x4071('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0xababe6,_0x4071('0x13'));_0x796c7e(_0x17d1a9['result']['message']);}})['catch'](function(_0x3926f9){logger[_0x4071('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0xababe6,_0x3926f9);_0x16ee01(_0x3926f9);});});} \ No newline at end of file +var _0x7c98=['jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x156dba,_0x4e513e){var _0xa401c=function(_0x2fcb8c){while(--_0x2fcb8c){_0x156dba['push'](_0x156dba['shift']());}};_0xa401c(++_0x4e513e);}(_0x7c98,0x7c));var _0x87c9=function(_0x124096,_0xbb4341){_0x124096=_0x124096-0x0;var _0x123aed=_0x7c98[_0x124096];return _0x123aed;};'use strict';var _=require(_0x87c9('0x0'));var util=require(_0x87c9('0x1'));var moment=require(_0x87c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x87c9('0x3'));var fs=require('fs');var Redis=require(_0x87c9('0x4'));var db=require(_0x87c9('0x5'))['db'];var utils=require(_0x87c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x87c9('0x7'));var jayson=require(_0x87c9('0x8'));var client=jayson[_0x87c9('0x9')][_0x87c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32b029,_0x4359c2,_0x5d59c1){return new BPromise(function(_0x15f56d,_0x180010){return client[_0x87c9('0xb')](_0x32b029,_0x5d59c1)[_0x87c9('0xc')](function(_0x1dc010){logger[_0x87c9('0xd')](_0x87c9('0xe'),_0x4359c2,_0x87c9('0xf'));logger['debug'](_0x87c9('0x10'),_0x4359c2,_0x87c9('0xf'),JSON['stringify'](_0x1dc010));if(_0x1dc010['error']){if(_0x1dc010[_0x87c9('0x11')][_0x87c9('0x12')]===0x1f4){logger[_0x87c9('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x4359c2,_0x1dc010[_0x87c9('0x11')]['message']);return _0x180010(_0x1dc010[_0x87c9('0x11')]['message']);}logger[_0x87c9('0x11')](_0x87c9('0xe'),_0x4359c2,_0x1dc010[_0x87c9('0x11')]['message']);return _0x15f56d(_0x1dc010['error'][_0x87c9('0x13')]);}else{logger['info'](_0x87c9('0xe'),_0x4359c2,_0x87c9('0xf'));_0x15f56d(_0x1dc010[_0x87c9('0x14')][_0x87c9('0x13')]);}})[_0x87c9('0x15')](function(_0x100e2a){logger[_0x87c9('0x11')](_0x87c9('0xe'),_0x4359c2,_0x100e2a);_0x180010(_0x100e2a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c6c4ca8..c8ae2d6 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 _0x0ce4=['sequelize','exports','INTEGER'];(function(_0x5d429f,_0x32ceb4){var _0x48dda6=function(_0x2381ee){while(--_0x2381ee){_0x5d429f['push'](_0x5d429f['shift']());}};_0x48dda6(++_0x32ceb4);}(_0x0ce4,0x8d));var _0x40ce=function(_0xf04b83,_0x399c28){_0xf04b83=_0xf04b83-0x0;var _0x3d15eb=_0x0ce4[_0xf04b83];return _0x3d15eb;};'use strict';var Sequelize=require(_0x40ce('0x0'));module[_0x40ce('0x1')]={'UserId':{'type':Sequelize[_0x40ce('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x40ce('0x2')]}}; \ No newline at end of file +var _0x799a=['exports','INTEGER'];(function(_0x184b7c,_0x96e391){var _0x44d750=function(_0x2743f2){while(--_0x2743f2){_0x184b7c['push'](_0x184b7c['shift']());}};_0x44d750(++_0x96e391);}(_0x799a,0x194));var _0xa799=function(_0x4dc512,_0x11475a){_0x4dc512=_0x4dc512-0x0;var _0xbba65f=_0x799a[_0x4dc512];return _0xbba65f;};'use strict';var Sequelize=require('sequelize');module[_0xa799('0x0')]={'UserId':{'type':Sequelize[_0xa799('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 06a9c18..efcbe36 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(_0x2054a5,_0x259fcb){var _0xdf63e6=function(_0xae65c4){while(--_0xae65c4){_0x2054a5['push'](_0x2054a5['shift']());}};_0xdf63e6(++_0x259fcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x52e83d,_0x2c09f0){var _0x111b97=function(_0x4fc139){while(--_0x4fc139){_0x52e83d['push'](_0x52e83d['shift']());}};_0x111b97(++_0x2c09f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 64c467c..7009d15 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2df9c3,_0x2c7e84){var _0x47e872=function(_0x551a7d){while(--_0x551a7d){_0x2df9c3['push'](_0x2df9c3['shift']());}};_0x47e872(++_0x2c7e84);}(_0xedd9,0xfc));var _0x9edd=function(_0x190c81,_0x58f0bd){_0x190c81=_0x190c81-0x0;var _0x503a57=_0xedd9[_0x190c81];return _0x503a57;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5f5a64,_0x11640b){var _0x6b73ff=function(_0x5ae266){while(--_0x5ae266){_0x5f5a64['push'](_0x5f5a64['shift']());}};_0x6b73ff(++_0x11640b);}(_0x70e0,0x17b));var _0x070e=function(_0x4b7379,_0x2d360a){_0x4b7379=_0x4b7379-0x0;var _0x41c15f=_0x70e0[_0x4b7379];return _0x41c15f;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d00f7cf..b15d03a 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 _0xbe44=['sequelize','INTEGER'];(function(_0x2b537f,_0x5a3068){var _0x3ac272=function(_0x31808e){while(--_0x31808e){_0x2b537f['push'](_0x2b537f['shift']());}};_0x3ac272(++_0x5a3068);}(_0xbe44,0x13a));var _0x4be4=function(_0x376971,_0x3d9579){_0x376971=_0x376971-0x0;var _0x2286ff=_0xbe44[_0x376971];return _0x2286ff;};'use strict';var Sequelize=require(_0x4be4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4be4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x57b5=['exports','INTEGER'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x57b5,0x1bc));var _0x557b=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x57b5[_0x469393];return _0x5f720d;};'use strict';var Sequelize=require('sequelize');module[_0x557b('0x0')]={'penalty':{'type':Sequelize[_0x557b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 880f47a..bcdcc15 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 _0x8237=['./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x12f7bb,_0x1bfb8f){var _0x1e19fa=function(_0x2e1eef){while(--_0x2e1eef){_0x12f7bb['push'](_0x12f7bb['shift']());}};_0x1e19fa(++_0x1bfb8f);}(_0x8237,0xbe));var _0x7823=function(_0x5024aa,_0x242360){_0x5024aa=_0x5024aa-0x0;var _0x468e9f=_0x8237[_0x5024aa];return _0x468e9f;};'use strict';var _=require(_0x7823('0x0'));var util=require('util');var logger=require(_0x7823('0x1'))(_0x7823('0x2'));var moment=require(_0x7823('0x3'));var BPromise=require(_0x7823('0x4'));var rp=require(_0x7823('0x5'));var fs=require('fs');var path=require(_0x7823('0x6'));var rimraf=require(_0x7823('0x7'));var config=require('../../config/environment');var attributes=require(_0x7823('0x8'));module[_0x7823('0x9')]=function(_0x4b542a,_0x1a253f){return _0x4b542a['define']('UserVoiceQueue',attributes,{'tableName':_0x7823('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa20c=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues','api','moment','bluebird','request-promise'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xa20c,0x1a0));var _0xca20=function(_0x96d638,_0x5f1a4f){_0x96d638=_0x96d638-0x0;var _0x4d689f=_0xa20c[_0x96d638];return _0x4d689f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xca20('0x0'));var moment=require(_0xca20('0x1'));var BPromise=require(_0xca20('0x2'));var rp=require(_0xca20('0x3'));var fs=require('fs');var path=require(_0xca20('0x4'));var rimraf=require(_0xca20('0x5'));var config=require(_0xca20('0x6'));var attributes=require(_0xca20('0x7'));module[_0xca20('0x8')]=function(_0x140337,_0x2190e7){return _0x140337['define']('UserVoiceQueue',attributes,{'tableName':_0xca20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index f855cd1..4effffc 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 _0x58ef=['util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UserVoiceQueue,\x20%s,\x20%s','lodash'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x58ef,0x155));var _0xf58e=function(_0x186ae4,_0x1f8b1e){_0x186ae4=_0x186ae4-0x0;var _0x182156=_0x58ef[_0x186ae4];return _0x182156;};'use strict';var _=require(_0xf58e('0x0'));var util=require(_0xf58e('0x1'));var moment=require('moment');var BPromise=require(_0xf58e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf58e('0x3'));var logger=require(_0xf58e('0x4'))(_0xf58e('0x5'));var config=require(_0xf58e('0x6'));var jayson=require(_0xf58e('0x7'));var client=jayson[_0xf58e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e99fe,_0x121df1,_0x10b37b){return new BPromise(function(_0xa22c75,_0x19e94a){return client[_0xf58e('0x9')](_0x5e99fe,_0x10b37b)[_0xf58e('0xa')](function(_0x19ea8d){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x121df1,_0xf58e('0xb'));logger['debug'](_0xf58e('0xc'),_0x121df1,'request\x20sent',JSON[_0xf58e('0xd')](_0x19ea8d));if(_0x19ea8d[_0xf58e('0xe')]){if(_0x19ea8d[_0xf58e('0xe')]['code']===0x1f4){logger[_0xf58e('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x121df1,_0x19ea8d[_0xf58e('0xe')]['message']);return _0x19e94a(_0x19ea8d['error'][_0xf58e('0xf')]);}logger[_0xf58e('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x121df1,_0x19ea8d['error'][_0xf58e('0xf')]);return _0xa22c75(_0x19ea8d['error'][_0xf58e('0xf')]);}else{logger[_0xf58e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x121df1,_0xf58e('0xb'));_0xa22c75(_0x19ea8d[_0xf58e('0x11')][_0xf58e('0xf')]);}})['catch'](function(_0x5e92a1){logger[_0xf58e('0xe')](_0xf58e('0x12'),_0x121df1,_0x5e92a1);_0x19e94a(_0x5e92a1);});});} \ No newline at end of file +var _0xdf58=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x324d02,_0x350c80){var _0x3ac052=function(_0x44f137){while(--_0x44f137){_0x324d02['push'](_0x324d02['shift']());}};_0x3ac052(++_0x350c80);}(_0xdf58,0xdd));var _0x8df5=function(_0x5b5abb,_0x291ee5){_0x5b5abb=_0x5b5abb-0x0;var _0x3fbd6f=_0xdf58[_0x5b5abb];return _0x3fbd6f;};'use strict';var _=require(_0x8df5('0x0'));var util=require(_0x8df5('0x1'));var moment=require('moment');var BPromise=require(_0x8df5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8df5('0x4'))(_0x8df5('0x5'));var config=require(_0x8df5('0x6'));var jayson=require(_0x8df5('0x7'));var client=jayson[_0x8df5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47a38f,_0x3bd39f,_0x2a8c2d){return new BPromise(function(_0x338e45,_0x549185){return client[_0x8df5('0x9')](_0x47a38f,_0x2a8c2d)[_0x8df5('0xa')](function(_0x17c04d){logger[_0x8df5('0xb')](_0x8df5('0xc'),_0x3bd39f,_0x8df5('0xd'));logger[_0x8df5('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bd39f,_0x8df5('0xd'),JSON[_0x8df5('0xf')](_0x17c04d));if(_0x17c04d['error']){if(_0x17c04d['error'][_0x8df5('0x10')]===0x1f4){logger[_0x8df5('0x11')](_0x8df5('0xc'),_0x3bd39f,_0x17c04d[_0x8df5('0x11')]['message']);return _0x549185(_0x17c04d[_0x8df5('0x11')]['message']);}logger['error'](_0x8df5('0xc'),_0x3bd39f,_0x17c04d[_0x8df5('0x11')][_0x8df5('0x12')]);return _0x338e45(_0x17c04d['error']['message']);}else{logger[_0x8df5('0xb')](_0x8df5('0xc'),_0x3bd39f,_0x8df5('0xd'));_0x338e45(_0x17c04d[_0x8df5('0x13')][_0x8df5('0x12')]);}})[_0x8df5('0x14')](function(_0x482bff){logger[_0x8df5('0x11')](_0x8df5('0xc'),_0x3bd39f,_0x482bff);_0x549185(_0x482bff);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 39b8dc9..dc463d6 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x269001,_0x537531){var _0x4fe863=function(_0x568419){while(--_0x568419){_0x269001['push'](_0x269001['shift']());}};_0x4fe863(++_0x537531);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4cbed8,_0x3f3b31){var _0x4f8fe9=function(_0x8baa8b){while(--_0x8baa8b){_0x4cbed8['push'](_0x4cbed8['shift']());}};_0x4f8fe9(++_0x3f3b31);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0xcb91[_0x43a1b8];return _0x324ecc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 9826bed..ff16729 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 _0x49d5=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x509e74,_0x59d5f5){var _0x265c97=function(_0x336757){while(--_0x336757){_0x509e74['push'](_0x509e74['shift']());}};_0x265c97(++_0x59d5f5);}(_0x49d5,0x11b));var _0x549d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x49d5[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x549d('0x0'));module[_0x549d('0x1')]={'uniqueid':{'type':Sequelize[_0x549d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x549d('0x3')},'membername':{'type':Sequelize[_0x549d('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x549d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x549d('0x4')],'allowNull':![],'unique':_0x549d('0x5'),'comment':_0x549d('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x549d('0x4')],'allowNull':![],'unique':_0x549d('0x5'),'comment':_0x549d('0x3')},'penalty':{'type':Sequelize[_0x549d('0x2')](0xb),'defaultValue':0x0,'comment':_0x549d('0x3')},'paused':{'type':Sequelize[_0x549d('0x2')](0xb),'defaultValue':0x0,'comment':_0x549d('0x3')}}; \ No newline at end of file +var _0xa209=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x3b0a42,_0x420275){var _0x27f854=function(_0x2dccb2){while(--_0x2dccb2){_0x3b0a42['push'](_0x3b0a42['shift']());}};_0x27f854(++_0x420275);}(_0xa209,0x1bb));var _0x9a20=function(_0x4fd848,_0x4a216d){_0x4fd848=_0x4fd848-0x0;var _0x197955=_0xa209[_0x4fd848];return _0x197955;};'use strict';var Sequelize=require(_0x9a20('0x0'));module[_0x9a20('0x1')]={'uniqueid':{'type':Sequelize[_0x9a20('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9a20('0x3')},'membername':{'type':Sequelize[_0x9a20('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9a20('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a20('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x9a20('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a20('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9a20('0x3')},'paused':{'type':Sequelize[_0x9a20('0x2')](0xb),'defaultValue':0x0,'comment':_0x9a20('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1309536..8acf0e0 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 _0x0423=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x184e69,_0x39af04){var _0x57d8ad=function(_0x153dd9){while(--_0x153dd9){_0x184e69['push'](_0x184e69['shift']());}};_0x57d8ad(++_0x39af04);}(_0x0423,0xeb));var _0x3042=function(_0x540cfd,_0x78a20a){_0x540cfd=_0x540cfd-0x0;var _0x7d5707=_0x0423[_0x540cfd];return _0x7d5707;};'use strict';var EventEmitter=require(_0x3042('0x0'));var UserVoiceQueueRt=require(_0x3042('0x1'))['db'][_0x3042('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3042('0x3')](0x0);var events={'afterCreate':_0x3042('0x4'),'afterUpdate':_0x3042('0x5'),'afterDestroy':_0x3042('0x6')};function emitEvent(_0x31e2c1){return function(_0x47288c,_0x3a8201,_0x5c9253){UserVoiceQueueRtEvents[_0x3042('0x7')](_0x31e2c1+':'+_0x47288c['id'],_0x47288c);UserVoiceQueueRtEvents['emit'](_0x31e2c1,_0x47288c);_0x5c9253(null);};}for(var e in events){if(events[_0x3042('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x3042('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd56c=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2be851,_0x1b998c){var _0x1e8c88=function(_0x3b8d37){while(--_0x3b8d37){_0x2be851['push'](_0x2be851['shift']());}};_0x1e8c88(++_0x1b998c);}(_0xd56c,0xa0));var _0xcd56=function(_0x2ec196,_0x2abe6e){_0x2ec196=_0x2ec196-0x0;var _0xffe018=_0xd56c[_0x2ec196];return _0xffe018;};'use strict';var EventEmitter=require(_0xcd56('0x0'));var UserVoiceQueueRt=require(_0xcd56('0x1'))['db'][_0xcd56('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xcd56('0x3')](0x0);var events={'afterCreate':_0xcd56('0x4'),'afterUpdate':_0xcd56('0x5'),'afterDestroy':_0xcd56('0x6')};function emitEvent(_0x836e90){return function(_0x3b22b1,_0x4a0383,_0x896109){UserVoiceQueueRtEvents[_0xcd56('0x7')](_0x836e90+':'+_0x3b22b1['id'],_0x3b22b1);UserVoiceQueueRtEvents['emit'](_0x836e90,_0x3b22b1);_0x896109(null);};}for(var e in events){if(events[_0xcd56('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xcd56('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7d955c3..062e129 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 _0x7422=['../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7422,0x11a));var _0x2742=function(_0x42940d,_0xce20f1){_0x42940d=_0x42940d-0x0;var _0xc1217f=_0x7422[_0x42940d];return _0xc1217f;};'use strict';var _=require(_0x2742('0x0'));var util=require('util');var logger=require(_0x2742('0x1'))(_0x2742('0x2'));var moment=require(_0x2742('0x3'));var BPromise=require(_0x2742('0x4'));var rp=require(_0x2742('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2742('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x35ade5,_0x54cb28){return _0x35ade5['define'](_0x2742('0x7'),attributes,{'tableName':_0x2742('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x368c=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x30ac14,_0x2ed451){var _0x32080d=function(_0x181ec3){while(--_0x181ec3){_0x30ac14['push'](_0x30ac14['shift']());}};_0x32080d(++_0x2ed451);}(_0x368c,0x1dd));var _0xc368=function(_0x1e6596,_0x4f5b93){_0x1e6596=_0x1e6596-0x0;var _0x16266e=_0x368c[_0x1e6596];return _0x16266e;};'use strict';var _=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var logger=require(_0xc368('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc368('0x3'));var rp=require(_0xc368('0x4'));var fs=require('fs');var path=require(_0xc368('0x5'));var rimraf=require(_0xc368('0x6'));var config=require('../../config/environment');var attributes=require(_0xc368('0x7'));module['exports']=function(_0x48e624,_0x52e979){return _0x48e624[_0xc368('0x8')](_0xc368('0x9'),attributes,{'tableName':_0xc368('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 9a82053..9faa307 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 _0x05ce=['code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x05ce,0x102));var _0xe05c=function(_0xc45f87,_0x1b5e4d){_0xc45f87=_0xc45f87-0x0;var _0x12ea14=_0x05ce[_0xc45f87];return _0x12ea14;};'use strict';var _=require(_0xe05c('0x0'));var util=require(_0xe05c('0x1'));var moment=require('moment');var BPromise=require(_0xe05c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe05c('0x3'));var db=require(_0xe05c('0x4'))['db'];var utils=require(_0xe05c('0x5'));var logger=require('../../config/logger')(_0xe05c('0x6'));var config=require(_0xe05c('0x7'));var jayson=require(_0xe05c('0x8'));var client=jayson[_0xe05c('0x9')]['http']({'port':0x232a});config[_0xe05c('0xa')]=_[_0xe05c('0xb')](config[_0xe05c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe05c('0xa')]));require(_0xe05c('0xc'))[_0xe05c('0xd')](socket);function respondWithRpcPromise(_0x20bd51,_0x2ee771,_0x454647){return new BPromise(function(_0x2aa24c,_0x453606){return client[_0xe05c('0xe')](_0x20bd51,_0x454647)[_0xe05c('0xf')](function(_0x2a3832){logger[_0xe05c('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2ee771,_0xe05c('0x11'));logger[_0xe05c('0x12')](_0xe05c('0x13'),_0x2ee771,_0xe05c('0x11'),JSON[_0xe05c('0x14')](_0x2a3832));if(_0x2a3832[_0xe05c('0x15')]){if(_0x2a3832[_0xe05c('0x15')][_0xe05c('0x16')]===0x1f4){logger['error'](_0xe05c('0x17'),_0x2ee771,_0x2a3832[_0xe05c('0x15')][_0xe05c('0x18')]);return _0x453606(_0x2a3832[_0xe05c('0x15')][_0xe05c('0x18')]);}logger[_0xe05c('0x15')](_0xe05c('0x17'),_0x2ee771,_0x2a3832[_0xe05c('0x15')][_0xe05c('0x18')]);return _0x2aa24c(_0x2a3832[_0xe05c('0x15')][_0xe05c('0x18')]);}else{logger[_0xe05c('0x10')](_0xe05c('0x17'),_0x2ee771,'request\x20sent');_0x2aa24c(_0x2a3832['result'][_0xe05c('0x18')]);}})[_0xe05c('0x19')](function(_0x4c15a0){logger[_0xe05c('0x15')](_0xe05c('0x17'),_0x2ee771,_0x4c15a0);_0x453606(_0x4c15a0);});});}exports[_0xe05c('0x1a')]=function(_0xf64053){var _0x4a3891=this;return new Promise(function(_0xbb2744,_0x30d4ba){return db[_0xe05c('0x1b')][_0xe05c('0x1c')]({'raw':_0xf64053[_0xe05c('0x1d')]?_0xf64053[_0xe05c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xf64053[_0xe05c('0x1d')]?_0xf64053['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xe05c('0x1e'),db['sequelize']['fn']('IF',db[_0xe05c('0x1f')][_0xe05c('0x20')](_0xe05c('0x21')))),_0xe05c('0x22')]]})[_0xe05c('0xf')](function(_0x48d011){logger[_0xe05c('0x10')](_0xe05c('0x1a'),_0xf64053);logger[_0xe05c('0x12')](_0xe05c('0x1a'),_0xf64053,JSON[_0xe05c('0x14')](_0x48d011));_0xbb2744(_0x48d011);})[_0xe05c('0x19')](function(_0x760974){logger['error']('GetVoiceQueueRtPauses',_0x760974[_0xe05c('0x18')],_0xf64053);_0x30d4ba(_0x4a3891['error'](0x1f4,_0x760974[_0xe05c('0x18')]));});});}; \ No newline at end of file +var _0xf319=['debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses'];(function(_0x544713,_0x124c2c){var _0x153df4=function(_0x4d2a5d){while(--_0x4d2a5d){_0x544713['push'](_0x544713['shift']());}};_0x153df4(++_0x124c2c);}(_0xf319,0x95));var _0x9f31=function(_0x7c265c,_0x1cf3b8){_0x7c265c=_0x7c265c-0x0;var _0x5e9b43=_0xf319[_0x7c265c];return _0x5e9b43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9f31('0x0'));var BPromise=require(_0x9f31('0x1'));var rs=require(_0x9f31('0x2'));var fs=require('fs');var Redis=require(_0x9f31('0x3'));var db=require(_0x9f31('0x4'))['db'];var utils=require(_0x9f31('0x5'));var logger=require(_0x9f31('0x6'))(_0x9f31('0x7'));var config=require(_0x9f31('0x8'));var jayson=require(_0x9f31('0x9'));var client=jayson[_0x9f31('0xa')][_0x9f31('0xb')]({'port':0x232a});config[_0x9f31('0xc')]=_[_0x9f31('0xd')](config[_0x9f31('0xc')],{'host':_0x9f31('0xe'),'port':0x18eb});var socket=require(_0x9f31('0xf'))(new Redis(config[_0x9f31('0xc')]));require(_0x9f31('0x10'))[_0x9f31('0x11')](socket);function respondWithRpcPromise(_0x17bb76,_0x19b5f6,_0x2b94b5){return new BPromise(function(_0x69d5ea,_0x3c740d){return client[_0x9f31('0x12')](_0x17bb76,_0x2b94b5)[_0x9f31('0x13')](function(_0x5b5d60){logger['info'](_0x9f31('0x14'),_0x19b5f6,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x19b5f6,'request\x20sent',JSON[_0x9f31('0x15')](_0x5b5d60));if(_0x5b5d60[_0x9f31('0x16')]){if(_0x5b5d60[_0x9f31('0x16')]['code']===0x1f4){logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x5b5d60[_0x9f31('0x16')][_0x9f31('0x17')]);return _0x3c740d(_0x5b5d60[_0x9f31('0x16')][_0x9f31('0x17')]);}logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x5b5d60[_0x9f31('0x16')]['message']);return _0x69d5ea(_0x5b5d60['error'][_0x9f31('0x17')]);}else{logger[_0x9f31('0x18')](_0x9f31('0x14'),_0x19b5f6,'request\x20sent');_0x69d5ea(_0x5b5d60['result'][_0x9f31('0x17')]);}})[_0x9f31('0x19')](function(_0x227412){logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x227412);_0x3c740d(_0x227412);});});}exports[_0x9f31('0x1a')]=function(_0x5ae6e2){var _0x22676a=this;return new Promise(function(_0x33cf99,_0x1325ac){return db[_0x9f31('0x1b')][_0x9f31('0x1c')]({'raw':_0x5ae6e2[_0x9f31('0x1d')]?_0x5ae6e2[_0x9f31('0x1d')][_0x9f31('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ae6e2['options']?_0x5ae6e2[_0x9f31('0x1d')][_0x9f31('0x1f')]||null:null,'attributes':[[db[_0x9f31('0x20')]['fn'](_0x9f31('0x21'),db[_0x9f31('0x20')]['fn']('IF',db[_0x9f31('0x20')][_0x9f31('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x9f31('0x23')]]})[_0x9f31('0x13')](function(_0x2ba35f){logger['info'](_0x9f31('0x1a'),_0x5ae6e2);logger[_0x9f31('0x24')](_0x9f31('0x1a'),_0x5ae6e2,JSON[_0x9f31('0x15')](_0x2ba35f));_0x33cf99(_0x2ba35f);})[_0x9f31('0x19')](function(_0x15671a){logger[_0x9f31('0x16')]('GetVoiceQueueRtPauses',_0x15671a[_0x9f31('0x17')],_0x5ae6e2);_0x1325ac(_0x22676a['error'](0x1f4,_0x15671a[_0x9f31('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5e066b2..5e4c286 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 _0x1261=['save','remove','update','emit','removeListener','userVoiceQueueRt:'];(function(_0x2e2f23,_0x1418fd){var _0x121d5e=function(_0x29b9ba){while(--_0x29b9ba){_0x2e2f23['push'](_0x2e2f23['shift']());}};_0x121d5e(++_0x1418fd);}(_0x1261,0x144));var _0x1126=function(_0x57b4cc,_0x2ae50e){_0x57b4cc=_0x57b4cc-0x0;var _0x45ba9d=_0x1261[_0x57b4cc];return _0x45ba9d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){UserVoiceQueueRtEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);UserVoiceQueueRtEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0xe548=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x3752e4,_0x135b91){var _0xe9702a=function(_0x3df84f){while(--_0x3df84f){_0x3752e4['push'](_0x3752e4['shift']());}};_0xe9702a(++_0x135b91);}(_0xe548,0x184));var _0x8e54=function(_0x3fb166,_0x4eb985){_0x3fb166=_0x3fb166-0x0;var _0x5e91be=_0xe548[_0x3fb166];return _0x5e91be;};'use strict';var UserVoiceQueueRtEvents=require(_0x8e54('0x0'));var events=[_0x8e54('0x1'),_0x8e54('0x2'),_0x8e54('0x3')];function createListener(_0x8824f6,_0x48a491){return function(_0x5d61b0){_0x48a491['emit'](_0x8824f6,_0x5d61b0);};}function removeListener(_0x4aa36a,_0x4b69ef){return function(){UserVoiceQueueRtEvents[_0x8e54('0x4')](_0x4aa36a,_0x4b69ef);};}exports['register']=function(_0x288be8){for(var _0x47a58d=0x0,_0xc6281c=events[_0x8e54('0x5')];_0x47a58d<_0xc6281c;_0x47a58d++){var _0x148c1f=events[_0x47a58d];var _0x3d6444=createListener(_0x8e54('0x6')+_0x148c1f,_0x288be8);UserVoiceQueueRtEvents['on'](_0x148c1f,_0x3d6444);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index b9137d7..bb870e2 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2de967,_0x1f6315){var _0x5d2dbb=function(_0xf45ae4){while(--_0xf45ae4){_0x2de967['push'](_0x2de967['shift']());}};_0x5d2dbb(++_0x1f6315);}(_0x70e0,0x17b));var _0x070e=function(_0x52a0ba,_0x5904db){_0x52a0ba=_0x52a0ba-0x0;var _0x5b9fa9=_0x70e0[_0x52a0ba];return _0x5b9fa9;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a90b1,_0x42d5db){var _0x17629a=function(_0x463c9f){while(--_0x463c9f){_0x4a90b1['push'](_0x4a90b1['shift']());}};_0x17629a(++_0x42d5db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xcb91[_0x2fd69d];return _0x5d5ef3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ed2a276..64ac177 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 _0x0084=['sequelize','exports'];(function(_0x4a4110,_0xf60292){var _0x5b02c9=function(_0x3017dc){while(--_0x3017dc){_0x4a4110['push'](_0x4a4110['shift']());}};_0x5b02c9(++_0xf60292);}(_0x0084,0x140));var _0x4008=function(_0x4ab80f,_0x5ab227){_0x4ab80f=_0x4ab80f-0x0;var _0x4a5699=_0x0084[_0x4ab80f];return _0x4a5699;};'use strict';var Sequelize=require(_0x4008('0x0'));module[_0x4008('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x50a9=['INTEGER','sequelize'];(function(_0x473914,_0x4565aa){var _0x43d95d=function(_0xdc1bd3){while(--_0xdc1bd3){_0x473914['push'](_0x473914['shift']());}};_0x43d95d(++_0x4565aa);}(_0x50a9,0x1d9));var _0x950a=function(_0x28f42d,_0x306db7){_0x28f42d=_0x28f42d-0x0;var _0x578610=_0x50a9[_0x28f42d];return _0x578610;};'use strict';var Sequelize=require(_0x950a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x950a('0x1')],'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 86dc80d..d101457 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 _0x484b=['../../config/logger','api','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x484b,0xa1));var _0xb484=function(_0xa5393,_0x14890a){_0xa5393=_0xa5393-0x0;var _0x1fb170=_0x484b[_0xa5393];return _0x1fb170;};'use strict';var _=require(_0xb484('0x0'));var util=require('util');var logger=require(_0xb484('0x1'))(_0xb484('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb484('0x3'));var fs=require('fs');var path=require(_0xb484('0x4'));var rimraf=require(_0xb484('0x5'));var config=require('../../config/environment');var attributes=require(_0xb484('0x6'));module[_0xb484('0x7')]=function(_0x112643,_0x3a3ad7){return _0x112643['define'](_0xb484('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9867=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger','api','request-promise','path'];(function(_0x1e75d,_0x2f948f){var _0x384205=function(_0x4438e5){while(--_0x4438e5){_0x1e75d['push'](_0x1e75d['shift']());}};_0x384205(++_0x2f948f);}(_0x9867,0x109));var _0x7986=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9867[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x7986('0x0'));var logger=require(_0x7986('0x1'))(_0x7986('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7986('0x3'));var fs=require('fs');var path=require(_0x7986('0x4'));var rimraf=require('rimraf');var config=require(_0x7986('0x5'));var attributes=require(_0x7986('0x6'));module[_0x7986('0x7')]=function(_0x21ee06,_0x372f55){return _0x21ee06[_0x7986('0x8')](_0x7986('0x9'),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 25861c7..0d32d24 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 _0xc0c4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x22ce9f,_0x59cc44){var _0x1fb33a=function(_0x587d48){while(--_0x587d48){_0x22ce9f['push'](_0x22ce9f['shift']());}};_0x1fb33a(++_0x59cc44);}(_0xc0c4,0x75));var _0x4c0c=function(_0x70281c,_0xe4b949){_0x70281c=_0x70281c-0x0;var _0x3e7998=_0xc0c4[_0x70281c];return _0x3e7998;};'use strict';var _=require('lodash');var util=require(_0x4c0c('0x0'));var moment=require('moment');var BPromise=require(_0x4c0c('0x1'));var rs=require(_0x4c0c('0x2'));var fs=require('fs');var Redis=require(_0x4c0c('0x3'));var db=require(_0x4c0c('0x4'))['db'];var utils=require(_0x4c0c('0x5'));var logger=require(_0x4c0c('0x6'))(_0x4c0c('0x7'));var config=require(_0x4c0c('0x8'));var jayson=require(_0x4c0c('0x9'));var client=jayson['client'][_0x4c0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fdab2,_0x2e7df8,_0x1c0524){return new BPromise(function(_0x21f8da,_0x27208d){return client[_0x4c0c('0xb')](_0x4fdab2,_0x1c0524)[_0x4c0c('0xc')](function(_0x12dd07){logger[_0x4c0c('0xd')](_0x4c0c('0xe'),_0x2e7df8,'request\x20sent');logger[_0x4c0c('0xf')](_0x4c0c('0x10'),_0x2e7df8,_0x4c0c('0x11'),JSON[_0x4c0c('0x12')](_0x12dd07));if(_0x12dd07['error']){if(_0x12dd07[_0x4c0c('0x13')][_0x4c0c('0x14')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2e7df8,_0x12dd07['error'][_0x4c0c('0x15')]);return _0x27208d(_0x12dd07['error'][_0x4c0c('0x15')]);}logger[_0x4c0c('0x13')](_0x4c0c('0xe'),_0x2e7df8,_0x12dd07[_0x4c0c('0x13')][_0x4c0c('0x15')]);return _0x21f8da(_0x12dd07[_0x4c0c('0x13')][_0x4c0c('0x15')]);}else{logger[_0x4c0c('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2e7df8,_0x4c0c('0x11'));_0x21f8da(_0x12dd07[_0x4c0c('0x16')][_0x4c0c('0x15')]);}})[_0x4c0c('0x17')](function(_0x3ca438){logger[_0x4c0c('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2e7df8,_0x3ca438);_0x27208d(_0x3ca438);});});} \ No newline at end of file +var _0x1df8=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch'];(function(_0x174e2f,_0x59e52b){var _0x4691ab=function(_0x1382f5){while(--_0x1382f5){_0x174e2f['push'](_0x174e2f['shift']());}};_0x4691ab(++_0x59e52b);}(_0x1df8,0x1a4));var _0x81df=function(_0x23d694,_0xb21f8f){_0x23d694=_0x23d694-0x0;var _0x4e4389=_0x1df8[_0x23d694];return _0x4e4389;};'use strict';var _=require('lodash');var util=require(_0x81df('0x0'));var moment=require(_0x81df('0x1'));var BPromise=require(_0x81df('0x2'));var rs=require(_0x81df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81df('0x4'))['db'];var utils=require(_0x81df('0x5'));var logger=require('../../config/logger')(_0x81df('0x6'));var config=require(_0x81df('0x7'));var jayson=require(_0x81df('0x8'));var client=jayson['client'][_0x81df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b7de0,_0x416b01,_0x406656){return new BPromise(function(_0x66d748,_0x2f5f93){return client['request'](_0x2b7de0,_0x406656)[_0x81df('0xa')](function(_0x5f077b){logger[_0x81df('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x416b01,_0x81df('0xc'));logger[_0x81df('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x416b01,_0x81df('0xc'),JSON['stringify'](_0x5f077b));if(_0x5f077b[_0x81df('0xe')]){if(_0x5f077b[_0x81df('0xe')][_0x81df('0xf')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x416b01,_0x5f077b[_0x81df('0xe')][_0x81df('0x10')]);return _0x2f5f93(_0x5f077b[_0x81df('0xe')][_0x81df('0x10')]);}logger[_0x81df('0xe')](_0x81df('0x11'),_0x416b01,_0x5f077b['error']['message']);return _0x66d748(_0x5f077b[_0x81df('0xe')]['message']);}else{logger[_0x81df('0xb')](_0x81df('0x11'),_0x416b01,_0x81df('0xc'));_0x66d748(_0x5f077b[_0x81df('0x12')][_0x81df('0x10')]);}})[_0x81df('0x13')](function(_0x2caf55){logger[_0x81df('0xe')](_0x81df('0x11'),_0x416b01,_0x2caf55);_0x2f5f93(_0x2caf55);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index cd70504..1dcc6e7 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 _0x0d4e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1201ce,_0x4b01d){var _0x526a56=function(_0xd5a561){while(--_0xd5a561){_0x1201ce['push'](_0x1201ce['shift']());}};_0x526a56(++_0x4b01d);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0d4e[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var path=require(_0xe0d4('0x2'));var timeout=require(_0xe0d4('0x3'));var express=require(_0xe0d4('0x4'));var router=express[_0xe0d4('0x5')]();var fs_extra=require(_0xe0d4('0x6'));var auth=require(_0xe0d4('0x7'));var interaction=require(_0xe0d4('0x8'));var config=require('../../config/environment');var controller=require(_0xe0d4('0x9'));router[_0xe0d4('0xa')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xc')]);router['get']('/:id',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xd')]);router[_0xe0d4('0xe')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xf')]);router[_0xe0d4('0x10')](_0xe0d4('0x11'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x12')]);router[_0xe0d4('0x13')](_0xe0d4('0x11'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb4e6=['express','Router','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38a6d4,_0x47cc89){var _0x4f9747=function(_0x24b1e4){while(--_0x24b1e4){_0x38a6d4['push'](_0x38a6d4['shift']());}};_0x4f9747(++_0x47cc89);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xb4e6[_0x38ce4c];return _0x5d4544;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require(_0x6b4e('0x1'));var path=require(_0x6b4e('0x2'));var timeout=require(_0x6b4e('0x3'));var express=require(_0x6b4e('0x4'));var router=express[_0x6b4e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6b4e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b4e('0x7'));var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0xd')]('/',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x10')]);router[_0x6b4e('0x11')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x12')]);module[_0x6b4e('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 14b1df8..ef82aea 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 _0x78cc=['STRING','name','sequelize'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x78cc,0x11c));var _0xc78c=function(_0x15953d,_0x5ab490){_0x15953d=_0x15953d-0x0;var _0x37f90d=_0x78cc[_0x15953d];return _0x37f90d;};'use strict';var Sequelize=require(_0xc78c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc78c('0x1')],'unique':_0xc78c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc78c('0x1')]}}; \ No newline at end of file +var _0xbeb0=['exports','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbeb0,0x15b));var _0x0beb=function(_0x58c92c,_0x131654){_0x58c92c=_0x58c92c-0x0;var _0x37ac3a=_0xbeb0[_0x58c92c];return _0x37ac3a;};'use strict';var Sequelize=require(_0x0beb('0x0'));module[_0x0beb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','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 a78db23..d22cc90 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 _0x5ffc=['count','set','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource','sendStatus','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','show','params','find','catch','create','body','user','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','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined'];(function(_0x71af0e,_0x55db52){var _0x5ec071=function(_0x5b05b2){while(--_0x5b05b2){_0x71af0e['push'](_0x71af0e['shift']());}};_0x5ec071(++_0x55db52);}(_0x5ffc,0xde));var _0xc5ff=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0x5ffc[_0x3ea022];return _0x3b97a2;};'use strict';var emlformat=require(_0xc5ff('0x0'));var rimraf=require(_0xc5ff('0x1'));var zipdir=require(_0xc5ff('0x2'));var jsonpatch=require(_0xc5ff('0x3'));var rp=require(_0xc5ff('0x4'));var moment=require(_0xc5ff('0x5'));var BPromise=require(_0xc5ff('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc5ff('0x7'));var sox=require(_0xc5ff('0x8'));var csv=require('to-csv');var ejs=require(_0xc5ff('0x9'));var fs=require('fs');var fs_extra=require(_0xc5ff('0xa'));var _=require(_0xc5ff('0xb'));var squel=require(_0xc5ff('0xc'));var crypto=require(_0xc5ff('0xd'));var jsforce=require(_0xc5ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc5ff('0xf'));var querystring=require(_0xc5ff('0x10'));var Papa=require(_0xc5ff('0x11'));var Redis=require(_0xc5ff('0x12'));var authService=require(_0xc5ff('0x13'));var qs=require(_0xc5ff('0x14'));var as=require(_0xc5ff('0x15'));var hardwareService=require(_0xc5ff('0x16'));var logger=require(_0xc5ff('0x17'))(_0xc5ff('0x18'));var utils=require(_0xc5ff('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc5ff('0x1a'))['db'];function respondWithStatusCode(_0x49ef59,_0x2957d0){_0x2957d0=_0x2957d0||0xcc;return function(_0x5aaad2){if(_0x5aaad2){return _0x49ef59['sendStatus'](_0x2957d0);}return _0x49ef59[_0xc5ff('0x1b')](_0x2957d0)[_0xc5ff('0x1c')]();};}function respondWithResult(_0x259494,_0x1937ed){_0x1937ed=_0x1937ed||0xc8;return function(_0x1cd39f){if(_0x1cd39f){return _0x259494[_0xc5ff('0x1b')](_0x1937ed)[_0xc5ff('0x1d')](_0x1cd39f);}};}function respondWithFilteredResult(_0x22978f,_0x514db9){return function(_0x1bf3ca){if(_0x1bf3ca){var _0x235b8e=typeof _0x514db9[_0xc5ff('0x1e')]==='undefined'&&typeof _0x514db9[_0xc5ff('0x1f')]===_0xc5ff('0x20');var _0x58327f=_0x1bf3ca['count'];var _0x192a68=_0x235b8e?0x0:_0x514db9[_0xc5ff('0x1e')];var _0xdccfd5=_0x235b8e?_0x1bf3ca[_0xc5ff('0x21')]:_0x514db9[_0xc5ff('0x1e')]+_0x514db9['limit'];var _0x42618d;if(_0xdccfd5>=_0x58327f){_0xdccfd5=_0x58327f;_0x42618d=0xc8;}else{_0x42618d=0xce;}_0x22978f['status'](_0x42618d);return _0x22978f[_0xc5ff('0x22')](_0xc5ff('0x23'),_0x192a68+'-'+_0xdccfd5+'/'+_0x58327f)[_0xc5ff('0x1d')](_0x1bf3ca);}return null;};}function patchUpdates(_0x2a9c6){return function(_0x29c1ee){try{jsonpatch[_0xc5ff('0x24')](_0x29c1ee,_0x2a9c6,!![]);}catch(_0x586d25){return BPromise[_0xc5ff('0x25')](_0x586d25);}return _0x29c1ee[_0xc5ff('0x26')]();};}function saveUpdates(_0x5dfcba,_0x38584a){return function(_0x5dc440){if(_0x5dc440){return _0x5dc440['update'](_0x5dfcba)[_0xc5ff('0x27')](function(_0x5e07ef){return _0x5e07ef;});}return null;};}function removeEntity(_0x4e22e3,_0x8f49e7){return function(_0x286b95){if(_0x286b95){return _0x286b95[_0xc5ff('0x28')]()[_0xc5ff('0x27')](function(){var _0x399ff1=_0x286b95[_0xc5ff('0x29')]({'plain':!![]});var _0x274dd1=_0xc5ff('0x2a');return db[_0xc5ff('0x2b')]['destroy']({'where':{'type':_0x274dd1,'resourceId':_0x399ff1['id']}})[_0xc5ff('0x27')](function(){return _0x286b95;});})[_0xc5ff('0x27')](function(){_0x4e22e3[_0xc5ff('0x1b')](0xcc)[_0xc5ff('0x1c')]();});}};}function handleEntityNotFound(_0x321b7c,_0x545bd5){return function(_0x459f1a){if(!_0x459f1a){_0x321b7c[_0xc5ff('0x2c')](0x194);}return _0x459f1a;};}function handleError(_0x273624,_0x9e0742){_0x9e0742=_0x9e0742||0x1f4;return function(_0x21a6ec){logger[_0xc5ff('0x2d')](_0x21a6ec['stack']);if(_0x21a6ec[_0xc5ff('0x2e')]){delete _0x21a6ec[_0xc5ff('0x2e')];}_0x273624[_0xc5ff('0x1b')](_0x9e0742)[_0xc5ff('0x2f')](_0x21a6ec);};}exports[_0xc5ff('0x30')]=function(_0x18ab25,_0x442322){var _0x50c66c={},_0x2a7cb1={},_0x248827={'count':0x0,'rows':[]};var _0x269498=_[_0xc5ff('0x31')](db[_0xc5ff('0x32')][_0xc5ff('0x33')],function(_0x154769){return{'name':_0x154769[_0xc5ff('0x34')],'type':_0x154769[_0xc5ff('0x35')][_0xc5ff('0x36')]};});_0x2a7cb1[_0xc5ff('0x37')]=_['map'](_0x269498,_0xc5ff('0x2e'));_0x2a7cb1[_0xc5ff('0x38')]=_[_0xc5ff('0x39')](_0x18ab25['query']);_0x2a7cb1[_0xc5ff('0x3a')]=_[_0xc5ff('0x3b')](_0x2a7cb1[_0xc5ff('0x37')],_0x2a7cb1[_0xc5ff('0x38')]);_0x50c66c[_0xc5ff('0x3c')]=_['intersection'](_0x2a7cb1[_0xc5ff('0x37')],qs['fields'](_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x3d')]));_0x50c66c[_0xc5ff('0x3c')]=_0x50c66c[_0xc5ff('0x3c')][_0xc5ff('0x3e')]?_0x50c66c['attributes']:_0x2a7cb1[_0xc5ff('0x37')];if(!_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x3f')](_0xc5ff('0x40'))){_0x50c66c[_0xc5ff('0x1f')]=qs[_0xc5ff('0x1f')](_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x1f')]);_0x50c66c[_0xc5ff('0x1e')]=qs[_0xc5ff('0x1e')](_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x1e')]);}_0x50c66c[_0xc5ff('0x41')]=qs['sort'](_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x42')]);_0x50c66c[_0xc5ff('0x43')]=qs[_0xc5ff('0x3a')](_['pick'](_0x18ab25[_0xc5ff('0x38')],_0x2a7cb1[_0xc5ff('0x3a')]),_0x269498);if(_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x44')]){_0x50c66c['where']=_[_0xc5ff('0x45')](_0x50c66c[_0xc5ff('0x43')],{'$or':_[_0xc5ff('0x31')](_0x269498,function(_0xcaa313){if(_0xcaa313['type']!==_0xc5ff('0x46')){var _0x11daee={};_0x11daee[_0xcaa313[_0xc5ff('0x2e')]]={'$like':'%'+_0x18ab25['query']['filter']+'%'};return _0x11daee;}})});}_0x50c66c=_[_0xc5ff('0x45')]({},_0x50c66c,_0x18ab25['options']);var _0x537e68={'where':_0x50c66c[_0xc5ff('0x43')]};return db['Variable'][_0xc5ff('0x21')](_0x537e68)['then'](function(_0x190fd6){_0x248827['count']=_0x190fd6;if(_0x18ab25[_0xc5ff('0x38')][_0xc5ff('0x47')]){_0x50c66c[_0xc5ff('0x48')]=[{'all':!![]}];}return db[_0xc5ff('0x32')]['findAll'](_0x50c66c);})[_0xc5ff('0x27')](function(_0x9e10af){_0x248827['rows']=_0x9e10af;return _0x248827;})[_0xc5ff('0x27')](respondWithFilteredResult(_0x442322,_0x50c66c))['catch'](handleError(_0x442322,null));};exports[_0xc5ff('0x49')]=function(_0xaa1f64,_0x312358){var _0x30fafc={'raw':!![],'where':{'id':_0xaa1f64[_0xc5ff('0x4a')]['id']}},_0x75b02d={};_0x75b02d[_0xc5ff('0x37')]=_[_0xc5ff('0x39')](db['Variable'][_0xc5ff('0x33')]);_0x75b02d[_0xc5ff('0x38')]=_[_0xc5ff('0x39')](_0xaa1f64['query']);_0x75b02d[_0xc5ff('0x3a')]=_[_0xc5ff('0x3b')](_0x75b02d[_0xc5ff('0x37')],_0x75b02d[_0xc5ff('0x38')]);_0x30fafc[_0xc5ff('0x3c')]=_[_0xc5ff('0x3b')](_0x75b02d[_0xc5ff('0x37')],qs['fields'](_0xaa1f64['query']['fields']));_0x30fafc[_0xc5ff('0x3c')]=_0x30fafc[_0xc5ff('0x3c')]['length']?_0x30fafc[_0xc5ff('0x3c')]:_0x75b02d['model'];if(_0xaa1f64[_0xc5ff('0x38')][_0xc5ff('0x47')]){_0x30fafc[_0xc5ff('0x48')]=[{'all':!![]}];}_0x30fafc=_['merge']({},_0x30fafc,_0xaa1f64['options']);return db['Variable'][_0xc5ff('0x4b')](_0x30fafc)[_0xc5ff('0x27')](handleEntityNotFound(_0x312358,null))['then'](respondWithResult(_0x312358,null))[_0xc5ff('0x4c')](handleError(_0x312358,null));};exports[_0xc5ff('0x4d')]=function(_0xc2d7bc,_0xe38682){return db['Variable']['create'](_0xc2d7bc[_0xc5ff('0x4e')],{})[_0xc5ff('0x27')](function(_0x168b05){var _0x10a310=_0xc2d7bc[_0xc5ff('0x4f')][_0xc5ff('0x29')]({'plain':!![]});if(!_0x10a310)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10a310[_0xc5ff('0x50')]===_0xc5ff('0x4f')){var _0x30e57e=_0x168b05['get']({'plain':!![]});var _0xa51739=_0xc5ff('0x2a');return db[_0xc5ff('0x51')][_0xc5ff('0x4b')]({'where':{'name':_0xa51739,'userProfileId':_0x10a310[_0xc5ff('0x52')]},'raw':!![]})['then'](function(_0x1c863f){if(_0x1c863f&&_0x1c863f[_0xc5ff('0x53')]===0x0){return db['UserProfileResource'][_0xc5ff('0x4d')]({'name':_0x30e57e[_0xc5ff('0x2e')],'resourceId':_0x30e57e['id'],'type':_0x1c863f[_0xc5ff('0x2e')],'sectionId':_0x1c863f['id']},{})[_0xc5ff('0x27')](function(){return _0x168b05;});}else{return _0x168b05;}})[_0xc5ff('0x4c')](function(_0x162735){logger[_0xc5ff('0x2d')](_0xc5ff('0x54'),_0x162735);throw _0x162735;});}return _0x168b05;})[_0xc5ff('0x27')](respondWithResult(_0xe38682,0xc9))[_0xc5ff('0x4c')](handleError(_0xe38682,null));};exports['update']=function(_0x68512b,_0x32a1f0){if(_0x68512b[_0xc5ff('0x4e')]['id']){delete _0x68512b['body']['id'];}return db[_0xc5ff('0x32')][_0xc5ff('0x4b')]({'where':{'id':_0x68512b[_0xc5ff('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32a1f0,null))[_0xc5ff('0x27')](saveUpdates(_0x68512b[_0xc5ff('0x4e')],null))[_0xc5ff('0x27')](respondWithResult(_0x32a1f0,null))[_0xc5ff('0x4c')](handleError(_0x32a1f0,null));};exports[_0xc5ff('0x28')]=function(_0x4d751c,_0x378aca){return db[_0xc5ff('0x32')]['find']({'where':{'id':_0x4d751c[_0xc5ff('0x4a')]['id']}})[_0xc5ff('0x27')](handleEntityNotFound(_0x378aca,null))[_0xc5ff('0x27')](removeEntity(_0x378aca,null))[_0xc5ff('0x4c')](handleError(_0x378aca,null));}; \ No newline at end of file +var _0xd1dd=['fields','length','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','then','sendStatus','error','name','send','index','Variable','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes'];(function(_0x5aedf7,_0x2d61a8){var _0x430fc0=function(_0x3a923f){while(--_0x3a923f){_0x5aedf7['push'](_0x5aedf7['shift']());}};_0x430fc0(++_0x2d61a8);}(_0xd1dd,0x1ad));var _0xdd1d=function(_0x3fd72c,_0x57a552){_0x3fd72c=_0x3fd72c-0x0;var _0x3f1692=_0xd1dd[_0x3fd72c];return _0x3f1692;};'use strict';var emlformat=require(_0xdd1d('0x0'));var rimraf=require(_0xdd1d('0x1'));var zipdir=require(_0xdd1d('0x2'));var jsonpatch=require(_0xdd1d('0x3'));var rp=require(_0xdd1d('0x4'));var moment=require('moment');var BPromise=require(_0xdd1d('0x5'));var Mustache=require(_0xdd1d('0x6'));var util=require('util');var path=require(_0xdd1d('0x7'));var sox=require('sox');var csv=require(_0xdd1d('0x8'));var ejs=require(_0xdd1d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd1d('0xa'));var squel=require(_0xdd1d('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd1d('0xc'));var deskjs=require(_0xdd1d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd1d('0xe'));var Papa=require(_0xdd1d('0xf'));var Redis=require(_0xdd1d('0x10'));var authService=require(_0xdd1d('0x11'));var qs=require(_0xdd1d('0x12'));var as=require(_0xdd1d('0x13'));var hardwareService=require(_0xdd1d('0x14'));var logger=require('../../config/logger')(_0xdd1d('0x15'));var utils=require(_0xdd1d('0x16'));var config=require(_0xdd1d('0x17'));var licenseUtil=require(_0xdd1d('0x18'));var db=require(_0xdd1d('0x19'))['db'];function respondWithStatusCode(_0xd879fc,_0x582d0d){_0x582d0d=_0x582d0d||0xcc;return function(_0x3437d2){if(_0x3437d2){return _0xd879fc['sendStatus'](_0x582d0d);}return _0xd879fc['status'](_0x582d0d)[_0xdd1d('0x1a')]();};}function respondWithResult(_0x561e0f,_0x450a5e){_0x450a5e=_0x450a5e||0xc8;return function(_0x1c0b0d){if(_0x1c0b0d){return _0x561e0f[_0xdd1d('0x1b')](_0x450a5e)[_0xdd1d('0x1c')](_0x1c0b0d);}};}function respondWithFilteredResult(_0x20d73f,_0x38ed62){return function(_0x5021ee){if(_0x5021ee){var _0xb68547=typeof _0x38ed62[_0xdd1d('0x1d')]===_0xdd1d('0x1e')&&typeof _0x38ed62[_0xdd1d('0x1f')]===_0xdd1d('0x1e');var _0x4a4965=_0x5021ee[_0xdd1d('0x20')];var _0x355290=_0xb68547?0x0:_0x38ed62[_0xdd1d('0x1d')];var _0x40c3af=_0xb68547?_0x5021ee[_0xdd1d('0x20')]:_0x38ed62[_0xdd1d('0x1d')]+_0x38ed62[_0xdd1d('0x1f')];var _0x191da9;if(_0x40c3af>=_0x4a4965){_0x40c3af=_0x4a4965;_0x191da9=0xc8;}else{_0x191da9=0xce;}_0x20d73f[_0xdd1d('0x1b')](_0x191da9);return _0x20d73f[_0xdd1d('0x21')]('Content-Range',_0x355290+'-'+_0x40c3af+'/'+_0x4a4965)[_0xdd1d('0x1c')](_0x5021ee);}return null;};}function patchUpdates(_0x583c8c){return function(_0x218b39){try{jsonpatch[_0xdd1d('0x22')](_0x218b39,_0x583c8c,!![]);}catch(_0xf6ee8a){return BPromise[_0xdd1d('0x23')](_0xf6ee8a);}return _0x218b39[_0xdd1d('0x24')]();};}function saveUpdates(_0x425dcf,_0x450545){return function(_0x29c06e){if(_0x29c06e){return _0x29c06e[_0xdd1d('0x25')](_0x425dcf)['then'](function(_0x52aa1c){return _0x52aa1c;});}return null;};}function removeEntity(_0x4e84ba,_0x4866f6){return function(_0x554d89){if(_0x554d89){return _0x554d89[_0xdd1d('0x26')]()['then'](function(){var _0x421e3e=_0x554d89[_0xdd1d('0x27')]({'plain':!![]});var _0x4d3ebb='Variables';return db['UserProfileResource'][_0xdd1d('0x26')]({'where':{'type':_0x4d3ebb,'resourceId':_0x421e3e['id']}})['then'](function(){return _0x554d89;});})[_0xdd1d('0x28')](function(){_0x4e84ba['status'](0xcc)[_0xdd1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f9de5,_0x2f2f0d){return function(_0x52ebf4){if(!_0x52ebf4){_0x3f9de5[_0xdd1d('0x29')](0x194);}return _0x52ebf4;};}function handleError(_0x5ba010,_0x4516e1){_0x4516e1=_0x4516e1||0x1f4;return function(_0xed7c69){logger[_0xdd1d('0x2a')](_0xed7c69['stack']);if(_0xed7c69[_0xdd1d('0x2b')]){delete _0xed7c69[_0xdd1d('0x2b')];}_0x5ba010['status'](_0x4516e1)[_0xdd1d('0x2c')](_0xed7c69);};}exports[_0xdd1d('0x2d')]=function(_0x56340b,_0x3848fc){var _0x1107a4={},_0x33ea1f={},_0x194771={'count':0x0,'rows':[]};var _0xb230f9=_['map'](db[_0xdd1d('0x2e')][_0xdd1d('0x2f')],function(_0x56b88a){return{'name':_0x56b88a[_0xdd1d('0x30')],'type':_0x56b88a[_0xdd1d('0x31')][_0xdd1d('0x32')]};});_0x33ea1f[_0xdd1d('0x33')]=_[_0xdd1d('0x34')](_0xb230f9,_0xdd1d('0x2b'));_0x33ea1f[_0xdd1d('0x35')]=_['keys'](_0x56340b[_0xdd1d('0x35')]);_0x33ea1f[_0xdd1d('0x36')]=_[_0xdd1d('0x37')](_0x33ea1f[_0xdd1d('0x33')],_0x33ea1f[_0xdd1d('0x35')]);_0x1107a4[_0xdd1d('0x38')]=_[_0xdd1d('0x37')](_0x33ea1f[_0xdd1d('0x33')],qs[_0xdd1d('0x39')](_0x56340b[_0xdd1d('0x35')]['fields']));_0x1107a4[_0xdd1d('0x38')]=_0x1107a4[_0xdd1d('0x38')][_0xdd1d('0x3a')]?_0x1107a4[_0xdd1d('0x38')]:_0x33ea1f[_0xdd1d('0x33')];if(!_0x56340b['query']['hasOwnProperty']('nolimit')){_0x1107a4[_0xdd1d('0x1f')]=qs[_0xdd1d('0x1f')](_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x1f')]);_0x1107a4[_0xdd1d('0x1d')]=qs[_0xdd1d('0x1d')](_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x1d')]);}_0x1107a4[_0xdd1d('0x3b')]=qs['sort'](_0x56340b[_0xdd1d('0x35')]['sort']);_0x1107a4[_0xdd1d('0x3c')]=qs[_0xdd1d('0x36')](_[_0xdd1d('0x3d')](_0x56340b['query'],_0x33ea1f[_0xdd1d('0x36')]),_0xb230f9);if(_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x3e')]){_0x1107a4['where']=_['merge'](_0x1107a4[_0xdd1d('0x3c')],{'$or':_[_0xdd1d('0x34')](_0xb230f9,function(_0x4ac998){if(_0x4ac998[_0xdd1d('0x31')]!==_0xdd1d('0x3f')){var _0x313c29={};_0x313c29[_0x4ac998['name']]={'$like':'%'+_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x3e')]+'%'};return _0x313c29;}})});}_0x1107a4=_[_0xdd1d('0x40')]({},_0x1107a4,_0x56340b[_0xdd1d('0x41')]);var _0xc8eb9c={'where':_0x1107a4[_0xdd1d('0x3c')]};return db[_0xdd1d('0x2e')][_0xdd1d('0x20')](_0xc8eb9c)['then'](function(_0x2fd576){_0x194771[_0xdd1d('0x20')]=_0x2fd576;if(_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x42')]){_0x1107a4[_0xdd1d('0x43')]=[{'all':!![]}];}return db[_0xdd1d('0x2e')][_0xdd1d('0x44')](_0x1107a4);})[_0xdd1d('0x28')](function(_0x13ed62){_0x194771[_0xdd1d('0x45')]=_0x13ed62;return _0x194771;})['then'](respondWithFilteredResult(_0x3848fc,_0x1107a4))[_0xdd1d('0x46')](handleError(_0x3848fc,null));};exports[_0xdd1d('0x47')]=function(_0x1c0913,_0x46d0db){var _0x6fa873={'raw':!![],'where':{'id':_0x1c0913[_0xdd1d('0x48')]['id']}},_0x52ab48={};_0x52ab48[_0xdd1d('0x33')]=_[_0xdd1d('0x49')](db[_0xdd1d('0x2e')][_0xdd1d('0x2f')]);_0x52ab48[_0xdd1d('0x35')]=_[_0xdd1d('0x49')](_0x1c0913['query']);_0x52ab48[_0xdd1d('0x36')]=_[_0xdd1d('0x37')](_0x52ab48[_0xdd1d('0x33')],_0x52ab48[_0xdd1d('0x35')]);_0x6fa873[_0xdd1d('0x38')]=_['intersection'](_0x52ab48[_0xdd1d('0x33')],qs['fields'](_0x1c0913[_0xdd1d('0x35')][_0xdd1d('0x39')]));_0x6fa873[_0xdd1d('0x38')]=_0x6fa873[_0xdd1d('0x38')]['length']?_0x6fa873['attributes']:_0x52ab48[_0xdd1d('0x33')];if(_0x1c0913['query'][_0xdd1d('0x42')]){_0x6fa873['include']=[{'all':!![]}];}_0x6fa873=_['merge']({},_0x6fa873,_0x1c0913['options']);return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')](_0x6fa873)[_0xdd1d('0x28')](handleEntityNotFound(_0x46d0db,null))[_0xdd1d('0x28')](respondWithResult(_0x46d0db,null))[_0xdd1d('0x46')](handleError(_0x46d0db,null));};exports[_0xdd1d('0x4b')]=function(_0xca5ea6,_0x2aced5){return db[_0xdd1d('0x2e')][_0xdd1d('0x4b')](_0xca5ea6[_0xdd1d('0x4c')],{})[_0xdd1d('0x28')](function(_0xee2b42){var _0x10154c=_0xca5ea6[_0xdd1d('0x4d')][_0xdd1d('0x27')]({'plain':!![]});if(!_0x10154c)throw new Error(_0xdd1d('0x4e'));if(_0x10154c['role']===_0xdd1d('0x4d')){var _0x1142d9=_0xee2b42['get']({'plain':!![]});var _0xbabf09='Variables';return db['UserProfileSection'][_0xdd1d('0x4a')]({'where':{'name':_0xbabf09,'userProfileId':_0x10154c['userProfileId']},'raw':!![]})[_0xdd1d('0x28')](function(_0x127861){if(_0x127861&&_0x127861[_0xdd1d('0x4f')]===0x0){return db['UserProfileResource'][_0xdd1d('0x4b')]({'name':_0x1142d9[_0xdd1d('0x2b')],'resourceId':_0x1142d9['id'],'type':_0x127861[_0xdd1d('0x2b')],'sectionId':_0x127861['id']},{})[_0xdd1d('0x28')](function(){return _0xee2b42;});}else{return _0xee2b42;}})[_0xdd1d('0x46')](function(_0x46d8a7){logger[_0xdd1d('0x2a')](_0xdd1d('0x50'),_0x46d8a7);throw _0x46d8a7;});}return _0xee2b42;})['then'](respondWithResult(_0x2aced5,0xc9))[_0xdd1d('0x46')](handleError(_0x2aced5,null));};exports[_0xdd1d('0x25')]=function(_0x456253,_0x2e9daf){if(_0x456253['body']['id']){delete _0x456253['body']['id'];}return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')]({'where':{'id':_0x456253['params']['id']}})[_0xdd1d('0x28')](handleEntityNotFound(_0x2e9daf,null))['then'](saveUpdates(_0x456253[_0xdd1d('0x4c')],null))[_0xdd1d('0x28')](respondWithResult(_0x2e9daf,null))[_0xdd1d('0x46')](handleError(_0x2e9daf,null));};exports['destroy']=function(_0x879418,_0x4f9d2a){return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')]({'where':{'id':_0x879418[_0xdd1d('0x48')]['id']}})[_0xdd1d('0x28')](handleEntityNotFound(_0x4f9d2a,null))[_0xdd1d('0x28')](removeEntity(_0x4f9d2a,null))[_0xdd1d('0x46')](handleError(_0x4f9d2a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 45e0809..093bd0c 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 _0x0758=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','Variable','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0758,0xa3));var _0x8075=function(_0x5630d1,_0x5f2cba){_0x5630d1=_0x5630d1-0x0;var _0x12128f=_0x0758[_0x5630d1];return _0x12128f;};'use strict';var _=require(_0x8075('0x0'));var util=require(_0x8075('0x1'));var logger=require(_0x8075('0x2'))('api');var moment=require(_0x8075('0x3'));var BPromise=require(_0x8075('0x4'));var rp=require(_0x8075('0x5'));var fs=require('fs');var path=require(_0x8075('0x6'));var rimraf=require(_0x8075('0x7'));var config=require(_0x8075('0x8'));var attributes=require(_0x8075('0x9'));module['exports']=function(_0x1a5dcc,_0x3dbfaf){return _0x1a5dcc['define'](_0x8075('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51cb=['bluebird','request-promise','path','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x51cb,0x98));var _0xb51c=function(_0x2498d7,_0x58359a){_0x2498d7=_0x2498d7-0x0;var _0xb76621=_0x51cb[_0x2498d7];return _0xb76621;};'use strict';var _=require(_0xb51c('0x0'));var util=require(_0xb51c('0x1'));var logger=require('../../config/logger')(_0xb51c('0x2'));var moment=require(_0xb51c('0x3'));var BPromise=require(_0xb51c('0x4'));var rp=require(_0xb51c('0x5'));var fs=require('fs');var path=require(_0xb51c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb51c('0x7'));module[_0xb51c('0x8')]=function(_0x3ed0d8,_0x47fdf2){return _0x3ed0d8[_0xb51c('0x9')](_0xb51c('0xa'),attributes,{'tableName':_0xb51c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 169840a..8e49e21 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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x31603a,_0x5aa3d6){var _0x5c6792=function(_0x4a2224){while(--_0x4a2224){_0x31603a['push'](_0x31603a['shift']());}};_0x5c6792(++_0x5aa3d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x350832,_0x27de90){_0x350832=_0x350832-0x0;var _0x5cb596=_0x6aa7[_0x350832];return _0x5cb596;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x1cb9,0x14e));var _0x91cb=function(_0x52519f,_0x5e05fc){_0x52519f=_0x52519f-0x0;var _0x39d514=_0x1cb9[_0x52519f];return _0x39d514;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d04ba3e..9831232 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 _0x5622=['/migrations','migrations','exports','express','Router','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','restart'];(function(_0x63d870,_0x1936ec){var _0x549979=function(_0x22be8e){while(--_0x22be8e){_0x63d870['push'](_0x63d870['shift']());}};_0x549979(++_0x1936ec);}(_0x5622,0xa3));var _0x2562=function(_0x3e00b6,_0xca563b){_0x3e00b6=_0x3e00b6-0x0;var _0x4dcf6b=_0x5622[_0x3e00b6];return _0x4dcf6b;};'use strict';var express=require(_0x2562('0x0'));var router=express[_0x2562('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x2562('0x2'));router[_0x2562('0x3')]('/',controller[_0x2562('0x4')]);router['get']('/fetch',auth[_0x2562('0x5')](),auth[_0x2562('0x6')](),controller[_0x2562('0x7')]);router[_0x2562('0x3')](_0x2562('0x8'),auth[_0x2562('0x5')](),auth[_0x2562('0x6')](),controller[_0x2562('0x9')]);router[_0x2562('0x3')](_0x2562('0xa'),auth[_0x2562('0x5')](),auth[_0x2562('0x6')](),controller[_0x2562('0xb')]);router[_0x2562('0x3')]('/restart',auth[_0x2562('0x5')](),controller[_0x2562('0xc')]);router['get'](_0x2562('0xd'),controller[_0x2562('0xe')]);module[_0x2562('0xf')]=router; \ No newline at end of file +var _0x36ce=['/reset','/pull','pull','restart','/migrations','exports','express','./version.controller','get','index','isAuthenticated','canUpdate'];(function(_0x26aaec,_0x2c5b3a){var _0x44cc7a=function(_0x107eb8){while(--_0x107eb8){_0x26aaec['push'](_0x26aaec['shift']());}};_0x44cc7a(++_0x2c5b3a);}(_0x36ce,0xae));var _0xe36c=function(_0x4b246b,_0x205a11){_0x4b246b=_0x4b246b-0x0;var _0x1baead=_0x36ce[_0x4b246b];return _0x1baead;};'use strict';var express=require(_0xe36c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe36c('0x1'));router[_0xe36c('0x2')]('/',controller[_0xe36c('0x3')]);router[_0xe36c('0x2')]('/fetch',auth[_0xe36c('0x4')](),auth[_0xe36c('0x5')](),controller['fetch']);router['get'](_0xe36c('0x6'),auth[_0xe36c('0x4')](),auth['canUpdate'](),controller['reset']);router[_0xe36c('0x2')](_0xe36c('0x7'),auth[_0xe36c('0x4')](),auth['canUpdate'](),controller[_0xe36c('0x8')]);router[_0xe36c('0x2')]('/restart',auth[_0xe36c('0x4')](),controller[_0xe36c('0x9')]);router[_0xe36c('0x2')](_0xe36c('0xa'),controller['migrations']);module[_0xe36c('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index eaf8a01..b54177e 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 _0x81c6=['version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','query','tags','latest','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x81c6,0x105));var _0x681c=function(_0x43c3db,_0x36ea7b){_0x43c3db=_0x43c3db-0x0;var _0x45e6b0=_0x81c6[_0x43c3db];return _0x45e6b0;};'use strict';var Umzug=require(_0x681c('0x0'));var path=require(_0x681c('0x1'));var fs=require('fs');var _=require(_0x681c('0x2'));var pkginfo=require(_0x681c('0x3'))(module,_0x681c('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x681c('0x5'))[_0x681c('0x6')];var db=require(_0x681c('0x7'))['db'];var config=require(_0x681c('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x681c('0x9'))(_0x681c('0xa'));var git=require('simple-git')(config['root']);exports['index']=function(_0x3e6415,_0x3adeba){var _0x273d24={'current':module['exports']['version'],'phonebar':0x2};if(_0x3e6415['query']&&_0x3e6415[_0x681c('0xb')]['latest']){return git['fetch']()[_0x681c('0xc')](function(_0x15a55c,_0x22493f){_0x273d24[_0x681c('0xd')]=(_0x15a55c?module[_0x681c('0xe')][_0x681c('0x4')]:_0x22493f[_0x681c('0xd')])||_0x681c('0xf');return _0x3adeba[_0x681c('0x10')](0xc8)[_0x681c('0x11')](_0x273d24);});}else{return _0x3adeba[_0x681c('0x10')](0xc8)[_0x681c('0x11')](_0x273d24);}};exports['fetch']=function(_0x180d43,_0x403a5f){return git['fetch']([_0x681c('0x12'),_0x681c('0x13')],function(_0x28fbb7){if(_0x28fbb7){logger[_0x681c('0x14')](_0x28fbb7);return _0x403a5f[_0x681c('0x10')](0x1f4)[_0x681c('0x11')](_0x28fbb7);}logger[_0x681c('0x15')](_0x681c('0x16'));return _0x403a5f[_0x681c('0x10')](0xc8)[_0x681c('0x11')]({'output':_0x681c('0x17')});});};exports[_0x681c('0x18')]=function(_0x39d32f,_0x5667d7){return git[_0x681c('0x18')]([_0x681c('0x19'),_0x681c('0x1a')],function(_0x504530){if(_0x504530){logger[_0x681c('0x14')](_0x504530);return _0x5667d7[_0x681c('0x10')](0x1f4)[_0x681c('0x11')](_0x504530);}logger[_0x681c('0x15')](_0x681c('0x1b'));return _0x5667d7[_0x681c('0x10')](0xc8)['json']({'output':_0x681c('0x1c')});});};exports['pull']=function(_0x90787f,_0x2da68c){exec('npm\x20install\x20--production',function(_0x59a453,_0x5d9bb3,_0x20e747){logger['info'](_0x5d9bb3);logger[_0x681c('0x15')](_0x20e747);if(_0x59a453){logger['error'](_0x59a453);return _0x2da68c[_0x681c('0x10')](0x1f4)[_0x681c('0x11')](_0x59a453);}return _0x2da68c[_0x681c('0x10')](0xc8)['json']({'output':_0x5d9bb3});});};exports[_0x681c('0x1d')]=function(_0x1bda95,_0x40f557){return pm2[_0x681c('0x1d')](_0x681c('0x1e'))['then'](function(_0x27de8f){logger[_0x681c('0x15')](_0x681c('0x1f'),_0x27de8f);return _0x40f557['status'](0xc8)[_0x681c('0x11')]({'output':_0x681c('0x20')});})[_0x681c('0x21')](function(_0x2e5aa2){logger[_0x681c('0x14')](_0x2e5aa2);return _0x40f557['status'](0x1f4)[_0x681c('0x11')](_0x2e5aa2);});};exports[_0x681c('0x22')]=function(_0x3a930b,_0x2efe04){var _0x25b3a4=fs[_0x681c('0x23')](path[_0x681c('0x24')](config[_0x681c('0x25')],_0x681c('0x26'),_0x681c('0x22')));var _0x1e64d3=[];for(var _0x444627=0x0;_0x444627<_0x25b3a4[_0x681c('0x27')];_0x444627++){var _0x52495a=_0x25b3a4[_0x444627][_0x681c('0x28')]('.js','');if(compareVersions(module['exports'][_0x681c('0x4')],_0x52495a)===-0x1){_0x1e64d3[_0x681c('0x29')](_0x52495a);}}if(_0x1e64d3['length']){var _0x20404b=_0x1e64d3[_0x681c('0x2a')](compareVersions);var _0x5e5681=new Umzug({'storage':_0x681c('0x2b'),'storageOptions':{'model':db[_0x681c('0x2c')],'modelName':_0x681c('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x681c('0x2b')][_0x681c('0x2d')](),db[_0x681c('0x2b')]['constructor'],function(){throw new Error(_0x681c('0x2e'));}],'path':path[_0x681c('0x24')](config[_0x681c('0x25')],'server','migrations'),'pattern':/\.js$/}});_0x5e5681['up']({'migrations':_['map'](_0x20404b,function(_0x597e05){return _0x597e05+'.js';})})[_0x681c('0x2f')](function(){return _0x2efe04[_0x681c('0x10')](0xc8)[_0x681c('0x11')]({'output':_0x681c('0x30')+module[_0x681c('0xe')][_0x681c('0x4')]+_0x681c('0x31')+_[_0x681c('0x32')](_0x20404b),'migrations':_[_0x681c('0x24')](_0x20404b)});})[_0x681c('0x21')](function(_0x3d5127){if(_0x3d5127 instanceof db['sequelize'][_0x681c('0x33')]){return _0x2efe04[_0x681c('0x10')](0xc8)[_0x681c('0x11')]({'output':_0x681c('0x34')});}else{return _0x2efe04[_0x681c('0x10')](0x1f4)[_0x681c('0x11')](_0x3d5127);}});}else{return _0x2efe04[_0x681c('0x10')](0xc8)[_0x681c('0x11')]({'output':_0x681c('0x34')});}}; \ No newline at end of file +var _0xcad8=['.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','exports','query','latest','fetch','tags','status','origin','master','error','json','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','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','migrations','readdirSync','join','root','server','length','replace','push','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0xcad8,0x1ae));var _0x8cad=function(_0x9000c5,_0x1ca4d6){_0x9000c5=_0x9000c5-0x0;var _0x4f94c7=_0xcad8[_0x9000c5];return _0x4f94c7;};'use strict';var Umzug=require(_0x8cad('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x8cad('0x1'));var pkginfo=require(_0x8cad('0x2'))(module,_0x8cad('0x3'));var compareVersions=require(_0x8cad('0x4'));var exec=require('child_process')[_0x8cad('0x5')];var db=require(_0x8cad('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x8cad('0x7'));var logger=require(_0x8cad('0x8'))(_0x8cad('0x9'));var git=require(_0x8cad('0xa'))(config['root']);exports['index']=function(_0x4c7e53,_0x48aeba){var _0x16890c={'current':module[_0x8cad('0xb')][_0x8cad('0x3')],'phonebar':0x2};if(_0x4c7e53[_0x8cad('0xc')]&&_0x4c7e53[_0x8cad('0xc')][_0x8cad('0xd')]){return git[_0x8cad('0xe')]()[_0x8cad('0xf')](function(_0x46114c,_0x4e86e3){_0x16890c['latest']=(_0x46114c?module[_0x8cad('0xb')][_0x8cad('0x3')]:_0x4e86e3[_0x8cad('0xd')])||'2.0.0';return _0x48aeba[_0x8cad('0x10')](0xc8)['json'](_0x16890c);});}else{return _0x48aeba[_0x8cad('0x10')](0xc8)['json'](_0x16890c);}};exports[_0x8cad('0xe')]=function(_0x18b6f7,_0x1cbe59){return git[_0x8cad('0xe')]([_0x8cad('0x11'),_0x8cad('0x12')],function(_0x132a91){if(_0x132a91){logger[_0x8cad('0x13')](_0x132a91);return _0x1cbe59[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x132a91);}logger['info'](_0x8cad('0x15'));return _0x1cbe59[_0x8cad('0x10')](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x16')});});};exports[_0x8cad('0x17')]=function(_0x1e8117,_0x12b284){return git[_0x8cad('0x17')]([_0x8cad('0x18'),_0x8cad('0x19')],function(_0x43fd8f){if(_0x43fd8f){logger[_0x8cad('0x13')](_0x43fd8f);return _0x12b284['status'](0x1f4)['json'](_0x43fd8f);}logger[_0x8cad('0x1a')](_0x8cad('0x1b'));return _0x12b284[_0x8cad('0x10')](0xc8)['json']({'output':_0x8cad('0x1c')});});};exports[_0x8cad('0x1d')]=function(_0x5be239,_0x40d2ac){exec(_0x8cad('0x1e'),function(_0x389848,_0x3d704e,_0xd0902d){logger['info'](_0x3d704e);logger[_0x8cad('0x1a')](_0xd0902d);if(_0x389848){logger[_0x8cad('0x13')](_0x389848);return _0x40d2ac[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x389848);}return _0x40d2ac[_0x8cad('0x10')](0xc8)['json']({'output':_0x3d704e});});};exports[_0x8cad('0x1f')]=function(_0x5631e2,_0x32fc9a){return pm2[_0x8cad('0x1f')](_0x8cad('0x20'))['then'](function(_0xb26870){logger[_0x8cad('0x1a')](_0x8cad('0x21'),_0xb26870);return _0x32fc9a['status'](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x22')});})['catch'](function(_0x3c2ee8){logger[_0x8cad('0x13')](_0x3c2ee8);return _0x32fc9a[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x3c2ee8);});};exports[_0x8cad('0x23')]=function(_0x4d3a48,_0x540959){var _0x53f4a5=fs[_0x8cad('0x24')](path[_0x8cad('0x25')](config[_0x8cad('0x26')],_0x8cad('0x27'),'migrations'));var _0x3875af=[];for(var _0x1ac93e=0x0;_0x1ac93e<_0x53f4a5[_0x8cad('0x28')];_0x1ac93e++){var _0x29a07a=_0x53f4a5[_0x1ac93e][_0x8cad('0x29')]('.js','');if(compareVersions(module[_0x8cad('0xb')]['version'],_0x29a07a)===-0x1){_0x3875af[_0x8cad('0x2a')](_0x29a07a);}}if(_0x3875af[_0x8cad('0x28')]){var _0x78c05d=_0x3875af['sort'](compareVersions);var _0x264d35=new Umzug({'storage':_0x8cad('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x8cad('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x8cad('0x2b')]['getQueryInterface'](),db[_0x8cad('0x2b')][_0x8cad('0x2d')],function(){throw new Error(_0x8cad('0x2e'));}],'path':path[_0x8cad('0x25')](config[_0x8cad('0x26')],_0x8cad('0x27'),'migrations'),'pattern':/\.js$/}});_0x264d35['up']({'migrations':_['map'](_0x78c05d,function(_0x3ce901){return _0x3ce901+_0x8cad('0x2f');})})[_0x8cad('0x30')](function(){return _0x540959['status'](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x31')+module[_0x8cad('0xb')][_0x8cad('0x3')]+_0x8cad('0x32')+_[_0x8cad('0x33')](_0x78c05d),'migrations':_[_0x8cad('0x25')](_0x78c05d)});})['catch'](function(_0x3d3209){if(_0x3d3209 instanceof db['sequelize'][_0x8cad('0x34')]){return _0x540959['status'](0xc8)[_0x8cad('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x540959[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x3d3209);}});}else{return _0x540959[_0x8cad('0x10')](0xc8)[_0x8cad('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 880790b..af48304 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 _0x6b5c=['post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1439f6,_0x5931fe){var _0x10c6dd=function(_0x52ee98){while(--_0x52ee98){_0x1439f6['push'](_0x1439f6['shift']());}};_0x10c6dd(++_0x5931fe);}(_0x6b5c,0xce));var _0xc6b5=function(_0xdfb29a,_0x3443b5){_0xdfb29a=_0xdfb29a-0x0;var _0x52f21e=_0x6b5c[_0xdfb29a];return _0x52f21e;};'use strict';var multer=require(_0xc6b5('0x0'));var util=require('util');var path=require(_0xc6b5('0x1'));var timeout=require(_0xc6b5('0x2'));var express=require(_0xc6b5('0x3'));var router=express['Router']();var fs_extra=require(_0xc6b5('0x4'));var auth=require(_0xc6b5('0x5'));var interaction=require(_0xc6b5('0x6'));var config=require(_0xc6b5('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xc6b5('0x8')]('/',auth[_0xc6b5('0x9')](),controller[_0xc6b5('0xa')]);router[_0xc6b5('0x8')](_0xc6b5('0xb'),auth[_0xc6b5('0x9')](),controller[_0xc6b5('0xc')]);router[_0xc6b5('0x8')]('/:id',auth[_0xc6b5('0x9')](),controller[_0xc6b5('0xd')]);router[_0xc6b5('0xe')]('/',auth['isAuthenticated'](),controller[_0xc6b5('0xf')]);router[_0xc6b5('0x10')](_0xc6b5('0x11'),auth[_0xc6b5('0x9')](),controller[_0xc6b5('0x12')]);router[_0xc6b5('0x13')]('/:id',auth[_0xc6b5('0x9')](),controller[_0xc6b5('0x14')]);module[_0xc6b5('0x15')]=router; \ No newline at end of file +var _0xefd6=['describe','/:id','show','post','create','put','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2a41b2,_0x53c672){var _0x59c822=function(_0xb375e5){while(--_0xb375e5){_0x2a41b2['push'](_0x2a41b2['shift']());}};_0x59c822(++_0x53c672);}(_0xefd6,0x171));var _0x6efd=function(_0x15998e,_0x5c87a0){_0x15998e=_0x15998e-0x0;var _0x184512=_0xefd6[_0x15998e];return _0x184512;};'use strict';var multer=require(_0x6efd('0x0'));var util=require(_0x6efd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6efd('0x2'));var router=express[_0x6efd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6efd('0x4'));var interaction=require(_0x6efd('0x5'));var config=require(_0x6efd('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x6efd('0x7')]('/',auth[_0x6efd('0x8')](),controller[_0x6efd('0x9')]);router[_0x6efd('0x7')](_0x6efd('0xa'),auth[_0x6efd('0x8')](),controller[_0x6efd('0xb')]);router[_0x6efd('0x7')](_0x6efd('0xc'),auth['isAuthenticated'](),controller[_0x6efd('0xd')]);router[_0x6efd('0xe')]('/',auth['isAuthenticated'](),controller[_0x6efd('0xf')]);router[_0x6efd('0x10')]('/:id',auth[_0x6efd('0x8')](),controller['update']);router['delete'](_0x6efd('0xc'),auth[_0x6efd('0x8')](),controller[_0x6efd('0x11')]);module[_0x6efd('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 f3d724f..f65c556 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 _0x5ed9=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x4595ac,_0x4a6c83){var _0x13c73c=function(_0x3b5faf){while(--_0x3b5faf){_0x4595ac['push'](_0x4595ac['shift']());}};_0x13c73c(++_0x4a6c83);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5ed9[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x95ed('0x0'));module[_0x95ed('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x95ed('0x2')]},'calleridnum':{'type':Sequelize[_0x95ed('0x2')]},'calleridname':{'type':Sequelize[_0x95ed('0x2')]},'queue':{'type':Sequelize[_0x95ed('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x95ed('0x2')]},'agentcalledAt':{'type':Sequelize[_0x95ed('0x3')]},'agentconnectAt':{'type':Sequelize[_0x95ed('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x95ed('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x95ed('0x4')]},'agentcomplete':{'type':Sequelize[_0x95ed('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x95ed('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x95ed('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x95ed('0x4')]},'agentacw':{'type':Sequelize[_0x95ed('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x95ed('0x2')]},'lastevent':{'type':Sequelize[_0x95ed('0x2')]},'channel':{'type':Sequelize[_0x95ed('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x95ed('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x95ed('0x2')]},'language':{'type':Sequelize[_0x95ed('0x2')]},'accountcode':{'type':Sequelize[_0x95ed('0x2')]},'context':{'type':Sequelize[_0x95ed('0x2')]},'exten':{'type':Sequelize[_0x95ed('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x95ed('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x95ed('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x95ed('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x95ed('0x2')]},'destlanguage':{'type':Sequelize[_0x95ed('0x2')]},'destaccountcode':{'type':Sequelize[_0x95ed('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x95ed('0x2')]},'destpriority':{'type':Sequelize[_0x95ed('0x2')]},'destuniqueid':{'type':Sequelize[_0x95ed('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x95ed('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x95ed('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x95ed('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x95ed('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7af9=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x50466b,_0x339b99){var _0x5d54c6=function(_0x4ea4aa){while(--_0x4ea4aa){_0x50466b['push'](_0x50466b['shift']());}};_0x5d54c6(++_0x339b99);}(_0x7af9,0x95));var _0x97af=function(_0x20a8d8,_0x16e1e1){_0x20a8d8=_0x20a8d8-0x0;var _0x50dcb7=_0x7af9[_0x20a8d8];return _0x50dcb7;};'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 3647984..287a62f 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(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 5cb089a..d0884a0 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 _0x7c09=['./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4961c1,_0x307b0e){var _0x274aee=function(_0x3c0f84){while(--_0x3c0f84){_0x4961c1['push'](_0x4961c1['shift']());}};_0x274aee(++_0x307b0e);}(_0x7c09,0x102));var _0x97c0=function(_0x2ca235,_0xc03735){_0x2ca235=_0x2ca235-0x0;var _0x45b6fa=_0x7c09[_0x2ca235];return _0x45b6fa;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'fields':[_0x97c0('0xc'),_0x97c0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0a1=['../../config/logger','api','moment','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a1,0x15b));var _0x1a0a=function(_0xfc3fc4,_0x321256){_0xfc3fc4=_0xfc3fc4-0x0;var _0x26b413=_0xa0a1[_0xfc3fc4];return _0x26b413;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var logger=require(_0x1a0a('0x1'))(_0x1a0a('0x2'));var moment=require(_0x1a0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a0a('0x4'));var rimraf=require(_0x1a0a('0x5'));var config=require('../../config/environment');var attributes=require(_0x1a0a('0x6'));module[_0x1a0a('0x7')]=function(_0x4b5573,_0x2d4b04){return _0x4b5573[_0x1a0a('0x8')](_0x1a0a('0x9'),attributes,{'tableName':_0x1a0a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1a0a('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 9ded8d7..1d27658 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 _0x0772=['stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','options','raw','where','limit','UpdateVoiceAgentReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x375923,_0x3bf77f){var _0x3f15ab=function(_0x4f4037){while(--_0x4f4037){_0x375923['push'](_0x375923['shift']());}};_0x3f15ab(++_0x3bf77f);}(_0x0772,0x110));var _0x2077=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0772[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x2077('0x0'));var moment=require('moment');var BPromise=require(_0x2077('0x1'));var rs=require(_0x2077('0x2'));var fs=require('fs');var Redis=require(_0x2077('0x3'));var db=require(_0x2077('0x4'))['db'];var utils=require(_0x2077('0x5'));var logger=require(_0x2077('0x6'))(_0x2077('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2077('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb985d3,_0x11b5e4,_0x4f4748){return new BPromise(function(_0x20d151,_0x497a5c){return client[_0x2077('0x9')](_0xb985d3,_0x4f4748)['then'](function(_0x69b132){logger[_0x2077('0xa')](_0x2077('0xb'),_0x11b5e4,_0x2077('0xc'));logger[_0x2077('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x11b5e4,_0x2077('0xc'),JSON[_0x2077('0xe')](_0x69b132));if(_0x69b132[_0x2077('0xf')]){if(_0x69b132[_0x2077('0xf')][_0x2077('0x10')]===0x1f4){logger[_0x2077('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x11b5e4,_0x69b132[_0x2077('0xf')][_0x2077('0x11')]);return _0x497a5c(_0x69b132[_0x2077('0xf')][_0x2077('0x11')]);}logger[_0x2077('0xf')](_0x2077('0xb'),_0x11b5e4,_0x69b132[_0x2077('0xf')][_0x2077('0x11')]);return _0x20d151(_0x69b132[_0x2077('0xf')]['message']);}else{logger[_0x2077('0xa')](_0x2077('0xb'),_0x11b5e4,_0x2077('0xc'));_0x20d151(_0x69b132['result'][_0x2077('0x11')]);}})[_0x2077('0x12')](function(_0x545072){logger['error'](_0x2077('0xb'),_0x11b5e4,_0x545072);_0x497a5c(_0x545072);});});}exports[_0x2077('0x13')]=function(_0x3b3720){var _0x55a941=this;return new Promise(function(_0x262905,_0x27fc6f){return db[_0x2077('0x14')]['create'](_0x3b3720['body'],{'raw':_0x3b3720[_0x2077('0x15')]?_0x3b3720[_0x2077('0x15')][_0x2077('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3ad7a5){logger[_0x2077('0xa')](_0x2077('0x13'),_0x3b3720);logger[_0x2077('0xd')](_0x2077('0x13'),_0x3b3720,JSON[_0x2077('0xe')](_0x3ad7a5));_0x262905(_0x3ad7a5);})[_0x2077('0x12')](function(_0x3bd5f9){logger[_0x2077('0xf')]('CreateVoiceAgentReport',_0x3bd5f9[_0x2077('0x11')],_0x3b3720);_0x27fc6f(_0x55a941[_0x2077('0xf')](0x1f4,_0x3bd5f9['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x92be82){var _0x3f4fd6=this;return new Promise(function(_0x3b13d2,_0x38383a){return db['VoiceAgentReport']['update'](_0x92be82['body'],{'raw':_0x92be82['options']?_0x92be82['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92be82[_0x2077('0x15')]?_0x92be82[_0x2077('0x15')][_0x2077('0x17')]||null:null,'attributes':_0x92be82[_0x2077('0x15')]?_0x92be82[_0x2077('0x15')]['attributes']||null:null,'limit':_0x92be82['options']?_0x92be82['options'][_0x2077('0x18')]||null:null})['then'](function(_0x20ce2d){logger['info'](_0x2077('0x19'),_0x92be82);logger['debug']('UpdateVoiceAgentReport',_0x92be82,JSON[_0x2077('0xe')](_0x20ce2d));_0x3b13d2(_0x20ce2d);})[_0x2077('0x12')](function(_0x153f8e){logger[_0x2077('0xf')](_0x2077('0x19'),_0x153f8e[_0x2077('0x11')],_0x92be82);_0x38383a(_0x3f4fd6[_0x2077('0xf')](0x1f4,_0x153f8e[_0x2077('0x11')]));});});}; \ No newline at end of file +var _0x3e75=['VoiceAgentReport','body','options','debug','UpdateVoiceAgentReport','update','raw','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','code','error','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3e75,0x89));var _0x53e7=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x3e75[_0x172133];return _0x2460e5;};'use strict';var _=require(_0x53e7('0x0'));var util=require(_0x53e7('0x1'));var moment=require('moment');var BPromise=require(_0x53e7('0x2'));var rs=require(_0x53e7('0x3'));var fs=require('fs');var Redis=require(_0x53e7('0x4'));var db=require(_0x53e7('0x5'))['db'];var utils=require(_0x53e7('0x6'));var logger=require(_0x53e7('0x7'))(_0x53e7('0x8'));var config=require(_0x53e7('0x9'));var jayson=require(_0x53e7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41564a,_0x32bde1,_0x3f50e6){return new BPromise(function(_0x39f3e3,_0x578ffb){return client[_0x53e7('0xb')](_0x41564a,_0x3f50e6)[_0x53e7('0xc')](function(_0x1e0a33){logger[_0x53e7('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'),JSON[_0x53e7('0xf')](_0x1e0a33));if(_0x1e0a33['error']){if(_0x1e0a33['error'][_0x53e7('0x10')]===0x1f4){logger[_0x53e7('0x11')](_0x53e7('0x12'),_0x32bde1,_0x1e0a33[_0x53e7('0x11')]['message']);return _0x578ffb(_0x1e0a33[_0x53e7('0x11')][_0x53e7('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x1e0a33['error'][_0x53e7('0x13')]);return _0x39f3e3(_0x1e0a33[_0x53e7('0x11')][_0x53e7('0x13')]);}else{logger[_0x53e7('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'));_0x39f3e3(_0x1e0a33[_0x53e7('0x14')][_0x53e7('0x13')]);}})[_0x53e7('0x15')](function(_0x47d19c){logger[_0x53e7('0x11')](_0x53e7('0x12'),_0x32bde1,_0x47d19c);_0x578ffb(_0x47d19c);});});}exports[_0x53e7('0x16')]=function(_0x3218c3){var _0x5cfefb=this;return new Promise(function(_0x369672,_0x154d54){return db[_0x53e7('0x17')]['create'](_0x3218c3[_0x53e7('0x18')],{'raw':_0x3218c3[_0x53e7('0x19')]?_0x3218c3[_0x53e7('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x460c4a){logger[_0x53e7('0xd')](_0x53e7('0x16'),_0x3218c3);logger[_0x53e7('0x1a')](_0x53e7('0x16'),_0x3218c3,JSON[_0x53e7('0xf')](_0x460c4a));_0x369672(_0x460c4a);})[_0x53e7('0x15')](function(_0x1ffbf1){logger['error']('CreateVoiceAgentReport',_0x1ffbf1['message'],_0x3218c3);_0x154d54(_0x5cfefb[_0x53e7('0x11')](0x1f4,_0x1ffbf1['message']));});});};exports[_0x53e7('0x1b')]=function(_0x2d8360){var _0x117e80=this;return new Promise(function(_0x145d16,_0x58ea17){return db[_0x53e7('0x17')][_0x53e7('0x1c')](_0x2d8360[_0x53e7('0x18')],{'raw':_0x2d8360[_0x53e7('0x19')]?_0x2d8360['options'][_0x53e7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d8360['options']?_0x2d8360['options']['where']||null:null,'attributes':_0x2d8360[_0x53e7('0x19')]?_0x2d8360[_0x53e7('0x19')][_0x53e7('0x1e')]||null:null,'limit':_0x2d8360['options']?_0x2d8360[_0x53e7('0x19')][_0x53e7('0x1f')]||null:null})['then'](function(_0x29cf6d){logger[_0x53e7('0xd')](_0x53e7('0x1b'),_0x2d8360);logger[_0x53e7('0x1a')]('UpdateVoiceAgentReport',_0x2d8360,JSON[_0x53e7('0xf')](_0x29cf6d));_0x145d16(_0x29cf6d);})[_0x53e7('0x15')](function(_0x509a9b){logger[_0x53e7('0x11')](_0x53e7('0x1b'),_0x509a9b[_0x53e7('0x13')],_0x2d8360);_0x58ea17(_0x117e80[_0x53e7('0x11')](0x1f4,_0x509a9b[_0x53e7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e4459f5..8b29fa8 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 _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x59b50c,_0x3ef459){var _0x3a825c=function(_0x58b18){while(--_0x58b18){_0x59b50c['push'](_0x59b50c['shift']());}};_0x3a825c(++_0x3ef459);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8958=['index','get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated'];(function(_0x3aeaf9,_0xcacc11){var _0x31ec43=function(_0x38e474){while(--_0x38e474){_0x3aeaf9['push'](_0x3aeaf9['shift']());}};_0x31ec43(++_0xcacc11);}(_0x8958,0x93));var _0x8895=function(_0xf9664c,_0x23180f){_0xf9664c=_0xf9664c-0x0;var _0x400cfb=_0x8958[_0xf9664c];return _0x400cfb;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0xd')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller['update']);router[_0x8895('0xe')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xf')]);module[_0x8895('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2d33d5e..15a294a 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 _0xa880=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x1f0c9b,_0x234e61){var _0x1283e6=function(_0x5e157c){while(--_0x5e157c){_0x1f0c9b['push'](_0x1f0c9b['shift']());}};_0x1283e6(++_0x234e61);}(_0xa880,0x106));var _0x0a88=function(_0x77e7e8,_0x5a319f){_0x77e7e8=_0x77e7e8-0x0;var _0x205a3e=_0xa880[_0x77e7e8];return _0x205a3e;};'use strict';var Sequelize=require(_0x0a88('0x0'));module[_0x0a88('0x1')]={'uniqueid':{'type':Sequelize[_0x0a88('0x2')]},'type':{'type':Sequelize[_0x0a88('0x3')](_0x0a88('0x4'),_0x0a88('0x5'),_0x0a88('0x6'),_0x0a88('0x7'),_0x0a88('0x8'),_0x0a88('0x9'))},'tag':{'type':Sequelize[_0x0a88('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x0a88('0x2')]},'destination':{'type':Sequelize[_0x0a88('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a88('0x2')]},'callerid':{'type':Sequelize[_0x0a88('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x0a88('0x2')]},'lastapplication':{'type':Sequelize[_0x0a88('0x2')]},'lastdata':{'type':Sequelize[_0x0a88('0xa')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0a88('0xb')]},'duration':{'type':Sequelize[_0x0a88('0xc')]},'billableseconds':{'type':Sequelize[_0x0a88('0xc')]},'mohtime':{'type':Sequelize[_0x0a88('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a88('0x2')]},'amaflags':{'type':Sequelize[_0x0a88('0x2')]},'userfield':{'type':Sequelize[_0x0a88('0x2')]},'userDisposition':{'type':Sequelize[_0x0a88('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x0a88('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x0a88('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0a88('0x2')]},'routeid':{'type':Sequelize[_0x0a88('0xc')]},'sipcallid':{'type':Sequelize[_0x0a88('0x2')]}}; \ No newline at end of file +var _0x69c4=['exports','STRING','inbound','TEXT','DATE','INTEGER','sequelize'];(function(_0x297d8d,_0x4dad3b){var _0x48ff74=function(_0x16ba99){while(--_0x16ba99){_0x297d8d['push'](_0x297d8d['shift']());}};_0x48ff74(++_0x4dad3b);}(_0x69c4,0x1d4));var _0x469c=function(_0x3e1bc9,_0x12ed09){_0x3e1bc9=_0x3e1bc9-0x0;var _0x132b8a=_0x69c4[_0x3e1bc9];return _0x132b8a;};'use strict';var Sequelize=require(_0x469c('0x0'));module[_0x469c('0x1')]={'uniqueid':{'type':Sequelize[_0x469c('0x2')]},'type':{'type':Sequelize['ENUM'](_0x469c('0x3'),'internal','outbound','inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0x469c('0x2')]},'accountcode':{'type':Sequelize[_0x469c('0x2')]},'source':{'type':Sequelize[_0x469c('0x2')]},'destination':{'type':Sequelize[_0x469c('0x2')]},'destinationcontext':{'type':Sequelize[_0x469c('0x2')]},'callerid':{'type':Sequelize[_0x469c('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x469c('0x2')]},'lastapplication':{'type':Sequelize[_0x469c('0x2')]},'lastdata':{'type':Sequelize[_0x469c('0x4')]},'starttime':{'type':Sequelize[_0x469c('0x5')]},'systemanswertime':{'type':Sequelize[_0x469c('0x5')]},'answertime':{'type':Sequelize[_0x469c('0x5')]},'endtime':{'type':Sequelize[_0x469c('0x5')]},'duration':{'type':Sequelize[_0x469c('0x6')]},'billableseconds':{'type':Sequelize[_0x469c('0x6')]},'mohtime':{'type':Sequelize[_0x469c('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x469c('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x469c('0x2')]},'userDisposition':{'type':Sequelize[_0x469c('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x469c('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x469c('0x2')]},'note':{'type':Sequelize[_0x469c('0x2')]},'prefix':{'type':Sequelize[_0x469c('0x2')]},'routeid':{'type':Sequelize[_0x469c('0x6')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 7becaea..55bb56b 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(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x5f2f,0x73));var _0xf5f2=function(_0x59338c,_0x1a9099){_0x59338c=_0x59338c-0x0;var _0x4dfab2=_0x5f2f[_0x59338c];return _0x4dfab2;};'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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x3fb63f,_0x4d50a9){var _0x23154d=function(_0x1455cb){while(--_0x1455cb){_0x3fb63f['push'](_0x3fb63f['shift']());}};_0x23154d(++_0x4d50a9);}(_0xdb28,0x106));var _0x8db2=function(_0x633c07,_0x38ccd7){_0x633c07=_0x633c07-0x0;var _0x4d64e4=_0xdb28[_0x633c07];return _0x4d64e4;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6100557..6eda24c 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 _0xce26=['moment','bluebird','request-promise','path','../../config/environment','exports','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5ce6e2,_0x59e35a){var _0x3a43f9=function(_0xadf64){while(--_0xadf64){_0x5ce6e2['push'](_0x5ce6e2['shift']());}};_0x3a43f9(++_0x59e35a);}(_0xce26,0x134));var _0x6ce2=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xce26[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x6ce2('0x0'));var util=require(_0x6ce2('0x1'));var logger=require(_0x6ce2('0x2'))(_0x6ce2('0x3'));var moment=require(_0x6ce2('0x4'));var BPromise=require(_0x6ce2('0x5'));var rp=require(_0x6ce2('0x6'));var fs=require('fs');var path=require(_0x6ce2('0x7'));var rimraf=require('rimraf');var config=require(_0x6ce2('0x8'));var attributes=require('./voiceCallReport.attributes');module[_0x6ce2('0x9')]=function(_0x320fc6,_0x38e9ec){return _0x320fc6['define'](_0x6ce2('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6ce2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9366=['path','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x592bba,_0x535c52){var _0x3e4180=function(_0x57831e){while(--_0x57831e){_0x592bba['push'](_0x592bba['shift']());}};_0x3e4180(++_0x535c52);}(_0x9366,0x14a));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6936('0x0'));var logger=require(_0x6936('0x1'))(_0x6936('0x2'));var moment=require(_0x6936('0x3'));var BPromise=require(_0x6936('0x4'));var rp=require(_0x6936('0x5'));var fs=require('fs');var path=require(_0x6936('0x6'));var rimraf=require('rimraf');var config=require(_0x6936('0x7'));var attributes=require(_0x6936('0x8'));module[_0x6936('0x9')]=function(_0x2b36cc,_0x3ad113){return _0x2b36cc['define']('VoiceCallReport',attributes,{'tableName':_0x6936('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6936('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 292a4b9..3bd2ed8 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 _0x6dad=['info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit','include','model','map','then','debug','CreateVoiceCallReport','VoiceCallReport','create','UpdateVoiceCallReport','body','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','request'];(function(_0x1d4079,_0x3f2d2a){var _0x38285f=function(_0x57c2de){while(--_0x57c2de){_0x1d4079['push'](_0x1d4079['shift']());}};_0x38285f(++_0x3f2d2a);}(_0x6dad,0x12a));var _0xd6da=function(_0x238410,_0x1b1946){_0x238410=_0x238410-0x0;var _0x459fd7=_0x6dad[_0x238410];return _0x459fd7;};'use strict';var _=require('lodash');var util=require(_0xd6da('0x0'));var moment=require(_0xd6da('0x1'));var BPromise=require(_0xd6da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6da('0x3'));var db=require(_0xd6da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6da('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd6da('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13e6cf,_0x53dc7b,_0x481374){return new BPromise(function(_0x13c14c,_0x483ae6){return client[_0xd6da('0x7')](_0x13e6cf,_0x481374)['then'](function(_0x3df7c9){logger[_0xd6da('0x8')](_0xd6da('0x9'),_0x53dc7b,_0xd6da('0xa'));logger['debug'](_0xd6da('0xb'),_0x53dc7b,_0xd6da('0xa'),JSON[_0xd6da('0xc')](_0x3df7c9));if(_0x3df7c9[_0xd6da('0xd')]){if(_0x3df7c9[_0xd6da('0xd')][_0xd6da('0xe')]===0x1f4){logger[_0xd6da('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x53dc7b,_0x3df7c9[_0xd6da('0xd')][_0xd6da('0xf')]);return _0x483ae6(_0x3df7c9[_0xd6da('0xd')][_0xd6da('0xf')]);}logger['error'](_0xd6da('0x9'),_0x53dc7b,_0x3df7c9[_0xd6da('0xd')][_0xd6da('0xf')]);return _0x13c14c(_0x3df7c9[_0xd6da('0xd')][_0xd6da('0xf')]);}else{logger['info'](_0xd6da('0x9'),_0x53dc7b,_0xd6da('0xa'));_0x13c14c(_0x3df7c9['result'][_0xd6da('0xf')]);}})[_0xd6da('0x10')](function(_0x19bb01){logger[_0xd6da('0xd')](_0xd6da('0x9'),_0x53dc7b,_0x19bb01);_0x483ae6(_0x19bb01);});});}exports[_0xd6da('0x11')]=function(_0x329883){var _0x372a85=this;return new Promise(function(_0x50805e,_0x50e58a){return db['VoiceCallReport'][_0xd6da('0x12')]({'raw':_0x329883[_0xd6da('0x13')]?_0x329883[_0xd6da('0x13')][_0xd6da('0x14')]===undefined?!![]:![]:!![],'where':_0x329883[_0xd6da('0x13')]?_0x329883[_0xd6da('0x13')]['where']||null:null,'attributes':_0x329883[_0xd6da('0x13')]?_0x329883[_0xd6da('0x13')][_0xd6da('0x15')]||null:null,'limit':_0x329883[_0xd6da('0x13')]?_0x329883[_0xd6da('0x13')][_0xd6da('0x16')]||null:null,'include':_0x329883['options']?_0x329883[_0xd6da('0x13')][_0xd6da('0x17')]?_['map'](_0x329883[_0xd6da('0x13')][_0xd6da('0x17')],function(_0x1d9939){return{'model':db[_0x1d9939[_0xd6da('0x18')]],'as':_0x1d9939['as'],'attributes':_0x1d9939[_0xd6da('0x15')],'include':_0x1d9939[_0xd6da('0x17')]?_['map'](_0x1d9939[_0xd6da('0x17')],function(_0x522215){return{'model':db[_0x522215['model']],'as':_0x522215['as'],'attributes':_0x522215[_0xd6da('0x15')],'include':_0x522215['include']?_[_0xd6da('0x19')](_0x522215[_0xd6da('0x17')],function(_0x4f9537){return{'model':db[_0x4f9537[_0xd6da('0x18')]],'as':_0x4f9537['as'],'attributes':_0x4f9537[_0xd6da('0x15')]};}):[]};}):[]};}):[]:[]})[_0xd6da('0x1a')](function(_0x4d7fb8){logger[_0xd6da('0x8')]('GetVoiceCallReport',_0x329883);logger[_0xd6da('0x1b')](_0xd6da('0x11'),_0x329883,JSON[_0xd6da('0xc')](_0x4d7fb8));_0x50805e(_0x4d7fb8);})[_0xd6da('0x10')](function(_0xaa32f9){logger[_0xd6da('0xd')](_0xd6da('0x11'),_0xaa32f9[_0xd6da('0xf')],_0x329883);_0x50e58a(_0x372a85['error'](0x1f4,_0xaa32f9[_0xd6da('0xf')]));});});};exports[_0xd6da('0x1c')]=function(_0x59dd50){var _0x18ddf9=this;return new Promise(function(_0x24dc33,_0x437b88){return db[_0xd6da('0x1d')][_0xd6da('0x1e')](_0x59dd50['body'],{'raw':_0x59dd50[_0xd6da('0x13')]?_0x59dd50[_0xd6da('0x13')][_0xd6da('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x43bb20){logger[_0xd6da('0x8')](_0xd6da('0x1c'),_0x59dd50);logger[_0xd6da('0x1b')](_0xd6da('0x1c'),_0x59dd50,JSON[_0xd6da('0xc')](_0x43bb20));_0x24dc33(_0x43bb20);})[_0xd6da('0x10')](function(_0x23ab4d){logger[_0xd6da('0xd')]('CreateVoiceCallReport',_0x23ab4d[_0xd6da('0xf')],_0x59dd50);_0x437b88(_0x18ddf9[_0xd6da('0xd')](0x1f4,_0x23ab4d[_0xd6da('0xf')]));});});};exports[_0xd6da('0x1f')]=function(_0x14f673){var _0x33c529=this;return new Promise(function(_0x3f1750,_0x1d1d97){return db['VoiceCallReport']['update'](_0x14f673[_0xd6da('0x20')],{'raw':_0x14f673[_0xd6da('0x13')]?_0x14f673[_0xd6da('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f673[_0xd6da('0x13')]?_0x14f673[_0xd6da('0x13')][_0xd6da('0x21')]||null:null,'attributes':_0x14f673[_0xd6da('0x13')]?_0x14f673['options']['attributes']||null:null,'limit':_0x14f673[_0xd6da('0x13')]?_0x14f673[_0xd6da('0x13')][_0xd6da('0x16')]||null:null})['then'](function(_0x46cad3){logger[_0xd6da('0x8')](_0xd6da('0x1f'),_0x14f673);logger['debug'](_0xd6da('0x1f'),_0x14f673,JSON[_0xd6da('0xc')](_0x46cad3));_0x3f1750(_0x46cad3);})[_0xd6da('0x10')](function(_0x5c718b){logger[_0xd6da('0xd')](_0xd6da('0x1f'),_0x5c718b[_0xd6da('0xf')],_0x14f673);_0x1d1d97(_0x33c529[_0xd6da('0xd')](0x1f4,_0x5c718b[_0xd6da('0xf')]));});});}; \ No newline at end of file +var _0xe725=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','body','raw','UpdateVoiceCallReport','update'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xe725,0x138));var _0x5e72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe725[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5e72('0x0'));var util=require('util');var moment=require(_0x5e72('0x1'));var BPromise=require(_0x5e72('0x2'));var rs=require(_0x5e72('0x3'));var fs=require('fs');var Redis=require(_0x5e72('0x4'));var db=require(_0x5e72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e72('0x6'))(_0x5e72('0x7'));var config=require(_0x5e72('0x8'));var jayson=require(_0x5e72('0x9'));var client=jayson['client'][_0x5e72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf2465,_0x2e0830,_0x2eaeed){return new BPromise(function(_0x288318,_0x4a5a7f){return client[_0x5e72('0xb')](_0xbf2465,_0x2eaeed)[_0x5e72('0xc')](function(_0x1d3c1d){logger[_0x5e72('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x5e72('0xe'));logger[_0x5e72('0xf')](_0x5e72('0x10'),_0x2e0830,_0x5e72('0xe'),JSON[_0x5e72('0x11')](_0x1d3c1d));if(_0x1d3c1d[_0x5e72('0x12')]){if(_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x13')]===0x1f4){logger[_0x5e72('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x14')]);return _0x4a5a7f(_0x1d3c1d[_0x5e72('0x12')]['message']);}logger[_0x5e72('0x12')](_0x5e72('0x15'),_0x2e0830,_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x14')]);return _0x288318(_0x1d3c1d['error'][_0x5e72('0x14')]);}else{logger[_0x5e72('0xd')](_0x5e72('0x15'),_0x2e0830,_0x5e72('0xe'));_0x288318(_0x1d3c1d[_0x5e72('0x16')]['message']);}})['catch'](function(_0x2e22a5){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x2e22a5);_0x4a5a7f(_0x2e22a5);});});}exports[_0x5e72('0x17')]=function(_0x18e671){var _0xa2fbfc=this;return new Promise(function(_0xe9ad67,_0x1f49ba){return db[_0x5e72('0x18')][_0x5e72('0x19')]({'raw':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1b')]||null:null,'attributes':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1c')]||null:null,'limit':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1d')]||null:null,'include':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1e')]?_[_0x5e72('0x1f')](_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1e')],function(_0x5f4ef4){return{'model':db[_0x5f4ef4['model']],'as':_0x5f4ef4['as'],'attributes':_0x5f4ef4['attributes'],'include':_0x5f4ef4['include']?_['map'](_0x5f4ef4[_0x5e72('0x1e')],function(_0xf3f0ab){return{'model':db[_0xf3f0ab[_0x5e72('0x20')]],'as':_0xf3f0ab['as'],'attributes':_0xf3f0ab[_0x5e72('0x1c')],'include':_0xf3f0ab[_0x5e72('0x1e')]?_[_0x5e72('0x1f')](_0xf3f0ab['include'],function(_0x2c8c4a){return{'model':db[_0x2c8c4a[_0x5e72('0x20')]],'as':_0x2c8c4a['as'],'attributes':_0x2c8c4a[_0x5e72('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5e72('0xc')](function(_0x2bb1df){logger['info'](_0x5e72('0x17'),_0x18e671);logger[_0x5e72('0xf')](_0x5e72('0x17'),_0x18e671,JSON['stringify'](_0x2bb1df));_0xe9ad67(_0x2bb1df);})[_0x5e72('0x21')](function(_0x2fb569){logger['error']('GetVoiceCallReport',_0x2fb569[_0x5e72('0x14')],_0x18e671);_0x1f49ba(_0xa2fbfc[_0x5e72('0x12')](0x1f4,_0x2fb569['message']));});});};exports[_0x5e72('0x22')]=function(_0x3b1ac6){var _0x3872ad=this;return new Promise(function(_0x7257a8,_0x5256ca){return db['VoiceCallReport']['create'](_0x3b1ac6[_0x5e72('0x23')],{'raw':_0x3b1ac6[_0x5e72('0x1a')]?_0x3b1ac6[_0x5e72('0x1a')][_0x5e72('0x24')]===undefined?!![]:![]:!![]})[_0x5e72('0xc')](function(_0x15fc11){logger[_0x5e72('0xd')](_0x5e72('0x22'),_0x3b1ac6);logger[_0x5e72('0xf')](_0x5e72('0x22'),_0x3b1ac6,JSON[_0x5e72('0x11')](_0x15fc11));_0x7257a8(_0x15fc11);})[_0x5e72('0x21')](function(_0x4c8b15){logger['error'](_0x5e72('0x22'),_0x4c8b15[_0x5e72('0x14')],_0x3b1ac6);_0x5256ca(_0x3872ad[_0x5e72('0x12')](0x1f4,_0x4c8b15[_0x5e72('0x14')]));});});};exports[_0x5e72('0x25')]=function(_0x1aaa47){var _0x1c4aad=this;return new Promise(function(_0x1d27c6,_0x2e2709){return db['VoiceCallReport'][_0x5e72('0x26')](_0x1aaa47[_0x5e72('0x23')],{'raw':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1aaa47['options']?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1b')]||null:null,'attributes':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1c')]||null:null,'limit':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1d')]||null:null})[_0x5e72('0xc')](function(_0x157f0c){logger[_0x5e72('0xd')](_0x5e72('0x25'),_0x1aaa47);logger[_0x5e72('0xf')](_0x5e72('0x25'),_0x1aaa47,JSON[_0x5e72('0x11')](_0x157f0c));_0x1d27c6(_0x157f0c);})[_0x5e72('0x21')](function(_0x2434a9){logger[_0x5e72('0x12')]('UpdateVoiceCallReport',_0x2434a9['message'],_0x1aaa47);_0x2e2709(_0x1c4aad['error'](0x1f4,_0x2434a9[_0x5e72('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index ec03d12..4a11834 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 _0x9003=['get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x59cd91,_0xaa1e23){var _0x4df7b0=function(_0x42baba){while(--_0x42baba){_0x59cd91['push'](_0x59cd91['shift']());}};_0x4df7b0(++_0xaa1e23);}(_0x9003,0x100));var _0x3900=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9003[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x3900('0x0'));var util=require(_0x3900('0x1'));var path=require('path');var timeout=require(_0x3900('0x2'));var express=require(_0x3900('0x3'));var router=express[_0x3900('0x4')]();var fs_extra=require(_0x3900('0x5'));var auth=require(_0x3900('0x6'));var interaction=require(_0x3900('0x7'));var config=require(_0x3900('0x8'));var controller=require(_0x3900('0x9'));router[_0x3900('0xa')]('/',auth[_0x3900('0xb')](),controller[_0x3900('0xc')]);router[_0x3900('0xa')](_0x3900('0xd'),auth[_0x3900('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3900('0xe')]);router[_0x3900('0xf')](_0x3900('0xd'),auth[_0x3900('0xb')](),controller[_0x3900('0x10')]);router[_0x3900('0x11')](_0x3900('0xd'),auth[_0x3900('0xb')](),controller[_0x3900('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3460=['post','put','destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','show'];(function(_0x320a7c,_0x43681b){var _0x2cd152=function(_0x486fc6){while(--_0x486fc6){_0x320a7c['push'](_0x320a7c['shift']());}};_0x2cd152(++_0x43681b);}(_0x3460,0xdc));var _0x0346=function(_0xe0aaf5,_0x2f95a0){_0xe0aaf5=_0xe0aaf5-0x0;var _0x24f5aa=_0x3460[_0xe0aaf5];return _0x24f5aa;};'use strict';var multer=require('multer');var util=require(_0x0346('0x0'));var path=require(_0x0346('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0346('0x2'));var auth=require(_0x0346('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0346('0x4'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x0346('0x5')](),controller[_0x0346('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0346('0x7')]);router[_0x0346('0x8')]('/',auth[_0x0346('0x5')](),controller['create']);router[_0x0346('0x9')]('/:id',auth[_0x0346('0x5')](),controller['update']);router['delete']('/:id',auth[_0x0346('0x5')](),controller[_0x0346('0xa')]);module[_0x0346('0xb')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 739c6ca..cc987e4 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 _0xf366=['setDataValue','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf366,0x149));var _0x6f36=function(_0x4344c4,_0x427ea3){_0x4344c4=_0x4344c4-0x0;var _0x2940e0=_0xf366[_0x4344c4];return _0x2940e0;};'use strict';var Sequelize=require(_0x6f36('0x0'));module[_0x6f36('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x6f36('0x2')],'unique':_0x6f36('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x29e100){this[_0x6f36('0x4')]('options',_0x29e100?_0x29e100['join'](''):[]);},'get':function(){return this[_0x6f36('0x5')](_0x6f36('0x6'))?this['getDataValue'](_0x6f36('0x6'))[_0x6f36('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x6f36('0x2')]},'record':{'type':Sequelize[_0x6f36('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6f36('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x79a5=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0xa1b0d4,_0xbeba0){var _0x19f06c=function(_0x172a9a){while(--_0x172a9a){_0xa1b0d4['push'](_0xa1b0d4['shift']());}};_0x19f06c(++_0xbeba0);}(_0x79a5,0x1a3));var _0x579a=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x79a5[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x579a('0x0'));module[_0x579a('0x1')]={'name':{'type':Sequelize[_0x579a('0x2')]},'prefix':{'type':Sequelize[_0x579a('0x2')],'unique':_0x579a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x579a('0x2')],'set':function(_0x36d349){this[_0x579a('0x4')](_0x579a('0x5'),_0x36d349?_0x36d349['join'](''):[]);},'get':function(){return this[_0x579a('0x6')]('options')?this[_0x579a('0x6')]('options')[_0x579a('0x7')](''):[];}},'auth':{'type':Sequelize[_0x579a('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x579a('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x579a('0x2')]},'description':{'type':Sequelize[_0x579a('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8c9dd8d..ee0ed07 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 _0x2557=['send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','name','filter','includeAll','VoiceChanSpy','findAll','rows','catch','show','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','error','stack'];(function(_0xba84b5,_0x2c8e10){var _0x97bf20=function(_0x5f47b8){while(--_0x5f47b8){_0xba84b5['push'](_0xba84b5['shift']());}};_0x97bf20(++_0x2c8e10);}(_0x2557,0x11e));var _0x7255=function(_0x3a1f12,_0x4532b9){_0x3a1f12=_0x3a1f12-0x0;var _0x1c0e58=_0x2557[_0x3a1f12];return _0x1c0e58;};'use strict';var emlformat=require(_0x7255('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7255('0x1'));var jsonpatch=require(_0x7255('0x2'));var rp=require(_0x7255('0x3'));var moment=require(_0x7255('0x4'));var BPromise=require(_0x7255('0x5'));var Mustache=require(_0x7255('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7255('0x7'));var ejs=require(_0x7255('0x8'));var fs=require('fs');var fs_extra=require(_0x7255('0x9'));var _=require(_0x7255('0xa'));var squel=require(_0x7255('0xb'));var crypto=require(_0x7255('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7255('0xd'));var toCsv=require(_0x7255('0x7'));var querystring=require(_0x7255('0xe'));var Papa=require('papaparse');var Redis=require(_0x7255('0xf'));var authService=require(_0x7255('0x10'));var qs=require(_0x7255('0x11'));var as=require(_0x7255('0x12'));var hardwareService=require(_0x7255('0x13'));var logger=require(_0x7255('0x14'))(_0x7255('0x15'));var utils=require('../../config/utils');var config=require(_0x7255('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x502367,_0x18de71){_0x18de71=_0x18de71||0xcc;return function(_0x3f9415){if(_0x3f9415){return _0x502367[_0x7255('0x17')](_0x18de71);}return _0x502367[_0x7255('0x18')](_0x18de71)[_0x7255('0x19')]();};}function respondWithResult(_0x2e2378,_0x44a4de){_0x44a4de=_0x44a4de||0xc8;return function(_0x5d2777){if(_0x5d2777){return _0x2e2378[_0x7255('0x18')](_0x44a4de)[_0x7255('0x1a')](_0x5d2777);}};}function respondWithFilteredResult(_0x1c565b,_0x3c5573){return function(_0x26e52b){if(_0x26e52b){var _0xc2c1f5=typeof _0x3c5573[_0x7255('0x1b')]===_0x7255('0x1c')&&typeof _0x3c5573[_0x7255('0x1d')]===_0x7255('0x1c');var _0x2e6489=_0x26e52b[_0x7255('0x1e')];var _0x19dac1=_0xc2c1f5?0x0:_0x3c5573[_0x7255('0x1b')];var _0x3db713=_0xc2c1f5?_0x26e52b[_0x7255('0x1e')]:_0x3c5573[_0x7255('0x1b')]+_0x3c5573['limit'];var _0x4f26da;if(_0x3db713>=_0x2e6489){_0x3db713=_0x2e6489;_0x4f26da=0xc8;}else{_0x4f26da=0xce;}_0x1c565b[_0x7255('0x18')](_0x4f26da);return _0x1c565b[_0x7255('0x1f')](_0x7255('0x20'),_0x19dac1+'-'+_0x3db713+'/'+_0x2e6489)[_0x7255('0x1a')](_0x26e52b);}return null;};}function patchUpdates(_0x4bff12){return function(_0x3cef55){try{jsonpatch[_0x7255('0x21')](_0x3cef55,_0x4bff12,!![]);}catch(_0x1be0c4){return BPromise[_0x7255('0x22')](_0x1be0c4);}return _0x3cef55[_0x7255('0x23')]();};}function saveUpdates(_0xc13135,_0x38f9eb){return function(_0x9fdfea){if(_0x9fdfea){return _0x9fdfea['update'](_0xc13135)[_0x7255('0x24')](function(_0x172e5a){return _0x172e5a;});}return null;};}function removeEntity(_0x3f6fea,_0x358e87){return function(_0x153113){if(_0x153113){return _0x153113[_0x7255('0x25')]()[_0x7255('0x24')](function(){var _0x4a62eb=_0x153113[_0x7255('0x26')]({'plain':!![]});var _0x455098=_0x7255('0x27');return db['UserProfileResource'][_0x7255('0x25')]({'where':{'type':_0x455098,'resourceId':_0x4a62eb['id']}})['then'](function(){return _0x153113;});})[_0x7255('0x24')](function(){_0x3f6fea[_0x7255('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe0b108,_0x3a8e2c){return function(_0x93c316){if(!_0x93c316){_0xe0b108[_0x7255('0x17')](0x194);}return _0x93c316;};}function handleError(_0x4770d0,_0x2d7038){_0x2d7038=_0x2d7038||0x1f4;return function(_0x54e53a){logger[_0x7255('0x28')](_0x54e53a[_0x7255('0x29')]);if(_0x54e53a['name']){delete _0x54e53a['name'];}_0x4770d0[_0x7255('0x18')](_0x2d7038)[_0x7255('0x2a')](_0x54e53a);};}exports[_0x7255('0x2b')]=function(_0x3eeb50,_0x25cc20){var _0x122a44={},_0x9436cc={},_0x464bc0={'count':0x0,'rows':[]};var _0x5bcb34=_[_0x7255('0x2c')](db['VoiceChanSpy'][_0x7255('0x2d')],function(_0x5af1af){return{'name':_0x5af1af[_0x7255('0x2e')],'type':_0x5af1af[_0x7255('0x2f')][_0x7255('0x30')]};});_0x9436cc['model']=_['map'](_0x5bcb34,'name');_0x9436cc[_0x7255('0x31')]=_[_0x7255('0x32')](_0x3eeb50[_0x7255('0x31')]);_0x9436cc[_0x7255('0x33')]=_[_0x7255('0x34')](_0x9436cc[_0x7255('0x35')],_0x9436cc[_0x7255('0x31')]);_0x122a44[_0x7255('0x36')]=_['intersection'](_0x9436cc[_0x7255('0x35')],qs[_0x7255('0x37')](_0x3eeb50['query'][_0x7255('0x37')]));_0x122a44[_0x7255('0x36')]=_0x122a44[_0x7255('0x36')][_0x7255('0x38')]?_0x122a44[_0x7255('0x36')]:_0x9436cc[_0x7255('0x35')];if(!_0x3eeb50['query'][_0x7255('0x39')](_0x7255('0x3a'))){_0x122a44[_0x7255('0x1d')]=qs['limit'](_0x3eeb50[_0x7255('0x31')]['limit']);_0x122a44[_0x7255('0x1b')]=qs[_0x7255('0x1b')](_0x3eeb50[_0x7255('0x31')][_0x7255('0x1b')]);}_0x122a44[_0x7255('0x3b')]=qs[_0x7255('0x3c')](_0x3eeb50[_0x7255('0x31')]['sort']);_0x122a44[_0x7255('0x3d')]=qs[_0x7255('0x33')](_[_0x7255('0x3e')](_0x3eeb50[_0x7255('0x31')],_0x9436cc[_0x7255('0x33')]),_0x5bcb34);if(_0x3eeb50[_0x7255('0x31')]['filter']){_0x122a44[_0x7255('0x3d')]=_[_0x7255('0x3f')](_0x122a44[_0x7255('0x3d')],{'$or':_[_0x7255('0x2c')](_0x5bcb34,function(_0x4d1aba){if(_0x4d1aba[_0x7255('0x2f')]!=='VIRTUAL'){var _0x4d5147={};_0x4d5147[_0x4d1aba[_0x7255('0x40')]]={'$like':'%'+_0x3eeb50['query'][_0x7255('0x41')]+'%'};return _0x4d5147;}})});}_0x122a44=_[_0x7255('0x3f')]({},_0x122a44,_0x3eeb50['options']);var _0x36ca10={'where':_0x122a44[_0x7255('0x3d')]};return db['VoiceChanSpy'][_0x7255('0x1e')](_0x36ca10)[_0x7255('0x24')](function(_0x359a45){_0x464bc0[_0x7255('0x1e')]=_0x359a45;if(_0x3eeb50[_0x7255('0x31')][_0x7255('0x42')]){_0x122a44['include']=[{'all':!![]}];}return db[_0x7255('0x43')][_0x7255('0x44')](_0x122a44);})[_0x7255('0x24')](function(_0x1d4611){_0x464bc0[_0x7255('0x45')]=_0x1d4611;return _0x464bc0;})[_0x7255('0x24')](respondWithFilteredResult(_0x25cc20,_0x122a44))[_0x7255('0x46')](handleError(_0x25cc20,null));};exports[_0x7255('0x47')]=function(_0x22849a,_0x1a39a9){var _0x5d39dd={'raw':![],'where':{'id':_0x22849a['params']['id']}},_0x10c912={};_0x10c912[_0x7255('0x35')]=_[_0x7255('0x32')](db[_0x7255('0x43')]['rawAttributes']);_0x10c912[_0x7255('0x31')]=_[_0x7255('0x32')](_0x22849a[_0x7255('0x31')]);_0x10c912[_0x7255('0x33')]=_[_0x7255('0x34')](_0x10c912[_0x7255('0x35')],_0x10c912[_0x7255('0x31')]);_0x5d39dd[_0x7255('0x36')]=_[_0x7255('0x34')](_0x10c912['model'],qs[_0x7255('0x37')](_0x22849a[_0x7255('0x31')][_0x7255('0x37')]));_0x5d39dd[_0x7255('0x36')]=_0x5d39dd[_0x7255('0x36')][_0x7255('0x38')]?_0x5d39dd['attributes']:_0x10c912['model'];if(_0x22849a[_0x7255('0x31')][_0x7255('0x42')]){_0x5d39dd['include']=[{'all':!![]}];}_0x5d39dd=_['merge']({},_0x5d39dd,_0x22849a['options']);return db[_0x7255('0x43')][_0x7255('0x48')](_0x5d39dd)[_0x7255('0x24')](handleEntityNotFound(_0x1a39a9,null))[_0x7255('0x24')](respondWithResult(_0x1a39a9,null))['catch'](handleError(_0x1a39a9,null));};exports['create']=function(_0x4d2e39,_0x415878){return db['VoiceChanSpy'][_0x7255('0x49')](_0x4d2e39[_0x7255('0x4a')],{})[_0x7255('0x24')](function(_0x5c18ae){var _0x1c730a=_0x4d2e39[_0x7255('0x4b')]['get']({'plain':!![]});if(!_0x1c730a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c730a[_0x7255('0x4c')]===_0x7255('0x4b')){var _0x4e9636=_0x5c18ae[_0x7255('0x26')]({'plain':!![]});var _0x4fba6a=_0x7255('0x27');return db['UserProfileSection'][_0x7255('0x48')]({'where':{'name':_0x4fba6a,'userProfileId':_0x1c730a[_0x7255('0x4d')]},'raw':!![]})[_0x7255('0x24')](function(_0x46517b){if(_0x46517b&&_0x46517b[_0x7255('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e9636[_0x7255('0x40')],'resourceId':_0x4e9636['id'],'type':_0x46517b['name'],'sectionId':_0x46517b['id']},{})[_0x7255('0x24')](function(){return _0x5c18ae;});}else{return _0x5c18ae;}})[_0x7255('0x46')](function(_0x3f532a){logger[_0x7255('0x28')](_0x7255('0x4f'),_0x3f532a);throw _0x3f532a;});}return _0x5c18ae;})[_0x7255('0x24')](respondWithResult(_0x415878,0xc9))['catch'](handleError(_0x415878,null));};exports[_0x7255('0x50')]=function(_0x13697f,_0x53371c){if(_0x13697f['body']['id']){delete _0x13697f[_0x7255('0x4a')]['id'];}return db[_0x7255('0x43')][_0x7255('0x48')]({'where':{'id':_0x13697f['params']['id']}})['then'](handleEntityNotFound(_0x53371c,null))[_0x7255('0x24')](saveUpdates(_0x13697f['body'],null))[_0x7255('0x24')](respondWithResult(_0x53371c,null))[_0x7255('0x46')](handleError(_0x53371c,null));};exports[_0x7255('0x25')]=function(_0x14f203,_0x1a71a7){return db[_0x7255('0x43')][_0x7255('0x48')]({'where':{'id':_0x14f203[_0x7255('0x51')]['id']}})[_0x7255('0x24')](handleEntityNotFound(_0x1a71a7,null))[_0x7255('0x24')](removeEntity(_0x1a71a7,null))[_0x7255('0x46')](handleError(_0x1a71a7,null));}; \ No newline at end of file +var _0x136c=['undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','ChanSpies','end','error','stack','name','send','index','VoiceChanSpy','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','catch','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','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x136c,0x1d2));var _0xc136=function(_0x4d9e6a,_0x314cad){_0x4d9e6a=_0x4d9e6a-0x0;var _0x21ab3a=_0x136c[_0x4d9e6a];return _0x21ab3a;};'use strict';var emlformat=require(_0xc136('0x0'));var rimraf=require(_0xc136('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc136('0x2'));var rp=require(_0xc136('0x3'));var moment=require(_0xc136('0x4'));var BPromise=require(_0xc136('0x5'));var Mustache=require(_0xc136('0x6'));var util=require(_0xc136('0x7'));var path=require(_0xc136('0x8'));var sox=require(_0xc136('0x9'));var csv=require(_0xc136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc136('0xb'));var _=require('lodash');var squel=require(_0xc136('0xc'));var crypto=require(_0xc136('0xd'));var jsforce=require(_0xc136('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc136('0xa'));var querystring=require('querystring');var Papa=require(_0xc136('0xf'));var Redis=require(_0xc136('0x10'));var authService=require(_0xc136('0x11'));var qs=require(_0xc136('0x12'));var as=require(_0xc136('0x13'));var hardwareService=require(_0xc136('0x14'));var logger=require(_0xc136('0x15'))(_0xc136('0x16'));var utils=require(_0xc136('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc136('0x18'))['db'];function respondWithStatusCode(_0x5d0c62,_0x17b00b){_0x17b00b=_0x17b00b||0xcc;return function(_0x473a8b){if(_0x473a8b){return _0x5d0c62[_0xc136('0x19')](_0x17b00b);}return _0x5d0c62['status'](_0x17b00b)['end']();};}function respondWithResult(_0x15be1a,_0x36d55d){_0x36d55d=_0x36d55d||0xc8;return function(_0x4e2674){if(_0x4e2674){return _0x15be1a['status'](_0x36d55d)['json'](_0x4e2674);}};}function respondWithFilteredResult(_0x2e28ba,_0x16e87f){return function(_0x4fa765){if(_0x4fa765){var _0x4e24fb=typeof _0x16e87f['offset']===_0xc136('0x1a')&&typeof _0x16e87f[_0xc136('0x1b')]===_0xc136('0x1a');var _0x155929=_0x4fa765[_0xc136('0x1c')];var _0x1ccf5f=_0x4e24fb?0x0:_0x16e87f['offset'];var _0x5df9b7=_0x4e24fb?_0x4fa765['count']:_0x16e87f[_0xc136('0x1d')]+_0x16e87f['limit'];var _0x238f8c;if(_0x5df9b7>=_0x155929){_0x5df9b7=_0x155929;_0x238f8c=0xc8;}else{_0x238f8c=0xce;}_0x2e28ba[_0xc136('0x1e')](_0x238f8c);return _0x2e28ba[_0xc136('0x1f')](_0xc136('0x20'),_0x1ccf5f+'-'+_0x5df9b7+'/'+_0x155929)['json'](_0x4fa765);}return null;};}function patchUpdates(_0x2b8527){return function(_0x1f942b){try{jsonpatch['apply'](_0x1f942b,_0x2b8527,!![]);}catch(_0xc26366){return BPromise['reject'](_0xc26366);}return _0x1f942b['save']();};}function saveUpdates(_0x5ac0bf,_0x1a350a){return function(_0x4f766d){if(_0x4f766d){return _0x4f766d[_0xc136('0x21')](_0x5ac0bf)[_0xc136('0x22')](function(_0x279c07){return _0x279c07;});}return null;};}function removeEntity(_0x45e5fe,_0x5d8300){return function(_0x6f0831){if(_0x6f0831){return _0x6f0831[_0xc136('0x23')]()['then'](function(){var _0x3432b0=_0x6f0831['get']({'plain':!![]});var _0x21a163=_0xc136('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x21a163,'resourceId':_0x3432b0['id']}})[_0xc136('0x22')](function(){return _0x6f0831;});})[_0xc136('0x22')](function(){_0x45e5fe['status'](0xcc)[_0xc136('0x25')]();});}};}function handleEntityNotFound(_0x283d7a,_0x31e862){return function(_0x2608b8){if(!_0x2608b8){_0x283d7a[_0xc136('0x19')](0x194);}return _0x2608b8;};}function handleError(_0x1c1057,_0xa3e411){_0xa3e411=_0xa3e411||0x1f4;return function(_0x5f3027){logger[_0xc136('0x26')](_0x5f3027[_0xc136('0x27')]);if(_0x5f3027[_0xc136('0x28')]){delete _0x5f3027[_0xc136('0x28')];}_0x1c1057[_0xc136('0x1e')](_0xa3e411)[_0xc136('0x29')](_0x5f3027);};}exports[_0xc136('0x2a')]=function(_0x1cba1e,_0x24632e){var _0x5e591e={},_0x2b3e73={},_0x218d07={'count':0x0,'rows':[]};var _0x4497bc=_['map'](db[_0xc136('0x2b')]['rawAttributes'],function(_0x4e5e09){return{'name':_0x4e5e09[_0xc136('0x2c')],'type':_0x4e5e09[_0xc136('0x2d')][_0xc136('0x2e')]};});_0x2b3e73['model']=_[_0xc136('0x2f')](_0x4497bc,_0xc136('0x28'));_0x2b3e73['query']=_[_0xc136('0x30')](_0x1cba1e[_0xc136('0x31')]);_0x2b3e73['filters']=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],_0x2b3e73[_0xc136('0x31')]);_0x5e591e[_0xc136('0x34')]=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],qs[_0xc136('0x35')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x35')]));_0x5e591e[_0xc136('0x34')]=_0x5e591e[_0xc136('0x34')][_0xc136('0x36')]?_0x5e591e['attributes']:_0x2b3e73[_0xc136('0x33')];if(!_0x1cba1e[_0xc136('0x31')][_0xc136('0x37')](_0xc136('0x38'))){_0x5e591e[_0xc136('0x1b')]=qs[_0xc136('0x1b')](_0x1cba1e[_0xc136('0x31')]['limit']);_0x5e591e[_0xc136('0x1d')]=qs[_0xc136('0x1d')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x1d')]);}_0x5e591e[_0xc136('0x39')]=qs[_0xc136('0x3a')](_0x1cba1e[_0xc136('0x31')]['sort']);_0x5e591e[_0xc136('0x3b')]=qs[_0xc136('0x3c')](_[_0xc136('0x3d')](_0x1cba1e[_0xc136('0x31')],_0x2b3e73[_0xc136('0x3c')]),_0x4497bc);if(_0x1cba1e['query'][_0xc136('0x3e')]){_0x5e591e[_0xc136('0x3b')]=_['merge'](_0x5e591e[_0xc136('0x3b')],{'$or':_[_0xc136('0x2f')](_0x4497bc,function(_0x26d2fc){if(_0x26d2fc[_0xc136('0x2d')]!==_0xc136('0x3f')){var _0x5d404e={};_0x5d404e[_0x26d2fc['name']]={'$like':'%'+_0x1cba1e[_0xc136('0x31')]['filter']+'%'};return _0x5d404e;}})});}_0x5e591e=_[_0xc136('0x40')]({},_0x5e591e,_0x1cba1e[_0xc136('0x41')]);var _0xabd8ff={'where':_0x5e591e[_0xc136('0x3b')]};return db[_0xc136('0x2b')][_0xc136('0x1c')](_0xabd8ff)[_0xc136('0x22')](function(_0x51af1e){_0x218d07['count']=_0x51af1e;if(_0x1cba1e[_0xc136('0x31')]['includeAll']){_0x5e591e[_0xc136('0x42')]=[{'all':!![]}];}return db[_0xc136('0x2b')]['findAll'](_0x5e591e);})[_0xc136('0x22')](function(_0x2c18c6){_0x218d07['rows']=_0x2c18c6;return _0x218d07;})['then'](respondWithFilteredResult(_0x24632e,_0x5e591e))['catch'](handleError(_0x24632e,null));};exports[_0xc136('0x43')]=function(_0x371142,_0x53c426){var _0x141ab0={'raw':![],'where':{'id':_0x371142[_0xc136('0x44')]['id']}},_0x18bed7={};_0x18bed7['model']=_[_0xc136('0x30')](db[_0xc136('0x2b')][_0xc136('0x45')]);_0x18bed7[_0xc136('0x31')]=_[_0xc136('0x30')](_0x371142['query']);_0x18bed7[_0xc136('0x3c')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],_0x18bed7[_0xc136('0x31')]);_0x141ab0[_0xc136('0x34')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],qs[_0xc136('0x35')](_0x371142[_0xc136('0x31')][_0xc136('0x35')]));_0x141ab0[_0xc136('0x34')]=_0x141ab0[_0xc136('0x34')][_0xc136('0x36')]?_0x141ab0[_0xc136('0x34')]:_0x18bed7[_0xc136('0x33')];if(_0x371142[_0xc136('0x31')][_0xc136('0x46')]){_0x141ab0[_0xc136('0x42')]=[{'all':!![]}];}_0x141ab0=_[_0xc136('0x40')]({},_0x141ab0,_0x371142[_0xc136('0x41')]);return db['VoiceChanSpy'][_0xc136('0x47')](_0x141ab0)[_0xc136('0x22')](handleEntityNotFound(_0x53c426,null))[_0xc136('0x22')](respondWithResult(_0x53c426,null))['catch'](handleError(_0x53c426,null));};exports['create']=function(_0x34193c,_0x24f258){return db[_0xc136('0x2b')][_0xc136('0x48')](_0x34193c[_0xc136('0x49')],{})['then'](function(_0x25288d){var _0x133715=_0x34193c[_0xc136('0x4a')][_0xc136('0x4b')]({'plain':!![]});if(!_0x133715)throw new Error(_0xc136('0x4c'));if(_0x133715[_0xc136('0x4d')]===_0xc136('0x4a')){var _0x4ea74f=_0x25288d[_0xc136('0x4b')]({'plain':!![]});var _0x16784c=_0xc136('0x24');return db[_0xc136('0x4e')]['find']({'where':{'name':_0x16784c,'userProfileId':_0x133715['userProfileId']},'raw':!![]})[_0xc136('0x22')](function(_0x2c7b74){if(_0x2c7b74&&_0x2c7b74['autoAssociation']===0x0){return db[_0xc136('0x4f')][_0xc136('0x48')]({'name':_0x4ea74f[_0xc136('0x28')],'resourceId':_0x4ea74f['id'],'type':_0x2c7b74[_0xc136('0x28')],'sectionId':_0x2c7b74['id']},{})[_0xc136('0x22')](function(){return _0x25288d;});}else{return _0x25288d;}})[_0xc136('0x50')](function(_0x2e91d2){logger[_0xc136('0x26')](_0xc136('0x51'),_0x2e91d2);throw _0x2e91d2;});}return _0x25288d;})[_0xc136('0x22')](respondWithResult(_0x24f258,0xc9))['catch'](handleError(_0x24f258,null));};exports['update']=function(_0x16f568,_0x297158){if(_0x16f568[_0xc136('0x49')]['id']){delete _0x16f568[_0xc136('0x49')]['id'];}return db[_0xc136('0x2b')][_0xc136('0x47')]({'where':{'id':_0x16f568[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x297158,null))['then'](saveUpdates(_0x16f568['body'],null))['then'](respondWithResult(_0x297158,null))['catch'](handleError(_0x297158,null));};exports[_0xc136('0x23')]=function(_0x5a18ef,_0x5ab4a0){return db[_0xc136('0x2b')]['find']({'where':{'id':_0x5a18ef[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x5ab4a0,null))['then'](removeEntity(_0x5ab4a0,null))[_0xc136('0x50')](handleError(_0x5ab4a0,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index b6ede9e..7b91783 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 _0xf5fa=['Authenticate','password','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','User','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth'];(function(_0x1f9948,_0x5bb701){var _0x4fb175=function(_0x3f80b7){while(--_0x3f80b7){_0x1f9948['push'](_0x1f9948['shift']());}};_0x4fb175(++_0x5bb701);}(_0xf5fa,0xaf));var _0xaf5f=function(_0x3e89c2,_0x13e513){_0x3e89c2=_0x3e89c2-0x0;var _0x22802a=_0xf5fa[_0x3e89c2];return _0x22802a;};'use strict';var _=require(_0xaf5f('0x0'));var util=require(_0xaf5f('0x1'));var BPromise=require(_0xaf5f('0x2'));var attributes=require(_0xaf5f('0x3'));var getUserApplications=function(_0x181b50,_0x492811,_0x85c482){var _0x2d9c3e=0x1;var _0x414f0=[];var _0x285e7e={'context':_0x492811[_0xaf5f('0x4')]||_0xaf5f('0x5'),'exten':util[_0xaf5f('0x6')](_0xaf5f('0x7'),_0x181b50[_0xaf5f('0x8')],_0x85c482),'type':_0xaf5f('0x9'),'isApp':![],'ChanSpyId':_0x181b50['id'],'UserId':_0x492811['id']};_0x414f0[_0xaf5f('0xa')](_['merge']({'app':_0xaf5f('0xb'),'appdata':util[_0xaf5f('0x6')](_0xaf5f('0xc'),_0xaf5f('0xd')),'priority':_0x2d9c3e++},_0x285e7e));if(_0x181b50[_0xaf5f('0xe')]){_0x414f0[_0xaf5f('0xa')](_[_0xaf5f('0xf')]({'app':_0xaf5f('0x10'),'appdata':util['format'](_0xaf5f('0x11'),_0x181b50[_0xaf5f('0x12')]),'priority':_0x2d9c3e++},_0x285e7e));}if(_0x181b50[_0xaf5f('0x13')]){_0x414f0[_0xaf5f('0xa')](_[_0xaf5f('0xf')]({'app':_0xaf5f('0x14'),'appdata':_0x181b50[_0xaf5f('0x15')],'priority':_0x2d9c3e++},_0x285e7e));}_0x414f0[_0xaf5f('0xa')](_[_0xaf5f('0xf')]({'app':'ChanSpy','appdata':util[_0xaf5f('0x6')](_0xaf5f('0x16'),_0x492811['name'],_0x181b50[_0xaf5f('0x17')]?_0x181b50['options']['join'](''):''),'priority':_0x2d9c3e++},_0x285e7e));if(_0x181b50[_0xaf5f('0xe')]){_0x414f0['push'](_[_0xaf5f('0xf')]({'app':_0xaf5f('0x18'),'priority':_0x2d9c3e++},_0x285e7e));}return _0x414f0;};var getChanSpyApplications=function(_0xfdecb5,_0x3d064b){var _0x1f1ea5=[];for(var _0x546916=0x0,_0x3167bd=0x1;_0x546916<_0x3d064b[_0xaf5f('0x19')];_0x546916++,_0x3167bd=0x1){_0x1f1ea5=_0x1f1ea5[_0xaf5f('0x1a')](getUserApplications(_0xfdecb5,_0x3d064b[_0x546916],_0x3d064b[_0x546916][_0xaf5f('0x1b')]));if(_0x3d064b[_0x546916][_0xaf5f('0x1b')]!=_0x3d064b[_0x546916]['name']){_0x1f1ea5=_0x1f1ea5[_0xaf5f('0x1a')](getUserApplications(_0xfdecb5,_0x3d064b[_0x546916],_0x3d064b[_0x546916]['name']));}}return _0x1f1ea5;};var getChanSpyPromise=function(_0x4908d2,_0x46541d){return new BPromise(function(_0xf77c9b,_0x41c0e9){return _0x4908d2[_0xaf5f('0x1c')]['findAll']({'attributes':['id','name',_0xaf5f('0x1b')],'where':{'role':_0xaf5f('0x1d'),'chanspy':!![]},'raw':!![]})[_0xaf5f('0x1e')](function(_0x3b5647){if(_0x3b5647){return _0xf77c9b(getChanSpyApplications(_0x46541d,_0x3b5647));}return _0xf77c9b([]);})[_0xaf5f('0x1f')](function(_0xb0d051){_0x41c0e9(_0xb0d051);});});};module['exports']=function(_0x14be17,_0x3a0130){var _0x16d2cc=_0x14be17[_0xaf5f('0x20')];return _0x14be17[_0xaf5f('0x21')](_0xaf5f('0x22'),attributes,{'tableName':_0xaf5f('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5353fd,_0x517093,_0x2ca1d6){return getChanSpyPromise(_0x16d2cc,_0x5353fd)[_0xaf5f('0x1e')](function(_0x3918ce){if(_0x3918ce&&_0x3918ce[_0xaf5f('0x19')]){return _0x16d2cc[_0xaf5f('0x24')][_0xaf5f('0x25')](_0x3918ce);}})[_0xaf5f('0x1e')](function(){_0x2ca1d6();})['catch'](function(_0x19714f){_0x2ca1d6(_0x19714f);});},'afterUpdate':function(_0x1785f9,_0x462855,_0x347683){return _0x16d2cc[_0xaf5f('0x24')][_0xaf5f('0x26')]({'where':{'ChanSpyId':_0x1785f9['id']}})['then'](function(){return getChanSpyPromise(_0x16d2cc,_0x1785f9);})[_0xaf5f('0x1e')](function(_0x121edb){if(_0x121edb&&_0x121edb['length']){return _0x16d2cc[_0xaf5f('0x24')][_0xaf5f('0x25')](_0x121edb);}})['then'](function(){_0x347683();})[_0xaf5f('0x1f')](function(_0x304141){_0x347683(_0x304141);});},'afterDestroy':function(_0x49940a,_0x5614c9,_0x3720f7){return _0x16d2cc[_0xaf5f('0x24')][_0xaf5f('0x26')]({'where':{'ChanSpyId':_0x49940a['id']}})['then'](function(){_0x3720f7();})['catch'](function(_0x1efd0f){_0x3720f7(_0x1efd0f);});}}});}; \ No newline at end of file +var _0x7987=['format','%s%s','prefix','system','push','merge','Set','chanspy','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','join','record','StopMixMonitor','length','concat','internal','findAll','then','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip'];(function(_0x4a4046,_0x4fa2b1){var _0x534165=function(_0x3795e5){while(--_0x3795e5){_0x4a4046['push'](_0x4a4046['shift']());}};_0x534165(++_0x4fa2b1);}(_0x7987,0xae));var _0x7798=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x7987[_0x272638];return _0x19d027;};'use strict';var _=require(_0x7798('0x0'));var util=require(_0x7798('0x1'));var BPromise=require(_0x7798('0x2'));var attributes=require(_0x7798('0x3'));var getUserApplications=function(_0x196977,_0x5706fb,_0x234be0){var _0x129e30=0x1;var _0x2063c0=[];var _0x10b85b={'context':_0x5706fb[_0x7798('0x4')]||_0x7798('0x5'),'exten':util[_0x7798('0x6')](_0x7798('0x7'),_0x196977[_0x7798('0x8')],_0x234be0),'type':_0x7798('0x9'),'isApp':![],'ChanSpyId':_0x196977['id'],'UserId':_0x5706fb['id']};_0x2063c0[_0x7798('0xa')](_[_0x7798('0xb')]({'app':_0x7798('0xc'),'appdata':util[_0x7798('0x6')]('CDR(type)=%s',_0x7798('0xd')),'priority':_0x129e30++},_0x10b85b));if(_0x196977['record']){_0x2063c0[_0x7798('0xa')](_[_0x7798('0xb')]({'app':'MixMonitor','appdata':util[_0x7798('0x6')](_0x7798('0xe'),_0x196977[_0x7798('0xf')]),'priority':_0x129e30++},_0x10b85b));}if(_0x196977[_0x7798('0x10')]){_0x2063c0['push'](_[_0x7798('0xb')]({'app':'Authenticate','appdata':_0x196977[_0x7798('0x11')],'priority':_0x129e30++},_0x10b85b));}_0x2063c0[_0x7798('0xa')](_['merge']({'app':_0x7798('0x12'),'appdata':util[_0x7798('0x6')]('SIP/%s,%s',_0x5706fb[_0x7798('0x13')],_0x196977[_0x7798('0x14')]?_0x196977[_0x7798('0x14')][_0x7798('0x15')](''):''),'priority':_0x129e30++},_0x10b85b));if(_0x196977[_0x7798('0x16')]){_0x2063c0['push'](_[_0x7798('0xb')]({'app':_0x7798('0x17'),'priority':_0x129e30++},_0x10b85b));}return _0x2063c0;};var getChanSpyApplications=function(_0x5f228a,_0x51fea4){var _0xc1c26b=[];for(var _0x521dac=0x0,_0x5b4b38=0x1;_0x521dac<_0x51fea4[_0x7798('0x18')];_0x521dac++,_0x5b4b38=0x1){_0xc1c26b=_0xc1c26b[_0x7798('0x19')](getUserApplications(_0x5f228a,_0x51fea4[_0x521dac],_0x51fea4[_0x521dac][_0x7798('0x1a')]));if(_0x51fea4[_0x521dac][_0x7798('0x1a')]!=_0x51fea4[_0x521dac][_0x7798('0x13')]){_0xc1c26b=_0xc1c26b[_0x7798('0x19')](getUserApplications(_0x5f228a,_0x51fea4[_0x521dac],_0x51fea4[_0x521dac]['name']));}}return _0xc1c26b;};var getChanSpyPromise=function(_0x1bc634,_0x57bcfa){return new BPromise(function(_0x5bbd59,_0x325b39){return _0x1bc634['User'][_0x7798('0x1b')]({'attributes':['id',_0x7798('0x13'),_0x7798('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x7798('0x1c')](function(_0x2375b3){if(_0x2375b3){return _0x5bbd59(getChanSpyApplications(_0x57bcfa,_0x2375b3));}return _0x5bbd59([]);})['catch'](function(_0x31f541){_0x325b39(_0x31f541);});});};module['exports']=function(_0xde52ee,_0x34535e){var _0xaf5bc7=_0xde52ee['models'];return _0xde52ee[_0x7798('0x1d')](_0x7798('0x1e'),attributes,{'tableName':_0x7798('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x8461b8,_0x45cc27,_0x38220b){return getChanSpyPromise(_0xaf5bc7,_0x8461b8)['then'](function(_0x3d61b6){if(_0x3d61b6&&_0x3d61b6[_0x7798('0x18')]){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x21')](_0x3d61b6);}})[_0x7798('0x1c')](function(){_0x38220b();})[_0x7798('0x22')](function(_0x459ea0){_0x38220b(_0x459ea0);});},'afterUpdate':function(_0x571384,_0x397e94,_0x21ad5f){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x23')]({'where':{'ChanSpyId':_0x571384['id']}})['then'](function(){return getChanSpyPromise(_0xaf5bc7,_0x571384);})[_0x7798('0x1c')](function(_0x11f399){if(_0x11f399&&_0x11f399[_0x7798('0x18')]){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x21')](_0x11f399);}})[_0x7798('0x1c')](function(){_0x21ad5f();})[_0x7798('0x22')](function(_0x1fce0e){_0x21ad5f(_0x1fce0e);});},'afterDestroy':function(_0x34161b,_0x4e46ce,_0xdb1306){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x23')]({'where':{'ChanSpyId':_0x34161b['id']}})[_0x7798('0x1c')](function(){_0xdb1306();})['catch'](function(_0x5378b2){_0xdb1306(_0x5378b2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 5555c57..ce93f11 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 _0x6308=['stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6308,0x1f2));var _0x8630=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6308[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var moment=require(_0x8630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8630('0x2'));var db=require(_0x8630('0x3'))['db'];var utils=require(_0x8630('0x4'));var logger=require(_0x8630('0x5'))(_0x8630('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8630('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337086,_0x3d5a10,_0x1bcfea){return new BPromise(function(_0x2b87ea,_0x10cc17){return client[_0x8630('0x8')](_0x337086,_0x1bcfea)['then'](function(_0x8b3652){logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));logger[_0x8630('0xb')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x3d5a10,_0x8630('0xa'),JSON[_0x8630('0xc')](_0x8b3652));if(_0x8b3652[_0x8630('0xd')]){if(_0x8b3652['error'][_0x8630('0xe')]===0x1f4){logger[_0x8630('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3d5a10,_0x8b3652['error'][_0x8630('0xf')]);return _0x10cc17(_0x8b3652[_0x8630('0xd')]['message']);}logger[_0x8630('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3d5a10,_0x8b3652[_0x8630('0xd')]['message']);return _0x2b87ea(_0x8b3652[_0x8630('0xd')]['message']);}else{logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));_0x2b87ea(_0x8b3652['result']['message']);}})[_0x8630('0x10')](function(_0x547667){logger[_0x8630('0xd')](_0x8630('0x9'),_0x3d5a10,_0x547667);_0x10cc17(_0x547667);});});} \ No newline at end of file +var _0x0e9f=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x0e9f,0x116));var _0xf0e9=function(_0x32554e,_0x2e45fa){_0x32554e=_0x32554e-0x0;var _0x398088=_0x0e9f[_0x32554e];return _0x398088;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index cc4978e..59cf23b 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 _0xd73c=['get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x140ebe,_0x46b9ff){var _0x1cda8d=function(_0x258324){while(--_0x258324){_0x140ebe['push'](_0x140ebe['shift']());}};_0x1cda8d(++_0x46b9ff);}(_0xd73c,0x14a));var _0xcd73=function(_0x2643ec,_0x25574c){_0x2643ec=_0x2643ec-0x0;var _0x3c7ca3=_0xd73c[_0x2643ec];return _0x3c7ca3;};'use strict';var multer=require(_0xcd73('0x0'));var util=require(_0xcd73('0x1'));var path=require(_0xcd73('0x2'));var timeout=require(_0xcd73('0x3'));var express=require(_0xcd73('0x4'));var router=express[_0xcd73('0x5')]();var fs_extra=require(_0xcd73('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcd73('0x7'));var config=require(_0xcd73('0x8'));var controller=require(_0xcd73('0x9'));router[_0xcd73('0xa')]('/',auth['isAuthenticated'](),controller[_0xcd73('0xb')]);router[_0xcd73('0xa')](_0xcd73('0xc'),auth[_0xcd73('0xd')](),controller['show']);router[_0xcd73('0xe')]('/',auth['isAuthenticated'](),controller[_0xcd73('0xf')]);router[_0xcd73('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcd73('0x11')](_0xcd73('0xc'),auth[_0xcd73('0xd')](),controller[_0xcd73('0x12')]);module[_0xcd73('0x13')]=router; \ No newline at end of file +var _0x3efd=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','show','post','create','put'];(function(_0x55085e,_0x17afe8){var _0x3b2383=function(_0x23d670){while(--_0x23d670){_0x55085e['push'](_0x55085e['shift']());}};_0x3b2383(++_0x17afe8);}(_0x3efd,0x155));var _0xd3ef=function(_0x45f032,_0x37f3b5){_0x45f032=_0x45f032-0x0;var _0x3b5a0e=_0x3efd[_0x45f032];return _0x3b5a0e;};'use strict';var multer=require('multer');var util=require(_0xd3ef('0x0'));var path=require(_0xd3ef('0x1'));var timeout=require(_0xd3ef('0x2'));var express=require(_0xd3ef('0x3'));var router=express['Router']();var fs_extra=require(_0xd3ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd3ef('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth[_0xd3ef('0x6')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd3ef('0x7')]);router[_0xd3ef('0x8')]('/',auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x9')]);router[_0xd3ef('0xa')](_0xd3ef('0xb'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0xc')]);router[_0xd3ef('0xd')](_0xd3ef('0xb'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0xe')]);module[_0xd3ef('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 65afd5b..1f537d8 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 _0x3aa1=['sequelize','exports','STRING','BOOLEAN'];(function(_0x47b281,_0x25034f){var _0x49abfa=function(_0x128818){while(--_0x128818){_0x47b281['push'](_0x47b281['shift']());}};_0x49abfa(++_0x25034f);}(_0x3aa1,0xbc));var _0x13aa=function(_0x572634,_0x10fc65){_0x572634=_0x572634-0x0;var _0x54c717=_0x3aa1[_0x572634];return _0x54c717;};'use strict';var Sequelize=require(_0x13aa('0x0'));module[_0x13aa('0x1')]={'name':{'type':Sequelize[_0x13aa('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x13aa('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x13aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xee96=['BOOLEAN','sequelize','exports','STRING'];(function(_0x8a6b9a,_0x2653ea){var _0x2c296a=function(_0x99c4ab){while(--_0x99c4ab){_0x8a6b9a['push'](_0x8a6b9a['shift']());}};_0x2c296a(++_0x2653ea);}(_0xee96,0xbd));var _0x6ee9=function(_0x5d59d3,_0x9b4d49){_0x5d59d3=_0x5d59d3-0x0;var _0x451fd7=_0xee96[_0x5d59d3];return _0x451fd7;};'use strict';var Sequelize=require(_0x6ee9('0x0'));module[_0x6ee9('0x1')]={'name':{'type':Sequelize[_0x6ee9('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6ee9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 1256845..4ddf894 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 _0xb0bf=['user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','Reload','utf8','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','save','update','get','Contexts','UserProfileResource','destroy','end','stack','name','index','map','VoiceContext','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','keys','rawAttributes','find','create','body','readFileSync','root','server/files/templates/context.ejs','render','writeFileSync','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0xb0bf,0x66));var _0xfb0b=function(_0x72c8e0,_0x50fb77){_0x72c8e0=_0x72c8e0-0x0;var _0x15bd3a=_0xb0bf[_0x72c8e0];return _0x15bd3a;};'use strict';var emlformat=require(_0xfb0b('0x0'));var rimraf=require(_0xfb0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb0b('0x2'));var moment=require(_0xfb0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfb0b('0x4'));var util=require(_0xfb0b('0x5'));var path=require(_0xfb0b('0x6'));var sox=require('sox');var csv=require(_0xfb0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb0b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb0b('0x9'));var toCsv=require(_0xfb0b('0x7'));var querystring=require(_0xfb0b('0xa'));var Papa=require(_0xfb0b('0xb'));var Redis=require('ioredis');var authService=require(_0xfb0b('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb0b('0xd'));var logger=require('../../config/logger')(_0xfb0b('0xe'));var utils=require('../../config/utils');var config=require(_0xfb0b('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb0b('0x10'))['db'];var jayson=require(_0xfb0b('0x11'));var client=jayson[_0xfb0b('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c46fb,_0x2d4337,_0x5c4edc,_0x3f797b){return new BPromise(function(_0x15c0c6,_0x515355){var _0x4e80d9=_0x3f797b||client;return _0x4e80d9[_0xfb0b('0x13')](_0x2c46fb,_0x5c4edc)[_0xfb0b('0x14')](function(_0x16b9c1){logger[_0xfb0b('0x15')](_0xfb0b('0x16'),_0x2d4337,'request\x20sent');logger[_0xfb0b('0x17')](_0xfb0b('0x18'),_0x2d4337,'request\x20sent',JSON[_0xfb0b('0x19')](_0x16b9c1));if(_0x16b9c1[_0xfb0b('0x1a')]){if(_0x16b9c1[_0xfb0b('0x1a')]['code']===0x1f4){logger[_0xfb0b('0x1a')](_0xfb0b('0x16'),_0x2d4337,_0x16b9c1[_0xfb0b('0x1a')][_0xfb0b('0x1b')]);return _0x515355(_0x16b9c1[_0xfb0b('0x1a')][_0xfb0b('0x1b')]);}logger[_0xfb0b('0x1a')](_0xfb0b('0x16'),_0x2d4337,_0x16b9c1[_0xfb0b('0x1a')][_0xfb0b('0x1b')]);return _0x15c0c6(_0x16b9c1[_0xfb0b('0x1a')][_0xfb0b('0x1b')]);}else{logger['info'](_0xfb0b('0x16'),_0x2d4337,_0xfb0b('0x1c'));_0x15c0c6(_0x16b9c1[_0xfb0b('0x1d')][_0xfb0b('0x1b')]);}})[_0xfb0b('0x1e')](function(_0x353e92){logger[_0xfb0b('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x2d4337,_0x353e92);_0x515355(_0x353e92);});});}function respondWithStatusCode(_0x21a854,_0x1ca724){_0x1ca724=_0x1ca724||0xcc;return function(_0x32c85f){if(_0x32c85f){return _0x21a854[_0xfb0b('0x1f')](_0x1ca724);}return _0x21a854[_0xfb0b('0x20')](_0x1ca724)['end']();};}function respondWithResult(_0x3914e5,_0x2f7f38){_0x2f7f38=_0x2f7f38||0xc8;return function(_0x2c7d20){if(_0x2c7d20){return _0x3914e5['status'](_0x2f7f38)[_0xfb0b('0x21')](_0x2c7d20);}};}function respondWithFilteredResult(_0x20395d,_0x2ba069){return function(_0x40aa99){if(_0x40aa99){var _0x5d6649=typeof _0x2ba069['offset']===_0xfb0b('0x22')&&typeof _0x2ba069['limit']==='undefined';var _0x4207f8=_0x40aa99[_0xfb0b('0x23')];var _0xded843=_0x5d6649?0x0:_0x2ba069[_0xfb0b('0x24')];var _0x5a88f1=_0x5d6649?_0x40aa99[_0xfb0b('0x23')]:_0x2ba069['offset']+_0x2ba069[_0xfb0b('0x25')];var _0x246bd2;if(_0x5a88f1>=_0x4207f8){_0x5a88f1=_0x4207f8;_0x246bd2=0xc8;}else{_0x246bd2=0xce;}_0x20395d[_0xfb0b('0x20')](_0x246bd2);return _0x20395d[_0xfb0b('0x26')](_0xfb0b('0x27'),_0xded843+'-'+_0x5a88f1+'/'+_0x4207f8)[_0xfb0b('0x21')](_0x40aa99);}return null;};}function patchUpdates(_0x48c8c3){return function(_0x1e9892){try{jsonpatch['apply'](_0x1e9892,_0x48c8c3,!![]);}catch(_0x70d831){return BPromise['reject'](_0x70d831);}return _0x1e9892[_0xfb0b('0x28')]();};}function saveUpdates(_0x5a7a23,_0x3f941d){return function(_0x1cfcf7){if(_0x1cfcf7){return _0x1cfcf7[_0xfb0b('0x29')](_0x5a7a23)[_0xfb0b('0x14')](function(_0x3e7706){return _0x3e7706;});}return null;};}function removeEntity(_0x38256e,_0x2df16c){return function(_0x4c9d86){if(_0x4c9d86){return _0x4c9d86['destroy']()[_0xfb0b('0x14')](function(){var _0x56473f=_0x4c9d86[_0xfb0b('0x2a')]({'plain':!![]});var _0x1b1773=_0xfb0b('0x2b');return db[_0xfb0b('0x2c')][_0xfb0b('0x2d')]({'where':{'type':_0x1b1773,'resourceId':_0x56473f['id']}})[_0xfb0b('0x14')](function(){return _0x4c9d86;});})['then'](function(){_0x38256e[_0xfb0b('0x20')](0xcc)[_0xfb0b('0x2e')]();});}};}function handleEntityNotFound(_0x1806b5,_0x181b22){return function(_0x2710a4){if(!_0x2710a4){_0x1806b5[_0xfb0b('0x1f')](0x194);}return _0x2710a4;};}function handleError(_0x5d5791,_0x11a8f0){_0x11a8f0=_0x11a8f0||0x1f4;return function(_0x103669){logger['error'](_0x103669[_0xfb0b('0x2f')]);if(_0x103669[_0xfb0b('0x30')]){delete _0x103669[_0xfb0b('0x30')];}_0x5d5791[_0xfb0b('0x20')](_0x11a8f0)['send'](_0x103669);};}exports[_0xfb0b('0x31')]=function(_0x25414a,_0x190f2d){var _0xe69b3={},_0x350b59={},_0x52f413={'count':0x0,'rows':[]};var _0x48f049=_[_0xfb0b('0x32')](db[_0xfb0b('0x33')]['rawAttributes'],function(_0x1e289e){return{'name':_0x1e289e[_0xfb0b('0x34')],'type':_0x1e289e[_0xfb0b('0x35')][_0xfb0b('0x36')]};});_0x350b59[_0xfb0b('0x37')]=_[_0xfb0b('0x32')](_0x48f049,'name');_0x350b59[_0xfb0b('0x38')]=_['keys'](_0x25414a[_0xfb0b('0x38')]);_0x350b59[_0xfb0b('0x39')]=_[_0xfb0b('0x3a')](_0x350b59['model'],_0x350b59[_0xfb0b('0x38')]);_0xe69b3['attributes']=_[_0xfb0b('0x3a')](_0x350b59['model'],qs[_0xfb0b('0x3b')](_0x25414a[_0xfb0b('0x38')][_0xfb0b('0x3b')]));_0xe69b3[_0xfb0b('0x3c')]=_0xe69b3[_0xfb0b('0x3c')][_0xfb0b('0x3d')]?_0xe69b3[_0xfb0b('0x3c')]:_0x350b59['model'];if(!_0x25414a[_0xfb0b('0x38')][_0xfb0b('0x3e')](_0xfb0b('0x3f'))){_0xe69b3[_0xfb0b('0x25')]=qs['limit'](_0x25414a['query']['limit']);_0xe69b3['offset']=qs[_0xfb0b('0x24')](_0x25414a['query'][_0xfb0b('0x24')]);}_0xe69b3['order']=qs['sort'](_0x25414a[_0xfb0b('0x38')]['sort']);_0xe69b3['where']=qs['filters'](_['pick'](_0x25414a[_0xfb0b('0x38')],_0x350b59[_0xfb0b('0x39')]),_0x48f049);if(_0x25414a[_0xfb0b('0x38')][_0xfb0b('0x40')]){_0xe69b3[_0xfb0b('0x41')]=_[_0xfb0b('0x42')](_0xe69b3[_0xfb0b('0x41')],{'$or':_[_0xfb0b('0x32')](_0x48f049,function(_0x5c2a9e){if(_0x5c2a9e['type']!==_0xfb0b('0x43')){var _0x8bae3e={};_0x8bae3e[_0x5c2a9e[_0xfb0b('0x30')]]={'$like':'%'+_0x25414a[_0xfb0b('0x38')][_0xfb0b('0x40')]+'%'};return _0x8bae3e;}})});}_0xe69b3=_['merge']({},_0xe69b3,_0x25414a[_0xfb0b('0x44')]);var _0x136408={'where':_0xe69b3[_0xfb0b('0x41')]};return db[_0xfb0b('0x33')]['count'](_0x136408)['then'](function(_0x427bd4){_0x52f413[_0xfb0b('0x23')]=_0x427bd4;if(_0x25414a['query'][_0xfb0b('0x45')]){_0xe69b3[_0xfb0b('0x46')]=[{'all':!![]}];}return db[_0xfb0b('0x33')][_0xfb0b('0x47')](_0xe69b3);})['then'](function(_0x109c85){_0x52f413[_0xfb0b('0x48')]=_0x109c85;return _0x52f413;})['then'](respondWithFilteredResult(_0x190f2d,_0xe69b3))[_0xfb0b('0x1e')](handleError(_0x190f2d,null));};exports['show']=function(_0x176bcb,_0x311a45){var _0x35d28e={'raw':![],'where':{'id':_0x176bcb['params']['id']}},_0xc69565={};_0xc69565[_0xfb0b('0x37')]=_[_0xfb0b('0x49')](db[_0xfb0b('0x33')][_0xfb0b('0x4a')]);_0xc69565[_0xfb0b('0x38')]=_['keys'](_0x176bcb['query']);_0xc69565[_0xfb0b('0x39')]=_[_0xfb0b('0x3a')](_0xc69565[_0xfb0b('0x37')],_0xc69565[_0xfb0b('0x38')]);_0x35d28e['attributes']=_[_0xfb0b('0x3a')](_0xc69565['model'],qs[_0xfb0b('0x3b')](_0x176bcb['query'][_0xfb0b('0x3b')]));_0x35d28e[_0xfb0b('0x3c')]=_0x35d28e[_0xfb0b('0x3c')][_0xfb0b('0x3d')]?_0x35d28e[_0xfb0b('0x3c')]:_0xc69565['model'];if(_0x176bcb[_0xfb0b('0x38')][_0xfb0b('0x45')]){_0x35d28e[_0xfb0b('0x46')]=[{'all':!![]}];}_0x35d28e=_[_0xfb0b('0x42')]({},_0x35d28e,_0x176bcb[_0xfb0b('0x44')]);return db[_0xfb0b('0x33')][_0xfb0b('0x4b')](_0x35d28e)['then'](handleEntityNotFound(_0x311a45,null))[_0xfb0b('0x14')](respondWithResult(_0x311a45,null))['catch'](handleError(_0x311a45,null));};exports[_0xfb0b('0x4c')]=function(_0x198107,_0x537dd5,_0x5bb559){var _0x304aab;return db[_0xfb0b('0x33')][_0xfb0b('0x4c')](_0x198107[_0xfb0b('0x4d')],{'raw':!![]})[_0xfb0b('0x14')](function(_0x3db135){_0x304aab=_0x3db135;return db['VoiceContext'][_0xfb0b('0x47')]({'raw':!![]});})[_0xfb0b('0x14')](function(_0x3876ce){var _0x3dc4cc=fs[_0xfb0b('0x4e')](path['join'](config[_0xfb0b('0x4f')],_0xfb0b('0x50')),'utf8');var _0xcc814f=ejs[_0xfb0b('0x51')](_0x3dc4cc,{'contexts':_0x3876ce||[]});fs[_0xfb0b('0x52')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xcc814f);})['then'](function(){return respondWithRpcPromise('Reload',_0xfb0b('0x4c'),{'module':_0xfb0b('0x53')});})[_0xfb0b('0x14')](function(){var _0x5d436c=_0x198107['user'][_0xfb0b('0x2a')]({'plain':!![]});if(!_0x5d436c)throw new Error(_0xfb0b('0x54'));if(_0x5d436c[_0xfb0b('0x55')]===_0xfb0b('0x56')){var _0x4921c7=_0x304aab[_0xfb0b('0x2a')]({'plain':!![]});return db['UserProfileSection'][_0xfb0b('0x4b')]({'where':{'name':_0xfb0b('0x2b'),'userProfileId':_0x5d436c['userProfileId']},'raw':!![]})['then'](function(_0x291050){if(_0x291050&&_0x291050[_0xfb0b('0x57')]===0x0){return db[_0xfb0b('0x2c')][_0xfb0b('0x4c')]({'name':_0x4921c7[_0xfb0b('0x30')],'resourceId':_0x4921c7['id'],'type':_0x291050[_0xfb0b('0x30')],'sectionId':_0x291050['id']},{})[_0xfb0b('0x14')](function(){return _0x304aab;});}else{return _0x304aab;}})[_0xfb0b('0x1e')](function(_0x28a882){logger['error'](_0xfb0b('0x58'),_0x28a882);throw _0x28a882;});}return _0x304aab;})['then'](respondWithResult(_0x537dd5,0xc9))[_0xfb0b('0x1e')](handleError(_0x537dd5,null));};exports['update']=function(_0x560f0b,_0x495719,_0x2ab653){var _0x18f856;return db['VoiceContext'][_0xfb0b('0x4b')]({'where':{'id':_0x560f0b[_0xfb0b('0x59')]['id']}})['then'](handleEntityNotFound(_0x495719,null))['then'](saveUpdates(_0x560f0b[_0xfb0b('0x4d')],null))[_0xfb0b('0x14')](function(_0xcb9ebf){if(_0xcb9ebf){_0x18f856=_0xcb9ebf;return db[_0xfb0b('0x33')]['findAll']({'raw':!![]});}})[_0xfb0b('0x14')](function(_0x4cd694){var _0x3b814f=fs[_0xfb0b('0x4e')](path[_0xfb0b('0x5a')](config[_0xfb0b('0x4f')],_0xfb0b('0x50')),'utf8');var _0x3e74df=ejs['render'](_0x3b814f,{'contexts':_0x4cd694||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3e74df);})[_0xfb0b('0x14')](function(){return respondWithRpcPromise(_0xfb0b('0x5b'),_0xfb0b('0x29'),{'module':_0xfb0b('0x53')});})['then'](function(){return _0x18f856;})[_0xfb0b('0x14')](respondWithResult(_0x495719,null))[_0xfb0b('0x1e')](handleError(_0x495719,null));};exports['destroy']=function(_0xb5cf5b,_0x2e3cfc,_0x515c2e){var _0x3d5bfc;return db[_0xfb0b('0x33')][_0xfb0b('0x4b')]({'where':{'id':_0xb5cf5b[_0xfb0b('0x59')]['id']}})[_0xfb0b('0x14')](handleEntityNotFound(_0x2e3cfc,null))['then'](removeEntity(_0x2e3cfc,null))[_0xfb0b('0x14')](function(){return db[_0xfb0b('0x33')][_0xfb0b('0x47')]({'raw':!![]});})[_0xfb0b('0x14')](function(_0x4cec48){var _0x5b15d0=fs['readFileSync'](path['join'](config[_0xfb0b('0x4f')],_0xfb0b('0x50')),_0xfb0b('0x5c'));var _0x44eaec=ejs[_0xfb0b('0x51')](_0x5b15d0,{'contexts':_0x4cec48});fs['writeFileSync'](_0xfb0b('0x5d'),_0x44eaec);return respondWithRpcPromise('Reload',_0xfb0b('0x2d'),{'module':_0xfb0b('0x53')});})[_0xfb0b('0x1e')](handleError(_0x2e3cfc,null));}; \ No newline at end of file +var _0xeda7=['utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','get','UserProfileResource','sendStatus','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VoiceContext','includeAll','include','rows','show','options','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs'];(function(_0x187907,_0x524178){var _0x215f4b=function(_0x304323){while(--_0x304323){_0x187907['push'](_0x187907['shift']());}};_0x215f4b(++_0x524178);}(_0xeda7,0x1bb));var _0x7eda=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xeda7[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x7eda('0x0'));var rimraf=require(_0x7eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7eda('0x2'));var rp=require(_0x7eda('0x3'));var moment=require('moment');var BPromise=require(_0x7eda('0x4'));var Mustache=require(_0x7eda('0x5'));var util=require(_0x7eda('0x6'));var path=require(_0x7eda('0x7'));var sox=require(_0x7eda('0x8'));var csv=require('to-csv');var ejs=require(_0x7eda('0x9'));var fs=require('fs');var fs_extra=require(_0x7eda('0xa'));var _=require(_0x7eda('0xb'));var squel=require(_0x7eda('0xc'));var crypto=require(_0x7eda('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7eda('0xe'));var toCsv=require(_0x7eda('0xf'));var querystring=require(_0x7eda('0x10'));var Papa=require('papaparse');var Redis=require(_0x7eda('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7eda('0x12'));var as=require(_0x7eda('0x13'));var hardwareService=require(_0x7eda('0x14'));var logger=require('../../config/logger')(_0x7eda('0x15'));var utils=require(_0x7eda('0x16'));var config=require(_0x7eda('0x17'));var licenseUtil=require(_0x7eda('0x18'));var db=require(_0x7eda('0x19'))['db'];var jayson=require(_0x7eda('0x1a'));var client=jayson[_0x7eda('0x1b')][_0x7eda('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5cf08f,_0x5c7557,_0x321a18,_0x50ee20){return new BPromise(function(_0x21b282,_0x2641a0){var _0x3436ee=_0x50ee20||client;return _0x3436ee[_0x7eda('0x1d')](_0x5cf08f,_0x321a18)[_0x7eda('0x1e')](function(_0x13167a){logger[_0x7eda('0x1f')](_0x7eda('0x20'),_0x5c7557,_0x7eda('0x21'));logger[_0x7eda('0x22')](_0x7eda('0x23'),_0x5c7557,'request\x20sent',JSON[_0x7eda('0x24')](_0x13167a));if(_0x13167a[_0x7eda('0x25')]){if(_0x13167a[_0x7eda('0x25')][_0x7eda('0x26')]===0x1f4){logger[_0x7eda('0x25')]('VoiceContext,\x20%s,\x20%s',_0x5c7557,_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);return _0x2641a0(_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);}logger['error'](_0x7eda('0x20'),_0x5c7557,_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);return _0x21b282(_0x13167a[_0x7eda('0x25')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5c7557,_0x7eda('0x21'));_0x21b282(_0x13167a[_0x7eda('0x28')]['message']);}})[_0x7eda('0x29')](function(_0x26eadc){logger[_0x7eda('0x25')](_0x7eda('0x20'),_0x5c7557,_0x26eadc);_0x2641a0(_0x26eadc);});});}function respondWithStatusCode(_0x4f9ceb,_0x58d654){_0x58d654=_0x58d654||0xcc;return function(_0x4e62de){if(_0x4e62de){return _0x4f9ceb['sendStatus'](_0x58d654);}return _0x4f9ceb[_0x7eda('0x2a')](_0x58d654)[_0x7eda('0x2b')]();};}function respondWithResult(_0x381210,_0x35bd90){_0x35bd90=_0x35bd90||0xc8;return function(_0x1b498d){if(_0x1b498d){return _0x381210[_0x7eda('0x2a')](_0x35bd90)[_0x7eda('0x2c')](_0x1b498d);}};}function respondWithFilteredResult(_0x175500,_0x1e15c0){return function(_0x3f6656){if(_0x3f6656){var _0x5674f8=typeof _0x1e15c0[_0x7eda('0x2d')]==='undefined'&&typeof _0x1e15c0[_0x7eda('0x2e')]===_0x7eda('0x2f');var _0x311748=_0x3f6656[_0x7eda('0x30')];var _0x58aa13=_0x5674f8?0x0:_0x1e15c0[_0x7eda('0x2d')];var _0x4a56c7=_0x5674f8?_0x3f6656[_0x7eda('0x30')]:_0x1e15c0[_0x7eda('0x2d')]+_0x1e15c0[_0x7eda('0x2e')];var _0x508d66;if(_0x4a56c7>=_0x311748){_0x4a56c7=_0x311748;_0x508d66=0xc8;}else{_0x508d66=0xce;}_0x175500[_0x7eda('0x2a')](_0x508d66);return _0x175500[_0x7eda('0x31')]('Content-Range',_0x58aa13+'-'+_0x4a56c7+'/'+_0x311748)[_0x7eda('0x2c')](_0x3f6656);}return null;};}function patchUpdates(_0x4e52f9){return function(_0x28bd78){try{jsonpatch[_0x7eda('0x32')](_0x28bd78,_0x4e52f9,!![]);}catch(_0x3e99ca){return BPromise[_0x7eda('0x33')](_0x3e99ca);}return _0x28bd78['save']();};}function saveUpdates(_0x4d307a,_0x376700){return function(_0x539a68){if(_0x539a68){return _0x539a68[_0x7eda('0x34')](_0x4d307a)[_0x7eda('0x1e')](function(_0x253701){return _0x253701;});}return null;};}function removeEntity(_0x1e24b6,_0x51ca81){return function(_0x4d5654){if(_0x4d5654){return _0x4d5654[_0x7eda('0x35')]()[_0x7eda('0x1e')](function(){var _0x13e1af=_0x4d5654[_0x7eda('0x36')]({'plain':!![]});var _0xdccdc4='Contexts';return db[_0x7eda('0x37')][_0x7eda('0x35')]({'where':{'type':_0xdccdc4,'resourceId':_0x13e1af['id']}})['then'](function(){return _0x4d5654;});})[_0x7eda('0x1e')](function(){_0x1e24b6[_0x7eda('0x2a')](0xcc)[_0x7eda('0x2b')]();});}};}function handleEntityNotFound(_0xcd23c2,_0x465b28){return function(_0x244e5d){if(!_0x244e5d){_0xcd23c2[_0x7eda('0x38')](0x194);}return _0x244e5d;};}function handleError(_0x5058ad,_0x1f44d2){_0x1f44d2=_0x1f44d2||0x1f4;return function(_0x114512){logger[_0x7eda('0x25')](_0x114512['stack']);if(_0x114512['name']){delete _0x114512['name'];}_0x5058ad['status'](_0x1f44d2)[_0x7eda('0x39')](_0x114512);};}exports[_0x7eda('0x3a')]=function(_0x55c615,_0x26b131){var _0x419993={},_0x130f2a={},_0x59c927={'count':0x0,'rows':[]};var _0x46f9fd=_[_0x7eda('0x3b')](db['VoiceContext'][_0x7eda('0x3c')],function(_0x54a7bc){return{'name':_0x54a7bc[_0x7eda('0x3d')],'type':_0x54a7bc[_0x7eda('0x3e')]['key']};});_0x130f2a[_0x7eda('0x3f')]=_[_0x7eda('0x3b')](_0x46f9fd,_0x7eda('0x40'));_0x130f2a[_0x7eda('0x41')]=_[_0x7eda('0x42')](_0x55c615[_0x7eda('0x41')]);_0x130f2a[_0x7eda('0x43')]=_[_0x7eda('0x44')](_0x130f2a[_0x7eda('0x3f')],_0x130f2a['query']);_0x419993[_0x7eda('0x45')]=_[_0x7eda('0x44')](_0x130f2a[_0x7eda('0x3f')],qs[_0x7eda('0x46')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x46')]));_0x419993[_0x7eda('0x45')]=_0x419993[_0x7eda('0x45')][_0x7eda('0x47')]?_0x419993['attributes']:_0x130f2a[_0x7eda('0x3f')];if(!_0x55c615[_0x7eda('0x41')][_0x7eda('0x48')](_0x7eda('0x49'))){_0x419993[_0x7eda('0x2e')]=qs[_0x7eda('0x2e')](_0x55c615['query'][_0x7eda('0x2e')]);_0x419993[_0x7eda('0x2d')]=qs[_0x7eda('0x2d')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x2d')]);}_0x419993['order']=qs[_0x7eda('0x4a')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x4a')]);_0x419993[_0x7eda('0x4b')]=qs[_0x7eda('0x43')](_['pick'](_0x55c615[_0x7eda('0x41')],_0x130f2a[_0x7eda('0x43')]),_0x46f9fd);if(_0x55c615[_0x7eda('0x41')][_0x7eda('0x4c')]){_0x419993[_0x7eda('0x4b')]=_[_0x7eda('0x4d')](_0x419993[_0x7eda('0x4b')],{'$or':_['map'](_0x46f9fd,function(_0x9c46e7){if(_0x9c46e7[_0x7eda('0x3e')]!=='VIRTUAL'){var _0x5c8906={};_0x5c8906[_0x9c46e7[_0x7eda('0x40')]]={'$like':'%'+_0x55c615[_0x7eda('0x41')]['filter']+'%'};return _0x5c8906;}})});}_0x419993=_[_0x7eda('0x4d')]({},_0x419993,_0x55c615['options']);var _0x16177a={'where':_0x419993[_0x7eda('0x4b')]};return db[_0x7eda('0x4e')][_0x7eda('0x30')](_0x16177a)[_0x7eda('0x1e')](function(_0x1b0464){_0x59c927[_0x7eda('0x30')]=_0x1b0464;if(_0x55c615[_0x7eda('0x41')][_0x7eda('0x4f')]){_0x419993[_0x7eda('0x50')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x419993);})[_0x7eda('0x1e')](function(_0x3e1558){_0x59c927[_0x7eda('0x51')]=_0x3e1558;return _0x59c927;})[_0x7eda('0x1e')](respondWithFilteredResult(_0x26b131,_0x419993))[_0x7eda('0x29')](handleError(_0x26b131,null));};exports[_0x7eda('0x52')]=function(_0x24f448,_0x21f4e5){var _0x4ee8ed={'raw':![],'where':{'id':_0x24f448['params']['id']}},_0x2762a1={};_0x2762a1[_0x7eda('0x3f')]=_['keys'](db['VoiceContext'][_0x7eda('0x3c')]);_0x2762a1['query']=_['keys'](_0x24f448[_0x7eda('0x41')]);_0x2762a1[_0x7eda('0x43')]=_[_0x7eda('0x44')](_0x2762a1['model'],_0x2762a1[_0x7eda('0x41')]);_0x4ee8ed[_0x7eda('0x45')]=_[_0x7eda('0x44')](_0x2762a1[_0x7eda('0x3f')],qs[_0x7eda('0x46')](_0x24f448[_0x7eda('0x41')]['fields']));_0x4ee8ed[_0x7eda('0x45')]=_0x4ee8ed[_0x7eda('0x45')][_0x7eda('0x47')]?_0x4ee8ed['attributes']:_0x2762a1['model'];if(_0x24f448[_0x7eda('0x41')][_0x7eda('0x4f')]){_0x4ee8ed['include']=[{'all':!![]}];}_0x4ee8ed=_[_0x7eda('0x4d')]({},_0x4ee8ed,_0x24f448[_0x7eda('0x53')]);return db[_0x7eda('0x4e')][_0x7eda('0x54')](_0x4ee8ed)[_0x7eda('0x1e')](handleEntityNotFound(_0x21f4e5,null))[_0x7eda('0x1e')](respondWithResult(_0x21f4e5,null))[_0x7eda('0x29')](handleError(_0x21f4e5,null));};exports[_0x7eda('0x55')]=function(_0x314950,_0x5b2fb8,_0x239d6a){var _0x28c134;return db[_0x7eda('0x4e')][_0x7eda('0x55')](_0x314950[_0x7eda('0x56')],{'raw':!![]})[_0x7eda('0x1e')](function(_0x11a5ea){_0x28c134=_0x11a5ea;return db[_0x7eda('0x4e')][_0x7eda('0x57')]({'raw':!![]});})['then'](function(_0x313d14){var _0x5d0e4a=fs[_0x7eda('0x58')](path[_0x7eda('0x59')](config[_0x7eda('0x5a')],_0x7eda('0x5b')),_0x7eda('0x5c'));var _0x223de6=ejs[_0x7eda('0x5d')](_0x5d0e4a,{'contexts':_0x313d14||[]});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x223de6);})[_0x7eda('0x1e')](function(){return respondWithRpcPromise(_0x7eda('0x60'),_0x7eda('0x55'),{'module':_0x7eda('0x61')});})[_0x7eda('0x1e')](function(){var _0x3abc35=_0x314950[_0x7eda('0x62')][_0x7eda('0x36')]({'plain':!![]});if(!_0x3abc35)throw new Error(_0x7eda('0x63'));if(_0x3abc35[_0x7eda('0x64')]===_0x7eda('0x62')){var _0x1d80f3=_0x28c134[_0x7eda('0x36')]({'plain':!![]});return db[_0x7eda('0x65')][_0x7eda('0x54')]({'where':{'name':_0x7eda('0x66'),'userProfileId':_0x3abc35[_0x7eda('0x67')]},'raw':!![]})['then'](function(_0x3b91af){if(_0x3b91af&&_0x3b91af[_0x7eda('0x68')]===0x0){return db[_0x7eda('0x37')][_0x7eda('0x55')]({'name':_0x1d80f3[_0x7eda('0x40')],'resourceId':_0x1d80f3['id'],'type':_0x3b91af[_0x7eda('0x40')],'sectionId':_0x3b91af['id']},{})[_0x7eda('0x1e')](function(){return _0x28c134;});}else{return _0x28c134;}})['catch'](function(_0x4e8b9e){logger['error'](_0x7eda('0x69'),_0x4e8b9e);throw _0x4e8b9e;});}return _0x28c134;})[_0x7eda('0x1e')](respondWithResult(_0x5b2fb8,0xc9))[_0x7eda('0x29')](handleError(_0x5b2fb8,null));};exports['update']=function(_0x1998d6,_0x5afc15,_0x3c6f8c){var _0x1d1559;return db[_0x7eda('0x4e')][_0x7eda('0x54')]({'where':{'id':_0x1998d6['params']['id']}})['then'](handleEntityNotFound(_0x5afc15,null))[_0x7eda('0x1e')](saveUpdates(_0x1998d6['body'],null))['then'](function(_0x3f319c){if(_0x3f319c){_0x1d1559=_0x3f319c;return db[_0x7eda('0x4e')][_0x7eda('0x57')]({'raw':!![]});}})[_0x7eda('0x1e')](function(_0x188a32){var _0x52b4e1=fs[_0x7eda('0x58')](path['join'](config[_0x7eda('0x5a')],_0x7eda('0x5b')),'utf8');var _0x4d0deb=ejs[_0x7eda('0x5d')](_0x52b4e1,{'contexts':_0x188a32||[]});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x4d0deb);})[_0x7eda('0x1e')](function(){return respondWithRpcPromise(_0x7eda('0x60'),_0x7eda('0x34'),{'module':_0x7eda('0x61')});})[_0x7eda('0x1e')](function(){return _0x1d1559;})[_0x7eda('0x1e')](respondWithResult(_0x5afc15,null))[_0x7eda('0x29')](handleError(_0x5afc15,null));};exports[_0x7eda('0x35')]=function(_0x61f774,_0x167d09,_0xdb4033){var _0x52ee48;return db[_0x7eda('0x4e')][_0x7eda('0x54')]({'where':{'id':_0x61f774[_0x7eda('0x6a')]['id']}})['then'](handleEntityNotFound(_0x167d09,null))[_0x7eda('0x1e')](removeEntity(_0x167d09,null))[_0x7eda('0x1e')](function(){return db[_0x7eda('0x4e')]['findAll']({'raw':!![]});})[_0x7eda('0x1e')](function(_0x3f5bda){var _0x4d87e5=fs[_0x7eda('0x58')](path[_0x7eda('0x59')](config['root'],_0x7eda('0x5b')),'utf8');var _0x4dab12=ejs[_0x7eda('0x5d')](_0x4d87e5,{'contexts':_0x3f5bda});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x4dab12);return respondWithRpcPromise('Reload',_0x7eda('0x35'),{'module':_0x7eda('0x61')});})[_0x7eda('0x29')](handleError(_0x167d09,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index a56a894..c8794bf 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 _0x3925=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x3f154d,_0x5c217d){var _0x5ada82=function(_0x390787){while(--_0x390787){_0x3f154d['push'](_0x3f154d['shift']());}};_0x5ada82(++_0x5c217d);}(_0x3925,0x1ba));var _0x5392=function(_0x57d100,_0x3559c7){_0x57d100=_0x57d100-0x0;var _0x170781=_0x3925[_0x57d100];return _0x170781;};'use strict';var _=require(_0x5392('0x0'));var util=require(_0x5392('0x1'));var logger=require(_0x5392('0x2'))(_0x5392('0x3'));var moment=require(_0x5392('0x4'));var BPromise=require(_0x5392('0x5'));var rp=require(_0x5392('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5392('0x7'));var attributes=require(_0x5392('0x8'));module[_0x5392('0x9')]=function(_0x53666e,_0x4cfec7){return _0x53666e[_0x5392('0xa')](_0x5392('0xb'),attributes,{'tableName':_0x5392('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93bd=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','define','voice_contexts'];(function(_0xd3d4ea,_0x51648e){var _0x51cf15=function(_0xadc129){while(--_0xadc129){_0xd3d4ea['push'](_0xd3d4ea['shift']());}};_0x51cf15(++_0x51648e);}(_0x93bd,0x1ef));var _0xd93b=function(_0x17848d,_0x2c71fa){_0x17848d=_0x17848d-0x0;var _0x467214=_0x93bd[_0x17848d];return _0x467214;};'use strict';var _=require(_0xd93b('0x0'));var util=require('util');var logger=require(_0xd93b('0x1'))(_0xd93b('0x2'));var moment=require(_0xd93b('0x3'));var BPromise=require(_0xd93b('0x4'));var rp=require(_0xd93b('0x5'));var fs=require('fs');var path=require(_0xd93b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x524e84,_0x5abf3c){return _0x524e84[_0xd93b('0x7')]('VoiceContext',attributes,{'tableName':_0xd93b('0x8'),'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 1981c92..44dd92a 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 _0xf632=['message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x947d8e,_0x1bca78){var _0x3b5cda=function(_0x2edaa9){while(--_0x2edaa9){_0x947d8e['push'](_0x947d8e['shift']());}};_0x3b5cda(++_0x1bca78);}(_0xf632,0xf9));var _0x2f63=function(_0x42c630,_0x2fb8f0){_0x42c630=_0x42c630-0x0;var _0x30d9c2=_0xf632[_0x42c630];return _0x30d9c2;};'use strict';var _=require(_0x2f63('0x0'));var util=require(_0x2f63('0x1'));var moment=require(_0x2f63('0x2'));var BPromise=require(_0x2f63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f63('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f63('0x5'))(_0x2f63('0x6'));var config=require(_0x2f63('0x7'));var jayson=require(_0x2f63('0x8'));var client=jayson['client'][_0x2f63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb728,_0x210fb4,_0xd2ddee){return new BPromise(function(_0x503399,_0x31321c){return client[_0x2f63('0xa')](_0x2cb728,_0xd2ddee)['then'](function(_0x4fc157){logger[_0x2f63('0xb')](_0x2f63('0xc'),_0x210fb4,_0x2f63('0xd'));logger[_0x2f63('0xe')](_0x2f63('0xf'),_0x210fb4,_0x2f63('0xd'),JSON['stringify'](_0x4fc157));if(_0x4fc157[_0x2f63('0x10')]){if(_0x4fc157[_0x2f63('0x10')]['code']===0x1f4){logger[_0x2f63('0x10')]('VoiceContext,\x20%s,\x20%s',_0x210fb4,_0x4fc157[_0x2f63('0x10')]['message']);return _0x31321c(_0x4fc157[_0x2f63('0x10')][_0x2f63('0x11')]);}logger[_0x2f63('0x10')](_0x2f63('0xc'),_0x210fb4,_0x4fc157[_0x2f63('0x10')][_0x2f63('0x11')]);return _0x503399(_0x4fc157[_0x2f63('0x10')][_0x2f63('0x11')]);}else{logger[_0x2f63('0xb')]('VoiceContext,\x20%s,\x20%s',_0x210fb4,_0x2f63('0xd'));_0x503399(_0x4fc157[_0x2f63('0x12')][_0x2f63('0x11')]);}})['catch'](function(_0x178b4d){logger[_0x2f63('0x10')](_0x2f63('0xc'),_0x210fb4,_0x178b4d);_0x31321c(_0x178b4d);});});} \ No newline at end of file +var _0x4123=['bluebird','randomstring','ioredis','../../mysqldb','../../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','code','error','message','result','catch','lodash','util','moment'];(function(_0x1c5605,_0x18fe62){var _0x4c1961=function(_0x3ee6bc){while(--_0x3ee6bc){_0x1c5605['push'](_0x1c5605['shift']());}};_0x4c1961(++_0x18fe62);}(_0x4123,0x87));var _0x3412=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x4123[_0xe9e6cf];return _0x2b8851;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var moment=require(_0x3412('0x2'));var BPromise=require(_0x3412('0x3'));var rs=require(_0x3412('0x4'));var fs=require('fs');var Redis=require(_0x3412('0x5'));var db=require(_0x3412('0x6'))['db'];var utils=require(_0x3412('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3412('0x8'));var jayson=require(_0x3412('0x9'));var client=jayson['client'][_0x3412('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c6b42,_0x30d18b,_0x43f43c){return new BPromise(function(_0x40c825,_0x2617a6){return client['request'](_0x2c6b42,_0x43f43c)[_0x3412('0xb')](function(_0x2517b0){logger[_0x3412('0xc')](_0x3412('0xd'),_0x30d18b,_0x3412('0xe'));logger[_0x3412('0xf')](_0x3412('0x10'),_0x30d18b,_0x3412('0xe'),JSON[_0x3412('0x11')](_0x2517b0));if(_0x2517b0['error']){if(_0x2517b0['error'][_0x3412('0x12')]===0x1f4){logger[_0x3412('0x13')](_0x3412('0xd'),_0x30d18b,_0x2517b0['error']['message']);return _0x2617a6(_0x2517b0['error'][_0x3412('0x14')]);}logger[_0x3412('0x13')](_0x3412('0xd'),_0x30d18b,_0x2517b0[_0x3412('0x13')][_0x3412('0x14')]);return _0x40c825(_0x2517b0[_0x3412('0x13')][_0x3412('0x14')]);}else{logger[_0x3412('0xc')](_0x3412('0xd'),_0x30d18b,_0x3412('0xe'));_0x40c825(_0x2517b0[_0x3412('0x15')][_0x3412('0x14')]);}})[_0x3412('0x16')](function(_0x854010){logger['error'](_0x3412('0xd'),_0x30d18b,_0x854010);_0x2617a6(_0x854010);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 943b82f..fa51870 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 _0xe88a=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4501a6,_0x34bb7a){var _0x646609=function(_0x5958a7){while(--_0x5958a7){_0x4501a6['push'](_0x4501a6['shift']());}};_0x646609(++_0x34bb7a);}(_0xe88a,0xb1));var _0xae88=function(_0x178557,_0x2cbacb){_0x178557=_0x178557-0x0;var _0x3c98df=_0xe88a[_0x178557];return _0x3c98df;};'use strict';var multer=require(_0xae88('0x0'));var util=require(_0xae88('0x1'));var path=require(_0xae88('0x2'));var timeout=require(_0xae88('0x3'));var express=require(_0xae88('0x4'));var router=express['Router']();var fs_extra=require(_0xae88('0x5'));var auth=require(_0xae88('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae88('0x7'));var controller=require(_0xae88('0x8'));router[_0xae88('0x9')]('/',auth[_0xae88('0xa')](),controller['index']);router[_0xae88('0x9')](_0xae88('0xb'),auth[_0xae88('0xa')](),controller['describe']);router[_0xae88('0x9')](_0xae88('0xc'),auth[_0xae88('0xa')](),controller[_0xae88('0xd')]);router['post']('/',auth[_0xae88('0xa')](),controller[_0xae88('0xe')]);router[_0xae88('0xf')](_0xae88('0xc'),auth[_0xae88('0xa')](),controller[_0xae88('0x10')]);router[_0xae88('0x11')](_0xae88('0xc'),auth['isAuthenticated'](),controller[_0xae88('0x12')]);module[_0xae88('0x13')]=router; \ No newline at end of file +var _0x8801=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8801,0x116));var _0x1880=function(_0x31c28c,_0x4b4bb0){_0x31c28c=_0x31c28c-0x0;var _0x259eb3=_0x8801[_0x31c28c];return _0x259eb3;};'use strict';var multer=require(_0x1880('0x0'));var util=require(_0x1880('0x1'));var path=require(_0x1880('0x2'));var timeout=require(_0x1880('0x3'));var express=require(_0x1880('0x4'));var router=express[_0x1880('0x5')]();var fs_extra=require(_0x1880('0x6'));var auth=require(_0x1880('0x7'));var interaction=require(_0x1880('0x8'));var config=require(_0x1880('0x9'));var controller=require(_0x1880('0xa'));router[_0x1880('0xb')]('/',auth['isAuthenticated'](),controller[_0x1880('0xc')]);router['get'](_0x1880('0xd'),auth[_0x1880('0xe')](),controller[_0x1880('0xf')]);router[_0x1880('0xb')](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x11')]);router[_0x1880('0x12')]('/',auth[_0x1880('0xe')](),controller[_0x1880('0x13')]);router['put'](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x14')]);router['delete'](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x15')]);module[_0x1880('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ca773f4..07b06d5 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(_0x4da4fe,_0x10a05e){var _0x24f795=function(_0x46e75b){while(--_0x46e75b){_0x4da4fe['push'](_0x4da4fe['shift']());}};_0x24f795(++_0x10a05e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x4b84[_0x125ff8];return _0x2d9ef;};'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 _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5ccfd0,_0xecb69e){var _0x1c6950=function(_0xcfd1e2){while(--_0xcfd1e2){_0x5ccfd0['push'](_0x5ccfd0['shift']());}};_0x1c6950(++_0xecb69e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57edf4,_0x1f7dd6){_0x57edf4=_0x57edf4-0x0;var _0x266b56=_0x9bde[_0x57edf4];return _0x266b56;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 77ced15..73c8b45 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 _0x9413=['key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','options','create','body','update','find','describe','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','count','limit','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','map','VoiceDialReport','fieldName','type'];(function(_0x3b1a74,_0x431559){var _0x58b051=function(_0x2b62c4){while(--_0x2b62c4){_0x3b1a74['push'](_0x3b1a74['shift']());}};_0x58b051(++_0x431559);}(_0x9413,0x182));var _0x3941=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x9413[_0x282ccc];return _0x27c2dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3941('0x0'));var jsonpatch=require(_0x3941('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3941('0x2'));var util=require(_0x3941('0x3'));var path=require(_0x3941('0x4'));var sox=require(_0x3941('0x5'));var csv=require(_0x3941('0x6'));var ejs=require(_0x3941('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3941('0x8'));var deskjs=require(_0x3941('0x9'));var toCsv=require(_0x3941('0x6'));var querystring=require('querystring');var Papa=require(_0x3941('0xa'));var Redis=require(_0x3941('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x3941('0xc'));var as=require(_0x3941('0xd'));var hardwareService=require(_0x3941('0xe'));var logger=require(_0x3941('0xf'))('api');var utils=require(_0x3941('0x10'));var config=require(_0x3941('0x11'));var licenseUtil=require(_0x3941('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19b03a,_0x2e2974){_0x2e2974=_0x2e2974||0xcc;return function(_0x49bcc1){if(_0x49bcc1){return _0x19b03a[_0x3941('0x13')](_0x2e2974);}return _0x19b03a[_0x3941('0x14')](_0x2e2974)['end']();};}function respondWithResult(_0x363f86,_0x209e1b){_0x209e1b=_0x209e1b||0xc8;return function(_0x4173f1){if(_0x4173f1){return _0x363f86[_0x3941('0x14')](_0x209e1b)['json'](_0x4173f1);}};}function respondWithFilteredResult(_0xb59985,_0x19683e){return function(_0x59e386){if(_0x59e386){var _0x13d723=typeof _0x19683e[_0x3941('0x15')]==='undefined'&&typeof _0x19683e['limit']==='undefined';var _0x34e2bf=_0x59e386[_0x3941('0x16')];var _0x27ed64=_0x13d723?0x0:_0x19683e['offset'];var _0x8e0f53=_0x13d723?_0x59e386['count']:_0x19683e[_0x3941('0x15')]+_0x19683e[_0x3941('0x17')];var _0x297d42;if(_0x8e0f53>=_0x34e2bf){_0x8e0f53=_0x34e2bf;_0x297d42=0xc8;}else{_0x297d42=0xce;}_0xb59985[_0x3941('0x14')](_0x297d42);return _0xb59985['set'](_0x3941('0x18'),_0x27ed64+'-'+_0x8e0f53+'/'+_0x34e2bf)[_0x3941('0x19')](_0x59e386);}return null;};}function patchUpdates(_0x57dbc6){return function(_0xb0c6ff){try{jsonpatch[_0x3941('0x1a')](_0xb0c6ff,_0x57dbc6,!![]);}catch(_0xacd3c8){return BPromise[_0x3941('0x1b')](_0xacd3c8);}return _0xb0c6ff[_0x3941('0x1c')]();};}function saveUpdates(_0xa0d6b4,_0x4750f1){return function(_0x9448e9){if(_0x9448e9){return _0x9448e9['update'](_0xa0d6b4)[_0x3941('0x1d')](function(_0x20b5c8){return _0x20b5c8;});}return null;};}function removeEntity(_0xadb48c,_0x9a8dda){return function(_0xea7850){if(_0xea7850){return _0xea7850[_0x3941('0x1e')]()[_0x3941('0x1d')](function(){_0xadb48c[_0x3941('0x14')](0xcc)[_0x3941('0x1f')]();});}};}function handleEntityNotFound(_0x3c9d3e,_0x351f64){return function(_0x34dc7e){if(!_0x34dc7e){_0x3c9d3e[_0x3941('0x13')](0x194);}return _0x34dc7e;};}function handleError(_0x337796,_0x3ddf59){_0x3ddf59=_0x3ddf59||0x1f4;return function(_0x40b39f){logger[_0x3941('0x20')](_0x40b39f[_0x3941('0x21')]);if(_0x40b39f[_0x3941('0x22')]){delete _0x40b39f['name'];}_0x337796[_0x3941('0x14')](_0x3ddf59)[_0x3941('0x23')](_0x40b39f);};}exports['index']=function(_0x5f339d,_0x4fec77){var _0x7e689c={},_0x26b97d={},_0x8355a9={'count':0x0,'rows':[]};var _0x2c841a=_[_0x3941('0x24')](db[_0x3941('0x25')]['rawAttributes'],function(_0x758495){return{'name':_0x758495[_0x3941('0x26')],'type':_0x758495[_0x3941('0x27')][_0x3941('0x28')]};});_0x26b97d[_0x3941('0x29')]=_['map'](_0x2c841a,_0x3941('0x22'));_0x26b97d['query']=_['keys'](_0x5f339d[_0x3941('0x2a')]);_0x26b97d['filters']=_[_0x3941('0x2b')](_0x26b97d['model'],_0x26b97d['query']);_0x7e689c['attributes']=_[_0x3941('0x2b')](_0x26b97d[_0x3941('0x29')],qs[_0x3941('0x2c')](_0x5f339d['query']['fields']));_0x7e689c[_0x3941('0x2d')]=_0x7e689c[_0x3941('0x2d')]['length']?_0x7e689c[_0x3941('0x2d')]:_0x26b97d[_0x3941('0x29')];if(!_0x5f339d[_0x3941('0x2a')][_0x3941('0x2e')]('nolimit')){_0x7e689c['limit']=qs[_0x3941('0x17')](_0x5f339d['query']['limit']);_0x7e689c[_0x3941('0x15')]=qs[_0x3941('0x15')](_0x5f339d[_0x3941('0x2a')][_0x3941('0x15')]);}_0x7e689c[_0x3941('0x2f')]=qs[_0x3941('0x30')](_0x5f339d[_0x3941('0x2a')]['sort']);_0x7e689c[_0x3941('0x31')]=qs[_0x3941('0x32')](_[_0x3941('0x33')](_0x5f339d['query'],_0x26b97d[_0x3941('0x32')]),_0x2c841a);if(_0x5f339d['query'][_0x3941('0x34')]){_0x7e689c[_0x3941('0x31')]=_[_0x3941('0x35')](_0x7e689c[_0x3941('0x31')],{'$or':_[_0x3941('0x24')](_0x2c841a,function(_0x8861ce){if(_0x8861ce[_0x3941('0x27')]!==_0x3941('0x36')){var _0x42fab3={};_0x42fab3[_0x8861ce[_0x3941('0x22')]]={'$like':'%'+_0x5f339d[_0x3941('0x2a')][_0x3941('0x34')]+'%'};return _0x42fab3;}})});}_0x7e689c=_['merge']({},_0x7e689c,_0x5f339d['options']);var _0x24c2fc={'where':_0x7e689c[_0x3941('0x31')]};return db['VoiceDialReport'][_0x3941('0x16')](_0x24c2fc)[_0x3941('0x1d')](function(_0x5d7f0a){_0x8355a9[_0x3941('0x16')]=_0x5d7f0a;if(_0x5f339d['query'][_0x3941('0x37')]){_0x7e689c['include']=[{'all':!![]}];}return db[_0x3941('0x25')][_0x3941('0x38')](_0x7e689c);})[_0x3941('0x1d')](function(_0x1bce8a){_0x8355a9[_0x3941('0x39')]=_0x1bce8a;return _0x8355a9;})[_0x3941('0x1d')](respondWithFilteredResult(_0x4fec77,_0x7e689c))[_0x3941('0x3a')](handleError(_0x4fec77,null));};exports[_0x3941('0x3b')]=function(_0x3a396e,_0x26c14e){var _0x916169={'raw':!![],'where':{'id':_0x3a396e[_0x3941('0x3c')]['id']}},_0x4c8762={};_0x4c8762[_0x3941('0x29')]=_[_0x3941('0x3d')](db[_0x3941('0x25')][_0x3941('0x3e')]);_0x4c8762[_0x3941('0x2a')]=_[_0x3941('0x3d')](_0x3a396e['query']);_0x4c8762[_0x3941('0x32')]=_[_0x3941('0x2b')](_0x4c8762['model'],_0x4c8762['query']);_0x916169[_0x3941('0x2d')]=_['intersection'](_0x4c8762[_0x3941('0x29')],qs[_0x3941('0x2c')](_0x3a396e[_0x3941('0x2a')]['fields']));_0x916169['attributes']=_0x916169[_0x3941('0x2d')][_0x3941('0x3f')]?_0x916169[_0x3941('0x2d')]:_0x4c8762[_0x3941('0x29')];if(_0x3a396e[_0x3941('0x2a')]['includeAll']){_0x916169[_0x3941('0x40')]=[{'all':!![]}];}_0x916169=_[_0x3941('0x35')]({},_0x916169,_0x3a396e[_0x3941('0x41')]);return db[_0x3941('0x25')]['find'](_0x916169)[_0x3941('0x1d')](handleEntityNotFound(_0x26c14e,null))[_0x3941('0x1d')](respondWithResult(_0x26c14e,null))[_0x3941('0x3a')](handleError(_0x26c14e,null));};exports[_0x3941('0x42')]=function(_0x26b6f1,_0x58697d){return db[_0x3941('0x25')][_0x3941('0x42')](_0x26b6f1[_0x3941('0x43')],{})['then'](respondWithResult(_0x58697d,0xc9))[_0x3941('0x3a')](handleError(_0x58697d,null));};exports[_0x3941('0x44')]=function(_0x276fdc,_0x1c2d9e){if(_0x276fdc[_0x3941('0x43')]['id']){delete _0x276fdc[_0x3941('0x43')]['id'];}return db[_0x3941('0x25')][_0x3941('0x45')]({'where':{'id':_0x276fdc['params']['id']}})[_0x3941('0x1d')](handleEntityNotFound(_0x1c2d9e,null))[_0x3941('0x1d')](saveUpdates(_0x276fdc[_0x3941('0x43')],null))['then'](respondWithResult(_0x1c2d9e,null))[_0x3941('0x3a')](handleError(_0x1c2d9e,null));};exports[_0x3941('0x1e')]=function(_0x241397,_0x4e262a){return db[_0x3941('0x25')][_0x3941('0x45')]({'where':{'id':_0x241397[_0x3941('0x3c')]['id']}})[_0x3941('0x1d')](handleEntityNotFound(_0x4e262a,null))['then'](removeEntity(_0x4e262a,null))[_0x3941('0x3a')](handleError(_0x4e262a,null));};exports[_0x3941('0x46')]=function(_0x508055,_0x2ff843){return db[_0x3941('0x25')][_0x3941('0x46')]()[_0x3941('0x1d')](respondWithResult(_0x2ff843,null))[_0x3941('0x3a')](handleError(_0x2ff843,null));}; \ No newline at end of file +var _0x29ef=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','model','keys','query','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','VoiceDialReport','findAll','rows','catch','rawAttributes','fields','attributes','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x271322,_0x3111c7){var _0x42cf56=function(_0x439c69){while(--_0x439c69){_0x271322['push'](_0x271322['shift']());}};_0x42cf56(++_0x3111c7);}(_0x29ef,0xd7));var _0xf29e=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x29ef[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0xf29e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf29e('0x1'));var jsonpatch=require(_0xf29e('0x2'));var rp=require(_0xf29e('0x3'));var moment=require(_0xf29e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf29e('0x5'));var util=require(_0xf29e('0x6'));var path=require(_0xf29e('0x7'));var sox=require('sox');var csv=require(_0xf29e('0x8'));var ejs=require(_0xf29e('0x9'));var fs=require('fs');var fs_extra=require(_0xf29e('0xa'));var _=require(_0xf29e('0xb'));var squel=require(_0xf29e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf29e('0xd'));var deskjs=require(_0xf29e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf29e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf29e('0x10'));var authService=require(_0xf29e('0x11'));var qs=require(_0xf29e('0x12'));var as=require(_0xf29e('0x13'));var hardwareService=require(_0xf29e('0x14'));var logger=require(_0xf29e('0x15'))(_0xf29e('0x16'));var utils=require(_0xf29e('0x17'));var config=require(_0xf29e('0x18'));var licenseUtil=require(_0xf29e('0x19'));var db=require(_0xf29e('0x1a'))['db'];function respondWithStatusCode(_0x5e81cc,_0x220c74){_0x220c74=_0x220c74||0xcc;return function(_0x5b7adc){if(_0x5b7adc){return _0x5e81cc[_0xf29e('0x1b')](_0x220c74);}return _0x5e81cc[_0xf29e('0x1c')](_0x220c74)[_0xf29e('0x1d')]();};}function respondWithResult(_0x1614e5,_0x347096){_0x347096=_0x347096||0xc8;return function(_0x1e9fae){if(_0x1e9fae){return _0x1614e5[_0xf29e('0x1c')](_0x347096)[_0xf29e('0x1e')](_0x1e9fae);}};}function respondWithFilteredResult(_0x34f563,_0x521c14){return function(_0x35e16b){if(_0x35e16b){var _0x724628=typeof _0x521c14[_0xf29e('0x1f')]===_0xf29e('0x20')&&typeof _0x521c14[_0xf29e('0x21')]==='undefined';var _0x411e4b=_0x35e16b[_0xf29e('0x22')];var _0x543d39=_0x724628?0x0:_0x521c14['offset'];var _0x1e7cdc=_0x724628?_0x35e16b['count']:_0x521c14[_0xf29e('0x1f')]+_0x521c14['limit'];var _0x1cc20e;if(_0x1e7cdc>=_0x411e4b){_0x1e7cdc=_0x411e4b;_0x1cc20e=0xc8;}else{_0x1cc20e=0xce;}_0x34f563[_0xf29e('0x1c')](_0x1cc20e);return _0x34f563[_0xf29e('0x23')]('Content-Range',_0x543d39+'-'+_0x1e7cdc+'/'+_0x411e4b)[_0xf29e('0x1e')](_0x35e16b);}return null;};}function patchUpdates(_0x365734){return function(_0xd9394d){try{jsonpatch['apply'](_0xd9394d,_0x365734,!![]);}catch(_0x398f64){return BPromise[_0xf29e('0x24')](_0x398f64);}return _0xd9394d[_0xf29e('0x25')]();};}function saveUpdates(_0xbc06f2,_0x3c7c5c){return function(_0x40ae7e){if(_0x40ae7e){return _0x40ae7e['update'](_0xbc06f2)[_0xf29e('0x26')](function(_0x199fb5){return _0x199fb5;});}return null;};}function removeEntity(_0x2c597f,_0x218ae1){return function(_0x366467){if(_0x366467){return _0x366467[_0xf29e('0x27')]()[_0xf29e('0x26')](function(){_0x2c597f['status'](0xcc)[_0xf29e('0x1d')]();});}};}function handleEntityNotFound(_0x18b4fe,_0x3c0962){return function(_0x3de672){if(!_0x3de672){_0x18b4fe[_0xf29e('0x1b')](0x194);}return _0x3de672;};}function handleError(_0x5114dd,_0x192328){_0x192328=_0x192328||0x1f4;return function(_0x1d4d24){logger[_0xf29e('0x28')](_0x1d4d24[_0xf29e('0x29')]);if(_0x1d4d24['name']){delete _0x1d4d24[_0xf29e('0x2a')];}_0x5114dd['status'](_0x192328)[_0xf29e('0x2b')](_0x1d4d24);};}exports[_0xf29e('0x2c')]=function(_0x10bd71,_0x5aafff){var _0x39cb72={},_0x3d8cec={},_0x5c73b4={'count':0x0,'rows':[]};var _0x19d125=_[_0xf29e('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x4bd785){return{'name':_0x4bd785[_0xf29e('0x2e')],'type':_0x4bd785[_0xf29e('0x2f')]['key']};});_0x3d8cec[_0xf29e('0x30')]=_[_0xf29e('0x2d')](_0x19d125,_0xf29e('0x2a'));_0x3d8cec['query']=_[_0xf29e('0x31')](_0x10bd71[_0xf29e('0x32')]);_0x3d8cec['filters']=_['intersection'](_0x3d8cec[_0xf29e('0x30')],_0x3d8cec['query']);_0x39cb72['attributes']=_[_0xf29e('0x33')](_0x3d8cec[_0xf29e('0x30')],qs['fields'](_0x10bd71['query']['fields']));_0x39cb72['attributes']=_0x39cb72['attributes']['length']?_0x39cb72['attributes']:_0x3d8cec[_0xf29e('0x30')];if(!_0x10bd71[_0xf29e('0x32')][_0xf29e('0x34')](_0xf29e('0x35'))){_0x39cb72[_0xf29e('0x21')]=qs[_0xf29e('0x21')](_0x10bd71[_0xf29e('0x32')]['limit']);_0x39cb72['offset']=qs[_0xf29e('0x1f')](_0x10bd71[_0xf29e('0x32')]['offset']);}_0x39cb72[_0xf29e('0x36')]=qs['sort'](_0x10bd71[_0xf29e('0x32')][_0xf29e('0x37')]);_0x39cb72[_0xf29e('0x38')]=qs[_0xf29e('0x39')](_[_0xf29e('0x3a')](_0x10bd71[_0xf29e('0x32')],_0x3d8cec['filters']),_0x19d125);if(_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3b')]){_0x39cb72['where']=_[_0xf29e('0x3c')](_0x39cb72[_0xf29e('0x38')],{'$or':_[_0xf29e('0x2d')](_0x19d125,function(_0x2a942f){if(_0x2a942f['type']!=='VIRTUAL'){var _0x3d414e={};_0x3d414e[_0x2a942f[_0xf29e('0x2a')]]={'$like':'%'+_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3b')]+'%'};return _0x3d414e;}})});}_0x39cb72=_[_0xf29e('0x3c')]({},_0x39cb72,_0x10bd71[_0xf29e('0x3d')]);var _0x542be6={'where':_0x39cb72[_0xf29e('0x38')]};return db['VoiceDialReport']['count'](_0x542be6)[_0xf29e('0x26')](function(_0x4b4816){_0x5c73b4[_0xf29e('0x22')]=_0x4b4816;if(_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3e')]){_0x39cb72[_0xf29e('0x3f')]=[{'all':!![]}];}return db[_0xf29e('0x40')][_0xf29e('0x41')](_0x39cb72);})[_0xf29e('0x26')](function(_0x5e04ba){_0x5c73b4[_0xf29e('0x42')]=_0x5e04ba;return _0x5c73b4;})[_0xf29e('0x26')](respondWithFilteredResult(_0x5aafff,_0x39cb72))[_0xf29e('0x43')](handleError(_0x5aafff,null));};exports['show']=function(_0x596c72,_0x24a09e){var _0x5a38ac={'raw':!![],'where':{'id':_0x596c72['params']['id']}},_0xe7f3ac={};_0xe7f3ac[_0xf29e('0x30')]=_[_0xf29e('0x31')](db[_0xf29e('0x40')][_0xf29e('0x44')]);_0xe7f3ac['query']=_[_0xf29e('0x31')](_0x596c72[_0xf29e('0x32')]);_0xe7f3ac[_0xf29e('0x39')]=_[_0xf29e('0x33')](_0xe7f3ac[_0xf29e('0x30')],_0xe7f3ac[_0xf29e('0x32')]);_0x5a38ac['attributes']=_['intersection'](_0xe7f3ac['model'],qs[_0xf29e('0x45')](_0x596c72[_0xf29e('0x32')][_0xf29e('0x45')]));_0x5a38ac[_0xf29e('0x46')]=_0x5a38ac[_0xf29e('0x46')][_0xf29e('0x47')]?_0x5a38ac[_0xf29e('0x46')]:_0xe7f3ac[_0xf29e('0x30')];if(_0x596c72[_0xf29e('0x32')][_0xf29e('0x3e')]){_0x5a38ac['include']=[{'all':!![]}];}_0x5a38ac=_[_0xf29e('0x3c')]({},_0x5a38ac,_0x596c72['options']);return db[_0xf29e('0x40')][_0xf29e('0x48')](_0x5a38ac)[_0xf29e('0x26')](handleEntityNotFound(_0x24a09e,null))[_0xf29e('0x26')](respondWithResult(_0x24a09e,null))[_0xf29e('0x43')](handleError(_0x24a09e,null));};exports[_0xf29e('0x49')]=function(_0x14742e,_0x407236){return db[_0xf29e('0x40')][_0xf29e('0x49')](_0x14742e['body'],{})[_0xf29e('0x26')](respondWithResult(_0x407236,0xc9))[_0xf29e('0x43')](handleError(_0x407236,null));};exports['update']=function(_0x4eefd8,_0x3e2411){if(_0x4eefd8[_0xf29e('0x4a')]['id']){delete _0x4eefd8[_0xf29e('0x4a')]['id'];}return db[_0xf29e('0x40')][_0xf29e('0x48')]({'where':{'id':_0x4eefd8[_0xf29e('0x4b')]['id']}})[_0xf29e('0x26')](handleEntityNotFound(_0x3e2411,null))[_0xf29e('0x26')](saveUpdates(_0x4eefd8[_0xf29e('0x4a')],null))[_0xf29e('0x26')](respondWithResult(_0x3e2411,null))['catch'](handleError(_0x3e2411,null));};exports[_0xf29e('0x27')]=function(_0x46ab97,_0xa9574f){return db[_0xf29e('0x40')][_0xf29e('0x48')]({'where':{'id':_0x46ab97[_0xf29e('0x4b')]['id']}})[_0xf29e('0x26')](handleEntityNotFound(_0xa9574f,null))[_0xf29e('0x26')](removeEntity(_0xa9574f,null))['catch'](handleError(_0xa9574f,null));};exports[_0xf29e('0x4c')]=function(_0x1fd574,_0x1eaf1a){return db[_0xf29e('0x40')][_0xf29e('0x4c')]()[_0xf29e('0x26')](respondWithResult(_0x1eaf1a,null))['catch'](handleError(_0x1eaf1a,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 7ebc8d4..90961cc 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 _0x5482=['request-promise','path','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xb6b780,_0x24672e){var _0xfeb08c=function(_0x4ac5b0){while(--_0x4ac5b0){_0xb6b780['push'](_0xb6b780['shift']());}};_0xfeb08c(++_0x24672e);}(_0x5482,0xf8));var _0x2548=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x5482[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var logger=require(_0x2548('0x2'))(_0x2548('0x3'));var moment=require(_0x2548('0x4'));var BPromise=require('bluebird');var rp=require(_0x2548('0x5'));var fs=require('fs');var path=require(_0x2548('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x2548('0x7')]=function(_0x238ced,_0x3c6201){return _0x238ced[_0x2548('0x8')]('VoiceDialReport',attributes,{'tableName':_0x2548('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2548('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf363=['report_dial','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport'];(function(_0x3a18f9,_0x416ace){var _0x140ad4=function(_0x14bbe9){while(--_0x14bbe9){_0x3a18f9['push'](_0x3a18f9['shift']());}};_0x140ad4(++_0x416ace);}(_0xf363,0xd9));var _0x3f36=function(_0x43f665,_0x55bec1){_0x43f665=_0x43f665-0x0;var _0x5337e9=_0xf363[_0x43f665];return _0x5337e9;};'use strict';var _=require('lodash');var util=require(_0x3f36('0x0'));var logger=require(_0x3f36('0x1'))(_0x3f36('0x2'));var moment=require(_0x3f36('0x3'));var BPromise=require(_0x3f36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f36('0x5'));var rimraf=require(_0x3f36('0x6'));var config=require(_0x3f36('0x7'));var attributes=require(_0x3f36('0x8'));module[_0x3f36('0x9')]=function(_0x243ad7,_0x35151f){return _0x243ad7['define'](_0x3f36('0xa'),attributes,{'tableName':_0x3f36('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6ef1772..5620eb8 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 _0x3d96=['VoiceDialReport','update','body','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','request\x20sent','result','catch','create','options','CreateVoiceDialReport','stringify','UpdateVoiceDialReport'];(function(_0x2924e1,_0x2bfc08){var _0x14c954=function(_0x580e2e){while(--_0x580e2e){_0x2924e1['push'](_0x2924e1['shift']());}};_0x14c954(++_0x2bfc08);}(_0x3d96,0x139));var _0x63d9=function(_0xfe490,_0x88dddb){_0xfe490=_0xfe490-0x0;var _0x2a511a=_0x3d96[_0xfe490];return _0x2a511a;};'use strict';var _=require(_0x63d9('0x0'));var util=require('util');var moment=require(_0x63d9('0x1'));var BPromise=require(_0x63d9('0x2'));var rs=require(_0x63d9('0x3'));var fs=require('fs');var Redis=require(_0x63d9('0x4'));var db=require(_0x63d9('0x5'))['db'];var utils=require(_0x63d9('0x6'));var logger=require(_0x63d9('0x7'))(_0x63d9('0x8'));var config=require('../../config/environment');var jayson=require(_0x63d9('0x9'));var client=jayson[_0x63d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37b95f,_0x5975ff,_0x3d994b){return new BPromise(function(_0x24d2c5,_0xcc4288){return client['request'](_0x37b95f,_0x3d994b)[_0x63d9('0xb')](function(_0x509761){logger[_0x63d9('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x5975ff,'request\x20sent');logger[_0x63d9('0xd')](_0x63d9('0xe'),_0x5975ff,'request\x20sent',JSON['stringify'](_0x509761));if(_0x509761[_0x63d9('0xf')]){if(_0x509761[_0x63d9('0xf')][_0x63d9('0x10')]===0x1f4){logger[_0x63d9('0xf')](_0x63d9('0x11'),_0x5975ff,_0x509761[_0x63d9('0xf')][_0x63d9('0x12')]);return _0xcc4288(_0x509761[_0x63d9('0xf')][_0x63d9('0x12')]);}logger[_0x63d9('0xf')](_0x63d9('0x11'),_0x5975ff,_0x509761[_0x63d9('0xf')]['message']);return _0x24d2c5(_0x509761[_0x63d9('0xf')][_0x63d9('0x12')]);}else{logger[_0x63d9('0xc')](_0x63d9('0x11'),_0x5975ff,_0x63d9('0x13'));_0x24d2c5(_0x509761[_0x63d9('0x14')][_0x63d9('0x12')]);}})[_0x63d9('0x15')](function(_0x10639f){logger[_0x63d9('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x5975ff,_0x10639f);_0xcc4288(_0x10639f);});});}exports['CreateVoiceDialReport']=function(_0x166000){var _0x1344b3=this;return new Promise(function(_0x1936c0,_0x51c84a){return db['VoiceDialReport'][_0x63d9('0x16')](_0x166000['body'],{'raw':_0x166000[_0x63d9('0x17')]?_0x166000[_0x63d9('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x63d9('0xb')](function(_0x58caae){logger[_0x63d9('0xc')](_0x63d9('0x18'),_0x166000);logger[_0x63d9('0xd')](_0x63d9('0x18'),_0x166000,JSON[_0x63d9('0x19')](_0x58caae));_0x1936c0(_0x58caae);})[_0x63d9('0x15')](function(_0x1fae36){logger['error'](_0x63d9('0x18'),_0x1fae36[_0x63d9('0x12')],_0x166000);_0x51c84a(_0x1344b3[_0x63d9('0xf')](0x1f4,_0x1fae36[_0x63d9('0x12')]));});});};exports[_0x63d9('0x1a')]=function(_0x18f2d2){var _0xbd6e7a=this;return new Promise(function(_0x27885d,_0xa86c3c){return db[_0x63d9('0x1b')][_0x63d9('0x1c')](_0x18f2d2[_0x63d9('0x1d')],{'raw':_0x18f2d2['options']?_0x18f2d2[_0x63d9('0x17')][_0x63d9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f2d2[_0x63d9('0x17')]?_0x18f2d2['options'][_0x63d9('0x1f')]||null:null,'attributes':_0x18f2d2[_0x63d9('0x17')]?_0x18f2d2['options'][_0x63d9('0x20')]||null:null,'limit':_0x18f2d2[_0x63d9('0x17')]?_0x18f2d2[_0x63d9('0x17')][_0x63d9('0x21')]||null:null})['then'](function(_0x38d3fc){logger['info'](_0x63d9('0x1a'),_0x18f2d2);logger[_0x63d9('0xd')](_0x63d9('0x1a'),_0x18f2d2,JSON[_0x63d9('0x19')](_0x38d3fc));_0x27885d(_0x38d3fc);})[_0x63d9('0x15')](function(_0x48aba9){logger[_0x63d9('0xf')](_0x63d9('0x1a'),_0x48aba9['message'],_0x18f2d2);_0xa86c3c(_0xbd6e7a[_0x63d9('0xf')](0x1f4,_0x48aba9[_0x63d9('0x12')]));});});}; \ No newline at end of file +var _0x245d=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','info','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','where'];(function(_0x1d5f03,_0xbba796){var _0x561261=function(_0x300223){while(--_0x300223){_0x1d5f03['push'](_0x1d5f03['shift']());}};_0x561261(++_0xbba796);}(_0x245d,0x1bb));var _0xd245=function(_0x4b2ffd,_0x46d2bf){_0x4b2ffd=_0x4b2ffd-0x0;var _0x2409d0=_0x245d[_0x4b2ffd];return _0x2409d0;};'use strict';var _=require('lodash');var util=require(_0xd245('0x0'));var moment=require(_0xd245('0x1'));var BPromise=require(_0xd245('0x2'));var rs=require(_0xd245('0x3'));var fs=require('fs');var Redis=require(_0xd245('0x4'));var db=require(_0xd245('0x5'))['db'];var utils=require(_0xd245('0x6'));var logger=require(_0xd245('0x7'))(_0xd245('0x8'));var config=require(_0xd245('0x9'));var jayson=require(_0xd245('0xa'));var client=jayson[_0xd245('0xb')][_0xd245('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47a914,_0x50fe0b,_0x31c961){return new BPromise(function(_0x189617,_0x298292){return client[_0xd245('0xd')](_0x47a914,_0x31c961)[_0xd245('0xe')](function(_0x4b89b3){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0xd245('0xf'));logger[_0xd245('0x10')](_0xd245('0x11'),_0x50fe0b,'request\x20sent',JSON[_0xd245('0x12')](_0x4b89b3));if(_0x4b89b3['error']){if(_0x4b89b3[_0xd245('0x13')][_0xd245('0x14')]===0x1f4){logger[_0xd245('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);return _0x298292(_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);}logger[_0xd245('0x13')](_0xd245('0x16'),_0x50fe0b,_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);return _0x189617(_0x4b89b3['error'][_0xd245('0x15')]);}else{logger[_0xd245('0x17')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,'request\x20sent');_0x189617(_0x4b89b3[_0xd245('0x18')][_0xd245('0x15')]);}})[_0xd245('0x19')](function(_0x3274ca){logger[_0xd245('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0x3274ca);_0x298292(_0x3274ca);});});}exports[_0xd245('0x1a')]=function(_0x5bd065){var _0x5601e7=this;return new Promise(function(_0x2dd453,_0x1f243a){return db[_0xd245('0x1b')]['create'](_0x5bd065[_0xd245('0x1c')],{'raw':_0x5bd065['options']?_0x5bd065[_0xd245('0x1d')][_0xd245('0x1e')]===undefined?!![]:![]:!![]})[_0xd245('0xe')](function(_0x76dc3d){logger[_0xd245('0x17')]('CreateVoiceDialReport',_0x5bd065);logger[_0xd245('0x10')](_0xd245('0x1a'),_0x5bd065,JSON[_0xd245('0x12')](_0x76dc3d));_0x2dd453(_0x76dc3d);})[_0xd245('0x19')](function(_0x18ccf2){logger['error'](_0xd245('0x1a'),_0x18ccf2['message'],_0x5bd065);_0x1f243a(_0x5601e7[_0xd245('0x13')](0x1f4,_0x18ccf2['message']));});});};exports[_0xd245('0x1f')]=function(_0x1bf4f9){var _0x411ad3=this;return new Promise(function(_0x17f3e1,_0x13948e){return db[_0xd245('0x1b')]['update'](_0x1bf4f9[_0xd245('0x1c')],{'raw':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')][_0xd245('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')][_0xd245('0x20')]||null:null,'attributes':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9['options'][_0xd245('0x21')]||null:null,'limit':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')]['limit']||null:null})[_0xd245('0xe')](function(_0x3b3115){logger['info'](_0xd245('0x1f'),_0x1bf4f9);logger[_0xd245('0x10')]('UpdateVoiceDialReport',_0x1bf4f9,JSON[_0xd245('0x12')](_0x3b3115));_0x17f3e1(_0x3b3115);})[_0xd245('0x19')](function(_0x258ca9){logger[_0xd245('0x13')](_0xd245('0x1f'),_0x258ca9[_0xd245('0x15')],_0x1bf4f9);_0x13948e(_0x411ad3['error'](0x1f4,_0x258ca9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a635aa2..e871e62 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 _0xeff8=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications'];(function(_0x4a27d5,_0x3c55a7){var _0x452f75=function(_0x396c39){while(--_0x396c39){_0x4a27d5['push'](_0x4a27d5['shift']());}};_0x452f75(++_0x3c55a7);}(_0xeff8,0x1bc));var _0x8eff=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeff8[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require(_0x8eff('0x2'));var timeout=require(_0x8eff('0x3'));var express=require(_0x8eff('0x4'));var router=express[_0x8eff('0x5')]();var fs_extra=require(_0x8eff('0x6'));var auth=require(_0x8eff('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8eff('0x8'));var controller=require(_0x8eff('0x9'));router[_0x8eff('0xa')]('/',auth[_0x8eff('0xb')](),controller['index']);router[_0x8eff('0xa')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')]('/',auth[_0x8eff('0xb')](),controller[_0x8eff('0xf')]);router[_0x8eff('0xe')](_0x8eff('0x10'),auth['isAuthenticated'](),controller[_0x8eff('0x11')]);router['put'](_0x8eff('0xc'),auth[_0x8eff('0xb')](),controller[_0x8eff('0x12')]);router[_0x8eff('0x13')](_0x8eff('0xc'),auth[_0x8eff('0xb')](),controller[_0x8eff('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd3c6=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceExtension.controller','get','index','/:id','isAuthenticated','create','post','/:id/applications','update','delete'];(function(_0x11a504,_0x64ff3){var _0x2a4672=function(_0xcc22fd){while(--_0xcc22fd){_0x11a504['push'](_0x11a504['shift']());}};_0x2a4672(++_0x64ff3);}(_0xd3c6,0x1b2));var _0x6d3c=function(_0x4606ca,_0x395d28){_0x4606ca=_0x4606ca-0x0;var _0x68aaa7=_0xd3c6[_0x4606ca];return _0x68aaa7;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require('util');var path=require(_0x6d3c('0x1'));var timeout=require(_0x6d3c('0x2'));var express=require(_0x6d3c('0x3'));var router=express[_0x6d3c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d3c('0x5'));var config=require('../../config/environment');var controller=require(_0x6d3c('0x6'));router[_0x6d3c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6d3c('0x8')]);router[_0x6d3c('0x7')](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d3c('0xb')]);router[_0x6d3c('0xc')](_0x6d3c('0xd'),auth[_0x6d3c('0xa')](),controller['addApplications']);router['put'](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xe')]);router[_0x6d3c('0xf')](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x10')]);module[_0x6d3c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a78ea07..651f491 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 _0x9abe=['exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL'];(function(_0x3c3413,_0x3f4240){var _0xa07ed4=function(_0x5081b3){while(--_0x5081b3){_0x3c3413['push'](_0x3c3413['shift']());}};_0xa07ed4(++_0x3f4240);}(_0x9abe,0xab));var _0xe9ab=function(_0x22bc68,_0x55b1e1){_0x22bc68=_0x22bc68-0x0;var _0x5ce184=_0x9abe[_0x22bc68];return _0x5ce184;};'use strict';var Sequelize=require(_0xe9ab('0x0'));module['exports']={'context':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'unique':_0xe9ab('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xe9ab('0x2')},'tag':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'defaultValue':_0xe9ab('0x3')},'appdata':{'type':Sequelize[_0xe9ab('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe9ab('0x4')](_0xe9ab('0x5'),_0xe9ab('0x6'),_0xe9ab('0x7'),_0xe9ab('0x8'),_0xe9ab('0x9'),_0xe9ab('0xa'),_0xe9ab('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xe9ab('0x1')]},'interval':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':![],'defaultValue':_0xe9ab('0xc')},'IntervalId':{'type':Sequelize[_0xe9ab('0xd')]},'isApp':{'type':Sequelize[_0xe9ab('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe9ab('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xe9ab('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe9ab('0xd')]},'recordingFormat':{'type':Sequelize[_0xe9ab('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xe9ab('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe9ab('0xf')],'get':function(_0x279321){return this['getDataValue'](_0xe9ab('0x10'));}},'alias':{'type':Sequelize[_0xe9ab('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xe38b=['compositeIndex','NoOp','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','sequelize','exports','STRING'];(function(_0xc4ac27,_0x58b55c){var _0x43ec34=function(_0x3fedcb){while(--_0x3fedcb){_0xc4ac27['push'](_0xc4ac27['shift']());}};_0x43ec34(++_0x58b55c);}(_0xe38b,0x165));var _0xbe38=function(_0x542f1b,_0x25aece){_0x542f1b=_0x542f1b-0x0;var _0x2b63a3=_0xe38b[_0x542f1b];return _0x2b63a3;};'use strict';var Sequelize=require(_0xbe38('0x0'));module[_0xbe38('0x1')]={'context':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'unique':_0xbe38('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'unique':_0xbe38('0x3')},'priority':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xbe38('0x3')},'tag':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':_0xbe38('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xbe38('0x5'),'internal',_0xbe38('0x6'),_0xbe38('0x7'),_0xbe38('0x8'),_0xbe38('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':_0xbe38('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xbe38('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbe38('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbe38('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbe38('0xc')]},'recordingFormat':{'type':Sequelize[_0xbe38('0x2')],'defaultValue':_0xbe38('0xd')},'answer':{'type':Sequelize[_0xbe38('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbe38('0xe')],'get':function(_0x5e1869){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xbe38('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d236cae..82bff69 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 _0xdc67=['send','map','VoiceExtension','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','findAll','rows','params','fields','include','catch','create','body','outbound','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','recordingFormat','cutdigits','mandatoryDisposition','findOne','transaction','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','value','includes','type','find','UserProfileResource','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc67,0xa0));var _0x7dc6=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xdc67[_0x5216e0];return _0x5b3f40;};'use strict';var emlformat=require(_0x7dc6('0x0'));var rimraf=require(_0x7dc6('0x1'));var zipdir=require(_0x7dc6('0x2'));var jsonpatch=require(_0x7dc6('0x3'));var rp=require(_0x7dc6('0x4'));var moment=require(_0x7dc6('0x5'));var BPromise=require(_0x7dc6('0x6'));var Mustache=require(_0x7dc6('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7dc6('0x8'));var csv=require(_0x7dc6('0x9'));var ejs=require(_0x7dc6('0xa'));var fs=require('fs');var fs_extra=require(_0x7dc6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7dc6('0xc'));var jsforce=require(_0x7dc6('0xd'));var deskjs=require(_0x7dc6('0xe'));var toCsv=require(_0x7dc6('0x9'));var querystring=require(_0x7dc6('0xf'));var Papa=require(_0x7dc6('0x10'));var Redis=require(_0x7dc6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7dc6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dc6('0x13'));var logger=require('../../config/logger')(_0x7dc6('0x14'));var utils=require(_0x7dc6('0x15'));var config=require(_0x7dc6('0x16'));var licenseUtil=require(_0x7dc6('0x17'));var db=require(_0x7dc6('0x18'))['db'];config[_0x7dc6('0x19')]=_[_0x7dc6('0x1a')](config[_0x7dc6('0x19')],{'host':_0x7dc6('0x1b'),'port':0x18eb});var socket=require(_0x7dc6('0x1c'))(new Redis(config[_0x7dc6('0x19')]));require(_0x7dc6('0x1d'))[_0x7dc6('0x1e')](socket);function respondWithStatusCode(_0x2e0aec,_0x3decae){_0x3decae=_0x3decae||0xcc;return function(_0x430199){if(_0x430199){return _0x2e0aec[_0x7dc6('0x1f')](_0x3decae);}return _0x2e0aec[_0x7dc6('0x20')](_0x3decae)[_0x7dc6('0x21')]();};}function respondWithResult(_0x3805f4,_0x47349f){_0x47349f=_0x47349f||0xc8;return function(_0x4b49b0){if(_0x4b49b0){return _0x3805f4['status'](_0x47349f)[_0x7dc6('0x22')](_0x4b49b0);}};}function respondWithFilteredResult(_0x5ae981,_0x19040d){return function(_0x4fb9a5){if(_0x4fb9a5){var _0x17cd26=typeof _0x19040d[_0x7dc6('0x23')]===_0x7dc6('0x24')&&typeof _0x19040d['limit']===_0x7dc6('0x24');var _0xa47d67=_0x4fb9a5[_0x7dc6('0x25')];var _0x40b0e9=_0x17cd26?0x0:_0x19040d[_0x7dc6('0x23')];var _0xd3fb8=_0x17cd26?_0x4fb9a5[_0x7dc6('0x25')]:_0x19040d[_0x7dc6('0x23')]+_0x19040d[_0x7dc6('0x26')];var _0x48023f;if(_0xd3fb8>=_0xa47d67){_0xd3fb8=_0xa47d67;_0x48023f=0xc8;}else{_0x48023f=0xce;}_0x5ae981[_0x7dc6('0x20')](_0x48023f);return _0x5ae981[_0x7dc6('0x27')](_0x7dc6('0x28'),_0x40b0e9+'-'+_0xd3fb8+'/'+_0xa47d67)['json'](_0x4fb9a5);}return null;};}function patchUpdates(_0x2e808b){return function(_0x2b3fa0){try{jsonpatch[_0x7dc6('0x29')](_0x2b3fa0,_0x2e808b,!![]);}catch(_0x1b6b0b){return BPromise[_0x7dc6('0x2a')](_0x1b6b0b);}return _0x2b3fa0[_0x7dc6('0x2b')]();};}function saveUpdates(_0x238d0b,_0x10e738){return function(_0x3eb9c6){if(_0x3eb9c6){return _0x3eb9c6[_0x7dc6('0x2c')](_0x238d0b)[_0x7dc6('0x2d')](function(_0x42f8c0){return _0x42f8c0;});}return null;};}function removeEntity(_0x1f437f,_0x311241){return function(_0x2b1d32){if(_0x2b1d32){return _0x2b1d32[_0x7dc6('0x2e')]()[_0x7dc6('0x2d')](function(){var _0xcb569c=_0x2b1d32[_0x7dc6('0x2f')]({'plain':!![]});var _0x16f5be=[{'name':_0x7dc6('0x30'),'value':_0x7dc6('0x31'),'ignore':![]},{'name':_0x7dc6('0x32'),'value':'outbound','ignore':![]},{'name':_0x7dc6('0x33'),'value':_0x7dc6('0x34'),'ignore':![]}];var _0x40f17d=_(_0x16f5be)[_0x7dc6('0x35')]('ignore')['map']('value')[_0x7dc6('0x36')]();if(_[_0x7dc6('0x37')](_0x40f17d,_0xcb569c[_0x7dc6('0x38')])){return;}var _0x205a7c=_[_0x7dc6('0x39')](_0x16f5be,[_0x7dc6('0x36'),_0xcb569c[_0x7dc6('0x38')]])['name'];return db[_0x7dc6('0x3a')][_0x7dc6('0x2e')]({'where':{'type':_0x205a7c,'resourceId':_0xcb569c['id']}})['then'](function(){return _0x2b1d32;});})[_0x7dc6('0x2d')](function(){_0x1f437f[_0x7dc6('0x20')](0xcc)[_0x7dc6('0x21')]();});}};}function handleEntityNotFound(_0x1fa2e6,_0x42d597){return function(_0x4195e2){if(!_0x4195e2){_0x1fa2e6[_0x7dc6('0x1f')](0x194);}return _0x4195e2;};}function handleError(_0x24a774,_0x593ad1){_0x593ad1=_0x593ad1||0x1f4;return function(_0x4c7371){logger[_0x7dc6('0x3b')](_0x4c7371[_0x7dc6('0x3c')]);if(_0x4c7371['name']){delete _0x4c7371[_0x7dc6('0x3d')];}_0x24a774['status'](_0x593ad1)[_0x7dc6('0x3e')](_0x4c7371);};}exports['index']=function(_0x3d9ed8,_0x373927){var _0x42602f={},_0x313623={},_0x48cb75={'count':0x0,'rows':[]};var _0x2d871f=_[_0x7dc6('0x3f')](db[_0x7dc6('0x40')][_0x7dc6('0x41')],function(_0x12511b){return{'name':_0x12511b[_0x7dc6('0x42')],'type':_0x12511b[_0x7dc6('0x38')][_0x7dc6('0x43')]};});_0x313623['model']=_[_0x7dc6('0x3f')](_0x2d871f,_0x7dc6('0x3d'));_0x313623[_0x7dc6('0x44')]=_[_0x7dc6('0x45')](_0x3d9ed8['query']);_0x313623['filters']=_[_0x7dc6('0x46')](_0x313623['model'],_0x313623[_0x7dc6('0x44')]);_0x42602f[_0x7dc6('0x47')]=_[_0x7dc6('0x46')](_0x313623[_0x7dc6('0x48')],qs['fields'](_0x3d9ed8[_0x7dc6('0x44')]['fields']));_0x42602f[_0x7dc6('0x47')]=_0x42602f[_0x7dc6('0x47')][_0x7dc6('0x49')]?_0x42602f['attributes']:_0x313623[_0x7dc6('0x48')];if(!_0x3d9ed8[_0x7dc6('0x44')]['hasOwnProperty'](_0x7dc6('0x4a'))){_0x42602f[_0x7dc6('0x26')]=qs[_0x7dc6('0x26')](_0x3d9ed8['query']['limit']);_0x42602f[_0x7dc6('0x23')]=qs[_0x7dc6('0x23')](_0x3d9ed8[_0x7dc6('0x44')]['offset']);}_0x42602f[_0x7dc6('0x4b')]=qs['sort'](_0x3d9ed8[_0x7dc6('0x44')][_0x7dc6('0x4c')]);_0x42602f[_0x7dc6('0x4d')]=qs[_0x7dc6('0x4e')](_[_0x7dc6('0x4f')](_0x3d9ed8[_0x7dc6('0x44')],_0x313623['filters']),_0x2d871f);if(_0x3d9ed8[_0x7dc6('0x44')][_0x7dc6('0x35')]){_0x42602f[_0x7dc6('0x4d')]=_[_0x7dc6('0x50')](_0x42602f[_0x7dc6('0x4d')],{'$or':_[_0x7dc6('0x3f')](_0x2d871f,function(_0x28aa9){if(_0x28aa9['type']!==_0x7dc6('0x51')){var _0x21575a={};_0x21575a[_0x28aa9[_0x7dc6('0x3d')]]={'$like':'%'+_0x3d9ed8[_0x7dc6('0x44')][_0x7dc6('0x35')]+'%'};return _0x21575a;}})});}_0x42602f=_[_0x7dc6('0x50')]({},_0x42602f,_0x3d9ed8['options']);var _0x3012ea={'where':_0x42602f[_0x7dc6('0x4d')]};return db['VoiceExtension']['count'](_0x3012ea)['then'](function(_0x1c7067){_0x48cb75['count']=_0x1c7067;if(_0x3d9ed8['query'][_0x7dc6('0x52')]){_0x42602f['include']=[{'all':!![]}];}return db[_0x7dc6('0x40')][_0x7dc6('0x53')](_0x42602f);})[_0x7dc6('0x2d')](function(_0xe6896a){_0x48cb75[_0x7dc6('0x54')]=_0xe6896a;return _0x48cb75;})['then'](respondWithFilteredResult(_0x373927,_0x42602f))['catch'](handleError(_0x373927,null));};exports['show']=function(_0x2e89ac,_0x173562){var _0x31d471={'raw':![],'where':{'id':_0x2e89ac[_0x7dc6('0x55')]['id']}},_0x3c12e4={};_0x3c12e4[_0x7dc6('0x48')]=_['keys'](db['VoiceExtension'][_0x7dc6('0x41')]);_0x3c12e4[_0x7dc6('0x44')]=_['keys'](_0x2e89ac['query']);_0x3c12e4[_0x7dc6('0x4e')]=_[_0x7dc6('0x46')](_0x3c12e4[_0x7dc6('0x48')],_0x3c12e4[_0x7dc6('0x44')]);_0x31d471[_0x7dc6('0x47')]=_['intersection'](_0x3c12e4[_0x7dc6('0x48')],qs['fields'](_0x2e89ac['query'][_0x7dc6('0x56')]));_0x31d471['attributes']=_0x31d471[_0x7dc6('0x47')][_0x7dc6('0x49')]?_0x31d471[_0x7dc6('0x47')]:_0x3c12e4['model'];if(_0x2e89ac[_0x7dc6('0x44')][_0x7dc6('0x52')]){_0x31d471[_0x7dc6('0x57')]=[{'all':!![]}];}_0x31d471=_[_0x7dc6('0x50')]({},_0x31d471,_0x2e89ac['options']);return db[_0x7dc6('0x40')]['find'](_0x31d471)[_0x7dc6('0x2d')](handleEntityNotFound(_0x173562,null))[_0x7dc6('0x2d')](respondWithResult(_0x173562,null))[_0x7dc6('0x58')](handleError(_0x173562,null));};exports[_0x7dc6('0x2e')]=function(_0x4b4600,_0x9b8c83){return db[_0x7dc6('0x40')][_0x7dc6('0x39')]({'where':{'id':_0x4b4600[_0x7dc6('0x55')]['id']}})['then'](handleEntityNotFound(_0x9b8c83,null))[_0x7dc6('0x2d')](removeEntity(_0x9b8c83,null))[_0x7dc6('0x58')](handleError(_0x9b8c83,null));};exports[_0x7dc6('0x59')]=function(_0x462f84,_0x390580){if(_0x462f84[_0x7dc6('0x5a')]['type']===_0x7dc6('0x5b')&&!_[_0x7dc6('0x5c')](_0x462f84[_0x7dc6('0x5a')][_0x7dc6('0x5d')],'_')){_0x462f84[_0x7dc6('0x5a')]['exten']='_'['concat'](_0x462f84[_0x7dc6('0x5a')][_0x7dc6('0x5d')]);}return db[_0x7dc6('0x40')][_0x7dc6('0x59')](_0x462f84[_0x7dc6('0x5a')],{'raw':![]})[_0x7dc6('0x2d')](function(_0x3140e6){var _0x3b8b18=_0x462f84['user']['get']({'plain':!![]});if(!_0x3b8b18)throw new Error(_0x7dc6('0x5e'));if(_0x3b8b18['role']===_0x7dc6('0x5f')){var _0x2e1fbc=_0x3140e6[_0x7dc6('0x2f')]({'plain':!![]});var _0x58e97b=[{'name':'InboundRoutes','value':_0x7dc6('0x31')},{'name':_0x7dc6('0x32'),'value':_0x7dc6('0x5b')},{'name':'InternalRoutes','value':_0x7dc6('0x34')}];var _0x38e510=_[_0x7dc6('0x39')](_0x58e97b,[_0x7dc6('0x36'),_0x2e1fbc[_0x7dc6('0x38')]])[_0x7dc6('0x3d')];return db[_0x7dc6('0x60')]['find']({'where':{'name':_0x38e510,'userProfileId':_0x3b8b18[_0x7dc6('0x61')]},'raw':!![]})['then'](function(_0x23e2c1){if(_0x23e2c1&&_0x23e2c1[_0x7dc6('0x62')]===0x0){return db['UserProfileResource'][_0x7dc6('0x59')]({'name':_0x2e1fbc[_0x7dc6('0x3d')],'resourceId':_0x2e1fbc['id'],'type':_0x23e2c1[_0x7dc6('0x3d')],'sectionId':_0x23e2c1['id']},{})[_0x7dc6('0x2d')](function(){return _0x3140e6;});}else{return _0x3140e6;}})[_0x7dc6('0x58')](function(_0x21901a){logger['error'](_0x7dc6('0x63'),_0x21901a);throw _0x21901a;});}return _0x3140e6;})[_0x7dc6('0x2d')](respondWithResult(_0x390580,0xc9))[_0x7dc6('0x58')](handleError(_0x390580,null));};exports['update']=function(_0x241928,_0x6f73f0){if(_0x241928['body']['id']){delete _0x241928[_0x7dc6('0x5a')]['id'];}return db['VoiceExtension'][_0x7dc6('0x39')]({'where':{'id':_0x241928[_0x7dc6('0x55')]['id']}})[_0x7dc6('0x2d')](handleEntityNotFound(_0x6f73f0,null))[_0x7dc6('0x2d')](function(_0x40d930){if(_0x40d930){return db[_0x7dc6('0x40')]['update'](_[_0x7dc6('0x4f')](_0x241928[_0x7dc6('0x5a')],[_0x7dc6('0x5d'),'context','description',_0x7dc6('0x64'),_0x7dc6('0x65'),_0x7dc6('0x66'),'alias']),{'where':{'context':_0x40d930['context'],'exten':_0x40d930[_0x7dc6('0x5d')]},'individualHooks':!![]})[_0x7dc6('0x2d')](function(_0x519861){return _0x519861;});}return null;})['then'](respondWithStatusCode(_0x6f73f0,null))[_0x7dc6('0x58')](handleError(_0x6f73f0,null));};exports['addApplications']=function(_0x12af02,_0x52cf27){return db[_0x7dc6('0x40')][_0x7dc6('0x67')]({'where':{'id':_0x12af02[_0x7dc6('0x55')]['id']}})[_0x7dc6('0x2d')](function(_0x3e6694){if(_0x3e6694){return db['sequelize'][_0x7dc6('0x68')](function(_0x2f09fd){return db[_0x7dc6('0x40')][_0x7dc6('0x2e')]({'where':{'VoiceExtensionId':_0x12af02[_0x7dc6('0x55')]['id']},'transaction':_0x2f09fd})[_0x7dc6('0x2d')](function(){var _0x5bffb7=_[_0x7dc6('0x3f')](_0x12af02[_0x7dc6('0x5a')],function(_0x474f78){_0x474f78['VoiceExtensionId']=_0x12af02[_0x7dc6('0x55')]['id'];_0x474f78[_0x7dc6('0x69')]=!![];return _0x474f78;});var _0x5e4b6c=_0x12af02[_0x7dc6('0x44')]['rewriteDial']&&_0x12af02['query'][_0x7dc6('0x6a')][_0x7dc6('0x6b')]()===_0x7dc6('0x6c')?!![]:![];return _0x3e6694[_0x7dc6('0x6d')](_0x5bffb7,_0x5e4b6c);})[_0x7dc6('0x2d')](function(_0x10317d){return db['VoiceExtension'][_0x7dc6('0x6e')](_0x10317d,{'transaction':_0x2f09fd});});})[_0x7dc6('0x2d')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x12af02['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x7dc6('0x2d')](respondWithResult(_0x52cf27,null))['catch'](handleError(_0x52cf27,null));}; \ No newline at end of file +var _0x7409=['register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','inbound','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','pick','where','options','includeAll','findAll','rows','show','params','keys','include','merge','catch','destroy','create','body','startsWith','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','OutboundRoutes','InternalRoutes','internal','UserProfileSection','autoAssociation','exten','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x22bff1,_0x1d964a){var _0x279396=function(_0x2573c7){while(--_0x2573c7){_0x22bff1['push'](_0x22bff1['shift']());}};_0x279396(++_0x1d964a);}(_0x7409,0xc9));var _0x9740=function(_0xb4fe2c,_0x3d2be6){_0xb4fe2c=_0xb4fe2c-0x0;var _0x460a1a=_0x7409[_0xb4fe2c];return _0x460a1a;};'use strict';var emlformat=require(_0x9740('0x0'));var rimraf=require(_0x9740('0x1'));var zipdir=require(_0x9740('0x2'));var jsonpatch=require(_0x9740('0x3'));var rp=require(_0x9740('0x4'));var moment=require(_0x9740('0x5'));var BPromise=require(_0x9740('0x6'));var Mustache=require('mustache');var util=require(_0x9740('0x7'));var path=require(_0x9740('0x8'));var sox=require(_0x9740('0x9'));var csv=require(_0x9740('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9740('0xb'));var _=require(_0x9740('0xc'));var squel=require(_0x9740('0xd'));var crypto=require('crypto');var jsforce=require(_0x9740('0xe'));var deskjs=require(_0x9740('0xf'));var toCsv=require(_0x9740('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9740('0x10'));var authService=require(_0x9740('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9740('0x12'));var logger=require(_0x9740('0x13'))(_0x9740('0x14'));var utils=require(_0x9740('0x15'));var config=require(_0x9740('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9740('0x17'))['db'];config[_0x9740('0x18')]=_[_0x9740('0x19')](config[_0x9740('0x18')],{'host':_0x9740('0x1a'),'port':0x18eb});var socket=require(_0x9740('0x1b'))(new Redis(config[_0x9740('0x18')]));require(_0x9740('0x1c'))[_0x9740('0x1d')](socket);function respondWithStatusCode(_0x1e8b46,_0x37d6a7){_0x37d6a7=_0x37d6a7||0xcc;return function(_0x2a1646){if(_0x2a1646){return _0x1e8b46[_0x9740('0x1e')](_0x37d6a7);}return _0x1e8b46[_0x9740('0x1f')](_0x37d6a7)[_0x9740('0x20')]();};}function respondWithResult(_0x2541cc,_0x1e8b70){_0x1e8b70=_0x1e8b70||0xc8;return function(_0xf76bb){if(_0xf76bb){return _0x2541cc[_0x9740('0x1f')](_0x1e8b70)['json'](_0xf76bb);}};}function respondWithFilteredResult(_0x44925b,_0x426643){return function(_0x4ddf8f){if(_0x4ddf8f){var _0x32171d=typeof _0x426643[_0x9740('0x21')]===_0x9740('0x22')&&typeof _0x426643[_0x9740('0x23')]===_0x9740('0x22');var _0x4476b4=_0x4ddf8f[_0x9740('0x24')];var _0x3d0cfb=_0x32171d?0x0:_0x426643['offset'];var _0x10e34d=_0x32171d?_0x4ddf8f[_0x9740('0x24')]:_0x426643[_0x9740('0x21')]+_0x426643[_0x9740('0x23')];var _0x4c5540;if(_0x10e34d>=_0x4476b4){_0x10e34d=_0x4476b4;_0x4c5540=0xc8;}else{_0x4c5540=0xce;}_0x44925b[_0x9740('0x1f')](_0x4c5540);return _0x44925b['set'](_0x9740('0x25'),_0x3d0cfb+'-'+_0x10e34d+'/'+_0x4476b4)[_0x9740('0x26')](_0x4ddf8f);}return null;};}function patchUpdates(_0x1520c6){return function(_0x193d18){try{jsonpatch[_0x9740('0x27')](_0x193d18,_0x1520c6,!![]);}catch(_0x49745a){return BPromise['reject'](_0x49745a);}return _0x193d18[_0x9740('0x28')]();};}function saveUpdates(_0x4cb188,_0x5be74b){return function(_0xac9ec6){if(_0xac9ec6){return _0xac9ec6[_0x9740('0x29')](_0x4cb188)[_0x9740('0x2a')](function(_0x5b81f7){return _0x5b81f7;});}return null;};}function removeEntity(_0x368b57,_0x3bd20b){return function(_0x3a5538){if(_0x3a5538){return _0x3a5538['destroy']()['then'](function(){var _0x5c3aa7=_0x3a5538['get']({'plain':!![]});var _0xc8d40c=[{'name':'InboundRoutes','value':_0x9740('0x2b'),'ignore':![]},{'name':'OutboundRoutes','value':_0x9740('0x2c'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x2b6e31=_(_0xc8d40c)[_0x9740('0x2d')](_0x9740('0x2e'))[_0x9740('0x2f')]('value')[_0x9740('0x30')]();if(_[_0x9740('0x31')](_0x2b6e31,_0x5c3aa7['type'])){return;}var _0x5c9e93=_[_0x9740('0x32')](_0xc8d40c,[_0x9740('0x30'),_0x5c3aa7[_0x9740('0x33')]])[_0x9740('0x34')];return db[_0x9740('0x35')]['destroy']({'where':{'type':_0x5c9e93,'resourceId':_0x5c3aa7['id']}})[_0x9740('0x2a')](function(){return _0x3a5538;});})['then'](function(){_0x368b57[_0x9740('0x1f')](0xcc)[_0x9740('0x20')]();});}};}function handleEntityNotFound(_0x5b4688,_0x3645d9){return function(_0x198519){if(!_0x198519){_0x5b4688[_0x9740('0x1e')](0x194);}return _0x198519;};}function handleError(_0x17bb3a,_0x59c164){_0x59c164=_0x59c164||0x1f4;return function(_0x13603a){logger[_0x9740('0x36')](_0x13603a['stack']);if(_0x13603a[_0x9740('0x34')]){delete _0x13603a[_0x9740('0x34')];}_0x17bb3a['status'](_0x59c164)[_0x9740('0x37')](_0x13603a);};}exports[_0x9740('0x38')]=function(_0x461ee0,_0x2eb648){var _0x32aa02={},_0x295978={},_0x2cbbb3={'count':0x0,'rows':[]};var _0x4a0710=_[_0x9740('0x2f')](db[_0x9740('0x39')][_0x9740('0x3a')],function(_0x3ab800){return{'name':_0x3ab800[_0x9740('0x3b')],'type':_0x3ab800['type'][_0x9740('0x3c')]};});_0x295978[_0x9740('0x3d')]=_['map'](_0x4a0710,_0x9740('0x34'));_0x295978[_0x9740('0x3e')]=_['keys'](_0x461ee0[_0x9740('0x3e')]);_0x295978[_0x9740('0x3f')]=_['intersection'](_0x295978['model'],_0x295978[_0x9740('0x3e')]);_0x32aa02['attributes']=_[_0x9740('0x40')](_0x295978[_0x9740('0x3d')],qs[_0x9740('0x41')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x41')]));_0x32aa02[_0x9740('0x42')]=_0x32aa02[_0x9740('0x42')][_0x9740('0x43')]?_0x32aa02[_0x9740('0x42')]:_0x295978[_0x9740('0x3d')];if(!_0x461ee0[_0x9740('0x3e')]['hasOwnProperty']('nolimit')){_0x32aa02[_0x9740('0x23')]=qs[_0x9740('0x23')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x23')]);_0x32aa02['offset']=qs[_0x9740('0x21')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x21')]);}_0x32aa02[_0x9740('0x44')]=qs[_0x9740('0x45')](_0x461ee0[_0x9740('0x3e')]['sort']);_0x32aa02['where']=qs[_0x9740('0x3f')](_[_0x9740('0x46')](_0x461ee0[_0x9740('0x3e')],_0x295978[_0x9740('0x3f')]),_0x4a0710);if(_0x461ee0[_0x9740('0x3e')]['filter']){_0x32aa02[_0x9740('0x47')]=_['merge'](_0x32aa02['where'],{'$or':_['map'](_0x4a0710,function(_0x5a0eb6){if(_0x5a0eb6[_0x9740('0x33')]!=='VIRTUAL'){var _0x5b834a={};_0x5b834a[_0x5a0eb6[_0x9740('0x34')]]={'$like':'%'+_0x461ee0['query'][_0x9740('0x2d')]+'%'};return _0x5b834a;}})});}_0x32aa02=_['merge']({},_0x32aa02,_0x461ee0[_0x9740('0x48')]);var _0x522b9e={'where':_0x32aa02[_0x9740('0x47')]};return db[_0x9740('0x39')][_0x9740('0x24')](_0x522b9e)[_0x9740('0x2a')](function(_0x55b0b0){_0x2cbbb3[_0x9740('0x24')]=_0x55b0b0;if(_0x461ee0[_0x9740('0x3e')][_0x9740('0x49')]){_0x32aa02['include']=[{'all':!![]}];}return db[_0x9740('0x39')][_0x9740('0x4a')](_0x32aa02);})[_0x9740('0x2a')](function(_0x26c095){_0x2cbbb3[_0x9740('0x4b')]=_0x26c095;return _0x2cbbb3;})[_0x9740('0x2a')](respondWithFilteredResult(_0x2eb648,_0x32aa02))['catch'](handleError(_0x2eb648,null));};exports[_0x9740('0x4c')]=function(_0x57d71b,_0x35a727){var _0x1fff45={'raw':![],'where':{'id':_0x57d71b[_0x9740('0x4d')]['id']}},_0x242ccd={};_0x242ccd[_0x9740('0x3d')]=_[_0x9740('0x4e')](db['VoiceExtension'][_0x9740('0x3a')]);_0x242ccd['query']=_[_0x9740('0x4e')](_0x57d71b[_0x9740('0x3e')]);_0x242ccd[_0x9740('0x3f')]=_[_0x9740('0x40')](_0x242ccd['model'],_0x242ccd[_0x9740('0x3e')]);_0x1fff45['attributes']=_[_0x9740('0x40')](_0x242ccd[_0x9740('0x3d')],qs[_0x9740('0x41')](_0x57d71b[_0x9740('0x3e')]['fields']));_0x1fff45[_0x9740('0x42')]=_0x1fff45[_0x9740('0x42')][_0x9740('0x43')]?_0x1fff45['attributes']:_0x242ccd['model'];if(_0x57d71b[_0x9740('0x3e')][_0x9740('0x49')]){_0x1fff45[_0x9740('0x4f')]=[{'all':!![]}];}_0x1fff45=_[_0x9740('0x50')]({},_0x1fff45,_0x57d71b[_0x9740('0x48')]);return db[_0x9740('0x39')][_0x9740('0x32')](_0x1fff45)[_0x9740('0x2a')](handleEntityNotFound(_0x35a727,null))[_0x9740('0x2a')](respondWithResult(_0x35a727,null))[_0x9740('0x51')](handleError(_0x35a727,null));};exports[_0x9740('0x52')]=function(_0x3601a7,_0x1e218c){return db[_0x9740('0x39')][_0x9740('0x32')]({'where':{'id':_0x3601a7[_0x9740('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1e218c,null))[_0x9740('0x2a')](removeEntity(_0x1e218c,null))[_0x9740('0x51')](handleError(_0x1e218c,null));};exports[_0x9740('0x53')]=function(_0xbbd7d7,_0x482cc7){if(_0xbbd7d7[_0x9740('0x54')][_0x9740('0x33')]===_0x9740('0x2c')&&!_[_0x9740('0x55')](_0xbbd7d7[_0x9740('0x54')]['exten'],'_')){_0xbbd7d7['body']['exten']='_'[_0x9740('0x56')](_0xbbd7d7[_0x9740('0x54')]['exten']);}return db[_0x9740('0x39')][_0x9740('0x53')](_0xbbd7d7[_0x9740('0x54')],{'raw':![]})[_0x9740('0x2a')](function(_0x508860){var _0x1bf633=_0xbbd7d7['user'][_0x9740('0x57')]({'plain':!![]});if(!_0x1bf633)throw new Error(_0x9740('0x58'));if(_0x1bf633[_0x9740('0x59')]===_0x9740('0x5a')){var _0x368568=_0x508860[_0x9740('0x57')]({'plain':!![]});var _0x3a4366=[{'name':_0x9740('0x5b'),'value':'inbound'},{'name':_0x9740('0x5c'),'value':_0x9740('0x2c')},{'name':_0x9740('0x5d'),'value':_0x9740('0x5e')}];var _0x47183d=_[_0x9740('0x32')](_0x3a4366,[_0x9740('0x30'),_0x368568[_0x9740('0x33')]])[_0x9740('0x34')];return db[_0x9740('0x5f')][_0x9740('0x32')]({'where':{'name':_0x47183d,'userProfileId':_0x1bf633['userProfileId']},'raw':!![]})['then'](function(_0x447a99){if(_0x447a99&&_0x447a99[_0x9740('0x60')]===0x0){return db[_0x9740('0x35')][_0x9740('0x53')]({'name':_0x368568[_0x9740('0x34')],'resourceId':_0x368568['id'],'type':_0x447a99[_0x9740('0x34')],'sectionId':_0x447a99['id']},{})[_0x9740('0x2a')](function(){return _0x508860;});}else{return _0x508860;}})[_0x9740('0x51')](function(_0x247f24){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x247f24);throw _0x247f24;});}return _0x508860;})[_0x9740('0x2a')](respondWithResult(_0x482cc7,0xc9))[_0x9740('0x51')](handleError(_0x482cc7,null));};exports[_0x9740('0x29')]=function(_0x49b086,_0x452470){if(_0x49b086['body']['id']){delete _0x49b086[_0x9740('0x54')]['id'];}return db[_0x9740('0x39')][_0x9740('0x32')]({'where':{'id':_0x49b086['params']['id']}})[_0x9740('0x2a')](handleEntityNotFound(_0x452470,null))[_0x9740('0x2a')](function(_0x53018e){if(_0x53018e){return db[_0x9740('0x39')][_0x9740('0x29')](_['pick'](_0x49b086[_0x9740('0x54')],[_0x9740('0x61'),'context',_0x9740('0x62'),_0x9740('0x63'),_0x9740('0x64'),_0x9740('0x65'),_0x9740('0x66')]),{'where':{'context':_0x53018e[_0x9740('0x67')],'exten':_0x53018e[_0x9740('0x61')]},'individualHooks':!![]})[_0x9740('0x2a')](function(_0xf7f94a){return _0xf7f94a;});}return null;})['then'](respondWithStatusCode(_0x452470,null))[_0x9740('0x51')](handleError(_0x452470,null));};exports['addApplications']=function(_0xd1302a,_0x5d490e){return db[_0x9740('0x39')][_0x9740('0x68')]({'where':{'id':_0xd1302a['params']['id']}})[_0x9740('0x2a')](function(_0x14ebc2){if(_0x14ebc2){return db[_0x9740('0x69')][_0x9740('0x6a')](function(_0x150d94){return db[_0x9740('0x39')][_0x9740('0x52')]({'where':{'VoiceExtensionId':_0xd1302a['params']['id']},'transaction':_0x150d94})[_0x9740('0x2a')](function(){var _0x3afb6f=_[_0x9740('0x2f')](_0xd1302a['body'],function(_0x5ae981){_0x5ae981[_0x9740('0x6b')]=_0xd1302a['params']['id'];_0x5ae981[_0x9740('0x6c')]=!![];return _0x5ae981;});var _0x1fbf1e=_0xd1302a[_0x9740('0x3e')][_0x9740('0x6d')]&&_0xd1302a[_0x9740('0x3e')]['rewriteDial'][_0x9740('0x6e')]()===_0x9740('0x6f')?!![]:![];return _0x14ebc2[_0x9740('0x70')](_0x3afb6f,_0x1fbf1e);})[_0x9740('0x2a')](function(_0xd012fe){return db[_0x9740('0x39')][_0x9740('0x71')](_0xd012fe,{'transaction':_0x150d94});});})[_0x9740('0x2a')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xd1302a['params']['id']},'order':_0x9740('0x72')});});}})['then'](respondWithResult(_0x5d490e,null))[_0x9740('0x51')](handleError(_0x5d490e,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 74c8b3e..9fd1fd9 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 _0xd188=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x36eb1a,_0x12b048){var _0x4bf257=function(_0x3884a2){while(--_0x3884a2){_0x36eb1a['push'](_0x36eb1a['shift']());}};_0x4bf257(++_0x12b048);}(_0xd188,0xb1));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8d18('0x0'));var VoiceExtension=require(_0x8d18('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8d18('0x2')](0x0);var events={'afterCreate':_0x8d18('0x3'),'afterUpdate':_0x8d18('0x4'),'afterDestroy':_0x8d18('0x5')};function emitEvent(_0x556947){return function(_0x27a649,_0x29d451,_0x4b3e25){VoiceExtensionEvents[_0x8d18('0x6')](_0x556947+':'+_0x27a649['id'],_0x27a649);VoiceExtensionEvents[_0x8d18('0x6')](_0x556947,_0x27a649);_0x4b3e25(null);};}for(var e in events){if(events[_0x8d18('0x7')](e)){var event=events[e];VoiceExtension[_0x8d18('0x8')](e,emitEvent(event));}}module[_0x8d18('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x4b89=['save','update','remove','hasOwnProperty','hook','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x95bc9a,_0xa48e4e){var _0x1d5185=function(_0x513145){while(--_0x513145){_0x95bc9a['push'](_0x95bc9a['shift']());}};_0x1d5185(++_0xa48e4e);}(_0x4b89,0x14d));var _0x94b8=function(_0x7261e6,_0x3e3bf7){_0x7261e6=_0x7261e6-0x0;var _0x20d5ed=_0x4b89[_0x7261e6];return _0x20d5ed;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x94b8('0x0'))['db'][_0x94b8('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x94b8('0x2')](0x0);var events={'afterCreate':_0x94b8('0x3'),'afterUpdate':_0x94b8('0x4'),'afterDestroy':_0x94b8('0x5')};function emitEvent(_0x546a84){return function(_0x5f4545,_0x454d1d,_0x1044b9){VoiceExtensionEvents['emit'](_0x546a84+':'+_0x5f4545['id'],_0x5f4545);VoiceExtensionEvents['emit'](_0x546a84,_0x5f4545);_0x1044b9(null);};}for(var e in events){if(events[_0x94b8('0x6')](e)){var event=events[e];VoiceExtension[_0x94b8('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 078c5b9..c7517eb 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 _0x85af=['priority','last','concat','catch','VoiceExtension','voice_extensions','Hangup','util','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','NoOp','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','join','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','app','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata'];(function(_0xf11b41,_0x3348d2){var _0x3093f4=function(_0x3488d1){while(--_0x3488d1){_0xf11b41['push'](_0xf11b41['shift']());}};_0x3093f4(++_0x3348d2);}(_0x85af,0x19c));var _0xf85a=function(_0x57ac63,_0x4728ad){_0x57ac63=_0x57ac63-0x0;var _0x2e5566=_0x85af[_0x57ac63];return _0x2e5566;};'use strict';var util=require(_0xf85a('0x0'));var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0xf85a('0x1')]=function(_0x606d99){var _0x58cbf1=_0x606d99[_0xf85a('0x2')];function _0x25d8cf(_0x2a5868){var _0x4a7a4b=0x2;var _0x962a63=[{'type':_0x2a5868[_0xf85a('0x3')],'app':_0xf85a('0x4'),'appdata':_0xf85a('0x5')+_0x2a5868[_0xf85a('0x3')],'context':_0x2a5868[_0xf85a('0x6')],'exten':_0x2a5868[_0xf85a('0x7')],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']},{'type':_0x2a5868[_0xf85a('0x3')],'app':_0x2a5868['alias']?_0xf85a('0x4'):'NoOp','appdata':_0x2a5868[_0xf85a('0x8')]?_0xf85a('0x9')+_0x2a5868[_0xf85a('0x8')]:_0xf85a('0xa'),'context':_0x2a5868['context'],'exten':_0x2a5868['exten'],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']}];if(_0x2a5868['type']===_0xf85a('0xb')){_0x962a63[_0xf85a('0xc')]({'type':_0xf85a('0xb'),'app':_0xf85a('0x4'),'appdata':_0xf85a('0xd')+_0x2a5868['id'],'context':_0x2a5868[_0xf85a('0x6')],'exten':_0x2a5868['exten'],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']});}_0x962a63['push']({'type':_0x2a5868['type'],'app':_0xf85a('0x4'),'appdata':_0xf85a('0xe'),'context':_0x2a5868[_0xf85a('0x6')],'exten':_0x2a5868['exten'],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']},{'type':_0x2a5868[_0xf85a('0x3')],'app':_0xf85a('0x4'),'appdata':_0xf85a('0xf'),'context':_0x2a5868[_0xf85a('0x6')],'exten':_0x2a5868[_0xf85a('0x7')],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']},{'type':_0x2a5868['type'],'app':_0xf85a('0x4'),'appdata':_0xf85a('0x10'),'context':_0x2a5868['context'],'exten':_0x2a5868['exten'],'priority':_0x4a7a4b++,'VoiceExtensionId':_0x2a5868['id']});return _0x962a63;}function _0x1f4c0e(_0x6845d3){var _0xc7c5c1=0x2;var _0x19cc4f=[{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':'CDR(type)=outbound','context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0x6845d3[_0xf85a('0x8')]?_0xf85a('0x4'):_0xf85a('0x12'),'appdata':_0x6845d3[_0xf85a('0x8')]?'CDR(routeAlias)='+_0x6845d3[_0xf85a('0x8')]:'No\x20alias\x20set','context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':'CDR(destination)='+(_0x6845d3['cutdigits']?'${EXTEN:'+_0x6845d3['cutdigits']+'}':_0xf85a('0x13')),'context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3['exten'],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':_0xf85a('0xd')+_0x6845d3['id'],'context':_0x6845d3['context'],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x14'),'appdata':_0xf85a('0x15')+(_0xc7c5c1+0x2)+_0xf85a('0x16')+(_0xc7c5c1+0x1)+')','context':_0x6845d3['context'],'exten':_0x6845d3['exten'],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':_0x6845d3[_0xf85a('0x17')]?_0xf85a('0x18')+_0x6845d3[_0xf85a('0x17')]+'}':_0xf85a('0x19'),'context':_0x6845d3['context'],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':'outbound','app':_0xf85a('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':_0xf85a('0xf'),'context':_0x6845d3['context'],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':'outbound','app':_0xf85a('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':'Set','appdata':_0xf85a('0x1a')+_0x6845d3['id'],'context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']}];if(_0x6845d3[_0xf85a('0x1b')]('recordingFormat')&&_0x6845d3['recordingFormat']!==_0xf85a('0x1c')){_0x19cc4f['push']({'type':_0xf85a('0x11'),'app':'Set','appdata':_0xf85a('0x1d'),'context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3['exten'],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']},{'type':_0xf85a('0x11'),'app':_0xf85a('0x4'),'appdata':_0xf85a('0x1e')+_0x6845d3[_0xf85a('0x1f')]||'wav','context':_0x6845d3[_0xf85a('0x6')],'exten':_0x6845d3[_0xf85a('0x7')],'priority':_0xc7c5c1++,'VoiceExtensionId':_0x6845d3['id']});}return _0x19cc4f;}function _0x48db2b(_0x5c2fc6){var _0x4a0512=[{'name':_0xf85a('0x20'),'param':0x0},{'name':_0xf85a('0x21'),'param':0x1},{'name':_0xf85a('0x22'),'param':0x2},{'name':_0xf85a('0x23'),'param':0x3}];var _0x53051b={};var _0x5648f4=_0x5c2fc6[_0xf85a('0x24')](',');var _0x517b03=[];for(var _0x348a59=0x0;_0x348a59<_0x4a0512[_0xf85a('0x25')];_0x348a59++){switch(_0x4a0512[_0x348a59][_0xf85a('0x26')]){case'trunk':_0x53051b[_0xf85a('0x20')]=_0x5648f4[_0x4a0512[_0x348a59][_0xf85a('0x27')]]['split']('/')[0x1];_0x53051b[_0xf85a('0x28')]=_0x5648f4[_0x4a0512[_0x348a59][_0xf85a('0x27')]][_0xf85a('0x24')]('/')[0x2];_0x53051b[_0xf85a('0x29')]=_0x53051b[_0xf85a('0x28')]?_0x53051b[_0xf85a('0x28')][_0xf85a('0x24')]('$')[0x0]:undefined;_0x53051b[_0xf85a('0x28')]=route['cutdigits']?(_0x53051b[_0xf85a('0x29')]||'')+_0xf85a('0x2a')+route[_0xf85a('0x17')]+'}':(_0x53051b[_0xf85a('0x29')]||'')+_0xf85a('0x13');_0x517b03[_0x4a0512[_0x348a59]['param']]=[_0xf85a('0x2b'),_0x53051b[_0xf85a('0x20')],_0x53051b['phone']][_0xf85a('0x2c')]('/');break;case'options':_0x53051b[_0xf85a('0x22')]=_0x5648f4[_0x4a0512[_0x348a59][_0xf85a('0x27')]];if(route[_0xf85a('0x1f')]!=='none'){if(_0x53051b[_0xf85a('0x22')]['indexOf'](_0xf85a('0x2d'))<0x0){_0x53051b[_0xf85a('0x22')]+=_0xf85a('0x2d');}}else{_0x53051b[_0xf85a('0x22')]=_0x53051b[_0xf85a('0x22')][_0xf85a('0x2e')](_0xf85a('0x2d'),'');}_0x517b03[_0x4a0512[_0x348a59][_0xf85a('0x27')]]=_0x53051b[_0xf85a('0x22')];break;default:_0x517b03[_0x4a0512[_0x348a59]['param']]=_0x5648f4[_0x4a0512[_0x348a59][_0xf85a('0x27')]];}}return _0x517b03[_0xf85a('0x2c')](',');}function _0x41d0db(_0x16d8fc,_0x3cb18c,_0xc6a35e,_0x3f760b){return new Promise(function(_0x58ff55,_0x54bb62){var _0xeb2148=[];if(_['isEmpty'](_0x3cb18c))return _0x58ff55(_0xeb2148);_0x58cbf1[_0xf85a('0x2f')][_0xf85a('0x30')]({'attributes':['id',_0xf85a('0x31'),_0xf85a('0x32')],'raw':!![]})[_0xf85a('0x33')](function(_0x31ca84){for(var _0x5dcd38=0x0,_0x35d644=0x0;_0x5dcd38<_0x3cb18c[_0xf85a('0x25')];_0x5dcd38++,_0x35d644=0x0){var _0x3b85ec=_0x3cb18c[_0x5dcd38];var _0x5f30ec=[];var _0x3097ee=[];if(_0x3b85ec[_0xf85a('0x31')]!==_0xf85a('0x34')){_0x3b85ec['intervals']=[_0x3b85ec['interval']];}else{_0x3b85ec[_0xf85a('0x35')]=_0x3b85ec[_0xf85a('0x32')]?_[_0xf85a('0x36')](_[_0xf85a('0x37')](_0x31ca84,{'IntervalId':_0x3b85ec['IntervalId']}),'interval'):[];}_0x3b85ec[_0xf85a('0x6')]=_0x16d8fc[_0xf85a('0x6')];_0x3b85ec[_0xf85a('0x7')]=_0x16d8fc[_0xf85a('0x7')];if(_0x3b85ec[_0xf85a('0x3')])_0x3b85ec['type']=_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')]();if(_0x16d8fc[_0xf85a('0x3')]===_0xf85a('0x11')){if(_0x3b85ec[_0xf85a('0x1b')](_0xf85a('0x39'))&&_0x3b85ec[_0xf85a('0x39')]&&_0x3b85ec[_0xf85a('0x39')]!=='--'){_0x5f30ec['push']({'type':_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')](),'app':'Set','appdata':'CDR(tag)='+_0x3b85ec[_0xf85a('0x39')],'context':_0x16d8fc[_0xf85a('0x6')],'exten':_0x16d8fc['exten'],'priority':_0x3b85ec[_0xf85a('0x35')][_0xf85a('0x25')]+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});}_0x5f30ec[_0xf85a('0xc')]({'type':_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')](),'app':_0xf85a('0x14'),'appdata':_0xf85a('0x3a')+(_0x3b85ec[_0xf85a('0x3b')]?_0xf85a('0x3c')+_0x3b85ec[_0xf85a('0x3b')]+')':_0xf85a('0x3d')),'context':_0x16d8fc[_0xf85a('0x6')],'exten':_0x16d8fc['exten'],'priority':_0x3b85ec['intervals']['length']+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});}else{if(_0x3b85ec[_0xf85a('0x1b')](_0xf85a('0x3e'))){if(['queue',_0xf85a('0x3f')]['includes'](_0x3b85ec[_0xf85a('0x40')][_0xf85a('0x38')]())&&_0x3b85ec['appType']!=='custom'){if(_0x3b85ec[_0xf85a('0x3e')]){_0x5f30ec['push']({'type':_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')](),'app':_0xf85a('0x14'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x16d8fc[_0xf85a('0x6')],'exten':_0x16d8fc[_0xf85a('0x7')],'priority':_0x3b85ec[_0xf85a('0x35')][_0xf85a('0x25')]+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});_0x5f30ec[_0xf85a('0xc')]({'type':_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')](),'app':_0xf85a('0x4'),'appdata':_0xf85a('0x41'),'context':_0x16d8fc['context'],'exten':_0x16d8fc[_0xf85a('0x7')],'priority':_0x3b85ec['intervals']['length']+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});}else{_0x5f30ec[_0xf85a('0xc')]({'type':_0x3b85ec[_0xf85a('0x3')][_0xf85a('0x38')](),'app':'ExecIf','appdata':_0xf85a('0x42'),'context':_0x16d8fc[_0xf85a('0x6')],'exten':_0x16d8fc[_0xf85a('0x7')],'priority':_0x3b85ec[_0xf85a('0x35')][_0xf85a('0x25')]+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});_0x5f30ec['push']({'type':_0x3b85ec[_0xf85a('0x3')]['toLowerCase'](),'app':_0xf85a('0x4'),'appdata':_0xf85a('0x43'),'context':_0x16d8fc[_0xf85a('0x6')],'exten':_0x16d8fc[_0xf85a('0x7')],'priority':_0x3b85ec[_0xf85a('0x35')][_0xf85a('0x25')]+_0xc6a35e+_0x35d644++,'VoiceExtensionId':_0x16d8fc['id']});}}}}for(var _0x325807=0x0;_0x325807<_0x3b85ec[_0xf85a('0x35')]['length'];_0x325807++){var _0x187a62=_0xc6a35e+_0x3b85ec[_0xf85a('0x35')][_0xf85a('0x25')];var _0x2eea4f=_0x325807===_0x3b85ec[_0xf85a('0x35')]['length']-0x1?_0xc6a35e+_0x5f30ec['length']+_0x3097ee[_0xf85a('0x25')]+0x2:_0xc6a35e+_0x325807+0x1;_0x5f30ec[_0xf85a('0x44')](_0x325807,0x0,{'type':_0x16d8fc['type'],'app':_0xf85a('0x45'),'appdata':_0x3b85ec[_0xf85a('0x35')][_0x325807]+'?'+_0x16d8fc[_0xf85a('0x6')]+_0xf85a('0x46')+_0x187a62+':'+_0x16d8fc[_0xf85a('0x6')]+',${EXTEN},'+_0x2eea4f,'exten':_0x16d8fc[_0xf85a('0x7')],'context':_0x16d8fc[_0xf85a('0x6')],'priority':_0xc6a35e+_0x325807,'VoiceExtensionId':_0x16d8fc['id']});}if(_0x3f760b&&_0x3b85ec[_0xf85a('0x47')]===_0xf85a('0x48'))_0x3b85ec[_0xf85a('0x49')]=_0x48db2b(_0x3b85ec[_0xf85a('0x49')]);_0x3b85ec[_0xf85a('0x4a')]=_0x5f30ec[_0xf85a('0x25')]?_[_0xf85a('0x4b')](_0x5f30ec)[_0xf85a('0x4a')]+0x1:_0xc6a35e;_0xeb2148=_[_0xf85a('0x4c')](_0xeb2148,_0x5f30ec,[_0x3b85ec],_0x3097ee);_0xc6a35e=_[_0xf85a('0x4b')](_0xeb2148)[_0xf85a('0x4a')]+0x1;}return _0x58ff55(_0xeb2148);})[_0xf85a('0x4d')](function(_0x31d796){_0x54bb62(_0x31d796);});});}return _0x606d99['define'](_0xf85a('0x4e'),attributes,{'tableName':_0xf85a('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x35ad00,_0x2e7d53){var _0x251d16=this;var _0x3e5dbb=_0x251d16[_0xf85a('0x3')]===_0xf85a('0x11')?_0x1f4c0e(_0x251d16):_0x25d8cf(_0x251d16);return _0x41d0db(_0x251d16,_0x35ad00,_[_0xf85a('0x4b')](_0x3e5dbb)[_0xf85a('0x4a')]+0x1,_0x2e7d53)[_0xf85a('0x33')](function(_0x55fa83){var _0x4598f6=_['concat'](_0x3e5dbb,_0x55fa83);_0x4598f6[_0xf85a('0xc')]({'type':_0x251d16[_0xf85a('0x3')],'app':_0xf85a('0x50'),'exten':_0x251d16[_0xf85a('0x7')],'context':_0x251d16[_0xf85a('0x6')],'priority':_[_0xf85a('0x4b')](_0x4598f6)[_0xf85a('0x4a')]+0x1,'VoiceExtensionId':_0x251d16['id']});return _0x4598f6;});}}});}; \ No newline at end of file +var _0x37d9=['XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','length','name','param','phone','split','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','util','./voiceExtension.attributes','exports','Set','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0'];(function(_0x7adb9e,_0x1c7475){var _0x3ac44d=function(_0x207c7a){while(--_0x207c7a){_0x7adb9e['push'](_0x7adb9e['shift']());}};_0x3ac44d(++_0x1c7475);}(_0x37d9,0x1d2));var _0x937d=function(_0x567e42,_0x39fca5){_0x567e42=_0x567e42-0x0;var _0x289a28=_0x37d9[_0x567e42];return _0x289a28;};'use strict';var util=require(_0x937d('0x0'));var _=require('lodash');var attributes=require(_0x937d('0x1'));module[_0x937d('0x2')]=function(_0x3ac3d3){var _0x16fa17=_0x3ac3d3['models'];function _0x4c1ac1(_0x535ab1){var _0x3c3096=0x2;var _0x42d185=[{'type':_0x535ab1['type'],'app':_0x937d('0x3'),'appdata':'CDR(type)='+_0x535ab1[_0x937d('0x4')],'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1[_0x937d('0x4')],'app':_0x535ab1[_0x937d('0x7')]?_0x937d('0x3'):_0x937d('0x8'),'appdata':_0x535ab1[_0x937d('0x7')]?_0x937d('0x9')+_0x535ab1[_0x937d('0x7')]:_0x937d('0xa'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']}];if(_0x535ab1['type']===_0x937d('0xb')){_0x42d185[_0x937d('0xc')]({'type':_0x937d('0xb'),'app':_0x937d('0x3'),'appdata':'CDR(routeid)='+_0x535ab1['id'],'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']});}_0x42d185[_0x937d('0xc')]({'type':_0x535ab1['type'],'app':_0x937d('0x3'),'appdata':_0x937d('0xd'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1['type'],'app':'Set','appdata':_0x937d('0xe'),'context':_0x535ab1['context'],'exten':_0x535ab1['exten'],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1[_0x937d('0x4')],'app':_0x937d('0x3'),'appdata':_0x937d('0xf'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1['exten'],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']});return _0x42d185;}function _0x39c44a(_0x5f1d8c){var _0x18696d=0x2;var _0x45f0b1=[{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x11'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x5f1d8c[_0x937d('0x7')]?'Set':_0x937d('0x8'),'appdata':_0x5f1d8c[_0x937d('0x7')]?'CDR(routeAlias)='+_0x5f1d8c['alias']:'No\x20alias\x20set','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x12')+(_0x5f1d8c[_0x937d('0x13')]?_0x937d('0x14')+_0x5f1d8c[_0x937d('0x13')]+'}':'${EXTEN}'),'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c['exten'],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x15')+_0x5f1d8c['id'],'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x18696d+0x2)+_0x937d('0x17')+(_0x18696d+0x1)+')','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x5f1d8c[_0x937d('0x13')]?_0x937d('0x18')+_0x5f1d8c[_0x937d('0x13')]+'}':_0x937d('0x19'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':'Set','appdata':_0x937d('0xd'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0xf'),'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0x1a')+_0x5f1d8c['id'],'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']}];if(_0x5f1d8c[_0x937d('0x1b')]('recordingFormat')&&_0x5f1d8c[_0x937d('0x1c')]!==_0x937d('0x1d')){_0x45f0b1[_0x937d('0xc')]({'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0x1e')+_0x5f1d8c['recordingFormat']||_0x937d('0x1f'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c['exten'],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']});}return _0x45f0b1;}function _0x2009f8(_0x3b6a6d){var _0x4907f7=[{'name':_0x937d('0x20'),'param':0x0},{'name':_0x937d('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x311916={};var _0x2fa0b4=_0x3b6a6d['split'](',');var _0x1c74f5=[];for(var _0x43388d=0x0;_0x43388d<_0x4907f7[_0x937d('0x22')];_0x43388d++){switch(_0x4907f7[_0x43388d][_0x937d('0x23')]){case _0x937d('0x20'):_0x311916[_0x937d('0x20')]=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]]['split']('/')[0x1];_0x311916[_0x937d('0x25')]=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]][_0x937d('0x26')]('/')[0x2];_0x311916[_0x937d('0x27')]=_0x311916[_0x937d('0x25')]?_0x311916[_0x937d('0x25')][_0x937d('0x26')]('$')[0x0]:undefined;_0x311916[_0x937d('0x25')]=route[_0x937d('0x13')]?(_0x311916[_0x937d('0x27')]||'')+_0x937d('0x14')+route[_0x937d('0x13')]+'}':(_0x311916[_0x937d('0x27')]||'')+'${EXTEN}';_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=[_0x937d('0x28'),_0x311916[_0x937d('0x20')],_0x311916[_0x937d('0x25')]][_0x937d('0x29')]('/');break;case _0x937d('0x2a'):_0x311916['options']=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]];if(route[_0x937d('0x1c')]!==_0x937d('0x1d')){if(_0x311916['options'][_0x937d('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x311916[_0x937d('0x2a')]+='U(xcally-mixmonitor-context)';}}else{_0x311916['options']=_0x311916[_0x937d('0x2a')]['replace'](_0x937d('0x2c'),'');}_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=_0x311916[_0x937d('0x2a')];break;default:_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=_0x2fa0b4[_0x4907f7[_0x43388d]['param']];}}return _0x1c74f5[_0x937d('0x29')](',');}function _0x549a5c(_0x4d9d22,_0x1b5621,_0x22d340,_0x23e3a6){return new Promise(function(_0x3bd64b,_0x50e247){var _0x54f8a8=[];if(_[_0x937d('0x2d')](_0x1b5621))return _0x3bd64b(_0x54f8a8);_0x16fa17[_0x937d('0x2e')][_0x937d('0x2f')]({'attributes':['id',_0x937d('0x30'),_0x937d('0x31')],'raw':!![]})[_0x937d('0x32')](function(_0x2a16c1){for(var _0x41ae1e=0x0,_0x4a339b=0x0;_0x41ae1e<_0x1b5621['length'];_0x41ae1e++,_0x4a339b=0x0){var _0x221c89=_0x1b5621[_0x41ae1e];var _0x555126=[];var _0x44329c=[];if(_0x221c89['interval']!==_0x937d('0x33')){_0x221c89[_0x937d('0x34')]=[_0x221c89[_0x937d('0x30')]];}else{_0x221c89[_0x937d('0x34')]=_0x221c89['IntervalId']?_[_0x937d('0x35')](_['filter'](_0x2a16c1,{'IntervalId':_0x221c89[_0x937d('0x31')]}),_0x937d('0x30')):[];}_0x221c89[_0x937d('0x5')]=_0x4d9d22[_0x937d('0x5')];_0x221c89['exten']=_0x4d9d22[_0x937d('0x6')];if(_0x221c89[_0x937d('0x4')])_0x221c89['type']=_0x221c89[_0x937d('0x4')]['toLowerCase']();if(_0x4d9d22[_0x937d('0x4')]==='outbound'){if(_0x221c89[_0x937d('0x1b')](_0x937d('0x36'))&&_0x221c89[_0x937d('0x36')]&&_0x221c89[_0x937d('0x36')]!=='--'){_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')]['toLowerCase'](),'app':_0x937d('0x3'),'appdata':'CDR(tag)='+_0x221c89['tag'],'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22['exten'],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}_0x555126[_0x937d('0xc')]({'type':_0x221c89['type'][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':_0x937d('0x38')+(_0x221c89[_0x937d('0x39')]?_0x937d('0x3a')+_0x221c89[_0x937d('0x39')]+')':_0x937d('0x3b')),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89['intervals'][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}else{if(_0x221c89[_0x937d('0x1b')](_0x937d('0x3c'))){if(['queue',_0x937d('0x3d')][_0x937d('0x3e')](_0x221c89[_0x937d('0x3f')][_0x937d('0x37')]())&&_0x221c89[_0x937d('0x40')]!==_0x937d('0x41')){if(_0x221c89[_0x937d('0x3c')]){_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22['exten'],'priority':_0x221c89[_0x937d('0x34')][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')]['toLowerCase'](),'app':_0x937d('0x3'),'appdata':_0x937d('0x42'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}else{_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':_0x937d('0x43'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});_0x555126[_0x937d('0xc')]({'type':_0x221c89['type'][_0x937d('0x37')](),'app':_0x937d('0x3'),'appdata':_0x937d('0x44'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}}}}for(var _0x143a2f=0x0;_0x143a2f<_0x221c89[_0x937d('0x34')][_0x937d('0x22')];_0x143a2f++){var _0x17f9db=_0x22d340+_0x221c89[_0x937d('0x34')][_0x937d('0x22')];var _0x1e0e0c=_0x143a2f===_0x221c89[_0x937d('0x34')][_0x937d('0x22')]-0x1?_0x22d340+_0x555126[_0x937d('0x22')]+_0x44329c[_0x937d('0x22')]+0x2:_0x22d340+_0x143a2f+0x1;_0x555126[_0x937d('0x45')](_0x143a2f,0x0,{'type':_0x4d9d22[_0x937d('0x4')],'app':'GotoIfTime','appdata':_0x221c89[_0x937d('0x34')][_0x143a2f]+'?'+_0x4d9d22[_0x937d('0x5')]+_0x937d('0x46')+_0x17f9db+':'+_0x4d9d22[_0x937d('0x5')]+_0x937d('0x46')+_0x1e0e0c,'exten':_0x4d9d22[_0x937d('0x6')],'context':_0x4d9d22['context'],'priority':_0x22d340+_0x143a2f,'VoiceExtensionId':_0x4d9d22['id']});}if(_0x23e3a6&&_0x221c89[_0x937d('0x40')]==='outboundDial')_0x221c89[_0x937d('0x47')]=_0x2009f8(_0x221c89[_0x937d('0x47')]);_0x221c89[_0x937d('0x48')]=_0x555126[_0x937d('0x22')]?_[_0x937d('0x49')](_0x555126)[_0x937d('0x48')]+0x1:_0x22d340;_0x54f8a8=_[_0x937d('0x4a')](_0x54f8a8,_0x555126,[_0x221c89],_0x44329c);_0x22d340=_[_0x937d('0x49')](_0x54f8a8)[_0x937d('0x48')]+0x1;}return _0x3bd64b(_0x54f8a8);})[_0x937d('0x4b')](function(_0x165103){_0x50e247(_0x165103);});});}return _0x3ac3d3[_0x937d('0x4c')](_0x937d('0x4d'),attributes,{'tableName':_0x937d('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37e903,_0x14901e){var _0x1d4917=this;var _0x390073=_0x1d4917['type']===_0x937d('0x10')?_0x39c44a(_0x1d4917):_0x4c1ac1(_0x1d4917);return _0x549a5c(_0x1d4917,_0x37e903,_[_0x937d('0x49')](_0x390073)[_0x937d('0x48')]+0x1,_0x14901e)[_0x937d('0x32')](function(_0x4f5ac2){var _0x1402a8=_[_0x937d('0x4a')](_0x390073,_0x4f5ac2);_0x1402a8[_0x937d('0xc')]({'type':_0x1d4917[_0x937d('0x4')],'app':_0x937d('0x4f'),'exten':_0x1d4917[_0x937d('0x6')],'context':_0x1d4917[_0x937d('0x5')],'priority':_[_0x937d('0x49')](_0x1402a8)[_0x937d('0x48')]+0x1,'VoiceExtensionId':_0x1d4917['id']});return _0x1402a8;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fd700f4..36c6514 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 _0xc4f5=['stringify','code','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','raw','where','limit','include','map','attributes','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0xb97d08,_0x5f1641){var _0x32e94b=function(_0x5b7290){while(--_0x5b7290){_0xb97d08['push'](_0xb97d08['shift']());}};_0x32e94b(++_0x5f1641);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x1ea034,_0x476985){_0x1ea034=_0x1ea034-0x0;var _0x2a16c1=_0xc4f5[_0x1ea034];return _0x2a16c1;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var moment=require(_0x5c4f('0x1'));var BPromise=require(_0x5c4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c4f('0x3'));var db=require(_0x5c4f('0x4'))['db'];var utils=require(_0x5c4f('0x5'));var logger=require(_0x5c4f('0x6'))(_0x5c4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c4f('0x8'));var client=jayson[_0x5c4f('0x9')][_0x5c4f('0xa')]({'port':0x232a});config[_0x5c4f('0xb')]=_[_0x5c4f('0xc')](config['redis'],{'host':_0x5c4f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c4f('0xb')]));require('./voiceExtension.socket')[_0x5c4f('0xe')](socket);function respondWithRpcPromise(_0x458348,_0x19623c,_0x56535a){return new BPromise(function(_0x249955,_0x2a9bf9){return client[_0x5c4f('0xf')](_0x458348,_0x56535a)['then'](function(_0x255e5d){logger[_0x5c4f('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x19623c,_0x5c4f('0x11'));logger[_0x5c4f('0x12')](_0x5c4f('0x13'),_0x19623c,_0x5c4f('0x11'),JSON[_0x5c4f('0x14')](_0x255e5d));if(_0x255e5d['error']){if(_0x255e5d['error'][_0x5c4f('0x15')]===0x1f4){logger[_0x5c4f('0x16')](_0x5c4f('0x17'),_0x19623c,_0x255e5d[_0x5c4f('0x16')][_0x5c4f('0x18')]);return _0x2a9bf9(_0x255e5d['error']['message']);}logger[_0x5c4f('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x19623c,_0x255e5d['error'][_0x5c4f('0x18')]);return _0x249955(_0x255e5d['error'][_0x5c4f('0x18')]);}else{logger[_0x5c4f('0x10')](_0x5c4f('0x17'),_0x19623c,_0x5c4f('0x11'));_0x249955(_0x255e5d[_0x5c4f('0x19')][_0x5c4f('0x18')]);}})[_0x5c4f('0x1a')](function(_0x3ec0ff){logger[_0x5c4f('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x19623c,_0x3ec0ff);_0x2a9bf9(_0x3ec0ff);});});}exports[_0x5c4f('0x1b')]=function(_0x2e1b98){var _0x238744=this;return new Promise(function(_0x32a779,_0x5170e0){return db['VoiceExtension'][_0x5c4f('0x1c')]({'raw':_0x2e1b98[_0x5c4f('0x1d')]?_0x2e1b98[_0x5c4f('0x1d')][_0x5c4f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e1b98[_0x5c4f('0x1d')]?_0x2e1b98[_0x5c4f('0x1d')][_0x5c4f('0x1f')]||null:null,'attributes':_0x2e1b98[_0x5c4f('0x1d')]?_0x2e1b98['options']['attributes']||null:null,'limit':_0x2e1b98[_0x5c4f('0x1d')]?_0x2e1b98[_0x5c4f('0x1d')][_0x5c4f('0x20')]||null:null,'include':_0x2e1b98[_0x5c4f('0x1d')]?_0x2e1b98['options'][_0x5c4f('0x21')]?_[_0x5c4f('0x22')](_0x2e1b98[_0x5c4f('0x1d')][_0x5c4f('0x21')],function(_0x307352){return{'model':db[_0x307352['model']],'as':_0x307352['as'],'attributes':_0x307352[_0x5c4f('0x23')],'include':_0x307352[_0x5c4f('0x21')]?_[_0x5c4f('0x22')](_0x307352[_0x5c4f('0x21')],function(_0x45bc65){return{'model':db[_0x45bc65[_0x5c4f('0x24')]],'as':_0x45bc65['as'],'attributes':_0x45bc65['attributes'],'include':_0x45bc65[_0x5c4f('0x21')]?_[_0x5c4f('0x22')](_0x45bc65[_0x5c4f('0x21')],function(_0xa55b58){return{'model':db[_0xa55b58['model']],'as':_0xa55b58['as'],'attributes':_0xa55b58['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e0b87){logger[_0x5c4f('0x10')](_0x5c4f('0x1b'),_0x2e1b98);logger[_0x5c4f('0x12')](_0x5c4f('0x1b'),_0x2e1b98,JSON[_0x5c4f('0x14')](_0x2e0b87));_0x32a779(_0x2e0b87);})[_0x5c4f('0x1a')](function(_0x44b2ff){logger[_0x5c4f('0x16')](_0x5c4f('0x1b'),_0x44b2ff[_0x5c4f('0x18')],_0x2e1b98);_0x5170e0(_0x238744[_0x5c4f('0x16')](0x1f4,_0x44b2ff[_0x5c4f('0x18')]));});});}; \ No newline at end of file +var _0x81c6=['client','redis','defaults','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','info','stringify','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x133d75,_0x561898){var _0x2b39a0=function(_0x12f740){while(--_0x12f740){_0x133d75['push'](_0x133d75['shift']());}};_0x2b39a0(++_0x561898);}(_0x81c6,0x1d5));var _0x681c=function(_0x5474b4,_0x5027aa){_0x5474b4=_0x5474b4-0x0;var _0x33a0b5=_0x81c6[_0x5474b4];return _0x33a0b5;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});config[_0x681c('0x8')]=_[_0x681c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x681c('0xa'))(new Redis(config[_0x681c('0x8')]));require(_0x681c('0xb'))['register'](socket);function respondWithRpcPromise(_0x4f0228,_0x3e3770,_0x4ff60b){return new BPromise(function(_0x82b6ad,_0x83927a){return client[_0x681c('0xc')](_0x4f0228,_0x4ff60b)[_0x681c('0xd')](function(_0x48dc05){logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));logger[_0x681c('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3e3770,_0x681c('0xf'),JSON['stringify'](_0x48dc05));if(_0x48dc05[_0x681c('0x11')]){if(_0x48dc05['error'][_0x681c('0x12')]===0x1f4){logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x83927a(_0x48dc05[_0x681c('0x11')]['message']);}logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x82b6ad(_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);}else{logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));_0x82b6ad(_0x48dc05[_0x681c('0x14')][_0x681c('0x13')]);}})['catch'](function(_0x22e608){logger[_0x681c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x3e3770,_0x22e608);_0x83927a(_0x22e608);});});}exports[_0x681c('0x15')]=function(_0x4c22c7){var _0x46cafc=this;return new Promise(function(_0x11836c,_0x11d68d){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x4c22c7['options']?_0x4c22c7['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'limit':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1b')]||null:null,'include':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1c')]?_[_0x681c('0x1d')](_0x4c22c7[_0x681c('0x18')][_0x681c('0x1c')],function(_0x228f59){return{'model':db[_0x228f59['model']],'as':_0x228f59['as'],'attributes':_0x228f59[_0x681c('0x1a')],'include':_0x228f59['include']?_[_0x681c('0x1d')](_0x228f59['include'],function(_0x583499){return{'model':db[_0x583499[_0x681c('0x1e')]],'as':_0x583499['as'],'attributes':_0x583499[_0x681c('0x1a')],'include':_0x583499[_0x681c('0x1c')]?_[_0x681c('0x1d')](_0x583499['include'],function(_0x3b1031){return{'model':db[_0x3b1031[_0x681c('0x1e')]],'as':_0x3b1031['as'],'attributes':_0x3b1031[_0x681c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x681c('0xd')](function(_0x147cda){logger[_0x681c('0x1f')](_0x681c('0x15'),_0x4c22c7);logger['debug'](_0x681c('0x15'),_0x4c22c7,JSON[_0x681c('0x20')](_0x147cda));_0x11836c(_0x147cda);})[_0x681c('0x21')](function(_0x4af6aa){logger[_0x681c('0x11')](_0x681c('0x15'),_0x4af6aa[_0x681c('0x13')],_0x4c22c7);_0x11d68d(_0x46cafc['error'](0x1f4,_0x4af6aa[_0x681c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index f22d959..784abe0 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x1b999c,_0x5ddbcb){var _0x370384=function(_0x309b99){while(--_0x309b99){_0x1b999c['push'](_0x1b999c['shift']());}};_0x370384(++_0x5ddbcb);}(_0x5fab,0x177));var _0xb5fa=function(_0x143d33,_0x5ae149){_0x143d33=_0x143d33-0x0;var _0x2ec94e=_0x5fab[_0x143d33];return _0x2ec94e;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x53a415,_0x2bded5){_0x53a415=_0x53a415-0x0;var _0x469af7=_0x1cb9[_0x53a415];return _0x469af7;};'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 7c21827..f789dd3 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 _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','/:id/messages','create','update','destroy','exports','util'];(function(_0x3ac342,_0xba7e4c){var _0x2dbe6d=function(_0x3605a3){while(--_0x3605a3){_0x3ac342['push'](_0x3ac342['shift']());}};_0x2dbe6d(++_0xba7e4c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6d38[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['getMessages']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xa'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0x958a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x1d6131,_0x181f2f){var _0x2b31e0=function(_0x5d2821){while(--_0x5d2821){_0x1d6131['push'](_0x1d6131['shift']());}};_0x2b31e0(++_0x181f2f);}(_0x958a,0x128));var _0xa958=function(_0x1ace6e,_0x3e618c){_0x1ace6e=_0x1ace6e-0x0;var _0x27c40e=_0x958a[_0x1ace6e];return _0x27c40e;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./voiceMail.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id/messages',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0xe')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x12')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 852d1d2..4c48610 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 _0xc74d=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x1d70cc,_0x23a7b6){var _0x8cc7ac=function(_0x546720){while(--_0x546720){_0x1d70cc['push'](_0x1d70cc['shift']());}};_0x8cc7ac(++_0x23a7b6);}(_0xc74d,0x127));var _0xdc74=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc74d[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0xdc74('0x0')]={'customer_id':{'type':Sequelize[_0xdc74('0x1')]},'context':{'type':Sequelize[_0xdc74('0x1')],'defaultValue':_0xdc74('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xdc74('0x3')},'password':{'type':Sequelize[_0xdc74('0x1')]},'fullname':{'type':Sequelize[_0xdc74('0x1')]},'email':{'type':Sequelize[_0xdc74('0x1')],'validate':{'isEmail':!![]},'set':function(_0x127978){this['setDataValue'](_0xdc74('0x4'),typeof _0x127978===_0xdc74('0x5')&&_0x127978[_0xdc74('0x6')]()?_0x127978[_0xdc74('0x6')]():null);}},'pager':{'type':Sequelize[_0xdc74('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xdc74('0x7')},'attach':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':_0xdc74('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xdc74('0x9'),'no'),'defaultValue':_0xdc74('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0xdc74('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xdc74('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xdc74('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xdc74('0x8')](_0xdc74('0x9'),'no'),'defaultValue':_0xdc74('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xdc74('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xdc74('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xdc74('0x8')]('yes','no'),'defaultValue':_0xdc74('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xdc74('0x1')]},'emailbody':{'type':Sequelize[_0xdc74('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xdc74('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xdc74('0xc')],'get':function(){return this[_0xdc74('0xd')](_0xdc74('0xe'))+_0xdc74('0xf')+this[_0xdc74('0xd')](_0xdc74('0x10'));}}}; \ No newline at end of file +var _0xdb07=['STRING','from-voicemail','setDataValue','email','string','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports'];(function(_0xa7c9d7,_0x5e1699){var _0x449bb4=function(_0x3724aa){while(--_0x3724aa){_0xa7c9d7['push'](_0xa7c9d7['shift']());}};_0x449bb4(++_0x5e1699);}(_0xdb07,0x152));var _0x7db0=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xdb07[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0x7db0('0x0'));module[_0x7db0('0x1')]={'customer_id':{'type':Sequelize[_0x7db0('0x2')]},'context':{'type':Sequelize[_0x7db0('0x2')],'defaultValue':_0x7db0('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7db0('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7db0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4b612b){this[_0x7db0('0x4')](_0x7db0('0x5'),typeof _0x4b612b===_0x7db0('0x6')&&_0x4b612b['trim']()?_0x4b612b['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x7db0('0x2')],'defaultValue':_0x7db0('0x7')},'attach':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7db0('0x2')]},'callback':{'type':Sequelize[_0x7db0('0x2')]},'review':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'stamp':{'type':_0x7db0('0xa')},'emailsubject':{'type':Sequelize[_0x7db0('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x7db0('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7db0('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7db0('0xc')],'get':function(){return this[_0x7db0('0xd')](_0x7db0('0xe'))+_0x7db0('0xf')+this[_0x7db0('0xd')](_0x7db0('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 9fb6d88..06ff8d3 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 _0xda3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','length','mailbox','VoiceMailMessage','findAndCountAll','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'];(function(_0x58b210,_0x16ddde){var _0x254559=function(_0x43ab1f){while(--_0x43ab1f){_0x58b210['push'](_0x58b210['shift']());}};_0x254559(++_0x16ddde);}(_0xda3f,0xec));var _0xfda3=function(_0x524264,_0x317974){_0x524264=_0x524264-0x0;var _0x3e0c88=_0xda3f[_0x524264];return _0x3e0c88;};'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(){var _0x2d5b44=_0x16eaa6[_0xfda3('0x24')]({'plain':!![]});var _0x4ae9b9=_0xfda3('0x25');return db[_0xfda3('0x26')][_0xfda3('0x27')]({'where':{'type':_0x4ae9b9,'resourceId':_0x2d5b44['id']}})[_0xfda3('0x23')](function(){return _0x16eaa6;});})[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6d7d,_0x1e87fe){return function(_0x2bef2b){if(!_0x2bef2b){_0x3c6d7d[_0xfda3('0x17')](0x194);}return _0x2bef2b;};}function handleError(_0x33ffd4,_0x5704c7){_0x5704c7=_0x5704c7||0x1f4;return function(_0x3c1549){logger[_0xfda3('0x28')](_0x3c1549[_0xfda3('0x29')]);if(_0x3c1549[_0xfda3('0x2a')]){delete _0x3c1549[_0xfda3('0x2a')];}_0x33ffd4[_0xfda3('0x18')](_0x5704c7)[_0xfda3('0x2b')](_0x3c1549);};}exports['index']=function(_0x56ca3a,_0x3aef3c){var _0x4fd277={},_0x4b9d90={},_0x16b4a2={'count':0x0,'rows':[]};var _0x2a5971=_[_0xfda3('0x2c')](db[_0xfda3('0x2d')][_0xfda3('0x2e')],function(_0x35ec7a){return{'name':_0x35ec7a[_0xfda3('0x2f')],'type':_0x35ec7a[_0xfda3('0x30')][_0xfda3('0x31')]};});_0x4b9d90['model']=_[_0xfda3('0x2c')](_0x2a5971,_0xfda3('0x2a'));_0x4b9d90[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x56ca3a[_0xfda3('0x32')]);_0x4b9d90[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x4b9d90[_0xfda3('0x36')],_0x4b9d90[_0xfda3('0x32')]);_0x4fd277['attributes']=_['intersection'](_0x4b9d90[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x56ca3a['query'][_0xfda3('0x37')]));_0x4fd277[_0xfda3('0x38')]=_0x4fd277[_0xfda3('0x38')]['length']?_0x4fd277[_0xfda3('0x38')]:_0x4b9d90[_0xfda3('0x36')];if(!_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4fd277['limit']=qs[_0xfda3('0x1b')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x1b')]);_0x4fd277['offset']=qs[_0xfda3('0x19')](_0x56ca3a['query'][_0xfda3('0x19')]);}_0x4fd277[_0xfda3('0x3b')]=qs[_0xfda3('0x3c')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3c')]);_0x4fd277[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x56ca3a['query'],_0x4b9d90[_0xfda3('0x34')]),_0x2a5971);if(_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4fd277[_0xfda3('0x3d')]=_['merge'](_0x4fd277[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x2a5971,function(_0x590ba5){if(_0x590ba5['type']!=='VIRTUAL'){var _0x31b173={};_0x31b173[_0x590ba5[_0xfda3('0x2a')]]={'$like':'%'+_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]+'%'};return _0x31b173;}})});}_0x4fd277=_[_0xfda3('0x40')]({},_0x4fd277,_0x56ca3a[_0xfda3('0x41')]);var _0x40b814={'where':_0x4fd277[_0xfda3('0x3d')]};return db[_0xfda3('0x2d')][_0xfda3('0x1c')](_0x40b814)['then'](function(_0x27200f){_0x16b4a2[_0xfda3('0x1c')]=_0x27200f;if(_0x56ca3a['query'][_0xfda3('0x42')]){_0x4fd277['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4fd277);})[_0xfda3('0x23')](function(_0x107fb1){_0x16b4a2[_0xfda3('0x43')]=_0x107fb1;return _0x16b4a2;})[_0xfda3('0x23')](respondWithFilteredResult(_0x3aef3c,_0x4fd277))['catch'](handleError(_0x3aef3c,null));};exports[_0xfda3('0x44')]=function(_0x25b9a6,_0x154ae7){var _0x2ce504={'raw':!![],'where':{'id':_0x25b9a6[_0xfda3('0x45')]['id']}},_0x564ccd={};_0x564ccd[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMail']['rawAttributes']);_0x564ccd[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x25b9a6[_0xfda3('0x32')]);_0x564ccd[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],_0x564ccd[_0xfda3('0x32')]);_0x2ce504[_0xfda3('0x38')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x37')]));_0x2ce504[_0xfda3('0x38')]=_0x2ce504['attributes']['length']?_0x2ce504[_0xfda3('0x38')]:_0x564ccd[_0xfda3('0x36')];if(_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x42')]){_0x2ce504[_0xfda3('0x46')]=[{'all':!![]}];}_0x2ce504=_[_0xfda3('0x40')]({},_0x2ce504,_0x25b9a6[_0xfda3('0x41')]);return db[_0xfda3('0x2d')][_0xfda3('0x47')](_0x2ce504)[_0xfda3('0x23')](handleEntityNotFound(_0x154ae7,null))['then'](respondWithResult(_0x154ae7,null))[_0xfda3('0x48')](handleError(_0x154ae7,null));};exports[_0xfda3('0x49')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x2d')]['create'](_0x481356[_0xfda3('0x4a')],{})[_0xfda3('0x23')](function(_0x15eb87){var _0x4bcd2b=_0x481356[_0xfda3('0x4b')][_0xfda3('0x24')]({'plain':!![]});if(!_0x4bcd2b)throw new Error(_0xfda3('0x4c'));if(_0x4bcd2b['role']===_0xfda3('0x4b')){var _0x33565d=_0x15eb87[_0xfda3('0x24')]({'plain':!![]});var _0x2f6e62=_0xfda3('0x25');return db['UserProfileSection'][_0xfda3('0x47')]({'where':{'name':_0x2f6e62,'userProfileId':_0x4bcd2b['userProfileId']},'raw':!![]})[_0xfda3('0x23')](function(_0x587eef){if(_0x587eef&&_0x587eef[_0xfda3('0x4d')]===0x0){return db[_0xfda3('0x26')][_0xfda3('0x49')]({'name':_0x33565d[_0xfda3('0x2a')],'resourceId':_0x33565d['id'],'type':_0x587eef['name'],'sectionId':_0x587eef['id']},{})[_0xfda3('0x23')](function(){return _0x15eb87;});}else{return _0x15eb87;}})[_0xfda3('0x48')](function(_0x2f2c32){logger[_0xfda3('0x28')](_0xfda3('0x4e'),_0x2f2c32);throw _0x2f2c32;});}return _0x15eb87;})[_0xfda3('0x23')](respondWithResult(_0x36aa3a,0xc9))[_0xfda3('0x48')](handleError(_0x36aa3a,null));};exports['update']=function(_0x4b1410,_0x4fb214){if(_0x4b1410[_0xfda3('0x4a')]['id']){delete _0x4b1410[_0xfda3('0x4a')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x4b1410[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x4fb214,null))[_0xfda3('0x23')](saveUpdates(_0x4b1410[_0xfda3('0x4a')],null))[_0xfda3('0x23')](respondWithResult(_0x4fb214,null))['catch'](handleError(_0x4fb214,null));};exports[_0xfda3('0x27')]=function(_0x2a30e8,_0x167424){return db[_0xfda3('0x2d')][_0xfda3('0x47')]({'where':{'id':_0x2a30e8[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x167424,null))[_0xfda3('0x23')](removeEntity(_0x167424,null))[_0xfda3('0x48')](handleError(_0x167424,null));};exports[_0xfda3('0x4f')]=function(_0x3ed7c1,_0x1fa27a,_0x5b426b){return db[_0xfda3('0x2d')][_0xfda3('0x50')]({'where':{'id':_0x3ed7c1[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x1fa27a,null))[_0xfda3('0x23')](function(_0x405d7e){var _0x42c7a1;var _0x4ce31c={},_0x5a3a6f={};_0x5a3a6f[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMailMessage'][_0xfda3('0x2e')]);_0x5a3a6f[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x3ed7c1[_0xfda3('0x32')]);_0x5a3a6f['filters']=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],_0x5a3a6f[_0xfda3('0x32')]);_0x4ce31c[_0xfda3('0x38')]=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],qs['fields'](_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x37')]));_0x4ce31c[_0xfda3('0x38')]=_0x4ce31c[_0xfda3('0x38')][_0xfda3('0x51')]?_0x4ce31c[_0xfda3('0x38')]:_0x5a3a6f['model'];if(!_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4ce31c[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3ed7c1['query']['limit']);_0x4ce31c[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3ed7c1['query']['offset']);}_0x4ce31c['order']=qs[_0xfda3('0x3c')](_0x3ed7c1[_0xfda3('0x32')]['sort']);_0x4ce31c[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x3ed7c1[_0xfda3('0x32')],_0x5a3a6f['filters']));if(_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x4ce31c['attributes'],function(_0x4e312d){var _0x31d657={};_0x31d657[_0x4e312d]={'$like':'%'+_0x3ed7c1['query'][_0xfda3('0x3f')]+'%'};return _0x31d657;})});}_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'mailboxuser':_0x405d7e[_0xfda3('0x52')]});_0x4ce31c=_[_0xfda3('0x40')]({},_0x4ce31c,_0x3ed7c1[_0xfda3('0x41')]);return db[_0xfda3('0x53')][_0xfda3('0x54')](_0x4ce31c)[_0xfda3('0x23')](respondWithFilteredResult(_0x1fa27a,_0x4ce31c));})['catch'](handleError(_0x1fa27a,null));}; \ No newline at end of file +var _0xbc9d=['mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../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','offset','set','Content-Range','save','update','destroy','then','get','UserProfileResource','stack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','options','include','VoiceMail','findAll','rows','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage'];(function(_0x306601,_0x242dd6){var _0x1907cd=function(_0x441e84){while(--_0x441e84){_0x306601['push'](_0x306601['shift']());}};_0x1907cd(++_0x242dd6);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x54b23e,_0x2935e5){_0x54b23e=_0x54b23e-0x0;var _0x18a67a=_0xbc9d[_0x54b23e];return _0x18a67a;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){var _0x32822f=_0x119230[_0xdbc9('0x27')]({'plain':!![]});var _0x3c8c1d='Voicemails';return db[_0xdbc9('0x28')][_0xdbc9('0x25')]({'where':{'type':_0x3c8c1d,'resourceId':_0x32822f['id']}})[_0xdbc9('0x26')](function(){return _0x119230;});})[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf121e9,_0x2ee00a){return function(_0x5300bd){if(!_0x5300bd){_0xf121e9['sendStatus'](0x194);}return _0x5300bd;};}function handleError(_0x45aebe,_0x278db2){_0x278db2=_0x278db2||0x1f4;return function(_0x473430){logger['error'](_0x473430[_0xdbc9('0x29')]);if(_0x473430['name']){delete _0x473430['name'];}_0x45aebe[_0xdbc9('0x1a')](_0x278db2)['send'](_0x473430);};}exports['index']=function(_0x417b17,_0x20eb4f){var _0x1cb557={},_0x4db824={},_0x35eaf8={'count':0x0,'rows':[]};var _0x22f8aa=_['map'](db['VoiceMail'][_0xdbc9('0x2a')],function(_0x245496){return{'name':_0x245496[_0xdbc9('0x2b')],'type':_0x245496[_0xdbc9('0x2c')][_0xdbc9('0x2d')]};});_0x4db824[_0xdbc9('0x2e')]=_[_0xdbc9('0x2f')](_0x22f8aa,'name');_0x4db824[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x417b17[_0xdbc9('0x30')]);_0x4db824[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x4db824[_0xdbc9('0x2e')],_0x4db824['query']);_0x1cb557[_0xdbc9('0x34')]=_['intersection'](_0x4db824['model'],qs['fields'](_0x417b17['query']['fields']));_0x1cb557[_0xdbc9('0x34')]=_0x1cb557[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x1cb557['attributes']:_0x4db824[_0xdbc9('0x2e')];if(!_0x417b17[_0xdbc9('0x30')][_0xdbc9('0x36')](_0xdbc9('0x37'))){_0x1cb557[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x417b17['query'][_0xdbc9('0x1e')]);_0x1cb557[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x417b17['query'][_0xdbc9('0x20')]);}_0x1cb557[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x417b17[_0xdbc9('0x30')]['sort']);_0x1cb557['where']=qs[_0xdbc9('0x32')](_[_0xdbc9('0x3a')](_0x417b17[_0xdbc9('0x30')],_0x4db824[_0xdbc9('0x32')]),_0x22f8aa);if(_0x417b17['query'][_0xdbc9('0x3b')]){_0x1cb557[_0xdbc9('0x3c')]=_[_0xdbc9('0x3d')](_0x1cb557['where'],{'$or':_[_0xdbc9('0x2f')](_0x22f8aa,function(_0x38a2a7){if(_0x38a2a7[_0xdbc9('0x2c')]!=='VIRTUAL'){var _0xa11bc8={};_0xa11bc8[_0x38a2a7[_0xdbc9('0x3e')]]={'$like':'%'+_0x417b17['query']['filter']+'%'};return _0xa11bc8;}})});}_0x1cb557=_[_0xdbc9('0x3d')]({},_0x1cb557,_0x417b17[_0xdbc9('0x3f')]);var _0x387b57={'where':_0x1cb557[_0xdbc9('0x3c')]};return db['VoiceMail'][_0xdbc9('0x1f')](_0x387b57)[_0xdbc9('0x26')](function(_0x577725){_0x35eaf8[_0xdbc9('0x1f')]=_0x577725;if(_0x417b17[_0xdbc9('0x30')]['includeAll']){_0x1cb557[_0xdbc9('0x40')]=[{'all':!![]}];}return db[_0xdbc9('0x41')][_0xdbc9('0x42')](_0x1cb557);})[_0xdbc9('0x26')](function(_0x3ed4de){_0x35eaf8[_0xdbc9('0x43')]=_0x3ed4de;return _0x35eaf8;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x20eb4f,_0x1cb557))['catch'](handleError(_0x20eb4f,null));};exports['show']=function(_0x768856,_0x3b8437){var _0xc77676={'raw':!![],'where':{'id':_0x768856[_0xdbc9('0x44')]['id']}},_0x41f56a={};_0x41f56a[_0xdbc9('0x2e')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x41')][_0xdbc9('0x2a')]);_0x41f56a[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x768856['query']);_0x41f56a['filters']=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],_0x41f56a[_0xdbc9('0x30')]);_0xc77676[_0xdbc9('0x34')]=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],qs[_0xdbc9('0x45')](_0x768856[_0xdbc9('0x30')]['fields']));_0xc77676['attributes']=_0xc77676[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0xc77676[_0xdbc9('0x34')]:_0x41f56a[_0xdbc9('0x2e')];if(_0x768856[_0xdbc9('0x30')][_0xdbc9('0x46')]){_0xc77676[_0xdbc9('0x40')]=[{'all':!![]}];}_0xc77676=_[_0xdbc9('0x3d')]({},_0xc77676,_0x768856[_0xdbc9('0x3f')]);return db['VoiceMail'][_0xdbc9('0x47')](_0xc77676)[_0xdbc9('0x26')](handleEntityNotFound(_0x3b8437,null))['then'](respondWithResult(_0x3b8437,null))['catch'](handleError(_0x3b8437,null));};exports[_0xdbc9('0x48')]=function(_0xc3db3c,_0x133a13){return db['VoiceMail'][_0xdbc9('0x48')](_0xc3db3c[_0xdbc9('0x49')],{})[_0xdbc9('0x26')](function(_0x274607){var _0x5aee83=_0xc3db3c[_0xdbc9('0x4a')][_0xdbc9('0x27')]({'plain':!![]});if(!_0x5aee83)throw new Error(_0xdbc9('0x4b'));if(_0x5aee83[_0xdbc9('0x4c')]==='user'){var _0x3e89f5=_0x274607[_0xdbc9('0x27')]({'plain':!![]});var _0x3f49b7=_0xdbc9('0x4d');return db[_0xdbc9('0x4e')][_0xdbc9('0x47')]({'where':{'name':_0x3f49b7,'userProfileId':_0x5aee83[_0xdbc9('0x4f')]},'raw':!![]})[_0xdbc9('0x26')](function(_0x4b34dd){if(_0x4b34dd&&_0x4b34dd[_0xdbc9('0x50')]===0x0){return db['UserProfileResource'][_0xdbc9('0x48')]({'name':_0x3e89f5[_0xdbc9('0x3e')],'resourceId':_0x3e89f5['id'],'type':_0x4b34dd['name'],'sectionId':_0x4b34dd['id']},{})['then'](function(){return _0x274607;});}else{return _0x274607;}})[_0xdbc9('0x51')](function(_0x4b55df){logger[_0xdbc9('0x52')](_0xdbc9('0x53'),_0x4b55df);throw _0x4b55df;});}return _0x274607;})[_0xdbc9('0x26')](respondWithResult(_0x133a13,0xc9))['catch'](handleError(_0x133a13,null));};exports[_0xdbc9('0x24')]=function(_0x1c52e6,_0x3d8b01){if(_0x1c52e6[_0xdbc9('0x49')]['id']){delete _0x1c52e6[_0xdbc9('0x49')]['id'];}return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x1c52e6[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d8b01,null))['then'](saveUpdates(_0x1c52e6['body'],null))[_0xdbc9('0x26')](respondWithResult(_0x3d8b01,null))[_0xdbc9('0x51')](handleError(_0x3d8b01,null));};exports[_0xdbc9('0x25')]=function(_0x55d8ba,_0x519ac9){return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x55d8ba['params']['id']}})['then'](handleEntityNotFound(_0x519ac9,null))[_0xdbc9('0x26')](removeEntity(_0x519ac9,null))[_0xdbc9('0x51')](handleError(_0x519ac9,null));};exports[_0xdbc9('0x54')]=function(_0x2f90a8,_0x3021be,_0x1f52bb){return db['VoiceMail'][_0xdbc9('0x55')]({'where':{'id':_0x2f90a8[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x3021be,null))['then'](function(_0x189d8a){var _0x14ccb4;var _0x1819fa={},_0x57b4ab={};_0x57b4ab[_0xdbc9('0x2e')]=_['keys'](db[_0xdbc9('0x56')][_0xdbc9('0x2a')]);_0x57b4ab[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x2f90a8[_0xdbc9('0x30')]);_0x57b4ab[_0xdbc9('0x32')]=_['intersection'](_0x57b4ab[_0xdbc9('0x2e')],_0x57b4ab['query']);_0x1819fa[_0xdbc9('0x34')]=_[_0xdbc9('0x33')](_0x57b4ab['model'],qs[_0xdbc9('0x45')](_0x2f90a8[_0xdbc9('0x30')]['fields']));_0x1819fa['attributes']=_0x1819fa[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x1819fa[_0xdbc9('0x34')]:_0x57b4ab['model'];if(!_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x36')]('nolimit')){_0x1819fa[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x2f90a8['query']['limit']);_0x1819fa[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x20')]);}_0x1819fa[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x39')]);_0x1819fa['where']=qs[_0xdbc9('0x32')](_[_0xdbc9('0x3a')](_0x2f90a8[_0xdbc9('0x30')],_0x57b4ab[_0xdbc9('0x32')]));if(_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x3b')]){_0x1819fa[_0xdbc9('0x3c')]=_[_0xdbc9('0x3d')](_0x1819fa['where'],{'$or':_[_0xdbc9('0x2f')](_0x1819fa['attributes'],function(_0x2678b2){var _0x4c5207={};_0x4c5207[_0x2678b2]={'$like':'%'+_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x3b')]+'%'};return _0x4c5207;})});}_0x1819fa['where']=_['merge'](_0x1819fa['where'],{'mailboxuser':_0x189d8a[_0xdbc9('0x57')]});_0x1819fa=_[_0xdbc9('0x3d')]({},_0x1819fa,_0x2f90a8[_0xdbc9('0x3f')]);return db['VoiceMailMessage'][_0xdbc9('0x58')](_0x1819fa)[_0xdbc9('0x26')](respondWithFilteredResult(_0x3021be,_0x1819fa));})[_0xdbc9('0x51')](handleError(_0x3021be,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4dc0341..c82e9cb 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 _0xcda2=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util'];(function(_0x245a1b,_0x4d1c82){var _0x4cfc59=function(_0x1620e3){while(--_0x1620e3){_0x245a1b['push'](_0x245a1b['shift']());}};_0x4cfc59(++_0x4d1c82);}(_0xcda2,0x139));var _0x2cda=function(_0x361704,_0x3af61c){_0x361704=_0x361704-0x0;var _0x258953=_0xcda2[_0x361704];return _0x258953;};'use strict';var _=require(_0x2cda('0x0'));var util=require(_0x2cda('0x1'));var logger=require(_0x2cda('0x2'))(_0x2cda('0x3'));var moment=require(_0x2cda('0x4'));var BPromise=require(_0x2cda('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cda('0x6'));var rimraf=require(_0x2cda('0x7'));var config=require(_0x2cda('0x8'));var attributes=require(_0x2cda('0x9'));module['exports']=function(_0xadddae,_0x4c1d5f){return _0xadddae[_0x2cda('0xa')](_0x2cda('0xb'),attributes,{'tableName':_0x2cda('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x2cda('0xd'),_0x2cda('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94ed=['VoiceMail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x445217,_0x44bc83){var _0x2459a5=function(_0x10baa1){while(--_0x10baa1){_0x445217['push'](_0x445217['shift']());}};_0x2459a5(++_0x44bc83);}(_0x94ed,0xd3));var _0xd94e=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x94ed[_0x44ceee];return _0x1a065c;};'use strict';var _=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var logger=require(_0xd94e('0x2'))(_0xd94e('0x3'));var moment=require(_0xd94e('0x4'));var BPromise=require(_0xd94e('0x5'));var rp=require(_0xd94e('0x6'));var fs=require('fs');var path=require(_0xd94e('0x7'));var rimraf=require(_0xd94e('0x8'));var config=require(_0xd94e('0x9'));var attributes=require(_0xd94e('0xa'));module[_0xd94e('0xb')]=function(_0x4cfc89,_0x38df22){return _0x4cfc89[_0xd94e('0xc')](_0xd94e('0xd'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd94e('0xe'),'fields':[_0xd94e('0xf'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c8b5ac3..1a89b47 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 _0xe113=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','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','stringify','error','code','message','result','catch','lodash'];(function(_0x5654af,_0x5a250f){var _0x493a3e=function(_0x3ab214){while(--_0x3ab214){_0x5654af['push'](_0x5654af['shift']());}};_0x493a3e(++_0x5a250f);}(_0xe113,0xb5));var _0x3e11=function(_0x38078a,_0x4b3e55){_0x38078a=_0x38078a-0x0;var _0x859911=_0xe113[_0x38078a];return _0x859911;};'use strict';var _=require(_0x3e11('0x0'));var util=require(_0x3e11('0x1'));var moment=require(_0x3e11('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e11('0x3'));var fs=require('fs');var Redis=require(_0x3e11('0x4'));var db=require(_0x3e11('0x5'))['db'];var utils=require(_0x3e11('0x6'));var logger=require(_0x3e11('0x7'))(_0x3e11('0x8'));var config=require(_0x3e11('0x9'));var jayson=require(_0x3e11('0xa'));var client=jayson[_0x3e11('0xb')][_0x3e11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41cf41,_0x4af988,_0x1d9a74){return new BPromise(function(_0x50a9c4,_0x829d1f){return client[_0x3e11('0xd')](_0x41cf41,_0x1d9a74)[_0x3e11('0xe')](function(_0x53c773){logger[_0x3e11('0xf')](_0x3e11('0x10'),_0x4af988,_0x3e11('0x11'));logger[_0x3e11('0x12')](_0x3e11('0x13'),_0x4af988,_0x3e11('0x11'),JSON[_0x3e11('0x14')](_0x53c773));if(_0x53c773[_0x3e11('0x15')]){if(_0x53c773[_0x3e11('0x15')][_0x3e11('0x16')]===0x1f4){logger[_0x3e11('0x15')](_0x3e11('0x10'),_0x4af988,_0x53c773[_0x3e11('0x15')][_0x3e11('0x17')]);return _0x829d1f(_0x53c773['error'][_0x3e11('0x17')]);}logger['error'](_0x3e11('0x10'),_0x4af988,_0x53c773[_0x3e11('0x15')]['message']);return _0x50a9c4(_0x53c773[_0x3e11('0x15')][_0x3e11('0x17')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x4af988,'request\x20sent');_0x50a9c4(_0x53c773[_0x3e11('0x18')][_0x3e11('0x17')]);}})[_0x3e11('0x19')](function(_0xe8d653){logger[_0x3e11('0x15')](_0x3e11('0x10'),_0x4af988,_0xe8d653);_0x829d1f(_0xe8d653);});});} \ No newline at end of file +var _0x3cdc=['client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a194f,_0x4964bf){var _0x43c8de=function(_0x216230){while(--_0x216230){_0x3a194f['push'](_0x3a194f['shift']());}};_0x43c8de(++_0x4964bf);}(_0x3cdc,0x147));var _0xc3cd=function(_0x5f1de4,_0x47c201){_0x5f1de4=_0x5f1de4-0x0;var _0x1aeaf0=_0x3cdc[_0x5f1de4];return _0x1aeaf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3cd('0x0'));var BPromise=require(_0xc3cd('0x1'));var rs=require(_0xc3cd('0x2'));var fs=require('fs');var Redis=require(_0xc3cd('0x3'));var db=require(_0xc3cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3cd('0x5'))(_0xc3cd('0x6'));var config=require(_0xc3cd('0x7'));var jayson=require(_0xc3cd('0x8'));var client=jayson[_0xc3cd('0x9')][_0xc3cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2443ad,_0x5ab469,_0x3fec5f){return new BPromise(function(_0x639603,_0x36093f){return client[_0xc3cd('0xb')](_0x2443ad,_0x3fec5f)[_0xc3cd('0xc')](function(_0x554614){logger[_0xc3cd('0xd')](_0xc3cd('0xe'),_0x5ab469,_0xc3cd('0xf'));logger[_0xc3cd('0x10')](_0xc3cd('0x11'),_0x5ab469,_0xc3cd('0xf'),JSON[_0xc3cd('0x12')](_0x554614));if(_0x554614[_0xc3cd('0x13')]){if(_0x554614[_0xc3cd('0x13')][_0xc3cd('0x14')]===0x1f4){logger[_0xc3cd('0x13')]('VoiceMail,\x20%s,\x20%s',_0x5ab469,_0x554614[_0xc3cd('0x13')]['message']);return _0x36093f(_0x554614[_0xc3cd('0x13')][_0xc3cd('0x15')]);}logger[_0xc3cd('0x13')](_0xc3cd('0xe'),_0x5ab469,_0x554614[_0xc3cd('0x13')]['message']);return _0x639603(_0x554614['error'][_0xc3cd('0x15')]);}else{logger['info'](_0xc3cd('0xe'),_0x5ab469,_0xc3cd('0xf'));_0x639603(_0x554614[_0xc3cd('0x16')][_0xc3cd('0x15')]);}})[_0xc3cd('0x17')](function(_0x18a0ec){logger[_0xc3cd('0x13')](_0xc3cd('0xe'),_0x5ab469,_0x18a0ec);_0x36093f(_0x18a0ec);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2a7497e..536b78c 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 _0x7eb6=['isAuthenticated','get','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./voiceMailMessage.controller'];(function(_0x14ec6b,_0x472785){var _0x255673=function(_0x175a10){while(--_0x175a10){_0x14ec6b['push'](_0x14ec6b['shift']());}};_0x255673(++_0x472785);}(_0x7eb6,0x162));var _0x67eb=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0x7eb6[_0x4b3e49];return _0x57e339;};'use strict';var multer=require(_0x67eb('0x0'));var util=require(_0x67eb('0x1'));var path=require(_0x67eb('0x2'));var timeout=require(_0x67eb('0x3'));var express=require('express');var router=express[_0x67eb('0x4')]();var fs_extra=require(_0x67eb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x67eb('0x6'));router['get']('/',auth[_0x67eb('0x7')](),controller['index']);router[_0x67eb('0x8')](_0x67eb('0x9'),auth[_0x67eb('0x7')](),controller[_0x67eb('0xa')]);router['get'](_0x67eb('0xb'),auth[_0x67eb('0x7')](),controller[_0x67eb('0xc')]);router[_0x67eb('0xd')]('/',auth[_0x67eb('0x7')](),controller[_0x67eb('0xe')]);router[_0x67eb('0xf')](_0x67eb('0x9'),auth[_0x67eb('0x7')](),controller['update']);router[_0x67eb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x67eb('0x11')]);module[_0x67eb('0x12')]=router; \ No newline at end of file +var _0xa5a7=['/:id/download','download','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2fef36,_0x2d9657){var _0x36cb38=function(_0xe2d130){while(--_0xe2d130){_0x2fef36['push'](_0x2fef36['shift']());}};_0x36cb38(++_0x2d9657);}(_0xa5a7,0x78));var _0x7a5a=function(_0x53413a,_0x2822c9){_0x53413a=_0x53413a-0x0;var _0x426533=_0xa5a7[_0x53413a];return _0x426533;};'use strict';var multer=require('multer');var util=require(_0x7a5a('0x0'));var path=require(_0x7a5a('0x1'));var timeout=require(_0x7a5a('0x2'));var express=require(_0x7a5a('0x3'));var router=express['Router']();var fs_extra=require(_0x7a5a('0x4'));var auth=require(_0x7a5a('0x5'));var interaction=require(_0x7a5a('0x6'));var config=require('../../config/environment');var controller=require(_0x7a5a('0x7'));router[_0x7a5a('0x8')]('/',auth[_0x7a5a('0x9')](),controller[_0x7a5a('0xa')]);router[_0x7a5a('0x8')](_0x7a5a('0xb'),auth['isAuthenticated'](),controller[_0x7a5a('0xc')]);router['get'](_0x7a5a('0xd'),auth[_0x7a5a('0x9')](),controller[_0x7a5a('0xe')]);router['post']('/',auth[_0x7a5a('0x9')](),controller['create']);router[_0x7a5a('0xf')]('/:id',auth[_0x7a5a('0x9')](),controller[_0x7a5a('0x10')]);router[_0x7a5a('0x11')]('/:id',auth[_0x7a5a('0x9')](),controller['destroy']);module[_0x7a5a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d378663..72828de 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 _0xd835=['sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x14c053,_0x57fb05){var _0x4f061d=function(_0x5d361d){while(--_0x5d361d){_0x14c053['push'](_0x14c053['shift']());}};_0x4f061d(++_0x57fb05);}(_0xd835,0xb4));var _0x5d83=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xd835[_0x187279];return _0x3da59d;};'use strict';var Sequelize=require(_0x5d83('0x0'));module[_0x5d83('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x32e531){return this[_0x5d83('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5d83('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5d83('0x5')](_0x5d83('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5d83('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x5d83('0x7'),'defaultValue':Sequelize[_0x5d83('0x8')](_0x5d83('0x9'))}}; \ No newline at end of file +var _0x51e1=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB'];(function(_0x48620b,_0x46d884){var _0x583ae5=function(_0xf377ac){while(--_0xf377ac){_0x48620b['push'](_0x48620b['shift']());}};_0x583ae5(++_0x46d884);}(_0x51e1,0xc2));var _0x151e=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x51e1[_0x5e238b];return _0x389bea;};'use strict';var Sequelize=require(_0x151e('0x0'));module[_0x151e('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x399a74){return this[_0x151e('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x151e('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x151e('0x5')](_0x151e('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'stamp':{'type':_0x151e('0x7'),'defaultValue':Sequelize[_0x151e('0x8')](_0x151e('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 458cfa7..11bd8b9 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 _0xd81a=['attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','length','find','catch','create','body','params','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','sendStatus','status','end','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection'];(function(_0x474e22,_0x5d5515){var _0x76a179=function(_0x4dc2ff){while(--_0x4dc2ff){_0x474e22['push'](_0x474e22['shift']());}};_0x76a179(++_0x5d5515);}(_0xd81a,0x1cd));var _0xad81=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd81a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xad81('0x0'));var rimraf=require(_0xad81('0x1'));var zipdir=require(_0xad81('0x2'));var jsonpatch=require(_0xad81('0x3'));var rp=require(_0xad81('0x4'));var moment=require(_0xad81('0x5'));var BPromise=require(_0xad81('0x6'));var Mustache=require(_0xad81('0x7'));var util=require('util');var path=require(_0xad81('0x8'));var sox=require(_0xad81('0x9'));var csv=require(_0xad81('0xa'));var ejs=require(_0xad81('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xad81('0xc'));var crypto=require('crypto');var jsforce=require(_0xad81('0xd'));var deskjs=require(_0xad81('0xe'));var toCsv=require(_0xad81('0xa'));var querystring=require(_0xad81('0xf'));var Papa=require(_0xad81('0x10'));var Redis=require(_0xad81('0x11'));var authService=require(_0xad81('0x12'));var qs=require(_0xad81('0x13'));var as=require(_0xad81('0x14'));var hardwareService=require(_0xad81('0x15'));var logger=require(_0xad81('0x16'))(_0xad81('0x17'));var utils=require(_0xad81('0x18'));var config=require(_0xad81('0x19'));var licenseUtil=require(_0xad81('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3deaa7,_0x434dbc){_0x434dbc=_0x434dbc||0xcc;return function(_0x377667){if(_0x377667){return _0x3deaa7[_0xad81('0x1b')](_0x434dbc);}return _0x3deaa7[_0xad81('0x1c')](_0x434dbc)[_0xad81('0x1d')]();};}function respondWithResult(_0x55ec83,_0x178536){_0x178536=_0x178536||0xc8;return function(_0xab66a0){if(_0xab66a0){return _0x55ec83[_0xad81('0x1c')](_0x178536)['json'](_0xab66a0);}};}function respondWithFilteredResult(_0x2651fb,_0x474e6b){return function(_0x509263){if(_0x509263){var _0x567db7=typeof _0x474e6b['offset']===_0xad81('0x1e')&&typeof _0x474e6b[_0xad81('0x1f')]==='undefined';var _0x278c21=_0x509263['count'];var _0x48a5ee=_0x567db7?0x0:_0x474e6b['offset'];var _0x71a64f=_0x567db7?_0x509263[_0xad81('0x20')]:_0x474e6b['offset']+_0x474e6b[_0xad81('0x1f')];var _0x3b9856;if(_0x71a64f>=_0x278c21){_0x71a64f=_0x278c21;_0x3b9856=0xc8;}else{_0x3b9856=0xce;}_0x2651fb[_0xad81('0x1c')](_0x3b9856);return _0x2651fb[_0xad81('0x21')](_0xad81('0x22'),_0x48a5ee+'-'+_0x71a64f+'/'+_0x278c21)['json'](_0x509263);}return null;};}function patchUpdates(_0x3f068e){return function(_0x1a2d65){try{jsonpatch[_0xad81('0x23')](_0x1a2d65,_0x3f068e,!![]);}catch(_0x54d000){return BPromise['reject'](_0x54d000);}return _0x1a2d65[_0xad81('0x24')]();};}function saveUpdates(_0x2eac2b,_0x1863d8){return function(_0x6e81f){if(_0x6e81f){return _0x6e81f[_0xad81('0x25')](_0x2eac2b)[_0xad81('0x26')](function(_0x396eb7){return _0x396eb7;});}return null;};}function removeEntity(_0x5682f6,_0x11083f){return function(_0x8df386){if(_0x8df386){return _0x8df386[_0xad81('0x27')]()[_0xad81('0x26')](function(){_0x5682f6[_0xad81('0x1c')](0xcc)[_0xad81('0x1d')]();});}};}function handleEntityNotFound(_0x22dbe4,_0x25ddf0){return function(_0x5a0d63){if(!_0x5a0d63){_0x22dbe4[_0xad81('0x1b')](0x194);}return _0x5a0d63;};}function handleError(_0x34f01b,_0x290a8d){_0x290a8d=_0x290a8d||0x1f4;return function(_0x20502e){logger[_0xad81('0x28')](_0x20502e[_0xad81('0x29')]);if(_0x20502e[_0xad81('0x2a')]){delete _0x20502e[_0xad81('0x2a')];}_0x34f01b[_0xad81('0x1c')](_0x290a8d)[_0xad81('0x2b')](_0x20502e);};}exports[_0xad81('0x2c')]=function(_0x3a9e47,_0x3449e5){var _0x364804={},_0x2e64d9={},_0x33a367={'count':0x0,'rows':[]};var _0x19e82f=_[_0xad81('0x2d')](db[_0xad81('0x2e')][_0xad81('0x2f')],function(_0x42d794){return{'name':_0x42d794[_0xad81('0x30')],'type':_0x42d794['type'][_0xad81('0x31')]};});_0x2e64d9[_0xad81('0x32')]=_[_0xad81('0x33')](_[_0xad81('0x2d')](_0x19e82f,_0xad81('0x2a')),[_0xad81('0x2a')]);_0x2e64d9[_0xad81('0x34')]=_[_0xad81('0x35')](_0x3a9e47['query']);_0x2e64d9['filters']=_[_0xad81('0x36')](_0x2e64d9[_0xad81('0x32')],_0x2e64d9[_0xad81('0x34')]);_0x364804[_0xad81('0x37')]=_[_0xad81('0x36')](_0x2e64d9[_0xad81('0x32')],qs[_0xad81('0x38')](_0x3a9e47[_0xad81('0x34')]['fields']));_0x364804[_0xad81('0x37')]=_0x364804[_0xad81('0x37')]['length']?_0x364804[_0xad81('0x37')]:_0x2e64d9[_0xad81('0x32')];if(!_0x3a9e47['query'][_0xad81('0x39')](_0xad81('0x3a'))){_0x364804[_0xad81('0x1f')]=qs['limit'](_0x3a9e47[_0xad81('0x34')][_0xad81('0x1f')]);_0x364804[_0xad81('0x3b')]=qs[_0xad81('0x3b')](_0x3a9e47['query'][_0xad81('0x3b')]);}_0x364804[_0xad81('0x3c')]=qs[_0xad81('0x3d')](_0x3a9e47['query'][_0xad81('0x3d')]);_0x364804['where']=qs[_0xad81('0x3e')](_['pick'](_0x3a9e47[_0xad81('0x34')],_0x2e64d9[_0xad81('0x3e')]),_0x19e82f);if(_0x3a9e47[_0xad81('0x34')][_0xad81('0x3f')]){_0x364804[_0xad81('0x40')]=_[_0xad81('0x41')](_0x364804[_0xad81('0x40')],{'$or':_[_0xad81('0x2d')](_0x19e82f,function(_0x4e1de0){if(_0x4e1de0[_0xad81('0x42')]!==_0xad81('0x43')){var _0x907c41={};_0x907c41[_0x4e1de0[_0xad81('0x2a')]]={'$like':'%'+_0x3a9e47[_0xad81('0x34')][_0xad81('0x3f')]+'%'};return _0x907c41;}})});}_0x364804=_['merge']({},_0x364804,_0x3a9e47['options']);var _0x45ce28={'where':_0x364804[_0xad81('0x40')]};return db[_0xad81('0x2e')][_0xad81('0x20')](_0x45ce28)[_0xad81('0x26')](function(_0x463360){_0x33a367['count']=_0x463360;if(_0x3a9e47[_0xad81('0x34')][_0xad81('0x44')]){_0x364804[_0xad81('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xad81('0x46')](_0x364804);})[_0xad81('0x26')](function(_0x13a7d6){_0x33a367['rows']=_0x13a7d6;return _0x33a367;})[_0xad81('0x26')](respondWithFilteredResult(_0x3449e5,_0x364804))['catch'](handleError(_0x3449e5,null));};exports['show']=function(_0x46e3d6,_0x16c338){var _0x56280c={'raw':!![],'where':{'id':_0x46e3d6['params']['id']}},_0x5c7c9d={};_0x5c7c9d[_0xad81('0x32')]=_[_0xad81('0x35')](db['VoiceMailMessage'][_0xad81('0x2f')]);_0x5c7c9d[_0xad81('0x34')]=_['keys'](_0x46e3d6[_0xad81('0x34')]);_0x5c7c9d['filters']=_['intersection'](_0x5c7c9d[_0xad81('0x32')],_0x5c7c9d[_0xad81('0x34')]);_0x56280c[_0xad81('0x37')]=_['intersection'](_0x5c7c9d[_0xad81('0x32')],qs[_0xad81('0x38')](_0x46e3d6['query'][_0xad81('0x38')]));_0x56280c[_0xad81('0x37')]=_0x56280c[_0xad81('0x37')][_0xad81('0x47')]?_0x56280c[_0xad81('0x37')]:_0x5c7c9d['model'];if(_0x46e3d6[_0xad81('0x34')][_0xad81('0x44')]){_0x56280c[_0xad81('0x45')]=[{'all':!![]}];}_0x56280c=_[_0xad81('0x41')]({},_0x56280c,_0x46e3d6['options']);return db[_0xad81('0x2e')][_0xad81('0x48')](_0x56280c)['then'](handleEntityNotFound(_0x16c338,null))[_0xad81('0x26')](respondWithResult(_0x16c338,null))[_0xad81('0x49')](handleError(_0x16c338,null));};exports[_0xad81('0x4a')]=function(_0x1748cc,_0x4a957f){return db[_0xad81('0x2e')][_0xad81('0x4a')](_0x1748cc[_0xad81('0x4b')],{})[_0xad81('0x26')](respondWithResult(_0x4a957f,0xc9))['catch'](handleError(_0x4a957f,null));};exports[_0xad81('0x25')]=function(_0x58f084,_0x78fb9f){if(_0x58f084['body']['id']){delete _0x58f084[_0xad81('0x4b')]['id'];}return db[_0xad81('0x2e')][_0xad81('0x48')]({'where':{'id':_0x58f084['params']['id']}})['then'](handleEntityNotFound(_0x78fb9f,null))['then'](saveUpdates(_0x58f084[_0xad81('0x4b')],null))['then'](respondWithResult(_0x78fb9f,null))[_0xad81('0x49')](handleError(_0x78fb9f,null));};exports[_0xad81('0x27')]=function(_0xc92b99,_0x20c177){return db['VoiceMailMessage'][_0xad81('0x48')]({'where':{'id':_0xc92b99[_0xad81('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20c177,null))[_0xad81('0x26')](removeEntity(_0x20c177,null))[_0xad81('0x49')](handleError(_0x20c177,null));};exports['download']=function(_0x3e7c86,_0x5c896d,_0x3cc8a3){return db[_0xad81('0x2e')]['find']({'where':{'id':_0x3e7c86[_0xad81('0x4c')]['id']},'attributes':['id',_0xad81('0x4d'),_0xad81('0x4e')]})[_0xad81('0x26')](handleEntityNotFound(_0x5c896d,null))[_0xad81('0x26')](function(_0x322584){if(_0x322584){if(!_0x322584['recording']){throw new db[(_0xad81('0x4f'))][(_0xad81('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x38de32={'Content-Type':_0xad81('0x51'),'Content-Disposition':_0xad81('0x52')};if(_0x322584['msg_id']){_0x38de32[_0xad81('0x53')]=_0xad81('0x54')+_0x322584['msg_id']+_0xad81('0x55');}_0x5c896d['set'](_0x38de32);return _0x5c896d[_0xad81('0x2b')](new Buffer(_0x322584[_0xad81('0x4d')]));}})[_0xad81('0x49')](handleError(_0x5c896d,null));}; \ No newline at end of file +var _0x49e3=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','crypto'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x49e3,0xeb));var _0x349e=function(_0x3f42aa,_0x1ce68f){_0x3f42aa=_0x3f42aa-0x0;var _0x3d505c=_0x49e3[_0x3f42aa];return _0x3d505c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x349e('0x0'));var zipdir=require(_0x349e('0x1'));var jsonpatch=require(_0x349e('0x2'));var rp=require(_0x349e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x349e('0x4'));var util=require(_0x349e('0x5'));var path=require(_0x349e('0x6'));var sox=require(_0x349e('0x7'));var csv=require(_0x349e('0x8'));var ejs=require(_0x349e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x349e('0xa'));var jsforce=require(_0x349e('0xb'));var deskjs=require(_0x349e('0xc'));var toCsv=require(_0x349e('0x8'));var querystring=require('querystring');var Papa=require(_0x349e('0xd'));var Redis=require(_0x349e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x349e('0xf'));var as=require(_0x349e('0x10'));var hardwareService=require(_0x349e('0x11'));var logger=require(_0x349e('0x12'))(_0x349e('0x13'));var utils=require('../../config/utils');var config=require(_0x349e('0x14'));var licenseUtil=require(_0x349e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x328564,_0x59c098){_0x59c098=_0x59c098||0xcc;return function(_0x4f769d){if(_0x4f769d){return _0x328564['sendStatus'](_0x59c098);}return _0x328564[_0x349e('0x16')](_0x59c098)[_0x349e('0x17')]();};}function respondWithResult(_0x13cc56,_0x1632d9){_0x1632d9=_0x1632d9||0xc8;return function(_0x5ada25){if(_0x5ada25){return _0x13cc56['status'](_0x1632d9)[_0x349e('0x18')](_0x5ada25);}};}function respondWithFilteredResult(_0x5d270c,_0x151e00){return function(_0x3d99b9){if(_0x3d99b9){var _0xcff538=typeof _0x151e00[_0x349e('0x19')]===_0x349e('0x1a')&&typeof _0x151e00['limit']===_0x349e('0x1a');var _0x47a7b0=_0x3d99b9[_0x349e('0x1b')];var _0x58bc1b=_0xcff538?0x0:_0x151e00[_0x349e('0x19')];var _0x329cf3=_0xcff538?_0x3d99b9['count']:_0x151e00[_0x349e('0x19')]+_0x151e00[_0x349e('0x1c')];var _0x26c288;if(_0x329cf3>=_0x47a7b0){_0x329cf3=_0x47a7b0;_0x26c288=0xc8;}else{_0x26c288=0xce;}_0x5d270c[_0x349e('0x16')](_0x26c288);return _0x5d270c[_0x349e('0x1d')]('Content-Range',_0x58bc1b+'-'+_0x329cf3+'/'+_0x47a7b0)['json'](_0x3d99b9);}return null;};}function patchUpdates(_0x5759dc){return function(_0x4eeba3){try{jsonpatch[_0x349e('0x1e')](_0x4eeba3,_0x5759dc,!![]);}catch(_0x277d3a){return BPromise[_0x349e('0x1f')](_0x277d3a);}return _0x4eeba3[_0x349e('0x20')]();};}function saveUpdates(_0x2d0dfa,_0x16f252){return function(_0x431c0f){if(_0x431c0f){return _0x431c0f[_0x349e('0x21')](_0x2d0dfa)[_0x349e('0x22')](function(_0x5208c3){return _0x5208c3;});}return null;};}function removeEntity(_0x46c8db,_0x406f0f){return function(_0x3afb62){if(_0x3afb62){return _0x3afb62[_0x349e('0x23')]()['then'](function(){_0x46c8db[_0x349e('0x16')](0xcc)[_0x349e('0x17')]();});}};}function handleEntityNotFound(_0xa89e18,_0x2eb534){return function(_0x5e3342){if(!_0x5e3342){_0xa89e18[_0x349e('0x24')](0x194);}return _0x5e3342;};}function handleError(_0x500ff7,_0x72cb6e){_0x72cb6e=_0x72cb6e||0x1f4;return function(_0x35747b){logger[_0x349e('0x25')](_0x35747b[_0x349e('0x26')]);if(_0x35747b[_0x349e('0x27')]){delete _0x35747b[_0x349e('0x27')];}_0x500ff7['status'](_0x72cb6e)['send'](_0x35747b);};}exports[_0x349e('0x28')]=function(_0x4ae506,_0x180309){var _0x1404eb={},_0x18c79a={},_0x56feb9={'count':0x0,'rows':[]};var _0x44188c=_[_0x349e('0x29')](db[_0x349e('0x2a')][_0x349e('0x2b')],function(_0x1a9f14){return{'name':_0x1a9f14[_0x349e('0x2c')],'type':_0x1a9f14['type'][_0x349e('0x2d')]};});_0x18c79a[_0x349e('0x2e')]=_['differenceBy'](_['map'](_0x44188c,_0x349e('0x27')),['name']);_0x18c79a[_0x349e('0x2f')]=_[_0x349e('0x30')](_0x4ae506[_0x349e('0x2f')]);_0x18c79a[_0x349e('0x31')]=_['intersection'](_0x18c79a[_0x349e('0x2e')],_0x18c79a[_0x349e('0x2f')]);_0x1404eb[_0x349e('0x32')]=_[_0x349e('0x33')](_0x18c79a['model'],qs[_0x349e('0x34')](_0x4ae506['query'][_0x349e('0x34')]));_0x1404eb[_0x349e('0x32')]=_0x1404eb['attributes']['length']?_0x1404eb[_0x349e('0x32')]:_0x18c79a[_0x349e('0x2e')];if(!_0x4ae506[_0x349e('0x2f')]['hasOwnProperty'](_0x349e('0x35'))){_0x1404eb[_0x349e('0x1c')]=qs[_0x349e('0x1c')](_0x4ae506['query'][_0x349e('0x1c')]);_0x1404eb[_0x349e('0x19')]=qs['offset'](_0x4ae506['query']['offset']);}_0x1404eb[_0x349e('0x36')]=qs[_0x349e('0x37')](_0x4ae506[_0x349e('0x2f')]['sort']);_0x1404eb[_0x349e('0x38')]=qs[_0x349e('0x31')](_[_0x349e('0x39')](_0x4ae506['query'],_0x18c79a[_0x349e('0x31')]),_0x44188c);if(_0x4ae506[_0x349e('0x2f')]['filter']){_0x1404eb[_0x349e('0x38')]=_[_0x349e('0x3a')](_0x1404eb[_0x349e('0x38')],{'$or':_[_0x349e('0x29')](_0x44188c,function(_0x2366c4){if(_0x2366c4[_0x349e('0x3b')]!==_0x349e('0x3c')){var _0xcb23e={};_0xcb23e[_0x2366c4[_0x349e('0x27')]]={'$like':'%'+_0x4ae506[_0x349e('0x2f')][_0x349e('0x3d')]+'%'};return _0xcb23e;}})});}_0x1404eb=_[_0x349e('0x3a')]({},_0x1404eb,_0x4ae506[_0x349e('0x3e')]);var _0x130c11={'where':_0x1404eb[_0x349e('0x38')]};return db[_0x349e('0x2a')][_0x349e('0x1b')](_0x130c11)[_0x349e('0x22')](function(_0x475d62){_0x56feb9[_0x349e('0x1b')]=_0x475d62;if(_0x4ae506[_0x349e('0x2f')]['includeAll']){_0x1404eb[_0x349e('0x3f')]=[{'all':!![]}];}return db[_0x349e('0x2a')][_0x349e('0x40')](_0x1404eb);})['then'](function(_0x51bcba){_0x56feb9['rows']=_0x51bcba;return _0x56feb9;})[_0x349e('0x22')](respondWithFilteredResult(_0x180309,_0x1404eb))[_0x349e('0x41')](handleError(_0x180309,null));};exports[_0x349e('0x42')]=function(_0x3bf416,_0x27184e){var _0x5b0a35={'raw':!![],'where':{'id':_0x3bf416[_0x349e('0x43')]['id']}},_0x41c01b={};_0x41c01b[_0x349e('0x2e')]=_[_0x349e('0x30')](db[_0x349e('0x2a')][_0x349e('0x2b')]);_0x41c01b[_0x349e('0x2f')]=_[_0x349e('0x30')](_0x3bf416[_0x349e('0x2f')]);_0x41c01b[_0x349e('0x31')]=_[_0x349e('0x33')](_0x41c01b['model'],_0x41c01b[_0x349e('0x2f')]);_0x5b0a35[_0x349e('0x32')]=_['intersection'](_0x41c01b[_0x349e('0x2e')],qs[_0x349e('0x34')](_0x3bf416['query'][_0x349e('0x34')]));_0x5b0a35[_0x349e('0x32')]=_0x5b0a35[_0x349e('0x32')]['length']?_0x5b0a35[_0x349e('0x32')]:_0x41c01b[_0x349e('0x2e')];if(_0x3bf416['query'][_0x349e('0x44')]){_0x5b0a35[_0x349e('0x3f')]=[{'all':!![]}];}_0x5b0a35=_[_0x349e('0x3a')]({},_0x5b0a35,_0x3bf416['options']);return db[_0x349e('0x2a')][_0x349e('0x45')](_0x5b0a35)[_0x349e('0x22')](handleEntityNotFound(_0x27184e,null))[_0x349e('0x22')](respondWithResult(_0x27184e,null))[_0x349e('0x41')](handleError(_0x27184e,null));};exports[_0x349e('0x46')]=function(_0x72a1ec,_0x5917bb){return db['VoiceMailMessage'][_0x349e('0x46')](_0x72a1ec[_0x349e('0x47')],{})['then'](respondWithResult(_0x5917bb,0xc9))[_0x349e('0x41')](handleError(_0x5917bb,null));};exports[_0x349e('0x21')]=function(_0x457d0d,_0x2e738a){if(_0x457d0d[_0x349e('0x47')]['id']){delete _0x457d0d[_0x349e('0x47')]['id'];}return db[_0x349e('0x2a')]['find']({'where':{'id':_0x457d0d[_0x349e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e738a,null))['then'](saveUpdates(_0x457d0d[_0x349e('0x47')],null))['then'](respondWithResult(_0x2e738a,null))[_0x349e('0x41')](handleError(_0x2e738a,null));};exports['destroy']=function(_0x197b8d,_0x60c4da){return db['VoiceMailMessage'][_0x349e('0x45')]({'where':{'id':_0x197b8d['params']['id']}})[_0x349e('0x22')](handleEntityNotFound(_0x60c4da,null))[_0x349e('0x22')](removeEntity(_0x60c4da,null))[_0x349e('0x41')](handleError(_0x60c4da,null));};exports['download']=function(_0x5880fa,_0x1847c5,_0x540f81){return db['VoiceMailMessage'][_0x349e('0x45')]({'where':{'id':_0x5880fa['params']['id']},'attributes':['id',_0x349e('0x48'),_0x349e('0x49')]})['then'](handleEntityNotFound(_0x1847c5,null))[_0x349e('0x22')](function(_0x7d7cd7){if(_0x7d7cd7){if(!_0x7d7cd7[_0x349e('0x48')]){throw new db[(_0x349e('0x4a'))][(_0x349e('0x4b'))](_0x349e('0x4c'));}var _0x21057f={'Content-Type':_0x349e('0x4d'),'Content-Disposition':_0x349e('0x4e')};if(_0x7d7cd7[_0x349e('0x49')]){_0x21057f['Content-Disposition']=_0x349e('0x4f')+_0x7d7cd7['msg_id']+_0x349e('0x50');}_0x1847c5[_0x349e('0x1d')](_0x21057f);return _0x1847c5[_0x349e('0x51')](new Buffer(_0x7d7cd7[_0x349e('0x48')]));}})[_0x349e('0x41')](handleError(_0x1847c5,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index aab79ac..b57cb2b 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 _0xb18b=['dir','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceMailMessage','voice_voicemail_messages'];(function(_0x3db9d9,_0x9b5946){var _0x21f54c=function(_0x41ee4d){while(--_0x41ee4d){_0x3db9d9['push'](_0x3db9d9['shift']());}};_0x21f54c(++_0x9b5946);}(_0xb18b,0xe7));var _0xbb18=function(_0xf23b24,_0x55c8f4){_0xf23b24=_0xf23b24-0x0;var _0x12ed3b=_0xb18b[_0xf23b24];return _0x12ed3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbb18('0x0'));var moment=require(_0xbb18('0x1'));var BPromise=require(_0xbb18('0x2'));var rp=require(_0xbb18('0x3'));var fs=require('fs');var path=require(_0xbb18('0x4'));var rimraf=require(_0xbb18('0x5'));var config=require(_0xbb18('0x6'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x5ed2b3,_0x2d218b){return _0x5ed2b3['define'](_0xbb18('0x7'),attributes,{'tableName':_0xbb18('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xbb18('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd36b=['request-promise','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xd36b,0x101));var _0xbd36=function(_0x2f0f8b,_0x5bd15c){_0x2f0f8b=_0x2f0f8b-0x0;var _0x484bd0=_0xd36b[_0x2f0f8b];return _0x484bd0;};'use strict';var _=require('lodash');var util=require(_0xbd36('0x0'));var logger=require(_0xbd36('0x1'))(_0xbd36('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd36('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd36('0x4'));var config=require('../../config/environment');var attributes=require(_0xbd36('0x5'));module[_0xbd36('0x6')]=function(_0x42f60e,_0x125f71){return _0x42f60e[_0xbd36('0x7')](_0xbd36('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xbd36('0x9'),'fields':[_0xbd36('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 9ea200f..4ec07bc 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 _0xea5d=['http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2c3cb2,_0xbb9792){var _0x58b09d=function(_0x50b33b){while(--_0x50b33b){_0x2c3cb2['push'](_0x2c3cb2['shift']());}};_0x58b09d(++_0xbb9792);}(_0xea5d,0x1da));var _0xdea5=function(_0x271530,_0x219a63){_0x271530=_0x271530-0x0;var _0x1e881e=_0xea5d[_0x271530];return _0x1e881e;};'use strict';var _=require('lodash');var util=require(_0xdea5('0x0'));var moment=require(_0xdea5('0x1'));var BPromise=require(_0xdea5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdea5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdea5('0x4'));var logger=require(_0xdea5('0x5'))(_0xdea5('0x6'));var config=require(_0xdea5('0x7'));var jayson=require(_0xdea5('0x8'));var client=jayson['client'][_0xdea5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57eae8,_0x345cbf,_0xe651e){return new BPromise(function(_0x26a1fc,_0x36e9e3){return client[_0xdea5('0xa')](_0x57eae8,_0xe651e)[_0xdea5('0xb')](function(_0x81196e){logger['info'](_0xdea5('0xc'),_0x345cbf,_0xdea5('0xd'));logger['debug'](_0xdea5('0xe'),_0x345cbf,_0xdea5('0xd'),JSON['stringify'](_0x81196e));if(_0x81196e[_0xdea5('0xf')]){if(_0x81196e[_0xdea5('0xf')][_0xdea5('0x10')]===0x1f4){logger[_0xdea5('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x345cbf,_0x81196e[_0xdea5('0xf')][_0xdea5('0x11')]);return _0x36e9e3(_0x81196e[_0xdea5('0xf')][_0xdea5('0x11')]);}logger[_0xdea5('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x345cbf,_0x81196e['error']['message']);return _0x26a1fc(_0x81196e[_0xdea5('0xf')][_0xdea5('0x11')]);}else{logger[_0xdea5('0x12')](_0xdea5('0xc'),_0x345cbf,_0xdea5('0xd'));_0x26a1fc(_0x81196e[_0xdea5('0x13')][_0xdea5('0x11')]);}})[_0xdea5('0x14')](function(_0x21f0fc){logger[_0xdea5('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x345cbf,_0x21f0fc);_0x36e9e3(_0x21f0fc);});});} \ No newline at end of file +var _0xced7=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xced7,0x94));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ced('0x0'));var util=require(_0x7ced('0x1'));var moment=require(_0x7ced('0x2'));var BPromise=require(_0x7ced('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ced('0x4'));var db=require(_0x7ced('0x5'))['db'];var utils=require(_0x7ced('0x6'));var logger=require(_0x7ced('0x7'))(_0x7ced('0x8'));var config=require(_0x7ced('0x9'));var jayson=require(_0x7ced('0xa'));var client=jayson[_0x7ced('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc3fe4,_0x44ef92,_0x51afee){return new BPromise(function(_0x5b8b17,_0x1623b3){return client['request'](_0xc3fe4,_0x51afee)[_0x7ced('0xc')](function(_0x19ed89){logger[_0x7ced('0xd')](_0x7ced('0xe'),_0x44ef92,'request\x20sent');logger[_0x7ced('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x44ef92,'request\x20sent',JSON[_0x7ced('0x10')](_0x19ed89));if(_0x19ed89[_0x7ced('0x11')]){if(_0x19ed89[_0x7ced('0x11')][_0x7ced('0x12')]===0x1f4){logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x19ed89[_0x7ced('0x11')][_0x7ced('0x13')]);return _0x1623b3(_0x19ed89[_0x7ced('0x11')][_0x7ced('0x13')]);}logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x19ed89[_0x7ced('0x11')]['message']);return _0x5b8b17(_0x19ed89[_0x7ced('0x11')]['message']);}else{logger[_0x7ced('0xd')](_0x7ced('0xe'),_0x44ef92,'request\x20sent');_0x5b8b17(_0x19ed89[_0x7ced('0x14')][_0x7ced('0x13')]);}})['catch'](function(_0x27916d){logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x27916d);_0x1623b3(_0x27916d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0091730..cc34cbc 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 _0x93da=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id/sounds','getSounds','post','put','delete','destroy','removeSound','exports','multer','util','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x93da,0x115));var _0xa93d=function(_0x2dc09e,_0x5b0466){_0x2dc09e=_0x2dc09e-0x0;var _0x541327=_0x93da[_0x2dc09e];return _0x541327;};'use strict';var multer=require(_0xa93d('0x0'));var util=require(_0xa93d('0x1'));var path=require(_0xa93d('0x2'));var timeout=require(_0xa93d('0x3'));var express=require(_0xa93d('0x4'));var router=express[_0xa93d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa93d('0x6'));var config=require(_0xa93d('0x7'));var controller=require(_0xa93d('0x8'));router[_0xa93d('0x9')]('/',auth[_0xa93d('0xa')](),controller[_0xa93d('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xa93d('0xc'),auth[_0xa93d('0xa')](),controller[_0xa93d('0xd')]);router[_0xa93d('0xe')]('/',auth[_0xa93d('0xa')](),controller['create']);router[_0xa93d('0xe')](_0xa93d('0xc'),auth[_0xa93d('0xa')](),controller['addSound']);router[_0xa93d('0xf')]('/:id',auth[_0xa93d('0xa')](),controller['update']);router[_0xa93d('0x10')]('/:id',auth[_0xa93d('0xa')](),controller[_0xa93d('0x11')]);router[_0xa93d('0x10')]('/:id/sounds/:id2',auth[_0xa93d('0xa')](),controller[_0xa93d('0x12')]);module[_0xa93d('0x13')]=router; \ No newline at end of file +var _0xf0b0=['show','/:id/sounds','getSounds','create','post','update','destroy','removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id'];(function(_0xf64e53,_0x4db24b){var _0x1e185e=function(_0x451dc3){while(--_0x451dc3){_0xf64e53['push'](_0xf64e53['shift']());}};_0x1e185e(++_0x4db24b);}(_0xf0b0,0x1ad));var _0x0f0b=function(_0x3909fc,_0x29e558){_0x3909fc=_0x3909fc-0x0;var _0x1872bf=_0xf0b0[_0x3909fc];return _0x1872bf;};'use strict';var multer=require(_0x0f0b('0x0'));var util=require(_0x0f0b('0x1'));var path=require(_0x0f0b('0x2'));var timeout=require(_0x0f0b('0x3'));var express=require(_0x0f0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0f0b('0x5'));var interaction=require(_0x0f0b('0x6'));var config=require(_0x0f0b('0x7'));var controller=require(_0x0f0b('0x8'));router[_0x0f0b('0x9')]('/',auth[_0x0f0b('0xa')](),controller['index']);router[_0x0f0b('0x9')](_0x0f0b('0xb'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xc')]);router[_0x0f0b('0x9')](_0x0f0b('0xd'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xe')]);router['post']('/',auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xf')]);router[_0x0f0b('0x10')](_0x0f0b('0xd'),auth[_0x0f0b('0xa')](),controller['addSound']);router['put'](_0x0f0b('0xb'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0x11')]);router['delete'](_0x0f0b('0xb'),auth['isAuthenticated'](),controller[_0x0f0b('0x12')]);router['delete']('/:id/sounds/:id2',auth[_0x0f0b('0xa')](),controller[_0x0f0b('0x13')]);module[_0x0f0b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8cab563..1579905 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 _0x3e3f=['quietmp3','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','name','custom','files','mp3nb','quietmp3nb'];(function(_0x5e5e02,_0x331b36){var _0x43770e=function(_0xaade53){while(--_0xaade53){_0x5e5e02['push'](_0x5e5e02['shift']());}};_0x43770e(++_0x331b36);}(_0x3e3f,0x164));var _0xf3e3=function(_0x38894a,_0x24e4a3){_0x38894a=_0x38894a-0x0;var _0xbea54=_0x3e3f[_0x38894a];return _0xbea54;};'use strict';var Sequelize=require(_0xf3e3('0x0'));module[_0xf3e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3e3('0x2')},'mode':{'type':Sequelize['ENUM'](_0xf3e3('0x3'),_0xf3e3('0x4'),_0xf3e3('0x5'),_0xf3e3('0x6'),_0xf3e3('0x7'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xf3e3('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0xf3e3('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf3e3('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf3e3('0x8')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xf3e3('0x8')],'allowNull':!![]},'stamp':{'type':_0xf3e3('0x9')},'defaultEntry':{'type':Sequelize[_0xf3e3('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x81c1=['files','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom'];(function(_0x53b2cd,_0x18747e){var _0x100d52=function(_0x4ffedc){while(--_0x4ffedc){_0x53b2cd['push'](_0x53b2cd['shift']());}};_0x100d52(++_0x18747e);}(_0x81c1,0x118));var _0x181c=function(_0x167651,_0x4e8533){_0x167651=_0x167651-0x0;var _0x152840=_0x81c1[_0x167651];return _0x152840;};'use strict';var Sequelize=require(_0x181c('0x0'));module[_0x181c('0x1')]={'name':{'type':Sequelize[_0x181c('0x2')],'allowNull':![],'unique':_0x181c('0x3')},'mode':{'type':Sequelize[_0x181c('0x4')](_0x181c('0x5'),_0x181c('0x6'),'mp3nb',_0x181c('0x7'),'quietmp3',_0x181c('0x8')),'allowNull':!![],'defaultValue':_0x181c('0x6')},'directory':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![],'defaultValue':_0x181c('0x9')},'format':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'stamp':{'type':_0x181c('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 ff1e0b2..1454e56 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 _0xc973=['Sequelize','removeSound','id2','%s.%s','getSounds','length','pick','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','rows','show','find','catch','update','body','params','create','sequelize','transaction','mode','directory','root','server/files/moh','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','join','rmdirSync','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','basename','extname','save_name','format'];(function(_0x4420bf,_0x419ad3){var _0x381a75=function(_0x2e1d73){while(--_0x2e1d73){_0x4420bf['push'](_0x4420bf['shift']());}};_0x381a75(++_0x419ad3);}(_0xc973,0x15a));var _0x3c97=function(_0x26b2e3,_0x26118d){_0x26b2e3=_0x26b2e3-0x0;var _0x243da7=_0xc973[_0x26b2e3];return _0x243da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c97('0x0'));var zipdir=require(_0x3c97('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c97('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3c97('0x3'));var util=require(_0x3c97('0x4'));var path=require('path');var sox=require(_0x3c97('0x5'));var csv=require('to-csv');var ejs=require(_0x3c97('0x6'));var fs=require('fs');var fs_extra=require(_0x3c97('0x7'));var _=require(_0x3c97('0x8'));var squel=require(_0x3c97('0x9'));var crypto=require(_0x3c97('0xa'));var jsforce=require(_0x3c97('0xb'));var deskjs=require(_0x3c97('0xc'));var toCsv=require(_0x3c97('0xd'));var querystring=require(_0x3c97('0xe'));var Papa=require('papaparse');var Redis=require(_0x3c97('0xf'));var authService=require(_0x3c97('0x10'));var qs=require(_0x3c97('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c97('0x12'));var logger=require(_0x3c97('0x13'))(_0x3c97('0x14'));var utils=require(_0x3c97('0x15'));var config=require(_0x3c97('0x16'));var licenseUtil=require(_0x3c97('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x526f82,_0x10604f){_0x10604f=_0x10604f||0xcc;return function(_0x1476c0){if(_0x1476c0){return _0x526f82[_0x3c97('0x18')](_0x10604f);}return _0x526f82[_0x3c97('0x19')](_0x10604f)[_0x3c97('0x1a')]();};}function respondWithResult(_0x3ddb8b,_0x1fd854){_0x1fd854=_0x1fd854||0xc8;return function(_0x17e03f){if(_0x17e03f){return _0x3ddb8b[_0x3c97('0x19')](_0x1fd854)['json'](_0x17e03f);}};}function respondWithFilteredResult(_0x29a419,_0x3a4355){return function(_0x506028){if(_0x506028){var _0x5d7657=typeof _0x3a4355[_0x3c97('0x1b')]===_0x3c97('0x1c')&&typeof _0x3a4355['limit']===_0x3c97('0x1c');var _0x5bf459=_0x506028[_0x3c97('0x1d')];var _0x562de8=_0x5d7657?0x0:_0x3a4355[_0x3c97('0x1b')];var _0x4f939a=_0x5d7657?_0x506028[_0x3c97('0x1d')]:_0x3a4355[_0x3c97('0x1b')]+_0x3a4355[_0x3c97('0x1e')];var _0xb9fb90;if(_0x4f939a>=_0x5bf459){_0x4f939a=_0x5bf459;_0xb9fb90=0xc8;}else{_0xb9fb90=0xce;}_0x29a419['status'](_0xb9fb90);return _0x29a419[_0x3c97('0x1f')](_0x3c97('0x20'),_0x562de8+'-'+_0x4f939a+'/'+_0x5bf459)[_0x3c97('0x21')](_0x506028);}return null;};}function patchUpdates(_0x1c7938){return function(_0x41e438){try{jsonpatch[_0x3c97('0x22')](_0x41e438,_0x1c7938,!![]);}catch(_0x15ecf9){return BPromise['reject'](_0x15ecf9);}return _0x41e438['save']();};}function saveUpdates(_0x42a2e5,_0x542eeb){return function(_0x332b2c){if(_0x332b2c){return _0x332b2c['update'](_0x42a2e5)[_0x3c97('0x23')](function(_0x4fef04){return _0x4fef04;});}return null;};}function removeEntity(_0x5aff4d,_0x254b24){return function(_0x3ea297){if(_0x3ea297){return _0x3ea297[_0x3c97('0x24')]()['then'](function(){var _0x2ba9f4=_0x3ea297[_0x3c97('0x25')]({'plain':!![]});var _0x271c52=_0x3c97('0x26');return db[_0x3c97('0x27')][_0x3c97('0x24')]({'where':{'type':_0x271c52,'resourceId':_0x2ba9f4['id']}})['then'](function(){return _0x3ea297;});})[_0x3c97('0x23')](function(){_0x5aff4d[_0x3c97('0x19')](0xcc)[_0x3c97('0x1a')]();});}};}function handleEntityNotFound(_0x52ccda,_0x180ec5){return function(_0x43a95d){if(!_0x43a95d){_0x52ccda[_0x3c97('0x18')](0x194);}return _0x43a95d;};}function handleError(_0x57ebac,_0x4c38d1){_0x4c38d1=_0x4c38d1||0x1f4;return function(_0xb12e31){logger[_0x3c97('0x28')](_0xb12e31['stack']);if(_0xb12e31[_0x3c97('0x29')]){delete _0xb12e31[_0x3c97('0x29')];}_0x57ebac[_0x3c97('0x19')](_0x4c38d1)[_0x3c97('0x2a')](_0xb12e31);};}exports[_0x3c97('0x2b')]=function(_0x29848b,_0x11b2fb){var _0x522ff7={},_0x80cd10={},_0x1dc890={'count':0x0,'rows':[]};var _0x4e225d=_[_0x3c97('0x2c')](db['VoiceMusicOnHold'][_0x3c97('0x2d')],function(_0x322075){return{'name':_0x322075['fieldName'],'type':_0x322075[_0x3c97('0x2e')][_0x3c97('0x2f')]};});_0x80cd10[_0x3c97('0x30')]=_[_0x3c97('0x2c')](_0x4e225d,'name');_0x80cd10[_0x3c97('0x31')]=_[_0x3c97('0x32')](_0x29848b['query']);_0x80cd10[_0x3c97('0x33')]=_[_0x3c97('0x34')](_0x80cd10[_0x3c97('0x30')],_0x80cd10[_0x3c97('0x31')]);_0x522ff7[_0x3c97('0x35')]=_['intersection'](_0x80cd10[_0x3c97('0x30')],qs[_0x3c97('0x36')](_0x29848b[_0x3c97('0x31')][_0x3c97('0x36')]));_0x522ff7[_0x3c97('0x35')]=_0x522ff7[_0x3c97('0x35')]['length']?_0x522ff7[_0x3c97('0x35')]:_0x80cd10[_0x3c97('0x30')];if(!_0x29848b[_0x3c97('0x31')][_0x3c97('0x37')](_0x3c97('0x38'))){_0x522ff7[_0x3c97('0x1e')]=qs[_0x3c97('0x1e')](_0x29848b['query'][_0x3c97('0x1e')]);_0x522ff7['offset']=qs[_0x3c97('0x1b')](_0x29848b[_0x3c97('0x31')]['offset']);}_0x522ff7[_0x3c97('0x39')]=qs['sort'](_0x29848b[_0x3c97('0x31')][_0x3c97('0x3a')]);delete _0x29848b['query'][_0x3c97('0x3a')];_0x522ff7[_0x3c97('0x3b')]=qs['filters'](_['pick'](_0x29848b[_0x3c97('0x31')],_0x80cd10[_0x3c97('0x33')]),_0x4e225d);if(_0x29848b['query'][_0x3c97('0x3c')]){_0x522ff7[_0x3c97('0x3b')]=_[_0x3c97('0x3d')](_0x522ff7[_0x3c97('0x3b')],{'$or':_[_0x3c97('0x2c')](_0x4e225d,function(_0x36e924){if(_0x36e924[_0x3c97('0x2e')]!==_0x3c97('0x3e')){var _0x4043fa={};_0x4043fa[_0x36e924[_0x3c97('0x29')]]={'$like':'%'+_0x29848b[_0x3c97('0x31')][_0x3c97('0x3c')]+'%'};return _0x4043fa;}})});}_0x522ff7=_[_0x3c97('0x3d')]({},_0x522ff7,_0x29848b[_0x3c97('0x3f')]);var _0x326526={'where':_0x522ff7[_0x3c97('0x3b')]};return db['VoiceMusicOnHold'][_0x3c97('0x1d')](_0x326526)[_0x3c97('0x23')](function(_0x3db94e){_0x1dc890[_0x3c97('0x1d')]=_0x3db94e;if(_0x29848b[_0x3c97('0x31')][_0x3c97('0x40')]){_0x522ff7[_0x3c97('0x41')]=[{'all':!![]}];}return db[_0x3c97('0x42')][_0x3c97('0x43')](_0x522ff7);})[_0x3c97('0x23')](function(_0x86cd1){_0x1dc890[_0x3c97('0x44')]=_0x86cd1;return _0x1dc890;})[_0x3c97('0x23')](respondWithFilteredResult(_0x11b2fb,_0x522ff7))['catch'](handleError(_0x11b2fb,null));};exports[_0x3c97('0x45')]=function(_0x356b38,_0x558804){var _0x208d03={'raw':![],'where':{'id':_0x356b38['params']['id']}},_0x1ed78a={};_0x1ed78a[_0x3c97('0x30')]=_['keys'](db[_0x3c97('0x42')][_0x3c97('0x2d')]);_0x1ed78a[_0x3c97('0x31')]=_['keys'](_0x356b38[_0x3c97('0x31')]);_0x1ed78a[_0x3c97('0x33')]=_['intersection'](_0x1ed78a[_0x3c97('0x30')],_0x1ed78a['query']);_0x208d03[_0x3c97('0x35')]=_[_0x3c97('0x34')](_0x1ed78a[_0x3c97('0x30')],qs[_0x3c97('0x36')](_0x356b38[_0x3c97('0x31')][_0x3c97('0x36')]));_0x208d03[_0x3c97('0x35')]=_0x208d03[_0x3c97('0x35')]['length']?_0x208d03[_0x3c97('0x35')]:_0x1ed78a[_0x3c97('0x30')];if(_0x356b38['query'][_0x3c97('0x40')]){_0x208d03['include']=[{'all':!![]}];}_0x208d03=_[_0x3c97('0x3d')]({},_0x208d03,_0x356b38[_0x3c97('0x3f')]);return db[_0x3c97('0x42')][_0x3c97('0x46')](_0x208d03)[_0x3c97('0x23')](handleEntityNotFound(_0x558804,null))['then'](respondWithResult(_0x558804,null))[_0x3c97('0x47')](handleError(_0x558804,null));};exports[_0x3c97('0x48')]=function(_0x41ef0a,_0x242cbb){if(_0x41ef0a[_0x3c97('0x49')]['id']){delete _0x41ef0a['body']['id'];}return db[_0x3c97('0x42')][_0x3c97('0x46')]({'where':{'id':_0x41ef0a[_0x3c97('0x4a')]['id']}})[_0x3c97('0x23')](handleEntityNotFound(_0x242cbb,null))[_0x3c97('0x23')](saveUpdates(_0x41ef0a[_0x3c97('0x49')],null))[_0x3c97('0x23')](respondWithResult(_0x242cbb,null))[_0x3c97('0x47')](handleError(_0x242cbb,null));};exports[_0x3c97('0x4b')]=function(_0x4a8bf9,_0xe86d73,_0x59e694){return db[_0x3c97('0x4c')][_0x3c97('0x4d')](function(_0x590501){if(_0x4a8bf9['body'][_0x3c97('0x4e')]==='files'){_0x4a8bf9[_0x3c97('0x49')][_0x3c97('0x4f')]=path['join'](config[_0x3c97('0x50')],_0x3c97('0x51'),_0x4a8bf9[_0x3c97('0x49')][_0x3c97('0x29')]);}return db['VoiceMusicOnHold']['create'](_0x4a8bf9[_0x3c97('0x49')],{'transaction':_0x590501})[_0x3c97('0x23')](function(_0x513874){if(_0x4a8bf9['body'][_0x3c97('0x4e')]===_0x3c97('0x52')){fs[_0x3c97('0x53')](_0x513874[_0x3c97('0x4f')],parseInt(_0x3c97('0x54'),0x8));}var _0x39bf38=_0x4a8bf9['user'][_0x3c97('0x25')]({'plain':!![]});if(!_0x39bf38)throw new Error(_0x3c97('0x55'));if(_0x39bf38['role']===_0x3c97('0x56')){var _0x3f67a0=_0x513874['get']({'plain':!![]});return db[_0x3c97('0x57')][_0x3c97('0x46')]({'where':{'name':'MusicOnHolds','userProfileId':_0x39bf38[_0x3c97('0x58')]},'raw':!![]})[_0x3c97('0x23')](function(_0x291383){if(_0x291383&&_0x291383[_0x3c97('0x59')]===0x0){return db[_0x3c97('0x27')][_0x3c97('0x4b')]({'name':_0x3f67a0[_0x3c97('0x29')],'resourceId':_0x3f67a0['id'],'type':_0x291383['name'],'sectionId':_0x291383['id']},{})['then'](function(){return _0x513874;});}else{return _0x513874;}})['catch'](function(_0x339085){logger['error'](_0x3c97('0x5a'),_0x339085);});}return _0x513874;});})['then'](respondWithResult(_0xe86d73,0xc9))[_0x3c97('0x47')](handleError(_0xe86d73,null));};exports[_0x3c97('0x24')]=function(_0x297c72,_0x41dea5,_0x5c23c9){var _0x2140f6;return db[_0x3c97('0x42')]['find']({'where':{'id':_0x297c72[_0x3c97('0x4a')]['id']}})[_0x3c97('0x23')](function(_0x3a4641){if(_0x3a4641){return db[_0x3c97('0x4c')][_0x3c97('0x4d')](function(_0xf2d178){return _0x3a4641[_0x3c97('0x24')]({'transaction':_0xf2d178,'raw':!![]})[_0x3c97('0x23')](function(_0x5eddb){if(_0x5eddb[_0x3c97('0x4f')]){fs['readdirSync'](_0x5eddb[_0x3c97('0x4f')])[_0x3c97('0x5b')](function(_0x671443){fs['unlinkSync'](path[_0x3c97('0x5c')](_0x5eddb[_0x3c97('0x4f')],_0x671443));});fs[_0x3c97('0x5d')](_0x5eddb[_0x3c97('0x4f')]);}return _0x5eddb;});})['catch'](function(_0xfc80f7){throw new db['Sequelize'][(_0x3c97('0x5e'))](_0xfc80f7[_0x3c97('0x5f')]);});}})[_0x3c97('0x23')](handleEntityNotFound(_0x41dea5,null))[_0x3c97('0x23')](removeEntity(_0x41dea5,null))[_0x3c97('0x47')](handleError(_0x41dea5,null));};exports[_0x3c97('0x60')]=function(_0xd3f3f6,_0x509436,_0x1098fb){return db['sequelize'][_0x3c97('0x4d')](function(_0x36e419){var _0x55f68b;return db[_0x3c97('0x42')][_0x3c97('0x46')]({'where':{'id':_0xd3f3f6[_0x3c97('0x4a')]['id']}})[_0x3c97('0x23')](function(_0x1e5c69){if(_0x1e5c69){_0x55f68b=_0x1e5c69;return _0x1e5c69[_0x3c97('0x60')](_0xd3f3f6['body']['id'],{'transaction':_0x36e419});}})[_0x3c97('0x23')](function(_0x7c5012){if(_0x7c5012){return db[_0x3c97('0x61')][_0x3c97('0x62')]({'where':{'id':_0xd3f3f6['body']['id']},'attributes':['id',_0x3c97('0x29'),'save_name',_0x3c97('0x63'),_0x3c97('0x64')],'raw':!![]});}})[_0x3c97('0x23')](function(_0x22d027){if(_0x22d027){var _0x4ef30b=path['join'](config[_0x3c97('0x50')],_0x3c97('0x65'),util['format']('%s.%s',path[_0x3c97('0x66')](_0x22d027['save_name'],path[_0x3c97('0x67')](_0x22d027[_0x3c97('0x68')])),_0x22d027[_0x3c97('0x63')]));var _0x27df9e=path[_0x3c97('0x5c')](config[_0x3c97('0x50')],_0x3c97('0x51'),_0x55f68b['name'],util[_0x3c97('0x69')]('%s.%s',_0x22d027[_0x3c97('0x29')],_0x22d027[_0x3c97('0x63')]));fs['symlinkSync'](_0x4ef30b,_0x27df9e);return _0x22d027;}})[_0x3c97('0x47')](function(_0x4e130c){throw new db[(_0x3c97('0x6a'))][(_0x3c97('0x5e'))](_0x4e130c[_0x3c97('0x5f')]);});})[_0x3c97('0x23')](handleEntityNotFound(_0x509436,null))[_0x3c97('0x23')](respondWithResult(_0x509436,0xc9))[_0x3c97('0x47')](handleError(_0x509436,null));};exports[_0x3c97('0x6b')]=function(_0x1a40b0,_0x23667b,_0x1ff40d){return db[_0x3c97('0x4c')][_0x3c97('0x4d')](function(_0x40470b){var _0x33477f;return db[_0x3c97('0x42')][_0x3c97('0x62')]({'where':{'id':_0x1a40b0[_0x3c97('0x4a')]['id']}})[_0x3c97('0x23')](handleEntityNotFound(_0x23667b,null))[_0x3c97('0x23')](function(_0x2f8845){if(_0x2f8845){_0x33477f=_0x2f8845;return _0x2f8845['removeSound'](_0x1a40b0['params'][_0x3c97('0x6c')]);}})[_0x3c97('0x23')](function(_0x1da4eb){if(_0x1da4eb){return db[_0x3c97('0x61')][_0x3c97('0x62')]({'where':{'id':_0x1a40b0[_0x3c97('0x4a')]['id2']},'attributes':['id',_0x3c97('0x29'),_0x3c97('0x68'),_0x3c97('0x63'),_0x3c97('0x64')],'raw':!![]});}})['then'](function(_0x10bd82){if(_0x10bd82){fs['unlinkSync'](path[_0x3c97('0x5c')](_0x33477f[_0x3c97('0x4f')],util[_0x3c97('0x69')](_0x3c97('0x6d'),_0x10bd82[_0x3c97('0x29')],_0x10bd82['converted_format'])));return _0x10bd82;}})[_0x3c97('0x47')](function(_0xfd6bca){throw new db[(_0x3c97('0x6a'))][(_0x3c97('0x5e'))](_0xfd6bca[_0x3c97('0x5f')]);});})[_0x3c97('0x23')](handleEntityNotFound(_0x23667b,null))[_0x3c97('0x23')](respondWithStatusCode(_0x23667b,0xcc))['catch'](handleError(_0x23667b,null));};exports[_0x3c97('0x6e')]=function(_0x2ba571,_0x2310f0,_0x10d9f3){var _0x122223={};var _0x4d52b8={};var _0x4cf330;var _0x229a2e;return db['VoiceMusicOnHold'][_0x3c97('0x62')]({'where':{'id':_0x2ba571[_0x3c97('0x4a')]['id']}})[_0x3c97('0x23')](handleEntityNotFound(_0x2310f0,null))[_0x3c97('0x23')](function(_0x360bae){if(_0x360bae){_0x4cf330=_0x360bae;_0x4d52b8[_0x3c97('0x30')]=_[_0x3c97('0x32')](db['Sound']['rawAttributes']);_0x4d52b8[_0x3c97('0x31')]=_['keys'](_0x2ba571[_0x3c97('0x31')]);_0x4d52b8[_0x3c97('0x33')]=_[_0x3c97('0x34')](_0x4d52b8['model'],_0x4d52b8['query']);_0x122223[_0x3c97('0x35')]=_[_0x3c97('0x34')](_0x4d52b8['model'],qs[_0x3c97('0x36')](_0x2ba571[_0x3c97('0x31')]['fields']));_0x122223[_0x3c97('0x35')]=_0x122223[_0x3c97('0x35')][_0x3c97('0x6f')]?_0x122223[_0x3c97('0x35')]:_0x4d52b8[_0x3c97('0x30')];_0x122223[_0x3c97('0x39')]=qs[_0x3c97('0x3a')](_0x2ba571[_0x3c97('0x31')]['sort']);_0x122223[_0x3c97('0x3b')]=qs[_0x3c97('0x33')](_[_0x3c97('0x70')](_0x2ba571[_0x3c97('0x31')],_0x4d52b8[_0x3c97('0x33')]));if(_0x2ba571[_0x3c97('0x31')][_0x3c97('0x3c')]){_0x122223[_0x3c97('0x3b')]=_[_0x3c97('0x3d')](_0x122223[_0x3c97('0x3b')],{'$or':_[_0x3c97('0x2c')](_0x122223['attributes'],function(_0x1c4af8){var _0x2994fc={};_0x2994fc[_0x1c4af8]={'$like':'%'+_0x2ba571['query'][_0x3c97('0x3c')]+'%'};return _0x2994fc;})});}_0x122223=_[_0x3c97('0x3d')]({},_0x122223,_0x2ba571[_0x3c97('0x3f')]);return _0x4cf330[_0x3c97('0x6e')](_0x122223);}})[_0x3c97('0x23')](function(_0x5ee5a2){if(_0x5ee5a2){_0x229a2e=_0x5ee5a2['length'];if(!_0x2ba571[_0x3c97('0x31')][_0x3c97('0x37')](_0x3c97('0x38'))){_0x122223[_0x3c97('0x1e')]=qs[_0x3c97('0x1e')](_0x2ba571['query'][_0x3c97('0x1e')]);_0x122223[_0x3c97('0x1b')]=qs[_0x3c97('0x1b')](_0x2ba571[_0x3c97('0x31')][_0x3c97('0x1b')]);}return _0x4cf330['getSounds'](_0x122223);}})[_0x3c97('0x23')](function(_0x2cb874){if(_0x2cb874){return _0x2cb874?{'count':_0x229a2e,'rows':_0x2cb874}:null;}})[_0x3c97('0x23')](respondWithResult(_0x2310f0,null))[_0x3c97('0x47')](handleError(_0x2310f0,null));}; \ No newline at end of file +var _0x60ee=['mkdirSync','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','create','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','transaction','Sound','findOne','converted_format','server/files/sounds/converted','format','%s.%s','basename','save_name','symlinkSync','message','removeSound','id2','createdAt','length','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','find','body','sequelize','files','join','root','server/files/moh'];(function(_0x5dfda1,_0x26d550){var _0x2add40=function(_0x103f37){while(--_0x103f37){_0x5dfda1['push'](_0x5dfda1['shift']());}};_0x2add40(++_0x26d550);}(_0x60ee,0x15c));var _0xe60e=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x60ee[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xe60e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe60e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe60e('0x2'));var BPromise=require(_0xe60e('0x3'));var Mustache=require(_0xe60e('0x4'));var util=require('util');var path=require(_0xe60e('0x5'));var sox=require(_0xe60e('0x6'));var csv=require(_0xe60e('0x7'));var ejs=require(_0xe60e('0x8'));var fs=require('fs');var fs_extra=require(_0xe60e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe60e('0xa'));var jsforce=require(_0xe60e('0xb'));var deskjs=require(_0xe60e('0xc'));var toCsv=require(_0xe60e('0x7'));var querystring=require('querystring');var Papa=require(_0xe60e('0xd'));var Redis=require(_0xe60e('0xe'));var authService=require(_0xe60e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe60e('0x10'));var utils=require(_0xe60e('0x11'));var config=require(_0xe60e('0x12'));var licenseUtil=require(_0xe60e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x415385,_0x5171a9){_0x5171a9=_0x5171a9||0xcc;return function(_0x17465b){if(_0x17465b){return _0x415385['sendStatus'](_0x5171a9);}return _0x415385['status'](_0x5171a9)[_0xe60e('0x14')]();};}function respondWithResult(_0x2b952f,_0x4bd612){_0x4bd612=_0x4bd612||0xc8;return function(_0x1063d9){if(_0x1063d9){return _0x2b952f[_0xe60e('0x15')](_0x4bd612)['json'](_0x1063d9);}};}function respondWithFilteredResult(_0x4a0845,_0x5d5cf4){return function(_0x1688fc){if(_0x1688fc){var _0x204c7c=typeof _0x5d5cf4['offset']==='undefined'&&typeof _0x5d5cf4['limit']===_0xe60e('0x16');var _0x391956=_0x1688fc[_0xe60e('0x17')];var _0x49482c=_0x204c7c?0x0:_0x5d5cf4[_0xe60e('0x18')];var _0x581dc7=_0x204c7c?_0x1688fc[_0xe60e('0x17')]:_0x5d5cf4[_0xe60e('0x18')]+_0x5d5cf4[_0xe60e('0x19')];var _0x2895c2;if(_0x581dc7>=_0x391956){_0x581dc7=_0x391956;_0x2895c2=0xc8;}else{_0x2895c2=0xce;}_0x4a0845['status'](_0x2895c2);return _0x4a0845[_0xe60e('0x1a')](_0xe60e('0x1b'),_0x49482c+'-'+_0x581dc7+'/'+_0x391956)[_0xe60e('0x1c')](_0x1688fc);}return null;};}function patchUpdates(_0x22922e){return function(_0x5ae02d){try{jsonpatch[_0xe60e('0x1d')](_0x5ae02d,_0x22922e,!![]);}catch(_0xf8aae){return BPromise[_0xe60e('0x1e')](_0xf8aae);}return _0x5ae02d[_0xe60e('0x1f')]();};}function saveUpdates(_0x45cfd3,_0x19c419){return function(_0x30495d){if(_0x30495d){return _0x30495d[_0xe60e('0x20')](_0x45cfd3)[_0xe60e('0x21')](function(_0x24d396){return _0x24d396;});}return null;};}function removeEntity(_0x5cfab8,_0x5818a4){return function(_0x278a9c){if(_0x278a9c){return _0x278a9c[_0xe60e('0x22')]()[_0xe60e('0x21')](function(){var _0x1a71c8=_0x278a9c[_0xe60e('0x23')]({'plain':!![]});var _0x5e6547=_0xe60e('0x24');return db['UserProfileResource'][_0xe60e('0x22')]({'where':{'type':_0x5e6547,'resourceId':_0x1a71c8['id']}})[_0xe60e('0x21')](function(){return _0x278a9c;});})[_0xe60e('0x21')](function(){_0x5cfab8[_0xe60e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ed427,_0x316bb7){return function(_0x2b57ad){if(!_0x2b57ad){_0x9ed427[_0xe60e('0x25')](0x194);}return _0x2b57ad;};}function handleError(_0x181bca,_0x27e277){_0x27e277=_0x27e277||0x1f4;return function(_0x345c68){logger[_0xe60e('0x26')](_0x345c68[_0xe60e('0x27')]);if(_0x345c68['name']){delete _0x345c68[_0xe60e('0x28')];}_0x181bca[_0xe60e('0x15')](_0x27e277)['send'](_0x345c68);};}exports[_0xe60e('0x29')]=function(_0x55bb8b,_0x37ddd8){var _0x20fedc={},_0x13d2a4={},_0x43300c={'count':0x0,'rows':[]};var _0x193c2f=_[_0xe60e('0x2a')](db[_0xe60e('0x2b')]['rawAttributes'],function(_0x500413){return{'name':_0x500413[_0xe60e('0x2c')],'type':_0x500413[_0xe60e('0x2d')][_0xe60e('0x2e')]};});_0x13d2a4[_0xe60e('0x2f')]=_[_0xe60e('0x2a')](_0x193c2f,_0xe60e('0x28'));_0x13d2a4[_0xe60e('0x30')]=_['keys'](_0x55bb8b[_0xe60e('0x30')]);_0x13d2a4[_0xe60e('0x31')]=_[_0xe60e('0x32')](_0x13d2a4[_0xe60e('0x2f')],_0x13d2a4[_0xe60e('0x30')]);_0x20fedc['attributes']=_[_0xe60e('0x32')](_0x13d2a4[_0xe60e('0x2f')],qs[_0xe60e('0x33')](_0x55bb8b[_0xe60e('0x30')]['fields']));_0x20fedc[_0xe60e('0x34')]=_0x20fedc[_0xe60e('0x34')]['length']?_0x20fedc[_0xe60e('0x34')]:_0x13d2a4[_0xe60e('0x2f')];if(!_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x35')](_0xe60e('0x36'))){_0x20fedc[_0xe60e('0x19')]=qs['limit'](_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x19')]);_0x20fedc['offset']=qs[_0xe60e('0x18')](_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x18')]);}_0x20fedc['order']=qs['sort'](_0x55bb8b['query']['sort']);delete _0x55bb8b[_0xe60e('0x30')][_0xe60e('0x37')];_0x20fedc[_0xe60e('0x38')]=qs[_0xe60e('0x31')](_[_0xe60e('0x39')](_0x55bb8b[_0xe60e('0x30')],_0x13d2a4[_0xe60e('0x31')]),_0x193c2f);if(_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3a')]){_0x20fedc[_0xe60e('0x38')]=_[_0xe60e('0x3b')](_0x20fedc[_0xe60e('0x38')],{'$or':_[_0xe60e('0x2a')](_0x193c2f,function(_0x10d300){if(_0x10d300[_0xe60e('0x2d')]!=='VIRTUAL'){var _0x296079={};_0x296079[_0x10d300[_0xe60e('0x28')]]={'$like':'%'+_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3a')]+'%'};return _0x296079;}})});}_0x20fedc=_['merge']({},_0x20fedc,_0x55bb8b['options']);var _0xc6e0f1={'where':_0x20fedc[_0xe60e('0x38')]};return db[_0xe60e('0x2b')]['count'](_0xc6e0f1)[_0xe60e('0x21')](function(_0x2223ee){_0x43300c[_0xe60e('0x17')]=_0x2223ee;if(_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3c')]){_0x20fedc[_0xe60e('0x3d')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xe60e('0x3e')](_0x20fedc);})[_0xe60e('0x21')](function(_0x1f34b3){_0x43300c[_0xe60e('0x3f')]=_0x1f34b3;return _0x43300c;})['then'](respondWithFilteredResult(_0x37ddd8,_0x20fedc))[_0xe60e('0x40')](handleError(_0x37ddd8,null));};exports['show']=function(_0x3f4900,_0x3a76ca){var _0x158635={'raw':![],'where':{'id':_0x3f4900[_0xe60e('0x41')]['id']}},_0x3c576a={};_0x3c576a[_0xe60e('0x2f')]=_[_0xe60e('0x42')](db[_0xe60e('0x2b')][_0xe60e('0x43')]);_0x3c576a[_0xe60e('0x30')]=_[_0xe60e('0x42')](_0x3f4900[_0xe60e('0x30')]);_0x3c576a[_0xe60e('0x31')]=_[_0xe60e('0x32')](_0x3c576a['model'],_0x3c576a['query']);_0x158635[_0xe60e('0x34')]=_[_0xe60e('0x32')](_0x3c576a[_0xe60e('0x2f')],qs['fields'](_0x3f4900[_0xe60e('0x30')][_0xe60e('0x33')]));_0x158635['attributes']=_0x158635[_0xe60e('0x34')]['length']?_0x158635[_0xe60e('0x34')]:_0x3c576a[_0xe60e('0x2f')];if(_0x3f4900[_0xe60e('0x30')][_0xe60e('0x3c')]){_0x158635[_0xe60e('0x3d')]=[{'all':!![]}];}_0x158635=_['merge']({},_0x158635,_0x3f4900[_0xe60e('0x44')]);return db[_0xe60e('0x2b')][_0xe60e('0x45')](_0x158635)[_0xe60e('0x21')](handleEntityNotFound(_0x3a76ca,null))[_0xe60e('0x21')](respondWithResult(_0x3a76ca,null))['catch'](handleError(_0x3a76ca,null));};exports['update']=function(_0x1f0ebe,_0xa55dee){if(_0x1f0ebe[_0xe60e('0x46')]['id']){delete _0x1f0ebe[_0xe60e('0x46')]['id'];}return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x1f0ebe[_0xe60e('0x41')]['id']}})[_0xe60e('0x21')](handleEntityNotFound(_0xa55dee,null))[_0xe60e('0x21')](saveUpdates(_0x1f0ebe[_0xe60e('0x46')],null))['then'](respondWithResult(_0xa55dee,null))['catch'](handleError(_0xa55dee,null));};exports['create']=function(_0xbb381b,_0xaa30bf,_0x2ad06a){return db[_0xe60e('0x47')]['transaction'](function(_0x57e0a4){if(_0xbb381b['body']['mode']===_0xe60e('0x48')){_0xbb381b[_0xe60e('0x46')]['directory']=path[_0xe60e('0x49')](config[_0xe60e('0x4a')],_0xe60e('0x4b'),_0xbb381b['body']['name']);}return db[_0xe60e('0x2b')]['create'](_0xbb381b[_0xe60e('0x46')],{'transaction':_0x57e0a4})[_0xe60e('0x21')](function(_0x4ecd5b){if(_0xbb381b[_0xe60e('0x46')]['mode']===_0xe60e('0x48')){fs[_0xe60e('0x4c')](_0x4ecd5b[_0xe60e('0x4d')],parseInt('0777',0x8));}var _0x4998e2=_0xbb381b['user'][_0xe60e('0x23')]({'plain':!![]});if(!_0x4998e2)throw new Error(_0xe60e('0x4e'));if(_0x4998e2['role']===_0xe60e('0x4f')){var _0x391c90=_0x4ecd5b[_0xe60e('0x23')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe60e('0x24'),'userProfileId':_0x4998e2[_0xe60e('0x50')]},'raw':!![]})['then'](function(_0x2a6d47){if(_0x2a6d47&&_0x2a6d47[_0xe60e('0x51')]===0x0){return db[_0xe60e('0x52')][_0xe60e('0x53')]({'name':_0x391c90[_0xe60e('0x28')],'resourceId':_0x391c90['id'],'type':_0x2a6d47[_0xe60e('0x28')],'sectionId':_0x2a6d47['id']},{})[_0xe60e('0x21')](function(){return _0x4ecd5b;});}else{return _0x4ecd5b;}})[_0xe60e('0x40')](function(_0x5c5c37){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5c37);});}return _0x4ecd5b;});})[_0xe60e('0x21')](respondWithResult(_0xaa30bf,0xc9))['catch'](handleError(_0xaa30bf,null));};exports[_0xe60e('0x22')]=function(_0x3093f6,_0x401cea,_0x527fae){var _0x1faaf2;return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x3093f6['params']['id']}})['then'](function(_0x2ac246){if(_0x2ac246){return db[_0xe60e('0x47')]['transaction'](function(_0xb4c7c3){return _0x2ac246['destroy']({'transaction':_0xb4c7c3,'raw':!![]})['then'](function(_0x2e552f){if(_0x2e552f[_0xe60e('0x4d')]){fs[_0xe60e('0x54')](_0x2e552f[_0xe60e('0x4d')])[_0xe60e('0x55')](function(_0x3d5251){fs[_0xe60e('0x56')](path[_0xe60e('0x49')](_0x2e552f['directory'],_0x3d5251));});fs[_0xe60e('0x57')](_0x2e552f['directory']);}return _0x2e552f;});})[_0xe60e('0x40')](function(_0x44ed75){throw new db[(_0xe60e('0x58'))][(_0xe60e('0x59'))](_0x44ed75['message']);});}})['then'](handleEntityNotFound(_0x401cea,null))['then'](removeEntity(_0x401cea,null))[_0xe60e('0x40')](handleError(_0x401cea,null));};exports[_0xe60e('0x5a')]=function(_0x226ec8,_0x37499e,_0x112cc2){return db[_0xe60e('0x47')][_0xe60e('0x5b')](function(_0x356684){var _0x2f0d6e;return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x226ec8['params']['id']}})[_0xe60e('0x21')](function(_0x398950){if(_0x398950){_0x2f0d6e=_0x398950;return _0x398950[_0xe60e('0x5a')](_0x226ec8[_0xe60e('0x46')]['id'],{'transaction':_0x356684});}})[_0xe60e('0x21')](function(_0x3f19ad){if(_0x3f19ad){return db[_0xe60e('0x5c')][_0xe60e('0x5d')]({'where':{'id':_0x226ec8[_0xe60e('0x46')]['id']},'attributes':['id','name','save_name',_0xe60e('0x5e'),'createdAt'],'raw':!![]});}})[_0xe60e('0x21')](function(_0x4fb9d4){if(_0x4fb9d4){var _0xa725c1=path['join'](config[_0xe60e('0x4a')],_0xe60e('0x5f'),util[_0xe60e('0x60')](_0xe60e('0x61'),path[_0xe60e('0x62')](_0x4fb9d4[_0xe60e('0x63')],path['extname'](_0x4fb9d4[_0xe60e('0x63')])),_0x4fb9d4[_0xe60e('0x5e')]));var _0x115c5b=path[_0xe60e('0x49')](config[_0xe60e('0x4a')],_0xe60e('0x4b'),_0x2f0d6e['name'],util[_0xe60e('0x60')]('%s.%s',_0x4fb9d4[_0xe60e('0x28')],_0x4fb9d4[_0xe60e('0x5e')]));fs[_0xe60e('0x64')](_0xa725c1,_0x115c5b);return _0x4fb9d4;}})[_0xe60e('0x40')](function(_0x183ea5){throw new db[(_0xe60e('0x58'))][(_0xe60e('0x59'))](_0x183ea5[_0xe60e('0x65')]);});})[_0xe60e('0x21')](handleEntityNotFound(_0x37499e,null))[_0xe60e('0x21')](respondWithResult(_0x37499e,0xc9))[_0xe60e('0x40')](handleError(_0x37499e,null));};exports[_0xe60e('0x66')]=function(_0x4adce7,_0x2db141,_0x454aa3){return db[_0xe60e('0x47')][_0xe60e('0x5b')](function(_0x21e1ee){var _0x3dd085;return db['VoiceMusicOnHold'][_0xe60e('0x5d')]({'where':{'id':_0x4adce7[_0xe60e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2db141,null))[_0xe60e('0x21')](function(_0x327b4a){if(_0x327b4a){_0x3dd085=_0x327b4a;return _0x327b4a[_0xe60e('0x66')](_0x4adce7[_0xe60e('0x41')][_0xe60e('0x67')]);}})[_0xe60e('0x21')](function(_0x504a1e){if(_0x504a1e){return db['Sound'][_0xe60e('0x5d')]({'where':{'id':_0x4adce7['params'][_0xe60e('0x67')]},'attributes':['id','name',_0xe60e('0x63'),_0xe60e('0x5e'),_0xe60e('0x68')],'raw':!![]});}})[_0xe60e('0x21')](function(_0x6b9d23){if(_0x6b9d23){fs[_0xe60e('0x56')](path[_0xe60e('0x49')](_0x3dd085['directory'],util[_0xe60e('0x60')](_0xe60e('0x61'),_0x6b9d23['name'],_0x6b9d23[_0xe60e('0x5e')])));return _0x6b9d23;}})[_0xe60e('0x40')](function(_0x39a97e){throw new db['Sequelize'][(_0xe60e('0x59'))](_0x39a97e[_0xe60e('0x65')]);});})[_0xe60e('0x21')](handleEntityNotFound(_0x2db141,null))['then'](respondWithStatusCode(_0x2db141,0xcc))[_0xe60e('0x40')](handleError(_0x2db141,null));};exports['getSounds']=function(_0xb5bad7,_0x6906be,_0x5acd2a){var _0x4c6a68={};var _0x419a82={};var _0x4f1b64;var _0x43e5a7;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0xb5bad7[_0xe60e('0x41')]['id']}})[_0xe60e('0x21')](handleEntityNotFound(_0x6906be,null))[_0xe60e('0x21')](function(_0x514542){if(_0x514542){_0x4f1b64=_0x514542;_0x419a82['model']=_['keys'](db[_0xe60e('0x5c')]['rawAttributes']);_0x419a82[_0xe60e('0x30')]=_[_0xe60e('0x42')](_0xb5bad7[_0xe60e('0x30')]);_0x419a82['filters']=_[_0xe60e('0x32')](_0x419a82[_0xe60e('0x2f')],_0x419a82['query']);_0x4c6a68[_0xe60e('0x34')]=_[_0xe60e('0x32')](_0x419a82[_0xe60e('0x2f')],qs['fields'](_0xb5bad7[_0xe60e('0x30')]['fields']));_0x4c6a68[_0xe60e('0x34')]=_0x4c6a68['attributes'][_0xe60e('0x69')]?_0x4c6a68['attributes']:_0x419a82['model'];_0x4c6a68['order']=qs[_0xe60e('0x37')](_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x37')]);_0x4c6a68[_0xe60e('0x38')]=qs[_0xe60e('0x31')](_['pick'](_0xb5bad7['query'],_0x419a82['filters']));if(_0xb5bad7['query'][_0xe60e('0x3a')]){_0x4c6a68[_0xe60e('0x38')]=_[_0xe60e('0x3b')](_0x4c6a68[_0xe60e('0x38')],{'$or':_['map'](_0x4c6a68[_0xe60e('0x34')],function(_0x3c746c){var _0x3931d8={};_0x3931d8[_0x3c746c]={'$like':'%'+_0xb5bad7['query'][_0xe60e('0x3a')]+'%'};return _0x3931d8;})});}_0x4c6a68=_[_0xe60e('0x3b')]({},_0x4c6a68,_0xb5bad7[_0xe60e('0x44')]);return _0x4f1b64['getSounds'](_0x4c6a68);}})[_0xe60e('0x21')](function(_0x1e891f){if(_0x1e891f){_0x43e5a7=_0x1e891f[_0xe60e('0x69')];if(!_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x35')](_0xe60e('0x36'))){_0x4c6a68['limit']=qs[_0xe60e('0x19')](_0xb5bad7[_0xe60e('0x30')]['limit']);_0x4c6a68[_0xe60e('0x18')]=qs[_0xe60e('0x18')](_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x18')]);}return _0x4f1b64['getSounds'](_0x4c6a68);}})[_0xe60e('0x21')](function(_0x3c1841){if(_0x3c1841){return _0x3c1841?{'count':_0x43e5a7,'rows':_0x3c1841}:null;}})['then'](respondWithResult(_0x6906be,null))[_0xe60e('0x40')](handleError(_0x6906be,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9216214..b7c2a9d 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 _0x4fff=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold','voice_musiconhold','util'];(function(_0x258fca,_0x3a4493){var _0x5a9124=function(_0x373284){while(--_0x373284){_0x258fca['push'](_0x258fca['shift']());}};_0x5a9124(++_0x3a4493);}(_0x4fff,0xef));var _0xf4ff=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4fff[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf4ff('0x0'));var logger=require('../../config/logger')(_0xf4ff('0x1'));var moment=require(_0xf4ff('0x2'));var BPromise=require(_0xf4ff('0x3'));var rp=require(_0xf4ff('0x4'));var fs=require('fs');var path=require(_0xf4ff('0x5'));var rimraf=require('rimraf');var config=require(_0xf4ff('0x6'));var attributes=require(_0xf4ff('0x7'));module['exports']=function(_0x8f99aa,_0x1e1132){return _0x8f99aa['define'](_0xf4ff('0x8'),attributes,{'tableName':_0xf4ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddf9=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xddf9,0x1c4));var _0x9ddf=function(_0x25ca44,_0x111633){_0x25ca44=_0x25ca44-0x0;var _0x4897c1=_0xddf9[_0x25ca44];return _0x4897c1;};'use strict';var _=require(_0x9ddf('0x0'));var util=require('util');var logger=require(_0x9ddf('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9ddf('0x2'));var rp=require(_0x9ddf('0x3'));var fs=require('fs');var path=require(_0x9ddf('0x4'));var rimraf=require(_0x9ddf('0x5'));var config=require(_0x9ddf('0x6'));var attributes=require(_0x9ddf('0x7'));module[_0x9ddf('0x8')]=function(_0x128609,_0x5f39bb){return _0x128609[_0x9ddf('0x9')](_0x9ddf('0xa'),attributes,{'tableName':_0x9ddf('0xb'),'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 749ff1d..b31c473 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x1f99b5,_0x3deed5){var _0x11684c=function(_0x2c0b01){while(--_0x2c0b01){_0x1f99b5['push'](_0x1f99b5['shift']());}};_0x11684c(++_0x3deed5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x2c346b,_0xc1d5c0){var _0x4c1834=function(_0x230901){while(--_0x230901){_0x2c346b['push'](_0x2c346b['shift']());}};_0x4c1834(++_0xc1d5c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xcb91[_0x53b8e0];return _0x10630c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 37456d0..7cca80c 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 _0xceee=['post','create','addAgents','/:id/teams','put','/:id','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/users'];(function(_0x42a7bd,_0x289bf8){var _0x86ec18=function(_0x16a229){while(--_0x16a229){_0x42a7bd['push'](_0x42a7bd['shift']());}};_0x86ec18(++_0x289bf8);}(_0xceee,0xbb));var _0xecee=function(_0x48721a,_0xcbde32){_0x48721a=_0x48721a-0x0;var _0x29b1a7=_0xceee[_0x48721a];return _0x29b1a7;};'use strict';var multer=require(_0xecee('0x0'));var util=require(_0xecee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xecee('0x2'));var router=express[_0xecee('0x3')]();var fs_extra=require(_0xecee('0x4'));var auth=require(_0xecee('0x5'));var interaction=require(_0xecee('0x6'));var config=require(_0xecee('0x7'));var controller=require('./voicePrefix.controller');router[_0xecee('0x8')]('/',auth[_0xecee('0x9')](),controller[_0xecee('0xa')]);router[_0xecee('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xecee('0xb')]);router[_0xecee('0x8')]('/:id',auth[_0xecee('0x9')](),controller['show']);router['get'](_0xecee('0xc'),auth[_0xecee('0x9')](),controller['getAgents']);router['get']('/:id/teams',auth[_0xecee('0x9')](),controller['getTeams']);router[_0xecee('0xd')]('/',auth['isAuthenticated'](),controller[_0xecee('0xe')]);router[_0xecee('0xd')](_0xecee('0xc'),auth[_0xecee('0x9')](),controller[_0xecee('0xf')]);router[_0xecee('0xd')](_0xecee('0x10'),auth[_0xecee('0x9')](),controller['addTeams']);router[_0xecee('0x11')](_0xecee('0x12'),auth[_0xecee('0x9')](),controller[_0xecee('0x13')]);router[_0xecee('0x14')]('/:id',auth[_0xecee('0x9')](),controller[_0xecee('0x15')]);router[_0xecee('0x14')](_0xecee('0xc'),auth[_0xecee('0x9')](),controller[_0xecee('0x16')]);router[_0xecee('0x14')](_0xecee('0x10'),auth[_0xecee('0x9')](),controller[_0xecee('0x17')]);module[_0xecee('0x18')]=router; \ No newline at end of file +var _0xdcab=['index','/describe','show','/:id/users','getAgents','/:id/teams','post','create','/:id','update','delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x59eeaf,_0x56e107){var _0x119d61=function(_0xad3379){while(--_0xad3379){_0x59eeaf['push'](_0x59eeaf['shift']());}};_0x119d61(++_0x56e107);}(_0xdcab,0x1e9));var _0xbdca=function(_0x2296cf,_0x539e44){_0x2296cf=_0x2296cf-0x0;var _0x4e17f7=_0xdcab[_0x2296cf];return _0x4e17f7;};'use strict';var multer=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var path=require(_0xbdca('0x2'));var timeout=require(_0xbdca('0x3'));var express=require(_0xbdca('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbdca('0x5'));var interaction=require(_0xbdca('0x6'));var config=require(_0xbdca('0x7'));var controller=require(_0xbdca('0x8'));router[_0xbdca('0x9')]('/',auth[_0xbdca('0xa')](),controller[_0xbdca('0xb')]);router[_0xbdca('0x9')](_0xbdca('0xc'),auth[_0xbdca('0xa')](),controller['describe']);router[_0xbdca('0x9')]('/:id',auth[_0xbdca('0xa')](),controller[_0xbdca('0xd')]);router[_0xbdca('0x9')](_0xbdca('0xe'),auth[_0xbdca('0xa')](),controller[_0xbdca('0xf')]);router[_0xbdca('0x9')](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller['getTeams']);router[_0xbdca('0x11')]('/',auth[_0xbdca('0xa')](),controller[_0xbdca('0x12')]);router[_0xbdca('0x11')]('/:id/users',auth[_0xbdca('0xa')](),controller['addAgents']);router[_0xbdca('0x11')](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller['addTeams']);router['put'](_0xbdca('0x13'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x14')]);router[_0xbdca('0x15')](_0xbdca('0x13'),auth[_0xbdca('0xa')](),controller['destroy']);router[_0xbdca('0x15')](_0xbdca('0xe'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x16')]);router['delete'](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x17')]);module[_0xbdca('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 e45839a..5aa6694 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 _0xa18f=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x27c5f7,_0xdbdc76){var _0x4cec69=function(_0x3f9994){while(--_0x3f9994){_0x27c5f7['push'](_0x27c5f7['shift']());}};_0x4cec69(++_0xdbdc76);}(_0xa18f,0x146));var _0xfa18=function(_0x393665,_0x2aab3d){_0x393665=_0x393665-0x0;var _0x561439=_0xa18f[_0x393665];return _0x561439;};'use strict';var Sequelize=require(_0xfa18('0x0'));module[_0xfa18('0x1')]={'name':{'type':Sequelize[_0xfa18('0x2')],'allowNull':![],'unique':_0xfa18('0x3')},'prefix':{'type':Sequelize[_0xfa18('0x4')],'get':function(_0x33e3ec){return _0xfa18('0x5')+this[_0xfa18('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xfa18('0x2')]},'callerIdAll':{'type':Sequelize[_0xfa18('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xfa18('0x7')]}}; \ No newline at end of file +var _0x2f48=['exports','STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0x3c8036,_0x5de805){var _0x3c4ddb=function(_0x304d4e){while(--_0x304d4e){_0x3c8036['push'](_0x3c8036['shift']());}};_0x3c4ddb(++_0x5de805);}(_0x2f48,0x1ef));var _0x82f4=function(_0x2a7bae,_0x3b47d5){_0x2a7bae=_0x2a7bae-0x0;var _0x24504e=_0x2f48[_0x2a7bae];return _0x24504e;};'use strict';var Sequelize=require(_0x82f4('0x0'));module[_0x82f4('0x1')]={'name':{'type':Sequelize[_0x82f4('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x82f4('0x3')],'get':function(_0x1393a7){return _0x82f4('0x4')+this[_0x82f4('0x5')](_0x82f4('0x6'))+'-';}},'description':{'type':Sequelize[_0x82f4('0x2')]},'callerIdAll':{'type':Sequelize[_0x82f4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x82f4('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index fcb5835..69c5e5f 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 _0x80ed=['../../mysqldb','redis','defaults','./voicePrefix.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','type','filter','merge','options','includeAll','include','rows','catch','show','length','find','params','describe','create','sequelize','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','No\x20callerid\x20available','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','pick','getTeams','findOne','Team','nolimit','addTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','UserVoicePrefix','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','TeamId','includes','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','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'];(function(_0x506e6b,_0x5dba9f){var _0x40176e=function(_0x51c97d){while(--_0x51c97d){_0x506e6b['push'](_0x506e6b['shift']());}};_0x40176e(++_0x5dba9f);}(_0x80ed,0x11c));var _0xd80e=function(_0x6def2c,_0x431bf6){_0x6def2c=_0x6def2c-0x0;var _0xadd58d=_0x80ed[_0x6def2c];return _0xadd58d;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];config[_0xd80e('0x1b')]=_[_0xd80e('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd80e('0x1d'))[_0xd80e('0x1e')](socket);function respondWithStatusCode(_0x3096ae,_0x1e8b63){_0x1e8b63=_0x1e8b63||0xcc;return function(_0x449c60){if(_0x449c60){return _0x3096ae['sendStatus'](_0x1e8b63);}return _0x3096ae[_0xd80e('0x1f')](_0x1e8b63)[_0xd80e('0x20')]();};}function respondWithResult(_0x3124e8,_0x3b48ae){_0x3b48ae=_0x3b48ae||0xc8;return function(_0x40a4d5){if(_0x40a4d5){return _0x3124e8[_0xd80e('0x1f')](_0x3b48ae)[_0xd80e('0x21')](_0x40a4d5);}};}function respondWithFilteredResult(_0x22ab67,_0x49e3e5){return function(_0x21ceec){if(_0x21ceec){var _0x1cc576=typeof _0x49e3e5[_0xd80e('0x22')]===_0xd80e('0x23')&&typeof _0x49e3e5['limit']===_0xd80e('0x23');var _0x175c67=_0x21ceec[_0xd80e('0x24')];var _0x527237=_0x1cc576?0x0:_0x49e3e5[_0xd80e('0x22')];var _0x2ef8a1=_0x1cc576?_0x21ceec[_0xd80e('0x24')]:_0x49e3e5[_0xd80e('0x22')]+_0x49e3e5[_0xd80e('0x25')];var _0x5509d4;if(_0x2ef8a1>=_0x175c67){_0x2ef8a1=_0x175c67;_0x5509d4=0xc8;}else{_0x5509d4=0xce;}_0x22ab67['status'](_0x5509d4);return _0x22ab67[_0xd80e('0x26')](_0xd80e('0x27'),_0x527237+'-'+_0x2ef8a1+'/'+_0x175c67)[_0xd80e('0x21')](_0x21ceec);}return null;};}function patchUpdates(_0x2d46e7){return function(_0x3eb3ca){try{jsonpatch[_0xd80e('0x28')](_0x3eb3ca,_0x2d46e7,!![]);}catch(_0x43152c){return BPromise['reject'](_0x43152c);}return _0x3eb3ca[_0xd80e('0x29')]();};}function saveUpdates(_0x57d70,_0x170109){return function(_0x5b0d6d){if(_0x5b0d6d){return _0x5b0d6d[_0xd80e('0x2a')](_0x57d70)[_0xd80e('0x2b')](function(_0xe9bb59){return _0xe9bb59;});}return null;};}function removeEntity(_0x482779,_0x521aa4){return function(_0x5420e7){if(_0x5420e7){return _0x5420e7[_0xd80e('0x2c')]()['then'](function(){var _0x9f9287=_0x5420e7[_0xd80e('0x2d')]({'plain':!![]});var _0x4e8ed9=_0xd80e('0x2e');return db[_0xd80e('0x2f')][_0xd80e('0x2c')]({'where':{'type':_0x4e8ed9,'resourceId':_0x9f9287['id']}})[_0xd80e('0x2b')](function(){return _0x5420e7;});})['then'](function(){_0x482779[_0xd80e('0x1f')](0xcc)[_0xd80e('0x20')]();});}};}function handleEntityNotFound(_0x845451,_0x39088b){return function(_0x2b1aaf){if(!_0x2b1aaf){_0x845451[_0xd80e('0x30')](0x194);}return _0x2b1aaf;};}function handleError(_0x289685,_0x138f19){_0x138f19=_0x138f19||0x1f4;return function(_0x5522dd){logger['error'](_0x5522dd[_0xd80e('0x31')]);if(_0x5522dd[_0xd80e('0x32')]){delete _0x5522dd[_0xd80e('0x32')];}_0x289685[_0xd80e('0x1f')](_0x138f19)[_0xd80e('0x33')](_0x5522dd);};}exports[_0xd80e('0x34')]=function(_0x506842,_0x568d82){var _0x39c124={},_0x2d6ae5={},_0x380f4f={'count':0x0,'rows':[]};var _0x122a72=_[_0xd80e('0x35')](db[_0xd80e('0x36')][_0xd80e('0x37')],function(_0x1a0dfe){return{'name':_0x1a0dfe['fieldName'],'type':_0x1a0dfe['type'][_0xd80e('0x38')]};});_0x2d6ae5[_0xd80e('0x39')]=_[_0xd80e('0x35')](_0x122a72,_0xd80e('0x32'));_0x2d6ae5[_0xd80e('0x3a')]=_[_0xd80e('0x3b')](_0x506842[_0xd80e('0x3a')]);_0x2d6ae5[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x2d6ae5[_0xd80e('0x39')],_0x2d6ae5['query']);_0x39c124[_0xd80e('0x3e')]=_['intersection'](_0x2d6ae5[_0xd80e('0x39')],qs[_0xd80e('0x3f')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x3f')]));_0x39c124['attributes']=_0x39c124[_0xd80e('0x3e')]['length']?_0x39c124[_0xd80e('0x3e')]:_0x2d6ae5['model'];if(!_0x506842[_0xd80e('0x3a')][_0xd80e('0x40')]('nolimit')){_0x39c124[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x506842[_0xd80e('0x3a')]['limit']);_0x39c124[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x22')]);}_0x39c124[_0xd80e('0x41')]=qs[_0xd80e('0x42')](_0x506842[_0xd80e('0x3a')][_0xd80e('0x42')]);_0x39c124[_0xd80e('0x43')]=qs['filters'](_['pick'](_0x506842['query'],_0x2d6ae5[_0xd80e('0x3c')]),_0x122a72);if(_0x506842[_0xd80e('0x3a')]['filter']){_0x39c124[_0xd80e('0x43')]=_['merge'](_0x39c124[_0xd80e('0x43')],{'$or':_['map'](_0x122a72,function(_0x7bc136){if(_0x7bc136[_0xd80e('0x44')]!=='VIRTUAL'){var _0x58d58a={};_0x58d58a[_0x7bc136[_0xd80e('0x32')]]={'$like':'%'+_0x506842[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x58d58a;}})});}_0x39c124=_[_0xd80e('0x46')]({},_0x39c124,_0x506842[_0xd80e('0x47')]);var _0x19de99={'where':_0x39c124[_0xd80e('0x43')]};return db[_0xd80e('0x36')][_0xd80e('0x24')](_0x19de99)[_0xd80e('0x2b')](function(_0x1bbb36){_0x380f4f[_0xd80e('0x24')]=_0x1bbb36;if(_0x506842[_0xd80e('0x3a')][_0xd80e('0x48')]){_0x39c124[_0xd80e('0x49')]=[{'all':!![]}];}return db[_0xd80e('0x36')]['findAll'](_0x39c124);})['then'](function(_0x5bdea5){_0x380f4f[_0xd80e('0x4a')]=_0x5bdea5;return _0x380f4f;})['then'](respondWithFilteredResult(_0x568d82,_0x39c124))[_0xd80e('0x4b')](handleError(_0x568d82,null));};exports[_0xd80e('0x4c')]=function(_0x551bd5,_0x15a880){var _0x2612e7={'raw':![],'where':{'id':_0x551bd5['params']['id']}},_0x7c394f={};_0x7c394f['model']=_['keys'](db[_0xd80e('0x36')]['rawAttributes']);_0x7c394f[_0xd80e('0x3a')]=_[_0xd80e('0x3b')](_0x551bd5[_0xd80e('0x3a')]);_0x7c394f[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x7c394f['model'],_0x7c394f[_0xd80e('0x3a')]);_0x2612e7[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x7c394f['model'],qs[_0xd80e('0x3f')](_0x551bd5[_0xd80e('0x3a')][_0xd80e('0x3f')]));_0x2612e7['attributes']=_0x2612e7[_0xd80e('0x3e')][_0xd80e('0x4d')]?_0x2612e7[_0xd80e('0x3e')]:_0x7c394f[_0xd80e('0x39')];if(_0x551bd5[_0xd80e('0x3a')][_0xd80e('0x48')]){_0x2612e7['include']=[{'all':!![]}];}_0x2612e7=_['merge']({},_0x2612e7,_0x551bd5[_0xd80e('0x47')]);return db[_0xd80e('0x36')][_0xd80e('0x4e')](_0x2612e7)['then'](handleEntityNotFound(_0x15a880,null))['then'](respondWithResult(_0x15a880,null))[_0xd80e('0x4b')](handleError(_0x15a880,null));};exports[_0xd80e('0x2c')]=function(_0x183f78,_0x1c0da8){return db[_0xd80e('0x36')]['find']({'where':{'id':_0x183f78[_0xd80e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c0da8,null))[_0xd80e('0x2b')](removeEntity(_0x1c0da8,null))[_0xd80e('0x4b')](handleError(_0x1c0da8,null));};exports['describe']=function(_0x29af86,_0xd19881){return db[_0xd80e('0x36')][_0xd80e('0x50')]()[_0xd80e('0x2b')](respondWithResult(_0xd19881,null))[_0xd80e('0x4b')](handleError(_0xd19881,null));};exports[_0xd80e('0x51')]=function(_0x50be26,_0x178c51){var _0x377e68;return db[_0xd80e('0x52')]['transaction'](function(_0x52ab04){return db[_0xd80e('0x36')][_0xd80e('0x51')](_0x50be26[_0xd80e('0x53')],{'transaction':_0x52ab04})[_0xd80e('0x2b')](function(_0x2f66eb){_0x377e68=_0x2f66eb[_0xd80e('0x2d')]({'plain':!![]});return db[_0xd80e('0x54')][_0xd80e('0x4e')]({'where':{'id':_0x377e68['VoiceExtensionId']},'raw':!![]})[_0xd80e('0x2b')](function(_0x5d6590){return createVoicePrefixExtensions(_0x377e68,_0x5d6590,_0x52ab04);});});})[_0xd80e('0x2b')](function(){var _0x3c184c=_0x50be26[_0xd80e('0x55')][_0xd80e('0x2d')]({'plain':!![]});if(!_0x3c184c)throw new Error(_0xd80e('0x56'));if(_0x3c184c[_0xd80e('0x57')]==='user'){var _0x13270c=_0x377e68;return db['UserProfileSection'][_0xd80e('0x4e')]({'where':{'name':_0xd80e('0x2e'),'userProfileId':_0x3c184c['userProfileId']},'raw':!![]})['then'](function(_0x402c0f){if(_0x402c0f&&_0x402c0f[_0xd80e('0x58')]===0x0){return db[_0xd80e('0x2f')]['create']({'name':_0x13270c['name'],'resourceId':_0x13270c['id'],'type':_0x402c0f[_0xd80e('0x32')],'sectionId':_0x402c0f['id']},{})[_0xd80e('0x2b')](function(){return _0x377e68;});}else{return _0x377e68;}})['catch'](function(_0x386918){logger[_0xd80e('0x59')](_0xd80e('0x5a'),_0x386918);throw _0x386918;});}return _0x377e68;})['then'](respondWithResult(_0x178c51,null))[_0xd80e('0x4b')](handleError(_0x178c51,null));};function Extension(_0x589c0b,_0x720eab,_0x392704,_0x3d8e46){this[_0xd80e('0x5b')]='from-sip';this[_0xd80e('0x5c')]=_0x589c0b;this['app']=_0x392704;this[_0xd80e('0x44')]='system';this[_0xd80e('0x5d')]=_0xd80e('0x5e');this[_0xd80e('0x5f')]=_0x720eab;this[_0xd80e('0x60')]=_0x3d8e46;}function createVoicePrefixExtensions(_0x53dd96,_0x1738ff,_0x280798){return new BPromise(function(_0x5d775f,_0x2ebfea){var _0x391e0c=new Extension(formatPrefixName(_0x53dd96[_0xd80e('0x61')]),0x1,_0xd80e('0x62'),'Voice\x20Prefix');_0x391e0c[_0xd80e('0x63')]=_0x53dd96['id'];return db[_0xd80e('0x54')]['create'](_0x391e0c,{'transaction':_0x280798})[_0xd80e('0x2b')](function(_0x22c680){var _0x136040=_0x22c680['get']({'plain':!![]});var _0x562ed7=_['map'](addVoicePrefixExtensions(_0x53dd96,_0x1738ff),function(_0x5f241c){_0x5f241c[_0xd80e('0x64')]=_0x136040['id'];_0x5f241c['VoicePrefixId']=_0x53dd96['id'];return _0x5f241c;});return db[_0xd80e('0x54')][_0xd80e('0x65')](_0x562ed7,{'transaction':_0x280798})[_0xd80e('0x2b')](function(_0x4e1b08){if(!_0x4e1b08){return _0x2ebfea(_0xd80e('0x66'));}else{return _0x5d775f(_0x4e1b08);}})[_0xd80e('0x4b')](function(_0x2b3ad6){return _0x2ebfea(_0x2b3ad6);});});;});};function addVoicePrefixExtensions(_0x1a351b,_0x43ab7b){var _0x2a34cd=[];var _0x385453=formatPrefixName(_0x1a351b[_0xd80e('0x61')]);_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x2,'Set','CDR(prefix)='+_0x1a351b[_0xd80e('0x32')]));if(_0x1a351b[_0xd80e('0x68')]){_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x3,_0xd80e('0x69'),'PREFIX-CALLERIDALL='+_0x1a351b[_0xd80e('0x68')]));}else{_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x3,_0xd80e('0x62'),_0xd80e('0x6a')));}_0x2a34cd[_0xd80e('0x67')](new Extension(_0x385453,0x4,'goto',_0x43ab7b[_0xd80e('0x5b')]+','+_0xd80e('0x6b')+(0x8+_0x1a351b[_0xd80e('0x32')][_0xd80e('0x4d')])+'}'+','+0x1));return _0x2a34cd;}function formatPrefixName(_0x53971e){var _0x215f2d='_';for(var _0x29be62=0x0;_0x29be62<_0x53971e[_0xd80e('0x4d')];_0x29be62++){if(_0x53971e[_0xd80e('0x6c')](_0x29be62)=='-'){_0x215f2d+=_0x53971e[_0xd80e('0x6c')](_0x29be62);}else{_0x215f2d+='['+_0x53971e[_0xd80e('0x6c')](_0x29be62)+']';}}_0x215f2d+='.';return _0x215f2d;}exports['update']=function(_0x3e3176,_0x393fb6,_0x5243c7){var _0x44cf88=_0x3e3176[_0xd80e('0x53')];_0x44cf88[_0xd80e('0x61')]=_0xd80e('0x6d')+_0x44cf88['name']+'-';return db[_0xd80e('0x52')]['transaction'](function(_0x314fbb){return db[_0xd80e('0x36')][_0xd80e('0x2a')](_0x44cf88,{'where':{'id':_0x44cf88['id']},'transaction':_0x314fbb})[_0xd80e('0x2b')](function(){return db[_0xd80e('0x54')]['destroy']({'where':{'VoicePrefixId':_0x44cf88['id']},'transaction':_0x314fbb})[_0xd80e('0x2b')](function(){return db[_0xd80e('0x54')][_0xd80e('0x4e')]({'where':{'id':_0x44cf88[_0xd80e('0x64')]},'raw':!![]})['then'](function(_0x46c926){return createVoicePrefixExtensions(_0x44cf88,_0x46c926,_0x314fbb);});});});})[_0xd80e('0x2b')](function(){return db['VoicePrefix'][_0xd80e('0x6e')](_0x44cf88['id']);})[_0xd80e('0x2b')](respondWithResult(_0x393fb6,null))[_0xd80e('0x4b')](handleError(_0x393fb6,null));};exports[_0xd80e('0x6f')]=function(_0x3feb77,_0x8b2fc4,_0x4a0dea){return db['VoicePrefix'][_0xd80e('0x4e')]({'where':{'id':_0x3feb77['params']['id']}})['then'](handleEntityNotFound(_0x8b2fc4,null))[_0xd80e('0x2b')](function(_0x1c830c){if(_0x1c830c){return _0x1c830c[_0xd80e('0x6f')](_0x3feb77[_0xd80e('0x53')][_0xd80e('0x70')],_[_0xd80e('0x71')](_0x3feb77[_0xd80e('0x53')],[_0xd80e('0x70'),'id'])||{})['spread'](function(_0x2d80d1){for(var _0xc5455e=0x0;_0xc5455e<_0x3feb77[_0xd80e('0x53')][_0xd80e('0x70')]['length'];_0xc5455e+=0x1){socket[_0xd80e('0x72')](_0xd80e('0x73'),{'UserId':Number(_0x3feb77['body'][_0xd80e('0x70')][_0xc5455e]),'VoicePrefixId':Number(_0x3feb77[_0xd80e('0x4f')]['id'])});}return _0x2d80d1;});}})['then'](respondWithResult(_0x8b2fc4,null))[_0xd80e('0x4b')](handleError(_0x8b2fc4,null));};exports[_0xd80e('0x74')]=function(_0x472dd3,_0x3fb194,_0x18299b){return db[_0xd80e('0x36')][_0xd80e('0x4e')]({'where':{'id':_0x472dd3[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x3fb194,null))[_0xd80e('0x2b')](function(_0x5d8e7c){if(_0x5d8e7c){return _0x5d8e7c[_0xd80e('0x74')](_0x472dd3[_0xd80e('0x3a')]['ids'])[_0xd80e('0x2b')](function(){if(_[_0xd80e('0x75')](_0x472dd3[_0xd80e('0x3a')]['ids'])){for(var _0x2090f4=0x0;_0x2090f4<_0x472dd3['query'][_0xd80e('0x70')][_0xd80e('0x4d')];_0x2090f4+=0x1){socket[_0xd80e('0x72')](_0xd80e('0x76'),{'UserId':Number(_0x472dd3[_0xd80e('0x3a')]['ids'][_0x2090f4]),'VoicePrefixId':Number(_0x472dd3[_0xd80e('0x4f')]['id'])});}}else{socket[_0xd80e('0x72')](_0xd80e('0x76'),{'UserId':Number(_0x472dd3[_0xd80e('0x3a')][_0xd80e('0x70')]),'VoicePrefixId':Number(_0x472dd3[_0xd80e('0x4f')]['id'])});}});}})[_0xd80e('0x2b')](respondWithStatusCode(_0x3fb194,null))[_0xd80e('0x4b')](handleError(_0x3fb194,null));};exports[_0xd80e('0x77')]=function(_0x28b7dc,_0x30a3d0,_0x99f183){var _0x31fd22={};var _0x1873d2={};var _0x5ddd1f;var _0x30ba45;return db['VoicePrefix']['findOne']({'where':{'id':_0x28b7dc['params']['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x30a3d0,null))[_0xd80e('0x2b')](function(_0x2d8f13){if(_0x2d8f13){_0x5ddd1f=_0x2d8f13;_0x1873d2[_0xd80e('0x39')]=_['keys'](db[_0xd80e('0x78')][_0xd80e('0x37')]);_0x1873d2[_0xd80e('0x3a')]=_['keys'](_0x28b7dc['query']);_0x1873d2[_0xd80e('0x3c')]=_['intersection'](_0x1873d2[_0xd80e('0x39')],_0x1873d2[_0xd80e('0x3a')]);_0x31fd22[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x1873d2[_0xd80e('0x39')],qs[_0xd80e('0x3f')](_0x28b7dc[_0xd80e('0x3a')]['fields']));_0x31fd22['attributes']=_0x31fd22['attributes'][_0xd80e('0x4d')]?_0x31fd22[_0xd80e('0x3e')]:_0x1873d2[_0xd80e('0x39')];_0x31fd22[_0xd80e('0x41')]=qs[_0xd80e('0x42')](_0x28b7dc[_0xd80e('0x3a')][_0xd80e('0x42')]);_0x31fd22[_0xd80e('0x43')]=qs[_0xd80e('0x3c')](_[_0xd80e('0x79')](_0x28b7dc[_0xd80e('0x3a')],_0x1873d2[_0xd80e('0x3c')]));if(_0x28b7dc[_0xd80e('0x3a')]['filter']){_0x31fd22[_0xd80e('0x43')]=_[_0xd80e('0x46')](_0x31fd22[_0xd80e('0x43')],{'$or':_[_0xd80e('0x35')](_0x31fd22[_0xd80e('0x3e')],function(_0x14ed09){var _0x34fcb2={};_0x34fcb2[_0x14ed09]={'$like':'%'+_0x28b7dc[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x34fcb2;})});}_0x31fd22=_[_0xd80e('0x46')]({},_0x31fd22,_0x28b7dc['options']);return _0x5ddd1f[_0xd80e('0x77')](_0x31fd22);}})[_0xd80e('0x2b')](function(_0x3e36e4){if(_0x3e36e4){_0x30ba45=_0x3e36e4[_0xd80e('0x4d')];if(!_0x28b7dc['query']['hasOwnProperty']('nolimit')){_0x31fd22[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x28b7dc['query'][_0xd80e('0x25')]);_0x31fd22[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x28b7dc['query'][_0xd80e('0x22')]);}return _0x5ddd1f['getAgents'](_0x31fd22);}})[_0xd80e('0x2b')](function(_0x247ebc){if(_0x247ebc){return _0x247ebc?{'count':_0x30ba45,'rows':_0x247ebc}:null;}})['then'](respondWithResult(_0x30a3d0,null))[_0xd80e('0x4b')](handleError(_0x30a3d0,null));};exports[_0xd80e('0x7a')]=function(_0x273551,_0x3d0f54,_0x511baa){var _0x366559={};var _0x494718={};var _0x120907;var _0x39721f;return db[_0xd80e('0x36')][_0xd80e('0x7b')]({'where':{'id':_0x273551[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](handleEntityNotFound(_0x3d0f54,null))[_0xd80e('0x2b')](function(_0x23514b){if(_0x23514b){_0x120907=_0x23514b;_0x494718[_0xd80e('0x39')]=_[_0xd80e('0x3b')](db[_0xd80e('0x7c')]['rawAttributes']);_0x494718['query']=_['keys'](_0x273551[_0xd80e('0x3a')]);_0x494718[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x494718[_0xd80e('0x39')],_0x494718[_0xd80e('0x3a')]);_0x366559[_0xd80e('0x3e')]=_[_0xd80e('0x3d')](_0x494718[_0xd80e('0x39')],qs['fields'](_0x273551[_0xd80e('0x3a')]['fields']));_0x366559[_0xd80e('0x3e')]=_0x366559[_0xd80e('0x3e')][_0xd80e('0x4d')]?_0x366559['attributes']:_0x494718[_0xd80e('0x39')];_0x366559['order']=qs[_0xd80e('0x42')](_0x273551['query'][_0xd80e('0x42')]);_0x366559[_0xd80e('0x43')]=qs['filters'](_['pick'](_0x273551[_0xd80e('0x3a')],_0x494718[_0xd80e('0x3c')]));if(_0x273551[_0xd80e('0x3a')][_0xd80e('0x45')]){_0x366559[_0xd80e('0x43')]=_[_0xd80e('0x46')](_0x366559[_0xd80e('0x43')],{'$or':_['map'](_0x366559[_0xd80e('0x3e')],function(_0x5c8d28){var _0x33afc6={};_0x33afc6[_0x5c8d28]={'$like':'%'+_0x273551[_0xd80e('0x3a')][_0xd80e('0x45')]+'%'};return _0x33afc6;})});}_0x366559=_[_0xd80e('0x46')]({},_0x366559,_0x273551[_0xd80e('0x47')]);return _0x120907['getTeams'](_0x366559);}})['then'](function(_0x42e910){if(_0x42e910){_0x39721f=_0x42e910[_0xd80e('0x4d')];if(!_0x273551[_0xd80e('0x3a')][_0xd80e('0x40')](_0xd80e('0x7d'))){_0x366559[_0xd80e('0x25')]=qs[_0xd80e('0x25')](_0x273551[_0xd80e('0x3a')][_0xd80e('0x25')]);_0x366559[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x273551[_0xd80e('0x3a')][_0xd80e('0x22')]);}return _0x120907['getTeams'](_0x366559);}})[_0xd80e('0x2b')](function(_0x54eaad){if(_0x54eaad){return _0x54eaad?{'count':_0x39721f,'rows':_0x54eaad}:null;}})[_0xd80e('0x2b')](respondWithResult(_0x3d0f54,null))[_0xd80e('0x4b')](handleError(_0x3d0f54,null));};exports[_0xd80e('0x7e')]=function(_0x3e60bf,_0x47184c,_0x53fbbd){var _0x5c108f=_0x3e60bf[_0xd80e('0x53')][_0xd80e('0x70')];var _0x4f010e;return db[_0xd80e('0x7c')][_0xd80e('0x7f')]({'where':{'id':_0x5c108f},'attributes':['id'],'include':[{'model':db[_0xd80e('0x78')],'as':_0xd80e('0x80'),'attributes':['id','name',_0xd80e('0x81'),_0xd80e('0x82'),_0xd80e('0x83')],'raw':!![]}]})[_0xd80e('0x2b')](function(_0x16737b){if(_0x16737b){_0x4f010e=_0x16737b;var _0xac3eff=_[_0xd80e('0x84')](_0x16737b,function(_0x3be383){var _0x50b24d=_0x3be383['get']({'plain':!![]});return _0x50b24d[_0xd80e('0x80')];});return db[_0xd80e('0x36')][_0xd80e('0x4e')]({'where':{'id':_0x3e60bf[_0xd80e('0x4f')]['id']}})[_0xd80e('0x2b')](function(_0x2c80ed){return db[_0xd80e('0x52')][_0xd80e('0x85')](function(_0x83a318){return _0x2c80ed[_0xd80e('0x7e')](_0x5c108f,{'transaction':_0x83a318})[_0xd80e('0x2b')](function(){return BPromise[_0xd80e('0x86')](_0x4f010e,function(_0x33e712){return db[_0xd80e('0x87')]['upsert']({'TeamId':_0x33e712['id'],'VoicePrefixId':_0x3e60bf[_0xd80e('0x4f')]['id']},{'transaction':_0x83a318});});})[_0xd80e('0x2b')](function(){return BPromise['each'](_0xac3eff,function(_0x2f90b3){return db[_0xd80e('0x88')]['findOrCreate']({'where':{'UserId':_0x2f90b3['id'],'VoicePrefixId':_0x3e60bf[_0xd80e('0x4f')]['id']},'transaction':_0x83a318});});})['then'](function(){_0xac3eff[_0xd80e('0x89')](function(_0x25455c){socket[_0xd80e('0x72')]('userVoicePrefix:save',{'UserId':_0x25455c['id'],'VoicePrefixId':_0x2c80ed['id']});});});});});}})[_0xd80e('0x2b')](respondWithStatusCode(_0x47184c,null))[_0xd80e('0x4b')](handleError(_0x47184c,null));};exports[_0xd80e('0x8a')]=function(_0x35bc9a,_0x598a2e,_0x1ba292){return db[_0xd80e('0x7c')][_0xd80e('0x7f')]({'where':{'id':_0x35bc9a[_0xd80e('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd80e('0x78')],'as':_0xd80e('0x80'),'attributes':['id'],'raw':!![]}]})[_0xd80e('0x2b')](handleEntityNotFound(_0x598a2e,null))[_0xd80e('0x2b')](function(_0x3a6e2d){var _0x4ba15d=_[_0xd80e('0x35')](_0x3a6e2d,'id');var _0x2635e9=[];var _0x21baed=[];var _0x570b33=squel['select']();_0x570b33[_0xd80e('0x8b')](_0xd80e('0x8c'))[_0xd80e('0x8d')](_0xd80e('0x8e'),'tq')[_0xd80e('0x8f')](_0xd80e('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd80e('0x43')](_0xd80e('0x91'),_0x35bc9a[_0xd80e('0x4f')]['id']);for(var _0x24c913=0x0;_0x24c913<_0x3a6e2d[_0xd80e('0x4d')];_0x24c913+=0x1){let _0x302063=_0x3a6e2d[_0x24c913];for(var _0x5a477c=0x0;_0x5a477c<_0x302063[_0xd80e('0x80')][_0xd80e('0x4d')];_0x5a477c+=0x1){let _0x54cbd5=_0x302063['Agents'][_0x5a477c];var _0x33d344=_0x570b33[_0xd80e('0x92')]();_0x33d344[_0xd80e('0x43')](_0xd80e('0x93'),_0x54cbd5['id']);_0x21baed[_0xd80e('0x67')](db[_0xd80e('0x52')][_0xd80e('0x3a')](_0x33d344[_0xd80e('0x94')](),{'type':db[_0xd80e('0x52')]['QueryTypes']['SELECT']})[_0xd80e('0x2b')](function(_0x1387b7){if(_0x1387b7[_0xd80e('0x4d')]===0x1){return _0x54cbd5['id'];}else{var _0xc8b46=_['every'](_[_0xd80e('0x35')](_0x1387b7,_0xd80e('0x95')),function(_0x13590b){return _[_0xd80e('0x96')](_0x4ba15d,_0x13590b);});if(_0xc8b46){return _0x54cbd5['id'];}}}));}}return BPromise['all'](_0x21baed)['then'](function(_0x527b34){_0x2635e9=_(_0x2635e9)[_0xd80e('0x97')](_0x527b34)[_0xd80e('0x98')]()[_0xd80e('0x99')]();return db['VoicePrefix'][_0xd80e('0x4e')]({'where':{'id':_0x35bc9a[_0xd80e('0x4f')]['id']}})['then'](function(_0x5b72de){return db[_0xd80e('0x52')][_0xd80e('0x85')](function(_0x2a46e7){return _0x5b72de[_0xd80e('0x8a')](_0x35bc9a['query'][_0xd80e('0x70')],{'transaction':_0x2a46e7})[_0xd80e('0x2b')](function(){if(!_[_0xd80e('0x9a')](_0x2635e9)){return _0x5b72de[_0xd80e('0x74')](_0x2635e9,{'transaction':_0x2a46e7});}})[_0xd80e('0x2b')](function(){_0x2635e9[_0xd80e('0x89')](function(_0x45a047){socket[_0xd80e('0x72')]('userVoicePrefix:remove',{'UserId':_0x45a047,'VoicePrefixId':_0x5b72de['id']});});});});});});})[_0xd80e('0x2b')](respondWithStatusCode(_0x598a2e,null))[_0xd80e('0x4b')](handleError(_0x598a2e,null));}; \ No newline at end of file +var _0x4fc2=['set','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoicePrefix','include','findAll','rows','catch','show','params','length','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','charAt','body','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','findOrCreate','forEach','removeTeams','User','select','field','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','includes','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','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','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','count'];(function(_0x17176e,_0x4000ad){var _0x42bf4b=function(_0x32dadb){while(--_0x32dadb){_0x17176e['push'](_0x17176e['shift']());}};_0x42bf4b(++_0x4000ad);}(_0x4fc2,0x111));var _0x24fc=function(_0x594de,_0x44f5fa){_0x594de=_0x594de-0x0;var _0x28dbf5=_0x4fc2[_0x594de];return _0x28dbf5;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];config['redis']=_[_0x24fc('0x1b')](config[_0x24fc('0x1c')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1c')]));require(_0x24fc('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a0971,_0x18c0a7){_0x18c0a7=_0x18c0a7||0xcc;return function(_0x2ffed3){if(_0x2ffed3){return _0x2a0971[_0x24fc('0x20')](_0x18c0a7);}return _0x2a0971['status'](_0x18c0a7)[_0x24fc('0x21')]();};}function respondWithResult(_0x588543,_0x4af098){_0x4af098=_0x4af098||0xc8;return function(_0x3385c7){if(_0x3385c7){return _0x588543[_0x24fc('0x22')](_0x4af098)[_0x24fc('0x23')](_0x3385c7);}};}function respondWithFilteredResult(_0x25cb40,_0x52a884){return function(_0x23873c){if(_0x23873c){var _0x1cb3d0=typeof _0x52a884[_0x24fc('0x24')]===_0x24fc('0x25')&&typeof _0x52a884['limit']===_0x24fc('0x25');var _0x4073e0=_0x23873c[_0x24fc('0x26')];var _0x5b0516=_0x1cb3d0?0x0:_0x52a884[_0x24fc('0x24')];var _0x36a771=_0x1cb3d0?_0x23873c[_0x24fc('0x26')]:_0x52a884[_0x24fc('0x24')]+_0x52a884['limit'];var _0x323beb;if(_0x36a771>=_0x4073e0){_0x36a771=_0x4073e0;_0x323beb=0xc8;}else{_0x323beb=0xce;}_0x25cb40['status'](_0x323beb);return _0x25cb40[_0x24fc('0x27')]('Content-Range',_0x5b0516+'-'+_0x36a771+'/'+_0x4073e0)[_0x24fc('0x23')](_0x23873c);}return null;};}function patchUpdates(_0x44c121){return function(_0x2ffade){try{jsonpatch['apply'](_0x2ffade,_0x44c121,!![]);}catch(_0x313a25){return BPromise['reject'](_0x313a25);}return _0x2ffade[_0x24fc('0x28')]();};}function saveUpdates(_0x2bb93a,_0x36a9b4){return function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2[_0x24fc('0x29')](_0x2bb93a)[_0x24fc('0x2a')](function(_0x3f0875){return _0x3f0875;});}return null;};}function removeEntity(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(_0x2a5c4b){return _0x2a5c4b['destroy']()[_0x24fc('0x2a')](function(){var _0x16f27f=_0x2a5c4b[_0x24fc('0x2b')]({'plain':!![]});var _0x5bb4c8=_0x24fc('0x2c');return db[_0x24fc('0x2d')][_0x24fc('0x2e')]({'where':{'type':_0x5bb4c8,'resourceId':_0x16f27f['id']}})[_0x24fc('0x2a')](function(){return _0x2a5c4b;});})[_0x24fc('0x2a')](function(){_0x20192b[_0x24fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240ae7,_0x29a461){return function(_0x3c99ed){if(!_0x3c99ed){_0x240ae7[_0x24fc('0x20')](0x194);}return _0x3c99ed;};}function handleError(_0x9f7bbc,_0x490aa5){_0x490aa5=_0x490aa5||0x1f4;return function(_0x55c27f){logger['error'](_0x55c27f[_0x24fc('0x2f')]);if(_0x55c27f['name']){delete _0x55c27f[_0x24fc('0x30')];}_0x9f7bbc[_0x24fc('0x22')](_0x490aa5)[_0x24fc('0x31')](_0x55c27f);};}exports[_0x24fc('0x32')]=function(_0x4dbd52,_0x66eec0){var _0x33f368={},_0x523c1f={},_0xf46cd5={'count':0x0,'rows':[]};var _0x1b174d=_['map'](db['VoicePrefix'][_0x24fc('0x33')],function(_0x56eae7){return{'name':_0x56eae7[_0x24fc('0x34')],'type':_0x56eae7[_0x24fc('0x35')]['key']};});_0x523c1f[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x1b174d,_0x24fc('0x30'));_0x523c1f[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x4dbd52[_0x24fc('0x38')]);_0x523c1f[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],_0x523c1f['query']);_0x33f368[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x4dbd52[_0x24fc('0x38')]['fields']));_0x33f368['attributes']=_0x33f368[_0x24fc('0x3c')]['length']?_0x33f368[_0x24fc('0x3c')]:_0x523c1f[_0x24fc('0x36')];if(!_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3e')]('nolimit')){_0x33f368[_0x24fc('0x3f')]=qs['limit'](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x33f368[_0x24fc('0x24')]=qs[_0x24fc('0x24')](_0x4dbd52[_0x24fc('0x38')]['offset']);}_0x33f368[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x41')]);_0x33f368['where']=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x4dbd52['query'],_0x523c1f[_0x24fc('0x3a')]),_0x1b174d);if(_0x4dbd52['query'][_0x24fc('0x43')]){_0x33f368[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x33f368[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x1b174d,function(_0x278b18){if(_0x278b18[_0x24fc('0x35')]!==_0x24fc('0x46')){var _0x4a18bb={};_0x4a18bb[_0x278b18[_0x24fc('0x30')]]={'$like':'%'+_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x4a18bb;}})});}_0x33f368=_['merge']({},_0x33f368,_0x4dbd52[_0x24fc('0x47')]);var _0x1e3b52={'where':_0x33f368['where']};return db[_0x24fc('0x48')][_0x24fc('0x26')](_0x1e3b52)[_0x24fc('0x2a')](function(_0x5e4e9b){_0xf46cd5[_0x24fc('0x26')]=_0x5e4e9b;if(_0x4dbd52[_0x24fc('0x38')]['includeAll']){_0x33f368[_0x24fc('0x49')]=[{'all':!![]}];}return db[_0x24fc('0x48')][_0x24fc('0x4a')](_0x33f368);})[_0x24fc('0x2a')](function(_0x4c8dad){_0xf46cd5[_0x24fc('0x4b')]=_0x4c8dad;return _0xf46cd5;})[_0x24fc('0x2a')](respondWithFilteredResult(_0x66eec0,_0x33f368))[_0x24fc('0x4c')](handleError(_0x66eec0,null));};exports[_0x24fc('0x4d')]=function(_0xbcbcfa,_0x58a950){var _0x2a27e6={'raw':![],'where':{'id':_0xbcbcfa[_0x24fc('0x4e')]['id']}},_0x1b9c90={};_0x1b9c90[_0x24fc('0x36')]=_['keys'](db[_0x24fc('0x48')][_0x24fc('0x33')]);_0x1b9c90['query']=_['keys'](_0xbcbcfa[_0x24fc('0x38')]);_0x1b9c90['filters']=_['intersection'](_0x1b9c90[_0x24fc('0x36')],_0x1b9c90['query']);_0x2a27e6[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x1b9c90[_0x24fc('0x36')],qs['fields'](_0xbcbcfa[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x2a27e6[_0x24fc('0x3c')]=_0x2a27e6[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x2a27e6[_0x24fc('0x3c')]:_0x1b9c90[_0x24fc('0x36')];if(_0xbcbcfa[_0x24fc('0x38')]['includeAll']){_0x2a27e6['include']=[{'all':!![]}];}_0x2a27e6=_[_0x24fc('0x45')]({},_0x2a27e6,_0xbcbcfa[_0x24fc('0x47')]);return db[_0x24fc('0x48')]['find'](_0x2a27e6)['then'](handleEntityNotFound(_0x58a950,null))[_0x24fc('0x2a')](respondWithResult(_0x58a950,null))[_0x24fc('0x4c')](handleError(_0x58a950,null));};exports[_0x24fc('0x2e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x134f64[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x21f8b8,null))[_0x24fc('0x2a')](removeEntity(_0x21f8b8,null))[_0x24fc('0x4c')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x51')]=function(_0x5ec1c0,_0x1c9a28){return db[_0x24fc('0x48')][_0x24fc('0x51')]()[_0x24fc('0x2a')](respondWithResult(_0x1c9a28,null))[_0x24fc('0x4c')](handleError(_0x1c9a28,null));};exports['create']=function(_0x428012,_0x4bf3a8){var _0x2c8f74;return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x41ddfb){return db[_0x24fc('0x48')][_0x24fc('0x54')](_0x428012['body'],{'transaction':_0x41ddfb})[_0x24fc('0x2a')](function(_0xc2ba88){_0x2c8f74=_0xc2ba88[_0x24fc('0x2b')]({'plain':!![]});return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0x2c8f74[_0x24fc('0x56')]},'raw':!![]})['then'](function(_0x36d500){return createVoicePrefixExtensions(_0x2c8f74,_0x36d500,_0x41ddfb);});});})[_0x24fc('0x2a')](function(){var _0x1628b4=_0x428012[_0x24fc('0x57')][_0x24fc('0x2b')]({'plain':!![]});if(!_0x1628b4)throw new Error(_0x24fc('0x58'));if(_0x1628b4[_0x24fc('0x59')]==='user'){var _0xd673f8=_0x2c8f74;return db[_0x24fc('0x5a')]['find']({'where':{'name':_0x24fc('0x2c'),'userProfileId':_0x1628b4[_0x24fc('0x5b')]},'raw':!![]})[_0x24fc('0x2a')](function(_0x2ba959){if(_0x2ba959&&_0x2ba959[_0x24fc('0x5c')]===0x0){return db[_0x24fc('0x2d')]['create']({'name':_0xd673f8[_0x24fc('0x30')],'resourceId':_0xd673f8['id'],'type':_0x2ba959['name'],'sectionId':_0x2ba959['id']},{})[_0x24fc('0x2a')](function(){return _0x2c8f74;});}else{return _0x2c8f74;}})[_0x24fc('0x4c')](function(_0x50e5b0){logger[_0x24fc('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e5b0);throw _0x50e5b0;});}return _0x2c8f74;})[_0x24fc('0x2a')](respondWithResult(_0x4bf3a8,null))['catch'](handleError(_0x4bf3a8,null));};function Extension(_0xdff811,_0x27b612,_0x57daaf,_0x2edef7){this['context']=_0x24fc('0x5e');this[_0x24fc('0x5f')]=_0xdff811;this['app']=_0x57daaf;this[_0x24fc('0x35')]=_0x24fc('0x60');this[_0x24fc('0x61')]=_0x24fc('0x62');this[_0x24fc('0x63')]=_0x27b612;this['appdata']=_0x2edef7;}function createVoicePrefixExtensions(_0x39da59,_0x2f62b0,_0x2d657a){return new BPromise(function(_0x2b5dca,_0x11d0e0){var _0x5e9c03=new Extension(formatPrefixName(_0x39da59['prefix']),0x1,_0x24fc('0x64'),_0x24fc('0x65'));_0x5e9c03['VoicePrefixId']=_0x39da59['id'];return db['VoiceExtension'][_0x24fc('0x54')](_0x5e9c03,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0x28ef6a){var _0x1c47cd=_0x28ef6a['get']({'plain':!![]});var _0x20973d=_[_0x24fc('0x37')](addVoicePrefixExtensions(_0x39da59,_0x2f62b0),function(_0x14427b){_0x14427b[_0x24fc('0x56')]=_0x1c47cd['id'];_0x14427b[_0x24fc('0x66')]=_0x39da59['id'];return _0x14427b;});return db[_0x24fc('0x55')][_0x24fc('0x67')](_0x20973d,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0xbe136e){if(!_0xbe136e){return _0x11d0e0(_0x24fc('0x68'));}else{return _0x2b5dca(_0xbe136e);}})[_0x24fc('0x4c')](function(_0x456690){return _0x11d0e0(_0x456690);});});;});};function addVoicePrefixExtensions(_0x8dbb4a,_0x24ca4b){var _0x354fc6=[];var _0x54ead5=formatPrefixName(_0x8dbb4a[_0x24fc('0x69')]);_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x2,_0x24fc('0x6b'),_0x24fc('0x6c')+_0x8dbb4a[_0x24fc('0x30')]));if(_0x8dbb4a[_0x24fc('0x6d')]){_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x6b'),'PREFIX-CALLERIDALL='+_0x8dbb4a[_0x24fc('0x6d')]));}else{_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x64'),_0x24fc('0x6e')));}_0x354fc6['push'](new Extension(_0x54ead5,0x4,_0x24fc('0x6f'),_0x24ca4b[_0x24fc('0x70')]+','+'${EXTEN:'+(0x8+_0x8dbb4a['name']['length'])+'}'+','+0x1));return _0x354fc6;}function formatPrefixName(_0x2ae2ac){var _0x698283='_';for(var _0x246ef1=0x0;_0x246ef1<_0x2ae2ac[_0x24fc('0x4f')];_0x246ef1++){if(_0x2ae2ac[_0x24fc('0x71')](_0x246ef1)=='-'){_0x698283+=_0x2ae2ac[_0x24fc('0x71')](_0x246ef1);}else{_0x698283+='['+_0x2ae2ac['charAt'](_0x246ef1)+']';}}_0x698283+='.';return _0x698283;}exports[_0x24fc('0x29')]=function(_0x15e8a3,_0x5a2c09,_0x51b1c0){var _0xfc6b7f=_0x15e8a3[_0x24fc('0x72')];_0xfc6b7f[_0x24fc('0x69')]='system-'+_0xfc6b7f[_0x24fc('0x30')]+'-';return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x4f5547){return db['VoicePrefix']['update'](_0xfc6b7f,{'where':{'id':_0xfc6b7f['id']},'transaction':_0x4f5547})['then'](function(){return db['VoiceExtension'][_0x24fc('0x2e')]({'where':{'VoicePrefixId':_0xfc6b7f['id']},'transaction':_0x4f5547})[_0x24fc('0x2a')](function(){return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0xfc6b7f['VoiceExtensionId']},'raw':!![]})[_0x24fc('0x2a')](function(_0x56dd0b){return createVoicePrefixExtensions(_0xfc6b7f,_0x56dd0b,_0x4f5547);});});});})[_0x24fc('0x2a')](function(){return db['VoicePrefix'][_0x24fc('0x73')](_0xfc6b7f['id']);})[_0x24fc('0x2a')](respondWithResult(_0x5a2c09,null))[_0x24fc('0x4c')](handleError(_0x5a2c09,null));};exports[_0x24fc('0x74')]=function(_0x3c4e2c,_0x291d60,_0x35c5f7){return db['VoicePrefix'][_0x24fc('0x50')]({'where':{'id':_0x3c4e2c[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x291d60,null))['then'](function(_0x5201e7){if(_0x5201e7){return _0x5201e7[_0x24fc('0x74')](_0x3c4e2c[_0x24fc('0x72')]['ids'],_[_0x24fc('0x75')](_0x3c4e2c[_0x24fc('0x72')],['ids','id'])||{})[_0x24fc('0x76')](function(_0x383503){for(var _0x5249ea=0x0;_0x5249ea<_0x3c4e2c[_0x24fc('0x72')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x5249ea+=0x1){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':Number(_0x3c4e2c[_0x24fc('0x72')]['ids'][_0x5249ea]),'VoicePrefixId':Number(_0x3c4e2c['params']['id'])});}return _0x383503;});}})[_0x24fc('0x2a')](respondWithResult(_0x291d60,null))['catch'](handleError(_0x291d60,null));};exports[_0x24fc('0x7a')]=function(_0x52d54e,_0x5233c5,_0x436652){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x52d54e[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x5233c5,null))[_0x24fc('0x2a')](function(_0x44eb26){if(_0x44eb26){return _0x44eb26[_0x24fc('0x7a')](_0x52d54e['query'][_0x24fc('0x77')])[_0x24fc('0x2a')](function(){if(_['isArray'](_0x52d54e['query'][_0x24fc('0x77')])){for(var _0x3cb0b5=0x0;_0x3cb0b5<_0x52d54e[_0x24fc('0x38')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x3cb0b5+=0x1){socket['emit'](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e[_0x24fc('0x38')]['ids'][_0x3cb0b5]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}}else{socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e['query'][_0x24fc('0x77')]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}});}})[_0x24fc('0x2a')](respondWithStatusCode(_0x5233c5,null))[_0x24fc('0x4c')](handleError(_0x5233c5,null));};exports[_0x24fc('0x7c')]=function(_0x1ce8cb,_0x17f88a,_0x46b320){var _0x188edb={};var _0x54f379={};var _0x7f4f80;var _0x2921a7;return db[_0x24fc('0x48')]['findOne']({'where':{'id':_0x1ce8cb['params']['id']}})['then'](handleEntityNotFound(_0x17f88a,null))[_0x24fc('0x2a')](function(_0x560c80){if(_0x560c80){_0x7f4f80=_0x560c80;_0x54f379[_0x24fc('0x36')]=_[_0x24fc('0x39')](db['User'][_0x24fc('0x33')]);_0x54f379['query']=_[_0x24fc('0x39')](_0x1ce8cb['query']);_0x54f379[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x54f379[_0x24fc('0x36')],_0x54f379[_0x24fc('0x38')]);_0x188edb[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x54f379['model'],qs[_0x24fc('0x3d')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x188edb[_0x24fc('0x3c')]=_0x188edb[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x188edb[_0x24fc('0x3c')]:_0x54f379[_0x24fc('0x36')];_0x188edb[_0x24fc('0x40')]=qs['sort'](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x41')]);_0x188edb[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_['pick'](_0x1ce8cb[_0x24fc('0x38')],_0x54f379[_0x24fc('0x3a')]));if(_0x1ce8cb[_0x24fc('0x38')]['filter']){_0x188edb[_0x24fc('0x44')]=_['merge'](_0x188edb['where'],{'$or':_['map'](_0x188edb[_0x24fc('0x3c')],function(_0x49c35c){var _0x29f1c1={};_0x29f1c1[_0x49c35c]={'$like':'%'+_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x29f1c1;})});}_0x188edb=_[_0x24fc('0x45')]({},_0x188edb,_0x1ce8cb['options']);return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x3d8394){if(_0x3d8394){_0x2921a7=_0x3d8394[_0x24fc('0x4f')];if(!_0x1ce8cb[_0x24fc('0x38')]['hasOwnProperty'](_0x24fc('0x7d'))){_0x188edb[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x1ce8cb[_0x24fc('0x38')]['limit']);_0x188edb['offset']=qs[_0x24fc('0x24')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x49e6f2){if(_0x49e6f2){return _0x49e6f2?{'count':_0x2921a7,'rows':_0x49e6f2}:null;}})[_0x24fc('0x2a')](respondWithResult(_0x17f88a,null))[_0x24fc('0x4c')](handleError(_0x17f88a,null));};exports[_0x24fc('0x7e')]=function(_0x5d5a59,_0xa8881f,_0x69a2cd){var _0x437233={};var _0x1e1474={};var _0xc52004;var _0x4c10d9;return db['VoicePrefix']['findOne']({'where':{'id':_0x5d5a59[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0xa8881f,null))[_0x24fc('0x2a')](function(_0x23a033){if(_0x23a033){_0xc52004=_0x23a033;_0x1e1474[_0x24fc('0x36')]=_[_0x24fc('0x39')](db[_0x24fc('0x7f')][_0x24fc('0x33')]);_0x1e1474[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5d5a59[_0x24fc('0x38')]);_0x1e1474[_0x24fc('0x3a')]=_['intersection'](_0x1e1474['model'],_0x1e1474[_0x24fc('0x38')]);_0x437233['attributes']=_[_0x24fc('0x3b')](_0x1e1474[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x437233[_0x24fc('0x3c')]=_0x437233[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x437233[_0x24fc('0x3c')]:_0x1e1474['model'];_0x437233[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x5d5a59['query']['sort']);_0x437233[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x5d5a59[_0x24fc('0x38')],_0x1e1474[_0x24fc('0x3a')]));if(_0x5d5a59[_0x24fc('0x38')]['filter']){_0x437233[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x437233[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x437233['attributes'],function(_0x2fb68a){var _0x10519f={};_0x10519f[_0x2fb68a]={'$like':'%'+_0x5d5a59[_0x24fc('0x38')]['filter']+'%'};return _0x10519f;})});}_0x437233=_[_0x24fc('0x45')]({},_0x437233,_0x5d5a59[_0x24fc('0x47')]);return _0xc52004[_0x24fc('0x7e')](_0x437233);}})['then'](function(_0x163a99){if(_0x163a99){_0x4c10d9=_0x163a99[_0x24fc('0x4f')];if(!_0x5d5a59['query']['hasOwnProperty'](_0x24fc('0x7d'))){_0x437233[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x437233[_0x24fc('0x24')]=qs['offset'](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0xc52004[_0x24fc('0x7e')](_0x437233);}})[_0x24fc('0x2a')](function(_0x6f8974){if(_0x6f8974){return _0x6f8974?{'count':_0x4c10d9,'rows':_0x6f8974}:null;}})[_0x24fc('0x2a')](respondWithResult(_0xa8881f,null))['catch'](handleError(_0xa8881f,null));};exports[_0x24fc('0x80')]=function(_0x4a2522,_0x5226aa,_0x260a62){var _0x19b426=_0x4a2522['body'][_0x24fc('0x77')];var _0x45e8da;return db[_0x24fc('0x7f')][_0x24fc('0x4a')]({'where':{'id':_0x19b426},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24fc('0x81'),'attributes':['id',_0x24fc('0x30'),_0x24fc('0x82'),_0x24fc('0x83'),_0x24fc('0x84')],'raw':!![]}]})[_0x24fc('0x2a')](function(_0x4e31bd){if(_0x4e31bd){_0x45e8da=_0x4e31bd;var _0x492328=_['flatMap'](_0x4e31bd,function(_0xc4f001){var _0x3fb8fc=_0xc4f001['get']({'plain':!![]});return _0x3fb8fc[_0x24fc('0x81')];});return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x4a2522['params']['id']}})[_0x24fc('0x2a')](function(_0x15dbba){return db['sequelize']['transaction'](function(_0x33c581){return _0x15dbba[_0x24fc('0x80')](_0x19b426,{'transaction':_0x33c581})[_0x24fc('0x2a')](function(){return BPromise['each'](_0x45e8da,function(_0x2e4e38){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x2e4e38['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},{'transaction':_0x33c581});});})['then'](function(){return BPromise['each'](_0x492328,function(_0x6dee4c){return db['UserVoicePrefix'][_0x24fc('0x85')]({'where':{'UserId':_0x6dee4c['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},'transaction':_0x33c581});});})[_0x24fc('0x2a')](function(){_0x492328[_0x24fc('0x86')](function(_0x4ae346){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':_0x4ae346['id'],'VoicePrefixId':_0x15dbba['id']});});});});});}})['then'](respondWithStatusCode(_0x5226aa,null))[_0x24fc('0x4c')](handleError(_0x5226aa,null));};exports[_0x24fc('0x87')]=function(_0x30d523,_0x8b1efd,_0x2a19f9){return db['Team'][_0x24fc('0x4a')]({'where':{'id':_0x30d523[_0x24fc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x24fc('0x88')],'as':_0x24fc('0x81'),'attributes':['id'],'raw':!![]}]})[_0x24fc('0x2a')](handleEntityNotFound(_0x8b1efd,null))[_0x24fc('0x2a')](function(_0x18197a){var _0x5aaa55=_[_0x24fc('0x37')](_0x18197a,'id');var _0x5d6e00=[];var _0x5c8969=[];var _0x42c158=squel[_0x24fc('0x89')]();_0x42c158[_0x24fc('0x8a')]('tq.TeamId')['from'](_0x24fc('0x8b'),'tq')[_0x24fc('0x8c')](_0x24fc('0x8d'),'ut',_0x24fc('0x8e'))[_0x24fc('0x44')](_0x24fc('0x8f'),_0x30d523[_0x24fc('0x4e')]['id']);for(var _0x1efb25=0x0;_0x1efb25<_0x18197a['length'];_0x1efb25+=0x1){let _0x5bbe2c=_0x18197a[_0x1efb25];for(var _0x316b8f=0x0;_0x316b8f<_0x5bbe2c['Agents']['length'];_0x316b8f+=0x1){let _0x1bf646=_0x5bbe2c[_0x24fc('0x81')][_0x316b8f];var _0x31c499=_0x42c158[_0x24fc('0x90')]();_0x31c499[_0x24fc('0x44')](_0x24fc('0x91'),_0x1bf646['id']);_0x5c8969[_0x24fc('0x6a')](db['sequelize'][_0x24fc('0x38')](_0x31c499[_0x24fc('0x92')](),{'type':db[_0x24fc('0x52')][_0x24fc('0x93')][_0x24fc('0x94')]})[_0x24fc('0x2a')](function(_0x3be176){if(_0x3be176[_0x24fc('0x4f')]===0x1){return _0x1bf646['id'];}else{var _0x9fd1b5=_[_0x24fc('0x95')](_[_0x24fc('0x37')](_0x3be176,_0x24fc('0x96')),function(_0x11ed4f){return _[_0x24fc('0x97')](_0x5aaa55,_0x11ed4f);});if(_0x9fd1b5){return _0x1bf646['id'];}}}));}}return BPromise[_0x24fc('0x98')](_0x5c8969)[_0x24fc('0x2a')](function(_0x29af09){_0x5d6e00=_(_0x5d6e00)[_0x24fc('0x99')](_0x29af09)[_0x24fc('0x9a')]()[_0x24fc('0x9b')]();return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x30d523[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](function(_0x219be8){return db['sequelize'][_0x24fc('0x53')](function(_0x4217f0){return _0x219be8[_0x24fc('0x87')](_0x30d523[_0x24fc('0x38')]['ids'],{'transaction':_0x4217f0})['then'](function(){if(!_['isEmpty'](_0x5d6e00)){return _0x219be8[_0x24fc('0x7a')](_0x5d6e00,{'transaction':_0x4217f0});}})['then'](function(){_0x5d6e00[_0x24fc('0x86')](function(_0x49e026){socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':_0x49e026,'VoicePrefixId':_0x219be8['id']});});});});});});})[_0x24fc('0x2a')](respondWithStatusCode(_0x8b1efd,null))[_0x24fc('0x4c')](handleError(_0x8b1efd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1f26ca7..57e37cd 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 _0x8649=['update','remove','emit','exports','events','save'];(function(_0x3d7de8,_0x2a2ec4){var _0x5e9a0c=function(_0x5b0499){while(--_0x5b0499){_0x3d7de8['push'](_0x3d7de8['shift']());}};_0x5e9a0c(++_0x2a2ec4);}(_0x8649,0x148));var _0x9864=function(_0x423047,_0x40bfda){_0x423047=_0x423047-0x0;var _0x1a0c24=_0x8649[_0x423047];return _0x1a0c24;};'use strict';var EventEmitter=require(_0x9864('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9864('0x1'),'afterUpdate':_0x9864('0x2'),'afterDestroy':_0x9864('0x3')};function emitEvent(_0x333b9b){return function(_0x23f83a,_0x519b8e,_0x2801bb){VoicePrefixEvents[_0x9864('0x4')](_0x333b9b+':'+_0x23f83a['id'],_0x23f83a);VoicePrefixEvents[_0x9864('0x4')](_0x333b9b,_0x23f83a);_0x2801bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9864('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0xc00f=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x65d044,_0x3ede47){var _0x545b56=function(_0x361fc5){while(--_0x361fc5){_0x65d044['push'](_0x65d044['shift']());}};_0x545b56(++_0x3ede47);}(_0xc00f,0x8c));var _0xfc00=function(_0x24b1ea,_0x642a66){_0x24b1ea=_0x24b1ea-0x0;var _0x1eb3b0=_0xc00f[_0x24b1ea];return _0x1eb3b0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xfc00('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc00('0x1'),'afterUpdate':_0xfc00('0x2'),'afterDestroy':_0xfc00('0x3')};function emitEvent(_0x18e4b6){return function(_0x49b528,_0x1b27be,_0x813d8b){VoicePrefixEvents['emit'](_0x18e4b6+':'+_0x49b528['id'],_0x49b528);VoicePrefixEvents[_0xfc00('0x4')](_0x18e4b6,_0x49b528);_0x813d8b(null);};}for(var e in events){if(events[_0xfc00('0x5')](e)){var event=events[e];VoicePrefix[_0xfc00('0x6')](e,emitEvent(event));}}module[_0xfc00('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 0d988bd..d9c2ee7 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 _0xd5fd=['api','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger'];(function(_0x21c5e2,_0x1f9f7a){var _0x45bd89=function(_0x20fc6c){while(--_0x20fc6c){_0x21c5e2['push'](_0x21c5e2['shift']());}};_0x45bd89(++_0x1f9f7a);}(_0xd5fd,0x195));var _0xdd5f=function(_0x4f4ef7,_0x11642b){_0x4f4ef7=_0x4f4ef7-0x0;var _0x5e3efc=_0xd5fd[_0x4f4ef7];return _0x5e3efc;};'use strict';var _=require(_0xdd5f('0x0'));var util=require(_0xdd5f('0x1'));var logger=require(_0xdd5f('0x2'))(_0xdd5f('0x3'));var moment=require(_0xdd5f('0x4'));var BPromise=require(_0xdd5f('0x5'));var rp=require(_0xdd5f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd5f('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd5f('0x8'));module['exports']=function(_0xe3032,_0x57cc68){return _0xe3032[_0xdd5f('0x9')](_0xdd5f('0xa'),attributes,{'tableName':_0xdd5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc7=['../../config/logger','api','moment','bluebird','request-promise','path','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x33a96b,_0x46a3da){var _0xa171c5=function(_0x3054a1){while(--_0x3054a1){_0x33a96b['push'](_0x33a96b['shift']());}};_0xa171c5(++_0x46a3da);}(_0x7cc7,0x8d));var _0x77cc=function(_0x167775,_0x101269){_0x167775=_0x167775-0x0;var _0x560e68=_0x7cc7[_0x167775];return _0x560e68;};'use strict';var _=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var logger=require(_0x77cc('0x2'))(_0x77cc('0x3'));var moment=require(_0x77cc('0x4'));var BPromise=require(_0x77cc('0x5'));var rp=require(_0x77cc('0x6'));var fs=require('fs');var path=require(_0x77cc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x77cc('0x8'));module[_0x77cc('0x9')]=function(_0x25f203,_0x2a2717){return _0x25f203[_0x77cc('0xa')](_0x77cc('0xb'),attributes,{'tableName':_0x77cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 808c0f7..85e05f7 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 _0xeaab=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0xeaab,0xd9));var _0xbeaa=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xeaab[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var moment=require(_0xbeaa('0x1'));var BPromise=require(_0xbeaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbeaa('0x3'))['db'];var utils=require(_0xbeaa('0x4'));var logger=require(_0xbeaa('0x5'))(_0xbeaa('0x6'));var config=require(_0xbeaa('0x7'));var jayson=require(_0xbeaa('0x8'));var client=jayson[_0xbeaa('0x9')][_0xbeaa('0xa')]({'port':0x232a});config[_0xbeaa('0xb')]=_[_0xbeaa('0xc')](config[_0xbeaa('0xb')],{'host':_0xbeaa('0xd'),'port':0x18eb});var socket=require(_0xbeaa('0xe'))(new Redis(config[_0xbeaa('0xb')]));require('./voicePrefix.socket')[_0xbeaa('0xf')](socket);function respondWithRpcPromise(_0xcefe5e,_0xdc012e,_0x3ca743){return new BPromise(function(_0x1762a1,_0x1305fc){return client[_0xbeaa('0x10')](_0xcefe5e,_0x3ca743)['then'](function(_0x18fd02){logger['info'](_0xbeaa('0x11'),_0xdc012e,_0xbeaa('0x12'));logger['debug'](_0xbeaa('0x13'),_0xdc012e,'request\x20sent',JSON[_0xbeaa('0x14')](_0x18fd02));if(_0x18fd02[_0xbeaa('0x15')]){if(_0x18fd02['error'][_0xbeaa('0x16')]===0x1f4){logger[_0xbeaa('0x15')](_0xbeaa('0x11'),_0xdc012e,_0x18fd02[_0xbeaa('0x15')][_0xbeaa('0x17')]);return _0x1305fc(_0x18fd02[_0xbeaa('0x15')][_0xbeaa('0x17')]);}logger[_0xbeaa('0x15')](_0xbeaa('0x11'),_0xdc012e,_0x18fd02[_0xbeaa('0x15')][_0xbeaa('0x17')]);return _0x1762a1(_0x18fd02[_0xbeaa('0x15')][_0xbeaa('0x17')]);}else{logger[_0xbeaa('0x18')](_0xbeaa('0x11'),_0xdc012e,_0xbeaa('0x12'));_0x1762a1(_0x18fd02[_0xbeaa('0x19')][_0xbeaa('0x17')]);}})[_0xbeaa('0x1a')](function(_0xa98958){logger[_0xbeaa('0x15')]('VoicePrefix,\x20%s,\x20%s',_0xdc012e,_0xa98958);_0x1305fc(_0xa98958);});});} \ No newline at end of file +var _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1be589,_0x40c396){_0x1be589=_0x1be589-0x0;var _0x34a3bf=_0x7a54[_0x1be589];return _0x34a3bf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 3e4f499..b746b4a 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 _0x4345=['save','update','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x38f655,_0xd2ca06){var _0x4873e7=function(_0x54b9cb){while(--_0x54b9cb){_0x38f655['push'](_0x38f655['shift']());}};_0x4873e7(++_0xd2ca06);}(_0x4345,0x77));var _0x5434=function(_0x480aa7,_0x5b1009){_0x480aa7=_0x480aa7-0x0;var _0x23816d=_0x4345[_0x480aa7];return _0x23816d;};'use strict';var VoicePrefixEvents=require(_0x5434('0x0'));var events=[_0x5434('0x1'),'remove',_0x5434('0x2')];function createListener(_0x393043,_0x38d317){return function(_0x46df60){_0x38d317['emit'](_0x393043,_0x46df60);};}function removeListener(_0x18b717,_0x4e402c){return function(){VoicePrefixEvents[_0x5434('0x3')](_0x18b717,_0x4e402c);};}exports[_0x5434('0x4')]=function(_0x14d339){for(var _0x5001cc=0x0,_0x1b26fe=events['length'];_0x5001cc<_0x1b26fe;_0x5001cc++){var _0x395e5c=events[_0x5001cc];var _0x457fe8=createListener(_0x5434('0x5')+_0x395e5c,_0x14d339);VoicePrefixEvents['on'](_0x395e5c,_0x457fe8);}}; \ No newline at end of file +var _0x5f6a=['length','./voicePrefix.events','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x218e11,_0x44c7d4){_0x218e11=_0x218e11-0x0;var _0x541e24=_0x5f6a[_0x218e11];return _0x541e24;};'use strict';var VoicePrefixEvents=require(_0xa5f6('0x0'));var events=['save','remove',_0xa5f6('0x1')];function createListener(_0x4be333,_0x2e23f3){return function(_0x1ec17a){_0x2e23f3['emit'](_0x4be333,_0x1ec17a);};}function removeListener(_0x2e8b33,_0x8e175a){return function(){VoicePrefixEvents[_0xa5f6('0x2')](_0x2e8b33,_0x8e175a);};}exports[_0xa5f6('0x3')]=function(_0xb6a42e){for(var _0x9c569c=0x0,_0x19ac7d=events[_0xa5f6('0x4')];_0x9c569c<_0x19ac7d;_0x9c569c++){var _0x2505d7=events[_0x9c569c];var _0x135782=createListener('voicePrefix:'+_0x2505d7,_0xb6a42e);VoicePrefixEvents['on'](_0x2505d7,_0x135782);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 72500e9..0374121 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 _0x8701=['removeLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','update','delete','/:id','removeTeams','removeAgents'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8701,0x136));var _0x1870=function(_0x105256,_0x4fa318){_0x105256=_0x105256-0x0;var _0x4b5a91=_0x8701[_0x105256];return _0x4b5a91;};'use strict';var multer=require(_0x1870('0x0'));var util=require(_0x1870('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1870('0x2'));var router=express[_0x1870('0x3')]();var fs_extra=require(_0x1870('0x4'));var auth=require(_0x1870('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1870('0x6'));var controller=require(_0x1870('0x7'));router[_0x1870('0x8')]('/',auth[_0x1870('0x9')](),controller[_0x1870('0xa')]);router[_0x1870('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1870('0xb')]);router[_0x1870('0x8')](_0x1870('0xc'),auth[_0x1870('0x9')](),controller[_0x1870('0xd')]);router[_0x1870('0x8')](_0x1870('0xe'),auth[_0x1870('0x9')](),controller[_0x1870('0xf')]);router[_0x1870('0x8')](_0x1870('0x10'),auth['isAuthenticated'](),controller[_0x1870('0x11')]);router[_0x1870('0x8')](_0x1870('0x12'),auth[_0x1870('0x9')](),controller['getHopperBlacks']);router['get'](_0x1870('0x13'),auth[_0x1870('0x9')](),controller[_0x1870('0x14')]);router[_0x1870('0x8')](_0x1870('0x15'),auth[_0x1870('0x9')](),controller[_0x1870('0x16')]);router[_0x1870('0x8')](_0x1870('0x17'),auth[_0x1870('0x9')](),controller[_0x1870('0x18')]);router[_0x1870('0x8')](_0x1870('0x19'),auth['isAuthenticated'](),controller[_0x1870('0x1a')]);router[_0x1870('0x8')](_0x1870('0x1b'),auth[_0x1870('0x9')](),controller[_0x1870('0x1c')]);router[_0x1870('0x1d')]('/',auth[_0x1870('0x9')](),controller[_0x1870('0x1e')]);router[_0x1870('0x1d')](_0x1870('0x1f'),auth['isAuthenticated'](),controller[_0x1870('0x20')]);router['post'](_0x1870('0x13'),auth[_0x1870('0x9')](),controller[_0x1870('0x21')]);router[_0x1870('0x1d')]('/:id/users',auth[_0x1870('0x9')](),controller[_0x1870('0x22')]);router['post'](_0x1870('0x19'),auth['isAuthenticated'](),controller[_0x1870('0x23')]);router[_0x1870('0x1d')](_0x1870('0x1b'),auth[_0x1870('0x9')](),controller[_0x1870('0x24')]);router['put']('/:id',auth[_0x1870('0x9')](),controller[_0x1870('0x25')]);router[_0x1870('0x26')](_0x1870('0x27'),auth['isAuthenticated'](),controller['destroy']);router[_0x1870('0x26')](_0x1870('0x13'),auth[_0x1870('0x9')](),controller[_0x1870('0x28')]);router[_0x1870('0x26')]('/:id/users',auth[_0x1870('0x9')](),controller[_0x1870('0x29')]);router[_0x1870('0x26')](_0x1870('0x19'),auth[_0x1870('0x9')](),controller[_0x1870('0x2a')]);router[_0x1870('0x26')](_0x1870('0x1b'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x1870('0x2b')]=router; \ No newline at end of file +var _0xc8ac=['clone','/:id/teams','addTeams','addAgents','/:id/lists','addLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0xc8ac,0x134));var _0xcc8a=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xc8ac[_0x14d896];return _0x28679a;};'use strict';var multer=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc8a('0x2'));var router=express[_0xcc8a('0x3')]();var fs_extra=require(_0xcc8a('0x4'));var auth=require(_0xcc8a('0x5'));var interaction=require(_0xcc8a('0x6'));var config=require(_0xcc8a('0x7'));var controller=require(_0xcc8a('0x8'));router[_0xcc8a('0x9')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xb')]);router['get'](_0xcc8a('0xc'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xd')]);router[_0xcc8a('0x9')](_0xcc8a('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xcc8a('0x9')](_0xcc8a('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xcc8a('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xcc8a('0x9')](_0xcc8a('0x10'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x11')]);router['get']('/:id/teams',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x12')]);router['get'](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x14')]);router['get']('/:id/members',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x15')]);router[_0xcc8a('0x9')]('/:id/lists',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x16')]);router[_0xcc8a('0x9')](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x18')]);router[_0xcc8a('0x19')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1a')]);router[_0xcc8a('0x19')](_0xcc8a('0x1b'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1c')]);router[_0xcc8a('0x19')](_0xcc8a('0x1d'),auth['isAuthenticated'](),controller[_0xcc8a('0x1e')]);router[_0xcc8a('0x19')](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1f')]);router['post'](_0xcc8a('0x20'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x21')]);router['post'](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller['addBlackLists']);router[_0xcc8a('0x22')](_0xcc8a('0xc'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x23')]);router[_0xcc8a('0x24')](_0xcc8a('0xc'),auth['isAuthenticated'](),controller[_0xcc8a('0x25')]);router[_0xcc8a('0x24')](_0xcc8a('0x1d'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x26')]);router[_0xcc8a('0x24')](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x27')]);router[_0xcc8a('0x24')](_0xcc8a('0x20'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x28')]);router['delete'](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller['removeBlackLists']);module[_0xcc8a('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 8c67bb6..d6989af 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 _0x4b68=['roundrobin','predictive','power','INTEGER','yes','all','TEXT','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','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','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0x4b68,0x129));var _0x84b6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4b68[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x84b6('0x0'));module[_0x84b6('0x1')]={'name':{'type':Sequelize[_0x84b6('0x2')],'allowNull':![],'unique':_0x84b6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x84b6('0x4')]('inbound',_0x84b6('0x5')),'allowNull':![],'defaultValue':_0x84b6('0x6')},'musiconhold':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':_0x84b6('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x84b6('0x4')]('rr',_0x84b6('0x8'),'leastrecent',_0x84b6('0x9'),'random',_0x84b6('0xa'),_0x84b6('0xb'),_0x84b6('0xc'),_0x84b6('0xd')),'allowNull':![],'defaultValue':_0x84b6('0x8'),'set':function(_0x4586c0){this['setDataValue'](_0x84b6('0xe'),_0x4586c0?_0x4586c0:_0x84b6('0xa'));},'get':function(){var _0x401671=this[_0x84b6('0xf')](_0x84b6('0x10'));var _0x4856c7=this[_0x84b6('0xf')](_0x84b6('0x11'));var _0x30e749=this['getDataValue'](_0x84b6('0xe'));if(_0x401671===_0x84b6('0x6')){return _0x30e749;}if(_0x4856c7===_0x84b6('0x12')&&_0x30e749===_0x84b6('0xa')||_0x4856c7===_0x84b6('0x12')&&_0x30e749===_0x84b6('0x13')){return _0x30e749;}if(_0x4856c7==='progressive'||_0x4856c7===_0x84b6('0x14')||_0x4856c7===_0x84b6('0x15')){return _0x30e749;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x84b6('0x16')](0xb)},'timeout':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':_0x84b6('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x84b6('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x84b6('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x84b6('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x84b6('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x84b6('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x84b6('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x84b6('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x84b6('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x84b6('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x84b6('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x84b6('0x2')]},'queue_youarenext':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x84b6('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x84b6('0x2')]},'queue_quantity1':{'type':Sequelize[_0x84b6('0x2')]},'queue_quantity2':{'type':Sequelize[_0x84b6('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x84b6('0x2')]},'queue_less_than':{'type':Sequelize[_0x84b6('0x2')]},'periodic_announce':{'type':Sequelize[_0x84b6('0x19')],'set':function(_0x554ba7){this[_0x84b6('0x1a')](_0x84b6('0x1b'),_0x554ba7?_0x554ba7[_0x84b6('0x1c')](','):[]);},'get':function(){return this[_0x84b6('0xf')](_0x84b6('0x1b'))?this[_0x84b6('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':_0x84b6('0x17'),'set':function(_0x21daed){this[_0x84b6('0x1a')](_0x84b6('0x1d'),_0x21daed?_0x21daed[_0x84b6('0x1c')](','):undefined);},'get':function(){return this[_0x84b6('0xf')]('joinempty')?this[_0x84b6('0xf')](_0x84b6('0x1d'))[_0x84b6('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':'no','set':function(_0x444729){this['setDataValue'](_0x84b6('0x1f'),_0x444729?_0x444729['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x84b6('0x1f'))?this['getDataValue'](_0x84b6('0x1f'))[_0x84b6('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x84b6('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x84b6('0x2')]},'acw':{'type':Sequelize[_0x84b6('0x20')],'defaultValue':0x0,'set':function(_0x21d087){this[_0x84b6('0x1a')]('acw',_0x21d087);if(_0x21d087){if(this['getDataValue'](_0x84b6('0x21'))<0x2){this[_0x84b6('0x1a')](_0x84b6('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x84b6('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x84b6('0x22')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x84b6('0x23'),_0x84b6('0x15'),_0x84b6('0x14'),_0x84b6('0x12')),'defaultValue':'progressive','comment':_0x84b6('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x84b6('0x25')},'dialLimitQueue':{'type':Sequelize[_0x84b6('0x16')](0x4)[_0x84b6('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x84b6('0x27')},'dialPowerLevel':{'type':Sequelize[_0x84b6('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x84b6('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x84b6('0x2a'),'dropRate'),'defaultValue':_0x84b6('0x2b'),'comment':_0x84b6('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x84b6('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x84b6('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x84b6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':_0x84b6('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x84b6('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x84b6('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x84b6('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x84b6('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x84b6('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x84b6('0x36')},'dialTimezone':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x84b6('0x37')},'dialPrefix':{'type':Sequelize[_0x84b6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x84b6('0x4')](_0x84b6('0x38'),_0x84b6('0x39'),_0x84b6('0x3a')),'defaultValue':_0x84b6('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x84b6('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x84b6('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x84b6('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x84b6('0x16')](0x9)[_0x84b6('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x84b6('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x84b6('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x84b6('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x84b6('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x84b6('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x84b6('0x16')](0x9)[_0x84b6('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x84b6('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x84b6('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x84b6('0x16')](0x9)[_0x84b6('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x84b6('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x84b6('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x84b6('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x84b6('0x43'),_0x84b6('0x44')),'defaultValue':_0x84b6('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x84b6('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x84b6('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x84b6('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x84b6('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x84b6('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x84b6('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x84b6('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x84b6('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x84b6('0x16')](0x3)[_0x84b6('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x84b6('0x16')](0x5)[_0x84b6('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x84b6('0x16')],'allowNull':!![],'comment':_0x84b6('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x84b6('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x55b08c){if(!_0x55b08c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x84b6('0x1a')](_0x84b6('0x4e'),_0x55b08c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x84b6('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x84b6('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xe7ad=['leastrecent','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','rrmemory','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','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)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','STRING','ENUM','inbound','default','ringall'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe7ad,0x1b1));var _0xde7a=function(_0x2c4346,_0xb0c6fa){_0x2c4346=_0x2c4346-0x0;var _0x1b59dd=_0xe7ad[_0x2c4346];return _0x1b59dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde7a('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x2'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':_0xde7a('0x3')},'announce':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0xde7a('0x1')]('rr',_0xde7a('0x4'),_0xde7a('0x5'),'fewestcalls','random','rrmemory',_0xde7a('0x6'),_0xde7a('0x7'),_0xde7a('0x8')),'allowNull':![],'defaultValue':_0xde7a('0x4'),'set':function(_0xdc1360){this['setDataValue'](_0xde7a('0x9'),_0xdc1360?_0xdc1360:'rrmemory');},'get':function(){var _0x12b701=this[_0xde7a('0xa')](_0xde7a('0xb'));var _0x32c70c=this[_0xde7a('0xa')](_0xde7a('0xc'));var _0x16927=this['getDataValue']('strategy');if(_0x12b701===_0xde7a('0x2')){return _0x16927;}if(_0x32c70c===_0xde7a('0xd')&&_0x16927===_0xde7a('0xe')||_0x32c70c==='booked'&&_0x16927===_0xde7a('0xf')){return _0x16927;}if(_0x32c70c===_0xde7a('0x10')||_0x32c70c===_0xde7a('0x11')||_0x32c70c===_0xde7a('0x12')){return _0x16927;}return null;}},'servicelevel':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xde7a('0x0')]},'weight':{'type':Sequelize[_0xde7a('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':_0xde7a('0x14')},'autopause':{'type':Sequelize[_0xde7a('0x1')]('yes','no',_0xde7a('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xde7a('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xde7a('0x1')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xde7a('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':_0xde7a('0x14')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xde7a('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0xde7a('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xde7a('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xde7a('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xde7a('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xde7a('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xde7a('0x0')]},'periodic_announce':{'type':Sequelize[_0xde7a('0x17')],'set':function(_0x189641){this[_0xde7a('0x18')](_0xde7a('0x19'),_0x189641?_0x189641[_0xde7a('0x1a')](','):[]);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x19'))?this[_0xde7a('0xa')](_0xde7a('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xde7a('0x14'),'set':function(_0x540419){this[_0xde7a('0x18')](_0xde7a('0x1b'),_0x540419?_0x540419[_0xde7a('0x1a')](','):undefined);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x1b'))?this[_0xde7a('0xa')]('joinempty')[_0xde7a('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'no','set':function(_0x2e6f91){this['setDataValue']('leavewhenempty',_0x2e6f91?_0x2e6f91['join'](','):undefined);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x1d'))?this[_0xde7a('0xa')](_0xde7a('0x1d'))[_0xde7a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xde7a('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xde7a('0x0')]},'description':{'type':Sequelize[_0xde7a('0x0')]},'acw':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'set':function(_0x646cfa){this['setDataValue']('acw',_0x646cfa);if(_0x646cfa){if(this['getDataValue'](_0xde7a('0x1f'))<0x2){this[_0xde7a('0x18')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xde7a('0x21'),_0xde7a('0x10'),_0xde7a('0x12'),'predictive',_0xde7a('0xd')),'defaultValue':_0xde7a('0x10'),'comment':_0xde7a('0x22')},'dialLimitChannel':{'type':Sequelize[_0xde7a('0x13')](0x4)[_0xde7a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xde7a('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde7a('0x24')},'dialPowerLevel':{'type':Sequelize[_0xde7a('0x25')](0x2)[_0xde7a('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xde7a('0x1')]('agentBusyFactor',_0xde7a('0x26')),'defaultValue':_0xde7a('0x26'),'comment':_0xde7a('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xde7a('0x25')](0x2)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xde7a('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x29')},'dialQueueOptions':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'tTxX','comment':_0xde7a('0x2a')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x2b')},'dialQueueProject':{'type':Sequelize[_0xde7a('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'comment':_0xde7a('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xde7a('0x30')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x31'),'never',_0xde7a('0x32')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x33')},'dialAMDInitialSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde7a('0x34')},'dialAMDMinWordLength':{'type':Sequelize[_0xde7a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xde7a('0x35')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xde7a('0x36')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xde7a('0x37')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xde7a('0x38')},'dialRecallInQueue':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x39')},'dialOrderByScheduledAt':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x3a'),_0xde7a('0x3b')),'defaultValue':_0xde7a('0x3a')},'dialQueueProject2':{'type':Sequelize[_0xde7a('0x0')],'comment':_0xde7a('0x3c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde7a('0x3d')},'dialCutDigit':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde7a('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x40')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x41')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x42')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x43')},'dialMachineMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x44')},'dialMachineRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde7a('0x13')],'allowNull':!![],'comment':_0xde7a('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![],'comment':_0xde7a('0x48'),'set':function(_0x258eaa){if(!_0x258eaa)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xde7a('0x18')]('mandatoryDisposition',_0x258eaa);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xde7a('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0f85a18..4d03dbf 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 _0x426c=['value','find','name','UserProfileResource','end','error','stack','send','index','map','VoiceQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','spread','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x426c,0x1dd));var _0xc426=function(_0x353247,_0x1466f9){_0x353247=_0x353247-0x0;var _0x45886e=_0x426c[_0x353247];return _0x45886e;};'use strict';var emlformat=require(_0xc426('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc426('0x1'));var jsonpatch=require(_0xc426('0x2'));var rp=require(_0xc426('0x3'));var moment=require(_0xc426('0x4'));var BPromise=require(_0xc426('0x5'));var Mustache=require(_0xc426('0x6'));var util=require(_0xc426('0x7'));var path=require(_0xc426('0x8'));var sox=require('sox');var csv=require(_0xc426('0x9'));var ejs=require(_0xc426('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc426('0xb'));var squel=require(_0xc426('0xc'));var crypto=require(_0xc426('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc426('0xe'));var toCsv=require(_0xc426('0x9'));var querystring=require(_0xc426('0xf'));var Papa=require('papaparse');var Redis=require(_0xc426('0x10'));var authService=require(_0xc426('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc426('0x12'));var licenseUtil=require(_0xc426('0x13'));var db=require(_0xc426('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xc426('0x15'),'port':0x18eb});var socket=require(_0xc426('0x16'))(new Redis(config['redis']));require(_0xc426('0x17'))['register'](socket);function respondWithStatusCode(_0x28a380,_0xec5cea){_0xec5cea=_0xec5cea||0xcc;return function(_0x348e2c){if(_0x348e2c){return _0x28a380[_0xc426('0x18')](_0xec5cea);}return _0x28a380[_0xc426('0x19')](_0xec5cea)['end']();};}function respondWithResult(_0x4e042f,_0x294497){_0x294497=_0x294497||0xc8;return function(_0xaf7496){if(_0xaf7496){return _0x4e042f['status'](_0x294497)[_0xc426('0x1a')](_0xaf7496);}};}function respondWithFilteredResult(_0x3a910c,_0x5395be){return function(_0x1f9a42){if(_0x1f9a42){var _0x3169ba=typeof _0x5395be[_0xc426('0x1b')]===_0xc426('0x1c')&&typeof _0x5395be[_0xc426('0x1d')]===_0xc426('0x1c');var _0x2d7bd1=_0x1f9a42[_0xc426('0x1e')];var _0x512cd3=_0x3169ba?0x0:_0x5395be[_0xc426('0x1b')];var _0x27581d=_0x3169ba?_0x1f9a42[_0xc426('0x1e')]:_0x5395be['offset']+_0x5395be['limit'];var _0x238321;if(_0x27581d>=_0x2d7bd1){_0x27581d=_0x2d7bd1;_0x238321=0xc8;}else{_0x238321=0xce;}_0x3a910c[_0xc426('0x19')](_0x238321);return _0x3a910c[_0xc426('0x1f')]('Content-Range',_0x512cd3+'-'+_0x27581d+'/'+_0x2d7bd1)['json'](_0x1f9a42);}return null;};}function patchUpdates(_0x33caa4){return function(_0x55599a){try{jsonpatch['apply'](_0x55599a,_0x33caa4,!![]);}catch(_0x23f0a7){return BPromise[_0xc426('0x20')](_0x23f0a7);}return _0x55599a['save']();};}function saveUpdates(_0x27829c,_0x2e79aa){return function(_0x3b1508){if(_0x3b1508){return _0x3b1508['update'](_0x27829c)[_0xc426('0x21')](function(_0x407dd6){return _0x407dd6;});}return null;};}function removeEntity(_0x367347,_0x165265){return function(_0x5e69e8){if(_0x5e69e8){return _0x5e69e8[_0xc426('0x22')]()[_0xc426('0x21')](function(){var _0x2bcb1f=_0x5e69e8[_0xc426('0x23')]({'plain':!![]});var _0x42f326=[{'name':_0xc426('0x24'),'value':_0xc426('0x25'),'ignore':![]},{'name':_0xc426('0x26'),'value':_0xc426('0x27'),'ignore':![]}];var _0xa6bde3=_(_0x42f326)[_0xc426('0x28')](_0xc426('0x29'))['map']('value')[_0xc426('0x2a')]();if(_['includes'](_0xa6bde3,_0x2bcb1f['type'])){return;}var _0x559c63=_[_0xc426('0x2b')](_0x42f326,[_0xc426('0x2a'),_0x2bcb1f['type']])[_0xc426('0x2c')];return db[_0xc426('0x2d')][_0xc426('0x22')]({'where':{'type':_0x559c63,'resourceId':_0x2bcb1f['id']}})[_0xc426('0x21')](function(){return _0x5e69e8;});})[_0xc426('0x21')](function(){_0x367347[_0xc426('0x19')](0xcc)[_0xc426('0x2e')]();});}};}function handleEntityNotFound(_0x173125,_0x17ce89){return function(_0x29053e){if(!_0x29053e){_0x173125['sendStatus'](0x194);}return _0x29053e;};}function handleError(_0x3037cb,_0x32aae1){_0x32aae1=_0x32aae1||0x1f4;return function(_0x1d9639){logger[_0xc426('0x2f')](_0x1d9639[_0xc426('0x30')]);if(_0x1d9639[_0xc426('0x2c')]){delete _0x1d9639[_0xc426('0x2c')];}_0x3037cb['status'](_0x32aae1)[_0xc426('0x31')](_0x1d9639);};}exports[_0xc426('0x32')]=function(_0x4619d7,_0x15cdb5){var _0x2e92f1={},_0xb4bb5e={},_0x1db6d5={'count':0x0,'rows':[]};var _0x1dcb37=_[_0xc426('0x33')](db[_0xc426('0x34')][_0xc426('0x35')],function(_0x161d16){return{'name':_0x161d16['fieldName'],'type':_0x161d16[_0xc426('0x36')][_0xc426('0x37')]};});_0xb4bb5e[_0xc426('0x38')]=_[_0xc426('0x33')](_0x1dcb37,'name');_0xb4bb5e[_0xc426('0x39')]=_['keys'](_0x4619d7[_0xc426('0x39')]);_0xb4bb5e[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0xb4bb5e['model'],_0xb4bb5e['query']);_0x2e92f1[_0xc426('0x3c')]=_['intersection'](_0xb4bb5e[_0xc426('0x38')],qs[_0xc426('0x3d')](_0x4619d7[_0xc426('0x39')][_0xc426('0x3d')]));_0x2e92f1['attributes']=_0x2e92f1[_0xc426('0x3c')][_0xc426('0x3e')]?_0x2e92f1['attributes']:_0xb4bb5e[_0xc426('0x38')];if(!_0x4619d7['query']['hasOwnProperty'](_0xc426('0x3f'))){_0x2e92f1['limit']=qs['limit'](_0x4619d7[_0xc426('0x39')]['limit']);_0x2e92f1['offset']=qs[_0xc426('0x1b')](_0x4619d7['query'][_0xc426('0x1b')]);}_0x2e92f1[_0xc426('0x40')]=qs[_0xc426('0x41')](_0x4619d7['query'][_0xc426('0x41')]);_0x2e92f1[_0xc426('0x42')]=qs[_0xc426('0x3a')](_['pick'](_0x4619d7[_0xc426('0x39')],_0xb4bb5e[_0xc426('0x3a')]),_0x1dcb37);if(_0x4619d7[_0xc426('0x39')]['filter']){_0x2e92f1[_0xc426('0x42')]=_['merge'](_0x2e92f1[_0xc426('0x42')],{'$or':_[_0xc426('0x33')](_0x1dcb37,function(_0x30822e){if(_0x30822e[_0xc426('0x36')]!=='VIRTUAL'){var _0x2cecb5={};_0x2cecb5[_0x30822e['name']]={'$like':'%'+_0x4619d7[_0xc426('0x39')][_0xc426('0x28')]+'%'};return _0x2cecb5;}})});}_0x2e92f1=_[_0xc426('0x43')]({},_0x2e92f1,_0x4619d7[_0xc426('0x44')]);var _0xbe208c={'where':_0x2e92f1[_0xc426('0x42')]};return db[_0xc426('0x34')][_0xc426('0x1e')](_0xbe208c)['then'](function(_0x17ed2e){_0x1db6d5[_0xc426('0x1e')]=_0x17ed2e;if(_0x4619d7[_0xc426('0x39')][_0xc426('0x45')]){_0x2e92f1[_0xc426('0x46')]=[{'all':!![]}];}return db[_0xc426('0x34')][_0xc426('0x47')](_0x2e92f1);})[_0xc426('0x21')](function(_0x36ee57){_0x1db6d5[_0xc426('0x48')]=_0x36ee57;return _0x1db6d5;})[_0xc426('0x21')](respondWithFilteredResult(_0x15cdb5,_0x2e92f1))[_0xc426('0x49')](handleError(_0x15cdb5,null));};exports[_0xc426('0x4a')]=function(_0x18d838,_0x199af8){var _0x349907={'raw':![],'where':{'id':_0x18d838[_0xc426('0x4b')]['id']}},_0x236380={};_0x236380[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x34')][_0xc426('0x35')]);_0x236380[_0xc426('0x39')]=_[_0xc426('0x4c')](_0x18d838['query']);_0x236380[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x236380[_0xc426('0x38')],_0x236380[_0xc426('0x39')]);_0x349907[_0xc426('0x3c')]=_['intersection'](_0x236380[_0xc426('0x38')],qs['fields'](_0x18d838[_0xc426('0x39')]['fields']));_0x349907[_0xc426('0x3c')]=_0x349907[_0xc426('0x3c')][_0xc426('0x3e')]?_0x349907['attributes']:_0x236380[_0xc426('0x38')];if(_0x18d838[_0xc426('0x39')][_0xc426('0x45')]){_0x349907[_0xc426('0x46')]=[{'all':!![]}];}_0x349907=_[_0xc426('0x43')]({},_0x349907,_0x18d838['options']);return db['VoiceQueue'][_0xc426('0x2b')](_0x349907)[_0xc426('0x21')](handleEntityNotFound(_0x199af8,null))[_0xc426('0x21')](respondWithResult(_0x199af8,null))['catch'](handleError(_0x199af8,null));};exports[_0xc426('0x4d')]=function(_0x382684,_0x3e3bc0){return db[_0xc426('0x34')][_0xc426('0x4d')](_0x382684['body'],{})[_0xc426('0x21')](function(_0x18fe6f){var _0x5be19c=_0x382684[_0xc426('0x4e')][_0xc426('0x23')]({'plain':!![]});if(!_0x5be19c)throw new Error(_0xc426('0x4f'));if(_0x5be19c['role']===_0xc426('0x4e')){var _0x2b817d=_0x18fe6f[_0xc426('0x23')]({'plain':!![]});var _0x41824d=[{'name':_0xc426('0x24'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xc426('0x27')}];var _0x46bce2=_[_0xc426('0x2b')](_0x41824d,[_0xc426('0x2a'),_0x2b817d[_0xc426('0x36')]])[_0xc426('0x2c')];return db[_0xc426('0x50')][_0xc426('0x2b')]({'where':{'name':_0x46bce2,'userProfileId':_0x5be19c['userProfileId']},'raw':!![]})['then'](function(_0x4dd59e){if(_0x4dd59e&&_0x4dd59e['autoAssociation']===0x0){return db[_0xc426('0x2d')][_0xc426('0x4d')]({'name':_0x2b817d[_0xc426('0x2c')],'resourceId':_0x2b817d['id'],'type':_0x4dd59e['name'],'sectionId':_0x4dd59e['id']},{})[_0xc426('0x21')](function(){return _0x18fe6f;});}else{return _0x18fe6f;}})[_0xc426('0x49')](function(_0x1893a0){logger[_0xc426('0x2f')](_0xc426('0x51'),_0x1893a0);throw _0x1893a0;});}return _0x18fe6f;})['then'](respondWithResult(_0x3e3bc0,0xc9))['catch'](handleError(_0x3e3bc0,null));};exports['clone']=function(_0x5f4e4a,_0x5efa0a){var _0xe5ba7f={'where':{'id':_0x5f4e4a['params']['id']}},_0x4b14ed={};_0x4b14ed[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x34')][_0xc426('0x35')]);_0xe5ba7f[_0xc426('0x3c')]=_['intersection'](_0x4b14ed['model'],qs[_0xc426('0x3d')](_0x5f4e4a['query'][_0xc426('0x3d')]));_0xe5ba7f[_0xc426('0x3c')]=_0xe5ba7f[_0xc426('0x3c')][_0xc426('0x3e')]?_0xe5ba7f[_0xc426('0x3c')]:_0x4b14ed[_0xc426('0x38')];if(_0x5f4e4a[_0xc426('0x39')][_0xc426('0x45')]){_0xe5ba7f[_0xc426('0x46')]=[{'all':!![]}];}_0xe5ba7f=_[_0xc426('0x43')]({},_0xe5ba7f,_0x5f4e4a['options']);return db[_0xc426('0x34')][_0xc426('0x2b')](_0xe5ba7f)[_0xc426('0x21')](handleEntityNotFound(_0x5efa0a,null))[_0xc426('0x21')](function(_0x510f00){if(_0x510f00){var _0x355cc6=_0x510f00[_0xc426('0x23')]({'plain':!![]});_0x355cc6=qs[_0xc426('0x52')](_0x355cc6,['id',_0xc426('0x53'),'updatedAt']);_0x5f4e4a[_0xc426('0x54')]=_[_0xc426('0x52')](_0x5f4e4a[_0xc426('0x54')],['id',_0xc426('0x53'),_0xc426('0x55')]);return db[_0xc426('0x34')][_0xc426('0x4d')](_['merge'](_0x355cc6,_0x5f4e4a[_0xc426('0x54')]),{'include':_0x5f4e4a[_0xc426('0x39')][_0xc426('0x45')]?[{'all':!![]}]:undefined})[_0xc426('0x21')](function(_0x48d88e){var _0x30fef2=_0x5f4e4a[_0xc426('0x4e')][_0xc426('0x23')]({'plain':!![]});if(!_0x30fef2)throw new Error(_0xc426('0x4f'));if(_0x30fef2['role']===_0xc426('0x4e')){var _0xdb35ff=_0x48d88e['get']({'plain':!![]});var _0x207b2c=[{'name':_0xc426('0x24'),'value':_0xc426('0x25')},{'name':_0xc426('0x26'),'value':_0xc426('0x27')}];var _0x16d294=_['find'](_0x207b2c,[_0xc426('0x2a'),_0xdb35ff[_0xc426('0x36')]])['name'];return db['UserProfileSection'][_0xc426('0x2b')]({'where':{'name':_0x16d294,'userProfileId':_0x30fef2[_0xc426('0x56')]},'raw':!![]})['then'](function(_0x499621){if(_0x499621&&_0x499621['autoAssociation']===0x0){return db[_0xc426('0x2d')][_0xc426('0x4d')]({'name':_0xdb35ff['name'],'resourceId':_0xdb35ff['id'],'type':_0x499621[_0xc426('0x2c')],'sectionId':_0x499621['id']},{})[_0xc426('0x21')](function(){return _0x48d88e;});}else{return _0x48d88e;}})[_0xc426('0x49')](function(_0x513e6f){logger[_0xc426('0x2f')](_0xc426('0x51'),_0x513e6f);throw _0x513e6f;});}return _0x48d88e;});}})[_0xc426('0x21')](respondWithResult(_0x5efa0a,0xc9))[_0xc426('0x49')](handleError(_0x5efa0a,null));};exports['update']=function(_0x247090,_0x25d398){if(_0x247090['body']['id']){delete _0x247090[_0xc426('0x54')]['id'];}return db['VoiceQueue'][_0xc426('0x2b')]({'where':{'id':_0x247090['params']['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x25d398,null))['then'](saveUpdates(_0x247090[_0xc426('0x54')],null))[_0xc426('0x21')](respondWithResult(_0x25d398,null))[_0xc426('0x49')](handleError(_0x25d398,null));};exports[_0xc426('0x22')]=function(_0x4f22b8,_0x468f38){return db['VoiceQueue'][_0xc426('0x2b')]({'where':{'id':_0x4f22b8[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x468f38,null))[_0xc426('0x21')](removeEntity(_0x468f38,null))[_0xc426('0x49')](handleError(_0x468f38,null));};exports[_0xc426('0x57')]=function(_0x5a6acb,_0x4aeff1,_0x57cb28){var _0x1c7244={'raw':![],'where':{}};var _0x467b3c={};var _0xd80b58={'count':0x0,'rows':[]};return db[_0xc426('0x34')][_0xc426('0x58')]({'where':{'id':_0x5a6acb[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x4aeff1,null))['then'](function(_0x419b71){if(_0x419b71){_0x467b3c[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x59')][_0xc426('0x35')]);_0x467b3c['query']=_[_0xc426('0x4c')](_0x5a6acb[_0xc426('0x39')]);_0x467b3c[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x467b3c[_0xc426('0x38')],_0x467b3c['query']);_0x1c7244[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x467b3c[_0xc426('0x38')],qs['fields'](_0x5a6acb[_0xc426('0x39')][_0xc426('0x3d')]));_0x1c7244['attributes']=_0x1c7244[_0xc426('0x3c')]['length']?_0x1c7244[_0xc426('0x3c')]:_0x467b3c[_0xc426('0x38')];if(!_0x5a6acb['query'][_0xc426('0x5a')](_0xc426('0x3f'))){_0x1c7244[_0xc426('0x1d')]=qs[_0xc426('0x1d')](_0x5a6acb[_0xc426('0x39')][_0xc426('0x1d')]);_0x1c7244[_0xc426('0x1b')]=qs[_0xc426('0x1b')](_0x5a6acb['query'][_0xc426('0x1b')]);}_0x1c7244[_0xc426('0x40')]=qs[_0xc426('0x41')](_0x5a6acb[_0xc426('0x39')][_0xc426('0x41')]);_0x1c7244[_0xc426('0x42')]=qs['filters'](_['pick'](_0x5a6acb[_0xc426('0x39')],_0x467b3c[_0xc426('0x3a')]));_0x1c7244[_0xc426('0x42')][_0xc426('0x5b')]=_0x419b71['id'];if(_0x5a6acb[_0xc426('0x39')][_0xc426('0x28')]){_0x1c7244[_0xc426('0x42')]=_['merge'](_0x1c7244['where'],{'$or':_[_0xc426('0x33')](_0x1c7244[_0xc426('0x3c')],function(_0x260f4d){var _0x32e605={};_0x32e605[_0x260f4d]={'$like':'%'+_0x5a6acb['query'][_0xc426('0x28')]+'%'};return _0x32e605;})});}_0x1c7244=_[_0xc426('0x43')]({},_0x1c7244,_0x5a6acb[_0xc426('0x44')]);return db['CmHopper'][_0xc426('0x1e')]({'where':_0x1c7244[_0xc426('0x42')]})['then'](function(_0x560426){_0xd80b58[_0xc426('0x1e')]=_0x560426;if(_0x5a6acb[_0xc426('0x39')]['includeAll']){_0x1c7244['include']=[{'all':!![]}];}return db[_0xc426('0x59')]['findAll'](_0x1c7244);})[_0xc426('0x21')](function(_0x456009){_0xd80b58[_0xc426('0x48')]=_0x456009;return _0xd80b58;});}})[_0xc426('0x21')](respondWithFilteredResult(_0x4aeff1,_0x1c7244))[_0xc426('0x49')](handleError(_0x4aeff1,null));};exports['getHopperHistories']=function(_0x2661ee,_0x5be28c,_0x1bfb59){var _0x4f9a92={'raw':!![],'where':{}};var _0x45f3d4={};var _0x4c7d11={'count':0x0,'rows':[]};return db[_0xc426('0x34')]['findOne']({'where':{'id':_0x2661ee['params']['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x5be28c,null))[_0xc426('0x21')](function(_0x49e586){if(_0x49e586){_0x45f3d4['model']=_[_0xc426('0x4c')](db[_0xc426('0x5c')][_0xc426('0x35')]);_0x45f3d4[_0xc426('0x39')]=_[_0xc426('0x4c')](_0x2661ee[_0xc426('0x39')]);_0x45f3d4[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x45f3d4[_0xc426('0x38')],_0x45f3d4[_0xc426('0x39')]);_0x4f9a92[_0xc426('0x3c')]=_['intersection'](_0x45f3d4[_0xc426('0x38')],qs[_0xc426('0x3d')](_0x2661ee[_0xc426('0x39')][_0xc426('0x3d')]));_0x4f9a92[_0xc426('0x3c')]=_0x4f9a92[_0xc426('0x3c')][_0xc426('0x3e')]?_0x4f9a92[_0xc426('0x3c')]:_0x45f3d4[_0xc426('0x38')];if(!_0x2661ee[_0xc426('0x39')][_0xc426('0x5a')](_0xc426('0x3f'))){_0x4f9a92[_0xc426('0x1d')]=qs[_0xc426('0x1d')](_0x2661ee['query'][_0xc426('0x1d')]);_0x4f9a92['offset']=qs[_0xc426('0x1b')](_0x2661ee[_0xc426('0x39')]['offset']);}_0x4f9a92[_0xc426('0x40')]=qs[_0xc426('0x41')](_0x2661ee['query'][_0xc426('0x41')]);_0x4f9a92[_0xc426('0x42')]=qs[_0xc426('0x3a')](_[_0xc426('0x5d')](_0x2661ee[_0xc426('0x39')],_0x45f3d4['filters']));_0x4f9a92['where']['VoiceQueueId']=_0x49e586['id'];if(_0x2661ee[_0xc426('0x39')][_0xc426('0x28')]){_0x4f9a92[_0xc426('0x42')]=_['merge'](_0x4f9a92[_0xc426('0x42')],{'$or':_['map'](_0x4f9a92[_0xc426('0x3c')],function(_0x578769){var _0x549d50={};_0x549d50[_0x578769]={'$like':'%'+_0x2661ee[_0xc426('0x39')][_0xc426('0x28')]+'%'};return _0x549d50;})});}_0x4f9a92=_[_0xc426('0x43')]({},_0x4f9a92,_0x2661ee[_0xc426('0x44')]);return db[_0xc426('0x5c')][_0xc426('0x1e')]({'where':_0x4f9a92[_0xc426('0x42')]})[_0xc426('0x21')](function(_0x181547){_0x4c7d11[_0xc426('0x1e')]=_0x181547;if(_0x2661ee['query'][_0xc426('0x45')]){_0x4f9a92[_0xc426('0x46')]=[{'all':!![]}];}return db[_0xc426('0x5c')][_0xc426('0x47')](_0x4f9a92);})['then'](function(_0x29174c){_0x4c7d11[_0xc426('0x48')]=_0x29174c;return _0x4c7d11;});}})['then'](respondWithFilteredResult(_0x5be28c,_0x4f9a92))[_0xc426('0x49')](handleError(_0x5be28c,null));};exports[_0xc426('0x5e')]=function(_0xf983,_0x4ad3d1,_0x3ace10){var _0x94ecdc={'raw':!![],'where':{}};var _0x1e1a43={};var _0x26bb5f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc426('0x58')]({'where':{'id':_0xf983[_0xc426('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ad3d1,null))[_0xc426('0x21')](function(_0x3519e4){if(_0x3519e4){_0x1e1a43[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x5f')][_0xc426('0x35')]);_0x1e1a43[_0xc426('0x39')]=_['keys'](_0xf983[_0xc426('0x39')]);_0x1e1a43[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x1e1a43[_0xc426('0x38')],_0x1e1a43['query']);_0x94ecdc[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x1e1a43[_0xc426('0x38')],qs[_0xc426('0x3d')](_0xf983[_0xc426('0x39')][_0xc426('0x3d')]));_0x94ecdc['attributes']=_0x94ecdc['attributes'][_0xc426('0x3e')]?_0x94ecdc['attributes']:_0x1e1a43[_0xc426('0x38')];if(!_0xf983['query'][_0xc426('0x5a')](_0xc426('0x3f'))){_0x94ecdc[_0xc426('0x1d')]=qs[_0xc426('0x1d')](_0xf983[_0xc426('0x39')][_0xc426('0x1d')]);_0x94ecdc[_0xc426('0x1b')]=qs[_0xc426('0x1b')](_0xf983[_0xc426('0x39')][_0xc426('0x1b')]);}_0x94ecdc[_0xc426('0x40')]=qs['sort'](_0xf983[_0xc426('0x39')][_0xc426('0x41')]);_0x94ecdc[_0xc426('0x42')]=qs[_0xc426('0x3a')](_[_0xc426('0x5d')](_0xf983[_0xc426('0x39')],_0x1e1a43['filters']));_0x94ecdc['where'][_0xc426('0x5b')]=_0x3519e4['id'];if(_0xf983['query']['filter']){_0x94ecdc[_0xc426('0x42')]=_['merge'](_0x94ecdc['where'],{'$or':_['map'](_0x94ecdc[_0xc426('0x3c')],function(_0x49151e){var _0x46e443={};_0x46e443[_0x49151e]={'$like':'%'+_0xf983[_0xc426('0x39')][_0xc426('0x28')]+'%'};return _0x46e443;})});}_0x94ecdc=_[_0xc426('0x43')]({},_0x94ecdc,_0xf983['options']);return db['CmHopperFinal'][_0xc426('0x1e')]({'where':_0x94ecdc[_0xc426('0x42')]})['then'](function(_0x5a3f87){_0x26bb5f['count']=_0x5a3f87;if(_0xf983[_0xc426('0x39')]['includeAll']){_0x94ecdc[_0xc426('0x46')]=[{'all':!![]}];}return db[_0xc426('0x5f')][_0xc426('0x47')](_0x94ecdc);})[_0xc426('0x21')](function(_0x341e5c){_0x26bb5f[_0xc426('0x48')]=_0x341e5c;return _0x26bb5f;});}})[_0xc426('0x21')](respondWithFilteredResult(_0x4ad3d1,_0x94ecdc))[_0xc426('0x49')](handleError(_0x4ad3d1,null));};exports['getHopperBlacks']=function(_0x395d33,_0xe58314,_0x426e38){var _0x1fe0cd={'raw':!![],'where':{}};var _0x28a508={};var _0x212ec4={'count':0x0,'rows':[]};return db[_0xc426('0x34')][_0xc426('0x58')]({'where':{'id':_0x395d33[_0xc426('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe58314,null))[_0xc426('0x21')](function(_0x15f81f){if(_0x15f81f){_0x28a508[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x60')][_0xc426('0x35')]);_0x28a508[_0xc426('0x39')]=_[_0xc426('0x4c')](_0x395d33[_0xc426('0x39')]);_0x28a508[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x28a508[_0xc426('0x38')],_0x28a508[_0xc426('0x39')]);_0x1fe0cd[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x28a508['model'],qs[_0xc426('0x3d')](_0x395d33[_0xc426('0x39')][_0xc426('0x3d')]));_0x1fe0cd[_0xc426('0x3c')]=_0x1fe0cd[_0xc426('0x3c')][_0xc426('0x3e')]?_0x1fe0cd['attributes']:_0x28a508['model'];if(!_0x395d33[_0xc426('0x39')][_0xc426('0x5a')](_0xc426('0x3f'))){_0x1fe0cd[_0xc426('0x1d')]=qs[_0xc426('0x1d')](_0x395d33[_0xc426('0x39')][_0xc426('0x1d')]);_0x1fe0cd['offset']=qs[_0xc426('0x1b')](_0x395d33['query'][_0xc426('0x1b')]);}_0x1fe0cd['order']=qs[_0xc426('0x41')](_0x395d33[_0xc426('0x39')]['sort']);_0x1fe0cd[_0xc426('0x42')]=qs['filters'](_[_0xc426('0x5d')](_0x395d33[_0xc426('0x39')],_0x28a508['filters']));_0x1fe0cd[_0xc426('0x42')][_0xc426('0x5b')]=_0x15f81f['id'];if(_0x395d33[_0xc426('0x39')]['filter']){_0x1fe0cd[_0xc426('0x42')]=_[_0xc426('0x43')](_0x1fe0cd['where'],{'$or':_['map'](_0x1fe0cd['attributes'],function(_0x18930d){var _0x102805={};_0x102805[_0x18930d]={'$like':'%'+_0x395d33['query'][_0xc426('0x28')]+'%'};return _0x102805;})});}_0x1fe0cd=_[_0xc426('0x43')]({},_0x1fe0cd,_0x395d33[_0xc426('0x44')]);return db['CmHopperBlack']['count']({'where':_0x1fe0cd[_0xc426('0x42')]})['then'](function(_0x245e50){_0x212ec4[_0xc426('0x1e')]=_0x245e50;if(_0x395d33[_0xc426('0x39')][_0xc426('0x45')]){_0x1fe0cd[_0xc426('0x46')]=[{'all':!![]}];}return db[_0xc426('0x60')][_0xc426('0x47')](_0x1fe0cd);})[_0xc426('0x21')](function(_0x51d3b6){_0x212ec4[_0xc426('0x48')]=_0x51d3b6;return _0x212ec4;});}})[_0xc426('0x21')](respondWithFilteredResult(_0xe58314,_0x1fe0cd))[_0xc426('0x49')](handleError(_0xe58314,null));};exports[_0xc426('0x61')]=function(_0x1c1bf2,_0x4846ca,_0x181f21){var _0x3cb877={};var _0x332a0a={};var _0x216ad4;var _0x8e7ef5;return db[_0xc426('0x34')][_0xc426('0x58')]({'where':{'id':_0x1c1bf2[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x4846ca,null))[_0xc426('0x21')](function(_0x42f812){if(_0x42f812){_0x216ad4=_0x42f812;_0x332a0a[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x62')][_0xc426('0x35')]);_0x332a0a[_0xc426('0x39')]=_[_0xc426('0x4c')](_0x1c1bf2['query']);_0x332a0a['filters']=_[_0xc426('0x3b')](_0x332a0a[_0xc426('0x38')],_0x332a0a[_0xc426('0x39')]);_0x3cb877[_0xc426('0x3c')]=_['intersection'](_0x332a0a['model'],qs[_0xc426('0x3d')](_0x1c1bf2['query']['fields']));_0x3cb877[_0xc426('0x3c')]=_0x3cb877[_0xc426('0x3c')][_0xc426('0x3e')]?_0x3cb877['attributes']:_0x332a0a[_0xc426('0x38')];_0x3cb877[_0xc426('0x40')]=qs['sort'](_0x1c1bf2[_0xc426('0x39')][_0xc426('0x41')]);_0x3cb877['where']=qs['filters'](_[_0xc426('0x5d')](_0x1c1bf2[_0xc426('0x39')],_0x332a0a[_0xc426('0x3a')]));if(_0x1c1bf2[_0xc426('0x39')][_0xc426('0x28')]){_0x3cb877[_0xc426('0x42')]=_[_0xc426('0x43')](_0x3cb877[_0xc426('0x42')],{'$or':_['map'](_0x3cb877[_0xc426('0x3c')],function(_0x4bf814){var _0x44aea6={};_0x44aea6[_0x4bf814]={'$like':'%'+_0x1c1bf2[_0xc426('0x39')]['filter']+'%'};return _0x44aea6;})});}_0x3cb877=_['merge']({},_0x3cb877,_0x1c1bf2[_0xc426('0x44')]);return _0x216ad4['getTeams'](_0x3cb877);}})[_0xc426('0x21')](function(_0x575d45){if(_0x575d45){_0x8e7ef5=_0x575d45[_0xc426('0x3e')];if(!_0x1c1bf2[_0xc426('0x39')][_0xc426('0x5a')]('nolimit')){_0x3cb877[_0xc426('0x1d')]=qs['limit'](_0x1c1bf2[_0xc426('0x39')][_0xc426('0x1d')]);_0x3cb877[_0xc426('0x1b')]=qs[_0xc426('0x1b')](_0x1c1bf2[_0xc426('0x39')][_0xc426('0x1b')]);}return _0x216ad4['getTeams'](_0x3cb877);}})['then'](function(_0x3c95ee){if(_0x3c95ee){return _0x3c95ee?{'count':_0x8e7ef5,'rows':_0x3c95ee}:null;}})['then'](respondWithResult(_0x4846ca,null))[_0xc426('0x49')](handleError(_0x4846ca,null));};exports[_0xc426('0x63')]=function(_0x39b953,_0x51f63d,_0x13c08f){var _0x4ef1f0=_0x39b953[_0xc426('0x54')][_0xc426('0x64')];var _0xd26c37=_[_0xc426('0x33')](_0x4ef1f0,'id');return db[_0xc426('0x62')][_0xc426('0x47')]({'where':{'id':_0xd26c37},'attributes':['id'],'include':[{'model':db[_0xc426('0x65')],'as':_0xc426('0x66'),'attributes':['id',_0xc426('0x2c'),'online',_0xc426('0x67'),_0xc426('0x68')],'raw':!![]}]})[_0xc426('0x21')](function(_0x31336f){if(_0x31336f){var _0x483e26=_[_0xc426('0x69')](_0x31336f,function(_0x1e8bf2){var _0x427c2a=_0x1e8bf2['get']({'plain':!![]});_0x427c2a[_0xc426('0x66')][_0xc426('0x6a')](function(_0x1d90e3){_0x1d90e3['penalty']=_[_0xc426('0x2b')](_0x4ef1f0,{'id':_0x427c2a['id']})[_0xc426('0x6b')];});return _0x427c2a[_0xc426('0x66')];});return db[_0xc426('0x34')][_0xc426('0x2b')]({'where':{'id':_0x39b953[_0xc426('0x4b')]['id']}})['then'](function(_0x4c9de0){return db[_0xc426('0x6c')][_0xc426('0x6d')](function(_0x989869){return _0x4c9de0[_0xc426('0x63')](_0xd26c37,{'transaction':_0x989869})[_0xc426('0x21')](function(){return BPromise[_0xc426('0x6e')](_0x4ef1f0,function(_0x2a9742){return db[_0xc426('0x6f')][_0xc426('0x70')]({'TeamId':_0x2a9742['id'],'VoiceQueueId':_0x39b953[_0xc426('0x4b')]['id'],'penalty':_0x2a9742[_0xc426('0x6b')]},{'transaction':_0x989869});});})[_0xc426('0x21')](function(){return BPromise[_0xc426('0x6e')](_0x483e26,function(_0x5ef2cd){return db[_0xc426('0x71')]['findOrCreate']({'where':{'UserId':_0x5ef2cd['id'],'VoiceQueueId':_0x39b953['params']['id']},'defaults':{'penalty':_0x5ef2cd[_0xc426('0x6b')]},'transaction':_0x989869});});})[_0xc426('0x21')](function(){return BPromise[_0xc426('0x6e')](_[_0xc426('0x28')](_0x483e26,{'online':!![]}),function(_0x2ff36c){return db['UserVoiceQueueRt']['upsert']({'membername':_0x2ff36c[_0xc426('0x2c')],'UserId':_0x2ff36c['id'],'queue_name':_0x4c9de0['name'],'VoiceQueueId':_0x4c9de0['id'],'interface':_['isNil'](_0x2ff36c[_0xc426('0x68')])?util[_0xc426('0x72')](_0xc426('0x73'),_0x2ff36c[_0xc426('0x2c')]):_0x2ff36c['interface'],'paused':_0x2ff36c['voicePause']||![],'penalty':_0x2ff36c[_0xc426('0x6b')]},{'transaction':_0x989869});});})['then'](function(){_0x483e26[_0xc426('0x6a')](function(_0x5aea8b){socket['emit'](_0xc426('0x74'),{'UserId':_0x5aea8b['id'],'VoiceQueueId':_0x4c9de0['id']});});});});});}})[_0xc426('0x21')](respondWithStatusCode(_0x51f63d,null))[_0xc426('0x49')](handleError(_0x51f63d,null));};exports[_0xc426('0x75')]=function(_0x2b59b2,_0x40e088,_0x298429){return db[_0xc426('0x62')][_0xc426('0x47')]({'where':{'id':_0x2b59b2['query'][_0xc426('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc426('0x21')](handleEntityNotFound(_0x40e088,null))[_0xc426('0x21')](function(_0x49d57e){var _0x4260cd=_['map'](_0x49d57e,'id');var _0x24cc18=[];var _0x3eeb14=[];var _0x3536f5=squel['select']();_0x3536f5[_0xc426('0x77')](_0xc426('0x78'))[_0xc426('0x79')](_0xc426('0x7a'),'tq')[_0xc426('0x7b')](_0xc426('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc426('0x42')]('VoiceQueueId\x20=\x20?',_0x2b59b2[_0xc426('0x4b')]['id']);for(var _0x59085f=0x0;_0x59085f<_0x49d57e[_0xc426('0x3e')];_0x59085f+=0x1){let _0x5243cd=_0x49d57e[_0x59085f];for(var _0x110d5c=0x0;_0x110d5c<_0x5243cd['Agents']['length'];_0x110d5c+=0x1){let _0x25cc69=_0x5243cd[_0xc426('0x66')][_0x110d5c];var _0x1cfb04=_0x3536f5['clone']();_0x1cfb04[_0xc426('0x42')](_0xc426('0x7d'),_0x25cc69['id']);_0x3eeb14['push'](db[_0xc426('0x6c')][_0xc426('0x39')](_0x1cfb04[_0xc426('0x7e')](),{'type':db[_0xc426('0x6c')][_0xc426('0x7f')][_0xc426('0x80')]})[_0xc426('0x21')](function(_0x471b5d){if(_0x471b5d['length']===0x1){return _0x25cc69['id'];}else{var _0x59e62d=_['every'](_[_0xc426('0x33')](_0x471b5d,'TeamId'),function(_0xd4e7be){return _['includes'](_0x4260cd,_0xd4e7be);});if(_0x59e62d){return _0x25cc69['id'];}}}));}}return BPromise[_0xc426('0x81')](_0x3eeb14)[_0xc426('0x21')](function(_0x380d90){_0x24cc18=_(_0x24cc18)[_0xc426('0x82')](_0x380d90)[_0xc426('0x83')]()[_0xc426('0x2a')]();return db[_0xc426('0x34')][_0xc426('0x2b')]({'where':{'id':_0x2b59b2[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](function(_0x5e0e71){return db[_0xc426('0x6c')]['transaction'](function(_0x1c671d){return _0x5e0e71['removeTeams'](_0x2b59b2['query']['ids'],{'transaction':_0x1c671d})[_0xc426('0x21')](function(){if(!_[_0xc426('0x84')](_0x24cc18)){return _0x5e0e71[_0xc426('0x85')](_0x24cc18,{'transaction':_0x1c671d})[_0xc426('0x21')](function(){return db[_0xc426('0x86')][_0xc426('0x22')]({'where':{'VoiceQueueId':_0x2b59b2[_0xc426('0x4b')]['id'],'UserId':_0x24cc18},'transaction':_0x1c671d});});}})[_0xc426('0x21')](function(){_0x24cc18[_0xc426('0x6a')](function(_0x2e931f){socket[_0xc426('0x87')](_0xc426('0x88'),{'UserId':_0x2e931f,'VoiceQueueId':_0x5e0e71['id']});});});});});});})[_0xc426('0x21')](respondWithStatusCode(_0x40e088,null))['catch'](handleError(_0x40e088,null));};exports['addAgents']=function(_0x43efbc,_0x2cfd56,_0x4a9d76){var _0x35dafb,_0x3347b8;return db[_0xc426('0x34')]['find']({'where':{'id':_0x43efbc[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x2cfd56,null))['then'](function(_0x3e930d){if(_0x3e930d){_0x3347b8=_0x3e930d;return _0x3e930d[_0xc426('0x89')](_0x43efbc[_0xc426('0x54')][_0xc426('0x76')],_[_0xc426('0x52')](_0x43efbc[_0xc426('0x54')],['ids','id'])||{})[_0xc426('0x8a')](function(_0x2d003a){for(var _0x1171b5=0x0;_0x1171b5<_0x43efbc['body'][_0xc426('0x76')]['length'];_0x1171b5+=0x1){socket[_0xc426('0x87')](_0xc426('0x74'),{'UserId':Number(_0x43efbc[_0xc426('0x54')][_0xc426('0x76')][_0x1171b5]),'VoiceQueueId':Number(_0x43efbc['params']['id'])});}return _0x2d003a;});}})['then'](function(_0x19b941){_0x35dafb=_0x19b941||[];if(_0x3347b8){return db[_0xc426('0x65')]['findAll']({'where':{'id':_0x43efbc['body'][_0xc426('0x76')]},'attributes':['id',_0xc426('0x2c'),_0xc426('0x8b'),_0xc426('0x67'),_0xc426('0x68')],'raw':!![]});}})[_0xc426('0x21')](function(_0x5a92c0){if(!_['isEmpty'](_0x5a92c0)){var _0x3a711a=[];for(var _0x3f9fd2=0x0;_0x3f9fd2<_0x5a92c0[_0xc426('0x3e')];_0x3f9fd2++){if(_0x5a92c0[_0x3f9fd2]['online']){_0x3a711a['push'](db[_0xc426('0x86')][_0xc426('0x70')]({'membername':_0x5a92c0[_0x3f9fd2]['name'],'UserId':_0x5a92c0[_0x3f9fd2]['id'],'queue_name':_0x3347b8[_0xc426('0x2c')],'VoiceQueueId':_0x3347b8['id'],'interface':_['isNil'](_0x5a92c0[_0x3f9fd2]['interface'])?util[_0xc426('0x72')](_0xc426('0x73'),_0x5a92c0[_0x3f9fd2][_0xc426('0x2c')]):_0x5a92c0[_0x3f9fd2]['interface'],'paused':_0x5a92c0[_0x3f9fd2]['voicePause']||![],'penalty':_0x43efbc[_0xc426('0x54')][_0xc426('0x6b')]||0x0}));}}return BPromise[_0xc426('0x81')](_0x3a711a);}})[_0xc426('0x21')](function(){return _0x35dafb;})['then'](respondWithResult(_0x2cfd56,null))['catch'](handleError(_0x2cfd56,null));};exports['removeAgents']=function(_0x288ffd,_0x549ff6,_0x42640f){return db[_0xc426('0x34')][_0xc426('0x2b')]({'where':{'id':_0x288ffd[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x549ff6,null))[_0xc426('0x21')](function(_0x335e23){if(_0x335e23){return _0x335e23['removeAgents'](_0x288ffd['query'][_0xc426('0x76')])[_0xc426('0x21')](function(){if(_[_0xc426('0x8c')](_0x288ffd[_0xc426('0x39')][_0xc426('0x76')])){for(var _0x1b6d00=0x0;_0x1b6d00<_0x288ffd[_0xc426('0x39')]['ids'][_0xc426('0x3e')];_0x1b6d00+=0x1){socket[_0xc426('0x87')]('userVoiceQueue:remove',{'UserId':Number(_0x288ffd[_0xc426('0x39')][_0xc426('0x76')][_0x1b6d00]),'VoiceQueueId':Number(_0x288ffd[_0xc426('0x4b')]['id'])});}}else{socket['emit'](_0xc426('0x88'),{'UserId':Number(_0x288ffd[_0xc426('0x39')][_0xc426('0x76')]),'VoiceQueueId':Number(_0x288ffd[_0xc426('0x4b')]['id'])});}});}})[_0xc426('0x21')](function(_0x1eb8ea){return db[_0xc426('0x86')][_0xc426('0x22')]({'where':{'VoiceQueueId':_0x288ffd[_0xc426('0x4b')]['id'],'UserId':_0x288ffd[_0xc426('0x39')][_0xc426('0x76')]}})[_0xc426('0x21')](function(){return _0x1eb8ea;});})[_0xc426('0x21')](respondWithStatusCode(_0x549ff6,null))[_0xc426('0x49')](handleError(_0x549ff6,null));};exports[_0xc426('0x8d')]=function(_0x2a7ae3,_0x3db4e7,_0x5ca43b){var _0x2a1b35={};var _0x4e37a0={};var _0x867881;var _0x9e5a3;return db[_0xc426('0x34')]['findOne']({'where':{'id':_0x2a7ae3[_0xc426('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3db4e7,null))['then'](function(_0x92301d){if(_0x92301d){_0x867881=_0x92301d;_0x4e37a0[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x65')][_0xc426('0x35')]);_0x4e37a0[_0xc426('0x39')]=_['keys'](_0x2a7ae3[_0xc426('0x39')]);_0x4e37a0[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x4e37a0['model'],_0x4e37a0[_0xc426('0x39')]);_0x2a1b35[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x4e37a0['model'],qs['fields'](_0x2a7ae3[_0xc426('0x39')][_0xc426('0x3d')]));_0x2a1b35[_0xc426('0x3c')]=_0x2a1b35[_0xc426('0x3c')][_0xc426('0x3e')]?_0x2a1b35[_0xc426('0x3c')]:_0x4e37a0['model'];_0x2a1b35[_0xc426('0x40')]=qs[_0xc426('0x41')](_0x2a7ae3[_0xc426('0x39')][_0xc426('0x41')]);_0x2a1b35['where']=qs[_0xc426('0x3a')](_[_0xc426('0x5d')](_0x2a7ae3[_0xc426('0x39')],_0x4e37a0['filters']));if(_0x2a7ae3['query'][_0xc426('0x28')]){_0x2a1b35[_0xc426('0x42')]=_[_0xc426('0x43')](_0x2a1b35['where'],{'$or':_['map'](_0x2a1b35[_0xc426('0x3c')],function(_0x1aefcf){var _0x42113b={};_0x42113b[_0x1aefcf]={'$like':'%'+_0x2a7ae3[_0xc426('0x39')]['filter']+'%'};return _0x42113b;})});}_0x2a1b35=_[_0xc426('0x43')]({},_0x2a1b35,_0x2a7ae3[_0xc426('0x44')]);return _0x867881[_0xc426('0x8d')](_0x2a1b35);}})[_0xc426('0x21')](function(_0x705697){if(_0x705697){_0x9e5a3=_0x705697[_0xc426('0x3e')];if(!_0x2a7ae3[_0xc426('0x39')][_0xc426('0x5a')](_0xc426('0x3f'))){_0x2a1b35[_0xc426('0x1d')]=qs[_0xc426('0x1d')](_0x2a7ae3[_0xc426('0x39')][_0xc426('0x1d')]);_0x2a1b35['offset']=qs[_0xc426('0x1b')](_0x2a7ae3[_0xc426('0x39')][_0xc426('0x1b')]);}return _0x867881['getAgents'](_0x2a1b35);}})[_0xc426('0x21')](function(_0x44dd64){if(_0x44dd64){return _0x44dd64?{'count':_0x9e5a3,'rows':_0x44dd64}:null;}})['then'](respondWithResult(_0x3db4e7,null))[_0xc426('0x49')](handleError(_0x3db4e7,null));};exports[_0xc426('0x8e')]=function(_0x5490d5,_0x44942,_0x2349e3){var _0x22b8aa={};var _0x3cd5c3={};var _0x28a631;var _0x2e7b53;return db['VoiceQueue'][_0xc426('0x58')]({'where':{'id':_0x5490d5[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x44942,null))[_0xc426('0x21')](function(_0x29528a){if(_0x29528a){_0x28a631=_0x29528a;_0x3cd5c3['model']=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x3cd5c3[_0xc426('0x39')]=_['keys'](_0x5490d5['query']);_0x3cd5c3[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x3cd5c3['model'],_0x3cd5c3[_0xc426('0x39')]);_0x22b8aa[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x3cd5c3[_0xc426('0x38')],qs[_0xc426('0x3d')](_0x5490d5['query'][_0xc426('0x3d')]));_0x22b8aa[_0xc426('0x3c')]=_0x22b8aa['attributes'][_0xc426('0x3e')]?_0x22b8aa[_0xc426('0x3c')]:_0x3cd5c3['model'];_0x22b8aa[_0xc426('0x40')]=qs[_0xc426('0x41')](_0x5490d5[_0xc426('0x39')][_0xc426('0x41')]);_0x22b8aa[_0xc426('0x42')]=qs['filters'](_[_0xc426('0x5d')](_0x5490d5['query'],_0x3cd5c3[_0xc426('0x3a')]));if(_0x5490d5['query'][_0xc426('0x28')]){_0x22b8aa['where']=_['merge'](_0x22b8aa[_0xc426('0x42')],{'$or':_[_0xc426('0x33')](_0x22b8aa[_0xc426('0x3c')],function(_0x4802a8){var _0x756601={};_0x756601[_0x4802a8]={'$like':'%'+_0x5490d5['query'][_0xc426('0x28')]+'%'};return _0x756601;})});}_0x22b8aa=_[_0xc426('0x43')]({},_0x22b8aa,_0x5490d5[_0xc426('0x44')]);return _0x28a631[_0xc426('0x8e')](_0x22b8aa);}})[_0xc426('0x21')](function(_0x29791a){if(_0x29791a){_0x2e7b53=_0x29791a[_0xc426('0x3e')];if(!_0x5490d5[_0xc426('0x39')][_0xc426('0x5a')](_0xc426('0x3f'))){_0x22b8aa[_0xc426('0x1d')]=qs['limit'](_0x5490d5[_0xc426('0x39')]['limit']);_0x22b8aa['offset']=qs[_0xc426('0x1b')](_0x5490d5[_0xc426('0x39')][_0xc426('0x1b')]);}return _0x28a631[_0xc426('0x8e')](_0x22b8aa);}})['then'](function(_0x43c02e){return _0x43c02e?{'count':_0x2e7b53,'rows':_0x43c02e}:null;})[_0xc426('0x21')](respondWithResult(_0x44942,null))[_0xc426('0x49')](handleError(_0x44942,null));};exports[_0xc426('0x8f')]=function(_0x40ff6d,_0x1794b2,_0x1ca02d){var _0x5e7ef0={};var _0x3e13d0={};var _0x5463c0;var _0x2572bb;return db[_0xc426('0x34')]['findOne']({'where':{'id':_0x40ff6d['params']['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x1794b2,null))[_0xc426('0x21')](function(_0x3f2f74){if(_0x3f2f74){_0x5463c0=_0x3f2f74;_0x3e13d0[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x90')][_0xc426('0x35')]);_0x3e13d0['query']=_[_0xc426('0x4c')](_0x40ff6d[_0xc426('0x39')]);_0x3e13d0[_0xc426('0x3a')]=_['intersection'](_0x3e13d0['model'],_0x3e13d0[_0xc426('0x39')]);_0x5e7ef0[_0xc426('0x3c')]=_[_0xc426('0x3b')](_0x3e13d0[_0xc426('0x38')],qs[_0xc426('0x3d')](_0x40ff6d['query'][_0xc426('0x3d')]));_0x5e7ef0[_0xc426('0x3c')]=_0x5e7ef0[_0xc426('0x3c')][_0xc426('0x3e')]?_0x5e7ef0[_0xc426('0x3c')]:_0x3e13d0[_0xc426('0x38')];_0x5e7ef0['order']=qs['sort'](_0x40ff6d[_0xc426('0x39')]['sort']);_0x5e7ef0[_0xc426('0x42')]=qs['filters'](_[_0xc426('0x5d')](_0x40ff6d[_0xc426('0x39')],_0x3e13d0[_0xc426('0x3a')]));if(_0x40ff6d[_0xc426('0x39')][_0xc426('0x28')]){_0x5e7ef0[_0xc426('0x42')]=_[_0xc426('0x43')](_0x5e7ef0[_0xc426('0x42')],{'$or':_[_0xc426('0x33')](_0x5e7ef0['attributes'],function(_0x17c34c){var _0xef6195={};_0xef6195[_0x17c34c]={'$like':'%'+_0x40ff6d[_0xc426('0x39')][_0xc426('0x28')]+'%'};return _0xef6195;})});}_0x5e7ef0=_[_0xc426('0x43')]({},_0x5e7ef0,_0x40ff6d['options']);return _0x5463c0[_0xc426('0x8f')](_0x5e7ef0);}})[_0xc426('0x21')](function(_0x2d7c6e){if(_0x2d7c6e){_0x2572bb=_0x2d7c6e[_0xc426('0x3e')];if(!_0x40ff6d[_0xc426('0x39')]['hasOwnProperty'](_0xc426('0x3f'))){_0x5e7ef0[_0xc426('0x1d')]=qs['limit'](_0x40ff6d[_0xc426('0x39')]['limit']);_0x5e7ef0[_0xc426('0x1b')]=qs['offset'](_0x40ff6d['query'][_0xc426('0x1b')]);}return _0x5463c0[_0xc426('0x8f')](_0x5e7ef0);}})[_0xc426('0x21')](function(_0x26ef95){if(_0x26ef95){return _0x26ef95?{'count':_0x2572bb,'rows':_0x26ef95}:null;}})[_0xc426('0x21')](respondWithResult(_0x1794b2,null))[_0xc426('0x49')](handleError(_0x1794b2,null));};exports[_0xc426('0x91')]=function(_0x4da51e,_0x2cfef8,_0x510954){var _0x2cd53c,_0x311d08;return db[_0xc426('0x34')]['find']({'where':{'id':_0x4da51e[_0xc426('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cfef8,null))[_0xc426('0x21')](function(_0x4f671b){if(_0x4f671b){_0x311d08=_0x4f671b;return _0x4f671b[_0xc426('0x91')](_0x4da51e[_0xc426('0x54')][_0xc426('0x76')],_[_0xc426('0x52')](_0x4da51e['body'],[_0xc426('0x76'),'id'])||{});}return null;})[_0xc426('0x8a')](function(_0x2fc73a){var _0x517ffb;_0x2cd53c=_0x2fc73a||[];var _0x1a06f2=[];if(_0x2fc73a){for(var _0x2d1762=0x0;_0x2d1762<_0x2fc73a[_0xc426('0x3e')];_0x2d1762+=0x1){var _0x4e414f=_0x2fc73a[_0x2d1762][_0xc426('0x23')]({'plain':!![]});_0x311d08[_0xc426('0x92')]=_0x4da51e[_0xc426('0x54')][_0xc426('0x92')]?_0x4da51e[_0xc426('0x54')][_0xc426('0x92')]:_0x311d08[_0xc426('0x92')];switch(_0x311d08[_0xc426('0x92')]){case'always':_0x517ffb=squel[_0xc426('0x93')]()[_0xc426('0x94')](_0xc426('0x95'))[_0xc426('0x96')](['phone',_0xc426('0x97'),_0xc426('0x98'),_0xc426('0x99'),'VoiceQueueId','createdAt',_0xc426('0x55')],squel[_0xc426('0x9a')]()['field'](_0xc426('0x9b'),'phone')[_0xc426('0x77')](_0xc426('0x9c'),_0xc426('0x97'))['field']('id',_0xc426('0x98'))[_0xc426('0x77')](_0x4e414f[_0xc426('0x9d')][_0xc426('0x7e')](),_0xc426('0x99'))[_0xc426('0x77')](_0x4da51e[_0xc426('0x4b')]['id'][_0xc426('0x7e')](),'VoiceQueueId')['field']('NOW()','createdAt')[_0xc426('0x77')](_0xc426('0x9c'),'updatedAt')[_0xc426('0x79')](_0xc426('0x9e'))[_0xc426('0x42')](_0xc426('0x9f'))[_0xc426('0x42')](_0xc426('0xa0'),_0x4e414f[_0xc426('0x9d')][_0xc426('0x7e')]())[_0xc426('0x42')](_0xc426('0xa1'))['where'](_0xc426('0xa2'),squel[_0xc426('0x9a')]()['field'](_0xc426('0xa3'))[_0xc426('0x79')]('cm_hopper_final')['where'](_0xc426('0xa4'),_0x4da51e[_0xc426('0x4b')]['id'][_0xc426('0x7e')]()))[_0xc426('0x42')](_0xc426('0xa2'),squel[_0xc426('0x9a')]()[_0xc426('0x77')](_0xc426('0xa5'))[_0xc426('0x79')](_0xc426('0x95'))[_0xc426('0x42')]('VoiceQueueId\x20=\x20?',_0x4da51e[_0xc426('0x4b')]['id'][_0xc426('0x7e')]())))[_0xc426('0x7e')]();break;case _0xc426('0xa6'):_0x517ffb=squel[_0xc426('0x93')]()[_0xc426('0x94')]('cm_hopper')[_0xc426('0x96')]([_0xc426('0x9b'),'scheduledAt',_0xc426('0x98'),'ListId',_0xc426('0x5b'),_0xc426('0x53'),'updatedAt'],squel[_0xc426('0x9a')]()['field'](_0xc426('0x9b'),_0xc426('0x9b'))[_0xc426('0x77')](_0xc426('0x9c'),_0xc426('0x97'))[_0xc426('0x77')]('id','ContactId')['field'](_0x4e414f[_0xc426('0x9d')][_0xc426('0x7e')](),_0xc426('0x99'))[_0xc426('0x77')](_0x4da51e[_0xc426('0x4b')]['id'][_0xc426('0x7e')](),_0xc426('0x5b'))[_0xc426('0x77')](_0xc426('0x9c'),_0xc426('0x53'))[_0xc426('0x77')]('NOW()','updatedAt')['from'](_0xc426('0x9e'))[_0xc426('0x42')](_0xc426('0x9f'))[_0xc426('0x42')](_0xc426('0xa0'),_0x4e414f['CmListId'][_0xc426('0x7e')]())[_0xc426('0x42')](_0xc426('0xa1'))[_0xc426('0x42')](_0xc426('0xa2'),squel[_0xc426('0x9a')]()[_0xc426('0x77')](_0xc426('0xa5'))[_0xc426('0x79')](_0xc426('0x95'))[_0xc426('0x42')](_0xc426('0xa4'),_0x4da51e[_0xc426('0x4b')]['id']['toString']())))['toString']();break;default:_0x517ffb=squel[_0xc426('0x93')]()[_0xc426('0x94')](_0xc426('0x95'))[_0xc426('0x96')]([_0xc426('0x9b'),_0xc426('0x97'),_0xc426('0x98'),_0xc426('0x99'),_0xc426('0x5b'),_0xc426('0x53'),'updatedAt'],squel[_0xc426('0x9a')]()[_0xc426('0x77')](_0xc426('0x9b'),_0xc426('0x9b'))[_0xc426('0x77')]('NOW()','scheduledAt')[_0xc426('0x77')]('id',_0xc426('0x98'))['field'](_0x4e414f[_0xc426('0x9d')]['toString'](),_0xc426('0x99'))[_0xc426('0x77')](_0x4da51e['params']['id']['toString'](),_0xc426('0x5b'))[_0xc426('0x77')]('NOW()',_0xc426('0x53'))[_0xc426('0x77')]('NOW()','updatedAt')[_0xc426('0x79')](_0xc426('0x9e'))[_0xc426('0x42')](_0xc426('0x9f'))[_0xc426('0x42')]('ListId\x20=\x20?',_0x4e414f[_0xc426('0x9d')][_0xc426('0x7e')]())[_0xc426('0x42')](_0xc426('0xa1')))['toString']();}_0x1a06f2[_0xc426('0xa7')](db[_0xc426('0x6c')][_0xc426('0x39')](_0x517ffb));}return BPromise[_0xc426('0x81')](_0x1a06f2);}})['then'](function(){return _0x2cd53c;})[_0xc426('0x21')](respondWithResult(_0x2cfef8,null))[_0xc426('0x49')](handleError(_0x2cfef8,null));};exports['removeLists']=function(_0x2895a9,_0x5c415d,_0x420f11){return db['VoiceQueue'][_0xc426('0x2b')]({'where':{'id':_0x2895a9[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x5c415d,null))[_0xc426('0x21')](function(_0x33d586){if(_0x33d586){return _0x33d586[_0xc426('0xa8')](_0x2895a9[_0xc426('0x39')][_0xc426('0x76')]);}})[_0xc426('0x21')](function(_0x231bf5){if(_0x231bf5){return db[_0xc426('0x59')][_0xc426('0x22')]({'where':{'ListId':_0x2895a9[_0xc426('0x39')]['ids'],'VoiceQueueId':_0x2895a9['params']['id']}})[_0xc426('0x21')](function(){return _0x231bf5;});}})[_0xc426('0x21')](respondWithStatusCode(_0x5c415d,null))[_0xc426('0x49')](handleError(_0x5c415d,null));};exports[_0xc426('0xa9')]=function(_0x54d616,_0x4ae162,_0x1cf907){var _0x3c0fd2={};var _0x5ce6a8={};var _0x1f1907;var _0x37dc3b;return db[_0xc426('0x34')]['findOne']({'where':{'id':_0x54d616[_0xc426('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ae162,null))[_0xc426('0x21')](function(_0x5a22c3){if(_0x5a22c3){_0x1f1907=_0x5a22c3;_0x5ce6a8[_0xc426('0x38')]=_[_0xc426('0x4c')](db[_0xc426('0x90')]['rawAttributes']);_0x5ce6a8[_0xc426('0x39')]=_[_0xc426('0x4c')](_0x54d616['query']);_0x5ce6a8[_0xc426('0x3a')]=_[_0xc426('0x3b')](_0x5ce6a8[_0xc426('0x38')],_0x5ce6a8[_0xc426('0x39')]);_0x3c0fd2['attributes']=_[_0xc426('0x3b')](_0x5ce6a8[_0xc426('0x38')],qs[_0xc426('0x3d')](_0x54d616[_0xc426('0x39')][_0xc426('0x3d')]));_0x3c0fd2['attributes']=_0x3c0fd2[_0xc426('0x3c')]['length']?_0x3c0fd2[_0xc426('0x3c')]:_0x5ce6a8[_0xc426('0x38')];_0x3c0fd2['order']=qs['sort'](_0x54d616['query'][_0xc426('0x41')]);_0x3c0fd2[_0xc426('0x42')]=qs[_0xc426('0x3a')](_[_0xc426('0x5d')](_0x54d616[_0xc426('0x39')],_0x5ce6a8[_0xc426('0x3a')]));if(_0x54d616[_0xc426('0x39')][_0xc426('0x28')]){_0x3c0fd2[_0xc426('0x42')]=_[_0xc426('0x43')](_0x3c0fd2[_0xc426('0x42')],{'$or':_[_0xc426('0x33')](_0x3c0fd2[_0xc426('0x3c')],function(_0x81ec24){var _0x14e15a={};_0x14e15a[_0x81ec24]={'$like':'%'+_0x54d616['query']['filter']+'%'};return _0x14e15a;})});}_0x3c0fd2=_[_0xc426('0x43')]({},_0x3c0fd2,_0x54d616[_0xc426('0x44')]);return _0x1f1907[_0xc426('0xa9')](_0x3c0fd2);}})[_0xc426('0x21')](function(_0x4f49c7){if(_0x4f49c7){_0x37dc3b=_0x4f49c7['length'];if(!_0x54d616[_0xc426('0x39')][_0xc426('0x5a')](_0xc426('0x3f'))){_0x3c0fd2['limit']=qs['limit'](_0x54d616[_0xc426('0x39')][_0xc426('0x1d')]);_0x3c0fd2[_0xc426('0x1b')]=qs[_0xc426('0x1b')](_0x54d616[_0xc426('0x39')][_0xc426('0x1b')]);}return _0x1f1907[_0xc426('0xa9')](_0x3c0fd2);}})['then'](function(_0x236ac0){if(_0x236ac0){return _0x236ac0?{'count':_0x37dc3b,'rows':_0x236ac0}:null;}})[_0xc426('0x21')](respondWithResult(_0x4ae162,null))[_0xc426('0x49')](handleError(_0x4ae162,null));};exports['addBlackLists']=function(_0x48880e,_0x27f317,_0x2b6b97){var _0x217e11,_0x2f0527;return db[_0xc426('0x34')][_0xc426('0x2b')]({'where':{'id':_0x48880e[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x27f317,null))[_0xc426('0x21')](function(_0x19d547){if(_0x19d547){_0x2f0527=_0x19d547;return _0x19d547[_0xc426('0xaa')](_0x48880e['body'][_0xc426('0x76')],_[_0xc426('0x52')](_0x48880e[_0xc426('0x54')],[_0xc426('0x76'),'id'])||{});}return null;})[_0xc426('0x8a')](function(_0x9d3168){var _0x4e6c69;_0x217e11=_0x9d3168||[];var _0x33da34=[];if(_0x9d3168){for(var _0x3bdf05=0x0;_0x3bdf05<_0x9d3168[_0xc426('0x3e')];_0x3bdf05+=0x1){var _0x2ebf98=_0x9d3168[_0x3bdf05][_0xc426('0x23')]({'plain':!![]});_0x4e6c69=squel[_0xc426('0x93')]()[_0xc426('0x94')](_0xc426('0xab'))[_0xc426('0x96')]([_0xc426('0x9b'),_0xc426('0x98'),_0xc426('0x99'),'VoiceQueueId',_0xc426('0x53'),_0xc426('0x55')],squel['select']()[_0xc426('0x77')](_0xc426('0x9b'),'phone')[_0xc426('0x77')]('id',_0xc426('0x98'))[_0xc426('0x77')](_0x2ebf98[_0xc426('0x9d')][_0xc426('0x7e')](),_0xc426('0x99'))[_0xc426('0x77')](_0x48880e['params']['id'][_0xc426('0x7e')](),_0xc426('0x5b'))['field'](_0xc426('0x9c'),_0xc426('0x53'))[_0xc426('0x77')](_0xc426('0x9c'),_0xc426('0x55'))[_0xc426('0x79')](_0xc426('0x9e'))[_0xc426('0x42')](_0xc426('0x9f'))['where']('ListId\x20=\x20?',_0x2ebf98['CmListId'][_0xc426('0x7e')]())[_0xc426('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0xc426('0x7e')]();_0x33da34[_0xc426('0xa7')](db[_0xc426('0x6c')][_0xc426('0x39')](_0x4e6c69));}return BPromise['all'](_0x33da34);}})[_0xc426('0x21')](function(){return _0x217e11;})['then'](respondWithResult(_0x27f317,null))[_0xc426('0x49')](handleError(_0x27f317,null));};exports[_0xc426('0xac')]=function(_0x1c63af,_0x1bdf87,_0x1de8d5){return db[_0xc426('0x34')][_0xc426('0x2b')]({'where':{'id':_0x1c63af[_0xc426('0x4b')]['id']}})[_0xc426('0x21')](handleEntityNotFound(_0x1bdf87,null))[_0xc426('0x21')](function(_0x46ca20){if(_0x46ca20){return _0x46ca20[_0xc426('0xac')](_0x1c63af[_0xc426('0x39')]['ids']);}})['then'](function(_0x197a94){if(_0x197a94){return db[_0xc426('0x60')][_0xc426('0x22')]({'where':{'ListId':_0x1c63af[_0xc426('0x39')]['ids'],'VoiceQueueId':_0x1c63af['params']['id']}})['then'](function(){return _0x197a94;});}})[_0xc426('0x21')](respondWithStatusCode(_0x1bdf87,null))[_0xc426('0x49')](handleError(_0x1bdf87,null));}; \ No newline at end of file +var _0x0905=['role','VoiceQueues','outbound','UserProfileSection','UserProfileResource','error','clone','omit','body','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','nolimit','order','pick','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','flatMap','forEach','penalty','transaction','addTeams','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','interface','voicePause','emit','userVoiceQueue:save','ids','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','inbound','QueueCampaigns','value','type','find','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','VoiceQueue','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5900f7,_0x2cc78d){var _0xb09d2a=function(_0x3af23e){while(--_0x3af23e){_0x5900f7['push'](_0x5900f7['shift']());}};_0xb09d2a(++_0x2cc78d);}(_0x0905,0x11a));var _0x5090=function(_0x256fb2,_0x1b3364){_0x256fb2=_0x256fb2-0x0;var _0x3dd360=_0x0905[_0x256fb2];return _0x3dd360;};'use strict';var emlformat=require(_0x5090('0x0'));var rimraf=require(_0x5090('0x1'));var zipdir=require(_0x5090('0x2'));var jsonpatch=require(_0x5090('0x3'));var rp=require(_0x5090('0x4'));var moment=require(_0x5090('0x5'));var BPromise=require(_0x5090('0x6'));var Mustache=require(_0x5090('0x7'));var util=require(_0x5090('0x8'));var path=require(_0x5090('0x9'));var sox=require('sox');var csv=require(_0x5090('0xa'));var ejs=require(_0x5090('0xb'));var fs=require('fs');var fs_extra=require(_0x5090('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5090('0xd'));var jsforce=require(_0x5090('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5090('0xa'));var querystring=require(_0x5090('0xf'));var Papa=require(_0x5090('0x10'));var Redis=require('ioredis');var authService=require(_0x5090('0x11'));var qs=require(_0x5090('0x12'));var as=require(_0x5090('0x13'));var hardwareService=require(_0x5090('0x14'));var logger=require('../../config/logger')(_0x5090('0x15'));var utils=require('../../config/utils');var config=require(_0x5090('0x16'));var licenseUtil=require(_0x5090('0x17'));var db=require(_0x5090('0x18'))['db'];config[_0x5090('0x19')]=_[_0x5090('0x1a')](config[_0x5090('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5090('0x1b'))(new Redis(config[_0x5090('0x19')]));require(_0x5090('0x1c'))['register'](socket);function respondWithStatusCode(_0x91a6e2,_0x2611db){_0x2611db=_0x2611db||0xcc;return function(_0x3082dc){if(_0x3082dc){return _0x91a6e2[_0x5090('0x1d')](_0x2611db);}return _0x91a6e2[_0x5090('0x1e')](_0x2611db)[_0x5090('0x1f')]();};}function respondWithResult(_0x473e30,_0x12979c){_0x12979c=_0x12979c||0xc8;return function(_0x308958){if(_0x308958){return _0x473e30['status'](_0x12979c)[_0x5090('0x20')](_0x308958);}};}function respondWithFilteredResult(_0x1d9486,_0x3a59ce){return function(_0x52ed38){if(_0x52ed38){var _0x5ee8da=typeof _0x3a59ce[_0x5090('0x21')]==='undefined'&&typeof _0x3a59ce[_0x5090('0x22')]==='undefined';var _0x42fba3=_0x52ed38[_0x5090('0x23')];var _0x1bbbe6=_0x5ee8da?0x0:_0x3a59ce[_0x5090('0x21')];var _0x1d5bf4=_0x5ee8da?_0x52ed38[_0x5090('0x23')]:_0x3a59ce['offset']+_0x3a59ce[_0x5090('0x22')];var _0x10b134;if(_0x1d5bf4>=_0x42fba3){_0x1d5bf4=_0x42fba3;_0x10b134=0xc8;}else{_0x10b134=0xce;}_0x1d9486[_0x5090('0x1e')](_0x10b134);return _0x1d9486['set'](_0x5090('0x24'),_0x1bbbe6+'-'+_0x1d5bf4+'/'+_0x42fba3)[_0x5090('0x20')](_0x52ed38);}return null;};}function patchUpdates(_0x1a9226){return function(_0x3b764d){try{jsonpatch[_0x5090('0x25')](_0x3b764d,_0x1a9226,!![]);}catch(_0x3cff02){return BPromise[_0x5090('0x26')](_0x3cff02);}return _0x3b764d[_0x5090('0x27')]();};}function saveUpdates(_0x32d3b2,_0x332667){return function(_0x5796ea){if(_0x5796ea){return _0x5796ea[_0x5090('0x28')](_0x32d3b2)[_0x5090('0x29')](function(_0x5504fb){return _0x5504fb;});}return null;};}function removeEntity(_0x217349,_0x1d9b26){return function(_0x53b20f){if(_0x53b20f){return _0x53b20f[_0x5090('0x2a')]()[_0x5090('0x29')](function(){var _0x4bbdf8=_0x53b20f[_0x5090('0x2b')]({'plain':!![]});var _0x2993d9=[{'name':'VoiceQueues','value':_0x5090('0x2c'),'ignore':![]},{'name':_0x5090('0x2d'),'value':'outbound','ignore':![]}];var _0x31cdfb=_(_0x2993d9)['filter']('ignore')['map']('value')[_0x5090('0x2e')]();if(_['includes'](_0x31cdfb,_0x4bbdf8[_0x5090('0x2f')])){return;}var _0x581b30=_[_0x5090('0x30')](_0x2993d9,['value',_0x4bbdf8[_0x5090('0x2f')]])[_0x5090('0x31')];return db['UserProfileResource']['destroy']({'where':{'type':_0x581b30,'resourceId':_0x4bbdf8['id']}})['then'](function(){return _0x53b20f;});})[_0x5090('0x29')](function(){_0x217349[_0x5090('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c4,_0x255af3){return function(_0x4a2ac0){if(!_0x4a2ac0){_0x45c4[_0x5090('0x1d')](0x194);}return _0x4a2ac0;};}function handleError(_0x1c4777,_0xcb8da6){_0xcb8da6=_0xcb8da6||0x1f4;return function(_0x520ecf){logger['error'](_0x520ecf['stack']);if(_0x520ecf[_0x5090('0x31')]){delete _0x520ecf['name'];}_0x1c4777[_0x5090('0x1e')](_0xcb8da6)[_0x5090('0x32')](_0x520ecf);};}exports[_0x5090('0x33')]=function(_0x516806,_0x213044){var _0x17fb2b={},_0x54f30d={},_0x5de55a={'count':0x0,'rows':[]};var _0x2dda23=_['map'](db['VoiceQueue'][_0x5090('0x34')],function(_0x3168b0){return{'name':_0x3168b0[_0x5090('0x35')],'type':_0x3168b0[_0x5090('0x2f')]['key']};});_0x54f30d[_0x5090('0x36')]=_[_0x5090('0x37')](_0x2dda23,_0x5090('0x31'));_0x54f30d['query']=_['keys'](_0x516806[_0x5090('0x38')]);_0x54f30d[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x54f30d['model'],_0x54f30d[_0x5090('0x38')]);_0x17fb2b['attributes']=_[_0x5090('0x3a')](_0x54f30d[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x516806['query'][_0x5090('0x3b')]));_0x17fb2b['attributes']=_0x17fb2b[_0x5090('0x3c')][_0x5090('0x3d')]?_0x17fb2b[_0x5090('0x3c')]:_0x54f30d[_0x5090('0x36')];if(!_0x516806[_0x5090('0x38')][_0x5090('0x3e')]('nolimit')){_0x17fb2b[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x516806[_0x5090('0x38')][_0x5090('0x22')]);_0x17fb2b[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x516806[_0x5090('0x38')]['offset']);}_0x17fb2b['order']=qs[_0x5090('0x3f')](_0x516806[_0x5090('0x38')][_0x5090('0x3f')]);_0x17fb2b[_0x5090('0x40')]=qs['filters'](_['pick'](_0x516806[_0x5090('0x38')],_0x54f30d[_0x5090('0x39')]),_0x2dda23);if(_0x516806['query'][_0x5090('0x41')]){_0x17fb2b['where']=_[_0x5090('0x42')](_0x17fb2b[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x2dda23,function(_0x2a3284){if(_0x2a3284[_0x5090('0x2f')]!==_0x5090('0x43')){var _0x4b6510={};_0x4b6510[_0x2a3284['name']]={'$like':'%'+_0x516806[_0x5090('0x38')]['filter']+'%'};return _0x4b6510;}})});}_0x17fb2b=_[_0x5090('0x42')]({},_0x17fb2b,_0x516806['options']);var _0xf2defd={'where':_0x17fb2b[_0x5090('0x40')]};return db['VoiceQueue']['count'](_0xf2defd)[_0x5090('0x29')](function(_0x18ac9f){_0x5de55a[_0x5090('0x23')]=_0x18ac9f;if(_0x516806[_0x5090('0x38')][_0x5090('0x44')]){_0x17fb2b[_0x5090('0x45')]=[{'all':!![]}];}return db['VoiceQueue'][_0x5090('0x46')](_0x17fb2b);})['then'](function(_0x599716){_0x5de55a[_0x5090('0x47')]=_0x599716;return _0x5de55a;})[_0x5090('0x29')](respondWithFilteredResult(_0x213044,_0x17fb2b))[_0x5090('0x48')](handleError(_0x213044,null));};exports['show']=function(_0x34a3ef,_0x5a9d40){var _0x1ba08c={'raw':![],'where':{'id':_0x34a3ef[_0x5090('0x49')]['id']}},_0xc09421={};_0xc09421['model']=_[_0x5090('0x4a')](db[_0x5090('0x4b')][_0x5090('0x34')]);_0xc09421[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x34a3ef[_0x5090('0x38')]);_0xc09421['filters']=_[_0x5090('0x3a')](_0xc09421[_0x5090('0x36')],_0xc09421[_0x5090('0x38')]);_0x1ba08c[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0xc09421[_0x5090('0x36')],qs['fields'](_0x34a3ef['query']['fields']));_0x1ba08c[_0x5090('0x3c')]=_0x1ba08c['attributes'][_0x5090('0x3d')]?_0x1ba08c[_0x5090('0x3c')]:_0xc09421['model'];if(_0x34a3ef['query'][_0x5090('0x44')]){_0x1ba08c[_0x5090('0x45')]=[{'all':!![]}];}_0x1ba08c=_[_0x5090('0x42')]({},_0x1ba08c,_0x34a3ef[_0x5090('0x4c')]);return db[_0x5090('0x4b')][_0x5090('0x30')](_0x1ba08c)[_0x5090('0x29')](handleEntityNotFound(_0x5a9d40,null))[_0x5090('0x29')](respondWithResult(_0x5a9d40,null))[_0x5090('0x48')](handleError(_0x5a9d40,null));};exports[_0x5090('0x4d')]=function(_0x1856b6,_0x5741c8){return db[_0x5090('0x4b')]['create'](_0x1856b6['body'],{})[_0x5090('0x29')](function(_0x45f4ab){var _0x26b78c=_0x1856b6[_0x5090('0x4e')][_0x5090('0x2b')]({'plain':!![]});if(!_0x26b78c)throw new Error(_0x5090('0x4f'));if(_0x26b78c[_0x5090('0x50')]==='user'){var _0x2bec34=_0x45f4ab[_0x5090('0x2b')]({'plain':!![]});var _0x65db88=[{'name':_0x5090('0x51'),'value':_0x5090('0x2c')},{'name':_0x5090('0x2d'),'value':_0x5090('0x52')}];var _0x5be266=_[_0x5090('0x30')](_0x65db88,['value',_0x2bec34[_0x5090('0x2f')]])['name'];return db[_0x5090('0x53')][_0x5090('0x30')]({'where':{'name':_0x5be266,'userProfileId':_0x26b78c['userProfileId']},'raw':!![]})[_0x5090('0x29')](function(_0x3c94f4){if(_0x3c94f4&&_0x3c94f4['autoAssociation']===0x0){return db[_0x5090('0x54')][_0x5090('0x4d')]({'name':_0x2bec34[_0x5090('0x31')],'resourceId':_0x2bec34['id'],'type':_0x3c94f4[_0x5090('0x31')],'sectionId':_0x3c94f4['id']},{})[_0x5090('0x29')](function(){return _0x45f4ab;});}else{return _0x45f4ab;}})[_0x5090('0x48')](function(_0x31d3f4){logger[_0x5090('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31d3f4);throw _0x31d3f4;});}return _0x45f4ab;})[_0x5090('0x29')](respondWithResult(_0x5741c8,0xc9))[_0x5090('0x48')](handleError(_0x5741c8,null));};exports[_0x5090('0x56')]=function(_0x45a2cd,_0x46422f){var _0x3bd964={'where':{'id':_0x45a2cd['params']['id']}},_0x31dfd5={};_0x31dfd5[_0x5090('0x36')]=_[_0x5090('0x4a')](db['VoiceQueue']['rawAttributes']);_0x3bd964[_0x5090('0x3c')]=_['intersection'](_0x31dfd5[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x45a2cd[_0x5090('0x38')][_0x5090('0x3b')]));_0x3bd964['attributes']=_0x3bd964[_0x5090('0x3c')][_0x5090('0x3d')]?_0x3bd964[_0x5090('0x3c')]:_0x31dfd5[_0x5090('0x36')];if(_0x45a2cd[_0x5090('0x38')]['includeAll']){_0x3bd964[_0x5090('0x45')]=[{'all':!![]}];}_0x3bd964=_[_0x5090('0x42')]({},_0x3bd964,_0x45a2cd[_0x5090('0x4c')]);return db[_0x5090('0x4b')][_0x5090('0x30')](_0x3bd964)[_0x5090('0x29')](handleEntityNotFound(_0x46422f,null))[_0x5090('0x29')](function(_0x217851){if(_0x217851){var _0x1c4c98=_0x217851['get']({'plain':!![]});_0x1c4c98=qs[_0x5090('0x57')](_0x1c4c98,['id','createdAt','updatedAt']);_0x45a2cd[_0x5090('0x58')]=_[_0x5090('0x57')](_0x45a2cd[_0x5090('0x58')],['id',_0x5090('0x59'),_0x5090('0x5a')]);return db[_0x5090('0x4b')][_0x5090('0x4d')](_[_0x5090('0x42')](_0x1c4c98,_0x45a2cd[_0x5090('0x58')]),{'include':_0x45a2cd[_0x5090('0x38')][_0x5090('0x44')]?[{'all':!![]}]:undefined})[_0x5090('0x29')](function(_0x16ee14){var _0x2c62ad=_0x45a2cd['user'][_0x5090('0x2b')]({'plain':!![]});if(!_0x2c62ad)throw new Error(_0x5090('0x4f'));if(_0x2c62ad['role']===_0x5090('0x4e')){var _0xcf5131=_0x16ee14[_0x5090('0x2b')]({'plain':!![]});var _0x3dac62=[{'name':_0x5090('0x51'),'value':'inbound'},{'name':_0x5090('0x2d'),'value':'outbound'}];var _0x305e99=_[_0x5090('0x30')](_0x3dac62,['value',_0xcf5131[_0x5090('0x2f')]])['name'];return db[_0x5090('0x53')][_0x5090('0x30')]({'where':{'name':_0x305e99,'userProfileId':_0x2c62ad[_0x5090('0x5b')]},'raw':!![]})[_0x5090('0x29')](function(_0x27e408){if(_0x27e408&&_0x27e408['autoAssociation']===0x0){return db[_0x5090('0x54')][_0x5090('0x4d')]({'name':_0xcf5131[_0x5090('0x31')],'resourceId':_0xcf5131['id'],'type':_0x27e408[_0x5090('0x31')],'sectionId':_0x27e408['id']},{})['then'](function(){return _0x16ee14;});}else{return _0x16ee14;}})[_0x5090('0x48')](function(_0x465415){logger[_0x5090('0x55')](_0x5090('0x5c'),_0x465415);throw _0x465415;});}return _0x16ee14;});}})['then'](respondWithResult(_0x46422f,0xc9))[_0x5090('0x48')](handleError(_0x46422f,null));};exports['update']=function(_0xfcf371,_0x555154){if(_0xfcf371[_0x5090('0x58')]['id']){delete _0xfcf371['body']['id'];}return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xfcf371[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x555154,null))['then'](saveUpdates(_0xfcf371['body'],null))['then'](respondWithResult(_0x555154,null))[_0x5090('0x48')](handleError(_0x555154,null));};exports[_0x5090('0x2a')]=function(_0x22bc1d,_0x255726){return db[_0x5090('0x4b')]['find']({'where':{'id':_0x22bc1d[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x255726,null))[_0x5090('0x29')](removeEntity(_0x255726,null))[_0x5090('0x48')](handleError(_0x255726,null));};exports['getHoppers']=function(_0x2cada7,_0x1d2348,_0x16203a){var _0x3486ea={'raw':![],'where':{}};var _0x2b4117={};var _0x40d94a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x2cada7[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x1d2348,null))[_0x5090('0x29')](function(_0x187e93){if(_0x187e93){_0x2b4117[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x5e')][_0x5090('0x34')]);_0x2b4117['query']=_[_0x5090('0x4a')](_0x2cada7['query']);_0x2b4117['filters']=_[_0x5090('0x3a')](_0x2b4117['model'],_0x2b4117['query']);_0x3486ea[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x2b4117[_0x5090('0x36')],qs['fields'](_0x2cada7[_0x5090('0x38')]['fields']));_0x3486ea[_0x5090('0x3c')]=_0x3486ea['attributes'][_0x5090('0x3d')]?_0x3486ea[_0x5090('0x3c')]:_0x2b4117[_0x5090('0x36')];if(!_0x2cada7[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x3486ea['limit']=qs[_0x5090('0x22')](_0x2cada7['query'][_0x5090('0x22')]);_0x3486ea[_0x5090('0x21')]=qs['offset'](_0x2cada7[_0x5090('0x38')][_0x5090('0x21')]);}_0x3486ea[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x2cada7[_0x5090('0x38')][_0x5090('0x3f')]);_0x3486ea[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x2cada7[_0x5090('0x38')],_0x2b4117['filters']));_0x3486ea[_0x5090('0x40')]['VoiceQueueId']=_0x187e93['id'];if(_0x2cada7[_0x5090('0x38')][_0x5090('0x41')]){_0x3486ea[_0x5090('0x40')]=_[_0x5090('0x42')](_0x3486ea[_0x5090('0x40')],{'$or':_['map'](_0x3486ea['attributes'],function(_0x2f0b49){var _0x33d2cc={};_0x33d2cc[_0x2f0b49]={'$like':'%'+_0x2cada7[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x33d2cc;})});}_0x3486ea=_[_0x5090('0x42')]({},_0x3486ea,_0x2cada7[_0x5090('0x4c')]);return db[_0x5090('0x5e')][_0x5090('0x23')]({'where':_0x3486ea[_0x5090('0x40')]})[_0x5090('0x29')](function(_0x2c3cce){_0x40d94a['count']=_0x2c3cce;if(_0x2cada7['query'][_0x5090('0x44')]){_0x3486ea[_0x5090('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x5090('0x46')](_0x3486ea);})['then'](function(_0x1ae289){_0x40d94a[_0x5090('0x47')]=_0x1ae289;return _0x40d94a;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x1d2348,_0x3486ea))[_0x5090('0x48')](handleError(_0x1d2348,null));};exports['getHopperHistories']=function(_0xffd43,_0x184446,_0x4e87a5){var _0xc2b003={'raw':!![],'where':{}};var _0x183a46={};var _0x244971={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xffd43[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x184446,null))[_0x5090('0x29')](function(_0x154d4f){if(_0x154d4f){_0x183a46['model']=_[_0x5090('0x4a')](db[_0x5090('0x62')][_0x5090('0x34')]);_0x183a46['query']=_[_0x5090('0x4a')](_0xffd43[_0x5090('0x38')]);_0x183a46['filters']=_['intersection'](_0x183a46[_0x5090('0x36')],_0x183a46[_0x5090('0x38')]);_0xc2b003[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x183a46['model'],qs[_0x5090('0x3b')](_0xffd43[_0x5090('0x38')][_0x5090('0x3b')]));_0xc2b003[_0x5090('0x3c')]=_0xc2b003[_0x5090('0x3c')][_0x5090('0x3d')]?_0xc2b003['attributes']:_0x183a46[_0x5090('0x36')];if(!_0xffd43[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0xc2b003[_0x5090('0x22')]=qs[_0x5090('0x22')](_0xffd43[_0x5090('0x38')][_0x5090('0x22')]);_0xc2b003[_0x5090('0x21')]=qs[_0x5090('0x21')](_0xffd43[_0x5090('0x38')][_0x5090('0x21')]);}_0xc2b003[_0x5090('0x60')]=qs['sort'](_0xffd43[_0x5090('0x38')][_0x5090('0x3f')]);_0xc2b003[_0x5090('0x40')]=qs[_0x5090('0x39')](_['pick'](_0xffd43['query'],_0x183a46[_0x5090('0x39')]));_0xc2b003['where'][_0x5090('0x63')]=_0x154d4f['id'];if(_0xffd43[_0x5090('0x38')]['filter']){_0xc2b003[_0x5090('0x40')]=_[_0x5090('0x42')](_0xc2b003[_0x5090('0x40')],{'$or':_['map'](_0xc2b003[_0x5090('0x3c')],function(_0x21757b){var _0x550b82={};_0x550b82[_0x21757b]={'$like':'%'+_0xffd43[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x550b82;})});}_0xc2b003=_[_0x5090('0x42')]({},_0xc2b003,_0xffd43[_0x5090('0x4c')]);return db[_0x5090('0x62')]['count']({'where':_0xc2b003['where']})[_0x5090('0x29')](function(_0x42dcc4){_0x244971['count']=_0x42dcc4;if(_0xffd43[_0x5090('0x38')][_0x5090('0x44')]){_0xc2b003[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x62')][_0x5090('0x46')](_0xc2b003);})[_0x5090('0x29')](function(_0x36a1af){_0x244971['rows']=_0x36a1af;return _0x244971;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x184446,_0xc2b003))[_0x5090('0x48')](handleError(_0x184446,null));};exports[_0x5090('0x64')]=function(_0x1c340b,_0x3194a8,_0x2ea6f5){var _0x550859={'raw':!![],'where':{}};var _0x545ff4={};var _0x4259b9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x1c340b[_0x5090('0x49')]['id']}})['then'](handleEntityNotFound(_0x3194a8,null))[_0x5090('0x29')](function(_0x31aa1e){if(_0x31aa1e){_0x545ff4[_0x5090('0x36')]=_[_0x5090('0x4a')](db['CmHopperFinal']['rawAttributes']);_0x545ff4[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x1c340b[_0x5090('0x38')]);_0x545ff4[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x545ff4[_0x5090('0x36')],_0x545ff4[_0x5090('0x38')]);_0x550859[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x545ff4[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x1c340b[_0x5090('0x38')]['fields']));_0x550859[_0x5090('0x3c')]=_0x550859['attributes'][_0x5090('0x3d')]?_0x550859[_0x5090('0x3c')]:_0x545ff4[_0x5090('0x36')];if(!_0x1c340b[_0x5090('0x38')]['hasOwnProperty']('nolimit')){_0x550859[_0x5090('0x22')]=qs['limit'](_0x1c340b[_0x5090('0x38')][_0x5090('0x22')]);_0x550859[_0x5090('0x21')]=qs['offset'](_0x1c340b[_0x5090('0x38')][_0x5090('0x21')]);}_0x550859[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x1c340b[_0x5090('0x38')][_0x5090('0x3f')]);_0x550859['where']=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x1c340b['query'],_0x545ff4[_0x5090('0x39')]));_0x550859[_0x5090('0x40')]['VoiceQueueId']=_0x31aa1e['id'];if(_0x1c340b[_0x5090('0x38')][_0x5090('0x41')]){_0x550859[_0x5090('0x40')]=_[_0x5090('0x42')](_0x550859[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x550859[_0x5090('0x3c')],function(_0x35c4c6){var _0x476b2d={};_0x476b2d[_0x35c4c6]={'$like':'%'+_0x1c340b[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x476b2d;})});}_0x550859=_[_0x5090('0x42')]({},_0x550859,_0x1c340b[_0x5090('0x4c')]);return db['CmHopperFinal'][_0x5090('0x23')]({'where':_0x550859[_0x5090('0x40')]})[_0x5090('0x29')](function(_0x337cb7){_0x4259b9[_0x5090('0x23')]=_0x337cb7;if(_0x1c340b[_0x5090('0x38')][_0x5090('0x44')]){_0x550859[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x65')][_0x5090('0x46')](_0x550859);})['then'](function(_0x407598){_0x4259b9[_0x5090('0x47')]=_0x407598;return _0x4259b9;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x3194a8,_0x550859))[_0x5090('0x48')](handleError(_0x3194a8,null));};exports[_0x5090('0x66')]=function(_0x5a1de4,_0x4480f1,_0x1a0fc5){var _0x332bf1={'raw':!![],'where':{}};var _0x31c2b7={};var _0x2dc820={'count':0x0,'rows':[]};return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x5a1de4[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x4480f1,null))[_0x5090('0x29')](function(_0x49ec13){if(_0x49ec13){_0x31c2b7[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x67')][_0x5090('0x34')]);_0x31c2b7[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x5a1de4['query']);_0x31c2b7[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x31c2b7[_0x5090('0x36')],_0x31c2b7[_0x5090('0x38')]);_0x332bf1[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x31c2b7[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x5a1de4[_0x5090('0x38')][_0x5090('0x3b')]));_0x332bf1[_0x5090('0x3c')]=_0x332bf1[_0x5090('0x3c')][_0x5090('0x3d')]?_0x332bf1[_0x5090('0x3c')]:_0x31c2b7[_0x5090('0x36')];if(!_0x5a1de4[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x332bf1[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x5a1de4[_0x5090('0x38')]['limit']);_0x332bf1[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x5a1de4[_0x5090('0x38')][_0x5090('0x21')]);}_0x332bf1[_0x5090('0x60')]=qs['sort'](_0x5a1de4['query'][_0x5090('0x3f')]);_0x332bf1[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x5a1de4[_0x5090('0x38')],_0x31c2b7[_0x5090('0x39')]));_0x332bf1['where'][_0x5090('0x63')]=_0x49ec13['id'];if(_0x5a1de4[_0x5090('0x38')][_0x5090('0x41')]){_0x332bf1[_0x5090('0x40')]=_['merge'](_0x332bf1[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x332bf1['attributes'],function(_0x437b37){var _0x4e0bc9={};_0x4e0bc9[_0x437b37]={'$like':'%'+_0x5a1de4[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x4e0bc9;})});}_0x332bf1=_['merge']({},_0x332bf1,_0x5a1de4[_0x5090('0x4c')]);return db[_0x5090('0x67')][_0x5090('0x23')]({'where':_0x332bf1['where']})[_0x5090('0x29')](function(_0x4a02fb){_0x2dc820['count']=_0x4a02fb;if(_0x5a1de4['query'][_0x5090('0x44')]){_0x332bf1[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x67')][_0x5090('0x46')](_0x332bf1);})[_0x5090('0x29')](function(_0x541123){_0x2dc820[_0x5090('0x47')]=_0x541123;return _0x2dc820;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x4480f1,_0x332bf1))[_0x5090('0x48')](handleError(_0x4480f1,null));};exports['getTeams']=function(_0x3fffa8,_0x35ca84,_0x19bf7f){var _0x440870={};var _0x5770b7={};var _0x23f0d8;var _0x1687e5;return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x3fffa8[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x35ca84,null))[_0x5090('0x29')](function(_0xfdd691){if(_0xfdd691){_0x23f0d8=_0xfdd691;_0x5770b7['model']=_['keys'](db[_0x5090('0x68')][_0x5090('0x34')]);_0x5770b7[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x3fffa8['query']);_0x5770b7[_0x5090('0x39')]=_['intersection'](_0x5770b7[_0x5090('0x36')],_0x5770b7[_0x5090('0x38')]);_0x440870[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x5770b7[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x3fffa8[_0x5090('0x38')]['fields']));_0x440870[_0x5090('0x3c')]=_0x440870['attributes'][_0x5090('0x3d')]?_0x440870[_0x5090('0x3c')]:_0x5770b7[_0x5090('0x36')];_0x440870[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x3fffa8[_0x5090('0x38')][_0x5090('0x3f')]);_0x440870[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x3fffa8[_0x5090('0x38')],_0x5770b7[_0x5090('0x39')]));if(_0x3fffa8[_0x5090('0x38')]['filter']){_0x440870[_0x5090('0x40')]=_['merge'](_0x440870[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x440870[_0x5090('0x3c')],function(_0x423d77){var _0x87a615={};_0x87a615[_0x423d77]={'$like':'%'+_0x3fffa8[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x87a615;})});}_0x440870=_['merge']({},_0x440870,_0x3fffa8[_0x5090('0x4c')]);return _0x23f0d8[_0x5090('0x69')](_0x440870);}})[_0x5090('0x29')](function(_0x377aed){if(_0x377aed){_0x1687e5=_0x377aed[_0x5090('0x3d')];if(!_0x3fffa8[_0x5090('0x38')][_0x5090('0x3e')]('nolimit')){_0x440870['limit']=qs[_0x5090('0x22')](_0x3fffa8[_0x5090('0x38')][_0x5090('0x22')]);_0x440870['offset']=qs[_0x5090('0x21')](_0x3fffa8[_0x5090('0x38')]['offset']);}return _0x23f0d8[_0x5090('0x69')](_0x440870);}})['then'](function(_0x113516){if(_0x113516){return _0x113516?{'count':_0x1687e5,'rows':_0x113516}:null;}})[_0x5090('0x29')](respondWithResult(_0x35ca84,null))[_0x5090('0x48')](handleError(_0x35ca84,null));};exports['addTeams']=function(_0x7535bd,_0x531f62,_0x163980){var _0x2590be=_0x7535bd['body'][_0x5090('0x6a')];var _0x20200c=_['map'](_0x2590be,'id');return db[_0x5090('0x68')][_0x5090('0x46')]({'where':{'id':_0x20200c},'attributes':['id'],'include':[{'model':db[_0x5090('0x6b')],'as':_0x5090('0x6c'),'attributes':['id','name',_0x5090('0x6d'),'voicePause','interface'],'raw':!![]}]})[_0x5090('0x29')](function(_0x58ed6d){if(_0x58ed6d){var _0x4eb9e6=_[_0x5090('0x6e')](_0x58ed6d,function(_0x384f6f){var _0x4fd1ed=_0x384f6f[_0x5090('0x2b')]({'plain':!![]});_0x4fd1ed[_0x5090('0x6c')][_0x5090('0x6f')](function(_0xd00ca4){_0xd00ca4[_0x5090('0x70')]=_['find'](_0x2590be,{'id':_0x4fd1ed['id']})[_0x5090('0x70')];});return _0x4fd1ed[_0x5090('0x6c')];});return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x7535bd[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(_0x4cc166){return db['sequelize'][_0x5090('0x71')](function(_0x2ab105){return _0x4cc166[_0x5090('0x72')](_0x20200c,{'transaction':_0x2ab105})[_0x5090('0x29')](function(){return BPromise['each'](_0x2590be,function(_0x342b73){return db[_0x5090('0x73')][_0x5090('0x74')]({'TeamId':_0x342b73['id'],'VoiceQueueId':_0x7535bd[_0x5090('0x49')]['id'],'penalty':_0x342b73[_0x5090('0x70')]},{'transaction':_0x2ab105});});})['then'](function(){return BPromise[_0x5090('0x75')](_0x4eb9e6,function(_0x5dc4f2){return db[_0x5090('0x76')]['findOrCreate']({'where':{'UserId':_0x5dc4f2['id'],'VoiceQueueId':_0x7535bd[_0x5090('0x49')]['id']},'defaults':{'penalty':_0x5dc4f2[_0x5090('0x70')]},'transaction':_0x2ab105});});})['then'](function(){return BPromise[_0x5090('0x75')](_['filter'](_0x4eb9e6,{'online':!![]}),function(_0x59e58d){return db[_0x5090('0x77')][_0x5090('0x74')]({'membername':_0x59e58d['name'],'UserId':_0x59e58d['id'],'queue_name':_0x4cc166['name'],'VoiceQueueId':_0x4cc166['id'],'interface':_['isNil'](_0x59e58d['interface'])?util[_0x5090('0x78')](_0x5090('0x79'),_0x59e58d[_0x5090('0x31')]):_0x59e58d[_0x5090('0x7a')],'paused':_0x59e58d[_0x5090('0x7b')]||![],'penalty':_0x59e58d[_0x5090('0x70')]},{'transaction':_0x2ab105});});})[_0x5090('0x29')](function(){_0x4eb9e6['forEach'](function(_0x1eae46){socket[_0x5090('0x7c')](_0x5090('0x7d'),{'UserId':_0x1eae46['id'],'VoiceQueueId':_0x4cc166['id']});});});});});}})[_0x5090('0x29')](respondWithStatusCode(_0x531f62,null))['catch'](handleError(_0x531f62,null));};exports['removeTeams']=function(_0xb6b621,_0x1481ba,_0x1aec44){return db[_0x5090('0x68')][_0x5090('0x46')]({'where':{'id':_0xb6b621[_0x5090('0x38')][_0x5090('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x5090('0x6b')],'as':_0x5090('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1481ba,null))['then'](function(_0x4d926c){var _0x6164ba=_[_0x5090('0x37')](_0x4d926c,'id');var _0x492eb4=[];var _0x583b03=[];var _0x1e58d3=squel['select']();_0x1e58d3[_0x5090('0x7f')]('tq.TeamId')['from'](_0x5090('0x80'),'tq')[_0x5090('0x81')](_0x5090('0x82'),'ut',_0x5090('0x83'))[_0x5090('0x40')]('VoiceQueueId\x20=\x20?',_0xb6b621[_0x5090('0x49')]['id']);for(var _0x584f6d=0x0;_0x584f6d<_0x4d926c[_0x5090('0x3d')];_0x584f6d+=0x1){let _0x55da32=_0x4d926c[_0x584f6d];for(var _0x5acaf8=0x0;_0x5acaf8<_0x55da32[_0x5090('0x6c')][_0x5090('0x3d')];_0x5acaf8+=0x1){let _0x2e712e=_0x55da32[_0x5090('0x6c')][_0x5acaf8];var _0x35034c=_0x1e58d3[_0x5090('0x56')]();_0x35034c[_0x5090('0x40')](_0x5090('0x84'),_0x2e712e['id']);_0x583b03[_0x5090('0x85')](db['sequelize'][_0x5090('0x38')](_0x35034c[_0x5090('0x86')](),{'type':db[_0x5090('0x87')][_0x5090('0x88')][_0x5090('0x89')]})[_0x5090('0x29')](function(_0x16d4df){if(_0x16d4df[_0x5090('0x3d')]===0x1){return _0x2e712e['id'];}else{var _0x248a42=_[_0x5090('0x8a')](_['map'](_0x16d4df,'TeamId'),function(_0x493d60){return _[_0x5090('0x8b')](_0x6164ba,_0x493d60);});if(_0x248a42){return _0x2e712e['id'];}}}));}}return BPromise[_0x5090('0x8c')](_0x583b03)['then'](function(_0xcf95ea){_0x492eb4=_(_0x492eb4)[_0x5090('0x8d')](_0xcf95ea)['compact']()[_0x5090('0x2e')]();return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xb6b621['params']['id']}})[_0x5090('0x29')](function(_0x1a7dbb){return db[_0x5090('0x87')]['transaction'](function(_0xb24cb4){return _0x1a7dbb[_0x5090('0x8e')](_0xb6b621[_0x5090('0x38')][_0x5090('0x7e')],{'transaction':_0xb24cb4})[_0x5090('0x29')](function(){if(!_[_0x5090('0x8f')](_0x492eb4)){return _0x1a7dbb[_0x5090('0x90')](_0x492eb4,{'transaction':_0xb24cb4})['then'](function(){return db[_0x5090('0x77')][_0x5090('0x2a')]({'where':{'VoiceQueueId':_0xb6b621['params']['id'],'UserId':_0x492eb4},'transaction':_0xb24cb4});});}})[_0x5090('0x29')](function(){_0x492eb4[_0x5090('0x6f')](function(_0x41c128){socket[_0x5090('0x7c')](_0x5090('0x91'),{'UserId':_0x41c128,'VoiceQueueId':_0x1a7dbb['id']});});});});});});})[_0x5090('0x29')](respondWithStatusCode(_0x1481ba,null))[_0x5090('0x48')](handleError(_0x1481ba,null));};exports[_0x5090('0x92')]=function(_0x1d0bac,_0x5108d3,_0x2fe096){var _0x4172f3,_0x2f27a6;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x1d0bac[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x5108d3,null))['then'](function(_0x1204fd){if(_0x1204fd){_0x2f27a6=_0x1204fd;return _0x1204fd[_0x5090('0x92')](_0x1d0bac['body'][_0x5090('0x7e')],_[_0x5090('0x57')](_0x1d0bac[_0x5090('0x58')],[_0x5090('0x7e'),'id'])||{})[_0x5090('0x93')](function(_0x1ebf5f){for(var _0x2c3c5b=0x0;_0x2c3c5b<_0x1d0bac[_0x5090('0x58')][_0x5090('0x7e')][_0x5090('0x3d')];_0x2c3c5b+=0x1){socket[_0x5090('0x7c')](_0x5090('0x7d'),{'UserId':Number(_0x1d0bac[_0x5090('0x58')]['ids'][_0x2c3c5b]),'VoiceQueueId':Number(_0x1d0bac[_0x5090('0x49')]['id'])});}return _0x1ebf5f;});}})[_0x5090('0x29')](function(_0x4515d4){_0x4172f3=_0x4515d4||[];if(_0x2f27a6){return db[_0x5090('0x6b')][_0x5090('0x46')]({'where':{'id':_0x1d0bac[_0x5090('0x58')]['ids']},'attributes':['id',_0x5090('0x31'),'online',_0x5090('0x7b'),_0x5090('0x7a')],'raw':!![]});}})['then'](function(_0x15bf2d){if(!_[_0x5090('0x8f')](_0x15bf2d)){var _0x28a43a=[];for(var _0x37d056=0x0;_0x37d056<_0x15bf2d[_0x5090('0x3d')];_0x37d056++){if(_0x15bf2d[_0x37d056]['online']){_0x28a43a[_0x5090('0x85')](db[_0x5090('0x77')]['upsert']({'membername':_0x15bf2d[_0x37d056][_0x5090('0x31')],'UserId':_0x15bf2d[_0x37d056]['id'],'queue_name':_0x2f27a6[_0x5090('0x31')],'VoiceQueueId':_0x2f27a6['id'],'interface':_[_0x5090('0x94')](_0x15bf2d[_0x37d056][_0x5090('0x7a')])?util[_0x5090('0x78')]('SIP/%s',_0x15bf2d[_0x37d056]['name']):_0x15bf2d[_0x37d056][_0x5090('0x7a')],'paused':_0x15bf2d[_0x37d056][_0x5090('0x7b')]||![],'penalty':_0x1d0bac['body'][_0x5090('0x70')]||0x0}));}}return BPromise[_0x5090('0x8c')](_0x28a43a);}})[_0x5090('0x29')](function(){return _0x4172f3;})[_0x5090('0x29')](respondWithResult(_0x5108d3,null))[_0x5090('0x48')](handleError(_0x5108d3,null));};exports['removeAgents']=function(_0x1c95d6,_0x58808d,_0x5f05cc){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x1c95d6[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x58808d,null))[_0x5090('0x29')](function(_0x2db362){if(_0x2db362){return _0x2db362[_0x5090('0x90')](_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')])[_0x5090('0x29')](function(){if(_['isArray'](_0x1c95d6['query'][_0x5090('0x7e')])){for(var _0x31e291=0x0;_0x31e291<_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]['length'];_0x31e291+=0x1){socket[_0x5090('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')][_0x31e291]),'VoiceQueueId':Number(_0x1c95d6[_0x5090('0x49')]['id'])});}}else{socket[_0x5090('0x7c')](_0x5090('0x91'),{'UserId':Number(_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]),'VoiceQueueId':Number(_0x1c95d6[_0x5090('0x49')]['id'])});}});}})['then'](function(_0x3cdc25){return db[_0x5090('0x77')][_0x5090('0x2a')]({'where':{'VoiceQueueId':_0x1c95d6[_0x5090('0x49')]['id'],'UserId':_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]}})['then'](function(){return _0x3cdc25;});})['then'](respondWithStatusCode(_0x58808d,null))[_0x5090('0x48')](handleError(_0x58808d,null));};exports['getAgents']=function(_0x647b7a,_0x2e0f5a,_0x371f2d){var _0x2709c6={};var _0x5f7c7d={};var _0x30f064;var _0x38589b;return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x647b7a[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x2e0f5a,null))[_0x5090('0x29')](function(_0x154acb){if(_0x154acb){_0x30f064=_0x154acb;_0x5f7c7d[_0x5090('0x36')]=_['keys'](db[_0x5090('0x6b')][_0x5090('0x34')]);_0x5f7c7d[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x647b7a['query']);_0x5f7c7d[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x5f7c7d[_0x5090('0x36')],_0x5f7c7d[_0x5090('0x38')]);_0x2709c6[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x5f7c7d[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x647b7a[_0x5090('0x38')][_0x5090('0x3b')]));_0x2709c6[_0x5090('0x3c')]=_0x2709c6[_0x5090('0x3c')][_0x5090('0x3d')]?_0x2709c6[_0x5090('0x3c')]:_0x5f7c7d[_0x5090('0x36')];_0x2709c6[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x647b7a[_0x5090('0x38')][_0x5090('0x3f')]);_0x2709c6[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x647b7a[_0x5090('0x38')],_0x5f7c7d[_0x5090('0x39')]));if(_0x647b7a[_0x5090('0x38')]['filter']){_0x2709c6[_0x5090('0x40')]=_['merge'](_0x2709c6[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x2709c6[_0x5090('0x3c')],function(_0x4cc55f){var _0x45545e={};_0x45545e[_0x4cc55f]={'$like':'%'+_0x647b7a[_0x5090('0x38')]['filter']+'%'};return _0x45545e;})});}_0x2709c6=_['merge']({},_0x2709c6,_0x647b7a[_0x5090('0x4c')]);return _0x30f064[_0x5090('0x95')](_0x2709c6);}})[_0x5090('0x29')](function(_0x40fc08){if(_0x40fc08){_0x38589b=_0x40fc08['length'];if(!_0x647b7a[_0x5090('0x38')]['hasOwnProperty'](_0x5090('0x5f'))){_0x2709c6['limit']=qs[_0x5090('0x22')](_0x647b7a[_0x5090('0x38')]['limit']);_0x2709c6[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x647b7a[_0x5090('0x38')][_0x5090('0x21')]);}return _0x30f064[_0x5090('0x95')](_0x2709c6);}})['then'](function(_0x17a035){if(_0x17a035){return _0x17a035?{'count':_0x38589b,'rows':_0x17a035}:null;}})[_0x5090('0x29')](respondWithResult(_0x2e0f5a,null))[_0x5090('0x48')](handleError(_0x2e0f5a,null));};exports[_0x5090('0x96')]=function(_0x1bd96b,_0x408e11,_0x597465){var _0x5756d5={};var _0x1c4e92={};var _0x49d0f0;var _0x3e6821;return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x1bd96b[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x408e11,null))[_0x5090('0x29')](function(_0x90cfed){if(_0x90cfed){_0x49d0f0=_0x90cfed;_0x1c4e92[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x77')][_0x5090('0x34')]);_0x1c4e92[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x1bd96b[_0x5090('0x38')]);_0x1c4e92['filters']=_[_0x5090('0x3a')](_0x1c4e92[_0x5090('0x36')],_0x1c4e92[_0x5090('0x38')]);_0x5756d5[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x1c4e92['model'],qs[_0x5090('0x3b')](_0x1bd96b['query'][_0x5090('0x3b')]));_0x5756d5[_0x5090('0x3c')]=_0x5756d5['attributes'][_0x5090('0x3d')]?_0x5756d5[_0x5090('0x3c')]:_0x1c4e92[_0x5090('0x36')];_0x5756d5[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x1bd96b[_0x5090('0x38')][_0x5090('0x3f')]);_0x5756d5[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x1bd96b[_0x5090('0x38')],_0x1c4e92[_0x5090('0x39')]));if(_0x1bd96b[_0x5090('0x38')]['filter']){_0x5756d5[_0x5090('0x40')]=_['merge'](_0x5756d5[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x5756d5[_0x5090('0x3c')],function(_0x53e3bd){var _0x1b1723={};_0x1b1723[_0x53e3bd]={'$like':'%'+_0x1bd96b[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x1b1723;})});}_0x5756d5=_[_0x5090('0x42')]({},_0x5756d5,_0x1bd96b['options']);return _0x49d0f0[_0x5090('0x96')](_0x5756d5);}})['then'](function(_0xef8491){if(_0xef8491){_0x3e6821=_0xef8491[_0x5090('0x3d')];if(!_0x1bd96b[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x5756d5['limit']=qs['limit'](_0x1bd96b[_0x5090('0x38')][_0x5090('0x22')]);_0x5756d5[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x1bd96b[_0x5090('0x38')][_0x5090('0x21')]);}return _0x49d0f0['getMembers'](_0x5756d5);}})[_0x5090('0x29')](function(_0x2b5b91){return _0x2b5b91?{'count':_0x3e6821,'rows':_0x2b5b91}:null;})['then'](respondWithResult(_0x408e11,null))[_0x5090('0x48')](handleError(_0x408e11,null));};exports[_0x5090('0x97')]=function(_0x34fb67,_0x1a44a3,_0xca8797){var _0x1e85a5={};var _0x469fec={};var _0x50ee82;var _0x2fb9b4;return db[_0x5090('0x4b')]['findOne']({'where':{'id':_0x34fb67['params']['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x1a44a3,null))[_0x5090('0x29')](function(_0x59b035){if(_0x59b035){_0x50ee82=_0x59b035;_0x469fec[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x98')][_0x5090('0x34')]);_0x469fec[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x34fb67[_0x5090('0x38')]);_0x469fec[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x469fec[_0x5090('0x36')],_0x469fec[_0x5090('0x38')]);_0x1e85a5[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x469fec[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x34fb67[_0x5090('0x38')][_0x5090('0x3b')]));_0x1e85a5[_0x5090('0x3c')]=_0x1e85a5[_0x5090('0x3c')][_0x5090('0x3d')]?_0x1e85a5[_0x5090('0x3c')]:_0x469fec['model'];_0x1e85a5[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x34fb67[_0x5090('0x38')][_0x5090('0x3f')]);_0x1e85a5[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x34fb67[_0x5090('0x38')],_0x469fec[_0x5090('0x39')]));if(_0x34fb67[_0x5090('0x38')][_0x5090('0x41')]){_0x1e85a5['where']=_[_0x5090('0x42')](_0x1e85a5[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x1e85a5[_0x5090('0x3c')],function(_0x1acc78){var _0x214195={};_0x214195[_0x1acc78]={'$like':'%'+_0x34fb67['query'][_0x5090('0x41')]+'%'};return _0x214195;})});}_0x1e85a5=_[_0x5090('0x42')]({},_0x1e85a5,_0x34fb67[_0x5090('0x4c')]);return _0x50ee82[_0x5090('0x97')](_0x1e85a5);}})[_0x5090('0x29')](function(_0x4ae4c4){if(_0x4ae4c4){_0x2fb9b4=_0x4ae4c4['length'];if(!_0x34fb67[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x1e85a5[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x34fb67[_0x5090('0x38')][_0x5090('0x22')]);_0x1e85a5[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x34fb67[_0x5090('0x38')][_0x5090('0x21')]);}return _0x50ee82['getLists'](_0x1e85a5);}})['then'](function(_0x369df4){if(_0x369df4){return _0x369df4?{'count':_0x2fb9b4,'rows':_0x369df4}:null;}})[_0x5090('0x29')](respondWithResult(_0x1a44a3,null))[_0x5090('0x48')](handleError(_0x1a44a3,null));};exports['addLists']=function(_0xec4ee6,_0x2b2aec,_0x3acb46){var _0x60d00d,_0x212882;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xec4ee6[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x2b2aec,null))[_0x5090('0x29')](function(_0x1747a0){if(_0x1747a0){_0x212882=_0x1747a0;return _0x1747a0[_0x5090('0x99')](_0xec4ee6[_0x5090('0x58')][_0x5090('0x7e')],_[_0x5090('0x57')](_0xec4ee6[_0x5090('0x58')],['ids','id'])||{});}return null;})[_0x5090('0x93')](function(_0x5aa3ee){var _0x3a9ccd;_0x60d00d=_0x5aa3ee||[];var _0x394807=[];if(_0x5aa3ee){for(var _0x14d321=0x0;_0x14d321<_0x5aa3ee[_0x5090('0x3d')];_0x14d321+=0x1){var _0x47308e=_0x5aa3ee[_0x14d321][_0x5090('0x2b')]({'plain':!![]});_0x212882['dialCheckDuplicateType']=_0xec4ee6['body'][_0x5090('0x9a')]?_0xec4ee6[_0x5090('0x58')][_0x5090('0x9a')]:_0x212882[_0x5090('0x9a')];switch(_0x212882[_0x5090('0x9a')]){case _0x5090('0x9b'):_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),_0x5090('0xa3'),_0x5090('0x63'),_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()['field'](_0x5090('0xa0'),_0x5090('0xa0'))['field'](_0x5090('0xa5'),_0x5090('0xa1'))['field']('id',_0x5090('0xa2'))[_0x5090('0x7f')](_0x47308e['CmListId'][_0x5090('0x86')](),'ListId')[_0x5090('0x7f')](_0xec4ee6[_0x5090('0x49')]['id']['toString'](),_0x5090('0x63'))[_0x5090('0x7f')](_0x5090('0xa5'),_0x5090('0x59'))[_0x5090('0x7f')]('NOW()',_0x5090('0x5a'))[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')](_0x5090('0xa8'))[_0x5090('0x40')](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())['where'](_0x5090('0xab'))[_0x5090('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5090('0xa4')]()[_0x5090('0x7f')](_0x5090('0xac'))[_0x5090('0xa6')]('cm_hopper_final')[_0x5090('0x40')]('VoiceQueueId\x20=\x20?',_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')]()))[_0x5090('0x40')](_0x5090('0xad'),squel['select']()[_0x5090('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0x5090('0x9e'))[_0x5090('0x40')](_0x5090('0xae'),_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')]())))[_0x5090('0x86')]();break;case _0x5090('0xaf'):_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),'ListId','VoiceQueueId',_0x5090('0x59'),_0x5090('0x5a')],squel['select']()[_0x5090('0x7f')](_0x5090('0xa0'),_0x5090('0xa0'))['field'](_0x5090('0xa5'),_0x5090('0xa1'))['field']('id','ContactId')[_0x5090('0x7f')](_0x47308e[_0x5090('0xaa')][_0x5090('0x86')](),_0x5090('0xa3'))[_0x5090('0x7f')](_0xec4ee6['params']['id'][_0x5090('0x86')](),_0x5090('0x63'))['field'](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),'updatedAt')[_0x5090('0xa6')]('cm_contacts')['where'](_0x5090('0xa8'))['where'](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())['where'](_0x5090('0xab'))[_0x5090('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5090('0xa4')]()[_0x5090('0x7f')]('COALESCE(phone,\x27\x27)')[_0x5090('0xa6')](_0x5090('0x9e'))[_0x5090('0x40')](_0x5090('0xae'),_0xec4ee6['params']['id'][_0x5090('0x86')]())))['toString']();break;default:_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),_0x5090('0xa3'),_0x5090('0x63'),_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()['field'](_0x5090('0xa0'),'phone')[_0x5090('0x7f')]('NOW()','scheduledAt')[_0x5090('0x7f')]('id',_0x5090('0xa2'))['field'](_0x47308e[_0x5090('0xaa')][_0x5090('0x86')](),_0x5090('0xa3'))['field'](_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')](),_0x5090('0x63'))['field'](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),_0x5090('0x5a'))[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')](_0x5090('0xa8'))[_0x5090('0x40')](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())[_0x5090('0x40')](_0x5090('0xab')))['toString']();}_0x394807['push'](db[_0x5090('0x87')][_0x5090('0x38')](_0x3a9ccd));}return BPromise[_0x5090('0x8c')](_0x394807);}})[_0x5090('0x29')](function(){return _0x60d00d;})[_0x5090('0x29')](respondWithResult(_0x2b2aec,null))[_0x5090('0x48')](handleError(_0x2b2aec,null));};exports[_0x5090('0xb0')]=function(_0x586052,_0x4d0a4f,_0x531ac7){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x586052['params']['id']}})['then'](handleEntityNotFound(_0x4d0a4f,null))[_0x5090('0x29')](function(_0x462d60){if(_0x462d60){return _0x462d60['removeLists'](_0x586052['query'][_0x5090('0x7e')]);}})[_0x5090('0x29')](function(_0x41010d){if(_0x41010d){return db[_0x5090('0x5e')][_0x5090('0x2a')]({'where':{'ListId':_0x586052[_0x5090('0x38')][_0x5090('0x7e')],'VoiceQueueId':_0x586052[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(){return _0x41010d;});}})[_0x5090('0x29')](respondWithStatusCode(_0x4d0a4f,null))['catch'](handleError(_0x4d0a4f,null));};exports[_0x5090('0xb1')]=function(_0x5c6e06,_0x462673,_0xa5676d){var _0x5a059a={};var _0x2c119c={};var _0x2b6930;var _0x193068;return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x5c6e06[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x462673,null))[_0x5090('0x29')](function(_0x336dff){if(_0x336dff){_0x2b6930=_0x336dff;_0x2c119c[_0x5090('0x36')]=_[_0x5090('0x4a')](db['CmList'][_0x5090('0x34')]);_0x2c119c['query']=_[_0x5090('0x4a')](_0x5c6e06['query']);_0x2c119c['filters']=_['intersection'](_0x2c119c[_0x5090('0x36')],_0x2c119c[_0x5090('0x38')]);_0x5a059a['attributes']=_[_0x5090('0x3a')](_0x2c119c[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x3b')]));_0x5a059a[_0x5090('0x3c')]=_0x5a059a[_0x5090('0x3c')][_0x5090('0x3d')]?_0x5a059a['attributes']:_0x2c119c[_0x5090('0x36')];_0x5a059a[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x3f')]);_0x5a059a['where']=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x5c6e06['query'],_0x2c119c['filters']));if(_0x5c6e06[_0x5090('0x38')]['filter']){_0x5a059a[_0x5090('0x40')]=_[_0x5090('0x42')](_0x5a059a['where'],{'$or':_[_0x5090('0x37')](_0x5a059a[_0x5090('0x3c')],function(_0x4fd506){var _0x1330c1={};_0x1330c1[_0x4fd506]={'$like':'%'+_0x5c6e06[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x1330c1;})});}_0x5a059a=_[_0x5090('0x42')]({},_0x5a059a,_0x5c6e06[_0x5090('0x4c')]);return _0x2b6930['getBlackLists'](_0x5a059a);}})['then'](function(_0x7e4066){if(_0x7e4066){_0x193068=_0x7e4066[_0x5090('0x3d')];if(!_0x5c6e06[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x5a059a[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x22')]);_0x5a059a[_0x5090('0x21')]=qs['offset'](_0x5c6e06[_0x5090('0x38')]['offset']);}return _0x2b6930[_0x5090('0xb1')](_0x5a059a);}})[_0x5090('0x29')](function(_0x2905e1){if(_0x2905e1){return _0x2905e1?{'count':_0x193068,'rows':_0x2905e1}:null;}})[_0x5090('0x29')](respondWithResult(_0x462673,null))[_0x5090('0x48')](handleError(_0x462673,null));};exports['addBlackLists']=function(_0x36b979,_0x31c5c4,_0x18b2b8){var _0x4e3d32,_0x48e8d4;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x36b979[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x31c5c4,null))[_0x5090('0x29')](function(_0x12b211){if(_0x12b211){_0x48e8d4=_0x12b211;return _0x12b211[_0x5090('0xb2')](_0x36b979['body'][_0x5090('0x7e')],_[_0x5090('0x57')](_0x36b979[_0x5090('0x58')],[_0x5090('0x7e'),'id'])||{});}return null;})['spread'](function(_0x5b7815){var _0x1ff7fe;_0x4e3d32=_0x5b7815||[];var _0x4b094b=[];if(_0x5b7815){for(var _0x570936=0x0;_0x570936<_0x5b7815[_0x5090('0x3d')];_0x570936+=0x1){var _0x172018=_0x5b7815[_0x570936]['get']({'plain':!![]});_0x1ff7fe=squel[_0x5090('0x9c')]()['into'](_0x5090('0xb3'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa2'),'ListId','VoiceQueueId',_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()[_0x5090('0x7f')](_0x5090('0xa0'),'phone')['field']('id',_0x5090('0xa2'))[_0x5090('0x7f')](_0x172018['CmListId'][_0x5090('0x86')](),_0x5090('0xa3'))[_0x5090('0x7f')](_0x36b979[_0x5090('0x49')]['id'][_0x5090('0x86')](),'VoiceQueueId')[_0x5090('0x7f')](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),'updatedAt')[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')]('deletedAt\x20IS\x20NULL')[_0x5090('0x40')](_0x5090('0xa9'),_0x172018['CmListId'][_0x5090('0x86')]())[_0x5090('0x40')](_0x5090('0xab')))['toString']();_0x4b094b[_0x5090('0x85')](db[_0x5090('0x87')]['query'](_0x1ff7fe));}return BPromise[_0x5090('0x8c')](_0x4b094b);}})['then'](function(){return _0x4e3d32;})[_0x5090('0x29')](respondWithResult(_0x31c5c4,null))[_0x5090('0x48')](handleError(_0x31c5c4,null));};exports[_0x5090('0xb4')]=function(_0x32295e,_0x12235b,_0x1c7c74){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x32295e[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x12235b,null))[_0x5090('0x29')](function(_0x51f647){if(_0x51f647){return _0x51f647[_0x5090('0xb4')](_0x32295e[_0x5090('0x38')][_0x5090('0x7e')]);}})['then'](function(_0x117a41){if(_0x117a41){return db['CmHopperBlack'][_0x5090('0x2a')]({'where':{'ListId':_0x32295e[_0x5090('0x38')][_0x5090('0x7e')],'VoiceQueueId':_0x32295e[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(){return _0x117a41;});}})['then'](respondWithStatusCode(_0x12235b,null))[_0x5090('0x48')](handleError(_0x12235b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index c5065f5..e4eb4d8 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 _0x621c=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x621c,0x17f));var _0xc621=function(_0x557e47,_0x57cfcf){_0x557e47=_0x557e47-0x0;var _0x365848=_0x621c[_0x557e47];return _0x365848;};'use strict';var EventEmitter=require(_0xc621('0x0'));var VoiceQueue=require(_0xc621('0x1'))['db'][_0xc621('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc621('0x3')](0x0);var events={'afterCreate':_0xc621('0x4'),'afterUpdate':_0xc621('0x5'),'afterDestroy':_0xc621('0x6')};function emitEvent(_0x41dbfe){return function(_0x3ccdec,_0x308234,_0xc50665){VoiceQueueEvents[_0xc621('0x7')](_0x41dbfe+':'+_0x3ccdec['id'],_0x3ccdec);VoiceQueueEvents[_0xc621('0x7')](_0x41dbfe,_0x3ccdec);_0xc50665(null);};}for(var e in events){if(events[_0xc621('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xc621('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xfa31=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0xfa31,0xbc));var _0x1fa3=function(_0x351200,_0x2f7c8c){_0x351200=_0x351200-0x0;var _0x1ca62b=_0xfa31[_0x351200];return _0x1ca62b;};'use strict';var EventEmitter=require(_0x1fa3('0x0'));var VoiceQueue=require(_0x1fa3('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fa3('0x2'),'afterDestroy':_0x1fa3('0x3')};function emitEvent(_0x1ecd5f){return function(_0x24c00b,_0x2911c5,_0x362217){VoiceQueueEvents[_0x1fa3('0x4')](_0x1ecd5f+':'+_0x24c00b['id'],_0x24c00b);VoiceQueueEvents[_0x1fa3('0x4')](_0x1ecd5f,_0x24c00b);_0x362217(null);};}for(var e in events){if(events[_0x1fa3('0x5')](e)){var event=events[e];VoiceQueue[_0x1fa3('0x6')](e,emitEvent(event));}}module[_0x1fa3('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e1744d9..4f05f0a 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x493263,_0x55d81a){var _0x5b492f=function(_0x16aaa2){while(--_0x16aaa2){_0x493263['push'](_0x493263['shift']());}};_0x5b492f(++_0x55d81a);}(_0x34e8,0x12c));var _0x834e=function(_0x2ca04a,_0x373040){_0x2ca04a=_0x2ca04a-0x0;var _0x31a715=_0x34e8[_0x2ca04a];return _0x31a715;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x25eac3,_0x13d151){var _0x49df3d=function(_0x1b69c3){while(--_0x1b69c3){_0x25eac3['push'](_0x25eac3['shift']());}};_0x49df3d(++_0x13d151);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index e2d4578..2c5721c 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 _0x07bc=['stringify','error','code','message','result','catch','VoiceQueue','options','raw','where','limit','include','map','attributes','model','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x07bc,0x1d5));var _0xc07b=function(_0x2cc9c7,_0x46b745){_0x2cc9c7=_0x2cc9c7-0x0;var _0xa1ebd8=_0x07bc[_0x2cc9c7];return _0xa1ebd8;};'use strict';var _=require(_0xc07b('0x0'));var util=require(_0xc07b('0x1'));var moment=require(_0xc07b('0x2'));var BPromise=require(_0xc07b('0x3'));var rs=require(_0xc07b('0x4'));var fs=require('fs');var Redis=require(_0xc07b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc07b('0x6'));var logger=require('../../config/logger')(_0xc07b('0x7'));var config=require(_0xc07b('0x8'));var jayson=require(_0xc07b('0x9'));var client=jayson['client'][_0xc07b('0xa')]({'port':0x232a});config[_0xc07b('0xb')]=_['defaults'](config[_0xc07b('0xb')],{'host':_0xc07b('0xc'),'port':0x18eb});var socket=require(_0xc07b('0xd'))(new Redis(config[_0xc07b('0xb')]));require(_0xc07b('0xe'))[_0xc07b('0xf')](socket);function respondWithRpcPromise(_0x3cae6e,_0x422aaf,_0x2cc571){return new BPromise(function(_0x372995,_0x208de6){return client[_0xc07b('0x10')](_0x3cae6e,_0x2cc571)[_0xc07b('0x11')](function(_0x2afd5c){logger[_0xc07b('0x12')](_0xc07b('0x13'),_0x422aaf,_0xc07b('0x14'));logger[_0xc07b('0x15')](_0xc07b('0x16'),_0x422aaf,_0xc07b('0x14'),JSON[_0xc07b('0x17')](_0x2afd5c));if(_0x2afd5c[_0xc07b('0x18')]){if(_0x2afd5c['error'][_0xc07b('0x19')]===0x1f4){logger[_0xc07b('0x18')](_0xc07b('0x13'),_0x422aaf,_0x2afd5c[_0xc07b('0x18')]['message']);return _0x208de6(_0x2afd5c['error'][_0xc07b('0x1a')]);}logger[_0xc07b('0x18')](_0xc07b('0x13'),_0x422aaf,_0x2afd5c[_0xc07b('0x18')][_0xc07b('0x1a')]);return _0x372995(_0x2afd5c['error'][_0xc07b('0x1a')]);}else{logger[_0xc07b('0x12')](_0xc07b('0x13'),_0x422aaf,'request\x20sent');_0x372995(_0x2afd5c[_0xc07b('0x1b')][_0xc07b('0x1a')]);}})[_0xc07b('0x1c')](function(_0x1f009b){logger[_0xc07b('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x422aaf,_0x1f009b);_0x208de6(_0x1f009b);});});}exports['GetVoiceQueue']=function(_0x3bc9aa){var _0x2e2a17=this;return new Promise(function(_0x42389c,_0x185963){return db[_0xc07b('0x1d')]['findAll']({'raw':_0x3bc9aa[_0xc07b('0x1e')]?_0x3bc9aa['options'][_0xc07b('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bc9aa[_0xc07b('0x1e')]?_0x3bc9aa[_0xc07b('0x1e')][_0xc07b('0x20')]||null:null,'attributes':_0x3bc9aa[_0xc07b('0x1e')]?_0x3bc9aa[_0xc07b('0x1e')]['attributes']||null:null,'limit':_0x3bc9aa[_0xc07b('0x1e')]?_0x3bc9aa[_0xc07b('0x1e')][_0xc07b('0x21')]||null:null,'include':_0x3bc9aa[_0xc07b('0x1e')]?_0x3bc9aa[_0xc07b('0x1e')][_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x3bc9aa['options'][_0xc07b('0x22')],function(_0x2aa6a0){return{'model':db[_0x2aa6a0['model']],'as':_0x2aa6a0['as'],'attributes':_0x2aa6a0[_0xc07b('0x24')],'include':_0x2aa6a0[_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x2aa6a0[_0xc07b('0x22')],function(_0x5da3ce){return{'model':db[_0x5da3ce['model']],'as':_0x5da3ce['as'],'attributes':_0x5da3ce[_0xc07b('0x24')],'include':_0x5da3ce[_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x5da3ce[_0xc07b('0x22')],function(_0x130145){return{'model':db[_0x130145[_0xc07b('0x25')]],'as':_0x130145['as'],'attributes':_0x130145[_0xc07b('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc07b('0x11')](function(_0xecfa08){logger[_0xc07b('0x12')](_0xc07b('0x26'),_0x3bc9aa);logger[_0xc07b('0x15')](_0xc07b('0x26'),_0x3bc9aa,JSON['stringify'](_0xecfa08));_0x42389c(_0xecfa08);})[_0xc07b('0x1c')](function(_0x28e406){logger[_0xc07b('0x18')](_0xc07b('0x26'),_0x28e406['message'],_0x3bc9aa);_0x185963(_0x2e2a17[_0xc07b('0x18')](0x1f4,_0x28e406[_0xc07b('0x1a')]));});});};exports[_0xc07b('0x27')]=function(_0x30f818){var _0x14e125=this;return new Promise(function(_0x211483,_0x32522e){return db[_0xc07b('0x1d')][_0xc07b('0x28')]({'raw':_0x30f818[_0xc07b('0x1e')]?_0x30f818['options']['raw']===undefined?!![]:![]:!![],'where':_0x30f818[_0xc07b('0x1e')]?_0x30f818[_0xc07b('0x1e')][_0xc07b('0x20')]||null:null,'attributes':_0x30f818[_0xc07b('0x1e')]?_0x30f818[_0xc07b('0x1e')][_0xc07b('0x24')]||null:null,'include':_0x30f818[_0xc07b('0x1e')]?_0x30f818['options'][_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x30f818[_0xc07b('0x1e')][_0xc07b('0x22')],function(_0x59d662){return{'model':db[_0x59d662[_0xc07b('0x25')]],'as':_0x59d662['as'],'attributes':_0x59d662['attributes'],'include':_0x59d662[_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x59d662[_0xc07b('0x22')],function(_0x2ef2ee){return{'model':db[_0x2ef2ee[_0xc07b('0x25')]],'as':_0x2ef2ee['as'],'attributes':_0x2ef2ee[_0xc07b('0x24')],'include':_0x2ef2ee[_0xc07b('0x22')]?_[_0xc07b('0x23')](_0x2ef2ee[_0xc07b('0x22')],function(_0x55e353){return{'model':db[_0x55e353[_0xc07b('0x25')]],'as':_0x55e353['as'],'attributes':_0x55e353[_0xc07b('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc07b('0x11')](function(_0x47b6be){logger['info'](_0xc07b('0x27'),_0x30f818);logger[_0xc07b('0x15')](_0xc07b('0x27'),_0x30f818,JSON[_0xc07b('0x17')](_0x47b6be));_0x211483(_0x47b6be);})[_0xc07b('0x1c')](function(_0x176826){logger[_0xc07b('0x18')]('ShowVoiceQueue',_0x176826[_0xc07b('0x1a')],_0x30f818);_0x32522e(_0x14e125[_0xc07b('0x18')](0x1f4,_0x176826[_0xc07b('0x1a')]));});});}; \ No newline at end of file +var _0x5786=['redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','model','include','attributes','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x5786,0x14d));var _0x6578=function(_0x21dae8,_0x17b70f){_0x21dae8=_0x21dae8-0x0;var _0x1818db=_0x5786[_0x21dae8];return _0x1818db;};'use strict';var _=require(_0x6578('0x0'));var util=require(_0x6578('0x1'));var moment=require(_0x6578('0x2'));var BPromise=require(_0x6578('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6578('0x4'))['db'];var utils=require(_0x6578('0x5'));var logger=require(_0x6578('0x6'))('rpc');var config=require(_0x6578('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6578('0x8')]({'port':0x232a});config[_0x6578('0x9')]=_[_0x6578('0xa')](config[_0x6578('0x9')],{'host':_0x6578('0xb'),'port':0x18eb});var socket=require(_0x6578('0xc'))(new Redis(config['redis']));require(_0x6578('0xd'))[_0x6578('0xe')](socket);function respondWithRpcPromise(_0x3375eb,_0x60f6de,_0x179b56){return new BPromise(function(_0x3cf290,_0x417f70){return client['request'](_0x3375eb,_0x179b56)[_0x6578('0xf')](function(_0x26aacc){logger['info'](_0x6578('0x10'),_0x60f6de,_0x6578('0x11'));logger[_0x6578('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x60f6de,_0x6578('0x11'),JSON[_0x6578('0x13')](_0x26aacc));if(_0x26aacc[_0x6578('0x14')]){if(_0x26aacc[_0x6578('0x14')][_0x6578('0x15')]===0x1f4){logger[_0x6578('0x14')](_0x6578('0x10'),_0x60f6de,_0x26aacc[_0x6578('0x14')][_0x6578('0x16')]);return _0x417f70(_0x26aacc['error'][_0x6578('0x16')]);}logger[_0x6578('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x60f6de,_0x26aacc[_0x6578('0x14')][_0x6578('0x16')]);return _0x3cf290(_0x26aacc[_0x6578('0x14')]['message']);}else{logger[_0x6578('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x60f6de,_0x6578('0x11'));_0x3cf290(_0x26aacc['result'][_0x6578('0x16')]);}})['catch'](function(_0x10a53e){logger['error'](_0x6578('0x10'),_0x60f6de,_0x10a53e);_0x417f70(_0x10a53e);});});}exports[_0x6578('0x18')]=function(_0x24887c){var _0x36c341=this;return new Promise(function(_0x4b6b1b,_0x1e268a){return db[_0x6578('0x19')][_0x6578('0x1a')]({'raw':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1c')]===undefined?!![]:![]:!![],'where':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1d')]||null:null,'attributes':_0x24887c['options']?_0x24887c[_0x6578('0x1b')]['attributes']||null:null,'limit':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1e')]||null:null,'include':_0x24887c[_0x6578('0x1b')]?_0x24887c['options']['include']?_[_0x6578('0x1f')](_0x24887c[_0x6578('0x1b')]['include'],function(_0x45db70){return{'model':db[_0x45db70[_0x6578('0x20')]],'as':_0x45db70['as'],'attributes':_0x45db70['attributes'],'include':_0x45db70[_0x6578('0x21')]?_['map'](_0x45db70[_0x6578('0x21')],function(_0x37f5ae){return{'model':db[_0x37f5ae[_0x6578('0x20')]],'as':_0x37f5ae['as'],'attributes':_0x37f5ae[_0x6578('0x22')],'include':_0x37f5ae[_0x6578('0x21')]?_[_0x6578('0x1f')](_0x37f5ae[_0x6578('0x21')],function(_0x27875a){return{'model':db[_0x27875a['model']],'as':_0x27875a['as'],'attributes':_0x27875a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6578('0xf')](function(_0x4843ed){logger[_0x6578('0x17')](_0x6578('0x18'),_0x24887c);logger[_0x6578('0x12')](_0x6578('0x18'),_0x24887c,JSON[_0x6578('0x13')](_0x4843ed));_0x4b6b1b(_0x4843ed);})[_0x6578('0x23')](function(_0x8b5c0b){logger[_0x6578('0x14')](_0x6578('0x18'),_0x8b5c0b['message'],_0x24887c);_0x1e268a(_0x36c341[_0x6578('0x14')](0x1f4,_0x8b5c0b['message']));});});};exports[_0x6578('0x24')]=function(_0x3e6b54){var _0x47e375=this;return new Promise(function(_0xbc2e57,_0x460c30){return db['VoiceQueue'][_0x6578('0x25')]({'raw':_0x3e6b54['options']?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e6b54['options']?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x1d')]||null:null,'attributes':_0x3e6b54[_0x6578('0x1b')]?_0x3e6b54[_0x6578('0x1b')]['attributes']||null:null,'include':_0x3e6b54[_0x6578('0x1b')]?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x21')]?_['map'](_0x3e6b54['options'][_0x6578('0x21')],function(_0x5acd9a){return{'model':db[_0x5acd9a[_0x6578('0x20')]],'as':_0x5acd9a['as'],'attributes':_0x5acd9a[_0x6578('0x22')],'include':_0x5acd9a[_0x6578('0x21')]?_['map'](_0x5acd9a[_0x6578('0x21')],function(_0x1fe582){return{'model':db[_0x1fe582[_0x6578('0x20')]],'as':_0x1fe582['as'],'attributes':_0x1fe582['attributes'],'include':_0x1fe582[_0x6578('0x21')]?_[_0x6578('0x1f')](_0x1fe582[_0x6578('0x21')],function(_0x9c2046){return{'model':db[_0x9c2046[_0x6578('0x20')]],'as':_0x9c2046['as'],'attributes':_0x9c2046[_0x6578('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6578('0xf')](function(_0x244d81){logger[_0x6578('0x17')](_0x6578('0x24'),_0x3e6b54);logger[_0x6578('0x12')](_0x6578('0x24'),_0x3e6b54,JSON[_0x6578('0x13')](_0x244d81));_0xbc2e57(_0x244d81);})[_0x6578('0x23')](function(_0x2d23d1){logger[_0x6578('0x14')](_0x6578('0x24'),_0x2d23d1[_0x6578('0x16')],_0x3e6b54);_0x460c30(_0x47e375['error'](0x1f4,_0x2d23d1['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 16b7099..c765934 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 _0x2530=['update','removeListener','register','./voiceQueue.events','save','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2530,0x81));var _0x0253=function(_0x1d7b2c,_0x2f72cf){_0x1d7b2c=_0x1d7b2c-0x0;var _0x5bf5c1=_0x2530[_0x1d7b2c];return _0x5bf5c1;};'use strict';var VoiceQueueEvents=require(_0x0253('0x0'));var events=[_0x0253('0x1'),_0x0253('0x2'),_0x0253('0x3')];function createListener(_0x7cf86,_0x3f290a){return function(_0x199d75){_0x3f290a['emit'](_0x7cf86,_0x199d75);};}function removeListener(_0x164e1d,_0x1dca27){return function(){VoiceQueueEvents[_0x0253('0x4')](_0x164e1d,_0x1dca27);};}exports[_0x0253('0x5')]=function(_0x80f552){for(var _0x119472=0x0,_0x38e01d=events['length'];_0x119472<_0x38e01d;_0x119472++){var _0xbb2a67=events[_0x119472];var _0x1bc313=createListener('voiceQueue:'+_0xbb2a67,_0x80f552);VoiceQueueEvents['on'](_0xbb2a67,_0x1bc313);}}; \ No newline at end of file +var _0x2333=['remove','update','emit','removeListener','register','length','./voiceQueue.events'];(function(_0x197897,_0x237e45){var _0x5c2932=function(_0x587914){while(--_0x587914){_0x197897['push'](_0x197897['shift']());}};_0x5c2932(++_0x237e45);}(_0x2333,0x148));var _0x3233=function(_0x4f785a,_0x14d24e){_0x4f785a=_0x4f785a-0x0;var _0x13dd1a=_0x2333[_0x4f785a];return _0x13dd1a;};'use strict';var VoiceQueueEvents=require(_0x3233('0x0'));var events=['save',_0x3233('0x1'),_0x3233('0x2')];function createListener(_0x5b715c,_0x514374){return function(_0x3fc7a2){_0x514374[_0x3233('0x3')](_0x5b715c,_0x3fc7a2);};}function removeListener(_0x533ee6,_0x3b4313){return function(){VoiceQueueEvents[_0x3233('0x4')](_0x533ee6,_0x3b4313);};}exports[_0x3233('0x5')]=function(_0x28646b){for(var _0xe46384=0x0,_0xb14693=events[_0x3233('0x6')];_0xe46384<_0xb14693;_0xe46384++){var _0x3b2018=events[_0xe46384];var _0x799ebb=createListener('voiceQueue:'+_0x3b2018,_0x28646b);VoiceQueueEvents['on'](_0x3b2018,_0x799ebb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index f6cc7d4..496572f 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 _0x64be=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b6657,_0x19446a){var _0x4fc84d=function(_0x2342e7){while(--_0x2342e7){_0x4b6657['push'](_0x4b6657['shift']());}};_0x4fc84d(++_0x19446a);}(_0x64be,0x92));var _0xe64b=function(_0x50d326,_0x357d5a){_0x50d326=_0x50d326-0x0;var _0x237940=_0x64be[_0x50d326];return _0x237940;};'use strict';var multer=require(_0xe64b('0x0'));var util=require('util');var path=require(_0xe64b('0x1'));var timeout=require(_0xe64b('0x2'));var express=require(_0xe64b('0x3'));var router=express[_0xe64b('0x4')]();var fs_extra=require(_0xe64b('0x5'));var auth=require(_0xe64b('0x6'));var interaction=require(_0xe64b('0x7'));var config=require('../../config/environment');var controller=require(_0xe64b('0x8'));router[_0xe64b('0x9')]('/',auth[_0xe64b('0xa')](),controller[_0xe64b('0xb')]);router[_0xe64b('0x9')](_0xe64b('0xc'),auth['isAuthenticated'](),controller[_0xe64b('0xd')]);router[_0xe64b('0x9')](_0xe64b('0xe'),auth[_0xe64b('0xa')](),controller[_0xe64b('0xf')]);router[_0xe64b('0x9')](_0xe64b('0x10'),auth[_0xe64b('0xa')](),controller[_0xe64b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe64b('0x10'),auth[_0xe64b('0xa')](),controller[_0xe64b('0x12')]);router[_0xe64b('0x13')](_0xe64b('0x10'),auth[_0xe64b('0xa')](),controller[_0xe64b('0x14')]);module[_0xe64b('0x15')]=router; \ No newline at end of file +var _0x6600=['/:id','isAuthenticated','post','put','update','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service','get','/describe','describe','getVoiceQueuesReport'];(function(_0x13b3b7,_0x5c39c0){var _0xe21777=function(_0xeed1e9){while(--_0xeed1e9){_0x13b3b7['push'](_0x13b3b7['shift']());}};_0xe21777(++_0x5c39c0);}(_0x6600,0x106));var _0x0660=function(_0x28c8cc,_0x231acc){_0x28c8cc=_0x28c8cc-0x0;var _0x1a24fc=_0x6600[_0x28c8cc];return _0x1a24fc;};'use strict';var multer=require('multer');var util=require(_0x0660('0x0'));var path=require(_0x0660('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0660('0x2'));var interaction=require(_0x0660('0x3'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x0660('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0660('0x5'),auth['isAuthenticated'](),controller[_0x0660('0x6')]);router[_0x0660('0x4')]('/index',auth['isAuthenticated'](),controller[_0x0660('0x7')]);router['get'](_0x0660('0x8'),auth[_0x0660('0x9')](),controller['show']);router[_0x0660('0xa')]('/',auth[_0x0660('0x9')](),controller['create']);router[_0x0660('0xb')](_0x0660('0x8'),auth[_0x0660('0x9')](),controller[_0x0660('0xc')]);router[_0x0660('0xd')]('/:id',auth[_0x0660('0x9')](),controller[_0x0660('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d2b47f2..5588c03 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 _0x8ecc=['seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x2dde31,_0x2265f5){var _0x2b35bb=function(_0x3a69f8){while(--_0x3a69f8){_0x2dde31['push'](_0x2dde31['shift']());}};_0x2b35bb(++_0x2265f5);}(_0x8ecc,0x15f));var _0xc8ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ecc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8ec('0x0'));var moment=require(_0xc8ec('0x1'));module[_0xc8ec('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc8ec('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc8ec('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xc8ec('0x4')],'set':function(_0x322a48){var _0x1c8279=moment(_0x322a48);var _0x59a691=moment(this[_0xc8ec('0x5')](_0xc8ec('0x6')))['format'](_0xc8ec('0x7'));var _0x3354a8=_0x1c8279[_0xc8ec('0x8')](_0x59a691,_0xc8ec('0x9'));this[_0xc8ec('0xa')]('queuecallerleaveAt',_0x322a48);this[_0xc8ec('0xa')]('holdtime',_0x3354a8||null);}},'position':{'type':Sequelize[_0xc8ec('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc8ec('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xc8ec('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc8ec('0x4')]},'queuecallerexit':{'type':Sequelize[_0xc8ec('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc8ec('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xc8ec('0x3')],'comment':_0xc8ec('0xd')},'originalposition':{'type':Sequelize[_0xc8ec('0xb')]},'channel':{'type':Sequelize[_0xc8ec('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc8ec('0x3')]},'accountcode':{'type':Sequelize[_0xc8ec('0x3')]},'context':{'type':Sequelize[_0xc8ec('0x3')]},'exten':{'type':Sequelize[_0xc8ec('0x3')]},'priority':{'type':Sequelize[_0xc8ec('0x3')]},'holdtime':{'type':Sequelize[_0xc8ec('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc8ec('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc8ec('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xc8ec('0xe')},'transferexten':{'type':Sequelize[_0xc8ec('0x3')]},'transferuniqueid':{'type':Sequelize[_0xc8ec('0x3')]},'disposition':{'type':Sequelize[_0xc8ec('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c31=['DATE','getDataValue','format','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x0c31,0x1e6));var _0x10c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c31[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x10c3('0x0'));var moment=require(_0x10c3('0x1'));module[_0x10c3('0x2')]={'type':{'type':Sequelize[_0x10c3('0x3')]},'uniqueid':{'type':Sequelize[_0x10c3('0x3')]},'calleridnum':{'type':Sequelize[_0x10c3('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x10c3('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x10c3('0x4')],'set':function(_0x214acb){var _0x1def86=moment(_0x214acb);var _0x42925e=moment(this[_0x10c3('0x5')]('queuecallerjoinAt'))[_0x10c3('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x17b838=_0x1def86['diff'](_0x42925e,_0x10c3('0x7'));this['setDataValue'](_0x10c3('0x8'),_0x214acb);this[_0x10c3('0x9')](_0x10c3('0xa'),_0x17b838||null);}},'position':{'type':Sequelize[_0x10c3('0xb')]},'count':{'type':Sequelize[_0x10c3('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerexit':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x10c3('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x10c3('0x3')]},'connectedlinenum':{'type':Sequelize[_0x10c3('0x3')]},'connectedlinename':{'type':Sequelize[_0x10c3('0x3')]},'accountcode':{'type':Sequelize[_0x10c3('0x3')]},'context':{'type':Sequelize[_0x10c3('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x10c3('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x10c3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x10c3('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x10c3('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x10c3('0x3')]},'disposition':{'type':Sequelize[_0x10c3('0x3')]},'secondDisposition':{'type':Sequelize[_0x10c3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x10c3('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 719f0b7..7a43071 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 _0xf4e3=['./voiceQueueReport.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x5b4374,_0x26f815){var _0x41bef7=function(_0xfea463){while(--_0xfea463){_0x5b4374['push'](_0x5b4374['shift']());}};_0x41bef7(++_0x26f815);}(_0xf4e3,0x136));var _0x3f4e=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0xf4e3[_0x4da382];return _0x10073f;};'use strict';var emlformat=require(_0x3f4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f4e('0x1'));var jsonpatch=require(_0x3f4e('0x2'));var rp=require(_0x3f4e('0x3'));var moment=require(_0x3f4e('0x4'));var BPromise=require(_0x3f4e('0x5'));var Mustache=require(_0x3f4e('0x6'));var util=require(_0x3f4e('0x7'));var path=require(_0x3f4e('0x8'));var sox=require(_0x3f4e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f4e('0xa'));var _=require(_0x3f4e('0xb'));var squel=require('squel');var crypto=require(_0x3f4e('0xc'));var jsforce=require(_0x3f4e('0xd'));var deskjs=require(_0x3f4e('0xe'));var toCsv=require(_0x3f4e('0xf'));var querystring=require(_0x3f4e('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f4e('0x11'));var authService=require(_0x3f4e('0x12'));var qs=require(_0x3f4e('0x13'));var as=require(_0x3f4e('0x14'));var hardwareService=require(_0x3f4e('0x15'));var logger=require(_0x3f4e('0x16'))(_0x3f4e('0x17'));var utils=require('../../config/utils');var config=require(_0x3f4e('0x18'));var licenseUtil=require(_0x3f4e('0x19'));var db=require(_0x3f4e('0x1a'))['db'];config[_0x3f4e('0x1b')]=_[_0x3f4e('0x1c')](config[_0x3f4e('0x1b')],{'host':_0x3f4e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f4e('0x1b')]));require(_0x3f4e('0x1e'))['register'](socket);function respondWithStatusCode(_0x2c9171,_0x3a91db){_0x3a91db=_0x3a91db||0xcc;return function(_0x35ab71){if(_0x35ab71){return _0x2c9171[_0x3f4e('0x1f')](_0x3a91db);}return _0x2c9171[_0x3f4e('0x20')](_0x3a91db)[_0x3f4e('0x21')]();};}function respondWithResult(_0x3bce38,_0x35c442){_0x35c442=_0x35c442||0xc8;return function(_0x3f774c){if(_0x3f774c){return _0x3bce38[_0x3f4e('0x20')](_0x35c442)['json'](_0x3f774c);}};}function respondWithFilteredResult(_0x5c12fc,_0x2de108){return function(_0x37cae9){if(_0x37cae9){var _0x58f715=typeof _0x2de108[_0x3f4e('0x22')]===_0x3f4e('0x23')&&typeof _0x2de108[_0x3f4e('0x24')]===_0x3f4e('0x23');var _0x5999ea=_0x37cae9[_0x3f4e('0x25')];var _0x485e88=_0x58f715?0x0:_0x2de108['offset'];var _0x55d80d=_0x58f715?_0x37cae9[_0x3f4e('0x25')]:_0x2de108['offset']+_0x2de108[_0x3f4e('0x24')];var _0x1ecdb7;if(_0x55d80d>=_0x5999ea){_0x55d80d=_0x5999ea;_0x1ecdb7=0xc8;}else{_0x1ecdb7=0xce;}_0x5c12fc[_0x3f4e('0x20')](_0x1ecdb7);return _0x5c12fc[_0x3f4e('0x26')](_0x3f4e('0x27'),_0x485e88+'-'+_0x55d80d+'/'+_0x5999ea)[_0x3f4e('0x28')](_0x37cae9);}return null;};}function patchUpdates(_0x55afe3){return function(_0x3cc8e7){try{jsonpatch[_0x3f4e('0x29')](_0x3cc8e7,_0x55afe3,!![]);}catch(_0x4a1d2e){return BPromise[_0x3f4e('0x2a')](_0x4a1d2e);}return _0x3cc8e7[_0x3f4e('0x2b')]();};}function saveUpdates(_0x2c4dbc,_0x48f99f){return function(_0x3380c9){if(_0x3380c9){return _0x3380c9[_0x3f4e('0x2c')](_0x2c4dbc)[_0x3f4e('0x2d')](function(_0xf88589){return _0xf88589;});}return null;};}function removeEntity(_0x1fbeb7,_0x574d6b){return function(_0x335c2e){if(_0x335c2e){return _0x335c2e[_0x3f4e('0x2e')]()[_0x3f4e('0x2d')](function(){_0x1fbeb7['status'](0xcc)[_0x3f4e('0x21')]();});}};}function handleEntityNotFound(_0x491c06,_0x3531fc){return function(_0x3b8c3f){if(!_0x3b8c3f){_0x491c06['sendStatus'](0x194);}return _0x3b8c3f;};}function handleError(_0x16dda5,_0x1e828b){_0x1e828b=_0x1e828b||0x1f4;return function(_0x78995e){logger[_0x3f4e('0x2f')](_0x78995e['stack']);if(_0x78995e['name']){delete _0x78995e[_0x3f4e('0x30')];}_0x16dda5[_0x3f4e('0x20')](_0x1e828b)[_0x3f4e('0x31')](_0x78995e);};}exports[_0x3f4e('0x32')]=function(_0x49da14,_0x1d45db){var _0x59c0dc={},_0x4b0982={},_0x44a976={'count':0x0,'rows':[]};var _0x445102=_[_0x3f4e('0x33')](db[_0x3f4e('0x34')][_0x3f4e('0x35')],function(_0x1f3890){return{'name':_0x1f3890[_0x3f4e('0x36')],'type':_0x1f3890[_0x3f4e('0x37')][_0x3f4e('0x38')]};});_0x4b0982['model']=_[_0x3f4e('0x33')](_0x445102,_0x3f4e('0x30'));_0x4b0982[_0x3f4e('0x39')]=_[_0x3f4e('0x3a')](_0x49da14[_0x3f4e('0x39')]);_0x4b0982[_0x3f4e('0x3b')]=_[_0x3f4e('0x3c')](_0x4b0982['model'],_0x4b0982[_0x3f4e('0x39')]);_0x59c0dc[_0x3f4e('0x3d')]=_[_0x3f4e('0x3c')](_0x4b0982[_0x3f4e('0x3e')],qs[_0x3f4e('0x3f')](_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x3f')]));_0x59c0dc[_0x3f4e('0x3d')]=_0x59c0dc[_0x3f4e('0x3d')][_0x3f4e('0x40')]?_0x59c0dc['attributes']:_0x4b0982[_0x3f4e('0x3e')];if(!_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x41')](_0x3f4e('0x42'))){_0x59c0dc[_0x3f4e('0x24')]=qs[_0x3f4e('0x24')](_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x24')]);_0x59c0dc[_0x3f4e('0x22')]=qs[_0x3f4e('0x22')](_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x22')]);}_0x59c0dc[_0x3f4e('0x43')]=qs[_0x3f4e('0x44')](_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x44')]);_0x59c0dc['where']=qs[_0x3f4e('0x3b')](_[_0x3f4e('0x45')](_0x49da14[_0x3f4e('0x39')],_0x4b0982[_0x3f4e('0x3b')]),_0x445102);if(_0x49da14['query'][_0x3f4e('0x46')]){_0x59c0dc[_0x3f4e('0x47')]=_[_0x3f4e('0x48')](_0x59c0dc[_0x3f4e('0x47')],{'$or':_[_0x3f4e('0x33')](_0x445102,function(_0x44d8d2){if(_0x44d8d2[_0x3f4e('0x37')]!=='VIRTUAL'){var _0x1a70c9={};_0x1a70c9[_0x44d8d2[_0x3f4e('0x30')]]={'$like':'%'+_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x46')]+'%'};return _0x1a70c9;}})});}_0x59c0dc=_[_0x3f4e('0x48')]({},_0x59c0dc,_0x49da14['options']);var _0x56fcde={'where':_0x59c0dc[_0x3f4e('0x47')]};return db[_0x3f4e('0x34')][_0x3f4e('0x25')](_0x56fcde)['then'](function(_0x1401de){_0x44a976[_0x3f4e('0x25')]=_0x1401de;if(_0x49da14[_0x3f4e('0x39')][_0x3f4e('0x49')]){_0x59c0dc[_0x3f4e('0x4a')]=[{'all':!![]}];}return db[_0x3f4e('0x34')][_0x3f4e('0x4b')](_0x59c0dc);})[_0x3f4e('0x2d')](function(_0x1c3d58){_0x44a976[_0x3f4e('0x4c')]=_0x1c3d58;return _0x44a976;})[_0x3f4e('0x2d')](respondWithFilteredResult(_0x1d45db,_0x59c0dc))[_0x3f4e('0x4d')](handleError(_0x1d45db,null));};exports['show']=function(_0x25806a,_0xc975d2){var _0x52f758={'raw':![],'where':{'id':_0x25806a[_0x3f4e('0x4e')]['id']}},_0x895b54={};_0x895b54['model']=_['keys'](db[_0x3f4e('0x34')][_0x3f4e('0x35')]);_0x895b54[_0x3f4e('0x39')]=_['keys'](_0x25806a[_0x3f4e('0x39')]);_0x895b54[_0x3f4e('0x3b')]=_[_0x3f4e('0x3c')](_0x895b54[_0x3f4e('0x3e')],_0x895b54[_0x3f4e('0x39')]);_0x52f758[_0x3f4e('0x3d')]=_[_0x3f4e('0x3c')](_0x895b54[_0x3f4e('0x3e')],qs['fields'](_0x25806a[_0x3f4e('0x39')][_0x3f4e('0x3f')]));_0x52f758[_0x3f4e('0x3d')]=_0x52f758[_0x3f4e('0x3d')][_0x3f4e('0x40')]?_0x52f758[_0x3f4e('0x3d')]:_0x895b54[_0x3f4e('0x3e')];if(_0x25806a[_0x3f4e('0x39')][_0x3f4e('0x49')]){_0x52f758['include']=[{'all':!![]}];}_0x52f758=_[_0x3f4e('0x48')]({},_0x52f758,_0x25806a[_0x3f4e('0x4f')]);return db[_0x3f4e('0x34')][_0x3f4e('0x50')](_0x52f758)['then'](handleEntityNotFound(_0xc975d2,null))[_0x3f4e('0x2d')](respondWithResult(_0xc975d2,null))[_0x3f4e('0x4d')](handleError(_0xc975d2,null));};exports[_0x3f4e('0x51')]=function(_0x85d280,_0xa4c58a){return db[_0x3f4e('0x34')][_0x3f4e('0x51')](_0x85d280['body'],{})[_0x3f4e('0x2d')](respondWithResult(_0xa4c58a,0xc9))['catch'](handleError(_0xa4c58a,null));};exports[_0x3f4e('0x2c')]=function(_0x1e5d43,_0xef4158){if(_0x1e5d43[_0x3f4e('0x52')]['id']){delete _0x1e5d43['body']['id'];}return db[_0x3f4e('0x34')][_0x3f4e('0x50')]({'where':{'id':_0x1e5d43[_0x3f4e('0x4e')]['id']}})[_0x3f4e('0x2d')](handleEntityNotFound(_0xef4158,null))['then'](saveUpdates(_0x1e5d43[_0x3f4e('0x52')],null))[_0x3f4e('0x2d')](respondWithResult(_0xef4158,null))[_0x3f4e('0x4d')](handleError(_0xef4158,null));};exports[_0x3f4e('0x2e')]=function(_0x1434dd,_0x5e49ad){return db[_0x3f4e('0x34')][_0x3f4e('0x50')]({'where':{'id':_0x1434dd[_0x3f4e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e49ad,null))[_0x3f4e('0x2d')](removeEntity(_0x5e49ad,null))[_0x3f4e('0x4d')](handleError(_0x5e49ad,null));};exports[_0x3f4e('0x53')]=function(_0x37174d,_0x44ad41){return db['VoiceQueueReport'][_0x3f4e('0x53')]()[_0x3f4e('0x2d')](respondWithResult(_0x44ad41,null))[_0x3f4e('0x4d')](handleError(_0x44ad41,null));};exports['getVoiceQueuesReport']=function(_0x27a9da,_0x2b4fe2){var _0x23b15b={},_0x42fb4d={},_0x2e464c={'count':0x0,'rows':[]};_0x42fb4d[_0x3f4e('0x3e')]=_[_0x3f4e('0x3a')](db[_0x3f4e('0x34')][_0x3f4e('0x35')]);_0x42fb4d[_0x3f4e('0x39')]=_[_0x3f4e('0x3a')](_0x27a9da[_0x3f4e('0x39')]);_0x42fb4d[_0x3f4e('0x3b')]=_[_0x3f4e('0x3c')](_0x42fb4d[_0x3f4e('0x3e')],_0x42fb4d[_0x3f4e('0x39')]);_0x23b15b['attributes']=_['intersection'](_0x42fb4d[_0x3f4e('0x3e')],qs[_0x3f4e('0x3f')](_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x3f')]));_0x23b15b[_0x3f4e('0x3d')]=_0x23b15b[_0x3f4e('0x3d')][_0x3f4e('0x40')]?_0x23b15b['attributes']:_0x42fb4d[_0x3f4e('0x3e')];if(!_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x41')](_0x3f4e('0x42'))){_0x23b15b['limit']=qs['limit'](_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x24')]);_0x23b15b[_0x3f4e('0x22')]=qs[_0x3f4e('0x22')](_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x22')]);}_0x23b15b['order']=qs['sort'](_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x44')]);_0x23b15b[_0x3f4e('0x47')]=qs[_0x3f4e('0x3b')](_[_0x3f4e('0x45')](_0x27a9da[_0x3f4e('0x39')],_0x42fb4d[_0x3f4e('0x3b')]));if(_0x27a9da[_0x3f4e('0x39')][_0x3f4e('0x46')]){_0x23b15b[_0x3f4e('0x47')]=_['merge'](_0x23b15b['where'],{'$or':_[_0x3f4e('0x33')](_0x23b15b[_0x3f4e('0x3d')],function(_0x322398){var _0x53db5b={};_0x53db5b[_0x322398]={'$like':'%'+_0x27a9da['query'][_0x3f4e('0x46')]+'%'};return _0x53db5b;})});}_0x23b15b=_[_0x3f4e('0x48')]({},_0x23b15b,_0x27a9da[_0x3f4e('0x4f')]);var _0x5308c2={'where':_0x23b15b[_0x3f4e('0x47')]};return db[_0x3f4e('0x34')][_0x3f4e('0x25')](_0x5308c2)[_0x3f4e('0x2d')](function(_0x389f63){_0x2e464c['count']=_0x389f63;if(_0x27a9da[_0x3f4e('0x39')]['includeAll']){_0x23b15b[_0x3f4e('0x4a')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3f4e('0x4b')](_0x23b15b);})[_0x3f4e('0x2d')](function(_0x1256a2){_0x2e464c[_0x3f4e('0x4c')]=_0x1256a2;return _0x2e464c;})[_0x3f4e('0x2d')](respondWithFilteredResult(_0x2b4fe2,_0x23b15b,_0x3f4e('0x54')))['catch'](handleError(_0x2b4fe2,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xeb88=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','hasOwnProperty','sort','pick','getVoiceQueuesReport','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x37cafa,_0x12b559){var _0x24c098=function(_0x2265e1){while(--_0x2265e1){_0x37cafa['push'](_0x37cafa['shift']());}};_0x24c098(++_0x12b559);}(_0xeb88,0x1d6));var _0x8eb8=function(_0x1daa49,_0x47e17a){_0x1daa49=_0x1daa49-0x0;var _0x2108e0=_0xeb88[_0x1daa49];return _0x2108e0;};'use strict';var emlformat=require(_0x8eb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8eb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8eb8('0x2'));var moment=require(_0x8eb8('0x3'));var BPromise=require(_0x8eb8('0x4'));var Mustache=require('mustache');var util=require(_0x8eb8('0x5'));var path=require(_0x8eb8('0x6'));var sox=require(_0x8eb8('0x7'));var csv=require(_0x8eb8('0x8'));var ejs=require(_0x8eb8('0x9'));var fs=require('fs');var fs_extra=require(_0x8eb8('0xa'));var _=require(_0x8eb8('0xb'));var squel=require(_0x8eb8('0xc'));var crypto=require(_0x8eb8('0xd'));var jsforce=require(_0x8eb8('0xe'));var deskjs=require(_0x8eb8('0xf'));var toCsv=require(_0x8eb8('0x8'));var querystring=require(_0x8eb8('0x10'));var Papa=require('papaparse');var Redis=require(_0x8eb8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8eb8('0x12'));var as=require(_0x8eb8('0x13'));var hardwareService=require(_0x8eb8('0x14'));var logger=require(_0x8eb8('0x15'))('api');var utils=require(_0x8eb8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8eb8('0x17'))['db'];config[_0x8eb8('0x18')]=_[_0x8eb8('0x19')](config[_0x8eb8('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8eb8('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x1dfe90,_0x2789c8){_0x2789c8=_0x2789c8||0xcc;return function(_0xb4cd52){if(_0xb4cd52){return _0x1dfe90[_0x8eb8('0x1a')](_0x2789c8);}return _0x1dfe90[_0x8eb8('0x1b')](_0x2789c8)[_0x8eb8('0x1c')]();};}function respondWithResult(_0x4dda84,_0x5e8ab2){_0x5e8ab2=_0x5e8ab2||0xc8;return function(_0x2691f5){if(_0x2691f5){return _0x4dda84[_0x8eb8('0x1b')](_0x5e8ab2)[_0x8eb8('0x1d')](_0x2691f5);}};}function respondWithFilteredResult(_0x1272b1,_0x4896d5){return function(_0x54a3ce){if(_0x54a3ce){var _0x2d328d=typeof _0x4896d5[_0x8eb8('0x1e')]===_0x8eb8('0x1f')&&typeof _0x4896d5[_0x8eb8('0x20')]==='undefined';var _0x51ddb4=_0x54a3ce[_0x8eb8('0x21')];var _0x2ae550=_0x2d328d?0x0:_0x4896d5[_0x8eb8('0x1e')];var _0x1a09b3=_0x2d328d?_0x54a3ce[_0x8eb8('0x21')]:_0x4896d5[_0x8eb8('0x1e')]+_0x4896d5['limit'];var _0x34b499;if(_0x1a09b3>=_0x51ddb4){_0x1a09b3=_0x51ddb4;_0x34b499=0xc8;}else{_0x34b499=0xce;}_0x1272b1['status'](_0x34b499);return _0x1272b1[_0x8eb8('0x22')]('Content-Range',_0x2ae550+'-'+_0x1a09b3+'/'+_0x51ddb4)['json'](_0x54a3ce);}return null;};}function patchUpdates(_0x245dfd){return function(_0x407806){try{jsonpatch[_0x8eb8('0x23')](_0x407806,_0x245dfd,!![]);}catch(_0x1f498b){return BPromise['reject'](_0x1f498b);}return _0x407806[_0x8eb8('0x24')]();};}function saveUpdates(_0x39a601,_0xcf99e3){return function(_0x152d27){if(_0x152d27){return _0x152d27[_0x8eb8('0x25')](_0x39a601)['then'](function(_0x339ceb){return _0x339ceb;});}return null;};}function removeEntity(_0x193bc7,_0x458809){return function(_0x291e6e){if(_0x291e6e){return _0x291e6e['destroy']()[_0x8eb8('0x26')](function(){_0x193bc7[_0x8eb8('0x1b')](0xcc)[_0x8eb8('0x1c')]();});}};}function handleEntityNotFound(_0x2aef2d,_0x2bfb60){return function(_0x21e52e){if(!_0x21e52e){_0x2aef2d[_0x8eb8('0x1a')](0x194);}return _0x21e52e;};}function handleError(_0x2878da,_0x446bad){_0x446bad=_0x446bad||0x1f4;return function(_0x4ca8f2){logger[_0x8eb8('0x27')](_0x4ca8f2[_0x8eb8('0x28')]);if(_0x4ca8f2[_0x8eb8('0x29')]){delete _0x4ca8f2[_0x8eb8('0x29')];}_0x2878da[_0x8eb8('0x1b')](_0x446bad)[_0x8eb8('0x2a')](_0x4ca8f2);};}exports[_0x8eb8('0x2b')]=function(_0x23bd6c,_0xa436a3){var _0x4205aa={},_0x2173e2={},_0x2d6bff={'count':0x0,'rows':[]};var _0x305760=_[_0x8eb8('0x2c')](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')],function(_0x3422f7){return{'name':_0x3422f7[_0x8eb8('0x2f')],'type':_0x3422f7[_0x8eb8('0x30')][_0x8eb8('0x31')]};});_0x2173e2[_0x8eb8('0x32')]=_[_0x8eb8('0x2c')](_0x305760,_0x8eb8('0x29'));_0x2173e2[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x23bd6c['query']);_0x2173e2[_0x8eb8('0x35')]=_['intersection'](_0x2173e2['model'],_0x2173e2[_0x8eb8('0x33')]);_0x4205aa[_0x8eb8('0x36')]=_[_0x8eb8('0x37')](_0x2173e2[_0x8eb8('0x32')],qs[_0x8eb8('0x38')](_0x23bd6c[_0x8eb8('0x33')]['fields']));_0x4205aa[_0x8eb8('0x36')]=_0x4205aa[_0x8eb8('0x36')][_0x8eb8('0x39')]?_0x4205aa['attributes']:_0x2173e2[_0x8eb8('0x32')];if(!_0x23bd6c[_0x8eb8('0x33')]['hasOwnProperty'](_0x8eb8('0x3a'))){_0x4205aa['limit']=qs[_0x8eb8('0x20')](_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x20')]);_0x4205aa['offset']=qs[_0x8eb8('0x1e')](_0x23bd6c[_0x8eb8('0x33')]['offset']);}_0x4205aa[_0x8eb8('0x3b')]=qs['sort'](_0x23bd6c[_0x8eb8('0x33')]['sort']);_0x4205aa['where']=qs['filters'](_['pick'](_0x23bd6c[_0x8eb8('0x33')],_0x2173e2[_0x8eb8('0x35')]),_0x305760);if(_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x3c')]){_0x4205aa[_0x8eb8('0x3d')]=_[_0x8eb8('0x3e')](_0x4205aa['where'],{'$or':_[_0x8eb8('0x2c')](_0x305760,function(_0x19e1b6){if(_0x19e1b6[_0x8eb8('0x30')]!==_0x8eb8('0x3f')){var _0x5aa922={};_0x5aa922[_0x19e1b6[_0x8eb8('0x29')]]={'$like':'%'+_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x3c')]+'%'};return _0x5aa922;}})});}_0x4205aa=_[_0x8eb8('0x3e')]({},_0x4205aa,_0x23bd6c[_0x8eb8('0x40')]);var _0x3b372a={'where':_0x4205aa[_0x8eb8('0x3d')]};return db[_0x8eb8('0x2d')]['count'](_0x3b372a)[_0x8eb8('0x26')](function(_0x1c275e){_0x2d6bff[_0x8eb8('0x21')]=_0x1c275e;if(_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x4205aa['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8eb8('0x42')](_0x4205aa);})['then'](function(_0x58e585){_0x2d6bff[_0x8eb8('0x43')]=_0x58e585;return _0x2d6bff;})[_0x8eb8('0x26')](respondWithFilteredResult(_0xa436a3,_0x4205aa))[_0x8eb8('0x44')](handleError(_0xa436a3,null));};exports[_0x8eb8('0x45')]=function(_0x9f8732,_0x5581d7){var _0x5a469b={'raw':![],'where':{'id':_0x9f8732[_0x8eb8('0x46')]['id']}},_0x50aad0={};_0x50aad0[_0x8eb8('0x32')]=_[_0x8eb8('0x34')](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')]);_0x50aad0[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x9f8732['query']);_0x50aad0[_0x8eb8('0x35')]=_[_0x8eb8('0x37')](_0x50aad0['model'],_0x50aad0[_0x8eb8('0x33')]);_0x5a469b[_0x8eb8('0x36')]=_['intersection'](_0x50aad0['model'],qs[_0x8eb8('0x38')](_0x9f8732['query'][_0x8eb8('0x38')]));_0x5a469b[_0x8eb8('0x36')]=_0x5a469b['attributes'][_0x8eb8('0x39')]?_0x5a469b[_0x8eb8('0x36')]:_0x50aad0[_0x8eb8('0x32')];if(_0x9f8732[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x5a469b[_0x8eb8('0x47')]=[{'all':!![]}];}_0x5a469b=_[_0x8eb8('0x3e')]({},_0x5a469b,_0x9f8732[_0x8eb8('0x40')]);return db[_0x8eb8('0x2d')][_0x8eb8('0x48')](_0x5a469b)[_0x8eb8('0x26')](handleEntityNotFound(_0x5581d7,null))[_0x8eb8('0x26')](respondWithResult(_0x5581d7,null))[_0x8eb8('0x44')](handleError(_0x5581d7,null));};exports[_0x8eb8('0x49')]=function(_0x29fdce,_0x5b3048){return db[_0x8eb8('0x2d')][_0x8eb8('0x49')](_0x29fdce['body'],{})['then'](respondWithResult(_0x5b3048,0xc9))['catch'](handleError(_0x5b3048,null));};exports[_0x8eb8('0x25')]=function(_0x48a8a1,_0x2c20fc){if(_0x48a8a1[_0x8eb8('0x4a')]['id']){delete _0x48a8a1[_0x8eb8('0x4a')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x48a8a1['params']['id']}})[_0x8eb8('0x26')](handleEntityNotFound(_0x2c20fc,null))[_0x8eb8('0x26')](saveUpdates(_0x48a8a1[_0x8eb8('0x4a')],null))[_0x8eb8('0x26')](respondWithResult(_0x2c20fc,null))['catch'](handleError(_0x2c20fc,null));};exports[_0x8eb8('0x4b')]=function(_0x4c7ac7,_0x3d1a08){return db[_0x8eb8('0x2d')][_0x8eb8('0x48')]({'where':{'id':_0x4c7ac7[_0x8eb8('0x46')]['id']}})[_0x8eb8('0x26')](handleEntityNotFound(_0x3d1a08,null))['then'](removeEntity(_0x3d1a08,null))[_0x8eb8('0x44')](handleError(_0x3d1a08,null));};exports[_0x8eb8('0x4c')]=function(_0x44be87,_0x18d3e6){return db[_0x8eb8('0x2d')]['describe']()[_0x8eb8('0x26')](respondWithResult(_0x18d3e6,null))[_0x8eb8('0x44')](handleError(_0x18d3e6,null));};exports['getVoiceQueuesReport']=function(_0x18f20e,_0x22719c){var _0x47d77a={},_0x32512e={},_0x5a1d4b={'count':0x0,'rows':[]};_0x32512e[_0x8eb8('0x32')]=_['keys'](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')]);_0x32512e[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x18f20e[_0x8eb8('0x33')]);_0x32512e[_0x8eb8('0x35')]=_[_0x8eb8('0x37')](_0x32512e[_0x8eb8('0x32')],_0x32512e[_0x8eb8('0x33')]);_0x47d77a[_0x8eb8('0x36')]=_['intersection'](_0x32512e[_0x8eb8('0x32')],qs['fields'](_0x18f20e['query'][_0x8eb8('0x38')]));_0x47d77a[_0x8eb8('0x36')]=_0x47d77a[_0x8eb8('0x36')][_0x8eb8('0x39')]?_0x47d77a[_0x8eb8('0x36')]:_0x32512e['model'];if(!_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x4d')](_0x8eb8('0x3a'))){_0x47d77a['limit']=qs[_0x8eb8('0x20')](_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x20')]);_0x47d77a[_0x8eb8('0x1e')]=qs[_0x8eb8('0x1e')](_0x18f20e['query']['offset']);}_0x47d77a['order']=qs['sort'](_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x4e')]);_0x47d77a['where']=qs['filters'](_[_0x8eb8('0x4f')](_0x18f20e['query'],_0x32512e['filters']));if(_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x3c')]){_0x47d77a[_0x8eb8('0x3d')]=_[_0x8eb8('0x3e')](_0x47d77a[_0x8eb8('0x3d')],{'$or':_[_0x8eb8('0x2c')](_0x47d77a[_0x8eb8('0x36')],function(_0x4feb8d){var _0x5bfa13={};_0x5bfa13[_0x4feb8d]={'$like':'%'+_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x3c')]+'%'};return _0x5bfa13;})});}_0x47d77a=_[_0x8eb8('0x3e')]({},_0x47d77a,_0x18f20e['options']);var _0x45fcd8={'where':_0x47d77a[_0x8eb8('0x3d')]};return db[_0x8eb8('0x2d')][_0x8eb8('0x21')](_0x45fcd8)[_0x8eb8('0x26')](function(_0x1cec4f){_0x5a1d4b[_0x8eb8('0x21')]=_0x1cec4f;if(_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x47d77a[_0x8eb8('0x47')]=[{'all':!![]}];}return db[_0x8eb8('0x2d')][_0x8eb8('0x42')](_0x47d77a);})[_0x8eb8('0x26')](function(_0x1b056){_0x5a1d4b['rows']=_0x1b056;return _0x5a1d4b;})[_0x8eb8('0x26')](respondWithFilteredResult(_0x22719c,_0x47d77a,_0x8eb8('0x50')))[_0x8eb8('0x44')](handleError(_0x22719c,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8c516e9..d2497aa 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 _0xc95a=['update','remove','emit','exports','../../mysqldb','VoiceQueueReport'];(function(_0x2e36e4,_0x353d60){var _0x2dc2d9=function(_0x393d91){while(--_0x393d91){_0x2e36e4['push'](_0x2e36e4['shift']());}};_0x2dc2d9(++_0x353d60);}(_0xc95a,0xa0));var _0xac95=function(_0x327f3a,_0x401282){_0x327f3a=_0x327f3a-0x0;var _0x41b4a1=_0xc95a[_0x327f3a];return _0x41b4a1;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xac95('0x0'))['db'][_0xac95('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xac95('0x2'),'afterDestroy':_0xac95('0x3')};function emitEvent(_0xfa9ffd){return function(_0x39ba16,_0x21a202,_0x7be441){VoiceQueueReportEvents[_0xac95('0x4')](_0xfa9ffd+':'+_0x39ba16['id'],_0x39ba16);VoiceQueueReportEvents[_0xac95('0x4')](_0xfa9ffd,_0x39ba16);_0x7be441(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xac95('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xaad1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0xb805ef,_0x46622a){var _0x225871=function(_0x80c688){while(--_0x80c688){_0xb805ef['push'](_0xb805ef['shift']());}};_0x225871(++_0x46622a);}(_0xaad1,0x181));var _0x1aad=function(_0x3265b3,_0x328e45){_0x3265b3=_0x3265b3-0x0;var _0x5b959b=_0xaad1[_0x3265b3];return _0x5b959b;};'use strict';var EventEmitter=require(_0x1aad('0x0'));var VoiceQueueReport=require(_0x1aad('0x1'))['db'][_0x1aad('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1aad('0x3'),'afterUpdate':_0x1aad('0x4'),'afterDestroy':_0x1aad('0x5')};function emitEvent(_0x18593f){return function(_0x31a801,_0x21f945,_0x5ad296){VoiceQueueReportEvents[_0x1aad('0x6')](_0x18593f+':'+_0x31a801['id'],_0x31a801);VoiceQueueReportEvents[_0x1aad('0x6')](_0x18593f,_0x31a801);_0x5ad296(null);};}for(var e in events){if(events[_0x1aad('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1aad('0x8')](e,emitEvent(event));}}module[_0x1aad('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c5a6776..6f2fb2f 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 _0xec19=['../../config/environment','./voiceQueueReport.attributes','exports','report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x545ced,_0x2eb3d3){var _0x40da32=function(_0x2eb6ef){while(--_0x2eb6ef){_0x545ced['push'](_0x545ced['shift']());}};_0x40da32(++_0x2eb3d3);}(_0xec19,0x95));var _0x9ec1=function(_0x32781f,_0x47b934){_0x32781f=_0x32781f-0x0;var _0x409ab0=_0xec19[_0x32781f];return _0x409ab0;};'use strict';var _=require(_0x9ec1('0x0'));var util=require('util');var logger=require(_0x9ec1('0x1'))(_0x9ec1('0x2'));var moment=require(_0x9ec1('0x3'));var BPromise=require(_0x9ec1('0x4'));var rp=require(_0x9ec1('0x5'));var fs=require('fs');var path=require(_0x9ec1('0x6'));var rimraf=require('rimraf');var config=require(_0x9ec1('0x7'));var attributes=require(_0x9ec1('0x8'));module[_0x9ec1('0x9')]=function(_0x4f693c,_0x391440){return _0x4f693c['define']('VoiceQueueReport',attributes,{'tableName':_0x9ec1('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x9ec1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b2a=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4b1450,_0x56a5ed){var _0x2dad91=function(_0x5baed4){while(--_0x5baed4){_0x4b1450['push'](_0x4b1450['shift']());}};_0x2dad91(++_0x56a5ed);}(_0x1b2a,0x13c));var _0xa1b2=function(_0x2c081b,_0xd7e1c5){_0x2c081b=_0x2c081b-0x0;var _0x2ebbd1=_0x1b2a[_0x2c081b];return _0x2ebbd1;};'use strict';var _=require(_0xa1b2('0x0'));var util=require('util');var logger=require(_0xa1b2('0x1'))(_0xa1b2('0x2'));var moment=require('moment');var BPromise=require(_0xa1b2('0x3'));var rp=require(_0xa1b2('0x4'));var fs=require('fs');var path=require(_0xa1b2('0x5'));var rimraf=require('rimraf');var config=require(_0xa1b2('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x1a731a,_0x3d863f){return _0x1a731a[_0xa1b2('0x7')](_0xa1b2('0x8'),attributes,{'tableName':_0xa1b2('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa1b2('0xa')]},{'fields':[_0xa1b2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 32a9fb8..fb08fe8 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 _0x29ab=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport'];(function(_0x30ffd3,_0x4e7c2c){var _0x1802c4=function(_0xa4b88b){while(--_0xa4b88b){_0x30ffd3['push'](_0x30ffd3['shift']());}};_0x1802c4(++_0x4e7c2c);}(_0x29ab,0x126));var _0xb29a=function(_0x355aef,_0x3a6d1f){_0x355aef=_0x355aef-0x0;var _0x2dada2=_0x29ab[_0x355aef];return _0x2dada2;};'use strict';var _=require('lodash');var util=require(_0xb29a('0x0'));var moment=require(_0xb29a('0x1'));var BPromise=require(_0xb29a('0x2'));var rs=require(_0xb29a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb29a('0x4'))['db'];var utils=require(_0xb29a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb29a('0x6'));var jayson=require(_0xb29a('0x7'));var client=jayson[_0xb29a('0x8')][_0xb29a('0x9')]({'port':0x232a});config['redis']=_[_0xb29a('0xa')](config[_0xb29a('0xb')],{'host':_0xb29a('0xc'),'port':0x18eb});var socket=require(_0xb29a('0xd'))(new Redis(config['redis']));require(_0xb29a('0xe'))[_0xb29a('0xf')](socket);function respondWithRpcPromise(_0x409a90,_0x390c72,_0x1564c5){return new BPromise(function(_0x591f6b,_0x3c03eb){return client[_0xb29a('0x10')](_0x409a90,_0x1564c5)[_0xb29a('0x11')](function(_0x823b90){logger[_0xb29a('0x12')](_0xb29a('0x13'),_0x390c72,'request\x20sent');logger[_0xb29a('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x390c72,_0xb29a('0x15'),JSON[_0xb29a('0x16')](_0x823b90));if(_0x823b90[_0xb29a('0x17')]){if(_0x823b90[_0xb29a('0x17')][_0xb29a('0x18')]===0x1f4){logger['error'](_0xb29a('0x13'),_0x390c72,_0x823b90[_0xb29a('0x17')][_0xb29a('0x19')]);return _0x3c03eb(_0x823b90[_0xb29a('0x17')][_0xb29a('0x19')]);}logger[_0xb29a('0x17')](_0xb29a('0x13'),_0x390c72,_0x823b90['error']['message']);return _0x591f6b(_0x823b90['error']['message']);}else{logger[_0xb29a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x390c72,_0xb29a('0x15'));_0x591f6b(_0x823b90['result']['message']);}})[_0xb29a('0x1a')](function(_0x2695ff){logger[_0xb29a('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x390c72,_0x2695ff);_0x3c03eb(_0x2695ff);});});}exports[_0xb29a('0x1b')]=function(_0x24fd32){var _0x181328=this;return new Promise(function(_0x3347f2,_0x5916db){return db[_0xb29a('0x1c')][_0xb29a('0x1d')]({'raw':_0x24fd32[_0xb29a('0x1e')]?_0x24fd32['options'][_0xb29a('0x1f')]===undefined?!![]:![]:!![],'where':_0x24fd32['options']?_0x24fd32[_0xb29a('0x1e')][_0xb29a('0x20')]||null:null,'attributes':_0x24fd32['options']?_0x24fd32['options']['attributes']||null:null,'limit':_0x24fd32[_0xb29a('0x1e')]?_0x24fd32[_0xb29a('0x1e')][_0xb29a('0x21')]||null:null,'include':_0x24fd32[_0xb29a('0x1e')]?_0x24fd32[_0xb29a('0x1e')][_0xb29a('0x22')]?_[_0xb29a('0x23')](_0x24fd32[_0xb29a('0x1e')][_0xb29a('0x22')],function(_0x1c803d){return{'model':db[_0x1c803d[_0xb29a('0x24')]],'as':_0x1c803d['as'],'attributes':_0x1c803d[_0xb29a('0x25')],'include':_0x1c803d[_0xb29a('0x22')]?_[_0xb29a('0x23')](_0x1c803d[_0xb29a('0x22')],function(_0x2b2cb8){return{'model':db[_0x2b2cb8[_0xb29a('0x24')]],'as':_0x2b2cb8['as'],'attributes':_0x2b2cb8[_0xb29a('0x25')],'include':_0x2b2cb8[_0xb29a('0x22')]?_[_0xb29a('0x23')](_0x2b2cb8[_0xb29a('0x22')],function(_0x3eef9c){return{'model':db[_0x3eef9c[_0xb29a('0x24')]],'as':_0x3eef9c['as'],'attributes':_0x3eef9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48dbda){logger[_0xb29a('0x12')](_0xb29a('0x1b'),_0x24fd32);logger[_0xb29a('0x14')](_0xb29a('0x1b'),_0x24fd32,JSON[_0xb29a('0x16')](_0x48dbda));_0x3347f2(_0x48dbda);})[_0xb29a('0x1a')](function(_0x5920e8){logger[_0xb29a('0x17')]('GetVoiceQueueReport',_0x5920e8[_0xb29a('0x19')],_0x24fd32);_0x5916db(_0x181328['error'](0x1f4,_0x5920e8['message']));});});};exports[_0xb29a('0x26')]=function(_0x67242e){var _0x3b1cf8=this;return new Promise(function(_0x46c24f,_0x3374ca){return db[_0xb29a('0x1c')][_0xb29a('0x27')](_0x67242e[_0xb29a('0x28')],{'raw':_0x67242e[_0xb29a('0x1e')]?_0x67242e[_0xb29a('0x1e')][_0xb29a('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x4ef682){logger[_0xb29a('0x12')]('CreateVoiceQueueReport',_0x67242e);logger[_0xb29a('0x14')](_0xb29a('0x26'),_0x67242e,JSON[_0xb29a('0x16')](_0x4ef682));_0x46c24f(_0x4ef682);})['catch'](function(_0x5d6c57){logger[_0xb29a('0x17')](_0xb29a('0x26'),_0x5d6c57[_0xb29a('0x19')],_0x67242e);_0x3374ca(_0x3b1cf8[_0xb29a('0x17')](0x1f4,_0x5d6c57[_0xb29a('0x19')]));});});};exports[_0xb29a('0x29')]=function(_0x4e9eab){var _0x2ae107=this;return new Promise(function(_0x2f7c6f,_0x2c2481){return db['VoiceQueueReport']['update'](_0x4e9eab['body'],{'raw':_0x4e9eab[_0xb29a('0x1e')]?_0x4e9eab[_0xb29a('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9eab[_0xb29a('0x1e')]?_0x4e9eab[_0xb29a('0x1e')]['where']||null:null,'attributes':_0x4e9eab[_0xb29a('0x1e')]?_0x4e9eab[_0xb29a('0x1e')][_0xb29a('0x25')]||null:null,'limit':_0x4e9eab[_0xb29a('0x1e')]?_0x4e9eab[_0xb29a('0x1e')][_0xb29a('0x21')]||null:null})[_0xb29a('0x11')](function(_0x147f9c){logger[_0xb29a('0x12')](_0xb29a('0x29'),_0x4e9eab);logger[_0xb29a('0x14')](_0xb29a('0x29'),_0x4e9eab,JSON['stringify'](_0x147f9c));_0x2f7c6f(_0x147f9c);})[_0xb29a('0x1a')](function(_0x37d16b){logger[_0xb29a('0x17')](_0xb29a('0x29'),_0x37d16b[_0xb29a('0x19')],_0x4e9eab);_0x2c2481(_0x2ae107[_0xb29a('0x17')](0x1f4,_0x37d16b[_0xb29a('0x19')]));});});}; \ No newline at end of file +var _0x591b=['error','code','message','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x511eaa,_0x31d9b0){var _0x961fa7=function(_0x21b11a){while(--_0x21b11a){_0x511eaa['push'](_0x511eaa['shift']());}};_0x961fa7(++_0x31d9b0);}(_0x591b,0x102));var _0xb591=function(_0x8de950,_0x2fb767){_0x8de950=_0x8de950-0x0;var _0x305afb=_0x591b[_0x8de950];return _0x305afb;};'use strict';var _=require('lodash');var util=require(_0xb591('0x0'));var moment=require(_0xb591('0x1'));var BPromise=require(_0xb591('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb591('0x3'));var db=require(_0xb591('0x4'))['db'];var utils=require(_0xb591('0x5'));var logger=require(_0xb591('0x6'))(_0xb591('0x7'));var config=require(_0xb591('0x8'));var jayson=require(_0xb591('0x9'));var client=jayson[_0xb591('0xa')][_0xb591('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb591('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb591('0xd'))[_0xb591('0xe')](socket);function respondWithRpcPromise(_0x3605ac,_0x183b73,_0x3c2e17){return new BPromise(function(_0x49d521,_0x5c6c98){return client['request'](_0x3605ac,_0x3c2e17)[_0xb591('0xf')](function(_0xb4c5db){logger[_0xb591('0x10')](_0xb591('0x11'),_0x183b73,_0xb591('0x12'));logger[_0xb591('0x13')](_0xb591('0x14'),_0x183b73,_0xb591('0x12'),JSON[_0xb591('0x15')](_0xb4c5db));if(_0xb4c5db[_0xb591('0x16')]){if(_0xb4c5db[_0xb591('0x16')][_0xb591('0x17')]===0x1f4){logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);return _0x5c6c98(_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);}logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);return _0x49d521(_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);}else{logger[_0xb591('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x183b73,_0xb591('0x12'));_0x49d521(_0xb4c5db['result']['message']);}})[_0xb591('0x19')](function(_0x54843b){logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0x54843b);_0x5c6c98(_0x54843b);});});}exports[_0xb591('0x1a')]=function(_0x19f8b8){var _0x5c9ae9=this;return new Promise(function(_0x431ec5,_0x533fde){return db['VoiceQueueReport'][_0xb591('0x1b')]({'raw':_0x19f8b8['options']?_0x19f8b8[_0xb591('0x1c')][_0xb591('0x1d')]===undefined?!![]:![]:!![],'where':_0x19f8b8[_0xb591('0x1c')]?_0x19f8b8['options'][_0xb591('0x1e')]||null:null,'attributes':_0x19f8b8['options']?_0x19f8b8['options'][_0xb591('0x1f')]||null:null,'limit':_0x19f8b8[_0xb591('0x1c')]?_0x19f8b8[_0xb591('0x1c')][_0xb591('0x20')]||null:null,'include':_0x19f8b8['options']?_0x19f8b8['options'][_0xb591('0x21')]?_[_0xb591('0x22')](_0x19f8b8['options'][_0xb591('0x21')],function(_0x3f940a){return{'model':db[_0x3f940a[_0xb591('0x23')]],'as':_0x3f940a['as'],'attributes':_0x3f940a['attributes'],'include':_0x3f940a['include']?_[_0xb591('0x22')](_0x3f940a['include'],function(_0x179655){return{'model':db[_0x179655[_0xb591('0x23')]],'as':_0x179655['as'],'attributes':_0x179655['attributes'],'include':_0x179655[_0xb591('0x21')]?_[_0xb591('0x22')](_0x179655[_0xb591('0x21')],function(_0x38a246){return{'model':db[_0x38a246[_0xb591('0x23')]],'as':_0x38a246['as'],'attributes':_0x38a246[_0xb591('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb591('0xf')](function(_0xf8f750){logger[_0xb591('0x10')](_0xb591('0x1a'),_0x19f8b8);logger[_0xb591('0x13')](_0xb591('0x1a'),_0x19f8b8,JSON[_0xb591('0x15')](_0xf8f750));_0x431ec5(_0xf8f750);})[_0xb591('0x19')](function(_0x3dc191){logger['error'](_0xb591('0x1a'),_0x3dc191[_0xb591('0x18')],_0x19f8b8);_0x533fde(_0x5c9ae9[_0xb591('0x16')](0x1f4,_0x3dc191[_0xb591('0x18')]));});});};exports[_0xb591('0x24')]=function(_0x563f4f){var _0x41679d=this;return new Promise(function(_0x483817,_0x1752c9){return db['VoiceQueueReport']['create'](_0x563f4f[_0xb591('0x25')],{'raw':_0x563f4f[_0xb591('0x1c')]?_0x563f4f[_0xb591('0x1c')][_0xb591('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x36868a){logger[_0xb591('0x10')](_0xb591('0x24'),_0x563f4f);logger[_0xb591('0x13')]('CreateVoiceQueueReport',_0x563f4f,JSON[_0xb591('0x15')](_0x36868a));_0x483817(_0x36868a);})[_0xb591('0x19')](function(_0x3d4f25){logger[_0xb591('0x16')](_0xb591('0x24'),_0x3d4f25[_0xb591('0x18')],_0x563f4f);_0x1752c9(_0x41679d['error'](0x1f4,_0x3d4f25['message']));});});};exports[_0xb591('0x26')]=function(_0x44f9b1){var _0x5782d1=this;return new Promise(function(_0x26710c,_0x42e98d){return db['VoiceQueueReport'][_0xb591('0x27')](_0x44f9b1[_0xb591('0x25')],{'raw':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['where']||null:null,'attributes':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['attributes']||null:null,'limit':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')][_0xb591('0x20')]||null:null})[_0xb591('0xf')](function(_0x4e5085){logger[_0xb591('0x10')](_0xb591('0x26'),_0x44f9b1);logger[_0xb591('0x13')]('UpdateVoiceQueueReport',_0x44f9b1,JSON[_0xb591('0x15')](_0x4e5085));_0x26710c(_0x4e5085);})[_0xb591('0x19')](function(_0x142352){logger[_0xb591('0x16')]('UpdateVoiceQueueReport',_0x142352[_0xb591('0x18')],_0x44f9b1);_0x42e98d(_0x5782d1[_0xb591('0x16')](0x1f4,_0x142352[_0xb591('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 3485417..25e6ff7 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 _0x38fb=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2cb7a3,_0x58c0e1){var _0x49df09=function(_0x15b914){while(--_0x15b914){_0x2cb7a3['push'](_0x2cb7a3['shift']());}};_0x49df09(++_0x58c0e1);}(_0x38fb,0x1b0));var _0xb38f=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0x38fb[_0x1b1365];return _0x5edfd8;};'use strict';var VoiceQueueReportEvents=require(_0xb38f('0x0'));var events=[_0xb38f('0x1'),_0xb38f('0x2'),_0xb38f('0x3')];function createListener(_0xbfcafb,_0x184ace){return function(_0x358e3c){_0x184ace[_0xb38f('0x4')](_0xbfcafb,_0x358e3c);};}function removeListener(_0x312920,_0x1af3f1){return function(){VoiceQueueReportEvents[_0xb38f('0x5')](_0x312920,_0x1af3f1);};}exports[_0xb38f('0x6')]=function(_0x4674f7){for(var _0x3ad4be=0x0,_0x1e34dd=events[_0xb38f('0x7')];_0x3ad4be<_0x1e34dd;_0x3ad4be++){var _0x2a5462=events[_0x3ad4be];var _0x4447d=createListener('voiceQueueReport:'+_0x2a5462,_0x4674f7);VoiceQueueReportEvents['on'](_0x2a5462,_0x4447d);}}; \ No newline at end of file +var _0xb13b=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x172449,_0x5c569b){var _0x49abc7=function(_0x1ced33){while(--_0x1ced33){_0x172449['push'](_0x172449['shift']());}};_0x49abc7(++_0x5c569b);}(_0xb13b,0x1de));var _0xbb13=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb13b[_0x4b2436];return _0x4f5ab2;};'use strict';var VoiceQueueReportEvents=require(_0xbb13('0x0'));var events=[_0xbb13('0x1'),_0xbb13('0x2'),_0xbb13('0x3')];function createListener(_0x625b76,_0x4c5102){return function(_0x1719ed){_0x4c5102[_0xbb13('0x4')](_0x625b76,_0x1719ed);};}function removeListener(_0x50898d,_0x9eab1b){return function(){VoiceQueueReportEvents[_0xbb13('0x5')](_0x50898d,_0x9eab1b);};}exports[_0xbb13('0x6')]=function(_0x464c50){for(var _0x296632=0x0,_0xd4a4bd=events[_0xbb13('0x7')];_0x296632<_0xd4a4bd;_0x296632++){var _0x3be2d2=events[_0x296632];var _0x56dc8f=createListener('voiceQueueReport:'+_0x3be2d2,_0x464c50);VoiceQueueReportEvents['on'](_0x3be2d2,_0x56dc8f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 59d4450..5c958ba 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 _0xe7b5=['get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xe7b5,0x9a));var _0x5e7b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe7b5[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x5e7b('0x0'));var path=require(_0x5e7b('0x1'));var timeout=require('connect-timeout');var express=require(_0x5e7b('0x2'));var router=express[_0x5e7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e7b('0x4'));var interaction=require(_0x5e7b('0x5'));var config=require(_0x5e7b('0x6'));var controller=require(_0x5e7b('0x7'));router[_0x5e7b('0x8')]('/',auth[_0x5e7b('0x9')](),controller[_0x5e7b('0xa')]);router['get'](_0x5e7b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5e7b('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e7b('0xd')]);router[_0x5e7b('0xe')](_0x5e7b('0xb'),auth[_0x5e7b('0x9')](),controller['update']);router[_0x5e7b('0xf')]('/:id',auth[_0x5e7b('0x9')](),controller[_0x5e7b('0x10')]);module[_0x5e7b('0x11')]=router; \ No newline at end of file +var _0xda3c=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x1307b8,_0x1bfffe){var _0x3965b0=function(_0x39057c){while(--_0x39057c){_0x1307b8['push'](_0x1307b8['shift']());}};_0x3965b0(++_0x1bfffe);}(_0xda3c,0x79));var _0xcda3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xda3c[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xcda3('0x0'));var util=require(_0xcda3('0x1'));var path=require(_0xcda3('0x2'));var timeout=require(_0xcda3('0x3'));var express=require(_0xcda3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcda3('0x5'));var config=require('../../config/environment');var controller=require(_0xcda3('0x6'));router[_0xcda3('0x7')]('/',auth[_0xcda3('0x8')](),controller['index']);router['get'](_0xcda3('0x9'),auth[_0xcda3('0x8')](),controller[_0xcda3('0xa')]);router[_0xcda3('0xb')]('/',auth[_0xcda3('0x8')](),controller[_0xcda3('0xc')]);router[_0xcda3('0xd')]('/:id',auth[_0xcda3('0x8')](),controller['update']);router[_0xcda3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xcda3('0xf')]);module[_0xcda3('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6c86be8..94e0f80 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 _0xa976=['sequelize','moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4d37b9,_0x3bc5e9){var _0xa9f965=function(_0x42ed25){while(--_0x42ed25){_0x4d37b9['push'](_0x4d37b9['shift']());}};_0xa9f965(++_0x3bc5e9);}(_0xa976,0xd7));var _0x6a97=function(_0x4616cb,_0x4a084b){_0x4616cb=_0x4616cb-0x0;var _0x4d4a32=_0xa976[_0x4616cb];return _0x4d4a32;};'use strict';var Sequelize=require(_0x6a97('0x0'));var moment=require(_0x6a97('0x1'));module['exports']={'time':{'type':Sequelize[_0x6a97('0x2')]},'callid':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6a97('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6a97('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x6a97('0x4'))}}; \ No newline at end of file +var _0xd5a2=['STRING','format','sequelize','moment','exports'];(function(_0x1b08ae,_0xac1350){var _0x23022b=function(_0xdfefbc){while(--_0xdfefbc){_0x1b08ae['push'](_0x1b08ae['shift']());}};_0x23022b(++_0xac1350);}(_0xd5a2,0x93));var _0x2d5a=function(_0xe458b6,_0x5847f8){_0xe458b6=_0xe458b6-0x0;var _0x108ac1=_0xd5a2[_0xe458b6];return _0x108ac1;};'use strict';var Sequelize=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));module[_0x2d5a('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x2d5a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 6294571..e4e0f21 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 _0x1cf6=['count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','fields','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0x1cf6,0x194));var _0x61cf=function(_0x825e5f,_0x4ecd90){_0x825e5f=_0x825e5f-0x0;var _0x15eb79=_0x1cf6[_0x825e5f];return _0x15eb79;};'use strict';var emlformat=require(_0x61cf('0x0'));var rimraf=require(_0x61cf('0x1'));var zipdir=require(_0x61cf('0x2'));var jsonpatch=require(_0x61cf('0x3'));var rp=require('request-promise');var moment=require(_0x61cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61cf('0x5'));var util=require(_0x61cf('0x6'));var path=require('path');var sox=require(_0x61cf('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61cf('0x8'));var _=require(_0x61cf('0x9'));var squel=require('squel');var crypto=require(_0x61cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x61cf('0xb'));var toCsv=require('to-csv');var querystring=require(_0x61cf('0xc'));var Papa=require(_0x61cf('0xd'));var Redis=require('ioredis');var authService=require(_0x61cf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x61cf('0xf'));var hardwareService=require(_0x61cf('0x10'));var logger=require(_0x61cf('0x11'))(_0x61cf('0x12'));var utils=require('../../config/utils');var config=require(_0x61cf('0x13'));var licenseUtil=require(_0x61cf('0x14'));var db=require(_0x61cf('0x15'))['db'];function respondWithStatusCode(_0x1b1d5e,_0x4af9cf){_0x4af9cf=_0x4af9cf||0xcc;return function(_0x3ff3af){if(_0x3ff3af){return _0x1b1d5e[_0x61cf('0x16')](_0x4af9cf);}return _0x1b1d5e[_0x61cf('0x17')](_0x4af9cf)['end']();};}function respondWithResult(_0x3913b3,_0x9db57d){_0x9db57d=_0x9db57d||0xc8;return function(_0x43e40a){if(_0x43e40a){return _0x3913b3[_0x61cf('0x17')](_0x9db57d)[_0x61cf('0x18')](_0x43e40a);}};}function respondWithFilteredResult(_0x55ff40,_0x1ab7a7){return function(_0x3743a7){if(_0x3743a7){var _0x2093f2=typeof _0x1ab7a7[_0x61cf('0x19')]===_0x61cf('0x1a')&&typeof _0x1ab7a7[_0x61cf('0x1b')]==='undefined';var _0x353ba8=_0x3743a7[_0x61cf('0x1c')];var _0x10a2a3=_0x2093f2?0x0:_0x1ab7a7['offset'];var _0x339b8c=_0x2093f2?_0x3743a7[_0x61cf('0x1c')]:_0x1ab7a7[_0x61cf('0x19')]+_0x1ab7a7[_0x61cf('0x1b')];var _0x46689b;if(_0x339b8c>=_0x353ba8){_0x339b8c=_0x353ba8;_0x46689b=0xc8;}else{_0x46689b=0xce;}_0x55ff40[_0x61cf('0x17')](_0x46689b);return _0x55ff40[_0x61cf('0x1d')]('Content-Range',_0x10a2a3+'-'+_0x339b8c+'/'+_0x353ba8)[_0x61cf('0x18')](_0x3743a7);}return null;};}function patchUpdates(_0x3581e5){return function(_0x250d61){try{jsonpatch['apply'](_0x250d61,_0x3581e5,!![]);}catch(_0x51c769){return BPromise[_0x61cf('0x1e')](_0x51c769);}return _0x250d61[_0x61cf('0x1f')]();};}function saveUpdates(_0x198178,_0x49b19d){return function(_0x2f3479){if(_0x2f3479){return _0x2f3479[_0x61cf('0x20')](_0x198178)[_0x61cf('0x21')](function(_0x2d0749){return _0x2d0749;});}return null;};}function removeEntity(_0x15a69f,_0x12c18f){return function(_0x1d5d60){if(_0x1d5d60){return _0x1d5d60[_0x61cf('0x22')]()[_0x61cf('0x21')](function(){_0x15a69f[_0x61cf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f4092,_0x38b736){return function(_0x50cc0e){if(!_0x50cc0e){_0x2f4092[_0x61cf('0x16')](0x194);}return _0x50cc0e;};}function handleError(_0x283d43,_0x27e159){_0x27e159=_0x27e159||0x1f4;return function(_0x21de59){logger[_0x61cf('0x23')](_0x21de59[_0x61cf('0x24')]);if(_0x21de59[_0x61cf('0x25')]){delete _0x21de59[_0x61cf('0x25')];}_0x283d43[_0x61cf('0x17')](_0x27e159)[_0x61cf('0x26')](_0x21de59);};}exports[_0x61cf('0x27')]=function(_0x187df2,_0x13de89){var _0x51f39f={},_0x45398e={},_0x36f793={'count':0x0,'rows':[]};var _0x4de6cf=_[_0x61cf('0x28')](db[_0x61cf('0x29')][_0x61cf('0x2a')],function(_0x31df1b){return{'name':_0x31df1b[_0x61cf('0x2b')],'type':_0x31df1b[_0x61cf('0x2c')][_0x61cf('0x2d')]};});_0x45398e[_0x61cf('0x2e')]=_[_0x61cf('0x28')](_0x4de6cf,'name');_0x45398e[_0x61cf('0x2f')]=_[_0x61cf('0x30')](_0x187df2[_0x61cf('0x2f')]);_0x45398e['filters']=_['intersection'](_0x45398e[_0x61cf('0x2e')],_0x45398e[_0x61cf('0x2f')]);_0x51f39f[_0x61cf('0x31')]=_[_0x61cf('0x32')](_0x45398e[_0x61cf('0x2e')],qs['fields'](_0x187df2[_0x61cf('0x2f')]['fields']));_0x51f39f[_0x61cf('0x31')]=_0x51f39f[_0x61cf('0x31')]['length']?_0x51f39f[_0x61cf('0x31')]:_0x45398e[_0x61cf('0x2e')];if(!_0x187df2[_0x61cf('0x2f')][_0x61cf('0x33')](_0x61cf('0x34'))){_0x51f39f[_0x61cf('0x1b')]=qs[_0x61cf('0x1b')](_0x187df2['query'][_0x61cf('0x1b')]);_0x51f39f[_0x61cf('0x19')]=qs[_0x61cf('0x19')](_0x187df2[_0x61cf('0x2f')][_0x61cf('0x19')]);}_0x51f39f['order']=qs['sort'](_0x187df2[_0x61cf('0x2f')][_0x61cf('0x35')]);_0x51f39f[_0x61cf('0x36')]=qs[_0x61cf('0x37')](_[_0x61cf('0x38')](_0x187df2[_0x61cf('0x2f')],_0x45398e[_0x61cf('0x37')]),_0x4de6cf);if(_0x187df2[_0x61cf('0x2f')]['filter']){_0x51f39f[_0x61cf('0x36')]=_[_0x61cf('0x39')](_0x51f39f['where'],{'$or':_[_0x61cf('0x28')](_0x4de6cf,function(_0x3945dc){if(_0x3945dc[_0x61cf('0x2c')]!==_0x61cf('0x3a')){var _0x551fd4={};_0x551fd4[_0x3945dc[_0x61cf('0x25')]]={'$like':'%'+_0x187df2[_0x61cf('0x2f')][_0x61cf('0x3b')]+'%'};return _0x551fd4;}})});}_0x51f39f=_[_0x61cf('0x39')]({},_0x51f39f,_0x187df2[_0x61cf('0x3c')]);var _0x5c1430={'where':_0x51f39f['where']};return db[_0x61cf('0x29')]['count'](_0x5c1430)[_0x61cf('0x21')](function(_0x25c2ca){_0x36f793[_0x61cf('0x1c')]=_0x25c2ca;if(_0x187df2[_0x61cf('0x2f')][_0x61cf('0x3d')]){_0x51f39f['include']=[{'all':!![]}];}return db[_0x61cf('0x29')][_0x61cf('0x3e')](_0x51f39f);})[_0x61cf('0x21')](function(_0x21134c){_0x36f793['rows']=_0x21134c;return _0x36f793;})['then'](respondWithFilteredResult(_0x13de89,_0x51f39f))[_0x61cf('0x3f')](handleError(_0x13de89,null));};exports[_0x61cf('0x40')]=function(_0x4d2890,_0x1cf048){var _0x30da98={'raw':!![],'where':{'id':_0x4d2890[_0x61cf('0x41')]['id']}},_0x2b336d={};_0x2b336d[_0x61cf('0x2e')]=_[_0x61cf('0x30')](db[_0x61cf('0x29')][_0x61cf('0x2a')]);_0x2b336d[_0x61cf('0x2f')]=_['keys'](_0x4d2890[_0x61cf('0x2f')]);_0x2b336d['filters']=_[_0x61cf('0x32')](_0x2b336d['model'],_0x2b336d[_0x61cf('0x2f')]);_0x30da98[_0x61cf('0x31')]=_['intersection'](_0x2b336d[_0x61cf('0x2e')],qs[_0x61cf('0x42')](_0x4d2890[_0x61cf('0x2f')][_0x61cf('0x42')]));_0x30da98['attributes']=_0x30da98[_0x61cf('0x31')][_0x61cf('0x43')]?_0x30da98['attributes']:_0x2b336d[_0x61cf('0x2e')];if(_0x4d2890[_0x61cf('0x2f')][_0x61cf('0x3d')]){_0x30da98[_0x61cf('0x44')]=[{'all':!![]}];}_0x30da98=_[_0x61cf('0x39')]({},_0x30da98,_0x4d2890[_0x61cf('0x3c')]);return db[_0x61cf('0x29')][_0x61cf('0x45')](_0x30da98)[_0x61cf('0x21')](handleEntityNotFound(_0x1cf048,null))[_0x61cf('0x21')](respondWithResult(_0x1cf048,null))['catch'](handleError(_0x1cf048,null));};exports[_0x61cf('0x46')]=function(_0x3e4d58,_0x34a561){return db['VoiceQueuesLog'][_0x61cf('0x46')](_0x3e4d58['body'],{})['then'](respondWithResult(_0x34a561,0xc9))[_0x61cf('0x3f')](handleError(_0x34a561,null));};exports[_0x61cf('0x20')]=function(_0x196f99,_0x17d180){if(_0x196f99[_0x61cf('0x47')]['id']){delete _0x196f99['body']['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x196f99[_0x61cf('0x41')]['id']}})[_0x61cf('0x21')](handleEntityNotFound(_0x17d180,null))[_0x61cf('0x21')](saveUpdates(_0x196f99[_0x61cf('0x47')],null))['then'](respondWithResult(_0x17d180,null))[_0x61cf('0x3f')](handleError(_0x17d180,null));};exports[_0x61cf('0x22')]=function(_0x5b4537,_0x573a09){return db[_0x61cf('0x29')]['find']({'where':{'id':_0x5b4537['params']['id']}})['then'](handleEntityNotFound(_0x573a09,null))[_0x61cf('0x21')](removeEntity(_0x573a09,null))[_0x61cf('0x3f')](handleError(_0x573a09,null));}; \ No newline at end of file +var _0x0046=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0046,0x1a4));var _0x6004=function(_0x3bff95,_0x314718){_0x3bff95=_0x3bff95-0x0;var _0x42e15a=_0x0046[_0x3bff95];return _0x42e15a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6004('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6004('0x1'));var rp=require(_0x6004('0x2'));var moment=require(_0x6004('0x3'));var BPromise=require(_0x6004('0x4'));var Mustache=require('mustache');var util=require(_0x6004('0x5'));var path=require(_0x6004('0x6'));var sox=require(_0x6004('0x7'));var csv=require('to-csv');var ejs=require(_0x6004('0x8'));var fs=require('fs');var fs_extra=require(_0x6004('0x9'));var _=require(_0x6004('0xa'));var squel=require(_0x6004('0xb'));var crypto=require(_0x6004('0xc'));var jsforce=require(_0x6004('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6004('0xe'));var Papa=require(_0x6004('0xf'));var Redis=require('ioredis');var authService=require(_0x6004('0x10'));var qs=require(_0x6004('0x11'));var as=require(_0x6004('0x12'));var hardwareService=require(_0x6004('0x13'));var logger=require(_0x6004('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6004('0x15'));var db=require(_0x6004('0x16'))['db'];function respondWithStatusCode(_0x60aecc,_0x319a8d){_0x319a8d=_0x319a8d||0xcc;return function(_0x37550f){if(_0x37550f){return _0x60aecc[_0x6004('0x17')](_0x319a8d);}return _0x60aecc[_0x6004('0x18')](_0x319a8d)[_0x6004('0x19')]();};}function respondWithResult(_0x1d8188,_0x5e9acb){_0x5e9acb=_0x5e9acb||0xc8;return function(_0x25865e){if(_0x25865e){return _0x1d8188[_0x6004('0x18')](_0x5e9acb)[_0x6004('0x1a')](_0x25865e);}};}function respondWithFilteredResult(_0x3628e7,_0x4b081a){return function(_0x10363e){if(_0x10363e){var _0xb5ec1f=typeof _0x4b081a[_0x6004('0x1b')]===_0x6004('0x1c')&&typeof _0x4b081a[_0x6004('0x1d')]===_0x6004('0x1c');var _0x45dee1=_0x10363e[_0x6004('0x1e')];var _0x4c2a4f=_0xb5ec1f?0x0:_0x4b081a[_0x6004('0x1b')];var _0x19589e=_0xb5ec1f?_0x10363e[_0x6004('0x1e')]:_0x4b081a[_0x6004('0x1b')]+_0x4b081a['limit'];var _0x1fdc51;if(_0x19589e>=_0x45dee1){_0x19589e=_0x45dee1;_0x1fdc51=0xc8;}else{_0x1fdc51=0xce;}_0x3628e7['status'](_0x1fdc51);return _0x3628e7[_0x6004('0x1f')](_0x6004('0x20'),_0x4c2a4f+'-'+_0x19589e+'/'+_0x45dee1)[_0x6004('0x1a')](_0x10363e);}return null;};}function patchUpdates(_0x55c92e){return function(_0x97e162){try{jsonpatch[_0x6004('0x21')](_0x97e162,_0x55c92e,!![]);}catch(_0x2fd465){return BPromise['reject'](_0x2fd465);}return _0x97e162[_0x6004('0x22')]();};}function saveUpdates(_0x584ccd,_0xe7047f){return function(_0x3f3dfd){if(_0x3f3dfd){return _0x3f3dfd[_0x6004('0x23')](_0x584ccd)['then'](function(_0x2c50d4){return _0x2c50d4;});}return null;};}function removeEntity(_0x1686ad,_0x1d60ed){return function(_0x5d5cac){if(_0x5d5cac){return _0x5d5cac[_0x6004('0x24')]()[_0x6004('0x25')](function(){_0x1686ad[_0x6004('0x18')](0xcc)[_0x6004('0x19')]();});}};}function handleEntityNotFound(_0x229c0c,_0x208f03){return function(_0x27c1ec){if(!_0x27c1ec){_0x229c0c[_0x6004('0x17')](0x194);}return _0x27c1ec;};}function handleError(_0x44b283,_0x16d5f6){_0x16d5f6=_0x16d5f6||0x1f4;return function(_0x4c128e){logger['error'](_0x4c128e[_0x6004('0x26')]);if(_0x4c128e[_0x6004('0x27')]){delete _0x4c128e[_0x6004('0x27')];}_0x44b283[_0x6004('0x18')](_0x16d5f6)[_0x6004('0x28')](_0x4c128e);};}exports[_0x6004('0x29')]=function(_0x424730,_0x2ea73b){var _0x42a67c={},_0x3fe66f={},_0x25074a={'count':0x0,'rows':[]};var _0x384d56=_[_0x6004('0x2a')](db[_0x6004('0x2b')][_0x6004('0x2c')],function(_0x3398a6){return{'name':_0x3398a6[_0x6004('0x2d')],'type':_0x3398a6[_0x6004('0x2e')][_0x6004('0x2f')]};});_0x3fe66f[_0x6004('0x30')]=_[_0x6004('0x2a')](_0x384d56,'name');_0x3fe66f[_0x6004('0x31')]=_[_0x6004('0x32')](_0x424730['query']);_0x3fe66f[_0x6004('0x33')]=_['intersection'](_0x3fe66f['model'],_0x3fe66f[_0x6004('0x31')]);_0x42a67c[_0x6004('0x34')]=_[_0x6004('0x35')](_0x3fe66f[_0x6004('0x30')],qs[_0x6004('0x36')](_0x424730[_0x6004('0x31')][_0x6004('0x36')]));_0x42a67c['attributes']=_0x42a67c['attributes']['length']?_0x42a67c['attributes']:_0x3fe66f[_0x6004('0x30')];if(!_0x424730[_0x6004('0x31')][_0x6004('0x37')](_0x6004('0x38'))){_0x42a67c['limit']=qs[_0x6004('0x1d')](_0x424730['query'][_0x6004('0x1d')]);_0x42a67c['offset']=qs['offset'](_0x424730[_0x6004('0x31')]['offset']);}_0x42a67c[_0x6004('0x39')]=qs[_0x6004('0x3a')](_0x424730[_0x6004('0x31')][_0x6004('0x3a')]);_0x42a67c[_0x6004('0x3b')]=qs[_0x6004('0x33')](_['pick'](_0x424730[_0x6004('0x31')],_0x3fe66f[_0x6004('0x33')]),_0x384d56);if(_0x424730[_0x6004('0x31')][_0x6004('0x3c')]){_0x42a67c['where']=_['merge'](_0x42a67c[_0x6004('0x3b')],{'$or':_[_0x6004('0x2a')](_0x384d56,function(_0x7b95b3){if(_0x7b95b3[_0x6004('0x2e')]!==_0x6004('0x3d')){var _0x5b3fe9={};_0x5b3fe9[_0x7b95b3[_0x6004('0x27')]]={'$like':'%'+_0x424730[_0x6004('0x31')][_0x6004('0x3c')]+'%'};return _0x5b3fe9;}})});}_0x42a67c=_[_0x6004('0x3e')]({},_0x42a67c,_0x424730[_0x6004('0x3f')]);var _0x1521e7={'where':_0x42a67c[_0x6004('0x3b')]};return db[_0x6004('0x2b')][_0x6004('0x1e')](_0x1521e7)[_0x6004('0x25')](function(_0x38589e){_0x25074a[_0x6004('0x1e')]=_0x38589e;if(_0x424730[_0x6004('0x31')][_0x6004('0x40')]){_0x42a67c[_0x6004('0x41')]=[{'all':!![]}];}return db[_0x6004('0x2b')][_0x6004('0x42')](_0x42a67c);})[_0x6004('0x25')](function(_0x2138be){_0x25074a[_0x6004('0x43')]=_0x2138be;return _0x25074a;})[_0x6004('0x25')](respondWithFilteredResult(_0x2ea73b,_0x42a67c))[_0x6004('0x44')](handleError(_0x2ea73b,null));};exports['show']=function(_0x4440be,_0x27fe6d){var _0x5b9dae={'raw':!![],'where':{'id':_0x4440be[_0x6004('0x45')]['id']}},_0x5d2a84={};_0x5d2a84['model']=_[_0x6004('0x32')](db[_0x6004('0x2b')][_0x6004('0x2c')]);_0x5d2a84[_0x6004('0x31')]=_[_0x6004('0x32')](_0x4440be['query']);_0x5d2a84[_0x6004('0x33')]=_[_0x6004('0x35')](_0x5d2a84[_0x6004('0x30')],_0x5d2a84[_0x6004('0x31')]);_0x5b9dae['attributes']=_[_0x6004('0x35')](_0x5d2a84['model'],qs[_0x6004('0x36')](_0x4440be[_0x6004('0x31')][_0x6004('0x36')]));_0x5b9dae[_0x6004('0x34')]=_0x5b9dae[_0x6004('0x34')]['length']?_0x5b9dae['attributes']:_0x5d2a84['model'];if(_0x4440be[_0x6004('0x31')][_0x6004('0x40')]){_0x5b9dae[_0x6004('0x41')]=[{'all':!![]}];}_0x5b9dae=_[_0x6004('0x3e')]({},_0x5b9dae,_0x4440be[_0x6004('0x3f')]);return db[_0x6004('0x2b')][_0x6004('0x46')](_0x5b9dae)[_0x6004('0x25')](handleEntityNotFound(_0x27fe6d,null))['then'](respondWithResult(_0x27fe6d,null))[_0x6004('0x44')](handleError(_0x27fe6d,null));};exports[_0x6004('0x47')]=function(_0x474b24,_0x50257b){return db['VoiceQueuesLog'][_0x6004('0x47')](_0x474b24[_0x6004('0x48')],{})['then'](respondWithResult(_0x50257b,0xc9))[_0x6004('0x44')](handleError(_0x50257b,null));};exports['update']=function(_0x10ca09,_0x44fe37){if(_0x10ca09[_0x6004('0x48')]['id']){delete _0x10ca09[_0x6004('0x48')]['id'];}return db[_0x6004('0x2b')][_0x6004('0x46')]({'where':{'id':_0x10ca09['params']['id']}})[_0x6004('0x25')](handleEntityNotFound(_0x44fe37,null))[_0x6004('0x25')](saveUpdates(_0x10ca09['body'],null))['then'](respondWithResult(_0x44fe37,null))[_0x6004('0x44')](handleError(_0x44fe37,null));};exports[_0x6004('0x24')]=function(_0x26163f,_0x163898){return db[_0x6004('0x2b')][_0x6004('0x46')]({'where':{'id':_0x26163f[_0x6004('0x45')]['id']}})[_0x6004('0x25')](handleEntityNotFound(_0x163898,null))['then'](removeEntity(_0x163898,null))[_0x6004('0x44')](handleError(_0x163898,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4ad665d..eae3f4f 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 _0x29fc=['./voiceQueuesLog.attributes','define','VoiceQueuesLog','event','dtm','util','api','request-promise','rimraf'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0x29fc,0xb0));var _0xc29f=function(_0x56ab15,_0x16915f){_0x56ab15=_0x56ab15-0x0;var _0x4f5ec6=_0x29fc[_0x56ab15];return _0x4f5ec6;};'use strict';var _=require('lodash');var util=require(_0xc29f('0x0'));var logger=require('../../config/logger')(_0xc29f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc29f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc29f('0x3'));var config=require('../../config/environment');var attributes=require(_0xc29f('0x4'));module['exports']=function(_0x41d9d4,_0x4d2590){return _0x41d9d4[_0xc29f('0x5')](_0xc29f('0x6'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xc29f('0x7'),_0xc29f('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0x463e=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x463e,0x1d6));var _0xe463=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x463e[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xe463('0x0'));var util=require(_0xe463('0x1'));var logger=require(_0xe463('0x2'))(_0xe463('0x3'));var moment=require(_0xe463('0x4'));var BPromise=require(_0xe463('0x5'));var rp=require(_0xe463('0x6'));var fs=require('fs');var path=require(_0xe463('0x7'));var rimraf=require(_0xe463('0x8'));var config=require(_0xe463('0x9'));var attributes=require(_0xe463('0xa'));module[_0xe463('0xb')]=function(_0x4969ec,_0x4f9125){return _0x4969ec['define'](_0xe463('0xc'),attributes,{'tableName':_0xe463('0xd'),'paranoid':![],'indexes':[{'name':_0xe463('0xe'),'fields':[_0xe463('0xf'),_0xe463('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 34e8278..f593e30 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 _0x47c2=['client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ecb4a,_0x198b7b){var _0x3dcea7=function(_0x371f12){while(--_0x371f12){_0x5ecb4a['push'](_0x5ecb4a['shift']());}};_0x3dcea7(++_0x198b7b);}(_0x47c2,0x1ae));var _0x247c=function(_0x1566ed,_0x511c9f){_0x1566ed=_0x1566ed-0x0;var _0x2eea27=_0x47c2[_0x1566ed];return _0x2eea27;};'use strict';var _=require(_0x247c('0x0'));var util=require(_0x247c('0x1'));var moment=require(_0x247c('0x2'));var BPromise=require(_0x247c('0x3'));var rs=require(_0x247c('0x4'));var fs=require('fs');var Redis=require(_0x247c('0x5'));var db=require(_0x247c('0x6'))['db'];var utils=require(_0x247c('0x7'));var logger=require(_0x247c('0x8'))(_0x247c('0x9'));var config=require(_0x247c('0xa'));var jayson=require(_0x247c('0xb'));var client=jayson[_0x247c('0xc')][_0x247c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x16d26e,_0x3b97cf,_0x4e3adb){return new BPromise(function(_0x2154b4,_0x5ae6fb){return client[_0x247c('0xe')](_0x16d26e,_0x4e3adb)[_0x247c('0xf')](function(_0x4f56ec){logger[_0x247c('0x10')](_0x247c('0x11'),_0x3b97cf,'request\x20sent');logger[_0x247c('0x12')](_0x247c('0x13'),_0x3b97cf,_0x247c('0x14'),JSON[_0x247c('0x15')](_0x4f56ec));if(_0x4f56ec[_0x247c('0x16')]){if(_0x4f56ec[_0x247c('0x16')]['code']===0x1f4){logger[_0x247c('0x16')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3b97cf,_0x4f56ec[_0x247c('0x16')][_0x247c('0x17')]);return _0x5ae6fb(_0x4f56ec[_0x247c('0x16')][_0x247c('0x17')]);}logger[_0x247c('0x16')](_0x247c('0x11'),_0x3b97cf,_0x4f56ec[_0x247c('0x16')]['message']);return _0x2154b4(_0x4f56ec[_0x247c('0x16')]['message']);}else{logger['info'](_0x247c('0x11'),_0x3b97cf,_0x247c('0x14'));_0x2154b4(_0x4f56ec[_0x247c('0x18')][_0x247c('0x17')]);}})[_0x247c('0x19')](function(_0x485d8f){logger[_0x247c('0x16')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3b97cf,_0x485d8f);_0x5ae6fb(_0x485d8f);});});} \ No newline at end of file +var _0x28bc=['info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0x28bc,0x79));var _0xc28b=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x28bc[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0xc28b('0x0'));var util=require(_0xc28b('0x1'));var moment=require(_0xc28b('0x2'));var BPromise=require(_0xc28b('0x3'));var rs=require(_0xc28b('0x4'));var fs=require('fs');var Redis=require(_0xc28b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc28b('0x6'));var logger=require(_0xc28b('0x7'))(_0xc28b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc28b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a581d,_0x123671,_0x387746){return new BPromise(function(_0x22a92a,_0x18fc74){return client[_0xc28b('0xa')](_0x1a581d,_0x387746)[_0xc28b('0xb')](function(_0x107339){logger['info'](_0xc28b('0xc'),_0x123671,_0xc28b('0xd'));logger[_0xc28b('0xe')](_0xc28b('0xf'),_0x123671,_0xc28b('0xd'),JSON[_0xc28b('0x10')](_0x107339));if(_0x107339[_0xc28b('0x11')]){if(_0x107339[_0xc28b('0x11')]['code']===0x1f4){logger[_0xc28b('0x11')](_0xc28b('0xc'),_0x123671,_0x107339[_0xc28b('0x11')]['message']);return _0x18fc74(_0x107339[_0xc28b('0x11')]['message']);}logger['error'](_0xc28b('0xc'),_0x123671,_0x107339['error'][_0xc28b('0x12')]);return _0x22a92a(_0x107339['error'][_0xc28b('0x12')]);}else{logger[_0xc28b('0x13')](_0xc28b('0xc'),_0x123671,_0xc28b('0xd'));_0x22a92a(_0x107339['result'][_0xc28b('0x12')]);}})['catch'](function(_0x23a2c4){logger['error'](_0xc28b('0xc'),_0x123671,_0x23a2c4);_0x18fc74(_0x23a2c4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7473ee2..9048263 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 _0x0493=['get','/describe','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','isAuthenticated'];(function(_0x26c444,_0x376c42){var _0x1086ea=function(_0x5accd3){while(--_0x5accd3){_0x26c444['push'](_0x26c444['shift']());}};_0x1086ea(++_0x376c42);}(_0x0493,0x69));var _0x3049=function(_0x2e9771,_0x5be098){_0x2e9771=_0x2e9771-0x0;var _0x57b012=_0x0493[_0x2e9771];return _0x57b012;};'use strict';var multer=require(_0x3049('0x0'));var util=require(_0x3049('0x1'));var path=require(_0x3049('0x2'));var timeout=require(_0x3049('0x3'));var express=require(_0x3049('0x4'));var router=express[_0x3049('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3049('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3049('0x7'));var controller=require(_0x3049('0x8'));router['get']('/',auth[_0x3049('0x9')](),controller['index']);router[_0x3049('0xa')](_0x3049('0xb'),auth[_0x3049('0x9')](),controller[_0x3049('0xc')]);router[_0x3049('0xa')](_0x3049('0xd'),auth[_0x3049('0x9')](),controller[_0x3049('0xe')]);router[_0x3049('0xa')](_0x3049('0xf'),auth[_0x3049('0x9')](),controller[_0x3049('0x10')]);router['get']('/:id/downloads',controller[_0x3049('0x11')]);router[_0x3049('0xa')](_0x3049('0x12'),auth[_0x3049('0x9')](),controller[_0x3049('0x13')]);router[_0x3049('0x14')]('/',auth[_0x3049('0x9')](),controller['create']);router[_0x3049('0x14')](_0x3049('0x12'),auth[_0x3049('0x9')](),controller['runTranscribe']);router['put'](_0x3049('0xd'),auth[_0x3049('0x9')](),controller[_0x3049('0x15')]);router['delete'](_0x3049('0xd'),auth[_0x3049('0x9')](),controller['destroy']);module[_0x3049('0x16')]=router; \ No newline at end of file +var _0x74ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/:id','show','/:id/downloads','downloads','/:id/transcribe','create','post','runTranscribe','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x54f5fb,_0x10110c){var _0x1c8b92=function(_0x43a0c3){while(--_0x43a0c3){_0x54f5fb['push'](_0x54f5fb['shift']());}};_0x1c8b92(++_0x10110c);}(_0x74ed,0x127));var _0xd74e=function(_0x29963b,_0x5d218d){_0x29963b=_0x29963b-0x0;var _0x37c2f8=_0x74ed[_0x29963b];return _0x37c2f8;};'use strict';var multer=require('multer');var util=require(_0xd74e('0x0'));var path=require(_0xd74e('0x1'));var timeout=require('connect-timeout');var express=require(_0xd74e('0x2'));var router=express[_0xd74e('0x3')]();var fs_extra=require(_0xd74e('0x4'));var auth=require(_0xd74e('0x5'));var interaction=require(_0xd74e('0x6'));var config=require(_0xd74e('0x7'));var controller=require(_0xd74e('0x8'));router[_0xd74e('0x9')]('/',auth[_0xd74e('0xa')](),controller[_0xd74e('0xb')]);router[_0xd74e('0x9')]('/describe',auth[_0xd74e('0xa')](),controller['describe']);router[_0xd74e('0x9')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0xd')]);router[_0xd74e('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xd74e('0x9')](_0xd74e('0xe'),controller[_0xd74e('0xf')]);router[_0xd74e('0x9')](_0xd74e('0x10'),auth[_0xd74e('0xa')](),controller['downloadTranscribe']);router['post']('/',auth[_0xd74e('0xa')](),controller[_0xd74e('0x11')]);router[_0xd74e('0x12')](_0xd74e('0x10'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x13')]);router[_0xd74e('0x14')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x15')]);router[_0xd74e('0x16')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x17')]);module[_0xd74e('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 44552f0..7d6916d 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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 c7ac550..c31b679 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 _0x0bbc=['transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','aws-sdk','uuid/v4','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','apply','reject','save','update','error','stack','name','index','map','VoiceRecording','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','then','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','download','uniqueid','value','format','%s.cypher','existsSync','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','decryptFile','secrets','Sequelize','destroy','isNil','Entity\x20not\x20found','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','info','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId'];(function(_0x43d2f6,_0x36a669){var _0x5f2e1f=function(_0x5aa6f6){while(--_0x5aa6f6){_0x43d2f6['push'](_0x43d2f6['shift']());}};_0x5f2e1f(++_0x36a669);}(_0x0bbc,0x148));var _0xc0bb=function(_0x324c62,_0x4d30c6){_0x324c62=_0x324c62-0x0;var _0x1f957d=_0x0bbc[_0x324c62];return _0x1f957d;};'use strict';var emlformat=require(_0xc0bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0bb('0x1'));var jsonpatch=require(_0xc0bb('0x2'));var rp=require('request-promise');var moment=require(_0xc0bb('0x3'));var BPromise=require(_0xc0bb('0x4'));var Mustache=require(_0xc0bb('0x5'));var util=require(_0xc0bb('0x6'));var path=require(_0xc0bb('0x7'));var sox=require(_0xc0bb('0x8'));var csv=require(_0xc0bb('0x9'));var ejs=require(_0xc0bb('0xa'));var fs=require('fs');var fs_extra=require(_0xc0bb('0xb'));var _=require(_0xc0bb('0xc'));var squel=require(_0xc0bb('0xd'));var crypto=require('crypto');var jsforce=require(_0xc0bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc0bb('0x9'));var querystring=require(_0xc0bb('0xf'));var Papa=require('papaparse');var AWS=require(_0xc0bb('0x10'));var uuidv4=require(_0xc0bb('0x11'));var Redis=require(_0xc0bb('0x12'));var authService=require(_0xc0bb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc0bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc0bb('0x15'));var utils=require(_0xc0bb('0x16'));var config=require(_0xc0bb('0x17'));var licenseUtil=require(_0xc0bb('0x18'));var db=require(_0xc0bb('0x19'))['db'];function respondWithStatusCode(_0x51abac,_0x574042){_0x574042=_0x574042||0xcc;return function(_0x21646b){if(_0x21646b){return _0x51abac[_0xc0bb('0x1a')](_0x574042);}return _0x51abac[_0xc0bb('0x1b')](_0x574042)[_0xc0bb('0x1c')]();};}function respondWithResult(_0x3d5ad5,_0x4f7e03){_0x4f7e03=_0x4f7e03||0xc8;return function(_0x58e899){if(_0x58e899){return _0x3d5ad5[_0xc0bb('0x1b')](_0x4f7e03)[_0xc0bb('0x1d')](_0x58e899);}};}function respondWithFilteredResult(_0x38782c,_0x5091c5){return function(_0x10c8f6){if(_0x10c8f6){var _0x789c18=typeof _0x5091c5[_0xc0bb('0x1e')]===_0xc0bb('0x1f')&&typeof _0x5091c5['limit']===_0xc0bb('0x1f');var _0x26078a=_0x10c8f6[_0xc0bb('0x20')];var _0xf2b92f=_0x789c18?0x0:_0x5091c5[_0xc0bb('0x1e')];var _0x11c2dc=_0x789c18?_0x10c8f6['count']:_0x5091c5[_0xc0bb('0x1e')]+_0x5091c5[_0xc0bb('0x21')];var _0x1855bf;if(_0x11c2dc>=_0x26078a){_0x11c2dc=_0x26078a;_0x1855bf=0xc8;}else{_0x1855bf=0xce;}_0x38782c[_0xc0bb('0x1b')](_0x1855bf);return _0x38782c[_0xc0bb('0x22')](_0xc0bb('0x23'),_0xf2b92f+'-'+_0x11c2dc+'/'+_0x26078a)[_0xc0bb('0x1d')](_0x10c8f6);}return null;};}function patchUpdates(_0x240196){return function(_0x3937c8){try{jsonpatch[_0xc0bb('0x24')](_0x3937c8,_0x240196,!![]);}catch(_0x5d8c2e){return BPromise[_0xc0bb('0x25')](_0x5d8c2e);}return _0x3937c8[_0xc0bb('0x26')]();};}function saveUpdates(_0x17962d,_0x43eff6){return function(_0xb5d584){if(_0xb5d584){return _0xb5d584[_0xc0bb('0x27')](_0x17962d)['then'](function(_0x3ca66c){return _0x3ca66c;});}return null;};}function removeEntity(_0x1147c2,_0xde205a){return function(_0x2b976f){if(_0x2b976f){return _0x2b976f['destroy']()['then'](function(){_0x1147c2['status'](0xcc)[_0xc0bb('0x1c')]();});}};}function handleEntityNotFound(_0x42caad,_0x562ed7){return function(_0x277ec7){if(!_0x277ec7){_0x42caad['sendStatus'](0x194);}return _0x277ec7;};}function handleError(_0x4592b3,_0x30f56e){_0x30f56e=_0x30f56e||0x1f4;return function(_0x20a9b5){logger[_0xc0bb('0x28')](_0x20a9b5[_0xc0bb('0x29')]);if(_0x20a9b5[_0xc0bb('0x2a')]){delete _0x20a9b5[_0xc0bb('0x2a')];}_0x4592b3[_0xc0bb('0x1b')](_0x30f56e)['send'](_0x20a9b5);};}exports[_0xc0bb('0x2b')]=function(_0xd82cd8,_0xb8db7d){var _0x40c354={},_0x165ac4={},_0x538d28={'count':0x0,'rows':[]};var _0x50c93a=_[_0xc0bb('0x2c')](db[_0xc0bb('0x2d')]['rawAttributes'],function(_0x43655c){return{'name':_0x43655c[_0xc0bb('0x2e')],'type':_0x43655c['type'][_0xc0bb('0x2f')]};});_0x165ac4[_0xc0bb('0x30')]=_[_0xc0bb('0x31')](_[_0xc0bb('0x2c')](_0x50c93a,_0xc0bb('0x2a')),['format']);_0x165ac4[_0xc0bb('0x32')]=_[_0xc0bb('0x33')](_0xd82cd8[_0xc0bb('0x32')]);_0x165ac4[_0xc0bb('0x34')]=_[_0xc0bb('0x35')](_0x165ac4[_0xc0bb('0x30')],_0x165ac4[_0xc0bb('0x32')]);_0x40c354[_0xc0bb('0x36')]=_[_0xc0bb('0x35')](_0x165ac4[_0xc0bb('0x30')],qs['fields'](_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x37')]));_0x40c354['attributes']=_0x40c354['attributes']['length']?_0x40c354['attributes']:_0x165ac4[_0xc0bb('0x30')];if(!_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x38')](_0xc0bb('0x39'))){_0x40c354[_0xc0bb('0x21')]=qs[_0xc0bb('0x21')](_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x21')]);_0x40c354['offset']=qs[_0xc0bb('0x1e')](_0xd82cd8['query'][_0xc0bb('0x1e')]);}_0x40c354[_0xc0bb('0x3a')]=qs[_0xc0bb('0x3b')](_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x3b')]);_0x40c354[_0xc0bb('0x3c')]=qs[_0xc0bb('0x34')](_['pick'](_0xd82cd8[_0xc0bb('0x32')],_0x165ac4[_0xc0bb('0x34')]),_0x50c93a);if(_0xd82cd8[_0xc0bb('0x32')]['filter']){_0x40c354[_0xc0bb('0x3c')]=_[_0xc0bb('0x3d')](_0x40c354[_0xc0bb('0x3c')],{'$or':_['map'](_0x50c93a,function(_0x305bc1){if(_0x305bc1[_0xc0bb('0x3e')]!==_0xc0bb('0x3f')){var _0x5195c2={};_0x5195c2[_0x305bc1['name']]={'$like':'%'+_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x40')]+'%'};return _0x5195c2;}})});}_0x40c354=_['merge']({},_0x40c354,_0xd82cd8[_0xc0bb('0x41')]);var _0x4fc2fc={'where':_0x40c354[_0xc0bb('0x3c')]};return db['VoiceRecording'][_0xc0bb('0x20')](_0x4fc2fc)[_0xc0bb('0x42')](function(_0x2b001){_0x538d28[_0xc0bb('0x20')]=_0x2b001;if(_0xd82cd8[_0xc0bb('0x32')][_0xc0bb('0x43')]){_0x40c354[_0xc0bb('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0xc0bb('0x45')](_0x40c354);})[_0xc0bb('0x42')](function(_0x4f0bf7){_0x538d28['rows']=_0x4f0bf7;return _0x538d28;})['then'](respondWithFilteredResult(_0xb8db7d,_0x40c354))[_0xc0bb('0x46')](handleError(_0xb8db7d,null));};exports[_0xc0bb('0x47')]=function(_0x38e079,_0x238c13){var _0x510948={'raw':![],'where':{'id':_0x38e079[_0xc0bb('0x48')]['id']}},_0xc14e44={};_0xc14e44[_0xc0bb('0x30')]=_[_0xc0bb('0x33')](db[_0xc0bb('0x2d')][_0xc0bb('0x49')]);_0xc14e44[_0xc0bb('0x32')]=_['keys'](_0x38e079[_0xc0bb('0x32')]);_0xc14e44[_0xc0bb('0x34')]=_[_0xc0bb('0x35')](_0xc14e44[_0xc0bb('0x30')],_0xc14e44[_0xc0bb('0x32')]);_0x510948['attributes']=_[_0xc0bb('0x35')](_0xc14e44[_0xc0bb('0x30')],qs[_0xc0bb('0x37')](_0x38e079[_0xc0bb('0x32')][_0xc0bb('0x37')]));_0x510948[_0xc0bb('0x36')]=_0x510948[_0xc0bb('0x36')]['length']?_0x510948[_0xc0bb('0x36')]:_0xc14e44[_0xc0bb('0x30')];if(_0x38e079[_0xc0bb('0x32')][_0xc0bb('0x43')]){_0x510948[_0xc0bb('0x44')]=[{'all':!![]}];}_0x510948=_[_0xc0bb('0x3d')]({},_0x510948,_0x38e079['options']);return db[_0xc0bb('0x2d')][_0xc0bb('0x4a')](_0x510948)['then'](handleEntityNotFound(_0x238c13,null))['then'](respondWithResult(_0x238c13,null))[_0xc0bb('0x46')](handleError(_0x238c13,null));};exports[_0xc0bb('0x4b')]=function(_0x17a886,_0xb3a4d8){return db[_0xc0bb('0x2d')][_0xc0bb('0x4b')](_0x17a886[_0xc0bb('0x4c')],{})[_0xc0bb('0x42')](respondWithResult(_0xb3a4d8,0xc9))[_0xc0bb('0x46')](handleError(_0xb3a4d8,null));};exports[_0xc0bb('0x27')]=function(_0x27f25d,_0xf7a908){if(_0x27f25d[_0xc0bb('0x4c')]['id']){delete _0x27f25d[_0xc0bb('0x4c')]['id'];}return db[_0xc0bb('0x2d')][_0xc0bb('0x4a')]({'where':{'id':_0x27f25d[_0xc0bb('0x48')]['id']}})[_0xc0bb('0x42')](handleEntityNotFound(_0xf7a908,null))[_0xc0bb('0x42')](saveUpdates(_0x27f25d[_0xc0bb('0x4c')],null))[_0xc0bb('0x42')](respondWithResult(_0xf7a908,null))['catch'](handleError(_0xf7a908,null));};exports[_0xc0bb('0x4d')]=function(_0x1dce4a,_0x1b46d1){return db[_0xc0bb('0x2d')][_0xc0bb('0x4d')]()[_0xc0bb('0x42')](respondWithResult(_0x1b46d1,null))[_0xc0bb('0x46')](handleError(_0x1b46d1,null));};exports[_0xc0bb('0x4e')]=function(_0x1b990e,_0x457174,_0x44ffb4){var _0x4aa065=require('../../components/encryptor');var _0x269b5c=![];var _0x447964={};if(_0x1b990e[_0xc0bb('0x32')][_0xc0bb('0x3e')]&&_0x1b990e[_0xc0bb('0x32')][_0xc0bb('0x3e')]===_0xc0bb('0x4f')){_0x447964['uniqueid']=_0x1b990e[_0xc0bb('0x48')]['id'];}else{_0x447964['id']=_0x1b990e[_0xc0bb('0x48')]['id'];}return db[_0xc0bb('0x2d')][_0xc0bb('0x4a')]({'where':_0x447964,'attributes':['id',_0xc0bb('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x457174,null))['then'](function(_0x38ba5a){if(_0x38ba5a){var _0x5a3bdd=_0x38ba5a[_0xc0bb('0x50')];var _0x5835f4=util[_0xc0bb('0x51')](_0xc0bb('0x52'),_0x5a3bdd);if(fs[_0xc0bb('0x53')](_0x5835f4)){_0x269b5c=!![];return _0x4aa065['decryptFile'](_0x5835f4,_0x5a3bdd,config['secrets'][_0xc0bb('0x54')])['then'](function(){return _0x38ba5a;});}return _0x38ba5a;}})[_0xc0bb('0x42')](function(_0xaf7440){if(_0xaf7440){var _0x27659c=_0xaf7440[_0xc0bb('0x50')];if(!fs['existsSync'](_0x27659c)){throw new db['Sequelize'][(_0xc0bb('0x55'))](_0xc0bb('0x56'));}if(_0xaf7440['filename']){return _0x457174[_0xc0bb('0x4e')](_0x27659c,_0xaf7440[_0xc0bb('0x57')]+path[_0xc0bb('0x58')](_0x27659c),function(){if(_0x269b5c){fs['unlink'](_0x27659c);}});}else{return _0x457174[_0xc0bb('0x4e')](_0x27659c,function(_0x3a8459){if(_0x269b5c){fs[_0xc0bb('0x59')](_0x27659c);}});}}})[_0xc0bb('0x46')](function(_0x247b40){if(_0x247b40['message']===_0xc0bb('0x56')){_0x457174[_0xc0bb('0x1b')](0x194)['send'](_0xc0bb('0x5a'));}else{return handleError(_0x457174,null);}});};exports[_0xc0bb('0x5b')]=function(_0x469223,_0x491734,_0x3407c4){var _0x2b7243=require(_0xc0bb('0x5c'));var _0x21b308=![];var _0x35f69f={'$and':[db['sequelize']['where'](db[_0xc0bb('0x5d')]['fn'](_0xc0bb('0x5e'),db['sequelize'][_0xc0bb('0x5f')](_0xc0bb('0x4f'))),_0x469223[_0xc0bb('0x32')][_0xc0bb('0x60')])]};if(_0x469223['query'][_0xc0bb('0x3e')]&&_0x469223[_0xc0bb('0x32')]['type']===_0xc0bb('0x4f')){_0x35f69f[_0xc0bb('0x61')][_0xc0bb('0x62')]({'uniqueid':_0x469223['params']['id']});}else{_0x35f69f['$and']['push']({'id':_0x469223[_0xc0bb('0x48')]['id']});}return db[_0xc0bb('0x2d')][_0xc0bb('0x4a')]({'where':_0x35f69f,'attributes':['id',_0xc0bb('0x50')],'raw':!![]})[_0xc0bb('0x42')](handleEntityNotFound(_0x491734,null))[_0xc0bb('0x42')](function(_0x13fa72){if(_0x13fa72){var _0x101d16=util['format'](_0xc0bb('0x52'),_0x13fa72[_0xc0bb('0x50')]);if(fs[_0xc0bb('0x53')](_0x101d16)){_0x21b308=!![];return _0x2b7243[_0xc0bb('0x63')](_0x101d16,_0x13fa72[_0xc0bb('0x50')],config[_0xc0bb('0x64')][_0xc0bb('0x54')])[_0xc0bb('0x42')](function(){return _0x13fa72;});}return _0x13fa72;}})['then'](function(_0x1f6d2e){if(_0x1f6d2e){if(!fs['existsSync'](_0x1f6d2e[_0xc0bb('0x50')])){throw new db[(_0xc0bb('0x65'))]['ValidationError'](_0xc0bb('0x56'));}if(_0x1f6d2e[_0xc0bb('0x57')]){return _0x491734[_0xc0bb('0x4e')](_0x1f6d2e[_0xc0bb('0x50')],_0x1f6d2e[_0xc0bb('0x57')]+path['extname'](_0x1f6d2e['value']),function(){if(_0x21b308){fs[_0xc0bb('0x59')](_0x1f6d2e[_0xc0bb('0x50')]);}});}else{return _0x491734['download'](_0x1f6d2e['value'],function(_0x22df83){if(_0x21b308){fs[_0xc0bb('0x59')](_0x1f6d2e[_0xc0bb('0x50')]);}});}}})[_0xc0bb('0x46')](handleError(_0x491734,null));};exports[_0xc0bb('0x66')]=function(_0x123ec8,_0xcdeb30){return db[_0xc0bb('0x2d')][_0xc0bb('0x4a')]({'where':{'id':_0x123ec8[_0xc0bb('0x48')]['id']}})['then'](function(_0x10d859){if(_[_0xc0bb('0x67')](_0x10d859)){throw new ReferenceError(_0xc0bb('0x68'));}return _0x10d859;})[_0xc0bb('0x42')](function(_0x1aae11){var _0x3a894b=_0x1aae11[_0xc0bb('0x50')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3a894b);if(!_[_0xc0bb('0x67')](_0x1aae11['value'])&&fs[_0xc0bb('0x53')](_0x3a894b)){logger['info']('File:\x20\x22'+_0x3a894b+_0xc0bb('0x69'));fs[_0xc0bb('0x6a')](_0x3a894b);}_0x3a894b=_0x3a894b+'.cypher';if(!_[_0xc0bb('0x67')](_0x1aae11[_0xc0bb('0x50')])&&fs[_0xc0bb('0x53')](_0x3a894b)){logger['info'](_0xc0bb('0x6b')+_0x3a894b+_0xc0bb('0x69'));fs[_0xc0bb('0x6a')](_0x3a894b);}return _0x1aae11;})[_0xc0bb('0x42')](function(_0xc18b2f){if(!_0xc18b2f)throw new InternalError();return _0xc18b2f[_0xc0bb('0x66')]();})[_0xc0bb('0x42')](function(){_0xcdeb30[_0xc0bb('0x1b')](0xcc)[_0xc0bb('0x1c')]();})[_0xc0bb('0x46')](handleError(_0xcdeb30,null));};function getBucketslist(_0x20a012,_0x5eec63,_0x471fc7){return new Promise(function(_0x1bb2f3,_0x17a6a9){var _0x1229de=new AWS['S3']({'accessKeyId':_0x5eec63,'secretAccessKey':_0x20a012,'region':_0x471fc7});_0x1229de['listBuckets']({},function(_0x18af17,_0x421037){if(_0x18af17){return _0x17a6a9(_0x18af17);}else{return _0x1bb2f3(_0x421037);}});});}function createBucket(_0x5941b6,_0x24523c,_0x9edeea,_0x205d5d){return new Promise(function(_0x2d711b,_0x1ce214){var _0x3ed9cc=new AWS['S3']({'accessKeyId':_0x24523c,'secretAccessKey':_0x5941b6,'region':_0x9edeea});_0x3ed9cc[_0xc0bb('0x6c')]({'Bucket':_0x205d5d},function(_0x4a1a24,_0x1eb266){if(_0x4a1a24){return _0x1ce214(_0x4a1a24);}else{return _0x2d711b(_0x1eb266);}});});}function uploadFile(_0x502c56,_0x32f2b9,_0x2a09af,_0xb3088f,_0x20bff5,_0x1215e2){return new Promise(function(_0x2a27ae,_0x3d289b){var _0xac1d4e=new AWS['S3']({'accessKeyId':_0x32f2b9,'secretAccessKey':_0x502c56,'region':_0x2a09af});_0xac1d4e['upload']({'Bucket':_0xb3088f,'Key':_0x20bff5,'Body':_0x1215e2},function(_0x5a5257,_0x5a2c80){if(_0x5a5257){return _0x3d289b(_0x5a5257);}else{return _0x2a27ae(_0x5a2c80);}});});}function startTranscribe(_0x179307,_0x1ac4eb,_0x6cbc4b,_0x22ab89,_0x3d6d96,_0xe84fc){return new Promise(function(_0x3983b2,_0xe6ac3b){var _0x525ed8=new AWS[(_0xc0bb('0x6d'))]({'accessKeyId':_0x1ac4eb,'secretAccessKey':_0x179307,'region':_0x6cbc4b});_0x525ed8[_0xc0bb('0x6e')]({'TranscriptionJobName':_0x22ab89,'LanguageCode':_0x3d6d96,'Media':{'MediaFileUri':_0xe84fc}},function(_0xe3856d,_0x37ebc0){if(_0xe3856d){return _0xe6ac3b(_0xe3856d);}else{return _0x3983b2(_0x37ebc0);}});});}function transcribe(_0x47c07b,_0x42c203,_0x148a29,_0x1e5cd0,_0x2004a6,_0x337a35,_0x51f0b0){return new Promise(function(_0x3dfbd3,_0x5bf0e7){var _0x13cbff={};logger['info'](util[_0xc0bb('0x51')](_0xc0bb('0x6f'),_0x47c07b,_0x2004a6));return uploadFile(_0x42c203,_0x148a29,_0x1e5cd0,_0x2004a6,path[_0xc0bb('0x70')](_0x337a35),fs[_0xc0bb('0x71')](_0x337a35))['then'](function(_0x57ff08){logger[_0xc0bb('0x72')](util[_0xc0bb('0x51')](_0xc0bb('0x73'),_0x47c07b,_0x2004a6,_0x57ff08[_0xc0bb('0x74')]));_0x13cbff[_0xc0bb('0x75')]=_0x57ff08[_0xc0bb('0x76')];_0x13cbff['location']=_0x57ff08[_0xc0bb('0x74')];logger['info'](util['format'](_0xc0bb('0x77'),_0x47c07b));return startTranscribe(_0x42c203,_0x148a29,_0x1e5cd0,uuidv4(),_0x51f0b0,_0x57ff08[_0xc0bb('0x74')]);})[_0xc0bb('0x42')](function(_0x4eb1ca){logger[_0xc0bb('0x72')](util[_0xc0bb('0x51')](_0xc0bb('0x78'),_0x47c07b,_0x4eb1ca[_0xc0bb('0x79')]['TranscriptionJobName']));_0x13cbff[_0xc0bb('0x7a')]=_0x4eb1ca[_0xc0bb('0x79')][_0xc0bb('0x7b')];_0x13cbff[_0xc0bb('0x7c')]=_0x4eb1ca[_0xc0bb('0x79')][_0xc0bb('0x7d')];return _0x3dfbd3(_0x13cbff);})['catch'](function(_0x5cfaa7){return _0x5bf0e7(_0x5cfaa7);});});}exports['runTranscribe']=function(_0x512143,_0x35a224,_0xca9d50){var _0x94b38e;var _0xd599a4;var _0x38be76;var _0x8d09ec=require(_0xc0bb('0x5c'));return db['VoiceRecording'][_0xc0bb('0x7e')]({'where':{'id':_0x512143[_0xc0bb('0x48')]['id']}})[_0xc0bb('0x42')](function(_0x143bc5){if(_0x143bc5){var _0xfe7099=util[_0xc0bb('0x51')]('%s.cypher',_0x143bc5['value']);if(fs[_0xc0bb('0x53')](_0xfe7099)){cypher=!![];return _0x8d09ec[_0xc0bb('0x63')](_0xfe7099,_0x143bc5[_0xc0bb('0x50')],config['secrets']['recording'])['then'](function(){return _0x143bc5;});}return _0x143bc5;}})[_0xc0bb('0x42')](function(_0x387a63){if(!_0x387a63){throw new db[(_0xc0bb('0x65'))]['ValidationError'](_0xc0bb('0x7f'));}_0xd599a4=_0x387a63;return db[_0xc0bb('0x80')]['findOne']({'where':{'id':0x1}});})[_0xc0bb('0x42')](handleEntityNotFound(_0x35a224,null))[_0xc0bb('0x42')](function(_0x467347){if(_0x467347){_0x94b38e=_0x467347;if(!_0x94b38e[_0xc0bb('0x81')]||!_0x94b38e[_0xc0bb('0x82')]||!_0x94b38e[_0xc0bb('0x83')]||!_0x94b38e['language']||!_0x94b38e['bucket']){throw new db[(_0xc0bb('0x65'))][(_0xc0bb('0x55'))](_0xc0bb('0x84'));}if(_0x512143['body'][_0xc0bb('0x85')]&&(!_0x94b38e[_0xc0bb('0x86')]||!_0x94b38e['sentimentAccountId']||!_0x94b38e['sentimentRegion']||!_0x94b38e[_0xc0bb('0x87')]||!_0x94b38e[_0xc0bb('0x75')])){throw new db[(_0xc0bb('0x65'))][(_0xc0bb('0x55'))](_0xc0bb('0x88'));}return db[_0xc0bb('0x89')]['findOne']({'where':{'id':_0x94b38e[_0xc0bb('0x82')]}});}})[_0xc0bb('0x42')](function(_0x1b727f){if(!_0x1b727f){throw new db[(_0xc0bb('0x65'))][(_0xc0bb('0x55'))](_0xc0bb('0x8a'));}if(!_0x1b727f[_0xc0bb('0x8b')]||!_0x1b727f[_0xc0bb('0x8c')]){throw new db['Sequelize']['ValidationError'](_0xc0bb('0x8d'));}_0x38be76=_0x1b727f;return getBucketslist(_0x38be76['data1'],_0x38be76[_0xc0bb('0x8c')],_0x94b38e[_0xc0bb('0x83')]);})[_0xc0bb('0x42')](function(_0xd67aa0){if(_0xd67aa0&&_0xd67aa0[_0xc0bb('0x8e')]){var _0xbdce20=_[_0xc0bb('0x4a')](_0xd67aa0['Buckets'],function(_0x4fe7c9){return _0x4fe7c9[_0xc0bb('0x8f')]===_0x94b38e[_0xc0bb('0x75')];});if(!_0xbdce20){logger[_0xc0bb('0x72')](util[_0xc0bb('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x512143[_0xc0bb('0x48')]['id'],_0x94b38e[_0xc0bb('0x75')]));return createBucket(_0x38be76['data1'],_0x38be76['data2'],_0x94b38e[_0xc0bb('0x83')],_0x94b38e[_0xc0bb('0x75')]);}logger['info'](util[_0xc0bb('0x51')](_0xc0bb('0x90'),_0x512143[_0xc0bb('0x48')]['id'],_0x94b38e['bucket']));return;}})[_0xc0bb('0x42')](function(_0x2a7787){if(_0xd599a4[_0xc0bb('0x7c')]===_0xc0bb('0x91')){return transcribe(_0x512143[_0xc0bb('0x48')]['id'],_0x38be76[_0xc0bb('0x8b')],_0x38be76[_0xc0bb('0x8c')],_0x94b38e[_0xc0bb('0x83')],_0x94b38e['bucket'],_0xd599a4['value'],_0x94b38e[_0xc0bb('0x87')]);}else{logger['info'](util['format'](_0xc0bb('0x92'),_0x512143[_0xc0bb('0x48')]['id']));return{'transcribeStatus':_0xc0bb('0x93')};}})[_0xc0bb('0x42')](function(_0x35116c){if(_0x35116c){_0x35116c[_0xc0bb('0x94')]=_0x512143[_0xc0bb('0x4c')]['runSentiment'];return _0xd599a4['updateAttributes'](_0x35116c);}})[_0xc0bb('0x42')](respondWithResult(_0x35a224,null))[_0xc0bb('0x46')](handleError(_0x35a224,null));};function writeFile(_0x54076f,_0x4149a1){return new Promise(function(_0x126c0a,_0x582e93){fs['writeFile'](_0x4149a1,_0x54076f,function(_0x1770a7,_0xc11d06){if(_0x1770a7){return _0x582e93(_0x1770a7);}else{return _0x126c0a(_0xc11d06);}});});}exports['downloadTranscribe']=function(_0x5b2a0a,_0x56fa3f,_0xdaebb6){return db[_0xc0bb('0x2d')][_0xc0bb('0x7e')]({'where':{'id':_0x5b2a0a[_0xc0bb('0x48')]['id']}})[_0xc0bb('0x42')](handleEntityNotFound(_0x56fa3f))[_0xc0bb('0x42')](function(_0x4f403d){if(_0x4f403d&&_0x4f403d[_0xc0bb('0x95')]){var _0x6c0dc1=_0x4f403d[_0xc0bb('0x95')];var _0x101320=config[_0xc0bb('0x96')]+'/server/files/transcribes/transcribe_'+_0x4f403d['id']+_0xc0bb('0x97');if(fs[_0xc0bb('0x53')](_0x101320)){return _0x101320;}return writeFile(_0x6c0dc1,_0x101320)[_0xc0bb('0x42')](function(){return _0x101320;});}else{throw new db['Sequelize'][(_0xc0bb('0x55'))](_0xc0bb('0x98'));}})['then'](function(_0x32d71d){return _0x56fa3f[_0xc0bb('0x4e')](_0x32d71d);})[_0xc0bb('0x46')](handleError(_0x56fa3f));}; \ No newline at end of file +var _0xd956=['../../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','Content-Range','apply','save','then','error','name','send','map','VoiceRecording','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','pick','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','extname','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','format','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','uuid/v4','../../components/auth/service'];(function(_0x791334,_0x13c0f8){var _0x5ba877=function(_0x560dcb){while(--_0x560dcb){_0x791334['push'](_0x791334['shift']());}};_0x5ba877(++_0x13c0f8);}(_0xd956,0x11c));var _0x6d95=function(_0x46c41f,_0x186749){_0x46c41f=_0x46c41f-0x0;var _0x2afba5=_0xd956[_0x46c41f];return _0x2afba5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d95('0x0'));var zipdir=require(_0x6d95('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d95('0x2'));var moment=require(_0x6d95('0x3'));var BPromise=require(_0x6d95('0x4'));var Mustache=require('mustache');var util=require(_0x6d95('0x5'));var path=require('path');var sox=require(_0x6d95('0x6'));var csv=require(_0x6d95('0x7'));var ejs=require(_0x6d95('0x8'));var fs=require('fs');var fs_extra=require(_0x6d95('0x9'));var _=require(_0x6d95('0xa'));var squel=require(_0x6d95('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d95('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d95('0x7'));var querystring=require('querystring');var Papa=require(_0x6d95('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x6d95('0xe'));var Redis=require('ioredis');var authService=require(_0x6d95('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6d95('0x10'));var hardwareService=require(_0x6d95('0x11'));var logger=require(_0x6d95('0x12'))(_0x6d95('0x13'));var utils=require(_0x6d95('0x14'));var config=require(_0x6d95('0x15'));var licenseUtil=require(_0x6d95('0x16'));var db=require(_0x6d95('0x17'))['db'];function respondWithStatusCode(_0x2dc9ed,_0x3cdb79){_0x3cdb79=_0x3cdb79||0xcc;return function(_0x231ffc){if(_0x231ffc){return _0x2dc9ed['sendStatus'](_0x3cdb79);}return _0x2dc9ed[_0x6d95('0x18')](_0x3cdb79)[_0x6d95('0x19')]();};}function respondWithResult(_0x358921,_0x1ea118){_0x1ea118=_0x1ea118||0xc8;return function(_0x31d61f){if(_0x31d61f){return _0x358921[_0x6d95('0x18')](_0x1ea118)[_0x6d95('0x1a')](_0x31d61f);}};}function respondWithFilteredResult(_0xb3e402,_0x3c5c01){return function(_0x2409de){if(_0x2409de){var _0x53cda6=typeof _0x3c5c01[_0x6d95('0x1b')]===_0x6d95('0x1c')&&typeof _0x3c5c01[_0x6d95('0x1d')]==='undefined';var _0x5bb940=_0x2409de[_0x6d95('0x1e')];var _0xabf3ac=_0x53cda6?0x0:_0x3c5c01[_0x6d95('0x1b')];var _0x10bd7e=_0x53cda6?_0x2409de['count']:_0x3c5c01[_0x6d95('0x1b')]+_0x3c5c01[_0x6d95('0x1d')];var _0x5c967e;if(_0x10bd7e>=_0x5bb940){_0x10bd7e=_0x5bb940;_0x5c967e=0xc8;}else{_0x5c967e=0xce;}_0xb3e402[_0x6d95('0x18')](_0x5c967e);return _0xb3e402[_0x6d95('0x1f')](_0x6d95('0x20'),_0xabf3ac+'-'+_0x10bd7e+'/'+_0x5bb940)['json'](_0x2409de);}return null;};}function patchUpdates(_0x2d579d){return function(_0x18bf94){try{jsonpatch[_0x6d95('0x21')](_0x18bf94,_0x2d579d,!![]);}catch(_0x5b9526){return BPromise['reject'](_0x5b9526);}return _0x18bf94[_0x6d95('0x22')]();};}function saveUpdates(_0xa06f0c,_0xdcc3af){return function(_0x31af47){if(_0x31af47){return _0x31af47['update'](_0xa06f0c)[_0x6d95('0x23')](function(_0xc7ead7){return _0xc7ead7;});}return null;};}function removeEntity(_0x28af0d,_0x31f140){return function(_0x54dd46){if(_0x54dd46){return _0x54dd46['destroy']()['then'](function(){_0x28af0d[_0x6d95('0x18')](0xcc)[_0x6d95('0x19')]();});}};}function handleEntityNotFound(_0x43c0b8,_0x2cf9e2){return function(_0x199589){if(!_0x199589){_0x43c0b8['sendStatus'](0x194);}return _0x199589;};}function handleError(_0x3aa1a1,_0x425c0a){_0x425c0a=_0x425c0a||0x1f4;return function(_0x1b634f){logger[_0x6d95('0x24')](_0x1b634f['stack']);if(_0x1b634f[_0x6d95('0x25')]){delete _0x1b634f[_0x6d95('0x25')];}_0x3aa1a1[_0x6d95('0x18')](_0x425c0a)[_0x6d95('0x26')](_0x1b634f);};}exports['index']=function(_0x113f37,_0x6a58d){var _0x52c7a2={},_0x1ab07d={},_0x34f596={'count':0x0,'rows':[]};var _0x3fd6f7=_[_0x6d95('0x27')](db[_0x6d95('0x28')][_0x6d95('0x29')],function(_0x11207c){return{'name':_0x11207c[_0x6d95('0x2a')],'type':_0x11207c['type']['key']};});_0x1ab07d[_0x6d95('0x2b')]=_['differenceBy'](_[_0x6d95('0x27')](_0x3fd6f7,_0x6d95('0x25')),['format']);_0x1ab07d['query']=_[_0x6d95('0x2c')](_0x113f37['query']);_0x1ab07d[_0x6d95('0x2d')]=_[_0x6d95('0x2e')](_0x1ab07d[_0x6d95('0x2b')],_0x1ab07d[_0x6d95('0x2f')]);_0x52c7a2['attributes']=_[_0x6d95('0x2e')](_0x1ab07d[_0x6d95('0x2b')],qs[_0x6d95('0x30')](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x30')]));_0x52c7a2[_0x6d95('0x31')]=_0x52c7a2['attributes']['length']?_0x52c7a2['attributes']:_0x1ab07d[_0x6d95('0x2b')];if(!_0x113f37[_0x6d95('0x2f')]['hasOwnProperty'](_0x6d95('0x32'))){_0x52c7a2[_0x6d95('0x1d')]=qs['limit'](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x1d')]);_0x52c7a2[_0x6d95('0x1b')]=qs[_0x6d95('0x1b')](_0x113f37['query']['offset']);}_0x52c7a2[_0x6d95('0x33')]=qs[_0x6d95('0x34')](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x34')]);_0x52c7a2['where']=qs[_0x6d95('0x2d')](_[_0x6d95('0x35')](_0x113f37[_0x6d95('0x2f')],_0x1ab07d['filters']),_0x3fd6f7);if(_0x113f37[_0x6d95('0x2f')]['filter']){_0x52c7a2[_0x6d95('0x36')]=_[_0x6d95('0x37')](_0x52c7a2['where'],{'$or':_[_0x6d95('0x27')](_0x3fd6f7,function(_0x9b059e){if(_0x9b059e[_0x6d95('0x38')]!=='VIRTUAL'){var _0x58737a={};_0x58737a[_0x9b059e[_0x6d95('0x25')]]={'$like':'%'+_0x113f37[_0x6d95('0x2f')][_0x6d95('0x39')]+'%'};return _0x58737a;}})});}_0x52c7a2=_[_0x6d95('0x37')]({},_0x52c7a2,_0x113f37['options']);var _0x3f6909={'where':_0x52c7a2[_0x6d95('0x36')]};return db[_0x6d95('0x28')][_0x6d95('0x1e')](_0x3f6909)[_0x6d95('0x23')](function(_0x2fa182){_0x34f596[_0x6d95('0x1e')]=_0x2fa182;if(_0x113f37[_0x6d95('0x2f')][_0x6d95('0x3a')]){_0x52c7a2[_0x6d95('0x3b')]=[{'all':!![]}];}return db[_0x6d95('0x28')][_0x6d95('0x3c')](_0x52c7a2);})[_0x6d95('0x23')](function(_0x1179f7){_0x34f596[_0x6d95('0x3d')]=_0x1179f7;return _0x34f596;})['then'](respondWithFilteredResult(_0x6a58d,_0x52c7a2))[_0x6d95('0x3e')](handleError(_0x6a58d,null));};exports[_0x6d95('0x3f')]=function(_0x61a46e,_0x3f0d8f){var _0x504852={'raw':![],'where':{'id':_0x61a46e[_0x6d95('0x40')]['id']}},_0x451622={};_0x451622[_0x6d95('0x2b')]=_[_0x6d95('0x2c')](db[_0x6d95('0x28')][_0x6d95('0x29')]);_0x451622[_0x6d95('0x2f')]=_[_0x6d95('0x2c')](_0x61a46e[_0x6d95('0x2f')]);_0x451622[_0x6d95('0x2d')]=_[_0x6d95('0x2e')](_0x451622[_0x6d95('0x2b')],_0x451622[_0x6d95('0x2f')]);_0x504852['attributes']=_[_0x6d95('0x2e')](_0x451622[_0x6d95('0x2b')],qs[_0x6d95('0x30')](_0x61a46e[_0x6d95('0x2f')][_0x6d95('0x30')]));_0x504852[_0x6d95('0x31')]=_0x504852[_0x6d95('0x31')][_0x6d95('0x41')]?_0x504852[_0x6d95('0x31')]:_0x451622['model'];if(_0x61a46e[_0x6d95('0x2f')][_0x6d95('0x3a')]){_0x504852[_0x6d95('0x3b')]=[{'all':!![]}];}_0x504852=_[_0x6d95('0x37')]({},_0x504852,_0x61a46e[_0x6d95('0x42')]);return db[_0x6d95('0x28')][_0x6d95('0x43')](_0x504852)[_0x6d95('0x23')](handleEntityNotFound(_0x3f0d8f,null))['then'](respondWithResult(_0x3f0d8f,null))['catch'](handleError(_0x3f0d8f,null));};exports[_0x6d95('0x44')]=function(_0x2c8f0b,_0x194026){return db[_0x6d95('0x28')][_0x6d95('0x44')](_0x2c8f0b[_0x6d95('0x45')],{})[_0x6d95('0x23')](respondWithResult(_0x194026,0xc9))[_0x6d95('0x3e')](handleError(_0x194026,null));};exports['update']=function(_0x58c16d,_0x457824){if(_0x58c16d[_0x6d95('0x45')]['id']){delete _0x58c16d[_0x6d95('0x45')]['id'];}return db[_0x6d95('0x28')][_0x6d95('0x43')]({'where':{'id':_0x58c16d['params']['id']}})[_0x6d95('0x23')](handleEntityNotFound(_0x457824,null))[_0x6d95('0x23')](saveUpdates(_0x58c16d[_0x6d95('0x45')],null))[_0x6d95('0x23')](respondWithResult(_0x457824,null))[_0x6d95('0x3e')](handleError(_0x457824,null));};exports[_0x6d95('0x46')]=function(_0x39d687,_0x140850){return db[_0x6d95('0x28')][_0x6d95('0x46')]()[_0x6d95('0x23')](respondWithResult(_0x140850,null))[_0x6d95('0x3e')](handleError(_0x140850,null));};exports['download']=function(_0x2553cb,_0x34a4b0,_0x4fd0bf){var _0x3bbd59=require(_0x6d95('0x47'));var _0x41e33c=![];var _0x547c22={};if(_0x2553cb['query'][_0x6d95('0x38')]&&_0x2553cb['query'][_0x6d95('0x38')]==='uniqueid'){_0x547c22[_0x6d95('0x48')]=_0x2553cb[_0x6d95('0x40')]['id'];}else{_0x547c22['id']=_0x2553cb[_0x6d95('0x40')]['id'];}return db[_0x6d95('0x28')][_0x6d95('0x43')]({'where':_0x547c22,'attributes':['id',_0x6d95('0x49')],'raw':!![]})[_0x6d95('0x23')](handleEntityNotFound(_0x34a4b0,null))[_0x6d95('0x23')](function(_0x477352){if(_0x477352){var _0x10fd1f=_0x477352[_0x6d95('0x49')];var _0x4852b1=util['format']('%s.cypher',_0x10fd1f);if(fs['existsSync'](_0x4852b1)){_0x41e33c=!![];return _0x3bbd59[_0x6d95('0x4a')](_0x4852b1,_0x10fd1f,config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x477352;});}return _0x477352;}})['then'](function(_0x3d2739){if(_0x3d2739){var _0x342872=_0x3d2739[_0x6d95('0x49')];if(!fs[_0x6d95('0x4d')](_0x342872)){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x50'));}if(_0x3d2739['filename']){return _0x34a4b0[_0x6d95('0x51')](_0x342872,_0x3d2739[_0x6d95('0x52')]+path['extname'](_0x342872),function(){if(_0x41e33c){fs[_0x6d95('0x53')](_0x342872);}});}else{return _0x34a4b0[_0x6d95('0x51')](_0x342872,function(_0x3115b4){if(_0x41e33c){fs[_0x6d95('0x53')](_0x342872);}});}}})['catch'](function(_0x21c16f){if(_0x21c16f['message']===_0x6d95('0x50')){_0x34a4b0[_0x6d95('0x18')](0x194)[_0x6d95('0x26')](_0x6d95('0x54'));}else{return handleError(_0x34a4b0,null);}});};exports[_0x6d95('0x55')]=function(_0x16c785,_0x173f37,_0xf1507e){var _0x546044=require(_0x6d95('0x47'));var _0x33729e=![];var _0xf4a494={'$and':[db['sequelize']['where'](db[_0x6d95('0x56')]['fn'](_0x6d95('0x57'),db['sequelize'][_0x6d95('0x58')](_0x6d95('0x48'))),_0x16c785[_0x6d95('0x2f')]['token'])]};if(_0x16c785[_0x6d95('0x2f')][_0x6d95('0x38')]&&_0x16c785[_0x6d95('0x2f')][_0x6d95('0x38')]==='uniqueid'){_0xf4a494[_0x6d95('0x59')]['push']({'uniqueid':_0x16c785[_0x6d95('0x40')]['id']});}else{_0xf4a494[_0x6d95('0x59')][_0x6d95('0x5a')]({'id':_0x16c785[_0x6d95('0x40')]['id']});}return db[_0x6d95('0x28')]['find']({'where':_0xf4a494,'attributes':['id','value'],'raw':!![]})[_0x6d95('0x23')](handleEntityNotFound(_0x173f37,null))[_0x6d95('0x23')](function(_0x36e219){if(_0x36e219){var _0x16f457=util['format'](_0x6d95('0x5b'),_0x36e219[_0x6d95('0x49')]);if(fs[_0x6d95('0x4d')](_0x16f457)){_0x33729e=!![];return _0x546044[_0x6d95('0x4a')](_0x16f457,_0x36e219[_0x6d95('0x49')],config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x36e219;});}return _0x36e219;}})[_0x6d95('0x23')](function(_0x5e05c3){if(_0x5e05c3){if(!fs['existsSync'](_0x5e05c3[_0x6d95('0x49')])){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x5e05c3['filename']){return _0x173f37[_0x6d95('0x51')](_0x5e05c3[_0x6d95('0x49')],_0x5e05c3[_0x6d95('0x52')]+path[_0x6d95('0x5c')](_0x5e05c3[_0x6d95('0x49')]),function(){if(_0x33729e){fs[_0x6d95('0x53')](_0x5e05c3[_0x6d95('0x49')]);}});}else{return _0x173f37[_0x6d95('0x51')](_0x5e05c3[_0x6d95('0x49')],function(_0x540295){if(_0x33729e){fs[_0x6d95('0x53')](_0x5e05c3[_0x6d95('0x49')]);}});}}})['catch'](handleError(_0x173f37,null));};exports[_0x6d95('0x5d')]=function(_0x34e34a,_0x1e023c){return db[_0x6d95('0x28')]['find']({'where':{'id':_0x34e34a[_0x6d95('0x40')]['id']}})[_0x6d95('0x23')](function(_0x1cff31){if(_['isNil'](_0x1cff31)){throw new ReferenceError(_0x6d95('0x5e'));}return _0x1cff31;})['then'](function(_0x55dbb4){var _0x18f583=_0x55dbb4[_0x6d95('0x49')];logger['info'](_0x6d95('0x5f'),_0x18f583);if(!_[_0x6d95('0x60')](_0x55dbb4[_0x6d95('0x49')])&&fs['existsSync'](_0x18f583)){logger[_0x6d95('0x61')](_0x6d95('0x62')+_0x18f583+_0x6d95('0x63'));fs['unlinkSync'](_0x18f583);}_0x18f583=_0x18f583+_0x6d95('0x64');if(!_['isNil'](_0x55dbb4[_0x6d95('0x49')])&&fs[_0x6d95('0x4d')](_0x18f583)){logger[_0x6d95('0x61')]('File:\x20\x22'+_0x18f583+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6d95('0x65')](_0x18f583);}return _0x55dbb4;})[_0x6d95('0x23')](function(_0xf4a300){if(!_0xf4a300)throw new InternalError();return _0xf4a300[_0x6d95('0x5d')]();})[_0x6d95('0x23')](function(){_0x1e023c['status'](0xcc)[_0x6d95('0x19')]();})['catch'](handleError(_0x1e023c,null));};function getBucketslist(_0x5a1461,_0x8b470c,_0x16bb84){return new Promise(function(_0x446719,_0x3594ae){var _0xe7503d=new AWS['S3']({'accessKeyId':_0x8b470c,'secretAccessKey':_0x5a1461,'region':_0x16bb84});_0xe7503d[_0x6d95('0x66')]({},function(_0x9a8ef4,_0x2c7758){if(_0x9a8ef4){return _0x3594ae(_0x9a8ef4);}else{return _0x446719(_0x2c7758);}});});}function createBucket(_0x2b61f0,_0x918412,_0x3fc91d,_0xd765c1){return new Promise(function(_0x1ebf34,_0x24f892){var _0x134569=new AWS['S3']({'accessKeyId':_0x918412,'secretAccessKey':_0x2b61f0,'region':_0x3fc91d});_0x134569[_0x6d95('0x67')]({'Bucket':_0xd765c1},function(_0x12d6ab,_0x4adefa){if(_0x12d6ab){return _0x24f892(_0x12d6ab);}else{return _0x1ebf34(_0x4adefa);}});});}function uploadFile(_0x11f30a,_0x460e38,_0x1e1bec,_0x6129,_0x3dfdce,_0x5686f8){return new Promise(function(_0x5e7309,_0x5e6944){var _0x2c9202=new AWS['S3']({'accessKeyId':_0x460e38,'secretAccessKey':_0x11f30a,'region':_0x1e1bec});_0x2c9202[_0x6d95('0x68')]({'Bucket':_0x6129,'Key':_0x3dfdce,'Body':_0x5686f8},function(_0x4c33ff,_0xb21a1b){if(_0x4c33ff){return _0x5e6944(_0x4c33ff);}else{return _0x5e7309(_0xb21a1b);}});});}function startTranscribe(_0x56fd41,_0x1b34d3,_0x51efd4,_0x5985ac,_0x56a21d,_0x5df679){return new Promise(function(_0x3cb938,_0xcb5b4a){var _0x1af9e3=new AWS['TranscribeService']({'accessKeyId':_0x1b34d3,'secretAccessKey':_0x56fd41,'region':_0x51efd4});_0x1af9e3[_0x6d95('0x69')]({'TranscriptionJobName':_0x5985ac,'LanguageCode':_0x56a21d,'Media':{'MediaFileUri':_0x5df679}},function(_0x302359,_0x4dbc5c){if(_0x302359){return _0xcb5b4a(_0x302359);}else{return _0x3cb938(_0x4dbc5c);}});});}function transcribe(_0x238e46,_0x5346e2,_0x26f815,_0x26f99c,_0x9fcfac,_0x4318f3,_0x4bbde0){return new Promise(function(_0x4b4769,_0x502075){var _0x32c66b={};logger['info'](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x238e46,_0x9fcfac));return uploadFile(_0x5346e2,_0x26f815,_0x26f99c,_0x9fcfac,path[_0x6d95('0x6b')](_0x4318f3),fs[_0x6d95('0x6c')](_0x4318f3))[_0x6d95('0x23')](function(_0x2316fc){logger[_0x6d95('0x61')](util[_0x6d95('0x6a')](_0x6d95('0x6d'),_0x238e46,_0x9fcfac,_0x2316fc[_0x6d95('0x6e')]));_0x32c66b[_0x6d95('0x6f')]=_0x2316fc[_0x6d95('0x70')];_0x32c66b[_0x6d95('0x71')]=_0x2316fc['Location'];logger[_0x6d95('0x61')](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x238e46));return startTranscribe(_0x5346e2,_0x26f815,_0x26f99c,uuidv4(),_0x4bbde0,_0x2316fc[_0x6d95('0x6e')]);})[_0x6d95('0x23')](function(_0x5232ec){logger[_0x6d95('0x61')](util['format'](_0x6d95('0x72'),_0x238e46,_0x5232ec[_0x6d95('0x73')][_0x6d95('0x74')]));_0x32c66b[_0x6d95('0x75')]=_0x5232ec[_0x6d95('0x73')][_0x6d95('0x74')];_0x32c66b[_0x6d95('0x76')]=_0x5232ec[_0x6d95('0x73')][_0x6d95('0x77')];return _0x4b4769(_0x32c66b);})[_0x6d95('0x3e')](function(_0x4df50c){return _0x502075(_0x4df50c);});});}exports[_0x6d95('0x78')]=function(_0x494d12,_0x36c0ed,_0x1f5ed3){var _0x61c125;var _0x357f02;var _0x125382;var _0x580a5f=require(_0x6d95('0x47'));return db[_0x6d95('0x28')][_0x6d95('0x79')]({'where':{'id':_0x494d12[_0x6d95('0x40')]['id']}})['then'](function(_0x4f8166){if(_0x4f8166){var _0xd7dd30=util[_0x6d95('0x6a')](_0x6d95('0x5b'),_0x4f8166[_0x6d95('0x49')]);if(fs[_0x6d95('0x4d')](_0xd7dd30)){cypher=!![];return _0x580a5f[_0x6d95('0x4a')](_0xd7dd30,_0x4f8166[_0x6d95('0x49')],config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x4f8166;});}return _0x4f8166;}})[_0x6d95('0x23')](function(_0x47dcf3){if(!_0x47dcf3){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x7a'));}_0x357f02=_0x47dcf3;return db[_0x6d95('0x7b')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x36c0ed,null))[_0x6d95('0x23')](function(_0x141141){if(_0x141141){_0x61c125=_0x141141;if(!_0x61c125[_0x6d95('0x7c')]||!_0x61c125[_0x6d95('0x7d')]||!_0x61c125[_0x6d95('0x7e')]||!_0x61c125[_0x6d95('0x7f')]||!_0x61c125[_0x6d95('0x6f')]){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x80'));}if(_0x494d12[_0x6d95('0x45')][_0x6d95('0x81')]&&(!_0x61c125[_0x6d95('0x82')]||!_0x61c125[_0x6d95('0x83')]||!_0x61c125[_0x6d95('0x84')]||!_0x61c125[_0x6d95('0x7f')]||!_0x61c125[_0x6d95('0x6f')])){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x85'));}return db[_0x6d95('0x86')][_0x6d95('0x79')]({'where':{'id':_0x61c125[_0x6d95('0x7d')]}});}})[_0x6d95('0x23')](function(_0x26b29d){if(!_0x26b29d){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x87'));}if(!_0x26b29d['data1']||!_0x26b29d[_0x6d95('0x88')]){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x89'));}_0x125382=_0x26b29d;return getBucketslist(_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')]);})[_0x6d95('0x23')](function(_0x499916){if(_0x499916&&_0x499916[_0x6d95('0x8b')]){var _0x3dddaf=_[_0x6d95('0x43')](_0x499916[_0x6d95('0x8b')],function(_0x5369a3){return _0x5369a3[_0x6d95('0x8c')]===_0x61c125['bucket'];});if(!_0x3dddaf){logger[_0x6d95('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x494d12[_0x6d95('0x40')]['id'],_0x61c125[_0x6d95('0x6f')]));return createBucket(_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')],_0x61c125['bucket']);}logger['info'](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x494d12[_0x6d95('0x40')]['id'],_0x61c125[_0x6d95('0x6f')]));return;}})[_0x6d95('0x23')](function(_0x2608f0){if(_0x357f02[_0x6d95('0x76')]===_0x6d95('0x8d')){return transcribe(_0x494d12[_0x6d95('0x40')]['id'],_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')],_0x61c125[_0x6d95('0x6f')],_0x357f02[_0x6d95('0x49')],_0x61c125['language']);}else{logger[_0x6d95('0x61')](util[_0x6d95('0x6a')](_0x6d95('0x8e'),_0x494d12[_0x6d95('0x40')]['id']));return{'transcribeStatus':_0x6d95('0x8f')};}})[_0x6d95('0x23')](function(_0x180a0a){if(_0x180a0a){_0x180a0a[_0x6d95('0x90')]=_0x494d12['body'][_0x6d95('0x81')];return _0x357f02[_0x6d95('0x91')](_0x180a0a);}})['then'](respondWithResult(_0x36c0ed,null))[_0x6d95('0x3e')](handleError(_0x36c0ed,null));};function writeFile(_0x3021b0,_0x14aae4){return new Promise(function(_0x301551,_0x25c819){fs['writeFile'](_0x14aae4,_0x3021b0,function(_0x1fb515,_0x5dfbb3){if(_0x1fb515){return _0x25c819(_0x1fb515);}else{return _0x301551(_0x5dfbb3);}});});}exports['downloadTranscribe']=function(_0x4d01b5,_0x48d4df,_0x11a32e){return db['VoiceRecording'][_0x6d95('0x79')]({'where':{'id':_0x4d01b5['params']['id']}})[_0x6d95('0x23')](handleEntityNotFound(_0x48d4df))[_0x6d95('0x23')](function(_0x41cd6b){if(_0x41cd6b&&_0x41cd6b['fileText']){var _0x592a21=_0x41cd6b['fileText'];var _0x3e07d4=config[_0x6d95('0x92')]+_0x6d95('0x93')+_0x41cd6b['id']+_0x6d95('0x94');if(fs[_0x6d95('0x4d')](_0x3e07d4)){return _0x3e07d4;}return writeFile(_0x592a21,_0x3e07d4)[_0x6d95('0x23')](function(){return _0x3e07d4;});}else{throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x95'));}})[_0x6d95('0x23')](function(_0x4fd87f){return _0x48d4df[_0x6d95('0x51')](_0x4fd87f);})[_0x6d95('0x3e')](handleError(_0x48d4df));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2edb716..db8a8d2 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 _0x0776=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger'];(function(_0x107f87,_0x2fc1b3){var _0x1a18fe=function(_0x4d737c){while(--_0x4d737c){_0x107f87['push'](_0x107f87['shift']());}};_0x1a18fe(++_0x2fc1b3);}(_0x0776,0x128));var _0x6077=function(_0x5d0324,_0x56b3a5){_0x5d0324=_0x5d0324-0x0;var _0x49952a=_0x0776[_0x5d0324];return _0x49952a;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var logger=require(_0x6077('0x2'))(_0x6077('0x3'));var moment=require(_0x6077('0x4'));var BPromise=require(_0x6077('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6077('0x6'));var rimraf=require(_0x6077('0x7'));var config=require(_0x6077('0x8'));var attributes=require('./voiceRecording.attributes');module[_0x6077('0x9')]=function(_0x296219,_0x5d3c70){return _0x296219[_0x6077('0xa')]('VoiceRecording',attributes,{'tableName':_0x6077('0xb'),'paranoid':![],'indexes':[{'name':_0x6077('0xc'),'fields':[_0x6077('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a55=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','voice_recordings','uniqueid'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a55,0xcc));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require(_0x57a5('0x1'));var logger=require(_0x57a5('0x2'))(_0x57a5('0x3'));var moment=require(_0x57a5('0x4'));var BPromise=require(_0x57a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57a5('0x6'));var rimraf=require(_0x57a5('0x7'));var config=require(_0x57a5('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x28a709,_0x4e75ae){return _0x28a709[_0x57a5('0x9')]('VoiceRecording',attributes,{'tableName':_0x57a5('0xa'),'paranoid':![],'indexes':[{'name':_0x57a5('0xb'),'fields':[_0x57a5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d5e2b3a..beb4783 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 _0x3e24=['client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x50222c,_0x120c24){var _0x1dc95c=function(_0x167e82){while(--_0x167e82){_0x50222c['push'](_0x50222c['shift']());}};_0x1dc95c(++_0x120c24);}(_0x3e24,0x167));var _0x43e2=function(_0x186020,_0x1fc7f9){_0x186020=_0x186020-0x0;var _0x30380a=_0x3e24[_0x186020];return _0x30380a;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});}exports[_0x43e2('0x15')]=function(_0x1b7cde){var _0x3ea010=this;return new Promise(function(_0x15ecb5,_0x3236b9){return db[_0x43e2('0x16')]['update'](_0x1b7cde[_0x43e2('0x17')],{'raw':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde['options'][_0x43e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1a')]||null:null,'attributes':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1b')]||null:null,'limit':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1c')]||null:null})[_0x43e2('0xc')](function(_0x52e361){logger[_0x43e2('0x13')](_0x43e2('0x15'),_0x1b7cde);logger[_0x43e2('0x1d')](_0x43e2('0x15'),_0x1b7cde,JSON['stringify'](_0x52e361));_0x15ecb5(_0x52e361);})[_0x43e2('0x14')](function(_0xc717d8){logger[_0x43e2('0x10')](_0x43e2('0x15'),_0xc717d8[_0x43e2('0x12')],_0x1b7cde);_0x3236b9(_0x3ea010[_0x43e2('0x10')](0x1f4,_0xc717d8[_0x43e2('0x12')]));});});};exports[_0x43e2('0x1e')]=function(_0xd29b7b){var _0x1ec68e=this;return new Promise(function(_0x1ea844,_0x1de7e1){var _0x52ed49=require(_0x43e2('0x1f'));var _0x2f2bd8;return db['Setting'][_0x43e2('0x20')]({'attributes':['id',_0x43e2('0x21')],'where':{'id':0x1},'raw':!![]})[_0x43e2('0xc')](function(_0x404483){_0x2f2bd8=_0x404483;return db[_0x43e2('0x16')]['create'](_0xd29b7b[_0x43e2('0x17')]);})[_0x43e2('0xc')](function(_0x1779f9){if(_0x2f2bd8[_0x43e2('0x21')]&&fs[_0x43e2('0x22')](_0x1779f9[_0x43e2('0x23')])){var _0x53f797=util['format'](_0x43e2('0x24'),_0x1779f9[_0x43e2('0x23')]);return _0x52ed49[_0x43e2('0x25')](_0x1779f9[_0x43e2('0x23')],_0x53f797,config[_0x43e2('0x26')]['recording'])[_0x43e2('0xc')](function(){fs[_0x43e2('0x27')](_0x1779f9[_0x43e2('0x23')]);logger[_0x43e2('0x13')](_0x43e2('0x28'));return _0x1779f9;});}return _0x1779f9;})[_0x43e2('0xc')](function(_0x2fcdd4){logger['info']('CreateVoiceRecording',_0xd29b7b);logger[_0x43e2('0x1d')](_0x43e2('0x1e'),_0xd29b7b,JSON['stringify'](_0x2fcdd4));_0x1ea844(_0x2fcdd4);})[_0x43e2('0x14')](function(_0x34effb){logger['error'](_0x43e2('0x1e'),_0x34effb['message'],_0xd29b7b);_0x1de7e1(_0x1ec68e['error'](0x1f4,_0x34effb['message']));});});}; \ No newline at end of file +var _0x583c=['options','raw','where','attributes','limit','debug','stringify','catch','Setting','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x3b66cd,_0x4effa9){var _0x32ff6d=function(_0x52d640){while(--_0x52d640){_0x3b66cd['push'](_0x3b66cd['shift']());}};_0x32ff6d(++_0x4effa9);}(_0x583c,0x12b));var _0xc583=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x583c[_0x802997];return _0x35c641;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['update'](_0x8a2d84[_0xc583('0x14')],{'raw':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x17')]||null:null,'attributes':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x18')]||null:null,'limit':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x19')]||null:null})['then'](function(_0x542256){logger[_0xc583('0xb')](_0xc583('0x12'),_0x8a2d84);logger[_0xc583('0x1a')]('UpdateVoiceRecording',_0x8a2d84,JSON[_0xc583('0x1b')](_0x542256));_0x36e0fd(_0x542256);})[_0xc583('0x1c')](function(_0x37f156){logger[_0xc583('0xf')](_0xc583('0x12'),_0x37f156['message'],_0x8a2d84);_0x5433ec(_0x12aac2['error'](0x1f4,_0x37f156[_0xc583('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x45ef74){var _0xcbe9b2=this;return new Promise(function(_0xbabf24,_0x1e7809){var _0x24aab5=require('../../components/encryptor');var _0x2dafb4;return db[_0xc583('0x1d')]['findOne']({'attributes':['id',_0xc583('0x1e')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x2c9088){_0x2dafb4=_0x2c9088;return db[_0xc583('0x13')][_0xc583('0x1f')](_0x45ef74[_0xc583('0x14')]);})[_0xc583('0xa')](function(_0x19079b){if(_0x2dafb4[_0xc583('0x1e')]&&fs['existsSync'](_0x19079b[_0xc583('0x20')])){var _0x390bc3=util[_0xc583('0x21')](_0xc583('0x22'),_0x19079b[_0xc583('0x20')]);return _0x24aab5[_0xc583('0x23')](_0x19079b['value'],_0x390bc3,config[_0xc583('0x24')]['recording'])['then'](function(){fs[_0xc583('0x25')](_0x19079b[_0xc583('0x20')]);logger[_0xc583('0xb')](_0xc583('0x26'));return _0x19079b;});}return _0x19079b;})[_0xc583('0xa')](function(_0x4a9679){logger[_0xc583('0xb')](_0xc583('0x27'),_0x45ef74);logger[_0xc583('0x1a')]('CreateVoiceRecording',_0x45ef74,JSON[_0xc583('0x1b')](_0x4a9679));_0xbabf24(_0x4a9679);})['catch'](function(_0x1aa62a){logger[_0xc583('0xf')](_0xc583('0x27'),_0x1aa62a[_0xc583('0x10')],_0x45ef74);_0x1e7809(_0xcbe9b2[_0xc583('0xf')](0x1f4,_0x1aa62a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e1aa89f..dd4765e 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 _0x260e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x260e,0xac));var _0xe260=function(_0x52a81e,_0x397de9){_0x52a81e=_0x52a81e-0x0;var _0x156e65=_0x260e[_0x52a81e];return _0x156e65;};'use strict';var multer=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var path=require(_0xe260('0x2'));var timeout=require(_0xe260('0x3'));var express=require(_0xe260('0x4'));var router=express['Router']();var fs_extra=require(_0xe260('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe260('0x6'));var config=require(_0xe260('0x7'));var controller=require(_0xe260('0x8'));router[_0xe260('0x9')]('/',auth[_0xe260('0xa')](),controller[_0xe260('0xb')]);router[_0xe260('0x9')](_0xe260('0xc'),auth[_0xe260('0xa')](),controller['describe']);router[_0xe260('0x9')]('/:id',auth[_0xe260('0xa')](),controller[_0xe260('0xd')]);router[_0xe260('0xe')]('/',auth['isAuthenticated'](),controller[_0xe260('0xf')]);router['put'](_0xe260('0x10'),auth[_0xe260('0xa')](),controller[_0xe260('0x11')]);router[_0xe260('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe260('0x13')]);module[_0xe260('0x14')]=router; \ No newline at end of file +var _0x5034=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','./voiceTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x5034,0xd5));var _0x4503=function(_0x1691ca,_0x9d48b6){_0x1691ca=_0x1691ca-0x0;var _0xe4f6f0=_0x5034[_0x1691ca];return _0xe4f6f0;};'use strict';var multer=require(_0x4503('0x0'));var util=require(_0x4503('0x1'));var path=require('path');var timeout=require(_0x4503('0x2'));var express=require(_0x4503('0x3'));var router=express[_0x4503('0x4')]();var fs_extra=require(_0x4503('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4503('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4503('0x7')]);router[_0x4503('0x8')](_0x4503('0x9'),auth[_0x4503('0xa')](),controller[_0x4503('0xb')]);router[_0x4503('0x8')](_0x4503('0xc'),auth[_0x4503('0xa')](),controller[_0x4503('0xd')]);router['post']('/',auth[_0x4503('0xa')](),controller[_0x4503('0xe')]);router[_0x4503('0xf')](_0x4503('0xc'),auth[_0x4503('0xa')](),controller['update']);router[_0x4503('0x10')]('/:id',auth[_0x4503('0xa')](),controller[_0x4503('0x11')]);module[_0x4503('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e541377..a901026 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 _0x0d79=['blind','attended','STRING','moment','exports','ENUM'];(function(_0x38dff7,_0x1cc092){var _0xd88a0a=function(_0x1c7f13){while(--_0x1c7f13){_0x38dff7['push'](_0x38dff7['shift']());}};_0xd88a0a(++_0x1cc092);}(_0x0d79,0x81));var _0x90d7=function(_0x33d138,_0xe77cd6){_0x33d138=_0x33d138-0x0;var _0x1c7aa0=_0x0d79[_0x33d138];return _0x1c7aa0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x90d7('0x0'));module[_0x90d7('0x1')]={'type':{'type':Sequelize[_0x90d7('0x2')](_0x90d7('0x3'),_0x90d7('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x90d7('0x5')]},'transferercalleridname':{'type':Sequelize[_0x90d7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x90d7('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x90d7('0x5')]},'transfererexten':{'type':Sequelize[_0x90d7('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x90d7('0x5')]},'transfereechannel':{'type':Sequelize[_0x90d7('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x90d7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x90d7('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x90d7('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x90d7('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x90d7('0x5')]},'isexternal':{'type':Sequelize[_0x90d7('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x90d7('0x5')]},'extension':{'type':Sequelize[_0x90d7('0x5')]}}; \ No newline at end of file +var _0x6401=['blind','attended','STRING','ENUM','Yes','sequelize','moment','exports'];(function(_0x5c45a1,_0x159ce7){var _0x1775fa=function(_0x1b1b77){while(--_0x1b1b77){_0x5c45a1['push'](_0x5c45a1['shift']());}};_0x1775fa(++_0x159ce7);}(_0x6401,0xf5));var _0x1640=function(_0x421bcd,_0x4df016){_0x421bcd=_0x421bcd-0x0;var _0x330e36=_0x6401[_0x421bcd];return _0x330e36;};'use strict';var Sequelize=require(_0x1640('0x0'));var moment=require(_0x1640('0x1'));module[_0x1640('0x2')]={'type':{'type':Sequelize['ENUM'](_0x1640('0x3'),_0x1640('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x1640('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1640('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1640('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1640('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1640('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1640('0x5')]},'transfereechannel':{'type':Sequelize[_0x1640('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1640('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1640('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1640('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1640('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1640('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x1640('0x5')]},'isexternal':{'type':Sequelize[_0x1640('0x6')](_0x1640('0x7'),'No')},'context':{'type':Sequelize[_0x1640('0x5')]},'extension':{'type':Sequelize[_0x1640('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index af6c230..7c7c932 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 _0x3b67=['order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','show','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x12fb74,_0x42e60a){var _0xe155aa=function(_0x40d5c8){while(--_0x40d5c8){_0x12fb74['push'](_0x12fb74['shift']());}};_0xe155aa(++_0x42e60a);}(_0x3b67,0x1da));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x73b6('0x0'));var rimraf=require(_0x73b6('0x1'));var zipdir=require(_0x73b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73b6('0x3'));var moment=require(_0x73b6('0x4'));var BPromise=require(_0x73b6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x73b6('0x6'));var sox=require(_0x73b6('0x7'));var csv=require(_0x73b6('0x8'));var ejs=require(_0x73b6('0x9'));var fs=require('fs');var fs_extra=require(_0x73b6('0xa'));var _=require(_0x73b6('0xb'));var squel=require('squel');var crypto=require(_0x73b6('0xc'));var jsforce=require(_0x73b6('0xd'));var deskjs=require(_0x73b6('0xe'));var toCsv=require(_0x73b6('0x8'));var querystring=require('querystring');var Papa=require(_0x73b6('0xf'));var Redis=require(_0x73b6('0x10'));var authService=require(_0x73b6('0x11'));var qs=require(_0x73b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73b6('0x13'));var logger=require(_0x73b6('0x14'))(_0x73b6('0x15'));var utils=require(_0x73b6('0x16'));var config=require(_0x73b6('0x17'));var licenseUtil=require(_0x73b6('0x18'));var db=require(_0x73b6('0x19'))['db'];function respondWithStatusCode(_0x31e001,_0x1f8354){_0x1f8354=_0x1f8354||0xcc;return function(_0x421559){if(_0x421559){return _0x31e001[_0x73b6('0x1a')](_0x1f8354);}return _0x31e001[_0x73b6('0x1b')](_0x1f8354)['end']();};}function respondWithResult(_0x4ec79f,_0x13e9b7){_0x13e9b7=_0x13e9b7||0xc8;return function(_0x3b7550){if(_0x3b7550){return _0x4ec79f[_0x73b6('0x1b')](_0x13e9b7)[_0x73b6('0x1c')](_0x3b7550);}};}function respondWithFilteredResult(_0x58f31c,_0x236fce){return function(_0x5eee47){if(_0x5eee47){var _0x23e899=typeof _0x236fce[_0x73b6('0x1d')]===_0x73b6('0x1e')&&typeof _0x236fce[_0x73b6('0x1f')]===_0x73b6('0x1e');var _0x4dc9ea=_0x5eee47['count'];var _0x3cacf1=_0x23e899?0x0:_0x236fce[_0x73b6('0x1d')];var _0xa84175=_0x23e899?_0x5eee47[_0x73b6('0x20')]:_0x236fce[_0x73b6('0x1d')]+_0x236fce[_0x73b6('0x1f')];var _0x515041;if(_0xa84175>=_0x4dc9ea){_0xa84175=_0x4dc9ea;_0x515041=0xc8;}else{_0x515041=0xce;}_0x58f31c[_0x73b6('0x1b')](_0x515041);return _0x58f31c[_0x73b6('0x21')]('Content-Range',_0x3cacf1+'-'+_0xa84175+'/'+_0x4dc9ea)[_0x73b6('0x1c')](_0x5eee47);}return null;};}function patchUpdates(_0x121df1){return function(_0x1b0fa4){try{jsonpatch[_0x73b6('0x22')](_0x1b0fa4,_0x121df1,!![]);}catch(_0x3f8407){return BPromise[_0x73b6('0x23')](_0x3f8407);}return _0x1b0fa4['save']();};}function saveUpdates(_0x4b0e2d,_0x43832f){return function(_0x10f3de){if(_0x10f3de){return _0x10f3de[_0x73b6('0x24')](_0x4b0e2d)['then'](function(_0x2fe412){return _0x2fe412;});}return null;};}function removeEntity(_0x9ced8c,_0x36eb66){return function(_0x137d86){if(_0x137d86){return _0x137d86['destroy']()[_0x73b6('0x25')](function(){_0x9ced8c['status'](0xcc)[_0x73b6('0x26')]();});}};}function handleEntityNotFound(_0x5583bf,_0x33a6ac){return function(_0x1543c2){if(!_0x1543c2){_0x5583bf[_0x73b6('0x1a')](0x194);}return _0x1543c2;};}function handleError(_0x2e2573,_0x242b53){_0x242b53=_0x242b53||0x1f4;return function(_0x5aac63){logger[_0x73b6('0x27')](_0x5aac63[_0x73b6('0x28')]);if(_0x5aac63[_0x73b6('0x29')]){delete _0x5aac63[_0x73b6('0x29')];}_0x2e2573[_0x73b6('0x1b')](_0x242b53)[_0x73b6('0x2a')](_0x5aac63);};}exports[_0x73b6('0x2b')]=function(_0x4e748f,_0x397d34){var _0x29d2f4={},_0x43e065={},_0x12d65c={'count':0x0,'rows':[]};var _0x377573=_['map'](db[_0x73b6('0x2c')][_0x73b6('0x2d')],function(_0x769ed0){return{'name':_0x769ed0[_0x73b6('0x2e')],'type':_0x769ed0[_0x73b6('0x2f')][_0x73b6('0x30')]};});_0x43e065['model']=_[_0x73b6('0x31')](_0x377573,_0x73b6('0x29'));_0x43e065[_0x73b6('0x32')]=_['keys'](_0x4e748f[_0x73b6('0x32')]);_0x43e065[_0x73b6('0x33')]=_[_0x73b6('0x34')](_0x43e065[_0x73b6('0x35')],_0x43e065[_0x73b6('0x32')]);_0x29d2f4[_0x73b6('0x36')]=_[_0x73b6('0x34')](_0x43e065['model'],qs[_0x73b6('0x37')](_0x4e748f['query'][_0x73b6('0x37')]));_0x29d2f4['attributes']=_0x29d2f4['attributes']['length']?_0x29d2f4['attributes']:_0x43e065[_0x73b6('0x35')];if(!_0x4e748f['query'][_0x73b6('0x38')](_0x73b6('0x39'))){_0x29d2f4[_0x73b6('0x1f')]=qs[_0x73b6('0x1f')](_0x4e748f[_0x73b6('0x32')][_0x73b6('0x1f')]);_0x29d2f4[_0x73b6('0x1d')]=qs['offset'](_0x4e748f['query'][_0x73b6('0x1d')]);}_0x29d2f4[_0x73b6('0x3a')]=qs[_0x73b6('0x3b')](_0x4e748f[_0x73b6('0x32')][_0x73b6('0x3b')]);_0x29d2f4[_0x73b6('0x3c')]=qs[_0x73b6('0x33')](_[_0x73b6('0x3d')](_0x4e748f[_0x73b6('0x32')],_0x43e065[_0x73b6('0x33')]),_0x377573);if(_0x4e748f['query']['filter']){_0x29d2f4['where']=_[_0x73b6('0x3e')](_0x29d2f4[_0x73b6('0x3c')],{'$or':_['map'](_0x377573,function(_0x42c359){if(_0x42c359[_0x73b6('0x2f')]!==_0x73b6('0x3f')){var _0x54d3cc={};_0x54d3cc[_0x42c359[_0x73b6('0x29')]]={'$like':'%'+_0x4e748f[_0x73b6('0x32')][_0x73b6('0x40')]+'%'};return _0x54d3cc;}})});}_0x29d2f4=_['merge']({},_0x29d2f4,_0x4e748f[_0x73b6('0x41')]);var _0x1b87f8={'where':_0x29d2f4[_0x73b6('0x3c')]};return db[_0x73b6('0x2c')][_0x73b6('0x20')](_0x1b87f8)['then'](function(_0x58bdeb){_0x12d65c['count']=_0x58bdeb;if(_0x4e748f[_0x73b6('0x32')]['includeAll']){_0x29d2f4[_0x73b6('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x29d2f4);})['then'](function(_0x2408c1){_0x12d65c[_0x73b6('0x43')]=_0x2408c1;return _0x12d65c;})[_0x73b6('0x25')](respondWithFilteredResult(_0x397d34,_0x29d2f4))['catch'](handleError(_0x397d34,null));};exports[_0x73b6('0x44')]=function(_0x3f2e4b,_0x487d21){var _0x427b34={'raw':!![],'where':{'id':_0x3f2e4b[_0x73b6('0x45')]['id']}},_0x34fc2a={};_0x34fc2a[_0x73b6('0x35')]=_[_0x73b6('0x46')](db[_0x73b6('0x2c')][_0x73b6('0x2d')]);_0x34fc2a[_0x73b6('0x32')]=_[_0x73b6('0x46')](_0x3f2e4b[_0x73b6('0x32')]);_0x34fc2a['filters']=_[_0x73b6('0x34')](_0x34fc2a[_0x73b6('0x35')],_0x34fc2a['query']);_0x427b34['attributes']=_[_0x73b6('0x34')](_0x34fc2a['model'],qs[_0x73b6('0x37')](_0x3f2e4b[_0x73b6('0x32')]['fields']));_0x427b34[_0x73b6('0x36')]=_0x427b34['attributes']['length']?_0x427b34[_0x73b6('0x36')]:_0x34fc2a[_0x73b6('0x35')];if(_0x3f2e4b[_0x73b6('0x32')][_0x73b6('0x47')]){_0x427b34['include']=[{'all':!![]}];}_0x427b34=_[_0x73b6('0x3e')]({},_0x427b34,_0x3f2e4b[_0x73b6('0x41')]);return db[_0x73b6('0x2c')][_0x73b6('0x48')](_0x427b34)['then'](handleEntityNotFound(_0x487d21,null))['then'](respondWithResult(_0x487d21,null))[_0x73b6('0x49')](handleError(_0x487d21,null));};exports[_0x73b6('0x4a')]=function(_0x172f12,_0x1ea9c8){return db[_0x73b6('0x2c')][_0x73b6('0x4a')](_0x172f12[_0x73b6('0x4b')],{})[_0x73b6('0x25')](respondWithResult(_0x1ea9c8,0xc9))[_0x73b6('0x49')](handleError(_0x1ea9c8,null));};exports[_0x73b6('0x24')]=function(_0x1c1aff,_0x4609e2){if(_0x1c1aff[_0x73b6('0x4b')]['id']){delete _0x1c1aff['body']['id'];}return db[_0x73b6('0x2c')][_0x73b6('0x48')]({'where':{'id':_0x1c1aff[_0x73b6('0x45')]['id']}})[_0x73b6('0x25')](handleEntityNotFound(_0x4609e2,null))['then'](saveUpdates(_0x1c1aff[_0x73b6('0x4b')],null))[_0x73b6('0x25')](respondWithResult(_0x4609e2,null))[_0x73b6('0x49')](handleError(_0x4609e2,null));};exports['destroy']=function(_0x567552,_0x19285b){return db[_0x73b6('0x2c')][_0x73b6('0x48')]({'where':{'id':_0x567552[_0x73b6('0x45')]['id']}})[_0x73b6('0x25')](handleEntityNotFound(_0x19285b,null))[_0x73b6('0x25')](removeEntity(_0x19285b,null))['catch'](handleError(_0x19285b,null));};exports['describe']=function(_0x5a395c,_0x1cd9aa){return db[_0x73b6('0x2c')]['describe']()[_0x73b6('0x25')](respondWithResult(_0x1cd9aa,null))['catch'](handleError(_0x1cd9aa,null));}; \ No newline at end of file +var _0xc411=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','filters','where','VIRTUAL','filter','merge','options','includeAll','catch','show','params','include','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc411,0x8e));var _0x1c41=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc411[_0x313c96];return _0x522f53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c41('0x0'));var zipdir=require(_0x1c41('0x1'));var jsonpatch=require(_0x1c41('0x2'));var rp=require('request-promise');var moment=require(_0x1c41('0x3'));var BPromise=require(_0x1c41('0x4'));var Mustache=require(_0x1c41('0x5'));var util=require('util');var path=require(_0x1c41('0x6'));var sox=require(_0x1c41('0x7'));var csv=require(_0x1c41('0x8'));var ejs=require(_0x1c41('0x9'));var fs=require('fs');var fs_extra=require(_0x1c41('0xa'));var _=require(_0x1c41('0xb'));var squel=require(_0x1c41('0xc'));var crypto=require(_0x1c41('0xd'));var jsforce=require(_0x1c41('0xe'));var deskjs=require(_0x1c41('0xf'));var toCsv=require(_0x1c41('0x8'));var querystring=require(_0x1c41('0x10'));var Papa=require(_0x1c41('0x11'));var Redis=require(_0x1c41('0x12'));var authService=require(_0x1c41('0x13'));var qs=require(_0x1c41('0x14'));var as=require(_0x1c41('0x15'));var hardwareService=require(_0x1c41('0x16'));var logger=require(_0x1c41('0x17'))(_0x1c41('0x18'));var utils=require(_0x1c41('0x19'));var config=require(_0x1c41('0x1a'));var licenseUtil=require(_0x1c41('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b382,_0x106741){_0x106741=_0x106741||0xcc;return function(_0xd09e95){if(_0xd09e95){return _0x13b382[_0x1c41('0x1c')](_0x106741);}return _0x13b382[_0x1c41('0x1d')](_0x106741)['end']();};}function respondWithResult(_0x431f3b,_0x53a5a1){_0x53a5a1=_0x53a5a1||0xc8;return function(_0x2aa8ac){if(_0x2aa8ac){return _0x431f3b[_0x1c41('0x1d')](_0x53a5a1)[_0x1c41('0x1e')](_0x2aa8ac);}};}function respondWithFilteredResult(_0x1867f9,_0x54550b){return function(_0x2e2b0f){if(_0x2e2b0f){var _0x34897a=typeof _0x54550b[_0x1c41('0x1f')]===_0x1c41('0x20')&&typeof _0x54550b[_0x1c41('0x21')]===_0x1c41('0x20');var _0x35f97c=_0x2e2b0f['count'];var _0xcd142=_0x34897a?0x0:_0x54550b[_0x1c41('0x1f')];var _0x2f9348=_0x34897a?_0x2e2b0f[_0x1c41('0x22')]:_0x54550b[_0x1c41('0x1f')]+_0x54550b[_0x1c41('0x21')];var _0x27ead1;if(_0x2f9348>=_0x35f97c){_0x2f9348=_0x35f97c;_0x27ead1=0xc8;}else{_0x27ead1=0xce;}_0x1867f9['status'](_0x27ead1);return _0x1867f9['set'](_0x1c41('0x23'),_0xcd142+'-'+_0x2f9348+'/'+_0x35f97c)[_0x1c41('0x1e')](_0x2e2b0f);}return null;};}function patchUpdates(_0x53dea4){return function(_0x21733b){try{jsonpatch[_0x1c41('0x24')](_0x21733b,_0x53dea4,!![]);}catch(_0x48e47a){return BPromise[_0x1c41('0x25')](_0x48e47a);}return _0x21733b[_0x1c41('0x26')]();};}function saveUpdates(_0x205217,_0x4f8f23){return function(_0x4df2f5){if(_0x4df2f5){return _0x4df2f5['update'](_0x205217)['then'](function(_0x128571){return _0x128571;});}return null;};}function removeEntity(_0xbd6f3f,_0x3d4583){return function(_0xdb135d){if(_0xdb135d){return _0xdb135d['destroy']()[_0x1c41('0x27')](function(){_0xbd6f3f[_0x1c41('0x1d')](0xcc)[_0x1c41('0x28')]();});}};}function handleEntityNotFound(_0x564fad,_0xda88b){return function(_0xeb509){if(!_0xeb509){_0x564fad[_0x1c41('0x1c')](0x194);}return _0xeb509;};}function handleError(_0x3c423a,_0x1c701d){_0x1c701d=_0x1c701d||0x1f4;return function(_0xc287bb){logger[_0x1c41('0x29')](_0xc287bb[_0x1c41('0x2a')]);if(_0xc287bb[_0x1c41('0x2b')]){delete _0xc287bb[_0x1c41('0x2b')];}_0x3c423a[_0x1c41('0x1d')](_0x1c701d)[_0x1c41('0x2c')](_0xc287bb);};}exports[_0x1c41('0x2d')]=function(_0x1276c0,_0x3f95bd){var _0x3ba1d5={},_0x145428={},_0x239c76={'count':0x0,'rows':[]};var _0x5718cd=_[_0x1c41('0x2e')](db[_0x1c41('0x2f')][_0x1c41('0x30')],function(_0x15f76d){return{'name':_0x15f76d[_0x1c41('0x31')],'type':_0x15f76d[_0x1c41('0x32')][_0x1c41('0x33')]};});_0x145428['model']=_['map'](_0x5718cd,_0x1c41('0x2b'));_0x145428['query']=_[_0x1c41('0x34')](_0x1276c0[_0x1c41('0x35')]);_0x145428['filters']=_['intersection'](_0x145428[_0x1c41('0x36')],_0x145428[_0x1c41('0x35')]);_0x3ba1d5[_0x1c41('0x37')]=_[_0x1c41('0x38')](_0x145428[_0x1c41('0x36')],qs[_0x1c41('0x39')](_0x1276c0[_0x1c41('0x35')]['fields']));_0x3ba1d5[_0x1c41('0x37')]=_0x3ba1d5[_0x1c41('0x37')][_0x1c41('0x3a')]?_0x3ba1d5[_0x1c41('0x37')]:_0x145428[_0x1c41('0x36')];if(!_0x1276c0['query'][_0x1c41('0x3b')]('nolimit')){_0x3ba1d5[_0x1c41('0x21')]=qs['limit'](_0x1276c0['query'][_0x1c41('0x21')]);_0x3ba1d5['offset']=qs[_0x1c41('0x1f')](_0x1276c0[_0x1c41('0x35')]['offset']);}_0x3ba1d5['order']=qs['sort'](_0x1276c0[_0x1c41('0x35')]['sort']);_0x3ba1d5['where']=qs[_0x1c41('0x3c')](_['pick'](_0x1276c0[_0x1c41('0x35')],_0x145428[_0x1c41('0x3c')]),_0x5718cd);if(_0x1276c0[_0x1c41('0x35')]['filter']){_0x3ba1d5[_0x1c41('0x3d')]=_['merge'](_0x3ba1d5['where'],{'$or':_[_0x1c41('0x2e')](_0x5718cd,function(_0x125186){if(_0x125186[_0x1c41('0x32')]!==_0x1c41('0x3e')){var _0x13e6d3={};_0x13e6d3[_0x125186[_0x1c41('0x2b')]]={'$like':'%'+_0x1276c0[_0x1c41('0x35')][_0x1c41('0x3f')]+'%'};return _0x13e6d3;}})});}_0x3ba1d5=_[_0x1c41('0x40')]({},_0x3ba1d5,_0x1276c0[_0x1c41('0x41')]);var _0x7adafa={'where':_0x3ba1d5[_0x1c41('0x3d')]};return db[_0x1c41('0x2f')][_0x1c41('0x22')](_0x7adafa)[_0x1c41('0x27')](function(_0x3a0e2b){_0x239c76[_0x1c41('0x22')]=_0x3a0e2b;if(_0x1276c0['query'][_0x1c41('0x42')]){_0x3ba1d5['include']=[{'all':!![]}];}return db[_0x1c41('0x2f')]['findAll'](_0x3ba1d5);})['then'](function(_0x6b654b){_0x239c76['rows']=_0x6b654b;return _0x239c76;})['then'](respondWithFilteredResult(_0x3f95bd,_0x3ba1d5))[_0x1c41('0x43')](handleError(_0x3f95bd,null));};exports[_0x1c41('0x44')]=function(_0x5468d3,_0x44093a){var _0x2e0846={'raw':!![],'where':{'id':_0x5468d3[_0x1c41('0x45')]['id']}},_0x2d07c2={};_0x2d07c2['model']=_['keys'](db[_0x1c41('0x2f')][_0x1c41('0x30')]);_0x2d07c2[_0x1c41('0x35')]=_[_0x1c41('0x34')](_0x5468d3[_0x1c41('0x35')]);_0x2d07c2[_0x1c41('0x3c')]=_[_0x1c41('0x38')](_0x2d07c2[_0x1c41('0x36')],_0x2d07c2['query']);_0x2e0846[_0x1c41('0x37')]=_[_0x1c41('0x38')](_0x2d07c2[_0x1c41('0x36')],qs[_0x1c41('0x39')](_0x5468d3[_0x1c41('0x35')][_0x1c41('0x39')]));_0x2e0846['attributes']=_0x2e0846[_0x1c41('0x37')][_0x1c41('0x3a')]?_0x2e0846['attributes']:_0x2d07c2[_0x1c41('0x36')];if(_0x5468d3[_0x1c41('0x35')][_0x1c41('0x42')]){_0x2e0846[_0x1c41('0x46')]=[{'all':!![]}];}_0x2e0846=_['merge']({},_0x2e0846,_0x5468d3[_0x1c41('0x41')]);return db[_0x1c41('0x2f')]['find'](_0x2e0846)[_0x1c41('0x27')](handleEntityNotFound(_0x44093a,null))[_0x1c41('0x27')](respondWithResult(_0x44093a,null))['catch'](handleError(_0x44093a,null));};exports[_0x1c41('0x47')]=function(_0x3369a9,_0x5ce845){return db[_0x1c41('0x2f')][_0x1c41('0x47')](_0x3369a9[_0x1c41('0x48')],{})[_0x1c41('0x27')](respondWithResult(_0x5ce845,0xc9))['catch'](handleError(_0x5ce845,null));};exports[_0x1c41('0x49')]=function(_0x58784b,_0x10b2d8){if(_0x58784b[_0x1c41('0x48')]['id']){delete _0x58784b['body']['id'];}return db['VoiceTransferReport'][_0x1c41('0x4a')]({'where':{'id':_0x58784b[_0x1c41('0x45')]['id']}})[_0x1c41('0x27')](handleEntityNotFound(_0x10b2d8,null))[_0x1c41('0x27')](saveUpdates(_0x58784b[_0x1c41('0x48')],null))[_0x1c41('0x27')](respondWithResult(_0x10b2d8,null))['catch'](handleError(_0x10b2d8,null));};exports['destroy']=function(_0x2be878,_0x5c44d1){return db[_0x1c41('0x2f')][_0x1c41('0x4a')]({'where':{'id':_0x2be878['params']['id']}})[_0x1c41('0x27')](handleEntityNotFound(_0x5c44d1,null))[_0x1c41('0x27')](removeEntity(_0x5c44d1,null))['catch'](handleError(_0x5c44d1,null));};exports[_0x1c41('0x4b')]=function(_0x3ff60a,_0x54de69){return db[_0x1c41('0x2f')][_0x1c41('0x4b')]()[_0x1c41('0x27')](respondWithResult(_0x54de69,null))[_0x1c41('0x43')](handleError(_0x54de69,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0587966..1048617 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 _0x45d9=['define','VoiceTransferReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x39a130,_0x2dfd82){var _0x58c436=function(_0x36cf36){while(--_0x36cf36){_0x39a130['push'](_0x39a130['shift']());}};_0x58c436(++_0x2dfd82);}(_0x45d9,0x1ca));var _0x945d=function(_0x2d93b7,_0xdcb506){_0x2d93b7=_0x2d93b7-0x0;var _0x2ba63e=_0x45d9[_0x2d93b7];return _0x2ba63e;};'use strict';var _=require(_0x945d('0x0'));var util=require(_0x945d('0x1'));var logger=require(_0x945d('0x2'))('api');var moment=require(_0x945d('0x3'));var BPromise=require(_0x945d('0x4'));var rp=require(_0x945d('0x5'));var fs=require('fs');var path=require(_0x945d('0x6'));var rimraf=require(_0x945d('0x7'));var config=require(_0x945d('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x945d('0x9')]=function(_0x19c7c8,_0x45c365){return _0x19c7c8[_0x945d('0xa')](_0x945d('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6cf=['define','VoiceTransferReport','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x391c68,_0x40bfbd){var _0x84409e=function(_0x4ffcc6){while(--_0x4ffcc6){_0x391c68['push'](_0x391c68['shift']());}};_0x84409e(++_0x40bfbd);}(_0xe6cf,0x1c5));var _0xfe6c=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xe6cf[_0x375325];return _0x228f57;};'use strict';var _=require('lodash');var util=require(_0xfe6c('0x0'));var logger=require('../../config/logger')(_0xfe6c('0x1'));var moment=require(_0xfe6c('0x2'));var BPromise=require(_0xfe6c('0x3'));var rp=require(_0xfe6c('0x4'));var fs=require('fs');var path=require(_0xfe6c('0x5'));var rimraf=require(_0xfe6c('0x6'));var config=require(_0xfe6c('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xfe6c('0x8')]=function(_0x253cff,_0x8120ab){return _0x253cff[_0xfe6c('0x9')](_0xfe6c('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 3ec8f32..71e8cd6 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 _0x06de=['body','options','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06de,0x12b));var _0xe06d=function(_0xb1c5d5,_0x3a2038){_0xb1c5d5=_0xb1c5d5-0x0;var _0x3766dc=_0x06de[_0xb1c5d5];return _0x3766dc;};'use strict';var _=require(_0xe06d('0x0'));var util=require(_0xe06d('0x1'));var moment=require('moment');var BPromise=require(_0xe06d('0x2'));var rs=require(_0xe06d('0x3'));var fs=require('fs');var Redis=require(_0xe06d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe06d('0x5'));var logger=require('../../config/logger')(_0xe06d('0x6'));var config=require('../../config/environment');var jayson=require(_0xe06d('0x7'));var client=jayson[_0xe06d('0x8')][_0xe06d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xefdb35,_0x2d7dc6,_0x11d2bb){return new BPromise(function(_0x2945c0,_0x362cb7){return client[_0xe06d('0xa')](_0xefdb35,_0x11d2bb)[_0xe06d('0xb')](function(_0x5a66d5){logger[_0xe06d('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x2d7dc6,_0xe06d('0xd'));logger[_0xe06d('0xe')](_0xe06d('0xf'),_0x2d7dc6,_0xe06d('0xd'),JSON[_0xe06d('0x10')](_0x5a66d5));if(_0x5a66d5[_0xe06d('0x11')]){if(_0x5a66d5['error'][_0xe06d('0x12')]===0x1f4){logger['error'](_0xe06d('0x13'),_0x2d7dc6,_0x5a66d5['error'][_0xe06d('0x14')]);return _0x362cb7(_0x5a66d5[_0xe06d('0x11')][_0xe06d('0x14')]);}logger[_0xe06d('0x11')](_0xe06d('0x13'),_0x2d7dc6,_0x5a66d5[_0xe06d('0x11')]['message']);return _0x2945c0(_0x5a66d5[_0xe06d('0x11')][_0xe06d('0x14')]);}else{logger[_0xe06d('0xc')](_0xe06d('0x13'),_0x2d7dc6,_0xe06d('0xd'));_0x2945c0(_0x5a66d5[_0xe06d('0x15')][_0xe06d('0x14')]);}})['catch'](function(_0x4aa51d){logger[_0xe06d('0x11')](_0xe06d('0x13'),_0x2d7dc6,_0x4aa51d);_0x362cb7(_0x4aa51d);});});}exports[_0xe06d('0x16')]=function(_0x3c78cb){var _0x489954=this;return new Promise(function(_0x504ef4,_0x29634a){return db[_0xe06d('0x17')][_0xe06d('0x18')](_0x3c78cb[_0xe06d('0x19')],{'raw':_0x3c78cb[_0xe06d('0x1a')]?_0x3c78cb['options']['raw']===undefined?!![]:![]:!![]})[_0xe06d('0xb')](function(_0x64a8be){logger[_0xe06d('0xc')](_0xe06d('0x16'),_0x3c78cb);logger[_0xe06d('0xe')](_0xe06d('0x16'),_0x3c78cb,JSON['stringify'](_0x64a8be));_0x504ef4(_0x64a8be);})['catch'](function(_0x579e8b){logger[_0xe06d('0x11')]('CreateVoiceTransferReport',_0x579e8b['message'],_0x3c78cb);_0x29634a(_0x489954['error'](0x1f4,_0x579e8b['message']));});});}; \ No newline at end of file +var _0x4d09=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceTransferReport','body'];(function(_0x142a07,_0x251e3c){var _0x101b6d=function(_0xcc9433){while(--_0xcc9433){_0x142a07['push'](_0x142a07['shift']());}};_0x101b6d(++_0x251e3c);}(_0x4d09,0x17b));var _0x94d0=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x4d09[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x94d0('0x0'));var util=require(_0x94d0('0x1'));var moment=require(_0x94d0('0x2'));var BPromise=require(_0x94d0('0x3'));var rs=require(_0x94d0('0x4'));var fs=require('fs');var Redis=require(_0x94d0('0x5'));var db=require(_0x94d0('0x6'))['db'];var utils=require(_0x94d0('0x7'));var logger=require(_0x94d0('0x8'))(_0x94d0('0x9'));var config=require(_0x94d0('0xa'));var jayson=require(_0x94d0('0xb'));var client=jayson[_0x94d0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f562,_0x4da53d,_0x982c27){return new BPromise(function(_0x3a1fa0,_0x1d1968){return client[_0x94d0('0xd')](_0x10f562,_0x982c27)[_0x94d0('0xe')](function(_0x23df45){logger[_0x94d0('0xf')](_0x94d0('0x10'),_0x4da53d,'request\x20sent');logger[_0x94d0('0x11')](_0x94d0('0x12'),_0x4da53d,_0x94d0('0x13'),JSON[_0x94d0('0x14')](_0x23df45));if(_0x23df45[_0x94d0('0x15')]){if(_0x23df45['error'][_0x94d0('0x16')]===0x1f4){logger[_0x94d0('0x15')](_0x94d0('0x10'),_0x4da53d,_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);return _0x1d1968(_0x23df45['error'][_0x94d0('0x17')]);}logger[_0x94d0('0x15')](_0x94d0('0x10'),_0x4da53d,_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);return _0x3a1fa0(_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);}else{logger['info'](_0x94d0('0x10'),_0x4da53d,_0x94d0('0x13'));_0x3a1fa0(_0x23df45['result'][_0x94d0('0x17')]);}})[_0x94d0('0x18')](function(_0x526e1b){logger['error'](_0x94d0('0x10'),_0x4da53d,_0x526e1b);_0x1d1968(_0x526e1b);});});}exports[_0x94d0('0x19')]=function(_0x4e080c){var _0x5166f5=this;return new Promise(function(_0x39d668,_0x4a4e8e){return db['VoiceTransferReport']['create'](_0x4e080c[_0x94d0('0x1a')],{'raw':_0x4e080c['options']?_0x4e080c[_0x94d0('0x1b')][_0x94d0('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x890684){logger['info'](_0x94d0('0x19'),_0x4e080c);logger[_0x94d0('0x11')](_0x94d0('0x19'),_0x4e080c,JSON[_0x94d0('0x14')](_0x890684));_0x39d668(_0x890684);})[_0x94d0('0x18')](function(_0xf81a06){logger[_0x94d0('0x15')](_0x94d0('0x19'),_0xf81a06[_0x94d0('0x17')],_0x4e080c);_0x4a4e8e(_0x5166f5[_0x94d0('0x15')](0x1f4,_0xf81a06[_0x94d0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 46dbefb..d7a7d90 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 _0x86c8=['canUpdate','originate','post','/hangup','hangup','/answer','isAuthenticated','answer','/hold','hold','/unhold','unhold','calls','express','Router','./webbar.controller'];(function(_0x1f90fc,_0x3a663d){var _0x4b6e1a=function(_0x4a9fbe){while(--_0x4a9fbe){_0x1f90fc['push'](_0x1f90fc['shift']());}};_0x4b6e1a(++_0x3a663d);}(_0x86c8,0x9d));var _0x886c=function(_0x302cb8,_0xd93386){_0x302cb8=_0x302cb8-0x0;var _0xf6f398=_0x86c8[_0x302cb8];return _0xf6f398;};'use strict';var express=require(_0x886c('0x0'));var router=express[_0x886c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x886c('0x2'));router['post']('/originate',auth['isAuthenticated'](),auth[_0x886c('0x3')](),controller[_0x886c('0x4')]);router[_0x886c('0x5')](_0x886c('0x6'),auth['isAuthenticated'](),auth[_0x886c('0x3')](),controller[_0x886c('0x7')]);router['post'](_0x886c('0x8'),auth[_0x886c('0x9')](),auth['canUpdate'](),controller[_0x886c('0xa')]);router[_0x886c('0x5')](_0x886c('0xb'),auth['isAuthenticated'](),auth[_0x886c('0x3')](),controller[_0x886c('0xc')]);router['post'](_0x886c('0xd'),auth[_0x886c('0x9')](),auth[_0x886c('0x3')](),controller[_0x886c('0xe')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0x886c('0x3')](),controller[_0x886c('0xf')]);router[_0x886c('0x5')]('/transfer',auth[_0x886c('0x9')](),auth['canUpdate'](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0xd348=['isAuthenticated','hangup','/answer','answer','/hold','unhold','/calls','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate'];(function(_0x496f8d,_0x266fb9){var _0x45f12d=function(_0x35465d){while(--_0x35465d){_0x496f8d['push'](_0x496f8d['shift']());}};_0x45f12d(++_0x266fb9);}(_0xd348,0x77));var _0x8d34=function(_0xa28331,_0x56764b){_0xa28331=_0xa28331-0x0;var _0x2bb8a4=_0xd348[_0xa28331];return _0x2bb8a4;};'use strict';var express=require(_0x8d34('0x0'));var router=express['Router']();var auth=require(_0x8d34('0x1'));var controller=require(_0x8d34('0x2'));router[_0x8d34('0x3')](_0x8d34('0x4'),auth['isAuthenticated'](),auth[_0x8d34('0x5')](),controller[_0x8d34('0x6')]);router[_0x8d34('0x3')]('/hangup',auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0x8')]);router[_0x8d34('0x3')](_0x8d34('0x9'),auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0xa')]);router[_0x8d34('0x3')](_0x8d34('0xb'),auth['isAuthenticated'](),auth[_0x8d34('0x5')](),controller['hold']);router['post']('/unhold',auth[_0x8d34('0x7')](),auth['canUpdate'](),controller[_0x8d34('0xc')]);router[_0x8d34('0x3')](_0x8d34('0xd'),auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0xe')]);router[_0x8d34('0x3')](_0x8d34('0xf'),auth[_0x8d34('0x7')](),auth['canUpdate'](),controller[_0x8d34('0x10')]);module[_0x8d34('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 14ece29..cbb0c6e 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61a5=['redis','defaults','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','status','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0x61a5,0xf0));var _0x561a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x61a5[_0x4f9b18];return _0x29f20c;};'use strict';var path=require(_0x561a('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x561a('0x1'))['db'];var config=require(_0x561a('0x2'));var util=require(_0x561a('0x3'));var BPromise=require(_0x561a('0x4'));var jayson=require(_0x561a('0x5'));var amiClient=jayson['client'][_0x561a('0x6')]({'port':0x232a});var logger=require(_0x561a('0x7'))('webbarapi');var Redis=require(_0x561a('0x8'));config[_0x561a('0x9')]=_[_0x561a('0xa')](config[_0x561a('0x9')],{'host':_0x561a('0xb'),'port':0x18eb});var io=require(_0x561a('0xc'))(new Redis(config[_0x561a('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x561a('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0x11')]},'transferNumber':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]}});function emit(_0x28ad8b,_0x3d91be,_0x14f141){logger[_0x561a('0x13')](_0x28ad8b,_0x3d91be,JSON[_0x561a('0x14')](_0x14f141));io['to'](_0x28ad8b)[_0x561a('0x15')](_0x3d91be,_0x14f141);}function handleError(_0x48df6a){return function(_0x43c5aa){console[_0x561a('0x16')]('handleError:',_0x43c5aa,_0x43c5aa instanceof RangeError);logger[_0x561a('0x17')](_0x43c5aa[_0x561a('0x18')]);if(_0x43c5aa instanceof RangeError){if(_0x43c5aa['name']){delete _0x43c5aa[_0x561a('0x19')];}_0x48df6a['status'](0x194)['send'](_0x43c5aa);}else{if(_0x43c5aa[_0x561a('0x19')]){delete _0x43c5aa[_0x561a('0x19')];}_0x48df6a['status'](0x1f4)[_0x561a('0x1a')](_0x43c5aa);}};}function checkError(){return function(_0x88b2b5){if(!_0x88b2b5){throw new RangeError(_0x561a('0x1b'));}return _0x88b2b5;};}function respondWithRpcPromise(_0x3cf6c8,_0x345941){return new BPromise(function(_0x1bb8df,_0x4f9c3a){var _0x3e5509=amiClient;return _0x3e5509[_0x561a('0x1c')](_0x3cf6c8,_0x345941)[_0x561a('0x1d')](function(_0x527207){if(_0x527207['error']){if(_0x527207[_0x561a('0x17')][_0x561a('0x1e')]===0x1f4){return _0x4f9c3a(_0x527207[_0x561a('0x17')][_0x561a('0x1f')]);}return _0x1bb8df(_0x527207[_0x561a('0x17')][_0x561a('0x1f')]);}else{_0x1bb8df(_0x527207[_0x561a('0x20')]);}})[_0x561a('0x21')](function(_0x5bf2fa){_0x4f9c3a(_0x5bf2fa);});});}function getAgent(_0x4c2752){return db[_0x561a('0x22')][_0x561a('0x23')]({'where':{'id':_0x4c2752,'role':_0x561a('0x24')}})[_0x561a('0x1d')](checkError());}function getAgentCheckSession(_0x5a0acd,_0x186862){return new BPromise(function(_0x3f0789,_0x44c851){var _0x23b489=respondWithRpcPromise(_0x561a('0x25'));var _0x47f93a=getAgent(_0x5a0acd);Promise[_0x561a('0x26')]([_0x23b489,_0x47f93a])[_0x561a('0x1d')](function(_0x4f0b23){var _0x401636=_0x4f0b23[0x0];var _0x276ae7=_0x4f0b23[0x1];var _0x58db23=_[_0x561a('0x27')](_0x401636['rows'],function(_0x54a47a){return _0x54a47a[_0x561a('0x28')]==_0x276ae7['id']&&_0x54a47a[_0x561a('0x29')]==_0x186862;});if(_0x58db23['length']==0x1){_0x3f0789(_0x276ae7);}else{_0x44c851(new RangeError(_0x561a('0x2a')+_0x186862+_0x561a('0x2b')));}});});}exports[_0x561a('0x2c')]=function(_0x278c7e,_0x169243){logger[_0x561a('0x13')](_0x561a('0x2d'),_0x278c7e[_0x561a('0x2e')]);var _0x506c2e=originateValidation[_0x561a('0x2f')](_0x278c7e[_0x561a('0x2e')]);if(_0x506c2e[_0x561a('0x30')]>0x0){return _0x169243[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x506c2e);}var _0x4ab97f=_0x278c7e[_0x561a('0x2e')][_0x561a('0x33')];var _0x2d0063=_0x278c7e[_0x561a('0x2e')]['callNumber'];var _0x9ea469=_0x278c7e[_0x561a('0x2e')][_0x561a('0x34')];var _0x48f470=_0x278c7e['body'][_0x561a('0x35')];return getAgent(_0x4ab97f)['then'](function(_0x5a45a4){logger['info'](_0x561a('0x36'),_0x5a45a4[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x5a45a4[_0x561a('0x19')]),_0x561a('0x39'),{'callNumber':_0x2d0063,'callerId':_0x9ea469,'callbackUrl':_0x48f470});return _0x169243['status'](0xc8)['json']({'error':![],'message':_0x561a('0x3a')});})[_0x561a('0x21')](handleError(_0x169243));};exports[_0x561a('0x3b')]=function(_0x4e7d95,_0x4d81f7){logger[_0x561a('0x13')](_0x561a('0x3c'),_0x4e7d95[_0x561a('0x2e')]);var _0x5865c7=hangupValidation[_0x561a('0x2f')](_0x4e7d95[_0x561a('0x2e')]);if(_0x5865c7[_0x561a('0x30')]>0x0){return _0x4d81f7[_0x561a('0x31')](0x190)['json'](_0x5865c7);}var _0xbd11c4=_0x4e7d95[_0x561a('0x2e')][_0x561a('0x33')];var _0x5c59dc=_0x4e7d95[_0x561a('0x2e')][_0x561a('0x29')];return getAgent(_0xbd11c4)[_0x561a('0x1d')](function(_0x16779d){logger[_0x561a('0x13')](_0x561a('0x36'),_0x16779d[_0x561a('0x19')]);emit(util['format'](_0x561a('0x38'),_0x16779d[_0x561a('0x19')]),_0x561a('0x3d'),{'sessionId':_0x5c59dc});return _0x4d81f7[_0x561a('0x31')](0xc8)[_0x561a('0x32')]({'error':![],'message':_0x561a('0x3e')});})['catch'](handleError(_0x4d81f7));};exports[_0x561a('0x3f')]=function(_0xd991f8,_0x3f0f44){logger[_0x561a('0x13')](_0x561a('0x40'),_0xd991f8[_0x561a('0x2e')]);var _0x293e11=answerValidation[_0x561a('0x2f')](_0xd991f8[_0x561a('0x2e')]);if(_0x293e11['length']>0x0){return _0x3f0f44[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x293e11);}var _0x5197b1=_0xd991f8[_0x561a('0x2e')]['userId'];var _0x141971=_0xd991f8[_0x561a('0x2e')][_0x561a('0x29')];return getAgent(_0x5197b1)[_0x561a('0x1d')](function(_0x93103b){logger['info'](_0x561a('0x36'),_0x93103b[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x93103b[_0x561a('0x19')]),_0x561a('0x41'),{'sessionId':_0x141971});return _0x3f0f44['status'](0xc8)['json']({'error':![],'message':_0x561a('0x42')});})['catch'](handleError(_0x3f0f44));};exports['hold']=function(_0x4d7a38,_0x5e9e37){logger['info'](_0x561a('0x43'),_0x4d7a38[_0x561a('0x2e')]);var _0x21858b=holdValidation['validate'](_0x4d7a38[_0x561a('0x2e')]);if(_0x21858b['length']>0x0){return _0x5e9e37['status'](0x190)[_0x561a('0x32')](_0x21858b);}var _0x13a2ad=_0x4d7a38[_0x561a('0x2e')]['userId'];var _0x3bfd1b=_0x4d7a38['body'][_0x561a('0x29')];return getAgent(_0x13a2ad)['then'](function(_0x1bd3df){logger[_0x561a('0x13')](_0x561a('0x36'),_0x1bd3df[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x1bd3df[_0x561a('0x19')]),_0x561a('0x44'),{'sessionId':_0x3bfd1b});return _0x5e9e37[_0x561a('0x31')](0xc8)['json']({'error':![],'message':_0x561a('0x45')});})[_0x561a('0x21')](handleError(_0x5e9e37));};exports[_0x561a('0x46')]=function(_0x48ed34,_0x14fe1b){logger[_0x561a('0x13')]('unhold\x20fired:',_0x48ed34[_0x561a('0x2e')]);var _0x99dc7f=unholdValidation[_0x561a('0x2f')](_0x48ed34['body']);if(_0x99dc7f[_0x561a('0x30')]>0x0){return _0x14fe1b[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x99dc7f);}var _0x2cd4e0=_0x48ed34[_0x561a('0x2e')][_0x561a('0x33')];var _0x3d9b63=_0x48ed34['body'][_0x561a('0x29')];return getAgent(_0x2cd4e0)[_0x561a('0x1d')](function(_0x2dc1a3){logger[_0x561a('0x13')](_0x561a('0x36'),_0x2dc1a3[_0x561a('0x19')]);emit(util[_0x561a('0x37')]('user:%s',_0x2dc1a3[_0x561a('0x19')]),_0x561a('0x47'),{'sessionId':_0x3d9b63});return _0x14fe1b[_0x561a('0x31')](0xc8)['json']({'error':![],'message':_0x561a('0x48')});})['catch'](handleError(_0x14fe1b));};exports[_0x561a('0x49')]=function(_0x3d03c5,_0x2e0351){logger[_0x561a('0x13')](_0x561a('0x4a'),_0x2e0351[_0x561a('0x2e')]);var _0x29d981=callsValidation['validate'](_0x3d03c5['body']);if(_0x29d981[_0x561a('0x30')]>0x0){return _0x2e0351[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x29d981);}var _0x2945c1=_0x3d03c5[_0x561a('0x2e')][_0x561a('0x33')];var _0x4d13c8=respondWithRpcPromise(_0x561a('0x25'));var _0x1b0ecf=getAgent(_0x2945c1);return Promise['all']([_0x4d13c8,_0x1b0ecf])[_0x561a('0x1d')](function(_0x574ee2){var _0x5194d5=_0x574ee2[0x0];var _0xc7447e=_0x574ee2[0x1];var _0x16daeb=_[_0x561a('0x27')](_0x5194d5[_0x561a('0x4b')],function(_0x4a714c){return _0x4a714c[_0x561a('0x28')]==_0xc7447e['id'];});return _0x2e0351['status'](0xc8)[_0x561a('0x32')]({'count':_0x16daeb[_0x561a('0x30')],'rows':_0x16daeb});})[_0x561a('0x21')](handleError(_0x2e0351));};exports['conference']=function(_0x4ec13c,_0x52074a){logger['info'](_0x561a('0x4c'),_0x4ec13c[_0x561a('0x2e')]);var _0x485b80=conferenceValidation[_0x561a('0x2f')](_0x4ec13c[_0x561a('0x2e')]);if(_0x485b80[_0x561a('0x30')]>0x0){return _0x52074a['status'](0x190)[_0x561a('0x32')](_0x485b80);}var _0xb046d8=_0x4ec13c[_0x561a('0x2e')][_0x561a('0x33')];return getAgent(_0xb046d8)[_0x561a('0x1d')](function(_0x849fe){logger[_0x561a('0x13')](_0x561a('0x36'),_0x849fe[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x849fe['name']),_0x561a('0x4d'));return _0x52074a[_0x561a('0x31')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x561a('0x21')](handleError(_0x52074a));};exports[_0x561a('0x4e')]=function(_0x565867,_0x40f22e){logger[_0x561a('0x13')](_0x561a('0x4f'),_0x565867[_0x561a('0x2e')]);var _0x30d2a7=transferValidation[_0x561a('0x2f')](_0x565867['body']);if(_0x30d2a7['length']>0x0){return _0x40f22e[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x30d2a7);}var _0x3c8b20=_0x565867[_0x561a('0x2e')][_0x561a('0x33')];var _0x1656b=_0x565867['body']['sessionId'];var _0x53a93a=_0x565867[_0x561a('0x2e')][_0x561a('0x50')];return getAgent(_0x3c8b20)[_0x561a('0x1d')](function(_0x57bffc){logger['info']('entityFound:',_0x57bffc['name']);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x57bffc['name']),_0x561a('0x51'),{'sessionId':_0x1656b,'transferNumber':_0x53a93a});return _0x40f22e['status'](0xc8)['json']({'error':![],'message':_0x561a('0x52')});})[_0x561a('0x21')](handleError(_0x40f22e));}; \ No newline at end of file +var _0xe644=['rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callerId','callbackUrl','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','format','user:%s','webbar:hangup','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','send','status','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter'];(function(_0x4559d6,_0x21ff92){var _0x3b77ae=function(_0x1ca65b){while(--_0x1ca65b){_0x4559d6['push'](_0x4559d6['shift']());}};_0x3b77ae(++_0x21ff92);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x4e64('0x0'));var fs=require('fs');var _=require(_0x4e64('0x1'));var db=require(_0x4e64('0x2'))['db'];var config=require(_0x4e64('0x3'));var util=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x4e64('0x6')][_0x4e64('0x7')]({'port':0x232a});var logger=require(_0x4e64('0x8'))(_0x4e64('0x9'));var Redis=require(_0x4e64('0xa'));config[_0x4e64('0xb')]=_['defaults'](config[_0x4e64('0xb')],{'host':_0x4e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x4e64('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4e64('0xe'),'required':[!![],_0x4e64('0xf')]},'callerId':{'type':_0x4e64('0xe')},'callbackUrl':{'type':_0x4e64('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x4e64('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x4e64('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4e64('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]}});function emit(_0x5b35b0,_0x3b885a,_0x3677f9){logger[_0x4e64('0x14')](_0x5b35b0,_0x3b885a,JSON[_0x4e64('0x15')](_0x3677f9));io['to'](_0x5b35b0)[_0x4e64('0x16')](_0x3b885a,_0x3677f9);}function handleError(_0x2a60ad){return function(_0x135ffb){console[_0x4e64('0x17')](_0x4e64('0x18'),_0x135ffb,_0x135ffb instanceof RangeError);logger[_0x4e64('0x19')](_0x135ffb['stack']);if(_0x135ffb instanceof RangeError){if(_0x135ffb[_0x4e64('0x1a')]){delete _0x135ffb[_0x4e64('0x1a')];}_0x2a60ad['status'](0x194)[_0x4e64('0x1b')](_0x135ffb);}else{if(_0x135ffb['name']){delete _0x135ffb['name'];}_0x2a60ad[_0x4e64('0x1c')](0x1f4)[_0x4e64('0x1b')](_0x135ffb);}};}function checkError(){return function(_0x227d64){if(!_0x227d64){throw new RangeError('NotFound');}return _0x227d64;};}function respondWithRpcPromise(_0x4a5c6d,_0x4a9957){return new BPromise(function(_0x30e356,_0x336c53){var _0x2df7a0=amiClient;return _0x2df7a0['request'](_0x4a5c6d,_0x4a9957)[_0x4e64('0x1d')](function(_0x58ea85){if(_0x58ea85[_0x4e64('0x19')]){if(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1e')]===0x1f4){return _0x336c53(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1f')]);}return _0x30e356(_0x58ea85['error'][_0x4e64('0x1f')]);}else{_0x30e356(_0x58ea85[_0x4e64('0x20')]);}})[_0x4e64('0x21')](function(_0x4afb9c){_0x336c53(_0x4afb9c);});});}function getAgent(_0x786ba9){return db[_0x4e64('0x22')][_0x4e64('0x23')]({'where':{'id':_0x786ba9,'role':_0x4e64('0x24')}})[_0x4e64('0x1d')](checkError());}function getAgentCheckSession(_0x5f0d42,_0x3185ba){return new BPromise(function(_0x2b1f2b,_0x45953f){var _0x194f33=respondWithRpcPromise(_0x4e64('0x25'));var _0x1057d0=getAgent(_0x5f0d42);Promise[_0x4e64('0x26')]([_0x194f33,_0x1057d0])[_0x4e64('0x1d')](function(_0x5467a5){var _0x371035=_0x5467a5[0x0];var _0xb17ca7=_0x5467a5[0x1];var _0x45ef44=_[_0x4e64('0x27')](_0x371035[_0x4e64('0x28')],function(_0x3b1f16){return _0x3b1f16[_0x4e64('0x29')]==_0xb17ca7['id']&&_0x3b1f16['sessionId']==_0x3185ba;});if(_0x45ef44[_0x4e64('0x2a')]==0x1){_0x2b1f2b(_0xb17ca7);}else{_0x45953f(new RangeError(_0x4e64('0x2b')+_0x3185ba+_0x4e64('0x2c')));}});});}exports[_0x4e64('0x2d')]=function(_0x3d8042,_0x3d6cec){logger[_0x4e64('0x14')]('originate\x20fired:',_0x3d8042[_0x4e64('0x2e')]);var _0x317c07=originateValidation[_0x4e64('0xd')](_0x3d8042['body']);if(_0x317c07[_0x4e64('0x2a')]>0x0){return _0x3d6cec['status'](0x190)[_0x4e64('0x2f')](_0x317c07);}var _0x37cde0=_0x3d8042['body']['userId'];var _0x5417ad=_0x3d8042[_0x4e64('0x2e')]['callNumber'];var _0x2c2397=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x30')];var _0x18ca6c=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x31')];return getAgent(_0x37cde0)[_0x4e64('0x1d')](function(_0x50b8d5){logger[_0x4e64('0x14')]('entityFound:',_0x50b8d5[_0x4e64('0x1a')]);emit(util['format']('user:%s',_0x50b8d5['name']),_0x4e64('0x32'),{'callNumber':_0x5417ad,'callerId':_0x2c2397,'callbackUrl':_0x18ca6c});return _0x3d6cec['status'](0xc8)['json']({'error':![],'message':_0x4e64('0x33')});})[_0x4e64('0x21')](handleError(_0x3d6cec));};exports[_0x4e64('0x34')]=function(_0x189769,_0x1757a2){logger[_0x4e64('0x14')](_0x4e64('0x35'),_0x189769['body']);var _0x5a03a8=hangupValidation['validate'](_0x189769[_0x4e64('0x2e')]);if(_0x5a03a8[_0x4e64('0x2a')]>0x0){return _0x1757a2[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x5a03a8);}var _0x5bf847=_0x189769[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x11c373=_0x189769[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x5bf847)['then'](function(_0x4faf59){logger[_0x4e64('0x14')]('entityFound:',_0x4faf59[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x4faf59[_0x4e64('0x1a')]),_0x4e64('0x3a'),{'sessionId':_0x11c373});return _0x1757a2[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x4e64('0x21')](handleError(_0x1757a2));};exports[_0x4e64('0x3b')]=function(_0x460d66,_0x2e6684){logger[_0x4e64('0x14')](_0x4e64('0x3c'),_0x460d66[_0x4e64('0x2e')]);var _0x21e835=answerValidation['validate'](_0x460d66[_0x4e64('0x2e')]);if(_0x21e835[_0x4e64('0x2a')]>0x0){return _0x2e6684['status'](0x190)[_0x4e64('0x2f')](_0x21e835);}var _0x306b4d=_0x460d66['body'][_0x4e64('0x36')];var _0x1ddcf2=_0x460d66[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x306b4d)[_0x4e64('0x1d')](function(_0x5bc523){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x5bc523[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x5bc523[_0x4e64('0x1a')]),_0x4e64('0x3e'),{'sessionId':_0x1ddcf2});return _0x2e6684[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x4e64('0x21')](handleError(_0x2e6684));};exports[_0x4e64('0x3f')]=function(_0x3cf687,_0x5861d7){logger[_0x4e64('0x14')](_0x4e64('0x40'),_0x3cf687[_0x4e64('0x2e')]);var _0x19a71b=holdValidation[_0x4e64('0xd')](_0x3cf687['body']);if(_0x19a71b[_0x4e64('0x2a')]>0x0){return _0x5861d7['status'](0x190)[_0x4e64('0x2f')](_0x19a71b);}var _0x3a5fad=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x4cfac3=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x3a5fad)[_0x4e64('0x1d')](function(_0x38a885){logger[_0x4e64('0x14')]('entityFound:',_0x38a885[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x38a885[_0x4e64('0x1a')]),_0x4e64('0x41'),{'sessionId':_0x4cfac3});return _0x5861d7[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x42')});})[_0x4e64('0x21')](handleError(_0x5861d7));};exports[_0x4e64('0x43')]=function(_0x4c2948,_0x44946b){logger[_0x4e64('0x14')]('unhold\x20fired:',_0x4c2948[_0x4e64('0x2e')]);var _0x5cedc6=unholdValidation[_0x4e64('0xd')](_0x4c2948['body']);if(_0x5cedc6[_0x4e64('0x2a')]>0x0){return _0x44946b['status'](0x190)[_0x4e64('0x2f')](_0x5cedc6);}var _0xb2c2c7=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x33933a=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0xb2c2c7)['then'](function(_0x471be1){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x471be1['name']);emit(util['format'](_0x4e64('0x39'),_0x471be1['name']),_0x4e64('0x44'),{'sessionId':_0x33933a});return _0x44946b[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':_0x4e64('0x45')});})[_0x4e64('0x21')](handleError(_0x44946b));};exports['calls']=function(_0x562f53,_0x339e39){logger[_0x4e64('0x14')](_0x4e64('0x46'),_0x339e39[_0x4e64('0x2e')]);var _0x3def87=callsValidation[_0x4e64('0xd')](_0x562f53[_0x4e64('0x2e')]);if(_0x3def87[_0x4e64('0x2a')]>0x0){return _0x339e39['status'](0x190)[_0x4e64('0x2f')](_0x3def87);}var _0x3251a3=_0x562f53[_0x4e64('0x2e')]['userId'];var _0xa277da=respondWithRpcPromise(_0x4e64('0x25'));var _0x502640=getAgent(_0x3251a3);return Promise[_0x4e64('0x26')]([_0xa277da,_0x502640])[_0x4e64('0x1d')](function(_0xb1ef5f){var _0x377da8=_0xb1ef5f[0x0];var _0x82dcde=_0xb1ef5f[0x1];var _0x10d2ac=_['filter'](_0x377da8[_0x4e64('0x28')],function(_0x12bf29){return _0x12bf29[_0x4e64('0x29')]==_0x82dcde['id'];});return _0x339e39['status'](0xc8)[_0x4e64('0x2f')]({'count':_0x10d2ac[_0x4e64('0x2a')],'rows':_0x10d2ac});})[_0x4e64('0x21')](handleError(_0x339e39));};exports[_0x4e64('0x47')]=function(_0x5d3789,_0x1914bf){logger[_0x4e64('0x14')]('conference\x20fired:',_0x5d3789[_0x4e64('0x2e')]);var _0xafc845=conferenceValidation[_0x4e64('0xd')](_0x5d3789[_0x4e64('0x2e')]);if(_0xafc845[_0x4e64('0x2a')]>0x0){return _0x1914bf[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0xafc845);}var _0x40873c=_0x5d3789['body'][_0x4e64('0x36')];return getAgent(_0x40873c)[_0x4e64('0x1d')](function(_0x489a34){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x489a34[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x489a34['name']),_0x4e64('0x48'));return _0x1914bf[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x49')});})[_0x4e64('0x21')](handleError(_0x1914bf));};exports[_0x4e64('0x4a')]=function(_0x44c368,_0xf9c4e0){logger[_0x4e64('0x14')]('transfer\x20fired:',_0x44c368[_0x4e64('0x2e')]);var _0x291fe8=transferValidation[_0x4e64('0xd')](_0x44c368['body']);if(_0x291fe8[_0x4e64('0x2a')]>0x0){return _0xf9c4e0[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x291fe8);}var _0x5ed23f=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x5761c9=_0x44c368['body']['sessionId'];var _0x3f2a81=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x4b')];return getAgent(_0x5ed23f)[_0x4e64('0x1d')](function(_0x27db3f){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x27db3f[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x27db3f[_0x4e64('0x1a')]),_0x4e64('0x4c'),{'sessionId':_0x5761c9,'transferNumber':_0x3f2a81});return _0xf9c4e0[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0xf9c4e0));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 2a0ac46..5e49ca2 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 _0xacf4=['./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x454947,_0x29bb46){var _0x178912=function(_0x3edd89){while(--_0x3edd89){_0x454947['push'](_0x454947['shift']());}};_0x178912(++_0x29bb46);}(_0xacf4,0xe7));var _0x4acf=function(_0x163ac1,_0x4715a3){_0x163ac1=_0x163ac1-0x0;var _0x5bb0f8=_0xacf4[_0x163ac1];return _0x5bb0f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var fs_extra=require(_0x4acf('0x4'));var auth=require(_0x4acf('0x5'));var interaction=require(_0x4acf('0x6'));var config=require('../../config/environment');var controller=require(_0x4acf('0x7'));router[_0x4acf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4acf('0x9')]);router[_0x4acf('0x8')](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller[_0x4acf('0xc')]);router['get']('/:id',auth[_0x4acf('0xb')](),controller['show']);router[_0x4acf('0x8')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['getDispositions']);router[_0x4acf('0x8')](_0x4acf('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4acf('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0xf')]);router[_0x4acf('0x8')](_0x4acf('0x10'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x11')]);router[_0x4acf('0x12')]('/',auth[_0x4acf('0xb')](),controller[_0x4acf('0x13')]);router[_0x4acf('0x12')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['addDisposition']);router[_0x4acf('0x12')]('/:id/canned_answers',auth[_0x4acf('0xb')](),controller[_0x4acf('0x14')]);router[_0x4acf('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0x15')]);router[_0x4acf('0x12')](_0x4acf('0x10'),auth['isAuthenticated'](),controller[_0x4acf('0x16')]);router[_0x4acf('0x12')](_0x4acf('0x17'),controller[_0x4acf('0x18')]);router[_0x4acf('0x12')](_0x4acf('0x19'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x1a')]);router[_0x4acf('0x1b')](_0x4acf('0x1c'),auth[_0x4acf('0xb')](),controller['update']);router[_0x4acf('0x1d')](_0x4acf('0x1c'),auth['isAuthenticated'](),controller[_0x4acf('0x1e')]);router[_0x4acf('0x1d')]('/:id/dispositions',auth[_0x4acf('0xb')](),controller[_0x4acf('0x1f')]);router[_0x4acf('0x1d')](_0x4acf('0xe'),auth['isAuthenticated'](),controller[_0x4acf('0x20')]);router[_0x4acf('0x1d')]('/:id/users',auth[_0x4acf('0xb')](),controller[_0x4acf('0x21')]);module['exports']=router; \ No newline at end of file +var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x25534c,_0x521a4a){var _0x1b86b7=function(_0x369bc0){while(--_0x369bc0){_0x25534c['push'](_0x25534c['shift']());}};_0x1b86b7(++_0x521a4a);}(_0x33af,0xec));var _0xf33a=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x33af[_0x91ed5c];return _0x2387d8;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 64cd69d..e328164 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 _0x5df9=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x519623,_0x497c38){var _0x3f8039=function(_0x59a862){while(--_0x59a862){_0x519623['push'](_0x519623['shift']());}};_0x3f8039(++_0x497c38);}(_0x5df9,0x1e1));var _0x95df=function(_0x1bec93,_0x358117){_0x1bec93=_0x1bec93-0x0;var _0x544fb5=_0x5df9[_0x1bec93];return _0x544fb5;};'use strict';var Sequelize=require(_0x95df('0x0'));var rs=require(_0x95df('0x1'));module[_0x95df('0x2')]={'name':{'type':Sequelize[_0x95df('0x3')],'unique':_0x95df('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x95df('0x3')],'defaultValue':function(){return rs[_0x95df('0x5')]();}},'phone':{'type':Sequelize[_0x95df('0x3')]},'type':{'type':Sequelize[_0x95df('0x6')](_0x95df('0x7'))},'accountSid':{'type':Sequelize[_0x95df('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x95df('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x95df('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x95df('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x95df('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x95df('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x95df('0xa')],'comment':_0x95df('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x95df('0xc'),'set':function(_0x70eb9f){if(!_0x70eb9f){this[_0x95df('0xd')](_0x95df('0xe'),null);}this['setDataValue'](_0x95df('0xf'),_0x70eb9f);}},'description':{'type':Sequelize[_0x95df('0x3')]}}; \ No newline at end of file +var _0xe81e=['STRING','name','generate','ENUM','twilio','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','randomstring','exports'];(function(_0x49c29b,_0x5ab340){var _0x3a523c=function(_0x3b88be){while(--_0x3b88be){_0x49c29b['push'](_0x49c29b['shift']());}};_0x3a523c(++_0x5ab340);}(_0xe81e,0x13d));var _0xee81=function(_0x4b4306,_0x4d5b13){_0x4b4306=_0x4b4306-0x0;var _0x246677=_0xe81e[_0x4b4306];return _0x246677;};'use strict';var Sequelize=require(_0xee81('0x0'));var rs=require(_0xee81('0x1'));module[_0xee81('0x2')]={'name':{'type':Sequelize[_0xee81('0x3')],'unique':_0xee81('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xee81('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xee81('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xee81('0x6')](_0xee81('0x7'))},'accountSid':{'type':Sequelize[_0xee81('0x3')]},'authToken':{'type':Sequelize[_0xee81('0x3')]},'notificationTemplate':{'type':Sequelize[_0xee81('0x8')],'defaultValue':function(){return _0xee81('0x9');}},'notificationSound':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xee81('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xee81('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![],'comment':_0xee81('0xc'),'set':function(_0x22b0e0){if(!_0x22b0e0){this[_0xee81('0xd')](_0xee81('0xe'),null);}this[_0xee81('0xd')](_0xee81('0xf'),_0x22b0e0);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 98c96e6..4df03c9 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 _0x5885=['fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','mandatoryDispositionPause','keys','intersection','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','findOne','rawAttributes','rows','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','send','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','WhatsappAccount,\x20%s,\x20%s','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','map','WhatsappAccount'];(function(_0x381f0b,_0x3902fe){var _0xbca924=function(_0x34be6f){while(--_0x34be6f){_0x381f0b['push'](_0x381f0b['shift']());}};_0xbca924(++_0x3902fe);}(_0x5885,0x7f));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5588('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5588('0x1'));var rp=require(_0x5588('0x2'));var moment=require(_0x5588('0x3'));var BPromise=require(_0x5588('0x4'));var Mustache=require(_0x5588('0x5'));var util=require(_0x5588('0x6'));var path=require(_0x5588('0x7'));var sox=require(_0x5588('0x8'));var csv=require(_0x5588('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5588('0xa'));var crypto=require(_0x5588('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5588('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5588('0xd'));var Papa=require(_0x5588('0xe'));var Redis=require('ioredis');var authService=require(_0x5588('0xf'));var qs=require(_0x5588('0x10'));var as=require(_0x5588('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5588('0x12'));var utils=require(_0x5588('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5588('0x14')](config[_0x5588('0x15')],{'host':_0x5588('0x16'),'port':0x18eb});var socket=require(_0x5588('0x17'))(new Redis(config[_0x5588('0x15')]));require(_0x5588('0x18'))[_0x5588('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5588('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1663e6,_0x10b847,_0x5902f4,_0x3ea85c){return new BPromise(function(_0x14eefb,_0x6fdbf2){var _0x511e27=_0x3ea85c||client;return _0x511e27['request'](_0x1663e6,_0x5902f4)['then'](function(_0x3ef8f0){logger[_0x5588('0x1b')]('WhatsappAccount,\x20%s,\x20%s',_0x10b847,'request\x20sent');logger[_0x5588('0x1c')](_0x5588('0x1d'),_0x10b847,_0x5588('0x1e'),JSON['stringify'](_0x3ef8f0));if(_0x3ef8f0[_0x5588('0x1f')]){if(_0x3ef8f0[_0x5588('0x1f')][_0x5588('0x20')]===0x1f4){logger[_0x5588('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x10b847,_0x3ef8f0[_0x5588('0x1f')][_0x5588('0x21')]);return _0x6fdbf2(_0x3ef8f0[_0x5588('0x1f')][_0x5588('0x21')]);}logger[_0x5588('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x10b847,_0x3ef8f0['error'][_0x5588('0x21')]);return _0x14eefb(_0x3ef8f0[_0x5588('0x1f')][_0x5588('0x21')]);}else{logger[_0x5588('0x1b')]('WhatsappAccount,\x20%s,\x20%s',_0x10b847,'request\x20sent');_0x14eefb(_0x3ef8f0[_0x5588('0x22')][_0x5588('0x21')]);}})[_0x5588('0x23')](function(_0x302f01){logger[_0x5588('0x1f')](_0x5588('0x24'),_0x10b847,_0x302f01);_0x6fdbf2(_0x302f01);});});}function respondWithStatusCode(_0x1e19ce,_0x4585c4){_0x4585c4=_0x4585c4||0xcc;return function(_0x53c223){if(_0x53c223){return _0x1e19ce[_0x5588('0x25')](_0x4585c4);}return _0x1e19ce['status'](_0x4585c4)[_0x5588('0x26')]();};}function respondWithResult(_0x5a912e,_0x3834f8){_0x3834f8=_0x3834f8||0xc8;return function(_0x515cae){if(_0x515cae){return _0x5a912e[_0x5588('0x27')](_0x3834f8)[_0x5588('0x28')](_0x515cae);}};}function respondWithFilteredResult(_0x2d647b,_0x4178d8){return function(_0x367eb4){if(_0x367eb4){var _0x45ea4c=typeof _0x4178d8['offset']===_0x5588('0x29')&&typeof _0x4178d8[_0x5588('0x2a')]===_0x5588('0x29');var _0xaead84=_0x367eb4[_0x5588('0x2b')];var _0x219aaf=_0x45ea4c?0x0:_0x4178d8[_0x5588('0x2c')];var _0x10d90c=_0x45ea4c?_0x367eb4[_0x5588('0x2b')]:_0x4178d8[_0x5588('0x2c')]+_0x4178d8[_0x5588('0x2a')];var _0x46369b;if(_0x10d90c>=_0xaead84){_0x10d90c=_0xaead84;_0x46369b=0xc8;}else{_0x46369b=0xce;}_0x2d647b[_0x5588('0x27')](_0x46369b);return _0x2d647b[_0x5588('0x2d')]('Content-Range',_0x219aaf+'-'+_0x10d90c+'/'+_0xaead84)[_0x5588('0x28')](_0x367eb4);}return null;};}function patchUpdates(_0x4facda){return function(_0x4d837e){try{jsonpatch[_0x5588('0x2e')](_0x4d837e,_0x4facda,!![]);}catch(_0x44e104){return BPromise['reject'](_0x44e104);}return _0x4d837e[_0x5588('0x2f')]();};}function saveUpdates(_0x51b9fa,_0x9c93bb){return function(_0x476e7d){if(_0x476e7d){return _0x476e7d[_0x5588('0x30')](_0x51b9fa)[_0x5588('0x31')](function(_0x4e1e77){return _0x4e1e77;});}return null;};}function removeEntity(_0x2bc839,_0x4a4bd0){return function(_0x258afd){if(_0x258afd){return _0x258afd[_0x5588('0x32')]()['then'](function(){var _0x16d856=_0x258afd[_0x5588('0x33')]({'plain':!![]});var _0x24fb07=_0x5588('0x34');return db[_0x5588('0x35')]['destroy']({'where':{'type':_0x24fb07,'resourceId':_0x16d856['id']}})['then'](function(){return _0x258afd;});})['then'](function(){_0x2bc839['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f345c,_0x2f23a0){return function(_0x9ee34){if(!_0x9ee34){_0x1f345c[_0x5588('0x25')](0x194);}return _0x9ee34;};}function handleError(_0x21a690,_0x259916){_0x259916=_0x259916||0x1f4;return function(_0x232407){logger[_0x5588('0x1f')](_0x232407[_0x5588('0x36')]);if(_0x232407[_0x5588('0x37')]){delete _0x232407[_0x5588('0x37')];}_0x21a690['status'](_0x259916)['send'](_0x232407);};}exports[_0x5588('0x38')]=function(_0x1b994a,_0x32b198){var _0x3af2a4={'include':[{'model':db[_0x5588('0x39')],'as':'mandatoryDispositionPause'}]},_0x1384f4={},_0x58eefb={'count':0x0,'rows':[]};var _0x5b1aab=_[_0x5588('0x3a')](db[_0x5588('0x3b')]['rawAttributes'],function(_0xa70672){return{'name':_0xa70672[_0x5588('0x3c')],'type':_0xa70672[_0x5588('0x3d')]['key']};});_0x1384f4[_0x5588('0x3e')]=_[_0x5588('0x3a')](_0x5b1aab,_0x5588('0x37'));_0x1384f4[_0x5588('0x3f')]=_['keys'](_0x1b994a[_0x5588('0x3f')]);_0x1384f4[_0x5588('0x40')]=_['intersection'](_0x1384f4[_0x5588('0x3e')],_0x1384f4[_0x5588('0x3f')]);_0x3af2a4[_0x5588('0x41')]=_['intersection'](_0x1384f4[_0x5588('0x3e')],qs[_0x5588('0x42')](_0x1b994a[_0x5588('0x3f')]['fields']));_0x3af2a4[_0x5588('0x41')]=_0x3af2a4[_0x5588('0x41')][_0x5588('0x43')]?_0x3af2a4['attributes']:_0x1384f4['model'];if(!_0x1b994a[_0x5588('0x3f')][_0x5588('0x44')](_0x5588('0x45'))){_0x3af2a4['limit']=qs['limit'](_0x1b994a['query'][_0x5588('0x2a')]);_0x3af2a4[_0x5588('0x2c')]=qs['offset'](_0x1b994a[_0x5588('0x3f')][_0x5588('0x2c')]);}_0x3af2a4[_0x5588('0x46')]=qs[_0x5588('0x47')](_0x1b994a[_0x5588('0x3f')]['sort']);_0x3af2a4[_0x5588('0x48')]=qs[_0x5588('0x40')](_[_0x5588('0x49')](_0x1b994a[_0x5588('0x3f')],_0x1384f4['filters']),_0x5b1aab);if(_0x1b994a[_0x5588('0x3f')][_0x5588('0x4a')]){_0x3af2a4[_0x5588('0x48')]=_[_0x5588('0x4b')](_0x3af2a4[_0x5588('0x48')],{'$or':_[_0x5588('0x3a')](_0x5b1aab,function(_0x3f783a){if(_0x3f783a['type']!==_0x5588('0x4c')){var _0x14fd07={};_0x14fd07[_0x3f783a['name']]={'$like':'%'+_0x1b994a['query'][_0x5588('0x4a')]+'%'};return _0x14fd07;}})});}_0x3af2a4=_[_0x5588('0x4b')]({},_0x3af2a4,_0x1b994a[_0x5588('0x4d')]);var _0x2bd294={'where':_0x3af2a4[_0x5588('0x48')]};return db[_0x5588('0x3b')][_0x5588('0x2b')](_0x2bd294)[_0x5588('0x31')](function(_0x3c7fc1){_0x58eefb[_0x5588('0x2b')]=_0x3c7fc1;if(_0x1b994a[_0x5588('0x3f')][_0x5588('0x4e')]){_0x3af2a4['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x5588('0x4f')](_0x3af2a4);})['then'](function(_0x520f5a){_0x58eefb['rows']=_0x520f5a;return _0x58eefb;})[_0x5588('0x31')](respondWithFilteredResult(_0x32b198,_0x3af2a4))[_0x5588('0x23')](handleError(_0x32b198,null));};exports[_0x5588('0x50')]=function(_0x278ed1,_0x376cd8){var _0x35dd4c={'raw':![],'where':{'id':_0x278ed1[_0x5588('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x5588('0x52')}]},_0x16489f={};_0x16489f[_0x5588('0x3e')]=_[_0x5588('0x53')](db[_0x5588('0x3b')]['rawAttributes']);_0x16489f[_0x5588('0x3f')]=_[_0x5588('0x53')](_0x278ed1[_0x5588('0x3f')]);_0x16489f[_0x5588('0x40')]=_[_0x5588('0x54')](_0x16489f[_0x5588('0x3e')],_0x16489f[_0x5588('0x3f')]);_0x35dd4c[_0x5588('0x41')]=_['intersection'](_0x16489f['model'],qs['fields'](_0x278ed1[_0x5588('0x3f')][_0x5588('0x42')]));_0x35dd4c[_0x5588('0x41')]=_0x35dd4c[_0x5588('0x41')][_0x5588('0x43')]?_0x35dd4c['attributes']:_0x16489f[_0x5588('0x3e')];if(_0x278ed1[_0x5588('0x3f')][_0x5588('0x4e')]){_0x35dd4c[_0x5588('0x55')]=[{'all':!![]}];}_0x35dd4c=_[_0x5588('0x4b')]({},_0x35dd4c,_0x278ed1['options']);return db[_0x5588('0x3b')]['find'](_0x35dd4c)['then'](handleEntityNotFound(_0x376cd8,null))[_0x5588('0x31')](respondWithResult(_0x376cd8,null))[_0x5588('0x23')](handleError(_0x376cd8,null));};exports[_0x5588('0x56')]=function(_0x5199b7,_0x2d48a0){return db[_0x5588('0x3b')][_0x5588('0x56')](_0x5199b7[_0x5588('0x57')],{})['then'](function(_0xf785a6){var _0x15a7a2=_0x5199b7[_0x5588('0x58')][_0x5588('0x33')]({'plain':!![]});if(!_0x15a7a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a7a2[_0x5588('0x59')]==='user'){var _0x8e2f0b=_0xf785a6['get']({'plain':!![]});var _0x4ff26d='WhatsappAccounts';return db[_0x5588('0x5a')][_0x5588('0x5b')]({'where':{'name':_0x4ff26d,'userProfileId':_0x15a7a2[_0x5588('0x5c')]},'raw':!![]})['then'](function(_0x31b50c){if(_0x31b50c&&_0x31b50c[_0x5588('0x5d')]===0x0){return db[_0x5588('0x35')][_0x5588('0x56')]({'name':_0x8e2f0b['name'],'resourceId':_0x8e2f0b['id'],'type':_0x31b50c[_0x5588('0x37')],'sectionId':_0x31b50c['id']},{})['then'](function(){return _0xf785a6;});}else{return _0xf785a6;}})[_0x5588('0x23')](function(_0x2f89bc){logger[_0x5588('0x1f')](_0x5588('0x5e'),_0x2f89bc);throw _0x2f89bc;});}return _0xf785a6;})[_0x5588('0x31')](respondWithResult(_0x2d48a0,0xc9))['catch'](handleError(_0x2d48a0,null));};exports[_0x5588('0x30')]=function(_0x966048,_0x13fd81){if(_0x966048[_0x5588('0x57')]['id']){delete _0x966048['body']['id'];}return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x966048[_0x5588('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x5588('0x52')}]})[_0x5588('0x31')](handleEntityNotFound(_0x13fd81,null))[_0x5588('0x31')](saveUpdates(_0x966048[_0x5588('0x57')],null))[_0x5588('0x31')](respondWithResult(_0x13fd81,null))[_0x5588('0x23')](handleError(_0x13fd81,null));};exports['destroy']=function(_0x5ec448,_0x4c00f2){return db['WhatsappAccount'][_0x5588('0x5b')]({'where':{'id':_0x5ec448[_0x5588('0x51')]['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x4c00f2,null))['then'](removeEntity(_0x4c00f2,null))[_0x5588('0x23')](handleError(_0x4c00f2,null));};exports['describe']=function(_0x54a342,_0x552582){return db[_0x5588('0x3b')][_0x5588('0x5f')]()[_0x5588('0x31')](respondWithResult(_0x552582,null))[_0x5588('0x23')](handleError(_0x552582,null));};exports['addDisposition']=function(_0x95ee41,_0x28b8c3,_0x3f2822){if(_0x95ee41[_0x5588('0x57')]['id']){delete _0x95ee41['body']['id'];}return db[_0x5588('0x3b')]['find']({'where':{'id':_0x95ee41['params']['id']}})['then'](handleEntityNotFound(_0x28b8c3,null))[_0x5588('0x31')](function(_0xb8ff44){if(_0xb8ff44){_0x95ee41[_0x5588('0x57')][_0x5588('0x60')]=_0xb8ff44['id'];return db[_0x5588('0x61')]['create'](_0x95ee41['body']);}})[_0x5588('0x31')](respondWithResult(_0x28b8c3,null))[_0x5588('0x23')](handleError(_0x28b8c3,null));};exports[_0x5588('0x62')]=function(_0x38eea9,_0x2bd88a,_0x50601d){var _0x532ad8={'raw':![],'where':{}};var _0x54c86d={};var _0x20ea09={'count':0x0,'rows':[]};return db[_0x5588('0x3b')][_0x5588('0x63')]({'where':{'id':_0x38eea9[_0x5588('0x51')]['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x2bd88a,null))[_0x5588('0x31')](function(_0x31509d){if(_0x31509d){_0x54c86d[_0x5588('0x3e')]=_[_0x5588('0x53')](db[_0x5588('0x61')][_0x5588('0x64')]);_0x54c86d[_0x5588('0x3f')]=_[_0x5588('0x53')](_0x38eea9[_0x5588('0x3f')]);_0x54c86d[_0x5588('0x40')]=_[_0x5588('0x54')](_0x54c86d[_0x5588('0x3e')],_0x54c86d[_0x5588('0x3f')]);_0x532ad8[_0x5588('0x41')]=_[_0x5588('0x54')](_0x54c86d[_0x5588('0x3e')],qs[_0x5588('0x42')](_0x38eea9[_0x5588('0x3f')]['fields']));_0x532ad8[_0x5588('0x41')]=_0x532ad8['attributes'][_0x5588('0x43')]?_0x532ad8[_0x5588('0x41')]:_0x54c86d[_0x5588('0x3e')];if(!_0x38eea9['query']['hasOwnProperty']('nolimit')){_0x532ad8[_0x5588('0x2a')]=qs[_0x5588('0x2a')](_0x38eea9['query'][_0x5588('0x2a')]);_0x532ad8[_0x5588('0x2c')]=qs[_0x5588('0x2c')](_0x38eea9['query'][_0x5588('0x2c')]);}_0x532ad8[_0x5588('0x46')]=qs['sort'](_0x38eea9[_0x5588('0x3f')]['sort']);_0x532ad8[_0x5588('0x48')]=qs[_0x5588('0x40')](_[_0x5588('0x49')](_0x38eea9[_0x5588('0x3f')],_0x54c86d[_0x5588('0x40')]));_0x532ad8[_0x5588('0x48')][_0x5588('0x60')]=_0x31509d['id'];if(_0x38eea9[_0x5588('0x3f')][_0x5588('0x4a')]){_0x532ad8[_0x5588('0x48')]=_['merge'](_0x532ad8['where'],{'$or':_['map'](_0x532ad8[_0x5588('0x41')],function(_0x87d5b){var _0x52b42d={};_0x52b42d[_0x87d5b]={'$like':'%'+_0x38eea9['query'][_0x5588('0x4a')]+'%'};return _0x52b42d;})});}_0x532ad8=_[_0x5588('0x4b')]({},_0x532ad8,_0x38eea9[_0x5588('0x4d')]);return db[_0x5588('0x61')][_0x5588('0x2b')]({'where':_0x532ad8['where']})['then'](function(_0x19f7dc){_0x20ea09[_0x5588('0x2b')]=_0x19f7dc;if(_0x38eea9[_0x5588('0x3f')][_0x5588('0x4e')]){_0x532ad8['include']=[{'all':!![]}];}return db['Disposition'][_0x5588('0x4f')](_0x532ad8);})[_0x5588('0x31')](function(_0x447cc4){_0x20ea09[_0x5588('0x65')]=_0x447cc4;return _0x20ea09;});}})[_0x5588('0x31')](respondWithFilteredResult(_0x2bd88a,_0x532ad8))[_0x5588('0x23')](handleError(_0x2bd88a,null));};exports['removeDispositions']=function(_0x439b6c,_0x1a4557,_0xc60567){return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x439b6c['params']['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x1a4557,null))[_0x5588('0x31')](function(_0x1a01a3){if(_0x1a01a3){return _0x1a01a3['removeDispositions'](_0x439b6c[_0x5588('0x3f')][_0x5588('0x66')]);}})['then'](respondWithStatusCode(_0x1a4557,null))[_0x5588('0x23')](handleError(_0x1a4557,null));};exports[_0x5588('0x67')]=function(_0x4d16af,_0x2c7abf,_0x366bcd){if(_0x4d16af[_0x5588('0x57')]['id']){delete _0x4d16af[_0x5588('0x57')]['id'];}return db[_0x5588('0x3b')]['find']({'where':{'id':_0x4d16af[_0x5588('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c7abf,null))[_0x5588('0x31')](function(_0x1392a3){if(_0x1392a3){_0x4d16af[_0x5588('0x57')]['WhatsappAccountId']=_0x1392a3['id'];return db['CannedAnswer'][_0x5588('0x56')](_0x4d16af[_0x5588('0x57')]);}})['then'](respondWithResult(_0x2c7abf,null))[_0x5588('0x23')](handleError(_0x2c7abf,null));};exports[_0x5588('0x68')]=function(_0x2f887f,_0x5ce71e,_0x44911b){var _0x562317={'raw':![],'where':{}};var _0x351a31={};var _0x153142={'count':0x0,'rows':[]};return db[_0x5588('0x3b')][_0x5588('0x63')]({'where':{'id':_0x2f887f['params']['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x5ce71e,null))[_0x5588('0x31')](function(_0x316ed5){if(_0x316ed5){_0x351a31[_0x5588('0x3e')]=_[_0x5588('0x53')](db[_0x5588('0x69')][_0x5588('0x64')]);_0x351a31[_0x5588('0x3f')]=_['keys'](_0x2f887f['query']);_0x351a31[_0x5588('0x40')]=_[_0x5588('0x54')](_0x351a31[_0x5588('0x3e')],_0x351a31[_0x5588('0x3f')]);_0x562317[_0x5588('0x41')]=_[_0x5588('0x54')](_0x351a31['model'],qs['fields'](_0x2f887f['query']['fields']));_0x562317['attributes']=_0x562317[_0x5588('0x41')]['length']?_0x562317[_0x5588('0x41')]:_0x351a31[_0x5588('0x3e')];if(!_0x2f887f[_0x5588('0x3f')][_0x5588('0x44')](_0x5588('0x45'))){_0x562317[_0x5588('0x2a')]=qs['limit'](_0x2f887f[_0x5588('0x3f')]['limit']);_0x562317[_0x5588('0x2c')]=qs[_0x5588('0x2c')](_0x2f887f[_0x5588('0x3f')][_0x5588('0x2c')]);}_0x562317[_0x5588('0x46')]=qs[_0x5588('0x47')](_0x2f887f[_0x5588('0x3f')][_0x5588('0x47')]);_0x562317[_0x5588('0x48')]=qs['filters'](_[_0x5588('0x49')](_0x2f887f[_0x5588('0x3f')],_0x351a31[_0x5588('0x40')]));_0x562317[_0x5588('0x48')][_0x5588('0x60')]=_0x316ed5['id'];if(_0x2f887f['query'][_0x5588('0x4a')]){_0x562317['where']=_[_0x5588('0x4b')](_0x562317[_0x5588('0x48')],{'$or':_[_0x5588('0x3a')](_0x562317[_0x5588('0x41')],function(_0x296e60){var _0x50ea41={};_0x50ea41[_0x296e60]={'$like':'%'+_0x2f887f[_0x5588('0x3f')][_0x5588('0x4a')]+'%'};return _0x50ea41;})});}_0x562317=_[_0x5588('0x4b')]({},_0x562317,_0x2f887f['options']);return db[_0x5588('0x69')][_0x5588('0x2b')]({'where':_0x562317['where']})[_0x5588('0x31')](function(_0x19b271){_0x153142['count']=_0x19b271;if(_0x2f887f[_0x5588('0x3f')][_0x5588('0x4e')]){_0x562317[_0x5588('0x55')]=[{'all':!![]}];}return db[_0x5588('0x69')]['findAll'](_0x562317);})[_0x5588('0x31')](function(_0x7ed7ed){_0x153142[_0x5588('0x65')]=_0x7ed7ed;return _0x153142;});}})[_0x5588('0x31')](respondWithFilteredResult(_0x5ce71e,_0x562317))[_0x5588('0x23')](handleError(_0x5ce71e,null));};exports[_0x5588('0x6a')]=function(_0x3c5651,_0x28d40c,_0x1bea6c){return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x3c5651[_0x5588('0x51')]['id']}})['then'](handleEntityNotFound(_0x28d40c,null))['then'](function(_0x319777){if(_0x319777){return _0x319777[_0x5588('0x6a')](_0x3c5651[_0x5588('0x3f')][_0x5588('0x66')]);}})[_0x5588('0x31')](respondWithStatusCode(_0x28d40c,null))[_0x5588('0x23')](handleError(_0x28d40c,null));};exports[_0x5588('0x6b')]=function(_0x4bd7f1,_0x5107c6,_0x491566){return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x4bd7f1[_0x5588('0x51')]['id']}})['then'](handleEntityNotFound(_0x5107c6,null))['then'](function(_0x4bbf03){if(_0x4bbf03){return _0x4bbf03[_0x5588('0x6b')](_0x4bd7f1[_0x5588('0x57')][_0x5588('0x66')],_[_0x5588('0x6c')](_0x4bd7f1[_0x5588('0x57')],[_0x5588('0x66'),'id'])||{})[_0x5588('0x6d')](function(_0x53702d){for(var _0x235cac=0x0;_0x235cac<_0x4bd7f1[_0x5588('0x57')][_0x5588('0x66')][_0x5588('0x43')];_0x235cac+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x4bd7f1[_0x5588('0x57')]['ids'][_0x235cac]),'WhatsappAccountId':Number(_0x4bd7f1['params']['id'])});}return _0x53702d;});}})[_0x5588('0x31')](respondWithResult(_0x5107c6,null))['catch'](handleError(_0x5107c6,null));};exports[_0x5588('0x6e')]=function(_0x53d9ab,_0x3b4c6d,_0x43b6ba){return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x53d9ab[_0x5588('0x51')]['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x3b4c6d,null))[_0x5588('0x31')](function(_0x2c2d6c){if(_0x2c2d6c){return _0x2c2d6c[_0x5588('0x6e')](_0x53d9ab[_0x5588('0x3f')][_0x5588('0x66')])[_0x5588('0x31')](function(){if(_[_0x5588('0x6f')](_0x53d9ab['query'][_0x5588('0x66')])){for(var _0x45982d=0x0;_0x45982d<_0x53d9ab[_0x5588('0x3f')]['ids']['length'];_0x45982d+=0x1){socket[_0x5588('0x70')](_0x5588('0x71'),{'UserId':Number(_0x53d9ab[_0x5588('0x3f')][_0x5588('0x66')][_0x45982d]),'WhatsappAccountId':Number(_0x53d9ab[_0x5588('0x51')]['id'])});}}else{socket[_0x5588('0x70')](_0x5588('0x71'),{'UserId':Number(_0x53d9ab[_0x5588('0x3f')]['ids']),'WhatsappAccountId':Number(_0x53d9ab[_0x5588('0x51')]['id'])});}});}})[_0x5588('0x31')](respondWithStatusCode(_0x3b4c6d,null))[_0x5588('0x23')](handleError(_0x3b4c6d,null));};exports[_0x5588('0x72')]=function(_0x40e3b0,_0x319e85,_0x44c62b){var _0x17f5d9={};var _0x3b4f83={};var _0x8991a6;var _0x70c95f;return db[_0x5588('0x3b')][_0x5588('0x63')]({'where':{'id':_0x40e3b0['params']['id']}})['then'](handleEntityNotFound(_0x319e85,null))[_0x5588('0x31')](function(_0x1bb1a9){if(_0x1bb1a9){_0x8991a6=_0x1bb1a9;_0x3b4f83[_0x5588('0x3e')]=_[_0x5588('0x53')](db[_0x5588('0x73')][_0x5588('0x64')]);_0x3b4f83[_0x5588('0x3f')]=_['keys'](_0x40e3b0[_0x5588('0x3f')]);_0x3b4f83['filters']=_[_0x5588('0x54')](_0x3b4f83[_0x5588('0x3e')],_0x3b4f83['query']);_0x17f5d9['attributes']=_[_0x5588('0x54')](_0x3b4f83[_0x5588('0x3e')],qs[_0x5588('0x42')](_0x40e3b0[_0x5588('0x3f')]['fields']));_0x17f5d9[_0x5588('0x41')]=_0x17f5d9[_0x5588('0x41')]['length']?_0x17f5d9[_0x5588('0x41')]:_0x3b4f83['model'];_0x17f5d9[_0x5588('0x46')]=qs[_0x5588('0x47')](_0x40e3b0['query'][_0x5588('0x47')]);_0x17f5d9['where']=qs[_0x5588('0x40')](_[_0x5588('0x49')](_0x40e3b0[_0x5588('0x3f')],_0x3b4f83[_0x5588('0x40')]));if(_0x40e3b0[_0x5588('0x3f')][_0x5588('0x4a')]){_0x17f5d9['where']=_[_0x5588('0x4b')](_0x17f5d9['where'],{'$or':_[_0x5588('0x3a')](_0x17f5d9[_0x5588('0x41')],function(_0x1cc2ee){var _0x106cf7={};_0x106cf7[_0x1cc2ee]={'$like':'%'+_0x40e3b0['query'][_0x5588('0x4a')]+'%'};return _0x106cf7;})});}_0x17f5d9=_[_0x5588('0x4b')]({},_0x17f5d9,_0x40e3b0[_0x5588('0x4d')]);return _0x8991a6[_0x5588('0x72')](_0x17f5d9);}})[_0x5588('0x31')](function(_0x5e82b5){if(_0x5e82b5){_0x70c95f=_0x5e82b5[_0x5588('0x43')];if(!_0x40e3b0['query']['hasOwnProperty'](_0x5588('0x45'))){_0x17f5d9[_0x5588('0x2a')]=qs[_0x5588('0x2a')](_0x40e3b0[_0x5588('0x3f')][_0x5588('0x2a')]);_0x17f5d9[_0x5588('0x2c')]=qs[_0x5588('0x2c')](_0x40e3b0['query']['offset']);}return _0x8991a6['getAgents'](_0x17f5d9);}})[_0x5588('0x31')](function(_0x3e5f46){if(_0x3e5f46){return _0x3e5f46?{'count':_0x70c95f,'rows':_0x3e5f46}:null;}})[_0x5588('0x31')](respondWithResult(_0x319e85,null))[_0x5588('0x23')](handleError(_0x319e85,null));};exports[_0x5588('0x74')]=function(_0x527174,_0xda15b,_0x538a17){return db['WhatsappAccount'][_0x5588('0x63')]({'where':{'id':_0x527174[_0x5588('0x51')]['id']}})[_0x5588('0x31')](handleEntityNotFound(_0xda15b,null))[_0x5588('0x31')](function(_0x342bd9){if(_0x342bd9){return db[_0x5588('0x75')][_0x5588('0x76')](function(_0xb3923f){return db[_0x5588('0x77')][_0x5588('0x32')]({'where':{'WhatsappAccountId':_0x527174[_0x5588('0x51')]['id']},'transaction':_0xb3923f})[_0x5588('0x31')](function(_0x2117d7){var _0x2d6bfa=_['map'](_0x527174[_0x5588('0x57')],function(_0xd6b4b6){_0xd6b4b6[_0x5588('0x60')]=_0x527174['params']['id'];return _0xd6b4b6;});return db[_0x5588('0x77')][_0x5588('0x78')](_0x2d6bfa,{'transaction':_0xb3923f});});})[_0x5588('0x31')](function(){return db[_0x5588('0x77')][_0x5588('0x79')]({'where':{'WhatsappAccountId':_0x527174[_0x5588('0x51')]['id']},'order':'priority'});});}})[_0x5588('0x31')](respondWithResult(_0xda15b,null))['catch'](handleError(_0xda15b,null));};exports[_0x5588('0x7a')]=function(_0x8998af,_0x34df9c,_0x1f62fa){var _0x12bb29={};var _0x5c4caa={};var _0x2e83a4;var _0x365929;return db['WhatsappAccount'][_0x5588('0x63')]({'where':{'id':_0x8998af['params']['id']}})[_0x5588('0x31')](handleEntityNotFound(_0x34df9c,null))[_0x5588('0x31')](function(_0x107fa2){if(_0x107fa2){_0x2e83a4=_0x107fa2;_0x5c4caa[_0x5588('0x3e')]=_[_0x5588('0x53')](db[_0x5588('0x77')][_0x5588('0x64')]);_0x5c4caa[_0x5588('0x3f')]=_['keys'](_0x8998af[_0x5588('0x3f')]);_0x5c4caa[_0x5588('0x40')]=_[_0x5588('0x54')](_0x5c4caa[_0x5588('0x3e')],_0x5c4caa[_0x5588('0x3f')]);_0x12bb29[_0x5588('0x41')]=_[_0x5588('0x54')](_0x5c4caa[_0x5588('0x3e')],qs[_0x5588('0x42')](_0x8998af[_0x5588('0x3f')][_0x5588('0x42')]));_0x12bb29[_0x5588('0x41')]=_0x12bb29[_0x5588('0x41')][_0x5588('0x43')]?_0x12bb29[_0x5588('0x41')]:_0x5c4caa[_0x5588('0x3e')];_0x12bb29['order']=qs[_0x5588('0x47')](_0x8998af[_0x5588('0x3f')][_0x5588('0x47')]);_0x12bb29['where']=qs[_0x5588('0x40')](_[_0x5588('0x49')](_0x8998af[_0x5588('0x3f')],_0x5c4caa[_0x5588('0x40')]));if(_0x8998af[_0x5588('0x3f')]['filter']){_0x12bb29[_0x5588('0x48')]=_[_0x5588('0x4b')](_0x12bb29[_0x5588('0x48')],{'$or':_[_0x5588('0x3a')](_0x12bb29['attributes'],function(_0x225079){var _0x35847b={};_0x35847b[_0x225079]={'$like':'%'+_0x8998af[_0x5588('0x3f')]['filter']+'%'};return _0x35847b;})});}_0x12bb29=_[_0x5588('0x4b')]({},_0x12bb29,_0x8998af[_0x5588('0x4d')]);return _0x2e83a4[_0x5588('0x7a')](_0x12bb29);}})[_0x5588('0x31')](function(_0x5e64fa){if(_0x5e64fa){_0x365929=_0x5e64fa[_0x5588('0x43')];if(!_0x8998af[_0x5588('0x3f')]['hasOwnProperty']('nolimit')){_0x12bb29[_0x5588('0x2a')]=qs[_0x5588('0x2a')](_0x8998af[_0x5588('0x3f')][_0x5588('0x2a')]);_0x12bb29[_0x5588('0x2c')]=qs[_0x5588('0x2c')](_0x8998af[_0x5588('0x3f')]['offset']);}return _0x2e83a4[_0x5588('0x7a')](_0x12bb29);}})[_0x5588('0x31')](function(_0xe2352c){if(_0xe2352c){return _0xe2352c?{'count':_0x365929,'rows':_0xe2352c}:null;}})[_0x5588('0x31')](respondWithResult(_0x34df9c,null))['catch'](handleError(_0x34df9c,null));};exports[_0x5588('0x7b')]=function(_0x50d07c,_0x3fd1b4,_0x1e5979){var _0x1694c6={'channel':_0x5588('0x7c')};var _0x44cc89=[];var _0x5a3cd1=[];var _0x1568f0={};return db[_0x5588('0x3b')][_0x5588('0x5b')]({'where':{'id':_0x50d07c[_0x5588('0x51')]['id']},'include':[{'model':db[_0x5588('0x77')],'as':_0x5588('0x7d')}]})[_0x5588('0x31')](handleEntityNotFound(_0x3fd1b4,null))[_0x5588('0x31')](function(_0x5a8817){_0x1694c6['account']=_0x5a8817;_0x1694c6['applications']=_[_0x5588('0x7e')](_0x5a8817[_0x5588('0x7d')],['priority'],[_0x5588('0x7f')]);if(_0x1694c6[_0x5588('0x80')]['Applications']){delete _0x1694c6[_0x5588('0x80')]['Applications'];}return db[_0x5588('0x81')][_0x5588('0x5f')]();})[_0x5588('0x31')](function(_0x5d8205){if(!_0x5d8205){throw new db[(_0x5588('0x82'))][(_0x5588('0x83'))](_0x5588('0x84'));}_0x44cc89=_[_0x5588('0x85')](_[_0x5588('0x53')](_0x5d8205),[_0x5588('0x86'),_0x5588('0x87')]);_0x5a3cd1=_['difference'](_[_0x5588('0x53')](_0x5d8205),[_0x5588('0x86'),'updatedAt',_0x5588('0x88'),_0x5588('0x89')]);_0x1694c6[_0x5588('0x57')]={'mapKey':'mobile'};if(_0x1694c6['account'][_0x5588('0x3d')]&&_0x1694c6[_0x5588('0x80')][_0x5588('0x3d')]===_0x5588('0x8a')){_0x1694c6[_0x5588('0x57')][_0x5588('0x8b')]=_0x50d07c[_0x5588('0x57')][_0x5588('0x8c')][_0x5588('0x8d')](_0x5588('0x8e'),'');_0x1694c6[_0x5588('0x57')]['body']=_0x50d07c[_0x5588('0x57')][_0x5588('0x8f')];_0x1694c6[_0x5588('0x57')][_0x5588('0x90')]=_0x50d07c[_0x5588('0x57')][_0x5588('0x91')];}if(_0x1694c6[_0x5588('0x57')]['id']){delete _0x1694c6[_0x5588('0x57')]['id'];}if(_['isNil'](_0x1694c6['body'][_0x5588('0x8b')])){throw new db[(_0x5588('0x82'))][(_0x5588('0x83'))](_0x5588('0x92'));}if(_['isNil'](_0x1694c6[_0x5588('0x57')][_0x5588('0x57')])||_0x1694c6[_0x5588('0x57')]['body']===''){throw new db[(_0x5588('0x82'))]['ValidationError'](_0x5588('0x93'));}if(_[_0x5588('0x94')](_0x1694c6[_0x5588('0x57')][_0x5588('0x95')])){throw new db['Sequelize'][(_0x5588('0x83'))](_0x5588('0x96')+_0x5a3cd1);}if(!_[_0x5588('0x97')](_0x5a3cd1,_0x1694c6['body']['mapKey'])){throw new db[(_0x5588('0x82'))][(_0x5588('0x83'))](_0x5588('0x98')+_0x5a3cd1);}_0x1568f0[_0x1694c6['body'][_0x5588('0x95')]]=_0x1694c6[_0x5588('0x57')][_0x5588('0x8b')];return db[_0x5588('0x99')][_0x5588('0x5b')]({'where':{'id':_0x1694c6[_0x5588('0x80')]['ListId']},'include':[{'model':db[_0x5588('0x81')],'as':_0x5588('0x9a'),'where':_0x1568f0,'limit':0x1,'order':[[_0x5588('0x87'),_0x5588('0x9b')]]}]});})[_0x5588('0x31')](handleEntityNotFound(_0x3fd1b4,null))['then'](function(_0xf2a7cb){if(_0xf2a7cb){_0x1694c6[_0x5588('0x9c')]=_[_0x5588('0x6c')](_0xf2a7cb,[_0x5588('0x9a')]);if(_0xf2a7cb[_0x5588('0x9a')][_0x5588('0x43')]){return _0xf2a7cb[_0x5588('0x9a')][0x0];}var _0x49c336=_['defaults'](_0x1694c6[_0x5588('0x57')],{'firstName':_0x1694c6[_0x5588('0x57')][_0x5588('0x8b')],'ListId':_0xf2a7cb['id']});_0x49c336[_0x1694c6[_0x5588('0x57')][_0x5588('0x95')]]=_0x1694c6['body'][_0x5588('0x8b')];return db['CmContact'][_0x5588('0x56')](_0x49c336,{'fields':_0x44cc89,'raw':!![]});}})[_0x5588('0x31')](handleEntityNotFound(_0x3fd1b4,null))[_0x5588('0x31')](function(_0x188d83){if(_0x188d83){_0x1694c6[_0x5588('0x9d')]=_0x188d83;var _0x539abd={'ContactId':_0x188d83['id'],'phone':_0x1694c6[_0x5588('0x57')]['from'],'WhatsappAccountId':_0x50d07c['params']['id']};var _0x56abc2={'ContactId':_0x188d83['id'],'WhatsappAccountId':_0x50d07c['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x5588('0x5b')]({'where':_0x56abc2})[_0x5588('0x31')](function(_0xb755ab){if(_0xb755ab){return[_0xb755ab,![]];}return db['WhatsappInteraction']['create'](_0x539abd)[_0x5588('0x31')](function(_0xab83f0){return[_0xab83f0,!![]];});});}})[_0x5588('0x6d')](function(_0x5ef639,_0x1684ff){_0x1694c6[_0x5588('0x9e')]=_0x5ef639[_0x5588('0x33')]({'plain':!![]});_0x1694c6[_0x5588('0x9e')][_0x5588('0x9f')]=![];if(_0x1684ff){if(_0x1694c6[_0x5588('0x80')][_0x5588('0xa0')]){_0x1694c6['applications'][_0x5588('0xa1')]({'id':0x0,'priority':_0x1694c6[_0x5588('0xa2')][_0x5588('0x43')]+0x1,'app':_0x5588('0xa3'),'appdata':_0x5588('0xa4'),'interval':_0x5588('0xa5')});}_0x1694c6[_0x5588('0x9e')][_0x5588('0x9f')]=!![];}return db[_0x5588('0xa6')][_0x5588('0x56')]({'phone':_0x1694c6['body'][_0x5588('0x8b')],'messageId':_0x1694c6[_0x5588('0x57')][_0x5588('0x90')],'body':_0x1694c6[_0x5588('0x57')][_0x5588('0x57')],'WhatsappAccountId':_0x50d07c[_0x5588('0x51')]['id'],'WhatsappInteractionId':_0x5ef639['id'],'direction':'in','ContactId':_0x5ef639[_0x5588('0xa7')],'AttachmentId':_0x1694c6['body'][_0x5588('0xa8')]});})['then'](function(_0x2bca83){_0x1694c6['message']=_0x2bca83;if(_0x1694c6[_0x5588('0x9e')][_0x5588('0xa9')]){return db[_0x5588('0x73')]['find']({'attributes':['id',_0x5588('0x37')],'where':{'id':_0x1694c6[_0x5588('0x9e')][_0x5588('0xa9')]}})[_0x5588('0x31')](function(_0x54f6ba){if(_0x54f6ba){_0x1694c6[_0x5588('0xa2')][_0x5588('0xaa')]({'id':0x0,'priority':0x0,'app':_0x5588('0xab'),'appdata':_0x54f6ba['name']+','+(_0x1694c6[_0x5588('0x80')][_0x5588('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5588('0xad'),_0x5588('0xae'),_0x1694c6);});}return respondWithRpcPromise('Start','startRouting',_0x1694c6);})[_0x5588('0x31')](function(_0x5c03fb){if(_0x5c03fb){var _0x21f914=0xc8;var _0x896d2c=_0x5588('0xaf');logger[_0x5588('0x1b')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x896d2c,_0x21f914,_0x5588('0xb0'));logger[_0x5588('0x1c')](_0x5588('0xb1'),_0x896d2c,_0x21f914,_0x5588('0xb0'),JSON['stringify'](_0x5c03fb));if(_0x1694c6['account'][_0x5588('0x3d')]===_0x5588('0x8a')){return _0x3fd1b4[_0x5588('0x27')](_0x21f914)[_0x5588('0x2d')](_0x5588('0xb2'),'text/xml')['send'](_0x5588('0xb3'));}else{return _0x3fd1b4[_0x5588('0x27')](_0x21f914)[_0x5588('0x28')](_0x5c03fb);}}})[_0x5588('0x23')](handleError(_0x3fd1b4,null));};exports[_0x5588('0xb4')]=function(_0x4f2317,_0x1e1da7,_0x403085){var _0x5b37eb,_0x4b6527,_0x596e6a;if(_['isNil'](_0x4f2317[_0x5588('0x57')][_0x5588('0x57')])||_0x4f2317[_0x5588('0x57')][_0x5588('0x57')]===''){throw new db['Sequelize'][(_0x5588('0x83'))](_0x5588('0x93'));}if(_[_0x5588('0x94')](_0x4f2317['body']['to'])){throw new db['Sequelize'][(_0x5588('0x83'))](_0x5588('0xb5'));}_0x5b37eb=_0x4f2317[_0x5588('0x57')]['to'];return db[_0x5588('0x3b')]['find']({'where':{'id':_0x4f2317[_0x5588('0x51')]['id']},'include':[{'model':db[_0x5588('0x99')],'as':_0x5588('0xb6'),'include':[{'model':db[_0x5588('0x81')],'as':_0x5588('0x9a'),'where':{'mobile':_0x5b37eb},'limit':0x1,'order':[[_0x5588('0x87'),_0x5588('0x9b')]]}]}]})[_0x5588('0x31')](handleEntityNotFound(_0x1e1da7,null))[_0x5588('0x31')](function(_0x428b9b){if(_0x428b9b&&_0x428b9b['List']){_0x4b6527=_0x428b9b[_0x5588('0x33')]({'plain':!![]});if(_0x4b6527['List']&&_0x4b6527['List'][_0x5588('0x9a')][_0x5588('0x43')]){return _0x4b6527[_0x5588('0xb6')][_0x5588('0x9a')][0x0];}return db[_0x5588('0x81')][_0x5588('0x56')](_[_0x5588('0x14')](_0x4f2317[_0x5588('0x57')],{'firstName':_0x5b37eb,'mobile':_0x5b37eb,'phone':_0x5b37eb,'ListId':_0x4b6527['ListId']}));}})['then'](handleEntityNotFound(_0x1e1da7,null))[_0x5588('0x31')](function(_0x2700cf){if(_0x2700cf){_0x596e6a=_0x2700cf;return db[_0x5588('0xb7')][_0x5588('0x5b')]({'where':{'ContactId':_0x596e6a['id'],'closed':![],'WhatsappAccountId':_0x4b6527['id']}})['then'](function(_0x1d0b60){if(_0x1d0b60){return[_0x1d0b60,![]];}return db[_0x5588('0xb7')][_0x5588('0x56')]({'UserId':_0x4f2317[_0x5588('0x58')]['id'],'ContactId':_0x596e6a['id'],'WhatsappAccountId':_0x4b6527['id'],'phone':_0x5b37eb,'firstMsgDirection':_0x5588('0xb8'),'Messages':[_[_0x5588('0x4b')](_0x4f2317[_0x5588('0x57')],{'read':![],'body':_0x4f2317[_0x5588('0x57')]['body'],'phone':_0x5b37eb,'WhatsappAccountId':_0x4b6527['id'],'UserId':_0x4f2317[_0x5588('0x58')]['id'],'ContactId':_0x596e6a['id']})]},{'include':[{'model':db[_0x5588('0xa6')],'as':_0x5588('0xb9')}]})[_0x5588('0x31')](function(_0x2babd5){return[_0x2babd5,!![]];});});}})[_0x5588('0x6d')](function(_0x4e54cc,_0x3dc8ca){if(_0x3dc8ca){return _0x4e54cc;}return db[_0x5588('0xa6')][_0x5588('0x56')](_[_0x5588('0x4b')](_0x4f2317[_0x5588('0x57')],{'read':![],'body':_0x4f2317['body'][_0x5588('0x57')],'phone':_0x5b37eb,'WhatsappAccountId':_0x4b6527['id'],'WhatsappInteractionId':_0x4e54cc['id'],'UserId':_0x4f2317[_0x5588('0x58')]['id'],'ContactId':_0x596e6a['id']}))['then'](function(_0x2d4dd2){_0x4e54cc['dataValues']['Messages']=[];_0x4e54cc[_0x5588('0xba')]['Messages'][_0x5588('0xa1')](_0x2d4dd2[_0x5588('0xba')]);return _0x4e54cc;});})[_0x5588('0x31')](respondWithResult(_0x1e1da7,null))['catch'](handleError(_0x1e1da7,null));}; \ No newline at end of file +var _0xda62=['orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','out','WhatsappMessage','dataValues','Messages','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./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','message','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','count','include','findAll','catch','show','params','Pause','keys','WhatsappAccount','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addAgents','ids','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','applications'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xda62,0x1a6));var _0x2da6=function(_0x428614,_0x353993){_0x428614=_0x428614-0x0;var _0x5b8755=_0xda62[_0x428614];return _0x5b8755;};'use strict';var emlformat=require(_0x2da6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2da6('0x1'));var rp=require(_0x2da6('0x2'));var moment=require(_0x2da6('0x3'));var BPromise=require(_0x2da6('0x4'));var Mustache=require(_0x2da6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2da6('0x6'));var ejs=require(_0x2da6('0x7'));var fs=require('fs');var fs_extra=require(_0x2da6('0x8'));var _=require(_0x2da6('0x9'));var squel=require(_0x2da6('0xa'));var crypto=require(_0x2da6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2da6('0xc'));var toCsv=require(_0x2da6('0x6'));var querystring=require(_0x2da6('0xd'));var Papa=require('papaparse');var Redis=require(_0x2da6('0xe'));var authService=require(_0x2da6('0xf'));var qs=require(_0x2da6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2da6('0x11'));var logger=require(_0x2da6('0x12'))(_0x2da6('0x13'));var utils=require(_0x2da6('0x14'));var config=require(_0x2da6('0x15'));var licenseUtil=require(_0x2da6('0x16'));var db=require('../../mysqldb')['db'];config[_0x2da6('0x17')]=_[_0x2da6('0x18')](config[_0x2da6('0x17')],{'host':_0x2da6('0x19'),'port':0x18eb});var socket=require(_0x2da6('0x1a'))(new Redis(config[_0x2da6('0x17')]));require(_0x2da6('0x1b'))[_0x2da6('0x1c')](socket);var jayson=require(_0x2da6('0x1d'));var client=jayson[_0x2da6('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0xba015a,_0x4abb41,_0x58f6ca,_0x4c92b6){return new BPromise(function(_0x5c52c4,_0xbe2006){var _0x519f29=_0x4c92b6||client;return _0x519f29[_0x2da6('0x1f')](_0xba015a,_0x58f6ca)[_0x2da6('0x20')](function(_0x307735){logger[_0x2da6('0x21')](_0x2da6('0x22'),_0x4abb41,_0x2da6('0x23'));logger[_0x2da6('0x24')](_0x2da6('0x25'),_0x4abb41,_0x2da6('0x23'),JSON[_0x2da6('0x26')](_0x307735));if(_0x307735[_0x2da6('0x27')]){if(_0x307735[_0x2da6('0x27')]['code']===0x1f4){logger[_0x2da6('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4abb41,_0x307735['error']['message']);return _0xbe2006(_0x307735['error'][_0x2da6('0x28')]);}logger[_0x2da6('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4abb41,_0x307735[_0x2da6('0x27')][_0x2da6('0x28')]);return _0x5c52c4(_0x307735[_0x2da6('0x27')][_0x2da6('0x28')]);}else{logger[_0x2da6('0x21')](_0x2da6('0x22'),_0x4abb41,'request\x20sent');_0x5c52c4(_0x307735['result'][_0x2da6('0x28')]);}})['catch'](function(_0x2a2957){logger[_0x2da6('0x27')](_0x2da6('0x22'),_0x4abb41,_0x2a2957);_0xbe2006(_0x2a2957);});});}function respondWithStatusCode(_0x4b7c97,_0x10e86d){_0x10e86d=_0x10e86d||0xcc;return function(_0x1b346a){if(_0x1b346a){return _0x4b7c97[_0x2da6('0x29')](_0x10e86d);}return _0x4b7c97[_0x2da6('0x2a')](_0x10e86d)[_0x2da6('0x2b')]();};}function respondWithResult(_0x5d93a2,_0x1a3806){_0x1a3806=_0x1a3806||0xc8;return function(_0x473c8c){if(_0x473c8c){return _0x5d93a2[_0x2da6('0x2a')](_0x1a3806)[_0x2da6('0x2c')](_0x473c8c);}};}function respondWithFilteredResult(_0x4792e9,_0x5f5ad7){return function(_0x889246){if(_0x889246){var _0x2b09c7=typeof _0x5f5ad7[_0x2da6('0x2d')]===_0x2da6('0x2e')&&typeof _0x5f5ad7[_0x2da6('0x2f')]===_0x2da6('0x2e');var _0x1c2a13=_0x889246['count'];var _0x15a20b=_0x2b09c7?0x0:_0x5f5ad7[_0x2da6('0x2d')];var _0x475702=_0x2b09c7?_0x889246['count']:_0x5f5ad7[_0x2da6('0x2d')]+_0x5f5ad7[_0x2da6('0x2f')];var _0x520689;if(_0x475702>=_0x1c2a13){_0x475702=_0x1c2a13;_0x520689=0xc8;}else{_0x520689=0xce;}_0x4792e9[_0x2da6('0x2a')](_0x520689);return _0x4792e9[_0x2da6('0x30')](_0x2da6('0x31'),_0x15a20b+'-'+_0x475702+'/'+_0x1c2a13)[_0x2da6('0x2c')](_0x889246);}return null;};}function patchUpdates(_0x25cd9f){return function(_0x22831f){try{jsonpatch['apply'](_0x22831f,_0x25cd9f,!![]);}catch(_0x19c20e){return BPromise[_0x2da6('0x32')](_0x19c20e);}return _0x22831f[_0x2da6('0x33')]();};}function saveUpdates(_0x6892f6,_0x1e4fd4){return function(_0x3b880b){if(_0x3b880b){return _0x3b880b[_0x2da6('0x34')](_0x6892f6)[_0x2da6('0x20')](function(_0x4733fb){return _0x4733fb;});}return null;};}function removeEntity(_0x34fde8,_0x3f2f52){return function(_0xcbbac){if(_0xcbbac){return _0xcbbac['destroy']()[_0x2da6('0x20')](function(){var _0x3995c8=_0xcbbac[_0x2da6('0x35')]({'plain':!![]});var _0x42322e=_0x2da6('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x42322e,'resourceId':_0x3995c8['id']}})[_0x2da6('0x20')](function(){return _0xcbbac;});})[_0x2da6('0x20')](function(){_0x34fde8[_0x2da6('0x2a')](0xcc)[_0x2da6('0x2b')]();});}};}function handleEntityNotFound(_0x21348d,_0x95778f){return function(_0x43397b){if(!_0x43397b){_0x21348d['sendStatus'](0x194);}return _0x43397b;};}function handleError(_0x49c67b,_0x555c26){_0x555c26=_0x555c26||0x1f4;return function(_0x524ab3){logger['error'](_0x524ab3[_0x2da6('0x37')]);if(_0x524ab3[_0x2da6('0x38')]){delete _0x524ab3[_0x2da6('0x38')];}_0x49c67b[_0x2da6('0x2a')](_0x555c26)[_0x2da6('0x39')](_0x524ab3);};}exports[_0x2da6('0x3a')]=function(_0x7ef0c6,_0x2ff0ac){var _0x213cb6={'include':[{'model':db['Pause'],'as':_0x2da6('0x3b')}]},_0x322489={},_0x128aed={'count':0x0,'rows':[]};var _0x184bc2=_[_0x2da6('0x3c')](db['WhatsappAccount'][_0x2da6('0x3d')],function(_0x773eee){return{'name':_0x773eee['fieldName'],'type':_0x773eee['type'][_0x2da6('0x3e')]};});_0x322489['model']=_[_0x2da6('0x3c')](_0x184bc2,_0x2da6('0x38'));_0x322489[_0x2da6('0x3f')]=_['keys'](_0x7ef0c6['query']);_0x322489['filters']=_[_0x2da6('0x40')](_0x322489[_0x2da6('0x41')],_0x322489[_0x2da6('0x3f')]);_0x213cb6[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x322489['model'],qs[_0x2da6('0x43')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x213cb6['attributes']=_0x213cb6[_0x2da6('0x42')][_0x2da6('0x44')]?_0x213cb6[_0x2da6('0x42')]:_0x322489[_0x2da6('0x41')];if(!_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x213cb6[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x213cb6[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x7ef0c6[_0x2da6('0x3f')]['offset']);}_0x213cb6[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x48')]);_0x213cb6['where']=qs[_0x2da6('0x49')](_[_0x2da6('0x4a')](_0x7ef0c6[_0x2da6('0x3f')],_0x322489[_0x2da6('0x49')]),_0x184bc2);if(_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x213cb6[_0x2da6('0x4c')]=_['merge'](_0x213cb6[_0x2da6('0x4c')],{'$or':_['map'](_0x184bc2,function(_0x28392c){if(_0x28392c[_0x2da6('0x4d')]!==_0x2da6('0x4e')){var _0x578209={};_0x578209[_0x28392c[_0x2da6('0x38')]]={'$like':'%'+_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x578209;}})});}_0x213cb6=_[_0x2da6('0x4f')]({},_0x213cb6,_0x7ef0c6[_0x2da6('0x50')]);var _0x3e8577={'where':_0x213cb6[_0x2da6('0x4c')]};return db['WhatsappAccount'][_0x2da6('0x51')](_0x3e8577)[_0x2da6('0x20')](function(_0x23176e){_0x128aed[_0x2da6('0x51')]=_0x23176e;if(_0x7ef0c6[_0x2da6('0x3f')]['includeAll']){_0x213cb6[_0x2da6('0x52')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x2da6('0x53')](_0x213cb6);})[_0x2da6('0x20')](function(_0x3ff468){_0x128aed['rows']=_0x3ff468;return _0x128aed;})[_0x2da6('0x20')](respondWithFilteredResult(_0x2ff0ac,_0x213cb6))[_0x2da6('0x54')](handleError(_0x2ff0ac,null));};exports[_0x2da6('0x55')]=function(_0x307580,_0x1cfcbd){var _0x4356e9={'raw':![],'where':{'id':_0x307580[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x57')],'as':_0x2da6('0x3b')}]},_0x25acc3={};_0x25acc3[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x59')]['rawAttributes']);_0x25acc3[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x307580['query']);_0x25acc3[_0x2da6('0x49')]=_['intersection'](_0x25acc3[_0x2da6('0x41')],_0x25acc3['query']);_0x4356e9[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x25acc3[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x307580['query']['fields']));_0x4356e9[_0x2da6('0x42')]=_0x4356e9[_0x2da6('0x42')][_0x2da6('0x44')]?_0x4356e9[_0x2da6('0x42')]:_0x25acc3['model'];if(_0x307580[_0x2da6('0x3f')][_0x2da6('0x5a')]){_0x4356e9['include']=[{'all':!![]}];}_0x4356e9=_['merge']({},_0x4356e9,_0x307580['options']);return db[_0x2da6('0x59')][_0x2da6('0x5b')](_0x4356e9)[_0x2da6('0x20')](handleEntityNotFound(_0x1cfcbd,null))[_0x2da6('0x20')](respondWithResult(_0x1cfcbd,null))[_0x2da6('0x54')](handleError(_0x1cfcbd,null));};exports[_0x2da6('0x5c')]=function(_0x1c6097,_0xbe78aa){return db[_0x2da6('0x59')]['create'](_0x1c6097[_0x2da6('0x5d')],{})['then'](function(_0x641610){var _0xf3ed49=_0x1c6097[_0x2da6('0x5e')]['get']({'plain':!![]});if(!_0xf3ed49)throw new Error(_0x2da6('0x5f'));if(_0xf3ed49[_0x2da6('0x60')]===_0x2da6('0x5e')){var _0x443289=_0x641610['get']({'plain':!![]});var _0xc023c9=_0x2da6('0x36');return db[_0x2da6('0x61')][_0x2da6('0x5b')]({'where':{'name':_0xc023c9,'userProfileId':_0xf3ed49['userProfileId']},'raw':!![]})['then'](function(_0x2318e9){if(_0x2318e9&&_0x2318e9['autoAssociation']===0x0){return db[_0x2da6('0x62')][_0x2da6('0x5c')]({'name':_0x443289[_0x2da6('0x38')],'resourceId':_0x443289['id'],'type':_0x2318e9[_0x2da6('0x38')],'sectionId':_0x2318e9['id']},{})[_0x2da6('0x20')](function(){return _0x641610;});}else{return _0x641610;}})[_0x2da6('0x54')](function(_0x5a5471){logger[_0x2da6('0x27')](_0x2da6('0x63'),_0x5a5471);throw _0x5a5471;});}return _0x641610;})[_0x2da6('0x20')](respondWithResult(_0xbe78aa,0xc9))[_0x2da6('0x54')](handleError(_0xbe78aa,null));};exports[_0x2da6('0x34')]=function(_0x2bd2a7,_0x1daa70){if(_0x2bd2a7[_0x2da6('0x5d')]['id']){delete _0x2bd2a7[_0x2da6('0x5d')]['id'];}return db[_0x2da6('0x59')]['find']({'where':{'id':_0x2bd2a7[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x57')],'as':_0x2da6('0x3b')}]})['then'](handleEntityNotFound(_0x1daa70,null))[_0x2da6('0x20')](saveUpdates(_0x2bd2a7[_0x2da6('0x5d')],null))[_0x2da6('0x20')](respondWithResult(_0x1daa70,null))[_0x2da6('0x54')](handleError(_0x1daa70,null));};exports[_0x2da6('0x64')]=function(_0x5e7c80,_0x12b45a){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x5e7c80['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x12b45a,null))['then'](removeEntity(_0x12b45a,null))[_0x2da6('0x54')](handleError(_0x12b45a,null));};exports[_0x2da6('0x65')]=function(_0x47859d,_0x10d77f){return db[_0x2da6('0x59')]['describe']()['then'](respondWithResult(_0x10d77f,null))[_0x2da6('0x54')](handleError(_0x10d77f,null));};exports[_0x2da6('0x66')]=function(_0x56744a,_0x3c3038,_0x9cdc94){if(_0x56744a[_0x2da6('0x5d')]['id']){delete _0x56744a[_0x2da6('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x56744a[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3c3038,null))['then'](function(_0x2c5db1){if(_0x2c5db1){_0x56744a['body'][_0x2da6('0x67')]=_0x2c5db1['id'];return db[_0x2da6('0x68')][_0x2da6('0x5c')](_0x56744a[_0x2da6('0x5d')]);}})[_0x2da6('0x20')](respondWithResult(_0x3c3038,null))[_0x2da6('0x54')](handleError(_0x3c3038,null));};exports[_0x2da6('0x69')]=function(_0x5175a9,_0x295902,_0x3779c6){var _0x962fa4={'raw':![],'where':{}};var _0x3e207a={};var _0x42da90={'count':0x0,'rows':[]};return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x5175a9['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x295902,null))[_0x2da6('0x20')](function(_0x2f8503){if(_0x2f8503){_0x3e207a[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x68')]['rawAttributes']);_0x3e207a['query']=_[_0x2da6('0x58')](_0x5175a9['query']);_0x3e207a['filters']=_[_0x2da6('0x40')](_0x3e207a[_0x2da6('0x41')],_0x3e207a['query']);_0x962fa4[_0x2da6('0x42')]=_['intersection'](_0x3e207a[_0x2da6('0x41')],qs['fields'](_0x5175a9['query'][_0x2da6('0x43')]));_0x962fa4[_0x2da6('0x42')]=_0x962fa4[_0x2da6('0x42')][_0x2da6('0x44')]?_0x962fa4['attributes']:_0x3e207a[_0x2da6('0x41')];if(!_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x45')]('nolimit')){_0x962fa4['limit']=qs[_0x2da6('0x2f')](_0x5175a9[_0x2da6('0x3f')]['limit']);_0x962fa4[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x5175a9['query'][_0x2da6('0x2d')]);}_0x962fa4[_0x2da6('0x47')]=qs['sort'](_0x5175a9['query'][_0x2da6('0x48')]);_0x962fa4['where']=qs[_0x2da6('0x49')](_['pick'](_0x5175a9[_0x2da6('0x3f')],_0x3e207a[_0x2da6('0x49')]));_0x962fa4[_0x2da6('0x4c')][_0x2da6('0x67')]=_0x2f8503['id'];if(_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x962fa4['where']=_[_0x2da6('0x4f')](_0x962fa4['where'],{'$or':_[_0x2da6('0x3c')](_0x962fa4[_0x2da6('0x42')],function(_0x3b6916){var _0x30b565={};_0x30b565[_0x3b6916]={'$like':'%'+_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x30b565;})});}_0x962fa4=_['merge']({},_0x962fa4,_0x5175a9[_0x2da6('0x50')]);return db['Disposition'][_0x2da6('0x51')]({'where':_0x962fa4['where']})['then'](function(_0x5a1fda){_0x42da90['count']=_0x5a1fda;if(_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x5a')]){_0x962fa4[_0x2da6('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x2da6('0x53')](_0x962fa4);})['then'](function(_0x317381){_0x42da90[_0x2da6('0x6b')]=_0x317381;return _0x42da90;});}})[_0x2da6('0x20')](respondWithFilteredResult(_0x295902,_0x962fa4))[_0x2da6('0x54')](handleError(_0x295902,null));};exports[_0x2da6('0x6c')]=function(_0x44c30b,_0x9e40ff,_0x6475d1){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x44c30b[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x9e40ff,null))[_0x2da6('0x20')](function(_0x45323f){if(_0x45323f){return _0x45323f[_0x2da6('0x6c')](_0x44c30b[_0x2da6('0x3f')]['ids']);}})[_0x2da6('0x20')](respondWithStatusCode(_0x9e40ff,null))[_0x2da6('0x54')](handleError(_0x9e40ff,null));};exports[_0x2da6('0x6d')]=function(_0x195070,_0x5bd121,_0x113241){if(_0x195070['body']['id']){delete _0x195070[_0x2da6('0x5d')]['id'];}return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x195070['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x5bd121,null))['then'](function(_0x461056){if(_0x461056){_0x195070[_0x2da6('0x5d')][_0x2da6('0x67')]=_0x461056['id'];return db[_0x2da6('0x6e')][_0x2da6('0x5c')](_0x195070[_0x2da6('0x5d')]);}})['then'](respondWithResult(_0x5bd121,null))['catch'](handleError(_0x5bd121,null));};exports['getAnswers']=function(_0x10d2b2,_0x402157,_0x28c233){var _0x2a9e33={'raw':![],'where':{}};var _0x4a8ae0={};var _0x4f3c04={'count':0x0,'rows':[]};return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x10d2b2[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x402157,null))[_0x2da6('0x20')](function(_0xf458ee){if(_0xf458ee){_0x4a8ae0['model']=_[_0x2da6('0x58')](db[_0x2da6('0x6e')][_0x2da6('0x3d')]);_0x4a8ae0['query']=_[_0x2da6('0x58')](_0x10d2b2[_0x2da6('0x3f')]);_0x4a8ae0[_0x2da6('0x49')]=_[_0x2da6('0x40')](_0x4a8ae0[_0x2da6('0x41')],_0x4a8ae0[_0x2da6('0x3f')]);_0x2a9e33[_0x2da6('0x42')]=_['intersection'](_0x4a8ae0[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x10d2b2[_0x2da6('0x3f')]['fields']));_0x2a9e33[_0x2da6('0x42')]=_0x2a9e33['attributes'][_0x2da6('0x44')]?_0x2a9e33[_0x2da6('0x42')]:_0x4a8ae0[_0x2da6('0x41')];if(!_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x2a9e33[_0x2da6('0x2f')]=qs['limit'](_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x2a9e33['offset']=qs['offset'](_0x10d2b2['query'][_0x2da6('0x2d')]);}_0x2a9e33[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x48')]);_0x2a9e33['where']=qs['filters'](_['pick'](_0x10d2b2['query'],_0x4a8ae0[_0x2da6('0x49')]));_0x2a9e33['where']['WhatsappAccountId']=_0xf458ee['id'];if(_0x10d2b2[_0x2da6('0x3f')]['filter']){_0x2a9e33[_0x2da6('0x4c')]=_[_0x2da6('0x4f')](_0x2a9e33['where'],{'$or':_[_0x2da6('0x3c')](_0x2a9e33[_0x2da6('0x42')],function(_0x5818c7){var _0x5efb55={};_0x5efb55[_0x5818c7]={'$like':'%'+_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x5efb55;})});}_0x2a9e33=_['merge']({},_0x2a9e33,_0x10d2b2[_0x2da6('0x50')]);return db[_0x2da6('0x6e')][_0x2da6('0x51')]({'where':_0x2a9e33['where']})[_0x2da6('0x20')](function(_0x2a2347){_0x4f3c04['count']=_0x2a2347;if(_0x10d2b2[_0x2da6('0x3f')]['includeAll']){_0x2a9e33['include']=[{'all':!![]}];}return db[_0x2da6('0x6e')][_0x2da6('0x53')](_0x2a9e33);})['then'](function(_0x1fcb65){_0x4f3c04[_0x2da6('0x6b')]=_0x1fcb65;return _0x4f3c04;});}})['then'](respondWithFilteredResult(_0x402157,_0x2a9e33))[_0x2da6('0x54')](handleError(_0x402157,null));};exports['removeAnswers']=function(_0x340f9a,_0xdbecdb,_0x12e39d){return db[_0x2da6('0x59')]['find']({'where':{'id':_0x340f9a[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0xdbecdb,null))[_0x2da6('0x20')](function(_0xbda1a9){if(_0xbda1a9){return _0xbda1a9[_0x2da6('0x6f')](_0x340f9a[_0x2da6('0x3f')]['ids']);}})[_0x2da6('0x20')](respondWithStatusCode(_0xdbecdb,null))['catch'](handleError(_0xdbecdb,null));};exports[_0x2da6('0x70')]=function(_0x1adec2,_0x41d9e0,_0x2aeca4){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x1adec2['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x41d9e0,null))[_0x2da6('0x20')](function(_0x585cb1){if(_0x585cb1){return _0x585cb1['addAgents'](_0x1adec2[_0x2da6('0x5d')][_0x2da6('0x71')],_['omit'](_0x1adec2['body'],[_0x2da6('0x71'),'id'])||{})[_0x2da6('0x72')](function(_0x27a034){for(var _0x53682a=0x0;_0x53682a<_0x1adec2['body'][_0x2da6('0x71')][_0x2da6('0x44')];_0x53682a+=0x1){socket[_0x2da6('0x73')](_0x2da6('0x74'),{'UserId':Number(_0x1adec2[_0x2da6('0x5d')]['ids'][_0x53682a]),'WhatsappAccountId':Number(_0x1adec2['params']['id'])});}return _0x27a034;});}})['then'](respondWithResult(_0x41d9e0,null))[_0x2da6('0x54')](handleError(_0x41d9e0,null));};exports['removeAgents']=function(_0xdd89f2,_0x1dcc97,_0x5803f9){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0xdd89f2[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x1dcc97,null))[_0x2da6('0x20')](function(_0x333617){if(_0x333617){return _0x333617[_0x2da6('0x75')](_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')])[_0x2da6('0x20')](function(){if(_['isArray'](_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')])){for(var _0x32388a=0x0;_0x32388a<_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')][_0x2da6('0x44')];_0x32388a+=0x1){socket[_0x2da6('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0xdd89f2['query'][_0x2da6('0x71')][_0x32388a]),'WhatsappAccountId':Number(_0xdd89f2[_0x2da6('0x56')]['id'])});}}else{socket[_0x2da6('0x73')](_0x2da6('0x76'),{'UserId':Number(_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')]),'WhatsappAccountId':Number(_0xdd89f2[_0x2da6('0x56')]['id'])});}});}})[_0x2da6('0x20')](respondWithStatusCode(_0x1dcc97,null))[_0x2da6('0x54')](handleError(_0x1dcc97,null));};exports[_0x2da6('0x77')]=function(_0x654e,_0x3d032e,_0x3344ae){var _0x3a4bcd={};var _0x5281ef={};var _0x32e217;var _0x4cc6a5;return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x654e['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3d032e,null))[_0x2da6('0x20')](function(_0x5a2f03){if(_0x5a2f03){_0x32e217=_0x5a2f03;_0x5281ef[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x78')][_0x2da6('0x3d')]);_0x5281ef[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x654e[_0x2da6('0x3f')]);_0x5281ef[_0x2da6('0x49')]=_[_0x2da6('0x40')](_0x5281ef['model'],_0x5281ef[_0x2da6('0x3f')]);_0x3a4bcd[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x5281ef[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x654e[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x3a4bcd[_0x2da6('0x42')]=_0x3a4bcd[_0x2da6('0x42')]['length']?_0x3a4bcd[_0x2da6('0x42')]:_0x5281ef['model'];_0x3a4bcd[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x654e['query']['sort']);_0x3a4bcd[_0x2da6('0x4c')]=qs[_0x2da6('0x49')](_['pick'](_0x654e['query'],_0x5281ef[_0x2da6('0x49')]));if(_0x654e[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x3a4bcd[_0x2da6('0x4c')]=_[_0x2da6('0x4f')](_0x3a4bcd[_0x2da6('0x4c')],{'$or':_[_0x2da6('0x3c')](_0x3a4bcd[_0x2da6('0x42')],function(_0x4fce2a){var _0x5b7b6c={};_0x5b7b6c[_0x4fce2a]={'$like':'%'+_0x654e[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x5b7b6c;})});}_0x3a4bcd=_['merge']({},_0x3a4bcd,_0x654e[_0x2da6('0x50')]);return _0x32e217[_0x2da6('0x77')](_0x3a4bcd);}})[_0x2da6('0x20')](function(_0x2e54fe){if(_0x2e54fe){_0x4cc6a5=_0x2e54fe[_0x2da6('0x44')];if(!_0x654e[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x3a4bcd[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x654e[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x3a4bcd[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x654e['query'][_0x2da6('0x2d')]);}return _0x32e217[_0x2da6('0x77')](_0x3a4bcd);}})[_0x2da6('0x20')](function(_0xf2b338){if(_0xf2b338){return _0xf2b338?{'count':_0x4cc6a5,'rows':_0xf2b338}:null;}})[_0x2da6('0x20')](respondWithResult(_0x3d032e,null))[_0x2da6('0x54')](handleError(_0x3d032e,null));};exports[_0x2da6('0x79')]=function(_0x33f454,_0x34914c,_0x275f01){return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x33f454[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x34914c,null))[_0x2da6('0x20')](function(_0x49a61a){if(_0x49a61a){return db[_0x2da6('0x7a')][_0x2da6('0x7b')](function(_0x539e73){return db[_0x2da6('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x33f454[_0x2da6('0x56')]['id']},'transaction':_0x539e73})[_0x2da6('0x20')](function(_0x3083ec){var _0x48831a=_[_0x2da6('0x3c')](_0x33f454['body'],function(_0x15c562){_0x15c562[_0x2da6('0x67')]=_0x33f454[_0x2da6('0x56')]['id'];return _0x15c562;});return db['WhatsappApplication'][_0x2da6('0x7d')](_0x48831a,{'transaction':_0x539e73});});})['then'](function(){return db[_0x2da6('0x7c')][_0x2da6('0x7e')]({'where':{'WhatsappAccountId':_0x33f454['params']['id']},'order':_0x2da6('0x7f')});});}})[_0x2da6('0x20')](respondWithResult(_0x34914c,null))[_0x2da6('0x54')](handleError(_0x34914c,null));};exports['getApplications']=function(_0x2e2df4,_0x3a9464,_0x43a95b){var _0x13d41f={};var _0x79aebe={};var _0x52df5f;var _0x3871e6;return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x2e2df4[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3a9464,null))['then'](function(_0x415ee3){if(_0x415ee3){_0x52df5f=_0x415ee3;_0x79aebe['model']=_[_0x2da6('0x58')](db[_0x2da6('0x7c')][_0x2da6('0x3d')]);_0x79aebe[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x2e2df4['query']);_0x79aebe[_0x2da6('0x49')]=_['intersection'](_0x79aebe['model'],_0x79aebe['query']);_0x13d41f['attributes']=_[_0x2da6('0x40')](_0x79aebe[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x13d41f[_0x2da6('0x42')]=_0x13d41f[_0x2da6('0x42')][_0x2da6('0x44')]?_0x13d41f[_0x2da6('0x42')]:_0x79aebe[_0x2da6('0x41')];_0x13d41f[_0x2da6('0x47')]=qs['sort'](_0x2e2df4['query'][_0x2da6('0x48')]);_0x13d41f[_0x2da6('0x4c')]=qs['filters'](_[_0x2da6('0x4a')](_0x2e2df4[_0x2da6('0x3f')],_0x79aebe[_0x2da6('0x49')]));if(_0x2e2df4[_0x2da6('0x3f')]['filter']){_0x13d41f['where']=_[_0x2da6('0x4f')](_0x13d41f['where'],{'$or':_[_0x2da6('0x3c')](_0x13d41f['attributes'],function(_0xd36146){var _0x494a73={};_0x494a73[_0xd36146]={'$like':'%'+_0x2e2df4['query'][_0x2da6('0x4b')]+'%'};return _0x494a73;})});}_0x13d41f=_[_0x2da6('0x4f')]({},_0x13d41f,_0x2e2df4[_0x2da6('0x50')]);return _0x52df5f[_0x2da6('0x80')](_0x13d41f);}})['then'](function(_0x30db85){if(_0x30db85){_0x3871e6=_0x30db85[_0x2da6('0x44')];if(!_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x45')]('nolimit')){_0x13d41f[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x2e2df4['query'][_0x2da6('0x2f')]);_0x13d41f[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x2d')]);}return _0x52df5f[_0x2da6('0x80')](_0x13d41f);}})['then'](function(_0x8c32cf){if(_0x8c32cf){return _0x8c32cf?{'count':_0x3871e6,'rows':_0x8c32cf}:null;}})[_0x2da6('0x20')](respondWithResult(_0x3a9464,null))[_0x2da6('0x54')](handleError(_0x3a9464,null));};exports[_0x2da6('0x81')]=function(_0x4161c2,_0x3bd7a5,_0x18ec4b){var _0x1496d0={'channel':'whatsapp'};var _0x34142e=[];var _0xe53d47=[];var _0x5da3fc={};return db[_0x2da6('0x59')]['find']({'where':{'id':_0x4161c2[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x7c')],'as':_0x2da6('0x82')}]})[_0x2da6('0x20')](handleEntityNotFound(_0x3bd7a5,null))['then'](function(_0x4fe8f4){_0x1496d0[_0x2da6('0x83')]=_0x4fe8f4;_0x1496d0[_0x2da6('0x84')]=_[_0x2da6('0x85')](_0x4fe8f4[_0x2da6('0x82')],[_0x2da6('0x7f')],['asc']);if(_0x1496d0[_0x2da6('0x83')][_0x2da6('0x82')]){delete _0x1496d0[_0x2da6('0x83')]['Applications'];}return db[_0x2da6('0x86')][_0x2da6('0x65')]();})[_0x2da6('0x20')](function(_0x497966){if(!_0x497966){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x89'));}_0x34142e=_[_0x2da6('0x8a')](_[_0x2da6('0x58')](_0x497966),[_0x2da6('0x8b'),_0x2da6('0x8c')]);_0xe53d47=_[_0x2da6('0x8a')](_[_0x2da6('0x58')](_0x497966),[_0x2da6('0x8b'),'updatedAt','CompanyId','ListId']);_0x1496d0[_0x2da6('0x5d')]={'mapKey':'mobile'};if(_0x1496d0['account']['type']&&_0x1496d0[_0x2da6('0x83')][_0x2da6('0x4d')]===_0x2da6('0x8d')){_0x1496d0[_0x2da6('0x5d')]['from']=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x8e')][_0x2da6('0x8f')](_0x2da6('0x90'),'');_0x1496d0[_0x2da6('0x5d')]['body']=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x91')];_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x92')]=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x93')];}if(_0x1496d0[_0x2da6('0x5d')]['id']){delete _0x1496d0[_0x2da6('0x5d')]['id'];}if(_['isNil'](_0x1496d0['body'][_0x2da6('0x94')])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x95'));}if(_[_0x2da6('0x96')](_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x5d')])||_0x1496d0['body'][_0x2da6('0x5d')]===''){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1496d0['body'][_0x2da6('0x97')])){throw new db['Sequelize'][(_0x2da6('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe53d47);}if(!_[_0x2da6('0x98')](_0xe53d47,_0x1496d0[_0x2da6('0x5d')]['mapKey'])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x99')+_0xe53d47);}_0x5da3fc[_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x97')]]=_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')];return db[_0x2da6('0x9a')]['find']({'where':{'id':_0x1496d0[_0x2da6('0x83')][_0x2da6('0x9b')]},'include':[{'model':db[_0x2da6('0x86')],'as':'Contacts','where':_0x5da3fc,'limit':0x1,'order':[[_0x2da6('0x8c'),_0x2da6('0x9c')]]}]});})['then'](handleEntityNotFound(_0x3bd7a5,null))[_0x2da6('0x20')](function(_0x9b4185){if(_0x9b4185){_0x1496d0[_0x2da6('0x9d')]=_[_0x2da6('0x9e')](_0x9b4185,[_0x2da6('0x9f')]);if(_0x9b4185['Contacts'][_0x2da6('0x44')]){return _0x9b4185['Contacts'][0x0];}var _0x10971f=_[_0x2da6('0x18')](_0x1496d0[_0x2da6('0x5d')],{'firstName':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')],'ListId':_0x9b4185['id']});_0x10971f[_0x1496d0[_0x2da6('0x5d')]['mapKey']]=_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')];return db[_0x2da6('0x86')][_0x2da6('0x5c')](_0x10971f,{'fields':_0x34142e,'raw':!![]});}})[_0x2da6('0x20')](handleEntityNotFound(_0x3bd7a5,null))[_0x2da6('0x20')](function(_0x1d8595){if(_0x1d8595){_0x1496d0[_0x2da6('0xa0')]=_0x1d8595;var _0xe5d8e={'ContactId':_0x1d8595['id'],'phone':_0x1496d0['body'][_0x2da6('0x94')],'WhatsappAccountId':_0x4161c2[_0x2da6('0x56')]['id']};var _0x463b71={'ContactId':_0x1d8595['id'],'WhatsappAccountId':_0x4161c2[_0x2da6('0x56')]['id'],'closed':![]};return db[_0x2da6('0xa1')]['find']({'where':_0x463b71})[_0x2da6('0x20')](function(_0x263c1f){if(_0x263c1f){return[_0x263c1f,![]];}return db['WhatsappInteraction'][_0x2da6('0x5c')](_0xe5d8e)['then'](function(_0x3b6a3f){return[_0x3b6a3f,!![]];});});}})['spread'](function(_0x43f3c9,_0x4719e2){_0x1496d0[_0x2da6('0xa2')]=_0x43f3c9[_0x2da6('0x35')]({'plain':!![]});_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xa3')]=![];if(_0x4719e2){if(_0x1496d0[_0x2da6('0x83')][_0x2da6('0xa4')]){_0x1496d0[_0x2da6('0x84')][_0x2da6('0xa5')]({'id':0x0,'priority':_0x1496d0[_0x2da6('0x84')][_0x2da6('0x44')]+0x1,'app':_0x2da6('0xa6'),'appdata':_0x2da6('0xa7'),'interval':_0x2da6('0xa8')});}_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xa3')]=!![];}return db['WhatsappMessage'][_0x2da6('0x5c')]({'phone':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')],'messageId':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x92')],'body':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x5d')],'WhatsappAccountId':_0x4161c2['params']['id'],'WhatsappInteractionId':_0x43f3c9['id'],'direction':'in','ContactId':_0x43f3c9['ContactId'],'AttachmentId':_0x1496d0['body'][_0x2da6('0xa9')]});})['then'](function(_0x10dc78){_0x1496d0[_0x2da6('0x28')]=_0x10dc78;if(_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xaa')]){return db[_0x2da6('0x78')][_0x2da6('0x5b')]({'attributes':['id','name'],'where':{'id':_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xaa')]}})[_0x2da6('0x20')](function(_0x5f3560){if(_0x5f3560){_0x1496d0[_0x2da6('0x84')][_0x2da6('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f3560['name']+','+(_0x1496d0[_0x2da6('0x83')][_0x2da6('0xac')]||0xa),'interval':_0x2da6('0xa8')});}return respondWithRpcPromise(_0x2da6('0xad'),_0x2da6('0xae'),_0x1496d0);});}return respondWithRpcPromise(_0x2da6('0xad'),_0x2da6('0xae'),_0x1496d0);})[_0x2da6('0x20')](function(_0x3a700a){if(_0x3a700a){var _0x5a7285=0xc8;var _0x187e67='receiveMessage';logger[_0x2da6('0x21')](_0x2da6('0x25'),_0x187e67,_0x5a7285,_0x2da6('0xaf'));logger['debug'](_0x2da6('0xb0'),_0x187e67,_0x5a7285,_0x2da6('0xaf'),JSON[_0x2da6('0x26')](_0x3a700a));if(_0x1496d0['account'][_0x2da6('0x4d')]===_0x2da6('0x8d')){return _0x3bd7a5[_0x2da6('0x2a')](_0x5a7285)[_0x2da6('0x30')](_0x2da6('0xb1'),_0x2da6('0xb2'))[_0x2da6('0x39')]('\x0a');}else{return _0x3bd7a5[_0x2da6('0x2a')](_0x5a7285)[_0x2da6('0x2c')](_0x3a700a);}}})['catch'](handleError(_0x3bd7a5,null));};exports[_0x2da6('0x39')]=function(_0x401b57,_0x33475b,_0x509025){var _0x19a48f,_0x4602bd,_0x29f730;if(_[_0x2da6('0x96')](_0x401b57['body'][_0x2da6('0x5d')])||_0x401b57[_0x2da6('0x5d')][_0x2da6('0x5d')]===''){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2da6('0x96')](_0x401b57[_0x2da6('0x5d')]['to'])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0xb3'));}_0x19a48f=_0x401b57[_0x2da6('0x5d')]['to'];return db['WhatsappAccount'][_0x2da6('0x5b')]({'where':{'id':_0x401b57[_0x2da6('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x2da6('0xb4'),'include':[{'model':db[_0x2da6('0x86')],'as':_0x2da6('0x9f'),'where':{'mobile':_0x19a48f},'limit':0x1,'order':[['updatedAt',_0x2da6('0x9c')]]}]}]})[_0x2da6('0x20')](handleEntityNotFound(_0x33475b,null))[_0x2da6('0x20')](function(_0x6f7824){if(_0x6f7824&&_0x6f7824['List']){_0x4602bd=_0x6f7824[_0x2da6('0x35')]({'plain':!![]});if(_0x4602bd[_0x2da6('0xb4')]&&_0x4602bd[_0x2da6('0xb4')][_0x2da6('0x9f')]['length']){return _0x4602bd[_0x2da6('0xb4')][_0x2da6('0x9f')][0x0];}return db[_0x2da6('0x86')][_0x2da6('0x5c')](_[_0x2da6('0x18')](_0x401b57[_0x2da6('0x5d')],{'firstName':_0x19a48f,'mobile':_0x19a48f,'phone':_0x19a48f,'ListId':_0x4602bd[_0x2da6('0x9b')]}));}})[_0x2da6('0x20')](handleEntityNotFound(_0x33475b,null))[_0x2da6('0x20')](function(_0x5507b8){if(_0x5507b8){_0x29f730=_0x5507b8;return db[_0x2da6('0xa1')][_0x2da6('0x5b')]({'where':{'ContactId':_0x29f730['id'],'closed':![],'WhatsappAccountId':_0x4602bd['id']}})[_0x2da6('0x20')](function(_0x58a6cd){if(_0x58a6cd){return[_0x58a6cd,![]];}return db[_0x2da6('0xa1')][_0x2da6('0x5c')]({'UserId':_0x401b57[_0x2da6('0x5e')]['id'],'ContactId':_0x29f730['id'],'WhatsappAccountId':_0x4602bd['id'],'phone':_0x19a48f,'firstMsgDirection':_0x2da6('0xb5'),'Messages':[_[_0x2da6('0x4f')](_0x401b57[_0x2da6('0x5d')],{'read':![],'body':_0x401b57[_0x2da6('0x5d')][_0x2da6('0x5d')],'phone':_0x19a48f,'WhatsappAccountId':_0x4602bd['id'],'UserId':_0x401b57[_0x2da6('0x5e')]['id'],'ContactId':_0x29f730['id']})]},{'include':[{'model':db[_0x2da6('0xb6')],'as':'Messages'}]})[_0x2da6('0x20')](function(_0x1967d3){return[_0x1967d3,!![]];});});}})[_0x2da6('0x72')](function(_0x5e634e,_0x12ab31){if(_0x12ab31){return _0x5e634e;}return db[_0x2da6('0xb6')][_0x2da6('0x5c')](_[_0x2da6('0x4f')](_0x401b57['body'],{'read':![],'body':_0x401b57[_0x2da6('0x5d')]['body'],'phone':_0x19a48f,'WhatsappAccountId':_0x4602bd['id'],'WhatsappInteractionId':_0x5e634e['id'],'UserId':_0x401b57['user']['id'],'ContactId':_0x29f730['id']}))['then'](function(_0x17182c){_0x5e634e[_0x2da6('0xb7')][_0x2da6('0xb8')]=[];_0x5e634e[_0x2da6('0xb7')][_0x2da6('0xb8')][_0x2da6('0xa5')](_0x17182c[_0x2da6('0xb7')]);return _0x5e634e;});})[_0x2da6('0x20')](respondWithResult(_0x33475b,null))[_0x2da6('0x54')](handleError(_0x33475b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 2f0d95c..8851882 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 _0xa79e=['emit','hasOwnProperty','../../mysqldb','setMaxListeners','save','update'];(function(_0x38a8ed,_0x24a2c4){var _0x3d7d2b=function(_0x587966){while(--_0x587966){_0x38a8ed['push'](_0x38a8ed['shift']());}};_0x3d7d2b(++_0x24a2c4);}(_0xa79e,0x92));var _0xea79=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0xa79e[_0x1b91c7];return _0xbbe014;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xea79('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xea79('0x1')](0x0);var events={'afterCreate':_0xea79('0x2'),'afterUpdate':_0xea79('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3d44a7){return function(_0xb25bcd,_0x258d52,_0x341c71){WhatsappAccountEvents[_0xea79('0x4')](_0x3d44a7+':'+_0xb25bcd['id'],_0xb25bcd);WhatsappAccountEvents['emit'](_0x3d44a7,_0xb25bcd);_0x341c71(null);};}for(var e in events){if(events[_0xea79('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xf51e=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x32abb9,_0x5f0d36){var _0xbaa5f5=function(_0x52670e){while(--_0x52670e){_0x32abb9['push'](_0x32abb9['shift']());}};_0xbaa5f5(++_0x5f0d36);}(_0xf51e,0x1c8));var _0xef51=function(_0x4f3f9,_0x3bd41f){_0x4f3f9=_0x4f3f9-0x0;var _0x3eb034=_0xf51e[_0x4f3f9];return _0x3eb034;};'use strict';var EventEmitter=require(_0xef51('0x0'));var WhatsappAccount=require(_0xef51('0x1'))['db'][_0xef51('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xef51('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef51('0x4'),'afterDestroy':_0xef51('0x5')};function emitEvent(_0x59772c){return function(_0x3a169e,_0x51d94c,_0x5ab1e6){WhatsappAccountEvents[_0xef51('0x6')](_0x59772c+':'+_0x3a169e['id'],_0x3a169e);WhatsappAccountEvents[_0xef51('0x6')](_0x59772c,_0x3a169e);_0x5ab1e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xef51('0x7')](e,emitEvent(event));}}module[_0xef51('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 656316e..58a046e 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 _0xcadc=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x44db8e,_0x143b54){var _0x40667a=function(_0x618866){while(--_0x618866){_0x44db8e['push'](_0x44db8e['shift']());}};_0x40667a(++_0x143b54);}(_0xcadc,0xe9));var _0xccad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcadc[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xccad('0x0'));var util=require('util');var logger=require(_0xccad('0x1'))(_0xccad('0x2'));var moment=require(_0xccad('0x3'));var BPromise=require(_0xccad('0x4'));var rp=require(_0xccad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xccad('0x6'));var attributes=require(_0xccad('0x7'));module[_0xccad('0x8')]=function(_0x394198,_0x1670df){return _0x394198[_0xccad('0x9')](_0xccad('0xa'),attributes,{'tableName':_0xccad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0358=['whatsapp_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount'];(function(_0x3d3378,_0x5ced43){var _0x1f2276=function(_0xcfcf4b){while(--_0xcfcf4b){_0x3d3378['push'](_0x3d3378['shift']());}};_0x1f2276(++_0x5ced43);}(_0x0358,0x1ef));var _0x8035=function(_0x1d8dd6,_0x38f846){_0x1d8dd6=_0x1d8dd6-0x0;var _0x9da036=_0x0358[_0x1d8dd6];return _0x9da036;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8035('0x0'))(_0x8035('0x1'));var moment=require(_0x8035('0x2'));var BPromise=require(_0x8035('0x3'));var rp=require(_0x8035('0x4'));var fs=require('fs');var path=require(_0x8035('0x5'));var rimraf=require(_0x8035('0x6'));var config=require(_0x8035('0x7'));var attributes=require(_0x8035('0x8'));module[_0x8035('0x9')]=function(_0x30b801,_0x4b0df5){return _0x30b801[_0x8035('0xa')](_0x8035('0xb'),attributes,{'tableName':_0x8035('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 6056b19..b676719 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 _0xc7f4=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowWhatsappAccount','options','raw','attributes','include','model','map','moment','bluebird'];(function(_0x1496fa,_0x4b2adc){var _0x2cd16a=function(_0x490ee1){while(--_0x490ee1){_0x1496fa['push'](_0x1496fa['shift']());}};_0x2cd16a(++_0x4b2adc);}(_0xc7f4,0x10e));var _0x4c7f=function(_0x28ed73,_0x5eb44a){_0x28ed73=_0x28ed73-0x0;var _0x347378=_0xc7f4[_0x28ed73];return _0x347378;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c7f('0x0'));var BPromise=require(_0x4c7f('0x1'));var rs=require(_0x4c7f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c7f('0x3'))['db'];var utils=require(_0x4c7f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c7f('0x5'));var jayson=require(_0x4c7f('0x6'));var client=jayson[_0x4c7f('0x7')][_0x4c7f('0x8')]({'port':0x232a});config['redis']=_[_0x4c7f('0x9')](config[_0x4c7f('0xa')],{'host':_0x4c7f('0xb'),'port':0x18eb});var socket=require(_0x4c7f('0xc'))(new Redis(config[_0x4c7f('0xa')]));require(_0x4c7f('0xd'))[_0x4c7f('0xe')](socket);function respondWithRpcPromise(_0x23c67a,_0x2c57d6,_0x518ec8){return new BPromise(function(_0x2500a9,_0x41780f){return client[_0x4c7f('0xf')](_0x23c67a,_0x518ec8)[_0x4c7f('0x10')](function(_0xda3ce4){logger['info'](_0x4c7f('0x11'),_0x2c57d6,_0x4c7f('0x12'));logger[_0x4c7f('0x13')](_0x4c7f('0x14'),_0x2c57d6,'request\x20sent',JSON[_0x4c7f('0x15')](_0xda3ce4));if(_0xda3ce4[_0x4c7f('0x16')]){if(_0xda3ce4[_0x4c7f('0x16')]['code']===0x1f4){logger['error'](_0x4c7f('0x11'),_0x2c57d6,_0xda3ce4[_0x4c7f('0x16')][_0x4c7f('0x17')]);return _0x41780f(_0xda3ce4[_0x4c7f('0x16')][_0x4c7f('0x17')]);}logger[_0x4c7f('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x2c57d6,_0xda3ce4['error']['message']);return _0x2500a9(_0xda3ce4['error'][_0x4c7f('0x17')]);}else{logger[_0x4c7f('0x18')](_0x4c7f('0x11'),_0x2c57d6,'request\x20sent');_0x2500a9(_0xda3ce4[_0x4c7f('0x19')][_0x4c7f('0x17')]);}})[_0x4c7f('0x1a')](function(_0x44f225){logger[_0x4c7f('0x16')](_0x4c7f('0x11'),_0x2c57d6,_0x44f225);_0x41780f(_0x44f225);});});}exports[_0x4c7f('0x1b')]=function(_0x5070b0){var _0x15e557=this;return new Promise(function(_0x30522d,_0x5d5965){return db['WhatsappAccount']['find']({'raw':_0x5070b0[_0x4c7f('0x1c')]?_0x5070b0['options'][_0x4c7f('0x1d')]===undefined?!![]:![]:!![],'where':_0x5070b0[_0x4c7f('0x1c')]?_0x5070b0[_0x4c7f('0x1c')]['where']||null:null,'attributes':_0x5070b0['options']?_0x5070b0[_0x4c7f('0x1c')][_0x4c7f('0x1e')]||null:null,'include':_0x5070b0[_0x4c7f('0x1c')]?_0x5070b0['options'][_0x4c7f('0x1f')]?_['map'](_0x5070b0[_0x4c7f('0x1c')]['include'],function(_0x4437a6){return{'model':db[_0x4437a6[_0x4c7f('0x20')]],'as':_0x4437a6['as'],'attributes':_0x4437a6['attributes'],'include':_0x4437a6[_0x4c7f('0x1f')]?_[_0x4c7f('0x21')](_0x4437a6[_0x4c7f('0x1f')],function(_0x544fdd){return{'model':db[_0x544fdd[_0x4c7f('0x20')]],'as':_0x544fdd['as'],'attributes':_0x544fdd[_0x4c7f('0x1e')],'include':_0x544fdd[_0x4c7f('0x1f')]?_[_0x4c7f('0x21')](_0x544fdd[_0x4c7f('0x1f')],function(_0x3af8b5){return{'model':db[_0x3af8b5['model']],'as':_0x3af8b5['as'],'attributes':_0x3af8b5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c7f('0x10')](function(_0x4974fd){logger[_0x4c7f('0x18')](_0x4c7f('0x1b'),_0x5070b0);logger[_0x4c7f('0x13')](_0x4c7f('0x1b'),_0x5070b0,JSON[_0x4c7f('0x15')](_0x4974fd));_0x30522d(_0x4974fd);})[_0x4c7f('0x1a')](function(_0x25e212){logger[_0x4c7f('0x16')](_0x4c7f('0x1b'),_0x25e212[_0x4c7f('0x17')],_0x5070b0);_0x5d5965(_0x15e557[_0x4c7f('0x16')](0x1f4,_0x25e212[_0x4c7f('0x17')]));});});}; \ No newline at end of file +var _0xbc8b=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','WhatsappAccount','raw','options','where','attributes','include','map','model','debug','ShowWhatsappAccount','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc8b,0x1bf));var _0xbbc8=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0xbc8b[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbc8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbc8('0x2'));var logger=require(_0xbbc8('0x3'))(_0xbbc8('0x4'));var config=require('../../config/environment');var jayson=require(_0xbbc8('0x5'));var client=jayson[_0xbbc8('0x6')][_0xbbc8('0x7')]({'port':0x232a});config[_0xbbc8('0x8')]=_[_0xbbc8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbc8('0x8')]));require('./whatsappAccount.socket')[_0xbbc8('0xa')](socket);function respondWithRpcPromise(_0x1d38c2,_0x428323,_0x60b805){return new BPromise(function(_0x4490f5,_0x5c3404){return client[_0xbbc8('0xb')](_0x1d38c2,_0x60b805)[_0xbbc8('0xc')](function(_0x1b06f3){logger[_0xbbc8('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0xbbc8('0xe'));logger['debug'](_0xbbc8('0xf'),_0x428323,_0xbbc8('0xe'),JSON['stringify'](_0x1b06f3));if(_0x1b06f3[_0xbbc8('0x10')]){if(_0x1b06f3[_0xbbc8('0x10')][_0xbbc8('0x11')]===0x1f4){logger[_0xbbc8('0x10')](_0xbbc8('0x12'),_0x428323,_0x1b06f3['error'][_0xbbc8('0x13')]);return _0x5c3404(_0x1b06f3[_0xbbc8('0x10')]['message']);}logger[_0xbbc8('0x10')](_0xbbc8('0x12'),_0x428323,_0x1b06f3[_0xbbc8('0x10')]['message']);return _0x4490f5(_0x1b06f3['error'][_0xbbc8('0x13')]);}else{logger[_0xbbc8('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0xbbc8('0xe'));_0x4490f5(_0x1b06f3[_0xbbc8('0x14')][_0xbbc8('0x13')]);}})['catch'](function(_0x36bea4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0x36bea4);_0x5c3404(_0x36bea4);});});}exports['ShowWhatsappAccount']=function(_0x4f4891){var _0xf654a3=this;return new Promise(function(_0x5af76c,_0x8015b2){return db[_0xbbc8('0x15')]['find']({'raw':_0x4f4891['options']?_0x4f4891['options'][_0xbbc8('0x16')]===undefined?!![]:![]:!![],'where':_0x4f4891[_0xbbc8('0x17')]?_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x18')]||null:null,'attributes':_0x4f4891[_0xbbc8('0x17')]?_0x4f4891['options'][_0xbbc8('0x19')]||null:null,'include':_0x4f4891['options']?_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x1a')]?_[_0xbbc8('0x1b')](_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x1a')],function(_0x4d565f){return{'model':db[_0x4d565f[_0xbbc8('0x1c')]],'as':_0x4d565f['as'],'attributes':_0x4d565f[_0xbbc8('0x19')],'include':_0x4d565f[_0xbbc8('0x1a')]?_[_0xbbc8('0x1b')](_0x4d565f['include'],function(_0x2f8657){return{'model':db[_0x2f8657[_0xbbc8('0x1c')]],'as':_0x2f8657['as'],'attributes':_0x2f8657['attributes'],'include':_0x2f8657[_0xbbc8('0x1a')]?_['map'](_0x2f8657[_0xbbc8('0x1a')],function(_0x3b8996){return{'model':db[_0x3b8996['model']],'as':_0x3b8996['as'],'attributes':_0x3b8996['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d96fb){logger['info']('ShowWhatsappAccount',_0x4f4891);logger[_0xbbc8('0x1d')](_0xbbc8('0x1e'),_0x4f4891,JSON[_0xbbc8('0x1f')](_0x5d96fb));_0x5af76c(_0x5d96fb);})['catch'](function(_0x1af959){logger[_0xbbc8('0x10')](_0xbbc8('0x1e'),_0x1af959['message'],_0x4f4891);_0x8015b2(_0xf654a3[_0xbbc8('0x10')](0x1f4,_0x1af959[_0xbbc8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 915fc6c..6f27d2a 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 _0xf06b=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x32aea3,_0x257428){var _0x2b3174=function(_0x542181){while(--_0x542181){_0x32aea3['push'](_0x32aea3['shift']());}};_0x2b3174(++_0x257428);}(_0xf06b,0xfc));var _0xbf06=function(_0x2bbf15,_0x132e0c){_0x2bbf15=_0x2bbf15-0x0;var _0x3675ed=_0xf06b[_0x2bbf15];return _0x3675ed;};'use strict';var WhatsappAccountEvents=require(_0xbf06('0x0'));var events=[_0xbf06('0x1'),_0xbf06('0x2'),_0xbf06('0x3')];function createListener(_0x54043b,_0x50b14e){return function(_0x3fb189){_0x50b14e['emit'](_0x54043b,_0x3fb189);};}function removeListener(_0x524cce,_0x526868){return function(){WhatsappAccountEvents[_0xbf06('0x4')](_0x524cce,_0x526868);};}exports[_0xbf06('0x5')]=function(_0x3a758d){for(var _0x596a47=0x0,_0x5b1500=events[_0xbf06('0x6')];_0x596a47<_0x5b1500;_0x596a47++){var _0x22ba93=events[_0x596a47];var _0x27b08a=createListener(_0xbf06('0x7')+_0x22ba93,_0x3a758d);WhatsappAccountEvents['on'](_0x22ba93,_0x27b08a);}}; \ No newline at end of file +var _0x8cc7=['emit','removeListener','length','whatsappAccount:','save'];(function(_0x2eb922,_0x67358c){var _0x344a25=function(_0x5436f2){while(--_0x5436f2){_0x2eb922['push'](_0x2eb922['shift']());}};_0x344a25(++_0x67358c);}(_0x8cc7,0xc7));var _0x78cc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8cc7[_0x3947c9];return _0x2e7871;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x78cc('0x0'),'remove','update'];function createListener(_0x169937,_0x4e2a4b){return function(_0x345d33){_0x4e2a4b[_0x78cc('0x1')](_0x169937,_0x345d33);};}function removeListener(_0x1d0f48,_0x30dede){return function(){WhatsappAccountEvents[_0x78cc('0x2')](_0x1d0f48,_0x30dede);};}exports['register']=function(_0x2ca1ae){for(var _0x35f653=0x0,_0x1dca91=events[_0x78cc('0x3')];_0x35f653<_0x1dca91;_0x35f653++){var _0x58f0e9=events[_0x35f653];var _0x2c9f97=createListener(_0x78cc('0x4')+_0x58f0e9,_0x2ca1ae);WhatsappAccountEvents['on'](_0x58f0e9,_0x2c9f97);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 4eca1df..3fda6ed 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 _0x926a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','util','connect-timeout'];(function(_0x14746c,_0x315796){var _0x1de2ef=function(_0xf35fb5){while(--_0xf35fb5){_0x14746c['push'](_0x14746c['shift']());}};_0x1de2ef(++_0x315796);}(_0x926a,0x9e));var _0xa926=function(_0x42f38b,_0x324b9f){_0x42f38b=_0x42f38b-0x0;var _0xbbac6a=_0x926a[_0x42f38b];return _0xbbac6a;};'use strict';var multer=require('multer');var util=require(_0xa926('0x0'));var path=require('path');var timeout=require(_0xa926('0x1'));var express=require(_0xa926('0x2'));var router=express[_0xa926('0x3')]();var fs_extra=require(_0xa926('0x4'));var auth=require(_0xa926('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa926('0x6'));var controller=require(_0xa926('0x7'));router[_0xa926('0x8')]('/',auth[_0xa926('0x9')](),controller[_0xa926('0xa')]);router['get'](_0xa926('0xb'),auth['isAuthenticated'](),controller[_0xa926('0xc')]);router['post']('/',auth[_0xa926('0x9')](),controller['create']);router[_0xa926('0xd')](_0xa926('0xb'),auth[_0xa926('0x9')](),controller[_0xa926('0xe')]);router[_0xa926('0xf')](_0xa926('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5c0a=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x591aad,_0x56227c){var _0x377bd1=function(_0x4aec2){while(--_0x4aec2){_0x591aad['push'](_0x591aad['shift']());}};_0x377bd1(++_0x56227c);}(_0x5c0a,0x108));var _0xa5c0=function(_0x297f25,_0x594be0){_0x297f25=_0x297f25-0x0;var _0x4b16e8=_0x5c0a[_0x297f25];return _0x4b16e8;};'use strict';var multer=require(_0xa5c0('0x0'));var util=require(_0xa5c0('0x1'));var path=require(_0xa5c0('0x2'));var timeout=require(_0xa5c0('0x3'));var express=require(_0xa5c0('0x4'));var router=express['Router']();var fs_extra=require(_0xa5c0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5c0('0x6'));var controller=require(_0xa5c0('0x7'));router[_0xa5c0('0x8')]('/',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xa')]);router[_0xa5c0('0x8')]('/:id',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xb')]);router[_0xa5c0('0xc')]('/',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xd')]);router[_0xa5c0('0xe')]('/:id',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xf')]);router[_0xa5c0('0x10')](_0xa5c0('0x11'),auth[_0xa5c0('0x9')](),controller[_0xa5c0('0x12')]);module[_0xa5c0('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 d9cb2d7..df60be7 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 _0xf274=['STRING','noop','INTEGER'];(function(_0x415b0b,_0xa9cfde){var _0xb6ce02=function(_0x1b40ba){while(--_0x1b40ba){_0x415b0b['push'](_0x415b0b['shift']());}};_0xb6ce02(++_0xa9cfde);}(_0xf274,0x8c));var _0x4f27=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xf274[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x4f27('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x4f27('0x1')],'allowNull':![],'defaultValue':_0x4f27('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4f27('0x1')]},'interval':{'type':Sequelize[_0x4f27('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x78ae=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x78ae,0x193));var _0xe78a=function(_0x481a26,_0x13d43e){_0x481a26=_0x481a26-0x0;var _0x4653c7=_0x78ae[_0x481a26];return _0x4653c7;};'use strict';var Sequelize=require('sequelize');module[_0xe78a('0x0')]={'priority':{'type':Sequelize[_0xe78a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe78a('0x2')],'allowNull':![],'defaultValue':_0xe78a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe78a('0x2')]},'interval':{'type':Sequelize[_0xe78a('0x2')],'defaultValue':_0xe78a('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e76959b..da24ce5 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 _0xf29d=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','WhatsappApplication','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x57b8e6,_0x1824ef){var _0x45cb5f=function(_0x3cc866){while(--_0x3cc866){_0x57b8e6['push'](_0x57b8e6['shift']());}};_0x45cb5f(++_0x1824ef);}(_0xf29d,0xc4));var _0xdf29=function(_0xfcdc2e,_0x4ce4af){_0xfcdc2e=_0xfcdc2e-0x0;var _0x3920a7=_0xf29d[_0xfcdc2e];return _0x3920a7;};'use strict';var emlformat=require(_0xdf29('0x0'));var rimraf=require(_0xdf29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf29('0x2'));var rp=require(_0xdf29('0x3'));var moment=require(_0xdf29('0x4'));var BPromise=require(_0xdf29('0x5'));var Mustache=require(_0xdf29('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdf29('0x7'));var ejs=require(_0xdf29('0x8'));var fs=require('fs');var fs_extra=require(_0xdf29('0x9'));var _=require('lodash');var squel=require(_0xdf29('0xa'));var crypto=require(_0xdf29('0xb'));var jsforce=require(_0xdf29('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdf29('0x7'));var querystring=require(_0xdf29('0xd'));var Papa=require(_0xdf29('0xe'));var Redis=require(_0xdf29('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdf29('0x10'));var hardwareService=require(_0xdf29('0x11'));var logger=require('../../config/logger')(_0xdf29('0x12'));var utils=require(_0xdf29('0x13'));var config=require(_0xdf29('0x14'));var licenseUtil=require(_0xdf29('0x15'));var db=require(_0xdf29('0x16'))['db'];function respondWithStatusCode(_0x52c98f,_0x3cbddc){_0x3cbddc=_0x3cbddc||0xcc;return function(_0x4f0875){if(_0x4f0875){return _0x52c98f[_0xdf29('0x17')](_0x3cbddc);}return _0x52c98f[_0xdf29('0x18')](_0x3cbddc)[_0xdf29('0x19')]();};}function respondWithResult(_0x478d8a,_0x42bfe2){_0x42bfe2=_0x42bfe2||0xc8;return function(_0xacbef1){if(_0xacbef1){return _0x478d8a['status'](_0x42bfe2)[_0xdf29('0x1a')](_0xacbef1);}};}function respondWithFilteredResult(_0x950f44,_0x14ddaa){return function(_0x598f2a){if(_0x598f2a){var _0x45ea43=typeof _0x14ddaa['offset']==='undefined'&&typeof _0x14ddaa[_0xdf29('0x1b')]===_0xdf29('0x1c');var _0x59c74d=_0x598f2a['count'];var _0x11dc19=_0x45ea43?0x0:_0x14ddaa[_0xdf29('0x1d')];var _0x4debb5=_0x45ea43?_0x598f2a[_0xdf29('0x1e')]:_0x14ddaa[_0xdf29('0x1d')]+_0x14ddaa[_0xdf29('0x1b')];var _0x3e13db;if(_0x4debb5>=_0x59c74d){_0x4debb5=_0x59c74d;_0x3e13db=0xc8;}else{_0x3e13db=0xce;}_0x950f44[_0xdf29('0x18')](_0x3e13db);return _0x950f44[_0xdf29('0x1f')](_0xdf29('0x20'),_0x11dc19+'-'+_0x4debb5+'/'+_0x59c74d)[_0xdf29('0x1a')](_0x598f2a);}return null;};}function patchUpdates(_0x15501e){return function(_0xf0983b){try{jsonpatch[_0xdf29('0x21')](_0xf0983b,_0x15501e,!![]);}catch(_0x2767a7){return BPromise[_0xdf29('0x22')](_0x2767a7);}return _0xf0983b[_0xdf29('0x23')]();};}function saveUpdates(_0x3370dd,_0xd09fa6){return function(_0x4b8f9c){if(_0x4b8f9c){return _0x4b8f9c['update'](_0x3370dd)[_0xdf29('0x24')](function(_0x468285){return _0x468285;});}return null;};}function removeEntity(_0x10d692,_0xfc7760){return function(_0x1e311b){if(_0x1e311b){return _0x1e311b['destroy']()[_0xdf29('0x24')](function(){_0x10d692[_0xdf29('0x18')](0xcc)[_0xdf29('0x19')]();});}};}function handleEntityNotFound(_0x41f6c5,_0x4b2931){return function(_0x29d3a1){if(!_0x29d3a1){_0x41f6c5['sendStatus'](0x194);}return _0x29d3a1;};}function handleError(_0x493d01,_0x4d743b){_0x4d743b=_0x4d743b||0x1f4;return function(_0x484989){logger['error'](_0x484989[_0xdf29('0x25')]);if(_0x484989['name']){delete _0x484989[_0xdf29('0x26')];}_0x493d01['status'](_0x4d743b)['send'](_0x484989);};}exports['index']=function(_0x3f5a96,_0x3cdca4){var _0x4fd7c9={},_0x333965={},_0x37ca23={'count':0x0,'rows':[]};var _0xd2b43c=_['map'](db['WhatsappApplication'][_0xdf29('0x27')],function(_0x24253e){return{'name':_0x24253e[_0xdf29('0x28')],'type':_0x24253e[_0xdf29('0x29')][_0xdf29('0x2a')]};});_0x333965[_0xdf29('0x2b')]=_[_0xdf29('0x2c')](_0xd2b43c,_0xdf29('0x26'));_0x333965[_0xdf29('0x2d')]=_[_0xdf29('0x2e')](_0x3f5a96[_0xdf29('0x2d')]);_0x333965[_0xdf29('0x2f')]=_[_0xdf29('0x30')](_0x333965[_0xdf29('0x2b')],_0x333965[_0xdf29('0x2d')]);_0x4fd7c9['attributes']=_[_0xdf29('0x30')](_0x333965[_0xdf29('0x2b')],qs['fields'](_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x31')]));_0x4fd7c9[_0xdf29('0x32')]=_0x4fd7c9['attributes'][_0xdf29('0x33')]?_0x4fd7c9[_0xdf29('0x32')]:_0x333965[_0xdf29('0x2b')];if(!_0x3f5a96[_0xdf29('0x2d')]['hasOwnProperty'](_0xdf29('0x34'))){_0x4fd7c9[_0xdf29('0x1b')]=qs['limit'](_0x3f5a96[_0xdf29('0x2d')]['limit']);_0x4fd7c9[_0xdf29('0x1d')]=qs[_0xdf29('0x1d')](_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x1d')]);}_0x4fd7c9[_0xdf29('0x35')]=qs[_0xdf29('0x36')](_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x36')]);_0x4fd7c9[_0xdf29('0x37')]=qs['filters'](_[_0xdf29('0x38')](_0x3f5a96[_0xdf29('0x2d')],_0x333965[_0xdf29('0x2f')]),_0xd2b43c);if(_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x39')]){_0x4fd7c9[_0xdf29('0x37')]=_[_0xdf29('0x3a')](_0x4fd7c9[_0xdf29('0x37')],{'$or':_['map'](_0xd2b43c,function(_0x576a8f){if(_0x576a8f[_0xdf29('0x29')]!=='VIRTUAL'){var _0x6598c5={};_0x6598c5[_0x576a8f[_0xdf29('0x26')]]={'$like':'%'+_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x39')]+'%'};return _0x6598c5;}})});}_0x4fd7c9=_[_0xdf29('0x3a')]({},_0x4fd7c9,_0x3f5a96['options']);var _0x10affc={'where':_0x4fd7c9[_0xdf29('0x37')]};return db['WhatsappApplication'][_0xdf29('0x1e')](_0x10affc)[_0xdf29('0x24')](function(_0x302d2b){_0x37ca23['count']=_0x302d2b;if(_0x3f5a96[_0xdf29('0x2d')][_0xdf29('0x3b')]){_0x4fd7c9[_0xdf29('0x3c')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xdf29('0x3d')](_0x4fd7c9);})['then'](function(_0x49cad4){_0x37ca23[_0xdf29('0x3e')]=_0x49cad4;return _0x37ca23;})[_0xdf29('0x24')](respondWithFilteredResult(_0x3cdca4,_0x4fd7c9))[_0xdf29('0x3f')](handleError(_0x3cdca4,null));};exports[_0xdf29('0x40')]=function(_0x4a3572,_0x309b3e){var _0x1c2fc0={'raw':!![],'where':{'id':_0x4a3572[_0xdf29('0x41')]['id']}},_0x28a198={};_0x28a198[_0xdf29('0x2b')]=_['keys'](db[_0xdf29('0x42')][_0xdf29('0x27')]);_0x28a198[_0xdf29('0x2d')]=_['keys'](_0x4a3572[_0xdf29('0x2d')]);_0x28a198[_0xdf29('0x2f')]=_['intersection'](_0x28a198[_0xdf29('0x2b')],_0x28a198[_0xdf29('0x2d')]);_0x1c2fc0[_0xdf29('0x32')]=_[_0xdf29('0x30')](_0x28a198['model'],qs[_0xdf29('0x31')](_0x4a3572['query'][_0xdf29('0x31')]));_0x1c2fc0[_0xdf29('0x32')]=_0x1c2fc0[_0xdf29('0x32')][_0xdf29('0x33')]?_0x1c2fc0[_0xdf29('0x32')]:_0x28a198[_0xdf29('0x2b')];if(_0x4a3572[_0xdf29('0x2d')][_0xdf29('0x3b')]){_0x1c2fc0[_0xdf29('0x3c')]=[{'all':!![]}];}_0x1c2fc0=_[_0xdf29('0x3a')]({},_0x1c2fc0,_0x4a3572[_0xdf29('0x43')]);return db[_0xdf29('0x42')][_0xdf29('0x44')](_0x1c2fc0)['then'](handleEntityNotFound(_0x309b3e,null))['then'](respondWithResult(_0x309b3e,null))[_0xdf29('0x3f')](handleError(_0x309b3e,null));};exports[_0xdf29('0x45')]=function(_0x52d3a8,_0x4f5605){return db[_0xdf29('0x42')]['create'](_0x52d3a8[_0xdf29('0x46')],{})[_0xdf29('0x24')](respondWithResult(_0x4f5605,0xc9))[_0xdf29('0x3f')](handleError(_0x4f5605,null));};exports['update']=function(_0xc9f50,_0x3db80f){if(_0xc9f50[_0xdf29('0x46')]['id']){delete _0xc9f50[_0xdf29('0x46')]['id'];}return db[_0xdf29('0x42')][_0xdf29('0x44')]({'where':{'id':_0xc9f50['params']['id']}})[_0xdf29('0x24')](handleEntityNotFound(_0x3db80f,null))[_0xdf29('0x24')](saveUpdates(_0xc9f50[_0xdf29('0x46')],null))[_0xdf29('0x24')](respondWithResult(_0x3db80f,null))[_0xdf29('0x3f')](handleError(_0x3db80f,null));};exports['destroy']=function(_0x9dbf59,_0x4735fa){return db['WhatsappApplication'][_0xdf29('0x44')]({'where':{'id':_0x9dbf59[_0xdf29('0x41')]['id']}})['then'](handleEntityNotFound(_0x4735fa,null))['then'](removeEntity(_0x4735fa,null))['catch'](handleError(_0x4735fa,null));}; \ No newline at end of file +var _0xb982=['sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','WhatsappApplication','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','update','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2b98('0x0'));var jsonpatch=require(_0x2b98('0x1'));var rp=require(_0x2b98('0x2'));var moment=require(_0x2b98('0x3'));var BPromise=require(_0x2b98('0x4'));var Mustache=require(_0x2b98('0x5'));var util=require(_0x2b98('0x6'));var path=require(_0x2b98('0x7'));var sox=require(_0x2b98('0x8'));var csv=require(_0x2b98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b98('0xa'));var _=require(_0x2b98('0xb'));var squel=require(_0x2b98('0xc'));var crypto=require(_0x2b98('0xd'));var jsforce=require(_0x2b98('0xe'));var deskjs=require(_0x2b98('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b98('0x10'));var Papa=require(_0x2b98('0x11'));var Redis=require('ioredis');var authService=require(_0x2b98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b98('0x13'));var hardwareService=require(_0x2b98('0x14'));var logger=require(_0x2b98('0x15'))(_0x2b98('0x16'));var utils=require(_0x2b98('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b98('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x145379,_0x2a2489){_0x2a2489=_0x2a2489||0xcc;return function(_0x675360){if(_0x675360){return _0x145379[_0x2b98('0x19')](_0x2a2489);}return _0x145379[_0x2b98('0x1a')](_0x2a2489)[_0x2b98('0x1b')]();};}function respondWithResult(_0x570e87,_0x29c259){_0x29c259=_0x29c259||0xc8;return function(_0x268fc3){if(_0x268fc3){return _0x570e87[_0x2b98('0x1a')](_0x29c259)[_0x2b98('0x1c')](_0x268fc3);}};}function respondWithFilteredResult(_0x2c6e3c,_0x196cc2){return function(_0x15e5c9){if(_0x15e5c9){var _0x4eab53=typeof _0x196cc2[_0x2b98('0x1d')]===_0x2b98('0x1e')&&typeof _0x196cc2['limit']===_0x2b98('0x1e');var _0x54d425=_0x15e5c9[_0x2b98('0x1f')];var _0x40426c=_0x4eab53?0x0:_0x196cc2[_0x2b98('0x1d')];var _0x50b886=_0x4eab53?_0x15e5c9['count']:_0x196cc2['offset']+_0x196cc2[_0x2b98('0x20')];var _0x3e380c;if(_0x50b886>=_0x54d425){_0x50b886=_0x54d425;_0x3e380c=0xc8;}else{_0x3e380c=0xce;}_0x2c6e3c['status'](_0x3e380c);return _0x2c6e3c['set'](_0x2b98('0x21'),_0x40426c+'-'+_0x50b886+'/'+_0x54d425)[_0x2b98('0x1c')](_0x15e5c9);}return null;};}function patchUpdates(_0x41c7de){return function(_0x5b75de){try{jsonpatch[_0x2b98('0x22')](_0x5b75de,_0x41c7de,!![]);}catch(_0xbff969){return BPromise[_0x2b98('0x23')](_0xbff969);}return _0x5b75de[_0x2b98('0x24')]();};}function saveUpdates(_0x3f5768,_0x349a8d){return function(_0x51db51){if(_0x51db51){return _0x51db51['update'](_0x3f5768)[_0x2b98('0x25')](function(_0x31225b){return _0x31225b;});}return null;};}function removeEntity(_0x373e34,_0x10e803){return function(_0x3bdfa3){if(_0x3bdfa3){return _0x3bdfa3[_0x2b98('0x26')]()[_0x2b98('0x25')](function(){_0x373e34[_0x2b98('0x1a')](0xcc)[_0x2b98('0x1b')]();});}};}function handleEntityNotFound(_0x1a1deb,_0x154f06){return function(_0x112d71){if(!_0x112d71){_0x1a1deb[_0x2b98('0x19')](0x194);}return _0x112d71;};}function handleError(_0x4cc4a2,_0xccda69){_0xccda69=_0xccda69||0x1f4;return function(_0x54b0c3){logger['error'](_0x54b0c3[_0x2b98('0x27')]);if(_0x54b0c3['name']){delete _0x54b0c3[_0x2b98('0x28')];}_0x4cc4a2[_0x2b98('0x1a')](_0xccda69)[_0x2b98('0x29')](_0x54b0c3);};}exports['index']=function(_0x5467a4,_0x3e506f){var _0x2769a7={},_0x2208b1={},_0x8cf049={'count':0x0,'rows':[]};var _0x4ee654=_['map'](db[_0x2b98('0x2a')]['rawAttributes'],function(_0x44b027){return{'name':_0x44b027['fieldName'],'type':_0x44b027['type'][_0x2b98('0x2b')]};});_0x2208b1[_0x2b98('0x2c')]=_[_0x2b98('0x2d')](_0x4ee654,_0x2b98('0x28'));_0x2208b1['query']=_[_0x2b98('0x2e')](_0x5467a4[_0x2b98('0x2f')]);_0x2208b1[_0x2b98('0x30')]=_[_0x2b98('0x31')](_0x2208b1[_0x2b98('0x2c')],_0x2208b1[_0x2b98('0x2f')]);_0x2769a7[_0x2b98('0x32')]=_[_0x2b98('0x31')](_0x2208b1[_0x2b98('0x2c')],qs[_0x2b98('0x33')](_0x5467a4[_0x2b98('0x2f')]['fields']));_0x2769a7[_0x2b98('0x32')]=_0x2769a7['attributes'][_0x2b98('0x34')]?_0x2769a7[_0x2b98('0x32')]:_0x2208b1[_0x2b98('0x2c')];if(!_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x35')](_0x2b98('0x36'))){_0x2769a7['limit']=qs[_0x2b98('0x20')](_0x5467a4['query'][_0x2b98('0x20')]);_0x2769a7[_0x2b98('0x1d')]=qs[_0x2b98('0x1d')](_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x1d')]);}_0x2769a7[_0x2b98('0x37')]=qs[_0x2b98('0x38')](_0x5467a4[_0x2b98('0x2f')]['sort']);_0x2769a7['where']=qs[_0x2b98('0x30')](_[_0x2b98('0x39')](_0x5467a4[_0x2b98('0x2f')],_0x2208b1[_0x2b98('0x30')]),_0x4ee654);if(_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x3a')]){_0x2769a7['where']=_[_0x2b98('0x3b')](_0x2769a7[_0x2b98('0x3c')],{'$or':_[_0x2b98('0x2d')](_0x4ee654,function(_0x1c2e54){if(_0x1c2e54[_0x2b98('0x3d')]!=='VIRTUAL'){var _0x12a6ad={};_0x12a6ad[_0x1c2e54[_0x2b98('0x28')]]={'$like':'%'+_0x5467a4[_0x2b98('0x2f')]['filter']+'%'};return _0x12a6ad;}})});}_0x2769a7=_[_0x2b98('0x3b')]({},_0x2769a7,_0x5467a4[_0x2b98('0x3e')]);var _0x44857a={'where':_0x2769a7[_0x2b98('0x3c')]};return db['WhatsappApplication'][_0x2b98('0x1f')](_0x44857a)['then'](function(_0x3c4569){_0x8cf049[_0x2b98('0x1f')]=_0x3c4569;if(_0x5467a4['query']['includeAll']){_0x2769a7[_0x2b98('0x3f')]=[{'all':!![]}];}return db[_0x2b98('0x2a')][_0x2b98('0x40')](_0x2769a7);})[_0x2b98('0x25')](function(_0x140ba0){_0x8cf049[_0x2b98('0x41')]=_0x140ba0;return _0x8cf049;})[_0x2b98('0x25')](respondWithFilteredResult(_0x3e506f,_0x2769a7))['catch'](handleError(_0x3e506f,null));};exports[_0x2b98('0x42')]=function(_0x1d0277,_0x569fc4){var _0x511ea2={'raw':!![],'where':{'id':_0x1d0277[_0x2b98('0x43')]['id']}},_0xf68abc={};_0xf68abc['model']=_[_0x2b98('0x2e')](db[_0x2b98('0x2a')][_0x2b98('0x44')]);_0xf68abc[_0x2b98('0x2f')]=_['keys'](_0x1d0277[_0x2b98('0x2f')]);_0xf68abc[_0x2b98('0x30')]=_[_0x2b98('0x31')](_0xf68abc[_0x2b98('0x2c')],_0xf68abc[_0x2b98('0x2f')]);_0x511ea2[_0x2b98('0x32')]=_[_0x2b98('0x31')](_0xf68abc['model'],qs[_0x2b98('0x33')](_0x1d0277[_0x2b98('0x2f')]['fields']));_0x511ea2[_0x2b98('0x32')]=_0x511ea2[_0x2b98('0x32')]['length']?_0x511ea2[_0x2b98('0x32')]:_0xf68abc['model'];if(_0x1d0277['query'][_0x2b98('0x45')]){_0x511ea2[_0x2b98('0x3f')]=[{'all':!![]}];}_0x511ea2=_[_0x2b98('0x3b')]({},_0x511ea2,_0x1d0277[_0x2b98('0x3e')]);return db['WhatsappApplication'][_0x2b98('0x46')](_0x511ea2)['then'](handleEntityNotFound(_0x569fc4,null))[_0x2b98('0x25')](respondWithResult(_0x569fc4,null))[_0x2b98('0x47')](handleError(_0x569fc4,null));};exports[_0x2b98('0x48')]=function(_0xb9a6f,_0xd667c0){return db[_0x2b98('0x2a')][_0x2b98('0x48')](_0xb9a6f[_0x2b98('0x49')],{})[_0x2b98('0x25')](respondWithResult(_0xd667c0,0xc9))[_0x2b98('0x47')](handleError(_0xd667c0,null));};exports[_0x2b98('0x4a')]=function(_0x18d835,_0x6860c8){if(_0x18d835['body']['id']){delete _0x18d835['body']['id'];}return db[_0x2b98('0x2a')][_0x2b98('0x46')]({'where':{'id':_0x18d835[_0x2b98('0x43')]['id']}})['then'](handleEntityNotFound(_0x6860c8,null))[_0x2b98('0x25')](saveUpdates(_0x18d835[_0x2b98('0x49')],null))[_0x2b98('0x25')](respondWithResult(_0x6860c8,null))[_0x2b98('0x47')](handleError(_0x6860c8,null));};exports[_0x2b98('0x26')]=function(_0x3524a3,_0x5c8a7c){return db['WhatsappApplication'][_0x2b98('0x46')]({'where':{'id':_0x3524a3[_0x2b98('0x43')]['id']}})[_0x2b98('0x25')](handleEntityNotFound(_0x5c8a7c,null))[_0x2b98('0x25')](removeEntity(_0x5c8a7c,null))[_0x2b98('0x47')](handleError(_0x5c8a7c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index e9a5284..576d5f1 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 _0xad36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0xad36,0x11c));var _0x6ad3=function(_0x3fd6f2,_0x3f3a65){_0x3fd6f2=_0x3fd6f2-0x0;var _0x4553c2=_0xad36[_0x3fd6f2];return _0x4553c2;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var logger=require(_0x6ad3('0x1'))(_0x6ad3('0x2'));var moment=require(_0x6ad3('0x3'));var BPromise=require(_0x6ad3('0x4'));var rp=require(_0x6ad3('0x5'));var fs=require('fs');var path=require(_0x6ad3('0x6'));var rimraf=require(_0x6ad3('0x7'));var config=require(_0x6ad3('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0x6ad3('0x9')]=function(_0x3d669f,_0x3c3041){return _0x3d669f[_0x6ad3('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x20ce=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x20ce,0x10d));var _0xe20c=function(_0x213f99,_0x3a3035){_0x213f99=_0x213f99-0x0;var _0xadb3fb=_0x20ce[_0x213f99];return _0xadb3fb;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var logger=require(_0xe20c('0x2'))('api');var moment=require(_0xe20c('0x3'));var BPromise=require(_0xe20c('0x4'));var rp=require(_0xe20c('0x5'));var fs=require('fs');var path=require(_0xe20c('0x6'));var rimraf=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var attributes=require(_0xe20c('0x9'));module[_0xe20c('0xa')]=function(_0x373f9f,_0x2c9e6a){return _0x373f9f[_0xe20c('0xb')](_0xe20c('0xc'),attributes,{'tableName':_0xe20c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe20c('0xe'),'collate':_0xe20c('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index bc1d5c0..4ac316f 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 _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x30f23b,_0x42e6de){var _0x5f5cee=function(_0xdfbff){while(--_0xdfbff){_0x30f23b['push'](_0x30f23b['shift']());}};_0x5f5cee(++_0x42e6de);}(_0x5fd1,0x155));var _0x15fd=function(_0x10c544,_0x2ecf77){_0x10c544=_0x10c544-0x0;var _0x145386=_0x5fd1[_0x10c544];return _0x145386;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x173dc4,_0x3b150c){var _0x251b4a=function(_0x29b3c5){while(--_0x29b3c5){_0x173dc4['push'](_0x173dc4['shift']());}};_0x251b4a(++_0x3b150c);}(_0xa8a8,0xec));var _0x8a8a=function(_0x157c10,_0xb726cd){_0x157c10=_0x157c10-0x0;var _0x429f51=_0xa8a8[_0x157c10];return _0x429f51;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f93c3f9..3871c9b 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 _0xaf1b=['tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags'];(function(_0x185559,_0x3271fd){var _0x33a706=function(_0x3563dc){while(--_0x3563dc){_0x185559['push'](_0x185559['shift']());}};_0x33a706(++_0x3271fd);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x31cd3c,_0x2d4225){_0x31cd3c=_0x31cd3c-0x0;var _0x3bdfae=_0xaf1b[_0x31cd3c];return _0x3bdfae;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMessages']);router[_0xbaf1('0xb')]('/:id/download',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0x14')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router[_0xbaf1('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x14')](_0xbaf1('0x17'),auth[_0xbaf1('0xc')](),interaction[_0xbaf1('0x18')](_0xbaf1('0x19'),_0xbaf1('0x1a')),controller['addTags']);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),interaction[_0xbaf1('0x18')](_0xbaf1('0x19'),_0xbaf1('0x1c')),controller[_0xbaf1('0x1d')]);router[_0xbaf1('0x1e')]('/:id',auth[_0xbaf1('0xc')](),interaction['tracked'](_0xbaf1('0x19'),_0xbaf1('0x1f')),controller[_0xbaf1('0x20')]);router[_0xbaf1('0x1e')]('/:id/tags',auth[_0xbaf1('0xc')](),controller['removeTags']);module[_0xbaf1('0x21')]=router; \ No newline at end of file +var _0x8b8e=['whatsappinteraction:destroy','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','put','/:id','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x76c22a,_0x509c6e){var _0x509eb6=function(_0x254ae2){while(--_0x254ae2){_0x76c22a['push'](_0x76c22a['shift']());}};_0x509eb6(++_0x509c6e);}(_0x8b8e,0x108));var _0xe8b8=function(_0x3d8c50,_0x4bb14c){_0x3d8c50=_0x3d8c50-0x0;var _0x2725db=_0x8b8e[_0x3d8c50];return _0x2725db;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['describe']);router[_0xe8b8('0x7')]('/:id',auth[_0xe8b8('0x8')](),controller['show']);router['get'](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller['getMessages']);router['get'](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router[_0xe8b8('0xe')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xf')]);router[_0xe8b8('0xe')](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x10')]);router[_0xe8b8('0xe')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')]('whatsapp',_0xe8b8('0x13')),controller['addTags']);router[_0xe8b8('0x14')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')](_0xe8b8('0x16'),_0xe8b8('0x17')),controller[_0xe8b8('0x18')]);router[_0xe8b8('0x19')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction['tracked'](_0xe8b8('0x16'),_0xe8b8('0x1a')),controller['destroy']);router[_0xe8b8('0x19')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x1b')]);module[_0xe8b8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 00b4e4d..faa8141 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 _0xbcc7=['STRING','ENUM','out','DATE','sequelize','moment','BOOLEAN'];(function(_0x2fe457,_0x1c58d6){var _0x40dac7=function(_0x29839b){while(--_0x29839b){_0x2fe457['push'](_0x2fe457['shift']());}};_0x40dac7(++_0x1c58d6);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x35ce67,_0x52e7f4){_0x35ce67=_0x35ce67-0x0;var _0x22d4e0=_0xbcc7[_0x35ce67];return _0x22d4e0;};'use strict';var Sequelize=require(_0x7bcc('0x0'));var moment=require(_0x7bcc('0x1'));module['exports']={'closed':{'type':Sequelize[_0x7bcc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7bcc('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7bcc('0x3')]},'phone':{'type':Sequelize[_0x7bcc('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7bcc('0x4')]('in',_0x7bcc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7bcc('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x7bcc('0x4')]('in',_0x7bcc('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7bcc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4fd7=['moment','exports','BOOLEAN','STRING','ENUM','DATE','sequelize'];(function(_0x5e6b21,_0x391d0b){var _0x225f39=function(_0x22dbc4){while(--_0x22dbc4){_0x5e6b21['push'](_0x5e6b21['shift']());}};_0x225f39(++_0x391d0b);}(_0x4fd7,0xe6));var _0x74fd=function(_0x12fadb,_0x305329){_0x12fadb=_0x12fadb-0x0;var _0x5eb1d5=_0x4fd7[_0x12fadb];return _0x5eb1d5;};'use strict';var Sequelize=require(_0x74fd('0x0'));var moment=require(_0x74fd('0x1'));module[_0x74fd('0x2')]={'closed':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x74fd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x74fd('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74fd('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x74fd('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index af73ae4..c10e0a6 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 _0x4f17=['u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','agent','WhatsappAccountId','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','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','c.email','Contact.email','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','includeAll','include','options','create','body','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','merge','findAll','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','firstName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','basename','createReadStream','pipe','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','select','field','from','u.id'];(function(_0x44efc,_0xa06ee){var _0x383e63=function(_0x1f6d78){while(--_0x1f6d78){_0x44efc['push'](_0x44efc['shift']());}};_0x383e63(++_0xa06ee);}(_0x4f17,0x9e));var _0x74f1=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0x4f17[_0x1ca4cc];return _0x108010;};'use strict';var emlformat=require(_0x74f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74f1('0x1'));var jsonpatch=require(_0x74f1('0x2'));var rp=require('request-promise');var moment=require(_0x74f1('0x3'));var BPromise=require(_0x74f1('0x4'));var Mustache=require(_0x74f1('0x5'));var util=require(_0x74f1('0x6'));var path=require(_0x74f1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74f1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74f1('0x9'));var squel=require('squel');var crypto=require(_0x74f1('0xa'));var jsforce=require(_0x74f1('0xb'));var deskjs=require(_0x74f1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x74f1('0xd'));var Papa=require('papaparse');var Redis=require(_0x74f1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x74f1('0xf'));var as=require(_0x74f1('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74f1('0x11'))(_0x74f1('0x12'));var utils=require(_0x74f1('0x13'));var config=require(_0x74f1('0x14'));var licenseUtil=require(_0x74f1('0x15'));var db=require(_0x74f1('0x16'))['db'];config[_0x74f1('0x17')]=_[_0x74f1('0x18')](config[_0x74f1('0x17')],{'host':_0x74f1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74f1('0x17')]));require('./whatsappInteraction.socket')[_0x74f1('0x1a')](socket);function respondWithStatusCode(_0x57e087,_0x25f605){_0x25f605=_0x25f605||0xcc;return function(_0x17762d){if(_0x17762d){return _0x57e087[_0x74f1('0x1b')](_0x25f605);}return _0x57e087[_0x74f1('0x1c')](_0x25f605)[_0x74f1('0x1d')]();};}function respondWithResult(_0x51faf1,_0x2310b0){_0x2310b0=_0x2310b0||0xc8;return function(_0x10a0b1){if(_0x10a0b1){return _0x51faf1['status'](_0x2310b0)[_0x74f1('0x1e')](_0x10a0b1);}};}function respondWithFilteredResult(_0x149ad8,_0x520aae){return function(_0x1cc44b){if(_0x1cc44b){var _0x29de10=typeof _0x520aae[_0x74f1('0x1f')]===_0x74f1('0x20')&&typeof _0x520aae[_0x74f1('0x21')]==='undefined';var _0x353918=_0x1cc44b[_0x74f1('0x22')];var _0x1b683e=_0x29de10?0x0:_0x520aae[_0x74f1('0x1f')];var _0x227fa9=_0x29de10?_0x1cc44b[_0x74f1('0x22')]:_0x520aae['offset']+_0x520aae['limit'];var _0x4feb19;if(_0x227fa9>=_0x353918){_0x227fa9=_0x353918;_0x4feb19=0xc8;}else{_0x4feb19=0xce;}_0x149ad8[_0x74f1('0x1c')](_0x4feb19);return _0x149ad8[_0x74f1('0x23')](_0x74f1('0x24'),_0x1b683e+'-'+_0x227fa9+'/'+_0x353918)[_0x74f1('0x1e')](_0x1cc44b);}return null;};}function patchUpdates(_0x15c559){return function(_0x26d363){try{jsonpatch[_0x74f1('0x25')](_0x26d363,_0x15c559,!![]);}catch(_0x26cba4){return BPromise[_0x74f1('0x26')](_0x26cba4);}return _0x26d363[_0x74f1('0x27')]();};}function saveUpdates(_0x17929d,_0x47b22f){return function(_0x4cff5f){if(_0x4cff5f){return _0x4cff5f[_0x74f1('0x28')](_0x17929d)[_0x74f1('0x29')](function(_0xad169c){return _0xad169c;});}return null;};}function removeEntity(_0x1b9554,_0x458194){return function(_0xddbb89){if(_0xddbb89){return _0xddbb89[_0x74f1('0x2a')]()['then'](function(){_0x1b9554[_0x74f1('0x1c')](0xcc)[_0x74f1('0x1d')]();});}};}function handleEntityNotFound(_0x59a7ac,_0x1736e3){return function(_0x58d6d8){if(!_0x58d6d8){_0x59a7ac['sendStatus'](0x194);}return _0x58d6d8;};}function handleError(_0x2f0aee,_0x37894a){_0x37894a=_0x37894a||0x1f4;return function(_0x365a2f){logger[_0x74f1('0x2b')](_0x365a2f[_0x74f1('0x2c')]);if(_0x365a2f[_0x74f1('0x2d')]){delete _0x365a2f[_0x74f1('0x2d')];}_0x2f0aee[_0x74f1('0x1c')](_0x37894a)[_0x74f1('0x2e')](_0x365a2f);};}function getInteractionUsers(_0x35e928,_0xd226be){return new BPromise(function(_0x8a65fa,_0x2a0a17){try{if(_0xd226be[_0x35e928['id']]){_0x35e928['Users']=_[_0x74f1('0x2f')](_0xd226be[_0x35e928['id']],function(_0x333226){return{'id':_0x333226['id'],'fullname':_0x333226[_0x74f1('0x30')]};});}}catch(_0xa191b1){_0x2a0a17(_0xa191b1);}_0x8a65fa(_0x35e928);});}function getInteractionTags(_0x52a4b0,_0x181201){return new BPromise(function(_0x48f7e8,_0x45c49c){try{if(_0x52a4b0[_0x74f1('0x31')]){_0x52a4b0[_0x74f1('0x32')]=[];_0x52a4b0[_0x74f1('0x31')]['split'](',')[_0x74f1('0x33')](function(_0x57fe1e){_0x52a4b0[_0x74f1('0x32')][_0x74f1('0x34')](_0x181201[_0x57fe1e]);});}delete _0x52a4b0[_0x74f1('0x31')];}catch(_0x158516){_0x45c49c(_0x158516);}_0x48f7e8(_0x52a4b0);});}function updateWhatsappInteraction(_0x119d07,_0x366472,_0x7cacd7){return new BPromise(function(_0x3dbb34,_0x292d33){return getInteractionUsers(_0x119d07,_0x7cacd7)['then'](function(_0x154fe8){return getInteractionTags(_0x154fe8,_0x366472);})[_0x74f1('0x29')](function(_0x4f7fe1){_0x3dbb34(_0x4f7fe1);})[_0x74f1('0x35')](function(_0x12f5a7){_0x292d33(_0x12f5a7);});});}exports[_0x74f1('0x36')]=function(_0x2eaad6,_0x4203e4){var _0x2210a2={},_0x5410e5={},_0x45497f={'count':0x0,'rows':[]};var _0x10117b=_[_0x74f1('0x2f')](db[_0x74f1('0x37')][_0x74f1('0x38')],function(_0x3484ad){return{'name':_0x3484ad[_0x74f1('0x39')],'type':_0x3484ad[_0x74f1('0x3a')][_0x74f1('0x3b')]};});_0x5410e5[_0x74f1('0x3c')]=_['map'](_0x10117b,_0x74f1('0x2d'));_0x5410e5['query']=_[_0x74f1('0x3d')](_0x2eaad6[_0x74f1('0x3e')]);_0x5410e5['filters']=_[_0x74f1('0x3f')](_0x5410e5[_0x74f1('0x3c')],_0x5410e5['query']);_0x2210a2[_0x74f1('0x40')]=_[_0x74f1('0x3f')](_0x5410e5['model'],qs[_0x74f1('0x41')](_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x41')]));_0x2210a2[_0x74f1('0x40')]=_0x2210a2[_0x74f1('0x40')][_0x74f1('0x42')]?_0x2210a2['attributes']:_0x5410e5['model'];if(!_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x43')](_0x74f1('0x44'))){_0x2210a2[_0x74f1('0x21')]=qs[_0x74f1('0x21')](_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x21')]);_0x2210a2[_0x74f1('0x1f')]=qs[_0x74f1('0x1f')](_0x2eaad6[_0x74f1('0x3e')]['offset']);}_0x2210a2['order']=qs[_0x74f1('0x45')](_0x2eaad6['query'][_0x74f1('0x45')]);_0x2210a2[_0x74f1('0x46')]=qs[_0x74f1('0x47')](_['pick'](_0x2eaad6[_0x74f1('0x3e')],_0x5410e5[_0x74f1('0x47')]),_0x10117b);var _0x44c80a=[];var _0x1bbe99=squel[_0x74f1('0x48')]()[_0x74f1('0x49')]('id')[_0x74f1('0x49')](_0x74f1('0x2d'))['field']('color')[_0x74f1('0x4a')]('tools_tags');var _0x163fc3=squel[_0x74f1('0x48')]()[_0x74f1('0x49')](_0x74f1('0x4b'))[_0x74f1('0x49')](_0x74f1('0x4c'))[_0x74f1('0x49')]('ui.WhatsappInteractionId')[_0x74f1('0x4a')](_0x74f1('0x4d'),'ui')[_0x74f1('0x4e')](_0x74f1('0x4f'),'u',_0x74f1('0x50'));var _0x492b66=squel[_0x74f1('0x48')]()[_0x74f1('0x4a')](_0x74f1('0x51'),'i')[_0x74f1('0x4e')](_0x74f1('0x52'),'c',_0x74f1('0x53'))[_0x74f1('0x4e')](_0x74f1('0x4f'),'o',_0x74f1('0x54'))['left_join'](_0x74f1('0x55'),'a',_0x74f1('0x56'))[_0x74f1('0x4e')]('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0x74f1('0x4e')](_0x74f1('0x57'),'it',_0x74f1('0x58'))[_0x74f1('0x4e')](_0x74f1('0x59'),'t',_0x74f1('0x5a'));var _0x23198e=squel[_0x74f1('0x5b')]();var _0x4db9a9=[];var _0x17ce42=squel[_0x74f1('0x5b')]();var _0xe025a4;if(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x5c')]){_0xe025a4=as[_0x74f1('0x5d')](_0x2eaad6['query'][_0x74f1('0x5c')]);var _0x272756=_0xe025a4['sqlOperator'];for(var _0x469cab=0x0;_0x469cab<_0xe025a4[_0x74f1('0x5e')][_0x74f1('0x42')];_0x469cab++){var _0x1fbdfc=_0xe025a4[_0x74f1('0x5e')][_0x469cab];var _0x400e81='i';var _0x137ff9=_[_0x74f1('0x5f')](_0x10117b,[_0x74f1('0x2d'),_0x1fbdfc[_0x74f1('0x49')]]);if(!_0x137ff9){switch(_0x1fbdfc[_0x74f1('0x49')]){case _0x74f1('0x60'):if(_0x1fbdfc[_0x74f1('0x61')]==0x1){_0x492b66[_0x74f1('0x62')]('`'+_0x1fbdfc[_0x74f1('0x49')]+_0x74f1('0x63'));}else{_0x492b66[_0x74f1('0x62')]('`'+_0x1fbdfc[_0x74f1('0x49')]+_0x74f1('0x64'));}break;case _0x74f1('0x65'):if(_0x1fbdfc[_0x74f1('0x66')]===_0x74f1('0x67')){if(_0x1fbdfc[_0x74f1('0x61')][_0x74f1('0x68')]('\x20')[_0x74f1('0x42')]>0x1){_0x23198e[_0x272756](_0x74f1('0x69'),qs[_0x74f1('0x6a')](_0x1fbdfc[_0x74f1('0x61')]),null);}else{var _0x55b919='%'+_0x1fbdfc[_0x74f1('0x61')]+'%';_0x23198e[_0x272756](_0x74f1('0x6b'),_0x55b919,_0x55b919,_0x55b919);}}else{_0x137ff9=_[_0x74f1('0x5f')](_0x10117b,[_0x74f1('0x2d'),_0x74f1('0x6c')]);_0x1fbdfc[_0x74f1('0x49')]='ContactId';_0x32afcd=as[_0x74f1('0x6d')](_0x400e81,_0x137ff9[_0x74f1('0x3a')],_0x1fbdfc);_0x23198e[_0x272756](_0x32afcd[_0x74f1('0x6e')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x6f')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x1d')]);}break;case'Tag':var _0x1c99f9=_0x1fbdfc[_0x74f1('0x61')]['split'](',')[_0x74f1('0x2f')](function(_0x2f5300){return Number(_0x2f5300);});_0x1c99f9['forEach'](function(_0xad4b67){_0x17ce42['or'](_0x74f1('0x70'),'%,'+_0xad4b67+',%');});_0x4db9a9=_[_0x74f1('0x71')](_0x4db9a9,_0x1c99f9);break;case _0x74f1('0x72'):if(_0x1fbdfc[_0x74f1('0x66')]==='$substring'){_0x23198e[_0x272756](_0x74f1('0x73'),'%'+_0x1fbdfc['value']+'%',null);}else{_0x137ff9=_[_0x74f1('0x5f')](_0x10117b,[_0x74f1('0x2d'),_0x74f1('0x74')]);_0x1fbdfc[_0x74f1('0x49')]=_0x74f1('0x74');_0x32afcd=as[_0x74f1('0x6d')](_0x400e81,_0x137ff9[_0x74f1('0x3a')],_0x1fbdfc);_0x23198e[_0x272756](_0x32afcd[_0x74f1('0x6e')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x6f')],_0x32afcd[_0x74f1('0x61')]['end']);}break;case'body':_0x32afcd=as[_0x74f1('0x6d')]('me',null,_0x1fbdfc);_0x23198e[_0x272756](_0x32afcd[_0x74f1('0x6e')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x6f')],_0x32afcd[_0x74f1('0x61')]['end']);break;}}else{var _0x32afcd=as[_0x74f1('0x6d')](_0x400e81,_0x137ff9['type'],_0x1fbdfc);_0x23198e[_0x272756](_0x32afcd[_0x74f1('0x6e')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x6f')],_0x32afcd[_0x74f1('0x61')][_0x74f1('0x1d')]);}}}else{var _0xebed2c=_(_0x2eaad6[_0x74f1('0x3e')])['keys']()['map'](function(_0x32dfa3){return _['some'](_0x10117b,[_0x74f1('0x2d'),_0x32dfa3])?_0x32dfa3:undefined;})[_0x74f1('0x75')]()[_0x74f1('0x61')]();if(!_['isEmpty'](_0xebed2c)){_0xebed2c[_0x74f1('0x33')](function(_0x59c362){if(_0x59c362==='WhatsappAccountId'){_0x492b66[_0x74f1('0x46')]('i.WhatsappAccountId\x20IN\x20?',[][_0x74f1('0x76')](_0x2eaad6[_0x74f1('0x3e')][_0x59c362]));}else if(_0x59c362===_0x74f1('0x77')){var _0xe64ac1=JSON[_0x74f1('0x78')](_0x2eaad6[_0x74f1('0x3e')][_0x59c362])[_0x74f1('0x79')];var _0x1f330c=JSON[_0x74f1('0x78')](_0x2eaad6[_0x74f1('0x3e')][_0x59c362])[_0x74f1('0x7a')];_0x492b66[_0x74f1('0x46')](_0x74f1('0x7b'),_0xe64ac1,_0x1f330c);}else{if(_0x2eaad6[_0x74f1('0x3e')][_0x59c362]===_0x74f1('0x7c')){_0x492b66['where']('i.'+_0x59c362+_0x74f1('0x7d'));}else{_0x492b66[_0x74f1('0x46')]('i.'+_0x59c362+_0x74f1('0x7e'),_0x2eaad6['query'][_0x59c362]);}}});}if(_0x2eaad6[_0x74f1('0x3e')]['read']){if(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x7f')]==0x1){_0x492b66['having']('`unreadMessages`\x20=\x200');}else{_0x492b66[_0x74f1('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x80')]){_0x4db9a9=_[_0x74f1('0x81')](_0x2eaad6['query'][_0x74f1('0x80')])?_0x2eaad6[_0x74f1('0x3e')]['tag']:new Array(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x80')]);_0x4db9a9[_0x74f1('0x33')](function(_0x36c50a){_0x17ce42['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36c50a+',%');});}if(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x82')]){var _0x2ef0e0=_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x82')][_0x74f1('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x74f1('0x84')](_0x2ef0e0)){_0x23198e['or'](_0x74f1('0x85'),_0x2ef0e0+'%')['or'](_0x74f1('0x86'),_0x2ef0e0+'%');}else{_0x23198e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x74f1('0x6a')](_0x2ef0e0))['or'](_0x74f1('0x87'),_0x2ef0e0+'%');}}}_0x492b66[_0x74f1('0x46')](_0x23198e);_0x492b66[_0x74f1('0x88')](_0x74f1('0x89'));var _0x15f1bd={'type':db['Sequelize'][_0x74f1('0x8a')]['SELECT'],'raw':!![]};var _0x3f565f=_0x492b66['clone']();_0x3f565f['field'](_0x74f1('0x89'));_0x3f565f[_0x74f1('0x49')](_0x74f1('0x8b'),_0x74f1('0x60'));if(_0x2210a2[_0x74f1('0x8c')]){_0x2210a2[_0x74f1('0x8c')][_0x74f1('0x33')](function(_0x2a343e){var _0x2ed50c=_0x2a343e[0x0]===_0x74f1('0x8d')?_0x2a343e[0x0]:'i.'+_0x2a343e[0x0];_0x492b66[_0x74f1('0x8c')](_0x2ed50c,_0x2a343e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x74f1('0x8e')](_0x4db9a9)){_0x492b66[_0x74f1('0x62')](_0x17ce42);_0x3f565f[_0x74f1('0x46')](_0x74f1('0x8f'),_0x4db9a9);}BPromise[_0x74f1('0x90')]()[_0x74f1('0x29')](function(){if(!_0xe025a4){if(_0x2eaad6[_0x74f1('0x3e')]['WhatsappAccountId'])return;_0x3f565f['where'](_0x74f1('0x91'));_0x492b66[_0x74f1('0x46')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2eaad6['user'][_0x74f1('0x92')]!=='agent')return;return _0x2eaad6[_0x74f1('0x93')][_0x74f1('0x94')]({'attributes':['id'],'raw':!![]})[_0x74f1('0x29')](function(_0x629c5d){if(_[_0x74f1('0x8e')](_0x629c5d)){_0x3f565f['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x492b66['where'](_0x74f1('0x95'));}else{_0x3f565f[_0x74f1('0x46')]('i.WhatsappAccountId\x20IN\x20?',_[_0x74f1('0x2f')](_0x629c5d,'id'));_0x492b66[_0x74f1('0x46')](_0x74f1('0x96'),_['map'](_0x629c5d,'id'));}});})[_0x74f1('0x29')](function(){if(_0x2eaad6[_0x74f1('0x93')][_0x74f1('0x92')]===_0x74f1('0x97')&&!_0xe025a4&&!_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x98')])return[];return db[_0x74f1('0x99')][_0x74f1('0x3e')](_0x3f565f['toString'](),_0x15f1bd);})[_0x74f1('0x29')](function(_0x27a8d4){_0x45497f[_0x74f1('0x22')]=_0x27a8d4[_0x74f1('0x42')];if(_0x45497f[_0x74f1('0x22')]===0x0)return[];return db[_0x74f1('0x99')][_0x74f1('0x3e')](_0x1bbe99[_0x74f1('0x9a')](),_0x15f1bd)[_0x74f1('0x29')](function(_0x471805){_0x44c80a=_[_0x74f1('0x9b')](_0x471805,'id');_0x15f1bd=_['merge'](_0x15f1bd,{'model':db[_0x74f1('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eaad6[_0x74f1('0x3e')][_0x74f1('0x41')]){_0x2210a2[_0x74f1('0x40')]['forEach'](function(_0x5d11a4){_0x492b66['field']('i.'+_0x5d11a4);});}else{_0x492b66[_0x74f1('0x49')](_0x74f1('0x8b'),_0x74f1('0x60'));_0x492b66[_0x74f1('0x49')](_0x74f1('0x9c'),_0x74f1('0x9d'));_0x492b66[_0x74f1('0x49')](_0x74f1('0x9e'),'Account.mandatoryDisposition');_0x492b66['field'](_0x74f1('0x9f'),_0x74f1('0x8d'));_0x492b66['field'](_0x74f1('0xa0'));_0x492b66[_0x74f1('0x49')](_0x74f1('0xa1'),_0x74f1('0xa2'));_0x492b66[_0x74f1('0x49')](_0x74f1('0xa3'),'Contact.lastName');_0x492b66[_0x74f1('0x49')](_0x74f1('0xa4'),_0x74f1('0xa5'));_0x492b66[_0x74f1('0x49')]('c.phone','Contact.phone');_0x492b66[_0x74f1('0x49')](_0x74f1('0xa6'),'Contact.mobile');_0x492b66['field'](_0x74f1('0xa7'),_0x74f1('0xa8'));_0x492b66[_0x74f1('0x49')](_0x74f1('0xa9'),_0x74f1('0xaa'));_0x492b66[_0x74f1('0x49')]('o.internal','Owner.internal');_0x492b66[_0x74f1('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2210a2[_0x74f1('0x21')])_0x492b66['limit'](_0x2210a2[_0x74f1('0x21')]);if(_0x2210a2[_0x74f1('0x1f')])_0x492b66[_0x74f1('0x1f')](_0x2210a2[_0x74f1('0x1f')]);return db[_0x74f1('0x99')][_0x74f1('0x3e')](_0x492b66[_0x74f1('0x9a')](),_0x15f1bd);})[_0x74f1('0x29')](function(_0x3558b9){if(_0x3558b9[_0x74f1('0x42')]>0x0)_0x163fc3[_0x74f1('0x46')](_0x74f1('0xab'),_[_0x74f1('0x2f')](_0x3558b9,'id'));return db[_0x74f1('0x99')][_0x74f1('0x3e')](_0x163fc3['toString'](),_0x15f1bd)[_0x74f1('0x29')](function(_0x4a6cef){var _0x2a7547=_[_0x74f1('0xac')](_0x4a6cef,_0x74f1('0xad'));var _0x2b2d9f=[];_0x3558b9[_0x74f1('0x33')](function(_0x4f23cf){_0x2b2d9f[_0x74f1('0x34')](updateWhatsappInteraction(_0x4f23cf,_0x44c80a,_0x2a7547));});return BPromise[_0x74f1('0xae')](_0x2b2d9f);});});})[_0x74f1('0x29')](function(_0x549a10){_0x45497f[_0x74f1('0xaf')]=_0x549a10;return _0x45497f;})['then'](respondWithFilteredResult(_0x4203e4,_0x2210a2))[_0x74f1('0x35')](handleError(_0x4203e4,null));};exports['show']=function(_0x1e3255,_0xd92e5f){var _0x351078={'raw':![],'where':{'id':_0x1e3255[_0x74f1('0xb0')]['id']}},_0x3ccbc7={};_0x3ccbc7[_0x74f1('0x3c')]=_[_0x74f1('0x3d')](db[_0x74f1('0x37')]['rawAttributes']);_0x3ccbc7[_0x74f1('0x3e')]=_[_0x74f1('0x3d')](_0x1e3255['query']);_0x3ccbc7['filters']=_[_0x74f1('0x3f')](_0x3ccbc7[_0x74f1('0x3c')],_0x3ccbc7[_0x74f1('0x3e')]);_0x351078[_0x74f1('0x40')]=_[_0x74f1('0x3f')](_0x3ccbc7['model'],qs[_0x74f1('0x41')](_0x1e3255[_0x74f1('0x3e')]['fields']));_0x351078[_0x74f1('0x40')]=_0x351078[_0x74f1('0x40')][_0x74f1('0x42')]?_0x351078[_0x74f1('0x40')]:_0x3ccbc7[_0x74f1('0x3c')];if(_0x1e3255[_0x74f1('0x3e')][_0x74f1('0xb1')]){_0x351078[_0x74f1('0xb2')]=[{'all':!![]}];}_0x351078=_['merge']({},_0x351078,_0x1e3255[_0x74f1('0xb3')]);return db[_0x74f1('0x37')]['find'](_0x351078)[_0x74f1('0x29')](handleEntityNotFound(_0xd92e5f,null))[_0x74f1('0x29')](respondWithResult(_0xd92e5f,null))[_0x74f1('0x35')](handleError(_0xd92e5f,null));};exports[_0x74f1('0xb4')]=function(_0x3dd317,_0x22f2cb){return db[_0x74f1('0x37')]['create'](_0x3dd317[_0x74f1('0xb5')],{})['then'](respondWithResult(_0x22f2cb,0xc9))[_0x74f1('0x35')](handleError(_0x22f2cb,null));};exports[_0x74f1('0x28')]=function(_0x593920,_0x31fbe6){if(_0x593920[_0x74f1('0xb5')]['id']){delete _0x593920[_0x74f1('0xb5')]['id'];}return db[_0x74f1('0x37')][_0x74f1('0x5f')]({'where':{'id':_0x593920['params']['id']}})['then'](handleEntityNotFound(_0x31fbe6,null))[_0x74f1('0x29')](saveUpdates(_0x593920[_0x74f1('0xb5')],null))['then'](respondWithResult(_0x31fbe6,null))['catch'](handleError(_0x31fbe6,null));};exports[_0x74f1('0x2a')]=function(_0x105044,_0x151c79){return db['WhatsappInteraction'][_0x74f1('0x5f')]({'where':{'id':_0x105044[_0x74f1('0xb0')]['id']}})[_0x74f1('0x29')](handleEntityNotFound(_0x151c79,null))['then'](removeEntity(_0x151c79,null))['catch'](handleError(_0x151c79,null));};exports[_0x74f1('0xb6')]=function(_0x120e97,_0x20546e){return db[_0x74f1('0x37')]['describe']()[_0x74f1('0x29')](respondWithResult(_0x20546e,null))[_0x74f1('0x35')](handleError(_0x20546e,null));};exports['addMessage']=function(_0x399cb4,_0x682e33,_0x47ff2f){return db[_0x74f1('0xb7')][_0x74f1('0x5f')]({'where':{'id':_0x399cb4['params']['id']}})['then'](handleEntityNotFound(_0x682e33,null))[_0x74f1('0x29')](function(_0x669822){if(_0x669822){return _0x669822[_0x74f1('0xb8')](_0x399cb4['body'][_0x74f1('0xb9')],_[_0x74f1('0xba')](_0x399cb4['body'],[_0x74f1('0xb9'),'id'])||{});}})[_0x74f1('0x29')](respondWithResult(_0x682e33,null))[_0x74f1('0x35')](handleError(_0x682e33,null));};exports[_0x74f1('0xbb')]=function(_0x3b1531,_0x44f547,_0x149563){var _0x5d12b7={'raw':![],'where':{}};var _0x2f4de0={};var _0x56dfac={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x74f1('0xbc')]({'where':{'id':_0x3b1531['params']['id']}})[_0x74f1('0x29')](handleEntityNotFound(_0x44f547,null))['then'](function(_0x382037){if(_0x382037){_0x2f4de0['model']=_[_0x74f1('0x3d')](db[_0x74f1('0xb7')][_0x74f1('0x38')]);_0x2f4de0['query']=_[_0x74f1('0x3d')](_0x3b1531['query']);_0x2f4de0[_0x74f1('0x47')]=_[_0x74f1('0x3f')](_0x2f4de0[_0x74f1('0x3c')],_0x2f4de0[_0x74f1('0x3e')]);_0x5d12b7['attributes']=_[_0x74f1('0x3f')](_0x2f4de0[_0x74f1('0x3c')],qs[_0x74f1('0x41')](_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x41')]));_0x5d12b7[_0x74f1('0x40')]=_0x5d12b7['attributes'][_0x74f1('0x42')]?_0x5d12b7[_0x74f1('0x40')]:_0x2f4de0[_0x74f1('0x3c')];if(!_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x43')](_0x74f1('0x44'))){_0x5d12b7['limit']=qs[_0x74f1('0x21')](_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x21')]);_0x5d12b7[_0x74f1('0x1f')]=qs[_0x74f1('0x1f')](_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x1f')]);}_0x5d12b7[_0x74f1('0x8c')]=qs['sort'](_0x3b1531['query'][_0x74f1('0x45')]);_0x5d12b7[_0x74f1('0x46')]=qs[_0x74f1('0x47')](_[_0x74f1('0xbd')](_0x3b1531['query'],_0x2f4de0[_0x74f1('0x47')]));_0x5d12b7['where'][_0x74f1('0xad')]=_0x382037['id'];if(_0x3b1531['query'][_0x74f1('0x82')]){_0x5d12b7['where']=_['merge'](_0x5d12b7[_0x74f1('0x46')],{'$or':_['map'](_0x5d12b7[_0x74f1('0x40')],function(_0x21355d){var _0x46267a={};_0x46267a[_0x21355d]={'$like':'%'+_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x82')]+'%'};return _0x46267a;})});}if(_0x3b1531[_0x74f1('0x3e')]['$gte']){var _0x1e7353=_0x3b1531[_0x74f1('0x3e')][_0x74f1('0x79')]['split'](',');var _0x38a1dc={};_0x38a1dc[_0x1e7353[0x0]]={'$gte':moment(_0x1e7353[0x1])[_0x74f1('0xbe')](_0x74f1('0xbf'))};_0x5d12b7[_0x74f1('0x46')]=_[_0x74f1('0xc0')](_0x5d12b7['where'],_0x38a1dc);}_0x5d12b7=_[_0x74f1('0xc0')]({},_0x5d12b7,_0x3b1531[_0x74f1('0xb3')]);return db[_0x74f1('0xb7')][_0x74f1('0x22')]({'where':_0x5d12b7[_0x74f1('0x46')]})[_0x74f1('0x29')](function(_0x53bc6b){_0x56dfac[_0x74f1('0x22')]=_0x53bc6b;if(_0x3b1531[_0x74f1('0x3e')]['includeAll']){_0x5d12b7['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x74f1('0xc1')](_0x5d12b7);})[_0x74f1('0x29')](function(_0x2a1e60){_0x56dfac[_0x74f1('0xaf')]=_0x2a1e60;return _0x56dfac;});}})[_0x74f1('0x29')](respondWithFilteredResult(_0x44f547,_0x5d12b7))['catch'](handleError(_0x44f547,null));};exports[_0x74f1('0xc2')]=function(_0x2c826a,_0x35393b,_0x5559dd){return db['WhatsappInteraction']['find']({'where':{'id':_0x2c826a[_0x74f1('0xb0')]['id']}})[_0x74f1('0x29')](handleEntityNotFound(_0x35393b,null))[_0x74f1('0x29')](function(_0x594e0c){if(_0x594e0c){return _0x594e0c[_0x74f1('0xc3')](_0x2c826a[_0x74f1('0xb5')][_0x74f1('0xb9')],_['omit'](_0x2c826a['body'],[_0x74f1('0xb9'),'id'])||{})['spread'](function(){return db[_0x74f1('0xc4')][_0x74f1('0xc1')]({'attributes':['id',_0x74f1('0x2d'),_0x74f1('0xc5')],'where':{'id':_0x2c826a[_0x74f1('0xb5')][_0x74f1('0xb9')]}});})[_0x74f1('0x29')](function(_0x29a602){socket[_0x74f1('0xc6')](_0x74f1('0xc7'),{'id':Number(_0x2c826a[_0x74f1('0xb0')]['id']),'tags':_0x29a602||[]});return{'id':Number(_0x2c826a[_0x74f1('0xb0')]['id']),'tags':_0x29a602||[]};});}})[_0x74f1('0x29')](respondWithResult(_0x35393b,null))[_0x74f1('0x35')](handleError(_0x35393b,null));};exports[_0x74f1('0xc8')]=function(_0x2120b2,_0x5caab8,_0x41c475){return db[_0x74f1('0x37')][_0x74f1('0x5f')]({'where':{'id':_0x2120b2[_0x74f1('0xb0')]['id']}})[_0x74f1('0x29')](handleEntityNotFound(_0x5caab8,null))[_0x74f1('0x29')](function(_0x48b7c7){if(_0x48b7c7){return _0x48b7c7[_0x74f1('0xc8')](_0x2120b2[_0x74f1('0x3e')][_0x74f1('0xb9')]);}})[_0x74f1('0x29')](respondWithStatusCode(_0x5caab8,null))[_0x74f1('0x35')](handleError(_0x5caab8,null));};exports[_0x74f1('0xc9')]=function(_0x3725fe,_0x5bd4a6){var _0x478e4d=moment()['unix']()[_0x74f1('0x9a')]();var _0x178980=path[_0x74f1('0xca')](config[_0x74f1('0xcb')],'server','files','tmp');var _0x304f7c=path[_0x74f1('0xca')](config[_0x74f1('0xcb')],_0x74f1('0xcc'),_0x74f1('0xcd'),_0x74f1('0xce'));var _0x1f1e3a=path[_0x74f1('0xca')](_0x178980,_0x478e4d);var _0x78f858=util[_0x74f1('0xbe')]('transcript-%d-%s.zip',_0x3725fe[_0x74f1('0xb0')]['id'],_0x478e4d);var _0x26ee12=path[_0x74f1('0xca')](_0x178980,_0x78f858);var _0x517aaa=[];_0x517aaa[_0x74f1('0x34')]({'model':db[_0x74f1('0x72')],'as':_0x74f1('0x72'),'attributes':['id',_0x74f1('0x30')],'raw':!![]});_0x517aaa[_0x74f1('0x34')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x74f1('0xcf'),'lastName'],'raw':!![]});if(_0x3725fe[_0x74f1('0x3e')][_0x74f1('0xce')]){_0x517aaa[_0x74f1('0x34')]({'model':db[_0x74f1('0xd0')],'as':_0x74f1('0xd0'),'raw':!![]});}var _0x33e302=[{'model':db[_0x74f1('0xb7')],'as':_0x74f1('0xd1'),'attributes':['id','body','createdAt',_0x74f1('0xd2'),_0x74f1('0xd3'),_0x74f1('0x7f')],'include':_0x517aaa}];_0x33e302[_0x74f1('0x34')]({'model':db[_0x74f1('0xd4')],'as':_0x74f1('0xd5'),'attributes':['id',_0x74f1('0x2d')]});_0x33e302[_0x74f1('0x34')]({'model':db['User'],'as':_0x74f1('0xd6'),'attributes':['id','fullname']});return db[_0x74f1('0x37')][_0x74f1('0x5f')]({'where':{'id':_0x3725fe[_0x74f1('0xb0')]['id']},'include':_0x33e302})[_0x74f1('0x29')](handleEntityNotFound(_0x5bd4a6,null))[_0x74f1('0x29')](function(_0xb88a3b){if(_0xb88a3b){var _0x350fa0=_0xb88a3b['get']({'plain':!![]});fs[_0x74f1('0xd7')](_0x1f1e3a);var _0x2e8773={'channel':_0x74f1('0xd8'),'account':_0x350fa0[_0x74f1('0xd5')][_0x74f1('0x2d')],'agent':_0x350fa0[_0x74f1('0xd6')]?_0x350fa0['Owner'][_0x74f1('0x30')]:_0x74f1('0xd9'),'createdAt':moment(_0x350fa0[_0x74f1('0x77')])[_0x74f1('0xbe')](_0x74f1('0xbf'))[_0x74f1('0x9a')](),'closedAt':_0x350fa0[_0x74f1('0xda')]?moment(_0x350fa0['closedAt'])[_0x74f1('0xbe')](_0x74f1('0xbf'))['toString']():'','disposition':_0x350fa0['disposition'],'messages':_(_0x350fa0['Messages'])[_0x74f1('0x82')]({'secret':![]})[_0x74f1('0x2f')](function(_0x491583){if(_0x491583[_0x74f1('0xd0')]){var _0x3f68da=path['join'](_0x304f7c,_0x491583[_0x74f1('0xd0')][_0x74f1('0xdb')]);if(fs['existsSync'](_0x3f68da)){fs[_0x74f1('0xdc')](_0x3f68da)[_0x74f1('0xdd')](fs[_0x74f1('0xde')](path[_0x74f1('0xca')](_0x1f1e3a,_0x491583[_0x74f1('0xd0')][_0x74f1('0xdb')])));}}return{'date':moment(_0x491583['createdAt'])[_0x74f1('0xbe')](_0x74f1('0xbf'))['toString'](),'sender':_0x491583['direction']===_0x74f1('0xdf')?_0x491583[_0x74f1('0x72')]?_0x491583[_0x74f1('0x72')]['fullname']:_0x74f1('0xe0'):_0x491583[_0x74f1('0x65')][_0x74f1('0xcf')]+(_0x491583['Contact']['lastName']?'\x20'+_0x491583[_0x74f1('0x65')][_0x74f1('0xe1')]:''),'body':_0x491583[_0x74f1('0xd0')]?_0x491583[_0x74f1('0xd0')][_0x74f1('0xdb')]:_0x491583[_0x74f1('0xb5')],'direction':_0x491583[_0x74f1('0xd2')]==='out'?'A':'C','secret':_0x491583[_0x74f1('0xd3')],'read':_0x491583[_0x74f1('0x7f')],'attachment':_0x491583['Attachment']};})[_0x74f1('0x61')]()};return ejs[_0x74f1('0xe2')](path[_0x74f1('0xca')](config[_0x74f1('0xcb')],'server',_0x74f1('0xe3'),_0x74f1('0xe4')),{'interaction':_0x2e8773})['then'](function(_0xf168d2){var _0x4cec3c=path['join'](_0x1f1e3a,_0x74f1('0xe5')+_0x350fa0['id']+'-'+_0x478e4d+_0x74f1('0xe6'));var _0x46ba42={'path':_0x4cec3c,'channel':_0x74f1('0xd8'),'interactionId':_0x350fa0['id']};return pdf[_0x74f1('0xe7')](_0xf168d2,_0x46ba42);})[_0x74f1('0x29')](function(){return new BPromise(function(_0x291dbe,_0x2ff88b){zipdir(_0x1f1e3a,{'saveTo':_0x26ee12},function(_0x25220b,_0x3e0bd9){if(_0x25220b)return _0x2ff88b(_0x25220b);return _0x291dbe(_0x3e0bd9);});})[_0x74f1('0x29')](function(){return new BPromise(function(_0x573be5,_0x228373){rimraf(_0x1f1e3a,function(_0x2d3ee2){if(_0x2d3ee2)_0x228373(_0x2d3ee2);return _0x573be5();});});})[_0x74f1('0x29')](function(){return _0x5bd4a6[_0x74f1('0xc9')](_0x26ee12,_0x78f858,function(_0x36df83){if(_0x36df83){console['log'](_0x74f1('0xe8'),_0x36df83);}else{fs[_0x74f1('0xe9')](_0x26ee12);}});});});}else{return _0x5bd4a6[_0x74f1('0x1b')](0xc8);}})[_0x74f1('0x35')](handleError(_0x5bd4a6,null));}; \ No newline at end of file +var _0x938a=['attachments','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','TagIds','Tags','forEach','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','from','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','keys','some','isEmpty','WhatsappAccountId','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','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.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','WhatsappInteractionId','push','all','rows','show','params','includeAll','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','omit','spread','color','emit','removeTags','download','unix','join','root','server','tmp','files'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x938a,0x1f2));var _0xa938=function(_0xa22f2c,_0x5d5aca){_0xa22f2c=_0xa22f2c-0x0;var _0x2af0b8=_0x938a[_0xa22f2c];return _0x2af0b8;};'use strict';var emlformat=require(_0xa938('0x0'));var rimraf=require(_0xa938('0x1'));var zipdir=require(_0xa938('0x2'));var jsonpatch=require(_0xa938('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa938('0x4'));var Mustache=require(_0xa938('0x5'));var util=require(_0xa938('0x6'));var path=require('path');var sox=require(_0xa938('0x7'));var csv=require(_0xa938('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa938('0x9'));var _=require(_0xa938('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa938('0xb'));var toCsv=require(_0xa938('0x8'));var querystring=require(_0xa938('0xc'));var Papa=require('papaparse');var Redis=require(_0xa938('0xd'));var authService=require(_0xa938('0xe'));var qs=require(_0xa938('0xf'));var as=require(_0xa938('0x10'));var pdf=require(_0xa938('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa938('0x12'))(_0xa938('0x13'));var utils=require(_0xa938('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa938('0x15')],{'host':_0xa938('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa938('0x15')]));require(_0xa938('0x17'))[_0xa938('0x18')](socket);function respondWithStatusCode(_0x4d014e,_0x1cd9d9){_0x1cd9d9=_0x1cd9d9||0xcc;return function(_0x776a3b){if(_0x776a3b){return _0x4d014e[_0xa938('0x19')](_0x1cd9d9);}return _0x4d014e[_0xa938('0x1a')](_0x1cd9d9)[_0xa938('0x1b')]();};}function respondWithResult(_0x5b5aec,_0x3d2a05){_0x3d2a05=_0x3d2a05||0xc8;return function(_0x7c29b3){if(_0x7c29b3){return _0x5b5aec[_0xa938('0x1a')](_0x3d2a05)[_0xa938('0x1c')](_0x7c29b3);}};}function respondWithFilteredResult(_0x5db39f,_0x112ec6){return function(_0x492b01){if(_0x492b01){var _0x2d8195=typeof _0x112ec6[_0xa938('0x1d')]===_0xa938('0x1e')&&typeof _0x112ec6[_0xa938('0x1f')]===_0xa938('0x1e');var _0x85f1c0=_0x492b01[_0xa938('0x20')];var _0x53bf8b=_0x2d8195?0x0:_0x112ec6[_0xa938('0x1d')];var _0x77acb6=_0x2d8195?_0x492b01[_0xa938('0x20')]:_0x112ec6[_0xa938('0x1d')]+_0x112ec6['limit'];var _0x1a5b3d;if(_0x77acb6>=_0x85f1c0){_0x77acb6=_0x85f1c0;_0x1a5b3d=0xc8;}else{_0x1a5b3d=0xce;}_0x5db39f['status'](_0x1a5b3d);return _0x5db39f['set'](_0xa938('0x21'),_0x53bf8b+'-'+_0x77acb6+'/'+_0x85f1c0)[_0xa938('0x1c')](_0x492b01);}return null;};}function patchUpdates(_0x51cde1){return function(_0xb2c127){try{jsonpatch[_0xa938('0x22')](_0xb2c127,_0x51cde1,!![]);}catch(_0x4ca84e){return BPromise['reject'](_0x4ca84e);}return _0xb2c127[_0xa938('0x23')]();};}function saveUpdates(_0x38dc2d,_0x40d476){return function(_0x461c03){if(_0x461c03){return _0x461c03[_0xa938('0x24')](_0x38dc2d)[_0xa938('0x25')](function(_0x3993b8){return _0x3993b8;});}return null;};}function removeEntity(_0x1c78db,_0x1575ef){return function(_0x5b0253){if(_0x5b0253){return _0x5b0253[_0xa938('0x26')]()[_0xa938('0x25')](function(){_0x1c78db['status'](0xcc)[_0xa938('0x1b')]();});}};}function handleEntityNotFound(_0x1aaca2,_0x56dbf8){return function(_0x182596){if(!_0x182596){_0x1aaca2[_0xa938('0x19')](0x194);}return _0x182596;};}function handleError(_0x6bb82d,_0x533d57){_0x533d57=_0x533d57||0x1f4;return function(_0x5c9342){logger[_0xa938('0x27')](_0x5c9342[_0xa938('0x28')]);if(_0x5c9342[_0xa938('0x29')]){delete _0x5c9342[_0xa938('0x29')];}_0x6bb82d[_0xa938('0x1a')](_0x533d57)['send'](_0x5c9342);};}function getInteractionUsers(_0x486f5e,_0x3ebfdc){return new BPromise(function(_0x38fb1f,_0x564dff){try{if(_0x3ebfdc[_0x486f5e['id']]){_0x486f5e[_0xa938('0x2a')]=_[_0xa938('0x2b')](_0x3ebfdc[_0x486f5e['id']],function(_0x174800){return{'id':_0x174800['id'],'fullname':_0x174800['fullname']};});}}catch(_0xc3b3d4){_0x564dff(_0xc3b3d4);}_0x38fb1f(_0x486f5e);});}function getInteractionTags(_0x40dc25,_0x1e75ab){return new BPromise(function(_0x51e215,_0x54d174){try{if(_0x40dc25[_0xa938('0x2c')]){_0x40dc25[_0xa938('0x2d')]=[];_0x40dc25[_0xa938('0x2c')]['split'](',')[_0xa938('0x2e')](function(_0x2e9395){_0x40dc25['Tags']['push'](_0x1e75ab[_0x2e9395]);});}delete _0x40dc25['TagIds'];}catch(_0x4d825a){_0x54d174(_0x4d825a);}_0x51e215(_0x40dc25);});}function updateWhatsappInteraction(_0x51ecf9,_0x54a0da,_0x3793c4){return new BPromise(function(_0x30b229,_0x35a964){return getInteractionUsers(_0x51ecf9,_0x3793c4)[_0xa938('0x25')](function(_0x1d64be){return getInteractionTags(_0x1d64be,_0x54a0da);})[_0xa938('0x25')](function(_0x113a7f){_0x30b229(_0x113a7f);})[_0xa938('0x2f')](function(_0x5b8842){_0x35a964(_0x5b8842);});});}exports[_0xa938('0x30')]=function(_0x18b13f,_0x9eb30b){var _0x255203={},_0x375e46={},_0x2de83d={'count':0x0,'rows':[]};var _0x145893=_[_0xa938('0x2b')](db[_0xa938('0x31')][_0xa938('0x32')],function(_0x2f548f){return{'name':_0x2f548f[_0xa938('0x33')],'type':_0x2f548f[_0xa938('0x34')][_0xa938('0x35')]};});_0x375e46[_0xa938('0x36')]=_[_0xa938('0x2b')](_0x145893,'name');_0x375e46['query']=_['keys'](_0x18b13f[_0xa938('0x37')]);_0x375e46[_0xa938('0x38')]=_[_0xa938('0x39')](_0x375e46[_0xa938('0x36')],_0x375e46[_0xa938('0x37')]);_0x255203['attributes']=_[_0xa938('0x39')](_0x375e46[_0xa938('0x36')],qs[_0xa938('0x3a')](_0x18b13f[_0xa938('0x37')]['fields']));_0x255203[_0xa938('0x3b')]=_0x255203[_0xa938('0x3b')]['length']?_0x255203[_0xa938('0x3b')]:_0x375e46[_0xa938('0x36')];if(!_0x18b13f['query'][_0xa938('0x3c')](_0xa938('0x3d'))){_0x255203[_0xa938('0x1f')]=qs[_0xa938('0x1f')](_0x18b13f[_0xa938('0x37')][_0xa938('0x1f')]);_0x255203[_0xa938('0x1d')]=qs[_0xa938('0x1d')](_0x18b13f['query'][_0xa938('0x1d')]);}_0x255203[_0xa938('0x3e')]=qs['sort'](_0x18b13f[_0xa938('0x37')][_0xa938('0x3f')]);_0x255203['where']=qs[_0xa938('0x38')](_[_0xa938('0x40')](_0x18b13f['query'],_0x375e46['filters']),_0x145893);var _0x6d2c99=[];var _0x546701=squel[_0xa938('0x41')]()[_0xa938('0x42')]('id')[_0xa938('0x42')](_0xa938('0x29'))[_0xa938('0x42')]('color')[_0xa938('0x43')]('tools_tags');var _0x210bc7=squel['select']()['field']('u.id')[_0xa938('0x42')](_0xa938('0x44'))[_0xa938('0x42')]('ui.WhatsappInteractionId')['from'](_0xa938('0x45'),'ui')[_0xa938('0x46')](_0xa938('0x47'),'u',_0xa938('0x48'));var _0x2e638f=squel[_0xa938('0x41')]()[_0xa938('0x43')]('whatsapp_interactions','i')[_0xa938('0x46')](_0xa938('0x49'),'c',_0xa938('0x4a'))[_0xa938('0x46')](_0xa938('0x47'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xa938('0x4b'),'a',_0xa938('0x4c'))[_0xa938('0x46')](_0xa938('0x4d'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa938('0x46')](_0xa938('0x4e'),'it',_0xa938('0x4f'))[_0xa938('0x46')](_0xa938('0x50'),'t',_0xa938('0x51'));var _0xb8bd5e=squel[_0xa938('0x52')]();var _0x22895c=[];var _0x35728e=squel[_0xa938('0x52')]();var _0x55a883;if(_0x18b13f['query'][_0xa938('0x53')]){_0x55a883=as[_0xa938('0x54')](_0x18b13f['query'][_0xa938('0x53')]);var _0x3ca994=_0x55a883['sqlOperator'];for(var _0x59f7cb=0x0;_0x59f7cb<_0x55a883['conditions']['length'];_0x59f7cb++){var _0x20bd2b=_0x55a883[_0xa938('0x55')][_0x59f7cb];var _0x355b69='i';var _0x3b901d=_['find'](_0x145893,[_0xa938('0x29'),_0x20bd2b[_0xa938('0x42')]]);if(!_0x3b901d){switch(_0x20bd2b[_0xa938('0x42')]){case _0xa938('0x56'):if(_0x20bd2b[_0xa938('0x57')]==0x1){_0x2e638f[_0xa938('0x58')]('`'+_0x20bd2b[_0xa938('0x42')]+'`\x20=\x200');}else{_0x2e638f[_0xa938('0x58')]('`'+_0x20bd2b[_0xa938('0x42')]+_0xa938('0x59'));}break;case _0xa938('0x5a'):if(_0x20bd2b[_0xa938('0x5b')]==='$substring'){if(_0x20bd2b[_0xa938('0x57')]['split']('\x20')[_0xa938('0x5c')]>0x1){_0xb8bd5e[_0x3ca994](_0xa938('0x5d'),qs[_0xa938('0x5e')](_0x20bd2b[_0xa938('0x57')]),null);}else{var _0x20df0c='%'+_0x20bd2b['value']+'%';_0xb8bd5e[_0x3ca994](_0xa938('0x5f'),_0x20df0c,_0x20df0c,_0x20df0c);}}else{_0x3b901d=_[_0xa938('0x60')](_0x145893,[_0xa938('0x29'),'ContactId']);_0x20bd2b[_0xa938('0x42')]=_0xa938('0x61');_0x52051f=as[_0xa938('0x62')](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}break;case _0xa938('0x65'):var _0x59fcee=_0x20bd2b[_0xa938('0x57')][_0xa938('0x66')](',')['map'](function(_0x1c876a){return Number(_0x1c876a);});_0x59fcee[_0xa938('0x2e')](function(_0x334beb){_0x35728e['or'](_0xa938('0x67'),'%,'+_0x334beb+',%');});_0x22895c=_['union'](_0x22895c,_0x59fcee);break;case _0xa938('0x68'):if(_0x20bd2b['operator']==='$substring'){_0xb8bd5e[_0x3ca994]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x20bd2b['value']+'%',null);}else{_0x3b901d=_[_0xa938('0x60')](_0x145893,[_0xa938('0x29'),_0xa938('0x69')]);_0x20bd2b[_0xa938('0x42')]=_0xa938('0x69');_0x52051f=as['buildExpression'](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f['value'][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}break;case _0xa938('0x6a'):_0x52051f=as[_0xa938('0x62')]('me',null,_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);break;}}else{var _0x52051f=as['buildExpression'](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}}}else{var _0x3d77a7=_(_0x18b13f[_0xa938('0x37')])[_0xa938('0x6b')]()[_0xa938('0x2b')](function(_0x4687d0){return _[_0xa938('0x6c')](_0x145893,['name',_0x4687d0])?_0x4687d0:undefined;})['compact']()[_0xa938('0x57')]();if(!_[_0xa938('0x6d')](_0x3d77a7)){_0x3d77a7['forEach'](function(_0x4b37ef){if(_0x4b37ef===_0xa938('0x6e')){_0x2e638f[_0xa938('0x6f')]('i.WhatsappAccountId\x20IN\x20?',[][_0xa938('0x70')](_0x18b13f[_0xa938('0x37')][_0x4b37ef]));}else if(_0x4b37ef===_0xa938('0x71')){var _0x597bbf=JSON[_0xa938('0x72')](_0x18b13f[_0xa938('0x37')][_0x4b37ef])[_0xa938('0x73')];var _0x176b48=JSON[_0xa938('0x72')](_0x18b13f[_0xa938('0x37')][_0x4b37ef])[_0xa938('0x74')];_0x2e638f[_0xa938('0x6f')](_0xa938('0x75'),_0x597bbf,_0x176b48);}else{if(_0x18b13f[_0xa938('0x37')][_0x4b37ef]==='null'){_0x2e638f[_0xa938('0x6f')]('i.'+_0x4b37ef+'\x20IS\x20NULL');}else{_0x2e638f['where']('i.'+_0x4b37ef+_0xa938('0x76'),_0x18b13f[_0xa938('0x37')][_0x4b37ef]);}}});}if(_0x18b13f[_0xa938('0x37')]['read']){if(_0x18b13f[_0xa938('0x37')][_0xa938('0x77')]==0x1){_0x2e638f[_0xa938('0x58')](_0xa938('0x78'));}else{_0x2e638f[_0xa938('0x58')](_0xa938('0x79'));}}if(_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')]){_0x22895c=_[_0xa938('0x7b')](_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')])?_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')]:new Array(_0x18b13f[_0xa938('0x37')]['tag']);_0x22895c[_0xa938('0x2e')](function(_0x36f1af){_0x35728e['or'](_0xa938('0x67'),'%,'+_0x36f1af+',%');});}if(_0x18b13f[_0xa938('0x37')]['filter']){var _0x21fbe6=_0x18b13f['query'][_0xa938('0x7c')][_0xa938('0x7d')]('\x5c','\x5c\x5c')[_0xa938('0x7d')](/'/g,'\x27\x27');if(qs[_0xa938('0x7e')](_0x21fbe6)){_0xb8bd5e['or'](_0xa938('0x7f'),_0x21fbe6+'%')['or'](_0xa938('0x80'),_0x21fbe6+'%');}else{_0xb8bd5e['or'](_0xa938('0x81'),qs[_0xa938('0x5e')](_0x21fbe6))['or'](_0xa938('0x82'),_0x21fbe6+'%');}}}_0x2e638f[_0xa938('0x6f')](_0xb8bd5e);_0x2e638f[_0xa938('0x83')](_0xa938('0x84'));var _0xfa3c56={'type':db[_0xa938('0x85')][_0xa938('0x86')]['SELECT'],'raw':!![]};var _0x36cf1a=_0x2e638f[_0xa938('0x87')]();_0x36cf1a[_0xa938('0x42')](_0xa938('0x84'));_0x36cf1a[_0xa938('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa938('0x56'));if(_0x255203[_0xa938('0x3e')]){_0x255203[_0xa938('0x3e')][_0xa938('0x2e')](function(_0x152a39){var _0x2d9e12=_0x152a39[0x0]===_0xa938('0x88')?_0x152a39[0x0]:'i.'+_0x152a39[0x0];_0x2e638f[_0xa938('0x3e')](_0x2d9e12,_0x152a39[0x1]===_0xa938('0x89')?![]:!![]);});}if(!_[_0xa938('0x6d')](_0x22895c)){_0x2e638f[_0xa938('0x58')](_0x35728e);_0x36cf1a[_0xa938('0x6f')](_0xa938('0x8a'),_0x22895c);}BPromise[_0xa938('0x8b')]()['then'](function(){if(!_0x55a883){if(_0x18b13f['query'][_0xa938('0x6e')])return;_0x36cf1a[_0xa938('0x6f')](_0xa938('0x8c'));_0x2e638f['where'](_0xa938('0x8c'));return;}if(_0x18b13f[_0xa938('0x8d')][_0xa938('0x8e')]!==_0xa938('0x8f'))return;return _0x18b13f[_0xa938('0x8d')][_0xa938('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d854a){if(_['isEmpty'](_0x3d854a)){_0x36cf1a[_0xa938('0x6f')](_0xa938('0x91'));_0x2e638f[_0xa938('0x6f')](_0xa938('0x91'));}else{_0x36cf1a[_0xa938('0x6f')](_0xa938('0x92'),_[_0xa938('0x2b')](_0x3d854a,'id'));_0x2e638f[_0xa938('0x6f')](_0xa938('0x92'),_[_0xa938('0x2b')](_0x3d854a,'id'));}});})[_0xa938('0x25')](function(){if(_0x18b13f[_0xa938('0x8d')][_0xa938('0x8e')]==='agent'&&!_0x55a883&&!_0x18b13f[_0xa938('0x37')][_0xa938('0x6e')])return[];return db['sequelize'][_0xa938('0x37')](_0x36cf1a[_0xa938('0x93')](),_0xfa3c56);})['then'](function(_0x5bbe5){_0x2de83d[_0xa938('0x20')]=_0x5bbe5[_0xa938('0x5c')];if(_0x2de83d[_0xa938('0x20')]===0x0)return[];return db[_0xa938('0x94')][_0xa938('0x37')](_0x546701[_0xa938('0x93')](),_0xfa3c56)['then'](function(_0x4a71d7){_0x6d2c99=_['keyBy'](_0x4a71d7,'id');_0xfa3c56=_[_0xa938('0x95')](_0xfa3c56,{'model':db[_0xa938('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18b13f[_0xa938('0x37')][_0xa938('0x3a')]){_0x255203['attributes'][_0xa938('0x2e')](function(_0x5cf515){_0x2e638f[_0xa938('0x42')]('i.'+_0x5cf515);});}else{_0x2e638f[_0xa938('0x42')](_0xa938('0x96'),_0xa938('0x56'));_0x2e638f[_0xa938('0x42')](_0xa938('0x97'),_0xa938('0x98'));_0x2e638f[_0xa938('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2e638f['field'](_0xa938('0x99'),_0xa938('0x88'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9a'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9b'),'Contact.firstName');_0x2e638f[_0xa938('0x42')]('c.lastName',_0xa938('0x9c'));_0x2e638f['field']('c.email',_0xa938('0x9d'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9e'),_0xa938('0x9f'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa0'),_0xa938('0xa1'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa2'),_0xa938('0xa3'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa4'),_0xa938('0xa5'));_0x2e638f['field'](_0xa938('0xa6'),_0xa938('0xa7'));_0x2e638f[_0xa938('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa938('0x2c'));}if(_0x255203['limit'])_0x2e638f[_0xa938('0x1f')](_0x255203[_0xa938('0x1f')]);if(_0x255203['offset'])_0x2e638f[_0xa938('0x1d')](_0x255203[_0xa938('0x1d')]);return db['sequelize'][_0xa938('0x37')](_0x2e638f[_0xa938('0x93')](),_0xfa3c56);})['then'](function(_0x2a880c){if(_0x2a880c['length']>0x0)_0x210bc7['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0xa938('0x2b')](_0x2a880c,'id'));return db['sequelize'][_0xa938('0x37')](_0x210bc7['toString'](),_0xfa3c56)[_0xa938('0x25')](function(_0x5d6f59){var _0x4d9d7d=_[_0xa938('0xa8')](_0x5d6f59,_0xa938('0xa9'));var _0x2342d3=[];_0x2a880c[_0xa938('0x2e')](function(_0x19bfb8){_0x2342d3[_0xa938('0xaa')](updateWhatsappInteraction(_0x19bfb8,_0x6d2c99,_0x4d9d7d));});return BPromise[_0xa938('0xab')](_0x2342d3);});});})[_0xa938('0x25')](function(_0x1dfff2){_0x2de83d[_0xa938('0xac')]=_0x1dfff2;return _0x2de83d;})[_0xa938('0x25')](respondWithFilteredResult(_0x9eb30b,_0x255203))[_0xa938('0x2f')](handleError(_0x9eb30b,null));};exports[_0xa938('0xad')]=function(_0x36b90e,_0x44bd08){var _0x2f03be={'raw':![],'where':{'id':_0x36b90e[_0xa938('0xae')]['id']}},_0x37048d={};_0x37048d[_0xa938('0x36')]=_['keys'](db[_0xa938('0x31')][_0xa938('0x32')]);_0x37048d[_0xa938('0x37')]=_[_0xa938('0x6b')](_0x36b90e[_0xa938('0x37')]);_0x37048d[_0xa938('0x38')]=_[_0xa938('0x39')](_0x37048d['model'],_0x37048d[_0xa938('0x37')]);_0x2f03be[_0xa938('0x3b')]=_['intersection'](_0x37048d[_0xa938('0x36')],qs[_0xa938('0x3a')](_0x36b90e[_0xa938('0x37')][_0xa938('0x3a')]));_0x2f03be[_0xa938('0x3b')]=_0x2f03be[_0xa938('0x3b')][_0xa938('0x5c')]?_0x2f03be['attributes']:_0x37048d[_0xa938('0x36')];if(_0x36b90e['query'][_0xa938('0xaf')]){_0x2f03be['include']=[{'all':!![]}];}_0x2f03be=_[_0xa938('0x95')]({},_0x2f03be,_0x36b90e[_0xa938('0xb0')]);return db[_0xa938('0x31')][_0xa938('0x60')](_0x2f03be)['then'](handleEntityNotFound(_0x44bd08,null))[_0xa938('0x25')](respondWithResult(_0x44bd08,null))[_0xa938('0x2f')](handleError(_0x44bd08,null));};exports[_0xa938('0xb1')]=function(_0x56fe9b,_0x557afc){return db['WhatsappInteraction'][_0xa938('0xb1')](_0x56fe9b[_0xa938('0x6a')],{})[_0xa938('0x25')](respondWithResult(_0x557afc,0xc9))[_0xa938('0x2f')](handleError(_0x557afc,null));};exports[_0xa938('0x24')]=function(_0x2ae38a,_0x495848){if(_0x2ae38a['body']['id']){delete _0x2ae38a['body']['id'];}return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x2ae38a[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x495848,null))[_0xa938('0x25')](saveUpdates(_0x2ae38a[_0xa938('0x6a')],null))['then'](respondWithResult(_0x495848,null))[_0xa938('0x2f')](handleError(_0x495848,null));};exports[_0xa938('0x26')]=function(_0x35a41b,_0x5552b4){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x35a41b[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x5552b4,null))[_0xa938('0x25')](removeEntity(_0x5552b4,null))[_0xa938('0x2f')](handleError(_0x5552b4,null));};exports[_0xa938('0xb2')]=function(_0xf4d657,_0x498039){return db[_0xa938('0x31')][_0xa938('0xb2')]()['then'](respondWithResult(_0x498039,null))[_0xa938('0x2f')](handleError(_0x498039,null));};exports[_0xa938('0xb3')]=function(_0x53cf99,_0x1e0f20,_0x95bff7){return db[_0xa938('0xb4')][_0xa938('0x60')]({'where':{'id':_0x53cf99[_0xa938('0xae')]['id']}})['then'](handleEntityNotFound(_0x1e0f20,null))[_0xa938('0x25')](function(_0xe7eb64){if(_0xe7eb64){return _0xe7eb64[_0xa938('0xb3')](_0x53cf99['body'][_0xa938('0xb5')],_['omit'](_0x53cf99[_0xa938('0x6a')],[_0xa938('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x1e0f20,null))[_0xa938('0x2f')](handleError(_0x1e0f20,null));};exports[_0xa938('0xb6')]=function(_0xea65ab,_0x60207f,_0x45ff17){var _0x28011a={'raw':![],'where':{}};var _0x4c80d7={};var _0x382396={'count':0x0,'rows':[]};return db[_0xa938('0x31')][_0xa938('0xb7')]({'where':{'id':_0xea65ab[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x60207f,null))[_0xa938('0x25')](function(_0x3e7e16){if(_0x3e7e16){_0x4c80d7[_0xa938('0x36')]=_['keys'](db[_0xa938('0xb4')][_0xa938('0x32')]);_0x4c80d7['query']=_[_0xa938('0x6b')](_0xea65ab['query']);_0x4c80d7[_0xa938('0x38')]=_[_0xa938('0x39')](_0x4c80d7[_0xa938('0x36')],_0x4c80d7[_0xa938('0x37')]);_0x28011a[_0xa938('0x3b')]=_[_0xa938('0x39')](_0x4c80d7['model'],qs['fields'](_0xea65ab['query'][_0xa938('0x3a')]));_0x28011a[_0xa938('0x3b')]=_0x28011a[_0xa938('0x3b')][_0xa938('0x5c')]?_0x28011a[_0xa938('0x3b')]:_0x4c80d7['model'];if(!_0xea65ab[_0xa938('0x37')][_0xa938('0x3c')]('nolimit')){_0x28011a[_0xa938('0x1f')]=qs[_0xa938('0x1f')](_0xea65ab[_0xa938('0x37')]['limit']);_0x28011a[_0xa938('0x1d')]=qs[_0xa938('0x1d')](_0xea65ab[_0xa938('0x37')][_0xa938('0x1d')]);}_0x28011a[_0xa938('0x3e')]=qs[_0xa938('0x3f')](_0xea65ab[_0xa938('0x37')]['sort']);_0x28011a[_0xa938('0x6f')]=qs[_0xa938('0x38')](_['pick'](_0xea65ab[_0xa938('0x37')],_0x4c80d7[_0xa938('0x38')]));_0x28011a[_0xa938('0x6f')][_0xa938('0xa9')]=_0x3e7e16['id'];if(_0xea65ab[_0xa938('0x37')][_0xa938('0x7c')]){_0x28011a['where']=_[_0xa938('0x95')](_0x28011a[_0xa938('0x6f')],{'$or':_[_0xa938('0x2b')](_0x28011a['attributes'],function(_0x131ded){var _0x4c8b15={};_0x4c8b15[_0x131ded]={'$like':'%'+_0xea65ab[_0xa938('0x37')][_0xa938('0x7c')]+'%'};return _0x4c8b15;})});}if(_0xea65ab['query'][_0xa938('0x73')]){var _0x901b2b=_0xea65ab['query'][_0xa938('0x73')][_0xa938('0x66')](',');var _0x2d88a4={};_0x2d88a4[_0x901b2b[0x0]]={'$gte':moment(_0x901b2b[0x1])[_0xa938('0xb8')](_0xa938('0xb9'))};_0x28011a[_0xa938('0x6f')]=_[_0xa938('0x95')](_0x28011a[_0xa938('0x6f')],_0x2d88a4);}_0x28011a=_['merge']({},_0x28011a,_0xea65ab[_0xa938('0xb0')]);return db[_0xa938('0xb4')][_0xa938('0x20')]({'where':_0x28011a[_0xa938('0x6f')]})[_0xa938('0x25')](function(_0x34e2c6){_0x382396['count']=_0x34e2c6;if(_0xea65ab[_0xa938('0x37')]['includeAll']){_0x28011a[_0xa938('0xba')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xa938('0xbb')](_0x28011a);})[_0xa938('0x25')](function(_0x5a1185){_0x382396[_0xa938('0xac')]=_0x5a1185;return _0x382396;});}})[_0xa938('0x25')](respondWithFilteredResult(_0x60207f,_0x28011a))[_0xa938('0x2f')](handleError(_0x60207f,null));};exports['addTags']=function(_0x227330,_0x498da5,_0x2317c7){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x227330[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x498da5,null))[_0xa938('0x25')](function(_0x340a83){if(_0x340a83){return _0x340a83[_0xa938('0xbc')](_0x227330[_0xa938('0x6a')][_0xa938('0xb5')],_[_0xa938('0xbd')](_0x227330[_0xa938('0x6a')],['ids','id'])||{})[_0xa938('0xbe')](function(){return db[_0xa938('0x65')][_0xa938('0xbb')]({'attributes':['id','name',_0xa938('0xbf')],'where':{'id':_0x227330[_0xa938('0x6a')]['ids']}});})[_0xa938('0x25')](function(_0x5c5dd7){socket[_0xa938('0xc0')]('whatsappInteractionTags:save',{'id':Number(_0x227330[_0xa938('0xae')]['id']),'tags':_0x5c5dd7||[]});return{'id':Number(_0x227330['params']['id']),'tags':_0x5c5dd7||[]};});}})[_0xa938('0x25')](respondWithResult(_0x498da5,null))[_0xa938('0x2f')](handleError(_0x498da5,null));};exports[_0xa938('0xc1')]=function(_0x74178c,_0x3db906,_0x26aa85){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x74178c[_0xa938('0xae')]['id']}})['then'](handleEntityNotFound(_0x3db906,null))[_0xa938('0x25')](function(_0x9c4945){if(_0x9c4945){return _0x9c4945[_0xa938('0xc1')](_0x74178c[_0xa938('0x37')][_0xa938('0xb5')]);}})[_0xa938('0x25')](respondWithStatusCode(_0x3db906,null))[_0xa938('0x2f')](handleError(_0x3db906,null));};exports[_0xa938('0xc2')]=function(_0x49c91c,_0x14fe1b){var _0x4669ed=moment()[_0xa938('0xc3')]()[_0xa938('0x93')]();var _0x1ca260=path[_0xa938('0xc4')](config[_0xa938('0xc5')],_0xa938('0xc6'),'files',_0xa938('0xc7'));var _0xe9578b=path[_0xa938('0xc4')](config[_0xa938('0xc5')],'server',_0xa938('0xc8'),_0xa938('0xc9'));var _0x2b1458=path[_0xa938('0xc4')](_0x1ca260,_0x4669ed);var _0x41b97d=util[_0xa938('0xb8')]('transcript-%d-%s.zip',_0x49c91c[_0xa938('0xae')]['id'],_0x4669ed);var _0x4b264a=path[_0xa938('0xc4')](_0x1ca260,_0x41b97d);var _0x548009=[];_0x548009['push']({'model':db[_0xa938('0x68')],'as':_0xa938('0x68'),'attributes':['id',_0xa938('0xca')],'raw':!![]});_0x548009[_0xa938('0xaa')]({'model':db[_0xa938('0xcb')],'as':_0xa938('0x5a'),'attributes':['id',_0xa938('0xcc'),_0xa938('0xcd')],'raw':!![]});if(_0x49c91c[_0xa938('0x37')][_0xa938('0xc9')]){_0x548009[_0xa938('0xaa')]({'model':db[_0xa938('0xce')],'as':_0xa938('0xce'),'raw':!![]});}var _0x59735c=[{'model':db[_0xa938('0xb4')],'as':_0xa938('0xcf'),'attributes':['id','body',_0xa938('0x71'),_0xa938('0xd0'),_0xa938('0xd1'),_0xa938('0x77')],'include':_0x548009}];_0x59735c[_0xa938('0xaa')]({'model':db[_0xa938('0xd2')],'as':_0xa938('0xd3'),'attributes':['id',_0xa938('0x29')]});_0x59735c[_0xa938('0xaa')]({'model':db[_0xa938('0x68')],'as':_0xa938('0xd4'),'attributes':['id',_0xa938('0xca')]});return db['WhatsappInteraction'][_0xa938('0x60')]({'where':{'id':_0x49c91c['params']['id']},'include':_0x59735c})[_0xa938('0x25')](handleEntityNotFound(_0x14fe1b,null))[_0xa938('0x25')](function(_0x15b6e8){if(_0x15b6e8){var _0x141977=_0x15b6e8[_0xa938('0xd5')]({'plain':!![]});fs[_0xa938('0xd6')](_0x2b1458);var _0x3df267={'channel':'Whatsapp','account':_0x141977[_0xa938('0xd3')][_0xa938('0x29')],'agent':_0x141977[_0xa938('0xd4')]?_0x141977[_0xa938('0xd4')][_0xa938('0xca')]:_0xa938('0xd7'),'createdAt':moment(_0x141977['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa938('0x93')](),'closedAt':_0x141977[_0xa938('0xd8')]?moment(_0x141977[_0xa938('0xd9')])[_0xa938('0xb8')](_0xa938('0xb9'))[_0xa938('0x93')]():'','disposition':_0x141977[_0xa938('0xda')],'messages':_(_0x141977[_0xa938('0xcf')])['filter']({'secret':![]})[_0xa938('0x2b')](function(_0x1c3d4a){if(_0x1c3d4a[_0xa938('0xce')]){var _0x20f992=path['join'](_0xe9578b,_0x1c3d4a['Attachment'][_0xa938('0xdb')]);if(fs[_0xa938('0xdc')](_0x20f992)){fs['createReadStream'](_0x20f992)['pipe'](fs[_0xa938('0xdd')](path[_0xa938('0xc4')](_0x2b1458,_0x1c3d4a['Attachment']['basename'])));}}return{'date':moment(_0x1c3d4a['createdAt'])[_0xa938('0xb8')](_0xa938('0xb9'))['toString'](),'sender':_0x1c3d4a[_0xa938('0xd0')]===_0xa938('0xde')?_0x1c3d4a[_0xa938('0x68')]?_0x1c3d4a[_0xa938('0x68')]['fullname']:_0xa938('0xdf'):_0x1c3d4a[_0xa938('0x5a')][_0xa938('0xcc')]+(_0x1c3d4a['Contact'][_0xa938('0xcd')]?'\x20'+_0x1c3d4a[_0xa938('0x5a')][_0xa938('0xcd')]:''),'body':_0x1c3d4a[_0xa938('0xce')]?_0x1c3d4a[_0xa938('0xce')]['basename']:_0x1c3d4a[_0xa938('0x6a')],'direction':_0x1c3d4a['direction']===_0xa938('0xde')?'A':'C','secret':_0x1c3d4a[_0xa938('0xd1')],'read':_0x1c3d4a[_0xa938('0x77')],'attachment':_0x1c3d4a['Attachment']};})[_0xa938('0x57')]()};return ejs['renderFile'](path['join'](config[_0xa938('0xc5')],'server',_0xa938('0xe0'),_0xa938('0xe1')),{'interaction':_0x3df267})[_0xa938('0x25')](function(_0x4f00ec){var _0x5d5d1e=path[_0xa938('0xc4')](_0x2b1458,_0xa938('0xe2')+_0x141977['id']+'-'+_0x4669ed+_0xa938('0xe3'));var _0x5dd307={'path':_0x5d5d1e,'channel':_0xa938('0xe4'),'interactionId':_0x141977['id']};return pdf[_0xa938('0xe5')](_0x4f00ec,_0x5dd307);})[_0xa938('0x25')](function(){return new BPromise(function(_0x3937f4,_0x40d981){zipdir(_0x2b1458,{'saveTo':_0x4b264a},function(_0x450b09,_0x32621a){if(_0x450b09)return _0x40d981(_0x450b09);return _0x3937f4(_0x32621a);});})[_0xa938('0x25')](function(){return new BPromise(function(_0x3e1d81,_0x1ac8c1){rimraf(_0x2b1458,function(_0x5cc809){if(_0x5cc809)_0x1ac8c1(_0x5cc809);return _0x3e1d81();});});})[_0xa938('0x25')](function(){return _0x14fe1b[_0xa938('0xc2')](_0x4b264a,_0x41b97d,function(_0x5cba63){if(_0x5cba63){console[_0xa938('0xe6')](_0xa938('0xe7'),_0x5cba63);}else{fs[_0xa938('0xe8')](_0x4b264a);}});});});}else{return _0x14fe1b[_0xa938('0x19')](0xc8);}})['catch'](handleError(_0x14fe1b,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 2c83086..dace68b 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 _0x3f8c=['setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','getUsers','then'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3f8c,0x104));var _0xc3f8=function(_0x479195,_0x11133d){_0x479195=_0x479195-0x0;var _0x170b98=_0x3f8c[_0x479195];return _0x170b98;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xc3f8('0x0')];var WhatsappMessage=require(_0xc3f8('0x1'))['db'][_0xc3f8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc3f8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e5dbd){return function(_0x51b8b5,_0x249286,_0x1a6976){_0x51b8b5[_0xc3f8('0x4')]({'attributes':['id'],'raw':!![]})[_0xc3f8('0x5')](function(_0x2bbaa5){_0x51b8b5[_0xc3f8('0x6')]('Users',_0x2bbaa5[_0xc3f8('0x7')](function(_0x315dff){return{'id':_0x315dff['id']};}));return WhatsappMessage[_0xc3f8('0x8')]({'where':{'WhatsappInteractionId':_0x51b8b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc3f8('0x5')](function(_0x148e6f){_0x51b8b5[_0xc3f8('0x6')](_0xc3f8('0x9'),_0x148e6f['length']);WhatsappInteractionEvents[_0xc3f8('0xa')](_0x4e5dbd+':'+_0x51b8b5['id'],_0x51b8b5);WhatsappInteractionEvents[_0xc3f8('0xa')](_0x4e5dbd,_0x51b8b5);_0x1a6976(null);})[_0xc3f8('0xb')](_0x1a6976(null));};}for(var e in events){if(events[_0xc3f8('0xc')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xc3f8('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6e77=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x5f2a50,_0x4700e0){var _0x7577ca=function(_0x45f47e){while(--_0x45f47e){_0x5f2a50['push'](_0x5f2a50['shift']());}};_0x7577ca(++_0x4700e0);}(_0x6e77,0xef));var _0x76e7=function(_0xf0cf28,_0x1a5fe2){_0xf0cf28=_0xf0cf28-0x0;var _0x2d367d=_0x6e77[_0xf0cf28];return _0x2d367d;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x76e7('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x76e7('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x76e7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x76e7('0x3'),'afterDestroy':_0x76e7('0x4')};function emitEvent(_0xcc6627){return function(_0x5eb27e,_0x498ec3,_0x423b7a){_0x5eb27e[_0x76e7('0x5')]({'attributes':['id'],'raw':!![]})[_0x76e7('0x6')](function(_0x5a5e94){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0x8'),_0x5a5e94[_0x76e7('0x9')](function(_0x5dbea3){return{'id':_0x5dbea3['id']};}));return WhatsappMessage[_0x76e7('0xa')]({'where':{'WhatsappInteractionId':_0x5eb27e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x76e7('0x6')](function(_0x57b048){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0xb'),_0x57b048[_0x76e7('0xc')]);WhatsappInteractionEvents[_0x76e7('0xd')](_0xcc6627+':'+_0x5eb27e['id'],_0x5eb27e);WhatsappInteractionEvents['emit'](_0xcc6627,_0x5eb27e);_0x423b7a(null);})[_0x76e7('0xe')](_0x423b7a(null));};}for(var e in events){if(events[_0x76e7('0xf')](e)){var event=events[e];WhatsappInteraction[_0x76e7('0x10')](e,emitEvent(event));}}module[_0x76e7('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 3afdec6..3a8f7f4 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 _0x22f0=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x22f0,0x159));var _0x022f=function(_0x38d5b2,_0xe77bf4){_0x38d5b2=_0x38d5b2-0x0;var _0x5b4ba8=_0x22f0[_0x38d5b2];return _0x5b4ba8;};'use strict';var _=require('lodash');var util=require(_0x022f('0x0'));var logger=require(_0x022f('0x1'))(_0x022f('0x2'));var moment=require(_0x022f('0x3'));var BPromise=require(_0x022f('0x4'));var rp=require(_0x022f('0x5'));var fs=require('fs');var path=require(_0x022f('0x6'));var rimraf=require(_0x022f('0x7'));var config=require(_0x022f('0x8'));var attributes=require(_0x022f('0x9'));module[_0x022f('0xa')]=function(_0x511a80,_0x1f85c8){return _0x511a80[_0x022f('0xb')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a2524,_0x1f851b,_0xc378d4){if(_0x1a2524[_0x022f('0xc')](_0x022f('0xd'))){_0x1a2524['closedAt']=moment()[_0x022f('0xe')](_0x022f('0xf'));}_0xc378d4(null,_0x1a2524);}}});}; \ No newline at end of file +var _0x3595=['lodash','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','closed','format'];(function(_0x632785,_0xa9e897){var _0x4b2fa4=function(_0x5141cb){while(--_0x5141cb){_0x632785['push'](_0x632785['shift']());}};_0x4b2fa4(++_0xa9e897);}(_0x3595,0x168));var _0x5359=function(_0x2e89cd,_0x3f6db6){_0x2e89cd=_0x2e89cd-0x0;var _0x218bb6=_0x3595[_0x2e89cd];return _0x218bb6;};'use strict';var _=require(_0x5359('0x0'));var util=require('util');var logger=require(_0x5359('0x1'))(_0x5359('0x2'));var moment=require(_0x5359('0x3'));var BPromise=require(_0x5359('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5359('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0x5359('0x6')]=function(_0x47ae94,_0x36de16){return _0x47ae94[_0x5359('0x7')](_0x5359('0x8'),attributes,{'tableName':_0x5359('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x93ded6,_0x494b88,_0x445c75){if(_0x93ded6['changed'](_0x5359('0xa'))){_0x93ded6['closedAt']=moment()[_0x5359('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x445c75(null,_0x93ded6);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 670871c..80a5312 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 _0x6d4d=['AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit'];(function(_0x598887,_0x570a0c){var _0x49ff73=function(_0x51a520){while(--_0x51a520){_0x598887['push'](_0x598887['shift']());}};_0x49ff73(++_0x570a0c);}(_0x6d4d,0x167));var _0xd6d4=function(_0xa3dae0,_0x3ca52f){_0xa3dae0=_0xa3dae0-0x0;var _0x32d050=_0x6d4d[_0xa3dae0];return _0x32d050;};'use strict';var _=require(_0xd6d4('0x0'));var util=require(_0xd6d4('0x1'));var moment=require(_0xd6d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6d4('0x3'));var fs=require('fs');var Redis=require(_0xd6d4('0x4'));var db=require(_0xd6d4('0x5'))['db'];var utils=require(_0xd6d4('0x6'));var logger=require(_0xd6d4('0x7'))(_0xd6d4('0x8'));var config=require(_0xd6d4('0x9'));var jayson=require(_0xd6d4('0xa'));var client=jayson[_0xd6d4('0xb')]['http']({'port':0x232a});config[_0xd6d4('0xc')]=_[_0xd6d4('0xd')](config[_0xd6d4('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6d4('0xc')]));require(_0xd6d4('0xe'))[_0xd6d4('0xf')](socket);function respondWithRpcPromise(_0xd6cdbc,_0x3e26d5,_0x30b0c3){return new BPromise(function(_0x2c8758,_0x5cd445){return client[_0xd6d4('0x10')](_0xd6cdbc,_0x30b0c3)[_0xd6d4('0x11')](function(_0x3f4073){logger[_0xd6d4('0x12')](_0xd6d4('0x13'),_0x3e26d5,_0xd6d4('0x14'));logger[_0xd6d4('0x15')](_0xd6d4('0x16'),_0x3e26d5,'request\x20sent',JSON[_0xd6d4('0x17')](_0x3f4073));if(_0x3f4073[_0xd6d4('0x18')]){if(_0x3f4073['error'][_0xd6d4('0x19')]===0x1f4){logger[_0xd6d4('0x18')](_0xd6d4('0x13'),_0x3e26d5,_0x3f4073[_0xd6d4('0x18')]['message']);return _0x5cd445(_0x3f4073[_0xd6d4('0x18')][_0xd6d4('0x1a')]);}logger[_0xd6d4('0x18')](_0xd6d4('0x13'),_0x3e26d5,_0x3f4073[_0xd6d4('0x18')][_0xd6d4('0x1a')]);return _0x2c8758(_0x3f4073[_0xd6d4('0x18')][_0xd6d4('0x1a')]);}else{logger[_0xd6d4('0x12')](_0xd6d4('0x13'),_0x3e26d5,'request\x20sent');_0x2c8758(_0x3f4073[_0xd6d4('0x1b')][_0xd6d4('0x1a')]);}})[_0xd6d4('0x1c')](function(_0x3add29){logger[_0xd6d4('0x18')](_0xd6d4('0x13'),_0x3e26d5,_0x3add29);_0x5cd445(_0x3add29);});});}exports[_0xd6d4('0x1d')]=function(_0x1c208b){var _0x58d068=this;return new Promise(function(_0x27f524,_0xde3b70){return db[_0xd6d4('0x1e')][_0xd6d4('0x1f')](_0x1c208b[_0xd6d4('0x20')],{'raw':_0x1c208b[_0xd6d4('0x21')]?_0x1c208b[_0xd6d4('0x21')][_0xd6d4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c208b[_0xd6d4('0x21')]?_0x1c208b['options'][_0xd6d4('0x23')]||null:null,'attributes':_0x1c208b[_0xd6d4('0x21')]?_0x1c208b[_0xd6d4('0x21')]['attributes']||null:null,'limit':_0x1c208b['options']?_0x1c208b[_0xd6d4('0x21')][_0xd6d4('0x24')]||null:null})[_0xd6d4('0x11')](function(_0xa201f9){logger[_0xd6d4('0x12')](_0xd6d4('0x1d'),_0x1c208b);logger[_0xd6d4('0x15')](_0xd6d4('0x1d'),_0x1c208b,JSON['stringify'](_0xa201f9));_0x27f524(_0xa201f9);})[_0xd6d4('0x1c')](function(_0x5bff58){logger['error']('UpdateWhatsappInteraction',_0x5bff58[_0xd6d4('0x1a')],_0x1c208b);_0xde3b70(_0x58d068[_0xd6d4('0x18')](0x1f4,_0x5bff58[_0xd6d4('0x1a')]));});});};exports[_0xd6d4('0x25')]=function(_0x5a9771){return new Promise(function(_0x5508f7,_0x44cf59){return db[_0xd6d4('0x1e')][_0xd6d4('0x26')]({'where':_0x5a9771[_0xd6d4('0x21')]?_0x5a9771['options'][_0xd6d4('0x23')]||null:null})[_0xd6d4('0x11')](function(_0x1c88f2){if(_0x1c88f2){return _0x1c88f2[_0xd6d4('0x27')](_0x5a9771[_0xd6d4('0x20')][_0xd6d4('0x28')],_[_0xd6d4('0x29')](_0x5a9771['body'],[_0xd6d4('0x28'),'id'])||{});}})[_0xd6d4('0x2a')](function(_0x5413c0){logger['info'](_0xd6d4('0x2b'),_0x5a9771);logger[_0xd6d4('0x15')](_0xd6d4('0x2b'),_0x5a9771,JSON['stringify'](_0x5413c0));_0x5508f7(_0x5413c0);})[_0xd6d4('0x1c')](function(_0x400b75){logger[_0xd6d4('0x18')]('AddTags',_0x400b75['message'],_0x5a9771);_0x44cf59(_this['error'](0x1f4,_0x400b75[_0xd6d4('0x1a')]));});});}; \ No newline at end of file +var _0x2d31=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2d31,0x1ec));var _0x12d3=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0x2d31[_0x3db122];return _0x325b67;};'use strict';var _=require('lodash');var util=require(_0x12d3('0x0'));var moment=require('moment');var BPromise=require(_0x12d3('0x1'));var rs=require(_0x12d3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12d3('0x3'))['db'];var utils=require(_0x12d3('0x4'));var logger=require('../../config/logger')(_0x12d3('0x5'));var config=require(_0x12d3('0x6'));var jayson=require(_0x12d3('0x7'));var client=jayson[_0x12d3('0x8')][_0x12d3('0x9')]({'port':0x232a});config[_0x12d3('0xa')]=_['defaults'](config[_0x12d3('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x12d3('0xb'))['register'](socket);function respondWithRpcPromise(_0x3d3b17,_0x1a8097,_0x42819b){return new BPromise(function(_0x4c3490,_0x28058b){return client[_0x12d3('0xc')](_0x3d3b17,_0x42819b)[_0x12d3('0xd')](function(_0x2e2536){logger['info'](_0x12d3('0xe'),_0x1a8097,_0x12d3('0xf'));logger[_0x12d3('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x1a8097,_0x12d3('0xf'),JSON['stringify'](_0x2e2536));if(_0x2e2536[_0x12d3('0x11')]){if(_0x2e2536[_0x12d3('0x11')][_0x12d3('0x12')]===0x1f4){logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);return _0x28058b(_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);}logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);return _0x4c3490(_0x2e2536['error'][_0x12d3('0x13')]);}else{logger[_0x12d3('0x14')](_0x12d3('0xe'),_0x1a8097,_0x12d3('0xf'));_0x4c3490(_0x2e2536[_0x12d3('0x15')][_0x12d3('0x13')]);}})[_0x12d3('0x16')](function(_0x2e4406){logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e4406);_0x28058b(_0x2e4406);});});}exports[_0x12d3('0x17')]=function(_0x66fd12){var _0x3db132=this;return new Promise(function(_0x37f70d,_0x5e0954){return db[_0x12d3('0x18')]['update'](_0x66fd12[_0x12d3('0x19')],{'raw':_0x66fd12['options']?_0x66fd12[_0x12d3('0x1a')][_0x12d3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12['options'][_0x12d3('0x1c')]||null:null,'attributes':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12[_0x12d3('0x1a')]['attributes']||null:null,'limit':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12[_0x12d3('0x1a')][_0x12d3('0x1d')]||null:null})[_0x12d3('0xd')](function(_0x45a323){logger[_0x12d3('0x14')](_0x12d3('0x17'),_0x66fd12);logger[_0x12d3('0x10')](_0x12d3('0x17'),_0x66fd12,JSON[_0x12d3('0x1e')](_0x45a323));_0x37f70d(_0x45a323);})[_0x12d3('0x16')](function(_0xacd6fd){logger['error'](_0x12d3('0x17'),_0xacd6fd[_0x12d3('0x13')],_0x66fd12);_0x5e0954(_0x3db132[_0x12d3('0x11')](0x1f4,_0xacd6fd[_0x12d3('0x13')]));});});};exports[_0x12d3('0x1f')]=function(_0x50e211){return new Promise(function(_0x3f2dc4,_0x5055a0){return db['WhatsappInteraction'][_0x12d3('0x20')]({'where':_0x50e211[_0x12d3('0x1a')]?_0x50e211[_0x12d3('0x1a')][_0x12d3('0x1c')]||null:null})[_0x12d3('0xd')](function(_0x151a3a){if(_0x151a3a){return _0x151a3a[_0x12d3('0x21')](_0x50e211['body'][_0x12d3('0x22')],_[_0x12d3('0x23')](_0x50e211['body'],['ids','id'])||{});}})[_0x12d3('0x24')](function(_0x4e9851){logger[_0x12d3('0x14')]('AddTags',_0x50e211);logger['debug']('AddTags',_0x50e211,JSON[_0x12d3('0x1e')](_0x4e9851));_0x3f2dc4(_0x4e9851);})[_0x12d3('0x16')](function(_0x17e870){logger['error'](_0x12d3('0x25'),_0x17e870[_0x12d3('0x13')],_0x50e211);_0x5055a0(_this[_0x12d3('0x11')](0x1f4,_0x17e870['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7d98e13..ff40ef3 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 _0x9aa1=['save','remove','update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x2d7806,_0x482612){var _0x55ed7b=function(_0x2208e0){while(--_0x2208e0){_0x2d7806['push'](_0x2d7806['shift']());}};_0x55ed7b(++_0x482612);}(_0x9aa1,0x11f));var _0x19aa=function(_0x1b5827,_0x31e942){_0x1b5827=_0x1b5827-0x0;var _0x3045e3=_0x9aa1[_0x1b5827];return _0x3045e3;};'use strict';var WhatsappInteractionEvents=require(_0x19aa('0x0'));var events=[_0x19aa('0x1'),_0x19aa('0x2'),_0x19aa('0x3')];function createListener(_0x4d4879,_0x291274){return function(_0x37718a){_0x291274[_0x19aa('0x4')](_0x4d4879,_0x37718a);};}function removeListener(_0x4039b1,_0x5bb19c){return function(){WhatsappInteractionEvents[_0x19aa('0x5')](_0x4039b1,_0x5bb19c);};}exports[_0x19aa('0x6')]=function(_0x4bd3eb){for(var _0x28a9c8=0x0,_0x147a2a=events['length'];_0x28a9c8<_0x147a2a;_0x28a9c8++){var _0x413c22=events[_0x28a9c8];var _0x14154f=createListener(_0x19aa('0x7')+_0x413c22,_0x4bd3eb);WhatsappInteractionEvents['on'](_0x413c22,_0x14154f);}}; \ No newline at end of file +var _0x93d6=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5a7680,_0x3f9c51){var _0x14e743=function(_0x2bfddd){while(--_0x2bfddd){_0x5a7680['push'](_0x5a7680['shift']());}};_0x14e743(++_0x3f9c51);}(_0x93d6,0x1aa));var _0x693d=function(_0x3b06a6,_0xb99922){_0x3b06a6=_0x3b06a6-0x0;var _0x70a37b=_0x93d6[_0x3b06a6];return _0x70a37b;};'use strict';var WhatsappInteractionEvents=require(_0x693d('0x0'));var events=[_0x693d('0x1'),_0x693d('0x2'),_0x693d('0x3')];function createListener(_0x2cf7e0,_0x25c43a){return function(_0x37aa0c){_0x25c43a[_0x693d('0x4')](_0x2cf7e0,_0x37aa0c);};}function removeListener(_0x4cdfb5,_0xb64ca1){return function(){WhatsappInteractionEvents[_0x693d('0x5')](_0x4cdfb5,_0xb64ca1);};}exports[_0x693d('0x6')]=function(_0x2793e6){for(var _0x84e70a=0x0,_0x2fda75=events[_0x693d('0x7')];_0x84e70a<_0x2fda75;_0x84e70a++){var _0x66432a=events[_0x84e70a];var _0x3ef8cc=createListener(_0x693d('0x8')+_0x66432a,_0x2793e6);WhatsappInteractionEvents['on'](_0x66432a,_0x3ef8cc);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index dcd70ee..c5587dc 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 _0x5c28=['accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept'];(function(_0x460e6,_0x2ff702){var _0x4c31b9=function(_0x57ab89){while(--_0x57ab89){_0x460e6['push'](_0x460e6['shift']());}};_0x4c31b9(++_0x2ff702);}(_0x5c28,0xac));var _0x85c2=function(_0x1843e2,_0x5d4fde){_0x1843e2=_0x1843e2-0x0;var _0x108ed8=_0x5c28[_0x1843e2];return _0x108ed8;};'use strict';var multer=require(_0x85c2('0x0'));var util=require(_0x85c2('0x1'));var path=require(_0x85c2('0x2'));var timeout=require(_0x85c2('0x3'));var express=require(_0x85c2('0x4'));var router=express[_0x85c2('0x5')]();var fs_extra=require(_0x85c2('0x6'));var auth=require(_0x85c2('0x7'));var interaction=require(_0x85c2('0x8'));var config=require(_0x85c2('0x9'));var controller=require(_0x85c2('0xa'));router[_0x85c2('0xb')]('/',auth[_0x85c2('0xc')](),controller[_0x85c2('0xd')]);router[_0x85c2('0xb')](_0x85c2('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x85c2('0xb')]('/:id',auth[_0x85c2('0xc')](),controller[_0x85c2('0xf')]);router[_0x85c2('0x10')]('/',auth['isAuthenticated'](),interaction[_0x85c2('0x11')](_0x85c2('0x12'),_0x85c2('0x13')),controller[_0x85c2('0x14')]);router[_0x85c2('0x10')](_0x85c2('0x15'),controller[_0x85c2('0x16')]);router['put']('/:id',auth[_0x85c2('0xc')](),controller[_0x85c2('0x17')]);router[_0x85c2('0x18')](_0x85c2('0x19'),auth[_0x85c2('0xc')](),controller[_0x85c2('0x1a')]);router[_0x85c2('0x18')](_0x85c2('0x1b'),auth[_0x85c2('0xc')](),controller[_0x85c2('0x1c')]);router[_0x85c2('0x1d')](_0x85c2('0x1e'),auth[_0x85c2('0xc')](),controller[_0x85c2('0x1f')]);module[_0x85c2('0x20')]=router; \ No newline at end of file +var _0x4d0f=['index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','update','put','accept','reject','multer','util','express','Router','fs-extra','../../config/environment','./whatsappMessage.controller','get'];(function(_0x4df1ee,_0x2788bd){var _0x41f8c5=function(_0x92e5de){while(--_0x92e5de){_0x4df1ee['push'](_0x4df1ee['shift']());}};_0x41f8c5(++_0x2788bd);}(_0x4d0f,0xb0));var _0xf4d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d0f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf4d0('0x0'));var util=require(_0xf4d0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4d0('0x2'));var router=express[_0xf4d0('0x3')]();var fs_extra=require(_0xf4d0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4d0('0x5'));var controller=require(_0xf4d0('0x6'));router[_0xf4d0('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4d0('0x8')]);router[_0xf4d0('0x7')](_0xf4d0('0x9'),auth[_0xf4d0('0xa')](),controller[_0xf4d0('0xb')]);router[_0xf4d0('0x7')](_0xf4d0('0xc'),auth['isAuthenticated'](),controller[_0xf4d0('0xd')]);router[_0xf4d0('0xe')]('/',auth[_0xf4d0('0xa')](),interaction[_0xf4d0('0xf')](_0xf4d0('0x10'),_0xf4d0('0x11')),controller['create']);router['post'](_0xf4d0('0x12'),controller['status']);router['put'](_0xf4d0('0xc'),auth[_0xf4d0('0xa')](),controller[_0xf4d0('0x13')]);router[_0xf4d0('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0xf4d0('0x15')]);router[_0xf4d0('0x14')]('/:id/reject',auth[_0xf4d0('0xa')](),controller[_0xf4d0('0x16')]);router['delete'](_0xf4d0('0xc'),auth['isAuthenticated'](),controller['destroy']);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 f39633c..71e3552 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 _0x3f19=['TEXT','exports','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f19,0x1f1));var _0x93f1=function(_0x6c225b,_0x4de56c){_0x6c225b=_0x6c225b-0x0;var _0x268839=_0x3f19[_0x6c225b];return _0x268839;};'use strict';var Sequelize=require('sequelize');module[_0x93f1('0x0')]={'body':{'type':Sequelize['TEXT'](_0x93f1('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x93f1('0x2')]('in',_0x93f1('0x3')),'defaultValue':_0x93f1('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x93f1('0x4')](0xbe)},'phone':{'type':Sequelize[_0x93f1('0x4')]},'readAt':{'type':Sequelize[_0x93f1('0x5')]},'secret':{'type':Sequelize[_0x93f1('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x93f1('0x4')]},'providerResponse':{'type':Sequelize[_0x93f1('0x7')]}}; \ No newline at end of file +var _0xfb9e=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xfb9e,0x1d5));var _0xefb9=function(_0x401b1a,_0x24bddf){_0x401b1a=_0x401b1a-0x0;var _0x51e72f=_0xfb9e[_0x401b1a];return _0x51e72f;};'use strict';var Sequelize=require(_0xefb9('0x0'));module[_0xefb9('0x1')]={'body':{'type':Sequelize[_0xefb9('0x2')](_0xefb9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xefb9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xefb9('0x5')),'defaultValue':_0xefb9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xefb9('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xefb9('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xefb9('0x6')]},'providerResponse':{'type':Sequelize[_0xefb9('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7090bb2..92e3173 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 _0x87cb=['attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappMessage','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','whatsapp-interactions','get','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','motionChannel','event','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x148f93,_0x299971){var _0x3ebc4b=function(_0xcbf0a6){while(--_0xcbf0a6){_0x148f93['push'](_0x148f93['shift']());}};_0x3ebc4b(++_0x299971);}(_0x87cb,0xdc));var _0xb87c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x87cb[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb87c('0x3'));var moment=require(_0xb87c('0x4'));var BPromise=require(_0xb87c('0x5'));var Mustache=require('mustache');var util=require(_0xb87c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb87c('0x7'));var ejs=require(_0xb87c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb87c('0x9'));var squel=require(_0xb87c('0xa'));var crypto=require(_0xb87c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb87c('0x7'));var querystring=require(_0xb87c('0xc'));var Papa=require('papaparse');var Redis=require(_0xb87c('0xd'));var authService=require(_0xb87c('0xe'));var qs=require(_0xb87c('0xf'));var as=require(_0xb87c('0x10'));var hardwareService=require(_0xb87c('0x11'));var logger=require(_0xb87c('0x12'))('api');var utils=require(_0xb87c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb87c('0x14'))['db'];config[_0xb87c('0x15')]=_[_0xb87c('0x16')](config['redis'],{'host':_0xb87c('0x17'),'port':0x18eb});var socket=require(_0xb87c('0x18'))(new Redis(config[_0xb87c('0x15')]));require(_0xb87c('0x19'))[_0xb87c('0x1a')](socket);var jayson=require(_0xb87c('0x1b'));var client=jayson['client'][_0xb87c('0x1c')]({'port':0x232c});var client9002=jayson[_0xb87c('0x1d')][_0xb87c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xaea86e,_0x2621b7,_0x4cc863,_0x13669f){return new BPromise(function(_0x4131c6,_0x1cc174){var _0x38cc45=_0x13669f||client;return _0x38cc45[_0xb87c('0x1e')](_0xaea86e,_0x4cc863)[_0xb87c('0x1f')](function(_0x119215){logger[_0xb87c('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x2621b7,_0xb87c('0x21'));logger['debug'](_0xb87c('0x22'),_0x2621b7,_0xb87c('0x21'),JSON[_0xb87c('0x23')](_0x119215));if(_0x119215[_0xb87c('0x24')]){if(_0x119215[_0xb87c('0x24')][_0xb87c('0x25')]===0x1f4){logger['error'](_0xb87c('0x26'),_0x2621b7,_0x119215[_0xb87c('0x24')]['message']);return _0x1cc174(_0x119215[_0xb87c('0x24')][_0xb87c('0x27')]);}logger[_0xb87c('0x24')](_0xb87c('0x26'),_0x2621b7,_0x119215[_0xb87c('0x24')][_0xb87c('0x27')]);return _0x4131c6(_0x119215[_0xb87c('0x24')][_0xb87c('0x27')]);}else{logger['info'](_0xb87c('0x26'),_0x2621b7,_0xb87c('0x21'));_0x4131c6(_0x119215[_0xb87c('0x28')]['message']);}})['catch'](function(_0x56bccb){logger[_0xb87c('0x24')](_0xb87c('0x26'),_0x2621b7,_0x56bccb);_0x1cc174(_0x56bccb);});});}function respondWithStatusCode(_0x23b7bc,_0x34ce42){_0x34ce42=_0x34ce42||0xcc;return function(_0x183848){if(_0x183848){return _0x23b7bc[_0xb87c('0x29')](_0x34ce42);}return _0x23b7bc['status'](_0x34ce42)[_0xb87c('0x2a')]();};}function respondWithResult(_0x158940,_0x444837){_0x444837=_0x444837||0xc8;return function(_0x1247d){if(_0x1247d){return _0x158940[_0xb87c('0x2b')](_0x444837)[_0xb87c('0x2c')](_0x1247d);}};}function respondWithFilteredResult(_0x3cea63,_0x5ac6e0){return function(_0x5ce03e){if(_0x5ce03e){var _0x4a3c27=typeof _0x5ac6e0[_0xb87c('0x2d')]===_0xb87c('0x2e')&&typeof _0x5ac6e0['limit']===_0xb87c('0x2e');var _0x23427c=_0x5ce03e[_0xb87c('0x2f')];var _0x3d69ac=_0x4a3c27?0x0:_0x5ac6e0[_0xb87c('0x2d')];var _0x1bb13a=_0x4a3c27?_0x5ce03e[_0xb87c('0x2f')]:_0x5ac6e0[_0xb87c('0x2d')]+_0x5ac6e0['limit'];var _0x2abf03;if(_0x1bb13a>=_0x23427c){_0x1bb13a=_0x23427c;_0x2abf03=0xc8;}else{_0x2abf03=0xce;}_0x3cea63[_0xb87c('0x2b')](_0x2abf03);return _0x3cea63[_0xb87c('0x30')](_0xb87c('0x31'),_0x3d69ac+'-'+_0x1bb13a+'/'+_0x23427c)[_0xb87c('0x2c')](_0x5ce03e);}return null;};}function patchUpdates(_0x101910){return function(_0x3c2031){try{jsonpatch['apply'](_0x3c2031,_0x101910,!![]);}catch(_0x5c12bc){return BPromise[_0xb87c('0x32')](_0x5c12bc);}return _0x3c2031['save']();};}function saveUpdates(_0x4e2ab0,_0x4fcff3){return function(_0x102b2d){if(_0x102b2d){return _0x102b2d[_0xb87c('0x33')](_0x4e2ab0)['then'](function(_0x4c0712){return _0x4c0712;});}return null;};}function removeEntity(_0xbbb38,_0x46953a){return function(_0x52dfbb){if(_0x52dfbb){return _0x52dfbb[_0xb87c('0x34')]()[_0xb87c('0x1f')](function(){_0xbbb38[_0xb87c('0x2b')](0xcc)[_0xb87c('0x2a')]();});}};}function handleEntityNotFound(_0x2328e7,_0x489f13){return function(_0x7bee03){if(!_0x7bee03){_0x2328e7[_0xb87c('0x29')](0x194);}return _0x7bee03;};}function handleError(_0x4927f4,_0x77834b){_0x77834b=_0x77834b||0x1f4;return function(_0x10c477){logger[_0xb87c('0x24')](_0x10c477['stack']);if(_0x10c477[_0xb87c('0x35')]){delete _0x10c477[_0xb87c('0x35')];}_0x4927f4['status'](_0x77834b)[_0xb87c('0x36')](_0x10c477);};}exports[_0xb87c('0x37')]=function(_0x2b4f29,_0x423b59){var _0x19f156={},_0x301970={},_0x906bb1={'count':0x0,'rows':[]};var _0x915bf0=_[_0xb87c('0x38')](db['WhatsappMessage'][_0xb87c('0x39')],function(_0x1e734d){return{'name':_0x1e734d[_0xb87c('0x3a')],'type':_0x1e734d[_0xb87c('0x3b')][_0xb87c('0x3c')]};});_0x301970['model']=_[_0xb87c('0x38')](_0x915bf0,_0xb87c('0x35'));_0x301970[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0x2b4f29[_0xb87c('0x3d')]);_0x301970[_0xb87c('0x3f')]=_['intersection'](_0x301970['model'],_0x301970[_0xb87c('0x3d')]);_0x19f156[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x301970[_0xb87c('0x42')],qs[_0xb87c('0x43')](_0x2b4f29[_0xb87c('0x3d')][_0xb87c('0x43')]));_0x19f156['attributes']=_0x19f156[_0xb87c('0x40')][_0xb87c('0x44')]?_0x19f156[_0xb87c('0x40')]:_0x301970[_0xb87c('0x42')];if(!_0x2b4f29[_0xb87c('0x3d')][_0xb87c('0x45')](_0xb87c('0x46'))){_0x19f156[_0xb87c('0x47')]=qs[_0xb87c('0x47')](_0x2b4f29[_0xb87c('0x3d')][_0xb87c('0x47')]);_0x19f156[_0xb87c('0x2d')]=qs[_0xb87c('0x2d')](_0x2b4f29[_0xb87c('0x3d')]['offset']);}_0x19f156[_0xb87c('0x48')]=qs['sort'](_0x2b4f29[_0xb87c('0x3d')][_0xb87c('0x49')]);_0x19f156[_0xb87c('0x4a')]=qs[_0xb87c('0x3f')](_[_0xb87c('0x4b')](_0x2b4f29[_0xb87c('0x3d')],_0x301970['filters']),_0x915bf0);if(_0x2b4f29[_0xb87c('0x3d')]['filter']){_0x19f156[_0xb87c('0x4a')]=_[_0xb87c('0x4c')](_0x19f156[_0xb87c('0x4a')],{'$or':_[_0xb87c('0x38')](_0x915bf0,function(_0x49ce33){if(_0x49ce33['type']!==_0xb87c('0x4d')){var _0x35aaa7={};_0x35aaa7[_0x49ce33[_0xb87c('0x35')]]={'$like':'%'+_0x2b4f29[_0xb87c('0x3d')][_0xb87c('0x4e')]+'%'};return _0x35aaa7;}})});}_0x19f156=_[_0xb87c('0x4c')]({},_0x19f156,_0x2b4f29[_0xb87c('0x4f')]);var _0x347295={'where':_0x19f156[_0xb87c('0x4a')]};return db[_0xb87c('0x50')][_0xb87c('0x2f')](_0x347295)['then'](function(_0x20826e){_0x906bb1[_0xb87c('0x2f')]=_0x20826e;if(_0x2b4f29[_0xb87c('0x3d')]['includeAll']){_0x19f156[_0xb87c('0x51')]=[{'all':!![]}];}return db[_0xb87c('0x50')][_0xb87c('0x52')](_0x19f156);})[_0xb87c('0x1f')](function(_0x4d4562){_0x906bb1[_0xb87c('0x53')]=_0x4d4562;return _0x906bb1;})[_0xb87c('0x1f')](respondWithFilteredResult(_0x423b59,_0x19f156))[_0xb87c('0x54')](handleError(_0x423b59,null));};exports[_0xb87c('0x55')]=function(_0xa12b2,_0x675173){var _0x59a887={'raw':!![],'where':{'id':_0xa12b2[_0xb87c('0x56')]['id']}},_0x3bcb2f={};_0x3bcb2f[_0xb87c('0x42')]=_[_0xb87c('0x3e')](db['WhatsappMessage'][_0xb87c('0x39')]);_0x3bcb2f[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0xa12b2[_0xb87c('0x3d')]);_0x3bcb2f[_0xb87c('0x3f')]=_[_0xb87c('0x41')](_0x3bcb2f['model'],_0x3bcb2f[_0xb87c('0x3d')]);_0x59a887[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x3bcb2f['model'],qs['fields'](_0xa12b2[_0xb87c('0x3d')]['fields']));_0x59a887[_0xb87c('0x40')]=_0x59a887[_0xb87c('0x40')]['length']?_0x59a887['attributes']:_0x3bcb2f['model'];if(_0xa12b2[_0xb87c('0x3d')][_0xb87c('0x57')]){_0x59a887['include']=[{'all':!![]}];}_0x59a887=_[_0xb87c('0x4c')]({},_0x59a887,_0xa12b2['options']);return db[_0xb87c('0x50')][_0xb87c('0x58')](_0x59a887)[_0xb87c('0x1f')](handleEntityNotFound(_0x675173,null))[_0xb87c('0x1f')](respondWithResult(_0x675173,null))[_0xb87c('0x54')](handleError(_0x675173,null));};exports['create']=function(_0xad6f4d,_0x4cfe0f){return db['WhatsappMessage'][_0xb87c('0x59')](_0xad6f4d['body'],{})[_0xb87c('0x1f')](respondWithResult(_0x4cfe0f,0xc9))['catch'](handleError(_0x4cfe0f,null));};exports['update']=function(_0x11b608,_0xbd2d78){if(_0x11b608[_0xb87c('0x5a')]['id']){delete _0x11b608[_0xb87c('0x5a')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x11b608['params']['id']}})[_0xb87c('0x1f')](handleEntityNotFound(_0xbd2d78,null))[_0xb87c('0x1f')](saveUpdates(_0x11b608[_0xb87c('0x5a')],null))[_0xb87c('0x1f')](respondWithResult(_0xbd2d78,null))['catch'](handleError(_0xbd2d78,null));};exports[_0xb87c('0x34')]=function(_0x41c573,_0x5c4b68){return db[_0xb87c('0x50')][_0xb87c('0x58')]({'where':{'id':_0x41c573[_0xb87c('0x56')]['id']}})[_0xb87c('0x1f')](handleEntityNotFound(_0x5c4b68,null))['then'](removeEntity(_0x5c4b68,null))[_0xb87c('0x54')](handleError(_0x5c4b68,null));};exports[_0xb87c('0x5b')]=function(_0x1e8b05,_0x30f6df){return db[_0xb87c('0x50')][_0xb87c('0x5b')]()[_0xb87c('0x1f')](respondWithResult(_0x30f6df,null))[_0xb87c('0x54')](handleError(_0x30f6df,null));};var interaction_log=require(_0xb87c('0x12'))('whatsapp-interactions');exports['accept']=function(_0xac2ab0,_0x1b55c8,_0x2235d1){var _0x302ede={'agent':{},'channel':_0xb87c('0x5c')};if(_0xac2ab0[_0xb87c('0x5a')]['id']){delete _0xac2ab0[_0xb87c('0x5a')]['id'];}_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x5d')]=!![];_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x5e')]=moment()[_0xb87c('0x5f')](_0xb87c('0x60'));_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x61')]=_0xac2ab0[_0xb87c('0x5a')]['UserId']||_0xac2ab0[_0xb87c('0x62')]['id'];_0x302ede[_0xb87c('0x63')]['id']=_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x61')];return db[_0xb87c('0x50')][_0xb87c('0x58')]({'where':{'id':_0xac2ab0[_0xb87c('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b55c8,null))['then'](saveUpdates(_0xac2ab0[_0xb87c('0x5a')],null))[_0xb87c('0x1f')](function(_0x4dfbb9){if(_0x4dfbb9){_0x302ede['message']=_0x4dfbb9['get']({'plain':!![]});return db['WhatsappInteraction'][_0xb87c('0x58')]({'where':{'id':_0x4dfbb9[_0xb87c('0x64')]}});}return null;})[_0xb87c('0x1f')](handleEntityNotFound(_0x1b55c8,null))[_0xb87c('0x1f')](function(_0x42b264){if(_0x42b264){return _0x42b264[_0xb87c('0x33')]({'UserId':_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x61')],'read1stAt':_[_0xb87c('0x65')](_0x42b264[_0xb87c('0x66')])?moment()[_0xb87c('0x5f')](_0xb87c('0x60')):undefined});}return null;})[_0xb87c('0x1f')](function(_0x5bfaa3){if(_0x5bfaa3){_0x302ede[_0xb87c('0x67')]=_0x5bfaa3['get']({'plain':!![]});interaction_log[_0xb87c('0x20')](_0xb87c('0x68'),_0xac2ab0['user']['id'],_0xac2ab0[_0xb87c('0x62')][_0xb87c('0x35')],_0xac2ab0[_0xb87c('0x62')][_0xb87c('0x69')],_0x302ede['interaction']['id'],_0xac2ab0[_0xb87c('0x5a')]?JSON[_0xb87c('0x23')](_0xac2ab0[_0xb87c('0x5a')]):_0xb87c('0x6a'));return respondWithRpcPromise(_0xb87c('0x6b'),_0xb87c('0x6c'),_0x302ede);}return null;})['then'](function(_0x1601fd){var _0x3985ca=_0xb87c('0x6d')+_0x1601fd[_0xb87c('0x27')]['ContactId'];return db['sequelize'][_0xb87c('0x3d')](_0x3985ca,{'type':db[_0xb87c('0x6e')][_0xb87c('0x6f')]['SELECT'],'raw':!![]})[_0xb87c('0x1f')](function(_0x2c88cc){return _0x2c88cc;});})[_0xb87c('0x1f')](function(_0x54d933){if(_0x54d933){_0x302ede[_0xb87c('0x27')][_0xb87c('0x70')]=_0x54d933[0x0];if(!_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x61')])return;return db[_0xb87c('0x71')][_0xb87c('0x58')]({'where':{'id':_0xac2ab0[_0xb87c('0x5a')][_0xb87c('0x61')],'role':_0xb87c('0x63')},'attributes':['id',_0xb87c('0x35'),_0xb87c('0x72'),_0xb87c('0x73'),_0xb87c('0x74')],'raw':!![]});}return null;})[_0xb87c('0x1f')](function(_0x46e58e){if(!_0x46e58e)return null;_0x302ede['message']['agent']=_0x46e58e;return _0x302ede;})[_0xb87c('0x1f')](function(_0x359d20){if(_0x359d20){if(_0xac2ab0['body'][_0xb87c('0x75')]){_0x302ede[_0xb87c('0x27')][_0xb87c('0x76')]=util[_0xb87c('0x5f')](_0xb87c('0x77'),_0xac2ab0[_0xb87c('0x62')]['name']);_0x302ede['message'][_0xb87c('0x78')]=_0x302ede[_0xb87c('0x78')];_0x302ede[_0xb87c('0x27')]['motionChannel']=_0x302ede[_0xb87c('0x78')];_0x302ede['message']['event']='accept';return respondWithRpcPromise(_0xb87c('0x79'),'EventManager',{'event':_0xb87c('0x7a'),'message':_0x302ede['message']},client9002)[_0xb87c('0x1f')](function(){return _0x302ede;});}return _0x302ede;}return null;})[_0xb87c('0x1f')](respondWithResult(_0x1b55c8,null))[_0xb87c('0x54')](handleError(_0x1b55c8,null));};var interaction_log=require('../../config/logger')(_0xb87c('0x7b'));exports[_0xb87c('0x32')]=function(_0x358468,_0x1f6b84,_0x42e546){var _0x3ae403={'agent':{},'channel':_0xb87c('0x5c')};if(_0x358468[_0xb87c('0x5a')]['id']){delete _0x358468['body']['id'];}_0x358468['body']['UserId']=_0x358468[_0xb87c('0x5a')][_0xb87c('0x61')]||_0x358468[_0xb87c('0x62')]['id'];_0x3ae403[_0xb87c('0x63')]['id']=_0x358468['body'][_0xb87c('0x61')];return db['WhatsappMessage'][_0xb87c('0x58')]({'where':{'id':_0x358468[_0xb87c('0x56')]['id'],'UserId':null}})[_0xb87c('0x1f')](handleEntityNotFound(_0x1f6b84,null))['then'](function(_0x519407){if(_0x519407){_0x3ae403[_0xb87c('0x27')]=_0x519407[_0xb87c('0x7c')]({'plain':!![]});return db[_0xb87c('0x7d')][_0xb87c('0x58')]({'where':{'id':_0x519407[_0xb87c('0x64')]}});}return null;})[_0xb87c('0x1f')](handleEntityNotFound(_0x1f6b84,null))[_0xb87c('0x1f')](function(_0x733b7c){if(_0x733b7c){_0x3ae403[_0xb87c('0x67')]=_0x733b7c[_0xb87c('0x7c')]({'plain':!![]});interaction_log['info'](_0xb87c('0x7e'),_0x358468[_0xb87c('0x62')]['id'],_0x358468[_0xb87c('0x62')][_0xb87c('0x35')],_0x358468[_0xb87c('0x62')][_0xb87c('0x69')],_0x3ae403[_0xb87c('0x67')]['id'],_0x358468['body']?JSON[_0xb87c('0x23')](_0x358468[_0xb87c('0x5a')]):_0xb87c('0x6a'));return respondWithRpcPromise(_0xb87c('0x7f'),_0xb87c('0x80'),_0x3ae403);}return null;})[_0xb87c('0x1f')](function(_0x48423e){var _0x5ac59d=_0xb87c('0x6d')+_0x48423e[_0xb87c('0x27')][_0xb87c('0x81')];return db[_0xb87c('0x82')][_0xb87c('0x3d')](_0x5ac59d,{'type':db['Sequelize'][_0xb87c('0x6f')]['SELECT'],'raw':!![]})[_0xb87c('0x1f')](function(_0x353248){return _0x353248;});})[_0xb87c('0x1f')](function(_0x4159f8){if(_0x4159f8){_0x3ae403[_0xb87c('0x27')][_0xb87c('0x70')]=_0x4159f8[0x0];if(!_0x358468['body'][_0xb87c('0x61')])return;return db[_0xb87c('0x71')]['find']({'where':{'id':_0x358468[_0xb87c('0x5a')]['UserId'],'role':_0xb87c('0x63')},'attributes':['id',_0xb87c('0x35'),_0xb87c('0x72'),'email',_0xb87c('0x74')],'raw':!![]});}return null;})['then'](function(_0x5f2896){if(!_0x5f2896)return null;_0x3ae403[_0xb87c('0x27')][_0xb87c('0x63')]=_0x5f2896;return _0x3ae403;})[_0xb87c('0x1f')](function(_0x2a6487){if(_0x2a6487){_0x2a6487[_0xb87c('0x27')][_0xb87c('0x76')]=util['format']('SIP/%s',_0x358468[_0xb87c('0x62')][_0xb87c('0x35')]);_0x2a6487[_0xb87c('0x27')][_0xb87c('0x78')]=_0x3ae403[_0xb87c('0x78')];_0x2a6487[_0xb87c('0x27')][_0xb87c('0x83')]=_0x3ae403['channel'];_0x2a6487[_0xb87c('0x27')][_0xb87c('0x84')]='reject';respondWithRpcPromise('EventManager',_0xb87c('0x79'),{'event':_0xb87c('0x85'),'message':_0x2a6487[_0xb87c('0x27')]},client9002);return _0x3ae403;}return null;})['then'](respondWithResult(_0x1f6b84,null))['catch'](handleError(_0x1f6b84,null));};exports[_0xb87c('0x2b')]=function(_0x2bf088,_0xade46a,_0x331969){if(_0x2bf088[_0xb87c('0x5a')]['id']){delete _0x2bf088[_0xb87c('0x5a')]['id'];}var _0x264672;return db[_0xb87c('0x50')][_0xb87c('0x58')]({'where':{'id':_0x2bf088[_0xb87c('0x56')]['id']}})['then'](handleEntityNotFound(_0xade46a,null))[_0xb87c('0x1f')](function(_0x2844fd){if(_0x2844fd){_0x264672=_0x2844fd;return db[_0xb87c('0x86')][_0xb87c('0x58')]({'where':{'id':_0x2844fd['WhatsappAccountId']}});}})[_0xb87c('0x1f')](handleEntityNotFound(_0xade46a,null))[_0xb87c('0x1f')](function(_0x3da209){if(_0x3da209){logger['debug'](_0xb87c('0x87'),_0xb87c('0x2b'),_0xb87c('0x88'),_0x3da209['type'],util['inspect'](_0x2bf088[_0xb87c('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3da209[_0xb87c('0x3b')]){case _0xb87c('0x89'):if(_0x2bf088[_0xb87c('0x5a')][_0xb87c('0x8a')]&&_0x2bf088[_0xb87c('0x5a')][_0xb87c('0x8a')]===_0x264672[_0xb87c('0x8b')]&&_0x2bf088[_0xb87c('0x5a')]['MessageStatus']&&_0x2bf088['body'][_0xb87c('0x8c')]===_0xb87c('0x5d')){return _0x264672['update']({'read':!![]});}else{logger['error'](_0xb87c('0x8d'),_0xb87c('0x2b'),_0xb87c('0x89'),util['inspect'](_0x2bf088[_0xb87c('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x264672;}})[_0xb87c('0x1f')](respondWithResult(_0xade46a,null))[_0xb87c('0x54')](handleError(_0xade46a,null));}; \ No newline at end of file +var _0x3c61=['User','email','event','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage'];(function(_0x49fa98,_0x11accf){var _0x1698f1=function(_0x22f95f){while(--_0x22f95f){_0x49fa98['push'](_0x49fa98['shift']());}};_0x1698f1(++_0x11accf);}(_0x3c61,0x11a));var _0x13c6=function(_0x374e03,_0x10c8d7){_0x374e03=_0x374e03-0x0;var _0x137e46=_0x3c61[_0x374e03];return _0x137e46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x13c6('0x0'));var jsonpatch=require(_0x13c6('0x1'));var rp=require('request-promise');var moment=require(_0x13c6('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13c6('0x3'));var path=require(_0x13c6('0x4'));var sox=require('sox');var csv=require(_0x13c6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13c6('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x13c6('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x13c6('0x8'));var toCsv=require(_0x13c6('0x5'));var querystring=require(_0x13c6('0x9'));var Papa=require(_0x13c6('0xa'));var Redis=require(_0x13c6('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x13c6('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13c6('0xd'));var logger=require(_0x13c6('0xe'))(_0x13c6('0xf'));var utils=require(_0x13c6('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x13c6('0x11'));var db=require(_0x13c6('0x12'))['db'];config[_0x13c6('0x13')]=_[_0x13c6('0x14')](config[_0x13c6('0x13')],{'host':_0x13c6('0x15'),'port':0x18eb});var socket=require(_0x13c6('0x16'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x13c6('0x17'));var client=jayson[_0x13c6('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0x13c6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x46359b,_0x1319ca,_0x150a9d,_0x275020){return new BPromise(function(_0x48eeb7,_0x4d1889){var _0x42c45b=_0x275020||client;return _0x42c45b[_0x13c6('0x1a')](_0x46359b,_0x150a9d)[_0x13c6('0x1b')](function(_0xd88a4b){logger['info'](_0x13c6('0x1c'),_0x1319ca,_0x13c6('0x1d'));logger['debug'](_0x13c6('0x1e'),_0x1319ca,_0x13c6('0x1d'),JSON['stringify'](_0xd88a4b));if(_0xd88a4b[_0x13c6('0x1f')]){if(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x20')]===0x1f4){logger[_0x13c6('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x1319ca,_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);return _0x4d1889(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);}logger['error'](_0x13c6('0x1c'),_0x1319ca,_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);return _0x48eeb7(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);}else{logger[_0x13c6('0x22')](_0x13c6('0x1c'),_0x1319ca,_0x13c6('0x1d'));_0x48eeb7(_0xd88a4b[_0x13c6('0x23')][_0x13c6('0x21')]);}})['catch'](function(_0x87402d){logger[_0x13c6('0x1f')](_0x13c6('0x1c'),_0x1319ca,_0x87402d);_0x4d1889(_0x87402d);});});}function respondWithStatusCode(_0x453580,_0x2f2c52){_0x2f2c52=_0x2f2c52||0xcc;return function(_0x13102a){if(_0x13102a){return _0x453580['sendStatus'](_0x2f2c52);}return _0x453580[_0x13c6('0x24')](_0x2f2c52)[_0x13c6('0x25')]();};}function respondWithResult(_0x227b2d,_0x540c98){_0x540c98=_0x540c98||0xc8;return function(_0x285114){if(_0x285114){return _0x227b2d[_0x13c6('0x24')](_0x540c98)[_0x13c6('0x26')](_0x285114);}};}function respondWithFilteredResult(_0x33866a,_0xd8ec19){return function(_0x3b33e6){if(_0x3b33e6){var _0x1e7fe1=typeof _0xd8ec19[_0x13c6('0x27')]===_0x13c6('0x28')&&typeof _0xd8ec19[_0x13c6('0x29')]===_0x13c6('0x28');var _0x134619=_0x3b33e6[_0x13c6('0x2a')];var _0x454bb8=_0x1e7fe1?0x0:_0xd8ec19[_0x13c6('0x27')];var _0x5a3018=_0x1e7fe1?_0x3b33e6[_0x13c6('0x2a')]:_0xd8ec19[_0x13c6('0x27')]+_0xd8ec19[_0x13c6('0x29')];var _0x425fcb;if(_0x5a3018>=_0x134619){_0x5a3018=_0x134619;_0x425fcb=0xc8;}else{_0x425fcb=0xce;}_0x33866a[_0x13c6('0x24')](_0x425fcb);return _0x33866a[_0x13c6('0x2b')](_0x13c6('0x2c'),_0x454bb8+'-'+_0x5a3018+'/'+_0x134619)[_0x13c6('0x26')](_0x3b33e6);}return null;};}function patchUpdates(_0xba01bb){return function(_0x526a96){try{jsonpatch[_0x13c6('0x2d')](_0x526a96,_0xba01bb,!![]);}catch(_0x15248b){return BPromise[_0x13c6('0x2e')](_0x15248b);}return _0x526a96[_0x13c6('0x2f')]();};}function saveUpdates(_0x23b504,_0x1f3f5e){return function(_0x1e0ddd){if(_0x1e0ddd){return _0x1e0ddd[_0x13c6('0x30')](_0x23b504)[_0x13c6('0x1b')](function(_0x78dfb5){return _0x78dfb5;});}return null;};}function removeEntity(_0x109618,_0x37f2cf){return function(_0x10f1c7){if(_0x10f1c7){return _0x10f1c7[_0x13c6('0x31')]()['then'](function(){_0x109618[_0x13c6('0x24')](0xcc)[_0x13c6('0x25')]();});}};}function handleEntityNotFound(_0x5336a2,_0x16d45d){return function(_0x309b49){if(!_0x309b49){_0x5336a2[_0x13c6('0x32')](0x194);}return _0x309b49;};}function handleError(_0x461ece,_0x22f077){_0x22f077=_0x22f077||0x1f4;return function(_0x135310){logger[_0x13c6('0x1f')](_0x135310[_0x13c6('0x33')]);if(_0x135310[_0x13c6('0x34')]){delete _0x135310[_0x13c6('0x34')];}_0x461ece[_0x13c6('0x24')](_0x22f077)['send'](_0x135310);};}exports[_0x13c6('0x35')]=function(_0x429637,_0xfe41d){var _0x3cbbe2={},_0x39064f={},_0x220605={'count':0x0,'rows':[]};var _0xcc1482=_[_0x13c6('0x36')](db[_0x13c6('0x37')][_0x13c6('0x38')],function(_0x4048ae){return{'name':_0x4048ae[_0x13c6('0x39')],'type':_0x4048ae[_0x13c6('0x3a')][_0x13c6('0x3b')]};});_0x39064f[_0x13c6('0x3c')]=_[_0x13c6('0x36')](_0xcc1482,_0x13c6('0x34'));_0x39064f['query']=_[_0x13c6('0x3d')](_0x429637[_0x13c6('0x3e')]);_0x39064f[_0x13c6('0x3f')]=_[_0x13c6('0x40')](_0x39064f[_0x13c6('0x3c')],_0x39064f[_0x13c6('0x3e')]);_0x3cbbe2[_0x13c6('0x41')]=_['intersection'](_0x39064f[_0x13c6('0x3c')],qs['fields'](_0x429637[_0x13c6('0x3e')][_0x13c6('0x42')]));_0x3cbbe2[_0x13c6('0x41')]=_0x3cbbe2[_0x13c6('0x41')][_0x13c6('0x43')]?_0x3cbbe2['attributes']:_0x39064f[_0x13c6('0x3c')];if(!_0x429637[_0x13c6('0x3e')][_0x13c6('0x44')]('nolimit')){_0x3cbbe2['limit']=qs[_0x13c6('0x29')](_0x429637['query']['limit']);_0x3cbbe2[_0x13c6('0x27')]=qs[_0x13c6('0x27')](_0x429637['query'][_0x13c6('0x27')]);}_0x3cbbe2['order']=qs['sort'](_0x429637[_0x13c6('0x3e')]['sort']);_0x3cbbe2[_0x13c6('0x45')]=qs[_0x13c6('0x3f')](_[_0x13c6('0x46')](_0x429637[_0x13c6('0x3e')],_0x39064f['filters']),_0xcc1482);if(_0x429637['query'][_0x13c6('0x47')]){_0x3cbbe2[_0x13c6('0x45')]=_[_0x13c6('0x48')](_0x3cbbe2[_0x13c6('0x45')],{'$or':_[_0x13c6('0x36')](_0xcc1482,function(_0x59b24a){if(_0x59b24a[_0x13c6('0x3a')]!==_0x13c6('0x49')){var _0x1a8f01={};_0x1a8f01[_0x59b24a['name']]={'$like':'%'+_0x429637['query'][_0x13c6('0x47')]+'%'};return _0x1a8f01;}})});}_0x3cbbe2=_['merge']({},_0x3cbbe2,_0x429637[_0x13c6('0x4a')]);var _0xdc961a={'where':_0x3cbbe2['where']};return db['WhatsappMessage'][_0x13c6('0x2a')](_0xdc961a)[_0x13c6('0x1b')](function(_0x5cc363){_0x220605[_0x13c6('0x2a')]=_0x5cc363;if(_0x429637[_0x13c6('0x3e')][_0x13c6('0x4b')]){_0x3cbbe2[_0x13c6('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x13c6('0x4d')](_0x3cbbe2);})[_0x13c6('0x1b')](function(_0x12f72f){_0x220605[_0x13c6('0x4e')]=_0x12f72f;return _0x220605;})[_0x13c6('0x1b')](respondWithFilteredResult(_0xfe41d,_0x3cbbe2))[_0x13c6('0x4f')](handleError(_0xfe41d,null));};exports[_0x13c6('0x50')]=function(_0x5682ac,_0x48743f){var _0x14aaa5={'raw':!![],'where':{'id':_0x5682ac[_0x13c6('0x51')]['id']}},_0x41e3ba={};_0x41e3ba['model']=_['keys'](db[_0x13c6('0x37')][_0x13c6('0x38')]);_0x41e3ba[_0x13c6('0x3e')]=_[_0x13c6('0x3d')](_0x5682ac[_0x13c6('0x3e')]);_0x41e3ba[_0x13c6('0x3f')]=_[_0x13c6('0x40')](_0x41e3ba['model'],_0x41e3ba[_0x13c6('0x3e')]);_0x14aaa5[_0x13c6('0x41')]=_[_0x13c6('0x40')](_0x41e3ba[_0x13c6('0x3c')],qs[_0x13c6('0x42')](_0x5682ac[_0x13c6('0x3e')][_0x13c6('0x42')]));_0x14aaa5[_0x13c6('0x41')]=_0x14aaa5[_0x13c6('0x41')][_0x13c6('0x43')]?_0x14aaa5[_0x13c6('0x41')]:_0x41e3ba['model'];if(_0x5682ac[_0x13c6('0x3e')]['includeAll']){_0x14aaa5[_0x13c6('0x4c')]=[{'all':!![]}];}_0x14aaa5=_[_0x13c6('0x48')]({},_0x14aaa5,_0x5682ac[_0x13c6('0x4a')]);return db[_0x13c6('0x37')]['find'](_0x14aaa5)[_0x13c6('0x1b')](handleEntityNotFound(_0x48743f,null))[_0x13c6('0x1b')](respondWithResult(_0x48743f,null))[_0x13c6('0x4f')](handleError(_0x48743f,null));};exports[_0x13c6('0x52')]=function(_0x2fc3e3,_0x479409){return db[_0x13c6('0x37')][_0x13c6('0x52')](_0x2fc3e3[_0x13c6('0x53')],{})[_0x13c6('0x1b')](respondWithResult(_0x479409,0xc9))[_0x13c6('0x4f')](handleError(_0x479409,null));};exports[_0x13c6('0x30')]=function(_0x22254,_0x3834c){if(_0x22254[_0x13c6('0x53')]['id']){delete _0x22254[_0x13c6('0x53')]['id'];}return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x22254[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x3834c,null))[_0x13c6('0x1b')](saveUpdates(_0x22254[_0x13c6('0x53')],null))[_0x13c6('0x1b')](respondWithResult(_0x3834c,null))[_0x13c6('0x4f')](handleError(_0x3834c,null));};exports[_0x13c6('0x31')]=function(_0x19fee8,_0x5c8910){return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x19fee8[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x5c8910,null))[_0x13c6('0x1b')](removeEntity(_0x5c8910,null))['catch'](handleError(_0x5c8910,null));};exports[_0x13c6('0x55')]=function(_0x12f163,_0x2d1d8e){return db['WhatsappMessage'][_0x13c6('0x55')]()[_0x13c6('0x1b')](respondWithResult(_0x2d1d8e,null))['catch'](handleError(_0x2d1d8e,null));};var interaction_log=require(_0x13c6('0xe'))('whatsapp-interactions');exports[_0x13c6('0x56')]=function(_0x2fa823,_0x412b6b,_0x4bbcb2){var _0x74b798={'agent':{},'channel':_0x13c6('0x57')};if(_0x2fa823[_0x13c6('0x53')]['id']){delete _0x2fa823['body']['id'];}_0x2fa823[_0x13c6('0x53')][_0x13c6('0x58')]=!![];_0x2fa823[_0x13c6('0x53')][_0x13c6('0x59')]=moment()[_0x13c6('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fa823[_0x13c6('0x53')]['UserId']=_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')]||_0x2fa823[_0x13c6('0x5c')]['id'];_0x74b798[_0x13c6('0x5d')]['id']=_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')];return db['WhatsappMessage'][_0x13c6('0x54')]({'where':{'id':_0x2fa823[_0x13c6('0x51')]['id'],'UserId':null}})[_0x13c6('0x1b')](handleEntityNotFound(_0x412b6b,null))[_0x13c6('0x1b')](saveUpdates(_0x2fa823['body'],null))[_0x13c6('0x1b')](function(_0x27a219){if(_0x27a219){_0x74b798['message']=_0x27a219[_0x13c6('0x5e')]({'plain':!![]});return db[_0x13c6('0x5f')][_0x13c6('0x54')]({'where':{'id':_0x27a219[_0x13c6('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x412b6b,null))[_0x13c6('0x1b')](function(_0x2d5bc3){if(_0x2d5bc3){return _0x2d5bc3['update']({'UserId':_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')],'read1stAt':_['isNil'](_0x2d5bc3[_0x13c6('0x61')])?moment()[_0x13c6('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x13c6('0x1b')](function(_0xad986d){if(_0xad986d){_0x74b798[_0x13c6('0x62')]=_0xad986d[_0x13c6('0x5e')]({'plain':!![]});interaction_log['info'](_0x13c6('0x63'),_0x2fa823[_0x13c6('0x5c')]['id'],_0x2fa823[_0x13c6('0x5c')][_0x13c6('0x34')],_0x2fa823['user'][_0x13c6('0x64')],_0x74b798[_0x13c6('0x62')]['id'],_0x2fa823[_0x13c6('0x53')]?JSON[_0x13c6('0x65')](_0x2fa823['body']):'null');return respondWithRpcPromise(_0x13c6('0x66'),_0x13c6('0x67'),_0x74b798);}return null;})[_0x13c6('0x1b')](function(_0x91f1c0){var _0x266201=_0x13c6('0x68')+_0x91f1c0[_0x13c6('0x21')][_0x13c6('0x69')];return db[_0x13c6('0x6a')][_0x13c6('0x3e')](_0x266201,{'type':db[_0x13c6('0x6b')][_0x13c6('0x6c')][_0x13c6('0x6d')],'raw':!![]})[_0x13c6('0x1b')](function(_0x29b446){return _0x29b446;});})[_0x13c6('0x1b')](function(_0x309cac){if(_0x309cac){_0x74b798[_0x13c6('0x21')][_0x13c6('0x6e')]=_0x309cac[0x0];if(!_0x2fa823['body'][_0x13c6('0x5b')])return;return db['User'][_0x13c6('0x54')]({'where':{'id':_0x2fa823['body']['UserId'],'role':_0x13c6('0x5d')},'attributes':['id',_0x13c6('0x34'),_0x13c6('0x6f'),'email',_0x13c6('0x70')],'raw':!![]});}return null;})[_0x13c6('0x1b')](function(_0x2f564c){if(!_0x2f564c)return null;_0x74b798[_0x13c6('0x21')][_0x13c6('0x5d')]=_0x2f564c;return _0x74b798;})[_0x13c6('0x1b')](function(_0x14ccce){if(_0x14ccce){if(_0x2fa823[_0x13c6('0x53')][_0x13c6('0x71')]){_0x74b798[_0x13c6('0x21')][_0x13c6('0x72')]=util['format']('SIP/%s',_0x2fa823['user']['name']);_0x74b798[_0x13c6('0x21')][_0x13c6('0x73')]=_0x74b798[_0x13c6('0x73')];_0x74b798[_0x13c6('0x21')][_0x13c6('0x74')]=_0x74b798['channel'];_0x74b798[_0x13c6('0x21')]['event']='accept';return respondWithRpcPromise(_0x13c6('0x75'),_0x13c6('0x75'),{'event':'acceptmessage','message':_0x74b798[_0x13c6('0x21')]},client9002)['then'](function(){return _0x74b798;});}return _0x74b798;}return null;})[_0x13c6('0x1b')](respondWithResult(_0x412b6b,null))[_0x13c6('0x4f')](handleError(_0x412b6b,null));};var interaction_log=require(_0x13c6('0xe'))(_0x13c6('0x76'));exports[_0x13c6('0x2e')]=function(_0x4fabaf,_0x29cbfd,_0x4dd606){var _0x418b16={'agent':{},'channel':_0x13c6('0x57')};if(_0x4fabaf[_0x13c6('0x53')]['id']){delete _0x4fabaf[_0x13c6('0x53')]['id'];}_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')]=_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')]||_0x4fabaf[_0x13c6('0x5c')]['id'];_0x418b16['agent']['id']=_0x4fabaf['body'][_0x13c6('0x5b')];return db[_0x13c6('0x37')]['find']({'where':{'id':_0x4fabaf[_0x13c6('0x51')]['id'],'UserId':null}})[_0x13c6('0x1b')](handleEntityNotFound(_0x29cbfd,null))['then'](function(_0x18ca41){if(_0x18ca41){_0x418b16[_0x13c6('0x21')]=_0x18ca41['get']({'plain':!![]});return db['WhatsappInteraction'][_0x13c6('0x54')]({'where':{'id':_0x18ca41[_0x13c6('0x60')]}});}return null;})[_0x13c6('0x1b')](handleEntityNotFound(_0x29cbfd,null))['then'](function(_0x4b804e){if(_0x4b804e){_0x418b16[_0x13c6('0x62')]=_0x4b804e[_0x13c6('0x5e')]({'plain':!![]});interaction_log[_0x13c6('0x22')](_0x13c6('0x77'),_0x4fabaf['user']['id'],_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x34')],_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x64')],_0x418b16[_0x13c6('0x62')]['id'],_0x4fabaf[_0x13c6('0x53')]?JSON[_0x13c6('0x65')](_0x4fabaf['body']):_0x13c6('0x78'));return respondWithRpcPromise(_0x13c6('0x79'),_0x13c6('0x7a'),_0x418b16);}return null;})['then'](function(_0x4d028f){var _0x32e5de=_0x13c6('0x68')+_0x4d028f[_0x13c6('0x21')]['ContactId'];return db[_0x13c6('0x6a')][_0x13c6('0x3e')](_0x32e5de,{'type':db[_0x13c6('0x6b')][_0x13c6('0x6c')][_0x13c6('0x6d')],'raw':!![]})['then'](function(_0x543d26){return _0x543d26;});})[_0x13c6('0x1b')](function(_0x15b225){if(_0x15b225){_0x418b16[_0x13c6('0x21')][_0x13c6('0x6e')]=_0x15b225[0x0];if(!_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')])return;return db[_0x13c6('0x7b')][_0x13c6('0x54')]({'where':{'id':_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')],'role':'agent'},'attributes':['id','name',_0x13c6('0x6f'),_0x13c6('0x7c'),_0x13c6('0x70')],'raw':!![]});}return null;})[_0x13c6('0x1b')](function(_0xdd1a2e){if(!_0xdd1a2e)return null;_0x418b16['message'][_0x13c6('0x5d')]=_0xdd1a2e;return _0x418b16;})[_0x13c6('0x1b')](function(_0x53be46){if(_0x53be46){_0x53be46['message'][_0x13c6('0x72')]=util['format']('SIP/%s',_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x34')]);_0x53be46[_0x13c6('0x21')][_0x13c6('0x73')]=_0x418b16[_0x13c6('0x73')];_0x53be46['message'][_0x13c6('0x74')]=_0x418b16['channel'];_0x53be46['message'][_0x13c6('0x7d')]=_0x13c6('0x2e');respondWithRpcPromise('EventManager',_0x13c6('0x75'),{'event':'rejectmessage','message':_0x53be46[_0x13c6('0x21')]},client9002);return _0x418b16;}return null;})['then'](respondWithResult(_0x29cbfd,null))[_0x13c6('0x4f')](handleError(_0x29cbfd,null));};exports[_0x13c6('0x24')]=function(_0x1f5f2d,_0x347ab9,_0x167879){if(_0x1f5f2d[_0x13c6('0x53')]['id']){delete _0x1f5f2d[_0x13c6('0x53')]['id'];}var _0x29cfe1;return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x1f5f2d[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x347ab9,null))[_0x13c6('0x1b')](function(_0x40d5e1){if(_0x40d5e1){_0x29cfe1=_0x40d5e1;return db['WhatsappAccount'][_0x13c6('0x54')]({'where':{'id':_0x40d5e1['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x347ab9,null))['then'](function(_0x37da58){if(_0x37da58){logger[_0x13c6('0x7e')](_0x13c6('0x7f'),_0x13c6('0x24'),_0x13c6('0x80'),_0x37da58[_0x13c6('0x3a')],util['inspect'](_0x1f5f2d[_0x13c6('0x53')],{'showHidden':![],'depth':null}));switch(_0x37da58[_0x13c6('0x3a')]){case _0x13c6('0x81'):if(_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x82')]&&_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x82')]===_0x29cfe1[_0x13c6('0x83')]&&_0x1f5f2d['body']['MessageStatus']&&_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x84')]==='read'){return _0x29cfe1[_0x13c6('0x30')]({'read':!![]});}else{logger[_0x13c6('0x1f')](_0x13c6('0x85'),_0x13c6('0x24'),'twilio',util[_0x13c6('0x86')](_0x1f5f2d[_0x13c6('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x29cfe1;}})['then'](respondWithResult(_0x347ab9,null))['catch'](handleError(_0x347ab9,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index fc4fdf4..495f9a4 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 _0x7af2=['hook','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x561628,_0x215809){var _0x11e475=function(_0x14883d){while(--_0x14883d){_0x561628['push'](_0x561628['shift']());}};_0x11e475(++_0x215809);}(_0x7af2,0x119));var _0x27af=function(_0x48ad49,_0x3170e4){_0x48ad49=_0x48ad49-0x0;var _0x3bf765=_0x7af2[_0x48ad49];return _0x3bf765;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x27af('0x0'))['db'][_0x27af('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x27af('0x2')](0x0);var events={'afterCreate':_0x27af('0x3'),'afterUpdate':'update','afterDestroy':_0x27af('0x4')};function emitEvent(_0x1067e7){return function(_0x709cb6,_0x2a542f,_0x22ae46){WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7+':'+_0x709cb6['id'],_0x709cb6);WhatsappMessageEvents[_0x27af('0x5')](_0x1067e7,_0x709cb6);_0x22ae46(null);};}for(var e in events){if(events[_0x27af('0x6')](e)){var event=events[e];WhatsappMessage[_0x27af('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x422f=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x422f,0x1c7));var _0xf422=function(_0x1f3d08,_0x446e66){_0x1f3d08=_0x1f3d08-0x0;var _0xa45dd7=_0x422f[_0x1f3d08];return _0xa45dd7;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xf422('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf422('0x1')](0x0);var events={'afterCreate':_0xf422('0x2'),'afterUpdate':'update','afterDestroy':_0xf422('0x3')};function emitEvent(_0x172a93){return function(_0x312bc8,_0x444ad5,_0x16047c){WhatsappMessageEvents[_0xf422('0x4')](_0x172a93+':'+_0x312bc8['id'],_0x312bc8);WhatsappMessageEvents[_0xf422('0x4')](_0x172a93,_0x312bc8);_0x16047c(null);};}for(var e in events){if(events[_0xf422('0x5')](e)){var event=events[e];WhatsappMessage[_0xf422('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1f024aa..5f2e2c9 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 _0x0b1f=['body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','WhatsappAccount','find','type','twilio','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','update','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x45bb17,_0x45da51){var _0x127ca1=function(_0x42204e){while(--_0x42204e){_0x45bb17['push'](_0x45bb17['shift']());}};_0x127ca1(++_0x45da51);}(_0x0b1f,0x82));var _0xf0b1=function(_0x113d44,_0xe9c556){_0x113d44=_0x113d44-0x0;var _0x460d7a=_0x0b1f[_0x113d44];return _0x460d7a;};'use strict';var _=require('lodash');var util=require(_0xf0b1('0x0'));var logger=require(_0xf0b1('0x1'))(_0xf0b1('0x2'));var moment=require('moment');var BPromise=require(_0xf0b1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf0b1('0x4'));var attributes=require(_0xf0b1('0x5'));module[_0xf0b1('0x6')]=function(_0x1654e4,_0x59d9c8){return _0x1654e4['define'](_0xf0b1('0x7'),attributes,{'tableName':_0xf0b1('0x8'),'paranoid':![],'indexes':[{'name':_0xf0b1('0x9'),'fields':[_0xf0b1('0x9')]},{'name':_0xf0b1('0xa'),'fields':[_0xf0b1('0xb')],'type':_0xf0b1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x259a50,_0x1a659e,_0x1911fc){var _0x15bd8e=_0x1654e4['models'];var _0x2eced0=_0x259a50['get']({'plain':!![]});if(_0x2eced0[_0xf0b1('0xd')][_0xf0b1('0xe')]()==='in'||_0x2eced0[_0xf0b1('0xd')][_0xf0b1('0xe')]()===_0xf0b1('0xf')&&!_0x2eced0[_0xf0b1('0x10')]&&!_[_0xf0b1('0x11')](_0x2eced0[_0xf0b1('0x12')])){_0x15bd8e[_0xf0b1('0x13')][_0xf0b1('0x14')]({'where':{'id':_0x2eced0[_0xf0b1('0x15')]}})[_0xf0b1('0x16')](function(_0x36ca2b){if(_0x36ca2b){_0x36ca2b['update']({'lastMsgAt':_0x2eced0[_0xf0b1('0x17')],'lastMsgDirection':_0x2eced0['direction'][_0xf0b1('0xe')]()});}})[_0xf0b1('0x18')](function(_0x23fbf6){console['error'](_0x23fbf6);});}if(_0x2eced0[_0xf0b1('0xd')]==='out'&&!_0x2eced0['secret']){var _0x5c9d6b;_0x15bd8e[_0xf0b1('0x19')][_0xf0b1('0x1a')]({'where':{'id':_0x2eced0['WhatsappAccountId']},'raw':!![]})['then'](function(_0x4714f1){_0x5c9d6b=_0x4714f1;if(_0x5c9d6b&&_0x5c9d6b[_0xf0b1('0x1b')]){switch(_0x5c9d6b[_0xf0b1('0x1b')]){case _0xf0b1('0x1c'):var _0x4ced80=require(_0xf0b1('0x1c'));if(_0x5c9d6b['accountSid']&&_0x5c9d6b[_0xf0b1('0x1d')]&&_0x5c9d6b[_0xf0b1('0x1e')]){var _0x5a3b44=new _0x4ced80(_0x5c9d6b['accountSid'],_0x5c9d6b[_0xf0b1('0x1d')]);_0x5a3b44[_0xf0b1('0x1f')][_0xf0b1('0x20')]({'body':_0x2eced0[_0xf0b1('0xb')],'to':_0xf0b1('0x21')+_0x2eced0[_0xf0b1('0x1e')],'from':'whatsapp:'+_0x5c9d6b[_0xf0b1('0x1e')],'statusCallback':_0x5c9d6b[_0xf0b1('0x22')]+'/api/whatsapp/messages/'+_0x2eced0['id']+_0xf0b1('0x23')+_0x5c9d6b[_0xf0b1('0x24')]})['then'](function(_0x453821){if(_0x453821[_0xf0b1('0x25')]){return _0x259a50[_0xf0b1('0x26')]({'messageId':_0x453821[_0xf0b1('0x25')]});}})[_0xf0b1('0x18')](function(_0x20a6b9){logger[_0xf0b1('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf0b1('0x28'),_0xf0b1('0x1c'),util[_0xf0b1('0x29')](_0x20a6b9,{'showHidden':![],'depth':null}));});}else{logger[_0xf0b1('0x27')](_0xf0b1('0x2a'),'afterCreate','twilio',_0xf0b1('0x2b'));}break;}}})[_0xf0b1('0x2c')](function(){_0x1911fc();});}else{_0x1911fc();}}},'charset':_0xf0b1('0x2d'),'collate':_0xf0b1('0x2e')});}; \ No newline at end of file +var _0x7382=['findOne','WhatsappInteractionId','then','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction'];(function(_0x450478,_0x360b9b){var _0x30d405=function(_0x3545ca){while(--_0x3545ca){_0x450478['push'](_0x450478['shift']());}};_0x30d405(++_0x360b9b);}(_0x7382,0x1f2));var _0x2738=function(_0x485997,_0x50e4ac){_0x485997=_0x485997-0x0;var _0xf96bf5=_0x7382[_0x485997];return _0xf96bf5;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2738('0x1'));var BPromise=require('bluebird');var rp=require(_0x2738('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2738('0x3'));var config=require(_0x2738('0x4'));var attributes=require('./whatsappMessage.attributes');module[_0x2738('0x5')]=function(_0x267a1a,_0x457c61){return _0x267a1a[_0x2738('0x6')]('WhatsappMessage',attributes,{'tableName':_0x2738('0x7'),'paranoid':![],'indexes':[{'name':_0x2738('0x8'),'fields':[_0x2738('0x8')]},{'name':_0x2738('0x9'),'fields':[_0x2738('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2eb46d,_0xcd5079,_0x2322cd){var _0x23db73=_0x267a1a[_0x2738('0xb')];var _0x58c181=_0x2eb46d['get']({'plain':!![]});if(_0x58c181['direction'][_0x2738('0xc')]()==='in'||_0x58c181[_0x2738('0xd')][_0x2738('0xc')]()===_0x2738('0xe')&&!_0x58c181[_0x2738('0xf')]&&!_[_0x2738('0x10')](_0x58c181[_0x2738('0x11')])){_0x23db73[_0x2738('0x12')][_0x2738('0x13')]({'where':{'id':_0x58c181[_0x2738('0x14')]}})[_0x2738('0x15')](function(_0x1d2de7){if(_0x1d2de7){_0x1d2de7['update']({'lastMsgAt':_0x58c181[_0x2738('0x16')],'lastMsgDirection':_0x58c181[_0x2738('0xd')]['toLowerCase']()});}})['catch'](function(_0x1542b6){console[_0x2738('0x17')](_0x1542b6);});}if(_0x58c181[_0x2738('0xd')]==='out'&&!_0x58c181[_0x2738('0xf')]){var _0x1f3962;_0x23db73[_0x2738('0x18')][_0x2738('0x19')]({'where':{'id':_0x58c181[_0x2738('0x1a')]},'raw':!![]})['then'](function(_0x43cab3){_0x1f3962=_0x43cab3;if(_0x1f3962&&_0x1f3962[_0x2738('0x1b')]){switch(_0x1f3962[_0x2738('0x1b')]){case _0x2738('0x1c'):var _0x36d4e8=require(_0x2738('0x1c'));if(_0x1f3962[_0x2738('0x1d')]&&_0x1f3962[_0x2738('0x1e')]&&_0x1f3962[_0x2738('0x1f')]){var _0x514e45=new _0x36d4e8(_0x1f3962[_0x2738('0x1d')],_0x1f3962['authToken']);_0x514e45[_0x2738('0x20')][_0x2738('0x21')]({'body':_0x58c181[_0x2738('0xa')],'to':_0x2738('0x22')+_0x58c181['phone'],'from':'whatsapp:'+_0x1f3962[_0x2738('0x1f')],'statusCallback':_0x1f3962[_0x2738('0x23')]+_0x2738('0x24')+_0x58c181['id']+_0x2738('0x25')+_0x1f3962['token']})[_0x2738('0x15')](function(_0x3d8274){if(_0x3d8274[_0x2738('0x26')]){return _0x2eb46d[_0x2738('0x27')]({'messageId':_0x3d8274['sid']});}})['catch'](function(_0x5b7fd0){logger[_0x2738('0x17')](_0x2738('0x28'),'afterCreate',_0x2738('0x1c'),util[_0x2738('0x29')](_0x5b7fd0,{'showHidden':![],'depth':null}));});}else{logger[_0x2738('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2738('0x2a'),_0x2738('0x1c'),_0x2738('0x2b'));}break;}}})[_0x2738('0x2c')](function(){_0x2322cd();});}else{_0x2322cd();}}},'charset':_0x2738('0x2d'),'collate':_0x2738('0x2e')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d6381cf..ed0cbe5 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 _0xb96c=['body','options','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','localhost','socket.io-emitter','redis','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create'];(function(_0x4003fe,_0x38c382){var _0x5af37c=function(_0x112092){while(--_0x112092){_0x4003fe['push'](_0x4003fe['shift']());}};_0x5af37c(++_0x38c382);}(_0xb96c,0x69));var _0xcb96=function(_0x1ba4a9,_0x155d51){_0x1ba4a9=_0x1ba4a9-0x0;var _0x33ba68=_0xb96c[_0x1ba4a9];return _0x33ba68;};'use strict';var _=require(_0xcb96('0x0'));var util=require(_0xcb96('0x1'));var moment=require(_0xcb96('0x2'));var BPromise=require(_0xcb96('0x3'));var rs=require(_0xcb96('0x4'));var fs=require('fs');var Redis=require(_0xcb96('0x5'));var db=require(_0xcb96('0x6'))['db'];var utils=require(_0xcb96('0x7'));var logger=require('../../config/logger')(_0xcb96('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb96('0x9')][_0xcb96('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xcb96('0xb'),'port':0x18eb});var socket=require(_0xcb96('0xc'))(new Redis(config[_0xcb96('0xd')]));require(_0xcb96('0xe'))[_0xcb96('0xf')](socket);function respondWithRpcPromise(_0x5cd51a,_0x1877a5,_0x56ed1f){return new BPromise(function(_0x2cdb13,_0x4d3924){return client[_0xcb96('0x10')](_0x5cd51a,_0x56ed1f)[_0xcb96('0x11')](function(_0xee88d1){logger[_0xcb96('0x12')](_0xcb96('0x13'),_0x1877a5,_0xcb96('0x14'));logger[_0xcb96('0x15')](_0xcb96('0x16'),_0x1877a5,_0xcb96('0x14'),JSON[_0xcb96('0x17')](_0xee88d1));if(_0xee88d1[_0xcb96('0x18')]){if(_0xee88d1[_0xcb96('0x18')][_0xcb96('0x19')]===0x1f4){logger[_0xcb96('0x18')](_0xcb96('0x13'),_0x1877a5,_0xee88d1[_0xcb96('0x18')][_0xcb96('0x1a')]);return _0x4d3924(_0xee88d1['error']['message']);}logger[_0xcb96('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x1877a5,_0xee88d1[_0xcb96('0x18')][_0xcb96('0x1a')]);return _0x2cdb13(_0xee88d1[_0xcb96('0x18')][_0xcb96('0x1a')]);}else{logger[_0xcb96('0x12')](_0xcb96('0x13'),_0x1877a5,'request\x20sent');_0x2cdb13(_0xee88d1[_0xcb96('0x1b')]['message']);}})[_0xcb96('0x1c')](function(_0x2f7897){logger[_0xcb96('0x18')](_0xcb96('0x13'),_0x1877a5,_0x2f7897);_0x4d3924(_0x2f7897);});});}exports['CreateWhatsappMessage']=function(_0xcac291){var _0x329f83=this;return new Promise(function(_0x57566f,_0x3e5013){return db[_0xcb96('0x1d')][_0xcb96('0x1e')](_0xcac291[_0xcb96('0x1f')],{'raw':_0xcac291[_0xcb96('0x20')]?_0xcac291[_0xcb96('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x56ea74){logger[_0xcb96('0x12')](_0xcb96('0x21'),_0xcac291);logger[_0xcb96('0x15')](_0xcb96('0x21'),_0xcac291,JSON['stringify'](_0x56ea74));_0x57566f(_0x56ea74);})['catch'](function(_0x2fc427){logger[_0xcb96('0x18')](_0xcb96('0x21'),_0x2fc427['message'],_0xcac291);_0x3e5013(_0x329f83[_0xcb96('0x18')](0x1f4,_0x2fc427[_0xcb96('0x1a')]));});});}; \ No newline at end of file +var _0xa737=['CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x2d4d6d,_0x440070){var _0xcc293a=function(_0x31edd9){while(--_0x31edd9){_0x2d4d6d['push'](_0x2d4d6d['shift']());}};_0xcc293a(++_0x440070);}(_0xa737,0x1a6));var _0x7a73=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xa737[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x7a73('0x0'));var util=require(_0x7a73('0x1'));var moment=require('moment');var BPromise=require(_0x7a73('0x2'));var rs=require(_0x7a73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a73('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a73('0x5'));var config=require(_0x7a73('0x6'));var jayson=require(_0x7a73('0x7'));var client=jayson[_0x7a73('0x8')][_0x7a73('0x9')]({'port':0x232a});config[_0x7a73('0xa')]=_[_0x7a73('0xb')](config[_0x7a73('0xa')],{'host':_0x7a73('0xc'),'port':0x18eb});var socket=require(_0x7a73('0xd'))(new Redis(config[_0x7a73('0xa')]));require(_0x7a73('0xe'))['register'](socket);function respondWithRpcPromise(_0x306972,_0x8ec11a,_0x3b5804){return new BPromise(function(_0x3e86f5,_0x45f5ac){return client[_0x7a73('0xf')](_0x306972,_0x3b5804)[_0x7a73('0x10')](function(_0x8b40cc){logger[_0x7a73('0x11')](_0x7a73('0x12'),_0x8ec11a,_0x7a73('0x13'));logger[_0x7a73('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8ec11a,_0x7a73('0x13'),JSON[_0x7a73('0x15')](_0x8b40cc));if(_0x8b40cc['error']){if(_0x8b40cc[_0x7a73('0x16')]['code']===0x1f4){logger['error'](_0x7a73('0x12'),_0x8ec11a,_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);return _0x45f5ac(_0x8b40cc['error']['message']);}logger[_0x7a73('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x8ec11a,_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);return _0x3e86f5(_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);}else{logger[_0x7a73('0x11')](_0x7a73('0x12'),_0x8ec11a,_0x7a73('0x13'));_0x3e86f5(_0x8b40cc[_0x7a73('0x18')][_0x7a73('0x17')]);}})[_0x7a73('0x19')](function(_0x34871e){logger[_0x7a73('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x8ec11a,_0x34871e);_0x45f5ac(_0x34871e);});});}exports[_0x7a73('0x1a')]=function(_0x1e5c29){var _0x83e44d=this;return new Promise(function(_0x8b3b51,_0x3cdc95){return db[_0x7a73('0x1b')][_0x7a73('0x1c')](_0x1e5c29[_0x7a73('0x1d')],{'raw':_0x1e5c29[_0x7a73('0x1e')]?_0x1e5c29[_0x7a73('0x1e')][_0x7a73('0x1f')]===undefined?!![]:![]:!![]})[_0x7a73('0x10')](function(_0x19bc0a){logger[_0x7a73('0x11')]('CreateWhatsappMessage',_0x1e5c29);logger[_0x7a73('0x14')](_0x7a73('0x1a'),_0x1e5c29,JSON[_0x7a73('0x15')](_0x19bc0a));_0x8b3b51(_0x19bc0a);})['catch'](function(_0x207a40){logger[_0x7a73('0x16')](_0x7a73('0x1a'),_0x207a40[_0x7a73('0x17')],_0x1e5c29);_0x3cdc95(_0x83e44d['error'](0x1f4,_0x207a40[_0x7a73('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c83aae7..cd01cc0 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 _0x5d8b=['emit','register','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0xf636af,_0x3f12a3){var _0x234c2d=function(_0x52d3b0){while(--_0x52d3b0){_0xf636af['push'](_0xf636af['shift']());}};_0x234c2d(++_0x3f12a3);}(_0x5d8b,0xf8));var _0xb5d8=function(_0x19ea5b,_0x2a1a41){_0x19ea5b=_0x19ea5b-0x0;var _0x17c52a=_0x5d8b[_0x19ea5b];return _0x17c52a;};'use strict';var WhatsappMessageEvents=require(_0xb5d8('0x0'));var events=[_0xb5d8('0x1'),_0xb5d8('0x2'),_0xb5d8('0x3')];function createListener(_0x24e8a5,_0x5cda0f){return function(_0xd69921){_0x5cda0f[_0xb5d8('0x4')](_0x24e8a5,_0xd69921);};}function removeListener(_0xb99667,_0x530cc6){return function(){WhatsappMessageEvents['removeListener'](_0xb99667,_0x530cc6);};}exports[_0xb5d8('0x5')]=function(_0x54c17f){for(var _0xec99d5=0x0,_0x4c303a=events['length'];_0xec99d5<_0x4c303a;_0xec99d5++){var _0x4077f1=events[_0xec99d5];var _0x270288=createListener(_0xb5d8('0x6')+_0x4077f1,_0x54c17f);WhatsappMessageEvents['on'](_0x4077f1,_0x270288);}}; \ No newline at end of file +var _0x91f9=['update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x44383f,_0x1a2522){var _0x4b9b48=function(_0x4e5f12){while(--_0x4e5f12){_0x44383f['push'](_0x44383f['shift']());}};_0x4b9b48(++_0x1a2522);}(_0x91f9,0x189));var _0x991f=function(_0x188832,_0x49101d){_0x188832=_0x188832-0x0;var _0x2b990f=_0x91f9[_0x188832];return _0x2b990f;};'use strict';var WhatsappMessageEvents=require(_0x991f('0x0'));var events=[_0x991f('0x1'),_0x991f('0x2'),_0x991f('0x3')];function createListener(_0x568459,_0x243b61){return function(_0x30654e){_0x243b61[_0x991f('0x4')](_0x568459,_0x30654e);};}function removeListener(_0x1bc98e,_0xc41866){return function(){WhatsappMessageEvents[_0x991f('0x5')](_0x1bc98e,_0xc41866);};}exports[_0x991f('0x6')]=function(_0x24a18a){for(var _0x1b1fe7=0x0,_0x4e7bf1=events[_0x991f('0x7')];_0x1b1fe7<_0x4e7bf1;_0x1b1fe7++){var _0x3ffb0a=events[_0x1b1fe7];var _0x5272f2=createListener(_0x991f('0x8')+_0x3ffb0a,_0x24a18a);WhatsappMessageEvents['on'](_0x3ffb0a,_0x5272f2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 644a8a2..41be668 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 _0x3456=['create','post','addAgents','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','/:id/users'];(function(_0x3f8bbd,_0x644fd6){var _0x1ddab8=function(_0x109a2b){while(--_0x109a2b){_0x3f8bbd['push'](_0x3f8bbd['shift']());}};_0x1ddab8(++_0x644fd6);}(_0x3456,0x8f));var _0x6345=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x3456[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require(_0x6345('0x0'));var util=require(_0x6345('0x1'));var path=require(_0x6345('0x2'));var timeout=require(_0x6345('0x3'));var express=require(_0x6345('0x4'));var router=express[_0x6345('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6345('0x6'));var config=require(_0x6345('0x7'));var controller=require(_0x6345('0x8'));router['get']('/',auth[_0x6345('0x9')](),controller[_0x6345('0xa')]);router[_0x6345('0xb')](_0x6345('0xc'),auth[_0x6345('0x9')](),controller[_0x6345('0xd')]);router[_0x6345('0xb')](_0x6345('0xe'),auth[_0x6345('0x9')](),controller[_0x6345('0xf')]);router[_0x6345('0xb')]('/:id/members',auth[_0x6345('0x9')](),controller[_0x6345('0x10')]);router[_0x6345('0xb')](_0x6345('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0x6345('0xb')](_0x6345('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x6345('0x9')](),controller[_0x6345('0x13')]);router['post'](_0x6345('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x6345('0x14')]('/:id/users',auth[_0x6345('0x9')](),controller[_0x6345('0x15')]);router[_0x6345('0x16')](_0x6345('0xe'),auth[_0x6345('0x9')](),controller[_0x6345('0x17')]);router[_0x6345('0x18')](_0x6345('0xe'),auth['isAuthenticated'](),controller[_0x6345('0x19')]);router['delete'](_0x6345('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x6345('0x18')](_0x6345('0x12'),auth[_0x6345('0x9')](),controller['removeAgents']);module[_0x6345('0x1a')]=router; \ No newline at end of file +var _0xe4bd=['/:id/users','addAgents','put','delete','destroy','removeAgents','multer','util','path','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams'];(function(_0x39bf8c,_0x123fe5){var _0x25de43=function(_0x1876cb){while(--_0x1876cb){_0x39bf8c['push'](_0x39bf8c['shift']());}};_0x25de43(++_0x123fe5);}(_0xe4bd,0x1b6));var _0xde4b=function(_0x2bcf73,_0x3ed471){_0x2bcf73=_0x2bcf73-0x0;var _0x55446e=_0xe4bd[_0x2bcf73];return _0x55446e;};'use strict';var multer=require(_0xde4b('0x0'));var util=require(_0xde4b('0x1'));var path=require(_0xde4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xde4b('0x3'));var router=express[_0xde4b('0x4')]();var fs_extra=require(_0xde4b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde4b('0x6'));var controller=require(_0xde4b('0x7'));router['get']('/',auth[_0xde4b('0x8')](),controller[_0xde4b('0x9')]);router[_0xde4b('0xa')](_0xde4b('0xb'),auth['isAuthenticated'](),controller[_0xde4b('0xc')]);router['get'](_0xde4b('0xd'),auth[_0xde4b('0x8')](),controller['show']);router[_0xde4b('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0xde4b('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xde4b('0xf')]);router[_0xde4b('0xa')]('/:id/users',auth[_0xde4b('0x8')](),controller[_0xde4b('0x10')]);router[_0xde4b('0x11')]('/',auth[_0xde4b('0x8')](),controller[_0xde4b('0x12')]);router['post'](_0xde4b('0x13'),auth[_0xde4b('0x8')](),controller[_0xde4b('0x14')]);router[_0xde4b('0x11')](_0xde4b('0x15'),auth['isAuthenticated'](),controller[_0xde4b('0x16')]);router[_0xde4b('0x17')]('/:id',auth[_0xde4b('0x8')](),controller['update']);router[_0xde4b('0x18')](_0xde4b('0xd'),auth['isAuthenticated'](),controller[_0xde4b('0x19')]);router[_0xde4b('0x18')]('/:id/teams',auth[_0xde4b('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xde4b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 3139c51..87058d8 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 _0x1752=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1752,0xa5));var _0x2175=function(_0x4cae68,_0x22bd96){_0x4cae68=_0x4cae68-0x0;var _0x323a2d=_0x1752[_0x4cae68];return _0x323a2d;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'name':{'type':Sequelize[_0x2175('0x1')],'unique':_0x2175('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2175('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2175('0x4')](_0x2175('0x5'),'beepall',_0x2175('0x6'))},'description':{'type':Sequelize[_0x2175('0x1')]}}; \ No newline at end of file +var _0xc68d=['exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4b6951,_0x30f254){var _0x5a3d64=function(_0x451fb2){while(--_0x451fb2){_0x4b6951['push'](_0x4b6951['shift']());}};_0x5a3d64(++_0x30f254);}(_0xc68d,0x17a));var _0xdc68=function(_0x10c245,_0x154c85){_0x10c245=_0x10c245-0x0;var _0x762f42=_0xc68d[_0x10c245];return _0x762f42;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'name':{'type':Sequelize[_0xdc68('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc68('0x2')](_0xdc68('0x3'),_0xdc68('0x4'),_0xdc68('0x5'))},'description':{'type':Sequelize[_0xdc68('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 46f2ddd..d1a4527 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 _0xd6ae=['Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','ids','User','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','Team','getTeams','addTeams'];(function(_0x173883,_0x50b5e7){var _0x3d897b=function(_0x32b2d6){while(--_0x32b2d6){_0x173883['push'](_0x173883['shift']());}};_0x3d897b(++_0x50b5e7);}(_0xd6ae,0x134));var _0xed6a=function(_0x4d51da,_0x502bd2){_0x4d51da=_0x4d51da-0x0;var _0x130a1d=_0xd6ae[_0x4d51da];return _0x130a1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed6a('0x0'));var zipdir=require(_0xed6a('0x1'));var jsonpatch=require(_0xed6a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed6a('0x3'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed6a('0x4'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed6a('0x5'));var jsforce=require(_0xed6a('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xed6a('0x7'));var querystring=require(_0xed6a('0x8'));var Papa=require(_0xed6a('0x9'));var Redis=require(_0xed6a('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xed6a('0xb'));var as=require(_0xed6a('0xc'));var hardwareService=require(_0xed6a('0xd'));var logger=require(_0xed6a('0xe'))(_0xed6a('0xf'));var utils=require(_0xed6a('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xed6a('0x11')]=_[_0xed6a('0x12')](config[_0xed6a('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xed6a('0x13'))(new Redis(config[_0xed6a('0x11')]));require(_0xed6a('0x14'))[_0xed6a('0x15')](socket);function respondWithStatusCode(_0x5e1914,_0x17a319){_0x17a319=_0x17a319||0xcc;return function(_0x30a937){if(_0x30a937){return _0x5e1914[_0xed6a('0x16')](_0x17a319);}return _0x5e1914[_0xed6a('0x17')](_0x17a319)[_0xed6a('0x18')]();};}function respondWithResult(_0x301be1,_0x482e69){_0x482e69=_0x482e69||0xc8;return function(_0x3f6732){if(_0x3f6732){return _0x301be1[_0xed6a('0x17')](_0x482e69)[_0xed6a('0x19')](_0x3f6732);}};}function respondWithFilteredResult(_0x4ed5d0,_0x14e70b){return function(_0x475121){if(_0x475121){var _0x3a0238=typeof _0x14e70b[_0xed6a('0x1a')]===_0xed6a('0x1b')&&typeof _0x14e70b[_0xed6a('0x1c')]===_0xed6a('0x1b');var _0x2074c7=_0x475121[_0xed6a('0x1d')];var _0x57ed37=_0x3a0238?0x0:_0x14e70b['offset'];var _0x2b0bb0=_0x3a0238?_0x475121[_0xed6a('0x1d')]:_0x14e70b[_0xed6a('0x1a')]+_0x14e70b[_0xed6a('0x1c')];var _0x3a0285;if(_0x2b0bb0>=_0x2074c7){_0x2b0bb0=_0x2074c7;_0x3a0285=0xc8;}else{_0x3a0285=0xce;}_0x4ed5d0['status'](_0x3a0285);return _0x4ed5d0[_0xed6a('0x1e')](_0xed6a('0x1f'),_0x57ed37+'-'+_0x2b0bb0+'/'+_0x2074c7)[_0xed6a('0x19')](_0x475121);}return null;};}function patchUpdates(_0x575fda){return function(_0x1a8563){try{jsonpatch[_0xed6a('0x20')](_0x1a8563,_0x575fda,!![]);}catch(_0x417a06){return BPromise['reject'](_0x417a06);}return _0x1a8563['save']();};}function saveUpdates(_0x208aad,_0x4feb0e){return function(_0x12dd60){if(_0x12dd60){return _0x12dd60[_0xed6a('0x21')](_0x208aad)[_0xed6a('0x22')](function(_0x8834c0){return _0x8834c0;});}return null;};}function removeEntity(_0x510ffc,_0xf16c41){return function(_0xb94f94){if(_0xb94f94){return _0xb94f94[_0xed6a('0x23')]()['then'](function(){var _0x2f8a27=_0xb94f94[_0xed6a('0x24')]({'plain':!![]});var _0x654f4f=_0xed6a('0x25');return db[_0xed6a('0x26')][_0xed6a('0x23')]({'where':{'type':_0x654f4f,'resourceId':_0x2f8a27['id']}})['then'](function(){return _0xb94f94;});})[_0xed6a('0x22')](function(){_0x510ffc[_0xed6a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28226c,_0x32710f){return function(_0xbb39ef){if(!_0xbb39ef){_0x28226c[_0xed6a('0x16')](0x194);}return _0xbb39ef;};}function handleError(_0x457027,_0x10180c){_0x10180c=_0x10180c||0x1f4;return function(_0x52da23){logger[_0xed6a('0x27')](_0x52da23[_0xed6a('0x28')]);if(_0x52da23[_0xed6a('0x29')]){delete _0x52da23[_0xed6a('0x29')];}_0x457027[_0xed6a('0x17')](_0x10180c)[_0xed6a('0x2a')](_0x52da23);};}exports['index']=function(_0x258ad6,_0x7768d3){var _0x333ce6={},_0x49da9f={},_0x3bf271={'count':0x0,'rows':[]};var _0x4442ca=_[_0xed6a('0x2b')](db[_0xed6a('0x2c')][_0xed6a('0x2d')],function(_0x4ab140){return{'name':_0x4ab140[_0xed6a('0x2e')],'type':_0x4ab140[_0xed6a('0x2f')][_0xed6a('0x30')]};});_0x49da9f[_0xed6a('0x31')]=_[_0xed6a('0x2b')](_0x4442ca,_0xed6a('0x29'));_0x49da9f[_0xed6a('0x32')]=_[_0xed6a('0x33')](_0x258ad6[_0xed6a('0x32')]);_0x49da9f[_0xed6a('0x34')]=_[_0xed6a('0x35')](_0x49da9f['model'],_0x49da9f['query']);_0x333ce6[_0xed6a('0x36')]=_['intersection'](_0x49da9f[_0xed6a('0x31')],qs[_0xed6a('0x37')](_0x258ad6[_0xed6a('0x32')][_0xed6a('0x37')]));_0x333ce6[_0xed6a('0x36')]=_0x333ce6[_0xed6a('0x36')]['length']?_0x333ce6['attributes']:_0x49da9f[_0xed6a('0x31')];if(!_0x258ad6[_0xed6a('0x32')][_0xed6a('0x38')](_0xed6a('0x39'))){_0x333ce6[_0xed6a('0x1c')]=qs[_0xed6a('0x1c')](_0x258ad6[_0xed6a('0x32')]['limit']);_0x333ce6['offset']=qs['offset'](_0x258ad6['query'][_0xed6a('0x1a')]);}_0x333ce6['order']=qs[_0xed6a('0x3a')](_0x258ad6[_0xed6a('0x32')]['sort']);_0x333ce6[_0xed6a('0x3b')]=qs[_0xed6a('0x34')](_[_0xed6a('0x3c')](_0x258ad6['query'],_0x49da9f['filters']),_0x4442ca);if(_0x258ad6[_0xed6a('0x32')][_0xed6a('0x3d')]){_0x333ce6[_0xed6a('0x3b')]=_[_0xed6a('0x3e')](_0x333ce6[_0xed6a('0x3b')],{'$or':_[_0xed6a('0x2b')](_0x4442ca,function(_0x2b326a){if(_0x2b326a[_0xed6a('0x2f')]!==_0xed6a('0x3f')){var _0x2981dd={};_0x2981dd[_0x2b326a[_0xed6a('0x29')]]={'$like':'%'+_0x258ad6[_0xed6a('0x32')][_0xed6a('0x3d')]+'%'};return _0x2981dd;}})});}_0x333ce6=_[_0xed6a('0x3e')]({},_0x333ce6,_0x258ad6['options']);var _0x57228b={'where':_0x333ce6[_0xed6a('0x3b')]};return db['WhatsappQueue'][_0xed6a('0x1d')](_0x57228b)[_0xed6a('0x22')](function(_0xbbf419){_0x3bf271[_0xed6a('0x1d')]=_0xbbf419;if(_0x258ad6[_0xed6a('0x32')][_0xed6a('0x40')]){_0x333ce6[_0xed6a('0x41')]=[{'all':!![]}];}return db[_0xed6a('0x2c')][_0xed6a('0x42')](_0x333ce6);})[_0xed6a('0x22')](function(_0x169af0){_0x3bf271[_0xed6a('0x43')]=_0x169af0;return _0x3bf271;})['then'](respondWithFilteredResult(_0x7768d3,_0x333ce6))['catch'](handleError(_0x7768d3,null));};exports['show']=function(_0x2eda68,_0x4e09c8){var _0x1e55e4={'raw':!![],'where':{'id':_0x2eda68[_0xed6a('0x44')]['id']}},_0x1de679={};_0x1de679[_0xed6a('0x31')]=_['keys'](db[_0xed6a('0x2c')][_0xed6a('0x2d')]);_0x1de679[_0xed6a('0x32')]=_[_0xed6a('0x33')](_0x2eda68[_0xed6a('0x32')]);_0x1de679[_0xed6a('0x34')]=_[_0xed6a('0x35')](_0x1de679[_0xed6a('0x31')],_0x1de679['query']);_0x1e55e4[_0xed6a('0x36')]=_[_0xed6a('0x35')](_0x1de679[_0xed6a('0x31')],qs[_0xed6a('0x37')](_0x2eda68[_0xed6a('0x32')][_0xed6a('0x37')]));_0x1e55e4['attributes']=_0x1e55e4[_0xed6a('0x36')][_0xed6a('0x45')]?_0x1e55e4[_0xed6a('0x36')]:_0x1de679[_0xed6a('0x31')];if(_0x2eda68['query'][_0xed6a('0x40')]){_0x1e55e4[_0xed6a('0x41')]=[{'all':!![]}];}_0x1e55e4=_['merge']({},_0x1e55e4,_0x2eda68[_0xed6a('0x46')]);return db[_0xed6a('0x2c')][_0xed6a('0x47')](_0x1e55e4)['then'](handleEntityNotFound(_0x4e09c8,null))['then'](respondWithResult(_0x4e09c8,null))[_0xed6a('0x48')](handleError(_0x4e09c8,null));};exports[_0xed6a('0x49')]=function(_0x41736b,_0x593c3e){return db[_0xed6a('0x2c')]['create'](_0x41736b[_0xed6a('0x4a')],{})[_0xed6a('0x22')](function(_0x315c51){var _0x28ea17=_0x41736b['user']['get']({'plain':!![]});if(!_0x28ea17)throw new Error(_0xed6a('0x4b'));if(_0x28ea17[_0xed6a('0x4c')]===_0xed6a('0x4d')){var _0x4640ab=_0x315c51[_0xed6a('0x24')]({'plain':!![]});var _0x417c72='WhatsappQueues';return db[_0xed6a('0x4e')][_0xed6a('0x47')]({'where':{'name':_0x417c72,'userProfileId':_0x28ea17[_0xed6a('0x4f')]},'raw':!![]})[_0xed6a('0x22')](function(_0x321028){if(_0x321028&&_0x321028['autoAssociation']===0x0){return db[_0xed6a('0x26')][_0xed6a('0x49')]({'name':_0x4640ab[_0xed6a('0x29')],'resourceId':_0x4640ab['id'],'type':_0x321028[_0xed6a('0x29')],'sectionId':_0x321028['id']},{})['then'](function(){return _0x315c51;});}else{return _0x315c51;}})['catch'](function(_0x2b1db2){logger[_0xed6a('0x27')](_0xed6a('0x50'),_0x2b1db2);throw _0x2b1db2;});}return _0x315c51;})[_0xed6a('0x22')](respondWithResult(_0x593c3e,0xc9))[_0xed6a('0x48')](handleError(_0x593c3e,null));};exports[_0xed6a('0x21')]=function(_0x1bbef4,_0x275e40){if(_0x1bbef4[_0xed6a('0x4a')]['id']){delete _0x1bbef4[_0xed6a('0x4a')]['id'];}return db['WhatsappQueue'][_0xed6a('0x47')]({'where':{'id':_0x1bbef4[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0x275e40,null))[_0xed6a('0x22')](saveUpdates(_0x1bbef4[_0xed6a('0x4a')],null))['then'](respondWithResult(_0x275e40,null))['catch'](handleError(_0x275e40,null));};exports[_0xed6a('0x23')]=function(_0x8efac4,_0x232a0e){return db[_0xed6a('0x2c')][_0xed6a('0x47')]({'where':{'id':_0x8efac4[_0xed6a('0x44')]['id']}})['then'](handleEntityNotFound(_0x232a0e,null))[_0xed6a('0x22')](removeEntity(_0x232a0e,null))[_0xed6a('0x48')](handleError(_0x232a0e,null));};exports['describe']=function(_0x48fc08,_0x28f7d0){return db[_0xed6a('0x2c')][_0xed6a('0x51')]()[_0xed6a('0x22')](respondWithResult(_0x28f7d0,null))[_0xed6a('0x48')](handleError(_0x28f7d0,null));};exports[_0xed6a('0x52')]=function(_0x8fbc34,_0x4316fa,_0x457ced){var _0x320558={'raw':!![],'where':{}},_0x5c133d={},_0x22198c;return db['WhatsappQueue'][_0xed6a('0x53')]({'where':{'id':_0x8fbc34[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0x4316fa,null))[_0xed6a('0x22')](function(_0x13fed6){if(_0x13fed6){_0x22198c=_0x13fed6['get']({'plain':!![]});_0x5c133d[_0xed6a('0x31')]=_[_0xed6a('0x33')](db[_0xed6a('0x54')]['rawAttributes']);_0x5c133d[_0xed6a('0x32')]=_[_0xed6a('0x33')](_0x8fbc34[_0xed6a('0x32')]);_0x5c133d[_0xed6a('0x34')]=_[_0xed6a('0x35')](_0x5c133d[_0xed6a('0x31')],_0x5c133d[_0xed6a('0x32')]);_0x320558['attributes']=_['intersection'](_0x5c133d[_0xed6a('0x31')],qs[_0xed6a('0x37')](_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x37')]));_0x320558[_0xed6a('0x36')]=_0x320558[_0xed6a('0x36')][_0xed6a('0x45')]?_0x320558['attributes']:_0x5c133d[_0xed6a('0x31')];if(!_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x38')](_0xed6a('0x39'))){_0x320558[_0xed6a('0x1c')]=qs[_0xed6a('0x1c')](_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x1c')]);_0x320558[_0xed6a('0x1a')]=qs[_0xed6a('0x1a')](_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x1a')]);}_0x320558[_0xed6a('0x55')]=qs['sort'](_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x3a')]);_0x320558[_0xed6a('0x3b')]=qs[_0xed6a('0x34')](_[_0xed6a('0x3c')](_0x8fbc34[_0xed6a('0x32')],_0x5c133d[_0xed6a('0x34')]));_0x320558[_0xed6a('0x3b')][_0xed6a('0x56')]=_0x13fed6['id'];if(_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x3d')]){_0x320558[_0xed6a('0x3b')]=_['merge'](_0x320558[_0xed6a('0x3b')],{'$or':_['map'](_0x320558[_0xed6a('0x36')],function(_0x3875fb){var _0x5eaa21={};_0x5eaa21[_0x3875fb]={'$like':'%'+_0x8fbc34[_0xed6a('0x32')][_0xed6a('0x3d')]+'%'};return _0x5eaa21;})});}_0x320558=_['merge']({},_0x320558,_0x8fbc34[_0xed6a('0x46')]);return db[_0xed6a('0x54')][_0xed6a('0x42')](_0x320558);}})[_0xed6a('0x22')](function(_0x49b116){if(_0x49b116){return db['User'][_0xed6a('0x57')]({'where':{'id':_[_0xed6a('0x2b')](_0x49b116,_0xed6a('0x58')),'role':_0xed6a('0x59')},'attributes':['id','name',_0xed6a('0x5a'),_0xed6a('0x5b'),_0xed6a('0x5c')]});}})[_0xed6a('0x22')](function(_0x189288){if(_0x189288){return{'count':_0x189288[_0xed6a('0x1d')],'rows':_['map'](_0x189288[_0xed6a('0x43')],function(_0xfc2c13){return{'membername':_0xfc2c13[_0xed6a('0x29')],'UserId':_0xfc2c13['id'],'queue_name':_0x22198c[_0xed6a('0x29')],'WhatsappQueueId':_0x22198c['id'],'interface':util['format'](_0xed6a('0x5d'),'SIP',_0xfc2c13['name']),'penalty':0x0,'paused':_0xfc2c13[_0xed6a('0x5a')],'createdAt':_0xfc2c13[_0xed6a('0x5c')],'updatedAt':_0xfc2c13[_0xed6a('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed6a('0x22')](respondWithFilteredResult(_0x4316fa,_0x320558))[_0xed6a('0x48')](handleError(_0x4316fa,null));};exports['getTeams']=function(_0x5ec121,_0xc7c2b9,_0x4a100e){var _0x37423e={};var _0x273994={};var _0xc7ec2;var _0x519e2c;return db[_0xed6a('0x2c')][_0xed6a('0x53')]({'where':{'id':_0x5ec121['params']['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0xc7c2b9,null))['then'](function(_0x1704ae){if(_0x1704ae){_0xc7ec2=_0x1704ae;_0x273994[_0xed6a('0x31')]=_['keys'](db[_0xed6a('0x5e')][_0xed6a('0x2d')]);_0x273994[_0xed6a('0x32')]=_[_0xed6a('0x33')](_0x5ec121['query']);_0x273994[_0xed6a('0x34')]=_[_0xed6a('0x35')](_0x273994[_0xed6a('0x31')],_0x273994[_0xed6a('0x32')]);_0x37423e[_0xed6a('0x36')]=_['intersection'](_0x273994[_0xed6a('0x31')],qs[_0xed6a('0x37')](_0x5ec121[_0xed6a('0x32')]['fields']));_0x37423e[_0xed6a('0x36')]=_0x37423e[_0xed6a('0x36')]['length']?_0x37423e[_0xed6a('0x36')]:_0x273994['model'];_0x37423e['order']=qs[_0xed6a('0x3a')](_0x5ec121[_0xed6a('0x32')][_0xed6a('0x3a')]);_0x37423e[_0xed6a('0x3b')]=qs[_0xed6a('0x34')](_['pick'](_0x5ec121[_0xed6a('0x32')],_0x273994[_0xed6a('0x34')]));if(_0x5ec121['query'][_0xed6a('0x3d')]){_0x37423e[_0xed6a('0x3b')]=_[_0xed6a('0x3e')](_0x37423e[_0xed6a('0x3b')],{'$or':_[_0xed6a('0x2b')](_0x37423e[_0xed6a('0x36')],function(_0xa8b561){var _0x53adb5={};_0x53adb5[_0xa8b561]={'$like':'%'+_0x5ec121[_0xed6a('0x32')]['filter']+'%'};return _0x53adb5;})});}_0x37423e=_[_0xed6a('0x3e')]({},_0x37423e,_0x5ec121['options']);return _0xc7ec2[_0xed6a('0x5f')](_0x37423e);}})[_0xed6a('0x22')](function(_0x210352){if(_0x210352){_0x519e2c=_0x210352[_0xed6a('0x45')];if(!_0x5ec121[_0xed6a('0x32')]['hasOwnProperty'](_0xed6a('0x39'))){_0x37423e[_0xed6a('0x1c')]=qs[_0xed6a('0x1c')](_0x5ec121[_0xed6a('0x32')][_0xed6a('0x1c')]);_0x37423e[_0xed6a('0x1a')]=qs['offset'](_0x5ec121[_0xed6a('0x32')][_0xed6a('0x1a')]);}return _0xc7ec2[_0xed6a('0x5f')](_0x37423e);}})[_0xed6a('0x22')](function(_0x205daf){if(_0x205daf){return _0x205daf?{'count':_0x519e2c,'rows':_0x205daf}:null;}})[_0xed6a('0x22')](respondWithResult(_0xc7c2b9,null))[_0xed6a('0x48')](handleError(_0xc7c2b9,null));};exports[_0xed6a('0x60')]=function(_0x2877b6,_0x5b30bb,_0x5e2ba4){var _0xcd306=_0x2877b6[_0xed6a('0x4a')]['ids'];return db['Team'][_0xed6a('0x42')]({'where':{'id':_0xcd306},'attributes':['id'],'include':[{'model':db['User'],'as':_0xed6a('0x61'),'attributes':['id','name',_0xed6a('0x62'),_0xed6a('0x63'),_0xed6a('0x64')],'raw':!![]}]})[_0xed6a('0x22')](function(_0x14f339){if(_0x14f339){var _0x317dc7=_[_0xed6a('0x65')](_0x14f339,function(_0x1cb13f){var _0x28e49d=_0x1cb13f[_0xed6a('0x24')]({'plain':!![]});return _0x28e49d[_0xed6a('0x61')];});return db[_0xed6a('0x2c')][_0xed6a('0x47')]({'where':{'id':_0x2877b6[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](function(_0x3c19fb){return db['sequelize'][_0xed6a('0x66')](function(_0xd4a17e){return _0x3c19fb['addTeams'](_0xcd306,{'transaction':_0xd4a17e})[_0xed6a('0x22')](function(){return BPromise[_0xed6a('0x67')](_0x317dc7,function(_0x140ee4){return db[_0xed6a('0x54')][_0xed6a('0x68')]({'where':{'UserId':_0x140ee4['id'],'WhatsappQueueId':_0x2877b6[_0xed6a('0x44')]['id']},'transaction':_0xd4a17e});});})[_0xed6a('0x22')](function(){_0x317dc7['forEach'](function(_0x1f362e){socket[_0xed6a('0x69')]('userWhatsappQueue:save',{'UserId':_0x1f362e['id'],'WhatsappQueueId':_0x3c19fb['id']});});});});});}})[_0xed6a('0x22')](respondWithStatusCode(_0x5b30bb,null))[_0xed6a('0x48')](handleError(_0x5b30bb,null));};exports['removeTeams']=function(_0x55ffdd,_0x493d88,_0x297ebe){return db[_0xed6a('0x5e')][_0xed6a('0x42')]({'where':{'id':_0x55ffdd[_0xed6a('0x32')][_0xed6a('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xed6a('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xed6a('0x22')](handleEntityNotFound(_0x493d88,null))[_0xed6a('0x22')](function(_0x5dc820){var _0x255e9a=_[_0xed6a('0x2b')](_0x5dc820,'id');var _0x3314b5=[];var _0x157bf2=[];var _0x413f68=squel['select']();_0x413f68['field'](_0xed6a('0x6c'))['from'](_0xed6a('0x6d'),'tq')[_0xed6a('0x6e')](_0xed6a('0x6f'),'ut',_0xed6a('0x70'))[_0xed6a('0x3b')](_0xed6a('0x71'),_0x55ffdd['params']['id']);for(var _0x381a1a=0x0;_0x381a1a<_0x5dc820['length'];_0x381a1a+=0x1){let _0x5bdcb0=_0x5dc820[_0x381a1a];for(var _0x18bb2f=0x0;_0x18bb2f<_0x5bdcb0[_0xed6a('0x61')][_0xed6a('0x45')];_0x18bb2f+=0x1){let _0x51a8a5=_0x5bdcb0[_0xed6a('0x61')][_0x18bb2f];var _0x27b0cb=_0x413f68[_0xed6a('0x72')]();_0x27b0cb[_0xed6a('0x3b')](_0xed6a('0x73'),_0x51a8a5['id']);_0x157bf2[_0xed6a('0x74')](db[_0xed6a('0x75')]['query'](_0x27b0cb['toString'](),{'type':db[_0xed6a('0x75')][_0xed6a('0x76')][_0xed6a('0x77')]})[_0xed6a('0x22')](function(_0x3b836c){if(_0x3b836c[_0xed6a('0x45')]===0x1){return _0x51a8a5['id'];}else{var _0x2d7857=_[_0xed6a('0x78')](_[_0xed6a('0x2b')](_0x3b836c,'TeamId'),function(_0x541911){return _[_0xed6a('0x79')](_0x255e9a,_0x541911);});if(_0x2d7857){return _0x51a8a5['id'];}}}));}}return BPromise[_0xed6a('0x7a')](_0x157bf2)[_0xed6a('0x22')](function(_0x4c9791){_0x3314b5=_(_0x3314b5)[_0xed6a('0x7b')](_0x4c9791)[_0xed6a('0x7c')]()['value']();return db[_0xed6a('0x2c')][_0xed6a('0x47')]({'where':{'id':_0x55ffdd[_0xed6a('0x44')]['id']}})['then'](function(_0x35da64){return db[_0xed6a('0x75')][_0xed6a('0x66')](function(_0x1d7568){return _0x35da64[_0xed6a('0x7d')](_0x55ffdd['query']['ids'],{'transaction':_0x1d7568})['then'](function(){if(!_[_0xed6a('0x7e')](_0x3314b5)){return _0x35da64[_0xed6a('0x7f')](_0x3314b5,{'transaction':_0x1d7568});}})[_0xed6a('0x22')](function(){_0x3314b5['forEach'](function(_0x418d91){socket[_0xed6a('0x69')](_0xed6a('0x80'),{'UserId':_0x418d91,'WhatsappQueueId':_0x35da64['id']});});});});});});})['then'](respondWithStatusCode(_0x493d88,null))[_0xed6a('0x48')](handleError(_0x493d88,null));};exports[_0xed6a('0x81')]=function(_0x12c380,_0x391819,_0x53ae9b){return db[_0xed6a('0x2c')]['find']({'where':{'id':_0x12c380[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0x391819,null))[_0xed6a('0x22')](function(_0x30bcc6){if(_0x30bcc6){return _0x30bcc6[_0xed6a('0x81')](_0x12c380[_0xed6a('0x4a')][_0xed6a('0x6a')],_[_0xed6a('0x82')](_0x12c380[_0xed6a('0x4a')],[_0xed6a('0x6a'),'id'])||{})[_0xed6a('0x83')](function(_0xd726ec){for(var _0x4a23fd=0x0;_0x4a23fd<_0x12c380['body'][_0xed6a('0x6a')][_0xed6a('0x45')];_0x4a23fd+=0x1){socket[_0xed6a('0x69')](_0xed6a('0x84'),{'UserId':Number(_0x12c380[_0xed6a('0x4a')][_0xed6a('0x6a')][_0x4a23fd]),'WhatsappQueueId':Number(_0x12c380['params']['id'])});}return _0xd726ec;});}})[_0xed6a('0x22')](respondWithResult(_0x391819,null))['catch'](handleError(_0x391819,null));};exports['removeAgents']=function(_0x5f4c81,_0x30873c,_0x2e4d3f){return db[_0xed6a('0x2c')][_0xed6a('0x47')]({'where':{'id':_0x5f4c81[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0x30873c,null))[_0xed6a('0x22')](function(_0x2f2df1){if(_0x2f2df1){return _0x2f2df1['removeAgents'](_0x5f4c81[_0xed6a('0x32')]['ids'])[_0xed6a('0x22')](function(){if(_[_0xed6a('0x85')](_0x5f4c81[_0xed6a('0x32')]['ids'])){for(var _0x17f15f=0x0;_0x17f15f<_0x5f4c81[_0xed6a('0x32')][_0xed6a('0x6a')]['length'];_0x17f15f+=0x1){socket[_0xed6a('0x69')](_0xed6a('0x80'),{'UserId':Number(_0x5f4c81[_0xed6a('0x32')]['ids'][_0x17f15f]),'WhatsappQueueId':Number(_0x5f4c81[_0xed6a('0x44')]['id'])});}}else{socket[_0xed6a('0x69')](_0xed6a('0x80'),{'UserId':Number(_0x5f4c81[_0xed6a('0x32')][_0xed6a('0x6a')]),'WhatsappQueueId':Number(_0x5f4c81[_0xed6a('0x44')]['id'])});}});}})[_0xed6a('0x22')](respondWithStatusCode(_0x30873c,null))[_0xed6a('0x48')](handleError(_0x30873c,null));};exports['getAgents']=function(_0x351c09,_0x1366cf,_0x6a9d5f){var _0x365a28={};var _0x59a0c9={};var _0x3852ea;var _0x1d8e30;return db[_0xed6a('0x2c')]['findOne']({'where':{'id':_0x351c09[_0xed6a('0x44')]['id']}})[_0xed6a('0x22')](handleEntityNotFound(_0x1366cf,null))[_0xed6a('0x22')](function(_0x4e07f3){if(_0x4e07f3){_0x3852ea=_0x4e07f3;_0x59a0c9[_0xed6a('0x31')]=_['keys'](db[_0xed6a('0x6b')]['rawAttributes']);_0x59a0c9[_0xed6a('0x32')]=_[_0xed6a('0x33')](_0x351c09['query']);_0x59a0c9[_0xed6a('0x34')]=_[_0xed6a('0x35')](_0x59a0c9[_0xed6a('0x31')],_0x59a0c9[_0xed6a('0x32')]);_0x365a28['attributes']=_[_0xed6a('0x35')](_0x59a0c9[_0xed6a('0x31')],qs[_0xed6a('0x37')](_0x351c09[_0xed6a('0x32')][_0xed6a('0x37')]));_0x365a28['attributes']=_0x365a28[_0xed6a('0x36')]['length']?_0x365a28[_0xed6a('0x36')]:_0x59a0c9[_0xed6a('0x31')];_0x365a28['order']=qs['sort'](_0x351c09[_0xed6a('0x32')][_0xed6a('0x3a')]);_0x365a28[_0xed6a('0x3b')]=qs[_0xed6a('0x34')](_['pick'](_0x351c09['query'],_0x59a0c9[_0xed6a('0x34')]));if(_0x351c09[_0xed6a('0x32')][_0xed6a('0x3d')]){_0x365a28[_0xed6a('0x3b')]=_[_0xed6a('0x3e')](_0x365a28['where'],{'$or':_['map'](_0x365a28[_0xed6a('0x36')],function(_0xc61cff){var _0x5daa55={};_0x5daa55[_0xc61cff]={'$like':'%'+_0x351c09[_0xed6a('0x32')][_0xed6a('0x3d')]+'%'};return _0x5daa55;})});}_0x365a28=_[_0xed6a('0x3e')]({},_0x365a28,_0x351c09[_0xed6a('0x46')]);return _0x3852ea[_0xed6a('0x86')](_0x365a28);}})[_0xed6a('0x22')](function(_0x17aea8){if(_0x17aea8){_0x1d8e30=_0x17aea8[_0xed6a('0x45')];if(!_0x351c09[_0xed6a('0x32')][_0xed6a('0x38')]('nolimit')){_0x365a28['limit']=qs[_0xed6a('0x1c')](_0x351c09['query'][_0xed6a('0x1c')]);_0x365a28[_0xed6a('0x1a')]=qs['offset'](_0x351c09[_0xed6a('0x32')][_0xed6a('0x1a')]);}return _0x3852ea[_0xed6a('0x86')](_0x365a28);}})[_0xed6a('0x22')](function(_0x4f8607){if(_0x4f8607){return _0x4f8607?{'count':_0x1d8e30,'rows':_0x4f8607}:null;}})[_0xed6a('0x22')](respondWithResult(_0x1366cf,null))['catch'](handleError(_0x1366cf,null));}; \ No newline at end of file +var _0x0ea8=['socket.io-emitter','./whatsappQueue.socket','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserWhatsappQueue','order','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','User','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit','removeTeams','Team','ids','select','tq.TeamId','user_has_teams','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x0ea8,0x18c));var _0x80ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0ea8[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x80ea('0x0'));var rimraf=require(_0x80ea('0x1'));var zipdir=require(_0x80ea('0x2'));var jsonpatch=require(_0x80ea('0x3'));var rp=require('request-promise');var moment=require(_0x80ea('0x4'));var BPromise=require(_0x80ea('0x5'));var Mustache=require(_0x80ea('0x6'));var util=require(_0x80ea('0x7'));var path=require(_0x80ea('0x8'));var sox=require('sox');var csv=require(_0x80ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80ea('0xa'));var _=require('lodash');var squel=require(_0x80ea('0xb'));var crypto=require(_0x80ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x80ea('0xd'));var toCsv=require(_0x80ea('0x9'));var querystring=require(_0x80ea('0xe'));var Papa=require(_0x80ea('0xf'));var Redis=require(_0x80ea('0x10'));var authService=require(_0x80ea('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x80ea('0x12'));var hardwareService=require(_0x80ea('0x13'));var logger=require(_0x80ea('0x14'))('api');var utils=require(_0x80ea('0x15'));var config=require(_0x80ea('0x16'));var licenseUtil=require(_0x80ea('0x17'));var db=require('../../mysqldb')['db'];config[_0x80ea('0x18')]=_[_0x80ea('0x19')](config[_0x80ea('0x18')],{'host':_0x80ea('0x1a'),'port':0x18eb});var socket=require(_0x80ea('0x1b'))(new Redis(config[_0x80ea('0x18')]));require(_0x80ea('0x1c'))['register'](socket);function respondWithStatusCode(_0x5eefcc,_0x5add48){_0x5add48=_0x5add48||0xcc;return function(_0x17f3aa){if(_0x17f3aa){return _0x5eefcc['sendStatus'](_0x5add48);}return _0x5eefcc[_0x80ea('0x1d')](_0x5add48)[_0x80ea('0x1e')]();};}function respondWithResult(_0x3ca62c,_0x1b22fe){_0x1b22fe=_0x1b22fe||0xc8;return function(_0x27e4d3){if(_0x27e4d3){return _0x3ca62c[_0x80ea('0x1d')](_0x1b22fe)[_0x80ea('0x1f')](_0x27e4d3);}};}function respondWithFilteredResult(_0x5ed73c,_0x1d800a){return function(_0x1364e0){if(_0x1364e0){var _0x17d4b8=typeof _0x1d800a['offset']===_0x80ea('0x20')&&typeof _0x1d800a['limit']===_0x80ea('0x20');var _0xe1bb55=_0x1364e0[_0x80ea('0x21')];var _0x12b5e9=_0x17d4b8?0x0:_0x1d800a[_0x80ea('0x22')];var _0x1bff9f=_0x17d4b8?_0x1364e0[_0x80ea('0x21')]:_0x1d800a['offset']+_0x1d800a[_0x80ea('0x23')];var _0xbf0780;if(_0x1bff9f>=_0xe1bb55){_0x1bff9f=_0xe1bb55;_0xbf0780=0xc8;}else{_0xbf0780=0xce;}_0x5ed73c[_0x80ea('0x1d')](_0xbf0780);return _0x5ed73c[_0x80ea('0x24')](_0x80ea('0x25'),_0x12b5e9+'-'+_0x1bff9f+'/'+_0xe1bb55)[_0x80ea('0x1f')](_0x1364e0);}return null;};}function patchUpdates(_0x3a7d98){return function(_0x538805){try{jsonpatch[_0x80ea('0x26')](_0x538805,_0x3a7d98,!![]);}catch(_0x26a8cf){return BPromise['reject'](_0x26a8cf);}return _0x538805[_0x80ea('0x27')]();};}function saveUpdates(_0x402848,_0x3a2ccf){return function(_0xff98c0){if(_0xff98c0){return _0xff98c0[_0x80ea('0x28')](_0x402848)[_0x80ea('0x29')](function(_0x2d51f8){return _0x2d51f8;});}return null;};}function removeEntity(_0x44e507,_0x5702f4){return function(_0x2d3f61){if(_0x2d3f61){return _0x2d3f61[_0x80ea('0x2a')]()[_0x80ea('0x29')](function(){var _0x8a0502=_0x2d3f61[_0x80ea('0x2b')]({'plain':!![]});var _0x4de535=_0x80ea('0x2c');return db[_0x80ea('0x2d')][_0x80ea('0x2a')]({'where':{'type':_0x4de535,'resourceId':_0x8a0502['id']}})[_0x80ea('0x29')](function(){return _0x2d3f61;});})['then'](function(){_0x44e507[_0x80ea('0x1d')](0xcc)[_0x80ea('0x1e')]();});}};}function handleEntityNotFound(_0x5793ea,_0x43ef6d){return function(_0x1ed33d){if(!_0x1ed33d){_0x5793ea[_0x80ea('0x2e')](0x194);}return _0x1ed33d;};}function handleError(_0x554a5e,_0x41d397){_0x41d397=_0x41d397||0x1f4;return function(_0x1c07af){logger[_0x80ea('0x2f')](_0x1c07af[_0x80ea('0x30')]);if(_0x1c07af[_0x80ea('0x31')]){delete _0x1c07af[_0x80ea('0x31')];}_0x554a5e[_0x80ea('0x1d')](_0x41d397)[_0x80ea('0x32')](_0x1c07af);};}exports[_0x80ea('0x33')]=function(_0x86dff0,_0x53a28e){var _0x51eff1={},_0x2d0297={},_0x3e5ed2={'count':0x0,'rows':[]};var _0x3b1d2b=_[_0x80ea('0x34')](db[_0x80ea('0x35')]['rawAttributes'],function(_0x17c8b5){return{'name':_0x17c8b5[_0x80ea('0x36')],'type':_0x17c8b5[_0x80ea('0x37')][_0x80ea('0x38')]};});_0x2d0297[_0x80ea('0x39')]=_[_0x80ea('0x34')](_0x3b1d2b,_0x80ea('0x31'));_0x2d0297['query']=_['keys'](_0x86dff0[_0x80ea('0x3a')]);_0x2d0297[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0x2d0297[_0x80ea('0x39')],_0x2d0297['query']);_0x51eff1[_0x80ea('0x3d')]=_['intersection'](_0x2d0297['model'],qs[_0x80ea('0x3e')](_0x86dff0['query']['fields']));_0x51eff1[_0x80ea('0x3d')]=_0x51eff1[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x51eff1['attributes']:_0x2d0297[_0x80ea('0x39')];if(!_0x86dff0['query'][_0x80ea('0x40')](_0x80ea('0x41'))){_0x51eff1[_0x80ea('0x23')]=qs[_0x80ea('0x23')](_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x51eff1['offset']=qs[_0x80ea('0x22')](_0x86dff0[_0x80ea('0x3a')]['offset']);}_0x51eff1['order']=qs[_0x80ea('0x42')](_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x42')]);_0x51eff1[_0x80ea('0x43')]=qs['filters'](_[_0x80ea('0x44')](_0x86dff0[_0x80ea('0x3a')],_0x2d0297[_0x80ea('0x3b')]),_0x3b1d2b);if(_0x86dff0[_0x80ea('0x3a')]['filter']){_0x51eff1[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x51eff1[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x3b1d2b,function(_0x3dc69b){if(_0x3dc69b[_0x80ea('0x37')]!==_0x80ea('0x46')){var _0x5eabd6={};_0x5eabd6[_0x3dc69b['name']]={'$like':'%'+_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x5eabd6;}})});}_0x51eff1=_[_0x80ea('0x45')]({},_0x51eff1,_0x86dff0[_0x80ea('0x48')]);var _0x40a953={'where':_0x51eff1[_0x80ea('0x43')]};return db[_0x80ea('0x35')][_0x80ea('0x21')](_0x40a953)[_0x80ea('0x29')](function(_0x568926){_0x3e5ed2['count']=_0x568926;if(_0x86dff0['query'][_0x80ea('0x49')]){_0x51eff1[_0x80ea('0x4a')]=[{'all':!![]}];}return db[_0x80ea('0x35')][_0x80ea('0x4b')](_0x51eff1);})[_0x80ea('0x29')](function(_0x6f0b54){_0x3e5ed2[_0x80ea('0x4c')]=_0x6f0b54;return _0x3e5ed2;})['then'](respondWithFilteredResult(_0x53a28e,_0x51eff1))[_0x80ea('0x4d')](handleError(_0x53a28e,null));};exports[_0x80ea('0x4e')]=function(_0x44bb2c,_0x35c340){var _0x2b909f={'raw':!![],'where':{'id':_0x44bb2c['params']['id']}},_0x2b81ad={};_0x2b81ad[_0x80ea('0x39')]=_['keys'](db[_0x80ea('0x35')][_0x80ea('0x4f')]);_0x2b81ad[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x44bb2c['query']);_0x2b81ad['filters']=_[_0x80ea('0x3c')](_0x2b81ad[_0x80ea('0x39')],_0x2b81ad['query']);_0x2b909f[_0x80ea('0x3d')]=_['intersection'](_0x2b81ad[_0x80ea('0x39')],qs[_0x80ea('0x3e')](_0x44bb2c[_0x80ea('0x3a')][_0x80ea('0x3e')]));_0x2b909f['attributes']=_0x2b909f[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x2b909f[_0x80ea('0x3d')]:_0x2b81ad[_0x80ea('0x39')];if(_0x44bb2c['query'][_0x80ea('0x49')]){_0x2b909f[_0x80ea('0x4a')]=[{'all':!![]}];}_0x2b909f=_[_0x80ea('0x45')]({},_0x2b909f,_0x44bb2c[_0x80ea('0x48')]);return db[_0x80ea('0x35')][_0x80ea('0x51')](_0x2b909f)[_0x80ea('0x29')](handleEntityNotFound(_0x35c340,null))[_0x80ea('0x29')](respondWithResult(_0x35c340,null))['catch'](handleError(_0x35c340,null));};exports[_0x80ea('0x52')]=function(_0x1d5c88,_0x4ea69e){return db[_0x80ea('0x35')][_0x80ea('0x52')](_0x1d5c88[_0x80ea('0x53')],{})['then'](function(_0x2a2361){var _0x256c7e=_0x1d5c88[_0x80ea('0x54')][_0x80ea('0x2b')]({'plain':!![]});if(!_0x256c7e)throw new Error(_0x80ea('0x55'));if(_0x256c7e['role']===_0x80ea('0x54')){var _0x3ac5f0=_0x2a2361[_0x80ea('0x2b')]({'plain':!![]});var _0x28a9e7=_0x80ea('0x2c');return db[_0x80ea('0x56')]['find']({'where':{'name':_0x28a9e7,'userProfileId':_0x256c7e[_0x80ea('0x57')]},'raw':!![]})[_0x80ea('0x29')](function(_0x112ade){if(_0x112ade&&_0x112ade[_0x80ea('0x58')]===0x0){return db[_0x80ea('0x2d')][_0x80ea('0x52')]({'name':_0x3ac5f0[_0x80ea('0x31')],'resourceId':_0x3ac5f0['id'],'type':_0x112ade[_0x80ea('0x31')],'sectionId':_0x112ade['id']},{})[_0x80ea('0x29')](function(){return _0x2a2361;});}else{return _0x2a2361;}})['catch'](function(_0x3ba2e8){logger[_0x80ea('0x2f')](_0x80ea('0x59'),_0x3ba2e8);throw _0x3ba2e8;});}return _0x2a2361;})[_0x80ea('0x29')](respondWithResult(_0x4ea69e,0xc9))[_0x80ea('0x4d')](handleError(_0x4ea69e,null));};exports[_0x80ea('0x28')]=function(_0x1a179e,_0x317812){if(_0x1a179e['body']['id']){delete _0x1a179e[_0x80ea('0x53')]['id'];}return db[_0x80ea('0x35')]['find']({'where':{'id':_0x1a179e[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x317812,null))[_0x80ea('0x29')](saveUpdates(_0x1a179e[_0x80ea('0x53')],null))[_0x80ea('0x29')](respondWithResult(_0x317812,null))[_0x80ea('0x4d')](handleError(_0x317812,null));};exports[_0x80ea('0x2a')]=function(_0x4c7569,_0x5881f6){return db[_0x80ea('0x35')]['find']({'where':{'id':_0x4c7569[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x5881f6,null))['then'](removeEntity(_0x5881f6,null))[_0x80ea('0x4d')](handleError(_0x5881f6,null));};exports[_0x80ea('0x5b')]=function(_0x40ef3b,_0x1edab5){return db[_0x80ea('0x35')][_0x80ea('0x5b')]()[_0x80ea('0x29')](respondWithResult(_0x1edab5,null))['catch'](handleError(_0x1edab5,null));};exports['getMembers']=function(_0x3556e5,_0x25fd61,_0x2ced71){var _0x22b574={'raw':!![],'where':{}},_0x58c37e={},_0xa8022a;return db[_0x80ea('0x35')]['findOne']({'where':{'id':_0x3556e5['params']['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x25fd61,null))[_0x80ea('0x29')](function(_0x1c4833){if(_0x1c4833){_0xa8022a=_0x1c4833[_0x80ea('0x2b')]({'plain':!![]});_0x58c37e['model']=_[_0x80ea('0x50')](db[_0x80ea('0x5c')][_0x80ea('0x4f')]);_0x58c37e[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x3556e5[_0x80ea('0x3a')]);_0x58c37e[_0x80ea('0x3b')]=_['intersection'](_0x58c37e[_0x80ea('0x39')],_0x58c37e[_0x80ea('0x3a')]);_0x22b574[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0x58c37e[_0x80ea('0x39')],qs[_0x80ea('0x3e')](_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x3e')]));_0x22b574[_0x80ea('0x3d')]=_0x22b574[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x22b574['attributes']:_0x58c37e[_0x80ea('0x39')];if(!_0x3556e5[_0x80ea('0x3a')]['hasOwnProperty'](_0x80ea('0x41'))){_0x22b574['limit']=qs[_0x80ea('0x23')](_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x22b574[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x3556e5['query']['offset']);}_0x22b574[_0x80ea('0x5d')]=qs[_0x80ea('0x42')](_0x3556e5[_0x80ea('0x3a')]['sort']);_0x22b574[_0x80ea('0x43')]=qs[_0x80ea('0x3b')](_[_0x80ea('0x44')](_0x3556e5['query'],_0x58c37e[_0x80ea('0x3b')]));_0x22b574[_0x80ea('0x43')][_0x80ea('0x5e')]=_0x1c4833['id'];if(_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x47')]){_0x22b574[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x22b574[_0x80ea('0x43')],{'$or':_['map'](_0x22b574[_0x80ea('0x3d')],function(_0x3fce43){var _0x14ca9b={};_0x14ca9b[_0x3fce43]={'$like':'%'+_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x14ca9b;})});}_0x22b574=_[_0x80ea('0x45')]({},_0x22b574,_0x3556e5[_0x80ea('0x48')]);return db[_0x80ea('0x5c')]['findAll'](_0x22b574);}})['then'](function(_0x54e9ff){if(_0x54e9ff){return db['User'][_0x80ea('0x5f')]({'where':{'id':_['map'](_0x54e9ff,_0x80ea('0x60')),'role':_0x80ea('0x61')},'attributes':['id',_0x80ea('0x31'),_0x80ea('0x62'),_0x80ea('0x63'),_0x80ea('0x64')]});}})[_0x80ea('0x29')](function(_0x58ec0b){if(_0x58ec0b){return{'count':_0x58ec0b[_0x80ea('0x21')],'rows':_['map'](_0x58ec0b['rows'],function(_0x43ab1e){return{'membername':_0x43ab1e[_0x80ea('0x31')],'UserId':_0x43ab1e['id'],'queue_name':_0xa8022a['name'],'WhatsappQueueId':_0xa8022a['id'],'interface':util[_0x80ea('0x65')](_0x80ea('0x66'),_0x80ea('0x67'),_0x43ab1e[_0x80ea('0x31')]),'penalty':0x0,'paused':_0x43ab1e[_0x80ea('0x62')],'createdAt':_0x43ab1e['createdAt'],'updatedAt':_0x43ab1e[_0x80ea('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25fd61,_0x22b574))[_0x80ea('0x4d')](handleError(_0x25fd61,null));};exports[_0x80ea('0x68')]=function(_0x4dac57,_0x11b9b4,_0x1fc39a){var _0x55c836={};var _0xaac2e9={};var _0x494ebe;var _0x123809;return db[_0x80ea('0x35')][_0x80ea('0x69')]({'where':{'id':_0x4dac57[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x11b9b4,null))[_0x80ea('0x29')](function(_0x30a71d){if(_0x30a71d){_0x494ebe=_0x30a71d;_0xaac2e9['model']=_[_0x80ea('0x50')](db['Team'][_0x80ea('0x4f')]);_0xaac2e9[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x4dac57[_0x80ea('0x3a')]);_0xaac2e9[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0xaac2e9[_0x80ea('0x39')],_0xaac2e9['query']);_0x55c836[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0xaac2e9['model'],qs[_0x80ea('0x3e')](_0x4dac57[_0x80ea('0x3a')]['fields']));_0x55c836['attributes']=_0x55c836[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x55c836['attributes']:_0xaac2e9[_0x80ea('0x39')];_0x55c836['order']=qs['sort'](_0x4dac57[_0x80ea('0x3a')]['sort']);_0x55c836[_0x80ea('0x43')]=qs[_0x80ea('0x3b')](_['pick'](_0x4dac57['query'],_0xaac2e9[_0x80ea('0x3b')]));if(_0x4dac57[_0x80ea('0x3a')]['filter']){_0x55c836[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x55c836[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x55c836[_0x80ea('0x3d')],function(_0x4d15f3){var _0x13b870={};_0x13b870[_0x4d15f3]={'$like':'%'+_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x13b870;})});}_0x55c836=_[_0x80ea('0x45')]({},_0x55c836,_0x4dac57[_0x80ea('0x48')]);return _0x494ebe[_0x80ea('0x68')](_0x55c836);}})['then'](function(_0x7d1599){if(_0x7d1599){_0x123809=_0x7d1599[_0x80ea('0x3f')];if(!_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x40')](_0x80ea('0x41'))){_0x55c836[_0x80ea('0x23')]=qs['limit'](_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x55c836[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x22')]);}return _0x494ebe[_0x80ea('0x68')](_0x55c836);}})['then'](function(_0x21c958){if(_0x21c958){return _0x21c958?{'count':_0x123809,'rows':_0x21c958}:null;}})['then'](respondWithResult(_0x11b9b4,null))[_0x80ea('0x4d')](handleError(_0x11b9b4,null));};exports[_0x80ea('0x6a')]=function(_0x13edd1,_0x12e172,_0x44aa28){var _0x11cd5d=_0x13edd1[_0x80ea('0x53')]['ids'];return db['Team'][_0x80ea('0x4b')]({'where':{'id':_0x11cd5d},'attributes':['id'],'include':[{'model':db[_0x80ea('0x6b')],'as':_0x80ea('0x6c'),'attributes':['id',_0x80ea('0x31'),_0x80ea('0x6d'),_0x80ea('0x6e'),'interface'],'raw':!![]}]})['then'](function(_0x3ee13f){if(_0x3ee13f){var _0x3c5d80=_['flatMap'](_0x3ee13f,function(_0x561c3b){var _0x159053=_0x561c3b[_0x80ea('0x2b')]({'plain':!![]});return _0x159053[_0x80ea('0x6c')];});return db[_0x80ea('0x35')]['find']({'where':{'id':_0x13edd1['params']['id']}})[_0x80ea('0x29')](function(_0x474fea){return db['sequelize'][_0x80ea('0x6f')](function(_0x4ef250){return _0x474fea[_0x80ea('0x6a')](_0x11cd5d,{'transaction':_0x4ef250})['then'](function(){return BPromise[_0x80ea('0x70')](_0x3c5d80,function(_0xb0319b){return db['UserWhatsappQueue'][_0x80ea('0x71')]({'where':{'UserId':_0xb0319b['id'],'WhatsappQueueId':_0x13edd1['params']['id']},'transaction':_0x4ef250});});})['then'](function(){_0x3c5d80[_0x80ea('0x72')](function(_0x59be27){socket[_0x80ea('0x73')]('userWhatsappQueue:save',{'UserId':_0x59be27['id'],'WhatsappQueueId':_0x474fea['id']});});});});});}})[_0x80ea('0x29')](respondWithStatusCode(_0x12e172,null))[_0x80ea('0x4d')](handleError(_0x12e172,null));};exports[_0x80ea('0x74')]=function(_0x397ee2,_0x3c0bf5,_0x21c0da){return db[_0x80ea('0x75')]['findAll']({'where':{'id':_0x397ee2[_0x80ea('0x3a')][_0x80ea('0x76')]},'attributes':['id'],'include':[{'model':db[_0x80ea('0x6b')],'as':_0x80ea('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c0bf5,null))[_0x80ea('0x29')](function(_0x5def3c){var _0x190721=_[_0x80ea('0x34')](_0x5def3c,'id');var _0x288f2f=[];var _0x581455=[];var _0x2f8d5f=squel[_0x80ea('0x77')]();_0x2f8d5f['field'](_0x80ea('0x78'))['from']('team_has_whatsapp_queues','tq')['join'](_0x80ea('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x397ee2[_0x80ea('0x5a')]['id']);for(var _0x251038=0x0;_0x251038<_0x5def3c[_0x80ea('0x3f')];_0x251038+=0x1){let _0xdc3c7e=_0x5def3c[_0x251038];for(var _0x2ab5b5=0x0;_0x2ab5b5<_0xdc3c7e[_0x80ea('0x6c')][_0x80ea('0x3f')];_0x2ab5b5+=0x1){let _0x139e8d=_0xdc3c7e['Agents'][_0x2ab5b5];var _0x4abc74=_0x2f8d5f[_0x80ea('0x7a')]();_0x4abc74[_0x80ea('0x43')](_0x80ea('0x7b'),_0x139e8d['id']);_0x581455['push'](db[_0x80ea('0x7c')][_0x80ea('0x3a')](_0x4abc74[_0x80ea('0x7d')](),{'type':db['sequelize'][_0x80ea('0x7e')][_0x80ea('0x7f')]})[_0x80ea('0x29')](function(_0xad9500){if(_0xad9500[_0x80ea('0x3f')]===0x1){return _0x139e8d['id'];}else{var _0x513b22=_[_0x80ea('0x80')](_['map'](_0xad9500,_0x80ea('0x81')),function(_0x41f7ce){return _['includes'](_0x190721,_0x41f7ce);});if(_0x513b22){return _0x139e8d['id'];}}}));}}return BPromise['all'](_0x581455)[_0x80ea('0x29')](function(_0x3f9aec){_0x288f2f=_(_0x288f2f)[_0x80ea('0x82')](_0x3f9aec)[_0x80ea('0x83')]()['value']();return db[_0x80ea('0x35')][_0x80ea('0x51')]({'where':{'id':_0x397ee2['params']['id']}})['then'](function(_0x74bef0){return db[_0x80ea('0x7c')][_0x80ea('0x6f')](function(_0x204507){return _0x74bef0[_0x80ea('0x74')](_0x397ee2[_0x80ea('0x3a')][_0x80ea('0x76')],{'transaction':_0x204507})[_0x80ea('0x29')](function(){if(!_[_0x80ea('0x84')](_0x288f2f)){return _0x74bef0[_0x80ea('0x85')](_0x288f2f,{'transaction':_0x204507});}})[_0x80ea('0x29')](function(){_0x288f2f[_0x80ea('0x72')](function(_0xd33b2){socket[_0x80ea('0x73')](_0x80ea('0x86'),{'UserId':_0xd33b2,'WhatsappQueueId':_0x74bef0['id']});});});});});});})[_0x80ea('0x29')](respondWithStatusCode(_0x3c0bf5,null))[_0x80ea('0x4d')](handleError(_0x3c0bf5,null));};exports[_0x80ea('0x87')]=function(_0x1fa2b1,_0x487eac,_0x2daf95){return db[_0x80ea('0x35')][_0x80ea('0x51')]({'where':{'id':_0x1fa2b1[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x487eac,null))['then'](function(_0x196068){if(_0x196068){return _0x196068['addAgents'](_0x1fa2b1[_0x80ea('0x53')]['ids'],_[_0x80ea('0x88')](_0x1fa2b1[_0x80ea('0x53')],[_0x80ea('0x76'),'id'])||{})[_0x80ea('0x89')](function(_0x38d4a3){for(var _0x3d2a4b=0x0;_0x3d2a4b<_0x1fa2b1[_0x80ea('0x53')][_0x80ea('0x76')][_0x80ea('0x3f')];_0x3d2a4b+=0x1){socket['emit'](_0x80ea('0x8a'),{'UserId':Number(_0x1fa2b1[_0x80ea('0x53')][_0x80ea('0x76')][_0x3d2a4b]),'WhatsappQueueId':Number(_0x1fa2b1[_0x80ea('0x5a')]['id'])});}return _0x38d4a3;});}})['then'](respondWithResult(_0x487eac,null))[_0x80ea('0x4d')](handleError(_0x487eac,null));};exports[_0x80ea('0x85')]=function(_0x5b0c19,_0x22f9b6,_0x1e909c){return db['WhatsappQueue'][_0x80ea('0x51')]({'where':{'id':_0x5b0c19[_0x80ea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x22f9b6,null))[_0x80ea('0x29')](function(_0x5a1a33){if(_0x5a1a33){return _0x5a1a33[_0x80ea('0x85')](_0x5b0c19['query'][_0x80ea('0x76')])['then'](function(){if(_[_0x80ea('0x8b')](_0x5b0c19['query'][_0x80ea('0x76')])){for(var _0x2b16f7=0x0;_0x2b16f7<_0x5b0c19['query'][_0x80ea('0x76')][_0x80ea('0x3f')];_0x2b16f7+=0x1){socket[_0x80ea('0x73')](_0x80ea('0x86'),{'UserId':Number(_0x5b0c19['query'][_0x80ea('0x76')][_0x2b16f7]),'WhatsappQueueId':Number(_0x5b0c19[_0x80ea('0x5a')]['id'])});}}else{socket[_0x80ea('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x5b0c19[_0x80ea('0x3a')]['ids']),'WhatsappQueueId':Number(_0x5b0c19['params']['id'])});}});}})[_0x80ea('0x29')](respondWithStatusCode(_0x22f9b6,null))[_0x80ea('0x4d')](handleError(_0x22f9b6,null));};exports[_0x80ea('0x8c')]=function(_0x158ed6,_0x2a11d3,_0x4a758d){var _0x48b3ce={};var _0x13a303={};var _0x4b791f;var _0x44dc0f;return db[_0x80ea('0x35')]['findOne']({'where':{'id':_0x158ed6[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x2a11d3,null))[_0x80ea('0x29')](function(_0x38ec02){if(_0x38ec02){_0x4b791f=_0x38ec02;_0x13a303['model']=_[_0x80ea('0x50')](db[_0x80ea('0x6b')]['rawAttributes']);_0x13a303[_0x80ea('0x3a')]=_['keys'](_0x158ed6[_0x80ea('0x3a')]);_0x13a303[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0x13a303[_0x80ea('0x39')],_0x13a303[_0x80ea('0x3a')]);_0x48b3ce[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0x13a303['model'],qs[_0x80ea('0x3e')](_0x158ed6['query'][_0x80ea('0x3e')]));_0x48b3ce['attributes']=_0x48b3ce['attributes'][_0x80ea('0x3f')]?_0x48b3ce['attributes']:_0x13a303[_0x80ea('0x39')];_0x48b3ce[_0x80ea('0x5d')]=qs[_0x80ea('0x42')](_0x158ed6['query'][_0x80ea('0x42')]);_0x48b3ce[_0x80ea('0x43')]=qs['filters'](_[_0x80ea('0x44')](_0x158ed6[_0x80ea('0x3a')],_0x13a303[_0x80ea('0x3b')]));if(_0x158ed6['query'][_0x80ea('0x47')]){_0x48b3ce[_0x80ea('0x43')]=_['merge'](_0x48b3ce[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x48b3ce['attributes'],function(_0x223e0c){var _0x2b6980={};_0x2b6980[_0x223e0c]={'$like':'%'+_0x158ed6[_0x80ea('0x3a')]['filter']+'%'};return _0x2b6980;})});}_0x48b3ce=_[_0x80ea('0x45')]({},_0x48b3ce,_0x158ed6[_0x80ea('0x48')]);return _0x4b791f['getAgents'](_0x48b3ce);}})[_0x80ea('0x29')](function(_0x4f8a4c){if(_0x4f8a4c){_0x44dc0f=_0x4f8a4c[_0x80ea('0x3f')];if(!_0x158ed6[_0x80ea('0x3a')][_0x80ea('0x40')](_0x80ea('0x41'))){_0x48b3ce[_0x80ea('0x23')]=qs[_0x80ea('0x23')](_0x158ed6[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x48b3ce[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x158ed6[_0x80ea('0x3a')]['offset']);}return _0x4b791f['getAgents'](_0x48b3ce);}})['then'](function(_0x1ec235){if(_0x1ec235){return _0x1ec235?{'count':_0x44dc0f,'rows':_0x1ec235}:null;}})[_0x80ea('0x29')](respondWithResult(_0x2a11d3,null))[_0x80ea('0x4d')](handleError(_0x2a11d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 5b4d292..3ce1cca 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 _0xff30=['save','update','emit','exports','WhatsappQueue'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xff30,0x153));var _0x0ff3=function(_0x4ca799,_0x3ec0f2){_0x4ca799=_0x4ca799-0x0;var _0x1e73fa=_0xff30[_0x4ca799];return _0x1e73fa;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x0ff3('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ff3('0x1'),'afterUpdate':_0x0ff3('0x2'),'afterDestroy':'remove'};function emitEvent(_0x13e26d){return function(_0x1d296c,_0x2bd610,_0x766fc1){WhatsappQueueEvents[_0x0ff3('0x3')](_0x13e26d+':'+_0x1d296c['id'],_0x1d296c);WhatsappQueueEvents['emit'](_0x13e26d,_0x1d296c);_0x766fc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x0ff3('0x4')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc66d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x3786d6,_0x24eb0c){var _0x1a529c=function(_0x258c9a){while(--_0x258c9a){_0x3786d6['push'](_0x3786d6['shift']());}};_0x1a529c(++_0x24eb0c);}(_0xc66d,0xd9));var _0xdc66=function(_0x27b7e9,_0x3713fd){_0x27b7e9=_0x27b7e9-0x0;var _0x44a6cb=_0xc66d[_0x27b7e9];return _0x44a6cb;};'use strict';var EventEmitter=require(_0xdc66('0x0'));var WhatsappQueue=require(_0xdc66('0x1'))['db'][_0xdc66('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xdc66('0x3')](0x0);var events={'afterCreate':_0xdc66('0x4'),'afterUpdate':_0xdc66('0x5'),'afterDestroy':_0xdc66('0x6')};function emitEvent(_0x472d37){return function(_0x5f0179,_0x22b386,_0x5345e4){WhatsappQueueEvents[_0xdc66('0x7')](_0x472d37+':'+_0x5f0179['id'],_0x5f0179);WhatsappQueueEvents[_0xdc66('0x7')](_0x472d37,_0x5f0179);_0x5345e4(null);};}for(var e in events){if(events[_0xdc66('0x8')](e)){var event=events[e];WhatsappQueue[_0xdc66('0x9')](e,emitEvent(event));}}module[_0xdc66('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a3ed72f..37ac6ca 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 _0x67dd=['../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x50d4cd,_0x25e478){var _0x68f9d=function(_0x320cfd){while(--_0x320cfd){_0x50d4cd['push'](_0x50d4cd['shift']());}};_0x68f9d(++_0x25e478);}(_0x67dd,0x125));var _0xd67d=function(_0x5f5436,_0x354dff){_0x5f5436=_0x5f5436-0x0;var _0x62d1ae=_0x67dd[_0x5f5436];return _0x62d1ae;};'use strict';var _=require(_0xd67d('0x0'));var util=require(_0xd67d('0x1'));var logger=require(_0xd67d('0x2'))(_0xd67d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd67d('0x4'));var fs=require('fs');var path=require(_0xd67d('0x5'));var rimraf=require(_0xd67d('0x6'));var config=require(_0xd67d('0x7'));var attributes=require(_0xd67d('0x8'));module[_0xd67d('0x9')]=function(_0x2ecf1f,_0x33ab0e){return _0x2ecf1f['define'](_0xd67d('0xa'),attributes,{'tableName':_0xd67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d48=['rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3d95e9,_0x45bb17){var _0x472c9a=function(_0x4eeb02){while(--_0x4eeb02){_0x3d95e9['push'](_0x3d95e9['shift']());}};_0x472c9a(++_0x45bb17);}(_0x4d48,0x9f));var _0x84d4=function(_0x2dc098,_0x48eb28){_0x2dc098=_0x2dc098-0x0;var _0x391d8d=_0x4d48[_0x2dc098];return _0x391d8d;};'use strict';var _=require(_0x84d4('0x0'));var util=require(_0x84d4('0x1'));var logger=require('../../config/logger')(_0x84d4('0x2'));var moment=require(_0x84d4('0x3'));var BPromise=require(_0x84d4('0x4'));var rp=require(_0x84d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84d4('0x6'));var config=require(_0x84d4('0x7'));var attributes=require(_0x84d4('0x8'));module['exports']=function(_0x3d3d42,_0x30be80){return _0x3d3d42['define'](_0x84d4('0x9'),attributes,{'tableName':_0x84d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 38369af..15d5e52 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 _0xec80=['register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket'];(function(_0x2fbfe9,_0xc34d85){var _0x2835f2=function(_0x4e93f9){while(--_0x4e93f9){_0x2fbfe9['push'](_0x2fbfe9['shift']());}};_0x2835f2(++_0xc34d85);}(_0xec80,0x151));var _0x0ec8=function(_0x332619,_0x108e85){_0x332619=_0x332619-0x0;var _0x1b76bf=_0xec80[_0x332619];return _0x1b76bf;};'use strict';var _=require(_0x0ec8('0x0'));var util=require(_0x0ec8('0x1'));var moment=require(_0x0ec8('0x2'));var BPromise=require(_0x0ec8('0x3'));var rs=require(_0x0ec8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ec8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ec8('0x6'))(_0x0ec8('0x7'));var config=require(_0x0ec8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0ec8('0x9')]=_[_0x0ec8('0xa')](config[_0x0ec8('0x9')],{'host':_0x0ec8('0xb'),'port':0x18eb});var socket=require(_0x0ec8('0xc'))(new Redis(config[_0x0ec8('0x9')]));require(_0x0ec8('0xd'))[_0x0ec8('0xe')](socket);function respondWithRpcPromise(_0x59f575,_0x592e6d,_0x2cc0f5){return new BPromise(function(_0x323d03,_0x42c0dd){return client[_0x0ec8('0xf')](_0x59f575,_0x2cc0f5)[_0x0ec8('0x10')](function(_0x161952){logger[_0x0ec8('0x11')](_0x0ec8('0x12'),_0x592e6d,'request\x20sent');logger[_0x0ec8('0x13')](_0x0ec8('0x14'),_0x592e6d,_0x0ec8('0x15'),JSON['stringify'](_0x161952));if(_0x161952[_0x0ec8('0x16')]){if(_0x161952['error']['code']===0x1f4){logger[_0x0ec8('0x16')](_0x0ec8('0x12'),_0x592e6d,_0x161952[_0x0ec8('0x16')][_0x0ec8('0x17')]);return _0x42c0dd(_0x161952[_0x0ec8('0x16')][_0x0ec8('0x17')]);}logger[_0x0ec8('0x16')](_0x0ec8('0x12'),_0x592e6d,_0x161952[_0x0ec8('0x16')]['message']);return _0x323d03(_0x161952['error']['message']);}else{logger[_0x0ec8('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x592e6d,_0x0ec8('0x15'));_0x323d03(_0x161952[_0x0ec8('0x18')]['message']);}})[_0x0ec8('0x19')](function(_0xbd2e2a){logger['error'](_0x0ec8('0x12'),_0x592e6d,_0xbd2e2a);_0x42c0dd(_0xbd2e2a);});});}exports['GetWhatsappQueue']=function(_0x4ed3a0){var _0x5365ad=this;return new Promise(function(_0x489841,_0x331517){return db[_0x0ec8('0x1a')]['findAll']({'raw':_0x4ed3a0['options']?_0x4ed3a0[_0x0ec8('0x1b')][_0x0ec8('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ed3a0['options']?_0x4ed3a0['options'][_0x0ec8('0x1d')]||null:null,'attributes':_0x4ed3a0[_0x0ec8('0x1b')]?_0x4ed3a0['options'][_0x0ec8('0x1e')]||null:null,'limit':_0x4ed3a0[_0x0ec8('0x1b')]?_0x4ed3a0[_0x0ec8('0x1b')][_0x0ec8('0x1f')]||null:null,'include':_0x4ed3a0[_0x0ec8('0x1b')]?_0x4ed3a0['options'][_0x0ec8('0x20')]?_[_0x0ec8('0x21')](_0x4ed3a0['options'][_0x0ec8('0x20')],function(_0x4c9f79){return{'model':db[_0x4c9f79[_0x0ec8('0x22')]],'as':_0x4c9f79['as'],'attributes':_0x4c9f79[_0x0ec8('0x1e')],'include':_0x4c9f79[_0x0ec8('0x20')]?_[_0x0ec8('0x21')](_0x4c9f79[_0x0ec8('0x20')],function(_0xd6c4be){return{'model':db[_0xd6c4be[_0x0ec8('0x22')]],'as':_0xd6c4be['as'],'attributes':_0xd6c4be['attributes'],'include':_0xd6c4be[_0x0ec8('0x20')]?_[_0x0ec8('0x21')](_0xd6c4be['include'],function(_0xbb502f){return{'model':db[_0xbb502f[_0x0ec8('0x22')]],'as':_0xbb502f['as'],'attributes':_0xbb502f[_0x0ec8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0ec8('0x10')](function(_0x28cd3b){logger[_0x0ec8('0x11')]('GetWhatsappQueue',_0x4ed3a0);logger[_0x0ec8('0x13')](_0x0ec8('0x23'),_0x4ed3a0,JSON[_0x0ec8('0x24')](_0x28cd3b));_0x489841(_0x28cd3b);})[_0x0ec8('0x19')](function(_0x2e2fee){logger[_0x0ec8('0x16')]('GetWhatsappQueue',_0x2e2fee[_0x0ec8('0x17')],_0x4ed3a0);_0x331517(_0x5365ad[_0x0ec8('0x16')](0x1f4,_0x2e2fee[_0x0ec8('0x17')]));});});};exports[_0x0ec8('0x25')]=function(_0x3f9915){var _0x371230=this;return new Promise(function(_0x3611da,_0x4650fa){return db['WhatsappQueue'][_0x0ec8('0x26')]({'raw':_0x3f9915[_0x0ec8('0x1b')]?_0x3f9915[_0x0ec8('0x1b')][_0x0ec8('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f9915['options']?_0x3f9915[_0x0ec8('0x1b')]['where']||null:null,'attributes':_0x3f9915[_0x0ec8('0x1b')]?_0x3f9915[_0x0ec8('0x1b')][_0x0ec8('0x1e')]||null:null,'include':_0x3f9915[_0x0ec8('0x1b')]?_0x3f9915[_0x0ec8('0x1b')]['include']?_['map'](_0x3f9915['options'][_0x0ec8('0x20')],function(_0xe1a101){return{'model':db[_0xe1a101[_0x0ec8('0x22')]],'as':_0xe1a101['as'],'attributes':_0xe1a101['attributes'],'include':_0xe1a101[_0x0ec8('0x20')]?_[_0x0ec8('0x21')](_0xe1a101['include'],function(_0x4c3c0c){return{'model':db[_0x4c3c0c[_0x0ec8('0x22')]],'as':_0x4c3c0c['as'],'attributes':_0x4c3c0c[_0x0ec8('0x1e')],'include':_0x4c3c0c[_0x0ec8('0x20')]?_['map'](_0x4c3c0c[_0x0ec8('0x20')],function(_0x2db3a8){return{'model':db[_0x2db3a8[_0x0ec8('0x22')]],'as':_0x2db3a8['as'],'attributes':_0x2db3a8[_0x0ec8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0ec8('0x10')](function(_0x184256){logger[_0x0ec8('0x11')](_0x0ec8('0x25'),_0x3f9915);logger[_0x0ec8('0x13')](_0x0ec8('0x25'),_0x3f9915,JSON[_0x0ec8('0x24')](_0x184256));_0x3611da(_0x184256);})[_0x0ec8('0x19')](function(_0x47f3a2){logger[_0x0ec8('0x16')](_0x0ec8('0x25'),_0x47f3a2['message'],_0x3f9915);_0x4650fa(_0x371230[_0x0ec8('0x16')](0x1f4,_0x47f3a2[_0x0ec8('0x17')]));});});}; \ No newline at end of file +var _0x6fd5=['raw','where','limit','map','include','attributes','model','debug','catch','ShowWhatsappQueue','find','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','options'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0x6fd5,0x12b));var _0x56fd=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6fd5[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x56fd('0x0'));var rs=require(_0x56fd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56fd('0x2'))['db'];var utils=require(_0x56fd('0x3'));var logger=require('../../config/logger')(_0x56fd('0x4'));var config=require('../../config/environment');var jayson=require(_0x56fd('0x5'));var client=jayson[_0x56fd('0x6')]['http']({'port':0x232a});config['redis']=_[_0x56fd('0x7')](config[_0x56fd('0x8')],{'host':_0x56fd('0x9'),'port':0x18eb});var socket=require(_0x56fd('0xa'))(new Redis(config[_0x56fd('0x8')]));require(_0x56fd('0xb'))['register'](socket);function respondWithRpcPromise(_0x19eb86,_0xe5100d,_0x8a730d){return new BPromise(function(_0x12bde6,_0x5056fd){return client[_0x56fd('0xc')](_0x19eb86,_0x8a730d)[_0x56fd('0xd')](function(_0x40e541){logger[_0x56fd('0xe')](_0x56fd('0xf'),_0xe5100d,_0x56fd('0x10'));logger['debug'](_0x56fd('0x11'),_0xe5100d,_0x56fd('0x10'),JSON[_0x56fd('0x12')](_0x40e541));if(_0x40e541[_0x56fd('0x13')]){if(_0x40e541[_0x56fd('0x13')][_0x56fd('0x14')]===0x1f4){logger[_0x56fd('0x13')](_0x56fd('0xf'),_0xe5100d,_0x40e541[_0x56fd('0x13')][_0x56fd('0x15')]);return _0x5056fd(_0x40e541['error'][_0x56fd('0x15')]);}logger['error'](_0x56fd('0xf'),_0xe5100d,_0x40e541['error']['message']);return _0x12bde6(_0x40e541[_0x56fd('0x13')]['message']);}else{logger['info'](_0x56fd('0xf'),_0xe5100d,_0x56fd('0x10'));_0x12bde6(_0x40e541[_0x56fd('0x16')]['message']);}})['catch'](function(_0x19e57a){logger[_0x56fd('0x13')](_0x56fd('0xf'),_0xe5100d,_0x19e57a);_0x5056fd(_0x19e57a);});});}exports[_0x56fd('0x17')]=function(_0x5c341b){var _0x48b0fd=this;return new Promise(function(_0x2e0a15,_0xb68ca5){return db['WhatsappQueue']['findAll']({'raw':_0x5c341b[_0x56fd('0x18')]?_0x5c341b['options'][_0x56fd('0x19')]===undefined?!![]:![]:!![],'where':_0x5c341b['options']?_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1a')]||null:null,'attributes':_0x5c341b[_0x56fd('0x18')]?_0x5c341b['options']['attributes']||null:null,'limit':_0x5c341b['options']?_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1b')]||null:null,'include':_0x5c341b[_0x56fd('0x18')]?_0x5c341b[_0x56fd('0x18')]['include']?_[_0x56fd('0x1c')](_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1d')],function(_0x165957){return{'model':db[_0x165957['model']],'as':_0x165957['as'],'attributes':_0x165957['attributes'],'include':_0x165957[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x165957['include'],function(_0x1027ed){return{'model':db[_0x1027ed['model']],'as':_0x1027ed['as'],'attributes':_0x1027ed[_0x56fd('0x1e')],'include':_0x1027ed[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x1027ed['include'],function(_0x22ca5c){return{'model':db[_0x22ca5c[_0x56fd('0x1f')]],'as':_0x22ca5c['as'],'attributes':_0x22ca5c[_0x56fd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x56fd('0xd')](function(_0x110540){logger[_0x56fd('0xe')](_0x56fd('0x17'),_0x5c341b);logger[_0x56fd('0x20')](_0x56fd('0x17'),_0x5c341b,JSON['stringify'](_0x110540));_0x2e0a15(_0x110540);})[_0x56fd('0x21')](function(_0x2c0aef){logger[_0x56fd('0x13')](_0x56fd('0x17'),_0x2c0aef[_0x56fd('0x15')],_0x5c341b);_0xb68ca5(_0x48b0fd[_0x56fd('0x13')](0x1f4,_0x2c0aef[_0x56fd('0x15')]));});});};exports[_0x56fd('0x22')]=function(_0x44a8f6){var _0x528410=this;return new Promise(function(_0x3d119a,_0x368748){return db['WhatsappQueue'][_0x56fd('0x23')]({'raw':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6['options'][_0x56fd('0x19')]===undefined?!![]:![]:!![],'where':_0x44a8f6['options']?_0x44a8f6[_0x56fd('0x18')]['where']||null:null,'attributes':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1e')]||null:null,'include':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1d')]?_['map'](_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1d')],function(_0x1610c5){return{'model':db[_0x1610c5[_0x56fd('0x1f')]],'as':_0x1610c5['as'],'attributes':_0x1610c5[_0x56fd('0x1e')],'include':_0x1610c5[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x1610c5[_0x56fd('0x1d')],function(_0x37321c){return{'model':db[_0x37321c[_0x56fd('0x1f')]],'as':_0x37321c['as'],'attributes':_0x37321c[_0x56fd('0x1e')],'include':_0x37321c[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x37321c['include'],function(_0xd5e10e){return{'model':db[_0xd5e10e[_0x56fd('0x1f')]],'as':_0xd5e10e['as'],'attributes':_0xd5e10e['attributes']};}):[]};}):[]};}):[]:[]})[_0x56fd('0xd')](function(_0x360572){logger[_0x56fd('0xe')](_0x56fd('0x22'),_0x44a8f6);logger[_0x56fd('0x20')](_0x56fd('0x22'),_0x44a8f6,JSON['stringify'](_0x360572));_0x3d119a(_0x360572);})[_0x56fd('0x21')](function(_0x5e4719){logger[_0x56fd('0x13')](_0x56fd('0x22'),_0x5e4719[_0x56fd('0x15')],_0x44a8f6);_0x368748(_0x528410[_0x56fd('0x13')](0x1f4,_0x5e4719[_0x56fd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 643a869..a0e605d 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 _0xa89a=['register','length','whatsappQueue:','./whatsappQueue.events','remove','update','emit'];(function(_0x30e84c,_0x4937fc){var _0x3aea2b=function(_0x306f46){while(--_0x306f46){_0x30e84c['push'](_0x30e84c['shift']());}};_0x3aea2b(++_0x4937fc);}(_0xa89a,0x1a0));var _0xaa89=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa89a[_0x1969a7];return _0x3d665f;};'use strict';var WhatsappQueueEvents=require(_0xaa89('0x0'));var events=['save',_0xaa89('0x1'),_0xaa89('0x2')];function createListener(_0x30b11f,_0x1080dc){return function(_0x3a75aa){_0x1080dc[_0xaa89('0x3')](_0x30b11f,_0x3a75aa);};}function removeListener(_0x27ec7d,_0x43951c){return function(){WhatsappQueueEvents['removeListener'](_0x27ec7d,_0x43951c);};}exports[_0xaa89('0x4')]=function(_0x452923){for(var _0x17d290=0x0,_0x213d7c=events[_0xaa89('0x5')];_0x17d290<_0x213d7c;_0x17d290++){var _0x1b448c=events[_0x17d290];var _0x58f677=createListener(_0xaa89('0x6')+_0x1b448c,_0x452923);WhatsappQueueEvents['on'](_0x1b448c,_0x58f677);}}; \ No newline at end of file +var _0x92bd=['register','whatsappQueue:','save','remove','update','removeListener'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x92bd,0x188));var _0xd92b=function(_0x1412b0,_0x489412){_0x1412b0=_0x1412b0-0x0;var _0x29d28f=_0x92bd[_0x1412b0];return _0x29d28f;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xd92b('0x0'),_0xd92b('0x1'),_0xd92b('0x2')];function createListener(_0x29588b,_0x3d9aae){return function(_0x30f4c6){_0x3d9aae['emit'](_0x29588b,_0x30f4c6);};}function removeListener(_0xe242b0,_0x41b52d){return function(){WhatsappQueueEvents[_0xd92b('0x3')](_0xe242b0,_0x41b52d);};}exports[_0xd92b('0x4')]=function(_0x3f385b){for(var _0x1891f2=0x0,_0x2e9d21=events['length'];_0x1891f2<_0x2e9d21;_0x1891f2++){var _0x3f12c9=events[_0x1891f2];var _0x2396b7=createListener(_0xd92b('0x5')+_0x3f12c9,_0x3f385b);WhatsappQueueEvents['on'](_0x3f12c9,_0x2396b7);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7d495c4..2d0b17d 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 _0xa356=['describe','/:id','isAuthenticated','show','post','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe'];(function(_0x3134bc,_0x282a70){var _0x45b747=function(_0x10e21e){while(--_0x10e21e){_0x3134bc['push'](_0x3134bc['shift']());}};_0x45b747(++_0x282a70);}(_0xa356,0xdb));var _0x6a35=function(_0x4a1cf4,_0x36ab33){_0x4a1cf4=_0x4a1cf4-0x0;var _0x1542bc=_0xa356[_0x4a1cf4];return _0x1542bc;};'use strict';var multer=require('multer');var util=require(_0x6a35('0x0'));var path=require('path');var timeout=require(_0x6a35('0x1'));var express=require(_0x6a35('0x2'));var router=express[_0x6a35('0x3')]();var fs_extra=require(_0x6a35('0x4'));var auth=require(_0x6a35('0x5'));var interaction=require(_0x6a35('0x6'));var config=require(_0x6a35('0x7'));var controller=require(_0x6a35('0x8'));router[_0x6a35('0x9')]('/',auth['isAuthenticated'](),controller[_0x6a35('0xa')]);router[_0x6a35('0x9')](_0x6a35('0xb'),auth['isAuthenticated'](),controller[_0x6a35('0xc')]);router[_0x6a35('0x9')](_0x6a35('0xd'),auth[_0x6a35('0xe')](),controller[_0x6a35('0xf')]);router[_0x6a35('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6a35('0xd'),auth[_0x6a35('0xe')](),controller[_0x6a35('0x11')]);router[_0x6a35('0x12')]('/:id',auth[_0x6a35('0xe')](),controller[_0x6a35('0x13')]);module[_0x6a35('0x14')]=router; \ No newline at end of file +var _0xe0dd=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','exports','multer'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0xe0dd,0x1f3));var _0xde0d=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0xe0dd[_0x1f99a0];return _0x1e0849;};'use strict';var multer=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var path=require(_0xde0d('0x2'));var timeout=require(_0xde0d('0x3'));var express=require(_0xde0d('0x4'));var router=express[_0xde0d('0x5')]();var fs_extra=require(_0xde0d('0x6'));var auth=require(_0xde0d('0x7'));var interaction=require(_0xde0d('0x8'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0xde0d('0x9')]('/',auth[_0xde0d('0xa')](),controller[_0xde0d('0xb')]);router[_0xde0d('0x9')](_0xde0d('0xc'),auth[_0xde0d('0xa')](),controller[_0xde0d('0xd')]);router[_0xde0d('0x9')](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller['show']);router[_0xde0d('0xf')]('/',auth[_0xde0d('0xa')](),controller[_0xde0d('0x10')]);router['put'](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller[_0xde0d('0x11')]);router[_0xde0d('0x12')](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller['destroy']);module[_0xde0d('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 2e57103..fa4fd63 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x28e5b1,_0x508ea5){var _0x18e5a7=function(_0x3bd479){while(--_0x3bd479){_0x28e5b1['push'](_0x28e5b1['shift']());}};_0x18e5a7(++_0x508ea5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1126db,_0x49aaad){var _0x17c814=function(_0x5d72d2){while(--_0x5d72d2){_0x1126db['push'](_0x1126db['shift']());}};_0x17c814(++_0x49aaad);}(_0x7a54,0x106));var _0x47a5=function(_0x1db863,_0x437d98){_0x1db863=_0x1db863-0x0;var _0x34027f=_0x7a54[_0x1db863];return _0x34027f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 8fa7eeb..c93ad21 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 _0x878f=['intersection','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','WhatsappQueueReport','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes'];(function(_0xdf059b,_0x198a6c){var _0x4a3c71=function(_0x381d46){while(--_0x381d46){_0xdf059b['push'](_0xdf059b['shift']());}};_0x4a3c71(++_0x198a6c);}(_0x878f,0x173));var _0xf878=function(_0x357331,_0x2f07e9){_0x357331=_0x357331-0x0;var _0x111d18=_0x878f[_0x357331];return _0x111d18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x22')]();});}};}function handleEntityNotFound(_0x35b3b4,_0x280036){return function(_0x20449e){if(!_0x20449e){_0x35b3b4['sendStatus'](0x194);}return _0x20449e;};}function handleError(_0x58c713,_0x59ba7b){_0x59ba7b=_0x59ba7b||0x1f4;return function(_0x242926){logger[_0xf878('0x23')](_0x242926[_0xf878('0x24')]);if(_0x242926['name']){delete _0x242926[_0xf878('0x25')];}_0x58c713[_0xf878('0x16')](_0x59ba7b)[_0xf878('0x26')](_0x242926);};}exports[_0xf878('0x27')]=function(_0x41dd55,_0x5aff46){var _0x502322={},_0x9a127d={},_0x5d9c97={'count':0x0,'rows':[]};var _0x4a0286=_[_0xf878('0x28')](db['WhatsappQueueReport'][_0xf878('0x29')],function(_0x51afaf){return{'name':_0x51afaf[_0xf878('0x2a')],'type':_0x51afaf['type'][_0xf878('0x2b')]};});_0x9a127d['model']=_[_0xf878('0x28')](_0x4a0286,_0xf878('0x25'));_0x9a127d[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x41dd55[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2e')]=_['intersection'](_0x9a127d[_0xf878('0x2f')],_0x9a127d[_0xf878('0x2c')]);_0x502322[_0xf878('0x30')]=_[_0xf878('0x31')](_0x9a127d[_0xf878('0x2f')],qs['fields'](_0x41dd55[_0xf878('0x2c')][_0xf878('0x32')]));_0x502322['attributes']=_0x502322[_0xf878('0x30')][_0xf878('0x33')]?_0x502322[_0xf878('0x30')]:_0x9a127d[_0xf878('0x2f')];if(!_0x41dd55[_0xf878('0x2c')]['hasOwnProperty'](_0xf878('0x34'))){_0x502322[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x41dd55[_0xf878('0x2c')]['limit']);_0x502322[_0xf878('0x17')]=qs['offset'](_0x41dd55['query'][_0xf878('0x17')]);}_0x502322[_0xf878('0x35')]=qs[_0xf878('0x36')](_0x41dd55[_0xf878('0x2c')][_0xf878('0x36')]);_0x502322['where']=qs[_0xf878('0x2e')](_['pick'](_0x41dd55[_0xf878('0x2c')],_0x9a127d[_0xf878('0x2e')]),_0x4a0286);if(_0x41dd55['query'][_0xf878('0x37')]){_0x502322[_0xf878('0x38')]=_['merge'](_0x502322[_0xf878('0x38')],{'$or':_[_0xf878('0x28')](_0x4a0286,function(_0x5b4098){if(_0x5b4098[_0xf878('0x39')]!==_0xf878('0x3a')){var _0x34731d={};_0x34731d[_0x5b4098[_0xf878('0x25')]]={'$like':'%'+_0x41dd55[_0xf878('0x2c')][_0xf878('0x37')]+'%'};return _0x34731d;}})});}_0x502322=_[_0xf878('0x3b')]({},_0x502322,_0x41dd55['options']);var _0x1179fb={'where':_0x502322[_0xf878('0x38')]};return db['WhatsappQueueReport'][_0xf878('0x1a')](_0x1179fb)['then'](function(_0x489964){_0x5d9c97[_0xf878('0x1a')]=_0x489964;if(_0x41dd55[_0xf878('0x2c')][_0xf878('0x3c')]){_0x502322[_0xf878('0x3d')]=[{'all':!![]}];}return db[_0xf878('0x3e')]['findAll'](_0x502322);})[_0xf878('0x20')](function(_0x4c4ae4){_0x5d9c97[_0xf878('0x3f')]=_0x4c4ae4;return _0x5d9c97;})[_0xf878('0x20')](respondWithFilteredResult(_0x5aff46,_0x502322))['catch'](handleError(_0x5aff46,null));};exports['show']=function(_0x180594,_0x2a66c1){var _0x13fcd3={'raw':!![],'where':{'id':_0x180594[_0xf878('0x40')]['id']}},_0x2f6ee5={};_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2d')](db[_0xf878('0x3e')][_0xf878('0x29')]);_0x2f6ee5['query']=_[_0xf878('0x2d')](_0x180594[_0xf878('0x2c')]);_0x2f6ee5[_0xf878('0x2e')]=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],_0x2f6ee5[_0xf878('0x2c')]);_0x13fcd3['attributes']=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],qs[_0xf878('0x32')](_0x180594[_0xf878('0x2c')][_0xf878('0x32')]));_0x13fcd3['attributes']=_0x13fcd3[_0xf878('0x30')][_0xf878('0x33')]?_0x13fcd3[_0xf878('0x30')]:_0x2f6ee5[_0xf878('0x2f')];if(_0x180594['query'][_0xf878('0x3c')]){_0x13fcd3[_0xf878('0x3d')]=[{'all':!![]}];}_0x13fcd3=_[_0xf878('0x3b')]({},_0x13fcd3,_0x180594['options']);return db['WhatsappQueueReport'][_0xf878('0x41')](_0x13fcd3)['then'](handleEntityNotFound(_0x2a66c1,null))['then'](respondWithResult(_0x2a66c1,null))['catch'](handleError(_0x2a66c1,null));};exports[_0xf878('0x42')]=function(_0x49e719,_0x156fdb){return db[_0xf878('0x3e')][_0xf878('0x42')](_0x49e719[_0xf878('0x43')],{})[_0xf878('0x20')](respondWithResult(_0x156fdb,0xc9))[_0xf878('0x44')](handleError(_0x156fdb,null));};exports[_0xf878('0x1f')]=function(_0x526c89,_0xb0bf4c){if(_0x526c89[_0xf878('0x43')]['id']){delete _0x526c89[_0xf878('0x43')]['id'];}return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x526c89['params']['id']}})['then'](handleEntityNotFound(_0xb0bf4c,null))[_0xf878('0x20')](saveUpdates(_0x526c89[_0xf878('0x43')],null))['then'](respondWithResult(_0xb0bf4c,null))[_0xf878('0x44')](handleError(_0xb0bf4c,null));};exports['destroy']=function(_0x1ce6b9,_0x31adde){return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x1ce6b9['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x31adde,null))[_0xf878('0x20')](removeEntity(_0x31adde,null))[_0xf878('0x44')](handleError(_0x31adde,null));};exports['describe']=function(_0xce30a5,_0x30df05){return db[_0xf878('0x3e')][_0xf878('0x45')]()['then'](respondWithResult(_0x30df05,null))[_0xf878('0x44')](handleError(_0x30df05,null));}; \ No newline at end of file +var _0xd87e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs'];(function(_0x217626,_0x71d75){var _0x3e2ada=function(_0x16dc65){while(--_0x16dc65){_0x217626['push'](_0x217626['shift']());}};_0x3e2ada(++_0x71d75);}(_0xd87e,0x1bf));var _0xed87=function(_0x2d6391,_0x4b7ec8){_0x2d6391=_0x2d6391-0x0;var _0x5e2ee6=_0xd87e[_0x2d6391];return _0x5e2ee6;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['index']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={},_0x3dff74={},_0x33c367={'count':0x0,'rows':[]};var _0x21c93b=_['map'](db['WhatsappQueueReport'][_0xed87('0x29')],function(_0x428b75){return{'name':_0x428b75[_0xed87('0x2a')],'type':_0x428b75['type'][_0xed87('0x2b')]};});_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0x21c93b,_0xed87('0x27'));_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0xb32b1c[_0xed87('0x2e')]);_0x3dff74[_0xed87('0x30')]=_[_0xed87('0x31')](_0x3dff74['model'],_0x3dff74[_0xed87('0x2e')]);_0x4eaa44[_0xed87('0x32')]=_['intersection'](_0x3dff74[_0xed87('0x2c')],qs['fields'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x4eaa44[_0xed87('0x32')]=_0x4eaa44[_0xed87('0x32')][_0xed87('0x34')]?_0x4eaa44[_0xed87('0x32')]:_0x3dff74[_0xed87('0x2c')];if(!_0xb32b1c[_0xed87('0x2e')][_0xed87('0x35')](_0xed87('0x36'))){_0x4eaa44[_0xed87('0x1e')]=qs['limit'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x1e')]);_0x4eaa44['offset']=qs[_0xed87('0x1c')](_0xb32b1c['query'][_0xed87('0x1c')]);}_0x4eaa44[_0xed87('0x37')]=qs['sort'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x38')]);_0x4eaa44[_0xed87('0x39')]=qs[_0xed87('0x30')](_[_0xed87('0x3a')](_0xb32b1c['query'],_0x3dff74[_0xed87('0x30')]),_0x21c93b);if(_0xb32b1c['query'][_0xed87('0x3b')]){_0x4eaa44['where']=_[_0xed87('0x3c')](_0x4eaa44[_0xed87('0x39')],{'$or':_[_0xed87('0x2d')](_0x21c93b,function(_0x217435){if(_0x217435[_0xed87('0x3d')]!==_0xed87('0x3e')){var _0x9e3356={};_0x9e3356[_0x217435[_0xed87('0x27')]]={'$like':'%'+_0xb32b1c[_0xed87('0x2e')]['filter']+'%'};return _0x9e3356;}})});}_0x4eaa44=_['merge']({},_0x4eaa44,_0xb32b1c[_0xed87('0x3f')]);var _0x206544={'where':_0x4eaa44[_0xed87('0x39')]};return db[_0xed87('0x40')][_0xed87('0x1f')](_0x206544)[_0xed87('0x23')](function(_0x5d1bd0){_0x33c367[_0xed87('0x1f')]=_0x5d1bd0;if(_0xb32b1c[_0xed87('0x2e')][_0xed87('0x41')]){_0x4eaa44['include']=[{'all':!![]}];}return db[_0xed87('0x40')][_0xed87('0x42')](_0x4eaa44);})[_0xed87('0x23')](function(_0x1b0092){_0x33c367[_0xed87('0x43')]=_0x1b0092;return _0x33c367;})[_0xed87('0x23')](respondWithFilteredResult(_0x1c4a65,_0x4eaa44))[_0xed87('0x44')](handleError(_0x1c4a65,null));};exports[_0xed87('0x45')]=function(_0x35bd1c,_0x406b73){var _0x5c6925={'raw':!![],'where':{'id':_0x35bd1c[_0xed87('0x46')]['id']}},_0x7e6cbb={};_0x7e6cbb[_0xed87('0x2c')]=_['keys'](db['WhatsappQueueReport'][_0xed87('0x29')]);_0x7e6cbb[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x35bd1c[_0xed87('0x2e')]);_0x7e6cbb['filters']=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],_0x7e6cbb['query']);_0x5c6925[_0xed87('0x32')]=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],qs[_0xed87('0x33')](_0x35bd1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x5c6925[_0xed87('0x32')]=_0x5c6925[_0xed87('0x32')][_0xed87('0x34')]?_0x5c6925[_0xed87('0x32')]:_0x7e6cbb[_0xed87('0x2c')];if(_0x35bd1c['query'][_0xed87('0x41')]){_0x5c6925[_0xed87('0x47')]=[{'all':!![]}];}_0x5c6925=_[_0xed87('0x3c')]({},_0x5c6925,_0x35bd1c[_0xed87('0x3f')]);return db[_0xed87('0x40')][_0xed87('0x48')](_0x5c6925)[_0xed87('0x23')](handleEntityNotFound(_0x406b73,null))[_0xed87('0x23')](respondWithResult(_0x406b73,null))[_0xed87('0x44')](handleError(_0x406b73,null));};exports[_0xed87('0x49')]=function(_0x8aa499,_0x26c8f4){return db[_0xed87('0x40')][_0xed87('0x49')](_0x8aa499[_0xed87('0x4a')],{})[_0xed87('0x23')](respondWithResult(_0x26c8f4,0xc9))[_0xed87('0x44')](handleError(_0x26c8f4,null));};exports['update']=function(_0x2c7bef,_0x1a68a7){if(_0x2c7bef[_0xed87('0x4a')]['id']){delete _0x2c7bef['body']['id'];}return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x2c7bef['params']['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x1a68a7,null))[_0xed87('0x23')](saveUpdates(_0x2c7bef[_0xed87('0x4a')],null))[_0xed87('0x23')](respondWithResult(_0x1a68a7,null))['catch'](handleError(_0x1a68a7,null));};exports[_0xed87('0x24')]=function(_0x436e15,_0x3ca34c){return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x436e15[_0xed87('0x46')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3ca34c,null))[_0xed87('0x23')](removeEntity(_0x3ca34c,null))[_0xed87('0x44')](handleError(_0x3ca34c,null));};exports[_0xed87('0x4b')]=function(_0x25a514,_0x18846f){return db[_0xed87('0x40')]['describe']()[_0xed87('0x23')](respondWithResult(_0x18846f,null))['catch'](handleError(_0x18846f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f101fc7..eab1034 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 _0x7da5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','uniqueid','../../config/logger'];(function(_0x49283a,_0x217442){var _0x3affc4=function(_0x2a8305){while(--_0x2a8305){_0x49283a['push'](_0x49283a['shift']());}};_0x3affc4(++_0x217442);}(_0x7da5,0x78));var _0x57da=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7da5[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x57da('0x0'))(_0x57da('0x1'));var moment=require(_0x57da('0x2'));var BPromise=require(_0x57da('0x3'));var rp=require(_0x57da('0x4'));var fs=require('fs');var path=require(_0x57da('0x5'));var rimraf=require(_0x57da('0x6'));var config=require(_0x57da('0x7'));var attributes=require(_0x57da('0x8'));module['exports']=function(_0x33d126,_0x5e00fe){return _0x33d126[_0x57da('0x9')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x57da('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cdc=['uniqueid','api','moment','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x13b8db,_0x29bde1){var _0x2d844b=function(_0x301d32){while(--_0x301d32){_0x13b8db['push'](_0x13b8db['shift']());}};_0x2d844b(++_0x29bde1);}(_0x2cdc,0xf1));var _0xc2cd=function(_0x1debaa,_0x39c5a5){_0x1debaa=_0x1debaa-0x0;var _0x2fbd5e=_0x2cdc[_0x1debaa];return _0x2fbd5e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc2cd('0x0'));var moment=require(_0xc2cd('0x1'));var BPromise=require('bluebird');var rp=require(_0xc2cd('0x2'));var fs=require('fs');var path=require(_0xc2cd('0x3'));var rimraf=require(_0xc2cd('0x4'));var config=require('../../config/environment');var attributes=require(_0xc2cd('0x5'));module[_0xc2cd('0x6')]=function(_0x52323a,_0x21994f){return _0x52323a[_0xc2cd('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xc2cd('0x8'),'paranoid':![],'indexes':[{'name':_0xc2cd('0x9'),'fields':[_0xc2cd('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index cd5c05b..e8afb89 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 _0xd158=['../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','options','stringify','catch','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis'];(function(_0x452f56,_0x999250){var _0x9f1c6a=function(_0x27ef63){while(--_0x27ef63){_0x452f56['push'](_0x452f56['shift']());}};_0x9f1c6a(++_0x999250);}(_0xd158,0xc6));var _0x8d15=function(_0xd0a7bd,_0x163fe8){_0xd0a7bd=_0xd0a7bd-0x0;var _0x47990e=_0xd158[_0xd0a7bd];return _0x47990e;};'use strict';var _=require(_0x8d15('0x0'));var util=require(_0x8d15('0x1'));var moment=require(_0x8d15('0x2'));var BPromise=require(_0x8d15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8d15('0x5'))('rpc');var config=require(_0x8d15('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8d15('0x7')][_0x8d15('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31bc0d,_0x1ece8a,_0x5b61ac){return new BPromise(function(_0x5db2f8,_0x1bcaa9){return client['request'](_0x31bc0d,_0x5b61ac)[_0x8d15('0x9')](function(_0x1d25fa){logger[_0x8d15('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1ece8a,_0x8d15('0xb'));logger[_0x8d15('0xc')](_0x8d15('0xd'),_0x1ece8a,_0x8d15('0xb'),JSON['stringify'](_0x1d25fa));if(_0x1d25fa[_0x8d15('0xe')]){if(_0x1d25fa[_0x8d15('0xe')][_0x8d15('0xf')]===0x1f4){logger[_0x8d15('0xe')](_0x8d15('0x10'),_0x1ece8a,_0x1d25fa[_0x8d15('0xe')][_0x8d15('0x11')]);return _0x1bcaa9(_0x1d25fa[_0x8d15('0xe')][_0x8d15('0x11')]);}logger[_0x8d15('0xe')](_0x8d15('0x10'),_0x1ece8a,_0x1d25fa['error'][_0x8d15('0x11')]);return _0x5db2f8(_0x1d25fa[_0x8d15('0xe')][_0x8d15('0x11')]);}else{logger[_0x8d15('0xa')](_0x8d15('0x10'),_0x1ece8a,'request\x20sent');_0x5db2f8(_0x1d25fa[_0x8d15('0x12')][_0x8d15('0x11')]);}})['catch'](function(_0x455aee){logger[_0x8d15('0xe')](_0x8d15('0x10'),_0x1ece8a,_0x455aee);_0x1bcaa9(_0x455aee);});});}exports['CreateWhatsappQueueReport']=function(_0x11a139){var _0x90ed57=this;return new Promise(function(_0x3e4fe0,_0xd62db9){return db['WhatsappQueueReport']['create'](_0x11a139['body'],{'raw':_0x11a139[_0x8d15('0x13')]?_0x11a139[_0x8d15('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x8d15('0x9')](function(_0x3dad40){logger[_0x8d15('0xa')]('CreateWhatsappQueueReport',_0x11a139);logger[_0x8d15('0xc')]('CreateWhatsappQueueReport',_0x11a139,JSON[_0x8d15('0x14')](_0x3dad40));_0x3e4fe0(_0x3dad40);})[_0x8d15('0x15')](function(_0x4442bb){logger[_0x8d15('0xe')](_0x8d15('0x16'),_0x4442bb['message'],_0x11a139);_0xd62db9(_0x90ed57[_0x8d15('0xe')](0x1f4,_0x4442bb['message']));});});};exports[_0x8d15('0x17')]=function(_0x2e8118){var _0xa0ee2c=this;return new Promise(function(_0xb37173,_0x33533e){return db[_0x8d15('0x18')][_0x8d15('0x19')](_0x2e8118['body'],{'raw':_0x2e8118['options']?_0x2e8118[_0x8d15('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e8118[_0x8d15('0x13')]?_0x2e8118[_0x8d15('0x13')][_0x8d15('0x1a')]||null:null,'attributes':_0x2e8118[_0x8d15('0x13')]?_0x2e8118[_0x8d15('0x13')][_0x8d15('0x1b')]||null:null,'limit':_0x2e8118[_0x8d15('0x13')]?_0x2e8118[_0x8d15('0x13')][_0x8d15('0x1c')]||null:null})['then'](function(_0x1fe2d5){logger[_0x8d15('0xa')](_0x8d15('0x17'),_0x2e8118);logger[_0x8d15('0xc')](_0x8d15('0x17'),_0x2e8118,JSON[_0x8d15('0x14')](_0x1fe2d5));_0xb37173(_0x1fe2d5);})[_0x8d15('0x15')](function(_0x7efe66){logger['error'](_0x8d15('0x17'),_0x7efe66[_0x8d15('0x11')],_0x2e8118);_0x33533e(_0xa0ee2c[_0x8d15('0xe')](0x1f4,_0x7efe66['message']));});});}; \ No newline at end of file +var _0x1e1d=['error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','stringify','WhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x1e1d,0x165));var _0xd1e1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x1e1d[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0xd1e1('0x0'));var moment=require(_0xd1e1('0x1'));var BPromise=require(_0xd1e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e1('0x3'));var db=require(_0xd1e1('0x4'))['db'];var utils=require(_0xd1e1('0x5'));var logger=require(_0xd1e1('0x6'))(_0xd1e1('0x7'));var config=require(_0xd1e1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd1e1('0x9')][_0xd1e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4be1e8,_0x41642d,_0xd446b3){return new BPromise(function(_0x3e780b,_0x2f5306){return client[_0xd1e1('0xb')](_0x4be1e8,_0xd446b3)[_0xd1e1('0xc')](function(_0x5afe95){logger[_0xd1e1('0xd')](_0xd1e1('0xe'),_0x41642d,_0xd1e1('0xf'));logger[_0xd1e1('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x41642d,_0xd1e1('0xf'),JSON['stringify'](_0x5afe95));if(_0x5afe95[_0xd1e1('0x11')]){if(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x12')]===0x1f4){logger[_0xd1e1('0x11')](_0xd1e1('0xe'),_0x41642d,_0x5afe95['error'][_0xd1e1('0x13')]);return _0x2f5306(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x41642d,_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);return _0x3e780b(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);}else{logger[_0xd1e1('0xd')](_0xd1e1('0xe'),_0x41642d,_0xd1e1('0xf'));_0x3e780b(_0x5afe95[_0xd1e1('0x14')][_0xd1e1('0x13')]);}})[_0xd1e1('0x15')](function(_0x31ea69){logger['error'](_0xd1e1('0xe'),_0x41642d,_0x31ea69);_0x2f5306(_0x31ea69);});});}exports[_0xd1e1('0x16')]=function(_0x47af2c){var _0x384f88=this;return new Promise(function(_0x103300,_0x305805){return db['WhatsappQueueReport'][_0xd1e1('0x17')](_0x47af2c[_0xd1e1('0x18')],{'raw':_0x47af2c[_0xd1e1('0x19')]?_0x47af2c[_0xd1e1('0x19')][_0xd1e1('0x1a')]===undefined?!![]:![]:!![]})[_0xd1e1('0xc')](function(_0x5d310d){logger[_0xd1e1('0xd')](_0xd1e1('0x16'),_0x47af2c);logger[_0xd1e1('0x10')](_0xd1e1('0x16'),_0x47af2c,JSON[_0xd1e1('0x1b')](_0x5d310d));_0x103300(_0x5d310d);})[_0xd1e1('0x15')](function(_0x2701e3){logger[_0xd1e1('0x11')](_0xd1e1('0x16'),_0x2701e3[_0xd1e1('0x13')],_0x47af2c);_0x305805(_0x384f88[_0xd1e1('0x11')](0x1f4,_0x2701e3['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xa7ef77){var _0x488cbe=this;return new Promise(function(_0x570434,_0x351436){return db[_0xd1e1('0x1c')][_0xd1e1('0x1d')](_0xa7ef77[_0xd1e1('0x18')],{'raw':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77['options'][_0xd1e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x1e')]||null:null,'attributes':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x1f')]||null:null,'limit':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x20')]||null:null})[_0xd1e1('0xc')](function(_0x47d2b4){logger[_0xd1e1('0xd')]('UpdateWhatsappQueueReport',_0xa7ef77);logger[_0xd1e1('0x10')](_0xd1e1('0x21'),_0xa7ef77,JSON[_0xd1e1('0x1b')](_0x47d2b4));_0x570434(_0x47d2b4);})[_0xd1e1('0x15')](function(_0x30145b){logger[_0xd1e1('0x11')](_0xd1e1('0x21'),_0x30145b[_0xd1e1('0x13')],_0xa7ef77);_0x351436(_0x488cbe[_0xd1e1('0x11')](0x1f4,_0x30145b[_0xd1e1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 0442820..652ffc0 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 _0x25d9=['./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x44de8e,_0x5eb643){var _0x2df66e=function(_0x19b1ef){while(--_0x19b1ef){_0x44de8e['push'](_0x44de8e['shift']());}};_0x2df66e(++_0x5eb643);}(_0x25d9,0xd3));var _0x925d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x25d9[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x925d('0x0'));var util=require('util');var path=require(_0x925d('0x1'));var timeout=require(_0x925d('0x2'));var express=require('express');var router=express[_0x925d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x925d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x925d('0x5'));router[_0x925d('0x6')]('/',auth[_0x925d('0x7')](),controller[_0x925d('0x8')]);router[_0x925d('0x6')](_0x925d('0x9'),auth[_0x925d('0x7')](),controller['describe']);router[_0x925d('0x6')]('/:id',auth[_0x925d('0x7')](),controller[_0x925d('0xa')]);router[_0x925d('0xb')]('/',auth[_0x925d('0x7')](),controller[_0x925d('0xc')]);router['put'](_0x925d('0xd'),auth[_0x925d('0x7')](),controller[_0x925d('0xe')]);router[_0x925d('0xf')](_0x925d('0xd'),auth[_0x925d('0x7')](),controller[_0x925d('0x10')]);module[_0x925d('0x11')]=router; \ No newline at end of file +var _0x112e=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','/describe','describe','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x50368e,_0x5b09f1){var _0x36c76e=function(_0x32959b){while(--_0x32959b){_0x50368e['push'](_0x50368e['shift']());}};_0x36c76e(++_0x5b09f1);}(_0x112e,0x180));var _0xe112=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x112e[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0xe112('0x0'));var util=require(_0xe112('0x1'));var path=require(_0xe112('0x2'));var timeout=require('connect-timeout');var express=require(_0xe112('0x3'));var router=express[_0xe112('0x4')]();var fs_extra=require(_0xe112('0x5'));var auth=require(_0xe112('0x6'));var interaction=require(_0xe112('0x7'));var config=require(_0xe112('0x8'));var controller=require(_0xe112('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe112('0xa')]);router['get'](_0xe112('0xb'),auth['isAuthenticated'](),controller[_0xe112('0xc')]);router[_0xe112('0xd')](_0xe112('0xe'),auth[_0xe112('0xf')](),controller[_0xe112('0x10')]);router['post']('/',auth[_0xe112('0xf')](),controller[_0xe112('0x11')]);router[_0xe112('0x12')](_0xe112('0xe'),auth[_0xe112('0xf')](),controller[_0xe112('0x13')]);router[_0xe112('0x14')]('/:id',auth[_0xe112('0xf')](),controller[_0xe112('0x15')]);module[_0xe112('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 47d4559..5a31110 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 _0xf79e=['STRING','ENUM','agent','queue','exports'];(function(_0x28f328,_0x4d089){var _0x2d67a6=function(_0x33ba06){while(--_0x33ba06){_0x28f328['push'](_0x28f328['shift']());}};_0x2d67a6(++_0x4d089);}(_0xf79e,0x185));var _0xef79=function(_0x32e39f,_0x4d6c6c){_0x32e39f=_0x32e39f-0x0;var _0x579277=_0xf79e[_0x32e39f];return _0x579277;};'use strict';var Sequelize=require('sequelize');module[_0xef79('0x0')]={'uniqueid':{'type':Sequelize[_0xef79('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xef79('0x2')]('account',_0xef79('0x3'),_0xef79('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x0c71=['ENUM','account','agent','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0c71,0xfb));var _0x10c7=function(_0xe3daba,_0x584f33){_0xe3daba=_0xe3daba-0x0;var _0xc26766=_0x0c71[_0xe3daba];return _0xc26766;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x10c7('0x1')](_0x10c7('0x2'),_0x10c7('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2e13203..2cd4582 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 _0x8104=['../../components/auth/service','../../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','reject','save','update','then','error','name','send','map','WhatsappTransferReport','fieldName','type','model','keys','query','filters','intersection','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','length','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x4684e2,_0x49458c){var _0x2ee1ff=function(_0x5b40de){while(--_0x5b40de){_0x4684e2['push'](_0x4684e2['shift']());}};_0x2ee1ff(++_0x49458c);}(_0x8104,0x84));var _0x4810=function(_0x132fec,_0x565370){_0x132fec=_0x132fec-0x0;var _0x205b4e=_0x8104[_0x132fec];return _0x205b4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4810('0x0'));var zipdir=require(_0x4810('0x1'));var jsonpatch=require(_0x4810('0x2'));var rp=require(_0x4810('0x3'));var moment=require('moment');var BPromise=require(_0x4810('0x4'));var Mustache=require('mustache');var util=require(_0x4810('0x5'));var path=require(_0x4810('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4810('0x7'));var fs=require('fs');var fs_extra=require(_0x4810('0x8'));var _=require(_0x4810('0x9'));var squel=require(_0x4810('0xa'));var crypto=require('crypto');var jsforce=require(_0x4810('0xb'));var deskjs=require(_0x4810('0xc'));var toCsv=require(_0x4810('0xd'));var querystring=require(_0x4810('0xe'));var Papa=require('papaparse');var Redis=require(_0x4810('0xf'));var authService=require(_0x4810('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4810('0x11'));var hardwareService=require(_0x4810('0x12'));var logger=require(_0x4810('0x13'))(_0x4810('0x14'));var utils=require(_0x4810('0x15'));var config=require(_0x4810('0x16'));var licenseUtil=require(_0x4810('0x17'));var db=require(_0x4810('0x18'))['db'];function respondWithStatusCode(_0x17ca7f,_0x558444){_0x558444=_0x558444||0xcc;return function(_0xe2aef6){if(_0xe2aef6){return _0x17ca7f[_0x4810('0x19')](_0x558444);}return _0x17ca7f[_0x4810('0x1a')](_0x558444)[_0x4810('0x1b')]();};}function respondWithResult(_0x1fd840,_0x505917){_0x505917=_0x505917||0xc8;return function(_0x55d43e){if(_0x55d43e){return _0x1fd840[_0x4810('0x1a')](_0x505917)[_0x4810('0x1c')](_0x55d43e);}};}function respondWithFilteredResult(_0xf245a3,_0x3c7667){return function(_0x58993c){if(_0x58993c){var _0x262023=typeof _0x3c7667['offset']===_0x4810('0x1d')&&typeof _0x3c7667[_0x4810('0x1e')]===_0x4810('0x1d');var _0x5012f5=_0x58993c[_0x4810('0x1f')];var _0x3f98c3=_0x262023?0x0:_0x3c7667[_0x4810('0x20')];var _0x3275f0=_0x262023?_0x58993c['count']:_0x3c7667[_0x4810('0x20')]+_0x3c7667[_0x4810('0x1e')];var _0x328df7;if(_0x3275f0>=_0x5012f5){_0x3275f0=_0x5012f5;_0x328df7=0xc8;}else{_0x328df7=0xce;}_0xf245a3['status'](_0x328df7);return _0xf245a3['set'](_0x4810('0x21'),_0x3f98c3+'-'+_0x3275f0+'/'+_0x5012f5)['json'](_0x58993c);}return null;};}function patchUpdates(_0x2b1e00){return function(_0x2bd35a){try{jsonpatch['apply'](_0x2bd35a,_0x2b1e00,!![]);}catch(_0x22bc7d){return BPromise[_0x4810('0x22')](_0x22bc7d);}return _0x2bd35a[_0x4810('0x23')]();};}function saveUpdates(_0x51cf52,_0x118b63){return function(_0xa24806){if(_0xa24806){return _0xa24806[_0x4810('0x24')](_0x51cf52)[_0x4810('0x25')](function(_0x239a7a){return _0x239a7a;});}return null;};}function removeEntity(_0x49b5e3,_0x733b3a){return function(_0x5135b9){if(_0x5135b9){return _0x5135b9['destroy']()[_0x4810('0x25')](function(){_0x49b5e3[_0x4810('0x1a')](0xcc)[_0x4810('0x1b')]();});}};}function handleEntityNotFound(_0xb76a40,_0x3297db){return function(_0x51d3be){if(!_0x51d3be){_0xb76a40['sendStatus'](0x194);}return _0x51d3be;};}function handleError(_0xe468e2,_0x21a499){_0x21a499=_0x21a499||0x1f4;return function(_0x610c65){logger[_0x4810('0x26')](_0x610c65['stack']);if(_0x610c65[_0x4810('0x27')]){delete _0x610c65[_0x4810('0x27')];}_0xe468e2[_0x4810('0x1a')](_0x21a499)[_0x4810('0x28')](_0x610c65);};}exports['index']=function(_0x114264,_0x2aabeb){var _0x1878c7={},_0x5c883d={},_0x14f48d={'count':0x0,'rows':[]};var _0x401bb3=_[_0x4810('0x29')](db[_0x4810('0x2a')]['rawAttributes'],function(_0x18e1a9){return{'name':_0x18e1a9[_0x4810('0x2b')],'type':_0x18e1a9[_0x4810('0x2c')]['key']};});_0x5c883d[_0x4810('0x2d')]=_[_0x4810('0x29')](_0x401bb3,_0x4810('0x27'));_0x5c883d['query']=_[_0x4810('0x2e')](_0x114264[_0x4810('0x2f')]);_0x5c883d[_0x4810('0x30')]=_[_0x4810('0x31')](_0x5c883d['model'],_0x5c883d[_0x4810('0x2f')]);_0x1878c7[_0x4810('0x32')]=_[_0x4810('0x31')](_0x5c883d[_0x4810('0x2d')],qs['fields'](_0x114264[_0x4810('0x2f')]['fields']));_0x1878c7[_0x4810('0x32')]=_0x1878c7[_0x4810('0x32')]['length']?_0x1878c7[_0x4810('0x32')]:_0x5c883d[_0x4810('0x2d')];if(!_0x114264[_0x4810('0x2f')]['hasOwnProperty'](_0x4810('0x33'))){_0x1878c7[_0x4810('0x1e')]=qs['limit'](_0x114264[_0x4810('0x2f')]['limit']);_0x1878c7[_0x4810('0x20')]=qs[_0x4810('0x20')](_0x114264['query'][_0x4810('0x20')]);}_0x1878c7[_0x4810('0x34')]=qs['sort'](_0x114264[_0x4810('0x2f')]['sort']);_0x1878c7[_0x4810('0x35')]=qs[_0x4810('0x30')](_[_0x4810('0x36')](_0x114264[_0x4810('0x2f')],_0x5c883d['filters']),_0x401bb3);if(_0x114264[_0x4810('0x2f')][_0x4810('0x37')]){_0x1878c7[_0x4810('0x35')]=_[_0x4810('0x38')](_0x1878c7['where'],{'$or':_['map'](_0x401bb3,function(_0x2b58f3){if(_0x2b58f3[_0x4810('0x2c')]!==_0x4810('0x39')){var _0x1a5907={};_0x1a5907[_0x2b58f3[_0x4810('0x27')]]={'$like':'%'+_0x114264[_0x4810('0x2f')][_0x4810('0x37')]+'%'};return _0x1a5907;}})});}_0x1878c7=_['merge']({},_0x1878c7,_0x114264[_0x4810('0x3a')]);var _0x466bb8={'where':_0x1878c7['where']};return db[_0x4810('0x2a')][_0x4810('0x1f')](_0x466bb8)[_0x4810('0x25')](function(_0x49659c){_0x14f48d[_0x4810('0x1f')]=_0x49659c;if(_0x114264[_0x4810('0x2f')][_0x4810('0x3b')]){_0x1878c7[_0x4810('0x3c')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x4810('0x3d')](_0x1878c7);})['then'](function(_0x3c1458){_0x14f48d[_0x4810('0x3e')]=_0x3c1458;return _0x14f48d;})['then'](respondWithFilteredResult(_0x2aabeb,_0x1878c7))[_0x4810('0x3f')](handleError(_0x2aabeb,null));};exports[_0x4810('0x40')]=function(_0x4c342f,_0x474436){var _0x4ebacc={'raw':!![],'where':{'id':_0x4c342f[_0x4810('0x41')]['id']}},_0x49285a={};_0x49285a['model']=_['keys'](db[_0x4810('0x2a')][_0x4810('0x42')]);_0x49285a['query']=_[_0x4810('0x2e')](_0x4c342f[_0x4810('0x2f')]);_0x49285a[_0x4810('0x30')]=_['intersection'](_0x49285a[_0x4810('0x2d')],_0x49285a['query']);_0x4ebacc[_0x4810('0x32')]=_[_0x4810('0x31')](_0x49285a[_0x4810('0x2d')],qs[_0x4810('0x43')](_0x4c342f[_0x4810('0x2f')]['fields']));_0x4ebacc[_0x4810('0x32')]=_0x4ebacc[_0x4810('0x32')][_0x4810('0x44')]?_0x4ebacc[_0x4810('0x32')]:_0x49285a['model'];if(_0x4c342f[_0x4810('0x2f')]['includeAll']){_0x4ebacc[_0x4810('0x3c')]=[{'all':!![]}];}_0x4ebacc=_['merge']({},_0x4ebacc,_0x4c342f[_0x4810('0x3a')]);return db[_0x4810('0x2a')]['find'](_0x4ebacc)[_0x4810('0x25')](handleEntityNotFound(_0x474436,null))[_0x4810('0x25')](respondWithResult(_0x474436,null))[_0x4810('0x3f')](handleError(_0x474436,null));};exports['create']=function(_0x273272,_0x311fd8){return db['WhatsappTransferReport'][_0x4810('0x45')](_0x273272[_0x4810('0x46')],{})['then'](respondWithResult(_0x311fd8,0xc9))[_0x4810('0x3f')](handleError(_0x311fd8,null));};exports[_0x4810('0x24')]=function(_0x522c1c,_0x4a4e32){if(_0x522c1c[_0x4810('0x46')]['id']){delete _0x522c1c[_0x4810('0x46')]['id'];}return db[_0x4810('0x2a')]['find']({'where':{'id':_0x522c1c[_0x4810('0x41')]['id']}})[_0x4810('0x25')](handleEntityNotFound(_0x4a4e32,null))[_0x4810('0x25')](saveUpdates(_0x522c1c[_0x4810('0x46')],null))[_0x4810('0x25')](respondWithResult(_0x4a4e32,null))['catch'](handleError(_0x4a4e32,null));};exports[_0x4810('0x47')]=function(_0x5ced28,_0xace94d){return db['WhatsappTransferReport'][_0x4810('0x48')]({'where':{'id':_0x5ced28[_0x4810('0x41')]['id']}})[_0x4810('0x25')](handleEntityNotFound(_0xace94d,null))[_0x4810('0x25')](removeEntity(_0xace94d,null))[_0x4810('0x3f')](handleError(_0xace94d,null));};exports[_0x4810('0x49')]=function(_0x561bc3,_0x29a819){return db[_0x4810('0x2a')][_0x4810('0x49')]()[_0x4810('0x25')](respondWithResult(_0x29a819,null))[_0x4810('0x3f')](handleError(_0x29a819,null));}; \ No newline at end of file +var _0x0648=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','options','includeAll','include','WhatsappTransferReport','rows','catch','rawAttributes','find','body','update','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0x0648,0x1a5));var _0x8064=function(_0x2e3e74,_0x37a85c){_0x2e3e74=_0x2e3e74-0x0;var _0x1a3156=_0x0648[_0x2e3e74];return _0x1a3156;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8064('0x0'));var jsonpatch=require(_0x8064('0x1'));var rp=require(_0x8064('0x2'));var moment=require('moment');var BPromise=require(_0x8064('0x3'));var Mustache=require('mustache');var util=require(_0x8064('0x4'));var path=require(_0x8064('0x5'));var sox=require(_0x8064('0x6'));var csv=require(_0x8064('0x7'));var ejs=require(_0x8064('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8064('0x9'));var squel=require(_0x8064('0xa'));var crypto=require(_0x8064('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8064('0xc'));var toCsv=require(_0x8064('0x7'));var querystring=require('querystring');var Papa=require(_0x8064('0xd'));var Redis=require(_0x8064('0xe'));var authService=require(_0x8064('0xf'));var qs=require(_0x8064('0x10'));var as=require(_0x8064('0x11'));var hardwareService=require(_0x8064('0x12'));var logger=require(_0x8064('0x13'))(_0x8064('0x14'));var utils=require(_0x8064('0x15'));var config=require(_0x8064('0x16'));var licenseUtil=require(_0x8064('0x17'));var db=require(_0x8064('0x18'))['db'];function respondWithStatusCode(_0x18fa74,_0x33b7f7){_0x33b7f7=_0x33b7f7||0xcc;return function(_0x162e1f){if(_0x162e1f){return _0x18fa74[_0x8064('0x19')](_0x33b7f7);}return _0x18fa74['status'](_0x33b7f7)['end']();};}function respondWithResult(_0x487cff,_0x5e2ff0){_0x5e2ff0=_0x5e2ff0||0xc8;return function(_0x13c799){if(_0x13c799){return _0x487cff['status'](_0x5e2ff0)[_0x8064('0x1a')](_0x13c799);}};}function respondWithFilteredResult(_0x9ab5c4,_0xb55bc8){return function(_0x1e5054){if(_0x1e5054){var _0x5ee9a5=typeof _0xb55bc8[_0x8064('0x1b')]===_0x8064('0x1c')&&typeof _0xb55bc8[_0x8064('0x1d')]===_0x8064('0x1c');var _0x33b1e0=_0x1e5054[_0x8064('0x1e')];var _0x245e27=_0x5ee9a5?0x0:_0xb55bc8[_0x8064('0x1b')];var _0x1e9eea=_0x5ee9a5?_0x1e5054[_0x8064('0x1e')]:_0xb55bc8['offset']+_0xb55bc8[_0x8064('0x1d')];var _0x54324d;if(_0x1e9eea>=_0x33b1e0){_0x1e9eea=_0x33b1e0;_0x54324d=0xc8;}else{_0x54324d=0xce;}_0x9ab5c4[_0x8064('0x1f')](_0x54324d);return _0x9ab5c4[_0x8064('0x20')](_0x8064('0x21'),_0x245e27+'-'+_0x1e9eea+'/'+_0x33b1e0)['json'](_0x1e5054);}return null;};}function patchUpdates(_0x2ec89d){return function(_0x1e02c4){try{jsonpatch[_0x8064('0x22')](_0x1e02c4,_0x2ec89d,!![]);}catch(_0x29ffac){return BPromise[_0x8064('0x23')](_0x29ffac);}return _0x1e02c4['save']();};}function saveUpdates(_0xfb97d0,_0x2f9f7f){return function(_0x7549e4){if(_0x7549e4){return _0x7549e4['update'](_0xfb97d0)[_0x8064('0x24')](function(_0x316b46){return _0x316b46;});}return null;};}function removeEntity(_0x1b2d92,_0x53a811){return function(_0x20ce5b){if(_0x20ce5b){return _0x20ce5b[_0x8064('0x25')]()[_0x8064('0x24')](function(){_0x1b2d92[_0x8064('0x1f')](0xcc)[_0x8064('0x26')]();});}};}function handleEntityNotFound(_0x7f1866,_0x4755bd){return function(_0x2420d1){if(!_0x2420d1){_0x7f1866['sendStatus'](0x194);}return _0x2420d1;};}function handleError(_0x5610bf,_0x45f65c){_0x45f65c=_0x45f65c||0x1f4;return function(_0xaf0f95){logger[_0x8064('0x27')](_0xaf0f95[_0x8064('0x28')]);if(_0xaf0f95['name']){delete _0xaf0f95[_0x8064('0x29')];}_0x5610bf[_0x8064('0x1f')](_0x45f65c)[_0x8064('0x2a')](_0xaf0f95);};}exports['index']=function(_0x450812,_0x1c0ba8){var _0x28c05d={},_0x53bdb5={},_0x5e8cbb={'count':0x0,'rows':[]};var _0x5bea7d=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x4b585f){return{'name':_0x4b585f['fieldName'],'type':_0x4b585f[_0x8064('0x2b')]['key']};});_0x53bdb5[_0x8064('0x2c')]=_['map'](_0x5bea7d,_0x8064('0x29'));_0x53bdb5[_0x8064('0x2d')]=_[_0x8064('0x2e')](_0x450812['query']);_0x53bdb5[_0x8064('0x2f')]=_[_0x8064('0x30')](_0x53bdb5['model'],_0x53bdb5[_0x8064('0x2d')]);_0x28c05d[_0x8064('0x31')]=_[_0x8064('0x30')](_0x53bdb5[_0x8064('0x2c')],qs[_0x8064('0x32')](_0x450812[_0x8064('0x2d')][_0x8064('0x32')]));_0x28c05d[_0x8064('0x31')]=_0x28c05d[_0x8064('0x31')][_0x8064('0x33')]?_0x28c05d['attributes']:_0x53bdb5[_0x8064('0x2c')];if(!_0x450812[_0x8064('0x2d')][_0x8064('0x34')](_0x8064('0x35'))){_0x28c05d[_0x8064('0x1d')]=qs[_0x8064('0x1d')](_0x450812['query']['limit']);_0x28c05d[_0x8064('0x1b')]=qs[_0x8064('0x1b')](_0x450812[_0x8064('0x2d')]['offset']);}_0x28c05d[_0x8064('0x36')]=qs['sort'](_0x450812['query'][_0x8064('0x37')]);_0x28c05d['where']=qs[_0x8064('0x2f')](_[_0x8064('0x38')](_0x450812['query'],_0x53bdb5[_0x8064('0x2f')]),_0x5bea7d);if(_0x450812['query']['filter']){_0x28c05d[_0x8064('0x39')]=_[_0x8064('0x3a')](_0x28c05d[_0x8064('0x39')],{'$or':_[_0x8064('0x3b')](_0x5bea7d,function(_0x571347){if(_0x571347[_0x8064('0x2b')]!==_0x8064('0x3c')){var _0x147427={};_0x147427[_0x571347[_0x8064('0x29')]]={'$like':'%'+_0x450812[_0x8064('0x2d')]['filter']+'%'};return _0x147427;}})});}_0x28c05d=_['merge']({},_0x28c05d,_0x450812[_0x8064('0x3d')]);var _0x2cdc2d={'where':_0x28c05d[_0x8064('0x39')]};return db['WhatsappTransferReport'][_0x8064('0x1e')](_0x2cdc2d)['then'](function(_0x58d0d0){_0x5e8cbb[_0x8064('0x1e')]=_0x58d0d0;if(_0x450812['query'][_0x8064('0x3e')]){_0x28c05d[_0x8064('0x3f')]=[{'all':!![]}];}return db[_0x8064('0x40')]['findAll'](_0x28c05d);})[_0x8064('0x24')](function(_0x1289c0){_0x5e8cbb[_0x8064('0x41')]=_0x1289c0;return _0x5e8cbb;})[_0x8064('0x24')](respondWithFilteredResult(_0x1c0ba8,_0x28c05d))[_0x8064('0x42')](handleError(_0x1c0ba8,null));};exports['show']=function(_0x4442ba,_0x546b6b){var _0x24c364={'raw':!![],'where':{'id':_0x4442ba['params']['id']}},_0x2bf217={};_0x2bf217[_0x8064('0x2c')]=_['keys'](db[_0x8064('0x40')][_0x8064('0x43')]);_0x2bf217['query']=_[_0x8064('0x2e')](_0x4442ba[_0x8064('0x2d')]);_0x2bf217['filters']=_[_0x8064('0x30')](_0x2bf217['model'],_0x2bf217['query']);_0x24c364[_0x8064('0x31')]=_[_0x8064('0x30')](_0x2bf217[_0x8064('0x2c')],qs[_0x8064('0x32')](_0x4442ba[_0x8064('0x2d')]['fields']));_0x24c364[_0x8064('0x31')]=_0x24c364['attributes']['length']?_0x24c364[_0x8064('0x31')]:_0x2bf217[_0x8064('0x2c')];if(_0x4442ba[_0x8064('0x2d')][_0x8064('0x3e')]){_0x24c364[_0x8064('0x3f')]=[{'all':!![]}];}_0x24c364=_[_0x8064('0x3a')]({},_0x24c364,_0x4442ba[_0x8064('0x3d')]);return db['WhatsappTransferReport'][_0x8064('0x44')](_0x24c364)[_0x8064('0x24')](handleEntityNotFound(_0x546b6b,null))[_0x8064('0x24')](respondWithResult(_0x546b6b,null))[_0x8064('0x42')](handleError(_0x546b6b,null));};exports['create']=function(_0x552bca,_0x23afd8){return db[_0x8064('0x40')]['create'](_0x552bca[_0x8064('0x45')],{})[_0x8064('0x24')](respondWithResult(_0x23afd8,0xc9))[_0x8064('0x42')](handleError(_0x23afd8,null));};exports[_0x8064('0x46')]=function(_0x2d899a,_0x53f46e){if(_0x2d899a[_0x8064('0x45')]['id']){delete _0x2d899a[_0x8064('0x45')]['id'];}return db[_0x8064('0x40')][_0x8064('0x44')]({'where':{'id':_0x2d899a['params']['id']}})[_0x8064('0x24')](handleEntityNotFound(_0x53f46e,null))[_0x8064('0x24')](saveUpdates(_0x2d899a[_0x8064('0x45')],null))[_0x8064('0x24')](respondWithResult(_0x53f46e,null))[_0x8064('0x42')](handleError(_0x53f46e,null));};exports[_0x8064('0x25')]=function(_0x1fa383,_0x20d450){return db[_0x8064('0x40')][_0x8064('0x44')]({'where':{'id':_0x1fa383[_0x8064('0x47')]['id']}})[_0x8064('0x24')](handleEntityNotFound(_0x20d450,null))[_0x8064('0x24')](removeEntity(_0x20d450,null))[_0x8064('0x42')](handleError(_0x20d450,null));};exports[_0x8064('0x48')]=function(_0x2d1c50,_0x16a65a){return db[_0x8064('0x40')][_0x8064('0x48')]()[_0x8064('0x24')](respondWithResult(_0x16a65a,null))[_0x8064('0x42')](handleError(_0x16a65a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 02802ac..6c78a2c 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 _0xc7a6=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappTransferReport','uniqueid','lodash'];(function(_0x3e9da0,_0x3c2472){var _0x51fcb7=function(_0x249612){while(--_0x249612){_0x3e9da0['push'](_0x3e9da0['shift']());}};_0x51fcb7(++_0x3c2472);}(_0xc7a6,0x103));var _0x6c7a=function(_0x30fe0f,_0x558c65){_0x30fe0f=_0x30fe0f-0x0;var _0x4910c0=_0xc7a6[_0x30fe0f];return _0x4910c0;};'use strict';var _=require(_0x6c7a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c7a('0x1'));var moment=require(_0x6c7a('0x2'));var BPromise=require(_0x6c7a('0x3'));var rp=require(_0x6c7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c7a('0x5'));var config=require(_0x6c7a('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x3840e2,_0x3a5f16){return _0x3840e2[_0x6c7a('0x7')](_0x6c7a('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x6c7a('0x9'),'fields':[_0x6c7a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d1e=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x2d1e,0xcc));var _0xe2d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2d1e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe2d1('0x0'));var util=require(_0xe2d1('0x1'));var logger=require(_0xe2d1('0x2'))(_0xe2d1('0x3'));var moment=require(_0xe2d1('0x4'));var BPromise=require(_0xe2d1('0x5'));var rp=require(_0xe2d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2d1('0x7'));var config=require(_0xe2d1('0x8'));var attributes=require(_0xe2d1('0x9'));module[_0xe2d1('0xa')]=function(_0x4f38ba,_0x5b2f80){return _0x4f38ba['define']('WhatsappTransferReport',attributes,{'tableName':_0xe2d1('0xb'),'paranoid':![],'indexes':[{'name':_0xe2d1('0xc'),'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 6d5e716..38b5316 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 _0xb260=['code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xb260,0xb7));var _0x0b26=function(_0x432324,_0x3e5677){_0x432324=_0x432324-0x0;var _0x2b2267=_0xb260[_0x432324];return _0x2b2267;};'use strict';var _=require(_0x0b26('0x0'));var util=require(_0x0b26('0x1'));var moment=require(_0x0b26('0x2'));var BPromise=require(_0x0b26('0x3'));var rs=require(_0x0b26('0x4'));var fs=require('fs');var Redis=require(_0x0b26('0x5'));var db=require(_0x0b26('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b26('0x7'))(_0x0b26('0x8'));var config=require('../../config/environment');var jayson=require(_0x0b26('0x9'));var client=jayson[_0x0b26('0xa')][_0x0b26('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398ed3,_0x5522ca,_0x22aec7){return new BPromise(function(_0xdeb92f,_0x4a927f){return client['request'](_0x398ed3,_0x22aec7)['then'](function(_0x21a233){logger['info'](_0x0b26('0xc'),_0x5522ca,'request\x20sent');logger[_0x0b26('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5522ca,_0x0b26('0xe'),JSON[_0x0b26('0xf')](_0x21a233));if(_0x21a233[_0x0b26('0x10')]){if(_0x21a233[_0x0b26('0x10')][_0x0b26('0x11')]===0x1f4){logger['error'](_0x0b26('0xc'),_0x5522ca,_0x21a233[_0x0b26('0x10')][_0x0b26('0x12')]);return _0x4a927f(_0x21a233[_0x0b26('0x10')]['message']);}logger['error'](_0x0b26('0xc'),_0x5522ca,_0x21a233['error']['message']);return _0xdeb92f(_0x21a233[_0x0b26('0x10')][_0x0b26('0x12')]);}else{logger[_0x0b26('0x13')](_0x0b26('0xc'),_0x5522ca,_0x0b26('0xe'));_0xdeb92f(_0x21a233['result'][_0x0b26('0x12')]);}})['catch'](function(_0x40a2b1){logger[_0x0b26('0x10')](_0x0b26('0xc'),_0x5522ca,_0x40a2b1);_0x4a927f(_0x40a2b1);});});} \ No newline at end of file +var _0x0875=['rpc','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x14a8bc,_0x23b0ac){var _0x54fe72=function(_0x3587a4){while(--_0x3587a4){_0x14a8bc['push'](_0x14a8bc['shift']());}};_0x54fe72(++_0x23b0ac);}(_0x0875,0x18b));var _0x5087=function(_0x3e6a03,_0x38bb42){_0x3e6a03=_0x3e6a03-0x0;var _0x2b3ce2=_0x0875[_0x3e6a03];return _0x2b3ce2;};'use strict';var _=require(_0x5087('0x0'));var util=require(_0x5087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5087('0x2'));var fs=require('fs');var Redis=require(_0x5087('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5087('0x4'))(_0x5087('0x5'));var config=require('../../config/environment');var jayson=require(_0x5087('0x6'));var client=jayson[_0x5087('0x7')][_0x5087('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1072ba,_0x3e2dfe,_0x36f4fb){return new BPromise(function(_0x282199,_0x2d51cc){return client[_0x5087('0x9')](_0x1072ba,_0x36f4fb)[_0x5087('0xa')](function(_0x3e9705){logger['info'](_0x5087('0xb'),_0x3e2dfe,_0x5087('0xc'));logger['debug'](_0x5087('0xd'),_0x3e2dfe,'request\x20sent',JSON[_0x5087('0xe')](_0x3e9705));if(_0x3e9705[_0x5087('0xf')]){if(_0x3e9705[_0x5087('0xf')][_0x5087('0x10')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3e2dfe,_0x3e9705[_0x5087('0xf')]['message']);return _0x2d51cc(_0x3e9705['error'][_0x5087('0x11')]);}logger[_0x5087('0xf')](_0x5087('0xb'),_0x3e2dfe,_0x3e9705[_0x5087('0xf')][_0x5087('0x11')]);return _0x282199(_0x3e9705[_0x5087('0xf')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x3e2dfe,_0x5087('0xc'));_0x282199(_0x3e9705[_0x5087('0x12')][_0x5087('0x11')]);}})[_0x5087('0x13')](function(_0x491e1f){logger['error'](_0x5087('0xb'),_0x3e2dfe,_0x491e1f);_0x2d51cc(_0x491e1f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d4dba01..9d900f6 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42cf=['Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','./config/seedDB','default','./config/license','catch','exit','lodash','./rpc','./config/environment','./config/pm2','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x42cf,0x1e2));var _0xf42c=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x42cf[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xf42c('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xf42c('0x1'));var config=require(_0xf42c('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0xf42c('0x3'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xf42c('0x4'));var chat=require(_0xf42c('0x5'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xf42c('0x6')][_0xf42c('0x7')]()[_0xf42c('0x8')](function(){return rpc[_0xf42c('0x9')]();})['then'](function(_0x17c92f){logger[_0xf42c('0xa')](_0x17c92f);return chat['start']();})['then'](function(){return whatsapp[_0xf42c('0xb')]();})['then'](function(){return schedule[_0xf42c('0xb')]();})[_0xf42c('0x8')](function(){return transcribe[_0xf42c('0xb')]();})[_0xf42c('0x8')](function(_0x2a8fd4){logger[_0xf42c('0xa')](_0x2a8fd4);return pm2['start'](pm2Config);})[_0xf42c('0x8')](function(_0x8b13b6){logger[_0xf42c('0xa')](_0xf42c('0xc'),_[_0xf42c('0xd')](_[_0xf42c('0xe')](_0x8b13b6,{'status':_0xf42c('0xf')}),_0xf42c('0x10'))[_0xf42c('0x11')]());logger[_0xf42c('0xa')](_0xf42c('0x12'),_[_0xf42c('0xd')](_['filter'](_0x8b13b6,function(_0x457039){return _0x457039[_0xf42c('0x13')]!==_0xf42c('0xf');}),'name')['join']()||_0xf42c('0x14'));config['seedDB']&&require(_0xf42c('0x15'))[_0xf42c('0x16')]();require(_0xf42c('0x17'))[_0xf42c('0x16')]();})[_0xf42c('0x18')](function(_0x556251){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x556251);process[_0xf42c('0x19')](0x1);});}main(); \ No newline at end of file +var _0x4f42=['start','then','info','Online\x20apps:','map','online','name','join','Offline\x20apps:','filter','status','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen'];(function(_0x30b045,_0x5cea47){var _0x290a8b=function(_0x3997cd){while(--_0x3997cd){_0x30b045['push'](_0x30b045['shift']());}};_0x290a8b(++_0x5cea47);}(_0x4f42,0x193));var _0x24f4=function(_0xee72d6,_0x75bcd3){_0xee72d6=_0xee72d6-0x0;var _0x39b435=_0x4f42[_0xee72d6];return _0x39b435;};'use strict';var _=require(_0x24f4('0x0'));var mysqldb=require(_0x24f4('0x1'));var rpc=require(_0x24f4('0x2'));var config=require('./config/environment');var logger=require(_0x24f4('0x3'))(_0x24f4('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x24f4('0x5'));var schedule=require(_0x24f4('0x6'));var chat=require(_0x24f4('0x7'));var whatsapp=require(_0x24f4('0x8'));var transcribe=require(_0x24f4('0x9'));function main(){return mysqldb['db'][_0x24f4('0xa')][_0x24f4('0xb')]()['then'](function(){return rpc[_0x24f4('0xc')]();})['then'](function(_0x38755c){logger['info'](_0x38755c);return chat[_0x24f4('0xd')]();})['then'](function(){return whatsapp[_0x24f4('0xd')]();})['then'](function(){return schedule[_0x24f4('0xd')]();})[_0x24f4('0xe')](function(){return transcribe['start']();})[_0x24f4('0xe')](function(_0x1e64d5){logger[_0x24f4('0xf')](_0x1e64d5);return pm2[_0x24f4('0xd')](pm2Config);})['then'](function(_0x32e3d9){logger['info'](_0x24f4('0x10'),_[_0x24f4('0x11')](_['filter'](_0x32e3d9,{'status':_0x24f4('0x12')}),_0x24f4('0x13'))[_0x24f4('0x14')]());logger['info'](_0x24f4('0x15'),_['map'](_[_0x24f4('0x16')](_0x32e3d9,function(_0x37281f){return _0x37281f[_0x24f4('0x17')]!==_0x24f4('0x12');}),_0x24f4('0x13'))['join']()||'None');config[_0x24f4('0x18')]&&require(_0x24f4('0x19'))[_0x24f4('0x1a')]();require(_0x24f4('0x1b'))[_0x24f4('0x1a')]();})[_0x24f4('0x1c')](function(_0x15ca9f){logger[_0x24f4('0x1d')](_0x24f4('0x1e'),_0x15ca9f);process[_0x24f4('0x1f')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e9d5f97..b8255b2 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 _0x0f7f=['hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','secrets','fullname','name','internal','email','userpic','permissions','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','downloadVoiceRecordings','downloadAttachments','isAuthenticated','use','user','findOne','params','closed','then','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','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','decryptString','length','splice','encryptString','join','promisify','secret','session','payload','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f7f,0x81));var _0xf0f7=function(_0x45fdf1,_0x45ee3b){_0x45fdf1=_0x45fdf1-0x0;var _0x387b61=_0x0f7f[_0x45fdf1];return _0x387b61;};'use strict';var db=require(_0xf0f7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xf0f7('0x1'));var licenseUtil=require(_0xf0f7('0x2'));var encryptor=require(_0xf0f7('0x3'));var _=require(_0xf0f7('0x4'));var jwt=require(_0xf0f7('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xf0f7('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0xf0f7('0x7'));var BPromise=require(_0xf0f7('0x8'));var util=require(_0xf0f7('0x9'));var moment=require(_0xf0f7('0xa'));var validateJwt=expressJwt({'secret':config[_0xf0f7('0xb')]['session']});var userAttributes=['id','role',_0xf0f7('0xc'),_0xf0f7('0xd'),_0xf0f7('0xe'),_0xf0f7('0xf'),_0xf0f7('0x10'),_0xf0f7('0x11'),'md5secret','voicePause','chatPause',_0xf0f7('0x12'),_0xf0f7('0x13'),_0xf0f7('0x14'),_0xf0f7('0x15'),_0xf0f7('0x16'),_0xf0f7('0x17'),_0xf0f7('0x18'),_0xf0f7('0x19'),_0xf0f7('0x1a'),_0xf0f7('0x1b'),'passwordResetAt',_0xf0f7('0x1c'),_0xf0f7('0x1d'),_0xf0f7('0x1e'),_0xf0f7('0x1f'),_0xf0f7('0x20'),_0xf0f7('0x21'),_0xf0f7('0x22'),_0xf0f7('0x23'),'phoneBarPrefixRequired',_0xf0f7('0x24'),_0xf0f7('0x25'),_0xf0f7('0x26'),_0xf0f7('0x27'),_0xf0f7('0x28'),'privacyEnabled',_0xf0f7('0x29'),'wssPort',_0xf0f7('0x2a'),'downloadOmnichannelInteractions',_0xf0f7('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0xf0f7('0x2c')](!![])[_0xf0f7('0x2d')](function(_0x4afd6c,_0x4bf10a,_0x5dff5f){if(_0x4afd6c[_0xf0f7('0x2e')]){_0x5dff5f();}else{return db['ChatInteraction'][_0xf0f7('0x2f')]({'where':{'id':_0x4afd6c[_0xf0f7('0x30')]['id']},'attributes':['id',_0xf0f7('0x31'),'disposition'],'raw':!![]})[_0xf0f7('0x32')](function(_0x4c0f96){if(_0x4c0f96&&_0x4c0f96[_0xf0f7('0x31')]){return _0x4bf10a[_0xf0f7('0x33')](_0x4c0f96['disposition']===_0xf0f7('0x34')?0x195:0x193)[_0xf0f7('0x35')]({'message':_0x4c0f96[_0xf0f7('0x36')]===_0xf0f7('0x34')?_0xf0f7('0x37'):_0xf0f7('0x38')});}else{_0x5dff5f();}})[_0xf0f7('0x39')](function(_0x35137a){_0x5dff5f(_0x35137a);});}});};exports[_0xf0f7('0x2c')]=function isAuthenticated(_0x3fa6f1){return compose()['use'](function(_0x2a658a,_0x761a1d,_0x5577f8){var _0xceb228;if(_0x2a658a[_0xf0f7('0x3a')]['authorization']){if(_['startsWith'](_0x2a658a[_0xf0f7('0x3a')][_0xf0f7('0x3b')],_0xf0f7('0x3c'))){var _0x42a735=basicAuth(_0x2a658a);db['User']['find']({'where':{'name':_0x42a735[_0xf0f7('0xd')]}})['then'](function(_0x53aa92){if(!_0x53aa92||!_0x53aa92[_0xf0f7('0x3d')](_0x42a735[_0xf0f7('0x3e')])){return _0x761a1d[_0xf0f7('0x33')](0x191)[_0xf0f7('0x35')]({'message':_0xf0f7('0x3f')});}_0x2a658a[_0xf0f7('0x2e')]={'id':_0x53aa92['id']};_0x5577f8();})[_0xf0f7('0x39')](function(_0x1e5f7b){_0x5577f8(_0x1e5f7b);});}else if(_[_0xf0f7('0x40')](_0x2a658a[_0xf0f7('0x3a')][_0xf0f7('0x3b')],_0xf0f7('0x41'))){validateJwt(_0x2a658a,_0x761a1d,_0x5577f8);}else{if(_0x3fa6f1){_0x5577f8();}else{return _0x761a1d['status'](0x193)[_0xf0f7('0x35')]({'message':_0xf0f7('0x42')});}}}else if(_0x2a658a[_0xf0f7('0x43')][_0xf0f7('0x44')]){try{var _0x353153={'audience':hardwareConf[_0xf0f7('0x45')](),'issuer':hardwareConf[_0xf0f7('0x45')]()};verifyJwt(_0x2a658a['query'][_0xf0f7('0x44')],_0x353153)['then'](function(_0xd9030c){return db['User'][_0xf0f7('0x46')]({'where':{'id':_0xd9030c[_0xf0f7('0x47')]}})[_0xf0f7('0x32')](function(_0x51358c){_0xceb228=_0x51358c;return db['Setting'][_0xf0f7('0x2f')]({'where':{'id':0x1},'attributes':[_0xf0f7('0x48'),_0xf0f7('0x49')],'raw':!![]});})[_0xf0f7('0x32')](function(_0x54089f){if(!_0xceb228||!_[_0xf0f7('0x4a')](_0xceb228[_0xf0f7('0x4b')],_0xd9030c[_0xf0f7('0x4c')])){return _0x761a1d[_0xf0f7('0x33')](0x191)[_0xf0f7('0x35')]({'message':_0xf0f7('0x4d')});}if(_0xceb228['disabled']){return _0x761a1d[_0xf0f7('0x33')](0x191)['json']({'message':_0xf0f7('0x4e')});}if(_0xceb228[_0xf0f7('0x4f')]){if(_0x54089f['blockDuration']>0x0){if(moment(_0xceb228[_0xf0f7('0x50')])[_0xf0f7('0x51')](_0x54089f[_0xf0f7('0x49')],_0xf0f7('0x52'))>moment()){return _0x761a1d['status'](0x191)[_0xf0f7('0x35')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x761a1d[_0xf0f7('0x33')](0x191)[_0xf0f7('0x35')]({'message':_0xf0f7('0x4e')});}}_0x2a658a[_0xf0f7('0x2e')]={'id':_0xceb228['id']};_0x5577f8();});})[_0xf0f7('0x39')](function(){return _0x761a1d[_0xf0f7('0x33')](0x191)[_0xf0f7('0x35')]({'message':_0xf0f7('0x4e')});});}catch(_0xc72cfa){_0x5577f8(_0xc72cfa);}}else if(_0x3fa6f1){_0x5577f8();}else{return _0x761a1d['status'](0x193)[_0xf0f7('0x35')]({'message':_0xf0f7('0x42')});}})['use'](function(_0xf558cd,_0x520a04,_0x299ff4){if(_0xf558cd[_0xf0f7('0x2e')]){db['User'][_0xf0f7('0x46')]({'where':{'id':_0xf558cd[_0xf0f7('0x2e')]['id']},'attributes':userAttributes})[_0xf0f7('0x32')](function(_0x54f8b0){if(!_0x54f8b0){return _0x520a04[_0xf0f7('0x33')](0x194)[_0xf0f7('0x35')]({'message':_0xf0f7('0x53')});}_0xf558cd[_0xf0f7('0x2e')]=_0x54f8b0;_0x299ff4();})[_0xf0f7('0x39')](function(_0x3b58f4){_0x299ff4(_0x3b58f4);});}else if(_0x3fa6f1){_0x299ff4();}else{return _0x520a04['status'](0x194)[_0xf0f7('0x35')]({'message':_0xf0f7('0x54')});}});};exports[_0xf0f7('0x55')]=function canUpdate(){return compose()['use'](function(_0x22e08a,_0x1b57ba,_0x46aea4){return licenseUtil[_0xf0f7('0x56')]()['then'](function(_0x4098ca){if(_0x4098ca[_0xf0f7('0x57')]){_0x46aea4();}else{return _0x1b57ba[_0xf0f7('0x33')](0x193)[_0xf0f7('0x35')]({'message':_0xf0f7('0x58')});}})[_0xf0f7('0x39')](function(_0x2efb52){_0x46aea4(_0x2efb52);});});};exports[_0xf0f7('0x59')]=function(_0x54c86f,_0x4c2501,_0x336cd9){_0x54c86f[_0xf0f7('0x59')]=!![];return _0x336cd9();};exports[_0xf0f7('0x5a')]=function signToken(_0x478c70){return signJwt(_0x478c70);};exports[_0xf0f7('0x5b')]=function(_0x4cc65e,_0x35a152){if(!_0x4cc65e[_0xf0f7('0x2e')]){return _0x35a152['status'](0x194)['json']({'message':_0xf0f7('0x5c')});}var _0x4fea92={'payload':{'id':_0x4cc65e[_0xf0f7('0x2e')]['id'],'role':_0x4cc65e[_0xf0f7('0x2e')][_0xf0f7('0x5d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4fea92)[_0xf0f7('0x32')](function(_0x380365){_0x35a152[_0xf0f7('0x5e')](_0xf0f7('0x5f'),_0x380365);_0x35a152[_0xf0f7('0x60')](_0xf0f7('0x61'));})[_0xf0f7('0x39')](function(_0x3236c4){return _0x35a152[_0xf0f7('0x33')](0x1f4)[_0xf0f7('0x62')](_0x3236c4);});};exports[_0xf0f7('0x63')]=function(_0x54b865){if(_[_0xf0f7('0x64')](_0x54b865[_0xf0f7('0x4b')])||_[_0xf0f7('0x64')](_0x54b865['apiKeyIat'])){return null;}else{return createJwt(_0x54b865);}};exports['generateApiKey']=function(_0x1b432e){_0x1b432e['apiKeyNonce']=generateNonce();_0x1b432e[_0xf0f7('0x65')]=generateIssuedAt();return createJwt(_0x1b432e);};exports['regenerateApiKey']=function(_0x47ab66,_0x50eaab){var _0x5da152=_0x47ab66[_0xf0f7('0x43')][_0xf0f7('0x44')];if(_0x5da152){var _0x5aee5b={'nonce':_0x50eaab['apiKeyNonce'],'iat':_0x50eaab[_0xf0f7('0x65')],'audience':hardwareConf[_0xf0f7('0x45')](),'issuer':hardwareConf[_0xf0f7('0x45')]()};return verifyJwt(_0x5da152,_0x5aee5b)[_0xf0f7('0x32')](function(){return generateApiKey(_0x50eaab);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xf0f7('0x66')]=function(_0x3530bb){var _0x1cc156=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1cc156[_0xf0f7('0x67')](_0x3530bb))throw new db[(_0xf0f7('0x68'))][(_0xf0f7('0x69'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xf0f7('0x6a')]=function(_0x5c2817,_0x4d030b,_0x57ebbe){var _0x15e75a=encryptor['decryptString'](_0x4d030b)['split'](',');for(var _0x2d8753=0x0;_0x2d8753<_0x57ebbe;_0x2d8753++){if(!_0x15e75a[_0x2d8753])break;if(_0x5c2817['toLowerCase']()===_0x15e75a[_0x2d8753]['toLowerCase']()){var _0x1dcda9=util[_0xf0f7('0x6b')](_0xf0f7('0x6c'),_0x57ebbe);if(_0x57ebbe===0x1){_0x1dcda9=_0xf0f7('0x6d');}throw new db[(_0xf0f7('0x68'))][(_0xf0f7('0x69'))](_0x1dcda9);}}return;};exports[_0xf0f7('0x6e')]=function(_0x18fa56,_0x530702){var _0xacd45=_0x530702?encryptor[_0xf0f7('0x6f')](_0x530702)['split'](','):[];if(_0xacd45[_0xf0f7('0x70')]===0x5){_0xacd45[_0xf0f7('0x71')](-0x1,0x1);}_0xacd45['unshift'](_0x18fa56);return encryptor[_0xf0f7('0x72')](_0xacd45[_0xf0f7('0x73')](','));};function signJwt(_0x237be3){var _0x1e5b5b=BPromise[_0xf0f7('0x74')](jwt['sign'],{'context':jwt});var _0x1ba364=_0x237be3[_0xf0f7('0x75')]||config['secrets'][_0xf0f7('0x76')];return new BPromise(function(_0x46085b,_0x659716){_0x1e5b5b(_0x237be3[_0xf0f7('0x77')],_0x1ba364,_0x237be3['options'])[_0xf0f7('0x32')](function(_0xcf9a10){_0x46085b(_0xcf9a10);})[_0xf0f7('0x39')](function(_0x67f74b){_0x659716(_0x67f74b);});});}function verifyJwt(_0x25391d,_0xb03c33,_0x4f2ef7){var _0x15aa9f=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x20c565=_0x4f2ef7||config[_0xf0f7('0xb')][_0xf0f7('0x76')];return new BPromise(function(_0x2a7472,_0xdf8e63){_0x15aa9f(_0x25391d,_0x20c565,_0xb03c33)[_0xf0f7('0x32')](function(_0x1e507c){_0x2a7472(_0x1e507c);})[_0xf0f7('0x39')](function(_0x4975d8){_0xdf8e63(_0x4975d8);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf0f7('0x78')](_0xf0f7('0x79'));}function generateIssuedAt(){return Math[_0xf0f7('0x7a')](Date[_0xf0f7('0x7b')]()/0x3e8)[_0xf0f7('0x78')]();}function createJwt(_0x3bae35){var _0x253222={'payload':{'iat':_0x3bae35['apiKeyIat'],'nonce':_0x3bae35[_0xf0f7('0x4b')]},'options':{'algorithm':_0xf0f7('0x7c'),'subject':_0x3bae35['id'][_0xf0f7('0x78')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x253222)[_0xf0f7('0x32')](function(_0x4a66b4){return{'iat':_0x3bae35[_0xf0f7('0x65')],'nonce':_0x3bae35[_0xf0f7('0x4b')],'token':_0x4a66b4};});} \ No newline at end of file +var _0xb076=['phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','use','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.','headers','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','user','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','decryptString','splice','unshift','encryptString','join','sign','payload','options','promisify','verify','randomBytes','toString','floor','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xb076,0x15b));var _0x6b07=function(_0x23629f,_0x4b37fa){_0x23629f=_0x23629f-0x0;var _0x4d810a=_0xb076[_0x23629f];return _0x4d810a;};'use strict';var db=require(_0x6b07('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x6b07('0x1'));var licenseUtil=require(_0x6b07('0x2'));var encryptor=require(_0x6b07('0x3'));var _=require('lodash');var jwt=require(_0x6b07('0x4'));var expressJwt=require(_0x6b07('0x5'));var compose=require(_0x6b07('0x6'));var basicAuth=require(_0x6b07('0x7'));var crypto=require(_0x6b07('0x8'));var BPromise=require(_0x6b07('0x9'));var util=require(_0x6b07('0xa'));var moment=require(_0x6b07('0xb'));var validateJwt=expressJwt({'secret':config[_0x6b07('0xc')]['session']});var userAttributes=['id',_0x6b07('0xd'),_0x6b07('0xe'),'name',_0x6b07('0xf'),_0x6b07('0x10'),'userpic','permissions',_0x6b07('0x11'),_0x6b07('0x12'),_0x6b07('0x13'),'mailPause','faxPause','smsPause',_0x6b07('0x14'),_0x6b07('0x15'),_0x6b07('0x16'),'lastLoginAt',_0x6b07('0x17'),_0x6b07('0x18'),'allowmessenger',_0x6b07('0x19'),_0x6b07('0x1a'),'phoneBarAutoAnswer',_0x6b07('0x1b'),_0x6b07('0x1c'),_0x6b07('0x1d'),_0x6b07('0x1e'),_0x6b07('0x1f'),_0x6b07('0x20'),_0x6b07('0x21'),_0x6b07('0x22'),_0x6b07('0x23'),_0x6b07('0x24'),'interface',_0x6b07('0x25'),_0x6b07('0x26'),_0x6b07('0x27'),_0x6b07('0x28'),_0x6b07('0x29'),_0x6b07('0x2a'),_0x6b07('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0x6b07('0x2c')](!![])[_0x6b07('0x2d')](function(_0x3cc1d1,_0x1717a7,_0x1547f8){if(_0x3cc1d1['user']){_0x1547f8();}else{return db[_0x6b07('0x2e')][_0x6b07('0x2f')]({'where':{'id':_0x3cc1d1['params']['id']},'attributes':['id',_0x6b07('0x30'),_0x6b07('0x31')],'raw':!![]})[_0x6b07('0x32')](function(_0x3851a8){if(_0x3851a8&&_0x3851a8[_0x6b07('0x30')]){return _0x1717a7[_0x6b07('0x33')](_0x3851a8[_0x6b07('0x31')]===_0x6b07('0x34')?0x195:0x193)[_0x6b07('0x35')]({'message':_0x3851a8['disposition']===_0x6b07('0x34')?_0x6b07('0x36'):_0x6b07('0x37')});}else{_0x1547f8();}})[_0x6b07('0x38')](function(_0x1e4821){_0x1547f8(_0x1e4821);});}});};exports[_0x6b07('0x2c')]=function isAuthenticated(_0x53cf6c){return compose()['use'](function(_0x1d7d56,_0x1bf9ba,_0x5116fa){var _0x4de0af;if(_0x1d7d56['headers'][_0x6b07('0x39')]){if(_[_0x6b07('0x3a')](_0x1d7d56['headers'][_0x6b07('0x39')],_0x6b07('0x3b'))){var _0x18ffed=basicAuth(_0x1d7d56);db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'name':_0x18ffed[_0x6b07('0x3e')]}})[_0x6b07('0x32')](function(_0x381a15){if(!_0x381a15||!_0x381a15[_0x6b07('0x3f')](_0x18ffed[_0x6b07('0x40')])){return _0x1bf9ba['status'](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x41')});}_0x1d7d56['user']={'id':_0x381a15['id']};_0x5116fa();})[_0x6b07('0x38')](function(_0x5c1794){_0x5116fa(_0x5c1794);});}else if(_[_0x6b07('0x3a')](_0x1d7d56[_0x6b07('0x42')]['authorization'],_0x6b07('0x43'))){validateJwt(_0x1d7d56,_0x1bf9ba,_0x5116fa);}else{if(_0x53cf6c){_0x5116fa();}else{return _0x1bf9ba[_0x6b07('0x33')](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x44')});}}}else if(_0x1d7d56['query'][_0x6b07('0x45')]){try{var _0x3604e8={'audience':hardwareConf[_0x6b07('0x46')](),'issuer':hardwareConf[_0x6b07('0x46')]()};verifyJwt(_0x1d7d56[_0x6b07('0x47')]['apikey'],_0x3604e8)[_0x6b07('0x32')](function(_0x341926){return db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'id':_0x341926[_0x6b07('0x48')]}})[_0x6b07('0x32')](function(_0x252e7b){_0x4de0af=_0x252e7b;return db[_0x6b07('0x49')][_0x6b07('0x2f')]({'where':{'id':0x1},'attributes':[_0x6b07('0x4a'),_0x6b07('0x4b')],'raw':!![]});})[_0x6b07('0x32')](function(_0x361278){if(!_0x4de0af||!_[_0x6b07('0x4c')](_0x4de0af['apiKeyNonce'],_0x341926[_0x6b07('0x4d')])){return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4de0af[_0x6b07('0x4e')]){return _0x1bf9ba['status'](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}if(_0x4de0af[_0x6b07('0x50')]){if(_0x361278[_0x6b07('0x4b')]>0x0){if(moment(_0x4de0af[_0x6b07('0x51')])['add'](_0x361278[_0x6b07('0x4b')],_0x6b07('0x52'))>moment()){return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}}else{return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}}_0x1d7d56[_0x6b07('0x53')]={'id':_0x4de0af['id']};_0x5116fa();});})[_0x6b07('0x38')](function(){return _0x1bf9ba['status'](0x191)['json']({'message':_0x6b07('0x4f')});});}catch(_0x527a10){_0x5116fa(_0x527a10);}}else if(_0x53cf6c){_0x5116fa();}else{return _0x1bf9ba['status'](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x44')});}})[_0x6b07('0x2d')](function(_0x1cdec7,_0xb9310f,_0x15f7e0){if(_0x1cdec7[_0x6b07('0x53')]){db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'id':_0x1cdec7['user']['id']},'attributes':userAttributes})[_0x6b07('0x32')](function(_0x2e5e6b){if(!_0x2e5e6b){return _0xb9310f[_0x6b07('0x33')](0x194)[_0x6b07('0x35')]({'message':'User\x20not\x20found.'});}_0x1cdec7[_0x6b07('0x53')]=_0x2e5e6b;_0x15f7e0();})['catch'](function(_0x1aa64c){_0x15f7e0(_0x1aa64c);});}else if(_0x53cf6c){_0x15f7e0();}else{return _0xb9310f[_0x6b07('0x33')](0x194)[_0x6b07('0x35')]({'message':_0x6b07('0x54')});}});};exports[_0x6b07('0x55')]=function canUpdate(){return compose()[_0x6b07('0x2d')](function(_0xd4f9af,_0x2e61a2,_0x3e4976){return licenseUtil[_0x6b07('0x56')]()[_0x6b07('0x32')](function(_0x49dd80){if(_0x49dd80['update']){_0x3e4976();}else{return _0x2e61a2[_0x6b07('0x33')](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x57')});}})['catch'](function(_0x14b539){_0x3e4976(_0x14b539);});});};exports[_0x6b07('0x58')]=function(_0x344e9b,_0x106542,_0x30cb55){_0x344e9b[_0x6b07('0x58')]=!![];return _0x30cb55();};exports[_0x6b07('0x59')]=function signToken(_0x27efa2){return signJwt(_0x27efa2);};exports[_0x6b07('0x5a')]=function(_0x584f8d,_0x21f3c9){if(!_0x584f8d[_0x6b07('0x53')]){return _0x21f3c9['status'](0x194)[_0x6b07('0x35')]({'message':_0x6b07('0x5b')});}var _0x2e4d6a={'payload':{'id':_0x584f8d[_0x6b07('0x53')]['id'],'role':_0x584f8d[_0x6b07('0x53')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2e4d6a)['then'](function(_0x20fdf1){_0x21f3c9[_0x6b07('0x5c')]('motion.token',_0x20fdf1);_0x21f3c9[_0x6b07('0x5d')](_0x6b07('0x5e'));})[_0x6b07('0x38')](function(_0x78d3d1){return _0x21f3c9[_0x6b07('0x33')](0x1f4)[_0x6b07('0x5f')](_0x78d3d1);});};exports[_0x6b07('0x60')]=function(_0xe6fd06){if(_[_0x6b07('0x61')](_0xe6fd06[_0x6b07('0x62')])||_[_0x6b07('0x61')](_0xe6fd06[_0x6b07('0x63')])){return null;}else{return createJwt(_0xe6fd06);}};exports[_0x6b07('0x64')]=function(_0x292012){_0x292012[_0x6b07('0x62')]=generateNonce();_0x292012[_0x6b07('0x63')]=generateIssuedAt();return createJwt(_0x292012);};exports['regenerateApiKey']=function(_0x2f3be,_0x10202a){var _0x5a83aa=_0x2f3be[_0x6b07('0x47')][_0x6b07('0x45')];if(_0x5a83aa){var _0x4fe2e5={'nonce':_0x10202a[_0x6b07('0x62')],'iat':_0x10202a['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x6b07('0x46')]()};return verifyJwt(_0x5a83aa,_0x4fe2e5)['then'](function(){return generateApiKey(_0x10202a);});}else{throw{'message':_0x6b07('0x65')};}};exports[_0x6b07('0x66')]=function(_0x425a79){var _0x1288f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1288f8[_0x6b07('0x67')](_0x425a79))throw new db[(_0x6b07('0x68'))][(_0x6b07('0x69'))](_0x6b07('0x6a'));return;};exports[_0x6b07('0x6b')]=function(_0x492619,_0x4b42a2,_0x44c14a){var _0x4bb1f9=encryptor['decryptString'](_0x4b42a2)[_0x6b07('0x6c')](',');for(var _0x352808=0x0;_0x352808<_0x44c14a;_0x352808++){if(!_0x4bb1f9[_0x352808])break;if(_0x492619[_0x6b07('0x6d')]()===_0x4bb1f9[_0x352808][_0x6b07('0x6d')]()){var _0x5505ec=util[_0x6b07('0x6e')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x44c14a);if(_0x44c14a===0x1){_0x5505ec=_0x6b07('0x6f');}throw new db[(_0x6b07('0x68'))][(_0x6b07('0x69'))](_0x5505ec);}}return;};exports['updatePasswordsHistory']=function(_0xd5f743,_0x2a14a7){var _0xa5cf09=_0x2a14a7?encryptor[_0x6b07('0x70')](_0x2a14a7)[_0x6b07('0x6c')](','):[];if(_0xa5cf09['length']===0x5){_0xa5cf09[_0x6b07('0x71')](-0x1,0x1);}_0xa5cf09[_0x6b07('0x72')](_0xd5f743);return encryptor[_0x6b07('0x73')](_0xa5cf09[_0x6b07('0x74')](','));};function signJwt(_0x30fdca){var _0x4e6ef7=BPromise['promisify'](jwt[_0x6b07('0x75')],{'context':jwt});var _0x357e01=_0x30fdca['secret']||config['secrets']['session'];return new BPromise(function(_0x18c63e,_0x53bb55){_0x4e6ef7(_0x30fdca[_0x6b07('0x76')],_0x357e01,_0x30fdca[_0x6b07('0x77')])[_0x6b07('0x32')](function(_0x25005c){_0x18c63e(_0x25005c);})[_0x6b07('0x38')](function(_0x4e506d){_0x53bb55(_0x4e506d);});});}function verifyJwt(_0x66b0ef,_0x3f0970,_0x55db99){var _0x2a77b7=BPromise[_0x6b07('0x78')](jwt[_0x6b07('0x79')],{'context':jwt});var _0xe58bb1=_0x55db99||config[_0x6b07('0xc')]['session'];return new BPromise(function(_0x501a15,_0x1e6f8c){_0x2a77b7(_0x66b0ef,_0xe58bb1,_0x3f0970)[_0x6b07('0x32')](function(_0x5c8134){_0x501a15(_0x5c8134);})[_0x6b07('0x38')](function(_0x38ea11){_0x1e6f8c(_0x38ea11);});});}function generateNonce(){return crypto[_0x6b07('0x7a')](0x10)[_0x6b07('0x7b')]('hex');}function generateIssuedAt(){return Math[_0x6b07('0x7c')](Date['now']()/0x3e8)[_0x6b07('0x7b')]();}function createJwt(_0x5e2bc4){var _0xbaf280={'payload':{'iat':_0x5e2bc4['apiKeyIat'],'nonce':_0x5e2bc4[_0x6b07('0x62')]},'options':{'algorithm':_0x6b07('0x7d'),'subject':_0x5e2bc4['id'][_0x6b07('0x7b')](),'issuer':hardwareConf[_0x6b07('0x46')](),'audience':hardwareConf[_0x6b07('0x46')]()}};return signJwt(_0xbaf280)[_0x6b07('0x32')](function(_0x5c291d){return{'iat':_0x5e2bc4[_0x6b07('0x63')],'nonce':_0x5e2bc4[_0x6b07('0x62')],'token':_0x5c291d};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 531edab..4474bf6 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 _0x77b9=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','write','final','close','unlink','createReadStream','secret','base64','decryptString','createDecipher','utf8','bluebird','lodash','../../config/environment','../../config/logger','secrets','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x77b9,0xaa));var _0x977b=function(_0x2c6255,_0x35b88e){_0x2c6255=_0x2c6255-0x0;var _0x519d63=_0x77b9[_0x2c6255];return _0x519d63;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x977b('0x0'));var _=require(_0x977b('0x1'));var config=require(_0x977b('0x2'));var logger=require(_0x977b('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x977b('0x4')]['session'],'algorithm':_0x977b('0x5')};const fileOptions={'algorithm':_0x977b('0x6')};if(config[_0x977b('0x7')]&&config[_0x977b('0x7')][_0x977b('0x8')]){var isSupported=isAlgorithmSupported(config[_0x977b('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x977b('0x7')][_0x977b('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x977b('0x9')](',\x20');logger[_0x977b('0xa')](config['encrypt'][_0x977b('0x8')],_0x977b('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4ad327){return AES_SUPPORTED_RX[_0x977b('0xc')](_0x4ad327);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x1699d7){return getSupportedCiphers()[_0x977b('0xd')](_0x1699d7)>-0x1;}function combineOptions(_0x57f1c1){var _0x29944d={};for(var _0x4b6ff3 in fileOptions){if(fileOptions[_0x977b('0xe')](_0x4b6ff3)){_0x29944d[_0x4b6ff3]=fileOptions[_0x4b6ff3];}}if(_0x57f1c1){for(var _0x15534d in _0x57f1c1){if(_0x57f1c1['hasOwnProperty'](_0x15534d)){_0x29944d[_0x15534d]=_0x57f1c1[_0x15534d];}}}return _0x29944d;}exports[_0x977b('0xf')]=function(_0x28dde3,_0x14e1c3,_0x8414b4,_0x462189){return new BPromise(function(_0x203111,_0x321143){_0x462189=combineOptions(_0x462189);var _0x5f002a=new Buffer(_0x8414b4);var _0xe1c36f=fs['createReadStream'](_0x28dde3);var _0x7c8e8e=fs[_0x977b('0x10')](_0x14e1c3);var _0x394fb3=crypto['createCipher'](_0x462189[_0x977b('0x8')],_0x5f002a);_0xe1c36f['on'](_0x977b('0x11'),function(_0x24a7e5){var _0x44c60a=new Buffer(_0x394fb3[_0x977b('0x12')](_0x24a7e5),_0x977b('0x13'));_0x7c8e8e[_0x977b('0x14')](_0x44c60a);});_0xe1c36f['on']('end',function(){try{var _0x552373=new Buffer(_0x394fb3[_0x977b('0x15')]('binary'),_0x977b('0x13'));_0x7c8e8e[_0x977b('0x14')](_0x552373);_0x7c8e8e['end']();_0x7c8e8e['on'](_0x977b('0x16'),function(){return _0x203111(_0x14e1c3);});}catch(_0x425e1b){fs[_0x977b('0x17')](_0x14e1c3);return _0x321143(_0x425e1b);}});});};exports['decryptFile']=function(_0x4ddbda,_0x132138,_0x124353,_0x30df24){return new BPromise(function(_0x4172be,_0x426e1b){_0x30df24=combineOptions(_0x30df24);var _0x3e5bb6=new Buffer(_0x124353);var _0x3b4bee=fs[_0x977b('0x18')](_0x4ddbda);var _0x33b77d=fs[_0x977b('0x10')](_0x132138);var _0xb326fe=crypto['createDecipher'](_0x30df24[_0x977b('0x8')],_0x3e5bb6);_0x3b4bee['on'](_0x977b('0x11'),function(_0x3c9a3d){var _0x3dd22e=new Buffer(_0xb326fe['update'](_0x3c9a3d),'binary');_0x33b77d['write'](_0x3dd22e);});_0x3b4bee['on']('end',function(){try{var _0x2bf394=new Buffer(_0xb326fe['final'](_0x977b('0x13')),'binary');_0x33b77d[_0x977b('0x14')](_0x2bf394);_0x33b77d['end']();_0x33b77d['on'](_0x977b('0x16'),function(){return _0x4172be(_0x132138);});}catch(_0x4964b8){fs[_0x977b('0x17')](_0x132138);return _0x426e1b(_0x4964b8);}});});};exports['encryptString']=function(_0x2e0d24,_0x3591c7,_0x19847e){var _0x866f39=_0x19847e||stringOptions[_0x977b('0x8')];var _0x51236a=_0x3591c7||stringOptions[_0x977b('0x19')];var _0x4dbfc1=crypto['createCipher'](_0x866f39,_0x51236a);var _0x19307f=_0x4dbfc1[_0x977b('0x12')](_0x2e0d24,'utf8',_0x977b('0x1a'));_0x19307f+=_0x4dbfc1[_0x977b('0x15')]('base64');return _0x19307f;};exports[_0x977b('0x1b')]=function(_0x11f846,_0xfaea41,_0xdbe680){var _0x136c4c=_0xdbe680||stringOptions[_0x977b('0x8')];var _0x4194b8=_0xfaea41||stringOptions[_0x977b('0x19')];var _0x5b1a96=crypto[_0x977b('0x1c')](_0x136c4c,_0x4194b8);var _0xfb22c4=_0x5b1a96[_0x977b('0x12')](_0x11f846,_0x977b('0x1a'),_0x977b('0x1d'));_0xfb22c4+=_0x5b1a96[_0x977b('0x15')]('utf8');return _0xfb22c4;}; \ No newline at end of file +var _0x41d6=['secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','end','write','close','unlink','update','final','encryptString','secret','utf8','base64','decryptString','createDecipher','bluebird','lodash','../../config/environment','app'];(function(_0x141727,_0x2888c2){var _0x1ec1c=function(_0x247e07){while(--_0x247e07){_0x141727['push'](_0x141727['shift']());}};_0x1ec1c(++_0x2888c2);}(_0x41d6,0x1b6));var _0x641d=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x41d6[_0x267484];return _0x14a356;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x641d('0x0'));var _=require(_0x641d('0x1'));var config=require(_0x641d('0x2'));var logger=require('../../config/logger')(_0x641d('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x641d('0x4')][_0x641d('0x5')],'algorithm':_0x641d('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x641d('0x7')]&&config['encrypt'][_0x641d('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x641d('0x8')]);if(isSupported){fileOptions[_0x641d('0x8')]=config[_0x641d('0x7')][_0x641d('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x641d('0x9')](',\x20');logger[_0x641d('0xa')](config['encrypt'][_0x641d('0x8')],_0x641d('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x2cc9f0){return AES_SUPPORTED_RX[_0x641d('0xc')](_0x2cc9f0);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x641d('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x909fc1){return getSupportedCiphers()[_0x641d('0xe')](_0x909fc1)>-0x1;}function combineOptions(_0x56540f){var _0x269b59={};for(var _0x58fcc4 in fileOptions){if(fileOptions[_0x641d('0xf')](_0x58fcc4)){_0x269b59[_0x58fcc4]=fileOptions[_0x58fcc4];}}if(_0x56540f){for(var _0x5a8f0c in _0x56540f){if(_0x56540f['hasOwnProperty'](_0x5a8f0c)){_0x269b59[_0x5a8f0c]=_0x56540f[_0x5a8f0c];}}}return _0x269b59;}exports[_0x641d('0x10')]=function(_0xb28f5d,_0x33bb32,_0x486fed,_0x5b5d12){return new BPromise(function(_0x5a57bf,_0x3c2a0b){_0x5b5d12=combineOptions(_0x5b5d12);var _0x418874=new Buffer(_0x486fed);var _0x55d7f2=fs[_0x641d('0x11')](_0xb28f5d);var _0x59ad37=fs[_0x641d('0x12')](_0x33bb32);var _0x1097d2=crypto[_0x641d('0x13')](_0x5b5d12['algorithm'],_0x418874);_0x55d7f2['on'](_0x641d('0x14'),function(_0x5e0c31){var _0x1c951e=new Buffer(_0x1097d2['update'](_0x5e0c31),_0x641d('0x15'));_0x59ad37['write'](_0x1c951e);});_0x55d7f2['on'](_0x641d('0x16'),function(){try{var _0x45c374=new Buffer(_0x1097d2['final']('binary'),_0x641d('0x15'));_0x59ad37[_0x641d('0x17')](_0x45c374);_0x59ad37[_0x641d('0x16')]();_0x59ad37['on'](_0x641d('0x18'),function(){return _0x5a57bf(_0x33bb32);});}catch(_0x4baa76){fs[_0x641d('0x19')](_0x33bb32);return _0x3c2a0b(_0x4baa76);}});});};exports['decryptFile']=function(_0x24a309,_0x14b2e0,_0x20d5a6,_0xb40fdb){return new BPromise(function(_0x8cfcc6,_0x21d102){_0xb40fdb=combineOptions(_0xb40fdb);var _0x117f00=new Buffer(_0x20d5a6);var _0x2aaf53=fs[_0x641d('0x11')](_0x24a309);var _0x44af43=fs[_0x641d('0x12')](_0x14b2e0);var _0x5ad03b=crypto['createDecipher'](_0xb40fdb[_0x641d('0x8')],_0x117f00);_0x2aaf53['on'](_0x641d('0x14'),function(_0x2e5029){var _0x425949=new Buffer(_0x5ad03b[_0x641d('0x1a')](_0x2e5029),_0x641d('0x15'));_0x44af43[_0x641d('0x17')](_0x425949);});_0x2aaf53['on']('end',function(){try{var _0x49b3e4=new Buffer(_0x5ad03b[_0x641d('0x1b')]('binary'),_0x641d('0x15'));_0x44af43['write'](_0x49b3e4);_0x44af43[_0x641d('0x16')]();_0x44af43['on'](_0x641d('0x18'),function(){return _0x8cfcc6(_0x14b2e0);});}catch(_0x1b1429){fs[_0x641d('0x19')](_0x14b2e0);return _0x21d102(_0x1b1429);}});});};exports[_0x641d('0x1c')]=function(_0x29dca9,_0x275359,_0x530a21){var _0xd234af=_0x530a21||stringOptions[_0x641d('0x8')];var _0x1b4b89=_0x275359||stringOptions[_0x641d('0x1d')];var _0x46925d=crypto[_0x641d('0x13')](_0xd234af,_0x1b4b89);var _0x54aa13=_0x46925d[_0x641d('0x1a')](_0x29dca9,_0x641d('0x1e'),_0x641d('0x1f'));_0x54aa13+=_0x46925d[_0x641d('0x1b')]('base64');return _0x54aa13;};exports[_0x641d('0x20')]=function(_0x5c8f8b,_0xe79912,_0x414dce){var _0x561d45=_0x414dce||stringOptions[_0x641d('0x8')];var _0x3f0fb2=_0xe79912||stringOptions['secret'];var _0x4f67ce=crypto[_0x641d('0x21')](_0x561d45,_0x3f0fb2);var _0x195f6d=_0x4f67ce['update'](_0x5c8f8b,'base64',_0x641d('0x1e'));_0x195f6d+=_0x4f67ce[_0x641d('0x1b')](_0x641d('0x1e'));return _0x195f6d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b1d022b..df5841c 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 _0x0390=['basename','.csv','existsSync','mkdirSync','join','%s%d.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x189364,_0xb3c7bb){var _0x26f26d=function(_0xf4a0ff){while(--_0xf4a0ff){_0x189364['push'](_0x189364['shift']());}};_0x26f26d(++_0xb3c7bb);}(_0x0390,0x103));var _0x0039=function(_0x225514,_0x56afdf){_0x225514=_0x225514-0x0;var _0x336531=_0x0390[_0x225514];return _0x336531;};'use strict';var util=require(_0x0039('0x0'));var path=require(_0x0039('0x1'));var _=require('lodash');var csv=require(_0x0039('0x2'));var fs=require('fs');var BPromise=require(_0x0039('0x3'));var zipdir=require(_0x0039('0x4'));var rimraf=require(_0x0039('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0039('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0039('0x7')][0x2]);var QUERY=process[_0x0039('0x7')][0x3];var PATH=process[_0x0039('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d90a9,_0x573285){var _0x368d11={'status':_0x3d90a9};var _0x538e6a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x573285){_0x368d11[_0x0039('0x8')]=_0x573285;}return db[_0x0039('0x9')]['update'](_0x368d11,_0x538e6a);}function main(){var _0x29e658=0x1388;var _0x54ae26;logger['info'](util['format'](_0x0039('0xa'),EXTRACTED_REPORT_ID,_0x0039('0xb')));return db['Setting'][_0x0039('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0039('0xd'),'splitSizeCsv']})['then'](function(_0x5db4fa){if(_0x5db4fa){_0x54ae26=_0x5db4fa;_0x29e658=_0x54ae26[_0x0039('0xe')]||0x1388;}})['then'](function(){return dbH[_0x0039('0xf')][_0x0039('0x10')](util[_0x0039('0x11')](_0x0039('0x12'),QUERY),{'type':dbH['sequelize'][_0x0039('0x13')][_0x0039('0x14')]});})[_0x0039('0x15')](function(_0xa0539f){if(!_0xa0539f[0x0][_0x0039('0x16')]){return analyticExtractedReport(_0x0039('0x17'));}var _0x27284a=[];var _0x417cbf=0x0;if(_0x54ae26[_0x0039('0xd')]){if(_0xa0539f&&_0xa0539f[_0x0039('0x18')]){var _0x5526bd=_['range'](_0xa0539f[0x0][_0x0039('0x16')]/_0x29e658);var _0x4cb900=Number[_0x0039('0x19')](_0xa0539f[0x0]['num']/_0x29e658)?_0xa0539f[0x0][_0x0039('0x16')]%_0x29e658:0x0;_0x5526bd['forEach'](function(_0x4dc55c){if(_0x4dc55c>0x0){_0x417cbf+=_0x29e658;}_0x27284a[_0x0039('0x1a')](dbH[_0x0039('0xf')][_0x0039('0x10')](util[_0x0039('0x11')](_0x0039('0x1b'),QUERY,_0x29e658,_0x417cbf),{'type':dbH[_0x0039('0xf')][_0x0039('0x13')]['SELECT']}));});if(_0x4cb900>0x0){_0x417cbf+=_0x29e658;_0x27284a['push'](dbH[_0x0039('0xf')][_0x0039('0x10')](util[_0x0039('0x11')](_0x0039('0x1b'),QUERY,_0x4cb900,_0x417cbf),{'type':dbH[_0x0039('0xf')][_0x0039('0x13')][_0x0039('0x14')]}));}}}else{_0x27284a[_0x0039('0x1a')](dbH[_0x0039('0xf')][_0x0039('0x10')](QUERY,{'type':dbH[_0x0039('0xf')][_0x0039('0x13')][_0x0039('0x14')]}));}var _0x37a357=path[_0x0039('0x1c')](PATH);var _0x3ec76e=path[_0x0039('0x1d')](PATH,_0x0039('0x1e'));var _0x13517f=_0x54ae26[_0x0039('0xd')]&&_0x27284a[_0x0039('0x18')]>0x1;var _0x54eb62=[];if(!fs[_0x0039('0x1f')](path['join'](_0x37a357,_0x3ec76e))&&_0x13517f){fs[_0x0039('0x20')](path[_0x0039('0x21')](_0x37a357,_0x3ec76e));}return BPromise['each'](_0x27284a,function(_0x372e50){_0x54eb62[_0x0039('0x1a')](_0x372e50);})[_0x0039('0x15')](function(){for(var _0xa1fcba=0x0;_0xa1fcba<_0x54eb62[_0x0039('0x18')];_0xa1fcba+=0x1){var _0x5e038f;var _0x219398=_0x54eb62[_0xa1fcba];if(_0x13517f){_0x5e038f=path[_0x0039('0x21')](_0x37a357,_0x3ec76e,util[_0x0039('0x11')](_0x0039('0x22'),_0x3ec76e,_0xa1fcba,_0x0039('0x23')));}else{_0x5e038f=path[_0x0039('0x21')](_0x37a357,util['format']('%s.%s',_0x3ec76e,_0x0039('0x23')));}fs[_0x0039('0x24')](_0x5e038f,csv(_0x219398));}})['then'](function(){if(_0x13517f){return new Promise(function(_0x2d1c88){zipdir(path[_0x0039('0x21')](_0x37a357,_0x3ec76e),{'saveTo':path['join'](_0x37a357,util['format']('%s.%s',_0x3ec76e,_0x0039('0x25')))},function(_0xbb6c93,_0x58afd3){rimraf(path[_0x0039('0x21')](_0x37a357,_0x3ec76e),function(){});_0x2d1c88(_0x0039('0x26'));});});}})['then'](function(){logger['info'](util[_0x0039('0x11')](_0x0039('0x27'),EXTRACTED_REPORT_ID,_0x0039('0xb')));return analyticExtractedReport(_0x0039('0x28'),_0x13517f?util[_0x0039('0x11')](_0x0039('0x29'),_0x3ec76e,_0x13517f?_0x0039('0x25'):_0x0039('0x23')):null);});})[_0x0039('0x2a')](function(_0x44cd41){logger[_0x0039('0x2b')](util[_0x0039('0x11')](_0x0039('0x2c'),EXTRACTED_REPORT_ID,_0x0039('0xb')),util[_0x0039('0x2d')](_0x44cd41,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0039('0x2e')](function(){process[_0x0039('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdc81=['isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','mkdirSync','join','each','push','%s.%s','csv','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','CSV','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','num','Empty','length','range'];(function(_0x4fb39d,_0x539377){var _0x1e4b07=function(_0x4e1ecf){while(--_0x4e1ecf){_0x4fb39d['push'](_0x4fb39d['shift']());}};_0x1e4b07(++_0x539377);}(_0xdc81,0x7f));var _0x1dc8=function(_0x432e11,_0x320ce1){_0x432e11=_0x432e11-0x0;var _0x1ef1bb=_0xdc81[_0x432e11];return _0x1ef1bb;};'use strict';var util=require('util');var path=require(_0x1dc8('0x0'));var _=require(_0x1dc8('0x1'));var csv=require(_0x1dc8('0x2'));var fs=require('fs');var BPromise=require(_0x1dc8('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x1dc8('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1dc8('0x5'))[_0x1dc8('0x6')];var logger=require(_0x1dc8('0x7'))(_0x1dc8('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x1dc8('0x9')][0x2]);var QUERY=process[_0x1dc8('0x9')][0x3];var PATH=process[_0x1dc8('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b7707,_0x23d46d){var _0x5e633c={'status':_0x2b7707};var _0x29de49={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23d46d){_0x5e633c[_0x1dc8('0xa')]=_0x23d46d;}return db[_0x1dc8('0xb')]['update'](_0x5e633c,_0x29de49);}function main(){var _0x5c6bea=0x1388;var _0x37c72c;logger[_0x1dc8('0xc')](util[_0x1dc8('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x1dc8('0xe')][_0x1dc8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1dc8('0x10'),_0x1dc8('0x11')]})[_0x1dc8('0x12')](function(_0x389087){if(_0x389087){_0x37c72c=_0x389087;_0x5c6bea=_0x37c72c['splitSizeCsv']||0x1388;}})[_0x1dc8('0x12')](function(){return dbH[_0x1dc8('0x13')][_0x1dc8('0x14')](util[_0x1dc8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')]['SELECT']});})['then'](function(_0x5e735f){if(!_0x5e735f[0x0][_0x1dc8('0x16')]){return analyticExtractedReport(_0x1dc8('0x17'));}var _0x56ca54=[];var _0x53a107=0x0;if(_0x37c72c[_0x1dc8('0x10')]){if(_0x5e735f&&_0x5e735f[_0x1dc8('0x18')]){var _0x182573=_[_0x1dc8('0x19')](_0x5e735f[0x0][_0x1dc8('0x16')]/_0x5c6bea);var _0x26237e=Number[_0x1dc8('0x1a')](_0x5e735f[0x0]['num']/_0x5c6bea)?_0x5e735f[0x0][_0x1dc8('0x16')]%_0x5c6bea:0x0;_0x182573[_0x1dc8('0x1b')](function(_0x22fdf3){if(_0x22fdf3>0x0){_0x53a107+=_0x5c6bea;}_0x56ca54['push'](dbH[_0x1dc8('0x13')][_0x1dc8('0x14')](util[_0x1dc8('0xd')](_0x1dc8('0x1c'),QUERY,_0x5c6bea,_0x53a107),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')][_0x1dc8('0x1d')]}));});if(_0x26237e>0x0){_0x53a107+=_0x5c6bea;_0x56ca54['push'](dbH['sequelize']['query'](util[_0x1dc8('0xd')](_0x1dc8('0x1c'),QUERY,_0x26237e,_0x53a107),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')]['SELECT']}));}}}else{_0x56ca54['push'](dbH[_0x1dc8('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x1dc8('0x15')]['SELECT']}));}var _0xd2fb72=path[_0x1dc8('0x1e')](PATH);var _0x2a17ef=path[_0x1dc8('0x1f')](PATH,_0x1dc8('0x20'));var _0x46d8f9=_0x37c72c[_0x1dc8('0x10')]&&_0x56ca54[_0x1dc8('0x18')]>0x1;var _0x2f6fac=[];if(!fs['existsSync'](path['join'](_0xd2fb72,_0x2a17ef))&&_0x46d8f9){fs[_0x1dc8('0x21')](path[_0x1dc8('0x22')](_0xd2fb72,_0x2a17ef));}return BPromise[_0x1dc8('0x23')](_0x56ca54,function(_0x2c19f3){_0x2f6fac[_0x1dc8('0x24')](_0x2c19f3);})[_0x1dc8('0x12')](function(){for(var _0x597402=0x0;_0x597402<_0x2f6fac['length'];_0x597402+=0x1){var _0x31a97f;var _0x698cfb=_0x2f6fac[_0x597402];if(_0x46d8f9){_0x31a97f=path['join'](_0xd2fb72,_0x2a17ef,util[_0x1dc8('0xd')]('%s%d.%s',_0x2a17ef,_0x597402,'csv'));}else{_0x31a97f=path[_0x1dc8('0x22')](_0xd2fb72,util[_0x1dc8('0xd')](_0x1dc8('0x25'),_0x2a17ef,_0x1dc8('0x26')));}fs[_0x1dc8('0x27')](_0x31a97f,csv(_0x698cfb));}})[_0x1dc8('0x12')](function(){if(_0x46d8f9){return new Promise(function(_0x16a8c2){zipdir(path[_0x1dc8('0x22')](_0xd2fb72,_0x2a17ef),{'saveTo':path['join'](_0xd2fb72,util[_0x1dc8('0xd')](_0x1dc8('0x25'),_0x2a17ef,'zip'))},function(_0x65437d,_0x5a5ef9){rimraf(path['join'](_0xd2fb72,_0x2a17ef),function(){});_0x16a8c2(_0x1dc8('0x28'));});});}})[_0x1dc8('0x12')](function(){logger[_0x1dc8('0xc')](util[_0x1dc8('0xd')](_0x1dc8('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x1dc8('0x2a'),_0x46d8f9?util['format'](_0x1dc8('0x25'),_0x2a17ef,_0x46d8f9?_0x1dc8('0x2b'):_0x1dc8('0x26')):null);});})[_0x1dc8('0x2c')](function(_0x4b80c1){logger[_0x1dc8('0xc')](util['format'](_0x1dc8('0x2d'),EXTRACTED_REPORT_ID,_0x1dc8('0x2e')),util[_0x1dc8('0x2f')](_0x4b80c1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1dc8('0x30'));})[_0x1dc8('0x31')](function(){process[_0x1dc8('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 1b06a8c..eeac435 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 _0x79ab=['/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','YYYY-MM-DD','toString','Arial','center','Interaction\x20Transcript','createWriteStream','finish','error','end','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','margin','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','then','splitSizePdf','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','finally','exit','/fonts/arial-regular.ttf'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x79ab,0xbe));var _0xb79a=function(_0x46eb54,_0x4f1eac){_0x46eb54=_0x46eb54-0x0;var _0x3902b2=_0x79ab[_0x46eb54];return _0x3902b2;};'use strict';var _=require(_0xb79a('0x0'));var fs=require('fs');var util=require(_0xb79a('0x1'));var path=require(_0xb79a('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xb79a('0x3'));var PdfPrinter=require(_0xb79a('0x4'));var zipdir=require(_0xb79a('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0xb79a('0x6'))[_0xb79a('0x7')];var window=new JSDOM('')[_0xb79a('0x8')];var BPromise=require('bluebird');var db=require(_0xb79a('0x9'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xb79a('0xa'))(_0xb79a('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xb79a('0xc')][0x2]);var QUERY=process[_0xb79a('0xc')][0x3];var PATH=process[_0xb79a('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xb79a('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1613bb,_0x2c110f){var _0xbcfd2c={'status':_0x1613bb};var _0x2bf1e3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c110f){_0xbcfd2c[_0xb79a('0xe')]=_0x2c110f;}return db[_0xb79a('0xf')][_0xb79a('0x10')](_0xbcfd2c,_0x2bf1e3);}function getHeaders(_0x4d8419){return _[_0xb79a('0x11')](_0x4d8419,function(_0x58c23a){return{'text':_0x58c23a,'style':_0xb79a('0x12')};});}function getRows(_0x3d51f4,_0xe4d304){return _[_0xb79a('0x11')](_0xe4d304,function(_0x3acc72){return _(_0x3acc72)[_0xb79a('0x13')](_0x3d51f4)[_0xb79a('0x11')](function(_0x4b81cf){return _0x4b81cf?_['toString'](_0x4b81cf):'';})[_0xb79a('0x14')]();});}function createTable(_0x387edc,_0x514b39){var _0x4e10b3={'widths':_[_0xb79a('0x15')](Array(_0x387edc[_0xb79a('0x16')]),0x91),'heights':function(_0xdbe775){return _0xdbe775===0x0?_0xb79a('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1c6119=getHeaders(_0x387edc);_0x4e10b3[_0xb79a('0x18')]['push'](_0x1c6119);var _0xc98670=getRows(_0x387edc,_0x514b39);_0x4e10b3[_0xb79a('0x18')]=_0x4e10b3['body']['concat'](_0xc98670);return _0x4e10b3;}function createTables(_0x1e64d2){var _0xfcbc52=[];var _0x2c1061=_[_0xb79a('0x19')](Object[_0xb79a('0x1a')](_0x1e64d2[0x0]),0x5);_0x2c1061[_0xb79a('0x1b')](function(_0x32593f){_0xfcbc52[_0xb79a('0x1c')](createTable(_0x32593f,_0x1e64d2));});return _0xfcbc52;}function getPDFDocDefinition(_0x48172d){var _0x20c728=util[_0xb79a('0x1d')](_0xb79a('0x1e'),NAME,EXTRACTED_REPORT[_0xb79a('0x1f')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xb79a('0x20')])['format'](FORMAT));var _0x5696b2=[];for(var _0x4236df=0x0;_0x4236df<_0x48172d[_0xb79a('0x16')];_0x4236df++){var _0x34f27e=[];if(_0x4236df===0x0){_0x34f27e[_0xb79a('0x1c')]({'text':_0x20c728,'style':_0xb79a('0x21')});}var _0x2d252b={'table':_0x48172d[_0x4236df]};if(_0x4236df>0x0){_0x2d252b[_0xb79a('0x22')]=_0xb79a('0x23');_0x2d252b[_0xb79a('0x24')]=[0x0,0x46,0x0,0x0];}_0x34f27e[_0xb79a('0x1c')](_0x2d252b);_0x5696b2[_0xb79a('0x1c')](_0x34f27e);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5696b2,'footer':function(_0x17123e,_0x3b4322){return{'text':_0x17123e['toString']()+_0xb79a('0x25')+_0x3b4322,'style':_0xb79a('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb79a('0x27')},'footer':{'alignment':_0xb79a('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x563653){var _0x39c288=0x1388;var _0x39c356;if(!_0x563653[0x0][_0xb79a('0x29')]){return analyticExtractedReport(_0xb79a('0x2a'));}return db[_0xb79a('0x2b')][_0xb79a('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb79a('0x2d'),'splitSizePdf']})[_0xb79a('0x2e')](function(_0x5ce0e3){if(_0x5ce0e3){_0x39c356=_0x5ce0e3;_0x39c288=_0x39c356[_0xb79a('0x2f')]||0x3e8;}})[_0xb79a('0x2e')](function(){var _0x442178=[];var _0x3349c8=0x0;if(_0x39c356[_0xb79a('0x2d')]){if(_0x563653&&_0x563653[_0xb79a('0x16')]){var _0x317100=_[_0xb79a('0x30')](_0x563653[0x0][_0xb79a('0x29')]/_0x39c288);var _0x4eaa13=Number[_0xb79a('0x31')](_0x563653[0x0][_0xb79a('0x29')]/_0x39c288)?_0x563653[0x0][_0xb79a('0x29')]%_0x39c288:0x0;_0x317100[_0xb79a('0x1b')](function(_0x21db16){if(_0x21db16>0x0){_0x3349c8+=_0x39c288;}_0x442178[_0xb79a('0x1c')](dbH[_0xb79a('0x32')]['query'](util[_0xb79a('0x1d')](_0xb79a('0x33'),QUERY,_0x39c288,_0x3349c8),{'type':dbH[_0xb79a('0x32')][_0xb79a('0x34')][_0xb79a('0x35')]}));});if(_0x4eaa13>0x0){_0x3349c8+=_0x39c288;_0x442178[_0xb79a('0x1c')](dbH[_0xb79a('0x32')][_0xb79a('0x36')](util[_0xb79a('0x1d')](_0xb79a('0x33'),QUERY,_0x4eaa13,_0x3349c8),{'type':dbH[_0xb79a('0x32')][_0xb79a('0x34')][_0xb79a('0x35')]}));}}}else{_0x442178[_0xb79a('0x1c')](dbH[_0xb79a('0x32')]['query'](QUERY,{'type':dbH[_0xb79a('0x32')][_0xb79a('0x34')][_0xb79a('0x35')]}));}var _0x4012f7=path[_0xb79a('0x37')](PATH);var _0x25ef52=path[_0xb79a('0x38')](PATH,_0xb79a('0x39'));var _0x16a114=_0x39c356[_0xb79a('0x2d')]&&_0x442178[_0xb79a('0x16')]>0x1;var _0x3ac0b8=[];if(!fs[_0xb79a('0x3a')](path[_0xb79a('0x3b')](_0x4012f7,_0x25ef52))&&_0x16a114){fs['mkdirSync'](path['join'](_0x4012f7,_0x25ef52));}return BPromise['each'](_0x442178,function(_0x48dc7d){_0x3ac0b8[_0xb79a('0x1c')](_0x48dc7d);})['then'](function(){var _0x2179cd=[];for(var _0x19d07e=0x0;_0x19d07e<_0x3ac0b8[_0xb79a('0x16')];_0x19d07e+=0x1){var _0x229eed=_0x3ac0b8[_0x19d07e];var _0xec04d0=createTables(_['flatten'](_0x229eed));var _0x3d62cf;var _0x5a9c06=getPDFDocDefinition(_0xec04d0);var _0x2535c8=getPDFPrinter();var _0x154e24=_0x2535c8[_0xb79a('0x3c')](_0x5a9c06);if(_0x16a114){_0x3d62cf=path[_0xb79a('0x3b')](_0x4012f7,_0x25ef52,util['format'](_0xb79a('0x3d'),_0x25ef52,_0x19d07e,_0xb79a('0x3e')));}else{_0x3d62cf=path[_0xb79a('0x3b')](_0x4012f7,util['format'](_0xb79a('0x3f'),_0x25ef52,_0xb79a('0x3e')));}_0x2179cd[_0xb79a('0x1c')](writePDFDocument(_0x154e24,_0x3d62cf));}return Promise[_0xb79a('0x40')](_0x2179cd);})[_0xb79a('0x2e')](function(){if(_0x16a114){return new Promise(function(_0x1b30ca){zipdir(path[_0xb79a('0x3b')](_0x4012f7,_0x25ef52),{'saveTo':path[_0xb79a('0x3b')](_0x4012f7,util[_0xb79a('0x1d')](_0xb79a('0x3f'),_0x25ef52,_0xb79a('0x41')))},function(){rimraf(path[_0xb79a('0x3b')](_0x4012f7,_0x25ef52),function(){});_0x1b30ca(_0xb79a('0x42'));});});}})[_0xb79a('0x2e')](function(){if(!_0x16a114)return;rimraf(path[_0xb79a('0x3b')](_0x4012f7,_0x25ef52),function(){});})[_0xb79a('0x2e')](function(){logger['info'](util[_0xb79a('0x1d')](_0xb79a('0x43'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xb79a('0x44'),_0x16a114?util[_0xb79a('0x1d')](_0xb79a('0x3f'),_0x25ef52,_0x16a114?_0xb79a('0x41'):_0xb79a('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb79a('0x45')](util[_0xb79a('0x1d')](_0xb79a('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xb79a('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x494dfd){EXTRACTED_REPORT=_0x494dfd;return dbH['sequelize'][_0xb79a('0x36')](util[_0xb79a('0x1d')](_0xb79a('0x47'),QUERY),{'type':dbH[_0xb79a('0x32')][_0xb79a('0x34')][_0xb79a('0x35')]});})[_0xb79a('0x2e')](extractReport)[_0xb79a('0x48')](function(_0xb62664){logger[_0xb79a('0x45')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb79a('0x49')),util['inspect'](_0xb62664,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xb79a('0x4a')](function(){process[_0xb79a('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x16eb11=new PdfPrinter({'Arial':{'normal':__dirname+_0xb79a('0x4c'),'bold':__dirname+_0xb79a('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xb79a('0x4e')}});return _0x16eb11;}function getPDFDocDefinitionFromHTML(_0x10fa1e,_0x2574f0){var _0x40141e=util[_0xb79a('0x1d')](_0xb79a('0x4f'),_0x2574f0['channel'],_0x2574f0['interactionId']);var _0x284985=moment()[_0xb79a('0x1d')](_0xb79a('0x50'))[_0xb79a('0x51')]();var _0x615116=htmlToPdfmake(_0x10fa1e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x615116],'defaultStyle':{'font':_0xb79a('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb79a('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb79a('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb79a('0x53')}},'header':function(){return[{'text':_0xb79a('0x54'),'style':_0xb79a('0x21')}];},'footer':function(_0x220ef8,_0x43721b){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x40141e,_0x220ef8,_0x43721b,_0x284985),'style':'footer'}];}};}function writePDFDocument(_0x25e3db,_0x573826){return new Promise(function(_0x27c73a,_0x56c258){var _0x4656f8=_0x25e3db['pipe'](fs[_0xb79a('0x55')](_0x573826));_0x4656f8['on'](_0xb79a('0x56'),function(){_0x27c73a(_0xb79a('0x56'));});_0x4656f8['on'](_0xb79a('0x57'),function(_0x4dcb37){_0x56c258(_0x4dcb37);});_0x25e3db[_0xb79a('0x58')]();});}exports['createPdfFromHTML']=function(_0x384555,_0x306b79){var _0x45acf9=getPDFPrinter();var _0x4467a0=getPDFDocDefinitionFromHTML(_0x384555,_0x306b79);var _0x9442ef=_0x45acf9[_0xb79a('0x3c')](_0x4467a0);return writePDFDocument(_0x9442ef,_0x306b79[_0xb79a('0x2')])[_0xb79a('0x48')](function(_0xf3f45c){throw _0xf3f45c;});}; \ No newline at end of file +var _0x75f2=['YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','fill','length','auto','body','push','concat','chunk','format','name','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId'];(function(_0x316911,_0x1fccd5){var _0x2df4bb=function(_0x17c34d){while(--_0x17c34d){_0x316911['push'](_0x316911['shift']());}};_0x2df4bb(++_0x1fccd5);}(_0x75f2,0x1da));var _0x275f=function(_0x3fceae,_0x21ddd3){_0x3fceae=_0x3fceae-0x0;var _0x38dcd4=_0x75f2[_0x3fceae];return _0x38dcd4;};'use strict';var _=require(_0x275f('0x0'));var fs=require('fs');var util=require(_0x275f('0x1'));var path=require(_0x275f('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x275f('0x3'));var PdfPrinter=require(_0x275f('0x4'));var zipdir=require(_0x275f('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x275f('0x6'))[_0x275f('0x7')];var window=new JSDOM('')[_0x275f('0x8')];var BPromise=require(_0x275f('0x9'));var db=require(_0x275f('0xa'))['db'];var dbH=require(_0x275f('0xa'))[_0x275f('0xb')];var logger=require(_0x275f('0xc'))(_0x275f('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x275f('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x275f('0xe')][0x5];var FORMAT=_0x275f('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5354a0,_0x2a209e){var _0x260d6f={'status':_0x5354a0};var _0x4eb37b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a209e){_0x260d6f[_0x275f('0x10')]=_0x2a209e;}return db[_0x275f('0x11')]['update'](_0x260d6f,_0x4eb37b);}function getHeaders(_0x13fcdf){return _[_0x275f('0x12')](_0x13fcdf,function(_0x2e5d58){return{'text':_0x2e5d58,'style':_0x275f('0x13')};});}function getRows(_0x54b446,_0x4c3a64){return _[_0x275f('0x12')](_0x4c3a64,function(_0x5e1d65){return _(_0x5e1d65)[_0x275f('0x14')](_0x54b446)[_0x275f('0x12')](function(_0xf38b1e){return _0xf38b1e?_[_0x275f('0x15')](_0xf38b1e):'';})['value']();});}function createTable(_0x2dbbf2,_0x23b8b3){var _0x1ce4b0={'widths':_[_0x275f('0x16')](Array(_0x2dbbf2[_0x275f('0x17')]),0x91),'heights':function(_0x13ce56){return _0x13ce56===0x0?_0x275f('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c3490=getHeaders(_0x2dbbf2);_0x1ce4b0[_0x275f('0x19')][_0x275f('0x1a')](_0x3c3490);var _0xed72e1=getRows(_0x2dbbf2,_0x23b8b3);_0x1ce4b0['body']=_0x1ce4b0[_0x275f('0x19')][_0x275f('0x1b')](_0xed72e1);return _0x1ce4b0;}function createTables(_0x3eba8a){var _0x24642a=[];var _0x5b421a=_[_0x275f('0x1c')](Object['keys'](_0x3eba8a[0x0]),0x5);_0x5b421a['forEach'](function(_0x538916){_0x24642a['push'](createTable(_0x538916,_0x3eba8a));});return _0x24642a;}function getPDFDocDefinition(_0x28cba0){var _0x22c0fd=util[_0x275f('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x275f('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x275f('0x1d')](FORMAT));var _0x33f613=[];for(var _0x49c912=0x0;_0x49c912<_0x28cba0[_0x275f('0x17')];_0x49c912++){var _0x3f8bdb=[];if(_0x49c912===0x0){_0x3f8bdb[_0x275f('0x1a')]({'text':_0x22c0fd,'style':_0x275f('0x1f')});}var _0x239da5={'table':_0x28cba0[_0x49c912]};if(_0x49c912>0x0){_0x239da5[_0x275f('0x20')]=_0x275f('0x21');_0x239da5[_0x275f('0x22')]=[0x0,0x46,0x0,0x0];}_0x3f8bdb['push'](_0x239da5);_0x33f613[_0x275f('0x1a')](_0x3f8bdb);}return{'pageSize':'A4','pageOrientation':_0x275f('0x23'),'content':_0x33f613,'footer':function(_0x6498e0,_0x31cb8d){return{'text':_0x6498e0[_0x275f('0x15')]()+_0x275f('0x24')+_0x31cb8d,'style':_0x275f('0x25')};},'defaultStyle':{'font':_0x275f('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x275f('0x27')},'footer':{'alignment':_0x275f('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xbdf407){var _0x59aeaf=0x1388;var _0x4a5bd4;if(!_0xbdf407[0x0][_0x275f('0x29')]){return analyticExtractedReport(_0x275f('0x2a'));}return db[_0x275f('0x2b')][_0x275f('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x275f('0x2d')]})[_0x275f('0x2e')](function(_0x3bbfcc){if(_0x3bbfcc){_0x4a5bd4=_0x3bbfcc;_0x59aeaf=_0x4a5bd4[_0x275f('0x2d')]||0x3e8;}})['then'](function(){var _0x3d9c81=[];var _0x3d30dc=0x0;if(_0x4a5bd4[_0x275f('0x2f')]){if(_0xbdf407&&_0xbdf407[_0x275f('0x17')]){var _0x6519d4=_['range'](_0xbdf407[0x0][_0x275f('0x29')]/_0x59aeaf);var _0x12b4bc=Number[_0x275f('0x30')](_0xbdf407[0x0][_0x275f('0x29')]/_0x59aeaf)?_0xbdf407[0x0][_0x275f('0x29')]%_0x59aeaf:0x0;_0x6519d4[_0x275f('0x31')](function(_0x3b4f57){if(_0x3b4f57>0x0){_0x3d30dc+=_0x59aeaf;}_0x3d9c81[_0x275f('0x1a')](dbH[_0x275f('0x32')][_0x275f('0x33')](util[_0x275f('0x1d')](_0x275f('0x34'),QUERY,_0x59aeaf,_0x3d30dc),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));});if(_0x12b4bc>0x0){_0x3d30dc+=_0x59aeaf;_0x3d9c81['push'](dbH[_0x275f('0x32')]['query'](util[_0x275f('0x1d')](_0x275f('0x34'),QUERY,_0x12b4bc,_0x3d30dc),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));}}}else{_0x3d9c81['push'](dbH[_0x275f('0x32')][_0x275f('0x33')](QUERY,{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));}var _0x467fea=path[_0x275f('0x37')](PATH);var _0x198185=path['basename'](PATH,'.pdf');var _0x18aacf=_0x4a5bd4[_0x275f('0x2f')]&&_0x3d9c81[_0x275f('0x17')]>0x1;var _0x70d723=[];if(!fs[_0x275f('0x38')](path['join'](_0x467fea,_0x198185))&&_0x18aacf){fs[_0x275f('0x39')](path[_0x275f('0x3a')](_0x467fea,_0x198185));}return BPromise[_0x275f('0x3b')](_0x3d9c81,function(_0x4310c4){_0x70d723[_0x275f('0x1a')](_0x4310c4);})['then'](function(){var _0x5d3699=[];for(var _0x6b9639=0x0;_0x6b9639<_0x70d723[_0x275f('0x17')];_0x6b9639+=0x1){var _0x3d9388=_0x70d723[_0x6b9639];var _0x21a2a6=createTables(_[_0x275f('0x3c')](_0x3d9388));var _0x2d6130;var _0x3f310f=getPDFDocDefinition(_0x21a2a6);var _0x28693c=getPDFPrinter();var _0x593b67=_0x28693c[_0x275f('0x3d')](_0x3f310f);if(_0x18aacf){_0x2d6130=path[_0x275f('0x3a')](_0x467fea,_0x198185,util[_0x275f('0x1d')](_0x275f('0x3e'),_0x198185,_0x6b9639,_0x275f('0x3f')));}else{_0x2d6130=path[_0x275f('0x3a')](_0x467fea,util[_0x275f('0x1d')](_0x275f('0x40'),_0x198185,_0x275f('0x3f')));}_0x5d3699[_0x275f('0x1a')](writePDFDocument(_0x593b67,_0x2d6130));}return Promise[_0x275f('0x41')](_0x5d3699);})[_0x275f('0x2e')](function(){if(_0x18aacf){return new Promise(function(_0x2ecb5d){zipdir(path['join'](_0x467fea,_0x198185),{'saveTo':path['join'](_0x467fea,util[_0x275f('0x1d')]('%s.%s',_0x198185,_0x275f('0x42')))},function(){rimraf(path[_0x275f('0x3a')](_0x467fea,_0x198185),function(){});_0x2ecb5d(_0x275f('0x43'));});});}})[_0x275f('0x2e')](function(){if(!_0x18aacf)return;rimraf(path[_0x275f('0x3a')](_0x467fea,_0x198185),function(){});})[_0x275f('0x2e')](function(){logger[_0x275f('0x44')](util[_0x275f('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x275f('0x45')));return analyticExtractedReport(_0x275f('0x46'),_0x18aacf?util[_0x275f('0x1d')](_0x275f('0x40'),_0x198185,_0x18aacf?'zip':_0x275f('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x275f('0x1d')](_0x275f('0x47'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x275f('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x275f('0x2e')](function(_0x19f8ff){EXTRACTED_REPORT=_0x19f8ff;return dbH[_0x275f('0x32')][_0x275f('0x33')](util[_0x275f('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')]['SELECT']});})[_0x275f('0x2e')](extractReport)[_0x275f('0x49')](function(_0x250cd4){logger[_0x275f('0x44')](util[_0x275f('0x1d')](_0x275f('0x4a'),EXTRACTED_REPORT_ID,_0x275f('0x45')),util[_0x275f('0x4b')](_0x250cd4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x275f('0x4c'));})[_0x275f('0x4d')](function(){process[_0x275f('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x52fbc5=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x275f('0x4f'),'italics':__dirname+_0x275f('0x50'),'bolditalics':__dirname+_0x275f('0x51')}});return _0x52fbc5;}function getPDFDocDefinitionFromHTML(_0x48026f,_0x27f7fd){var _0x2aa7ae=util[_0x275f('0x1d')]('%s\x20#%d',_0x27f7fd[_0x275f('0x52')],_0x27f7fd[_0x275f('0x53')]);var _0xba7807=moment()[_0x275f('0x1d')](_0x275f('0x54'))[_0x275f('0x15')]();var _0x45723b=htmlToPdfmake(_0x48026f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x45723b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x275f('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x275f('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x275f('0x55')}},'header':function(){return[{'text':_0x275f('0x56'),'style':_0x275f('0x1f')}];},'footer':function(_0xbed753,_0x428ba8){return[{'text':util[_0x275f('0x1d')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2aa7ae,_0xbed753,_0x428ba8,_0xba7807),'style':_0x275f('0x25')}];}};}function writePDFDocument(_0xafadcf,_0x3d2932){return new Promise(function(_0x34fc8f,_0x16a0eb){var _0x3bae18=_0xafadcf[_0x275f('0x57')](fs[_0x275f('0x58')](_0x3d2932));_0x3bae18['on'](_0x275f('0x59'),function(){_0x34fc8f(_0x275f('0x59'));});_0x3bae18['on'](_0x275f('0x5a'),function(_0x28e804){_0x16a0eb(_0x28e804);});_0xafadcf[_0x275f('0x5b')]();});}exports[_0x275f('0x5c')]=function(_0x1265ee,_0x188679){var _0x1c4749=getPDFPrinter();var _0x38eff8=getPDFDocDefinitionFromHTML(_0x1265ee,_0x188679);var _0x1624b2=_0x1c4749[_0x275f('0x3d')](_0x38eff8);return writePDFDocument(_0x1624b2,_0x188679['path'])['catch'](function(_0x5809f7){throw _0x5809f7;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d5b8022..e404f94 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 _0x3d3b=['basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip','info','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','finally','exit','util','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname'];(function(_0x1901b3,_0x89058f){var _0x3fbbb2=function(_0x120fdb){while(--_0x120fdb){_0x1901b3['push'](_0x1901b3['shift']());}};_0x3fbbb2(++_0x89058f);}(_0x3d3b,0x1af));var _0xb3d3=function(_0x5541ae,_0x4a902d){_0x5541ae=_0x5541ae-0x0;var _0x42adf6=_0x3d3b[_0x5541ae];return _0x42adf6;};'use strict';var util=require(_0xb3d3('0x0'));var path=require('path');var _=require(_0xb3d3('0x1'));var fs=require('fs');var json2xls=require(_0xb3d3('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xb3d3('0x3'));var db=require(_0xb3d3('0x4'))['db'];var dbH=require(_0xb3d3('0x4'))[_0xb3d3('0x5')];var logger=require(_0xb3d3('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb3d3('0x7')][0x2]);var QUERY=process[_0xb3d3('0x7')][0x3];var PATH=process[_0xb3d3('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c14d8,_0x41a457){var _0x50db26={'status':_0x2c14d8};var _0x47e24e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41a457){_0x50db26[_0xb3d3('0x8')]=_0x41a457;}return db[_0xb3d3('0x9')][_0xb3d3('0xa')](_0x50db26,_0x47e24e);}function main(){var _0x2abbf8=0x1388;var _0x39ed2b;logger['info'](util[_0xb3d3('0xb')](_0xb3d3('0xc'),EXTRACTED_REPORT_ID,_0xb3d3('0xd')));return db['Setting'][_0xb3d3('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb3d3('0xf'),_0xb3d3('0x10')]})[_0xb3d3('0x11')](function(_0x327df1){if(_0x327df1){_0x39ed2b=_0x327df1;_0x2abbf8=_0x39ed2b[_0xb3d3('0x10')]||0x1388;}})[_0xb3d3('0x11')](function(){return dbH[_0xb3d3('0x12')][_0xb3d3('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb3d3('0x12')][_0xb3d3('0x14')]['SELECT']});})[_0xb3d3('0x11')](function(_0xcbdec5){if(!_0xcbdec5[0x0]['num']){return analyticExtractedReport('Empty');}var _0x553b22=[];var _0xb2e031=0x0;if(_0x39ed2b[_0xb3d3('0xf')]){if(_0xcbdec5&&_0xcbdec5[_0xb3d3('0x15')]){var _0x37b32d=_[_0xb3d3('0x16')](_0xcbdec5[0x0][_0xb3d3('0x17')]/_0x2abbf8);var _0xd34f4e=Number['isInteger'](_0xcbdec5[0x0][_0xb3d3('0x17')]/_0x2abbf8)?_0xcbdec5[0x0]['num']%_0x2abbf8:0x0;_0x37b32d[_0xb3d3('0x18')](function(_0x5b0ce4){if(_0x5b0ce4>0x0){_0xb2e031+=_0x2abbf8;}_0x553b22[_0xb3d3('0x19')](dbH[_0xb3d3('0x12')][_0xb3d3('0x13')](util[_0xb3d3('0xb')](_0xb3d3('0x1a'),QUERY,_0x2abbf8,_0xb2e031),{'type':dbH[_0xb3d3('0x12')][_0xb3d3('0x14')]['SELECT']}));});if(_0xd34f4e>0x0){_0xb2e031+=_0x2abbf8;_0x553b22[_0xb3d3('0x19')](dbH[_0xb3d3('0x12')][_0xb3d3('0x13')](util[_0xb3d3('0xb')](_0xb3d3('0x1a'),QUERY,_0xd34f4e,_0xb2e031),{'type':dbH[_0xb3d3('0x12')][_0xb3d3('0x14')][_0xb3d3('0x1b')]}));}}}else{_0x553b22['push'](dbH[_0xb3d3('0x12')]['query'](QUERY,{'type':dbH[_0xb3d3('0x12')][_0xb3d3('0x14')][_0xb3d3('0x1b')]}));}var _0x22edae=path[_0xb3d3('0x1c')](PATH);var _0x538e81=path[_0xb3d3('0x1d')](PATH,_0xb3d3('0x1e'));var _0x35aa89=_0x39ed2b['split']&&_0x553b22[_0xb3d3('0x15')]>0x1;var _0x563d8a=[];if(!fs[_0xb3d3('0x1f')](path[_0xb3d3('0x20')](_0x22edae,_0x538e81))&&_0x35aa89){fs[_0xb3d3('0x21')](path['join'](_0x22edae,_0x538e81));}return BPromise[_0xb3d3('0x22')](_0x553b22,function(_0xb50e4d){_0x563d8a[_0xb3d3('0x19')](_0xb50e4d);})[_0xb3d3('0x11')](function(){for(var _0x4c799e=0x0;_0x4c799e<_0x563d8a['length'];_0x4c799e+=0x1){var _0x32f68f;var _0x3f0f3a=_0x563d8a[_0x4c799e];if(_0x35aa89){_0x32f68f=path[_0xb3d3('0x20')](_0x22edae,_0x538e81,util[_0xb3d3('0xb')]('%s%d.%s',_0x538e81,_0x4c799e,_0xb3d3('0x23')));}else{_0x32f68f=path[_0xb3d3('0x20')](_0x22edae,util[_0xb3d3('0xb')](_0xb3d3('0x24'),_0x538e81,_0xb3d3('0x23')));}fs['writeFileSync'](_0x32f68f,json2xls(_0x3f0f3a),_0xb3d3('0x25'));}})[_0xb3d3('0x11')](function(){if(_0x35aa89){return new Promise(function(_0x4c25db){zipdir(path[_0xb3d3('0x20')](_0x22edae,_0x538e81),{'saveTo':path[_0xb3d3('0x20')](_0x22edae,util[_0xb3d3('0xb')]('%s.%s',_0x538e81,_0xb3d3('0x26')))},function(_0xe4cace,_0x1884a2){rimraf(path['join'](_0x22edae,_0x538e81),function(){});_0x4c25db('zip\x20finished');});});}})[_0xb3d3('0x11')](function(){logger[_0xb3d3('0x27')](util[_0xb3d3('0xb')](_0xb3d3('0x28'),EXTRACTED_REPORT_ID,_0xb3d3('0xd')));return analyticExtractedReport(_0xb3d3('0x29'),_0x35aa89?util[_0xb3d3('0xb')](_0xb3d3('0x24'),_0x538e81,_0x35aa89?'zip':_0xb3d3('0x23')):null);});})[_0xb3d3('0x2a')](function(_0x41d388){logger[_0xb3d3('0x27')](util['format'](_0xb3d3('0x2b'),EXTRACTED_REPORT_ID,_0xb3d3('0xd')),util['inspect'](_0x41d388,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xb3d3('0x2c')](function(){process[_0xb3d3('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0e18=['length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','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','finally','util','path','lodash','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Empty','split'];(function(_0x328d12,_0x470323){var _0x3fed8b=function(_0x375508){while(--_0x375508){_0x328d12['push'](_0x328d12['shift']());}};_0x3fed8b(++_0x470323);}(_0x0e18,0x125));var _0x80e1=function(_0x4abe52,_0x346d7d){_0x4abe52=_0x4abe52-0x0;var _0x4f0fe8=_0x0e18[_0x4abe52];return _0x4f0fe8;};'use strict';var util=require(_0x80e1('0x0'));var path=require(_0x80e1('0x1'));var _=require(_0x80e1('0x2'));var fs=require('fs');var json2xls=require(_0x80e1('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x80e1('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x80e1('0x5'))[_0x80e1('0x6')];var logger=require(_0x80e1('0x7'))(_0x80e1('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x80e1('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b1697,_0xc5f2b2){var _0x493403={'status':_0x5b1697};var _0x3bad5f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc5f2b2){_0x493403[_0x80e1('0xa')]=_0xc5f2b2;}return db['AnalyticExtractedReport'][_0x80e1('0xb')](_0x493403,_0x3bad5f);}function main(){var _0x215880=0x1388;var _0x158871;logger[_0x80e1('0xc')](util['format'](_0x80e1('0xd'),EXTRACTED_REPORT_ID,_0x80e1('0xe')));return db[_0x80e1('0xf')][_0x80e1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x80e1('0x11')]})['then'](function(_0x32a649){if(_0x32a649){_0x158871=_0x32a649;_0x215880=_0x158871[_0x80e1('0x11')]||0x1388;}})[_0x80e1('0x12')](function(){return dbH[_0x80e1('0x13')][_0x80e1('0x14')](util[_0x80e1('0x15')](_0x80e1('0x16'),QUERY),{'type':dbH[_0x80e1('0x13')]['QueryTypes']['SELECT']});})[_0x80e1('0x12')](function(_0x23f84c){if(!_0x23f84c[0x0]['num']){return analyticExtractedReport(_0x80e1('0x17'));}var _0xac324a=[];var _0x573e5f=0x0;if(_0x158871[_0x80e1('0x18')]){if(_0x23f84c&&_0x23f84c[_0x80e1('0x19')]){var _0x299931=_[_0x80e1('0x1a')](_0x23f84c[0x0][_0x80e1('0x1b')]/_0x215880);var _0x915800=Number[_0x80e1('0x1c')](_0x23f84c[0x0][_0x80e1('0x1b')]/_0x215880)?_0x23f84c[0x0][_0x80e1('0x1b')]%_0x215880:0x0;_0x299931[_0x80e1('0x1d')](function(_0x3e8236){if(_0x3e8236>0x0){_0x573e5f+=_0x215880;}_0xac324a[_0x80e1('0x1e')](dbH[_0x80e1('0x13')][_0x80e1('0x14')](util[_0x80e1('0x15')](_0x80e1('0x1f'),QUERY,_0x215880,_0x573e5f),{'type':dbH['sequelize'][_0x80e1('0x20')][_0x80e1('0x21')]}));});if(_0x915800>0x0){_0x573e5f+=_0x215880;_0xac324a[_0x80e1('0x1e')](dbH[_0x80e1('0x13')][_0x80e1('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x915800,_0x573e5f),{'type':dbH[_0x80e1('0x13')][_0x80e1('0x20')][_0x80e1('0x21')]}));}}}else{_0xac324a['push'](dbH['sequelize'][_0x80e1('0x14')](QUERY,{'type':dbH[_0x80e1('0x13')][_0x80e1('0x20')][_0x80e1('0x21')]}));}var _0x372a5e=path[_0x80e1('0x22')](PATH);var _0x567035=path[_0x80e1('0x23')](PATH,'.xlsx');var _0x19f0bc=_0x158871[_0x80e1('0x18')]&&_0xac324a[_0x80e1('0x19')]>0x1;var _0x454346=[];if(!fs['existsSync'](path[_0x80e1('0x24')](_0x372a5e,_0x567035))&&_0x19f0bc){fs[_0x80e1('0x25')](path[_0x80e1('0x24')](_0x372a5e,_0x567035));}return BPromise[_0x80e1('0x26')](_0xac324a,function(_0x5de26b){_0x454346[_0x80e1('0x1e')](_0x5de26b);})[_0x80e1('0x12')](function(){for(var _0x4b6f2e=0x0;_0x4b6f2e<_0x454346[_0x80e1('0x19')];_0x4b6f2e+=0x1){var _0x392f6e;var _0x546865=_0x454346[_0x4b6f2e];if(_0x19f0bc){_0x392f6e=path[_0x80e1('0x24')](_0x372a5e,_0x567035,util['format'](_0x80e1('0x27'),_0x567035,_0x4b6f2e,_0x80e1('0x28')));}else{_0x392f6e=path[_0x80e1('0x24')](_0x372a5e,util[_0x80e1('0x15')](_0x80e1('0x29'),_0x567035,_0x80e1('0x28')));}fs[_0x80e1('0x2a')](_0x392f6e,json2xls(_0x546865),_0x80e1('0x2b'));}})[_0x80e1('0x12')](function(){if(_0x19f0bc){return new Promise(function(_0x34b0ba){zipdir(path['join'](_0x372a5e,_0x567035),{'saveTo':path['join'](_0x372a5e,util[_0x80e1('0x15')]('%s.%s',_0x567035,_0x80e1('0x2c')))},function(_0x5c5f1d,_0x2ecdbd){rimraf(path['join'](_0x372a5e,_0x567035),function(){});_0x34b0ba(_0x80e1('0x2d'));});});}})[_0x80e1('0x12')](function(){logger[_0x80e1('0xc')](util[_0x80e1('0x15')](_0x80e1('0x2e'),EXTRACTED_REPORT_ID,_0x80e1('0xe')));return analyticExtractedReport(_0x80e1('0x2f'),_0x19f0bc?util['format'](_0x80e1('0x29'),_0x567035,_0x19f0bc?_0x80e1('0x2c'):'xlsx'):null);});})[_0x80e1('0x30')](function(_0x1c2ec6){logger[_0x80e1('0xc')](util[_0x80e1('0x15')](_0x80e1('0x31'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x80e1('0x32')](_0x1c2ec6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x80e1('0x33'));})[_0x80e1('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index fb162bf..f1a6ea9 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 _0xda6e=['CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','hasOwnProperty','extensions','extension','find','type','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','push','Set','CDR(routeid)='];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xda6e,0x19e));var _0xeda6=function(_0x2d8f47,_0x4aa8d4){_0x2d8f47=_0x2d8f47-0x0;var _0x26cede=_0xda6e[_0x2d8f47];return _0x26cede;};'use strict';var _=require(_0xeda6('0x0'));var util=require(_0xeda6('0x1'));function rewrite(_0xe4b118,_0x193715){var _0x12b5ea=this;return _0xe4b118['models'][_0xeda6('0x2')][_0xeda6('0x3')]({'raw':!![]})[_0xeda6('0x4')](function(_0x3a62c1){_0x12b5ea[_0xeda6('0x5')]=_0x3a62c1;return _0xe4b118[_0xeda6('0x6')][_0xeda6('0x7')][_0xeda6('0x3')]({'where':{'IntervalId':_0x193715[_0xeda6('0x8')]},'raw':!![]});})[_0xeda6('0x4')](function(_0x1f54c4){return _0xe4b118[_0xeda6('0x6')]['VoiceExtension'][_0xeda6('0x3')]({'where':{'exten':{'$in':_[_0xeda6('0x9')](_[_0xeda6('0xa')](_0x1f54c4,'exten'))}},'order':[{'raw':_0xeda6('0xb')}],'raw':!![]});})[_0xeda6('0x4')](function(_0xdf375f){var _0x3e7534=_['filter'](_0xdf375f,{'priority':'1'});var _0x3c1acd=_[_0xeda6('0xc')](_0xdf375f,{'isApp':0x1});var _0x1cd600=_[_0xeda6('0xd')](_0x3c1acd,_0xeda6('0xe'));var _0x8d6a98=['queue',_0xeda6('0xf')];var _0x1748a5=[];var _0x886e64=[];for(var _0x43e2b4 in _0x1cd600){if(_0x1cd600[_0xeda6('0x10')](_0x43e2b4)){_0x12b5ea['priority']=0x2;_0x12b5ea[_0xeda6('0x11')]=[];_0x12b5ea[_0xeda6('0x12')]=_[_0xeda6('0x13')](_0x3e7534,{'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')]});_0x12b5ea['extensions']['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':'Set','appdata':util[_0xeda6('0x15')](_0xeda6('0x16'),_0x1cd600[_0x43e2b4][0x0]['type']),'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});if(_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')]===_0xeda6('0x1a')){_0x12b5ea[_0xeda6('0x11')][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':_0xeda6('0x1c'),'appdata':_0xeda6('0x1d')+_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')],'context':_0x1cd600[_0x43e2b4][0x0]['context'],'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});}else if(_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')]==='outbound'){if(_0x12b5ea[_0xeda6('0x12')]){_0x12b5ea[_0xeda6('0x11')]['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':'Set','appdata':_0xeda6('0x1e')+(_0x12b5ea['extension'][_0xeda6('0x1f')]?'${EXTEN:'+_0x12b5ea['extension']['cutdigits']+'}':_0xeda6('0x20')),'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});}_0x12b5ea['extensions'][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':'Set','appdata':_0xeda6('0x1d')+_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')],'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea['priority']++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});var _0x49e4d8=_0x12b5ea[_0xeda6('0x18')]++;_0x12b5ea['extensions'][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0]['type'],'app':_0xeda6('0x21'),'appdata':_0xeda6('0x22')+(_0x49e4d8+0x2)+_0xeda6('0x23')+(_0x49e4d8+0x1)+')','context':_0x1cd600[_0x43e2b4][0x0]['context'],'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'priority':_0x49e4d8,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});if(_0x12b5ea[_0xeda6('0x12')]){_0x12b5ea['extensions'][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0]['type'],'app':_0xeda6('0x1c'),'appdata':_0x12b5ea[_0xeda6('0x12')][_0xeda6('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x12b5ea[_0xeda6('0x12')][_0xeda6('0x1f')]+'}':_0xeda6('0x24'),'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});}_0x12b5ea[_0xeda6('0x11')][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':_0xeda6('0x1c'),'appdata':_0xeda6('0x25')+_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')],'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0]['VoiceExtensionId']});if(_0x12b5ea[_0xeda6('0x12')]&&_0x12b5ea[_0xeda6('0x12')][_0xeda6('0x10')](_0xeda6('0x26'))&&_0x12b5ea['extension'][_0xeda6('0x26')]!==_0xeda6('0x27')){_0x12b5ea[_0xeda6('0x11')]['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':_0xeda6('0x1c'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});_0x12b5ea[_0xeda6('0x11')]['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':'Set','appdata':_0xeda6('0x28')+_0x12b5ea[_0xeda6('0x12')][_0xeda6('0x26')]||_0xeda6('0x29'),'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});}}_0x12b5ea[_0xeda6('0x11')]['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':_0xeda6('0x1c'),'appdata':_0xeda6('0x2a'),'context':_0x1cd600[_0x43e2b4][0x0]['context'],'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'priority':_0x12b5ea['priority']++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});_0x12b5ea[_0xeda6('0x11')][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':'Set','appdata':_0xeda6('0x2b'),'context':_0x1cd600[_0x43e2b4][0x0]['context'],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0]['VoiceExtensionId']});_0x12b5ea[_0xeda6('0x11')][_0xeda6('0x1b')]({'type':_0x1cd600[_0x43e2b4][0x0]['type'],'app':_0xeda6('0x1c'),'appdata':_0xeda6('0x2c'),'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'exten':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0xe')],'priority':_0x12b5ea[_0xeda6('0x18')]++,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});for(var _0x35108f=0x0,_0x26e7b4=0x0;_0x35108f<_0x1cd600[_0x43e2b4][_0xeda6('0x2d')];_0x35108f+=0x1,_0x26e7b4=0x0){var _0x4c11b7=_0x1cd600[_0x43e2b4][_0x35108f];if(_0x4c11b7['type']){_0x4c11b7[_0xeda6('0x14')]=_0x4c11b7['type'][_0xeda6('0x2e')]();}var _0x11e5f4=[];var _0x2f4cda=[];delete _0x4c11b7['id'];delete _0x4c11b7['createdAt'];delete _0x4c11b7[_0xeda6('0x2f')];var _0x585364=_0x4c11b7[_0xeda6('0x30')]!==_0xeda6('0x31')?[_0x4c11b7[_0xeda6('0x30')]]:_0x4c11b7[_0xeda6('0x8')]?_['map'](_['filter'](_0x12b5ea[_0xeda6('0x5')],{'IntervalId':_0x4c11b7['IntervalId']}),_0xeda6('0x30')):[];if(_0x4c11b7[_0xeda6('0x10')](_0xeda6('0x32'))){if(_0x4c11b7[_0xeda6('0x32')]&&_0x4c11b7[_0xeda6('0x32')]!=='--'){_0x11e5f4[_0xeda6('0x1b')]({'type':_0x4c11b7['type'],'app':_0xeda6('0x1c'),'appdata':'CDR(tag)='+_0x4c11b7['tag'],'context':_0x4c11b7[_0xeda6('0x17')],'exten':_0x4c11b7[_0xeda6('0xe')],'priority':_0x585364[_0xeda6('0x2d')]+_0x12b5ea[_0xeda6('0x18')]+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});}}if(_0x4c11b7['type']===_0xeda6('0x33')&&_0x4c11b7[_0xeda6('0x10')](_0xeda6('0x34'))){if(_0x4c11b7['callerID']){_0x11e5f4[_0xeda6('0x1b')]({'type':_0x4c11b7[_0xeda6('0x14')],'app':_0xeda6('0x21'),'appdata':_0xeda6('0x35')+_0x4c11b7[_0xeda6('0x34')]+')','context':_0x4c11b7['context'],'exten':_0x4c11b7[_0xeda6('0xe')],'priority':_0x585364['length']+_0x12b5ea[_0xeda6('0x18')]+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});}else{_0x11e5f4[_0xeda6('0x1b')]({'type':_0x4c11b7[_0xeda6('0x14')],'app':_0xeda6('0x21'),'appdata':_0xeda6('0x36'),'context':_0x4c11b7[_0xeda6('0x17')],'exten':_0x4c11b7[_0xeda6('0xe')],'priority':_0x585364[_0xeda6('0x2d')]+_0x12b5ea[_0xeda6('0x18')]+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});}}if(_0x4c11b7[_0xeda6('0x10')](_0xeda6('0x37'))){if(_0x8d6a98[_0xeda6('0x38')](_0x4c11b7[_0xeda6('0x39')]['toLowerCase']())>=0x0&&_0x4c11b7[_0xeda6('0x3a')]!=='custom'){if(_0x4c11b7[_0xeda6('0x37')]){_0x11e5f4[_0xeda6('0x1b')]({'type':_0x4c11b7['type'],'app':_0xeda6('0x21'),'appdata':_0xeda6('0x3b'),'context':_0x4c11b7[_0xeda6('0x17')],'exten':_0x4c11b7[_0xeda6('0xe')],'priority':_0x585364['length']+_0x12b5ea['priority']+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});_0x11e5f4['push']({'type':_0x4c11b7[_0xeda6('0x14')],'app':'Set','appdata':_0xeda6('0x3c'),'context':_0x4c11b7['context'],'exten':_0x4c11b7['exten'],'priority':_0x585364[_0xeda6('0x2d')]+_0x12b5ea[_0xeda6('0x18')]+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});}else{_0x11e5f4['push']({'type':_0x4c11b7[_0xeda6('0x14')],'app':_0xeda6('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4c11b7[_0xeda6('0x17')],'exten':_0x4c11b7['exten'],'priority':_0x585364[_0xeda6('0x2d')]+_0x12b5ea['priority']+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});_0x11e5f4[_0xeda6('0x1b')]({'type':_0x4c11b7[_0xeda6('0x14')],'app':_0xeda6('0x1c'),'appdata':_0xeda6('0x3d'),'context':_0x4c11b7[_0xeda6('0x17')],'exten':_0x4c11b7[_0xeda6('0xe')],'priority':_0x585364[_0xeda6('0x2d')]+_0x12b5ea['priority']+_0x26e7b4++,'VoiceExtensionId':_0x4c11b7[_0xeda6('0x19')]});}}}for(var _0x1cf4bd=0x0;_0x1cf4bd<_0x585364[_0xeda6('0x2d')];_0x1cf4bd+=0x1){var _0x1d68ca=_0x12b5ea[_0xeda6('0x18')]+_0x585364[_0xeda6('0x2d')];var _0x5a1450=_0x1cf4bd===_0x585364[_0xeda6('0x2d')]-0x1?_0x12b5ea[_0xeda6('0x18')]+_0x11e5f4['length']+_0x2f4cda[_0xeda6('0x2d')]+0x2:_0x12b5ea[_0xeda6('0x18')]+_0x1cf4bd+0x1;_0x11e5f4[_0xeda6('0x3e')](_0x1cf4bd,0x0,{'type':_0x4c11b7['type'],'app':_0xeda6('0x3f'),'appdata':_0x585364[_0x1cf4bd]+'?'+_0x4c11b7['context']+_0xeda6('0x40')+_0x1d68ca+':'+_0x4c11b7[_0xeda6('0x17')]+_0xeda6('0x40')+_0x5a1450,'exten':_0x4c11b7['exten'],'context':_0x4c11b7['context'],'priority':_0x12b5ea[_0xeda6('0x18')]+_0x1cf4bd,'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});}_0x4c11b7[_0xeda6('0x18')]=_0x11e5f4[_0xeda6('0x2d')]?_[_0xeda6('0x41')](_0x11e5f4)['priority']+0x1:_0x12b5ea['priority'];_0x12b5ea['priority']=(_0x2f4cda[_0xeda6('0x2d')]?_['last'](_0x2f4cda)[_0xeda6('0x18')]:_0x4c11b7['priority'])+0x1;_0x12b5ea[_0xeda6('0x11')]=_[_0xeda6('0x42')](_0x12b5ea[_0xeda6('0x11')],_0x11e5f4,[_0x4c11b7],_0x2f4cda);}_0x12b5ea[_0xeda6('0x11')]['push']({'type':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x14')],'app':_0xeda6('0x43'),'exten':_0x1cd600[_0x43e2b4][0x0]['exten'],'context':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x17')],'priority':_0x12b5ea[_0xeda6('0x18')],'VoiceExtensionId':_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]});_0x1748a5[_0xeda6('0x1b')](_0x1cd600[_0x43e2b4][0x0][_0xeda6('0x19')]);_0x886e64=_[_0xeda6('0x42')](_0x886e64,_0x12b5ea[_0xeda6('0x11')]);}}return _0xe4b118['transaction'](function(_0x480ec6){return _0xe4b118[_0xeda6('0x6')][_0xeda6('0x7')][_0xeda6('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x1748a5}},'transaction':_0x480ec6})[_0xeda6('0x4')](function(_0x4b971e){return _0xe4b118['models'][_0xeda6('0x7')][_0xeda6('0x45')](_[_0xeda6('0x46')](_0x886e64,_0xeda6('0x18')),{'transaction':_0x480ec6});});});})[_0xeda6('0x47')](function(_0x2ec2d6){console[_0xeda6('0x48')](_0x2ec2d6);});}exports[_0xeda6('0x49')]=rewrite; \ No newline at end of file +var _0xa4b0=['CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','CDR(tag)=','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','catch','rewrite','util','Interval','findAll','then','intervals','models','IntervalId','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','format','context','VoiceExtensionId','inbound','outbound','${EXTEN:','cutdigits','${EXTEN}','Set'];(function(_0x4d0b1f,_0x3e9d04){var _0xde9596=function(_0x2beec4){while(--_0x2beec4){_0x4d0b1f['push'](_0x4d0b1f['shift']());}};_0xde9596(++_0x3e9d04);}(_0xa4b0,0xb0));var _0x0a4b=function(_0x14e2e2,_0x16fd14){_0x14e2e2=_0x14e2e2-0x0;var _0x396e58=_0xa4b0[_0x14e2e2];return _0x396e58;};'use strict';var _=require('lodash');var util=require(_0x0a4b('0x0'));function rewrite(_0x13bfaa,_0x2b0d8a){var _0x2fd12d=this;return _0x13bfaa['models'][_0x0a4b('0x1')][_0x0a4b('0x2')]({'raw':!![]})[_0x0a4b('0x3')](function(_0xd6e7dc){_0x2fd12d[_0x0a4b('0x4')]=_0xd6e7dc;return _0x13bfaa[_0x0a4b('0x5')]['VoiceExtension'][_0x0a4b('0x2')]({'where':{'IntervalId':_0x2b0d8a[_0x0a4b('0x6')]},'raw':!![]});})[_0x0a4b('0x3')](function(_0x109425){return _0x13bfaa[_0x0a4b('0x5')]['VoiceExtension'][_0x0a4b('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0x0a4b('0x7')](_0x109425,_0x0a4b('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x3e3eb6){var _0x4a712e=_['filter'](_0x3e3eb6,{'priority':'1'});var _0x139087=_[_0x0a4b('0x9')](_0x3e3eb6,{'isApp':0x1});var _0x37be4b=_[_0x0a4b('0xa')](_0x139087,_0x0a4b('0x8'));var _0x5bb89e=[_0x0a4b('0xb'),_0x0a4b('0xc')];var _0x5148e4=[];var _0x4651a6=[];for(var _0x48709a in _0x37be4b){if(_0x37be4b[_0x0a4b('0xd')](_0x48709a)){_0x2fd12d[_0x0a4b('0xe')]=0x2;_0x2fd12d[_0x0a4b('0xf')]=[];_0x2fd12d[_0x0a4b('0x10')]=_['find'](_0x4a712e,{'exten':_0x37be4b[_0x48709a][0x0]['exten']});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':util[_0x0a4b('0x13')]('CDR(type)=%s',_0x37be4b[_0x48709a][0x0]['type']),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')]===_0x0a4b('0x16')){_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}else if(_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')]===_0x0a4b('0x17')){if(_0x2fd12d[_0x0a4b('0x10')]){_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':'CDR(destination)='+(_0x2fd12d[_0x0a4b('0x10')]['cutdigits']?_0x0a4b('0x18')+_0x2fd12d['extension'][_0x0a4b('0x19')]+'}':_0x0a4b('0x1a')),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x1c')+_0x37be4b[_0x48709a][0x0]['VoiceExtensionId'],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});var _0x44ed9f=_0x2fd12d['priority']++;_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'ExecIf','appdata':_0x0a4b('0x1d')+(_0x44ed9f+0x2)+_0x0a4b('0x1e')+(_0x44ed9f+0x1)+')','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x44ed9f,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x2fd12d['extension']){_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':_0x2fd12d[_0x0a4b('0x10')][_0x0a4b('0x19')]?_0x0a4b('0x1f')+_0x2fd12d[_0x0a4b('0x10')]['cutdigits']+'}':_0x0a4b('0x20'),'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x21')+_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')],'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x2fd12d[_0x0a4b('0x10')]&&_0x2fd12d[_0x0a4b('0x10')]['hasOwnProperty'](_0x0a4b('0x22'))&&_0x2fd12d['extension'][_0x0a4b('0x22')]!=='none'){_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':_0x0a4b('0x23'),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x24')+_0x2fd12d[_0x0a4b('0x10')][_0x0a4b('0x22')]||_0x0a4b('0x25'),'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});}}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x26'),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':'MONITOR_OPTIONS=ab','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});for(var _0x294d74=0x0,_0x154a46=0x0;_0x294d74<_0x37be4b[_0x48709a][_0x0a4b('0x27')];_0x294d74+=0x1,_0x154a46=0x0){var _0xdd1a28=_0x37be4b[_0x48709a][_0x294d74];if(_0xdd1a28[_0x0a4b('0x12')]){_0xdd1a28[_0x0a4b('0x12')]=_0xdd1a28[_0x0a4b('0x12')][_0x0a4b('0x28')]();}var _0x4d2ca7=[];var _0x5b530b=[];delete _0xdd1a28['id'];delete _0xdd1a28[_0x0a4b('0x29')];delete _0xdd1a28[_0x0a4b('0x2a')];var _0x20867d=_0xdd1a28['interval']!==_0x0a4b('0x2b')?[_0xdd1a28[_0x0a4b('0x2c')]]:_0xdd1a28['IntervalId']?_['map'](_[_0x0a4b('0x9')](_0x2fd12d[_0x0a4b('0x4')],{'IntervalId':_0xdd1a28[_0x0a4b('0x6')]}),_0x0a4b('0x2c')):[];if(_0xdd1a28['hasOwnProperty']('tag')){if(_0xdd1a28['tag']&&_0xdd1a28['tag']!=='--'){_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x2d')+_0xdd1a28[_0x0a4b('0x2e')],'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d['length']+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28['VoiceExtensionId']});}}if(_0xdd1a28['type']===_0x0a4b('0x17')&&_0xdd1a28['hasOwnProperty'](_0x0a4b('0x2f'))){if(_0xdd1a28[_0x0a4b('0x2f')]){_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x30'),'appdata':_0x0a4b('0x31')+_0xdd1a28['callerID']+')','context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28['exten'],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}else{_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28['type'],'app':'ExecIf','appdata':_0x0a4b('0x32'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28['VoiceExtensionId']});}}if(_0xdd1a28['hasOwnProperty'](_0x0a4b('0x33'))){if(_0x5bb89e[_0x0a4b('0x34')](_0xdd1a28[_0x0a4b('0x35')][_0x0a4b('0x28')]())>=0x0&&_0xdd1a28['appType']!==_0x0a4b('0x36')){if(_0xdd1a28[_0x0a4b('0x33')]){_0x4d2ca7['push']({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x30'),'appdata':_0x0a4b('0x37'),'context':_0xdd1a28['context'],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});_0x4d2ca7['push']({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x38'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}else{_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':'ExecIf','appdata':_0x0a4b('0x39'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28['exten'],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28['type'],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x3a'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}}}for(var _0x112092=0x0;_0x112092<_0x20867d[_0x0a4b('0x27')];_0x112092+=0x1){var _0x4fa54d=_0x2fd12d[_0x0a4b('0xe')]+_0x20867d[_0x0a4b('0x27')];var _0x58f285=_0x112092===_0x20867d[_0x0a4b('0x27')]-0x1?_0x2fd12d[_0x0a4b('0xe')]+_0x4d2ca7['length']+_0x5b530b[_0x0a4b('0x27')]+0x2:_0x2fd12d[_0x0a4b('0xe')]+_0x112092+0x1;_0x4d2ca7['splice'](_0x112092,0x0,{'type':_0xdd1a28['type'],'app':'GotoIfTime','appdata':_0x20867d[_0x112092]+'?'+_0xdd1a28[_0x0a4b('0x14')]+_0x0a4b('0x3b')+_0x4fa54d+':'+_0xdd1a28['context']+_0x0a4b('0x3b')+_0x58f285,'exten':_0xdd1a28[_0x0a4b('0x8')],'context':_0xdd1a28[_0x0a4b('0x14')],'priority':_0x2fd12d[_0x0a4b('0xe')]+_0x112092,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}_0xdd1a28[_0x0a4b('0xe')]=_0x4d2ca7[_0x0a4b('0x27')]?_[_0x0a4b('0x3c')](_0x4d2ca7)['priority']+0x1:_0x2fd12d[_0x0a4b('0xe')];_0x2fd12d[_0x0a4b('0xe')]=(_0x5b530b['length']?_[_0x0a4b('0x3c')](_0x5b530b)[_0x0a4b('0xe')]:_0xdd1a28[_0x0a4b('0xe')])+0x1;_0x2fd12d[_0x0a4b('0xf')]=_[_0x0a4b('0x3d')](_0x2fd12d[_0x0a4b('0xf')],_0x4d2ca7,[_0xdd1a28],_0x5b530b);}_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x3e'),'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'priority':_0x2fd12d[_0x0a4b('0xe')],'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x5148e4['push'](_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]);_0x4651a6=_[_0x0a4b('0x3d')](_0x4651a6,_0x2fd12d[_0x0a4b('0xf')]);}}return _0x13bfaa[_0x0a4b('0x3f')](function(_0x5872c8){return _0x13bfaa[_0x0a4b('0x5')][_0x0a4b('0x40')][_0x0a4b('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x5148e4}},'transaction':_0x5872c8})[_0x0a4b('0x3')](function(_0x29816d){return _0x13bfaa[_0x0a4b('0x5')][_0x0a4b('0x40')]['bulkCreate'](_['sortBy'](_0x4651a6,'priority'),{'transaction':_0x5872c8});});});})[_0x0a4b('0x42')](function(_0x5a550c){console['error'](_0x5a550c);});}exports[_0x0a4b('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 7af562d..53d6145 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 _0x226b=['cm_hopper','scheduledAt','select','field','ContactId','toString','NOW()','createdAt','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','into','fromQuery','id\x20IN\x20?','str','\x20=\x20?','phone\x20NOT\x20IN\x20(?)','insert','cm_hopper_black','VoiceQueue','outbound','CmList','always','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','findAll','get','Campaign','dialCheckDuplicateType','Lists','BlackLists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','split','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','email','ListId','CompanyId','find','CmContact','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect'];(function(_0x5ec25d,_0x286edc){var _0x468ab5=function(_0x42ff95){while(--_0x42ff95){_0x5ec25d['push'](_0x5ec25d['shift']());}};_0x468ab5(++_0x286edc);}(_0x226b,0x113));var _0xb226=function(_0xc6d578,_0x2067fa){_0xc6d578=_0xc6d578-0x0;var _0x4f35b0=_0x226b[_0xc6d578];return _0x4f35b0;};'use strict';var BPromise=require(_0xb226('0x0'));var util=require(_0xb226('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xb226('0x2'));var Papa=require(_0xb226('0x3'));var Redis=require(_0xb226('0x4'));var db=require(_0xb226('0x5'))['db'];var config=require(_0xb226('0x6'));var logger=require('../../../config/logger')(_0xb226('0x7'));config[_0xb226('0x8')]=_[_0xb226('0x9')](config['redis'],{'host':_0xb226('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb226('0x8')]));require(_0xb226('0xb'))[_0xb226('0xc')](socket);try{if(!process[_0xb226('0xd')][0x2]||process['argv'][0x2]===_0xb226('0xe')||process['argv'][0x2]==='null'){throw new Error(_0xb226('0xf'));}var FILEPATH=process[_0xb226('0xd')][0x2];if(!process['argv'][0x3]||process[_0xb226('0xd')][0x3]===_0xb226('0xe')||process[_0xb226('0xd')][0x3]===_0xb226('0x10')||!process[_0xb226('0xd')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0xb226('0x10')){throw new Error(_0xb226('0x11'));}var FIELDS=_['zipObject'](process[_0xb226('0xd')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0xb226('0xd')][0x5]||process[_0xb226('0xd')][0x5]==='undefined'||process['argv'][0x5]===_0xb226('0x10')){throw new Error(_0xb226('0x12'));}var LISTID=process[_0xb226('0xd')][0x5];var COMPANYID=process[_0xb226('0xd')][0x6]&&process[_0xb226('0xd')][0x6]!==_0xb226('0xe')&&process[_0xb226('0xd')][0x6]!==_0xb226('0x10')?process[_0xb226('0xd')][0x6]:null;var DUPLICATES=process[_0xb226('0xd')][0x7]&&process[_0xb226('0xd')][0x7]!==_0xb226('0xe')&&process[_0xb226('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xb226('0xd')][0x8]||process[_0xb226('0xd')][0x8]==='undefined'||process['argv'][0x8]==='null'){throw new Error(_0xb226('0x13'));}var SOCKET_TIMESTAMP=process[_0xb226('0xd')][0x8];}catch(_0x39fdf6){logger[_0xb226('0x14')](_0x39fdf6);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(_0xee501d,_0x425f5d,_0x3fcc60,_0x4032ad){var _0x11ffcf={'message':_0x425f5d};_0x11ffcf[_0xee501d]=!![];if(_0x3fcc60){_0x11ffcf[_0xb226('0x15')]=_0x3fcc60;}if(_0x4032ad){_0x11ffcf[_0xb226('0x16')]=_0x4032ad;}return _0x11ffcf;}function isEmail(_0x56cd88){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x56cd88);}function checkRow(_0x1ca528,_0x5a728d,_0x355ab2){return new BPromise(function(_0x5c048f,_0x5d5f96){if(_['isNil'](_0x1ca528)){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x355ab2));}if(_0x1ca528['errors']&&_0x1ca528[_0xb226('0x17')][_0xb226('0x18')]){var _0x5a10c9=_['map'](_0x1ca528['errors'],_0xb226('0x19'))[_0xb226('0x1a')](';');return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),_0x5a10c9,null,_0x355ab2));}var _0x115fe1={};for(var _0x4e6404 in FIELDS){if(FIELDS[_0xb226('0x1b')](_0x4e6404)&&FIELDS[_0x4e6404]){_0x115fe1[_0x4e6404]=_0x1ca528['data'][0x0][FIELDS[_0x4e6404]]||_0x1ca528[_0xb226('0x1c')][0x0]['\ufeff'+FIELDS[_0x4e6404]];}}if(!_0x115fe1[_0xb226('0x1d')]){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),_0xb226('0x1e'),null,_0x355ab2));}if(!_0x115fe1[_0xb226('0x1f')]){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),_0xb226('0x20'),null,_0x355ab2));}if(_0x115fe1[_0xb226('0x21')]){var _0x563783=moment(_0x115fe1['birthDate'],'YYYY-MM-DD');if(!_0x563783[_0xb226('0x22')]()){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x355ab2));}}if(_0x115fe1[_0xb226('0x23')]){if(!isEmail(_0x115fe1[_0xb226('0x23')])){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),'email\x20format\x20is\x20not\x20valid!',null,_0x355ab2));}}_0x115fe1[_0xb226('0x24')]=LISTID;_0x115fe1[_0xb226('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb226('0x18')]&&_0x5a728d){var _0x3326dc={};for(var _0x4e6d56=0x0,_0x3003af=DUPLICATES[_0xb226('0x18')];_0x4e6d56<_0x3003af;_0x4e6d56+=0x1){_0x3326dc[DUPLICATES[_0x4e6d56]]=_0x115fe1[DUPLICATES[_0x4e6d56]];}var _0x8807fd=_[_0xb226('0x26')](_0x5a728d,_0x3326dc);if(_0x8807fd){return _0x5d5f96(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x8807fd,_0x355ab2));}}return db[_0xb226('0x27')][_0xb226('0x28')](_0x115fe1,{'raw':!![],'hooks':![],'fields':_[_0xb226('0x29')](_0x115fe1)})[_0xb226('0x2a')](function(_0x2e09f9){if(DUPLICATES&&DUPLICATES['length']&&_0x5a728d){_0x5a728d['push'](_[_0xb226('0x2b')](_0x115fe1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2e09f9['id'];return _0x5c048f();})[_0xb226('0x2c')](function(_0x5792f3){return _0x5d5f96(handleCheckRowError(_0xb226('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5792f3[_0xb226('0x19')]||JSON[_0xb226('0x2d')](_0x5792f3)),null,_0x355ab2));});});}function checkHopper(){function _0x5d7251(){return function(_0x1c5b6f){logger[_0xb226('0x14')](_0xb226('0x2e'),_0xb226('0x2f'),util[_0xb226('0x30')](_0x1c5b6f,{'showHidden':![],'depth':null}));};}var _0x5398e8=function(_0x39b2df,_0x37ef3d){var _0x269a35=squel['insert']()['into'](_0xb226('0x31'))['fromQuery'](['phone',_0xb226('0x32'),'ContactId',_0xb226('0x24'),_0x37ef3d,'createdAt','updatedAt'],squel[_0xb226('0x33')]()['field'](_0xb226('0x1f'),_0xb226('0x1f'))['field']('NOW()',_0xb226('0x32'))[_0xb226('0x34')]('id',_0xb226('0x35'))[_0xb226('0x34')](LISTID['toString'](),_0xb226('0x24'))[_0xb226('0x34')](_0x39b2df['id'][_0xb226('0x36')](),_0x37ef3d)['field'](_0xb226('0x37'),_0xb226('0x38'))[_0xb226('0x34')]('NOW()',_0xb226('0x39'))[_0xb226('0x3a')](_0xb226('0x3b'))['where'](_0xb226('0x3c'))[_0xb226('0x3d')](_0xb226('0x3e'),LISTID[_0xb226('0x36')]())[_0xb226('0x3d')](_0xb226('0x3f'))[_0xb226('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb226('0x34')](_0xb226('0x1f'))['from'](_0xb226('0x31'))[_0xb226('0x3d')](_0x37ef3d+'\x20=\x20?',_0x39b2df['id'][_0xb226('0x36')]())))[_0xb226('0x36')]();return _0x269a35;};var _0x1a777c=function(_0x3cb87c,_0x1ea3fa){var _0x180a51=squel['insert']()[_0xb226('0x40')](_0xb226('0x31'))[_0xb226('0x41')]([_0xb226('0x1f'),'scheduledAt',_0xb226('0x35'),_0xb226('0x24'),_0x1ea3fa,_0xb226('0x38'),_0xb226('0x39')],squel['select']()[_0xb226('0x34')](_0xb226('0x1f'),_0xb226('0x1f'))[_0xb226('0x34')](_0xb226('0x37'),_0xb226('0x32'))[_0xb226('0x34')]('id',_0xb226('0x35'))[_0xb226('0x34')](LISTID['toString'](),_0xb226('0x24'))[_0xb226('0x34')](_0x3cb87c['id']['toString'](),_0x1ea3fa)[_0xb226('0x34')](_0xb226('0x37'),'createdAt')[_0xb226('0x34')](_0xb226('0x37'),_0xb226('0x39'))[_0xb226('0x3a')]('cm_contacts')[_0xb226('0x3d')]('deletedAt\x20IS\x20NULL')[_0xb226('0x3d')]('ListId\x20=\x20?',LISTID[_0xb226('0x36')]())[_0xb226('0x3d')](_0xb226('0x42'),squel[_0xb226('0x43')](hopperContacts))[_0xb226('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xb226('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb226('0x33')]()[_0xb226('0x34')]('calleridnum')[_0xb226('0x3a')]('cm_hopper_final')[_0xb226('0x3d')](_0x1ea3fa+_0xb226('0x44'),_0x3cb87c['id'][_0xb226('0x36')]()))['where'](_0xb226('0x45'),squel[_0xb226('0x33')]()[_0xb226('0x34')](_0xb226('0x1f'))[_0xb226('0x3a')](_0xb226('0x31'))['where'](_0x1ea3fa+_0xb226('0x44'),_0x3cb87c['id'][_0xb226('0x36')]())))[_0xb226('0x36')]();return _0x180a51;};function _0x505407(_0x59814b,_0x445241){var _0x296e2b=squel[_0xb226('0x46')]()['into'](_0xb226('0x31'))[_0xb226('0x41')](['phone','scheduledAt',_0xb226('0x35'),_0xb226('0x24'),_0x445241,_0xb226('0x38'),_0xb226('0x39')],squel[_0xb226('0x33')]()['field']('phone',_0xb226('0x1f'))[_0xb226('0x34')]('NOW()',_0xb226('0x32'))[_0xb226('0x34')]('id',_0xb226('0x35'))[_0xb226('0x34')](LISTID[_0xb226('0x36')](),'ListId')[_0xb226('0x34')](_0x59814b['id'][_0xb226('0x36')](),_0x445241)['field'](_0xb226('0x37'),_0xb226('0x38'))['field'](_0xb226('0x37'),_0xb226('0x39'))[_0xb226('0x3a')](_0xb226('0x3b'))[_0xb226('0x3d')](_0xb226('0x3c'))['where'](_0xb226('0x3e'),LISTID[_0xb226('0x36')]())[_0xb226('0x3d')](_0xb226('0x42'),squel[_0xb226('0x43')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb226('0x36')]();return _0x296e2b;}function _0x1cbcb5(_0xfa41d4,_0x8fd0fc){var _0x51bd93=squel[_0xb226('0x46')]()[_0xb226('0x40')](_0xb226('0x47'))['fromQuery']([_0xb226('0x1f'),_0xb226('0x35'),_0xb226('0x24'),_0x8fd0fc,_0xb226('0x38'),_0xb226('0x39')],squel[_0xb226('0x33')]()[_0xb226('0x34')]('phone',_0xb226('0x1f'))[_0xb226('0x34')]('id',_0xb226('0x35'))[_0xb226('0x34')](LISTID[_0xb226('0x36')](),_0xb226('0x24'))[_0xb226('0x34')](_0xfa41d4['id'][_0xb226('0x36')](),_0x8fd0fc)['field'](_0xb226('0x37'),_0xb226('0x38'))[_0xb226('0x34')](_0xb226('0x37'),_0xb226('0x39'))[_0xb226('0x3a')](_0xb226('0x3b'))[_0xb226('0x3d')](_0xb226('0x3c'))[_0xb226('0x3d')](_0xb226('0x3e'),LISTID[_0xb226('0x36')]())[_0xb226('0x3d')]('id\x20IN\x20?',squel[_0xb226('0x43')](hopperContacts))['where'](_0xb226('0x3f')))[_0xb226('0x36')]();return _0x51bd93;}return db[_0xb226('0x48')]['findAll']({'where':{'type':_0xb226('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb226('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0xb226('0x2a')](function(_0x5a9458){var _0x3a3762=[];if(_0x5a9458){var _0x3af848;for(var _0x521e2d=0x0,_0x5c0221;_0x521e2d<_0x5a9458[_0xb226('0x18')];_0x521e2d+=0x1){_0x5c0221=_0x5a9458[_0x521e2d]['get']({'plain':!![]});switch(_0x5c0221['dialCheckDuplicateType']){case _0xb226('0x4b'):_0x3a3762['push'](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x1a777c(_0x5c0221,_0xb226('0x4e')))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));break;case _0xb226('0x4f'):_0x3a3762[_0xb226('0x50')](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x5398e8(_0x5c0221,_0xb226('0x4e')))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));break;default:_0x3a3762[_0xb226('0x50')](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x505407(_0x5c0221,'VoiceQueueId'))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));}}}return _0x3a3762;})[_0xb226('0x51')]()[_0xb226('0x2a')](function(){return db['VoiceQueue'][_0xb226('0x52')]({'where':{'type':_0xb226('0x49')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb226('0x2a')](function(_0x4f94d){var _0x4eba88=[];if(_0x4f94d){var _0x60e782;for(var _0x116625=0x0,_0xdcfd6c;_0x116625<_0x4f94d[_0xb226('0x18')];_0x116625+=0x1){_0xdcfd6c=_0x4f94d[_0x116625][_0xb226('0x53')]({'plain':!![]});_0x4eba88['push'](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x1cbcb5(_0xdcfd6c,'VoiceQueueId'))['then'](function(){})[_0xb226('0x2c')](_0x5d7251()));}}return _0x4eba88;})[_0xb226('0x51')]();})[_0xb226('0x2a')](function(){return db[_0xb226('0x54')][_0xb226('0x52')]({'attributes':['id',_0xb226('0x55')],'include':[{'model':db[_0xb226('0x4a')],'as':_0xb226('0x56'),'where':{'id':LISTID}}]})[_0xb226('0x2a')](function(_0x451674){var _0x2a3ab1=[];if(_0x451674){for(var _0xf7c4de=0x0,_0x1df8f0;_0xf7c4de<_0x451674[_0xb226('0x18')];_0xf7c4de+=0x1){_0x1df8f0=_0x451674[_0xf7c4de][_0xb226('0x53')]({'plain':!![]});switch(_0x1df8f0[_0xb226('0x55')]){case'always':_0x2a3ab1['push'](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x1a777c(_0x1df8f0,'CampaignId'))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));break;case'onlyIfOpen':_0x2a3ab1[_0xb226('0x50')](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x5398e8(_0x1df8f0,'CampaignId'))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));break;default:_0x2a3ab1[_0xb226('0x50')](db[_0xb226('0x4c')][_0xb226('0x4d')](_0x505407(_0x1df8f0,'CampaignId'))['then'](function(){})[_0xb226('0x2c')](_0x5d7251()));}}}return _0x2a3ab1;})[_0xb226('0x51')]();})[_0xb226('0x2a')](function(){return db[_0xb226('0x54')][_0xb226('0x52')]({'attributes':['id'],'include':[{'model':db[_0xb226('0x4a')],'as':_0xb226('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3f063e){var _0x27dba1=[];if(_0x3f063e){for(var _0x266e8b=0x0,_0x5a2302;_0x266e8b<_0x3f063e['length'];_0x266e8b+=0x1){_0x5a2302=_0x3f063e[_0x266e8b]['get']({'plain':!![]});_0x27dba1[_0xb226('0x50')](db['sequelize'][_0xb226('0x4d')](_0x1cbcb5(_0x5a2302,_0xb226('0x58')))[_0xb226('0x2a')](function(){})[_0xb226('0x2c')](_0x5d7251()));}}return _0x27dba1;})[_0xb226('0x51')]();})[_0xb226('0x2c')](function(_0x568be7){logger[_0xb226('0x14')](_0xb226('0x59'),_0xb226('0x5a'),_0x568be7[_0xb226('0x19')]);});}var processPromises=function(_0x331103){return BPromise[_0xb226('0x51')](promises)['then'](function(_0x15e633){})['catch'](function(_0x5a8d2d){logger[_0xb226('0x14')](_0xb226('0x5b'),JSON[_0xb226('0x2d')](_0x5a8d2d));})[_0xb226('0x5c')](function(){socket['emit'](_0xb226('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x331103){return _0x331103[_0xb226('0x5e')]();}});};var endCsv=function(){return BPromise[_0xb226('0x5f')]()[_0xb226('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xb226('0x2a')](function(){socket[_0xb226('0x60')](_0xb226('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb226('0x61')](FILEPATH);}catch(_0x553e64){logger['error'](_0xb226('0x62'),JSON['stringify'](_0x553e64));}finally{process[_0xb226('0x63')](0x0);}});};process['on'](_0xb226('0x64'),function(){logger[_0xb226('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb226('0x5f')]()[_0xb226('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb226('0x66')](',');return db['CmContact'][_0xb226('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb226('0x2a')](function(_0x3f0ded){var _0x54a5f9=fs[_0xb226('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb226('0x68')](_0x54a5f9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x24e05e,_0x5991fc){total+=0x1;var _0x5affce=total;promises['push'](checkRow(_0x24e05e,_0x3f0ded,_0x5affce)['then'](function(){success+=0x1;})[_0xb226('0x2c')](function(_0x58accd){if(_0x58accd[_0xb226('0x14')]){errors+=0x1;delete _0x58accd[_0xb226('0x14')];}else if(_0x58accd['duplicate']){duplicates+=0x1;delete _0x58accd[_0xb226('0x69')];}rows[_0xb226('0x50')](_0x58accd);}));if(total%0xc8===0x0){_0x5991fc[_0xb226('0x6a')]();return processPromises(_0x5991fc);}},'complete':function(){return processPromises()[_0xb226('0x2a')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5542a,_0xd41d31){logger['info'](_0xb226('0x6b'),JSON['stringify'](_0x5542a));endCsv();}});})[_0xb226('0x2c')](function(_0x4a8854){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4a8854));});}main(); \ No newline at end of file +var _0x01ab=['\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','sequelize','VoiceQueueId','onlyIfOpen','push','query','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum'];(function(_0x4d238d,_0x4602f9){var _0xa4c991=function(_0x38f715){while(--_0x38f715){_0x4d238d['push'](_0x4d238d['shift']());}};_0xa4c991(++_0x4602f9);}(_0x01ab,0x164));var _0xb01a=function(_0x322652,_0x5a85c0){_0x322652=_0x322652-0x0;var _0x5d5e88=_0x01ab[_0x322652];return _0x5d5e88;};'use strict';var BPromise=require('bluebird');var util=require(_0xb01a('0x0'));var _=require(_0xb01a('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xb01a('0x2'))['db'];var config=require('../../../config/environment');var logger=require(_0xb01a('0x3'))(_0xb01a('0x4'));config[_0xb01a('0x5')]=_[_0xb01a('0x6')](config[_0xb01a('0x5')],{'host':_0xb01a('0x7'),'port':0x18eb});var socket=require(_0xb01a('0x8'))(new Redis(config[_0xb01a('0x5')]));require(_0xb01a('0x9'))[_0xb01a('0xa')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xb01a('0xc')][0x2];if(!process[_0xb01a('0xc')][0x3]||process[_0xb01a('0xc')][0x3]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x3]===_0xb01a('0xd')||!process['argv'][0x4]||process[_0xb01a('0xc')][0x4]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x4]===_0xb01a('0xd')){throw new Error(_0xb01a('0xe'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xb01a('0xf')](','),process['argv'][0x4]['split'](','));if(!process[_0xb01a('0xc')][0x5]||process[_0xb01a('0xc')][0x5]===_0xb01a('0xb')||process['argv'][0x5]===_0xb01a('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb01a('0xc')][0x5];var COMPANYID=process[_0xb01a('0xc')][0x6]&&process[_0xb01a('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0xb01a('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0xb01a('0xc')][0x7]&&process['argv'][0x7]!==_0xb01a('0xb')&&process[_0xb01a('0xc')][0x7]!==_0xb01a('0xd')?process['argv'][0x7]:null;if(!process[_0xb01a('0xc')][0x8]||process[_0xb01a('0xc')][0x8]===_0xb01a('0xb')||process['argv'][0x8]===_0xb01a('0xd')){throw new Error(_0xb01a('0x10'));}var SOCKET_TIMESTAMP=process[_0xb01a('0xc')][0x8];}catch(_0x3dc14f){logger[_0xb01a('0x11')](_0x3dc14f);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(_0x2cb967,_0xcd8aa8,_0x40cea5,_0xec3eb4){var _0x4755e4={'message':_0xcd8aa8};_0x4755e4[_0x2cb967]=!![];if(_0x40cea5){_0x4755e4[_0xb01a('0x12')]=_0x40cea5;}if(_0xec3eb4){_0x4755e4[_0xb01a('0x13')]=_0xec3eb4;}return _0x4755e4;}function isEmail(_0x3eac7b){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3eac7b);}function checkRow(_0x20286b,_0x18220c,_0x1aea2f){return new BPromise(function(_0x5f3824,_0x5ccba6){if(_['isNil'](_0x20286b)){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x14'),null,_0x1aea2f));}if(_0x20286b['errors']&&_0x20286b[_0xb01a('0x15')][_0xb01a('0x16')]){var _0x57a457=_['map'](_0x20286b[_0xb01a('0x15')],_0xb01a('0x17'))[_0xb01a('0x18')](';');return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0x57a457,null,_0x1aea2f));}var _0xb6f3da={};for(var _0x1ae448 in FIELDS){if(FIELDS[_0xb01a('0x19')](_0x1ae448)&&FIELDS[_0x1ae448]){_0xb6f3da[_0x1ae448]=_0x20286b[_0xb01a('0x1a')][0x0][FIELDS[_0x1ae448]]||_0x20286b['data'][0x0]['\ufeff'+FIELDS[_0x1ae448]];}}if(!_0xb6f3da[_0xb01a('0x1b')]){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x1c'),null,_0x1aea2f));}if(!_0xb6f3da[_0xb01a('0x1d')]){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x1e'),null,_0x1aea2f));}if(_0xb6f3da[_0xb01a('0x1f')]){var _0x7cdd07=moment(_0xb6f3da[_0xb01a('0x1f')],_0xb01a('0x20'));if(!_0x7cdd07[_0xb01a('0x21')]()){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x22'),null,_0x1aea2f));}}if(_0xb6f3da[_0xb01a('0x23')]){if(!isEmail(_0xb6f3da[_0xb01a('0x23')])){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x1aea2f));}}_0xb6f3da[_0xb01a('0x24')]=LISTID;_0xb6f3da[_0xb01a('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb01a('0x16')]&&_0x18220c){var _0xe5ed46={};for(var _0x5d2a6f=0x0,_0x171ed6=DUPLICATES['length'];_0x5d2a6f<_0x171ed6;_0x5d2a6f+=0x1){_0xe5ed46[DUPLICATES[_0x5d2a6f]]=_0xb6f3da[DUPLICATES[_0x5d2a6f]];}var _0x1b0794=_[_0xb01a('0x26')](_0x18220c,_0xe5ed46);if(_0x1b0794){return _0x5ccba6(handleCheckRowError(_0xb01a('0x27'),_0xb01a('0x28'),_0x1b0794,_0x1aea2f));}}return db[_0xb01a('0x29')][_0xb01a('0x2a')](_0xb6f3da,{'raw':!![],'hooks':![],'fields':_['keys'](_0xb6f3da)})[_0xb01a('0x2b')](function(_0x1fc0a9){if(DUPLICATES&&DUPLICATES['length']&&_0x18220c){_0x18220c['push'](_[_0xb01a('0x2c')](_0xb6f3da,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1fc0a9['id'];return _0x5f3824();})[_0xb01a('0x2d')](function(_0x4facb2){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x2e')+(_0x4facb2[_0xb01a('0x17')]||JSON[_0xb01a('0x2f')](_0x4facb2)),null,_0x1aea2f));});});}function checkHopper(){function _0x16bb0a(){return function(_0x500448){logger[_0xb01a('0x11')](_0xb01a('0x30'),'checkHopper',util[_0xb01a('0x31')](_0x500448,{'showHidden':![],'depth':null}));};}var _0x13ee96=function(_0x2096e1,_0x58bf45){var _0x52ff13=squel[_0xb01a('0x32')]()[_0xb01a('0x33')](_0xb01a('0x34'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),'ContactId','ListId',_0x58bf45,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()['field'](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),'scheduledAt')[_0xb01a('0x3a')]('id',_0xb01a('0x3c'))[_0xb01a('0x3a')](LISTID[_0xb01a('0x3d')](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x2096e1['id'][_0xb01a('0x3d')](),_0x58bf45)[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x37'))['field'](_0xb01a('0x3b'),_0xb01a('0x38'))['from'](_0xb01a('0x3e'))['where'](_0xb01a('0x3f'))[_0xb01a('0x40')](_0xb01a('0x41'),LISTID['toString']())[_0xb01a('0x40')](_0xb01a('0x42'))[_0xb01a('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb01a('0x1d'))[_0xb01a('0x43')]('cm_hopper')[_0xb01a('0x40')](_0x58bf45+'\x20=\x20?',_0x2096e1['id']['toString']())))[_0xb01a('0x3d')]();return _0x52ff13;};var _0x10dc08=function(_0x58bf44,_0x55defa){var _0x4994c6=squel['insert']()[_0xb01a('0x33')]('cm_hopper')[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),_0xb01a('0x3c'),'ListId',_0x55defa,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x36'))['field']('id','ContactId')['field'](LISTID[_0xb01a('0x3d')](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x58bf44['id'][_0xb01a('0x3d')](),_0x55defa)[_0xb01a('0x3a')]('NOW()','createdAt')[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x38'))[_0xb01a('0x43')]('cm_contacts')[_0xb01a('0x40')]('deletedAt\x20IS\x20NULL')[_0xb01a('0x40')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0xb01a('0x44'),squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')](_0xb01a('0x42'))[_0xb01a('0x40')](_0xb01a('0x46'),squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x47'))[_0xb01a('0x43')]('cm_hopper_final')['where'](_0x55defa+_0xb01a('0x48'),_0x58bf44['id'][_0xb01a('0x3d')]()))[_0xb01a('0x40')](_0xb01a('0x46'),squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'))[_0xb01a('0x43')](_0xb01a('0x34'))[_0xb01a('0x40')](_0x55defa+_0xb01a('0x48'),_0x58bf44['id'][_0xb01a('0x3d')]())))[_0xb01a('0x3d')]();return _0x4994c6;};function _0x486653(_0x17b6e5,_0x564b1c){var _0x40d8ca=squel[_0xb01a('0x32')]()[_0xb01a('0x33')](_0xb01a('0x34'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),_0xb01a('0x3c'),_0xb01a('0x24'),_0x564b1c,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),'scheduledAt')[_0xb01a('0x3a')]('id',_0xb01a('0x3c'))[_0xb01a('0x3a')](LISTID['toString'](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x17b6e5['id'][_0xb01a('0x3d')](),_0x564b1c)[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x37'))[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x38'))['from']('cm_contacts')[_0xb01a('0x40')](_0xb01a('0x3f'))['where'](_0xb01a('0x41'),LISTID['toString']())[_0xb01a('0x40')](_0xb01a('0x44'),squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x40d8ca;}function _0x3acf13(_0x4a422a,_0xa3ce44){var _0x3b0988=squel[_0xb01a('0x32')]()['into'](_0xb01a('0x49'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x3c'),_0xb01a('0x24'),_0xa3ce44,'createdAt',_0xb01a('0x38')],squel[_0xb01a('0x39')]()['field'](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')]('id','ContactId')[_0xb01a('0x3a')](LISTID['toString'](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x4a422a['id'][_0xb01a('0x3d')](),_0xa3ce44)['field'](_0xb01a('0x3b'),_0xb01a('0x37'))['field'](_0xb01a('0x3b'),_0xb01a('0x38'))[_0xb01a('0x43')]('cm_contacts')[_0xb01a('0x40')](_0xb01a('0x3f'))['where'](_0xb01a('0x41'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')](_0xb01a('0x42')))[_0xb01a('0x3d')]();return _0x3b0988;}return db[_0xb01a('0x4a')][_0xb01a('0x4b')]({'where':{'type':_0xb01a('0x4c')},'attributes':['id',_0xb01a('0x4d')],'include':[{'model':db[_0xb01a('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x367462){var _0x17c12f=[];if(_0x367462){var _0x49c3b0;for(var _0x5f4be0=0x0,_0x1b63ab;_0x5f4be0<_0x367462[_0xb01a('0x16')];_0x5f4be0+=0x1){_0x1b63ab=_0x367462[_0x5f4be0][_0xb01a('0x4f')]({'plain':!![]});switch(_0x1b63ab['dialCheckDuplicateType']){case'always':_0x17c12f['push'](db[_0xb01a('0x50')]['query'](_0x10dc08(_0x1b63ab,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;case _0xb01a('0x52'):_0x17c12f[_0xb01a('0x53')](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x13ee96(_0x1b63ab,'VoiceQueueId'))[_0xb01a('0x2b')](function(){})['catch'](_0x16bb0a()));break;default:_0x17c12f[_0xb01a('0x53')](db['sequelize'][_0xb01a('0x54')](_0x486653(_0x1b63ab,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}}return _0x17c12f;})[_0xb01a('0x55')]()['then'](function(){return db[_0xb01a('0x4a')]['findAll']({'where':{'type':_0xb01a('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb01a('0x56'),'where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x2e9c7c){var _0x5d18b3=[];if(_0x2e9c7c){var _0x4b1aeb;for(var _0x5141ce=0x0,_0x34d07b;_0x5141ce<_0x2e9c7c[_0xb01a('0x16')];_0x5141ce+=0x1){_0x34d07b=_0x2e9c7c[_0x5141ce][_0xb01a('0x4f')]({'plain':!![]});_0x5d18b3[_0xb01a('0x53')](db['sequelize'][_0xb01a('0x54')](_0x3acf13(_0x34d07b,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}return _0x5d18b3;})[_0xb01a('0x55')]();})['then'](function(){return db[_0xb01a('0x57')]['findAll']({'attributes':['id',_0xb01a('0x4d')],'include':[{'model':db[_0xb01a('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x56e59f){var _0x5aff3b=[];if(_0x56e59f){for(var _0xfcfc0c=0x0,_0x2c6d3f;_0xfcfc0c<_0x56e59f['length'];_0xfcfc0c+=0x1){_0x2c6d3f=_0x56e59f[_0xfcfc0c][_0xb01a('0x4f')]({'plain':!![]});switch(_0x2c6d3f[_0xb01a('0x4d')]){case'always':_0x5aff3b[_0xb01a('0x53')](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x10dc08(_0x2c6d3f,_0xb01a('0x58')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;case _0xb01a('0x52'):_0x5aff3b['push'](db['sequelize'][_0xb01a('0x54')](_0x13ee96(_0x2c6d3f,_0xb01a('0x58')))['then'](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;default:_0x5aff3b['push'](db['sequelize'][_0xb01a('0x54')](_0x486653(_0x2c6d3f,'CampaignId'))['then'](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}}return _0x5aff3b;})[_0xb01a('0x55')]();})['then'](function(){return db['Campaign'][_0xb01a('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xb01a('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x4eb14e){var _0xd8b0d8=[];if(_0x4eb14e){for(var _0x3a7b2a=0x0,_0x546d10;_0x3a7b2a<_0x4eb14e['length'];_0x3a7b2a+=0x1){_0x546d10=_0x4eb14e[_0x3a7b2a][_0xb01a('0x4f')]({'plain':!![]});_0xd8b0d8['push'](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x3acf13(_0x546d10,_0xb01a('0x58')))[_0xb01a('0x2b')](function(){})['catch'](_0x16bb0a()));}}return _0xd8b0d8;})[_0xb01a('0x55')]();})['catch'](function(_0x3236ad){logger['error'](_0xb01a('0x59'),_0xb01a('0x5a'),_0x3236ad[_0xb01a('0x17')]);});}var processPromises=function(_0x3021c8){return BPromise[_0xb01a('0x55')](promises)[_0xb01a('0x2b')](function(_0x57da0e){})[_0xb01a('0x2d')](function(_0x2e2756){logger[_0xb01a('0x11')](_0xb01a('0x5b'),JSON[_0xb01a('0x2f')](_0x2e2756));})[_0xb01a('0x5c')](function(){socket[_0xb01a('0x5d')](_0xb01a('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3021c8){return _0x3021c8[_0xb01a('0x5f')]();}});};var endCsv=function(){return BPromise[_0xb01a('0x60')]()[_0xb01a('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xb01a('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb01a('0x61')](FILEPATH);}catch(_0x5ded6c){logger[_0xb01a('0x11')](_0xb01a('0x62'),JSON['stringify'](_0x5ded6c));}finally{process[_0xb01a('0x63')](0x0);}});};process['on'](_0xb01a('0x64'),function(){logger[_0xb01a('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0xb01a('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb01a('0xf')](',');return db[_0xb01a('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb01a('0x2b')](function(_0x3d81c0){var _0x48fee5=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb01a('0x66')](_0x48fee5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x41db38,_0x53ee04){total+=0x1;var _0xb87ffa=total;promises[_0xb01a('0x53')](checkRow(_0x41db38,_0x3d81c0,_0xb87ffa)[_0xb01a('0x2b')](function(){success+=0x1;})[_0xb01a('0x2d')](function(_0xe4fc92){if(_0xe4fc92[_0xb01a('0x11')]){errors+=0x1;delete _0xe4fc92[_0xb01a('0x11')];}else if(_0xe4fc92[_0xb01a('0x27')]){duplicates+=0x1;delete _0xe4fc92['duplicate'];}rows['push'](_0xe4fc92);}));if(total%0xc8===0x0){_0x53ee04[_0xb01a('0x67')]();return processPromises(_0x53ee04);}},'complete':function(){return processPromises()['then'](function(){logger[_0xb01a('0x65')](_0xb01a('0x68'));endCsv();});},'error':function(_0xcc59ba,_0x4fd661){logger[_0xb01a('0x65')](_0xb01a('0x69'),JSON[_0xb01a('0x2f')](_0xcc59ba));endCsv();}});})['catch'](function(_0x5ebcdf){logger[_0xb01a('0x11')](_0xb01a('0x6a'),JSON[_0xb01a('0x2f')](_0x5ebcdf));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3afd801..64e6228 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 _0xb0fb=['createReadStream','data','length','errors','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','rows','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','scheduledat','ListId','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','ContactId','cm_contacts','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','createdAt','insert','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','catch','main','stringify','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse'];(function(_0x1cafe8,_0x47f891){var _0x3b6630=function(_0x5de32e){while(--_0x5de32e){_0x1cafe8['push'](_0x1cafe8['shift']());}};_0x3b6630(++_0x47f891);}(_0xb0fb,0xcb));var _0xbb0f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb0fb[_0x4792c8];return _0x35edb1;};'use strict';var fs=require('fs');var path=require(_0xbb0f('0x0'));var _=require(_0xbb0f('0x1'));var Papa=require(_0xbb0f('0x2'));var util=require(_0xbb0f('0x3'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xbb0f('0x4'));var Redis=require(_0xbb0f('0x5'));var db=require(_0xbb0f('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xbb0f('0x7'))(_0xbb0f('0x8'));config[_0xbb0f('0x9')]=_[_0xbb0f('0xa')](config[_0xbb0f('0x9')],{'host':_0xbb0f('0xb'),'port':0x18eb});var socket=require(_0xbb0f('0xc'))(new Redis(config[_0xbb0f('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xbb0f('0xd'));function isEmail(_0x15665f){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))*$/[_0xbb0f('0xe')](_0x15665f);}function selectNotIn(_0x1b262a,_0x14b506,_0xa9130c,_0xf3781f,_0x535457){return squel[_0xbb0f('0xf')]()[_0xbb0f('0x10')]('phone')[_0xbb0f('0x11')](_0xf3781f)[_0xbb0f('0x12')](_0x14b506,null,_0x14b506+_0xbb0f('0x13')+_0xf3781f+'.'+_0xa9130c)['where'](_0xf3781f+'.'+_0xa9130c+_0xbb0f('0x14')+_0x1b262a+'.'+_0xa9130c)[_0xbb0f('0x15')](_0x14b506+_0xbb0f('0x16')+_0x535457[_0xbb0f('0x12')]()+')');}function insertCmHopper(_0x31658b,_0x2a5eed,_0x762bf0,_0x28728e,_0x2dfb5e){var _0x483705=[_0xbb0f('0x17'),'cm_contacts.scheduledat',_0xbb0f('0x18'),_0xbb0f('0x19'),_0x2a5eed+'.'+_0x28728e,_0xbb0f('0x1a'),_0xbb0f('0x1b'),_0xbb0f('0x1c'),_0xbb0f('0x1d'),'\x22'+_0x2dfb5e+'\x22'];return squel['insert']()[_0xbb0f('0x1e')](_0xbb0f('0x1f'))[_0xbb0f('0x20')]([_0xbb0f('0x21'),_0xbb0f('0x22'),'ContactId',_0xbb0f('0x23'),_0x28728e,'createdAt',_0xbb0f('0x24'),_0xbb0f('0x25'),'UserId',_0xbb0f('0x26')],squel['select']()[_0xbb0f('0x27')](_0x483705)['from'](_0x2a5eed)[_0xbb0f('0x12')]('cm_contacts',null,_0xbb0f('0x28')+_0x2a5eed+_0xbb0f('0x29'))['join'](_0x762bf0,null,_0x762bf0+_0xbb0f('0x13')+_0x2a5eed+'.'+_0x28728e)['where'](_0x2a5eed+_0xbb0f('0x2a'),_0x31658b)[_0xbb0f('0x15')](_0xbb0f('0x2b'),NOW)[_0xbb0f('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2a5eed,_0x762bf0,_0x28728e,'cm_hopper',[_0xbb0f('0x2c'),_0xbb0f('0x2d')]))[_0xbb0f('0x15')](_0xbb0f('0x2e'),selectNotIn(_0x2a5eed,_0x762bf0,_0x28728e,_0xbb0f('0x1f'),[_0xbb0f('0x2c')])))['toString']();}function insertCmHopperBlack(_0x258dc1,_0x3919ba,_0x298ef8,_0xedb38){var _0xd726a8=[_0xbb0f('0x17'),'cm_contacts.id',_0xbb0f('0x19'),_0x3919ba+'.'+_0xedb38,_0xbb0f('0x1a'),_0xbb0f('0x1b')];return squel['insert']()[_0xbb0f('0x1e')]('cm_hopper_black')[_0xbb0f('0x20')]([_0xbb0f('0x21'),_0xbb0f('0x2f'),'ListId',_0xedb38,'createdAt','updatedAt'],squel[_0xbb0f('0xf')]()[_0xbb0f('0x27')](_0xd726a8)[_0xbb0f('0x11')](_0x3919ba)[_0xbb0f('0x12')](_0xbb0f('0x30'),null,_0xbb0f('0x28')+_0x3919ba+_0xbb0f('0x29'))[_0xbb0f('0x12')](_0x298ef8,null,_0x298ef8+_0xbb0f('0x13')+_0x3919ba+'.'+_0xedb38)['where'](_0x3919ba+'.CmListId\x20=\x20?',_0x258dc1)['where'](_0xbb0f('0x2b'),NOW)[_0xbb0f('0x15')](_0xbb0f('0x2e'),squel['select']()[_0xbb0f('0x10')](_0xbb0f('0x21'))[_0xbb0f('0x11')](_0xbb0f('0x31'))[_0xbb0f('0x15')](_0xbb0f('0x32'),_0x258dc1)[_0xbb0f('0x15')](_0xedb38+_0xbb0f('0x33'),_0x3919ba+'.'+_0xedb38)))[_0xbb0f('0x34')]();}function insertCmContact(_0x595db5,_0x1bdf58,_0x49ca44,_0x4da879){var _0x50439c=_[_0xbb0f('0x35')](_[_0xbb0f('0x36')](_0x4da879),[_0xbb0f('0x23'),'CompanyId',_0xbb0f('0x37'),_0xbb0f('0x24')]);return squel[_0xbb0f('0x38')]()[_0xbb0f('0x1e')](_0xbb0f('0x30'))[_0xbb0f('0x20')](_0x50439c,squel['select']()[_0xbb0f('0x27')](_0x50439c)[_0xbb0f('0x11')](_0x1bdf58)[_0xbb0f('0x15')]('('+_0x49ca44[_0xbb0f('0x12')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xbb0f('0x27')](_0x49ca44)['from'](_0xbb0f('0x30'))[_0xbb0f('0x15')](_0xbb0f('0x32'),_0x595db5)[_0xbb0f('0x15')](_0xbb0f('0x39')))['where'](_0xbb0f('0x3a'),squel[_0xbb0f('0xf')]()[_0xbb0f('0x10')](_0xbb0f('0x3b'),'min_id')['from'](_0x1bdf58)[_0xbb0f('0x3c')](_0x49ca44['join'](','))))[_0xbb0f('0x34')]();}function handleStop(){logger[_0xbb0f('0x3d')](_0xbb0f('0x3e'));stopped=!![];}function handleUncaughtException(_0x44d31b){logger[_0xbb0f('0x3f')](_0x44d31b[_0xbb0f('0x40')]);process[_0xbb0f('0x41')](0x1);}function handleError(_0x47d0c4,_0x42648e){stats['errors'][_0xbb0f('0x42')]({'name':_0x42648e[_0xbb0f('0x43')],'message':_0x42648e[_0xbb0f('0x40')],'row':_0x47d0c4});}function handleQuery(_0x1e6db0){logger[_0xbb0f('0x3d')](_0x1e6db0);return db[_0xbb0f('0x44')][_0xbb0f('0x45')](_0x1e6db0)['spread'](function(_0x37147a){results[_0xbb0f('0x42')](_0x37147a);})[_0xbb0f('0x46')](function(_0x276f4b){logger[_0xbb0f('0x3f')](_0x276f4b['message']);});}function main(_0x14641f,_0xb157db,_0x1475d8,_0x478268){logger['info'](_0xbb0f('0x47'),_0x14641f,JSON[_0xbb0f('0x48')](_0xb157db));process['send'](_0xbb0f('0x49'));var _0x1a655f=_0xb157db[_0xbb0f('0x4a')];var _0xa1428f=_0xb157db['socket_timestamp'];var _0x314fe7=path[_0xbb0f('0x12')](config[_0xbb0f('0x4b')],_0xbb0f('0x4c'),_0xa1428f+_0xbb0f('0x4d'));var _0x5f2a2b=_[_0xbb0f('0x36')](_0x1a655f)[_0xbb0f('0x12')]();logger[_0xbb0f('0x3d')](_0xbb0f('0x4e'),_0x5f2a2b);fs[_0xbb0f('0x4f')](_0x314fe7,_0x5f2a2b+'\x0a');Papa[_0xbb0f('0x50')](fs[_0xbb0f('0x51')](_0x14641f),{'header':!![],'skipEmptyLines':!![],'step':function(_0xaae310,_0x472103){try{for(var _0x4d498f=0x0,_0x11fc1e=[];_0x4d498f<_0xaae310[_0xbb0f('0x52')][_0xbb0f('0x53')];_0x4d498f++){stats['rows']+=0x1;if(_0xaae310[_0xbb0f('0x54')][_0x4d498f]){handleError(_0xaae310[_0xbb0f('0x52')][_0x4d498f],_0xaae310[_0xbb0f('0x54')][_0x4d498f]);}else{var _0x54785f=[];for(var _0x55010b in _0x1a655f){if(_0x1a655f[_0xbb0f('0x55')](_0x55010b)){if(_0xaae310[_0xbb0f('0x52')][_0x4d498f][_0x1a655f[_0x55010b]]){var _0x2bb2b5=_[_0xbb0f('0x56')](_0xaae310[_0xbb0f('0x52')][_0x4d498f][_0x1a655f[_0x55010b]][_0xbb0f('0x57')](/"/g,'\x27'));switch(_0x55010b){case _0xbb0f('0x22'):var _0x2decbb=moment(_0x2bb2b5,_0xbb0f('0xd'),!![]);if(_0x2decbb[_0xbb0f('0x58')]()){_0x11fc1e[_0xbb0f('0x42')]('\x22'+_0x2bb2b5+'\x22');}else{_0x54785f['push'](_0xbb0f('0x59'));}break;case _0xbb0f('0x25'):var _0x5785ec=parseInt(_0x2bb2b5);_0x2bb2b5=_['isNaN'](_0x5785ec)||_0x5785ec<0x0||_0x5785ec>0x4?_0x478268?0x3:0x2:_0x5785ec;_0x11fc1e[_0xbb0f('0x42')]('\x22'+_0x2bb2b5+'\x22');break;case'UserId':var _0x5a3bbe=parseInt(_0x2bb2b5);if(_[_0xbb0f('0x5a')](_0x5a3bbe)&&_[_0xbb0f('0x5b')](_0x1475d8,_0x5a3bbe)){_0x11fc1e['push']('\x22'+_0x5a3bbe+'\x22');}else{_0x54785f[_0xbb0f('0x42')](_0xbb0f('0x5c'));}break;case _0xbb0f('0x5d'):if(isEmail(_0x2bb2b5)){_0x11fc1e[_0xbb0f('0x42')]('\x22'+_0x2bb2b5+'\x22');}else{_0x54785f[_0xbb0f('0x42')](_0xbb0f('0x5e'));}break;case _0xbb0f('0x5f'):var _0x1f8857=moment(_0x2bb2b5,_0xbb0f('0x60'),!![]);if(_0x1f8857[_0xbb0f('0x58')]()){_0x11fc1e[_0xbb0f('0x42')]('\x22'+_0x2bb2b5+'\x22');}else{_0x54785f[_0xbb0f('0x42')](_0xbb0f('0x61'));}break;default:_0x11fc1e['push']('\x22'+_0x2bb2b5+'\x22');}}else{switch(_0x55010b){case _0xbb0f('0x62'):case'phone':_0x54785f[_0xbb0f('0x42')](_0x55010b+'\x20not\x20specified');break;default:_0x11fc1e[_0xbb0f('0x42')]('\x22\x22');}}}}if(_0x54785f['length']){handleError(_0xaae310[_0xbb0f('0x52')][_0x4d498f],{'code':_0xbb0f('0x63'),'message':_0x54785f[_0xbb0f('0x12')]()});}else{fs[_0xbb0f('0x64')](_0x314fe7,_0x11fc1e[_0xbb0f('0x12')]()+'\x0a');}_0x11fc1e=[];}if(!(stats[_0xbb0f('0x65')]%0xc8)){socket[_0xbb0f('0x66')](_0xbb0f('0x67')+_0xa1428f,stats);stats['errors']=[];}}if(stopped){logger[_0xbb0f('0x3d')]('Abort\x20parser');_0x472103[_0xbb0f('0x68')]();}}catch(_0x3ad63e){handleError(_0xaae310['data'][_0x4d498f],{'code':_0xbb0f('0x69'),'message':_0x3ad63e[_0xbb0f('0x40')]});logger[_0xbb0f('0x3f')](_0xbb0f('0x6a'),_0x3ad63e[_0xbb0f('0x40')]);}},'complete':function(){try{var _0x385505=[];var _0x533c79=_0xbb0f('0x30');if(_0xb157db[_0xbb0f('0x6b')]&&_0xb157db[_0xbb0f('0x6b')][_0xbb0f('0x53')]){_0x533c79=_0xbb0f('0x6c')+_0xa1428f;_0x385505['push'](_0xbb0f('0x6d')+_0x533c79+_0xbb0f('0x6e'));}var _0x1b97ac=util[_0xbb0f('0x6f')](_0xbb0f('0x70'),_0x314fe7,_0x533c79,_0x5f2a2b,_0xb157db[_0xbb0f('0x23')],_0xb157db[_0xbb0f('0x71')]||null,NOW,NOW);if(_[_0xbb0f('0x72')](_0x1a655f['scheduledat'])){_0x1b97ac+=',\x20scheduledAt\x20=\x20NOW()';}_0x385505[_0xbb0f('0x42')](_0x1b97ac);if(_0xb157db['duplicates']&&_0xb157db[_0xbb0f('0x6b')][_0xbb0f('0x53')]){_0x385505[_0xbb0f('0x42')](insertCmContact(_0xb157db[_0xbb0f('0x23')],_0x533c79,_0xb157db[_0xbb0f('0x6b')],_0x1a655f));_0x385505[_0xbb0f('0x42')](_0xbb0f('0x73')+_0x533c79+';');}_0x385505['push'](insertCmHopper(_0xb157db[_0xbb0f('0x23')],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x478268));_0x385505[_0xbb0f('0x42')](insertCmHopperBlack(_0xb157db['ListId'],_0xbb0f('0x74'),_0xbb0f('0x75'),_0xbb0f('0x76')));_0x385505['push'](insertCmHopper(_0xb157db[_0xbb0f('0x23')],_0xbb0f('0x77'),_0xbb0f('0x78'),_0xbb0f('0x79'),_0x478268));_0x385505['push'](insertCmHopperBlack(_0xb157db[_0xbb0f('0x23')],_0xbb0f('0x7a'),'campaigns',_0xbb0f('0x79')));BPromise[_0xbb0f('0x7b')](_0x385505,handleQuery)['then'](function(_0x5e8a00){stats[_0xbb0f('0x7c')]=!![];stats[_0xbb0f('0x7d')]=_0xb157db['duplicates']&&_0xb157db[_0xbb0f('0x6b')][_0xbb0f('0x53')]?results[0x2][_0xbb0f('0x7d')]:results[0x0]['affectedRows'];socket[_0xbb0f('0x66')](_0xbb0f('0x67')+_0xa1428f,stats);fs[_0xbb0f('0x7e')](_0x14641f);fs['unlink'](_0x314fe7);process[_0xbb0f('0x41')](0x0);})[_0xbb0f('0x46')](function(_0x5a0764){logger[_0xbb0f('0x3f')](_0x5a0764[_0xbb0f('0x40')]);process[_0xbb0f('0x41')](0x1);});}catch(_0x40b094){logger['error'](_0xbb0f('0x7f'),_0x40b094['message']);process[_0xbb0f('0x41')](0x1);}},'error':function(_0x1291d8,_0x4fbc64,_0x5de3ac,_0x5dfbc8){throw new Error(_0x5dfbc8);}});}function validate(){if(process[_0xbb0f('0x80')]&&process[_0xbb0f('0x80')][_0xbb0f('0x53')]<0x4){throw new Error(_0xbb0f('0x81'));}var _0x5e712a=path[_0xbb0f('0x12')](config['root'],'server/files/tmp',process[_0xbb0f('0x80')][0x2]);if(!fs[_0xbb0f('0x82')](_0x5e712a)){throw new Error(_0xbb0f('0x83'));}var _0x3d1cba={};try{_0x3d1cba=JSON['parse'](process[_0xbb0f('0x80')][0x3]);if(!_0x3d1cba[_0xbb0f('0x4a')]){throw new Error(_0xbb0f('0x84'));}if(!_0x3d1cba['binding'][_0xbb0f('0x21')]){throw new Error(_0xbb0f('0x85'));}if(!_0x3d1cba[_0xbb0f('0x4a')][_0xbb0f('0x62')]){throw new Error(_0xbb0f('0x86'));}var _0x455867=0x0;if(_0x3d1cba[_0xbb0f('0x4a')][_0xbb0f('0x87')]){_0x455867=0x1;}if(!_0x3d1cba[_0xbb0f('0x23')]){throw new Error(_0xbb0f('0x88'));}}catch(_0x314a9c){throw new Error(_0xbb0f('0x89'));}var _0x38408a=[];try{_0x38408a=_[_0xbb0f('0x8a')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x4e41da){logger[_0xbb0f('0x3d')](_0xbb0f('0x8b'));}main(_0x5e712a,_0x3d1cba,_0x38408a,_0x455867);}validate();process['on'](_0xbb0f('0x8c'),handleStop);process['on'](_0xbb0f('0x8d'),handleUncaughtException); \ No newline at end of file +var _0x3cca=['Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','into','cm_hopper_black','ListId','keys','CompanyId','cm_contacts',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cca,0xce));var _0xa3cc=function(_0x2ee8a8,_0x445a54){_0x2ee8a8=_0x2ee8a8-0x0;var _0x3ec669=_0x3cca[_0x2ee8a8];return _0x3ec669;};'use strict';var fs=require('fs');var path=require(_0xa3cc('0x0'));var _=require(_0xa3cc('0x1'));var Papa=require(_0xa3cc('0x2'));var util=require('util');var BPromise=require(_0xa3cc('0x3'));var moment=require(_0xa3cc('0x4'));var squel=require(_0xa3cc('0x5'));var Redis=require('ioredis');var db=require(_0xa3cc('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0xa3cc('0x7')]=_[_0xa3cc('0x8')](config[_0xa3cc('0x7')],{'host':_0xa3cc('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3cc('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa3cc('0xa')](_0xa3cc('0xb'));function isEmail(_0x5a31fd){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x5a31fd);}function selectNotIn(_0x473de3,_0x22f27f,_0x435c01,_0x15594e,_0x144fa1){return squel[_0xa3cc('0xc')]()[_0xa3cc('0xd')](_0xa3cc('0xe'))[_0xa3cc('0xf')](_0x15594e)['join'](_0x22f27f,null,_0x22f27f+_0xa3cc('0x10')+_0x15594e+'.'+_0x435c01)[_0xa3cc('0x11')](_0x15594e+'.'+_0x435c01+_0xa3cc('0x12')+_0x473de3+'.'+_0x435c01)[_0xa3cc('0x11')](_0x22f27f+'.dialCheckDuplicateType\x20IN\x20('+_0x144fa1[_0xa3cc('0x13')]()+')');}function insertCmHopper(_0x306572,_0x55f809,_0xeaa7c5,_0x4558e2,_0x4cf3d1){var _0x2b0b32=['cm_contacts.phone',_0xa3cc('0x14'),_0xa3cc('0x15'),_0xa3cc('0x16'),_0x55f809+'.'+_0x4558e2,_0xa3cc('0x17'),_0xa3cc('0x18'),_0xa3cc('0x19'),'cm_contacts.UserId','\x22'+_0x4cf3d1+'\x22'];return squel[_0xa3cc('0x1a')]()['into'](_0xa3cc('0x1b'))[_0xa3cc('0x1c')](['phone',_0xa3cc('0x1d'),'ContactId','ListId',_0x4558e2,_0xa3cc('0x1e'),_0xa3cc('0x1f'),_0xa3cc('0x20'),'UserId',_0xa3cc('0x21')],squel['select']()[_0xa3cc('0x22')](_0x2b0b32)[_0xa3cc('0xf')](_0x55f809)[_0xa3cc('0x13')]('cm_contacts',null,_0xa3cc('0x23')+_0x55f809+_0xa3cc('0x24'))[_0xa3cc('0x13')](_0xeaa7c5,null,_0xeaa7c5+'.id\x20=\x20'+_0x55f809+'.'+_0x4558e2)[_0xa3cc('0x11')](_0x55f809+_0xa3cc('0x25'),_0x306572)['where'](_0xa3cc('0x26'),NOW)[_0xa3cc('0x11')](_0xa3cc('0x27'),selectNotIn(_0x55f809,_0xeaa7c5,_0x4558e2,'cm_hopper',[_0xa3cc('0x28'),_0xa3cc('0x29')]))[_0xa3cc('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x55f809,_0xeaa7c5,_0x4558e2,_0xa3cc('0x1b'),[_0xa3cc('0x28')])))[_0xa3cc('0x2a')]();}function insertCmHopperBlack(_0x2a6254,_0x526b53,_0x3bd296,_0x509a74){var _0x4a26c6=[_0xa3cc('0x2b'),_0xa3cc('0x15'),_0xa3cc('0x16'),_0x526b53+'.'+_0x509a74,_0xa3cc('0x17'),_0xa3cc('0x18')];return squel[_0xa3cc('0x1a')]()[_0xa3cc('0x2c')](_0xa3cc('0x2d'))[_0xa3cc('0x1c')]([_0xa3cc('0xe'),'ContactId',_0xa3cc('0x2e'),_0x509a74,'createdAt',_0xa3cc('0x1f')],squel[_0xa3cc('0xc')]()[_0xa3cc('0x22')](_0x4a26c6)['from'](_0x526b53)[_0xa3cc('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x526b53+_0xa3cc('0x24'))[_0xa3cc('0x13')](_0x3bd296,null,_0x3bd296+_0xa3cc('0x10')+_0x526b53+'.'+_0x509a74)[_0xa3cc('0x11')](_0x526b53+_0xa3cc('0x25'),_0x2a6254)[_0xa3cc('0x11')](_0xa3cc('0x26'),NOW)[_0xa3cc('0x11')](_0xa3cc('0x27'),squel['select']()[_0xa3cc('0xd')](_0xa3cc('0xe'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x2a6254)[_0xa3cc('0x11')](_0x509a74+'\x20=\x20?',_0x526b53+'.'+_0x509a74)))[_0xa3cc('0x2a')]();}function insertCmContact(_0x52a6d3,_0x3ad20c,_0x55f52c,_0xd4333a){var _0x4918fa=_['concat'](_[_0xa3cc('0x2f')](_0xd4333a),[_0xa3cc('0x2e'),_0xa3cc('0x30'),_0xa3cc('0x1e'),_0xa3cc('0x1f')]);return squel[_0xa3cc('0x1a')]()[_0xa3cc('0x2c')](_0xa3cc('0x31'))[_0xa3cc('0x1c')](_0x4918fa,squel[_0xa3cc('0xc')]()[_0xa3cc('0x22')](_0x4918fa)[_0xa3cc('0xf')](_0x3ad20c)[_0xa3cc('0x11')]('('+_0x55f52c[_0xa3cc('0x13')](',')+_0xa3cc('0x32'),squel[_0xa3cc('0xc')]()['fields'](_0x55f52c)[_0xa3cc('0xf')]('cm_contacts')['where'](_0xa3cc('0x33'),_0x52a6d3)[_0xa3cc('0x11')](_0xa3cc('0x34')))['where'](_0xa3cc('0x35'),squel[_0xa3cc('0xc')]()[_0xa3cc('0xd')](_0xa3cc('0x36'),_0xa3cc('0x37'))[_0xa3cc('0xf')](_0x3ad20c)[_0xa3cc('0x38')](_0x55f52c[_0xa3cc('0x13')](','))))['toString']();}function handleStop(){logger[_0xa3cc('0x39')](_0xa3cc('0x3a'));stopped=!![];}function handleUncaughtException(_0x5221bb){logger[_0xa3cc('0x3b')](_0x5221bb[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);}function handleError(_0x158cd1,_0x1d0320){stats[_0xa3cc('0x3e')][_0xa3cc('0x3f')]({'name':_0x1d0320[_0xa3cc('0x40')],'message':_0x1d0320[_0xa3cc('0x3c')],'row':_0x158cd1});}function handleQuery(_0x28da3b){logger[_0xa3cc('0x39')](_0x28da3b);return db[_0xa3cc('0x41')][_0xa3cc('0x42')](_0x28da3b)[_0xa3cc('0x43')](function(_0x49b8f9){results[_0xa3cc('0x3f')](_0x49b8f9);})[_0xa3cc('0x44')](function(_0x54b2a9){logger[_0xa3cc('0x3b')](_0x54b2a9[_0xa3cc('0x3c')]);});}function main(_0x5c1163,_0x4bd69e,_0x3baa0c,_0x58d278){logger[_0xa3cc('0x39')](_0xa3cc('0x45'),_0x5c1163,JSON[_0xa3cc('0x46')](_0x4bd69e));process[_0xa3cc('0x47')](_0xa3cc('0x48'));var _0x55532c=_0x4bd69e[_0xa3cc('0x49')];var _0x1eb177=_0x4bd69e[_0xa3cc('0x4a')];var _0x929d28=path[_0xa3cc('0x13')](config['root'],_0xa3cc('0x4b'),_0x1eb177+_0xa3cc('0x4c'));var _0x57ee11=_[_0xa3cc('0x2f')](_0x55532c)[_0xa3cc('0x13')]();logger['info'](_0xa3cc('0x4d'),_0x57ee11);fs[_0xa3cc('0x4e')](_0x929d28,_0x57ee11+'\x0a');Papa['parse'](fs[_0xa3cc('0x4f')](_0x5c1163),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a262f,_0x55cada){try{for(var _0x2ad82a=0x0,_0x4dc537=[];_0x2ad82a<_0x1a262f['data'][_0xa3cc('0x50')];_0x2ad82a++){stats[_0xa3cc('0x51')]+=0x1;if(_0x1a262f[_0xa3cc('0x3e')][_0x2ad82a]){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],_0x1a262f[_0xa3cc('0x3e')][_0x2ad82a]);}else{var _0x1d0b65=[];for(var _0x4224b7 in _0x55532c){if(_0x55532c['hasOwnProperty'](_0x4224b7)){if(_0x1a262f['data'][_0x2ad82a][_0x55532c[_0x4224b7]]){var _0x22e8d1=_[_0xa3cc('0x53')](_0x1a262f['data'][_0x2ad82a][_0x55532c[_0x4224b7]][_0xa3cc('0x54')](/"/g,'\x27'));switch(_0x4224b7){case _0xa3cc('0x1d'):var _0x275d1c=moment(_0x22e8d1,_0xa3cc('0xb'),!![]);if(_0x275d1c[_0xa3cc('0x55')]()){_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x56'));}break;case _0xa3cc('0x20'):var _0x24b074=parseInt(_0x22e8d1);_0x22e8d1=_[_0xa3cc('0x57')](_0x24b074)||_0x24b074<0x0||_0x24b074>0x4?_0x58d278?0x3:0x2:_0x24b074;_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');break;case'UserId':var _0x5b904a=parseInt(_0x22e8d1);if(_[_0xa3cc('0x58')](_0x5b904a)&&_[_0xa3cc('0x59')](_0x3baa0c,_0x5b904a)){_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x5b904a+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x5a'));}break;case _0xa3cc('0x5b'):if(isEmail(_0x22e8d1)){_0x4dc537['push']('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x193f07=moment(_0x22e8d1,'YYYY-MM-DD',!![]);if(_0x193f07[_0xa3cc('0x55')]()){_0x4dc537['push']('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x5c'));}break;default:_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');}}else{switch(_0x4224b7){case _0xa3cc('0x5d'):case _0xa3cc('0xe'):_0x1d0b65[_0xa3cc('0x3f')](_0x4224b7+_0xa3cc('0x5e'));break;default:_0x4dc537[_0xa3cc('0x3f')]('\x22\x22');}}}}if(_0x1d0b65['length']){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],{'code':'SystemRow','message':_0x1d0b65['join']()});}else{fs[_0xa3cc('0x5f')](_0x929d28,_0x4dc537[_0xa3cc('0x13')]()+'\x0a');}_0x4dc537=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xa3cc('0x60')+_0x1eb177,stats);stats[_0xa3cc('0x3e')]=[];}}if(stopped){logger[_0xa3cc('0x39')]('Abort\x20parser');_0x55cada[_0xa3cc('0x61')]();}}catch(_0x58c4c9){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],{'code':'SystemError','message':_0x58c4c9[_0xa3cc('0x3c')]});logger[_0xa3cc('0x3b')](_0xa3cc('0x62'),_0x58c4c9[_0xa3cc('0x3c')]);}},'complete':function(){try{var _0x16b31e=[];var _0x3024b8='cm_contacts';if(_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')][_0xa3cc('0x50')]){_0x3024b8=_0xa3cc('0x64')+_0x1eb177;_0x16b31e[_0xa3cc('0x3f')](_0xa3cc('0x65')+_0x3024b8+_0xa3cc('0x66'));}var _0x17bbe7=util[_0xa3cc('0xa')](_0xa3cc('0x67'),_0x929d28,_0x3024b8,_0x57ee11,_0x4bd69e[_0xa3cc('0x2e')],_0x4bd69e['CompanyId']||null,NOW,NOW);if(_[_0xa3cc('0x68')](_0x55532c[_0xa3cc('0x1d')])){_0x17bbe7+=_0xa3cc('0x69');}_0x16b31e[_0xa3cc('0x3f')](_0x17bbe7);if(_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')]['length']){_0x16b31e['push'](insertCmContact(_0x4bd69e[_0xa3cc('0x2e')],_0x3024b8,_0x4bd69e[_0xa3cc('0x63')],_0x55532c));_0x16b31e['push'](_0xa3cc('0x6a')+_0x3024b8+';');}_0x16b31e[_0xa3cc('0x3f')](insertCmHopper(_0x4bd69e[_0xa3cc('0x2e')],'voice_queues_has_cm_lists',_0xa3cc('0x6b'),_0xa3cc('0x6c'),_0x58d278));_0x16b31e[_0xa3cc('0x3f')](insertCmHopperBlack(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x6d'),_0xa3cc('0x6b'),_0xa3cc('0x6c')));_0x16b31e['push'](insertCmHopper(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x6e'),_0xa3cc('0x6f'),'CampaignId',_0x58d278));_0x16b31e['push'](insertCmHopperBlack(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x70'),_0xa3cc('0x6f'),_0xa3cc('0x71')));BPromise[_0xa3cc('0x72')](_0x16b31e,handleQuery)[_0xa3cc('0x73')](function(_0x49e52d){stats['finish']=!![];stats[_0xa3cc('0x74')]=_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')][_0xa3cc('0x50')]?results[0x2][_0xa3cc('0x74')]:results[0x0][_0xa3cc('0x74')];socket[_0xa3cc('0x75')](_0xa3cc('0x60')+_0x1eb177,stats);fs[_0xa3cc('0x76')](_0x5c1163);fs['unlink'](_0x929d28);process['exit'](0x0);})[_0xa3cc('0x44')](function(_0x231f3e){logger[_0xa3cc('0x3b')](_0x231f3e[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);});}catch(_0x269774){logger['error'](_0xa3cc('0x77'),_0x269774[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);}},'error':function(_0x3f7810,_0x1dd322,_0x5aaf9f,_0x219a86){throw new Error(_0x219a86);}});}function validate(){if(process[_0xa3cc('0x78')]&&process[_0xa3cc('0x78')]['length']<0x4){throw new Error(_0xa3cc('0x79'));}var _0x5817c9=path['join'](config[_0xa3cc('0x7a')],'server/files/tmp',process[_0xa3cc('0x78')][0x2]);if(!fs[_0xa3cc('0x7b')](_0x5817c9)){throw new Error(_0xa3cc('0x7c'));}var _0x295068={};try{_0x295068=JSON['parse'](process['argv'][0x3]);if(!_0x295068[_0xa3cc('0x49')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x295068['binding']['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x295068[_0xa3cc('0x49')]['firstName']){throw new Error(_0xa3cc('0x7d'));}var _0x3838f6=0x0;if(_0x295068[_0xa3cc('0x49')][_0xa3cc('0x7e')]){_0x3838f6=0x1;}if(!_0x295068[_0xa3cc('0x2e')]){throw new Error(_0xa3cc('0x7f'));}}catch(_0x11e76c){throw new Error(_0xa3cc('0x80'));}var _0x498ca4=[];try{_0x498ca4=_[_0xa3cc('0x81')](JSON[_0xa3cc('0x82')](process['argv'][0x4]),'id');}catch(_0x2f7ed4){logger[_0xa3cc('0x39')](_0xa3cc('0x83'));}main(_0x5817c9,_0x295068,_0x498ca4,_0x3838f6);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 54a0e15..322c056 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 _0x9154=['Caller\x20Number','keyValue','Caller\x20Name','calleridname','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','toLowerCase','voice','inbound','push','queue','calleridnum','string','Outbound\x20Call','variable','getDescriptions','***\x20Call\x20Info\x20***'];(function(_0x3932b4,_0x6e7e98){var _0x5bc0b6=function(_0x5b81ad){while(--_0x5b81ad){_0x3932b4['push'](_0x3932b4['shift']());}};_0x5bc0b6(++_0x6e7e98);}(_0x9154,0x1e3));var _0x4915=function(_0x180e4a,_0x3a0c1c){_0x180e4a=_0x180e4a-0x0;var _0xd53fed=_0x9154[_0x180e4a];return _0xd53fed;};'use strict';exports['getSubjects']=function(_0x50a9eb,_0x1e6a0a){var _0x38042c=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x50a9eb[_0x4915('0x0')]()){case _0x4915('0x1'):switch(_0x1e6a0a[_0x4915('0x0')]()){case _0x4915('0x2'):_0x38042c[_0x4915('0x3')]({'type':'variable','content':'','variableName':_0x4915('0x4')});_0x38042c[_0x4915('0x3')]({'type':'variable','content':'','variableName':_0x4915('0x5')});break;case'outbound':_0x38042c[_0x4915('0x3')]({'type':_0x4915('0x6'),'content':_0x4915('0x7'),'variableName':null});_0x38042c[_0x4915('0x3')]({'type':_0x4915('0x8'),'content':'','variableName':'destcalleridnum'});break;}}return _0x38042c;};exports[_0x4915('0x9')]=function(_0x3695a9,_0x4beb32){var _0x365a2d=[];switch(_0x3695a9[_0x4915('0x0')]()){case _0x4915('0x1'):switch(_0x4beb32[_0x4915('0x0')]()){case _0x4915('0x2'):_0x365a2d=[{'type':_0x4915('0x6'),'content':_0x4915('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4915('0xb'),'keyType':_0x4915('0x8'),'variableName':'calleridnum'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0xd'),'keyType':_0x4915('0x8'),'variableName':_0x4915('0xe')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x4915('0x8'),'variableName':'destexten'},{'type':_0x4915('0xc'),'content':'','key':'Queue','keyType':_0x4915('0x8'),'variableName':'queue'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0xf'),'keyType':_0x4915('0x8'),'variableName':_0x4915('0x10')},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x11'),'keyType':_0x4915('0x8'),'variableName':_0x4915('0x12')},{'type':_0x4915('0x6'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x13'),'keyType':'variable','variableName':'destcalleridname'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x14'),'keyType':'variable','variableName':_0x4915('0x15')},{'type':'string','content':_0x4915('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x4915('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x4915('0x12')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x4915('0x8'),'variableName':_0x4915('0x17')},{'type':_0x4915('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x4915('0x8'),'variableName':_0x4915('0x18')},{'type':'keyValue','content':'','key':_0x4915('0x19'),'keyType':_0x4915('0x8'),'variableName':_0x4915('0x1a')},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x1b'),'keyType':_0x4915('0x8'),'variableName':_0x4915('0x1c')}];break;case _0x4915('0x1d'):_0x365a2d=[{'type':_0x4915('0x6'),'content':_0x4915('0xa'),'variableName':null},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x4915('0x15')},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x1f'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x4915('0xf'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x11'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':_0x4915('0x20')},{'type':_0x4915('0x6'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x21'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':'answertime'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x22'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':_0x4915('0x23')},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x24'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':'duration'},{'type':_0x4915('0xc'),'content':'','key':_0x4915('0x25'),'keyType':_0x4915('0x8'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x365a2d;}; \ No newline at end of file +var _0x22ca=['agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','membername','starttime','Answer\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','calleridname','Call\x20To','UniqueId','uniqueid','Date','agentcalledAt','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x22ca,0x1b2));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';exports[_0xa22c('0x0')]=function(_0xb39a81,_0x2422b8){var _0x405d23=[{'type':_0xa22c('0x1'),'content':_0xa22c('0x2'),'variableName':null}];switch(_0xb39a81[_0xa22c('0x3')]()){case _0xa22c('0x4'):switch(_0x2422b8['toLowerCase']()){case _0xa22c('0x5'):_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':_0xa22c('0x8')});_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':_0xa22c('0x9')});break;case _0xa22c('0xa'):_0x405d23[_0xa22c('0x6')]({'type':'string','content':_0xa22c('0xb'),'variableName':null});_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x405d23;};exports[_0xa22c('0xc')]=function(_0x1eb5b7,_0x3a0e5c){var _0x3f05a5=[];switch(_0x1eb5b7[_0xa22c('0x3')]()){case'voice':switch(_0x3a0e5c[_0xa22c('0x3')]()){case _0xa22c('0x5'):_0x3f05a5=[{'type':_0xa22c('0x1'),'content':_0xa22c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa22c('0xe'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x9')},{'type':_0xa22c('0xf'),'content':'','key':'Caller\x20Name','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x10')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x11'),'keyType':_0xa22c('0x7'),'variableName':'destexten'},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':'keyValue','content':'','key':_0xa22c('0x12'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x13')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x14'),'keyType':'variable','variableName':_0xa22c('0x15')},{'type':_0xa22c('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa22c('0xf'),'content':'','key':'Agent\x20Name','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x16')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x17'),'keyType':'variable','variableName':_0xa22c('0x18')},{'type':'string','content':_0xa22c('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1a'),'keyType':'variable','variableName':_0xa22c('0x15')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1b'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x1c')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1d'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x1e')},{'type':'keyValue','content':'','key':_0xa22c('0x1f'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x20')},{'type':_0xa22c('0xf'),'content':'','key':'Talk\x20Time','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x21')}];break;case _0xa22c('0xa'):_0x3f05a5=[{'type':_0xa22c('0x1'),'content':_0xa22c('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xa22c('0x22'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x23')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x12'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x14'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x24')},{'type':_0xa22c('0x1'),'content':_0xa22c('0x19')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x25'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0xa22c('0xf'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xa22c('0x26')},{'type':'keyValue','content':'','key':_0xa22c('0x27'),'keyType':'variable','keyContent':'','variableName':_0xa22c('0x28')},{'type':_0xa22c('0xf'),'content':'','key':'Billable\x20Time','keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x29')}];break;}}return _0x3f05a5;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index eac850e..abada24 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 _0xd513=['findOne','then','update','info','catch','error','tracked','query','clone','body','omit','phone','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','role','stringify'];(function(_0x5951ba,_0x454655){var _0x1ac401=function(_0x445897){while(--_0x445897){_0x5951ba['push'](_0x5951ba['shift']());}};_0x1ac401(++_0x454655);}(_0xd513,0x185));var _0x3d51=function(_0x466f76,_0x5a480b){_0x466f76=_0x466f76-0x0;var _0x2f855=_0xd513[_0x466f76];return _0x2f855;};'use strict';var _=require('lodash');var db=require(_0x3d51('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x3d51('0x1')),'mail':require(_0x3d51('0x2'))(_0x3d51('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x3d51('0x4')),'chat':require('../../config/logger')(_0x3d51('0x5')),'whatsapp':require(_0x3d51('0x2'))(_0x3d51('0x6'))};function getInteractionId(_0x115dd3,_0x365088,_0x2bc53e){if(_0x115dd3&&_0x115dd3[_[_0x3d51('0x7')](_0x2bc53e)+_0x3d51('0x8')]){return _0x115dd3[_['upperFirst'](_0x2bc53e)+_0x3d51('0x8')];}else if(_0x115dd3&&_0x115dd3['id']){return _0x115dd3['id'];}else if(_0x365088&&_0x365088['id']){return _0x365088['id'];}else{return'unknown';}}function log(_0x520598,_0x3d6137,_0xda63b2,_0x3613a1,_0x3230c7,_0x42874a){loggers[_0x3230c7['toLowerCase']()][_0x520598]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42874a['toUpperCase'](),_0x3d6137?_0x3d6137['id']:null,_0x3d6137?_0x3d6137['name']:null,_0x3d6137?_0x3d6137[_0x3d51('0x9')]:null,getInteractionId(_0xda63b2,_0x3613a1,_0x3230c7),_0xda63b2?JSON[_0x3d51('0xa')](_0xda63b2):'null');}function updateUser(_0x2125a1,_0x47a3ef,_0xf74640,_0x29b80c,_0x332940){db[_[_0x3d51('0x7')](_0x29b80c)+'Interaction'][_0x3d51('0xb')]({'where':{'id':getInteractionId(_0x47a3ef,_0xf74640,_0x29b80c)}})[_0x3d51('0xc')](function(_0x414f7e){if(_0x414f7e){return _0x414f7e[_0x3d51('0xd')]({'UserId':_0x2125a1?_0x2125a1['id']:null});}})[_0x3d51('0xc')](function(_0x5e7a17){if(_0x5e7a17){log(_0x3d51('0xe'),_0x2125a1,_0x47a3ef,_0xf74640,_0x29b80c,_0x332940);}})[_0x3d51('0xf')](function(){log(_0x3d51('0x10'),_0x2125a1,_0x47a3ef,_0xf74640,_0x29b80c,_0x332940);});}exports[_0x3d51('0x11')]=function(_0x49e07a,_0x438946){return function(_0x5bbc37,_0x3b2d7c,_0x1d508e){var _0x3ae76c=_0x5bbc37['user'];var _0x2e79aa={};var _0x4c6eed=_0x5bbc37[_0x3d51('0x12')];if(_0x2e79aa){_0x2e79aa=_[_0x3d51('0x13')](_0x5bbc37[_0x3d51('0x14')]);_0x2e79aa=_[_0x3d51('0x15')](_0x2e79aa,[_0x3d51('0x14'),'html',_0x3d51('0x16'),_0x3d51('0x17'),_0x3d51('0x18')]);}updateUser(_0x3ae76c,_0x2e79aa,_0x4c6eed,_0x49e07a,_0x438946);_0x1d508e(null);};}; \ No newline at end of file +var _0x0812=['name','stringify','Interaction','findOne','update','then','info','catch','error','tracked','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x121359,_0x35f15b){var _0x5aeb22=function(_0x111ce5){while(--_0x111ce5){_0x121359['push'](_0x121359['shift']());}};_0x5aeb22(++_0x35f15b);}(_0x0812,0xc0));var _0x2081=function(_0x5f3efe,_0x43945b){_0x5f3efe=_0x5f3efe-0x0;var _0x54e4fd=_0x0812[_0x5f3efe];return _0x54e4fd;};'use strict';var _=require('lodash');var db=require(_0x2081('0x0'))['db'];var loggers={'openchannel':require(_0x2081('0x1'))(_0x2081('0x2')),'mail':require(_0x2081('0x1'))(_0x2081('0x3')),'fax':require('../../config/logger')(_0x2081('0x4')),'sms':require(_0x2081('0x1'))(_0x2081('0x5')),'chat':require(_0x2081('0x1'))(_0x2081('0x6')),'whatsapp':require(_0x2081('0x1'))('whatsapp-interactions')};function getInteractionId(_0xd91547,_0x565032,_0x23416c){if(_0xd91547&&_0xd91547[_['upperFirst'](_0x23416c)+_0x2081('0x7')]){return _0xd91547[_[_0x2081('0x8')](_0x23416c)+'InteractionId'];}else if(_0xd91547&&_0xd91547['id']){return _0xd91547['id'];}else if(_0x565032&&_0x565032['id']){return _0x565032['id'];}else{return'unknown';}}function log(_0x5d9869,_0x16048d,_0x716fc1,_0x1d6050,_0x1739c6,_0x290c8e){loggers[_0x1739c6[_0x2081('0x9')]()][_0x5d9869](_0x2081('0xa'),_0x290c8e['toUpperCase'](),_0x16048d?_0x16048d['id']:null,_0x16048d?_0x16048d[_0x2081('0xb')]:null,_0x16048d?_0x16048d['role']:null,getInteractionId(_0x716fc1,_0x1d6050,_0x1739c6),_0x716fc1?JSON[_0x2081('0xc')](_0x716fc1):'null');}function updateUser(_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513){db[_[_0x2081('0x8')](_0x480255)+_0x2081('0xd')][_0x2081('0xe')]({'where':{'id':getInteractionId(_0x4a6dfe,_0x1524be,_0x480255)}})['then'](function(_0x5ae924){if(_0x5ae924){return _0x5ae924[_0x2081('0xf')]({'UserId':_0x239236?_0x239236['id']:null});}})[_0x2081('0x10')](function(_0x2180c4){if(_0x2180c4){log(_0x2081('0x11'),_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513);}})[_0x2081('0x12')](function(){log(_0x2081('0x13'),_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513);});}exports[_0x2081('0x14')]=function(_0x5e1a31,_0x593680){return function(_0x3209d4,_0x6f5c1e,_0x3de36c){var _0xe50f36=_0x3209d4['user'];var _0x1fde3b={};var _0x4ee909=_0x3209d4[_0x2081('0x15')];if(_0x1fde3b){_0x1fde3b=_[_0x2081('0x16')](_0x3209d4[_0x2081('0x17')]);_0x1fde3b=_[_0x2081('0x18')](_0x1fde3b,[_0x2081('0x17'),_0x2081('0x19'),_0x2081('0x1a'),_0x2081('0x1b'),_0x2081('0x1c')]);}updateUser(_0xe50f36,_0x1fde3b,_0x4ee909,_0x5e1a31,_0x593680);_0x3de36c(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 531015a..88fee87 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 _0xeef5=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','count'];(function(_0x5d5c49,_0x528f94){var _0x41cb72=function(_0x4fe8e2){while(--_0x4fe8e2){_0x5d5c49['push'](_0x5d5c49['shift']());}};_0x41cb72(++_0x528f94);}(_0xeef5,0x109));var _0x5eef=function(_0x54d220,_0x42694d){_0x54d220=_0x54d220-0x0;var _0x12c14c=_0xeef5[_0x54d220];return _0x12c14c;};'use strict';var crypto=require(_0x5eef('0x0'));var util=require(_0x5eef('0x1'));var compose=require(_0x5eef('0x2'));var db=require(_0x5eef('0x3'))['db'];var config=require(_0x5eef('0x4'));function getValueFromLicense(_0x3b4995,_0x576e2f){if(_0x3b4995&&_0x576e2f){if(_0x576e2f[_0x5eef('0x5')]&&_0x576e2f['license']){var _0xc0c5a=_0x576e2f[_0x5eef('0x5')];var _0x1fe7d5=_0x576e2f[_0x5eef('0x6')];var _0x5822ca=_0xc0c5a['split']('-')[0x4];var _0x396cc6=_0xc0c5a[_0x5eef('0x7')]('-')[0x0];var _0x3389bb=crypto[_0x5eef('0x8')](_0x5eef('0x9'),util[_0x5eef('0xa')](_0x5eef('0xb'),_0x5822ca,_0xc0c5a,_0x396cc6));var _0x21ae08=_0x3389bb[_0x5eef('0xc')](_0x1fe7d5,_0x5eef('0xd'),_0x5eef('0xe'));_0x21ae08+=_0x3389bb[_0x5eef('0xf')](_0x5eef('0xe'));var _0x2d9086=JSON[_0x5eef('0x10')](_0x21ae08);return _0x2d9086[_0x5eef('0x11')](_0x3b4995)?_0x2d9086[_0x3b4995]:null;}}return null;}function isLimit(_0x18ec29,_0x2d46b5,_0x127b37,_0x49588b){var _0x4e44ef=_0x2d46b5;return compose()[_0x5eef('0x12')](function(_0x4b1f45,_0x182d89,_0xe0f666){return db[_0x5eef('0x13')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x48303b){var _0xd196aa=getValueFromLicense(_0x18ec29,_0x48303b);return _0xd196aa?_0xd196aa:_0x4e44ef;})['then'](function(_0x414bbb){_0x4e44ef=_0x414bbb;return _0x127b37[_0x5eef('0x14')](_0x49588b);})['then'](function(_0xe8e2f6){if(_0xe8e2f6>=_0x4e44ef){return _0x182d89['status'](0x193)[_0x5eef('0x15')]({'message':util[_0x5eef('0xa')](_0x5eef('0x16'),_0x18ec29)});}_0xe0f666();})[_0x5eef('0x17')](function(_0x223b12){_0xe0f666(_0x223b12);});});}function isUserLimit(){return isLimit(_0x5eef('0x18'),0x1,db[_0x5eef('0x19')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x84aa=['user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin'];(function(_0x5e0bda,_0x4c9b6b){var _0x5cc542=function(_0x392a5c){while(--_0x392a5c){_0x5e0bda['push'](_0x5e0bda['shift']());}};_0x5cc542(++_0x4c9b6b);}(_0x84aa,0xbf));var _0xa84a=function(_0x371e53,_0x2483f4){_0x371e53=_0x371e53-0x0;var _0x589756=_0x84aa[_0x371e53];return _0x589756;};'use strict';var crypto=require(_0xa84a('0x0'));var util=require('util');var compose=require(_0xa84a('0x1'));var db=require(_0xa84a('0x2'))['db'];var config=require(_0xa84a('0x3'));function getValueFromLicense(_0x56b7ad,_0x2b7c80){if(_0x56b7ad&&_0x2b7c80){if(_0x2b7c80['data1']&&_0x2b7c80['license']){var _0x32418d=_0x2b7c80['data1'];var _0x2e29a5=_0x2b7c80['license'];var _0x1d4f54=_0x32418d[_0xa84a('0x4')]('-')[0x4];var _0x3e2e8f=_0x32418d[_0xa84a('0x4')]('-')[0x0];var _0xfeba66=crypto[_0xa84a('0x5')]('aes-256-ctr',util[_0xa84a('0x6')](_0xa84a('0x7'),_0x1d4f54,_0x32418d,_0x3e2e8f));var _0x4c927d=_0xfeba66[_0xa84a('0x8')](_0x2e29a5,'base64',_0xa84a('0x9'));_0x4c927d+=_0xfeba66[_0xa84a('0xa')](_0xa84a('0x9'));var _0x40ed56=JSON[_0xa84a('0xb')](_0x4c927d);return _0x40ed56[_0xa84a('0xc')](_0x56b7ad)?_0x40ed56[_0x56b7ad]:null;}}return null;}function isLimit(_0x393832,_0x4934c3,_0x330d52,_0x599cb6){var _0xb3abdc=_0x4934c3;return compose()[_0xa84a('0xd')](function(_0x3a926a,_0x1aa03a,_0x5f0fd9){return db[_0xa84a('0xe')][_0xa84a('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x35b2c3){var _0x132e47=getValueFromLicense(_0x393832,_0x35b2c3);return _0x132e47?_0x132e47:_0xb3abdc;})['then'](function(_0x4fdc38){_0xb3abdc=_0x4fdc38;return _0x330d52[_0xa84a('0x10')](_0x599cb6);})[_0xa84a('0x11')](function(_0x1763fa){if(_0x1763fa>=_0xb3abdc){return _0x1aa03a[_0xa84a('0x12')](0x193)[_0xa84a('0x13')]({'message':util[_0xa84a('0x6')](_0xa84a('0x14'),_0x393832)});}_0x5f0fd9();})[_0xa84a('0x15')](function(_0x1dca20){_0x5f0fd9(_0x1dca20);});});}function isUserLimit(){return isLimit(_0xa84a('0x16'),0x1,db[_0xa84a('0x17')],{'where':{'$or':[{'role':_0xa84a('0x18')},{'role':_0xa84a('0x19')}]}});}exports[_0xa84a('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index ae07cc9..dea4ef2 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 _0x0e7a=['$eq','=\x20?','$ne','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?'];(function(_0x76dd51,_0x59e662){var _0x4f03f7=function(_0x54f44d){while(--_0x54f44d){_0x76dd51['push'](_0x76dd51['shift']());}};_0x4f03f7(++_0x59e662);}(_0x0e7a,0x193));var _0xa0e7=function(_0xb3688c,_0x2a2b1a){_0xb3688c=_0xb3688c-0x0;var _0x1220a6=_0x0e7a[_0xb3688c];return _0x1220a6;};'use strict';var _=require(_0xa0e7('0x0'));var moment=require(_0xa0e7('0x1'));exports[_0xa0e7('0x2')]=function(_0x1824a6){var _0x2bb1be={'conditions':[]};_0x2bb1be[_0xa0e7('0x3')]=_[_0xa0e7('0x4')](_0x1824a6,'[$or]')?'or':_0xa0e7('0x5');var _0x5c2bb3=_0x1824a6[_0xa0e7('0x6')](_0xa0e7('0x7'),'')['replace'](_0xa0e7('0x8'),'')[_0xa0e7('0x9')]('||');for(var _0x1be941=0x0;_0x1be941<_0x5c2bb3[_0xa0e7('0xa')];_0x1be941++){var _0x4f4859=_0x5c2bb3[_0x1be941][_0xa0e7('0x9')](':=');var _0x10cbb7=_0x4f4859[0x0];var _0x505abd=_0x4f4859[_0xa0e7('0xb')](0x1);_0x505abd[_0xa0e7('0xc')](function(_0x2657a1){var _0x43dca1=_0x2657a1[_0xa0e7('0x9')]('[')[_0xa0e7('0xd')]();var _0x42afdf=_0x2657a1[_0xa0e7('0xe')](/\[(.*?)\]/g);_0x42afdf[_0xa0e7('0xc')](function(_0x55b699){var _0x7df0e2=_0x55b699['split']('[')['filter'](function(_0x4c3d11){return _0x4c3d11[_0xa0e7('0xf')](']')>-0x1;})[_0xa0e7('0x10')](function(_0x37df1b){return _0x37df1b[_0xa0e7('0x9')](']')[0x0];})[0x0];_0x2bb1be[_0xa0e7('0x11')][_0xa0e7('0x12')]({'field':_0x10cbb7,'operator':_0x43dca1,'value':_0x7df0e2});});});}return _0x2bb1be;};exports[_0xa0e7('0x13')]=function(_0x15b2cb,_0x1f3863,_0x132459){var _0x584478={};if(_0x1f3863===_0xa0e7('0x14')){if(_0x132459['operator']==='$eq'){_0x132459[_0xa0e7('0x15')]=_0xa0e7('0x16');_0x132459[_0xa0e7('0x17')]+=','+_0x132459[_0xa0e7('0x17')];}else if(_[_0xa0e7('0x18')](['$gt',_0xa0e7('0x19')],_0x132459[_0xa0e7('0x15')])){_0x132459[_0xa0e7('0x17')]=moment(_0x132459[_0xa0e7('0x17')])[_0xa0e7('0x1a')](0x1,_0xa0e7('0x1b'))[_0xa0e7('0x1c')](_0xa0e7('0x1d'));}}if(_0x132459[_0xa0e7('0x1e')]){_0x1f3863=_0x132459[_0xa0e7('0x1e')];_0x584478[_0xa0e7('0x1f')]='CAST('+_0x15b2cb+'.'+_0x132459['field']+'\x20AS\x20'+_0x132459[_0xa0e7('0x1e')]+')\x20'+parseOperator(_0x132459['operator']);}else{_0x584478[_0xa0e7('0x1f')]=_0x15b2cb+'.'+_0x132459[_0xa0e7('0x20')]+'\x20'+parseOperator(_0x132459[_0xa0e7('0x15')]);}if(_[_0xa0e7('0x18')](['$ne',_0xa0e7('0x21')],_0x132459[_0xa0e7('0x15')]))_0x584478[_0xa0e7('0x1f')]='('+_0x584478['text']+_0xa0e7('0x22')+_0x15b2cb+'.'+_0x132459[_0xa0e7('0x20')]+_0xa0e7('0x23');_0x584478[_0xa0e7('0x17')]=parseValue(_0x1f3863,_0x132459[_0xa0e7('0x15')],_0x132459[_0xa0e7('0x17')]);return _0x584478;};function parseOperator(_0x40f392){var _0x3f833f;switch(_0x40f392){case'$in':_0x3f833f='IN\x20?';break;case'$notIn':_0x3f833f=_0xa0e7('0x24');break;case _0xa0e7('0x25'):_0x3f833f=_0xa0e7('0x26');break;case _0xa0e7('0x27'):_0x3f833f='<>\x20?';break;case _0xa0e7('0x28'):case _0xa0e7('0x29'):case _0xa0e7('0x2a'):_0x3f833f='LIKE\x20?';break;case _0xa0e7('0x2b'):_0x3f833f=_0xa0e7('0x2c');break;case'$gt':_0x3f833f=_0xa0e7('0x2d');break;case _0xa0e7('0x19'):_0x3f833f='<=\x20?';break;case _0xa0e7('0x2e'):_0x3f833f=_0xa0e7('0x2f');break;case _0xa0e7('0x16'):_0x3f833f=_0xa0e7('0x30');break;}return _0x3f833f;}function parseValue(_0x206f6e,_0x148a2c,_0x289264){var _0x27b266={'start':undefined,'end':undefined};switch(_0x148a2c){case _0xa0e7('0x31'):case'$notIn':_0x27b266[_0xa0e7('0x32')]=_0x289264[_0xa0e7('0x9')](',');break;case _0xa0e7('0x28'):_0x27b266[_0xa0e7('0x32')]='%'+_0x289264+'%';break;case _0xa0e7('0x29'):_0x27b266[_0xa0e7('0x32')]=_0x289264+'%';break;case _0xa0e7('0x2a'):_0x27b266[_0xa0e7('0x32')]='%'+_0x289264;break;case _0xa0e7('0x16'):var _0x76bbf0=_0x289264[_0xa0e7('0x9')](',');var _0x289264=_0x76bbf0[_0xa0e7('0xd')]();var _0x144df5=_0x76bbf0['pop']();if(_0x206f6e===_0xa0e7('0x14')){_0x289264=moment(_0x289264)[_0xa0e7('0x33')](0x0,!![])[_0xa0e7('0x1c')]();_0x144df5=moment(_0x144df5)[_0xa0e7('0x33')](0x0,!![])[_0xa0e7('0x1a')](0x17,_0xa0e7('0x34'))[_0xa0e7('0x1a')](0x3b,_0xa0e7('0x35'))[_0xa0e7('0x1a')](0x3b,_0xa0e7('0x36'))[_0xa0e7('0x1c')]();}_0x27b266={'start':_0x289264,'end':_0x144df5};break;default:_0x27b266[_0xa0e7('0x32')]=_0x289264;break;}return _0x27b266;} \ No newline at end of file +var _0xc774=['$startsWith','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','split','slice','forEach','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start'];(function(_0x4d4065,_0x552d1e){var _0x475a23=function(_0x520f87){while(--_0x520f87){_0x4d4065['push'](_0x4d4065['shift']());}};_0x475a23(++_0x552d1e);}(_0xc774,0x119));var _0x4c77=function(_0x2283aa,_0x1b36aa){_0x2283aa=_0x2283aa-0x0;var _0x5ad23f=_0xc774[_0x2283aa];return _0x5ad23f;};'use strict';var _=require(_0x4c77('0x0'));var moment=require(_0x4c77('0x1'));exports[_0x4c77('0x2')]=function(_0x5423ab){var _0x566585={'conditions':[]};_0x566585[_0x4c77('0x3')]=_['startsWith'](_0x5423ab,_0x4c77('0x4'))?'or':_0x4c77('0x5');var _0xb116dc=_0x5423ab['replace'](_0x4c77('0x6'),'')['replace'](_0x4c77('0x4'),'')['split']('||');for(var _0x120940=0x0;_0x120940<_0xb116dc['length'];_0x120940++){var _0x381420=_0xb116dc[_0x120940][_0x4c77('0x7')](':=');var _0x44578c=_0x381420[0x0];var _0x36d8de=_0x381420[_0x4c77('0x8')](0x1);_0x36d8de[_0x4c77('0x9')](function(_0x5baa94){var _0x5c29ec=_0x5baa94[_0x4c77('0x7')]('[')['shift']();var _0x57d5a4=_0x5baa94[_0x4c77('0xa')](/\[(.*?)\]/g);_0x57d5a4[_0x4c77('0x9')](function(_0x1a6ba){var _0x37f017=_0x1a6ba[_0x4c77('0x7')]('[')[_0x4c77('0xb')](function(_0xd95b45){return _0xd95b45[_0x4c77('0xc')](']')>-0x1;})[_0x4c77('0xd')](function(_0x3f16e3){return _0x3f16e3['split'](']')[0x0];})[0x0];_0x566585[_0x4c77('0xe')]['push']({'field':_0x44578c,'operator':_0x5c29ec,'value':_0x37f017});});});}return _0x566585;};exports[_0x4c77('0xf')]=function(_0x538d07,_0xc30ec,_0x205ba1){var _0x4ac510={};if(_0xc30ec===_0x4c77('0x10')){if(_0x205ba1['operator']==='$eq'){_0x205ba1[_0x4c77('0x11')]=_0x4c77('0x12');_0x205ba1[_0x4c77('0x13')]+=','+_0x205ba1['value'];}else if(_[_0x4c77('0x14')]([_0x4c77('0x15'),_0x4c77('0x16')],_0x205ba1[_0x4c77('0x11')])){_0x205ba1['value']=moment(_0x205ba1[_0x4c77('0x13')])[_0x4c77('0x17')](0x1,_0x4c77('0x18'))[_0x4c77('0x19')](_0x4c77('0x1a'));}}if(_0x205ba1[_0x4c77('0x1b')]){_0xc30ec=_0x205ba1[_0x4c77('0x1b')];_0x4ac510['text']='CAST('+_0x538d07+'.'+_0x205ba1[_0x4c77('0x1c')]+_0x4c77('0x1d')+_0x205ba1[_0x4c77('0x1b')]+')\x20'+parseOperator(_0x205ba1[_0x4c77('0x11')]);}else{_0x4ac510[_0x4c77('0x1e')]=_0x538d07+'.'+_0x205ba1['field']+'\x20'+parseOperator(_0x205ba1[_0x4c77('0x11')]);}if(_['includes']([_0x4c77('0x1f'),'$notIn'],_0x205ba1[_0x4c77('0x11')]))_0x4ac510[_0x4c77('0x1e')]='('+_0x4ac510[_0x4c77('0x1e')]+'\x20OR\x20'+_0x538d07+'.'+_0x205ba1[_0x4c77('0x1c')]+_0x4c77('0x20');_0x4ac510[_0x4c77('0x13')]=parseValue(_0xc30ec,_0x205ba1[_0x4c77('0x11')],_0x205ba1['value']);return _0x4ac510;};function parseOperator(_0x3dafdd){var _0x5fd622;switch(_0x3dafdd){case'$in':_0x5fd622=_0x4c77('0x21');break;case'$notIn':_0x5fd622=_0x4c77('0x22');break;case _0x4c77('0x23'):_0x5fd622=_0x4c77('0x24');break;case _0x4c77('0x1f'):_0x5fd622=_0x4c77('0x25');break;case _0x4c77('0x26'):case'$startsWith':case _0x4c77('0x27'):_0x5fd622=_0x4c77('0x28');break;case'$lt':_0x5fd622=_0x4c77('0x29');break;case _0x4c77('0x15'):_0x5fd622=_0x4c77('0x2a');break;case _0x4c77('0x16'):_0x5fd622=_0x4c77('0x2b');break;case _0x4c77('0x2c'):_0x5fd622=_0x4c77('0x2d');break;case _0x4c77('0x12'):_0x5fd622=_0x4c77('0x2e');break;}return _0x5fd622;}function parseValue(_0x22f192,_0x52d55a,_0x39850f){var _0x38ab0b={'start':undefined,'end':undefined};switch(_0x52d55a){case _0x4c77('0x2f'):case'$notIn':_0x38ab0b[_0x4c77('0x30')]=_0x39850f['split'](',');break;case _0x4c77('0x26'):_0x38ab0b[_0x4c77('0x30')]='%'+_0x39850f+'%';break;case _0x4c77('0x31'):_0x38ab0b[_0x4c77('0x30')]=_0x39850f+'%';break;case _0x4c77('0x27'):_0x38ab0b['start']='%'+_0x39850f;break;case _0x4c77('0x12'):var _0x3a3cfb=_0x39850f['split'](',');var _0x39850f=_0x3a3cfb['shift']();var _0x3c6d22=_0x3a3cfb[_0x4c77('0x32')]();if(_0x22f192===_0x4c77('0x10')){_0x39850f=moment(_0x39850f)[_0x4c77('0x33')](0x0,!![])[_0x4c77('0x19')]();_0x3c6d22=moment(_0x3c6d22)[_0x4c77('0x33')](0x0,!![])['add'](0x17,_0x4c77('0x34'))[_0x4c77('0x17')](0x3b,_0x4c77('0x35'))[_0x4c77('0x17')](0x3b,_0x4c77('0x36'))[_0x4c77('0x19')]();}_0x38ab0b={'start':_0x39850f,'end':_0x3c6d22};break;default:_0x38ab0b[_0x4c77('0x30')]=_0x39850f;break;}return _0x38ab0b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 28ccbd7..a457c29 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 _0x2eef=['attributes','order','where','pick','filter','merge','VIRTUAL','lower','options','lodash','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','push','join','getOptions','query','$id','model','name','intersection'];(function(_0x27632c,_0x15caad){var _0x460308=function(_0x4e6da4){while(--_0x4e6da4){_0x27632c['push'](_0x27632c['shift']());}};_0x460308(++_0x15caad);}(_0x2eef,0x1ad));var _0xf2ee=function(_0x331e0d,_0x3ec5b3){_0x331e0d=_0x331e0d-0x0;var _0x338ea1=_0x2eef[_0x331e0d];return _0x338ea1;};'use strict';var _=require(_0xf2ee('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x43ad9b){var _0x1d63cb=['ne'];try{var _0x33e1bb=JSON[_0xf2ee('0x1')](_0x43ad9b);var _0x42aa51=Object[_0xf2ee('0x2')](_0x33e1bb)[0x0];return _0x1d63cb[_0xf2ee('0x3')](_0x42aa51);}catch(_0x20ee21){return![];}}function getOperatorValue(_0x7a6908){var _0x3e25d1=JSON['parse'](_0x7a6908);var _0xe94d7d=Object[_0xf2ee('0x2')](_0x3e25d1)[0x0];var _0x243ebd=_0x3e25d1[_0xe94d7d];return{['$'+_0xe94d7d]:_0x243ebd};}exports[_0xf2ee('0x4')]=function(_0x791242){var _0x541371=null;if(_0x791242){_0x541371=_0x791242[_0xf2ee('0x5')](',');}return _0x541371;};exports[_0xf2ee('0x6')]=function(_0x4ea2b1,_0x7f3448){var _0x4e92a0={};if(!_[_0xf2ee('0x7')](_0x4ea2b1)){_[_0xf2ee('0x8')](_0x4ea2b1,function(_0x237867,_0x30bf2e){try{if(_0x7f3448){var _0x574b10=_[_0xf2ee('0x9')](_0x7f3448,{'name':_0x30bf2e})||{};if(hasSequelizeOperator(_0x237867)){_0x4e92a0[_0x30bf2e]=getOperatorValue(_0x237867);}else if(_0x574b10[_0xf2ee('0xa')]===_0xf2ee('0xb')&&_[_0xf2ee('0xc')](_0x237867)){var _0x3f9cbb=JSON['parse'](_0x237867);var _0x152c01={'$gte':moment(moment(_0x3f9cbb[_0xf2ee('0xd')])['format'](_0xf2ee('0xe')))[_0xf2ee('0xf')]()[_0xf2ee('0x10')](),'$lte':moment(moment(_0x3f9cbb[_0xf2ee('0x11')])[_0xf2ee('0x10')]('YYYY-MM-DD'))[_0xf2ee('0xf')]()[_0xf2ee('0x12')](0x1,'s')['format']()};_0x4e92a0[_0x30bf2e]=_0x152c01;}else if(_0x574b10['name']===_0xf2ee('0x13')){_0x4e92a0[_0x30bf2e]=_0x237867;}else{_0x4e92a0[_0x30bf2e]=_[_0xf2ee('0x14')](_0x237867)?_0x237867:JSON[_0xf2ee('0x1')](_0x237867);}}else{_0x4e92a0[_0x30bf2e]=_[_0xf2ee('0x14')](_0x237867)?_0x237867:JSON['parse'](_0x237867);}}catch(_0x12471f){_0x4e92a0[_0x30bf2e]=_0x237867[_0xf2ee('0x5')](',');}});}return _0x4e92a0;};exports[_0xf2ee('0x15')]=function(_0x349e4b){_0x349e4b=parseInt(_0x349e4b,0xa);if(!_0x349e4b||_0x349e4b<0x0){_0x349e4b=LIMIT_VALUE;}return _0x349e4b;};exports[_0xf2ee('0x16')]=function(_0x384e6b){_0x384e6b=parseInt(_0x384e6b,0xa);if(!_0x384e6b||_0x384e6b<0x0){_0x384e6b=0x0;}return _0x384e6b;};exports[_0xf2ee('0x17')]=function(_0x4877e4){var _0x2eeb99,_0x511a01=null;if(_0x4877e4){_0x2eeb99=_0x4877e4[_0xf2ee('0x5')](',');_0x511a01=_[_0xf2ee('0x18')](_0x2eeb99,function(_0xaa2f5e){if(_0xaa2f5e[_0xf2ee('0x19')]('-')===0x0){return[_0xaa2f5e===_0xf2ee('0x1a')?sequelize[_0xf2ee('0x1b')](sequelize[_0xf2ee('0x1c')]('priority'),_0xf2ee('0x1d')):_0xaa2f5e[_0xf2ee('0x1e')](0x1),_0xf2ee('0x1f')];}else{return[_0xaa2f5e===_0xf2ee('0x1a')?sequelize[_0xf2ee('0x1b')](sequelize['col'](_0xf2ee('0x1a')),'unsigned'):_0xaa2f5e,_0xf2ee('0x20')];}});}return _0x511a01;};exports[_0xf2ee('0x21')]=function(_0x361e76,_0x4cbbd6){if(_[_0xf2ee('0x7')](_0x361e76)){return _0x361e76;}if(_['isArray'](_0x361e76)){for(var _0x13a7f2=0x0;_0x13a7f2<_0x361e76[_0xf2ee('0x22')];_0x13a7f2+=0x1){_0x361e76[_0x13a7f2]=this[_0xf2ee('0x21')](_0x361e76[_0x13a7f2],_0x4cbbd6);}return _0x361e76;}if(!_[_0xf2ee('0x23')](_0x361e76)){return _0x361e76;}if(_[_0xf2ee('0x24')](_0x4cbbd6)){_0x4cbbd6=[_0x4cbbd6];}if(!_[_0xf2ee('0x14')](_0x4cbbd6)){return _0x361e76;}for(var _0xc68e99=0x0;_0xc68e99<_0x4cbbd6[_0xf2ee('0x22')];_0xc68e99+=0x1){_[_0xf2ee('0x25')](_0x361e76,_0x4cbbd6[_0xc68e99]);}for(var _0x63be3d in _0x361e76){if(_0x361e76['hasOwnProperty'](_0x63be3d)){_0x361e76[_0x63be3d]=this['omit'](_0x361e76[_0x63be3d],_0x4cbbd6);}}return _0x361e76;};exports[_0xf2ee('0x26')]=function(_0x4c2ea3){return _0x4c2ea3[_0xf2ee('0x27')](RegExp(_0xf2ee('0x28')))?!![]:![];};exports[_0xf2ee('0x29')]=function(_0x2c9add){return _0x2c9add[_0xf2ee('0x27')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2f4677){var _0x337586=[];_0x2f4677[_0xf2ee('0x5')](/[ ,]+/)[_0xf2ee('0x2a')](function(_0x2f7335){_0x2f7335=_0x2f7335['replace'](/([^:]")"+/g,'$1');_0x2f7335='+'+_0x2f7335+'*';if(_0x2f7335[_0xf2ee('0x3')]('@'))_0x2f7335='\x22'+_0x2f7335+'\x22';_0x337586[_0xf2ee('0x2b')](_0x2f7335);});return _0x337586[_0xf2ee('0x2c')]('\x20');};exports[_0xf2ee('0x2d')]=function(_0x210199,_0x2c8fcf,_0x217d4c){var _0x3c15b7={},_0x40b58c={};if(_0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x2f')]){_0x2c8fcf['query']['id']=_0x2c8fcf['query'][_0xf2ee('0x2f')];delete _0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x2f')];}_0x3c15b7[_0xf2ee('0x30')]=_['map'](_0x210199,_0xf2ee('0x31'));_0x3c15b7[_0xf2ee('0x2e')]=_['keys'](_0x2c8fcf[_0xf2ee('0x2e')]);_0x3c15b7[_0xf2ee('0x6')]=_[_0xf2ee('0x32')](_0x3c15b7['model'],_0x3c15b7[_0xf2ee('0x2e')]);_0x40b58c[_0xf2ee('0x33')]=_['intersection'](_0x3c15b7['model'],this[_0xf2ee('0x4')](_0x2c8fcf['query']['fields']));_0x40b58c[_0xf2ee('0x33')]=_0x40b58c['attributes'][_0xf2ee('0x22')]?_0x40b58c[_0xf2ee('0x33')]:_0x3c15b7[_0xf2ee('0x30')];if(!_0x2c8fcf['query']['hasOwnProperty']('nolimit')){_0x40b58c[_0xf2ee('0x15')]=this[_0xf2ee('0x15')](_0x2c8fcf['query']['limit']);_0x40b58c[_0xf2ee('0x16')]=this[_0xf2ee('0x16')](_0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x16')]);}_0x40b58c[_0xf2ee('0x34')]=this[_0xf2ee('0x17')](_0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x17')]);_0x40b58c[_0xf2ee('0x35')]=this[_0xf2ee('0x6')](_[_0xf2ee('0x36')](_0x2c8fcf[_0xf2ee('0x2e')],_0x3c15b7[_0xf2ee('0x6')]),_0x210199);if(_0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x37')]){_0x40b58c[_0xf2ee('0x35')]=_[_0xf2ee('0x38')](_0x40b58c['where'],{'$or':_[_0xf2ee('0x18')](_0x210199,function(_0x54298a){if(_0x54298a['type']!==_0xf2ee('0x39')){if(_0x217d4c){return sequelize[_0xf2ee('0x35')](sequelize['fn'](_0xf2ee('0x3a'),sequelize[_0xf2ee('0x1c')](_0x54298a[_0xf2ee('0x31')])),{'$like':sequelize['fn']('lower','%'+_0x2c8fcf['query'][_0xf2ee('0x37')]+'%')});}else{var _0x2e4f11={};_0x2e4f11[_0x54298a[_0xf2ee('0x31')]]={'$like':'%'+_0x2c8fcf[_0xf2ee('0x2e')][_0xf2ee('0x37')]+'%'};return _0x2e4f11;}}})});}_0x40b58c=_[_0xf2ee('0x38')]({},_0x40b58c,_0x2c8fcf[_0xf2ee('0x3b')]);return _0x40b58c;}; \ No newline at end of file +var _0x1f76=['getFullTextValue','replace','push','join','getOptions','query','$id','model','name','attributes','intersection','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','uniqueid','isArray','split','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','length','omit','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0x1f76,0x17b));var _0x61f7=function(_0x26ef33,_0x143c9c){_0x26ef33=_0x26ef33-0x0;var _0x1c654e=_0x1f76[_0x26ef33];return _0x1c654e;};'use strict';var _=require('lodash');var sequelize=require(_0x61f7('0x0'));var moment=require(_0x61f7('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xc9f103){var _0x590b79=['ne'];try{var _0x38eb34=JSON[_0x61f7('0x2')](_0xc9f103);var _0x3d1c05=Object[_0x61f7('0x3')](_0x38eb34)[0x0];return _0x590b79[_0x61f7('0x4')](_0x3d1c05);}catch(_0xe8ff81){return![];}}function getOperatorValue(_0x5e7495){var _0x24bd5a=JSON['parse'](_0x5e7495);var _0x13432=Object[_0x61f7('0x3')](_0x24bd5a)[0x0];var _0x15cd2c=_0x24bd5a[_0x13432];return{['$'+_0x13432]:_0x15cd2c};}exports[_0x61f7('0x5')]=function(_0x1b0d46){var _0x10e56b=null;if(_0x1b0d46){_0x10e56b=_0x1b0d46['split'](',');}return _0x10e56b;};exports[_0x61f7('0x6')]=function(_0x311a14,_0x13a002){var _0x268d44={};if(!_[_0x61f7('0x7')](_0x311a14)){_[_0x61f7('0x8')](_0x311a14,function(_0x14887d,_0x12e07c){try{if(_0x13a002){var _0x49c683=_['find'](_0x13a002,{'name':_0x12e07c})||{};if(hasSequelizeOperator(_0x14887d)){_0x268d44[_0x12e07c]=getOperatorValue(_0x14887d);}else if(_0x49c683[_0x61f7('0x9')]===_0x61f7('0xa')&&_[_0x61f7('0xb')](_0x14887d)){var _0x116fe8=JSON[_0x61f7('0x2')](_0x14887d);var _0x12ff85={'$gte':moment(moment(_0x116fe8[_0x61f7('0xc')])['format'](_0x61f7('0xd')))[_0x61f7('0xe')]()[_0x61f7('0xf')](),'$lte':moment(moment(_0x116fe8['$lte'])[_0x61f7('0xf')](_0x61f7('0xd')))[_0x61f7('0xe')]()[_0x61f7('0x10')](0x1,'s')[_0x61f7('0xf')]()};_0x268d44[_0x12e07c]=_0x12ff85;}else if(_0x49c683['name']===_0x61f7('0x11')){_0x268d44[_0x12e07c]=_0x14887d;}else{_0x268d44[_0x12e07c]=_[_0x61f7('0x12')](_0x14887d)?_0x14887d:JSON[_0x61f7('0x2')](_0x14887d);}}else{_0x268d44[_0x12e07c]=_['isArray'](_0x14887d)?_0x14887d:JSON['parse'](_0x14887d);}}catch(_0x5a6304){_0x268d44[_0x12e07c]=_0x14887d[_0x61f7('0x13')](',');}});}return _0x268d44;};exports[_0x61f7('0x14')]=function(_0x1c023f){_0x1c023f=parseInt(_0x1c023f,0xa);if(!_0x1c023f||_0x1c023f<0x0){_0x1c023f=LIMIT_VALUE;}return _0x1c023f;};exports[_0x61f7('0x15')]=function(_0x3da276){_0x3da276=parseInt(_0x3da276,0xa);if(!_0x3da276||_0x3da276<0x0){_0x3da276=0x0;}return _0x3da276;};exports[_0x61f7('0x16')]=function(_0x4534d7){var _0x211bc1,_0x5d7ff9=null;if(_0x4534d7){_0x211bc1=_0x4534d7[_0x61f7('0x13')](',');_0x5d7ff9=_[_0x61f7('0x17')](_0x211bc1,function(_0x43bd26){if(_0x43bd26[_0x61f7('0x18')]('-')===0x0){return[_0x43bd26==='priority'?sequelize[_0x61f7('0x19')](sequelize[_0x61f7('0x1a')](_0x61f7('0x1b')),_0x61f7('0x1c')):_0x43bd26[_0x61f7('0x1d')](0x1),_0x61f7('0x1e')];}else{return[_0x43bd26===_0x61f7('0x1b')?sequelize[_0x61f7('0x19')](sequelize['col'](_0x61f7('0x1b')),_0x61f7('0x1c')):_0x43bd26,_0x61f7('0x1f')];}});}return _0x5d7ff9;};exports['omit']=function(_0x575caa,_0x350237){if(_['isEmpty'](_0x575caa)){return _0x575caa;}if(_[_0x61f7('0x12')](_0x575caa)){for(var _0x1cd0fd=0x0;_0x1cd0fd<_0x575caa[_0x61f7('0x20')];_0x1cd0fd+=0x1){_0x575caa[_0x1cd0fd]=this[_0x61f7('0x21')](_0x575caa[_0x1cd0fd],_0x350237);}return _0x575caa;}if(!_['isObject'](_0x575caa)){return _0x575caa;}if(_[_0x61f7('0x22')](_0x350237)){_0x350237=[_0x350237];}if(!_[_0x61f7('0x12')](_0x350237)){return _0x575caa;}for(var _0x314b7b=0x0;_0x314b7b<_0x350237[_0x61f7('0x20')];_0x314b7b+=0x1){_[_0x61f7('0x23')](_0x575caa,_0x350237[_0x314b7b]);}for(var _0x47941e in _0x575caa){if(_0x575caa[_0x61f7('0x24')](_0x47941e)){_0x575caa[_0x47941e]=this[_0x61f7('0x21')](_0x575caa[_0x47941e],_0x350237);}}return _0x575caa;};exports[_0x61f7('0x25')]=function(_0xa38f85){return _0xa38f85[_0x61f7('0x26')](RegExp(_0x61f7('0x27')))?!![]:![];};exports[_0x61f7('0x28')]=function(_0x28e022){return _0x28e022[_0x61f7('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x61f7('0x29')]=function(_0x201459){var _0x5d2d23=[];_0x201459['split'](/[ ,]+/)['forEach'](function(_0x45cb80){_0x45cb80=_0x45cb80[_0x61f7('0x2a')](/([^:]")"+/g,'$1');_0x45cb80='+'+_0x45cb80+'*';if(_0x45cb80[_0x61f7('0x4')]('@'))_0x45cb80='\x22'+_0x45cb80+'\x22';_0x5d2d23[_0x61f7('0x2b')](_0x45cb80);});return _0x5d2d23[_0x61f7('0x2c')]('\x20');};exports[_0x61f7('0x2d')]=function(_0xa940b9,_0x3ba3d3,_0x12a0d1){var _0x5d78f5={},_0x145fea={};if(_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x2f')]){_0x3ba3d3['query']['id']=_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x2f')];delete _0x3ba3d3['query'][_0x61f7('0x2f')];}_0x5d78f5[_0x61f7('0x30')]=_['map'](_0xa940b9,_0x61f7('0x31'));_0x5d78f5[_0x61f7('0x2e')]=_[_0x61f7('0x3')](_0x3ba3d3['query']);_0x5d78f5[_0x61f7('0x6')]=_['intersection'](_0x5d78f5[_0x61f7('0x30')],_0x5d78f5[_0x61f7('0x2e')]);_0x145fea[_0x61f7('0x32')]=_[_0x61f7('0x33')](_0x5d78f5['model'],this[_0x61f7('0x5')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x5')]));_0x145fea[_0x61f7('0x32')]=_0x145fea['attributes'][_0x61f7('0x20')]?_0x145fea['attributes']:_0x5d78f5[_0x61f7('0x30')];if(!_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x24')](_0x61f7('0x34'))){_0x145fea['limit']=this[_0x61f7('0x14')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x14')]);_0x145fea[_0x61f7('0x15')]=this[_0x61f7('0x15')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x15')]);}_0x145fea[_0x61f7('0x35')]=this[_0x61f7('0x16')](_0x3ba3d3['query']['sort']);_0x145fea[_0x61f7('0x36')]=this['filters'](_[_0x61f7('0x37')](_0x3ba3d3[_0x61f7('0x2e')],_0x5d78f5[_0x61f7('0x6')]),_0xa940b9);if(_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x38')]){_0x145fea[_0x61f7('0x36')]=_[_0x61f7('0x39')](_0x145fea[_0x61f7('0x36')],{'$or':_['map'](_0xa940b9,function(_0x1c6ab7){if(_0x1c6ab7['type']!==_0x61f7('0x3a')){if(_0x12a0d1){return sequelize[_0x61f7('0x36')](sequelize['fn'](_0x61f7('0x3b'),sequelize['col'](_0x1c6ab7[_0x61f7('0x31')])),{'$like':sequelize['fn'](_0x61f7('0x3b'),'%'+_0x3ba3d3['query'][_0x61f7('0x38')]+'%')});}else{var _0x1ee8af={};_0x1ee8af[_0x1c6ab7[_0x61f7('0x31')]]={'$like':'%'+_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x38')]+'%'};return _0x1ee8af;}}})});}_0x145fea=_[_0x61f7('0x39')]({},_0x145fea,_0x3ba3d3['options']);return _0x145fea;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 62500f2..7be923d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d34=['root','split','use','static','get','/server/views','engine','html','renderFile','view\x20engine','urlencoded','50mb','initialize','express','serve-favicon','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','production','set','appPath','join','development','test'];(function(_0x56b8c4,_0x12b01b){var _0x1a7086=function(_0xdf5e20){while(--_0xdf5e20){_0x56b8c4['push'](_0x56b8c4['shift']());}};_0x1a7086(++_0x12b01b);}(_0x6d34,0x143));var _0x46d3=function(_0x41f8bd,_0x37ce63){_0x41f8bd=_0x41f8bd-0x0;var _0x486f75=_0x6d34[_0x41f8bd];return _0x486f75;};'use strict';var express=require(_0x46d3('0x0'));var favicon=require(_0x46d3('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x46d3('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x46d3('0x3'));var path=require(_0x46d3('0x4'));var passport=require(_0x46d3('0x5'));var cors=require(_0x46d3('0x6'));var moment=require(_0x46d3('0x7'));var config=require(_0x46d3('0x8'));var db=require(_0x46d3('0x9'))['db'];exports[_0x46d3('0xa')]=function(_0x3088aa){var _0x242626=_0x3088aa['get'](_0x46d3('0xb'));if(_0x242626===_0x46d3('0xc')){_0x3088aa[_0x46d3('0xd')](_0x46d3('0xe'),path[_0x46d3('0xf')](config['root'],'public'));}if(_0x242626===_0x46d3('0x10')||_0x242626===_0x46d3('0x11')){_0x3088aa[_0x46d3('0xd')](_0x46d3('0xe'),path['join'](config[_0x46d3('0x12')],'client'));_0x3088aa['use'](errorHandler());}_0x3088aa['set']('json\x20replacer',function(_0x1d7d2d,_0x7e98a3){if(this[_0x1d7d2d]instanceof Date){_0x7e98a3=this[_0x1d7d2d]['toISOString']()[_0x46d3('0x13')]('.')[0x0]+'Z';}return _0x7e98a3;});_0x3088aa[_0x46d3('0x14')](express[_0x46d3('0x15')](_0x3088aa[_0x46d3('0x16')](_0x46d3('0xe'))));_0x3088aa[_0x46d3('0xd')]('views',config[_0x46d3('0x12')]+_0x46d3('0x17'));_0x3088aa[_0x46d3('0x18')](_0x46d3('0x19'),require('ejs')[_0x46d3('0x1a')]);_0x3088aa[_0x46d3('0xd')](_0x46d3('0x1b'),'html');_0x3088aa['use'](bodyParser[_0x46d3('0x1c')]({'limit':'50mb','extended':!![]}));_0x3088aa[_0x46d3('0x14')](bodyParser['json']({'limit':_0x46d3('0x1d')}));_0x3088aa[_0x46d3('0x14')](cors());_0x3088aa[_0x46d3('0x14')](methodOverride());_0x3088aa['use'](cookieParser());_0x3088aa[_0x46d3('0x14')](passport[_0x46d3('0x1e')]());}; \ No newline at end of file +var _0x499d=['development','test','appPath','use','json\x20replacer','toISOString','static','views','html','renderFile','view\x20engine','50mb','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','get','env','production','set','join','root','public'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x499d,0x1ec));var _0xd499=function(_0x1cc5b2,_0x5837e7){_0x1cc5b2=_0x1cc5b2-0x0;var _0x4cbbbd=_0x499d[_0x1cc5b2];return _0x4cbbbd;};'use strict';var express=require(_0xd499('0x0'));var favicon=require(_0xd499('0x1'));var bodyParser=require(_0xd499('0x2'));var methodOverride=require(_0xd499('0x3'));var cookieParser=require(_0xd499('0x4'));var errorHandler=require(_0xd499('0x5'));var path=require(_0xd499('0x6'));var passport=require(_0xd499('0x7'));var cors=require(_0xd499('0x8'));var moment=require(_0xd499('0x9'));var config=require('./environment');var db=require(_0xd499('0xa'))['db'];exports['default']=function(_0x58b0f0){var _0x8870d2=_0x58b0f0[_0xd499('0xb')](_0xd499('0xc'));if(_0x8870d2===_0xd499('0xd')){_0x58b0f0[_0xd499('0xe')]('appPath',path[_0xd499('0xf')](config[_0xd499('0x10')],_0xd499('0x11')));}if(_0x8870d2===_0xd499('0x12')||_0x8870d2===_0xd499('0x13')){_0x58b0f0[_0xd499('0xe')](_0xd499('0x14'),path[_0xd499('0xf')](config[_0xd499('0x10')],'client'));_0x58b0f0[_0xd499('0x15')](errorHandler());}_0x58b0f0[_0xd499('0xe')](_0xd499('0x16'),function(_0x544ed9,_0x13588c){if(this[_0x544ed9]instanceof Date){_0x13588c=this[_0x544ed9][_0xd499('0x17')]()['split']('.')[0x0]+'Z';}return _0x13588c;});_0x58b0f0[_0xd499('0x15')](express[_0xd499('0x18')](_0x58b0f0[_0xd499('0xb')](_0xd499('0x14'))));_0x58b0f0[_0xd499('0xe')](_0xd499('0x19'),config['root']+'/server/views');_0x58b0f0['engine'](_0xd499('0x1a'),require('ejs')[_0xd499('0x1b')]);_0x58b0f0[_0xd499('0xe')](_0xd499('0x1c'),_0xd499('0x1a'));_0x58b0f0[_0xd499('0x15')](bodyParser['urlencoded']({'limit':_0xd499('0x1d'),'extended':!![]}));_0x58b0f0[_0xd499('0x15')](bodyParser['json']({'limit':_0xd499('0x1d')}));_0x58b0f0['use'](cors());_0x58b0f0[_0xd499('0x15')](methodOverride());_0x58b0f0[_0xd499('0x15')](cookieParser());_0x58b0f0[_0xd499('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9e89988..046489a 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 _0x8e70=['crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','ipAddress','update','hex','substring','lodash'];(function(_0x538066,_0x894b22){var _0x1ddaa6=function(_0x396a6d){while(--_0x396a6d){_0x538066['push'](_0x538066['shift']());}};_0x1ddaa6(++_0x894b22);}(_0x8e70,0xcb));var _0x08e7=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8e70[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0x08e7('0x0'));var os=require('os');var crypto=require(_0x08e7('0x1'));var machine=require(_0x08e7('0x2'));var exec=require(_0x08e7('0x3'))[_0x08e7('0x4')];var config=require(_0x08e7('0x5'));function getInterfaces(){var _0x1e83ff=[];var _0x339acb=os[_0x08e7('0x6')]();var _0x229e3b=_[_0x08e7('0x7')](_['keys'](_0x339acb));for(var _0x423ef9=0x0;_0x423ef9<_0x229e3b[_0x08e7('0x8')];_0x423ef9++){var _0x1141b5=_0x339acb[_0x229e3b[_0x423ef9]][_0x08e7('0x9')](function(_0x81e23c){return _0x81e23c[_0x08e7('0xa')]===_0x08e7('0xb')&&_0x81e23c[_0x08e7('0xc')]===![];});_0x1e83ff=_0x1e83ff[_0x08e7('0xd')](_0x1141b5);}return _0x1e83ff;}function getFirstInterface(){var _0x443497=_['head'](getInterfaces());return{'macAddress':_0x443497&&_0x443497[_0x08e7('0xe')]?_0x443497['mac']:_0x08e7('0xf'),'ipAddress':_0x443497&&_0x443497[_0x08e7('0x10')]?_0x443497[_0x08e7('0x10')]:_0x08e7('0x11')};}exports[_0x08e7('0x12')]=getFirstInterface;function getCPUhash(){var _0x5848a3=_[_0x08e7('0x7')](os[_0x08e7('0x13')]()[_0x08e7('0x14')](function(_0x18ef63){return _0x18ef63[_0x08e7('0x15')];}))[_0x08e7('0x16')](':');return crypto[_0x08e7('0x17')](_0x08e7('0x18'))['update'](_0x5848a3)['digest']('hex');}exports[_0x08e7('0x19')]=function(){var _0x33f42f=os['platform']();var _0x538900=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x538900['test'](config['licenseToken'])){return config[_0x08e7('0x1a')];}else if(_0x33f42f===_0x08e7('0x1b')){return exec(_0x08e7('0x1c'),{'encoding':_0x08e7('0x1d')})['replace']('\x0d\x0a','');}else{var _0x3525d3=getFirstInterface();var _0x501563=getCPUhash();var _0x277e8d=_0x501563+'|'+os['hostname']()+'|'+_0x3525d3['macAddress']+'|'+_0x3525d3[_0x08e7('0x1e')];var _0x6ecbbf=crypto[_0x08e7('0x17')](_0x08e7('0x18'))[_0x08e7('0x1f')](_0x277e8d)['digest'](_0x08e7('0x20'));return _0x6ecbbf[_0x08e7('0x21')](0x0,0x8)+'-'+_0x6ecbbf[_0x08e7('0x21')](0x8,0xc)+'-'+_0x6ecbbf[_0x08e7('0x21')](0xc,0x10)+'-'+_0x6ecbbf[_0x08e7('0x21')](0x10,0x14)+'-'+_0x6ecbbf['substring'](0x14);}}; \ No newline at end of file +var _0xb7a4=['platform','licenseToken','win32','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex'];(function(_0xb40d80,_0x4c55dc){var _0x509e3a=function(_0x36bb5d){while(--_0x36bb5d){_0xb40d80['push'](_0xb40d80['shift']());}};_0x509e3a(++_0x4c55dc);}(_0xb7a4,0xae));var _0x4b7a=function(_0x5a138,_0x225902){_0x5a138=_0x5a138-0x0;var _0x19e2b7=_0xb7a4[_0x5a138];return _0x19e2b7;};'use strict';var _=require(_0x4b7a('0x0'));var os=require('os');var crypto=require(_0x4b7a('0x1'));var machine=require(_0x4b7a('0x2'));var exec=require(_0x4b7a('0x3'))[_0x4b7a('0x4')];var config=require(_0x4b7a('0x5'));function getInterfaces(){var _0x286381=[];var _0x204ad8=os[_0x4b7a('0x6')]();var _0x1f68d3=_[_0x4b7a('0x7')](_[_0x4b7a('0x8')](_0x204ad8));for(var _0x27be85=0x0;_0x27be85<_0x1f68d3[_0x4b7a('0x9')];_0x27be85++){var _0x38f7b7=_0x204ad8[_0x1f68d3[_0x27be85]]['filter'](function(_0x394299){return _0x394299['family']===_0x4b7a('0xa')&&_0x394299['internal']===![];});_0x286381=_0x286381[_0x4b7a('0xb')](_0x38f7b7);}return _0x286381;}function getFirstInterface(){var _0x10d041=_[_0x4b7a('0xc')](getInterfaces());return{'macAddress':_0x10d041&&_0x10d041[_0x4b7a('0xd')]?_0x10d041[_0x4b7a('0xd')]:'00:00:00:00:00:00','ipAddress':_0x10d041&&_0x10d041[_0x4b7a('0xe')]?_0x10d041[_0x4b7a('0xe')]:'127.0.0.1'};}exports[_0x4b7a('0xf')]=getFirstInterface;function getCPUhash(){var _0x1aa484=_['orderBy'](os[_0x4b7a('0x10')]()[_0x4b7a('0x11')](function(_0x216d76){return _0x216d76[_0x4b7a('0x12')];}))[_0x4b7a('0x13')](':');return crypto[_0x4b7a('0x14')](_0x4b7a('0x15'))['update'](_0x1aa484)[_0x4b7a('0x16')](_0x4b7a('0x17'));}exports['getUuid']=function(){var _0x5d6a1a=os[_0x4b7a('0x18')]();var _0xece91a=/[0-9a-f-]{36}/;if(config[_0x4b7a('0x19')]&&_0xece91a['test'](config[_0x4b7a('0x19')])){return config[_0x4b7a('0x19')];}else if(_0x5d6a1a===_0x4b7a('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x4b7a('0x1b')]('\x0d\x0a','');}else{var _0x2c8962=getFirstInterface();var _0x59e5fa=getCPUhash();var _0x5762f5=_0x59e5fa+'|'+os[_0x4b7a('0x1c')]()+'|'+_0x2c8962[_0x4b7a('0x1d')]+'|'+_0x2c8962[_0x4b7a('0x1e')];var _0x3bdc52=crypto[_0x4b7a('0x14')]('md5')[_0x4b7a('0x1f')](_0x5762f5)['digest'](_0x4b7a('0x17'));return _0x3bdc52[_0x4b7a('0x20')](0x0,0x8)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x8,0xc)+'-'+_0x3bdc52[_0x4b7a('0x20')](0xc,0x10)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x10,0x14)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 466a1a0..d9afa83 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 _0xe346=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled'];(function(_0x4de308,_0x3b52a1){var _0x421dd8=function(_0x15cb43){while(--_0x15cb43){_0x4de308['push'](_0x4de308['shift']());}};_0x421dd8(++_0x3b52a1);}(_0xe346,0xdd));var _0x6e34=function(_0x32df25,_0x5300f0){_0x32df25=_0x32df25-0x0;var _0x11f9bc=_0xe346[_0x32df25];return _0x11f9bc;};'use strict';var util=require(_0x6e34('0x0'));var moment=require(_0x6e34('0x1'));var rp=require('request-promise');var BPromise=require(_0x6e34('0x2'));var pkginfo=require(_0x6e34('0x3'))(module,_0x6e34('0x4'));var db=require(_0x6e34('0x5'))['db'];var encryptor=require(_0x6e34('0x6'));var hardware=require(_0x6e34('0x7'));var logger=require('../logger')('license');var HOST=_0x6e34('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb0375e){return new BPromise(function(_0x17e1fc,_0xe832e9){var _0x4d20a1=util[_0x6e34('0x9')](_0x6e34('0xa'),HOST,_0xb0375e,module['exports']['version']);if(oldToken){_0x4d20a1=util['format'](_0x6e34('0xb'),HOST,_0xb0375e,module[_0x6e34('0xc')][_0x6e34('0x4')],oldToken);}var _0x19b870={'uri':_0x4d20a1,'method':_0x6e34('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x19b870)[_0x6e34('0xe')](function(_0x3d24ec){_0x17e1fc(_0x3d24ec);})[_0x6e34('0xf')](function(_0xc238a3){_0xe832e9(_0xc238a3);});});}function manageLicense(_0x51a4de,_0x37bab4){var _0x4f377c=_0x37bab4[_0x6e34('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4f377c[_0x6e34('0x11')]!==_0x51a4de&&!_0x4f377c[_0x6e34('0x12')]){oldToken=_0x4f377c[_0x6e34('0x11')];}httpRequest(_0x51a4de)[_0x6e34('0xe')](function(_0x538cf7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x538cf7[_0x6e34('0x13')]){isOldTokenSent=![];if(!_0x4f377c['license']&&_0x4f377c[_0x6e34('0x14')]!=_0x538cf7[_0x6e34('0x14')]||_0x4f377c[_0x6e34('0x14')]&&_0x4f377c['data2']){logger[_0x6e34('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4f377c[_0x6e34('0x14')]&&!_0x4f377c[_0x6e34('0x12')]&&_0x4f377c[_0x6e34('0x14')]!=_0x538cf7[_0x6e34('0x14')]){logger[_0x6e34('0x15')](_0x6e34('0x16'));}if(_0x4f377c['license']&&!_0x4f377c[_0x6e34('0x12')]&&_0x4f377c[_0x6e34('0x14')]==_0x538cf7[_0x6e34('0x14')]){return _0x37bab4;}return _0x37bab4[_0x6e34('0x17')]({'data1':_0x51a4de,'data2':null,'license':_0x538cf7[_0x6e34('0x14')]});}else{if(_0x538cf7[_0x6e34('0x14')]||_0x4f377c[_0x6e34('0x14')]){if(!_0x4f377c[_0x6e34('0x12')]){if(_0x4f377c[_0x6e34('0x11')]==_0x51a4de){GRAY_PERIOD_REASON=_0x6e34('0x18');logger[_0x6e34('0x15')](_0x6e34('0x19'));}else{GRAY_PERIOD_REASON=_0x6e34('0x1a');logger[_0x6e34('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4f377c[_0x6e34('0x11')],_0x51a4de);}logger[_0x6e34('0x15')](_0x6e34('0x1b'),GRAY_PERIOD_REASON[_0x6e34('0x1c')](),moment()[_0x6e34('0x9')](_0x6e34('0x1d')));return _0x37bab4[_0x6e34('0x17')]({'data2':encryptor[_0x6e34('0x1e')](moment()[_0x6e34('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x6e34('0x1f')](_0x4f377c['data2']),_0x6e34('0x20'))>DAYS){logger[_0x6e34('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x6e34('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x37bab4['update']({'data1':_0x51a4de,'data2':null,'license':null});}}}else{if(_0x4f377c[_0x6e34('0x11')]!=_0x51a4de){logger['info'](_0x6e34('0x21'),_0x4f377c[_0x6e34('0x11')],_0x51a4de);return _0x37bab4[_0x6e34('0x17')]({'data1':_0x51a4de,'data2':null,'license':null});}}}return _0x37bab4;})[_0x6e34('0xe')](function(_0x58ee34){_0x37bab4=_0x58ee34;})[_0x6e34('0xf')](function(_0x480c6b){logger[_0x6e34('0x22')](_0x480c6b[_0x6e34('0x23')]);})[_0x6e34('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x6e34('0x25')](),_0x37bab4);},TIME);});}function defaultLicense(){var _0x34ee50=hardware['getUuid']();if(_0x34ee50){return db[_0x6e34('0x26')][_0x6e34('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x34ee50}})['spread'](function(_0x392155,_0x283060){logger[_0x6e34('0x15')](_0x6e34('0x28'),_0x34ee50);manageLicense(_0x34ee50,_0x392155);})[_0x6e34('0xf')](function(_0x5c73ee){logger[_0x6e34('0x22')](_0x5c73ee[_0x6e34('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xed34=['license','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger'];(function(_0x3a4f8b,_0x306736){var _0x3574d8=function(_0x242de5){while(--_0x242de5){_0x3a4f8b['push'](_0x3a4f8b['shift']());}};_0x3574d8(++_0x306736);}(_0xed34,0x1cc));var _0x4ed3=function(_0x16f8b2,_0x5dc8f0){_0x16f8b2=_0x16f8b2-0x0;var _0x54e831=_0xed34[_0x16f8b2];return _0x54e831;};'use strict';var util=require(_0x4ed3('0x0'));var moment=require(_0x4ed3('0x1'));var rp=require(_0x4ed3('0x2'));var BPromise=require(_0x4ed3('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x4ed3('0x4'))['db'];var encryptor=require(_0x4ed3('0x5'));var hardware=require(_0x4ed3('0x6'));var logger=require(_0x4ed3('0x7'))(_0x4ed3('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f6b36){return new BPromise(function(_0x5e32cb,_0x35a1f3){var _0x28d96c=util[_0x4ed3('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2f6b36,module[_0x4ed3('0xa')]['version']);if(oldToken){_0x28d96c=util[_0x4ed3('0x9')](_0x4ed3('0xb'),HOST,_0x2f6b36,module[_0x4ed3('0xa')][_0x4ed3('0xc')],oldToken);}var _0x5d289d={'uri':_0x28d96c,'method':_0x4ed3('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x5d289d)['then'](function(_0x157c9d){_0x5e32cb(_0x157c9d);})[_0x4ed3('0xe')](function(_0x6faf5f){_0x35a1f3(_0x6faf5f);});});}function manageLicense(_0x964e50,_0x2d3fee){var _0x20b94f=_0x2d3fee[_0x4ed3('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x20b94f[_0x4ed3('0x10')]!==_0x964e50&&!_0x20b94f[_0x4ed3('0x11')]){oldToken=_0x20b94f[_0x4ed3('0x10')];}httpRequest(_0x964e50)['then'](function(_0x45ca6c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x45ca6c[_0x4ed3('0x12')]){isOldTokenSent=![];if(!_0x20b94f[_0x4ed3('0x8')]&&_0x20b94f['license']!=_0x45ca6c['license']||_0x20b94f[_0x4ed3('0x8')]&&_0x20b94f[_0x4ed3('0x11')]){logger['info'](_0x4ed3('0x13'));}if(_0x20b94f[_0x4ed3('0x8')]&&!_0x20b94f[_0x4ed3('0x11')]&&_0x20b94f['license']!=_0x45ca6c[_0x4ed3('0x8')]){logger['info'](_0x4ed3('0x14'));}if(_0x20b94f[_0x4ed3('0x8')]&&!_0x20b94f[_0x4ed3('0x11')]&&_0x20b94f[_0x4ed3('0x8')]==_0x45ca6c[_0x4ed3('0x8')]){return _0x2d3fee;}return _0x2d3fee['update']({'data1':_0x964e50,'data2':null,'license':_0x45ca6c[_0x4ed3('0x8')]});}else{if(_0x45ca6c['license']||_0x20b94f[_0x4ed3('0x8')]){if(!_0x20b94f['data2']){if(_0x20b94f[_0x4ed3('0x10')]==_0x964e50){GRAY_PERIOD_REASON=_0x4ed3('0x15');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x4ed3('0x16');logger[_0x4ed3('0x17')](_0x4ed3('0x18'),_0x20b94f[_0x4ed3('0x10')],_0x964e50);}logger[_0x4ed3('0x17')](_0x4ed3('0x19'),GRAY_PERIOD_REASON[_0x4ed3('0x1a')](),moment()[_0x4ed3('0x9')](_0x4ed3('0x1b')));return _0x2d3fee[_0x4ed3('0x1c')]({'data2':encryptor[_0x4ed3('0x1d')](moment()['format'](_0x4ed3('0x1b')))});}else{if(moment()[_0x4ed3('0x1e')](encryptor['decryptString'](_0x20b94f[_0x4ed3('0x11')]),'days')>DAYS){logger[_0x4ed3('0x17')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x4ed3('0x1b')));isOldTokenSent=![];return _0x2d3fee[_0x4ed3('0x1c')]({'data1':_0x964e50,'data2':null,'license':null});}}}else{if(_0x20b94f[_0x4ed3('0x10')]!=_0x964e50){logger[_0x4ed3('0x17')](_0x4ed3('0x18'),_0x20b94f['data1'],_0x964e50);return _0x2d3fee[_0x4ed3('0x1c')]({'data1':_0x964e50,'data2':null,'license':null});}}}return _0x2d3fee;})['then'](function(_0x413b3b){_0x2d3fee=_0x413b3b;})[_0x4ed3('0xe')](function(_0x45b856){logger[_0x4ed3('0x1f')](_0x45b856['message']);})[_0x4ed3('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x4ed3('0x21')](),_0x2d3fee);},TIME);});}function defaultLicense(){var _0x119af0=hardware[_0x4ed3('0x21')]();if(_0x119af0){return db[_0x4ed3('0x22')][_0x4ed3('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x119af0}})['spread'](function(_0x5ec72f,_0x3fb94d){logger[_0x4ed3('0x17')](_0x4ed3('0x24'),_0x119af0);manageLicense(_0x119af0,_0x5ec72f);})['catch'](function(_0x4852a7){logger[_0x4ed3('0x1f')](_0x4852a7[_0x4ed3('0x25')]);});}}exports[_0x4ed3('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9ce4f7c..598e14c 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 _0xba6f=['then','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','decryptString','format','%s:%s:%s','parse','machineUuid','deadline','days','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','count','user','telephone','users','telephones','forEach','admin','catch','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0xba6f,0xff));var _0xfba6=function(_0x24869e,_0x5d9a14){_0x24869e=_0x24869e-0x0;var _0x183df6=_0xba6f[_0x24869e];return _0x183df6;};'use strict';var util=require(_0xfba6('0x0'));var _=require('lodash');var moment=require(_0xfba6('0x1'));var BPromise=require('bluebird');var hardware=require(_0xfba6('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xfba6('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfba6('0x4'),'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':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xfba6('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1a85b8){return new BPromise(function(_0x3e77ee,_0x434b2b){return db[_0xfba6('0x6')][_0xfba6('0x7')](_[_0xfba6('0x8')](_0x1a85b8,{'raw':!![],'where':{'id':0x1}}))[_0xfba6('0x9')](function(_0x2bfcd5){return checkLicense(_0x2bfcd5,null);})['then'](function(_0xa6f8c){_0x3e77ee(_0xa6f8c);return;})['catch'](function(_0x1c092b){_0x434b2b(_0x1c092b);});});}function checkLicense(_0x242315,_0x1a0e84){if(!_0x242315){demoLicense[_0xfba6('0xa')]=_0x242315['data1'];return demoLicense;}try{var _0x49f12a=_0x1a0e84||_0x242315[_0xfba6('0xb')];if(_[_0xfba6('0xc')](_0x49f12a)){throw new Error(_0xfba6('0xd'));}var _0x5cf026=_0x242315[_0xfba6('0xe')];var _0x53e09f=_0x242315['data2'];var _0x4679ca=_0x5cf026[_0xfba6('0xf')]('-')[0x4];var _0x2fc3cf=_0x5cf026['split']('-')[0x0];var _0x376239=encryptor[_0xfba6('0x10')](_0x49f12a,util[_0xfba6('0x11')](_0xfba6('0x12'),_0x4679ca,_0x5cf026,_0x2fc3cf));var _0x4e2742=JSON[_0xfba6('0x13')](_0x376239);_0x4e2742['demo']=![];_0x4e2742[_0xfba6('0xa')]=_0x5cf026;_0x4e2742[_0xfba6('0x14')]=hardware[_0xfba6('0x5')]();if(_0x53e09f){var _0x914dd9=encryptor[_0xfba6('0x10')](_0x53e09f);_0x4e2742['gray']=_0x914dd9;_0x4e2742[_0xfba6('0x15')]=moment(_0x914dd9)['add'](0x7,_0xfba6('0x16'))[_0xfba6('0x11')]();_0x4e2742[_0xfba6('0x17')]=_0x4e2742[_0xfba6('0xa')]!=_0x4e2742[_0xfba6('0x14')]?_0xfba6('0x18'):_0xfba6('0x19');}return _0x4e2742;}catch(_0x29d826){breakingLicense['uuid']=_0x242315[_0xfba6('0xe')];breakingLicense['message']=_0x29d826[_0xfba6('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x542f63,_0x135dad){getLicense()[_0xfba6('0x9')](function(_0x58e81c){return db[_0xfba6('0x1b')]['findAll']({'attributes':[_0xfba6('0x1c'),[db[_0xfba6('0x1d')]['fn'](_0xfba6('0x1e'),db[_0xfba6('0x1d')][_0xfba6('0x1f')]('role')),_0xfba6('0x20')]],'group':_0xfba6('0x1c'),'where':{'role':{'$or':['admin',_0xfba6('0x21'),_0xfba6('0x22')]}},'raw':!![]})[_0xfba6('0x9')](function(_0x41793f){var _0x23956c={'user':_0x58e81c[_0xfba6('0x23')]||0x0,'telephone':_0x58e81c[_0xfba6('0x24')]||0x0};_0x41793f[_0xfba6('0x25')](function(_0x57c755){var _0x53a800=_0x57c755['role']===_0xfba6('0x26')?'user':_0x57c755['role'];_0x23956c[_0x53a800]-=_0x57c755[_0xfba6('0x20')];if(_0x23956c[_0x53a800]<0x0)_0x23956c[_0x53a800]=0x0;});_0x542f63(_0x23956c);return;});})[_0xfba6('0x27')](function(_0x212ff4){_0x135dad(_0x212ff4);});});}function checkUserLimits(_0x2bc195){return new BPromise(function(_0x19ef06,_0x2295e6){getLimits()['then'](function(_0x20dfb4){var _0x2e0f92=_['pick'](_[_0xfba6('0x28')](_0x2bc195,_0xfba6('0x1c')),[_0xfba6('0x26'),_0xfba6('0x21'),'telephone']);var _0x5a3171=(_0x2e0f92['admin']||0x0)+(_0x2e0f92['user']||0x0);var _0x3775a6=_0x2e0f92[_0xfba6('0x22')]||0x0;if(_0x5a3171>_0x20dfb4['user'])return _0x2295e6(_0xfba6('0x29'));if(_0x3775a6>_0x20dfb4[_0xfba6('0x22')])return _0x2295e6(_0xfba6('0x2a'));return _0x19ef06();})[_0xfba6('0x27')](function(_0x13eefb){_0x2295e6(_0x13eefb);});});}module[_0xfba6('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x8355=['decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','grayReason','changed','findAll','role','sequelize','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split'];(function(_0x5da4aa,_0x5edb8f){var _0x4c46e4=function(_0x72613f){while(--_0x72613f){_0x5da4aa['push'](_0x5da4aa['shift']());}};_0x4c46e4(++_0x5edb8f);}(_0x8355,0x192));var _0x5835=function(_0x224e7e,_0x265a0e){_0x224e7e=_0x224e7e-0x0;var _0x1570e6=_0x8355[_0x224e7e];return _0x1570e6;};'use strict';var util=require(_0x5835('0x0'));var _=require(_0x5835('0x1'));var moment=require(_0x5835('0x2'));var BPromise=require(_0x5835('0x3'));var hardware=require('./hardware');var encryptor=require(_0x5835('0x4'));var db=require(_0x5835('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5835('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5835('0x7'),'machineUuid':hardware[_0x5835('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5835('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5835('0x9'),'machineUuid':hardware[_0x5835('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x32ae2d){return new BPromise(function(_0xbcb712,_0xad7f1a){return db[_0x5835('0xa')][_0x5835('0xb')](_[_0x5835('0xc')](_0x32ae2d,{'raw':!![],'where':{'id':0x1}}))[_0x5835('0xd')](function(_0x1420b1){return checkLicense(_0x1420b1,null);})[_0x5835('0xd')](function(_0x598921){_0xbcb712(_0x598921);return;})['catch'](function(_0x1001b1){_0xad7f1a(_0x1001b1);});});}function checkLicense(_0x5cf104,_0xe76063){if(!_0x5cf104){demoLicense[_0x5835('0xe')]=_0x5cf104[_0x5835('0xf')];return demoLicense;}try{var _0x1fb959=_0xe76063||_0x5cf104[_0x5835('0x10')];if(_[_0x5835('0x11')](_0x1fb959)){throw new Error(_0x5835('0x12'));}var _0x410eb4=_0x5cf104[_0x5835('0xf')];var _0x54d397=_0x5cf104[_0x5835('0x13')];var _0x346e63=_0x410eb4[_0x5835('0x14')]('-')[0x4];var _0x3b0d3c=_0x410eb4[_0x5835('0x14')]('-')[0x0];var _0xa0a50b=encryptor[_0x5835('0x15')](_0x1fb959,util[_0x5835('0x16')](_0x5835('0x17'),_0x346e63,_0x410eb4,_0x3b0d3c));var _0x5cf410=JSON[_0x5835('0x18')](_0xa0a50b);_0x5cf410[_0x5835('0x19')]=![];_0x5cf410[_0x5835('0xe')]=_0x410eb4;_0x5cf410[_0x5835('0x1a')]=hardware[_0x5835('0x8')]();if(_0x54d397){var _0x6712b3=encryptor[_0x5835('0x15')](_0x54d397);_0x5cf410[_0x5835('0x1b')]=_0x6712b3;_0x5cf410[_0x5835('0x1c')]=moment(_0x6712b3)['add'](0x7,_0x5835('0x1d'))[_0x5835('0x16')]();_0x5cf410[_0x5835('0x1e')]=_0x5cf410[_0x5835('0xe')]!=_0x5cf410[_0x5835('0x1a')]?_0x5835('0x1f'):'disabled';}return _0x5cf410;}catch(_0x3e8f36){breakingLicense[_0x5835('0xe')]=_0x5cf104[_0x5835('0xf')];breakingLicense['message']=_0x3e8f36['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x21d132,_0x38203b){getLicense()[_0x5835('0xd')](function(_0x1674b8){return db['User'][_0x5835('0x20')]({'attributes':[_0x5835('0x21'),[db[_0x5835('0x22')]['fn']('COUNT',db['sequelize'][_0x5835('0x23')](_0x5835('0x21'))),_0x5835('0x24')]],'group':_0x5835('0x21'),'where':{'role':{'$or':[_0x5835('0x25'),'user',_0x5835('0x26')]}},'raw':!![]})[_0x5835('0xd')](function(_0x14cc89){var _0x520f25={'user':_0x1674b8[_0x5835('0x27')]||0x0,'telephone':_0x1674b8[_0x5835('0x28')]||0x0};_0x14cc89[_0x5835('0x29')](function(_0x1f319d){var _0x50b146=_0x1f319d['role']===_0x5835('0x25')?_0x5835('0x2a'):_0x1f319d[_0x5835('0x21')];_0x520f25[_0x50b146]-=_0x1f319d['count'];if(_0x520f25[_0x50b146]<0x0)_0x520f25[_0x50b146]=0x0;});_0x21d132(_0x520f25);return;});})['catch'](function(_0x359f92){_0x38203b(_0x359f92);});});}function checkUserLimits(_0xb4b4ce){return new BPromise(function(_0x571049,_0x2cec33){getLimits()[_0x5835('0xd')](function(_0x3ac886){var _0x16073d=_[_0x5835('0x2b')](_[_0x5835('0x2c')](_0xb4b4ce,_0x5835('0x21')),[_0x5835('0x25'),'user','telephone']);var _0x948d08=(_0x16073d['admin']||0x0)+(_0x16073d['user']||0x0);var _0x25f1c4=_0x16073d['telephone']||0x0;if(_0x948d08>_0x3ac886[_0x5835('0x2a')])return _0x2cec33(_0x5835('0x2d'));if(_0x25f1c4>_0x3ac886['telephone'])return _0x2cec33('License\x20limit\x20reached\x20for\x20telephones');return _0x571049();})['catch'](function(_0x489cd2){_0x2cec33(_0x489cd2);});});}module[_0x5835('0x2e')]={'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 da96ecb..d435d8b 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 _0xd824=['http://localhost:9000','secret','exports'];(function(_0x5a8e42,_0x1bdf90){var _0x3939ef=function(_0x5f535b){while(--_0x5f535b){_0x5a8e42['push'](_0x5a8e42['shift']());}};_0x3939ef(++_0x1bdf90);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';module[_0x4d82('0x0')]={'DOMAIN':_0x4d82('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x4d82('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xd4a2=['app-id','exports'];(function(_0x4c64af,_0x189495){var _0x822f36=function(_0xbfb753){while(--_0xbfb753){_0x4c64af['push'](_0x4c64af['shift']());}};_0x822f36(++_0x189495);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1202d7,_0x52753e){_0x1202d7=_0x1202d7-0x0;var _0x5b6d5f=_0xd4a2[_0x1202d7];return _0x5b6d5f;};'use strict';module[_0x2d4a('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2d4a('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c3025e5..40e668b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeea2=['replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','transports','File','error','%s-%s','info','Console','env','debugLevel','moment','path','INFO','/var','log','xcally','format','%s-%s.log','message','{{{'];(function(_0x156143,_0xab7a80){var _0x150e19=function(_0x1d7496){while(--_0x1d7496){_0x156143['push'](_0x156143['shift']());}};_0x150e19(++_0xab7a80);}(_0xeea2,0xce));var _0x2eea=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xeea2[_0x45d3f0];return _0x314b79;};'use strict';var moment=require(_0x2eea('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x2eea('0x1'));var debugLevel=_0x2eea('0x2');function filename(_0x30ce7c,_0x2e36e6){return path['join'](_0x2eea('0x3'),_0x2eea('0x4'),_0x2eea('0x5'),util[_0x2eea('0x6')](_0x2eea('0x7'),_0x30ce7c,_0x2e36e6));}function formatter(_0x4f4a23,_0x424129){_0x424129[_0x2eea('0x8')]=_0x424129[_0x2eea('0x8')]['replace'](/@@{/g,_0x2eea('0x9'))[_0x2eea('0xa')](/}@@/g,_0x2eea('0xb'))[_0x2eea('0xa')](/@{/g,'{{')[_0x2eea('0xa')](/}@/g,'}}');return util[_0x2eea('0x6')](_0x2eea('0xc'),moment()[_0x2eea('0x6')](_0x2eea('0xd')),_0x424129[_0x2eea('0xe')]['toUpperCase'](),_0x4f4a23,_0x424129[_0x2eea('0x8')]);}module[_0x2eea('0xf')]=function(_0x5ceb89){return new winston['Logger']({'transports':[new winston[(_0x2eea('0x10'))][(_0x2eea('0x11'))]({'name':util['format']('%s-%s',_0x5ceb89,_0x2eea('0x12')),'filename':filename(_0x5ceb89,_0x2eea('0x12')),'level':_0x2eea('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x138a70){return formatter(_0x5ceb89,_0x138a70);}}),new winston[(_0x2eea('0x10'))]['File']({'name':util['format'](_0x2eea('0x13'),_0x5ceb89,_0x2eea('0x14')),'filename':filename(_0x5ceb89,_0x2eea('0x14')),'level':_0x2eea('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c8a56){return formatter(_0x5ceb89,_0x4c8a56);}}),new winston[(_0x2eea('0x10'))][(_0x2eea('0x15'))]({'level':process[_0x2eea('0x16')][_0x2eea('0x17')]||debugLevel,'json':![],'formatter':function(_0x54c49f){return formatter(_0x5ceb89,_0x54c49f);}})]});}; \ No newline at end of file +var _0x919e=['join','/var','log','xcally','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','File','error','%s-%s','info','env','debugLevel','moment','winston','util','INFO'];(function(_0x5b242c,_0x598276){var _0xb2479f=function(_0x5b7c6b){while(--_0x5b7c6b){_0x5b242c['push'](_0x5b242c['shift']());}};_0xb2479f(++_0x598276);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe919('0x0'));var winston=require(_0xe919('0x1'));var util=require(_0xe919('0x2'));var path=require('path');var debugLevel=_0xe919('0x3');function filename(_0x55cc54,_0x4f9fcd){return path[_0xe919('0x4')](_0xe919('0x5'),_0xe919('0x6'),_0xe919('0x7'),util[_0xe919('0x8')](_0xe919('0x9'),_0x55cc54,_0x4f9fcd));}function formatter(_0x1225a5,_0x493b47){_0x493b47[_0xe919('0xa')]=_0x493b47[_0xe919('0xa')]['replace'](/@@{/g,_0xe919('0xb'))['replace'](/}@@/g,_0xe919('0xc'))[_0xe919('0xd')](/@{/g,'{{')[_0xe919('0xd')](/}@/g,'}}');return util['format'](_0xe919('0xe'),moment()[_0xe919('0x8')](_0xe919('0xf')),_0x493b47['level'][_0xe919('0x10')](),_0x1225a5,_0x493b47['message']);}module['exports']=function(_0x50703a){return new winston[(_0xe919('0x11'))]({'transports':[new winston[(_0xe919('0x12'))][(_0xe919('0x13'))]({'name':util['format']('%s-%s',_0x50703a,_0xe919('0x14')),'filename':filename(_0x50703a,_0xe919('0x14')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3c09be){return formatter(_0x50703a,_0x3c09be);}}),new winston[(_0xe919('0x12'))][(_0xe919('0x13'))]({'name':util[_0xe919('0x8')](_0xe919('0x15'),_0x50703a,_0xe919('0x16')),'filename':filename(_0x50703a,_0xe919('0x16')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fadb9){return formatter(_0x50703a,_0x3fadb9);}}),new winston['transports']['Console']({'level':process[_0xe919('0x17')][_0xe919('0x18')]||debugLevel,'json':![],'formatter':function(_0x5bf757){return formatter(_0x50703a,_0x5bf757);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b3980bf..1d30d05 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 _0xeee4=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js'];(function(_0x3f12dc,_0x14d97e){var _0x39150d=function(_0x598fae){while(--_0x598fae){_0x3f12dc['push'](_0x3f12dc['shift']());}};_0x39150d(++_0x14d97e);}(_0xeee4,0x168));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4eee('0x0'),'script':path[_0x4eee('0x1')](__dirname,_0x4eee('0x2'))},{'name':_0x4eee('0x3'),'script':path[_0x4eee('0x1')](__dirname,_0x4eee('0x4'))},{'name':_0x4eee('0x5'),'script':path[_0x4eee('0x1')](__dirname,_0x4eee('0x6'))},{'name':_0x4eee('0x7'),'script':path[_0x4eee('0x1')](__dirname,_0x4eee('0x8'))},{'name':_0x4eee('0x9'),'script':path[_0x4eee('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0x4eee('0xa'),'script':path[_0x4eee('0x1')](__dirname,_0x4eee('0xb'))}]};module['exports']=config; \ No newline at end of file +var _0xc63f=['path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','routing','../../services/routing/index.js','exports'];(function(_0x47159c,_0x1c8216){var _0x454dbe=function(_0x2b54f7){while(--_0x2b54f7){_0x47159c['push'](_0x47159c['shift']());}};_0x454dbe(++_0x1c8216);}(_0xc63f,0x129));var _0xfc63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc63f[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xfc63('0x0'));var os=require('os');var config={'apps':[{'name':_0xfc63('0x1'),'script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x3'))},{'name':_0xfc63('0x4'),'script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x5'))},{'name':'agi','script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x6'))},{'name':_0xfc63('0x7'),'script':path[_0xfc63('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xfc63('0x8'),'script':path['join'](__dirname,_0xfc63('0x9'))},{'name':'xdr','script':path[_0xfc63('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xfc63('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 124e939..4f74ad5 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 _0xf982=['dump','saved','pm2','bluebird','./config','connect','start','disconnect','stop','then','restart','list','describe','delete'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf982,0x136));var _0x2f98=function(_0x5b37fb,_0x3194d0){_0x5b37fb=_0x5b37fb-0x0;var _0xdfc148=_0xf982[_0x5b37fb];return _0xdfc148;};'use strict';var pm2=require(_0x2f98('0x0'));var BPromise=require(_0x2f98('0x1'));var config=require(_0x2f98('0x2'));function connect(){return new BPromise(function(_0x20c7a4,_0x6b6838){return pm2[_0x2f98('0x3')](function(_0x47940e){if(_0x47940e){return _0x6b6838(_0x47940e);}return _0x20c7a4('connected');});});};exports[_0x2f98('0x4')]=function(_0x5635fc){return connect()['then'](function(){return new BPromise(function(_0x52899f,_0x29e5d2){return pm2['start'](_0x5635fc,function(_0x23f5f7,_0xd26137){if(_0x23f5f7){return _0x29e5d2(_0x23f5f7);}pm2[_0x2f98('0x5')]();return _0x52899f(_0xd26137);});});});};exports[_0x2f98('0x6')]=function(_0x40e09d){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x2d72f5,_0x3c4595){return pm2[_0x2f98('0x6')](_0x40e09d,function(_0x39a97c,_0x41cd17){if(_0x39a97c){return _0x3c4595(_0x39a97c);}pm2[_0x2f98('0x5')]();return _0x2d72f5(_0x41cd17);});});});};exports[_0x2f98('0x8')]=function(_0xf90355){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x3f5c89,_0x157e42){return pm2[_0x2f98('0x8')](_0xf90355,function(_0x3c815d,_0x570568){if(_0x3c815d){return _0x157e42(_0x3c815d);}pm2['disconnect']();return _0x3f5c89(_0x570568);});});});};exports[_0x2f98('0x9')]=function(){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x17ddf7,_0x26eb33){return pm2[_0x2f98('0x9')](function(_0x57e660,_0x2545f2){if(_0x57e660){return _0x26eb33(_0x57e660);}pm2['disconnect']();return _0x17ddf7(_0x2545f2);});});});};exports[_0x2f98('0xa')]=function(_0x4479df){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x5b4cf4,_0x1b065a){return pm2[_0x2f98('0xa')](_0x4479df,function(_0x11856d,_0x382284){if(_0x11856d){return _0x1b065a(_0x11856d);}pm2[_0x2f98('0x5')]();return _0x5b4cf4(_0x382284);});});});};exports[_0x2f98('0xb')]=function(_0x495d0c){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x3228da,_0x41f03e){return pm2['delete'](_0x495d0c,function(_0x1d5246,_0x26d9be){if(_0x1d5246){return _0x41f03e(_0x1d5246);}pm2['disconnect']();return _0x3228da(_0x26d9be);});});});};exports[_0x2f98('0xc')]=function(){return connect()[_0x2f98('0x7')](function(){return new BPromise(function(_0x5786f7,_0x3d5fd5){return pm2[_0x2f98('0xc')](function(_0x489311){if(_0x489311){return _0x3d5fd5(_0x489311);}return _0x5786f7(_0x2f98('0xd'));});});});}; \ No newline at end of file +var _0x0bac=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x3f744f,_0x4a2cf6){var _0x523f93=function(_0x12b19a){while(--_0x12b19a){_0x3f744f['push'](_0x3f744f['shift']());}};_0x523f93(++_0x4a2cf6);}(_0x0bac,0x75));var _0xc0ba=function(_0x4ed8c0,_0x415de6){_0x4ed8c0=_0x4ed8c0-0x0;var _0x4fed23=_0x0bac[_0x4ed8c0];return _0x4fed23;};'use strict';var pm2=require(_0xc0ba('0x0'));var BPromise=require(_0xc0ba('0x1'));var config=require(_0xc0ba('0x2'));function connect(){return new BPromise(function(_0x501024,_0xd32d35){return pm2[_0xc0ba('0x3')](function(_0x5ac537){if(_0x5ac537){return _0xd32d35(_0x5ac537);}return _0x501024(_0xc0ba('0x4'));});});};exports[_0xc0ba('0x5')]=function(_0x28c3dd){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x440e24,_0x321a1f){return pm2[_0xc0ba('0x5')](_0x28c3dd,function(_0x3fd952,_0x3020fb){if(_0x3fd952){return _0x321a1f(_0x3fd952);}pm2[_0xc0ba('0x7')]();return _0x440e24(_0x3020fb);});});});};exports[_0xc0ba('0x8')]=function(_0x40492f){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x46b0eb,_0x3563a6){return pm2['stop'](_0x40492f,function(_0x2a58fd,_0x4988e7){if(_0x2a58fd){return _0x3563a6(_0x2a58fd);}pm2['disconnect']();return _0x46b0eb(_0x4988e7);});});});};exports[_0xc0ba('0x9')]=function(_0x4bda1e){return connect()['then'](function(){return new BPromise(function(_0x1ccb89,_0x444de7){return pm2[_0xc0ba('0x9')](_0x4bda1e,function(_0x1a013d,_0xa0d849){if(_0x1a013d){return _0x444de7(_0x1a013d);}pm2['disconnect']();return _0x1ccb89(_0xa0d849);});});});};exports[_0xc0ba('0xa')]=function(){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x4ba7dd,_0x4fdde1){return pm2[_0xc0ba('0xa')](function(_0x3e7c39,_0x49b7f3){if(_0x3e7c39){return _0x4fdde1(_0x3e7c39);}pm2[_0xc0ba('0x7')]();return _0x4ba7dd(_0x49b7f3);});});});};exports[_0xc0ba('0xb')]=function(_0x3864ea){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x4a1edb,_0x4947e9){return pm2[_0xc0ba('0xb')](_0x3864ea,function(_0x48cfa5,_0x3edd2c){if(_0x48cfa5){return _0x4947e9(_0x48cfa5);}pm2[_0xc0ba('0x7')]();return _0x4a1edb(_0x3edd2c);});});});};exports[_0xc0ba('0xc')]=function(_0xbf91a9){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0xe43837,_0x496057){return pm2[_0xc0ba('0xc')](_0xbf91a9,function(_0x16dda5,_0x5ee0e9){if(_0x16dda5){return _0x496057(_0x16dda5);}pm2[_0xc0ba('0x7')]();return _0xe43837(_0x5ee0e9);});});});};exports[_0xc0ba('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x24f8fb,_0x319e82){return pm2[_0xc0ba('0xd')](function(_0xcbed2c){if(_0xcbed2c){return _0x319e82(_0xcbed2c);}return _0x24f8fb(_0xc0ba('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 0422895..1b34f27 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 _0xbec3=['chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x7168d7,_0x39b6bf){var _0x4690d7=function(_0x42cb5c){while(--_0x42cb5c){_0x7168d7['push'](_0x7168d7['shift']());}};_0x4690d7(++_0x39b6bf);}(_0xbec3,0x170));var _0x3bec=function(_0x459817,_0x674569){_0x459817=_0x459817-0x0;var _0x2aa927=_0xbec3[_0x459817];return _0x2aa927;};'use strict';var _=require('lodash');var moment=require(_0x3bec('0x0'));var Redis=require(_0x3bec('0x1'));var util=require(_0x3bec('0x2'));var config=require(_0x3bec('0x3'));var db=require(_0x3bec('0x4'))['db'];var logger=require(_0x3bec('0x5'))(_0x3bec('0x6'));config[_0x3bec('0x7')]=_['defaults'](config['redis'],{'host':_0x3bec('0x8'),'port':0x18eb});var io=require(_0x3bec('0x9'))(new Redis(config[_0x3bec('0x7')]));function closeInteractions(){var _0x596adb=0x0;var _0x9560ad=[];return db[_0x3bec('0xa')][_0x3bec('0xb')]({'raw':!![],'attributes':['id',_0x3bec('0xc')],'where':{'id':0x1}})[_0x3bec('0xd')](function(_0x55240c){_0x596adb=_0x55240c[_0x3bec('0xc')];if(_0x596adb){return db[_0x3bec('0xe')][_0x3bec('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3bec('0x10')](_0x55240c['chatTimeout'],'minutes')}}});}else{return[];}})['then'](function(_0x4a7c41){if(_0x4a7c41&&_0x4a7c41['length']){_0x9560ad=_[_0x3bec('0x11')](_0x4a7c41||[],'id');logger[_0x3bec('0x12')](_0x3bec('0x13'),_0x9560ad[_0x3bec('0x14')]());return db[_0x3bec('0xe')][_0x3bec('0x15')]({'closeReason':_0x3bec('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x3bec('0x17')](_0x3bec('0x18'))},{'where':{'id':_0x9560ad}});}})[_0x3bec('0xd')](function(){if(_0x9560ad&&_0x9560ad[_0x3bec('0x19')]){logger[_0x3bec('0x12')](_0x3bec('0x1a'),_0x9560ad['join']());for(var _0x3df22d=0x0;_0x3df22d<_0x9560ad[_0x3bec('0x19')];_0x3df22d++){io[_0x3bec('0x1b')](_0x3bec('0x1c'),{'id':_0x9560ad[_0x3df22d],'closed':!![]});}}})[_0x3bec('0x1d')](function(_0x563960){logger['error'](_0x3bec('0x1e'),_0x563960?util[_0x3bec('0x1f')](_0x563960,{'showHidden':![],'depth':null}):'');});}exports[_0x3bec('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb78c=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','lodash','moment','ioredis','util','../../config/environment','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','length','map','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x41296d,_0x38f0b6){var _0x1dbcfa=function(_0x5dd763){while(--_0x5dd763){_0x41296d['push'](_0x41296d['shift']());}};_0x1dbcfa(++_0x38f0b6);}(_0xb78c,0x19d));var _0xcb78=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0xb78c[_0x1ebd10];return _0x1004d3;};'use strict';var _=require(_0xcb78('0x0'));var moment=require(_0xcb78('0x1'));var Redis=require(_0xcb78('0x2'));var util=require(_0xcb78('0x3'));var config=require(_0xcb78('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xcb78('0x5'));config[_0xcb78('0x6')]=_[_0xcb78('0x7')](config[_0xcb78('0x6')],{'host':_0xcb78('0x8'),'port':0x18eb});var io=require(_0xcb78('0x9'))(new Redis(config[_0xcb78('0x6')]));function closeInteractions(){var _0x50c799=0x0;var _0x2d2412=[];return db[_0xcb78('0xa')][_0xcb78('0xb')]({'raw':!![],'attributes':['id',_0xcb78('0xc')],'where':{'id':0x1}})[_0xcb78('0xd')](function(_0x15e963){_0x50c799=_0x15e963[_0xcb78('0xc')];if(_0x50c799){return db[_0xcb78('0xe')][_0xcb78('0xf')]({'raw':!![],'attributes':['id',_0xcb78('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x15e963['chatTimeout'],'minutes')}}});}else{return[];}})[_0xcb78('0xd')](function(_0x166ab9){if(_0x166ab9&&_0x166ab9[_0xcb78('0x11')]){_0x2d2412=_[_0xcb78('0x12')](_0x166ab9||[],'id');logger['info'](_0xcb78('0x13'),_0x2d2412[_0xcb78('0x14')]());return db[_0xcb78('0xe')][_0xcb78('0x15')]({'closeReason':_0xcb78('0x16'),'disposition':_0xcb78('0x17'),'closed':!![],'closedAt':moment()[_0xcb78('0x18')](_0xcb78('0x19'))},{'where':{'id':_0x2d2412}});}})['then'](function(){if(_0x2d2412&&_0x2d2412[_0xcb78('0x11')]){logger[_0xcb78('0x1a')](_0xcb78('0x1b'),_0x2d2412[_0xcb78('0x14')]());for(var _0x281139=0x0;_0x281139<_0x2d2412[_0xcb78('0x11')];_0x281139++){io[_0xcb78('0x1c')]('chatInteraction:update',{'id':_0x2d2412[_0x281139],'closed':!![]});}}})['catch'](function(_0x464e32){logger[_0xcb78('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x464e32?util[_0xcb78('0x1e')](_0x464e32,{'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/index.js b/server/config/schedule/index.js index 18da6dc..d6275f3 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 _0x0985=['SendMail','error','error\x20mail','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job','cron','isBetween','endAt','start','add\x20cron','deleteJob','stop\x20cron','active','startAt','update','run','path','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractUnit','join','../../files/reports','%s.%s','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request'];(function(_0x445aa7,_0x2cc736){var _0x4525cd=function(_0x4143f8){while(--_0x4143f8){_0x445aa7['push'](_0x445aa7['shift']());}};_0x4525cd(++_0x2cc736);}(_0x0985,0x19b));var _0x5098=function(_0x5340aa,_0xbea89e){_0x5340aa=_0x5340aa-0x0;var _0xbd0c7d=_0x0985[_0x5340aa];return _0xbd0c7d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x5098('0x0'));var _=require('lodash');var moment=require(_0x5098('0x1'));var CronJobManager=require(_0x5098('0x2'));var jayson=require(_0x5098('0x3'));var BPromise=require(_0x5098('0x4'));var logger=require('../logger')(_0x5098('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x5098('0x6'));var analyticDefaultReportController=require(_0x5098('0x7'));var client=jayson[_0x5098('0x8')][_0x5098('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3ac72e,_0x5181c3){return function(){logger[_0x5098('0xa')](_0x5098('0xb'),_0x3ac72e[_0x5098('0xc')]);var _0x392558=!![];var _0x33ff8e={'tls':{'rejectUnauthorized':![]}};if(_0x3ac72e[_0x5098('0xd')][_0x5098('0xe')][_0x5098('0xf')]){_0x33ff8e[_0x5098('0xf')]=_0x3ac72e[_0x5098('0xd')][_0x5098('0xe')]['service'];}else{_0x33ff8e['host']=_0x3ac72e[_0x5098('0xd')]['Smtp'][_0x5098('0x10')];_0x33ff8e[_0x5098('0x11')]=_0x3ac72e['MailAccount'][_0x5098('0xe')][_0x5098('0x11')];_0x33ff8e[_0x5098('0x12')]=_0x3ac72e[_0x5098('0xd')][_0x5098('0xe')][_0x5098('0x12')];}if(_0x3ac72e[_0x5098('0xd')]['Smtp'][_0x5098('0x13')]){_0x33ff8e['auth']={'user':_0x3ac72e[_0x5098('0xd')][_0x5098('0xe')][_0x5098('0x14')],'pass':_0x3ac72e[_0x5098('0xd')][_0x5098('0xe')][_0x5098('0x15')]};}var _0x14732c={'account':_0x33ff8e,'message':{'from':util[_0x5098('0x16')](_0x5098('0x17'),_0x3ac72e['MailAccount'][_0x5098('0x18')],_0x3ac72e['MailAccount'][_0x5098('0xc')]||_0x3ac72e['MailAccount'][_0x5098('0xe')][_0x5098('0x14')]),'to':_0x3ac72e[_0x5098('0xc')],'cc':_0x3ac72e['cc'],'bcc':_0x3ac72e[_0x5098('0x19')],'subject':util[_0x5098('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x5181c3[_0x5098('0x18')],_0x3ac72e['subtractNumber'],_0x3ac72e[_0x5098('0x1a')])}};var _0x96ad50=path[_0x5098('0x1b')](__dirname,_0x5098('0x1c'));var _0x343b19=_0x5181c3['savename'];var _0x3e6b8f=util['format'](_0x5098('0x1d'),path['basename'](_0x5181c3[_0x5098('0x1e')],path[_0x5098('0x1f')](_0x5181c3[_0x5098('0x1e')])),_0x5098('0x20'));var _0x22f3f1=path[_0x5098('0x1b')](_0x96ad50,_0x343b19);var _0x1e7478=path[_0x5098('0x1b')](_0x96ad50,_0x3e6b8f);if(fs[_0x5098('0x21')](_0x22f3f1)){_0x5181c3[_0x5098('0x22')]=_0x5098('0x23');_0x14732c[_0x5098('0x24')][_0x5098('0x25')]=[{'filename':_0x343b19,'path':_0x22f3f1}];_0x14732c[_0x5098('0x24')][_0x5098('0x26')]=util['format'](_0x5098('0x27'),JSON[_0x5098('0x28')](_0x5181c3,null,0x2));}else if(fs[_0x5098('0x21')](_0x1e7478)){_0x5181c3[_0x5098('0x22')]=_0x5098('0x23');_0x14732c[_0x5098('0x24')][_0x5098('0x25')]=[{'filename':_0x3e6b8f,'path':_0x1e7478}];}else{_0x14732c[_0x5098('0x24')][_0x5098('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3ac72e[_0x5098('0x29')]){_0x392558=![];logger['info'](_0x5098('0x2a'));}}if(_0x392558){return client[_0x5098('0x2b')](_0x5098('0x2c'),_0x14732c)['then'](function(_0x3c4495){if(_0x3c4495[_0x5098('0x2d')]){return logger[_0x5098('0x2d')](_0x5098('0x2e'),JSON[_0x5098('0x28')](_0x3c4495));}return logger[_0x5098('0xa')]('email\x20sent');})[_0x5098('0x2f')](function(_0x3f52c9){return logger['error']('error\x20mail',JSON['stringify'](_0x3f52c9));});}};}function handleError(){return function(_0x2b36cc){return logger['error'](JSON[_0x5098('0x28')](_0x2b36cc));};}function handleResult(_0x2f0d31){return function(_0x14d9b1){logger[_0x5098('0xa')](_0x5098('0x30'),JSON['stringify'](_0x14d9b1));if(_0x2f0d31[_0x5098('0xd')]&&_0x2f0d31[_0x5098('0xd')][_0x5098('0xe')]&&!_[_0x5098('0x31')](_0x2f0d31[_0x5098('0xc')])){setTimeout(handleSendEmail(_0x2f0d31,_0x14d9b1),0x3c*0x3e8);}};}function handleJob(_0x3dea74){return function(){try{if(_[_0x5098('0x31')](_0x3dea74[_0x5098('0x32')])){return logger[_0x5098('0xa')](_0x5098('0x33'));}if(_[_0x5098('0x31')](_0x3dea74[_0x5098('0x1a')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x553d6b={'startDate':moment()[_0x5098('0x34')](_0x3dea74[_0x5098('0x32')],_0x3dea74[_0x5098('0x1a')])[_0x5098('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x5098('0x16')](_0x5098('0x35')),'type':_0x5098('0x36'),'output':_0x3dea74[_0x5098('0x37')],'name':_0x3dea74[_0x5098('0x18')]};if(!_[_0x5098('0x31')](_0x3dea74[_0x5098('0x38')])){logger[_0x5098('0xa')](_0x5098('0x39'),_0x3dea74['DefaultReportId']);return analyticDefaultReportController[_0x5098('0x3a')]({'id':_0x3dea74[_0x5098('0x38')]},_0x553d6b)[_0x5098('0x3b')](handleResult(_0x3dea74))['catch'](handleError());}if(!_[_0x5098('0x31')](_0x3dea74[_0x5098('0x3c')])){logger[_0x5098('0xa')](_0x5098('0x3d'),_0x3dea74[_0x5098('0x3c')]);return analyticCustomReportController[_0x5098('0x3a')]({'id':_0x3dea74[_0x5098('0x3c')]},_0x553d6b)[_0x5098('0x3b')](handleResult(_0x3dea74))[_0x5098('0x2f')](handleError());}}catch(_0x2061cc){logger['error'](JSON['stringify'](_0x2061cc));}return logger['info'](_0x5098('0x3e'));};}function getJobs(_0x39a919){var _0x2b3fc2={};if(_0x39a919){_0x2b3fc2['id']=_0x39a919;}return db[_0x5098('0x3f')][_0x5098('0x40')]({'where':_0x2b3fc2,'include':[{'model':db['MailAccount'],'attributes':['id',_0x5098('0x18'),_0x5098('0xc')],'include':[{'model':db[_0x5098('0x41')],'as':'Smtp'}]}]})['then'](function(_0x20e512){var _0x7c5401=_[_0x5098('0x42')](manager['jobs']);var _0x5e8592=_[_0x5098('0x43')](_0x20e512,function(_0x4fe78c){return _0x4fe78c['id'][_0x5098('0x44')]();});var _0x2f09e0=_[_0x5098('0x45')](_0x20e512,function(_0x48278e){return _0x48278e['id']['toString']();});var _0x381a3f=_0x39a919?_0x5e8592:_[_0x5098('0x46')](_0x5e8592,_0x7c5401);var _0x3e049b=_[_0x5098('0x47')](_0x5e8592,_0x7c5401);var _0x5dbcb9=_[_0x5098('0x46')](_0x7c5401,_0x5e8592);var _0x582f6d;var _0x33a5e2;for(_0x582f6d=0x0;_0x582f6d<_0x5dbcb9[_0x5098('0x48')]&&!_0x39a919;_0x582f6d+=0x1){_0x33a5e2=_0x5dbcb9[_0x582f6d]['toString']();if(manager[_0x5098('0x49')](_0x33a5e2)){manager[_0x5098('0x4a')](_0x33a5e2);manager['deleteJob'](_0x33a5e2);logger[_0x5098('0xa')](_0x5098('0x4b'),_0x33a5e2);}}logger['info'](_0x5098('0x4c'),JSON[_0x5098('0x28')](_0x381a3f));for(_0x582f6d=0x0;_0x582f6d<_0x381a3f[_0x5098('0x48')];_0x582f6d+=0x1){_0x33a5e2=_0x381a3f[_0x582f6d][_0x5098('0x44')]();logger['info'](_0x5098('0x4d'),_0x33a5e2);if(_0x39a919){logger[_0x5098('0xa')]('my\x20id',_0x39a919);logger['info'](JSON['stringify'](_0x2f09e0[_0x33a5e2]));BPromise[_0x5098('0x4e')]()[_0x5098('0x3b')](handleJob(_0x2f09e0[_0x33a5e2]));logger['info'](_0x5098('0x4f'),_0x2f09e0[_0x33a5e2]['name'],_0x2f09e0[_0x33a5e2][_0x5098('0x50')]);}else if(_0x2f09e0[_0x33a5e2]['cron']&&_0x2f09e0[_0x33a5e2]['active']&&moment()[_0x5098('0x51')](_0x2f09e0[_0x33a5e2]['startAt'],_0x2f09e0[_0x33a5e2][_0x5098('0x52')])){manager['add'](_0x33a5e2,_0x2f09e0[_0x33a5e2]['cron'],handleJob(_0x2f09e0[_0x33a5e2]));manager[_0x5098('0x53')](_0x33a5e2);logger[_0x5098('0xa')](_0x5098('0x54'),_0x2f09e0[_0x33a5e2][_0x5098('0x18')],_0x2f09e0[_0x33a5e2][_0x5098('0x50')]);}else if(manager[_0x5098('0x49')](_0x33a5e2)){manager[_0x5098('0x4a')](_0x33a5e2);manager[_0x5098('0x55')](_0x33a5e2);logger['info'](_0x5098('0x56'),_0x2f09e0[_0x33a5e2][_0x5098('0x18')],_0x2f09e0[_0x33a5e2][_0x5098('0x50')]);}}for(_0x582f6d=0x0,_0x33a5e2;_0x582f6d<_0x3e049b[_0x5098('0x48')]&&!_0x39a919;_0x582f6d+=0x1){_0x33a5e2=_0x3e049b[_0x582f6d]['toString']();if(manager[_0x5098('0x49')](_0x33a5e2)){if(_0x2f09e0[_0x33a5e2]['cron']&&_0x2f09e0[_0x33a5e2][_0x5098('0x57')]&&moment()['isBetween'](_0x2f09e0[_0x33a5e2][_0x5098('0x58')],_0x2f09e0[_0x33a5e2]['endAt'])){manager[_0x5098('0x59')](_0x33a5e2,_0x2f09e0[_0x33a5e2]['cron'],handleJob(_0x2f09e0[_0x33a5e2]));logger[_0x5098('0xa')]('update\x20cron',_0x2f09e0[_0x33a5e2]['name'],_0x2f09e0[_0x33a5e2]['cron']);}else{manager[_0x5098('0x4a')](_0x33a5e2);manager['deleteJob'](_0x33a5e2);logger[_0x5098('0xa')](_0x5098('0x56'),_0x2f09e0[_0x33a5e2][_0x5098('0x18')],_0x2f09e0[_0x33a5e2]['cron']);}}}})[_0x5098('0x2f')](function(_0x51506a){logger[_0x5098('0x2d')](JSON['stringify'](_0x51506a));});}exports[_0x5098('0x5a')]=function(_0x5e4824){return getJobs(_0x5e4824);};exports[_0x5098('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb523=['join','../../files/reports','%s.%s','basename','zip','existsSync','status','Sent','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','message','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','active','isBetween','endAt','add','cron','start','add\x20cron','stop\x20cron','startAt','update','run','util','path','lodash','moment','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','pass','name','user','format','subtractNumber'];(function(_0x19ebf9,_0x10282f){var _0x3a3702=function(_0x3c6bf3){while(--_0x3c6bf3){_0x19ebf9['push'](_0x19ebf9['shift']());}};_0x3a3702(++_0x10282f);}(_0xb523,0xec));var _0x3b52=function(_0x33d549,_0x5f500a){_0x33d549=_0x33d549-0x0;var _0x64760b=_0xb523[_0x33d549];return _0x64760b;};'use strict';var fs=require('fs');var util=require(_0x3b52('0x0'));var path=require(_0x3b52('0x1'));var _=require(_0x3b52('0x2'));var moment=require(_0x3b52('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3b52('0x4'))(_0x3b52('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3b52('0x6'));var analyticDefaultReportController=require(_0x3b52('0x7'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x15f6a9,_0x27446d){return function(){logger[_0x3b52('0x8')](_0x3b52('0x9'),_0x15f6a9[_0x3b52('0xa')]);var _0x2da597=!![];var _0x535c6c={'tls':{'rejectUnauthorized':![]}};if(_0x15f6a9['MailAccount'][_0x3b52('0xb')]['service']){_0x535c6c[_0x3b52('0xc')]=_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0xc')];}else{_0x535c6c[_0x3b52('0xe')]=_0x15f6a9['MailAccount'][_0x3b52('0xb')][_0x3b52('0xe')];_0x535c6c[_0x3b52('0xf')]=_0x15f6a9[_0x3b52('0xd')]['Smtp']['port'];_0x535c6c[_0x3b52('0x10')]=_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x10')];}if(_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')]['authentication']){_0x535c6c['auth']={'user':_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')]['user'],'pass':_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x11')]};}var _0x481375={'account':_0x535c6c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x15f6a9['MailAccount'][_0x3b52('0x12')],_0x15f6a9[_0x3b52('0xd')]['email']||_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x13')]),'to':_0x15f6a9[_0x3b52('0xa')],'cc':_0x15f6a9['cc'],'bcc':_0x15f6a9['bcc'],'subject':util[_0x3b52('0x14')]('Report\x20%s\x20last\x20%s\x20%s',_0x27446d[_0x3b52('0x12')],_0x15f6a9[_0x3b52('0x15')],_0x15f6a9['subtractUnit'])}};var _0x37db3d=path[_0x3b52('0x16')](__dirname,_0x3b52('0x17'));var _0x3fdb6e=_0x27446d['savename'];var _0x42866a=util[_0x3b52('0x14')](_0x3b52('0x18'),path[_0x3b52('0x19')](_0x27446d['savename'],path['extname'](_0x27446d['savename'])),_0x3b52('0x1a'));var _0x553f40=path[_0x3b52('0x16')](_0x37db3d,_0x3fdb6e);var _0x400170=path[_0x3b52('0x16')](_0x37db3d,_0x42866a);if(fs[_0x3b52('0x1b')](_0x553f40)){_0x27446d[_0x3b52('0x1c')]=_0x3b52('0x1d');_0x481375['message']['attachments']=[{'filename':_0x3fdb6e,'path':_0x553f40}];_0x481375['message'][_0x3b52('0x1e')]=util[_0x3b52('0x14')](_0x3b52('0x1f'),JSON[_0x3b52('0x20')](_0x27446d,null,0x2));}else if(fs[_0x3b52('0x1b')](_0x400170)){_0x27446d['status']=_0x3b52('0x1d');_0x481375['message']['attachments']=[{'filename':_0x42866a,'path':_0x400170}];}else{_0x481375[_0x3b52('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x15f6a9[_0x3b52('0x22')]){_0x2da597=![];logger[_0x3b52('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2da597){return client[_0x3b52('0x23')](_0x3b52('0x24'),_0x481375)[_0x3b52('0x25')](function(_0xbb9163){if(_0xbb9163[_0x3b52('0x26')]){return logger['error'](_0x3b52('0x27'),JSON[_0x3b52('0x20')](_0xbb9163));}return logger[_0x3b52('0x8')](_0x3b52('0x28'));})[_0x3b52('0x29')](function(_0x3c084d){return logger['error'](_0x3b52('0x27'),JSON[_0x3b52('0x20')](_0x3c084d));});}};}function handleError(){return function(_0x346ea0){return logger[_0x3b52('0x26')](JSON[_0x3b52('0x20')](_0x346ea0));};}function handleResult(_0x5404ff){return function(_0x2c6657){logger[_0x3b52('0x8')](_0x3b52('0x2a'),JSON[_0x3b52('0x20')](_0x2c6657));if(_0x5404ff[_0x3b52('0xd')]&&_0x5404ff[_0x3b52('0xd')][_0x3b52('0xb')]&&!_[_0x3b52('0x2b')](_0x5404ff['email'])){setTimeout(handleSendEmail(_0x5404ff,_0x2c6657),0x3c*0x3e8);}};}function handleJob(_0xddf8e8){return function(){try{if(_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x15')])){return logger[_0x3b52('0x8')](_0x3b52('0x2c'));}if(_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x2d')])){return logger[_0x3b52('0x8')](_0x3b52('0x2e'));}var _0x98b50b={'startDate':moment()[_0x3b52('0x2f')](_0xddf8e8[_0x3b52('0x15')],_0xddf8e8[_0x3b52('0x2d')])[_0x3b52('0x14')](_0x3b52('0x30')),'endDate':moment()[_0x3b52('0x14')](_0x3b52('0x30')),'type':_0x3b52('0x31'),'output':_0xddf8e8[_0x3b52('0x32')],'name':_0xddf8e8['name']};if(!_[_0x3b52('0x2b')](_0xddf8e8['DefaultReportId'])){logger[_0x3b52('0x8')](_0x3b52('0x33'),_0xddf8e8[_0x3b52('0x34')]);return analyticDefaultReportController[_0x3b52('0x35')]({'id':_0xddf8e8['DefaultReportId']},_0x98b50b)[_0x3b52('0x25')](handleResult(_0xddf8e8))[_0x3b52('0x29')](handleError());}if(!_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x36')])){logger[_0x3b52('0x8')](_0x3b52('0x37'),_0xddf8e8[_0x3b52('0x36')]);return analyticCustomReportController[_0x3b52('0x35')]({'id':_0xddf8e8[_0x3b52('0x36')]},_0x98b50b)[_0x3b52('0x25')](handleResult(_0xddf8e8))[_0x3b52('0x29')](handleError());}}catch(_0x4df68c){logger[_0x3b52('0x26')](JSON['stringify'](_0x4df68c));}return logger[_0x3b52('0x8')](_0x3b52('0x38'));};}function getJobs(_0xd18e15){var _0xfb0f14={};if(_0xd18e15){_0xfb0f14['id']=_0xd18e15;}return db[_0x3b52('0x39')][_0x3b52('0x3a')]({'where':_0xfb0f14,'include':[{'model':db[_0x3b52('0xd')],'attributes':['id','name',_0x3b52('0xa')],'include':[{'model':db[_0x3b52('0x3b')],'as':_0x3b52('0xb')}]}]})[_0x3b52('0x25')](function(_0x488ea5){var _0x4a014b=_[_0x3b52('0x3c')](manager['jobs']);var _0x1af23e=_[_0x3b52('0x3d')](_0x488ea5,function(_0x18c78a){return _0x18c78a['id'][_0x3b52('0x3e')]();});var _0x2fbb0c=_[_0x3b52('0x3f')](_0x488ea5,function(_0x199de8){return _0x199de8['id'][_0x3b52('0x3e')]();});var _0x1ac4b8=_0xd18e15?_0x1af23e:_['difference'](_0x1af23e,_0x4a014b);var _0x24b81f=_[_0x3b52('0x40')](_0x1af23e,_0x4a014b);var _0x2a9a11=_[_0x3b52('0x41')](_0x4a014b,_0x1af23e);var _0x1f8303;var _0xe195e2;for(_0x1f8303=0x0;_0x1f8303<_0x2a9a11[_0x3b52('0x42')]&&!_0xd18e15;_0x1f8303+=0x1){_0xe195e2=_0x2a9a11[_0x1f8303][_0x3b52('0x3e')]();if(manager[_0x3b52('0x43')](_0xe195e2)){manager[_0x3b52('0x44')](_0xe195e2);manager[_0x3b52('0x45')](_0xe195e2);logger[_0x3b52('0x8')](_0x3b52('0x46'),_0xe195e2);}}logger[_0x3b52('0x8')](_0x3b52('0x47'),JSON[_0x3b52('0x20')](_0x1ac4b8));for(_0x1f8303=0x0;_0x1f8303<_0x1ac4b8[_0x3b52('0x42')];_0x1f8303+=0x1){_0xe195e2=_0x1ac4b8[_0x1f8303][_0x3b52('0x3e')]();logger[_0x3b52('0x8')](_0x3b52('0x48'),_0xe195e2);if(_0xd18e15){logger[_0x3b52('0x8')](_0x3b52('0x49'),_0xd18e15);logger[_0x3b52('0x8')](JSON[_0x3b52('0x20')](_0x2fbb0c[_0xe195e2]));BPromise['resolve']()[_0x3b52('0x25')](handleJob(_0x2fbb0c[_0xe195e2]));logger[_0x3b52('0x8')](_0x3b52('0x4a'),_0x2fbb0c[_0xe195e2][_0x3b52('0x12')],_0x2fbb0c[_0xe195e2]['cron']);}else if(_0x2fbb0c[_0xe195e2]['cron']&&_0x2fbb0c[_0xe195e2][_0x3b52('0x4b')]&&moment()[_0x3b52('0x4c')](_0x2fbb0c[_0xe195e2]['startAt'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4d')])){manager[_0x3b52('0x4e')](_0xe195e2,_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')],handleJob(_0x2fbb0c[_0xe195e2]));manager[_0x3b52('0x50')](_0xe195e2);logger['info'](_0x3b52('0x51'),_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]);}else if(manager[_0x3b52('0x43')](_0xe195e2)){manager[_0x3b52('0x44')](_0xe195e2);manager[_0x3b52('0x45')](_0xe195e2);logger['info'](_0x3b52('0x52'),_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2]['cron']);}}for(_0x1f8303=0x0,_0xe195e2;_0x1f8303<_0x24b81f[_0x3b52('0x42')]&&!_0xd18e15;_0x1f8303+=0x1){_0xe195e2=_0x24b81f[_0x1f8303][_0x3b52('0x3e')]();if(manager[_0x3b52('0x43')](_0xe195e2)){if(_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]&&_0x2fbb0c[_0xe195e2][_0x3b52('0x4b')]&&moment()['isBetween'](_0x2fbb0c[_0xe195e2][_0x3b52('0x53')],_0x2fbb0c[_0xe195e2][_0x3b52('0x4d')])){manager[_0x3b52('0x54')](_0xe195e2,_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')],handleJob(_0x2fbb0c[_0xe195e2]));logger['info']('update\x20cron',_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]);}else{manager[_0x3b52('0x44')](_0xe195e2);manager['deleteJob'](_0xe195e2);logger['info']('stop\x20cron',_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2]['cron']);}}}})[_0x3b52('0x29')](function(_0x5cb66c){logger[_0x3b52('0x26')](JSON[_0x3b52('0x20')](_0x5cb66c));});}exports[_0x3b52('0x55')]=function(_0x13d4fb){return getJobs(_0x13d4fb);};exports[_0x3b52('0x50')]=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 708064e..3090ba4 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 _0x1120=['getTranscriptionJob','detectSentiment','substring','format','transcribeName','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','bucket','fileText','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','language','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','push','lodash','aws-sdk','request-promise','transcribe','TranscribeService'];(function(_0x49bd93,_0x2c9bc3){var _0x52974f=function(_0x2d9cd8){while(--_0x2d9cd8){_0x49bd93['push'](_0x49bd93['shift']());}};_0x52974f(++_0x2c9bc3);}(_0x1120,0x140));var _0x0112=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x1120[_0x102e37];return _0x35a07c;};var _=require(_0x0112('0x0'));var AWS=require(_0x0112('0x1'));var rp=require(_0x0112('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x0112('0x3'));function getTranscriptionJob(_0x395145,_0x1d9e34,_0xa78633,_0x419307){return new Promise(function(_0x10fdca,_0x408230){var _0x40ad0d=new AWS[(_0x0112('0x4'))]({'accessKeyId':_0x1d9e34,'secretAccessKey':_0x395145,'region':_0xa78633});_0x40ad0d[_0x0112('0x5')]({'TranscriptionJobName':_0x419307},function(_0x2fd18c,_0x1e87af){if(_0x2fd18c){return _0x408230(_0x2fd18c);}else{return _0x10fdca(_0x1e87af);}});});}function sentiment(_0x4bf145,_0x126262,_0x26fd2e,_0x2f9a7d,_0x31d6c5){return new Promise(function(_0x1e74f2,_0x707684){var _0x2c0680=new AWS['Comprehend']({'accessKeyId':_0x126262,'secretAccessKey':_0x4bf145,'region':_0x26fd2e});_0x2c0680[_0x0112('0x6')]({'Text':_0x2f9a7d,'LanguageCode':_0x31d6c5[_0x0112('0x7')](0x0,0x2)},function(_0x5fee9c,_0x762578){if(_0x5fee9c){return _0x707684(_0x5fee9c);}else{return _0x1e74f2(_0x762578);}});});}function checkTranscribeJob(_0x58b431,_0x95d441,_0x394926){var _0xb58a0b;return new BPromise(function(_0x140750,_0x5a47d5){logger['info'](util[_0x0112('0x8')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x58b431['id'],_0x58b431[_0x0112('0x9')]));return getTranscriptionJob(_0x394926['data1'],_0x394926[_0x0112('0xa')],_0x95d441[_0x0112('0xb')],_0x58b431[_0x0112('0x9')])[_0x0112('0xc')](function(_0x54269a){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0xe'),_0x58b431['id'],_0x58b431['transcribeName'],_0x54269a['TranscriptionJob'][_0x0112('0xf')]));if(!_0x58b431['fileText']){switch(_0x54269a[_0x0112('0x10')]['TranscriptionJobStatus']){case _0x0112('0x11'):var _0x2b952d={'transcribeStatus':_0x54269a['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x54269a[_0x0112('0x10')][_0x0112('0x12')]['TranscriptFileUri']};logger[_0x0112('0xd')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x58b431['id']));return rp({'uri':_0x54269a['TranscriptionJob'][_0x0112('0x12')][_0x0112('0x13')],'json':!![]})[_0x0112('0xc')](function(_0x53f19c){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x14'),_0x58b431['id']));if(_0x53f19c&&_0x53f19c[_0x0112('0x15')]&&_0x53f19c['results'][_0x0112('0x16')]&&_0x53f19c[_0x0112('0x15')][_0x0112('0x16')][_0x0112('0x17')]){_0x2b952d['fileText']='';for(var _0x1e0f71=0x0;_0x1e0f71<_0x53f19c['results']['transcripts'][_0x0112('0x17')];_0x1e0f71++){_0x2b952d['fileText']+=_0x53f19c[_0x0112('0x15')]['transcripts'][_0x1e0f71][_0x0112('0x18')]+'';}}return _0x58b431[_0x0112('0x19')](_0x2b952d);})[_0x0112('0xc')](function(){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x1a'),_0x58b431['id']));if(!_0x58b431[_0x0112('0x1b')]){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))](_0x0112('0x1e'));}if(!_0x95d441[_0x0112('0x1f')]||!_0x95d441['sentimentAccountId']||!_0x95d441[_0x0112('0x20')]||!_0x95d441['language']||!_0x95d441[_0x0112('0x21')]){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2b952d[_0x0112('0x22')]){throw new Error('Transcript\x20not\x20available');}if(_0x95d441[_0x0112('0x23')]===_0x394926['id']){return _0x394926;}else{return db[_0x0112('0x24')][_0x0112('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x4aa32b){if(!_0x4aa32b){throw new db[(_0x0112('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4aa32b['data1']||!_0x4aa32b['data2']){throw new db['Sequelize'][(_0x0112('0x1d'))](_0x0112('0x26'));}_0xb58a0b=_0x4aa32b;logger[_0x0112('0xd')](util['format'](_0x0112('0x27'),_0x58b431['id']));return sentiment(_0xb58a0b[_0x0112('0x28')],_0xb58a0b['data2'],_0x95d441[_0x0112('0x20')],_0x2b952d['fileText'],_0x95d441[_0x0112('0x29')]);})['then'](function(_0x17152b){logger[_0x0112('0xd')](util[_0x0112('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x58b431['id']));return _0x58b431['update']({'sentiment':_0x17152b['Sentiment'],'sPositive':_0x17152b['SentimentScore'][_0x0112('0x2a')],'sNegative':_0x17152b[_0x0112('0x2b')][_0x0112('0x2c')],'sMixed':_0x17152b[_0x0112('0x2b')][_0x0112('0x2d')],'sNeutral':_0x17152b[_0x0112('0x2b')][_0x0112('0x2e')]});})[_0x0112('0xc')](function(){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x1a'),_0x58b431['id']));_0x140750();});case _0x0112('0x2f'):return _0x58b431[_0x0112('0x19')]({'transcribeStatus':_0x0112('0x2f'),'failureReason':_0x54269a['TranscriptionJob']['FailureReason']})['then'](function(){logger['info'](util[_0x0112('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x58b431['id']));_0x140750();});default:logger[_0x0112('0xd')](util['format'](_0x0112('0x30'),_0x58b431['id']));break;}}else{return BPromise[_0x0112('0x31')]()[_0x0112('0xc')](function(){if(!_0x58b431[_0x0112('0x1b')]){throw new db['Sequelize'][(_0x0112('0x1d'))](_0x0112('0x1e'));}if(!_0x95d441[_0x0112('0x1f')]||!_0x95d441[_0x0112('0x23')]||!_0x95d441['sentimentRegion']||!_0x95d441['language']||!_0x95d441['bucket']){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))](_0x0112('0x32'));}if(!_0x58b431[_0x0112('0x22')]){throw new Error('Transcript\x20not\x20available');}if(_0x95d441[_0x0112('0x23')]===_0x394926['id']){return _0x394926;}else{return db[_0x0112('0x24')][_0x0112('0x25')]({'where':{'id':_settings[_0x0112('0x23')]}});}})['then'](function(_0x117d4d){if(!_0x117d4d){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x117d4d[_0x0112('0x28')]||!_0x117d4d[_0x0112('0xa')]){throw new db[(_0x0112('0x1c'))]['ValidationError'](_0x0112('0x26'));}_0xb58a0b=_0x117d4d;logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x27'),_0x58b431['id']));return sentiment(_0xb58a0b[_0x0112('0x28')],_0xb58a0b[_0x0112('0xa')],_0x95d441['sentimentRegion'],_0x58b431[_0x0112('0x22')],_0x95d441['language']);})[_0x0112('0xc')](function(_0x8cb36c){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x33'),_0x58b431['id']));return _0x58b431['update']({'sentiment':_0x8cb36c['Sentiment'],'sPositive':_0x8cb36c['SentimentScore']['Positive'],'sNegative':_0x8cb36c[_0x0112('0x2b')][_0x0112('0x2c')],'sMixed':_0x8cb36c['SentimentScore'][_0x0112('0x2d')],'sNeutral':_0x8cb36c[_0x0112('0x2b')][_0x0112('0x2e')],'transcribeStatus':_0x0112('0x11')});})['then'](function(){logger[_0x0112('0xd')](util[_0x0112('0x8')](_0x0112('0x1a'),_0x58b431['id']));_0x140750();});}})[_0x0112('0x34')](function(_0x59f7e3){if(_0x59f7e3){if(!_0x59f7e3['name']||_0x59f7e3[_0x0112('0x35')]!==_0x0112('0x36')){logger[_0x0112('0x37')](util['format'](_0x0112('0x38'),_0x58b431['id']),util[_0x0112('0x39')](_0x59f7e3,{'showHidden':![],'depth':null}));}}_0x140750();});});}function checkTranscribe(){var _0x39a7e6;var _0x3e525c;var _0x4d7d63;return db[_0x0112('0x3a')][_0x0112('0x3b')]({'where':{'transcribeStatus':_0x0112('0x3c')}})['then'](function(_0x13cc93){if(!_0x13cc93||!_0x13cc93[_0x0112('0x17')]){throw new db['Sequelize'][(_0x0112('0x1d'))](_0x0112('0x3d'));}_0x39a7e6=_0x13cc93;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x288ae7){if(!_0x288ae7){throw new db['Sequelize'][(_0x0112('0x1d'))]('Settings\x20not\x20available');}_0x3e525c=_0x288ae7;if(!_0x3e525c['transcribe']||!_0x3e525c['transcribeAccountId']||!_0x3e525c[_0x0112('0xb')]||!_0x3e525c[_0x0112('0x29')]||!_0x3e525c['bucket']){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))](_0x0112('0x3e'));}return db[_0x0112('0x24')][_0x0112('0x25')]({'where':{'id':_0x3e525c['transcribeAccountId']}});})['then'](function(_0x5c0a67){if(!_0x5c0a67){throw new db[(_0x0112('0x1c'))]['ValidationError'](_0x0112('0x3f'));}if(!_0x5c0a67[_0x0112('0x28')]||!_0x5c0a67[_0x0112('0xa')]){throw new db[(_0x0112('0x1c'))][(_0x0112('0x1d'))](_0x0112('0x26'));}_0x4d7d63=_0x5c0a67;var _0x4c730f=[];_0x39a7e6['forEach'](function(_0x1ceaf3){_0x4c730f[_0x0112('0x40')](checkTranscribeJob(_0x1ceaf3,_0x3e525c,_0x4d7d63));});return BPromise['all'](_0x4c730f);})[_0x0112('0x34')](function(_0x286f3a){if(_0x286f3a){if(!_0x286f3a[_0x0112('0x35')]||_0x286f3a['name']!==_0x0112('0x36')){logger[_0x0112('0x37')](util[_0x0112('0x39')](_0x286f3a,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x7980=['../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','all','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb'];(function(_0x567c8f,_0x5226a9){var _0x5dd537=function(_0x3ca83f){while(--_0x3ca83f){_0x567c8f['push'](_0x567c8f['shift']());}};_0x5dd537(++_0x5226a9);}(_0x7980,0x123));var _0x0798=function(_0x5a83b1,_0x29f9c8){_0x5a83b1=_0x5a83b1-0x0;var _0x3943b7=_0x7980[_0x5a83b1];return _0x3943b7;};var _=require(_0x0798('0x0'));var AWS=require(_0x0798('0x1'));var rp=require('request-promise');var util=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var db=require(_0x0798('0x4'))['db'];var logger=require(_0x0798('0x5'))(_0x0798('0x6'));function getTranscriptionJob(_0x43fa79,_0x119a23,_0xa50ea,_0x5568e9){return new Promise(function(_0x12ea59,_0x22a15f){var _0x429cea=new AWS[(_0x0798('0x7'))]({'accessKeyId':_0x119a23,'secretAccessKey':_0x43fa79,'region':_0xa50ea});_0x429cea[_0x0798('0x8')]({'TranscriptionJobName':_0x5568e9},function(_0x6d2904,_0x51b4c1){if(_0x6d2904){return _0x22a15f(_0x6d2904);}else{return _0x12ea59(_0x51b4c1);}});});}function sentiment(_0x34acae,_0x42f8dc,_0x772259,_0x2524a4,_0xf2c8dc){return new Promise(function(_0x393e71,_0x329189){var _0x218b3f=new AWS[(_0x0798('0x9'))]({'accessKeyId':_0x42f8dc,'secretAccessKey':_0x34acae,'region':_0x772259});_0x218b3f[_0x0798('0xa')]({'Text':_0x2524a4,'LanguageCode':_0xf2c8dc[_0x0798('0xb')](0x0,0x2)},function(_0x2e582c,_0x5a5710){if(_0x2e582c){return _0x329189(_0x2e582c);}else{return _0x393e71(_0x5a5710);}});});}function checkTranscribeJob(_0x1db338,_0x549e25,_0x24bbcf){var _0x5c2bc7;return new BPromise(function(_0x1134fc,_0x539d47){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0xe'),_0x1db338['id'],_0x1db338[_0x0798('0xf')]));return getTranscriptionJob(_0x24bbcf[_0x0798('0x10')],_0x24bbcf[_0x0798('0x11')],_0x549e25[_0x0798('0x12')],_0x1db338[_0x0798('0xf')])[_0x0798('0x13')](function(_0xe435f7){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x14'),_0x1db338['id'],_0x1db338[_0x0798('0xf')],_0xe435f7[_0x0798('0x15')][_0x0798('0x16')]));if(!_0x1db338[_0x0798('0x17')]){switch(_0xe435f7[_0x0798('0x15')]['TranscriptionJobStatus']){case _0x0798('0x18'):var _0x101221={'transcribeStatus':_0xe435f7[_0x0798('0x15')][_0x0798('0x16')],'fileUri':_0xe435f7[_0x0798('0x15')][_0x0798('0x19')]['TranscriptFileUri']};logger[_0x0798('0xc')](util['format'](_0x0798('0x1a'),_0x1db338['id']));return rp({'uri':_0xe435f7['TranscriptionJob']['Transcript'][_0x0798('0x1b')],'json':!![]})[_0x0798('0x13')](function(_0x12e5e6){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1db338['id']));if(_0x12e5e6&&_0x12e5e6[_0x0798('0x1c')]&&_0x12e5e6['results'][_0x0798('0x1d')]&&_0x12e5e6['results'][_0x0798('0x1d')][_0x0798('0x1e')]){_0x101221[_0x0798('0x17')]='';for(var _0x4cd9c0=0x0;_0x4cd9c0<_0x12e5e6[_0x0798('0x1c')]['transcripts'][_0x0798('0x1e')];_0x4cd9c0++){_0x101221[_0x0798('0x17')]+=_0x12e5e6[_0x0798('0x1c')][_0x0798('0x1d')][_0x4cd9c0]['transcript']+'';}}return _0x1db338[_0x0798('0x1f')](_0x101221);})['then'](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x20'),_0x1db338['id']));if(!_0x1db338['tempSentiment']){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x22'));}if(!_0x549e25[_0x0798('0x23')]||!_0x549e25[_0x0798('0x24')]||!_0x549e25['sentimentRegion']||!_0x549e25['language']||!_0x549e25[_0x0798('0x25')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x27'));}if(!_0x101221['fileText']){throw new Error(_0x0798('0x28'));}if(_0x549e25[_0x0798('0x24')]===_0x24bbcf['id']){return _0x24bbcf;}else{return db[_0x0798('0x29')][_0x0798('0x2a')]({'where':{'id':_settings[_0x0798('0x24')]}});}})[_0x0798('0x13')](function(_0x372237){if(!_0x372237){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x2b'));}if(!_0x372237['data1']||!_0x372237[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x5c2bc7=_0x372237;logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1db338['id']));return sentiment(_0x5c2bc7[_0x0798('0x10')],_0x5c2bc7[_0x0798('0x11')],_0x549e25[_0x0798('0x2c')],_0x101221[_0x0798('0x17')],_0x549e25[_0x0798('0x2d')]);})[_0x0798('0x13')](function(_0x1c3751){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x2e'),_0x1db338['id']));return _0x1db338['update']({'sentiment':_0x1c3751[_0x0798('0x2f')],'sPositive':_0x1c3751['SentimentScore'][_0x0798('0x30')],'sNegative':_0x1c3751['SentimentScore']['Negative'],'sMixed':_0x1c3751[_0x0798('0x31')][_0x0798('0x32')],'sNeutral':_0x1c3751[_0x0798('0x31')][_0x0798('0x33')]});})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util['format'](_0x0798('0x20'),_0x1db338['id']));_0x1134fc();});case'FAILED':return _0x1db338[_0x0798('0x1f')]({'transcribeStatus':_0x0798('0x34'),'failureReason':_0xe435f7['TranscriptionJob'][_0x0798('0x35')]})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1db338['id']));_0x1134fc();});default:logger['info'](util['format'](_0x0798('0x36'),_0x1db338['id']));break;}}else{return BPromise[_0x0798('0x37')]()[_0x0798('0x13')](function(){if(!_0x1db338[_0x0798('0x38')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x22'));}if(!_0x549e25['sentiment']||!_0x549e25[_0x0798('0x24')]||!_0x549e25[_0x0798('0x2c')]||!_0x549e25['language']||!_0x549e25[_0x0798('0x25')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x27'));}if(!_0x1db338[_0x0798('0x17')]){throw new Error(_0x0798('0x28'));}if(_0x549e25[_0x0798('0x24')]===_0x24bbcf['id']){return _0x24bbcf;}else{return db['CloudProvider'][_0x0798('0x2a')]({'where':{'id':_settings[_0x0798('0x24')]}});}})['then'](function(_0x412fcd){if(!_0x412fcd){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x2b'));}if(!_0x412fcd[_0x0798('0x10')]||!_0x412fcd[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x39'));}_0x5c2bc7=_0x412fcd;logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x3a'),_0x1db338['id']));return sentiment(_0x5c2bc7[_0x0798('0x10')],_0x5c2bc7[_0x0798('0x11')],_0x549e25[_0x0798('0x2c')],_0x1db338['fileText'],_0x549e25['language']);})[_0x0798('0x13')](function(_0x1a614f){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x2e'),_0x1db338['id']));return _0x1db338[_0x0798('0x1f')]({'sentiment':_0x1a614f[_0x0798('0x2f')],'sPositive':_0x1a614f[_0x0798('0x31')][_0x0798('0x30')],'sNegative':_0x1a614f[_0x0798('0x31')][_0x0798('0x3b')],'sMixed':_0x1a614f[_0x0798('0x31')]['Mixed'],'sNeutral':_0x1a614f[_0x0798('0x31')][_0x0798('0x33')],'transcribeStatus':_0x0798('0x18')});})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1db338['id']));_0x1134fc();});}})[_0x0798('0x3c')](function(_0x45c9b4){if(_0x45c9b4){if(!_0x45c9b4[_0x0798('0x3d')]||_0x45c9b4[_0x0798('0x3d')]!==_0x0798('0x3e')){logger['error'](util[_0x0798('0xd')](_0x0798('0x3f'),_0x1db338['id']),util[_0x0798('0x40')](_0x45c9b4,{'showHidden':![],'depth':null}));}}_0x1134fc();});});}function checkTranscribe(){var _0x52abc9;var _0x6cd0f7;var _0x2b0cd1;return db['VoiceRecording'][_0x0798('0x41')]({'where':{'transcribeStatus':_0x0798('0x42')}})[_0x0798('0x13')](function(_0x1453d7){if(!_0x1453d7||!_0x1453d7['length']){throw new db[(_0x0798('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x52abc9=_0x1453d7;return db[_0x0798('0x43')][_0x0798('0x2a')]({'where':{'id':0x1}});})[_0x0798('0x13')](function(_0x2be108){if(!_0x2be108){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x44'));}_0x6cd0f7=_0x2be108;if(!_0x6cd0f7['transcribe']||!_0x6cd0f7['transcribeAccountId']||!_0x6cd0f7[_0x0798('0x12')]||!_0x6cd0f7[_0x0798('0x2d')]||!_0x6cd0f7['bucket']){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x45'));}return db['CloudProvider'][_0x0798('0x2a')]({'where':{'id':_0x6cd0f7[_0x0798('0x46')]}});})[_0x0798('0x13')](function(_0x1c5643){if(!_0x1c5643){throw new db[(_0x0798('0x21'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1c5643[_0x0798('0x10')]||!_0x1c5643[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x39'));}_0x2b0cd1=_0x1c5643;var _0x41d912=[];_0x52abc9['forEach'](function(_0x2d6fa7){_0x41d912['push'](checkTranscribeJob(_0x2d6fa7,_0x6cd0f7,_0x2b0cd1));});return BPromise[_0x0798('0x47')](_0x41d912);})[_0x0798('0x3c')](function(_0x2ed2e1){if(_0x2ed2e1){if(!_0x2ed2e1[_0x0798('0x3d')]||_0x2ed2e1[_0x0798('0x3d')]!==_0x0798('0x3e')){logger[_0x0798('0x48')](util[_0x0798('0x40')](_0x2ed2e1,{'showHidden':![],'depth':null}));}}});}exports[_0x0798('0x49')]=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 19cfcea..d05fcf8 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 _0x63a6=['whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','WhatsappInteraction','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x1b3abf,_0x4a5693){var _0x17b06b=function(_0x1c51a6){while(--_0x1c51a6){_0x1b3abf['push'](_0x1b3abf['shift']());}};_0x17b06b(++_0x4a5693);}(_0x63a6,0x1c7));var _0x663a=function(_0x5745d2,_0x536b58){_0x5745d2=_0x5745d2-0x0;var _0xd6df54=_0x63a6[_0x5745d2];return _0xd6df54;};'use strict';var _=require('lodash');var moment=require(_0x663a('0x0'));var Redis=require(_0x663a('0x1'));var util=require('util');var config=require(_0x663a('0x2'));var db=require(_0x663a('0x3'))['db'];var logger=require('../logger')(_0x663a('0x4'));config[_0x663a('0x5')]=_[_0x663a('0x6')](config[_0x663a('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x14b552=[];return db[_0x663a('0x7')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x663a('0x8')](0x18,_0x663a('0x9'))}}})[_0x663a('0xa')](function(_0x4aa93a){if(_0x4aa93a&&_0x4aa93a['length']){_0x14b552=_[_0x663a('0xb')](_0x4aa93a||[],'id');logger[_0x663a('0xc')](_0x663a('0xd'),_0x14b552[_0x663a('0xe')]());return db[_0x663a('0x7')][_0x663a('0xf')]({'closeReason':'system','disposition':_0x663a('0x10'),'closed':!![],'closedAt':moment()[_0x663a('0x11')](_0x663a('0x12'))},{'where':{'id':_0x14b552}});}})['then'](function(){if(_0x14b552&&_0x14b552['length']){logger[_0x663a('0xc')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x14b552['join']());for(var _0x2e01e1=0x0;_0x2e01e1<_0x14b552[_0x663a('0x13')];_0x2e01e1++){io['emit'](_0x663a('0x14'),{'id':_0x14b552[_0x2e01e1],'closed':!![]});}}})['catch'](function(_0x2fafbe){logger[_0x663a('0x15')](_0x663a('0x16'),_0x2fafbe?util[_0x663a('0x17')](_0x2fafbe,{'showHidden':![],'depth':null}):'');});}exports[_0x663a('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfa03=['lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x10dab0,_0x7537ac){var _0x263cde=function(_0x1139ec){while(--_0x1139ec){_0x10dab0['push'](_0x10dab0['shift']());}};_0x263cde(++_0x7537ac);}(_0xfa03,0xba));var _0x3fa0=function(_0x3aad16,_0x1c4969){_0x3aad16=_0x3aad16-0x0;var _0x3dc1ba=_0xfa03[_0x3aad16];return _0x3dc1ba;};'use strict';var _=require(_0x3fa0('0x0'));var moment=require(_0x3fa0('0x1'));var Redis=require(_0x3fa0('0x2'));var util=require(_0x3fa0('0x3'));var config=require(_0x3fa0('0x4'));var db=require(_0x3fa0('0x5'))['db'];var logger=require(_0x3fa0('0x6'))(_0x3fa0('0x7'));config['redis']=_[_0x3fa0('0x8')](config[_0x3fa0('0x9')],{'host':_0x3fa0('0xa'),'port':0x18eb});var io=require(_0x3fa0('0xb'))(new Redis(config[_0x3fa0('0x9')]));function closeInteractions(){var _0x914332=[];return db['WhatsappInteraction'][_0x3fa0('0xc')]({'raw':!![],'attributes':['id',_0x3fa0('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3fa0('0xe')](0x18,'hours')}}})[_0x3fa0('0xf')](function(_0x3b7ff5){if(_0x3b7ff5&&_0x3b7ff5[_0x3fa0('0x10')]){_0x914332=_[_0x3fa0('0x11')](_0x3b7ff5||[],'id');logger[_0x3fa0('0x12')](_0x3fa0('0x13'),_0x914332['join']());return db[_0x3fa0('0x14')][_0x3fa0('0x15')]({'closeReason':_0x3fa0('0x16'),'disposition':_0x3fa0('0x17'),'closed':!![],'closedAt':moment()['format'](_0x3fa0('0x18'))},{'where':{'id':_0x914332}});}})[_0x3fa0('0xf')](function(){if(_0x914332&&_0x914332['length']){logger[_0x3fa0('0x12')](_0x3fa0('0x19'),_0x914332['join']());for(var _0x277988=0x0;_0x277988<_0x914332['length'];_0x277988++){io[_0x3fa0('0x1a')](_0x3fa0('0x1b'),{'id':_0x914332[_0x277988],'closed':!![]});}}})[_0x3fa0('0x1c')](function(_0x412e3a){logger['error'](_0x3fa0('0x1d'),_0x412e3a?util[_0x3fa0('0x1e')](_0x412e3a,{'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/seedContact.js b/server/config/seedContact.js index 7c0bf4b..0846fd1 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4be6=['../mysqldb','Biondo','innocenzo.biondo','push','now','@xcally.com','CmContact','destroy','bulkCreate','CmHopper','then','log','finished\x20populating','hopper1','hopper2','catch'];(function(_0x443a06,_0x5bafca){var _0xa1fb2b=function(_0x141ddd){while(--_0x141ddd){_0x443a06['push'](_0x443a06['shift']());}};_0xa1fb2b(++_0x5bafca);}(_0x4be6,0xd0));var _0x64be=function(_0x498577,_0x4b8af0){_0x498577=_0x498577-0x0;var _0x56f79a=_0x4be6[_0x498577];return _0x56f79a;};'use strict';var util=require('util');var db=require(_0x64be('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x64be('0x1')+i,'phone':0xf879fb460+i,'email':_0x64be('0x2')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x64be('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x64be('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x64be('0x4')](),'updatedAt':Date[_0x64be('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x64be('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x64be('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x64be('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x64be('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x64be('0x4')](),'updatedAt':Date['now']()});}db[_0x64be('0x6')][_0x64be('0x7')]({'where':{}})['then'](function(){return db['CmContact'][_0x64be('0x8')](contacts);})['then'](function(){console['log']('finished\x20populating','contacts1');return db['CmHopper'][_0x64be('0x7')]({'where':{}});})['then'](function(){return db[_0x64be('0x9')][_0x64be('0x8')](hopper);})[_0x64be('0xa')](function(){console[_0x64be('0xb')](_0x64be('0xc'),_0x64be('0xd'));return db[_0x64be('0x6')][_0x64be('0x8')](contacts2);})['then'](function(){console[_0x64be('0xb')]('finished\x20populating','contacts2');return db[_0x64be('0x9')]['bulkCreate'](hopper2);})[_0x64be('0xa')](function(){console[_0x64be('0xb')]('finished\x20populating',_0x64be('0xe'));})[_0x64be('0xf')](function(_0x25f124){console[_0x64be('0xb')](_0x25f124);}); \ No newline at end of file +var _0xc6d3=['now','Biondo','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com'];(function(_0x2ed395,_0x24323b){var _0x14a5eb=function(_0x12a09b){while(--_0x12a09b){_0x2ed395['push'](_0x2ed395['shift']());}};_0x14a5eb(++_0x24323b);}(_0xc6d3,0xf1));var _0x3c6d=function(_0x4fc0c6,_0x48b1b8){_0x4fc0c6=_0x4fc0c6-0x0;var _0x1e0e5e=_0xc6d3[_0x4fc0c6];return _0x1e0e5e;};'use strict';var util=require(_0x3c6d('0x0'));var db=require(_0x3c6d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3c6d('0x2')]({'id':i,'firstName':_0x3c6d('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3c6d('0x4')+i+_0x3c6d('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3c6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3c6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c6d('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x3c6d('0x3')+i,'lastName':_0x3c6d('0x7')+i,'phone':0xf879fb460+i,'email':_0x3c6d('0x4')+i+_0x3c6d('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3c6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3c6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c6d('0x6')](),'updatedAt':Date['now']()});}db['CmContact']['destroy']({'where':{}})[_0x3c6d('0x8')](function(){return db[_0x3c6d('0x9')][_0x3c6d('0xa')](contacts);})[_0x3c6d('0x8')](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0xd'));return db['CmHopper'][_0x3c6d('0xe')]({'where':{}});})[_0x3c6d('0x8')](function(){return db[_0x3c6d('0xf')]['bulkCreate'](hopper);})['then'](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0x10'));return db[_0x3c6d('0x9')][_0x3c6d('0xa')](contacts2);})[_0x3c6d('0x8')](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0x11'));return db[_0x3c6d('0xf')][_0x3c6d('0xa')](hopper2);})[_0x3c6d('0x8')](function(){console['log'](_0x3c6d('0xc'),_0x3c6d('0x12'));})['catch'](function(_0x5e6fde){console[_0x3c6d('0xb')](_0x5e6fde);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5525eb8..f86ee18 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3559=['password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com'];(function(_0x5b55b5,_0x433251){var _0x54068d=function(_0x4f2d4b){while(--_0x4f2d4b){_0x5b55b5['push'](_0x5b55b5['shift']());}};_0x54068d(++_0x433251);}(_0x3559,0x15e));var _0x9355=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3559[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x9355('0x0'));var db=require(_0x9355('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9355('0x2')]({'name':util['format'](_0x9355('0x3'),_0x9355('0x4'),i),'fullname':util[_0x9355('0x5')](_0x9355('0x3'),_0x9355('0x4'),i),'email':util[_0x9355('0x5')](_0x9355('0x6'),'agent',i),'role':'agent','password':_0x9355('0x7'),'internal':0xfa0+i,'type':_0x9355('0x8'),'transport':[_0x9355('0x9'),'ws',_0x9355('0xa')],'disallow':[_0x9355('0xb')],'allow':[_0x9355('0xc')],'defaultuser':util[_0x9355('0x5')]('%s%s','agent',i),'encryption':_0x9355('0xd'),'avpf':_0x9355('0xd'),'force_avp':_0x9355('0xd'),'icesupport':_0x9355('0xd'),'dtlsenable':_0x9355('0xd'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x9355('0xe'),'dtlssetup':'actpass','callerid':util[_0x9355('0x5')]('\x22%s\x22\x20<%s>',util[_0x9355('0x5')](_0x9355('0x3'),_0x9355('0x4'),i),0xfa0+i)});}db[_0x9355('0xf')][_0x9355('0x10')](users)[_0x9355('0x11')](function(){console[_0x9355('0x12')](_0x9355('0x13'));})[_0x9355('0x14')](function(_0x1d397c){console['log'](_0x1d397c);}); \ No newline at end of file +var _0xe2d4=['push','%s%s','agent','format','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','log','add\x20user','util','../mysqldb'];(function(_0x4b824a,_0x275d05){var _0x3779ab=function(_0x3de4e5){while(--_0x3de4e5){_0x4b824a['push'](_0x4b824a['shift']());}};_0x3779ab(++_0x275d05);}(_0xe2d4,0x17a));var _0x4e2d=function(_0x24bc09,_0x294f72){_0x24bc09=_0x24bc09-0x0;var _0x2431c8=_0xe2d4[_0x24bc09];return _0x2431c8;};'use strict';var util=require(_0x4e2d('0x0'));var db=require(_0x4e2d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4e2d('0x2')]({'name':util['format'](_0x4e2d('0x3'),_0x4e2d('0x4'),i),'fullname':util[_0x4e2d('0x5')](_0x4e2d('0x3'),_0x4e2d('0x4'),i),'email':util[_0x4e2d('0x5')]('%s%s@xcally.com',_0x4e2d('0x4'),i),'role':_0x4e2d('0x4'),'password':_0x4e2d('0x6'),'internal':0xfa0+i,'type':_0x4e2d('0x7'),'transport':[_0x4e2d('0x8'),'ws',_0x4e2d('0x9')],'disallow':[_0x4e2d('0xa')],'allow':[_0x4e2d('0xb')],'defaultuser':util[_0x4e2d('0x5')]('%s%s',_0x4e2d('0x4'),i),'encryption':_0x4e2d('0xc'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x4e2d('0xc'),'dtlsverify':'no','dtlscertfile':_0x4e2d('0xd'),'dtlsprivatekey':_0x4e2d('0xe'),'dtlssetup':_0x4e2d('0xf'),'callerid':util[_0x4e2d('0x5')]('\x22%s\x22\x20<%s>',util[_0x4e2d('0x5')](_0x4e2d('0x3'),_0x4e2d('0x4'),i),0xfa0+i)});}db['User'][_0x4e2d('0x10')](users)[_0x4e2d('0x11')](function(){console[_0x4e2d('0x12')](_0x4e2d('0x13'));})['catch'](function(_0x2ec2c8){console[_0x4e2d('0x12')](_0x2ec2c8);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 14008b2..ec3d545 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee55=['sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','default','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','address','DISCONNECTED','lodash','bluebird','./environment','Agents','User','role','agent','name','telephone','type','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','ivr','format','%s:queue:%s','length','user:%s','handshake','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','SmsQueue','OpenchannelQueue','Trunk','user','userProfileId','ChatQueue','MailQueue','WhatsappQueues','WhatsappQueue','Trunks','getVoiceQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','all'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xee55,0x1a0));var _0x5ee5=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xee55[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x5ee5('0x0'));var util=require('util');var BPromise=require(_0x5ee5('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x5ee5('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x5ee5('0x3'),'model':db[_0x5ee5('0x4')],'attributes':['id','name',_0x5ee5('0x5')],'raw':!![],'where':{'role':_0x5ee5('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5ee5('0x7')],'where':{'role':_0x5ee5('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5ee5('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x5ee5('0x7')],'where':{'role':_0x5ee5('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x5ee5('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4ca2f6,_0xb1de5b,_0x5eeb7b){return db['UserProfileSection'][_0x5ee5('0xa')]({'where':{'name':_0x4ca2f6,'userProfileId':_0xb1de5b},'raw':!![]})[_0x5ee5('0xb')](function(_0xd361f5){if(_0xd361f5){if(_0xd361f5[_0x5ee5('0xc')]){switch(_0x4ca2f6){case'VoiceQueues':case _0x5ee5('0xd'):case _0x5ee5('0xe'):case _0x5ee5('0xf'):case _0x5ee5('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x5eeb7b][_0x5ee5('0x11')](queryQueues);case _0x5ee5('0x12'):return db[_0x5eeb7b][_0x5ee5('0x11')](queryTelephones);case'Trunks':return db[_0x5eeb7b][_0x5ee5('0x11')](queryTrunks);case _0x5ee5('0x13'):return db[_0x5eeb7b][_0x5ee5('0x11')](queryCampaigns);}}else{return db[_0x5ee5('0x14')][_0x5ee5('0x11')]({'attributes':[_0x5ee5('0x15')],'where':{'sectionId':_0xd361f5['id']},'raw':!![]})[_0x5ee5('0xb')](function(_0x5dd990){if(_0x5dd990){var _0x2773ab={'where':{'id':_[_0x5ee5('0x16')](_0x5dd990,_0x5ee5('0x15'))},'raw':!![]};switch(_0x5eeb7b){case _0x5ee5('0x4'):_0x2773ab['where']['role']=_0x5ee5('0x8');break;case _0x5ee5('0x17'):_0x2773ab[_0x5ee5('0x18')]['type']=_0x5ee5('0x19');break;}return db[_0x5eeb7b]['findAll'](_0x2773ab);}else{return[];}});}}else{return[];}})[_0x5ee5('0xb')](function(_0x5b8f1a){return _0x5b8f1a;});}function joinOrLeaveQueues(_0x2c859a,_0x18f8cc,_0x17417a,_0x33f150){_0x2c859a[_0x18f8cc](util[_0x5ee5('0x1a')](_0x5ee5('0x1b'),_0x17417a,_0x33f150[_0x5ee5('0x7')]));if(_0x33f150[_0x5ee5('0x3')]){for(var _0x45e278=0x0;_0x45e278<_0x33f150[_0x5ee5('0x3')][_0x5ee5('0x1c')];_0x45e278+=0x1){_0x2c859a[_0x18f8cc](util[_0x5ee5('0x1a')](_0x5ee5('0x1d'),_0x33f150[_0x5ee5('0x3')][_0x45e278][_0x5ee5('0x7')]));}}}function joinOrLeave(_0x1efbd1,_0x3aa2d5,_0x1e0f65){var _0x1c2004;if(_0x1efbd1[_0x5ee5('0x1e')]['query']['id']){db['User'][_0x5ee5('0x1f')]({'attributes':['id',_0x5ee5('0x7'),_0x5ee5('0x5'),'userProfileId'],'where':{'id':_0x1efbd1[_0x5ee5('0x1e')]['query']['id']},'include':[{'model':db[_0x5ee5('0x20')],'as':_0x5ee5('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee5('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x5ee5('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee5('0x24')],'as':_0x5ee5('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee5('0x26')],'as':_0x5ee5('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5ee5('0x28')],'as':_0x5ee5('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3d78a8){if(_0x3d78a8){_0x1c2004=_0x3d78a8;_0x1efbd1[_0x3aa2d5](util[_0x5ee5('0x1a')](_0x5ee5('0x1d'),_0x3d78a8['name']));var _0x1ba633=[];switch(_0x3d78a8[_0x5ee5('0x5')]){case _0x5ee5('0x2a'):_0x1efbd1[_0x3aa2d5](_0x5ee5('0x2b'));_0x1efbd1[_0x3aa2d5](_0x5ee5('0x2c'));if(queryQueues[_0x5ee5('0x2d')](_0x5ee5('0x2e'))){delete queryQueues[_0x5ee5('0x2e')];}_0x1ba633['push'](db[_0x5ee5('0x2f')]['findAll'](queryQueues));_0x1ba633[_0x5ee5('0x30')](db['ChatQueue'][_0x5ee5('0x11')](queryQueues));_0x1ba633[_0x5ee5('0x30')](db['FaxQueue']['findAll'](queryQueues));_0x1ba633[_0x5ee5('0x30')](db[_0x5ee5('0x31')][_0x5ee5('0x11')](queryQueues));_0x1ba633[_0x5ee5('0x30')](db['MailQueue'][_0x5ee5('0x11')](queryQueues));_0x1ba633['push'](db[_0x5ee5('0x32')]['findAll'](queryQueues));_0x1ba633[_0x5ee5('0x30')](db['WhatsappQueue'][_0x5ee5('0x11')](queryQueues));_0x1ba633[_0x5ee5('0x30')](db[_0x5ee5('0x4')][_0x5ee5('0x11')](queryTelephones));_0x1ba633[_0x5ee5('0x30')](db[_0x5ee5('0x33')][_0x5ee5('0x11')](queryTrunks));_0x1ba633['push'](db[_0x5ee5('0x17')][_0x5ee5('0x11')](queryCampaigns));_0x1ba633[_0x5ee5('0x30')](db[_0x5ee5('0x4')]['findAll'](queryAgents));break;case _0x5ee5('0x34'):_0x1efbd1[_0x3aa2d5]('voice:inbound');_0x1efbd1[_0x3aa2d5](_0x5ee5('0x2c'));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources('VoiceQueues',_0x3d78a8[_0x5ee5('0x35')],'VoiceQueue'));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources(_0x5ee5('0xd'),_0x3d78a8[_0x5ee5('0x35')],_0x5ee5('0x36')));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources(_0x5ee5('0xe'),_0x3d78a8['userProfileId'],'FaxQueue'));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources('SmsQueues',_0x3d78a8['userProfileId'],_0x5ee5('0x31')));_0x1ba633['push'](getAssociatedResources(_0x5ee5('0x10'),_0x3d78a8[_0x5ee5('0x35')],_0x5ee5('0x37')));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources('OpenchannelQueues',_0x3d78a8['userProfileId'],_0x5ee5('0x32')));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources(_0x5ee5('0x38'),_0x3d78a8[_0x5ee5('0x35')],_0x5ee5('0x39')));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources(_0x5ee5('0x12'),_0x3d78a8[_0x5ee5('0x35')],_0x5ee5('0x4')));_0x1ba633[_0x5ee5('0x30')](getAssociatedResources(_0x5ee5('0x3a'),_0x3d78a8[_0x5ee5('0x35')],_0x5ee5('0x33')));_0x1ba633['push'](getAssociatedResources(_0x5ee5('0x13'),_0x3d78a8[_0x5ee5('0x35')],'Campaign'));_0x1ba633[_0x5ee5('0x30')](db[_0x5ee5('0x4')]['findAll'](queryAgents));break;case'agent':_0x1efbd1[_0x3aa2d5](_0x5ee5('0x2b'));_0x1efbd1[_0x3aa2d5](_0x5ee5('0x2c'));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8[_0x5ee5('0x3b')]({'attributes':['id',_0x5ee5('0x7')]}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8['getChatQueues']({'attributes':['id',_0x5ee5('0x7')]}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8[_0x5ee5('0x3c')]({'attributes':['id',_0x5ee5('0x7')]}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8['getSmsQueues']({'attributes':['id','name']}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8['getMailQueues']({'attributes':['id',_0x5ee5('0x7')]}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8[_0x5ee5('0x3d')]({'attributes':['id',_0x5ee5('0x7')]}));_0x1ba633[_0x5ee5('0x30')](_0x3d78a8[_0x5ee5('0x3e')]({'attributes':['id',_0x5ee5('0x7')]}));break;}return BPromise[_0x5ee5('0x3f')](_0x1ba633);}})['then'](function(_0x7e96a1){if(_0x7e96a1&&_0x7e96a1[_0x5ee5('0x1c')]){for(var _0x28cade=0x0;_0x28cade<_0x7e96a1[_0x5ee5('0x1c')];_0x28cade+=0x1){for(var _0x1a53ef=0x0;_0x1a53ef<_0x7e96a1[_0x28cade][_0x5ee5('0x1c')];_0x1a53ef+=0x1){switch(_0x28cade){case 0x0:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,'voice',_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x1:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,'chat',_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x2:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,'fax',_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x3:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,_0x5ee5('0x40'),_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x4:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,_0x5ee5('0x41'),_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x5:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,_0x5ee5('0x42'),_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x6:joinOrLeaveQueues(_0x1efbd1,_0x3aa2d5,_0x5ee5('0x43'),_0x7e96a1[_0x28cade][_0x1a53ef]);break;case 0x7:if(_0x1c2004[_0x5ee5('0x5')]!==_0x5ee5('0x6'))_0x1efbd1[_0x3aa2d5](util['format'](_0x5ee5('0x44'),_0x7e96a1[_0x28cade][_0x1a53ef][_0x5ee5('0x7')]));break;case 0x8:if(_0x1c2004['role']!==_0x5ee5('0x6'))_0x1efbd1[_0x3aa2d5](util[_0x5ee5('0x1a')](_0x5ee5('0x45'),_0x7e96a1[_0x28cade][_0x1a53ef][_0x5ee5('0x7')]));break;case 0x9:if(_0x1c2004['role']!==_0x5ee5('0x6'))_0x1efbd1[_0x3aa2d5](util[_0x5ee5('0x1a')]('campaign:%s:%s',_0x7e96a1[_0x28cade][_0x1a53ef]['type'],_0x7e96a1[_0x28cade][_0x1a53ef][_0x5ee5('0x7')]));break;case 0xa:_0x1efbd1[_0x3aa2d5](util[_0x5ee5('0x1a')]('user:%s',_0x7e96a1[_0x28cade][_0x1a53ef]['name']));break;}}}}})[_0x5ee5('0xb')](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0x4b5b2d=_['map'](_0x1c2004[_0x5ee5('0x21')],'id');return _0x1c2004[_0x5ee5('0x47')](_0x4b5b2d)[_0x5ee5('0xb')](function(){for(var _0x22a5e2=0x0;_0x22a5e2<_0x4b5b2d['length'];_0x22a5e2+=0x1){_0x1e0f65['emit'](_0x5ee5('0x48'),{'ChatInteractionId':Number(_0x4b5b2d[_0x22a5e2]),'UserId':Number(_0x1c2004['id'])});}});}})[_0x5ee5('0xb')](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0x507bb9=_['map'](_0x1c2004[_0x5ee5('0x49')],'id');return _0x1c2004[_0x5ee5('0x4a')](_0x507bb9)[_0x5ee5('0xb')](function(){for(var _0x4b6435=0x0;_0x4b6435<_0x507bb9[_0x5ee5('0x1c')];_0x4b6435+=0x1){_0x1e0f65[_0x5ee5('0x4b')](_0x5ee5('0x4c'),{'MailInteractionId':Number(_0x507bb9[_0x4b6435]),'UserId':Number(_0x1c2004['id'])});}});}})['then'](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0x5f2ef6=_[_0x5ee5('0x16')](_0x1c2004['FaxInteractions'],'id');return _0x1c2004[_0x5ee5('0x4d')](_0x5f2ef6)[_0x5ee5('0xb')](function(){for(var _0xd2055d=0x0;_0xd2055d<_0x5f2ef6[_0x5ee5('0x1c')];_0xd2055d+=0x1){_0x1e0f65[_0x5ee5('0x4b')](_0x5ee5('0x4e'),{'FaxInteractionId':Number(_0x5f2ef6[_0xd2055d]),'UserId':Number(_0x1c2004['id'])});}});}})[_0x5ee5('0xb')](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0x3fcc86=_[_0x5ee5('0x16')](_0x1c2004[_0x5ee5('0x25')],'id');return _0x1c2004['removeSmsInteractions'](_0x3fcc86)[_0x5ee5('0xb')](function(){for(var _0x23d0d6=0x0;_0x23d0d6<_0x3fcc86[_0x5ee5('0x1c')];_0x23d0d6+=0x1){_0x1e0f65[_0x5ee5('0x4b')](_0x5ee5('0x4f'),{'SmsInteractionId':Number(_0x3fcc86[_0x23d0d6]),'UserId':Number(_0x1c2004['id'])});}});}})[_0x5ee5('0xb')](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0x5d0a29=_[_0x5ee5('0x16')](_0x1c2004[_0x5ee5('0x27')],'id');return _0x1c2004[_0x5ee5('0x50')](_0x5d0a29)[_0x5ee5('0xb')](function(){for(var _0x603f9c=0x0;_0x603f9c<_0x5d0a29['length'];_0x603f9c+=0x1){_0x1e0f65[_0x5ee5('0x4b')](_0x5ee5('0x51'),{'OpenchannelInteractionId':Number(_0x5d0a29[_0x603f9c]),'UserId':Number(_0x1c2004['id'])});}});}})[_0x5ee5('0xb')](function(){if(_0x3aa2d5===_0x5ee5('0x46')){var _0xb30038=_[_0x5ee5('0x16')](_0x1c2004['WhatsappInteractions'],'id');return _0x1c2004[_0x5ee5('0x52')](_0xb30038)[_0x5ee5('0xb')](function(){for(var _0x37f3dd=0x0;_0x37f3dd<_0xb30038[_0x5ee5('0x1c')];_0x37f3dd+=0x1){_0x1e0f65[_0x5ee5('0x4b')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xb30038[_0x37f3dd]),'UserId':Number(_0x1c2004['id'])});}});}})[_0x5ee5('0x53')](function(_0x50b453){_0x1efbd1['log'](_0x50b453);});}}function onDisconnect(_0x374e88,_0x33293e){joinOrLeave(_0x374e88,_0x5ee5('0x46'),_0x33293e);}function onConnect(_0xe08a24){joinOrLeave(_0xe08a24,_0x5ee5('0x54'));}exports[_0x5ee5('0x55')]=function(_0xdc9069){_0xdc9069['on']('connection',function(_0x344bc0){_0x344bc0[_0x5ee5('0x56')](0x0);_0x344bc0['address']=_0x344bc0[_0x5ee5('0x57')][_0x5ee5('0x58')][_0x5ee5('0x59')]+':'+_0x344bc0[_0x5ee5('0x57')][_0x5ee5('0x58')][_0x5ee5('0x5a')];_0x344bc0[_0x5ee5('0x5b')]=new Date();_0x344bc0['log']=function(_0x36e44f){console[_0x5ee5('0x5c')](_0x5ee5('0x5d')+_0x344bc0['nsp'][_0x5ee5('0x7')]+'['+_0x344bc0[_0x5ee5('0x5e')]+']',_0x36e44f);};_0x344bc0['on']('disconnect',function(){onDisconnect(_0x344bc0,_0xdc9069);_0x344bc0[_0x5ee5('0x5c')](_0x5ee5('0x5f'));});onConnect(_0x344bc0);_0x344bc0[_0x5ee5('0x5c')]('CONNECTED');});}; \ No newline at end of file +var _0x39e6=['MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueue','SmsQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','fax','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','leave','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','User','Campaign','where','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39e6,0x9e));var _0x639e=function(_0x5c95fb,_0x4ded42){_0x5c95fb=_0x5c95fb-0x0;var _0xbae5b3=_0x39e6[_0x5c95fb];return _0xbae5b3;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var BPromise=require(_0x639e('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x639e('0x2')],'include':[{'as':_0x639e('0x3'),'model':db['User'],'attributes':['id',_0x639e('0x2'),_0x639e('0x4')],'raw':!![],'where':{'role':_0x639e('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x639e('0x2')],'where':{'role':_0x639e('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x639e('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x639e('0x2')],'where':{'role':_0x639e('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x639e('0x2'),_0x639e('0x7')],'where':{'type':_0x639e('0x8')}};function getAssociatedResources(_0x2fab76,_0x2a6749,_0x4410d4){return db[_0x639e('0x9')][_0x639e('0xa')]({'where':{'name':_0x2fab76,'userProfileId':_0x2a6749},'raw':!![]})[_0x639e('0xb')](function(_0x3834a6){if(_0x3834a6){if(_0x3834a6['autoAssociation']){switch(_0x2fab76){case'VoiceQueues':case _0x639e('0xc'):case _0x639e('0xd'):case _0x639e('0xe'):case _0x639e('0xf'):case _0x639e('0x10'):case _0x639e('0x11'):return db[_0x4410d4][_0x639e('0x12')](queryQueues);case'Telephones':return db[_0x4410d4]['findAll'](queryTelephones);case _0x639e('0x13'):return db[_0x4410d4][_0x639e('0x12')](queryTrunks);case _0x639e('0x14'):return db[_0x4410d4][_0x639e('0x12')](queryCampaigns);}}else{return db[_0x639e('0x15')][_0x639e('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x3834a6['id']},'raw':!![]})[_0x639e('0xb')](function(_0x20bfbb){if(_0x20bfbb){var _0x23f0f9={'where':{'id':_[_0x639e('0x16')](_0x20bfbb,'resourceId')},'raw':!![]};switch(_0x4410d4){case _0x639e('0x17'):_0x23f0f9['where'][_0x639e('0x4')]=_0x639e('0x6');break;case _0x639e('0x18'):_0x23f0f9[_0x639e('0x19')][_0x639e('0x7')]=_0x639e('0x8');break;}return db[_0x4410d4]['findAll'](_0x23f0f9);}else{return[];}});}}else{return[];}})[_0x639e('0xb')](function(_0x34baca){return _0x34baca;});}function joinOrLeaveQueues(_0x36f71d,_0x1da55e,_0x59f772,_0x28e05e){_0x36f71d[_0x1da55e](util[_0x639e('0x1a')](_0x639e('0x1b'),_0x59f772,_0x28e05e[_0x639e('0x2')]));if(_0x28e05e[_0x639e('0x3')]){for(var _0x50de77=0x0;_0x50de77<_0x28e05e[_0x639e('0x3')][_0x639e('0x1c')];_0x50de77+=0x1){_0x36f71d[_0x1da55e](util['format'](_0x639e('0x1d'),_0x28e05e['Agents'][_0x50de77]['name']));}}}function joinOrLeave(_0x224d52,_0x3813f6,_0x3ab673){var _0x24e1ad;if(_0x224d52[_0x639e('0x1e')]['query']['id']){db[_0x639e('0x17')][_0x639e('0x1f')]({'attributes':['id',_0x639e('0x2'),_0x639e('0x4'),_0x639e('0x20')],'where':{'id':_0x224d52['handshake'][_0x639e('0x21')]['id']},'include':[{'model':db[_0x639e('0x22')],'as':_0x639e('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x25')],'as':_0x639e('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x2c8e3a){if(_0x2c8e3a){_0x24e1ad=_0x2c8e3a;_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x1d'),_0x2c8e3a[_0x639e('0x2')]));var _0x412176=[];switch(_0x2c8e3a[_0x639e('0x4')]){case'admin':_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6](_0x639e('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x639e('0x2c')];}_0x412176[_0x639e('0x2d')](db[_0x639e('0x2e')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db['ChatQueue'][_0x639e('0x12')](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x2f')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db['SmsQueue'][_0x639e('0x12')](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x30')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x31')][_0x639e('0x12')](queryQueues));_0x412176['push'](db[_0x639e('0x32')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x17')][_0x639e('0x12')](queryTelephones));_0x412176[_0x639e('0x2d')](db[_0x639e('0x33')]['findAll'](queryTrunks));_0x412176[_0x639e('0x2d')](db[_0x639e('0x18')][_0x639e('0x12')](queryCampaigns));_0x412176[_0x639e('0x2d')](db['User'][_0x639e('0x12')](queryAgents));break;case _0x639e('0x34'):_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6]('voice:outbound');_0x412176[_0x639e('0x2d')](getAssociatedResources('VoiceQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x2e')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0xc'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x35')));_0x412176['push'](getAssociatedResources(_0x639e('0xd'),_0x2c8e3a[_0x639e('0x20')],'FaxQueue'));_0x412176[_0x639e('0x2d')](getAssociatedResources('SmsQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x36')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0xf'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x30')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0x10'),_0x2c8e3a['userProfileId'],'OpenchannelQueue'));_0x412176['push'](getAssociatedResources('WhatsappQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x32')));_0x412176['push'](getAssociatedResources(_0x639e('0x37'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x17')));_0x412176['push'](getAssociatedResources(_0x639e('0x13'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x33')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0x14'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x18')));_0x412176[_0x639e('0x2d')](db[_0x639e('0x17')]['findAll'](queryAgents));break;case _0x639e('0x5'):_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6](_0x639e('0x2b'));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x38')]({'attributes':['id',_0x639e('0x2')]}));_0x412176['push'](_0x2c8e3a[_0x639e('0x39')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3a')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3b')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3c')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a['getOpenchannelQueues']({'attributes':['id',_0x639e('0x2')]}));_0x412176['push'](_0x2c8e3a['getWhatsappQueues']({'attributes':['id',_0x639e('0x2')]}));break;}return BPromise[_0x639e('0x3d')](_0x412176);}})[_0x639e('0xb')](function(_0x47620d){if(_0x47620d&&_0x47620d[_0x639e('0x1c')]){for(var _0x5b27b6=0x0;_0x5b27b6<_0x47620d[_0x639e('0x1c')];_0x5b27b6+=0x1){for(var _0x1fa830=0x0;_0x1fa830<_0x47620d[_0x5b27b6]['length'];_0x1fa830+=0x1){switch(_0x5b27b6){case 0x0:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x3e'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x1:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x3f'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x2:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x40'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x3:joinOrLeaveQueues(_0x224d52,_0x3813f6,'sms',_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x4:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x41'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x5:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x42'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x6:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x43'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x7:if(_0x24e1ad[_0x639e('0x4')]!=='agent')_0x224d52[_0x3813f6](util[_0x639e('0x1a')]('telephone:%s',_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;case 0x8:if(_0x24e1ad['role']!==_0x639e('0x5'))_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x44'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;case 0x9:if(_0x24e1ad[_0x639e('0x4')]!=='agent')_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x45'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x7')],_0x47620d[_0x5b27b6][_0x1fa830]['name']));break;case 0xa:_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x1d'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;}}}}})[_0x639e('0xb')](function(){if(_0x3813f6==='leave'){var _0xb7afb8=_['map'](_0x24e1ad[_0x639e('0x23')],'id');return _0x24e1ad[_0x639e('0x46')](_0xb7afb8)[_0x639e('0xb')](function(){for(var _0x555629=0x0;_0x555629<_0xb7afb8['length'];_0x555629+=0x1){_0x3ab673[_0x639e('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xb7afb8[_0x555629]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x1e9278=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x49')],'id');return _0x24e1ad['removeMailInteractions'](_0x1e9278)[_0x639e('0xb')](function(){for(var _0x9f3c5c=0x0;_0x9f3c5c<_0x1e9278[_0x639e('0x1c')];_0x9f3c5c+=0x1){_0x3ab673['emit'](_0x639e('0x4a'),{'MailInteractionId':Number(_0x1e9278[_0x9f3c5c]),'UserId':Number(_0x24e1ad['id'])});}});}})[_0x639e('0xb')](function(){if(_0x3813f6===_0x639e('0x48')){var _0x3c22a8=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x26')],'id');return _0x24e1ad[_0x639e('0x4b')](_0x3c22a8)['then'](function(){for(var _0x349cc6=0x0;_0x349cc6<_0x3c22a8[_0x639e('0x1c')];_0x349cc6+=0x1){_0x3ab673[_0x639e('0x47')](_0x639e('0x4c'),{'FaxInteractionId':Number(_0x3c22a8[_0x349cc6]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x29ee94=_[_0x639e('0x16')](_0x24e1ad['SmsInteractions'],'id');return _0x24e1ad['removeSmsInteractions'](_0x29ee94)['then'](function(){for(var _0x151cbe=0x0;_0x151cbe<_0x29ee94[_0x639e('0x1c')];_0x151cbe+=0x1){_0x3ab673['emit'](_0x639e('0x4d'),{'SmsInteractionId':Number(_0x29ee94[_0x151cbe]),'UserId':Number(_0x24e1ad['id'])});}});}})[_0x639e('0xb')](function(){if(_0x3813f6===_0x639e('0x48')){var _0x29314a=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x4e')],'id');return _0x24e1ad[_0x639e('0x4f')](_0x29314a)[_0x639e('0xb')](function(){for(var _0x51112d=0x0;_0x51112d<_0x29314a[_0x639e('0x1c')];_0x51112d+=0x1){_0x3ab673[_0x639e('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x29314a[_0x51112d]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x549d44=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x50')],'id');return _0x24e1ad[_0x639e('0x51')](_0x549d44)['then'](function(){for(var _0x6085ca=0x0;_0x6085ca<_0x549d44[_0x639e('0x1c')];_0x6085ca+=0x1){_0x3ab673[_0x639e('0x47')](_0x639e('0x52'),{'WhatsappInteractionId':Number(_0x549d44[_0x6085ca]),'UserId':Number(_0x24e1ad['id'])});}});}})['catch'](function(_0x212e27){_0x224d52[_0x639e('0x53')](_0x212e27);});}}function onDisconnect(_0x4eda16,_0x404adb){joinOrLeave(_0x4eda16,_0x639e('0x48'),_0x404adb);}function onConnect(_0x6b1b3e){joinOrLeave(_0x6b1b3e,_0x639e('0x54'));}exports[_0x639e('0x55')]=function(_0x570835){_0x570835['on'](_0x639e('0x56'),function(_0x94fab4){_0x94fab4[_0x639e('0x57')](0x0);_0x94fab4[_0x639e('0x58')]=_0x94fab4[_0x639e('0x59')][_0x639e('0x56')][_0x639e('0x5a')]+':'+_0x94fab4[_0x639e('0x59')][_0x639e('0x56')][_0x639e('0x5b')];_0x94fab4['connectedAt']=new Date();_0x94fab4['log']=function(_0xdeb345){console[_0x639e('0x53')](_0x639e('0x5c')+_0x94fab4[_0x639e('0x5d')][_0x639e('0x2')]+'['+_0x94fab4['address']+']',_0xdeb345);};_0x94fab4['on'](_0x639e('0x5e'),function(){onDisconnect(_0x94fab4,_0x570835);_0x94fab4['log'](_0x639e('0x5f'));});onConnect(_0x94fab4);_0x94fab4[_0x639e('0x53')](_0x639e('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b03aa7c..e6de424 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 _0x6cbf=['internal','format','SIP/%s','incomingmessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','changed','closed','User','interface','agent','default','length','hook','callback','toLowerCase','condition','util','jayson/promise','lodash','client','Chat','ChatInteraction','afterCreate','afterUpdate','ChatMessage','newinteraction','Sms','closedinteraction','SmsMessage','newmessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','substatus','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','channel','motionChannel','event','direction','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','find','name','fullname','email'];(function(_0x33968f,_0x19e029){var _0x3ca1e5=function(_0x59ed2f){while(--_0x59ed2f){_0x33968f['push'](_0x33968f['shift']());}};_0x3ca1e5(++_0x19e029);}(_0x6cbf,0x122));var _0xf6cb=function(_0x5239ff,_0x46ff0f){_0x5239ff=_0x5239ff-0x0;var _0x466b66=_0x6cbf[_0x5239ff];return _0x466b66;};'use strict';var util=require(_0xf6cb('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf6cb('0x1'));var logger=require('../logger')('triggers');var _=require(_0xf6cb('0x2'));var client=jayson[_0xf6cb('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xf6cb('0x4'),'model':_0xf6cb('0x5'),'event':_0xf6cb('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xf6cb('0x4'),'model':_0xf6cb('0x5'),'event':_0xf6cb('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf6cb('0x4'),'model':_0xf6cb('0x8'),'event':_0xf6cb('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xf6cb('0x6'),'condition':_0xf6cb('0x9'),'callback':afterCreate},{'channel':_0xf6cb('0xa'),'model':'SmsInteraction','event':'afterUpdate','condition':_0xf6cb('0xb'),'callback':afterUpdate},{'channel':_0xf6cb('0xa'),'model':_0xf6cb('0xc'),'event':_0xf6cb('0x6'),'condition':_0xf6cb('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xf6cb('0xe'),'event':_0xf6cb('0x6'),'condition':_0xf6cb('0x9'),'callback':afterCreate},{'channel':_0xf6cb('0xf'),'model':'WhatsappInteraction','event':_0xf6cb('0x7'),'condition':_0xf6cb('0xb'),'callback':afterUpdate},{'channel':_0xf6cb('0xf'),'model':_0xf6cb('0x10'),'event':_0xf6cb('0x6'),'condition':_0xf6cb('0xd'),'callback':afterCreateMessage},{'channel':_0xf6cb('0x11'),'model':_0xf6cb('0x12'),'event':'afterCreate','condition':_0xf6cb('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0xf6cb('0x12'),'event':_0xf6cb('0x7'),'condition':_0xf6cb('0xb'),'callback':afterUpdate},{'channel':_0xf6cb('0x11'),'model':'FaxMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf6cb('0x13'),'model':_0xf6cb('0x14'),'event':_0xf6cb('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0xf6cb('0x14'),'event':'afterUpdate','condition':_0xf6cb('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0xf6cb('0x14'),'event':_0xf6cb('0x15'),'condition':_0xf6cb('0x15'),'callback':afterUpdate},{'channel':_0xf6cb('0x13'),'model':_0xf6cb('0x16'),'event':'afterCreate','condition':_0xf6cb('0xd'),'callback':afterCreateMessage},{'channel':_0xf6cb('0x17'),'model':_0xf6cb('0x18'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xf6cb('0x17'),'model':'OpenchannelInteraction','event':_0xf6cb('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xf6cb('0x19'),'event':_0xf6cb('0x6'),'condition':_0xf6cb('0xd'),'callback':afterCreateMessage}];function request(_0x407e28){return client[_0xf6cb('0x1a')](_0xf6cb('0x1b'),_0x407e28)[_0xf6cb('0x1c')](function(_0x17e689){logger[_0xf6cb('0x1d')](_0xf6cb('0x1e'),_0xf6cb('0x1b'),_0x17e689);if(_0x17e689[_0xf6cb('0x1f')]){if(_0x17e689['error']['code']===0x1f4){logger[_0xf6cb('0x1f')](_0xf6cb('0x1e'),_0xf6cb('0x1b'),_0x17e689[_0xf6cb('0x1f')]);}}})[_0xf6cb('0x20')](function(_0x425ff9){logger[_0xf6cb('0x1f')](_0xf6cb('0x1e'),_0xf6cb('0x1b'),_0x425ff9);});}function afterCreateMessage(_0x49653f,_0x37504a){return function(_0x155f4c,_0x362945){_0x155f4c=_0x155f4c[_0xf6cb('0x21')]({'plain':!![]});_0x155f4c[_0xf6cb('0x22')]=_0x49653f;_0x155f4c[_0xf6cb('0x23')]=_0x49653f;_0x155f4c[_0xf6cb('0x24')]=_0x155f4c[_0xf6cb('0x25')];var _0x1fc8f3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x155f4c[_0xf6cb('0x26')];return db[_0xf6cb('0x27')][_0xf6cb('0x28')](_0x1fc8f3,{'type':db[_0xf6cb('0x29')][_0xf6cb('0x2a')][_0xf6cb('0x2b')],'raw':!![]})[_0xf6cb('0x1c')](function(_0x492239){return _0x492239;})[_0xf6cb('0x1c')](function(_0x288a63){if(_0x288a63){_0x155f4c[_0xf6cb('0x2c')]=_0x288a63[0x0];}if(_0x155f4c[_0xf6cb('0x2d')]){return db['User'][_0xf6cb('0x2e')]({'where':{'id':_0x155f4c[_0xf6cb('0x2d')]},'attributes':['id',_0xf6cb('0x2f'),_0xf6cb('0x30'),_0xf6cb('0x31'),_0xf6cb('0x32')],'raw':!![]})[_0xf6cb('0x1c')](function(_0x2042a4){_0x155f4c['interface']=util[_0xf6cb('0x33')](_0xf6cb('0x34'),_0x2042a4['name']);_0x155f4c[_0xf6cb('0x22')]=_0x49653f;_0x155f4c['agent']=_0x2042a4;return request({'event':_0xf6cb('0x35'),'message':_0x155f4c});})[_0xf6cb('0x20')](function(_0x558d37){console[_0xf6cb('0x1f')](_0x558d37);});}else{return request({'event':_0xf6cb('0x36'),'message':_0x155f4c});}});};}function afterCreate(_0x429795,_0x5ca4b0){return function(_0x279136,_0x17584c){_0x279136=_0x279136['get']({'plain':!![]});_0x279136[_0xf6cb('0x22')]=_0x429795;_0x279136[_0xf6cb('0x23')]=_0x429795;_0x279136[_0xf6cb('0x24')]=_0xf6cb('0x37');var _0x415f7f=_0xf6cb('0x38')+_0x279136['ContactId'];return db[_0xf6cb('0x27')][_0xf6cb('0x28')](_0x415f7f,{'type':db[_0xf6cb('0x29')][_0xf6cb('0x2a')]['SELECT'],'raw':!![]})[_0xf6cb('0x1c')](function(_0x565aa8){return _0x565aa8;})['then'](function(_0x4f5cbc){if(_0x4f5cbc){_0x279136[_0xf6cb('0x2c')]=_0x4f5cbc[0x0];}return request({'event':_0x5ca4b0,'message':_0x279136});});};}function afterUpdate(_0x1ac93f,_0x32ffdc){return function(_0x1cbfce,_0x5b9c3c){if(_0x1cbfce[_0xf6cb('0x39')]('closed')&&_0x1cbfce[_0xf6cb('0x3a')]){_0x1cbfce=_0x1cbfce[_0xf6cb('0x21')]({'plain':!![]});_0x1cbfce['channel']=_0x1ac93f;_0x1cbfce[_0xf6cb('0x23')]=_0x1ac93f;_0x1cbfce[_0xf6cb('0x24')]=_0xf6cb('0x3a');var _0x5561a1=_0xf6cb('0x38')+_0x1cbfce[_0xf6cb('0x26')];return db[_0xf6cb('0x27')][_0xf6cb('0x28')](_0x5561a1,{'type':db[_0xf6cb('0x29')][_0xf6cb('0x2a')][_0xf6cb('0x2b')],'raw':!![]})['then'](function(_0xf39a60){return _0xf39a60;})[_0xf6cb('0x1c')](function(_0xde90f0){if(_0xde90f0){_0x1cbfce[_0xf6cb('0x2c')]=_0xde90f0[0x0];}if(_0x1cbfce[_0xf6cb('0x2d')]){return db[_0xf6cb('0x3b')]['find']({'where':{'id':_0x1cbfce[_0xf6cb('0x2d')]},'attributes':['id',_0xf6cb('0x2f'),_0xf6cb('0x30'),_0xf6cb('0x31'),_0xf6cb('0x32')],'raw':!![]})['then'](function(_0x549282){_0x1cbfce[_0xf6cb('0x3c')]=util[_0xf6cb('0x33')](_0xf6cb('0x34'),_0x549282[_0xf6cb('0x2f')]);_0x1cbfce[_0xf6cb('0x3d')]=_0x549282;return request({'event':_0x32ffdc,'message':_0x1cbfce});})['catch'](function(_0x3b9cfd){console[_0xf6cb('0x1f')](_0x3b9cfd);});}else{return request({'event':_0x32ffdc,'message':_0x1cbfce});}});}else if(_0x1cbfce[_0xf6cb('0x39')]('substatus')){_0x1cbfce=_0x1cbfce['get']({'plain':!![]});_0x1cbfce['channel']=_0x1ac93f;_0x1cbfce[_0xf6cb('0x24')]='substatus';var _0x5561a1=_0xf6cb('0x38')+_0x1cbfce['ContactId'];return db[_0xf6cb('0x27')][_0xf6cb('0x28')](_0x5561a1,{'type':db['Sequelize'][_0xf6cb('0x2a')][_0xf6cb('0x2b')],'raw':!![]})[_0xf6cb('0x1c')](function(_0xa6e32){return _0xa6e32;})[_0xf6cb('0x1c')](function(_0x318385){if(_0x318385){_0x1cbfce[_0xf6cb('0x2c')]=_0x318385[0x0];}if(_0x1cbfce['UserId']){return db['User'][_0xf6cb('0x2e')]({'where':{'id':_0x1cbfce[_0xf6cb('0x2d')]},'attributes':['id',_0xf6cb('0x2f'),_0xf6cb('0x30'),_0xf6cb('0x31'),'internal'],'raw':!![]})[_0xf6cb('0x1c')](function(_0x410775){_0x1cbfce[_0xf6cb('0x3c')]=util[_0xf6cb('0x33')](_0xf6cb('0x34'),_0x410775['name']);_0x1cbfce[_0xf6cb('0x3d')]=_0x410775;return request({'event':_0x32ffdc,'message':_0x1cbfce});})[_0xf6cb('0x20')](function(_0x4852a6){console['error'](_0x4852a6);});}else{return request({'event':_0x32ffdc,'message':_0x1cbfce});}});}};}exports[_0xf6cb('0x3e')]=function(){for(var _0x5aed65=0x0;_0x5aed65=_0x451da2[_0xda0f('0x13')]){throw Error(_0xda0f('0x14'));}_0x28cb3b(_0x408982);})[_0xda0f('0x15')](function(_0x3fbbb3){_0x387421(_0x3fbbb3);});});}; \ No newline at end of file +var _0x23b3=['./license/util','voice','mail','chat','sms','whatsapp','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x23b3,0x156));var _0x323b=function(_0x297f25,_0x594be0){_0x297f25=_0x297f25-0x0;var _0x4b16e8=_0x23b3[_0x297f25];return _0x4b16e8;};'use strict';var _=require(_0x323b('0x0'));var BPromise=require(_0x323b('0x1'));var db=require(_0x323b('0x2'))['db'];var util=require(_0x323b('0x3'));var channels=[_0x323b('0x4'),_0x323b('0x5'),_0x323b('0x6'),'fax',_0x323b('0x7'),_0x323b('0x8'),'openchannel'];exports[_0x323b('0x9')]=function(){return channels;};exports[_0x323b('0xa')]=function(_0x167362){_0x167362=_0x167362['toLowerCase']();return _[_0x323b('0xb')](channels,_0x167362);};exports[_0x323b('0xc')]=function(_0x2bf53a,_0x31e353,_0x452f48,_0x278a2b){var _0x769b13={'loginAttempts':_0x31e353,'blocked':_0x452f48};if(!_[_0x323b('0xd')](_0x278a2b)){_0x769b13[_0x323b('0xe')]=_0x278a2b;}return _0x2bf53a[_0x323b('0xf')](_0x769b13);};exports[_0x323b('0x10')]=function(_0x2064a2){return new BPromise(function(_0x1cd481,_0x4e2c0b){var _0x46dee9=0x0;if(_0x2064a2['role']!==_0x323b('0x11')){_0x1cd481(_0x2064a2);}db[_0x323b('0x12')]['count']({'where':{'role':_0x323b('0x11'),'online':!![],'id':{'$ne':_0x2064a2['id']}}})[_0x323b('0x13')](function(_0x388fd4){_0x46dee9=_0x388fd4;return util['getLicense']();})[_0x323b('0x13')](function(_0x2946b4){if(_0x2946b4&&_0x2946b4['agents']&&_0x46dee9>=_0x2946b4[_0x323b('0x14')]){throw Error(_0x323b('0x15'));}_0x1cd481(_0x2064a2);})[_0x323b('0x16')](function(_0x1d37a2){_0x4e2c0b(_0x1d37a2);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 34702ea..2477f9c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c4a=['send','exports','404','status','render','json'];(function(_0x7d6c0,_0x35dbf9){var _0xaab5b2=function(_0x4b3e2f){while(--_0x4b3e2f){_0x7d6c0['push'](_0x7d6c0['shift']());}};_0xaab5b2(++_0x35dbf9);}(_0x7c4a,0xf1));var _0xa7c4=function(_0x129046,_0x519448){_0x129046=_0x129046-0x0;var _0x4d06d9=_0x7c4a[_0x129046];return _0x4d06d9;};'use strict';module[_0xa7c4('0x0')][0x194]=function pageNotFound(_0x228c89,_0x2fb604){var _0x3650c0=_0xa7c4('0x1');var _0x455e01=0x194;var _0x5c5fbd={'status':_0x455e01};_0x2fb604[_0xa7c4('0x2')](_0x5c5fbd[_0xa7c4('0x2')]);_0x2fb604[_0xa7c4('0x3')](_0x3650c0,{},function(_0x2b4e68,_0x13e823){if(_0x2b4e68){return _0x2fb604['status'](_0x5c5fbd[_0xa7c4('0x2')])[_0xa7c4('0x4')](_0x5c5fbd);}_0x2fb604[_0xa7c4('0x5')](_0x13e823);});}; \ No newline at end of file +var _0xb93e=['send','exports','404','status','render','json'];(function(_0x2de12b,_0x50c255){var _0xbeb344=function(_0x204475){while(--_0x204475){_0x2de12b['push'](_0x2de12b['shift']());}};_0xbeb344(++_0x50c255);}(_0xb93e,0x6d));var _0xeb93=function(_0x4c4f17,_0x421c15){_0x4c4f17=_0x4c4f17-0x0;var _0x4403be=_0xb93e[_0x4c4f17];return _0x4403be;};'use strict';module[_0xeb93('0x0')][0x194]=function pageNotFound(_0x5b3608,_0x2a7c68){var _0x2119eb=_0xeb93('0x1');var _0x280ac6=0x194;var _0x163fd9={'status':_0x280ac6};_0x2a7c68[_0xeb93('0x2')](_0x163fd9[_0xeb93('0x2')]);_0x2a7c68[_0xeb93('0x3')](_0x2119eb,{},function(_0x3164e0,_0x2beaaf){if(_0x3164e0){return _0x2a7c68[_0xeb93('0x2')](_0x163fd9[_0xeb93('0x2')])[_0xeb93('0x4')](_0x163fd9);}_0x2a7c68[_0xeb93('0x5')](_0x2beaaf);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 19d3c6c..524cc2e 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x815e=['Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','Contact','ContactId','MailAccountId','MailServerOut','Imap','Smtp','CannedAnswer','Answers','Interactions','List','ListId','TemplateId','Agents','Team','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Disposition','Dispositions','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Attachment','FaxQueueReport','SmsAccount','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelApplication','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','ChatApplication','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','AnalyticFieldReport','CustomReportId','Fields','MetricId','Configurations','Subjects','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','AccountId','SubjectId','int_desk_configuration_has_tags','ZendeskConfiguration','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesConfiguration','FreshsalesField','ChatInternalMessage','ToId','SessionId','JscriptyAnswerReport','ProjectId','team_has_fax_queues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','SquareProjectId','FromMailAccountId','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromAgent','ToFaxQueueId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','TeamVoicePrefix','UserProfileSection','Resources','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','lodash','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','database','username','options','password','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../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','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteraction','ChatInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','UserVoicePrefix','MailQueue','MailQueues','ChatQueues','FaxQueues','OpenchannelQueues','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds'];(function(_0xc1ede1,_0x27c567){var _0x36f293=function(_0x1fe28c){while(--_0x1fe28c){_0xc1ede1['push'](_0xc1ede1['shift']());}};_0x36f293(++_0x27c567);}(_0x815e,0xb9));var _0xe815=function(_0x2f29f8,_0x22b456){_0x2f29f8=_0x2f29f8-0x0;var _0x11c90a=_0x815e[_0x2f29f8];return _0x11c90a;};'use strict';var config=require(_0xe815('0x0'));var Sequelize=require('sequelize');var _=require(_0xe815('0x1'));var jstz=require('jstz');var timezone=jstz[_0xe815('0x2')]();config[_0xe815('0x3')]=_[_0xe815('0x4')](config[_0xe815('0x3')],{'database':_0xe815('0x5'),'username':_0xe815('0x6'),'password':_0xe815('0x7'),'options':{'host':_0xe815('0x8'),'port':0xcea,'dialect':_0xe815('0x9'),'dialectOptions':{'charset':_0xe815('0xa')},'logging':![],'timezone':timezone[_0xe815('0xb')](),'define':{'charset':'utf8','collate':_0xe815('0xc')}}});config[_0xe815('0xd')]=_[_0xe815('0x4')](config[_0xe815('0xd')],{'database':'motion2','username':_0xe815('0x6'),'password':_0xe815('0x7'),'options':{'host':_0xe815('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe815('0xa')},'logging':![],'timezone':timezone[_0xe815('0xb')](),'define':{'charset':_0xe815('0xe'),'collate':_0xe815('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe815('0x3')][_0xe815('0xf')],config['sequelize'][_0xe815('0x10')],config[_0xe815('0x3')]['password'],config[_0xe815('0x3')][_0xe815('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe815('0xd')][_0xe815('0xf')],config[_0xe815('0xd')][_0xe815('0x10')],config[_0xe815('0xd')][_0xe815('0x12')],config[_0xe815('0xd')][_0xe815('0x11')])};db['User']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/user/user.model');db[_0xe815('0x14')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xe815('0x15')]=db[_0xe815('0x3')]['import'](_0xe815('0x16'));db['VoiceExtension']=db[_0xe815('0x3')]['import'](_0xe815('0x17'));db[_0xe815('0x18')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x19'));db['VoiceQueue']=db['sequelize']['import'](_0xe815('0x1a'));db['VoiceRecording']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x1b'));db[_0xe815('0x1c')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/screenRecording/screenRecording.model');db[_0xe815('0x1d')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x1e'));db[_0xe815('0x1f')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xe815('0x20')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x21'));db[_0xe815('0x22')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x23'));db[_0xe815('0x24')]=db['sequelize']['import'](_0xe815('0x25'));db[_0xe815('0x26')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x27'));db['MemberReport']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/memberReport/memberReport.model');db[_0xe815('0x28')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x29'));db[_0xe815('0x2a')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x2b'));db[_0xe815('0x2c')]=db[_0xe815('0x3')]['import'](_0xe815('0x2d'));db['UserVoiceQueue']=db['sequelize']['import'](_0xe815('0x2e'));db[_0xe815('0x2f')]=db[_0xe815('0x3')]['import'](_0xe815('0x30'));db[_0xe815('0x31')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x32'));db[_0xe815('0x33')]=db[_0xe815('0x3')]['import'](_0xe815('0x34'));db[_0xe815('0x35')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x36'));db[_0xe815('0x37')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x38'));db[_0xe815('0x39')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x3a'));db[_0xe815('0x3b')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x3c'));db['MailServerOut']=db['sequelize']['import'](_0xe815('0x3d'));db[_0xe815('0x3e')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/mailQueue/mailQueue.model');db[_0xe815('0x3f')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0xe815('0x40')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x41'));db[_0xe815('0x42')]=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db[_0xe815('0x43')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x44'));db[_0xe815('0x45')]=db['sequelize']['import'](_0xe815('0x46'));db[_0xe815('0x47')]=db[_0xe815('0x3')]['import'](_0xe815('0x48'));db[_0xe815('0x49')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xe815('0x4a')]=db[_0xe815('0x3')]['import'](_0xe815('0x4b'));db[_0xe815('0x4c')]=db['sequelize']['import'](_0xe815('0x4d'));db[_0xe815('0x4e')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xe815('0x4f')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x50'));db[_0xe815('0x51')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db['sequelize'][_0xe815('0x13')](_0xe815('0x52'));db['SmsAccount']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x53'));db[_0xe815('0x54')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x55'));db[_0xe815('0x56')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x57'));db[_0xe815('0x58')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/smsMessage/smsMessage.model');db[_0xe815('0x59')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/smsQueue/smsQueue.model');db[_0xe815('0x5a')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x5b'));db['OpenchannelApplication']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x5c'));db[_0xe815('0x5d')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xe815('0x3')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xe815('0x5e')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xe815('0x5f')]=db[_0xe815('0x3')]['import'](_0xe815('0x60'));db['OpenchannelQueueReport']=db[_0xe815('0x3')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x61'));db['ChatInteraction']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xe815('0x62')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xe815('0x3')]['import'](_0xe815('0x63'));db[_0xe815('0x64')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x65'));db[_0xe815('0x66')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x67'));db[_0xe815('0x68')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x69'));db[_0xe815('0x6a')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/cmCompany/cmCompany.model');db[_0xe815('0x6b')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x6c'));db['CmHopper']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x6d'));db[_0xe815('0x6e')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe815('0x6f')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xe815('0x70')]=db[_0xe815('0x3')]['import'](_0xe815('0x71'));db[_0xe815('0x72')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x73'));db[_0xe815('0x74')]=db['sequelize'][_0xe815('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0xe815('0x75')]=db[_0xe815('0x3')]['import'](_0xe815('0x76'));db[_0xe815('0x77')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x78'));db['CannedAnswer']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x79'));db['Condition']=db['sequelize'][_0xe815('0x13')](_0xe815('0x7a'));db[_0xe815('0x7b')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/interval/interval.model');db[_0xe815('0x7c')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/pause/pause.model');db[_0xe815('0x7d')]=db['sequelize']['import'](_0xe815('0x7e'));db[_0xe815('0x7f')]=db['sequelize']['import'](_0xe815('0x80'));db['Schedule']=db['sequelize'][_0xe815('0x13')](_0xe815('0x81'));db[_0xe815('0x82')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x83'));db[_0xe815('0x84')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x85'));db[_0xe815('0x86')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x87'));db['Trigger']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x88'));db[_0xe815('0x89')]=db['sequelize']['import']('../api/variable/variable.model');db[_0xe815('0x8a')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/integration/integration.model');db[_0xe815('0x8b')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/integrationReport/integrationReport.model');db[_0xe815('0x8c')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x8d'));db[_0xe815('0x8e')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xe815('0x8f')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xe815('0x90')]=db[_0xe815('0x3')]['import'](_0xe815('0x91'));db['AnalyticFieldReport']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x92'));db[_0xe815('0x93')]=db['sequelize']['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe815('0x94')]=db[_0xe815('0x3')]['import'](_0xe815('0x95'));db[_0xe815('0x96')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x97'));db[_0xe815('0x98')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x99'));db[_0xe815('0x9a')]=db['sequelize'][_0xe815('0x13')](_0xe815('0x9b'));db[_0xe815('0x9c')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0x9d'));db['SugarcrmField']=db['sequelize'][_0xe815('0x13')](_0xe815('0x9e'));db[_0xe815('0x9f')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xa0'));db[_0xe815('0xa1')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xa2'));db[_0xe815('0xa3')]=db[_0xe815('0x3')]['import'](_0xe815('0xa4'));db[_0xe815('0xa5')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xa6'));db[_0xe815('0xa7')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xa8'));db[_0xe815('0xa9')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xaa'));db[_0xe815('0xab')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0xe815('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xe815('0xac')]=db['sequelize'][_0xe815('0x13')](_0xe815('0xad'));db['FreshdeskAccount']=db['sequelize'][_0xe815('0x13')](_0xe815('0xae'));db[_0xe815('0xaf')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xb0'));db['FreshdeskField']=db['sequelize'][_0xe815('0x13')](_0xe815('0xb1'));db[_0xe815('0xb2')]=db['sequelize'][_0xe815('0x13')](_0xe815('0xb3'));db[_0xe815('0xb4')]=db[_0xe815('0x3')]['import'](_0xe815('0xb5'));db[_0xe815('0xb6')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xb7'));db[_0xe815('0xb8')]=db[_0xe815('0x3')]['import'](_0xe815('0xb9'));db['ServicenowConfiguration']=db[_0xe815('0x3')]['import'](_0xe815('0xba'));db[_0xe815('0xbb')]=db[_0xe815('0x3')]['import'](_0xe815('0xbc'));db[_0xe815('0xbd')]=db['sequelize'][_0xe815('0x13')](_0xe815('0xbe'));db[_0xe815('0xbf')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xc0'));db[_0xe815('0xc1')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xc2'));db[_0xe815('0xc3')]=db[_0xe815('0x3')]['import'](_0xe815('0xc4'));db['FreshsalesConfiguration']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xc5'));db['FreshsalesField']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xc6'));db[_0xe815('0x8a')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/integration/integration.model');db[_0xe815('0xc7')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xc8'));db[_0xe815('0xc9')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xca'));db['ChatInternalMessage']=db['sequelize'][_0xe815('0x13')](_0xe815('0xcb'));db['JscriptyAnswerReport']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xe815('0xcc')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xe815('0xcd')]=db[_0xe815('0x3')]['import'](_0xe815('0xce'));db[_0xe815('0xcf')]=db['sequelize']['import'](_0xe815('0xd0'));db['SquareReport']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xd1'));db[_0xe815('0xd2')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xd3'));db[_0xe815('0xd4')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xe815('0x13')]('../api/setting/setting.model');db[_0xe815('0xd5')]=db[_0xe815('0x3')]['import']('../api/squareOdbc/squareOdbc.model');db[_0xe815('0xd6')]=db[_0xe815('0x3')]['import'](_0xe815('0xd7'));db[_0xe815('0xd8')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xd9'));db['SquareMessage']=db['sequelize'][_0xe815('0x13')](_0xe815('0xda'));db['Team']=db[_0xe815('0x3')][_0xe815('0x13')]('../api/team/team.model');db[_0xe815('0xdb')]=db['sequelize'][_0xe815('0x13')](_0xe815('0xdc'));db['Campaign']=db[_0xe815('0x3')]['import'](_0xe815('0xdd'));db[_0xe815('0xde')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xdf'));db['Attachment']=db['sequelize']['import']('../api/attachment/attachment.model');db[_0xe815('0xe0')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xe1'));db[_0xe815('0xe2')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xe3'));db['ChatTransferReport']=db[_0xe815('0x3')]['import'](_0xe815('0xe4'));db[_0xe815('0xe5')]=db['sequelize'][_0xe815('0x13')](_0xe815('0xe6'));db[_0xe815('0xe7')]=db[_0xe815('0x3')]['import'](_0xe815('0xe8'));db[_0xe815('0xe9')]=db[_0xe815('0x3')]['import'](_0xe815('0xea'));db['CmList']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xeb'));db[_0xe815('0xec')]=db[_0xe815('0x3')][_0xe815('0x13')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xe815('0x3')]['import'](_0xe815('0xed'));db['UserProfileSection']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xee'));db[_0xe815('0xef')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xf0'));db['UserNotification']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xf1'));db['WhatsappAccount']=db[_0xe815('0x3')]['import'](_0xe815('0xf2'));db[_0xe815('0xf3')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xf4'));db[_0xe815('0xf5')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xf6'));db['WhatsappMessage']=db[_0xe815('0x3')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xe815('0xf7')]=db['sequelize'][_0xe815('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xf8'));db[_0xe815('0xf9')]=db[_0xe815('0x3')]['import']('../api/whatsappQueue/whatsappQueue.model');db[_0xe815('0xfa')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xfb'));db[_0xe815('0xfc')]=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xfd'));db['TeamVoicePrefix']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xfe'));db['UserVoicePrefix']=db[_0xe815('0x3')][_0xe815('0x13')](_0xe815('0xff'));db[_0xe815('0x100')][_0xe815('0x101')](db[_0xe815('0x1d')],{'as':_0xe815('0x1d'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x103')});db['User'][_0xe815('0x104')](db[_0xe815('0x105')],{'as':'Recordings','foreignKey':_0xe815('0x103')});db['User'][_0xe815('0x104')](db[_0xe815('0x2c')],{'as':_0xe815('0x106'),'foreignKey':'UserId'});db[_0xe815('0x100')]['hasMany'](db[_0xe815('0x107')],{'as':_0xe815('0x108'),'onDelete':'cascade','hooks':!![]});db[_0xe815('0x100')][_0xe815('0x104')](db['CmHopperFinal'],{'as':_0xe815('0x109'),'foreignKey':_0xe815('0x103')});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0xe815('0x10a'),'foreignKey':'UserId'});db['User'][_0xe815('0x104')](db[_0xe815('0x72')],{'as':_0xe815('0x72'),'foreignKey':'UserId'});db['User'][_0xe815('0x104')](db[_0xe815('0x5d')],{'as':_0xe815('0x10b'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x100')][_0xe815('0x104')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xe815('0x103')});db[_0xe815('0x100')][_0xe815('0x104')](db[_0xe815('0x56')],{'as':_0xe815('0x10c'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xe815('0x4e')],{'as':_0xe815('0x10d'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x100')][_0xe815('0x104')](db['MailInteraction'],{'as':_0xe815('0x10e'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x100')]['hasMany'](db[_0xe815('0xf5')],{'as':_0xe815('0x10f'),'foreignKey':_0xe815('0x103')});db['User'][_0xe815('0x104')](db[_0xe815('0x110')],{'as':_0xe815('0x111'),'foreignKey':_0xe815('0x112')});db['User']['belongsTo'](db[_0xe815('0x113')],{'as':_0xe815('0x113'),'foreignKey':_0xe815('0x114')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x66')],{'as':_0xe815('0x116'),'through':_0xe815('0x117')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x6b')],{'as':_0xe815('0x118'),'through':'cm_user_has_contacts'});db[_0xe815('0x100')]['belongsToMany'](db[_0xe815('0x119')],{'as':_0xe815('0x11a'),'through':_0xe815('0x11b')});db[_0xe815('0x100')][_0xe815('0x115')](db['Team'],{'through':_0xe815('0x11c')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x40')],{'as':_0xe815('0x10e'),'through':_0xe815('0x11d')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x11e')],{'as':_0xe815('0x11f'),'through':'user_has_chat_interactions'});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x4e')],{'as':_0xe815('0x10d'),'through':'user_has_fax_interactions'});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x56')],{'as':_0xe815('0x10c'),'through':_0xe815('0x120')});db['User'][_0xe815('0x115')](db[_0xe815('0x5d')],{'as':_0xe815('0x10b'),'through':_0xe815('0x121')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0xf5')],{'as':_0xe815('0x10f'),'through':_0xe815('0x122')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x123')],{'as':_0xe815('0x124'),'through':_0xe815('0x125'),'required':![]});db['User']['belongsToMany'](db[_0xe815('0xec')],{'as':'VoicePrefixes','through':_0xe815('0x126'),'required':![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x127')],{'as':_0xe815('0x128'),'through':'UserMailQueue','required':![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x64')],{'as':_0xe815('0x129'),'through':_0xe815('0x2f'),'required':![],'hooks':!![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x51')],{'as':_0xe815('0x12a'),'through':_0xe815('0x33'),'required':![]});db['User'][_0xe815('0x115')](db[_0xe815('0x59')],{'as':'SmsQueues','through':_0xe815('0x35'),'required':![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x5e')],{'as':_0xe815('0x12b'),'through':_0xe815('0x37'),'required':![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0xf9')],{'as':'WhatsappQueues','through':_0xe815('0x39'),'required':![]});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x119')],{'through':_0xe815('0x11b')});db[_0xe815('0x100')]['belongsToMany'](db[_0xe815('0x5f')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0xe815('0x100')][_0xe815('0x115')](db['FaxAccount'],{'as':_0xe815('0x12c'),'through':'user_has_fax_accounts'});db[_0xe815('0x100')]['belongsToMany'](db[_0xe815('0x3e')],{'as':_0xe815('0x12d'),'through':_0xe815('0x12e')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0xe815('0x12f'),'through':_0xe815('0x130')});db[_0xe815('0x100')][_0xe815('0x115')](db['SmsAccount'],{'as':_0xe815('0x131'),'through':_0xe815('0x132')});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0x133')],{'as':_0xe815('0x134'),'through':'user_has_whatsapp_accounts'});db[_0xe815('0x100')][_0xe815('0x115')](db[_0xe815('0xd6')],{'as':_0xe815('0x135'),'through':_0xe815('0x136')});db[_0xe815('0x14')]['hasMany'](db[_0xe815('0x107')],{'as':'SpiedAgents','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x137')});db['VoiceContext'][_0xe815('0x104')](db[_0xe815('0x107')],{'onDelete':_0xe815('0x102')});db[_0xe815('0x107')][_0xe815('0x104')](db[_0xe815('0x107')],{'as':_0xe815('0x138'),'onDelete':_0xe815('0x102')});db[_0xe815('0x18')][_0xe815('0x115')](db[_0xe815('0x82')],{'as':_0xe815('0x139'),'through':'moh_has_sounds'});db[_0xe815('0x123')][_0xe815('0x104')](db[_0xe815('0x2c')],{'as':_0xe815('0x13a'),'foreignKey':_0xe815('0x13b')});db[_0xe815('0x123')]['hasMany'](db[_0xe815('0x13c')],{'as':_0xe815('0x13d'),'foreignKey':_0xe815('0x13b')});db[_0xe815('0x123')][_0xe815('0x104')](db['CmHopperFinal'],{'as':_0xe815('0x109'),'foreignKey':_0xe815('0x13b')});db[_0xe815('0x123')][_0xe815('0x104')](db[_0xe815('0x70')],{'as':_0xe815('0x13e'),'foreignKey':_0xe815('0x13b')});db['VoiceQueue'][_0xe815('0x104')](db['ReportAgentPreview'],{'as':_0xe815('0x72'),'foreignKey':_0xe815('0x13b')});db[_0xe815('0x123')]['hasMany'](db['CmHopperBlack'],{'as':_0xe815('0x13f'),'foreignKey':_0xe815('0x13b')});db['VoiceQueue'][_0xe815('0x104')](db[_0xe815('0xcd')],{'as':_0xe815('0x140'),'foreignKey':'VoiceQueueId'});db[_0xe815('0x123')][_0xe815('0x141')](db[_0xe815('0x28')],{'as':_0xe815('0x28'),'foreignKey':_0xe815('0x142')});db[_0xe815('0x123')][_0xe815('0x141')](db[_0xe815('0x28')],{'as':_0xe815('0x143'),'foreignKey':_0xe815('0x144')});db[_0xe815('0x123')][_0xe815('0x141')](db[_0xe815('0x7b')],{'as':_0xe815('0x7b'),'foreignKey':_0xe815('0x145')});db[_0xe815('0x123')][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':_0xe815('0x146'),'foreignKey':_0xe815('0x147')});db[_0xe815('0x123')][_0xe815('0x115')](db[_0xe815('0x119')],{'as':_0xe815('0x11a'),'through':_0xe815('0x148')});db['VoiceQueue']['belongsToMany'](db[_0xe815('0x100')],{'as':'Agents','through':_0xe815('0x125')});db['VoiceQueue'][_0xe815('0x115')](db['Team'],{'as':_0xe815('0x149'),'through':_0xe815('0xfc')});db[_0xe815('0x123')][_0xe815('0x115')](db[_0xe815('0x119')],{'as':_0xe815('0x14a'),'through':_0xe815('0x14b')});db[_0xe815('0x105')][_0xe815('0x141')](db['User'],{'as':_0xe815('0x100'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x1c')][_0xe815('0x141')](db['User'],{'as':_0xe815('0x100'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x1d')][_0xe815('0x104')](db[_0xe815('0x1f')],{'as':_0xe815('0x14c'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x14d'),'sourceKey':'mailbox'});db[_0xe815('0x1f')][_0xe815('0x141')](db[_0xe815('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0xe815('0x14e')});db[_0xe815('0x20')]['hasMany'](db[_0xe815('0x26')],{'as':'QueueCalls','foreignKey':_0xe815('0x14f'),'constraints':![]});db[_0xe815('0x20')]['hasMany'](db[_0xe815('0x24')],{'as':'AgentReports','foreignKey':_0xe815('0x14f'),'constraints':![]});db['VoiceCallReport'][_0xe815('0x141')](db['User'],{'as':'User','foreignKey':_0xe815('0x103')});db[_0xe815('0x20')][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x3b')][_0xe815('0x141')](db[_0xe815('0x3e')],{'as':'MailAccount','foreignKey':_0xe815('0x152')});db[_0xe815('0x153')]['belongsTo'](db[_0xe815('0x3e')],{'as':'MailAccount','foreignKey':_0xe815('0x152')});db[_0xe815('0x3e')][_0xe815('0x101')](db[_0xe815('0x3b')],{'as':_0xe815('0x154'),'onDelete':'cascade'});db[_0xe815('0x3e')]['hasOne'](db[_0xe815('0x153')],{'as':_0xe815('0x155'),'onDelete':_0xe815('0x102')});db['MailAccount'][_0xe815('0x104')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe815('0x152'),'onDelete':'cascade'});db[_0xe815('0x3e')][_0xe815('0x104')](db[_0xe815('0x156')],{'as':_0xe815('0x157'),'foreignKey':'MailAccountId'});db[_0xe815('0x3e')][_0xe815('0x104')](db[_0xe815('0x42')],{'as':_0xe815('0x14c'),'foreignKey':'MailAccountId'});db[_0xe815('0x3e')][_0xe815('0x104')](db['MailInteraction'],{'as':_0xe815('0x158')});db[_0xe815('0x3e')][_0xe815('0x104')](db[_0xe815('0x43')],{'as':_0xe815('0x138')});db[_0xe815('0x3e')]['belongsTo'](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x3e')][_0xe815('0x141')](db[_0xe815('0x86')],{'as':_0xe815('0x86'),'foreignKey':_0xe815('0x15b')});db[_0xe815('0x3e')][_0xe815('0x141')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe815('0x147')});db['MailAccount']['belongsToMany'](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x12e')});db[_0xe815('0x127')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x31')});db[_0xe815('0x127')]['belongsToMany'](db[_0xe815('0x15d')],{'through':_0xe815('0x15e'),'as':_0xe815('0x149')});db[_0xe815('0x40')][_0xe815('0x104')](db[_0xe815('0x42')],{'as':_0xe815('0x14c'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x15f')});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x152')});db[_0xe815('0x40')][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':'ContactId'});db[_0xe815('0x40')]['belongsTo'](db['User'],{'as':_0xe815('0x161'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x40')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x162'),'as':_0xe815('0x163')});db['MailInteraction'][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x162'),'as':_0xe815('0x164')});db['MailInteraction']['belongsToMany'](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':_0xe815('0x11d'),'foreignKey':_0xe815('0x15f')});db['MailMessage'][_0xe815('0x104')](db['Attachment'],{'as':_0xe815('0x166'),'onDelete':_0xe815('0x102')});db[_0xe815('0x42')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x100')});db[_0xe815('0x42')][_0xe815('0x141')](db[_0xe815('0x6b')],{'onDelete':_0xe815('0x102'),'as':_0xe815('0x150')});db[_0xe815('0x42')][_0xe815('0x141')](db['MailInteraction'],{'as':_0xe815('0x167'),'foreignKey':_0xe815('0x15f')});db[_0xe815('0x42')][_0xe815('0x141')](db[_0xe815('0x3e')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xe815('0x42')][_0xe815('0x141')](db[_0xe815('0x5f')],{'as':_0xe815('0x5f'),'foreignKey':_0xe815('0x168')});db[_0xe815('0x42')]['belongsTo'](db[_0xe815('0x169')],{'as':'ChatOfflineMessage','foreignKey':_0xe815('0x16a')});db[_0xe815('0x43')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x43')][_0xe815('0x141')](db[_0xe815('0x127')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x43')][_0xe815('0x141')](db[_0xe815('0x3e')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x43')][_0xe815('0x141')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xe815('0x145')});db[_0xe815('0x43')][_0xe815('0x141')](db['Tag'],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x16c')});db[_0xe815('0x45')][_0xe815('0x141')](db[_0xe815('0x3e')],{});db[_0xe815('0x45')]['belongsTo'](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x45')][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':'ContactId'});db[_0xe815('0x45')]['belongsTo'](db[_0xe815('0x40')],{});db['MailQueueReport'][_0xe815('0x141')](db[_0xe815('0x42')],{});db[_0xe815('0x45')][_0xe815('0x141')](db[_0xe815('0x100')],{});db[_0xe815('0x45')][_0xe815('0x141')](db['MailQueue'],{});db['Dashboard']['hasMany'](db[_0xe815('0x49')],{'as':'Items','onDelete':'cascade'});db[_0xe815('0x4a')]['hasMany'](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':_0xe815('0x16f'),'onDelete':_0xe815('0x102')});db[_0xe815('0x4a')][_0xe815('0x104')](db[_0xe815('0x156')],{'as':'Answers','foreignKey':_0xe815('0x16f')});db[_0xe815('0x4a')][_0xe815('0x104')](db[_0xe815('0x4e')],{'as':_0xe815('0x158')});db[_0xe815('0x4a')]['hasMany'](db[_0xe815('0x4c')],{'as':_0xe815('0x138')});db[_0xe815('0x4a')]['hasMany'](db[_0xe815('0x107')],{'as':_0xe815('0x170'),'onDelete':'cascade'});db[_0xe815('0x4a')][_0xe815('0x104')](db[_0xe815('0x4f')],{'as':_0xe815('0x14c')});db[_0xe815('0x4a')][_0xe815('0x141')](db[_0xe815('0x28')],{'as':_0xe815('0x28')});db[_0xe815('0x4a')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':'List','foreignKey':_0xe815('0x15a')});db['FaxAccount'][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':_0xe815('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount']['belongsToMany'](db[_0xe815('0x100')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xe815('0x4c')]['belongsTo'](db[_0xe815('0x100')],{'onDelete':'restrict'});db[_0xe815('0x4c')][_0xe815('0x141')](db[_0xe815('0x51')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x4c')][_0xe815('0x141')](db[_0xe815('0x4a')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x4c')]['belongsTo'](db[_0xe815('0x84')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x16c')});db[_0xe815('0x4e')][_0xe815('0x104')](db[_0xe815('0x4f')],{'as':'Messages','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x171')});db[_0xe815('0x4e')][_0xe815('0x141')](db[_0xe815('0x4a')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xe815('0x4e')][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x4e')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x161'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x4e')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x172'),'as':_0xe815('0x164')});db[_0xe815('0x4e')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':_0xe815('0x173'),'foreignKey':_0xe815('0x171')});db[_0xe815('0x4f')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':_0xe815('0x102'),'as':'User'});db['FaxMessage'][_0xe815('0x141')](db['FaxInteraction'],{'as':_0xe815('0x167'),'foreignKey':_0xe815('0x171')});db[_0xe815('0x4f')]['belongsTo'](db[_0xe815('0x6b')],{'onDelete':_0xe815('0x102'),'as':_0xe815('0x150')});db['FaxMessage'][_0xe815('0x141')](db[_0xe815('0x174')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xe815('0x4f')]['belongsTo'](db[_0xe815('0x4a')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x16f')});db['FaxQueue'][_0xe815('0x115')](db['User'],{'as':_0xe815('0x15c'),'through':_0xe815('0x33')});db[_0xe815('0x51')][_0xe815('0x115')](db['Team'],{'through':'team_has_fax_queues','as':_0xe815('0x149')});db['FaxQueueReport'][_0xe815('0x141')](db[_0xe815('0x4a')],{});db[_0xe815('0x175')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':'List','foreignKey':_0xe815('0x15a')});db['FaxQueueReport'][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x175')][_0xe815('0x141')](db[_0xe815('0x4e')],{});db['FaxQueueReport'][_0xe815('0x141')](db[_0xe815('0x4f')],{});db['FaxQueueReport'][_0xe815('0x141')](db[_0xe815('0x100')],{});db[_0xe815('0x175')][_0xe815('0x141')](db[_0xe815('0x51')],{});db[_0xe815('0x176')]['hasMany'](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':_0xe815('0x177'),'onDelete':_0xe815('0x102')});db[_0xe815('0x176')][_0xe815('0x104')](db[_0xe815('0x156')],{'as':'Answers','foreignKey':_0xe815('0x177')});db['SmsAccount'][_0xe815('0x104')](db['SmsMessage'],{'as':_0xe815('0x14c'),'foreignKey':_0xe815('0x177')});db[_0xe815('0x176')][_0xe815('0x104')](db[_0xe815('0x56')],{'as':'Interactions'});db[_0xe815('0x176')][_0xe815('0x104')](db[_0xe815('0x54')],{'as':_0xe815('0x138')});db[_0xe815('0x176')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':'ListId'});db['SmsAccount'][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':_0xe815('0x146'),'foreignKey':_0xe815('0x147')});db[_0xe815('0x176')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':'Agents','through':_0xe815('0x132')});db[_0xe815('0x54')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':'restrict'});db[_0xe815('0x54')]['belongsTo'](db[_0xe815('0x59')],{'onDelete':'restrict'});db[_0xe815('0x54')][_0xe815('0x141')](db['SmsAccount'],{'onDelete':_0xe815('0x16b')});db['SmsApplication'][_0xe815('0x141')](db[_0xe815('0x7b')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x145')});db['SmsApplication'][_0xe815('0x141')](db[_0xe815('0x84')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x16c')});db[_0xe815('0x56')][_0xe815('0x104')](db['SmsMessage'],{'as':_0xe815('0x14c'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x178')});db['SmsInteraction'][_0xe815('0x141')](db[_0xe815('0x176')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x177')});db[_0xe815('0x56')][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x56')][_0xe815('0x141')](db['User'],{'as':_0xe815('0x161'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x56')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x179'),'as':_0xe815('0x163')});db['SmsInteraction'][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x179'),'as':_0xe815('0x164')});db[_0xe815('0x56')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':_0xe815('0x120'),'foreignKey':'SmsInteractionId'});db[_0xe815('0x58')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x100')});db['SmsMessage'][_0xe815('0x141')](db['CmContact'],{'onDelete':_0xe815('0x102'),'as':_0xe815('0x150')});db['SmsMessage']['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0xe815('0x167'),'foreignKey':_0xe815('0x178')});db[_0xe815('0x58')][_0xe815('0x141')](db[_0xe815('0x176')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xe815('0x59')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x35'),'foreignKey':_0xe815('0x17a')});db['SmsQueue'][_0xe815('0x115')](db[_0xe815('0x15d')],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount'][_0xe815('0x104')](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':'OpenchannelAccountId','onDelete':_0xe815('0x102')});db['OpenchannelAccount'][_0xe815('0x104')](db['CannedAnswer'],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0xe815('0x5a')][_0xe815('0x104')](db[_0xe815('0x5d')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0xe815('0x5a')]['hasMany'](db['OpenchannelMessage'],{'as':_0xe815('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0xe815('0x5a')][_0xe815('0x104')](db[_0xe815('0x17b')],{'as':_0xe815('0x138'),'foreignKey':_0xe815('0x17c')});db[_0xe815('0x5a')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':'ListId'});db[_0xe815('0x5a')][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':'user_has_openchannel_accounts'});db[_0xe815('0x17b')]['belongsTo'](db[_0xe815('0x100')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0x17b')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x17d')});db[_0xe815('0x17b')][_0xe815('0x141')](db['OpenchannelAccount'],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x17c')});db[_0xe815('0x17b')][_0xe815('0x141')](db[_0xe815('0x7b')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x145')});db[_0xe815('0x17b')][_0xe815('0x141')](db[_0xe815('0x84')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x16c')});db['OpenchannelInteraction']['hasMany'](db[_0xe815('0x17e')],{'as':'Messages','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x17f')});db[_0xe815('0x5d')][_0xe815('0x141')](db['OpenchannelAccount'],{'as':_0xe815('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0xe815('0x5d')]['belongsTo'](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x5d')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x161'),'foreignKey':_0xe815('0x103')});db['OpenchannelInteraction'][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x180'),'as':_0xe815('0x163')});db[_0xe815('0x5d')]['belongsToMany'](db[_0xe815('0x84')],{'through':_0xe815('0x180'),'as':_0xe815('0x164')});db[_0xe815('0x5d')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':'user_has_openchannel_interactions','foreignKey':_0xe815('0x17f')});db[_0xe815('0x17e')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':'cascade','as':_0xe815('0x100')});db['OpenchannelMessage'][_0xe815('0x141')](db[_0xe815('0x6b')],{'onDelete':'cascade','as':'Contact'});db[_0xe815('0x17e')][_0xe815('0x141')](db[_0xe815('0x5d')],{'onDelete':_0xe815('0x102'),'as':_0xe815('0x167'),'foreignKey':_0xe815('0x17f')});db[_0xe815('0x17e')][_0xe815('0x141')](db['Attachment'],{'as':_0xe815('0x174'),'foreignKey':_0xe815('0x181')});db[_0xe815('0x17e')]['belongsTo'](db[_0xe815('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xe815('0x5e')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x37'),'foreignKey':_0xe815('0x17d')});db['OpenchannelQueue'][_0xe815('0x115')](db[_0xe815('0x15d')],{'through':_0xe815('0x182'),'as':'Teams'});db[_0xe815('0x5f')]['hasMany'](db['Disposition'],{'as':_0xe815('0x16e'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xe815('0x5f')]['hasMany'](db['CannedAnswer'],{'as':_0xe815('0x157'),'foreignKey':_0xe815('0x168')});db['ChatWebsite'][_0xe815('0x104')](db[_0xe815('0x68')],{'as':_0xe815('0x183')});db[_0xe815('0x5f')]['hasMany'](db[_0xe815('0x11e')],{'as':_0xe815('0x158')});db[_0xe815('0x5f')][_0xe815('0x104')](db[_0xe815('0x184')],{'as':'Applications'});db['ChatWebsite'][_0xe815('0x104')](db[_0xe815('0x62')],{'as':_0xe815('0x14c')});db[_0xe815('0x5f')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':'ListId'});db[_0xe815('0x5f')][_0xe815('0x141')](db[_0xe815('0x7b')],{'as':_0xe815('0x7b'),'foreignKey':'IntervalId'});db[_0xe815('0x5f')][_0xe815('0x141')](db[_0xe815('0x3e')],{'as':'MailAccount','foreignKey':_0xe815('0x152')});db[_0xe815('0x5f')][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0xe815('0x147')});db[_0xe815('0x5f')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x185')});db[_0xe815('0x186')][_0xe815('0x141')](db[_0xe815('0x5a')],{});db[_0xe815('0x186')]['belongsTo'](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x186')]['belongsTo'](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':'ContactId'});db[_0xe815('0x186')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xe815('0x186')]['belongsTo'](db[_0xe815('0x17e')],{});db[_0xe815('0x186')][_0xe815('0x141')](db[_0xe815('0x100')],{});db['OpenchannelQueueReport'][_0xe815('0x141')](db[_0xe815('0x5e')],{});db[_0xe815('0x184')]['belongsTo'](db[_0xe815('0x100')],{'as':_0xe815('0x187'),'foreignKey':'UserId','onDelete':_0xe815('0x16b')});db[_0xe815('0x184')]['belongsTo'](db['ChatQueue'],{'as':_0xe815('0x188'),'foreignKey':_0xe815('0x189'),'onDelete':'restrict'});db['ChatApplication'][_0xe815('0x141')](db[_0xe815('0x5f')],{'as':_0xe815('0x18a'),'foreignKey':_0xe815('0x168'),'onDelete':_0xe815('0x16b')});db[_0xe815('0x184')][_0xe815('0x141')](db[_0xe815('0x84')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xe815('0x11e')][_0xe815('0x104')](db[_0xe815('0x62')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe815('0x18b')});db[_0xe815('0x11e')]['belongsTo'](db[_0xe815('0x5f')],{'as':'Account','foreignKey':_0xe815('0x168')});db['ChatInteraction'][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db['ChatInteraction'][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x161'),'foreignKey':'UserId'});db[_0xe815('0x11e')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x18c'),'as':_0xe815('0x163')});db[_0xe815('0x11e')]['belongsToMany'](db[_0xe815('0x84')],{'through':_0xe815('0x18c'),'as':_0xe815('0x164')});db[_0xe815('0x11e')][_0xe815('0x115')](db['User'],{'as':_0xe815('0x165'),'through':'user_has_chat_interactions','foreignKey':_0xe815('0x18b')});db['ChatMessage'][_0xe815('0x141')](db['User'],{'onDelete':_0xe815('0x102'),'as':'User'});db['ChatMessage']['belongsTo'](db[_0xe815('0x6b')],{'onDelete':'cascade','as':_0xe815('0x150'),'foreignKey':'ContactId'});db['ChatMessage'][_0xe815('0x141')](db[_0xe815('0x11e')],{'onDelete':_0xe815('0x102'),'as':_0xe815('0x167'),'foreignKey':_0xe815('0x18b')});db[_0xe815('0x62')][_0xe815('0x141')](db[_0xe815('0x174')],{'as':_0xe815('0x174'),'foreignKey':_0xe815('0x181')});db[_0xe815('0x62')][_0xe815('0x141')](db[_0xe815('0x5f')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x168')});db['ChatOfflineMessage'][_0xe815('0x104')](db[_0xe815('0x174')],{'as':_0xe815('0x166'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xe815('0x102'),'hooks':!![]});db[_0xe815('0x169')]['belongsTo'](db[_0xe815('0x6b')],{'onDelete':'cascade','as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x169')][_0xe815('0x141')](db[_0xe815('0x5f')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x168')});db[_0xe815('0x64')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':'UserChatQueue','hooks':!![]});db[_0xe815('0x64')][_0xe815('0x115')](db[_0xe815('0x15d')],{'through':_0xe815('0x18d'),'as':_0xe815('0x149')});db[_0xe815('0x66')]['hasMany'](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xe815('0x18e'),'onDelete':_0xe815('0x102')});db['ChatGroup'][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x13a'),'through':_0xe815('0x117')});db[_0xe815('0x68')][_0xe815('0x141')](db[_0xe815('0x5f')],{'as':_0xe815('0x18a'),'foreignKey':'ChatWebsiteId'});db[_0xe815('0x6a')]['hasMany'](db[_0xe815('0x6b')],{'as':_0xe815('0x118'),'foreignKey':'CompanyId'});db[_0xe815('0x6b')][_0xe815('0x104')](db[_0xe815('0x13c')],{'as':_0xe815('0x13d'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x6b')][_0xe815('0x104')](db[_0xe815('0x6f')],{'as':_0xe815('0x109'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x6b')]['hasMany'](db[_0xe815('0x70')],{'as':_0xe815('0x13e'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x6b')]['hasMany'](db[_0xe815('0x72')],{'as':_0xe815('0x72'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x6b')][_0xe815('0x104')](db[_0xe815('0xcd')],{'as':_0xe815('0x140'),'foreignKey':_0xe815('0x151')});db[_0xe815('0x6b')][_0xe815('0x104')](db[_0xe815('0x5d')],{'as':_0xe815('0x10b'),'foreignKey':_0xe815('0x151'),'onDelete':_0xe815('0x16b')});db[_0xe815('0x6b')]['hasMany'](db['ChatInteraction'],{'as':_0xe815('0x11f'),'foreignKey':'ContactId','onDelete':_0xe815('0x16b')});db['CmContact'][_0xe815('0x104')](db[_0xe815('0x56')],{'as':_0xe815('0x10c'),'foreignKey':'ContactId','onDelete':_0xe815('0x16b')});db[_0xe815('0x6b')]['hasMany'](db['FaxInteraction'],{'as':_0xe815('0x10d'),'foreignKey':'ContactId','onDelete':_0xe815('0x16b')});db['CmContact'][_0xe815('0x104')](db[_0xe815('0x40')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0xe815('0x141')](db[_0xe815('0x6a')],{'as':_0xe815('0x18f'),'foreignKey':_0xe815('0x190')});db[_0xe815('0x6b')]['belongsTo'](db['CmList'],{'as':_0xe815('0x159'),'foreignKey':_0xe815('0x15a'),'onDelete':_0xe815('0x102')});db[_0xe815('0x6b')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':_0xe815('0x191')});db[_0xe815('0x6b')][_0xe815('0x115')](db[_0xe815('0x84')],{'as':_0xe815('0x163'),'through':_0xe815('0x192')});db[_0xe815('0x6b')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x192'),'as':_0xe815('0x164')});db[_0xe815('0x13c')][_0xe815('0x141')](db['CmContact'],{'as':_0xe815('0x150'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':'ListId','onDelete':_0xe815('0x102')});db[_0xe815('0x13c')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x187'),'foreignKey':_0xe815('0x103')});db[_0xe815('0x13c')][_0xe815('0x141')](db[_0xe815('0x123')],{'as':_0xe815('0x188'),'foreignKey':_0xe815('0x13b'),'onDelete':_0xe815('0x102')});db['CmHopper'][_0xe815('0x141')](db['Campaign'],{'as':_0xe815('0x193'),'foreignKey':_0xe815('0x194'),'onDelete':'cascade'});db[_0xe815('0x13c')][_0xe815('0x141')](db[_0xe815('0x100')],{'as':_0xe815('0x161'),'foreignKey':_0xe815('0x195')});db[_0xe815('0x6e')][_0xe815('0x141')](db['CmContact'],{'as':_0xe815('0x150'),'foreignKey':'ContactId','onDelete':_0xe815('0x102')});db[_0xe815('0x6e')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':_0xe815('0x159'),'foreignKey':_0xe815('0x15a'),'onDelete':'cascade'});db[_0xe815('0x6e')][_0xe815('0x141')](db[_0xe815('0x123')],{'as':_0xe815('0x188'),'foreignKey':_0xe815('0x13b'),'onDelete':_0xe815('0x102')});db[_0xe815('0x6e')][_0xe815('0x141')](db[_0xe815('0x193')],{'as':_0xe815('0x193'),'foreignKey':_0xe815('0x194'),'onDelete':_0xe815('0x102')});db[_0xe815('0x77')][_0xe815('0x104')](db[_0xe815('0x196')],{'as':{'plural':_0xe815('0x197'),'singular':_0xe815('0x198')},'foreignKey':_0xe815('0x199'),'onDelete':_0xe815('0x102'),'hooks':!![]});db['Automation'][_0xe815('0x104')](db[_0xe815('0x196')],{'as':{'plural':_0xe815('0x19a'),'singular':_0xe815('0x19b')},'foreignKey':_0xe815('0x19c'),'onDelete':_0xe815('0x102'),'hooks':!![]});db['Automation'][_0xe815('0x104')](db[_0xe815('0x75')],{'as':_0xe815('0x19d'),'foreignKey':_0xe815('0x19e'),'onDelete':_0xe815('0x102'),'hooks':!![]});db[_0xe815('0x16d')][_0xe815('0x104')](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':_0xe815('0x19f'),'onDelete':_0xe815('0x102')});db[_0xe815('0x7b')]['hasMany'](db[_0xe815('0x7b')],{'as':_0xe815('0x1a0'),'foreignKey':_0xe815('0x145'),'onDelete':_0xe815('0x102'),'hooks':!![],'required':![]});db[_0xe815('0x7b')][_0xe815('0x104')](db[_0xe815('0x107')],{'as':_0xe815('0x108'),'foreignKey':_0xe815('0x145'),'onDelete':_0xe815('0x16b')});db[_0xe815('0x7b')][_0xe815('0x104')](db[_0xe815('0x43')],{'as':_0xe815('0x1a1'),'foreignKey':'IntervalId'});db[_0xe815('0x7b')][_0xe815('0x104')](db[_0xe815('0x184')],{'as':_0xe815('0x1a2'),'foreignKey':_0xe815('0x145')});db[_0xe815('0x7b')][_0xe815('0x104')](db[_0xe815('0x4c')],{'as':_0xe815('0x1a3'),'foreignKey':_0xe815('0x145')});db[_0xe815('0x7b')][_0xe815('0x104')](db[_0xe815('0x54')],{'as':'SmsApplications','foreignKey':_0xe815('0x145')});db[_0xe815('0x1a4')][_0xe815('0x141')](db[_0xe815('0x3e')],{});db[_0xe815('0x1a4')][_0xe815('0x141')](db[_0xe815('0x8e')],{'foreignKey':_0xe815('0x1a5')});db['Schedule'][_0xe815('0x141')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0xe815('0x82')][_0xe815('0x115')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xe815('0x1a6'),'onDelete':_0xe815('0x16b')});db[_0xe815('0x84')][_0xe815('0x115')](db[_0xe815('0x6b')],{'through':_0xe815('0x192')});db[_0xe815('0x84')][_0xe815('0x115')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xe815('0x84')][_0xe815('0x115')](db[_0xe815('0x40')],{'through':_0xe815('0x162')});db['Tag'][_0xe815('0x115')](db[_0xe815('0x56')],{'through':_0xe815('0x179')});db['Tag'][_0xe815('0x115')](db[_0xe815('0x4e')],{'through':'fax_interaction_has_tags'});db[_0xe815('0x84')][_0xe815('0x115')](db[_0xe815('0x5d')],{'through':'openchannel_interaction_has_tags'});db[_0xe815('0x84')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xe815('0x1a7')});db[_0xe815('0x1a8')][_0xe815('0x104')](db[_0xe815('0x196')],{'as':{'plural':_0xe815('0x1a9'),'singular':'AllCondition'},'foreignKey':_0xe815('0x1aa'),'onDelete':_0xe815('0x102'),'hooks':!![]});db[_0xe815('0x1a8')][_0xe815('0x104')](db['Condition'],{'as':{'plural':_0xe815('0x1ab'),'singular':'AnyCondition'},'foreignKey':_0xe815('0x1ac'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xe815('0x1ad'),'onDelete':_0xe815('0x102'),'hooks':!![]});db[_0xe815('0x8c')][_0xe815('0x104')](db[_0xe815('0x1ae')],{'as':'Fields','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1af'),'hooks':!![]});db[_0xe815('0x8e')][_0xe815('0x104')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xe815('0x102'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0xe815('0x1ae')],{'as':_0xe815('0x1b0'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b1')});db['AnalyticFieldReport'][_0xe815('0x141')](db[_0xe815('0x90')],{'foreignKey':'MetricId'});db[_0xe815('0x94')][_0xe815('0x104')](db['SalesforceConfiguration'],{'as':_0xe815('0x1b2'),'onDelete':_0xe815('0x102'),'foreignKey':'AccountId'});db[_0xe815('0x96')][_0xe815('0x104')](db[_0xe815('0x98')],{'as':_0xe815('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe815('0x96')][_0xe815('0x104')](db[_0xe815('0x98')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b5')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x96')][_0xe815('0x141')](db[_0xe815('0x94')],{'as':_0xe815('0x160'),'foreignKey':'AccountId'});db['SalesforceField'][_0xe815('0x104')](db[_0xe815('0x98')],{'as':_0xe815('0x1b7'),'foreignKey':'SubjectId'});db[_0xe815('0x98')]['hasMany'](db[_0xe815('0x98')],{'as':_0xe815('0x1b8'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x98')][_0xe815('0x104')](db[_0xe815('0x98')],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x98')]['belongsTo'](db[_0xe815('0x89')],{'as':'Variable','foreignKey':_0xe815('0x1ba')});db[_0xe815('0x9a')][_0xe815('0x104')](db[_0xe815('0x9c')],{'as':'Configurations','onDelete':_0xe815('0x102'),'foreignKey':'AccountId'});db[_0xe815('0x9c')][_0xe815('0x104')](db['SugarcrmField'],{'as':_0xe815('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe815('0x9c')][_0xe815('0x104')](db[_0xe815('0x1bb')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x9c')][_0xe815('0x104')](db[_0xe815('0x1bb')],{'as':_0xe815('0x1b0'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x9c')][_0xe815('0x141')](db['SugarcrmAccount'],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0x1bb')][_0xe815('0x104')](db[_0xe815('0x1bb')],{'as':_0xe815('0x1b7'),'foreignKey':'SubjectId'});db[_0xe815('0x1bb')][_0xe815('0x104')](db[_0xe815('0x1bb')],{'as':_0xe815('0x1b8'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x1bb')][_0xe815('0x104')](db[_0xe815('0x1bb')],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x1bb')][_0xe815('0x141')](db[_0xe815('0x89')],{'as':_0xe815('0x89'),'foreignKey':_0xe815('0x1ba')});db[_0xe815('0x9f')][_0xe815('0x104')](db['DeskConfiguration'],{'as':_0xe815('0x1b2'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0xa1')][_0xe815('0x104')](db[_0xe815('0xa3')],{'as':_0xe815('0x1b3'),'onDelete':'cascade','foreignKey':_0xe815('0x1bd')});db[_0xe815('0xa1')][_0xe815('0x104')](db[_0xe815('0xa3')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':'DescriptionId'});db[_0xe815('0xa1')][_0xe815('0x104')](db[_0xe815('0xa3')],{'as':_0xe815('0x1b0'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xa1')]['belongsTo'](db['DeskAccount'],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0xa1')]['belongsToMany'](db[_0xe815('0x84')],{'through':_0xe815('0x1be')});db['DeskField'][_0xe815('0x104')](db[_0xe815('0xa3')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xa3')][_0xe815('0x104')](db['DeskField'],{'as':_0xe815('0x1b8'),'foreignKey':_0xe815('0x1b5')});db['DeskField'][_0xe815('0x104')](db['DeskField'],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xa3')][_0xe815('0x141')](db['Variable'],{'as':_0xe815('0x89'),'foreignKey':'VariableId'});db[_0xe815('0xa5')]['hasMany'](db['ZohoConfiguration'],{'as':_0xe815('0x1b2'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0xa7')][_0xe815('0x104')](db[_0xe815('0xa9')],{'as':_0xe815('0x1b3'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xa7')][_0xe815('0x104')](db[_0xe815('0xa9')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0xa7')][_0xe815('0x104')](db[_0xe815('0xa9')],{'as':_0xe815('0x1b0'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xa7')][_0xe815('0x141')](db[_0xe815('0xa5')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1bc')});db['ZohoField'][_0xe815('0x104')](db[_0xe815('0xa9')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xa9')][_0xe815('0x104')](db['ZohoField'],{'as':_0xe815('0x1b8'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0xa9')]['hasMany'](db[_0xe815('0xa9')],{'as':'Field','foreignKey':_0xe815('0x1b6')});db['ZohoField']['belongsTo'](db[_0xe815('0x89')],{'as':'Variable','foreignKey':_0xe815('0x1ba')});db[_0xe815('0xab')]['hasMany'](db[_0xe815('0x1bf')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe815('0x1bc')});db[_0xe815('0x1bf')][_0xe815('0x104')](db[_0xe815('0xac')],{'as':_0xe815('0x1b3'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0x1bf')]['hasMany'](db[_0xe815('0xac')],{'as':_0xe815('0x1b4'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x1bf')]['hasMany'](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xe815('0x1bf')][_0xe815('0x141')](db[_0xe815('0xab')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xe815('0x115')](db[_0xe815('0x84')],{'through':'int_zendesk_configuration_has_tags'});db[_0xe815('0xac')]['hasMany'](db[_0xe815('0xac')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db['ZendeskField'][_0xe815('0x104')](db[_0xe815('0xac')],{'as':'Description','foreignKey':_0xe815('0x1b5')});db[_0xe815('0xac')]['hasMany'](db[_0xe815('0xac')],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xac')][_0xe815('0x141')](db[_0xe815('0x89')],{'as':_0xe815('0x89'),'foreignKey':'VariableId'});db[_0xe815('0x1c0')][_0xe815('0x104')](db[_0xe815('0xaf')],{'as':'Configurations','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0xaf')][_0xe815('0x104')](db[_0xe815('0x1c1')],{'as':_0xe815('0x1b3'),'onDelete':'cascade','foreignKey':_0xe815('0x1bd')});db['FreshdeskConfiguration'][_0xe815('0x104')](db[_0xe815('0x1c1')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0xaf')][_0xe815('0x104')](db[_0xe815('0x1c1')],{'as':_0xe815('0x1b0'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xaf')][_0xe815('0x141')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xe815('0x1bc')});db[_0xe815('0xaf')][_0xe815('0x115')](db['Tag'],{'through':_0xe815('0x1c2')});db[_0xe815('0x1c1')][_0xe815('0x104')](db[_0xe815('0x1c1')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0x1c1')][_0xe815('0x104')](db[_0xe815('0x1c1')],{'as':_0xe815('0x1b8'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x1c1')][_0xe815('0x104')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xe815('0x1b6')});db[_0xe815('0x1c1')][_0xe815('0x141')](db[_0xe815('0x89')],{'as':_0xe815('0x89'),'foreignKey':'VariableId'});db[_0xe815('0xb2')][_0xe815('0x104')](db['VtigerConfiguration'],{'as':_0xe815('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe815('0xb4')][_0xe815('0x104')](db[_0xe815('0xb6')],{'as':'Subjects','foreignKey':_0xe815('0x1bd')});db[_0xe815('0xb4')][_0xe815('0x104')](db[_0xe815('0xb6')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xe815('0x104')](db[_0xe815('0xb6')],{'as':_0xe815('0x1b0'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xb4')][_0xe815('0x141')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xe815('0x1bc')});db[_0xe815('0xb6')]['hasMany'](db[_0xe815('0xb6')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xb6')][_0xe815('0x104')](db['VtigerField'],{'as':_0xe815('0x1b8'),'foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db['VtigerField'][_0xe815('0x141')](db[_0xe815('0x89')],{'as':'Variable','foreignKey':'VariableId'});db[_0xe815('0xb8')][_0xe815('0x104')](db[_0xe815('0x1c3')],{'as':_0xe815('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe815('0x1c3')][_0xe815('0x104')](db['ServicenowField'],{'as':_0xe815('0x1b3'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0x1c3')][_0xe815('0x104')](db[_0xe815('0xbb')],{'as':_0xe815('0x1b4'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xe815('0x104')](db['ServicenowField'],{'as':'Fields','foreignKey':_0xe815('0x1b6')});db[_0xe815('0x1c3')]['belongsTo'](db[_0xe815('0xb8')],{'as':_0xe815('0x160'),'foreignKey':'AccountId'});db[_0xe815('0xbb')][_0xe815('0x104')](db[_0xe815('0xbb')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xbb')][_0xe815('0x104')](db[_0xe815('0xbb')],{'as':_0xe815('0x1b8'),'foreignKey':'DescriptionId'});db[_0xe815('0xbb')][_0xe815('0x104')](db[_0xe815('0xbb')],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0xbb')]['belongsTo'](db[_0xe815('0x89')],{'as':_0xe815('0x89'),'foreignKey':'VariableId'});db[_0xe815('0xbd')]['hasMany'](db[_0xe815('0xbf')],{'as':'Configurations','onDelete':_0xe815('0x102'),'foreignKey':'AccountId'});db[_0xe815('0xbf')][_0xe815('0x104')](db[_0xe815('0xc1')],{'as':'Subjects','onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bd')});db['Dynamics365Configuration'][_0xe815('0x104')](db[_0xe815('0xc1')],{'as':_0xe815('0x1b4'),'onDelete':_0xe815('0x102'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0xe815('0x104')](db[_0xe815('0xc1')],{'as':_0xe815('0x1b0'),'onDelete':'cascade','foreignKey':_0xe815('0x1b6')});db[_0xe815('0xbf')][_0xe815('0x141')](db['Dynamics365Account'],{'as':_0xe815('0x160'),'foreignKey':'AccountId'});db[_0xe815('0xc1')]['hasMany'](db[_0xe815('0xc1')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0xc1')][_0xe815('0x104')](db['Dynamics365Field'],{'as':_0xe815('0x1b8'),'foreignKey':'DescriptionId'});db[_0xe815('0xc1')]['hasMany'](db[_0xe815('0xc1')],{'as':'Field','foreignKey':_0xe815('0x1b6')});db[_0xe815('0xc1')][_0xe815('0x141')](db[_0xe815('0x89')],{'as':'Variable','foreignKey':'VariableId'});db[_0xe815('0xc3')][_0xe815('0x104')](db[_0xe815('0x1c4')],{'as':_0xe815('0x1b2'),'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1bc')});db['FreshsalesConfiguration'][_0xe815('0x104')](db[_0xe815('0x1c5')],{'as':'Subjects','foreignKey':_0xe815('0x1bd')});db[_0xe815('0x1c4')]['hasMany'](db['FreshsalesField'],{'as':_0xe815('0x1b4'),'foreignKey':_0xe815('0x1b5')});db[_0xe815('0x1c4')][_0xe815('0x104')](db[_0xe815('0x1c5')],{'as':_0xe815('0x1b0'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x1c4')]['belongsTo'](db[_0xe815('0xc3')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1bc')});db[_0xe815('0x1c5')]['hasMany'](db[_0xe815('0x1c5')],{'as':_0xe815('0x1b7'),'foreignKey':_0xe815('0x1bd')});db[_0xe815('0x1c5')]['hasMany'](db[_0xe815('0x1c5')],{'as':_0xe815('0x1b8'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0xe815('0x104')](db[_0xe815('0x1c5')],{'as':_0xe815('0x1b9'),'foreignKey':_0xe815('0x1b6')});db[_0xe815('0x1c5')][_0xe815('0x141')](db[_0xe815('0x89')],{'as':_0xe815('0x89'),'foreignKey':_0xe815('0x1ba')});db[_0xe815('0xc9')][_0xe815('0x141')](db['ChatWebsite'],{});db['ChatQueueReport'][_0xe815('0x141')](db['CmList'],{'as':'List','foreignKey':_0xe815('0x15a')});db['ChatQueueReport'][_0xe815('0x141')](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0xc9')][_0xe815('0x141')](db[_0xe815('0x11e')],{});db['ChatQueueReport'][_0xe815('0x141')](db[_0xe815('0x62')],{});db[_0xe815('0xc9')]['belongsTo'](db[_0xe815('0x100')],{});db[_0xe815('0xc9')][_0xe815('0x141')](db[_0xe815('0x64')],{});db[_0xe815('0x1c6')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':_0xe815('0x102'),'foreignKey':'FromId'});db[_0xe815('0x1c6')][_0xe815('0x141')](db[_0xe815('0x100')],{'onDelete':_0xe815('0x102'),'foreignKey':_0xe815('0x1c7')});db[_0xe815('0xcd')][_0xe815('0x104')](db[_0xe815('0xcc')],{'foreignKey':_0xe815('0x1c8'),'onDelete':_0xe815('0x102')});db[_0xe815('0xcd')][_0xe815('0x104')](db[_0xe815('0x1c9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xe815('0xcf')][_0xe815('0x141')](db[_0xe815('0x176')],{});db[_0xe815('0xcf')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':'List','foreignKey':_0xe815('0x15a')});db[_0xe815('0xcf')][_0xe815('0x141')](db['CmContact'],{'as':'Contact','foreignKey':_0xe815('0x151')});db[_0xe815('0xcf')][_0xe815('0x141')](db['SmsInteraction'],{});db[_0xe815('0xcf')]['belongsTo'](db['SmsMessage'],{});db[_0xe815('0xcf')][_0xe815('0x141')](db[_0xe815('0x100')],{});db['SmsQueueReport'][_0xe815('0x141')](db[_0xe815('0x59')],{});db[_0xe815('0xd4')]['hasMany'](db[_0xe815('0xcd')],{'foreignKey':_0xe815('0x1ca')});db[_0xe815('0xd4')][_0xe815('0x104')](db[_0xe815('0xcc')],{'foreignKey':_0xe815('0x1ca')});db[_0xe815('0xd4')][_0xe815('0x104')](db[_0xe815('0x1c9')],{'foreignKey':_0xe815('0x1ca')});db[_0xe815('0xd6')][_0xe815('0x115')](db['User'],{'as':_0xe815('0x165'),'through':_0xe815('0x136')});db[_0xe815('0x15d')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xe815('0x11c')});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x123')],{'through':'TeamVoiceQueue','as':_0xe815('0x124')});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x127')],{'through':_0xe815('0x15e'),'as':'MailQueues'});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x64')],{'through':'team_has_chat_queues','as':_0xe815('0x129')});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x51')],{'through':_0xe815('0x1cb'),'as':_0xe815('0x12a')});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x59')],{'through':'team_has_sms_queues','as':_0xe815('0x1cc')});db[_0xe815('0x15d')][_0xe815('0x115')](db[_0xe815('0x5e')],{'through':'team_has_openchannel_queues','as':_0xe815('0x12b')});db[_0xe815('0x15d')]['belongsToMany'](db[_0xe815('0xf9')],{'through':_0xe815('0x1cd'),'as':_0xe815('0x1ce')});db[_0xe815('0x15d')]['belongsToMany'](db[_0xe815('0xec')],{'through':'TeamVoicePrefix','as':_0xe815('0x1cf')});db[_0xe815('0x193')]['hasMany'](db['CmHopper'],{'as':_0xe815('0x13d'),'foreignKey':_0xe815('0x194')});db['Campaign'][_0xe815('0x104')](db[_0xe815('0x6f')],{'as':_0xe815('0x109'),'foreignKey':_0xe815('0x194')});db[_0xe815('0x193')][_0xe815('0x104')](db[_0xe815('0x70')],{'as':_0xe815('0x13e'),'foreignKey':_0xe815('0x194')});db[_0xe815('0x193')][_0xe815('0x104')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xe815('0x194')});db['Campaign'][_0xe815('0x141')](db[_0xe815('0x28')],{'as':_0xe815('0x28'),'foreignKey':_0xe815('0x142')});db[_0xe815('0x193')][_0xe815('0x141')](db[_0xe815('0x28')],{'as':_0xe815('0x143'),'foreignKey':'TrunkBackupId'});db[_0xe815('0x193')][_0xe815('0x141')](db[_0xe815('0x7b')],{'as':_0xe815('0x7b'),'foreignKey':'IntervalId'});db[_0xe815('0x193')][_0xe815('0x141')](db[_0xe815('0xd6')],{'as':_0xe815('0xd6'),'foreignKey':_0xe815('0x1d0')});db[_0xe815('0x193')][_0xe815('0x115')](db[_0xe815('0x119')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xe815('0x193')][_0xe815('0x115')](db[_0xe815('0x119')],{'as':_0xe815('0x14a'),'through':'campaigns_has_cm_blacklists'});db[_0xe815('0x174')]['belongsTo'](db[_0xe815('0x169')],{'as':'ChatOfflineMessage','foreignKey':_0xe815('0x16a')});db[_0xe815('0xe2')][_0xe815('0x141')](db[_0xe815('0x42')],{});db[_0xe815('0xe2')][_0xe815('0x141')](db['MailInteraction'],{});db[_0xe815('0xe2')][_0xe815('0x141')](db[_0xe815('0x3e')],{'foreignKey':_0xe815('0x1d1'),'as':'FromAccount'});db[_0xe815('0xe2')][_0xe815('0x141')](db['User'],{'foreignKey':_0xe815('0x1d2'),'as':'FromAgent'});db[_0xe815('0xe2')][_0xe815('0x141')](db[_0xe815('0x100')],{'foreignKey':'ToUserId','as':_0xe815('0x1d3')});db[_0xe815('0xe2')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xe815('0x1d4'),'as':_0xe815('0x1d5')});db[_0xe815('0xe2')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xe815('0x1d6')});db[_0xe815('0x1d7')][_0xe815('0x141')](db['ChatMessage'],{});db[_0xe815('0x1d7')][_0xe815('0x141')](db['ChatInteraction'],{});db[_0xe815('0x1d7')][_0xe815('0x141')](db[_0xe815('0x5f')],{'foreignKey':_0xe815('0x1d8'),'as':_0xe815('0x1d9')});db[_0xe815('0x1d7')][_0xe815('0x141')](db[_0xe815('0x100')],{'foreignKey':_0xe815('0x1d2'),'as':'FromAgent'});db[_0xe815('0x1d7')][_0xe815('0x141')](db[_0xe815('0x100')],{'foreignKey':_0xe815('0x1da'),'as':'ToAgent'});db['ChatTransferReport'][_0xe815('0x141')](db[_0xe815('0x64')],{'foreignKey':_0xe815('0x1db'),'as':'ToQueue'});db[_0xe815('0x1d7')]['belongsTo'](db[_0xe815('0x5f')],{'foreignKey':_0xe815('0x1dc'),'as':_0xe815('0x1d6')});db['FaxTransferReport']['belongsTo'](db[_0xe815('0x4f')],{});db[_0xe815('0xe5')]['belongsTo'](db[_0xe815('0x4e')],{});db[_0xe815('0xe5')][_0xe815('0x141')](db[_0xe815('0x4a')],{'foreignKey':_0xe815('0x1dd'),'as':_0xe815('0x1d9')});db[_0xe815('0xe5')]['belongsTo'](db['User'],{'foreignKey':_0xe815('0x1d2'),'as':_0xe815('0x1de')});db[_0xe815('0xe5')][_0xe815('0x141')](db[_0xe815('0x100')],{'foreignKey':_0xe815('0x1da'),'as':_0xe815('0x1d3')});db[_0xe815('0xe5')][_0xe815('0x141')](db['FaxQueue'],{'foreignKey':_0xe815('0x1df'),'as':_0xe815('0x1d5')});db['FaxTransferReport']['belongsTo'](db[_0xe815('0x4a')],{'foreignKey':'ToFaxAccountId','as':_0xe815('0x1d6')});db[_0xe815('0xe7')][_0xe815('0x141')](db[_0xe815('0x17e')],{});db[_0xe815('0xe7')][_0xe815('0x141')](db[_0xe815('0x5d')],{});db[_0xe815('0xe7')][_0xe815('0x141')](db[_0xe815('0x5a')],{'foreignKey':'FromOpenchannelAccountId','as':_0xe815('0x1d9')});db[_0xe815('0xe7')]['belongsTo'](db['User'],{'foreignKey':_0xe815('0x1d2'),'as':_0xe815('0x1de')});db[_0xe815('0xe7')]['belongsTo'](db[_0xe815('0x100')],{'foreignKey':'ToUserId','as':_0xe815('0x1d3')});db['OpenchannelTransferReport'][_0xe815('0x141')](db[_0xe815('0x5e')],{'foreignKey':_0xe815('0x1e0'),'as':'ToQueue'});db[_0xe815('0xe7')]['belongsTo'](db[_0xe815('0x5a')],{'foreignKey':_0xe815('0x1e1'),'as':'ToAccount'});db[_0xe815('0xe9')][_0xe815('0x141')](db[_0xe815('0x58')],{});db[_0xe815('0xe9')][_0xe815('0x141')](db[_0xe815('0x56')],{});db['SmsTransferReport'][_0xe815('0x141')](db[_0xe815('0x176')],{'foreignKey':_0xe815('0x1e2'),'as':_0xe815('0x1d9')});db[_0xe815('0xe9')]['belongsTo'](db['User'],{'foreignKey':_0xe815('0x1d2'),'as':_0xe815('0x1de')});db[_0xe815('0xe9')]['belongsTo'](db[_0xe815('0x100')],{'foreignKey':'ToUserId','as':_0xe815('0x1d3')});db['SmsTransferReport'][_0xe815('0x141')](db[_0xe815('0x59')],{'foreignKey':_0xe815('0x1e3'),'as':_0xe815('0x1d5')});db['SmsTransferReport'][_0xe815('0x141')](db[_0xe815('0x176')],{'foreignKey':_0xe815('0x1e4'),'as':_0xe815('0x1d6')});db[_0xe815('0x119')][_0xe815('0x104')](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':_0xe815('0x15a'),'onDelete':_0xe815('0x102')});db['CmList'][_0xe815('0x104')](db['CmCustomField'],{'as':_0xe815('0x1e5'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x119')][_0xe815('0x104')](db['CmContact'],{'as':_0xe815('0x118'),'onDelete':'cascade','foreignKey':_0xe815('0x15a')});db[_0xe815('0x119')][_0xe815('0x104')](db[_0xe815('0x6f')],{'as':_0xe815('0x109'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x119')][_0xe815('0x104')](db[_0xe815('0x70')],{'as':_0xe815('0x10a'),'foreignKey':'ListId'});db[_0xe815('0x119')][_0xe815('0x104')](db[_0xe815('0x72')],{'as':_0xe815('0x72'),'foreignKey':_0xe815('0x15a')});db[_0xe815('0x119')]['belongsToMany'](db[_0xe815('0x123')],{'as':_0xe815('0x1e6'),'through':_0xe815('0x148')});db[_0xe815('0x119')]['belongsToMany'](db['User'],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0xe815('0x107')],{'as':_0xe815('0x108'),'onDelete':_0xe815('0x102')});db['VoicePrefix']['belongsToMany'](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x126')});db[_0xe815('0xec')]['belongsToMany'](db[_0xe815('0x15d')],{'through':_0xe815('0x1e7'),'as':_0xe815('0x149')});db['UserProfile']['hasMany'](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'foreignKey':_0xe815('0x114')});db[_0xe815('0x113')][_0xe815('0x104')](db[_0xe815('0x1e8')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xe815('0x102')});db[_0xe815('0x1e8')][_0xe815('0x104')](db[_0xe815('0xef')],{'as':_0xe815('0x1e9'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0xe815('0x133')]['hasMany'](db[_0xe815('0x16d')],{'as':_0xe815('0x16e'),'foreignKey':_0xe815('0x1ea'),'onDelete':_0xe815('0x102')});db[_0xe815('0x133')][_0xe815('0x104')](db[_0xe815('0x156')],{'as':_0xe815('0x157'),'foreignKey':_0xe815('0x1ea')});db[_0xe815('0x133')][_0xe815('0x104')](db[_0xe815('0x1eb')],{'as':_0xe815('0x14c'),'foreignKey':_0xe815('0x1ea')});db[_0xe815('0x133')][_0xe815('0x104')](db[_0xe815('0xf5')],{'as':_0xe815('0x158')});db[_0xe815('0x133')][_0xe815('0x104')](db['WhatsappApplication'],{'as':_0xe815('0x138')});db[_0xe815('0x133')][_0xe815('0x141')](db[_0xe815('0x119')],{'as':'List','foreignKey':'ListId'});db[_0xe815('0x133')][_0xe815('0x141')](db[_0xe815('0x7c')],{'as':_0xe815('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe815('0x133')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x15c'),'through':_0xe815('0x1ec')});db[_0xe815('0xf3')]['belongsTo'](db['User'],{'onDelete':_0xe815('0x16b')});db[_0xe815('0xf3')][_0xe815('0x141')](db['WhatsappQueue'],{'onDelete':_0xe815('0x16b')});db[_0xe815('0xf3')]['belongsTo'](db[_0xe815('0x133')],{'onDelete':_0xe815('0x16b')});db[_0xe815('0xf3')][_0xe815('0x141')](db['Interval'],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x145')});db[_0xe815('0xf3')][_0xe815('0x141')](db[_0xe815('0x84')],{'onDelete':_0xe815('0x16b'),'foreignKey':_0xe815('0x16c')});db[_0xe815('0xf5')]['hasMany'](db[_0xe815('0x1eb')],{'as':'Messages','onDelete':_0xe815('0x102'),'foreignKey':'WhatsappInteractionId'});db[_0xe815('0xf5')][_0xe815('0x141')](db[_0xe815('0x133')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1ea')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db['WhatsappInteraction'][_0xe815('0x141')](db[_0xe815('0x100')],{'as':'Owner','foreignKey':'UserId'});db[_0xe815('0xf5')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x1a7'),'as':_0xe815('0x163')});db[_0xe815('0xf5')][_0xe815('0x115')](db[_0xe815('0x84')],{'through':_0xe815('0x1a7'),'as':_0xe815('0x164')});db[_0xe815('0xf5')][_0xe815('0x115')](db[_0xe815('0x100')],{'as':_0xe815('0x165'),'through':'user_has_whatsapp_interactions','foreignKey':_0xe815('0x1ed')});db[_0xe815('0x1eb')]['belongsTo'](db[_0xe815('0x100')],{'as':'User'});db[_0xe815('0x1eb')][_0xe815('0x141')](db[_0xe815('0x6b')],{'onDelete':'cascade','as':_0xe815('0x150')});db['WhatsappMessage']['belongsTo'](db[_0xe815('0xf5')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xe815('0x1ed')});db[_0xe815('0x1eb')]['belongsTo'](db[_0xe815('0x133')],{'as':_0xe815('0x160'),'foreignKey':_0xe815('0x1ea')});db[_0xe815('0xf7')]['belongsTo'](db[_0xe815('0x133')],{});db[_0xe815('0xf7')]['belongsTo'](db['CmList'],{'as':_0xe815('0x159'),'foreignKey':'ListId'});db[_0xe815('0xf7')]['belongsTo'](db[_0xe815('0x6b')],{'as':_0xe815('0x150'),'foreignKey':_0xe815('0x151')});db[_0xe815('0xf7')]['belongsTo'](db[_0xe815('0xf5')],{});db[_0xe815('0xf7')][_0xe815('0x141')](db[_0xe815('0xf9')],{});db[_0xe815('0xf7')][_0xe815('0x141')](db[_0xe815('0x1eb')],{});db[_0xe815('0xf7')][_0xe815('0x141')](db['User'],{});db[_0xe815('0x1ee')][_0xe815('0x141')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xe815('0x141')](db[_0xe815('0xf5')],{});db[_0xe815('0x1ee')][_0xe815('0x141')](db['WhatsappAccount'],{'foreignKey':_0xe815('0x1ef'),'as':_0xe815('0x1d9')});db[_0xe815('0x1ee')][_0xe815('0x141')](db[_0xe815('0x133')],{'foreignKey':_0xe815('0x1f0'),'as':'ToAccount'});db[_0xe815('0x1ee')][_0xe815('0x141')](db[_0xe815('0xf9')],{'foreignKey':'ToQueueId','as':_0xe815('0x1d5')});db[_0xe815('0x1ee')]['belongsTo'](db[_0xe815('0x100')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe815('0x1ee')][_0xe815('0x141')](db[_0xe815('0x100')],{'foreignKey':_0xe815('0x1da'),'as':_0xe815('0x1d3')});db[_0xe815('0xf9')][_0xe815('0x115')](db['User'],{'as':_0xe815('0x15c'),'through':'UserWhatsappQueue','foreignKey':_0xe815('0x1f1')});db[_0xe815('0xf9')]['belongsToMany'](db[_0xe815('0x15d')],{'through':_0xe815('0x1cd'),'as':_0xe815('0x149')});module[_0xe815('0x1f2')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x0acf=['../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','ChatGroup','belongsToMany','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','CmHopper','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','ContactId','MailAccountId','Smtp','Dispositions','Interactions','MailApplication','List','TemplateId','MailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','ListId','Items','FaxAccountId','Applications','user_has_fax_accounts','Contact','FaxInteractionId','FaxMessage','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','ChatApplication','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','Company','CompanyId','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Queue','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','SugarcrmField','Descriptions','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesAccount','ToId','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','VoiceQueues','team_has_whatsapp_queues','TrunkBackup','TrunkBackupId','SquareProjectId','MailTransferReport','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ChatTransferReport','FromChatWebsiteId','ToUserId','ToAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','cm_user_has_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','sequelize','lodash','jstz','motion2','xcall','127.0.0.1','utf8mb4','name','utf8_general_ci','defaultsDeep','sequelizeHistory','xC@LL1234','mysql','utf8','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport'];(function(_0x12c973,_0x2fcf0b){var _0x5d78d5=function(_0x4bf20d){while(--_0x4bf20d){_0x12c973['push'](_0x12c973['shift']());}};_0x5d78d5(++_0x2fcf0b);}(_0x0acf,0x15d));var _0xf0ac=function(_0x769935,_0x2311a5){_0x769935=_0x769935-0x0;var _0x24f62e=_0x0acf[_0x769935];return _0x24f62e;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf0ac('0x0'));var _=require(_0xf0ac('0x1'));var jstz=require(_0xf0ac('0x2'));var timezone=jstz['determine']();config[_0xf0ac('0x0')]=_['defaultsDeep'](config[_0xf0ac('0x0')],{'database':_0xf0ac('0x3'),'username':_0xf0ac('0x4'),'password':'xC@LL1234','options':{'host':_0xf0ac('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf0ac('0x6')},'logging':![],'timezone':timezone[_0xf0ac('0x7')](),'define':{'charset':'utf8','collate':_0xf0ac('0x8')}}});config['sequelizeHistory']=_[_0xf0ac('0x9')](config[_0xf0ac('0xa')],{'database':_0xf0ac('0x3'),'username':_0xf0ac('0x4'),'password':_0xf0ac('0xb'),'options':{'host':_0xf0ac('0x5'),'port':0xcea,'dialect':_0xf0ac('0xc'),'dialectOptions':{'charset':_0xf0ac('0x6')},'logging':![],'timezone':timezone[_0xf0ac('0x7')](),'define':{'charset':_0xf0ac('0xd'),'collate':_0xf0ac('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ac('0x0')][_0xf0ac('0xe')],config[_0xf0ac('0x0')][_0xf0ac('0xf')],config[_0xf0ac('0x0')][_0xf0ac('0x10')],config[_0xf0ac('0x0')][_0xf0ac('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xf0ac('0xe')],config['sequelizeHistory'][_0xf0ac('0xf')],config[_0xf0ac('0xa')][_0xf0ac('0x10')],config[_0xf0ac('0xa')]['options'])};db['User']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x12'));db[_0xf0ac('0x13')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceContext/voiceContext.model');db[_0xf0ac('0x15')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x16'));db[_0xf0ac('0x17')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x18'));db[_0xf0ac('0x19')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x1a'));db[_0xf0ac('0x1b')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x1c'));db[_0xf0ac('0x1d')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x1e'));db['VoiceMail']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x1f'));db[_0xf0ac('0x20')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x21'));db[_0xf0ac('0x22')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x23'));db[_0xf0ac('0x24')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x25'));db[_0xf0ac('0x26')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x27'));db['VoiceQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xf0ac('0x28')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x29'));db[_0xf0ac('0x2a')]=db['sequelize'][_0xf0ac('0x14')]('../api/trunk/trunk.model');db[_0xf0ac('0x2b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xf0ac('0x2c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x2d'));db[_0xf0ac('0x2e')]=db[_0xf0ac('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf0ac('0x2f')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x30'));db[_0xf0ac('0x31')]=db['sequelize'][_0xf0ac('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0xf0ac('0x32')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x33'));db[_0xf0ac('0x34')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x35'));db[_0xf0ac('0x36')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x37'));db[_0xf0ac('0x38')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x39'));db[_0xf0ac('0x3a')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xf0ac('0x3b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailServerOut/mailServerOut.model');db[_0xf0ac('0x3c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x3d'));db['MailQueue']=db['sequelize']['import'](_0xf0ac('0x3e'));db[_0xf0ac('0x3f')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x40'));db[_0xf0ac('0x41')]=db['sequelize'][_0xf0ac('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0xf0ac('0x42')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0xf0ac('0x14')]('../api/mailApplication/mailApplication.model');db[_0xf0ac('0x43')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x44'));db[_0xf0ac('0x45')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x46'));db[_0xf0ac('0x47')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x48'));db[_0xf0ac('0x49')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x4a'));db[_0xf0ac('0x4b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x4c'));db['FaxInteraction']=db[_0xf0ac('0x0')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize']['import'](_0xf0ac('0x4d'));db[_0xf0ac('0x4e')]=db['sequelize']['import'](_0xf0ac('0x4f'));db[_0xf0ac('0x50')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xf0ac('0x51')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x52'));db[_0xf0ac('0x53')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x54'));db[_0xf0ac('0x55')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x56'));db[_0xf0ac('0x57')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x58'));db['SmsQueue']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x59'));db['OpenchannelAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5a'));db['OpenchannelApplication']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5b'));db['OpenchannelInteraction']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x5c'));db[_0xf0ac('0x5d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf0ac('0x5e')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5f'));db['OpenchannelQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x60'));db['ChatApplication']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x61'));db[_0xf0ac('0x62')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x63'));db[_0xf0ac('0x64')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x65'));db['ChatOfflineMessage']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x66'));db[_0xf0ac('0x67')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x68'));db['ChatGroup']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x69'));db[_0xf0ac('0x6a')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x6b'));db[_0xf0ac('0x6c')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x6d'));db['CmHopper']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x6e'));db[_0xf0ac('0x6f')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x70'));db[_0xf0ac('0x71')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x72'));db[_0xf0ac('0x73')]=db['sequelize'][_0xf0ac('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xf0ac('0x74')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x75'));db[_0xf0ac('0x76')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x77'));db[_0xf0ac('0x78')]=db['sequelize']['import'](_0xf0ac('0x79'));db['Automation']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/automation/automation.model');db[_0xf0ac('0x7a')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x7b'));db[_0xf0ac('0x7c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x7d'));db[_0xf0ac('0x7e')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x7f'));db[_0xf0ac('0x80')]=db['sequelize']['import'](_0xf0ac('0x81'));db[_0xf0ac('0x82')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x83'));db['Cdr']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x84'));db['VoiceQueuesLog']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x85'));db[_0xf0ac('0x86')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x87'));db[_0xf0ac('0x88')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x89'));db['Tag']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x8a'));db[_0xf0ac('0x8b')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x8c'));db[_0xf0ac('0x8d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x8e'));db['Variable']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x8f'));db[_0xf0ac('0x90')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x91'));db[_0xf0ac('0x92')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x93'));db['AnalyticCustomReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x94'));db[_0xf0ac('0x95')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x96'));db[_0xf0ac('0x97')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x98'));db[_0xf0ac('0x99')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x9a'));db[_0xf0ac('0x9b')]=db['sequelize']['import'](_0xf0ac('0x9c'));db[_0xf0ac('0x9d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x9e'));db[_0xf0ac('0x9f')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa0'));db['SalesforceConfiguration']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa1'));db[_0xf0ac('0xa2')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xa3'));db[_0xf0ac('0xa4')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xa5'));db[_0xf0ac('0xa6')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa7'));db['SugarcrmField']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa8'));db[_0xf0ac('0xa9')]=db['sequelize'][_0xf0ac('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0xf0ac('0xaa')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xab'));db['DeskField']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xac'));db[_0xf0ac('0xad')]=db['sequelize'][_0xf0ac('0x14')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xf0ac('0xae')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xaf'));db['ZendeskConfiguration']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xb0'));db[_0xf0ac('0xb1')]=db['sequelize'][_0xf0ac('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ac('0xb2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xb3'));db[_0xf0ac('0xb4')]=db['sequelize'][_0xf0ac('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xf0ac('0xb5')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xb6'));db[_0xf0ac('0xb7')]=db['sequelize']['import'](_0xf0ac('0xb8'));db[_0xf0ac('0xb9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xba'));db[_0xf0ac('0xbb')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xbc'));db[_0xf0ac('0xbd')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xbe'));db[_0xf0ac('0xbf')]=db['sequelize'][_0xf0ac('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xf0ac('0xc0')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xc1'));db[_0xf0ac('0xc2')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xc3'));db[_0xf0ac('0xc4')]=db['sequelize'][_0xf0ac('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xf0ac('0xc5')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xc6'));db['FreshsalesAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xc7'));db[_0xf0ac('0xc8')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xc9'));db[_0xf0ac('0xca')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xcb'));db['Integration']=db[_0xf0ac('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xcc'));db[_0xf0ac('0xcd')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xce'));db[_0xf0ac('0xcf')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xd0'));db['JscriptyAnswerReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xf0ac('0xd1')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xf0ac('0xd2')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xd3'));db['SmsQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd4'));db[_0xf0ac('0xd5')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd6'));db[_0xf0ac('0xd7')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd8'));db[_0xf0ac('0xd9')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xda'));db[_0xf0ac('0xdb')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xdc'));db[_0xf0ac('0xdd')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xde'));db[_0xf0ac('0xdf')]=db['sequelize']['import'](_0xf0ac('0xe0'));db[_0xf0ac('0xe1')]=db[_0xf0ac('0x0')]['import']('../api/squareRecording/squareRecording.model');db[_0xf0ac('0xe2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/squareMessage/squareMessage.model');db[_0xf0ac('0xe3')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xe4'));db['License']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe5'));db['Campaign']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe6'));db[_0xf0ac('0xe7')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe8'));db[_0xf0ac('0xe9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/attachment/attachment.model');db[_0xf0ac('0xea')]=db[_0xf0ac('0x0')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xeb'));db[_0xf0ac('0xec')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xed'));db[_0xf0ac('0xee')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xef'));db[_0xf0ac('0xf0')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf1'));db[_0xf0ac('0xf2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/cmList/cmList.model');db[_0xf0ac('0xf3')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xf0ac('0xf4')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf5'));db[_0xf0ac('0xf6')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf7'));db[_0xf0ac('0xf8')]=db['sequelize'][_0xf0ac('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xf0ac('0xf9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappAccount/whatsappAccount.model');db[_0xf0ac('0xfa')]=db['sequelize']['import'](_0xf0ac('0xfb'));db[_0xf0ac('0xfc')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xfd'));db[_0xf0ac('0xfe')]=db['sequelize']['import'](_0xf0ac('0xff'));db['WhatsappQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xf0ac('0x100')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xf0ac('0x101')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x102'));db['CloudProvider']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x103'));db[_0xf0ac('0x104')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x105'));db[_0xf0ac('0x106')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x107'));db[_0xf0ac('0x108')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x109'));db[_0xf0ac('0x10a')][_0xf0ac('0x10b')](db['VoiceMail'],{'as':_0xf0ac('0x10c'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x10e')});db['User']['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xf0ac('0x10e')});db['User'][_0xf0ac('0x10f')](db['UserVoiceQueueRt'],{'as':_0xf0ac('0x110'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x10a')]['hasMany'](db[_0xf0ac('0x71')],{'as':'HopperFinals','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xf0ac('0x10a')]['hasMany'](db['ReportAgentPreview'],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x112'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['ChatInteraction'],{'as':_0xf0ac('0x113'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['SmsInteraction'],{'as':_0xf0ac('0x114'),'foreignKey':_0xf0ac('0x10e')});db['User'][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':'FaxInteractions','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x41')],{'as':'MailInteractions','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['WhatsappInteraction'],{'as':_0xf0ac('0x116'),'foreignKey':'UserId'});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['UserNotification'],{'as':_0xf0ac('0x117'),'foreignKey':_0xf0ac('0x118')});db['User'][_0xf0ac('0x119')](db[_0xf0ac('0xf4')],{'as':'UserProfile','foreignKey':_0xf0ac('0x11a')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x11b')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'through':_0xf0ac('0x11e')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x11f'),'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x120')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['MailInteraction'],{'as':_0xf0ac('0x121'),'through':_0xf0ac('0x122')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['ChatInteraction'],{'as':_0xf0ac('0x113'),'through':_0xf0ac('0x123')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x124'),'through':_0xf0ac('0x125')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x55')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x112'),'through':_0xf0ac('0x126')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0xfc')],{'as':_0xf0ac('0x116'),'through':_0xf0ac('0x127')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x19')],{'as':'VoiceQueues','through':_0xf0ac('0x2e'),'required':![]});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0xf3')],{'as':_0xf0ac('0x128'),'through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db['MailQueue'],{'as':_0xf0ac('0x129'),'through':'UserMailQueue','required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x67')],{'as':_0xf0ac('0x12a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x4e')],{'as':_0xf0ac('0x12b'),'through':'UserFaxQueue','required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x12c')],{'as':_0xf0ac('0x12d'),'through':_0xf0ac('0x34'),'required':![]});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x5d')],{'as':_0xf0ac('0x12e'),'through':_0xf0ac('0x36'),'required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['WhatsappQueue'],{'as':_0xf0ac('0x12f'),'through':_0xf0ac('0x38'),'required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xf0ac('0x11c')](db['ChatWebsite'],{'as':_0xf0ac('0x130'),'through':_0xf0ac('0x131')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x49')],{'as':_0xf0ac('0x132'),'through':'user_has_fax_accounts'});db['User']['belongsToMany'](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x133'),'through':_0xf0ac('0x134')});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0x135')],{'as':'OpenchannelAccounts','through':_0xf0ac('0x136')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x51')],{'as':_0xf0ac('0x137'),'through':_0xf0ac('0x138')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x13a'),'through':_0xf0ac('0x13b')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xdf')],{'as':_0xf0ac('0x13c'),'through':_0xf0ac('0x13d')});db[_0xf0ac('0x13')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':_0xf0ac('0x13e'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x13f')});db[_0xf0ac('0x140')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x15')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Applications','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x17')][_0xf0ac('0x11c')](db[_0xf0ac('0x88')],{'as':_0xf0ac('0x141'),'through':_0xf0ac('0x142')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x2c')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x143')],{'as':_0xf0ac('0x144'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db['CmHopperFinal'],{'as':_0xf0ac('0x146'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db['CmHopperHistory'],{'as':_0xf0ac('0x147'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x6f')],{'as':_0xf0ac('0x148'),'foreignKey':'VoiceQueueId'});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0xd2')],{'as':_0xf0ac('0x149'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':'Trunk','foreignKey':_0xf0ac('0x14a')});db[_0xf0ac('0x19')]['belongsTo'](db[_0xf0ac('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xf0ac('0x19')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['VoiceQueue'][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x19')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x2e')});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'as':_0xf0ac('0x14f'),'through':_0xf0ac('0x104')});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x150'),'through':_0xf0ac('0x151')});db['VoiceRecording'][_0xf0ac('0x119')](db['User'],{'as':'User','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x1d')]['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a'),'foreignKey':_0xf0ac('0x10e')});db['VoiceMail'][_0xf0ac('0x10f')](db[_0xf0ac('0x20')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x153'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10c')],{'foreignKey':_0xf0ac('0x153'),'targetKey':_0xf0ac('0x154')});db[_0xf0ac('0x22')]['hasMany'](db[_0xf0ac('0x155')],{'as':_0xf0ac('0x156'),'foreignKey':_0xf0ac('0x157'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xf0ac('0x26')],{'as':'AgentReports','foreignKey':_0xf0ac('0x157'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a'),'foreignKey':'UserId'});db[_0xf0ac('0x22')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x3a')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x3c'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3b')][_0xf0ac('0x119')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3c')]['hasOne'](db[_0xf0ac('0x3a')],{'as':'Imap','onDelete':_0xf0ac('0x10d')});db['MailAccount'][_0xf0ac('0x10b')](db[_0xf0ac('0x3b')],{'as':_0xf0ac('0x15a'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':'Answers','foreignKey':_0xf0ac('0x159')});db['MailAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x42')],{'as':_0xf0ac('0x152'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x41')],{'as':_0xf0ac('0x15c')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x15d')],{'as':'Applications'});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db[_0xf0ac('0x8b')],{'as':_0xf0ac('0x8b'),'foreignKey':_0xf0ac('0x15f')});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ac('0x3c')][_0xf0ac('0x11c')](db['User'],{'as':'Agents','through':_0xf0ac('0x134')});db[_0xf0ac('0x160')]['belongsToMany'](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x31')});db[_0xf0ac('0x160')][_0xf0ac('0x11c')](db['Team'],{'through':_0xf0ac('0x161'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x41')][_0xf0ac('0x10f')](db[_0xf0ac('0x42')],{'as':'Messages','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x162')});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x159')});db['MailInteraction']['belongsTo'](db[_0xf0ac('0x6c')],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db['MailInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db['MailInteraction']['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x166'),'as':_0xf0ac('0x167')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0xf0ac('0x166'),'as':_0xf0ac('0x168')});db[_0xf0ac('0x41')][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x122'),'foreignKey':_0xf0ac('0x162')});db[_0xf0ac('0x42')][_0xf0ac('0x10f')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0x16a'),'onDelete':_0xf0ac('0x10d')});db['MailMessage'][_0xf0ac('0x119')](db['User'],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':'Contact'});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x41')],{'as':'Interaction','foreignKey':_0xf0ac('0x162')});db['MailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x159')});db['MailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x5e'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x16c')],{'as':'ChatOfflineMessage','foreignKey':_0xf0ac('0x16d')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db['User'],{'onDelete':'restrict'});db[_0xf0ac('0x15d')]['belongsTo'](db['MailQueue'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{});db['MailQueueReport'][_0xf0ac('0x119')](db['CmList'],{'as':'List','foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x41')],{});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db[_0xf0ac('0x42')],{});db[_0xf0ac('0x43')]['belongsTo'](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x43')]['belongsTo'](db[_0xf0ac('0x160')],{});db[_0xf0ac('0x45')][_0xf0ac('0x10f')](db[_0xf0ac('0x47')],{'as':_0xf0ac('0x171'),'onDelete':'cascade'});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x172'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x49')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x15c')});db['FaxAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x4b')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Exntensions','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db['FaxMessage'],{'as':_0xf0ac('0x152')});db[_0xf0ac('0x49')]['belongsTo'](db['Trunk'],{'as':'Trunk'});db[_0xf0ac('0x49')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x49')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x49')][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x174')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x4e')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')]['belongsTo'](db[_0xf0ac('0x49')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf0ac('0x115')][_0xf0ac('0x10f')](db['FaxMessage'],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xf0ac('0x115')]['belongsTo'](db['FaxAccount'],{'as':_0xf0ac('0x163'),'foreignKey':'FaxAccountId'});db[_0xf0ac('0x115')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x115')]['belongsTo'](db['User'],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':'fax_interaction_has_tags','as':_0xf0ac('0x167')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':'fax_interaction_has_tags','as':_0xf0ac('0x168')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x125'),'foreignKey':_0xf0ac('0x176')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db['FaxInteraction'],{'as':_0xf0ac('0x178'),'foreignKey':_0xf0ac('0x176')});db['FaxMessage'][_0xf0ac('0x119')](db['CmContact'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db['FaxMessage']['belongsTo'](db[_0xf0ac('0xe9')],{'as':'Attachment','foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x172')});db['FaxQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x32')});db['FaxQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x17a'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x50')][_0xf0ac('0x119')](db['FaxAccount'],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x50')][_0xf0ac('0x119')](db[_0xf0ac('0x115')],{});db['FaxQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x177')],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0x4e')],{});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x17b'),'onDelete':_0xf0ac('0x10d')});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':_0xf0ac('0x17c'),'foreignKey':'SmsAccountId'});db[_0xf0ac('0x51')][_0xf0ac('0x10f')](db[_0xf0ac('0x57')],{'as':'Messages','foreignKey':_0xf0ac('0x17b')});db['SmsAccount']['hasMany'](db[_0xf0ac('0x55')],{'as':_0xf0ac('0x15c')});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x53')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x51')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x51')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x51')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Agents','through':_0xf0ac('0x138')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x12c')],{'onDelete':'restrict'});db[_0xf0ac('0x53')]['belongsTo'](db['SmsAccount'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x14b')});db['SmsApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf0ac('0x55')][_0xf0ac('0x10f')](db[_0xf0ac('0x57')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SmsInteractionId'});db[_0xf0ac('0x55')]['belongsTo'](db[_0xf0ac('0x51')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x17b')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db['SmsInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x17d'),'as':'Tags'});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db['Tag'],{'through':_0xf0ac('0x17d'),'as':'ThroughTags'});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x17e'),'foreignKey':_0xf0ac('0x17f')});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db['SmsMessage']['belongsTo'](db['SmsInteraction'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':'SmsInteractionId'});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db['SmsAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x17b')});db['SmsQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x34'),'foreignKey':_0xf0ac('0x180')});db[_0xf0ac('0x12c')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x181'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db['Disposition'],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x182'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x15c'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db[_0xf0ac('0x183')],{'as':'Messages','foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['OpenchannelAccount'][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x136')});db[_0xf0ac('0x184')]['belongsTo'](db[_0xf0ac('0x10a')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0xf0ac('0x119')](db['OpenchannelAccount'],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xf0ac('0x119')](db['Interval'],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x184')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x111')][_0xf0ac('0x10f')](db[_0xf0ac('0x183')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x185')});db[_0xf0ac('0x111')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'as':_0xf0ac('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xf0ac('0x111')]['belongsTo'](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db['OpenchannelInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db[_0xf0ac('0x111')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':'openchannel_interaction_has_tags','as':_0xf0ac('0x167')});db['OpenchannelInteraction'][_0xf0ac('0x11c')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xf0ac('0x168')});db['OpenchannelInteraction'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x126'),'foreignKey':_0xf0ac('0x185')});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x183')]['belongsTo'](db['CmContact'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db[_0xf0ac('0x183')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':'OpenchannelInteractionId'});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0xe9'),'foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x5d')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x36'),'foreignKey':_0xf0ac('0x186')});db[_0xf0ac('0x5d')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x187'),'as':'Teams'});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x16b'),'onDelete':'cascade'});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db['CannedAnswer'],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x16b')});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x188')],{'as':_0xf0ac('0x189')});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x62')],{'as':_0xf0ac('0x15c')});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db['ChatApplication'],{'as':'Applications'});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db[_0xf0ac('0x64')],{'as':'Messages'});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['ChatWebsite'][_0xf0ac('0x119')](db['MailAccount'],{'as':_0xf0ac('0x3c'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0xf0ac('0x14d')});db['ChatWebsite'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db['OpenchannelInteraction'],{});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x183')],{});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x18c'),'foreignKey':_0xf0ac('0x10e'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x67')],{'as':'Queue','foreignKey':_0xf0ac('0x18d'),'onDelete':'restrict'});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x18e'),'foreignKey':'ChatWebsiteId','onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x62')][_0xf0ac('0x10f')](db[_0xf0ac('0x64')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x18f')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x190'),'as':_0xf0ac('0x167')});db[_0xf0ac('0x62')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x190'),'as':_0xf0ac('0x168')});db['ChatInteraction'][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x123'),'foreignKey':_0xf0ac('0x18f')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db['User'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0x62')],{'onDelete':_0xf0ac('0x10d'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0xe9'),'foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x64')]['belongsTo'](db[_0xf0ac('0x5e')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf0ac('0x16c')][_0xf0ac('0x10f')](db['Attachment'],{'as':_0xf0ac('0x16a'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xf0ac('0x10d'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x16c')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x67')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x191'),'as':'Teams'});db[_0xf0ac('0x11b')][_0xf0ac('0x10f')](db[_0xf0ac('0xcf')],{'as':'Messages','foreignKey':_0xf0ac('0x192'),'onDelete':_0xf0ac('0x10d')});db['ChatGroup'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x193'),'through':'chat_group_has_users'});db[_0xf0ac('0x188')][_0xf0ac('0x119')](db['ChatWebsite'],{'as':_0xf0ac('0x18e'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x6a')][_0xf0ac('0x10f')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'foreignKey':'CompanyId'});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x143')],{'as':_0xf0ac('0x144'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x71')],{'as':'HopperFinals','foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0xd2')],{'as':_0xf0ac('0x149'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x111')],{'as':'OpenchannelInteractions','foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x55')],{'as':_0xf0ac('0x114'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x124'),'foreignKey':_0xf0ac('0x158'),'onDelete':'restrict'});db[_0xf0ac('0x6c')]['hasMany'](db['MailInteraction'],{'as':_0xf0ac('0x121'),'foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x119')](db[_0xf0ac('0x6a')],{'as':_0xf0ac('0x194'),'foreignKey':_0xf0ac('0x195')});db['CmContact'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170'),'onDelete':'cascade'});db[_0xf0ac('0x6c')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x11e')});db[_0xf0ac('0x6c')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'as':_0xf0ac('0x167'),'through':'cm_contact_has_tags'});db[_0xf0ac('0x6c')][_0xf0ac('0x11c')](db['Tag'],{'through':_0xf0ac('0x196'),'as':'ThroughTags'});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db['CmList'],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db['CmHopper'][_0xf0ac('0x119')](db['User'],{'as':_0xf0ac('0x18c'),'foreignKey':'UserId'});db['CmHopper'][_0xf0ac('0x119')](db[_0xf0ac('0x19')],{'as':'Queue','foreignKey':_0xf0ac('0x145'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db[_0xf0ac('0x197')],{'as':_0xf0ac('0x197'),'foreignKey':_0xf0ac('0x198'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')]['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x199')});db[_0xf0ac('0x6f')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')]['belongsTo'](db['VoiceQueue'],{'as':_0xf0ac('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')][_0xf0ac('0x119')](db[_0xf0ac('0x197')],{'as':_0xf0ac('0x197'),'foreignKey':'CampaignId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x19b')][_0xf0ac('0x10f')](db['Condition'],{'as':{'plural':_0xf0ac('0x19c'),'singular':_0xf0ac('0x19d')},'foreignKey':_0xf0ac('0x19e'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x19b')]['hasMany'](db['Condition'],{'as':{'plural':_0xf0ac('0x19f'),'singular':_0xf0ac('0x1a0')},'foreignKey':_0xf0ac('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x19b')][_0xf0ac('0x10f')](db[_0xf0ac('0x78')],{'as':_0xf0ac('0x1a2'),'foreignKey':_0xf0ac('0x1a3'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x7c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x1a4'),'onDelete':'cascade'});db[_0xf0ac('0x80')][_0xf0ac('0x10f')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x1a5'),'foreignKey':'IntervalId','onDelete':_0xf0ac('0x10d'),'hooks':!![],'required':![]});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x15')],{'as':_0xf0ac('0x1a6'),'foreignKey':_0xf0ac('0x14b'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x15d')],{'as':_0xf0ac('0x1a7'),'foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x80')][_0xf0ac('0x10f')](db[_0xf0ac('0x18b')],{'as':_0xf0ac('0x1a8'),'foreignKey':_0xf0ac('0x14b')});db['Interval'][_0xf0ac('0x10f')](db[_0xf0ac('0x4b')],{'as':_0xf0ac('0x1a9'),'foreignKey':'IntervalId'});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x53')],{'as':_0xf0ac('0x1aa'),'foreignKey':_0xf0ac('0x14b')});db['Schedule'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{});db['Schedule'][_0xf0ac('0x119')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xf0ac('0x86')][_0xf0ac('0x119')](db[_0xf0ac('0x1ab')],{'foreignKey':_0xf0ac('0x1ac')});db['Sound']['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xf0ac('0x142'),'onDelete':_0xf0ac('0x16e')});db['Tag']['belongsToMany'](db[_0xf0ac('0x6c')],{'through':_0xf0ac('0x196')});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0x62')],{'through':_0xf0ac('0x190')});db['Tag'][_0xf0ac('0x11c')](db[_0xf0ac('0x41')],{'through':_0xf0ac('0x166')});db['Tag']['belongsToMany'](db[_0xf0ac('0x55')],{'through':_0xf0ac('0x17d')});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0x111')],{'through':'openchannel_interaction_has_tags'});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0xfc')],{'through':_0xf0ac('0x1ad')});db[_0xf0ac('0x8d')][_0xf0ac('0x10f')](db[_0xf0ac('0x7e')],{'as':{'plural':'AllConditions','singular':_0xf0ac('0x1ae')},'foreignKey':_0xf0ac('0x1af'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xf0ac('0x7e')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x8d')][_0xf0ac('0x10f')](db['Action'],{'as':'Actions','foreignKey':_0xf0ac('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x1ab')][_0xf0ac('0x10f')](db['AnalyticFieldReport'],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xf0ac('0x10f')](db['AnalyticFieldReport'],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b2')});db[_0xf0ac('0x99')][_0xf0ac('0x10f')](db[_0xf0ac('0x9b')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b3')});db[_0xf0ac('0x9b')][_0xf0ac('0x119')](db[_0xf0ac('0x99')],{'foreignKey':_0xf0ac('0x1b3')});db[_0xf0ac('0x9f')][_0xf0ac('0x10f')](db[_0xf0ac('0x1b4')],{'as':_0xf0ac('0x1b5'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0x1b4')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':'Descriptions','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1b4')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1b4')][_0xf0ac('0x119')](db[_0xf0ac('0x9f')],{'as':'Account','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xa2')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xa4')]['hasMany'](db[_0xf0ac('0xa6')],{'as':_0xf0ac('0x1b5'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Subjects','onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db['SugarcrmField'],{'as':_0xf0ac('0x1c1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':_0xf0ac('0x1b1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xa6')][_0xf0ac('0x119')](db[_0xf0ac('0xa4')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c0')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Subject','foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0x1c0')]['hasMany'](db[_0xf0ac('0x1c0')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c0')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Field','foreignKey':_0xf0ac('0x1b9')});db['SugarcrmField']['belongsTo'](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xa9')][_0xf0ac('0x10f')](db[_0xf0ac('0xaa')],{'as':_0xf0ac('0x1b5'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xaa')][_0xf0ac('0x10f')](db['DeskField'],{'as':_0xf0ac('0x1b6'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b7')});db['DeskConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xaa')]['hasMany'](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db['DeskConfiguration'][_0xf0ac('0x119')](db['DeskAccount'],{'as':_0xf0ac('0x163'),'foreignKey':'AccountId'});db[_0xf0ac('0xaa')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c3')});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db['DeskField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1bd'),'foreignKey':'FieldId'});db[_0xf0ac('0x1c2')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db['ZohoAccount'][_0xf0ac('0x10f')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':'AccountId'});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db['ZohoField'],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1c4')][_0xf0ac('0x119')](db['ZohoAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xae')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xf0ac('0x1bc'),'foreignKey':'DescriptionId'});db[_0xf0ac('0xae')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xae')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0x1c5')]['hasMany'](db[_0xf0ac('0x1c6')],{'as':_0xf0ac('0x1b5'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c6')][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':_0xf0ac('0x1b6'),'foreignKey':_0xf0ac('0x1b7')});db['ZendeskConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c6')][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':'Fields','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1c6')][_0xf0ac('0x119')](db[_0xf0ac('0x1c5')],{'as':'Account','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c6')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c7')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['ZendeskField'][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':'Variable','foreignKey':'VariableId'});db[_0xf0ac('0xb2')]['hasMany'](db[_0xf0ac('0xb4')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xb4')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration']['hasMany'](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb4')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb4')]['belongsTo'](db[_0xf0ac('0xb2')],{'as':_0xf0ac('0x163'),'foreignKey':'AccountId'});db[_0xf0ac('0xb4')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c8')});db[_0xf0ac('0xb5')]['hasMany'](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xb5')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1bc'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':'Field','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb5')][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xb7')][_0xf0ac('0x10f')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0xf0ac('0x1b6'),'foreignKey':'SubjectId'});db[_0xf0ac('0xb9')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb9')]['hasMany'](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb9')][_0xf0ac('0x119')](db[_0xf0ac('0xb7')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xbb')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0xbb')]['hasMany'](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xbb')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['VtigerField'][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db['ServicenowAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xbf')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xbf')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xf0ac('0x10f')](db['ServicenowField'],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db['ServicenowConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xbf')][_0xf0ac('0x119')](db['ServicenowAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xc0')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0xc0')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc0')]['hasMany'](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc0')][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xc2')][_0xf0ac('0x10f')](db[_0xf0ac('0xc4')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['Dynamics365Configuration']['hasMany'](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xc4')][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1c1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b8')});db['Dynamics365Configuration'][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1b1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc4')]['belongsTo'](db[_0xf0ac('0xc2')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db['Dynamics365Field'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db['Dynamics365Field'],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['Dynamics365Field'][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0x1c9')]['hasMany'](db[_0xf0ac('0xc8')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db['FreshsalesConfiguration']['hasMany'](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1b6'),'foreignKey':_0xf0ac('0x1b7')});db['FreshsalesConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc8')][_0xf0ac('0x10f')](db['FreshsalesField'],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc8')]['belongsTo'](db[_0xf0ac('0x1c9')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xca')]['hasMany'](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xca')][_0xf0ac('0x10f')](db['FreshsalesField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db['FreshsalesField'][_0xf0ac('0x10f')](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xca')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db['CmList'],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['ChatQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{});db['ChatQueueReport'][_0xf0ac('0x119')](db['ChatQueue'],{});db['ChatInternalMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ca')});db[_0xf0ac('0xd2')][_0xf0ac('0x10f')](db[_0xf0ac('0xd1')],{'foreignKey':_0xf0ac('0x1cb'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xd2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1cc')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x51')],{});db['SmsQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['SmsQueueReport']['belongsTo'](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x55')],{});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x57')],{});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db['User'],{});db['SmsQueueReport'][_0xf0ac('0x119')](db['SmsQueue'],{});db[_0xf0ac('0xd9')]['hasMany'](db[_0xf0ac('0xd2')],{'foreignKey':_0xf0ac('0x1ce')});db[_0xf0ac('0xd9')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xf0ac('0x1ce')});db[_0xf0ac('0xd9')][_0xf0ac('0x10f')](db[_0xf0ac('0x1cc')],{'foreignKey':_0xf0ac('0x1ce')});db['SquareProject']['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x13d')});db['Team']['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x120')});db['Team']['belongsToMany'](db[_0xf0ac('0x19')],{'through':_0xf0ac('0x104'),'as':_0xf0ac('0x1cf')});db[_0xf0ac('0xe3')]['belongsToMany'](db[_0xf0ac('0x160')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team'][_0xf0ac('0x11c')](db['ChatQueue'],{'through':_0xf0ac('0x191'),'as':'ChatQueues'});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0x4e')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0x12c')],{'through':_0xf0ac('0x181'),'as':_0xf0ac('0x12d')});db[_0xf0ac('0xe3')]['belongsToMany'](db[_0xf0ac('0x5d')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xf0ac('0x101')],{'through':_0xf0ac('0x1d0'),'as':_0xf0ac('0x12f')});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0xf3')],{'through':_0xf0ac('0x106'),'as':_0xf0ac('0x128')});db['Campaign'][_0xf0ac('0x10f')](db['CmHopper'],{'as':_0xf0ac('0x144'),'foreignKey':'CampaignId'});db[_0xf0ac('0x197')][_0xf0ac('0x10f')](db[_0xf0ac('0x71')],{'as':_0xf0ac('0x146'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':_0xf0ac('0x147'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')]['hasMany'](db[_0xf0ac('0x6f')],{'as':_0xf0ac('0x148'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':_0xf0ac('0x2a'),'foreignKey':_0xf0ac('0x14a')});db['Campaign'][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':_0xf0ac('0x1d1'),'foreignKey':_0xf0ac('0x1d2')});db[_0xf0ac('0x197')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['Campaign']['belongsTo'](db['SquareProject'],{'as':_0xf0ac('0xdf'),'foreignKey':_0xf0ac('0x1d3')});db[_0xf0ac('0x197')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x11f'),'through':'campaigns_has_cm_lists'});db[_0xf0ac('0x197')]['belongsToMany'](db[_0xf0ac('0xf2')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xf0ac('0xe9')][_0xf0ac('0x119')](db[_0xf0ac('0x16c')],{'as':_0xf0ac('0x16c'),'foreignKey':_0xf0ac('0x16d')});db[_0xf0ac('0x1d4')]['belongsTo'](db['MailMessage'],{});db['MailTransferReport'][_0xf0ac('0x119')](db['MailInteraction'],{});db[_0xf0ac('0x1d4')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'foreignKey':'FromMailAccountId','as':_0xf0ac('0x1d5')});db['MailTransferReport']['belongsTo'](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['MailTransferReport'][_0xf0ac('0x119')](db['User'],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db[_0xf0ac('0x1d4')][_0xf0ac('0x119')](db['MailQueue'],{'foreignKey':_0xf0ac('0x1d9'),'as':_0xf0ac('0x1da')});db['MailTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x64')],{});db[_0xf0ac('0x1db')]['belongsTo'](db[_0xf0ac('0x62')],{});db[_0xf0ac('0x1db')]['belongsTo'](db[_0xf0ac('0x5e')],{'foreignKey':_0xf0ac('0x1dc'),'as':'FromAccount'});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'FromUserId','as':_0xf0ac('0x1d7')});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1dd'),'as':_0xf0ac('0x1d8')});db['ChatTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x67')],{'foreignKey':'ToChatQueueId','as':_0xf0ac('0x1da')});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'foreignKey':'ToChatWebsiteId','as':_0xf0ac('0x1de')});db['FaxTransferReport']['belongsTo'](db[_0xf0ac('0x177')],{});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x115')],{});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'foreignKey':'FromFaxAccountId','as':_0xf0ac('0x1d5')});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['FaxTransferReport'][_0xf0ac('0x119')](db['User'],{'foreignKey':_0xf0ac('0x1dd'),'as':_0xf0ac('0x1d8')});db['FaxTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x4e')],{'foreignKey':_0xf0ac('0x1df'),'as':_0xf0ac('0x1da')});db['FaxTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'foreignKey':_0xf0ac('0x1e0'),'as':_0xf0ac('0x1de')});db[_0xf0ac('0xee')]['belongsTo'](db[_0xf0ac('0x183')],{});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x111')],{});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db['OpenchannelAccount'],{'foreignKey':_0xf0ac('0x1e1'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['OpenchannelTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{'foreignKey':_0xf0ac('0x1e2'),'as':_0xf0ac('0x1da')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'foreignKey':_0xf0ac('0x1e3'),'as':_0xf0ac('0x1de')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['SmsMessage'],{});db[_0xf0ac('0xf0')]['belongsTo'](db[_0xf0ac('0x55')],{});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['SmsAccount'],{'foreignKey':_0xf0ac('0x1e4'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['User'],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db['SmsTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x12c')],{'foreignKey':_0xf0ac('0x1e5'),'as':'ToQueue'});db['SmsTransferReport'][_0xf0ac('0x119')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xf0ac('0x1de')});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xf2')]['hasMany'](db[_0xf0ac('0x76')],{'as':_0xf0ac('0x1e6'),'foreignKey':'ListId'});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0xf2')]['hasMany'](db[_0xf0ac('0x71')],{'as':_0xf0ac('0x146'),'foreignKey':'ListId'});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':_0xf0ac('0x1e7'),'foreignKey':_0xf0ac('0x170')});db['CmList'][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0xf2')][_0xf0ac('0x11c')](db['VoiceQueue'],{'as':_0xf0ac('0x1e8'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x1e9')});db['VoicePrefix'][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Extensions','onDelete':_0xf0ac('0x10d')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':'Agents','through':_0xf0ac('0x108')});db[_0xf0ac('0xf3')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x106'),'as':_0xf0ac('0x14f')});db['UserProfile']['hasMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'foreignKey':_0xf0ac('0x11a')});db[_0xf0ac('0xf4')][_0xf0ac('0x10f')](db['UserProfileSection'],{'as':_0xf0ac('0x1ea'),'foreignKey':'userProfileId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xf6')][_0xf0ac('0x10f')](db['UserProfileResource'],{'as':_0xf0ac('0x1eb'),'foreignKey':_0xf0ac('0x1ec'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x139')][_0xf0ac('0x10f')](db['Disposition'],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x1ed'),'onDelete':'cascade'});db[_0xf0ac('0x139')]['hasMany'](db['CannedAnswer'],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x1ed')});db['WhatsappAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xfe')],{'as':_0xf0ac('0x152'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0x139')]['hasMany'](db[_0xf0ac('0xfc')],{'as':_0xf0ac('0x15c')});db['WhatsappAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xfa')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x139')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x139')][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x139')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x13b')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':'restrict'});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db['WhatsappQueue'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0xfc')][_0xf0ac('0x10f')](db[_0xf0ac('0xfe')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ee')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':'Owner','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0xfc')]['belongsToMany'](db['Tag'],{'through':_0xf0ac('0x1ad'),'as':_0xf0ac('0x167')});db[_0xf0ac('0xfc')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1ad'),'as':_0xf0ac('0x168')});db[_0xf0ac('0xfc')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Users','through':_0xf0ac('0x127'),'foreignKey':'WhatsappInteractionId'});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0xfc')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':_0xf0ac('0x1ee')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{});db[_0xf0ac('0x1ef')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db['WhatsappQueueReport'][_0xf0ac('0x119')](db['WhatsappInteraction'],{});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0x101')],{});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0xfe')],{});db[_0xf0ac('0x1ef')]['belongsTo'](db['User'],{});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0xfe')],{});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0xfc')],{});db[_0xf0ac('0x100')]['belongsTo'](db[_0xf0ac('0x139')],{'foreignKey':_0xf0ac('0x1f0'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'foreignKey':'ToWhatsappAccountId','as':_0xf0ac('0x1de')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x101')],{'foreignKey':_0xf0ac('0x1f1'),'as':_0xf0ac('0x1da')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ac('0x101')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x38'),'foreignKey':_0xf0ac('0x1f2')});db[_0xf0ac('0x101')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x1d0'),'as':_0xf0ac('0x14f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 1964aa0..31e4b81 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbd6=['/api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','static','root','/apidoc','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isArray','isPlainObject','isString','replace','}@@','includes','lodash','path','express-winston','util','./errors','./config/environment','./config/logger','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','other','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/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/trunk','/api/voice/transfers/reports','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./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/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./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/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./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/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc'];(function(_0x4f4749,_0x60c14){var _0x4b6c6c=function(_0x57b40d){while(--_0x57b40d){_0x4f4749['push'](_0x4f4749['shift']());}};_0x4b6c6c(++_0x60c14);}(_0xdbd6,0x19a));var _0x6dbd=function(_0x10da0c,_0x3a8c22){_0x10da0c=_0x10da0c-0x0;var _0x3654bb=_0xdbd6[_0x10da0c];return _0x3654bb;};'use strict';var _=require(_0x6dbd('0x0'));var path=require(_0x6dbd('0x1'));var express=require('express');var ewinston=require(_0x6dbd('0x2'));var util=require(_0x6dbd('0x3'));var errors=require(_0x6dbd('0x4'));var config=require(_0x6dbd('0x5'));var logger=require(_0x6dbd('0x6'))('api');var authLogger=require(_0x6dbd('0x6'))('auth');exports[_0x6dbd('0x7')]=function(_0x751504){_0x751504[_0x6dbd('0x8')](ewinston[_0x6dbd('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x44baea,_0x28b660){var _0x1309e1=_0x6dbd('0xa');if(!_[_0x6dbd('0xb')](_0x44baea['body'])){_0x1309e1+=_0x6dbd('0xc');var _0x2bc6ea=_0x44baea[_0x6dbd('0xd')];maskSensitiveData(_0x2bc6ea);}return util[_0x6dbd('0xe')](_0x1309e1,_0x44baea['method'],_0x44baea['headers'][_0x6dbd('0xf')]?_0x44baea[_0x6dbd('0x10')][_0x6dbd('0xf')]:_0x44baea[_0x6dbd('0x11')][_0x6dbd('0x12')]||_0x44baea['ip'],_0x44baea[_0x6dbd('0x13')],_0x28b660[_0x6dbd('0x14')],_0x28b660[_0x6dbd('0x15')],_0x44baea['user']?_0x44baea[_0x6dbd('0x16')]['id']:null,_0x44baea[_0x6dbd('0x16')]?_0x44baea[_0x6dbd('0x16')][_0x6dbd('0x17')]:null,_0x44baea[_0x6dbd('0x16')]?_0x44baea[_0x6dbd('0x16')][_0x6dbd('0x18')]:null,_0x2bc6ea?util[_0x6dbd('0x19')](_0x2bc6ea,![],null):'');}}));_0x751504[_0x6dbd('0x8')](ewinston[_0x6dbd('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x49d5ce,_0x419d92){var _0x52a996=_0x6dbd('0x1a');if(_0x49d5ce[_0x6dbd('0xd')]&&_0x49d5ce[_0x6dbd('0xd')][_0x6dbd('0x1b')]&&_0x49d5ce[_0x6dbd('0xd')][_0x6dbd('0x1c')]){_0x52a996=_0x6dbd('0x1d');}return util[_0x6dbd('0xe')](_0x52a996,_0x49d5ce[_0x6dbd('0x1e')],_0x49d5ce[_0x6dbd('0x10')]['x-forwarded-for']?_0x49d5ce['headers'][_0x6dbd('0xf')]:_0x49d5ce[_0x6dbd('0x11')]['remoteAddress']||_0x49d5ce['ip'],_0x49d5ce[_0x6dbd('0x13')],_0x419d92[_0x6dbd('0x14')],_0x419d92[_0x6dbd('0x15')],_0x49d5ce['user']?_0x49d5ce[_0x6dbd('0x16')]['id']:null,_0x49d5ce[_0x6dbd('0x16')]?_0x49d5ce['user']['name']:null,_0x49d5ce[_0x6dbd('0x16')]?_0x49d5ce[_0x6dbd('0x16')][_0x6dbd('0x18')]:null,_0x49d5ce['body']&&_0x49d5ce[_0x6dbd('0xd')]['device']?_0x49d5ce[_0x6dbd('0xd')]['device']:_0x6dbd('0x1f'),_0x49d5ce[_0x6dbd('0xd')]&&_0x49d5ce[_0x6dbd('0xd')][_0x6dbd('0x1c')]?_0x49d5ce[_0x6dbd('0xd')][_0x6dbd('0x1c')]:'',_0x49d5ce[_0x6dbd('0xd')]&&_0x49d5ce['body']['agent_name']?_0x49d5ce[_0x6dbd('0xd')]['agent_name']:'');},'ignoreRoute':function(_0x11d7bb){var _0x1dfc4d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1dfc4d[_0x6dbd('0x20')](_0x11d7bb['url']);}}));_0x751504[_0x6dbd('0x8')]('/api/users',require(_0x6dbd('0x21')));_0x751504['use'](_0x6dbd('0x22'),require(_0x6dbd('0x23')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x24'),require('./api/voiceContext'));_0x751504[_0x6dbd('0x8')]('/api/voice/extensions',require(_0x6dbd('0x25')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x26'),require(_0x6dbd('0x27')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x28'),require(_0x6dbd('0x29')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x2a'),require('./api/voiceRecording'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x2b'),require(_0x6dbd('0x2c')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x2d'),require(_0x6dbd('0x2e')));_0x751504['use'](_0x6dbd('0x2f'),require(_0x6dbd('0x30')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x31'),require(_0x6dbd('0x32')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x33'),require(_0x6dbd('0x34')));_0x751504['use'](_0x6dbd('0x35'),require(_0x6dbd('0x36')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x37'),require(_0x6dbd('0x38')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x39'),require(_0x6dbd('0x3a')));_0x751504[_0x6dbd('0x8')]('/api/trunks',require(_0x6dbd('0x3b')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x3c'),require('./api/voiceTransferReport'));_0x751504[_0x6dbd('0x8')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x3d'),require(_0x6dbd('0x3e')));_0x751504['use'](_0x6dbd('0x3f'),require('./api/mailQueue'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x40'),require(_0x6dbd('0x41')));_0x751504[_0x6dbd('0x8')]('/api/mail/interactions',require(_0x6dbd('0x42')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x43'),require(_0x6dbd('0x44')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x45'),require(_0x6dbd('0x46')));_0x751504['use'](_0x6dbd('0x47'),require('./api/mailQueueReport'));_0x751504[_0x6dbd('0x8')]('/api/dashboards',require(_0x6dbd('0x48')));_0x751504[_0x6dbd('0x8')]('/api/dashboards/items',require(_0x6dbd('0x49')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x4a'),require(_0x6dbd('0x4b')));_0x751504[_0x6dbd('0x8')]('/api/fax/applications',require('./api/faxApplication'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x4c'),require(_0x6dbd('0x4d')));_0x751504['use'](_0x6dbd('0x4e'),require(_0x6dbd('0x4f')));_0x751504['use'](_0x6dbd('0x50'),require(_0x6dbd('0x51')));_0x751504[_0x6dbd('0x8')]('/api/fax/reports/queue',require(_0x6dbd('0x52')));_0x751504['use'](_0x6dbd('0x53'),require(_0x6dbd('0x54')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x55'),require(_0x6dbd('0x56')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x57'),require(_0x6dbd('0x58')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x59'),require(_0x6dbd('0x5a')));_0x751504['use'](_0x6dbd('0x5b'),require(_0x6dbd('0x5c')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x5d'),require(_0x6dbd('0x5e')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x5f'),require(_0x6dbd('0x60')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x61'),require(_0x6dbd('0x62')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x63'),require(_0x6dbd('0x64')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x65'),require(_0x6dbd('0x66')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x67'),require('./api/chatWebsite'));_0x751504[_0x6dbd('0x8')]('/api/openchannel/reports/queue',require(_0x6dbd('0x68')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x69'),require(_0x6dbd('0x6a')));_0x751504['use'](_0x6dbd('0x6b'),require(_0x6dbd('0x6c')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x6d'),require(_0x6dbd('0x6e')));_0x751504[_0x6dbd('0x8')]('/api/chat/offline_messages',require(_0x6dbd('0x6f')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x70'),require(_0x6dbd('0x71')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x72'),require(_0x6dbd('0x73')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x74'),require(_0x6dbd('0x75')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x76'),require(_0x6dbd('0x77')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x78'),require(_0x6dbd('0x79')));_0x751504['use'](_0x6dbd('0x7a'),require(_0x6dbd('0x7b')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x7c'),require(_0x6dbd('0x7d')));_0x751504['use'](_0x6dbd('0x7e'),require(_0x6dbd('0x7f')));_0x751504[_0x6dbd('0x8')]('/api/cm/hopper_history',require(_0x6dbd('0x80')));_0x751504[_0x6dbd('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x81'),require(_0x6dbd('0x82')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x83'),require(_0x6dbd('0x84')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x85'),require(_0x6dbd('0x86')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x87'),require('./api/disposition'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x88'),require('./api/condition'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x89'),require(_0x6dbd('0x8a')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x8b'),require(_0x6dbd('0x8c')));_0x751504['use'](_0x6dbd('0x8d'),require(_0x6dbd('0x8e')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x8f'),require(_0x6dbd('0x90')));_0x751504[_0x6dbd('0x8')]('/api/schedules',require(_0x6dbd('0x91')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x92'),require(_0x6dbd('0x93')));_0x751504['use']('/api/tags',require(_0x6dbd('0x94')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x95'),require(_0x6dbd('0x96')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x97'),require(_0x6dbd('0x98')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x99'),require('./api/variable'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x9a'),require(_0x6dbd('0x9b')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x9c'),require(_0x6dbd('0x9d')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x9e'),require('./api/analyticCustomReport'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x9f'),require(_0x6dbd('0xa0')));_0x751504['use']('/api/analytics/extracted_reports',require(_0x6dbd('0xa1')));_0x751504['use'](_0x6dbd('0xa2'),require(_0x6dbd('0xa3')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xa4'),require(_0x6dbd('0xa5')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xa6'),require(_0x6dbd('0xa7')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xa8'),require(_0x6dbd('0xa9')));_0x751504['use'](_0x6dbd('0xaa'),require('./api/intSalesforceConfiguration'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xab'),require('./api/intSalesforceField'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xac'),require(_0x6dbd('0xad')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xae'),require(_0x6dbd('0xaf')));_0x751504['use']('/api/integrations/sugarcrm/fields',require(_0x6dbd('0xb0')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xb1'),require('./api/intDeskAccount'));_0x751504['use']('/api/integrations/desk/configurations',require(_0x6dbd('0xb2')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xb3'),require(_0x6dbd('0xb4')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xb5'),require(_0x6dbd('0xb6')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xb7'),require(_0x6dbd('0xb8')));_0x751504['use'](_0x6dbd('0xb9'),require(_0x6dbd('0xba')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xbb'),require(_0x6dbd('0xbc')));_0x751504['use']('/api/integrations/zendesk/configurations',require(_0x6dbd('0xbd')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xbe'),require(_0x6dbd('0xbf')));_0x751504[_0x6dbd('0x8')]('/api/integrations/freshdesk/accounts',require(_0x6dbd('0xc0')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xc1'),require(_0x6dbd('0xc2')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xc3'),require(_0x6dbd('0xc4')));_0x751504[_0x6dbd('0x8')]('/api/integrations/vtiger/accounts',require(_0x6dbd('0xc5')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xc6'),require('./api/intVtigerConfiguration'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xc7'),require(_0x6dbd('0xc8')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xc9'),require(_0x6dbd('0xca')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xcb'),require(_0x6dbd('0xcc')));_0x751504['use'](_0x6dbd('0xcd'),require(_0x6dbd('0xce')));_0x751504[_0x6dbd('0x8')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xcf'),require('./api/intDynamics365Configuration'));_0x751504[_0x6dbd('0x8')]('/api/integrations/dynamics365/fields',require(_0x6dbd('0xd0')));_0x751504[_0x6dbd('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xd1'),require(_0x6dbd('0xd2')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xd3'),require(_0x6dbd('0xd4')));_0x751504['use'](_0x6dbd('0xd5'),require(_0x6dbd('0xd6')));_0x751504['use']('/api/chat/reports/queue',require(_0x6dbd('0xd7')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xd8'),require('./api/chatInternalMessage'));_0x751504['use'](_0x6dbd('0xd9'),require(_0x6dbd('0xda')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xdb'),require(_0x6dbd('0xdc')));_0x751504['use'](_0x6dbd('0xdd'),require(_0x6dbd('0xde')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xdf'),require(_0x6dbd('0xe0')));_0x751504['use'](_0x6dbd('0xe1'),require('./api/squareReport'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xe2'),require(_0x6dbd('0xe3')));_0x751504['use'](_0x6dbd('0xe4'),require(_0x6dbd('0xe5')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xe6'),require('./api/setting'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xe7'),require(_0x6dbd('0xe8')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xe9'),require(_0x6dbd('0xea')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xeb'),require(_0x6dbd('0xec')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xed'),require(_0x6dbd('0xee')));_0x751504['use'](_0x6dbd('0xef'),require(_0x6dbd('0xf0')));_0x751504[_0x6dbd('0x8')]('/api/license',require(_0x6dbd('0xf1')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xf2'),require(_0x6dbd('0xf3')));_0x751504[_0x6dbd('0x8')]('/api/migrations',require(_0x6dbd('0xf4')));_0x751504[_0x6dbd('0x8')]('/api/attachments',require(_0x6dbd('0xf5')));_0x751504[_0x6dbd('0x8')]('/api/plugins',require(_0x6dbd('0xf6')));_0x751504['use']('/api/mail/reports/transfer',require(_0x6dbd('0xf7')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xf8'),require(_0x6dbd('0xf9')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xfa'),require(_0x6dbd('0xfb')));_0x751504[_0x6dbd('0x8')]('/api/openchannel/reports/transfer',require(_0x6dbd('0xfc')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xfd'),require(_0x6dbd('0xfe')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0xff'),require('./api/cmList'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x100'),require(_0x6dbd('0x101')));_0x751504[_0x6dbd('0x8')]('/api/userProfiles',require(_0x6dbd('0x102')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x103'),require(_0x6dbd('0x104')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x105'),require('./api/userProfileResource'));_0x751504['use'](_0x6dbd('0x106'),require(_0x6dbd('0x107')));_0x751504['use'](_0x6dbd('0x108'),require(_0x6dbd('0x109')));_0x751504[_0x6dbd('0x8')]('/api/whatsapp/applications',require(_0x6dbd('0x10a')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x10b'),require(_0x6dbd('0x10c')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x10d'),require(_0x6dbd('0x10e')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x10f'),require(_0x6dbd('0x110')));_0x751504['use']('/api/whatsapp/reports/transfer',require(_0x6dbd('0x111')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x112'),require('./api/whatsappQueue'));_0x751504['use'](_0x6dbd('0x113'),require(_0x6dbd('0x114')));_0x751504['use']('/api/realtime',require(_0x6dbd('0x115')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x116'),require(_0x6dbd('0x117')));_0x751504['use'](_0x6dbd('0x118'),require(_0x6dbd('0x119')));_0x751504[_0x6dbd('0x8')]('/api/jira',require(_0x6dbd('0x11a')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x11b'),require('./api/rpc'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x11c'),require('./api/version'));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x11d'),require('./api/system'));_0x751504['use'](_0x6dbd('0x11e'),require(_0x6dbd('0x11f')));_0x751504['use']('/api/webbar',require(_0x6dbd('0x120')));_0x751504[_0x6dbd('0x8')]('/apidoc',express[_0x6dbd('0x121')](path['join'](config[_0x6dbd('0x122')],_0x6dbd('0x123'))));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x124'),express[_0x6dbd('0x121')](path[_0x6dbd('0x125')](config['root'],_0x6dbd('0x124'))));_0x751504['use'](_0x6dbd('0x126'),express['static'](path[_0x6dbd('0x125')](config[_0x6dbd('0x122')],'/demo')));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x127'),express[_0x6dbd('0x121')](path[_0x6dbd('0x125')](config['root'],_0x6dbd('0x128'),_0x6dbd('0x129'))));_0x751504[_0x6dbd('0x8')](_0x6dbd('0x12a'),express[_0x6dbd('0x121')](path[_0x6dbd('0x125')](config[_0x6dbd('0x122')],_0x6dbd('0x12b'))));_0x751504[_0x6dbd('0x12c')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x6dbd('0x12d')](errors[0x194]);_0x751504[_0x6dbd('0x12c')]('/*')[_0x6dbd('0x12d')](function(_0x26382d,_0x4c527e){_0x4c527e[_0x6dbd('0x12e')](path[_0x6dbd('0x12f')](_0x751504[_0x6dbd('0x12d')](_0x6dbd('0x130'))+'/index.html'));});};var sensitiveFields=[_0x6dbd('0x131'),_0x6dbd('0x132'),_0x6dbd('0x133'),_0x6dbd('0x134'),_0x6dbd('0x135'),_0x6dbd('0x136'),_0x6dbd('0x137'),_0x6dbd('0x138'),_0x6dbd('0x139'),_0x6dbd('0x13a'),_0x6dbd('0x13b'),_0x6dbd('0x13c'),_0x6dbd('0x13d'),'securityToken','code',_0x6dbd('0x13e'),_0x6dbd('0x13f'),_0x6dbd('0x140'),_0x6dbd('0x141'),_0x6dbd('0x142'),_0x6dbd('0x143'),'authToken','consumerKey',_0x6dbd('0x144'),_0x6dbd('0x145'),_0x6dbd('0x146'),_0x6dbd('0x147'),_0x6dbd('0x148'),_0x6dbd('0x149'),_0x6dbd('0x14a'),'privateKey',_0x6dbd('0x14b'),_0x6dbd('0x14c'),_0x6dbd('0x14d'),_0x6dbd('0x16'),_0x6dbd('0x14e'),_0x6dbd('0x14f'),_0x6dbd('0x150'),_0x6dbd('0x151'),_0x6dbd('0x152'),_0x6dbd('0x153'),_0x6dbd('0x154')];function maskSensitiveData(_0x64ac1a){var _0x56a9ab=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x64ac1a))return;for(var _0x3cd9f7 in _0x64ac1a){if(_[_0x6dbd('0x155')](_0x64ac1a[_0x3cd9f7])){for(var _0x162717=0x0;_0x162717<_0x64ac1a[_0x3cd9f7]['length'];_0x162717++){maskSensitiveData(_0x64ac1a[_0x3cd9f7][_0x162717]);}}else if(_[_0x6dbd('0x156')](_0x64ac1a[_0x3cd9f7])){maskSensitiveData(_0x64ac1a[_0x3cd9f7]);}else if(_[_0x6dbd('0x157')](_0x64ac1a[_0x3cd9f7])){_0x64ac1a[_0x3cd9f7]=_0x64ac1a[_0x3cd9f7][_0x6dbd('0x158')](/{{{/g,'@@{')[_0x6dbd('0x158')](/}}}/g,_0x6dbd('0x159'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x6dbd('0x15a')](sensitiveFields,_0x3cd9f7)){_0x64ac1a[_0x3cd9f7]=_0x64ac1a[_0x3cd9f7][_0x6dbd('0x158')](_0x56a9ab,'*');}}}} \ No newline at end of file +var _0x3d89=['./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','password','newPassword','apiKey','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','consumerKey','consumerSecret','calleridname','exten','clientEmail','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','length','replace','@@{','}@@','includes','path','util','./errors','./config/logger','api','auth','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','name','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./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/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3d89,0x1cc));var _0x93d8=function(_0x4c7f36,_0x258987){_0x4c7f36=_0x4c7f36-0x0;var _0x24f44c=_0x3d89[_0x4c7f36];return _0x24f44c;};'use strict';var _=require('lodash');var path=require(_0x93d8('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require(_0x93d8('0x1'));var errors=require(_0x93d8('0x2'));var config=require('./config/environment');var logger=require(_0x93d8('0x3'))(_0x93d8('0x4'));var authLogger=require('./config/logger')(_0x93d8('0x5'));exports['default']=function(_0xa9a686){_0xa9a686[_0x93d8('0x6')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x554ca6,_0x27173d){var _0x47528b=_0x93d8('0x7');if(!_[_0x93d8('0x8')](_0x554ca6['body'])){_0x47528b+=_0x93d8('0x9');var _0x477962=_0x554ca6[_0x93d8('0xa')];maskSensitiveData(_0x477962);}return util[_0x93d8('0xb')](_0x47528b,_0x554ca6['method'],_0x554ca6['headers'][_0x93d8('0xc')]?_0x554ca6['headers'][_0x93d8('0xc')]:_0x554ca6[_0x93d8('0xd')][_0x93d8('0xe')]||_0x554ca6['ip'],_0x554ca6[_0x93d8('0xf')],_0x27173d[_0x93d8('0x10')],_0x27173d[_0x93d8('0x11')],_0x554ca6[_0x93d8('0x12')]?_0x554ca6[_0x93d8('0x12')]['id']:null,_0x554ca6['user']?_0x554ca6[_0x93d8('0x12')]['name']:null,_0x554ca6[_0x93d8('0x12')]?_0x554ca6[_0x93d8('0x12')][_0x93d8('0x13')]:null,_0x477962?util[_0x93d8('0x14')](_0x477962,![],null):'');}}));_0xa9a686[_0x93d8('0x6')](ewinston[_0x93d8('0x15')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2b0220,_0x209cb1){var _0x4a7cde=_0x93d8('0x16');if(_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x17')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x18')]){_0x4a7cde=_0x93d8('0x19');}return util['format'](_0x4a7cde,_0x2b0220[_0x93d8('0x1a')],_0x2b0220['headers'][_0x93d8('0xc')]?_0x2b0220['headers'][_0x93d8('0xc')]:_0x2b0220['connection'][_0x93d8('0xe')]||_0x2b0220['ip'],_0x2b0220[_0x93d8('0xf')],_0x209cb1[_0x93d8('0x10')],_0x209cb1['responseTime'],_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')]['id']:null,_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')][_0x93d8('0x1b')]:null,_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')]['role']:null,_0x2b0220['body']&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x17')]?_0x2b0220['body'][_0x93d8('0x17')]:_0x93d8('0x1c'),_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x18')]?_0x2b0220['body'][_0x93d8('0x18')]:'',_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x1d')]?_0x2b0220[_0x93d8('0xa')][_0x93d8('0x1d')]:'');},'ignoreRoute':function(_0x45a912){var _0x51e2d0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x51e2d0[_0x93d8('0x1e')](_0x45a912[_0x93d8('0xf')]);}}));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x1f'),require('./api/user'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x20'),require(_0x93d8('0x21')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x22'),require(_0x93d8('0x23')));_0xa9a686['use'](_0x93d8('0x24'),require(_0x93d8('0x25')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x26'),require(_0x93d8('0x27')));_0xa9a686[_0x93d8('0x6')]('/api/voice/queues',require('./api/voiceQueue'));_0xa9a686[_0x93d8('0x6')]('/api/voice/recordings',require(_0x93d8('0x28')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x29'),require(_0x93d8('0x2a')));_0xa9a686[_0x93d8('0x6')]('/api/voice/mails',require(_0x93d8('0x2b')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2c'),require('./api/voiceMailMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2d'),require(_0x93d8('0x2e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2f'),require(_0x93d8('0x30')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x31'),require('./api/voiceAgentReport'));_0xa9a686['use'](_0x93d8('0x32'),require(_0x93d8('0x33')));_0xa9a686['use'](_0x93d8('0x34'),require('./api/memberReport'));_0xa9a686['use'](_0x93d8('0x35'),require('./api/trunk'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x36'),require(_0x93d8('0x37')));_0xa9a686[_0x93d8('0x6')]('/api/mail/out_servers',require(_0x93d8('0x38')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x39'),require(_0x93d8('0x3a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3b'),require(_0x93d8('0x3c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3d'),require(_0x93d8('0x3e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3f'),require(_0x93d8('0x40')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x41'),require(_0x93d8('0x42')));_0xa9a686['use'](_0x93d8('0x43'),require('./api/mailApplication'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x44'),require('./api/mailQueueReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x45'),require('./api/dashboard'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x46'),require(_0x93d8('0x47')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x48'),require('./api/faxAccount'));_0xa9a686[_0x93d8('0x6')]('/api/fax/applications',require(_0x93d8('0x49')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4a'),require(_0x93d8('0x4b')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4c'),require('./api/faxMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4d'),require('./api/faxQueue'));_0xa9a686['use'](_0x93d8('0x4e'),require(_0x93d8('0x4f')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x50'),require(_0x93d8('0x51')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x52'),require('./api/smsApplication'));_0xa9a686[_0x93d8('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0xa9a686['use'](_0x93d8('0x53'),require(_0x93d8('0x54')));_0xa9a686[_0x93d8('0x6')]('/api/sms/queues',require(_0x93d8('0x55')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0xa9a686['use'](_0x93d8('0x56'),require(_0x93d8('0x57')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/interactions',require(_0x93d8('0x58')));_0xa9a686['use']('/api/openchannel/messages',require(_0x93d8('0x59')));_0xa9a686['use'](_0x93d8('0x5a'),require(_0x93d8('0x5b')));_0xa9a686['use'](_0x93d8('0x5c'),require(_0x93d8('0x5d')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x5e'),require(_0x93d8('0x5f')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x60'),require('./api/chatApplication'));_0xa9a686[_0x93d8('0x6')]('/api/chat/interactions',require(_0x93d8('0x61')));_0xa9a686['use'](_0x93d8('0x62'),require('./api/chatMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x63'),require(_0x93d8('0x64')));_0xa9a686['use'](_0x93d8('0x65'),require(_0x93d8('0x66')));_0xa9a686[_0x93d8('0x6')]('/api/chat/groups',require(_0x93d8('0x67')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x68'),require('./api/chatProactiveAction'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x69'),require('./api/cmCompany'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x6a'),require(_0x93d8('0x6b')));_0xa9a686['use']('/api/cm/hopper',require('./api/cmHopper'));_0xa9a686[_0x93d8('0x6')]('/api/cm/hopper_black',require(_0x93d8('0x6c')));_0xa9a686['use']('/api/cm/hopper_final',require(_0x93d8('0x6d')));_0xa9a686[_0x93d8('0x6')]('/api/cm/hopper_history',require(_0x93d8('0x6e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x6f'),require(_0x93d8('0x70')));_0xa9a686[_0x93d8('0x6')]('/api/actions',require('./api/action'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x71'),require(_0x93d8('0x72')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x73'),require(_0x93d8('0x74')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x75'),require(_0x93d8('0x76')));_0xa9a686[_0x93d8('0x6')]('/api/conditions',require('./api/condition'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x77'),require(_0x93d8('0x78')));_0xa9a686[_0x93d8('0x6')]('/api/pauses',require('./api/pause'));_0xa9a686['use'](_0x93d8('0x79'),require(_0x93d8('0x7a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x7b'),require(_0x93d8('0x7c')));_0xa9a686[_0x93d8('0x6')]('/api/schedules',require(_0x93d8('0x7d')));_0xa9a686['use'](_0x93d8('0x7e'),require(_0x93d8('0x7f')));_0xa9a686[_0x93d8('0x6')]('/api/tags',require(_0x93d8('0x80')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x81'),require(_0x93d8('0x82')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x83'),require('./api/trigger'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x84'),require(_0x93d8('0x85')));_0xa9a686['use']('/api/integrations',require(_0x93d8('0x86')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x87'),require(_0x93d8('0x88')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x89'),require('./api/analyticCustomReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8a'),require('./api/analyticDefaultReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8b'),require(_0x93d8('0x8c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8d'),require(_0x93d8('0x8e')));_0xa9a686[_0x93d8('0x6')]('/api/analytics/field_reports',require(_0x93d8('0x8f')));_0xa9a686['use'](_0x93d8('0x90'),require(_0x93d8('0x91')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x92'),require('./api/intSalesforceAccount'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x93'),require(_0x93d8('0x94')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/salesforce/fields',require(_0x93d8('0x95')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x93d8('0x96')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x97'),require(_0x93d8('0x98')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x99'),require(_0x93d8('0x9a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9b'),require(_0x93d8('0x9c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9d'),require(_0x93d8('0x9e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9f'),require(_0x93d8('0xa0')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xa1'),require(_0x93d8('0xa2')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xa3'),require(_0x93d8('0xa4')));_0xa9a686['use'](_0x93d8('0xa5'),require('./api/intZohoField'));_0xa9a686['use'](_0x93d8('0xa6'),require(_0x93d8('0xa7')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/zendesk/configurations',require(_0x93d8('0xa8')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/zendesk/fields',require(_0x93d8('0xa9')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xaa'),require('./api/intFreshdeskAccount'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xab'),require(_0x93d8('0xac')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xad'),require('./api/intFreshdeskField'));_0xa9a686['use'](_0x93d8('0xae'),require('./api/intVtigerAccount'));_0xa9a686['use'](_0x93d8('0xaf'),require(_0x93d8('0xb0')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/vtiger/fields',require(_0x93d8('0xb1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb2'),require(_0x93d8('0xb3')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb4'),require('./api/intServicenowConfiguration'));_0xa9a686[_0x93d8('0x6')]('/api/integrations/servicenow/fields',require(_0x93d8('0xb5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb6'),require('./api/intDynamics365Account'));_0xa9a686['use'](_0x93d8('0xb7'),require(_0x93d8('0xb8')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb9'),require(_0x93d8('0xba')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/freshsales/accounts',require(_0x93d8('0xbb')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xbc'),require(_0x93d8('0xbd')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/freshsales/fields',require(_0x93d8('0xbe')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xbf'),require('./api/network'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc0'),require('./api/chatQueueReport'));_0xa9a686[_0x93d8('0x6')]('/api/chat/internal/messages',require(_0x93d8('0xc1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc2'),require(_0x93d8('0xc3')));_0xa9a686['use'](_0x93d8('0xc4'),require(_0x93d8('0xc5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc6'),require(_0x93d8('0xc7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc8'),require('./api/smsQueueReport'));_0xa9a686['use'](_0x93d8('0xc9'),require('./api/squareReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xca'),require('./api/squareReportDetail'));_0xa9a686[_0x93d8('0x6')]('/api/jscripty/projects',require(_0x93d8('0xcb')));_0xa9a686['use'](_0x93d8('0xcc'),require('./api/setting'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xcd'),require('./api/squareOdbc'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xce'),require(_0x93d8('0xcf')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd0'),require('./api/squareRecording'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd1'),require(_0x93d8('0xd2')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd3'),require(_0x93d8('0xd4')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd5'),require('./api/license'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd6'),require(_0x93d8('0xd7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd8'),require(_0x93d8('0xd9')));_0xa9a686[_0x93d8('0x6')]('/api/attachments',require('./api/attachment'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xda'),require(_0x93d8('0xdb')));_0xa9a686[_0x93d8('0x6')]('/api/mail/reports/transfer',require(_0x93d8('0xdc')));_0xa9a686['use'](_0x93d8('0xdd'),require(_0x93d8('0xde')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xdf'),require(_0x93d8('0xe0')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/reports/transfer',require(_0x93d8('0xe1')));_0xa9a686[_0x93d8('0x6')]('/api/sms/reports/transfer',require(_0x93d8('0xe2')));_0xa9a686['use'](_0x93d8('0xe3'),require('./api/cmList'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe4'),require(_0x93d8('0xe5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe6'),require(_0x93d8('0xe7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe8'),require(_0x93d8('0xe9')));_0xa9a686[_0x93d8('0x6')]('/api/userProfile/resources',require(_0x93d8('0xea')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xeb'),require(_0x93d8('0xec')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xed'),require(_0x93d8('0xee')));_0xa9a686[_0x93d8('0x6')]('/api/whatsapp/applications',require(_0x93d8('0xef')));_0xa9a686['use'](_0x93d8('0xf0'),require(_0x93d8('0xf1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf2'),require(_0x93d8('0xf3')));_0xa9a686['use'](_0x93d8('0xf4'),require(_0x93d8('0xf5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf6'),require(_0x93d8('0xf7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf8'),require(_0x93d8('0xf9')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfa'),require(_0x93d8('0xfb')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfc'),require(_0x93d8('0xfd')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfe'),require(_0x93d8('0xff')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x100'),require(_0x93d8('0x101')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x102'),require('./api/jira'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x103'),require(_0x93d8('0x104')));_0xa9a686['use'](_0x93d8('0x105'),require(_0x93d8('0x106')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x107'),require(_0x93d8('0x108')));_0xa9a686['use']('/api/pm2',require(_0x93d8('0x109')));_0xa9a686[_0x93d8('0x6')]('/api/webbar',require(_0x93d8('0x10a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x10b'),express[_0x93d8('0x10c')](path['join'](config[_0x93d8('0x10d')],_0x93d8('0x10b'))));_0xa9a686[_0x93d8('0x6')]('/www',express[_0x93d8('0x10c')](path['join'](config[_0x93d8('0x10d')],_0x93d8('0x10e'))));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x10f'),express['static'](path[_0x93d8('0x110')](config[_0x93d8('0x10d')],_0x93d8('0x10f'))));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x111'),express[_0x93d8('0x10c')](path[_0x93d8('0x110')](config[_0x93d8('0x10d')],'snippet',_0x93d8('0x112'))));_0xa9a686[_0x93d8('0x6')]('/plugins',express[_0x93d8('0x10c')](path[_0x93d8('0x110')](config['root'],_0x93d8('0x113'))));_0xa9a686[_0x93d8('0x114')](_0x93d8('0x115'))[_0x93d8('0x116')](errors[0x194]);_0xa9a686[_0x93d8('0x114')]('/*')['get'](function(_0x518a6f,_0x4b9a90){_0x4b9a90[_0x93d8('0x117')](path['resolve'](_0xa9a686[_0x93d8('0x116')]('appPath')+_0x93d8('0x118')));});};var sensitiveFields=['username',_0x93d8('0x119'),_0x93d8('0x11a'),_0x93d8('0x11b'),'firstName',_0x93d8('0x11c'),_0x93d8('0x11d'),_0x93d8('0x11e'),_0x93d8('0x11f'),'fax',_0x93d8('0x120'),_0x93d8('0x121'),_0x93d8('0x122'),_0x93d8('0x123'),_0x93d8('0x124'),_0x93d8('0x125'),_0x93d8('0x126'),_0x93d8('0x127'),_0x93d8('0x128'),'accessToken','accessTokenSecret','authToken',_0x93d8('0x129'),_0x93d8('0x12a'),'membername',_0x93d8('0x12b'),'calleridnum',_0x93d8('0x12c'),'vidaooApiKey',_0x93d8('0x12d'),'privateKey',_0x93d8('0x12e'),_0x93d8('0x12f'),'key',_0x93d8('0x12'),_0x93d8('0x130'),_0x93d8('0x131'),_0x93d8('0x132'),_0x93d8('0x133'),_0x93d8('0x134'),'registry',_0x93d8('0x135')];function maskSensitiveData(_0x333563){var _0x10723f=/(?!^)[\s\S](?!$)/g;if(!_[_0x93d8('0x136')](_0x333563))return;for(var _0x531ce7 in _0x333563){if(_['isArray'](_0x333563[_0x531ce7])){for(var _0x218ce4=0x0;_0x218ce4<_0x333563[_0x531ce7][_0x93d8('0x137')];_0x218ce4++){maskSensitiveData(_0x333563[_0x531ce7][_0x218ce4]);}}else if(_['isPlainObject'](_0x333563[_0x531ce7])){maskSensitiveData(_0x333563[_0x531ce7]);}else if(_['isString'](_0x333563[_0x531ce7])){_0x333563[_0x531ce7]=_0x333563[_0x531ce7][_0x93d8('0x138')](/{{{/g,_0x93d8('0x139'))[_0x93d8('0x138')](/}}}/g,_0x93d8('0x13a'))[_0x93d8('0x138')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x93d8('0x13b')](sensitiveFields,_0x531ce7)){_0x333563[_0x531ce7]=_0x333563[_0x531ce7]['replace'](_0x10723f,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7df06d8..38d0e71 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7908=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc'];(function(_0x30d9ad,_0x340f81){var _0xfa91b=function(_0x4235f3){while(--_0x4235f3){_0x30d9ad['push'](_0x30d9ad['shift']());}};_0xfa91b(++_0x340f81);}(_0x7908,0x1b1));var _0x8790=function(_0x2f81b8,_0x5813f9){_0x2f81b8=_0x2f81b8-0x0;var _0x4a6dfd=_0x7908[_0x2f81b8];return _0x4a6dfd;};'use strict';var jayson=require(_0x8790('0x0'));var BPromise=require(_0x8790('0x1'));var _=require(_0x8790('0x2'));var config=require(_0x8790('0x3'));exports['listen']=function(){return new BPromise(function(_0x563527,_0x2a2e52){var _0xde40e6={};_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x4')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x6')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x7')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/voiceRecording/voiceRecording.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x8')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x9')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0xa')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0xb')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0xc')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0xd')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0xe')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0xf')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x10')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x11')));_0xde40e6=_['merge'](_0xde40e6,require('../api/mailQueue/mailQueue.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x12')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x13')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x14')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x15')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x16')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x17')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x18')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x19')));_0xde40e6=_['merge'](_0xde40e6,require('../api/faxQueue/faxQueue.rpc'));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x1a')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x1b')));_0xde40e6=_['merge'](_0xde40e6,require('../api/smsInteraction/smsInteraction.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x1c')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/smsQueue/smsQueue.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x1d')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x1e')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x1f')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x20')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x21')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x22')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x23')));_0xde40e6=_['merge'](_0xde40e6,require('../api/cmHopper/cmHopper.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x24')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x25')));_0xde40e6=_['merge'](_0xde40e6,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x26')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x27')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x28')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x29')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x2a')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x2b')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x2c')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x2d')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x2e')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x2f')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x30')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x31')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x32')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x33')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x34')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/chatQueueReport/chatQueueReport.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x35')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x36')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x37')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x38')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x39')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x3a')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x3b')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x3c')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x3d')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x3e')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/plugin/plugin.rpc'));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x3f')));_0xde40e6=_['merge'](_0xde40e6,require(_0x8790('0x40')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x41')));_0xde40e6=_[_0x8790('0x5')](_0xde40e6,require(_0x8790('0x42')));var _0x2c26d8=jayson['server'](_0xde40e6)[_0x8790('0x43')]();var _0x5f40f5=config[_0x8790('0x44')][_0x8790('0x45')]||config[_0x8790('0x45')]+0x1;var _0x2bd9a3=config[_0x8790('0x44')]['ip']||_0x8790('0x46');_0x2c26d8['on'](_0x8790('0x47'),function(_0x11fb60){return _0x2a2e52(_0x11fb60);});_0x2c26d8['listen'](_0x5f40f5,_0x2bd9a3,function(){console[_0x8790('0x48')](_0x8790('0x49'),_0x2bd9a3,_0x5f40f5);require(_0x8790('0x4a'))[_0x8790('0x4b')]();return _0x563527(_0x8790('0x4c')+_0x2bd9a3+':'+_0x5f40f5);});});}; \ No newline at end of file +var _0x9584=['bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20'];(function(_0x1787d0,_0x2f2305){var _0x338c91=function(_0x463f89){while(--_0x463f89){_0x1787d0['push'](_0x1787d0['shift']());}};_0x338c91(++_0x2f2305);}(_0x9584,0x110));var _0x4958=function(_0x266e9d,_0x3ead2f){_0x266e9d=_0x266e9d-0x0;var _0x204f80=_0x9584[_0x266e9d];return _0x204f80;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4958('0x0'));var _=require(_0x4958('0x1'));var config=require(_0x4958('0x2'));exports[_0x4958('0x3')]=function(){return new BPromise(function(_0x1a1da5,_0x2a1246){var _0x442b42={};_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/user/user.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x5')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x6')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/voiceRecording/voiceRecording.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x7')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x8')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x9')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xa')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xb')));_0x442b42=_['merge'](_0x442b42,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x442b42=_['merge'](_0x442b42,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0xc')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xd')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/mailQueue/mailQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xe')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xf')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x10')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x11')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x12')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x13')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x14')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x15')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x16')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/smsAccount/smsAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x17')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x18')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x19')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1b')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1c')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1d')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1e')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/chatMessage/chatMessage.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/chatQueue/chatQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/cmContact/cmContact.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1f')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x20')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x21')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x22')));_0x442b42=_['merge'](_0x442b42,require('../api/interval/interval.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/pause/pause.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x23')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x24')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/trigger/trigger.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/variable/variable.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x25')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x26')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x27')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x28')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x29')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2b')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x2c')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2d')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2e')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2f')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x30')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x31')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x32')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x33')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x34')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/campaign/campaign.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x35')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x36')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x37')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x38')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x39')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x3a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x3b')));var _0x260d65=jayson[_0x4958('0x3c')](_0x442b42)[_0x4958('0x3d')]();var _0x5ae3a2=config[_0x4958('0x3e')][_0x4958('0x3f')]||config['port']+0x1;var _0x2f41cd=config[_0x4958('0x3e')]['ip']||_0x4958('0x40');_0x260d65['on']('error',function(_0x4d7137){return _0x2a1246(_0x4d7137);});_0x260d65[_0x4958('0x3')](_0x5ae3a2,_0x2f41cd,function(){console[_0x4958('0x41')](_0x4958('0x42'),_0x2f41cd,_0x5ae3a2);require('../config/triggers')['default']();return _0x1a1da5(_0x4958('0x43')+_0x2f41cd+':'+_0x5ae3a2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1683470..5f403b6 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 _0xae30=['startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','destroy','pipe','command','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','continueAt','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','result=','indexOf','substr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae30,0x10a));var _0x0ae3=function(_0x2c54db,_0x4decb4){_0x2c54db=_0x2c54db-0x0;var _0x40c4e4=_0xae30[_0x2c54db];return _0x40c4e4;};'use strict';var util=require(_0x0ae3('0x0'));var _=require(_0x0ae3('0x1'));var EventEmitter=require(_0x0ae3('0x2'))['EventEmitter'];var AGIReply=require(_0x0ae3('0x3'));var AGIError=require(_0x0ae3('0x4'));function AGIChannel(_0x405dd0){var _0x1e3bed=this,_0x51f481=new AGIReply(),_0x23a7a1=![],_0xcf497c={};EventEmitter[_0x0ae3('0x5')](_0x1e3bed);_0x405dd0[_0x0ae3('0x6')](_0x0ae3('0x7'));_0x405dd0[_0x0ae3('0x8')](0x8*0x3c*0x3c*0x3e8);_0x51f481[_0x0ae3('0x6')](_0x0ae3('0x7'));_0x51f481['on'](_0x0ae3('0x9'),function(_0x34e783){for(var _0x1bae69 in _0x34e783){_0x1e3bed[_0x1bae69]=_0x34e783[_0x1bae69];}_0x1e3bed[_0x0ae3('0xa')](_0x0ae3('0xb'));});_0x51f481['on']('line',function(_0x98ab46){if(_0x98ab46[_0x0ae3('0xc')]()=='hangup'){_0x1e3bed['emit'](_0x0ae3('0xd'));return;}if(_0x98ab46[_0x0ae3('0xe')](0x0,0xb)==_0x0ae3('0xf')){_0x23a7a1=!![];}if(_0x23a7a1){_0xcf497c['rx']+=_0x98ab46+'\x0a';if(_0x98ab46[_0x0ae3('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x23a7a1=![];}}else{_0xcf497c['rx']=_0x98ab46;}if(_0x23a7a1){return;}if(typeof _0xcf497c['cb']=='function'){var _0x245ac0=_0xcf497c['rx']['substring'](0x0,0x3),_0x45242d=null,_0x50cee6=null;_0x245ac0=parseInt(_0x245ac0);if(isNaN(_0x245ac0)){_0xcf497c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0ae3('0x11')});return;}if(_0x245ac0!=0xc8){_0xcf497c['cb'](null,{'code':_0x245ac0,'result':-0x1,'extra':'KO'});return;}_0x45242d=_0xcf497c['rx']['substring'](0x4)[_0x0ae3('0x12')](_0x0ae3('0x13'),'');if(_0x45242d[_0x0ae3('0x14')]('\x20')!=-0x1){_0x45242d=_0x45242d[_0x0ae3('0x15')](0x0,_0x45242d[_0x0ae3('0x14')]('\x20'));}if(_[_0x0ae3('0x16')](_0x45242d,'-1')){_0x45242d=parseInt(_0x45242d);}_0x50cee6=_0xcf497c['rx'][_0x0ae3('0x17')]('\x20');if(_0x50cee6['length']==0x3){_0x50cee6=_0x50cee6[0x2][_0x0ae3('0xe')](0x1,_0x50cee6[0x2]['length']-0x1);}else if(_0x50cee6[_0x0ae3('0x18')]>0x3){var _0x254a0f=/\((.+)\)/;var _0x337d12=_0xcf497c['rx'][_0x0ae3('0x19')](_0x254a0f);if(_0x337d12){_0x50cee6=_0x337d12[0x1];}else{_0x50cee6=null;}}else{_0x50cee6=null;}_0xcf497c['cb'](null,{'code':_0x245ac0,'result':_0x45242d,'extra':_0x50cee6});}});_0x405dd0['on'](_0x0ae3('0x1a'),function(_0x40edc6){_0x1e3bed[_0x0ae3('0xa')](_0x0ae3('0x1a'),new AGIError(_0x0ae3('0x1b'),_0x40edc6['code']));});_0x405dd0['on'](_0x0ae3('0x1c'),function(){_0x1e3bed['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x405dd0['on']('timeout',function(){_0x1e3bed['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x405dd0[_0x0ae3('0x1d')]();});_0x405dd0[_0x0ae3('0x1e')](_0x51f481);this[_0x0ae3('0x1f')]=function(_0x580dbd,_0x1cdd85){var _0x580dbd=_0x580dbd||'',_0x1cdd85=typeof _0x1cdd85=='function'?_0x1cdd85:new Function();_0xcf497c={'tx':_0x580dbd,'rx':'','cb':_0x1cdd85};_0x405dd0['write'](_0x580dbd+'\x0a');},this['close']=function(){_0x405dd0[_0x0ae3('0x1d')]();};}util[_0x0ae3('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0ae3('0x21')]['sendRequest']=function(_0x530ba6){return this[_0x0ae3('0x1f')][_0x0ae3('0x22')](this,_0x530ba6);};AGIChannel['prototype'][_0x0ae3('0x23')]=function(){return this[_0x0ae3('0x24')](_0x0ae3('0x25'));};AGIChannel['prototype'][_0x0ae3('0x26')]=function(_0x1f9cde,_0x415c3d,_0x5303f6){_0x1f9cde=_0x1f9cde===undefined?_0x0ae3('0x27'):_0x1f9cde;_0x415c3d=_0x415c3d===undefined?'5':_0x415c3d;_0x5303f6=_0x5303f6===undefined?'1':_0x5303f6;return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1f9cde,_0x415c3d*0x3e8,_0x5303f6));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x29')]=function(_0xf0e310){_0xf0e310=_0xf0e310||_0x0ae3('0x2a');return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')](_0x0ae3('0x2b'),_0xf0e310));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x2c')]=function(_0x26a104,_0x4032f4){if(_[_0x0ae3('0x2d')](_0x4032f4)){return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')](_0x0ae3('0x2e'),_0x26a104,_0x4032f4['join'](',')));}return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')](_0x0ae3('0x2e'),_0x26a104,_0x4032f4));};AGIChannel[_0x0ae3('0x21')]['setContext']=function(_0x1c03b5){return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')](_0x0ae3('0x2f'),_0x1c03b5));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x30')]=function(_0x58e6c4){return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')](_0x0ae3('0x31'),_0x58e6c4));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x32')]=function(_0x685e8b){return this[_0x0ae3('0x24')](util['format']('SET\x20PRIORITY\x20%s',_0x685e8b));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0xd')]=function(){return this[_0x0ae3('0x24')]('HANGUP');};AGIChannel['prototype'][_0x0ae3('0x33')]=function(_0xefecde,_0x1ef996){var _0x3a099e=_[_0x0ae3('0x34')](_0x1ef996)||_[_0x0ae3('0x35')](_0x1ef996)?_0x1ef996[_0x0ae3('0x36')]():_0x1ef996;return this['sendRequest'](util[_0x0ae3('0x28')](_0x0ae3('0x37'),_0xefecde,_0x3a099e?_0x3a099e[_0x0ae3('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x76fe78,_0x12521b){return this['sendRequest'](util[_0x0ae3('0x28')](_0x0ae3('0x38'),_0x76fe78,_0x12521b));};AGIChannel[_0x0ae3('0x21')]['sayDigits']=function(_0x2534d3,_0x5dd8d7){return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x2534d3,_0x5dd8d7));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x39')]=function(_0xfa6c7f,_0x3680d1){return this[_0x0ae3('0x24')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xfa6c7f,_0x3680d1));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x3a')]=function(_0x5c6874,_0x59833d,_0x4808c2){_0x59833d=_0x59833d||this['extension'];_0x4808c2=_0x4808c2||0x1;this[_0x0ae3('0x3b')](_0x5c6874);this[_0x0ae3('0x30')](_0x59833d);this[_0x0ae3('0x32')](_0x4808c2);return this[_0x0ae3('0x29')](util[_0x0ae3('0x28')](_0x0ae3('0x3c'),_0x5c6874,_0x59833d,_0x4808c2));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x3d')]=function(_0x2cfc16){return this[_0x0ae3('0x24')](util['format'](_0x0ae3('0x3e'),_0x2cfc16));};AGIChannel[_0x0ae3('0x21')]['recordFile']=function(_0x1efc23,_0xc9337,_0x3f2f3a,_0x416704,_0x22c12a,_0x49591a){_0xc9337=_0xc9337||_0x0ae3('0x3f');_0x3f2f3a=_0x3f2f3a||'';_0x416704=_0x416704===undefined?-0x1:_0x416704==='-1'?-0x1:_0x416704*0x3e8;_0x22c12a=_0x22c12a===undefined?'':'s='+_0x22c12a;_0x49591a=_0x49591a?_0x0ae3('0x40'):'';return this[_0x0ae3('0x24')](util[_0x0ae3('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1efc23,_0xc9337,_0x3f2f3a,_0x416704,_0x49591a,_0x22c12a));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x41')]=function(_0x49fbd7,_0xa6c493){_0xa6c493=_0xa6c493||'';return this[_0x0ae3('0x24')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x49fbd7,_0xa6c493));};AGIChannel[_0x0ae3('0x21')][_0x0ae3('0x42')]=function(_0x6c24d4){return this[_0x0ae3('0x2c')](_0x0ae3('0x43'),_0x6c24d4);};AGIChannel['prototype']['wait']=function(_0xc23bb0){return this['exec'](_0x0ae3('0x44'),_0xc23bb0);};AGIChannel[_0x0ae3('0x21')]['error']=function(_0x29e158,_0x3e4bfb){this['noop'](util[_0x0ae3('0x28')](_0x0ae3('0x45'),_0x29e158['id'],_0x29e158[_0x0ae3('0x46')],_0x3e4bfb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0ae3('0x47')]=AGIChannel; \ No newline at end of file +var _0x4ca6=['error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','sendRequest','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','replace','indexOf','startsWith','split','length','match'];(function(_0x833f99,_0x3cf4b6){var _0x5681bf=function(_0x4de463){while(--_0x4de463){_0x833f99['push'](_0x833f99['shift']());}};_0x5681bf(++_0x3cf4b6);}(_0x4ca6,0x1a9));var _0x64ca=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x4ca6[_0x29df9a];return _0x3a8e96;};'use strict';var util=require(_0x64ca('0x0'));var _=require(_0x64ca('0x1'));var EventEmitter=require(_0x64ca('0x2'))[_0x64ca('0x3')];var AGIReply=require(_0x64ca('0x4'));var AGIError=require(_0x64ca('0x5'));function AGIChannel(_0x49e6c6){var _0x15b3f9=this,_0x577afc=new AGIReply(),_0x29d468=![],_0x2714f1={};EventEmitter['call'](_0x15b3f9);_0x49e6c6[_0x64ca('0x6')]('utf8');_0x49e6c6[_0x64ca('0x7')](0x8*0x3c*0x3c*0x3e8);_0x577afc['setEncoding'](_0x64ca('0x8'));_0x577afc['on']('headers',function(_0x596fc0){for(var _0x3ade8f in _0x596fc0){_0x15b3f9[_0x3ade8f]=_0x596fc0[_0x3ade8f];}_0x15b3f9[_0x64ca('0x9')](_0x64ca('0xa'));});_0x577afc['on'](_0x64ca('0xb'),function(_0x432ddf){if(_0x432ddf[_0x64ca('0xc')]()=='hangup'){_0x15b3f9['emit'](_0x64ca('0xd'));return;}if(_0x432ddf['substring'](0x0,0xb)==_0x64ca('0xe')){_0x29d468=!![];}if(_0x29d468){_0x2714f1['rx']+=_0x432ddf+'\x0a';if(_0x432ddf[_0x64ca('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x29d468=![];}}else{_0x2714f1['rx']=_0x432ddf;}if(_0x29d468){return;}if(typeof _0x2714f1['cb']==_0x64ca('0x10')){var _0x1fab09=_0x2714f1['rx'][_0x64ca('0x11')](0x0,0x3),_0x43b31e=null,_0x503ab7=null;_0x1fab09=parseInt(_0x1fab09);if(isNaN(_0x1fab09)){_0x2714f1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x64ca('0x12')});return;}if(_0x1fab09!=0xc8){_0x2714f1['cb'](null,{'code':_0x1fab09,'result':-0x1,'extra':'KO'});return;}_0x43b31e=_0x2714f1['rx'][_0x64ca('0x11')](0x4)[_0x64ca('0x13')]('result=','');if(_0x43b31e[_0x64ca('0x14')]('\x20')!=-0x1){_0x43b31e=_0x43b31e['substr'](0x0,_0x43b31e[_0x64ca('0x14')]('\x20'));}if(_[_0x64ca('0x15')](_0x43b31e,'-1')){_0x43b31e=parseInt(_0x43b31e);}_0x503ab7=_0x2714f1['rx'][_0x64ca('0x16')]('\x20');if(_0x503ab7[_0x64ca('0x17')]==0x3){_0x503ab7=_0x503ab7[0x2][_0x64ca('0x11')](0x1,_0x503ab7[0x2]['length']-0x1);}else if(_0x503ab7[_0x64ca('0x17')]>0x3){var _0x163bb2=/\((.+)\)/;var _0x1c27e5=_0x2714f1['rx'][_0x64ca('0x18')](_0x163bb2);if(_0x1c27e5){_0x503ab7=_0x1c27e5[0x1];}else{_0x503ab7=null;}}else{_0x503ab7=null;}_0x2714f1['cb'](null,{'code':_0x1fab09,'result':_0x43b31e,'extra':_0x503ab7});}});_0x49e6c6['on'](_0x64ca('0x19'),function(_0x2b5da3){_0x15b3f9['emit'](_0x64ca('0x19'),new AGIError(_0x64ca('0x1a'),_0x2b5da3['code']));});_0x49e6c6['on'](_0x64ca('0x1b'),function(){_0x15b3f9['emit'](_0x64ca('0x1b'),new AGIError(_0x64ca('0x1c')));});_0x49e6c6['on'](_0x64ca('0x1d'),function(){_0x15b3f9[_0x64ca('0x9')](_0x64ca('0x1d'),new AGIError(_0x64ca('0x1e')));_0x49e6c6[_0x64ca('0x1f')]();});_0x49e6c6[_0x64ca('0x20')](_0x577afc);this[_0x64ca('0x21')]=function(_0x4d5d87,_0x1f8c84){var _0x4d5d87=_0x4d5d87||'',_0x1f8c84=typeof _0x1f8c84==_0x64ca('0x10')?_0x1f8c84:new Function();_0x2714f1={'tx':_0x4d5d87,'rx':'','cb':_0x1f8c84};_0x49e6c6[_0x64ca('0x22')](_0x4d5d87+'\x0a');},this[_0x64ca('0x1b')]=function(){_0x49e6c6[_0x64ca('0x1f')]();};}util[_0x64ca('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x64ca('0x24')]['sendRequest']=function(_0x1db1cf){return this[_0x64ca('0x21')][_0x64ca('0x25')](this,_0x1db1cf);};AGIChannel['prototype'][_0x64ca('0x26')]=function(){return this['sendRequest'](_0x64ca('0x27'));};AGIChannel['prototype']['getData']=function(_0x34b82d,_0x4bb4f3,_0xc94f93){_0x34b82d=_0x34b82d===undefined?'beep':_0x34b82d;_0x4bb4f3=_0x4bb4f3===undefined?'5':_0x4bb4f3;_0xc94f93=_0xc94f93===undefined?'1':_0xc94f93;return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x29'),_0x34b82d,_0x4bb4f3*0x3e8,_0xc94f93));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2a')]=function(_0x360b06){_0x360b06=_0x360b06||_0x64ca('0x2b');return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('VERBOSE\x20\x22%s\x22',_0x360b06));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2d')]=function(_0x2af41a,_0x57e82c){if(_[_0x64ca('0x2e')](_0x57e82c)){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c[_0x64ca('0x30')](',')));}return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c));};AGIChannel['prototype'][_0x64ca('0x31')]=function(_0x530a53){return this['sendRequest'](util['format'](_0x64ca('0x32'),_0x530a53));};AGIChannel['prototype'][_0x64ca('0x33')]=function(_0x17e31b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x34'),_0x17e31b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x35')]=function(_0x20d7e0){return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x36'),_0x20d7e0));};AGIChannel[_0x64ca('0x24')][_0x64ca('0xd')]=function(){return this['sendRequest'](_0x64ca('0x37'));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x38')]=function(_0x37801a,_0x482959){var _0x4ec7b2=_[_0x64ca('0x39')](_0x482959)||_['isNumber'](_0x482959)?_0x482959['toString']():_0x482959;return this['sendRequest'](util[_0x64ca('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x37801a,_0x4ec7b2?_0x4ec7b2[_0x64ca('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x64ca('0x24')]['sayNumber']=function(_0x43ae23,_0x4a6187){return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x3b'),_0x43ae23,_0x4a6187));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3c')]=function(_0x38b22f,_0x6f8879){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3d'),_0x38b22f,_0x6f8879));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3e')]=function(_0x188d4a,_0x31a53b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3f'),_0x188d4a,_0x31a53b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x40')]=function(_0x4c5949,_0x39b251,_0x5c1a43){_0x39b251=_0x39b251||this['extension'];_0x5c1a43=_0x5c1a43||0x1;this[_0x64ca('0x31')](_0x4c5949);this[_0x64ca('0x33')](_0x39b251);this[_0x64ca('0x35')](_0x5c1a43);return this[_0x64ca('0x2a')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x4c5949,_0x39b251,_0x5c1a43));};AGIChannel['prototype'][_0x64ca('0x41')]=function(_0x445334){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x42'),_0x445334));};AGIChannel[_0x64ca('0x24')]['recordFile']=function(_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x85c515,_0x4b74f2){_0x15937a=_0x15937a||_0x64ca('0x43');_0x32b879=_0x32b879||'';_0xdb99b9=_0xdb99b9===undefined?-0x1:_0xdb99b9==='-1'?-0x1:_0xdb99b9*0x3e8;_0x85c515=_0x85c515===undefined?'':'s='+_0x85c515;_0x4b74f2=_0x4b74f2?_0x64ca('0x44'):'';return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x45'),_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x4b74f2,_0x85c515));};AGIChannel[_0x64ca('0x24')]['streamFile']=function(_0x46cd81,_0x146fd0){_0x146fd0=_0x146fd0||'';return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x46cd81,_0x146fd0));};AGIChannel[_0x64ca('0x24')]['agi']=function(_0x346455){return this[_0x64ca('0x2d')]('AGI',_0x346455);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x46')]=function(_0x20a9a1){return this['exec'](_0x64ca('0x47'),_0x20a9a1);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x19')]=function(_0x4677e3,_0x578828){this['noop'](util[_0x64ca('0x28')](_0x64ca('0x48'),_0x4677e3['id'],_0x4677e3[_0x64ca('0x49')],_0x578828));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x64ca('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7f4864f..4798121 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 _0xa20b=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa20b,0x137));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xba20('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xba20('0x1'),'E_AGI_SERVER_ERROR':_0xba20('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xba20('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xba20('0x4'),'E_AGI_SOCKET_ERROR':_0xba20('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xba20('0x6'),'E_AGI_COMMAND_EMPTY':_0xba20('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xba20('0x8'),'E_AGI_IVR_ENTRY':_0xba20('0x9')};function AGIError(_0x50afba){var _0x50afba=_0x50afba||null,_0x2684dd=_0x2684dd||[],_0x2797e7=0x1,_0x2ad5a1='';if(!error[_0x50afba]){_0x50afba=_0xba20('0xa');}_0x2684dd['push'](error[_0x50afba]);while(arguments[_0x2797e7]){_0x2684dd['push'](arguments[_0x2797e7]);_0x2797e7++;}_0x2ad5a1=util[_0xba20('0xb')][_0xba20('0xc')](util,_0x2684dd);this[_0xba20('0xd')]=_0x2ad5a1;this[_0xba20('0xe')]=_0x50afba;}module['exports']=AGIError; \ No newline at end of file +var _0x53fb=['Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5b0a4a,_0x11a985){var _0x2ce5c6=function(_0x4b3a55){while(--_0x4b3a55){_0x5b0a4a['push'](_0x5b0a4a['shift']());}};_0x2ce5c6(++_0x11a985);}(_0x53fb,0xcc));var _0xb53f=function(_0x3eef57,_0xdbe4e7){_0x3eef57=_0x3eef57-0x0;var _0xe006d4=_0x53fb[_0x3eef57];return _0xe006d4;};'use strict';var util=require(_0xb53f('0x0'));var error={'E_AGI_UNDEFINED':_0xb53f('0x1'),'E_AGI_ARGUMENT_PORT':_0xb53f('0x2'),'E_AGI_SERVER_ERROR':_0xb53f('0x3'),'E_AGI_SERVER_CLOSE':_0xb53f('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb53f('0x5'),'E_AGI_SOCKET_ERROR':_0xb53f('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb53f('0x7'),'E_AGI_COMMAND_EMPTY':_0xb53f('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x1f2b45){var _0x1f2b45=_0x1f2b45||null,_0x36c19b=_0x36c19b||[],_0x176628=0x1,_0x17cbeb='';if(!error[_0x1f2b45]){_0x1f2b45=_0xb53f('0x9');}_0x36c19b[_0xb53f('0xa')](error[_0x1f2b45]);while(arguments[_0x176628]){_0x36c19b[_0xb53f('0xa')](arguments[_0x176628]);_0x176628++;}_0x17cbeb=util[_0xb53f('0xb')]['apply'](util,_0x36c19b);this[_0xb53f('0xc')]=_0x17cbeb;this[_0xb53f('0xd')]=_0x1f2b45;}module[_0xb53f('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ee3aedf..be666b7 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 _0xd8df=['length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found'];(function(_0x1dc71c,_0x34810c){var _0x426ddf=function(_0x28db49){while(--_0x28db49){_0x1dc71c['push'](_0x1dc71c['shift']());}};_0x426ddf(++_0x34810c);}(_0xd8df,0x141));var _0xfd8d=function(_0x994f36,_0x259920){_0x994f36=_0x994f36-0x0;var _0x1adbc4=_0xd8df[_0x994f36];return _0x1adbc4;};'use strict';var _=require('lodash');var logger=require(_0xfd8d('0x0'))('agi');var verticesWithRetry=[_0xfd8d('0x1'),_0xfd8d('0x2'),_0xfd8d('0x3')];var Graph=function(){this[_0xfd8d('0x4')]={};this[_0xfd8d('0x5')]={};this[_0xfd8d('0x6')]=0x0;};Graph[_0xfd8d('0x7')][_0xfd8d('0x8')]=function(_0x3ee072){this[_0xfd8d('0x4')][_0x3ee072['id']]=_0x3ee072;this['edges'][_0x3ee072['id']]=[];};Graph['prototype']['addEdge']=function(_0x212e84,_0xe486c3,_0x44951d){this[_0xfd8d('0x5')][_0x212e84][_0xfd8d('0x9')]({'target':_0xe486c3,'condition':_0x44951d});this[_0xfd8d('0x6')]+=0x1;};Graph[_0xfd8d('0x7')][_0xfd8d('0xa')]=function(){return _[_0xfd8d('0xa')](this[_0xfd8d('0x4')]);};Graph[_0xfd8d('0x7')]['relations']=function(){return this['numberOfEdges'];};Graph[_0xfd8d('0x7')][_0xfd8d('0xb')]=function(_0x2ba8ff){return this[_0xfd8d('0x4')][_0x2ba8ff];};Graph[_0xfd8d('0x7')][_0xfd8d('0xc')]=function(_0x55581b,_0x26fd67){if(!this['vertices'][_0x55581b]){return logger[_0xfd8d('0xd')](_0xfd8d('0xe'));}var _0x2d52a3=_0x26fd67(this['vertices'][_0x55581b]);if(!_0x2d52a3){return logger[_0xfd8d('0xd')]('stop\x20traverse');}if(this['edges'][_0x55581b][_0xfd8d('0xf')]===0x0){return logger['info'](_0xfd8d('0x10'));}for(var _0x2ba997=0x0,_0x352a98=[],_0xbd8d82=![];_0x2ba997\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','source','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','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','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','util','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','defaults','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','error','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xca09,0x144));var _0x9ca0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca09[_0x502c7d];return _0x30b7ed;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require('syncho');var util=require(_0x9ca0('0x0'));var moment=require(_0x9ca0('0x1'));var config=require('../../config/environment');var logger=require(_0x9ca0('0x2'))('agi');var utilLicense=require(_0x9ca0('0x3'));var rpc=require(_0x9ca0('0x4'));var mailRpc=require(_0x9ca0('0x5'));var Graph=require(_0x9ca0('0x6'));var Vertices=require(_0x9ca0('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9ca0('0x8')]=_[_0x9ca0('0x9')](config[_0x9ca0('0x8')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x18d6c5){process[_0x9ca0('0xa')](function(){syncho(function(){try{setChannelVariables(_0x18d6c5);agiHandler(_0x18d6c5);}catch(_0x59e407){logger['error'](_0x59e407[_0x9ca0('0xb')]);}});});}function listeningHandler(){console[_0x9ca0('0xc')](_0x9ca0('0xd'),config[_0x9ca0('0x8')]['port']);logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')](_0x9ca0('0x10'),config[_0x9ca0('0x8')]['ip'],config[_0x9ca0('0x8')][_0x9ca0('0x11')]));}function errorHandler(_0xfdb490){if(_0xfdb490&&_0xfdb490[_0x9ca0('0x12')]&&_0xfdb490['message']){logger['error'](util[_0x9ca0('0xf')](_0x9ca0('0x13'),_0xfdb490[_0x9ca0('0x12')],_0xfdb490[_0x9ca0('0x14')]));}else{logger[_0x9ca0('0x15')](util[_0x9ca0('0xf')](_0x9ca0('0x16'),_0xfdb490[_0x9ca0('0xb')]));}}function closeHandler(){logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9ca0('0x17')],this[_0x9ca0('0x18')],this[_0x9ca0('0x19')],this[_0x9ca0('0x1a')],this[_0x9ca0('0x1b')]));try{createSquareReport(this);}catch(_0x24092e){logger['error'](_0x24092e[_0x9ca0('0xb')]);}}function timeoutHandler(){logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')](_0x9ca0('0x1c'),this[_0x9ca0('0x17')],this[_0x9ca0('0x18')],this['callerid'],this[_0x9ca0('0x1a')],this[_0x9ca0('0x1b')]));}function hangupHandler(){logger['info'](util[_0x9ca0('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9ca0('0x17')],this[_0x9ca0('0x18')],this[_0x9ca0('0x19')],this[_0x9ca0('0x1a')],this[_0x9ca0('0x1b')]));this[_0x9ca0('0x1d')]=!![];}function getRoot(_0x348cc1){return parser['toJson'](_0x348cc1,{'object':!![]})[_0x9ca0('0x1e')][_0x9ca0('0x1f')];}function addVertex(_0x27a722,_0x22fb4c,_0x411c6d){_0x22fb4c[_0x9ca0('0x20')]=_0x411c6d;if(_0x22fb4c[_0x9ca0('0x21')](_0x9ca0('0x22'))){_0x22fb4c[_0x9ca0('0x23')]=parseInt(_0x22fb4c['retry'],0xa);}_0x27a722['addVertex'](_[_0x9ca0('0x24')](_0x22fb4c,_0x9ca0('0x25')));}function initGraph(_0x17b4a3,_0x5193a3){var _0xd889=new Graph();for(var _0x582782 in _0x17b4a3){if(_0x17b4a3['hasOwnProperty'](_0x582782)){if(_[_0x9ca0('0x26')](_0x17b4a3[_0x582782])){for(var _0x8f761d=0x0;_0x8f761d<_0x17b4a3[_0x582782]['length'];_0x8f761d+=0x1){addVertex(_0xd889,_0x17b4a3[_0x582782][_0x8f761d],_0x582782);}}else{addVertex(_0xd889,_0x17b4a3[_0x582782],_0x582782);}}}for(var _0x6c870f=0x0;_0x6c870f<_0x5193a3['length'];_0x6c870f+=0x1){if(_0x5193a3[_0x6c870f][_0x9ca0('0x27')]&&_0x5193a3[_0x6c870f]['target']){_0xd889[_0x9ca0('0x28')](_0x5193a3[_0x6c870f][_0x9ca0('0x27')],_0x5193a3[_0x6c870f]['target'],_0x5193a3[_0x6c870f][_0x9ca0('0x29')]);}}return _0xd889;}function getSquareProject(_0x1f86a2,_0x5cdedd){rpc[_0x9ca0('0x2a')](_0x1f86a2)[_0x9ca0('0x2b')](function(_0x2429b2){_0x5cdedd(null,_0x2429b2);})[_0x9ca0('0x2c')](function(_0x286e97){_0x5cdedd(null,_0x286e97);});}function createSquareReport(_0x56dea4,_0x274861){rpc[_0x9ca0('0x2d')](_0x56dea4)[_0x9ca0('0x2b')](function(_0x39839d){if(_0x274861){_0x274861(null,_0x39839d);}})[_0x9ca0('0x2c')](function(_0x5bfd01){if(_0x274861){_0x274861(null,_0x5bfd01);}});}function setChannelVariables(_0x4f2b32){for(var _0x12ddc3 in _0x4f2b32){if(_0x4f2b32[_0x9ca0('0x21')](_0x12ddc3)){if(_0x12ddc3[_0x9ca0('0x2e')]('agi_')===0x0){_0x4f2b32[_0x12ddc3[_0x9ca0('0x2f')](0x4)]=_0x4f2b32[_0x12ddc3];delete _0x4f2b32[_0x12ddc3];}}}}function getLogFromObject(_0x3ee703){return util[_0x9ca0('0x30')](_0x3ee703,{'showHidden':![],'depth':null});}function agiHandler(_0x8b0e3){var _0x2840e4,_0x3dde79,_0x376a39,_0x56223d,_0x324327;logger[_0x9ca0('0x31')](_0x9ca0('0x32'),JSON[_0x9ca0('0x33')](_0x8b0e3,null,0x2));logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')](_0x9ca0('0x34'),_0x8b0e3[_0x9ca0('0x17')],_0x8b0e3[_0x9ca0('0x18')],_0x8b0e3[_0x9ca0('0x19')],_0x8b0e3[_0x9ca0('0x1a')],_0x8b0e3['uniqueid']));_0x8b0e3['on'](_0x9ca0('0x15'),errorHandler);_0x8b0e3['on'](_0x9ca0('0x35'),closeHandler);_0x8b0e3['on'](_0x9ca0('0x36'),timeoutHandler);_0x8b0e3[_0x9ca0('0x1d')]=![];_0x8b0e3['on'](_0x9ca0('0x37'),hangupHandler);var _0x13c105=getSquareProject[_0x9ca0('0x38')](null,_0x8b0e3['arg_1']);if(_0x13c105){if(_0x13c105[_0x9ca0('0x39')]){_0x2840e4=getRoot(_0x13c105[_0x9ca0('0x39')]);if(_0x2840e4&&_0x2840e4[_0x9ca0('0x3a')]){logger[_0x9ca0('0x31')](_0x9ca0('0x1f'),JSON[_0x9ca0('0x33')](_0x2840e4,null,0x2));_0x8b0e3[_0x9ca0('0x3b')]=moment()['format'](_0x9ca0('0x3c'));_0x3dde79=initGraph(_[_0x9ca0('0x24')](_0x2840e4,_0x9ca0('0x25')),_0x2840e4[_0x9ca0('0x25')]);_0x376a39=new Vertices(_0x8b0e3,rpc,mailRpc);logger['info'](util['format'](_0x9ca0('0x3d'),_0x8b0e3[_0x9ca0('0x17')],_0x8b0e3['calleridname'],_0x8b0e3[_0x9ca0('0x19')],_0x8b0e3[_0x9ca0('0x1a')],_0x8b0e3['uniqueid']));_0x3dde79[_0x9ca0('0x3e')](_0x2840e4['start']['id'],function(_0x31b024){try{_0x31b024=_0x376a39['clear'](_0x31b024);logger[_0x9ca0('0x31')](_0x9ca0('0x3f'),JSON[_0x9ca0('0x33')](_0x31b024,null,0x2));if(_0x31b024[_0x9ca0('0x20')]===_0x9ca0('0x40')){logger[_0x9ca0('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x8b0e3[_0x9ca0('0x41')]=_0x31b024[_0x9ca0('0x41')]||_0x8b0e3[_0x9ca0('0x41')];_0x8b0e3[_0x9ca0('0x42')]=_0x31b024[_0x9ca0('0x42')];_0x8b0e3['priority']=_0x31b024[_0x9ca0('0x43')]?_0x31b024[_0x9ca0('0x43')]-0x1:0x1;return null;}else if(_0x31b024&&_0x376a39[_0x31b024[_0x9ca0('0x20')]]){_0x324327=_0x376a39[_0x31b024['agicommand']](_0x31b024);logger[_0x9ca0('0xe')](_0x9ca0('0x44'),JSON[_0x9ca0('0x33')](_0x324327,null,0x2));if(_0x324327&&_0x324327[_0x9ca0('0x45')]===AGI_CODE_SUCCESS&&_0x324327[_0x9ca0('0x46')]!==AGI_RESULT_ERROR&&!_0x8b0e3[_0x9ca0('0x1d')]){logger['debug'](_0x9ca0('0x44'),getLogFromObject(_0x324327));return _[_0x9ca0('0x47')](_0x324327[_0x9ca0('0x46')])?null:_0x324327[_0x9ca0('0x46')][_0x9ca0('0x48')]();}else{logger['error'](_0x9ca0('0x44'),getLogFromObject(_0x324327));return null;}}else{logger[_0x9ca0('0x15')](_0x9ca0('0x49'));return null;}}catch(_0xddf79e){logger[_0x9ca0('0x15')](_0xddf79e[_0x9ca0('0xb')]);return null;}});if(_0x2840e4[_0x9ca0('0x4a')]){logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x8b0e3[_0x9ca0('0x17')],_0x8b0e3[_0x9ca0('0x18')],_0x8b0e3[_0x9ca0('0x19')],_0x8b0e3[_0x9ca0('0x1a')],_0x8b0e3[_0x9ca0('0x1b')]));_0x3dde79['traverseBFS'](_0x2840e4[_0x9ca0('0x4a')]['id'],function(_0x52f340){try{_0x52f340=_0x376a39['clear'](_0x52f340);logger['debug'](_0x9ca0('0x3f'),JSON[_0x9ca0('0x33')](_0x52f340,null,0x2));if(_0x52f340&&_0x376a39[_0x52f340[_0x9ca0('0x20')]]){_0x324327=_0x376a39[_0x52f340[_0x9ca0('0x20')]](_0x52f340);if(_0x324327){logger[_0x9ca0('0x31')](_0x9ca0('0x44'),getLogFromObject(_0x324327));return _[_0x9ca0('0x47')](_0x324327[_0x9ca0('0x46')])?null:_0x324327['result'][_0x9ca0('0x48')]();}else{logger[_0x9ca0('0x15')](_0x9ca0('0x44'),getLogFromObject(_0x324327));return null;}}else{logger[_0x9ca0('0x15')](_0x9ca0('0x49'));return null;}}catch(_0x41f7a7){logger[_0x9ca0('0x15')](_0x41f7a7['stack']);return null;}});}logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')](_0x9ca0('0x4b'),_0x8b0e3[_0x9ca0('0x17')],_0x8b0e3['calleridname'],_0x8b0e3[_0x9ca0('0x19')],_0x8b0e3[_0x9ca0('0x1a')],_0x8b0e3['uniqueid']));logger[_0x9ca0('0xe')](util[_0x9ca0('0xf')](_0x9ca0('0x4c'),_0x8b0e3[_0x9ca0('0x41')],_0x8b0e3[_0x9ca0('0x42')],parseInt(_0x8b0e3[_0x9ca0('0x43')],0xa)+0x1));_0x8b0e3[_0x9ca0('0x4d')](_0x8b0e3['context'],_0x8b0e3[_0x9ca0('0x42')],parseInt(_0x8b0e3[_0x9ca0('0x43')],0xa)+0x1);_0x8b0e3[_0x9ca0('0x35')]();}}else{logger[_0x9ca0('0x15')](util[_0x9ca0('0xf')](_0x9ca0('0x4e'),_0x8b0e3['arg_1']));_0x8b0e3[_0x9ca0('0x4d')](_0x8b0e3['context'],_0x8b0e3[_0x9ca0('0x42')],parseInt(_0x8b0e3[_0x9ca0('0x43')],0xa)+0x1);_0x8b0e3[_0x9ca0('0x35')]();}}else{logger[_0x9ca0('0x15')](util[_0x9ca0('0xf')]('Project\x20%s\x20not\x20found',_0x8b0e3[_0x9ca0('0x17')]));_0x8b0e3['continueAt'](_0x8b0e3['context'],_0x8b0e3['extension'],parseInt(_0x8b0e3['priority'],0xa)+0x1);_0x8b0e3[_0x9ca0('0x35')]();}}function main(){var _0x391632;return utilLicense[_0x9ca0('0x4f')]()[_0x9ca0('0x2b')](function(_0x199798){if(_0x199798){if(_0x199798[_0x9ca0('0x50')]){if(_0x199798[_0x9ca0('0x51')]&&_0x199798[_0x9ca0('0x51')]>0x0){logger['info'](util[_0x9ca0('0xf')](_0x9ca0('0x52'),_0x199798[_0x9ca0('0x51')]));_0x391632=_0x199798[_0x9ca0('0x51')];}else{logger[_0x9ca0('0xe')](_0x9ca0('0x53'));}}else{logger[_0x9ca0('0xe')](_0x9ca0('0x54'));_0x391632=-0x1;}}})[_0x9ca0('0x2c')](function(_0xf8073c){logger[_0x9ca0('0x15')]('[LICENSE]',_0xf8073c[_0x9ca0('0xb')]);})[_0x9ca0('0x4a')](function(){var _0x56c89b=require(_0x9ca0('0x55'))(config[_0x9ca0('0x8')][_0x9ca0('0x11')],config[_0x9ca0('0x8')]['ip'],_0x391632);_0x56c89b['on']('error',errorHandler);_0x56c89b['on'](_0x9ca0('0x56'),listeningHandler);_0x56c89b['on'](_0x9ca0('0x57'),connectionHandler);_0x56c89b['on'](_0x9ca0('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0xda7a=['source','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','extension','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','moment','../../config/environment','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','error','[%s]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','mxCell','isArray','length','target','addEdge'];(function(_0x4a8440,_0x3ab425){var _0xc11147=function(_0x210804){while(--_0x210804){_0x4a8440['push'](_0x4a8440['shift']());}};_0xc11147(++_0x3ab425);}(_0xda7a,0x8f));var _0xada7=function(_0x33e06c,_0x4f9475){_0x33e06c=_0x33e06c-0x0;var _0xc987e8=_0xda7a[_0x33e06c];return _0xc987e8;};'use strict';var parser=require(_0xada7('0x0'));var _=require(_0xada7('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0xada7('0x2'));var config=require(_0xada7('0x3'));var logger=require('../../config/logger')(_0xada7('0x4'));var utilLicense=require(_0xada7('0x5'));var rpc=require('./rpc');var mailRpc=require(_0xada7('0x6'));var Graph=require(_0xada7('0x7'));var Vertices=require(_0xada7('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xada7('0x4')]=_[_0xada7('0x9')](config[_0xada7('0x4')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x1f67e1){process[_0xada7('0xa')](function(){syncho(function(){try{setChannelVariables(_0x1f67e1);agiHandler(_0x1f67e1);}catch(_0x5e764e){logger['error'](_0x5e764e['stack']);}});});}function listeningHandler(){console[_0xada7('0xb')](_0xada7('0xc'),config[_0xada7('0x4')]['port']);logger[_0xada7('0xd')](util['format'](_0xada7('0xe'),config[_0xada7('0x4')]['ip'],config[_0xada7('0x4')][_0xada7('0xf')]));}function errorHandler(_0x2fef1f){if(_0x2fef1f&&_0x2fef1f[_0xada7('0x10')]&&_0x2fef1f[_0xada7('0x11')]){logger[_0xada7('0x12')](util['format'](_0xada7('0x13'),_0x2fef1f[_0xada7('0x10')],_0x2fef1f[_0xada7('0x11')]));}else{logger[_0xada7('0x12')](util['format']('[ERROR]\x20%s',_0x2fef1f[_0xada7('0x14')]));}}function closeHandler(){logger['info'](util['format'](_0xada7('0x15'),this[_0xada7('0x16')],this['calleridname'],this[_0xada7('0x17')],this[_0xada7('0x18')],this[_0xada7('0x19')]));try{createSquareReport(this);}catch(_0x2e0384){logger[_0xada7('0x12')](_0x2e0384['stack']);}}function timeoutHandler(){logger[_0xada7('0xd')](util['format'](_0xada7('0x1a'),this['arg_1'],this[_0xada7('0x1b')],this['callerid'],this[_0xada7('0x18')],this[_0xada7('0x19')]));}function hangupHandler(){logger[_0xada7('0xd')](util['format'](_0xada7('0x1c'),this[_0xada7('0x16')],this[_0xada7('0x1b')],this[_0xada7('0x17')],this[_0xada7('0x18')],this[_0xada7('0x19')]));this[_0xada7('0x1d')]=!![];}function getRoot(_0x2a3d79){return parser[_0xada7('0x1e')](_0x2a3d79,{'object':!![]})['mxGraphModel'][_0xada7('0x1f')];}function addVertex(_0x280d6c,_0xea634,_0x40a608){_0xea634[_0xada7('0x20')]=_0x40a608;if(_0xea634[_0xada7('0x21')](_0xada7('0x22'))){_0xea634[_0xada7('0x23')]=parseInt(_0xea634[_0xada7('0x22')],0xa);}_0x280d6c['addVertex'](_['omit'](_0xea634,_0xada7('0x24')));}function initGraph(_0x3ed3f3,_0x1a6058){var _0x1a8a7d=new Graph();for(var _0x399d0c in _0x3ed3f3){if(_0x3ed3f3[_0xada7('0x21')](_0x399d0c)){if(_[_0xada7('0x25')](_0x3ed3f3[_0x399d0c])){for(var _0x10d8c0=0x0;_0x10d8c0<_0x3ed3f3[_0x399d0c][_0xada7('0x26')];_0x10d8c0+=0x1){addVertex(_0x1a8a7d,_0x3ed3f3[_0x399d0c][_0x10d8c0],_0x399d0c);}}else{addVertex(_0x1a8a7d,_0x3ed3f3[_0x399d0c],_0x399d0c);}}}for(var _0x3d9d8b=0x0;_0x3d9d8b<_0x1a6058['length'];_0x3d9d8b+=0x1){if(_0x1a6058[_0x3d9d8b]['source']&&_0x1a6058[_0x3d9d8b][_0xada7('0x27')]){_0x1a8a7d[_0xada7('0x28')](_0x1a6058[_0x3d9d8b][_0xada7('0x29')],_0x1a6058[_0x3d9d8b][_0xada7('0x27')],_0x1a6058[_0x3d9d8b][_0xada7('0x2a')]);}}return _0x1a8a7d;}function getSquareProject(_0x4cf0d4,_0x3a33ce){rpc[_0xada7('0x2b')](_0x4cf0d4)[_0xada7('0x2c')](function(_0x2191dd){_0x3a33ce(null,_0x2191dd);})['catch'](function(_0x24fb31){_0x3a33ce(null,_0x24fb31);});}function createSquareReport(_0x1f9c6c,_0x512fee){rpc[_0xada7('0x2d')](_0x1f9c6c)[_0xada7('0x2c')](function(_0x4828be){if(_0x512fee){_0x512fee(null,_0x4828be);}})[_0xada7('0x2e')](function(_0x1b02a7){if(_0x512fee){_0x512fee(null,_0x1b02a7);}});}function setChannelVariables(_0xb361b2){for(var _0x455c12 in _0xb361b2){if(_0xb361b2['hasOwnProperty'](_0x455c12)){if(_0x455c12[_0xada7('0x2f')](_0xada7('0x30'))===0x0){_0xb361b2[_0x455c12[_0xada7('0x31')](0x4)]=_0xb361b2[_0x455c12];delete _0xb361b2[_0x455c12];}}}}function getLogFromObject(_0x5ee0f0){return util[_0xada7('0x32')](_0x5ee0f0,{'showHidden':![],'depth':null});}function agiHandler(_0xa80cc){var _0x11483d,_0x2ce9d9,_0x2b0e84,_0x5561b6,_0x5b8b38;logger[_0xada7('0x33')](_0xada7('0x34'),JSON[_0xada7('0x35')](_0xa80cc,null,0x2));logger['info'](util['format'](_0xada7('0x36'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc['dnid'],_0xa80cc[_0xada7('0x19')]));_0xa80cc['on'](_0xada7('0x12'),errorHandler);_0xa80cc['on'](_0xada7('0x37'),closeHandler);_0xa80cc['on'](_0xada7('0x38'),timeoutHandler);_0xa80cc[_0xada7('0x1d')]=![];_0xa80cc['on'](_0xada7('0x39'),hangupHandler);var _0x1a044e=getSquareProject['sync'](null,_0xa80cc['arg_1']);if(_0x1a044e){if(_0x1a044e[_0xada7('0x3a')]){_0x11483d=getRoot(_0x1a044e[_0xada7('0x3a')]);if(_0x11483d&&_0x11483d[_0xada7('0x3b')]){logger[_0xada7('0x33')](_0xada7('0x1f'),JSON[_0xada7('0x35')](_0x11483d,null,0x2));_0xa80cc[_0xada7('0x3c')]=moment()[_0xada7('0x3d')](_0xada7('0x3e'));_0x2ce9d9=initGraph(_[_0xada7('0x3f')](_0x11483d,'mxCell'),_0x11483d[_0xada7('0x24')]);_0x2b0e84=new Vertices(_0xa80cc,rpc,mailRpc);logger[_0xada7('0xd')](util[_0xada7('0x3d')](_0xada7('0x40'),_0xa80cc['arg_1'],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc[_0xada7('0x18')],_0xa80cc[_0xada7('0x19')]));_0x2ce9d9[_0xada7('0x41')](_0x11483d[_0xada7('0x3b')]['id'],function(_0x109097){try{_0x109097=_0x2b0e84[_0xada7('0x42')](_0x109097);logger[_0xada7('0x33')](_0xada7('0x43'),JSON['stringify'](_0x109097,null,0x2));if(_0x109097['agicommand']==='gotoc'){logger[_0xada7('0xd')](_0xada7('0x44'));_0xa80cc['context']=_0x109097[_0xada7('0x45')]||_0xa80cc[_0xada7('0x45')];_0xa80cc['extension']=_0x109097['extension'];_0xa80cc[_0xada7('0x46')]=_0x109097['priority']?_0x109097[_0xada7('0x46')]-0x1:0x1;return null;}else if(_0x109097&&_0x2b0e84[_0x109097['agicommand']]){_0x5b8b38=_0x2b0e84[_0x109097[_0xada7('0x20')]](_0x109097);logger[_0xada7('0xd')](_0xada7('0x47'),JSON['stringify'](_0x5b8b38,null,0x2));if(_0x5b8b38&&_0x5b8b38['code']===AGI_CODE_SUCCESS&&_0x5b8b38[_0xada7('0x48')]!==AGI_RESULT_ERROR&&!_0xa80cc[_0xada7('0x1d')]){logger[_0xada7('0x33')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return _[_0xada7('0x49')](_0x5b8b38[_0xada7('0x48')])?null:_0x5b8b38[_0xada7('0x48')][_0xada7('0x4a')]();}else{logger[_0xada7('0x12')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x187ccd){logger[_0xada7('0x12')](_0x187ccd['stack']);return null;}});if(_0x11483d[_0xada7('0x4b')]){logger[_0xada7('0xd')](util[_0xada7('0x3d')](_0xada7('0x4c'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc['callerid'],_0xa80cc['dnid'],_0xa80cc[_0xada7('0x19')]));_0x2ce9d9[_0xada7('0x41')](_0x11483d['finally']['id'],function(_0x1b72cf){try{_0x1b72cf=_0x2b0e84['clear'](_0x1b72cf);logger[_0xada7('0x33')](_0xada7('0x43'),JSON['stringify'](_0x1b72cf,null,0x2));if(_0x1b72cf&&_0x2b0e84[_0x1b72cf['agicommand']]){_0x5b8b38=_0x2b0e84[_0x1b72cf[_0xada7('0x20')]](_0x1b72cf);if(_0x5b8b38){logger[_0xada7('0x33')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return _[_0xada7('0x49')](_0x5b8b38[_0xada7('0x48')])?null:_0x5b8b38[_0xada7('0x48')][_0xada7('0x4a')]();}else{logger['error'](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return null;}}else{logger[_0xada7('0x12')](_0xada7('0x4d'));return null;}}catch(_0x3db81f){logger[_0xada7('0x12')](_0x3db81f[_0xada7('0x14')]);return null;}});}logger['info'](util[_0xada7('0x3d')](_0xada7('0x4e'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc[_0xada7('0x18')],_0xa80cc[_0xada7('0x19')]));logger['info'](util[_0xada7('0x3d')](_0xada7('0x4f'),_0xa80cc['context'],_0xa80cc['extension'],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1));_0xa80cc[_0xada7('0x50')](_0xa80cc['context'],_0xa80cc[_0xada7('0x51')],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc['close']();}}else{logger[_0xada7('0x12')](util[_0xada7('0x3d')](_0xada7('0x52'),_0xa80cc[_0xada7('0x16')]));_0xa80cc[_0xada7('0x50')](_0xa80cc[_0xada7('0x45')],_0xa80cc['extension'],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc[_0xada7('0x37')]();}}else{logger[_0xada7('0x12')](util[_0xada7('0x3d')]('Project\x20%s\x20not\x20found',_0xa80cc['arg_1']));_0xa80cc[_0xada7('0x50')](_0xa80cc['context'],_0xa80cc[_0xada7('0x51')],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc[_0xada7('0x37')]();}}function main(){var _0x171326;return utilLicense[_0xada7('0x53')]()[_0xada7('0x2c')](function(_0x9f6194){if(_0x9f6194){if(_0x9f6194[_0xada7('0x54')]){if(_0x9f6194['callysquare']&&_0x9f6194[_0xada7('0x55')]>0x0){logger['info'](util[_0xada7('0x3d')](_0xada7('0x56'),_0x9f6194[_0xada7('0x55')]));_0x171326=_0x9f6194[_0xada7('0x55')];}else{logger[_0xada7('0xd')](_0xada7('0x57'));}}else{logger[_0xada7('0xd')](_0xada7('0x58'));_0x171326=-0x1;}}})[_0xada7('0x2e')](function(_0x1aa548){logger[_0xada7('0x12')](_0xada7('0x59'),_0x1aa548[_0xada7('0x14')]);})[_0xada7('0x4b')](function(){var _0x891b16=require(_0xada7('0x5a'))(config[_0xada7('0x4')][_0xada7('0xf')],config[_0xada7('0x4')]['ip'],_0x171326);_0x891b16['on']('error',errorHandler);_0x891b16['on'](_0xada7('0x5b'),listeningHandler);_0x891b16['on']('connection',connectionHandler);_0x891b16['on'](_0xada7('0x37'),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 abace5d..14cd2b5 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 _0xedc5=['http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xedc5,0x8c));var _0x5edc=function(_0x3dc6f4,_0x362e2a){_0x3dc6f4=_0x3dc6f4-0x0;var _0x3b18e9=_0xedc5[_0x3dc6f4];return _0x3b18e9;};'use strict';var BPromise=require(_0x5edc('0x0'));var jayson=require(_0x5edc('0x1'));var client=jayson[_0x5edc('0x2')][_0x5edc('0x3')]({'port':0x232b});function request(_0x68afe1,_0x2efa54){return new BPromise(function(_0x17ca92,_0x631e0a){return client[_0x5edc('0x4')](_0x68afe1,_0x2efa54)[_0x5edc('0x5')](function(_0x1bc44d){if(_0x1bc44d[_0x5edc('0x6')]){return _0x631e0a(_0x1bc44d[_0x5edc('0x6')]['message']);}else{return _0x17ca92(_0x1bc44d[_0x5edc('0x7')]);}})[_0x5edc('0x8')](function(_0xdcad49){return _0x631e0a(_0xdcad49);});});}exports[_0x5edc('0x9')]=function(_0x1a4c8c,_0x22a3bd){return request(_0x5edc('0xa'),{'account':_0x1a4c8c,'message':_0x22a3bd});}; \ No newline at end of file +var _0x4083=['request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x1987f3,_0x39f746){var _0x272441=function(_0x485997){while(--_0x485997){_0x1987f3['push'](_0x1987f3['shift']());}};_0x272441(++_0x39f746);}(_0x4083,0x7f));var _0x3408=function(_0x556f76,_0x16b700){_0x556f76=_0x556f76-0x0;var _0x6cec33=_0x4083[_0x556f76];return _0x6cec33;};'use strict';var BPromise=require(_0x3408('0x0'));var jayson=require(_0x3408('0x1'));var client=jayson['client'][_0x3408('0x2')]({'port':0x232b});function request(_0x48791b,_0x4b6be5){return new BPromise(function(_0x2dc7a4,_0x1057a4){return client[_0x3408('0x3')](_0x48791b,_0x4b6be5)[_0x3408('0x4')](function(_0x173944){if(_0x173944['error']){return _0x1057a4(_0x173944[_0x3408('0x5')][_0x3408('0x6')]);}else{return _0x2dc7a4(_0x173944['result']);}})[_0x3408('0x7')](function(_0x4f7ca5){return _0x1057a4(_0x4f7ca5);});});}exports[_0x3408('0x8')]=function(_0x10b0c9,_0x5ed50b){return request(_0x3408('0x9'),{'account':_0x10b0c9,'message':_0x5ed50b});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 581d34a..7a15a20 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 _0x162a=['_transform','_localBuffer','substring','length','indexOf','slice','trim','emit','line','exports','util','stream','Transform','call','_inBody','inherits','prototype'];(function(_0x25873d,_0x2200af){var _0x383f7c=function(_0x3aecca){while(--_0x3aecca){_0x25873d['push'](_0x25873d['shift']());}};_0x383f7c(++_0x2200af);}(_0x162a,0x180));var _0xa162=function(_0x34d22a,_0x441d18){_0x34d22a=_0x34d22a-0x0;var _0x1bd7d8=_0x162a[_0x34d22a];return _0x1bd7d8;};'use strict';var util=require(_0xa162('0x0'));var Transform=require(_0xa162('0x1'))[_0xa162('0x2')];function AGIReply(_0x3d5f30){Transform[_0xa162('0x3')](this,_0x3d5f30);this['_localBuffer']='';this[_0xa162('0x4')]=![];}util[_0xa162('0x5')](AGIReply,Transform);AGIReply[_0xa162('0x6')][_0xa162('0x7')]=function(_0x46e36d,_0x3d3de2,_0x2af0e9){var _0x5cd2cb='\x0a',_0x4e88e1=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x51682a=-0x1,_0x40b367=-0x1,_0x458145='',_0xc35062=0x0,_0x55dc88='',_0x211c2a='';this['_localBuffer']+=_0x46e36d['toString']();_0x55dc88=this[_0xa162('0x8')];if(!this[_0xa162('0x4')]){_0xc35062=0x0;while(_0x4e88e1[_0xc35062]){while((_0x40b367=_0x55dc88['indexOf'](_0x4e88e1[_0xc35062]))!=-0x1){_0x458145=_0x4e88e1[_0xc35062];_0x211c2a=_0x55dc88[_0xa162('0x9')](0x0,_0x40b367);_0x55dc88=_0x55dc88['substring'](_0x40b367+_0x458145[_0xa162('0xa')]);var _0x2d3787=_0x211c2a['split'](_0x5cd2cb),_0x2959d3=0x0,_0x4d7be0={},_0x46f856='',_0x1331e3='',_0x3481ea=-0x1;while(_0x2d3787[_0x2959d3]){_0x3481ea=_0x2d3787[_0x2959d3][_0xa162('0xb')](':');if(_0x3481ea!=-0x1){_0x46f856=_0x2d3787[_0x2959d3][_0xa162('0xc')](0x0,_0x3481ea)[_0xa162('0xd')]();_0x1331e3=_0x2d3787[_0x2959d3][_0xa162('0xc')](_0x3481ea+0x1)[_0xa162('0xd')]();if(_0x46f856[_0xa162('0xa')]>0x0){_0x4d7be0[_0x46f856]=_0x1331e3;}}else{}_0x2959d3++;}this[_0xa162('0xe')]('headers',_0x4d7be0);this[_0xa162('0x4')]=!![];}_0xc35062++;}this['_localBuffer']=_0x55dc88;}else{while((_0x51682a=_0x55dc88[_0xa162('0xb')](_0x5cd2cb))!=-0x1){_0x211c2a=_0x55dc88[_0xa162('0x9')](0x0,_0x51682a);this[_0xa162('0xe')](_0xa162('0xf'),_0x211c2a);_0x55dc88=_0x55dc88[_0xa162('0x9')](_0x51682a+_0x5cd2cb['length']);}this['_localBuffer']=_0x55dc88;}_0x2af0e9();};module[_0xa162('0x10')]=AGIReply; \ No newline at end of file +var _0x9acc=['\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','trim','slice','emit','line','exports','util','stream','Transform','call','_localBuffer','inherits','_transform'];(function(_0x29a3df,_0x442bf5){var _0x5793f7=function(_0x133c8d){while(--_0x133c8d){_0x29a3df['push'](_0x29a3df['shift']());}};_0x5793f7(++_0x442bf5);}(_0x9acc,0x175));var _0xc9ac=function(_0x2a9235,_0x20010d){_0x2a9235=_0x2a9235-0x0;var _0x2c6fa2=_0x9acc[_0x2a9235];return _0x2c6fa2;};'use strict';var util=require(_0xc9ac('0x0'));var Transform=require(_0xc9ac('0x1'))[_0xc9ac('0x2')];function AGIReply(_0xfc9284){Transform[_0xc9ac('0x3')](this,_0xfc9284);this[_0xc9ac('0x4')]='';this['_inBody']=![];}util[_0xc9ac('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xc9ac('0x6')]=function(_0x59cd56,_0x1f2766,_0x113ac3){var _0x3caf33='\x0a',_0x1c8307=['\x0a\x0a',_0xc9ac('0x7')],_0x212dcc=-0x1,_0x391c03=-0x1,_0x387423='',_0x1d552a=0x0,_0x1b56b8='',_0x19ecd9='';this[_0xc9ac('0x4')]+=_0x59cd56[_0xc9ac('0x8')]();_0x1b56b8=this[_0xc9ac('0x4')];if(!this[_0xc9ac('0x9')]){_0x1d552a=0x0;while(_0x1c8307[_0x1d552a]){while((_0x391c03=_0x1b56b8[_0xc9ac('0xa')](_0x1c8307[_0x1d552a]))!=-0x1){_0x387423=_0x1c8307[_0x1d552a];_0x19ecd9=_0x1b56b8[_0xc9ac('0xb')](0x0,_0x391c03);_0x1b56b8=_0x1b56b8[_0xc9ac('0xb')](_0x391c03+_0x387423[_0xc9ac('0xc')]);var _0x7c4771=_0x19ecd9[_0xc9ac('0xd')](_0x3caf33),_0x559552=0x0,_0x41a719={},_0x108d80='',_0x5b1334='',_0x113881=-0x1;while(_0x7c4771[_0x559552]){_0x113881=_0x7c4771[_0x559552][_0xc9ac('0xa')](':');if(_0x113881!=-0x1){_0x108d80=_0x7c4771[_0x559552]['slice'](0x0,_0x113881)[_0xc9ac('0xe')]();_0x5b1334=_0x7c4771[_0x559552][_0xc9ac('0xf')](_0x113881+0x1)['trim']();if(_0x108d80[_0xc9ac('0xc')]>0x0){_0x41a719[_0x108d80]=_0x5b1334;}}else{}_0x559552++;}this[_0xc9ac('0x10')]('headers',_0x41a719);this[_0xc9ac('0x9')]=!![];}_0x1d552a++;}this[_0xc9ac('0x4')]=_0x1b56b8;}else{while((_0x212dcc=_0x1b56b8[_0xc9ac('0xa')](_0x3caf33))!=-0x1){_0x19ecd9=_0x1b56b8[_0xc9ac('0xb')](0x0,_0x212dcc);this[_0xc9ac('0x10')](_0xc9ac('0x11'),_0x19ecd9);_0x1b56b8=_0x1b56b8[_0xc9ac('0xb')](_0x212dcc+_0x3caf33[_0xc9ac('0xc')]);}this['_localBuffer']=_0x1b56b8;}_0x113ac3();};module[_0xc9ac('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index bd9f89f..ec57d94 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 _0xa574=['error','message','catch','getSquareProject','production','ShowMailAccount','Smtp','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','name','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getIntervalById','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','jayson/promise','client','http','request','then'];(function(_0x2131a5,_0x5cc5ed){var _0x12bf1b=function(_0x338290){while(--_0x338290){_0x2131a5['push'](_0x2131a5['shift']());}};_0x12bf1b(++_0x5cc5ed);}(_0xa574,0x1cd));var _0x4a57=function(_0x1224d7,_0x2f1463){_0x1224d7=_0x1224d7-0x0;var _0x5f25f0=_0xa574[_0x1224d7];return _0x5f25f0;};'use strict';var BPromise=require(_0x4a57('0x0'));var moment=require(_0x4a57('0x1'));var _=require('lodash');var util=require('util');var jayson=require(_0x4a57('0x2'));var client=jayson[_0x4a57('0x3')][_0x4a57('0x4')]({'port':0x2329});function request(_0x1245a1,_0x38c4e7){return new BPromise(function(_0x5185a8,_0x1d0741){return client[_0x4a57('0x5')](_0x1245a1,_0x38c4e7)[_0x4a57('0x6')](function(_0x4dd245){if(_0x4dd245[_0x4a57('0x7')]){return _0x1d0741(_0x4dd245[_0x4a57('0x7')][_0x4a57('0x8')]);}else{return _0x5185a8(_0x4dd245['result']);}})[_0x4a57('0x9')](function(_0x162617){return _0x1d0741(_0x162617);});});}exports[_0x4a57('0xa')]=function(_0x1963a8){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1963a8},'attributes':[_0x4a57('0xb')]}});};exports['getMailAccountById']=function(_0x149359){return request(_0x4a57('0xc'),{'options':{'raw':![],'where':{'id':_0x149359},'include':[{'model':'MailServerOut','as':_0x4a57('0xd')}],'attributes':['id','name','email']}});};exports[_0x4a57('0xe')]=function(_0x3f8756){return request('ShowSquareProject',{'options':{'where':{'id':_0x3f8756},'attributes':['name']}});};exports[_0x4a57('0xf')]=function(_0x5b1265){return request(_0x4a57('0x10'),{'options':{'where':{'id':_0x5b1265},'attributes':[_0x4a57('0x11')]}});};exports[_0x4a57('0x12')]=function(_0x1d9578){return request(_0x4a57('0x13'),{'options':{'where':{'id':_0x1d9578},'attributes':[_0x4a57('0x11')]}});};exports['getSquareOdbcById']=function(_0x4bb846){return request(_0x4a57('0x14'),{'options':{'where':{'id':_0x4bb846},'attributes':[_0x4a57('0x15')]}});};exports[_0x4a57('0x16')]=function(_0x25843c){return request(_0x4a57('0x17'),{'options':{'where':{'id':_0x25843c},'attributes':[_0x4a57('0x11')]}});};exports[_0x4a57('0x18')]=function(_0x277921){return request('ShowTrunk',{'options':{'where':{'id':_0x277921},'attributes':[_0x4a57('0x11')]}});};exports['getSoundById']=function(_0x427941){return request('ShowSound',{'options':{'where':{'id':_0x427941},'attributes':['save_name']}});};exports[_0x4a57('0x19')]=function(_0x32fb3d){return request(_0x4a57('0x1a'),{'options':{'raw':![],'where':{'id':_0x32fb3d},'include':[{'model':'Interval','as':_0x4a57('0x1b')}]}});};exports[_0x4a57('0x1c')]=function(_0x29cffb){return request('ShowSmsAccount',{'options':{'where':{'id':_0x29cffb},'attributes':['id',_0x4a57('0x11')]}});};exports[_0x4a57('0x1d')]=function(_0x447907){return request(_0x4a57('0x1e'),{'body':_0x447907});};exports[_0x4a57('0x1f')]=function(_0xa379b4){return request(_0x4a57('0x20'),{'body':_0xa379b4});};exports[_0x4a57('0x21')]=function(_0xec37c6){return request(_0x4a57('0x22'),{'body':_[_0x4a57('0x23')](_0xec37c6,{'project_name':_0xec37c6[_0x4a57('0x24')],'prev_project_name':_0xec37c6[_0x4a57('0x25')]||'','is_subproject':_0xec37c6[_0x4a57('0x25')]?!![]:![],'leaveAt':moment()[_0x4a57('0x26')](_0x4a57('0x27'))})});};exports['createSquareRecording']=function(_0x169733){return request('CreateSquareRecording',{'body':_0x169733});};exports['createSquareMessage']=function(_0x20cf43){return request(_0x4a57('0x28'),{'body':_0x20cf43});};exports['createCmContact']=function(_0x289579){return request(_0x4a57('0x29'),{'options':{'raw':![],'where':{'phone':_0x289579[_0x4a57('0x2a')],'ListId':_0x289579[_0x4a57('0x2b')]}}})[_0x4a57('0x6')](function(_0x3b0feb){if(_0x3b0feb){return _0x3b0feb;}return request(_0x4a57('0x2c'),{'body':_0x289579});});};exports[_0x4a57('0x2d')]=function(_0x3973fa){return request(_0x4a57('0x2e'),{'options':{'where':{'id':_0x3973fa},'attributes':[_0x4a57('0x11')]}});};exports[_0x4a57('0x2f')]=function(_0x80f520,_0xf5294b){return request(_0x4a57('0x30'),{'body':{'interface':_0xf5294b},'options':{'where':_0x80f520}});};exports['agentPause']=function(_0x3beeb1,_0x47209a,_0x4f545c){return request('PauseUser',{'body':{'type':_0x47209a,'uniqueid':_0x4f545c},'options':{'where':_0x3beeb1}});};exports[_0x4a57('0x31')]=function(_0x597180){return request('UnpauseUser',{'body':{},'options':{'where':_0x597180}});};exports[_0x4a57('0x32')]=function(_0x42640f){return request(_0x4a57('0x33'),{'body':{},'options':{'where':_0x42640f}});}; \ No newline at end of file +var _0x4711=['arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createCmContact','phone','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge'];(function(_0x41ea8e,_0x4e5aae){var _0x3f628a=function(_0xb687d0){while(--_0xb687d0){_0x41ea8e['push'](_0x41ea8e['shift']());}};_0x3f628a(++_0x4e5aae);}(_0x4711,0xe4));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x1471('0x0'));var moment=require(_0x1471('0x1'));var _=require('lodash');var util=require(_0x1471('0x2'));var jayson=require(_0x1471('0x3'));var client=jayson[_0x1471('0x4')][_0x1471('0x5')]({'port':0x2329});function request(_0x550cf1,_0x595c50){return new BPromise(function(_0x45e027,_0x3c972b){return client[_0x1471('0x6')](_0x550cf1,_0x595c50)['then'](function(_0x174c8a){if(_0x174c8a['error']){return _0x3c972b(_0x174c8a['error'][_0x1471('0x7')]);}else{return _0x45e027(_0x174c8a[_0x1471('0x8')]);}})[_0x1471('0x9')](function(_0x3a91dd){return _0x3c972b(_0x3a91dd);});});}exports[_0x1471('0xa')]=function(_0x536b98){return request(_0x1471('0xb'),{'options':{'raw':![],'where':{'name':_0x536b98},'attributes':[_0x1471('0xc')]}});};exports[_0x1471('0xd')]=function(_0x444023){return request(_0x1471('0xe'),{'options':{'raw':![],'where':{'id':_0x444023},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x1471('0xf'),_0x1471('0x10')]}});};exports[_0x1471('0x11')]=function(_0x2f2b14){return request(_0x1471('0xb'),{'options':{'where':{'id':_0x2f2b14},'attributes':[_0x1471('0xf')]}});};exports[_0x1471('0x12')]=function(_0x1b2081){return request(_0x1471('0x13'),{'options':{'where':{'id':_0x1b2081},'attributes':[_0x1471('0xf')]}});};exports[_0x1471('0x14')]=function(_0x19cb60){return request('ShowVariable',{'options':{'where':{'id':_0x19cb60},'attributes':[_0x1471('0xf')]}});};exports['getSquareOdbcById']=function(_0x2aeb6d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2aeb6d},'attributes':[_0x1471('0x15')]}});};exports[_0x1471('0x16')]=function(_0x166a41){return request(_0x1471('0x17'),{'options':{'where':{'id':_0x166a41},'attributes':['name']}});};exports['getTrunkById']=function(_0x3b0c44){return request(_0x1471('0x18'),{'options':{'where':{'id':_0x3b0c44},'attributes':['name']}});};exports[_0x1471('0x19')]=function(_0x314757){return request('ShowSound',{'options':{'where':{'id':_0x314757},'attributes':[_0x1471('0x1a')]}});};exports[_0x1471('0x1b')]=function(_0x51c8a1){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x51c8a1},'include':[{'model':_0x1471('0x1c'),'as':_0x1471('0x1d')}]}});};exports[_0x1471('0x1e')]=function(_0x5b4625){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5b4625},'attributes':['id','name']}});};exports[_0x1471('0x1f')]=function(_0xa69dee){return request(_0x1471('0x20'),{'body':_0xa69dee});};exports[_0x1471('0x21')]=function(_0x174c11){return request(_0x1471('0x22'),{'body':_0x174c11});};exports[_0x1471('0x23')]=function(_0x420dac){return request('CreateSquareReport',{'body':_[_0x1471('0x24')](_0x420dac,{'project_name':_0x420dac['arg_1'],'prev_project_name':_0x420dac[_0x1471('0x25')]||'','is_subproject':_0x420dac[_0x1471('0x25')]?!![]:![],'leaveAt':moment()[_0x1471('0x26')](_0x1471('0x27'))})});};exports['createSquareRecording']=function(_0x2f89ba){return request(_0x1471('0x28'),{'body':_0x2f89ba});};exports['createSquareMessage']=function(_0x3d5f56){return request('CreateSquareMessage',{'body':_0x3d5f56});};exports[_0x1471('0x29')]=function(_0x332f07){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x332f07[_0x1471('0x2a')],'ListId':_0x332f07['ListId']}}})[_0x1471('0x2b')](function(_0x2bb1b4){if(_0x2bb1b4){return _0x2bb1b4;}return request(_0x1471('0x2c'),{'body':_0x332f07});});};exports[_0x1471('0x2d')]=function(_0x176891){return request(_0x1471('0x2e'),{'options':{'where':{'id':_0x176891},'attributes':[_0x1471('0xf')]}});};exports['agentLogin']=function(_0x32b3ec,_0x2a9cd6){return request(_0x1471('0x2f'),{'body':{'interface':_0x2a9cd6},'options':{'where':_0x32b3ec}});};exports[_0x1471('0x30')]=function(_0x3f3e84,_0x447f69,_0x4a2910){return request(_0x1471('0x31'),{'body':{'type':_0x447f69,'uniqueid':_0x4a2910},'options':{'where':_0x3f3e84}});};exports[_0x1471('0x32')]=function(_0x3398f0){return request('UnpauseUser',{'body':{},'options':{'where':_0x3398f0}});};exports[_0x1471('0x33')]=function(_0x4063e1){return request(_0x1471('0x34'),{'body':{},'options':{'where':_0x4063e1}});}; \ 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 5425568..143a73d 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 _0xb491=['./polly','./lex','exports'];(function(_0x16b027,_0x1ebad8){var _0x2485c1=function(_0x1001a9){while(--_0x1001a9){_0x16b027['push'](_0x16b027['shift']());}};_0x2485c1(++_0x1ebad8);}(_0xb491,0x18c));var _0x1b49=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xb491[_0x1be3b3];return _0x4f8b2d;};var polly=require(_0x1b49('0x0'));var lex=require(_0x1b49('0x1'));module[_0x1b49('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x7dee=['./polly','exports'];(function(_0x3d9e0b,_0x521f5a){var _0x5d18d3=function(_0x4e9698){while(--_0x4e9698){_0x3d9e0b['push'](_0x3d9e0b['shift']());}};_0x5d18d3(++_0x521f5a);}(_0x7dee,0xb0));var _0xe7de=function(_0x2a5e63,_0x3def42){_0x2a5e63=_0x2a5e63-0x0;var _0x51fbef=_0x7dee[_0x2a5e63];return _0x51fbef;};var polly=require(_0xe7de('0x0'));var lex=require('./lex');module[_0xe7de('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index eea3204..fae549d 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 _0xa9e0=['exports','./lib/api'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ No newline at end of file +var _0x6e6c=['exports','./lib/api'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 161a901..a1bb9ab 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(_0x37726b,_0x558b84){var _0x23e811=function(_0x119701){while(--_0x119701){_0x37726b['push'](_0x37726b['shift']());}};_0x23e811(++_0x558b84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x209617,_0x57e825){var _0x36a496=function(_0x79f29c){while(--_0x79f29c){_0x209617['push'](_0x209617['shift']());}};_0x36a496(++_0x57e825);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 9bc19bf..1e2693f 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 _0x8757=['exports'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x8757,0x64));var _0x7875=function(_0x227904,_0x522f79){_0x227904=_0x227904-0x0;var _0x20485b=_0x8757[_0x227904];return _0x20485b;};'use strict';var polly=require('./lib/api');module[_0x7875('0x0')]=function(_0x5b2082,_0x50b9ef,_0x381d0f,_0x14faf6,_0x33eeef,_0x5512ae,_0x1f4d9c){return polly(_0x5b2082,_0x50b9ef,_0x381d0f,_0x14faf6,_0x33eeef,_0x5512ae,_0x1f4d9c);}; \ No newline at end of file +var _0xb8ab=['./lib/api'];(function(_0x400ef1,_0x3e9bf1){var _0x2762ec=function(_0x2ddccf){while(--_0x2ddccf){_0x400ef1['push'](_0x400ef1['shift']());}};_0x2762ec(++_0x3e9bf1);}(_0xb8ab,0xc0));var _0xbb8a=function(_0x13f3f1,_0x29345d){_0x13f3f1=_0x13f3f1-0x0;var _0xa5a374=_0xb8ab[_0x13f3f1];return _0xa5a374;};'use strict';var polly=require(_0xbb8a('0x0'));module['exports']=function(_0xb8ed54,_0x290539,_0x389f73,_0x34a383,_0x5e113b,_0x2aa1e4,_0x5ada8){return polly(_0xb8ed54,_0x290539,_0x389f73,_0x34a383,_0x5e113b,_0x2aa1e4,_0x5ada8);}; \ 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 839bb00..144ddc0 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 _0x666e=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','path'];(function(_0x4f58d6,_0x5e028a){var _0xd0fdba=function(_0x3e6fd8){while(--_0x3e6fd8){_0x4f58d6['push'](_0x4f58d6['shift']());}};_0xd0fdba(++_0x5e028a);}(_0x666e,0xf2));var _0xe666=function(_0x24689f,_0x4fff42){_0x24689f=_0x24689f-0x0;var _0x2c1c51=_0x666e[_0x24689f];return _0x2c1c51;};'use strict';var fs=require('fs');var path=require(_0xe666('0x0'));var BPromise=require(_0xe666('0x1'));var rs=require(_0xe666('0x2'));var AWS=require(_0xe666('0x3'));function pollyResult(_0x38e742,_0x26ea58,_0x3a38b4){return new BPromise(function(_0x2bfb3a,_0x292837){_0x38e742[_0xe666('0x4')](_0x26ea58,function(_0x372348,_0x4a6067){if(_0x372348){_0x292837(_0x372348);}else if(_0x4a6067){if(_0x4a6067[_0xe666('0x5')]instanceof Buffer){fs['writeFile'](_0x3a38b4,_0x4a6067['AudioStream'],function(_0x2b4735){if(_0x2b4735){_0x292837(_0x2b4735);}else{_0x2bfb3a();}});}else{_0x292837(new Error(_0xe666('0x6')));}}else{_0x292837(new Error(_0xe666('0x7')));}});});}module[_0xe666('0x8')]=function(_0x21d981,_0x516d80,_0x5a92ea,_0x4381b6,_0x4790a5,_0x54934d,_0x4bc8a8){var _0x3b15f9=new AWS['Polly']({'accessKeyId':_0x21d981,'secretAccessKey':_0x516d80,'region':_0x5a92ea});var _0x208760={'Text':_0x4790a5,'TextType':_0x54934d||'text','OutputFormat':'mp3','VoiceId':_0x4381b6};return pollyResult(_0x3b15f9,_0x208760,_0x4bc8a8);}; \ No newline at end of file +var _0x87d1=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','bluebird','randomstring','aws-sdk'];(function(_0xccc0d4,_0x2f6bf7){var _0x27a653=function(_0x285e63){while(--_0x285e63){_0xccc0d4['push'](_0xccc0d4['shift']());}};_0x27a653(++_0x2f6bf7);}(_0x87d1,0xe7));var _0x187d=function(_0x24110d,_0x1a75f4){_0x24110d=_0x24110d-0x0;var _0x378697=_0x87d1[_0x24110d];return _0x378697;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x187d('0x0'));var rs=require(_0x187d('0x1'));var AWS=require(_0x187d('0x2'));function pollyResult(_0x4841ff,_0x27b1cc,_0x56a9fe){return new BPromise(function(_0xccdf4d,_0x4f03af){_0x4841ff[_0x187d('0x3')](_0x27b1cc,function(_0x13c97b,_0xde6874){if(_0x13c97b){_0x4f03af(_0x13c97b);}else if(_0xde6874){if(_0xde6874[_0x187d('0x4')]instanceof Buffer){fs[_0x187d('0x5')](_0x56a9fe,_0xde6874['AudioStream'],function(_0x31bc7f){if(_0x31bc7f){_0x4f03af(_0x31bc7f);}else{_0xccdf4d();}});}else{_0x4f03af(new Error(_0x187d('0x6')));}}else{_0x4f03af(new Error(_0x187d('0x7')));}});});}module['exports']=function(_0x4b9c78,_0x262f24,_0x2e6523,_0x55a1d0,_0x153289,_0x1e6873,_0x2dadfe){var _0x5c5285=new AWS['Polly']({'accessKeyId':_0x4b9c78,'secretAccessKey':_0x262f24,'region':_0x2e6523});var _0x395a2b={'Text':_0x153289,'TextType':_0x1e6873||_0x187d('0x8'),'OutputFormat':'mp3','VoiceId':_0x55a1d0};return pollyResult(_0x5c5285,_0x395a2b,_0x2dadfe);}; \ 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 a346c43..1d8fb2d 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 _0x071e=['./lib/api','exports'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x071e,0x1ec));var _0xe071=function(_0x1ae06f,_0x5b7a6c){_0x1ae06f=_0x1ae06f-0x0;var _0x429688=_0x071e[_0x1ae06f];return _0x429688;};'use strict';var asr=require(_0xe071('0x0'));module[_0xe071('0x1')]=function(_0x5bf94b,_0x5a9691,_0x2cc442,_0x3cbff2){return asr(_0x5bf94b,_0x5a9691,_0x2cc442);}; \ No newline at end of file +var _0xdb3a=['./lib/api','exports'];(function(_0x263901,_0x36ae24){var _0x31f81e=function(_0x3c36d9){while(--_0x3c36d9){_0x263901['push'](_0x263901['shift']());}};_0x31f81e(++_0x36ae24);}(_0xdb3a,0x1d6));var _0xadb3=function(_0x4748a2,_0x5d04bd){_0x4748a2=_0x4748a2-0x0;var _0x16c342=_0xdb3a[_0x4748a2];return _0x16c342;};'use strict';var asr=require(_0xadb3('0x0'));module[_0xadb3('0x1')]=function(_0x59fc5a,_0x3a0341,_0x3b2791,_0xda09a3){return asr(_0x59fc5a,_0x3a0341,_0x3b2791);}; \ 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 18ee73a..649771f 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 _0x1152=['LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key='];(function(_0xf0cdb1,_0x65bd9b){var _0x3ad267=function(_0x45daeb){while(--_0x45daeb){_0xf0cdb1['push'](_0xf0cdb1['shift']());}};_0x3ad267(++_0x65bd9b);}(_0x1152,0x182));var _0x2115=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0x1152[_0x4d7241];return _0x59d9e2;};'use strict';var url=require(_0x2115('0x0'));var BPromise=require(_0x2115('0x1'));var fs=require('fs');var host=_0x2115('0x2');module[_0x2115('0x3')]=function(_0x20049f,_0x31ab3c,_0x31783d){return new BPromise(function(_0x3b8dfa,_0x4d0f31){var _0x1e8a26;if(typeof _0x20049f!=='string'||_0x20049f[_0x2115('0x4')]===0x0){return _0x4d0f31(_0x2115('0x5'));}if(typeof _0x31ab3c!=='string'||_0x31ab3c['length']===0x0){return _0x4d0f31('key\x20should\x20be\x20a\x20string');}if(typeof _0x31783d!=='undefined'&&(typeof _0x31783d!=='string'||_0x31783d[_0x2115('0x4')]===0x0)){return _0x4d0f31(_0x2115('0x6'));}try{_0x1e8a26=fs[_0x2115('0x7')](_0x20049f)['toString'](_0x2115('0x8'));}catch(_0x534958){return _0x4d0f31(_0x534958);}return _0x3b8dfa({'method':'POST','uri':host+_0x2115('0x9')+_0x31ab3c,'body':{'config':{'encoding':_0x2115('0xa'),'sampleRateHertz':_0x2115('0xb'),'languageCode':_0x31783d},'audio':{'content':_0x1e8a26}},'json':!![]});});}; \ No newline at end of file +var _0xee39=['toString','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xee39,0x1e6));var _0x9ee3=function(_0x3500cb,_0x35a934){_0x3500cb=_0x3500cb-0x0;var _0x248df0=_0xee39[_0x3500cb];return _0x248df0;};'use strict';var url=require(_0x9ee3('0x0'));var BPromise=require(_0x9ee3('0x1'));var fs=require('fs');var host=_0x9ee3('0x2');module['exports']=function(_0x39e617,_0x64784f,_0x18357f){return new BPromise(function(_0x3cdeaf,_0x2724c7){var _0x3a556a;if(typeof _0x39e617!==_0x9ee3('0x3')||_0x39e617[_0x9ee3('0x4')]===0x0){return _0x2724c7(_0x9ee3('0x5'));}if(typeof _0x64784f!==_0x9ee3('0x3')||_0x64784f['length']===0x0){return _0x2724c7(_0x9ee3('0x6'));}if(typeof _0x18357f!==_0x9ee3('0x7')&&(typeof _0x18357f!==_0x9ee3('0x3')||_0x18357f['length']===0x0)){return _0x2724c7(_0x9ee3('0x8'));}try{_0x3a556a=fs['readFileSync'](_0x39e617)[_0x9ee3('0x9')]('base64');}catch(_0x2a5ae7){return _0x2724c7(_0x2a5ae7);}return _0x3cdeaf({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x64784f,'body':{'config':{'encoding':_0x9ee3('0xa'),'sampleRateHertz':'8000','languageCode':_0x18357f},'audio':{'content':_0x3a556a}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 10cb4be..016c936 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x39f6=['./asr','exports'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x39f6,0x19e));var _0x639f=function(_0x46eb8b,_0x574ae2){_0x46eb8b=_0x46eb8b-0x0;var _0x512d37=_0x39f6[_0x46eb8b];return _0x512d37;};var asr=require(_0x639f('0x0'));module[_0x639f('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 fb7c65d..0a894ce 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 _0x2d0c=['source','result','resolvedQuery','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','action','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','https:','host','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','createWriteStream','finish','info','close','download\x20error','pipe','end','path','get','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','unlink','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify','jQ1olc','null','generic','slice','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest'];(function(_0x5a8482,_0x523a32){var _0xb67728=function(_0x1a3cb6){while(--_0x1a3cb6){_0x5a8482['push'](_0x5a8482['shift']());}};_0xb67728(++_0x523a32);}(_0x2d0c,0x1df));var _0xc2d0=function(_0x46eb54,_0x4f1eac){_0x46eb54=_0x46eb54-0x0;var _0x3902b2=_0x2d0c[_0x46eb54];return _0x3902b2;};'use strict';var apiai=require(_0xc2d0('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xc2d0('0x1'));var fs=require('fs');var http=require(_0xc2d0('0x2'));var https=require(_0xc2d0('0x3'));var md5=require('md5');var path=require('path');var querystring=require(_0xc2d0('0x4'));var rp=require(_0xc2d0('0x5'));var rs=require(_0xc2d0('0x6'));var sox=require(_0xc2d0('0x7'));var tts=require(_0xc2d0('0x8'));var urlParse=require(_0xc2d0('0x9'))[_0xc2d0('0xa')];var util=require(_0xc2d0('0xb'));var aws=require(_0xc2d0('0xc'));var google=require(_0xc2d0('0xd'));var sestek=require(_0xc2d0('0xe'));var tilde=require(_0xc2d0('0xf'));var logger=require(_0xc2d0('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x10bb51,_0xa5e723){return new BPromise(function(_0x5a7c7a,_0x1f8fbe){var _0x5c6539=urlParse(_0x10bb51);var _0x4cb3fa=_0x5c6539[_0xc2d0('0x11')]===_0xc2d0('0x12')?https:http;var _0x582db1={'host':_0x5c6539[_0xc2d0('0x13')],'path':_0x5c6539['path'],'headers':{'user-agent':_0xc2d0('0x14')}};_0x4cb3fa['get'](_0x582db1,function(_0x38cb6b){if(_0x38cb6b['statusCode']!==0xc8){logger[_0xc2d0('0x15')](_0xc2d0('0x16')+_0x10bb51+_0xc2d0('0x17')+_0x38cb6b['statusCode']+'\x20('+_0x38cb6b[_0xc2d0('0x18')]+')');_0x1f8fbe(new Error(_0xc2d0('0x16')+_0x10bb51+_0xc2d0('0x17')+_0x38cb6b[_0xc2d0('0x19')]+'\x20('+_0x38cb6b[_0xc2d0('0x18')]+')'));return;}var _0x6d93ad=fs[_0xc2d0('0x1a')](_0xa5e723);_0x6d93ad['on'](_0xc2d0('0x1b'),function(){logger[_0xc2d0('0x1c')]('finish\x20download\x20file');_0x6d93ad[_0xc2d0('0x1d')](_0x5a7c7a);});_0x6d93ad['on']('error',function(_0x5e26d4){fs['unlink'](_0xa5e723);logger[_0xc2d0('0x15')](_0xc2d0('0x1e'),_0x5e26d4);_0x1f8fbe(_0x5e26d4);});_0x38cb6b[_0xc2d0('0x1f')](_0x6d93ad);})['on'](_0xc2d0('0x15'),function(_0x3a5961){logger[_0xc2d0('0x15')](_0x3a5961);_0x1f8fbe(_0x3a5961);})[_0xc2d0('0x20')]();});}function uploadFile(_0x3a27e7){return new BPromise(function(_0x3d33b7,_0x49dff8){var _0x4d6612=urlParse(_0x3a27e7);var _0x50533b=_0x4d6612[_0xc2d0('0x11')]==='https:'?https:http;var _0x54917f={'host':_0x4d6612[_0xc2d0('0x13')],'path':_0x4d6612[_0xc2d0('0x21')],'headers':{'user-agent':_0xc2d0('0x14')}};_0x50533b[_0xc2d0('0x22')](_0x54917f,function(_0x349924){if(_0x349924[_0xc2d0('0x19')]!==0xc8){_0x49dff8(new Error(_0xc2d0('0x16')+_0x3a27e7+_0xc2d0('0x17')+_0x349924[_0xc2d0('0x19')]+'\x20('+_0x349924[_0xc2d0('0x18')]+')'));return;}var _0x170a49='';_0x349924['on']('data',function(_0x54077c){_0x170a49+=_0x54077c;});_0x349924['on'](_0xc2d0('0x20'),function(){_0x3d33b7(_0x170a49);});})['on'](_0xc2d0('0x15'),function(_0x25e423){_0x49dff8(_0x25e423);})[_0xc2d0('0x20')]();});}function convertFile(_0x48bce1,_0xbf86dd){return new BPromise(function(_0x2da44a,_0x38ce68){var _0x42120d=sox['transcode'](_0x48bce1,_0xbf86dd,{'sampleRate':0x1f40,'format':_0xc2d0('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x42120d['on'](_0xc2d0('0x15'),function(_0x4abb0a){logger[_0xc2d0('0x15')](_0xc2d0('0x24'),_0x4abb0a);_0x38ce68(_0x4abb0a);});_0x42120d['on'](_0xc2d0('0x20'),function(){logger['info'](_0xc2d0('0x25'));_0x2da44a();});_0x42120d[_0xc2d0('0x26')]();});}function base64Decode(_0x1ab9f8,_0x3f3d2e){var _0x132c92=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x2a'));fs[_0xc2d0('0x2b')](_0x132c92,_0x1ab9f8,_0xc2d0('0x2c'));return convertFile(_0x132c92,_0x3f3d2e)['then'](function(){try{fs[_0xc2d0('0x2d')](_0x132c92);fs[_0xc2d0('0x2e')](_0x3f3d2e,_0xc2d0('0x2f'));}catch(_0x5e0556){logger['error'](_0x5e0556);}return _0x3f3d2e[_0xc2d0('0x30')]('.')[0x0];});}function base64Encode(_0x3aa737){var _0x497e8e=fs[_0xc2d0('0x31')](_0x3aa737);return new Buffer(_0x497e8e)['toString'](_0xc2d0('0x2c'));}exports['googleCloudTTS']=function(_0x8691e9,_0x544496,_0x3d9fd7,_0x1c97fa,_0x59ccb5,_0x3c229d){var _0x2d5289,_0xb1e61f;var _0x140631=_0xc2d0('0x32');var _0x44f521='?key='+_0x8691e9;var _0x2a3387={};if(_0x544496===_0xc2d0('0x33')){_0x2a3387[_0xc2d0('0x34')]={'ssml':_0x3d9fd7};}else{_0x2a3387[_0xc2d0('0x34')]={'text':_0x3d9fd7};};_0x2a3387['voice']={'languageCode':_0x1c97fa,'ssmlGender':_0x59ccb5};_0x2a3387[_0xc2d0('0x35')]={'audioEncoding':_0xc2d0('0x36'),'sampleRateHertz':0x1f40};var _0x1b22e1={'url':_0x140631+_0xc2d0('0x37')+_0x44f521,'method':_0xc2d0('0x38'),'json':!![],'body':_0x2a3387};return rp(_0x1b22e1)['then'](function(_0x3c42b8){return new BPromise(function(_0x291c79,_0x36e479){_0x2d5289=path[_0xc2d0('0x27')](__dirname,'tmp',rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x39'));var _0xd839e0=Buffer[_0xc2d0('0x3a')](_0x3c42b8[_0xc2d0('0x3b')],_0xc2d0('0x2c'));return fs[_0xc2d0('0x3c')](_0x2d5289,_0xd839e0,function(_0xed3977){_0x36e479(_0xed3977);},function(_0xea6ad){fs[_0xc2d0('0x2e')](_0x2d5289,_0xc2d0('0x2f'));_0x291c79(_0xea6ad);});});})[_0xc2d0('0x3d')](function(_0x3a81c1){_0xb1e61f=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x2a'));return convertFile(_0x2d5289,_0xb1e61f);})[_0xc2d0('0x3d')](function(){try{fs[_0xc2d0('0x2d')](_0x2d5289);fs[_0xc2d0('0x2e')](_0xb1e61f,_0xc2d0('0x2f'));}catch(_0x8ca065){logger[_0xc2d0('0x15')](_0x8ca065);}logger[_0xc2d0('0x1c')](_0xc2d0('0x3e'),_0xb1e61f['split']('.')[0x0]);return _0xb1e61f[_0xc2d0('0x30')]('.')[0x0];});};exports[_0xc2d0('0x3f')]=function(_0xe4d85a,_0x3ac911){var _0x39a52b='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x52c29a,_0x15c9ae;var _0x2584d9;var _0x7e9412={'encoding':_0xc2d0('0x40'),'method':'POST','timeout':0x2710,'url':_0x39a52b,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xc2d0('0x41')+encodeURIComponent(JSON[_0xc2d0('0x42')]([[[_0xc2d0('0x43'),JSON[_0xc2d0('0x42')]([_0xe4d85a,_0x3ac911||'en',![],_0xc2d0('0x44')]),null,_0xc2d0('0x45')]]]))};return rp(_0x7e9412)[_0xc2d0('0x3d')](function(_0x3a5288){try{_0x2584d9=eval(_0x3a5288[_0xc2d0('0x46')](0x5))[0x0][0x2];}catch(_0x143616){throw new Error('parse\x20response\x20failed:\x0a'+_0x3a5288[_0xc2d0('0x47')]);}if(!_0x2584d9){if(_0xe4d85a[_0xc2d0('0x48')]>0xc8){throw new Error(_0xc2d0('0x49'));}else{throw new Error(_0xc2d0('0x4a')+_0x3ac911+'\x22\x20might\x20not\x20exist');}}try{_0x2584d9=eval(_0x2584d9)[0x0];}catch(_0x59df15){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xc2d0('0x47')]);}const _0x1b8d36=_0x2584d9;_0x52c29a=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x39'));fs[_0xc2d0('0x2b')](_0x52c29a,_0x2584d9,{'encoding':'base64'});_0x15c9ae=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x52c29a,_0x15c9ae);})[_0xc2d0('0x3d')](function(){try{fs[_0xc2d0('0x2d')](_0x52c29a);fs['chmodSync'](_0x15c9ae,_0xc2d0('0x2f'));}catch(_0x25b27e){logger[_0xc2d0('0x15')](_0x25b27e);}logger[_0xc2d0('0x1c')](_0xc2d0('0x4b'),_0x15c9ae[_0xc2d0('0x30')]('.')[0x0]);return _0x15c9ae['split']('.')[0x0];});};exports[_0xc2d0('0x4c')]=function(_0x11e29f,_0x2d1221,_0x23b18c){return google[_0xc2d0('0x4d')](_0x11e29f,_0x2d1221,_0x23b18c)[_0xc2d0('0x3d')](function(_0xa2425c){logger['info'](_0xa2425c[_0xc2d0('0x4e')]);return rp(_0xa2425c);})['then'](function(_0x178b64){var _0x9b82c8='';var _0x43425f=0x0;try{fs[_0xc2d0('0x2d')](_0x11e29f);}catch(_0x35d7cd){logger[_0xc2d0('0x15')](_0x35d7cd);}if(_0x178b64&&_0x178b64[_0xc2d0('0x4f')]){_0x9b82c8=_0x178b64[_0xc2d0('0x4f')]['map'](function(_0x439b41){return _0x439b41&&_0x439b41[_0xc2d0('0x50')][0x0]&&_0x439b41[_0xc2d0('0x50')][0x0]['transcript']?_0x439b41['alternatives'][0x0][_0xc2d0('0x51')]:'';})['join']('\x0a');_0x43425f=_0x178b64[_0xc2d0('0x4f')][_0xc2d0('0x52')](function(_0x177455){return _0x177455&&_0x177455[_0xc2d0('0x50')][0x0]&&_0x177455['alternatives'][0x0][_0xc2d0('0x53')]?_0x177455[_0xc2d0('0x50')][0x0][_0xc2d0('0x53')]:0x0;})[_0xc2d0('0x54')]('\x0a');}logger['info'](_0xc2d0('0x55'),_0x9b82c8);logger[_0xc2d0('0x1c')](_0xc2d0('0x56'),_0x43425f);return{'transcript':_0x9b82c8,'confidence':_0x43425f};})[_0xc2d0('0x57')](function(_0x145da0){logger[_0xc2d0('0x15')](_0xc2d0('0x58'),_0x145da0[_0xc2d0('0x19')],_0x145da0[_0xc2d0('0x59')],_0x145da0[_0xc2d0('0x5a')]);});};exports[_0xc2d0('0x5b')]=function(_0x1bfff3,_0x1e15c5,_0x311634,_0x4a5d4b){var _0x53b690=apiai(_0x1e15c5,{'language':_0x4a5d4b||'en'});return _0x53b690[_0xc2d0('0x5c')](_0x311634,{'sessionId':md5(_0x1bfff3)})[_0xc2d0('0x3d')](function(_0x197cf4){logger['info'](JSON['stringify'](_0x197cf4));return{'source':_0x197cf4['result'][_0xc2d0('0x5d')],'resolvedQuery':_0x197cf4[_0xc2d0('0x5e')][_0xc2d0('0x5f')],'action':_0x197cf4[_0xc2d0('0x5e')]['action'],'actionIncomplete':_0x197cf4[_0xc2d0('0x5e')]['actionIncomplete'],'speech':_0x197cf4[_0xc2d0('0x5e')]['fulfillment'][_0xc2d0('0x60')],'score':_0x197cf4[_0xc2d0('0x5e')][_0xc2d0('0x61')],'statusCode':_0x197cf4[_0xc2d0('0x62')][_0xc2d0('0x63')],'endConversation':_0x197cf4['result'][_0xc2d0('0x64')][_0xc2d0('0x65')]||![],'isFallbackIntent':_0x197cf4[_0xc2d0('0x5e')][_0xc2d0('0x64')][_0xc2d0('0x66')]};});};exports[_0xc2d0('0x67')]=function(_0x2b9bda,_0x54623e,_0x4b6e6c,_0x379207,_0xf93a27,_0x147c16){var _0x120396=_0x379207[_0xc2d0('0x68')](/\\n/g,'\x0a');var _0x2a770b={'credentials':{'private_key':_0x120396,'client_email':_0x4b6e6c}};var _0x5bcc56=new dialogflow['SessionsClient'](_0x2a770b);var _0x21f878=_0x5bcc56[_0xc2d0('0x69')](_0x54623e,md5(_0x2b9bda));var _0x855c4b={'session':_0x21f878,'queryInput':{'text':{'text':_0xf93a27,'languageCode':_0x147c16}}};return _0x5bcc56[_0xc2d0('0x6a')](_0x855c4b)[_0xc2d0('0x3d')](function(_0x263472){if(_0x263472&&_0x263472[_0xc2d0('0x48')]){logger[_0xc2d0('0x1c')](_0xc2d0('0x6b'),JSON[_0xc2d0('0x42')](_0x263472));var _0x29acd8=_0x263472[0x0];if(_0x29acd8){var _0x14d958={'action':_0x29acd8['queryResult'][_0xc2d0('0x6c')],'allRequiredParamsPresent':_0x29acd8['queryResult'][_0xc2d0('0x6d')],'endConversation':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x6f')]&&_0x29acd8[_0xc2d0('0x6e')]['diagnosticInfo'][_0xc2d0('0x70')]?_0x29acd8[_0xc2d0('0x6e')]['diagnosticInfo'][_0xc2d0('0x70')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x71')],'intentName':_0x29acd8['queryResult'][_0xc2d0('0x72')][_0xc2d0('0x59')],'intentDisplayName':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x72')][_0xc2d0('0x73')],'isFallbackIntent':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x72')][_0xc2d0('0x74')],'languageCode':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x75')],'queryText':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x76')],'responseId':_0x29acd8[_0xc2d0('0x77')],'score':_0x29acd8['queryResult'][_0xc2d0('0x78')],'speech':_0x29acd8[_0xc2d0('0x6e')][_0xc2d0('0x71')],'providerResponse':JSON[_0xc2d0('0x42')](_0x263472)};return _0x14d958;}}});};exports[_0xc2d0('0x79')]=function(_0x28b2ce,_0x42fff9,_0x4445c8,_0x3df8c6){return tilde[_0xc2d0('0x4d')](_0x28b2ce,_0x42fff9,_0x4445c8,_0x3df8c6)[_0xc2d0('0x3d')](function(_0x26d109){try{fs[_0xc2d0('0x2d')](_0x28b2ce);}catch(_0x237295){logger['error'](_0x237295);}logger[_0xc2d0('0x1c')]('Tilde\x20ASR\x20transcription',_0x26d109['transcript']);logger['info'](_0xc2d0('0x7a'),_0x26d109[_0xc2d0('0x53')]);return _0x26d109;});};exports[_0xc2d0('0x7b')]=function(_0x449da5,_0x19b455,_0x245a71,_0x2fab64,_0x1c90dd,_0x5b6be7){var _0x458a6b=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x39'));var _0x15a8c2;return aws[_0xc2d0('0x7c')](_0x449da5,_0x19b455,_0x245a71,_0x2fab64,_0x1c90dd,_0x5b6be7,_0x458a6b)[_0xc2d0('0x3d')](function(){_0x15a8c2=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs['generate'](0x4)+_0xc2d0('0x2a'));return convertFile(_0x458a6b,_0x15a8c2);})[_0xc2d0('0x3d')](function(){try{fs[_0xc2d0('0x2d')](_0x458a6b);fs['chmodSync'](_0x15a8c2,_0xc2d0('0x2f'));}catch(_0x1f85c7){logger[_0xc2d0('0x15')](_0x1f85c7);}return _0x15a8c2[_0xc2d0('0x30')]('.')[0x0];});};exports[_0xc2d0('0x7d')]=function(_0x96d7ef,_0x33ca04,_0x294fb8,_0x2ef375,_0x2d7135,_0x10b3c1){return aws[_0xc2d0('0x7e')](_0x96d7ef,_0x33ca04,_0x294fb8,_0x2ef375,_0x2d7135,_0x10b3c1)['then'](function(_0x4ef4cf){logger['info'](JSON[_0xc2d0('0x42')](_0x4ef4cf));return _0x4ef4cf;});};exports['ispeechTTS']=function(_0x1902d4,_0x4a75b7,_0x46ea07,_0x293764){var _0x56d496=util[_0xc2d0('0x7f')](_0xc2d0('0x80'),ISPEECH_API,_0x1902d4,encodeURIComponent(_0x4a75b7),_0x46ea07,_0x293764);var _0x421fab=path['resolve'](__dirname,_0xc2d0('0x28'),rs[_0xc2d0('0x29')](0x4)+_0xc2d0('0x39'));var _0x2f9f69;return downloadFile(_0x56d496,_0x421fab)[_0xc2d0('0x3d')](function(){_0x2f9f69=path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs['generate'](0x4)+_0xc2d0('0x2a'));return convertFile(_0x421fab,_0x2f9f69);})['then'](function(){try{fs['unlink'](_0x421fab);fs[_0xc2d0('0x2e')](_0x2f9f69,_0xc2d0('0x2f'));}catch(_0x4875d7){logger[_0xc2d0('0x15')](_0x4875d7);}return _0x2f9f69['split']('.')[0x0];});};exports[_0xc2d0('0x81')]=function(_0x47e262,_0x455808,_0xc53fed,_0x52357b){var _0x1e27d5=util[_0xc2d0('0x7f')](_0xc2d0('0x82'),ISPEECH_API,_0x455808,_0xc53fed,base64Encode(_0x47e262),_0x52357b?util[_0xc2d0('0x7f')](_0xc2d0('0x83'),encodeURIComponent(_0x52357b)):_0xc2d0('0x84'));return uploadFile(_0x1e27d5)[_0xc2d0('0x3d')](function(_0x3dd6af){return querystring[_0xc2d0('0xa')](_0x3dd6af);});};exports[_0xc2d0('0x85')]=function(_0x1afb76,_0x59e717){return sestek[_0xc2d0('0x86')](_0x1afb76,_0x59e717)[_0xc2d0('0x3d')](function(_0x5a8545){logger[_0xc2d0('0x1c')](JSON[_0xc2d0('0x42')](_0x5a8545));var _0x1080e0={'speech':_0x5a8545[_0xc2d0('0x87')],'action':_0x5a8545[_0xc2d0('0x88')]?_0x5a8545[_0xc2d0('0x88')][_0xc2d0('0x89')]:undefined,'actiondata':_0x5a8545[_0xc2d0('0x88')]?_0x5a8545[_0xc2d0('0x88')][_0xc2d0('0x8a')]:undefined};if(_0x5a8545[_0xc2d0('0x88')]&&_0x5a8545[_0xc2d0('0x88')][_0xc2d0('0x8b')]){return base64Decode(_0x5a8545[_0xc2d0('0x88')][_0xc2d0('0x8b')][_0xc2d0('0x8c')],path[_0xc2d0('0x27')](__dirname,_0xc2d0('0x28'),rs['generate'](0x4)+_0xc2d0('0x2a')))['then'](function(_0x4e83e6){_0x1080e0[_0xc2d0('0x8d')]=_0x4e83e6;return _0x1080e0;});}return _0x1080e0;});};exports[_0xc2d0('0x8e')]=function(){return __dirname;}; \ No newline at end of file +var _0xe6be=['application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','transcript','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','result','action','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','wav','finish\x20to\x20convert','start','resolve','generate','.wav','then','chmodSync','777','split','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','tmp','from','audioContent','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8'];(function(_0x545150,_0x2c2b6c){var _0xff7fd6=function(_0x18bb22){while(--_0x18bb22){_0x545150['push'](_0x545150['shift']());}};_0xff7fd6(++_0x2c2b6c);}(_0xe6be,0x1eb));var _0xee6b=function(_0x12a069,_0x478b58){_0x12a069=_0x12a069-0x0;var _0x5ad121=_0xe6be[_0x12a069];return _0x5ad121;};'use strict';var apiai=require(_0xee6b('0x0'));var BPromise=require(_0xee6b('0x1'));var dialogflow=require(_0xee6b('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xee6b('0x3'));var md5=require(_0xee6b('0x4'));var path=require(_0xee6b('0x5'));var querystring=require('querystring');var rp=require(_0xee6b('0x6'));var rs=require(_0xee6b('0x7'));var sox=require(_0xee6b('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xee6b('0x9'))[_0xee6b('0xa')];var util=require(_0xee6b('0xb'));var aws=require(_0xee6b('0xc'));var google=require(_0xee6b('0xd'));var sestek=require(_0xee6b('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xee6b('0xf'));var ISPEECH_API=_0xee6b('0x10');function downloadFile(_0x1a7f59,_0x24a5f8){return new BPromise(function(_0x343635,_0x2b72f5){var _0x2376b1=urlParse(_0x1a7f59);var _0x49f4da=_0x2376b1['protocol']===_0xee6b('0x11')?https:http;var _0x461c17={'host':_0x2376b1[_0xee6b('0x12')],'path':_0x2376b1['path'],'headers':{'user-agent':_0xee6b('0x13')}};_0x49f4da[_0xee6b('0x14')](_0x461c17,function(_0x32a416){if(_0x32a416[_0xee6b('0x15')]!==0xc8){logger[_0xee6b('0x16')]('request\x20to\x20'+_0x1a7f59+_0xee6b('0x17')+_0x32a416[_0xee6b('0x15')]+'\x20('+_0x32a416[_0xee6b('0x18')]+')');_0x2b72f5(new Error(_0xee6b('0x19')+_0x1a7f59+'\x20failed,\x20status\x20code\x20=\x20'+_0x32a416[_0xee6b('0x15')]+'\x20('+_0x32a416[_0xee6b('0x18')]+')'));return;}var _0x315473=fs[_0xee6b('0x1a')](_0x24a5f8);_0x315473['on'](_0xee6b('0x1b'),function(){logger[_0xee6b('0x1c')](_0xee6b('0x1d'));_0x315473['close'](_0x343635);});_0x315473['on'](_0xee6b('0x16'),function(_0x4510d7){fs[_0xee6b('0x1e')](_0x24a5f8);logger[_0xee6b('0x16')](_0xee6b('0x1f'),_0x4510d7);_0x2b72f5(_0x4510d7);});_0x32a416[_0xee6b('0x20')](_0x315473);})['on'](_0xee6b('0x16'),function(_0x457413){logger[_0xee6b('0x16')](_0x457413);_0x2b72f5(_0x457413);})[_0xee6b('0x21')]();});}function uploadFile(_0x349e7f){return new BPromise(function(_0x408fa8,_0x4a853b){var _0x2837bd=urlParse(_0x349e7f);var _0x17c50d=_0x2837bd['protocol']===_0xee6b('0x11')?https:http;var _0x4f25a1={'host':_0x2837bd['host'],'path':_0x2837bd['path'],'headers':{'user-agent':_0xee6b('0x13')}};_0x17c50d['get'](_0x4f25a1,function(_0x441566){if(_0x441566[_0xee6b('0x15')]!==0xc8){_0x4a853b(new Error('request\x20to\x20'+_0x349e7f+_0xee6b('0x17')+_0x441566['statusCode']+'\x20('+_0x441566[_0xee6b('0x18')]+')'));return;}var _0x5bf1fb='';_0x441566['on']('data',function(_0x138d18){_0x5bf1fb+=_0x138d18;});_0x441566['on'](_0xee6b('0x21'),function(){_0x408fa8(_0x5bf1fb);});})['on'](_0xee6b('0x16'),function(_0x402ead){_0x4a853b(_0x402ead);})[_0xee6b('0x21')]();});}function convertFile(_0x420732,_0x3cf63f){return new BPromise(function(_0x38facb,_0x2df118){var _0x3dd037=sox['transcode'](_0x420732,_0x3cf63f,{'sampleRate':0x1f40,'format':_0xee6b('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dd037['on'](_0xee6b('0x16'),function(_0x33704e){logger[_0xee6b('0x16')]('error\x20convert',_0x33704e);_0x2df118(_0x33704e);});_0x3dd037['on'](_0xee6b('0x21'),function(){logger['info'](_0xee6b('0x23'));_0x38facb();});_0x3dd037[_0xee6b('0x24')]();});}function base64Decode(_0x2a6477,_0x2f4ccd){var _0x27bf3d=path[_0xee6b('0x25')](__dirname,'tmp',rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));fs['writeFileSync'](_0x27bf3d,_0x2a6477,'base64');return convertFile(_0x27bf3d,_0x2f4ccd)[_0xee6b('0x28')](function(){try{fs[_0xee6b('0x1e')](_0x27bf3d);fs[_0xee6b('0x29')](_0x2f4ccd,_0xee6b('0x2a'));}catch(_0x181aa0){logger[_0xee6b('0x16')](_0x181aa0);}return _0x2f4ccd[_0xee6b('0x2b')]('.')[0x0];});}function base64Encode(_0x3a1805){var _0x25a77f=fs[_0xee6b('0x2c')](_0x3a1805);return new Buffer(_0x25a77f)[_0xee6b('0x2d')](_0xee6b('0x2e'));}exports['googleCloudTTS']=function(_0x1050df,_0x2fb495,_0x404f65,_0x3496d1,_0xfbe2e7,_0xb20e80){var _0x455607,_0xc53aaf;var _0x1aca79=_0xee6b('0x2f');var _0x221dab=_0xee6b('0x30')+_0x1050df;var _0x3ba93b={};if(_0x2fb495===_0xee6b('0x31')){_0x3ba93b[_0xee6b('0x32')]={'ssml':_0x404f65};}else{_0x3ba93b[_0xee6b('0x32')]={'text':_0x404f65};};_0x3ba93b[_0xee6b('0x33')]={'languageCode':_0x3496d1,'ssmlGender':_0xfbe2e7};_0x3ba93b['audioConfig']={'audioEncoding':_0xee6b('0x34'),'sampleRateHertz':0x1f40};var _0x3e8b66={'url':_0x1aca79+_0xee6b('0x35')+_0x221dab,'method':_0xee6b('0x36'),'json':!![],'body':_0x3ba93b};return rp(_0x3e8b66)[_0xee6b('0x28')](function(_0x4d8524){return new BPromise(function(_0x4a0f98,_0x4d31f4){_0x455607=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+'.mp3');var _0x5e3121=Buffer[_0xee6b('0x38')](_0x4d8524[_0xee6b('0x39')],_0xee6b('0x2e'));return fs['writeFile'](_0x455607,_0x5e3121,function(_0x3c8499){_0x4d31f4(_0x3c8499);},function(_0x1a2eba){fs[_0xee6b('0x29')](_0x455607,_0xee6b('0x2a'));_0x4a0f98(_0x1a2eba);});});})[_0xee6b('0x28')](function(_0xdb74fe){_0xc53aaf=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x455607,_0xc53aaf);})['then'](function(){try{fs[_0xee6b('0x1e')](_0x455607);fs[_0xee6b('0x29')](_0xc53aaf,_0xee6b('0x2a'));}catch(_0x1a697d){logger[_0xee6b('0x16')](_0x1a697d);}logger['info']('googleCloudTTS\x20path',_0xc53aaf[_0xee6b('0x2b')]('.')[0x0]);return _0xc53aaf[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x3a')]=function(_0x430836,_0x4e8ccd){var _0x8fc53d=_0xee6b('0x3b');var _0x4a278d,_0x4ff8c3;var _0x46df11;var _0x5540a9={'encoding':_0xee6b('0x3c'),'method':_0xee6b('0x36'),'timeout':0x2710,'url':_0x8fc53d,'headers':{'Content-Type':_0xee6b('0x3d')},'body':_0xee6b('0x3e')+encodeURIComponent(JSON['stringify']([[[_0xee6b('0x3f'),JSON[_0xee6b('0x40')]([_0x430836,_0x4e8ccd||'en',![],_0xee6b('0x41')]),null,_0xee6b('0x42')]]]))};return rp(_0x5540a9)['then'](function(_0x10b7b9){try{_0x46df11=eval(_0x10b7b9[_0xee6b('0x43')](0x5))[0x0][0x2];}catch(_0x45b0da){throw new Error(_0xee6b('0x44')+_0x10b7b9['data']);}if(!_0x46df11){if(_0x430836[_0xee6b('0x45')]>0xc8){throw new Error(_0xee6b('0x46'));}else{throw new Error(_0xee6b('0x47')+_0x4e8ccd+_0xee6b('0x48'));}}try{_0x46df11=eval(_0x46df11)[0x0];}catch(_0x744118){throw new Error(_0xee6b('0x44')+res['data']);}const _0x3c607f=_0x46df11;_0x4a278d=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+_0xee6b('0x49'));fs['writeFileSync'](_0x4a278d,_0x46df11,{'encoding':_0xee6b('0x2e')});_0x4ff8c3=path['resolve'](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+_0xee6b('0x27'));return convertFile(_0x4a278d,_0x4ff8c3);})[_0xee6b('0x28')](function(){try{fs[_0xee6b('0x1e')](_0x4a278d);fs['chmodSync'](_0x4ff8c3,'777');}catch(_0x3732c4){logger[_0xee6b('0x16')](_0x3732c4);}logger[_0xee6b('0x1c')](_0xee6b('0x4a'),_0x4ff8c3[_0xee6b('0x2b')]('.')[0x0]);return _0x4ff8c3[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x4b')]=function(_0x171aae,_0x501ccc,_0x381613){return google[_0xee6b('0x4c')](_0x171aae,_0x501ccc,_0x381613)[_0xee6b('0x28')](function(_0x2f6692){logger[_0xee6b('0x1c')](_0x2f6692[_0xee6b('0x4d')]);return rp(_0x2f6692);})['then'](function(_0x4b5810){var _0x10baf5='';var _0x39129f=0x0;try{fs[_0xee6b('0x1e')](_0x171aae);}catch(_0x2a7f5a){logger[_0xee6b('0x16')](_0x2a7f5a);}if(_0x4b5810&&_0x4b5810[_0xee6b('0x4e')]){_0x10baf5=_0x4b5810[_0xee6b('0x4e')]['map'](function(_0xafda95){return _0xafda95&&_0xafda95['alternatives'][0x0]&&_0xafda95['alternatives'][0x0][_0xee6b('0x4f')]?_0xafda95[_0xee6b('0x50')][0x0][_0xee6b('0x4f')]:'';})[_0xee6b('0x51')]('\x0a');_0x39129f=_0x4b5810[_0xee6b('0x4e')][_0xee6b('0x52')](function(_0x275a4){return _0x275a4&&_0x275a4[_0xee6b('0x50')][0x0]&&_0x275a4[_0xee6b('0x50')][0x0][_0xee6b('0x53')]?_0x275a4[_0xee6b('0x50')][0x0][_0xee6b('0x53')]:0x0;})['join']('\x0a');}logger[_0xee6b('0x1c')](_0xee6b('0x54'),_0x10baf5);logger['info'](_0xee6b('0x55'),_0x39129f);return{'transcript':_0x10baf5,'confidence':_0x39129f};})[_0xee6b('0x56')](function(_0xb72f4b){logger[_0xee6b('0x16')](_0xee6b('0x57'),_0xb72f4b[_0xee6b('0x15')],_0xb72f4b['name'],_0xb72f4b[_0xee6b('0x58')]);});};exports[_0xee6b('0x59')]=function(_0x37253d,_0x264c04,_0x416c88,_0x1fec11){var _0x19190c=apiai(_0x264c04,{'language':_0x1fec11||'en'});return _0x19190c[_0xee6b('0x5a')](_0x416c88,{'sessionId':md5(_0x37253d)})['then'](function(_0xce6582){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0xce6582));return{'source':_0xce6582['result'][_0xee6b('0x5b')],'resolvedQuery':_0xce6582[_0xee6b('0x5c')]['resolvedQuery'],'action':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x5d')],'actionIncomplete':_0xce6582['result']['actionIncomplete'],'speech':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x5e')][_0xee6b('0x5f')],'score':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x60')],'statusCode':_0xce6582['status']['code'],'endConversation':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x61')][_0xee6b('0x62')]||![],'isFallbackIntent':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x61')][_0xee6b('0x63')]};});};exports['googleDialogflowV2']=function(_0x4c8a82,_0x30a557,_0x4bd890,_0x34889e,_0x518f7e,_0xe8249f){var _0x456932=_0x34889e[_0xee6b('0x64')](/\\n/g,'\x0a');var _0x56232c={'credentials':{'private_key':_0x456932,'client_email':_0x4bd890}};var _0x5b9dd8=new dialogflow['SessionsClient'](_0x56232c);var _0x3dccab=_0x5b9dd8[_0xee6b('0x65')](_0x30a557,md5(_0x4c8a82));var _0x47837a={'session':_0x3dccab,'queryInput':{'text':{'text':_0x518f7e,'languageCode':_0xe8249f}}};return _0x5b9dd8[_0xee6b('0x66')](_0x47837a)[_0xee6b('0x28')](function(_0x34bcc3){if(_0x34bcc3&&_0x34bcc3[_0xee6b('0x45')]){logger[_0xee6b('0x1c')]('Dialogflow\x20V2\x20response:',JSON[_0xee6b('0x40')](_0x34bcc3));var _0x552fc4=_0x34bcc3[0x0];if(_0x552fc4){var _0x5d7d6c={'action':_0x552fc4['queryResult'][_0xee6b('0x5d')],'allRequiredParamsPresent':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x68')],'endConversation':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x69')]&&_0x552fc4[_0xee6b('0x67')]['diagnosticInfo'][_0xee6b('0x6a')]?_0x552fc4[_0xee6b('0x67')]['diagnosticInfo']['fields'][_0xee6b('0x6b')][_0xee6b('0x6c')]:![],'fulfillmentText':_0x552fc4[_0xee6b('0x67')]['fulfillmentText'],'intentName':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x6e')],'intentDisplayName':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x6f')],'isFallbackIntent':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x70')],'languageCode':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x71')],'queryText':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x72')],'responseId':_0x552fc4[_0xee6b('0x73')],'score':_0x552fc4['queryResult'][_0xee6b('0x74')],'speech':_0x552fc4[_0xee6b('0x67')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x34bcc3)};return _0x5d7d6c;}}});};exports['tildeASR']=function(_0x1fd464,_0x1565ec,_0x4fb6bd,_0x36d520){return tilde[_0xee6b('0x4c')](_0x1fd464,_0x1565ec,_0x4fb6bd,_0x36d520)[_0xee6b('0x28')](function(_0x542cdb){try{fs[_0xee6b('0x1e')](_0x1fd464);}catch(_0x657ab0){logger['error'](_0x657ab0);}logger[_0xee6b('0x1c')](_0xee6b('0x75'),_0x542cdb[_0xee6b('0x4f')]);logger[_0xee6b('0x1c')](_0xee6b('0x76'),_0x542cdb[_0xee6b('0x53')]);return _0x542cdb;});};exports[_0xee6b('0x77')]=function(_0x289c9f,_0x31e930,_0x372e34,_0xce5f04,_0x4260fe,_0x3bfbbe){var _0x244496=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+'.mp3');var _0xf8a084;return aws[_0xee6b('0x78')](_0x289c9f,_0x31e930,_0x372e34,_0xce5f04,_0x4260fe,_0x3bfbbe,_0x244496)[_0xee6b('0x28')](function(){_0xf8a084=path[_0xee6b('0x25')](__dirname,'tmp',rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));return convertFile(_0x244496,_0xf8a084);})['then'](function(){try{fs[_0xee6b('0x1e')](_0x244496);fs[_0xee6b('0x29')](_0xf8a084,_0xee6b('0x2a'));}catch(_0x55d299){logger['error'](_0x55d299);}return _0xf8a084[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x79')]=function(_0x3640b5,_0x24f1ce,_0x973416,_0x48ae8d,_0xf6bc13,_0x29fcbe){return aws[_0xee6b('0x7a')](_0x3640b5,_0x24f1ce,_0x973416,_0x48ae8d,_0xf6bc13,_0x29fcbe)['then'](function(_0x296c4c){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0x296c4c));return _0x296c4c;});};exports['ispeechTTS']=function(_0x58bf85,_0x2754b3,_0x32e3d2,_0x32bfbc){var _0x4fd007=util[_0xee6b('0x7b')](_0xee6b('0x7c'),ISPEECH_API,_0x58bf85,encodeURIComponent(_0x2754b3),_0x32e3d2,_0x32bfbc);var _0x1ea246=path['resolve'](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+'.mp3');var _0x1478a1;return downloadFile(_0x4fd007,_0x1ea246)[_0xee6b('0x28')](function(){_0x1478a1=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));return convertFile(_0x1ea246,_0x1478a1);})[_0xee6b('0x28')](function(){try{fs['unlink'](_0x1ea246);fs[_0xee6b('0x29')](_0x1478a1,'777');}catch(_0x471951){logger[_0xee6b('0x16')](_0x471951);}return _0x1478a1['split']('.')[0x0];});};exports[_0xee6b('0x7d')]=function(_0x1b9070,_0x235e20,_0x3b35a2,_0xb5782f){var _0x14e61c=util['format'](_0xee6b('0x7e'),ISPEECH_API,_0x235e20,_0x3b35a2,base64Encode(_0x1b9070),_0xb5782f?util[_0xee6b('0x7b')](_0xee6b('0x7f'),encodeURIComponent(_0xb5782f)):_0xee6b('0x80'));return uploadFile(_0x14e61c)[_0xee6b('0x28')](function(_0x307eb6){return querystring[_0xee6b('0xa')](_0x307eb6);});};exports[_0xee6b('0x81')]=function(_0xfe611f,_0x419854){return sestek[_0xee6b('0x82')](_0xfe611f,_0x419854)[_0xee6b('0x28')](function(_0x230b6f){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0x230b6f));var _0x221daf={'speech':_0x230b6f[_0xee6b('0x83')],'action':_0x230b6f[_0xee6b('0x84')]?_0x230b6f[_0xee6b('0x84')][_0xee6b('0x85')]:undefined,'actiondata':_0x230b6f['channelData']?_0x230b6f[_0xee6b('0x84')][_0xee6b('0x86')]:undefined};if(_0x230b6f[_0xee6b('0x84')]&&_0x230b6f['channelData']['AudioFromTts']){return base64Decode(_0x230b6f[_0xee6b('0x84')][_0xee6b('0x87')][_0xee6b('0x88')],path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27')))['then'](function(_0x3347fa){_0x221daf['audiofile']=_0x3347fa;return _0x221daf;});}return _0x221daf;});};exports[_0xee6b('0x89')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 6525711..9c48b17 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 _0xdb00=['./nda','exports'];(function(_0x42fe10,_0x23f799){var _0x289ac3=function(_0x25f412){while(--_0x25f412){_0x42fe10['push'](_0x42fe10['shift']());}};_0x289ac3(++_0x23f799);}(_0xdb00,0x9a));var _0x0db0=function(_0x4fdb79,_0x12c116){_0x4fdb79=_0x4fdb79-0x0;var _0x3ec15b=_0xdb00[_0x4fdb79];return _0x3ec15b;};var nda=require(_0x0db0('0x0'));module[_0x0db0('0x1')]={'nda':nda}; \ No newline at end of file +var _0x72b3=['exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x72b3,0x10b));var _0x372b=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0x72b3[_0x4c4037];return _0x357862;};var nda=require('./nda');module[_0x372b('0x0')]={'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 eaa4a99..489032e 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 _0x05b0=['ndassistant_url','message','calleridname','dnid','text','Bearer\x20','access_token','project','body','channelData','ProjectName','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','stringify','../../../../../config/logger','agi','POST','resolve','/token','password','username','then'];(function(_0x439791,_0x3390da){var _0x22fb04=function(_0x1a7c82){while(--_0x1a7c82){_0x439791['push'](_0x439791['shift']());}};_0x22fb04(++_0x3390da);}(_0x05b0,0x188));var _0x005b=function(_0x5c86c9,_0x311a0f){_0x5c86c9=_0x5c86c9-0x0;var _0xa4b796=_0x05b0[_0x5c86c9];return _0xa4b796;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x005b('0x0'))(_0x005b('0x1'));module['exports']=function(_0xbc782b,_0x2f5c09){var _0x4a76d7={'method':_0x005b('0x2'),'uri':url[_0x005b('0x3')](_0x2f5c09['ndauth_url'],_0x005b('0x4')),'form':{'grant_type':_0x005b('0x5'),'username':_0x2f5c09[_0x005b('0x6')],'password':_0x2f5c09[_0x005b('0x5')]},'json':!![]};return rp(_0x4a76d7)[_0x005b('0x7')](function(_0x35998d){var _0x263bc9={'method':'POST','uri':url[_0x005b('0x3')](_0x2f5c09[_0x005b('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x2f5c09['ndaactivity_type']||_0x005b('0x9'),'channelId':'Nda','conversation':{'id':_0xbc782b['uniqueid']},'from':{'id':_0xbc782b['callerid'],'name':_0xbc782b[_0x005b('0xa')]},'recipient':{'id':_0xbc782b[_0x005b('0xb')],'name':_0xbc782b['extension']},'text':_0x2f5c09[_0x005b('0xc')],'channelData':{}},'headers':{'Authorization':_0x005b('0xd')+_0x35998d[_0x005b('0xe')]},'json':!![]};if(_0x2f5c09[_0x005b('0xf')]){_0x263bc9[_0x005b('0x10')][_0x005b('0x11')][_0x005b('0x12')]=_0x2f5c09['project'];}if(_0x2f5c09['ndagenerate_audio']=='1'){_0x263bc9['body'][_0x005b('0x11')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x005b('0x13')};}if(_0x2f5c09['custom_action']){_0x263bc9[_0x005b('0x10')][_0x005b('0x11')][_0x005b('0x14')]=_0x2f5c09[_0x005b('0x15')];if(_0x2f5c09[_0x005b('0x16')]){_0x263bc9['body'][_0x005b('0x11')][_0x005b('0x17')]=_0x2f5c09[_0x005b('0x16')];}}logger['info'](JSON[_0x005b('0x18')](_0x263bc9));return rp(_0x263bc9);});}; \ No newline at end of file +var _0xf6fb=['access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','info','stringify','../../../../../config/logger','agi','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','text'];(function(_0xb2595c,_0x16e127){var _0x4c9709=function(_0x3d63bb){while(--_0x3d63bb){_0xb2595c['push'](_0xb2595c['shift']());}};_0x4c9709(++_0x16e127);}(_0xf6fb,0x111));var _0xbf6f=function(_0x4bd611,_0x23855a){_0x4bd611=_0x4bd611-0x0;var _0x5d5606=_0xf6fb[_0x4bd611];return _0x5d5606;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));module['exports']=function(_0x270dda,_0x7191f2){var _0x5709b7={'method':_0xbf6f('0x2'),'uri':url['resolve'](_0x7191f2[_0xbf6f('0x3')],_0xbf6f('0x4')),'form':{'grant_type':_0xbf6f('0x5'),'username':_0x7191f2[_0xbf6f('0x6')],'password':_0x7191f2[_0xbf6f('0x5')]},'json':!![]};return rp(_0x5709b7)[_0xbf6f('0x7')](function(_0x9d0c63){var _0x43d56b={'method':'POST','uri':url[_0xbf6f('0x8')](_0x7191f2[_0xbf6f('0x9')],_0xbf6f('0xa')),'body':{'type':_0x7191f2[_0xbf6f('0xb')]||_0xbf6f('0xc'),'channelId':'Nda','conversation':{'id':_0x270dda['uniqueid']},'from':{'id':_0x270dda[_0xbf6f('0xd')],'name':_0x270dda[_0xbf6f('0xe')]},'recipient':{'id':_0x270dda[_0xbf6f('0xf')],'name':_0x270dda['extension']},'text':_0x7191f2[_0xbf6f('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x9d0c63[_0xbf6f('0x11')]},'json':!![]};if(_0x7191f2[_0xbf6f('0x12')]){_0x43d56b[_0xbf6f('0x13')]['channelData'][_0xbf6f('0x14')]=_0x7191f2[_0xbf6f('0x12')];}if(_0x7191f2[_0xbf6f('0x15')]=='1'){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x7191f2[_0xbf6f('0x18')]){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x19')]=_0x7191f2[_0xbf6f('0x18')];if(_0x7191f2[_0xbf6f('0x1a')]){_0x43d56b[_0xbf6f('0x13')]['channelData']['CustomActionData']=_0x7191f2[_0xbf6f('0x1a')];}}logger[_0xbf6f('0x1b')](JSON[_0xbf6f('0x1c')](_0x43d56b));return rp(_0x43d56b);});}; \ 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 27ce911..974fbe0 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 _0xf096=['exports'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xf096,0xb5));var _0x6f09=function(_0x4ef343,_0x124611){_0x4ef343=_0x4ef343-0x0;var _0x14f697=_0xf096[_0x4ef343];return _0x14f697;};'use strict';var asr=require('./lib/api');module[_0x6f09('0x0')]=function(_0x4882b5,_0xda9fa1,_0x1a4a81,_0x297f49){return asr(_0x4882b5,_0xda9fa1,_0x1a4a81,_0x297f49);}; \ No newline at end of file +var _0xfce6=['./lib/api','exports'];(function(_0x255b94,_0x352b45){var _0xc5806b=function(_0x530e79){while(--_0x530e79){_0x255b94['push'](_0x255b94['shift']());}};_0xc5806b(++_0x352b45);}(_0xfce6,0x1c6));var _0x6fce=function(_0xeedbcc,_0x42f007){_0xeedbcc=_0xeedbcc-0x0;var _0x4a9b38=_0xfce6[_0xeedbcc];return _0x4a9b38;};'use strict';var asr=require(_0x6fce('0x0'));module[_0x6fce('0x1')]=function(_0x345a6c,_0xc49f3b,_0x4841c7,_0x4fd990){return asr(_0x345a6c,_0xc49f3b,_0x4841c7,_0x4fd990);}; \ 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 2dff7a9..dbde38d 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 _0xb375=['lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','unix','stringify','createReadStream','data','send','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','isObject','open','message','close'];(function(_0xf3beb2,_0x1cb3b7){var _0x480024=function(_0x59acd0){while(--_0x59acd0){_0xf3beb2['push'](_0xf3beb2['shift']());}};_0x480024(++_0x1cb3b7);}(_0xb375,0x9c));var _0x5b37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb375[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var _=require(_0x5b37('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5b37('0x1'));var crypto=require(_0x5b37('0x2'));var logger=require(_0x5b37('0x3'))(_0x5b37('0x4'));module[_0x5b37('0x5')]=function(_0x19f0f4,_0x3ad073,_0x56bcb0,_0x582b9b){return new BPromise(function(_0x93fbab,_0x5a7401){logger[_0x5b37('0x6')](_0x5b37('0x7'),_0x582b9b||_0x5b37('0x8'));var _0x26ff69=new WebSocket(_0x582b9b||_0x5b37('0x8'),{'perMessageDeflate':![]});var _0x25e3e5='';var _0x2d29d4='0';var _0x105010='1';var _0x5ef32d=_0x5b37('0x9');function _0x5aeb5d(_0x60583f){var _0x507a7b=crypto[_0x5b37('0xa')](_0x5b37('0xb'));_0x507a7b['update'](_0x60583f);return _0x507a7b[_0x5b37('0xc')]('hex');}function _0x1a9bef(){try{logger[_0x5b37('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x37f74a=moment()[_0x5b37('0xd')]();var _0x394f85=_0x5aeb5d(_0x37f74a+_0x3ad073+_0x56bcb0);_0x26ff69['send'](JSON[_0x5b37('0xe')]({'appID':_0x3ad073,'timestamp':_0x37f74a,'appKey':_0x394f85}));var _0x57e035=fs[_0x5b37('0xf')](_0x19f0f4);_0x57e035['on'](_0x5b37('0x10'),function(_0x3a0179){_0x26ff69['send'](_0x3a0179);});_0x57e035['on']('close',function(){_0x26ff69[_0x5b37('0x11')](_0x5b37('0x12'));});}catch(_0x276434){logger['error'](_0x5b37('0x13'),JSON[_0x5b37('0xe')](_0x276434));_0x26ff69[_0x5b37('0x14')]();}}function _0x30bfb2(_0x3eeb69){try{if(_0x3eeb69){var _0x345e49=JSON['parse'](_0x3eeb69);switch(_0x345e49[_0x5b37('0x15')]){case 0x0:if(_0x345e49['result']){if(_0x345e49[_0x5b37('0x16')][_0x5b37('0x17')]){logger[_0x5b37('0x6')](_0x5b37('0x18'),JSON[_0x5b37('0xe')](_0x345e49[_0x5b37('0x16')][_0x5b37('0x19')]));_0x25e3e5=_0x345e49[_0x5b37('0x16')][_0x5b37('0x19')][0x0][_0x5b37('0x1a')];_0x2d29d4=_0x345e49[_0x5b37('0x16')][_0x5b37('0x19')][0x0]['likelihood'];_0x105010='0';_0x5ef32d=_0x5b37('0x1b');_0x26ff69['terminate']();}}break;case 0x1:logger[_0x5b37('0x6')](_0x5b37('0x9'));_0x105010='1';_0x5ef32d=_0x5b37('0x9');break;case 0x2:logger[_0x5b37('0x6')](_0x5b37('0x1c'));_0x105010='2';_0x5ef32d=_0x5b37('0x1c');break;case 0x9:logger[_0x5b37('0x6')](_0x5b37('0x1d'));_0x105010='9';_0x5ef32d=_0x5b37('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x105010='10';_0x5ef32d=_0x5b37('0x1e');break;case 0xb:logger['info'](_0x5b37('0x1f'));_0x105010='11';_0x5ef32d=_0x5b37('0x1f');}}}catch(_0x261890){logger['error'](_0x5b37('0x20'),JSON[_0x5b37('0xe')](_0x261890));_0x26ff69[_0x5b37('0x14')]();}}function _0x33d38c(){logger[_0x5b37('0x6')](_0x5b37('0x21'));_0x93fbab({'transcript':_0x25e3e5,'confidence':_0x2d29d4,'status':_0x105010,'status_message':_0x5ef32d});}function _0x660d10(_0x26c6f7){logger[_0x5b37('0x22')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x26c6f7)){logger[_0x5b37('0x22')](_[_0x5b37('0x23')](_0x26c6f7)?JSON[_0x5b37('0xe')](_0x26c6f7):_0x26c6f7);}}_0x26ff69['on'](_0x5b37('0x24'),_0x1a9bef);_0x26ff69['on'](_0x5b37('0x25'),_0x30bfb2);_0x26ff69['on'](_0x5b37('0x26'),_0x33d38c);_0x26ff69['on'](_0x5b37('0x22'),_0x660d10);});}; \ No newline at end of file +var _0x57f9=['Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','open','close','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','send','stringify','data','error','Tilde\x20ASR\x20send\x20error','terminate','final','Tilde\x20ASR\x20hypoteses','result','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x8a3fb7,_0x1c1632){var _0x1d4606=function(_0x3061e5){while(--_0x3061e5){_0x8a3fb7['push'](_0x8a3fb7['shift']());}};_0x1d4606(++_0x1c1632);}(_0x57f9,0xd3));var _0x957f=function(_0x6dd195,_0x2898ea){_0x6dd195=_0x6dd195-0x0;var _0x48ef7d=_0x57f9[_0x6dd195];return _0x48ef7d;};'use strict';var BPromise=require(_0x957f('0x0'));var _=require(_0x957f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x957f('0x2'));var logger=require(_0x957f('0x3'))(_0x957f('0x4'));module[_0x957f('0x5')]=function(_0x5868f1,_0x22c29d,_0x4f2e4e,_0x3835d7){return new BPromise(function(_0x45ce03,_0x27a9d4){logger[_0x957f('0x6')]('Tilde\x20URI',_0x3835d7||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x301df1=new WebSocket(_0x3835d7||_0x957f('0x7'),{'perMessageDeflate':![]});var _0x5037c2='';var _0x437de7='0';var _0x3a0eaa='1';var _0x1ee4e1=_0x957f('0x8');function _0x18092e(_0xa893e){var _0x3b88aa=crypto[_0x957f('0x9')](_0x957f('0xa'));_0x3b88aa[_0x957f('0xb')](_0xa893e);return _0x3b88aa[_0x957f('0xc')](_0x957f('0xd'));}function _0x2e0daa(){try{logger[_0x957f('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0xa20c67=moment()['unix']();var _0x5da239=_0x18092e(_0xa20c67+_0x22c29d+_0x4f2e4e);_0x301df1[_0x957f('0xe')](JSON[_0x957f('0xf')]({'appID':_0x22c29d,'timestamp':_0xa20c67,'appKey':_0x5da239}));var _0x15ff7e=fs['createReadStream'](_0x5868f1);_0x15ff7e['on'](_0x957f('0x10'),function(_0xb1777){_0x301df1[_0x957f('0xe')](_0xb1777);});_0x15ff7e['on']('close',function(){_0x301df1[_0x957f('0xe')]('EOS');});}catch(_0x1001b5){logger[_0x957f('0x11')](_0x957f('0x12'),JSON['stringify'](_0x1001b5));_0x301df1[_0x957f('0x13')]();}}function _0xcc65d0(_0x334497){try{if(_0x334497){var _0xaeccbb=JSON['parse'](_0x334497);switch(_0xaeccbb['status']){case 0x0:if(_0xaeccbb['result']){if(_0xaeccbb['result'][_0x957f('0x14')]){logger[_0x957f('0x6')](_0x957f('0x15'),JSON[_0x957f('0xf')](_0xaeccbb[_0x957f('0x16')]['hypotheses']));_0x5037c2=_0xaeccbb['result']['hypotheses'][0x0][_0x957f('0x17')];_0x437de7=_0xaeccbb[_0x957f('0x16')]['hypotheses'][0x0]['likelihood'];_0x3a0eaa='0';_0x1ee4e1=_0x957f('0x18');_0x301df1['terminate']();}}break;case 0x1:logger['info'](_0x957f('0x8'));_0x3a0eaa='1';_0x1ee4e1=_0x957f('0x8');break;case 0x2:logger[_0x957f('0x6')](_0x957f('0x19'));_0x3a0eaa='2';_0x1ee4e1=_0x957f('0x19');break;case 0x9:logger[_0x957f('0x6')](_0x957f('0x1a'));_0x3a0eaa='9';_0x1ee4e1=_0x957f('0x1a');break;case 0xa:logger[_0x957f('0x6')]('Authentication\x20failed.');_0x3a0eaa='10';_0x1ee4e1=_0x957f('0x1b');break;case 0xb:logger[_0x957f('0x6')](_0x957f('0x1c'));_0x3a0eaa='11';_0x1ee4e1=_0x957f('0x1c');}}}catch(_0x3d4f34){logger[_0x957f('0x11')](_0x957f('0x1d'),JSON[_0x957f('0xf')](_0x3d4f34));_0x301df1['terminate']();}}function _0x31ed6d(){logger[_0x957f('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x45ce03({'transcript':_0x5037c2,'confidence':_0x437de7,'status':_0x3a0eaa,'status_message':_0x1ee4e1});}function _0x3e782b(_0x4191cb){logger['error'](_0x957f('0x1e'));if(!_[_0x957f('0x1f')](_0x4191cb)){logger[_0x957f('0x11')](_['isObject'](_0x4191cb)?JSON['stringify'](_0x4191cb):_0x4191cb);}}_0x301df1['on'](_0x957f('0x20'),_0x2e0daa);_0x301df1['on']('message',_0xcc65d0);_0x301df1['on'](_0x957f('0x21'),_0x31ed6d);_0x301df1['on'](_0x957f('0x11'),_0x3e782b);});}; \ 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 ec823d0..c9241a1 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 _0xc2b8=['exports','./asr'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc2b8,0x1d9));var _0x8c2b=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0xc2b8[_0x484cac];return _0x1d6e77;};var asr=require(_0x8c2b('0x0'));module[_0x8c2b('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8f3d=['./asr','exports'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x8f3d,0xa8));var _0xd8f3=function(_0x836478,_0xe5914b){_0x836478=_0x836478-0x0;var _0x514664=_0x8f3d[_0x836478];return _0x514664;};var asr=require(_0xd8f3('0x0'));module[_0xd8f3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5a8ebc0..1e4498b 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 _0xf7af=['E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','./channel','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close'];(function(_0x180347,_0x3f73d4){var _0x3ad53c=function(_0xce1b03){while(--_0xce1b03){_0x180347['push'](_0x180347['shift']());}};_0x3ad53c(++_0x3f73d4);}(_0xf7af,0x1bd));var _0xff7a=function(_0x348722,_0xc6f898){_0x348722=_0x348722-0x0;var _0x14fdd1=_0xf7af[_0x348722];return _0x14fdd1;};'use strict';var util=require('util');var net=require(_0xff7a('0x0'));var EventEmitter=require(_0xff7a('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0xff7a('0x2'));var AGIServer=function(_0x136577,_0x454a7b,_0x147606){var _0x5416e2=this,_0x136577=_0x136577||0x11dd,_0x454a7b=_0x454a7b||'127.0.0.1',_0x22906e=null,_0x2870da=0x0;EventEmitter['call'](_0x5416e2);function _0x4eb395(){if(!_0x136577){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x4'),new AGIError(_0xff7a('0x5')));return![];}_0x22906e=net[_0xff7a('0x6')]();_0x22906e[_0xff7a('0x7')](_0x136577,_0x454a7b);_0x22906e['on']('listening',function(){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x8'));});_0x22906e['on'](_0xff7a('0x9'),function(_0x155ded){_0x22906e[_0xff7a('0xa')](function(_0x9c85f2,_0x28ad34){if(_0x9c85f2){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x4'),new AGIError(_0xff7a('0xb'),_0x9c85f2));}else if(_0x147606&&_0x147606<0x0){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x4'),new AGIError(_0xff7a('0xc')));_0x155ded[_0xff7a('0xd')]();}else if(_0x147606&&_0x147606>0x0&&_0x147606<_0x28ad34){_0x2870da+=0x1;_0x5416e2[_0xff7a('0x3')](_0xff7a('0x4'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2870da));_0x155ded['destroy']();}else{var _0x590945=new AGIChannel(_0x155ded);_0x590945['on'](_0xff7a('0xe'),function(){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x9'),_0x590945);});}});});_0x22906e['on']('error',function(_0x3326b3){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x4'),new AGIError(_0xff7a('0xb'),_0x3326b3[_0xff7a('0xf')]));});_0x22906e['on']('close',function(){_0x5416e2[_0xff7a('0x3')](_0xff7a('0x10'),new AGIError(_0xff7a('0x11')));});}process[_0xff7a('0x12')](function(){_0x4eb395();});};util[_0xff7a('0x13')](AGIServer,EventEmitter);module[_0xff7a('0x14')]=function(_0x24a705,_0x38e217,_0x3abc8b){return new AGIServer(_0x24a705,_0x38e217,_0x3abc8b);}; \ No newline at end of file +var _0xa49d=['createServer','listen','emit','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','./error','./channel','127.0.0.1','call','error'];(function(_0x56ef1e,_0x3226f2){var _0x19e171=function(_0x5d9414){while(--_0x5d9414){_0x56ef1e['push'](_0x56ef1e['shift']());}};_0x19e171(++_0x3226f2);}(_0xa49d,0x142));var _0xda49=function(_0x28caa5,_0x5643e0){_0x28caa5=_0x28caa5-0x0;var _0x1e0d91=_0xa49d[_0x28caa5];return _0x1e0d91;};'use strict';var util=require(_0xda49('0x0'));var net=require(_0xda49('0x1'));var EventEmitter=require(_0xda49('0x2'))['EventEmitter'];var AGIError=require(_0xda49('0x3'));var AGIChannel=require(_0xda49('0x4'));var AGIServer=function(_0x4c0021,_0x13822a,_0x570db9){var _0x5127ff=this,_0x4c0021=_0x4c0021||0x11dd,_0x13822a=_0x13822a||_0xda49('0x5'),_0x148ecd=null,_0xaea5f2=0x0;EventEmitter[_0xda49('0x6')](_0x5127ff);function _0x3eeb2d(){if(!_0x4c0021){_0x5127ff['emit'](_0xda49('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x148ecd=net[_0xda49('0x8')]();_0x148ecd[_0xda49('0x9')](_0x4c0021,_0x13822a);_0x148ecd['on']('listening',function(){_0x5127ff[_0xda49('0xa')](_0xda49('0xb'));});_0x148ecd['on'](_0xda49('0xc'),function(_0xf39a23){_0x148ecd[_0xda49('0xd')](function(_0x1d91b0,_0x10e12a){if(_0x1d91b0){_0x5127ff[_0xda49('0xa')]('error',new AGIError(_0xda49('0xe'),_0x1d91b0));}else if(_0x570db9&&_0x570db9<0x0){_0x5127ff[_0xda49('0xa')](_0xda49('0x7'),new AGIError(_0xda49('0xf')));_0xf39a23[_0xda49('0x10')]();}else if(_0x570db9&&_0x570db9>0x0&&_0x570db9<_0x10e12a){_0xaea5f2+=0x1;_0x5127ff[_0xda49('0xa')](_0xda49('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xaea5f2));_0xf39a23['destroy']();}else{var _0x1ce8fe=new AGIChannel(_0xf39a23);_0x1ce8fe['on']('ready',function(){_0x5127ff[_0xda49('0xa')]('connection',_0x1ce8fe);});}});});_0x148ecd['on'](_0xda49('0x7'),function(_0x32e0bc){_0x5127ff['emit']('error',new AGIError(_0xda49('0xe'),_0x32e0bc['code']));});_0x148ecd['on'](_0xda49('0x11'),function(){_0x5127ff[_0xda49('0xa')](_0xda49('0x11'),new AGIError(_0xda49('0x12')));});}process[_0xda49('0x13')](function(){_0x3eeb2d();});};util[_0xda49('0x14')](AGIServer,EventEmitter);module[_0xda49('0x15')]=function(_0x532890,_0x2d0dd2,_0x1c8981){return new AGIServer(_0x532890,_0x2d0dd2,_0x1c8981);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index cf86ea1..c18147a 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 _0x731b=['getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','key','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','phone','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','wav','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','queue_id','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','recordFile','escape_digits','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','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','arg_1','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getTrunk','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isNil','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','restAPI','method','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','headers','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','includes','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','replaceAllVariables','saveRestApiResult','isEmpty','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','info','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','sync','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected'];(function(_0x9d240c,_0x3fd5ed){var _0x26ec2e=function(_0x33d9ce){while(--_0x33d9ce){_0x9d240c['push'](_0x9d240c['shift']());}};_0x26ec2e(++_0x3fd5ed);}(_0x731b,0xf7));var _0xb731=function(_0x3e5c22,_0x15887a){_0x3e5c22=_0x3e5c22-0x0;var _0x1391a7=_0x731b[_0x3e5c22];return _0x1391a7;};'use strict';var fs=require('fs');var path=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var _=require('lodash');var sh=require(_0xb731('0x2'));var odbc=require(_0xb731('0x3'))();var rs=require(_0xb731('0x4'));var moment=require(_0xb731('0x5'));var Mustache=require(_0xb731('0x6'));var rp=require(_0xb731('0x7'));var logger=require('../../config/logger')(_0xb731('0x8'));var config=require(_0xb731('0x9'));var scripts=require(_0xb731('0xa'));var FILES_PATH=_0xb731('0xb');var recursiveMapAttributes=[_0xb731('0xc'),_0xb731('0xd')];var verticesWithRetry=[_0xb731('0xe'),'getdigits',_0xb731('0xf')];var AGIVertices=function(_0xfd6c16,_0xf9db3,_0x26488c){this[_0xb731('0x10')]=_0xfd6c16;this[_0xb731('0x11')]=_0xf9db3;this[_0xb731('0x12')]=_0x26488c;};AGIVertices[_0xb731('0x13')][_0xb731('0x14')]=function(_0x2bb336,_0x131d88){this[_0xb731('0x11')][_0xb731('0x15')](_0x2bb336)[_0xb731('0x16')](function(_0xc002e7){_0x131d88(null,_0xc002e7?_0xc002e7['name']:![]);})[_0xb731('0x17')](function(_0x5f4f12){_0x131d88(_0x5f4f12);});};AGIVertices[_0xb731('0x13')][_0xb731('0x18')]=function(_0x31fba7,_0x5b668d){this[_0xb731('0x11')]['getVoiceQueueById'](_0x31fba7)['then'](function(_0x579641){_0x5b668d(null,_0x579641?_0x579641[_0xb731('0x19')]:![]);})[_0xb731('0x17')](function(_0x4962e8){_0x5b668d(_0x4962e8);});};AGIVertices[_0xb731('0x13')][_0xb731('0x1a')]=function(_0x5e4ca6,_0x30da75){this[_0xb731('0x11')][_0xb731('0x1b')](_0x5e4ca6)[_0xb731('0x16')](function(_0x4e0c6d){_0x30da75(null,_0x4e0c6d?_0x4e0c6d[_0xb731('0x19')]:![]);})[_0xb731('0x17')](function(_0x30eff7){_0x30da75(_0x30eff7);});};AGIVertices[_0xb731('0x13')]['getSquareOdbc']=function(_0x1f9de6,_0x50a758){this['rpc'][_0xb731('0x1c')](_0x1f9de6)['then'](function(_0x396997){_0x50a758(null,_0x396997?_0x396997[_0xb731('0x1d')]:![]);})[_0xb731('0x17')](function(_0x36374e){_0x50a758(_0x36374e);});};AGIVertices[_0xb731('0x13')]['getUser']=function(_0x5670f5,_0x16fabf){this[_0xb731('0x11')]['getUserById'](_0x5670f5)['then'](function(_0x12a0df){_0x16fabf(null,_0x12a0df?_0x12a0df['name']:![]);})[_0xb731('0x17')](function(_0x15be09){_0x16fabf(_0x15be09);});};AGIVertices['prototype'][_0xb731('0x1e')]=function(_0x1a812b,_0x293f95){this[_0xb731('0x11')]['getTrunkById'](_0x1a812b)[_0xb731('0x16')](function(_0x14904e){_0x293f95(null,_0x14904e?_0x14904e[_0xb731('0x19')]:![]);})[_0xb731('0x17')](function(_0x17ab32){_0x293f95(_0x17ab32);});};AGIVertices['prototype']['getSound']=function(_0x21ccd0,_0x3519c8){var _0x513a26=this;this['rpc'][_0xb731('0x1f')](_0x21ccd0)['then'](function(_0x41f8d3){_0x3519c8(null,_0x41f8d3?_0x513a26['getSoundPath'](_0x41f8d3[_0xb731('0x20')]):![]);})[_0xb731('0x17')](function(_0xc14f79){_0x3519c8(_0xc14f79);});};AGIVertices[_0xb731('0x13')][_0xb731('0x21')]=function(_0x485e86,_0x53ba29){this['rpc'][_0xb731('0x22')](_0x485e86)[_0xb731('0x16')](function(_0x325a04){_0x53ba29(null,_0x325a04?_0x325a04:![]);})['catch'](function(_0x189b34){_0x53ba29(_0x189b34);});};AGIVertices['prototype'][_0xb731('0x23')]=function(_0xbcb6a,_0x4918f7,_0x1efc04){this[_0xb731('0x12')]['sendMailMessage'](_0xbcb6a,_0x4918f7)[_0xb731('0x16')](function(){_0x1efc04(null);})[_0xb731('0x17')](function(_0x3e1249){_0x1efc04(_0x3e1249);});};AGIVertices[_0xb731('0x13')][_0xb731('0x24')]=function(_0x330980,_0x2197f5){this['rpc'][_0xb731('0x25')](_0x330980)[_0xb731('0x16')](function(_0x215c64){if(_0x215c64){if(_0x215c64[_0xb731('0x26')]){_0x2197f5(null,[_0x215c64[_0xb731('0x27')]]);}else{_0x2197f5(null,_[_0xb731('0x28')](_0x215c64[_0xb731('0x29')],_0xb731('0x27')));}}else{_0x2197f5(null,![]);}})[_0xb731('0x17')](function(_0x285442){_0x2197f5(_0x285442);});};AGIVertices[_0xb731('0x13')][_0xb731('0x2a')]=function(_0x3aab02){return util[_0xb731('0x2b')](_0xb731('0x2c'),FILES_PATH,_0x3aab02);};AGIVertices[_0xb731('0x13')][_0xb731('0x2d')]=function(_0x2b7a79,_0x4cbff7,_0x29363c){odbc['open'](_0x2b7a79,function(_0x281e48){if(_0x281e48){logger[_0xb731('0x2e')](_0xb731('0x2f'),_0x281e48);_0x29363c(_0x281e48);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xb731('0x30')](_0x4cbff7,function(_0x296a56,_0x72bd79){if(_0x296a56){logger['info']('Error\x20executing\x20query\x20%s',_0x4cbff7);_0x29363c(_0x296a56);}else{logger['info'](_0xb731('0x31'),_0x4cbff7);odbc[_0xb731('0x32')](function(_0x42205f){if(_0x42205f){logger[_0xb731('0x2e')](_0xb731('0x33'),_0x42205f);}_0x29363c(null,_0x72bd79);});}});}});};AGIVertices[_0xb731('0x13')][_0xb731('0x34')]=function(_0x321441,_0x350a4d){this[_0xb731('0x11')][_0xb731('0x35')](_0x321441)[_0xb731('0x16')](function(_0x1b7936){_0x350a4d(null,_0x1b7936?_0x1b7936:![]);})[_0xb731('0x17')](function(_0x381496){_0x350a4d(_0x381496);});};AGIVertices[_0xb731('0x13')][_0xb731('0x36')]=function(_0x3eb22f,_0x9d33b0){this[_0xb731('0x11')][_0xb731('0x36')](_0x3eb22f)[_0xb731('0x16')](function(_0x11b1d2){_0x9d33b0(null,_0x11b1d2);})['catch'](function(_0x43e9ca){_0x9d33b0(_0x43e9ca);});};AGIVertices[_0xb731('0x13')][_0xb731('0x37')]=function(_0x2078d1,_0x4f49f3,_0x5394b2){this[_0xb731('0x11')][_0xb731('0x37')]({'uniqueid':this[_0xb731('0x10')][_0xb731('0x38')],'node':_0x2078d1[_0xb731('0x39')],'application':_0x2078d1[_0xb731('0x3a')],'data':_0x4f49f3||null,'project_name':this[_0xb731('0x10')]['arg_1'],'callerid':this[_0xb731('0x10')][_0xb731('0x3b')]})[_0xb731('0x16')](function(_0x4f80ff){if(_0x5394b2){_0x5394b2(null,_0x4f80ff);}})[_0xb731('0x17')](function(_0x46f01a){if(_0x5394b2){_0x5394b2(_0x46f01a);}});};AGIVertices[_0xb731('0x13')][_0xb731('0x3c')]=function(_0x401a9c,_0xbdc0fb,_0x35d516,_0x4436eb){this[_0xb731('0x11')]['createSquareRecording']({'uniqueid':this['channel'][_0xb731('0x38')],'callerid':this[_0xb731('0x10')][_0xb731('0x3b')],'calleridname':this[_0xb731('0x10')][_0xb731('0x3d')],'context':this[_0xb731('0x10')][_0xb731('0x3e')],'extension':this[_0xb731('0x10')]['extension'],'priority':this['channel'][_0xb731('0x3f')],'accountcode':this[_0xb731('0x10')][_0xb731('0x40')],'dnid':this[_0xb731('0x10')]['dnid'],'projectName':this[_0xb731('0x10')]['arg_1'],'saveName':_0xbdc0fb,'filename':_0x401a9c[_0xb731('0x41')]||_0xbdc0fb,'savePath':_0x35d516})[_0xb731('0x16')](function(_0x493f70){_0x4436eb(null,_0x493f70);})['catch'](function(_0x3a536e){_0x4436eb(_0x3a536e);});};AGIVertices['prototype'][_0xb731('0x42')]=function(_0x46f20a,_0xb699d,_0x4db993,_0x261e2d,_0x166419){this[_0xb731('0x11')][_0xb731('0x42')]({'uniqueid':this[_0xb731('0x10')]['uniqueid'],'body':_0x46f20a,'direction':_0xb699d,'providerName':_0x4db993,'providerResponse':_0x261e2d})[_0xb731('0x16')](function(_0x4cf35d){if(_0x166419){_0x166419(null,_0x4cf35d);}})['catch'](function(_0x45b174){if(_0x166419){_0x166419(_0x45b174);}});};AGIVertices[_0xb731('0x13')][_0xb731('0x43')]=function(_0x1b699f,_0x26bc63){this[_0xb731('0x11')][_0xb731('0x43')]({'firstName':_['isEmpty'](_0x1b699f[_0xb731('0x19')])||_[_0xb731('0x44')](_0x1b699f[_0xb731('0x19')])?'callback_'+Math['random']():_0x1b699f[_0xb731('0x19')],'lastName':_['isEmpty'](_0x1b699f[_0xb731('0x45')])||_[_0xb731('0x44')](_0x1b699f[_0xb731('0x45')])?null:_0x1b699f[_0xb731('0x45')],'phone':_0x1b699f['phone'],'ListId':_0x1b699f[_0xb731('0x46')],'scheduledat':_0x1b699f['scheduledAt'],'callbackUniqueid':this['channel'][_0xb731('0x38')],'tags':_0xb731('0x47'),'description':_0xb731('0x48')+_0x1b699f[_0xb731('0x49')][_0xb731('0x4a')](),'priority':_0x1b699f[_0xb731('0x4b')]})['then'](function(_0x2cdf17){_0x26bc63(null,_0x2cdf17);})[_0xb731('0x17')](function(_0x3c9ad2){_0x26bc63(_0x3c9ad2);});};AGIVertices[_0xb731('0x13')][_0xb731('0x4c')]=function(_0x5418ea,_0x5f0788){this[_0xb731('0x11')][_0xb731('0x4d')](_0x5418ea)[_0xb731('0x16')](function(_0x84a0c3){_0x5f0788(null,_0x84a0c3?_0x84a0c3[_0xb731('0x19')]:![]);})[_0xb731('0x17')](function(_0x4c4132){_0x5f0788(_0x4c4132);});};AGIVertices[_0xb731('0x13')][_0xb731('0x4e')]=function(_0x21f044,_0x5a4eab,_0x4796a8){var _0x14085e={'role':_0xb731('0x4f')};_0x14085e[_0x21f044]=this[_0xb731('0x10')][_0xb731('0x3b')];this[_0xb731('0x11')][_0xb731('0x4e')](_0x14085e,_0x5a4eab,this['channel'][_0xb731('0x38')])[_0xb731('0x16')](function(_0x39f272){_0x4796a8(null,_[_0xb731('0x44')](_0x39f272)?![]:!![]);})[_0xb731('0x17')](function(_0x380a24){logger[_0xb731('0x2e')](_0x380a24);_0x4796a8(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x515e84,_0x26ce8e){var _0x29832f={'role':'agent'};_0x29832f[_0x515e84]=this[_0xb731('0x10')][_0xb731('0x3b')];this['rpc'][_0xb731('0x50')](_0x29832f)[_0xb731('0x16')](function(_0x57fd3f){_0x26ce8e(null,_[_0xb731('0x44')](_0x57fd3f)?![]:!![]);})[_0xb731('0x17')](function(_0x5a1e40){logger[_0xb731('0x2e')](_0x5a1e40);_0x26ce8e(null,![]);});};AGIVertices[_0xb731('0x13')][_0xb731('0x51')]=function(_0x5bee28,_0x2047fc){var _0x1f64c7={'role':_0xb731('0x4f')};_0x1f64c7[_0x5bee28]=this[_0xb731('0x10')][_0xb731('0x3b')];this['rpc'][_0xb731('0x51')](_0x1f64c7)[_0xb731('0x16')](function(_0x461f22){_0x2047fc(null,_[_0xb731('0x44')](_0x461f22)?![]:!![]);})[_0xb731('0x17')](function(_0x3424d1){logger[_0xb731('0x2e')](_0x3424d1);_0x2047fc(null,![]);});};AGIVertices[_0xb731('0x13')][_0xb731('0x52')]=function(_0x4c9dc5,_0xd091f9){var _0x417fc2={'role':_0xb731('0x4f')};_0x417fc2[_0x4c9dc5]=this['channel']['callerid'];var _0x3e2643=_0x4c9dc5!='internal'?util[_0xb731('0x2b')](_0xb731('0x53'),_0xb731('0x54'),this[_0xb731('0x10')][_0xb731('0x3b')]):undefined;this['rpc'][_0xb731('0x52')](_0x417fc2,_0x3e2643)[_0xb731('0x16')](function(_0x1b6b62){_0xd091f9(null,_[_0xb731('0x44')](_0x1b6b62)?![]:!![]);})['catch'](function(_0x556a1e){logger[_0xb731('0x2e')](_0x556a1e);_0xd091f9(null,![]);});};AGIVertices[_0xb731('0x13')][_0xb731('0x55')]=function(_0x578127,_0xac1ce4){sh[_0xb731('0x56')](_[_0xb731('0x57')](_0x578127),function(_0x462ea9,_0x232700){var _0x583cc6=_0x232700[_0xb731('0x58')](/(\r\n|\n|\r)/gm,'');_0xac1ce4(null,_0x583cc6);});};AGIVertices[_0xb731('0x13')][_0xb731('0x59')]=function(_0x281938,_0x171ffd){scripts[_0xb731('0x59')](_0x281938[_0xb731('0x5a')],_0x281938[_0xb731('0x5b')]||_0xb731('0x5c'),_0x281938[_0xb731('0x5c')],_0x281938[_0xb731('0x5d')]||_0xb731('0x5e'),_0x281938['ssmlGender']||_0xb731('0x5f'),_0x281938[_0xb731('0x60')]||'MP3')[_0xb731('0x16')](function(_0x1723e4){_0x171ffd(null,_0x1723e4);})[_0xb731('0x17')](function(_0x4c0826){_0x171ffd(_0x4c0826);});};AGIVertices[_0xb731('0x13')][_0xb731('0x61')]=function(_0x41a5cd,_0x5985f1){scripts['googleTTS'](_0x41a5cd[_0xb731('0x5c')],_0x41a5cd['google_tts_language']||'en',0x1)[_0xb731('0x16')](function(_0x537028){_0x5985f1(null,_0x537028);})['catch'](function(_0x5bdf28){_0x5985f1(_0x5bdf28);});};AGIVertices[_0xb731('0x13')][_0xb731('0x62')]=function(_0xc10bdd,_0x46b34a){var _0x3564b6={'uri':_0xc10bdd['url'],'method':_0xc10bdd[_0xb731('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xc10bdd[_0xb731('0x64')])==='number'&&parseInt(_0xc10bdd[_0xb731('0x64')])>=0x1?parseInt(_0xc10bdd[_0xb731('0x64')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xb731('0x65'),_0xb731('0x66')],_0x3564b6[_0xb731('0x63')][_0xb731('0x67')]())){try{_0x3564b6[_0xb731('0x68')]=_0xc10bdd[_0xb731('0xd')]?JSON[_0xb731('0x69')](_0xc10bdd[_0xb731('0xd')]):{};}catch(_0xeebf6){logger[_0xb731('0x2e')](_0xb731('0x6a'),_0xeebf6);}}try{_0x3564b6['headers']=_0xc10bdd[_0xb731('0xc')]?JSON[_0xb731('0x69')](_0xc10bdd[_0xb731('0xc')]):{};}catch(_0x14b07b){logger['error'](_0xb731('0x6b'),_0x14b07b);}if(_0xc10bdd[_0xb731('0x6c')]){try{var _0x8344c9=require(_0xc10bdd[_0xb731('0x6c')])['sync'](this,_0x3564b6);_0x3564b6[_0xb731('0x6d')]=Mustache['render'](_0xc10bdd['url'],_0x8344c9,{},['$$','$$']);if(_0x3564b6[_0xb731('0x6e')]){_0x3564b6[_0xb731('0x6e')]=JSON['parse'](Mustache[_0xb731('0x6f')](JSON[_0xb731('0x70')](_0x3564b6[_0xb731('0x6e')]),_0x8344c9,{},['$$','$$']));}if(_0x3564b6['body']){_0x3564b6[_0xb731('0x68')]=JSON[_0xb731('0x69')](Mustache[_0xb731('0x6f')](JSON[_0xb731('0x70')](_0x3564b6['body']),_0x8344c9,{},['$$','$$']));}}catch(_0x3fb3ec){logger['error'](_0xb731('0x71'),_0x3fb3ec);}}rp(_0x3564b6)[_0xb731('0x16')](function(_0x324fa5){var _0x45c126={'statusCode':_0x324fa5[_0xb731('0x72')]||0xc8,'statusMessage':_0x324fa5[_0xb731('0x73')]||'OK','headers':_0x324fa5['headers']||{},'body':_0x324fa5[_0xb731('0x68')]||{}};_0x46b34a(null,_0x45c126);})[_0xb731('0x17')](function(_0x5d32ee){var _0x188e5e={'statusCode':_0x5d32ee[_0xb731('0x72')]||0x1f4,'statusMessage':_0x5d32ee[_0xb731('0x74')]||_0xb731('0x75'),'headers':_0x5d32ee['options'][_0xb731('0x6e')]||{},'body':_0x5d32ee[_0xb731('0x76')][_0xb731('0x68')]||{}};_0x46b34a(null,_0x188e5e);});};AGIVertices['prototype'][_0xb731('0x77')]=function(_0x599d9d,_0x30a29d){scripts[_0xb731('0x77')](this[_0xb731('0x10')][_0xb731('0x38')],_0x599d9d['key'],_0x599d9d['text'],_0x599d9d[_0xb731('0x78')]||'en')['then'](function(_0x24c776){_0x30a29d(null,_0x24c776);})[_0xb731('0x17')](function(_0x49303a){_0x30a29d(_0x49303a);});};AGIVertices[_0xb731('0x13')]['googleDialogflowV2']=function(_0x38f4fd,_0x123c35){scripts[_0xb731('0x79')](this['channel']['uniqueid'],_0x38f4fd[_0xb731('0x7a')],_0x38f4fd[_0xb731('0x7b')],_0x38f4fd[_0xb731('0x7c')],_0x38f4fd[_0xb731('0x5c')],_0x38f4fd[_0xb731('0x7d')]||'en')[_0xb731('0x16')](function(_0x49f5dd){_0x123c35(null,_0x49f5dd);})['catch'](function(_0x52afe5){_0x123c35(_0x52afe5);});};AGIVertices[_0xb731('0x13')][_0xb731('0x7e')]=function(_0x32b9bb,_0x32ea63){scripts[_0xb731('0x7e')](this['channel'],_0x32b9bb)[_0xb731('0x16')](function(_0x4a5f8a){_0x32ea63(null,_0x4a5f8a);})['catch'](function(_0x9ceffd){_0x32ea63(_0x9ceffd);});};AGIVertices[_0xb731('0x13')]['ispeechTTS']=function(_0x1efc96,_0x1cbcc4){scripts['ispeechTTS'](_0x1efc96['key'],_0x1efc96[_0xb731('0x5c')],_0x1efc96[_0xb731('0x7f')]||'en-US',_0x1efc96[_0xb731('0x80')])['then'](function(_0x54f2ab){_0x1cbcc4(null,_0x54f2ab);})[_0xb731('0x17')](function(_0xf4822d){_0x1cbcc4(_0xf4822d);});};AGIVertices['prototype'][_0xb731('0x81')]=function(_0xa56838,_0xcf9bdd,_0xd859a){scripts[_0xb731('0x81')](_0xcf9bdd,_0xa56838['key'],_0xa56838[_0xb731('0x82')]||'en-US',this[_0xb731('0x83')](_0xa56838[_0xb731('0x84')])?_0xa56838[_0xb731('0x84')]:undefined)[_0xb731('0x16')](function(_0x3931f3){_0xd859a(null,_0x3931f3);})['catch'](function(_0x3bb768){_0xd859a(_0x3bb768);});};AGIVertices[_0xb731('0x13')][_0xb731('0x85')]=function(_0x38915e,_0x316076){scripts[_0xb731('0x85')](_0x38915e[_0xb731('0x86')],_0x38915e['aws_secret_access_key'],_0x38915e[_0xb731('0x87')],_0x38915e[_0xb731('0x88')]||'Amy',_0x38915e[_0xb731('0x5c')],_0x38915e['aws_text_type']||_0xb731('0x5c'))[_0xb731('0x16')](function(_0x39a86e){_0x316076(null,_0x39a86e);})[_0xb731('0x17')](function(_0x3c5db9){_0x316076(_0x3c5db9);});};AGIVertices['prototype'][_0xb731('0x89')]=function(_0x51b275,_0x31de47){scripts['awsLex'](this['channel']['uniqueid'],_0x51b275['aws_access_key_id'],_0x51b275['aws_secret_access_key'],_0x51b275['aws_lex_region'],_0x51b275[_0xb731('0x5c')],_0x51b275[_0xb731('0x8a')])[_0xb731('0x16')](function(_0x2e7c21){_0x31de47(null,_0x2e7c21);})[_0xb731('0x17')](function(_0x2b5c21){_0x31de47(_0x2b5c21);});};AGIVertices[_0xb731('0x13')][_0xb731('0x8b')]=function(_0x83c600,_0x29df0d,_0x5e7b69){scripts[_0xb731('0x8b')](_0x29df0d,_0x83c600['key'],_0x83c600[_0xb731('0x8c')]||'en-US')[_0xb731('0x16')](function(_0x314e4d){_0x5e7b69(null,_0x314e4d);})[_0xb731('0x17')](function(_0x5521fd){_0x5e7b69(_0x5521fd);});};AGIVertices[_0xb731('0x13')][_0xb731('0x8d')]=function(_0x5ddfb9,_0x3dfe1b,_0x2bba83){scripts[_0xb731('0x8d')](_0x3dfe1b,_0x5ddfb9[_0xb731('0x8e')],_0x5ddfb9['appsecret'],_0x5ddfb9['uri'])[_0xb731('0x16')](function(_0x3d806a){_0x2bba83(null,_0x3d806a);})['catch'](function(_0xc220f){_0x2bba83(_0xc220f);});};AGIVertices[_0xb731('0x13')][_0xb731('0x8f')]=function(_0x1c0efe){var _0x21735a=_[_0xb731('0x90')](verticesWithRetry,_0x1c0efe[_0xb731('0x3a')])?_0x1c0efe:_[_0xb731('0x91')](_0x1c0efe);for(var _0x3ba78d in _0x21735a){if(_0x21735a['hasOwnProperty'](_0x3ba78d)){if(_0x21735a[_0x3ba78d]&&_[_0xb731('0x92')](_0x21735a[_0x3ba78d])){if(_[_0xb731('0x90')](recursiveMapAttributes,_0x3ba78d)){_0x21735a[_0x3ba78d]=this[_0xb731('0x93')](_0x21735a[_0x3ba78d]);}else{_0x21735a[_0x3ba78d]=this['replaceAllVariables'](_0x21735a[_0x3ba78d]);}}}}return _0x21735a;};AGIVertices['prototype'][_0xb731('0x94')]=function(_0x414d3b){for(var _0x388de5 in _0x414d3b){if(_0x414d3b[_0xb731('0x95')](_0x388de5)){if(_[_0xb731('0x96')](_0x414d3b[_0x388de5])){this[_0xb731('0x94')](_0x414d3b[_0x388de5]);}else if(_['isArray'](_0x414d3b[_0x388de5])){for(var _0x57f0cc=0x0;_0x57f0cc<_0x414d3b[_0x388de5][_0xb731('0x97')];_0x57f0cc++){this[_0xb731('0x94')](_0x414d3b[_0x388de5][_0x57f0cc]);}}else if(_['isString'](_0x414d3b[_0x388de5])){_0x414d3b[_0x388de5]=this[_0xb731('0x98')](_0x414d3b[_0x388de5]);}}}};AGIVertices[_0xb731('0x13')][_0xb731('0x99')]=function(_0x5e0cef,_0x59ac91){for(var _0x17c57c in _0x5e0cef){if(_0x5e0cef[_0xb731('0x95')](_0x17c57c)){if(_['isPlainObject'](_0x5e0cef[_0x17c57c])){if(!_[_0xb731('0x9a')](_0x5e0cef[_0x17c57c])){this[_0xb731('0x99')](_0x5e0cef[_0x17c57c],util[_0xb731('0x2b')](_0xb731('0x9b'),_0x59ac91,_0x17c57c));}}else if(_['isArray'](_0x5e0cef[_0x17c57c])){for(var _0x456f59=0x0;_0x456f59<_0x5e0cef[_0x17c57c][_0xb731('0x97')];_0x456f59++){this[_0xb731('0x99')](_0x5e0cef[_0x17c57c][_0x456f59],util[_0xb731('0x2b')](_0xb731('0x9b'),_0x59ac91,_0x17c57c+'['+_0x456f59+']'));}}else{if(!_['isNil'](_0x5e0cef[_0x17c57c])){this['channel'][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0x9b'),_0x59ac91,_0x17c57c),_0x5e0cef[_0x17c57c]);}}}}};AGIVertices['prototype'][_0xb731('0x93')]=function(_0x1d8764){try{var _0x2cc398=JSON[_0xb731('0x69')](_0x1d8764);this[_0xb731('0x94')](_0x2cc398);return JSON[_0xb731('0x70')](_0x2cc398);}catch(_0x56054f){return this[_0xb731('0x98')](_0x1d8764);}};AGIVertices[_0xb731('0x13')][_0xb731('0x98')]=function(_0x56e7df){var _0x464324=_0x56e7df[_0xb731('0x9d')]('{');for(var _0x50e04d=0x1;_0x50e04d<_0x464324[_0xb731('0x97')];_0x50e04d+=0x1){var _0x1ddbb=_0x464324[_0x50e04d]['split']('}');if(_0x1ddbb[_0xb731('0x97')]>0x1){_0x56e7df=_0x56e7df[_0xb731('0x9e')]('{'+_0x1ddbb[0x0]+'}',this[_0xb731('0x10')][_0xb731('0x14')](_0x1ddbb[0x0])[_0xb731('0x9f')]||_0x1ddbb[0x0]);}}if(_0x464324[_0xb731('0x97')]===0x1){return _0x56e7df['toString']();}return this[_0xb731('0x98')](_0x56e7df);};AGIVertices[_0xb731('0x13')][_0xb731('0xa0')]=function(_0x3570ce,_0x1f0308){var _0x5636de=this[_0xb731('0x10')][_0xb731('0x14')](_0x3570ce);if(_0x5636de[_0xb731('0xa1')]===-0x1){return _0x5636de;}logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xa3'),_0x1f0308,_0x5636de[_0xb731('0x9f')]));return this[_0xb731('0x10')][_0xb731('0x9c')](_0x1f0308,_0x5636de[_0xb731('0x9f')]);};AGIVertices['prototype'][_0xb731('0x83')]=function(_0x25b4ac){return _0x25b4ac&&_0x25b4ac!=='0'&&_0x25b4ac!=='-1'&&_0x25b4ac!=='';};AGIVertices[_0xb731('0x13')]['maxRetry']=function(_0x289237){this[_0xb731('0x37')]['sync'](this,_0x289237,'-');_0x289237[_0xb731('0xa4')]=_0x289237[_0xb731('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xb731('0xa6')]=function(_0x1f5f4d){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xa7'),_0x1f5f4d[_0xb731('0x39')]));if(!this['isConfigured'](_0x1f5f4d[_0xb731('0x5c')])){return this['channel'][_0xb731('0xa8')]('no\x20text\x20configured');}var _0x3b3776='\x22'+_0x1f5f4d[_0xb731('0x5c')]+'\x22';if(this['isConfigured'](_0x1f5f4d['options'])){_0x3b3776+=','+_0x1f5f4d[_0xb731('0x76')];}var _0x4318e3=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xa9'),_0x3b3776);if(_0x4318e3[_0xb731('0xa1')]===-0x1){return _0x4318e3;}return this['channel']['noop'](util[_0xb731('0x2b')](_0xb731('0xaa'),_0x3b3776));};AGIVertices[_0xb731('0x13')]['mrcprecog']=function(_0x30c6e2){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x30c6e2[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x30c6e2[_0xb731('0xab')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20grammar\x20configured');}var _0xbf8c12=_0x30c6e2['grammar'];if(this[_0xb731('0x83')](_0x30c6e2[_0xb731('0x76')])){_0xbf8c12+=','+_0x30c6e2[_0xb731('0x76')];}var _0x4c841d=this[_0xb731('0x10')]['exec'](_0xb731('0xac'),_0xbf8c12);if(_0x4c841d[_0xb731('0xa1')]===-0x1){return _0x4c841d;}var _0x12655e=this[_0xb731('0xa0')](_0xb731('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x12655e[_0xb731('0xa1')]===-0x1){return _0x12655e;}var _0x3aac12=this[_0xb731('0xa0')](_0xb731('0xae'),_0xb731('0xaf'));if(_0x3aac12[_0xb731('0xa1')]===-0x1){return _0x3aac12;}var _0x12bef2=this[_0xb731('0xa0')](_0xb731('0xb0'),_0xb731('0xb1'));if(_0x12bef2[_0xb731('0xa1')]===-0x1){return _0x12bef2;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0xbf8c12));};AGIVertices[_0xb731('0x13')][_0xb731('0x8')]=function(_0x2507c2){logger[_0xb731('0xa2')](util['format'](_0xb731('0xb2'),_0x2507c2['label']));return this['channel']['agi']([_0x2507c2[_0xb731('0xb3')],_0x2507c2['args']]);};AGIVertices[_0xb731('0x13')][_0xb731('0xb4')]=function(_0x54e1ca){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x54e1ca[_0xb731('0x39')]));if(this[_0xb731('0x83')](_0x54e1ca[_0xb731('0x64')])){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x54e1ca[_0xb731('0x64')]));var _0x14bd8c=this[_0xb731('0x10')][_0xb731('0xb5')](_0x54e1ca['timeout']);if(_0x14bd8c[_0xb731('0xa1')]===-0x1){return _0x14bd8c;}}return this['channel'][_0xb731('0xb4')]();};AGIVertices[_0xb731('0x13')][_0xb731('0x47')]=function(_0x288fed){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xb6'),_0x288fed[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x288fed['list_id'])){return this['channel'][_0xb731('0x2e')](_0x288fed,_0xb731('0xb7'));}_0x288fed['scheduledAt']=moment();if(this[_0xb731('0x83')](_0x288fed['delay'])){_0x288fed[_0xb731('0x49')]=moment()[_0xb731('0xb8')](_0x288fed['delay'],_0xb731('0xb9'));}if(!this[_0xb731('0x83')](_0x288fed[_0xb731('0x4b')])){_0x288fed['callback_priority']=0x2;}this['createCmContact'][_0xb731('0xba')](this,_0x288fed);return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x288fed['phone'],_0x288fed['list_id'],_0x288fed['scheduledAt']));};AGIVertices[_0xb731('0x13')]['custom_app']=function(_0x2824c3){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xbb'),_0x2824c3[_0xb731('0x39')]));var _0x76f0d0=this[_0xb731('0x10')][_0xb731('0x56')](_0x2824c3[_0xb731('0xbc')],_0x2824c3[_0xb731('0x76')]);if(_0x76f0d0[_0xb731('0xa1')]===-0x1){return _0x76f0d0;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('Executed\x20command\x20%s\x20%s',_0x2824c3[_0xb731('0xbc')],_0x2824c3[_0xb731('0x76')]));};AGIVertices[_0xb731('0x13')][_0xb731('0xbd')]=function(_0x1c91e9){logger[_0xb731('0xa2')](util['format'](_0xb731('0xbe'),_0x1c91e9['label']));if(!this[_0xb731('0x83')](_0x1c91e9[_0xb731('0x5c')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20text\x20configured');}var _0x17ee2f='\x22'+_0x1c91e9[_0xb731('0x5c')]+'\x22';if(this[_0xb731('0x83')](_0x1c91e9[_0xb731('0x76')])){_0x17ee2f+=','+_0x1c91e9['options'];}var _0x2d336a=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xa9'),_0x17ee2f);if(_0x2d336a[_0xb731('0xa1')]===-0x1){return _0x2d336a;}return this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xaa'),_0x17ee2f));};AGIVertices[_0xb731('0x13')][_0xb731('0xbf')]=function(_0x3bfebd){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3bfebd[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x3bfebd[_0xb731('0x5c')])){return this[_0xb731('0x10')]['noop'](_0xb731('0xc0'));}var _0x5952af='\x22'+_0x3bfebd[_0xb731('0x5c')]+'\x22';if(this[_0xb731('0x83')](_0x3bfebd[_0xb731('0x76')])){_0x5952af+=','+_0x3bfebd['options'];}var _0x56c104=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xa9'),_0x5952af);if(_0x56c104['result']===-0x1){return _0x56c104;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xaa'),_0x5952af));};AGIVertices['prototype'][_0xb731('0xc1')]=function(_0x163409){logger[_0xb731('0xa2')](util['format'](_0xb731('0xc2'),_0x163409['label']));if(!this[_0xb731('0x83')](_0x163409[_0xb731('0xab')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20grammar\x20configured');}var _0x25b18c=_0x163409['grammar'];if(this[_0xb731('0x83')](_0x163409[_0xb731('0x76')])){_0x25b18c+=','+_0x163409[_0xb731('0x76')];}var _0x1f97e9=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xac'),_0x25b18c);if(_0x1f97e9[_0xb731('0xa1')]===-0x1){return _0x1f97e9;}var _0x43b670=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xb731('0xc3'));if(_0x43b670['result']===-0x1){return _0x43b670;}var _0x39b777=this[_0xb731('0xa0')](_0xb731('0xae'),_0xb731('0xc4'));if(_0x39b777[_0xb731('0xa1')]===-0x1){return _0x39b777;}var _0x28e3db=this[_0xb731('0xa0')](_0xb731('0xb0'),_0xb731('0xc5'));if(_0x28e3db['result']===-0x1){return _0x28e3db;}return this[_0xb731('0x10')][_0xb731('0xa8')](util['format'](_0xb731('0xc6'),_0x25b18c));};AGIVertices[_0xb731('0x13')]['sestekasr']=function(_0x4329aa){logger[_0xb731('0xa2')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x4329aa['label']));if(!this[_0xb731('0x83')](_0x4329aa[_0xb731('0xab')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x219150=_0x4329aa[_0xb731('0xab')];if(this[_0xb731('0x83')](_0x4329aa['options'])){_0x219150+=','+_0x4329aa[_0xb731('0x76')];}var _0x553110=this['channel']['exec'](_0xb731('0xac'),_0x219150);if(_0x553110[_0xb731('0xa1')]===-0x1){return _0x553110;}var _0x53a3a5=this[_0xb731('0xa0')](_0xb731('0xad'),_0xb731('0xc7'));if(_0x53a3a5[_0xb731('0xa1')]===-0x1){return _0x53a3a5;}var _0x525172=this[_0xb731('0xa0')](_0xb731('0xae'),'SESTEK_ASR_TRANSCRIPT');if(_0x525172['result']===-0x1){return _0x525172;}var _0x276413=this[_0xb731('0xa0')](_0xb731('0xb0'),_0xb731('0xc8'));if(_0x276413[_0xb731('0xa1')]===-0x1){return _0x276413;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xc6'),_0x219150));};AGIVertices[_0xb731('0x13')][_0xb731('0xc9')]=function(_0x14c1fa){logger[_0xb731('0xa2')](util['format'](_0xb731('0xca'),_0x14c1fa[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x14c1fa[_0xb731('0xcb')])){return this['channel']['error'](_0x14c1fa,_0xb731('0xcc'));}var _0x1b9fa=this[_0xb731('0xcd')][_0xb731('0xba')](this,_0x14c1fa[_0xb731('0xcb')]);if(!_0x1b9fa){return this['channel'][_0xb731('0x2e')](_0x14c1fa,_0xb731('0xce'));}if(!this['isConfigured'](_0x14c1fa[_0xb731('0x30')])){return this['channel'][_0xb731('0x2e')](_0x14c1fa,_0xb731('0xcf'));}var _0x3877cd=_0x14c1fa[_0xb731('0x30')][_0xb731('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0xd0'),_0x3877cd));var _0x212b8d=this[_0xb731('0x2d')][_0xb731('0xba')](this,_0x1b9fa,_0x3877cd);this[_0xb731('0x37')][_0xb731('0xba')](this,_0x14c1fa,_0x3877cd);if(!this[_0xb731('0x83')](_0x14c1fa[_0xb731('0xd1')])){return this['channel'][_0xb731('0xa8')](_0xb731('0xd2'));}var _0x46dbca=this[_0xb731('0x14')][_0xb731('0xba')](this,_0x14c1fa[_0xb731('0xd1')]);if(!_0x46dbca){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x14c1fa,_0xb731('0xd3'));}var _0x4d1ab1=this;_0x212b8d['forEach'](function(_0x52b2fa,_0xa3e2fa){Object[_0xb731('0xd4')](_0x52b2fa)[_0xb731('0xd5')](function(_0xdb44a8){_0x4d1ab1[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0xd6'),_0x46dbca,_0xa3e2fa,_0xdb44a8),_0x52b2fa[_0xdb44a8]);});});this['channel'][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0xd7'),_0x46dbca),_0x212b8d['length']);return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0xd8'),_0x46dbca));};AGIVertices['prototype'][_0xb731('0xd9')]=function(_0x126198){logger[_0xb731('0xda')](util[_0xb731('0x2b')](_0xb731('0xdb'),_0x126198['label']));if(!this[_0xb731('0x83')](_0x126198[_0xb731('0xdc')])){return this['channel']['error'](_0x126198,_0xb731('0xdd'));}var _0x167608=this[_0xb731('0xde')][_0xb731('0xba')](this,_0x126198[_0xb731('0xdc')]);if(!_0x167608){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x126198,_0xb731('0xdf'));}var _0x4a2fda=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xe0'),[util[_0xb731('0x2b')](_0xb731('0xe1'),_0x167608),_0x126198[_0xb731('0x64')],_0x126198[_0xb731('0xe2')],_0x126198[_0xb731('0xe3')]]);if(_0x4a2fda['result']===-0x1){return _0x4a2fda;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xe4'),_0xb731('0xe0')));};AGIVertices[_0xb731('0x13')][_0xb731('0xe5')]=function(_0x2b444b){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2b444b[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x2b444b[_0xb731('0xe6')])){return this[_0xb731('0x10')]['noop'](_0xb731('0xe7'));}if(!this[_0xb731('0x83')](_0x2b444b[_0xb731('0x5c')])){return this[_0xb731('0x10')]['noop'](_0xb731('0xc0'));}this[_0xb731('0x10')][_0xb731('0xe8')]=!![];this[_0xb731('0x37')](_0x2b444b);this[_0xb731('0x42')](_0x2b444b[_0xb731('0x5c')],'in','','');this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0xe9'),_0x2b444b['text']));var _0x1ed57d=this['googleDialogflow'][_0xb731('0xba')](this,_0x2b444b);if(_0x1ed57d){for(var _0x4c020b in _0x1ed57d){if(_0x1ed57d[_0xb731('0x95')](_0x4c020b)){this[_0xb731('0x10')][_0xb731('0x9c')](util['format']('DIALOGFLOW_%s',_0x4c020b['toUpperCase']()),_0x1ed57d[_0x4c020b]);}}this[_0xb731('0x42')](_0x1ed57d[_0xb731('0xea')],_0xb731('0xeb'),'dialogflow','');return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xec'),_0x1ed57d[_0xb731('0xea')]));}return this[_0xb731('0x10')][_0xb731('0x2e')](_0x2b444b,_0xb731('0xed'));};AGIVertices['prototype'][_0xb731('0xee')]=function(_0x70273c){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xef'),_0x70273c[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x70273c[_0xb731('0x7a')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xf0'));}if(!this[_0xb731('0x83')](_0x70273c['client_email'])){return this[_0xb731('0x10')]['noop'](_0xb731('0xf1'));}if(!this[_0xb731('0x83')](_0x70273c[_0xb731('0x7c')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x70273c['dialogflowV2_language'])){return this[_0xb731('0x10')]['noop'](_0xb731('0xf2'));}if(!this['isConfigured'](_0x70273c[_0xb731('0x5c')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xc0'));}this[_0xb731('0x10')][_0xb731('0xe8')]=!![];this[_0xb731('0x37')](_0x70273c);this[_0xb731('0x42')](_0x70273c[_0xb731('0x5c')],'in','','');this[_0xb731('0x10')][_0xb731('0xa8')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x70273c[_0xb731('0x5c')]));var _0x3f6208=this[_0xb731('0x79')]['sync'](this,_0x70273c);if(_0x3f6208){for(var _0x5e07b2 in _0x3f6208){if(_0x3f6208[_0xb731('0x95')](_0x5e07b2)){if(_0x5e07b2!==_0xb731('0xf3')){this[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')]('DIALOGFLOW_%s',_0x5e07b2[_0xb731('0x67')]()),_0x3f6208[_0x5e07b2]);}}}this[_0xb731('0x42')](_0x3f6208['speech'],_0xb731('0xeb'),_0xb731('0xee'),_0x3f6208[_0xb731('0xf3')]);return this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xf4'),_0x3f6208[_0xb731('0xea')]));}return this[_0xb731('0x10')]['error'](_0x70273c,_0xb731('0xf5'));};AGIVertices[_0xb731('0x13')][_0xb731('0xf6')]=function(_0x45ab78){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0xf7'),_0x45ab78[_0xb731('0x39')]));if(!this['isConfigured'](_0x45ab78['ndauth_url'])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xf8'));}if(!this['isConfigured'](_0x45ab78[_0xb731('0xf9')])){return this[_0xb731('0x10')]['noop'](_0xb731('0xfa'));}if(!this['isConfigured'](_0x45ab78[_0xb731('0xfb')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xfc'));}if(!this[_0xb731('0x83')](_0x45ab78[_0xb731('0xfd')])){return this['channel'][_0xb731('0xa8')](_0xb731('0xc0'));}this['channel'][_0xb731('0xe8')]=!![];this[_0xb731('0x37')](_0x45ab78);this[_0xb731('0x42')](_0x45ab78[_0xb731('0x5c')],'in','','');this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xfe'),_0x45ab78[_0xb731('0x5c')]));var _0x186893=this[_0xb731('0x7e')][_0xb731('0xba')](this,_0x45ab78);if(_0x186893){for(var _0x19a8ba in _0x186893){if(_0x186893[_0xb731('0x95')](_0x19a8ba)){this[_0xb731('0x10')][_0xb731('0x9c')](util['format'](_0xb731('0xff'),_0x19a8ba[_0xb731('0x67')]()),_0x186893[_0x19a8ba]);}}this[_0xb731('0x42')](_0x186893['speech'],_0xb731('0xeb'),_0xb731('0xf6'),'');if(_0x186893[_0xb731('0x100')]){this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x101'),_0x186893[_0xb731('0x100')]));var _0x486383=this[_0xb731('0x10')]['streamFile'](_0x186893['audiofile']);try{fs[_0xb731('0x102')](_0x186893[_0xb731('0x100')]+'.wav');}catch(_0x59f150){logger['error'](_0x59f150);}return _0x486383;}else{return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x103'),_0x186893['speech']));}}return this['channel'][_0xb731('0x2e')](_0x45ab78,_0xb731('0x104'));};AGIVertices[_0xb731('0x13')][_0xb731('0x105')]=function(_0x511833){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x511833[_0xb731('0x39')]));return this['channel'][_0xb731('0xa8')](_0xb731('0x105'));};AGIVertices['prototype'][_0xb731('0x106')]=function(_0x37d9e1){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x37d9e1[_0xb731('0x39')]));var _0x475b7b='';if(_0x37d9e1[_0xb731('0x107')]){if(!this[_0xb731('0x83')](_0x37d9e1[_0xb731('0x107')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x37d9e1,_0xb731('0x108'));}else{var _0x30263f=parseInt(_0x37d9e1[_0xb731('0x107')],0xa);if(isNaN(_0x30263f)){_0x475b7b=_0x37d9e1[_0xb731('0x107')];}else{_0x475b7b=this[_0xb731('0x1e')][_0xb731('0xba')](this,_0x37d9e1[_0xb731('0x107')]);if(!_0x475b7b){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x37d9e1,'no\x20trunk\x20found');}}}}else if(_0x37d9e1[_0xb731('0x109')]){_0x475b7b=_0x37d9e1['trunk_name'];}else{return this['channel'][_0xb731('0x2e')](_0x37d9e1,'no\x20trunk\x20selected');}var _0x24bb78=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0xe0'),[util[_0xb731('0x2b')]('SIP/%s/%s',_0x475b7b,_0x37d9e1[_0xb731('0x10a')]),_0x37d9e1[_0xb731('0x64')],_0x37d9e1['opts'],_0x37d9e1[_0xb731('0xe3')]]);if(_0x24bb78[_0xb731('0xa1')]===-0x1){return _0x24bb78;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0xe4'),_0xb731('0xe0')));};AGIVertices[_0xb731('0x13')]['finally']=function(_0x2d91da){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x10b'),_0x2d91da['label']));return this[_0xb731('0x10')]['noop'](_0xb731('0x10c'));};AGIVertices['prototype'][_0xb731('0x10d')]=function(_0x22ece5){logger['info'](util[_0xb731('0x2b')](_0xb731('0x10e'),_0x22ece5[_0xb731('0x39')]));if(_0x22ece5[_0xb731('0xa4')]===0x0){return this[_0xb731('0xa5')](_0x22ece5);}_0x22ece5[_0xb731('0xa4')]-=0x1;if(!this[_0xb731('0x83')](_0x22ece5[_0xb731('0x10f')])){return this['channel'][_0xb731('0x2e')](_0x22ece5,_0xb731('0x110'));}var _0x109700=this['getSound']['sync'](this,_0x22ece5[_0xb731('0x10f')]);if(!_0x109700){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x22ece5,_0xb731('0x111'));}if(!this[_0xb731('0x83')](_0x22ece5['variable_id'])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0xb731('0xd2'));}var _0x339fa4=this[_0xb731('0x10')]['getData'](_0x109700,_0x22ece5[_0xb731('0x112')],_0x22ece5[_0xb731('0x113')]);var _0x5bffc6=_0x339fa4[_0xb731('0xa1')]?_0x339fa4[_0xb731('0xa1')]['toString']():'';logger[_0xb731('0xa2')](_0xb731('0x114'),JSON[_0xb731('0x70')](_0x339fa4));if(_0x339fa4[_0xb731('0xa1')]===-0x1){this[_0xb731('0x37')][_0xb731('0xba')](this,_0x22ece5,_0x5bffc6);return _0x339fa4;}else if(_0x339fa4['extra']===_0xb731('0x64')){_0x339fa4[_0xb731('0xa1')]=_0x5bffc6[_0xb731('0x97')]>=parseInt(_0x22ece5['mindigit'])?'x':'i';}else{_0x339fa4['result']=_0x5bffc6[_0xb731('0x97')]>=parseInt(_0x22ece5[_0xb731('0x115')])&&_0x5bffc6[_0xb731('0x97')]<=parseInt(_0x22ece5[_0xb731('0x113')])?'x':'i';}var _0x1d0f1f=this[_0xb731('0x14')]['sync'](this,_0x22ece5[_0xb731('0xd1')]);if(!_0x1d0f1f){return this['channel'][_0xb731('0x2e')](_0x22ece5,'no\x20variable\x20found');}this[_0xb731('0x10')][_0xb731('0x9c')](_0x1d0f1f,_0x5bffc6);if(this['isConfigured'](_0x22ece5[_0xb731('0x116')])){var _0x4b03c5=parseInt(_0x22ece5[_0xb731('0x116')],0xa);var _0x25e253=rs[_0xb731('0x117')]({'charset':'*','length':_0x4b03c5});var _0x1f5a67=_0x5bffc6[_0xb731('0x97')];if(_0x1f5a67>0x0){if(_0x1f5a67>_0x4b03c5){this['createSquareDetailsReport'][_0xb731('0xba')](this,_0x22ece5,_0x22ece5['hiddendigitspos']==='first'?_0x25e253+_0x5bffc6[_0xb731('0x118')](_0x4b03c5):_0x5bffc6[_0xb731('0x118')](0x0,_0x1f5a67-_0x4b03c5)+_0x25e253);}else{this['createSquareDetailsReport'][_0xb731('0xba')](this,_0x22ece5,rs[_0xb731('0x117')]({'charset':'*','length':_0x1f5a67}));}}else{this['createSquareDetailsReport'][_0xb731('0xba')](this,_0x22ece5,'');}}else{this[_0xb731('0x37')][_0xb731('0xba')](this,_0x22ece5,_0x5bffc6);}return _0x339fa4;};AGIVertices[_0xb731('0x13')]['getsecretdigits']=function(_0x1bfd73){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x119'),_0x1bfd73[_0xb731('0x39')]));return this['getdigits'](_0x1bfd73);};AGIVertices['prototype'][_0xb731('0x11a')]=function(_0x1dbea0){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1dbea0[_0xb731('0x39')]));this[_0xb731('0x37')][_0xb731('0xba')](this,_0x1dbea0,_0x1dbea0['goalname']);return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')]('GOAL\x20%s',_0x1dbea0[_0xb731('0x11b')]));};AGIVertices[_0xb731('0x13')][_0xb731('0x11c')]=function(_0x4dbe7c){logger['info'](util[_0xb731('0x2b')](_0xb731('0x11d'),_0x4dbe7c[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x4dbe7c['aws_access_key_id'])||!this[_0xb731('0x83')](_0x4dbe7c[_0xb731('0x11e')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xb731('0x83')](_0x4dbe7c[_0xb731('0x5c')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xc0'));}this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x11f'),_0x4dbe7c['text']));var _0x18c265=this[_0xb731('0x85')][_0xb731('0xba')](this,_0x4dbe7c);if(_0x18c265){this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x120'),_0x18c265));var _0x4c1907=this[_0xb731('0x10')][_0xb731('0x121')](_0x18c265);try{fs[_0xb731('0x102')](_0x18c265+_0xb731('0x122'));}catch(_0x38e016){logger[_0xb731('0x2e')](_0x38e016);}return _0x4c1907;}return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4dbe7c,_0xb731('0x123'));};AGIVertices[_0xb731('0x13')]['awslex']=function(_0x4cd022){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x4cd022['label']));if(!this[_0xb731('0x83')](_0x4cd022[_0xb731('0x86')])||!this[_0xb731('0x83')](_0x4cd022[_0xb731('0x11e')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x124'));}if(!this['isConfigured'](_0x4cd022[_0xb731('0x8a')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x125'));}if(!this[_0xb731('0x83')](_0x4cd022[_0xb731('0x5c')])){return this['channel'][_0xb731('0xa8')]('no\x20text\x20configured');}this['channel'][_0xb731('0xe8')]=!![];this[_0xb731('0x37')](_0x4cd022);this[_0xb731('0x42')](_0x4cd022[_0xb731('0x5c')],'in','','');this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x126'),_0x4cd022[_0xb731('0x5c')]));var _0x5eafa1=this['awsLex']['sync'](this,_0x4cd022);if(_0x5eafa1){for(var _0x19547a in _0x5eafa1){if(_0x5eafa1[_0xb731('0x95')](_0x19547a)&&_[_0xb731('0x92')](_0x5eafa1[_0x19547a])){this[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')]('AWS_LEX_%s',_0x19547a[_0xb731('0x67')]()),_0x5eafa1[_0x19547a]);}}if(_[_0xb731('0x44')](_0x5eafa1[_0xb731('0x74')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x127'));}else{this['createSquareMessage'](_0x5eafa1[_0xb731('0x74')],_0xb731('0xeb'),'amazonlex','');return this['channel']['noop'](util[_0xb731('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x5eafa1[_0xb731('0x74')]));}}return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4cd022,_0xb731('0x128'));};AGIVertices[_0xb731('0x13')][_0xb731('0x129')]=function(_0x12ac73){logger['info'](util[_0xb731('0x2b')](_0xb731('0x12a'),_0x12ac73[_0xb731('0x39')],_0x12ac73[_0xb731('0x64')]));if(!this[_0xb731('0x83')](_0x12ac73['key'])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20key\x20configured');}var _0x25e3c5='wav';var _0x331422=util[_0xb731('0x2b')](_0xb731('0x12b'),FILES_PATH,rs[_0xb731('0x117')](0x4));var _0x51c9d7=util[_0xb731('0x2b')](_0xb731('0x9b'),_0x331422,_0x25e3c5);var _0x404e26=!![];if(_0x12ac73['beep']==='NOBEEP'){_0x404e26=![];}var _0x289182=this[_0xb731('0x10')]['recordFile'](_0x331422,_0x25e3c5,_0x12ac73[_0xb731('0x12c')],_0x12ac73['timeout'],undefined,_0x404e26);if(_0x289182[_0xb731('0xa1')]!==-0x1){this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('google\x20%s\x20file\x20created',_0x51c9d7));var _0x1418fa=this[_0xb731('0x8b')][_0xb731('0xba')](this,_0x12ac73,_0x51c9d7);if(_0x1418fa){for(var _0x47b300 in _0x1418fa){if(_0x1418fa[_0xb731('0x95')](_0x47b300)){this[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0x12d'),_0x47b300[_0xb731('0x67')]()),_0x1418fa[_0x47b300]);}}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x12e'),JSON[_0xb731('0x70')](_0x1418fa)));}}return _0x289182;};AGIVertices[_0xb731('0x13')]['tildeasr']=function(_0x3b6f41){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x12f'),_0x3b6f41[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x3b6f41[_0xb731('0x8e')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20appid\x20configured');}if(!this[_0xb731('0x83')](_0x3b6f41[_0xb731('0x130')])){return this[_0xb731('0x10')]['noop'](_0xb731('0x131'));}var _0x53ffdd=_0xb731('0x132');var _0x42ea73=util[_0xb731('0x2b')](_0xb731('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x517dcb=util[_0xb731('0x2b')](_0xb731('0x9b'),_0x42ea73,_0x53ffdd);var _0x7b24eb=!![];if(_0x3b6f41[_0xb731('0x133')]===_0xb731('0x134')){_0x7b24eb=![];}var _0x54f557=this[_0xb731('0x10')]['recordFile'](_0x42ea73,_0x53ffdd,_0x3b6f41['intKey'],_0x3b6f41['timeout'],undefined,_0x7b24eb);if(_0x54f557[_0xb731('0xa1')]!==-0x1){this[_0xb731('0x10')][_0xb731('0xa8')](util['format'](_0xb731('0x135'),_0x517dcb));var _0x5d6244=this['tildeASR'][_0xb731('0xba')](this,_0x3b6f41,_0x517dcb);if(_0x5d6244){for(var _0x2e7b02 in _0x5d6244){if(_0x5d6244['hasOwnProperty'](_0x2e7b02)){this[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0x136'),_0x2e7b02[_0xb731('0x67')]()),_0x5d6244[_0x2e7b02]);}}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0xb731('0x70')](_0x5d6244)));}}return _0x54f557;};AGIVertices[_0xb731('0x13')][_0xb731('0x137')]=function(_0x5dad5a){logger[_0xb731('0xa2')](util['format'](_0xb731('0x138'),_0x5dad5a['label']));return this[_0xb731('0x10')]['continueAt'](_0x5dad5a[_0xb731('0x3e')],_0x5dad5a[_0xb731('0x139')],_0x5dad5a[_0xb731('0x3f')]);};AGIVertices['prototype'][_0xb731('0x13a')]=function(_0x1b3faa){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x1b3faa[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x1b3faa[_0xb731('0x13b')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x1b3faa,_0xb731('0x13c'));}try{var _0x44faa8=eval(_0x1b3faa['condition'])?_0xb731('0x13d'):'false';this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x13e'),_0x1b3faa[_0xb731('0x13b')],_0x44faa8));return{'code':0xc8,'result':_0x44faa8};}catch(_0x1f022d){return{'code':0xc8,'result':_0xb731('0x13f')};}};AGIVertices[_0xb731('0x13')][_0xb731('0x140')]=function(_0x4acd55){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x141'),_0x4acd55[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x4acd55['interval_id'])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4acd55,_0xb731('0x142'));}var _0x368ad0=this[_0xb731('0x24')][_0xb731('0xba')](this,_0x4acd55[_0xb731('0x143')]);if(!_0x368ad0){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4acd55,_0xb731('0x144'));}for(var _0xc424ad=0x0;_0xc424ad<_0x368ad0[_0xb731('0x97')];_0xc424ad+=0x1){var _0x316199=this[_0xb731('0x10')][_0xb731('0x14')](util[_0xb731('0x2b')]('IFTIME(%s?true:false)',_0x368ad0[_0xc424ad]));if(_0x316199[_0xb731('0xa1')]===-0x1){return _0x316199;}logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x145'),_0x368ad0[_0xc424ad],_0x316199[_0xb731('0x9f')]));if(_0x316199['extra']==='true'){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x145'),_0x368ad0[_0xc424ad],_0xb731('0x13d')));this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x145'),_0x368ad0[_0xc424ad],_0xb731('0x13d')));return{'code':0xc8,'result':_0xb731('0x13d')};}else{logger['info'](util[_0xb731('0x2b')](_0xb731('0x145'),_0x368ad0[_0xc424ad],_0xb731('0x13f')));this[_0xb731('0x10')][_0xb731('0xa8')](util['format'](_0xb731('0x145'),_0x368ad0[_0xc424ad],_0xb731('0x13f')));}}return{'code':0xc8,'result':_0xb731('0x13f')};};AGIVertices[_0xb731('0x13')][_0xb731('0x146')]=function(_0x15bba2){logger['info'](util[_0xb731('0x2b')](_0xb731('0x147'),_0x15bba2[_0xb731('0x39')]));return this[_0xb731('0x10')][_0xb731('0x146')]();};AGIVertices[_0xb731('0x13')][_0xb731('0x148')]=function(_0x21a89c){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x149'),_0x21a89c[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x21a89c[_0xb731('0xe6')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xe7'));}var _0x1e1dd4=_0xb731('0x132');var _0x3291ed=util[_0xb731('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0xb731('0x117')](0x4));var _0x1e157a=util[_0xb731('0x2b')](_0xb731('0x9b'),_0x3291ed,_0x1e1dd4);var _0x43167c=!![];if(_0x21a89c[_0xb731('0x133')]===_0xb731('0x134')){_0x43167c=![];}var _0x7cdf34=this[_0xb731('0x10')]['recordFile'](_0x3291ed,_0x1e1dd4,_0x21a89c[_0xb731('0x12c')],_0x21a89c['timeout'],undefined,_0x43167c);if(_0x7cdf34[_0xb731('0xa1')]!==-0x1){this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')]('ispeech\x20%s\x20file\x20created',_0x1e157a));var _0x1e3484=this['ispeechASR']['sync'](this,_0x21a89c,_0x1e157a);if(_0x1e3484){for(var _0x571297 in _0x1e3484){if(_0x1e3484[_0xb731('0x95')](_0x571297)){this[_0xb731('0x10')][_0xb731('0x9c')](util['format']('ISPEECH_ASR_%s',_0x571297[_0xb731('0x67')]()),_0x1e3484[_0x571297]);}}return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x14a'),JSON[_0xb731('0x70')](_0x1e3484)));}}return _0x7cdf34;};AGIVertices['prototype'][_0xb731('0x14b')]=function(_0x221923){logger['info'](util[_0xb731('0x2b')](_0xb731('0x14c'),_0x221923[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x221923[_0xb731('0xe6')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0xe7'));}if(!this['isConfigured'](_0x221923[_0xb731('0x5c')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20text\x20configured');}this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x14d'),_0x221923[_0xb731('0x5c')]));var _0x179d68=this[_0xb731('0x14e')]['sync'](this,_0x221923);if(_0x179d68){this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x14f'),_0x179d68));var _0x30962f=this[_0xb731('0x10')][_0xb731('0x121')](_0x179d68,_0x221923[_0xb731('0x12c')]);try{fs[_0xb731('0x102')](_0x179d68+_0xb731('0x122'));}catch(_0x1a1741){logger[_0xb731('0x2e')](_0x1a1741);}return _0x30962f;}return this['channel'][_0xb731('0x2e')](_0x221923,_0xb731('0x150'));};AGIVertices[_0xb731('0x13')][_0xb731('0x151')]=function(_0x31afd1){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x152'),_0x31afd1[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x31afd1[_0xb731('0x153')])){return this['channel']['error'](_0x31afd1,_0xb731('0x154'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb731('0x10')][_0xb731('0x3b')],_0x31afd1[_0xb731('0x153')]));var _0x38606=this['agentLogin'][_0xb731('0xba')](this,_0x31afd1[_0xb731('0x153')]);if(_0x38606){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x155'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x31afd1[_0xb731('0x153')]));this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x155'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x31afd1[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x156')};}else{logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x157'),this['channel'][_0xb731('0x3b')],_0x31afd1[_0xb731('0x153')]));this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x157'),this['channel'][_0xb731('0x3b')],_0x31afd1[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x158')};}};AGIVertices[_0xb731('0x13')][_0xb731('0x159')]=function(_0x1b4368){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x15a'),_0x1b4368[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x1b4368[_0xb731('0x153')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x1b4368,_0xb731('0x154'));}logger[_0xb731('0xa2')](util['format'](_0xb731('0x15b'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x1b4368['findBy']));var _0x2e7d5f=this[_0xb731('0x51')][_0xb731('0xba')](this,_0x1b4368[_0xb731('0x153')]);if(_0x2e7d5f){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x155'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x1b4368['findBy']));this['channel'][_0xb731('0xa8')](util[_0xb731('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb731('0x3b')],_0x1b4368[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x156')};}else{logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x157'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x1b4368[_0xb731('0x153')]));this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x157'),this['channel'][_0xb731('0x3b')],_0x1b4368[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x158')};}};AGIVertices[_0xb731('0x13')][_0xb731('0x15c')]=function(_0x19b9d3){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x19b9d3[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x19b9d3[_0xb731('0x15d')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x19b9d3,_0xb731('0x15e'));}this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x15f'),_0x19b9d3[_0xb731('0x15d')]));var _0x3cf893=eval(_0x19b9d3[_0xb731('0x15d')]);if(!this['isConfigured'](_0x19b9d3['variable_id'])){return this[_0xb731('0x10')]['noop'](_0xb731('0xd2'));}var _0x40c9c3=this[_0xb731('0x14')]['sync'](this,_0x19b9d3[_0xb731('0xd1')]);if(!_0x40c9c3){return this['channel']['error'](_0x19b9d3,'no\x20variable\x20found');}if(_[_0xb731('0x160')](_0x3cf893)){var _0x44a03c=this;_0x3cf893[_0xb731('0xd5')](function(_0x366f5b,_0x131187){_0x44a03c['channel'][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0x161'),_0x40c9c3,_0x131187),_0x366f5b);});return this['channel']['noop'](util[_0xb731('0x2b')](_0xb731('0x162'),_0x40c9c3));}else{return this[_0xb731('0x10')][_0xb731('0x9c')](_0x40c9c3,_0x3cf893);}};AGIVertices[_0xb731('0x13')][_0xb731('0xe')]=function(_0x46cefd){logger['info'](util[_0xb731('0x2b')](_0xb731('0x163'),_0x46cefd[_0xb731('0x39')]));if(_0x46cefd[_0xb731('0xa4')]===0x0){return this['maxRetry'](_0x46cefd);}_0x46cefd[_0xb731('0xa4')]-=0x1;if(!this[_0xb731('0x83')](_0x46cefd[_0xb731('0x10f')])){return this[_0xb731('0x10')]['error'](_0x46cefd,'no\x20file\x20audio\x20selected');}var _0x420657=this[_0xb731('0x164')][_0xb731('0xba')](this,_0x46cefd[_0xb731('0x10f')]);if(!_0x420657){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x46cefd,_0xb731('0x111'));}var _0x5452c4=this[_0xb731('0x10')][_0xb731('0x165')](_0x420657,_0x46cefd[_0xb731('0x112')],_0x46cefd['digit']);var _0x2e62c0=_0x5452c4[_0xb731('0xa1')];if(_0x5452c4[_0xb731('0xa1')]===-0x1){this[_0xb731('0x37')]['sync'](this,_0x46cefd,'-1');return _0x5452c4;}else if(_0x5452c4['extra']===_0xb731('0x64')){_0x5452c4[_0xb731('0xa1')]=_0x5452c4[_0xb731('0xa1')][_0xb731('0x97')]>0x0?_0x5452c4['result']:'t';}else if(_[_0xb731('0x9a')](_0x5452c4[_0xb731('0xa1')])){_0x5452c4[_0xb731('0xa1')]='#';_0x2e62c0='#';}if(!this[_0xb731('0x83')](_0x46cefd[_0xb731('0xd1')])){this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x30fc89=this[_0xb731('0x14')]['sync'](this,_0x46cefd[_0xb731('0xd1')]);if(!_0x30fc89){return this[_0xb731('0x10')]['error'](_0x46cefd,'no\x20variable\x20found');}this[_0xb731('0x10')][_0xb731('0x9c')](_0x30fc89,_0x2e62c0);}this[_0xb731('0x37')][_0xb731('0xba')](this,_0x46cefd,_0x2e62c0);return _0x5452c4;};AGIVertices['prototype'][_0xb731('0xa8')]=function(_0x4ad8bb){logger[_0xb731('0xa2')](util['format'](_0xb731('0x166'),_0x4ad8bb[_0xb731('0x39')]));return this[_0xb731('0x10')][_0xb731('0xa8')](_0x4ad8bb[_0xb731('0x167')]||_0x4ad8bb[_0xb731('0x39')]);};AGIVertices[_0xb731('0x13')][_0xb731('0x168')]=function(_0x57b7fa){logger['info'](util[_0xb731('0x2b')](_0xb731('0x169'),_0x57b7fa[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x57b7fa[_0xb731('0x153')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x57b7fa,_0xb731('0x154'));}logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x15b'),this['channel'][_0xb731('0x3b')],_0x57b7fa[_0xb731('0x153')]));var _0x524329=this[_0xb731('0x4c')][_0xb731('0xba')](this,_0x57b7fa['pause_id']);var _0x225cd0=this[_0xb731('0x4e')][_0xb731('0xba')](this,_0x57b7fa[_0xb731('0x153')],_0x524329);if(_0x225cd0){logger[_0xb731('0xa2')](util['format'](_0xb731('0x155'),this[_0xb731('0x10')]['callerid'],_0x57b7fa['findBy']));this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb731('0x10')][_0xb731('0x3b')],_0x57b7fa[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x156')};}else{logger['info'](util[_0xb731('0x2b')](_0xb731('0x157'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x57b7fa[_0xb731('0x153')]));this[_0xb731('0x10')][_0xb731('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb731('0x10')][_0xb731('0x3b')],_0x57b7fa[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x158')};}};AGIVertices[_0xb731('0x13')]['playback']=function(_0x4b3cfc){logger[_0xb731('0xa2')](util['format'](_0xb731('0x16a'),_0x4b3cfc['label']));if(!this['isConfigured'](_0x4b3cfc[_0xb731('0x10f')])){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4b3cfc,'no\x20file\x20audio\x20selected');}var _0x434c86=this[_0xb731('0x164')]['sync'](this,_0x4b3cfc[_0xb731('0x10f')]);if(!_0x434c86){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4b3cfc,'no\x20file\x20audio\x20found');}var _0x1dd8b3=this[_0xb731('0x10')][_0xb731('0x56')]('PLAYBACK',[_0x434c86,_0x4b3cfc['opts']]);if(_0x1dd8b3['result']===-0x1){return _0x1dd8b3;}return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x16b'),_0xb731('0x16c'),_0x434c86));};AGIVertices['prototype']['queue']=function(_0x4ad674){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4ad674[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x4ad674['queue_id'])){return this['channel'][_0xb731('0x2e')](_0x4ad674,'no\x20queue\x20selected');}var _0x59a2d8='';var _0x5ee7f5=parseInt(_0x4ad674[_0xb731('0x16d')],0xa);if(isNaN(_0x5ee7f5)){_0x59a2d8=_0x4ad674[_0xb731('0x16d')];}else{_0x59a2d8=this[_0xb731('0x18')]['sync'](this,_0x4ad674[_0xb731('0x16d')]);if(!_0x59a2d8){return this[_0xb731('0x10')]['error'](_0x4ad674,'no\x20queue\x20found');}}var _0x312cbf='';if(this[_0xb731('0x83')](_0x4ad674[_0xb731('0x10f')])){var _0x109196=this[_0xb731('0x164')][_0xb731('0xba')](this,_0x4ad674[_0xb731('0x10f')]);if(_0x109196){_0x312cbf=_0x109196;}}this[_0xb731('0x37')]['sync'](this,_0x4ad674,_0x59a2d8);if(_0x4ad674[_0xb731('0xe2')]['indexOf']('x')<0x0){_0x4ad674[_0xb731('0xe2')]+='x';}if(_0x4ad674[_0xb731('0xe2')][_0xb731('0x16e')]('X')<0x0){_0x4ad674[_0xb731('0xe2')]+='X';}this[_0xb731('0x10')]['setVariable'](_0xb731('0x16f'),_0x59a2d8?_0x59a2d8[_0xb731('0x170')]():'');var _0x1d42d2=this['channel'][_0xb731('0x56')]('QUEUE',[_0x59a2d8,_0x4ad674[_0xb731('0xe2')],_0x4ad674['url'],_0x312cbf,_0x4ad674[_0xb731('0x64')],_0x4ad674[_0xb731('0x8')],_0x4ad674[_0xb731('0x171')],_0x4ad674[_0xb731('0x172')],'',_0x4ad674[_0xb731('0x173')]]);if(_0x1d42d2[_0xb731('0xa1')]===-0x1){return _0x1d42d2;}return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')](_0xb731('0x16b'),'QUEUE',_0x59a2d8));};AGIVertices[_0xb731('0x13')][_0xb731('0x174')]=function(_0x4f358d){logger['info'](util['format'](_0xb731('0x175'),_0x4f358d['label']));var _0x560138=_0x4f358d['recordingFormat']||_0xb731('0x132');var _0xd1fca7=util['format']('%s_%s',this[_0xb731('0x10')][_0xb731('0x38')],rs['generate'](0x5));var _0x1c6847=util[_0xb731('0x2b')](_0xb731('0x176'),FILES_PATH,_0xd1fca7,_0x560138);var _0x31436e=util[_0xb731('0x2b')]('%s/recordings/%s',FILES_PATH,_0xd1fca7);this[_0xb731('0x3c')][_0xb731('0xba')](this,_0x4f358d,_0xd1fca7,_0x1c6847);this['channel'][_0xb731('0x9c')](_0xb731('0x177'),_0xd1fca7);logger[_0xb731('0xa2')](_0xb731('0x178'),_0x31436e,_0x560138,_0x4f358d['escape_digits'],_0x4f358d['timeout']);return this[_0xb731('0x10')][_0xb731('0x179')](_0x31436e,_0x560138,_0x4f358d[_0xb731('0x17a')],_0x4f358d[_0xb731('0x64')],undefined,!![]);};AGIVertices[_0xb731('0x13')][_0xb731('0x17b')]=function(_0x1cc97a){logger[_0xb731('0xa2')](util['format'](_0xb731('0x17c'),_0x1cc97a[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x1cc97a[_0xb731('0xe3')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x17d'));}var _0x401845=this[_0xb731('0x62')][_0xb731('0xba')](this,_0x1cc97a);logger['info'](util[_0xb731('0x2b')](_0xb731('0x17e'),util['inspect'](_0x401845,{'showHidden':![],'depth':null})));if(!this[_0xb731('0x83')](_0x1cc97a[_0xb731('0xd1')])){return this['channel'][_0xb731('0xa8')](_0xb731('0x17f'));}var _0x499de9=this[_0xb731('0x14')][_0xb731('0xba')](this,_0x1cc97a[_0xb731('0xd1')]);if(!_0x499de9){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x1cc97a,_0xb731('0xd3'));}this['channel'][_0xb731('0x9c')](util[_0xb731('0x2b')](_0xb731('0x180'),_0x499de9),_0x401845['statusCode']?_0x401845['statusCode']:_0xb731('0x181'));this[_0xb731('0x10')][_0xb731('0x9c')](util[_0xb731('0x2b')]('%s_STATUS_MESSAGE',_0x499de9),_0x401845[_0xb731('0x73')]?_0x401845['statusMessage']:'OK');if(_0x401845[_0xb731('0x68')]){try{this[_0xb731('0x99')](_0x401845[_0xb731('0x68')],_0x499de9);}catch(_0xecf659){logger['error'](util[_0xb731('0x2b')](_0xb731('0x182'),_0x499de9));}}return this[_0xb731('0x10')][_0xb731('0xa8')](util['format']('variable\x20%s\x20set',_0x499de9));};AGIVertices['prototype']['saydigits']=function(_0x42617a){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x42617a[_0xb731('0x39')]));return this[_0xb731('0x10')][_0xb731('0x183')](_0x42617a[_0xb731('0x184')][_0xb731('0x58')](/\s+/g,''),_0x42617a['escape_digits']);};AGIVertices[_0xb731('0x13')][_0xb731('0x185')]=function(_0x395736){logger['info'](util['format'](_0xb731('0x186'),_0x395736['label']));return this[_0xb731('0x10')]['sayNumber'](_0x395736[_0xb731('0x187')][_0xb731('0x58')](/\s+/g,''),_0x395736[_0xb731('0x17a')]);};AGIVertices['prototype'][_0xb731('0x188')]=function(_0x4e9804){logger[_0xb731('0xa2')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4e9804['label']));return this[_0xb731('0x10')][_0xb731('0x189')](_0x4e9804[_0xb731('0x5c')],_0x4e9804[_0xb731('0x17a')]);};AGIVertices[_0xb731('0x13')][_0xb731('0x18a')]=function(_0x2d73d4){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x18b'),_0x2d73d4[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x2d73d4[_0xb731('0x18c')])){return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x18d'));}var _0x1b1ebd=this[_0xb731('0x21')][_0xb731('0xba')](this,_0x2d73d4[_0xb731('0x18c')]);if(!_0x1b1ebd||!_0x1b1ebd[_0xb731('0x18e')]){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x2d73d4,_0xb731('0x18f'));}var _0x4fb680={'from':util['format'](_0xb731('0x190'),_0x1b1ebd[_0xb731('0x19')],_0x1b1ebd[_0xb731('0x191')]||_0x1b1ebd[_0xb731('0x18e')][_0xb731('0x192')]),'to':_0x2d73d4['to']||'','cc':_0x2d73d4['cc']||'','bcc':_0x2d73d4[_0xb731('0x193')]||'','subject':_0x2d73d4[_0xb731('0x194')],'html':_0x2d73d4['text'],'text':_0x2d73d4['text']};var _0x25dc26={'tls':{'rejectUnauthorized':![]}};if(_0x1b1ebd[_0xb731('0x18e')][_0xb731('0x195')]){_0x25dc26[_0xb731('0x195')]=_0x1b1ebd[_0xb731('0x18e')][_0xb731('0x195')];}else{_0x25dc26[_0xb731('0x196')]=_0x1b1ebd['Smtp'][_0xb731('0x196')];_0x25dc26[_0xb731('0x197')]=_0x1b1ebd[_0xb731('0x18e')]['port'];_0x25dc26['secure']=_0x1b1ebd[_0xb731('0x18e')]['secure'];}if(_0x1b1ebd[_0xb731('0x18e')][_0xb731('0x198')]){_0x25dc26[_0xb731('0x199')]={'user':_0x1b1ebd['Smtp']['user'],'pass':_0x1b1ebd[_0xb731('0x18e')][_0xb731('0x19a')]};}if(this[_0xb731('0x83')](_0x2d73d4[_0xb731('0x19b')])){}logger[_0xb731('0xda')](_0xb731('0x19c'),JSON['stringify'](_0x4fb680));this[_0xb731('0x37')]['sync'](this,_0x2d73d4,_0x2d73d4[_0xb731('0x18c')]);this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x19d'),_0x1b1ebd['name']));this[_0xb731('0x23')][_0xb731('0xba')](this,_0x25dc26,_0x4fb680);return this['channel'][_0xb731('0xa8')](_0xb731('0x19e'));};AGIVertices[_0xb731('0x13')][_0xb731('0x19f')]=function(_0x49242){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x1a0'),_0x49242[_0xb731('0x39')]));return this['channel']['noop'](_0xb731('0x1a1'));};AGIVertices[_0xb731('0x13')][_0xb731('0x1a2')]=function(_0xdf8940){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0xdf8940['label']));if(!this[_0xb731('0x83')](_0xdf8940['sms_account_id'])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20sms\x20account\x20configured');}var _0x3501eb=this[_0xb731('0x34')][_0xb731('0xba')](this,_0xdf8940[_0xb731('0x1a3')]);if(!_0x3501eb){return this[_0xb731('0x10')][_0xb731('0x2e')](_0xdf8940,_0xb731('0x1a4'));}var _0x358622={'body':_0xdf8940['sms_text'],'phone':_0xdf8940['to']||'','SmsAccountId':_0x3501eb['id']};logger[_0xb731('0xda')](_0xb731('0x1a5'),JSON[_0xb731('0x70')](_0x358622));this['createSquareDetailsReport'][_0xb731('0xba')](this,_0xdf8940,_0xdf8940['sms_account_id']);this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x1a6'),_0x3501eb['name']));this[_0xb731('0x36')][_0xb731('0xba')](this,_0x358622);return this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x1a7'));};AGIVertices[_0xb731('0x13')]['set']=function(_0x2c5ad3){logger[_0xb731('0xa2')](util['format'](_0xb731('0x1a8'),_0x2c5ad3[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x2c5ad3['variable_id'])){return this[_0xb731('0x10')]['error'](_0x2c5ad3,'no\x20variable\x20selected');}var _0xf28efb=this[_0xb731('0x14')][_0xb731('0xba')](this,_0x2c5ad3[_0xb731('0xd1')]);if(!_0xf28efb){return this['channel'][_0xb731('0x2e')](_0x2c5ad3,_0xb731('0xd3'));}return this[_0xb731('0x10')]['setVariable'](_0xf28efb,_0x2c5ad3[_0xb731('0x1a9')]);};AGIVertices['prototype']['start']=function(_0x5f49ee){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5f49ee[_0xb731('0x39')]));this[_0xb731('0x10')][_0xb731('0xa8')](_0xb731('0x1aa'));if(_0x5f49ee[_0xb731('0xb4')]==='yes'){this[_0xb731('0x10')]['noop'](_0xb731('0x1ab'));return this[_0xb731('0x10')][_0xb731('0xb4')]();}return this['channel'][_0xb731('0xa8')](_0xb731('0x1ac'));};AGIVertices['prototype']['subproject']=function(_0x3b70ae){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x1ad'),_0x3b70ae[_0xb731('0x39')]));if(!this['isConfigured'](_0x3b70ae[_0xb731('0x1ae')])){return this['channel']['error'](_0x3b70ae,'no\x20subproject\x20selected');}var _0x2ad387=this[_0xb731('0x1a')][_0xb731('0xba')](this,_0x3b70ae[_0xb731('0x1ae')]);if(!this[_0xb731('0x83')](_0x2ad387)){return this[_0xb731('0x10')]['error'](_0x3b70ae,util[_0xb731('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3b70ae[_0xb731('0x1ae')]));}if(_0x2ad387===this['channel'][_0xb731('0x1af')]){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x3b70ae,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xb731('0x37')][_0xb731('0xba')](this,_0x3b70ae,_0x2ad387);var _0x508d9c=this[_0xb731('0x10')][_0xb731('0x56')](_0xb731('0x1b0'),util[_0xb731('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xb731('0x8')][_0xb731('0x196')]||_0xb731('0x1b1'),_0x2ad387,this[_0xb731('0x10')][_0xb731('0x1af')]));if(_0x508d9c[_0xb731('0xa1')]===-0x1){return _0x508d9c;}return this[_0xb731('0x10')][_0xb731('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0xb731('0x1b0'),_0x2ad387));};AGIVertices['prototype'][_0xb731('0x1b2')]=function(_0x32b45d){logger['info'](util[_0xb731('0x2b')](_0xb731('0x1b3'),_0x32b45d[_0xb731('0x39')]));var _0x10700f=this['shellCommand'][_0xb731('0xba')](this,_0x32b45d[_0xb731('0xb3')]);this[_0xb731('0x37')][_0xb731('0xba')](this,_0x32b45d,_0x32b45d[_0xb731('0xb3')]);if(this['isConfigured'](_0x32b45d['variable_id'])){var _0x5ab8b9=this['getVariable'][_0xb731('0xba')](this,_0x32b45d[_0xb731('0xd1')]);if(_0x5ab8b9){this['channel'][_0xb731('0x9c')](_0x5ab8b9,_0x10700f);return this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x1b4'),_0x32b45d[_0xb731('0xb3')],_0x5ab8b9));}}return this[_0xb731('0x10')]['noop'](util[_0xb731('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x32b45d[_0xb731('0xb3')]));};AGIVertices[_0xb731('0x13')][_0xb731('0x1b5')]=function(_0x2449ad){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x1b6'),_0x2449ad[_0xb731('0x39')]));_0x2449ad[_0xb731('0x5c')]=_0x2449ad[_0xb731('0x5c')][_0xb731('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb731('0x83')](_0x2449ad['apiKey'])){return this['channel'][_0xb731('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0xb731('0x83')](_0x2449ad['text'])){return this[_0xb731('0x10')]['noop'](_0xb731('0xc0'));}this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x1b7'),_0x2449ad[_0xb731('0x5c')]));var _0x5ef4b5=this[_0xb731('0x59')][_0xb731('0xba')](this,_0x2449ad);if(_0x5ef4b5){this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x5ef4b5));var _0xf58ea9=this['channel'][_0xb731('0x121')](_0x5ef4b5);try{fs[_0xb731('0x102')](_0x5ef4b5+_0xb731('0x122'));}catch(_0x1fafb2){logger['error'](_0x1fafb2);}return _0xf58ea9;}return this[_0xb731('0x10')][_0xb731('0x2e')](_0x2449ad,_0xb731('0x1b8'));};AGIVertices[_0xb731('0x13')][_0xb731('0x1b9')]=function(_0x380026){logger[_0xb731('0xa2')](util[_0xb731('0x2b')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x380026[_0xb731('0x39')]));_0x380026['text']=_0x380026[_0xb731('0x5c')][_0xb731('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb731('0x83')](_0x380026[_0xb731('0x5c')])){return this[_0xb731('0x10')][_0xb731('0xa8')]('no\x20text\x20configured');}this[_0xb731('0x10')][_0xb731('0xa8')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x380026[_0xb731('0x5c')]));var _0x48abb5=this[_0xb731('0x61')][_0xb731('0xba')](this,_0x380026);if(_0x48abb5){this['channel']['noop'](util[_0xb731('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x48abb5));var _0x44f86f=this[_0xb731('0x10')]['streamFile'](_0x48abb5);try{fs['unlink'](_0x48abb5+'.wav');}catch(_0x5a2a61){logger[_0xb731('0x2e')](_0x5a2a61);}return _0x44f86f;}return this[_0xb731('0x10')][_0xb731('0x2e')](_0x380026,_0xb731('0x1ba'));};AGIVertices[_0xb731('0x13')][_0xb731('0x1bb')]=function(_0x52faaf){logger['info'](util[_0xb731('0x2b')](_0xb731('0x1bc'),_0x52faaf[_0xb731('0x39')]));if(!this['isConfigured'](_0x52faaf[_0xb731('0x153')])){return this[_0xb731('0x10')]['error'](_0x52faaf,_0xb731('0x154'));}logger[_0xb731('0xa2')](util['format'](_0xb731('0x15b'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x52faaf[_0xb731('0x153')]));var _0x59d1e0=this[_0xb731('0x50')]['sync'](this,_0x52faaf[_0xb731('0x153')]);if(_0x59d1e0){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x155'),this[_0xb731('0x10')][_0xb731('0x3b')],_0x52faaf[_0xb731('0x153')]));this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x155'),this[_0xb731('0x10')]['callerid'],_0x52faaf['findBy']));return{'code':0xc8,'result':_0xb731('0x156')};}else{logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x157'),this['channel'][_0xb731('0x3b')],_0x52faaf['findBy']));this[_0xb731('0x10')][_0xb731('0xa8')](util[_0xb731('0x2b')](_0xb731('0x157'),this['channel'][_0xb731('0x3b')],_0x52faaf[_0xb731('0x153')]));return{'code':0xc8,'result':_0xb731('0x158')};}};AGIVertices[_0xb731('0x13')][_0xb731('0x1bd')]=function(_0x3fbce3){logger['info'](util[_0xb731('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3fbce3['label']));var _0x160724=this[_0xb731('0x10')]['exec'](_0xb731('0x1be'),[_0x3fbce3[_0xb731('0x1bf')],_0x3fbce3[_0xb731('0x76')]]);if(_0x160724[_0xb731('0xa1')]===-0x1){return _0x160724;}return this[_0xb731('0x10')][_0xb731('0xa8')](util['format'](_0xb731('0x16b'),'VOICEMAIL',_0x3fbce3[_0xb731('0x1bf')]));};AGIVertices['prototype']['vswitch']=function(_0x4f03de){logger[_0xb731('0xa2')](util[_0xb731('0x2b')](_0xb731('0x1c0'),_0x4f03de[_0xb731('0x39')]));if(!this[_0xb731('0x83')](_0x4f03de[_0xb731('0xd1')])){return this[_0xb731('0x10')]['error'](_0x4f03de,_0xb731('0x1c1'));}var _0x296943=this[_0xb731('0x14')]['sync'](this,_0x4f03de[_0xb731('0xd1')]);if(!_0x296943){return this[_0xb731('0x10')][_0xb731('0x2e')](_0x4f03de,_0xb731('0xd3'));}var _0x36dc83=this['channel'][_0xb731('0x14')](_0x296943);return{'code':0xc8,'result':_0x36dc83['extra']?_0x36dc83[_0xb731('0x9f')]:'-'};};String[_0xb731('0x13')][_0xb731('0x9e')]=function(_0x177beb,_0x994064){return this[_0xb731('0x9d')](_0x177beb)[_0xb731('0x1c2')](_0x994064);};module[_0xb731('0x1c3')]=AGIVertices; \ No newline at end of file +var _0x47c5=['toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','isString','%s.%s','saveRestApiResult','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','no\x20variable\x20found','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Executed\x20command\x20%s\x20%s','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method'];(function(_0x466db3,_0x36316d){var _0x143e1e=function(_0x528f31){while(--_0x528f31){_0x466db3['push'](_0x466db3['shift']());}};_0x143e1e(++_0x36316d);}(_0x47c5,0x165));var _0x547c=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x47c5[_0x5f1617];return _0x3af5da;};'use strict';var fs=require('fs');var path=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var _=require(_0x547c('0x2'));var sh=require(_0x547c('0x3'));var odbc=require(_0x547c('0x4'))();var rs=require(_0x547c('0x5'));var moment=require('moment');var Mustache=require(_0x547c('0x6'));var rp=require(_0x547c('0x7'));var logger=require('../../config/logger')(_0x547c('0x8'));var config=require(_0x547c('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x547c('0xa');var recursiveMapAttributes=[_0x547c('0xb'),_0x547c('0xc')];var verticesWithRetry=[_0x547c('0xd'),_0x547c('0xe'),_0x547c('0xf')];var AGIVertices=function(_0x3e2279,_0x40be25,_0x10dec9){this[_0x547c('0x10')]=_0x3e2279;this[_0x547c('0x11')]=_0x40be25;this[_0x547c('0x12')]=_0x10dec9;};AGIVertices[_0x547c('0x13')][_0x547c('0x14')]=function(_0x386e2c,_0x8addbe){this[_0x547c('0x11')]['getVariableById'](_0x386e2c)[_0x547c('0x15')](function(_0x39dce7){_0x8addbe(null,_0x39dce7?_0x39dce7['name']:![]);})[_0x547c('0x16')](function(_0x201d95){_0x8addbe(_0x201d95);});};AGIVertices[_0x547c('0x13')][_0x547c('0x17')]=function(_0x392a35,_0x150317){this[_0x547c('0x11')][_0x547c('0x18')](_0x392a35)[_0x547c('0x15')](function(_0x161991){_0x150317(null,_0x161991?_0x161991[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x39f316){_0x150317(_0x39f316);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1a')]=function(_0xf32cdd,_0x39498d){this[_0x547c('0x11')]['getSquareProjectById'](_0xf32cdd)['then'](function(_0x23fa9e){_0x39498d(null,_0x23fa9e?_0x23fa9e[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x4a8901){_0x39498d(_0x4a8901);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1b')]=function(_0x1ddbd3,_0x58ddc9){this[_0x547c('0x11')][_0x547c('0x1c')](_0x1ddbd3)['then'](function(_0x5453f9){_0x58ddc9(null,_0x5453f9?_0x5453f9[_0x547c('0x1d')]:![]);})[_0x547c('0x16')](function(_0x4f20c1){_0x58ddc9(_0x4f20c1);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1e')]=function(_0x592e46,_0x2e317a){this[_0x547c('0x11')][_0x547c('0x1f')](_0x592e46)['then'](function(_0x3a55a0){_0x2e317a(null,_0x3a55a0?_0x3a55a0[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x26823c){_0x2e317a(_0x26823c);});};AGIVertices[_0x547c('0x13')][_0x547c('0x20')]=function(_0x2ab2cc,_0x17fa33){this['rpc'][_0x547c('0x21')](_0x2ab2cc)['then'](function(_0x5b05f2){_0x17fa33(null,_0x5b05f2?_0x5b05f2['name']:![]);})['catch'](function(_0x2c725d){_0x17fa33(_0x2c725d);});};AGIVertices['prototype'][_0x547c('0x22')]=function(_0x5729b0,_0x3ea493){var _0x486216=this;this[_0x547c('0x11')][_0x547c('0x23')](_0x5729b0)[_0x547c('0x15')](function(_0x30a96c){_0x3ea493(null,_0x30a96c?_0x486216[_0x547c('0x24')](_0x30a96c['save_name']):![]);})['catch'](function(_0x28c282){_0x3ea493(_0x28c282);});};AGIVertices['prototype'][_0x547c('0x25')]=function(_0xed2d39,_0x3e7652){this[_0x547c('0x11')][_0x547c('0x26')](_0xed2d39)[_0x547c('0x15')](function(_0x342c10){_0x3e7652(null,_0x342c10?_0x342c10:![]);})['catch'](function(_0x54f6a8){_0x3e7652(_0x54f6a8);});};AGIVertices[_0x547c('0x13')][_0x547c('0x27')]=function(_0x1e4313,_0x26850a,_0x1b8c17){this[_0x547c('0x12')][_0x547c('0x27')](_0x1e4313,_0x26850a)[_0x547c('0x15')](function(){_0x1b8c17(null);})[_0x547c('0x16')](function(_0x31026e){_0x1b8c17(_0x31026e);});};AGIVertices[_0x547c('0x13')][_0x547c('0x28')]=function(_0x243cb,_0x385275){this['rpc'][_0x547c('0x29')](_0x243cb)['then'](function(_0x4ad00e){if(_0x4ad00e){if(_0x4ad00e['IntervalId']){_0x385275(null,[_0x4ad00e[_0x547c('0x2a')]]);}else{_0x385275(null,_[_0x547c('0x2b')](_0x4ad00e[_0x547c('0x2c')],_0x547c('0x2a')));}}else{_0x385275(null,![]);}})[_0x547c('0x16')](function(_0x45f724){_0x385275(_0x45f724);});};AGIVertices['prototype']['getSoundPath']=function(_0x5ea2c7){return util[_0x547c('0x2d')](_0x547c('0x2e'),FILES_PATH,_0x5ea2c7);};AGIVertices[_0x547c('0x13')][_0x547c('0x2f')]=function(_0xe0352c,_0x185465,_0x57ce3b){odbc[_0x547c('0x30')](_0xe0352c,function(_0x4e2e52){if(_0x4e2e52){logger[_0x547c('0x31')](_0x547c('0x32'),_0x4e2e52);_0x57ce3b(_0x4e2e52);}else{logger['info'](_0x547c('0x33'));odbc['query'](_0x185465,function(_0x511103,_0x3137e0){if(_0x511103){logger[_0x547c('0x34')](_0x547c('0x35'),_0x185465);_0x57ce3b(_0x511103);}else{logger[_0x547c('0x34')]('Query\x20executed\x20correctly\x20%s',_0x185465);odbc['close'](function(_0xe5f1b9){if(_0xe5f1b9){logger[_0x547c('0x31')](_0x547c('0x36'),_0xe5f1b9);}_0x57ce3b(null,_0x3137e0);});}});}});};AGIVertices['prototype'][_0x547c('0x37')]=function(_0x21838a,_0x4746ee){this['rpc'][_0x547c('0x38')](_0x21838a)[_0x547c('0x15')](function(_0xbb08e7){_0x4746ee(null,_0xbb08e7?_0xbb08e7:![]);})['catch'](function(_0x26e8d2){_0x4746ee(_0x26e8d2);});};AGIVertices[_0x547c('0x13')]['createSmsMessage']=function(_0x26ea8c,_0x23c8b2){this[_0x547c('0x11')]['createSmsMessage'](_0x26ea8c)[_0x547c('0x15')](function(_0x4f2859){_0x23c8b2(null,_0x4f2859);})[_0x547c('0x16')](function(_0x5393a2){_0x23c8b2(_0x5393a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x39')]=function(_0x3d37d7,_0x3797d3,_0x139a61){this[_0x547c('0x11')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x547c('0x3a')],'node':_0x3d37d7[_0x547c('0x3b')],'application':_0x3d37d7[_0x547c('0x3c')],'data':_0x3797d3||null,'project_name':this['channel'][_0x547c('0x3d')],'callerid':this[_0x547c('0x10')][_0x547c('0x3e')]})[_0x547c('0x15')](function(_0x1e4ab7){if(_0x139a61){_0x139a61(null,_0x1e4ab7);}})[_0x547c('0x16')](function(_0x4adb6f){if(_0x139a61){_0x139a61(_0x4adb6f);}});};AGIVertices[_0x547c('0x13')][_0x547c('0x3f')]=function(_0x3d7088,_0x4c4287,_0x291302,_0x478320){this[_0x547c('0x11')][_0x547c('0x3f')]({'uniqueid':this['channel'][_0x547c('0x3a')],'callerid':this['channel'][_0x547c('0x3e')],'calleridname':this['channel'][_0x547c('0x40')],'context':this[_0x547c('0x10')]['context'],'extension':this[_0x547c('0x10')][_0x547c('0x41')],'priority':this[_0x547c('0x10')][_0x547c('0x42')],'accountcode':this['channel'][_0x547c('0x43')],'dnid':this['channel']['dnid'],'projectName':this[_0x547c('0x10')][_0x547c('0x3d')],'saveName':_0x4c4287,'filename':_0x3d7088[_0x547c('0x44')]||_0x4c4287,'savePath':_0x291302})[_0x547c('0x15')](function(_0x1daaf4){_0x478320(null,_0x1daaf4);})[_0x547c('0x16')](function(_0x153392){_0x478320(_0x153392);});};AGIVertices[_0x547c('0x13')][_0x547c('0x45')]=function(_0x31a262,_0x25b267,_0x38b2bc,_0x503b41,_0x4a0f42){this[_0x547c('0x11')][_0x547c('0x45')]({'uniqueid':this['channel'][_0x547c('0x3a')],'body':_0x31a262,'direction':_0x25b267,'providerName':_0x38b2bc,'providerResponse':_0x503b41})[_0x547c('0x15')](function(_0x3ab131){if(_0x4a0f42){_0x4a0f42(null,_0x3ab131);}})[_0x547c('0x16')](function(_0x30680d){if(_0x4a0f42){_0x4a0f42(_0x30680d);}});};AGIVertices[_0x547c('0x13')]['createCmContact']=function(_0x152982,_0x5258cf){this[_0x547c('0x11')][_0x547c('0x46')]({'firstName':_[_0x547c('0x47')](_0x152982['name'])||_[_0x547c('0x48')](_0x152982['name'])?_0x547c('0x49')+Math[_0x547c('0x4a')]():_0x152982['name'],'lastName':_[_0x547c('0x47')](_0x152982[_0x547c('0x4b')])||_[_0x547c('0x48')](_0x152982[_0x547c('0x4b')])?null:_0x152982[_0x547c('0x4b')],'phone':_0x152982[_0x547c('0x4c')],'ListId':_0x152982[_0x547c('0x4d')],'scheduledat':_0x152982['scheduledAt'],'callbackUniqueid':this[_0x547c('0x10')]['uniqueid'],'tags':_0x547c('0x4e'),'description':_0x547c('0x4f')+_0x152982[_0x547c('0x50')][_0x547c('0x51')](),'priority':_0x152982[_0x547c('0x52')]})['then'](function(_0x369fb0){_0x5258cf(null,_0x369fb0);})['catch'](function(_0x124222){_0x5258cf(_0x124222);});};AGIVertices[_0x547c('0x13')][_0x547c('0x53')]=function(_0x2b14e0,_0x347536){this['rpc'][_0x547c('0x54')](_0x2b14e0)[_0x547c('0x15')](function(_0x4efdd5){_0x347536(null,_0x4efdd5?_0x4efdd5[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x22e016){_0x347536(_0x22e016);});};AGIVertices[_0x547c('0x13')]['agentPause']=function(_0x52d134,_0x56125c,_0x188363){var _0x455467={'role':'agent'};_0x455467[_0x52d134]=this[_0x547c('0x10')]['callerid'];this[_0x547c('0x11')][_0x547c('0x55')](_0x455467,_0x56125c,this[_0x547c('0x10')][_0x547c('0x3a')])[_0x547c('0x15')](function(_0x423889){_0x188363(null,_[_0x547c('0x48')](_0x423889)?![]:!![]);})['catch'](function(_0x5746ee){logger[_0x547c('0x31')](_0x5746ee);_0x188363(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x56')]=function(_0x64bf1e,_0xd3b584){var _0x50582e={'role':'agent'};_0x50582e[_0x64bf1e]=this['channel']['callerid'];this['rpc'][_0x547c('0x56')](_0x50582e)[_0x547c('0x15')](function(_0xe32d09){_0xd3b584(null,_['isNil'](_0xe32d09)?![]:!![]);})[_0x547c('0x16')](function(_0x1f901b){logger[_0x547c('0x31')](_0x1f901b);_0xd3b584(null,![]);});};AGIVertices[_0x547c('0x13')]['agentLogout']=function(_0x4ab718,_0x5c395d){var _0xa66eee={'role':_0x547c('0x57')};_0xa66eee[_0x4ab718]=this[_0x547c('0x10')][_0x547c('0x3e')];this[_0x547c('0x11')]['agentLogout'](_0xa66eee)['then'](function(_0x1e2826){_0x5c395d(null,_[_0x547c('0x48')](_0x1e2826)?![]:!![]);})[_0x547c('0x16')](function(_0x70451){logger[_0x547c('0x31')](_0x70451);_0x5c395d(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x531892,_0x244e32){var _0x48f519={'role':_0x547c('0x57')};_0x48f519[_0x531892]=this[_0x547c('0x10')][_0x547c('0x3e')];var _0x50f4e6=_0x531892!='internal'?util[_0x547c('0x2d')](_0x547c('0x58'),_0x547c('0x59'),this[_0x547c('0x10')][_0x547c('0x3e')]):undefined;this[_0x547c('0x11')][_0x547c('0x5a')](_0x48f519,_0x50f4e6)['then'](function(_0x310243){_0x244e32(null,_[_0x547c('0x48')](_0x310243)?![]:!![]);})[_0x547c('0x16')](function(_0x6bf96d){logger[_0x547c('0x31')](_0x6bf96d);_0x244e32(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5b')]=function(_0x4066ce,_0x49dc3c){sh[_0x547c('0x5c')](_[_0x547c('0x5d')](_0x4066ce),function(_0x1dedca,_0xe3e820){var _0x4f0ed4=_0xe3e820[_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'');_0x49dc3c(null,_0x4f0ed4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5f')]=function(_0x4e2acc,_0x52cccd){scripts['googleCloudTTS'](_0x4e2acc[_0x547c('0x60')],_0x4e2acc[_0x547c('0x61')]||_0x547c('0x62'),_0x4e2acc['text'],_0x4e2acc[_0x547c('0x63')]||_0x547c('0x64'),_0x4e2acc[_0x547c('0x65')]||_0x547c('0x66'),_0x4e2acc['audioEncoding']||'MP3')[_0x547c('0x15')](function(_0x5e41e4){_0x52cccd(null,_0x5e41e4);})[_0x547c('0x16')](function(_0x393204){_0x52cccd(_0x393204);});};AGIVertices['prototype'][_0x547c('0x67')]=function(_0x4edded,_0x1566d6){scripts[_0x547c('0x67')](_0x4edded['text'],_0x4edded[_0x547c('0x68')]||'en',0x1)[_0x547c('0x15')](function(_0xdd0ebc){_0x1566d6(null,_0xdd0ebc);})[_0x547c('0x16')](function(_0x4c7e53){_0x1566d6(_0x4c7e53);});};AGIVertices['prototype'][_0x547c('0x69')]=function(_0x165bfe,_0x358aed){var _0x3378a3={'uri':_0x165bfe['url'],'method':_0x165bfe['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x165bfe[_0x547c('0x6a')])===_0x547c('0x6b')&&parseInt(_0x165bfe[_0x547c('0x6a')])>=0x1?parseInt(_0x165bfe[_0x547c('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0x547c('0x6c')]([_0x547c('0x6d'),_0x547c('0x6e')],_0x3378a3[_0x547c('0x6f')][_0x547c('0x70')]())){try{_0x3378a3[_0x547c('0x71')]=_0x165bfe[_0x547c('0xc')]?JSON[_0x547c('0x72')](_0x165bfe[_0x547c('0xc')]):{};}catch(_0x4e038b){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4e038b);}}try{_0x3378a3[_0x547c('0x73')]=_0x165bfe['rawHeaders']?JSON['parse'](_0x165bfe[_0x547c('0xb')]):{};}catch(_0x5cbef2){logger['error'](_0x547c('0x74'),_0x5cbef2);}if(_0x165bfe[_0x547c('0x75')]){try{var _0x2ab7d3=require(_0x165bfe[_0x547c('0x75')])['sync'](this,_0x3378a3);_0x3378a3[_0x547c('0x76')]=Mustache[_0x547c('0x77')](_0x165bfe['url'],_0x2ab7d3,{},['$$','$$']);if(_0x3378a3['headers']){_0x3378a3[_0x547c('0x73')]=JSON[_0x547c('0x72')](Mustache[_0x547c('0x77')](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x73')]),_0x2ab7d3,{},['$$','$$']));}if(_0x3378a3[_0x547c('0x71')]){_0x3378a3[_0x547c('0x71')]=JSON[_0x547c('0x72')](Mustache['render'](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x71')]),_0x2ab7d3,{},['$$','$$']));}}catch(_0x1fd7d1){logger['error'](_0x547c('0x79'),_0x1fd7d1);}}rp(_0x3378a3)[_0x547c('0x15')](function(_0x2cb2ff){var _0x1fa904={'statusCode':_0x2cb2ff[_0x547c('0x7a')]||0xc8,'statusMessage':_0x2cb2ff[_0x547c('0x7b')]||'OK','headers':_0x2cb2ff[_0x547c('0x73')]||{},'body':_0x2cb2ff[_0x547c('0x71')]||{}};_0x358aed(null,_0x1fa904);})[_0x547c('0x16')](function(_0x7a72fd){var _0x73eb72={'statusCode':_0x7a72fd[_0x547c('0x7a')]||0x1f4,'statusMessage':_0x7a72fd[_0x547c('0x7c')]||_0x547c('0x7d'),'headers':_0x7a72fd['options'][_0x547c('0x73')]||{},'body':_0x7a72fd[_0x547c('0x7e')][_0x547c('0x71')]||{}};_0x358aed(null,_0x73eb72);});};AGIVertices['prototype'][_0x547c('0x7f')]=function(_0x19927b,_0x185176){scripts[_0x547c('0x7f')](this[_0x547c('0x10')][_0x547c('0x3a')],_0x19927b[_0x547c('0x80')],_0x19927b[_0x547c('0x62')],_0x19927b[_0x547c('0x81')]||'en')[_0x547c('0x15')](function(_0x224f62){_0x185176(null,_0x224f62);})[_0x547c('0x16')](function(_0x3a988f){_0x185176(_0x3a988f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4d8594,_0x588e2b){scripts['googleDialogflowV2'](this['channel'][_0x547c('0x3a')],_0x4d8594[_0x547c('0x82')],_0x4d8594[_0x547c('0x83')],_0x4d8594[_0x547c('0x84')],_0x4d8594['text'],_0x4d8594[_0x547c('0x85')]||'en')[_0x547c('0x15')](function(_0x27410e){_0x588e2b(null,_0x27410e);})['catch'](function(_0x4607f4){_0x588e2b(_0x4607f4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x86')]=function(_0x53a0a7,_0x51f200){scripts['sestekNDA'](this[_0x547c('0x10')],_0x53a0a7)['then'](function(_0x41e2c2){_0x51f200(null,_0x41e2c2);})[_0x547c('0x16')](function(_0x58d2b3){_0x51f200(_0x58d2b3);});};AGIVertices[_0x547c('0x13')][_0x547c('0x87')]=function(_0x168b42,_0x3f54cf){scripts[_0x547c('0x87')](_0x168b42['key'],_0x168b42[_0x547c('0x62')],_0x168b42['ispeech_tts_language']||_0x547c('0x64'),_0x168b42[_0x547c('0x88')])[_0x547c('0x15')](function(_0x1dfce9){_0x3f54cf(null,_0x1dfce9);})['catch'](function(_0x1e8cd7){_0x3f54cf(_0x1e8cd7);});};AGIVertices['prototype'][_0x547c('0x89')]=function(_0x8eb70e,_0x506426,_0x348ef8){scripts['ispeechASR'](_0x506426,_0x8eb70e[_0x547c('0x80')],_0x8eb70e[_0x547c('0x8a')]||_0x547c('0x64'),this[_0x547c('0x8b')](_0x8eb70e['model'])?_0x8eb70e[_0x547c('0x8c')]:undefined)[_0x547c('0x15')](function(_0xea441b){_0x348ef8(null,_0xea441b);})[_0x547c('0x16')](function(_0x2febce){_0x348ef8(_0x2febce);});};AGIVertices['prototype'][_0x547c('0x8d')]=function(_0x36d1b0,_0x28cbee){scripts['awsPolly'](_0x36d1b0[_0x547c('0x8e')],_0x36d1b0[_0x547c('0x8f')],_0x36d1b0[_0x547c('0x90')],_0x36d1b0[_0x547c('0x91')]||'Amy',_0x36d1b0[_0x547c('0x62')],_0x36d1b0['aws_text_type']||_0x547c('0x62'))['then'](function(_0x196128){_0x28cbee(null,_0x196128);})[_0x547c('0x16')](function(_0xc17a4d){_0x28cbee(_0xc17a4d);});};AGIVertices[_0x547c('0x13')][_0x547c('0x92')]=function(_0x2b314d,_0x48bb39){scripts['awsLex'](this['channel'][_0x547c('0x3a')],_0x2b314d[_0x547c('0x8e')],_0x2b314d[_0x547c('0x8f')],_0x2b314d[_0x547c('0x93')],_0x2b314d['text'],_0x2b314d[_0x547c('0x94')])['then'](function(_0xbd5c0e){_0x48bb39(null,_0xbd5c0e);})[_0x547c('0x16')](function(_0x7edc0f){_0x48bb39(_0x7edc0f);});};AGIVertices[_0x547c('0x13')][_0x547c('0x95')]=function(_0x15778c,_0x51e60a,_0x40bc73){scripts['googleASR'](_0x51e60a,_0x15778c[_0x547c('0x80')],_0x15778c[_0x547c('0x96')]||'en-US')[_0x547c('0x15')](function(_0x141f89){_0x40bc73(null,_0x141f89);})[_0x547c('0x16')](function(_0x1fe6a2){_0x40bc73(_0x1fe6a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x97')]=function(_0x24339b,_0x59bc57,_0xcdd93f){scripts[_0x547c('0x97')](_0x59bc57,_0x24339b[_0x547c('0x98')],_0x24339b['appsecret'],_0x24339b[_0x547c('0x76')])['then'](function(_0x1a29ca){_0xcdd93f(null,_0x1a29ca);})['catch'](function(_0x44b5e9){_0xcdd93f(_0x44b5e9);});};AGIVertices[_0x547c('0x13')][_0x547c('0x99')]=function(_0x13bbfe){var _0x515220=_[_0x547c('0x6c')](verticesWithRetry,_0x13bbfe[_0x547c('0x3c')])?_0x13bbfe:_[_0x547c('0x9a')](_0x13bbfe);for(var _0x358ca1 in _0x515220){if(_0x515220['hasOwnProperty'](_0x358ca1)){if(_0x515220[_0x358ca1]&&_['isString'](_0x515220[_0x358ca1])){if(_[_0x547c('0x6c')](recursiveMapAttributes,_0x358ca1)){_0x515220[_0x358ca1]=this[_0x547c('0x9b')](_0x515220[_0x358ca1]);}else{_0x515220[_0x358ca1]=this['replaceAllVariables'](_0x515220[_0x358ca1]);}}}}return _0x515220;};AGIVertices[_0x547c('0x13')]['recursiveNodeIndex']=function(_0x4c91fe){for(var _0x5c4b10 in _0x4c91fe){if(_0x4c91fe[_0x547c('0x9c')](_0x5c4b10)){if(_[_0x547c('0x9d')](_0x4c91fe[_0x5c4b10])){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10]);}else if(_[_0x547c('0x9f')](_0x4c91fe[_0x5c4b10])){for(var _0x508a62=0x0;_0x508a62<_0x4c91fe[_0x5c4b10][_0x547c('0xa0')];_0x508a62++){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10][_0x508a62]);}}else if(_[_0x547c('0xa1')](_0x4c91fe[_0x5c4b10])){_0x4c91fe[_0x5c4b10]=this['replaceAllVariables'](_0x4c91fe[_0x5c4b10]);}}}};AGIVertices[_0x547c('0x13')]['saveRestApiResult']=function(_0x90de50,_0x3ffc1e){for(var _0xc648f4 in _0x90de50){if(_0x90de50['hasOwnProperty'](_0xc648f4)){if(_[_0x547c('0x9d')](_0x90de50[_0xc648f4])){if(!_[_0x547c('0x47')](_0x90de50[_0xc648f4])){this['saveRestApiResult'](_0x90de50[_0xc648f4],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4));}}else if(_[_0x547c('0x9f')](_0x90de50[_0xc648f4])){for(var _0x2fb055=0x0;_0x2fb055<_0x90de50[_0xc648f4][_0x547c('0xa0')];_0x2fb055++){this[_0x547c('0xa3')](_0x90de50[_0xc648f4][_0x2fb055],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4+'['+_0x2fb055+']'));}}else{if(!_[_0x547c('0x48')](_0x90de50[_0xc648f4])){this[_0x547c('0x10')]['setVariable'](util['format'](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4),_0x90de50[_0xc648f4]);}}}}};AGIVertices['prototype'][_0x547c('0x9b')]=function(_0x557e76){try{var _0x66a70c=JSON[_0x547c('0x72')](_0x557e76);this[_0x547c('0x9e')](_0x66a70c);return JSON[_0x547c('0x78')](_0x66a70c);}catch(_0x2c962d){return this[_0x547c('0xa4')](_0x557e76);}};AGIVertices[_0x547c('0x13')]['replaceAllVariables']=function(_0x180b89){var _0x23701c=_0x180b89[_0x547c('0xa5')]('{');for(var _0x436c13=0x1;_0x436c13<_0x23701c[_0x547c('0xa0')];_0x436c13+=0x1){var _0x3fa33c=_0x23701c[_0x436c13][_0x547c('0xa5')]('}');if(_0x3fa33c[_0x547c('0xa0')]>0x1){_0x180b89=_0x180b89[_0x547c('0xa6')]('{'+_0x3fa33c[0x0]+'}',this[_0x547c('0x10')][_0x547c('0x14')](_0x3fa33c[0x0])[_0x547c('0xa7')]||_0x3fa33c[0x0]);}}if(_0x23701c[_0x547c('0xa0')]===0x1){return _0x180b89['toString']();}return this[_0x547c('0xa4')](_0x180b89);};AGIVertices[_0x547c('0x13')][_0x547c('0xa8')]=function(_0x8811ee,_0x23da9d){var _0x11e9fd=this[_0x547c('0x10')][_0x547c('0x14')](_0x8811ee);if(_0x11e9fd['result']===-0x1){return _0x11e9fd;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xa9'),_0x23da9d,_0x11e9fd['extra']));return this['channel'][_0x547c('0xaa')](_0x23da9d,_0x11e9fd[_0x547c('0xa7')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x8b')]=function(_0x443680){return _0x443680&&_0x443680!=='0'&&_0x443680!=='-1'&&_0x443680!=='';};AGIVertices[_0x547c('0x13')][_0x547c('0xab')]=function(_0xb541a7){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0xb541a7,'-');_0xb541a7[_0x547c('0xad')]=_0xb541a7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x547c('0x13')][_0x547c('0xae')]=function(_0x40421b){logger[_0x547c('0x34')](util['format'](_0x547c('0xaf'),_0x40421b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x40421b[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}var _0x50d13b='\x22'+_0x40421b[_0x547c('0x62')]+'\x22';if(this[_0x547c('0x8b')](_0x40421b[_0x547c('0x7e')])){_0x50d13b+=','+_0x40421b[_0x547c('0x7e')];}var _0x57dae1=this[_0x547c('0x10')]['exec']('MRCPSynth',_0x50d13b);if(_0x57dae1[_0x547c('0xb2')]===-0x1){return _0x57dae1;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x50d13b));};AGIVertices[_0x547c('0x13')]['mrcprecog']=function(_0x5c3ccc){logger[_0x547c('0x34')](util['format'](_0x547c('0xb4'),_0x5c3ccc[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5c3ccc[_0x547c('0xb5')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x580190=_0x5c3ccc[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5c3ccc['options'])){_0x580190+=','+_0x5c3ccc[_0x547c('0x7e')];}var _0xa5710=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x580190);if(_0xa5710['result']===-0x1){return _0xa5710;}var _0x47c368=this[_0x547c('0xa8')]('RECOG_CONFIDENCE()',_0x547c('0xb8'));if(_0x47c368['result']===-0x1){return _0x47c368;}var _0x1d00ea=this['getAndSetVariable'](_0x547c('0xb9'),_0x547c('0xba'));if(_0x1d00ea[_0x547c('0xb2')]===-0x1){return _0x1d00ea;}var _0x1bf745=this[_0x547c('0xa8')](_0x547c('0xbb'),_0x547c('0xbc'));if(_0x1bf745[_0x547c('0xb2')]===-0x1){return _0x1bf745;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x580190));};AGIVertices[_0x547c('0x13')][_0x547c('0x8')]=function(_0x6105fe){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xbe'),_0x6105fe[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x8')]([_0x6105fe[_0x547c('0xbf')],_0x6105fe[_0x547c('0xc0')]]);};AGIVertices['prototype'][_0x547c('0xc1')]=function(_0x2ea971){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2ea971[_0x547c('0x3b')]));if(this[_0x547c('0x8b')](_0x2ea971[_0x547c('0x6a')])){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc2'),_0x2ea971[_0x547c('0x6a')]));var _0xecf19c=this['channel'][_0x547c('0xc3')](_0x2ea971[_0x547c('0x6a')]);if(_0xecf19c[_0x547c('0xb2')]===-0x1){return _0xecf19c;}}return this[_0x547c('0x10')][_0x547c('0xc1')]();};AGIVertices[_0x547c('0x13')][_0x547c('0x4e')]=function(_0x30a5b2){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc4'),_0x30a5b2[_0x547c('0x3b')]));if(!this['isConfigured'](_0x30a5b2[_0x547c('0x4d')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x30a5b2,_0x547c('0xc5'));}_0x30a5b2[_0x547c('0x50')]=moment();if(this['isConfigured'](_0x30a5b2['delay'])){_0x30a5b2[_0x547c('0x50')]=moment()[_0x547c('0xc6')](_0x30a5b2[_0x547c('0xc7')],'minutes');}if(!this[_0x547c('0x8b')](_0x30a5b2[_0x547c('0x52')])){_0x30a5b2[_0x547c('0x52')]=0x2;}this[_0x547c('0x46')][_0x547c('0xac')](this,_0x30a5b2);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xc8'),_0x30a5b2['phone'],_0x30a5b2['list_id'],_0x30a5b2[_0x547c('0x50')]));};AGIVertices[_0x547c('0x13')]['custom_app']=function(_0x101cd1){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc9'),_0x101cd1[_0x547c('0x3b')]));var _0x21d031=this[_0x547c('0x10')][_0x547c('0x5c')](_0x101cd1['application'],_0x101cd1['options']);if(_0x21d031[_0x547c('0xb2')]===-0x1){return _0x21d031;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x101cd1[_0x547c('0xca')],_0x101cd1['options']));};AGIVertices[_0x547c('0x13')][_0x547c('0xcb')]=function(_0x5b1afb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xcc'),_0x5b1afb[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5b1afb[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x21c274='\x22'+_0x5b1afb[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x5b1afb[_0x547c('0x7e')])){_0x21c274+=','+_0x5b1afb['options'];}var _0x340512=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xcd'),_0x21c274);if(_0x340512['result']===-0x1){return _0x340512;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x21c274));};AGIVertices[_0x547c('0x13')]['sestektts']=function(_0x2b4fd7){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xce'),_0x2b4fd7[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x2b4fd7[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x36ee98='\x22'+_0x2b4fd7[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x2b4fd7[_0x547c('0x7e')])){_0x36ee98+=','+_0x2b4fd7[_0x547c('0x7e')];}var _0x4a5a9b=this['channel'][_0x547c('0x5c')](_0x547c('0xcd'),_0x36ee98);if(_0x4a5a9b[_0x547c('0xb2')]===-0x1){return _0x4a5a9b;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x36ee98));};AGIVertices[_0x547c('0x13')][_0x547c('0xcf')]=function(_0x5256b0){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd0'),_0x5256b0[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5256b0[_0x547c('0xb5')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x42c8c5=_0x5256b0[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5256b0[_0x547c('0x7e')])){_0x42c8c5+=','+_0x5256b0[_0x547c('0x7e')];}var _0x5f2608=this['channel'][_0x547c('0x5c')](_0x547c('0xb7'),_0x42c8c5);if(_0x5f2608[_0x547c('0xb2')]===-0x1){return _0x5f2608;}var _0x5add20=this[_0x547c('0xa8')](_0x547c('0xd1'),_0x547c('0xd2'));if(_0x5add20[_0x547c('0xb2')]===-0x1){return _0x5add20;}var _0x45f2b7=this[_0x547c('0xa8')]('RECOG_INPUT()',_0x547c('0xd3'));if(_0x45f2b7[_0x547c('0xb2')]===-0x1){return _0x45f2b7;}var _0x47ad34=this['getAndSetVariable'](_0x547c('0xbb'),_0x547c('0xd4'));if(_0x47ad34[_0x547c('0xb2')]===-0x1){return _0x47ad34;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x42c8c5));};AGIVertices[_0x547c('0x13')][_0x547c('0xd5')]=function(_0x4a2d0d){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd6'),_0x4a2d0d[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x4a2d0d[_0x547c('0xb5')])){return this[_0x547c('0x10')]['noop']('no\x20grammar\x20configured');}var _0x4eee3e=_0x4a2d0d[_0x547c('0xb5')];if(this['isConfigured'](_0x4a2d0d[_0x547c('0x7e')])){_0x4eee3e+=','+_0x4a2d0d[_0x547c('0x7e')];}var _0x135c87=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x4eee3e);if(_0x135c87[_0x547c('0xb2')]===-0x1){return _0x135c87;}var _0x65a4e4=this['getAndSetVariable'](_0x547c('0xd1'),_0x547c('0xd7'));if(_0x65a4e4['result']===-0x1){return _0x65a4e4;}var _0x203b7d=this[_0x547c('0xa8')](_0x547c('0xb9'),_0x547c('0xd8'));if(_0x203b7d['result']===-0x1){return _0x203b7d;}var _0x1e3004=this[_0x547c('0xa8')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1e3004[_0x547c('0xb2')]===-0x1){return _0x1e3004;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x4eee3e));};AGIVertices[_0x547c('0x13')][_0x547c('0xd9')]=function(_0x3abe71){logger[_0x547c('0x34')](util['format'](_0x547c('0xda'),_0x3abe71[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xdb')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdc'));}var _0x1059cd=this['getSquareOdbc'][_0x547c('0xac')](this,_0x3abe71['odbc_id']);if(!_0x1059cd){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdd'));}if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xde')])){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20query\x20configured');}var _0xae973e=_0x3abe71[_0x547c('0xde')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xdf'),_0xae973e));var _0x2026bf=this[_0x547c('0x2f')]['sync'](this,_0x1059cd,_0xae973e);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x3abe71,_0xae973e);if(!this[_0x547c('0x8b')](_0x3abe71['variable_id'])){return this[_0x547c('0x10')]['noop'](_0x547c('0xe0'));}var _0x36eb83=this['getVariable'][_0x547c('0xac')](this,_0x3abe71[_0x547c('0xe1')]);if(!_0x36eb83){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20variable\x20found');}var _0x85ac5c=this;_0x2026bf['forEach'](function(_0x2eff31,_0x288fa8){Object['keys'](_0x2eff31)['forEach'](function(_0x4cdef9){_0x85ac5c[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s[%s][%s]',_0x36eb83,_0x288fa8,_0x4cdef9),_0x2eff31[_0x4cdef9]);});});this[_0x547c('0x10')][_0x547c('0xaa')](util['format'](_0x547c('0xe2'),_0x36eb83),_0x2026bf[_0x547c('0xa0')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util['format'](_0x547c('0xe3'),_0x36eb83));};AGIVertices['prototype'][_0x547c('0xe4')]=function(_0x27ad64){logger[_0x547c('0xe5')](util[_0x547c('0x2d')](_0x547c('0xe6'),_0x27ad64[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x27ad64[_0x547c('0xe7')])){return this['channel'][_0x547c('0x31')](_0x27ad64,'no\x20user\x20selected');}var _0x21c7be=this[_0x547c('0x1e')][_0x547c('0xac')](this,_0x27ad64[_0x547c('0xe7')]);if(!_0x21c7be){return this['channel']['error'](_0x27ad64,_0x547c('0xe8'));}var _0x490e1e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0xea'),_0x21c7be),_0x27ad64[_0x547c('0x6a')],_0x27ad64[_0x547c('0xeb')],_0x27ad64[_0x547c('0xec')]]);if(_0x490e1e[_0x547c('0xb2')]===-0x1){return _0x490e1e;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x547c('0x13')][_0x547c('0xed')]=function(_0x27aeb1){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x27aeb1[_0x547c('0x3b')]));if(!this['isConfigured'](_0x27aeb1[_0x547c('0x80')])){return this[_0x547c('0x10')]['noop'](_0x547c('0xee'));}if(!this[_0x547c('0x8b')](_0x27aeb1['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this['createSquareDetailsReport'](_0x27aeb1);this[_0x547c('0x45')](_0x27aeb1[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xf0'),_0x27aeb1[_0x547c('0x62')]));var _0x251e38=this[_0x547c('0x7f')]['sync'](this,_0x27aeb1);if(_0x251e38){for(var _0x57eba7 in _0x251e38){if(_0x251e38[_0x547c('0x9c')](_0x57eba7)){this[_0x547c('0x10')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x57eba7[_0x547c('0x70')]()),_0x251e38[_0x57eba7]);}}this[_0x547c('0x45')](_0x251e38['speech'],_0x547c('0xf1'),'dialogflow','');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf2'),_0x251e38[_0x547c('0xf3')]));}return this['channel'][_0x547c('0x31')](_0x27aeb1,_0x547c('0xf4'));};AGIVertices[_0x547c('0x13')]['dialogflowV2']=function(_0x309343){logger['info'](util[_0x547c('0x2d')](_0x547c('0xf5'),_0x309343[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x309343['dialogflowV2_project_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xf6'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x83')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20client_email\x20configured');}if(!this[_0x547c('0x8b')](_0x309343['private_key'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20private_key\x20configured');}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x85')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xf7'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel']['bot']=!![];this[_0x547c('0x39')](_0x309343);this[_0x547c('0x45')](_0x309343[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf8'),_0x309343[_0x547c('0x62')]));var _0x25e06e=this[_0x547c('0xf9')][_0x547c('0xac')](this,_0x309343);if(_0x25e06e){for(var _0x583fce in _0x25e06e){if(_0x25e06e['hasOwnProperty'](_0x583fce)){if(_0x583fce!==_0x547c('0xfa')){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0xfb'),_0x583fce[_0x547c('0x70')]()),_0x25e06e[_0x583fce]);}}}this[_0x547c('0x45')](_0x25e06e[_0x547c('0xf3')],_0x547c('0xf1'),'dialogflowV2',_0x25e06e['providerResponse']);return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xfc'),_0x25e06e[_0x547c('0xf3')]));}return this[_0x547c('0x10')]['error'](_0x309343,_0x547c('0xfd'));};AGIVertices[_0x547c('0x13')][_0x547c('0xfe')]=function(_0x770ced){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x770ced['label']));if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0xff')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x100')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x101'));}if(!this[_0x547c('0x8b')](_0x770ced['password'])){return this[_0x547c('0x10')]['noop'](_0x547c('0x102'));}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x103')])){return this['channel']['noop'](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this[_0x547c('0x39')](_0x770ced);this['createSquareMessage'](_0x770ced[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SestekNDA:\x20%s',_0x770ced[_0x547c('0x62')]));var _0x4da4e0=this['sestekNDA'][_0x547c('0xac')](this,_0x770ced);if(_0x4da4e0){for(var _0x2cee60 in _0x4da4e0){if(_0x4da4e0['hasOwnProperty'](_0x2cee60)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x104'),_0x2cee60['toUpperCase']()),_0x4da4e0[_0x2cee60]);}}this[_0x547c('0x45')](_0x4da4e0['speech'],_0x547c('0xf1'),_0x547c('0xfe'),'');if(_0x4da4e0[_0x547c('0x105')]){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4da4e0['audiofile']));var _0x5bbcbf=this[_0x547c('0x10')][_0x547c('0x106')](_0x4da4e0['audiofile']);try{fs['unlink'](_0x4da4e0[_0x547c('0x105')]+'.wav');}catch(_0x4c7112){logger[_0x547c('0x31')](_0x4c7112);}return _0x5bbcbf;}else{return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('SestekNDA\x20Result\x20%s',_0x4da4e0[_0x547c('0xf3')]));}}return this[_0x547c('0x10')][_0x547c('0x31')](_0x770ced,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x547c('0x107')]=function(_0x25b70d){logger['info'](util[_0x547c('0x2d')](_0x547c('0x108'),_0x25b70d['label']));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x107'));};AGIVertices[_0x547c('0x13')][_0x547c('0x109')]=function(_0x2bceab){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2bceab[_0x547c('0x3b')]));var _0x161191='';if(_0x2bceab['trunk_id']){if(!this[_0x547c('0x8b')](_0x2bceab[_0x547c('0x10a')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}else{var _0x1e0c5b=parseInt(_0x2bceab[_0x547c('0x10a')],0xa);if(isNaN(_0x1e0c5b)){_0x161191=_0x2bceab[_0x547c('0x10a')];}else{_0x161191=this[_0x547c('0x20')][_0x547c('0xac')](this,_0x2bceab[_0x547c('0x10a')]);if(!_0x161191){return this[_0x547c('0x10')]['error'](_0x2bceab,_0x547c('0x10c'));}}}}else if(_0x2bceab['trunk_name']){_0x161191=_0x2bceab['trunk_name'];}else{return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}var _0x545620=this[_0x547c('0x10')]['exec'](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0x10d'),_0x161191,_0x2bceab[_0x547c('0x4c')]),_0x2bceab[_0x547c('0x6a')],_0x2bceab[_0x547c('0xeb')],_0x2bceab['url']]);if(_0x545620[_0x547c('0xb2')]===-0x1){return _0x545620;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x10e'),_0x547c('0xe9')));};AGIVertices[_0x547c('0x13')][_0x547c('0x10f')]=function(_0x7ba892){logger[_0x547c('0x34')](util['format'](_0x547c('0x110'),_0x7ba892['label']));return this['channel'][_0x547c('0xb0')](_0x547c('0x10f'));};AGIVertices[_0x547c('0x13')][_0x547c('0xe')]=function(_0x40061a){logger[_0x547c('0x34')](util['format'](_0x547c('0x111'),_0x40061a[_0x547c('0x3b')]));if(_0x40061a[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x40061a);}_0x40061a[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x40061a['file_id'])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,_0x547c('0x112'));}var _0x410192=this[_0x547c('0x22')]['sync'](this,_0x40061a[_0x547c('0x113')]);if(!_0x410192){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20file\x20audio\x20found');}if(!this[_0x547c('0x8b')](_0x40061a[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1748ef=this[_0x547c('0x10')][_0x547c('0x114')](_0x410192,_0x40061a['response'],_0x40061a[_0x547c('0x115')]);var _0x1201b7=_0x1748ef[_0x547c('0xb2')]?_0x1748ef['result']['toString']():'';logger['info']('test',JSON[_0x547c('0x78')](_0x1748ef));if(_0x1748ef['result']===-0x1){this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,_0x1201b7);return _0x1748ef;}else if(_0x1748ef['extra']==='timeout'){_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])?'x':'i';}else{_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])&&_0x1201b7[_0x547c('0xa0')]<=parseInt(_0x40061a[_0x547c('0x115')])?'x':'i';}var _0x214304=this['getVariable']['sync'](this,_0x40061a['variable_id']);if(!_0x214304){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20variable\x20found');}this[_0x547c('0x10')][_0x547c('0xaa')](_0x214304,_0x1201b7);if(this[_0x547c('0x8b')](_0x40061a[_0x547c('0x117')])){var _0x1ddfff=parseInt(_0x40061a['hiddendigitsnum'],0xa);var _0x2f70e0=rs['generate']({'charset':'*','length':_0x1ddfff});var _0x5d8d4d=_0x1201b7[_0x547c('0xa0')];if(_0x5d8d4d>0x0){if(_0x5d8d4d>_0x1ddfff){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,_0x40061a[_0x547c('0x118')]===_0x547c('0x119')?_0x2f70e0+_0x1201b7[_0x547c('0x11a')](_0x1ddfff):_0x1201b7[_0x547c('0x11a')](0x0,_0x5d8d4d-_0x1ddfff)+_0x2f70e0);}else{this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,rs[_0x547c('0x11b')]({'charset':'*','length':_0x5d8d4d}));}}else{this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,'');}}else{this[_0x547c('0x39')]['sync'](this,_0x40061a,_0x1201b7);}return _0x1748ef;};AGIVertices[_0x547c('0x13')]['getsecretdigits']=function(_0x28f27b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x11c'),_0x28f27b[_0x547c('0x3b')]));return this[_0x547c('0xe')](_0x28f27b);};AGIVertices[_0x547c('0x13')][_0x547c('0x11d')]=function(_0x5f4eac){logger['info'](util['format'](_0x547c('0x11e'),_0x5f4eac[_0x547c('0x3b')]));this[_0x547c('0x39')]['sync'](this,_0x5f4eac,_0x5f4eac[_0x547c('0x11f')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x120'),_0x5f4eac[_0x547c('0x11f')]));};AGIVertices[_0x547c('0x13')]['awspolly']=function(_0x1ddf54){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x121'),_0x1ddf54['label']));if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8e')])||!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x1ddf54[_0x547c('0x62')]));var _0x2c4f37=this['awsPolly'][_0x547c('0xac')](this,_0x1ddf54);if(_0x2c4f37){this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x123'),_0x2c4f37));var _0x2d8ffd=this['channel'][_0x547c('0x106')](_0x2c4f37);try{fs[_0x547c('0x124')](_0x2c4f37+_0x547c('0x125'));}catch(_0x348577){logger[_0x547c('0x31')](_0x348577);}return _0x2d8ffd;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x1ddf54,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x126')]=function(_0x303f60){logger[_0x547c('0x34')](util['format'](_0x547c('0x127'),_0x303f60[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x303f60[_0x547c('0x8e')])||!this['isConfigured'](_0x303f60[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this['isConfigured'](_0x303f60['aws_bot_name'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x128'));}if(!this[_0x547c('0x8b')](_0x303f60['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x303f60);this[_0x547c('0x45')](_0x303f60[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x129'),_0x303f60[_0x547c('0x62')]));var _0x1e8dec=this[_0x547c('0x92')]['sync'](this,_0x303f60);if(_0x1e8dec){for(var _0x39275c in _0x1e8dec){if(_0x1e8dec[_0x547c('0x9c')](_0x39275c)&&_['isString'](_0x1e8dec[_0x39275c])){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('AWS_LEX_%s',_0x39275c[_0x547c('0x70')]()),_0x1e8dec[_0x39275c]);}}if(_['isNil'](_0x1e8dec[_0x547c('0x7c')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x547c('0x45')](_0x1e8dec[_0x547c('0x7c')],_0x547c('0xf1'),_0x547c('0x12a'),'');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x12b'),_0x1e8dec[_0x547c('0x7c')]));}}return this['channel']['error'](_0x303f60,_0x547c('0x12c'));};AGIVertices[_0x547c('0x13')][_0x547c('0x12d')]=function(_0x5ac314){logger['info'](util[_0x547c('0x2d')](_0x547c('0x12e'),_0x5ac314['label'],_0x5ac314[_0x547c('0x6a')]));if(!this[_0x547c('0x8b')](_0x5ac314[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}var _0x5699a0='wav';var _0x45fbb2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs[_0x547c('0x11b')](0x4));var _0x4f4482=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x45fbb2,_0x5699a0);var _0x23c84c=!![];if(_0x5ac314['beep']==='NOBEEP'){_0x23c84c=![];}var _0x54948d=this['channel'][_0x547c('0x130')](_0x45fbb2,_0x5699a0,_0x5ac314[_0x547c('0x131')],_0x5ac314[_0x547c('0x6a')],undefined,_0x23c84c);if(_0x54948d[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('google\x20%s\x20file\x20created',_0x4f4482));var _0x1510a1=this[_0x547c('0x95')][_0x547c('0xac')](this,_0x5ac314,_0x4f4482);if(_0x1510a1){for(var _0x4824d1 in _0x1510a1){if(_0x1510a1[_0x547c('0x9c')](_0x4824d1)){this[_0x547c('0x10')]['setVariable'](util[_0x547c('0x2d')](_0x547c('0x132'),_0x4824d1[_0x547c('0x70')]()),_0x1510a1[_0x4824d1]);}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x133'),JSON['stringify'](_0x1510a1)));}}return _0x54948d;};AGIVertices[_0x547c('0x13')]['tildeasr']=function(_0xad307c){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x134'),_0xad307c[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x98')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x135'));}if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x136')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x137'));}var _0x9ddf2=_0x547c('0x138');var _0x1b4961=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x1a386f=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x1b4961,_0x9ddf2);var _0x3e4503=!![];if(_0xad307c['beep']===_0x547c('0x139')){_0x3e4503=![];}var _0x4cd14a=this[_0x547c('0x10')][_0x547c('0x130')](_0x1b4961,_0x9ddf2,_0xad307c['intKey'],_0xad307c[_0x547c('0x6a')],undefined,_0x3e4503);if(_0x4cd14a[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x13a'),_0x1a386f));var _0x44309c=this[_0x547c('0x97')]['sync'](this,_0xad307c,_0x1a386f);if(_0x44309c){for(var _0x15e613 in _0x44309c){if(_0x44309c[_0x547c('0x9c')](_0x15e613)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x13b'),_0x15e613[_0x547c('0x70')]()),_0x44309c[_0x15e613]);}}return this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x13c'),JSON[_0x547c('0x78')](_0x44309c)));}}return _0x4cd14a;};AGIVertices[_0x547c('0x13')]['gotoc']=function(_0xf3bc02){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x13d'),_0xf3bc02['label']));return this['channel'][_0x547c('0x13e')](_0xf3bc02[_0x547c('0x13f')],_0xf3bc02[_0x547c('0x41')],_0xf3bc02[_0x547c('0x42')]);};AGIVertices['prototype'][_0x547c('0x140')]=function(_0x4cc4bb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x141'),_0x4cc4bb['label']));if(!this[_0x547c('0x8b')](_0x4cc4bb[_0x547c('0x142')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4cc4bb,_0x547c('0x143'));}try{var _0x3522ba=eval(_0x4cc4bb['condition'])?'true':_0x547c('0x144');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x145'),_0x4cc4bb['condition'],_0x3522ba));return{'code':0xc8,'result':_0x3522ba};}catch(_0x2b3ba6){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x1226e5){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1226e5['label']));if(!this[_0x547c('0x8b')](_0x1226e5[_0x547c('0x146')])){return this['channel']['error'](_0x1226e5,_0x547c('0x147'));}var _0xbb471d=this['getIntervals']['sync'](this,_0x1226e5['interval_id']);if(!_0xbb471d){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1226e5,_0x547c('0x148'));}for(var _0x52e3c3=0x0;_0x52e3c3<_0xbb471d[_0x547c('0xa0')];_0x52e3c3+=0x1){var _0x7fdeb=this['channel'][_0x547c('0x14')](util[_0x547c('0x2d')](_0x547c('0x149'),_0xbb471d[_0x52e3c3]));if(_0x7fdeb[_0x547c('0xb2')]===-0x1){return _0x7fdeb;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x7fdeb['extra']));if(_0x7fdeb[_0x547c('0xa7')]===_0x547c('0x14b')){logger[_0x547c('0x34')](util['format']('IFTIME\x20%s\x20%s',_0xbb471d[_0x52e3c3],_0x547c('0x14b')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x14b')));return{'code':0xc8,'result':_0x547c('0x14b')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x144')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],'false'));}}return{'code':0xc8,'result':_0x547c('0x144')};};AGIVertices[_0x547c('0x13')][_0x547c('0x14c')]=function(_0x15458f){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14d'),_0x15458f[_0x547c('0x3b')]));return this['channel']['hangup']();};AGIVertices[_0x547c('0x13')][_0x547c('0x14e')]=function(_0x3c0b69){logger['info'](util[_0x547c('0x2d')](_0x547c('0x14f'),_0x3c0b69[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3c0b69[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xee'));}var _0x4430dd=_0x547c('0x138');var _0x2467e2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x5386c4=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x2467e2,_0x4430dd);var _0x3c29b9=!![];if(_0x3c0b69[_0x547c('0x150')]==='NOBEEP'){_0x3c29b9=![];}var _0x28dd3e=this[_0x547c('0x10')][_0x547c('0x130')](_0x2467e2,_0x4430dd,_0x3c0b69['intKey'],_0x3c0b69[_0x547c('0x6a')],undefined,_0x3c29b9);if(_0x28dd3e['result']!==-0x1){this['channel']['noop'](util[_0x547c('0x2d')]('ispeech\x20%s\x20file\x20created',_0x5386c4));var _0xeacc0a=this['ispeechASR']['sync'](this,_0x3c0b69,_0x5386c4);if(_0xeacc0a){for(var _0x39fdc2 in _0xeacc0a){if(_0xeacc0a[_0x547c('0x9c')](_0x39fdc2)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x151'),_0x39fdc2[_0x547c('0x70')]()),_0xeacc0a[_0x39fdc2]);}}return this['channel'][_0x547c('0xb0')](util['format'](_0x547c('0x152'),JSON[_0x547c('0x78')](_0xeacc0a)));}}return _0x28dd3e;};AGIVertices[_0x547c('0x13')][_0x547c('0x153')]=function(_0x433d30){logger[_0x547c('0x34')](util['format'](_0x547c('0x154'),_0x433d30[_0x547c('0x3b')]));if(!this['isConfigured'](_0x433d30[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x433d30[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x155'),_0x433d30['text']));var _0x1ab6e0=this[_0x547c('0x87')][_0x547c('0xac')](this,_0x433d30);if(_0x1ab6e0){this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x156'),_0x1ab6e0));var _0x2a7ae0=this[_0x547c('0x10')][_0x547c('0x106')](_0x1ab6e0,_0x433d30[_0x547c('0x131')]);try{fs[_0x547c('0x124')](_0x1ab6e0+'.wav');}catch(_0x31f68b){logger['error'](_0x31f68b);}return _0x2a7ae0;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x433d30,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')]['login']=function(_0x39e457){logger['info'](util[_0x547c('0x2d')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x39e457[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x39e457['findBy'])){return this[_0x547c('0x10')]['error'](_0x39e457,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x547c('0x157'),this['channel']['callerid'],_0x39e457['findBy']));var _0x36618f=this[_0x547c('0x5a')][_0x547c('0xac')](this,_0x39e457[_0x547c('0x158')]);if(_0x36618f){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')]['callerid'],_0x39e457['findBy']));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices[_0x547c('0x13')][_0x547c('0x15d')]=function(_0x336e89){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15e'),_0x336e89[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x336e89[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x336e89,_0x547c('0x15f'));}logger[_0x547c('0x34')](util[_0x547c('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));var _0x28f8f2=this[_0x547c('0x160')][_0x547c('0xac')](this,_0x336e89[_0x547c('0x158')]);if(_0x28f8f2){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices['prototype'][_0x547c('0x161')]=function(_0x2d7ed4){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x162'),_0x2d7ed4['label']));if(!this['isConfigured'](_0x2d7ed4[_0x547c('0x163')])){return this[_0x547c('0x10')]['error'](_0x2d7ed4,_0x547c('0x164'));}this['channel']['noop'](util[_0x547c('0x2d')](_0x547c('0x165'),_0x2d7ed4[_0x547c('0x163')]));var _0x556b00=eval(_0x2d7ed4[_0x547c('0x163')]);if(!this[_0x547c('0x8b')](_0x2d7ed4[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}var _0x151cba=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x2d7ed4[_0x547c('0xe1')]);if(!_0x151cba){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2d7ed4,'no\x20variable\x20found');}if(_['isArray'](_0x556b00)){var _0x263366=this;_0x556b00[_0x547c('0x166')](function(_0x23add7,_0x54eb69){_0x263366[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x167'),_0x151cba,_0x54eb69),_0x23add7);});return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x168'),_0x151cba));}else{return this[_0x547c('0x10')][_0x547c('0xaa')](_0x151cba,_0x556b00);}};AGIVertices[_0x547c('0x13')]['menu']=function(_0x416264){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x416264[_0x547c('0x3b')]));if(_0x416264[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x416264);}_0x416264[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x416264['file_id'])){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x112'));}var _0x22f5cc=this['getSound'][_0x547c('0xac')](this,_0x416264[_0x547c('0x113')]);if(!_0x22f5cc){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x169'));}var _0x5d6c6c=this[_0x547c('0x10')][_0x547c('0x114')](_0x22f5cc,_0x416264['response'],_0x416264[_0x547c('0x16a')]);var _0x14828a=_0x5d6c6c[_0x547c('0xb2')];if(_0x5d6c6c[_0x547c('0xb2')]===-0x1){this[_0x547c('0x39')]['sync'](this,_0x416264,'-1');return _0x5d6c6c;}else if(_0x5d6c6c[_0x547c('0xa7')]===_0x547c('0x6a')){_0x5d6c6c[_0x547c('0xb2')]=_0x5d6c6c[_0x547c('0xb2')][_0x547c('0xa0')]>0x0?_0x5d6c6c['result']:'t';}else if(_[_0x547c('0x47')](_0x5d6c6c[_0x547c('0xb2')])){_0x5d6c6c[_0x547c('0xb2')]='#';_0x14828a='#';}if(!this['isConfigured'](_0x416264[_0x547c('0xe1')])){this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}else{var _0x467e81=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x416264[_0x547c('0xe1')]);if(!_0x467e81){return this[_0x547c('0x10')][_0x547c('0x31')](_0x416264,_0x547c('0x16b'));}this[_0x547c('0x10')]['setVariable'](_0x467e81,_0x14828a);}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x416264,_0x14828a);return _0x5d6c6c;};AGIVertices['prototype'][_0x547c('0xb0')]=function(_0x5a15e6){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5a15e6[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x5a15e6[_0x547c('0x16c')]||_0x5a15e6[_0x547c('0x3b')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x16d')]=function(_0x48ab51){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x16e'),_0x48ab51[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x48ab51[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x48ab51,'no\x20find\x20by\x20configured');}logger[_0x547c('0x34')](util['format'](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51['findBy']));var _0x30890f=this[_0x547c('0x53')][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x16f')]);var _0x1609d9=this['agentPause'][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x158')],_0x30890f);if(_0x1609d9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger['info'](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['playback']=function(_0x59377a){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x170'),_0x59377a[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x59377a[_0x547c('0x113')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x59377a,_0x547c('0x112'));}var _0x3a6283=this[_0x547c('0x22')][_0x547c('0xac')](this,_0x59377a[_0x547c('0x113')]);if(!_0x3a6283){return this['channel']['error'](_0x59377a,_0x547c('0x169'));}var _0x312c76=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x171'),[_0x3a6283,_0x59377a['opts']]);if(_0x312c76['result']===-0x1){return _0x312c76;}return this['channel'][_0x547c('0xb0')](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x171'),_0x3a6283));};AGIVertices[_0x547c('0x13')]['queue']=function(_0x38655f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x172'),_0x38655f['label']));if(!this['isConfigured'](_0x38655f[_0x547c('0x173')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x38655f,_0x547c('0x174'));}var _0x26cedc='';var _0xe042ea=parseInt(_0x38655f[_0x547c('0x173')],0xa);if(isNaN(_0xe042ea)){_0x26cedc=_0x38655f[_0x547c('0x173')];}else{_0x26cedc=this[_0x547c('0x17')][_0x547c('0xac')](this,_0x38655f[_0x547c('0x173')]);if(!_0x26cedc){return this[_0x547c('0x10')]['error'](_0x38655f,'no\x20queue\x20found');}}var _0x5abe57='';if(this[_0x547c('0x8b')](_0x38655f[_0x547c('0x113')])){var _0x3f029d=this['getSound']['sync'](this,_0x38655f[_0x547c('0x113')]);if(_0x3f029d){_0x5abe57=_0x3f029d;}}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x38655f,_0x26cedc);if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('x')<0x0){_0x38655f['opts']+='x';}if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('X')<0x0){_0x38655f[_0x547c('0xeb')]+='X';}this[_0x547c('0x10')]['setVariable'](_0x547c('0x176'),_0x26cedc?_0x26cedc[_0x547c('0x177')]():'');var _0x327db8=this[_0x547c('0x10')][_0x547c('0x5c')]('QUEUE',[_0x26cedc,_0x38655f[_0x547c('0xeb')],_0x38655f['url'],_0x5abe57,_0x38655f[_0x547c('0x6a')],_0x38655f[_0x547c('0x8')],_0x38655f[_0x547c('0x178')],_0x38655f[_0x547c('0x179')],'',_0x38655f[_0x547c('0x17a')]]);if(_0x327db8[_0x547c('0xb2')]===-0x1){return _0x327db8;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x17b'),_0x26cedc));};AGIVertices[_0x547c('0x13')][_0x547c('0x17c')]=function(_0x806a2e){logger[_0x547c('0x34')](util['format'](_0x547c('0x17d'),_0x806a2e[_0x547c('0x3b')]));var _0x4b6a72=_0x806a2e[_0x547c('0x17e')]||'wav';var _0x372c70=util[_0x547c('0x2d')]('%s_%s',this['channel']['uniqueid'],rs[_0x547c('0x11b')](0x5));var _0x2a73e1=util[_0x547c('0x2d')](_0x547c('0x17f'),FILES_PATH,_0x372c70,_0x4b6a72);var _0x92c34c=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,_0x372c70);this[_0x547c('0x3f')][_0x547c('0xac')](this,_0x806a2e,_0x372c70,_0x2a73e1);this[_0x547c('0x10')][_0x547c('0xaa')](_0x547c('0x180'),_0x372c70);logger[_0x547c('0x34')](_0x547c('0x181'),_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')]);return this['channel']['recordFile'](_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')],undefined,!![]);};AGIVertices[_0x547c('0x13')][_0x547c('0x183')]=function(_0x1129db){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x184'),_0x1129db[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x1129db['url'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x185'));}var _0x55fbd0=this['restAPI'][_0x547c('0xac')](this,_0x1129db);logger[_0x547c('0x34')](util['format'](_0x547c('0x186'),util['inspect'](_0x55fbd0,{'showHidden':![],'depth':null})));if(!this[_0x547c('0x8b')](_0x1129db[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x187'));}var _0x4f0d29=this[_0x547c('0x14')]['sync'](this,_0x1129db[_0x547c('0xe1')]);if(!_0x4f0d29){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1129db,_0x547c('0x16b'));}this['channel'][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_CODE',_0x4f0d29),_0x55fbd0[_0x547c('0x7a')]?_0x55fbd0[_0x547c('0x7a')]:_0x547c('0x188'));this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_MESSAGE',_0x4f0d29),_0x55fbd0[_0x547c('0x7b')]?_0x55fbd0[_0x547c('0x7b')]:'OK');if(_0x55fbd0[_0x547c('0x71')]){try{this[_0x547c('0xa3')](_0x55fbd0[_0x547c('0x71')],_0x4f0d29);}catch(_0x3757a9){logger['error'](util['format'](_0x547c('0x189'),_0x4f0d29));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xe3'),_0x4f0d29));};AGIVertices[_0x547c('0x13')][_0x547c('0x18a')]=function(_0xaadcb7){logger['info'](util['format'](_0x547c('0x18b'),_0xaadcb7['label']));return this[_0x547c('0x10')]['sayDigits'](_0xaadcb7[_0x547c('0x18c')]['replace'](/\s+/g,''),_0xaadcb7[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')]['saynumber']=function(_0x1ce40e){logger['info'](util[_0x547c('0x2d')](_0x547c('0x18d'),_0x1ce40e[_0x547c('0x3b')]));return this['channel'][_0x547c('0x18e')](_0x1ce40e['number'][_0x547c('0x5e')](/\s+/g,''),_0x1ce40e[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x18f')]=function(_0x5e7c6b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x190'),_0x5e7c6b[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x191')](_0x5e7c6b[_0x547c('0x62')],_0x5e7c6b[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x192')]=function(_0x4aa68e){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x193'),_0x4aa68e[_0x547c('0x3b')]));if(!this['isConfigured'](_0x4aa68e[_0x547c('0x194')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x195'));}var _0x509e98=this[_0x547c('0x25')][_0x547c('0xac')](this,_0x4aa68e[_0x547c('0x194')]);if(!_0x509e98||!_0x509e98[_0x547c('0x196')]){return this[_0x547c('0x10')]['error'](_0x4aa68e,_0x547c('0x197'));}var _0x5eedb4={'from':util[_0x547c('0x2d')](_0x547c('0x198'),_0x509e98[_0x547c('0x19')],_0x509e98[_0x547c('0x199')]||_0x509e98['Smtp'][_0x547c('0x19a')]),'to':_0x4aa68e['to']||'','cc':_0x4aa68e['cc']||'','bcc':_0x4aa68e[_0x547c('0x19b')]||'','subject':_0x4aa68e[_0x547c('0x19c')],'html':_0x4aa68e[_0x547c('0x62')],'text':_0x4aa68e[_0x547c('0x62')]};var _0x166864={'tls':{'rejectUnauthorized':![]}};if(_0x509e98[_0x547c('0x196')][_0x547c('0x19d')]){_0x166864[_0x547c('0x19d')]=_0x509e98[_0x547c('0x196')][_0x547c('0x19d')];}else{_0x166864[_0x547c('0x19e')]=_0x509e98[_0x547c('0x196')]['host'];_0x166864['port']=_0x509e98[_0x547c('0x196')][_0x547c('0x19f')];_0x166864[_0x547c('0x1a0')]=_0x509e98['Smtp'][_0x547c('0x1a0')];}if(_0x509e98[_0x547c('0x196')][_0x547c('0x1a1')]){_0x166864[_0x547c('0x1a2')]={'user':_0x509e98[_0x547c('0x196')][_0x547c('0x19a')],'pass':_0x509e98[_0x547c('0x196')]['pass']};}if(this[_0x547c('0x8b')](_0x4aa68e[_0x547c('0x1a3')])){}logger['debug']('sendMail\x20message',JSON[_0x547c('0x78')](_0x5eedb4));this['createSquareDetailsReport']['sync'](this,_0x4aa68e,_0x4aa68e[_0x547c('0x194')]);this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x509e98['name']));this[_0x547c('0x27')][_0x547c('0xac')](this,_0x166864,_0x5eedb4);return this[_0x547c('0x10')]['noop'](_0x547c('0x1a4'));};AGIVertices[_0x547c('0x13')]['sendFax']=function(_0x3b3d31){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1a5'),_0x3b3d31[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a6'));};AGIVertices[_0x547c('0x13')]['sendSMS']=function(_0x26a68f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1a7'),_0x26a68f[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x26a68f['sms_account_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a8'));}var _0x20f33b=this[_0x547c('0x37')][_0x547c('0xac')](this,_0x26a68f[_0x547c('0x1a9')]);if(!_0x20f33b){return this['channel'][_0x547c('0x31')](_0x26a68f,_0x547c('0x1aa'));}var _0x125278={'body':_0x26a68f[_0x547c('0x1ab')],'phone':_0x26a68f['to']||'','SmsAccountId':_0x20f33b['id']};logger[_0x547c('0xe5')](_0x547c('0x1ac'),JSON['stringify'](_0x125278));this[_0x547c('0x39')][_0x547c('0xac')](this,_0x26a68f,_0x26a68f[_0x547c('0x1a9')]);this['channel']['noop'](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x20f33b[_0x547c('0x19')]));this[_0x547c('0x1ad')][_0x547c('0xac')](this,_0x125278);return this['channel'][_0x547c('0xb0')](_0x547c('0x1ae'));};AGIVertices['prototype'][_0x547c('0x1af')]=function(_0x4498f3){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x4498f3['label']));if(!this['isConfigured'](_0x4498f3[_0x547c('0xe1')])){return this['channel'][_0x547c('0x31')](_0x4498f3,_0x547c('0x1b0'));}var _0x27b6e7=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x4498f3[_0x547c('0xe1')]);if(!_0x27b6e7){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4498f3,_0x547c('0x16b'));}return this['channel'][_0x547c('0xaa')](_0x27b6e7,_0x4498f3[_0x547c('0x1b1')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x1b2')]=function(_0x15b69c){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x15b69c['label']));this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1b3'));if(_0x15b69c['answer']===_0x547c('0x1b4')){this['channel'][_0x547c('0xb0')](_0x547c('0x1b5'));return this[_0x547c('0x10')]['answer']();}return this[_0x547c('0x10')][_0x547c('0xb0')]('Skipped\x20Answer');};AGIVertices[_0x547c('0x13')][_0x547c('0x1b6')]=function(_0x169091){logger['info'](util['format'](_0x547c('0x1b7'),_0x169091[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x169091[_0x547c('0x1b8')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x169091,_0x547c('0x1b9'));}var _0x530d50=this[_0x547c('0x1a')][_0x547c('0xac')](this,_0x169091[_0x547c('0x1b8')]);if(!this[_0x547c('0x8b')](_0x530d50)){return this['channel'][_0x547c('0x31')](_0x169091,util['format'](_0x547c('0x1ba'),_0x169091[_0x547c('0x1b8')]));}if(_0x530d50===this[_0x547c('0x10')]['arg_1']){return this[_0x547c('0x10')]['error'](_0x169091,_0x547c('0x1bb'));}this[_0x547c('0x39')]['sync'](this,_0x169091,_0x530d50);var _0x4eca26=this['channel'][_0x547c('0x5c')](_0x547c('0x1bc'),util[_0x547c('0x2d')](_0x547c('0x1bd'),config[_0x547c('0x8')][_0x547c('0x19e')]||_0x547c('0x1be'),_0x530d50,this[_0x547c('0x10')][_0x547c('0x3d')]));if(_0x4eca26[_0x547c('0xb2')]===-0x1){return _0x4eca26;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x547c('0x1bc'),_0x530d50));};AGIVertices[_0x547c('0x13')][_0x547c('0x1bf')]=function(_0x57326b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c0'),_0x57326b[_0x547c('0x3b')]));var _0x44c078=this[_0x547c('0x5b')][_0x547c('0xac')](this,_0x57326b['command']);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x57326b,_0x57326b[_0x547c('0xbf')]);if(this[_0x547c('0x8b')](_0x57326b[_0x547c('0xe1')])){var _0x855cb3=this['getVariable'][_0x547c('0xac')](this,_0x57326b[_0x547c('0xe1')]);if(_0x855cb3){this[_0x547c('0x10')][_0x547c('0xaa')](_0x855cb3,_0x44c078);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c1'),_0x57326b[_0x547c('0xbf')],_0x855cb3));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x57326b['command']));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c2')]=function(_0x4a38af){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c3'),_0x4a38af[_0x547c('0x3b')]));_0x4a38af[_0x547c('0x62')]=_0x4a38af[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4a38af[_0x547c('0x60')])){return this[_0x547c('0x10')]['noop'](_0x547c('0x1c4'));}if(!this[_0x547c('0x8b')](_0x4a38af['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c5'),_0x4a38af['text']));var _0xea5d21=this['googleCloudTTS']['sync'](this,_0x4a38af);if(_0xea5d21){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c6'),_0xea5d21));var _0x105da8=this['channel'][_0x547c('0x106')](_0xea5d21);try{fs[_0x547c('0x124')](_0xea5d21+_0x547c('0x125'));}catch(_0x4b4130){logger['error'](_0x4b4130);}return _0x105da8;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x4a38af,_0x547c('0x1c7'));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c8')]=function(_0x7bfc89){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1c9'),_0x7bfc89['label']));_0x7bfc89[_0x547c('0x62')]=_0x7bfc89[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x7bfc89[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1ca'),_0x7bfc89['text']));var _0x2a3508=this[_0x547c('0x67')][_0x547c('0xac')](this,_0x7bfc89);if(_0x2a3508){this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x1cb'),_0x2a3508));var _0x3e79e1=this[_0x547c('0x10')][_0x547c('0x106')](_0x2a3508);try{fs[_0x547c('0x124')](_0x2a3508+'.wav');}catch(_0x40fa4b){logger[_0x547c('0x31')](_0x40fa4b);}return _0x3e79e1;}return this['channel'][_0x547c('0x31')](_0x7bfc89,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x1cc')]=function(_0x56932e){logger['info'](util['format'](_0x547c('0x1cd'),_0x56932e[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x56932e[_0x547c('0x158')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x56932e,_0x547c('0x15f'));}logger['info'](util[_0x547c('0x2d')](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));var _0x46e7a9=this['agentUnpause'][_0x547c('0xac')](this,_0x56932e['findBy']);if(_0x46e7a9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')]['callerid'],_0x56932e[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this['channel'][_0x547c('0x3e')],_0x56932e[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['voicemail']=function(_0x5ce54a){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1ce'),_0x5ce54a[_0x547c('0x3b')]));var _0x44f83e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x1cf'),[_0x5ce54a['mailbox'],_0x5ce54a[_0x547c('0x7e')]]);if(_0x44f83e[_0x547c('0xb2')]===-0x1){return _0x44f83e;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1d0'),_0x547c('0x1cf'),_0x5ce54a[_0x547c('0x1d1')]));};AGIVertices[_0x547c('0x13')][_0x547c('0x1d2')]=function(_0x11cf1b){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1d3'),_0x11cf1b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x11cf1b[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x1b0'));}var _0x5d47ae=this[_0x547c('0x14')]['sync'](this,_0x11cf1b[_0x547c('0xe1')]);if(!_0x5d47ae){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x16b'));}var _0x391845=this[_0x547c('0x10')][_0x547c('0x14')](_0x5d47ae);return{'code':0xc8,'result':_0x391845['extra']?_0x391845[_0x547c('0xa7')]:'-'};};String['prototype'][_0x547c('0xa6')]=function(_0xc48591,_0x156307){return this[_0x547c('0xa5')](_0xc48591)[_0x547c('0x1d4')](_0x156307);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index ad6d2ed..547f181 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 _0xf91b=['mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','acw','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition'];(function(_0xa12685,_0x21ab8f){var _0x482f65=function(_0x2f7d70){while(--_0x2f7d70){_0xa12685['push'](_0xa12685['shift']());}};_0x482f65(++_0x21ab8f);}(_0xf91b,0x1ca));var _0xbf91=function(_0x8a4a33,_0x2620c3){_0x8a4a33=_0x8a4a33-0x0;var _0x2b8308=_0xf91b[_0x8a4a33];return _0x2b8308;};'use strict';var util=require(_0xbf91('0x0'));var _=require(_0xbf91('0x1'));var moment=require(_0xbf91('0x2'));var ami=require('../ami');var logger=require(_0xbf91('0x3'))(_0xbf91('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4d07f5){this[_0xbf91('0x5')]=_0x4d07f5['voiceQueues'];this[_0xbf91('0x6')]=_0x4d07f5[_0xbf91('0x6')];this['timers']=_0x4d07f5['timers'];this[_0xbf91('0x7')]={};ami['on'](_0xbf91('0x8'),this[_0xbf91('0x9')][_0xbf91('0xa')](this));ami['on'](_0xbf91('0xb'),this[_0xbf91('0xc')][_0xbf91('0xa')](this));ami['on']('hangup',this[_0xbf91('0xd')][_0xbf91('0xa')](this));ami['on'](_0xbf91('0xe'),this['syncAgentRingNoAnswer'][_0xbf91('0xa')](this));ami['on']('attendedtransfer',this[_0xbf91('0xf')][_0xbf91('0xa')](this));ami['on'](_0xbf91('0x10'),this[_0xbf91('0x11')]['bind'](this));ami['on'](_0xbf91('0x12'),this[_0xbf91('0x13')][_0xbf91('0xa')](this));}function getDiff(_0x1d1e17){var _0x143ddc=moment()[_0xbf91('0x14')](0x0);var _0x5cd72f=moment(_0x1d1e17)['milliseconds'](0x0);return _0x143ddc['diff'](_0x5cd72f,_0xbf91('0x15'));}Acw[_0xbf91('0x16')][_0xbf91('0x17')]=function(_0x676ded){try{var _0x358667=this;var _0xf654f1=this[_0xbf91('0x7')][_0x676ded][_0xbf91('0x18')];var _0x52db4f=this[_0xbf91('0x7')][_0x676ded][_0xbf91('0x19')];var _0x4e8b24=this[_0xbf91('0x5')][_0x52db4f];var _0x29e45b=![];var _0x31588d=_0xbf91('0x1a');if(_0x4e8b24[_0xbf91('0x1b')]){if(_0x4e8b24[_0xbf91('0x1c')][_0xbf91('0x1d')]){_0x29e45b=!![];_0x31588d=_0x4e8b24[_0xbf91('0x1c')][_0xbf91('0x1d')];}}ami[_0xbf91('0x1e')]({'action':_0xbf91('0x1f'),'interface':_0xf654f1,'paused':!![],'reason':_0x31588d})[_0xbf91('0x20')](function(_0x34dead){if(_0x358667[_0xbf91('0x6')][_0xf654f1]){return RpcUser[_0xbf91('0x21')](_0x358667[_0xbf91('0x6')][_0xf654f1]['id'])[_0xbf91('0x20')](function(_0xaab6ca){if(_0xaab6ca&&!_0xaab6ca['voicePause']){logger[_0xbf91('0x22')](_0xbf91('0x23'),_0x676ded,_0xf654f1,_0x52db4f);var _0x5ab12d=_0x358667[_0xbf91('0x7')][_0x676ded][_0xbf91('0x24')]&&_0x358667[_0xbf91('0x7')][_0x676ded][_0xbf91('0x25')]?_0x358667['channels'][_0x676ded][_0xbf91('0x25')]:_0x676ded;return RpcUser[_0xbf91('0x26')](_0x358667[_0xbf91('0x6')][_0xf654f1],_0x31588d,_0x5ab12d)['then'](function(_0x3e5298){if(!_0x29e45b){_0x358667[_0xbf91('0x27')][_0xf654f1]={};logger['info'](_0xbf91('0x28'),_0x676ded,_0x358667[_0xbf91('0x5')][_0x52db4f][_0xbf91('0x29')],_0xf654f1,_0x52db4f);_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x2a')]=setTimeout(_0x358667[_0xbf91('0x2b')][_0xbf91('0xa')](_0x358667,_0xf654f1),_0x358667['voiceQueues'][_0x52db4f][_0xbf91('0x29')]*0x3e8);_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x2c')]=moment()[_0xbf91('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x2e')]=_0x676ded;_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x19')]=_0x52db4f;_0x358667[_0xbf91('0x27')][_0xf654f1]['updateAcw']=function(){var _0x4b6455=getDiff(_0x358667['timers'][_0xf654f1][_0xbf91('0x2c')]);clearTimeout(_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x2a')]);_0x358667[_0xbf91('0x27')][_0xf654f1][_0xbf91('0x2a')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x4b6455},_0x358667['timers'][_0xf654f1][_0xbf91('0x2e')],_0xf654f1)[_0xbf91('0x20')](function(_0x38cb2c){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x676ded,_0x4b6455,_0x38cb2c);})[_0xbf91('0x2f')](function(_0x3bd467){logger['error'](_0xbf91('0x30'),_0x676ded,_0x3bd467);});delete _0x358667[_0xbf91('0x27')][_0xf654f1];};}});}else{logger[_0xbf91('0x22')](_0xbf91('0x31'),_0x676ded,_0xf654f1,_0x52db4f);}});}})['catch'](function(_0x4d2f9c){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x676ded,_0x358667[_0xbf91('0x5')][_0x52db4f][_0xbf91('0x29')],_0xf654f1,_0x52db4f);})['finally'](function(){delete _0x358667[_0xbf91('0x7')][_0x676ded];});}catch(_0x20f3d7){logger[_0xbf91('0x32')](_0xbf91('0x33'),_0x20f3d7[_0xbf91('0x34')]);}};Acw['prototype'][_0xbf91('0x2b')]=function(_0x249674){try{var _0x35c2=this;if(_0x35c2[_0xbf91('0x27')][_0x249674]){_0x35c2[_0xbf91('0x27')][_0x249674][_0xbf91('0x2a')]=![];var _0x2985c4=_0x35c2[_0xbf91('0x27')][_0x249674][_0xbf91('0x2e')];var _0xf81983=_0x35c2[_0xbf91('0x27')][_0x249674][_0xbf91('0x19')];var _0x3b85ca=_0x35c2['voiceQueues'][_0xf81983][_0xbf91('0x29')];logger['info'](_0xbf91('0x35'),_0x2985c4,_0x249674);RpcUser[_0xbf91('0x36')](this[_0xbf91('0x6')][_0x249674]);RpcVoiceAgentReport[_0xbf91('0x37')]({'acwtime':_0x3b85ca,'agentacw':!![]},_0x2985c4,_0x249674)['then'](function(_0x40ac78){logger[_0xbf91('0x22')](_0xbf91('0x38'),_0x2985c4,_0x3b85ca,_0x40ac78);})[_0xbf91('0x2f')](function(_0x51cb4b){logger[_0xbf91('0x32')](_0xbf91('0x30'),_0x2985c4,_0x51cb4b);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x249674);if(_0x35c2[_0xbf91('0x27')]){logger[_0xbf91('0x22')](_0xbf91('0x39'),JSON['stringify'](_0x35c2[_0xbf91('0x27')]));}}}catch(_0x5660c3){logger['error']('[ACW][STOP]\x20%s',_0x5660c3['message']);}};Acw['prototype'][_0xbf91('0x9')]=function(_0x2e5fc1){try{if(this[_0xbf91('0x5')][_0x2e5fc1[_0xbf91('0x19')]]&&(this[_0xbf91('0x5')][_0x2e5fc1[_0xbf91('0x19')]][_0xbf91('0x4')]||this[_0xbf91('0x5')][_0x2e5fc1[_0xbf91('0x19')]][_0xbf91('0x1b')])){if(this[_0xbf91('0x6')][_0x2e5fc1[_0xbf91('0x18')]]){this[_0xbf91('0x7')][_0x2e5fc1['uniqueid']]={'queue':_0x2e5fc1[_0xbf91('0x19')],'interface':_0x2e5fc1[_0xbf91('0x18')],'destlinkedid':_0x2e5fc1[_0xbf91('0x25')]};}}}catch(_0x5ebf60){logger['error'](_0xbf91('0x3a'),_0x5ebf60[_0xbf91('0x34')]);}};Acw[_0xbf91('0x16')][_0xbf91('0x13')]=function(_0x42ef2f){try{if(this['voiceQueues'][_0x42ef2f[_0xbf91('0x19')]]&&(this['voiceQueues'][_0x42ef2f[_0xbf91('0x19')]]['acw']||this[_0xbf91('0x5')][_0x42ef2f[_0xbf91('0x19')]][_0xbf91('0x1b')])){if(this['agents'][_0x42ef2f[_0xbf91('0x18')]]){this['channels'][_0x42ef2f[_0xbf91('0x2e')]]={'queue':_0x42ef2f[_0xbf91('0x19')],'interface':_0x42ef2f[_0xbf91('0x18')]};}}}catch(_0x22c059){logger[_0xbf91('0x32')](_0xbf91('0x3b'),_0x22c059[_0xbf91('0x34')]);}};Acw['prototype']['syncHangupRequest']=function(_0x3dde9d){try{if(this[_0xbf91('0x7')][_0x3dde9d[_0xbf91('0x2e')]]&&_[_0xbf91('0x3c')](this[_0xbf91('0x7')][_0x3dde9d[_0xbf91('0x2e')]][_0xbf91('0x24')])){logger[_0xbf91('0x22')](_0xbf91('0x3d'),_0x3dde9d[_0xbf91('0x2e')]);this[_0xbf91('0x17')](_0x3dde9d[_0xbf91('0x2e')]);}else if(this[_0xbf91('0x7')][_0x3dde9d[_0xbf91('0x3e')]]&&_[_0xbf91('0x3c')](this['channels'][_0x3dde9d[_0xbf91('0x3e')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x3dde9d[_0xbf91('0x3e')]);this['startAcw'](_0x3dde9d[_0xbf91('0x3e')]);}}catch(_0x551757){logger[_0xbf91('0x32')](_0xbf91('0x3f'),_0x551757['message']);}};Acw['prototype'][_0xbf91('0xd')]=function(_0x1adbc9){try{if(this[_0xbf91('0x7')][_0x1adbc9[_0xbf91('0x2e')]]&&this[_0xbf91('0x7')][_0x1adbc9[_0xbf91('0x2e')]][_0xbf91('0x24')]){logger[_0xbf91('0x22')](_0xbf91('0x40'),_0x1adbc9[_0xbf91('0x2e')]);this[_0xbf91('0x17')](_0x1adbc9[_0xbf91('0x2e')]);}else if(this[_0xbf91('0x7')][_0x1adbc9[_0xbf91('0x3e')]]&&this['channels'][_0x1adbc9[_0xbf91('0x3e')]][_0xbf91('0x24')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1adbc9['linkedid']);this[_0xbf91('0x17')](_0x1adbc9[_0xbf91('0x3e')]);}}catch(_0x341ad5){logger[_0xbf91('0x32')]('[ACW][syncHangup]\x20%s',_0x341ad5['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0x57c250){try{if(!_[_0xbf91('0x41')](this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x42')]])){this[_0xbf91('0x17')](_0x57c250[_0xbf91('0x42')]);if(this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x43')]]){this[_0xbf91('0x7')][_0x57c250['secondtransfereruniqueid']][_0xbf91('0x24')]=!![];this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x44')]]=this['channels'][_0x57c250[_0xbf91('0x43')]];delete this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x43')]];}}else if(!_[_0xbf91('0x41')](this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x44')]])){this['startAcw'](_0x57c250[_0xbf91('0x44')]);if(this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x45')]]){this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x45')]][_0xbf91('0x24')]=!![];this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x42')]]=this[_0xbf91('0x7')][_0x57c250[_0xbf91('0x45')]];delete this[_0xbf91('0x7')][_0x57c250['origtransfereruniqueid']];}}}catch(_0x1e4a54){logger[_0xbf91('0x32')](_0xbf91('0x46'),_0x1e4a54['message']);}};Acw[_0xbf91('0x16')][_0xbf91('0x11')]=function(_0x31a3e9){try{if(this[_0xbf91('0x7')][_0x31a3e9[_0xbf91('0x47')]]){logger[_0xbf91('0x22')](_0xbf91('0x48'),JSON[_0xbf91('0x49')](_0x31a3e9[_0xbf91('0x47')]));this[_0xbf91('0x17')](_0x31a3e9[_0xbf91('0x47')]);}else if(this[_0xbf91('0x7')][_0x31a3e9[_0xbf91('0x4a')]]){logger[_0xbf91('0x22')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xbf91('0x49')](_0x31a3e9[_0xbf91('0x4a')]));this[_0xbf91('0x17')](_0x31a3e9[_0xbf91('0x4a')]);}}catch(_0x3b8c8e){logger['error'](_0xbf91('0x4b'),_0x3b8c8e[_0xbf91('0x34')]);}};Acw[_0xbf91('0x16')]['syncAgentRingNoAnswer']=function(_0x28bb32){try{if(this[_0xbf91('0x5')][_0x28bb32['queue']]&&this[_0xbf91('0x5')][_0x28bb32[_0xbf91('0x19')]][_0xbf91('0x4c')]===_0xbf91('0x4d')){if(this[_0xbf91('0x6')][_0x28bb32[_0xbf91('0x18')]]){logger[_0xbf91('0x22')](_0xbf91('0x4e'),_0x28bb32['uniqueid'],_0x28bb32[_0xbf91('0x18')],_0x28bb32[_0xbf91('0x19')]);return RpcUser[_0xbf91('0x26')](this[_0xbf91('0x6')][_0x28bb32[_0xbf91('0x18')]],_0xbf91('0x4f'),_0x28bb32[_0xbf91('0x2e')]);}}}catch(_0x16cb0e){logger[_0xbf91('0x32')](_0xbf91('0x50'),_0x16cb0e[_0xbf91('0x34')]);}};module['exports']=Acw; \ No newline at end of file +var _0x42f3=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','syncAgentConnect','bind','hanguprequest','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','agents','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','attended','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x59c389,_0x19e789){var _0x2d35c6=function(_0x4deae7){while(--_0x4deae7){_0x59c389['push'](_0x59c389['shift']());}};_0x2d35c6(++_0x19e789);}(_0x42f3,0x69));var _0x342f=function(_0xbad322,_0x3e6b0b){_0xbad322=_0xbad322-0x0;var _0x2101cb=_0x42f3[_0xbad322];return _0x2101cb;};'use strict';var util=require(_0x342f('0x0'));var _=require(_0x342f('0x1'));var moment=require('moment');var ami=require(_0x342f('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x342f('0x3'));var RpcVoiceAgentReport=require(_0x342f('0x4'));function Acw(_0x21a001){this[_0x342f('0x5')]=_0x21a001['voiceQueues'];this['agents']=_0x21a001['agents'];this[_0x342f('0x6')]=_0x21a001['timers'];this[_0x342f('0x7')]={};ami['on']('agentconnect',this[_0x342f('0x8')][_0x342f('0x9')](this));ami['on'](_0x342f('0xa'),this['syncHangupRequest'][_0x342f('0x9')](this));ami['on'](_0x342f('0xb'),this['syncHangup'][_0x342f('0x9')](this));ami['on']('agentringnoanswer',this[_0x342f('0xc')][_0x342f('0x9')](this));ami['on'](_0x342f('0xd'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x342f('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x342f('0xe')][_0x342f('0x9')](this));}function getDiff(_0x572c29){var _0x25853f=moment()[_0x342f('0xf')](0x0);var _0x23a616=moment(_0x572c29)[_0x342f('0xf')](0x0);return _0x25853f['diff'](_0x23a616,_0x342f('0x10'));}Acw[_0x342f('0x11')][_0x342f('0x12')]=function(_0x1f618b){try{var _0x3cb3e9=this;var _0x1ae98c=this[_0x342f('0x7')][_0x1f618b]['interface'];var _0x19db65=this[_0x342f('0x7')][_0x1f618b][_0x342f('0x13')];var _0x2e97b9=this[_0x342f('0x5')][_0x19db65];var _0x2604f2=![];var _0x2c856c=_0x342f('0x14');if(_0x2e97b9[_0x342f('0x15')]){if(_0x2e97b9['mandatoryDispositionPause'][_0x342f('0x16')]){_0x2604f2=!![];_0x2c856c=_0x2e97b9[_0x342f('0x17')]['name'];}}ami['Action']({'action':_0x342f('0x18'),'interface':_0x1ae98c,'paused':!![],'reason':_0x2c856c})[_0x342f('0x19')](function(_0x33f234){if(_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c]){return RpcUser[_0x342f('0x1b')](_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c]['id'])['then'](function(_0x59fc0e){if(_0x59fc0e&&!_0x59fc0e[_0x342f('0x1c')]){logger[_0x342f('0x1d')](_0x342f('0x1e'),_0x1f618b,_0x1ae98c,_0x19db65);var _0x37d11b=_0x3cb3e9[_0x342f('0x7')][_0x1f618b]['attended']&&_0x3cb3e9[_0x342f('0x7')][_0x1f618b]['destlinkedid']?_0x3cb3e9[_0x342f('0x7')][_0x1f618b][_0x342f('0x1f')]:_0x1f618b;return RpcUser[_0x342f('0x20')](_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c],_0x2c856c,_0x37d11b)['then'](function(_0x23571a){if(!_0x2604f2){_0x3cb3e9[_0x342f('0x6')][_0x1ae98c]={};logger[_0x342f('0x1d')](_0x342f('0x21'),_0x1f618b,_0x3cb3e9[_0x342f('0x5')][_0x19db65][_0x342f('0x22')],_0x1ae98c,_0x19db65);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c]['timer']=setTimeout(_0x3cb3e9[_0x342f('0x23')]['bind'](_0x3cb3e9,_0x1ae98c),_0x3cb3e9[_0x342f('0x5')][_0x19db65]['acwTimeout']*0x3e8);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x24')]=moment()[_0x342f('0x25')](_0x342f('0x26'));_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x27')]=_0x1f618b;_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x13')]=_0x19db65;_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x28')]=function(){var _0x2149a0=getDiff(_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x24')]);clearTimeout(_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x29')]);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x29')]=![];RpcVoiceAgentReport[_0x342f('0x2a')]({'acwtime':_0x2149a0},_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x27')],_0x1ae98c)[_0x342f('0x19')](function(_0x2ba203){logger[_0x342f('0x1d')](_0x342f('0x2b'),_0x1f618b,_0x2149a0,_0x2ba203);})['catch'](function(_0x189c4e){logger[_0x342f('0x2c')](_0x342f('0x2d'),_0x1f618b,_0x189c4e);});delete _0x3cb3e9[_0x342f('0x6')][_0x1ae98c];};}});}else{logger[_0x342f('0x1d')](_0x342f('0x2e'),_0x1f618b,_0x1ae98c,_0x19db65);}});}})[_0x342f('0x2f')](function(_0x2676ce){logger[_0x342f('0x2c')](_0x342f('0x21'),_0x1f618b,_0x3cb3e9[_0x342f('0x5')][_0x19db65]['acwTimeout'],_0x1ae98c,_0x19db65);})[_0x342f('0x30')](function(){delete _0x3cb3e9['channels'][_0x1f618b];});}catch(_0x32af19){logger[_0x342f('0x2c')](_0x342f('0x31'),_0x32af19[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x23')]=function(_0x3f9658){try{var _0x3307e8=this;if(_0x3307e8[_0x342f('0x6')][_0x3f9658]){_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x29')]=![];var _0x1432ae=_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x27')];var _0x2f1c94=_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x13')];var _0x3f2e4f=_0x3307e8['voiceQueues'][_0x2f1c94][_0x342f('0x22')];logger[_0x342f('0x1d')](_0x342f('0x33'),_0x1432ae,_0x3f9658);RpcUser[_0x342f('0x34')](this[_0x342f('0x1a')][_0x3f9658]);RpcVoiceAgentReport[_0x342f('0x2a')]({'acwtime':_0x3f2e4f,'agentacw':!![]},_0x1432ae,_0x3f9658)['then'](function(_0xe34cd3){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x1432ae,_0x3f2e4f,_0xe34cd3);})[_0x342f('0x2f')](function(_0x576dd6){logger[_0x342f('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x1432ae,_0x576dd6);});}else{logger[_0x342f('0x2c')](_0x342f('0x35'),_0x3f9658);if(_0x3307e8['timers']){logger[_0x342f('0x1d')](_0x342f('0x36'),JSON[_0x342f('0x37')](_0x3307e8['timers']));}}}catch(_0x178dce){logger['error'](_0x342f('0x38'),_0x178dce[_0x342f('0x32')]);}};Acw['prototype']['syncAgentConnect']=function(_0x17f1db){try{if(this[_0x342f('0x5')][_0x17f1db['queue']]&&(this[_0x342f('0x5')][_0x17f1db[_0x342f('0x13')]][_0x342f('0x39')]||this[_0x342f('0x5')][_0x17f1db['queue']][_0x342f('0x15')])){if(this['agents'][_0x17f1db[_0x342f('0x3a')]]){this[_0x342f('0x7')][_0x17f1db[_0x342f('0x27')]]={'queue':_0x17f1db[_0x342f('0x13')],'interface':_0x17f1db[_0x342f('0x3a')],'destlinkedid':_0x17f1db['destlinkedid']};}}}catch(_0x556c03){logger['error'](_0x342f('0x3b'),_0x556c03[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0xe')]=function(_0x54d87f){try{if(this['voiceQueues'][_0x54d87f[_0x342f('0x13')]]&&(this['voiceQueues'][_0x54d87f[_0x342f('0x13')]][_0x342f('0x39')]||this[_0x342f('0x5')][_0x54d87f[_0x342f('0x13')]][_0x342f('0x15')])){if(this[_0x342f('0x1a')][_0x54d87f[_0x342f('0x3a')]]){this[_0x342f('0x7')][_0x54d87f['uniqueid']]={'queue':_0x54d87f[_0x342f('0x13')],'interface':_0x54d87f[_0x342f('0x3a')]};}}}catch(_0x16d403){logger[_0x342f('0x2c')](_0x342f('0x3c'),_0x16d403[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x3d')]=function(_0x4cb1e1){try{if(this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x27')]]&&_['isUndefined'](this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x27')]]['attended'])){logger['info'](_0x342f('0x3e'),_0x4cb1e1[_0x342f('0x27')]);this[_0x342f('0x12')](_0x4cb1e1[_0x342f('0x27')]);}else if(this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x3f')]]&&_[_0x342f('0x40')](this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x3f')]][_0x342f('0x41')])){logger[_0x342f('0x1d')](_0x342f('0x42'),_0x4cb1e1['linkedid']);this[_0x342f('0x12')](_0x4cb1e1[_0x342f('0x3f')]);}}catch(_0x2df698){logger[_0x342f('0x2c')]('[ACW][syncHangupRequest]\x20%s',_0x2df698[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x43')]=function(_0x515dab){try{if(this['channels'][_0x515dab[_0x342f('0x27')]]&&this[_0x342f('0x7')][_0x515dab[_0x342f('0x27')]][_0x342f('0x41')]){logger['info'](_0x342f('0x44'),_0x515dab[_0x342f('0x27')]);this[_0x342f('0x12')](_0x515dab[_0x342f('0x27')]);}else if(this['channels'][_0x515dab[_0x342f('0x3f')]]&&this[_0x342f('0x7')][_0x515dab[_0x342f('0x3f')]][_0x342f('0x41')]){logger[_0x342f('0x1d')](_0x342f('0x45'),_0x515dab[_0x342f('0x3f')]);this[_0x342f('0x12')](_0x515dab['linkedid']);}}catch(_0x263e5c){logger[_0x342f('0x2c')]('[ACW][syncHangup]\x20%s',_0x263e5c[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x46')]=function(_0x2075b0){try{if(!_[_0x342f('0x47')](this[_0x342f('0x7')][_0x2075b0[_0x342f('0x48')]])){this[_0x342f('0x12')](_0x2075b0[_0x342f('0x48')]);if(this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]]){this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]][_0x342f('0x41')]=!![];this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4a')]]=this[_0x342f('0x7')][_0x2075b0['secondtransfereruniqueid']];delete this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]];}}else if(!_[_0x342f('0x47')](this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4a')]])){this['startAcw'](_0x2075b0[_0x342f('0x4a')]);if(this['channels'][_0x2075b0[_0x342f('0x4b')]]){this[_0x342f('0x7')][_0x2075b0['origtransfereruniqueid']][_0x342f('0x41')]=!![];this[_0x342f('0x7')][_0x2075b0[_0x342f('0x48')]]=this[_0x342f('0x7')][_0x2075b0['origtransfereruniqueid']];delete this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4b')]];}}}catch(_0x3e7dcc){logger[_0x342f('0x2c')](_0x342f('0x4c'),_0x3e7dcc[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x4d')]=function(_0x5764f3){try{if(this[_0x342f('0x7')][_0x5764f3[_0x342f('0x4e')]]){logger[_0x342f('0x1d')](_0x342f('0x4f'),JSON['stringify'](_0x5764f3[_0x342f('0x4e')]));this[_0x342f('0x12')](_0x5764f3['transfereruniqueid']);}else if(this[_0x342f('0x7')][_0x5764f3[_0x342f('0x50')]]){logger[_0x342f('0x1d')](_0x342f('0x51'),JSON[_0x342f('0x37')](_0x5764f3[_0x342f('0x50')]));this[_0x342f('0x12')](_0x5764f3[_0x342f('0x50')]);}}catch(_0x54a255){logger[_0x342f('0x2c')](_0x342f('0x52'),_0x54a255[_0x342f('0x32')]);}};Acw[_0x342f('0x11')]['syncAgentRingNoAnswer']=function(_0x12df87){try{if(this[_0x342f('0x5')][_0x12df87[_0x342f('0x13')]]&&this[_0x342f('0x5')][_0x12df87['queue']][_0x342f('0x53')]===_0x342f('0x54')){if(this['agents'][_0x12df87['interface']]){logger[_0x342f('0x1d')](_0x342f('0x55'),_0x12df87[_0x342f('0x27')],_0x12df87['interface'],_0x12df87['queue']);return RpcUser[_0x342f('0x20')](this['agents'][_0x12df87['interface']],'Auto-Pause',_0x12df87[_0x342f('0x27')]);}}}catch(_0x2452e9){logger[_0x342f('0x2c')](_0x342f('0x56'),_0x2452e9[_0x342f('0x32')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index fa698e1..8001d08 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 _0xc75a=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','actionSipShowRegistry','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','username','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionDeviceStateList','then','actionSipPeerStatus','catch','bluebird','moment','util','lodash','../../config/logger','ami','port','asterisk','password','keepConnected','Action','promisify','action','format'];(function(_0x408bd8,_0x126bd2){var _0x332a9b=function(_0x330264){while(--_0x330264){_0x408bd8['push'](_0x408bd8['shift']());}};_0x332a9b(++_0x126bd2);}(_0xc75a,0xd0));var _0xac75=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0xc75a[_0x3d61c6];return _0x47e0df;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xac75('0x0'));var moment=require(_0xac75('0x1'));var util=require(_0xac75('0x2'));var _=require(_0xac75('0x3'));var logger=require(_0xac75('0x4'))(_0xac75('0x5'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0xac75('0x6')],config[_0xac75('0x7')]['ip'],config[_0xac75('0x7')]['username'],config[_0xac75('0x7')][_0xac75('0x8')],!![]);ami[_0xac75('0x9')]();ami[_0xac75('0xa')]=BPromise[_0xac75('0xb')](ami[_0xac75('0xc')]);function error(_0x12088a){logger['error'](util[_0xac75('0xd')](_0xac75('0xe'),config['asterisk']['username'],config[_0xac75('0x7')]['ip'],config[_0xac75('0x7')]['port'],util[_0xac75('0xf')](_0x12088a,![],null)));}function close(){logger[_0xac75('0x10')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xac75('0x7')]['ip'],config[_0xac75('0x7')][_0xac75('0x6')]));}ami[_0xac75('0x11')]=function(){return function(){return ami[_0xac75('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xac75('0xa')]({'action':_0xac75('0x12')});};};ami[_0xac75('0x13')]=function(){return function(){return ami['Action']({'action':_0xac75('0x14')});};};ami[_0xac75('0x15')]=function(){return function(){return ami['Action']({'action':_0xac75('0x16')});};};function connect(_0x310b53){logger[_0xac75('0x17')](util['format'](_0xac75('0x18'),config[_0xac75('0x7')]['username'],config['asterisk']['ip'],config[_0xac75('0x7')][_0xac75('0x6')]));ami[_0xac75('0x19')](_0xac75('0x10'),error);ami[_0xac75('0x19')](_0xac75('0x1a'),close);}ami['on'](_0xac75('0x1b'),connect);ami['on'](_0xac75('0x1c'),function(_0x53eb26){logger['info'](util[_0xac75('0xd')](_0xac75('0x1d'),config[_0xac75('0x7')][_0xac75('0x1e')],config[_0xac75('0x7')]['ip'],config[_0xac75('0x7')]['port'],util[_0xac75('0xf')](_0x53eb26,![],null)));});ami['on'](_0xac75('0x1f'),function(_0x9684b2){logger[_0xac75('0x17')](util[_0xac75('0xd')](_0xac75('0x20'),config[_0xac75('0x7')][_0xac75('0x1e')],config[_0xac75('0x7')]['ip'],config['asterisk'][_0xac75('0x6')]));return BPromise['resolve']()['then'](ami[_0xac75('0x11')]())['then'](ami[_0xac75('0x21')]())[_0xac75('0x22')](ami[_0xac75('0x23')]())[_0xac75('0x22')](ami[_0xac75('0x13')]())[_0xac75('0x22')](ami[_0xac75('0x15')]())[_0xac75('0x24')](function(_0x516512){console['log'](_0x516512);});});ami['once'](_0xac75('0x10'),error);ami[_0xac75('0x19')](_0xac75('0x1a'),close);module['exports']=ami; \ No newline at end of file +var _0x6d03=['actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','format','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','asterisk','port','username','password','keepConnected','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x335235,_0x3aa499){var _0x74bae8=function(_0x347a52){while(--_0x347a52){_0x335235['push'](_0x335235['shift']());}};_0x74bae8(++_0x3aa499);}(_0x6d03,0xe1));var _0x36d0=function(_0x506ecb,_0x2957e4){_0x506ecb=_0x506ecb-0x0;var _0x341e49=_0x6d03[_0x506ecb];return _0x341e49;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x36d0('0x0'));var moment=require(_0x36d0('0x1'));var util=require(_0x36d0('0x2'));var _=require(_0x36d0('0x3'));var logger=require(_0x36d0('0x4'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x36d0('0x5')][_0x36d0('0x6')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x7')],config[_0x36d0('0x5')][_0x36d0('0x8')],!![]);ami[_0x36d0('0x9')]();ami['Action']=BPromise['promisify'](ami[_0x36d0('0xa')]);function error(_0xd89ac1){logger[_0x36d0('0xb')](util['format'](_0x36d0('0xc'),config['asterisk']['username'],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')],util[_0x36d0('0xd')](_0xd89ac1,![],null)));}function close(){logger['error'](util['format'](_0x36d0('0xe'),config[_0x36d0('0x5')][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')]['port']));}ami[_0x36d0('0xf')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x11')});};};ami[_0x36d0('0x12')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x13')});};};ami[_0x36d0('0x14')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x15')});};};ami[_0x36d0('0x16')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x18')});};};function connect(_0x329f1c){logger[_0x36d0('0x19')](util['format'](_0x36d0('0x1a'),config[_0x36d0('0x5')][_0x36d0('0x7')],config['asterisk']['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')]));ami[_0x36d0('0x1b')](_0x36d0('0xb'),error);ami[_0x36d0('0x1b')](_0x36d0('0x1c'),close);}ami['on'](_0x36d0('0x1d'),connect);ami['on']('shutdown',function(_0x53f59f){logger[_0x36d0('0x19')](util['format'](_0x36d0('0x1e'),config['asterisk'][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')],util['inspect'](_0x53f59f,![],null)));});ami['on'](_0x36d0('0x1f'),function(_0x8fcd42){logger[_0x36d0('0x19')](util[_0x36d0('0x20')](_0x36d0('0x21'),config['asterisk'][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config['asterisk'][_0x36d0('0x6')]));return BPromise[_0x36d0('0x22')]()['then'](ami[_0x36d0('0xf')]())[_0x36d0('0x23')](ami[_0x36d0('0x12')]())[_0x36d0('0x23')](ami[_0x36d0('0x14')]())[_0x36d0('0x23')](ami[_0x36d0('0x16')]())['then'](ami[_0x36d0('0x24')]())[_0x36d0('0x25')](function(_0x2781fc){console[_0x36d0('0x26')](_0x2781fc);});});ami[_0x36d0('0x1b')](_0x36d0('0xb'),error);ami['once'](_0x36d0('0x1c'),close);module[_0x36d0('0x27')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index eead1ce..670fbfe 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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x327f96,_0x57436c){var _0x521f06=function(_0x180cc0){while(--_0x180cc0){_0x327f96['push'](_0x327f96['shift']());}};_0x521f06(++_0x57436c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda3f,0xec));var _0xfda3=function(_0x2630dd,_0x4ff833){_0x2630dd=_0x2630dd-0x0;var _0x251e6f=_0xda3f[_0x2630dd];return _0x251e6f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index ba0dc0a..270a0b0 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf3a=['UserId','VoiceQueueId','idHopper','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','\x22%s\x22\x20<%s>','substring','prototype','exports','util','lodash','moment','isNil','string','voiceQueue','Contact','phone','number','queue','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x4ff1b9,_0x515fed){var _0x4a77b9=function(_0x30e752){while(--_0x30e752){_0x4ff1b9['push'](_0x4ff1b9['shift']());}};_0x4a77b9(++_0x515fed);}(_0xbf3a,0xd2));var _0xabf3=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0xbf3a[_0x15942a];return _0x36a9fb;};'use strict';var util=require(_0xabf3('0x0'));var _=require(_0xabf3('0x1'));var moment=require(_0xabf3('0x2'));function checkNameSurname(_0x325c97,_0x40782c,_0x2e8895){var _0x195d09='';if(!_[_0xabf3('0x3')](_0x40782c)&&'string'===typeof _0x40782c){_0x195d09+=_0x40782c;}if(!_[_0xabf3('0x3')](_0x2e8895)&&_0xabf3('0x4')===typeof _0x2e8895){_0x195d09+='\x20'+_0x2e8895;}if(_0x195d09!==''){return _0x195d09;}return _0x325c97;}function Action(_0x51a3f1,_0x5c2f80,_0x590cb7){this[_0xabf3('0x5')]=_0x51a3f1;this['uniqueid']=_0x590cb7||undefined;this['name']=checkNameSurname(_0x5c2f80[_0xabf3('0x6')][_0xabf3('0x7')],_0x5c2f80[_0xabf3('0x6')]['firstName'],_0x5c2f80[_0xabf3('0x6')]['lastName']);this[_0xabf3('0x8')]=_0x5c2f80[_0xabf3('0x6')][_0xabf3('0x7')];this[_0xabf3('0x9')]=_0x51a3f1[_0xabf3('0xa')];this[_0xabf3('0xb')]=_0x5c2f80[_0xabf3('0xb')]||![];this['type']=_0x51a3f1['type'];this[_0xabf3('0xc')]=_0x51a3f1[_0xabf3('0xc')]||0x3;this[_0xabf3('0xd')]=_0x5c2f80[_0xabf3('0xd')];this[_0xabf3('0xe')]=_0x5c2f80[_0xabf3('0xe')];this[_0xabf3('0xf')]=_0x5c2f80[_0xabf3('0xf')];this[_0xabf3('0x10')]=_0x5c2f80[_0xabf3('0x10')];this[_0xabf3('0x11')]=_0x5c2f80[_0xabf3('0x11')];this[_0xabf3('0x12')]=_0x5c2f80[_0xabf3('0x12')];this[_0xabf3('0x13')]=_0x5c2f80['countabandonedretry'];this[_0xabf3('0x14')]=_0x5c2f80[_0xabf3('0x14')];this[_0xabf3('0x15')]=_0x5c2f80[_0xabf3('0x15')];this[_0xabf3('0x16')]=_0x5c2f80[_0xabf3('0x16')];this['ListId']=_0x5c2f80[_0xabf3('0x17')];this[_0xabf3('0x18')]=_0x5c2f80['UserId'];this[_0xabf3('0x19')]=_0x5c2f80['VoiceQueueId'];this['CampaignId']=_0x5c2f80['CampaignId'];this[_0xabf3('0x1a')]=_0x5c2f80['id'];this['ContactFirstName']=_0x5c2f80['Contact'][_0xabf3('0x1b')]||'';this['starttime']=moment()[_0xabf3('0x1c')](_0xabf3('0x1d'));this[_0xabf3('0x1e')]=_0x5c2f80[_0xabf3('0x1e')];this[_0xabf3('0x1f')]=_0x5c2f80[_0xabf3('0x1f')];this[_0xabf3('0x20')]=_0x5c2f80[_0xabf3('0x20')];this[_0xabf3('0x21')]=_0x5c2f80['recallme'];this[_0xabf3('0x22')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0xabf3('0x1c')](_0xabf3('0x23'),this[_0xabf3('0xa')],this[_0xabf3('0x5')]['dialCutDigit']>0x0?this[_0xabf3('0x8')][_0xabf3('0x24')](this[_0xabf3('0x5')]['dialCutDigit']):this[_0xabf3('0x8')]);};Action[_0xabf3('0x25')]['getQueue']=function(){return this[_0xabf3('0x9')];};module[_0xabf3('0x26')]=Action; \ No newline at end of file +var _0xd485=['util','moment','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports'];(function(_0x5a0957,_0x22f040){var _0x3ceab1=function(_0x3d6344){while(--_0x3d6344){_0x5a0957['push'](_0x5a0957['shift']());}};_0x3ceab1(++_0x22f040);}(_0xd485,0xcd));var _0x5d48=function(_0x30d77a,_0x55d542){_0x30d77a=_0x30d77a-0x0;var _0x382841=_0xd485[_0x30d77a];return _0x382841;};'use strict';var util=require(_0x5d48('0x0'));var _=require('lodash');var moment=require(_0x5d48('0x1'));function checkNameSurname(_0x5cb90d,_0x27862b,_0x353049){var _0x4bb26e='';if(!_['isNil'](_0x27862b)&&_0x5d48('0x2')===typeof _0x27862b){_0x4bb26e+=_0x27862b;}if(!_[_0x5d48('0x3')](_0x353049)&&_0x5d48('0x2')===typeof _0x353049){_0x4bb26e+='\x20'+_0x353049;}if(_0x4bb26e!==''){return _0x4bb26e;}return _0x5cb90d;}function Action(_0x246e3f,_0x5ce4a5,_0x501cb8){this[_0x5d48('0x4')]=_0x246e3f;this[_0x5d48('0x5')]=_0x501cb8||undefined;this[_0x5d48('0x6')]=checkNameSurname(_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x8')],_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x9')],_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0xa')]);this[_0x5d48('0xb')]=_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x8')];this[_0x5d48('0xc')]=_0x246e3f[_0x5d48('0x6')];this[_0x5d48('0xd')]=_0x5ce4a5[_0x5d48('0xd')]||![];this[_0x5d48('0xe')]=_0x246e3f['type'];this[_0x5d48('0xf')]=_0x246e3f[_0x5d48('0xf')]||0x3;this[_0x5d48('0x10')]=_0x5ce4a5['scheduledat'];this[_0x5d48('0x11')]=_0x5ce4a5[_0x5d48('0x11')];this[_0x5d48('0x12')]=_0x5ce4a5['countcongestionretry'];this['countnoanswerretry']=_0x5ce4a5['countnoanswerretry'];this['countnosuchnumberretry']=_0x5ce4a5['countnosuchnumberretry'];this[_0x5d48('0x13')]=_0x5ce4a5[_0x5d48('0x13')];this[_0x5d48('0x14')]=_0x5ce4a5[_0x5d48('0x14')];this[_0x5d48('0x15')]=_0x5ce4a5[_0x5d48('0x15')];this['countagentrejectretry']=_0x5ce4a5['countagentrejectretry'];this[_0x5d48('0x16')]=_0x5ce4a5[_0x5d48('0x16')];this[_0x5d48('0x17')]=_0x5ce4a5[_0x5d48('0x17')];this['UserId']=_0x5ce4a5[_0x5d48('0x18')];this[_0x5d48('0x19')]=_0x5ce4a5[_0x5d48('0x19')];this[_0x5d48('0x1a')]=_0x5ce4a5[_0x5d48('0x1a')];this[_0x5d48('0x1b')]=_0x5ce4a5['id'];this['ContactFirstName']=_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x9')]||'';this['starttime']=moment()[_0x5d48('0x1c')](_0x5d48('0x1d'));this[_0x5d48('0x1e')]=_0x5ce4a5[_0x5d48('0x1e')];this[_0x5d48('0x1f')]=_0x5ce4a5['callbackuniqueid'];this['callbackat']=_0x5ce4a5[_0x5d48('0x20')];this[_0x5d48('0x21')]=_0x5ce4a5['recallme'];this[_0x5d48('0x22')]='';this['originatecalleridname']='';}Action['prototype'][_0x5d48('0x23')]=function(){return util[_0x5d48('0x1c')](_0x5d48('0x24'),this[_0x5d48('0x6')],this[_0x5d48('0x4')]['dialCutDigit']>0x0?this[_0x5d48('0xb')][_0x5d48('0x25')](this[_0x5d48('0x4')][_0x5d48('0x26')]):this[_0x5d48('0xb')]);};Action['prototype'][_0x5d48('0x27')]=function(){return this[_0x5d48('0xc')];};module[_0x5d48('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index aa2c8a8..2cdffd6 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1081=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0x15ea6a,_0x2d282f){var _0x4d4d12=function(_0x10e180){while(--_0x10e180){_0x15ea6a['push'](_0x15ea6a['shift']());}};_0x4d4d12(++_0x2d282f);}(_0x1081,0x192));var _0x1108=function(_0x12cd3e,_0x4e93cc){_0x12cd3e=_0x12cd3e-0x0;var _0x5e0d1b=_0x1081[_0x12cd3e];return _0x5e0d1b;};'use strict';var util=require(_0x1108('0x0'));var _=require(_0x1108('0x1'));var moment=require(_0x1108('0x2'));function getSeconds(_0x3d5d55,_0x343558){var _0x410751=moment(_0x3d5d55)['milliseconds'](0x0);var _0x4bd118=moment(_0x343558)[_0x1108('0x3')](0x0);return _0x410751[_0x1108('0x4')](_0x4bd118,_0x1108('0x5'));}function AgentComplete(_0x1734ab,_0x229076){this[_0x1108('0x6')]=0x4;this[_0x1108('0x7')]=_0x1108('0x8');this[_0x1108('0x9')]=_0x1734ab[_0x1108('0x9')];this[_0x1108('0xa')]=_0x1734ab[_0x1108('0xa')];this[_0x1108('0xb')]=_0x1734ab[_0x1108('0xa')]===_0x1108('0xc')?'queue':_0x1734ab[_0x1108('0xa')];this[_0x1108('0xd')]=_0x1734ab[_0x1108('0xd')];this[_0x1108('0xe')]=_0x1734ab['countcongestionretry'];this[_0x1108('0xf')]=_0x1734ab['countnoanswerretry'];this[_0x1108('0x10')]=_0x1734ab[_0x1108('0xd')]+_0x1734ab[_0x1108('0xe')]+_0x1734ab[_0x1108('0xf')]+_0x1734ab[_0x1108('0x11')]+_0x1734ab[_0x1108('0x12')]+_0x1734ab[_0x1108('0x13')]+_0x1734ab['countmachineretry']+_0x1734ab[_0x1108('0x14')];this['countnosuchnumberretry']=_0x1734ab[_0x1108('0x11')];this[_0x1108('0x12')]=_0x1734ab[_0x1108('0x12')];this['countabandonedretry']=_0x1734ab['countabandonedretry'];this[_0x1108('0x15')]=_0x1734ab['countmachineretry'];this[_0x1108('0x14')]=_0x1734ab['countagentrejectretry'];this['uniqueid']=_0x229076[_0x1108('0x16')];this[_0x1108('0x17')]=_0x1734ab['name'];this[_0x1108('0x18')]=_0x1734ab[_0x1108('0x19')];this[_0x1108('0x1a')]=_0x1734ab[_0x1108('0x1a')];this[_0x1108('0x1b')]=_0x1734ab[_0x1108('0x1b')];this[_0x1108('0x1c')]=_0x1734ab[_0x1108('0x1c')];this[_0x1108('0x1d')]=moment()['format'](_0x1108('0x1e'));this[_0x1108('0x1f')]=getSeconds(_0x1734ab[_0x1108('0x1b')],_0x1734ab[_0x1108('0x1a')]);this['holdtime']=getSeconds(_0x1734ab[_0x1108('0x1c')],_0x1734ab[_0x1108('0x1b')]);this['talktime']=getSeconds(this[_0x1108('0x1d')],_0x1734ab[_0x1108('0x1c')]);this[_0x1108('0x20')]=_0x229076['queue'];this[_0x1108('0x21')]=_0x229076[_0x1108('0x21')];this[_0x1108('0x22')]=_0x229076[_0x1108('0x22')];this[_0x1108('0x23')]=_0x1734ab[_0x1108('0x23')];this[_0x1108('0x24')]=_0x1734ab[_0x1108('0x24')];this[_0x1108('0x25')]=_0x1734ab[_0x1108('0x25')];this['recallme']=_0x1734ab[_0x1108('0x26')];this[_0x1108('0x27')]=_0x1734ab[_0x1108('0x27')];this[_0x1108('0x28')]=_0x1734ab['ListId'];this['UserId']=_0x1734ab[_0x1108('0x29')];this[_0x1108('0x2a')]=_0x1734ab[_0x1108('0x2a')];this[_0x1108('0x2b')]=_0x1734ab['CampaignId'];this['originatecalleridnum']=_0x1734ab['originatecalleridnum']||'';this['originatecalleridname']=_0x1734ab[_0x1108('0x2c')]||'';}module[_0x1108('0x2d')]=AgentComplete; \ No newline at end of file +var _0x4a20=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x228284,_0x791773){var _0x3715d5=function(_0x47d091){while(--_0x47d091){_0x228284['push'](_0x228284['shift']());}};_0x3715d5(++_0x791773);}(_0x4a20,0x75));var _0x04a2=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x4a20[_0xaa1b3e];return _0x454d7d;};'use strict';var util=require('util');var _=require(_0x04a2('0x0'));var moment=require(_0x04a2('0x1'));function getSeconds(_0x46adbc,_0x4644cd){var _0x548893=moment(_0x46adbc)[_0x04a2('0x2')](0x0);var _0x3da70a=moment(_0x4644cd)[_0x04a2('0x2')](0x0);return _0x548893[_0x04a2('0x3')](_0x3da70a,_0x04a2('0x4'));}function AgentComplete(_0x14bcbd,_0x58d3bc){this[_0x04a2('0x5')]=0x4;this[_0x04a2('0x6')]=_0x04a2('0x7');this[_0x04a2('0x8')]=_0x14bcbd[_0x04a2('0x8')];this['type']=_0x14bcbd[_0x04a2('0x9')];this['campaigntype']=_0x14bcbd[_0x04a2('0x9')]===_0x04a2('0xa')?'queue':_0x14bcbd[_0x04a2('0x9')];this[_0x04a2('0xb')]=_0x14bcbd['countbusyretry'];this[_0x04a2('0xc')]=_0x14bcbd[_0x04a2('0xc')];this[_0x04a2('0xd')]=_0x14bcbd[_0x04a2('0xd')];this[_0x04a2('0xe')]=_0x14bcbd[_0x04a2('0xb')]+_0x14bcbd[_0x04a2('0xc')]+_0x14bcbd[_0x04a2('0xd')]+_0x14bcbd['countnosuchnumberretry']+_0x14bcbd[_0x04a2('0xf')]+_0x14bcbd['countabandonedretry']+_0x14bcbd['countmachineretry']+_0x14bcbd['countagentrejectretry'];this[_0x04a2('0x10')]=_0x14bcbd[_0x04a2('0x10')];this[_0x04a2('0xf')]=_0x14bcbd[_0x04a2('0xf')];this['countabandonedretry']=_0x14bcbd['countabandonedretry'];this[_0x04a2('0x11')]=_0x14bcbd['countmachineretry'];this['countagentrejectretry']=_0x14bcbd[_0x04a2('0x12')];this['uniqueid']=_0x58d3bc[_0x04a2('0x13')];this[_0x04a2('0x14')]=_0x14bcbd[_0x04a2('0x15')];this[_0x04a2('0x16')]=_0x14bcbd[_0x04a2('0x17')];this[_0x04a2('0x18')]=_0x14bcbd[_0x04a2('0x18')];this[_0x04a2('0x19')]=_0x14bcbd['responsetime'];this['answertime']=_0x14bcbd[_0x04a2('0x1a')];this[_0x04a2('0x1b')]=moment()[_0x04a2('0x1c')](_0x04a2('0x1d'));this[_0x04a2('0x1e')]=getSeconds(_0x14bcbd[_0x04a2('0x19')],_0x14bcbd[_0x04a2('0x18')]);this['holdtime']=getSeconds(_0x14bcbd[_0x04a2('0x1a')],_0x14bcbd[_0x04a2('0x19')]);this[_0x04a2('0x1f')]=getSeconds(this['endtime'],_0x14bcbd[_0x04a2('0x1a')]);this[_0x04a2('0x20')]=_0x58d3bc[_0x04a2('0x20')];this[_0x04a2('0x21')]=_0x58d3bc[_0x04a2('0x21')];this[_0x04a2('0x22')]=_0x58d3bc[_0x04a2('0x22')];this[_0x04a2('0x23')]=_0x14bcbd[_0x04a2('0x23')];this['callbackuniqueid']=_0x14bcbd[_0x04a2('0x24')];this[_0x04a2('0x25')]=_0x14bcbd['callbackat'];this[_0x04a2('0x26')]=_0x14bcbd[_0x04a2('0x26')];this['ContactId']=_0x14bcbd[_0x04a2('0x27')];this['ListId']=_0x14bcbd[_0x04a2('0x28')];this[_0x04a2('0x29')]=_0x14bcbd[_0x04a2('0x29')];this[_0x04a2('0x2a')]=_0x14bcbd[_0x04a2('0x2a')];this[_0x04a2('0x2b')]=_0x14bcbd[_0x04a2('0x2b')];this[_0x04a2('0x2c')]=_0x14bcbd['originatecalleridnum']||'';this['originatecalleridname']=_0x14bcbd[_0x04a2('0x2d')]||'';}module[_0x04a2('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index b46708c..e2c50f2 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08d9=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util'];(function(_0x43832f,_0x319c43){var _0x234007=function(_0x10a2aa){while(--_0x10a2aa){_0x43832f['push'](_0x43832f['shift']());}};_0x234007(++_0x319c43);}(_0x08d9,0xc2));var _0x908d=function(_0x5671af,_0x16886f){_0x5671af=_0x5671af-0x0;var _0x48f75a=_0x08d9[_0x5671af];return _0x48f75a;};'use strict';var util=require(_0x908d('0x0'));var _=require('lodash');var moment=require(_0x908d('0x1'));function getSeconds(_0x488ec0,_0x1557c3){var _0x739218=moment(_0x488ec0)[_0x908d('0x2')](0x0);var _0x5228dd=moment(_0x1557c3)['milliseconds'](0x0);return _0x739218[_0x908d('0x3')](_0x5228dd,_0x908d('0x4'));}function Final(_0x1fa63e){this[_0x908d('0x5')]=_0x1fa63e[_0x908d('0x5')];this['scheduledat']=_0x1fa63e[_0x908d('0x6')];this[_0x908d('0x7')]=_0x1fa63e[_0x908d('0x7')];this[_0x908d('0x8')]=_0x1fa63e[_0x908d('0x7')]===_0x908d('0x9')?_0x908d('0xa'):_0x1fa63e[_0x908d('0x7')];this[_0x908d('0xb')]=_0x1fa63e[_0x908d('0xb')];this['countcongestionretry']=_0x1fa63e[_0x908d('0xc')];this[_0x908d('0xd')]=_0x1fa63e[_0x908d('0xd')];this[_0x908d('0xe')]=_0x1fa63e[_0x908d('0xb')]+_0x1fa63e['countcongestionretry']+_0x1fa63e['countnoanswerretry']+_0x1fa63e['countnosuchnumberretry']+_0x1fa63e[_0x908d('0xf')]+_0x1fa63e[_0x908d('0x10')]+_0x1fa63e[_0x908d('0x11')]+_0x1fa63e[_0x908d('0x12')];this[_0x908d('0x13')]=_0x1fa63e[_0x908d('0x13')];this[_0x908d('0xf')]=_0x1fa63e['countdropretry'];this['countabandonedretry']=_0x1fa63e[_0x908d('0x10')];this[_0x908d('0x11')]=_0x1fa63e[_0x908d('0x11')];this[_0x908d('0x12')]=_0x1fa63e['countagentrejectretry'];this['queue']=_0x1fa63e[_0x908d('0xa')];this[_0x908d('0x14')]=_0x1fa63e[_0x908d('0x14')];this[_0x908d('0x15')]=_0x1fa63e['calleridnum'];this[_0x908d('0x16')]=_0x1fa63e[_0x908d('0x16')];this[_0x908d('0x17')]=_0x1fa63e[_0x908d('0x17')];this[_0x908d('0x18')]=_0x1fa63e[_0x908d('0x17')];this[_0x908d('0x19')]=_0x1fa63e['ringtime']||0x0;this[_0x908d('0x1a')]=_0x1fa63e[_0x908d('0x1a')]||0x0;this[_0x908d('0x1b')]=_0x1fa63e['talktime']||0x0;this[_0x908d('0x1c')]=_0x1fa63e[_0x908d('0x1c')];this[_0x908d('0x1d')]=_0x1fa63e[_0x908d('0x1d')];this[_0x908d('0x1e')]=_0x1fa63e['callbackat'];this[_0x908d('0x1f')]=_0x1fa63e['recallme'];this[_0x908d('0x20')]=_0x1fa63e[_0x908d('0x20')];this[_0x908d('0x21')]=_0x1fa63e[_0x908d('0x21')];this[_0x908d('0x22')]=_0x1fa63e[_0x908d('0x22')];this[_0x908d('0x23')]=_0x1fa63e[_0x908d('0x23')];this['CampaignId']=_0x1fa63e[_0x908d('0x24')];this[_0x908d('0x25')]=_0x1fa63e[_0x908d('0x25')]||'';this[_0x908d('0x26')]=_0x1fa63e[_0x908d('0x26')]||'';}module['exports']=Final; \ No newline at end of file +var _0xc978=['UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x3efbff,_0x3d6b69){var _0x3997e8=function(_0x3b7ecd){while(--_0x3b7ecd){_0x3efbff['push'](_0x3efbff['shift']());}};_0x3997e8(++_0x3d6b69);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8c97('0x0'));var _=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));function getSeconds(_0x35f7e9,_0x371c48){var _0x44d4ea=moment(_0x35f7e9)['milliseconds'](0x0);var _0x23f5e9=moment(_0x371c48)[_0x8c97('0x3')](0x0);return _0x44d4ea[_0x8c97('0x4')](_0x23f5e9,_0x8c97('0x5'));}function Final(_0x426a77){this[_0x8c97('0x6')]=_0x426a77[_0x8c97('0x6')];this['scheduledat']=_0x426a77[_0x8c97('0x7')];this[_0x8c97('0x8')]=_0x426a77[_0x8c97('0x8')];this[_0x8c97('0x9')]=_0x426a77[_0x8c97('0x8')]===_0x8c97('0xa')?_0x8c97('0xb'):_0x426a77['type'];this[_0x8c97('0xc')]=_0x426a77[_0x8c97('0xc')];this[_0x8c97('0xd')]=_0x426a77[_0x8c97('0xd')];this[_0x8c97('0xe')]=_0x426a77[_0x8c97('0xe')];this[_0x8c97('0xf')]=_0x426a77[_0x8c97('0xc')]+_0x426a77[_0x8c97('0xd')]+_0x426a77['countnoanswerretry']+_0x426a77[_0x8c97('0x10')]+_0x426a77[_0x8c97('0x11')]+_0x426a77['countabandonedretry']+_0x426a77[_0x8c97('0x12')]+_0x426a77[_0x8c97('0x13')];this['countnosuchnumberretry']=_0x426a77[_0x8c97('0x10')];this['countdropretry']=_0x426a77['countdropretry'];this['countabandonedretry']=_0x426a77[_0x8c97('0x14')];this[_0x8c97('0x12')]=_0x426a77[_0x8c97('0x12')];this[_0x8c97('0x13')]=_0x426a77[_0x8c97('0x13')];this[_0x8c97('0xb')]=_0x426a77[_0x8c97('0xb')];this[_0x8c97('0x15')]=_0x426a77[_0x8c97('0x15')];this['calleridnum']=_0x426a77[_0x8c97('0x16')];this[_0x8c97('0x17')]=_0x426a77[_0x8c97('0x17')];this[_0x8c97('0x18')]=_0x426a77[_0x8c97('0x18')];this[_0x8c97('0x19')]=_0x426a77[_0x8c97('0x18')];this[_0x8c97('0x1a')]=_0x426a77[_0x8c97('0x1a')]||0x0;this[_0x8c97('0x1b')]=_0x426a77[_0x8c97('0x1b')]||0x0;this[_0x8c97('0x1c')]=_0x426a77[_0x8c97('0x1c')]||0x0;this[_0x8c97('0x1d')]=_0x426a77[_0x8c97('0x1d')];this[_0x8c97('0x1e')]=_0x426a77['callbackuniqueid'];this[_0x8c97('0x1f')]=_0x426a77[_0x8c97('0x1f')];this[_0x8c97('0x20')]=_0x426a77['recallme'];this['ContactId']=_0x426a77[_0x8c97('0x21')];this['ListId']=_0x426a77[_0x8c97('0x22')];this[_0x8c97('0x23')]=_0x426a77[_0x8c97('0x23')];this[_0x8c97('0x24')]=_0x426a77[_0x8c97('0x24')];this[_0x8c97('0x25')]=_0x426a77[_0x8c97('0x25')];this['originatecalleridnum']=_0x426a77['originatecalleridnum']||'';this[_0x8c97('0x26')]=_0x426a77[_0x8c97('0x26')]||'';}module[_0x8c97('0x27')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index f1be712..db90b8c 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc17b=['countabandonedretry','countmachineretry','uniqueid','name','number','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry'];(function(_0x118b5f,_0x68d69c){var _0x3d9b6f=function(_0x3b04b0){while(--_0x3b04b0){_0x118b5f['push'](_0x118b5f['shift']());}};_0x3d9b6f(++_0x68d69c);}(_0xc17b,0x96));var _0xbc17=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc17b[_0x4f9b18];return _0x29f20c;};'use strict';var util=require(_0xbc17('0x0'));var _=require(_0xbc17('0x1'));var moment=require(_0xbc17('0x2'));function getSeconds(_0x2f6a17,_0x2734a5){var _0x394801=moment(_0x2f6a17)[_0xbc17('0x3')](0x0);var _0x2b25d8=moment(_0x2734a5)['milliseconds'](0x0);return _0x394801[_0xbc17('0x4')](_0x2b25d8,_0xbc17('0x5'));}function Hangup(_0x128c5c,_0x13aac4){this[_0xbc17('0x6')]=0x4;this[_0xbc17('0x7')]=_0xbc17('0x8');this[_0xbc17('0x9')]=_0x128c5c[_0xbc17('0x9')];this[_0xbc17('0xa')]=_0x128c5c[_0xbc17('0xa')];this[_0xbc17('0xb')]=_0x128c5c['type']==='outbound'?'queue':_0x128c5c['type'];this[_0xbc17('0xc')]=_0x128c5c['countbusyretry'];this[_0xbc17('0xd')]=_0x128c5c['countcongestionretry'];this[_0xbc17('0xe')]=_0x128c5c[_0xbc17('0xe')];this['countglobal']=_0x128c5c[_0xbc17('0xc')]+_0x128c5c[_0xbc17('0xd')]+_0x128c5c['countnoanswerretry']+_0x128c5c[_0xbc17('0xf')]+_0x128c5c[_0xbc17('0x10')]+_0x128c5c['countabandonedretry']+_0x128c5c['countmachineretry']+_0x128c5c[_0xbc17('0x11')];this['countnosuchnumberretry']=_0x128c5c[_0xbc17('0xf')];this['countdropretry']=_0x128c5c[_0xbc17('0x10')];this[_0xbc17('0x12')]=_0x128c5c[_0xbc17('0x12')];this['countmachineretry']=_0x128c5c[_0xbc17('0x13')];this['countagentrejectretry']=_0x128c5c['countagentrejectretry'];this[_0xbc17('0x14')]=_0x13aac4['uniqueid'];this['calleridname']=_0x128c5c[_0xbc17('0x15')];this['calleridnum']=_0x128c5c[_0xbc17('0x16')];this['starttime']=_0x128c5c[_0xbc17('0x17')];this['responsetime']=_0x128c5c['responsetime'];this[_0xbc17('0x18')]=moment()['format'](_0xbc17('0x19'));this[_0xbc17('0x1a')]=getSeconds(_0x128c5c[_0xbc17('0x1b')],_0x128c5c['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this['endtime'],_0x128c5c[_0xbc17('0x1b')]);this['queue']=_0x128c5c['queue'];this[_0xbc17('0x1c')]=_0xbc17('0x1d');this[_0xbc17('0x1e')]=_0x13aac4[_0xbc17('0x1f')];this['callback']=_0x128c5c[_0xbc17('0x20')];this[_0xbc17('0x21')]=_0x128c5c[_0xbc17('0x21')];this[_0xbc17('0x22')]=_0x128c5c[_0xbc17('0x22')];this[_0xbc17('0x23')]=_0x128c5c[_0xbc17('0x23')];this[_0xbc17('0x24')]=_0x128c5c[_0xbc17('0x24')];this[_0xbc17('0x25')]=_0x128c5c[_0xbc17('0x25')];this[_0xbc17('0x26')]=_0x128c5c[_0xbc17('0x26')];this[_0xbc17('0x27')]=_0x128c5c['VoiceQueueId'];this['CampaignId']=_0x128c5c[_0xbc17('0x28')];}module[_0xbc17('0x29')]=Hangup; \ No newline at end of file +var _0xf598=['queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x556ef1,_0x3bd90d){var _0x1b519b=function(_0x51f3e9){while(--_0x51f3e9){_0x556ef1['push'](_0x556ef1['shift']());}};_0x1b519b(++_0x3bd90d);}(_0xf598,0x1d7));var _0x8f59=function(_0x2f9d9c,_0x4f50a0){_0x2f9d9c=_0x2f9d9c-0x0;var _0x3d3acb=_0xf598[_0x2f9d9c];return _0x3d3acb;};'use strict';var util=require(_0x8f59('0x0'));var _=require(_0x8f59('0x1'));var moment=require(_0x8f59('0x2'));function getSeconds(_0x2a8091,_0x59f91c){var _0x5741c2=moment(_0x2a8091)[_0x8f59('0x3')](0x0);var _0x3049c0=moment(_0x59f91c)[_0x8f59('0x3')](0x0);return _0x5741c2[_0x8f59('0x4')](_0x3049c0,_0x8f59('0x5'));}function Hangup(_0x3fce24,_0x49a544){this[_0x8f59('0x6')]=0x4;this[_0x8f59('0x7')]=_0x8f59('0x8');this[_0x8f59('0x9')]=_0x3fce24[_0x8f59('0x9')];this['type']=_0x3fce24[_0x8f59('0xa')];this[_0x8f59('0xb')]=_0x3fce24[_0x8f59('0xa')]===_0x8f59('0xc')?_0x8f59('0xd'):_0x3fce24[_0x8f59('0xa')];this[_0x8f59('0xe')]=_0x3fce24[_0x8f59('0xe')];this['countcongestionretry']=_0x3fce24[_0x8f59('0xf')];this['countnoanswerretry']=_0x3fce24['countnoanswerretry'];this[_0x8f59('0x10')]=_0x3fce24['countbusyretry']+_0x3fce24[_0x8f59('0xf')]+_0x3fce24[_0x8f59('0x11')]+_0x3fce24[_0x8f59('0x12')]+_0x3fce24[_0x8f59('0x13')]+_0x3fce24['countabandonedretry']+_0x3fce24['countmachineretry']+_0x3fce24[_0x8f59('0x14')];this[_0x8f59('0x12')]=_0x3fce24[_0x8f59('0x12')];this[_0x8f59('0x13')]=_0x3fce24[_0x8f59('0x13')];this[_0x8f59('0x15')]=_0x3fce24[_0x8f59('0x15')];this[_0x8f59('0x16')]=_0x3fce24['countmachineretry'];this[_0x8f59('0x14')]=_0x3fce24[_0x8f59('0x14')];this[_0x8f59('0x17')]=_0x49a544[_0x8f59('0x17')];this['calleridname']=_0x3fce24[_0x8f59('0x18')];this[_0x8f59('0x19')]=_0x3fce24[_0x8f59('0x1a')];this[_0x8f59('0x1b')]=_0x3fce24['starttime'];this[_0x8f59('0x1c')]=_0x3fce24[_0x8f59('0x1c')];this[_0x8f59('0x1d')]=moment()['format'](_0x8f59('0x1e'));this[_0x8f59('0x1f')]=getSeconds(_0x3fce24[_0x8f59('0x1c')],_0x3fce24['starttime']);this['holdtime']=0x0;this[_0x8f59('0x20')]=getSeconds(this[_0x8f59('0x1d')],_0x3fce24[_0x8f59('0x1c')]);this['queue']=_0x3fce24[_0x8f59('0xd')];this[_0x8f59('0x21')]=_0x8f59('0x22');this[_0x8f59('0x23')]=_0x49a544[_0x8f59('0x24')];this[_0x8f59('0x25')]=_0x3fce24[_0x8f59('0x25')];this['callbackuniqueid']=_0x3fce24['callbackuniqueid'];this[_0x8f59('0x26')]=_0x3fce24[_0x8f59('0x26')];this['recallme']=_0x3fce24['recallme'];this[_0x8f59('0x27')]=_0x3fce24[_0x8f59('0x27')];this['ListId']=_0x3fce24['ListId'];this[_0x8f59('0x28')]=_0x3fce24[_0x8f59('0x28')];this['VoiceQueueId']=_0x3fce24[_0x8f59('0x29')];this['CampaignId']=_0x3fce24[_0x8f59('0x2a')];}module[_0x8f59('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index ac2f8ac..c2df813 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a9f=['originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','calleridname','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3a9f,0x131));var _0xf3a9=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x3a9f[_0x246115];return _0x385878;};'use strict';var util=require(_0xf3a9('0x0'));var _=require(_0xf3a9('0x1'));var moment=require(_0xf3a9('0x2'));function getSeconds(_0x469f77,_0x1428b7){var _0x22ed53=moment(_0x469f77)[_0xf3a9('0x3')](0x0);var _0xa99a94=moment(_0x1428b7)[_0xf3a9('0x3')](0x0);return _0x22ed53[_0xf3a9('0x4')](_0xa99a94,_0xf3a9('0x5'));}function History(_0x1d35d3){this[_0xf3a9('0x6')]=_0x1d35d3[_0xf3a9('0x6')];this[_0xf3a9('0x7')]=_0x1d35d3[_0xf3a9('0x7')]||undefined;this[_0xf3a9('0x8')]=_0x1d35d3[_0xf3a9('0x8')];this['campaigntype']=_0x1d35d3[_0xf3a9('0x8')]===_0xf3a9('0x9')?_0xf3a9('0xa'):_0x1d35d3['type'];this['countbusyretry']=_0x1d35d3[_0xf3a9('0xb')];this[_0xf3a9('0xc')]=_0x1d35d3['countcongestionretry'];this[_0xf3a9('0xd')]=_0x1d35d3[_0xf3a9('0xd')];this[_0xf3a9('0xe')]=_0x1d35d3[_0xf3a9('0xb')]+_0x1d35d3[_0xf3a9('0xc')]+_0x1d35d3[_0xf3a9('0xd')]+_0x1d35d3['countnosuchnumberretry']+_0x1d35d3[_0xf3a9('0xf')]+_0x1d35d3['countabandonedretry']+_0x1d35d3['countmachineretry']+_0x1d35d3[_0xf3a9('0x10')];this[_0xf3a9('0x11')]=_0x1d35d3[_0xf3a9('0x11')];this[_0xf3a9('0xf')]=_0x1d35d3['countdropretry'];this[_0xf3a9('0x12')]=_0x1d35d3['countabandonedretry'];this[_0xf3a9('0x13')]=_0x1d35d3['countmachineretry'];this[_0xf3a9('0x10')]=_0x1d35d3['countagentrejectretry'];this[_0xf3a9('0xa')]=_0x1d35d3['queue'];this[_0xf3a9('0x14')]=_0x1d35d3['name'];this[_0xf3a9('0x15')]=_0x1d35d3[_0xf3a9('0x16')];this[_0xf3a9('0x17')]=_0x1d35d3['starttime'];this[_0xf3a9('0x18')]=_0x1d35d3[_0xf3a9('0x18')];this['endtime']=_0x1d35d3['responsetime'];this['ringtime']=getSeconds(_0x1d35d3[_0xf3a9('0x18')],_0x1d35d3[_0xf3a9('0x17')]);this[_0xf3a9('0x19')]=0x0;this[_0xf3a9('0x1a')]=0x0;this[_0xf3a9('0x1b')]=_0x1d35d3[_0xf3a9('0x1b')];this['callbackuniqueid']=_0x1d35d3[_0xf3a9('0x1c')];this[_0xf3a9('0x1d')]=_0x1d35d3[_0xf3a9('0x1d')];this[_0xf3a9('0x1e')]=_0x1d35d3['recallme'];this['ContactId']=_0x1d35d3[_0xf3a9('0x1f')];this[_0xf3a9('0x20')]=_0x1d35d3[_0xf3a9('0x20')];this[_0xf3a9('0x21')]=_0x1d35d3[_0xf3a9('0x21')];this[_0xf3a9('0x22')]=_0x1d35d3[_0xf3a9('0x22')];this[_0xf3a9('0x23')]=_0x1d35d3[_0xf3a9('0x23')];this[_0xf3a9('0x24')]=_0x1d35d3['originatecalleridnum']||'';this[_0xf3a9('0x25')]=_0x1d35d3[_0xf3a9('0x25')]||'';}module['exports']=History; \ No newline at end of file +var _0x527c=['calleridname','calleridnum','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','queue'];(function(_0x3611cd,_0x5b2b47){var _0x58d809=function(_0xc1e519){while(--_0xc1e519){_0x3611cd['push'](_0x3611cd['shift']());}};_0x58d809(++_0x5b2b47);}(_0x527c,0x15f));var _0xc527=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0x527c[_0x34ecbf];return _0x115f8a;};'use strict';var util=require(_0xc527('0x0'));var _=require(_0xc527('0x1'));var moment=require('moment');function getSeconds(_0x8f9a33,_0xaca864){var _0x4928d4=moment(_0x8f9a33)[_0xc527('0x2')](0x0);var _0x5b55e9=moment(_0xaca864)[_0xc527('0x2')](0x0);return _0x4928d4['diff'](_0x5b55e9,_0xc527('0x3'));}function History(_0x24c3ea){this[_0xc527('0x4')]=_0x24c3ea[_0xc527('0x4')];this[_0xc527('0x5')]=_0x24c3ea[_0xc527('0x5')]||undefined;this[_0xc527('0x6')]=_0x24c3ea[_0xc527('0x6')];this[_0xc527('0x7')]=_0x24c3ea[_0xc527('0x6')]===_0xc527('0x8')?'queue':_0x24c3ea['type'];this['countbusyretry']=_0x24c3ea['countbusyretry'];this[_0xc527('0x9')]=_0x24c3ea[_0xc527('0x9')];this[_0xc527('0xa')]=_0x24c3ea['countnoanswerretry'];this[_0xc527('0xb')]=_0x24c3ea[_0xc527('0xc')]+_0x24c3ea[_0xc527('0x9')]+_0x24c3ea['countnoanswerretry']+_0x24c3ea['countnosuchnumberretry']+_0x24c3ea[_0xc527('0xd')]+_0x24c3ea['countabandonedretry']+_0x24c3ea[_0xc527('0xe')]+_0x24c3ea[_0xc527('0xf')];this[_0xc527('0x10')]=_0x24c3ea['countnosuchnumberretry'];this[_0xc527('0xd')]=_0x24c3ea[_0xc527('0xd')];this[_0xc527('0x11')]=_0x24c3ea[_0xc527('0x11')];this['countmachineretry']=_0x24c3ea['countmachineretry'];this[_0xc527('0xf')]=_0x24c3ea[_0xc527('0xf')];this[_0xc527('0x12')]=_0x24c3ea[_0xc527('0x12')];this[_0xc527('0x13')]=_0x24c3ea['name'];this[_0xc527('0x14')]=_0x24c3ea['number'];this[_0xc527('0x15')]=_0x24c3ea[_0xc527('0x15')];this[_0xc527('0x16')]=_0x24c3ea[_0xc527('0x16')];this['endtime']=_0x24c3ea[_0xc527('0x16')];this['ringtime']=getSeconds(_0x24c3ea[_0xc527('0x16')],_0x24c3ea['starttime']);this[_0xc527('0x17')]=0x0;this[_0xc527('0x18')]=0x0;this[_0xc527('0x19')]=_0x24c3ea[_0xc527('0x19')];this[_0xc527('0x1a')]=_0x24c3ea[_0xc527('0x1a')];this[_0xc527('0x1b')]=_0x24c3ea[_0xc527('0x1b')];this[_0xc527('0x1c')]=_0x24c3ea[_0xc527('0x1c')];this['ContactId']=_0x24c3ea[_0xc527('0x1d')];this[_0xc527('0x1e')]=_0x24c3ea[_0xc527('0x1e')];this[_0xc527('0x1f')]=_0x24c3ea[_0xc527('0x1f')];this['VoiceQueueId']=_0x24c3ea[_0xc527('0x20')];this[_0xc527('0x21')]=_0x24c3ea[_0xc527('0x21')];this[_0xc527('0x22')]=_0x24c3ea[_0xc527('0x22')]||'';this[_0xc527('0x23')]=_0x24c3ea[_0xc527('0x23')]||'';}module[_0xc527('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 8d7857c..7443960 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 _0x6324=['pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','trunks','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','emit','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','buildObj','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr]','countnosuchnumberretry','countabandonedretry','reason\x2019\x20machine....','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','[syncHangupIvr]','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','countglobal','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','rrmemory','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','preview','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','loopCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','INTERVAL_IS_NULL','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','Failure','isArray','iftime\x20%s,%s','interval','indexOf','true','content','all','some','INTERVAL_IS_OVERTIME','Global:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','launchHandleIvr','dialActive','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','phone','Contact','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','bluebird','uuid','md5','../preview/util/util','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','Interval','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','diff','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb'];(function(_0x7d36ed,_0x334f35){var _0x3768b3=function(_0x23bc60){while(--_0x23bc60){_0x7d36ed['push'](_0x7d36ed['shift']());}};_0x3768b3(++_0x334f35);}(_0x6324,0x142));var _0x4632=function(_0x7c7a41,_0x11a170){_0x7c7a41=_0x7c7a41-0x0;var _0x5c09d3=_0x6324[_0x7c7a41];return _0x5c09d3;};'use strict';var util=require(_0x4632('0x0'));var _=require(_0x4632('0x1'));var BPromise=require(_0x4632('0x2'));var uuid=require(_0x4632('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x4632('0x4'));var Redis=require('ioredis');var ut=require(_0x4632('0x5'));var config=require('../../../config/environment/');var logger=require(_0x4632('0x6'))('dialer');var loggerBooked=require(_0x4632('0x6'))(_0x4632('0x7'));var loggerPredictive=require(_0x4632('0x6'))(_0x4632('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x4632('0x9'));var loggerSyncQueueSummary=require(_0x4632('0x6'))(_0x4632('0xa'));var ami=require('../ami');config[_0x4632('0xb')]=_[_0x4632('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4632('0xd'))(new Redis(config[_0x4632('0xb')]));var cmHopper=require(_0x4632('0xe'));var cmHopperHistory=require(_0x4632('0xf'));var cmHopperBlack=require(_0x4632('0x10'));var voiceQueueRt=require(_0x4632('0x11'));var Action=require(_0x4632('0x12'));var History=require(_0x4632('0x13'));var Final=require('./final');var AgentComplete=require(_0x4632('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x4632('0x15'));var ipAgi=process[_0x4632('0x16')][_0x4632('0x17')]||_0x4632('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0x4632('0x19')};var Sequence=function(){};Sequence[_0x4632('0x1a')][_0x4632('0x1b')]=function(_0x37d798){this[_0x4632('0x1c')]=this['tail']?this['tail'][_0x4632('0x1d')](_0x37d798):_0x37d798();};function Dialer(_0x38bedd,_0x2bcfa3){this[_0x4632('0x1e')]=new Sequence();this['preview']=_0x2bcfa3;this[_0x4632('0x1f')]=_0x38bedd[_0x4632('0x1f')];this[_0x4632('0x20')]=_0x38bedd['campaigns'];this[_0x4632('0x21')]=_0x38bedd[_0x4632('0x21')];this['trunks']=_0x38bedd['trunks'];this[_0x4632('0x22')]=config[_0x4632('0x22')]||0x2;this[_0x4632('0x23')]={};this[_0x4632('0x24')]={};this[_0x4632('0x25')]={};this[_0x4632('0x26')]={};this[_0x4632('0x27')]={};this[_0x4632('0x28')]={};this[_0x4632('0x29')]={};this[_0x4632('0x2a')]={};this[_0x4632('0x2b')]={};this[_0x4632('0x2c')]={};ami['on'](_0x4632('0x2d'),this[_0x4632('0x2e')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x30'),this[_0x4632('0x31')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x32'),this[_0x4632('0x33')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x34'),this[_0x4632('0x35')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x36'),this[_0x4632('0xa')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x37'),this[_0x4632('0x38')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x39'),this[_0x4632('0x3a')][_0x4632('0x2f')](this));ami['on']('varset',this['syncVarSet'][_0x4632('0x2f')](this));ami['on'](_0x4632('0x3b'),this[_0x4632('0x3c')][_0x4632('0x2f')](this));ami['on'](_0x4632('0x3d'),this[_0x4632('0x3e')][_0x4632('0x2f')](this));this['loopCampaigns']();this[_0x4632('0x3f')]();}function isNotNull(_0x135fd2){return _0x135fd2!==null&&!_['isUndefined'](_0x135fd2);}function checkIsLoggedIn(_0x216119,_0x5316f7){return function(){if(_0x5316f7<=0x0){_0x216119[_0x4632('0x40')]='AGENTS_NOT_LOGGED';throw _0x216119['name']+_0x4632('0x41');}};}function isActive(_0x1cd26a){return _0x1cd26a;}function checkIsActive(_0x3fe812,_0x4ebf94){return function(){if(!isActive(_0x4ebf94)){_0x3fe812['message']=_0x4632('0x42');throw _0x3fe812[_0x4632('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4aab76){return function(){if(!isNotNull(_0x4aab76[_0x4632('0x44')])){_0x4aab76[_0x4632('0x40')]='INTERVAL_IS_NULL';throw _0x4aab76[_0x4632('0x43')]+_0x4632('0x45');}if(!isNotNull(_0x4aab76[_0x4632('0x44')][_0x4632('0x46')])){_0x4aab76[_0x4632('0x40')]='INTERVAL_IS_NULL';throw _0x4aab76[_0x4632('0x43')]+_0x4632('0x45');}if(!isNotNull(_['isEmpty'](_0x4aab76['Interval'][_0x4632('0x46')]))){_0x4aab76['message']='INTERVAL_IS_NULL';throw _0x4aab76[_0x4632('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x318416,_0x468735,_0x305079){return{'action':_0x318416,'response':_0x468735,'message':_0x305079,'stack':_0x305079};}function myreject(_0x52dd7f){return function(_0x4d091b){return _0x52dd7f(msgResponse(_0x4632('0x47'),_0x4632('0x48'),JSON[_0x4632('0x49')](_0x4d091b)));};}function getSeconds(_0x37c4d0,_0x5d20f9){var _0x486f6c=moment(_0x37c4d0)[_0x4632('0x4a')](0x0);var _0xd90c7c=moment(_0x5d20f9)[_0x4632('0x4a')](0x0);return _0x486f6c['diff'](_0xd90c7c,'seconds');}function emit(_0x53b436,_0x405308,_0x393ef2){io['to'](_0x53b436)['emit'](_0x405308,_0x393ef2);}function emitVoiceQueueSummary(_0x3809aa){if(_0x3809aa[_0x4632('0x4b')]===_0x4632('0x4c')){var _0x3adf41={'id':_0x3809aa['id'],'name':_0x3809aa[_0x4632('0x43')],'strategy':_0x3809aa[_0x4632('0x4d')],'answered':_0x3809aa[_0x4632('0x4e')],'available':_0x3809aa[_0x4632('0x4f')],'loggedIn':_0x3809aa[_0x4632('0x50')],'pTalking':_0x3809aa[_0x4632('0x51')],'sumBillable':_0x3809aa[_0x4632('0x52')],'sumDuration':_0x3809aa[_0x4632('0x53')],'sumHoldTime':_0x3809aa['sumHoldTime']||0x0,'talking':_0x3809aa[_0x4632('0x54')],'total':_0x3809aa[_0x4632('0x55')],'type':_0x3809aa['type'],'unmanaged':_0x3809aa[_0x4632('0x56')],'abandoned':_0x3809aa[_0x4632('0x57')],'waiting':_0x3809aa['waiting'],'loggedInDb':_0x3809aa[_0x4632('0x58')],'dialActive':_0x3809aa['dialActive'],'dialMethod':_0x3809aa[_0x4632('0x59')],'dialOriginateCallerIdName':_0x3809aa[_0x4632('0x5a')],'dialOriginateCallerIdNumber':_0x3809aa[_0x4632('0x5b')],'dialOriginateTimeout':_0x3809aa[_0x4632('0x5c')],'dialPrefix':_0x3809aa['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3809aa[_0x4632('0x5d')],'outboundAnswerCallsDay':_0x3809aa[_0x4632('0x5e')],'outboundBlacklistCallsDay':_0x3809aa[_0x4632('0x5f')],'outboundBusyCallsDay':_0x3809aa[_0x4632('0x60')],'outboundCongestionCallsDay':_0x3809aa['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3809aa['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3809aa[_0x4632('0x61')],'outboundDropCallsDayTimeout':_0x3809aa[_0x4632('0x62')],'outboundNoAnswerCallsDay':_0x3809aa[_0x4632('0x63')],'outboundNoSuchCallsDay':_0x3809aa['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3809aa[_0x4632('0x64')],'outboundReCallsDay':_0x3809aa[_0x4632('0x65')],'outboundRejectCallsDay':_0x3809aa[_0x4632('0x66')],'outboundUnknownCallsDay':_0x3809aa[_0x4632('0x67')],'predictiveIntervalAnsweredCalls':_0x3809aa[_0x4632('0x68')],'predictiveIntervalAvgHoldtime':_0x3809aa[_0x4632('0x69')],'predictiveIntervalAvgTalktime':_0x3809aa[_0x4632('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x3809aa['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3809aa[_0x4632('0x6b')],'predictiveIntervalErlangCalls':_0x3809aa[_0x4632('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x3809aa[_0x4632('0x6d')],'predictiveIntervalHitRate':_0x3809aa[_0x4632('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x3809aa[_0x4632('0x6f')],'predictiveIntervalPauses':_0x3809aa['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3809aa['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3809aa[_0x4632('0x70')],'message':_0x3809aa[_0x4632('0x40')],'originated':_0x3809aa[_0x4632('0x71')],'erlangCalls':_0x3809aa[_0x4632('0x72')],'erlangCallToSecond':_0x3809aa['erlangCallToSecond'],'erlangAbandonmentRate':_0x3809aa[_0x4632('0x73')],'erlangBusyFactor':_0x3809aa[_0x4632('0x74')],'startPredictive':_0x3809aa[_0x4632('0x28')],'startProgressive':_0x3809aa[_0x4632('0x29')]};if(_0x3809aa[_0x4632('0x75')]){_0x3adf41['Trunk']={'id':_0x3809aa[_0x4632('0x75')]['id'],'name':_0x3809aa[_0x4632('0x75')][_0x4632('0x43')],'active':_0x3809aa[_0x4632('0x75')][_0x4632('0x76')],'callerid':_0x3809aa[_0x4632('0x75')][_0x4632('0x77')]};}if(_0x3809aa[_0x4632('0x44')]){_0x3adf41[_0x4632('0x44')]={'id':_0x3809aa[_0x4632('0x44')]['id'],'name':_0x3809aa[_0x4632('0x44')]['name']};}var _0xc3ffd0=md5(JSON[_0x4632('0x49')](_0x3adf41));if(_0x3809aa[_0x4632('0x4')]!==_0xc3ffd0){_0x3809aa['md5']=_0xc3ffd0;emit(util[_0x4632('0x78')](_0x4632('0x79'),_0x3adf41[_0x4632('0x43')]),_0x4632('0x7a'),_0x3adf41);}}}function emitCampaignSummary(_0xa681e9){if(_0xa681e9[_0x4632('0x4b')]===_0x4632('0x7b')){emit(util[_0x4632('0x78')](_0x4632('0x7c'),_0xa681e9[_0x4632('0x43')]),'campaign:save',_0xa681e9);}}function checkGetDataPredictive(_0x35afe5){if(isNotNull(_0x35afe5)&&!_[_0x4632('0x7d')](_0x35afe5)){loggerPredictive['info'](_0x4632('0x7e'));loggerPredictive[_0x4632('0x7f')](_0x4632('0x80'),_0x35afe5[_0x4632('0x70')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x81'),_0x35afe5[_0x4632('0x68')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x82'),_0x35afe5[_0x4632('0x6b')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x83'),_0x35afe5[_0x4632('0x84')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x85'),_0x35afe5[_0x4632('0x69')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x86'),_0x35afe5[_0x4632('0x6a')]);loggerPredictive[_0x4632('0x7f')]('---------------------------');if(_0x35afe5[_0x4632('0x70')]>0x0){if(!_[_0x4632('0x87')](_0x35afe5[_0x4632('0x6a')])&&_0x35afe5[_0x4632('0x6a')]>0x0){return!![];}loggerPredictive[_0x4632('0x7f')](_0x4632('0x88'));if(!_['isUndefined'](_0x35afe5[_0x4632('0x69')])&&_0x35afe5[_0x4632('0x69')]>0x0){return!![];}loggerPredictive[_0x4632('0x7f')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x4632('0x7f')](_0x4632('0x89'));}}else{loggerPredictive['info'](_0x4632('0x8a'));}return![];}function mergeDataErlangB(_0x1aa4f0){return function(_0x3bfebd){loggerPredictive['info'](_0x4632('0x8b'));loggerPredictive[_0x4632('0x7f')](_0x4632('0x8c'),_0x3bfebd[_0x4632('0x72')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x8d'),_0x3bfebd[_0x4632('0x8e')]);loggerPredictive[_0x4632('0x7f')](_0x4632('0x8f'),_0x3bfebd[_0x4632('0x73')]);loggerPredictive['info'](_0x4632('0x90'),_0x3bfebd[_0x4632('0x74')]);loggerPredictive['info'](_0x4632('0x8f'),_0x3bfebd['erlangAbandonmentRate']);loggerPredictive['info'](_0x4632('0x91'));_[_0x4632('0x92')](_0x1aa4f0,_0x3bfebd);};}function getDiff(_0x2451ba){var _0xd89124=moment()[_0x4632('0x4a')](0x0);var _0x433dac=moment(_0x2451ba)[_0x4632('0x4a')](0x0);return _0xd89124[_0x4632('0x93')](_0x433dac,_0x4632('0x94'));}function ifInterval(_0x2eacee,_0x1c321f){if(_[_0x4632('0x87')](_0x1c321f)){return![];}return getDiff(_0x1c321f)<_0x2eacee*0x3c;}function freeVariablesPredictive(_0x3d7417){if(isNotNull(_0x3d7417)){if(!_[_0x4632('0x87')](_0x3d7417['startProgressive'])){_0x3d7417['startProgressive']=undefined;loggerPredictive[_0x4632('0x7f')](_0x3d7417[_0x4632('0x43')],_0x4632('0x95'));}if(!_[_0x4632('0x87')](_0x3d7417[_0x4632('0x28')])){_0x3d7417[_0x4632('0x28')]=undefined;loggerPredictive['info'](_0x3d7417[_0x4632('0x43')],_0x4632('0x96'));}if(!_[_0x4632('0x87')](_0x3d7417[_0x4632('0x97')])){clearInterval(_0x3d7417['handlePredictive']);_0x3d7417['handlePredictive']=undefined;loggerPredictive[_0x4632('0x7f')](_0x3d7417['name'],_0x4632('0x98'));}}}function erlangb(_0x263f11,_0xc86476){if(_0xc86476===0x0){return 0x0;}var _0x35143e=0x1;for(var _0xc5515f=0x1;_0xc5515f<=_0xc86476;_0xc5515f+=0x1){_0x35143e=0x1+_0x35143e*_0xc5515f/_0x263f11;}return 0x1/_0x35143e;}function isVoiceQueueOutbound(_0x5e5669){return _0x5e5669===_0x4632('0x4c');}function isNotPreview(_0x1cd108){return _0x1cd108!=='preview';}function isCampaignIvr(_0x57bca2){return _0x57bca2===_0x4632('0x7b');}function getCallerId(_0x1375f6,_0x47391f,_0x3090d6){if(!_['isUndefined'](_0x3090d6)&&typeof _0x3090d6==='string'&&!_['isEmpty'](_0x3090d6)){if(!_[_0x4632('0x87')](_0x47391f)&&typeof _0x47391f==='string'&&!_[_0x4632('0x7d')](_0x47391f)){return util[_0x4632('0x78')](_0x4632('0x99'),_0x47391f,_0x3090d6);}return util[_0x4632('0x78')](_0x4632('0x99'),_0x3090d6,_0x3090d6);}if(!_[_0x4632('0x87')](_0x1375f6)&&typeof _0x1375f6===_0x4632('0x9a')&&!_[_0x4632('0x7d')](_0x1375f6)){return _0x1375f6;}return _0x4632('0x9b');}function loggerCatchQueueSummary(_0x321969,_0x1dbba9){return function(_0x2b4c83){freeVariablesPredictive(_0x1dbba9);emitVoiceQueueSummary(_0x1dbba9);emitCampaignSummary(_0x1dbba9);loggerSyncQueueSummary[_0x4632('0x9c')](_0x321969,util[_0x4632('0x9d')](_0x2b4c83,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x461700,_0x1b2905){return function(_0x550c4d){loggerPredictive[_0x4632('0x9c')](_0x1b2905[_0x4632('0x43')],_0x461700);loggerPredictive[_0x4632('0x9c')](_0x550c4d[_0x4632('0x9e')]);freeVariablesPredictive(_0x1b2905);};}function loggerCatch(_0x1e0948){return function(_0x273a0d){logger[_0x4632('0x9c')](_0x1e0948,util[_0x4632('0x9d')](_0x273a0d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x22b2a2){return _0x22b2a2&&!_[_0x4632('0x87')](_0x22b2a2)&&_0x22b2a2[_0x4632('0x9f')]>0x0;}function decremetOriginate(_0x1cc209){if(!_[_0x4632('0x87')](_0x1cc209)&&_0x1cc209!==null){if(typeof _0x1cc209['originated']!==_0x4632('0xa0')){if(_0x1cc209[_0x4632('0x71')]>0x0){_0x1cc209[_0x4632('0x71')]-=0x1;}else{logger[_0x4632('0x9c')](_0x4632('0xa1'));}}}else{logger[_0x4632('0x9c')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xd78b1f,_0x11161a,_0x484f28){if(_0x11161a>_0x484f28){for(var _0x35778a=0x0;_0x35778a<_0x11161a-_0x484f28;_0x35778a+=0x1){decremetOriginate(_0xd78b1f);}}}function loggerGetContactDialer(_0x458688,_0x879c8,_0x182b19){return function(_0x41f4d3){checkContactLowerLimitOriginate(_0x879c8,_0x182b19,0x0);logger['error'](_0x458688,util[_0x4632('0x9d')](_0x41f4d3,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x340720){return function(_0x3def00){if(isNotNull(_0x3def00)&&isNotNull(_0x3def00[0x0])){if(_0x3def00[0x0]['contactsRescheduled']>0x0){_0x340720[_0x4632('0x40')]=_0x4632('0xa2');logger[_0x4632('0x7f')](_0x4632('0xa3')+_0x340720[_0x4632('0x43')],_0x3def00[0x0][_0x4632('0xa4')],_0x4632('0xa5'));}else{_0x340720[_0x4632('0x40')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4632('0x7f')](_0x4632('0xa6')+_0x340720[_0x4632('0x43')]);}}};}function notSendMessagesQueue(_0x525bf9){if(_0x525bf9[_0x4632('0xa7')]){freeVariablesPredictive(_0x525bf9);if(_0x525bf9[_0x4632('0x71')]===0x0&&_0x525bf9['talking']===0x0&&_0x525bf9['waiting']===0x0&&(_0x525bf9[_0x4632('0x51')]||0x0)===0x0){_0x525bf9[_0x4632('0xa7')]=![];_0x525bf9['available']=0x0;_0x525bf9[_0x4632('0x40')]=_0x4632('0x42');loggerSyncQueueSummary[_0x4632('0x9c')](_0x4632('0xa8'),_0x525bf9[_0x4632('0x43')],_0x4632('0xa9'));}else{_0x525bf9[_0x4632('0x40')]=_0x4632('0xaa');loggerSyncQueueSummary['error'](_0x4632('0xa8'),_0x525bf9[_0x4632('0x43')],_0x4632('0xab'));}emitVoiceQueueSummary(_0x525bf9);}}function notSendMessagesCampaign(_0x16085e){if(_0x16085e['sendMessageOneNotActive']){if(_0x16085e[_0x4632('0x71')]===0x0){_0x16085e[_0x4632('0xa7')]=![];_0x16085e[_0x4632('0x40')]=_0x4632('0x42');loggerSyncQueueSummary[_0x4632('0x9c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x16085e[_0x4632('0x43')],_0x4632('0xa9'));}else{_0x16085e[_0x4632('0x40')]=_0x4632('0xaa');loggerSyncQueueSummary[_0x4632('0x9c')](_0x4632('0xac'),_0x16085e[_0x4632('0x43')],_0x4632('0xab'));}emitCampaignSummary(_0x16085e);}}function createObjHistory(_0x56a39b,_0x2afed6,_0x40cc33,_0x44f95d,_0x96fa74){_0x56a39b[_0x4632('0x40')]=_0x40cc33;var _0x3a2560=new Action(_0x56a39b,_0x2afed6);var _0x4c638c=new History(_0x3a2560);_0x4c638c[_0x4632('0xad')]=_0x44f95d;_0x4c638c[_0x4632('0xae')]=_0x96fa74;_0x4c638c[_0x4632('0xaf')]=_0x3a2560[_0x4632('0xb0')];return _0x4c638c;}Dialer[_0x4632('0x1a')][_0x4632('0x3f')]=function(){var _0x310c9c=this;setInterval(function(){_0x310c9c['clearZombieChannels'](_0x310c9c[_0x4632('0x26')],_0x4632('0xb1'));_0x310c9c[_0x4632('0xb2')](_0x310c9c[_0x4632('0x24')],_0x4632('0xb3'));},0x32c8);};Dialer[_0x4632('0x1a')][_0x4632('0xb2')]=function(_0x4b621b,_0x247bf3){var _0x5929e9=this;for(var _0x139ffc in _0x4b621b){if(typeof _0x4b621b[_0x139ffc]!==_0x4632('0xa0')){this[_0x4632('0x1e')][_0x4632('0x1b')](function(){if(!_[_0x4632('0xb4')](_0x4b621b[_0x139ffc])){return ami[_0x4632('0xb5')]({'action':_0x4632('0xb6'),'channel':_0x4b621b[_0x139ffc][_0x4632('0xb7')]})[_0x4632('0xb8')](function(_0x53382d){if(_0x53382d[_0x4632('0x40')]===_0x4632('0xb9')){setTimeout(function(){if(_0x4b621b[_0x139ffc]&&_0x4b621b[_0x139ffc][_0x4632('0x4b')]!=='ivr'){_0x5929e9[_0x4632('0xba')](_0x5929e9[_0x4632('0x1f')][_0x4b621b[_0x139ffc][_0x4632('0xbb')]]);logger[_0x4632('0x9c')](_0x4632('0xbc'),_0x247bf3,_0x139ffc,_0x4b621b[_0x139ffc][_0x4632('0xbb')]);delete _0x4b621b[_0x139ffc];}if(_0x4b621b[_0x139ffc]&&_0x4b621b[_0x139ffc]['type']==='ivr'){_0x5929e9[_0x4632('0xba')](_0x5929e9[_0x4632('0x20')][_0x4b621b[_0x139ffc][_0x4632('0xbb')]]);logger['error'](_0x4632('0xbd'),_0x247bf3,_0x139ffc,_0x4b621b[_0x139ffc]['queue']);delete _0x4b621b[_0x139ffc];}},0x2328);}});}});}}};Dialer[_0x4632('0x1a')]['countReScheduled']=function(_0x3ba274){return BPromise[_0x4632('0xbe')]()['then'](cmHopper[_0x4632('0xbf')](_0x3ba274))[_0x4632('0xb8')](loggerCatch(_0x4632('0xc0')));};Dialer['prototype'][_0x4632('0xc1')]=function(_0x40b568){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopperBlack['checkIsBlackList'](_0x40b568))[_0x4632('0xb8')](loggerCatch(_0x4632('0xc3')));};Dialer[_0x4632('0x1a')][_0x4632('0xc4')]=function(_0x5df48d){return BPromise['resolve']()[_0x4632('0xc2')](cmHopperBlack[_0x4632('0xc4')](_0x5df48d))[_0x4632('0xb8')](loggerCatch(_0x4632('0xc5')));};Dialer[_0x4632('0x1a')][_0x4632('0xc6')]=function(_0x6452c6){return BPromise['resolve']()[_0x4632('0xc2')](cmHopperHistory[_0x4632('0xc7')](_0x6452c6))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x4632('0x1a')][_0x4632('0xc8')]=function(_0x264f2f){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopper[_0x4632('0xc8')](_0x264f2f))[_0x4632('0xb8')](loggerCatch(_0x4632('0xc9')));};Dialer[_0x4632('0x1a')][_0x4632('0xca')]=function(_0x5a6200,_0x20632c,_0x235cce){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopper[_0x4632('0xca')](_0x5a6200,_0x20632c,_0x235cce))[_0x4632('0xb8')](loggerCatch(_0x4632('0xcb')));};Dialer[_0x4632('0x1a')][_0x4632('0xcc')]=function(_0x5b61b9,_0x10dd56,_0x48c416,_0x33b36f,_0x4a6a9a){return BPromise[_0x4632('0xbe')]()['then'](cmHopper[_0x4632('0xcc')](_0x5b61b9,_0x10dd56,_0x48c416,_0x33b36f))[_0x4632('0xb8')](function(_0x230bbf){_0x4a6a9a['temp']-=_0x48c416;_0x4a6a9a['temp']=_0x4a6a9a[_0x4632('0xcd')]>0x0?_0x4a6a9a[_0x4632('0xcd')]:0x0;loggerCatch(_0x4632('0xce'))(_0x230bbf);});};Dialer[_0x4632('0x1a')][_0x4632('0xcf')]=function(_0xdd5a96,_0x3c69a2,_0x3dea43,_0x4ae12e){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopper[_0x4632('0xcf')](_0xdd5a96,_0x3c69a2,_0x3dea43))[_0x4632('0xb8')](function(_0x16ab82){_0x4ae12e[_0x4632('0xcd')]-=_0x3c69a2;_0x4ae12e[_0x4632('0xcd')]=_0x4ae12e[_0x4632('0xcd')]>0x0?_0x4ae12e[_0x4632('0xcd')]:0x0;loggerCatch(_0x4632('0xd0'))(_0x16ab82);});};Dialer['prototype'][_0x4632('0xd1')]=function(_0x206eca){return BPromise[_0x4632('0xbe')]()['then'](voiceQueueRt[_0x4632('0xd1')](_0x206eca))[_0x4632('0xb8')](loggerCatch(_0x4632('0xd2')));};Dialer[_0x4632('0x1a')][_0x4632('0xd3')]=function(_0x24ff87){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopper[_0x4632('0xd3')](_0x24ff87))[_0x4632('0xb8')](loggerCatch(_0x4632('0xd4')));};Dialer['prototype'][_0x4632('0xd5')]=function(_0x5c9438){return BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](cmHopperHistory['createHistory'](_0x5c9438))[_0x4632('0xb8')](loggerCatch(_0x4632('0xd6')));};Dialer[_0x4632('0x1a')]['updateOriginated']=function(_0x4a3d46){if(!_[_0x4632('0x87')](_0x4a3d46)&&_0x4a3d46!==null){if(typeof _0x4a3d46['originated']!=='undefined'){if(_0x4a3d46[_0x4632('0x71')]>0x0){_0x4a3d46[_0x4632('0x71')]-=0x1;}else{logger[_0x4632('0x9c')](_0x4632('0xd7'));}}}else{logger[_0x4632('0x9c')](_0x4632('0xd8'));}};Dialer[_0x4632('0x1a')][_0x4632('0xd9')]=function(_0x144539,_0x45a048){var _0x44ac49=this;return function(_0xd86291){_0x44ac49[_0x4632('0xba')](_0x45a048);logger[_0x4632('0x9c')](_0x144539,util['inspect'](_0xd86291,{'showHidden':![],'depth':null}));};};Dialer[_0x4632('0x1a')][_0x4632('0xda')]=function(_0x353de6,_0x505563,_0x1f63a3){var _0x34901c={'state':0x19,'statedesc':_0x4632('0xdb')};this[_0x4632('0xba')](_0x505563);this[_0x4632('0xdc')](_[_0x4632('0x92')](_0x34901c,_[_0x4632('0xdd')](_0x1f63a3,[_0x4632('0xde'),_0x4632('0xdf'),'UserId',_0x4632('0xe0'),_0x4632('0xe1')])),_0x4632('0xe2'),_0x4632('0xe3'));logger[_0x4632('0x9c')](_0x353de6);};Dialer[_0x4632('0x1a')]['isSuccess']=function(_0x4be3fc){return _0x4be3fc===_0x4632('0xe4');};Dialer[_0x4632('0x1a')]['isTrunkReachable']=function(_0x4fb758){return!_['isUndefined'](_0x4fb758)&&_0x4fb758&&!_[_0x4632('0x87')](_0x4fb758['name'])&&!_[_0x4632('0x87')](_0x4fb758[_0x4632('0x76')])&&_0x4fb758[_0x4632('0x76')]&&(this[_0x4632('0xe5')][util[_0x4632('0x78')](_0x4632('0xe6'),_0x4fb758[_0x4632('0x43')])][_0x4632('0xb6')]===_0x4632('0xe7')||this[_0x4632('0xe5')][util[_0x4632('0x78')](_0x4632('0xe6'),_0x4fb758[_0x4632('0x43')])][_0x4632('0xb6')]===_0x4632('0xe8'));};Dialer[_0x4632('0x1a')]['saveInDb']=function(_0x268443,_0x38f032,_0x41cae7){this['createHistory'](_0x268443)[_0x4632('0xb8')](loggerCatch(_0x38f032));this[_0x4632('0xd3')](_0x268443)[_0x4632('0xb8')](loggerCatch(_0x41cae7));};Dialer[_0x4632('0x1a')][_0x4632('0xe9')]=function(_0x2794e0){var _0x14fd7d=this['uniqueId'][_0x2794e0[_0x4632('0xea')]];var _0x4fd446;if(!_['isNil'](_0x2794e0)&&!_['isNil'](_0x2794e0['variable'])&&!_['isNil'](_0x2794e0[_0x4632('0xeb')][_0x4632('0xec')])&&_0x2794e0[_0x4632('0xed')]===_0x4632('0xee')&&_0x14fd7d){if(_0x14fd7d[_0x4632('0x4b')]!=='ivr'&&this['voiceQueues'][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0xef')]&&_0x2794e0[_0x4632('0xf0')]===_0x4632('0xf1')){delete this[_0x4632('0x26')][_0x2794e0[_0x4632('0xea')]];this['updateOriginated'](this['voiceQueues'][_0x14fd7d[_0x4632('0xbb')]]);this[_0x4632('0x1f')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0x5e')]+=0x1;this[_0x4632('0x1f')][_0x14fd7d['queue']][_0x4632('0x5d')]+=0x1;_0x4fd446=new Hangup(_0x14fd7d,_0x2794e0);_0x4fd446[_0x4632('0xad')]=0x12;_0x4fd446[_0x4632('0xae')]=_0x4632('0xf2');_0x4fd446[_0x4632('0xf3')]='AMD';ami[_0x4632('0xf4')](_0x4632('0xf5'),ut['buildObj'](_0x4fd446,'amd'));this[_0x4632('0xdc')](_0x4fd446,_0x4632('0xf6'),_0x4632('0xf7'));}if(_0x14fd7d['type']!=='ivr'&&this[_0x4632('0x1f')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0xef')]&&_0x2794e0[_0x4632('0xf0')]===_0x4632('0xf8')){var _0x983bb1=this;return new BPromise(function(_0x1f0562,_0x566ef8){delete _0x983bb1[_0x4632('0x26')][_0x2794e0['uniqueid']];_0x983bb1['updateOriginated'](_0x983bb1[_0x4632('0x1f')][_0x14fd7d['queue']]);_0x983bb1[_0x4632('0x1f')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0x5e')]+=0x1;_0x983bb1['voiceQueues'][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0x5d')]+=0x1;var _0x4842a7=_0x983bb1['voiceQueues'][_0x14fd7d[_0x4632('0xbb')]];var _0x527a5c=new Hangup(_0x14fd7d,_0x2794e0);_0x527a5c[_0x4632('0xad')]=0x13;_0x527a5c[_0x4632('0xae')]=_0x4632('0xf9');_0x527a5c[_0x4632('0xf3')]='AMD';_0x527a5c['countmachineretry']+=0x1;_0x527a5c['countglobal']+=0x1;_0x527a5c['amd']=!![];ami[_0x4632('0xf4')](_0x4632('0xf5'),ut[_0x4632('0xfa')](_0x527a5c,_0x4632('0xfb')));_0x983bb1[_0x4632('0xd5')](_0x527a5c)[_0x4632('0xb8')](loggerCatch(_0x4632('0xfc')));if(_0x527a5c[_0x4632('0xfd')]+_0x527a5c[_0x4632('0xfe')]+_0x527a5c[_0x4632('0xff')]+_0x527a5c['countnosuchnumberretry']+_0x527a5c[_0x4632('0x100')]+_0x527a5c['countabandonedretry']+_0x527a5c[_0x4632('0x101')]+_0x527a5c[_0x4632('0x102')]>=_0x4842a7[_0x4632('0x103')]){_0x983bb1[_0x4632('0x104')](_0x527a5c,_0x1f0562,_0x566ef8,_0x4632('0x105'));}else{if(_0x527a5c['countmachineretry']>=_0x4842a7[_0x4632('0x106')]){_0x983bb1[_0x4632('0x107')](_0x527a5c,_0x1f0562,_0x566ef8,'reason\x2019\x20machine....');}else{_0x983bb1[_0x4632('0xc8')]({'active':![],'countmachineretry':_0x527a5c[_0x4632('0x101')],'scheduledat':moment()['add'](_0x4842a7[_0x4632('0x108')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x527a5c[_0x4632('0xde')],'ListId':_0x527a5c[_0x4632('0xdf')],'VoiceQueueId':_0x527a5c[_0x4632('0xe0')]||undefined,'CampaignId':_0x527a5c[_0x4632('0xe1')]||undefined})['catch'](loggerCatch(_0x4632('0x10b')));_0x1f0562({'reschedule':0x1});}}});}if(_0x14fd7d[_0x4632('0x4b')]===_0x4632('0x7b')&&this[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0xef')]&&_0x2794e0[_0x4632('0xf0')]==='HANGUP'){delete this[_0x4632('0x26')][_0x2794e0[_0x4632('0xea')]];this[_0x4632('0xba')](this[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]]);_0x4fd446=new Hangup(_0x14fd7d,_0x2794e0);_0x4fd446['state']=0x12;_0x4fd446['statedesc']='HangupInAMD';_0x4fd446[_0x4632('0xf3')]=_0x4632('0x10c');ami[_0x4632('0xf4')](_0x4632('0xf5'),ut[_0x4632('0xfa')](_0x4fd446,_0x4632('0xfb')));this['saveInDb'](_0x4fd446,'[syncHangupInAMDIvr][createHistory]',_0x4632('0x10d'));}if(_0x14fd7d['type']==='ivr'&&this[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0xef')]&&_0x2794e0[_0x4632('0xf0')]===_0x4632('0xf8')){var _0x983bb1=this;return new BPromise(function(_0x1d55a0,_0x1f729b){delete _0x983bb1[_0x4632('0x26')][_0x2794e0[_0x4632('0xea')]];_0x983bb1[_0x4632('0xba')](_0x983bb1[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]]);_0x983bb1[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0x5e')]+=0x1;_0x983bb1[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]][_0x4632('0x5d')]+=0x1;var _0x2a5386=_0x983bb1[_0x4632('0x20')][_0x14fd7d[_0x4632('0xbb')]];var _0x20b46c=new Hangup(_0x14fd7d,_0x2794e0);_0x20b46c['state']=0x13;_0x20b46c[_0x4632('0xae')]='Machine';_0x20b46c['membername']=_0x4632('0x10c');_0x20b46c[_0x4632('0x101')]+=0x1;_0x20b46c['countglobal']+=0x1;_0x20b46c[_0x4632('0xfb')]=!![];ami['emit']('custom:amd',ut[_0x4632('0xfa')](_0x20b46c,'amd'));_0x983bb1['createHistory'](_0x20b46c)[_0x4632('0xb8')](loggerCatch(_0x4632('0xfc')));if(_0x20b46c[_0x4632('0xfd')]+_0x20b46c[_0x4632('0xfe')]+_0x20b46c[_0x4632('0xff')]+_0x20b46c[_0x4632('0x10e')]+_0x20b46c['countdropretry']+_0x20b46c[_0x4632('0x10f')]+_0x20b46c[_0x4632('0x101')]+_0x20b46c[_0x4632('0x102')]>=_0x2a5386['dialGlobalMaxRetry']){_0x983bb1[_0x4632('0x104')](_0x20b46c,_0x1d55a0,_0x1f729b,'reason19\x20machine....');}else{if(_0x20b46c[_0x4632('0x101')]>=_0x2a5386['dialMachineMaxRetry']){_0x983bb1['createStateFinal'](_0x20b46c,_0x1d55a0,_0x1f729b,_0x4632('0x110'));}else{_0x983bb1[_0x4632('0xc8')]({'active':![],'countmachineretry':_0x20b46c[_0x4632('0x101')],'scheduledat':moment()[_0x4632('0x111')](_0x2a5386[_0x4632('0x108')],'minutes')[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x20b46c[_0x4632('0xde')],'ListId':_0x20b46c[_0x4632('0xdf')],'VoiceQueueId':_0x20b46c[_0x4632('0xe0')]||undefined,'CampaignId':_0x20b46c[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x10b')));_0x1d55a0({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x4632('0x38')]=function(_0x2a6c54){var _0x94621=this['uniqueId'][_0x2a6c54[_0x4632('0xea')]];var _0x73e660=this;var _0x14c62b;if(_0x94621&&_0x94621[_0x4632('0x4b')]===_0x4632('0x7b')){delete this[_0x4632('0x26')][_0x2a6c54[_0x4632('0xea')]];this['updateOriginated'](this[_0x4632('0x20')][_0x94621['queue']]);this['campaigns'][_0x94621[_0x4632('0xbb')]][_0x4632('0x112')]+=0x1;_0x14c62b=new Hangup(_0x94621,_0x2a6c54);this[_0x4632('0xd5')](_0x14c62b)[_0x4632('0xb8')](loggerCatch(_0x4632('0x113')));this['moveContactManagedDialer'](_0x14c62b)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x94621&&_0x94621[_0x4632('0x4b')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x94621[_0x4632('0xbb')]][_0x4632('0x114')])){delete this[_0x4632('0x26')][_0x2a6c54[_0x4632('0xea')]];this[_0x4632('0xba')](this[_0x4632('0x1f')][_0x94621[_0x4632('0xbb')]]);this['voiceQueues'][_0x94621[_0x4632('0xbb')]][_0x4632('0x5e')]+=0x1;this['voiceQueues'][_0x94621['queue']][_0x4632('0x5d')]+=0x1;_0x14c62b=new Hangup(_0x94621,_0x2a6c54);_0x14c62b[_0x4632('0xad')]=0x10;_0x14c62b[_0x4632('0xae')]=_0x4632('0x115');_0x14c62b[_0x4632('0xf3')]=_0x4632('0x116');this[_0x4632('0xd5')](_0x14c62b)[_0x4632('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x14c62b)[_0x4632('0xb8')](loggerCatch('[syncHangupIvr]'));}if(_0x94621&&_0x94621[_0x4632('0x4b')]!==_0x4632('0x7b')&&!isNotNull(this[_0x4632('0x1f')][_0x94621[_0x4632('0xbb')]]['dialQueueProject'])){delete this[_0x4632('0x26')][_0x2a6c54[_0x4632('0xea')]];this['updateOriginated'](this[_0x4632('0x1f')][_0x94621['queue']]);this[_0x4632('0x1f')][_0x94621[_0x4632('0xbb')]][_0x4632('0x67')]+=0x1;_0x14c62b=new Hangup(_0x94621,_0x2a6c54);_0x14c62b[_0x4632('0xad')]=0xc;_0x14c62b[_0x4632('0xae')]=_0x2a6c54[_0x4632('0x117')];_0x14c62b[_0x4632('0xf3')]=_0x4632('0x118');this[_0x4632('0xd5')](_0x14c62b)[_0x4632('0xb8')](loggerCatch(_0x4632('0x113')));this[_0x4632('0xd3')](_0x14c62b)[_0x4632('0xb8')](loggerCatch(_0x4632('0x119')));}};Dialer[_0x4632('0x1a')][_0x4632('0x35')]=function(_0x3132a5){var _0x4cacba=this[_0x4632('0x26')][_0x3132a5[_0x4632('0xea')]];var _0x303379=this;if(this[_0x4632('0x1f')][_0x3132a5[_0x4632('0xbb')]]){if(_0x4cacba&&_0x4cacba[_0x4632('0x4b')]!==_0x4632('0x7b')){delete this['uniqueId'][_0x3132a5[_0x4632('0xea')]];this[_0x4632('0x1f')][_0x3132a5[_0x4632('0xbb')]][_0x4632('0x5e')]+=0x1;var _0xc576f1=new AgentComplete(_0x4cacba,_0x3132a5);if(_0x3132a5[_0x4632('0x11a')]===_0x4632('0x11b')){_0xc576f1[_0x4632('0x11c')]=this[_0x4632('0x1f')][_0x3132a5[_0x4632('0xbb')]][_0x4632('0x11d')]&&this[_0x4632('0x1f')][_0x3132a5[_0x4632('0xbb')]]['dialAgiAfterHangupAgent']?moment()[_0x4632('0x78')](_0x4632('0x10a')):undefined;}this[_0x4632('0xd5')](_0xc576f1)[_0x4632('0xb8')](loggerCatch(_0x4632('0x11e')));this[_0x4632('0xd3')](_0xc576f1)[_0x4632('0xb8')](loggerCatch(_0x4632('0x11f')));}}};Dialer[_0x4632('0x1a')]['syncAgentConnect']=function(_0x57b272){if(this[_0x4632('0x1f')][_0x57b272[_0x4632('0xbb')]]){if(this[_0x4632('0x26')][_0x57b272[_0x4632('0xea')]]&&this[_0x4632('0x26')][_0x57b272[_0x4632('0xea')]]['type']!==_0x4632('0x7b')){this[_0x4632('0xba')](this['voiceQueues'][_0x57b272[_0x4632('0xbb')]]);this[_0x4632('0x26')][_0x57b272['uniqueid']]['answertime']=moment()[_0x4632('0x78')](_0x4632('0x10a'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x375e4a){this[_0x4632('0xd5')](_0x375e4a)[_0x4632('0xb8')](loggerCatch(_0x4632('0x11e')));this[_0x4632('0xd3')](_0x375e4a)[_0x4632('0xb8')](loggerCatch(_0x4632('0x120')));};Dialer['prototype'][_0x4632('0x31')]=function(_0x3be4a0){var _0x25a2c7=this[_0x4632('0x26')][_0x3be4a0[_0x4632('0xea')]];var _0x5871c8=this;if(this['voiceQueues'][_0x3be4a0[_0x4632('0xbb')]]){if(_0x25a2c7&&_0x25a2c7['type']!==_0x4632('0x7b')){delete this[_0x4632('0x26')][_0x3be4a0[_0x4632('0xea')]];this[_0x4632('0xba')](this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]]);_0x25a2c7[_0x4632('0x121')]=moment()[_0x4632('0x78')](_0x4632('0x10a'));var _0x4a1000=new QueueCallerAbandon(_0x25a2c7,_0x3be4a0);if(getSeconds(_0x25a2c7['droptime'],_0x25a2c7['responsetime'])>=_0x25a2c7[_0x4632('0x122')]){this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x62')]+=0x1;this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4a1000[_0x4632('0xad')]=0xa;_0x4a1000[_0x4632('0xae')]=_0x4632('0x123');_0x4a1000[_0x4632('0x124')]=_0x4632('0x125');_0x4a1000[_0x4632('0x11c')]=this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x11d')]?moment()[_0x4632('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4a1000[_0x4632('0x100')]+=0x1;_0x4a1000[_0x4632('0x126')]+=0x1;if(_0x4a1000[_0x4632('0x100')]>=this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x127')]){this[_0x4632('0x128')](_0x4a1000);}else{this[_0x4632('0xc8')]({'active':![],'countdropretry':_0x4a1000[_0x4632('0x100')],'scheduledat':moment()[_0x4632('0x111')](this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x129')],_0x4632('0x109'))['format'](_0x4632('0x10a')),'ContactId':_0x25a2c7[_0x4632('0xde')],'ListId':_0x25a2c7[_0x4632('0xdf')],'VoiceQueueId':_0x25a2c7[_0x4632('0xe0')]||undefined,'CampaignId':_0x25a2c7[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x12a')));var _0x56e812=new History(_0x4a1000);_0x56e812[_0x4632('0xad')]=0xa;_0x56e812['statedesc']='Drop';_0x56e812[_0x4632('0xb0')]=moment()['format'](_0x4632('0x10a'));_0x56e812['endtime']=_0x56e812[_0x4632('0xb0')];_0x56e812[_0x4632('0x12b')]=_0x4a1000[_0x4632('0x12b')];_0x56e812[_0x4632('0x12c')]=_0x4a1000['calleridnum'];this[_0x4632('0xd5')](_0x56e812)[_0x4632('0xb8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this['voiceQueues'][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x84')]+=0x1;this[_0x4632('0x1f')][_0x3be4a0['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x4a1000[_0x4632('0xad')]=0xb;_0x4a1000['statedesc']=_0x4632('0x12d');_0x4a1000[_0x4632('0x124')]='CALLEREXIT';_0x4a1000['countabandonedretry']+=0x1;_0x4a1000[_0x4632('0x126')]+=0x1;if(_0x4a1000[_0x4632('0x10f')]>=this[_0x4632('0x1f')][_0x3be4a0['queue']][_0x4632('0x12e')]){this['queueCallerAbandonCreateState'](_0x4a1000);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x4a1000[_0x4632('0x10f')],'scheduledat':moment()[_0x4632('0x111')](this[_0x4632('0x1f')][_0x3be4a0[_0x4632('0xbb')]][_0x4632('0x12f')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x25a2c7[_0x4632('0xde')],'ListId':_0x25a2c7[_0x4632('0xdf')],'VoiceQueueId':_0x25a2c7[_0x4632('0xe0')]||undefined,'CampaignId':_0x25a2c7[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x130')));var _0x56e812=new History(_0x4a1000);_0x56e812[_0x4632('0xad')]=0xb;_0x56e812[_0x4632('0xae')]='Abandoned';_0x56e812[_0x4632('0xb0')]=moment()[_0x4632('0x78')](_0x4632('0x10a'));_0x56e812[_0x4632('0xaf')]=_0x56e812['starttime'];_0x56e812[_0x4632('0x12b')]=_0x4a1000['calleridname'];_0x56e812[_0x4632('0x12c')]=_0x4a1000[_0x4632('0x12c')];this[_0x4632('0xd5')](_0x56e812)[_0x4632('0xb8')](loggerCatch(_0x4632('0x131')));}}}}};Dialer[_0x4632('0x1a')][_0x4632('0x3a')]=function(_0x41a908){if(this[_0x4632('0x24')][_0x41a908['uniqueid']]){this[_0x4632('0x24')][_0x41a908[_0x4632('0xea')]][_0x4632('0xb7')]=_0x41a908[_0x4632('0xb7')];}if(this['uniqueId'][_0x41a908[_0x4632('0xea')]]){this[_0x4632('0x26')][_0x41a908[_0x4632('0xea')]][_0x4632('0xb7')]=_0x41a908['channel'];}};Dialer['prototype'][_0x4632('0x3c')]=function(_0xaaa6e2){if(strategy[this[_0x4632('0x1f')][this['actions'][_0xaaa6e2[_0x4632('0x132')]]['queue']][_0x4632('0x4d')]]===_0x4632('0x19')){if(this[_0x4632('0x24')][_0xaaa6e2[_0x4632('0x132')]]&&_[_0x4632('0xb4')](this[_0x4632('0x24')][_0xaaa6e2['actionid']][_0x4632('0x133')])&&_0xaaa6e2[_0x4632('0xb6')]==='1'&&_0xaaa6e2['paused']==='0'){if(this[_0x4632('0x21')][_0xaaa6e2[_0x4632('0x134')]]){if(!this[_0x4632('0x21')][_0xaaa6e2[_0x4632('0x134')]]['locked']){this[_0x4632('0x21')][_0xaaa6e2[_0x4632('0x134')]][_0x4632('0x133')]=!![];this['actions'][_0xaaa6e2[_0x4632('0x132')]][_0x4632('0x133')]=!![];this[_0x4632('0x24')][_0xaaa6e2[_0x4632('0x132')]]['stateinterface']=_0xaaa6e2[_0x4632('0x134')];}}}}else if((strategy[this[_0x4632('0x1f')][this['actions'][_0xaaa6e2[_0x4632('0x132')]][_0x4632('0xbb')]][_0x4632('0x4d')]]||_0x4632('0x135'))===_0x4632('0x135')){if(this['actions'][_0xaaa6e2[_0x4632('0x132')]]){if(this['agents'][_0xaaa6e2[_0x4632('0x134')]]){this['actions'][_0xaaa6e2[_0x4632('0x132')]][_0x4632('0x134')]=_0xaaa6e2['stateinterface'];if(_[_0x4632('0xb4')](this[_0x4632('0x2b')][this[_0x4632('0x24')][_0xaaa6e2[_0x4632('0x132')]][_0x4632('0xbb')]])){this['queueBooked'][this[_0x4632('0x24')][_0xaaa6e2['actionid']][_0x4632('0xbb')]]=[];}this[_0x4632('0x2b')][this[_0x4632('0x24')][_0xaaa6e2[_0x4632('0x132')]][_0x4632('0xbb')]][_0x4632('0x136')](_['merge'](_[_0x4632('0xdd')](this[_0x4632('0x24')][_0xaaa6e2[_0x4632('0x132')]],[_0x4632('0x137'),'stateinterface']),{'status':_0xaaa6e2[_0x4632('0xb6')],'paused':_0xaaa6e2[_0x4632('0x138')]}));}}}};function unlockQueueStatus(_0x1f7ae4,_0x4377d6){setTimeout(function(){if(_['isUndefined'](_0x1f7ae4[_0x4632('0x139')])){loggerBooked[_0x4632('0x9c')](_0x4632('0x13a'),_0x4377d6);}_0x1f7ae4[_0x4632('0x139')]=!![];loggerBooked[_0x4632('0x7f')]('[booked][unlockQueueStatus]',_0x4377d6,JSON[_0x4632('0x49')](_[_0x4632('0xdd')](_0x1f7ae4,[_0x4632('0x43'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4632('0x1a')][_0x4632('0x3e')]=function(_0x210a17){var _0x2a7ef7=this;var _0x347a61=_0x2a7ef7[_0x4632('0x1f')][_0x2a7ef7['actions'][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]];if(strategy[this[_0x4632('0x1f')][this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]]['queue']]['strategy']]===_0x4632('0x19')){if(this['actions'][_0x210a17[_0x4632('0x132')]]&&this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0x134')]){this[_0x4632('0x13b')][_0x4632('0x13c')](this['actions'][_0x210a17['actionid']][_0x4632('0x137')],this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0x134')])[_0x4632('0xb8')](function(_0x15f372){logger[_0x4632('0x9c')](_0x4632('0x13d'),util[_0x4632('0x9d')](_0x15f372,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2a7ef7[_0x4632('0xba')](_0x2a7ef7['voiceQueues'][_0x2a7ef7[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]]['queue']]);_0x2a7ef7[_0x4632('0x21')][_0x2a7ef7[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0x134')]]['locked']=![];delete _0x2a7ef7['actions'][_0x210a17['actionid']];unlockQueueStatus(_0x347a61);});}else{this[_0x4632('0xba')](this[_0x4632('0x1f')][this[_0x4632('0x24')][_0x210a17['actionid']][_0x4632('0xbb')]]);this[_0x4632('0xc8')]({'active':![],'ContactId':this['actions'][_0x210a17[_0x4632('0x132')]][_0x4632('0xde')],'ListId':this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0xdf')],'VoiceQueueId':this[_0x4632('0x24')][_0x210a17['actionid']][_0x4632('0xe0')]||undefined,'CampaignId':this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]];unlockQueueStatus(_0x347a61);}}else if((strategy[this[_0x4632('0x1f')][this['actions'][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]][_0x4632('0x4d')]]||'rrmemory')===_0x4632('0x135')){var _0x50ada8;if(this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]]&&!_[_0x4632('0x7d')](this['queueBooked'][this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]]['queue']])){if(this[_0x4632('0x2c')][_0x2a7ef7[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]]){this[_0x4632('0x2c')][_0x2a7ef7['actions'][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]]=this['queueBookedRR'][this['actions'][_0x210a17[_0x4632('0x132')]]['queue']]?this['queueBookedRR'][this['actions'][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]]:this[_0x4632('0x2b')][this['actions'][_0x210a17['actionid']][_0x4632('0xbb')]]?this['queueBooked'][this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]][_0x4632('0x13e')]||0x0:0x0;}this[_0x4632('0x2b')][this[_0x4632('0x24')][_0x210a17['actionid']][_0x4632('0xbb')]][_0x4632('0x13e')]=this[_0x4632('0x2c')][this[_0x4632('0x24')][_0x210a17[_0x4632('0x132')]][_0x4632('0xbb')]];for(var _0x5976ed=0x0;_0x5976ed=0x0;})['catch'](myreject(_0x22cc4d)));}}else{_0x63e8f1[_0x4632('0x136')](ami[_0x4632('0xb5')]({'action':'command','command':util[_0x4632('0x78')](_0x4632('0x156'),_0x1e8348,!_[_0x4632('0x87')](config[_0x4632('0x152')][_0x4cc608])?_0x4cc608:'')})[_0x4632('0xc2')](function(_0x28d1dc){return _0x28d1dc[_0x4632('0x15a')][_0x4632('0x158')](_0x4632('0x159'))>=0x0;})['catch'](myreject(_0x22cc4d)));}BPromise[_0x4632('0x15b')](_0x63e8f1)['then'](function(_0x6629db){var _0x5acc07=_[_0x4632('0x15c')](_0x6629db);if(_0x5acc07){return _0x72e070(_0x5acc07);}else{_0x31481e[_0x4632('0x40')]=_0x576010?'GLOBAL_INTERVAL_IS_OVERTIME':_0x4632('0x15d');return _0x22cc4d(msgResponse('[ifTime][promiseAll]',_0x4632('0x154'),_0x4632('0x15e')+_0x576010+'\x20'+_0x5a0bcc+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x1e8348,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4cc608));}})['catch'](function(_0x2380ce){return _0x22cc4d(msgResponse(_0x4632('0x14e'),_0x4632('0x154'),JSON[_0x4632('0x49')](_0x2380ce)));});});};Dialer['prototype'][_0x4632('0x15f')]=function(_0x36ca5e){var _0x215e1f=this;return function(){switch(_0x36ca5e[_0x4632('0x59')]){case _0x4632('0x160'):freeVariablesPredictive(_0x36ca5e);_0x215e1f[_0x4632('0x161')](_0x36ca5e,0x1);break;case _0x4632('0x162'):freeVariablesPredictive(_0x36ca5e);_0x215e1f[_0x4632('0x161')](_0x36ca5e,_0x36ca5e[_0x4632('0x163')]);break;case _0x4632('0x8'):_0x215e1f[_0x4632('0x8')](_0x36ca5e);break;case _0x4632('0x7'):freeVariablesPredictive(_0x36ca5e);_0x215e1f['handlePower'](_0x36ca5e,0x1);break;default:freeVariablesPredictive(_0x36ca5e);logger['error']('Queue',_0x36ca5e[_0x4632('0x43')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x4632('0x164')]=function(_0xe18f9c){var _0x125e56=this;return function(){_0x125e56['handleIvr'](_0xe18f9c);};};Dialer[_0x4632('0x1a')][_0x4632('0xa')]=function(_0x202be0){var _0x1ccac1=this;if(isNotPreview(_0x202be0[_0x4632('0x59')])){if(isVoiceQueueOutbound(_0x202be0['type'])&&isActive(_0x202be0[_0x4632('0x165')])){_0x202be0[_0x4632('0xa7')]=!![];BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](checkIsLoggedIn(_0x202be0,_0x202be0[_0x4632('0x50')]))[_0x4632('0xc2')](checkIsActive(_0x202be0,_0x202be0[_0x4632('0x165')]))[_0x4632('0xc2')](checkInterval(_0x202be0))[_0x4632('0xc2')](_0x1ccac1[_0x4632('0x148')](_0x202be0))[_0x4632('0xc2')](_0x1ccac1[_0x4632('0x14d')](_0x202be0[_0x4632('0x166')],_0x202be0['dialTimezone'],_0x202be0[_0x4632('0x43')],_0x202be0))[_0x4632('0xc2')](_0x1ccac1[_0x4632('0x167')](_0x202be0[_0x4632('0x44')],_0x202be0[_0x4632('0x168')],_0x202be0[_0x4632('0x43')],_0x202be0))[_0x4632('0xc2')](_0x1ccac1['checkDialMethod'](_0x202be0))[_0x4632('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x202be0));}else{notSendMessagesQueue(_0x202be0);}}else{freeVariablesPredictive(_0x202be0);}};Dialer[_0x4632('0x1a')][_0x4632('0x169')]=function(){var _0x2640bb=this;var _0x3eae8a;for(var _0x28a63a in this[_0x4632('0x20')]){if(typeof this['campaigns'][_0x28a63a]!==_0x4632('0xa0')){_0x3eae8a=this[_0x4632('0x20')][_0x28a63a];if(isCampaignIvr(_0x3eae8a['type'])&&isActive(_0x3eae8a[_0x4632('0x76')])){_0x3eae8a['sendMessageOneNotActive']=!![];BPromise[_0x4632('0xbe')]()[_0x4632('0xc2')](checkIsActive(_0x3eae8a,_0x3eae8a[_0x4632('0x76')]))['then'](checkInterval(_0x3eae8a))[_0x4632('0xc2')](_0x2640bb[_0x4632('0x148')](_0x3eae8a))[_0x4632('0xc2')](_0x2640bb[_0x4632('0x14d')](_0x3eae8a[_0x4632('0x166')],_0x3eae8a[_0x4632('0x168')],_0x3eae8a[_0x4632('0x43')],_0x3eae8a))['then'](_0x2640bb[_0x4632('0x167')](_0x3eae8a['Interval'],_0x3eae8a['dialTimezone'],_0x3eae8a['name'],_0x3eae8a))[_0x4632('0xc2')](_0x2640bb['launchHandleIvr'](_0x3eae8a))[_0x4632('0xb8')](loggerCatchQueueSummary(_0x4632('0x16a'),_0x3eae8a));}else{notSendMessagesCampaign(_0x3eae8a);}}}};function getCallerIdRandom(_0x12d34f,_0xf30684){var _0x3399f8;var _0x5573b3;var _0x53f9e9;if(_0xf30684<=0x0){_0xf30684=0x1;}_0x3399f8=new RegExp(_0x4632('0x16b')+_0xf30684+'}$');_0x5573b3=Math[_0x4632('0x16c')](0xa,_0xf30684-0x1);_0x53f9e9=Math[_0x4632('0x16c')](0xa,_0xf30684)-0x1;return util[_0x4632('0x78')]('%s',_[_0x4632('0x16d')](_0x12d34f,_0x3399f8,_[_0x4632('0x16e')](_0x5573b3,_0x53f9e9)));}function extractCalleridName(_0x416ee1){var _0x53feb0=_0x416ee1[_0x4632('0x16f')](/"(.*?)"/);return _0x53feb0?_0x53feb0[0x1]:_0x416ee1;}function extractCalleridNumber(_0x28bcb0){var _0x397454=_0x28bcb0[_0x4632('0x16f')](/<(.*?)>/);return _0x397454?_0x397454[0x1]:_0x28bcb0;}Dialer[_0x4632('0x1a')]['actionOriginate']=function(_0x464313,_0x3e784c){var _0x3aa830=this;var _0x1d71e=uuid['v4']();this['actions'][_0x1d71e]=new Action(_0x464313,_0x3e784c,_0x1d71e);return new BPromise(function(_0x550b77,_0x48fa0e){if(_['isUndefined'](_0x464313)&&typeof _0x464313!==_0x4632('0x170')){return _0x48fa0e(msgResponse('originate',_0x4632('0x154'),_0x4632('0x171')));}if(_[_0x4632('0x87')](_0x3e784c['Contact'][_0x4632('0x172')])||_0x3e784c[_0x4632('0x173')][_0x4632('0x172')]===null){return _0x48fa0e(msgResponse('originate',_0x4632('0x154'),'contact\x20is\x20undefine'));}var _0x3ea240={'XMD-CALLERID':_0x3aa830[_0x4632('0x24')][_0x1d71e][_0x4632('0x174')](),'XMD-AGI':_0x464313[_0x4632('0x114')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x464313[_0x4632('0x114')]):_0x4632('0x175'),'XMD-AGIAFTER':_0x464313[_0x4632('0x11d')]?util[_0x4632('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x464313[_0x4632('0x11d')]):_0x4632('0x175'),'XMD-QUEUE':_0x464313[_0x4632('0x4b')]==='outbound'?util['format'](_0x4632('0x176'),_0x464313[_0x4632('0x43')],_0x464313[_0x4632('0x177')]||'',_0x464313['dialAgiAfterHangupAgent']?'c':'',_0x464313[_0x4632('0x122')]||0x3):_0x4632('0x175'),'XMD-CONTACTID':_0x3e784c[_0x4632('0xde')],'XMD-CDRTYPE':_0x4632('0x178'),'CALLERID(all)':_0x3aa830[_0x4632('0x24')][_0x1d71e][_0x4632('0x174')](),'XMD-AMD':_0x464313['dialAMDActive']?_0x4632('0x179'):_0x4632('0x175'),'XMD-DESTINATION':_0x4632('0xee')};if(_0x464313[_0x4632('0xef')]){_0x3ea240['XMD-AMDINITIALSILENCE']=_0x464313[_0x4632('0x17a')]||0x9c4;_0x3ea240[_0x4632('0x17b')]=_0x464313[_0x4632('0x17c')]||0x5dc;_0x3ea240['XMD-AMDAFTERGREETINGSILENCE']=_0x464313[_0x4632('0x17d')]||0x320;_0x3ea240[_0x4632('0x17e')]=_0x464313['dialAMDTotalAnalysisTime']||0x1388;_0x3ea240[_0x4632('0x17f')]=_0x464313['dialAMDMinWordLength']||0x64;_0x3ea240[_0x4632('0x180')]=_0x464313['dialAMDBetweenWordsSilence']||0x32;_0x3ea240['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x464313[_0x4632('0x181')]||0x3;_0x3ea240[_0x4632('0x182')]=_0x464313['dialAMDSilenceThreshold']||0x100;_0x3ea240[_0x4632('0x183')]=_0x464313[_0x4632('0x184')]||0x1388;}if(_0x464313['type']===_0x4632('0x4c')){_0x3ea240[_0x4632('0x185')]=_0x3e784c['VoiceQueueId'];}else{_0x3ea240[_0x4632('0x186')]=_0x3e784c[_0x4632('0xe1')];}for(var _0x5e39aa in _0x3e784c[_0x4632('0x173')]){if(typeof _0x3e784c[_0x4632('0x173')][_0x5e39aa]!==_0x4632('0xa0')){if(isNotNull(_0x3e784c[_0x4632('0x173')][_0x5e39aa])&&_0x5e39aa!=='id'&&_0x5e39aa!==_0x4632('0x187')&&_0x5e39aa!=='createdAt'&&_0x5e39aa!=='updatedAt'){_0x3ea240[util[_0x4632('0x78')](_0x4632('0x188'),_0x4632('0x189'),_[_0x4632('0x18a')](_0x5e39aa))]=_0x3e784c[_0x4632('0x173')][_0x5e39aa];}}}var _0x3f9f4c=_0x3aa830['isTrunkReachable'](_0x464313['Trunk'])?getCallerId(_0x464313[_0x4632('0x75')][_0x4632('0x77')],_0x464313[_0x4632('0x5a')],_0x464313[_0x4632('0x18b')]>0x0?getCallerIdRandom(_0x464313[_0x4632('0x5b')],_0x464313['dialRandomLastDigitCallerIdNumber']):_0x464313[_0x4632('0x5b')]):getCallerId(_[_0x4632('0xb4')](_0x464313['TrunkBackup'])?_0x464313['Trunk']['callerid']:_0x464313[_0x4632('0x14a')][_0x4632('0x77')],_0x464313['dialOriginateCallerIdName'],_0x464313[_0x4632('0x18b')]>0x0?getCallerIdRandom(_0x464313[_0x4632('0x5b')],_0x464313[_0x4632('0x18b')]):_0x464313[_0x4632('0x5b')]);if(_0x3f9f4c){_0x3ea240[_0x4632('0x18c')]=_0x3aa830[_0x4632('0x24')][_0x1d71e][_0x4632('0x18d')]=extractCalleridName(_0x3f9f4c);_0x3ea240['XMD-ORIGINATECALLERIDNUM']=_0x3aa830[_0x4632('0x24')][_0x1d71e][_0x4632('0x18e')]=extractCalleridNumber(_0x3f9f4c);}return ami[_0x4632('0xb5')]({'actionid':_0x1d71e,'action':'originate','channel':_0x3aa830['isTrunkReachable'](_0x464313[_0x4632('0x75')])?util[_0x4632('0x78')](_0x4632('0x18f'),_0x464313[_0x4632('0x75')][_0x4632('0x43')],isNotNull(_0x464313['dialPrefix'])?_0x464313['dialPrefix'][_0x4632('0x190')]()||'':'',_0x464313[_0x4632('0x191')]>0x0?_0x3e784c[_0x4632('0x173')][_0x4632('0x172')]['substring'](_0x464313['dialCutDigit']):_0x3e784c[_0x4632('0x173')][_0x4632('0x172')]):util[_0x4632('0x78')]('SIP/%s/%s%s',_[_0x4632('0xb4')](_0x464313[_0x4632('0x14a')])?_0x464313[_0x4632('0x75')][_0x4632('0x43')]:_0x464313[_0x4632('0x14a')][_0x4632('0x43')],isNotNull(_0x464313[_0x4632('0x192')])?_0x464313[_0x4632('0x192')]['trim']()||'':'',_0x464313[_0x4632('0x191')]>0x0?_0x3e784c['Contact'][_0x4632('0x172')][_0x4632('0x193')](_0x464313[_0x4632('0x191')]):_0x3e784c['Contact'][_0x4632('0x172')]),'callerid':_0x3f9f4c,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x3ea240,'timeout':(_0x464313[_0x4632('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1d71e})[_0x4632('0xc2')](function(_0x27786b){return _0x550b77(_0x27786b);})[_0x4632('0xb8')](function(_0x1c3775){_0x464313['outboundOriginateFailureCallsDay']+=0x1;var _0xd29875=new History(_0x3aa830[_0x4632('0x24')][_0x1d71e]);logger[_0x4632('0x9c')](util[_0x4632('0x78')](_0x4632('0x194'),JSON[_0x4632('0x49')](_0x1c3775)));_0xd29875[_0x4632('0xad')]=0xe;_0xd29875[_0x4632('0xae')]=_0x4632('0x195');_0xd29875['starttime']=moment()[_0x4632('0x78')](_0x4632('0x10a'));_0xd29875[_0x4632('0xaf')]=_0xd29875['starttime'];_0x3aa830[_0x4632('0xd5')](_0xd29875)[_0x4632('0xb8')](loggerCatch(_0x4632('0x196')));_0x3aa830[_0x4632('0xd3')](_0xd29875)['catch'](loggerCatch(_0x4632('0x196')))[_0x4632('0x1d')](function(){delete _0x3aa830[_0x4632('0x24')][_0x1d71e];return _0x48fa0e(msgResponse('originate','Error',_0x4632('0x197')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x434d18){var _0xbba1e2=this[_0x4632('0x24')][_0x434d18[_0x4632('0x132')]];if(_0xbba1e2){delete this[_0x4632('0x24')][_0x434d18[_0x4632('0x132')]];_0xbba1e2[_0x4632('0x198')]=moment()[_0x4632('0x78')](_0x4632('0x10a'));var _0x3ee362=_0xbba1e2[_0x4632('0x4b')]===_0x4632('0x7b')?this[_0x4632('0x20')][_0xbba1e2[_0x4632('0xbb')]]:this[_0x4632('0x1f')][_0xbba1e2['getQueue']()];if(!this[_0x4632('0x199')](_0x434d18[_0x4632('0x19a')])){this[_0x4632('0xba')](_0x3ee362);return this[_0x4632('0x19b')](_0xbba1e2,_0x3ee362,_0x434d18)[_0x4632('0xb8')](loggerCatch(_0x4632('0x19c')));}this[_0x4632('0x26')][_0x434d18['uniqueid']]=_0xbba1e2;}};Dialer[_0x4632('0x1a')][_0x4632('0x19d')]=function(_0x359534,_0x32cf2e,_0x1e74be){var _0x4e16bc=new History(_0x32cf2e);if(_0x4e16bc[_0x4632('0xfd')]+_0x4e16bc[_0x4632('0xfe')]+_0x4e16bc['countnoanswerretry']+_0x4e16bc['countnosuchnumberretry']+_0x4e16bc[_0x4632('0x100')]+_0x4e16bc[_0x4632('0x10f')]+_0x4e16bc[_0x4632('0x101')]+_0x4e16bc[_0x4632('0x102')]>=_0x1e74be[_0x4632('0x103')]-0x1){return!![];}switch(_0x359534){case 0x3:if(_0x4e16bc[_0x4632('0xff')]>=_0x1e74be[_0x4632('0x19e')]-0x1){return!![];}this[_0x4632('0xc8')]({'active':![],'countnoanswerretry':_0x4e16bc[_0x4632('0xff')]+=0x1,'scheduledat':moment()['add'](_0x1e74be[_0x4632('0x19f')],_0x4632('0x109'))['format'](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1a0')));break;case 0x5:if(_0x4e16bc[_0x4632('0xfd')]>=_0x1e74be['dialBusyMaxRetry']-0x1){return!![];}this[_0x4632('0xc8')]({'active':![],'countbusyretry':_0x4e16bc['countbusyretry']+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be[_0x4632('0x1a1')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc['ListId'],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1a2')));break;case 0x8:if(_0x4e16bc['countcongestionretry']>=_0x1e74be['dialCongestionMaxRetry']-0x1){return!![];}this[_0x4632('0xc8')]({'active':![],'countcongestionretry':_0x4e16bc[_0x4632('0xfe')]+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be[_0x4632('0x1a3')],_0x4632('0x109'))[_0x4632('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e16bc['ContactId'],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1a4')));break;case 0x0:if(_0x4e16bc[_0x4632('0x10e')]>=_0x1e74be[_0x4632('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4e16bc['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be['dialNoSuchNumberRetryFrequency'],_0x4632('0x109'))['format'](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc['ListId'],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1a6')));}break;case 0xa:if(_0x4e16bc[_0x4632('0x100')]>=_0x1e74be[_0x4632('0x127')]-0x1){return!![];}this[_0x4632('0xc8')]({'active':![],'countdropretry':_0x4e16bc[_0x4632('0x100')]+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be[_0x4632('0x129')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc['VoiceQueueId']||undefined,'CampaignId':_0x4e16bc[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x12a')));break;case 0xb:if(_0x4e16bc[_0x4632('0x10f')]>=_0x1e74be['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x4e16bc[_0x4632('0x10f')]+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be[_0x4632('0x12f')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc['CampaignId']||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x130')));break;case 0x13:if(_0x4e16bc[_0x4632('0x101')]>=_0x1e74be[_0x4632('0x106')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x4e16bc[_0x4632('0x101')]+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be[_0x4632('0x108')],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x4e16bc['ContactId'],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc[_0x4632('0xe0')]||undefined,'CampaignId':_0x4e16bc['CampaignId']||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x10b')));break;case 0x14:if(_0x4e16bc[_0x4632('0x102')]>=_0x1e74be[_0x4632('0x1a7')]-0x1){return!![];}this[_0x4632('0xc8')]({'active':![],'countagentrejectretry':_0x4e16bc[_0x4632('0x102')]+=0x1,'scheduledat':moment()[_0x4632('0x111')](_0x1e74be['dialAgentRejectRetryFrequency'],_0x4632('0x109'))[_0x4632('0x78')](_0x4632('0x10a')),'ContactId':_0x4e16bc[_0x4632('0xde')],'ListId':_0x4e16bc[_0x4632('0xdf')],'VoiceQueueId':_0x4e16bc['VoiceQueueId']||undefined,'CampaignId':_0x4e16bc['CampaignId']||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1a8')));break;default:return!![];}};Dialer[_0x4632('0x1a')]['callProgressDetecting']=function(_0x4db86c,_0x2db399,_0x435eaa){var _0x3d28c7=this;var _0x267188=new History(_0x4db86c);return new BPromise(function(_0x186e99,_0xb81a05){if(_['isUndefined'](_0x2db399)&&typeof _0x2db399!==_0x4632('0x170')){return _0xb81a05(msgResponse(_0x4632('0x1a9'),_0x4632('0x154'),_0x4632('0x1aa')));}if(_['isUndefined'](_0x435eaa)&&typeof _0x435eaa!==_0x4632('0x170')){return _0xb81a05(msgResponse(_0x4632('0x1a9'),_0x4632('0x154'),_0x4632('0x1ab')));}switch(_0x435eaa[_0x4632('0x11a')]){case'0':_0x2db399[_0x4632('0x1ac')]+=0x1;_0x267188['state']=0x0;_0x267188[_0x4632('0xae')]=_0x4632('0x1ad');_0x267188[_0x4632('0x10e')]+=0x1;_0x267188[_0x4632('0x126')]+=0x1;ami[_0x4632('0xf4')](_0x4632('0x1ae'),ut['buildObj'](_0x4db86c,_0x4632('0x1af')));_0x3d28c7[_0x4632('0xd5')](_0x267188)['catch'](loggerCatch(_0x4632('0xfc')));if(_0x3d28c7[_0x4632('0x19d')](0x0,_0x4db86c,_0x2db399)){if(_0x267188[_0x4632('0x10e')]>=_0x2db399[_0x4632('0x1a5')]){_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1b0'));}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2db399['outboundNoAnswerCallsDay']+=0x1;_0x267188['state']=0x3;_0x267188['statedesc']=_0x4632('0x1b1');_0x267188[_0x4632('0xff')]+=0x1;_0x267188[_0x4632('0x126')]+=0x1;ami[_0x4632('0xf4')]('custom:agentnoanswer',ut['buildObj'](_0x4db86c,_0x4632('0x1b2')));_0x3d28c7[_0x4632('0xd5')](_0x267188)[_0x4632('0xb8')](loggerCatch(_0x4632('0x1b3')));if(_0x3d28c7[_0x4632('0x19d')](0x3,_0x4db86c,_0x2db399)){if(_0x267188[_0x4632('0xff')]>=_0x2db399['dialNoAnswerMaxRetry']){_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1b4'));}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1b4'));}}break;case'5':_0x2db399[_0x4632('0x60')]+=0x1;_0x267188['state']=0x5;_0x267188['statedesc']=_0x4632('0x1b5');_0x267188[_0x4632('0xfd')]+=0x1;_0x267188['countglobal']+=0x1;ami[_0x4632('0xf4')](_0x4632('0x1b6'),ut['buildObj'](_0x4db86c,_0x4632('0x1b7')));_0x3d28c7[_0x4632('0xd5')](_0x267188)[_0x4632('0xb8')](loggerCatch(_0x4632('0x1b8')));if(_0x3d28c7['checkRetriveMax'](0x5,_0x4db86c,_0x2db399)){if(_0x267188['countbusyretry']>=_0x2db399[_0x4632('0x1b9')]){_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1ba'));}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1ba'));}}break;case'8':_0x2db399[_0x4632('0x1bb')]+=0x1;_0x267188['state']=0x8;_0x267188[_0x4632('0xae')]=_0x4632('0x1bc');_0x267188[_0x4632('0xfe')]+=0x1;_0x267188[_0x4632('0x126')]+=0x1;ami[_0x4632('0xf4')](_0x4632('0x1bd'),ut['buildObj'](_0x4db86c,_0x4632('0x1be')));_0x3d28c7[_0x4632('0xd5')](_0x267188)[_0x4632('0xb8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3d28c7['checkRetriveMax'](0x8,_0x4db86c,_0x2db399)){if(_0x267188[_0x4632('0xfe')]>=_0x2db399[_0x4632('0x1bf')]){_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1c0'));}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1c0'));}}break;case'11':_0x2db399[_0x4632('0x1c1')]+=0x1;_0x267188[_0x4632('0xad')]=0xb;_0x267188[_0x4632('0xae')]=_0x4632('0x12d');_0x267188[_0x4632('0x10f')]+=0x1;_0x267188[_0x4632('0x126')]+=0x1;_0x3d28c7[_0x4632('0xd5')](_0x267188)[_0x4632('0xb8')](loggerCatch(_0x4632('0x131')));if(_0x3d28c7[_0x4632('0x19d')](0xb,_0x4db86c,_0x2db399)){if(_0x267188[_0x4632('0x10f')]>=_0x2db399[_0x4632('0x12e')]){_0x3d28c7['createStateFinal'](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1c2'));}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1c2'));}}break;case'20':_0x2db399['outboundRejectCallsDay']+=0x1;_0x267188[_0x4632('0xad')]=0x14;_0x267188['statedesc']=_0x4632('0x1c3');_0x267188[_0x4632('0x102')]+=0x1;_0x267188['countglobal']+=0x1;ami[_0x4632('0xf4')](_0x4632('0x1c4'),ut[_0x4632('0xfa')](_0x4db86c,'agentreject'));_0x3d28c7[_0x4632('0xd5')](_0x267188)[_0x4632('0xb8')](loggerCatch(_0x4632('0x1c5')));if(_0x3d28c7[_0x4632('0x19d')](0x14,_0x4db86c,_0x2db399)){if(_0x267188[_0x4632('0x102')]>=_0x2db399['dialAgentRejectMaxRetry']){_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,'reason\x2020\x20agentreject');}else{_0x3d28c7[_0x4632('0x104')](_0x267188,_0x186e99,_0xb81a05,_0x4632('0x1c6'));}}break;default:_0x2db399[_0x4632('0x67')]+=0x1;_0x267188[_0x4632('0xad')]=0xc;_0x267188[_0x4632('0xae')]=_0x435eaa[_0x4632('0x11a')];_0x3d28c7['createHistory'](_0x267188)[_0x4632('0xb8')](loggerCatch(_0x4632('0x1c7')));if(_0x3d28c7[_0x4632('0x19d')](_0x435eaa[_0x4632('0x11a')],_0x4db86c,_0x2db399)){if(_0x267188['countbusyretry']+_0x267188[_0x4632('0xfe')]+_0x267188[_0x4632('0xff')]+_0x267188[_0x4632('0x10e')]+_0x267188['countdropretry']+_0x267188[_0x4632('0x10f')]+_0x267188[_0x4632('0x101')]+_0x267188[_0x4632('0x102')]>=_0x2db399[_0x4632('0x103')]){_0x3d28c7['stateGlobal'](_0x267188,_0x186e99,_0xb81a05,_0x435eaa[_0x4632('0x11a')]);}else{_0x3d28c7[_0x4632('0x107')](_0x267188,_0x186e99,_0xb81a05,_0x435eaa[_0x4632('0x11a')]);}}}});};Dialer[_0x4632('0x1a')][_0x4632('0x104')]=function(_0x55dbd0,_0x3872ae,_0x4527d8,_0x1859d0){var _0x2cf959=new Final(_0x55dbd0);_0x2cf959[_0x4632('0xad')]=0xf;_0x2cf959[_0x4632('0xae')]=_0x4632('0x1c8');this['createStateFinal'](_0x2cf959,_0x3872ae,_0x4527d8,_0x1859d0);};Dialer[_0x4632('0x1a')][_0x4632('0x107')]=function(_0x136a1b,_0x3459e9,_0x37d69e,_0x2028a3){this[_0x4632('0xd3')](_0x136a1b)[_0x4632('0xc2')](function(){return _0x3459e9(msgResponse(_0x4632('0x1a9'),'Success',_0x2028a3));})[_0x4632('0xb8')](function(){return _0x37d69e(msgResponse(_0x4632('0x1c9'),_0x4632('0x154'),'contact\x20not\x20moved'));});};Dialer[_0x4632('0x1a')][_0x4632('0x8')]=function(_0x534b4d){var _0x1fd7b6=_0x534b4d[_0x4632('0x1ca')]/0x64;var _0x515d2b=_0x534b4d[_0x4632('0x62')]/(_0x534b4d[_0x4632('0x62')]+_0x534b4d[_0x4632('0x5e')]);var _0x34cabb=Math[_0x4632('0x1cb')](_0x534b4d[_0x4632('0x1cc')]*(_0x534b4d[_0x4632('0x1cd')]/0x64));var _0x38bdba=Math[_0x4632('0x1cb')](_0x534b4d['predictiveIntervalAvailable']*(_0x534b4d['predictiveIntervalMinThreshold']/0x64));var _0x3b6bfd=_0x534b4d[_0x4632('0x4f')]+_0x534b4d[_0x4632('0x54')];var _0x284a91=Math['floor'](_0x534b4d[_0x4632('0x72')]*_0x534b4d[_0x4632('0x73')]*_0x534b4d[_0x4632('0x6e')]*_0x534b4d[_0x4632('0x6f')]);if(_[_0x4632('0x87')](_0x534b4d['startProgressive'])){if(!_[_0x4632('0x87')](_0x534b4d[_0x4632('0x28')])){_0x534b4d[_0x4632('0x28')]=undefined;loggerPredictive[_0x4632('0x9c')]('[startMethodPredictive][StartProgressive]',_0x4632('0x1ce'));}if(!_[_0x4632('0x87')](_0x534b4d[_0x4632('0x97')])){loggerPredictive[_0x4632('0x9c')](_0x4632('0x1cf'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x534b4d[_0x4632('0x97')]);_0x534b4d[_0x4632('0x97')]=undefined;}_0x534b4d[_0x4632('0x29')]=moment()['format'](_0x4632('0x10a'));loggerPredictive[_0x4632('0x7f')](_0x534b4d['name'],'collection\x20data\x20in\x20progressive\x20at',_0x534b4d[_0x4632('0x29')]);this[_0x4632('0x161')](_0x534b4d,0x1);}else if(ifInterval(_0x534b4d[_0x4632('0x1d0')],_0x534b4d[_0x4632('0x29')])){this[_0x4632('0x161')](_0x534b4d,0x1);loggerPredictiveCalls[_0x4632('0x7f')](_0x4632('0x1d1'),_0x534b4d[_0x4632('0x29')],_0x534b4d[_0x4632('0x43')]);_0x534b4d[_0x4632('0x72')]=0x0;_0x534b4d[_0x4632('0x6d')]=0x0;}else if(_0x1fd7b6<_0x515d2b&&_0x534b4d[_0x4632('0x1d2')]===_0x4632('0x1d3')){freeVariablesPredictive(_0x534b4d);loggerPredictive[_0x4632('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x4632('0x1d4'),_0x515d2b,'startProgressive',_0x534b4d[_0x4632('0x43')]);}else if(_0x284a91<_0x534b4d[_0x4632('0x6d')]&&_0x534b4d[_0x4632('0x1d2')]===_0x4632('0x1d3')){freeVariablesPredictive(_0x534b4d);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x4632('0x1d5'),_0x284a91,_0x4632('0x1d6'),_0x534b4d[_0x4632('0x6d')],'startProgressive',_0x534b4d[_0x4632('0x43')]);}else if(!ifInterval(_0x534b4d['dialPredictiveInterval'],_0x534b4d[_0x4632('0x29')])&&_['isUndefined'](_0x534b4d['startPredictive'])&&!_[_0x4632('0x87')](_0x534b4d[_0x4632('0x29')])){_0x534b4d['startPredictive']=moment()['format'](_0x4632('0x10a'));loggerPredictive[_0x4632('0x7f')](_0x534b4d[_0x4632('0x43')],_0x4632('0x1d7'),_0x534b4d[_0x4632('0x28')]);this[_0x4632('0xc6')](_0x534b4d[_0x4632('0x1d0')])[_0x4632('0xc2')](this['getDataPredictive'](_0x534b4d))[_0x4632('0xc2')](mergeDataErlangB(_0x534b4d))[_0x4632('0xc2')](this[_0x4632('0x1d8')](_0x534b4d))[_0x4632('0xb8')](loggerCatchPredictive(_0x4632('0x1d9'),_0x534b4d));}else if(!ifInterval(_0x534b4d[_0x4632('0x1d0')],_0x534b4d[_0x4632('0x28')])){_0x534b4d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x534b4d['startPredictive']=moment()[_0x4632('0x78')](_0x4632('0x10a'));loggerPredictive[_0x4632('0x7f')](_0x534b4d[_0x4632('0x43')],_0x4632('0x1da'),_0x534b4d[_0x4632('0x28')]);clearInterval(_0x534b4d[_0x4632('0x97')]);_0x534b4d[_0x4632('0x97')]=undefined;this[_0x4632('0xc6')](_0x534b4d[_0x4632('0x1d0')])['then'](this[_0x4632('0x1db')](_0x534b4d))[_0x4632('0xc2')](mergeDataErlangB(_0x534b4d))[_0x4632('0xc2')](this[_0x4632('0x1d8')](_0x534b4d))[_0x4632('0xb8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x534b4d));}else if(_0x534b4d['predictiveIntervalAvailable']&&_0x3b6bfd<_0x534b4d['predictiveIntervalAvailable']-_0x38bdba){freeVariablesPredictive(_0x534b4d);loggerPredictive[_0x4632('0x7f')](_0x534b4d[_0x4632('0x43')],_0x4632('0x1dc'),_0x3b6bfd,_0x4632('0x1dd'),_0x534b4d[_0x4632('0x1cc')],'-',_0x38bdba,'=',_0x534b4d[_0x4632('0x1cc')]-_0x38bdba,')');}else if(_0x534b4d['predictiveIntervalAvailable']&&_0x3b6bfd>_0x534b4d[_0x4632('0x1cc')]+_0x34cabb){freeVariablesPredictive(_0x534b4d);loggerPredictive['info'](_0x534b4d[_0x4632('0x43')],_0x4632('0x1dc'),_0x3b6bfd,')\x20are\x20more\x20than\x20threshold\x20(',_0x534b4d[_0x4632('0x1cc')],'+',_0x34cabb,'=',_0x534b4d[_0x4632('0x1cc')]+_0x34cabb,')');}};Dialer[_0x4632('0x1a')][_0x4632('0x1db')]=function(_0x1d1078){var _0x36feb4=this;return function(_0x334850){return new BPromise(function(_0x1e6ca9,_0x2a6532){_[_0x4632('0x92')](_0x1d1078,_0x334850[0x0]);if(checkGetDataPredictive(_0x334850[0x0])){var _0x29abc2=_0x1d1078['predictiveIntervalAvailable']=_0x1d1078['talking']+_0x1d1078[_0x4632('0x4f')];var _0x46ea89=_0x1d1078['dialPredictiveInterval']*0x3c;var _0x660f6=_0x334850[0x0][_0x4632('0x6a')]+_0x334850[0x0][_0x4632('0x69')];var _0x1444af=(_0x334850[0x0][_0x4632('0x68')]+_0x334850[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x334850[0x0][_0x4632('0x84')])/_0x334850[0x0][_0x4632('0x70')];_0x1d1078[_0x4632('0x6e')]=_0x1444af>0x0?_0x1444af:0x1;switch(_0x1d1078[_0x4632('0x1d2')]){case _0x4632('0x1d3'):var _0x44f508=_0x1d1078[_0x4632('0x1ca')]/0x64;return _0x36feb4[_0x4632('0x1de')](_0x29abc2,_0x46ea89,_0x660f6,_0x1444af,_0x44f508)[_0x4632('0xc2')](function(_0x528516){return _0x1e6ca9(_0x528516);});case _0x4632('0x1df'):var _0x3e7947=_0x1d1078['dialPredictiveOptimizationPercentage']/0x64;return _0x36feb4['busyFactor'](_0x29abc2,_0x46ea89,_0x660f6,_0x1444af,_0x3e7947)['then'](function(_0x477969){return _0x1e6ca9(_0x477969);});default:return _0x2a6532(msgResponse('[getDataPredictive]',_0x4632('0x154'),_0x4632('0x1e0')));}}else{return _0x2a6532(msgResponse(_0x4632('0x1e1'),'Failure',_0x4632('0x1e2')));}});};};Dialer[_0x4632('0x1a')][_0x4632('0x1e3')]=function(_0x5f0ec0){var _0x1de7d9=this;return function(_0x1e761e){return new BPromise(function(_0xb4dfa6,_0x5f1890){_[_0x4632('0x92')](_0x5f0ec0,_0x1e761e[0x0]);if(checkGetDataPredictive(_0x1e761e[0x0])){loggerPredictive[_0x4632('0x7f')](JSON['stringify'](_0x1e761e[0x0]));if(_0x5f0ec0[_0x4632('0x1d2')]===_0x4632('0x1d3')){return _0x1de7d9[_0x4632('0xd1')](_0x5f0ec0['id'])['then'](function(_0x1ac5c3){var _0xa8361d=_0x5f0ec0[_0x4632('0x50')]-_0x1ac5c3[0x0][_0x4632('0x1e4')];var _0x1bd2b0=_0x5f0ec0[_0x4632('0x1d0')]*0x3c;var _0x6800a4=_0x1e761e[0x0][_0x4632('0x6a')]+_0x1e761e[0x0]['predictiveIntervalAvgHoldtime'];var _0x190347=(_0x1e761e[0x0][_0x4632('0x68')]+_0x1e761e[0x0][_0x4632('0x6b')]+_0x1e761e[0x0][_0x4632('0x84')])/_0x1e761e[0x0][_0x4632('0x70')];var _0x2ea605=_0x5f0ec0['dialPredictiveOptimizationPercentage']/0x64;_0x5f0ec0[_0x4632('0x1e5')]=_0x1ac5c3[0x0][_0x4632('0x1e4')]||0x0;_0x5f0ec0['predictiveIntervalHitRate']=_0x190347>0x0?_0x190347:0x1;return _0x1de7d9['abandonmentRate'](_0xa8361d,_0x1bd2b0,_0x6800a4,_0x190347,_0x2ea605);})[_0x4632('0xc2')](function(_0x287138){return _0xb4dfa6(_0x287138);})['catch'](function(_0x42b8c0){return _0x5f1890(msgResponse('[CatchErlangB]',_0x4632('0x154'),JSON[_0x4632('0x49')](_0x42b8c0)));});}if(_0x5f0ec0[_0x4632('0x1d2')]===_0x4632('0x1df')){return _0x1de7d9['getVoiceQueueRtPauses'](_0x5f0ec0['id'])[_0x4632('0xc2')](function(_0x35f8c3){var _0x25070d=_0x5f0ec0['loggedIn']-_0x35f8c3[0x0]['outboundQueuePauses'];var _0x2c6966=_0x5f0ec0['dialPredictiveInterval']*0x3c;var _0x3ae3e3=_0x1e761e[0x0][_0x4632('0x6a')]+_0x1e761e[0x0][_0x4632('0x69')];var _0x525123=(_0x1e761e[0x0][_0x4632('0x68')]+_0x1e761e[0x0][_0x4632('0x6b')]+_0x1e761e[0x0][_0x4632('0x84')])/_0x1e761e[0x0][_0x4632('0x70')];var _0x184b6d=_0x5f0ec0[_0x4632('0x1ca')]/0x64;_0x5f0ec0[_0x4632('0x1e5')]=_0x35f8c3[0x0][_0x4632('0x1e4')]||0x0;_0x5f0ec0[_0x4632('0x6e')]=_0x525123>0x0?_0x525123:0x1;return _0x1de7d9['busyFactor'](_0x25070d,_0x2c6966,_0x3ae3e3,_0x525123,_0x184b6d);})[_0x4632('0xc2')](function(_0xf7bc7a){return _0xb4dfa6(_0xf7bc7a);})['catch'](function(_0x345846){return _0x5f1890(msgResponse(_0x4632('0x1e6'),_0x4632('0x154'),JSON[_0x4632('0x49')](_0x345846)));});}}else{return _0x5f1890(msgResponse('[getDataPredictive]','Failure',_0x4632('0x1e2')));}});};};Dialer[_0x4632('0x1a')][_0x4632('0x1d8')]=function(_0xd02862){var _0x421374=this;return function(){var _0x3eca94=0x0;var _0x4beb98=Math[_0x4632('0x1e7')](_0xd02862['erlangCallToSecond']*0x3e8);if(_0x4beb98>0x0){_0x4beb98=_0x4beb98<0x64?0x64:_0x4beb98;loggerPredictive['info'](_0xd02862[_0x4632('0x43')],'one\x20call\x20every:',_0x4beb98,'milliseconds');_0xd02862[_0x4632('0x97')]=setInterval(function(){_0x421374[_0x4632('0x97')](_0xd02862);loggerPredictiveCalls['info'](_0x4632('0x1e8'),_0x3eca94+=0x1);},_0x4beb98);}else{loggerPredictive[_0x4632('0x7f')](_0xd02862[_0x4632('0x43')],_0x4632('0x1e9'));}};};Dialer['prototype'][_0x4632('0x1ea')]=function(_0x360d0c,_0x45d64f){var _0x294b3d=this;return function(_0xbe33cd){if(_['isEmpty'](_0xbe33cd)){if(_[_0x4632('0xb4')](_0x45d64f['UserId'])||!_0x45d64f[_0x4632('0x1eb')]){if(_0x360d0c['dialMethod']===_0x4632('0x7')){_0x360d0c[_0x4632('0x139')]=_[_0x4632('0x87')](_0x360d0c[_0x4632('0x139')])?!![]:_0x360d0c['queueStatusComplete'];var _0x155932=uuid['v4']();_0x294b3d['actions'][_0x155932]=new Action(_0x360d0c,_0x45d64f,_0x155932);loggerBooked['info'](_0x4632('0x1ec'),_0x155932,'queueStatusComplete:\x20',JSON[_0x4632('0x49')](_0x360d0c['queueStatusComplete']),_0x4632('0x1ed'),_0x360d0c['name']);if(_0x360d0c[_0x4632('0x139')]){_0x360d0c[_0x4632('0x139')]=![];_0x294b3d[_0x4632('0x2b')][_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xbb')]]=[];ami[_0x4632('0xb5')]({'actionid':_0x155932,'action':_0x4632('0x1ee'),'queue':_0x360d0c[_0x4632('0x43')]})[_0x4632('0xb8')](function(){_0x294b3d['updateOriginated'](_0x360d0c);_0x294b3d[_0x4632('0xc8')]({'active':![],'ContactId':_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xde')],'ListId':_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xdf')],'VoiceQueueId':_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xe0')]||undefined,'CampaignId':_0x294b3d['actions'][_0x155932]['CampaignId']||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1ef')));delete _0x294b3d[_0x4632('0x24')][_0x155932];});}else{loggerBooked[_0x4632('0x7f')](_0x4632('0x1f0'),JSON[_0x4632('0x49')](_0x360d0c[_0x4632('0x139')]),_0x4632('0x1ed'),_0x360d0c[_0x4632('0x43')]);_0x294b3d['updateOriginated'](_0x360d0c);_0x294b3d[_0x4632('0xc8')]({'active':![],'ContactId':_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xde')],'ListId':_0x294b3d['actions'][_0x155932]['ListId'],'VoiceQueueId':_0x294b3d[_0x4632('0x24')][_0x155932]['VoiceQueueId']||undefined,'CampaignId':_0x294b3d[_0x4632('0x24')][_0x155932][_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1ef')));delete _0x294b3d[_0x4632('0x24')][_0x155932];}}else{return _0x294b3d[_0x4632('0x1f1')](_0x360d0c,_0x45d64f);}}else{if(getDiff(_0x45d64f[_0x4632('0x1f2')])<_0x360d0c[_0x4632('0x1f3')]*0x3c){if(_0x45d64f['Agent']&&!_0x45d64f[_0x4632('0x1f4')][_0x4632('0x1f5')]){_0x294b3d[_0x4632('0x13b')][_0x4632('0x13c')](_0x45d64f['id'])['finally'](function(){_0x294b3d[_0x4632('0xba')](_0x360d0c);});}else{_0x294b3d[_0x4632('0xca')]({'active':![]},_0x45d64f['id'],0x1)[_0x4632('0x1d')](function(){_0x294b3d['updateOriginated'](_0x360d0c);});}}else{_0x360d0c[_0x4632('0x65')]+=0x1;_0x294b3d['updateOriginated'](_0x360d0c);if(_0x360d0c[_0x4632('0x1f6')]){_0x294b3d[_0x4632('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x45d64f[_0x4632('0xde')],'ListId':_0x45d64f['ListId'],'VoiceQueueId':_0x45d64f[_0x4632('0xe0')]||undefined,'CampaignId':_0x45d64f[_0x4632('0xe1')]||undefined})[_0x4632('0xb8')](loggerCatch(_0x4632('0x1f7')));_0x294b3d[_0x4632('0xd5')](createObjHistory(_0x360d0c,_0x45d64f,_0x4632('0x1f8'),0x17,_0x4632('0x1f9')))[_0x4632('0xb8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x294b3d[_0x4632('0xdc')](createObjHistory(_0x360d0c,_0x45d64f,_0x4632('0x1fa'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x4632('0x1fb'));}}}}else{_0x360d0c[_0x4632('0x5f')]+=0x1;_0x294b3d[_0x4632('0xdc')](createObjHistory(_0x360d0c,_0x45d64f,_0x4632('0x1fc'),0xd,'Blacklist'),_0x4632('0x1fd'),_0x4632('0x1fe'));throw'inBlackList';}};};Dialer[_0x4632('0x1a')][_0x4632('0x1ff')]=function(_0xcf063c){var _0x2a2496=this;var _0x18c3ba=_0xcf063c[_0x4632('0x200')]-_0xcf063c['originated']-_0xcf063c[_0x4632('0xcd')];emitCampaignSummary(_0xcf063c);if(_0x18c3ba>0x0){if(_0x18c3ba>this['maxNumberOriginate']){_0x18c3ba=this[_0x4632('0x22')];}_0xcf063c['temp']+=_0x18c3ba;this[_0x4632('0xcf')](_0xcf063c['id'],_0x18c3ba,_0xcf063c[_0x4632('0x201')],_0xcf063c)[_0x4632('0xc2')](function(_0x538e8d){_0xcf063c['temp']-=_0x18c3ba;_0xcf063c['temp']=_0xcf063c[_0x4632('0xcd')]>0x0?_0xcf063c['temp']:0x0;if(!checkContactEmpty(_0x538e8d)){_0xcf063c[_0x4632('0x40')]=_0x4632('0x202');logger[_0x4632('0x7f')](_0x4632('0x203')+_0xcf063c['name']);}else{_0xcf063c[_0x4632('0x71')]+=_0x538e8d[_0x4632('0x9f')];_0xcf063c[_0x4632('0x40')]=_0x4632('0x204');for(var _0xb75898=0x0;_0xb75898<_0x538e8d[_0x4632('0x9f')];_0xb75898+=0x1){_0xcf063c['ivrTotalCallsDays']+=0x1;if(_[_0x4632('0xb4')](_0x538e8d[_0xb75898])||_[_0x4632('0xb4')](_0x538e8d[_0xb75898][_0x4632('0x173')])||_[_0x4632('0xb4')](_0x538e8d[_0xb75898]['Contact'][_0x4632('0x172')])){_0x2a2496['emptyContact']('[actionOriginate]\x20',_0xcf063c,_0x538e8d[_0xb75898]);}else{_0x2a2496[_0x4632('0xc4')](_[_0x4632('0xdd')](_0x538e8d[_0xb75898],[_0x4632('0xe1'),'Contact.phone']))[_0x4632('0xc2')](_0x2a2496[_0x4632('0x1ea')](_0xcf063c,_0x538e8d[_0xb75898]))['catch'](_0x2a2496['loggerHandler'](_0x4632('0x205'),_0xcf063c));}}}})[_0x4632('0xb8')](loggerGetContactDialer(_0x4632('0x206'),_0xcf063c,_0x18c3ba));}};Dialer[_0x4632('0x1a')][_0x4632('0x161')]=function(_0x20f749,_0x2d050e){var _0x358669=this;var _0x55db5b=[];var _0x1b9849=_0x2d050e>=0x1?_0x2d050e:0x1;if(_0x20f749[_0x4632('0x59')]==='booked'){_0x1b9849=0x1;}var _0x5cd945=Math['floor'](_0x20f749[_0x4632('0x4f')]*_0x1b9849)-_0x20f749['originated']-_0x20f749[_0x4632('0xcd')];emitVoiceQueueSummary(_0x20f749);if(_0x20f749[_0x4632('0x207')]>0x0){var _0x910616=_0x20f749['dialLimitQueue']-_0x20f749[_0x4632('0x71')]-_0x20f749[_0x4632('0x54')]-_0x20f749[_0x4632('0xcd')]-_0x20f749[_0x4632('0x51')];if(_0x5cd945>_0x910616){_0x5cd945=_0x910616;}}if(_0x5cd945>0x0){if(_0x20f749[_0x4632('0x59')]==='booked'){_0x5cd945=0x1;}if(_0x5cd945>this[_0x4632('0x22')]){_0x5cd945=this[_0x4632('0x22')];}_0x20f749['temp']+=_0x5cd945;for(var _0x4013fe in this['agents']){if(typeof this[_0x4632('0x21')][_0x4013fe]!==_0x4632('0xa0')){if(this[_0x4632('0x21')][_0x4013fe]['state']===_0x4632('0x208')&&this[_0x4632('0x21')][_0x4013fe]['status']===_0x4632('0xe7')){_0x55db5b['push'](this[_0x4632('0x21')][_0x4013fe]['id']);}}}this[_0x4632('0xcc')](_0x20f749['id'],_0x55db5b,_0x5cd945,_0x20f749['dialOrderByScheduledAt'],_0x20f749)[_0x4632('0xc2')](function(_0x296cd4){_0x20f749['temp']-=_0x5cd945;_0x20f749['temp']=_0x20f749[_0x4632('0xcd')]>0x0?_0x20f749[_0x4632('0xcd')]:0x0;if(!checkContactEmpty(_0x296cd4)){_0x358669[_0x4632('0xbf')](_0x20f749)[_0x4632('0xc2')](sendMessageReschedule(_0x20f749))[_0x4632('0xb8')](loggerCatch(_0x4632('0xc0')));}else{_0x20f749['originated']+=_0x296cd4[_0x4632('0x9f')];_0x20f749['message']=_0x20f749[_0x4632('0x59')]===_0x4632('0x7')?_0x4632('0x179'):_0x4632('0x204');for(var _0x5da9c9=0x0;_0x5da9c9<_0x296cd4[_0x4632('0x9f')];_0x5da9c9+=0x1){if(_[_0x4632('0xb4')](_0x296cd4[_0x5da9c9])||_['isNil'](_0x296cd4[_0x5da9c9][_0x4632('0x173')])||_[_0x4632('0xb4')](_0x296cd4[_0x5da9c9][_0x4632('0x173')]['phone'])){_0x358669[_0x4632('0xda')](_0x4632('0x209'),_0x20f749,_0x296cd4[_0x5da9c9]);}else{_0x358669[_0x4632('0xc1')](_[_0x4632('0xdd')](_0x296cd4[_0x5da9c9],['VoiceQueueId',_0x4632('0x20a')]))['then'](_0x358669['checkContactBlack'](_0x20f749,_0x296cd4[_0x5da9c9]))[_0x4632('0xb8')](_0x358669[_0x4632('0xd9')](_0x4632('0x209'),_0x20f749));}}}})[_0x4632('0xb8')](loggerGetContactDialer(_0x4632('0x20b'),_0x20f749,_0x5cd945));}};Dialer[_0x4632('0x1a')][_0x4632('0x97')]=function(_0x284580){if(_0x284580[_0x4632('0x207')]>0x0){var _0x2aecd9=_0x284580['dialLimitQueue']-_0x284580['originated']-_0x284580[_0x4632('0x54')];if(_0x2aecd9>0x0){this['tryOriginatePredictive'](_0x284580);}else{loggerPredictiveCalls[_0x4632('0x7f')](_0x4632('0x20c'));}}else{this[_0x4632('0x20d')](_0x284580);}};Dialer[_0x4632('0x1a')][_0x4632('0x20d')]=function(_0xf5e3be){var _0x179ca9=this;var _0x4cd0f3=[];_0xf5e3be[_0x4632('0x71')]+=0x1;for(var _0x9ca007 in this[_0x4632('0x21')]){if(typeof this['agents'][_0x9ca007]!==_0x4632('0xa0')){if(this[_0x4632('0x21')][_0x9ca007]['state']===_0x4632('0x208')&&this[_0x4632('0x21')][_0x9ca007][_0x4632('0xb6')]===_0x4632('0xe7')){_0x4cd0f3['push'](this[_0x4632('0x21')][_0x9ca007]['id']);}}}this['getContactDialer'](_0xf5e3be['id'],_0x4cd0f3,0x1,_0xf5e3be[_0x4632('0x201')],_0xf5e3be)[_0x4632('0xc2')](function(_0x4a8a6b){if(!checkContactEmpty(_0x4a8a6b)){checkContactLowerLimitOriginate(_0xf5e3be,0x1,0x0);_0x179ca9[_0x4632('0xbf')](_0xf5e3be)[_0x4632('0xc2')](sendMessageReschedule(_0xf5e3be))[_0x4632('0xb8')](loggerCatch('[countReScheduled]\x20'));}else{_0xf5e3be[_0x4632('0x40')]=_0x4632('0x204');if(_[_0x4632('0xb4')](_0x4a8a6b[0x0])||_[_0x4632('0xb4')](_0x4a8a6b[0x0][_0x4632('0x173')])||_[_0x4632('0xb4')](_0x4a8a6b[0x0]['Contact'][_0x4632('0x172')])){_0x179ca9[_0x4632('0xda')](_0x4632('0x209'),_0xf5e3be,_0x4a8a6b[0x0]);}else{_0x179ca9[_0x4632('0xc1')](_[_0x4632('0xdd')](_0x4a8a6b[0x0],[_0x4632('0xe0'),_0x4632('0x20a')]))['then'](_0x179ca9[_0x4632('0x1ea')](_0xf5e3be,_0x4a8a6b[0x0]))[_0x4632('0xb8')](_0x179ca9['loggerHandler'](_0x4632('0x20e'),_0xf5e3be));}}})[_0x4632('0xb8')](loggerGetContactDialer(_0x4632('0x20f'),_0xf5e3be,0x1));emitVoiceQueueSummary(_0xf5e3be);};Dialer['prototype'][_0x4632('0x1de')]=function(_0x104c9f,_0x376b55,_0x292f89,_0x23f6ad,_0x54e7b5,_0x87500c){loggerPredictive[_0x4632('0x7f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4632('0x7f')](_0x4632('0x210'),_0x104c9f);loggerPredictive[_0x4632('0x7f')](_0x4632('0x211'),_0x376b55);loggerPredictive[_0x4632('0x7f')](_0x4632('0x212'),_0x292f89);loggerPredictive[_0x4632('0x7f')](_0x4632('0x213'),_0x23f6ad);loggerPredictive[_0x4632('0x7f')](_0x4632('0x214'),_0x54e7b5);loggerPredictive[_0x4632('0x7f')](_0x4632('0x91'));return new BPromise(function(_0x351607,_0x2af0b3){if(_0x104c9f<=0x0||isNaN(_0x104c9f)){return _0x2af0b3(msgResponse(_0x4632('0x215'),_0x4632('0x48'),_0x4632('0x216')+_0x104c9f));}if(_0x292f89<=0x0||isNaN(_0x292f89)){return _0x2af0b3(msgResponse(_0x4632('0x215'),_0x4632('0x48'),_0x4632('0x217')+_0x292f89));}if(_0x23f6ad<=0x0||isNaN(_0x23f6ad)){return _0x2af0b3(msgResponse(_0x4632('0x215'),_0x4632('0x48'),_0x4632('0x218')+_0x23f6ad));}if(_0x376b55<=0x0||isNaN(_0x376b55)){return _0x2af0b3(msgResponse(_0x4632('0x215'),_0x4632('0x48'),_0x4632('0x219')+_0x376b55));}if(_0x54e7b5<=0x0||isNaN(_0x54e7b5)){return _0x2af0b3(msgResponse(_0x4632('0x215'),'Error',_0x4632('0x21a')+_0x54e7b5));}_0x87500c=_0x87500c||0x0;var _0x79fa27=0x1/_0x292f89;var _0x45a691=0x0;var _0x202515=0x0;var _0x552340=0x0;var _0x1469db=0x0;for(var _0x1d4dc5=0x0;_0x552340<_0x54e7b5;_0x1d4dc5+=0x1){_0x202515=_0x1d4dc5/_0x376b55;_0x45a691=(_0x23f6ad*_0x202515+_0x87500c)/_0x79fa27;_0x552340=erlangb(_0x45a691,_0x104c9f);_0x1469db=_0x45a691/_0x104c9f*(0x1-erlangb(_0x45a691,_0x104c9f));}return _0x351607({'erlangCalls':_0x1d4dc5,'erlangCallToSecond':_0x376b55/_0x1d4dc5,'erlangAbandonmentRate':_0x552340,'erlangBusyFactor':_0x1469db});});};Dialer['prototype'][_0x4632('0x21b')]=function(_0x34d489,_0x1ba526,_0x132dbe,_0x5a227c,_0x40d7f4,_0xe3a70b){loggerPredictive[_0x4632('0x7f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x4632('0x7f')](_0x4632('0x210'),_0x34d489);loggerPredictive[_0x4632('0x7f')](_0x4632('0x211'),_0x1ba526);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',_0x132dbe);loggerPredictive['info'](_0x4632('0x213'),_0x5a227c);loggerPredictive[_0x4632('0x7f')](_0x4632('0x21c'),_0x40d7f4);loggerPredictive[_0x4632('0x7f')](_0x4632('0x91'));return new BPromise(function(_0x350ece,_0x369727){if(_0x34d489<=0x0||isNaN(_0x34d489)){return _0x369727(msgResponse(_0x4632('0x21d'),'Error',_0x4632('0x216')+_0x34d489));}if(_0x132dbe<=0x0||isNaN(_0x132dbe)){return _0x369727(msgResponse(_0x4632('0x21d'),'Error',_0x4632('0x217')+_0x132dbe));}if(_0x5a227c<=0x0||isNaN(_0x5a227c)){return _0x369727(msgResponse(_0x4632('0x21d'),_0x4632('0x48'),_0x4632('0x218')+_0x5a227c));}if(_0x1ba526<=0x0||isNaN(_0x1ba526)){return _0x369727(msgResponse(_0x4632('0x21d'),_0x4632('0x48'),'interval\x20=\x20'+_0x1ba526));}if(_0x40d7f4<=0x0||isNaN(_0x40d7f4)){return _0x369727(msgResponse(_0x4632('0x21d'),_0x4632('0x48'),_0x4632('0x21e')+_0x40d7f4));}_0xe3a70b=_0xe3a70b||0x0;var _0x4e8391=0x1/_0x132dbe;var _0xb5308f=0x0;var _0x2d636=0x0;var _0x16ea13=0x0;var _0x4d8737=0x0;for(var _0x5b2476=0x0;_0x4d8737<_0x40d7f4;_0x5b2476+=0x1){_0x2d636=_0x5b2476/_0x1ba526;_0xb5308f=(_0x5a227c*_0x2d636+_0xe3a70b)/_0x4e8391;_0x16ea13=erlangb(_0xb5308f,_0x34d489);_0x4d8737=_0xb5308f/_0x34d489*(0x1-erlangb(_0xb5308f,_0x34d489));}return _0x350ece({'erlangCalls':_0x5b2476,'erlangCallToSecond':_0x1ba526/_0x5b2476,'erlangAbandonmentRate':_0x16ea13,'erlangBusyFactor':_0x4d8737});});};module['exports']=Dialer; \ No newline at end of file +var _0x5db8=['[syncQueueSummary]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','reason','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','dialPredictiveOptimizationPercentage','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','tryOriginatePredictive','not_inuse','[actionOriginate]\x20','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','./action','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','name','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','uniqueid','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr]','countbusyretry','countnoanswerretry','countnosuchnumberretry','createStateFinal','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','outboundUnknownCallsDay','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','Drop','dropreason','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','stateinterface','strategy','push','merge','idHopper','paused','[booked][unlockQueueStatus]','queueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','run','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','predictive','Queue','launchHandleIvr','handleIvr','dialActive','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone'];(function(_0x149955,_0xe033d3){var _0x943baa=function(_0x3de40b){while(--_0x3de40b){_0x149955['push'](_0x149955['shift']());}};_0x943baa(++_0xe033d3);}(_0x5db8,0xbb));var _0x85db=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x5db8[_0x1460f6];return _0x46ce94;};'use strict';var util=require(_0x85db('0x0'));var _=require(_0x85db('0x1'));var BPromise=require(_0x85db('0x2'));var uuid=require('uuid');var moment=require(_0x85db('0x3'));var rr=require('rr');var md5=require(_0x85db('0x4'));var Redis=require(_0x85db('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x85db('0x6'))(_0x85db('0x7'));var loggerBooked=require(_0x85db('0x6'))(_0x85db('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x85db('0x6'))(_0x85db('0x9'));var loggerSyncQueueSummary=require(_0x85db('0x6'))(_0x85db('0xa'));var ami=require('../ami');config[_0x85db('0xb')]=_['defaults'](config[_0x85db('0xb')],{'host':_0x85db('0xc'),'port':0x18eb});var io=require(_0x85db('0xd'))(new Redis(config[_0x85db('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x85db('0xe'));var Action=require(_0x85db('0xf'));var History=require('./history');var Final=require(_0x85db('0x10'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x85db('0x11'));var Hangup=require(_0x85db('0x12'));var ipAgi=process[_0x85db('0x13')][_0x85db('0x14')]||_0x85db('0x15');var strategy={'rrmemory':_0x85db('0x16'),'roundrobin':_0x85db('0x17')};var Sequence=function(){};Sequence[_0x85db('0x18')][_0x85db('0x19')]=function(_0x415281){this[_0x85db('0x1a')]=this[_0x85db('0x1a')]?this[_0x85db('0x1a')]['finally'](_0x415281):_0x415281();};function Dialer(_0x27bd65,_0x175622){this[_0x85db('0x1b')]=new Sequence();this[_0x85db('0x1c')]=_0x175622;this[_0x85db('0x1d')]=_0x27bd65[_0x85db('0x1d')];this[_0x85db('0x1e')]=_0x27bd65['campaigns'];this[_0x85db('0x1f')]=_0x27bd65[_0x85db('0x1f')];this[_0x85db('0x20')]=_0x27bd65[_0x85db('0x20')];this[_0x85db('0x21')]=config[_0x85db('0x21')]||0x2;this[_0x85db('0x22')]={};this[_0x85db('0x23')]={};this[_0x85db('0x24')]={};this[_0x85db('0x25')]={};this['optionPredictive']={};this[_0x85db('0x26')]={};this[_0x85db('0x27')]={};this[_0x85db('0x28')]={};this[_0x85db('0x29')]={};this[_0x85db('0x2a')]={};ami['on'](_0x85db('0x2b'),this[_0x85db('0x2c')][_0x85db('0x2d')](this));ami['on']('queuecallerabandon',this[_0x85db('0x2e')][_0x85db('0x2d')](this));ami['on'](_0x85db('0x2f'),this[_0x85db('0x30')][_0x85db('0x2d')](this));ami['on'](_0x85db('0x31'),this['syncAgentComplete'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x32'),this[_0x85db('0xa')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x33'),this[_0x85db('0x34')]['bind'](this));ami['on'](_0x85db('0x35'),this[_0x85db('0x36')][_0x85db('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x37'),this[_0x85db('0x38')][_0x85db('0x2d')](this));this[_0x85db('0x39')]();this[_0x85db('0x3a')]();}function isNotNull(_0x8af4a4){return _0x8af4a4!==null&&!_[_0x85db('0x3b')](_0x8af4a4);}function checkIsLoggedIn(_0x6ee161,_0x1edc8d){return function(){if(_0x1edc8d<=0x0){_0x6ee161['message']='AGENTS_NOT_LOGGED';throw _0x6ee161[_0x85db('0x3c')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x22e404){return _0x22e404;}function checkIsActive(_0x203cad,_0x5abdb7){return function(){if(!isActive(_0x5abdb7)){_0x203cad[_0x85db('0x3d')]=_0x85db('0x3e');throw _0x203cad[_0x85db('0x3c')]+_0x85db('0x3f');}};}function checkInterval(_0x515a06){return function(){if(!isNotNull(_0x515a06[_0x85db('0x40')])){_0x515a06[_0x85db('0x3d')]=_0x85db('0x41');throw _0x515a06[_0x85db('0x3c')]+_0x85db('0x42');}if(!isNotNull(_0x515a06['Interval'][_0x85db('0x43')])){_0x515a06[_0x85db('0x3d')]=_0x85db('0x41');throw _0x515a06[_0x85db('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x85db('0x44')](_0x515a06[_0x85db('0x40')][_0x85db('0x43')]))){_0x515a06['message']='INTERVAL_IS_NULL';throw _0x515a06[_0x85db('0x3c')]+_0x85db('0x42');}};}function msgResponse(_0x4980b7,_0x33b08e,_0x2e2879){return{'action':_0x4980b7,'response':_0x33b08e,'message':_0x2e2879,'stack':_0x2e2879};}function myreject(_0x20939b){return function(_0x240325){return _0x20939b(msgResponse(_0x85db('0x45'),_0x85db('0x46'),JSON[_0x85db('0x47')](_0x240325)));};}function getSeconds(_0x281a7e,_0x158ac8){var _0x27b218=moment(_0x281a7e)[_0x85db('0x48')](0x0);var _0x365f2d=moment(_0x158ac8)['milliseconds'](0x0);return _0x27b218[_0x85db('0x49')](_0x365f2d,_0x85db('0x4a'));}function emit(_0x254167,_0x11f00f,_0x57a77a){io['to'](_0x254167)[_0x85db('0x4b')](_0x11f00f,_0x57a77a);}function emitVoiceQueueSummary(_0x31d169){if(_0x31d169[_0x85db('0x4c')]===_0x85db('0x4d')){var _0x5a759d={'id':_0x31d169['id'],'name':_0x31d169['name'],'strategy':_0x31d169['strategy'],'answered':_0x31d169['answered'],'available':_0x31d169['available'],'loggedIn':_0x31d169[_0x85db('0x4e')],'pTalking':_0x31d169[_0x85db('0x4f')],'sumBillable':_0x31d169[_0x85db('0x50')],'sumDuration':_0x31d169[_0x85db('0x51')],'sumHoldTime':_0x31d169[_0x85db('0x52')]||0x0,'talking':_0x31d169['talking'],'total':_0x31d169['total'],'type':_0x31d169[_0x85db('0x4c')],'unmanaged':_0x31d169['unmanaged'],'abandoned':_0x31d169[_0x85db('0x53')],'waiting':_0x31d169[_0x85db('0x54')],'loggedInDb':_0x31d169['loggedInDb'],'dialActive':_0x31d169['dialActive'],'dialMethod':_0x31d169[_0x85db('0x55')],'dialOriginateCallerIdName':_0x31d169[_0x85db('0x56')],'dialOriginateCallerIdNumber':_0x31d169[_0x85db('0x57')],'dialOriginateTimeout':_0x31d169[_0x85db('0x58')],'dialPrefix':_0x31d169[_0x85db('0x59')],'outboundAnswerAgiCallsDay':_0x31d169['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x31d169[_0x85db('0x5a')],'outboundBlacklistCallsDay':_0x31d169[_0x85db('0x5b')],'outboundBusyCallsDay':_0x31d169[_0x85db('0x5c')],'outboundCongestionCallsDay':_0x31d169['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x31d169['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x31d169['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x31d169[_0x85db('0x5d')],'outboundNoAnswerCallsDay':_0x31d169[_0x85db('0x5e')],'outboundNoSuchCallsDay':_0x31d169[_0x85db('0x5f')],'outboundOriginateFailureCallsDay':_0x31d169['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x31d169['outboundReCallsDay'],'outboundRejectCallsDay':_0x31d169[_0x85db('0x60')],'outboundUnknownCallsDay':_0x31d169['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x31d169[_0x85db('0x61')],'predictiveIntervalAvgHoldtime':_0x31d169[_0x85db('0x62')],'predictiveIntervalAvgTalktime':_0x31d169[_0x85db('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x31d169['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x31d169[_0x85db('0x64')],'predictiveIntervalErlangCalls':_0x31d169[_0x85db('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x31d169[_0x85db('0x66')],'predictiveIntervalHitRate':_0x31d169[_0x85db('0x67')],'predictiveIntervalMultiplicativeFactor':_0x31d169[_0x85db('0x68')],'predictiveIntervalPauses':_0x31d169[_0x85db('0x69')],'predictiveIntervalAvailable':_0x31d169[_0x85db('0x6a')],'predictiveIntervalTotalCalls':_0x31d169[_0x85db('0x6b')],'message':_0x31d169[_0x85db('0x3d')],'originated':_0x31d169['originated'],'erlangCalls':_0x31d169[_0x85db('0x6c')],'erlangCallToSecond':_0x31d169[_0x85db('0x6d')],'erlangAbandonmentRate':_0x31d169[_0x85db('0x6e')],'erlangBusyFactor':_0x31d169[_0x85db('0x6f')],'startPredictive':_0x31d169[_0x85db('0x26')],'startProgressive':_0x31d169[_0x85db('0x27')]};if(_0x31d169['Trunk']){_0x5a759d[_0x85db('0x70')]={'id':_0x31d169[_0x85db('0x70')]['id'],'name':_0x31d169[_0x85db('0x70')]['name'],'active':_0x31d169['Trunk'][_0x85db('0x71')],'callerid':_0x31d169['Trunk'][_0x85db('0x72')]};}if(_0x31d169[_0x85db('0x40')]){_0x5a759d[_0x85db('0x40')]={'id':_0x31d169[_0x85db('0x40')]['id'],'name':_0x31d169[_0x85db('0x40')]['name']};}var _0x5d44ef=md5(JSON[_0x85db('0x47')](_0x5a759d));if(_0x31d169[_0x85db('0x4')]!==_0x5d44ef){_0x31d169[_0x85db('0x4')]=_0x5d44ef;emit(util[_0x85db('0x73')](_0x85db('0x74'),_0x5a759d[_0x85db('0x3c')]),_0x85db('0x75'),_0x5a759d);}}}function emitCampaignSummary(_0x114509){if(_0x114509[_0x85db('0x4c')]===_0x85db('0x76')){emit(util['format'](_0x85db('0x77'),_0x114509[_0x85db('0x3c')]),'campaign:save',_0x114509);}}function checkGetDataPredictive(_0x5a175b){if(isNotNull(_0x5a175b)&&!_[_0x85db('0x44')](_0x5a175b)){loggerPredictive[_0x85db('0x78')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0x85db('0x79'),_0x5a175b[_0x85db('0x6b')]);loggerPredictive['info'](_0x85db('0x7a'),_0x5a175b[_0x85db('0x61')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7b'),_0x5a175b[_0x85db('0x64')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7c'),_0x5a175b[_0x85db('0x7d')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7e'),_0x5a175b['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x85db('0x7f'),_0x5a175b[_0x85db('0x63')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x80'));if(_0x5a175b[_0x85db('0x6b')]>0x0){if(!_[_0x85db('0x3b')](_0x5a175b[_0x85db('0x63')])&&_0x5a175b[_0x85db('0x63')]>0x0){return!![];}loggerPredictive[_0x85db('0x78')](_0x85db('0x81'));if(!_[_0x85db('0x3b')](_0x5a175b[_0x85db('0x62')])&&_0x5a175b[_0x85db('0x62')]>0x0){return!![];}loggerPredictive[_0x85db('0x78')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x85db('0x78')](_0x85db('0x82'));}}else{loggerPredictive['info'](_0x85db('0x83'));}return![];}function mergeDataErlangB(_0x40a009){return function(_0x88cfa6){loggerPredictive[_0x85db('0x78')](_0x85db('0x84'));loggerPredictive[_0x85db('0x78')](_0x85db('0x85'),_0x88cfa6['erlangCalls']);loggerPredictive[_0x85db('0x78')](_0x85db('0x86'),_0x88cfa6['erlangCallToSecond']);loggerPredictive['info'](_0x85db('0x87'),_0x88cfa6['erlangAbandonmentRate']);loggerPredictive[_0x85db('0x78')](_0x85db('0x88'),_0x88cfa6[_0x85db('0x6f')]);loggerPredictive[_0x85db('0x78')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x88cfa6[_0x85db('0x6e')]);loggerPredictive['info']('---------------------------');_['merge'](_0x40a009,_0x88cfa6);};}function getDiff(_0x367e3e){var _0x310b42=moment()['milliseconds'](0x0);var _0x2b4dcb=moment(_0x367e3e)[_0x85db('0x48')](0x0);return _0x310b42['diff'](_0x2b4dcb,_0x85db('0x4a'));}function ifInterval(_0x20e15f,_0x5d71aa){if(_[_0x85db('0x3b')](_0x5d71aa)){return![];}return getDiff(_0x5d71aa)<_0x20e15f*0x3c;}function freeVariablesPredictive(_0x42eddd){if(isNotNull(_0x42eddd)){if(!_[_0x85db('0x3b')](_0x42eddd['startProgressive'])){_0x42eddd[_0x85db('0x27')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd[_0x85db('0x3c')],_0x85db('0x89'));}if(!_[_0x85db('0x3b')](_0x42eddd[_0x85db('0x26')])){_0x42eddd[_0x85db('0x26')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd['name'],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x42eddd['handlePredictive'])){clearInterval(_0x42eddd[_0x85db('0x8a')]);_0x42eddd[_0x85db('0x8a')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd[_0x85db('0x3c')],_0x85db('0x8b'));}}}function erlangb(_0x2f7148,_0x5636fa){if(_0x5636fa===0x0){return 0x0;}var _0x367ebe=0x1;for(var _0x6e3240=0x1;_0x6e3240<=_0x5636fa;_0x6e3240+=0x1){_0x367ebe=0x1+_0x367ebe*_0x6e3240/_0x2f7148;}return 0x1/_0x367ebe;}function isVoiceQueueOutbound(_0x11bc25){return _0x11bc25===_0x85db('0x4d');}function isNotPreview(_0x560784){return _0x560784!==_0x85db('0x1c');}function isCampaignIvr(_0x3dc6f0){return _0x3dc6f0===_0x85db('0x76');}function getCallerId(_0x1aa93a,_0x4d042c,_0x2a7f1e){if(!_[_0x85db('0x3b')](_0x2a7f1e)&&typeof _0x2a7f1e===_0x85db('0x8c')&&!_[_0x85db('0x44')](_0x2a7f1e)){if(!_[_0x85db('0x3b')](_0x4d042c)&&typeof _0x4d042c==='string'&&!_[_0x85db('0x44')](_0x4d042c)){return util[_0x85db('0x73')](_0x85db('0x8d'),_0x4d042c,_0x2a7f1e);}return util[_0x85db('0x73')](_0x85db('0x8d'),_0x2a7f1e,_0x2a7f1e);}if(!_['isUndefined'](_0x1aa93a)&&typeof _0x1aa93a===_0x85db('0x8c')&&!_[_0x85db('0x44')](_0x1aa93a)){return _0x1aa93a;}return _0x85db('0x8e');}function loggerCatchQueueSummary(_0x1da7ed,_0x20c059){return function(_0x51ff84){freeVariablesPredictive(_0x20c059);emitVoiceQueueSummary(_0x20c059);emitCampaignSummary(_0x20c059);loggerSyncQueueSummary[_0x85db('0x8f')](_0x1da7ed,util[_0x85db('0x90')](_0x51ff84,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x176e51,_0x58ff0f){return function(_0xee1099){loggerPredictive[_0x85db('0x8f')](_0x58ff0f[_0x85db('0x3c')],_0x176e51);loggerPredictive['error'](_0xee1099[_0x85db('0x91')]);freeVariablesPredictive(_0x58ff0f);};}function loggerCatch(_0xc840a){return function(_0x5b516d){logger[_0x85db('0x8f')](_0xc840a,util[_0x85db('0x90')](_0x5b516d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1b1c1b){return _0x1b1c1b&&!_[_0x85db('0x3b')](_0x1b1c1b)&&_0x1b1c1b[_0x85db('0x92')]>0x0;}function decremetOriginate(_0xb391ff){if(!_[_0x85db('0x3b')](_0xb391ff)&&_0xb391ff!==null){if(typeof _0xb391ff[_0x85db('0x93')]!==_0x85db('0x94')){if(_0xb391ff[_0x85db('0x93')]>0x0){_0xb391ff[_0x85db('0x93')]-=0x1;}else{logger[_0x85db('0x8f')](_0x85db('0x95'));}}}else{logger[_0x85db('0x8f')](_0x85db('0x96'));}}function checkContactLowerLimitOriginate(_0x4da42e,_0x420831,_0x2f7f7a){if(_0x420831>_0x2f7f7a){for(var _0x1c48ac=0x0;_0x1c48ac<_0x420831-_0x2f7f7a;_0x1c48ac+=0x1){decremetOriginate(_0x4da42e);}}}function loggerGetContactDialer(_0x24fec7,_0x4edff1,_0x4e6cc8){return function(_0x21bfe8){checkContactLowerLimitOriginate(_0x4edff1,_0x4e6cc8,0x0);logger['error'](_0x24fec7,util[_0x85db('0x90')](_0x21bfe8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x45cfd2){return function(_0x3fc37e){if(isNotNull(_0x3fc37e)&&isNotNull(_0x3fc37e[0x0])){if(_0x3fc37e[0x0]['contactsRescheduled']>0x0){_0x45cfd2[_0x85db('0x3d')]=_0x85db('0x97');logger[_0x85db('0x78')](_0x85db('0x98')+_0x45cfd2['name'],_0x3fc37e[0x0][_0x85db('0x99')],'contacts');}else{_0x45cfd2[_0x85db('0x3d')]=_0x85db('0x9a');logger[_0x85db('0x78')](_0x85db('0x9b')+_0x45cfd2[_0x85db('0x3c')]);}}};}function notSendMessagesQueue(_0x40e97e){if(_0x40e97e[_0x85db('0x9c')]){freeVariablesPredictive(_0x40e97e);if(_0x40e97e[_0x85db('0x93')]===0x0&&_0x40e97e[_0x85db('0x9d')]===0x0&&_0x40e97e[_0x85db('0x54')]===0x0&&(_0x40e97e[_0x85db('0x4f')]||0x0)===0x0){_0x40e97e[_0x85db('0x9c')]=![];_0x40e97e[_0x85db('0x9e')]=0x0;_0x40e97e['message']=_0x85db('0x3e');loggerSyncQueueSummary['error'](_0x85db('0x9f'),_0x40e97e[_0x85db('0x3c')],'is\x20not\x20active');}else{_0x40e97e[_0x85db('0x3d')]=_0x85db('0xa0');loggerSyncQueueSummary[_0x85db('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x40e97e[_0x85db('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x40e97e);}}function notSendMessagesCampaign(_0xa2d663){if(_0xa2d663['sendMessageOneNotActive']){if(_0xa2d663[_0x85db('0x93')]===0x0){_0xa2d663[_0x85db('0x9c')]=![];_0xa2d663['message']=_0x85db('0x3e');loggerSyncQueueSummary[_0x85db('0x8f')](_0x85db('0xa1'),_0xa2d663[_0x85db('0x3c')],_0x85db('0xa2'));}else{_0xa2d663[_0x85db('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x85db('0x8f')](_0x85db('0xa1'),_0xa2d663[_0x85db('0x3c')],'is\x20disactive');}emitCampaignSummary(_0xa2d663);}}function createObjHistory(_0x3c92b3,_0x2c6f48,_0x388fa4,_0x294d7b,_0x22183f){_0x3c92b3[_0x85db('0x3d')]=_0x388fa4;var _0x13fd5=new Action(_0x3c92b3,_0x2c6f48);var _0x308537=new History(_0x13fd5);_0x308537[_0x85db('0xa3')]=_0x294d7b;_0x308537[_0x85db('0xa4')]=_0x22183f;_0x308537[_0x85db('0xa5')]=_0x13fd5['starttime'];return _0x308537;}Dialer[_0x85db('0x18')][_0x85db('0x3a')]=function(){var _0xdcb072=this;setInterval(function(){_0xdcb072['clearZombieChannels'](_0xdcb072[_0x85db('0x25')],'[uniqueid]');_0xdcb072[_0x85db('0xa6')](_0xdcb072['actions'],_0x85db('0xa7'));},0x32c8);};Dialer['prototype'][_0x85db('0xa6')]=function(_0x5c6028,_0x28741a){var _0x3ca9e7=this;for(var _0x4d268a in _0x5c6028){if(typeof _0x5c6028[_0x4d268a]!==_0x85db('0x94')){this['sequence']['enqueue'](function(){if(!_[_0x85db('0xa8')](_0x5c6028[_0x4d268a])){return ami[_0x85db('0xa9')]({'action':_0x85db('0xaa'),'channel':_0x5c6028[_0x4d268a][_0x85db('0xab')]})[_0x85db('0xac')](function(_0x2aa231){if(_0x2aa231['message']===_0x85db('0xad')){setTimeout(function(){if(_0x5c6028[_0x4d268a]&&_0x5c6028[_0x4d268a][_0x85db('0x4c')]!==_0x85db('0x76')){_0x3ca9e7[_0x85db('0xae')](_0x3ca9e7[_0x85db('0x1d')][_0x5c6028[_0x4d268a]['queue']]);logger[_0x85db('0x8f')]('[Dialer][checkChannel]',_0x28741a,_0x4d268a,_0x5c6028[_0x4d268a][_0x85db('0xaf')]);delete _0x5c6028[_0x4d268a];}if(_0x5c6028[_0x4d268a]&&_0x5c6028[_0x4d268a][_0x85db('0x4c')]===_0x85db('0x76')){_0x3ca9e7['updateOriginated'](_0x3ca9e7['campaigns'][_0x5c6028[_0x4d268a][_0x85db('0xaf')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x28741a,_0x4d268a,_0x5c6028[_0x4d268a]['queue']);delete _0x5c6028[_0x4d268a];}},0x2328);}});}});}}};Dialer[_0x85db('0x18')][_0x85db('0xb0')]=function(_0x1eec46){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopper[_0x85db('0xb0')](_0x1eec46))[_0x85db('0xac')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x85db('0x18')][_0x85db('0xb3')]=function(_0x43d786){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperBlack[_0x85db('0xb3')](_0x43d786))['catch'](loggerCatch(_0x85db('0xb4')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x15c530){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperBlack[_0x85db('0xb5')](_0x15c530))[_0x85db('0xac')](loggerCatch(_0x85db('0xb6')));};Dialer[_0x85db('0x18')][_0x85db('0xb7')]=function(_0x5e56e8){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperHistory[_0x85db('0xb8')](_0x5e56e8))[_0x85db('0xac')](loggerCatch(_0x85db('0xb9')));};Dialer['prototype'][_0x85db('0xba')]=function(_0x392253){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopper[_0x85db('0xba')](_0x392253))['catch'](loggerCatch(_0x85db('0xbb')));};Dialer[_0x85db('0x18')]['unlockContact']=function(_0x416f42,_0x283fba,_0x63f52a){return BPromise[_0x85db('0xb1')]()['then'](cmHopper[_0x85db('0xbc')](_0x416f42,_0x283fba,_0x63f52a))['catch'](loggerCatch(_0x85db('0xbd')));};Dialer[_0x85db('0x18')][_0x85db('0xbe')]=function(_0x4acecc,_0xb40a10,_0x117521,_0x41fd89,_0x159d0e){return BPromise['resolve']()[_0x85db('0xb2')](cmHopper['getContactDialer'](_0x4acecc,_0xb40a10,_0x117521,_0x41fd89))[_0x85db('0xac')](function(_0xec5d61){_0x159d0e['temp']-=_0x117521;_0x159d0e['temp']=_0x159d0e[_0x85db('0xbf')]>0x0?_0x159d0e['temp']:0x0;loggerCatch(_0x85db('0xc0'))(_0xec5d61);});};Dialer[_0x85db('0x18')]['getContactDialerIvr']=function(_0x2828bc,_0x104809,_0xe6ec04,_0x593907){return BPromise['resolve']()['then'](cmHopper[_0x85db('0xc1')](_0x2828bc,_0x104809,_0xe6ec04))[_0x85db('0xac')](function(_0x2e44bd){_0x593907[_0x85db('0xbf')]-=_0x104809;_0x593907[_0x85db('0xbf')]=_0x593907[_0x85db('0xbf')]>0x0?_0x593907[_0x85db('0xbf')]:0x0;loggerCatch(_0x85db('0xc2'))(_0x2e44bd);});};Dialer[_0x85db('0x18')][_0x85db('0xc3')]=function(_0x5884d1){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](voiceQueueRt[_0x85db('0xc3')](_0x5884d1))[_0x85db('0xac')](loggerCatch(_0x85db('0xc4')));};Dialer[_0x85db('0x18')][_0x85db('0xc5')]=function(_0x13aeed){return BPromise['resolve']()[_0x85db('0xb2')](cmHopper[_0x85db('0xc5')](_0x13aeed))[_0x85db('0xac')](loggerCatch(_0x85db('0xc6')));};Dialer[_0x85db('0x18')][_0x85db('0xc7')]=function(_0x4ae8c4){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperHistory['createHistory'](_0x4ae8c4))['catch'](loggerCatch(_0x85db('0xc8')));};Dialer[_0x85db('0x18')][_0x85db('0xae')]=function(_0x4f9d67){if(!_[_0x85db('0x3b')](_0x4f9d67)&&_0x4f9d67!==null){if(typeof _0x4f9d67['originated']!==_0x85db('0x94')){if(_0x4f9d67['originated']>0x0){_0x4f9d67[_0x85db('0x93')]-=0x1;}else{logger[_0x85db('0x8f')](_0x85db('0xc9'));}}}else{logger[_0x85db('0x8f')](_0x85db('0xca'));}};Dialer[_0x85db('0x18')][_0x85db('0xcb')]=function(_0x1b2695,_0x20883a){var _0x528b48=this;return function(_0xac6512){_0x528b48[_0x85db('0xae')](_0x20883a);logger[_0x85db('0x8f')](_0x1b2695,util['inspect'](_0xac6512,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x85db('0xcc')]=function(_0x3c8346,_0x106542,_0x872bc3){var _0x1aef96={'state':0x19,'statedesc':'notFound'};this[_0x85db('0xae')](_0x106542);this[_0x85db('0xcd')](_['merge'](_0x1aef96,_[_0x85db('0xce')](_0x872bc3,[_0x85db('0xcf'),_0x85db('0xd0'),_0x85db('0xd1'),_0x85db('0xd2'),_0x85db('0xd3')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x85db('0x8f')](_0x3c8346);};Dialer[_0x85db('0x18')][_0x85db('0xd4')]=function(_0x417c8a){return _0x417c8a===_0x85db('0xd5');};Dialer[_0x85db('0x18')][_0x85db('0xd6')]=function(_0x410b77){return!_['isUndefined'](_0x410b77)&&_0x410b77&&!_[_0x85db('0x3b')](_0x410b77['name'])&&!_['isUndefined'](_0x410b77['active'])&&_0x410b77['active']&&(this[_0x85db('0x20')][util[_0x85db('0x73')](_0x85db('0xd7'),_0x410b77['name'])]['status']===_0x85db('0xd8')||this[_0x85db('0x20')][util[_0x85db('0x73')]('SIP/%s',_0x410b77[_0x85db('0x3c')])][_0x85db('0xaa')]===_0x85db('0xd9'));};Dialer[_0x85db('0x18')]['saveInDb']=function(_0x4423f1,_0x31887a,_0x5ba1f9){this[_0x85db('0xc7')](_0x4423f1)[_0x85db('0xac')](loggerCatch(_0x31887a));this[_0x85db('0xc5')](_0x4423f1)[_0x85db('0xac')](loggerCatch(_0x5ba1f9));};Dialer['prototype'][_0x85db('0x36')]=function(_0x19dffb){var _0x43d419=this[_0x85db('0x25')][_0x19dffb['uniqueid']];var _0x5528e6;if(!_['isNil'](_0x19dffb)&&!_[_0x85db('0xa8')](_0x19dffb[_0x85db('0xda')])&&!_[_0x85db('0xa8')](_0x19dffb[_0x85db('0xda')][_0x85db('0xdb')])&&_0x19dffb[_0x85db('0xdc')]===_0x85db('0xdd')&&_0x43d419){if(_0x43d419[_0x85db('0x4c')]!==_0x85db('0x76')&&this['voiceQueues'][_0x43d419[_0x85db('0xaf')]]['dialAMDActive']&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xdf')){delete this[_0x85db('0x25')][_0x19dffb[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;this[_0x85db('0x1d')][_0x43d419['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x5528e6=new Hangup(_0x43d419,_0x19dffb);_0x5528e6[_0x85db('0xa3')]=0x12;_0x5528e6[_0x85db('0xa4')]=_0x85db('0xe1');_0x5528e6['membername']=_0x85db('0xe2');ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x5528e6,_0x85db('0xe5')));this[_0x85db('0xcd')](_0x5528e6,_0x85db('0xe6'),_0x85db('0xe7'));}if(_0x43d419[_0x85db('0x4c')]!=='ivr'&&this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xe8')]&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xe9')){var _0x170ab4=this;return new BPromise(function(_0xb3eac6,_0x584448){delete _0x170ab4[_0x85db('0x25')][_0x19dffb[_0x85db('0xe0')]];_0x170ab4[_0x85db('0xae')](_0x170ab4[_0x85db('0x1d')][_0x43d419['queue']]);_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xea')]+=0x1;var _0x45b430=_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]];var _0x43ef4d=new Hangup(_0x43d419,_0x19dffb);_0x43ef4d['state']=0x13;_0x43ef4d[_0x85db('0xa4')]=_0x85db('0xeb');_0x43ef4d['membername']=_0x85db('0xe2');_0x43ef4d[_0x85db('0xec')]+=0x1;_0x43ef4d[_0x85db('0xed')]+=0x1;_0x43ef4d[_0x85db('0xe5')]=!![];ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x43ef4d,_0x85db('0xe5')));_0x170ab4['createHistory'](_0x43ef4d)[_0x85db('0xac')](loggerCatch(_0x85db('0xee')));if(_0x43ef4d['countbusyretry']+_0x43ef4d[_0x85db('0xef')]+_0x43ef4d['countnoanswerretry']+_0x43ef4d['countnosuchnumberretry']+_0x43ef4d[_0x85db('0xf0')]+_0x43ef4d[_0x85db('0xf1')]+_0x43ef4d[_0x85db('0xec')]+_0x43ef4d[_0x85db('0xf2')]>=_0x45b430[_0x85db('0xf3')]){_0x170ab4[_0x85db('0xf4')](_0x43ef4d,_0xb3eac6,_0x584448,_0x85db('0xf5'));}else{if(_0x43ef4d['countmachineretry']>=_0x45b430[_0x85db('0xf6')]){_0x170ab4['createStateFinal'](_0x43ef4d,_0xb3eac6,_0x584448,_0x85db('0xf7'));}else{_0x170ab4[_0x85db('0xba')]({'active':![],'countmachineretry':_0x43ef4d[_0x85db('0xec')],'scheduledat':moment()[_0x85db('0xf8')](_0x45b430[_0x85db('0xf9')],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x43ef4d['ContactId'],'ListId':_0x43ef4d[_0x85db('0xd0')],'VoiceQueueId':_0x43ef4d['VoiceQueueId']||undefined,'CampaignId':_0x43ef4d['CampaignId']||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0xfb')));_0xb3eac6({'reschedule':0x1});}}});}if(_0x43d419['type']===_0x85db('0x76')&&this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]['dialAMDActive']&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xdf')){delete this[_0x85db('0x25')][_0x19dffb['uniqueid']];this[_0x85db('0xae')](this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]);_0x5528e6=new Hangup(_0x43d419,_0x19dffb);_0x5528e6[_0x85db('0xa3')]=0x12;_0x5528e6[_0x85db('0xa4')]=_0x85db('0xe1');_0x5528e6[_0x85db('0xfc')]=_0x85db('0xe2');ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x5528e6,'amd'));this[_0x85db('0xcd')](_0x5528e6,'[syncHangupInAMDIvr][createHistory]',_0x85db('0xfd'));}if(_0x43d419['type']===_0x85db('0x76')&&this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xe8')]&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xe9')){var _0x170ab4=this;return new BPromise(function(_0x1c8b7b,_0x5cf9f4){delete _0x170ab4[_0x85db('0x25')][_0x19dffb['uniqueid']];_0x170ab4[_0x85db('0xae')](_0x170ab4['campaigns'][_0x43d419[_0x85db('0xaf')]]);_0x170ab4['campaigns'][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;_0x170ab4[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2aeae6=_0x170ab4[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]];var _0x26c5e5=new Hangup(_0x43d419,_0x19dffb);_0x26c5e5['state']=0x13;_0x26c5e5[_0x85db('0xa4')]=_0x85db('0xeb');_0x26c5e5[_0x85db('0xfc')]=_0x85db('0xe2');_0x26c5e5[_0x85db('0xec')]+=0x1;_0x26c5e5[_0x85db('0xed')]+=0x1;_0x26c5e5[_0x85db('0xe5')]=!![];ami[_0x85db('0x4b')]('custom:amd',ut[_0x85db('0xe4')](_0x26c5e5,'amd'));_0x170ab4[_0x85db('0xc7')](_0x26c5e5)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x26c5e5[_0x85db('0xfe')]+_0x26c5e5[_0x85db('0xef')]+_0x26c5e5[_0x85db('0xff')]+_0x26c5e5[_0x85db('0x100')]+_0x26c5e5[_0x85db('0xf0')]+_0x26c5e5['countabandonedretry']+_0x26c5e5[_0x85db('0xec')]+_0x26c5e5[_0x85db('0xf2')]>=_0x2aeae6['dialGlobalMaxRetry']){_0x170ab4[_0x85db('0xf4')](_0x26c5e5,_0x1c8b7b,_0x5cf9f4,_0x85db('0xf5'));}else{if(_0x26c5e5[_0x85db('0xec')]>=_0x2aeae6[_0x85db('0xf6')]){_0x170ab4[_0x85db('0x101')](_0x26c5e5,_0x1c8b7b,_0x5cf9f4,_0x85db('0xf7'));}else{_0x170ab4[_0x85db('0xba')]({'active':![],'countmachineretry':_0x26c5e5[_0x85db('0xec')],'scheduledat':moment()[_0x85db('0xf8')](_0x2aeae6[_0x85db('0xf9')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x26c5e5[_0x85db('0xcf')],'ListId':_0x26c5e5[_0x85db('0xd0')],'VoiceQueueId':_0x26c5e5[_0x85db('0xd2')]||undefined,'CampaignId':_0x26c5e5[_0x85db('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1c8b7b({'reschedule':0x1});}}});}}};Dialer[_0x85db('0x18')][_0x85db('0x103')]=function(_0x5a7714){var _0xdfda89=this[_0x85db('0x25')][_0x5a7714['uniqueid']];var _0x157942=this;var _0x1b3249;if(_0xdfda89&&_0xdfda89['type']==='ivr'){delete this[_0x85db('0x25')][_0x5a7714[_0x85db('0xe0')]];this['updateOriginated'](this['campaigns'][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1e')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x104')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);this[_0x85db('0xc7')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this[_0x85db('0xc5')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x106')));}if(_0xdfda89&&_0xdfda89[_0x85db('0x4c')]!==_0x85db('0x76')&&isNotNull(this['voiceQueues'][_0xdfda89['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x5a7714[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0xea')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);_0x1b3249[_0x85db('0xa3')]=0x10;_0x1b3249[_0x85db('0xa4')]='AnswerAGI';_0x1b3249['membername']=_0x85db('0x107');this['createHistory'](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this['moveContactManagedDialer'](_0x1b3249)['catch'](loggerCatch(_0x85db('0x106')));}if(_0xdfda89&&_0xdfda89['type']!==_0x85db('0x76')&&!isNotNull(this[_0x85db('0x1d')][_0xdfda89['queue']][_0x85db('0x108')])){delete this['uniqueId'][_0x5a7714[_0x85db('0xe0')]];this[_0x85db('0xae')](this['voiceQueues'][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x109')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);_0x1b3249[_0x85db('0xa3')]=0xc;_0x1b3249['statedesc']=_0x5a7714['cause-txt'];_0x1b3249[_0x85db('0xfc')]='Unknow';this[_0x85db('0xc7')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this[_0x85db('0xc5')](_0x1b3249)[_0x85db('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x85db('0x10a')]=function(_0x2bafcc){var _0x9b1dda=this[_0x85db('0x25')][_0x2bafcc['uniqueid']];var _0x3e6a48=this;if(this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]]){if(_0x9b1dda&&_0x9b1dda[_0x85db('0x4c')]!==_0x85db('0x76')){delete this[_0x85db('0x25')][_0x2bafcc[_0x85db('0xe0')]];this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;var _0x48d30c=new AgentComplete(_0x9b1dda,_0x2bafcc);if(_0x2bafcc['reason']===_0x85db('0x10b')){_0x48d30c[_0x85db('0x10c')]=this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x10d')]&&this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x10e')]?moment()[_0x85db('0x73')](_0x85db('0xfa')):undefined;}this[_0x85db('0xc7')](_0x48d30c)['catch'](loggerCatch(_0x85db('0x10f')));this[_0x85db('0xc5')](_0x48d30c)[_0x85db('0xac')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x85db('0x18')][_0x85db('0x2c')]=function(_0x320726){if(this[_0x85db('0x1d')][_0x320726['queue']]){if(this['uniqueId'][_0x320726[_0x85db('0xe0')]]&&this[_0x85db('0x25')][_0x320726['uniqueid']][_0x85db('0x4c')]!==_0x85db('0x76')){this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x320726['queue']]);this[_0x85db('0x25')][_0x320726[_0x85db('0xe0')]][_0x85db('0x110')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x85db('0x18')][_0x85db('0x111')]=function(_0x34d8fb){this[_0x85db('0xc7')](_0x34d8fb)[_0x85db('0xac')](loggerCatch(_0x85db('0x10f')));this[_0x85db('0xc5')](_0x34d8fb)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x85db('0x18')]['syncQueueCallerAbandon']=function(_0x1a4f7c){var _0x391556=this[_0x85db('0x25')][_0x1a4f7c[_0x85db('0xe0')]];var _0x436173=this;if(this['voiceQueues'][_0x1a4f7c[_0x85db('0xaf')]]){if(_0x391556&&_0x391556[_0x85db('0x4c')]!=='ivr'){delete this[_0x85db('0x25')][_0x1a4f7c[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]);_0x391556['droptime']=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x20020b=new QueueCallerAbandon(_0x391556,_0x1a4f7c);if(getSeconds(_0x391556[_0x85db('0x112')],_0x391556[_0x85db('0x113')])>=_0x391556['dialQueueTimeout']){this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x5d')]+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x66')]+=0x1;_0x20020b['state']=0xa;_0x20020b[_0x85db('0xa4')]=_0x85db('0x114');_0x20020b[_0x85db('0x115')]='TIMEOUT';_0x20020b[_0x85db('0x10c')]=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x10d')]?moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x20020b[_0x85db('0xf0')]+=0x1;_0x20020b['countglobal']+=0x1;if(_0x20020b[_0x85db('0xf0')]>=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]['dialDropMaxRetry']){this[_0x85db('0x111')](_0x20020b);}else{this[_0x85db('0xba')]({'active':![],'countdropretry':_0x20020b[_0x85db('0xf0')],'scheduledat':moment()[_0x85db('0xf8')](this[_0x85db('0x1d')][_0x1a4f7c['queue']]['dialDropRetryFrequency'],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x391556['ContactId'],'ListId':_0x391556['ListId'],'VoiceQueueId':_0x391556['VoiceQueueId']||undefined,'CampaignId':_0x391556['CampaignId']||undefined})['catch'](loggerCatch(_0x85db('0x116')));var _0x47d827=new History(_0x20020b);_0x47d827[_0x85db('0xa3')]=0xa;_0x47d827['statedesc']=_0x85db('0x114');_0x47d827[_0x85db('0x117')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x47d827['endtime']=_0x47d827['starttime'];_0x47d827[_0x85db('0x118')]=_0x20020b['calleridname'];_0x47d827[_0x85db('0x119')]=_0x20020b['calleridnum'];this['createHistory'](_0x47d827)['catch'](loggerCatch(_0x85db('0x11a')));}}else{this[_0x85db('0x1d')][_0x1a4f7c['queue']][_0x85db('0x7d')]+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x11b')]+=0x1;_0x20020b[_0x85db('0xa3')]=0xb;_0x20020b['statedesc']=_0x85db('0x11c');_0x20020b[_0x85db('0x115')]=_0x85db('0x11d');_0x20020b['countabandonedretry']+=0x1;_0x20020b[_0x85db('0xed')]+=0x1;if(_0x20020b['countabandonedretry']>=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x11e')]){this['queueCallerAbandonCreateState'](_0x20020b);}else{this[_0x85db('0xba')]({'active':![],'countabandonedretry':_0x20020b[_0x85db('0xf1')],'scheduledat':moment()[_0x85db('0xf8')](this[_0x85db('0x1d')][_0x1a4f7c['queue']][_0x85db('0x11f')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x391556['ContactId'],'ListId':_0x391556[_0x85db('0xd0')],'VoiceQueueId':_0x391556[_0x85db('0xd2')]||undefined,'CampaignId':_0x391556[_0x85db('0xd3')]||undefined})['catch'](loggerCatch(_0x85db('0x120')));var _0x47d827=new History(_0x20020b);_0x47d827[_0x85db('0xa3')]=0xb;_0x47d827[_0x85db('0xa4')]='Abandoned';_0x47d827[_0x85db('0x117')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x47d827[_0x85db('0xa5')]=_0x47d827[_0x85db('0x117')];_0x47d827[_0x85db('0x118')]=_0x20020b['calleridname'];_0x47d827[_0x85db('0x119')]=_0x20020b[_0x85db('0x119')];this['createHistory'](_0x47d827)[_0x85db('0xac')](loggerCatch(_0x85db('0x121')));}}}}};Dialer[_0x85db('0x18')][_0x85db('0x34')]=function(_0x214cc4){if(this[_0x85db('0x23')][_0x214cc4[_0x85db('0xe0')]]){this[_0x85db('0x23')][_0x214cc4[_0x85db('0xe0')]][_0x85db('0xab')]=_0x214cc4['channel'];}if(this[_0x85db('0x25')][_0x214cc4['uniqueid']]){this[_0x85db('0x25')][_0x214cc4[_0x85db('0xe0')]][_0x85db('0xab')]=_0x214cc4[_0x85db('0xab')];}};Dialer[_0x85db('0x18')][_0x85db('0x122')]=function(_0x5e877f){if(strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]]['strategy']]==='roundrobin'){if(this['actions'][_0x5e877f[_0x85db('0x123')]]&&_[_0x85db('0xa8')](this[_0x85db('0x23')][_0x5e877f['actionid']][_0x85db('0x124')])&&_0x5e877f['status']==='1'&&_0x5e877f['paused']==='0'){if(this[_0x85db('0x1f')][_0x5e877f['stateinterface']]){if(!this[_0x85db('0x1f')][_0x5e877f[_0x85db('0x125')]][_0x85db('0x124')]){this['agents'][_0x5e877f[_0x85db('0x125')]][_0x85db('0x124')]=!![];this['actions'][_0x5e877f[_0x85db('0x123')]][_0x85db('0x124')]=!![];this['actions'][_0x5e877f[_0x85db('0x123')]]['stateinterface']=_0x5e877f[_0x85db('0x125')];}}}}else if((strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]||_0x85db('0x16'))==='rrmemory'){if(this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]){if(this[_0x85db('0x1f')][_0x5e877f[_0x85db('0x125')]]){this[_0x85db('0x23')][_0x5e877f['actionid']][_0x85db('0x125')]=_0x5e877f[_0x85db('0x125')];if(_['isNil'](this['queueBooked'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]['queue']])){this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]]=[];}this['queueBooked'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]['queue']][_0x85db('0x127')](_[_0x85db('0x128')](_[_0x85db('0xce')](this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]],[_0x85db('0x129'),_0x85db('0x125')]),{'status':_0x5e877f[_0x85db('0xaa')],'paused':_0x5e877f[_0x85db('0x12a')]}));}}}};function unlockQueueStatus(_0x1d42a3,_0x2c7b0b){setTimeout(function(){if(_[_0x85db('0x3b')](_0x1d42a3['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x2c7b0b);}_0x1d42a3['queueStatusComplete']=!![];loggerBooked['info'](_0x85db('0x12b'),_0x2c7b0b,JSON['stringify'](_['pick'](_0x1d42a3,[_0x85db('0x3c'),_0x85db('0x12c')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5f29f0){var _0xecb89b=this;var _0x367ce6=_0xecb89b['voiceQueues'][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]];if(strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]===_0x85db('0x17')){if(this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]&&this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['stateinterface']){this[_0x85db('0x1c')]['run'](this['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x129')],this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x125')])[_0x85db('0xac')](function(_0x135f91){logger['error'](_0x85db('0x12d'),util[_0x85db('0x90')](_0x135f91,{'showHidden':![],'depth':null}));})[_0x85db('0x12e')](function(){_0xecb89b['updateOriginated'](_0xecb89b[_0x85db('0x1d')][_0xecb89b['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]);_0xecb89b[_0x85db('0x1f')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x125')]]['locked']=![];delete _0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);});}else{this[_0x85db('0xae')](this['voiceQueues'][this[_0x85db('0x23')][_0x5f29f0['actionid']]['queue']]);this[_0x85db('0xba')]({'active':![],'ContactId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xcf')],'ListId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd0')],'VoiceQueueId':this['actions'][_0x5f29f0[_0x85db('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x85db('0x23')][_0x5f29f0['actionid']][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x12f')));delete this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);}}else if((strategy[this[_0x85db('0x1d')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]||_0x85db('0x16'))==='rrmemory'){var _0x454a88;if(this['actions'][_0x5f29f0['actionid']]&&!_[_0x85db('0x44')](this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]])){if(this[_0x85db('0x2a')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]){this[_0x85db('0x2a')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['queue']]=this['queueBookedRR'][this[_0x85db('0x23')][_0x5f29f0['actionid']][_0x85db('0xaf')]]?this['queueBookedRR'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]:this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]?this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x130')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x5f29f0[_0x85db('0x123')]]['queue']][_0x85db('0x130')]=this[_0x85db('0x2a')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]];for(var _0x569f1d=0x0;_0x569f1d=0x0;})[_0x85db('0xac')](myreject(_0x58b523)));}}else{_0x514e25[_0x85db('0x127')](ami[_0x85db('0xa9')]({'action':_0x85db('0x144'),'command':util[_0x85db('0x73')](_0x85db('0x145'),_0x50b052,!_[_0x85db('0x3b')](config[_0x85db('0x141')][_0x38be88])?_0x38be88:'')})[_0x85db('0xb2')](function(_0x2fbd1a){return _0x2fbd1a[_0x85db('0x149')][_0x85db('0x147')]('true')>=0x0;})['catch'](myreject(_0x58b523)));}BPromise['all'](_0x514e25)[_0x85db('0xb2')](function(_0x4384b9){var _0x3a6b1f=_[_0x85db('0x14a')](_0x4384b9);if(_0x3a6b1f){return _0xa4e3e4(_0x3a6b1f);}else{_0x59f182[_0x85db('0x3d')]=_0x134352?_0x85db('0x14b'):'INTERVAL_IS_OVERTIME';return _0x58b523(msgResponse('[ifTime][promiseAll]',_0x85db('0x13e'),_0x85db('0x14c')+_0x134352+'\x20'+_0x10194d+_0x85db('0x14d')+util[_0x85db('0x90')](_0x50b052,{'showHidden':![],'depth':null})+_0x85db('0x14e')+_0x38be88));}})[_0x85db('0xac')](function(_0x195305){return _0x58b523(msgResponse('ifTime',_0x85db('0x13e'),JSON['stringify'](_0x195305)));});});};Dialer[_0x85db('0x18')][_0x85db('0x14f')]=function(_0x25a0d1){var _0x55f52a=this;return function(){switch(_0x25a0d1[_0x85db('0x55')]){case _0x85db('0x150'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,0x1);break;case _0x85db('0x152'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,_0x25a0d1['dialPowerLevel']);break;case'predictive':_0x55f52a[_0x85db('0x153')](_0x25a0d1);break;case _0x85db('0x8'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,0x1);break;default:freeVariablesPredictive(_0x25a0d1);logger['error'](_0x85db('0x154'),_0x25a0d1[_0x85db('0x3c')],'method\x20not\x20recognized');}};};Dialer[_0x85db('0x18')][_0x85db('0x155')]=function(_0x3c11d7){var _0x211e72=this;return function(){_0x211e72[_0x85db('0x156')](_0x3c11d7);};};Dialer[_0x85db('0x18')]['syncQueueSummary']=function(_0x3fe764){var _0x3c2899=this;if(isNotPreview(_0x3fe764['dialMethod'])){if(isVoiceQueueOutbound(_0x3fe764[_0x85db('0x4c')])&&isActive(_0x3fe764[_0x85db('0x157')])){_0x3fe764[_0x85db('0x9c')]=!![];BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](checkIsLoggedIn(_0x3fe764,_0x3fe764[_0x85db('0x4e')]))[_0x85db('0xb2')](checkIsActive(_0x3fe764,_0x3fe764[_0x85db('0x157')]))[_0x85db('0xb2')](checkInterval(_0x3fe764))['then'](_0x3c2899[_0x85db('0x158')](_0x3fe764))[_0x85db('0xb2')](_0x3c2899[_0x85db('0x159')](_0x3fe764[_0x85db('0x15a')],_0x3fe764['dialTimezone'],_0x3fe764[_0x85db('0x3c')],_0x3fe764))['then'](_0x3c2899[_0x85db('0x13d')](_0x3fe764[_0x85db('0x40')],_0x3fe764[_0x85db('0x15b')],_0x3fe764[_0x85db('0x3c')],_0x3fe764))[_0x85db('0xb2')](_0x3c2899[_0x85db('0x14f')](_0x3fe764))[_0x85db('0xac')](loggerCatchQueueSummary(_0x85db('0x15c'),_0x3fe764));}else{notSendMessagesQueue(_0x3fe764);}}else{freeVariablesPredictive(_0x3fe764);}};Dialer[_0x85db('0x18')][_0x85db('0x139')]=function(){var _0x4ad4c5=this;var _0x1193b9;for(var _0x2796b4 in this[_0x85db('0x1e')]){if(typeof this['campaigns'][_0x2796b4]!=='undefined'){_0x1193b9=this[_0x85db('0x1e')][_0x2796b4];if(isCampaignIvr(_0x1193b9['type'])&&isActive(_0x1193b9[_0x85db('0x71')])){_0x1193b9[_0x85db('0x9c')]=!![];BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](checkIsActive(_0x1193b9,_0x1193b9[_0x85db('0x71')]))['then'](checkInterval(_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x158')](_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x159')](_0x1193b9[_0x85db('0x15a')],_0x1193b9[_0x85db('0x15b')],_0x1193b9[_0x85db('0x3c')],_0x1193b9))['then'](_0x4ad4c5[_0x85db('0x13d')](_0x1193b9[_0x85db('0x40')],_0x1193b9[_0x85db('0x15b')],_0x1193b9[_0x85db('0x3c')],_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x155')](_0x1193b9))[_0x85db('0xac')](loggerCatchQueueSummary('[syncCampaigns]',_0x1193b9));}else{notSendMessagesCampaign(_0x1193b9);}}}};function getCallerIdRandom(_0x341631,_0x460bc6){var _0x1bd358;var _0x4b5fa2;var _0x56594b;if(_0x460bc6<=0x0){_0x460bc6=0x1;}_0x1bd358=new RegExp(_0x85db('0x15d')+_0x460bc6+'}$');_0x4b5fa2=Math[_0x85db('0x15e')](0xa,_0x460bc6-0x1);_0x56594b=Math['pow'](0xa,_0x460bc6)-0x1;return util[_0x85db('0x73')]('%s',_['replace'](_0x341631,_0x1bd358,_[_0x85db('0x15f')](_0x4b5fa2,_0x56594b)));}function extractCalleridName(_0x2a5225){var _0x39edac=_0x2a5225[_0x85db('0x160')](/"(.*?)"/);return _0x39edac?_0x39edac[0x1]:_0x2a5225;}function extractCalleridNumber(_0x353239){var _0x4429a2=_0x353239[_0x85db('0x160')](/<(.*?)>/);return _0x4429a2?_0x4429a2[0x1]:_0x353239;}Dialer['prototype'][_0x85db('0x161')]=function(_0x1d16b1,_0x344577){var _0x30266d=this;var _0xcb9d4=uuid['v4']();this['actions'][_0xcb9d4]=new Action(_0x1d16b1,_0x344577,_0xcb9d4);return new BPromise(function(_0x5b190e,_0x10329b){if(_['isUndefined'](_0x1d16b1)&&typeof _0x1d16b1!==_0x85db('0x162')){return _0x10329b(msgResponse(_0x85db('0x163'),_0x85db('0x13e'),_0x85db('0x164')));}if(_[_0x85db('0x3b')](_0x344577[_0x85db('0x165')][_0x85db('0x166')])||_0x344577[_0x85db('0x165')][_0x85db('0x166')]===null){return _0x10329b(msgResponse('originate',_0x85db('0x13e'),_0x85db('0x167')));}var _0x51c2ce={'XMD-CALLERID':_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x168')](),'XMD-AGI':_0x1d16b1[_0x85db('0x108')]?util[_0x85db('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d16b1['dialQueueProject']):_0x85db('0x169'),'XMD-AGIAFTER':_0x1d16b1['dialQueueProject2']?util[_0x85db('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d16b1['dialQueueProject2']):'NONE','XMD-QUEUE':_0x1d16b1[_0x85db('0x4c')]===_0x85db('0x4d')?util[_0x85db('0x73')](_0x85db('0x16a'),_0x1d16b1[_0x85db('0x3c')],_0x1d16b1[_0x85db('0x16b')]||'',_0x1d16b1[_0x85db('0x10e')]?'c':'',_0x1d16b1[_0x85db('0x16c')]||0x3):_0x85db('0x169'),'XMD-CONTACTID':_0x344577[_0x85db('0xcf')],'XMD-CDRTYPE':_0x85db('0x7'),'CALLERID(all)':_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x168')](),'XMD-AMD':_0x1d16b1[_0x85db('0xe8')]?_0x85db('0x16d'):'NONE','XMD-DESTINATION':_0x85db('0xdd')};if(_0x1d16b1['dialAMDActive']){_0x51c2ce[_0x85db('0x16e')]=_0x1d16b1['dialAMDInitialSilence']||0x9c4;_0x51c2ce[_0x85db('0x16f')]=_0x1d16b1[_0x85db('0x170')]||0x5dc;_0x51c2ce[_0x85db('0x171')]=_0x1d16b1[_0x85db('0x172')]||0x320;_0x51c2ce[_0x85db('0x173')]=_0x1d16b1[_0x85db('0x174')]||0x1388;_0x51c2ce[_0x85db('0x175')]=_0x1d16b1['dialAMDMinWordLength']||0x64;_0x51c2ce['XMD-AMDBETWEENWORDSSILENCE']=_0x1d16b1[_0x85db('0x176')]||0x32;_0x51c2ce[_0x85db('0x177')]=_0x1d16b1[_0x85db('0x178')]||0x3;_0x51c2ce[_0x85db('0x179')]=_0x1d16b1[_0x85db('0x17a')]||0x100;_0x51c2ce['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d16b1[_0x85db('0x17b')]||0x1388;}if(_0x1d16b1[_0x85db('0x4c')]==='outbound'){_0x51c2ce[_0x85db('0x17c')]=_0x344577[_0x85db('0xd2')];}else{_0x51c2ce[_0x85db('0x17d')]=_0x344577[_0x85db('0xd3')];}for(var _0x4c2652 in _0x344577[_0x85db('0x165')]){if(typeof _0x344577[_0x85db('0x165')][_0x4c2652]!==_0x85db('0x94')){if(isNotNull(_0x344577['Contact'][_0x4c2652])&&_0x4c2652!=='id'&&_0x4c2652!==_0x85db('0x17e')&&_0x4c2652!==_0x85db('0x17f')&&_0x4c2652!==_0x85db('0x180')){_0x51c2ce[util[_0x85db('0x73')](_0x85db('0x181'),_0x85db('0x182'),_[_0x85db('0x183')](_0x4c2652))]=_0x344577[_0x85db('0x165')][_0x4c2652];}}}var _0x4dad18=_0x30266d[_0x85db('0xd6')](_0x1d16b1['Trunk'])?getCallerId(_0x1d16b1['Trunk'][_0x85db('0x72')],_0x1d16b1['dialOriginateCallerIdName'],_0x1d16b1[_0x85db('0x184')]>0x0?getCallerIdRandom(_0x1d16b1[_0x85db('0x57')],_0x1d16b1[_0x85db('0x184')]):_0x1d16b1['dialOriginateCallerIdNumber']):getCallerId(_[_0x85db('0xa8')](_0x1d16b1[_0x85db('0x13a')])?_0x1d16b1[_0x85db('0x70')][_0x85db('0x72')]:_0x1d16b1['TrunkBackup'][_0x85db('0x72')],_0x1d16b1['dialOriginateCallerIdName'],_0x1d16b1[_0x85db('0x184')]>0x0?getCallerIdRandom(_0x1d16b1[_0x85db('0x57')],_0x1d16b1['dialRandomLastDigitCallerIdNumber']):_0x1d16b1['dialOriginateCallerIdNumber']);if(_0x4dad18){_0x51c2ce['XMD-ORIGINATECALLERIDNAME']=_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x185')]=extractCalleridName(_0x4dad18);_0x51c2ce[_0x85db('0x186')]=_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x187')]=extractCalleridNumber(_0x4dad18);}return ami[_0x85db('0xa9')]({'actionid':_0xcb9d4,'action':_0x85db('0x163'),'channel':_0x30266d['isTrunkReachable'](_0x1d16b1[_0x85db('0x70')])?util[_0x85db('0x73')](_0x85db('0x188'),_0x1d16b1[_0x85db('0x70')][_0x85db('0x3c')],isNotNull(_0x1d16b1[_0x85db('0x59')])?_0x1d16b1['dialPrefix'][_0x85db('0x189')]()||'':'',_0x1d16b1[_0x85db('0x18a')]>0x0?_0x344577[_0x85db('0x165')]['phone']['substring'](_0x1d16b1[_0x85db('0x18a')]):_0x344577[_0x85db('0x165')]['phone']):util[_0x85db('0x73')](_0x85db('0x188'),_[_0x85db('0xa8')](_0x1d16b1[_0x85db('0x13a')])?_0x1d16b1['Trunk']['name']:_0x1d16b1[_0x85db('0x13a')]['name'],isNotNull(_0x1d16b1[_0x85db('0x59')])?_0x1d16b1[_0x85db('0x59')][_0x85db('0x189')]()||'':'',_0x1d16b1[_0x85db('0x18a')]>0x0?_0x344577[_0x85db('0x165')]['phone'][_0x85db('0x18b')](_0x1d16b1[_0x85db('0x18a')]):_0x344577[_0x85db('0x165')][_0x85db('0x166')]),'callerid':_0x4dad18,'Exten':_0x85db('0xdd'),'Context':_0x85db('0x18c'),'Priority':'1','variable':_0x51c2ce,'timeout':(_0x1d16b1[_0x85db('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcb9d4})[_0x85db('0xb2')](function(_0x1e86cd){return _0x5b190e(_0x1e86cd);})[_0x85db('0xac')](function(_0x2259e0){_0x1d16b1[_0x85db('0x18d')]+=0x1;var _0x5990ac=new History(_0x30266d[_0x85db('0x23')][_0xcb9d4]);logger[_0x85db('0x8f')](util['format'](_0x85db('0x18e'),JSON[_0x85db('0x47')](_0x2259e0)));_0x5990ac[_0x85db('0xa3')]=0xe;_0x5990ac[_0x85db('0xa4')]=_0x85db('0x18f');_0x5990ac[_0x85db('0x117')]=moment()['format'](_0x85db('0xfa'));_0x5990ac[_0x85db('0xa5')]=_0x5990ac['starttime'];_0x30266d[_0x85db('0xc7')](_0x5990ac)[_0x85db('0xac')](loggerCatch('[originate][error]'));_0x30266d[_0x85db('0xc5')](_0x5990ac)[_0x85db('0xac')](loggerCatch(_0x85db('0x190')))['finally'](function(){delete _0x30266d[_0x85db('0x23')][_0xcb9d4];return _0x10329b(msgResponse(_0x85db('0x163'),_0x85db('0x46'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x85db('0x30')]=function(_0xbc62dd){var _0x22401c=this[_0x85db('0x23')][_0xbc62dd[_0x85db('0x123')]];if(_0x22401c){delete this[_0x85db('0x23')][_0xbc62dd['actionid']];_0x22401c[_0x85db('0x113')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x18cdfb=_0x22401c[_0x85db('0x4c')]===_0x85db('0x76')?this[_0x85db('0x1e')][_0x22401c[_0x85db('0xaf')]]:this[_0x85db('0x1d')][_0x22401c[_0x85db('0x191')]()];if(!this[_0x85db('0xd4')](_0xbc62dd[_0x85db('0x192')])){this['updateOriginated'](_0x18cdfb);return this[_0x85db('0x193')](_0x22401c,_0x18cdfb,_0xbc62dd)['catch'](loggerCatch(_0x85db('0x194')));}this[_0x85db('0x25')][_0xbc62dd[_0x85db('0xe0')]]=_0x22401c;}};Dialer[_0x85db('0x18')][_0x85db('0x195')]=function(_0x3426cf,_0x35c127,_0xbde8c5){var _0x3797ba=new History(_0x35c127);if(_0x3797ba[_0x85db('0xfe')]+_0x3797ba[_0x85db('0xef')]+_0x3797ba[_0x85db('0xff')]+_0x3797ba[_0x85db('0x100')]+_0x3797ba['countdropretry']+_0x3797ba[_0x85db('0xf1')]+_0x3797ba['countmachineretry']+_0x3797ba['countagentrejectretry']>=_0xbde8c5[_0x85db('0xf3')]-0x1){return!![];}switch(_0x3426cf){case 0x3:if(_0x3797ba[_0x85db('0xff')]>=_0xbde8c5[_0x85db('0x196')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countnoanswerretry':_0x3797ba['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x197')],'minutes')[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba['CampaignId']||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x198')));break;case 0x5:if(_0x3797ba['countbusyretry']>=_0xbde8c5[_0x85db('0x199')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countbusyretry':_0x3797ba[_0x85db('0xfe')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5[_0x85db('0x19a')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba['ContactId'],'ListId':_0x3797ba['ListId'],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x19b')));break;case 0x8:if(_0x3797ba[_0x85db('0xef')]>=_0xbde8c5[_0x85db('0x19c')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countcongestionretry':_0x3797ba[_0x85db('0xef')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5[_0x85db('0x19d')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3797ba['countnosuchnumberretry']>=_0xbde8c5['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x85db('0xba')]({'active':![],'countnosuchnumberretry':_0x3797ba[_0x85db('0x100')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x19e')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x19f')));}break;case 0xa:if(_0x3797ba[_0x85db('0xf0')]>=_0xbde8c5[_0x85db('0x1a0')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countdropretry':_0x3797ba[_0x85db('0xf0')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5['dialDropRetryFrequency'],_0x85db('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x116')));break;case 0xb:if(_0x3797ba[_0x85db('0xf1')]>=_0xbde8c5[_0x85db('0x11e')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countabandonedretry':_0x3797ba[_0x85db('0xf1')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5['dialAbandonedRetryFrequency'],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x120')));break;case 0x13:if(_0x3797ba[_0x85db('0xec')]>=_0xbde8c5[_0x85db('0xf6')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countmachineretry':_0x3797ba['countmachineretry']+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0xf9')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0xfb')));break;case 0x14:if(_0x3797ba['countagentrejectretry']>=_0xbde8c5[_0x85db('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3797ba[_0x85db('0xf2')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x1a2')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x85db('0x18')][_0x85db('0x193')]=function(_0x2537fd,_0x2309ff,_0x247055){var _0x6c95fe=this;var _0x391fed=new History(_0x2537fd);return new BPromise(function(_0x5b1d66,_0x4c2173){if(_[_0x85db('0x3b')](_0x2309ff)&&typeof _0x2309ff!==_0x85db('0x162')){return _0x4c2173(msgResponse(_0x85db('0x1a3'),_0x85db('0x13e'),_0x85db('0x1a4')));}if(_['isUndefined'](_0x247055)&&typeof _0x247055!==_0x85db('0x162')){return _0x4c2173(msgResponse('[callProgressDetecting]',_0x85db('0x13e'),'evt\x20is\x20undefine'));}switch(_0x247055['reason']){case'0':_0x2309ff[_0x85db('0x5f')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x0;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1a5');_0x391fed[_0x85db('0x100')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami['emit'](_0x85db('0x1a6'),ut['buildObj'](_0x2537fd,_0x85db('0x1a7')));_0x6c95fe['createHistory'](_0x391fed)['catch'](loggerCatch(_0x85db('0xee')));if(_0x6c95fe[_0x85db('0x195')](0x0,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0x100')]>=_0x2309ff[_0x85db('0x1a8')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1a9'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1a9'));}}break;case'3':_0x2309ff[_0x85db('0x5e')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x3;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1aa');_0x391fed[_0x85db('0xff')]+=0x1;_0x391fed['countglobal']+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1ab'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1ac')));_0x6c95fe[_0x85db('0xc7')](_0x391fed)['catch'](loggerCatch(_0x85db('0x1ad')));if(_0x6c95fe['checkRetriveMax'](0x3,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xff')]>=_0x2309ff[_0x85db('0x196')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1ae'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1ae'));}}break;case'5':_0x2309ff[_0x85db('0x5c')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x5;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1af');_0x391fed[_0x85db('0xfe')]+=0x1;_0x391fed['countglobal']+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1b0'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1b1')));_0x6c95fe[_0x85db('0xc7')](_0x391fed)[_0x85db('0xac')](loggerCatch(_0x85db('0x1b2')));if(_0x6c95fe['checkRetriveMax'](0x5,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xfe')]>=_0x2309ff[_0x85db('0x199')]){_0x6c95fe['createStateFinal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b3'));}else{_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b3'));}}break;case'8':_0x2309ff[_0x85db('0x1b4')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x8;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1b5');_0x391fed[_0x85db('0xef')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1b6'),ut[_0x85db('0xe4')](_0x2537fd,'congestion'));_0x6c95fe['createHistory'](_0x391fed)[_0x85db('0xac')](loggerCatch(_0x85db('0x1b7')));if(_0x6c95fe[_0x85db('0x195')](0x8,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xef')]>=_0x2309ff[_0x85db('0x19c')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b8'));}else{_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b8'));}}break;case'11':_0x2309ff[_0x85db('0x1b9')]+=0x1;_0x391fed[_0x85db('0xa3')]=0xb;_0x391fed[_0x85db('0xa4')]=_0x85db('0x11c');_0x391fed[_0x85db('0xf1')]+=0x1;_0x391fed['countglobal']+=0x1;_0x6c95fe[_0x85db('0xc7')](_0x391fed)['catch'](loggerCatch(_0x85db('0x121')));if(_0x6c95fe[_0x85db('0x195')](0xb,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xf1')]>=_0x2309ff['dialAbandonedMaxRetry']){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,'reason\x2011\x20abandoned');}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,'reason\x2011\x20abandoned');}}break;case'20':_0x2309ff['outboundRejectCallsDay']+=0x1;_0x391fed['state']=0x14;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1ba');_0x391fed[_0x85db('0xf2')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami['emit'](_0x85db('0x1bb'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1bc')));_0x6c95fe['createHistory'](_0x391fed)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x6c95fe['checkRetriveMax'](0x14,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xf2')]>=_0x2309ff[_0x85db('0x1a1')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1bd'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1bd'));}}break;default:_0x2309ff[_0x85db('0x109')]+=0x1;_0x391fed['state']=0xc;_0x391fed[_0x85db('0xa4')]=_0x247055[_0x85db('0x1be')];_0x6c95fe[_0x85db('0xc7')](_0x391fed)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x6c95fe[_0x85db('0x195')](_0x247055['reason'],_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xfe')]+_0x391fed[_0x85db('0xef')]+_0x391fed[_0x85db('0xff')]+_0x391fed[_0x85db('0x100')]+_0x391fed[_0x85db('0xf0')]+_0x391fed[_0x85db('0xf1')]+_0x391fed['countmachineretry']+_0x391fed[_0x85db('0xf2')]>=_0x2309ff[_0x85db('0xf3')]){_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x247055[_0x85db('0x1be')]);}else{_0x6c95fe['createStateFinal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x247055[_0x85db('0x1be')]);}}}});};Dialer[_0x85db('0x18')][_0x85db('0xf4')]=function(_0x432cab,_0x4afa87,_0x1a0879,_0x4d983d){var _0xe8668=new Final(_0x432cab);_0xe8668[_0x85db('0xa3')]=0xf;_0xe8668[_0x85db('0xa4')]='Global';this[_0x85db('0x101')](_0xe8668,_0x4afa87,_0x1a0879,_0x4d983d);};Dialer['prototype'][_0x85db('0x101')]=function(_0x56e101,_0x1e33a0,_0x20e819,_0x290f80){this[_0x85db('0xc5')](_0x56e101)[_0x85db('0xb2')](function(){return _0x1e33a0(msgResponse(_0x85db('0x1a3'),_0x85db('0xd5'),_0x290f80));})['catch'](function(){return _0x20e819(msgResponse(_0x85db('0x1bf'),_0x85db('0x13e'),_0x85db('0x1c0')));});};Dialer[_0x85db('0x18')][_0x85db('0x153')]=function(_0x26948e){var _0x4520af=_0x26948e['dialPredictiveOptimizationPercentage']/0x64;var _0x49fc8e=_0x26948e[_0x85db('0x5d')]/(_0x26948e[_0x85db('0x5d')]+_0x26948e[_0x85db('0x5a')]);var _0x511183=Math[_0x85db('0x1c1')](_0x26948e[_0x85db('0x6a')]*(_0x26948e['predictiveIntervalMaxThreshold']/0x64));var _0x25ac0c=Math[_0x85db('0x1c1')](_0x26948e[_0x85db('0x6a')]*(_0x26948e[_0x85db('0x1c2')]/0x64));var _0x1f5bda=_0x26948e[_0x85db('0x9e')]+_0x26948e['talking'];var _0x2821b8=Math[_0x85db('0x1c3')](_0x26948e[_0x85db('0x6c')]*_0x26948e[_0x85db('0x6e')]*_0x26948e[_0x85db('0x67')]*_0x26948e[_0x85db('0x68')]);if(_[_0x85db('0x3b')](_0x26948e[_0x85db('0x27')])){if(!_[_0x85db('0x3b')](_0x26948e[_0x85db('0x26')])){_0x26948e[_0x85db('0x26')]=undefined;loggerPredictive[_0x85db('0x8f')](_0x85db('0x1c4'),_0x85db('0x1c5'));}if(!_['isUndefined'](_0x26948e[_0x85db('0x8a')])){loggerPredictive[_0x85db('0x8f')](_0x85db('0x1c4'),_0x85db('0x1c6'));clearInterval(_0x26948e[_0x85db('0x8a')]);_0x26948e['handlePredictive']=undefined;}_0x26948e[_0x85db('0x27')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x85db('0x78')](_0x26948e['name'],'collection\x20data\x20in\x20progressive\x20at',_0x26948e['startProgressive']);this[_0x85db('0x151')](_0x26948e,0x1);}else if(ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x27')])){this['handlePower'](_0x26948e,0x1);loggerPredictiveCalls[_0x85db('0x78')](_0x85db('0x1c8'),_0x26948e[_0x85db('0x27')],_0x26948e[_0x85db('0x3c')]);_0x26948e['erlangCalls']=0x0;_0x26948e['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4520af<_0x49fc8e&&_0x26948e[_0x85db('0x1c9')]===_0x85db('0x1ca')){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x85db('0x1cb'),_0x85db('0x1cc'),_0x49fc8e,_0x85db('0x27'),_0x26948e[_0x85db('0x3c')]);}else if(_0x2821b8<_0x26948e['predictiveIntervalErlangCallsDroppedCalls']&&_0x26948e['dialPredictiveOptimization']===_0x85db('0x1ca')){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x85db('0x1cd'),_0x2821b8,_0x85db('0x1ce'),_0x26948e['predictiveIntervalErlangCallsDroppedCalls'],_0x85db('0x27'),_0x26948e[_0x85db('0x3c')]);}else if(!ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x27')])&&_[_0x85db('0x3b')](_0x26948e[_0x85db('0x26')])&&!_[_0x85db('0x3b')](_0x26948e[_0x85db('0x27')])){_0x26948e[_0x85db('0x26')]=moment()['format'](_0x85db('0xfa'));loggerPredictive['info'](_0x26948e[_0x85db('0x3c')],_0x85db('0x1cf'),_0x26948e['startPredictive']);this[_0x85db('0xb7')](_0x26948e[_0x85db('0x1c7')])[_0x85db('0xb2')](this['getDataPredictive'](_0x26948e))['then'](mergeDataErlangB(_0x26948e))['then'](this[_0x85db('0x1d0')](_0x26948e))[_0x85db('0xac')](loggerCatchPredictive(_0x85db('0x1d1'),_0x26948e));}else if(!ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x26')])){_0x26948e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x26948e[_0x85db('0x26')]=moment()[_0x85db('0x73')](_0x85db('0xfa'));loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d2'),_0x26948e[_0x85db('0x26')]);clearInterval(_0x26948e[_0x85db('0x8a')]);_0x26948e[_0x85db('0x8a')]=undefined;this[_0x85db('0xb7')](_0x26948e[_0x85db('0x1c7')])['then'](this[_0x85db('0x1d3')](_0x26948e))[_0x85db('0xb2')](mergeDataErlangB(_0x26948e))[_0x85db('0xb2')](this['startMethodPredictive'](_0x26948e))['catch'](loggerCatchPredictive(_0x85db('0x1d4'),_0x26948e));}else if(_0x26948e['predictiveIntervalAvailable']&&_0x1f5bda<_0x26948e[_0x85db('0x6a')]-_0x25ac0c){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d5'),_0x1f5bda,_0x85db('0x1d6'),_0x26948e[_0x85db('0x6a')],'-',_0x25ac0c,'=',_0x26948e[_0x85db('0x6a')]-_0x25ac0c,')');}else if(_0x26948e[_0x85db('0x6a')]&&_0x1f5bda>_0x26948e[_0x85db('0x6a')]+_0x511183){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d5'),_0x1f5bda,_0x85db('0x1d7'),_0x26948e[_0x85db('0x6a')],'+',_0x511183,'=',_0x26948e['predictiveIntervalAvailable']+_0x511183,')');}};Dialer[_0x85db('0x18')]['getDataPredictive']=function(_0x2d1b48){var _0x47647f=this;return function(_0x5e86a1){return new BPromise(function(_0x9b1b0f,_0x2ecf34){_[_0x85db('0x128')](_0x2d1b48,_0x5e86a1[0x0]);if(checkGetDataPredictive(_0x5e86a1[0x0])){var _0x3de7f5=_0x2d1b48['predictiveIntervalAvailable']=_0x2d1b48[_0x85db('0x9d')]+_0x2d1b48[_0x85db('0x9e')];var _0xc863df=_0x2d1b48[_0x85db('0x1c7')]*0x3c;var _0x1d6c69=_0x5e86a1[0x0][_0x85db('0x63')]+_0x5e86a1[0x0][_0x85db('0x62')];var _0x3da01c=(_0x5e86a1[0x0]['predictiveIntervalAnsweredCalls']+_0x5e86a1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5e86a1[0x0][_0x85db('0x7d')])/_0x5e86a1[0x0][_0x85db('0x6b')];_0x2d1b48['predictiveIntervalHitRate']=_0x3da01c>0x0?_0x3da01c:0x1;switch(_0x2d1b48[_0x85db('0x1c9')]){case _0x85db('0x1ca'):var _0x2dfb35=_0x2d1b48['dialPredictiveOptimizationPercentage']/0x64;return _0x47647f[_0x85db('0x1d8')](_0x3de7f5,_0xc863df,_0x1d6c69,_0x3da01c,_0x2dfb35)[_0x85db('0xb2')](function(_0x5c1e06){return _0x9b1b0f(_0x5c1e06);});case _0x85db('0x1d9'):var _0x45a726=_0x2d1b48['dialPredictiveOptimizationPercentage']/0x64;return _0x47647f[_0x85db('0x1da')](_0x3de7f5,_0xc863df,_0x1d6c69,_0x3da01c,_0x45a726)['then'](function(_0x5966e9){return _0x9b1b0f(_0x5966e9);});default:return _0x2ecf34(msgResponse(_0x85db('0x1db'),_0x85db('0x13e'),_0x85db('0x1dc')));}}else{return _0x2ecf34(msgResponse(_0x85db('0x1db'),_0x85db('0x13e'),_0x85db('0x1dd')));}});};};Dialer[_0x85db('0x18')][_0x85db('0x1de')]=function(_0x4cc9a0){var _0x1ee3bd=this;return function(_0x403cce){return new BPromise(function(_0x3b90c7,_0x497fae){_[_0x85db('0x128')](_0x4cc9a0,_0x403cce[0x0]);if(checkGetDataPredictive(_0x403cce[0x0])){loggerPredictive['info'](JSON[_0x85db('0x47')](_0x403cce[0x0]));if(_0x4cc9a0[_0x85db('0x1c9')]==='dropRate'){return _0x1ee3bd[_0x85db('0xc3')](_0x4cc9a0['id'])[_0x85db('0xb2')](function(_0x4ba99e){var _0xdf3e57=_0x4cc9a0[_0x85db('0x4e')]-_0x4ba99e[0x0][_0x85db('0x1df')];var _0x23971b=_0x4cc9a0[_0x85db('0x1c7')]*0x3c;var _0x1cdc9e=_0x403cce[0x0][_0x85db('0x63')]+_0x403cce[0x0][_0x85db('0x62')];var _0x3c6816=(_0x403cce[0x0][_0x85db('0x61')]+_0x403cce[0x0][_0x85db('0x64')]+_0x403cce[0x0][_0x85db('0x7d')])/_0x403cce[0x0][_0x85db('0x6b')];var _0x390cfc=_0x4cc9a0[_0x85db('0x1e0')]/0x64;_0x4cc9a0[_0x85db('0x69')]=_0x4ba99e[0x0][_0x85db('0x1df')]||0x0;_0x4cc9a0[_0x85db('0x67')]=_0x3c6816>0x0?_0x3c6816:0x1;return _0x1ee3bd[_0x85db('0x1d8')](_0xdf3e57,_0x23971b,_0x1cdc9e,_0x3c6816,_0x390cfc);})[_0x85db('0xb2')](function(_0x589a4f){return _0x3b90c7(_0x589a4f);})[_0x85db('0xac')](function(_0x5b219f){return _0x497fae(msgResponse(_0x85db('0x1e1'),_0x85db('0x13e'),JSON['stringify'](_0x5b219f)));});}if(_0x4cc9a0['dialPredictiveOptimization']===_0x85db('0x1d9')){return _0x1ee3bd[_0x85db('0xc3')](_0x4cc9a0['id'])[_0x85db('0xb2')](function(_0x1b332f){var _0x268a66=_0x4cc9a0[_0x85db('0x4e')]-_0x1b332f[0x0][_0x85db('0x1df')];var _0x49e929=_0x4cc9a0['dialPredictiveInterval']*0x3c;var _0x2dc674=_0x403cce[0x0][_0x85db('0x63')]+_0x403cce[0x0][_0x85db('0x62')];var _0x42b4d1=(_0x403cce[0x0][_0x85db('0x61')]+_0x403cce[0x0][_0x85db('0x64')]+_0x403cce[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x403cce[0x0][_0x85db('0x6b')];var _0x3beb08=_0x4cc9a0[_0x85db('0x1e0')]/0x64;_0x4cc9a0[_0x85db('0x69')]=_0x1b332f[0x0][_0x85db('0x1df')]||0x0;_0x4cc9a0[_0x85db('0x67')]=_0x42b4d1>0x0?_0x42b4d1:0x1;return _0x1ee3bd[_0x85db('0x1da')](_0x268a66,_0x49e929,_0x2dc674,_0x42b4d1,_0x3beb08);})[_0x85db('0xb2')](function(_0x3eebb2){return _0x3b90c7(_0x3eebb2);})[_0x85db('0xac')](function(_0x79bf6c){return _0x497fae(msgResponse(_0x85db('0x1e1'),_0x85db('0x13e'),JSON[_0x85db('0x47')](_0x79bf6c)));});}}else{return _0x497fae(msgResponse('[getDataPredictive]',_0x85db('0x13e'),'check\x20failure'));}});};};Dialer[_0x85db('0x18')][_0x85db('0x1d0')]=function(_0x35fafb){var _0x230f52=this;return function(){var _0x57acce=0x0;var _0x38b78c=Math['floor'](_0x35fafb[_0x85db('0x6d')]*0x3e8);if(_0x38b78c>0x0){_0x38b78c=_0x38b78c<0x64?0x64:_0x38b78c;loggerPredictive[_0x85db('0x78')](_0x35fafb[_0x85db('0x3c')],_0x85db('0x1e2'),_0x38b78c,_0x85db('0x48'));_0x35fafb[_0x85db('0x8a')]=setInterval(function(){_0x230f52[_0x85db('0x8a')](_0x35fafb);loggerPredictiveCalls['info'](_0x85db('0x1e3'),_0x57acce+=0x1);},_0x38b78c);}else{loggerPredictive[_0x85db('0x78')](_0x35fafb[_0x85db('0x3c')],_0x85db('0x1e4'));}};};Dialer['prototype'][_0x85db('0x1e5')]=function(_0x44f09b,_0x49240f){var _0x56916a=this;return function(_0x108e12){if(_[_0x85db('0x44')](_0x108e12)){if(_[_0x85db('0xa8')](_0x49240f[_0x85db('0xd1')])||!_0x49240f['recallme']){if(_0x44f09b[_0x85db('0x55')]==='booked'){_0x44f09b['queueStatusComplete']=_[_0x85db('0x3b')](_0x44f09b[_0x85db('0x12c')])?!![]:_0x44f09b['queueStatusComplete'];var _0xbf3d73=uuid['v4']();_0x56916a[_0x85db('0x23')][_0xbf3d73]=new Action(_0x44f09b,_0x49240f,_0xbf3d73);loggerBooked[_0x85db('0x78')](_0x85db('0x1e6'),_0xbf3d73,_0x85db('0x1e7'),JSON[_0x85db('0x47')](_0x44f09b['queueStatusComplete']),'Queue:\x20',_0x44f09b[_0x85db('0x3c')]);if(_0x44f09b[_0x85db('0x12c')]){_0x44f09b['queueStatusComplete']=![];_0x56916a[_0x85db('0x29')][_0x56916a['actions'][_0xbf3d73][_0x85db('0xaf')]]=[];ami['Action']({'actionid':_0xbf3d73,'action':'queuestatus','queue':_0x44f09b[_0x85db('0x3c')]})['catch'](function(){_0x56916a['updateOriginated'](_0x44f09b);_0x56916a[_0x85db('0xba')]({'active':![],'ContactId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['ContactId'],'ListId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['ListId'],'VoiceQueueId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['VoiceQueueId']||undefined,'CampaignId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x1e8')));delete _0x56916a[_0x85db('0x23')][_0xbf3d73];});}else{loggerBooked[_0x85db('0x78')](_0x85db('0x1e9'),JSON['stringify'](_0x44f09b[_0x85db('0x12c')]),_0x85db('0x1ea'),_0x44f09b[_0x85db('0x3c')]);_0x56916a[_0x85db('0xae')](_0x44f09b);_0x56916a[_0x85db('0xba')]({'active':![],'ContactId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xcf')],'ListId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xd0')],'VoiceQueueId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['VoiceQueueId']||undefined,'CampaignId':_0x56916a['actions'][_0xbf3d73][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x1e8')));delete _0x56916a['actions'][_0xbf3d73];}}else{return _0x56916a['actionOriginate'](_0x44f09b,_0x49240f);}}else{if(getDiff(_0x49240f[_0x85db('0x1eb')])<_0x44f09b[_0x85db('0x1ec')]*0x3c){if(_0x49240f['Agent']&&!_0x49240f[_0x85db('0x1ed')][_0x85db('0x1ee')]){_0x56916a[_0x85db('0x1c')][_0x85db('0x133')](_0x49240f['id'])[_0x85db('0x12e')](function(){_0x56916a['updateOriginated'](_0x44f09b);});}else{_0x56916a['unlockContact']({'active':![]},_0x49240f['id'],0x1)[_0x85db('0x12e')](function(){_0x56916a['updateOriginated'](_0x44f09b);});}}else{_0x44f09b['outboundReCallsDay']+=0x1;_0x56916a[_0x85db('0xae')](_0x44f09b);if(_0x44f09b[_0x85db('0x1ef')]){_0x56916a[_0x85db('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49240f[_0x85db('0xcf')],'ListId':_0x49240f['ListId'],'VoiceQueueId':_0x49240f[_0x85db('0xd2')]||undefined,'CampaignId':_0x49240f['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x56916a[_0x85db('0xc7')](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f0'),0x17,_0x85db('0x1f1')))[_0x85db('0xac')](loggerCatch(_0x85db('0x1f2')));}else{_0x56916a['saveInDb'](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f3'),0x16,_0x85db('0x1f4')),'[Originate][HistoryRecallClose][historyCatch]',_0x85db('0x1f5'));}}}}else{_0x44f09b['outboundBlacklistCallsDay']+=0x1;_0x56916a[_0x85db('0xcd')](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f6'),0xd,_0x85db('0x1f7')),_0x85db('0x1f8'),_0x85db('0x1f9'));throw _0x85db('0x1fa');}};};Dialer[_0x85db('0x18')][_0x85db('0x156')]=function(_0x4ae33d){var _0x1cc78d=this;var _0x27a33c=_0x4ae33d[_0x85db('0x1fb')]-_0x4ae33d['originated']-_0x4ae33d['temp'];emitCampaignSummary(_0x4ae33d);if(_0x27a33c>0x0){if(_0x27a33c>this[_0x85db('0x21')]){_0x27a33c=this[_0x85db('0x21')];}_0x4ae33d[_0x85db('0xbf')]+=_0x27a33c;this[_0x85db('0xc1')](_0x4ae33d['id'],_0x27a33c,_0x4ae33d[_0x85db('0x1fc')],_0x4ae33d)[_0x85db('0xb2')](function(_0x110401){_0x4ae33d[_0x85db('0xbf')]-=_0x27a33c;_0x4ae33d[_0x85db('0xbf')]=_0x4ae33d[_0x85db('0xbf')]>0x0?_0x4ae33d[_0x85db('0xbf')]:0x0;if(!checkContactEmpty(_0x110401)){_0x4ae33d['message']=_0x85db('0x9a');logger[_0x85db('0x78')](_0x85db('0x1fd')+_0x4ae33d[_0x85db('0x3c')]);}else{_0x4ae33d[_0x85db('0x93')]+=_0x110401[_0x85db('0x92')];_0x4ae33d[_0x85db('0x3d')]=_0x85db('0x1fe');for(var _0x98e302=0x0;_0x98e302<_0x110401[_0x85db('0x92')];_0x98e302+=0x1){_0x4ae33d[_0x85db('0x1ff')]+=0x1;if(_['isNil'](_0x110401[_0x98e302])||_['isNil'](_0x110401[_0x98e302]['Contact'])||_[_0x85db('0xa8')](_0x110401[_0x98e302][_0x85db('0x165')]['phone'])){_0x1cc78d[_0x85db('0xcc')]('[actionOriginate]\x20',_0x4ae33d,_0x110401[_0x98e302]);}else{_0x1cc78d[_0x85db('0xb5')](_[_0x85db('0xce')](_0x110401[_0x98e302],[_0x85db('0xd3'),_0x85db('0x200')]))[_0x85db('0xb2')](_0x1cc78d[_0x85db('0x1e5')](_0x4ae33d,_0x110401[_0x98e302]))[_0x85db('0xac')](_0x1cc78d[_0x85db('0xcb')](_0x85db('0x201'),_0x4ae33d));}}}})[_0x85db('0xac')](loggerGetContactDialer(_0x85db('0x202'),_0x4ae33d,_0x27a33c));}};Dialer[_0x85db('0x18')][_0x85db('0x151')]=function(_0x3dd2e2,_0x13ba35){var _0x21887f=this;var _0xdfd1cc=[];var _0x531f2a=_0x13ba35>=0x1?_0x13ba35:0x1;if(_0x3dd2e2[_0x85db('0x55')]===_0x85db('0x8')){_0x531f2a=0x1;}var _0x50c02d=Math[_0x85db('0x1c3')](_0x3dd2e2[_0x85db('0x9e')]*_0x531f2a)-_0x3dd2e2[_0x85db('0x93')]-_0x3dd2e2['temp'];emitVoiceQueueSummary(_0x3dd2e2);if(_0x3dd2e2[_0x85db('0x203')]>0x0){var _0x3e5183=_0x3dd2e2[_0x85db('0x203')]-_0x3dd2e2['originated']-_0x3dd2e2[_0x85db('0x9d')]-_0x3dd2e2[_0x85db('0xbf')]-_0x3dd2e2[_0x85db('0x4f')];if(_0x50c02d>_0x3e5183){_0x50c02d=_0x3e5183;}}if(_0x50c02d>0x0){if(_0x3dd2e2[_0x85db('0x55')]==='booked'){_0x50c02d=0x1;}if(_0x50c02d>this[_0x85db('0x21')]){_0x50c02d=this[_0x85db('0x21')];}_0x3dd2e2['temp']+=_0x50c02d;for(var _0x52d123 in this[_0x85db('0x1f')]){if(typeof this[_0x85db('0x1f')][_0x52d123]!=='undefined'){if(this['agents'][_0x52d123][_0x85db('0xa3')]==='not_inuse'&&this[_0x85db('0x1f')][_0x52d123]['status']===_0x85db('0xd8')){_0xdfd1cc[_0x85db('0x127')](this[_0x85db('0x1f')][_0x52d123]['id']);}}}this['getContactDialer'](_0x3dd2e2['id'],_0xdfd1cc,_0x50c02d,_0x3dd2e2['dialOrderByScheduledAt'],_0x3dd2e2)[_0x85db('0xb2')](function(_0x512ae0){_0x3dd2e2[_0x85db('0xbf')]-=_0x50c02d;_0x3dd2e2['temp']=_0x3dd2e2[_0x85db('0xbf')]>0x0?_0x3dd2e2['temp']:0x0;if(!checkContactEmpty(_0x512ae0)){_0x21887f['countReScheduled'](_0x3dd2e2)[_0x85db('0xb2')](sendMessageReschedule(_0x3dd2e2))[_0x85db('0xac')](loggerCatch(_0x85db('0x204')));}else{_0x3dd2e2[_0x85db('0x93')]+=_0x512ae0['length'];_0x3dd2e2[_0x85db('0x3d')]=_0x3dd2e2[_0x85db('0x55')]===_0x85db('0x8')?_0x85db('0x16d'):_0x85db('0x1fe');for(var _0x466d12=0x0;_0x466d12<_0x512ae0[_0x85db('0x92')];_0x466d12+=0x1){if(_['isNil'](_0x512ae0[_0x466d12])||_[_0x85db('0xa8')](_0x512ae0[_0x466d12][_0x85db('0x165')])||_['isNil'](_0x512ae0[_0x466d12][_0x85db('0x165')][_0x85db('0x166')])){_0x21887f[_0x85db('0xcc')]('[actionOriginate]\x20',_0x3dd2e2,_0x512ae0[_0x466d12]);}else{_0x21887f['checkIsBlackList'](_[_0x85db('0xce')](_0x512ae0[_0x466d12],[_0x85db('0xd2'),_0x85db('0x200')]))[_0x85db('0xb2')](_0x21887f[_0x85db('0x1e5')](_0x3dd2e2,_0x512ae0[_0x466d12]))[_0x85db('0xac')](_0x21887f[_0x85db('0xcb')]('[actionOriginate]\x20',_0x3dd2e2));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3dd2e2,_0x50c02d));}};Dialer['prototype'][_0x85db('0x8a')]=function(_0x17213e){if(_0x17213e['dialLimitQueue']>0x0){var _0x2d2987=_0x17213e[_0x85db('0x203')]-_0x17213e['originated']-_0x17213e[_0x85db('0x9d')];if(_0x2d2987>0x0){this[_0x85db('0x205')](_0x17213e);}else{loggerPredictiveCalls[_0x85db('0x78')]('[handlePredictive][limitChannel]');}}else{this[_0x85db('0x205')](_0x17213e);}};Dialer[_0x85db('0x18')][_0x85db('0x205')]=function(_0x41dc5d){var _0x1f3f15=this;var _0x7f010b=[];_0x41dc5d[_0x85db('0x93')]+=0x1;for(var _0x45038b in this[_0x85db('0x1f')]){if(typeof this[_0x85db('0x1f')][_0x45038b]!=='undefined'){if(this['agents'][_0x45038b][_0x85db('0xa3')]===_0x85db('0x206')&&this[_0x85db('0x1f')][_0x45038b][_0x85db('0xaa')]===_0x85db('0xd8')){_0x7f010b[_0x85db('0x127')](this[_0x85db('0x1f')][_0x45038b]['id']);}}}this['getContactDialer'](_0x41dc5d['id'],_0x7f010b,0x1,_0x41dc5d[_0x85db('0x1fc')],_0x41dc5d)[_0x85db('0xb2')](function(_0x350544){if(!checkContactEmpty(_0x350544)){checkContactLowerLimitOriginate(_0x41dc5d,0x1,0x0);_0x1f3f15[_0x85db('0xb0')](_0x41dc5d)[_0x85db('0xb2')](sendMessageReschedule(_0x41dc5d))[_0x85db('0xac')](loggerCatch(_0x85db('0x204')));}else{_0x41dc5d[_0x85db('0x3d')]=_0x85db('0x1fe');if(_['isNil'](_0x350544[0x0])||_['isNil'](_0x350544[0x0]['Contact'])||_[_0x85db('0xa8')](_0x350544[0x0]['Contact'][_0x85db('0x166')])){_0x1f3f15[_0x85db('0xcc')](_0x85db('0x207'),_0x41dc5d,_0x350544[0x0]);}else{_0x1f3f15[_0x85db('0xb3')](_['pick'](_0x350544[0x0],[_0x85db('0xd2'),_0x85db('0x200')]))['then'](_0x1f3f15[_0x85db('0x1e5')](_0x41dc5d,_0x350544[0x0]))[_0x85db('0xac')](_0x1f3f15['loggerHandler'](_0x85db('0x208'),_0x41dc5d));}}})[_0x85db('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x41dc5d,0x1));emitVoiceQueueSummary(_0x41dc5d);};Dialer[_0x85db('0x18')][_0x85db('0x1d8')]=function(_0x310523,_0x369b70,_0x5dca56,_0x5ac24e,_0x187585,_0xb6e49e){loggerPredictive[_0x85db('0x78')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x85db('0x78')](_0x85db('0x209'),_0x310523);loggerPredictive[_0x85db('0x78')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x369b70);loggerPredictive[_0x85db('0x78')](_0x85db('0x20a'),_0x5dca56);loggerPredictive[_0x85db('0x78')](_0x85db('0x20b'),_0x5ac24e);loggerPredictive['info'](_0x85db('0x20c'),_0x187585);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x16d33f,_0x5343ec){if(_0x310523<=0x0||isNaN(_0x310523)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),_0x85db('0x20e')+_0x310523));}if(_0x5dca56<=0x0||isNaN(_0x5dca56)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),'Ts\x20=\x20'+_0x5dca56));}if(_0x5ac24e<=0x0||isNaN(_0x5ac24e)){return _0x5343ec(msgResponse('[abandonmentRate]','Error',_0x85db('0x20f')+_0x5ac24e));}if(_0x369b70<=0x0||isNaN(_0x369b70)){return _0x5343ec(msgResponse('[abandonmentRate]',_0x85db('0x46'),_0x85db('0x210')+_0x369b70));}if(_0x187585<=0x0||isNaN(_0x187585)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),'Amax\x20=\x20'+_0x187585));}_0xb6e49e=_0xb6e49e||0x0;var _0x4631fa=0x1/_0x5dca56;var _0x45bfe0=0x0;var _0x3e1646=0x0;var _0x4da4ae=0x0;var _0x466ee8=0x0;for(var _0x201030=0x0;_0x4da4ae<_0x187585;_0x201030+=0x1){_0x3e1646=_0x201030/_0x369b70;_0x45bfe0=(_0x5ac24e*_0x3e1646+_0xb6e49e)/_0x4631fa;_0x4da4ae=erlangb(_0x45bfe0,_0x310523);_0x466ee8=_0x45bfe0/_0x310523*(0x1-erlangb(_0x45bfe0,_0x310523));}return _0x16d33f({'erlangCalls':_0x201030,'erlangCallToSecond':_0x369b70/_0x201030,'erlangAbandonmentRate':_0x4da4ae,'erlangBusyFactor':_0x466ee8});});};Dialer['prototype']['busyFactor']=function(_0x30468c,_0x5dd10d,_0x2c83cd,_0x2e1453,_0x2b2482,_0x1cb2d2){loggerPredictive[_0x85db('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x85db('0x78')](_0x85db('0x209'),_0x30468c);loggerPredictive[_0x85db('0x78')](_0x85db('0x211'),_0x5dd10d);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',_0x2c83cd);loggerPredictive['info']('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',_0x2e1453);loggerPredictive[_0x85db('0x78')](_0x85db('0x212'),_0x2b2482);loggerPredictive[_0x85db('0x78')](_0x85db('0x80'));return new BPromise(function(_0x4390cc,_0x3263cd){if(_0x30468c<=0x0||isNaN(_0x30468c)){return _0x3263cd(msgResponse(_0x85db('0x213'),'Error',_0x85db('0x20e')+_0x30468c));}if(_0x2c83cd<=0x0||isNaN(_0x2c83cd)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x214')+_0x2c83cd));}if(_0x2e1453<=0x0||isNaN(_0x2e1453)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x20f')+_0x2e1453));}if(_0x5dd10d<=0x0||isNaN(_0x5dd10d)){return _0x3263cd(msgResponse('[busyFactor]',_0x85db('0x46'),_0x85db('0x210')+_0x5dd10d));}if(_0x2b2482<=0x0||isNaN(_0x2b2482)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x215')+_0x2b2482));}_0x1cb2d2=_0x1cb2d2||0x0;var _0x2d2582=0x1/_0x2c83cd;var _0x3a596f=0x0;var _0x3475c5=0x0;var _0x27ef74=0x0;var _0x237faf=0x0;for(var _0x1065c7=0x0;_0x237faf<_0x2b2482;_0x1065c7+=0x1){_0x3475c5=_0x1065c7/_0x5dd10d;_0x3a596f=(_0x2e1453*_0x3475c5+_0x1cb2d2)/_0x2d2582;_0x27ef74=erlangb(_0x3a596f,_0x30468c);_0x237faf=_0x3a596f/_0x30468c*(0x1-erlangb(_0x3a596f,_0x30468c));}return _0x4390cc({'erlangCalls':_0x1065c7,'erlangCallToSecond':_0x5dd10d/_0x1065c7,'erlangAbandonmentRate':_0x27ef74,'erlangBusyFactor':_0x237faf});});};module[_0x85db('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5fe8c17..2fba5cd 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd75b=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','diff','seconds','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xd75b,0x1de));var _0xbd75=function(_0x3ee827,_0x2c011d){_0x3ee827=_0x3ee827-0x0;var _0x1368dd=_0xd75b[_0x3ee827];return _0x1368dd;};'use strict';var util=require('util');var _=require(_0xbd75('0x0'));var moment=require(_0xbd75('0x1'));function getSeconds(_0x4e5424,_0x191926){var _0x55b1da=moment(_0x4e5424)['milliseconds'](0x0);var _0x54e584=moment(_0x191926)['milliseconds'](0x0);return _0x55b1da[_0xbd75('0x2')](_0x54e584,_0xbd75('0x3'));}function QueueCallerAbandon(_0x165ea9,_0x4ecbc2){this[_0xbd75('0x4')]=_0x165ea9[_0xbd75('0x4')];this['type']=_0x165ea9['type'];this[_0xbd75('0x5')]=_0x165ea9[_0xbd75('0x6')]===_0xbd75('0x7')?'queue':_0x165ea9[_0xbd75('0x6')];this[_0xbd75('0x8')]=_0x165ea9[_0xbd75('0x8')];this['countcongestionretry']=_0x165ea9[_0xbd75('0x9')];this[_0xbd75('0xa')]=_0x165ea9[_0xbd75('0xa')];this[_0xbd75('0xb')]=_0x165ea9[_0xbd75('0x8')]+_0x165ea9[_0xbd75('0x9')]+_0x165ea9[_0xbd75('0xa')]+_0x165ea9[_0xbd75('0xc')]+_0x165ea9[_0xbd75('0xd')]+_0x165ea9[_0xbd75('0xe')]+_0x165ea9['countmachineretry']+_0x165ea9[_0xbd75('0xf')];this['countnosuchnumberretry']=_0x165ea9[_0xbd75('0xc')];this[_0xbd75('0xd')]=_0x165ea9[_0xbd75('0xd')];this[_0xbd75('0xe')]=_0x165ea9['countabandonedretry'];this['countmachineretry']=_0x165ea9[_0xbd75('0x10')];this['countagentrejectretry']=_0x165ea9[_0xbd75('0xf')];this[_0xbd75('0x11')]=_0x4ecbc2[_0xbd75('0x11')];this[_0xbd75('0x12')]=_0x165ea9[_0xbd75('0x13')];this['calleridnum']=_0x165ea9[_0xbd75('0x14')];this[_0xbd75('0x15')]=_0x165ea9['starttime'];this['responsetime']=_0x165ea9[_0xbd75('0x16')];this['droptime']=_0x165ea9[_0xbd75('0x17')];this[_0xbd75('0x18')]=this[_0xbd75('0x17')];this[_0xbd75('0x19')]=getSeconds(_0x165ea9[_0xbd75('0x16')],_0x165ea9[_0xbd75('0x15')]);this[_0xbd75('0x1a')]=getSeconds(this['droptime'],_0x165ea9[_0xbd75('0x16')]);this[_0xbd75('0x1b')]=0x0;this['queue']=_0x4ecbc2[_0xbd75('0x1c')];this[_0xbd75('0x1d')]=_0x4ecbc2['connectedlinename'];this[_0xbd75('0x1e')]=_0x4ecbc2[_0xbd75('0x1e')];this['callback']=_0x165ea9[_0xbd75('0x1f')];this[_0xbd75('0x20')]=_0x165ea9[_0xbd75('0x20')];this[_0xbd75('0x21')]=_0x165ea9[_0xbd75('0x21')];this[_0xbd75('0x22')]=_0x165ea9[_0xbd75('0x22')];this[_0xbd75('0x23')]=_0x165ea9[_0xbd75('0x23')];this[_0xbd75('0x24')]=_0x165ea9[_0xbd75('0x24')];this[_0xbd75('0x25')]=_0x165ea9[_0xbd75('0x25')];this[_0xbd75('0x26')]=_0x165ea9[_0xbd75('0x26')];this['CampaignId']=_0x165ea9[_0xbd75('0x27')];this[_0xbd75('0x28')]=_0x165ea9['originatecalleridnum']||'';this[_0xbd75('0x29')]=_0x165ea9[_0xbd75('0x29')]||'';}module[_0xbd75('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x7e2a=['responsetime','droptime','holdtime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','calleridnum','number','starttime'];(function(_0x569560,_0x16b989){var _0x3c1de0=function(_0x1f652b){while(--_0x1f652b){_0x569560['push'](_0x569560['shift']());}};_0x3c1de0(++_0x16b989);}(_0x7e2a,0x1b2));var _0xa7e2=function(_0x418361,_0x5816c8){_0x418361=_0x418361-0x0;var _0x3f2c3c=_0x7e2a[_0x418361];return _0x3f2c3c;};'use strict';var util=require(_0xa7e2('0x0'));var _=require(_0xa7e2('0x1'));var moment=require(_0xa7e2('0x2'));function getSeconds(_0x169cc4,_0x97c978){var _0x3055b0=moment(_0x169cc4)['milliseconds'](0x0);var _0x478b72=moment(_0x97c978)[_0xa7e2('0x3')](0x0);return _0x3055b0['diff'](_0x478b72,_0xa7e2('0x4'));}function QueueCallerAbandon(_0x4f60b9,_0x5d48e3){this[_0xa7e2('0x5')]=_0x4f60b9[_0xa7e2('0x5')];this['type']=_0x4f60b9['type'];this['campaigntype']=_0x4f60b9[_0xa7e2('0x6')]===_0xa7e2('0x7')?_0xa7e2('0x8'):_0x4f60b9['type'];this[_0xa7e2('0x9')]=_0x4f60b9['countbusyretry'];this[_0xa7e2('0xa')]=_0x4f60b9[_0xa7e2('0xa')];this[_0xa7e2('0xb')]=_0x4f60b9['countnoanswerretry'];this[_0xa7e2('0xc')]=_0x4f60b9[_0xa7e2('0x9')]+_0x4f60b9[_0xa7e2('0xa')]+_0x4f60b9[_0xa7e2('0xb')]+_0x4f60b9[_0xa7e2('0xd')]+_0x4f60b9['countdropretry']+_0x4f60b9['countabandonedretry']+_0x4f60b9[_0xa7e2('0xe')]+_0x4f60b9[_0xa7e2('0xf')];this['countnosuchnumberretry']=_0x4f60b9[_0xa7e2('0xd')];this[_0xa7e2('0x10')]=_0x4f60b9[_0xa7e2('0x10')];this[_0xa7e2('0x11')]=_0x4f60b9[_0xa7e2('0x11')];this['countmachineretry']=_0x4f60b9['countmachineretry'];this[_0xa7e2('0xf')]=_0x4f60b9[_0xa7e2('0xf')];this['uniqueid']=_0x5d48e3['uniqueid'];this[_0xa7e2('0x12')]=_0x4f60b9['name'];this[_0xa7e2('0x13')]=_0x4f60b9[_0xa7e2('0x14')];this[_0xa7e2('0x15')]=_0x4f60b9['starttime'];this[_0xa7e2('0x16')]=_0x4f60b9['responsetime'];this[_0xa7e2('0x17')]=_0x4f60b9['droptime'];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x4f60b9['responsetime'],_0x4f60b9[_0xa7e2('0x15')]);this[_0xa7e2('0x18')]=getSeconds(this['droptime'],_0x4f60b9[_0xa7e2('0x16')]);this['talktime']=0x0;this[_0xa7e2('0x8')]=_0x5d48e3['queue'];this['membername']=_0x5d48e3[_0xa7e2('0x19')];this[_0xa7e2('0x1a')]=_0x5d48e3[_0xa7e2('0x1a')];this[_0xa7e2('0x1b')]=_0x4f60b9[_0xa7e2('0x1b')];this['callbackuniqueid']=_0x4f60b9['callbackuniqueid'];this['callbackat']=_0x4f60b9[_0xa7e2('0x1c')];this[_0xa7e2('0x1d')]=_0x4f60b9[_0xa7e2('0x1d')];this[_0xa7e2('0x1e')]=_0x4f60b9[_0xa7e2('0x1e')];this[_0xa7e2('0x1f')]=_0x4f60b9[_0xa7e2('0x1f')];this['UserId']=_0x4f60b9[_0xa7e2('0x20')];this[_0xa7e2('0x21')]=_0x4f60b9[_0xa7e2('0x21')];this[_0xa7e2('0x22')]=_0x4f60b9[_0xa7e2('0x22')];this['originatecalleridnum']=_0x4f60b9[_0xa7e2('0x23')]||'';this[_0xa7e2('0x24')]=_0x4f60b9[_0xa7e2('0x24')]||'';}module[_0xa7e2('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 12b9d44..9609ea8 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(_0x348b08,_0x5d7a46){var _0x484999=function(_0x5ddbac){while(--_0x5ddbac){_0x348b08['push'](_0x348b08['shift']());}};_0x484999(++_0x5d7a46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x18c5ab,_0x30cdf4){var _0x5cc9f1=function(_0x488a68){while(--_0x488a68){_0x18c5ab['push'](_0x18c5ab['shift']());}};_0x5cc9f1(++_0x30cdf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 0b6312e..926b6c4 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 _0x7224=['Empty\x20path','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','localstationid','filename','info','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x7224,0x179));var _0x4722=function(_0x45dd91,_0x28e7df){_0x45dd91=_0x45dd91-0x0;var _0x32eea1=_0x7224[_0x45dd91];return _0x32eea1;};'use strict';var util=require(_0x4722('0x0'));var _=require(_0x4722('0x1'));var BPromise=require(_0x4722('0x2'));var uuid=require(_0x4722('0x3'));var moment=require('moment');var path=require(_0x4722('0x4'));var tiff2pdf=require(_0x4722('0x5'));var gs=require(_0x4722('0x6'));var logger=require(_0x4722('0x7'))('fax');var ami=require(_0x4722('0x8'));var rpcDb=require(_0x4722('0x9'));var Channel=require(_0x4722('0xa'));var ut=require(_0x4722('0xb'));var Action=require(_0x4722('0xc'));var faxAccount=require(_0x4722('0xd'));var attachment=require(_0x4722('0xe'));var faxMessage=require(_0x4722('0xf'));function Fax(_0x4835ef){this['channels']={};this[_0x4722('0x10')]=_0x4835ef[_0x4722('0x10')];this[_0x4722('0x11')]=_0x4835ef[_0x4722('0x11')];this[_0x4722('0x12')]={};ami['on'](_0x4722('0x13'),this[_0x4722('0x14')][_0x4722('0x15')](this));ami['on'](_0x4722('0x16'),this[_0x4722('0x17')][_0x4722('0x15')](this));ami['on'](_0x4722('0x18'),this[_0x4722('0x19')][_0x4722('0x15')](this));ami['on'](_0x4722('0x1a'),this[_0x4722('0x1b')][_0x4722('0x15')](this));ami['on'](_0x4722('0x1c'),this[_0x4722('0x1d')][_0x4722('0x15')](this));ami['on'](_0x4722('0x1e'),this['syncReceiveFax'][_0x4722('0x15')](this));ami['on']('hangup',this[_0x4722('0x1f')][_0x4722('0x15')](this));ami['on'](_0x4722('0x20'),this['syncOriginateResponse']['bind'](this));}Fax[_0x4722('0x21')][_0x4722('0x14')]=function(_0xb3fcea){if(_0xb3fcea[_0x4722('0x22')]==='from-voip-provider'){for(var _0x19335b in this[_0x4722('0x10')]){if(this[_0x4722('0x10')][_0x4722('0x23')](_0x19335b)){if(_0xb3fcea[_0x4722('0x24')]===this[_0x4722('0x10')][_0x19335b]['localstationid']){this[_0x4722('0x25')][_0xb3fcea[_0x4722('0x26')]]={};this['channels'][_0xb3fcea[_0x4722('0x26')]][_0x4722('0x27')]=_0xb3fcea[_0x4722('0x27')];this[_0x4722('0x25')][_0xb3fcea['uniqueid']]['id']=this['faxAccounts'][_0x19335b]['id'];this[_0x4722('0x25')][_0xb3fcea['uniqueid']][_0x4722('0x28')]=this['faxAccounts'][_0x19335b]['name'];logger['info'](_0xb3fcea[_0x4722('0x26')],'\x20syncNewchannel\x20');}}}}if(this[_0x4722('0x12')][_0xb3fcea[_0x4722('0x26')]]){this['channels'][_0xb3fcea[_0x4722('0x26')]]={};this[_0x4722('0x25')][_0xb3fcea[_0x4722('0x26')]][_0x4722('0x27')]=_0xb3fcea[_0x4722('0x27')];logger['info'](_0xb3fcea['uniqueid'],_0x4722('0x29'));}};Fax[_0x4722('0x21')]['syncVarSet']=function(_0x1c3ef5){if(this[_0x4722('0x25')][_0x1c3ef5[_0x4722('0x26')]]){for(var _0x1c3ef3 in _0x1c3ef5[_0x4722('0x2a')]){if(_0x1c3ef5[_0x4722('0x2a')][_0x4722('0x23')](_0x1c3ef3)){this[_0x4722('0x25')][_0x1c3ef5[_0x4722('0x26')]][_0x1c3ef3]=_0x1c3ef5['value'];}}}};Fax[_0x4722('0x21')]['syncNewState']=function(_0x48aed7){if(this[_0x4722('0x25')][_0x48aed7['uniqueid']]){this[_0x4722('0x25')][_0x48aed7['uniqueid']][_0x4722('0x2b')]=_0x48aed7['channelstate'];this[_0x4722('0x25')][_0x48aed7['uniqueid']][_0x4722('0x2c')]=_0x48aed7[_0x4722('0x2c')];}};Fax[_0x4722('0x21')][_0x4722('0x1b')]=function(_0x4b483b){if(this['channels'][_0x4b483b[_0x4722('0x26')]]){for(var _0xd95ae3 in _0x4b483b['variable']){if(_0x4b483b[_0x4722('0x2a')]['hasOwnProperty'](_0xd95ae3)){this[_0x4722('0x25')][_0x4b483b[_0x4722('0x26')]][_0xd95ae3]=_0x4b483b[_0x4722('0x2d')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x29ec65){if(this[_0x4722('0x25')][_0x29ec65[_0x4722('0x26')]]){this[_0x4722('0x25')][_0x29ec65['uniqueid']]['operation']=_0x29ec65[_0x4722('0x2e')];this[_0x4722('0x25')][_0x29ec65[_0x4722('0x26')]][_0x4722('0x2f')]=_0x29ec65[_0x4722('0x2f')];this[_0x4722('0x25')][_0x29ec65[_0x4722('0x26')]][_0x4722('0x30')]=_0x29ec65[_0x4722('0x30')];this['channels'][_0x29ec65[_0x4722('0x26')]][_0x4722('0x31')]=_0x29ec65[_0x4722('0x31')];logger[_0x4722('0x32')](_0x29ec65[_0x4722('0x26')],_0x4722('0x33'));}};Fax[_0x4722('0x21')][_0x4722('0x34')]=function(_0x3c5684){var _0x149b09=this;if(this[_0x4722('0x25')][_0x3c5684['uniqueid']]){var _0x5adf2c=this[_0x4722('0x25')][_0x3c5684['uniqueid']]['id'];this[_0x4722('0x25')][_0x3c5684['uniqueid']][_0x4722('0x35')]=_0x3c5684[_0x4722('0x35')];this['channels'][_0x3c5684[_0x4722('0x26')]][_0x4722('0x36')]=_0x3c5684[_0x4722('0x36')];this[_0x4722('0x25')][_0x3c5684[_0x4722('0x26')]][_0x4722('0x30')]=_0x3c5684[_0x4722('0x30')];this[_0x4722('0x25')][_0x3c5684[_0x4722('0x26')]][_0x4722('0x37')]=_0x3c5684[_0x4722('0x37')];this[_0x4722('0x25')][_0x3c5684[_0x4722('0x26')]][_0x4722('0x38')]=_0x3c5684['transferrate'];this['channels'][_0x3c5684[_0x4722('0x26')]][_0x4722('0x31')]=_0x3c5684[_0x4722('0x31')];this[_0x4722('0x25')][_0x3c5684[_0x4722('0x26')]]['calleridnum']=_0x3c5684[_0x4722('0x39')];if(this['channels'][_0x3c5684[_0x4722('0x26')]][_0x4722('0x36')]>0x0){tiff2pdf(_0x3c5684[_0x4722('0x31')],_0x4722('0x3a'),function(_0x468613){logger['info'](_0x3c5684['uniqueid'],_0x4722('0x3b'),_0x468613['message']);attachment[_0x4722('0x3c')]({'name':path[_0x4722('0x3d')](_0x3c5684[_0x4722('0x31')])[_0x4722('0x28')],'basename':path[_0x4722('0x3d')](_0x3c5684[_0x4722('0x31')])[_0x4722('0x28')]+_0x4722('0x3e'),'type':_0x4722('0x3f')})[_0x4722('0x40')](function(_0x420b94){faxAccount[_0x4722('0x41')](_0x5adf2c,{'from':_0x3c5684[_0x4722('0x39')],'mapKey':_0x4722('0x42'),'body':path[_0x4722('0x3d')](_0x3c5684[_0x4722('0x31')])['name']+'.pdf','AttachmentId':_0x420b94['id']})[_0x4722('0x43')](function(_0x2cfa7c){logger[_0x4722('0x44')](_0x3c5684[_0x4722('0x26')],_0x4722('0x45'),JSON[_0x4722('0x46')](_0x2cfa7c));});})[_0x4722('0x43')](function(_0x3d22fb){logger[_0x4722('0x44')](_0x3c5684['uniqueid'],_0x4722('0x47'),JSON[_0x4722('0x46')](_0x3d22fb));});});}logger['info'](_0x3c5684[_0x4722('0x26')],_0x4722('0x47'));}};Fax[_0x4722('0x21')][_0x4722('0x48')]=function(_0x5b8029){if(this['actions'][_0x5b8029['uniqueid']]){_[_0x4722('0x49')](this['channels'][_0x5b8029[_0x4722('0x26')]],_[_0x4722('0x4a')](_0x5b8029,[_0x4722('0x4b'),_0x4722('0x4c')]));}};function updateStatus(_0xf4d6af){if(_0xf4d6af[_0x4722('0x4d')]){faxMessage[_0x4722('0x4e')](_0xf4d6af[_0x4722('0x4d')],{'failMessage':_0x4722('0x4f')})['then'](function(_0x367ac3){ut[_0x4722('0x50')](_0x4722('0x51'),_0x367ac3);})['catch'](function(_0x4690b5){ut[_0x4722('0x50')](_0x4722('0x52'),_0x4690b5);});}else{ut[_0x4722('0x50')](_0x4722('0x53'));}}Fax['prototype'][_0x4722('0x54')]=function(_0x46830b,_0x2062aa,_0x96ca05){var _0x27b214=this;var _0x4583f6={};if(_0x2062aa){_0x4583f6={'read':_0x2062aa};}else{_0x4583f6={'failMessage':_0x96ca05};}if(this['actions'][_0x46830b][_0x4722('0x4d')]){faxMessage[_0x4722('0x4e')](this['actions'][_0x46830b]['AttachmentId'],_0x4583f6)[_0x4722('0x40')](function(_0x1f5d96){ut[_0x4722('0x50')](_0x4722('0x55'),_0x1f5d96);})[_0x4722('0x43')](function(_0x3e6719){ut[_0x4722('0x50')](_0x4722('0x56'),_0x3e6719);})[_0x4722('0x57')](function(){delete _0x27b214[_0x4722('0x25')][_0x46830b];delete _0x27b214[_0x4722('0x12')][_0x46830b];});}else{ut[_0x4722('0x50')](_0x4722('0x58'));delete this[_0x4722('0x25')][_0x46830b];delete this[_0x4722('0x12')][_0x46830b];}};Fax['prototype'][_0x4722('0x1f')]=function(_0xe22df3){var _0x145989=this;if(this[_0x4722('0x25')][_0xe22df3[_0x4722('0x26')]]){if(this['actions'][_0xe22df3[_0x4722('0x26')]]){this['channels'][_0xe22df3[_0x4722('0x26')]]['id']=this['actions'][_0xe22df3[_0x4722('0x26')]]['id'];this[_0x4722('0x25')][_0xe22df3[_0x4722('0x26')]][_0x4722('0x28')]=this[_0x4722('0x12')][_0xe22df3[_0x4722('0x26')]][_0x4722('0x28')];}logger[_0x4722('0x32')](_0xe22df3['uniqueid'],this[_0x4722('0x12')][_0xe22df3[_0x4722('0x26')]]?_0x4722('0x59'):'\x20hangup\x20faxRiceive\x20',JSON[_0x4722('0x46')](this[_0x4722('0x25')][_0xe22df3[_0x4722('0x26')]]));if(this[_0x4722('0x12')][_0xe22df3['uniqueid']]){if(this['channels'][_0xe22df3[_0x4722('0x26')]]['faxpages']>0x0&&this['channels'][_0xe22df3[_0x4722('0x26')]]['faxstatus']===_0x4722('0x5a')){this[_0x4722('0x54')](_0xe22df3[_0x4722('0x26')],!![]);}else{this['updateStatus'](_0xe22df3[_0x4722('0x26')],![],this['channels'][_0xe22df3[_0x4722('0x26')]][_0x4722('0x5b')]?_0x4722('0x5c')+this[_0x4722('0x25')][_0xe22df3[_0x4722('0x26')]]['faxstatusstring']:_0x4722('0x5d'));}}}};Fax[_0x4722('0x21')][_0x4722('0x5e')]=function(_0x33b22b){var _0x44abc8=this;return new BPromise(function(_0x1078e3,_0xb99b91){_0x44abc8['execOriginate'](_0x33b22b,_0x44abc8[_0x4722('0x10')][_0x33b22b[_0x4722('0x5f')]])[_0x4722('0x40')](function(_0x383ded){ut[_0x4722('0x50')](_0x4722('0x60'),_0x383ded);_0x1078e3(ut[_0x4722('0x61')](_0x4722('0x62')));})[_0x4722('0x43')](function(_0x2d4f20){ut[_0x4722('0x50')](_0x4722('0x63'),_0x2d4f20);updateStatus(_0x33b22b);_0xb99b91(ut[_0x4722('0x61')](_0x4722('0x64')));});});};Fax['prototype']['checkAfterSend']=function(_0x3e2f5c){var _0x39cc8d=this;return new BPromise(function(_0x197a0c,_0x1ba073){var _0x27fec7=_0x39cc8d[_0x4722('0x65')](_0x39cc8d['faxAccounts'][_0x3e2f5c[_0x4722('0x5f')]][_0x4722('0x66')],_0x3e2f5c);if(_0x27fec7[_0x4722('0x67')]){_0x197a0c(ut[_0x4722('0x61')]('Trunk\x20Reachable'));}else{_0x1ba073(ut[_0x4722('0x61')](_0x27fec7['message']));}});};function originate(_0x5cd2fb,_0x4001b4,_0x92b676){return new BPromise(function(_0x408eb1,_0x41e873){if(_0x92b676){var _0x1fc2c3=util[_0x4722('0x68')](_0x4722('0x69'),path[_0x4722('0x3d')](_0x5cd2fb[_0x4722('0x4')])[_0x4722('0x28')],_0x5cd2fb['path']);gs['execute'](_0x1fc2c3)[_0x4722('0x40')](function(){_0x5cd2fb[_0x4722('0x4')]=util['format'](_0x4722('0x6a'),path['parse'](_0x5cd2fb['path'])[_0x4722('0x6b')],path[_0x4722('0x3d')](_0x5cd2fb['path'])[_0x4722('0x28')]);_0x4001b4[_0x4722('0x6c')]=_0x5cd2fb['path'];ut[_0x4722('0x50')](_0x4722('0x6d'),'');ami[_0x4722('0x6e')](ut['variablesAction'](_0x5cd2fb,_0x4001b4))[_0x4722('0x40')](function(_0x3472ad){_0x408eb1(_0x3472ad);})[_0x4722('0x43')](function(_0x506406){_0x41e873(_0x506406);});})['catch'](function(_0x3ddcb7){_0x41e873(_0x3ddcb7);});}else{ami[_0x4722('0x6e')](ut[_0x4722('0x6f')](_0x5cd2fb,_0x4001b4))[_0x4722('0x40')](function(_0x2b5885){_0x408eb1(_0x2b5885);})['catch'](function(_0x395025){_0x41e873(_0x395025);});}});}Fax['prototype'][_0x4722('0x70')]=function(_0x4bcdde,_0x3a4a4d){var _0x124bdc=this;return new BPromise(function(_0x4b4630,_0x563c4b){var _0x1df5c6=uuid['v4']();var _0x46822a=ut[_0x4722('0x71')](_0x4bcdde,_0x3a4a4d);_0x124bdc[_0x4722('0x12')][_0x1df5c6]=new Action(_0x1df5c6,_0x3a4a4d,_0x4bcdde);var _0x136ac0=_0x124bdc['actions'][_0x1df5c6];if(path['parse'](_0x4bcdde[_0x4722('0x4')])['ext']===_0x4722('0x3e')){originate(_0x136ac0,_0x46822a,!![])['then'](function(_0x5836bd){_0x4b4630(_0x5836bd);})[_0x4722('0x43')](function(_0x53d1d1){_0x563c4b(_0x53d1d1);});}else{originate(_0x136ac0,_0x46822a,![])[_0x4722('0x40')](function(_0xaddf3b){_0x4b4630(_0xaddf3b);})[_0x4722('0x43')](function(_0x3ccf6c){_0x563c4b(_0x3ccf6c);});}});};Fax['prototype']['isTrunkReachable']=function(_0x325c70){return!_['isNil'](_0x325c70)&&!_[_0x4722('0x72')](_0x325c70[_0x4722('0x28')])&&!_[_0x4722('0x72')](_0x325c70['active'])&&_0x325c70[_0x4722('0x73')]&&!_[_0x4722('0x72')](this[_0x4722('0x11')][util[_0x4722('0x68')](_0x4722('0x74'),_0x325c70[_0x4722('0x28')])])&&!_[_0x4722('0x72')](this[_0x4722('0x11')][util[_0x4722('0x68')](_0x4722('0x74'),_0x325c70[_0x4722('0x28')])][_0x4722('0x2f')])&&(this[_0x4722('0x11')][util[_0x4722('0x68')](_0x4722('0x74'),_0x325c70[_0x4722('0x28')])][_0x4722('0x2f')]===_0x4722('0x75')||this['trunks'][util['format'](_0x4722('0x74'),_0x325c70['name'])][_0x4722('0x2f')]===_0x4722('0x76'));};Fax[_0x4722('0x21')][_0x4722('0x65')]=function(_0x11bec4,_0x17e8db){if(!this[_0x4722('0x77')](_0x11bec4)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x11bec4)?'':_0x11bec4[_0x4722('0x28')]+_0x4722('0x78'));return{'isValid':![],'message':_0x4722('0x79')};}if(_[_0x4722('0x72')](_0x17e8db['fax'])){ut[_0x4722('0x50')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4722('0x46')](_0x17e8db));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x17e8db[_0x4722('0x4')])){ut[_0x4722('0x50')](_0x4722('0x7a'),JSON['stringify'](_0x17e8db));return{'isValid':![],'message':_0x4722('0x7b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x4722('0x7c')]=Fax; \ No newline at end of file +var _0x2b39=['[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','context','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','\x20syncNewchannel\x20','info','prototype','variable','channelstate','channelstatedesc','syncNewExten','value','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b39,0x197));var _0x92b3=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0x2b39[_0x426fb9];return _0x2d1760;};'use strict';var util=require(_0x92b3('0x0'));var _=require(_0x92b3('0x1'));var BPromise=require('bluebird');var uuid=require(_0x92b3('0x2'));var moment=require(_0x92b3('0x3'));var path=require('path');var tiff2pdf=require(_0x92b3('0x4'));var gs=require(_0x92b3('0x5'));var logger=require('../../../config/logger')(_0x92b3('0x6'));var ami=require(_0x92b3('0x7'));var rpcDb=require(_0x92b3('0x8'));var Channel=require(_0x92b3('0x9'));var ut=require(_0x92b3('0xa'));var Action=require(_0x92b3('0xb'));var faxAccount=require(_0x92b3('0xc'));var attachment=require(_0x92b3('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x332d93){this['channels']={};this[_0x92b3('0xe')]=_0x332d93[_0x92b3('0xe')];this['trunks']=_0x332d93[_0x92b3('0xf')];this[_0x92b3('0x10')]={};ami['on']('newchannel',this[_0x92b3('0x11')][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x13'),this[_0x92b3('0x14')][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x15'),this[_0x92b3('0x16')][_0x92b3('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x17'),this[_0x92b3('0x18')]['bind'](this));ami['on'](_0x92b3('0x19'),this[_0x92b3('0x1a')]['bind'](this));ami['on'](_0x92b3('0x1b'),this['syncHangup'][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x1c'),this[_0x92b3('0x1d')][_0x92b3('0x12')](this));}Fax['prototype']['syncNewchannel']=function(_0x2d57a0){if(_0x2d57a0[_0x92b3('0x1e')]==='from-voip-provider'){for(var _0x3c373b in this[_0x92b3('0xe')]){if(this[_0x92b3('0xe')][_0x92b3('0x1f')](_0x3c373b)){if(_0x2d57a0[_0x92b3('0x20')]===this[_0x92b3('0xe')][_0x3c373b][_0x92b3('0x21')]){this['channels'][_0x2d57a0[_0x92b3('0x22')]]={};this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x24')]=_0x2d57a0[_0x92b3('0x24')];this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]]['id']=this[_0x92b3('0xe')][_0x3c373b]['id'];this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x25')]=this[_0x92b3('0xe')][_0x3c373b][_0x92b3('0x25')];logger['info'](_0x2d57a0['uniqueid'],_0x92b3('0x26'));}}}}if(this[_0x92b3('0x10')][_0x2d57a0['uniqueid']]){this['channels'][_0x2d57a0[_0x92b3('0x22')]]={};this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x24')]=_0x2d57a0[_0x92b3('0x24')];logger[_0x92b3('0x27')](_0x2d57a0[_0x92b3('0x22')],_0x92b3('0x26'));}};Fax[_0x92b3('0x28')][_0x92b3('0x14')]=function(_0x5c0ca0){if(this[_0x92b3('0x23')][_0x5c0ca0['uniqueid']]){for(var _0x11ac1d in _0x5c0ca0[_0x92b3('0x29')]){if(_0x5c0ca0[_0x92b3('0x29')]['hasOwnProperty'](_0x11ac1d)){this[_0x92b3('0x23')][_0x5c0ca0['uniqueid']][_0x11ac1d]=_0x5c0ca0['value'];}}}};Fax[_0x92b3('0x28')][_0x92b3('0x16')]=function(_0x28cd67){if(this[_0x92b3('0x23')][_0x28cd67[_0x92b3('0x22')]]){this[_0x92b3('0x23')][_0x28cd67[_0x92b3('0x22')]][_0x92b3('0x2a')]=_0x28cd67[_0x92b3('0x2a')];this[_0x92b3('0x23')][_0x28cd67['uniqueid']][_0x92b3('0x2b')]=_0x28cd67[_0x92b3('0x2b')];}};Fax['prototype'][_0x92b3('0x2c')]=function(_0x377279){if(this['channels'][_0x377279['uniqueid']]){for(var _0x465369 in _0x377279[_0x92b3('0x29')]){if(_0x377279[_0x92b3('0x29')]['hasOwnProperty'](_0x465369)){this[_0x92b3('0x23')][_0x377279[_0x92b3('0x22')]][_0x465369]=_0x377279[_0x92b3('0x2d')];}}}};Fax[_0x92b3('0x28')][_0x92b3('0x18')]=function(_0x4a4b93){if(this['channels'][_0x4a4b93[_0x92b3('0x22')]]){this['channels'][_0x4a4b93[_0x92b3('0x22')]]['operation']=_0x4a4b93['operation'];this['channels'][_0x4a4b93['uniqueid']][_0x92b3('0x2e')]=_0x4a4b93['status'];this[_0x92b3('0x23')][_0x4a4b93[_0x92b3('0x22')]][_0x92b3('0x21')]=_0x4a4b93['localstationid'];this['channels'][_0x4a4b93[_0x92b3('0x22')]][_0x92b3('0x2f')]=_0x4a4b93[_0x92b3('0x2f')];logger['info'](_0x4a4b93['uniqueid'],_0x92b3('0x30'));}};Fax['prototype'][_0x92b3('0x1a')]=function(_0x489948){var _0x4eb7e1=this;if(this['channels'][_0x489948[_0x92b3('0x22')]]){var _0x204b89=this['channels'][_0x489948[_0x92b3('0x22')]]['id'];this[_0x92b3('0x23')][_0x489948['uniqueid']][_0x92b3('0x31')]=_0x489948[_0x92b3('0x31')];this['channels'][_0x489948[_0x92b3('0x22')]]['pagestransferred']=_0x489948[_0x92b3('0x32')];this['channels'][_0x489948[_0x92b3('0x22')]][_0x92b3('0x21')]=_0x489948[_0x92b3('0x21')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]][_0x92b3('0x33')]=_0x489948[_0x92b3('0x33')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]]['transferrate']=_0x489948[_0x92b3('0x34')];this[_0x92b3('0x23')][_0x489948['uniqueid']]['filename']=_0x489948[_0x92b3('0x2f')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]][_0x92b3('0x35')]=_0x489948[_0x92b3('0x35')];if(this['channels'][_0x489948[_0x92b3('0x22')]][_0x92b3('0x32')]>0x0){tiff2pdf(_0x489948['filename'],_0x92b3('0x36'),function(_0x15b440){logger[_0x92b3('0x27')](_0x489948[_0x92b3('0x22')],_0x92b3('0x37'),_0x15b440[_0x92b3('0x38')]);attachment[_0x92b3('0x39')]({'name':path[_0x92b3('0x3a')](_0x489948[_0x92b3('0x2f')])['name'],'basename':path[_0x92b3('0x3a')](_0x489948[_0x92b3('0x2f')])[_0x92b3('0x25')]+_0x92b3('0x3b'),'type':_0x92b3('0x3c')})[_0x92b3('0x3d')](function(_0x1a77cd){faxAccount['notify'](_0x204b89,{'from':_0x489948['calleridnum'],'mapKey':_0x92b3('0x6'),'body':path['parse'](_0x489948[_0x92b3('0x2f')])[_0x92b3('0x25')]+_0x92b3('0x3b'),'AttachmentId':_0x1a77cd['id']})[_0x92b3('0x3e')](function(_0xdf1f83){logger[_0x92b3('0x3f')](_0x489948['uniqueid'],_0x92b3('0x40'),JSON[_0x92b3('0x41')](_0xdf1f83));});})[_0x92b3('0x3e')](function(_0x822de6){logger[_0x92b3('0x3f')](_0x489948[_0x92b3('0x22')],_0x92b3('0x42'),JSON[_0x92b3('0x41')](_0x822de6));});});}logger['info'](_0x489948[_0x92b3('0x22')],'\x20receiveFax\x20');}};Fax[_0x92b3('0x28')]['syncOriginateResponse']=function(_0xa84256){if(this[_0x92b3('0x10')][_0xa84256[_0x92b3('0x22')]]){_[_0x92b3('0x43')](this[_0x92b3('0x23')][_0xa84256['uniqueid']],_[_0x92b3('0x44')](_0xa84256,[_0x92b3('0x45'),'reason']));}};function updateStatus(_0x1402e9){if(_0x1402e9[_0x92b3('0x46')]){faxMessage['update'](_0x1402e9['AttachmentId'],{'failMessage':_0x92b3('0x47')})[_0x92b3('0x3d')](function(_0x84c214){ut[_0x92b3('0x48')](_0x92b3('0x49'),_0x84c214);})['catch'](function(_0x5941a2){ut[_0x92b3('0x48')](_0x92b3('0x4a'),_0x5941a2);});}else{ut[_0x92b3('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x92b3('0x28')][_0x92b3('0x4b')]=function(_0x5297dd,_0x16071d,_0x2cad3c){var _0x59619c=this;var _0x1d3ed2={};if(_0x16071d){_0x1d3ed2={'read':_0x16071d};}else{_0x1d3ed2={'failMessage':_0x2cad3c};}if(this[_0x92b3('0x10')][_0x5297dd]['AttachmentId']){faxMessage[_0x92b3('0x4c')](this[_0x92b3('0x10')][_0x5297dd][_0x92b3('0x46')],_0x1d3ed2)['then'](function(_0x26a8a6){ut[_0x92b3('0x48')]('[Fax][Message][Updated]',_0x26a8a6);})['catch'](function(_0x352924){ut[_0x92b3('0x48')](_0x92b3('0x4d'),_0x352924);})[_0x92b3('0x4e')](function(){delete _0x59619c[_0x92b3('0x23')][_0x5297dd];delete _0x59619c['actions'][_0x5297dd];});}else{ut[_0x92b3('0x48')](_0x92b3('0x4f'));delete this['channels'][_0x5297dd];delete this[_0x92b3('0x10')][_0x5297dd];}};Fax['prototype'][_0x92b3('0x50')]=function(_0x576461){var _0x188249=this;if(this['channels'][_0x576461[_0x92b3('0x22')]]){if(this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]]){this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]]['id']=this['actions'][_0x576461['uniqueid']]['id'];this[_0x92b3('0x23')][_0x576461['uniqueid']][_0x92b3('0x25')]=this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x25')];}logger[_0x92b3('0x27')](_0x576461[_0x92b3('0x22')],this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]]?'\x20hangup\x20sendFile\x20':_0x92b3('0x51'),JSON[_0x92b3('0x41')](this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]]));if(this['actions'][_0x576461[_0x92b3('0x22')]]){if(this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x52')]>0x0&&this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x17')]==='SUCCESS'){this['updateStatus'](_0x576461['uniqueid'],!![]);}else{this[_0x92b3('0x4b')](_0x576461[_0x92b3('0x22')],![],this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x576461['uniqueid']][_0x92b3('0x53')]:_0x92b3('0x54'));}}}};Fax['prototype'][_0x92b3('0x55')]=function(_0x2000b6){var _0x2a1e60=this;return new BPromise(function(_0x1bd961,_0x239156){_0x2a1e60['execOriginate'](_0x2000b6,_0x2a1e60['faxAccounts'][_0x2000b6['FaxAccountId']])['then'](function(_0x526926){ut[_0x92b3('0x48')](_0x92b3('0x56'),_0x526926);_0x1bd961(ut[_0x92b3('0x38')](_0x92b3('0x57')));})[_0x92b3('0x3e')](function(_0x537426){ut[_0x92b3('0x48')]('[Fax][execOriginate][failure]',_0x537426);updateStatus(_0x2000b6);_0x239156(ut['message'](_0x92b3('0x58')));});});};Fax['prototype'][_0x92b3('0x59')]=function(_0x4d3a4f){var _0x49782f=this;return new BPromise(function(_0x356bd4,_0x43bf65){var _0x17f5d1=_0x49782f[_0x92b3('0x5a')](_0x49782f[_0x92b3('0xe')][_0x4d3a4f[_0x92b3('0x5b')]][_0x92b3('0x5c')],_0x4d3a4f);if(_0x17f5d1['isValid']){_0x356bd4(ut[_0x92b3('0x38')](_0x92b3('0x5d')));}else{_0x43bf65(ut['message'](_0x17f5d1[_0x92b3('0x38')]));}});};function originate(_0x55197c,_0x506cbf,_0x3dc55d){return new BPromise(function(_0x12aa06,_0x85c48){if(_0x3dc55d){var _0x16ca09=util[_0x92b3('0x5e')](_0x92b3('0x5f'),path[_0x92b3('0x3a')](_0x55197c['path'])[_0x92b3('0x25')],_0x55197c[_0x92b3('0x60')]);gs[_0x92b3('0x61')](_0x16ca09)[_0x92b3('0x3d')](function(){_0x55197c[_0x92b3('0x60')]=util[_0x92b3('0x5e')](_0x92b3('0x62'),path[_0x92b3('0x3a')](_0x55197c[_0x92b3('0x60')])[_0x92b3('0x63')],path[_0x92b3('0x3a')](_0x55197c[_0x92b3('0x60')])['name']);_0x506cbf[_0x92b3('0x64')]=_0x55197c[_0x92b3('0x60')];ut['logger'](_0x92b3('0x65'),'');ami[_0x92b3('0x66')](ut[_0x92b3('0x67')](_0x55197c,_0x506cbf))['then'](function(_0x5388b9){_0x12aa06(_0x5388b9);})[_0x92b3('0x3e')](function(_0x1b7f8b){_0x85c48(_0x1b7f8b);});})[_0x92b3('0x3e')](function(_0x39d415){_0x85c48(_0x39d415);});}else{ami[_0x92b3('0x66')](ut[_0x92b3('0x67')](_0x55197c,_0x506cbf))[_0x92b3('0x3d')](function(_0x499fc3){_0x12aa06(_0x499fc3);})['catch'](function(_0x762dca){_0x85c48(_0x762dca);});}});}Fax[_0x92b3('0x28')][_0x92b3('0x68')]=function(_0x5f2593,_0x59e02a){var _0x4812bd=this;return new BPromise(function(_0x1d7a60,_0x18cd20){var _0x2c0107=uuid['v4']();var _0x4a7fd5=ut[_0x92b3('0x69')](_0x5f2593,_0x59e02a);_0x4812bd[_0x92b3('0x10')][_0x2c0107]=new Action(_0x2c0107,_0x59e02a,_0x5f2593);var _0x591995=_0x4812bd[_0x92b3('0x10')][_0x2c0107];if(path[_0x92b3('0x3a')](_0x5f2593['path'])[_0x92b3('0x6a')]===_0x92b3('0x3b')){originate(_0x591995,_0x4a7fd5,!![])[_0x92b3('0x3d')](function(_0x4d1b4c){_0x1d7a60(_0x4d1b4c);})[_0x92b3('0x3e')](function(_0x343899){_0x18cd20(_0x343899);});}else{originate(_0x591995,_0x4a7fd5,![])[_0x92b3('0x3d')](function(_0x514f29){_0x1d7a60(_0x514f29);})[_0x92b3('0x3e')](function(_0x54c9a9){_0x18cd20(_0x54c9a9);});}});};Fax[_0x92b3('0x28')][_0x92b3('0x6b')]=function(_0x41294e){return!_[_0x92b3('0x6c')](_0x41294e)&&!_[_0x92b3('0x6c')](_0x41294e[_0x92b3('0x25')])&&!_[_0x92b3('0x6c')](_0x41294e[_0x92b3('0x6d')])&&_0x41294e[_0x92b3('0x6d')]&&!_[_0x92b3('0x6c')](this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])])&&!_['isNil'](this['trunks'][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])][_0x92b3('0x2e')])&&(this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])][_0x92b3('0x2e')]===_0x92b3('0x6f')||this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])]['status']===_0x92b3('0x70'));};Fax[_0x92b3('0x28')]['checkTrunk']=function(_0x4c4fc8,_0x1cb0b9){if(!this['isTrunkReachable'](_0x4c4fc8)){ut[_0x92b3('0x48')](_0x92b3('0x71'),_[_0x92b3('0x6c')](_0x4c4fc8)?'':_0x4c4fc8[_0x92b3('0x25')]+_0x92b3('0x72'));return{'isValid':![],'message':_0x92b3('0x73')};}if(_[_0x92b3('0x6c')](_0x1cb0b9['fax'])){ut[_0x92b3('0x48')](_0x92b3('0x74'),JSON[_0x92b3('0x41')](_0x1cb0b9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x92b3('0x6c')](_0x1cb0b9[_0x92b3('0x60')])){ut['logger'](_0x92b3('0x75'),JSON[_0x92b3('0x41')](_0x1cb0b9));return{'isValid':![],'message':_0x92b3('0x76')};}return{'isValid':!![],'message':_0x92b3('0x77')};};module[_0x92b3('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 378bca9..06c2b2b 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 _0x0135=['../../../config/logger','preview','lodash','error','inspect','resolve','then','notify','[Notify]\x20','util','bluebird'];(function(_0x219508,_0x440c97){var _0x454ade=function(_0x31ee93){while(--_0x31ee93){_0x219508['push'](_0x219508['shift']());}};_0x454ade(++_0x440c97);}(_0x0135,0xfb));var _0x5013=function(_0x1d904b,_0x34a749){_0x1d904b=_0x1d904b-0x0;var _0xdb0604=_0x0135[_0x1d904b];return _0xdb0604;};'use strict';var util=require(_0x5013('0x0'));var BPromise=require(_0x5013('0x1'));var logger=require(_0x5013('0x2'))(_0x5013('0x3'));var _=require(_0x5013('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2d338d){return function(_0x521496){logger[_0x5013('0x5')](_0x2d338d,util[_0x5013('0x6')](_0x521496,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x26422e,_0x3ecb98){return BPromise[_0x5013('0x7')]()[_0x5013('0x8')](faxAccount[_0x5013('0x9')](_0x26422e,_0x3ecb98))['catch'](loggerCatch(_0x5013('0xa')));}; \ No newline at end of file +var _0xe291=['inspect','notify','resolve','then','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe291,0x1a7));var _0x1e29=function(_0x34d319,_0x2e5614){_0x34d319=_0x34d319-0x0;var _0x2bc087=_0xe291[_0x34d319];return _0x2bc087;};'use strict';var util=require(_0x1e29('0x0'));var BPromise=require(_0x1e29('0x1'));var logger=require('../../../config/logger')(_0x1e29('0x2'));var _=require(_0x1e29('0x3'));var faxAccount=require(_0x1e29('0x4'));function loggerCatch(_0x307f0a){return function(_0x47041d){logger[_0x1e29('0x5')](_0x307f0a,util[_0x1e29('0x6')](_0x47041d,{'showHidden':![],'depth':null}));};}exports[_0x1e29('0x7')]=function(_0xe3e078,_0x309eee){return BPromise[_0x1e29('0x8')]()[_0x1e29('0x9')](faxAccount[_0x1e29('0x7')](_0xe3e078,_0x309eee))['catch'](loggerCatch(_0x1e29('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index a50d237..05626ad 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 _0xcc81=['inspect','util','bluebird','child_process','info','Exec\x20gs','\x20Error\x20:'];(function(_0x4c99d0,_0x1febe1){var _0x5e541f=function(_0x6a83e5){while(--_0x6a83e5){_0x4c99d0['push'](_0x4c99d0['shift']());}};_0x5e541f(++_0x1febe1);}(_0xcc81,0x86));var _0x1cc8=function(_0x1ca7b5,_0x18c9bc){_0x1ca7b5=_0x1ca7b5-0x0;var _0x45265f=_0xcc81[_0x1ca7b5];return _0x45265f;};'use strict';var util=require(_0x1cc8('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x1cc8('0x1'));var exec=require(_0x1cc8('0x2'))['exec'];exports['execute']=function(_0x6a237f){return new BPromise(function(_0x1248c7,_0x5c91c4){exec(_0x6a237f,function(_0x4f8d86,_0x2dc6f1,_0x4a3f5e){logger['info']('Exec\x20gs',_0x2dc6f1);if(_0x4f8d86){logger[_0x1cc8('0x3')](_0x1cc8('0x4'),_0x1cc8('0x5'),util[_0x1cc8('0x6')](_0x4f8d86,{'showHidden':![],'depth':null}),_0x2dc6f1,_0x4a3f5e);_0x5c91c4(_0x4f8d86);}_0x1248c7(_0x2dc6f1);});});}; \ No newline at end of file +var _0xcc01=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process'];(function(_0x18ef99,_0x24b6b9){var _0x2960e5=function(_0x3b80c7){while(--_0x3b80c7){_0x18ef99['push'](_0x18ef99['shift']());}};_0x2960e5(++_0x24b6b9);}(_0xcc01,0xad));var _0x1cc0=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0xcc01[_0x1551af];return _0xd8eb82;};'use strict';var util=require('util');var logger=require(_0x1cc0('0x0'))(_0x1cc0('0x1'));var BPromise=require('bluebird');var exec=require(_0x1cc0('0x2'))['exec'];exports[_0x1cc0('0x3')]=function(_0x16eb2a){return new BPromise(function(_0x1b6bca,_0xb0817a){exec(_0x16eb2a,function(_0x1394a2,_0x8df5f5,_0x1dcc14){logger[_0x1cc0('0x4')](_0x1cc0('0x5'),_0x8df5f5);if(_0x1394a2){logger[_0x1cc0('0x4')]('Exec\x20gs',_0x1cc0('0x6'),util[_0x1cc0('0x7')](_0x1394a2,{'showHidden':![],'depth':null}),_0x8df5f5,_0x1dcc14);_0xb0817a(_0x1394a2);}_0x1b6bca(_0x8df5f5);});});}; \ 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 f2e016e..1475cef 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 _0xd960=['\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','xcally-motion-fax'];(function(_0xa1906d,_0x25485b){var _0x58de6c=function(_0x47755c){while(--_0x47755c){_0xa1906d['push'](_0xa1906d['shift']());}};_0x58de6c(++_0x25485b);}(_0xd960,0x86));var _0x0d96=function(_0x20cb03,_0x5715f8){_0x20cb03=_0x20cb03-0x0;var _0x10da54=_0xd960[_0x20cb03];return _0x10da54;};'use strict';var util=require('util');var _=require(_0x0d96('0x0'));var moment=require(_0x0d96('0x1'));var logger=require(_0x0d96('0x2'))(_0x0d96('0x3'));exports[_0x0d96('0x4')]=function(_0x214260){return{'message':_0x214260};};exports[_0x0d96('0x5')]=function(_0x51306c,_0x3a971f){logger[_0x0d96('0x6')](_0x51306c,util[_0x0d96('0x7')](_0x3a971f,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x546f46,_0x4ec473){var _0x3d2aa7={'XMF-ECM':_0x4ec473[_0x0d96('0x8')],'XMF-HEADERINFO':_0x4ec473['headerinfo'],'XMF-MINRATE':_0x4ec473[_0x0d96('0x9')],'XMF-MAXRATE':_0x4ec473[_0x0d96('0xa')],'XMF-MODEM':util[_0x0d96('0xb')](_0x0d96('0xc'),_0x4ec473[_0x0d96('0xd')]),'XMF-GATEWAY':_0x4ec473['gateway'],'XMF-FAXDETECT':_0x4ec473[_0x0d96('0xe')],'XMF-T38TIMEOUT':_0x4ec473[_0x0d96('0xf')],'XMF-LOCALSTATIONID':_0x4ec473['localstationid'],'XMF-PATH':_0x546f46[_0x0d96('0x10')]};return _0x3d2aa7;};exports[_0x0d96('0x11')]=function(_0x3f23dd,_0x23be76){return{'actionid':_0x3f23dd[_0x0d96('0x12')],'action':'originate','channel':_0x3f23dd['channel'],'Exten':_0x0d96('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0x0d96('0xb')](_0x0d96('0x14'),_0x3f23dd[_0x0d96('0x15')]?_0x3f23dd[_0x0d96('0x15')]:'',_0x3f23dd['localstationid']),'variable':_0x23be76,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f23dd['uniqueid']};}; \ No newline at end of file +var _0x97f2=['moment','../../../../config/logger','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','util','lodash'];(function(_0x422103,_0x4277fa){var _0x494110=function(_0x462097){while(--_0x462097){_0x422103['push'](_0x422103['shift']());}};_0x494110(++_0x4277fa);}(_0x97f2,0x129));var _0x297f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97f2[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x297f('0x0'));var _=require(_0x297f('0x1'));var moment=require(_0x297f('0x2'));var logger=require(_0x297f('0x3'))('fax');exports[_0x297f('0x4')]=function(_0x8b2381){return{'message':_0x8b2381};};exports['logger']=function(_0x2faeb5,_0xafc062){logger[_0x297f('0x5')](_0x2faeb5,util[_0x297f('0x6')](_0xafc062,{'showHidden':![],'depth':null}));};exports[_0x297f('0x7')]=function(_0x54c59c,_0x3d7c32){var _0x110303={'XMF-ECM':_0x3d7c32[_0x297f('0x8')],'XMF-HEADERINFO':_0x3d7c32[_0x297f('0x9')],'XMF-MINRATE':_0x3d7c32[_0x297f('0xa')],'XMF-MAXRATE':_0x3d7c32[_0x297f('0xb')],'XMF-MODEM':util[_0x297f('0xc')]('\x22%s\x22',_0x3d7c32[_0x297f('0xd')]),'XMF-GATEWAY':_0x3d7c32['gateway'],'XMF-FAXDETECT':_0x3d7c32[_0x297f('0xe')],'XMF-T38TIMEOUT':_0x3d7c32[_0x297f('0xf')],'XMF-LOCALSTATIONID':_0x3d7c32[_0x297f('0x10')],'XMF-PATH':_0x54c59c[_0x297f('0x11')]};return _0x110303;};exports[_0x297f('0x12')]=function(_0x5adbd4,_0x4a0279){return{'actionid':_0x5adbd4[_0x297f('0x13')],'action':_0x297f('0x14'),'channel':_0x5adbd4['channel'],'Exten':_0x297f('0x15'),'Context':_0x297f('0x16'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x5adbd4[_0x297f('0x9')]?_0x5adbd4[_0x297f('0x9')]:'',_0x5adbd4[_0x297f('0x10')]),'variable':_0x4a0279,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5adbd4[_0x297f('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d59bce1..96d76c6 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 _0x0678=['initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','util','moment','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0x4b0869,_0x5421a4){var _0x5462da=function(_0x2e74df){while(--_0x2e74df){_0x4b0869['push'](_0x4b0869['shift']());}};_0x5462da(++_0x5421a4);}(_0x0678,0x120));var _0x8067=function(_0x30fe80,_0x353eee){_0x30fe80=_0x30fe80-0x0;var _0x3fed56=_0x0678[_0x30fe80];return _0x3fed56;};'use strict';var BPromise=require('bluebird');var util=require(_0x8067('0x0'));var moment=require(_0x8067('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x8067('0x2'));var Trigger=require(_0x8067('0x3'));var Dialer=require(_0x8067('0x4'));var Preview=require('./preview');var Fax=require(_0x8067('0x5'));var user=require(_0x8067('0x6'));var voiceQueue=require(_0x8067('0x7'));var voiceQueueReport=require(_0x8067('0x8'));var voiceCallReport=require(_0x8067('0x9'));var trunk=require(_0x8067('0xa'));var trigger=require(_0x8067('0xb'));var template=require(_0x8067('0xc'));var cmHopperHistory=require(_0x8067('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8067('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x8067('0xf'));var salesforce=require(_0x8067('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x8067('0x11'));var desk=require(_0x8067('0x12'));var zoho=require(_0x8067('0x13'));var vtiger=require(_0x8067('0x14'));var freshsales=require(_0x8067('0x15'));var servicenow=require(_0x8067('0x16'));var dynamics365=require(_0x8067('0x17'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x8067('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8067('0x19')]()[_0x8067('0x1a')](user[_0x8067('0x1b')]())[_0x8067('0x1a')](realtime[_0x8067('0x1c')]())[_0x8067('0x1a')](user[_0x8067('0x1d')]())['then'](realtime[_0x8067('0x1e')]())[_0x8067('0x1a')](trunk[_0x8067('0x1f')]())[_0x8067('0x1a')](realtime[_0x8067('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0x8067('0x1a')](realtime[_0x8067('0x21')]())[_0x8067('0x1a')](trigger[_0x8067('0x22')]())[_0x8067('0x1a')](realtime[_0x8067('0x23')]())['then'](template['getTemplates']())['then'](realtime[_0x8067('0x24')]())['then'](zendesk[_0x8067('0x25')]())[_0x8067('0x1a')](realtime[_0x8067('0x26')]())[_0x8067('0x1a')](salesforce[_0x8067('0x27')]())[_0x8067('0x1a')](realtime[_0x8067('0x28')]())[_0x8067('0x1a')](sugarcrm[_0x8067('0x29')]())[_0x8067('0x1a')](realtime[_0x8067('0x2a')]())[_0x8067('0x1a')](freshdesk[_0x8067('0x2b')]())[_0x8067('0x1a')](realtime[_0x8067('0x2c')]())[_0x8067('0x1a')](desk[_0x8067('0x2d')]())[_0x8067('0x1a')](realtime[_0x8067('0x2e')]())['then'](zoho['getZohoAccounts']())[_0x8067('0x1a')](realtime[_0x8067('0x2f')]())['then'](vtiger[_0x8067('0x30')]())[_0x8067('0x1a')](realtime[_0x8067('0x31')]())[_0x8067('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime['initFreshsalesAccounts']())[_0x8067('0x1a')](servicenow['getServicenowAccounts']())[_0x8067('0x1a')](realtime[_0x8067('0x32')]())[_0x8067('0x1a')](dynamics365[_0x8067('0x33')]())[_0x8067('0x1a')](realtime['initDynamics365Accounts']())[_0x8067('0x1a')](campaign['getCampaigns']())[_0x8067('0x1a')](realtime[_0x8067('0x34')]())['then'](voiceExtension[_0x8067('0x35')]())[_0x8067('0x1a')](realtime[_0x8067('0x36')]())[_0x8067('0x1a')](faxAccount[_0x8067('0x37')]())[_0x8067('0x1a')](realtime[_0x8067('0x38')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x8067('0x19')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x8067('0x1a')](realtime[_0x8067('0x39')]())['then'](cmHopperHistory[_0x8067('0x3a')]())[_0x8067('0x1a')](realtime[_0x8067('0x3b')]())[_0x8067('0x1a')](cmHopperHistory[_0x8067('0x3c')]())[_0x8067('0x1a')](realtime[_0x8067('0x3d')]())[_0x8067('0x1a')](voiceCallReport[_0x8067('0x3e')]())['then'](realtime[_0x8067('0x3f')]())['then'](function(_0x42d780){})['catch'](function(_0x51656c){console[_0x8067('0x40')](_0x51656c);});}function main(){return server[_0x8067('0x41')](realtime,preview,fax)['then'](function(_0x4aa20a){return initRealtime();})[_0x8067('0x1a')](function(){return initParams();})[_0x8067('0x1a')](function(){report[_0x8067('0x42')]();setInterval(initRealtime,0x1388);})[_0x8067('0x43')](function(_0x56cb07){console[_0x8067('0x40')](_0x56cb07);});}main(); \ No newline at end of file +var _0x1a41=['./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a41,0x115));var _0x11a4=function(_0x208d39,_0x318d89){_0x208d39=_0x208d39-0x0;var _0x3e4f4b=_0x1a41[_0x208d39];return _0x3e4f4b;};'use strict';var BPromise=require('bluebird');var util=require(_0x11a4('0x0'));var moment=require(_0x11a4('0x1'));var server=require('./server');var Realtime=require(_0x11a4('0x2'));var Report=require(_0x11a4('0x3'));var Acw=require(_0x11a4('0x4'));var Trigger=require(_0x11a4('0x5'));var Dialer=require(_0x11a4('0x6'));var Preview=require(_0x11a4('0x7'));var Fax=require(_0x11a4('0x8'));var user=require(_0x11a4('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x11a4('0xa'));var voiceCallReport=require(_0x11a4('0xb'));var trunk=require(_0x11a4('0xc'));var trigger=require(_0x11a4('0xd'));var template=require(_0x11a4('0xe'));var cmHopperHistory=require(_0x11a4('0xf'));var campaign=require(_0x11a4('0x10'));var voiceExtension=require(_0x11a4('0x11'));var faxAccount=require(_0x11a4('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x11a4('0x13'));var sugarcrm=require(_0x11a4('0x14'));var freshdesk=require(_0x11a4('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x11a4('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x11a4('0x17'));var servicenow=require(_0x11a4('0x18'));var dynamics365=require(_0x11a4('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x11a4('0x1a')](_0x11a4('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x11a4('0x1a')](_0x11a4('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x11a4('0x1c')]()[_0x11a4('0x1d')](user[_0x11a4('0x1e')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x1f')]())['then'](user[_0x11a4('0x20')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x21')]())[_0x11a4('0x1d')](trunk[_0x11a4('0x22')]())['then'](realtime[_0x11a4('0x23')]())['then'](voiceQueue[_0x11a4('0x24')]())['then'](realtime[_0x11a4('0x25')]())['then'](trigger[_0x11a4('0x26')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x27')]())[_0x11a4('0x1d')](template[_0x11a4('0x28')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x29')]())[_0x11a4('0x1d')](zendesk['getZendeskAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x2a')]())[_0x11a4('0x1d')](salesforce[_0x11a4('0x2b')]())['then'](realtime[_0x11a4('0x2c')]())[_0x11a4('0x1d')](sugarcrm[_0x11a4('0x2d')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x2e')]())[_0x11a4('0x1d')](freshdesk[_0x11a4('0x2f')]())['then'](realtime[_0x11a4('0x30')]())[_0x11a4('0x1d')](desk[_0x11a4('0x31')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x32')]())['then'](zoho[_0x11a4('0x33')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x34')]())['then'](vtiger[_0x11a4('0x35')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x36')]())['then'](freshsales['getFreshsalesAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x37')]())['then'](servicenow[_0x11a4('0x38')]())[_0x11a4('0x1d')](realtime['initServicenowAccounts']())[_0x11a4('0x1d')](dynamics365[_0x11a4('0x39')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x3a')]())[_0x11a4('0x1d')](campaign[_0x11a4('0x3b')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x3c')]())[_0x11a4('0x1d')](voiceExtension['getVoiceExtensions']())[_0x11a4('0x1d')](realtime[_0x11a4('0x3d')]())[_0x11a4('0x1d')](faxAccount['getFaxAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x3e')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x11a4('0x1c')]()[_0x11a4('0x1d')](voiceQueueReport[_0x11a4('0x3f')]())[_0x11a4('0x1d')](realtime['initVoiceQueueReports']())[_0x11a4('0x1d')](cmHopperHistory[_0x11a4('0x40')]())[_0x11a4('0x1d')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x11a4('0x41')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x42')]())[_0x11a4('0x1d')](voiceCallReport[_0x11a4('0x43')]())['then'](realtime['initVoiceCallReports']())[_0x11a4('0x1d')](function(_0x463de0){})[_0x11a4('0x44')](function(_0x4dd25){console[_0x11a4('0x45')](_0x4dd25);});}function main(){return server[_0x11a4('0x46')](realtime,preview,fax)[_0x11a4('0x1d')](function(_0x1ece0b){return initRealtime();})[_0x11a4('0x1d')](function(){return initParams();})['then'](function(){report[_0x11a4('0x47')]();setInterval(initRealtime,0x1388);})[_0x11a4('0x44')](function(_0xc340be){console[_0x11a4('0x45')](_0xc340be);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 5f9cfce..636da2c 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x42d6b0,_0xecdb46){var _0x20922d=function(_0x1999b5){while(--_0x1999b5){_0x42d6b0['push'](_0x42d6b0['shift']());}};_0x20922d(++_0xecdb46);}(_0x70e0,0x17b));var _0x070e=function(_0x1a55dc,_0x8bceb){_0x1a55dc=_0x1a55dc-0x0;var _0xe7ca7c=_0x70e0[_0x1a55dc];return _0xe7ca7c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x259cf3,_0xcdf232){var _0x267c74=function(_0x5e8c1d){while(--_0x5e8c1d){_0x259cf3['push'](_0x259cf3['shift']());}};_0x267c74(++_0xcdf232);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c60899b..c0b0db4 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 _0x5b84=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5b84,0xea));var _0x45b8=function(_0xd913ff,_0x21ecaa){_0xd913ff=_0xd913ff-0x0;var _0x56efd8=_0x5b84[_0xd913ff];return _0x56efd8;};'use strict';function Campaign(_0x55f215){this['id']=_0x55f215['id']||0x0;this['name']=_0x55f215[_0x45b8('0x0')]||'';this['type']=_0x55f215['type']||'campaign';this[_0x45b8('0x1')]=0x0;this[_0x45b8('0x2')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x45b8('0x3')]=0x0;this[_0x45b8('0x4')]='';this[_0x45b8('0x5')]=!![];this[_0x45b8('0x6')]=_0x55f215[_0x45b8('0x6')];this[_0x45b8('0x7')]=_0x55f215[_0x45b8('0x7')];this[_0x45b8('0x8')]=_0x55f215[_0x45b8('0x8')]||null;this[_0x45b8('0x9')]=_0x55f215['dialGlobalInterval']?_0x55f215[_0x45b8('0x9')]:null;this[_0x45b8('0xa')]=_0x55f215[_0x45b8('0xa')];this['dialOriginateCallerIdNumber']=_0x55f215[_0x45b8('0xb')];this[_0x45b8('0xc')]=_0x55f215[_0x45b8('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x55f215[_0x45b8('0xd')];this['dialCongestionRetryFrequency']=_0x55f215[_0x45b8('0xe')];this[_0x45b8('0xf')]=_0x55f215[_0x45b8('0xf')];this[_0x45b8('0x10')]=_0x55f215[_0x45b8('0x10')];this[_0x45b8('0x11')]=_0x55f215['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x55f215[_0x45b8('0x12')];this[_0x45b8('0x13')]=_0x55f215[_0x45b8('0x13')];this[_0x45b8('0x14')]=_0x55f215[_0x45b8('0x14')]||0x3;this[_0x45b8('0x15')]=_0x55f215[_0x45b8('0x15')]||0x96;this[_0x45b8('0x16')]=_0x55f215['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x55f215[_0x45b8('0x17')]||0x96;this[_0x45b8('0x18')]=_0x55f215[_0x45b8('0x18')]||0x3;this[_0x45b8('0x19')]=_0x55f215['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x55f215[_0x45b8('0x1a')]||0x3;this[_0x45b8('0x1b')]=_0x55f215[_0x45b8('0x1b')]||0x96;this[_0x45b8('0x1c')]=_0x55f215[_0x45b8('0x1c')]||0x3;this[_0x45b8('0x1d')]=_0x55f215[_0x45b8('0x1d')]||0x96;this[_0x45b8('0x1e')]=_0x55f215[_0x45b8('0x1e')]||_0x45b8('0x1f');this[_0x45b8('0x20')]=_0x55f215['dialPrefix']||undefined;this[_0x45b8('0x21')]=_0x55f215[_0x45b8('0x21')]||undefined;this[_0x45b8('0x22')]=_0x55f215[_0x45b8('0x22')]||undefined;this[_0x45b8('0x23')]=_0x55f215[_0x45b8('0x23')]?_0x55f215[_0x45b8('0x23')]:undefined;this['Trunk']=_0x55f215[_0x45b8('0x24')]?_0x55f215['Trunk']:undefined;this['Interval']=_0x55f215[_0x45b8('0x25')]?_0x55f215[_0x45b8('0x25')]:undefined;this[_0x45b8('0x26')]=_0x55f215[_0x45b8('0x26')]?_0x55f215[_0x45b8('0x26')]:undefined;this[_0x45b8('0x27')]=_0x55f215[_0x45b8('0x26')]?_0x55f215[_0x45b8('0x26')][_0x45b8('0x0')]:undefined;this[_0x45b8('0x28')]=_0x55f215[_0x45b8('0x28')]||![];this['dialAMDInitialSilence']=_0x55f215[_0x45b8('0x29')];this['dialAMDGreeting']=_0x55f215[_0x45b8('0x2a')];this[_0x45b8('0x2b')]=_0x55f215[_0x45b8('0x2b')];this[_0x45b8('0x2c')]=_0x55f215[_0x45b8('0x2c')];this[_0x45b8('0x2d')]=_0x55f215[_0x45b8('0x2d')];this[_0x45b8('0x2e')]=_0x55f215[_0x45b8('0x2e')];this[_0x45b8('0x2f')]=_0x55f215['dialAMDMaximumNumberOfWords'];this[_0x45b8('0x30')]=_0x55f215[_0x45b8('0x30')];this[_0x45b8('0x31')]=_0x55f215['dialAMDMaximumWordLength'];}module[_0x45b8('0x32')]=Campaign; \ No newline at end of file +var _0xe1dc=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x18882b,_0x25d1c0){var _0x4ef0fc=function(_0x252b01){while(--_0x252b01){_0x18882b['push'](_0x18882b['shift']());}};_0x4ef0fc(++_0x25d1c0);}(_0xe1dc,0x12d));var _0xce1d=function(_0xee94a1,_0x32bfab){_0xee94a1=_0xee94a1-0x0;var _0x510b45=_0xe1dc[_0xee94a1];return _0x510b45;};'use strict';function Campaign(_0x3c431e){this['id']=_0x3c431e['id']||0x0;this[_0xce1d('0x0')]=_0x3c431e['name']||'';this[_0xce1d('0x1')]=_0x3c431e[_0xce1d('0x1')]||'campaign';this[_0xce1d('0x2')]=0x0;this[_0xce1d('0x3')]=0x0;this[_0xce1d('0x4')]=0x0;this[_0xce1d('0x5')]=0x0;this[_0xce1d('0x6')]='';this[_0xce1d('0x7')]=!![];this[_0xce1d('0x8')]=_0x3c431e[_0xce1d('0x8')];this['limitCalls']=_0x3c431e['limitCalls'];this['dialTimezone']=_0x3c431e[_0xce1d('0x9')]||null;this[_0xce1d('0xa')]=_0x3c431e[_0xce1d('0xa')]?_0x3c431e['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x3c431e['dialOriginateCallerIdName'];this[_0xce1d('0xb')]=_0x3c431e['dialOriginateCallerIdNumber'];this[_0xce1d('0xc')]=_0x3c431e[_0xce1d('0xc')]||0x1e;this[_0xce1d('0xd')]=_0x3c431e[_0xce1d('0xd')];this[_0xce1d('0xe')]=_0x3c431e['dialCongestionRetryFrequency'];this[_0xce1d('0xf')]=_0x3c431e[_0xce1d('0xf')];this[_0xce1d('0x10')]=_0x3c431e[_0xce1d('0x10')];this[_0xce1d('0x11')]=_0x3c431e[_0xce1d('0x11')];this['dialNoAnswerRetryFrequency']=_0x3c431e['dialNoAnswerRetryFrequency'];this[_0xce1d('0x12')]=_0x3c431e[_0xce1d('0x12')];this[_0xce1d('0x13')]=_0x3c431e['dialNoSuchNumberMaxRetry']||0x3;this[_0xce1d('0x14')]=_0x3c431e[_0xce1d('0x14')]||0x96;this[_0xce1d('0x15')]=_0x3c431e[_0xce1d('0x15')]||0x3;this['dialDropRetryFrequency']=_0x3c431e[_0xce1d('0x16')]||0x96;this[_0xce1d('0x17')]=_0x3c431e['dialAbandonedMaxRetry']||0x3;this[_0xce1d('0x18')]=_0x3c431e[_0xce1d('0x18')]||0x96;this[_0xce1d('0x19')]=_0x3c431e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x3c431e['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x3c431e[_0xce1d('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3c431e[_0xce1d('0x1b')]||0x96;this[_0xce1d('0x1c')]=_0x3c431e['dialOrderByScheduledAt']||_0xce1d('0x1d');this[_0xce1d('0x1e')]=_0x3c431e[_0xce1d('0x1e')]||undefined;this[_0xce1d('0x1f')]=_0x3c431e[_0xce1d('0x1f')]||undefined;this['dialCutDigit']=_0x3c431e[_0xce1d('0x20')]||undefined;this[_0xce1d('0x21')]=_0x3c431e[_0xce1d('0x21')]?_0x3c431e['TrunkBackup']:undefined;this[_0xce1d('0x22')]=_0x3c431e['Trunk']?_0x3c431e[_0xce1d('0x22')]:undefined;this[_0xce1d('0x23')]=_0x3c431e[_0xce1d('0x23')]?_0x3c431e[_0xce1d('0x23')]:undefined;this[_0xce1d('0x24')]=_0x3c431e[_0xce1d('0x24')]?_0x3c431e['SquareProject']:undefined;this[_0xce1d('0x25')]=_0x3c431e[_0xce1d('0x24')]?_0x3c431e['SquareProject']['name']:undefined;this['dialAMDActive']=_0x3c431e[_0xce1d('0x26')]||![];this[_0xce1d('0x27')]=_0x3c431e[_0xce1d('0x27')];this[_0xce1d('0x28')]=_0x3c431e[_0xce1d('0x28')];this[_0xce1d('0x29')]=_0x3c431e[_0xce1d('0x29')];this[_0xce1d('0x2a')]=_0x3c431e['dialAMDTotalAnalysisTime'];this[_0xce1d('0x2b')]=_0x3c431e[_0xce1d('0x2b')];this[_0xce1d('0x2c')]=_0x3c431e[_0xce1d('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x3c431e[_0xce1d('0x2d')];this[_0xce1d('0x2e')]=_0x3c431e[_0xce1d('0x2e')];this['dialAMDMaximumWordLength']=_0x3c431e['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 23fb48a..8bb30c1 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 _0x419f=['calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum'];(function(_0x34c3dd,_0x4d36ac){var _0x2d914c=function(_0x367644){while(--_0x367644){_0x34c3dd['push'](_0x34c3dd['shift']());}};_0x2d914c(++_0x4d36ac);}(_0x419f,0x176));var _0xf419=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x419f[_0x53ccf2];return _0x5a2964;};'use strict';function Channel(){this[_0xf419('0x0')]=null;this[_0xf419('0x1')]='';this[_0xf419('0x2')]='';this[_0xf419('0x3')]=0x0;this[_0xf419('0x4')]='';this[_0xf419('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xf419('0x6')]=0x0;this['context']='';this[_0xf419('0x7')]=0x0;this[_0xf419('0x8')]=0x0;this[_0xf419('0x9')]=0x0;this[_0xf419('0xa')]=![];this[_0xf419('0xb')]=null;this[_0xf419('0xc')]=null;this[_0xf419('0xd')]=![];this[_0xf419('0xe')]=![];this[_0xf419('0xf')]='';this['lastdata']='';this[_0xf419('0x10')]=0x0;this[_0xf419('0x11')]=0x0;this['holdtime']=0x0;this[_0xf419('0x12')]=null;this[_0xf419('0x13')]=null;this[_0xf419('0x14')]=null;this['monitor']=![];this[_0xf419('0x15')]=null;this[_0xf419('0x16')]=null;this[_0xf419('0x17')]=[];this[_0xf419('0x18')]=undefined;this[_0xf419('0x19')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xf419('0x1a')]=Channel; \ No newline at end of file +var _0xa5c9=['holdtime','type','tag','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','exten','answered','answertime','endtime','abandoned','lastdata','duration'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xa5c9,0x143));var _0x9a5c=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xa5c9[_0x4de1b1];return _0x639f27;};'use strict';function Channel(){this[_0x9a5c('0x0')]=null;this[_0x9a5c('0x1')]='';this[_0x9a5c('0x2')]='';this[_0x9a5c('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x9a5c('0x4')]=undefined;this[_0x9a5c('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x9a5c('0x6')]=0x0;this[_0x9a5c('0x7')]=![];this[_0x9a5c('0x8')]=null;this[_0x9a5c('0x9')]=null;this['unmanaged']=![];this[_0x9a5c('0xa')]=![];this['lastapplication']='';this[_0x9a5c('0xb')]='';this[_0x9a5c('0xc')]=0x0;this['billableseconds']=0x0;this[_0x9a5c('0xd')]=0x0;this[_0x9a5c('0xe')]=null;this[_0x9a5c('0xf')]=null;this['disposition']=null;this['monitor']=![];this[_0x9a5c('0x10')]=null;this[_0x9a5c('0x11')]=null;this[_0x9a5c('0x12')]=[];this[_0x9a5c('0x13')]=undefined;this[_0x9a5c('0x14')]=undefined;this[_0x9a5c('0x15')]=undefined;this[_0x9a5c('0x16')]=0x0;}module[_0x9a5c('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6d64fdb..7b3072a 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 _0x93f8=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x36d15,_0x55fafe){var _0x3c86c4=function(_0x26c27f){while(--_0x26c27f){_0x36d15['push'](_0x36d15['shift']());}};_0x3c86c4(++_0x55fafe);}(_0x93f8,0x121));var _0x893f=function(_0x33c736,_0xf7fcc5){_0x33c736=_0x33c736-0x0;var _0x312647=_0x93f8[_0x33c736];return _0x312647;};'use strict';function DeskAccount(_0x166dbd){this['id']=_0x166dbd['id']||0x0;this['name']=_0x166dbd[_0x893f('0x0')]||'';this[_0x893f('0x1')]=_0x166dbd['username']||'';this[_0x893f('0x2')]=_0x166dbd[_0x893f('0x2')]||'';this[_0x893f('0x3')]=_0x166dbd[_0x893f('0x3')]||'';this[_0x893f('0x4')]=_0x166dbd[_0x893f('0x4')]||'';this[_0x893f('0x5')]=_0x166dbd[_0x893f('0x5')]||'';this[_0x893f('0x6')]=_0x166dbd[_0x893f('0x6')]||'';this[_0x893f('0x7')]=_0x166dbd[_0x893f('0x7')]||'';this[_0x893f('0x8')]=_0x166dbd[_0x893f('0x8')]||'';this['type']=_0x166dbd[_0x893f('0x9')]||'';this[_0x893f('0xa')]=_0x166dbd[_0x893f('0xa')]||'';this['Configurations']=_0x166dbd[_0x893f('0xb')]||{};}module[_0x893f('0xc')]=DeskAccount; \ No newline at end of file +var _0x6ef9=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x3f2357,_0x7203b4){var _0x567eb1=function(_0x4f53f7){while(--_0x4f53f7){_0x3f2357['push'](_0x3f2357['shift']());}};_0x567eb1(++_0x7203b4);}(_0x6ef9,0x171));var _0x96ef=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x6ef9[_0x57b432];return _0x2edf2a;};'use strict';function DeskAccount(_0x13ede1){this['id']=_0x13ede1['id']||0x0;this[_0x96ef('0x0')]=_0x13ede1[_0x96ef('0x0')]||'';this[_0x96ef('0x1')]=_0x13ede1[_0x96ef('0x1')]||'';this[_0x96ef('0x2')]=_0x13ede1['remoteUri']||'';this['authType']=_0x13ede1[_0x96ef('0x3')]||'';this[_0x96ef('0x4')]=_0x13ede1[_0x96ef('0x4')]||'';this['consumerKey']=_0x13ede1[_0x96ef('0x5')]||'';this[_0x96ef('0x6')]=_0x13ede1[_0x96ef('0x6')]||'';this[_0x96ef('0x7')]=_0x13ede1['token']||'';this[_0x96ef('0x8')]=_0x13ede1['tokenSecret']||'';this[_0x96ef('0x9')]=_0x13ede1['type']||'';this['serverUrl']=_0x13ede1[_0x96ef('0xa')]||'';this[_0x96ef('0xb')]=_0x13ede1[_0x96ef('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 3add82d..abe2559 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 _0x4483=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x4a4b4a,_0x42c47b){var _0xf71680=function(_0x13c3f2){while(--_0x13c3f2){_0x4a4b4a['push'](_0x4a4b4a['shift']());}};_0xf71680(++_0x42c47b);}(_0x4483,0x1a3));var _0x3448=function(_0x4cf769,_0x4873c6){_0x4cf769=_0x4cf769-0x0;var _0x1375f0=_0x4483[_0x4cf769];return _0x1375f0;};'use strict';function Dynamics365Account(_0x43f30d){this['id']=_0x43f30d['id']||0x0;this[_0x3448('0x0')]=_0x43f30d[_0x3448('0x0')]||'';this['username']=_0x43f30d[_0x3448('0x1')]||'';this[_0x3448('0x2')]=_0x43f30d[_0x3448('0x2')]||'';this[_0x3448('0x3')]=_0x43f30d[_0x3448('0x3')]||'';this['tenantId']=_0x43f30d[_0x3448('0x4')]||'';this[_0x3448('0x5')]=_0x43f30d[_0x3448('0x5')]||'';this[_0x3448('0x6')]=_0x43f30d[_0x3448('0x6')]||{};this[_0x3448('0x7')]=_0x43f30d[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x43f30d['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x1d2195,_0x4b8096){var _0x4962cd=function(_0x301f5a){while(--_0x301f5a){_0x1d2195['push'](_0x1d2195['shift']());}};_0x4962cd(++_0x4b8096);}(_0xee5b,0x1f4));var _0xbee5=function(_0xece08d,_0x435b79){_0xece08d=_0xece08d-0x0;var _0x1e15b8=_0xee5b[_0xece08d];return _0x1e15b8;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index a768200..53794c0 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 _0xb723=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description'];(function(_0x1a41a0,_0x3b8ad5){var _0x1ddc40=function(_0xc8899e){while(--_0xc8899e){_0x1a41a0['push'](_0x1a41a0['shift']());}};_0x1ddc40(++_0x3b8ad5);}(_0xb723,0xb9));var _0x3b72=function(_0x23a49a,_0x45fd99){_0x23a49a=_0x23a49a-0x0;var _0x2e0cb8=_0xb723[_0x23a49a];return _0x2e0cb8;};'use strict';function FaxAccount(_0x33a7a5){this['id']=_0x33a7a5['id']||0x0;this['name']=_0x33a7a5[_0x3b72('0x0')]||'';this[_0x3b72('0x1')]=_0x33a7a5[_0x3b72('0x1')];this[_0x3b72('0x2')]=_0x33a7a5['ecm'];this[_0x3b72('0x3')]=_0x33a7a5[_0x3b72('0x3')];this[_0x3b72('0x4')]=_0x33a7a5[_0x3b72('0x4')];this[_0x3b72('0x5')]=_0x33a7a5['minrate']||0x960;this[_0x3b72('0x6')]=_0x33a7a5[_0x3b72('0x6')]||0x3840;this[_0x3b72('0x7')]=_0x33a7a5[_0x3b72('0x7')]||_0x3b72('0x8');this[_0x3b72('0x9')]=_0x33a7a5[_0x3b72('0x9')]||'no';this[_0x3b72('0xa')]=_0x33a7a5[_0x3b72('0xa')]||'no';this[_0x3b72('0xb')]=_0x33a7a5[_0x3b72('0xb')]||0x1388;this['tech']=_0x33a7a5[_0x3b72('0xc')]||'SIP';this[_0x3b72('0xd')]=_0x33a7a5[_0x3b72('0xd')]?_0x33a7a5[_0x3b72('0xd')]:undefined;this[_0x3b72('0xe')]=_0x33a7a5[_0x3b72('0xe')];this[_0x3b72('0xf')]=_0x33a7a5[_0x3b72('0xf')];}module[_0x3b72('0x10')]=FaxAccount; \ No newline at end of file +var _0xae16=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x8e276f,_0x356cc2){var _0x2da08d=function(_0x3f69fd){while(--_0x3f69fd){_0x8e276f['push'](_0x8e276f['shift']());}};_0x2da08d(++_0x356cc2);}(_0xae16,0x1ac));var _0x6ae1=function(_0x12a614,_0x3f8b65){_0x12a614=_0x12a614-0x0;var _0x23b9a1=_0xae16[_0x12a614];return _0x23b9a1;};'use strict';function FaxAccount(_0x7936c6){this['id']=_0x7936c6['id']||0x0;this[_0x6ae1('0x0')]=_0x7936c6['name']||'';this[_0x6ae1('0x1')]=_0x7936c6[_0x6ae1('0x1')];this[_0x6ae1('0x2')]=_0x7936c6['ecm'];this['headerinfo']=_0x7936c6[_0x6ae1('0x3')];this[_0x6ae1('0x4')]=_0x7936c6[_0x6ae1('0x4')];this[_0x6ae1('0x5')]=_0x7936c6[_0x6ae1('0x5')]||0x960;this[_0x6ae1('0x6')]=_0x7936c6[_0x6ae1('0x6')]||0x3840;this['modem']=_0x7936c6[_0x6ae1('0x7')]||'v17,v27,v29';this[_0x6ae1('0x8')]=_0x7936c6[_0x6ae1('0x8')]||'no';this[_0x6ae1('0x9')]=_0x7936c6[_0x6ae1('0x9')]||'no';this['t38timeout']=_0x7936c6[_0x6ae1('0xa')]||0x1388;this[_0x6ae1('0xb')]=_0x7936c6['tech']||'SIP';this['Trunk']=_0x7936c6[_0x6ae1('0xc')]?_0x7936c6[_0x6ae1('0xc')]:undefined;this[_0x6ae1('0xd')]=_0x7936c6[_0x6ae1('0xd')];this[_0x6ae1('0xe')]=_0x7936c6[_0x6ae1('0xe')];}module[_0x6ae1('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 5d41b17..7111645 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 _0x9bcb=['Configurations','exports','name','username','apiKey','token','serverUrl'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9bcb,0x160));var _0xb9bc=function(_0x27f959,_0x2812ec){_0x27f959=_0x27f959-0x0;var _0x5e89a5=_0x9bcb[_0x27f959];return _0x5e89a5;};'use strict';function FreshdeskAccount(_0x127abd){this['id']=_0x127abd['id']||0x0;this[_0xb9bc('0x0')]=_0x127abd['name']||'';this[_0xb9bc('0x1')]=_0x127abd['username']||'';this[_0xb9bc('0x2')]=_0x127abd[_0xb9bc('0x3')]||'';this['remoteUri']=_0x127abd['remoteUri']||'';this['serverUrl']=_0x127abd[_0xb9bc('0x4')]||'';this['Configurations']=_0x127abd[_0xb9bc('0x5')]||{};}module[_0xb9bc('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xb340=['exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0x5cfcee,_0x392025){var _0x54163f=function(_0x1955a5){while(--_0x1955a5){_0x5cfcee['push'](_0x5cfcee['shift']());}};_0x54163f(++_0x392025);}(_0xb340,0x15d));var _0x0b34=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb340[_0x465028];return _0xb783d4;};'use strict';function FreshdeskAccount(_0x5ed574){this['id']=_0x5ed574['id']||0x0;this[_0x0b34('0x0')]=_0x5ed574[_0x0b34('0x0')]||'';this[_0x0b34('0x1')]=_0x5ed574[_0x0b34('0x1')]||'';this[_0x0b34('0x2')]=_0x5ed574['token']||'';this[_0x0b34('0x3')]=_0x5ed574[_0x0b34('0x3')]||'';this[_0x0b34('0x4')]=_0x5ed574['serverUrl']||'';this['Configurations']=_0x5ed574['Configurations']||{};}module[_0x0b34('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 0537504..6f29b3f 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 _0x3148=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x1da5d8,_0x173f77){var _0x10b03e=function(_0x277ef0){while(--_0x277ef0){_0x1da5d8['push'](_0x1da5d8['shift']());}};_0x10b03e(++_0x173f77);}(_0x3148,0x1d3));var _0x8314=function(_0x3e3936,_0x24c3a6){_0x3e3936=_0x3e3936-0x0;var _0x10be4e=_0x3148[_0x3e3936];return _0x10be4e;};'use strict';function FreshsalesAccount(_0x414720){this['id']=_0x414720['id']||0x0;this[_0x8314('0x0')]=_0x414720['name']||'';this[_0x8314('0x1')]=_0x414720[_0x8314('0x1')]||'';this[_0x8314('0x2')]=_0x414720[_0x8314('0x3')]||'';this['remoteUri']=_0x414720[_0x8314('0x4')]||'';this[_0x8314('0x5')]=_0x414720[_0x8314('0x5')]||'';this[_0x8314('0x6')]=_0x414720[_0x8314('0x6')]||{};}module[_0x8314('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xe9e8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x190b90,_0x4a0059){var _0x462d37=function(_0x5b3a0a){while(--_0x5b3a0a){_0x190b90['push'](_0x190b90['shift']());}};_0x462d37(++_0x4a0059);}(_0xe9e8,0x179));var _0x8e9e=function(_0x1be737,_0x1eb845){_0x1be737=_0x1be737-0x0;var _0x5a661b=_0xe9e8[_0x1be737];return _0x5a661b;};'use strict';function FreshsalesAccount(_0x298ee0){this['id']=_0x298ee0['id']||0x0;this[_0x8e9e('0x0')]=_0x298ee0[_0x8e9e('0x0')]||'';this[_0x8e9e('0x1')]=_0x298ee0[_0x8e9e('0x1')]||'';this[_0x8e9e('0x2')]=_0x298ee0[_0x8e9e('0x3')]||'';this['remoteUri']=_0x298ee0[_0x8e9e('0x4')]||'';this['serverUrl']=_0x298ee0[_0x8e9e('0x5')]||'';this[_0x8e9e('0x6')]=_0x298ee0[_0x8e9e('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 24f722a..31b17ff 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 _0xb1bf=['inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports'];(function(_0x189130,_0x267f06){var _0x3e3c11=function(_0x23d1bf){while(--_0x23d1bf){_0x189130['push'](_0x189130['shift']());}};_0x3e3c11(++_0x267f06);}(_0xb1bf,0xc0));var _0xfb1b=function(_0x10a1b1,_0x3ed63c){_0x10a1b1=_0x10a1b1-0x0;var _0x389691=_0xb1bf[_0x10a1b1];return _0x389691;};'use strict';function QueueReport(){this['type']=_0xfb1b('0x0');this[_0xfb1b('0x1')]='';this[_0xfb1b('0x2')]='';this['calleridname']='';this[_0xfb1b('0x3')]='';this['queuecallerjoinAt']=null;this[_0xfb1b('0x4')]=null;this[_0xfb1b('0x5')]=0x1;this['count']=0x1;this[_0xfb1b('0x6')]=![];this[_0xfb1b('0x7')]=null;this[_0xfb1b('0x8')]=![];this[_0xfb1b('0x9')]=null;this['queuecallerexit']=![];this[_0xfb1b('0xa')]=null;this[_0xfb1b('0xb')]=0x1;this[_0xfb1b('0xc')]='';this[_0xfb1b('0xd')]='';this['connectedlinename']='';this[_0xfb1b('0xe')]='';this[_0xfb1b('0xf')]='';this['exten']='';this[_0xfb1b('0x10')]='';this[_0xfb1b('0x11')]=0x0;this[_0xfb1b('0x12')]=![];this[_0xfb1b('0x13')]='';this['motionChannel']=_0xfb1b('0x14');this[_0xfb1b('0x15')]=0x0;this[_0xfb1b('0x16')]={};}module[_0xfb1b('0x17')]=QueueReport; \ No newline at end of file +var _0xfdc8=['exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x17068e,_0x115480){var _0xa24249=function(_0x49bcac){while(--_0x49bcac){_0x17068e['push'](_0x17068e['shift']());}};_0xa24249(++_0x115480);}(_0xfdc8,0x13e));var _0x8fdc=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xfdc8[_0x171fdc];return _0x3782ea;};'use strict';function QueueReport(){this[_0x8fdc('0x0')]=_0x8fdc('0x1');this[_0x8fdc('0x2')]='';this[_0x8fdc('0x3')]='';this[_0x8fdc('0x4')]='';this['queue']='';this[_0x8fdc('0x5')]=null;this[_0x8fdc('0x6')]=null;this[_0x8fdc('0x7')]=0x1;this[_0x8fdc('0x8')]=0x1;this[_0x8fdc('0x9')]=![];this[_0x8fdc('0xa')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x8fdc('0xb')]=![];this[_0x8fdc('0xc')]=null;this['originalposition']=0x1;this[_0x8fdc('0xd')]='';this[_0x8fdc('0xe')]='';this[_0x8fdc('0xf')]='';this[_0x8fdc('0x10')]='';this[_0x8fdc('0x11')]='';this[_0x8fdc('0x12')]='';this[_0x8fdc('0x13')]='';this[_0x8fdc('0x14')]=0x0;this[_0x8fdc('0x15')]=![];this[_0x8fdc('0x16')]='';this[_0x8fdc('0x17')]=_0x8fdc('0x18');this[_0x8fdc('0x19')]=0x0;this[_0x8fdc('0x1a')]={};}module[_0x8fdc('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index e8762e4..c405d2f 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 _0x069e=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x069e,0x108));var _0xe069=function(_0x3bc44d,_0x47f40a){_0x3bc44d=_0x3bc44d-0x0;var _0x5e9b5b=_0x069e[_0x3bc44d];return _0x5e9b5b;};'use strict';function SalesforceAccount(_0x265b43){this['id']=_0x265b43['id']||0x0;this[_0xe069('0x0')]=_0x265b43['name']||'';this[_0xe069('0x1')]=_0x265b43[_0xe069('0x1')]||'';this[_0xe069('0x2')]=_0x265b43[_0xe069('0x2')]||'';this[_0xe069('0x3')]=_0x265b43[_0xe069('0x3')]||'';this[_0xe069('0x4')]=_0x265b43[_0xe069('0x4')]||'';this[_0xe069('0x5')]=_0x265b43[_0xe069('0x5')]||'';this['securityToken']=_0x265b43[_0xe069('0x6')]||'';this[_0xe069('0x7')]=_0x265b43['type']||'integrationTab';this[_0xe069('0x8')]=_0x265b43['serverUrl']||'';this[_0xe069('0x9')]=_0x265b43[_0xe069('0x9')]||{};}module[_0xe069('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x69d4=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x64a57c,_0x4179f0){var _0x33e84e=function(_0x242c49){while(--_0x242c49){_0x64a57c['push'](_0x64a57c['shift']());}};_0x33e84e(++_0x4179f0);}(_0x69d4,0x83));var _0x469d=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x69d4[_0x49b207];return _0x2dc8fa;};'use strict';function SalesforceAccount(_0x59afa3){this['id']=_0x59afa3['id']||0x0;this[_0x469d('0x0')]=_0x59afa3['name']||'';this[_0x469d('0x1')]=_0x59afa3[_0x469d('0x1')]||'';this[_0x469d('0x2')]=_0x59afa3['remoteUri']||'';this[_0x469d('0x3')]=_0x59afa3['password']||'';this[_0x469d('0x4')]=_0x59afa3[_0x469d('0x4')]||'';this[_0x469d('0x5')]=_0x59afa3[_0x469d('0x5')]||'';this[_0x469d('0x6')]=_0x59afa3[_0x469d('0x6')]||'';this['type']=_0x59afa3[_0x469d('0x7')]||'integrationTab';this[_0x469d('0x8')]=_0x59afa3[_0x469d('0x8')]||'';this[_0x469d('0x9')]=_0x59afa3['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a718d44..97495a1 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 _0x5277=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x53c009,_0x5ae527){var _0x2fafdb=function(_0x29d90b){while(--_0x29d90b){_0x53c009['push'](_0x53c009['shift']());}};_0x2fafdb(++_0x5ae527);}(_0x5277,0xbe));var _0x7527=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5277[_0x321bb2];return _0x9c12ed;};'use strict';function ServicenowAccount(_0x5ebcb2){this['id']=_0x5ebcb2['id']||0x0;this[_0x7527('0x0')]=_0x5ebcb2[_0x7527('0x0')]||'';this['username']=_0x5ebcb2[_0x7527('0x1')]||'';this['password']=_0x5ebcb2['password']||'';this['remoteUri']=_0x5ebcb2[_0x7527('0x2')]||'';this[_0x7527('0x3')]=_0x5ebcb2['serverUrl']||'';this[_0x7527('0x4')]=_0x5ebcb2[_0x7527('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x2152=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1d4eed,_0x4922b2){var _0x10911b=function(_0x5422ab){while(--_0x5422ab){_0x1d4eed['push'](_0x1d4eed['shift']());}};_0x10911b(++_0x4922b2);}(_0x2152,0x90));var _0x2215=function(_0xe23dc9,_0x55b7e7){_0xe23dc9=_0xe23dc9-0x0;var _0x2fd74d=_0x2152[_0xe23dc9];return _0x2fd74d;};'use strict';function ServicenowAccount(_0x106f25){this['id']=_0x106f25['id']||0x0;this[_0x2215('0x0')]=_0x106f25['name']||'';this[_0x2215('0x1')]=_0x106f25[_0x2215('0x1')]||'';this['password']=_0x106f25[_0x2215('0x2')]||'';this[_0x2215('0x3')]=_0x106f25[_0x2215('0x3')]||'';this[_0x2215('0x4')]=_0x106f25[_0x2215('0x4')]||'';this[_0x2215('0x5')]=_0x106f25['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index b4bbbab..e1f81be 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 _0xcb24=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x46b4aa,_0x303110){var _0x192019=function(_0x46621b){while(--_0x46621b){_0x46b4aa['push'](_0x46b4aa['shift']());}};_0x192019(++_0x303110);}(_0xcb24,0x81));var _0x4cb2=function(_0x100d3e,_0x24a292){_0x100d3e=_0x100d3e-0x0;var _0x18af67=_0xcb24[_0x100d3e];return _0x18af67;};'use strict';function SugarcrmAccount(_0x3dcac5){this['id']=_0x3dcac5['id']||0x0;this[_0x4cb2('0x0')]=_0x3dcac5[_0x4cb2('0x0')]||'';this[_0x4cb2('0x1')]=_0x3dcac5[_0x4cb2('0x1')]||'';this[_0x4cb2('0x2')]=_0x3dcac5[_0x4cb2('0x2')]||'';this[_0x4cb2('0x3')]=_0x3dcac5['remoteUri']||'';this[_0x4cb2('0x4')]=_0x3dcac5[_0x4cb2('0x4')]||'';this[_0x4cb2('0x5')]=_0x3dcac5[_0x4cb2('0x5')]||{};}module[_0x4cb2('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x4bfa=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4bfa,0x172));var _0xa4bf=function(_0x221332,_0x5c0307){_0x221332=_0x221332-0x0;var _0x281621=_0x4bfa[_0x221332];return _0x281621;};'use strict';function SugarcrmAccount(_0x5f19a7){this['id']=_0x5f19a7['id']||0x0;this[_0xa4bf('0x0')]=_0x5f19a7[_0xa4bf('0x0')]||'';this[_0xa4bf('0x1')]=_0x5f19a7[_0xa4bf('0x1')]||'';this['password']=_0x5f19a7[_0xa4bf('0x2')]||'';this[_0xa4bf('0x3')]=_0x5f19a7['remoteUri']||'';this['serverUrl']=_0x5f19a7[_0xa4bf('0x4')]||'';this['Configurations']=_0x5f19a7[_0xa4bf('0x5')]||{};}module[_0xa4bf('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 11770d9..22a826c 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 _0x2831=['exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2831,0x189));var _0x1283=function(_0x4c8779,_0x399ca4){_0x4c8779=_0x4c8779-0x0;var _0x55a207=_0x2831[_0x4c8779];return _0x55a207;};'use strict';function Telephone(_0x2d9568){this['id']=_0x2d9568['id']||0x0;this[_0x1283('0x0')]=_0x2d9568[_0x1283('0x0')]||'';this['accountcode']=_0x2d9568[_0x1283('0x1')]||'';this[_0x1283('0x2')]=_0x1283('0x3');this[_0x1283('0x4')]=0x0;this[_0x1283('0x5')]=_0x1283('0x3');this['address']='';}module[_0x1283('0x6')]=Telephone; \ No newline at end of file +var _0x2724=['name','accountcode','state','stateTime','status','unknown','address','exports'];(function(_0x1f5027,_0x523274){var _0xb775c0=function(_0x2ee038){while(--_0x2ee038){_0x1f5027['push'](_0x1f5027['shift']());}};_0xb775c0(++_0x523274);}(_0x2724,0xa8));var _0x4272=function(_0x56c7c2,_0x2a9c04){_0x56c7c2=_0x56c7c2-0x0;var _0x378358=_0x2724[_0x56c7c2];return _0x378358;};'use strict';function Telephone(_0x3ddafe){this['id']=_0x3ddafe['id']||0x0;this[_0x4272('0x0')]=_0x3ddafe['name']||'';this[_0x4272('0x1')]=_0x3ddafe['accountcode']||'';this[_0x4272('0x2')]='unknown';this[_0x4272('0x3')]=0x0;this[_0x4272('0x4')]=_0x4272('0x5');this[_0x4272('0x6')]='';}module[_0x4272('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 52038d4..b11b2c1 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(_0x54f536,_0x23a8b5){var _0x35cb75=function(_0x151602){while(--_0x151602){_0x54f536['push'](_0x54f536['shift']());}};_0x35cb75(++_0x23a8b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x163142,_0x4d1a1c){var _0x3017e7=function(_0x2697db){while(--_0x2697db){_0x163142['push'](_0x163142['shift']());}};_0x3017e7(++_0x4d1a1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 74b6b43..a253720 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x1328fd,_0x485d44){var _0x223e4a=function(_0x41522e){while(--_0x41522e){_0x1328fd['push'](_0x1328fd['shift']());}};_0x223e4a(++_0x485d44);}(_0xb10b,0x12a));var _0xbb10=function(_0x132b71,_0x25f23e){_0x132b71=_0x132b71-0x0;var _0x224664=_0xb10b[_0x132b71];return _0x224664;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x32fed9,_0x5b94c7){var _0x11cd7f=function(_0x2b2654){while(--_0x2b2654){_0x32fed9['push'](_0x32fed9['shift']());}};_0x11cd7f(++_0x5b94c7);}(_0x4fc2,0x111));var _0x24fc=function(_0x443547,_0x21d7a8){_0x443547=_0x443547-0x0;var _0x1423a8=_0x4fc2[_0x443547];return _0x1423a8;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2dfa389..31fd3c6 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 _0xbf70=['host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0x294cbd,_0x547060){var _0x155fa1=function(_0x5e40b8){while(--_0x5e40b8){_0x294cbd['push'](_0x294cbd['shift']());}};_0x155fa1(++_0x547060);}(_0xbf70,0x1cb));var _0x0bf7=function(_0x535015,_0x139277){_0x535015=_0x535015-0x0;var _0x216277=_0xbf70[_0x535015];return _0x216277;};'use strict';function Trunk(_0x4ddf19){this['id']=_0x4ddf19['id']||0x0;this[_0x0bf7('0x0')]=_0x4ddf19[_0x0bf7('0x0')]||![];this[_0x0bf7('0x1')]=_0x4ddf19[_0x0bf7('0x1')]||'';this[_0x0bf7('0x2')]=_0x0bf7('0x3');this[_0x0bf7('0x4')]=0x0;this[_0x0bf7('0x5')]='unknown';this[_0x0bf7('0x6')]=_0x4ddf19[_0x0bf7('0x6')]&&_0x4ddf19[_0x0bf7('0x6')][_0x0bf7('0x7')](':')?_0x4ddf19[_0x0bf7('0x6')][_0x0bf7('0x8')](':')[0x0]:'';this[_0x0bf7('0x9')]='';this[_0x0bf7('0xa')]='';this[_0x0bf7('0xb')]='';this['domainport']='';this[_0x0bf7('0xc')]='';this[_0x0bf7('0xd')]=_0x0bf7('0x3');this[_0x0bf7('0xe')]='';this[_0x0bf7('0xf')]='';this[_0x0bf7('0x10')]=_0x4ddf19[_0x0bf7('0x10')]||'';}module[_0x0bf7('0x11')]=Trunk; \ No newline at end of file +var _0xf3f0=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','host','domain','domainport','refresh'];(function(_0x3a2d4e,_0x339dd6){var _0x3085af=function(_0x45d954){while(--_0x45d954){_0x3a2d4e['push'](_0x3a2d4e['shift']());}};_0x3085af(++_0x339dd6);}(_0xf3f0,0xc0));var _0x0f3f=function(_0x23c6c5,_0x5c41a1){_0x23c6c5=_0x23c6c5-0x0;var _0x4b80d9=_0xf3f0[_0x23c6c5];return _0x4b80d9;};'use strict';function Trunk(_0x145fda){this['id']=_0x145fda['id']||0x0;this[_0x0f3f('0x0')]=_0x145fda[_0x0f3f('0x0')]||![];this[_0x0f3f('0x1')]=_0x145fda[_0x0f3f('0x1')]||'';this[_0x0f3f('0x2')]=_0x0f3f('0x3');this['stateTime']=0x0;this[_0x0f3f('0x4')]=_0x0f3f('0x3');this[_0x0f3f('0x5')]=_0x145fda[_0x0f3f('0x5')]&&_0x145fda['registry'][_0x0f3f('0x6')](':')?_0x145fda[_0x0f3f('0x5')][_0x0f3f('0x7')](':')[0x0]:'';this[_0x0f3f('0x8')]='';this['port']='';this[_0x0f3f('0x9')]='';this[_0x0f3f('0xa')]='';this[_0x0f3f('0xb')]='';this[_0x0f3f('0xc')]=_0x0f3f('0x3');this[_0x0f3f('0xd')]='';this[_0x0f3f('0xe')]='';this[_0x0f3f('0xf')]=_0x145fda[_0x0f3f('0xf')]||'';}module[_0x0f3f('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 51ce1f6..d0ad7fe 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 _0x5d00=['exten','mandatoryDisposition','exports'];(function(_0x56a0fb,_0x3dc8fc){var _0x102dfb=function(_0x426c84){while(--_0x426c84){_0x56a0fb['push'](_0x56a0fb['shift']());}};_0x102dfb(++_0x3dc8fc);}(_0x5d00,0x93));var _0x05d0=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x5d00[_0x2d61ac];return _0x3f7d3c;};'use strict';function voiceExtension(_0x4e08f0){this['id']=_0x4e08f0['id']||0x0;this['exten']=_0x4e08f0[_0x05d0('0x0')]||'';this['recordingFormat']=_0x4e08f0['recordingFormat']||'none';this['mandatoryDisposition']=_0x4e08f0[_0x05d0('0x1')]||![];}module[_0x05d0('0x2')]=voiceExtension; \ No newline at end of file +var _0xbb03=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1d418a,_0x30d642){var _0x256f72=function(_0x2911d4){while(--_0x2911d4){_0x1d418a['push'](_0x1d418a['shift']());}};_0x256f72(++_0x30d642);}(_0xbb03,0xec));var _0x3bb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbb03[_0x321bb2];return _0x9c12ed;};'use strict';function voiceExtension(_0x30f586){this['id']=_0x30f586['id']||0x0;this[_0x3bb0('0x0')]=_0x30f586[_0x3bb0('0x0')]||'';this[_0x3bb0('0x1')]=_0x30f586[_0x3bb0('0x1')]||_0x3bb0('0x2');this['mandatoryDisposition']=_0x30f586[_0x3bb0('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3f4c0c7..5552cf9 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 _0xf9a8=['dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','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','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','unavailable','ringing','onhold','wav','wav49','roundrobin','monitor_format','type','inbound','waiting','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel'];(function(_0x5f2ef7,_0x56d0ee){var _0x320811=function(_0x1919a5){while(--_0x1919a5){_0x5f2ef7['push'](_0x5f2ef7['shift']());}};_0x320811(++_0x56d0ee);}(_0xf9a8,0x1bd));var _0x8f9a=function(_0x218263,_0x2f8512){_0x218263=_0x218263-0x0;var _0x392b03=_0xf9a8[_0x218263];return _0x392b03;};'use strict';var statusDesc=[_0x8f9a('0x0'),'not_inuse','inuse',_0x8f9a('0x1'),'invalid',_0x8f9a('0x2'),_0x8f9a('0x3'),'ringinuse',_0x8f9a('0x4')];var monitorFormat={'wav':_0x8f9a('0x5'),'wav49':_0x8f9a('0x6'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x8f9a('0x7')};function VoiceQueue(_0x108227){this['id']=_0x108227['id']||0x0;this['name']=_0x108227['name']||'';this[_0x8f9a('0x8')]=_0x108227['monitor_format']||'';this[_0x8f9a('0x9')]=_0x108227[_0x8f9a('0x9')]||_0x8f9a('0xa');this[_0x8f9a('0xb')]=0x0;this['talking']=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x8f9a('0xc')]=0x0;this[_0x8f9a('0xd')]=0x0;this[_0x8f9a('0xe')]=0x0;this[_0x8f9a('0xf')]=0x0;this[_0x8f9a('0x10')]=0x0;this[_0x8f9a('0x11')]=0x0;this[_0x8f9a('0x12')]=_0x108227['acw']||![];this[_0x8f9a('0x13')]=_0x108227[_0x8f9a('0x13')]||0xa;this[_0x8f9a('0x14')]=_0x108227[_0x8f9a('0x14')]||'no';this['sendMessageOneNotActive']=!![];this[_0x8f9a('0x15')]='';this['originated']=0x0;this[_0x8f9a('0x16')]=0x0;this[_0x8f9a('0x17')]=_0x108227[_0x8f9a('0x17')]||null;this[_0x8f9a('0x18')]=_0x108227[_0x8f9a('0x18')]?_0x108227[_0x8f9a('0x18')]:null;this['dialActive']=_0x108227[_0x8f9a('0x19')];this[_0x8f9a('0x1a')]=_0x108227[_0x8f9a('0x1a')]||_0x8f9a('0x1b');this[_0x8f9a('0x1c')]=_0x108227[_0x8f9a('0x1c')]||0x0;this[_0x8f9a('0x1d')]=_0x108227[_0x8f9a('0x1d')]||0x0;this['dialPowerLevel']=_0x108227[_0x8f9a('0x1e')]||0x1;this[_0x8f9a('0x1f')]=_0x108227[_0x8f9a('0x1f')]||_0x8f9a('0x20');this[_0x8f9a('0x21')]=_0x108227[_0x8f9a('0x21')]||0.03;this[_0x8f9a('0x22')]=_0x108227[_0x8f9a('0x22')]||0x258;this[_0x8f9a('0x23')]=_0x108227['dialOriginateCallerIdName']||_0x8f9a('0x24');this[_0x8f9a('0x25')]=_0x108227[_0x8f9a('0x25')]||_0x8f9a('0x24');this[_0x8f9a('0x26')]=_0x108227[_0x8f9a('0x26')]||0x1e;this[_0x8f9a('0x27')]=_0x108227[_0x8f9a('0x27')]||'tTxX';this['dialQueueTimeout']=_0x108227['dialQueueTimeout']||0x3;this[_0x8f9a('0x28')]=_0x108227['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x108227[_0x8f9a('0x29')]||0x3;this[_0x8f9a('0x2a')]=_0x108227[_0x8f9a('0x2a')]||0x96;this[_0x8f9a('0x2b')]=_0x108227[_0x8f9a('0x2b')]||0x3;this['dialBusyRetryFrequency']=_0x108227[_0x8f9a('0x2c')]||0x96;this[_0x8f9a('0x2d')]=_0x108227[_0x8f9a('0x2d')]||0x3;this[_0x8f9a('0x2e')]=_0x108227[_0x8f9a('0x2e')]||0x96;this[_0x8f9a('0x2f')]=_0x108227[_0x8f9a('0x2f')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x108227[_0x8f9a('0x30')]||0x96;this[_0x8f9a('0x31')]=_0x108227[_0x8f9a('0x31')]||0x3;this[_0x8f9a('0x32')]=_0x108227['dialDropRetryFrequency']||0x96;this[_0x8f9a('0x33')]=_0x108227[_0x8f9a('0x33')]||0x3;this[_0x8f9a('0x34')]=_0x108227[_0x8f9a('0x34')]||0x96;this[_0x8f9a('0x35')]=_0x108227[_0x8f9a('0x35')]||0x3;this['dialMachineRetryFrequency']=_0x108227[_0x8f9a('0x36')]||0x96;this[_0x8f9a('0x37')]=_0x108227[_0x8f9a('0x37')]||0x3;this[_0x8f9a('0x38')]=_0x108227[_0x8f9a('0x38')]||0x96;this[_0x8f9a('0x39')]=_0x108227[_0x8f9a('0x39')]||0x4;this[_0x8f9a('0x3a')]=_0x108227[_0x8f9a('0x3a')]?_0x108227[_0x8f9a('0x3a')]:undefined;this['TrunkBackup']=_0x108227[_0x8f9a('0x3b')]?_0x108227[_0x8f9a('0x3b')]:undefined;this[_0x8f9a('0x3c')]=_0x108227[_0x8f9a('0x3c')]||undefined;this['Interval']=_0x108227[_0x8f9a('0x3d')]?_0x108227[_0x8f9a('0x3d')]:undefined;this[_0x8f9a('0x3e')]=_0x108227[_0x8f9a('0x3e')]||_0x8f9a('0x3f');this[_0x8f9a('0x40')]=_0x108227[_0x8f9a('0x40')]||undefined;this[_0x8f9a('0x41')]=_0x108227['dialCutDigit']||undefined;this['strategy']=strategy[_0x108227[_0x8f9a('0x42')]]||_0x8f9a('0x43');this['queueStatusComplete']=!![];this[_0x8f9a('0x44')]=_0x108227[_0x8f9a('0x44')]||![];this[_0x8f9a('0x45')]=_0x108227[_0x8f9a('0x45')];this[_0x8f9a('0x46')]=_0x108227[_0x8f9a('0x46')];this[_0x8f9a('0x47')]=_0x108227[_0x8f9a('0x47')];this[_0x8f9a('0x48')]=_0x108227[_0x8f9a('0x48')];this[_0x8f9a('0x49')]=_0x108227[_0x8f9a('0x49')];this[_0x8f9a('0x4a')]=_0x108227['dialAMDBetweenWordsSilence'];this[_0x8f9a('0x4b')]=_0x108227[_0x8f9a('0x4b')];this[_0x8f9a('0x4c')]=_0x108227[_0x8f9a('0x4c')];this[_0x8f9a('0x4d')]=_0x108227[_0x8f9a('0x4d')];this[_0x8f9a('0x4e')]=0x0;this[_0x8f9a('0x4f')]=0x0;this[_0x8f9a('0x50')]=_0x108227[_0x8f9a('0x50')];this[_0x8f9a('0x51')]=0x0;this[_0x8f9a('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x8f9a('0x53')]=0x0;this[_0x8f9a('0x54')]=0x0;this[_0x8f9a('0x55')]=0x0;this[_0x8f9a('0x56')]=0x0;this[_0x8f9a('0x57')]=0x0;this[_0x8f9a('0x58')]=0x0;this[_0x8f9a('0x59')]=0x0;this[_0x8f9a('0x5a')]=0x0;this[_0x8f9a('0x5b')]=0x0;this[_0x8f9a('0x5c')]=0x0;this[_0x8f9a('0x5d')]=0x0;this[_0x8f9a('0x5e')]=undefined;this[_0x8f9a('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x8f9a('0x60')]=1.05;this[_0x8f9a('0x61')]=0x0;this[_0x8f9a('0x62')]=0x0;this[_0x8f9a('0x63')]=0x0;this[_0x8f9a('0x64')]=0x0;this[_0x8f9a('0x65')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x8f9a('0x66')]=_0x108227[_0x8f9a('0x67')]||0x14;this[_0x8f9a('0x68')]=_0x108227[_0x8f9a('0x67')]||0xa;this[_0x8f9a('0x69')]=0x0;this[_0x8f9a('0x6a')]=0x0;this[_0x8f9a('0x6b')]=0x1;this[_0x8f9a('0x6c')]=0x0;this[_0x8f9a('0x6d')]=0x0;this[_0x8f9a('0x6e')]=0x0;this[_0x8f9a('0x6f')]=0x0;this[_0x8f9a('0x70')]=_0x108227[_0x8f9a('0x70')]||0x1e;this[_0x8f9a('0x71')]=_0x108227[_0x8f9a('0x71')]||![];this[_0x8f9a('0x72')]=_0x108227['dialQueueProject2']||undefined;this[_0x8f9a('0x73')]=_0x108227[_0x8f9a('0x73')]||![];this[_0x8f9a('0x74')]=_0x108227[_0x8f9a('0x74')]||![];this[_0x8f9a('0x8')]=monitorFormat[_0x108227[_0x8f9a('0x8')]]?monitorFormat[_0x108227[_0x8f9a('0x8')]]:undefined;this[_0x8f9a('0x75')]=_0x108227[_0x8f9a('0x75')]||![];this[_0x8f9a('0x76')]=_0x108227[_0x8f9a('0x76')]?_0x108227['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x9a0a=['unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x36f002,_0x4a0869){_0x36f002=_0x36f002-0x0;var _0x25e84e=_0x9a0a[_0x36f002];return _0x25e84e;};'use strict';var statusDesc=[_0xa9a0('0x0'),_0xa9a0('0x1'),_0xa9a0('0x2'),_0xa9a0('0x3'),_0xa9a0('0x4'),_0xa9a0('0x5'),_0xa9a0('0x6'),_0xa9a0('0x7'),_0xa9a0('0x8')];var monitorFormat={'wav':'wav','wav49':_0xa9a0('0x9'),'gsm':_0xa9a0('0xa')};var strategy={'rrmemory':_0xa9a0('0xb'),'roundrobin':_0xa9a0('0xc')};function VoiceQueue(_0x1357ea){this['id']=_0x1357ea['id']||0x0;this[_0xa9a0('0xd')]=_0x1357ea['name']||'';this[_0xa9a0('0xe')]=_0x1357ea[_0xa9a0('0xe')]||'';this[_0xa9a0('0xf')]=_0x1357ea[_0xa9a0('0xf')]||_0xa9a0('0x10');this['waiting']=0x0;this[_0xa9a0('0x11')]=0x0;this['total']=0x0;this[_0xa9a0('0x12')]=0x0;this[_0xa9a0('0x13')]=0x0;this[_0xa9a0('0x14')]=0x0;this[_0xa9a0('0x15')]=0x0;this['unmanaged']=0x0;this[_0xa9a0('0x16')]=0x0;this[_0xa9a0('0x17')]=0x0;this[_0xa9a0('0x18')]=0x0;this[_0xa9a0('0x19')]=_0x1357ea[_0xa9a0('0x19')]||![];this[_0xa9a0('0x1a')]=_0x1357ea[_0xa9a0('0x1a')]||0xa;this['autopause']=_0x1357ea[_0xa9a0('0x1b')]||'no';this[_0xa9a0('0x1c')]=!![];this[_0xa9a0('0x1d')]='';this[_0xa9a0('0x1e')]=0x0;this[_0xa9a0('0x1f')]=0x0;this[_0xa9a0('0x20')]=_0x1357ea[_0xa9a0('0x20')]||null;this[_0xa9a0('0x21')]=_0x1357ea[_0xa9a0('0x21')]?_0x1357ea[_0xa9a0('0x21')]:null;this['dialActive']=_0x1357ea[_0xa9a0('0x22')];this['dialMethod']=_0x1357ea[_0xa9a0('0x23')]||_0xa9a0('0x24');this[_0xa9a0('0x25')]=_0x1357ea[_0xa9a0('0x25')]||0x0;this[_0xa9a0('0x26')]=_0x1357ea[_0xa9a0('0x26')]||0x0;this[_0xa9a0('0x27')]=_0x1357ea['dialPowerLevel']||0x1;this[_0xa9a0('0x28')]=_0x1357ea[_0xa9a0('0x28')]||'dropRate';this[_0xa9a0('0x29')]=_0x1357ea['dialPredictiveOptimizationPercentage']||0.03;this[_0xa9a0('0x2a')]=_0x1357ea[_0xa9a0('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x1357ea[_0xa9a0('0x2b')]||_0xa9a0('0x2c');this[_0xa9a0('0x2d')]=_0x1357ea[_0xa9a0('0x2d')]||_0xa9a0('0x2c');this['dialOriginateTimeout']=_0x1357ea['dialOriginateTimeout']||0x1e;this[_0xa9a0('0x2e')]=_0x1357ea[_0xa9a0('0x2e')]||_0xa9a0('0x2f');this[_0xa9a0('0x30')]=_0x1357ea[_0xa9a0('0x30')]||0x3;this[_0xa9a0('0x31')]=_0x1357ea[_0xa9a0('0x31')]||undefined;this[_0xa9a0('0x32')]=_0x1357ea[_0xa9a0('0x32')]||0x3;this[_0xa9a0('0x33')]=_0x1357ea[_0xa9a0('0x33')]||0x96;this[_0xa9a0('0x34')]=_0x1357ea[_0xa9a0('0x34')]||0x3;this[_0xa9a0('0x35')]=_0x1357ea[_0xa9a0('0x35')]||0x96;this[_0xa9a0('0x36')]=_0x1357ea[_0xa9a0('0x36')]||0x3;this[_0xa9a0('0x37')]=_0x1357ea[_0xa9a0('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1357ea[_0xa9a0('0x38')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1357ea[_0xa9a0('0x39')]||0x96;this[_0xa9a0('0x3a')]=_0x1357ea[_0xa9a0('0x3a')]||0x3;this[_0xa9a0('0x3b')]=_0x1357ea[_0xa9a0('0x3b')]||0x96;this[_0xa9a0('0x3c')]=_0x1357ea[_0xa9a0('0x3c')]||0x3;this[_0xa9a0('0x3d')]=_0x1357ea[_0xa9a0('0x3d')]||0x96;this[_0xa9a0('0x3e')]=_0x1357ea[_0xa9a0('0x3e')]||0x3;this[_0xa9a0('0x3f')]=_0x1357ea['dialMachineRetryFrequency']||0x96;this[_0xa9a0('0x40')]=_0x1357ea[_0xa9a0('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1357ea['dialAgentRejectRetryFrequency']||0x96;this[_0xa9a0('0x41')]=_0x1357ea[_0xa9a0('0x41')]||0x4;this[_0xa9a0('0x42')]=_0x1357ea[_0xa9a0('0x42')]?_0x1357ea[_0xa9a0('0x42')]:undefined;this['TrunkBackup']=_0x1357ea[_0xa9a0('0x43')]?_0x1357ea[_0xa9a0('0x43')]:undefined;this[_0xa9a0('0x44')]=_0x1357ea[_0xa9a0('0x44')]||undefined;this[_0xa9a0('0x45')]=_0x1357ea['Interval']?_0x1357ea['Interval']:undefined;this[_0xa9a0('0x46')]=_0x1357ea['dialOrderByScheduledAt']||_0xa9a0('0x47');this['dialRandomLastDigitCallerIdNumber']=_0x1357ea[_0xa9a0('0x48')]||undefined;this[_0xa9a0('0x49')]=_0x1357ea[_0xa9a0('0x49')]||undefined;this['strategy']=strategy[_0x1357ea[_0xa9a0('0x4a')]]||_0xa9a0('0xb');this[_0xa9a0('0x4b')]=!![];this[_0xa9a0('0x4c')]=_0x1357ea[_0xa9a0('0x4c')]||![];this['dialAMDInitialSilence']=_0x1357ea[_0xa9a0('0x4d')];this[_0xa9a0('0x4e')]=_0x1357ea[_0xa9a0('0x4e')];this['dialAMDAfterGreetingSilence']=_0x1357ea['dialAMDAfterGreetingSilence'];this[_0xa9a0('0x4f')]=_0x1357ea[_0xa9a0('0x4f')];this['dialAMDMinWordLength']=_0x1357ea['dialAMDMinWordLength'];this[_0xa9a0('0x50')]=_0x1357ea[_0xa9a0('0x50')];this[_0xa9a0('0x51')]=_0x1357ea[_0xa9a0('0x51')];this[_0xa9a0('0x52')]=_0x1357ea[_0xa9a0('0x52')];this[_0xa9a0('0x53')]=_0x1357ea[_0xa9a0('0x53')];this[_0xa9a0('0x54')]=0x0;this['pTalking']=0x0;this[_0xa9a0('0x55')]=_0x1357ea[_0xa9a0('0x55')];this[_0xa9a0('0x56')]=0x0;this[_0xa9a0('0x57')]=0x0;this[_0xa9a0('0x58')]=0x0;this[_0xa9a0('0x59')]=0x0;this[_0xa9a0('0x5a')]=0x0;this[_0xa9a0('0x5b')]=0x0;this[_0xa9a0('0x5c')]=0x0;this[_0xa9a0('0x5d')]=0x0;this[_0xa9a0('0x5e')]=0x0;this[_0xa9a0('0x5f')]=0x0;this[_0xa9a0('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa9a0('0x61')]=0x0;this[_0xa9a0('0x62')]=0x0;this[_0xa9a0('0x63')]=undefined;this['startPredictive']=undefined;this[_0xa9a0('0x64')]=undefined;this[_0xa9a0('0x65')]=1.05;this[_0xa9a0('0x66')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xa9a0('0x67')]=0x0;this[_0xa9a0('0x68')]=0x0;this[_0xa9a0('0x69')]=0x0;this[_0xa9a0('0x6a')]=0x0;this[_0xa9a0('0x6b')]=0x0;this[_0xa9a0('0x6c')]=_0x1357ea[_0xa9a0('0x6d')]||0x14;this[_0xa9a0('0x6e')]=_0x1357ea['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xa9a0('0x6f')]=0x0;this[_0xa9a0('0x70')]=0x0;this[_0xa9a0('0x71')]=0x1;this[_0xa9a0('0x72')]=0x0;this[_0xa9a0('0x73')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa9a0('0x74')]=0x0;this['dialRecallMeTimeout']=_0x1357ea['dialRecallMeTimeout']||0x1e;this[_0xa9a0('0x75')]=_0x1357ea[_0xa9a0('0x75')]||![];this['dialQueueProject2']=_0x1357ea[_0xa9a0('0x76')]||undefined;this['dialAgiAfterHangupClient']=_0x1357ea[_0xa9a0('0x77')]||![];this[_0xa9a0('0x78')]=_0x1357ea[_0xa9a0('0x78')]||![];this[_0xa9a0('0xe')]=monitorFormat[_0x1357ea['monitor_format']]?monitorFormat[_0x1357ea[_0xa9a0('0xe')]]:undefined;this[_0xa9a0('0x79')]=_0x1357ea[_0xa9a0('0x79')]||![];this['mandatoryDispositionPause']=_0x1357ea[_0xa9a0('0x7a')]?_0x1357ea[_0xa9a0('0x7a')]:undefined;}module[_0xa9a0('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 86814a2..c811f0a 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 _0xeefe=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x2f4d41,_0x104d39){var _0x2197d1=function(_0x2427ee){while(--_0x2427ee){_0x2f4d41['push'](_0x2f4d41['shift']());}};_0x2197d1(++_0x104d39);}(_0xeefe,0xab));var _0xeeef=function(_0x48e765,_0x52d16){_0x48e765=_0x48e765-0x0;var _0x3dbb37=_0xeefe[_0x48e765];return _0x3dbb37;};'use strict';function VtigerAccount(_0x2b837b){this['id']=_0x2b837b['id']||0x0;this['name']=_0x2b837b[_0xeeef('0x0')]||'';this[_0xeeef('0x1')]=_0x2b837b[_0xeeef('0x1')]||'';this[_0xeeef('0x2')]=_0x2b837b['accessKey']||'';this[_0xeeef('0x3')]=_0x2b837b[_0xeeef('0x3')]||'';this[_0xeeef('0x4')]=_0x2b837b['serverUrl']||'';this[_0xeeef('0x5')]=_0x2b837b[_0xeeef('0x5')]||{};}module[_0xeeef('0x6')]=VtigerAccount; \ No newline at end of file +var _0xae4f=['remoteUri','Configurations','exports','name','username','accessKey'];(function(_0xbfbbac,_0x27949e){var _0x3f55b6=function(_0x657769){while(--_0x657769){_0xbfbbac['push'](_0xbfbbac['shift']());}};_0x3f55b6(++_0x27949e);}(_0xae4f,0xd5));var _0xfae4=function(_0x36d402,_0x7d6a49){_0x36d402=_0x36d402-0x0;var _0x3064be=_0xae4f[_0x36d402];return _0x3064be;};'use strict';function VtigerAccount(_0x43d6a4){this['id']=_0x43d6a4['id']||0x0;this[_0xfae4('0x0')]=_0x43d6a4[_0xfae4('0x0')]||'';this[_0xfae4('0x1')]=_0x43d6a4['username']||'';this[_0xfae4('0x2')]=_0x43d6a4[_0xfae4('0x2')]||'';this[_0xfae4('0x3')]=_0x43d6a4['remoteUri']||'';this['serverUrl']=_0x43d6a4['serverUrl']||'';this[_0xfae4('0x4')]=_0x43d6a4[_0xfae4('0x4')]||{};}module[_0xfae4('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 6c93fb5..3db02dd 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 _0x03d8=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x03d8,0xef));var _0x803d=function(_0x2ad6a9,_0x1bae45){_0x2ad6a9=_0x2ad6a9-0x0;var _0x2c6216=_0x03d8[_0x2ad6a9];return _0x2c6216;};'use strict';function ZendeskAccount(_0x43881f){this['id']=_0x43881f['id']||0x0;this[_0x803d('0x0')]=_0x43881f[_0x803d('0x0')]||'';this[_0x803d('0x1')]=_0x43881f[_0x803d('0x1')]||'';this[_0x803d('0x2')]=_0x43881f[_0x803d('0x2')]||'';this[_0x803d('0x3')]=_0x43881f['token']||'';this[_0x803d('0x4')]=_0x43881f[_0x803d('0x4')]||'';this[_0x803d('0x5')]=_0x43881f[_0x803d('0x5')]||'';this[_0x803d('0x6')]=_0x43881f['type']||_0x803d('0x7');this[_0x803d('0x8')]=_0x43881f[_0x803d('0x8')]||'';this[_0x803d('0x9')]=_0x43881f['Configurations']||{};}module[_0x803d('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xd13e=['type','integrationTab','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x317f09,_0x38dcf2){var _0x350832=function(_0x36ad19){while(--_0x36ad19){_0x317f09['push'](_0x317f09['shift']());}};_0x350832(++_0x38dcf2);}(_0xd13e,0x18a));var _0xed13=function(_0x2fbfba,_0x107d2f){_0x2fbfba=_0x2fbfba-0x0;var _0x511287=_0xd13e[_0x2fbfba];return _0x511287;};'use strict';function ZendeskAccount(_0x5c2dc2){this['id']=_0x5c2dc2['id']||0x0;this[_0xed13('0x0')]=_0x5c2dc2[_0xed13('0x0')]||'';this['username']=_0x5c2dc2[_0xed13('0x1')]||'';this['password']=_0x5c2dc2[_0xed13('0x2')]||'';this[_0xed13('0x3')]=_0x5c2dc2[_0xed13('0x3')]||'';this[_0xed13('0x4')]=_0x5c2dc2['remoteUri']||'';this[_0xed13('0x5')]=_0x5c2dc2['authType']||'';this['type']=_0x5c2dc2[_0xed13('0x6')]||_0xed13('0x7');this['serverUrl']=_0x5c2dc2['serverUrl']||'';this[_0xed13('0x8')]=_0x5c2dc2[_0xed13('0x8')]||{};}module[_0xed13('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4e792b3..2b21e96 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 _0x90c7=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x20af07,_0x110896){var _0xaf45cd=function(_0x124384){while(--_0x124384){_0x20af07['push'](_0x20af07['shift']());}};_0xaf45cd(++_0x110896);}(_0x90c7,0xb8));var _0x790c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x90c7[_0x2b5eae];return _0x5f3ac9;};'use strict';function ZohoAccount(_0x18ac70){this['id']=_0x18ac70['id']||0x0;this[_0x790c('0x0')]=_0x18ac70[_0x790c('0x0')]||'';this[_0x790c('0x1')]=_0x18ac70['description']||'';this[_0x790c('0x2')]=_0x18ac70[_0x790c('0x2')]||'';this[_0x790c('0x3')]=_0x18ac70[_0x790c('0x3')]||'';this[_0x790c('0x4')]=_0x18ac70['clientId']||'';this['clientSecret']=_0x18ac70[_0x790c('0x5')]||'';this[_0x790c('0x6')]=_0x18ac70[_0x790c('0x6')]||'';this[_0x790c('0x7')]=_0x18ac70[_0x790c('0x7')]||'';this[_0x790c('0x8')]=_0x18ac70[_0x790c('0x8')]||'';this['Configurations']=_0x18ac70[_0x790c('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xb3f5=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5b7f92,_0x29b3ee){var _0x593946=function(_0x2a24db){while(--_0x2a24db){_0x5b7f92['push'](_0x5b7f92['shift']());}};_0x593946(++_0x29b3ee);}(_0xb3f5,0xbb));var _0x5b3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3f5[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x342d9b){this['id']=_0x342d9b['id']||0x0;this[_0x5b3f('0x0')]=_0x342d9b[_0x5b3f('0x0')]||'';this[_0x5b3f('0x1')]=_0x342d9b[_0x5b3f('0x1')]||'';this['host']=_0x342d9b[_0x5b3f('0x2')]||'';this['zone']=_0x342d9b[_0x5b3f('0x3')]||'';this[_0x5b3f('0x4')]=_0x342d9b[_0x5b3f('0x4')]||'';this[_0x5b3f('0x5')]=_0x342d9b[_0x5b3f('0x5')]||'';this[_0x5b3f('0x6')]=_0x342d9b[_0x5b3f('0x6')]||'';this['code']=_0x342d9b[_0x5b3f('0x7')]||'';this[_0x5b3f('0x8')]=_0x342d9b[_0x5b3f('0x8')]||'';this[_0x5b3f('0x9')]=_0x342d9b[_0x5b3f('0x9')]||{};}module[_0x5b3f('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 791b95a..d9288ae 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 _0x7c37=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','number','util','lodash','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat'];(function(_0x460895,_0x1c8f3a){var _0x46e6a3=function(_0x4a79e1){while(--_0x4a79e1){_0x460895['push'](_0x460895['shift']());}};_0x46e6a3(++_0x1c8f3a);}(_0x7c37,0x67));var _0x77c3=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x7c37[_0x32f7d7];return _0x133d09;};'use strict';var util=require(_0x77c3('0x0'));var _=require(_0x77c3('0x1'));var moment=require('moment');function checkNameSurname(_0x3e3b5c,_0xbd7c0,_0x49feda){var _0x205089='';if(!_[_0x77c3('0x2')](_0xbd7c0)&&'string'===typeof _0xbd7c0){_0x205089+=_0xbd7c0;}if(!_[_0x77c3('0x2')](_0x49feda)&&_0x77c3('0x3')===typeof _0x49feda){_0x205089+='\x20'+_0x49feda;}if(_0x205089!==''){return _0x205089;}return _0x3e3b5c;}function Action(_0x3dd421,_0x238cca,_0xc2360b,_0x4d4e28,_0x147640){this[_0x77c3('0x4')]=_0xc2360b||undefined;this[_0x77c3('0x5')]=_0x3dd421['id'];this[_0x77c3('0x6')]=_0x238cca['name'];this[_0x77c3('0x7')]=_0x238cca[_0x77c3('0x7')];this[_0x77c3('0x8')]=_0x77c3('0x6');this[_0x77c3('0x9')]=![];this[_0x77c3('0xa')]=_[_0x77c3('0x2')](_0x3dd421[_0x77c3('0xb')])?undefined:_0x3dd421[_0x77c3('0xb')][_0x77c3('0xc')];this[_0x77c3('0xd')]=this[_0x77c3('0xa')]?util[_0x77c3('0xe')](_0x77c3('0xf'),this['membername']):_0x4d4e28||undefined;this[_0x77c3('0x10')]=checkNameSurname(_0x3dd421[_0x77c3('0x11')][_0x77c3('0x12')],_0x3dd421[_0x77c3('0x11')]['firstName'],_0x3dd421[_0x77c3('0x11')][_0x77c3('0x13')]);this[_0x77c3('0x14')]=_0x3dd421[_0x77c3('0x14')]||![];this[_0x77c3('0x15')]=_0x3dd421[_0x77c3('0x11')][_0x77c3('0x12')];this[_0x77c3('0x16')]=_0x3dd421[_0x77c3('0x16')];this[_0x77c3('0x17')]=_0x3dd421[_0x77c3('0x17')]||0x0;this[_0x77c3('0x18')]=_0x3dd421[_0x77c3('0x18')]||0x0;this[_0x77c3('0x19')]=_0x3dd421[_0x77c3('0x19')]||0x0;this[_0x77c3('0x1a')]=(_0x3dd421['countbusyretry']||0x0)+(_0x3dd421[_0x77c3('0x18')]||0x0)+(_0x3dd421['countnoanswerretry']||0x0)+(_0x3dd421[_0x77c3('0x1b')]||0x0)+(_0x3dd421[_0x77c3('0x1c')]||0x0)+(_0x3dd421[_0x77c3('0x1d')]||0x0)+(_0x3dd421[_0x77c3('0x1e')]||0x0)+(_0x3dd421['countagentrejectretry']||0x0);this[_0x77c3('0x1b')]=_0x3dd421[_0x77c3('0x1b')]||0x0;this[_0x77c3('0x1c')]=_0x3dd421['countdropretry']||0x0;this[_0x77c3('0x1d')]=_0x3dd421['countabandonedretry']||0x0;this[_0x77c3('0x1e')]=_0x3dd421[_0x77c3('0x1e')]||0x0;this[_0x77c3('0x1f')]=_0x3dd421[_0x77c3('0x1f')]||0x0;this['callback']=_0x3dd421[_0x77c3('0x20')];this[_0x77c3('0x21')]=_0x3dd421[_0x77c3('0x21')];this[_0x77c3('0x22')]=_0x3dd421[_0x77c3('0x22')];this[_0x77c3('0x23')]=_0x3dd421[_0x77c3('0x23')];this[_0x77c3('0x24')]=_0x3dd421[_0x77c3('0x24')];this[_0x77c3('0x25')]=_0x3dd421['ListId'];this[_0x77c3('0x26')]=_['isNil'](_0x3dd421[_0x77c3('0xb')])?_0x3dd421['UserId']:_0x3dd421[_0x77c3('0xb')]['id'];this[_0x77c3('0x27')]=_0x3dd421[_0x77c3('0x27')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x77c3('0x28')]['getCaller']=function(){return util[_0x77c3('0xe')]('\x22%s\x22\x20<%s>',this[_0x77c3('0x10')],this[_0x77c3('0x29')]);};module['exports']=Action; \ No newline at end of file +var _0x9f76=['getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9f76,0x1b1));var _0x69f7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x9f76[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0x69f7('0x0'));var _=require(_0x69f7('0x1'));var moment=require(_0x69f7('0x2'));function checkNameSurname(_0x30d626,_0x57e6c4,_0x28dd06){var _0x274583='';if(!_[_0x69f7('0x3')](_0x57e6c4)&&_0x69f7('0x4')===typeof _0x57e6c4){_0x274583+=_0x57e6c4;}if(!_[_0x69f7('0x3')](_0x28dd06)&&_0x69f7('0x4')===typeof _0x28dd06){_0x274583+='\x20'+_0x28dd06;}if(_0x274583!==''){return _0x274583;}return _0x30d626;}function Action(_0x379d99,_0x27db88,_0xbe08f8,_0x202e34,_0x38f9a7){this[_0x69f7('0x5')]=_0xbe08f8||undefined;this[_0x69f7('0x6')]=_0x379d99['id'];this[_0x69f7('0x7')]=_0x27db88['name'];this[_0x69f7('0x8')]=_0x27db88['type'];this[_0x69f7('0x9')]=_0x69f7('0x7');this['dialAnswer']=![];this[_0x69f7('0xa')]=_[_0x69f7('0x3')](_0x379d99[_0x69f7('0xb')])?undefined:_0x379d99['Agent'][_0x69f7('0xc')];this[_0x69f7('0xd')]=this['membername']?util[_0x69f7('0xe')](_0x69f7('0xf'),this['membername']):_0x202e34||undefined;this[_0x69f7('0x10')]=checkNameSurname(_0x379d99[_0x69f7('0x11')]['phone'],_0x379d99[_0x69f7('0x11')]['firstName'],_0x379d99[_0x69f7('0x11')]['lastName']);this[_0x69f7('0x12')]=_0x379d99['active']||![];this['calleridnum']=_0x379d99[_0x69f7('0x11')][_0x69f7('0x13')];this[_0x69f7('0x14')]=_0x379d99[_0x69f7('0x14')];this[_0x69f7('0x15')]=_0x379d99[_0x69f7('0x15')]||0x0;this[_0x69f7('0x16')]=_0x379d99[_0x69f7('0x16')]||0x0;this[_0x69f7('0x17')]=_0x379d99['countnoanswerretry']||0x0;this[_0x69f7('0x18')]=(_0x379d99[_0x69f7('0x15')]||0x0)+(_0x379d99[_0x69f7('0x16')]||0x0)+(_0x379d99[_0x69f7('0x17')]||0x0)+(_0x379d99[_0x69f7('0x19')]||0x0)+(_0x379d99['countdropretry']||0x0)+(_0x379d99[_0x69f7('0x1a')]||0x0)+(_0x379d99[_0x69f7('0x1b')]||0x0)+(_0x379d99[_0x69f7('0x1c')]||0x0);this[_0x69f7('0x19')]=_0x379d99[_0x69f7('0x19')]||0x0;this[_0x69f7('0x1d')]=_0x379d99[_0x69f7('0x1d')]||0x0;this[_0x69f7('0x1a')]=_0x379d99['countabandonedretry']||0x0;this[_0x69f7('0x1b')]=_0x379d99['countmachineretry']||0x0;this['countagentrejectretry']=_0x379d99[_0x69f7('0x1c')]||0x0;this['callback']=_0x379d99[_0x69f7('0x1e')];this[_0x69f7('0x1f')]=_0x379d99[_0x69f7('0x1f')];this[_0x69f7('0x20')]=_0x379d99[_0x69f7('0x20')];this[_0x69f7('0x21')]=_0x379d99['recallme'];this[_0x69f7('0x22')]=_0x379d99[_0x69f7('0x22')];this[_0x69f7('0x23')]=_0x379d99['ListId'];this[_0x69f7('0x24')]=_[_0x69f7('0x3')](_0x379d99[_0x69f7('0xb')])?_0x379d99[_0x69f7('0x24')]:_0x379d99[_0x69f7('0xb')]['id'];this['VoiceQueueId']=_0x379d99[_0x69f7('0x25')];this['originatecalleridnum']='';this[_0x69f7('0x26')]='';}Action[_0x69f7('0x27')][_0x69f7('0x28')]=function(){return util['format'](_0x69f7('0x29'),this['calleridname'],this[_0x69f7('0x2a')]);};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 e69a601..96e7d81 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 _0x142e=['\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','unlock','getContactPreview','recallme','validateContact','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','callerid','dialOriginateCallerIdNumber','extractCalleridNumber','addVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','[originateFailure][logOriginateFailure]','syncOriginateResponse','lookAgent','logLookAgent','responsetime','response','unlockContact','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','name','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','outbound','dialMethod','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','campaignsPreview','pTalking:\x20','pick','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','Agent','[RecallMe]','logger2','disableContact','starttime','outboundReCallsDay','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','[syncHangup][talking][increment]','uniqueid'];(function(_0x206a85,_0x59b4d8){var _0x2561a4=function(_0x1ceb47){while(--_0x1ceb47){_0x206a85['push'](_0x206a85['shift']());}};_0x2561a4(++_0x59b4d8);}(_0x142e,0x1e4));var _0xe142=function(_0x24acdd,_0x4d616e){_0x24acdd=_0x24acdd-0x0;var _0x3f6c0a=_0x142e[_0x24acdd];return _0x3f6c0a;};'use strict';var util=require(_0xe142('0x0'));var _=require(_0xe142('0x1'));var BPromise=require(_0xe142('0x2'));var uuid=require(_0xe142('0x3'));var moment=require(_0xe142('0x4'));var md5=require(_0xe142('0x5'));var Redis=require(_0xe142('0x6'));var config=require(_0xe142('0x7'));var logger=require('../../../config/logger')(_0xe142('0x8'));var loggerAction=require(_0xe142('0x9'))(_0xe142('0xa'));var ami=require(_0xe142('0xb'));var rpcDb=require('./rpcDb');var Action=require(_0xe142('0xc'));var ut=require(_0xe142('0xd'));config[_0xe142('0xe')]=_[_0xe142('0xf')](config[_0xe142('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe142('0xe')]));var Sequence=function(){};Sequence[_0xe142('0x10')][_0xe142('0x11')]=function(_0x5a5977){this[_0xe142('0x12')]=this[_0xe142('0x12')]?this['tail'][_0xe142('0x13')](_0x5a5977):_0x5a5977();};function Preview(_0x40a952){this[_0xe142('0x14')]=new Sequence();this['campaignsPreview']=_0x40a952[_0xe142('0x15')];this[_0xe142('0x16')]=_0x40a952[_0xe142('0x16')];this[_0xe142('0x17')]={};this[_0xe142('0x18')]=_0x40a952[_0xe142('0x18')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xe142('0x19')](this));ami['on']('hangup',this[_0xe142('0x1a')][_0xe142('0x19')](this));ami['on'](_0xe142('0x1b'),this[_0xe142('0x1c')][_0xe142('0x19')](this));ami['on'](_0xe142('0x1d'),this[_0xe142('0x1e')][_0xe142('0x19')](this));ami['on']('newexten',this[_0xe142('0x1f')]['bind'](this));ami['on'](_0xe142('0x20'),this[_0xe142('0x21')]['bind'](this));ami['on'](_0xe142('0x22'),this[_0xe142('0x23')]['bind'](this));ami['on'](_0xe142('0x24'),this[_0xe142('0x25')][_0xe142('0x19')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x313068,_0x1256f4,_0x4d1c67){io['to'](_0x313068)[_0xe142('0x26')](_0x1256f4,_0x4d1c67);}function emitCampaignPreview(_0x2a9529){if(_0x2a9529[_0xe142('0x27')]==='outbound'){var _0x190ce8={'id':_0x2a9529['id'],'name':_0x2a9529['name'],'strategy':_0x2a9529['strategy'],'answered':_0x2a9529[_0xe142('0x28')],'available':_0x2a9529[_0xe142('0x29')],'loggedIn':_0x2a9529['loggedIn'],'pTalking':_0x2a9529[_0xe142('0x2a')],'sumBillable':_0x2a9529[_0xe142('0x2b')],'sumDuration':_0x2a9529[_0xe142('0x2c')],'sumHoldTime':_0x2a9529[_0xe142('0x2d')]||0x0,'talking':_0x2a9529['talking'],'total':_0x2a9529[_0xe142('0x2e')],'type':_0x2a9529[_0xe142('0x27')],'unmanaged':_0x2a9529[_0xe142('0x2f')],'abandoned':_0x2a9529[_0xe142('0x30')],'waiting':_0x2a9529['waiting'],'loggedInDb':_0x2a9529[_0xe142('0x31')],'dialActive':_0x2a9529[_0xe142('0x32')],'dialMethod':_0x2a9529['dialMethod'],'dialOriginateCallerIdName':_0x2a9529[_0xe142('0x33')],'dialOriginateCallerIdNumber':_0x2a9529['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2a9529[_0xe142('0x34')],'dialPrefix':_0x2a9529[_0xe142('0x35')],'outboundAnswerAgiCallsDay':_0x2a9529[_0xe142('0x36')],'outboundAnswerCallsDay':_0x2a9529['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2a9529['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2a9529[_0xe142('0x37')],'outboundCongestionCallsDay':_0x2a9529['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2a9529[_0xe142('0x38')],'outboundDropCallsDayCallersExit':_0x2a9529['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2a9529[_0xe142('0x39')],'outboundNoAnswerCallsDay':_0x2a9529[_0xe142('0x3a')],'outboundNoSuchCallsDay':_0x2a9529[_0xe142('0x3b')],'outboundOriginateFailureCallsDay':_0x2a9529['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2a9529['outboundReCallsDay'],'outboundRejectCallsDay':_0x2a9529[_0xe142('0x3c')],'outboundUnknownCallsDay':_0x2a9529[_0xe142('0x3d')],'outboundAbandonedCallsDay':_0x2a9529[_0xe142('0x3e')],'predictiveIntervalAnsweredCalls':_0x2a9529['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2a9529[_0xe142('0x3f')],'predictiveIntervalAvgTalktime':_0x2a9529[_0xe142('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x2a9529['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2a9529[_0xe142('0x41')],'predictiveIntervalErlangCalls':_0x2a9529[_0xe142('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x2a9529[_0xe142('0x43')],'predictiveIntervalHitRate':_0x2a9529[_0xe142('0x44')],'predictiveIntervalMultiplicativeFactor':_0x2a9529[_0xe142('0x45')],'predictiveIntervalPauses':_0x2a9529['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2a9529[_0xe142('0x46')],'predictiveIntervalTotalCalls':_0x2a9529[_0xe142('0x47')],'message':_0x2a9529[_0xe142('0x48')],'originated':_0x2a9529['originated'],'erlangCalls':_0x2a9529[_0xe142('0x49')],'erlangCallToSecond':_0x2a9529[_0xe142('0x4a')],'erlangAbandonmentRate':_0x2a9529[_0xe142('0x4b')],'erlangBusyFactor':_0x2a9529[_0xe142('0x4c')],'startPredictive':_0x2a9529['startPredictive'],'startProgressive':_0x2a9529[_0xe142('0x4d')]};if(_0x2a9529['Trunk']){_0x190ce8[_0xe142('0x4e')]={'id':_0x2a9529[_0xe142('0x4e')]['id'],'name':_0x2a9529['Trunk']['name'],'active':_0x2a9529[_0xe142('0x4e')][_0xe142('0x4f')],'callerid':_0x2a9529[_0xe142('0x4e')]['callerid']};}if(_0x2a9529['Interval']){_0x190ce8[_0xe142('0x50')]={'id':_0x2a9529[_0xe142('0x50')]['id'],'name':_0x2a9529[_0xe142('0x50')][_0xe142('0x51')]};}var _0x3169ab=md5(JSON[_0xe142('0x52')](_0x190ce8));if(_0x2a9529['md5']!==_0x3169ab){_0x2a9529[_0xe142('0x5')]=_0x3169ab;emit(util[_0xe142('0x53')](_0xe142('0x54'),_0x190ce8[_0xe142('0x51')]),_0xe142('0x55'),_0x190ce8);}}}function emitVoiceQueueChannelRemove(_0x39a95d){logger['info'](_0xe142('0x56'),JSON[_0xe142('0x52')](_0x39a95d));emit(util[_0xe142('0x53')](_0xe142('0x54'),_0x39a95d[_0xe142('0x51')]),_0xe142('0x57'),_0x39a95d);io[_0xe142('0x26')](_0xe142('0x58'),_0x39a95d);}function notSendMessagesQueue(_0x4201c6){if(_0x4201c6[_0xe142('0x59')]){if(_0x4201c6[_0xe142('0x5a')]===0x0&&_0x4201c6[_0xe142('0x2a')]===0x0){_0x4201c6[_0xe142('0x59')]=![];_0x4201c6[_0xe142('0x29')]=0x0;_0x4201c6[_0xe142('0x5b')]=0x0;_0x4201c6['message']=_0xe142('0x5c');ut[_0xe142('0x5d')](_0xe142('0x5e'),_0x4201c6[_0xe142('0x51')]+'\x20is\x20not\x20active');}else{_0x4201c6[_0xe142('0x48')]=_0xe142('0x5f');ut[_0xe142('0x5d')](_0xe142('0x5e'),_0x4201c6[_0xe142('0x51')]+_0xe142('0x60'));}emitCampaignPreview(_0x4201c6);}}Preview[_0xe142('0x10')]['loopCampaigns']=function(){var _0x5f7004=this;setInterval(function(){_0x5f7004[_0xe142('0x61')]();},0x7cf);};Preview['prototype'][_0xe142('0x61')]=function(){var _0x265f11=this['campaignsPreview'];this[_0xe142('0x62')]+=0x1;for(var _0xc026d7 in _0x265f11){if(_0x265f11[_0xe142('0x63')](_0xc026d7)&&(_0x265f11[_0xc026d7]['dialMethod']===_0xe142('0x8')||_0x265f11[_0xc026d7]['dialMethod']===_0xe142('0x64'))&&_0x265f11[_0xc026d7][_0xe142('0x27')]===_0xe142('0x65')){if(this[_0xe142('0x62')]>0x7){this[_0xe142('0x62')]=0x0;this['clearZombieChannels']();}}if(_0x265f11['hasOwnProperty'](_0xc026d7)&&_0x265f11[_0xc026d7][_0xe142('0x66')]===_0xe142('0x8')&&_0x265f11[_0xc026d7][_0xe142('0x27')]===_0xe142('0x65')){if(_0x265f11[_0xc026d7]['dialActive']){this[_0xe142('0x67')](_0x265f11[_0xc026d7]);this[_0xe142('0x68')](_0x265f11[_0xc026d7]);}else{notSendMessagesQueue(_0x265f11[_0xc026d7]);}}}};Preview[_0xe142('0x10')][_0xe142('0x69')]=function(_0x3a5839){var _0x2bd9f7=this;this[_0xe142('0x14')][_0xe142('0x11')](function(){if(!_[_0xe142('0x6a')](_0x2bd9f7[_0xe142('0x17')][_0x3a5839])){loggerAction[_0xe142('0x6b')](_0xe142('0x6c'),_0x3a5839,_0xe142('0x6d'),_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')],_0xe142('0x6f'),JSON[_0xe142('0x52')](_0x2bd9f7[_0xe142('0x70')][_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')]][_0xe142('0x5a')]),_0xe142('0x71'),JSON[_0xe142('0x52')](_0x2bd9f7[_0xe142('0x70')][_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')]]['pTalking']),JSON[_0xe142('0x52')](_0x2bd9f7[_0xe142('0x17')][_0x3a5839]['dialAnswer']),JSON[_0xe142('0x52')](_[_0xe142('0x72')](_0x2bd9f7[_0xe142('0x17')][_0x3a5839],['contactId',_0xe142('0x73'),_0xe142('0x74'),_0xe142('0x75')])));return ami[_0xe142('0x76')]({'action':'status','channel':_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x77')]})[_0xe142('0x78')](function(_0x32e4ec){if(_0x32e4ec[_0xe142('0x48')]===_0xe142('0x79')){setTimeout(function(){if(_0x2bd9f7['actions'][_0x3a5839]){ut['updateOriginated'](_0x2bd9f7[_0xe142('0x70')][_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')]],'[clearZombieChannel]');if(_0x2bd9f7['actions'][_0x3a5839][_0xe142('0x7a')]===!![]){ut[_0xe142('0x7b')](_0x2bd9f7[_0xe142('0x70')][_0x2bd9f7['actions'][_0x3a5839][_0xe142('0x6e')]],'[clearZombieChannel]');ut[_0xe142('0x7c')]('[Dialer][checkChannel][pTalking][Preview]'+_0x3a5839,_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')]);}ut['loggerError'](_0xe142('0x7d')+_0x3a5839,_0x2bd9f7[_0xe142('0x17')][_0x3a5839][_0xe142('0x6e')]);delete _0x2bd9f7[_0xe142('0x17')][_0x3a5839];}},0x2328);}});}});};Preview['prototype'][_0xe142('0x7e')]=function(){var _0x4d6b56=this;loggerAction['info'](_0xe142('0x7f'),_[_0xe142('0x80')](this[_0xe142('0x17')]));for(var _0x4d0026 in this['actions']){if(_0x4d6b56[_0xe142('0x17')]['hasOwnProperty'](_0x4d0026)){_0x4d6b56['clearZombieChannel'](_0x4d0026);}}};Preview[_0xe142('0x10')][_0xe142('0x68')]=function(_0x1b0413){var _0x30cf6b=this;rpcDb[_0xe142('0x81')](_0x1b0413['id'],ut[_0xe142('0x82')](this[_0xe142('0x18')]))['then'](function(_0x31cb1d){if(!_[_0xe142('0x6a')](_0x31cb1d)){for(var _0x28208d=0x0;_0x28208d<_0x31cb1d[_0xe142('0x83')];_0x28208d+=0x1){if(ut['getDiff'](_0x31cb1d[_0x28208d][_0xe142('0x84')])<_0x1b0413['dialRecallMeTimeout']*0x3c){if(_0x31cb1d[_0x28208d][_0xe142('0x85')]&&!_0x31cb1d[_0x28208d][_0xe142('0x85')]['voicePause']){_0x30cf6b['run'](_0x31cb1d[_0x28208d]['id'])['then'](ut['logger2'](_0xe142('0x86')))[_0xe142('0x78')](ut[_0xe142('0x87')](_0xe142('0x86')));}else{rpcDb[_0xe142('0x88')](_0x31cb1d[_0x28208d]['id']);}}else{var _0x23b9cf=new Action(_0x31cb1d[_0x28208d],_0x1b0413);_0x23b9cf[_0xe142('0x89')]=moment()[_0xe142('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b0413[_0xe142('0x8a')]+=0x1;ut[_0xe142('0x8b')](_0x23b9cf,0x17,'RecallInQueue');if(_0x1b0413['dialRecallInQueue']){rpcDb[_0xe142('0x8c')](ut[_0xe142('0x8d')](_0x31cb1d[_0x28208d]));rpcDb[_0xe142('0x8e')](_0x23b9cf,_0xe142('0x8f'));}else{ut[_0xe142('0x8b')](_0x23b9cf,0x16,_0xe142('0x90'));rpcDb['createCustomerHistory'](_0x23b9cf,_0xe142('0x91'));rpcDb[_0xe142('0x92')](_0x23b9cf,_0xe142('0x91'));}}}}})['catch'](ut[_0xe142('0x87')](_0xe142('0x93')));};Preview[_0xe142('0x10')][_0xe142('0x67')]=function(_0x3e5e06){_0x3e5e06[_0xe142('0x59')]=!![];if(ut[_0xe142('0x94')](_0x3e5e06[_0xe142('0x95')])){_0x3e5e06['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xe142('0x96')](_0x3e5e06[_0xe142('0x32')])){_0x3e5e06[_0xe142('0x48')]=_0xe142('0x5c');}else if(!this[_0xe142('0x97')](_0x3e5e06[_0xe142('0x4e')])){if(!this[_0xe142('0x97')](_0x3e5e06['TrunkBackup'])){_0x3e5e06[_0xe142('0x48')]=_0xe142('0x98');}else{_0x3e5e06[_0xe142('0x48')]=_0xe142('0x99');}}else{_0x3e5e06['message']='ACTIVE';}emitCampaignPreview(_0x3e5e06);};Preview[_0xe142('0x10')][_0xe142('0x9a')]=function(_0x16fa75,_0x566af4,_0x5e3fde){var _0x389e64=this;var _0xf924da=this[_0xe142('0x17')][_0x566af4];var _0x334e77=this[_0xe142('0x70')][_0xf924da[_0xe142('0x6e')]];var _0x88c0a0;if(_0x334e77){switch(_0x5e3fde){case'1':_0x334e77[_0xe142('0x3b')]+=0x1;_0xf924da[_0xe142('0x9b')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0x0,'NoSuchNumber');ami['emit']('custom:agentnosuchnumber',ut[_0xe142('0x9e')](_0xf924da,_0xe142('0x9f')));rpcDb['createCustomerHistory'](_0xf924da,_0xe142('0xa0'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0xf924da[_0xe142('0x9b')]>=_0x334e77[_0xe142('0xa4')]){rpcDb['createCustomerFinal'](_0xf924da,_0xe142('0xa5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0xf924da,_0xe142('0x9b'),_0x334e77[_0xe142('0xa6')]),_0xf924da[_0xe142('0xa7')],_0xf924da[_0xe142('0xa8')]);}}delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xa9')]];break;case _0xe142('0xaa'):var _0x2bdac6=moment()[_0xe142('0x53')](_0xe142('0xab'));_0xf924da['responsetime']=_0x2bdac6;_0xf924da['answertime']=_0x2bdac6;_0xf924da[_0xe142('0x7a')]=!![];_0x334e77[_0xe142('0x2a')]+=0x1;logger[_0xe142('0x6b')](_0xe142('0xac'),_0xf924da[_0xe142('0xad')],_0xe142('0xae'),_0x334e77['name'],_0xe142('0x71'),_0x334e77[_0xe142('0x2a')]);ami['emit'](_0xe142('0xaf'),ut[_0xe142('0x9e')](_0xf924da,_0xe142('0xb0'),this[_0xe142('0x70')][_0xf924da[_0xe142('0x6e')]]));if(_0x334e77[_0xe142('0xb1')]){ami[_0xe142('0x26')]('custom:agentConnectPreview',ut[_0xe142('0xb2')](_0xf924da));}break;case'16':ami[_0xe142('0x26')](_0xe142('0xb3'),ut['buildObj'](_0xf924da,_0xe142('0xb4'),this[_0xe142('0x70')][_0xf924da[_0xe142('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0xe142('0x9e')](_0xf924da,_0xe142('0xb4')));_0x334e77['outboundAnswerCallsDay']+=0x1;_0x334e77[_0xe142('0x2e')]+=0x1;_0x334e77[_0xe142('0x28')]+=0x1;ut[_0xe142('0x7b')](_0x334e77,_0xe142('0xb5'));_0xf924da['countglobal']=ut[_0xe142('0x9d')](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0x4,_0xe142('0xb6'));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xb7'));rpcDb['createCustomerFinal'](_0xf924da,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0xf924da);_0x334e77[_0xe142('0x2c')]+=_0xf924da[_0xe142('0xb8')];_0x334e77[_0xe142('0x2b')]+=_0xf924da[_0xe142('0xb8')];logger[_0xe142('0x6b')]('[syncHangup][talking][decrement]',_0xf924da[_0xe142('0xad')],'\x20Queue',_0x334e77[_0xe142('0x51')],'pTalking:\x20',_0x334e77[_0xe142('0x2a')]);delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xa9')]];break;case _0xe142('0xb9'):_0x334e77['outboundBusyCallsDay']+=0x1;_0xf924da[_0xe142('0xba')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0x5,_0xe142('0xbb'));ami['emit']('custom:agentbusy',ut[_0xe142('0x9e')](_0xf924da,_0xe142('0xbc')));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xbd'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77['dialGlobalMaxRetry']){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,_0xe142('0xbe'));}else{if(_0xf924da[_0xe142('0xba')]>=_0x334e77[_0xe142('0xbf')]){rpcDb[_0xe142('0x92')](_0xf924da,_0xe142('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0xe142('0xc0')](_0xf924da,'countbusyretry',_0x334e77[_0xe142('0xc1')]),_0xf924da['unlockAgent'],_0xf924da[_0xe142('0xa8')]);}}break;case'NOANSWER':_0x334e77[_0xe142('0x3a')]+=0x1;_0xf924da['countnoanswerretry']+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut['logCustomer'](_0xf924da,0x3,_0xe142('0xc2'));ami['emit'](_0xe142('0xc3'),ut['buildObj'](_0xf924da,_0xe142('0xc4')));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xc5'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xf924da[_0xe142('0xc6')]>=_0x334e77[_0xe142('0xc7')]){rpcDb[_0xe142('0x92')](_0xf924da,_0xe142('0xc5'));}else{rpcDb[_0xe142('0xc8')](ut[_0xe142('0xc0')](_0xf924da,_0xe142('0xc6'),_0x334e77[_0xe142('0xc9')]),_0xf924da[_0xe142('0xa7')],_0xf924da[_0xe142('0xa8')]);}}break;case _0xe142('0xca'):_0x334e77[_0xe142('0xcb')]+=0x1;_0xf924da[_0xe142('0xcc')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut['logCustomer'](_0xf924da,0x8,_0xe142('0xcd'));ami[_0xe142('0x26')](_0xe142('0xce'),ut['buildObj'](_0xf924da,_0xe142('0xcf')));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xd0'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut['cloneAction'](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xf924da[_0xe142('0xcc')]>=_0x334e77['dialCongestionMaxRetry']){rpcDb[_0xe142('0x92')](_0xf924da,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xe142('0xc8')](ut[_0xe142('0xc0')](_0xf924da,_0xe142('0xcc'),_0x334e77['dialBusyRetryFrequency']),_0xf924da['unlockAgent'],_0xf924da[_0xe142('0xa8')]);}}break;case _0xe142('0xd1'):_0x334e77[_0xe142('0x3c')]+=0x1;_0xf924da[_0xe142('0xd2')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut['totalGlobal'](_0xf924da);ut['logCustomer'](_0xf924da,0x14,_0xe142('0xd3'));ami[_0xe142('0x26')](_0xe142('0xd4'),ut[_0xe142('0x9e')](_0xf924da,_0xe142('0xd5')));rpcDb[_0xe142('0x8e')](_0xf924da,'[syncHangupRequest][logAgentReject]');if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0x14,_0xe142('0xd3'));rpcDb[_0xe142('0x92')](_0x88c0a0,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0xf924da[_0xe142('0xd2')]>=_0x334e77[_0xe142('0xd6')]){rpcDb['createCustomerFinal'](_0xf924da,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xe142('0xc8')](ut[_0xe142('0xc0')](_0xf924da,'countagentrejectretry',_0x334e77['dialAgentRejectRetryFrequency']),_0xf924da[_0xe142('0xa7')],_0xf924da[_0xe142('0xa8')]);}}break;case'ABANDONED':_0x334e77[_0xe142('0x3e')]+=0x1;_0xf924da[_0xe142('0xd7')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0xb,_0xe142('0xd8'));rpcDb['createCustomerHistory'](_0xf924da,_0xe142('0xd9'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,_0xe142('0xd9'));}else{if(_0xf924da['countabandonedetry']>=_0x334e77[_0xe142('0xda')]){rpcDb[_0xe142('0x92')](_0xf924da,_0xe142('0xd9'));}else{rpcDb[_0xe142('0xc8')](ut[_0xe142('0xc0')](_0xf924da,_0xe142('0xd7'),_0x334e77[_0xe142('0xdb')]),_0xf924da['unlockAgent'],_0xf924da[_0xe142('0xa8')]);}}break;case'18':_0x334e77['outboundUnknownCallsDay']+=0x1;_0xf924da['countmachineretry']+=0x1;_0xf924da[_0xe142('0x9c')]=ut['totalGlobal'](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0x12,_0x16fa75[_0xe142('0xdc')]||_0x16fa75[_0xe142('0xdd')]);ami[_0xe142('0x26')](_0xe142('0xde'),ut[_0xe142('0x9e')](_0xf924da,_0xe142('0xdf')));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xe0'));if(ut['totalGlobal'](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,_0xe142('0xe0'));}else{rpcDb[_0xe142('0x92')](_0xf924da,_0xe142('0xe0'));}delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xa9')]];break;case'19':_0x334e77[_0xe142('0x3d')]+=0x1;_0xf924da[_0xe142('0x9c')]=ut['totalGlobal'](_0xf924da);ut['logCustomer'](_0xf924da,0x13,_0x16fa75['cause-txt']||_0x16fa75[_0xe142('0xdd')]);ami['emit'](_0xe142('0xde'),ut['buildObj'](_0xf924da,_0xe142('0xdf')));rpcDb[_0xe142('0x8e')](_0xf924da,_0xe142('0xe1'));if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77['dialGlobalMaxRetry']){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,'Global');rpcDb['createCustomerFinal'](_0x88c0a0,_0xe142('0xe1'));}else{rpcDb['createCustomerFinal'](_0xf924da,'[callProgressDetectingCustomer][machine]');}delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xa9')]];break;default:if(_0xf924da[_0xe142('0x7a')]){ut[_0xe142('0x7b')](_0x334e77,_0xe142('0xe2'));ut[_0xe142('0x7c')](_0xe142('0xe3')+_0x334e77[_0xe142('0x51')],_0x16fa75);}_0x334e77['outboundUnknownCallsDay']+=0x1;_0xf924da[_0xe142('0x9c')]=ut[_0xe142('0x9d')](_0xf924da);ut[_0xe142('0x8b')](_0xf924da,0xc,_0x16fa75['cause-txt']||_0x16fa75[_0xe142('0xdd')]);rpcDb['createCustomerHistory'](_0xf924da,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xe142('0x9d')](_0xf924da)>=_0x334e77[_0xe142('0xa1')]){_0x88c0a0=ut[_0xe142('0xa2')](_0xf924da,0xf,_0xe142('0xa3'));rpcDb[_0xe142('0x92')](_0x88c0a0,_0xe142('0xe4'));}else{rpcDb[_0xe142('0x92')](_0xf924da,_0xe142('0xe4'));}delete this['actions'][_0x16fa75[_0xe142('0xa9')]];}if(!(_0xf924da[_0xe142('0x7a')]&&_0x5e3fde==='16')){ut['updateOriginated'](_0x334e77,'[callProgressDetectingCustomer]');logger[_0xe142('0x6b')](_0xe142('0xe5'),_0xf924da[_0xe142('0xad')],'\x20Queue',_0x334e77[_0xe142('0x51')],_0xe142('0x6f'),_0x334e77[_0xe142('0x5a')]);}if(_0x5e3fde!==_0xe142('0xaa')){delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xa9')]];delete this[_0xe142('0x17')][_0x16fa75[_0xe142('0xe6')]];}}};Preview[_0xe142('0x10')]['callProgressDetectingAgent']=function(_0x30ea58,_0x54973e,_0x14f82c){if(_[_0xe142('0xe7')](_0x54973e)&&_0xe142('0xe8')!==typeof _0x54973e){return;}if(_[_0xe142('0xe7')](_0x14f82c)&&'object'!==typeof _0x14f82c){return;}switch(_0x14f82c[_0xe142('0xe9')]){case'0':ut[_0xe142('0xea')](_0x30ea58,0x0,_0xe142('0xeb'));rpcDb[_0xe142('0xec')](_0x30ea58,_0xe142('0xed'));break;case'3':ut[_0xe142('0xea')](_0x30ea58,0x3,'NoAnswer');rpcDb[_0xe142('0xec')](_0x30ea58,_0xe142('0xee'));break;case'5':ut[_0xe142('0xea')](_0x30ea58,0x5,_0xe142('0xbb'));rpcDb[_0xe142('0xec')](_0x30ea58,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe142('0xea')](_0x30ea58,0x8,'Congestion');rpcDb[_0xe142('0xec')](_0x30ea58,_0xe142('0xef'));break;case'22':ut[_0xe142('0xea')](_0x30ea58,0x16,_0xe142('0xf0'));rpcDb['createAgentHistory'](_0x30ea58,_0xe142('0xf1'));break;default:ut[_0xe142('0xea')](_0x30ea58,0xc,_0x14f82c[_0xe142('0xe9')]);rpcDb['createAgentHistory'](_0x30ea58,_0xe142('0xef'));}ut['updateOriginated'](_0x54973e,'[callProgressDetectingAgent]');logger['info'](_0xe142('0xf2'),_0x30ea58[_0xe142('0xad')],'\x20Queue',_0x54973e['name'],_0xe142('0x6f'),_0x54973e['originated']);delete this[_0xe142('0x17')][_0x30ea58['uniqueid']];};Preview[_0xe142('0x10')]['checkInBlack']=function(_0x336a21,_0x4f8162,_0x2f3ceb,_0x3ae187,_0x4a6444){var _0x169b59=this;return new BPromise(function(_0x227c8e,_0xaedaba){if(_['isNil'](_0x4f8162)||_[_0xe142('0x6a')](_0x4f8162['Contact'])||_[_0xe142('0x6a')](_0x4f8162[_0xe142('0xf3')][_0xe142('0xf4')])||_[_0xe142('0x6a')](_0x4f8162[_0xe142('0x74')])){_0xaedaba(ut[_0xe142('0x48')]('Contact\x20is\x20undefined',_0x3ae187,_0x4a6444));return;}var _0x286fb4=uuid['v4']();var _0x17508=_0x169b59['campaignsPreview'][_0x4f8162[_0xe142('0x6d')][_0xe142('0x51')]];var _0x251253=_0x2f3ceb?_0x169b59[_0xe142('0x18')][_0x2f3ceb]['id']:undefined;_0x169b59[_0xe142('0x17')][_0x286fb4]=new Action(_0x4f8162,_0x17508,_0x286fb4,_0x2f3ceb,_0x251253);var _0x49a442=_0x169b59[_0xe142('0x17')][_0x286fb4];_0x49a442[_0xe142('0xa7')]=_0x3ae187;_0x49a442[_0xe142('0xa8')]=_0x4a6444;_0x49a442['lookAgent']=_0x2f3ceb;if(_[_0xe142('0xf5')](_0x336a21)){_0x169b59[_0xe142('0xf6')](_0x49a442,_0x17508,_0x4f8162,_0x2f3ceb)[_0xe142('0xf7')](function(_0x7caef5){logger[_0xe142('0x6b')](_0xe142('0xf8'),_0xe142('0xf9')+_0x49a442[_0xe142('0x6e')]+_0xe142('0xfa')+_0x49a442['idContact'],JSON[_0xe142('0x52')](_0x7caef5));ami[_0xe142('0x26')]('custom:agentcalled',ut[_0xe142('0x9e')](_0x49a442,_0xe142('0xfb'),_0x169b59[_0xe142('0x70')][_0x49a442[_0xe142('0x6e')]]));_0x227c8e(ut['message']('Calling'));})[_0xe142('0x78')](function(_0x21b1c0){ut['logger']('[Preview][execCall][failure]',_0x21b1c0);_0xaedaba(ut[_0xe142('0x48')](_0xe142('0xfc'),_0x3ae187,_0x4a6444));});}else{_0x17508['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x49a442);rpcDb[_0xe142('0xfd')](_0x49a442,'[Blacklist][error]');delete _0x169b59[_0xe142('0x17')][_0x286fb4];_0xaedaba(ut[_0xe142('0x48')](_0xe142('0xfe'),_0x3ae187,_0x4a6444));}});};Preview[_0xe142('0x10')]['isTrunkReachable']=function(_0x8a6646){return!_['isNil'](_0x8a6646)&&!_[_0xe142('0x6a')](_0x8a6646[_0xe142('0x51')])&&!_[_0xe142('0x6a')](_0x8a6646[_0xe142('0x4f')])&&_0x8a6646[_0xe142('0x4f')]&&!_[_0xe142('0x6a')](this[_0xe142('0x16')][util[_0xe142('0x53')]('SIP/%s',_0x8a6646['name'])])&&!_[_0xe142('0x6a')](this[_0xe142('0x16')][util['format']('SIP/%s',_0x8a6646[_0xe142('0x51')])]['status'])&&(this[_0xe142('0x16')][util[_0xe142('0x53')](_0xe142('0xff'),_0x8a6646['name'])][_0xe142('0x100')]===_0xe142('0x101')||this['trunks'][util[_0xe142('0x53')]('SIP/%s',_0x8a6646['name'])][_0xe142('0x100')]===_0xe142('0x102'));};Preview[_0xe142('0x10')][_0xe142('0x103')]=function(_0x205e05,_0x32d968){var _0x10ecc8=this;return new BPromise(function(_0x3d6775,_0x59dccb){_0x10ecc8['execRun'](_0x205e05,_0x32d968)[_0xe142('0xf7')](function(_0x6d9690){_0x3d6775(_['pick'](_0x6d9690,[_0xe142('0x48')]));})['catch'](function(_0x43ea78){if(_0x43ea78[_0xe142('0x104')]){rpcDb['unlockContact'](_0x205e05);}if(_0x43ea78[_0xe142('0x4f')]){rpcDb[_0xe142('0x88')](_0x205e05);}_0x59dccb(_[_0xe142('0x72')](_0x43ea78,[_0xe142('0x48')]));});});};Preview[_0xe142('0x10')]['execRun']=function(_0x486591,_0x3871c2){var _0x3f3f87=this;return new BPromise(function(_0x5bf8c5,_0x3c1b76){var _0x2695da,_0x5d4a31;rpcDb[_0xe142('0x105')](_0x486591)[_0xe142('0xf7')](function(_0x2216d6){if(!_['isNil'](_0x2216d6[0x0])){_0x5d4a31=_0x2216d6[0x0][_0xe142('0x106')]?![]:!![];_0x2695da=_0x2216d6[0x0][_0xe142('0x106')]?!![]:![];_0x2695da=_0x3871c2?!![]:_0x2695da;}var _0x5c2160=_0x3f3f87[_0xe142('0x107')](_0x2216d6);if(_0x5c2160[_0xe142('0x108')]){rpcDb['checkIsBlackList'](_[_0xe142('0x72')](_0x2216d6[0x0],[_0xe142('0x74'),_0xe142('0x109')]))[_0xe142('0xf7')](function(_0x57218a){_0x3f3f87[_0xe142('0x10a')](_0x57218a,_0x2216d6[0x0],_0x3871c2,_0x5d4a31,_0x2695da)['then'](function(_0x347857){_0x5bf8c5(_0x347857);})[_0xe142('0x78')](function(_0x5cd901){_0x3c1b76(_0x5cd901);});})[_0xe142('0x78')](function(_0xc548f5){ut['logger'](_0xe142('0x10b'),_0xc548f5);_0x3c1b76(ut['message'](_0xe142('0x10c'),_0x5d4a31,_0x2695da));});}else{_0x3c1b76(ut[_0xe142('0x48')](_0x5c2160['message'],_0x5d4a31,_0x2695da));}})[_0xe142('0x78')](function(_0x3aceae){ut[_0xe142('0x5d')](_0xe142('0x10d'),_0x3aceae);_0x3c1b76(ut[_0xe142('0x48')](_0xe142('0x10c'),![],!![]));});});};Preview[_0xe142('0x10')]['validateContact']=function(_0x9cfd3a){if(_[_0xe142('0x6a')](_0x9cfd3a)||_[_0xe142('0xf5')](_0x9cfd3a)||!_[_0xe142('0x6a')](_0x9cfd3a[0x0]['Agent'])&&_['isNil'](_0x9cfd3a[0x0]['Agent'][_0xe142('0x51')])){ut[_0xe142('0x5d')](_0xe142('0x10e'),_0x9cfd3a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x219b6d=this[_0xe142('0x70')][_0x9cfd3a[0x0][_0xe142('0x6d')]['name']];_0x219b6d[_0xe142('0x48')]=_0xe142('0x99');if(_[_0xe142('0x6a')](_0x219b6d)){ut[_0xe142('0x5d')](_0xe142('0x10f'),_0x219b6d);return{'isValid':![],'message':_0xe142('0x110')};}if(!this[_0xe142('0x97')](_0x219b6d['Trunk'])){ut[_0xe142('0x5d')](_0xe142('0x111'),_0xe142('0x112')+_0x219b6d[_0xe142('0x51')]+_0xe142('0x113'));if(!this['isTrunkReachable'](_0x219b6d[_0xe142('0x114')])){ut[_0xe142('0x5d')](_0xe142('0x111'),_0x219b6d['name']+_0xe142('0x115'));return{'isValid':![],'message':_0xe142('0x116')};}}if(!ut[_0xe142('0x96')](_0x219b6d['dialActive'])){ut[_0xe142('0x5d')](_0xe142('0x117'),_0x219b6d[_0xe142('0x51')]+_0xe142('0x118'));return{'isValid':![],'message':_0xe142('0x112')+_0x219b6d[_0xe142('0x51')]+_0xe142('0x118')};}return{'isValid':!![],'message':_0xe142('0x119')};};Preview['prototype'][_0xe142('0xf6')]=function(_0x396cf4,_0xa1904c,_0x2ae668,_0x29ecf8){var _0x183b7a=this;return new BPromise(function(_0x277bcc,_0x59395e){var _0x468e9e=_0x396cf4[_0xe142('0xad')];var _0x800bab=_0x183b7a[_0xe142('0x97')](_0xa1904c[_0xe142('0x4e')])?util[_0xe142('0x53')](_0xe142('0x11a'),_0xa1904c[_0xe142('0x4e')]['name'],_['isNil'](_0xa1904c[_0xe142('0x35')])?'':_0xa1904c[_0xe142('0x35')][_0xe142('0x11b')]()||'',_0xa1904c[_0xe142('0x11c')]>0x0?_0x2ae668[_0xe142('0xf3')]['phone']['substring'](_0xa1904c[_0xe142('0x11c')]):_0x2ae668[_0xe142('0xf3')][_0xe142('0xf4')]):util['format'](_0xe142('0x11a'),_['isNil'](_0xa1904c['TrunkBackup'])?_0xa1904c['Trunk'][_0xe142('0x51')]:_0xa1904c[_0xe142('0x114')]['name'],_[_0xe142('0x6a')](_0xa1904c['dialPrefix'])?'':_0xa1904c[_0xe142('0x35')][_0xe142('0x11b')]()||'',_0xa1904c[_0xe142('0x11c')]>0x0?_0x2ae668[_0xe142('0xf3')][_0xe142('0xf4')][_0xe142('0x11d')](_0xa1904c['dialCutDigit']):_0x2ae668[_0xe142('0xf3')][_0xe142('0xf4')]);var _0x27a7df=_0x183b7a['isTrunkReachable'](_0xa1904c['Trunk'])?ut[_0xe142('0x11e')](_0xa1904c[_0xe142('0x4e')]['callerid'],_0xa1904c[_0xe142('0x33')],_0xa1904c['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xe142('0x11f')](_0xa1904c['dialOriginateCallerIdNumber'],_0xa1904c[_0xe142('0x120')]):_0xa1904c['dialOriginateCallerIdNumber']):ut[_0xe142('0x11e')](_['isNil'](_0xa1904c[_0xe142('0x114')])?_0xa1904c[_0xe142('0x4e')][_0xe142('0x121')]:_0xa1904c[_0xe142('0x114')][_0xe142('0x121')],_0xa1904c[_0xe142('0x33')],_0xa1904c[_0xe142('0x120')]>0x0?ut[_0xe142('0x11f')](_0xa1904c[_0xe142('0x122')],_0xa1904c[_0xe142('0x120')]):_0xa1904c[_0xe142('0x122')]);if(_0x27a7df){_0x396cf4['originatecalleridname']=ut['extractCalleridName'](_0x27a7df);_0x396cf4['originatecalleridnum']=ut[_0xe142('0x123')](_0x27a7df);}var _0x3edd48=ut[_0xe142('0x124')](_0xa1904c,_0x2ae668,_0x800bab,_0x27a7df,_0x468e9e,_0x396cf4);_['merge'](_0x396cf4,ut['toLowerVariables'](_0x3edd48));_0x396cf4[_0xe142('0x89')]=moment()[_0xe142('0x53')](_0xe142('0xab'));ami['Action'](ut[_0xe142('0x125')](_0x396cf4,_0xa1904c,_0x3edd48,_0x396cf4[_0xe142('0xa8')],_0x29ecf8))[_0xe142('0xf7')](function(_0x40c6ad){var _0x333fc8=_0x396cf4[_0xe142('0x126')];if(!_['isNil'](_0x333fc8)){if(!_[_0xe142('0x6a')](_0x183b7a[_0xe142('0x18')][_0x333fc8])){_0x183b7a['agents'][_0x333fc8][_0xe142('0x127')]=_0x396cf4[_0xe142('0x128')];emit(util[_0xe142('0x53')](_0xe142('0x129'),_0x183b7a['agents'][_0x333fc8][_0xe142('0x51')]),_0xe142('0x12a'),{'destaccountcode':_0x183b7a[_0xe142('0x18')][_0x333fc8][_0xe142('0x12b')],'destconnectedlinenum':_0x396cf4[_0xe142('0x128')]});}}_0xa1904c[_0xe142('0x5a')]+=0x1;logger[_0xe142('0x6b')](_0xe142('0x12c'),_0x468e9e,_0xe142('0xae'),_0xa1904c[_0xe142('0x51')],'originated:\x20',_0xa1904c['originated']);_0x277bcc(_0x40c6ad);})[_0xe142('0x78')](function(_0x21d741){ut[_0xe142('0xea')](_0x396cf4,0xe,'OriginateError');rpcDb[_0xe142('0xec')](_0x396cf4,_0xe142('0x12d'));_0x59395e(_0x21d741);});});};Preview['prototype'][_0xe142('0x1f')]=function(_0x5b6f6d){if(this[_0xe142('0x17')][_0x5b6f6d[_0xe142('0xa9')]]){this[_0xe142('0x17')][_0x5b6f6d[_0xe142('0xa9')]]['channel']=_0x5b6f6d[_0xe142('0x77')];}};Preview[_0xe142('0x10')][_0xe142('0x12e')]=function(_0x4265de){var _0x3b5df2=this;var _0x4ce7c7=this[_0xe142('0x17')][_0x4265de['actionid']];if(_0x4ce7c7){if(_0x4ce7c7[_0xe142('0x12f')]&&this[_0xe142('0x18')][_0x4ce7c7[_0xe142('0x12f')]]){ut[_0xe142('0x130')](_0x4ce7c7,this[_0xe142('0x18')][_0x4ce7c7['lookAgent']][_0xe142('0x51')],this[_0xe142('0x18')][_0x4ce7c7[_0xe142('0x12f')]]['id']);}var _0x46ca8c=_['clone'](_0x4ce7c7);_0x46ca8c[_0xe142('0x131')]=moment()['format'](_0xe142('0xab'));var _0x53df93=_0x3b5df2[_0xe142('0x70')][_0x4ce7c7[_0xe142('0x6e')]];if(ut['isFailure'](_0x4265de[_0xe142('0x132')])){if(_0x4ce7c7[_0xe142('0xa7')]){rpcDb[_0xe142('0x133')](_0x4ce7c7[_0xe142('0x134')]);}if(_0x4ce7c7[_0xe142('0xa8')]){rpcDb['disableContact'](_0x4ce7c7['idContact']);}ami[_0xe142('0x26')]('custom:agentringnoanswer',ut[_0xe142('0x9e')](_0x4ce7c7,_0xe142('0x135'),this[_0xe142('0x70')][_0x4ce7c7[_0xe142('0x6e')]]));this['callProgressDetectingAgent'](_0x46ca8c,_0x53df93,_0x4265de);}else{_0x4ce7c7['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x46ca8c,0x4,'Answer');rpcDb[_0xe142('0xec')](_0x46ca8c,_0xe142('0x136'));}}};Preview[_0xe142('0x10')]['syncHangup']=function(_0x23e98d){var _0x1d9736=this;var _0x5ea668=this[_0xe142('0x17')][_0x23e98d[_0xe142('0xa9')]];var _0x16b631;if(_0x5ea668){_0x16b631=this[_0xe142('0x70')][_0x5ea668[_0xe142('0x6e')]];logger[_0xe142('0x6b')](_0xe142('0x137'),_0x23e98d[_0xe142('0xa9')],_0xe142('0xae'),_0x16b631[_0xe142('0x51')],_0xe142('0x71'),_0x16b631[_0xe142('0x2a')]);}if(this['actions'][_0x23e98d[_0xe142('0xa9')]]&&_0x23e98d[_0xe142('0xa9')]!==_0x23e98d[_0xe142('0xad')]){if(_0x23e98d[_0xe142('0x138')]==='16'&&this['actions'][_0x23e98d['linkedid']][_0xe142('0x7a')]){this[_0xe142('0x9a')](_0x23e98d,_0x23e98d[_0xe142('0xa9')],_0x23e98d[_0xe142('0x138')]);}else if(this['actions'][_0x23e98d[_0xe142('0xa9')]][_0xe142('0x7a')]){logger[_0xe142('0x6b')](_0xe142('0x139'),_0x23e98d['linkedid'],_0x23e98d[_0xe142('0x138')],_0xe142('0xae'),_0x16b631['name'],_0xe142('0x71'),_0x16b631[_0xe142('0x2a')]);this[_0xe142('0x9a')](_0x23e98d,_0x23e98d[_0xe142('0xa9')],_0x23e98d[_0xe142('0x138')]);}}else if(_0x5ea668&&_[_0xe142('0x6a')](_0x5ea668['statedesc'])&&_0x16b631[_0xe142('0x13a')]&&_0x23e98d[_0xe142('0xa9')]===_0x23e98d[_0xe142('0xad')]&&_[_0xe142('0x6a')](_0x23e98d[_0xe142('0xe9')])&&_0x23e98d[_0xe142('0x138')]==='16'&&_0x23e98d[_0xe142('0x13b')]==='6'&&_[_0xe142('0xe7')](_0x5ea668[_0xe142('0x13c')])){if(_0x5ea668[_0xe142('0xa7')]){rpcDb[_0xe142('0x133')](_0x5ea668[_0xe142('0x134')]);}if(_0x5ea668[_0xe142('0xa8')]){rpcDb[_0xe142('0x88')](_0x5ea668[_0xe142('0x134')]);}_0x23e98d[_0xe142('0xe9')]='22';this['callProgressDetectingAgent'](_0x5ea668,_0x16b631,_0x23e98d);}else if(_0x5ea668&&_0x5ea668[_0xe142('0x13c')]){if(_0x23e98d[_0xe142('0x138')]==='16'&&this[_0xe142('0x17')][_0x23e98d['linkedid']][_0xe142('0x7a')]){logger[_0xe142('0x6b')](_0xe142('0x13d'),_0x23e98d[_0xe142('0xa9')],_0x23e98d[_0xe142('0x138')],'\x20Queue',_0x16b631['name'],_0xe142('0x71'),_0x16b631[_0xe142('0x2a')]);this[_0xe142('0x9a')](_0x23e98d,_0x23e98d[_0xe142('0xa9')],_0x23e98d[_0xe142('0x138')]);}else if(this[_0xe142('0x17')][_0x23e98d[_0xe142('0xa9')]][_0xe142('0x7a')]){logger[_0xe142('0x6b')](_0xe142('0x139'),_0x23e98d[_0xe142('0xa9')],_0x23e98d[_0xe142('0x138')],'\x20Queue',_0x16b631[_0xe142('0x51')],_0xe142('0x71'),_0x16b631[_0xe142('0x2a')]);this[_0xe142('0x9a')](_0x23e98d,_0x23e98d['linkedid'],_0x23e98d[_0xe142('0x138')]);}}};Preview[_0xe142('0x10')][_0xe142('0x1e')]=function(_0x5c2e18){if(this[_0xe142('0x17')][_0x5c2e18['destlinkedid']]&&_0x5c2e18['destlinkedid']!==_0x5c2e18[_0xe142('0x13e')]){this[_0xe142('0x9a')](_0x5c2e18,_0x5c2e18['destlinkedid'],_0x5c2e18[_0xe142('0xdd')]);}};Preview['prototype'][_0xe142('0x1c')]=function(_0x144902){if(this['actions'][_0x144902[_0xe142('0xa9')]]&&_0x144902[_0xe142('0xa9')]!==_0x144902[_0xe142('0xad')]&&!this[_0xe142('0x17')][_0x144902[_0xe142('0xa9')]][_0xe142('0x7a')]){if(_0x144902['cause']==='1'){this[_0xe142('0x9a')](_0x144902,_0x144902['linkedid'],_0x144902[_0xe142('0x138')]);}}};Preview[_0xe142('0x10')][_0xe142('0x13f')]=function(_0x583966,_0x58e22f,_0x337757){if(this['actions'][_0x583966]){if(_[_0xe142('0x6a')](this[_0xe142('0x17')][_0x583966]['variables'])){this[_0xe142('0x17')][_0x583966]['variables']={};}this[_0xe142('0x17')][_0x583966]['variables'][_0x58e22f]=_0x337757;}};Preview[_0xe142('0x10')][_0xe142('0x21')]=function(_0xff7db0){try{if(!_[_0xe142('0x6a')](_0xff7db0)){if(ut[_0xe142('0x140')](_[_0xe142('0x141')](_0xff7db0[_0xe142('0x142')])[0x0])){this[_0xe142('0x13f')](_0xff7db0[_0xe142('0xad')],_[_0xe142('0x141')](_0xff7db0[_0xe142('0x142')])[0x0],_0xff7db0[_0xe142('0x143')]);}}}catch(_0x2f0ae5){logger[_0xe142('0x144')](_0xe142('0x145'),util[_0xe142('0x146')](_0x2f0ae5,{'showHidden':![],'depth':null}));}};Preview[_0xe142('0x10')]['syncAttendedTransfer']=function(_0x590809){if(_0x590809){if(this[_0xe142('0x17')][_0x590809[_0xe142('0x147')]]){this[_0xe142('0x17')][_0x590809[_0xe142('0x147')]][_0xe142('0x13c')]=!![];}}};Preview[_0xe142('0x10')][_0xe142('0x25')]=function(_0x5190f2){if(_0x5190f2){if(this[_0xe142('0x17')][_0x5190f2['transfererlinkedid']]){this[_0xe142('0x17')][_0x5190f2[_0xe142('0x148')]][_0xe142('0x13c')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x79fd=['[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','substring','SIP/%s/%s%s','trim','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','addVariables','merge','channelAgent','destconnectedlinenum','user:%s','user:agentconnect','accountcode','calleridnum','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','idContact','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','campaignsPreview','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','catch','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','complete','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','Busy','[callProgressDetectingAgent][logBusy]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall'];(function(_0x571a71,_0x3933bb){var _0x622df3=function(_0x46fc9d){while(--_0x46fc9d){_0x571a71['push'](_0x571a71['shift']());}};_0x622df3(++_0x3933bb);}(_0x79fd,0x1ae));var _0xd79f=function(_0x362636,_0x5d23d9){_0x362636=_0x362636-0x0;var _0x4b868d=_0x79fd[_0x362636];return _0x4b868d;};'use strict';var util=require(_0xd79f('0x0'));var _=require('lodash');var BPromise=require(_0xd79f('0x1'));var uuid=require(_0xd79f('0x2'));var moment=require(_0xd79f('0x3'));var md5=require(_0xd79f('0x4'));var Redis=require(_0xd79f('0x5'));var config=require(_0xd79f('0x6'));var logger=require(_0xd79f('0x7'))(_0xd79f('0x8'));var loggerAction=require(_0xd79f('0x7'))(_0xd79f('0x9'));var ami=require(_0xd79f('0xa'));var rpcDb=require(_0xd79f('0xb'));var Action=require(_0xd79f('0xc'));var ut=require(_0xd79f('0xd'));config[_0xd79f('0xe')]=_[_0xd79f('0xf')](config[_0xd79f('0xe')],{'host':_0xd79f('0x10'),'port':0x18eb});var io=require(_0xd79f('0x11'))(new Redis(config[_0xd79f('0xe')]));var Sequence=function(){};Sequence[_0xd79f('0x12')][_0xd79f('0x13')]=function(_0x2acd34){this[_0xd79f('0x14')]=this['tail']?this[_0xd79f('0x14')][_0xd79f('0x15')](_0x2acd34):_0x2acd34();};function Preview(_0x53584c){this[_0xd79f('0x16')]=new Sequence();this['campaignsPreview']=_0x53584c[_0xd79f('0x17')];this[_0xd79f('0x18')]=_0x53584c[_0xd79f('0x18')];this[_0xd79f('0x19')]={};this[_0xd79f('0x1a')]=_0x53584c[_0xd79f('0x1a')];this[_0xd79f('0x1b')]=0x0;ami['on']('originateresponse',this[_0xd79f('0x1c')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x1e'),this[_0xd79f('0x1f')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x20'),this['syncHangupRequest'][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x21'),this['syncDialEnd'][_0xd79f('0x1d')](this));ami['on']('newexten',this[_0xd79f('0x22')]['bind'](this));ami['on'](_0xd79f('0x23'),this['syncVarSet'][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x24'),this[_0xd79f('0x25')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x26'),this['syncBlindTransfer'][_0xd79f('0x1d')](this));this[_0xd79f('0x27')](this['campaignsPreview']);}function emit(_0x17c5ce,_0x1b1cf3,_0x563b3f){io['to'](_0x17c5ce)[_0xd79f('0x28')](_0x1b1cf3,_0x563b3f);}function emitCampaignPreview(_0x4bdf01){if(_0x4bdf01[_0xd79f('0x29')]===_0xd79f('0x2a')){var _0xc98927={'id':_0x4bdf01['id'],'name':_0x4bdf01[_0xd79f('0x2b')],'strategy':_0x4bdf01[_0xd79f('0x2c')],'answered':_0x4bdf01[_0xd79f('0x2d')],'available':_0x4bdf01['available'],'loggedIn':_0x4bdf01[_0xd79f('0x2e')],'pTalking':_0x4bdf01[_0xd79f('0x2f')],'sumBillable':_0x4bdf01[_0xd79f('0x30')],'sumDuration':_0x4bdf01[_0xd79f('0x31')],'sumHoldTime':_0x4bdf01[_0xd79f('0x32')]||0x0,'talking':_0x4bdf01['talking'],'total':_0x4bdf01[_0xd79f('0x33')],'type':_0x4bdf01[_0xd79f('0x29')],'unmanaged':_0x4bdf01['unmanaged'],'abandoned':_0x4bdf01[_0xd79f('0x34')],'waiting':_0x4bdf01[_0xd79f('0x35')],'loggedInDb':_0x4bdf01[_0xd79f('0x36')],'dialActive':_0x4bdf01[_0xd79f('0x37')],'dialMethod':_0x4bdf01[_0xd79f('0x38')],'dialOriginateCallerIdName':_0x4bdf01[_0xd79f('0x39')],'dialOriginateCallerIdNumber':_0x4bdf01[_0xd79f('0x3a')],'dialOriginateTimeout':_0x4bdf01[_0xd79f('0x3b')],'dialPrefix':_0x4bdf01['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4bdf01[_0xd79f('0x3c')],'outboundAnswerCallsDay':_0x4bdf01[_0xd79f('0x3d')],'outboundBlacklistCallsDay':_0x4bdf01['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4bdf01[_0xd79f('0x3e')],'outboundCongestionCallsDay':_0x4bdf01['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4bdf01['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4bdf01[_0xd79f('0x3f')],'outboundDropCallsDayTimeout':_0x4bdf01[_0xd79f('0x40')],'outboundNoAnswerCallsDay':_0x4bdf01[_0xd79f('0x41')],'outboundNoSuchCallsDay':_0x4bdf01[_0xd79f('0x42')],'outboundOriginateFailureCallsDay':_0x4bdf01['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4bdf01[_0xd79f('0x43')],'outboundRejectCallsDay':_0x4bdf01['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4bdf01[_0xd79f('0x44')],'outboundAbandonedCallsDay':_0x4bdf01['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4bdf01[_0xd79f('0x45')],'predictiveIntervalAvgHoldtime':_0x4bdf01['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4bdf01[_0xd79f('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x4bdf01['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4bdf01[_0xd79f('0x47')],'predictiveIntervalErlangCalls':_0x4bdf01[_0xd79f('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x4bdf01[_0xd79f('0x49')],'predictiveIntervalHitRate':_0x4bdf01['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4bdf01['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4bdf01[_0xd79f('0x4a')],'predictiveIntervalAvailable':_0x4bdf01[_0xd79f('0x4b')],'predictiveIntervalTotalCalls':_0x4bdf01['predictiveIntervalTotalCalls'],'message':_0x4bdf01['message'],'originated':_0x4bdf01[_0xd79f('0x4c')],'erlangCalls':_0x4bdf01[_0xd79f('0x4d')],'erlangCallToSecond':_0x4bdf01[_0xd79f('0x4e')],'erlangAbandonmentRate':_0x4bdf01[_0xd79f('0x4f')],'erlangBusyFactor':_0x4bdf01['erlangBusyFactor'],'startPredictive':_0x4bdf01[_0xd79f('0x50')],'startProgressive':_0x4bdf01[_0xd79f('0x51')]};if(_0x4bdf01[_0xd79f('0x52')]){_0xc98927[_0xd79f('0x52')]={'id':_0x4bdf01[_0xd79f('0x52')]['id'],'name':_0x4bdf01[_0xd79f('0x52')][_0xd79f('0x2b')],'active':_0x4bdf01[_0xd79f('0x52')]['active'],'callerid':_0x4bdf01['Trunk']['callerid']};}if(_0x4bdf01['Interval']){_0xc98927[_0xd79f('0x53')]={'id':_0x4bdf01[_0xd79f('0x53')]['id'],'name':_0x4bdf01[_0xd79f('0x53')][_0xd79f('0x2b')]};}var _0x2eae2f=md5(JSON[_0xd79f('0x54')](_0xc98927));if(_0x4bdf01['md5']!==_0x2eae2f){_0x4bdf01[_0xd79f('0x4')]=_0x2eae2f;emit(util[_0xd79f('0x55')](_0xd79f('0x56'),_0xc98927[_0xd79f('0x2b')]),_0xd79f('0x57'),_0xc98927);}}}function emitVoiceQueueChannelRemove(_0x225dea){logger[_0xd79f('0x58')](_0xd79f('0x59'),JSON[_0xd79f('0x54')](_0x225dea));emit(util['format']('voice:queue:%s',_0x225dea[_0xd79f('0x2b')]),_0xd79f('0x5a'),_0x225dea);io[_0xd79f('0x28')](_0xd79f('0x5b'),_0x225dea);}function notSendMessagesQueue(_0x3b3023){if(_0x3b3023[_0xd79f('0x5c')]){if(_0x3b3023['originated']===0x0&&_0x3b3023[_0xd79f('0x2f')]===0x0){_0x3b3023[_0xd79f('0x5c')]=![];_0x3b3023[_0xd79f('0x5d')]=0x0;_0x3b3023[_0xd79f('0x5e')]=0x0;_0x3b3023[_0xd79f('0x5f')]=_0xd79f('0x60');ut[_0xd79f('0x61')](_0xd79f('0x62'),_0x3b3023[_0xd79f('0x2b')]+'\x20is\x20not\x20active');}else{_0x3b3023[_0xd79f('0x5f')]=_0xd79f('0x63');ut[_0xd79f('0x61')](_0xd79f('0x62'),_0x3b3023[_0xd79f('0x2b')]+'\x20is\x20disactive');}emitCampaignPreview(_0x3b3023);}}Preview[_0xd79f('0x12')][_0xd79f('0x27')]=function(){var _0x2568c9=this;setInterval(function(){_0x2568c9[_0xd79f('0x64')]();},0x7cf);};Preview['prototype'][_0xd79f('0x64')]=function(){var _0x3da263=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x315df1 in _0x3da263){if(_0x3da263[_0xd79f('0x65')](_0x315df1)&&(_0x3da263[_0x315df1][_0xd79f('0x38')]===_0xd79f('0x8')||_0x3da263[_0x315df1]['dialMethod']===_0xd79f('0x66'))&&_0x3da263[_0x315df1]['type']===_0xd79f('0x2a')){if(this[_0xd79f('0x1b')]>0x7){this[_0xd79f('0x1b')]=0x0;this[_0xd79f('0x67')]();}}if(_0x3da263[_0xd79f('0x65')](_0x315df1)&&_0x3da263[_0x315df1]['dialMethod']==='preview'&&_0x3da263[_0x315df1][_0xd79f('0x29')]==='outbound'){if(_0x3da263[_0x315df1][_0xd79f('0x37')]){this[_0xd79f('0x68')](_0x3da263[_0x315df1]);this[_0xd79f('0x69')](_0x3da263[_0x315df1]);}else{notSendMessagesQueue(_0x3da263[_0x315df1]);}}}};Preview[_0xd79f('0x12')][_0xd79f('0x6a')]=function(_0x1c1626){var _0x21d1d2=this;this[_0xd79f('0x16')][_0xd79f('0x13')](function(){if(!_[_0xd79f('0x6b')](_0x21d1d2['actions'][_0x1c1626])){loggerAction[_0xd79f('0x58')](_0xd79f('0x6c'),_0x1c1626,_0xd79f('0x6d'),_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x6e')],_0xd79f('0x6f'),JSON['stringify'](_0x21d1d2['campaignsPreview'][_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]][_0xd79f('0x4c')]),_0xd79f('0x70'),JSON[_0xd79f('0x54')](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2['actions'][_0x1c1626]['queue']]['pTalking']),JSON[_0xd79f('0x54')](_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x72')]),JSON['stringify'](_[_0xd79f('0x73')](_0x21d1d2[_0xd79f('0x19')][_0x1c1626],[_0xd79f('0x74'),_0xd79f('0x75'),_0xd79f('0x76'),_0xd79f('0x77')])));return ami[_0xd79f('0x78')]({'action':_0xd79f('0x79'),'channel':_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x7a')]})['catch'](function(_0x53700c){if(_0x53700c['message']===_0xd79f('0x7b')){setTimeout(function(){if(_0x21d1d2['actions'][_0x1c1626]){ut['updateOriginated'](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x6e')]],'[clearZombieChannel]');if(_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x72')]===!![]){ut['decrementTalkink'](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]],_0xd79f('0x7c'));ut[_0xd79f('0x7d')](_0xd79f('0x7e')+_0x1c1626,_0x21d1d2['actions'][_0x1c1626]['queue']);}ut[_0xd79f('0x7d')]('[Dialer][checkChannel][Preview]'+_0x1c1626,_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]);delete _0x21d1d2['actions'][_0x1c1626];}},0x2328);}});}});};Preview[_0xd79f('0x12')][_0xd79f('0x67')]=function(){var _0x34862f=this;loggerAction[_0xd79f('0x58')]('[action]',_[_0xd79f('0x7f')](this['actions']));for(var _0x2663b7 in this['actions']){if(_0x34862f[_0xd79f('0x19')][_0xd79f('0x65')](_0x2663b7)){_0x34862f['clearZombieChannel'](_0x2663b7);}}};Preview[_0xd79f('0x12')]['recallMe']=function(_0x4dc964){var _0x1c033e=this;rpcDb[_0xd79f('0x80')](_0x4dc964['id'],ut[_0xd79f('0x81')](this[_0xd79f('0x1a')]))[_0xd79f('0x82')](function(_0x503d00){if(!_['isNil'](_0x503d00)){for(var _0x20dd01=0x0;_0x20dd01<_0x503d00[_0xd79f('0x83')];_0x20dd01+=0x1){if(ut['getDiff'](_0x503d00[_0x20dd01][_0xd79f('0x84')])<_0x4dc964[_0xd79f('0x85')]*0x3c){if(_0x503d00[_0x20dd01][_0xd79f('0x86')]&&!_0x503d00[_0x20dd01][_0xd79f('0x86')][_0xd79f('0x87')]){_0x1c033e['run'](_0x503d00[_0x20dd01]['id'])['then'](ut['logger2']('[RecallMe]'))[_0xd79f('0x88')](ut[_0xd79f('0x89')](_0xd79f('0x8a')));}else{rpcDb[_0xd79f('0x8b')](_0x503d00[_0x20dd01]['id']);}}else{var _0x2f979e=new Action(_0x503d00[_0x20dd01],_0x4dc964);_0x2f979e[_0xd79f('0x8c')]=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));_0x4dc964[_0xd79f('0x43')]+=0x1;ut[_0xd79f('0x8e')](_0x2f979e,0x17,_0xd79f('0x8f'));if(_0x4dc964[_0xd79f('0x90')]){rpcDb[_0xd79f('0x91')](ut[_0xd79f('0x92')](_0x503d00[_0x20dd01]));rpcDb[_0xd79f('0x93')](_0x2f979e,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xd79f('0x8e')](_0x2f979e,0x16,_0xd79f('0x94'));rpcDb[_0xd79f('0x93')](_0x2f979e,'[HistoryRecallClose]');rpcDb[_0xd79f('0x95')](_0x2f979e,_0xd79f('0x96'));}}}}})[_0xd79f('0x88')](ut[_0xd79f('0x89')](_0xd79f('0x97')));};Preview[_0xd79f('0x12')][_0xd79f('0x68')]=function(_0x3baced){_0x3baced[_0xd79f('0x5c')]=!![];if(ut[_0xd79f('0x98')](_0x3baced['loggedIn'])){_0x3baced['message']=_0xd79f('0x99');}else if(!ut['isActive'](_0x3baced[_0xd79f('0x37')])){_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x60');}else if(!this[_0xd79f('0x9a')](_0x3baced['Trunk'])){if(!this['isTrunkReachable'](_0x3baced[_0xd79f('0x9b')])){_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9c');}else{_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9d');}}else{_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9d');}emitCampaignPreview(_0x3baced);};Preview[_0xd79f('0x12')][_0xd79f('0x9e')]=function(_0x48ca8b,_0x4b7769,_0xa688f2){var _0x34652c=this;var _0x3be880=this[_0xd79f('0x19')][_0x4b7769];var _0x39a07e=this[_0xd79f('0x71')][_0x3be880[_0xd79f('0x6e')]];var _0x2e26e4;if(_0x39a07e){switch(_0xa688f2){case'1':_0x39a07e[_0xd79f('0x42')]+=0x1;_0x3be880[_0xd79f('0x9f')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x0,_0xd79f('0xa1'));ami[_0xd79f('0x28')](_0xd79f('0xa2'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xa4')));rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xa5'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3be880[_0xd79f('0x9f')]>=_0x39a07e[_0xd79f('0xaa')]){rpcDb[_0xd79f('0x95')](_0x3be880,_0xd79f('0xab'));}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0x9f'),_0x39a07e[_0xd79f('0xae')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];break;case _0xd79f('0xb2'):var _0x3cbce9=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));_0x3be880[_0xd79f('0xb3')]=_0x3cbce9;_0x3be880['answertime']=_0x3cbce9;_0x3be880['dialAnswer']=!![];_0x39a07e[_0xd79f('0x2f')]+=0x1;logger['info'](_0xd79f('0xb4'),_0x3be880[_0xd79f('0xb5')],'\x20Queue',_0x39a07e[_0xd79f('0x2b')],_0xd79f('0x70'),_0x39a07e[_0xd79f('0x2f')]);ami[_0xd79f('0x28')](_0xd79f('0xb6'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xb7'),this['campaignsPreview'][_0x3be880[_0xd79f('0x6e')]]));if(_0x39a07e[_0xd79f('0xb8')]){ami[_0xd79f('0x28')](_0xd79f('0xb9'),ut['buildAcw'](_0x3be880));}break;case'16':ami[_0xd79f('0x28')]('custom:agentcomplete',ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xba'),this[_0xd79f('0x71')][_0x3be880['queue']]));emitVoiceQueueChannelRemove(ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xba')));_0x39a07e[_0xd79f('0x3d')]+=0x1;_0x39a07e[_0xd79f('0x33')]+=0x1;_0x39a07e['answered']+=0x1;ut[_0xd79f('0xbb')](_0x39a07e,'[16]');_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x4,_0xd79f('0xbc'));rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xbd'));rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xd79f('0xbe')](_0x3be880);_0x39a07e[_0xd79f('0x31')]+=_0x3be880[_0xd79f('0xbf')];_0x39a07e['sumBillable']+=_0x3be880['talktime'];logger[_0xd79f('0x58')](_0xd79f('0xc0'),_0x3be880[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x39a07e['name'],_0xd79f('0x70'),_0x39a07e[_0xd79f('0x2f')]);delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];break;case'BUSY':_0x39a07e[_0xd79f('0x3e')]+=0x1;_0x3be880['countbusyretry']+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x5,'Busy');ami['emit'](_0xd79f('0xc2'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xc3')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xc4'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut['cloneAction'](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,_0xd79f('0xc5'));}else{if(_0x3be880[_0xd79f('0xc6')]>=_0x39a07e[_0xd79f('0xc7')]){rpcDb['createCustomerFinal'](_0x3be880,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xc6'),_0x39a07e[_0xd79f('0xc8')]),_0x3be880[_0xd79f('0xaf')],_0x3be880['activeContact']);}}break;case _0xd79f('0xc9'):_0x39a07e['outboundNoAnswerCallsDay']+=0x1;_0x3be880[_0xd79f('0xca')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x3,_0xd79f('0xcb'));ami[_0xd79f('0x28')](_0xd79f('0xcc'),ut[_0xd79f('0xa3')](_0x3be880,'noanswer'));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xcd'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e['dialGlobalMaxRetry']){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3be880['countnoanswerretry']>=_0x39a07e['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x3be880,_0xd79f('0xcd'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3be880,_0xd79f('0xca'),_0x39a07e[_0xd79f('0xce')]),_0x3be880['unlockAgent'],_0x3be880[_0xd79f('0xb0')]);}}break;case'CONGESTION':_0x39a07e[_0xd79f('0xcf')]+=0x1;_0x3be880[_0xd79f('0xd0')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut['logCustomer'](_0x3be880,0x8,'Congestion');ami[_0xd79f('0x28')](_0xd79f('0xd1'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xd2')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xd3'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e['dialGlobalMaxRetry']){_0x2e26e4=ut['cloneAction'](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,_0xd79f('0xd4'));}else{if(_0x3be880[_0xd79f('0xd0')]>=_0x39a07e[_0xd79f('0xd5')]){rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xd0'),_0x39a07e[_0xd79f('0xc8')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}break;case _0xd79f('0xd6'):_0x39a07e[_0xd79f('0xd7')]+=0x1;_0x3be880[_0xd79f('0xd8')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x14,_0xd79f('0xd9'));ami[_0xd79f('0x28')](_0xd79f('0xda'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xdb')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xdc'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0x14,_0xd79f('0xd9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3be880['countagentrejectretry']>=_0x39a07e[_0xd79f('0xdd')]){rpcDb['createCustomerFinal'](_0x3be880,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xd8'),_0x39a07e[_0xd79f('0xde')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}break;case _0xd79f('0xdf'):_0x39a07e['outboundAbandonedCallsDay']+=0x1;_0x3be880['countabandonedretry']+=0x1;_0x3be880['countglobal']=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0xb,_0xd79f('0xe0'));rpcDb[_0xd79f('0x93')](_0x3be880,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3be880['countabandonedetry']>=_0x39a07e[_0xd79f('0xe1')]){rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xe2'),_0x39a07e[_0xd79f('0xe3')]),_0x3be880['unlockAgent'],_0x3be880[_0xd79f('0xb0')]);}}break;case'18':_0x39a07e[_0xd79f('0x44')]+=0x1;_0x3be880[_0xd79f('0xe4')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x12,_0x48ca8b[_0xd79f('0xe5')]||_0x48ca8b[_0xd79f('0xe6')]);ami[_0xd79f('0x28')](_0xd79f('0xe7'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xe8')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xe9'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,_0xd79f('0xe9'));}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xd79f('0x19')][_0x48ca8b['linkedid']];break;case'19':_0x39a07e[_0xd79f('0x44')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x13,_0x48ca8b['cause-txt']||_0x48ca8b[_0xd79f('0xe6')]);ami[_0xd79f('0x28')](_0xd79f('0xe7'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xe8')));rpcDb[_0xd79f('0x93')](_0x3be880,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][machine]');}delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xb1')]];break;default:if(_0x3be880['dialAnswer']){ut[_0xd79f('0xbb')](_0x39a07e,_0xd79f('0xea'));ut['loggerError'](_0xd79f('0xeb')+_0x39a07e[_0xd79f('0x2b')],_0x48ca8b);}_0x39a07e['outboundUnknownCallsDay']+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0xc,_0x48ca8b['cause-txt']||_0x48ca8b[_0xd79f('0xe6')]);rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xec'));if(ut['totalGlobal'](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];}if(!(_0x3be880[_0xd79f('0x72')]&&_0xa688f2==='16')){ut[_0xd79f('0xed')](_0x39a07e,_0xd79f('0xee'));logger['info'](_0xd79f('0xef'),_0x3be880[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x39a07e[_0xd79f('0x2b')],'originated:\x20',_0x39a07e[_0xd79f('0x4c')]);}if(_0xa688f2!==_0xd79f('0xb2')){delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xb1')]];delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xf0')]];}}};Preview[_0xd79f('0x12')][_0xd79f('0xf1')]=function(_0x1cafee,_0x5891eb,_0x1ac1b8){if(_[_0xd79f('0xf2')](_0x5891eb)&&_0xd79f('0xf3')!==typeof _0x5891eb){return;}if(_[_0xd79f('0xf2')](_0x1ac1b8)&&_0xd79f('0xf3')!==typeof _0x1ac1b8){return;}switch(_0x1ac1b8[_0xd79f('0xf4')]){case'0':ut['logAgent'](_0x1cafee,0x0,_0xd79f('0xa1'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xf6'));break;case'3':ut['logAgent'](_0x1cafee,0x3,_0xd79f('0xcb'));rpcDb['createAgentHistory'](_0x1cafee,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x1cafee,0x5,_0xd79f('0xf7'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xf8'));break;case'8':ut[_0xd79f('0xf9')](_0x1cafee,0x8,_0xd79f('0xfa'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfb'));break;case'22':ut[_0xd79f('0xf9')](_0x1cafee,0x16,_0xd79f('0xfc'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfd'));break;default:ut[_0xd79f('0xf9')](_0x1cafee,0xc,_0x1ac1b8[_0xd79f('0xf4')]);rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfb'));}ut[_0xd79f('0xed')](_0x5891eb,_0xd79f('0xfe'));logger[_0xd79f('0x58')](_0xd79f('0xff'),_0x1cafee[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x5891eb[_0xd79f('0x2b')],'originated:\x20',_0x5891eb[_0xd79f('0x4c')]);delete this[_0xd79f('0x19')][_0x1cafee[_0xd79f('0xb5')]];};Preview[_0xd79f('0x12')][_0xd79f('0x100')]=function(_0x4be110,_0x377dbb,_0x3c5060,_0x47b2fb,_0x2f969b){var _0xdeef45=this;return new BPromise(function(_0x1b6332,_0x281b70){if(_[_0xd79f('0x6b')](_0x377dbb)||_[_0xd79f('0x6b')](_0x377dbb['Contact'])||_[_0xd79f('0x6b')](_0x377dbb[_0xd79f('0x101')][_0xd79f('0x102')])||_[_0xd79f('0x6b')](_0x377dbb[_0xd79f('0x76')])){_0x281b70(ut['message'](_0xd79f('0x103'),_0x47b2fb,_0x2f969b));return;}var _0x47ebf4=uuid['v4']();var _0x462a1f=_0xdeef45[_0xd79f('0x71')][_0x377dbb[_0xd79f('0x6d')][_0xd79f('0x2b')]];var _0x1af9af=_0x3c5060?_0xdeef45[_0xd79f('0x1a')][_0x3c5060]['id']:undefined;_0xdeef45['actions'][_0x47ebf4]=new Action(_0x377dbb,_0x462a1f,_0x47ebf4,_0x3c5060,_0x1af9af);var _0x5dab03=_0xdeef45[_0xd79f('0x19')][_0x47ebf4];_0x5dab03[_0xd79f('0xaf')]=_0x47b2fb;_0x5dab03[_0xd79f('0xb0')]=_0x2f969b;_0x5dab03[_0xd79f('0x104')]=_0x3c5060;if(_['isEmpty'](_0x4be110)){_0xdeef45[_0xd79f('0x105')](_0x5dab03,_0x462a1f,_0x377dbb,_0x3c5060)['then'](function(_0x154394){logger['info'](_0xd79f('0x106'),_0xd79f('0x107')+_0x5dab03['queue']+_0xd79f('0x108')+_0x5dab03['idContact'],JSON[_0xd79f('0x54')](_0x154394));ami['emit'](_0xd79f('0x109'),ut['buildObj'](_0x5dab03,_0xd79f('0x10a'),_0xdeef45[_0xd79f('0x71')][_0x5dab03[_0xd79f('0x6e')]]));_0x1b6332(ut['message']('Calling'));})['catch'](function(_0x1ee491){ut[_0xd79f('0x61')](_0xd79f('0x10b'),_0x1ee491);_0x281b70(ut[_0xd79f('0x5f')](_0xd79f('0x10c'),_0x47b2fb,_0x2f969b));});}else{_0x462a1f[_0xd79f('0x10d')]+=0x1;ut[_0xd79f('0x10e')](_0x5dab03);rpcDb[_0xd79f('0x10f')](_0x5dab03,_0xd79f('0x110'));delete _0xdeef45[_0xd79f('0x19')][_0x47ebf4];_0x281b70(ut[_0xd79f('0x5f')](_0xd79f('0x111'),_0x47b2fb,_0x2f969b));}});};Preview[_0xd79f('0x12')][_0xd79f('0x9a')]=function(_0x1a90ce){return!_['isNil'](_0x1a90ce)&&!_[_0xd79f('0x6b')](_0x1a90ce['name'])&&!_['isNil'](_0x1a90ce[_0xd79f('0x112')])&&_0x1a90ce[_0xd79f('0x112')]&&!_['isNil'](this[_0xd79f('0x18')][util[_0xd79f('0x55')]('SIP/%s',_0x1a90ce[_0xd79f('0x2b')])])&&!_[_0xd79f('0x6b')](this[_0xd79f('0x18')][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])]['status'])&&(this['trunks'][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])][_0xd79f('0x79')]===_0xd79f('0x114')||this[_0xd79f('0x18')][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])][_0xd79f('0x79')]===_0xd79f('0x115'));};Preview[_0xd79f('0x12')]['run']=function(_0x594bef,_0x1c10ef){var _0x3dd9c4=this;return new BPromise(function(_0xbda512,_0x563709){_0x3dd9c4[_0xd79f('0x116')](_0x594bef,_0x1c10ef)[_0xd79f('0x82')](function(_0x5f5a37){_0xbda512(_[_0xd79f('0x73')](_0x5f5a37,[_0xd79f('0x5f')]));})[_0xd79f('0x88')](function(_0x1ed490){if(_0x1ed490[_0xd79f('0x117')]){rpcDb[_0xd79f('0x118')](_0x594bef);}if(_0x1ed490[_0xd79f('0x112')]){rpcDb[_0xd79f('0x8b')](_0x594bef);}_0x563709(_[_0xd79f('0x73')](_0x1ed490,[_0xd79f('0x5f')]));});});};Preview[_0xd79f('0x12')][_0xd79f('0x116')]=function(_0x36fbb4,_0x22d78c){var _0x4dfe75=this;return new BPromise(function(_0x4d7788,_0x7c6cd1){var _0x185965,_0x43c486;rpcDb[_0xd79f('0x119')](_0x36fbb4)['then'](function(_0x3425a2){if(!_['isNil'](_0x3425a2[0x0])){_0x43c486=_0x3425a2[0x0][_0xd79f('0x11a')]?![]:!![];_0x185965=_0x3425a2[0x0]['recallme']?!![]:![];_0x185965=_0x22d78c?!![]:_0x185965;}var _0x20df0c=_0x4dfe75[_0xd79f('0x11b')](_0x3425a2);if(_0x20df0c[_0xd79f('0x11c')]){rpcDb[_0xd79f('0x11d')](_[_0xd79f('0x73')](_0x3425a2[0x0],['VoiceQueueId','Contact.phone']))[_0xd79f('0x82')](function(_0x213f4e){_0x4dfe75[_0xd79f('0x100')](_0x213f4e,_0x3425a2[0x0],_0x22d78c,_0x43c486,_0x185965)[_0xd79f('0x82')](function(_0x5397c5){_0x4d7788(_0x5397c5);})['catch'](function(_0x47f922){_0x7c6cd1(_0x47f922);});})['catch'](function(_0x46665c){ut[_0xd79f('0x61')]('[Preview][checkIsBlackList]',_0x46665c);_0x7c6cd1(ut[_0xd79f('0x5f')](_0xd79f('0x11e'),_0x43c486,_0x185965));});}else{_0x7c6cd1(ut['message'](_0x20df0c[_0xd79f('0x5f')],_0x43c486,_0x185965));}})['catch'](function(_0x4e5034){ut[_0xd79f('0x61')](_0xd79f('0x11f'),_0x4e5034);_0x7c6cd1(ut[_0xd79f('0x5f')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd79f('0x12')]['validateContact']=function(_0x2d60b6){if(_[_0xd79f('0x6b')](_0x2d60b6)||_[_0xd79f('0x120')](_0x2d60b6)||!_['isNil'](_0x2d60b6[0x0][_0xd79f('0x86')])&&_[_0xd79f('0x6b')](_0x2d60b6[0x0][_0xd79f('0x86')][_0xd79f('0x2b')])){ut['logger'](_0xd79f('0x121'),_0x2d60b6);return{'isValid':![],'message':_0xd79f('0x122')};}var _0x142753=this[_0xd79f('0x71')][_0x2d60b6[0x0][_0xd79f('0x6d')][_0xd79f('0x2b')]];_0x142753[_0xd79f('0x5f')]=_0xd79f('0x9d');if(_[_0xd79f('0x6b')](_0x142753)){ut[_0xd79f('0x61')](_0xd79f('0x123'),_0x142753);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x142753[_0xd79f('0x52')])){ut['logger'](_0xd79f('0x124'),_0xd79f('0x125')+_0x142753[_0xd79f('0x2b')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xd79f('0x9a')](_0x142753[_0xd79f('0x9b')])){ut['logger'](_0xd79f('0x124'),_0x142753[_0xd79f('0x2b')]+_0xd79f('0x126'));return{'isValid':![],'message':_0xd79f('0x127')};}}if(!ut['isActive'](_0x142753[_0xd79f('0x37')])){ut[_0xd79f('0x61')](_0xd79f('0x128'),_0x142753[_0xd79f('0x2b')]+_0xd79f('0x129'));return{'isValid':![],'message':_0xd79f('0x125')+_0x142753[_0xd79f('0x2b')]+_0xd79f('0x129')};}return{'isValid':!![],'message':_0xd79f('0x12a')};};Preview[_0xd79f('0x12')][_0xd79f('0x105')]=function(_0x5c4bc3,_0x58547b,_0x4cdc0f,_0x50fd67){var _0x173a96=this;return new BPromise(function(_0x2481ce,_0x238e4f){var _0x92ada2=_0x5c4bc3[_0xd79f('0xb5')];var _0x543b12=_0x173a96[_0xd79f('0x9a')](_0x58547b[_0xd79f('0x52')])?util[_0xd79f('0x55')]('SIP/%s/%s%s',_0x58547b['Trunk'][_0xd79f('0x2b')],_[_0xd79f('0x6b')](_0x58547b[_0xd79f('0x12b')])?'':_0x58547b['dialPrefix']['trim']()||'',_0x58547b['dialCutDigit']>0x0?_0x4cdc0f['Contact'][_0xd79f('0x102')][_0xd79f('0x12c')](_0x58547b['dialCutDigit']):_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')]):util[_0xd79f('0x55')](_0xd79f('0x12d'),_[_0xd79f('0x6b')](_0x58547b['TrunkBackup'])?_0x58547b[_0xd79f('0x52')][_0xd79f('0x2b')]:_0x58547b['TrunkBackup'][_0xd79f('0x2b')],_['isNil'](_0x58547b[_0xd79f('0x12b')])?'':_0x58547b[_0xd79f('0x12b')][_0xd79f('0x12e')]()||'',_0x58547b[_0xd79f('0x12f')]>0x0?_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')][_0xd79f('0x12c')](_0x58547b[_0xd79f('0x12f')]):_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')]);var _0xe313ff=_0x173a96[_0xd79f('0x9a')](_0x58547b[_0xd79f('0x52')])?ut[_0xd79f('0x130')](_0x58547b[_0xd79f('0x52')][_0xd79f('0x131')],_0x58547b[_0xd79f('0x39')],_0x58547b[_0xd79f('0x132')]>0x0?ut['getCallerIdRandom'](_0x58547b['dialOriginateCallerIdNumber'],_0x58547b['dialRandomLastDigitCallerIdNumber']):_0x58547b[_0xd79f('0x3a')]):ut[_0xd79f('0x130')](_[_0xd79f('0x6b')](_0x58547b[_0xd79f('0x9b')])?_0x58547b[_0xd79f('0x52')][_0xd79f('0x131')]:_0x58547b['TrunkBackup'][_0xd79f('0x131')],_0x58547b[_0xd79f('0x39')],_0x58547b[_0xd79f('0x132')]>0x0?ut['getCallerIdRandom'](_0x58547b['dialOriginateCallerIdNumber'],_0x58547b[_0xd79f('0x132')]):_0x58547b['dialOriginateCallerIdNumber']);if(_0xe313ff){_0x5c4bc3[_0xd79f('0x133')]=ut['extractCalleridName'](_0xe313ff);_0x5c4bc3['originatecalleridnum']=ut['extractCalleridNumber'](_0xe313ff);}var _0x295237=ut[_0xd79f('0x134')](_0x58547b,_0x4cdc0f,_0x543b12,_0xe313ff,_0x92ada2,_0x5c4bc3);_[_0xd79f('0x135')](_0x5c4bc3,ut['toLowerVariables'](_0x295237));_0x5c4bc3['starttime']=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));ami[_0xd79f('0x78')](ut['variablesAction'](_0x5c4bc3,_0x58547b,_0x295237,_0x5c4bc3[_0xd79f('0xb0')],_0x50fd67))[_0xd79f('0x82')](function(_0x56ea2b){var _0x6d5ade=_0x5c4bc3[_0xd79f('0x136')];if(!_['isNil'](_0x6d5ade)){if(!_[_0xd79f('0x6b')](_0x173a96['agents'][_0x6d5ade])){_0x173a96[_0xd79f('0x1a')][_0x6d5ade][_0xd79f('0x137')]=_0x5c4bc3['calleridnum'];emit(util['format'](_0xd79f('0x138'),_0x173a96['agents'][_0x6d5ade][_0xd79f('0x2b')]),_0xd79f('0x139'),{'destaccountcode':_0x173a96[_0xd79f('0x1a')][_0x6d5ade][_0xd79f('0x13a')],'destconnectedlinenum':_0x5c4bc3[_0xd79f('0x13b')]});}}_0x58547b[_0xd79f('0x4c')]+=0x1;logger[_0xd79f('0x58')]('[originated][increment]',_0x92ada2,_0xd79f('0xc1'),_0x58547b['name'],_0xd79f('0x6f'),_0x58547b[_0xd79f('0x4c')]);_0x2481ce(_0x56ea2b);})['catch'](function(_0x2a9219){ut[_0xd79f('0xf9')](_0x5c4bc3,0xe,'OriginateError');rpcDb[_0xd79f('0xf5')](_0x5c4bc3,_0xd79f('0x13c'));_0x238e4f(_0x2a9219);});});};Preview[_0xd79f('0x12')][_0xd79f('0x22')]=function(_0x1f7741){if(this['actions'][_0x1f7741[_0xd79f('0xb1')]]){this['actions'][_0x1f7741[_0xd79f('0xb1')]][_0xd79f('0x7a')]=_0x1f7741[_0xd79f('0x7a')];}};Preview[_0xd79f('0x12')][_0xd79f('0x1c')]=function(_0x3acd88){var _0xb5964b=this;var _0x37ae34=this['actions'][_0x3acd88[_0xd79f('0x13d')]];if(_0x37ae34){if(_0x37ae34[_0xd79f('0x104')]&&this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]]){ut['logLookAgent'](_0x37ae34,this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]][_0xd79f('0x2b')],this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]]['id']);}var _0x37b7dd=_[_0xd79f('0x13e')](_0x37ae34);_0x37b7dd[_0xd79f('0xb3')]=moment()[_0xd79f('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5b3de7=_0xb5964b['campaignsPreview'][_0x37ae34[_0xd79f('0x6e')]];if(ut[_0xd79f('0x13f')](_0x3acd88[_0xd79f('0x140')])){if(_0x37ae34[_0xd79f('0xaf')]){rpcDb[_0xd79f('0x118')](_0x37ae34[_0xd79f('0x141')]);}if(_0x37ae34['activeContact']){rpcDb[_0xd79f('0x8b')](_0x37ae34[_0xd79f('0x141')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x37ae34,'rejected',this[_0xd79f('0x71')][_0x37ae34['queue']]));this['callProgressDetectingAgent'](_0x37b7dd,_0x5b3de7,_0x3acd88);}else{_0x37ae34[_0xd79f('0x8c')]=moment()['format'](_0xd79f('0x8d'));ut['logAgent'](_0x37b7dd,0x4,_0xd79f('0xbc'));rpcDb[_0xd79f('0xf5')](_0x37b7dd,_0xd79f('0x142'));}}};Preview[_0xd79f('0x12')][_0xd79f('0x1f')]=function(_0x550e77){var _0x598b86=this;var _0x3443b6=this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]];var _0x1ebf60;if(_0x3443b6){_0x1ebf60=this['campaignsPreview'][_0x3443b6[_0xd79f('0x6e')]];logger[_0xd79f('0x58')](_0xd79f('0x143'),_0x550e77[_0xd79f('0xb1')],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);}if(this['actions'][_0x550e77[_0xd79f('0xb1')]]&&_0x550e77[_0xd79f('0xb1')]!==_0x550e77['uniqueid']){if(_0x550e77['cause']==='16'&&this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]]['dialAnswer']){this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}else if(this[_0xd79f('0x19')][_0x550e77['linkedid']][_0xd79f('0x72')]){logger[_0xd79f('0x58')](_0xd79f('0x145'),_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}}else if(_0x3443b6&&_[_0xd79f('0x6b')](_0x3443b6[_0xd79f('0x146')])&&_0x1ebf60[_0xd79f('0x147')]&&_0x550e77[_0xd79f('0xb1')]===_0x550e77[_0xd79f('0xb5')]&&_[_0xd79f('0x6b')](_0x550e77[_0xd79f('0xf4')])&&_0x550e77['cause']==='16'&&_0x550e77[_0xd79f('0x148')]==='6'&&_['isUndefined'](_0x3443b6[_0xd79f('0x149')])){if(_0x3443b6[_0xd79f('0xaf')]){rpcDb['unlockContact'](_0x3443b6[_0xd79f('0x141')]);}if(_0x3443b6[_0xd79f('0xb0')]){rpcDb[_0xd79f('0x8b')](_0x3443b6[_0xd79f('0x141')]);}_0x550e77[_0xd79f('0xf4')]='22';this[_0xd79f('0xf1')](_0x3443b6,_0x1ebf60,_0x550e77);}else if(_0x3443b6&&_0x3443b6[_0xd79f('0x149')]){if(_0x550e77[_0xd79f('0x144')]==='16'&&this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]]['dialAnswer']){logger[_0xd79f('0x58')](_0xd79f('0x14a'),_0x550e77['linkedid'],_0x550e77['cause'],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}else if(this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]][_0xd79f('0x72')]){logger[_0xd79f('0x58')]('[syncHangup][talking][cause]',_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')],_0xd79f('0xc1'),_0x1ebf60['name'],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this['callProgressDetectingCustomer'](_0x550e77,_0x550e77['linkedid'],_0x550e77['cause']);}}};Preview[_0xd79f('0x12')][_0xd79f('0x14b')]=function(_0x1be247){if(this[_0xd79f('0x19')][_0x1be247[_0xd79f('0xf0')]]&&_0x1be247['destlinkedid']!==_0x1be247[_0xd79f('0x14c')]){this[_0xd79f('0x9e')](_0x1be247,_0x1be247['destlinkedid'],_0x1be247['dialstatus']);}};Preview[_0xd79f('0x12')][_0xd79f('0x14d')]=function(_0x78fc5a){if(this[_0xd79f('0x19')][_0x78fc5a[_0xd79f('0xb1')]]&&_0x78fc5a[_0xd79f('0xb1')]!==_0x78fc5a[_0xd79f('0xb5')]&&!this[_0xd79f('0x19')][_0x78fc5a[_0xd79f('0xb1')]][_0xd79f('0x72')]){if(_0x78fc5a[_0xd79f('0x144')]==='1'){this[_0xd79f('0x9e')](_0x78fc5a,_0x78fc5a[_0xd79f('0xb1')],_0x78fc5a[_0xd79f('0x144')]);}}};Preview[_0xd79f('0x12')][_0xd79f('0x14e')]=function(_0x495e05,_0x1e8a7d,_0x41e41f){if(this['actions'][_0x495e05]){if(_[_0xd79f('0x6b')](this['actions'][_0x495e05][_0xd79f('0x14f')])){this[_0xd79f('0x19')][_0x495e05][_0xd79f('0x14f')]={};}this[_0xd79f('0x19')][_0x495e05][_0xd79f('0x14f')][_0x1e8a7d]=_0x41e41f;}};Preview[_0xd79f('0x12')]['syncVarSet']=function(_0x57d550){try{if(!_['isNil'](_0x57d550)){if(ut[_0xd79f('0x150')](_['keys'](_0x57d550[_0xd79f('0x151')])[0x0])){this[_0xd79f('0x14e')](_0x57d550[_0xd79f('0xb5')],_['keys'](_0x57d550[_0xd79f('0x151')])[0x0],_0x57d550[_0xd79f('0x152')]);}}}catch(_0x10ad6d){logger[_0xd79f('0x153')](_0xd79f('0x154'),util[_0xd79f('0x155')](_0x10ad6d,{'showHidden':![],'depth':null}));}};Preview[_0xd79f('0x12')][_0xd79f('0x25')]=function(_0x52fbe1){if(_0x52fbe1){if(this[_0xd79f('0x19')][_0x52fbe1[_0xd79f('0x156')]]){this[_0xd79f('0x19')][_0x52fbe1[_0xd79f('0x156')]][_0xd79f('0x149')]=!![];}}};Preview['prototype'][_0xd79f('0x157')]=function(_0xed82a9){if(_0xed82a9){if(this[_0xd79f('0x19')][_0xed82a9[_0xd79f('0x158')]]){this[_0xd79f('0x19')][_0xed82a9[_0xd79f('0x158')]][_0xd79f('0x149')]=!![];}}};module[_0xd79f('0x159')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 171602c..4044b51 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 _0xfcb9=['util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','membername','context','from-sip','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20'];(function(_0x775ff4,_0x14d00f){var _0x2e6abe=function(_0x5ad039){while(--_0x5ad039){_0x775ff4['push'](_0x775ff4['shift']());}};_0x2e6abe(++_0x14d00f);}(_0xfcb9,0x12c));var _0x9fcb=function(_0x4dad15,_0x5c9165){_0x4dad15=_0x4dad15-0x0;var _0x240260=_0xfcb9[_0x4dad15];return _0x240260;};'use strict';var util=require(_0x9fcb('0x0'));var BPromise=require(_0x9fcb('0x1'));var logger=require(_0x9fcb('0x2'))(_0x9fcb('0x3'));var _=require('lodash');var cmHopper=require(_0x9fcb('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x9fcb('0x5'));var cmHopperBlack=require(_0x9fcb('0x6'));var voiceQueueRt=require(_0x9fcb('0x7'));var agentReportPreview=require(_0x9fcb('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x46fe1e){return function(_0x1d5c9b){logger[_0x9fcb('0x9')](_0x46fe1e,util[_0x9fcb('0xa')](_0x1d5c9b,{'showHidden':![],'depth':null}));};}function create(_0x178132){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopperHistory[_0x9fcb('0xd')](_0x178132))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0xf')));}function createAgent(_0x5ad4f8){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](agentReportPreview[_0x9fcb('0xd')](_0x5ad4f8))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0xf')));}function moveContact(_0xe34b9a){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x10')](_0xe34b9a,!![]))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0x11')));}exports[_0x9fcb('0x12')]=function(_0x2d7010){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopperBlack['checkIsBlackList'](_0x2d7010))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0x13')));};exports[_0x9fcb('0x14')]=function(_0x4e7803){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x14')](_0x4e7803))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0x15')));};exports[_0x9fcb('0xd')]=function(_0x268631,_0x585d9a){create(_0x268631)[_0x9fcb('0xe')](loggerCatch(_0x585d9a));moveContact(_0x268631)[_0x9fcb('0xe')](loggerCatch(_0x585d9a));};exports[_0x9fcb('0x16')]=function(_0x256de1,_0x242a41){createAgent(_0x256de1)[_0x9fcb('0xe')](loggerCatch(_0x242a41));};exports['createCustomerHistory']=function(_0x37b845,_0x2ef9f9){create(_0x37b845)[_0x9fcb('0xe')](loggerCatch(_0x2ef9f9));};exports[_0x9fcb('0x17')]=function(_0x33f5af,_0x128d51){moveContact(_0x33f5af)[_0x9fcb('0xe')](loggerCatch(_0x128d51));};exports[_0x9fcb('0x18')]=function(_0x4afb64,_0x7673f4,_0x1d22c5){if(_0x7673f4){_0x4afb64['UserId']=null;}if(_0x1d22c5){_0x4afb64[_0x9fcb('0x19')]=![];}return BPromise['resolve']()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x18')](_0x4afb64))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0x1a')));};exports['countReScheduled']=function(_0x362090){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper['countReScheduled'](_0x362090))[_0x9fcb('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x9fcb('0x1b')]=function(_0x5712ab){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x1b')]({'UserId':null},_0x5712ab,0x1))['catch'](loggerCatch(_0x9fcb('0x1c')));};exports['disableContact']=function(_0x23d382){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x1b')]({'active':![]},_0x23d382,0x1))[_0x9fcb('0xe')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0xa5634c){var _0x446243={};_0x446243[_0x9fcb('0x1d')]=_0xa5634c[_0x9fcb('0x1d')];_0x446243['uniqueid']=_0xa5634c[_0x9fcb('0x1e')];_0x446243[_0x9fcb('0x1f')]=_0xa5634c[_0x9fcb('0x1f')];_0x446243[_0x9fcb('0x20')]=_0xa5634c['calleridname'];_0x446243[_0x9fcb('0x21')]=_0xa5634c[_0x9fcb('0x21')];_0x446243[_0x9fcb('0x22')]=_0xa5634c[_0x9fcb('0x23')];_0x446243[_0x9fcb('0x24')]=_0xa5634c[_0x9fcb('0x23')];_0x446243['queuecallercomplete']=0x1;_0x446243[_0x9fcb('0x25')]=_0xa5634c[_0x9fcb('0x26')];_0x446243['connectedlinename']=_0xa5634c[_0x9fcb('0x27')];_0x446243[_0x9fcb('0x28')]=_0x9fcb('0x29');_0x446243['exten']='xcally-motion-preview';_0x446243[_0x9fcb('0x2a')]=0x0;_0x446243[_0x9fcb('0x2b')]=0x1;_0x446243[_0x9fcb('0x2c')]=_0xa5634c[_0x9fcb('0x27')];_0x446243[_0x9fcb('0x2d')]=_0x9fcb('0x2e');return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](voiceQueueReport['create'](_0x446243))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x9fcb('0x2f')]=function(_0x13b8d5,_0x41489e){return BPromise[_0x9fcb('0xb')]()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x2f')](_0x13b8d5,_0x41489e))['catch'](loggerCatch(_0x9fcb('0x30')));};exports['rescheduleContactInQueue']=function(_0x2f6020){return BPromise['resolve']()[_0x9fcb('0xc')](cmHopper[_0x9fcb('0x18')](_0x2f6020,!![],!![]))[_0x9fcb('0xe')](loggerCatch(_0x9fcb('0x31')));}; \ No newline at end of file +var _0xdf91=['../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopperBlack'];(function(_0x516048,_0x4d20a5){var _0x2197f4=function(_0x2b7586){while(--_0x2b7586){_0x516048['push'](_0x516048['shift']());}};_0x2197f4(++_0x4d20a5);}(_0xdf91,0x12d));var _0x1df9=function(_0x40cd5f,_0x3c217f){_0x40cd5f=_0x40cd5f-0x0;var _0x291bd5=_0xdf91[_0x40cd5f];return _0x291bd5;};'use strict';var util=require(_0x1df9('0x0'));var BPromise=require('bluebird');var logger=require(_0x1df9('0x1'))(_0x1df9('0x2'));var _=require(_0x1df9('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1df9('0x4'));var voiceQueueRt=require(_0x1df9('0x5'));var agentReportPreview=require(_0x1df9('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x7f2605){return function(_0x34a925){logger[_0x1df9('0x7')](_0x7f2605,util['inspect'](_0x34a925,{'showHidden':![],'depth':null}));};}function create(_0x3863d3){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopperHistory['createHistory'](_0x3863d3))[_0x1df9('0xa')](loggerCatch(_0x1df9('0xb')));}function createAgent(_0x3d8b9f){return BPromise[_0x1df9('0x8')]()['then'](agentReportPreview[_0x1df9('0xc')](_0x3d8b9f))[_0x1df9('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2e8726){return BPromise['resolve']()['then'](cmHopper[_0x1df9('0xd')](_0x2e8726,!![]))['catch'](loggerCatch(_0x1df9('0xe')));}exports['checkIsBlackList']=function(_0x2761b1){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x2761b1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0xf')));};exports['getContactPreview']=function(_0x42d134){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x10')](_0x42d134))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x11')));};exports[_0x1df9('0xc')]=function(_0x8905d7,_0x3dd96d){create(_0x8905d7)[_0x1df9('0xa')](loggerCatch(_0x3dd96d));moveContact(_0x8905d7)[_0x1df9('0xa')](loggerCatch(_0x3dd96d));};exports['createAgentHistory']=function(_0xb7b1db,_0x13b278){createAgent(_0xb7b1db)[_0x1df9('0xa')](loggerCatch(_0x13b278));};exports[_0x1df9('0x12')]=function(_0x3d150c,_0x4aaf61){create(_0x3d150c)['catch'](loggerCatch(_0x4aaf61));};exports['createCustomerFinal']=function(_0x4c1c16,_0x337b3d){moveContact(_0x4c1c16)[_0x1df9('0xa')](loggerCatch(_0x337b3d));};exports['rescheduleContact']=function(_0x50d9b6,_0xf79699,_0x22ad46){if(_0xf79699){_0x50d9b6[_0x1df9('0x13')]=null;}if(_0x22ad46){_0x50d9b6[_0x1df9('0x14')]=![];}return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x15')](_0x50d9b6))['catch'](loggerCatch(_0x1df9('0x16')));};exports[_0x1df9('0x17')]=function(_0x32b147){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x17')](_0x32b147))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x18')));};exports[_0x1df9('0x19')]=function(_0x470867){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x19')]({'UserId':null},_0x470867,0x1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x1a')));};exports[_0x1df9('0x1b')]=function(_0x54f24d){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x19')]({'active':![]},_0x54f24d,0x1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x1c')));};exports[_0x1df9('0x1d')]=function(_0x301312){var _0x5e7055={};_0x5e7055[_0x1df9('0x1e')]=_0x301312[_0x1df9('0x1e')];_0x5e7055['uniqueid']=_0x301312['uniqueid'];_0x5e7055['calleridnum']=_0x301312[_0x1df9('0x1f')];_0x5e7055['calleridname']=_0x301312[_0x1df9('0x20')];_0x5e7055[_0x1df9('0x21')]=_0x301312[_0x1df9('0x21')];_0x5e7055['queuecallerjoinAt']=_0x301312[_0x1df9('0x22')];_0x5e7055[_0x1df9('0x23')]=_0x301312['answertime'];_0x5e7055[_0x1df9('0x24')]=0x1;_0x5e7055['queuecallercompleteAt']=_0x301312['endtime'];_0x5e7055['connectedlinename']=_0x301312[_0x1df9('0x25')];_0x5e7055[_0x1df9('0x26')]=_0x1df9('0x27');_0x5e7055[_0x1df9('0x28')]='xcally-motion-preview';_0x5e7055['holdtime']=0x0;_0x5e7055[_0x1df9('0x29')]=0x1;_0x5e7055[_0x1df9('0x2a')]=_0x301312[_0x1df9('0x25')];_0x5e7055[_0x1df9('0x2b')]=_0x1df9('0x2c');return BPromise['resolve']()[_0x1df9('0x9')](voiceQueueReport[_0x1df9('0x2d')](_0x5e7055))['catch'](loggerCatch(_0x1df9('0x2e')));};exports['getContactRecallMe']=function(_0xf1d123,_0x4bdb62){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x2f')](_0xf1d123,_0x4bdb62))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x30')));};exports[_0x1df9('0x31')]=function(_0x71cf96){return BPromise['resolve']()[_0x1df9('0x9')](cmHopper['rescheduleContact'](_0x71cf96,!![],!![]))['catch'](loggerCatch(_0x1df9('0x32')));}; \ 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 f609fce..cabc749 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 _0x5087=['logCustomer','endtime','talktime','answertime','isFailure','Failure','BOOKED','channelAgent','from-sip','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','uniqueid','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','scheduledat','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','ringtime','starttime','membername'];(function(_0x13cdd0,_0x3a3ca7){var _0x2fcc49=function(_0x4682f1){while(--_0x4682f1){_0x13cdd0['push'](_0x13cdd0['shift']());}};_0x2fcc49(++_0x3a3ca7);}(_0x5087,0xe1));var _0x7508=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x5087[_0x1627ae];return _0x34b38f;};'use strict';var util=require(_0x7508('0x0'));var _=require(_0x7508('0x1'));var moment=require(_0x7508('0x2'));var logger=require(_0x7508('0x3'))(_0x7508('0x4'));var ipAgi=process[_0x7508('0x5')]['XCALLY_IP_AGI']||_0x7508('0x6');function getSeconds(_0x3e0cbc,_0x417edd){var _0x5d3e7f=moment(_0x3e0cbc)[_0x7508('0x7')](0x0);var _0x1975e6=moment(_0x417edd)[_0x7508('0x7')](0x0);return _0x5d3e7f[_0x7508('0x8')](_0x1975e6,_0x7508('0x9'));}exports[_0x7508('0xa')]=function(_0x41cfb3){return function(_0x4b72ed){logger[_0x7508('0xb')](_0x41cfb3,util[_0x7508('0xc')](_0x4b72ed,{'showHidden':![],'depth':null}));};};exports[_0x7508('0xd')]=function(_0xdbf57e,_0x4ba240){logger[_0x7508('0xe')](_0xdbf57e,util['inspect'](_0x4ba240,{'showHidden':![],'depth':null}));};exports[_0x7508('0xf')]=function(_0x5d0037,_0x11ee34){logger['error'](_0x5d0037,util[_0x7508('0xc')](_0x11ee34,{'showHidden':![],'depth':null}));};exports[_0x7508('0x10')]=function(_0x216492){return function(_0x19845c){logger[_0x7508('0xe')](_0x216492,util[_0x7508('0xc')](_0x19845c,{'showHidden':![],'depth':null}));};};exports[_0x7508('0x11')]=function(_0x3220f9,_0x37829f,_0x1782e3){return{'message':_0x3220f9,'unlock':_0x37829f,'active':_0x1782e3};};exports[_0x7508('0x12')]=function(_0x1e44ee,_0x2fe0e7,_0x10ca63){if(!_['isUndefined'](_0x10ca63)&&_0x7508('0x13')===typeof _0x10ca63&&!_[_0x7508('0x14')](_0x10ca63)){if(!_[_0x7508('0x15')](_0x2fe0e7)&&'string'===typeof _0x2fe0e7&&!_[_0x7508('0x14')](_0x2fe0e7)){return util[_0x7508('0x16')](_0x7508('0x17'),_0x2fe0e7,_0x10ca63);}return util[_0x7508('0x16')]('\x22%s\x22\x20<%s>',_0x10ca63,_0x10ca63);}if(!_[_0x7508('0x15')](_0x1e44ee)&&_0x7508('0x13')===typeof _0x1e44ee&&!_['isEmpty'](_0x1e44ee)){return _0x1e44ee;}return _0x7508('0x18');};exports[_0x7508('0x19')]=function(_0x914af9){if(_['isNil'](_0x914af9)){return![];}return _0x914af9;};exports[_0x7508('0x1a')]=function(_0x131657,_0x48062f,_0x4c0957,_0x4b9990,_0x3fe661,_0x2ad66f){var _0xa17ee7={'XMD-QUEUE':_0x48062f['Queue']?_0x48062f['Queue']['name']:'','XMD-CALLERID':_0x4b9990,'XMD-CALLERID-PREVIEW':_0x2ad66f?util[_0x7508('0x16')](_0x7508('0x17'),_0x2ad66f[_0x7508('0x1b')],_0x2ad66f[_0x7508('0x1c')]):_0x4b9990,'XMD-DIALID':_0x3fe661,'XMD-CONTACTID':_0x48062f[_0x7508('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4b9990,'XMD-VOICEQUEUEID':_0x48062f[_0x7508('0x1e')],'XMD-DIALCHANNEL':_0x4c0957,'XMD-DIALTIMEOUT':_0x131657[_0x7508('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x7508('0x16')]('\x22rtTxX%s%s\x22',_0x131657[_0x7508('0x20')]?'g':'',_[_0x7508('0x14')](_0x131657[_0x7508('0x21')])?'':_0x7508('0x22')),'XMD-DIALURL':_0x131657[_0x7508('0x23')]||'','XMD-AGI':_0x131657['dialQueueProject']?util[_0x7508('0x16')](_0x7508('0x24'),ipAgi,_0x131657[_0x7508('0x25')]):'NONE','XMD-AGIAFTER':_0x131657[_0x7508('0x20')]?util[_0x7508('0x16')]('\x22agi://%s/square,%s\x22',ipAgi,_0x131657[_0x7508('0x20')]):_0x7508('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x2ad66f?_0x2ad66f[_0x7508('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x2ad66f?_0x2ad66f[_0x7508('0x28')]:'','XMD-DESTINATION':_0x7508('0x29')};if(!_[_0x7508('0x14')](_0x131657[_0x7508('0x21')])){_0xa17ee7[util['format']('%s',_0x7508('0x2a'))]=_0x131657[_0x7508('0x21')];_0xa17ee7[util[_0x7508('0x16')]('%s',_0x7508('0x2b'))]=_0x3fe661;}if(_0x48062f&&_0x48062f[_0x7508('0x2c')]){for(var _0x4958de in _0x48062f[_0x7508('0x2c')]){if(_0x48062f[_0x7508('0x2c')]['hasOwnProperty'](_0x4958de)){if(!_[_0x7508('0x2d')](_0x48062f[_0x7508('0x2c')][_0x4958de])&&_0x4958de!=='id'&&_0x4958de!=='tags'&&_0x4958de!==_0x7508('0x2e')&&_0x4958de!==_0x7508('0x2f')){_0xa17ee7[util[_0x7508('0x16')]('%s%s',_0x7508('0x30'),_[_0x7508('0x31')](_0x4958de))]=_0x48062f['Contact'][_0x4958de];}}}}return _0xa17ee7;};exports[_0x7508('0x32')]=function(_0x86338a){var _0x1ab217={};for(var _0x28cc34 in _0x86338a){if(_0x86338a[_0x7508('0x33')](_0x28cc34)){_0x1ab217[util['format']('%s',_['toLower'](_0x28cc34))]=_0x86338a[_0x28cc34];}}return{'variables':_0x1ab217};};exports[_0x7508('0x34')]=function(_0x43e872,_0x52210a){if(!_[_0x7508('0x2d')](_0x43e872)){if(_0x43e872[_0x7508('0x33')](_0x7508('0x35'))){if(_0x43e872[_0x7508('0x35')]>0x0){_0x43e872[_0x7508('0x35')]-=0x1;}else{logger[_0x7508('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x52210a);}}}else{logger[_0x7508('0xb')](_0x7508('0x36'),_0x52210a);}};exports[_0x7508('0x37')]=function(_0x286f5d){var _0x4451b2=moment()[_0x7508('0x16')](_0x7508('0x38'));_0x286f5d[_0x7508('0x39')]=0xd;_0x286f5d[_0x7508('0x3a')]='Blacklist';_0x286f5d['starttime']=_0x4451b2;_0x286f5d[_0x7508('0x3b')]=_0x4451b2;_0x286f5d['endtime']=_0x4451b2;};exports['logAgent']=function(_0x5d1d86,_0x4fb69b,_0x447386){var _0x5ec27f=moment()['format'](_0x7508('0x38'));_0x5d1d86[_0x7508('0x39')]=_0x4fb69b;_0x5d1d86[_0x7508('0x3a')]=_0x447386;_0x5d1d86['responsetime']=_0x5ec27f;_0x5d1d86[_0x7508('0x3c')]=getSeconds(_0x5d1d86[_0x7508('0x3b')],_0x5d1d86[_0x7508('0x3d')]);};exports['logLookAgent']=function(_0x24165d,_0x25c623,_0x1a966b){_0x24165d[_0x7508('0x3e')]=_0x25c623;_0x24165d['UserId']=_0x1a966b;};exports[_0x7508('0x3f')]=function(_0x390745,_0x2cebce,_0x5e731b){var _0xab0fd2=moment()[_0x7508('0x16')](_0x7508('0x38'));_0x390745[_0x7508('0x39')]=_0x2cebce;_0x390745['statedesc']=_0x5e731b;_0x390745[_0x7508('0x3b')]=_0x390745[_0x7508('0x3b')]?_0x390745[_0x7508('0x3b')]:_0xab0fd2;_0x390745[_0x7508('0x40')]=_0x390745[_0x7508('0x40')]?_0x390745[_0x7508('0x40')]:_0xab0fd2;_0x390745['ringtime']=getSeconds(_0x390745['responsetime']||0x0,_0x390745['starttime']||0x0);_0x390745[_0x7508('0x41')]=_0x390745[_0x7508('0x42')]?getSeconds(_0x390745['endtime'],_0x390745[_0x7508('0x42')]):0x0;};exports[_0x7508('0x43')]=function(_0x5430cb){return _0x5430cb===_0x7508('0x44');};exports['variablesAction']=function(_0x354560,_0x21c1d8,_0x81d00,_0x430758,_0x47148a){var _0x4ed6cc=_0x430758?'RECALL':_0x354560['calleridname'];_0x4ed6cc=_0x47148a?_0x7508('0x45'):_0x4ed6cc;return{'actionid':_0x354560['uniqueid'],'action':'originate','channel':_0x354560[_0x7508('0x46')],'callerid':util[_0x7508('0x16')](_0x7508('0x17'),_0x4ed6cc,_0x354560[_0x7508('0x1c')]),'Exten':'xcally-motion-preview','Context':_0x7508('0x47'),'Priority':'1','variable':_0x81d00,'timeout':(_0x21c1d8[_0x7508('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x354560['uniqueid']};};exports['totalGlobal']=function(_0x59de8a){return _0x59de8a['countbusyretry']+_0x59de8a[_0x7508('0x49')]+_0x59de8a[_0x7508('0x4a')]+_0x59de8a[_0x7508('0x4b')]+_0x59de8a[_0x7508('0x4c')];};exports[_0x7508('0x4d')]=function(_0x5b3854){var _0x5de4d3=_[_0x7508('0x4e')](_0x5b3854);_0x5de4d3['state']=0xf;_0x5de4d3[_0x7508('0x3a')]=_0x7508('0x4f');return _0x5de4d3;};exports[_0x7508('0x50')]=function(_0xb5ff21,_0x5e9d26,_0x13acd8){var _0x39c650={};_0x39c650[_0x5e9d26]=_0xb5ff21[_0x5e9d26];_0x39c650[_0x7508('0x51')]=![];_0x39c650['scheduledat']=moment()[_0x7508('0x52')](_0x13acd8,_0x7508('0x53'))[_0x7508('0x16')](_0x7508('0x38'));_0x39c650[_0x7508('0x1d')]=_0xb5ff21[_0x7508('0x1d')];_0x39c650[_0x7508('0x54')]=_0xb5ff21[_0x7508('0x54')];_0x39c650[_0x7508('0x1e')]=_0xb5ff21[_0x7508('0x1e')]||undefined;return _0x39c650;};exports[_0x7508('0x55')]=function(_0x274ace,_0x1b04fb){if(!_['isNil'](_0x274ace)){if(_0x274ace[_0x7508('0x56')]>0x0){_0x274ace[_0x7508('0x56')]-=0x1;}else{logger[_0x7508('0xb')](_0x1b04fb,_0x7508('0x57'));}}else{logger[_0x7508('0xb')](_0x1b04fb,_0x7508('0x58'));}};exports[_0x7508('0x59')]=function(_0x283372){if(_0x283372<=0x0){return!![];}return![];};exports[_0x7508('0x5a')]=function(_0x1dad27,_0x259424,_0x369e44){_0x1dad27['lastevent']=_0x259424;_0x1dad27['name']=_0x1dad27[_0x7508('0x5b')];_0x1dad27[_0x7508('0x5c')]=_0x1dad27['channelAgent'];_0x1dad27[_0x7508('0x5d')]=_0x7508('0x5e');if(_0x369e44){_0x1dad27[_0x7508('0x5f')]=_0x369e44[_0x7508('0x5f')];}return _0x1dad27;};exports[_0x7508('0x60')]=function(_0xee6161){var _0x3a0f38={};_0x3a0f38[_0x7508('0x5b')]=_0xee6161[_0x7508('0x5b')];_0x3a0f38[_0x7508('0x5c')]=_0xee6161[_0x7508('0x46')];_0x3a0f38[_0x7508('0x61')]=_0xee6161[_0x7508('0x61')];return _0x3a0f38;};exports['agentReadyId']=function(_0xb92308){var _0xba3bbd=[];for(var _0x2b5b63 in _0xb92308){if(_0xb92308['hasOwnProperty'](_0x2b5b63)){if(!_[_0x7508('0x2d')](_0xb92308[_0x2b5b63])&&_0xb92308[_0x2b5b63][_0x7508('0x39')]===_0x7508('0x62')&&_0xb92308[_0x2b5b63][_0x7508('0x63')]===_0x7508('0x64')){_0xba3bbd[_0x7508('0x65')](_0xb92308[_0x2b5b63]['id']);}}}return _0xba3bbd;};exports[_0x7508('0x66')]=function(_0x130c34){var _0x55c8fd=moment()[_0x7508('0x7')](0x0);var _0x438daa=moment(_0x130c34)[_0x7508('0x7')](0x0);return _0x55c8fd[_0x7508('0x8')](_0x438daa,_0x7508('0x9'));};exports[_0x7508('0x67')]=function(_0x1a31f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a31f['ContactId'],'ListId':_0x1a31f[_0x7508('0x54')],'VoiceQueueId':_0x1a31f[_0x7508('0x1e')]||undefined,'CampaignId':_0x1a31f[_0x7508('0x68')]||undefined};};exports['filterKey']=function(_0x5b4fd4){if(_0x5b4fd4==='uniqueid'||_0x5b4fd4===_0x7508('0x69')||_0x5b4fd4===_0x7508('0x5b')||_0x5b4fd4===_0x7508('0x6a')||_0x5b4fd4===_0x7508('0x6b')||_0x5b4fd4===_0x7508('0x6c')||_0x5b4fd4===_0x7508('0x3e')||_0x5b4fd4===_0x7508('0x46')||_0x5b4fd4===_0x7508('0x1b')||_0x5b4fd4===_0x7508('0x51')||_0x5b4fd4==='calleridnum'||_0x5b4fd4===_0x7508('0x6d')||_0x5b4fd4===_0x7508('0x6e')||_0x5b4fd4===_0x7508('0x49')||_0x5b4fd4===_0x7508('0x4a')||_0x5b4fd4===_0x7508('0x6f')||_0x5b4fd4===_0x7508('0x70')||_0x5b4fd4===_0x7508('0x71')||_0x5b4fd4===_0x7508('0x72')||_0x5b4fd4===_0x7508('0x73')||_0x5b4fd4===_0x7508('0x1d')||_0x5b4fd4===_0x7508('0x54')||_0x5b4fd4===_0x7508('0x74')||_0x5b4fd4==='VoiceQueueId'||_0x5b4fd4===_0x7508('0x75')||_0x5b4fd4===_0x7508('0x76')||_0x5b4fd4===_0x7508('0x77')||_0x5b4fd4===_0x7508('0x78')||_0x5b4fd4===_0x7508('0x79')||_0x5b4fd4===_0x7508('0x7a')||_0x5b4fd4==='xmd-dialtimeout'||_0x5b4fd4===_0x7508('0x7b')||_0x5b4fd4==='xmd-dialid'||_0x5b4fd4===_0x7508('0x7c')||_0x5b4fd4===_0x7508('0x7d')||_0x5b4fd4===_0x7508('0x7e')||_0x5b4fd4==='xmd-callerid'||_0x5b4fd4===_0x7508('0x7f')||_0x5b4fd4==='xmd-agi'||_0x5b4fd4===_0x7508('0x80')||_0x5b4fd4===_0x7508('0x81')||_0x5b4fd4==='rtpaudioqosjitter'||_0x5b4fd4===_0x7508('0x82')||_0x5b4fd4===_0x7508('0x83')||_0x5b4fd4===_0x7508('0x84')||_0x5b4fd4==='rtpaudioqosrtt'||_0x5b4fd4===_0x7508('0x85')||_0x5b4fd4===_0x7508('0x80')||_0x5b4fd4===_0x7508('0x81')||_0x5b4fd4===_0x7508('0x86')||_0x5b4fd4===_0x7508('0x82')||_0x5b4fd4===_0x7508('0x83')||_0x5b4fd4===_0x7508('0x84')||_0x5b4fd4===_0x7508('0x87')||_0x5b4fd4===_0x7508('0x85')||_0x5b4fd4===_0x7508('0x88')||_0x5b4fd4===_0x7508('0x89')||_0x5b4fd4===_0x7508('0x39')||_0x5b4fd4===_0x7508('0x3a')){return![];}return!![];};exports[_0x7508('0x8a')]=function(_0x41a38c,_0x371854){var _0x3077af,_0x1f5319,_0x27f44f;if(_0x371854<=0x0){_0x371854=0x1;}_0x3077af=new RegExp(_0x7508('0x8b')+_0x371854+'}$');_0x1f5319=Math['pow'](0xa,_0x371854-0x1);_0x27f44f=Math[_0x7508('0x8c')](0xa,_0x371854)-0x1;return util[_0x7508('0x16')]('%s',_[_0x7508('0x8d')](_0x41a38c,_0x3077af,_['random'](_0x1f5319,_0x27f44f)));};exports['extractCalleridName']=function(_0x5c8ade){var _0x509c08=_0x5c8ade[_0x7508('0x8e')](/"(.*?)"/);return _0x509c08?_0x509c08[0x1]:_0x5c8ade;};exports[_0x7508('0x8f')]=function(_0x1c105b){var _0x53dc16=_0x1c105b[_0x7508('0x8e')](/<(.*?)>/);return _0x53dc16?_0x53dc16[0x1]:_0x1c105b;}; \ No newline at end of file +var _0x5248=['variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','Global','active','add','minutes','ListId','decrementTalkink','pTalking','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','xmd-queue','xmd-listid','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','logger2','getCallerId','isEmpty','isUndefined','string','\x22%s\x22\x20<%s>','format','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','talktime','answertime','isFailure','Failure'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0x5248,0x1c6));var _0x8524=function(_0x4340f0,_0x2c6471){_0x4340f0=_0x4340f0-0x0;var _0x21d3e4=_0x5248[_0x4340f0];return _0x21d3e4;};'use strict';var util=require(_0x8524('0x0'));var _=require(_0x8524('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x8524('0x2'));var ipAgi=process[_0x8524('0x3')][_0x8524('0x4')]||_0x8524('0x5');function getSeconds(_0x587b42,_0x5b5171){var _0x1fe5c7=moment(_0x587b42)[_0x8524('0x6')](0x0);var _0x4fa0f2=moment(_0x5b5171)[_0x8524('0x6')](0x0);return _0x1fe5c7[_0x8524('0x7')](_0x4fa0f2,_0x8524('0x8'));}exports[_0x8524('0x9')]=function(_0x298f0a){return function(_0x5a104c){logger['error'](_0x298f0a,util[_0x8524('0xa')](_0x5a104c,{'showHidden':![],'depth':null}));};};exports[_0x8524('0xb')]=function(_0x2d591e,_0x158cd7){logger[_0x8524('0xc')](_0x2d591e,util[_0x8524('0xa')](_0x158cd7,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2bb2d0,_0x504bcf){logger['error'](_0x2bb2d0,util['inspect'](_0x504bcf,{'showHidden':![],'depth':null}));};exports[_0x8524('0xd')]=function(_0x319962){return function(_0x51c08a){logger[_0x8524('0xc')](_0x319962,util['inspect'](_0x51c08a,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4f6898,_0x258d31,_0x31501d){return{'message':_0x4f6898,'unlock':_0x258d31,'active':_0x31501d};};exports[_0x8524('0xe')]=function(_0x46f4b0,_0xe27241,_0x5e056b){if(!_['isUndefined'](_0x5e056b)&&'string'===typeof _0x5e056b&&!_[_0x8524('0xf')](_0x5e056b)){if(!_[_0x8524('0x10')](_0xe27241)&&_0x8524('0x11')===typeof _0xe27241&&!_[_0x8524('0xf')](_0xe27241)){return util['format'](_0x8524('0x12'),_0xe27241,_0x5e056b);}return util[_0x8524('0x13')](_0x8524('0x12'),_0x5e056b,_0x5e056b);}if(!_[_0x8524('0x10')](_0x46f4b0)&&'string'===typeof _0x46f4b0&&!_[_0x8524('0xf')](_0x46f4b0)){return _0x46f4b0;}return'\x22\x22\x20<>';};exports[_0x8524('0x14')]=function(_0x423e97){if(_[_0x8524('0x15')](_0x423e97)){return![];}return _0x423e97;};exports['addVariables']=function(_0x4e7651,_0x1d9194,_0x5b2f37,_0x37e192,_0x3be87f,_0xaf71a8){var _0x1b7380={'XMD-QUEUE':_0x1d9194['Queue']?_0x1d9194[_0x8524('0x16')][_0x8524('0x17')]:'','XMD-CALLERID':_0x37e192,'XMD-CALLERID-PREVIEW':_0xaf71a8?util[_0x8524('0x13')](_0x8524('0x12'),_0xaf71a8['calleridname'],_0xaf71a8[_0x8524('0x18')]):_0x37e192,'XMD-DIALID':_0x3be87f,'XMD-CONTACTID':_0x1d9194[_0x8524('0x19')],'XMD-CDRTYPE':_0x8524('0x1a'),'CALLERID(all)':_0x37e192,'XMD-VOICEQUEUEID':_0x1d9194[_0x8524('0x1b')],'XMD-DIALCHANNEL':_0x5b2f37,'XMD-DIALTIMEOUT':_0x4e7651[_0x8524('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x4e7651[_0x8524('0x1d')]?'g':'',_[_0x8524('0xf')](_0x4e7651[_0x8524('0x1e')])?'':_0x8524('0x1f')),'XMD-DIALURL':_0x4e7651['dialPreviewUrl']||'','XMD-AGI':_0x4e7651[_0x8524('0x20')]?util[_0x8524('0x13')](_0x8524('0x21'),ipAgi,_0x4e7651[_0x8524('0x20')]):_0x8524('0x22'),'XMD-AGIAFTER':_0x4e7651['dialQueueProject2']?util[_0x8524('0x13')](_0x8524('0x21'),ipAgi,_0x4e7651[_0x8524('0x1d')]):_0x8524('0x22'),'XMD-ORIGINATECALLERIDNUM':_0xaf71a8?_0xaf71a8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0xaf71a8?_0xaf71a8[_0x8524('0x23')]:'','XMD-DESTINATION':_0x8524('0x24')};if(!_['isEmpty'](_0x4e7651['monitor_format'])){_0x1b7380[util[_0x8524('0x13')]('%s',_0x8524('0x25'))]=_0x4e7651[_0x8524('0x1e')];_0x1b7380[util['format']('%s',_0x8524('0x26'))]=_0x3be87f;}if(_0x1d9194&&_0x1d9194['Contact']){for(var _0x445ba8 in _0x1d9194[_0x8524('0x27')]){if(_0x1d9194['Contact'][_0x8524('0x28')](_0x445ba8)){if(!_[_0x8524('0x15')](_0x1d9194['Contact'][_0x445ba8])&&_0x445ba8!=='id'&&_0x445ba8!==_0x8524('0x29')&&_0x445ba8!==_0x8524('0x2a')&&_0x445ba8!==_0x8524('0x2b')){_0x1b7380[util['format'](_0x8524('0x2c'),_0x8524('0x2d'),_[_0x8524('0x2e')](_0x445ba8))]=_0x1d9194[_0x8524('0x27')][_0x445ba8];}}}}return _0x1b7380;};exports['toLowerVariables']=function(_0x1276d9){var _0x2cc493={};for(var _0x1ac2f0 in _0x1276d9){if(_0x1276d9[_0x8524('0x28')](_0x1ac2f0)){_0x2cc493[util[_0x8524('0x13')]('%s',_['toLower'](_0x1ac2f0))]=_0x1276d9[_0x1ac2f0];}}return{'variables':_0x2cc493};};exports[_0x8524('0x2f')]=function(_0x34518b,_0x31e537){if(!_[_0x8524('0x15')](_0x34518b)){if(_0x34518b[_0x8524('0x28')](_0x8524('0x30'))){if(_0x34518b[_0x8524('0x30')]>0x0){_0x34518b[_0x8524('0x30')]-=0x1;}else{logger[_0x8524('0x31')](_0x8524('0x32'),_0x31e537);}}}else{logger['error'](_0x8524('0x33'),_0x31e537);}};exports[_0x8524('0x34')]=function(_0x4dd60b){var _0x816206=moment()[_0x8524('0x13')](_0x8524('0x35'));_0x4dd60b[_0x8524('0x36')]=0xd;_0x4dd60b[_0x8524('0x37')]=_0x8524('0x38');_0x4dd60b[_0x8524('0x39')]=_0x816206;_0x4dd60b['responsetime']=_0x816206;_0x4dd60b[_0x8524('0x3a')]=_0x816206;};exports[_0x8524('0x3b')]=function(_0x41594a,_0x6b2309,_0x35d8dd){var _0x22102f=moment()[_0x8524('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x41594a['state']=_0x6b2309;_0x41594a['statedesc']=_0x35d8dd;_0x41594a[_0x8524('0x3c')]=_0x22102f;_0x41594a[_0x8524('0x3d')]=getSeconds(_0x41594a[_0x8524('0x3c')],_0x41594a[_0x8524('0x39')]);};exports['logLookAgent']=function(_0x3aa76e,_0x44292c,_0x406725){_0x3aa76e['membername']=_0x44292c;_0x3aa76e['UserId']=_0x406725;};exports['logCustomer']=function(_0x2bf598,_0x20dd31,_0x982399){var _0x82f3d=moment()[_0x8524('0x13')](_0x8524('0x35'));_0x2bf598['state']=_0x20dd31;_0x2bf598['statedesc']=_0x982399;_0x2bf598[_0x8524('0x3c')]=_0x2bf598[_0x8524('0x3c')]?_0x2bf598[_0x8524('0x3c')]:_0x82f3d;_0x2bf598[_0x8524('0x3a')]=_0x2bf598['endtime']?_0x2bf598[_0x8524('0x3a')]:_0x82f3d;_0x2bf598[_0x8524('0x3d')]=getSeconds(_0x2bf598[_0x8524('0x3c')]||0x0,_0x2bf598[_0x8524('0x39')]||0x0);_0x2bf598[_0x8524('0x3e')]=_0x2bf598[_0x8524('0x3f')]?getSeconds(_0x2bf598[_0x8524('0x3a')],_0x2bf598[_0x8524('0x3f')]):0x0;};exports[_0x8524('0x40')]=function(_0x1fdc40){return _0x1fdc40===_0x8524('0x41');};exports[_0x8524('0x42')]=function(_0x129df1,_0x4c6b48,_0x532387,_0x5e6ef5,_0xebd242){var _0x544f25=_0x5e6ef5?_0x8524('0x43'):_0x129df1[_0x8524('0x44')];_0x544f25=_0xebd242?'BOOKED':_0x544f25;return{'actionid':_0x129df1[_0x8524('0x45')],'action':_0x8524('0x46'),'channel':_0x129df1[_0x8524('0x47')],'callerid':util[_0x8524('0x13')](_0x8524('0x12'),_0x544f25,_0x129df1[_0x8524('0x18')]),'Exten':_0x8524('0x24'),'Context':_0x8524('0x48'),'Priority':'1','variable':_0x532387,'timeout':(_0x4c6b48['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x129df1['uniqueid']};};exports[_0x8524('0x49')]=function(_0xe9e30e){return _0xe9e30e['countbusyretry']+_0xe9e30e[_0x8524('0x4a')]+_0xe9e30e[_0x8524('0x4b')]+_0xe9e30e[_0x8524('0x4c')]+_0xe9e30e['countnosuchnumberretry'];};exports['cloneAction']=function(_0xbade74){var _0x1f186c=_['clone'](_0xbade74);_0x1f186c['state']=0xf;_0x1f186c['statedesc']=_0x8524('0x4d');return _0x1f186c;};exports['scheduledAt']=function(_0x690760,_0x2744c0,_0x244c45){var _0x5b43ad={};_0x5b43ad[_0x2744c0]=_0x690760[_0x2744c0];_0x5b43ad[_0x8524('0x4e')]=![];_0x5b43ad['scheduledat']=moment()[_0x8524('0x4f')](_0x244c45,_0x8524('0x50'))[_0x8524('0x13')](_0x8524('0x35'));_0x5b43ad[_0x8524('0x19')]=_0x690760['ContactId'];_0x5b43ad['ListId']=_0x690760[_0x8524('0x51')];_0x5b43ad[_0x8524('0x1b')]=_0x690760[_0x8524('0x1b')]||undefined;return _0x5b43ad;};exports[_0x8524('0x52')]=function(_0xcae708,_0x5db57c){if(!_[_0x8524('0x15')](_0xcae708)){if(_0xcae708[_0x8524('0x53')]>0x0){_0xcae708[_0x8524('0x53')]-=0x1;}else{logger[_0x8524('0x31')](_0x5db57c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x8524('0x31')](_0x5db57c,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x229b5a){if(_0x229b5a<=0x0){return!![];}return![];};exports[_0x8524('0x54')]=function(_0x3b7fa7,_0x2d822e,_0x1ed49d){_0x3b7fa7[_0x8524('0x55')]=_0x2d822e;_0x3b7fa7['name']=_0x3b7fa7[_0x8524('0x56')];_0x3b7fa7[_0x8524('0x57')]=_0x3b7fa7[_0x8524('0x47')];_0x3b7fa7[_0x8524('0x58')]=_0x8524('0x59');if(_0x1ed49d){_0x3b7fa7[_0x8524('0x5a')]=_0x1ed49d[_0x8524('0x5a')];}return _0x3b7fa7;};exports['buildAcw']=function(_0xd119ea){var _0x27daec={};_0x27daec[_0x8524('0x56')]=_0xd119ea[_0x8524('0x56')];_0x27daec[_0x8524('0x57')]=_0xd119ea[_0x8524('0x47')];_0x27daec[_0x8524('0x45')]=_0xd119ea[_0x8524('0x45')];return _0x27daec;};exports[_0x8524('0x5b')]=function(_0x5933a1){var _0x57b30e=[];for(var _0x2f4675 in _0x5933a1){if(_0x5933a1['hasOwnProperty'](_0x2f4675)){if(!_[_0x8524('0x15')](_0x5933a1[_0x2f4675])&&_0x5933a1[_0x2f4675][_0x8524('0x36')]===_0x8524('0x5c')&&_0x5933a1[_0x2f4675][_0x8524('0x5d')]===_0x8524('0x5e')){_0x57b30e['push'](_0x5933a1[_0x2f4675]['id']);}}}return _0x57b30e;};exports[_0x8524('0x5f')]=function(_0x133997){var _0x28dbfd=moment()['milliseconds'](0x0);var _0x27a501=moment(_0x133997)[_0x8524('0x6')](0x0);return _0x28dbfd[_0x8524('0x7')](_0x27a501,_0x8524('0x8'));};exports[_0x8524('0x60')]=function(_0x38cd9b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38cd9b[_0x8524('0x19')],'ListId':_0x38cd9b[_0x8524('0x51')],'VoiceQueueId':_0x38cd9b[_0x8524('0x1b')]||undefined,'CampaignId':_0x38cd9b[_0x8524('0x61')]||undefined};};exports[_0x8524('0x62')]=function(_0x2d7645){if(_0x2d7645===_0x8524('0x45')||_0x2d7645===_0x8524('0x63')||_0x2d7645===_0x8524('0x56')||_0x2d7645==='type'||_0x2d7645===_0x8524('0x64')||_0x2d7645===_0x8524('0x65')||_0x2d7645==='membername'||_0x2d7645===_0x8524('0x47')||_0x2d7645===_0x8524('0x44')||_0x2d7645===_0x8524('0x4e')||_0x2d7645===_0x8524('0x18')||_0x2d7645===_0x8524('0x66')||_0x2d7645==='countbusyretry'||_0x2d7645==='countcongestionretry'||_0x2d7645===_0x8524('0x4b')||_0x2d7645===_0x8524('0x67')||_0x2d7645==='callback'||_0x2d7645===_0x8524('0x68')||_0x2d7645===_0x8524('0x69')||_0x2d7645===_0x8524('0x6a')||_0x2d7645===_0x8524('0x19')||_0x2d7645===_0x8524('0x51')||_0x2d7645==='UserId'||_0x2d7645===_0x8524('0x1b')||_0x2d7645==='sipcallid'||_0x2d7645==='xmd-voicequeueid'||_0x2d7645===_0x8524('0x6b')||_0x2d7645==='xmd-phone'||_0x2d7645===_0x8524('0x6c')||_0x2d7645==='xmd-dialurl'||_0x2d7645==='xmd-dialtimeout'||_0x2d7645==='xmd-dialoptions'||_0x2d7645===_0x8524('0x6d')||_0x2d7645===_0x8524('0x6e')||_0x2d7645===_0x8524('0x6f')||_0x2d7645===_0x8524('0x70')||_0x2d7645===_0x8524('0x71')||_0x2d7645===_0x8524('0x72')||_0x2d7645==='xmd-agi'||_0x2d7645===_0x8524('0x73')||_0x2d7645==='rtpaudioqosbridged'||_0x2d7645==='rtpaudioqosjitter'||_0x2d7645==='rtpaudioqosjitterbridged'||_0x2d7645==='rtpaudioqosloss'||_0x2d7645===_0x8524('0x74')||_0x2d7645===_0x8524('0x75')||_0x2d7645===_0x8524('0x76')||_0x2d7645==='rtpaudioqos'||_0x2d7645==='rtpaudioqosbridged'||_0x2d7645===_0x8524('0x77')||_0x2d7645===_0x8524('0x78')||_0x2d7645===_0x8524('0x79')||_0x2d7645===_0x8524('0x74')||_0x2d7645==='rtpaudioqosrtt'||_0x2d7645===_0x8524('0x76')||_0x2d7645===_0x8524('0x7a')||_0x2d7645===_0x8524('0x7b')||_0x2d7645===_0x8524('0x36')||_0x2d7645===_0x8524('0x37')){return![];}return!![];};exports[_0x8524('0x7c')]=function(_0x10f7a6,_0x3861b3){var _0x3cee7e,_0x4e1cc9,_0x561d9c;if(_0x3861b3<=0x0){_0x3861b3=0x1;}_0x3cee7e=new RegExp('\x5cw{0,'+_0x3861b3+'}$');_0x4e1cc9=Math[_0x8524('0x7d')](0xa,_0x3861b3-0x1);_0x561d9c=Math['pow'](0xa,_0x3861b3)-0x1;return util['format']('%s',_[_0x8524('0x7e')](_0x10f7a6,_0x3cee7e,_[_0x8524('0x7f')](_0x4e1cc9,_0x561d9c)));};exports['extractCalleridName']=function(_0x48e75b){var _0x370ffe=_0x48e75b[_0x8524('0x80')](/"(.*?)"/);return _0x370ffe?_0x370ffe[0x1]:_0x48e75b;};exports[_0x8524('0x81')]=function(_0x5b15bd){var _0x25f61f=_0x5b15bd[_0x8524('0x80')](/<(.*?)>/);return _0x25f61f?_0x25f61f[0x1]:_0x5b15bd;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c00a355..50886d3 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 _0x1ba7=['number','boolean','queueremove','string','queuepause','voicechannel','voicequeuechannelredirect','queueadd'];(function(_0x3a1749,_0x456218){var _0x5425a7=function(_0x525b41){while(--_0x525b41){_0x3a1749['push'](_0x3a1749['shift']());}};_0x5425a7(++_0x456218);}(_0x1ba7,0x1b7));var _0x71ba=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x1ba7[_0x220dbb];return _0x2b77de;};'use strict';exports[_0x71ba('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x71ba('0x1'),'required':![]},'paused':{'type':_0x71ba('0x2'),'required':![]}};exports[_0x71ba('0x3')]={'queue':{'type':_0x71ba('0x4'),'required':!![]},'interface':{'type':_0x71ba('0x4'),'required':!![]}};exports[_0x71ba('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x71ba('0x4'),'required':![]}};exports['reload']={'module':{'type':_0x71ba('0x4'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x71ba('0x6')]={'uniqueid':{'type':_0x71ba('0x4'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x71ba('0x4')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x71ba('0x4'),'required':!![]}};exports[_0x71ba('0x7')]={'uniqueid':{'type':_0x71ba('0x4'),'required':!![]},'exten':{'type':_0x71ba('0x4'),'required':!![]},'context':{'type':_0x71ba('0x4')}}; \ No newline at end of file +var _0x325d=['number','boolean','reload','voicequeuechannelredirect','queueadd','string'];(function(_0x4f69de,_0x25c68d){var _0x4cbe66=function(_0x24a682){while(--_0x24a682){_0x4f69de['push'](_0x4f69de['shift']());}};_0x4cbe66(++_0x25c68d);}(_0x325d,0xb2));var _0xd325=function(_0x4d3180,_0x377996){_0x4d3180=_0x4d3180-0x0;var _0x103996=_0x325d[_0x4d3180];return _0x103996;};'use strict';exports[_0xd325('0x0')]={'queue':{'type':_0xd325('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xd325('0x2'),'required':![]},'paused':{'type':_0xd325('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xd325('0x1'),'required':!![]},'interface':{'type':_0xd325('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xd325('0x1'),'required':!![]},'paused':{'type':_0xd325('0x3')},'reason':{'type':'string','required':![]}};exports[_0xd325('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xd325('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd325('0x1')},'format':{'type':_0xd325('0x1')},'mixmonitorid':{'type':_0xd325('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xd325('0x1'),'required':!![]}};exports[_0xd325('0x5')]={'uniqueid':{'type':_0xd325('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0bc62b7..97d3a1a 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 _0xe7e5=['outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','prototype','length','isUndefined','initVoiceQueues','voiceQueues','triggers','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xe7e5,0xfe));var _0x5e7e=function(_0x3607b5,_0x5dc7d){_0x3607b5=_0x3607b5-0x0;var _0x236348=_0xe7e5[_0x3607b5];return _0x236348;};'use strict';var BPromise=require('bluebird');var util=require(_0x5e7e('0x0'));var _=require(_0x5e7e('0x1'));var moment=require(_0x5e7e('0x2'));var Agent=require(_0x5e7e('0x3'));var Telephone=require(_0x5e7e('0x4'));var Trunk=require(_0x5e7e('0x5'));var VoiceQueue=require(_0x5e7e('0x6'));var Trigger=require(_0x5e7e('0x7'));var Template=require(_0x5e7e('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x5e7e('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x5e7e('0xa'));var FreshdeskAccount=require(_0x5e7e('0xb'));var SugarcrmAccount=require(_0x5e7e('0xc'));var ZohoAccount=require(_0x5e7e('0xd'));var DeskAccount=require(_0x5e7e('0xe'));var VtigerAccount=require(_0x5e7e('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x5e7e('0x10'));var Realtime=function(){this[_0x5e7e('0x11')]={};this[_0x5e7e('0x12')]={};this[_0x5e7e('0x13')]={};this['voiceQueues']={};this['triggers']={};this[_0x5e7e('0x14')]={};this[_0x5e7e('0x15')]={};this[_0x5e7e('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5e7e('0x17')]={};this['channels']={};this[_0x5e7e('0x18')]={};this[_0x5e7e('0x19')]={};this[_0x5e7e('0x1a')]={};this[_0x5e7e('0x1b')]={};this[_0x5e7e('0x1c')]={};this[_0x5e7e('0x1d')]={};this[_0x5e7e('0x1e')]={};this[_0x5e7e('0x1f')]={};this[_0x5e7e('0x20')]={};this[_0x5e7e('0x21')]={};this[_0x5e7e('0x22')]={};this[_0x5e7e('0x23')]={};this[_0x5e7e('0x24')]={};this['freshsalesAccounts']={};this[_0x5e7e('0x25')]={};};function freeIsNotKey(_0x23b72c,_0x4bb04e,_0x203a04){var _0x271929=_[_0x5e7e('0x26')](_0x23b72c,function(_0xa14d58,_0xc6fda9){return _0xa14d58[_0x203a04];});for(var _0x1167a3 in _0x4bb04e){if(_0x4bb04e[_0x5e7e('0x27')](_0x1167a3)){if(!_0x271929[_0x1167a3]){delete _0x4bb04e[_0x1167a3];}}}}function freeIsNotKeySip(_0x5ca368,_0x146dab){var _0x5cf0cc=_[_0x5e7e('0x26')](_0x5ca368,function(_0x35981f,_0x2984dd){return util[_0x5e7e('0x28')](_0x5e7e('0x29'),_0x35981f[_0x5e7e('0x2a')]);});for(var _0x29b71 in _0x146dab){if(_0x146dab[_0x5e7e('0x27')](_0x29b71)){if(!_0x5cf0cc[_0x29b71]){delete _0x146dab[_0x29b71];}}}}function freeIsNotKeyAgent(_0x319ab0,_0xa1b137){var _0x366663=_[_0x5e7e('0x26')](_0x319ab0,function(_0x4d46dd,_0x47f3f4){var _0x3e049b=_['isNil'](_0x4d46dd[_0x5e7e('0x2b')])?util[_0x5e7e('0x28')](_0x5e7e('0x29'),_0x4d46dd[_0x5e7e('0x2a')]):_0x4d46dd[_0x5e7e('0x2b')];return _0x3e049b;});for(var _0x405cdd in _0xa1b137){if(_0xa1b137[_0x5e7e('0x27')](_0x405cdd)){if(!_0x366663[_0x405cdd]){delete _0xa1b137[_0x405cdd];}}}}function clearVoiceCallReports(_0x2dd20a){_0x2dd20a[_0x5e7e('0x2c')]=0x0;_0x2dd20a[_0x5e7e('0x2d')]=0x0;_0x2dd20a['sumHoldTime']=0x0;_0x2dd20a[_0x5e7e('0x2e')]=0x0;_0x2dd20a[_0x5e7e('0x2f')]=0x0;}function clearCampaigns(_0xcb90a){if(!_[_0x5e7e('0x30')](_0xcb90a)){for(var _0x585581 in _0xcb90a){if(_0xcb90a[_0x5e7e('0x27')](_0x585581)){_0xcb90a[_0x585581]['ivrTotalCallsDays']=0x0;_0xcb90a[_0x585581][_0x5e7e('0x31')]=0x0;}}}}function clearVoiceQueues(_0x2669fd){if(!_[_0x5e7e('0x30')](_0x2669fd)){for(var _0x219bab in _0x2669fd){if(_0x2669fd[_0x5e7e('0x27')](_0x219bab)){_0x2669fd[_0x219bab][_0x5e7e('0x2c')]=0x0;_0x2669fd[_0x219bab]['answered']=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x32')]=0x0;_0x2669fd[_0x219bab]['abandoned']=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x33')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x2e')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x2f')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x34')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x35')]=0x0;_0x2669fd[_0x219bab]['outboundBusyCallsDay']=0x0;_0x2669fd[_0x219bab]['outboundCongestionCallsDay']=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x36')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x37')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x38')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x39')]=0x0;_0x2669fd[_0x219bab]['outboundBlacklistCallsDay']=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x3a')]=0x0;_0x2669fd[_0x219bab]['outboundRejectCallsDay']=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x3b')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x34')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x3c')]=0x0;_0x2669fd[_0x219bab][_0x5e7e('0x3d')]=!![];}}}}Realtime['prototype'][_0x5e7e('0x3e')]=function(_0x3fb225,_0x502fc3){for(var _0x4738ad in _0x502fc3){if(_0x3fb225[_0x5e7e('0x27')](_0x4738ad)){_0x3fb225[_0x4738ad]=_0x502fc3[_0x4738ad];}}};Realtime['prototype'][_0x5e7e('0x3f')]=function(){var _0x1781d5=this;return function(_0x12d9e5){if(_0x12d9e5){freeIsNotKeyAgent(_0x12d9e5,_0x1781d5['agents']);for(var _0x224605=0x0,_0x3ee2a5={},_0xe064f6={};_0x224605<_0x12d9e5['length'];_0x224605+=0x1){_0x3ee2a5=_0x12d9e5[_0x224605];var _0x122e9d=_['isNil'](_0x3ee2a5[_0x5e7e('0x2b')])?util[_0x5e7e('0x28')](_0x5e7e('0x29'),_0x3ee2a5['name']):_0x3ee2a5[_0x5e7e('0x2b')];if(_['isUndefined'](_0x1781d5[_0x5e7e('0x11')][_0x122e9d])){_0x1781d5[_0x5e7e('0x11')][_0x122e9d]=new Agent(_0x3ee2a5);}else{_0x1781d5['mergeFromDatabase'](_0x1781d5[_0x5e7e('0x11')][_0x122e9d],_0x3ee2a5);}}}return _0x1781d5['agents'];};};Realtime[_0x5e7e('0x40')]['initTelephones']=function(){var _0x235b54=this;return function(_0x336bac){if(_0x336bac){freeIsNotKeySip(_0x336bac,_0x235b54['telephones']);for(var _0x13443b=0x0,_0x183a8c={},_0x594286={};_0x13443b<_0x336bac[_0x5e7e('0x41')];_0x13443b+=0x1){_0x183a8c=_0x336bac[_0x13443b];if(_[_0x5e7e('0x42')](_0x235b54['telephones'][util['format']('SIP/%s',_0x183a8c[_0x5e7e('0x2a')])])){_0x235b54[_0x5e7e('0x12')][util[_0x5e7e('0x28')](_0x5e7e('0x29'),_0x183a8c[_0x5e7e('0x2a')])]=new Telephone(_0x183a8c);}else{_0x235b54[_0x5e7e('0x3e')](_0x235b54['telephones'][util['format'](_0x5e7e('0x29'),_0x183a8c[_0x5e7e('0x2a')])],_0x183a8c);}}}return _0x235b54[_0x5e7e('0x12')];};};Realtime[_0x5e7e('0x40')]['initTrunks']=function(){var _0x3f43f3=this;return function(_0x243574){if(_0x243574){freeIsNotKeySip(_0x243574,_0x3f43f3['trunks']);for(var _0x2d287e=0x0,_0x23bdd3={},_0x33508e={};_0x2d287e<_0x243574[_0x5e7e('0x41')];_0x2d287e+=0x1){_0x23bdd3=_0x243574[_0x2d287e];if(_[_0x5e7e('0x42')](_0x3f43f3['trunks'][util[_0x5e7e('0x28')](_0x5e7e('0x29'),_0x23bdd3[_0x5e7e('0x2a')])])){_0x3f43f3[_0x5e7e('0x13')][util['format'](_0x5e7e('0x29'),_0x23bdd3['name'])]=new Trunk(_0x23bdd3);}else{_0x3f43f3[_0x5e7e('0x3e')](_0x3f43f3[_0x5e7e('0x13')][util[_0x5e7e('0x28')]('SIP/%s',_0x23bdd3[_0x5e7e('0x2a')])],_0x23bdd3);}}}return _0x3f43f3[_0x5e7e('0x13')];};};Realtime['prototype'][_0x5e7e('0x43')]=function(){var _0x5892ed=this;return function(_0xf2821f){if(_0xf2821f){freeIsNotKey(_0xf2821f,_0x5892ed[_0x5e7e('0x44')],_0x5e7e('0x2a'));for(var _0x289048=0x0,_0x3d10d2={},_0x513887={};_0x289048<_0xf2821f[_0x5e7e('0x41')];_0x289048+=0x1){_0x3d10d2=_0xf2821f[_0x289048];if(_['isUndefined'](_0x5892ed[_0x5e7e('0x44')][_0x3d10d2[_0x5e7e('0x2a')]])){_0x5892ed['voiceQueues'][_0x3d10d2[_0x5e7e('0x2a')]]=new VoiceQueue(_0x3d10d2);}else{_0x5892ed[_0x5e7e('0x3e')](_0x5892ed[_0x5e7e('0x44')][_0x3d10d2[_0x5e7e('0x2a')]],_0x3d10d2);}}}return _0x5892ed[_0x5e7e('0x44')];};};Realtime['prototype']['initTriggers']=function(){var _0x2500d4=this;return function(_0x41f75c){if(_0x41f75c){freeIsNotKey(_0x41f75c,_0x2500d4[_0x5e7e('0x45')],'id');for(var _0x32b8f5=0x0,_0x280858={},_0x12d64e={};_0x32b8f5<_0x41f75c[_0x5e7e('0x41')];_0x32b8f5+=0x1){_0x280858=_0x41f75c[_0x32b8f5];if(_['isUndefined'](_0x2500d4['triggers'][_0x280858['id']])){_0x2500d4[_0x5e7e('0x45')][_0x280858['id']]=new Trigger(_0x280858);}else{_0x2500d4['mergeFromDatabase'](_0x2500d4[_0x5e7e('0x45')][_0x280858['id']],_0x280858);}}}return _0x2500d4[_0x5e7e('0x45')];};};Realtime[_0x5e7e('0x40')]['initTemplates']=function(){var _0x265d60=this;return function(_0x1eee8d){if(_0x1eee8d){freeIsNotKey(_0x1eee8d,_0x265d60[_0x5e7e('0x15')],'id');for(var _0x30c62c=0x0,_0x43e376={},_0x456ca4={};_0x30c62c<_0x1eee8d[_0x5e7e('0x41')];_0x30c62c+=0x1){_0x43e376=_0x1eee8d[_0x30c62c];if(_[_0x5e7e('0x42')](_0x265d60[_0x5e7e('0x15')][_0x43e376['id']])){_0x265d60[_0x5e7e('0x15')][_0x43e376['id']]=new Template(_0x43e376);}else{_0x265d60[_0x5e7e('0x3e')](_0x265d60[_0x5e7e('0x15')][_0x43e376['id']],_0x43e376);}}}return _0x265d60[_0x5e7e('0x15')];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x46')]=function(){var _0xb9c151=this;return function(_0x405107){if(_0x405107){freeIsNotKey(_0x405107,_0xb9c151[_0x5e7e('0x1c')],'id');for(var _0x329097=0x0,_0x9af581={},_0x5535e8={};_0x329097<_0x405107[_0x5e7e('0x41')];_0x329097+=0x1){_0x9af581=_0x405107[_0x329097];if(_[_0x5e7e('0x42')](_0xb9c151[_0x5e7e('0x1c')][_0x9af581['id']])){_0xb9c151['zendeskAccounts'][_0x9af581['id']]=new ZendeskAccount(_0x9af581);}else{_0xb9c151['mergeFromDatabase'](_0xb9c151[_0x5e7e('0x1c')][_0x9af581['id']],_0x9af581);}}}return _0xb9c151[_0x5e7e('0x1c')];};};Realtime[_0x5e7e('0x40')]['initSalesforceAccounts']=function(){var _0x4665c8=this;return function(_0x24dd6b){if(_0x24dd6b){freeIsNotKey(_0x24dd6b,_0x4665c8['salesforceAccounts'],'id');for(var _0x3fcc08=0x0,_0x27fdac={},_0x44c068={};_0x3fcc08<_0x24dd6b[_0x5e7e('0x41')];_0x3fcc08+=0x1){_0x27fdac=_0x24dd6b[_0x3fcc08];if(_[_0x5e7e('0x42')](_0x4665c8['salesforceAccounts'][_0x27fdac['id']])){_0x4665c8[_0x5e7e('0x1d')][_0x27fdac['id']]=new SalesforceAccount(_0x27fdac);}else{_0x4665c8['mergeFromDatabase'](_0x4665c8['salesforceAccounts'][_0x27fdac['id']],_0x27fdac);}}}return _0x4665c8[_0x5e7e('0x1d')];};};Realtime['prototype'][_0x5e7e('0x47')]=function(){var _0x371d3d=this;return function(_0x3892c7){if(_0x3892c7){freeIsNotKey(_0x3892c7,_0x371d3d['freshdeskAccounts'],'id');for(var _0x399bd0=0x0,_0x2ecbe7={},_0x4428e6={};_0x399bd0<_0x3892c7[_0x5e7e('0x41')];_0x399bd0+=0x1){_0x2ecbe7=_0x3892c7[_0x399bd0];if(_['isUndefined'](_0x371d3d[_0x5e7e('0x1f')][_0x2ecbe7['id']])){_0x371d3d[_0x5e7e('0x1f')][_0x2ecbe7['id']]=new FreshdeskAccount(_0x2ecbe7);}else{_0x371d3d[_0x5e7e('0x3e')](_0x371d3d[_0x5e7e('0x1f')][_0x2ecbe7['id']],_0x2ecbe7);}}}return _0x371d3d[_0x5e7e('0x1f')];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x48')]=function(){var _0x482864=this;return function(_0xf8edc9){if(_0xf8edc9){freeIsNotKey(_0xf8edc9,_0x482864[_0x5e7e('0x20')],'id');for(var _0x10cf9e=0x0,_0x58f24e={},_0x33475f={};_0x10cf9e<_0xf8edc9[_0x5e7e('0x41')];_0x10cf9e+=0x1){_0x58f24e=_0xf8edc9[_0x10cf9e];if(_['isUndefined'](_0x482864[_0x5e7e('0x20')][_0x58f24e['id']])){_0x482864[_0x5e7e('0x20')][_0x58f24e['id']]=new ZohoAccount(_0x58f24e);}else{_0x482864[_0x5e7e('0x3e')](_0x482864['zohoAccounts'][_0x58f24e['id']],_0x58f24e);}}}return _0x482864[_0x5e7e('0x20')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x145d17=this;return function(_0x42d3c5){if(_0x42d3c5){freeIsNotKey(_0x42d3c5,_0x145d17[_0x5e7e('0x21')],'id');for(var _0x6571ff=0x0,_0x86dd74={},_0x59deed={};_0x6571ff<_0x42d3c5['length'];_0x6571ff+=0x1){_0x86dd74=_0x42d3c5[_0x6571ff];if(_[_0x5e7e('0x42')](_0x145d17[_0x5e7e('0x21')][_0x86dd74['id']])){_0x145d17[_0x5e7e('0x21')][_0x86dd74['id']]=new DeskAccount(_0x86dd74);}else{_0x145d17[_0x5e7e('0x3e')](_0x145d17['deskAccounts'][_0x86dd74['id']],_0x86dd74);}}}return _0x145d17[_0x5e7e('0x21')];};};Realtime['prototype'][_0x5e7e('0x49')]=function(){var _0x47aac7=this;return function(_0x312184){if(_0x312184){freeIsNotKey(_0x312184,_0x47aac7[_0x5e7e('0x1e')],'id');for(var _0x25b577=0x0,_0x3e14e9={},_0x353ec9={};_0x25b577<_0x312184[_0x5e7e('0x41')];_0x25b577+=0x1){_0x3e14e9=_0x312184[_0x25b577];if(_[_0x5e7e('0x42')](_0x47aac7[_0x5e7e('0x1e')][_0x3e14e9['id']])){_0x47aac7['sugarcrmAccounts'][_0x3e14e9['id']]=new SugarcrmAccount(_0x3e14e9);}else{_0x47aac7[_0x5e7e('0x3e')](_0x47aac7[_0x5e7e('0x1e')][_0x3e14e9['id']],_0x3e14e9);}}}return _0x47aac7['sugarcrmAccounts'];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x4a')]=function(){var _0x2a5556=this;return function(_0x44a7ec){if(_0x44a7ec){freeIsNotKey(_0x44a7ec,_0x2a5556[_0x5e7e('0x22')],'id');for(var _0x41f2c5=0x0,_0x5a1ab9={},_0x41c7d0={};_0x41f2c5<_0x44a7ec['length'];_0x41f2c5+=0x1){_0x5a1ab9=_0x44a7ec[_0x41f2c5];if(_[_0x5e7e('0x42')](_0x2a5556[_0x5e7e('0x22')][_0x5a1ab9['id']])){_0x2a5556[_0x5e7e('0x22')][_0x5a1ab9['id']]=new VtigerAccount(_0x5a1ab9);}else{_0x2a5556['mergeFromDatabase'](_0x2a5556[_0x5e7e('0x22')][_0x5a1ab9['id']],_0x5a1ab9);}}}return _0x2a5556[_0x5e7e('0x22')];};};Realtime[_0x5e7e('0x40')]['initServicenowAccounts']=function(){var _0x36d773=this;return function(_0x34417c){if(_0x34417c){freeIsNotKey(_0x34417c,_0x36d773[_0x5e7e('0x23')],'id');for(var _0x4f8022=0x0,_0x31bfbb={},_0x1ff942={};_0x4f8022<_0x34417c[_0x5e7e('0x41')];_0x4f8022+=0x1){_0x31bfbb=_0x34417c[_0x4f8022];if(_[_0x5e7e('0x42')](_0x36d773[_0x5e7e('0x23')][_0x31bfbb['id']])){_0x36d773[_0x5e7e('0x23')][_0x31bfbb['id']]=new ServicenowAccount(_0x31bfbb);}else{_0x36d773[_0x5e7e('0x3e')](_0x36d773[_0x5e7e('0x23')][_0x31bfbb['id']],_0x31bfbb);}}}return _0x36d773[_0x5e7e('0x23')];};};Realtime['prototype'][_0x5e7e('0x4b')]=function(){var _0x28305b=this;return function(_0x2ef77b){if(_0x2ef77b){freeIsNotKey(_0x2ef77b,_0x28305b[_0x5e7e('0x24')],'id');for(var _0x2a0f47=0x0,_0x900add={},_0x2981c0={};_0x2a0f47<_0x2ef77b[_0x5e7e('0x41')];_0x2a0f47+=0x1){_0x900add=_0x2ef77b[_0x2a0f47];if(_[_0x5e7e('0x42')](_0x28305b[_0x5e7e('0x24')][_0x900add['id']])){_0x28305b[_0x5e7e('0x24')][_0x900add['id']]=new Dynamics365Account(_0x900add);}else{_0x28305b[_0x5e7e('0x3e')](_0x28305b[_0x5e7e('0x24')][_0x900add['id']],_0x900add);}}}return _0x28305b[_0x5e7e('0x24')];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x4c')]=function(){var _0x4691d2=this;return function(_0x844550){if(_0x844550){freeIsNotKey(_0x844550,_0x4691d2['freshsalesAccounts'],'id');for(var _0x5579dd=0x0,_0x37f999={},_0x44e192={};_0x5579dd<_0x844550[_0x5e7e('0x41')];_0x5579dd+=0x1){_0x37f999=_0x844550[_0x5579dd];if(_[_0x5e7e('0x42')](_0x4691d2[_0x5e7e('0x4d')][_0x37f999['id']])){_0x4691d2[_0x5e7e('0x4d')][_0x37f999['id']]=new FreshsalesAccount(_0x37f999);}else{_0x4691d2['mergeFromDatabase'](_0x4691d2['freshsalesAccounts'][_0x37f999['id']],_0x37f999);}}}return _0x4691d2['freshsalesAccounts'];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x4e')]=function(){var _0x49d375=this;return function(_0x2ec78b){for(var _0x180c9a=0x0;_0x180c9a<_0x2ec78b[_0x5e7e('0x41')];_0x180c9a+=0x1){_[_0x5e7e('0x4f')](_0x49d375[_0x5e7e('0x44')][_0x2ec78b[_0x180c9a][_0x5e7e('0x2a')]],_0x2ec78b[_0x180c9a]);}return _0x49d375['voiceQueues'];};};Realtime['prototype'][_0x5e7e('0x50')]=function(){var _0xaa4aba=this;return function(_0x46ab4b){clearVoiceQueues(_0xaa4aba[_0x5e7e('0x44')]);if(_0x46ab4b){_0x46ab4b=_[_0x5e7e('0x51')](_0x46ab4b,_0x5e7e('0x52'));for(var _0x52dfed in _0x46ab4b){if(_0x46ab4b[_0x5e7e('0x27')](_0x52dfed)){var _0x2fa55d={};for(var _0x545c4f=0x0;_0x545c4f<_0x46ab4b[_0x52dfed]['length'];_0x545c4f+=0x1){var _0x413db4=_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x53')];if(_0xaa4aba[_0x5e7e('0x44')][_0x413db4]){if(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x54')]){_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x32')]+=0x1;}if(_0x46ab4b[_0x52dfed][_0x545c4f]['queuecallerabandon']){_0xaa4aba['voiceQueues'][_0x413db4][_0x5e7e('0x55')]+=0x1;}_0xaa4aba['voiceQueues'][_0x413db4][_0x5e7e('0x33')]+=moment(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x56')])[_0x5e7e('0x57')](moment(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x58')]),_0x5e7e('0x59'))||0x0;if(_0x545c4f===_0x46ab4b[_0x52dfed][_0x5e7e('0x41')]-0x1){_0xaa4aba['voiceQueues'][_0x413db4]['sumDuration']+=moment(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x5a')]||_0x46ab4b[_0x52dfed][_0x545c4f]['queuecallerabandonAt']||_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x5b')])[_0x5e7e('0x57')](moment(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x58')]),'seconds')||0x0;_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x2c')]+=0x1;if(_0x46ab4b[_0x52dfed][_0x545c4f][_0x5e7e('0x5c')]){_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x2d')]+=0x1;_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x2f')]+=moment(_0x46ab4b[_0x52dfed][_0x545c4f]['queuecallercompleteAt'])[_0x5e7e('0x57')](moment(_0x46ab4b[_0x52dfed][_0x545c4f]['queuecallerleaveAt']),_0x5e7e('0x59'))||0x0;}}else{_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x2e')]+=_0xaa4aba[_0x5e7e('0x44')][_0x413db4][_0x5e7e('0x33')]||0x0;}}}}}}return _0xaa4aba[_0x5e7e('0x44')];};};Realtime['prototype'][_0x5e7e('0x5d')]=function(){var _0x5b4858=this;return function(_0xd18f5f){clearVoiceCallReports(_0x5b4858[_0x5e7e('0x16')]);if(_0xd18f5f){for(var _0x5cf305=0x0;_0x5cf305<_0xd18f5f[_0x5e7e('0x41')];_0x5cf305+=0x1){_0x5b4858['outbound'][_0x5e7e('0x2c')]+=0x1;_0x5b4858['outbound'][_0x5e7e('0x2e')]+=_0xd18f5f[_0x5cf305]['duration'];if(_0xd18f5f[_0x5cf305]['disposition']===_0x5e7e('0x5e')){_0x5b4858[_0x5e7e('0x16')]['answered']+=0x1;_0x5b4858['outbound'][_0x5e7e('0x33')]+=_0xd18f5f[_0x5cf305][_0x5e7e('0x5f')]-_0xd18f5f[_0x5cf305]['billableseconds']||0x0;_0x5b4858['outbound'][_0x5e7e('0x2f')]+=_0xd18f5f[_0x5cf305][_0x5e7e('0x60')];}}}return _0x5b4858[_0x5e7e('0x16')];};};Realtime['prototype'][_0x5e7e('0x61')]=function(){var _0x28a341=this;return function(_0x435063){if(_0x435063){freeIsNotKey(_0x435063,_0x28a341[_0x5e7e('0x14')],'name');for(var _0x5104cd=0x0,_0x2e9a18={};_0x5104cd<_0x435063[_0x5e7e('0x41')];_0x5104cd+=0x1){_0x2e9a18=_0x435063[_0x5104cd];if(_[_0x5e7e('0x42')](_0x28a341['campaigns'][_0x2e9a18[_0x5e7e('0x2a')]])){_0x28a341[_0x5e7e('0x14')][_0x2e9a18[_0x5e7e('0x2a')]]=new Campaign(_0x2e9a18);}else{_0x28a341[_0x5e7e('0x3e')](_0x28a341[_0x5e7e('0x14')][_0x2e9a18['name']],_0x2e9a18);_0x28a341['campaigns'][_0x2e9a18[_0x5e7e('0x2a')]][_0x5e7e('0x62')]=_0x2e9a18[_0x5e7e('0x63')]?_0x2e9a18['SquareProject'][_0x5e7e('0x2a')]:undefined;}}}return _0x28a341[_0x5e7e('0x14')];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x64')]=function(){var _0xd83497=this;return function(_0x1429ca){if(_0x1429ca){freeIsNotKey(_0x1429ca,_0xd83497['voiceExtensions'],'id');for(var _0x127e8d=0x0,_0x5db885={};_0x127e8d<_0x1429ca[_0x5e7e('0x41')];_0x127e8d+=0x1){_0x5db885=_0x1429ca[_0x127e8d];if(_[_0x5e7e('0x42')](_0xd83497['voiceExtensions'][_0x5db885['id']])){_0xd83497[_0x5e7e('0x17')][_0x5db885['id']]=new VoiceExtension(_0x5db885);}else{_0xd83497[_0x5e7e('0x3e')](_0xd83497[_0x5e7e('0x17')][_0x5db885['id']],_0x5db885);}}}return _0xd83497['voiceExtensions'];};};Realtime['prototype'][_0x5e7e('0x65')]=function(){var _0x867fe4=this;return function(_0x5dc78e){clearCampaigns(_0x867fe4['campaigns']);for(var _0x4f10be=0x0;_0x4f10be<_0x5dc78e[_0x5e7e('0x41')];_0x4f10be+=0x1){_[_0x5e7e('0x4f')](_0x867fe4[_0x5e7e('0x14')][_0x5dc78e[_0x4f10be][_0x5e7e('0x2a')]],_0x5dc78e[_0x4f10be]);}return _0x867fe4[_0x5e7e('0x14')];};};Realtime[_0x5e7e('0x40')][_0x5e7e('0x66')]=function(){var _0x282190=this;return function(_0x1a85e7){if(_0x1a85e7){freeIsNotKey(_0x1a85e7,_0x282190[_0x5e7e('0x25')],'id');for(var _0x11c8ba=0x0,_0x1fb93e={},_0x271af9={};_0x11c8ba<_0x1a85e7[_0x5e7e('0x41')];_0x11c8ba+=0x1){_0x1fb93e=_0x1a85e7[_0x11c8ba];if(_[_0x5e7e('0x42')](_0x282190['faxAccounts'][_0x1fb93e['id']])){_0x282190[_0x5e7e('0x25')][_0x1fb93e['id']]=new FaxAccount(_0x1fb93e);}else{_0x282190[_0x5e7e('0x3e')](_0x282190[_0x5e7e('0x25')][_0x1fb93e['id']],_0x1fb93e);}}}return _0x282190['faxAccounts'];};};module[_0x5e7e('0x67')]=Realtime; \ No newline at end of file +var _0xadd7=['initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','agents','telephones','triggers','campaigns','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts'];(function(_0x11e4e7,_0xc44822){var _0x3794a5=function(_0x2232eb){while(--_0x2232eb){_0x11e4e7['push'](_0x11e4e7['shift']());}};_0x3794a5(++_0xc44822);}(_0xadd7,0x151));var _0x7add=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xadd7[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require('bluebird');var util=require(_0x7add('0x0'));var _=require(_0x7add('0x1'));var moment=require(_0x7add('0x2'));var Agent=require(_0x7add('0x3'));var Telephone=require(_0x7add('0x4'));var Trunk=require(_0x7add('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x7add('0x6'));var Template=require(_0x7add('0x7'));var Campaign=require(_0x7add('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x7add('0x9'));var SalesforceAccount=require(_0x7add('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x7add('0xb'));var ZohoAccount=require(_0x7add('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x7add('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x7add('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x7add('0xf')]={};this[_0x7add('0x10')]={};this['trunks']={};this['voiceQueues']={};this[_0x7add('0x11')]={};this[_0x7add('0x12')]={};this['templates']={};this[_0x7add('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7add('0x14')]={};this[_0x7add('0x15')]={};this['queueChannels']={};this[_0x7add('0x16')]={};this[_0x7add('0x17')]={};this['settings']={};this[_0x7add('0x18')]={};this[_0x7add('0x19')]={};this[_0x7add('0x1a')]={};this[_0x7add('0x1b')]={};this[_0x7add('0x1c')]={};this[_0x7add('0x1d')]={};this[_0x7add('0x1e')]={};this[_0x7add('0x1f')]={};this['dynamics365Accounts']={};this[_0x7add('0x20')]={};this[_0x7add('0x21')]={};};function freeIsNotKey(_0x571074,_0x3931d4,_0x37104c){var _0x1ee037=_[_0x7add('0x22')](_0x571074,function(_0x19aef5,_0x4b66a7){return _0x19aef5[_0x37104c];});for(var _0x15b45c in _0x3931d4){if(_0x3931d4[_0x7add('0x23')](_0x15b45c)){if(!_0x1ee037[_0x15b45c]){delete _0x3931d4[_0x15b45c];}}}}function freeIsNotKeySip(_0x73910b,_0x4ccba5){var _0xee2895=_[_0x7add('0x22')](_0x73910b,function(_0x3da816,_0x5a91e6){return util[_0x7add('0x24')](_0x7add('0x25'),_0x3da816[_0x7add('0x26')]);});for(var _0x36d1ed in _0x4ccba5){if(_0x4ccba5[_0x7add('0x23')](_0x36d1ed)){if(!_0xee2895[_0x36d1ed]){delete _0x4ccba5[_0x36d1ed];}}}}function freeIsNotKeyAgent(_0x596c4e,_0x3debd3){var _0x13fd7a=_[_0x7add('0x22')](_0x596c4e,function(_0x19f60c,_0xec1053){var _0x23e759=_['isNil'](_0x19f60c[_0x7add('0x27')])?util[_0x7add('0x24')](_0x7add('0x25'),_0x19f60c[_0x7add('0x26')]):_0x19f60c[_0x7add('0x27')];return _0x23e759;});for(var _0x31cffd in _0x3debd3){if(_0x3debd3[_0x7add('0x23')](_0x31cffd)){if(!_0x13fd7a[_0x31cffd]){delete _0x3debd3[_0x31cffd];}}}}function clearVoiceCallReports(_0x47c665){_0x47c665[_0x7add('0x28')]=0x0;_0x47c665[_0x7add('0x29')]=0x0;_0x47c665[_0x7add('0x2a')]=0x0;_0x47c665[_0x7add('0x2b')]=0x0;_0x47c665[_0x7add('0x2c')]=0x0;}function clearCampaigns(_0x31fed0){if(!_['isEmpty'](_0x31fed0)){for(var _0x76d146 in _0x31fed0){if(_0x31fed0['hasOwnProperty'](_0x76d146)){_0x31fed0[_0x76d146][_0x7add('0x2d')]=0x0;_0x31fed0[_0x76d146][_0x7add('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5192af){if(!_['isEmpty'](_0x5192af)){for(var _0x133452 in _0x5192af){if(_0x5192af[_0x7add('0x23')](_0x133452)){_0x5192af[_0x133452][_0x7add('0x28')]=0x0;_0x5192af[_0x133452][_0x7add('0x29')]=0x0;_0x5192af[_0x133452]['unmanaged']=0x0;_0x5192af[_0x133452][_0x7add('0x2f')]=0x0;_0x5192af[_0x133452]['sumHoldTime']=0x0;_0x5192af[_0x133452][_0x7add('0x2b')]=0x0;_0x5192af[_0x133452][_0x7add('0x2c')]=0x0;_0x5192af[_0x133452][_0x7add('0x30')]=0x0;_0x5192af[_0x133452]['outboundNoAnswerCallsDay']=0x0;_0x5192af[_0x133452][_0x7add('0x31')]=0x0;_0x5192af[_0x133452][_0x7add('0x32')]=0x0;_0x5192af[_0x133452][_0x7add('0x33')]=0x0;_0x5192af[_0x133452][_0x7add('0x34')]=0x0;_0x5192af[_0x133452][_0x7add('0x35')]=0x0;_0x5192af[_0x133452][_0x7add('0x36')]=0x0;_0x5192af[_0x133452][_0x7add('0x37')]=0x0;_0x5192af[_0x133452][_0x7add('0x38')]=0x0;_0x5192af[_0x133452][_0x7add('0x39')]=0x0;_0x5192af[_0x133452][_0x7add('0x3a')]=0x0;_0x5192af[_0x133452][_0x7add('0x30')]=0x0;_0x5192af[_0x133452][_0x7add('0x3b')]=0x0;_0x5192af[_0x133452]['queueStatusComplete']=!![];}}}}Realtime[_0x7add('0x3c')][_0x7add('0x3d')]=function(_0x537964,_0x1399e4){for(var _0x135be0 in _0x1399e4){if(_0x537964[_0x7add('0x23')](_0x135be0)){_0x537964[_0x135be0]=_0x1399e4[_0x135be0];}}};Realtime[_0x7add('0x3c')][_0x7add('0x3e')]=function(){var _0x2978c2=this;return function(_0x3ac66a){if(_0x3ac66a){freeIsNotKeyAgent(_0x3ac66a,_0x2978c2[_0x7add('0xf')]);for(var _0x2667e2=0x0,_0x3c5f5e={},_0x5f35a7={};_0x2667e2<_0x3ac66a[_0x7add('0x3f')];_0x2667e2+=0x1){_0x3c5f5e=_0x3ac66a[_0x2667e2];var _0x34a9bb=_[_0x7add('0x40')](_0x3c5f5e[_0x7add('0x27')])?util[_0x7add('0x24')](_0x7add('0x25'),_0x3c5f5e[_0x7add('0x26')]):_0x3c5f5e[_0x7add('0x27')];if(_[_0x7add('0x41')](_0x2978c2[_0x7add('0xf')][_0x34a9bb])){_0x2978c2[_0x7add('0xf')][_0x34a9bb]=new Agent(_0x3c5f5e);}else{_0x2978c2['mergeFromDatabase'](_0x2978c2[_0x7add('0xf')][_0x34a9bb],_0x3c5f5e);}}}return _0x2978c2['agents'];};};Realtime[_0x7add('0x3c')][_0x7add('0x42')]=function(){var _0x216c16=this;return function(_0x48f280){if(_0x48f280){freeIsNotKeySip(_0x48f280,_0x216c16[_0x7add('0x10')]);for(var _0x208ea7=0x0,_0x30e692={},_0x29f4ea={};_0x208ea7<_0x48f280[_0x7add('0x3f')];_0x208ea7+=0x1){_0x30e692=_0x48f280[_0x208ea7];if(_[_0x7add('0x41')](_0x216c16[_0x7add('0x10')][util[_0x7add('0x24')]('SIP/%s',_0x30e692[_0x7add('0x26')])])){_0x216c16['telephones'][util[_0x7add('0x24')](_0x7add('0x25'),_0x30e692[_0x7add('0x26')])]=new Telephone(_0x30e692);}else{_0x216c16['mergeFromDatabase'](_0x216c16[_0x7add('0x10')][util['format']('SIP/%s',_0x30e692[_0x7add('0x26')])],_0x30e692);}}}return _0x216c16['telephones'];};};Realtime[_0x7add('0x3c')]['initTrunks']=function(){var _0x559ebd=this;return function(_0x302c17){if(_0x302c17){freeIsNotKeySip(_0x302c17,_0x559ebd['trunks']);for(var _0x36046b=0x0,_0x25a622={},_0x2309d3={};_0x36046b<_0x302c17[_0x7add('0x3f')];_0x36046b+=0x1){_0x25a622=_0x302c17[_0x36046b];if(_[_0x7add('0x41')](_0x559ebd[_0x7add('0x43')][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])])){_0x559ebd[_0x7add('0x43')][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])]=new Trunk(_0x25a622);}else{_0x559ebd[_0x7add('0x3d')](_0x559ebd['trunks'][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])],_0x25a622);}}}return _0x559ebd['trunks'];};};Realtime[_0x7add('0x3c')][_0x7add('0x44')]=function(){var _0x4b2735=this;return function(_0x208505){if(_0x208505){freeIsNotKey(_0x208505,_0x4b2735[_0x7add('0x45')],_0x7add('0x26'));for(var _0x2e020e=0x0,_0x1a902b={},_0x20ce8b={};_0x2e020e<_0x208505['length'];_0x2e020e+=0x1){_0x1a902b=_0x208505[_0x2e020e];if(_[_0x7add('0x41')](_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]])){_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]]=new VoiceQueue(_0x1a902b);}else{_0x4b2735[_0x7add('0x3d')](_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]],_0x1a902b);}}}return _0x4b2735['voiceQueues'];};};Realtime[_0x7add('0x3c')][_0x7add('0x46')]=function(){var _0x4f84b5=this;return function(_0x8982ee){if(_0x8982ee){freeIsNotKey(_0x8982ee,_0x4f84b5[_0x7add('0x11')],'id');for(var _0x318d12=0x0,_0x1a898c={},_0x303860={};_0x318d12<_0x8982ee[_0x7add('0x3f')];_0x318d12+=0x1){_0x1a898c=_0x8982ee[_0x318d12];if(_[_0x7add('0x41')](_0x4f84b5[_0x7add('0x11')][_0x1a898c['id']])){_0x4f84b5[_0x7add('0x11')][_0x1a898c['id']]=new Trigger(_0x1a898c);}else{_0x4f84b5[_0x7add('0x3d')](_0x4f84b5['triggers'][_0x1a898c['id']],_0x1a898c);}}}return _0x4f84b5[_0x7add('0x11')];};};Realtime['prototype'][_0x7add('0x47')]=function(){var _0x5be84e=this;return function(_0x41c48f){if(_0x41c48f){freeIsNotKey(_0x41c48f,_0x5be84e['templates'],'id');for(var _0x464650=0x0,_0x1d9524={},_0x5d0430={};_0x464650<_0x41c48f['length'];_0x464650+=0x1){_0x1d9524=_0x41c48f[_0x464650];if(_[_0x7add('0x41')](_0x5be84e[_0x7add('0x48')][_0x1d9524['id']])){_0x5be84e['templates'][_0x1d9524['id']]=new Template(_0x1d9524);}else{_0x5be84e[_0x7add('0x3d')](_0x5be84e[_0x7add('0x48')][_0x1d9524['id']],_0x1d9524);}}}return _0x5be84e[_0x7add('0x48')];};};Realtime['prototype'][_0x7add('0x49')]=function(){var _0x87e45f=this;return function(_0x6c57d8){if(_0x6c57d8){freeIsNotKey(_0x6c57d8,_0x87e45f[_0x7add('0x18')],'id');for(var _0x5c5c62=0x0,_0x200bc9={},_0x7a5cea={};_0x5c5c62<_0x6c57d8[_0x7add('0x3f')];_0x5c5c62+=0x1){_0x200bc9=_0x6c57d8[_0x5c5c62];if(_['isUndefined'](_0x87e45f[_0x7add('0x18')][_0x200bc9['id']])){_0x87e45f[_0x7add('0x18')][_0x200bc9['id']]=new ZendeskAccount(_0x200bc9);}else{_0x87e45f[_0x7add('0x3d')](_0x87e45f[_0x7add('0x18')][_0x200bc9['id']],_0x200bc9);}}}return _0x87e45f['zendeskAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4a')]=function(){var _0x1d8a4c=this;return function(_0x367aa0){if(_0x367aa0){freeIsNotKey(_0x367aa0,_0x1d8a4c[_0x7add('0x19')],'id');for(var _0x1e2a04=0x0,_0x59069c={},_0x4999a9={};_0x1e2a04<_0x367aa0['length'];_0x1e2a04+=0x1){_0x59069c=_0x367aa0[_0x1e2a04];if(_['isUndefined'](_0x1d8a4c['salesforceAccounts'][_0x59069c['id']])){_0x1d8a4c[_0x7add('0x19')][_0x59069c['id']]=new SalesforceAccount(_0x59069c);}else{_0x1d8a4c[_0x7add('0x3d')](_0x1d8a4c[_0x7add('0x19')][_0x59069c['id']],_0x59069c);}}}return _0x1d8a4c['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x4de35b=this;return function(_0x4dd976){if(_0x4dd976){freeIsNotKey(_0x4dd976,_0x4de35b['freshdeskAccounts'],'id');for(var _0x532386=0x0,_0x1cacd7={},_0x3454e5={};_0x532386<_0x4dd976['length'];_0x532386+=0x1){_0x1cacd7=_0x4dd976[_0x532386];if(_[_0x7add('0x41')](_0x4de35b[_0x7add('0x1b')][_0x1cacd7['id']])){_0x4de35b[_0x7add('0x1b')][_0x1cacd7['id']]=new FreshdeskAccount(_0x1cacd7);}else{_0x4de35b['mergeFromDatabase'](_0x4de35b['freshdeskAccounts'][_0x1cacd7['id']],_0x1cacd7);}}}return _0x4de35b[_0x7add('0x1b')];};};Realtime[_0x7add('0x3c')][_0x7add('0x4b')]=function(){var _0x4ddb1e=this;return function(_0x48c7c0){if(_0x48c7c0){freeIsNotKey(_0x48c7c0,_0x4ddb1e[_0x7add('0x1c')],'id');for(var _0x37d8fa=0x0,_0x1b8f86={},_0x1755c6={};_0x37d8fa<_0x48c7c0[_0x7add('0x3f')];_0x37d8fa+=0x1){_0x1b8f86=_0x48c7c0[_0x37d8fa];if(_[_0x7add('0x41')](_0x4ddb1e[_0x7add('0x1c')][_0x1b8f86['id']])){_0x4ddb1e['zohoAccounts'][_0x1b8f86['id']]=new ZohoAccount(_0x1b8f86);}else{_0x4ddb1e[_0x7add('0x3d')](_0x4ddb1e['zohoAccounts'][_0x1b8f86['id']],_0x1b8f86);}}}return _0x4ddb1e['zohoAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4c')]=function(){var _0x2f9289=this;return function(_0x4eaee1){if(_0x4eaee1){freeIsNotKey(_0x4eaee1,_0x2f9289[_0x7add('0x1d')],'id');for(var _0x503440=0x0,_0x57a274={},_0x2847f2={};_0x503440<_0x4eaee1['length'];_0x503440+=0x1){_0x57a274=_0x4eaee1[_0x503440];if(_[_0x7add('0x41')](_0x2f9289[_0x7add('0x1d')][_0x57a274['id']])){_0x2f9289[_0x7add('0x1d')][_0x57a274['id']]=new DeskAccount(_0x57a274);}else{_0x2f9289[_0x7add('0x3d')](_0x2f9289[_0x7add('0x1d')][_0x57a274['id']],_0x57a274);}}}return _0x2f9289['deskAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4d')]=function(){var _0x450f34=this;return function(_0x1c1608){if(_0x1c1608){freeIsNotKey(_0x1c1608,_0x450f34[_0x7add('0x1a')],'id');for(var _0x3516c2=0x0,_0x3e1c5f={},_0x561f59={};_0x3516c2<_0x1c1608['length'];_0x3516c2+=0x1){_0x3e1c5f=_0x1c1608[_0x3516c2];if(_[_0x7add('0x41')](_0x450f34[_0x7add('0x1a')][_0x3e1c5f['id']])){_0x450f34['sugarcrmAccounts'][_0x3e1c5f['id']]=new SugarcrmAccount(_0x3e1c5f);}else{_0x450f34[_0x7add('0x3d')](_0x450f34['sugarcrmAccounts'][_0x3e1c5f['id']],_0x3e1c5f);}}}return _0x450f34[_0x7add('0x1a')];};};Realtime[_0x7add('0x3c')][_0x7add('0x4e')]=function(){var _0xd954d2=this;return function(_0x5530de){if(_0x5530de){freeIsNotKey(_0x5530de,_0xd954d2[_0x7add('0x1e')],'id');for(var _0x423a66=0x0,_0x1b1633={},_0x3ea0c3={};_0x423a66<_0x5530de[_0x7add('0x3f')];_0x423a66+=0x1){_0x1b1633=_0x5530de[_0x423a66];if(_[_0x7add('0x41')](_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']])){_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']]=new VtigerAccount(_0x1b1633);}else{_0xd954d2[_0x7add('0x3d')](_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']],_0x1b1633);}}}return _0xd954d2[_0x7add('0x1e')];};};Realtime[_0x7add('0x3c')]['initServicenowAccounts']=function(){var _0xcca292=this;return function(_0x5b39b2){if(_0x5b39b2){freeIsNotKey(_0x5b39b2,_0xcca292['servicenowAccounts'],'id');for(var _0x5d5f31=0x0,_0x3ee7c4={},_0x6f86c0={};_0x5d5f31<_0x5b39b2[_0x7add('0x3f')];_0x5d5f31+=0x1){_0x3ee7c4=_0x5b39b2[_0x5d5f31];if(_[_0x7add('0x41')](_0xcca292[_0x7add('0x1f')][_0x3ee7c4['id']])){_0xcca292['servicenowAccounts'][_0x3ee7c4['id']]=new ServicenowAccount(_0x3ee7c4);}else{_0xcca292[_0x7add('0x3d')](_0xcca292['servicenowAccounts'][_0x3ee7c4['id']],_0x3ee7c4);}}}return _0xcca292[_0x7add('0x1f')];};};Realtime['prototype'][_0x7add('0x4f')]=function(){var _0x299773=this;return function(_0x31a630){if(_0x31a630){freeIsNotKey(_0x31a630,_0x299773['dynamics365Accounts'],'id');for(var _0x14d7de=0x0,_0x481844={},_0x15b7c8={};_0x14d7de<_0x31a630[_0x7add('0x3f')];_0x14d7de+=0x1){_0x481844=_0x31a630[_0x14d7de];if(_['isUndefined'](_0x299773['dynamics365Accounts'][_0x481844['id']])){_0x299773[_0x7add('0x50')][_0x481844['id']]=new Dynamics365Account(_0x481844);}else{_0x299773['mergeFromDatabase'](_0x299773['dynamics365Accounts'][_0x481844['id']],_0x481844);}}}return _0x299773['dynamics365Accounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x51')]=function(){var _0x58f0ba=this;return function(_0x19d241){if(_0x19d241){freeIsNotKey(_0x19d241,_0x58f0ba[_0x7add('0x20')],'id');for(var _0x3feafd=0x0,_0x7b3478={},_0x59d623={};_0x3feafd<_0x19d241[_0x7add('0x3f')];_0x3feafd+=0x1){_0x7b3478=_0x19d241[_0x3feafd];if(_[_0x7add('0x41')](_0x58f0ba[_0x7add('0x20')][_0x7b3478['id']])){_0x58f0ba['freshsalesAccounts'][_0x7b3478['id']]=new FreshsalesAccount(_0x7b3478);}else{_0x58f0ba[_0x7add('0x3d')](_0x58f0ba['freshsalesAccounts'][_0x7b3478['id']],_0x7b3478);}}}return _0x58f0ba[_0x7add('0x20')];};};Realtime[_0x7add('0x3c')][_0x7add('0x52')]=function(){var _0x4b4128=this;return function(_0x1d2c16){for(var _0x4b4d12=0x0;_0x4b4d12<_0x1d2c16[_0x7add('0x3f')];_0x4b4d12+=0x1){_[_0x7add('0x53')](_0x4b4128[_0x7add('0x45')][_0x1d2c16[_0x4b4d12][_0x7add('0x26')]],_0x1d2c16[_0x4b4d12]);}return _0x4b4128['voiceQueues'];};};Realtime[_0x7add('0x3c')][_0x7add('0x54')]=function(){var _0x266067=this;return function(_0x31a569){clearVoiceQueues(_0x266067[_0x7add('0x45')]);if(_0x31a569){_0x31a569=_['groupBy'](_0x31a569,_0x7add('0x55'));for(var _0x5e8c35 in _0x31a569){if(_0x31a569['hasOwnProperty'](_0x5e8c35)){var _0x1fd8cb={};for(var _0x203924=0x0;_0x203924<_0x31a569[_0x5e8c35]['length'];_0x203924+=0x1){var _0x1d47e9=_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x56')];if(_0x266067[_0x7add('0x45')][_0x1d47e9]){if(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x57')]){_0x266067['voiceQueues'][_0x1d47e9][_0x7add('0x58')]+=0x1;}if(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x59')]){_0x266067[_0x7add('0x45')][_0x1d47e9]['abandoned']+=0x1;}_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2a')]+=moment(_0x31a569[_0x5e8c35][_0x203924]['queuecallerleaveAt'])[_0x7add('0x5a')](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5b')]),_0x7add('0x5c'))||0x0;if(_0x203924===_0x31a569[_0x5e8c35][_0x7add('0x3f')]-0x1){_0x266067['voiceQueues'][_0x1d47e9][_0x7add('0x2b')]+=moment(_0x31a569[_0x5e8c35][_0x203924]['queuecallercompleteAt']||_0x31a569[_0x5e8c35][_0x203924]['queuecallerabandonAt']||_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5d')])[_0x7add('0x5a')](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5b')]),_0x7add('0x5c'))||0x0;_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x28')]+=0x1;if(_0x31a569[_0x5e8c35][_0x203924]['queuecallercomplete']){_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x29')]+=0x1;_0x266067[_0x7add('0x45')][_0x1d47e9]['sumBillable']+=moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5e')])['diff'](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5f')]),'seconds')||0x0;}}else{_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2b')]+=_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2a')]||0x0;}}}}}}return _0x266067['voiceQueues'];};};Realtime['prototype'][_0x7add('0x60')]=function(){var _0x6bd23d=this;return function(_0x417f9f){clearVoiceCallReports(_0x6bd23d[_0x7add('0x13')]);if(_0x417f9f){for(var _0xbe158f=0x0;_0xbe158f<_0x417f9f[_0x7add('0x3f')];_0xbe158f+=0x1){_0x6bd23d['outbound'][_0x7add('0x28')]+=0x1;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2b')]+=_0x417f9f[_0xbe158f][_0x7add('0x61')];if(_0x417f9f[_0xbe158f]['disposition']==='ANSWERED'){_0x6bd23d[_0x7add('0x13')][_0x7add('0x29')]+=0x1;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2a')]+=_0x417f9f[_0xbe158f][_0x7add('0x61')]-_0x417f9f[_0xbe158f][_0x7add('0x62')]||0x0;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2c')]+=_0x417f9f[_0xbe158f][_0x7add('0x62')];}}}return _0x6bd23d[_0x7add('0x13')];};};Realtime['prototype'][_0x7add('0x63')]=function(){var _0x59d99a=this;return function(_0x70b109){if(_0x70b109){freeIsNotKey(_0x70b109,_0x59d99a['campaigns'],'name');for(var _0x27f56a=0x0,_0x5ad173={};_0x27f56a<_0x70b109[_0x7add('0x3f')];_0x27f56a+=0x1){_0x5ad173=_0x70b109[_0x27f56a];if(_[_0x7add('0x41')](_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]])){_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]]=new Campaign(_0x5ad173);}else{_0x59d99a[_0x7add('0x3d')](_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]],_0x5ad173);_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]]['dialQueueProject']=_0x5ad173[_0x7add('0x64')]?_0x5ad173['SquareProject']['name']:undefined;}}}return _0x59d99a[_0x7add('0x12')];};};Realtime[_0x7add('0x3c')][_0x7add('0x65')]=function(){var _0x567ecc=this;return function(_0x35ef8d){if(_0x35ef8d){freeIsNotKey(_0x35ef8d,_0x567ecc[_0x7add('0x14')],'id');for(var _0x3f1f7f=0x0,_0x590e15={};_0x3f1f7f<_0x35ef8d[_0x7add('0x3f')];_0x3f1f7f+=0x1){_0x590e15=_0x35ef8d[_0x3f1f7f];if(_['isUndefined'](_0x567ecc[_0x7add('0x14')][_0x590e15['id']])){_0x567ecc[_0x7add('0x14')][_0x590e15['id']]=new VoiceExtension(_0x590e15);}else{_0x567ecc[_0x7add('0x3d')](_0x567ecc['voiceExtensions'][_0x590e15['id']],_0x590e15);}}}return _0x567ecc['voiceExtensions'];};};Realtime[_0x7add('0x3c')][_0x7add('0x66')]=function(){var _0x147720=this;return function(_0x35a525){clearCampaigns(_0x147720[_0x7add('0x12')]);for(var _0x570805=0x0;_0x570805<_0x35a525[_0x7add('0x3f')];_0x570805+=0x1){_['merge'](_0x147720[_0x7add('0x12')][_0x35a525[_0x570805][_0x7add('0x26')]],_0x35a525[_0x570805]);}return _0x147720[_0x7add('0x12')];};};Realtime[_0x7add('0x3c')][_0x7add('0x67')]=function(){var _0x7267f2=this;return function(_0x2043b0){if(_0x2043b0){freeIsNotKey(_0x2043b0,_0x7267f2[_0x7add('0x21')],'id');for(var _0x251df8=0x0,_0x3c33c9={},_0x5f536e={};_0x251df8<_0x2043b0[_0x7add('0x3f')];_0x251df8+=0x1){_0x3c33c9=_0x2043b0[_0x251df8];if(_['isUndefined'](_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']])){_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']]=new FaxAccount(_0x3c33c9);}else{_0x7267f2[_0x7add('0x3d')](_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']],_0x3c33c9);}}}return _0x7267f2[_0x7add('0x21')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 424abb2..6661f0c 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 _0x1208=['mobile','lastIndexOf','voiceDialReport','transfererlinkedid','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','agents','accountcode','isNil','interface','format','SIP/%s','name','length','connectedlinenum','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','create','match','destination','exten','dialer','lastapplication','lastdata','queue','callerid','context','from-sip','calleridnum','originatecalleridnum','channel','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','xcally-motion-dialer','forEach','Local','substring','indexOf'];(function(_0xffe2e4,_0x4ed4e7){var _0x48f03c=function(_0xefaa16){while(--_0xefaa16){_0xffe2e4['push'](_0xffe2e4['shift']());}};_0x48f03c(++_0x4ed4e7);}(_0x1208,0xaa));var _0x8120=function(_0x1b5a78,_0x313c1d){_0x1b5a78=_0x1b5a78-0x0;var _0x49ae88=_0x1208[_0x1b5a78];return _0x49ae88;};'use strict';var _=require('lodash');var moment=require(_0x8120('0x0'));var util=require(_0x8120('0x1'));var config=require(_0x8120('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x8120('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x8120('0x4'));var RpcMemberReport=require(_0x8120('0x5'));var RpcVoiceQueueReport=require(_0x8120('0x6'));var RpcVoiceRecording=require(_0x8120('0x7'));var RpcVoiceTransferReport=require(_0x8120('0x8'));var VoiceQueueReport=require(_0x8120('0x9'));var VoiceCallReport=require(_0x8120('0xa'));var VoiceAgentReport=require(_0x8120('0xb'));var VoiceDialReport=require(_0x8120('0xc'));var UserReport=require(_0x8120('0xd'));function Report(_0x42d6c3){this['realtime']=_0x42d6c3;this['agents']=_0x42d6c3['agents'];this['telephones']=_0x42d6c3[_0x8120('0xe')];}Report[_0x8120('0xf')]['sync']=function(_0x4f9dd5){var _0x37f177=new VoiceQueueReport(this[_0x8120('0x10')]);var _0x2883ee=new VoiceAgentReport(this[_0x8120('0x10')]);var _0x53e861=new VoiceDialReport(this[_0x8120('0x10')]);var _0x32a134=new VoiceCallReport(this[_0x8120('0x10')]);var _0x1beee7=new UserReport(this[_0x8120('0x10')]);if(config[_0x8120('0x11')]&&config[_0x8120('0x11')][_0x8120('0x12')]){ami['on'](_0x8120('0x13'),this[_0x8120('0x14')][_0x8120('0x15')](this));ami['on'](_0x8120('0x16'),this[_0x8120('0x17')]['bind'](this));ami['on'](_0x8120('0x18'),this[_0x8120('0x19')][_0x8120('0x15')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x8120('0x15')](this));ami['on'](_0x8120('0x1a'),this[_0x8120('0x1b')]['bind'](this));ami['on'](_0x8120('0x1c'),this[_0x8120('0x1d')][_0x8120('0x15')](this));}};Report['prototype'][_0x8120('0x1e')]=function(_0x1d718d){var _0x2d81a8;_0x2d81a8=_[_0x8120('0x1f')](this[_0x8120('0x20')],function(_0x48c7b2){return _0x48c7b2[_0x8120('0x21')]==_0x1d718d||_0x48c7b2['name']==_0x1d718d;});if(_[_0x8120('0x22')](_0x2d81a8)){var _0x2d4fbc=_[_0x8120('0x1f')](this[_0x8120('0xe')],function(_0x1006c1){return _0x1006c1[_0x8120('0x21')]==_0x1d718d||_0x1006c1['name']==_0x1d718d;});if(_0x2d4fbc){_0x2d81a8=_['find'](this['agents'],function(_0x2a7937){return _0x2a7937[_0x8120('0x23')]==util[_0x8120('0x24')](_0x8120('0x25'),_0x2d4fbc[_0x8120('0x26')]);});}}return _0x2d81a8;};Report[_0x8120('0xf')][_0x8120('0x14')]=function(_0x3ae57e){for(var _0x282c6b=0x0;_0x282c6b<_0x3ae57e[_0x8120('0x27')];_0x282c6b+=0x1){var _0x3b8b9e=this[_0x8120('0x1e')](_0x3ae57e[_0x282c6b][_0x8120('0x28')]);if(_0x3b8b9e){_0x3ae57e[_0x282c6b][_0x8120('0x21')]=_0x3b8b9e['accountcode'];_0x3ae57e[_0x282c6b]['assigned']=!![];_0x3ae57e[_0x282c6b]['lastAssignedTo']=_0x3b8b9e['name'];_0x3ae57e[_0x282c6b][_0x8120('0x23')]=_[_0x8120('0x22')](_0x3b8b9e[_0x8120('0x23')])?util[_0x8120('0x24')](_0x8120('0x25'),_0x3b8b9e['name']):_0x3b8b9e[_0x8120('0x23')];if(_0x3ae57e[_0x282c6b]['queuecallercomplete']){_0x3ae57e[_0x282c6b][_0x8120('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3ae57e[_0x282c6b][_0x8120('0x2a')]){_0x3ae57e[_0x282c6b][_0x8120('0x2b')]=moment()[_0x8120('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x8120('0x14')](_0x3ae57e[_0x282c6b]);}RpcVoiceQueueReport[_0x8120('0x2c')](_0x3ae57e[_0x282c6b]);}};function extractCalleridNumber(_0x4f1266){var _0xc4943e=_0x4f1266[_0x8120('0x2d')](/<(.*?)>/);return _0xc4943e?_0xc4943e[0x1]:_0x4f1266;}Report[_0x8120('0xf')][_0x8120('0x17')]=function(_0x518d3e){_0x518d3e[_0x8120('0x2e')]=_0x518d3e[_0x8120('0x2e')]||_0x518d3e[_0x8120('0x2f')];if(_0x518d3e['type']==_0x8120('0x30')){_0x518d3e[_0x8120('0x31')]='queue';_0x518d3e[_0x8120('0x32')]=_0x518d3e[_0x8120('0x33')];if(_0x518d3e['context']=='from-voip-provider'){_0x518d3e[_0x8120('0x21')]='';_0x518d3e[_0x8120('0x2e')]=extractCalleridNumber(_0x518d3e[_0x8120('0x34')]);}else if(_0x518d3e[_0x8120('0x35')]==_0x8120('0x36')){if(_0x518d3e[_0x8120('0x2e')]=='xcally-motion-preview'){_0x518d3e['destination']=extractCalleridNumber(_0x518d3e['calleridpreview']);_0x518d3e[_0x8120('0x37')]=_0x518d3e[_0x8120('0x38')];_0x518d3e['destinationchannel']=[_0x518d3e[_0x8120('0x39')],_0x518d3e[_0x8120('0x39')]=_0x518d3e[_0x8120('0x3a')]][0x0];_0x518d3e[_0x8120('0x34')]=_0x518d3e[_0x8120('0x3b')];}else{_0x518d3e[_0x8120('0x2e')]=_0x518d3e[_0x8120('0x37')];_0x518d3e['calleridnum']=_0x518d3e[_0x8120('0x38')];if(_0x518d3e[_0x8120('0x3c')]==_0x8120('0x3d')){_0x518d3e[_0x8120('0x21')]=_0x518d3e[_0x8120('0x28')];}else{_0x518d3e[_0x8120('0x21')]='';}}}}else{_0x518d3e[_0x8120('0x34')]=util['format'](_0x8120('0x3e'),_0x518d3e['calleridname'],_0x518d3e[_0x8120('0x37')]);}if(RpcVoiceTransferReport[_0x8120('0x3f')][_0x518d3e[_0x8120('0x40')]]){var _0x44256a=RpcVoiceTransferReport[_0x8120('0x3f')][_0x518d3e[_0x8120('0x40')]];_0x44256a[_0x8120('0x41')]=_0x518d3e[_0x8120('0x42')];RpcVoiceTransferReport[_0x8120('0x1b')](_0x44256a);delete RpcVoiceTransferReport[_0x8120('0x3f')][_0x518d3e[_0x8120('0x40')]];}RpcVoiceCallReport['create'](_0x518d3e);if(_0x518d3e['monitor']){for(var _0x4adb67=0x0;_0x4adb67<_0x518d3e[_0x8120('0x43')][_0x8120('0x27')];_0x4adb67+=0x1){_0x518d3e[_0x8120('0x44')]=_0x518d3e[_0x8120('0x43')][_0x4adb67][_0x8120('0x45')];_0x518d3e[_0x8120('0x46')]=_0x518d3e[_0x8120('0x43')][_0x4adb67]['createdAt'];if(_0x518d3e[_0x8120('0x2f')]==_0x8120('0x47')){_0x518d3e[_0x8120('0x37')]=_0x518d3e['connectedlinenum'];_0x518d3e[_0x8120('0x48')]=_0x518d3e['connectedlinename'];_0x518d3e['connectedlinenum']=_0x518d3e[_0x8120('0x21')];_0x518d3e[_0x8120('0x49')]=_0x518d3e['membername'];_0x518d3e[_0x8120('0x2f')]=_0x518d3e[_0x8120('0x38')];}else if(_0x518d3e[_0x8120('0x2f')]==_0x8120('0x4a')){_0x518d3e[_0x8120('0x37')]=_0x518d3e[_0x8120('0x2e')];_0x518d3e[_0x8120('0x2f')]=_0x518d3e[_0x8120('0x38')];}RpcVoiceRecording[_0x8120('0x2c')](_0x518d3e);}}};Report[_0x8120('0xf')]['voiceAgentReport']=function(_0x273db8){if(_['isArray'](_0x273db8)){_0x273db8[_0x8120('0x4b')](function(_0x28f2ee){RpcVoiceAgentReport[_0x8120('0x2c')](_0x28f2ee);});}else{RpcVoiceAgentReport[_0x8120('0x2c')](_0x273db8);}};Report[_0x8120('0xf')]['voiceDialReport']=function(_0x3cf651){RpcVoiceDialReport[_0x8120('0x2c')](_0x3cf651);var _0x20c157;var _0x3121f0;var _0x2146bd=_0x3cf651[_0x8120('0x39')];if(_['startsWith'](_0x2146bd,_0x8120('0x4c'))){_0x3121f0=_0x2146bd[_0x8120('0x4d')](_0x2146bd[_0x8120('0x4e')]('/')+0x1,_0x2146bd[_0x8120('0x4e')]('@'));_0x20c157=_['find'](this[_0x8120('0x20')],function(_0x2f8b45){return _0x2f8b45[_0x8120('0x4f')]==_0x3121f0||_0x2f8b45['phone']==_0x3121f0||_0x2f8b45[_0x8120('0x21')]==_0x3121f0;});}else{_0x3121f0=_0x2146bd[_0x8120('0x4d')](_0x2146bd[_0x8120('0x4e')]('/')+0x1,_0x2146bd[_0x8120('0x50')]('-'));_0x20c157=this[_0x8120('0x1e')](_0x3121f0);}if(_0x20c157){_0x3cf651[_0x8120('0x23')]=_[_0x8120('0x22')](_0x20c157['interface'])?util[_0x8120('0x24')](_0x8120('0x25'),_0x20c157[_0x8120('0x26')]):_0x20c157[_0x8120('0x23')];_0x3cf651['membername']=_0x20c157[_0x8120('0x26')];_0x3cf651[_0x8120('0x21')]=_0x20c157['accountcode'];RpcMemberReport[_0x8120('0x51')](_0x3cf651);}};Report[_0x8120('0xf')][_0x8120('0x1b')]=function(_0x4d5444){RpcVoiceTransferReport[_0x8120('0x3f')][_0x4d5444[_0x8120('0x52')]]=_0x4d5444;};Report[_0x8120('0xf')][_0x8120('0x1d')]=function(_0x7162e3){RpcVoiceTransferReport['attendedTransfer'](_0x7162e3);};module['exports']=Report; \ No newline at end of file +var _0x3226=['channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','membername','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','length','lastAssignedTo','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x488e98,_0x1806fc){var _0x57acd8=function(_0x4bdb4c){while(--_0x4bdb4c){_0x488e98['push'](_0x488e98['shift']());}};_0x57acd8(++_0x1806fc);}(_0x3226,0x128));var _0x6322=function(_0x39e23f,_0x27fd31){_0x39e23f=_0x39e23f-0x0;var _0x3f6388=_0x3226[_0x39e23f];return _0x3f6388;};'use strict';var _=require(_0x6322('0x0'));var moment=require(_0x6322('0x1'));var util=require(_0x6322('0x2'));var config=require(_0x6322('0x3'));var ami=require(_0x6322('0x4'));var RpcVoiceAgentReport=require(_0x6322('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x6322('0x6'));var RpcMemberReport=require(_0x6322('0x7'));var RpcVoiceQueueReport=require(_0x6322('0x8'));var RpcVoiceRecording=require(_0x6322('0x9'));var RpcVoiceTransferReport=require(_0x6322('0xa'));var VoiceQueueReport=require(_0x6322('0xb'));var VoiceCallReport=require(_0x6322('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x6322('0xd'));var UserReport=require(_0x6322('0xe'));function Report(_0xbe18a4){this['realtime']=_0xbe18a4;this[_0x6322('0xf')]=_0xbe18a4[_0x6322('0xf')];this['telephones']=_0xbe18a4[_0x6322('0x10')];}Report[_0x6322('0x11')][_0x6322('0x12')]=function(_0x2481de){var _0x4cd7ec=new VoiceQueueReport(this[_0x6322('0x13')]);var _0x11a059=new VoiceAgentReport(this[_0x6322('0x13')]);var _0xfd9de8=new VoiceDialReport(this['realtime']);var _0x305e79=new VoiceCallReport(this['realtime']);var _0x254ea9=new UserReport(this[_0x6322('0x13')]);if(config['xdr']&&config['xdr'][_0x6322('0x14')]){ami['on'](_0x6322('0x15'),this[_0x6322('0x16')][_0x6322('0x17')](this));ami['on'](_0x6322('0x18'),this[_0x6322('0x19')]['bind'](this));ami['on'](_0x6322('0x1a'),this[_0x6322('0x1b')]['bind'](this));ami['on'](_0x6322('0x1c'),this['voiceDialReport'][_0x6322('0x17')](this));ami['on']('blindtransfer',this[_0x6322('0x1d')][_0x6322('0x17')](this));ami['on'](_0x6322('0x1e'),this['attendedTransfer'][_0x6322('0x17')](this));}};Report[_0x6322('0x11')][_0x6322('0x1f')]=function(_0x57db05){var _0x52612a;_0x52612a=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x2f8f6a){return _0x2f8f6a[_0x6322('0x21')]==_0x57db05||_0x2f8f6a[_0x6322('0x22')]==_0x57db05;});if(_['isNil'](_0x52612a)){var _0x385077=_[_0x6322('0x20')](this[_0x6322('0x10')],function(_0x22cd49){return _0x22cd49[_0x6322('0x21')]==_0x57db05||_0x22cd49['name']==_0x57db05;});if(_0x385077){_0x52612a=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x593b05){return _0x593b05[_0x6322('0x23')]==util[_0x6322('0x24')](_0x6322('0x25'),_0x385077[_0x6322('0x22')]);});}}return _0x52612a;};Report[_0x6322('0x11')][_0x6322('0x16')]=function(_0x3afd8f){for(var _0x457492=0x0;_0x457492<_0x3afd8f[_0x6322('0x26')];_0x457492+=0x1){var _0x50c263=this['findAgent'](_0x3afd8f[_0x457492]['connectedlinenum']);if(_0x50c263){_0x3afd8f[_0x457492]['accountcode']=_0x50c263[_0x6322('0x21')];_0x3afd8f[_0x457492]['assigned']=!![];_0x3afd8f[_0x457492][_0x6322('0x27')]=_0x50c263[_0x6322('0x22')];_0x3afd8f[_0x457492][_0x6322('0x23')]=_[_0x6322('0x28')](_0x50c263['interface'])?util[_0x6322('0x24')](_0x6322('0x25'),_0x50c263['name']):_0x50c263[_0x6322('0x23')];if(_0x3afd8f[_0x457492][_0x6322('0x29')]){_0x3afd8f[_0x457492]['queuecallercompleteAt']=moment()[_0x6322('0x24')](_0x6322('0x2a'));}if(_0x3afd8f[_0x457492][_0x6322('0x2b')]){_0x3afd8f[_0x457492][_0x6322('0x2c')]=moment()['format'](_0x6322('0x2a'));}RpcMemberReport[_0x6322('0x16')](_0x3afd8f[_0x457492]);}RpcVoiceQueueReport[_0x6322('0x2d')](_0x3afd8f[_0x457492]);}};function extractCalleridNumber(_0x51ae7f){var _0x67318=_0x51ae7f[_0x6322('0x2e')](/<(.*?)>/);return _0x67318?_0x67318[0x1]:_0x51ae7f;}Report[_0x6322('0x11')][_0x6322('0x19')]=function(_0x4d7821){_0x4d7821[_0x6322('0x2f')]=_0x4d7821[_0x6322('0x2f')]||_0x4d7821[_0x6322('0x30')];if(_0x4d7821[_0x6322('0x31')]==_0x6322('0x32')){_0x4d7821[_0x6322('0x33')]=_0x6322('0x34');_0x4d7821['lastdata']=_0x4d7821[_0x6322('0x34')];if(_0x4d7821[_0x6322('0x35')]==_0x6322('0x36')){_0x4d7821['accountcode']='';_0x4d7821[_0x6322('0x2f')]=extractCalleridNumber(_0x4d7821[_0x6322('0x37')]);}else if(_0x4d7821['context']=='from-sip'){if(_0x4d7821[_0x6322('0x2f')]==_0x6322('0x38')){_0x4d7821['destination']=extractCalleridNumber(_0x4d7821[_0x6322('0x39')]);_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3b')];_0x4d7821['destinationchannel']=[_0x4d7821[_0x6322('0x3c')],_0x4d7821[_0x6322('0x3c')]=_0x4d7821['destinationchannel']][0x0];_0x4d7821['callerid']=_0x4d7821[_0x6322('0x39')];}else{_0x4d7821[_0x6322('0x2f')]=_0x4d7821[_0x6322('0x3a')];_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3b')];if(_0x4d7821[_0x6322('0x3d')]==_0x6322('0x3e')){_0x4d7821[_0x6322('0x21')]=_0x4d7821[_0x6322('0x3f')];}else{_0x4d7821['accountcode']='';}}}}else{_0x4d7821[_0x6322('0x37')]=util[_0x6322('0x24')](_0x6322('0x40'),_0x4d7821[_0x6322('0x41')],_0x4d7821[_0x6322('0x3a')]);}if(RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]]){var _0x48856a=RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]];_0x48856a[_0x6322('0x44')]=_0x4d7821[_0x6322('0x45')];RpcVoiceTransferReport[_0x6322('0x1d')](_0x48856a);delete RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]];}RpcVoiceCallReport[_0x6322('0x2d')](_0x4d7821);if(_0x4d7821['monitor']){for(var _0xb0bb54=0x0;_0xb0bb54<_0x4d7821[_0x6322('0x46')][_0x6322('0x26')];_0xb0bb54+=0x1){_0x4d7821[_0x6322('0x47')]=_0x4d7821[_0x6322('0x46')][_0xb0bb54][_0x6322('0x48')];_0x4d7821[_0x6322('0x49')]=_0x4d7821[_0x6322('0x46')][_0xb0bb54][_0x6322('0x49')];if(_0x4d7821[_0x6322('0x30')]==_0x6322('0x38')){_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3f')];_0x4d7821['calleridname']=_0x4d7821['connectedlinename'];_0x4d7821[_0x6322('0x3f')]=_0x4d7821[_0x6322('0x21')];_0x4d7821[_0x6322('0x4a')]=_0x4d7821['membername'];_0x4d7821[_0x6322('0x30')]=_0x4d7821['originatecalleridnum'];}else if(_0x4d7821[_0x6322('0x30')]==_0x6322('0x4b')){_0x4d7821['calleridnum']=_0x4d7821[_0x6322('0x2f')];_0x4d7821[_0x6322('0x30')]=_0x4d7821[_0x6322('0x3b')];}RpcVoiceRecording[_0x6322('0x2d')](_0x4d7821);}}};Report[_0x6322('0x11')][_0x6322('0x1b')]=function(_0x502ad2){if(_[_0x6322('0x4c')](_0x502ad2)){_0x502ad2[_0x6322('0x4d')](function(_0x72b649){RpcVoiceAgentReport[_0x6322('0x2d')](_0x72b649);});}else{RpcVoiceAgentReport[_0x6322('0x2d')](_0x502ad2);}};Report[_0x6322('0x11')][_0x6322('0x4e')]=function(_0x20bb66){RpcVoiceDialReport[_0x6322('0x2d')](_0x20bb66);var _0x315d00;var _0x2e274d;var _0x204476=_0x20bb66[_0x6322('0x3c')];if(_[_0x6322('0x4f')](_0x204476,_0x6322('0x50'))){_0x2e274d=_0x204476[_0x6322('0x51')](_0x204476[_0x6322('0x52')]('/')+0x1,_0x204476[_0x6322('0x52')]('@'));_0x315d00=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x3153a0){return _0x3153a0[_0x6322('0x53')]==_0x2e274d||_0x3153a0['phone']==_0x2e274d||_0x3153a0[_0x6322('0x21')]==_0x2e274d;});}else{_0x2e274d=_0x204476[_0x6322('0x51')](_0x204476[_0x6322('0x52')]('/')+0x1,_0x204476[_0x6322('0x54')]('-'));_0x315d00=this[_0x6322('0x1f')](_0x2e274d);}if(_0x315d00){_0x20bb66[_0x6322('0x23')]=_[_0x6322('0x28')](_0x315d00['interface'])?util[_0x6322('0x24')](_0x6322('0x25'),_0x315d00[_0x6322('0x22')]):_0x315d00[_0x6322('0x23')];_0x20bb66[_0x6322('0x55')]=_0x315d00[_0x6322('0x22')];_0x20bb66[_0x6322('0x21')]=_0x315d00['accountcode'];RpcMemberReport['voiceDialReport'](_0x20bb66);}};Report[_0x6322('0x11')][_0x6322('0x1d')]=function(_0x544942){RpcVoiceTransferReport[_0x6322('0x42')][_0x544942[_0x6322('0x56')]]=_0x544942;};Report['prototype'][_0x6322('0x57')]=function(_0x2c61bc){RpcVoiceTransferReport['attendedTransfer'](_0x2c61bc);};module[_0x6322('0x58')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index a1e7ce1..7707083 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe65b=['syncRealtimeShow','resolve','then','catch','error','inspect','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','state','omit','actionid','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','phone','accountcode','info','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','bind','syncDeviceState','peerstatus','syncPeerStatus'];(function(_0x4d2fd1,_0x413e5c){var _0x400b45=function(_0x1375b7){while(--_0x1375b7){_0x4d2fd1['push'](_0x4d2fd1['shift']());}};_0x400b45(++_0x413e5c);}(_0xe65b,0x75));var _0xbe65=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe65b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbe65('0x0'));var moment=require(_0xbe65('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0xbe65('0x2'));var config=require('../../../config/environment');var logger=require(_0xbe65('0x3'))(_0xbe65('0x4'));var ami=require(_0xbe65('0x5'));config[_0xbe65('0x6')]=_[_0xbe65('0x7')](config[_0xbe65('0x6')],{'host':_0xbe65('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x313f89){this['trunks']=_0x313f89[_0xbe65('0x9')];this[_0xbe65('0xa')]=_0x313f89[_0xbe65('0xa')];this[_0xbe65('0xb')]=_0x313f89[_0xbe65('0xb')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on']('registry',this[_0xbe65('0xc')][_0xbe65('0xd')](this));ami['on']('devicestatechange',this[_0xbe65('0xe')]['bind'](this));ami['on'](_0xbe65('0xf'),this[_0xbe65('0x10')]['bind'](this));return this[_0xbe65('0x11')]();}function showSipRegistrations(){Promise[_0xbe65('0x12')]()[_0xbe65('0x13')](ami['actionSipShowRegistry']())[_0xbe65('0x14')](function(_0x523cce){logger[_0xbe65('0x15')]('[userReport][sipshowregistry]',util['inspect'](_0x523cce,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xbe65('0x12')]()[_0xbe65('0x13')](ami['actionDeviceStateList']())[_0xbe65('0x14')](function(_0x136bdd){logger[_0xbe65('0x15')]('[userReport][devicestatelist]',util[_0xbe65('0x16')](_0x136bdd,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xbe65('0x12')]()['then'](ami[_0xbe65('0x17')]())['catch'](function(_0x385e00){logger['error']('[userReport][sippeerstatus]',util[_0xbe65('0x16')](_0x385e00,{'showHidden':![],'depth':null}));});}UserReport[_0xbe65('0x18')][_0xbe65('0x11')]=function(){setInterval(function(){BPromise[_0xbe65('0x12')]()[_0xbe65('0x13')](showSipRegistrations())[_0xbe65('0x13')](listDeviceStates())[_0xbe65('0x13')](showPeersStatus());},0x32c8);};UserReport[_0xbe65('0x18')][_0xbe65('0x19')]=function(_0x583584){return _0x583584!==null&&!_[_0xbe65('0x1a')](_0x583584);};UserReport[_0xbe65('0x18')][_0xbe65('0x1b')]=function(_0x59f75a,_0x2343a8,_0x6ed4c0){io['to'](_0x59f75a)[_0xbe65('0x1b')](_0x2343a8,_0x6ed4c0);};UserReport[_0xbe65('0x18')]['syncRegistry']=function(_0x4e8386){try{if(this[_0xbe65('0x19')](_0x4e8386)){logger['info'](_0xbe65('0x1c'),_0x4e8386[_0xbe65('0x1d')],_0x4e8386['state']);logger[_0xbe65('0x1e')](_0xbe65('0x1f'),util[_0xbe65('0x16')](_0x4e8386,{'showHidden':![],'depth':null}));var _0x1dccf0=_[_0xbe65('0x20')](this[_0xbe65('0x9')],{'defaultuser':_0x4e8386['username']});if(_0x1dccf0){_0x4e8386[_0xbe65('0x21')]=_0x4e8386[_0xbe65('0x22')];_['merge'](_0x1dccf0,_[_0xbe65('0x23')](_0x4e8386,['event',_0xbe65('0x24'),_0xbe65('0x1d'),_0xbe65('0x22')]));logger[_0xbe65('0x1e')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x1dccf0,{'showHidden':![],'depth':null}));this[_0xbe65('0x1b')](util[_0xbe65('0x25')](_0xbe65('0x26'),_0x1dccf0[_0xbe65('0x27')]),_0xbe65('0x28'),_0x1dccf0);}}}catch(_0x2874a2){logger[_0xbe65('0x15')]('[userReport][registry]',util['inspect'](_0x2874a2,{'showHidden':![],'depth':null}));}};UserReport[_0xbe65('0x18')][_0xbe65('0xe')]=function(_0x31fc70){try{if(this[_0xbe65('0x19')](_0x31fc70)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x31fc70['device'],_0x31fc70['state']);logger[_0xbe65('0x1e')](_0xbe65('0x29'),util[_0xbe65('0x16')](_0x31fc70,{'showHidden':![],'depth':null}));if(this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]]){if(!this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x2b')]||_0x31fc70[_0xbe65('0x22')][_0xbe65('0x2c')]()==_0xbe65('0x2d')){this['agents'][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x2b')]=![];if(this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x22')]!==_0x31fc70[_0xbe65('0x22')][_0xbe65('0x2c')]()){this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x2e')]=_[_0xbe65('0x2f')](moment()['format']('x'));}this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]]['state']=_0x31fc70[_0xbe65('0x22')][_0xbe65('0x2c')]();this[_0xbe65('0xa')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x30')](_0x31fc70);}}else if(this['telephones'][_0x31fc70[_0xbe65('0x2a')]]){if(this[_0xbe65('0xb')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x22')]!==_0x31fc70[_0xbe65('0x22')][_0xbe65('0x2c')]()){this[_0xbe65('0xb')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x2e')]=_['toNumber'](moment()[_0xbe65('0x25')]('x'));}this['telephones'][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x22')]=_0x31fc70['state'][_0xbe65('0x2c')]();logger['debug'](_0xbe65('0x31'),util[_0xbe65('0x16')](this[_0xbe65('0xb')][_0x31fc70[_0xbe65('0x2a')]],{'showHidden':![],'depth':null}));this[_0xbe65('0x1b')](util[_0xbe65('0x25')](_0xbe65('0x32'),this[_0xbe65('0xb')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x27')]),'telephone:save',this[_0xbe65('0xb')][_0x31fc70['device']]);}else if(this[_0xbe65('0x9')][_0x31fc70[_0xbe65('0x2a')]]){if(this[_0xbe65('0x9')][_0x31fc70[_0xbe65('0x2a')]]['state']!==_0x31fc70['state'][_0xbe65('0x2c')]()){this['trunks'][_0x31fc70[_0xbe65('0x2a')]]['stateTime']=_[_0xbe65('0x2f')](moment()[_0xbe65('0x25')]('x'));}this[_0xbe65('0x9')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x22')]=_0x31fc70[_0xbe65('0x22')]['toLowerCase']();logger[_0xbe65('0x1e')](_0xbe65('0x33'),util[_0xbe65('0x16')](this['trunks'][_0x31fc70[_0xbe65('0x2a')]],{'showHidden':![],'depth':null}));this[_0xbe65('0x1b')](util[_0xbe65('0x25')](_0xbe65('0x26'),this[_0xbe65('0x9')][_0x31fc70[_0xbe65('0x2a')]][_0xbe65('0x27')]),_0xbe65('0x28'),this[_0xbe65('0x9')][_0x31fc70[_0xbe65('0x2a')]]);}else if(_[_0xbe65('0x34')](_0x31fc70[_0xbe65('0x2a')],_0xbe65('0x35'))){var _0x4f7a1e=_0x31fc70['device'];var _0x367c3f=_0x4f7a1e[_0xbe65('0x36')](_0x4f7a1e['indexOf']('/')+0x1,_0x4f7a1e['indexOf']('@'));var _0x4e4eaf=_[_0xbe65('0x20')](this[_0xbe65('0xa')],function(_0x4e769f){return _0x4e769f['mobile']==_0x367c3f||_0x4e769f[_0xbe65('0x37')]==_0x367c3f||_0x4e769f[_0xbe65('0x38')]==_0x367c3f;});if(_0x4e4eaf){if(_0x4e4eaf[_0xbe65('0x22')]!==_0x31fc70['state'][_0xbe65('0x2c')]()){_0x4e4eaf['stateTime']=_[_0xbe65('0x2f')](moment()[_0xbe65('0x25')]('x'));}_0x4e4eaf[_0xbe65('0x22')]=_0x31fc70[_0xbe65('0x22')][_0xbe65('0x2c')]();_0x4e4eaf[_0xbe65('0x2b')]=!![];_0x4e4eaf['updateStatusRealtime'](_0x31fc70);}}}}catch(_0x4216f7){logger['error'](_0xbe65('0x29'),util[_0xbe65('0x16')](_0x4216f7,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x22fc96){try{if(this[_0xbe65('0x19')](_0x22fc96)&&this[_0xbe65('0x19')](_0x22fc96[_0xbe65('0xf')])){logger[_0xbe65('0x39')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x22fc96[_0xbe65('0x3a')],_0x22fc96[_0xbe65('0x3b')],_0x22fc96['peerstatus']);logger[_0xbe65('0x1e')](_0xbe65('0x3c'),util[_0xbe65('0x16')](_0x22fc96,{'showHidden':![],'depth':null}));if(this[_0xbe65('0xa')][_0x22fc96[_0xbe65('0x3a')]]){if(!this[_0xbe65('0xa')][_0x22fc96[_0xbe65('0x3a')]][_0xbe65('0x2b')]||_0x22fc96['peerstatus'][_0xbe65('0x2c')]()==_0xbe65('0x3d')){this[_0xbe65('0xa')][_0x22fc96['peer']][_0xbe65('0x2b')]=![];this[_0xbe65('0xa')][_0x22fc96[_0xbe65('0x3a')]][_0xbe65('0x3e')]=_0x22fc96[_0xbe65('0xf')][_0xbe65('0x2c')]();this[_0xbe65('0xa')][_0x22fc96[_0xbe65('0x3a')]]['address']=_0x22fc96[_0xbe65('0x3b')];this[_0xbe65('0xa')][_0x22fc96[_0xbe65('0x3a')]][_0xbe65('0x30')](_0x22fc96);}}else if(this[_0xbe65('0xb')][_0x22fc96[_0xbe65('0x3a')]]){this[_0xbe65('0xb')][_0x22fc96[_0xbe65('0x3a')]][_0xbe65('0x3e')]=_0x22fc96['peerstatus'][_0xbe65('0x2c')]();this[_0xbe65('0xb')][_0x22fc96[_0xbe65('0x3a')]][_0xbe65('0x3b')]=_0x22fc96[_0xbe65('0x3b')];logger[_0xbe65('0x1e')](_0xbe65('0x3f'),util['inspect'](this[_0xbe65('0xb')][_0x22fc96[_0xbe65('0x3a')]],{'showHidden':![],'depth':null}));this[_0xbe65('0x1b')](util[_0xbe65('0x25')](_0xbe65('0x32'),this[_0xbe65('0xb')][_0x22fc96['peer']][_0xbe65('0x27')]),_0xbe65('0x40'),this[_0xbe65('0xb')][_0x22fc96[_0xbe65('0x3a')]]);}else if(this[_0xbe65('0x9')][_0x22fc96['peer']]){this[_0xbe65('0x9')][_0x22fc96['peer']]['status']=_0x22fc96[_0xbe65('0xf')][_0xbe65('0x2c')]();this[_0xbe65('0x9')][_0x22fc96[_0xbe65('0x3a')]]['address']=_0x22fc96['address'];logger[_0xbe65('0x1e')](_0xbe65('0x41'),util[_0xbe65('0x16')](this[_0xbe65('0x9')][_0x22fc96[_0xbe65('0x3a')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xbe65('0x25')]('trunk:%s',this[_0xbe65('0x9')][_0x22fc96['peer']][_0xbe65('0x27')]),'trunk:save',this[_0xbe65('0x9')][_0x22fc96[_0xbe65('0x3a')]]);}}}catch(_0x2264e0){logger[_0xbe65('0x15')]('[userReport][peerstatus]',util['inspect'](_0x2264e0,{'showHidden':![],'depth':null}));}};module[_0xbe65('0x42')]=UserReport; \ No newline at end of file +var _0x7acd=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','format','updateStatusRealtime','toNumber','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered'];(function(_0x4e7fd0,_0x29cccd){var _0x1de972=function(_0x430190){while(--_0x430190){_0x4e7fd0['push'](_0x4e7fd0['shift']());}};_0x1de972(++_0x29cccd);}(_0x7acd,0xeb));var _0xd7ac=function(_0x15cbe1,_0x4e5ee9){_0x15cbe1=_0x15cbe1-0x0;var _0x43bca8=_0x7acd[_0x15cbe1];return _0x43bca8;};'use strict';var _=require(_0xd7ac('0x0'));var moment=require(_0xd7ac('0x1'));var util=require(_0xd7ac('0x2'));var Redis=require('ioredis');var BPromise=require(_0xd7ac('0x3'));var config=require('../../../config/environment');var logger=require(_0xd7ac('0x4'))(_0xd7ac('0x5'));var ami=require('../ami');config['redis']=_[_0xd7ac('0x6')](config[_0xd7ac('0x7')],{'host':_0xd7ac('0x8'),'port':0x18eb});var io=require(_0xd7ac('0x9'))(new Redis(config[_0xd7ac('0x7')]));function UserReport(_0x18c12e){this[_0xd7ac('0xa')]=_0x18c12e[_0xd7ac('0xa')];this[_0xd7ac('0xb')]=_0x18c12e[_0xd7ac('0xb')];this[_0xd7ac('0xc')]=_0x18c12e[_0xd7ac('0xc')];ami['on'](_0xd7ac('0xd'),this[_0xd7ac('0xe')]['bind'](this));ami['on'](_0xd7ac('0xf'),this['syncRegistry'][_0xd7ac('0x10')](this));ami['on'](_0xd7ac('0x11'),this[_0xd7ac('0x12')][_0xd7ac('0x10')](this));ami['on'](_0xd7ac('0x13'),this[_0xd7ac('0x14')][_0xd7ac('0x10')](this));return this[_0xd7ac('0x15')]();}function showSipRegistrations(){Promise['resolve']()[_0xd7ac('0x16')](ami['actionSipShowRegistry']())[_0xd7ac('0x17')](function(_0x16f706){logger[_0xd7ac('0x18')](_0xd7ac('0x19'),util[_0xd7ac('0x1a')](_0x16f706,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd7ac('0x1b')]()[_0xd7ac('0x16')](ami[_0xd7ac('0x1c')]())[_0xd7ac('0x17')](function(_0x10f827){logger[_0xd7ac('0x18')](_0xd7ac('0x1d'),util['inspect'](_0x10f827,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd7ac('0x1b')]()[_0xd7ac('0x16')](ami[_0xd7ac('0x1e')]())[_0xd7ac('0x17')](function(_0x13a9db){logger[_0xd7ac('0x18')](_0xd7ac('0x1f'),util['inspect'](_0x13a9db,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xd7ac('0x1b')]()['then'](showSipRegistrations())[_0xd7ac('0x16')](listDeviceStates())[_0xd7ac('0x16')](showPeersStatus());},0x32c8);};UserReport[_0xd7ac('0x20')][_0xd7ac('0x21')]=function(_0x4255d1){return _0x4255d1!==null&&!_[_0xd7ac('0x22')](_0x4255d1);};UserReport[_0xd7ac('0x20')][_0xd7ac('0x23')]=function(_0x1e903c,_0x93ca4c,_0x1d4061){io['to'](_0x1e903c)[_0xd7ac('0x23')](_0x93ca4c,_0x1d4061);};UserReport[_0xd7ac('0x20')][_0xd7ac('0xe')]=function(_0x3b95e6){try{if(this['isNotNull'](_0x3b95e6)){logger[_0xd7ac('0x24')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x3b95e6[_0xd7ac('0x25')],_0x3b95e6[_0xd7ac('0x26')]);logger[_0xd7ac('0x27')](_0xd7ac('0x28'),util[_0xd7ac('0x1a')](_0x3b95e6,{'showHidden':![],'depth':null}));var _0x2e193c=_['find'](this[_0xd7ac('0xa')],{'defaultuser':_0x3b95e6['username']});if(_0x2e193c){_0x3b95e6[_0xd7ac('0x29')]=_0x3b95e6[_0xd7ac('0x26')];_[_0xd7ac('0x2a')](_0x2e193c,_[_0xd7ac('0x2b')](_0x3b95e6,[_0xd7ac('0x2c'),_0xd7ac('0x2d'),'username','state']));logger[_0xd7ac('0x27')](_0xd7ac('0x2e'),util[_0xd7ac('0x1a')](_0x2e193c,{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util['format'](_0xd7ac('0x2f'),_0x2e193c[_0xd7ac('0x30')]),_0xd7ac('0x31'),_0x2e193c);}}}catch(_0x17fcd1){logger[_0xd7ac('0x18')]('[userReport][registry]',util[_0xd7ac('0x1a')](_0x17fcd1,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x27dc3c){try{if(this[_0xd7ac('0x21')](_0x27dc3c)){logger[_0xd7ac('0x24')](_0xd7ac('0x32'),_0x27dc3c[_0xd7ac('0x33')],_0x27dc3c[_0xd7ac('0x26')]);logger[_0xd7ac('0x27')](_0xd7ac('0x34'),util[_0xd7ac('0x1a')](_0x27dc3c,{'showHidden':![],'depth':null}));if(this[_0xd7ac('0xb')][_0x27dc3c['device']]){if(!this['agents'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x35')]||_0x27dc3c['state'][_0xd7ac('0x36')]()==_0xd7ac('0x37')){this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x35')]=![];if(this['agents'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x38')]=_['toNumber'](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xb')][_0x27dc3c['device']][_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]();this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x3a')](_0x27dc3c);}}else if(this[_0xd7ac('0xc')][_0x27dc3c['device']]){if(this['telephones'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x38')]=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')]['toLowerCase']();logger[_0xd7ac('0x27')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xd7ac('0x1a')](this[_0xd7ac('0xc')][_0x27dc3c[_0xd7ac('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd7ac('0x39')]('telephone:%s',this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x30')]),_0xd7ac('0x3c'),this['telephones'][_0x27dc3c['device']]);}else if(this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]){if(this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c['state'][_0xd7ac('0x36')]()){this['trunks'][_0x27dc3c[_0xd7ac('0x33')]]['stateTime']=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]=_0x27dc3c['state'][_0xd7ac('0x36')]();logger[_0xd7ac('0x27')](_0xd7ac('0x3d'),util['inspect'](this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util[_0xd7ac('0x39')](_0xd7ac('0x2f'),this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]['name']),_0xd7ac('0x31'),this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]);}else if(_[_0xd7ac('0x3e')](_0x27dc3c[_0xd7ac('0x33')],_0xd7ac('0x3f'))){var _0x456795=_0x27dc3c['device'];var _0x120181=_0x456795['substring'](_0x456795['indexOf']('/')+0x1,_0x456795['indexOf']('@'));var _0x33f14e=_[_0xd7ac('0x40')](this[_0xd7ac('0xb')],function(_0x50505c){return _0x50505c[_0xd7ac('0x41')]==_0x120181||_0x50505c[_0xd7ac('0x42')]==_0x120181||_0x50505c[_0xd7ac('0x43')]==_0x120181;});if(_0x33f14e){if(_0x33f14e[_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){_0x33f14e[_0xd7ac('0x38')]=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}_0x33f14e[_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]();_0x33f14e[_0xd7ac('0x35')]=!![];_0x33f14e[_0xd7ac('0x3a')](_0x27dc3c);}}}}catch(_0x245f1c){logger[_0xd7ac('0x18')](_0xd7ac('0x34'),util[_0xd7ac('0x1a')](_0x245f1c,{'showHidden':![],'depth':null}));}};UserReport[_0xd7ac('0x20')][_0xd7ac('0x14')]=function(_0x3b58fd){try{if(this['isNotNull'](_0x3b58fd)&&this['isNotNull'](_0x3b58fd[_0xd7ac('0x13')])){logger[_0xd7ac('0x24')](_0xd7ac('0x44'),_0x3b58fd['peer'],_0x3b58fd[_0xd7ac('0x45')],_0x3b58fd[_0xd7ac('0x13')]);logger['debug'](_0xd7ac('0x46'),util[_0xd7ac('0x1a')](_0x3b58fd,{'showHidden':![],'depth':null}));if(this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]]){if(!this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x35')]||_0x3b58fd['peerstatus']['toLowerCase']()==_0xd7ac('0x48')){this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x35')]=![];this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd[_0xd7ac('0x13')][_0xd7ac('0x36')]();this[_0xd7ac('0xb')][_0x3b58fd['peer']][_0xd7ac('0x45')]=_0x3b58fd[_0xd7ac('0x45')];this['agents'][_0x3b58fd['peer']][_0xd7ac('0x3a')](_0x3b58fd);}}else if(this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]]){this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd[_0xd7ac('0x13')][_0xd7ac('0x36')]();this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x45')]=_0x3b58fd[_0xd7ac('0x45')];logger[_0xd7ac('0x27')](_0xd7ac('0x4a'),util['inspect'](this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util['format']('telephone:%s',this['telephones'][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x30')]),_0xd7ac('0x3c'),this['telephones'][_0x3b58fd[_0xd7ac('0x47')]]);}else if(this['trunks'][_0x3b58fd['peer']]){this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd['peerstatus'][_0xd7ac('0x36')]();this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]]['address']=_0x3b58fd[_0xd7ac('0x45')];logger[_0xd7ac('0x27')](_0xd7ac('0x4b'),util[_0xd7ac('0x1a')](this['trunks'][_0x3b58fd[_0xd7ac('0x47')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util[_0xd7ac('0x39')]('trunk:%s',this[_0xd7ac('0xa')][_0x3b58fd['peer']]['name']),'trunk:save',this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]]);}}}catch(_0x2fca9f){logger[_0xd7ac('0x18')](_0xd7ac('0x46'),util[_0xd7ac('0x1a')](_0x2fca9f,{'showHidden':![],'depth':null}));}};module[_0xd7ac('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 8103fef..4120f14 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96aa=['[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','interface','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','inbound','voice','merge','omit','event'];(function(_0x4986c6,_0x3ad414){var _0x4c8167=function(_0x3ad30a){while(--_0x3ad30a){_0x4986c6['push'](_0x4986c6['shift']());}};_0x4c8167(++_0x3ad414);}(_0x96aa,0x67));var _0xa96a=function(_0x44333d,_0x133810){_0x44333d=_0x44333d-0x0;var _0x44ec1c=_0x96aa[_0x44333d];return _0x44ec1c;};'use strict';var _=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));var util=require('util');var Redis=require(_0xa96a('0x2'));var config=require(_0xa96a('0x3'));var logger=require(_0xa96a('0x4'))(_0xa96a('0x5'));var ami=require(_0xa96a('0x6'));config['redis']=_[_0xa96a('0x7')](config[_0xa96a('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa96a('0x9'))(new Redis(config[_0xa96a('0x8')]));function VoiceAgentReport(_0x282c8c){this[_0xa96a('0xa')]={};this[_0xa96a('0xb')]=_0x282c8c[_0xa96a('0xa')];this[_0xa96a('0xc')]=_0x282c8c[_0xa96a('0xc')];this[_0xa96a('0xd')]=_0x282c8c[_0xa96a('0xd')];this[_0xa96a('0xe')]={};ami['on']('agentcalled',this[_0xa96a('0xf')]['bind'](this));ami['on'](_0xa96a('0x10'),this[_0xa96a('0x11')]['bind'](this));ami['on'](_0xa96a('0x12'),this[_0xa96a('0x13')][_0xa96a('0x14')](this));ami['on'](_0xa96a('0x15'),this[_0xa96a('0x16')][_0xa96a('0x14')](this));ami['on'](_0xa96a('0x17'),this[_0xa96a('0x18')][_0xa96a('0x14')](this));ami['on'](_0xa96a('0x19'),this[_0xa96a('0x1a')][_0xa96a('0x14')](this));ami['on']('hangup',this['syncHangup'][_0xa96a('0x14')](this));ami['on']('musiconholdstart',this[_0xa96a('0x1b')]['bind'](this));ami['on'](_0xa96a('0x1c'),this[_0xa96a('0x1d')][_0xa96a('0x14')](this));ami['on'](_0xa96a('0x1e'),this[_0xa96a('0x1f')][_0xa96a('0x14')](this));ami['on']('blindtransfer',this[_0xa96a('0x20')][_0xa96a('0x14')](this));}VoiceAgentReport['prototype'][_0xa96a('0x21')]=function(_0x33298e,_0x4155e5,_0x2e8c75){io['to'](_0x33298e)[_0xa96a('0x21')](_0x4155e5,_0x2e8c75);};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x23')]=function(_0x190e94){return _0x190e94!==null&&!_[_0xa96a('0x24')](_0x190e94);};VoiceAgentReport['prototype'][_0xa96a('0xf')]=function(_0x5b7cbc){try{if(this[_0xa96a('0x23')](_0x5b7cbc)){logger['info'](_0xa96a('0x25'),_0x5b7cbc[_0xa96a('0x26')],_0x5b7cbc['membername'],_0x5b7cbc['destuniqueid']);logger[_0xa96a('0x27')](_0xa96a('0x28'),_0x5b7cbc[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x5b7cbc,{'showHidden':![],'depth':null}));if(_[_0xa96a('0x24')](this[_0xa96a('0xa')][_0x5b7cbc['uniqueid']])){this['channels'][_0x5b7cbc[_0xa96a('0x26')]]={};}if(_['isUndefined'](this[_0xa96a('0xa')][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc[_0xa96a('0x2a')]])){this['channels'][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc['destuniqueid']]={'agentcalledAt':moment()['format'](_0xa96a('0x2b')),'lastevent':'called','mandatoryDisposition':this[_0xa96a('0xc')][_0x5b7cbc[_0xa96a('0x2c')]]?this[_0xa96a('0xc')][_0x5b7cbc['queue']][_0xa96a('0x2d')]||![]:![],'type':this['voiceQueues'][_0x5b7cbc['queue']]?this[_0xa96a('0xc')][_0x5b7cbc['queue']]['type']||_0xa96a('0x2e'):_0xa96a('0x2e'),'variables':this['variables'][_0x5b7cbc[_0xa96a('0x26')]],'motionChannel':_0xa96a('0x2f')};}_[_0xa96a('0x30')](this[_0xa96a('0xa')][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc['destuniqueid']],_[_0xa96a('0x31')](_0x5b7cbc,[_0xa96a('0x32'),'privilege']));logger[_0xa96a('0x27')](_0xa96a('0x33'),_0x5b7cbc[_0xa96a('0x26')],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc[_0xa96a('0x2a')]],{'showHidden':![],'depth':null}));ami['emit'](_0xa96a('0x34'),this[_0xa96a('0xa')][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc[_0xa96a('0x2a')]]);logger[_0xa96a('0x27')](_0xa96a('0x35'),_0x5b7cbc['uniqueid'],util['inspect'](this['channels'][_0x5b7cbc['uniqueid']][_0x5b7cbc[_0xa96a('0x2a')]],{'showHidden':![],'depth':null}));this[_0xa96a('0x21')](util[_0xa96a('0x36')](_0xa96a('0x37'),_0x5b7cbc[_0xa96a('0x38')]),_0xa96a('0x39'),this[_0xa96a('0xa')][_0x5b7cbc[_0xa96a('0x26')]][_0x5b7cbc[_0xa96a('0x2a')]]);}}catch(_0xddd3f8){logger[_0xa96a('0x3a')](_0xa96a('0x3b'),_0x5b7cbc['uniqueid'],util['inspect'](_0xddd3f8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x11')]=function(_0x49fd6e){try{if(this[_0xa96a('0x23')](_0x49fd6e)){if(this['channels'][_0x49fd6e['uniqueid']]){logger[_0xa96a('0x27')](_0xa96a('0x3c'),_0x49fd6e[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x49fd6e,{'showHidden':![],'depth':null}));for(var _0x169acd in this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]]){if(this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]]['hasOwnProperty'](_0x169acd)){if(_0x49fd6e[_0xa96a('0x2a')]===_0x169acd){logger[_0xa96a('0x3d')](_0xa96a('0x3e'),_0x49fd6e['uniqueid'],_0x49fd6e['membername'],_0x49fd6e['destuniqueid']);this['channels'][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x3f')]=moment()['format'](_0xa96a('0x2b'));this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x40')]=_0x49fd6e[_0xa96a('0x40')];this[_0xa96a('0xa')][_0x49fd6e['uniqueid']][_0x169acd]['connectedlinenum']=_0x49fd6e['connectedlinenum'];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x41')]=_0x49fd6e['destchannelstate'];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x42')]=_0x49fd6e['destchannelstatedesc'];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x43')]=_0x49fd6e[_0xa96a('0x43')];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x44')]='connect';if(this[_0xa96a('0xb')][this[_0xa96a('0xa')][_0x49fd6e['uniqueid']][_0x169acd]['uniqueid']]){var _0x10f6bf=this[_0xa96a('0xb')][this['channels'][_0x49fd6e['uniqueid']][_0x169acd][_0xa96a('0x26')]][_0xa96a('0x45')];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x45')]=_0x10f6bf;_0x49fd6e['routealias']=_0x10f6bf;}_[_0xa96a('0x30')](this[_0xa96a('0xd')][_0x49fd6e[_0xa96a('0x46')]],_['pick'](_0x49fd6e,['queue',_0xa96a('0x47'),_0xa96a('0x45')]));logger[_0xa96a('0x27')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x49fd6e['uniqueid'],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x49fd6e[_0xa96a('0x2a')]],{'showHidden':![],'depth':null}));ami[_0xa96a('0x21')](_0xa96a('0x48'),this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x49fd6e[_0xa96a('0x2a')]]);logger[_0xa96a('0x27')](_0xa96a('0x49'),_0x49fd6e[_0xa96a('0x26')],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x49fd6e['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xa96a('0x21')](util['format']('user:%s',_0x49fd6e[_0xa96a('0x38')]),'user:agentconnect',this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x49fd6e[_0xa96a('0x2a')]]);}else if(!this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x12')]&&!this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x17')]){logger[_0xa96a('0x3d')](_0xa96a('0x4a'),_0x49fd6e['uniqueid'],this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd]['membername'],_0x169acd);this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd]['agentringnoanswer']=!![];this[_0xa96a('0xa')][_0x49fd6e['uniqueid']][_0x169acd][_0xa96a('0x4b')]=moment()[_0xa96a('0x36')](_0xa96a('0x2b'));this[_0xa96a('0xa')][_0x49fd6e['uniqueid']][_0x169acd][_0xa96a('0x4c')]=_0x49fd6e[_0xa96a('0x2a')];this['channels'][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x4d')]=_0x49fd6e[_0xa96a('0x38')];this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x44')]=_0xa96a('0x4e');this[_0xa96a('0xa')][_0x49fd6e[_0xa96a('0x26')]][_0x169acd][_0xa96a('0x4f')]='answered_elsewhere';logger[_0xa96a('0x27')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x49fd6e[_0xa96a('0x26')],util[_0xa96a('0x29')](this['channels'][_0x49fd6e['uniqueid']][_0x169acd],{'showHidden':![],'depth':null}));ami[_0xa96a('0x21')](_0xa96a('0x50'),this[_0xa96a('0xa')][_0x49fd6e['uniqueid']][_0x169acd]);}}}}}}catch(_0x288b13){logger['error'](_0xa96a('0x51'),_0x49fd6e[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x288b13,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')]['syncAgentRingNoAnswer']=function(_0x6149ad){try{if(this[_0xa96a('0x23')](_0x6149ad)){logger[_0xa96a('0x27')](_0xa96a('0x52'),_0x6149ad[_0xa96a('0x26')],util['inspect'](_0x6149ad,{'showHidden':![],'depth':null}));if(this[_0xa96a('0xa')][_0x6149ad[_0xa96a('0x26')]]&&this['channels'][_0x6149ad[_0xa96a('0x26')]][_0x6149ad[_0xa96a('0x2a')]]){logger[_0xa96a('0x3d')](_0xa96a('0x53'),_0x6149ad[_0xa96a('0x26')],_0x6149ad['membername'],_0x6149ad[_0xa96a('0x2a')]);this[_0xa96a('0xa')][_0x6149ad[_0xa96a('0x26')]][_0x6149ad[_0xa96a('0x2a')]][_0xa96a('0x12')]=!![];this[_0xa96a('0xa')][_0x6149ad[_0xa96a('0x26')]][_0x6149ad[_0xa96a('0x2a')]]['agentringnoanswerAt']=moment()[_0xa96a('0x36')](_0xa96a('0x2b'));this[_0xa96a('0xa')][_0x6149ad[_0xa96a('0x26')]][_0x6149ad[_0xa96a('0x2a')]][_0xa96a('0x44')]=_0xa96a('0x54');this[_0xa96a('0xa')][_0x6149ad[_0xa96a('0x26')]][_0x6149ad[_0xa96a('0x2a')]][_0xa96a('0x4f')]='rejected';logger[_0xa96a('0x27')](_0xa96a('0x55'),_0x6149ad['uniqueid'],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x6149ad['uniqueid']][_0x6149ad[_0xa96a('0x2a')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xa96a('0xa')][_0x6149ad['uniqueid']][_0x6149ad[_0xa96a('0x2a')]]);}}}catch(_0x28b4db){logger[_0xa96a('0x3a')]('[%s][voiceAgentReport][agentringnoanswer]',_0x6149ad[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x28b4db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x16')]=function(_0x46a4fa){try{if(this[_0xa96a('0x23')](_0x46a4fa)){logger[_0xa96a('0x27')](_0xa96a('0x56'),_0x46a4fa['uniqueid'],util['inspect'](_0x46a4fa,{'showHidden':![],'depth':null}));if(this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]]){for(var _0xd9b71b in this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]]){if(this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xa96a('0x57')](_0xd9b71b)&&!this[_0xa96a('0xa')][_0x46a4fa['uniqueid']][_0xd9b71b][_0xa96a('0x12')]&&!this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b][_0xa96a('0x17')]){logger[_0xa96a('0x3d')](_0xa96a('0x58'),_0x46a4fa[_0xa96a('0x26')],this['channels'][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b]['membername'],_0xd9b71b);this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b]['agentringnoanswer']=!![];this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b][_0xa96a('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b][_0xa96a('0x44')]='abandoned';this['channels'][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b][_0xa96a('0x4f')]=_0xa96a('0x59');logger[_0xa96a('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x46a4fa[_0xa96a('0x26')],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b],{'showHidden':![],'depth':null}));ami[_0xa96a('0x21')](_0xa96a('0x5a'),this['channels'][_0x46a4fa[_0xa96a('0x26')]][_0xd9b71b]);}}}}}catch(_0x5ee51c){logger[_0xa96a('0x3a')](_0xa96a('0x5b'),_0x46a4fa[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x5ee51c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')]['syncAgentComplete']=function(_0x1521f9){try{if(this[_0xa96a('0x23')](_0x1521f9)){logger[_0xa96a('0x27')](_0xa96a('0x5c'),_0x1521f9[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x1521f9,{'showHidden':![],'depth':null}));if(this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]]){for(var _0x567728 in this['channels'][_0x1521f9[_0xa96a('0x26')]]){if(this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0xa96a('0x57')](_0x567728)){if(this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x3f')]&&!this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x17')]){logger[_0xa96a('0x3d')](_0xa96a('0x5d'),_0x1521f9[_0xa96a('0x26')],this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x38')],_0x567728);this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x17')]=!![];this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x44')]='complete';this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728]['reason']=_0x1521f9[_0xa96a('0x4f')]==_0xa96a('0x5f')?_0xa96a('0x60'):_0x1521f9[_0xa96a('0x4f')];this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x61')]=_0x1521f9['talktime'];if(this[_0xa96a('0xc')][_0x1521f9[_0xa96a('0x2c')]]&&this['voiceQueues'][_0x1521f9['queue']][_0xa96a('0x62')]){this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728]['acwtime']=this[_0xa96a('0xc')][_0x1521f9[_0xa96a('0x2c')]][_0xa96a('0x63')];this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728][_0xa96a('0x64')]=!![];}this[_0xa96a('0xd')][_0x1521f9[_0xa96a('0x46')]]=_[_0xa96a('0x31')](this[_0xa96a('0xd')][_0x1521f9[_0xa96a('0x46')]],['queue',_0xa96a('0x47')]);logger[_0xa96a('0x27')](_0xa96a('0x65'),_0x1521f9[_0xa96a('0x26')],util['inspect'](this['channels'][_0x1521f9[_0xa96a('0x26')]][_0x567728],{'showHidden':![],'depth':null}));ami[_0xa96a('0x21')](_0xa96a('0x66'),this[_0xa96a('0xa')][_0x1521f9['uniqueid']][_0x567728]);logger[_0xa96a('0x27')](_0xa96a('0x67'),_0x1521f9['uniqueid'],util[_0xa96a('0x29')](this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728],{'showHidden':![],'depth':null}));this[_0xa96a('0x21')](util['format'](_0xa96a('0x37'),_0x1521f9[_0xa96a('0x38')]),_0xa96a('0x68'),this[_0xa96a('0xa')][_0x1521f9[_0xa96a('0x26')]][_0x567728]);}}}}}}catch(_0x25dc9b){logger[_0xa96a('0x3a')](_0xa96a('0x69'),_0x1521f9[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x25dc9b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa96a('0x1a')]=function(_0x1445a2){try{if(this['isNotNull'](_0x1445a2)){logger[_0xa96a('0x27')](_0xa96a('0x6a'),_0x1445a2['uniqueid'],util[_0xa96a('0x29')](_0x1445a2,{'showHidden':![],'depth':null}));this['addVariable'](_0x1445a2[_0xa96a('0x26')],_['keys'](_0x1445a2[_0xa96a('0x6b')])[0x0],_0x1445a2[_0xa96a('0x6c')]);if(this[_0xa96a('0xa')][_0x1445a2['uniqueid']]){for(var _0x2ed319 in this[_0xa96a('0xa')][_0x1445a2[_0xa96a('0x26')]]){if(this[_0xa96a('0xa')][_0x1445a2[_0xa96a('0x26')]]['hasOwnProperty'](_0x2ed319)){logger[_0xa96a('0x3d')](_0xa96a('0x6d'),_0x1445a2['uniqueid'],_0x2ed319,_[_0xa96a('0x6e')](_0x1445a2[_0xa96a('0x6b')])[0x0],_0x1445a2[_0xa96a('0x6c')]);if(_['isUndefined'](this[_0xa96a('0xa')][_0x1445a2[_0xa96a('0x26')]][_0x2ed319][_0xa96a('0xe')])){this['channels'][_0x1445a2['uniqueid']][_0x2ed319]['variables']={};}this[_0xa96a('0xa')][_0x1445a2[_0xa96a('0x26')]][_0x2ed319][_0xa96a('0xe')]=this[_0xa96a('0xe')][_0x1445a2[_0xa96a('0x26')]];}}}}}catch(_0x3c4002){logger[_0xa96a('0x3a')]('[%s][voiceAgentReport][varset]',_0x1445a2[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x3c4002,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x6f')]=function(_0x20acc0,_0x4dfac9,_0x57d0de){var _0x4acc09=[_0xa96a('0x70'),_0xa96a('0x71'),_0xa96a('0x72'),_0xa96a('0x73'),'rtpaudioqosloss',_0xa96a('0x74'),_0xa96a('0x75'),_0xa96a('0x76'),_0xa96a('0x77'),_0xa96a('0x78'),'bridgepeer',_0xa96a('0x79'),'membercalls',_0xa96a('0x7a'),'memberinterface',_0xa96a('0x7b'),_0xa96a('0x38'),_0xa96a('0x7c'),_0xa96a('0x7d')];if(!_[_0xa96a('0x7e')](_0x4dfac9)&&!_[_0xa96a('0x7f')](_0x4acc09,_0x4dfac9)){if(_[_0xa96a('0x24')](this['variables'][_0x20acc0])){this['variables'][_0x20acc0]={};}this['variables'][_0x20acc0][_0x4dfac9]=_0x57d0de;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x4dec34){try{if(this[_0xa96a('0x23')](_0x4dec34)){logger[_0xa96a('0x27')](_0xa96a('0x80'),_0x4dec34['uniqueid'],util[_0xa96a('0x29')](_0x4dec34,{'showHidden':![],'depth':null}));if(this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]]){for(var _0x4f4ff4 in this[_0xa96a('0xa')][_0x4dec34['uniqueid']]){if(this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]][_0xa96a('0x57')](_0x4f4ff4)){if(this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]][_0x4f4ff4][_0xa96a('0x4f')]==_0xa96a('0x5f')&&this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]][_0x4f4ff4][_0xa96a('0x17')]){logger[_0xa96a('0x3d')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4dec34[_0xa96a('0x26')],_0x4f4ff4);this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]][_0x4f4ff4][_0xa96a('0x5e')]=moment()[_0xa96a('0x36')](_0xa96a('0x2b'));}}}logger['debug'](_0xa96a('0x81'),_0x4dec34[_0xa96a('0x26')],util[_0xa96a('0x29')](_[_0xa96a('0x82')](this['channels'][_0x4dec34['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xa96a('0x21')](_0xa96a('0x83'),_[_0xa96a('0x82')](this[_0xa96a('0xa')][_0x4dec34[_0xa96a('0x26')]]));delete this['channels'][_0x4dec34[_0xa96a('0x26')]];}if(this['variables'][_0x4dec34[_0xa96a('0x26')]]){delete this[_0xa96a('0xe')][_0x4dec34[_0xa96a('0x26')]];}}}catch(_0x402f35){logger[_0xa96a('0x3a')](_0xa96a('0x84'),_0x4dec34['uniqueid'],util[_0xa96a('0x29')](_0x402f35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x1f')]=function(_0x49ee49){try{if(this['isNotNull'](_0x49ee49)){logger[_0xa96a('0x27')](_0xa96a('0x85'),_0x49ee49[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x49ee49,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ee49['transfereeuniqueid']]){for(var _0x57866a in this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]]){if(this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]][_0xa96a('0x57')](_0x57866a)){if(_0x49ee49[_0xa96a('0x87')]===_0x57866a){logger['info'](_0xa96a('0x88'),_0x49ee49[_0xa96a('0x26')],this['channels'][_0x49ee49[_0xa96a('0x86')]][_0x57866a][_0xa96a('0x38')],_0x57866a);var _0xb897d5=moment();this['channels'][_0x49ee49[_0xa96a('0x86')]][_0x57866a]['agentcomplete']=!![];this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]][_0x57866a]['agentcompleteAt']=moment()[_0xa96a('0x36')](_0xa96a('0x2b'));this['channels'][_0x49ee49[_0xa96a('0x86')]][_0x57866a][_0xa96a('0x44')]=_0xa96a('0x89');this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]][_0x57866a]['reason']=_0xa96a('0x5f');this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]][_0x57866a]['talktime']=_0xb897d5['diff'](this['channels'][_0x49ee49[_0xa96a('0x86')]][_0x57866a][_0xa96a('0x3f')],_0xa96a('0x8a'));}}}}if(this['channels'][_0x49ee49[_0xa96a('0x8b')]]){var _0x312562=this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x8b')]];this['channels'][_0x49ee49[_0xa96a('0x8b')]]=this[_0xa96a('0xa')][_0x49ee49[_0xa96a('0x86')]];this['channels'][_0x49ee49[_0xa96a('0x86')]]=_0x312562;}}}catch(_0x594f7b){logger[_0xa96a('0x3a')](_0xa96a('0x8c'),_0x49ee49['uniqueid'],util[_0xa96a('0x29')](_0x594f7b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa96a('0x20')]=function(_0x3b153c){try{if(this[_0xa96a('0x23')](_0x3b153c)){logger[_0xa96a('0x27')](_0xa96a('0x8d'),_0x3b153c[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x3b153c,{'showHidden':![],'depth':null}));if(this['channels'][_0x3b153c[_0xa96a('0x86')]]){for(var _0x439f41 in this[_0xa96a('0xa')][_0x3b153c['transfereeuniqueid']]){if(this[_0xa96a('0xa')][_0x3b153c[_0xa96a('0x86')]]['hasOwnProperty'](_0x439f41)){if(_0x3b153c[_0xa96a('0x8e')]===_0x439f41){logger['info'](_0xa96a('0x8f'),_0x3b153c[_0xa96a('0x26')],this[_0xa96a('0xa')][_0x3b153c['transfereeuniqueid']][_0x439f41][_0xa96a('0x38')],_0x439f41);var _0x206a65=moment();this['channels'][_0x3b153c[_0xa96a('0x86')]][_0x439f41][_0xa96a('0x17')]=!![];this[_0xa96a('0xa')][_0x3b153c['transfereeuniqueid']][_0x439f41][_0xa96a('0x5e')]=_0x206a65;this['channels'][_0x3b153c[_0xa96a('0x86')]][_0x439f41][_0xa96a('0x44')]=_0xa96a('0x89');this[_0xa96a('0xa')][_0x3b153c[_0xa96a('0x86')]][_0x439f41][_0xa96a('0x4f')]=_0xa96a('0x5f');this['channels'][_0x3b153c['transfereeuniqueid']][_0x439f41][_0xa96a('0x61')]=_0x206a65[_0xa96a('0x90')](this[_0xa96a('0xa')][_0x3b153c[_0xa96a('0x86')]][_0x439f41]['agentconnectAt'],_0xa96a('0x8a'));}}}}}}catch(_0x1f8f71){logger[_0xa96a('0x3a')]('[%s][voiceAgentReport][blindtransfer]',_0x3b153c['uniqueid'],util[_0xa96a('0x29')](_0x1f8f71,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x1b')]=function(_0x27c910){var _0x425a4d='';try{if(this[_0xa96a('0x23')](_0x27c910)){logger['debug'](_0xa96a('0x91'),_0x27c910['uniqueid'],util[_0xa96a('0x29')](_0x27c910,{'showHidden':![],'depth':null}));if(_0x27c910[_0xa96a('0x92')]){_0x425a4d=_0x27c910[_0xa96a('0x92')][_0xa96a('0x93')](0x0,_0x27c910[_0xa96a('0x92')][_0xa96a('0x94')]('-'));if(this[_0xa96a('0xd')][_0x425a4d]){logger[_0xa96a('0x3d')](_0xa96a('0x95'),_0x27c910[_0xa96a('0x26')],_0x425a4d);this['agents'][_0x425a4d][_0xa96a('0x96')]=!![];}}}}catch(_0x1686e7){logger[_0xa96a('0x3a')](_0xa96a('0x97'),_0x27c910[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x1686e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa96a('0x22')][_0xa96a('0x1d')]=function(_0x53b527){var _0x2cf1b5='';try{if(this[_0xa96a('0x23')](_0x53b527)){logger[_0xa96a('0x27')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x53b527['uniqueid'],util['inspect'](_0x53b527,{'showHidden':![],'depth':null}));if(_0x53b527[_0xa96a('0x92')]){_0x2cf1b5=_0x53b527['channel'][_0xa96a('0x93')](0x0,_0x53b527[_0xa96a('0x92')][_0xa96a('0x94')]('-'));if(this[_0xa96a('0xd')][_0x2cf1b5]){logger['info'](_0xa96a('0x98'),_0x53b527[_0xa96a('0x26')],_0x2cf1b5);this[_0xa96a('0xd')][_0x2cf1b5]['onhold']=![];}}}}catch(_0x4747b0){logger['error'](_0xa96a('0x99'),_0x53b527[_0xa96a('0x26')],util[_0xa96a('0x29')](_0x4747b0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x67cc=['custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','prototype','emit','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:'];(function(_0x4b6fdf,_0x565ee8){var _0x369d07=function(_0x187398){while(--_0x187398){_0x4b6fdf['push'](_0x4b6fdf['shift']());}};_0x369d07(++_0x565ee8);}(_0x67cc,0xd2));var _0xc67c=function(_0x340f77,_0x8d1b86){_0x340f77=_0x340f77-0x0;var _0x5e82a0=_0x67cc[_0x340f77];return _0x5e82a0;};'use strict';var _=require(_0xc67c('0x0'));var moment=require('moment');var util=require(_0xc67c('0x1'));var Redis=require(_0xc67c('0x2'));var config=require(_0xc67c('0x3'));var logger=require(_0xc67c('0x4'))(_0xc67c('0x5'));var ami=require(_0xc67c('0x6'));config[_0xc67c('0x7')]=_[_0xc67c('0x8')](config[_0xc67c('0x7')],{'host':_0xc67c('0x9'),'port':0x18eb});var io=require(_0xc67c('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x3ee5d8){this['channels']={};this['voiceChannels']=_0x3ee5d8[_0xc67c('0xb')];this[_0xc67c('0xc')]=_0x3ee5d8[_0xc67c('0xc')];this[_0xc67c('0xd')]=_0x3ee5d8[_0xc67c('0xd')];this[_0xc67c('0xe')]={};ami['on'](_0xc67c('0xf'),this[_0xc67c('0x10')]['bind'](this));ami['on'](_0xc67c('0x11'),this[_0xc67c('0x12')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x14'),this[_0xc67c('0x15')]['bind'](this));ami['on'](_0xc67c('0x16'),this[_0xc67c('0x17')][_0xc67c('0x13')](this));ami['on']('agentcomplete',this[_0xc67c('0x18')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x19'),this[_0xc67c('0x1a')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1b'),this[_0xc67c('0x1c')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1d'),this[_0xc67c('0x1e')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1f'),this[_0xc67c('0x20')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x21'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x23')]=function(_0x451381,_0x51e73c,_0x37fc5a){io['to'](_0x451381)[_0xc67c('0x23')](_0x51e73c,_0x37fc5a);};VoiceAgentReport[_0xc67c('0x22')]['isNotNull']=function(_0x1982f7){return _0x1982f7!==null&&!_['isUndefined'](_0x1982f7);};VoiceAgentReport['prototype'][_0xc67c('0x10')]=function(_0x11ef53){try{if(this['isNotNull'](_0x11ef53)){logger[_0xc67c('0x24')](_0xc67c('0x25'),_0x11ef53[_0xc67c('0x26')],_0x11ef53[_0xc67c('0x27')],_0x11ef53[_0xc67c('0x28')]);logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x11ef53,{'showHidden':![],'depth':null}));if(_[_0xc67c('0x2b')](this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]])){this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]]={};}if(_[_0xc67c('0x2b')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']])){this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]]={'agentcalledAt':moment()[_0xc67c('0x2c')](_0xc67c('0x2d')),'lastevent':'called','mandatoryDisposition':this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]]?this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]]['mandatoryDisposition']||![]:![],'type':this[_0xc67c('0xc')][_0x11ef53['queue']]?this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]][_0xc67c('0x2f')]||_0xc67c('0x30'):'inbound','variables':this['variables'][_0x11ef53[_0xc67c('0x26')]],'motionChannel':_0xc67c('0x31')};}_[_0xc67c('0x32')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]],_[_0xc67c('0x33')](_0x11ef53,[_0xc67c('0x34'),_0xc67c('0x35')]));logger[_0xc67c('0x29')](_0xc67c('0x36'),_0x11ef53[_0xc67c('0x26')],util['inspect'](this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x37'),this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']]);logger[_0xc67c('0x29')](_0xc67c('0x38'),_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x11ef53[_0xc67c('0x27')]),_0xc67c('0x3a'),this['channels'][_0x11ef53['uniqueid']][_0x11ef53['destuniqueid']]);}}catch(_0x4ca4b0){logger[_0xc67c('0x3b')]('[%s][voiceAgentReport][agentcalled]',_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4ca4b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x12')]=function(_0x349423){try{if(this[_0xc67c('0x3c')](_0x349423)){if(this[_0xc67c('0xb')][_0x349423['uniqueid']]){logger[_0xc67c('0x29')](_0xc67c('0x3d'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x349423,{'showHidden':![],'depth':null}));for(var _0x45e4f7 in this['channels'][_0x349423['uniqueid']]){if(this[_0xc67c('0xb')][_0x349423['uniqueid']][_0xc67c('0x3e')](_0x45e4f7)){if(_0x349423[_0xc67c('0x28')]===_0x45e4f7){logger[_0xc67c('0x24')](_0xc67c('0x3f'),_0x349423[_0xc67c('0x26')],_0x349423['membername'],_0x349423['destuniqueid']);this['channels'][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x40')]=moment()['format'](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x41')]=_0x349423[_0xc67c('0x41')];this['channels'][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x42')]=_0x349423[_0xc67c('0x42')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x43')]=_0x349423[_0xc67c('0x43')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x44')]=_0x349423[_0xc67c('0x44')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x45')]=_0x349423[_0xc67c('0x45')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['lastevent']=_0xc67c('0x46');if(this[_0xc67c('0x47')][this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['uniqueid']]){var _0x81866a=this['voiceChannels'][this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x26')]][_0xc67c('0x48')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x48')]=_0x81866a;_0x349423[_0xc67c('0x48')]=_0x81866a;}_[_0xc67c('0x32')](this[_0xc67c('0xd')][_0x349423['interface']],_['pick'](_0x349423,['queue',_0xc67c('0x49'),_0xc67c('0x48')]));logger[_0xc67c('0x29')](_0xc67c('0x4a'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')]('custom:agentconnect',this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]]);logger['debug'](_0xc67c('0x4b'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x349423['membername']),_0xc67c('0x4c'),this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]]);}else if(!this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x14')]&&!this['channels'][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x4d')]){logger[_0xc67c('0x24')](_0xc67c('0x4e'),_0x349423[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x27')],_0x45e4f7);this['channels'][_0x349423['uniqueid']][_0x45e4f7]['agentringnoanswer']=!![];this['channels'][_0x349423['uniqueid']][_0x45e4f7]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x4f')]=_0x349423[_0xc67c('0x28')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x50')]=_0x349423[_0xc67c('0x27')];this['channels'][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x51')]=_0xc67c('0x52');this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['reason']=_0xc67c('0x52');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x349423['uniqueid'],util['inspect'](this['channels'][_0x349423['uniqueid']][_0x45e4f7],{'showHidden':![],'depth':null}));ami['emit'](_0xc67c('0x53'),this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]);}}}}}}catch(_0x401a54){logger[_0xc67c('0x3b')](_0xc67c('0x54'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x401a54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x15')]=function(_0x30ee16){try{if(this[_0xc67c('0x3c')](_0x30ee16)){logger[_0xc67c('0x29')](_0xc67c('0x55'),_0x30ee16[_0xc67c('0x26')],util['inspect'](_0x30ee16,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]]&&this['channels'][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]){logger['info'](_0xc67c('0x56'),_0x30ee16[_0xc67c('0x26')],_0x30ee16['membername'],_0x30ee16['destuniqueid']);this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]][_0xc67c('0x14')]=!![];this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x30ee16['uniqueid']][_0x30ee16[_0xc67c('0x28')]]['lastevent']=_0xc67c('0x57');this['channels'][_0x30ee16['uniqueid']][_0x30ee16['destuniqueid']][_0xc67c('0x58')]=_0xc67c('0x57');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x30ee16[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]);}}}catch(_0x58a815){logger['error'](_0xc67c('0x59'),_0x30ee16[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x58a815,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x17')]=function(_0x40ac8d){try{if(this[_0xc67c('0x3c')](_0x40ac8d)){logger['debug'](_0xc67c('0x5a'),_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x40ac8d,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x40ac8d['uniqueid']]){for(var _0x3ef7cb in this[_0xc67c('0xb')][_0x40ac8d['uniqueid']]){if(this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0xc67c('0x3e')](_0x3ef7cb)&&!this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['agentringnoanswer']&&!this['channels'][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb][_0xc67c('0x4d')]){logger[_0xc67c('0x24')](_0xc67c('0x5b'),_0x40ac8d[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['membername'],_0x3ef7cb);this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['agentringnoanswer']=!![];this[_0xc67c('0xb')][_0x40ac8d['uniqueid']][_0x3ef7cb]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this['channels'][_0x40ac8d['uniqueid']][_0x3ef7cb][_0xc67c('0x51')]='abandoned';this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['reason']=_0xc67c('0x5c');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb],{'showHidden':![],'depth':null}));ami['emit'](_0xc67c('0x5d'),this[_0xc67c('0xb')][_0x40ac8d['uniqueid']][_0x3ef7cb]);}}}}}catch(_0x4dba9a){logger[_0xc67c('0x3b')](_0xc67c('0x5e'),_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4dba9a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x18')]=function(_0x3967fe){try{if(this['isNotNull'](_0x3967fe)){logger[_0xc67c('0x29')](_0xc67c('0x5f'),_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x3967fe,{'showHidden':![],'depth':null}));if(this['channels'][_0x3967fe[_0xc67c('0x26')]]){for(var _0x56278b in this['channels'][_0x3967fe[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]]['hasOwnProperty'](_0x56278b)){if(this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentconnectAt']&&!this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentcomplete']){logger['info'](_0xc67c('0x60'),_0x3967fe[_0xc67c('0x26')],this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['membername'],_0x56278b);this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentcomplete']=!![];this['channels'][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x61')]=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x51')]=_0xc67c('0x62');this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x58')]=_0x3967fe[_0xc67c('0x58')]==_0xc67c('0x63')?_0xc67c('0x64'):_0x3967fe[_0xc67c('0x58')];this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x65')]=_0x3967fe[_0xc67c('0x65')];if(this[_0xc67c('0xc')][_0x3967fe[_0xc67c('0x2e')]]&&this['voiceQueues'][_0x3967fe[_0xc67c('0x2e')]][_0xc67c('0x66')]){this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x67')]=this['voiceQueues'][_0x3967fe[_0xc67c('0x2e')]][_0xc67c('0x68')];this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x69')]=!![];}this['agents'][_0x3967fe[_0xc67c('0x6a')]]=_[_0xc67c('0x33')](this[_0xc67c('0xd')][_0x3967fe[_0xc67c('0x6a')]],[_0xc67c('0x2e'),_0xc67c('0x49')]);logger['debug'](_0xc67c('0x6b'),_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x6c'),this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]);logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x3967fe[_0xc67c('0x27')]),_0xc67c('0x6d'),this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b]);}}}}}}catch(_0x30bc2e){logger[_0xc67c('0x3b')](_0xc67c('0x6e'),_0x3967fe[_0xc67c('0x26')],util['inspect'](_0x30bc2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x1a')]=function(_0x10589d){try{if(this[_0xc67c('0x3c')](_0x10589d)){logger[_0xc67c('0x29')]('[%s][voiceAgentReport][varset]\x20event:',_0x10589d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x10589d,{'showHidden':![],'depth':null}));this[_0xc67c('0x6f')](_0x10589d[_0xc67c('0x26')],_[_0xc67c('0x70')](_0x10589d[_0xc67c('0x71')])[0x0],_0x10589d['value']);if(this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]){for(var _0x528b95 in this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]['hasOwnProperty'](_0x528b95)){logger[_0xc67c('0x24')](_0xc67c('0x72'),_0x10589d['uniqueid'],_0x528b95,_[_0xc67c('0x70')](_0x10589d['variable'])[0x0],_0x10589d[_0xc67c('0x73')]);if(_[_0xc67c('0x2b')](this[_0xc67c('0xb')][_0x10589d['uniqueid']][_0x528b95][_0xc67c('0xe')])){this[_0xc67c('0xb')][_0x10589d['uniqueid']][_0x528b95]['variables']={};}this['channels'][_0x10589d[_0xc67c('0x26')]][_0x528b95]['variables']=this[_0xc67c('0xe')][_0x10589d[_0xc67c('0x26')]];}}}}}catch(_0x5420c9){logger[_0xc67c('0x3b')](_0xc67c('0x74'),_0x10589d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x5420c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x6f')]=function(_0x56f579,_0x47d4e1,_0x588454){var _0x4d6af9=[_0xc67c('0x75'),_0xc67c('0x76'),'rtpaudioqosjitter',_0xc67c('0x77'),_0xc67c('0x78'),'rtpaudioqoslossbridged',_0xc67c('0x79'),_0xc67c('0x7a'),_0xc67c('0x7b'),_0xc67c('0x7c'),_0xc67c('0x7d'),_0xc67c('0x7e'),_0xc67c('0x7f'),'memberdynamic',_0xc67c('0x80'),'memberlastcall',_0xc67c('0x27'),_0xc67c('0x81'),_0xc67c('0x82')];if(!_[_0xc67c('0x83')](_0x47d4e1)&&!_[_0xc67c('0x84')](_0x4d6af9,_0x47d4e1)){if(_['isUndefined'](this[_0xc67c('0xe')][_0x56f579])){this[_0xc67c('0xe')][_0x56f579]={};}this[_0xc67c('0xe')][_0x56f579][_0x47d4e1]=_0x588454;}};VoiceAgentReport[_0xc67c('0x22')]['syncHangup']=function(_0x455123){try{if(this['isNotNull'](_0x455123)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x455123[_0xc67c('0x26')],util['inspect'](_0x455123,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]]){for(var _0x131242 in this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x455123['uniqueid']][_0xc67c('0x3e')](_0x131242)){if(this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]][_0x131242][_0xc67c('0x58')]==_0xc67c('0x63')&&this['channels'][_0x455123[_0xc67c('0x26')]][_0x131242][_0xc67c('0x4d')]){logger['info'](_0xc67c('0x85'),_0x455123[_0xc67c('0x26')],_0x131242);this['channels'][_0x455123[_0xc67c('0x26')]][_0x131242]['agentcompleteAt']=moment()[_0xc67c('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xc67c('0x29')](_0xc67c('0x86'),_0x455123[_0xc67c('0x26')],util['inspect'](_[_0xc67c('0x87')](this['channels'][_0x455123[_0xc67c('0x26')]]),{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x88'),_[_0xc67c('0x87')](this['channels'][_0x455123[_0xc67c('0x26')]]));delete this['channels'][_0x455123[_0xc67c('0x26')]];}if(this[_0xc67c('0xe')][_0x455123[_0xc67c('0x26')]]){delete this[_0xc67c('0xe')][_0x455123[_0xc67c('0x26')]];}}}catch(_0x56547a){logger['error'](_0xc67c('0x89'),_0x455123[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x56547a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x8a')]=function(_0xfb4267){try{if(this[_0xc67c('0x3c')](_0xfb4267)){logger[_0xc67c('0x29')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xfb4267[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0xfb4267,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]]){for(var _0xa2aba2 in this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']]){if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]]['hasOwnProperty'](_0xa2aba2)){if(_0xfb4267[_0xc67c('0x8c')]===_0xa2aba2){logger[_0xc67c('0x24')](_0xc67c('0x8d'),_0xfb4267[_0xc67c('0x26')],this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']][_0xa2aba2][_0xc67c('0x27')],_0xa2aba2);var _0x46c8e1=moment();this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x4d')]=!![];this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']][_0xa2aba2]['agentcompleteAt']=moment()[_0xc67c('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x51')]='complete';this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x58')]='transfer';this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x65')]=_0x46c8e1[_0xc67c('0x8e')](this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x40')],_0xc67c('0x8f'));}}}}if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x90')]]){var _0x9995af=this['channels'][_0xfb4267[_0xc67c('0x90')]];this['channels'][_0xfb4267[_0xc67c('0x90')]]=this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]];this['channels'][_0xfb4267[_0xc67c('0x8b')]]=_0x9995af;}}}catch(_0x2af758){logger[_0xc67c('0x3b')]('[%s][voiceAgentReport][attendedtransfer]',_0xfb4267[_0xc67c('0x26')],util['inspect'](_0x2af758,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc67c('0x91')]=function(_0x41c61a){try{if(this[_0xc67c('0x3c')](_0x41c61a)){logger[_0xc67c('0x29')](_0xc67c('0x92'),_0x41c61a[_0xc67c('0x26')],util['inspect'](_0x41c61a,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]]){for(var _0x2f7848 in this[_0xc67c('0xb')][_0x41c61a['transfereeuniqueid']]){if(this[_0xc67c('0xb')][_0x41c61a['transfereeuniqueid']][_0xc67c('0x3e')](_0x2f7848)){if(_0x41c61a[_0xc67c('0x93')]===_0x2f7848){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41c61a[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x27')],_0x2f7848);var _0x44034f=moment();this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x4d')]=!![];this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848]['agentcompleteAt']=_0x44034f;this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x51')]='complete';this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848]['reason']=_0xc67c('0x63');this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x65')]=_0x44034f[_0xc67c('0x8e')](this['channels'][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x40')],_0xc67c('0x8f'));}}}}}}catch(_0x251ca0){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x41c61a[_0xc67c('0x26')],util['inspect'](_0x251ca0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0xec9d44){var _0x38d78f='';try{if(this[_0xc67c('0x3c')](_0xec9d44)){logger[_0xc67c('0x29')](_0xc67c('0x94'),_0xec9d44[_0xc67c('0x26')],util['inspect'](_0xec9d44,{'showHidden':![],'depth':null}));if(_0xec9d44['channel']){_0x38d78f=_0xec9d44[_0xc67c('0x95')][_0xc67c('0x96')](0x0,_0xec9d44[_0xc67c('0x95')]['lastIndexOf']('-'));if(this[_0xc67c('0xd')][_0x38d78f]){logger[_0xc67c('0x24')](_0xc67c('0x97'),_0xec9d44['uniqueid'],_0x38d78f);this[_0xc67c('0xd')][_0x38d78f][_0xc67c('0x98')]=!![];}}}}catch(_0x1b81e2){logger['error'](_0xc67c('0x99'),_0xec9d44[_0xc67c('0x26')],util['inspect'](_0x1b81e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')]['syncMusicOnHoldStop']=function(_0x4d292d){var _0x85169d='';try{if(this[_0xc67c('0x3c')](_0x4d292d)){logger[_0xc67c('0x29')](_0xc67c('0x9a'),_0x4d292d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4d292d,{'showHidden':![],'depth':null}));if(_0x4d292d[_0xc67c('0x95')]){_0x85169d=_0x4d292d[_0xc67c('0x95')][_0xc67c('0x96')](0x0,_0x4d292d[_0xc67c('0x95')][_0xc67c('0x9b')]('-'));if(this[_0xc67c('0xd')][_0x85169d]){logger[_0xc67c('0x24')](_0xc67c('0x9c'),_0x4d292d[_0xc67c('0x26')],_0x85169d);this['agents'][_0x85169d][_0xc67c('0x98')]=![];}}}}catch(_0xe02adf){logger[_0xc67c('0x3b')](_0xc67c('0x9d'),_0x4d292d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0xe02adf,{'showHidden':![],'depth':null}));}};module[_0xc67c('0x9e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 46b128b..5651da0 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb71c=['isUndefined','emit','syncNewCallerId','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','pick','keys','context','channel','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','accountcode','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','exten','user:agentconnect','[%s][voiceCallReport][newchannel]','syncNewExten','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','includes','lastapplication','lastdata','cdr(','match','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','seconds','connectedlinename','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','push','rec','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','then','isEmpty','monitors','getSettings','StopMixMonitor','catch','Action','destinationchannel','finally','webbar:stopmonitors','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','util','ioredis','../../../config/environment','../model/channel','inuse','busy','invalid','unavailable','ringing','ringinuse','set','queue','agi','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull'];(function(_0x4ec156,_0x23bc92){var _0x407222=function(_0x213bb7){while(--_0x213bb7){_0x4ec156['push'](_0x4ec156['shift']());}};_0x407222(++_0x23bc92);}(_0xb71c,0x9b));var _0xcb71=function(_0x346754,_0x56c422){_0x346754=_0x346754-0x0;var _0x11069a=_0xb71c[_0x346754];return _0x11069a;};'use strict';var BPromise=require(_0xcb71('0x0'));var _=require(_0xcb71('0x1'));var moment=require(_0xcb71('0x2'));var util=require(_0xcb71('0x3'));var path=require('path');var Redis=require(_0xcb71('0x4'));var config=require(_0xcb71('0x5'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var Channel=require(_0xcb71('0x6'));var RpcSetting=require('../rpc/setting');var statusDesc=['unknown','not_inuse',_0xcb71('0x7'),_0xcb71('0x8'),_0xcb71('0x9'),_0xcb71('0xa'),_0xcb71('0xb'),_0xcb71('0xc'),'onhold'];var applications=[_0xcb71('0xd'),_0xcb71('0xe'),_0xcb71('0xf'),'dial','playback','voicemail'];var dispositions=[_0xcb71('0x10'),'FAILED',_0xcb71('0x11'),_0xcb71('0x10'),_0xcb71('0x10'),_0xcb71('0x10'),_0xcb71('0x12'),_0xcb71('0x13'),'FAILED',_0xcb71('0x11'),_0xcb71('0x11')];var actions={};config[_0xcb71('0x14')]=_['defaults'](config[_0xcb71('0x14')],{'host':_0xcb71('0x15'),'port':0x18eb});var io=require(_0xcb71('0x16'))(new Redis(config[_0xcb71('0x14')]));function VoiceCallReport(_0x530365){this[_0xcb71('0x17')]=_0x530365[_0xcb71('0x17')];this[_0xcb71('0x18')]=_0x530365[_0xcb71('0x18')];this[_0xcb71('0x19')]={};ami['on'](_0xcb71('0x1a'),this['syncNewExten'][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x1c'),this['syncNewExten'][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x1d'),this[_0xcb71('0x1e')][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x1f'),this['syncNewState'][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x20'),this[_0xcb71('0x21')]['bind'](this));ami['on']('hangup',this[_0xcb71('0x22')][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x23'),this['syncNewCallerId'][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x24'),this[_0xcb71('0x25')][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x26'),this[_0xcb71('0x27')][_0xcb71('0x1b')](this));ami['on'](_0xcb71('0x28'),this[_0xcb71('0x29')]['bind'](this));ami['on'](_0xcb71('0x2a'),this[_0xcb71('0x2b')][_0xcb71('0x1b')](this));try{logger['info'](_0xcb71('0x2c'));ami['actionCoreShowChannels']();}catch(_0x181b2b){logger[_0xcb71('0x2d')](_0xcb71('0x2e'),util[_0xcb71('0x2f')](_0x181b2b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x31')]=function(_0xb5d494){return _0xb5d494!==null&&!_[_0xcb71('0x32')](_0xb5d494);};VoiceCallReport['prototype'][_0xcb71('0x33')]=function(_0x5b1b61,_0x26a2ec,_0x3769ef){io['to'](_0x5b1b61)[_0xcb71('0x33')](_0x26a2ec,_0x3769ef);};VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x34')]=function(_0x5897fe){try{if(this[_0xcb71('0x31')](_0x5897fe)){logger[_0xcb71('0x35')](_0xcb71('0x36'),_0x5897fe[_0xcb71('0x37')],_0x5897fe['calleridname'],_0x5897fe[_0xcb71('0x38')]);logger['debug'](_0xcb71('0x39'),_0x5897fe[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x5897fe,{'showHidden':![],'depth':null}));if(_0x5897fe[_0xcb71('0x37')]===_0x5897fe['linkedid']){if(!_[_0xcb71('0x32')](this[_0xcb71('0x17')][_0x5897fe['uniqueid']])){_['merge'](this['channels'][_0x5897fe[_0xcb71('0x37')]],_[_0xcb71('0x3a')](_0x5897fe,_[_0xcb71('0x3b')](this['channels'][_0x5897fe[_0xcb71('0x37')]])));}}if(_0x5897fe[_0xcb71('0x3c')]==='from-sip'){if(this['agents'][_0x5897fe[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){if(_0x5897fe['exten']==_0xcb71('0x3f')){this['agents'][_0x5897fe['channel'][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x40')]=_0x5897fe[_0xcb71('0x41')];this[_0xcb71('0x33')](util[_0xcb71('0x42')](_0xcb71('0x43'),this[_0xcb71('0x18')][_0x5897fe['channel'][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x44')]),'user:agentconnect',{'destaccountcode':this[_0xcb71('0x18')][_0x5897fe['channel'][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x45')],'destconnectedlinenum':_0x5897fe[_0xcb71('0x41')]});}}}}}catch(_0x537646){logger[_0xcb71('0x2d')](_0xcb71('0x46'),_0x5897fe[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x537646,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x1e')]=function(_0x1f1cf2){try{if(this['isNotNull'](_0x1f1cf2)){logger[_0xcb71('0x47')](_0xcb71('0x48'),_0x1f1cf2['uniqueid'],util[_0xcb71('0x2f')](_0x1f1cf2,{'showHidden':![],'depth':null}));if(_0x1f1cf2['uniqueid']===_0x1f1cf2[_0xcb71('0x49')]&&_0x1f1cf2[_0xcb71('0x3d')]!=_0xcb71('0x4a')){if(_[_0xcb71('0x32')](this['channels'][_0x1f1cf2[_0xcb71('0x37')]])){logger[_0xcb71('0x35')](_0xcb71('0x4b'),_0x1f1cf2[_0xcb71('0x37')],_0x1f1cf2['context'],_0x1f1cf2['exten']);this[_0xcb71('0x17')][_0x1f1cf2[_0xcb71('0x37')]]=new Channel();this[_0xcb71('0x17')][_0x1f1cf2['uniqueid']][_0xcb71('0x4c')]=moment()['format'](_0xcb71('0x4d'));this[_0xcb71('0x17')][_0x1f1cf2[_0xcb71('0x37')]][_0xcb71('0x4e')]=dispositions[_[_0xcb71('0x4f')](_0x1f1cf2[_0xcb71('0x50')])];_[_0xcb71('0x51')](this['channels'][_0x1f1cf2[_0xcb71('0x37')]],_[_0xcb71('0x3a')](_0x1f1cf2,_['keys'](this['channels'][_0x1f1cf2['uniqueid']])));if(_0x1f1cf2[_0xcb71('0x3c')]===_0xcb71('0x52')){if(this[_0xcb71('0x18')][_0x1f1cf2[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){if(_[_0xcb71('0x32')](this['agents'][_0x1f1cf2[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x40')])){this[_0xcb71('0x18')][_0x1f1cf2['channel'][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x40')]=_0x1f1cf2['exten'];logger[_0xcb71('0x47')](_0xcb71('0x53'),_0x1f1cf2[_0xcb71('0x37')],util['inspect']({'destaccountcode':this[_0xcb71('0x18')][_0x1f1cf2['channel']['split']('-')[0x0]][_0xcb71('0x45')],'destconnectedlinenum':_0x1f1cf2[_0xcb71('0x54')]},{'showHidden':![],'depth':null}));this[_0xcb71('0x33')](util[_0xcb71('0x42')](_0xcb71('0x43'),this[_0xcb71('0x18')][_0x1f1cf2[_0xcb71('0x3d')]['split']('-')[0x0]][_0xcb71('0x44')]),_0xcb71('0x55'),{'destaccountcode':this[_0xcb71('0x18')][_0x1f1cf2[_0xcb71('0x3d')]['split']('-')[0x0]][_0xcb71('0x45')],'destconnectedlinenum':_0x1f1cf2[_0xcb71('0x54')]});}}}}}}}catch(_0x186265){logger[_0xcb71('0x2d')](_0xcb71('0x56'),_0x1f1cf2[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x186265,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x57')]=function(_0x3215ee){try{if(this[_0xcb71('0x31')](_0x3215ee)){logger['debug'](_0xcb71('0x58'),_0x3215ee[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x3215ee,{'showHidden':![],'depth':null}));if(_0x3215ee[_0xcb71('0x37')]===_0x3215ee[_0xcb71('0x49')]&&_0x3215ee[_0xcb71('0x54')]!='h'&&_0x3215ee[_0xcb71('0x3d')]!='OutgoingSpoolFailed'){_0x3215ee[_0xcb71('0x59')]=_0x3215ee['application'][_0xcb71('0x5a')]();_0x3215ee[_0xcb71('0x5b')]=_0x3215ee[_0xcb71('0x5c')]&&_0x3215ee['appdata'][_0xcb71('0x5d')](_0xcb71('0x5e'))?_0x3215ee['appdata']:(_0x3215ee['appdata']||_0x3215ee[_0xcb71('0x5b')])['toLowerCase']();logger[_0xcb71('0x35')](_0xcb71('0x5f'),_0x3215ee[_0xcb71('0x37')],_0x3215ee['application'],_0x3215ee[_0xcb71('0x5b')]);if(_[_0xcb71('0x32')](this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]])){this['channels'][_0x3215ee['uniqueid']]=new Channel();this['channels'][_0x3215ee[_0xcb71('0x37')]][_0xcb71('0x4c')]=_0x3215ee[_0xcb71('0x60')]?moment()[_0xcb71('0x61')](moment[_0xcb71('0x60')](_0x3215ee[_0xcb71('0x60')])['seconds'](),'seconds')[_0xcb71('0x42')](_0xcb71('0x4d')):moment()[_0xcb71('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]][_0xcb71('0x4e')]=_0xcb71('0x10');}_[_0xcb71('0x51')](this['channels'][_0x3215ee[_0xcb71('0x37')]],_[_0xcb71('0x3a')](_0x3215ee,_[_0xcb71('0x3b')](this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]])));if(_[_0xcb71('0x62')](applications,_0x3215ee[_0xcb71('0x59')])){this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]][_0xcb71('0x63')]=_0x3215ee[_0xcb71('0x59')];this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]][_0xcb71('0x64')]=_0x3215ee['applicationdata'];if(_0x3215ee[_0xcb71('0x59')]===_0xcb71('0xd')&&_[_0xcb71('0x5d')](_0x3215ee[_0xcb71('0x5b')]['toLowerCase'](),_0xcb71('0x65'))){var _0xbe1096=_0x3215ee[_0xcb71('0x5b')][_0xcb71('0x3e')]('=');var _0x217875=_0xbe1096[0x0][_0xcb71('0x5a')]()[_0xcb71('0x66')](/cdr\((.*)\)/);if(_0x217875){this['channels'][_0x3215ee[_0xcb71('0x37')]][_0x217875[0x1]]=_0xbe1096[0x1];}}else if(_0x3215ee[_0xcb71('0x59')]===_0xcb71('0xe')){this[_0xcb71('0x17')][_0x3215ee[_0xcb71('0x37')]][_0xcb71('0xe')]=_0x3215ee['applicationdata']['split'](',')[0x0];}}}}}catch(_0xd10b13){logger[_0xcb71('0x2d')]('[%s][voiceCallReport][newexten]',_0x3215ee[_0xcb71('0x37')],util['inspect'](_0xd10b13,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x67')]=function(_0x337208){try{if(this[_0xcb71('0x31')](_0x337208)){logger[_0xcb71('0x35')](_0xcb71('0x68'),_0x337208[_0xcb71('0x37')],_0x337208[_0xcb71('0x49')],_0x337208[_0xcb71('0x69')],_0x337208['calleridnum']);logger['debug'](_0xcb71('0x6a'),_0x337208[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x337208,{'showHidden':![],'depth':null}));if(_0x337208[_0xcb71('0x37')]!==_0x337208['linkedid']){if(this['channels'][_0x337208['linkedid']]){if(_0x337208[_0xcb71('0x50')]==='6'){if(!this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]][_0xcb71('0x6b')]){var _0x291579=moment();this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]][_0xcb71('0x6b')]=!![];this[_0xcb71('0x17')][_0x337208['linkedid']][_0xcb71('0x6c')]=_0x291579[_0xcb71('0x42')](_0xcb71('0x4d'));if(this[_0xcb71('0x17')][_0x337208['linkedid']][_0xcb71('0x4c')]){this[_0xcb71('0x17')][_0x337208['linkedid']]['holdtime']=_0x291579[_0xcb71('0x6d')](this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]]['starttime'],_0xcb71('0x6e'));}}this['channels'][_0x337208[_0xcb71('0x49')]]['linkedid']=_0x337208[_0xcb71('0x37')];if(_0x337208[_0xcb71('0x38')]!==_0xcb71('0x3f')){this['channels'][_0x337208[_0xcb71('0x49')]][_0xcb71('0x41')]=_0x337208[_0xcb71('0x38')];}this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]][_0xcb71('0x6f')]=_0x337208[_0xcb71('0x69')];this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]]['destinationchannel']=_0x337208[_0xcb71('0x3d')];this[_0xcb71('0x17')][_0x337208['linkedid']][_0xcb71('0x4e')]=dispositions[_[_0xcb71('0x4f')](_0x337208['channelstate'])];if(this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]]['UserId']=this[_0xcb71('0x18')][_0x337208['channel']['split']('-')[0x0]]['id'];this[_0xcb71('0x17')][_0x337208[_0xcb71('0x49')]][_0xcb71('0x70')]=this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]['name'];}}}}else{if(this[_0xcb71('0x17')][_0x337208[_0xcb71('0x37')]]){if(_0x337208['channelstate']==='6'){if(this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){this[_0xcb71('0x17')][_0x337208[_0xcb71('0x37')]][_0xcb71('0x71')]=this['agents'][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]['id'];this['channels'][_0x337208[_0xcb71('0x37')]][_0xcb71('0x70')]=this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x44')];}}}}if(_0x337208[_0xcb71('0x50')]==='6'&&_0x337208[_0xcb71('0x3c')]===_0xcb71('0x52')){if(this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x40')]=_0x337208[_0xcb71('0x54')];var _0x11aa60;if(this[_0xcb71('0x17')][_0x337208[_0xcb71('0x37')]])_0x11aa60=this[_0xcb71('0x17')][_0x337208[_0xcb71('0x37')]][_0xcb71('0x72')];else if(this[_0xcb71('0x17')][_0x337208['linkedid']])_0x11aa60=this[_0xcb71('0x17')][_0x337208['linkedid']][_0xcb71('0x72')];logger[_0xcb71('0x47')](_0xcb71('0x73'),_0x337208[_0xcb71('0x37')],util['inspect']({'destaccountcode':this['agents'][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x45')],'destconnectedlinenum':_0x337208[_0xcb71('0x54')],'routealias':_0x11aa60},{'showHidden':![],'depth':null}));this[_0xcb71('0x33')](util['format'](_0xcb71('0x43'),this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x44')]),_0xcb71('0x55'),{'destaccountcode':this[_0xcb71('0x18')][_0x337208[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x337208['exten'],'routealias':_0x11aa60});}}}}catch(_0x300c9e){logger[_0xcb71('0x2d')](_0xcb71('0x74'),_0x337208['uniqueid'],util['inspect'](_0x300c9e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')]['syncMixMonitorFilename']=function(_0x2036f0,_0x2901af){try{if(this[_0xcb71('0x17')][_0x2036f0]){logger[_0xcb71('0x35')](_0xcb71('0x75'),_0x2036f0,_0x2901af);this[_0xcb71('0x17')][_0x2036f0][_0xcb71('0x76')]=!![];if(_[_0xcb71('0x77')](_0x2901af,_0xcb71('0x78'))){_0x2901af=_0x2901af[_0xcb71('0x79')]('.wav49',_0xcb71('0x7a'));}this['channels'][_0x2036f0][_0xcb71('0x7b')]=_0x2901af;var _0x4699af=_[_0xcb71('0x7c')](this[_0xcb71('0x17')][_0x2036f0]['monitors'],{'filename':_0x2901af});if(_['isNil'](_0x4699af)){this[_0xcb71('0x17')][_0x2036f0]['monitors'][_0xcb71('0x7d')]({'filename':_0x2901af,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xcb71('0x7e')});}}}catch(_0x4c7ab1){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x2036f0,util[_0xcb71('0x2f')](_0x4c7ab1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x50cf0d){try{if(this[_0xcb71('0x31')](_0x50cf0d)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x50cf0d[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x50cf0d,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]]&&_0x50cf0d[_0xcb71('0x3d')]!='OutgoingSpoolFailed'){if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')])){if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x80')])){logger[_0xcb71('0x35')](_0xcb71('0x81'),_0x50cf0d['uniqueid'],_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x83')](_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x84')])){logger[_0xcb71('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x50cf0d[_0xcb71('0x37')],_0x50cf0d['value']);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]]['calleridnum']=_0x50cf0d[_0xcb71('0x82')];}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x85')])){logger['info'](_0xcb71('0x86'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]][_0xcb71('0x87')]=_0x50cf0d[_0xcb71('0x82')];}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x88')])){logger['info'](_0xcb71('0x89'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);this['channels'][_0x50cf0d['uniqueid']][_0xcb71('0x8a')]=_0x50cf0d[_0xcb71('0x82')];}else if(this['isNotNull'](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x8b')])){logger[_0xcb71('0x35')](_0xcb71('0x8c'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')][_0xcb71('0x3e')](',')[0x0]);this['channels'][_0x50cf0d[_0xcb71('0x37')]][_0xcb71('0xe')]=_0x50cf0d[_0xcb71('0x82')]['split'](',')[0x0];}else if(this[_0xcb71('0x31')](_0x50cf0d['variable']['xmd-originatecalleridnum'])){logger[_0xcb71('0x35')](_0xcb71('0x8d'),_0x50cf0d['uniqueid'],_0x50cf0d['value']);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]][_0xcb71('0x8e')]=_0x50cf0d[_0xcb71('0x82')];}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')]['xmd-destination'])){logger['info'](_0xcb71('0x8f'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]][_0xcb71('0x90')]=_0x50cf0d[_0xcb71('0x82')];}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x91')])){logger['info'](_0xcb71('0x92'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]][_0xcb71('0x93')]=_0x50cf0d[_0xcb71('0x82')];}else if(this[_0xcb71('0x31')](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x94')])){logger['info'](_0xcb71('0x95'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d['value']);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]]['queue']=_0x50cf0d[_0xcb71('0x82')];}else if(this['isNotNull'](_0x50cf0d[_0xcb71('0x7f')][_0xcb71('0x96')])){logger[_0xcb71('0x35')](_0xcb71('0x97'),_0x50cf0d[_0xcb71('0x37')],_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x37')]]['sipcalluniqueid']=_0x50cf0d[_0xcb71('0x82')];}}}else if(this['isNotNull'](_0x50cf0d['variable'][_0xcb71('0x80')])){if(_0x50cf0d[_0xcb71('0x82')]){var _0x4f5ee9=path['parse'](_0x50cf0d['value'])['name'];logger[_0xcb71('0x35')](_0xcb71('0x81'),_0x4f5ee9,_0x50cf0d[_0xcb71('0x82')]);this[_0xcb71('0x83')](_0x4f5ee9,_0x50cf0d[_0xcb71('0x82')]);}}else if(this[_0xcb71('0x17')][_0x50cf0d['linkedid']]){if(this['isNotNull'](_0x50cf0d['variable'])){if(this['isNotNull'](_0x50cf0d['variable'][_0xcb71('0x96')])){logger[_0xcb71('0x35')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x50cf0d['linkedid'],_0x50cf0d['value']);this[_0xcb71('0x17')][_0x50cf0d[_0xcb71('0x49')]][_0xcb71('0x98')]=_0x50cf0d[_0xcb71('0x82')];}}}}}catch(_0x1737a){logger['error'](_0xcb71('0x99'),_0x50cf0d[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x1737a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')]['syncHangup']=function(_0x36eba3){try{if(this[_0xcb71('0x31')](_0x36eba3)){logger[_0xcb71('0x47')](_0xcb71('0x9a'),_0x36eba3[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x36eba3,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]]){logger['info'](_0xcb71('0x9b'),_0x36eba3[_0xcb71('0x37')],_0x36eba3['cause-txt']);var _0x26916d=moment();this[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x9c')]=_0x26916d['format'](_0xcb71('0x4d'));this['channels'][_0x36eba3['uniqueid']][_0xcb71('0x60')]=_0x26916d[_0xcb71('0x6d')](this[_0xcb71('0x17')][_0x36eba3['uniqueid']][_0xcb71('0x4c')],_0xcb71('0x6e'));if(this['channels'][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x6b')]){this[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x9d')]=_0x26916d[_0xcb71('0x6d')](this['channels'][_0x36eba3['uniqueid']]['answertime'],_0xcb71('0x6e'));this['channels'][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x9e')]=this[_0xcb71('0x17')][_0x36eba3['uniqueid']][_0xcb71('0x60')]-this['channels'][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x9d')];}if(_0x36eba3[_0xcb71('0x3c')]===_0xcb71('0x52')){if(this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]]){this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')]['split']('-')[0x0]]=_[_0xcb71('0x9f')](this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]],[_0xcb71('0x40')]);logger[_0xcb71('0x47')](_0xcb71('0xa0'),_0x36eba3[_0xcb71('0x37')],util['inspect']({'id':this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x45')]},{'showHidden':![],'depth':null}));this[_0xcb71('0x33')](util[_0xcb71('0x42')](_0xcb71('0x43'),this[_0xcb71('0x18')][_0x36eba3[_0xcb71('0x3d')][_0xcb71('0x3e')]('-')[0x0]][_0xcb71('0x44')]),'user:agentcomplete',{'id':this['agents'][_0x36eba3[_0xcb71('0x3d')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xcb71('0x18')][_0x36eba3['channel']['split']('-')[0x0]][_0xcb71('0x45')]});}}var _0x52f23e=this;Promise[_0xcb71('0xa1')]()[_0xcb71('0xa2')](function(){var _0x2c300a=_0x52f23e['channels'][_0x36eba3[_0xcb71('0x37')]];if(typeof _0x2c300a['transferType']==='undefined')return;if(_[_0xcb71('0xa3')](_0x2c300a[_0xcb71('0xa4')]))return;return RpcSetting[_0xcb71('0xa5')]()['then'](function(_0x4ee155){if(!_0x4ee155['stopRecordingOnTransfer'])return;return Promise[_0xcb71('0xa1')]()[_0xcb71('0xa2')](function(){return ami['Action']({'action':_0xcb71('0xa6'),'channel':_0x2c300a[_0xcb71('0x3d')]})[_0xcb71('0xa7')](function(){});})[_0xcb71('0xa2')](function(){return ami[_0xcb71('0xa8')]({'action':_0xcb71('0xa6'),'channel':_0x2c300a[_0xcb71('0xa9')]})['catch'](function(){})[_0xcb71('0xaa')](function(){var _0x2ba719=_0x52f23e[_0xcb71('0x18')][_0x2c300a[_0xcb71('0xa9')][_0xcb71('0x3e')]('-')[0x0]];if(!_0x2ba719)return;io['emit'](_0xcb71('0xab'),{'agentId':_0x2ba719['id'],'uniqueid':_0x2c300a['uniqueid']});});});});})[_0xcb71('0xa2')](function(){if(_0x36eba3['event']===_0xcb71('0xac')){_0x52f23e['blindTransfers'][_0x36eba3[_0xcb71('0x37')]]=_0x52f23e['channels'][_0x36eba3['uniqueid']];}else{if(_0x52f23e['channels'][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x8a')]===_0xcb71('0xad')&&_0x52f23e[_0xcb71('0x19')][_0x36eba3[_0xcb71('0x37')]]){_0x52f23e[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x37')]=[_0x52f23e[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x49')],_0x52f23e[_0xcb71('0x17')][_0x36eba3['uniqueid']][_0xcb71('0x49')]=_0x52f23e[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]][_0xcb71('0x37')]][0x0];delete _0x52f23e[_0xcb71('0x19')][_0x36eba3[_0xcb71('0x37')]];}}logger[_0xcb71('0x47')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x36eba3['uniqueid'],util[_0xcb71('0x2f')](_0x52f23e['channels'][_0x36eba3['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xcb71('0xae'),_0x52f23e[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]]);delete _0x52f23e[_0xcb71('0x17')][_0x36eba3[_0xcb71('0x37')]];});}}}catch(_0x1e9a95){logger[_0xcb71('0x2d')]('[%s][voiceCallReport][hangup]',_0x36eba3[_0xcb71('0x37')],util['inspect'](_0x1e9a95,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')]['syncAttendedTransfer']=function(_0x38bde9){try{if(this[_0xcb71('0x31')](_0x38bde9)){logger[_0xcb71('0x35')](_0xcb71('0xaf'),_0x38bde9[_0xcb71('0x37')],_0x38bde9[_0xcb71('0xb0')],_0x38bde9[_0xcb71('0xb1')]);logger[_0xcb71('0x47')](_0xcb71('0xb2'),_0x38bde9[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x38bde9,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb3')]]){this['channels'][_0x38bde9[_0xcb71('0xb3')]][_0xcb71('0xb4')]=_0x38bde9[_0xcb71('0xb0')];this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb3')]]['transferconnectedlinenum']=_0x38bde9['transfertargetcalleridnum'];if(this['channels'][_0x38bde9[_0xcb71('0xb5')]]){var _0x2ec50e=this[_0xcb71('0x17')][_0x38bde9['secondtransfereruniqueid']];this['channels'][_0x38bde9['secondtransfereruniqueid']]=this['channels'][_0x38bde9[_0xcb71('0xb3')]];this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb3')]]=_0x2ec50e;}}else if(this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb6')]]){this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb6')]][_0xcb71('0xb4')]=_0x38bde9[_0xcb71('0xb0')];this[_0xcb71('0x17')][_0x38bde9['transfertargetuniqueid']][_0xcb71('0xb7')]=_0x38bde9[_0xcb71('0xb1')];if(this[_0xcb71('0x17')][_0x38bde9['origtransfereruniqueid']]){var _0x2ec50e=this[_0xcb71('0x17')][_0x38bde9['origtransfereruniqueid']];this['channels'][_0x38bde9[_0xcb71('0xb8')]]=this[_0xcb71('0x17')][_0x38bde9['transfertargetuniqueid']];this['channels'][_0x38bde9[_0xcb71('0xb6')]]=_0x2ec50e;}}if((this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb8')]]||this['channels'][_0x38bde9[_0xcb71('0xb9')]])&&this['channels'][_0x38bde9[_0xcb71('0xb5')]]){var _0x3ac3e3=_[_0xcb71('0xba')]([this['channels'][_0x38bde9['origtransfereruniqueid']],this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb9')]],this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb5')]]],function(_0x499d65){return _0x499d65&&_0x499d65[_0xcb71('0x8a')]===_0xcb71('0xad')&&_0x499d65[_0xcb71('0xbb')];});if(_0x3ac3e3){if(this[_0xcb71('0x17')][_0x38bde9['origtransfereruniqueid']])this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb8')]][_0xcb71('0xbc')]=_0xcb71('0xbd');if(this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb9')]])this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb9')]][_0xcb71('0xbc')]='ATTENDED';this[_0xcb71('0x17')][_0x38bde9[_0xcb71('0xb5')]]['transferType']=_0xcb71('0xbd');}}}}catch(_0x3b3f1b){logger[_0xcb71('0x2d')](_0xcb71('0xbe'),_0x38bde9[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x3b3f1b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')]['syncBlindTransfer']=function(_0x64b8ea){try{if(this[_0xcb71('0x31')](_0x64b8ea)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x64b8ea[_0xcb71('0x37')],_0x64b8ea[_0xcb71('0xbf')],_0x64b8ea['extension']);logger[_0xcb71('0x47')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x64b8ea[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x64b8ea,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x64b8ea['transfereeuniqueid']]){this[_0xcb71('0x17')][_0x64b8ea[_0xcb71('0xb3')]]['transfercalleridnum']=_0x64b8ea[_0xcb71('0xbf')];this['channels'][_0x64b8ea[_0xcb71('0xb3')]][_0xcb71('0xb7')]=_0x64b8ea['extension'];this[_0xcb71('0x17')][_0x64b8ea['transfereeuniqueid']][_0xcb71('0xbc')]=_0xcb71('0xc0');this[_0xcb71('0x22')]({'event':_0xcb71('0xac'),'uniqueid':_0x64b8ea[_0xcb71('0xb3')],'context':_0x64b8ea['context'],'channel':_0x64b8ea[_0xcb71('0xc1')]});}else{this[_0xcb71('0x17')][_0x64b8ea[_0xcb71('0xc2')]]['transferType']=_0xcb71('0xc0');}}}catch(_0x592358){logger[_0xcb71('0x2d')]('[%s][voiceCallReport][blindtransfer]',_0x64b8ea[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x592358,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')]['syncMusicOnHoldStart']=function(_0x47489c){try{if(this[_0xcb71('0x31')](_0x47489c)){logger['debug'](_0xcb71('0xc3'),_0x47489c[_0xcb71('0x37')],util['inspect'](_0x47489c,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x47489c[_0xcb71('0x37')]]){if(!_[_0xcb71('0xc4')](this[_0xcb71('0x17')][_0x47489c['uniqueid']][_0xcb71('0x6c')])){this[_0xcb71('0x17')][_0x47489c[_0xcb71('0x37')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xcb71('0x35')](_0xcb71('0xc5'),_0x47489c[_0xcb71('0x37')],this[_0xcb71('0x17')][_0x47489c[_0xcb71('0x37')]]['mohstarttime']);}}}}catch(_0x1eb7dd){logger['error'](_0xcb71('0xc6'),_0x47489c[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x1eb7dd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcb71('0x30')][_0xcb71('0x2b')]=function(_0x23e3be){try{if(this['isNotNull'](_0x23e3be)){logger[_0xcb71('0x47')](_0xcb71('0xc7'),_0x23e3be[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0x23e3be,{'showHidden':![],'depth':null}));if(this[_0xcb71('0x17')][_0x23e3be[_0xcb71('0x37')]]){if(!_[_0xcb71('0xc4')](this[_0xcb71('0x17')][_0x23e3be['uniqueid']]['mohstarttime'])){this[_0xcb71('0x17')][_0x23e3be[_0xcb71('0x37')]]['mohtime']+=moment()[_0xcb71('0xc8')](0x0)['diff'](this[_0xcb71('0x17')][_0x23e3be[_0xcb71('0x37')]][_0xcb71('0xc9')],'seconds');logger[_0xcb71('0x35')](_0xcb71('0xca'),_0x23e3be[_0xcb71('0x37')],this[_0xcb71('0x17')][_0x23e3be[_0xcb71('0x37')]][_0xcb71('0xcb')]);delete this['channels'][_0x23e3be[_0xcb71('0x37')]][_0xcb71('0xc9')];}}}}catch(_0xdbd59f){logger[_0xcb71('0x2d')](_0xcb71('0xcc'),_0x23e3be[_0xcb71('0x37')],util[_0xcb71('0x2f')](_0xdbd59f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x52bb=['[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','destinationchannel','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','exten','split','destconnectedlinenum','user:%s','name','user:agentconnect','channel','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','application','duration','seconds','lastapplication','lastdata','startsWith','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answertime','diff','xcally-motion-preview','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','monitorFilename','find','monitors','isNil','push','rec'];(function(_0x81ab8b,_0x5677be){var _0x377eba=function(_0x4eb469){while(--_0x4eb469){_0x81ab8b['push'](_0x81ab8b['shift']());}};_0x377eba(++_0x5677be);}(_0x52bb,0x127));var _0xb52b=function(_0x2fa1d0,_0x41a848){_0x2fa1d0=_0x2fa1d0-0x0;var _0x170d37=_0x52bb[_0x2fa1d0];return _0x170d37;};'use strict';var BPromise=require(_0xb52b('0x0'));var _=require(_0xb52b('0x1'));var moment=require(_0xb52b('0x2'));var util=require(_0xb52b('0x3'));var path=require(_0xb52b('0x4'));var Redis=require(_0xb52b('0x5'));var config=require(_0xb52b('0x6'));var logger=require(_0xb52b('0x7'))('ami');var ami=require(_0xb52b('0x8'));var Channel=require(_0xb52b('0x9'));var RpcSetting=require(_0xb52b('0xa'));var statusDesc=[_0xb52b('0xb'),_0xb52b('0xc'),_0xb52b('0xd'),'busy',_0xb52b('0xe'),_0xb52b('0xf'),'ringing',_0xb52b('0x10'),_0xb52b('0x11')];var applications=[_0xb52b('0x12'),_0xb52b('0x13'),_0xb52b('0x14'),_0xb52b('0x15'),'playback','voicemail'];var dispositions=[_0xb52b('0x16'),_0xb52b('0x17'),_0xb52b('0x17'),'NO\x20ANSWER','NO\x20ANSWER',_0xb52b('0x16'),_0xb52b('0x18'),_0xb52b('0x19'),_0xb52b('0x17'),_0xb52b('0x17'),_0xb52b('0x17')];var actions={};config[_0xb52b('0x1a')]=_[_0xb52b('0x1b')](config[_0xb52b('0x1a')],{'host':_0xb52b('0x1c'),'port':0x18eb});var io=require(_0xb52b('0x1d'))(new Redis(config[_0xb52b('0x1a')]));function VoiceCallReport(_0x4224d6){this[_0xb52b('0x1e')]=_0x4224d6['channels'];this[_0xb52b('0x1f')]=_0x4224d6[_0xb52b('0x1f')];this[_0xb52b('0x20')]={};ami['on'](_0xb52b('0x21'),this[_0xb52b('0x22')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x24'),this[_0xb52b('0x22')]['bind'](this));ami['on'](_0xb52b('0x25'),this['syncNewChannel']['bind'](this));ami['on'](_0xb52b('0x26'),this['syncNewState'][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x27'),this[_0xb52b('0x28')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x29'),this[_0xb52b('0x2a')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x2b'),this[_0xb52b('0x2c')]['bind'](this));ami['on']('attendedtransfer',this[_0xb52b('0x2d')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x2e'),this[_0xb52b('0x2f')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x30'),this[_0xb52b('0x31')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x32'),this[_0xb52b('0x33')][_0xb52b('0x23')](this));try{logger[_0xb52b('0x34')](_0xb52b('0x35'));ami[_0xb52b('0x36')]();}catch(_0x70f582){logger[_0xb52b('0x37')]('[voiceCallReport][coreshowchannels]',util[_0xb52b('0x38')](_0x70f582,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x3a')]=function(_0xfe5be7){return _0xfe5be7!==null&&!_[_0xb52b('0x3b')](_0xfe5be7);};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x3c')]=function(_0x2afa5f,_0x235662,_0x44b57c){io['to'](_0x2afa5f)[_0xb52b('0x3c')](_0x235662,_0x44b57c);};VoiceCallReport[_0xb52b('0x39')]['syncNewCallerId']=function(_0xcb6a58){try{if(this[_0xb52b('0x3a')](_0xcb6a58)){logger[_0xb52b('0x34')](_0xb52b('0x3d'),_0xcb6a58[_0xb52b('0x3e')],_0xcb6a58[_0xb52b('0x3f')],_0xcb6a58[_0xb52b('0x40')]);logger[_0xb52b('0x41')](_0xb52b('0x42'),_0xcb6a58[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0xcb6a58,{'showHidden':![],'depth':null}));if(_0xcb6a58[_0xb52b('0x3e')]===_0xcb6a58[_0xb52b('0x43')]){if(!_['isUndefined'](this[_0xb52b('0x1e')][_0xcb6a58[_0xb52b('0x3e')]])){_[_0xb52b('0x44')](this['channels'][_0xcb6a58['uniqueid']],_[_0xb52b('0x45')](_0xcb6a58,_[_0xb52b('0x46')](this[_0xb52b('0x1e')][_0xcb6a58[_0xb52b('0x3e')]])));}}if(_0xcb6a58[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0xcb6a58['channel']['split']('-')[0x0]]){if(_0xcb6a58[_0xb52b('0x49')]=='xcally-motion-preview'){this[_0xb52b('0x1f')][_0xcb6a58['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4b')]=_0xcb6a58['connectedlinenum'];this[_0xb52b('0x3c')](util['format'](_0xb52b('0x4c'),this['agents'][_0xcb6a58['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0x4e'),{'destaccountcode':this[_0xb52b('0x1f')][_0xcb6a58[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xcb6a58[_0xb52b('0x50')]});}}}}}catch(_0x5d1b5c){logger['error'](_0xb52b('0x51'),_0xcb6a58[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5d1b5c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x4ec32c){try{if(this[_0xb52b('0x3a')](_0x4ec32c)){logger[_0xb52b('0x41')](_0xb52b('0x52'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4ec32c,{'showHidden':![],'depth':null}));if(_0x4ec32c[_0xb52b('0x3e')]===_0x4ec32c[_0xb52b('0x43')]&&_0x4ec32c[_0xb52b('0x4f')]!=_0xb52b('0x53')){if(_[_0xb52b('0x3b')](this[_0xb52b('0x1e')][_0x4ec32c['uniqueid']])){logger[_0xb52b('0x34')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x4ec32c[_0xb52b('0x3e')],_0x4ec32c['context'],_0x4ec32c['exten']);this['channels'][_0x4ec32c['uniqueid']]=new Channel();this[_0xb52b('0x1e')][_0x4ec32c['uniqueid']][_0xb52b('0x54')]=moment()[_0xb52b('0x55')](_0xb52b('0x56'));this[_0xb52b('0x1e')][_0x4ec32c[_0xb52b('0x3e')]][_0xb52b('0x57')]=dispositions[_[_0xb52b('0x58')](_0x4ec32c[_0xb52b('0x59')])];_[_0xb52b('0x44')](this[_0xb52b('0x1e')][_0x4ec32c[_0xb52b('0x3e')]],_[_0xb52b('0x45')](_0x4ec32c,_['keys'](this['channels'][_0x4ec32c[_0xb52b('0x3e')]])));if(_0x4ec32c['context']==='from-sip'){if(this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){if(_[_0xb52b('0x3b')](this[_0xb52b('0x1f')][_0x4ec32c['channel'][_0xb52b('0x4a')]('-')[0x0]]['destconnectedlinenum'])){this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['destconnectedlinenum']=_0x4ec32c[_0xb52b('0x49')];logger[_0xb52b('0x41')](_0xb52b('0x5a'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')]({'destaccountcode':this[_0xb52b('0x1f')][_0x4ec32c['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x4ec32c[_0xb52b('0x49')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xb52b('0x4c'),this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0x4e'),{'destaccountcode':this['agents'][_0x4ec32c[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x4ec32c[_0xb52b('0x49')]});}}}}}}}catch(_0x1ad75d){logger[_0xb52b('0x37')](_0xb52b('0x5c'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x1ad75d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x22')]=function(_0x2bb311){try{if(this[_0xb52b('0x3a')](_0x2bb311)){logger[_0xb52b('0x41')](_0xb52b('0x5d'),_0x2bb311[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2bb311,{'showHidden':![],'depth':null}));if(_0x2bb311[_0xb52b('0x3e')]===_0x2bb311[_0xb52b('0x43')]&&_0x2bb311[_0xb52b('0x49')]!='h'&&_0x2bb311['channel']!=_0xb52b('0x53')){_0x2bb311['application']=_0x2bb311['application'][_0xb52b('0x5e')]();_0x2bb311[_0xb52b('0x5f')]=_0x2bb311[_0xb52b('0x60')]&&_0x2bb311[_0xb52b('0x60')]['startsWith'](_0xb52b('0x61'))?_0x2bb311[_0xb52b('0x60')]:(_0x2bb311[_0xb52b('0x60')]||_0x2bb311[_0xb52b('0x5f')])[_0xb52b('0x5e')]();logger[_0xb52b('0x34')](_0xb52b('0x62'),_0x2bb311[_0xb52b('0x3e')],_0x2bb311[_0xb52b('0x63')],_0x2bb311[_0xb52b('0x5f')]);if(_[_0xb52b('0x3b')](this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]])){this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]]=new Channel();this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x54')]=_0x2bb311[_0xb52b('0x64')]?moment()['subtract'](moment[_0xb52b('0x64')](_0x2bb311[_0xb52b('0x64')])[_0xb52b('0x65')](),_0xb52b('0x65'))[_0xb52b('0x55')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb52b('0x55')](_0xb52b('0x56'));this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]]['disposition']=_0xb52b('0x16');}_['merge'](this['channels'][_0x2bb311[_0xb52b('0x3e')]],_[_0xb52b('0x45')](_0x2bb311,_[_0xb52b('0x46')](this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]])));if(_['includes'](applications,_0x2bb311['application'])){this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x66')]=_0x2bb311[_0xb52b('0x63')];this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]][_0xb52b('0x67')]=_0x2bb311['applicationdata'];if(_0x2bb311[_0xb52b('0x63')]==='set'&&_[_0xb52b('0x68')](_0x2bb311['applicationdata']['toLowerCase'](),'cdr(')){var _0x2927e0=_0x2bb311[_0xb52b('0x5f')][_0xb52b('0x4a')]('=');var _0x4fe524=_0x2927e0[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x4fe524){this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]][_0x4fe524[0x1]]=_0x2927e0[0x1];}}else if(_0x2bb311[_0xb52b('0x63')]===_0xb52b('0x13')){this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x13')]=_0x2bb311['applicationdata'][_0xb52b('0x4a')](',')[0x0];}}}}}catch(_0x5ba0e6){logger[_0xb52b('0x37')](_0xb52b('0x69'),_0x2bb311[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5ba0e6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb52b('0x6a')]=function(_0x1cc933){try{if(this[_0xb52b('0x3a')](_0x1cc933)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1cc933[_0xb52b('0x3e')],_0x1cc933['linkedid'],_0x1cc933[_0xb52b('0x3f')],_0x1cc933[_0xb52b('0x40')]);logger[_0xb52b('0x41')](_0xb52b('0x6b'),_0x1cc933[_0xb52b('0x3e')],util['inspect'](_0x1cc933,{'showHidden':![],'depth':null}));if(_0x1cc933['uniqueid']!==_0x1cc933['linkedid']){if(this['channels'][_0x1cc933[_0xb52b('0x43')]]){if(_0x1cc933['channelstate']==='6'){if(!this[_0xb52b('0x1e')][_0x1cc933['linkedid']]['answered']){var _0x34e6a4=moment();this[_0xb52b('0x1e')][_0x1cc933['linkedid']]['answered']=!![];this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x6c')]=_0x34e6a4[_0xb52b('0x55')](_0xb52b('0x56'));if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x54')]){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]]['holdtime']=_0x34e6a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x54')],'seconds');}}this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x43')]=_0x1cc933[_0xb52b('0x3e')];if(_0x1cc933[_0xb52b('0x40')]!==_0xb52b('0x6e')){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x50')]=_0x1cc933[_0xb52b('0x40')];}this['channels'][_0x1cc933[_0xb52b('0x43')]]['connectedlinename']=_0x1cc933[_0xb52b('0x3f')];this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]]['destinationchannel']=_0x1cc933['channel'];this[_0xb52b('0x1e')][_0x1cc933['linkedid']][_0xb52b('0x57')]=dispositions[_[_0xb52b('0x58')](_0x1cc933[_0xb52b('0x59')])];if(this[_0xb52b('0x1f')][_0x1cc933['channel']['split']('-')[0x0]]){this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x6f')]=this[_0xb52b('0x1f')][_0x1cc933['channel'][_0xb52b('0x4a')]('-')[0x0]]['id'];this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x70')]=this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x4d')];}}}}else{if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]]){if(_0x1cc933[_0xb52b('0x59')]==='6'){if(this[_0xb52b('0x1f')][_0x1cc933['channel'][_0xb52b('0x4a')]('-')[0x0]]){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]][_0xb52b('0x6f')]=this[_0xb52b('0x1f')][_0x1cc933['channel']['split']('-')[0x0]]['id'];this[_0xb52b('0x1e')][_0x1cc933['uniqueid']][_0xb52b('0x70')]=this['agents'][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')];}}}}if(_0x1cc933['channelstate']==='6'&&_0x1cc933[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){this['agents'][_0x1cc933[_0xb52b('0x4f')]['split']('-')[0x0]]['destconnectedlinenum']=_0x1cc933['exten'];var _0x1795e3;if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]])_0x1795e3=this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]][_0xb52b('0x71')];else if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]])_0x1795e3=this['channels'][_0x1cc933['linkedid']][_0xb52b('0x71')];logger[_0xb52b('0x41')](_0xb52b('0x72'),_0x1cc933['uniqueid'],util['inspect']({'destaccountcode':this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x1cc933[_0xb52b('0x49')],'routealias':_0x1795e3},{'showHidden':![],'depth':null}));this[_0xb52b('0x3c')](util[_0xb52b('0x55')](_0xb52b('0x4c'),this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x1cc933[_0xb52b('0x49')],'routealias':_0x1795e3});}}}}catch(_0x5e025d){logger['error'](_0xb52b('0x73'),_0x1cc933[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5e025d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncMixMonitorFilename']=function(_0xf6d727,_0x51e693){try{if(this[_0xb52b('0x1e')][_0xf6d727]){logger[_0xb52b('0x34')](_0xb52b('0x74'),_0xf6d727,_0x51e693);this['channels'][_0xf6d727]['monitor']=!![];if(_[_0xb52b('0x75')](_0x51e693,_0xb52b('0x76'))){_0x51e693=_0x51e693['replace'](_0xb52b('0x76'),'.WAV');}this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x77')]=_0x51e693;var _0x228566=_[_0xb52b('0x78')](this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x79')],{'filename':_0x51e693});if(_[_0xb52b('0x7a')](_0x228566)){this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x79')][_0xb52b('0x7b')]({'filename':_0x51e693,'createdAt':moment()[_0xb52b('0x55')](_0xb52b('0x56')),'mixmonitorid':'','status':_0xb52b('0x7c')});}}}catch(_0x5caba8){logger[_0xb52b('0x37')](_0xb52b('0x7d'),_0xf6d727,util[_0xb52b('0x38')](_0x5caba8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x28')]=function(_0x1e9f98){try{if(this['isNotNull'](_0x1e9f98)){logger[_0xb52b('0x41')](_0xb52b('0x7e'),_0x1e9f98['uniqueid'],util['inspect'](_0x1e9f98,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]]&&_0x1e9f98['channel']!=_0xb52b('0x53')){if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')])){if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')]['mixmonitor_filename'])){logger['info'](_0xb52b('0x80'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x82')](_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);}else if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x83')])){logger['info'](_0xb52b('0x84'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']]['calleridnum']=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x85')])){logger['info'](_0xb52b('0x86'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x87')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')]['xmd-cdrtype'])){logger['info'](_0xb52b('0x88'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']][_0xb52b('0x89')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8a')])){logger['info'](_0xb52b('0x8b'),_0x1e9f98['uniqueid'],_0x1e9f98['value'][_0xb52b('0x4a')](',')[0x0]);this['channels'][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x13')]=_0x1e9f98[_0xb52b('0x81')][_0xb52b('0x4a')](',')[0x0];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8c')])){logger[_0xb52b('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x8d')]=_0x1e9f98[_0xb52b('0x81')];}else if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8e')])){logger[_0xb52b('0x34')](_0xb52b('0x8f'),_0x1e9f98['uniqueid'],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x90')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x91')])){logger[_0xb52b('0x34')](_0xb52b('0x92'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']][_0xb52b('0x93')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x94')])){logger['info'](_0xb52b('0x95'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x13')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98['variable'][_0xb52b('0x96')])){logger[_0xb52b('0x34')](_0xb52b('0x97'),_0x1e9f98['uniqueid'],_0x1e9f98[_0xb52b('0x81')]);this['channels'][_0x1e9f98['uniqueid']][_0xb52b('0x98')]=_0x1e9f98['value'];}}}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x99')])){if(_0x1e9f98[_0xb52b('0x81')]){var _0x2b2e46=path['parse'](_0x1e9f98[_0xb52b('0x81')])[_0xb52b('0x4d')];logger[_0xb52b('0x34')](_0xb52b('0x80'),_0x2b2e46,_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x82')](_0x2b2e46,_0x1e9f98['value']);}}else if(this[_0xb52b('0x1e')][_0x1e9f98['linkedid']]){if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')])){if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')]['sipcallid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1e9f98['linkedid'],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x43')]][_0xb52b('0x9a')]=_0x1e9f98[_0xb52b('0x81')];}}}}}catch(_0x56fef5){logger[_0xb52b('0x37')](_0xb52b('0x9b'),_0x1e9f98['uniqueid'],util[_0xb52b('0x38')](_0x56fef5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb52b('0x2a')]=function(_0x41c197){try{if(this[_0xb52b('0x3a')](_0x41c197)){logger[_0xb52b('0x41')](_0xb52b('0x9c'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x41c197,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]]){logger[_0xb52b('0x34')](_0xb52b('0x9d'),_0x41c197['uniqueid'],_0x41c197[_0xb52b('0x9e')]);var _0x4a13a4=moment();this['channels'][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x9f')]=_0x4a13a4[_0xb52b('0x55')](_0xb52b('0x56'));this['channels'][_0x41c197['uniqueid']][_0xb52b('0x64')]=_0x4a13a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x54')],_0xb52b('0x65'));if(this['channels'][_0x41c197[_0xb52b('0x3e')]]['answered']){this['channels'][_0x41c197['uniqueid']][_0xb52b('0xa0')]=_0x4a13a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x6c')],_0xb52b('0x65'));this['channels'][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0xa1')]=this[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x64')]-this[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0xa0')];}if(_0x41c197[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')]['split']('-')[0x0]]=_['omit'](this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]],[_0xb52b('0x4b')]);logger[_0xb52b('0x41')](_0xb52b('0xa2'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')]({'id':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')]},{'showHidden':![],'depth':null}));this[_0xb52b('0x3c')](util['format'](_0xb52b('0x4c'),this['agents'][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0xa3'),{'id':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')]});}}var _0x4d6a83=this;Promise['resolve']()['then'](function(){var _0x503809=_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]];if(typeof _0x503809[_0xb52b('0xa4')]===_0xb52b('0xa5'))return;if(_[_0xb52b('0xa6')](_0x503809[_0xb52b('0x79')]))return;return RpcSetting[_0xb52b('0xa7')]()[_0xb52b('0xa8')](function(_0x2af1ba){if(!_0x2af1ba[_0xb52b('0xa9')])return;return Promise[_0xb52b('0xaa')]()['then'](function(){return ami[_0xb52b('0xab')]({'action':_0xb52b('0xac'),'channel':_0x503809[_0xb52b('0x4f')]})[_0xb52b('0xad')](function(){});})[_0xb52b('0xa8')](function(){return ami[_0xb52b('0xab')]({'action':_0xb52b('0xac'),'channel':_0x503809['destinationchannel']})[_0xb52b('0xad')](function(){})[_0xb52b('0xae')](function(){var _0x274f3d=_0x4d6a83[_0xb52b('0x1f')][_0x503809[_0xb52b('0xaf')]['split']('-')[0x0]];if(!_0x274f3d)return;io[_0xb52b('0x3c')](_0xb52b('0xb0'),{'agentId':_0x274f3d['id'],'uniqueid':_0x503809[_0xb52b('0x3e')]});});});});})[_0xb52b('0xa8')](function(){if(_0x41c197[_0xb52b('0xb1')]===_0xb52b('0xb2')){_0x4d6a83[_0xb52b('0x20')][_0x41c197['uniqueid']]=_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]];}else{if(_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x89')]==='outbound'&&_0x4d6a83[_0xb52b('0x20')][_0x41c197[_0xb52b('0x3e')]]){_0x4d6a83[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x3e')]=[_0x4d6a83[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x43')],_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x43')]=_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x3e')]][0x0];delete _0x4d6a83[_0xb52b('0x20')][_0x41c197[_0xb52b('0x3e')]];}}logger[_0xb52b('0x41')](_0xb52b('0xb3'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]],{'showHidden':![],'depth':null}));ami[_0xb52b('0x3c')]('custom:voiceCallReport',_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]]);delete _0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]];});}}}catch(_0x384b27){logger['error']('[%s][voiceCallReport][hangup]',_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x384b27,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x2d')]=function(_0x4835bb){try{if(this[_0xb52b('0x3a')](_0x4835bb)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4835bb[_0xb52b('0x3e')],_0x4835bb[_0xb52b('0xb4')],_0x4835bb[_0xb52b('0xb5')]);logger['debug'](_0xb52b('0xb6'),_0x4835bb['uniqueid'],util[_0xb52b('0x38')](_0x4835bb,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]]){this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]][_0xb52b('0xb8')]=_0x4835bb[_0xb52b('0xb4')];this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]][_0xb52b('0xb9')]=_0x4835bb[_0xb52b('0xb5')];if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]]){var _0x16a07d=this['channels'][_0x4835bb[_0xb52b('0xba')]];this['channels'][_0x4835bb[_0xb52b('0xba')]]=this['channels'][_0x4835bb[_0xb52b('0xb7')]];this['channels'][_0x4835bb[_0xb52b('0xb7')]]=_0x16a07d;}}else if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbb')]]){this[_0xb52b('0x1e')][_0x4835bb['transfertargetuniqueid']][_0xb52b('0xb8')]=_0x4835bb[_0xb52b('0xb4')];this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbb')]][_0xb52b('0xb9')]=_0x4835bb[_0xb52b('0xb5')];if(this['channels'][_0x4835bb[_0xb52b('0xbc')]]){var _0x16a07d=this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]];this['channels'][_0x4835bb[_0xb52b('0xbc')]]=this['channels'][_0x4835bb['transfertargetuniqueid']];this[_0xb52b('0x1e')][_0x4835bb['transfertargetuniqueid']]=_0x16a07d;}}if((this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]]||this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]])&&this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]]){var _0x779dbc=_[_0xb52b('0xbe')]([this['channels'][_0x4835bb[_0xb52b('0xbc')]],this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]],this['channels'][_0x4835bb[_0xb52b('0xba')]]],function(_0x70b734){return _0x70b734&&_0x70b734[_0xb52b('0x89')]===_0xb52b('0xbf')&&_0x70b734[_0xb52b('0xc0')];});if(_0x779dbc){if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]])this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]][_0xb52b('0xa4')]='ATTENDED';if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]])this['channels'][_0x4835bb[_0xb52b('0xbd')]]['transferType']='ATTENDED';this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]][_0xb52b('0xa4')]=_0xb52b('0xc1');}}}}catch(_0x43c174){logger[_0xb52b('0x37')](_0xb52b('0xc2'),_0x4835bb['uniqueid'],util[_0xb52b('0x38')](_0x43c174,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncBlindTransfer']=function(_0x17d9ba){try{if(this[_0xb52b('0x3a')](_0x17d9ba)){logger['info'](_0xb52b('0xc3'),_0x17d9ba[_0xb52b('0x3e')],_0x17d9ba[_0xb52b('0xc4')],_0x17d9ba[_0xb52b('0xc5')]);logger[_0xb52b('0x41')](_0xb52b('0xc6'),_0x17d9ba[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x17d9ba,{'showHidden':![],'depth':null}));if(this['channels'][_0x17d9ba['transfereeuniqueid']]){this['channels'][_0x17d9ba[_0xb52b('0xb7')]][_0xb52b('0xb8')]=_0x17d9ba[_0xb52b('0xc4')];this['channels'][_0x17d9ba[_0xb52b('0xb7')]][_0xb52b('0xb9')]=_0x17d9ba[_0xb52b('0xc5')];this[_0xb52b('0x1e')][_0x17d9ba[_0xb52b('0xb7')]]['transferType']=_0xb52b('0xc7');this[_0xb52b('0x2a')]({'event':_0xb52b('0xb2'),'uniqueid':_0x17d9ba[_0xb52b('0xb7')],'context':_0x17d9ba['context'],'channel':_0x17d9ba['transfererchannel']});}else{this[_0xb52b('0x1e')][_0x17d9ba[_0xb52b('0xc8')]][_0xb52b('0xa4')]='BLIND';}}}catch(_0x2d2634){logger[_0xb52b('0x37')](_0xb52b('0xc9'),_0x17d9ba[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2d2634,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncMusicOnHoldStart']=function(_0x4e676c){try{if(this[_0xb52b('0x3a')](_0x4e676c)){logger['debug'](_0xb52b('0xca'),_0x4e676c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4e676c,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x4e676c[_0xb52b('0x3e')]]){if(!_[_0xb52b('0x7a')](this['channels'][_0x4e676c[_0xb52b('0x3e')]][_0xb52b('0x6c')])){this['channels'][_0x4e676c['uniqueid']][_0xb52b('0xcb')]=moment()[_0xb52b('0x55')](_0xb52b('0x56'));logger[_0xb52b('0x34')](_0xb52b('0xcc'),_0x4e676c[_0xb52b('0x3e')],this[_0xb52b('0x1e')][_0x4e676c[_0xb52b('0x3e')]][_0xb52b('0xcb')]);}}}}catch(_0xddc2e6){logger[_0xb52b('0x37')](_0xb52b('0xcd'),_0x4e676c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0xddc2e6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x33')]=function(_0x2a68c8){try{if(this[_0xb52b('0x3a')](_0x2a68c8)){logger[_0xb52b('0x41')](_0xb52b('0xce'),_0x2a68c8['uniqueid'],util[_0xb52b('0x38')](_0x2a68c8,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]]){if(!_[_0xb52b('0x7a')](this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')])){this['channels'][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcf')]+=moment()[_0xb52b('0xd0')](0x0)[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')],'seconds');logger[_0xb52b('0x34')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x2a68c8[_0xb52b('0x3e')],this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcf')]);delete this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')];}}}}catch(_0x2f5df4){logger[_0xb52b('0x37')]('[%s][voiceCallReport][musiconholdstop]',_0x2a68c8[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2f5df4,{'showHidden':![],'depth':null}));}};module[_0xb52b('0xd1')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index db5c5d1..dfb43fa 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf43=['memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','duration','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','varset','syncVarSet','newexten','hangup','syncHangup','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','prototype','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','addVariable','keys','value','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls'];(function(_0x19e6a1,_0x299eb9){var _0x36356a=function(_0x1171eb){while(--_0x1171eb){_0x19e6a1['push'](_0x19e6a1['shift']());}};_0x36356a(++_0x299eb9);}(_0xdf43,0x196));var _0x3df4=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xdf43[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var moment=require(_0x3df4('0x0'));var util=require(_0x3df4('0x1'));var Redis=require(_0x3df4('0x2'));var config=require('../../../config/environment');var logger=require(_0x3df4('0x3'))(_0x3df4('0x4'));var ami=require(_0x3df4('0x5'));config['redis']=_[_0x3df4('0x6')](config[_0x3df4('0x7')],{'host':_0x3df4('0x8'),'port':0x18eb});var io=require(_0x3df4('0x9'))(new Redis(config[_0x3df4('0x7')]));function VoiceDialReport(_0x5e01ca){this[_0x3df4('0xa')]=_0x5e01ca[_0x3df4('0xb')];this[_0x3df4('0xc')]=_0x5e01ca[_0x3df4('0xc')];this[_0x3df4('0xd')]={};this[_0x3df4('0xe')]={};ami['on'](_0x3df4('0xf'),this[_0x3df4('0x10')][_0x3df4('0x11')](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on'](_0x3df4('0x12'),this[_0x3df4('0x13')][_0x3df4('0x11')](this));ami['on'](_0x3df4('0x14'),this['syncNewExten'][_0x3df4('0x11')](this));ami['on'](_0x3df4('0x15'),this[_0x3df4('0x16')][_0x3df4('0x11')](this));}VoiceDialReport['prototype'][_0x3df4('0x17')]=function(_0x46d255){return _0x46d255!==null&&!_[_0x3df4('0x18')](_0x46d255);};VoiceDialReport['prototype'][_0x3df4('0x19')]=function(_0x269ac9,_0x12d4c6,_0x508422){io['to'](_0x269ac9)[_0x3df4('0x19')](_0x12d4c6,_0x508422);};VoiceDialReport['prototype'][_0x3df4('0x10')]=function(_0x6a93c8){try{if(this[_0x3df4('0x17')](_0x6a93c8)){logger[_0x3df4('0x1a')](_0x3df4('0x1b'),_0x6a93c8[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x6a93c8,{'showHidden':![],'depth':null}));if(this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]]){_[_0x3df4('0x1e')](this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]],{'starttime':moment()[_0x3df4('0x1f')](_0x3df4('0x20')),'lastevent':_0x3df4('0x21'),'interface':_0x6a93c8[_0x3df4('0x22')][_0x3df4('0x23')](0x0,_0x6a93c8['channel'][_0x3df4('0x24')]('-')),'membername':_0x6a93c8['channel'][_0x3df4('0x23')](_0x6a93c8[_0x3df4('0x22')][_0x3df4('0x24')]('/')+0x1,_0x6a93c8[_0x3df4('0x22')][_0x3df4('0x24')]('-'))},_[_0x3df4('0x25')](_0x6a93c8,[_0x3df4('0x26'),'privilege']));logger['info'](_0x3df4('0x27'),_0x6a93c8[_0x3df4('0x1c')],this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]][_0x3df4('0x28')],this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]][_0x3df4('0x29')]);logger[_0x3df4('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x6a93c8[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x6a93c8[_0x3df4('0x1c')]])_[_0x3df4('0x1e')](this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]],this[_0x3df4('0xd')][_0x6a93c8[_0x3df4('0x1c')]]);this['emit'](_0x3df4('0x2a'),'voice_outbound_channel:save',this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]]);logger[_0x3df4('0x1a')](_0x3df4('0x2b'),_0x6a93c8[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this[_0x3df4('0xa')][_0x6a93c8[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x3df4('0x19')](_0x3df4('0x2c'),this['channels'][_0x6a93c8['uniqueid']]);}}}catch(_0x1a1fb3){logger['error'](_0x3df4('0x2d'),_0x6a93c8[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x1a1fb3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3df4('0x2e')][_0x3df4('0x2f')]=function(_0x53eb5b){try{if(this[_0x3df4('0x17')](_0x53eb5b)){logger[_0x3df4('0x1a')](_0x3df4('0x30'),_0x53eb5b['uniqueid'],util[_0x3df4('0x1d')](_0x53eb5b,{'showHidden':![],'depth':null}));if(this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]]){this[_0x3df4('0xa')][_0x53eb5b['uniqueid']][_0x3df4('0x31')]=_0x53eb5b['dialstatus'];if(_0x53eb5b[_0x3df4('0x31')]===_0x3df4('0x32')){this['channels'][_0x53eb5b['uniqueid']][_0x3df4('0x33')]=_0x53eb5b[_0x3df4('0x33')];this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]][_0x3df4('0x34')]=_0x53eb5b[_0x3df4('0x34')];this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]][_0x3df4('0x35')]=moment()['format'](_0x3df4('0x20'));this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]][_0x3df4('0x36')]=_0x3df4('0x37');logger[_0x3df4('0x38')](_0x3df4('0x39'),_0x53eb5b[_0x3df4('0x1c')],_0x53eb5b[_0x3df4('0x22')][_0x3df4('0x23')](_0x53eb5b['channel'][_0x3df4('0x24')]('/')+0x1,_0x53eb5b[_0x3df4('0x22')]['lastIndexOf']('-')));logger[_0x3df4('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x53eb5b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this['channels'][_0x53eb5b[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x3df4('0x19')](_0x3df4('0x3a'),this[_0x3df4('0xa')][_0x53eb5b['uniqueid']]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x53eb5b[_0x3df4('0x1c')],util['inspect'](this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));this[_0x3df4('0x19')]('voice:outbound',_0x3df4('0x3b'),this[_0x3df4('0xa')][_0x53eb5b[_0x3df4('0x1c')]]);}}}catch(_0x59f88d){logger[_0x3df4('0x3c')](_0x3df4('0x3d'),_0x53eb5b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x59f88d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3df4('0x2e')][_0x3df4('0x13')]=function(_0x147067){try{if(this[_0x3df4('0x17')](_0x147067)){logger[_0x3df4('0x1a')]('[%s][voiceDialReport][varset]\x20event:',_0x147067[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x147067,{'showHidden':![],'depth':null}));this[_0x3df4('0x3e')](_0x147067['uniqueid'],_[_0x3df4('0x3f')](_0x147067['variable'])[0x0],_0x147067[_0x3df4('0x40')]);if(this['isNotNull'](_0x147067[_0x3df4('0x41')])&&this['isNotNull'](_0x147067[_0x3df4('0x41')][_0x3df4('0x42')])){if(_[_0x3df4('0x18')](this[_0x3df4('0xa')][_0x147067[_0x3df4('0x1c')]])){this[_0x3df4('0xa')][_0x147067[_0x3df4('0x1c')]]={'routeId':_0x147067[_0x3df4('0x40')],'variables':this[_0x3df4('0xe')][_0x147067[_0x3df4('0x1c')]],'motionChannel':_0x3df4('0x43')};logger['info'](_0x3df4('0x44'),_0x147067[_0x3df4('0x1c')],_0x147067[_0x3df4('0x41')][_0x3df4('0x42')],_['keys'](_0x147067[_0x3df4('0x41')])[0x0],_0x147067['value']);logger['debug'](_0x3df4('0x45'),_0x147067[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this[_0x3df4('0xa')][_0x147067[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));this[_0x3df4('0x19')](_0x3df4('0x2a'),_0x3df4('0x3b'),this[_0x3df4('0xa')][_0x147067['uniqueid']]);}}}}catch(_0x536873){logger[_0x3df4('0x3c')](_0x3df4('0x46'),_0x147067['uniqueid'],util['inspect'](_0x536873,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3df4('0x2e')][_0x3df4('0x3e')]=function(_0x9b0406,_0x20066c,_0x58f8cf){var _0x5995ba=[_0x3df4('0x47'),_0x3df4('0x48'),_0x3df4('0x49'),'rtpaudioqosjitterbridged',_0x3df4('0x4a'),_0x3df4('0x4b'),_0x3df4('0x4c'),_0x3df4('0x4d'),_0x3df4('0x4e'),_0x3df4('0x4f'),_0x3df4('0x50'),'bridgepvtcallid',_0x3df4('0x51'),_0x3df4('0x52'),_0x3df4('0x53'),_0x3df4('0x54'),_0x3df4('0x28'),'memberpenalty',_0x3df4('0x55')];if(!_['isNil'](_0x20066c)&&!_[_0x3df4('0x56')](_0x5995ba,_0x20066c)){if(_[_0x3df4('0x18')](this[_0x3df4('0xe')][_0x9b0406])){this[_0x3df4('0xe')][_0x9b0406]={};}this[_0x3df4('0xe')][_0x9b0406][_0x20066c]=_0x58f8cf;}};VoiceDialReport[_0x3df4('0x2e')][_0x3df4('0x16')]=function(_0x3cd92b){try{if(this[_0x3df4('0x17')](_0x3cd92b)){logger[_0x3df4('0x1a')](_0x3df4('0x57'),_0x3cd92b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x3cd92b,{'showHidden':![],'depth':null}));if(this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]){logger[_0x3df4('0x38')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x3cd92b['uniqueid'],_0x3cd92b['cause-txt']);this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x58')]=moment(this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x59')])[_0x3df4('0x5a')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x5b')],_0x3df4('0x5c'));this['channels'][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x36')]=_0x3df4('0x5d');this['outbound'][_0x3df4('0x5e')]+=0x1;if(this['channels'][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x35')]){this[_0x3df4('0xc')][_0x3df4('0x5f')]+=0x1;this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x60')]=moment(this['channels'][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x35')])[_0x3df4('0x5a')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x5b')],'seconds');this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x61')]=moment(this['channels'][_0x3cd92b[_0x3df4('0x1c')]]['endtime'])[_0x3df4('0x5a')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]['answertime'],_0x3df4('0x5c'));this[_0x3df4('0xc')]['sumHoldTime']+=this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]['holdtime']||0x0;this[_0x3df4('0xc')]['sumBillable']+=this['channels'][_0x3cd92b[_0x3df4('0x1c')]][_0x3df4('0x61')];}this[_0x3df4('0xc')][_0x3df4('0x62')]+=this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]['duration'];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x3cd92b['uniqueid'],util[_0x3df4('0x1d')](this['channels'][_0x3cd92b['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x3df4('0x19')](_0x3df4('0x63'),this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]);logger[_0x3df4('0x1a')](_0x3df4('0x64'),_0x3cd92b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this['channels'][_0x3cd92b[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x3df4('0x19')](_0x3df4('0x65'),this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]);logger[_0x3df4('0x1a')](_0x3df4('0x66'),_0x3cd92b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x3df4('0x67'),this[_0x3df4('0xc')]);logger['info'](_0x3df4('0x68'),JSON[_0x3df4('0x69')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]));logger[_0x3df4('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x3cd92b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0x3df4('0x2a'),_0x3df4('0x6a'),this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]]);delete this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x1c')]];}else if(this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x6b')]]){this[_0x3df4('0xa')][_0x3cd92b[_0x3df4('0x6b')]][_0x3df4('0x1c')]=this['channels'][_0x3cd92b['linkedid']][_0x3df4('0x6c')];}if(this[_0x3df4('0xe')][_0x3cd92b[_0x3df4('0x1c')]]){delete this[_0x3df4('0xe')][_0x3cd92b['uniqueid']];}}}catch(_0x142995){logger[_0x3df4('0x3c')](_0x3df4('0x6d'),_0x3cd92b[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x142995,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x3df4('0x6e')]=function(_0x31f1db){try{if(this[_0x3df4('0x17')](_0x31f1db)){logger[_0x3df4('0x1a')](_0x3df4('0x6f'),_0x31f1db[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x31f1db,{'showHidden':![],'depth':null}));if(_0x31f1db[_0x3df4('0x70')][_0x3df4('0x71')]()===_0x3df4('0x72')){_0x31f1db[_0x3df4('0x73')]=(_0x31f1db[_0x3df4('0x74')]||_0x31f1db[_0x3df4('0x73')])[_0x3df4('0x71')]();if(_['startsWith'](_0x31f1db[_0x3df4('0x73')],_0x3df4('0x75'))){if(_[_0x3df4('0x18')](this[_0x3df4('0xd')][_0x31f1db[_0x3df4('0x1c')]]))this['applications'][_0x31f1db[_0x3df4('0x1c')]]={};logger['info'](_0x3df4('0x76'),_0x31f1db[_0x3df4('0x1c')],_0x31f1db[_0x3df4('0x70')],_0x31f1db['applicationdata']);var _0x46311b=_0x31f1db[_0x3df4('0x73')][_0x3df4('0x77')]('=');var _0x1c6fd3=_0x46311b[0x0][_0x3df4('0x78')](/cdr\((.*)\)/);if(_0x1c6fd3)this[_0x3df4('0xd')][_0x31f1db[_0x3df4('0x1c')]][_0x1c6fd3[0x1]]=_0x46311b[0x1];}}}}catch(_0x80f7f){logger[_0x3df4('0x3c')]('[%s][voiceDialReport][newexten]',_0x31f1db[_0x3df4('0x1c')],util[_0x3df4('0x1d')](_0x80f7f,{'showHidden':![],'depth':null}));}};module[_0x3df4('0x79')]=VoiceDialReport; \ No newline at end of file +var _0x28fb=['billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice:outbound','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','application','toLowerCase','set','appdata','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','newexten','syncHangup','prototype','isUndefined','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','variable','value','isNotNull','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','isNil','includes','cause-txt','endtime','duration','diff','starttime','seconds','complete','total'];(function(_0x54808c,_0x36e290){var _0xe9459=function(_0x55df21){while(--_0x55df21){_0x54808c['push'](_0x54808c['shift']());}};_0xe9459(++_0x36e290);}(_0x28fb,0x109));var _0xb28f=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x28fb[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0xb28f('0x0'));var moment=require(_0xb28f('0x1'));var util=require('util');var Redis=require(_0xb28f('0x2'));var config=require(_0xb28f('0x3'));var logger=require(_0xb28f('0x4'))('ami');var ami=require('../ami');config[_0xb28f('0x5')]=_[_0xb28f('0x6')](config['redis'],{'host':_0xb28f('0x7'),'port':0x18eb});var io=require(_0xb28f('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x6a478e){this[_0xb28f('0x9')]=_0x6a478e[_0xb28f('0xa')];this[_0xb28f('0xb')]=_0x6a478e['outbound'];this[_0xb28f('0xc')]={};this['variables']={};ami['on'](_0xb28f('0xd'),this[_0xb28f('0xe')][_0xb28f('0xf')](this));ami['on'](_0xb28f('0x10'),this['syncDialEnd'][_0xb28f('0xf')](this));ami['on'](_0xb28f('0x11'),this[_0xb28f('0x12')]['bind'](this));ami['on'](_0xb28f('0x13'),this['syncNewExten'][_0xb28f('0xf')](this));ami['on']('hangup',this[_0xb28f('0x14')][_0xb28f('0xf')](this));}VoiceDialReport[_0xb28f('0x15')]['isNotNull']=function(_0x5c128d){return _0x5c128d!==null&&!_[_0xb28f('0x16')](_0x5c128d);};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x17')]=function(_0x479f47,_0x4f4adc,_0x4f553c){io['to'](_0x479f47)[_0xb28f('0x17')](_0x4f4adc,_0x4f553c);};VoiceDialReport['prototype']['syncDialBegin']=function(_0xee0426){try{if(this['isNotNull'](_0xee0426)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0xee0426[_0xb28f('0x18')],util['inspect'](_0xee0426,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0xee0426['uniqueid']]){_[_0xb28f('0x19')](this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]],{'starttime':moment()[_0xb28f('0x1a')](_0xb28f('0x1b')),'lastevent':_0xb28f('0x1c'),'interface':_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1e')](0x0,_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('-')),'membername':_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1e')](_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('/')+0x1,_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('-'))},_['omit'](_0xee0426,[_0xb28f('0x20'),_0xb28f('0x21')]));logger['info'](_0xb28f('0x22'),_0xee0426[_0xb28f('0x18')],this['channels'][_0xee0426['uniqueid']][_0xb28f('0x23')],this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]][_0xb28f('0x24')]);logger[_0xb28f('0x25')](_0xb28f('0x26'),_0xee0426[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));if(this[_0xb28f('0xc')][_0xee0426[_0xb28f('0x18')]])_[_0xb28f('0x19')](this['channels'][_0xee0426[_0xb28f('0x18')]],this[_0xb28f('0xc')][_0xee0426[_0xb28f('0x18')]]);this['emit']('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0xee0426['uniqueid']]);logger['debug'](_0xb28f('0x29'),_0xee0426['uniqueid'],util['inspect'](this[_0xb28f('0x9')][_0xee0426['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')](_0xb28f('0x2a'),this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]]);}}}catch(_0x4fc3a2){logger[_0xb28f('0x2b')]('[%s][voiceDialReport][dialbegin]',_0xee0426[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x4fc3a2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x2c')]=function(_0xca648b){try{if(this['isNotNull'](_0xca648b)){logger['debug'](_0xb28f('0x2d'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](_0xca648b,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0xca648b['uniqueid']]){this[_0xb28f('0x9')][_0xca648b['uniqueid']][_0xb28f('0x2e')]=_0xca648b['dialstatus'];if(_0xca648b['dialstatus']===_0xb28f('0x2f')){this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x30')]=_0xca648b['connectedlinenum'];this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x31')]=_0xca648b[_0xb28f('0x31')];this['channels'][_0xca648b['uniqueid']][_0xb28f('0x32')]=moment()[_0xb28f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x33')]=_0xb28f('0x34');logger[_0xb28f('0x35')](_0xb28f('0x36'),_0xca648b[_0xb28f('0x18')],_0xca648b['channel']['substring'](_0xca648b['channel']['lastIndexOf']('/')+0x1,_0xca648b[_0xb28f('0x1d')]['lastIndexOf']('-')));logger['debug'](_0xb28f('0x37'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xca648b['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')]('custom:dialconnect',this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]]);}logger[_0xb28f('0x25')](_0xb28f('0x38'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xca648b['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0xca648b['uniqueid']]);}}}catch(_0x57c82e){logger[_0xb28f('0x2b')](_0xb28f('0x39'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x57c82e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x12')]=function(_0x1d63c7){try{if(this['isNotNull'](_0x1d63c7)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][varset]\x20event:',_0x1d63c7[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x1d63c7,{'showHidden':![],'depth':null}));this['addVariable'](_0x1d63c7[_0xb28f('0x18')],_['keys'](_0x1d63c7[_0xb28f('0x3a')])[0x0],_0x1d63c7[_0xb28f('0x3b')]);if(this[_0xb28f('0x3c')](_0x1d63c7[_0xb28f('0x3a')])&&this['isNotNull'](_0x1d63c7[_0xb28f('0x3a')][_0xb28f('0x3d')])){if(_[_0xb28f('0x16')](this['channels'][_0x1d63c7[_0xb28f('0x18')]])){this[_0xb28f('0x9')][_0x1d63c7[_0xb28f('0x18')]]={'routeId':_0x1d63c7['value'],'variables':this[_0xb28f('0x3e')][_0x1d63c7[_0xb28f('0x18')]],'motionChannel':'voice'};logger[_0xb28f('0x35')](_0xb28f('0x3f'),_0x1d63c7[_0xb28f('0x18')],_0x1d63c7[_0xb28f('0x3a')][_0xb28f('0x3d')],_[_0xb28f('0x40')](_0x1d63c7['variable'])[0x0],_0x1d63c7['value']);logger[_0xb28f('0x25')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1d63c7[_0xb28f('0x18')],util[_0xb28f('0x27')](this['channels'][_0x1d63c7[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));this[_0xb28f('0x17')]('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0x1d63c7[_0xb28f('0x18')]]);}}}}catch(_0x2f0444){logger[_0xb28f('0x2b')](_0xb28f('0x41'),_0x1d63c7['uniqueid'],util[_0xb28f('0x27')](_0x2f0444,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb28f('0x42')]=function(_0x276992,_0x4f4c58,_0xfd1c6e){var _0x16674c=[_0xb28f('0x43'),_0xb28f('0x44'),_0xb28f('0x45'),_0xb28f('0x46'),_0xb28f('0x47'),_0xb28f('0x48'),_0xb28f('0x49'),_0xb28f('0x4a'),_0xb28f('0x4b'),_0xb28f('0x4c'),_0xb28f('0x4d'),_0xb28f('0x4e'),_0xb28f('0x4f'),'memberdynamic',_0xb28f('0x50'),'memberlastcall',_0xb28f('0x23'),_0xb28f('0x51'),'memberrealtime'];if(!_[_0xb28f('0x52')](_0x4f4c58)&&!_[_0xb28f('0x53')](_0x16674c,_0x4f4c58)){if(_[_0xb28f('0x16')](this[_0xb28f('0x3e')][_0x276992])){this['variables'][_0x276992]={};}this[_0xb28f('0x3e')][_0x276992][_0x4f4c58]=_0xfd1c6e;}};VoiceDialReport[_0xb28f('0x15')]['syncHangup']=function(_0x44e6ea){try{if(this[_0xb28f('0x3c')](_0x44e6ea)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][hangup]\x20event:',_0x44e6ea[_0xb28f('0x18')],util['inspect'](_0x44e6ea,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']]){logger[_0xb28f('0x35')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x44e6ea[_0xb28f('0x18')],_0x44e6ea[_0xb28f('0x54')]);this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x55')]=moment()[_0xb28f('0x1a')](_0xb28f('0x1b'));this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x56')]=moment(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x55')])[_0xb28f('0x57')](this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x58')],_0xb28f('0x59'));this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x33')]=_0xb28f('0x5a');this[_0xb28f('0xb')][_0xb28f('0x5b')]+=0x1;if(this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x32')]){this[_0xb28f('0xb')]['answered']+=0x1;this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]['holdtime']=moment(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x32')])[_0xb28f('0x57')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x58')],_0xb28f('0x59'));this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x5c')]=moment(this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x55')])[_0xb28f('0x57')](this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x32')],_0xb28f('0x59'));this['outbound'][_0xb28f('0x5d')]+=this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x5e')]||0x0;this[_0xb28f('0xb')][_0xb28f('0x5f')]+=this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x5c')];}this['outbound'][_0xb28f('0x60')]+=this['channels'][_0x44e6ea['uniqueid']]['duration'];logger[_0xb28f('0x25')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')](_0xb28f('0x61'),this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]);logger['debug'](_0xb28f('0x62'),_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb28f('0x63'),this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]);logger['debug'](_0xb28f('0x64'),_0x44e6ea['uniqueid'],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xb28f('0x65'),this[_0xb28f('0xb')]);logger[_0xb28f('0x35')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xb28f('0x66')](this['channels'][_0x44e6ea[_0xb28f('0x18')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));this[_0xb28f('0x17')](_0xb28f('0x67'),_0xb28f('0x68'),this[_0xb28f('0x9')][_0x44e6ea['uniqueid']]);delete this['channels'][_0x44e6ea[_0xb28f('0x18')]];}else if(this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x69')]]){this[_0xb28f('0x9')][_0x44e6ea['linkedid']][_0xb28f('0x18')]=this[_0xb28f('0x9')][_0x44e6ea['linkedid']][_0xb28f('0x6a')];}if(this['variables'][_0x44e6ea[_0xb28f('0x18')]]){delete this['variables'][_0x44e6ea[_0xb28f('0x18')]];}}}catch(_0x186d2d){logger['error'](_0xb28f('0x6b'),_0x44e6ea['uniqueid'],util[_0xb28f('0x27')](_0x186d2d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb28f('0x6c')]=function(_0x1c493a){try{if(this[_0xb28f('0x3c')](_0x1c493a)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][newexten]\x20event:',_0x1c493a['uniqueid'],util['inspect'](_0x1c493a,{'showHidden':![],'depth':null}));if(_0x1c493a[_0xb28f('0x6d')][_0xb28f('0x6e')]()===_0xb28f('0x6f')){_0x1c493a['applicationdata']=(_0x1c493a[_0xb28f('0x70')]||_0x1c493a[_0xb28f('0x71')])[_0xb28f('0x6e')]();if(_['startsWith'](_0x1c493a['applicationdata'],_0xb28f('0x72'))){if(_['isUndefined'](this[_0xb28f('0xc')][_0x1c493a[_0xb28f('0x18')]]))this['applications'][_0x1c493a[_0xb28f('0x18')]]={};logger[_0xb28f('0x35')](_0xb28f('0x73'),_0x1c493a[_0xb28f('0x18')],_0x1c493a['application'],_0x1c493a[_0xb28f('0x71')]);var _0x4bc433=_0x1c493a[_0xb28f('0x71')]['split']('=');var _0x58530a=_0x4bc433[0x0][_0xb28f('0x74')](/cdr\((.*)\)/);if(_0x58530a)this[_0xb28f('0xc')][_0x1c493a[_0xb28f('0x18')]][_0x58530a[0x1]]=_0x4bc433[0x1];}}}}catch(_0x3b6eae){logger['error'](_0xb28f('0x75'),_0x1c493a['uniqueid'],util['inspect'](_0x3b6eae,{'showHidden':![],'depth':null}));}};module[_0xb28f('0x76')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index b163971..23a8bab 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8721=['syncQueueSummary','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentConnect','varset','syncHangup','fullybooted','syncFullyBooted','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','clearZombieChannels','switch','enqueue','isNil','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','format','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','available','sumBillable','sumHoldTime','talking','unmanaged','waiting','Trunk','active','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','loggedin','emitVoiceQueueSummary','syncQueueSummaryComplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','startsWith','channel','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','variable','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','value','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','length','abandoned','diff','sumDuration','total','milliseconds','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','secondtransfereruniqueid','transfereeuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','../../../config/environment','../model/queueReport','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x8721,0xd9));var _0x1872=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x8721[_0x58965a];return _0x254efc;};'use strict';var _=require(_0x1872('0x0'));var moment=require(_0x1872('0x1'));var util=require(_0x1872('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x1872('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require(_0x1872('0x4'));config[_0x1872('0x5')]=_[_0x1872('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1872('0x7'))(new Redis(config[_0x1872('0x5')]));var Sequence=function(){};Sequence[_0x1872('0x8')]['enqueue']=function(_0x2aaad6){this[_0x1872('0x9')]=this[_0x1872('0x9')]?this[_0x1872('0x9')][_0x1872('0xa')](_0x2aaad6):_0x2aaad6();};function VoiceQueueReport(_0x1b057e){this[_0x1872('0xb')]=new Sequence();this[_0x1872('0xc')]={};this[_0x1872('0xd')]=_0x1b057e[_0x1872('0xd')];this[_0x1872('0xe')]=_0x1b057e['queueChannels'];this[_0x1872('0xf')]=_0x1b057e[_0x1872('0xf')];this[_0x1872('0x10')]=!![];this[_0x1872('0x11')]=_0x1b057e['campaigns'];this[_0x1872('0x12')]={};ami['on'](_0x1872('0x13'),this[_0x1872('0x14')][_0x1872('0x15')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0x1872('0x15')](this));ami['on'](_0x1872('0x16'),this[_0x1872('0x17')][_0x1872('0x15')](this));ami['on'](_0x1872('0x18'),this[_0x1872('0x19')]['bind'](this));ami['on']('queuecallerleave',this[_0x1872('0x1a')][_0x1872('0x15')](this));ami['on'](_0x1872('0x1b'),this['syncAgentComplete'][_0x1872('0x15')](this));ami['on']('agentconnect',this[_0x1872('0x1c')][_0x1872('0x15')](this));ami['on'](_0x1872('0x1d'),this['syncVarSet'][_0x1872('0x15')](this));ami['on']('hangup',this[_0x1872('0x1e')][_0x1872('0x15')](this));ami['on'](_0x1872('0x1f'),this[_0x1872('0x20')][_0x1872('0x15')](this));ami['on']('newexten',this[_0x1872('0x21')][_0x1872('0x15')](this));ami['on'](_0x1872('0x22'),this[_0x1872('0x23')][_0x1872('0x15')](this));ami['on'](_0x1872('0x24'),this[_0x1872('0x25')][_0x1872('0x15')](this));ami['on'](_0x1872('0x26'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x1872('0x27')][_0x1872('0x15')](this));this[_0x1872('0x28')]();this[_0x1872('0x29')]();}function clearChannels(_0x4d480d){if(!_[_0x1872('0x2a')](_0x4d480d)){for(var _0x2ac6b8 in _0x4d480d){if(_0x4d480d[_0x1872('0x2b')](_0x2ac6b8)){delete _0x4d480d[_0x2ac6b8];}}}}function clearCampaigns(_0x588fc1){if(!_[_0x1872('0x2a')](_0x588fc1)){for(var _0x576efa in _0x588fc1){if(_0x588fc1[_0x1872('0x2b')](_0x576efa)){_0x588fc1[_0x576efa][_0x1872('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x38a335){if(!_['isEmpty'](_0x38a335)){for(var _0x430b95 in _0x38a335){if(_0x38a335[_0x1872('0x2b')](_0x430b95)){_0x38a335[_0x430b95]['originated']=0x0;_0x38a335[_0x430b95]['talking']=0x0;_0x38a335[_0x430b95][_0x1872('0x2d')]=0x0;_0x38a335[_0x430b95]['waiting']=0x0;_0x38a335[_0x430b95]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x333961){if(!_['isEmpty'](_0x333961)){for(var _0x3f2779 in _0x333961){if(_0x333961[_0x1872('0x2b')](_0x3f2779)){_0x333961[_0x3f2779]['unlockRR']=!![];}}}}VoiceQueueReport[_0x1872('0x8')][_0x1872('0x2e')]=function(){var _0x30ad4f=this;for(var _0x558234 in this[_0x1872('0xe')]){if(this[_0x1872('0xe')][_0x1872('0x2b')](_0x558234)&&!this[_0x1872('0xe')][_0x558234][_0x1872('0x2f')]){this['sequence'][_0x1872('0x30')](function(){if(!_[_0x1872('0x31')](_0x30ad4f[_0x1872('0xe')][_0x558234])){return ami[_0x1872('0x32')]({'action':_0x1872('0x33'),'channel':_0x30ad4f[_0x1872('0xe')][_0x558234]['channel']})[_0x1872('0x34')](function(_0x39aa77){if(_0x39aa77[_0x1872('0x35')]===_0x1872('0x36')){setTimeout(function(){if(_0x30ad4f[_0x1872('0xe')][_0x558234]){delete _0x30ad4f[_0x1872('0xe')][_0x558234];logger[_0x1872('0x37')](_0x1872('0x38'),_0x558234,util['inspect'](_0x39aa77,{'showHidden':![],'depth':null}));}if(_0x30ad4f['queueReports'][_0x558234]){delete _0x30ad4f[_0x1872('0xc')][_0x558234];logger[_0x1872('0x37')](_0x1872('0x39'),_0x558234,util[_0x1872('0x3a')](_0x39aa77,{'showHidden':![],'depth':null}));}if(_0x30ad4f[_0x1872('0x12')][_0x558234]){delete _0x30ad4f[_0x1872('0x12')][_0x558234];logger['error'](_0x1872('0x3b'),_0x558234,util[_0x1872('0x3a')](_0x39aa77,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger['error'](_0x1872('0x3c'));clearChannels(this[_0x1872('0xe')]);this[_0x1872('0x3d')](this['queueReports']);clearAgentBooked(this[_0x1872('0xd')]);clearVoiceQueues(this[_0x1872('0xf')]);clearCampaigns(this[_0x1872('0x11')]);};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x3d')]=function(_0x290ff5){var _0x4c6c11=this;if(!_[_0x1872('0x2a')](_0x290ff5)){for(var _0x3c6e8b in _0x290ff5){if(_0x290ff5[_0x1872('0x2b')](_0x3c6e8b)){_0x4c6c11[_0x1872('0x3e')](_0x290ff5[_0x3c6e8b],_0x1872('0x3f'));delete _0x290ff5[_0x3c6e8b];}}}};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x40')]=function(_0x2ba9a4,_0x54cf1c,_0x2019f3){io['to'](_0x2ba9a4)[_0x1872('0x40')](_0x54cf1c,_0x2019f3);};VoiceQueueReport[_0x1872('0x8')]['emitVoiceQueueChannelSave']=function(_0x1b0b19,_0x12d9f9){logger['debug'](_0x1872('0x41')+_0x12d9f9+_0x1872('0x42'),_0x1b0b19[_0x1872('0x43')],util[_0x1872('0x3a')](_0x1b0b19,{'showHidden':![],'depth':null}));this[_0x1872('0x40')](util['format'](_0x1872('0x44'),_0x1b0b19[_0x1872('0x45')]),_0x1872('0x46'),_0x1b0b19);io['emit'](_0x1872('0x47'),_0x1b0b19);};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x3e')]=function(_0x36527d,_0x38b60e){logger[_0x1872('0x48')](_0x1872('0x41')+_0x38b60e+_0x1872('0x49'),_0x36527d[_0x1872('0x43')],util['inspect'](_0x36527d,{'showHidden':![],'depth':null}));this[_0x1872('0x40')](util[_0x1872('0x4a')](_0x1872('0x44'),_0x36527d[_0x1872('0x45')]),_0x1872('0x4b'),_0x36527d);io[_0x1872('0x40')](_0x1872('0x4c'),_0x36527d);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x42618f,_0x135c8b){if(_0x42618f[_0x1872('0x4d')]===_0x1872('0x4e')){var _0x583833={'id':_0x42618f['id'],'name':_0x42618f['name'],'strategy':_0x42618f['strategy'],'answered':_0x42618f['answered'],'available':_0x42618f[_0x1872('0x4f')],'loggedIn':_0x42618f['loggedIn'],'pTalking':_0x42618f[_0x1872('0x2d')],'sumBillable':_0x42618f[_0x1872('0x50')],'sumDuration':_0x42618f['sumDuration'],'sumHoldTime':_0x42618f[_0x1872('0x51')]||0x0,'talking':_0x42618f[_0x1872('0x52')],'total':_0x42618f['total'],'type':_0x42618f[_0x1872('0x4d')],'unmanaged':_0x42618f[_0x1872('0x53')],'abandoned':_0x42618f['abandoned'],'waiting':_0x42618f[_0x1872('0x54')]};if(_0x42618f[_0x1872('0x55')]){_0x583833[_0x1872('0x55')]={'id':_0x42618f[_0x1872('0x55')]['id'],'name':_0x42618f[_0x1872('0x55')][_0x1872('0x45')],'active':_0x42618f[_0x1872('0x55')][_0x1872('0x56')],'callerid':_0x42618f['Trunk']['callerid']};}if(_0x42618f[_0x1872('0x57')]){_0x583833[_0x1872('0x57')]={'id':_0x42618f[_0x1872('0x57')]['id'],'name':_0x42618f['Interval'][_0x1872('0x45')]};}var _0x21d16a=md5(JSON[_0x1872('0x58')](_0x583833));if(_0x42618f[_0x1872('0x59')]!==_0x21d16a){_0x42618f[_0x1872('0x59')]=_0x21d16a;logger['debug'](_0x1872('0x5a')+_0x135c8b+_0x1872('0x5b'),util[_0x1872('0x3a')](_0x583833,{'showHidden':![],'depth':null}));this[_0x1872('0x40')](util[_0x1872('0x4a')]('voice:queue:%s',_0x583833[_0x1872('0x45')]),_0x1872('0x5c'),_0x583833);}}};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x5d')]=function(_0x25244a){return _0x25244a!==null&&!_[_0x1872('0x5e')](_0x25244a);};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x29')]=function(){var _0x3528b6=this;setInterval(function(){_0x3528b6['clearZombieChannels']();ami[_0x1872('0x32')]({'action':_0x1872('0x5f')})[_0x1872('0x34')](function(_0x17a80b){logger[_0x1872('0x37')](_0x1872('0x60'),util[_0x1872('0x3a')](_0x17a80b,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x2a5bca=this;setInterval(function(){if(_0x2a5bca[_0x1872('0x10')]){return ami[_0x1872('0x32')]({'action':'queuesummary'})[_0x1872('0x61')](function(_0x470ef9){_0x2a5bca[_0x1872('0x10')]=![];})[_0x1872('0x34')](function(_0x25c4e7){logger[_0x1872('0x37')](_0x1872('0x62'),util[_0x1872('0x3a')](_0x25c4e7,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x1872('0x14')]=function(_0x512300){try{if(this[_0x1872('0x5d')](_0x512300)&&this[_0x1872('0x5d')](_0x512300[_0x1872('0x63')])){logger['debug'](_0x1872('0x64'),util['inspect'](_0x512300,{'showHidden':![],'depth':null}));if(this[_0x1872('0xf')][_0x512300['queue']]){logger['info'](_0x1872('0x65'),_0x512300[_0x1872('0x63')]);var _0x17d16c=_[_0x1872('0x66')](this['channels'],_0x1872('0x63'))[_0x512300[_0x1872('0x63')]]||0x0;var _0x341209=_0x17d16c-_0x512300[_0x1872('0x67')];if(this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x54')]!==_[_0x1872('0x68')](_0x512300[_0x1872('0x67')])||this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x69')]!==_[_0x1872('0x68')](_0x512300[_0x1872('0x6a')])||this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x4f')]!==_[_0x1872('0x68')](_0x512300[_0x1872('0x4f')])||this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x52')]!==_0x341209){this[_0x1872('0xf')][_0x512300['queue']][_0x1872('0x54')]=_['toNumber'](_0x512300[_0x1872('0x67')]);this['voiceQueues'][_0x512300['queue']][_0x1872('0x69')]=_[_0x1872('0x68')](_0x512300[_0x1872('0x6a')]);this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]]['available']=_[_0x1872('0x68')](_0x512300[_0x1872('0x4f')]);this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x52')]=_0x341209>0x0?_0x341209:0x0;this['voiceQueues'][_0x512300[_0x1872('0x63')]]['talking']=this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]][_0x1872('0x52')]>_[_0x1872('0x68')](_0x512300[_0x1872('0x6a')])?_[_0x1872('0x68')](_0x512300[_0x1872('0x6a')]):this[_0x1872('0xf')][_0x512300['queue']][_0x1872('0x52')];this[_0x1872('0x6b')](this['voiceQueues'][_0x512300[_0x1872('0x63')]],'queuesummary');}logger[_0x1872('0x48')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x1872('0x3a')](this[_0x1872('0xf')][_0x512300[_0x1872('0x63')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x512300[_0x1872('0x63')]]);}}}catch(_0x5d1574){logger['error'](_0x1872('0x62'),util[_0x1872('0x3a')](_0x5d1574,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x6c')]=function(_0x149470){logger[_0x1872('0x48')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x1872('0x3a')](_0x149470,{'showHidden':![],'depth':null}));this[_0x1872('0x10')]=!![];};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x17')]=function(_0x10f52d){try{if(this[_0x1872('0x5d')](_0x10f52d)){logger[_0x1872('0x48')](_0x1872('0x6d'),_0x10f52d[_0x1872('0x43')],util[_0x1872('0x3a')](_0x10f52d,{'showHidden':![],'depth':null}));if(_[_0x1872('0x5e')](this[_0x1872('0xc')][_0x10f52d[_0x1872('0x43')]]))this[_0x1872('0xc')][_0x10f52d[_0x1872('0x43')]]=[];if(_[_0x1872('0x5e')](this[_0x1872('0xe')][_0x10f52d['uniqueid']]))this['channels'][_0x10f52d[_0x1872('0x43')]]={};var _0x308783=new QueueReport();_0x308783[_0x1872('0x45')]=_0x10f52d['queue'];_0x308783[_0x1872('0x4d')]=this['voiceQueues'][_0x308783['name']]&&this[_0x1872('0xf')][_0x308783['name']][_0x1872('0x4d')]?this['voiceQueues'][_0x308783[_0x1872('0x45')]]['type']||_0x1872('0x4e'):_0x1872('0x4e');_0x308783[_0x1872('0x63')]=_0x10f52d[_0x1872('0x63')];_0x308783[_0x1872('0x6e')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));_0x308783[_0x1872('0x70')]=_0x10f52d[_0x1872('0x70')];_0x308783['count']=_0x10f52d[_0x1872('0x71')];_0x308783[_0x1872('0x43')]=_0x10f52d[_0x1872('0x43')];_0x308783[_0x1872('0x72')]=this[_0x1872('0xe')][_0x10f52d[_0x1872('0x43')]][_0x1872('0x72')];logger[_0x1872('0x73')](_0x1872('0x74'),_0x308783[_0x1872('0x45')],_0x308783[_0x1872('0x4d')]);_[_0x1872('0x75')](_0x308783,_[_0x1872('0x76')](_0x10f52d,_[_0x1872('0x77')](_0x308783)));this['queueReports'][_0x10f52d['uniqueid']]['push'](_0x308783);this[_0x1872('0xe')][_0x10f52d['uniqueid']]=_0x308783;this[_0x1872('0x78')](_0x308783,_0x1872('0x16'));}}catch(_0x3f5f03){logger[_0x1872('0x37')]('[%s][voiceQueueReport][queuecallerjoin]',_0x10f52d[_0x1872('0x43')],util[_0x1872('0x3a')](_0x3f5f03,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')]['syncQueueCallerAbandon']=function(_0x2619bb){try{if(this['isNotNull'](_0x2619bb)){logger[_0x1872('0x48')](_0x1872('0x79'),_0x2619bb[_0x1872('0x43')],util[_0x1872('0x3a')](_0x2619bb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2619bb['uniqueid']]){var _0xc2360e=_[_0x1872('0x7a')](this[_0x1872('0xc')][_0x2619bb[_0x1872('0x43')]]);_0xc2360e['queuecallercomplete']=![];_0xc2360e['queuecallercompleteAt']=null;_0xc2360e[_0x1872('0x7b')]=_0x2619bb[_0x1872('0x7b')];_0xc2360e[_0x1872('0x7c')]=_0x2619bb[_0x1872('0x7c')];_0xc2360e[_0x1872('0x18')]=!![];_0xc2360e[_0x1872('0x7d')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));_0xc2360e[_0x1872('0x7e')]=_0x1872('0x7f');_0xc2360e[_0x1872('0x80')]=null;logger[_0x1872('0x73')](_0x1872('0x81'),_0xc2360e[_0x1872('0x45')],_0xc2360e[_0x1872('0x4d')]);this[_0x1872('0xe')][_0x2619bb['uniqueid']]=_0xc2360e;this[_0x1872('0x3e')](_0xc2360e,_0x1872('0x18'));}}}catch(_0x169eb6){logger[_0x1872('0x37')](_0x1872('0x79'),_0x2619bb[_0x1872('0x43')],util[_0x1872('0x3a')](_0x169eb6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1872('0x1a')]=function(_0x49e86b){try{if(this[_0x1872('0x5d')](_0x49e86b)){logger['debug'](_0x1872('0x82'),_0x49e86b['uniqueid'],util[_0x1872('0x3a')](_0x49e86b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x49e86b[_0x1872('0x43')]]){var _0x59abd0=_[_0x1872('0x7a')](this[_0x1872('0xc')][_0x49e86b['uniqueid']]);_0x59abd0[_0x1872('0x83')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));_0x59abd0[_0x1872('0x84')]=_0x49e86b[_0x1872('0x84')];_0x59abd0['connectedlinename']=_0x49e86b[_0x1872('0x85')];logger[_0x1872('0x73')](_0x1872('0x86'),_0x59abd0[_0x1872('0x45')],_0x59abd0[_0x1872('0x4d')],_0x49e86b['connectedlinenum'],_0x49e86b['connectedlinename']);this[_0x1872('0xe')][_0x49e86b['uniqueid']]=_0x59abd0;this['emitVoiceQueueChannelSave'](_0x59abd0,_0x1872('0x87'));}}}catch(_0x8cecba){logger[_0x1872('0x37')]('[%s][voiceQueueReport][queuecallerleave]',_0x49e86b[_0x1872('0x43')],util[_0x1872('0x3a')](_0x8cecba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')][_0x1872('0x1c')]=function(_0x892788){try{if(this[_0x1872('0x5d')](_0x892788)){logger[_0x1872('0x48')](_0x1872('0x88'),_0x892788[_0x1872('0x43')],util[_0x1872('0x3a')](_0x892788,{'showHidden':![],'depth':null}));if(this[_0x1872('0xc')][_0x892788['uniqueid']]){var _0x5c299c=_[_0x1872('0x7a')](this[_0x1872('0xc')][_0x892788['uniqueid']]);_0x5c299c[_0x1872('0x89')]=!![];_0x5c299c['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x1872('0x73')](_0x1872('0x8a'),_0x5c299c[_0x1872('0x45')],_0x5c299c[_0x1872('0x4d')]);}}}catch(_0x39ea27){logger[_0x1872('0x37')](_0x1872('0x88'),_0x892788['uniqueid'],util[_0x1872('0x3a')](_0x39ea27,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')]['syncAgentComplete']=function(_0x24b51c){try{if(this[_0x1872('0x5d')](_0x24b51c)){logger[_0x1872('0x48')](_0x1872('0x8b'),_0x24b51c['uniqueid'],util[_0x1872('0x3a')](_0x24b51c,{'showHidden':![],'depth':null}));if(this[_0x1872('0xc')][_0x24b51c['uniqueid']]){var _0x16b10e=_[_0x1872('0x7a')](this['queueReports'][_0x24b51c['uniqueid']]);_0x16b10e['queuecallerabandon']=![];_0x16b10e['queuecallerabandonAt']=null;_0x16b10e[_0x1872('0x8c')]=!![];_0x16b10e[_0x1872('0x80')]=_0x24b51c[_0x1872('0x8d')];_0x16b10e[_0x1872('0x7b')]=_0x24b51c['holdtime'];_0x16b10e[_0x1872('0x89')]=!![];_0x16b10e['queuecallerexit']=![];_0x16b10e[_0x1872('0x8e')]=null;if(!_0x16b10e[_0x1872('0x8f')]){if(_0x24b51c['reason']==_0x1872('0x8f')){_0x16b10e['queuecallerexitreason']='COMPLETED';logger[_0x1872('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x16b10e[_0x1872('0x45')],_0x16b10e[_0x1872('0x4d')]);}else{if(_[_0x1872('0x90')](_0x24b51c[_0x1872('0x91')][_0x1872('0x92')](),_0x1872('0x93'))){if(this[_0x1872('0xc')][_0x24b51c[_0x1872('0x94')]]){var _0x3e363d=_['last'](this[_0x1872('0xc')][_0x24b51c[_0x1872('0x94')]]);_0x3e363d[_0x1872('0x89')]=![];_0x3e363d[_0x1872('0x95')]=!![];_0x3e363d[_0x1872('0x8e')]=moment(_0x16b10e[_0x1872('0x6e')])[_0x1872('0x96')](_0x24b51c['holdtime'],_0x1872('0x97'))[_0x1872('0x4a')](_0x1872('0x6f'));_0x3e363d[_0x1872('0x7e')]='FORWARDTRANSFER';_0x3e363d[_0x1872('0x8f')]=!![];_0x3e363d[_0x1872('0x98')]=_0x1872('0x99');_0x3e363d[_0x1872('0x9a')]=_0x24b51c[_0x1872('0x9b')];_0x3e363d[_0x1872('0x9c')]=_0x24b51c['uniqueid'];logger[_0x1872('0x73')](_0x1872('0x9d'),_0x3e363d[_0x1872('0x45')],_0x3e363d[_0x1872('0x4d')]);var _0x101e15=this['queueReports'][_0x24b51c['linkedid']];this[_0x1872('0xc')][_0x24b51c['linkedid']]=this[_0x1872('0xc')][_0x24b51c[_0x1872('0x43')]];this['queueReports'][_0x24b51c[_0x1872('0x43')]]=_0x101e15;}}else{_0x16b10e[_0x1872('0x7e')]=_0x1872('0x9e')+_0x24b51c[_0x1872('0x9f')]['toUpperCase']();logger[_0x1872('0x73')](_0x1872('0xa0'),_0x16b10e[_0x1872('0x45')],_0x16b10e[_0x1872('0x4d')],_0x16b10e[_0x1872('0x7e')]);}}}this['channels'][_0x24b51c[_0x1872('0x43')]]=_0x16b10e;this[_0x1872('0x3e')](_0x16b10e,_0x1872('0x1b'));}}}catch(_0x339307){logger[_0x1872('0x37')](_0x1872('0x8b'),_0x24b51c[_0x1872('0x43')],util[_0x1872('0x3a')](_0x339307,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')]['syncVarSet']=function(_0x5f5c35){try{if(this['isNotNull'](_0x5f5c35)){logger[_0x1872('0x48')](_0x1872('0xa1'),_0x5f5c35['uniqueid'],util[_0x1872('0x3a')](_0x5f5c35,{'showHidden':![],'depth':null}));this['addVariable'](_0x5f5c35[_0x1872('0x43')],_['keys'](_0x5f5c35[_0x1872('0xa2')])[0x0],_0x5f5c35['value']);if(this['queueReports'][_0x5f5c35[_0x1872('0x43')]]){var _0x50f4ec=_[_0x1872('0x7a')](this[_0x1872('0xc')][_0x5f5c35[_0x1872('0x43')]]);if(_0x50f4ec){if(this[_0x1872('0x5d')](_0x5f5c35[_0x1872('0xa2')])&&this[_0x1872('0x5d')](_0x5f5c35[_0x1872('0xa2')]['queuestatus'])){switch(_0x5f5c35['value']){case _0x1872('0xa3'):_0x50f4ec[_0x1872('0x95')]=![];_0x50f4ec[_0x1872('0x8e')]=null;break;case _0x1872('0xa4'):_0x50f4ec[_0x1872('0xa5')]=_0x1872('0xa6');_0x50f4ec[_0x1872('0x95')]=!![];_0x50f4ec[_0x1872('0x8e')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));_0x50f4ec[_0x1872('0x83')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));logger['debug'](_0x1872('0xa7'),_0x5f5c35[_0x1872('0x43')],util['inspect'](_0x50f4ec,{'showHidden':![],'depth':null}));ami[_0x1872('0x40')](_0x1872('0xa8'),_0x50f4ec);break;default:_0x50f4ec[_0x1872('0x95')]=!![];_0x50f4ec[_0x1872('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x50f4ec['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x50f4ec[_0x1872('0x18')]=![];_0x50f4ec[_0x1872('0x7d')]=null;_0x50f4ec[_0x1872('0x7e')]=_0x5f5c35[_0x1872('0xa9')];this[_0x1872('0xe')][_0x5f5c35[_0x1872('0x43')]]=_0x50f4ec;this['emitVoiceQueueChannelRemove'](_0x50f4ec,'varset');}else if(this['isNotNull'](_0x5f5c35[_0x1872('0xa2')])&&this['isNotNull'](_0x5f5c35[_0x1872('0xa2')][_0x1872('0xaa')])){if(!_0x50f4ec[_0x1872('0x18')]){_0x50f4ec[_0x1872('0x95')]=!![];_0x50f4ec[_0x1872('0x8e')]=moment()[_0x1872('0x4a')](_0x1872('0x6f'));_0x50f4ec[_0x1872('0x7e')]=_0x1872('0xab');_0x50f4ec['queuecallerleaveAt']=moment()[_0x1872('0x4a')](_0x1872('0x6f'));this[_0x1872('0xe')][_0x5f5c35[_0x1872('0x43')]]=_0x50f4ec;}}logger['info'](_0x1872('0xac'),_0x5f5c35['uniqueid'],_0x50f4ec[_0x1872('0x45')],_0x50f4ec[_0x1872('0x4d')],_[_0x1872('0x77')](_0x5f5c35['variable'])[0x0],_0x5f5c35['value']);_0x50f4ec['variables']=this[_0x1872('0x12')][_0x5f5c35[_0x1872('0x43')]];}}}}catch(_0x4a853a){logger[_0x1872('0x37')](_0x1872('0xa1'),_0x5f5c35[_0x1872('0x43')],util['inspect'](_0x4a853a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1872('0x8')][_0x1872('0xad')]=function(_0x58370f,_0x4e79fc,_0x1ebbf0){var _0x37b7af=[_0x1872('0xae'),_0x1872('0xaf'),_0x1872('0xb0'),'rtpaudioqosjitterbridged',_0x1872('0xb1'),'rtpaudioqoslossbridged',_0x1872('0xb2'),_0x1872('0xb3'),_0x1872('0xb4'),_0x1872('0xb5'),_0x1872('0xb6'),_0x1872('0xb7'),_0x1872('0xb8'),_0x1872('0xb9'),_0x1872('0xba'),_0x1872('0xbb'),'membername',_0x1872('0xbc'),_0x1872('0xbd')];if(!_[_0x1872('0x31')](_0x4e79fc)&&!_[_0x1872('0xbe')](_0x37b7af,_0x4e79fc)){if(_[_0x1872('0x5e')](this['variables'][_0x58370f])){this[_0x1872('0x12')][_0x58370f]={};}this[_0x1872('0x12')][_0x58370f][_0x4e79fc]=_0x1ebbf0;}};VoiceQueueReport['prototype']['syncHangup']=function(_0xc027ac){try{if(this[_0x1872('0x5d')](_0xc027ac)){logger[_0x1872('0x48')]('[%s][voiceQueueReport][hangup]',_0xc027ac[_0x1872('0x43')],util[_0x1872('0x3a')](_0xc027ac,{'showHidden':![],'depth':null}));if(this[_0x1872('0xc')][_0xc027ac[_0x1872('0x43')]]){for(var _0x164500=0x0,_0x1a7725={};_0x1645000x0?_0x5aee92:0x0;this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x59')]=this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x59')]>_[_0xca0b('0x6d')](_0x36feaa['loggedin'])?_['toNumber'](_0x36feaa['loggedin']):this['voiceQueues'][_0x36feaa['queue']][_0xca0b('0x59')];this[_0xca0b('0x53')](this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]],_0xca0b('0x70'));}logger[_0xca0b('0x61')](_0xca0b('0x71'),util[_0xca0b('0x43')](this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xca0b('0x72'),this['voiceQueues'][_0x36feaa[_0xca0b('0x6b')]]);}}}catch(_0x4c0b99){logger[_0xca0b('0x3f')](_0xca0b('0x69'),util['inspect'](_0x4c0b99,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xca0b('0x73')]=function(_0x3f3d28){logger[_0xca0b('0x61')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xca0b('0x43')](_0x3f3d28,{'showHidden':![],'depth':null}));this[_0xca0b('0x15')]=!![];};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x1c')]=function(_0x541ba4){try{if(this[_0xca0b('0x64')](_0x541ba4)){logger['debug'](_0xca0b('0x74'),_0x541ba4['uniqueid'],util[_0xca0b('0x43')](_0x541ba4,{'showHidden':![],'depth':null}));if(_[_0xca0b('0x65')](this['queueReports'][_0x541ba4[_0xca0b('0x51')]]))this[_0xca0b('0x41')][_0x541ba4['uniqueid']]=[];if(_[_0xca0b('0x65')](this[_0xca0b('0x12')][_0x541ba4[_0xca0b('0x51')]]))this['channels'][_0x541ba4[_0xca0b('0x51')]]={};var _0x462908=new QueueReport();_0x462908[_0xca0b('0x4f')]=_0x541ba4['queue'];_0x462908[_0xca0b('0x5b')]=this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]]&&this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]][_0xca0b('0x5b')]?this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]][_0xca0b('0x5b')]||_0xca0b('0x54'):_0xca0b('0x54');_0x462908[_0xca0b('0x6b')]=_0x541ba4[_0xca0b('0x6b')];_0x462908[_0xca0b('0x75')]=moment()[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x462908[_0xca0b('0x76')]=_0x541ba4[_0xca0b('0x76')];_0x462908[_0xca0b('0x77')]=_0x541ba4[_0xca0b('0x77')];_0x462908[_0xca0b('0x51')]=_0x541ba4[_0xca0b('0x51')];_0x462908[_0xca0b('0x78')]=this[_0xca0b('0x12')][_0x541ba4['uniqueid']][_0xca0b('0x78')];logger[_0xca0b('0x79')](_0xca0b('0x7a'),_0x462908[_0xca0b('0x4f')],_0x462908[_0xca0b('0x5b')]);_[_0xca0b('0x7b')](_0x462908,_['pick'](_0x541ba4,_[_0xca0b('0x7c')](_0x462908)));this[_0xca0b('0x41')][_0x541ba4[_0xca0b('0x51')]][_0xca0b('0x7d')](_0x462908);this[_0xca0b('0x12')][_0x541ba4[_0xca0b('0x51')]]=_0x462908;this[_0xca0b('0x4a')](_0x462908,_0xca0b('0x1b'));}}catch(_0xbf0bc6){logger[_0xca0b('0x3f')](_0xca0b('0x74'),_0x541ba4[_0xca0b('0x51')],util['inspect'](_0xbf0bc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncQueueCallerAbandon']=function(_0x1779cf){try{if(this[_0xca0b('0x64')](_0x1779cf)){logger['debug'](_0xca0b('0x7e'),_0x1779cf[_0xca0b('0x51')],util['inspect'](_0x1779cf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1779cf[_0xca0b('0x51')]]){var _0x415ad5=_[_0xca0b('0x7f')](this['queueReports'][_0x1779cf[_0xca0b('0x51')]]);_0x415ad5['queuecallercomplete']=![];_0x415ad5[_0xca0b('0x80')]=null;_0x415ad5['holdtime']=_0x1779cf[_0xca0b('0x81')];_0x415ad5[_0xca0b('0x82')]=_0x1779cf[_0xca0b('0x82')];_0x415ad5['queuecallerabandon']=!![];_0x415ad5['queuecallerabandonAt']=moment()['format'](_0xca0b('0x83'));_0x415ad5[_0xca0b('0x84')]=_0xca0b('0x85');_0x415ad5[_0xca0b('0x86')]=null;logger[_0xca0b('0x79')](_0xca0b('0x87'),_0x415ad5[_0xca0b('0x4f')],_0x415ad5['type']);this['channels'][_0x1779cf[_0xca0b('0x51')]]=_0x415ad5;this[_0xca0b('0x47')](_0x415ad5,_0xca0b('0x1d'));}}}catch(_0x1cc727){logger[_0xca0b('0x3f')](_0xca0b('0x7e'),_0x1779cf[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x1cc727,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x20')]=function(_0x4b9764){try{if(this['isNotNull'](_0x4b9764)){logger['debug'](_0xca0b('0x88'),_0x4b9764[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x4b9764,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b9764['uniqueid']]){var _0x151f5f=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x4b9764['uniqueid']]);_0x151f5f[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x151f5f[_0xca0b('0x8a')]=_0x4b9764[_0xca0b('0x8a')];_0x151f5f[_0xca0b('0x8b')]=_0x4b9764[_0xca0b('0x8b')];logger['info'](_0xca0b('0x8c'),_0x151f5f[_0xca0b('0x4f')],_0x151f5f[_0xca0b('0x5b')],_0x4b9764['connectedlinenum'],_0x4b9764[_0xca0b('0x8b')]);this[_0xca0b('0x12')][_0x4b9764['uniqueid']]=_0x151f5f;this['emitVoiceQueueChannelSave'](_0x151f5f,_0xca0b('0x1f'));}}}catch(_0x5e965b){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x4b9764['uniqueid'],util[_0xca0b('0x43')](_0x5e965b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncAgentConnect']=function(_0x259da0){try{if(this['isNotNull'](_0x259da0)){logger['debug'](_0xca0b('0x8d'),_0x259da0['uniqueid'],util[_0xca0b('0x43')](_0x259da0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x259da0['uniqueid']]){var _0x4c8863=_[_0xca0b('0x7f')](this['queueReports'][_0x259da0[_0xca0b('0x51')]]);_0x4c8863[_0xca0b('0x8e')]=!![];_0x4c8863['queuecallerexitreason']=_0xca0b('0x8f');logger[_0xca0b('0x79')](_0xca0b('0x90'),_0x4c8863[_0xca0b('0x4f')],_0x4c8863[_0xca0b('0x5b')]);}}}catch(_0x3d9dc7){logger[_0xca0b('0x3f')](_0xca0b('0x8d'),_0x259da0['uniqueid'],util['inspect'](_0x3d9dc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x91')]=function(_0x541114){try{if(this[_0xca0b('0x64')](_0x541114)){logger[_0xca0b('0x61')]('[%s][voiceQueueReport][agentcomplete]',_0x541114[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x541114,{'showHidden':![],'depth':null}));if(this[_0xca0b('0x41')][_0x541114[_0xca0b('0x51')]]){var _0x3a94aa=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x541114['uniqueid']]);_0x3a94aa['queuecallerabandon']=![];_0x3a94aa[_0xca0b('0x92')]=null;_0x3a94aa[_0xca0b('0x93')]=!![];_0x3a94aa[_0xca0b('0x86')]=_0x541114['membername'];_0x3a94aa['holdtime']=_0x541114[_0xca0b('0x81')];_0x3a94aa['queuecallercomplete']=!![];_0x3a94aa[_0xca0b('0x94')]=![];_0x3a94aa[_0xca0b('0x95')]=null;if(!_0x3a94aa['transfer']){if(_0x541114[_0xca0b('0x96')]==_0xca0b('0x97')){_0x3a94aa[_0xca0b('0x84')]=_0xca0b('0x98');logger[_0xca0b('0x79')](_0xca0b('0x99'),_0x3a94aa[_0xca0b('0x4f')],_0x3a94aa[_0xca0b('0x5b')]);}else{if(_[_0xca0b('0x9a')](_0x541114[_0xca0b('0x3c')][_0xca0b('0x9b')](),_0xca0b('0x9c'))){if(this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]){var _0x542d4f=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]);_0x542d4f[_0xca0b('0x8e')]=![];_0x542d4f['queuecallerexit']=!![];_0x542d4f[_0xca0b('0x95')]=moment(_0x3a94aa[_0xca0b('0x75')])[_0xca0b('0x9e')](_0x541114[_0xca0b('0x81')],_0xca0b('0x9f'))[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x542d4f[_0xca0b('0x84')]='FORWARDTRANSFER';_0x542d4f[_0xca0b('0x97')]=!![];_0x542d4f[_0xca0b('0xa0')]=_0xca0b('0xa1');_0x542d4f[_0xca0b('0xa2')]=_0x541114[_0xca0b('0xa3')];_0x542d4f[_0xca0b('0xa4')]=_0x541114['uniqueid'];logger[_0xca0b('0x79')](_0xca0b('0xa5'),_0x542d4f[_0xca0b('0x4f')],_0x542d4f[_0xca0b('0x5b')]);var _0x15b0a1=this['queueReports'][_0x541114['linkedid']];this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]=this[_0xca0b('0x41')][_0x541114[_0xca0b('0x51')]];this[_0xca0b('0x41')][_0x541114['uniqueid']]=_0x15b0a1;}}else{_0x3a94aa[_0xca0b('0x84')]=_0xca0b('0xa6')+_0x541114[_0xca0b('0x96')][_0xca0b('0xa7')]();logger[_0xca0b('0x79')](_0xca0b('0xa8'),_0x3a94aa[_0xca0b('0x4f')],_0x3a94aa['type'],_0x3a94aa['queuecallerexitreason']);}}}this['channels'][_0x541114['uniqueid']]=_0x3a94aa;this[_0xca0b('0x47')](_0x3a94aa,'agentcomplete');}}}catch(_0x17745c){logger['error'](_0xca0b('0xa9'),_0x541114[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x17745c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncVarSet']=function(_0xa9ba11){try{if(this[_0xca0b('0x64')](_0xa9ba11)){logger['debug']('[%s][voiceQueueReport][varset]',_0xa9ba11['uniqueid'],util[_0xca0b('0x43')](_0xa9ba11,{'showHidden':![],'depth':null}));this['addVariable'](_0xa9ba11[_0xca0b('0x51')],_[_0xca0b('0x7c')](_0xa9ba11['variable'])[0x0],_0xa9ba11['value']);if(this[_0xca0b('0x41')][_0xa9ba11[_0xca0b('0x51')]]){var _0x37ce06=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0xa9ba11[_0xca0b('0x51')]]);if(_0x37ce06){if(this[_0xca0b('0x64')](_0xa9ba11[_0xca0b('0xaa')])&&this[_0xca0b('0x64')](_0xa9ba11['variable'][_0xca0b('0xab')])){switch(_0xa9ba11[_0xca0b('0xac')]){case _0xca0b('0xad'):_0x37ce06['queuecallerexit']=![];_0x37ce06[_0xca0b('0x95')]=null;break;case _0xca0b('0xae'):_0x37ce06[_0xca0b('0xaf')]=_0xca0b('0xb0');_0x37ce06[_0xca0b('0x94')]=!![];_0x37ce06['queuecallerexitAt']=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));logger['debug'](_0xca0b('0xb1'),_0xa9ba11['uniqueid'],util['inspect'](_0x37ce06,{'showHidden':![],'depth':null}));ami[_0xca0b('0x49')](_0xca0b('0xb2'),_0x37ce06);break;default:_0x37ce06[_0xca0b('0x94')]=!![];_0x37ce06['queuecallerexitAt']=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));}_0x37ce06[_0xca0b('0x1d')]=![];_0x37ce06[_0xca0b('0x92')]=null;_0x37ce06[_0xca0b('0x84')]=_0xa9ba11[_0xca0b('0xac')];this['channels'][_0xa9ba11[_0xca0b('0x51')]]=_0x37ce06;this[_0xca0b('0x47')](_0x37ce06,_0xca0b('0x23'));}else if(this[_0xca0b('0x64')](_0xa9ba11['variable'])&&this[_0xca0b('0x64')](_0xa9ba11[_0xca0b('0xaa')]['queueposition'])){if(!_0x37ce06['queuecallerabandon']){_0x37ce06['queuecallerexit']=!![];_0x37ce06[_0xca0b('0x95')]=moment()['format'](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x84')]=_0xca0b('0xb3');_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));this[_0xca0b('0x12')][_0xa9ba11[_0xca0b('0x51')]]=_0x37ce06;}}logger['info'](_0xca0b('0xb4'),_0xa9ba11[_0xca0b('0x51')],_0x37ce06['name'],_0x37ce06[_0xca0b('0x5b')],_[_0xca0b('0x7c')](_0xa9ba11[_0xca0b('0xaa')])[0x0],_0xa9ba11[_0xca0b('0xac')]);_0x37ce06[_0xca0b('0x17')]=this[_0xca0b('0x17')][_0xa9ba11[_0xca0b('0x51')]];}}}}catch(_0x21645f){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][varset]',_0xa9ba11[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x21645f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0xb5')]=function(_0x576880,_0x4b6f9c,_0x3b9ac3){var _0x69837b=[_0xca0b('0xb6'),_0xca0b('0xb7'),'rtpaudioqosjitter',_0xca0b('0xb8'),_0xca0b('0xb9'),_0xca0b('0xba'),'rtpaudioqosrtt',_0xca0b('0xbb'),_0xca0b('0xbc'),_0xca0b('0xbd'),_0xca0b('0xbe'),_0xca0b('0xbf'),'membercalls','memberdynamic',_0xca0b('0xc0'),_0xca0b('0xc1'),'membername',_0xca0b('0xc2'),_0xca0b('0xc3')];if(!_[_0xca0b('0x39')](_0x4b6f9c)&&!_[_0xca0b('0xc4')](_0x69837b,_0x4b6f9c)){if(_[_0xca0b('0x65')](this[_0xca0b('0x17')][_0x576880])){this['variables'][_0x576880]={};}this[_0xca0b('0x17')][_0x576880][_0x4b6f9c]=_0x3b9ac3;}};VoiceQueueReport['prototype'][_0xca0b('0xc5')]=function(_0x1818f4){try{if(this[_0xca0b('0x64')](_0x1818f4)){logger[_0xca0b('0x61')]('[%s][voiceQueueReport][hangup]',_0x1818f4['uniqueid'],util['inspect'](_0x1818f4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1818f4[_0xca0b('0x51')]]){for(var _0x20a03f=0x0,_0x1e767c={};_0x20a03f=0x0?moment(_0x1f86a7['endtime'])[_0xd064('0x15')](_0x1f86a7[_0xd064('0x13')],_0xd064('0xb')):null,'data1':_0xd064('0x16'),'data2':_0x1f86a7['accountcode'],'data3':_0x1f86a7[_0xd064('0xd')],'data4':_0x1f86a7[_0xd064('0x17')]||null,'role':_0xd064('0xf'),'internal':_0x1f86a7[_0xd064('0x10')]?_[_0xd064('0x18')](_0x1f86a7['accountcode']):undefined,'uniqueid':_0x1f86a7[_0xd064('0x11')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x49fb=['diff','seconds','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','endtime','starttime','outbound','exten','dialstring','moment','util','../client','voiceQueueReport','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt'];(function(_0xb9232,_0x52ba7c){var _0x4189fb=function(_0x49b84e){while(--_0x49b84e){_0xb9232['push'](_0xb9232['shift']());}};_0x4189fb(++_0x52ba7c);}(_0x49fb,0x1a2));var _0xb49f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x49fb[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0xb49f('0x0'));var _=require('lodash');var util=require(_0xb49f('0x1'));var client=require(_0xb49f('0x2'));exports[_0xb49f('0x3')]=function(_0x47d237){var _0x39f53f=_0x47d237['queuecallercompleteAt']||_0x47d237['queuecallerexitAt'];return client[_0xb49f('0x4')](_0xb49f('0x5'),{'body':{'channel':_0xb49f('0x6'),'membername':_0x47d237['lastAssignedTo'],'interface':_[_0xb49f('0x7')](_0x47d237[_0xb49f('0x8')])?util[_0xb49f('0x9')](_0xb49f('0xa'),_0x47d237[_0xb49f('0xb')]):_0x47d237[_0xb49f('0x8')],'type':_0xb49f('0xc'),'enterAt':_0x47d237[_0xb49f('0xd')],'exitAt':_0x39f53f,'duration':moment(_0x39f53f)[_0xb49f('0xe')](_0x47d237[_0xb49f('0xd')],_0xb49f('0xf')),'data1':'inbound','data2':_0x47d237['calleridnum'],'data3':_0x47d237['exten'],'data4':null,'data5':_0x47d237[_0xb49f('0x10')],'role':_0xb49f('0x11'),'internal':_0x47d237[_0xb49f('0x12')]?_[_0xb49f('0x13')](_0x47d237[_0xb49f('0x12')]):undefined,'uniqueid':_0x47d237[_0xb49f('0x14')]},'log':'CreateMemberReport'});};exports[_0xb49f('0x15')]=function(_0x342673){return client[_0xb49f('0x4')]('CreateMemberReport',{'body':{'channel':_0xb49f('0x6'),'membername':_0x342673['membername'],'interface':_0x342673[_0xb49f('0x8')],'type':_0xb49f('0xc'),'enterAt':_0x342673['starttime'],'exitAt':_0x342673[_0xb49f('0x16')],'duration':moment(_0x342673[_0xb49f('0x16')])[_0xb49f('0xe')](_0x342673['starttime'],'seconds')>=0x0?moment(_0x342673[_0xb49f('0x16')])[_0xb49f('0xe')](_0x342673[_0xb49f('0x17')],_0xb49f('0xf')):null,'data1':_0xb49f('0x18'),'data2':_0x342673[_0xb49f('0x12')],'data3':_0x342673[_0xb49f('0x19')],'data4':_0x342673[_0xb49f('0x1a')]||null,'role':'agent','internal':_0x342673[_0xb49f('0x12')]?_['toNumber'](_0x342673[_0xb49f('0x12')]):undefined,'uniqueid':_0x342673[_0xb49f('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index cdb36e7..4cc24e0 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 _0x55da=['stopRecordingOnTransfer','GetSettings','getSettings','Request','ShowSetting'];(function(_0x48e977,_0x3290b8){var _0xa3f7e=function(_0x3630c4){while(--_0x3630c4){_0x48e977['push'](_0x48e977['shift']());}};_0xa3f7e(++_0x3290b8);}(_0x55da,0x16f));var _0xa55d=function(_0x56280a,_0x27953c){_0x56280a=_0x56280a-0x0;var _0x3d14ab=_0x55da[_0x56280a];return _0x3d14ab;};'use strict';var client=require('../client');exports[_0xa55d('0x0')]=function(){return client[_0xa55d('0x1')](_0xa55d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa55d('0x3')]},'log':_0xa55d('0x4')});}; \ No newline at end of file +var _0xb49a=['stopRecordingOnTransfer','../client','getSettings','Request','ShowSetting'];(function(_0x3bab40,_0x381406){var _0x46093e=function(_0x1b10e2){while(--_0x1b10e2){_0x3bab40['push'](_0x3bab40['shift']());}};_0x46093e(++_0x381406);}(_0xb49a,0xfb));var _0xab49=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xb49a[_0x3c59fc];return _0x2b78d4;};'use strict';var client=require(_0xab49('0x0'));exports[_0xab49('0x1')]=function(){return client[_0xab49('0x2')](_0xab49('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xab49('0x4')]},'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 b0b0d34..252c6db 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 _0x7ce8=['name','html','../client','getTemplates','GetTemplate'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x7ce8,0x165));var _0x87ce=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x7ce8[_0x11e30d];return _0x2d4e29;};'use strict';var client=require(_0x87ce('0x0'));exports[_0x87ce('0x1')]=function(_0x1e7569){return function(_0x59f58e){return client['Request'](_0x87ce('0x2'),{'options':{'raw':!![],'attributes':['id',_0x87ce('0x3'),_0x87ce('0x4')]},'log':_0x87ce('0x2')});};}; \ No newline at end of file +var _0xa327=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x21dc8d,_0x2d3c63){var _0x42de1a=function(_0x4ec78a){while(--_0x4ec78a){_0x21dc8d['push'](_0x21dc8d['shift']());}};_0x42de1a(++_0x2d3c63);}(_0xa327,0x136));var _0x7a32=function(_0x21ab64,_0x20cda3){_0x21ab64=_0x21ab64-0x0;var _0x5812c9=_0xa327[_0x21ab64];return _0x5812c9;};'use strict';var client=require(_0x7a32('0x0'));exports[_0x7a32('0x1')]=function(_0x13de96){return function(_0x5ed06a){return client[_0x7a32('0x2')](_0x7a32('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x7a32('0x4')]},'log':_0x7a32('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e21125b..c795eba 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 _0x1ec5=['Action','Actions','action','data1','data2','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status','Condition','AllConditions','operator','value','AnyConditions','field'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0x1ec5,0x185));var _0x51ec=function(_0x436b13,_0x55d9f9){_0x436b13=_0x436b13-0x0;var _0x2220c4=_0x1ec5[_0x436b13];return _0x2220c4;};'use strict';var client=require(_0x51ec('0x0'));exports[_0x51ec('0x1')]=function(_0x4e5b3a){return function(_0x49e77e){return client['Request'](_0x51ec('0x2'),{'options':{'raw':![],'attributes':['id',_0x51ec('0x3'),'channel',_0x51ec('0x4')],'include':[{'model':_0x51ec('0x5'),'as':_0x51ec('0x6'),'attributes':['id','field',_0x51ec('0x7'),_0x51ec('0x8')]},{'model':'Condition','as':_0x51ec('0x9'),'attributes':['id',_0x51ec('0xa'),_0x51ec('0x7'),_0x51ec('0x8')]},{'model':_0x51ec('0xb'),'as':_0x51ec('0xc'),'attributes':['id',_0x51ec('0xd'),_0x51ec('0xe'),_0x51ec('0xf'),'data3',_0x51ec('0x10'),_0x51ec('0x11'),_0x51ec('0x12'),_0x51ec('0x13')]}]},'log':_0x51ec('0x2')});};}; \ No newline at end of file +var _0xf34c=['data4','data5','data6','data7','getTriggers','GetTrigger','channel','Condition','AllConditions','field','operator','value','AnyConditions','action','data1','data2','data3'];(function(_0x30806e,_0x41bb0d){var _0x2777c6=function(_0x2557b6){while(--_0x2557b6){_0x30806e['push'](_0x30806e['shift']());}};_0x2777c6(++_0x41bb0d);}(_0xf34c,0x1cf));var _0xcf34=function(_0x520e31,_0x4ef38e){_0x520e31=_0x520e31-0x0;var _0x24492e=_0xf34c[_0x520e31];return _0x24492e;};'use strict';var client=require('../client');exports[_0xcf34('0x0')]=function(_0x599bb0){return function(_0x38daed){return client['Request'](_0xcf34('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xcf34('0x2'),'status'],'include':[{'model':_0xcf34('0x3'),'as':_0xcf34('0x4'),'attributes':['id',_0xcf34('0x5'),_0xcf34('0x6'),_0xcf34('0x7')]},{'model':_0xcf34('0x3'),'as':_0xcf34('0x8'),'attributes':['id',_0xcf34('0x5'),_0xcf34('0x6'),_0xcf34('0x7')]},{'model':'Action','as':'Actions','attributes':['id',_0xcf34('0x9'),_0xcf34('0xa'),_0xcf34('0xb'),_0xcf34('0xc'),_0xcf34('0xd'),_0xcf34('0xe'),_0xcf34('0xf'),_0xcf34('0x10')]}]},'log':_0xcf34('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e7c40f2..8c7650d 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 _0xedc0=['../client','Request','GetTrunk','name','defaultuser'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xedc0,0x12c));var _0x0edc=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xedc0[_0x2525f1];return _0x13c1b5;};'use strict';var client=require(_0x0edc('0x0'));exports['getTrunks']=function(_0x36519a){return function(_0x1e85f4){return client[_0x0edc('0x1')](_0x0edc('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0edc('0x3'),'registry',_0x0edc('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xda73=['GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x7dc0bf,_0xca3827){var _0x5a7f3b=function(_0x33cd59){while(--_0x33cd59){_0x7dc0bf['push'](_0x7dc0bf['shift']());}};_0x5a7f3b(++_0xca3827);}(_0xda73,0x160));var _0x3da7=function(_0x55d7da,_0x14459d){_0x55d7da=_0x55d7da-0x0;var _0x7a431c=_0xda73[_0x55d7da];return _0x7a431c;};'use strict';var client=require(_0x3da7('0x0'));exports[_0x3da7('0x1')]=function(_0x435bae){return function(_0x4a0419){return client['Request'](_0x3da7('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3da7('0x3'),_0x3da7('0x4'),_0x3da7('0x5')]},'log':_0x3da7('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 2414647..8386d31 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe706,0xa3));var _0x6e70=function(_0x6be190,_0x25e8dd){_0x6be190=_0x6be190-0x0;var _0x3867df=_0xe706[_0x6be190];return _0x3867df;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x2c42fc,_0xc7df41){var _0x1df9a4=function(_0x5401d6){while(--_0x5401d6){_0x2c42fc['push'](_0x2c42fc['shift']());}};_0x1df9a4(++_0xc7df41);}(_0xedd9,0xfc));var _0x9edd=function(_0x45c481,_0x5736cd){_0x45c481=_0x45c481-0x0;var _0x38a5c0=_0xedd9[_0x45c481];return _0x38a5c0;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 2c6c3ad..b9492b3 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 _0xd38c=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd38c,0x15c));var _0xcd38=function(_0x38789e,_0x32a364){_0x38789e=_0x38789e-0x0;var _0x2755bb=_0xd38c[_0x38789e];return _0x2755bb;};'use strict';var client=require(_0xcd38('0x0'));exports[_0xcd38('0x1')]=function(_0x275b37){return client[_0xcd38('0x2')](_0xcd38('0x3'),{'body':_0x275b37,'log':_0xcd38('0x3')});};exports['update']=function(_0x883017,_0x4a3067,_0x3cdf74){return client[_0xcd38('0x2')](_0xcd38('0x4'),{'body':_0x883017,'options':{'where':{'uniqueid':_0x4a3067,'interface':_0x3cdf74,'agentcomplete':!![]}},'log':_0xcd38('0x4')});}; \ No newline at end of file +var _0xa0b4=['Request','update','UpdateVoiceAgentReport','create'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xa0b4,0x12f));var _0x4a0b=function(_0x506391,_0x36bb23){_0x506391=_0x506391-0x0;var _0x1a47f3=_0xa0b4[_0x506391];return _0x1a47f3;};'use strict';var client=require('../client');exports[_0x4a0b('0x0')]=function(_0x356746){return client[_0x4a0b('0x1')]('CreateVoiceAgentReport',{'body':_0x356746,'log':'CreateVoiceAgentReport'});};exports[_0x4a0b('0x2')]=function(_0x551da4,_0x4b4900,_0x5670f4){return client['Request'](_0x4a0b('0x3'),{'body':_0x551da4,'options':{'where':{'uniqueid':_0x4b4900,'interface':_0x5670f4,'agentcomplete':!![]}},'log':_0x4a0b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a4cc200..1e76d99 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 _0x3b7a=['merge','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','GetVoiceCallReports','moment','util','../client'];(function(_0x1d69f3,_0x28d347){var _0x1aa313=function(_0x9d9d5){while(--_0x9d9d5){_0x1d69f3['push'](_0x1d69f3['shift']());}};_0x1aa313(++_0x28d347);}(_0x3b7a,0x153));var _0xa3b7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b7a[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xa3b7('0x0'));var util=require(_0xa3b7('0x1'));var _=require('lodash');var client=require(_0xa3b7('0x2'));exports['create']=function(_0x40e45f){return client['Request']('CreateVoiceCallReport',{'body':_[_0xa3b7('0x3')](_0x40e45f,{'source':_0x40e45f['calleridnum'],'destinationcontext':_0x40e45f[_0xa3b7('0x4')],'callerid':_0x40e45f[_0xa3b7('0x5')],'amaflags':_0xa3b7('0x6')}),'log':_0xa3b7('0x7')});};exports[_0xa3b7('0x8')]=function(){return function(){return client[_0xa3b7('0x9')](_0xa3b7('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xa3b7('0xb')](_0xa3b7('0xc'))[_0xa3b7('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa3b7('0xe')](_0xa3b7('0xc'))[_0xa3b7('0xd')](_0xa3b7('0xf'))]}},'attributes':['type',_0xa3b7('0x10'),'duration',_0xa3b7('0x11')]},'log':_0xa3b7('0x12')});};}; \ No newline at end of file +var _0x6588=['disposition','util','lodash','create','Request','merge','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x4586c6,_0x757d6a){var _0x5f054b=function(_0x388c63){while(--_0x388c63){_0x4586c6['push'](_0x4586c6['shift']());}};_0x5f054b(++_0x757d6a);}(_0x6588,0x188));var _0x8658=function(_0x5ddafe,_0x1fb508){_0x5ddafe=_0x5ddafe-0x0;var _0x5e23aa=_0x6588[_0x5ddafe];return _0x5e23aa;};'use strict';var moment=require('moment');var util=require(_0x8658('0x0'));var _=require(_0x8658('0x1'));var client=require('../client');exports[_0x8658('0x2')]=function(_0x939e3){return client[_0x8658('0x3')]('CreateVoiceCallReport',{'body':_[_0x8658('0x4')](_0x939e3,{'source':_0x939e3['calleridnum'],'destinationcontext':_0x939e3[_0x8658('0x5')],'callerid':_0x939e3[_0x8658('0x6')],'amaflags':_0x8658('0x7')}),'log':_0x8658('0x8')});};exports[_0x8658('0x9')]=function(){return function(){return client[_0x8658('0x3')](_0x8658('0xa'),{'options':{'where':{'type':[_0x8658('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8658('0xc'))[_0x8658('0xd')](_0x8658('0xe')),moment()[_0x8658('0xf')](_0x8658('0xc'))[_0x8658('0xd')](_0x8658('0xe'))]}},'attributes':['type',_0x8658('0x10'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 4f119e4..0e69168 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 _0x9207=['../client','create','Request','CreateVoiceDialReport'];(function(_0x56c48f,_0x14e5ee){var _0x4eccbf=function(_0x334107){while(--_0x334107){_0x56c48f['push'](_0x56c48f['shift']());}};_0x4eccbf(++_0x14e5ee);}(_0x9207,0x15c));var _0x7920=function(_0x42d41d,_0x17b8ea){_0x42d41d=_0x42d41d-0x0;var _0x2e6184=_0x9207[_0x42d41d];return _0x2e6184;};'use strict';var client=require(_0x7920('0x0'));exports[_0x7920('0x1')]=function(_0x31bf98){return client[_0x7920('0x2')](_0x7920('0x3'),{'body':_0x31bf98,'log':_0x7920('0x3')});}; \ No newline at end of file +var _0xe406=['CreateVoiceDialReport','../client','create'];(function(_0x1fd3e2,_0x1a6772){var _0x5a9210=function(_0x37e9c3){while(--_0x37e9c3){_0x1fd3e2['push'](_0x1fd3e2['shift']());}};_0x5a9210(++_0x1a6772);}(_0xe406,0x1de));var _0x6e40=function(_0xa10b0d,_0x5652d4){_0xa10b0d=_0xa10b0d-0x0;var _0xd12973=_0xe406[_0xa10b0d];return _0xd12973;};'use strict';var client=require(_0x6e40('0x0'));exports[_0x6e40('0x1')]=function(_0x14854c){return client['Request'](_0x6e40('0x2'),{'body':_0x14854c,'log':_0x6e40('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 861f35d..31004b6 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 _0xb921=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x4affd8,_0x1ba00a){var _0x4a7ef9=function(_0x52cd0b){while(--_0x52cd0b){_0x4affd8['push'](_0x4affd8['shift']());}};_0x4a7ef9(++_0x1ba00a);}(_0xb921,0x16a));var _0x1b92=function(_0x16311f,_0x40f002){_0x16311f=_0x16311f-0x0;var _0x42f147=_0xb921[_0x16311f];return _0x42f147;};'use strict';var client=require(_0x1b92('0x0'));exports[_0x1b92('0x1')]=function(){return function(){return client[_0x1b92('0x2')](_0x1b92('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1b92('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xa5fa=['getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x42509b,_0x5e36e5){var _0x549670=function(_0x199458){while(--_0x199458){_0x42509b['push'](_0x42509b['shift']());}};_0x549670(++_0x5e36e5);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x7e55a4,_0x10ff38){_0x7e55a4=_0x7e55a4-0x0;var _0x1e152b=_0xa5fa[_0x7e55a4];return _0x1e152b;};'use strict';var client=require('../client');exports[_0xaa5f('0x0')]=function(){return function(){return client[_0xaa5f('0x1')](_0xaa5f('0x2'),{'options':{'raw':!![],'attributes':['id',_0xaa5f('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xaa5f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 9fcb42f..500c4c1 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 _0x16fb=['dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialLimitQueue'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0x16fb,0x180));var _0xb16f=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x16fb[_0x2eb5bc];return _0x51c7b1;};'use strict';var client=require('../client');exports[_0xb16f('0x0')]=function(){return function(){return client['Request'](_0xb16f('0x1'),{'options':{'raw':![],'attributes':['id',_0xb16f('0x2'),_0xb16f('0x3'),'acwTimeout',_0xb16f('0x4'),_0xb16f('0x5'),'type',_0xb16f('0x6'),'dialMethod','dialLimitChannel',_0xb16f('0x7'),_0xb16f('0x8'),'dialPredictiveOptimization',_0xb16f('0x9'),_0xb16f('0xa'),'dialOriginateCallerIdName',_0xb16f('0xb'),_0xb16f('0xc'),_0xb16f('0xd'),_0xb16f('0xe'),_0xb16f('0xf'),'dialCongestionMaxRetry',_0xb16f('0x10'),_0xb16f('0x11'),'dialBusyRetryFrequency',_0xb16f('0x12'),_0xb16f('0x13'),_0xb16f('0x14'),_0xb16f('0x15'),'dialGlobalInterval','dialPrefix','dialCheckDuplicateType',_0xb16f('0x16'),_0xb16f('0x17'),_0xb16f('0x18'),_0xb16f('0x19'),_0xb16f('0x1a'),_0xb16f('0x1b'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xb16f('0x1c'),_0xb16f('0x1d'),_0xb16f('0x1e'),_0xb16f('0x1f'),'dialRecallInQueue',_0xb16f('0x20'),_0xb16f('0x21'),_0xb16f('0x22'),'dialQueueProject2',_0xb16f('0x5'),_0xb16f('0x23'),_0xb16f('0x24'),_0xb16f('0x25'),_0xb16f('0x26'),_0xb16f('0x27'),_0xb16f('0x28'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0xb16f('0x29'),_0xb16f('0x2a'),_0xb16f('0x2b'),_0xb16f('0x2c'),_0xb16f('0x2d'),_0xb16f('0x2e'),_0xb16f('0x2f'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xb16f('0x30'),'as':_0xb16f('0x30'),'attributes':['id','name','callerid',_0xb16f('0x31')]},{'model':_0xb16f('0x32'),'as':_0xb16f('0x33'),'attributes':['id',_0xb16f('0x2')]},{'model':_0xb16f('0x30'),'as':_0xb16f('0x34'),'attributes':['id','name','callerid',_0xb16f('0x31')]},{'model':_0xb16f('0x35'),'as':_0xb16f('0x35'),'attributes':['id','name'],'include':[{'model':_0xb16f('0x35'),'as':_0xb16f('0x36'),'attributes':['id',_0xb16f('0x2'),_0xb16f('0x37')]}]}]},'log':_0xb16f('0x0')});};}; \ No newline at end of file +var _0xc55d=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','name','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x2a8122,_0xd957e){var _0x49a5c7=function(_0x12ab58){while(--_0x12ab58){_0x2a8122['push'](_0x2a8122['shift']());}};_0x49a5c7(++_0xd957e);}(_0xc55d,0x179));var _0xdc55=function(_0x3c34fb,_0x59cacf){_0x3c34fb=_0x3c34fb-0x0;var _0x320156=_0xc55d[_0x3c34fb];return _0x320156;};'use strict';var client=require(_0xdc55('0x0'));exports[_0xdc55('0x1')]=function(){return function(){return client['Request'](_0xdc55('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xdc55('0x3'),_0xdc55('0x4'),_0xdc55('0x5'),'monitor_format',_0xdc55('0x6'),_0xdc55('0x7'),_0xdc55('0x8'),_0xdc55('0x9'),'dialLimitQueue','dialPowerLevel',_0xdc55('0xa'),'dialPredictiveOptimizationPercentage',_0xdc55('0xb'),_0xdc55('0xc'),_0xdc55('0xd'),_0xdc55('0xe'),_0xdc55('0xf'),_0xdc55('0x10'),_0xdc55('0x11'),'dialCongestionMaxRetry',_0xdc55('0x12'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xdc55('0x13'),_0xdc55('0x14'),_0xdc55('0x15'),'dialTimezone',_0xdc55('0x16'),_0xdc55('0x17'),_0xdc55('0x18'),_0xdc55('0x19'),_0xdc55('0x1a'),_0xdc55('0x1b'),_0xdc55('0x1c'),_0xdc55('0x1d'),_0xdc55('0x1e'),'dialAMDBetweenWordsSilence',_0xdc55('0x1f'),_0xdc55('0x20'),_0xdc55('0x21'),'timeout',_0xdc55('0x22'),_0xdc55('0x23'),_0xdc55('0x24'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xdc55('0x25'),_0xdc55('0x26'),_0xdc55('0x27'),'dialRandomLastDigitCallerIdNumber',_0xdc55('0x28'),_0xdc55('0x29'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xdc55('0x2a'),'dialAbandonedMaxRetry',_0xdc55('0x2b'),_0xdc55('0x2c'),_0xdc55('0x2d'),_0xdc55('0x2e'),_0xdc55('0x2f'),'mandatoryDisposition',_0xdc55('0x30'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xdc55('0x31'),'as':_0xdc55('0x31'),'attributes':['id','name',_0xdc55('0x32'),'active']},{'model':_0xdc55('0x33'),'as':_0xdc55('0x34'),'attributes':['id',_0xdc55('0x35')]},{'model':_0xdc55('0x31'),'as':_0xdc55('0x36'),'attributes':['id',_0xdc55('0x35'),_0xdc55('0x32'),_0xdc55('0x37')]},{'model':_0xdc55('0x38'),'as':_0xdc55('0x38'),'attributes':['id',_0xdc55('0x35')],'include':[{'model':'Interval','as':_0xdc55('0x39'),'attributes':['id',_0xdc55('0x35'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 49e49ea..771d180 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(_0x2dc12b,_0x179f1c){var _0x1dd75b=function(_0x46c62c){while(--_0x46c62c){_0x2dc12b['push'](_0x2dc12b['shift']());}};_0x1dd75b(++_0x179f1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x5be024,_0x11f9b5){var _0x47c8d5=function(_0x45d0b4){while(--_0x45d0b4){_0x5be024['push'](_0x5be024['shift']());}};_0x47c8d5(++_0x11f9b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 0dab53a..ca0851f 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 _0x4290=['getVoiceQueueRtPauses','../client','Request'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4290,0x124));var _0x0429=function(_0x5a80e1,_0x28c735){_0x5a80e1=_0x5a80e1-0x0;var _0x30d553=_0x4290[_0x5a80e1];return _0x30d553;};'use strict';var client=require(_0x0429('0x0'));exports['getVoiceQueueRtPauses']=function(_0x197dd9){return function(){return client[_0x0429('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x197dd9,'paused':!![]},'raw':!![]},'log':_0x0429('0x2')});};}; \ No newline at end of file +var _0xb78c=['../client','getVoiceQueueRtPauses'];(function(_0x3a876d,_0x2ab77b){var _0x31e089=function(_0x1b11b6){while(--_0x1b11b6){_0x3a876d['push'](_0x3a876d['shift']());}};_0x31e089(++_0x2ab77b);}(_0xb78c,0x194));var _0xcb78=function(_0x8ba624,_0x42e30e){_0x8ba624=_0x8ba624-0x0;var _0x43940f=_0xb78c[_0x8ba624];return _0x43940f;};'use strict';var client=require(_0xcb78('0x0'));exports[_0xcb78('0x1')]=function(_0x4f4e5b){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4f4e5b,'paused':!![]},'raw':!![]},'log':_0xcb78('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ad7d94a..cd5e045 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x31692d,_0x487999){var _0x5d5df8=function(_0x503bcb){while(--_0x503bcb){_0x31692d['push'](_0x31692d['shift']());}};_0x5d5df8(++_0x487999);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2b0f2a,_0xcdba36){var _0x2e3e23=function(_0x2486b7){while(--_0x2486b7){_0x2b0f2a['push'](_0x2b0f2a['shift']());}};_0x2e3e23(++_0xcdba36);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 4e7fec5..661a1e0 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 _0xf325=['../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransferercontext','origtransfererexten','attended'];(function(_0xffae83,_0x80ffee){var _0x260e8a=function(_0x6b514b){while(--_0x6b514b){_0xffae83['push'](_0xffae83['shift']());}};_0x260e8a(++_0x80ffee);}(_0xf325,0xa0));var _0x5f32=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xf325[_0x2aa0e7];return _0x1472c0;};'use strict';var client=require(_0x5f32('0x0'));exports['transfers']={};exports[_0x5f32('0x1')]=function(_0x26724f){return client[_0x5f32('0x2')](_0x5f32('0x3'),{'body':{'result':_0x26724f[_0x5f32('0x4')],'transfererchannel':_0x26724f['transfererchannel'],'transferercalleridnum':_0x26724f[_0x5f32('0x5')],'transferercalleridname':_0x26724f[_0x5f32('0x6')],'transfererconnectedlinenum':_0x26724f[_0x5f32('0x7')],'transfererconnectedlinename':_0x26724f[_0x5f32('0x8')],'transfereraccountcode':_0x26724f[_0x5f32('0x9')],'transferercontext':_0x26724f[_0x5f32('0xa')],'transfererexten':_0x26724f[_0x5f32('0xb')],'transfererlinkedid':_0x26724f[_0x5f32('0xc')],'transfereechannel':_0x26724f[_0x5f32('0xd')],'transfereecalleridnum':_0x26724f[_0x5f32('0xe')],'transfereecalleridname':_0x26724f[_0x5f32('0xf')],'transfereeconnectedlinenum':_0x26724f[_0x5f32('0x10')],'transfereeconnectedlinename':_0x26724f[_0x5f32('0x11')],'transfereeaccountcode':_0x26724f[_0x5f32('0x12')],'transfereecontext':_0x26724f[_0x5f32('0x13')],'transfereeexten':_0x26724f[_0x5f32('0x14')],'transfereelinkedid':_0x26724f['transfereelinkedid'],'isexternal':_0x26724f[_0x5f32('0x15')],'context':_0x26724f[_0x5f32('0x16')],'extension':_0x26724f[_0x5f32('0x17')],'type':_0x5f32('0x18')},'log':_0x5f32('0x3')});};exports[_0x5f32('0x19')]=function(_0x488ee8){return client[_0x5f32('0x2')](_0x5f32('0x3'),{'body':{'result':_0x488ee8[_0x5f32('0x4')],'transfererchannel':_0x488ee8[_0x5f32('0x1a')],'transferercalleridnum':_0x488ee8[_0x5f32('0x1b')],'transferercalleridname':_0x488ee8[_0x5f32('0x1c')],'transfererconnectedlinenum':_0x488ee8[_0x5f32('0x1d')],'transfererconnectedlinename':_0x488ee8[_0x5f32('0x1e')],'transfereraccountcode':_0x488ee8['origtransfereraccountcode'],'transferercontext':_0x488ee8['secondtransferercontext'],'transfererexten':_0x488ee8['secondtransfererexten'],'transfererlinkedid':_0x488ee8[_0x5f32('0x1f')],'transfereechannel':_0x488ee8[_0x5f32('0x20')],'transfereecalleridnum':_0x488ee8[_0x5f32('0x21')],'transfereecalleridname':_0x488ee8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x488ee8[_0x5f32('0x22')],'transfereeconnectedlinename':_0x488ee8[_0x5f32('0x23')],'transfereeaccountcode':_0x488ee8['transfertargetaccountcode'],'transfereecontext':_0x488ee8[_0x5f32('0x24')],'transfereeexten':_0x488ee8['transfertargetexten'],'transfereelinkedid':_0x488ee8['transfertargetlinkedid'],'isexternal':_0x488ee8[_0x5f32('0x15')],'context':_0x488ee8[_0x5f32('0x25')],'extension':_0x488ee8[_0x5f32('0x26')],'type':_0x5f32('0x27')},'log':_0x5f32('0x3')});}; \ No newline at end of file +var _0xa5fb=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x3414c1,_0x3d8623){var _0x154711=function(_0xfe929a){while(--_0xfe929a){_0x3414c1['push'](_0x3414c1['shift']());}};_0x154711(++_0x3d8623);}(_0xa5fb,0x1f4));var _0xba5f=function(_0x32e0df,_0x4a6d94){_0x32e0df=_0x32e0df-0x0;var _0x4874bf=_0xa5fb[_0x32e0df];return _0x4874bf;};'use strict';var client=require(_0xba5f('0x0'));exports[_0xba5f('0x1')]={};exports['blindTransfer']=function(_0x5bd664){return client[_0xba5f('0x2')](_0xba5f('0x3'),{'body':{'result':_0x5bd664[_0xba5f('0x4')],'transfererchannel':_0x5bd664['transfererchannel'],'transferercalleridnum':_0x5bd664[_0xba5f('0x5')],'transferercalleridname':_0x5bd664[_0xba5f('0x6')],'transfererconnectedlinenum':_0x5bd664['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5bd664[_0xba5f('0x7')],'transfereraccountcode':_0x5bd664[_0xba5f('0x8')],'transferercontext':_0x5bd664[_0xba5f('0x9')],'transfererexten':_0x5bd664[_0xba5f('0xa')],'transfererlinkedid':_0x5bd664[_0xba5f('0xb')],'transfereechannel':_0x5bd664[_0xba5f('0xc')],'transfereecalleridnum':_0x5bd664[_0xba5f('0xd')],'transfereecalleridname':_0x5bd664['transfereecalleridname'],'transfereeconnectedlinenum':_0x5bd664[_0xba5f('0xe')],'transfereeconnectedlinename':_0x5bd664[_0xba5f('0xf')],'transfereeaccountcode':_0x5bd664[_0xba5f('0x10')],'transfereecontext':_0x5bd664[_0xba5f('0x11')],'transfereeexten':_0x5bd664[_0xba5f('0x12')],'transfereelinkedid':_0x5bd664[_0xba5f('0x13')],'isexternal':_0x5bd664['isexternal'],'context':_0x5bd664[_0xba5f('0x14')],'extension':_0x5bd664[_0xba5f('0x15')],'type':'blind'},'log':_0xba5f('0x3')});};exports[_0xba5f('0x16')]=function(_0x5312f5){return client[_0xba5f('0x2')](_0xba5f('0x3'),{'body':{'result':_0x5312f5['result'],'transfererchannel':_0x5312f5['origtransfererchannel'],'transferercalleridnum':_0x5312f5[_0xba5f('0x17')],'transferercalleridname':_0x5312f5[_0xba5f('0x18')],'transfererconnectedlinenum':_0x5312f5[_0xba5f('0x19')],'transfererconnectedlinename':_0x5312f5['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5312f5[_0xba5f('0x1a')],'transferercontext':_0x5312f5[_0xba5f('0x1b')],'transfererexten':_0x5312f5[_0xba5f('0x1c')],'transfererlinkedid':_0x5312f5[_0xba5f('0x1d')],'transfereechannel':_0x5312f5['transfertargetchannel'],'transfereecalleridnum':_0x5312f5[_0xba5f('0x1e')],'transfereecalleridname':_0x5312f5[_0xba5f('0x1f')],'transfereeconnectedlinenum':_0x5312f5[_0xba5f('0x20')],'transfereeconnectedlinename':_0x5312f5[_0xba5f('0x21')],'transfereeaccountcode':_0x5312f5['transfertargetaccountcode'],'transfereecontext':_0x5312f5[_0xba5f('0x22')],'transfereeexten':_0x5312f5[_0xba5f('0x23')],'transfereelinkedid':_0x5312f5['transfertargetlinkedid'],'isexternal':_0x5312f5['isexternal'],'context':_0x5312f5[_0xba5f('0x24')],'extension':_0x5312f5['origtransfererexten'],'type':_0xba5f('0x25')},'log':_0xba5f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 450f7b1..3991e29 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 _0x39e6=['MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Action','then','message','catch','username','content','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','map','find','uniqueid','channel','filename','wav'];(function(_0x11797f,_0x5c738c){var _0x3e7c76=function(_0x2bb1bd){while(--_0x2bb1bd){_0x11797f['push'](_0x11797f['shift']());}};_0x3e7c76(++_0x5c738c);}(_0x39e6,0x9e));var _0x639e=function(_0x326ee0,_0x5ece78){_0x326ee0=_0x326ee0-0x0;var _0x454e45=_0x39e6[_0x326ee0];return _0x454e45;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var jayson=require(_0x639e('0x1'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x639e('0x2'));var config=require(_0x639e('0x3'));var properties=require('../properties');var ami=require(_0x639e('0x4'));exports[_0x639e('0x5')]=function(_0x199e72,_0x2935fd,_0x15e5df){return new BPromise(function(_0x320448,_0x3812c0){var _0x21db36={'QueuePause':function(_0x36b11f){return new Promise(function(_0x134eec,_0x29e806){var _0x2fab76=util[_0x639e('0x6')](_0x639e('0x7'),_0x639e('0x8'),_0x36b11f[_0x639e('0x9')]);if(_0x199e72[_0x639e('0xa')]&&_0x199e72[_0x639e('0xa')][_0x2fab76]&&_0x199e72['timers'][_0x2fab76]['timer']){_0x199e72[_0x639e('0xa')][_0x2fab76][_0x639e('0xb')]();}if(_0x199e72[_0x639e('0xc')][_0x2fab76]){_0x199e72[_0x639e('0xc')][_0x2fab76][_0x639e('0xd')]({'statePause':_0x36b11f[_0x639e('0xe')]?!![]:![]});}_0x134eec({'code':0xc8,'message':_0x639e('0xf')});});},'Reload':function(_0x4f3d38){var _0x56d9bb=this;return new Promise(function(_0x3c6a33,_0x3a1693){if(ami[_0x639e('0x10')]()==![]){return _0x3a1693(_0x56d9bb[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}_0x4f3d38=_[_0x639e('0x15')](_0x4f3d38,_[_0x639e('0x16')](properties['module']));_0x4f3d38[_0x639e('0x17')]='Reload';return ami[_0x639e('0x18')](_0x4f3d38)[_0x639e('0x19')](function(_0x391957){_0x3c6a33({'code':0xc8,'message':_0x391957[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x1c023e){_0x3a1693(_0x56d9bb['error'](0x1f5,_0x1c023e[_0x639e('0x1a')]));});});},'Command':function(_0x34baca){var _0x36f71d=this;return new Promise(function(_0x1da55e,_0x59f772){if(ami[_0x639e('0x10')]()==![]){return _0x59f772(_0x36f71d[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}_0x34baca=_[_0x639e('0x15')](_0x34baca,'command');_0x34baca[_0x639e('0x17')]='Command';return ami['Action'](_0x34baca)[_0x639e('0x19')](function(_0x3813f6){_0x1da55e({'code':0xc8,'message':_0x3813f6[_0x639e('0x1d')]});})[_0x639e('0x1b')](function(_0x211fcb){_0x59f772(_0x36f71d['error'](0x1f5,_0x211fcb[_0x639e('0x1a')]));});});},'VoiceQueues':function(_0x3647d9){return new Promise(function(_0x39b44f,_0x2da264){var _0x2df4d1=[];for(var _0x5f27f6 in _0x199e72[_0x639e('0x1e')]){if(_0x199e72[_0x639e('0x1e')][_0x639e('0x1f')](_0x5f27f6)){var _0x10abb0=_0x199e72['voiceQueues'][_0x5f27f6];var _0x2ae3b7={'id':_0x10abb0['id'],'name':_0x10abb0[_0x639e('0x9')],'strategy':_0x10abb0[_0x639e('0x20')],'answered':_0x10abb0['answered'],'available':_0x10abb0[_0x639e('0x21')],'loggedIn':_0x10abb0['loggedIn'],'pTalking':_0x10abb0[_0x639e('0x22')],'sumBillable':_0x10abb0['sumBillable'],'sumDuration':_0x10abb0['sumDuration'],'sumHoldTime':_0x10abb0[_0x639e('0x23')]||0x0,'talking':_0x10abb0[_0x639e('0x24')],'total':_0x10abb0[_0x639e('0x25')],'type':_0x10abb0[_0x639e('0x26')],'unmanaged':_0x10abb0[_0x639e('0x27')],'abandoned':_0x10abb0[_0x639e('0x28')],'waiting':_0x10abb0['waiting'],'loggedInDb':_0x10abb0[_0x639e('0x29')]};if(_0x10abb0[_0x639e('0x26')]==='outbound'){_0x2ae3b7['dialActive']=_0x10abb0[_0x639e('0x2a')];_0x2ae3b7[_0x639e('0x2b')]=_0x10abb0[_0x639e('0x2b')];_0x2ae3b7['dialOriginateCallerIdName']=_0x10abb0[_0x639e('0x2c')];_0x2ae3b7['dialOriginateCallerIdNumber']=_0x10abb0[_0x639e('0x2d')];_0x2ae3b7[_0x639e('0x2e')]=_0x10abb0[_0x639e('0x2e')];_0x2ae3b7['dialPrefix']=_0x10abb0[_0x639e('0x2f')];_0x2ae3b7['temp']=_0x10abb0[_0x639e('0x30')];_0x2ae3b7[_0x639e('0x31')]=_0x10abb0[_0x639e('0x31')];_0x2ae3b7['outboundAnswerCallsDay']=_0x10abb0[_0x639e('0x32')];_0x2ae3b7[_0x639e('0x33')]=_0x10abb0[_0x639e('0x33')];_0x2ae3b7['outboundBusyCallsDay']=_0x10abb0[_0x639e('0x34')];_0x2ae3b7['outboundCongestionCallsDay']=_0x10abb0[_0x639e('0x35')];_0x2ae3b7[_0x639e('0x36')]=_0x10abb0[_0x639e('0x36')];_0x2ae3b7[_0x639e('0x37')]=_0x10abb0[_0x639e('0x37')];_0x2ae3b7['outboundDropCallsDayTimeout']=_0x10abb0[_0x639e('0x38')];_0x2ae3b7[_0x639e('0x39')]=_0x10abb0[_0x639e('0x39')];_0x2ae3b7[_0x639e('0x3a')]=_0x10abb0['outboundNoSuchCallsDay'];_0x2ae3b7[_0x639e('0x3b')]=_0x10abb0[_0x639e('0x3b')];_0x2ae3b7[_0x639e('0x3c')]=_0x10abb0['outboundReCallsDay'];_0x2ae3b7[_0x639e('0x3d')]=_0x10abb0['outboundRejectCallsDay'];_0x2ae3b7[_0x639e('0x3e')]=_0x10abb0[_0x639e('0x3e')];_0x2ae3b7[_0x639e('0x3f')]=_0x10abb0[_0x639e('0x3f')];_0x2ae3b7[_0x639e('0x40')]=_0x10abb0[_0x639e('0x40')];_0x2ae3b7['predictiveIntervalAvgTalktime']=_0x10abb0[_0x639e('0x41')];_0x2ae3b7[_0x639e('0x42')]=_0x10abb0['predictiveIntervalDroppedCallsCallersExit'];_0x2ae3b7[_0x639e('0x43')]=_0x10abb0['predictiveIntervalDroppedCallsTimeout'];_0x2ae3b7[_0x639e('0x44')]=_0x10abb0[_0x639e('0x44')];_0x2ae3b7[_0x639e('0x45')]=_0x10abb0[_0x639e('0x45')];_0x2ae3b7[_0x639e('0x46')]=_0x10abb0[_0x639e('0x46')];_0x2ae3b7[_0x639e('0x47')]=_0x10abb0[_0x639e('0x47')];_0x2ae3b7['predictiveIntervalPauses']=_0x10abb0['predictiveIntervalPauses'];_0x2ae3b7['predictiveIntervalAvailable']=_0x10abb0['predictiveIntervalAvailable'];_0x2ae3b7[_0x639e('0x48')]=_0x10abb0[_0x639e('0x48')];_0x2ae3b7['message']=_0x10abb0[_0x639e('0x1a')];_0x2ae3b7[_0x639e('0x49')]=_0x10abb0[_0x639e('0x49')];_0x2ae3b7['erlangCalls']=_0x10abb0[_0x639e('0x4a')];_0x2ae3b7[_0x639e('0x4b')]=_0x10abb0[_0x639e('0x4b')];_0x2ae3b7[_0x639e('0x4c')]=_0x10abb0[_0x639e('0x4c')];_0x2ae3b7[_0x639e('0x4d')]=_0x10abb0[_0x639e('0x4d')];_0x2ae3b7[_0x639e('0x4e')]=_0x10abb0[_0x639e('0x4e')];_0x2ae3b7['startProgressive']=_0x10abb0[_0x639e('0x4f')];}if(_0x10abb0[_0x639e('0x50')]){_0x2ae3b7[_0x639e('0x50')]={'id':_0x10abb0[_0x639e('0x50')]['id'],'name':_0x10abb0[_0x639e('0x50')][_0x639e('0x9')],'active':_0x10abb0['Trunk'][_0x639e('0x51')],'callerid':_0x10abb0[_0x639e('0x50')][_0x639e('0x52')]};}if(_0x10abb0[_0x639e('0x53')]){_0x2ae3b7[_0x639e('0x53')]={'id':_0x10abb0[_0x639e('0x53')]['id'],'name':_0x10abb0[_0x639e('0x53')][_0x639e('0x9')]};}_0x2df4d1[_0x639e('0x54')](_0x2ae3b7);}}_0x39b44f({'count':_0x2df4d1[_0x639e('0x55')],'rows':_0x2df4d1});});},'UpdateVoiceQueue':function(_0x2c504e){return new Promise(function(_0x2a679c,_0x4e01f1){var _0xe25497=_['find'](_0x199e72['voiceQueues'],{'id':parseInt(_0x2c504e['id'])});var _0x261d6a=_[_0x639e('0x56')](_0x2c504e,['id']);if(_0xe25497){for(var _0x44a3e5 in _0x261d6a){if(typeof _0x261d6a[_0x44a3e5]!==_0x639e('0x57')&&typeof _0xe25497[_0x44a3e5]!==_0x639e('0x57')){_0xe25497[_0x44a3e5]=_0x261d6a[_0x44a3e5];}}_0x2a679c(_0xe25497);}else{_0x4e01f1();}});},'VoiceChannels':function(_0x5b27b6){return new Promise(function(_0x2b0dbb,_0x1fa830){var _0x56ecea=_[_0x639e('0x58')](_0x199e72[_0x639e('0x59')]);_0x2b0dbb({'count':_0x56ecea[_0x639e('0x55')],'rows':_0x56ecea});});},'VoiceChannelMixMonitor':function(_0x4c5899){var _0x12e146=this;return new Promise(function(_0x1d9fc5,_0x32add6){if(ami[_0x639e('0x10')]()==![]){return _0x32add6(_0x12e146['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x413ebd=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x4c5899);if(_0x413ebd[_0x639e('0x55')]>0x0){return _0x32add6(_0x12e146['error'](0x1f4,_[_0x639e('0x5c')](_0x413ebd,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x4dab80=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x4c5899[_0x639e('0x5e')]});if(_0x4dab80&&_0x4dab80[_0x639e('0x5f')]){var _0x5292ef=util[_0x639e('0x6')]('%s.%s',_0x4c5899[_0x639e('0x60')]||_0x4c5899[_0x639e('0x5e')],_0x4c5899[_0x639e('0x6')]||_0x639e('0x61'));return ami['Action']({'action':_0x639e('0x62'),'channel':_0x4dab80['channel'],'file':_0x5292ef,'options':'ai(mixmonitorid)'})[_0x639e('0x19')](function(_0x1e9278){var _0x1daeea=_[_0x639e('0x5d')](_0x4dab80['monitors'],{'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')]()});if(_[_0x639e('0x65')](_0x1daeea)){_0x4dab80['monitors'][_0x639e('0x54')]({'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')](),'createdAt':moment()[_0x639e('0x6')](_0x639e('0x66')),'mixmonitorid':_0x1e9278[_0x639e('0x67')],'status':_0x639e('0x68')});}else{_0x1daeea['mixmonitorid']=_0x1e9278[_0x639e('0x67')];_0x1daeea[_0x639e('0x69')]=_0x639e('0x68');}_0x1d9fc5({'code':0xc8,'message':[_0x4c5899[_0x639e('0x5e')],'MixMonitor\x20Success',_0x1e9278[_0x639e('0x67')]][_0x639e('0x14')]('\x20'),'mixmonitorid':_0x1e9278[_0x639e('0x67')]});})['catch'](function(_0x4ecd7e){_0x32add6(_0x12e146['error'](0x1f5,[_0x4c5899[_0x639e('0x5e')],_0x4ecd7e[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x32add6(_0x12e146[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x29314a){var _0x3d116a=this;return new Promise(function(_0x5bab36,_0x427f11){if(ami[_0x639e('0x10')]()==![]){return _0x427f11(_0x3d116a['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x549d44=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x29314a);if(_0x549d44[_0x639e('0x55')]>0x0){return _0x427f11(_0x3d116a['error'](0x1f4,_[_0x639e('0x5c')](_0x549d44,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x3b8401=_['find'](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x29314a[_0x639e('0x5e')]});if(_0x3b8401){return BPromise['resolve']()[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x5f')],'mixmonitorid':_0x29314a['mixmonitorid']})[_0x639e('0x1b')](function(_0x94fab4){});}})[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x6c')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x6c')],'mixmonitorid':_0x29314a[_0x639e('0x67')]})[_0x639e('0x1b')](function(_0x22fca7){});}})['then'](function(_0x5982a0){var _0xdeb345=_[_0x639e('0x5d')](_0x3b8401[_0x639e('0x6d')],{'mixmonitorid':_0x29314a[_0x639e('0x67')]});if(_0xdeb345){_0xdeb345[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){var _0x48fc0e=util[_0x639e('0x6')](_0x639e('0x6e'),_0x29314a[_0x639e('0x60')]||_0x29314a['uniqueid'],_0x29314a['format']||_0x639e('0x61'));var _0x2a5ca9=_[_0x639e('0x5d')](_0x3b8401['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x48fc0e[_0x639e('0x64')]()});if(_0x2a5ca9){_0x2a5ca9[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){_0x5bab36({'code':0xc8,'message':[_0x29314a[_0x639e('0x5e')],_0x639e('0x6f')][_0x639e('0x14')]('\x20')});})['catch'](function(_0x476d46){_0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,[_0x29314a[_0x639e('0x5e')],_0x476d46[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannels':function(_0x3c945c){return new Promise(function(_0x806962,_0x4d7e98){var _0x207e2c=_[_0x639e('0x58')](_0x199e72[_0x639e('0x70')]);_0x806962({'count':_0x207e2c[_0x639e('0x55')],'rows':_0x207e2c});});},'VoiceQueuesChannel':function(_0x2aa53b){var _0x250046=this;return new Promise(function(_0x606061,_0x31a209){var _0x3a87e3=schema(properties['voicequeuechannel'])[_0x639e('0x5b')](_0x2aa53b);if(_0x3a87e3[_0x639e('0x55')]>0x0){return _0x31a209(_0x250046[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x3a87e3,_0x639e('0x1a'))['join'](',\x20')));}var _0x5c265c=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x2aa53b[_0x639e('0x5e')]});if(_0x5c265c){_0x606061(_0x5c265c);}else{return _0x31a209(_0x250046[_0x639e('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x27517f){var _0xbe7032=this;return new Promise(function(_0x821ac7,_0x3f347b){if(ami['isConnected']()==![]){return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x5f324b=schema(properties[_0x639e('0x71')])[_0x639e('0x5b')](_0x27517f);if(_0x5f324b[_0x639e('0x55')]>0x0){return _0x3f347b(_0xbe7032['error'](0x1f4,_[_0x639e('0x5c')](_0x5f324b,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x2d0ef5=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x27517f['uniqueid']});if(_0x2d0ef5&&_0x2d0ef5[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x72'),'channel':_0x2d0ef5[_0x639e('0x5f')]})[_0x639e('0x19')](function(_0x4d2b66){_0x821ac7({'code':0xc8,'message':[_0x27517f[_0x639e('0x5e')],_0x4d2b66[_0x639e('0x1a')][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x433bb6){_0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,[_0x27517f[_0x639e('0x5e')],_0x433bb6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x413fb5){var _0x13e28d=this;return new Promise(function(_0x2a2e9b,_0x3c9ac4){if(ami[_0x639e('0x10')]()==![]){return _0x3c9ac4(_0x13e28d['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}var _0x457f21=schema(properties['voicequeuechannelredirect'])[_0x639e('0x5b')](_0x413fb5);if(_0x457f21[_0x639e('0x55')]>0x0){return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x457f21,'message')[_0x639e('0x14')](',\x20')));}var _0xd66e73=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x70')],{'uniqueid':_0x413fb5['uniqueid']});if(_0xd66e73&&_0xd66e73[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':'Redirect','channel':_0xd66e73[_0x639e('0x5f')],'exten':_0x413fb5['exten'],'context':_0x413fb5[_0x639e('0x73')]||_0xd66e73[_0x639e('0x73')],'priority':0x1})[_0x639e('0x19')](function(_0x2b2799){_0x2a2e9b({'code':0xc8,'message':[_0x413fb5[_0x639e('0x5e')],_0x2b2799['message'][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x5495d5){_0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,[_0x413fb5[_0x639e('0x5e')],_0x5495d5[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'Agents':function(_0x1839ae){return new Promise(function(_0x351459,_0x31facd){var _0x2669a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0xc')]);_0x351459({'count':_0x2669a3[_0x639e('0x55')],'rows':_0x2669a3});});},'Telephones':function(_0x3a90e2){return new Promise(function(_0x101230,_0x34183e){var _0x498ced=_[_0x639e('0x58')](_0x199e72['telephones']);_0x101230({'count':_0x498ced[_0x639e('0x55')],'rows':_0x498ced});});},'Trunks':function(_0x25faba){return new Promise(function(_0x91c03,_0x40625b){var _0x2d5f67=_['values'](_0x199e72[_0x639e('0x74')]);_0x91c03({'count':_0x2d5f67[_0x639e('0x55')],'rows':_0x2d5f67});});},'OutboundChannels':function(_0x38d5d4){return new Promise(function(_0x2cd5c6,_0x452085){var _0x1c14a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x75')]);_0x2cd5c6({'count':_0x1c14a3[_0x639e('0x55')],'rows':_0x1c14a3});});},'Outbound':function(_0x3d2a25){return new Promise(function(_0x28e379,_0x59b26e){_0x28e379(_0x199e72['outbound']);});},'Campaigns':function(_0x284de7){return new Promise(function(_0x1e8927,_0x2146fe){var _0x4ce384=_[_0x639e('0x58')](_0x199e72[_0x639e('0x76')]);_0x1e8927({'count':_0x4ce384[_0x639e('0x55')],'rows':_0x4ce384});});},'VoiceQueuesPreview':function(_0x516e7f){var _0xe9bfb9=this;return new Promise(function(_0x33d71e,_0x1664fd){_0x2935fd['run'](_0x516e7f['id'])[_0x639e('0x19')](function(_0x66f38a){_0x33d71e({'code':0xc8,'message':_0x66f38a[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x30911e){_0x1664fd(_0xe9bfb9[_0x639e('0x11')](0x1f4,_0x30911e[_0x639e('0x1a')]));});});},'EventManager':function(_0x167ec3){var _0x581d53=this;return new Promise(function(_0xfa5b9,_0x53cbcc){if(!_0x167ec3[_0x639e('0x77')]){return _0x53cbcc(_0x581d53[_0x639e('0x11')](0x1f4,_0x639e('0x78')));}ami[_0x639e('0x79')]('custom:'+_0x167ec3[_0x639e('0x77')],_0x167ec3[_0x639e('0x1a')]);_0xfa5b9({'code':0xc8,'message':_0x167ec3});});},'FaxAccounts':function(_0x56b313){return new Promise(function(_0x47bf07,_0xedca5f){var _0x24d1b3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x7a')]);_0x47bf07({'count':_0x24d1b3[_0x639e('0x55')],'rows':_0x24d1b3});});},'SendFax':function(_0x195b09){var _0x1b53b2=this;return new Promise(function(_0x413d4d,_0x4522cc){_0x15e5df['send'](_0x195b09)[_0x639e('0x19')](function(_0x3a51e1){_0x413d4d({'code':0xc8,'message':_0x3a51e1[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x255562){_0x4522cc(_0x1b53b2[_0x639e('0x11')](0x1f4,_0x255562[_0x639e('0x1a')]));});});},'CheckAfterSend':function(_0x4e41a2){var _0x125490=this;return new Promise(function(_0x418264,_0x585f04){_0x15e5df[_0x639e('0x7b')](_0x4e41a2)[_0x639e('0x19')](function(_0x203a59){_0x418264({'code':0xc8,'message':_0x203a59['message']});})['catch'](function(_0x2b83c7){_0x585f04(_0x125490['error'](0x1f4,_0x2b83c7[_0x639e('0x1a')]));});});}};var _0x1d5f57=jayson['server'](_0x21db36)[_0x639e('0x7c')]();_0x1d5f57['on'](_0x639e('0x11'),function(_0x282c08){return _0x3812c0(_0x282c08);});_0x1d5f57[_0x639e('0x5')](0x232a,_0x639e('0x7d'),function(){console['log'](_0x639e('0x7e'),0x232a);return _0x320448(_0x639e('0x7f')+0x232a);});});}; \ No newline at end of file +var _0xe626=['StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outbound','emit','custom:','faxAccounts','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','pick','command','Command','content','voiceQueues','name','strategy','answered','loggedIn','pTalking','sumBillable','talking','waiting','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','channels','voicechannel','uniqueid','%s.%s','filename','format','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve'];(function(_0x28506e,_0x10ce43){var _0x2ebaa6=function(_0x5ee621){while(--_0x5ee621){_0x28506e['push'](_0x28506e['shift']());}};_0x2ebaa6(++_0x10ce43);}(_0xe626,0x9d));var _0x6e62=function(_0x3e8e83,_0x3d3efb){_0x3e8e83=_0x3e8e83-0x0;var _0x24aff6=_0xe626[_0x3e8e83];return _0x24aff6;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var jayson=require(_0x6e62('0x2'));var schema=require(_0x6e62('0x3'));var BPromise=require('bluebird');var moment=require(_0x6e62('0x4'));var config=require(_0x6e62('0x5'));var properties=require(_0x6e62('0x6'));var ami=require(_0x6e62('0x7'));exports[_0x6e62('0x8')]=function(_0x4d4816,_0x5f25a3,_0x4a778d){return new BPromise(function(_0x2ee927,_0x157047){var _0x55165e={'QueuePause':function(_0x32fd89){return new Promise(function(_0x1dfbaf,_0x16fa52){var _0x3317f1=util['format'](_0x6e62('0x9'),_0x6e62('0xa'),_0x32fd89['name']);if(_0x4d4816[_0x6e62('0xb')]&&_0x4d4816['timers'][_0x3317f1]&&_0x4d4816[_0x6e62('0xb')][_0x3317f1]['timer']){_0x4d4816[_0x6e62('0xb')][_0x3317f1]['updateAcw']();}if(_0x4d4816[_0x6e62('0xc')][_0x3317f1]){_0x4d4816[_0x6e62('0xc')][_0x3317f1][_0x6e62('0xd')]({'statePause':_0x32fd89[_0x6e62('0xe')]?!![]:![]});}_0x1dfbaf({'code':0xc8,'message':_0x6e62('0xf')});});},'Reload':function(_0x1c266b){var _0x3b5c11=this;return new Promise(function(_0x49be2d,_0x4e7917){if(ami[_0x6e62('0x10')]()==![]){return _0x4e7917(_0x3b5c11[_0x6e62('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}_0x1c266b=_['pick'](_0x1c266b,_[_0x6e62('0x16')](properties[_0x6e62('0x17')]));_0x1c266b[_0x6e62('0x18')]=_0x6e62('0x19');return ami[_0x6e62('0x1a')](_0x1c266b)[_0x6e62('0x1b')](function(_0x42c2ea){_0x49be2d({'code':0xc8,'message':_0x42c2ea[_0x6e62('0x1c')]});})[_0x6e62('0x1d')](function(_0x15bce5){_0x4e7917(_0x3b5c11['error'](0x1f5,_0x15bce5[_0x6e62('0x1c')]));});});},'Command':function(_0x400bcc){var _0x55ce3b=this;return new Promise(function(_0xefbfb6,_0x4ecdff){if(ami[_0x6e62('0x10')]()==![]){return _0x4ecdff(_0x55ce3b[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}_0x400bcc=_[_0x6e62('0x1e')](_0x400bcc,_0x6e62('0x1f'));_0x400bcc[_0x6e62('0x18')]=_0x6e62('0x20');return ami['Action'](_0x400bcc)[_0x6e62('0x1b')](function(_0x52d5e7){_0xefbfb6({'code':0xc8,'message':_0x52d5e7[_0x6e62('0x21')]});})[_0x6e62('0x1d')](function(_0x345af8){_0x4ecdff(_0x55ce3b[_0x6e62('0x11')](0x1f5,_0x345af8[_0x6e62('0x1c')]));});});},'VoiceQueues':function(_0x425d1c){return new Promise(function(_0x4373b5,_0x3a1683){var _0x2e4fe1=[];for(var _0x448691 in _0x4d4816['voiceQueues']){if(_0x4d4816[_0x6e62('0x22')]['hasOwnProperty'](_0x448691)){var _0x2f9c68=_0x4d4816[_0x6e62('0x22')][_0x448691];var _0x318fc3={'id':_0x2f9c68['id'],'name':_0x2f9c68[_0x6e62('0x23')],'strategy':_0x2f9c68[_0x6e62('0x24')],'answered':_0x2f9c68[_0x6e62('0x25')],'available':_0x2f9c68['available'],'loggedIn':_0x2f9c68[_0x6e62('0x26')],'pTalking':_0x2f9c68[_0x6e62('0x27')],'sumBillable':_0x2f9c68[_0x6e62('0x28')],'sumDuration':_0x2f9c68['sumDuration'],'sumHoldTime':_0x2f9c68['sumHoldTime']||0x0,'talking':_0x2f9c68[_0x6e62('0x29')],'total':_0x2f9c68['total'],'type':_0x2f9c68['type'],'unmanaged':_0x2f9c68['unmanaged'],'abandoned':_0x2f9c68['abandoned'],'waiting':_0x2f9c68[_0x6e62('0x2a')],'loggedInDb':_0x2f9c68['loggedInDb']};if(_0x2f9c68[_0x6e62('0x2b')]==='outbound'){_0x318fc3[_0x6e62('0x2c')]=_0x2f9c68[_0x6e62('0x2c')];_0x318fc3[_0x6e62('0x2d')]=_0x2f9c68['dialMethod'];_0x318fc3['dialOriginateCallerIdName']=_0x2f9c68[_0x6e62('0x2e')];_0x318fc3[_0x6e62('0x2f')]=_0x2f9c68['dialOriginateCallerIdNumber'];_0x318fc3['dialOriginateTimeout']=_0x2f9c68['dialOriginateTimeout'];_0x318fc3[_0x6e62('0x30')]=_0x2f9c68['dialPrefix'];_0x318fc3[_0x6e62('0x31')]=_0x2f9c68[_0x6e62('0x31')];_0x318fc3[_0x6e62('0x32')]=_0x2f9c68[_0x6e62('0x32')];_0x318fc3[_0x6e62('0x33')]=_0x2f9c68['outboundAnswerCallsDay'];_0x318fc3['outboundBlacklistCallsDay']=_0x2f9c68[_0x6e62('0x34')];_0x318fc3[_0x6e62('0x35')]=_0x2f9c68[_0x6e62('0x35')];_0x318fc3[_0x6e62('0x36')]=_0x2f9c68[_0x6e62('0x36')];_0x318fc3[_0x6e62('0x37')]=_0x2f9c68[_0x6e62('0x37')];_0x318fc3[_0x6e62('0x38')]=_0x2f9c68[_0x6e62('0x38')];_0x318fc3['outboundDropCallsDayTimeout']=_0x2f9c68[_0x6e62('0x39')];_0x318fc3[_0x6e62('0x3a')]=_0x2f9c68[_0x6e62('0x3a')];_0x318fc3['outboundNoSuchCallsDay']=_0x2f9c68[_0x6e62('0x3b')];_0x318fc3[_0x6e62('0x3c')]=_0x2f9c68['outboundOriginateFailureCallsDay'];_0x318fc3[_0x6e62('0x3d')]=_0x2f9c68[_0x6e62('0x3d')];_0x318fc3[_0x6e62('0x3e')]=_0x2f9c68[_0x6e62('0x3e')];_0x318fc3[_0x6e62('0x3f')]=_0x2f9c68['outboundUnknownCallsDay'];_0x318fc3[_0x6e62('0x40')]=_0x2f9c68[_0x6e62('0x40')];_0x318fc3[_0x6e62('0x41')]=_0x2f9c68[_0x6e62('0x41')];_0x318fc3[_0x6e62('0x42')]=_0x2f9c68['predictiveIntervalAvgTalktime'];_0x318fc3[_0x6e62('0x43')]=_0x2f9c68[_0x6e62('0x43')];_0x318fc3[_0x6e62('0x44')]=_0x2f9c68['predictiveIntervalDroppedCallsTimeout'];_0x318fc3[_0x6e62('0x45')]=_0x2f9c68[_0x6e62('0x45')];_0x318fc3['predictiveIntervalErlangCallsDroppedCalls']=_0x2f9c68['predictiveIntervalErlangCallsDroppedCalls'];_0x318fc3[_0x6e62('0x46')]=_0x2f9c68[_0x6e62('0x46')];_0x318fc3[_0x6e62('0x47')]=_0x2f9c68['predictiveIntervalMultiplicativeFactor'];_0x318fc3['predictiveIntervalPauses']=_0x2f9c68[_0x6e62('0x48')];_0x318fc3['predictiveIntervalAvailable']=_0x2f9c68['predictiveIntervalAvailable'];_0x318fc3[_0x6e62('0x49')]=_0x2f9c68[_0x6e62('0x49')];_0x318fc3[_0x6e62('0x1c')]=_0x2f9c68[_0x6e62('0x1c')];_0x318fc3[_0x6e62('0x4a')]=_0x2f9c68['originated'];_0x318fc3[_0x6e62('0x4b')]=_0x2f9c68['erlangCalls'];_0x318fc3['erlangCallToSecond']=_0x2f9c68[_0x6e62('0x4c')];_0x318fc3[_0x6e62('0x4d')]=_0x2f9c68[_0x6e62('0x4d')];_0x318fc3['erlangBusyFactor']=_0x2f9c68[_0x6e62('0x4e')];_0x318fc3['startPredictive']=_0x2f9c68[_0x6e62('0x4f')];_0x318fc3[_0x6e62('0x50')]=_0x2f9c68[_0x6e62('0x50')];}if(_0x2f9c68[_0x6e62('0x51')]){_0x318fc3[_0x6e62('0x51')]={'id':_0x2f9c68[_0x6e62('0x51')]['id'],'name':_0x2f9c68[_0x6e62('0x51')][_0x6e62('0x23')],'active':_0x2f9c68[_0x6e62('0x51')][_0x6e62('0x52')],'callerid':_0x2f9c68['Trunk']['callerid']};}if(_0x2f9c68['Interval']){_0x318fc3[_0x6e62('0x53')]={'id':_0x2f9c68['Interval']['id'],'name':_0x2f9c68[_0x6e62('0x53')][_0x6e62('0x23')]};}_0x2e4fe1['push'](_0x318fc3);}}_0x4373b5({'count':_0x2e4fe1[_0x6e62('0x54')],'rows':_0x2e4fe1});});},'UpdateVoiceQueue':function(_0x10c992){return new Promise(function(_0x223c3b,_0x2efc75){var _0x11cd3b=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x22')],{'id':parseInt(_0x10c992['id'])});var _0x22f217=_[_0x6e62('0x56')](_0x10c992,['id']);if(_0x11cd3b){for(var _0x7e251d in _0x22f217){if(typeof _0x22f217[_0x7e251d]!==_0x6e62('0x57')&&typeof _0x11cd3b[_0x7e251d]!==_0x6e62('0x57')){_0x11cd3b[_0x7e251d]=_0x22f217[_0x7e251d];}}_0x223c3b(_0x11cd3b);}else{_0x2efc75();}});},'VoiceChannels':function(_0x7c26d2){return new Promise(function(_0x5efc0c,_0x419fab){var _0x158c75=_['values'](_0x4d4816[_0x6e62('0x58')]);_0x5efc0c({'count':_0x158c75['length'],'rows':_0x158c75});});},'VoiceChannelMixMonitor':function(_0x45da05){var _0x1aaec8=this;return new Promise(function(_0x34d642,_0x5ca4eb){if(ami[_0x6e62('0x10')]()==![]){return _0x5ca4eb(_0x1aaec8[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x315ed4=schema(properties[_0x6e62('0x59')])[_0x6e62('0x3')](_0x45da05);if(_0x315ed4[_0x6e62('0x54')]>0x0){return _0x5ca4eb(_0x1aaec8['error'](0x1f4,_['map'](_0x315ed4,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x168992=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x58')],{'uniqueid':_0x45da05[_0x6e62('0x5a')]});if(_0x168992&&_0x168992['channel']){var _0x19a7e9=util['format'](_0x6e62('0x5b'),_0x45da05[_0x6e62('0x5c')]||_0x45da05[_0x6e62('0x5a')],_0x45da05[_0x6e62('0x5d')]||_0x6e62('0x5e'));return ami['Action']({'action':_0x6e62('0x5f'),'channel':_0x168992[_0x6e62('0x60')],'file':_0x19a7e9,'options':_0x6e62('0x61')})[_0x6e62('0x1b')](function(_0x5378b5){var _0x2aa82d=_['find'](_0x168992[_0x6e62('0x62')],{'filename':_0x6e62('0x63')+_0x19a7e9[_0x6e62('0x64')]()});if(_[_0x6e62('0x65')](_0x2aa82d)){_0x168992[_0x6e62('0x62')][_0x6e62('0x66')]({'filename':_0x6e62('0x63')+_0x19a7e9['toLowerCase'](),'createdAt':moment()[_0x6e62('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5378b5[_0x6e62('0x67')],'status':_0x6e62('0x68')});}else{_0x2aa82d[_0x6e62('0x67')]=_0x5378b5[_0x6e62('0x67')];_0x2aa82d[_0x6e62('0x69')]='rec';}_0x34d642({'code':0xc8,'message':[_0x45da05[_0x6e62('0x5a')],'MixMonitor\x20Success',_0x5378b5[_0x6e62('0x67')]][_0x6e62('0x15')]('\x20'),'mixmonitorid':_0x5378b5[_0x6e62('0x67')]});})['catch'](function(_0x577eb4){_0x5ca4eb(_0x1aaec8[_0x6e62('0x11')](0x1f5,[_0x45da05['uniqueid'],_0x577eb4[_0x6e62('0x1c')]['toLowerCase']()][_0x6e62('0x15')]('\x20')));});}else{return _0x5ca4eb(_0x1aaec8['error'](0x1f5,_0x6e62('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0xb19995){var _0x5f2d00=this;return new Promise(function(_0x1226ce,_0x2f4f20){if(ami['isConnected']()==![]){return _0x2f4f20(_0x5f2d00['error'](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x1eb6e8=schema(properties[_0x6e62('0x59')])['validate'](_0xb19995);if(_0x1eb6e8[_0x6e62('0x54')]>0x0){return _0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x1eb6e8,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x492ffd=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x58')],{'uniqueid':_0xb19995['uniqueid']});if(_0x492ffd){return BPromise[_0x6e62('0x6c')]()[_0x6e62('0x1b')](function(){if(_0x492ffd[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x6d'),'channel':_0x492ffd['channel'],'mixmonitorid':_0xb19995[_0x6e62('0x67')]})[_0x6e62('0x1d')](function(_0x28435b){});}})['then'](function(){if(_0x492ffd[_0x6e62('0x6e')]){return ami[_0x6e62('0x1a')]({'action':'StopMixMonitor','channel':_0x492ffd[_0x6e62('0x6e')],'mixmonitorid':_0xb19995['mixmonitorid']})[_0x6e62('0x1d')](function(_0xb22e54){});}})[_0x6e62('0x1b')](function(_0x5db78e){var _0x58e9bd=_[_0x6e62('0x55')](_0x492ffd[_0x6e62('0x62')],{'mixmonitorid':_0xb19995[_0x6e62('0x67')]});if(_0x58e9bd){_0x58e9bd[_0x6e62('0x69')]=_0x6e62('0x6f');}})[_0x6e62('0x1b')](function(){var _0x1a778a=util[_0x6e62('0x5d')]('%s.%s',_0xb19995[_0x6e62('0x5c')]||_0xb19995[_0x6e62('0x5a')],_0xb19995['format']||_0x6e62('0x5e'));var _0x4a079d=_[_0x6e62('0x55')](_0x492ffd[_0x6e62('0x62')],{'filename':_0x6e62('0x63')+_0x1a778a[_0x6e62('0x64')]()});if(_0x4a079d){_0x4a079d['status']='stop';}})[_0x6e62('0x1b')](function(){_0x1226ce({'code':0xc8,'message':[_0xb19995[_0x6e62('0x5a')],_0x6e62('0x70')][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x60b516){_0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f5,[_0xb19995[_0x6e62('0x5a')],_0x60b516['message'][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannels':function(_0x1685c4){return new Promise(function(_0x8ff2c0,_0x3268e2){var _0x37816e=_[_0x6e62('0x71')](_0x4d4816['queueChannels']);_0x8ff2c0({'count':_0x37816e[_0x6e62('0x54')],'rows':_0x37816e});});},'VoiceQueuesChannel':function(_0x256993){var _0x3ddc7f=this;return new Promise(function(_0x8b84d7,_0xeb5195){var _0x3937b3=schema(properties[_0x6e62('0x72')])[_0x6e62('0x3')](_0x256993);if(_0x3937b3[_0x6e62('0x54')]>0x0){return _0xeb5195(_0x3ddc7f[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x3937b3,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x3be758=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x73')],{'uniqueid':_0x256993[_0x6e62('0x5a')]});if(_0x3be758){_0x8b84d7(_0x3be758);}else{return _0xeb5195(_0x3ddc7f['error'](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x174f93){var _0x2c11e4=this;return new Promise(function(_0x256608,_0x53684f){if(ami[_0x6e62('0x10')]()==![]){return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config['asterisk'][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x1fd508=schema(properties['voicequeuechannelhangup'])[_0x6e62('0x3')](_0x174f93);if(_0x1fd508[_0x6e62('0x54')]>0x0){return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x1fd508,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x1e7420=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x73')],{'uniqueid':_0x174f93[_0x6e62('0x5a')]});if(_0x1e7420&&_0x1e7420[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x74'),'channel':_0x1e7420[_0x6e62('0x60')]})['then'](function(_0xf25da3){_0x256608({'code':0xc8,'message':[_0x174f93[_0x6e62('0x5a')],_0xf25da3[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x451dd1){_0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f5,[_0x174f93['uniqueid'],_0x451dd1[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x2f6e7c){var _0x4066aa=this;return new Promise(function(_0x489e44,_0x45319f){if(ami[_0x6e62('0x10')]()==![]){return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x2034bf=schema(properties[_0x6e62('0x75')])[_0x6e62('0x3')](_0x2f6e7c);if(_0x2034bf[_0x6e62('0x54')]>0x0){return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x2034bf,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x4577c0=_[_0x6e62('0x55')](_0x4d4816['queueChannels'],{'uniqueid':_0x2f6e7c[_0x6e62('0x5a')]});if(_0x4577c0&&_0x4577c0[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x76'),'channel':_0x4577c0[_0x6e62('0x60')],'exten':_0x2f6e7c[_0x6e62('0x77')],'context':_0x2f6e7c['context']||_0x4577c0[_0x6e62('0x78')],'priority':0x1})[_0x6e62('0x1b')](function(_0x518213){_0x489e44({'code':0xc8,'message':[_0x2f6e7c[_0x6e62('0x5a')],_0x518213['message']['toLowerCase']()][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x14b2a7){_0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f5,[_0x2f6e7c['uniqueid'],_0x14b2a7[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x320981){return new Promise(function(_0x374d33,_0x44747a){var _0x5cfbb9=_[_0x6e62('0x71')](_0x4d4816['agents']);_0x374d33({'count':_0x5cfbb9['length'],'rows':_0x5cfbb9});});},'Telephones':function(_0x35beef){return new Promise(function(_0x3b1917,_0x129eca){var _0x5368de=_['values'](_0x4d4816[_0x6e62('0x79')]);_0x3b1917({'count':_0x5368de[_0x6e62('0x54')],'rows':_0x5368de});});},'Trunks':function(_0x15c205){return new Promise(function(_0x38a760,_0x28d430){var _0x54ee57=_[_0x6e62('0x71')](_0x4d4816[_0x6e62('0x7a')]);_0x38a760({'count':_0x54ee57[_0x6e62('0x54')],'rows':_0x54ee57});});},'OutboundChannels':function(_0x1c7688){return new Promise(function(_0x5cc806,_0x48e7b7){var _0x8f326e=_[_0x6e62('0x71')](_0x4d4816['outboundChannels']);_0x5cc806({'count':_0x8f326e['length'],'rows':_0x8f326e});});},'Outbound':function(_0x3eb4a1){return new Promise(function(_0x2fb04e,_0x346cd6){_0x2fb04e(_0x4d4816[_0x6e62('0x7b')]);});},'Campaigns':function(_0x102e42){return new Promise(function(_0x288955,_0x431bdd){var _0x1ac390=_[_0x6e62('0x71')](_0x4d4816['campaigns']);_0x288955({'count':_0x1ac390[_0x6e62('0x54')],'rows':_0x1ac390});});},'VoiceQueuesPreview':function(_0x1ee1f9){var _0x1e753b=this;return new Promise(function(_0x5ae85e,_0x1efc4c){_0x5f25a3['run'](_0x1ee1f9['id'])[_0x6e62('0x1b')](function(_0x258314){_0x5ae85e({'code':0xc8,'message':_0x258314['message']});})[_0x6e62('0x1d')](function(_0x19879c){_0x1efc4c(_0x1e753b[_0x6e62('0x11')](0x1f4,_0x19879c[_0x6e62('0x1c')]));});});},'EventManager':function(_0x25d318){var _0x35f31b=this;return new Promise(function(_0x162750,_0x519e98){if(!_0x25d318['event']){return _0x519e98(_0x35f31b[_0x6e62('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x6e62('0x7c')](_0x6e62('0x7d')+_0x25d318['event'],_0x25d318[_0x6e62('0x1c')]);_0x162750({'code':0xc8,'message':_0x25d318});});},'FaxAccounts':function(_0x4cf02a){return new Promise(function(_0xc63c1a,_0x567624){var _0x334092=_['values'](_0x4d4816[_0x6e62('0x7e')]);_0xc63c1a({'count':_0x334092[_0x6e62('0x54')],'rows':_0x334092});});},'SendFax':function(_0x454f23){var _0x47745e=this;return new Promise(function(_0x45f361,_0x5ce958){_0x4a778d[_0x6e62('0x7f')](_0x454f23)[_0x6e62('0x1b')](function(_0x14df12){_0x45f361({'code':0xc8,'message':_0x14df12[_0x6e62('0x1c')]});})[_0x6e62('0x1d')](function(_0x2049e4){_0x5ce958(_0x47745e[_0x6e62('0x11')](0x1f4,_0x2049e4[_0x6e62('0x1c')]));});});},'CheckAfterSend':function(_0x7fa90b){var _0x4767b1=this;return new Promise(function(_0x1f7b9d,_0x5706a9){_0x4a778d[_0x6e62('0x80')](_0x7fa90b)[_0x6e62('0x1b')](function(_0x52c724){_0x1f7b9d({'code':0xc8,'message':_0x52c724['message']});})['catch'](function(_0xaa43f){_0x5706a9(_0x4767b1[_0x6e62('0x11')](0x1f4,_0xaa43f[_0x6e62('0x1c')]));});});}};var _0x40d958=jayson['server'](_0x55165e)['http']();_0x40d958['on'](_0x6e62('0x11'),function(_0x22cfd7){return _0x157047(_0x22cfd7);});_0x40d958[_0x6e62('0x8')](0x232a,_0x6e62('0x81'),function(){console[_0x6e62('0x82')](_0x6e62('0x83'),0x232a);return _0x2ee927(_0x6e62('0x84')+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 602d3bf..3bf2b58 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 _0xf17e=['calleridname','','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','destcalleridname','push','format','user:%s','name','trigger:%s','action','toLowerCase','length','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data1','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','createdAt','updatedAt','resolve','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil'];(function(_0x34711f,_0x4c533b){var _0x2e444e=function(_0x3eafcb){while(--_0x3eafcb){_0x34711f['push'](_0x34711f['shift']());}};_0x2e444e(++_0x4c533b);}(_0xf17e,0x117));var _0xef17=function(_0x292588,_0x924042){_0x292588=_0x292588-0x0;var _0x5dbf98=_0xf17e[_0x292588];return _0x5dbf98;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xef17('0x0'));var util=require('util');var config=require(_0xef17('0x1'));var logger=require('../../../../config/logger')(_0xef17('0x2'));var cmContactRpc=require(_0xef17('0x3'));config[_0xef17('0x4')]=_[_0xef17('0x5')](config[_0xef17('0x4')],{'host':_0xef17('0x6'),'port':0x18eb});var io=require(_0xef17('0x7'))(new Redis(config[_0xef17('0x4')]));function emit(_0x831c8d,_0x45e9d9,_0x43828f,_0x31b302,_0x51cc81){logger[_0xef17('0x8')]('[CM][%s][%s]',_0x831c8d,_0x45e9d9['id'],_0x43828f,_0x31b302,JSON[_0xef17('0x9')](_0x51cc81));io['to'](_0x43828f)[_0xef17('0xa')](_0x31b302,_0x51cc81);}exports[_0xef17('0xb')]=function(_0x50add5,_0x292981,_0x77b818,_0x325330){var _0x30c3d3,_0x12ac40;var _0x510fef={};var _0x532d50=Number(_0x77b818[_0xef17('0xc')]);var _0xe1504=_0x77b818['data2']?Boolean(Number(_0x77b818['data2'])):![];var _0x4ef2c7;if(_0x325330[_0xef17('0xd')]){_0x510fef['id']=_0x325330[_0xef17('0xd')];}if(!_0x510fef['id']){_0x510fef[_0xef17('0xe')]=_0x532d50;_0x4ef2c7=_0x77b818[_0xef17('0xf')]&&_0x77b818['data3']!=='0'?_0x77b818['data3'][_0xef17('0x10')](','):['phone'];_0x510fef[_0xef17('0x11')]=_[_0xef17('0x12')](_0x4ef2c7,function(_0x1b2f3b){var _0x2c5206={};_0x2c5206[_0x1b2f3b]=_0x325330[_0xef17('0x13')]?_0x325330[_0xef17('0x14')]:_0x325330[_0xef17('0x15')];return _0x2c5206;});}var _0x2f9e71=['id',_0xef17('0x16'),_0xef17('0x17'),_0xef17('0x18'),'mobile',_0xef17('0x19'),_0xef17('0xe'),_0xef17('0x1a'),'scheduledAt',_0xef17('0x1b')];var _0xe084ab=_['union'](_0x2f9e71,_0x4ef2c7);BPromise[_0xef17('0x1c')]()[_0xef17('0x1d')](cmContactRpc[_0xef17('0x1e')]({'attributes':_0xe084ab,'where':_0x510fef}))[_0xef17('0x1d')](function(_0x17455b){_0x12ac40=_0x17455b;if(!_['isEmpty'](_0x12ac40)){if(_0x12ac40['length']===0x1){_0x30c3d3=_0x12ac40[0x0];logger['info'](_0xef17('0x1f'),_0x325330[_0xef17('0x20')],_0x292981['id'],_0x30c3d3['id']);}else{logger[_0xef17('0x8')](_0xef17('0x21'),_0x325330[_0xef17('0x20')],_0x292981['id'],_[_0xef17('0x12')](_0x12ac40,'id')[_0xef17('0x22')](','));}return;}else{logger[_0xef17('0x8')](_0xef17('0x23'),_0x325330[_0xef17('0x20')],_0x292981['id']);var _0x415df2={'ListId':_0x532d50};var _0xd8511c=_0x77b818[_0xef17('0x24')]&&_0x77b818[_0xef17('0x24')]!=='0'?_0x77b818[_0xef17('0x24')]:_0xef17('0x18');if(_0xe1504){logger[_0xef17('0x8')](_0xef17('0x25'),_0x325330[_0xef17('0x20')],_0x292981['id']);_0x415df2[_0xd8511c]=_[_0xef17('0x26')](_0x325330['routeId'])?_0x325330[_0xef17('0x15')]:_0x325330[_0xef17('0x14')];if(_[_0xef17('0x26')](_0x325330[_0xef17('0x13')])){_0x415df2['firstName']=_0x325330[_0xef17('0x27')]&&_0x325330[_0xef17('0x27')]!==_0xef17('0x28')?_0x325330[_0xef17('0x27')]:'Unknown';}else{_0x415df2[_0xef17('0x16')]=_0x325330['destcalleridname']&&_0x325330['destcalleridname']!==_0xef17('0x28')?_0x325330['destcalleridname']:'Unknown';}return BPromise['resolve']()[_0xef17('0x1d')](cmContactRpc[_0xef17('0x29')](_0x415df2))['then'](function(_0x242eb1){_0x30c3d3=_0x242eb1;_0x12ac40['push'](_0x242eb1);if(_0x30c3d3){logger[_0xef17('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x325330[_0xef17('0x20')],_0x292981['id'],_0x30c3d3['id']);}return;});}else{logger[_0xef17('0x8')](_0xef17('0x2a'),_0x325330['uniqueid'],_0x292981['id']);_0x415df2[_0xd8511c]=_[_0xef17('0x26')](_0x325330[_0xef17('0x13')])?_0x325330[_0xef17('0x15')]:_0x325330[_0xef17('0x14')];if(_['isNil'](_0x325330[_0xef17('0x13')])){_0x415df2[_0xef17('0x16')]=_0x325330[_0xef17('0x27')]&&_0x325330[_0xef17('0x27')]!==_0xef17('0x28')?_0x325330[_0xef17('0x27')]:_0xef17('0x2b');}else{_0x415df2['firstName']=_0x325330[_0xef17('0x2c')]&&_0x325330[_0xef17('0x2c')]!==_0xef17('0x28')?_0x325330[_0xef17('0x2c')]:_0xef17('0x2b');}_0x30c3d3=_0x415df2;_0x12ac40[_0xef17('0x2d')](_0x415df2);return;}}})[_0xef17('0x1d')](function(){if(_0x50add5){emit(_0x325330[_0xef17('0x20')],_0x292981,util[_0xef17('0x2e')](_0xef17('0x2f'),_0x50add5[_0xef17('0x30')]),util[_0xef17('0x2e')](_0xef17('0x31'),_0x77b818[_0xef17('0x32')][_0xef17('0x33')]()),{'evt':_['merge'](_0x325330,{'autoCreate':_0xe1504}),'contact':_0x30c3d3===undefined?{}:_0x30c3d3,'contacts':_0x12ac40[_0xef17('0x34')]===0x0?undefined:_0x12ac40});}});}; \ No newline at end of file +var _0x5f12=['emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','firstName','lastName','fax','createdAt','scheduledAt','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','routeId','calleridnum','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','trigger:%s','action','merge','../../../../config/logger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify'];(function(_0x5eb409,_0x2566cf){var _0x45418e=function(_0x5c30d7){while(--_0x5c30d7){_0x5eb409['push'](_0x5eb409['shift']());}};_0x45418e(++_0x2566cf);}(_0x5f12,0xc9));var _0x25f1=function(_0x40a21c,_0x248e9c){_0x40a21c=_0x40a21c-0x0;var _0x4eb108=_0x5f12[_0x40a21c];return _0x4eb108;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x25f1('0x0'))('trigger');var cmContactRpc=require(_0x25f1('0x1'));config[_0x25f1('0x2')]=_['defaults'](config[_0x25f1('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x25f1('0x3'))(new Redis(config[_0x25f1('0x2')]));function emit(_0x3e2091,_0x5b499f,_0x2dd24a,_0x2ed71f,_0x36c74f){logger[_0x25f1('0x4')](_0x25f1('0x5'),_0x3e2091,_0x5b499f['id'],_0x2dd24a,_0x2ed71f,JSON[_0x25f1('0x6')](_0x36c74f));io['to'](_0x2dd24a)[_0x25f1('0x7')](_0x2ed71f,_0x36c74f);}exports[_0x25f1('0x8')]=function(_0x362088,_0x49bc2d,_0x56b59c,_0x142e5f){var _0x1d16eb,_0x4d03fd;var _0xa064b={};var _0x409561=Number(_0x56b59c[_0x25f1('0x9')]);var _0xc3c805=_0x56b59c[_0x25f1('0xa')]?Boolean(Number(_0x56b59c[_0x25f1('0xa')])):![];var _0x1e13c1;if(_0x142e5f[_0x25f1('0xb')]){_0xa064b['id']=_0x142e5f[_0x25f1('0xb')];}if(!_0xa064b['id']){_0xa064b[_0x25f1('0xc')]=_0x409561;_0x1e13c1=_0x56b59c[_0x25f1('0xd')]&&_0x56b59c['data3']!=='0'?_0x56b59c[_0x25f1('0xd')][_0x25f1('0xe')](','):[_0x25f1('0xf')];_0xa064b['$or']=_[_0x25f1('0x10')](_0x1e13c1,function(_0x364ec8){var _0x2de28a={};_0x2de28a[_0x364ec8]=_0x142e5f['routeId']?_0x142e5f[_0x25f1('0x11')]:_0x142e5f['calleridnum'];return _0x2de28a;});}var _0x361239=['id',_0x25f1('0x12'),_0x25f1('0x13'),_0x25f1('0xf'),'mobile',_0x25f1('0x14'),_0x25f1('0xc'),_0x25f1('0x15'),_0x25f1('0x16'),_0x25f1('0x17')];var _0x23030e=_[_0x25f1('0x18')](_0x361239,_0x1e13c1);BPromise[_0x25f1('0x19')]()[_0x25f1('0x1a')](cmContactRpc[_0x25f1('0x1b')]({'attributes':_0x23030e,'where':_0xa064b}))[_0x25f1('0x1a')](function(_0x164d51){_0x4d03fd=_0x164d51;if(!_[_0x25f1('0x1c')](_0x4d03fd)){if(_0x4d03fd[_0x25f1('0x1d')]===0x1){_0x1d16eb=_0x4d03fd[0x0];logger[_0x25f1('0x4')](_0x25f1('0x1e'),_0x142e5f['uniqueid'],_0x49bc2d['id'],_0x1d16eb['id']);}else{logger[_0x25f1('0x4')](_0x25f1('0x1f'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id'],_[_0x25f1('0x10')](_0x4d03fd,'id')[_0x25f1('0x21')](','));}return;}else{logger[_0x25f1('0x4')](_0x25f1('0x22'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id']);var _0x194627={'ListId':_0x409561};var _0x3f3d37=_0x56b59c[_0x25f1('0x23')]&&_0x56b59c['data4']!=='0'?_0x56b59c['data4']:'phone';if(_0xc3c805){logger['info'](_0x25f1('0x24'),_0x142e5f['uniqueid'],_0x49bc2d['id']);_0x194627[_0x3f3d37]=_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])?_0x142e5f[_0x25f1('0x27')]:_0x142e5f[_0x25f1('0x11')];if(_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])){_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x28')]&&_0x142e5f['calleridname']!==_0x25f1('0x29')?_0x142e5f['calleridname']:_0x25f1('0x2a');}else{_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x2b')]&&_0x142e5f[_0x25f1('0x2b')]!==_0x25f1('0x29')?_0x142e5f['destcalleridname']:_0x25f1('0x2a');}return BPromise[_0x25f1('0x19')]()[_0x25f1('0x1a')](cmContactRpc['createContact'](_0x194627))['then'](function(_0xfb78f3){_0x1d16eb=_0xfb78f3;_0x4d03fd[_0x25f1('0x2c')](_0xfb78f3);if(_0x1d16eb){logger[_0x25f1('0x4')](_0x25f1('0x2d'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id'],_0x1d16eb['id']);}return;});}else{logger[_0x25f1('0x4')](_0x25f1('0x2e'),_0x142e5f['uniqueid'],_0x49bc2d['id']);_0x194627[_0x3f3d37]=_[_0x25f1('0x25')](_0x142e5f['routeId'])?_0x142e5f['calleridnum']:_0x142e5f[_0x25f1('0x11')];if(_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])){_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x28')]&&_0x142e5f[_0x25f1('0x28')]!==_0x25f1('0x29')?_0x142e5f['calleridname']:_0x25f1('0x2a');}else{_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x2b')]&&_0x142e5f[_0x25f1('0x2b')]!==_0x25f1('0x29')?_0x142e5f[_0x25f1('0x2b')]:_0x25f1('0x2a');}_0x1d16eb=_0x194627;_0x4d03fd[_0x25f1('0x2c')](_0x194627);return;}}})['then'](function(){if(_0x362088){emit(_0x142e5f[_0x25f1('0x20')],_0x49bc2d,util['format'](_0x25f1('0x2f'),_0x362088[_0x25f1('0x30')]),util['format'](_0x25f1('0x31'),_0x56b59c[_0x25f1('0x32')]['toLowerCase']()),{'evt':_[_0x25f1('0x33')](_0x142e5f,{'autoCreate':_0xc3c805}),'contact':_0x1d16eb===undefined?{}:_0x1d16eb,'contacts':_0x4d03fd[_0x25f1('0x1d')]===0x0?undefined:_0x4d03fd});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a18d7b9..71ce993 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 _0x6107=['custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','prototype','clone','undefined','motionChannel','checkTriggers','interface','status','merge','variables','Actions','length','action','contactmanager','motionbar','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','data3','data4','location','uriLocation','windowWidth','isNil','800','data5','data6','600','winapp','winArguments','user:%s','name','format','trigger:%s:%s','toLowerCase','integration','exec','queue','routeId','urlforward','script','buildUri','parse','replace','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','some','field','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','substatus','exports','util','lodash','url','ioredis','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction'];(function(_0x248c20,_0x51b1e9){var _0x2f9c0d=function(_0x4e1125){while(--_0x4e1125){_0x248c20['push'](_0x248c20['shift']());}};_0x2f9c0d(++_0x51b1e9);}(_0x6107,0x12f));var _0x7610=function(_0x49186e,_0x5ed4c1){_0x49186e=_0x49186e-0x0;var _0x909133=_0x6107[_0x49186e];return _0x909133;};'use strict';var util=require(_0x7610('0x0'));var _=require(_0x7610('0x1'));var url=require(_0x7610('0x2'));var Mustache=require('mustache');var Redis=require(_0x7610('0x3'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x7610('0x4'));var script=require(_0x7610('0x5'));var config=require(_0x7610('0x6'));var logger=require(_0x7610('0x7'))(_0x7610('0x8'));var ami=require(_0x7610('0x9'));config[_0x7610('0xa')]=_[_0x7610('0xb')](config[_0x7610('0xa')],{'host':_0x7610('0xc'),'port':0x18eb});var io=require(_0x7610('0xd'))(new Redis(config[_0x7610('0xa')]));var operators={'equals':function(_0x429ede,_0x11d92f){return _0x429ede==_0x11d92f;},'not_equals':function(_0x1b45e5,_0x4077e6){return _0x1b45e5!=_0x4077e6;}};var barAndWebActions=[_0x7610('0xe'),_0x7610('0x2'),'winapp'];function Trigger(_0x50db01){this['triggers']=_0x50db01[_0x7610('0xf')];this[_0x7610('0x10')]=_0x50db01[_0x7610('0x10')];this[_0x7610('0x11')]=_0x50db01['voiceQueues'];this['templates']=_0x50db01['templates'];this[_0x7610('0x12')]=_0x50db01[_0x7610('0x12')];this[_0x7610('0x13')]=_0x50db01[_0x7610('0x13')];this[_0x7610('0x14')]=_0x50db01[_0x7610('0x14')];this['salesforceAccounts']=_0x50db01[_0x7610('0x15')];this['sugarcrmAccounts']=_0x50db01[_0x7610('0x16')];this[_0x7610('0x17')]=_0x50db01[_0x7610('0x17')];this[_0x7610('0x18')]=_0x50db01[_0x7610('0x18')];this[_0x7610('0x19')]=_0x50db01[_0x7610('0x19')];this[_0x7610('0x1a')]=_0x50db01['servicenowAccounts'];this[_0x7610('0x1b')]=_0x50db01['dynamics365Accounts'];this['freshsalesAccounts']=_0x50db01[_0x7610('0x1c')];this[_0x7610('0x1d')]={'zendesk':this[_0x7610('0x13')],'salesforce':this[_0x7610('0x15')],'freshdesk':this[_0x7610('0x14')],'sugarcrm':this[_0x7610('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0x7610('0x18')],'vtiger':this[_0x7610('0x19')],'dynamics365':this[_0x7610('0x1b')],'freshsales':this[_0x7610('0x1c')],'servicenow':this[_0x7610('0x1a')]};ami['on']('custom:agentcalled',this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x20'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x21'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x22'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x23'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x24'),this[_0x7610('0x1e')]['bind'](this));ami['on'](_0x7610('0x25'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on']('custom:agentcongestion',this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x26'),this['syncCustomEvent'][_0x7610('0x1f')](this));ami['on'](_0x7610('0x27'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on']('custom:queuecallerabandon',this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x28'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0x7610('0x29')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x2a'),this[_0x7610('0x29')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x2b'),this['syncAgentDial'][_0x7610('0x1f')](this));ami['on']('custom:newinteraction',this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x2c'),this[_0x7610('0x1e')]['bind'](this));ami['on'](_0x7610('0x2d'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on'](_0x7610('0x2e'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));ami['on']('custom:acceptmessage',this[_0x7610('0x1e')]['bind'](this));ami['on'](_0x7610('0x2f'),this[_0x7610('0x1e')][_0x7610('0x1f')](this));}Trigger['prototype'][_0x7610('0x30')]=function(_0x39f5b5,_0x2db160,_0x57ed3d){logger['info'](_0x39f5b5,_0x2db160,JSON['stringify'](_0x57ed3d));io['to'](_0x39f5b5)[_0x7610('0x30')](_0x2db160,_0x57ed3d);};Trigger[_0x7610('0x31')]['syncCustomEvent']=function(_0x86c65e){var _0x200476=_[_0x7610('0x32')](_0x86c65e);if(typeof _0x200476['motionChannel']===_0x7610('0x33')){_0x200476[_0x7610('0x34')]='voice';}this[_0x7610('0x35')](_0x200476);};Trigger[_0x7610('0x31')][_0x7610('0x29')]=function(_0xc5615a){if(this[_0x7610('0x10')][_0xc5615a[_0x7610('0x36')]]){this[_0x7610('0x1e')](_0xc5615a);}};Trigger[_0x7610('0x31')]['checkTriggers']=function(_0x39c9d9){var _0x440716;for(var _0x25bf50 in this['triggers']){if(this[_0x7610('0xf')]['hasOwnProperty'](_0x25bf50)){if(this['triggers'][_0x25bf50][_0x7610('0x37')]){_0x440716=this['checkTrigger'](this[_0x7610('0xf')][_0x25bf50],_0x39c9d9);if(_0x440716){_[_0x7610('0x38')](_0x39c9d9,_0x39c9d9[_0x7610('0x39')]);for(var _0x232ffe=0x0,_0x109c7b,_0x2a5ee0,_0x4e1ff6;_0x232ffe0x0){_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 +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x5b3602,_0x3291d8){var _0x28eb7f=function(_0x5f3e60){while(--_0x5f3e60){_0x5b3602['push'](_0x5b3602['shift']());}};_0x28eb7f(++_0x3291d8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 64473d4..6cfbdb4 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 _0x4dbb=['monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase','message','Bearer\x20','4.0','value','isNil','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId','username','internalemailaddress','outbound','destcalleridnum','POST','contacts','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20Created!','includes','string','nameField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','ticketType','phonecall','phonecalls','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x4dbb,0xd4));var _0xb4db=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x4dbb[_0x424357];return _0x29c68e;};'use strict';var _=require(_0xb4db('0x0'));var BPromise=require(_0xb4db('0x1'));var rp=require(_0xb4db('0x2'));var util=require(_0xb4db('0x3'));var intUtil=require('./util');var md5=require(_0xb4db('0x4'));var Redis=require(_0xb4db('0x5'));var logger=require(_0xb4db('0x6'))(_0xb4db('0x7'));var config=require(_0xb4db('0x8'));config[_0xb4db('0x9')]=_[_0xb4db('0xa')](config[_0xb4db('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb4db('0xb'))(new Redis(config[_0xb4db('0x9')]));function getAuthToken(_0xf3724b,_0x18032b,_0x2d1715){var _0x163a9b={'method':'POST','uri':_0x18032b,'form':{'client_id':_0xf3724b[_0xb4db('0xc')],'resource':_0xf3724b['remoteUri'],'username':_0xf3724b['username'],'password':_0xf3724b[_0xb4db('0xd')],'grant_type':_0xb4db('0xd'),'client_secret':_0xf3724b[_0xb4db('0xe')]},'json':!![]};return rp(_0x163a9b)[_0xb4db('0xf')](function(_0x51d1e2){return _0x51d1e2[_0xb4db('0x10')];})[_0xb4db('0x11')](function(_0x574aa8){logger[_0xb4db('0x12')]('['+[_0x2d1715[_0xb4db('0x13')]()]+']\x20Wrong\x20credentials!');return _0x574aa8[_0xb4db('0x14')];});}function getUser(_0x1d6180,_0x1aa099,_0x428e84,_0x484c5c,_0x58026f,_0x509231){return new BPromise(function(_0x580cd1,_0x19c29f){return getAuthToken(_0x1aa099,_0x484c5c,_0x509231)[_0xb4db('0xf')](function(_0x232b56){var _0x282b28={'method':'GET','uri':_0x58026f+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xb4db('0x15')+_0x232b56,'OData-Version':_0xb4db('0x16')},'json':!![]};return rp(_0x282b28);})[_0xb4db('0xf')](function(_0x1690d8){var _0x1102d1=_0x1690d8[_0xb4db('0x17')];var _0x53ce42=![];var _0x470f17=null;if(!_[_0xb4db('0x18')](_0x428e84)){if(intUtil['validateEmail'](_0x428e84[_0xb4db('0x19')])){_0x1d6180[_0xb4db('0x1a')]=_0x428e84[_0xb4db('0x19')];for(_0x470f17=0x0;_0x470f17<_0x1102d1[_0xb4db('0x1b')];_0x470f17++){if(_0x1102d1[_0x470f17]['internalemailaddress']===_0x428e84[_0xb4db('0x19')]&&!_0x1102d1[_0x470f17]['isdisabled']){_0x53ce42=!![];logger[_0xb4db('0x1c')]('['+[_0x509231[_0xb4db('0x13')]()]+_0xb4db('0x1d')+_0x1102d1[_0x470f17][_0xb4db('0x1e')]+'!');_0x1d6180[_0xb4db('0x1f')]=_0x1102d1[_0x470f17][_0xb4db('0x1e')];}}}}if(!_0x53ce42){logger[_0xb4db('0x1c')]('['+[_0x509231[_0xb4db('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1d6180[_0xb4db('0x1a')]=_0x1aa099[_0xb4db('0x20')];for(_0x470f17=0x0;_0x470f17<_0x1102d1[_0xb4db('0x1b')];_0x470f17++){if(_0x1102d1[_0x470f17][_0xb4db('0x21')]===_0x1aa099[_0xb4db('0x20')]){_0x1d6180[_0xb4db('0x1f')]=_0x1102d1[_0x470f17][_0xb4db('0x1e')];}}}_0x580cd1(_0x1d6180);})[_0xb4db('0x11')](function(_0x276cca){_0x19c29f(_0x276cca['message']);});});}function createEndUser(_0x67eccb,_0x573236,_0x2b065c,_0x181c84,_0x4cf727,_0x2935fd){return new BPromise(function(_0x5d4456,_0x163f4b){return getAuthToken(_0x573236,_0x2b065c,_0x2935fd)[_0xb4db('0xf')](function(_0x27fb1c){var _0x470465=_0x2935fd['toLowerCase']()===_0xb4db('0x22')?_0x4cf727[_0xb4db('0x23')]:_0x4cf727['calleridnum'];var _0x294a53={'method':_0xb4db('0x24'),'uri':_0x181c84+_0xb4db('0x25'),'body':{'telephone1':_0x470465,'fullname':_0x470465,'firstname':_0x470465,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x67eccb[_0xb4db('0x1f')]+')'},'headers':{'Authorization':_0xb4db('0x15')+_0x27fb1c,'OData-Version':_0xb4db('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x294a53);})[_0xb4db('0xf')](function(_0xb39828){var _0x33a6fa=_0xb39828['headers'][_0xb4db('0x26')];var _0x1e2cec=_0x33a6fa[_0xb4db('0x27')](_0x33a6fa[_0xb4db('0x28')]('(')+0x1,_0x33a6fa[_0xb4db('0x28')](')'));_0x67eccb[_0xb4db('0x29')]=_0x1e2cec;_0x5d4456(_0x67eccb);})[_0xb4db('0x11')](function(_0x107b76){_0x163f4b(_0x107b76[_0xb4db('0x14')]);});});}function getEndUser(_0x5781a4,_0x156d32,_0xc0d623,_0x2059e9,_0x3e31e3,_0x36fcec){return new BPromise(function(_0x1c154a,_0x5a1f33){var _0x51fc9a=_0x36fcec[_0xb4db('0x2a')]()==='outbound'?_0x3e31e3['destcalleridnum']:_0x3e31e3[_0xb4db('0x2b')];return getAuthToken(_0x156d32,_0xc0d623,_0x36fcec)[_0xb4db('0xf')](function(_0x5a423f){var _0x1f0a23={'method':'GET','uri':_0x2059e9+_0xb4db('0x2c')+_0x51fc9a[_0xb4db('0x2d')]('+',_0xb4db('0x2e'))+'\x27','headers':{'Authorization':_0xb4db('0x15')+_0x5a423f,'If-None-Match':null,'OData-Version':_0xb4db('0x16')},'json':!![]};return rp(_0x1f0a23);})[_0xb4db('0xf')](function(_0x4e8f7d){var _0x1d82e6=null;if(_0x4e8f7d){var _0x4120f8=_0x4e8f7d[_0xb4db('0x17')];var _0x1d5751=![];for(_0x1d82e6=0x0;_0x1d82e6<_0x4120f8['length'];_0x1d82e6++){if(_0x4120f8[_0x1d82e6]['telephone1']===_0x51fc9a){_0x1d5751=!![];_0x5781a4[_0xb4db('0x29')]=_0x4120f8[_0x1d82e6][_0xb4db('0x2f')];}}if(_0x1d5751){_0x1c154a(_0x5781a4);}else{return createEndUser(_0x5781a4,_0x156d32,_0xc0d623,_0x2059e9,_0x3e31e3,_0x36fcec)[_0xb4db('0xf')](function(_0x59b3b7){logger[_0xb4db('0x1c')]('['+[_0x36fcec[_0xb4db('0x13')]()]+']\x20Enduser\x20created!',_0x59b3b7[_0xb4db('0x29')]);_0x1c154a(_0x59b3b7);});}}else{return createEndUser(_0x5781a4,_0x156d32,_0xc0d623,_0x2059e9,_0x3e31e3,_0x36fcec)[_0xb4db('0xf')](function(_0x26cabc){logger[_0xb4db('0x1c')]('['+[_0x36fcec[_0xb4db('0x13')]()]+_0xb4db('0x30'),_0x26cabc[_0xb4db('0x29')]);_0x1c154a(_0x26cabc);});}});});}function getCustomFields(_0x6fd64e,_0x200e47,_0x4608f1){var _0x136b8c={};if(_0x6fd64e[_0xb4db('0x1b')]>0x0){_['forEach'](_0x6fd64e,function(_0x3dd72a){if(_[_0xb4db('0x31')]([_0xb4db('0x32'),'picklist'],_0x3dd72a['type'])&&_0x3dd72a[_0xb4db('0x33')]&&!_0x3dd72a['customField']){var _0x14f208=_0x3dd72a['idField']['toLowerCase']();var _0x23ee27=_0x14f208['substring'](0x0,_0x14f208[_0xb4db('0x34')]('_'));var _0x44f134=_0x14f208[_0xb4db('0x27')](_0x14f208[_0xb4db('0x34')]('_')+0x1);if(_0x23ee27===_0x4608f1){_0x136b8c[_0x44f134]=_0x3dd72a[_0xb4db('0x35')];}}});}return _0x136b8c;}function getTicket(_0x54b232,_0x33b618,_0x4c5fdb,_0x13785e,_0x5b273f,_0x305364,_0x3b3179){return new BPromise(function(_0x4c958b,_0x22b31d){var _0x1ad964;return getAuthToken(_0x33b618,_0x4c5fdb,_0x3b3179)['then'](function(_0x40d3bd){if(_0x305364['ticketType']===_0xb4db('0x36')){_0x1ad964={'method':_0xb4db('0x24'),'uri':_0x13785e+_0xb4db('0x37'),'body':Object[_0xb4db('0x38')]({},{'title':intUtil[_0xb4db('0x39')](_0x305364[_0xb4db('0x3a')],_0x5b273f,'\x20'),'description':intUtil['getString'](_0x305364[_0xb4db('0x3b')],_0x5b273f,'\x0a'),'customerid_contact@odata.bind':_0xb4db('0x3c')+_0x54b232['enduserId']+')','ownerid@odata.bind':_0xb4db('0x3d')+_0x54b232[_0xb4db('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x305364[_0xb4db('0x3e')],_0x5b273f,_0x305364[_0xb4db('0x3f')])),'headers':{'Authorization':_0xb4db('0x15')+_0x40d3bd,'OData-Version':_0xb4db('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x305364['ticketType']===_0xb4db('0x40')){_0x1ad964={'method':_0xb4db('0x24'),'uri':_0x13785e+_0xb4db('0x41'),'body':Object[_0xb4db('0x38')]({},{'subject':intUtil[_0xb4db('0x39')](_0x305364[_0xb4db('0x3a')],_0x5b273f,'\x20'),'phonenumber':String(_0x5b273f[_0xb4db('0x2b')]),'description':intUtil[_0xb4db('0x39')](_0x305364[_0xb4db('0x3b')],_0x5b273f,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb4db('0x3c')+_0x54b232['enduserId']+')','ownerid@odata.bind':_0xb4db('0x3d')+_0x54b232[_0xb4db('0x1f')]+')','directioncode':_0x54b232[_0xb4db('0x42')]===_0xb4db('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xb4db('0x3d')+_0x54b232['userId']+')','participationtypemask':_0x54b232['callDirection']===_0xb4db('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xb4db('0x3c')+_0x54b232[_0xb4db('0x29')]+')','participationtypemask':_0x54b232[_0xb4db('0x42')]===_0xb4db('0x43')?0x1:0x2}]},getCustomFields(_0x305364[_0xb4db('0x3e')],_0x5b273f,_0x305364['ticketType'])),'headers':{'Authorization':_0xb4db('0x15')+_0x40d3bd,'OData-Version':_0xb4db('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1ad964);})[_0xb4db('0xf')](function(_0x34701f){var _0x35003e=_0x34701f['headers'][_0xb4db('0x26')];var _0x171bb3=_0x35003e['substring'](_0x35003e[_0xb4db('0x28')]('(')+0x1,_0x35003e[_0xb4db('0x28')](')'));_0x54b232[_0xb4db('0x44')]=_0x171bb3;_0x4c958b(_0x54b232);})['catch'](function(_0x1d145e){_0x22b31d(_0x1d145e[_0xb4db('0x14')]);});});}function emit(_0x1a6b76,_0x52306c,_0x4d6676,_0x50d215){var _0x5765fd={'uri':util[_0xb4db('0x45')](_0xb4db('0x46'),_0x1a6b76,_0x4d6676,_0x50d215)};io['to'](util[_0xb4db('0x45')](_0xb4db('0x47'),_0x52306c))[_0xb4db('0x48')](_0xb4db('0x49'),_0x5765fd);}exports['cs']=function(_0x1666f6,_0x55d620,_0x144264,_0x18bf8f,_0x2b1d5d,_0x53e01f,_0x147773,_0x1f4fa6){var _0x26f242={};_0x53e01f[_0xb4db('0x4a')]=intUtil[_0xb4db('0x4b')](_0x53e01f[_0xb4db('0x4a')]);_0x53e01f[_0xb4db('0x4c')]=intUtil[_0xb4db('0x4b')](_0x53e01f['serverUrl']);_0x26f242[_0xb4db('0x42')]=_0x1f4fa6===_0xb4db('0x43')||_0x1f4fa6===_0xb4db('0x4d')?'queue':_0xb4db('0x22');var _0x5cc8ec=util[_0xb4db('0x45')](_0xb4db('0x4e'),_0x53e01f[_0xb4db('0x4a')]);var _0x340e85=util[_0xb4db('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x53e01f[_0xb4db('0x4f')]);var _0x23070a=util[_0xb4db('0x45')](_0xb4db('0x50'),_0x53e01f[_0xb4db('0x4c')],_0x55d620['uniqueid'],md5(_0x55d620[_0xb4db('0x51')]));if(_0x2b1d5d&&_0x2b1d5d[_0xb4db('0x52')]){logger[_0xb4db('0x1c')](_0xb4db('0x53'),'Recording\x20is\x20enabled!');_0x55d620[_0xb4db('0x54')]=_0x23070a;}else if(_0x147773&&_0x147773[_0xb4db('0x55')]&&_0x147773['recordingFormat']!==_0xb4db('0x56')){logger[_0xb4db('0x1c')](_0xb4db('0x57'),_0xb4db('0x58'));_0x55d620[_0xb4db('0x54')]=_0x23070a;}else{_0x55d620[_0xb4db('0x54')]='';}return getUser(_0x26f242,_0x53e01f,_0x18bf8f,_0x340e85,_0x5cc8ec,_0x1f4fa6)[_0xb4db('0xf')](function(_0x12a7ec){logger['info']('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x59'),_0x12a7ec[_0xb4db('0x1f')]);logger[_0xb4db('0x1c')]('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x5a'),_0x12a7ec['userEmail']);return getEndUser(_0x12a7ec,_0x53e01f,_0x340e85,_0x5cc8ec,_0x55d620,_0x1f4fa6);})['then'](function(_0x9b8df3){logger[_0xb4db('0x1c')]('['+_0x1f4fa6[_0xb4db('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x9b8df3[_0xb4db('0x29')]);logger[_0xb4db('0x1c')]('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x5b'),_0x55d620['calleridnum']);return getTicket(_0x9b8df3,_0x53e01f,_0x340e85,_0x5cc8ec,_0x55d620,_0x144264,_0x1f4fa6);})[_0xb4db('0xf')](function(_0xc06204){logger[_0xb4db('0x1c')](util['format']('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x5c'),_0x144264[_0xb4db('0x3f')],_0xc06204[_0xb4db('0x44')]));logger[_0xb4db('0x1c')](util['format']('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x5d'),_0x1f4fa6));if(_0x1f4fa6!==_0xb4db('0x4d')){logger['info']('['+_0x1f4fa6[_0xb4db('0x13')]()+']',_0xb4db('0x5e'));emit(_0x53e01f[_0xb4db('0x4a')],_0x18bf8f[_0xb4db('0x5f')],_0x144264['ticketType'],_0xc06204[_0xb4db('0x44')]);}})[_0xb4db('0x11')](function(_0x1b08eb){logger[_0xb4db('0x12')]('['+_0x1f4fa6[_0xb4db('0x13')]()+_0xb4db('0x60'),util[_0xb4db('0x61')](_0x1b08eb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa624=['destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','lastIndexOf','enduserId','outbound','GET','replace','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','customField','idField','substring','indexOf','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','request-promise','util','./util','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','POST','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase','username','length'];(function(_0x49bd20,_0x141ebb){var _0x318f58=function(_0x4b8068){while(--_0x4b8068){_0x49bd20['push'](_0x49bd20['shift']());}};_0x318f58(++_0x141ebb);}(_0xa624,0x9b));var _0x4a62=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0xa624[_0xa4c85];return _0x172c1f;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x4a62('0x0'));var util=require(_0x4a62('0x1'));var intUtil=require(_0x4a62('0x2'));var md5=require(_0x4a62('0x3'));var Redis=require(_0x4a62('0x4'));var logger=require(_0x4a62('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x4a62('0x6')],{'host':_0x4a62('0x7'),'port':0x18eb});var io=require(_0x4a62('0x8'))(new Redis(config[_0x4a62('0x6')]));function getAuthToken(_0x408be4,_0x10ccfa,_0x1d06f7){var _0x168fa3={'method':_0x4a62('0x9'),'uri':_0x10ccfa,'form':{'client_id':_0x408be4['clientId'],'resource':_0x408be4['remoteUri'],'username':_0x408be4['username'],'password':_0x408be4[_0x4a62('0xa')],'grant_type':'password','client_secret':_0x408be4[_0x4a62('0xb')]},'json':!![]};return rp(_0x168fa3)[_0x4a62('0xc')](function(_0x50f7db){return _0x50f7db[_0x4a62('0xd')];})[_0x4a62('0xe')](function(_0xd61738){logger[_0x4a62('0xf')]('['+[_0x1d06f7['toUpperCase']()]+_0x4a62('0x10'));return _0xd61738[_0x4a62('0x11')];});}function getUser(_0x4ee049,_0xf2ddf3,_0x3e676b,_0x40fc4b,_0x24bbac,_0x47766c){return new BPromise(function(_0x86872,_0x33471f){return getAuthToken(_0xf2ddf3,_0x40fc4b,_0x47766c)['then'](function(_0x4ca5b3){var _0x6d53f3={'method':'GET','uri':_0x24bbac+_0x4a62('0x12'),'headers':{'Authorization':_0x4a62('0x13')+_0x4ca5b3,'OData-Version':'4.0'},'json':!![]};return rp(_0x6d53f3);})['then'](function(_0x479005){var _0x252c15=_0x479005[_0x4a62('0x14')];var _0x24ce22=![];var _0x20ed76=null;if(!_['isNil'](_0x3e676b)){if(intUtil[_0x4a62('0x15')](_0x3e676b[_0x4a62('0x16')])){_0x4ee049[_0x4a62('0x17')]=_0x3e676b['email'];for(_0x20ed76=0x0;_0x20ed76<_0x252c15['length'];_0x20ed76++){if(_0x252c15[_0x20ed76][_0x4a62('0x18')]===_0x3e676b[_0x4a62('0x16')]&&!_0x252c15[_0x20ed76][_0x4a62('0x19')]){_0x24ce22=!![];logger[_0x4a62('0x1a')]('['+[_0x47766c['toUpperCase']()]+_0x4a62('0x1b')+_0x252c15[_0x20ed76][_0x4a62('0x1c')]+'!');_0x4ee049[_0x4a62('0x1d')]=_0x252c15[_0x20ed76][_0x4a62('0x1c')];}}}}if(!_0x24ce22){logger[_0x4a62('0x1a')]('['+[_0x47766c[_0x4a62('0x1e')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4ee049[_0x4a62('0x17')]=_0xf2ddf3[_0x4a62('0x1f')];for(_0x20ed76=0x0;_0x20ed76<_0x252c15[_0x4a62('0x20')];_0x20ed76++){if(_0x252c15[_0x20ed76][_0x4a62('0x18')]===_0xf2ddf3['username']){_0x4ee049[_0x4a62('0x1d')]=_0x252c15[_0x20ed76][_0x4a62('0x1c')];}}}_0x86872(_0x4ee049);})[_0x4a62('0xe')](function(_0x4fa851){_0x33471f(_0x4fa851[_0x4a62('0x11')]);});});}function createEndUser(_0x3f1669,_0x4f5fe6,_0x3e7941,_0x2a1b2b,_0x2cb162,_0x37f328){return new BPromise(function(_0x385c59,_0x5984c2){return getAuthToken(_0x4f5fe6,_0x3e7941,_0x37f328)[_0x4a62('0xc')](function(_0x37840d){var _0x586e04=_0x37f328['toLowerCase']()==='outbound'?_0x2cb162[_0x4a62('0x21')]:_0x2cb162[_0x4a62('0x22')];var _0x551789={'method':'POST','uri':_0x2a1b2b+_0x4a62('0x23'),'body':{'telephone1':_0x586e04,'fullname':_0x586e04,'firstname':_0x586e04,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4a62('0x24')+_0x3f1669[_0x4a62('0x1d')]+')'},'headers':{'Authorization':_0x4a62('0x13')+_0x37840d,'OData-Version':_0x4a62('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x551789);})[_0x4a62('0xc')](function(_0x499ff0){var _0xb0d63f=_0x499ff0[_0x4a62('0x26')][_0x4a62('0x27')];var _0x912c3d=_0xb0d63f['substring'](_0xb0d63f[_0x4a62('0x28')]('(')+0x1,_0xb0d63f[_0x4a62('0x28')](')'));_0x3f1669[_0x4a62('0x29')]=_0x912c3d;_0x385c59(_0x3f1669);})[_0x4a62('0xe')](function(_0x1490b9){_0x5984c2(_0x1490b9[_0x4a62('0x11')]);});});}function getEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0){return new BPromise(function(_0x2ca83a,_0x2d1cd5){var _0x468756=_0x25dec0['toLowerCase']()===_0x4a62('0x2a')?_0x17facd['destcalleridnum']:_0x17facd[_0x4a62('0x22')];return getAuthToken(_0x2cd968,_0x620356,_0x25dec0)['then'](function(_0x18d926){var _0x4a33ce={'method':_0x4a62('0x2b'),'uri':_0x5da66b+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x468756[_0x4a62('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x18d926,'If-None-Match':null,'OData-Version':_0x4a62('0x25')},'json':!![]};return rp(_0x4a33ce);})[_0x4a62('0xc')](function(_0x2987da){var _0x2cca94=null;if(_0x2987da){var _0x4451a1=_0x2987da[_0x4a62('0x14')];var _0x383699=![];for(_0x2cca94=0x0;_0x2cca94<_0x4451a1['length'];_0x2cca94++){if(_0x4451a1[_0x2cca94][_0x4a62('0x2d')]===_0x468756){_0x383699=!![];_0x2b7a39[_0x4a62('0x29')]=_0x4451a1[_0x2cca94][_0x4a62('0x2e')];}}if(_0x383699){_0x2ca83a(_0x2b7a39);}else{return createEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0)[_0x4a62('0xc')](function(_0x1404a3){logger[_0x4a62('0x1a')]('['+[_0x25dec0['toUpperCase']()]+_0x4a62('0x2f'),_0x1404a3[_0x4a62('0x29')]);_0x2ca83a(_0x1404a3);});}}else{return createEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0)[_0x4a62('0xc')](function(_0xe84bfd){logger['info']('['+[_0x25dec0['toUpperCase']()]+_0x4a62('0x30'),_0xe84bfd[_0x4a62('0x29')]);_0x2ca83a(_0xe84bfd);});}});});}function getCustomFields(_0x334ddc,_0x24f894,_0x292942){var _0x43c3b6={};if(_0x334ddc['length']>0x0){_[_0x4a62('0x31')](_0x334ddc,function(_0x14e307){if(_[_0x4a62('0x32')]([_0x4a62('0x33'),_0x4a62('0x34')],_0x14e307[_0x4a62('0x35')])&&_0x14e307['nameField']&&!_0x14e307[_0x4a62('0x36')]){var _0x31d732=_0x14e307[_0x4a62('0x37')]['toLowerCase']();var _0x2e21e0=_0x31d732[_0x4a62('0x38')](0x0,_0x31d732[_0x4a62('0x39')]('_'));var _0x171f2c=_0x31d732[_0x4a62('0x38')](_0x31d732['indexOf']('_')+0x1);if(_0x2e21e0===_0x292942){_0x43c3b6[_0x171f2c]=_0x14e307['content'];}}});}return _0x43c3b6;}function getTicket(_0x41cb73,_0x15202f,_0x313a8d,_0x4f52a7,_0x3708bc,_0x289a9e,_0x4d9c3e){return new BPromise(function(_0x47422a,_0x416f97){var _0x3cc5a8;return getAuthToken(_0x15202f,_0x313a8d,_0x4d9c3e)['then'](function(_0x11f0f1){if(_0x289a9e[_0x4a62('0x3a')]===_0x4a62('0x3b')){_0x3cc5a8={'method':'POST','uri':_0x4f52a7+_0x4a62('0x3c'),'body':Object['assign']({},{'title':intUtil[_0x4a62('0x3d')](_0x289a9e['Subjects'],_0x3708bc,'\x20'),'description':intUtil[_0x4a62('0x3d')](_0x289a9e[_0x4a62('0x3e')],_0x3708bc,'\x0a'),'customerid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73[_0x4a62('0x29')]+')','ownerid@odata.bind':_0x4a62('0x24')+_0x41cb73['userId']+')','caseorigincode':'1'},getCustomFields(_0x289a9e[_0x4a62('0x40')],_0x3708bc,_0x289a9e[_0x4a62('0x3a')])),'headers':{'Authorization':_0x4a62('0x13')+_0x11f0f1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x289a9e[_0x4a62('0x3a')]==='phonecall'){_0x3cc5a8={'method':_0x4a62('0x9'),'uri':_0x4f52a7+_0x4a62('0x41'),'body':Object[_0x4a62('0x42')]({},{'subject':intUtil[_0x4a62('0x3d')](_0x289a9e['Subjects'],_0x3708bc,'\x20'),'phonenumber':String(_0x3708bc[_0x4a62('0x22')]),'description':intUtil['getString'](_0x289a9e[_0x4a62('0x3e')],_0x3708bc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73[_0x4a62('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x41cb73[_0x4a62('0x1d')]+')','directioncode':_0x41cb73[_0x4a62('0x43')]===_0x4a62('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4a62('0x24')+_0x41cb73['userId']+')','participationtypemask':_0x41cb73[_0x4a62('0x43')]===_0x4a62('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73['enduserId']+')','participationtypemask':_0x41cb73['callDirection']===_0x4a62('0x44')?0x1:0x2}]},getCustomFields(_0x289a9e['Fields'],_0x3708bc,_0x289a9e[_0x4a62('0x3a')])),'headers':{'Authorization':_0x4a62('0x13')+_0x11f0f1,'OData-Version':_0x4a62('0x25')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3cc5a8);})[_0x4a62('0xc')](function(_0x55c59d){var _0x103711=_0x55c59d[_0x4a62('0x26')][_0x4a62('0x27')];var _0x2c3f79=_0x103711[_0x4a62('0x38')](_0x103711[_0x4a62('0x28')]('(')+0x1,_0x103711[_0x4a62('0x28')](')'));_0x41cb73['ticketId']=_0x2c3f79;_0x47422a(_0x41cb73);})['catch'](function(_0x53d9c9){_0x416f97(_0x53d9c9[_0x4a62('0x11')]);});});}function emit(_0x1d77bf,_0x2099f4,_0x2cfe9f,_0x4e65a0){var _0x588fd6={'uri':util[_0x4a62('0x45')](_0x4a62('0x46'),_0x1d77bf,_0x2cfe9f,_0x4e65a0)};io['to'](util[_0x4a62('0x45')](_0x4a62('0x47'),_0x2099f4))[_0x4a62('0x48')](_0x4a62('0x49'),_0x588fd6);}exports['cs']=function(_0x10adb8,_0x4c4c30,_0x392433,_0xd5c903,_0xd495d6,_0x189e5a,_0x388a06,_0x12fe2e){var _0x37f98d={};_0x189e5a[_0x4a62('0x4a')]=intUtil[_0x4a62('0x4b')](_0x189e5a[_0x4a62('0x4a')]);_0x189e5a[_0x4a62('0x4c')]=intUtil[_0x4a62('0x4b')](_0x189e5a['serverUrl']);_0x37f98d[_0x4a62('0x43')]=_0x12fe2e===_0x4a62('0x44')||_0x12fe2e===_0x4a62('0x4d')?_0x4a62('0x44'):_0x4a62('0x2a');var _0x94f26=util[_0x4a62('0x45')](_0x4a62('0x4e'),_0x189e5a['remoteUri']);var _0x2167b7=util[_0x4a62('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x189e5a[_0x4a62('0x4f')]);var _0xa5edfb=util['format'](_0x4a62('0x50'),_0x189e5a[_0x4a62('0x4c')],_0x4c4c30[_0x4a62('0x51')],md5(_0x4c4c30[_0x4a62('0x51')]));if(_0xd495d6&&_0xd495d6[_0x4a62('0x52')]){logger[_0x4a62('0x1a')](_0x4a62('0x53'),_0x4a62('0x54'));_0x4c4c30['recordingURL']=_0xa5edfb;}else if(_0x388a06&&_0x388a06[_0x4a62('0x55')]&&_0x388a06[_0x4a62('0x55')]!==_0x4a62('0x56')){logger[_0x4a62('0x1a')]('[OUTBOUND]',_0x4a62('0x54'));_0x4c4c30['recordingURL']=_0xa5edfb;}else{_0x4c4c30[_0x4a62('0x57')]='';}return getUser(_0x37f98d,_0x189e5a,_0xd5c903,_0x2167b7,_0x94f26,_0x12fe2e)[_0x4a62('0xc')](function(_0x37d6b7){logger['info']('['+_0x12fe2e['toUpperCase']()+_0x4a62('0x58'),_0x37d6b7[_0x4a62('0x1d')]);logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']\x20The\x20User\x20email\x20is:',_0x37d6b7[_0x4a62('0x17')]);return getEndUser(_0x37d6b7,_0x189e5a,_0x2167b7,_0x94f26,_0x4c4c30,_0x12fe2e);})[_0x4a62('0xc')](function(_0x25a185){logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x59'),_0x25a185[_0x4a62('0x29')]);logger[_0x4a62('0x1a')]('['+_0x12fe2e['toUpperCase']()+_0x4a62('0x5a'),_0x4c4c30[_0x4a62('0x22')]);return getTicket(_0x25a185,_0x189e5a,_0x2167b7,_0x94f26,_0x4c4c30,_0x392433,_0x12fe2e);})['then'](function(_0x5a8705){logger['info'](util[_0x4a62('0x45')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x5b'),_0x392433[_0x4a62('0x3a')],_0x5a8705['ticketId']));logger[_0x4a62('0x1a')](util[_0x4a62('0x45')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x5c'),_0x12fe2e));if(_0x12fe2e!==_0x4a62('0x4d')){logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x189e5a[_0x4a62('0x4a')],_0xd5c903[_0x4a62('0x5d')],_0x392433[_0x4a62('0x3a')],_0x5a8705['ticketId']);}})[_0x4a62('0xe')](function(_0x1b8a54){logger[_0x4a62('0xf')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x1b8a54,{'showHidden':!![],'depth':null}));});}; \ 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 dd99513..0c26688 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 _0xc099=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','stringify','GET','forEach','includes','string','picklist','nameField','customField','idField','push','variable','variableName','type','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','toUpperCase','error','lastevent','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','value','format','%s/api/v2/tickets','remoteUri','POST','info','validateEmail','%s/api/v2/agents','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!'];(function(_0x123902,_0x4912bf){var _0x1464f1=function(_0x4d95db){while(--_0x4d95db){_0x123902['push'](_0x123902['shift']());}};_0x1464f1(++_0x4912bf);}(_0xc099,0xe9));var _0x9c09=function(_0x99c0e0,_0x23423f){_0x99c0e0=_0x99c0e0-0x0;var _0x5e4fd0=_0xc099[_0x99c0e0];return _0x5e4fd0;};'use strict';var _=require(_0x9c09('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x9c09('0x1'));var Redis=require(_0x9c09('0x2'));var intUtil=require(_0x9c09('0x3'));var config=require(_0x9c09('0x4'));var logger=require(_0x9c09('0x5'))(_0x9c09('0x6'));config['redis']=_[_0x9c09('0x7')](config[_0x9c09('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x9c09('0x9'))(new Redis(config[_0x9c09('0x8')]));var headers={'Content-Type':_0x9c09('0xa'),'Accept':_0x9c09('0xa')};function emit(_0x41b038,_0x2a8f41,_0x4663ef){io['to'](_0x41b038)['emit'](_0x2a8f41,_0x4663ef);}function getTicket(_0x418a16,_0x5b4f5c,_0x118661,_0x3b867e,_0x9ac23a){logger['info'](_0x9c09('0xb'));var _0x3c5ee1=_[_0x9c09('0xc')]({'responder_id':_0x5b4f5c['id'],'requester_id':_0x118661['id'],'name':util['format'](_0x9c09('0xd'),_0x9ac23a[_0x9c09('0xe')]),'phone':_0x9ac23a[_0x9c09('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9c09('0x10')](_0x3b867e['Subjects'],_0x9ac23a,'\x20'),'description':intUtil[_0x9c09('0x10')](_0x3b867e[_0x9c09('0x11')],_0x9ac23a,'
'),'tags':getTags(_0x3b867e[_0x9c09('0x12')],_0x9c09('0x13'))},getCustomFields(_0x3b867e[_0x9c09('0x14')],_0x9ac23a));_0x3c5ee1[_0x9c09('0x15')]=_['mapValues'](_['keyBy'](_0x3c5ee1[_0x9c09('0x15')],'id'),_0x9c09('0x16'));return request({'uri':util[_0x9c09('0x17')](_0x9c09('0x18'),_0x418a16[_0x9c09('0x19')]),'method':_0x9c09('0x1a'),'body':_0x3c5ee1})['then'](function(_0x1e20e2){logger[_0x9c09('0x1b')]('Ticket\x20created!');return _0x1e20e2;});}function getUser(_0x355341,_0x4a01ad){if(intUtil[_0x9c09('0x1c')](_0x4a01ad)){return request({'uri':util[_0x9c09('0x17')](_0x9c09('0x1d'),_0x355341[_0x9c09('0x19')]),'qs':{'email':_0x4a01ad}})[_0x9c09('0x1e')](function(_0x3501bd){if(_0x3501bd[_0x9c09('0x1f')]){logger[_0x9c09('0x1b')](_0x9c09('0x20'));return _[_0x9c09('0x21')](_0x3501bd,function(_0x45da30){return _0x45da30[_0x9c09('0x22')][_0x9c09('0x23')]===_0x4a01ad;});}else{logger[_0x9c09('0x1b')](_0x9c09('0x24'));return request({'uri':util[_0x9c09('0x17')](_0x9c09('0x25'),_0x355341[_0x9c09('0x19')])})[_0x9c09('0x1e')](function(_0x53c737){logger[_0x9c09('0x1b')](_0x9c09('0x26'));return _0x53c737;});}});}else{logger['info'](_0x9c09('0x27'));return request({'uri':util[_0x9c09('0x17')](_0x9c09('0x25'),_0x355341[_0x9c09('0x19')])})['then'](function(_0x87102c){logger[_0x9c09('0x1b')]('Admin\x20account\x20selected.');return _0x87102c;});}}function getEndUser(_0x199911,_0x1d3dd4,_0x385b5a){logger[_0x9c09('0x1b')](_0x9c09('0x28'),_0x385b5a);return request({'uri':util[_0x9c09('0x17')](_0x9c09('0x29'),_0x199911[_0x9c09('0x19')]),'qs':{'phone':_0x385b5a}})[_0x9c09('0x1e')](function(_0x2ee85e){if(_0x2ee85e['length']){logger['info'](_0x9c09('0x2a'));return _[_0x9c09('0x21')](_0x2ee85e,{'phone':_0x385b5a});}else{logger[_0x9c09('0x1b')](_0x9c09('0x2b'));return request({'uri':util['format'](_0x9c09('0x29'),_0x199911[_0x9c09('0x19')]),'method':_0x9c09('0x1a'),'body':{'name':_0x1d3dd4,'phone':_0x385b5a}})[_0x9c09('0x1e')](function(_0x4c747e){logger[_0x9c09('0x1b')](_0x9c09('0x2c'));return _0x4c747e;});}});}function getAuth(_0x1f5b35){return util[_0x9c09('0x17')](_0x9c09('0x2d'),new Buffer(_0x1f5b35['apiKey']+':X')[_0x9c09('0x2e')](_0x9c09('0x2f')));}function request(_0x97d326){logger[_0x9c09('0x30')]('[HTTP]',JSON[_0x9c09('0x31')](_0x97d326));return rp(_[_0x9c09('0x7')](_0x97d326,{'method':_0x9c09('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x286d19,_0x2c8f22){var _0x53b2b5=[];if(_0x286d19&&_0x286d19[_0x9c09('0x1f')]>0x0){_0x53b2b5=_['map'](_0x286d19,_0x2c8f22);}return _0x53b2b5;}function getCustomFields(_0x377a8f,_0x382307){var _0x35a2b3=[];var _0x5c4bb3={'custom_fields':[]};if(_0x377a8f[_0x9c09('0x1f')]>0x0){_[_0x9c09('0x33')](_0x377a8f,function(_0x1b6d6b){if(_[_0x9c09('0x34')]([_0x9c09('0x35'),_0x9c09('0x36')],_0x1b6d6b['type'])&&_0x1b6d6b[_0x9c09('0x37')]&&!_0x1b6d6b[_0x9c09('0x38')]){_0x5c4bb3[_0x1b6d6b['nameField']['toLowerCase']()]=_0x1b6d6b['content'][_0x9c09('0x2e')]();}else if(_[_0x9c09('0x34')]([_0x9c09('0x35'),_0x9c09('0x36')],_0x1b6d6b['type'])&&_0x1b6d6b[_0x9c09('0x39')]&&_0x1b6d6b[_0x9c09('0x38')]){_0x5c4bb3[_0x9c09('0x15')][_0x9c09('0x3a')]({'id':_0x1b6d6b[_0x9c09('0x39')],'value':_0x1b6d6b['content'][_0x9c09('0x2e')]()});}else if(_0x1b6d6b['type']===_0x9c09('0x3b')&&_0x1b6d6b[_0x9c09('0x3c')]&&_0x1b6d6b[_0x9c09('0x39')]&&_0x1b6d6b['customField']){_0x382307[_0x1b6d6b[_0x9c09('0x3c')]]&&_0x5c4bb3[_0x9c09('0x15')][_0x9c09('0x3a')]({'id':_0x1b6d6b[_0x9c09('0x39')],'value':_0x382307[_0x1b6d6b[_0x9c09('0x3c')]][_0x9c09('0x2e')]()});}else if(_0x1b6d6b[_0x9c09('0x3d')]===_0x9c09('0x3e')&&_0x1b6d6b[_0x9c09('0x3f')]&&_0x1b6d6b[_0x9c09('0x3f')][_0x9c09('0x13')]&&_0x1b6d6b[_0x9c09('0x39')]&&_0x1b6d6b[_0x9c09('0x38')]){_0x382307[_0x1b6d6b[_0x9c09('0x3f')][_0x9c09('0x13')]['toLowerCase']()]&&_0x5c4bb3['custom_fields']['push']({'id':_0x1b6d6b[_0x9c09('0x39')],'value':_0x382307[_0x1b6d6b[_0x9c09('0x3f')]['name'][_0x9c09('0x40')]()][_0x9c09('0x2e')]()});}});}return _0x5c4bb3;}exports[_0x9c09('0x41')]=function(_0x228c47,_0x457c46,_0x455eea,_0x5d9aa0,_0x134836,_0x55f757){var _0xa1041,_0x5323c5;_0x55f757[_0x9c09('0x19')]=intUtil['stripTrailingSlash'](_0x55f757[_0x9c09('0x19')]);_0x55f757[_0x9c09('0x42')]=intUtil[_0x9c09('0x43')](_0x55f757['serverUrl']);if(_0x134836&&_0x134836[_0x9c09('0x44')]){logger[_0x9c09('0x1b')]('[QUEUE]',_0x9c09('0x45'));_0x457c46[_0x9c09('0x46')]=util['format'](_0x9c09('0x47'),_0x55f757[_0x9c09('0x42')],_0x457c46[_0x9c09('0x48')],md5(_0x457c46['uniqueid']));}else{_0x457c46['recordingURL']='';}headers[_0x9c09('0x49')]=getAuth(_0x55f757);return getUser(_0x55f757,_0x5d9aa0[_0x9c09('0x23')])[_0x9c09('0x1e')](function(_0x38cf83){_0xa1041=_0x38cf83;logger['info'](_0x9c09('0x4a'),_0xa1041['id']);return getEndUser(_0x55f757,_0x457c46['calleridname'],_0x457c46[_0x9c09('0xf')]);})[_0x9c09('0x1e')](function(_0x105425){_0x5323c5=_0x105425;logger[_0x9c09('0x1b')](_0x9c09('0x4b'),_0x5323c5['id']);return getTicket(_0x55f757,_0xa1041,_0x5323c5,_0x455eea,_0x457c46);})['then'](function(_0x439452){if(_0x439452&&_0x439452['id']){logger[_0x9c09('0x1b')](_0x9c09('0x4c'));logger[_0x9c09('0x1b')](_0x9c09('0x4d'),_0x439452['id']);logger[_0x9c09('0x1b')](_0x9c09('0x4e'),_0x9c09('0x4f'));emit(util[_0x9c09('0x17')](_0x9c09('0x50'),_0x5d9aa0[_0x9c09('0x13')]),_0x9c09('0x51'),{'uri':util[_0x9c09('0x17')](_0x9c09('0x52'),_0x55f757[_0x9c09('0x19')],_0x439452['id'])});}})[_0x9c09('0x53')](function(_0x26b9f7){logger['error'](_0x9c09('0x4e'),JSON[_0x9c09('0x31')](_0x26b9f7));});};exports[_0x9c09('0x54')]=function(_0x48e5f3,_0xab93ec,_0x4908e9,_0x426047,_0x6f714c,_0x60351b,_0x2d38ed){var _0x66535c,_0x2b5744;_0x60351b[_0x9c09('0x19')]=intUtil[_0x9c09('0x43')](_0x60351b[_0x9c09('0x19')]);_0x60351b[_0x9c09('0x42')]=intUtil[_0x9c09('0x43')](_0x60351b[_0x9c09('0x42')]);if(_0x2d38ed&&_0x2d38ed[_0x9c09('0x55')]&&_0x2d38ed[_0x9c09('0x55')]!==_0x9c09('0x56')){logger['info'](_0x9c09('0x57'),_0x9c09('0x45'));_0xab93ec[_0x9c09('0x46')]=util[_0x9c09('0x17')](_0x9c09('0x47'),_0x60351b[_0x9c09('0x42')],_0xab93ec['uniqueid'],md5(_0xab93ec[_0x9c09('0x48')]));}headers[_0x9c09('0x49')]=getAuth(_0x60351b);return getUser(_0x60351b,_0x426047[_0x9c09('0x23')])[_0x9c09('0x1e')](function(_0x30ce58){_0x66535c=_0x30ce58;logger[_0x9c09('0x1b')](_0x9c09('0x4a'),_0x66535c['id']);return getEndUser(_0x60351b,_0xab93ec['destcalleridname'],_0xab93ec[_0x9c09('0x58')]);})[_0x9c09('0x1e')](function(_0x589bd9){_0x2b5744=_0x589bd9;logger[_0x9c09('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x2b5744['id']);return getTicket(_0x60351b,_0x66535c,_0x2b5744,_0x4908e9,_0xab93ec);})[_0x9c09('0x1e')](function(_0x2c64ff){if(_0x2c64ff&&_0x2c64ff['id']){logger['info'](_0x9c09('0x4c'));logger['info'](_0x9c09('0x4d'),_0x2c64ff['id']);logger[_0x9c09('0x1b')](_0x9c09('0x57'),_0x9c09('0x4f'));emit(util[_0x9c09('0x17')]('user:%s',_0x426047[_0x9c09('0x13')]),_0x9c09('0x51'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x60351b[_0x9c09('0x19')],_0x2c64ff['id'])});}})[_0x9c09('0x53')](function(_0x595ff6){logger['error']('[OUTBOUND]',JSON['stringify'](_0x595ff6));});};exports['unmanaged']=function(_0x27df6f,_0x5d43b7,_0x49810f,_0x10b035,_0x24961c,_0x3da854){var _0x450323,_0x3883ac;_0x3da854[_0x9c09('0x19')]=intUtil[_0x9c09('0x43')](_0x3da854[_0x9c09('0x19')]);_0x3da854[_0x9c09('0x42')]=intUtil[_0x9c09('0x43')](_0x3da854[_0x9c09('0x42')]);if(_0x24961c&&_0x24961c[_0x9c09('0x44')]){logger['info']('['+_0x5d43b7['lastevent'][_0x9c09('0x59')]()+']',_0x9c09('0x45'));_0x5d43b7[_0x9c09('0x46')]=util['format'](_0x9c09('0x47'),_0x3da854[_0x9c09('0x42')],_0x5d43b7[_0x9c09('0x48')],md5(_0x5d43b7[_0x9c09('0x48')]));}else{_0x5d43b7[_0x9c09('0x46')]='';}headers['Authorization']=getAuth(_0x3da854);return getUser(_0x3da854,'')[_0x9c09('0x1e')](function(_0x56f184){_0x450323=_0x56f184;logger[_0x9c09('0x1b')]('The\x20User\x20ID\x20is:',_0x450323['id']);return getEndUser(_0x3da854,_0x5d43b7[_0x9c09('0xe')],_0x5d43b7[_0x9c09('0xf')]);})['then'](function(_0x418256){_0x3883ac=_0x418256;logger[_0x9c09('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x3883ac['id']);return getTicket(_0x3da854,_0x450323,_0x3883ac,_0x49810f,_0x5d43b7);})[_0x9c09('0x1e')](function(_0x13cc72){if(_0x13cc72){logger['info'](_0x9c09('0x4c'));logger[_0x9c09('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x13cc72['id']);}})[_0x9c09('0x53')](function(_0x4ad8be){logger[_0x9c09('0x5a')]('['+_0x5d43b7[_0x9c09('0x5b')][_0x9c09('0x59')]()+']',JSON[_0x9c09('0x31')](_0x4ad8be));});}; \ No newline at end of file +var _0xe5da=['toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','push','variable','variableName','idField','customVariable','Variable'];(function(_0x217c7e,_0x1ddaf1){var _0x58f008=function(_0x5f527b){while(--_0x5f527b){_0x217c7e['push'](_0x217c7e['shift']());}};_0x58f008(++_0x1ddaf1);}(_0xe5da,0x134));var _0xae5d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe5da[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xae5d('0x0'));var rp=require(_0xae5d('0x1'));var md5=require(_0xae5d('0x2'));var util=require(_0xae5d('0x3'));var Redis=require(_0xae5d('0x4'));var intUtil=require(_0xae5d('0x5'));var config=require(_0xae5d('0x6'));var logger=require('../../../../config/logger')(_0xae5d('0x7'));config[_0xae5d('0x8')]=_[_0xae5d('0x9')](config[_0xae5d('0x8')],{'host':_0xae5d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xae5d('0xb'),'Accept':_0xae5d('0xb')};function emit(_0x2c5733,_0x59cac0,_0x3b4521){io['to'](_0x2c5733)[_0xae5d('0xc')](_0x59cac0,_0x3b4521);}function getTicket(_0x52c610,_0x309728,_0x311de1,_0x33cd2a,_0x1fcad9){logger[_0xae5d('0xd')](_0xae5d('0xe'));var _0xc2fdc=_[_0xae5d('0xf')]({'responder_id':_0x309728['id'],'requester_id':_0x311de1['id'],'name':util[_0xae5d('0x10')]('Caller\x20-\x20%s',_0x1fcad9[_0xae5d('0x11')]),'phone':_0x1fcad9[_0xae5d('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xae5d('0x13')](_0x33cd2a[_0xae5d('0x14')],_0x1fcad9,'\x20'),'description':intUtil[_0xae5d('0x13')](_0x33cd2a[_0xae5d('0x15')],_0x1fcad9,_0xae5d('0x16')),'tags':getTags(_0x33cd2a[_0xae5d('0x17')],_0xae5d('0x18'))},getCustomFields(_0x33cd2a[_0xae5d('0x19')],_0x1fcad9));_0xc2fdc[_0xae5d('0x1a')]=_['mapValues'](_[_0xae5d('0x1b')](_0xc2fdc['custom_fields'],'id'),_0xae5d('0x1c'));return request({'uri':util['format'](_0xae5d('0x1d'),_0x52c610['remoteUri']),'method':_0xae5d('0x1e'),'body':_0xc2fdc})['then'](function(_0x2c0a72){logger[_0xae5d('0xd')](_0xae5d('0x1f'));return _0x2c0a72;});}function getUser(_0x54eeef,_0x2e6096){if(intUtil[_0xae5d('0x20')](_0x2e6096)){return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x21'),_0x54eeef[_0xae5d('0x22')]),'qs':{'email':_0x2e6096}})[_0xae5d('0x23')](function(_0x42161a){if(_0x42161a[_0xae5d('0x24')]){logger[_0xae5d('0xd')](_0xae5d('0x25'));return _['find'](_0x42161a,function(_0x3996c4){return _0x3996c4[_0xae5d('0x26')][_0xae5d('0x27')]===_0x2e6096;});}else{logger[_0xae5d('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xae5d('0x10')]('%s/api/v2/agents/me',_0x54eeef[_0xae5d('0x22')])})[_0xae5d('0x23')](function(_0x931827){logger[_0xae5d('0xd')](_0xae5d('0x28'));return _0x931827;});}});}else{logger[_0xae5d('0xd')](_0xae5d('0x29'));return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x2a'),_0x54eeef[_0xae5d('0x22')])})[_0xae5d('0x23')](function(_0xbc9103){logger[_0xae5d('0xd')](_0xae5d('0x28'));return _0xbc9103;});}}function getEndUser(_0x2daaae,_0xa4431c,_0x4f4410){logger[_0xae5d('0xd')]('Searching\x20enduser\x20with\x20phone',_0x4f4410);return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x2b'),_0x2daaae[_0xae5d('0x22')]),'qs':{'phone':_0x4f4410}})['then'](function(_0x3c8448){if(_0x3c8448['length']){logger['info'](_0xae5d('0x2c'));return _['find'](_0x3c8448,{'phone':_0x4f4410});}else{logger[_0xae5d('0xd')](_0xae5d('0x2d'));return request({'uri':util['format']('%s/api/v2/contacts',_0x2daaae['remoteUri']),'method':_0xae5d('0x1e'),'body':{'name':_0xa4431c,'phone':_0x4f4410}})['then'](function(_0x161698){logger[_0xae5d('0xd')](_0xae5d('0x2e'));return _0x161698;});}});}function getAuth(_0x192ef6){return util[_0xae5d('0x10')](_0xae5d('0x2f'),new Buffer(_0x192ef6['apiKey']+':X')[_0xae5d('0x30')](_0xae5d('0x31')));}function request(_0x3e08f6){logger['debug'](_0xae5d('0x32'),JSON[_0xae5d('0x33')](_0x3e08f6));return rp(_[_0xae5d('0x9')](_0x3e08f6,{'method':_0xae5d('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x316e63,_0x26168d){var _0xbd3f8c=[];if(_0x316e63&&_0x316e63[_0xae5d('0x24')]>0x0){_0xbd3f8c=_[_0xae5d('0x35')](_0x316e63,_0x26168d);}return _0xbd3f8c;}function getCustomFields(_0x49e748,_0x356b00){var _0xcfb65d=[];var _0x5aaa6e={'custom_fields':[]};if(_0x49e748[_0xae5d('0x24')]>0x0){_[_0xae5d('0x36')](_0x49e748,function(_0x35aba4){if(_[_0xae5d('0x37')]([_0xae5d('0x38'),_0xae5d('0x39')],_0x35aba4['type'])&&_0x35aba4[_0xae5d('0x3a')]&&!_0x35aba4[_0xae5d('0x3b')]){_0x5aaa6e[_0x35aba4[_0xae5d('0x3a')]['toLowerCase']()]=_0x35aba4[_0xae5d('0x3c')][_0xae5d('0x30')]();}else if(_['includes']([_0xae5d('0x38'),_0xae5d('0x39')],_0x35aba4[_0xae5d('0x3d')])&&_0x35aba4['idField']&&_0x35aba4['customField']){_0x5aaa6e[_0xae5d('0x1a')][_0xae5d('0x3e')]({'id':_0x35aba4['idField'],'value':_0x35aba4['content'][_0xae5d('0x30')]()});}else if(_0x35aba4['type']===_0xae5d('0x3f')&&_0x35aba4[_0xae5d('0x40')]&&_0x35aba4[_0xae5d('0x41')]&&_0x35aba4[_0xae5d('0x3b')]){_0x356b00[_0x35aba4[_0xae5d('0x40')]]&&_0x5aaa6e[_0xae5d('0x1a')]['push']({'id':_0x35aba4[_0xae5d('0x41')],'value':_0x356b00[_0x35aba4[_0xae5d('0x40')]][_0xae5d('0x30')]()});}else if(_0x35aba4[_0xae5d('0x3d')]===_0xae5d('0x42')&&_0x35aba4['Variable']&&_0x35aba4['Variable']['name']&&_0x35aba4['idField']&&_0x35aba4[_0xae5d('0x3b')]){_0x356b00[_0x35aba4[_0xae5d('0x43')][_0xae5d('0x18')][_0xae5d('0x44')]()]&&_0x5aaa6e['custom_fields'][_0xae5d('0x3e')]({'id':_0x35aba4[_0xae5d('0x41')],'value':_0x356b00[_0x35aba4['Variable'][_0xae5d('0x18')]['toLowerCase']()][_0xae5d('0x30')]()});}});}return _0x5aaa6e;}exports[_0xae5d('0x45')]=function(_0x54b074,_0x4e7ee5,_0x559987,_0x597782,_0xf292ba,_0x1a734b){var _0x47dda8,_0xab326d;_0x1a734b['remoteUri']=intUtil[_0xae5d('0x46')](_0x1a734b[_0xae5d('0x22')]);_0x1a734b['serverUrl']=intUtil[_0xae5d('0x46')](_0x1a734b[_0xae5d('0x47')]);if(_0xf292ba&&_0xf292ba[_0xae5d('0x48')]){logger[_0xae5d('0xd')](_0xae5d('0x49'),_0xae5d('0x4a'));_0x4e7ee5[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x1a734b['serverUrl'],_0x4e7ee5['uniqueid'],md5(_0x4e7ee5[_0xae5d('0x4d')]));}else{_0x4e7ee5[_0xae5d('0x4b')]='';}headers[_0xae5d('0x4e')]=getAuth(_0x1a734b);return getUser(_0x1a734b,_0x597782[_0xae5d('0x27')])[_0xae5d('0x23')](function(_0x47a48d){_0x47dda8=_0x47a48d;logger[_0xae5d('0xd')]('The\x20User\x20ID\x20is:',_0x47dda8['id']);return getEndUser(_0x1a734b,_0x4e7ee5[_0xae5d('0x11')],_0x4e7ee5[_0xae5d('0x12')]);})['then'](function(_0x586625){_0xab326d=_0x586625;logger[_0xae5d('0xd')](_0xae5d('0x4f'),_0xab326d['id']);return getTicket(_0x1a734b,_0x47dda8,_0xab326d,_0x559987,_0x4e7ee5);})[_0xae5d('0x23')](function(_0x2f4a7d){if(_0x2f4a7d&&_0x2f4a7d['id']){logger['info']('Ticket\x20created!');logger[_0xae5d('0xd')](_0xae5d('0x50'),_0x2f4a7d['id']);logger[_0xae5d('0xd')](_0xae5d('0x49'),_0xae5d('0x51'));emit(util[_0xae5d('0x10')](_0xae5d('0x52'),_0x597782['name']),_0xae5d('0x53'),{'uri':util[_0xae5d('0x10')]('%s/helpdesk/tickets/%d',_0x1a734b[_0xae5d('0x22')],_0x2f4a7d['id'])});}})['catch'](function(_0x3ae68d){logger['error'](_0xae5d('0x49'),JSON['stringify'](_0x3ae68d));});};exports[_0xae5d('0x54')]=function(_0x897506,_0x4235b3,_0x5724fd,_0x21916f,_0x3579f9,_0x2ce0da,_0x383c45){var _0x1c27fb,_0x12b704;_0x2ce0da[_0xae5d('0x22')]=intUtil[_0xae5d('0x46')](_0x2ce0da[_0xae5d('0x22')]);_0x2ce0da['serverUrl']=intUtil[_0xae5d('0x46')](_0x2ce0da[_0xae5d('0x47')]);if(_0x383c45&&_0x383c45[_0xae5d('0x55')]&&_0x383c45[_0xae5d('0x55')]!=='none'){logger[_0xae5d('0xd')](_0xae5d('0x56'),_0xae5d('0x4a'));_0x4235b3[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x2ce0da[_0xae5d('0x47')],_0x4235b3[_0xae5d('0x4d')],md5(_0x4235b3[_0xae5d('0x4d')]));}headers[_0xae5d('0x4e')]=getAuth(_0x2ce0da);return getUser(_0x2ce0da,_0x21916f[_0xae5d('0x27')])['then'](function(_0x45c0b7){_0x1c27fb=_0x45c0b7;logger[_0xae5d('0xd')](_0xae5d('0x57'),_0x1c27fb['id']);return getEndUser(_0x2ce0da,_0x4235b3['destcalleridname'],_0x4235b3['destcalleridnum']);})[_0xae5d('0x23')](function(_0x5d204d){_0x12b704=_0x5d204d;logger[_0xae5d('0xd')](_0xae5d('0x4f'),_0x12b704['id']);return getTicket(_0x2ce0da,_0x1c27fb,_0x12b704,_0x5724fd,_0x4235b3);})[_0xae5d('0x23')](function(_0x220472){if(_0x220472&&_0x220472['id']){logger[_0xae5d('0xd')](_0xae5d('0x1f'));logger[_0xae5d('0xd')](_0xae5d('0x50'),_0x220472['id']);logger[_0xae5d('0xd')](_0xae5d('0x56'),_0xae5d('0x51'));emit(util[_0xae5d('0x10')]('user:%s',_0x21916f[_0xae5d('0x18')]),_0xae5d('0x53'),{'uri':util['format'](_0xae5d('0x58'),_0x2ce0da['remoteUri'],_0x220472['id'])});}})[_0xae5d('0x59')](function(_0x50e9a8){logger[_0xae5d('0x5a')](_0xae5d('0x56'),JSON['stringify'](_0x50e9a8));});};exports[_0xae5d('0x5b')]=function(_0x1e0e7f,_0x18ad73,_0x26906f,_0x4c60bf,_0x3c9db7,_0x387024){var _0x57ce6f,_0x2ff64f;_0x387024[_0xae5d('0x22')]=intUtil[_0xae5d('0x46')](_0x387024['remoteUri']);_0x387024[_0xae5d('0x47')]=intUtil['stripTrailingSlash'](_0x387024[_0xae5d('0x47')]);if(_0x3c9db7&&_0x3c9db7[_0xae5d('0x48')]){logger[_0xae5d('0xd')]('['+_0x18ad73[_0xae5d('0x5c')][_0xae5d('0x5d')]()+']',_0xae5d('0x4a'));_0x18ad73[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x387024[_0xae5d('0x47')],_0x18ad73[_0xae5d('0x4d')],md5(_0x18ad73[_0xae5d('0x4d')]));}else{_0x18ad73['recordingURL']='';}headers[_0xae5d('0x4e')]=getAuth(_0x387024);return getUser(_0x387024,'')[_0xae5d('0x23')](function(_0x21e4bd){_0x57ce6f=_0x21e4bd;logger[_0xae5d('0xd')]('The\x20User\x20ID\x20is:',_0x57ce6f['id']);return getEndUser(_0x387024,_0x18ad73['calleridname'],_0x18ad73[_0xae5d('0x12')]);})[_0xae5d('0x23')](function(_0xd373d5){_0x2ff64f=_0xd373d5;logger['info'](_0xae5d('0x4f'),_0x2ff64f['id']);return getTicket(_0x387024,_0x57ce6f,_0x2ff64f,_0x26906f,_0x18ad73);})['then'](function(_0x15f21c){if(_0x15f21c){logger[_0xae5d('0xd')](_0xae5d('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x15f21c['id']);}})[_0xae5d('0x59')](function(_0x5152d5){logger[_0xae5d('0x5a')]('['+_0x18ad73['lastevent'][_0xae5d('0x5d')]()+']',JSON['stringify'](_0x5152d5));});}; \ 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 ea57710..313dbd7 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 _0xbb36=['[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','format','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none'];(function(_0x4f91fd,_0xccfa60){var _0x342f46=function(_0x1bba1c){while(--_0x1bba1c){_0x4f91fd['push'](_0x4f91fd['shift']());}};_0x342f46(++_0xccfa60);}(_0xbb36,0x156));var _0x6bb3=function(_0x1b1e5d,_0x12d2f2){_0x1b1e5d=_0x1b1e5d-0x0;var _0x370891=_0xbb36[_0x1b1e5d];return _0x370891;};'use strict';var _=require(_0x6bb3('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var moment=require(_0x6bb3('0x1'));var Promise=require(_0x6bb3('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6bb3('0x3'));var config=require(_0x6bb3('0x4'));var logger=require(_0x6bb3('0x5'))('freshsales');config['redis']=_['defaults'](config[_0x6bb3('0x6')],{'host':_0x6bb3('0x7'),'port':0x18eb});var io=require(_0x6bb3('0x8'))(new Redis(config['redis']));function getAdminId(_0x59d8e7,_0x3a6c65,_0x2c9cd0,_0x4556c0){return new Promise(function(_0xdd0531,_0x103cb4){var _0x4b7bef=![];var _0x30025c={'method':_0x6bb3('0x9'),'uri':_0x4556c0+_0x6bb3('0xa'),'json':!![]};_0x30025c[_0x6bb3('0xb')]=_0x2c9cd0;logger[_0x6bb3('0xc')](_0x6bb3('0xd'));return rp(_0x30025c)[_0x6bb3('0xe')](function(_0x398500){if(_0x398500){var _0x1a00a5=_0x398500['users'];var _0xb4417a=null;for(_0xb4417a=0x0;_0xb4417a<_0x1a00a5[_0x6bb3('0xf')];_0xb4417a++){if(_0x1a00a5[_0xb4417a][_0x6bb3('0x10')]===_0x59d8e7[_0x6bb3('0x11')]){_0x59d8e7[_0x6bb3('0x12')]=_0x1a00a5[_0xb4417a]['id'];_0x4b7bef=!![];}}if(_0x4b7bef){logger['info']('Admin\x20found:',_0x59d8e7[_0x6bb3('0x12')]);_0xdd0531(_0x59d8e7);}else{_0x103cb4({'statusCode':0x194,'message':_0x6bb3('0x13')});}}else{_0x103cb4({'statusCode':0x194,'message':_0x6bb3('0x13')});}})[_0x6bb3('0x14')](function(_0x27f489){logger[_0x6bb3('0x15')]('['+[_0x3a6c65[_0x6bb3('0x16')]()]+']',_0x27f489[_0x6bb3('0x17')]);_0x103cb4(_0x27f489);});});}function getUser(_0x4cdc8b,_0x3f9637,_0x34c56a){return function(_0x4e2174){return new Promise(function(_0x1d5b9a,_0x1d9d10){var _0x5be654={'method':_0x6bb3('0x9'),'uri':_0x34c56a+'/api/selector/owners','json':!![]};_0x5be654[_0x6bb3('0xb')]=_0x3f9637;logger[_0x6bb3('0xc')](_0x6bb3('0x18'));return rp(_0x5be654)[_0x6bb3('0xe')](function(_0x30c57c){if(_0x30c57c){var _0x3e2e86=_0x30c57c['users'];var _0xe7751c=![];var _0x337d94=null;if(_0x4e2174[_0x6bb3('0x19')]!==null){logger['info'](_0x6bb3('0x1a'),_0x4e2174[_0x6bb3('0x19')]);_0x4e2174[_0x6bb3('0x1b')]=_0x4e2174[_0x6bb3('0x19')];for(_0x337d94=0x0;_0x337d94<_0x3e2e86[_0x6bb3('0xf')];_0x337d94++){if(_0x3e2e86[_0x337d94][_0x6bb3('0x10')]===_0x4e2174[_0x6bb3('0x19')]){_0xe7751c=!![];_0x4e2174[_0x6bb3('0x1c')]=_0x3e2e86[_0x337d94]['id'];logger[_0x6bb3('0xc')](_0x6bb3('0x1d'),_0x4e2174[_0x6bb3('0x1c')]);}}}if(!_0xe7751c){logger[_0x6bb3('0xc')](_0x6bb3('0x1e'));_0x4e2174[_0x6bb3('0x1b')]=_0x4e2174[_0x6bb3('0x11')];_0x4e2174[_0x6bb3('0x1c')]=_0x4e2174['adminId'];_0xe7751c=!![];}if(_0xe7751c){_0x1d5b9a(_0x4e2174);}else{_0x1d9d10({'statusCode':0x194,'message':_0x6bb3('0x13')});}}else{_0x1d9d10({'statusCode':0x194,'message':_0x6bb3('0x13')});}})[_0x6bb3('0x14')](function(_0x15e204){logger[_0x6bb3('0x15')]('['+[_0x4cdc8b[_0x6bb3('0x16')]()]+']',_0x15e204[_0x6bb3('0x17')]);_0x1d9d10(_0x15e204);});});};}function searchContact(_0x5efadb,_0x4f0a52,_0x9baae5,_0x5f5847){return new Promise(function(_0x2f1966,_0x5b9eca){var _0x59c189={'method':'GET','headers':_0x4f0a52,'uri':_0x5efadb+_0x6bb3('0x1f')+_0x5f5847+_0x6bb3('0x20')+_0x9baae5+_0x6bb3('0x21'),'json':!![]};rp(_0x59c189)[_0x6bb3('0xe')](function(_0x3d7b9c){var _0x1f834a=_[_0x6bb3('0x22')](_0x3d7b9c['contacts']['contacts'],[_0x9baae5,_0x5f5847]);_0x2f1966(_0x1f834a);})['catch'](function(_0x3fc4b5){_0x5b9eca(_0x3fc4b5);});});}function getEndUser(_0x37862c,_0x110a54,_0x2e3dd8){return function(_0x40f030){return new Promise(function(_0x5ef0bf,_0x41588c){logger[_0x6bb3('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x40f030[_0x6bb3('0x23')]));searchContact(_0x2e3dd8,_0x110a54,_0x6bb3('0x24'),_0x40f030[_0x6bb3('0x23')])[_0x6bb3('0xe')](function(_0x17d672){if(_0x17d672){_0x40f030[_0x6bb3('0x25')]=_0x17d672['id'];logger[_0x6bb3('0xc')](_0x6bb3('0x26'),_0x40f030[_0x6bb3('0x25')]);return _0x5ef0bf(_0x40f030);}searchContact(_0x2e3dd8,_0x110a54,_0x6bb3('0x27'),_0x40f030[_0x6bb3('0x23')])[_0x6bb3('0xe')](function(_0x2dd68d){if(_0x2dd68d){_0x40f030[_0x6bb3('0x25')]=_0x2dd68d['id'];logger[_0x6bb3('0xc')](_0x6bb3('0x28'),_0x40f030[_0x6bb3('0x25')]);return _0x5ef0bf(_0x40f030);}createEndUser(_0x40f030,_0x37862c,_0x110a54,_0x2e3dd8)['then'](function(_0x4c2a65){logger[_0x6bb3('0xc')](_0x6bb3('0x29'),_0x4c2a65[_0x6bb3('0x25')]);return _0x5ef0bf(_0x4c2a65);});});})[_0x6bb3('0x14')](function(_0x4e4b92){_0x41588c(_0x4e4b92);});});};}function createEndUser(_0x41ead7,_0x49c325,_0x1b7301,_0x543f46){return new Promise(function(_0x5c271c,_0x3c3028){var _0x5c61bd=moment();var _0x7e1c2e={'method':_0x6bb3('0x2a'),'uri':_0x543f46+_0x6bb3('0x2b'),'body':{'contact':{'last_name':_0x41ead7[_0x6bb3('0x23')],'work_number':_0x41ead7['contactNumber'],'mobile_number':_0x41ead7[_0x6bb3('0x23')],'owner_id':_0x41ead7[_0x6bb3('0x1c')],'created_at':_0x5c61bd['format'](_0x6bb3('0x2c'))}},'json':!![]};_0x7e1c2e[_0x6bb3('0xb')]=_0x1b7301;logger['info'](_0x6bb3('0x2d'));return rp(_0x7e1c2e)['then'](function(_0x5f3b89){_0x41ead7['endUserId']=_0x5f3b89[_0x6bb3('0x2e')]['id'];_0x5c271c(_0x41ead7);})[_0x6bb3('0x14')](function(_0xfdcf98){logger[_0x6bb3('0x15')]('['+[_0x49c325[_0x6bb3('0x16')]()]+']',_0xfdcf98['message']);_0x3c3028(_0xfdcf98[_0x6bb3('0x17')]);});});}function getTicket(_0x5c794f,_0x4f45d2,_0x3cce50,_0x2b3028,_0x39bf58){return function(_0x56a353){logger[_0x6bb3('0xc')](_0x6bb3('0x2f'));return new Promise(function(_0x15a467,_0x109749){var _0x65b955=moment();var _0x5ab842={'method':_0x6bb3('0x2a'),'uri':_0x3cce50+_0x6bb3('0x30'),'body':{'title':intUtil[_0x6bb3('0x31')](_0x2b3028[_0x6bb3('0x32')],_0x39bf58,'\x20'),'description':intUtil[_0x6bb3('0x31')](_0x2b3028[_0x6bb3('0x33')],_0x39bf58,'\x0a'),'owner_id':_0x56a353[_0x6bb3('0x1c')],'creater_id':_0x56a353[_0x6bb3('0x12')],'targetable_id':_0x56a353[_0x6bb3('0x25')],'targetable_type':'Contact','created_at':_0x65b955[_0x6bb3('0x34')](_0x6bb3('0x2c')),'due_date':_0x65b955['add'](0x1e,'m')[_0x6bb3('0x34')](_0x6bb3('0x2c'))},'json':!![]};_0x5ab842[_0x6bb3('0xb')]=_0x4f45d2;return rp(_0x5ab842)[_0x6bb3('0xe')](function(_0xd9f4a9){_0x56a353[_0x6bb3('0x35')]=_0xd9f4a9['task']['id'];logger[_0x6bb3('0xc')]('Task\x20created:',_0x56a353[_0x6bb3('0x35')]);_0x15a467(_0x56a353);})['catch'](function(_0x293c3e){logger[_0x6bb3('0x15')]('['+[_0x5c794f['toUpperCase']()]+']',_0x293c3e[_0x6bb3('0x17')]);_0x109749(_0x293c3e[_0x6bb3('0x17')]);});});};}function emit(_0x4b3afe,_0x372fe4,_0x2a252f){var _0x3826f8={'uri':_0x4b3afe+_0x6bb3('0x36')+_0x2a252f};io['to'](util[_0x6bb3('0x34')](_0x6bb3('0x37'),_0x372fe4))[_0x6bb3('0x38')](_0x6bb3('0x39'),_0x3826f8);}exports['cs']=function(_0x35d00e,_0x849735,_0xad9ceb,_0xcc993d,_0x4c9769,_0x45406b,_0x4743a3,_0x23d7a6){var _0x40a24c={};var _0x2e4202={'Authorization':_0x6bb3('0x3a')+_0x45406b[_0x6bb3('0x3b')]};_0x45406b[_0x6bb3('0x3c')]=intUtil['stripTrailingSlash'](_0x45406b['remoteUri']);_0x45406b['serverUrl']=intUtil[_0x6bb3('0x3d')](_0x45406b[_0x6bb3('0x3e')]);var _0x3a7f35=_0x45406b[_0x6bb3('0x3c')];_0x40a24c[_0x6bb3('0x11')]=_0x45406b[_0x6bb3('0x3f')];_0x40a24c[_0x6bb3('0x23')]=_0x23d7a6[_0x6bb3('0x40')]()===_0x6bb3('0x41')?_0x849735[_0x6bb3('0x42')]:_0x849735[_0x6bb3('0x43')];_0x40a24c[_0x6bb3('0x44')]=_0x23d7a6===_0x6bb3('0x45')||_0x23d7a6===_0x6bb3('0x46')?_0x6bb3('0x45'):_0x6bb3('0x41');if(_0xcc993d){_0x40a24c['agentEmail']=_0xcc993d['email'];}var _0xa42200=util[_0x6bb3('0x34')](_0x6bb3('0x47'),_0x45406b[_0x6bb3('0x3e')],_0x849735[_0x6bb3('0x48')],md5(_0x849735[_0x6bb3('0x48')]));if(_0x4c9769&&_0x4c9769[_0x6bb3('0x49')]){logger[_0x6bb3('0xc')]('[QUEUE]',_0x6bb3('0x4a'));_0x849735[_0x6bb3('0x4b')]=_0xa42200;}else if(_0x4743a3&&_0x4743a3['recordingFormat']&&_0x4743a3[_0x6bb3('0x4c')]!==_0x6bb3('0x4d')){logger[_0x6bb3('0xc')](_0x6bb3('0x4e'),'Recording\x20is\x20enabled!');_0x849735[_0x6bb3('0x4b')]=_0xa42200;}else{_0x849735[_0x6bb3('0x4b')]='';}return getAdminId(_0x40a24c,_0x23d7a6,_0x2e4202,_0x3a7f35)[_0x6bb3('0xe')](getUser(_0x23d7a6,_0x2e4202,_0x3a7f35))['then'](getEndUser(_0x23d7a6,_0x2e4202,_0x3a7f35))[_0x6bb3('0xe')](getTicket(_0x23d7a6,_0x2e4202,_0x3a7f35,_0xad9ceb,_0x849735))[_0x6bb3('0xe')](function(_0x590efa){logger[_0x6bb3('0xc')](util[_0x6bb3('0x34')](_0x6bb3('0x4f'),_0x590efa[_0x6bb3('0x35')]));if(_0x23d7a6!=='unmanaged'){logger[_0x6bb3('0xc')]('['+[_0x23d7a6['toUpperCase']()]+']',_0x6bb3('0x50'));emit(_0x3a7f35,_0xcc993d[_0x6bb3('0x51')],_0x590efa[_0x6bb3('0x25')]);}})['catch'](function(_0x2d4bd8){logger[_0x6bb3('0x15')]('['+[_0x23d7a6[_0x6bb3('0x16')]()]+_0x6bb3('0x52'),util[_0x6bb3('0x53')](_0x2d4bd8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc6c0=['name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','/api/lookup?q=','&f=','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...'];(function(_0x4dbff0,_0xd80451){var _0xf762b6=function(_0x3b5c4f){while(--_0x3b5c4f){_0x4dbff0['push'](_0x4dbff0['shift']());}};_0xf762b6(++_0xd80451);}(_0xc6c0,0x152));var _0x0c6c=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0xc6c0[_0x53b53e];return _0xbb6179;};'use strict';var _=require('lodash');var rp=require(_0x0c6c('0x0'));var md5=require('md5');var util=require(_0x0c6c('0x1'));var moment=require(_0x0c6c('0x2'));var Promise=require(_0x0c6c('0x3'));var Redis=require(_0x0c6c('0x4'));var intUtil=require(_0x0c6c('0x5'));var config=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));config[_0x0c6c('0x9')]=_['defaults'](config['redis'],{'host':_0x0c6c('0xa'),'port':0x18eb});var io=require(_0x0c6c('0xb'))(new Redis(config[_0x0c6c('0x9')]));function getAdminId(_0x35fdda,_0x47389e,_0x47fcf8,_0x806d9a){return new Promise(function(_0x1dc97f,_0x4e12ba){var _0x3bf41b=![];var _0x382a64={'method':_0x0c6c('0xc'),'uri':_0x806d9a+_0x0c6c('0xd'),'json':!![]};_0x382a64[_0x0c6c('0xe')]=_0x47fcf8;logger['info'](_0x0c6c('0xf'));return rp(_0x382a64)[_0x0c6c('0x10')](function(_0x5b3c89){if(_0x5b3c89){var _0x18f257=_0x5b3c89[_0x0c6c('0x11')];var _0x5692a1=null;for(_0x5692a1=0x0;_0x5692a1<_0x18f257['length'];_0x5692a1++){if(_0x18f257[_0x5692a1][_0x0c6c('0x12')]===_0x35fdda[_0x0c6c('0x13')]){_0x35fdda[_0x0c6c('0x14')]=_0x18f257[_0x5692a1]['id'];_0x3bf41b=!![];}}if(_0x3bf41b){logger['info'](_0x0c6c('0x15'),_0x35fdda[_0x0c6c('0x14')]);_0x1dc97f(_0x35fdda);}else{_0x4e12ba({'statusCode':0x194,'message':_0x0c6c('0x16')});}}else{_0x4e12ba({'statusCode':0x194,'message':_0x0c6c('0x16')});}})[_0x0c6c('0x17')](function(_0x3bd46f){logger[_0x0c6c('0x18')]('['+[_0x47389e[_0x0c6c('0x19')]()]+']',_0x3bd46f[_0x0c6c('0x1a')]);_0x4e12ba(_0x3bd46f);});});}function getUser(_0x5476e8,_0x249615,_0x4aaf79){return function(_0x402e07){return new Promise(function(_0x136cd7,_0x43bf4b){var _0x5becf1={'method':_0x0c6c('0xc'),'uri':_0x4aaf79+_0x0c6c('0xd'),'json':!![]};_0x5becf1['headers']=_0x249615;logger[_0x0c6c('0x1b')](_0x0c6c('0x1c'));return rp(_0x5becf1)[_0x0c6c('0x10')](function(_0x237aca){if(_0x237aca){var _0x1cc984=_0x237aca[_0x0c6c('0x11')];var _0x18488b=![];var _0x347c5c=null;if(_0x402e07[_0x0c6c('0x1d')]!==null){logger['info'](_0x0c6c('0x1e'),_0x402e07[_0x0c6c('0x1d')]);_0x402e07[_0x0c6c('0x1f')]=_0x402e07[_0x0c6c('0x1d')];for(_0x347c5c=0x0;_0x347c5c<_0x1cc984[_0x0c6c('0x20')];_0x347c5c++){if(_0x1cc984[_0x347c5c][_0x0c6c('0x12')]===_0x402e07['agentEmail']){_0x18488b=!![];_0x402e07[_0x0c6c('0x21')]=_0x1cc984[_0x347c5c]['id'];logger[_0x0c6c('0x1b')](_0x0c6c('0x22'),_0x402e07[_0x0c6c('0x21')]);}}}if(!_0x18488b){logger[_0x0c6c('0x1b')]('Admin\x20selected');_0x402e07[_0x0c6c('0x1f')]=_0x402e07[_0x0c6c('0x13')];_0x402e07['userId']=_0x402e07[_0x0c6c('0x14')];_0x18488b=!![];}if(_0x18488b){_0x136cd7(_0x402e07);}else{_0x43bf4b({'statusCode':0x194,'message':_0x0c6c('0x16')});}}else{_0x43bf4b({'statusCode':0x194,'message':_0x0c6c('0x16')});}})[_0x0c6c('0x17')](function(_0x13fa95){logger[_0x0c6c('0x18')]('['+[_0x5476e8[_0x0c6c('0x19')]()]+']',_0x13fa95[_0x0c6c('0x1a')]);_0x43bf4b(_0x13fa95);});});};}function searchContact(_0x507ce6,_0x51f89d,_0x122ea5,_0x2277a1){return new Promise(function(_0x15f7a5,_0xf2c16c){var _0x143d51={'method':_0x0c6c('0xc'),'headers':_0x51f89d,'uri':_0x507ce6+_0x0c6c('0x23')+_0x2277a1+_0x0c6c('0x24')+_0x122ea5+'&entities=contact','json':!![]};rp(_0x143d51)[_0x0c6c('0x10')](function(_0x1a9ad8){var _0x369db6=_[_0x0c6c('0x25')](_0x1a9ad8['contacts'][_0x0c6c('0x26')],[_0x122ea5,_0x2277a1]);_0x15f7a5(_0x369db6);})[_0x0c6c('0x17')](function(_0x26dc07){_0xf2c16c(_0x26dc07);});});}function getEndUser(_0x48e976,_0x46e061,_0x5b0e71){return function(_0x5e9af0){return new Promise(function(_0x31b47d,_0x326bad){logger[_0x0c6c('0x1b')](util[_0x0c6c('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5e9af0[_0x0c6c('0x28')]));searchContact(_0x5b0e71,_0x46e061,_0x0c6c('0x29'),_0x5e9af0[_0x0c6c('0x28')])['then'](function(_0x18d28c){if(_0x18d28c){_0x5e9af0[_0x0c6c('0x2a')]=_0x18d28c['id'];logger['info'](_0x0c6c('0x2b'),_0x5e9af0['endUserId']);return _0x31b47d(_0x5e9af0);}searchContact(_0x5b0e71,_0x46e061,_0x0c6c('0x2c'),_0x5e9af0[_0x0c6c('0x28')])[_0x0c6c('0x10')](function(_0x25b980){if(_0x25b980){_0x5e9af0['endUserId']=_0x25b980['id'];logger[_0x0c6c('0x1b')]('Contact\x20found\x20work_number:',_0x5e9af0[_0x0c6c('0x2a')]);return _0x31b47d(_0x5e9af0);}createEndUser(_0x5e9af0,_0x48e976,_0x46e061,_0x5b0e71)[_0x0c6c('0x10')](function(_0x4db3a6){logger[_0x0c6c('0x1b')]('Contact\x20created:',_0x4db3a6[_0x0c6c('0x2a')]);return _0x31b47d(_0x4db3a6);});});})[_0x0c6c('0x17')](function(_0x2973da){_0x326bad(_0x2973da);});});};}function createEndUser(_0x4c5856,_0xcdd633,_0x4a0ffc,_0x3c1471){return new Promise(function(_0x4bc64a,_0x54ab4c){var _0x4750ef=moment();var _0x1bcf16={'method':'POST','uri':_0x3c1471+_0x0c6c('0x2d'),'body':{'contact':{'last_name':_0x4c5856[_0x0c6c('0x28')],'work_number':_0x4c5856[_0x0c6c('0x28')],'mobile_number':_0x4c5856['contactNumber'],'owner_id':_0x4c5856[_0x0c6c('0x21')],'created_at':_0x4750ef['format'](_0x0c6c('0x2e'))}},'json':!![]};_0x1bcf16[_0x0c6c('0xe')]=_0x4a0ffc;logger['info'](_0x0c6c('0x2f'));return rp(_0x1bcf16)['then'](function(_0x13d621){_0x4c5856[_0x0c6c('0x2a')]=_0x13d621[_0x0c6c('0x30')]['id'];_0x4bc64a(_0x4c5856);})['catch'](function(_0x3f2de4){logger[_0x0c6c('0x18')]('['+[_0xcdd633['toUpperCase']()]+']',_0x3f2de4[_0x0c6c('0x1a')]);_0x54ab4c(_0x3f2de4['message']);});});}function getTicket(_0x5688c1,_0x53ac2c,_0x4aef38,_0x271bf0,_0x44b331){return function(_0x511ef1){logger[_0x0c6c('0x1b')](_0x0c6c('0x31'));return new Promise(function(_0x5b23c2,_0x263636){var _0x18fe3b=moment();var _0x3c17ab={'method':'POST','uri':_0x4aef38+_0x0c6c('0x32'),'body':{'title':intUtil[_0x0c6c('0x33')](_0x271bf0[_0x0c6c('0x34')],_0x44b331,'\x20'),'description':intUtil['getString'](_0x271bf0[_0x0c6c('0x35')],_0x44b331,'\x0a'),'owner_id':_0x511ef1[_0x0c6c('0x21')],'creater_id':_0x511ef1[_0x0c6c('0x14')],'targetable_id':_0x511ef1[_0x0c6c('0x2a')],'targetable_type':_0x0c6c('0x36'),'created_at':_0x18fe3b[_0x0c6c('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x18fe3b[_0x0c6c('0x37')](0x1e,'m')[_0x0c6c('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3c17ab[_0x0c6c('0xe')]=_0x53ac2c;return rp(_0x3c17ab)[_0x0c6c('0x10')](function(_0x7a0e7b){_0x511ef1[_0x0c6c('0x38')]=_0x7a0e7b[_0x0c6c('0x39')]['id'];logger['info'](_0x0c6c('0x3a'),_0x511ef1[_0x0c6c('0x38')]);_0x5b23c2(_0x511ef1);})['catch'](function(_0x3a6bd5){logger[_0x0c6c('0x18')]('['+[_0x5688c1[_0x0c6c('0x19')]()]+']',_0x3a6bd5[_0x0c6c('0x1a')]);_0x263636(_0x3a6bd5[_0x0c6c('0x1a')]);});});};}function emit(_0x28dc67,_0x4c7d56,_0x4a5354){var _0x49b630={'uri':_0x28dc67+_0x0c6c('0x3b')+_0x4a5354};io['to'](util['format'](_0x0c6c('0x3c'),_0x4c7d56))[_0x0c6c('0x3d')](_0x0c6c('0x3e'),_0x49b630);}exports['cs']=function(_0x437b22,_0xd1a5f1,_0x7777aa,_0x387c28,_0x5a6773,_0x26d43e,_0x18dd2b,_0x411c0b){var _0x290b98={};var _0x2c0ee2={'Authorization':_0x0c6c('0x3f')+_0x26d43e[_0x0c6c('0x40')]};_0x26d43e['remoteUri']=intUtil['stripTrailingSlash'](_0x26d43e[_0x0c6c('0x41')]);_0x26d43e[_0x0c6c('0x42')]=intUtil['stripTrailingSlash'](_0x26d43e[_0x0c6c('0x42')]);var _0x5e2459=_0x26d43e[_0x0c6c('0x41')];_0x290b98['adminEmail']=_0x26d43e['username'];_0x290b98[_0x0c6c('0x28')]=_0x411c0b[_0x0c6c('0x43')]()==='outbound'?_0xd1a5f1[_0x0c6c('0x44')]:_0xd1a5f1[_0x0c6c('0x45')];_0x290b98[_0x0c6c('0x46')]=_0x411c0b==='queue'||_0x411c0b===_0x0c6c('0x47')?'queue':_0x0c6c('0x48');if(_0x387c28){_0x290b98['agentEmail']=_0x387c28[_0x0c6c('0x12')];}var _0x17086e=util[_0x0c6c('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26d43e[_0x0c6c('0x42')],_0xd1a5f1[_0x0c6c('0x49')],md5(_0xd1a5f1[_0x0c6c('0x49')]));if(_0x5a6773&&_0x5a6773[_0x0c6c('0x4a')]){logger[_0x0c6c('0x1b')]('[QUEUE]','Recording\x20is\x20enabled!');_0xd1a5f1[_0x0c6c('0x4b')]=_0x17086e;}else if(_0x18dd2b&&_0x18dd2b[_0x0c6c('0x4c')]&&_0x18dd2b['recordingFormat']!==_0x0c6c('0x4d')){logger[_0x0c6c('0x1b')](_0x0c6c('0x4e'),_0x0c6c('0x4f'));_0xd1a5f1[_0x0c6c('0x4b')]=_0x17086e;}else{_0xd1a5f1['recordingURL']='';}return getAdminId(_0x290b98,_0x411c0b,_0x2c0ee2,_0x5e2459)[_0x0c6c('0x10')](getUser(_0x411c0b,_0x2c0ee2,_0x5e2459))[_0x0c6c('0x10')](getEndUser(_0x411c0b,_0x2c0ee2,_0x5e2459))[_0x0c6c('0x10')](getTicket(_0x411c0b,_0x2c0ee2,_0x5e2459,_0x7777aa,_0xd1a5f1))['then'](function(_0x37a680){logger[_0x0c6c('0x1b')](util[_0x0c6c('0x27')](_0x0c6c('0x50'),_0x37a680['ticketId']));if(_0x411c0b!==_0x0c6c('0x47')){logger[_0x0c6c('0x1b')]('['+[_0x411c0b[_0x0c6c('0x19')]()]+']',_0x0c6c('0x51'));emit(_0x5e2459,_0x387c28[_0x0c6c('0x52')],_0x37a680[_0x0c6c('0x2a')]);}})[_0x0c6c('0x17')](function(_0x391169){logger[_0x0c6c('0x18')]('['+[_0x411c0b['toUpperCase']()]+_0x0c6c('0x53'),util['inspect'](_0x391169,{'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 b9ec76a..c8d9a0e 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 _0x187c=['exec','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','log','unmanaged','salesforce','zoho','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x187c,0x13c));var _0xc187=function(_0x1502e3,_0xb4bc8c){_0x1502e3=_0x1502e3-0x0;var _0x331355=_0x187c[_0x1502e3];return _0x331355;};'use strict';var _=require(_0xc187('0x0'));var util=require(_0xc187('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xc187('0x2'));var sugarcrm=require(_0xc187('0x3'));var freshdesk=require(_0xc187('0x4'));var zoho=require(_0xc187('0x5'));var desk=require(_0xc187('0x6'));var vtiger=require(_0xc187('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xc187('0x8'));var freshsales=require(_0xc187('0x9'));var integrations=[_0xc187('0xa'),'salesforce','sugarcrm',_0xc187('0xb'),'zoho',_0xc187('0xc'),_0xc187('0xd'),_0xc187('0xe'),_0xc187('0xf'),_0xc187('0x10')];exports[_0xc187('0x11')]=function(_0x15d4f9,_0x1a389f,_0x45252e,_0x113589,_0x4756fa,_0x4bdf83){if(_0x45252e){if(_[_0xc187('0x12')](integrations,_0x15d4f9['data1'][_0xc187('0x13')]())){try{var _0x1e3e56=null;var _0x657377='';var _0x4990c2=_0x45252e[_0x15d4f9[_0xc187('0x14')][_0xc187('0x13')]()];if(_0x4990c2){var _0x1ddc5b=_0x4990c2[_0x15d4f9[_0xc187('0x15')]];if(_0x1ddc5b){var _0x46aa61=_[_0xc187('0x16')](_0x1ddc5b[_0xc187('0x17')],{'id':parseInt(_0x15d4f9[_0xc187('0x18')],0xa)});if(_0x46aa61){if(_0x113589){if(_0x4756fa&&_0x1a389f[_0xc187('0x19')]){_0x657377='queue';}else if(_0x1a389f['routeId']){_0x657377='outbound';}else{console[_0xc187('0x1a')]('EVENT\x20UNKNOWN',_0x1a389f);}}else{_0x657377=_0xc187('0x1b');}switch(_0x15d4f9[_0xc187('0x14')]['toLowerCase']()){case _0xc187('0xa'):zendesk[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0x1c'):salesforce[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case'sugarcrm':sugarcrm[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0xb'):freshdesk[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0x1d'):zoho[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0xc'):desk[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0xd'):vtiger[_0x657377](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83);break;case _0xc187('0xf'):freshsales['cs'](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83,_0x657377);break;case _0xc187('0x10'):servicenow['cs'](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83,_0x657377);break;case _0xc187('0xe'):dynamics365['cs'](_0x15d4f9,_0x1a389f,_0x46aa61,_0x113589,_0x4756fa,_0x1ddc5b,_0x4bdf83,_0x657377);break;default:console[_0xc187('0x1a')](_0xc187('0x1e'));}}else{_0x1e3e56=require('../../../../config/logger')(_0x15d4f9[_0xc187('0x14')]['toLowerCase']());_0x1e3e56['error'](_0xc187('0x1f'),util[_0xc187('0x20')](_0xc187('0x21'),_0x15d4f9[_0xc187('0x14')][_0xc187('0x13')](),_0x15d4f9[_0xc187('0x18')]));}}else{_0x1e3e56=require(_0xc187('0x22'))(_0x15d4f9[_0xc187('0x14')]['toLowerCase']());_0x1e3e56[_0xc187('0x23')](_0xc187('0x1f'),util['format'](_0xc187('0x24'),_0x15d4f9[_0xc187('0x14')][_0xc187('0x13')](),_0x15d4f9[_0xc187('0x15')]));}}else{}}catch(_0x494bb1){console['error'](_0x494bb1);}}}}; \ No newline at end of file +var _0xc551=['servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','util','./zendesk','./salesforce','./sugarcrm','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales'];(function(_0x7ecd61,_0x28c775){var _0x67d35d=function(_0x103519){while(--_0x103519){_0x7ecd61['push'](_0x7ecd61['shift']());}};_0x67d35d(++_0x28c775);}(_0xc551,0x1d1));var _0x1c55=function(_0x150e6b,_0x3b8604){_0x150e6b=_0x150e6b-0x0;var _0x22a4e5=_0xc551[_0x150e6b];return _0x22a4e5;};'use strict';var _=require('lodash');var util=require(_0x1c55('0x0'));var zendesk=require(_0x1c55('0x1'));var salesforce=require(_0x1c55('0x2'));var sugarcrm=require(_0x1c55('0x3'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x1c55('0x4'));var vtiger=require(_0x1c55('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x1c55('0x6'));var freshsales=require(_0x1c55('0x7'));var integrations=[_0x1c55('0x8'),_0x1c55('0x9'),_0x1c55('0xa'),_0x1c55('0xb'),_0x1c55('0xc'),_0x1c55('0xd'),'vtiger',_0x1c55('0xe'),_0x1c55('0xf'),_0x1c55('0x10')];exports[_0x1c55('0x11')]=function(_0x319d9b,_0x42f2eb,_0x424a1d,_0x18e6af,_0x488ab0,_0x5e460b){if(_0x424a1d){if(_[_0x1c55('0x12')](integrations,_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]())){try{var _0x29f7df=null;var _0xaa41ae='';var _0x5549a2=_0x424a1d[_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]()];if(_0x5549a2){var _0x34ab5e=_0x5549a2[_0x319d9b[_0x1c55('0x15')]];if(_0x34ab5e){var _0x31c6a4=_[_0x1c55('0x16')](_0x34ab5e[_0x1c55('0x17')],{'id':parseInt(_0x319d9b[_0x1c55('0x18')],0xa)});if(_0x31c6a4){if(_0x18e6af){if(_0x488ab0&&_0x42f2eb[_0x1c55('0x19')]){_0xaa41ae=_0x1c55('0x19');}else if(_0x42f2eb[_0x1c55('0x1a')]){_0xaa41ae=_0x1c55('0x1b');}else{console[_0x1c55('0x1c')](_0x1c55('0x1d'),_0x42f2eb);}}else{_0xaa41ae=_0x1c55('0x1e');}switch(_0x319d9b[_0x1c55('0x13')]['toLowerCase']()){case _0x1c55('0x8'):zendesk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case'salesforce':salesforce[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xa'):sugarcrm[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xb'):freshdesk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case'zoho':zoho[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xd'):desk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0x1f'):vtiger[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xf'):freshsales['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;case _0x1c55('0x10'):servicenow['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;case'dynamics365':dynamics365['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;default:console[_0x1c55('0x1c')](_0x1c55('0x20'));}}else{_0x29f7df=require('../../../../config/logger')(_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]());_0x29f7df[_0x1c55('0x21')](_0x1c55('0x22'),util[_0x1c55('0x23')]('%s\x20configuration\x20#%s\x20not\x20found',_0x319d9b[_0x1c55('0x13')]['toLowerCase'](),_0x319d9b[_0x1c55('0x18')]));}}else{_0x29f7df=require(_0x1c55('0x24'))(_0x319d9b['data1'][_0x1c55('0x14')]());_0x29f7df[_0x1c55('0x21')](_0x1c55('0x22'),util[_0x1c55('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x319d9b['data1'][_0x1c55('0x14')](),_0x319d9b[_0x1c55('0x15')]));}}else{}}catch(_0x355d08){console[_0x1c55('0x21')](_0x355d08);}}}}; \ 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 88d8dee..fa0d128 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 _0x37a9=['user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','stripTrailingSlash','recordingFormat','none','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','toUpperCase','request-promise','bluebird','jsforce','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','emit','getString','Subjects','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','lead','WhoId','account','WhatId','Case','ContactId','endUserType','AccountId','leadId','info','sobject','ticketType','create','isNil','validateEmail','User','find','execute','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','additionalSearchAccount','Account','Lead','first','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','Caller\x20-\x20%s','format','upperFirst','forEach','includes','idField','toString','variableName','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x37a9,0x107));var _0x937a=function(_0x3f1d02,_0x533c27){_0x3f1d02=_0x3f1d02-0x0;var _0x3da535=_0x37a9[_0x3f1d02];return _0x3da535;};'use strict';var _=require('lodash');var rp=require(_0x937a('0x0'));var moment=require('moment');var BPromise=require(_0x937a('0x1'));var md5=require('md5');var jsforce=require(_0x937a('0x2'));var util=require('util');var Redis=require(_0x937a('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x937a('0x4'))('salesforce');config[_0x937a('0x5')]=_['defaults'](config['redis'],{'host':_0x937a('0x6'),'port':0x18eb});var io=require(_0x937a('0x7'))(new Redis(config[_0x937a('0x5')]));function emit(_0xc01867,_0x2da0d6,_0x293878){io['to'](_0xc01867)[_0x937a('0x8')](_0x2da0d6,_0x293878);}function getTicket(_0x40f7ae,_0x9a187d,_0xbe2644,_0x479cf0,_0x4cccc0,_0x5d1540,_0x4fe53f,_0x3c872e){var _0x197c6d=Object['assign']({},{'OwnerId':_0x9a187d['id'],'Subject':intUtil[_0x937a('0x9')](_0x479cf0[_0x937a('0xa')],_0x4cccc0,'\x20'),'Description':intUtil[_0x937a('0x9')](_0x479cf0['Descriptions'],_0x4cccc0,'\x0a')},getCustomFields(_0x5d1540,_0x4cccc0));if(_0xbe2644){if(_0x479cf0['ticketType']==='Task'){_0x197c6d[_0x937a('0xb')]=moment[_0x937a('0xc')]();_0x197c6d[_0x937a('0xd')]=![];_0x197c6d[_0x937a('0xe')]=![];if(_0xbe2644['endUserType']===_0x937a('0xf')||_0xbe2644['endUserType']===_0x937a('0x10')){_0x197c6d[_0x937a('0x11')]=_0xbe2644['id'];}else if(_0xbe2644['endUserType']===_0x937a('0x12')){_0x197c6d[_0x937a('0x13')]=_0xbe2644['id'];}}else if(_0x479cf0['ticketType']===_0x937a('0x14')){if(_0xbe2644['endUserType']===_0x937a('0xf')){_0x197c6d[_0x937a('0x15')]=_0xbe2644['id'];}else if(_0xbe2644[_0x937a('0x16')]==='account'){_0x197c6d[_0x937a('0x17')]=_0xbe2644['id'];}else if(_0xbe2644[_0x937a('0x16')]==='lead'&&_0x479cf0[_0x937a('0x18')]){_0x197c6d[_0x479cf0[_0x937a('0x18')]]=_0xbe2644['id'];}else{logger[_0x937a('0x19')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4fe53f[_0x937a('0x1a')](_0x479cf0[_0x937a('0x1b')])[_0x937a('0x1c')](_0x197c6d);}function getUser(_0x10d75f,_0x5e6c7d,_0x434ec7){if(!_[_0x937a('0x1d')](_0x5e6c7d)&&intUtil[_0x937a('0x1e')](_0x5e6c7d)){var _0x116cce={'Email':_0x5e6c7d};var _0x478ef1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x434ec7[_0x937a('0x1a')](_0x937a('0x1f'))[_0x937a('0x20')](_0x116cce,_0x478ef1)[_0x937a('0x21')]()['then'](function(_0x30a36d){if(_0x30a36d['length']){var _0x3c79f7=_[_0x937a('0x20')](_0x30a36d,function(_0x2a1766){return _0x2a1766['Email']===_0x5e6c7d;});if(_0x3c79f7){logger[_0x937a('0x19')](_0x937a('0x22'),_0x5e6c7d);return BPromise[_0x937a('0x23')]({'id':_0x3c79f7['Id'],'name':_0x3c79f7[_0x937a('0x24')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5e6c7d);return _0x434ec7[_0x937a('0x25')]()[_0x937a('0x26')](function(_0x4891c2){return BPromise[_0x937a('0x23')]({'id':_0x4891c2[_0x937a('0x27')],'name':_0x4891c2[_0x937a('0x28')]});});}});}else{logger[_0x937a('0x19')](_0x937a('0x29'),_0x5e6c7d);return _0x434ec7[_0x937a('0x25')]()['then'](function(_0x2d734a){return BPromise[_0x937a('0x23')]({'id':_0x2d734a[_0x937a('0x27')],'name':_0x2d734a[_0x937a('0x28')]});});}}function getEndUser(_0x456aa5,_0x541567,_0x23c76d,_0x488521,_0x5b91ac){var _0x38c6e0={'$or':{'Phone':_0x488521}};var _0x2a473d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x937a('0x26')](function(){logger[_0x937a('0x19')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x488521,_0x541567[_0x937a('0x2a')]);switch(_0x541567[_0x937a('0x2a')]){case _0x937a('0x2b'):var _0x1d7238=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x2d')]){var _0xc246a4={};_0xc246a4[_0x541567[_0x937a('0x2d')]]=_0x488521;_[_0x937a('0x2e')](_0x1d7238[_0x937a('0x2f')],_0xc246a4);}return _0x5b91ac[_0x937a('0x1a')](_0x937a('0x30'))[_0x937a('0x20')](_0x1d7238,_0x2a473d)[_0x937a('0x21')]()['then'](function(_0x3db7a8){if(_0x3db7a8&&_0x3db7a8[_0x937a('0x31')]){return _0x3db7a8;}else{var _0x1b654f=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x32')]){var _0x18d5e7={};_0x18d5e7[_0x541567[_0x937a('0x32')]]=_0x488521;_[_0x937a('0x2e')](_0x1b654f['$or'],_0x18d5e7);}return _0x5b91ac[_0x937a('0x1a')]('Lead')['find'](_0x1b654f,_0x2a473d);}});case'account_contact_lead':var _0x1c4ae7=_['cloneDeep'](_0x38c6e0);if(_0x541567['additionalSearchAccount']){var _0xc246a4={};_0xc246a4[_0x541567[_0x937a('0x33')]]=_0x488521;_[_0x937a('0x2e')](_0x1c4ae7['$or'],_0xc246a4);}return _0x5b91ac[_0x937a('0x1a')](_0x937a('0x34'))[_0x937a('0x20')](_0x1c4ae7,_0x2a473d)['execute']()[_0x937a('0x26')](function(_0x508cf2){if(_0x508cf2&&_0x508cf2[_0x937a('0x31')]){return _0x508cf2;}else{var _0xc3b97c=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x2d')]){var _0xf6dcd9={};_0xf6dcd9[_0x541567[_0x937a('0x2d')]]=_0x488521;_['merge'](_0xc3b97c[_0x937a('0x2f')],_0xf6dcd9);}return _0x5b91ac[_0x937a('0x1a')](_0x937a('0x30'))['find'](_0xc3b97c,_0x2a473d)[_0x937a('0x26')](function(_0x2a36f6){if(_0x2a36f6&&_0x2a36f6[_0x937a('0x31')]){return _0x2a36f6;}else{var _0x4e4ca8=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x32')]){var _0x1a731e={};_0x1a731e[_0x541567[_0x937a('0x32')]]=_0x488521;_[_0x937a('0x2e')](_0x4e4ca8[_0x937a('0x2f')],_0x1a731e);}return _0x5b91ac['sobject']('Lead')['find'](_0x4e4ca8,_0x2a473d);}});}});case _0x937a('0xf'):var _0x1d7238=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x2d')]){var _0xc246a4={};_0xc246a4[_0x541567[_0x937a('0x2d')]]=_0x488521;_[_0x937a('0x2e')](_0x1d7238[_0x937a('0x2f')],_0xc246a4);}return _0x5b91ac[_0x937a('0x1a')](_0x937a('0x30'))[_0x937a('0x20')](_0x1d7238,_0x2a473d)[_0x937a('0x21')]();case'lead':var _0x59edd7=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x32')]){var _0xc246a4={};_0xc246a4[_0x541567[_0x937a('0x32')]]=_0x488521;_[_0x937a('0x2e')](_0x59edd7[_0x937a('0x2f')],_0xc246a4);}return _0x5b91ac[_0x937a('0x1a')](_0x937a('0x35'))[_0x937a('0x20')](_0x59edd7,_0x2a473d);case _0x937a('0x12'):var _0x1c4ae7=_[_0x937a('0x2c')](_0x38c6e0);if(_0x541567[_0x937a('0x33')]){var _0xc246a4={};_0xc246a4[_0x541567[_0x937a('0x33')]]=_0x488521;_[_0x937a('0x2e')](_0x1c4ae7[_0x937a('0x2f')],_0xc246a4);}return _0x5b91ac[_0x937a('0x1a')]('Account')[_0x937a('0x20')](_0x1c4ae7,_0x2a473d);default:return null;}})[_0x937a('0x26')](function(_0x57f758){if(_0x57f758&&_0x57f758[_0x937a('0x31')]){var _0x1a3e00=_[_0x937a('0x36')](_0x57f758);if(_0x1a3e00){return BPromise[_0x937a('0x23')]({'id':_0x1a3e00['Id'],'name':_0x1a3e00[_0x937a('0x24')],'phone':_0x1a3e00['Phone'],'endUserType':_0x1a3e00[_0x937a('0x37')][_0x937a('0x38')][_0x937a('0x39')]()});}}})['then'](function(_0xa4bbdc){if(_0xa4bbdc){logger[_0x937a('0x19')](_0x937a('0x3a'),_0xa4bbdc[_0x937a('0x16')],_0x488521);return BPromise[_0x937a('0x23')](_0xa4bbdc);}else{logger['info'](_0x937a('0x3b'),_0x488521);var _0x575728={'Phone':_0x488521};if(_0x541567[_0x937a('0x3c')]){if(_0x541567['moduleCreate']==='contact'){logger['info'](_0x937a('0x3d'),_0x488521,_0x541567['moduleCreate']);_0x575728['LastName']=_0x23c76d!==_0x937a('0x3e')?_0x23c76d:util['format']('Caller\x20-\x20%s',_0x488521);}else if(_0x541567[_0x937a('0x3c')]===_0x937a('0x10')){logger[_0x937a('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x488521,_0x541567[_0x937a('0x3c')]);_0x575728[_0x937a('0x3f')]=_0x23c76d!==_0x937a('0x3e')?_0x23c76d:util['format'](_0x937a('0x40'),_0x488521);_0x575728['Company']='No\x20Company';}else if(_0x541567['moduleCreate']==='account'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x488521,_0x541567[_0x937a('0x3c')]);_0x575728['Name']=_0x23c76d!==_0x937a('0x3e')?_0x23c76d:util[_0x937a('0x41')](_0x937a('0x40'),_0x488521);}else{return null;}}return _0x5b91ac[_0x937a('0x1a')](_[_0x937a('0x42')](_0x541567[_0x937a('0x3c')]))['create'](_0x575728)[_0x937a('0x26')](function(_0x3b47dd){return BPromise[_0x937a('0x23')]({'id':_0x3b47dd['id'],'endUserType':_0x541567['moduleCreate']});});}});}function getCustomFields(_0x485561,_0x41f2e5){var _0x4dbc06={};if(_0x485561[_0x937a('0x31')]>0x0){_[_0x937a('0x43')](_0x485561,function(_0x5907e0){if(_[_0x937a('0x44')](['string','picklist'],_0x5907e0['type'])&&_0x5907e0[_0x937a('0x45')]){_0x4dbc06[_0x5907e0[_0x937a('0x45')]]=_0x5907e0['content'][_0x937a('0x46')]();}else if(_0x5907e0['type']==='variable'&&_0x5907e0[_0x937a('0x47')]&&_0x5907e0[_0x937a('0x45')]){_0x41f2e5[_0x5907e0[_0x937a('0x47')]]&&(_0x4dbc06[_0x5907e0[_0x937a('0x45')]]=_0x41f2e5[_0x5907e0[_0x937a('0x47')]]['toString']());}else if(_0x5907e0[_0x937a('0x38')]==='customVariable'&&_0x5907e0['Variable']&&_0x5907e0[_0x937a('0x48')][_0x937a('0x49')]&&_0x5907e0['idField']){_0x41f2e5[_0x5907e0[_0x937a('0x48')][_0x937a('0x49')][_0x937a('0x39')]()]&&(_0x4dbc06[_0x5907e0[_0x937a('0x45')]]=_0x41f2e5[_0x5907e0[_0x937a('0x48')]['name'][_0x937a('0x39')]()][_0x937a('0x46')]());}});}return _0x4dbc06;}function getConnection(_0x4c26c4){var _0x302944=_0x4c26c4['password']['concat'](_0x4c26c4[_0x937a('0x4a')]);var _0x3e08e6=new jsforce[(_0x937a('0x4b'))]({'oauth2':{'loginUrl':_0x4c26c4[_0x937a('0x4c')]||_0x937a('0x4d'),'clientId':_0x4c26c4[_0x937a('0x4e')],'clientSecret':_0x4c26c4[_0x937a('0x4f')]}});return _0x3e08e6[_0x937a('0x50')](_0x4c26c4[_0x937a('0x51')],_0x302944)[_0x937a('0x26')](function(){logger['info'](_0x937a('0x52'));return _0x3e08e6;});}exports[_0x937a('0x53')]=function(_0x403144,_0x12c54b,_0x177612,_0x420e69,_0x5e2eae,_0x57c1a0){var _0x3154dc,_0x483881,_0x5cc357,_0x17cea9;_0x57c1a0[_0x937a('0x54')]=intUtil['stripTrailingSlash'](_0x57c1a0['serverUrl']);_0x57c1a0[_0x937a('0x4c')]=intUtil['stripTrailingSlash'](_0x57c1a0[_0x937a('0x4c')]);if(_0x5e2eae&&_0x5e2eae[_0x937a('0x55')]){logger['info']('[QUEUE]',_0x937a('0x56'));_0x12c54b[_0x937a('0x57')]=util[_0x937a('0x41')](_0x937a('0x58'),_0x57c1a0[_0x937a('0x54')],_0x12c54b[_0x937a('0x59')],md5(_0x12c54b['uniqueid']));}else{_0x12c54b[_0x937a('0x57')]='';}return getConnection(_0x57c1a0)[_0x937a('0x26')](function(_0x32e4d3){_0x17cea9=_0x32e4d3;return getUser(_0x57c1a0,_0x420e69['email'],_0x17cea9);})[_0x937a('0x26')](function(_0x45c25d){_0x3154dc=_0x45c25d;return getEndUser(_0x57c1a0,_0x177612,_0x12c54b[_0x937a('0x5a')],_0x12c54b[_0x937a('0x5b')],_0x17cea9);})['then'](function(_0x1f79ea){_0x483881=_0x1f79ea;return getTicket(_0x57c1a0,_0x3154dc,_0x483881,_0x177612,_0x12c54b,_0x177612[_0x937a('0x5c')],_0x17cea9,'queue');})[_0x937a('0x26')](function(_0x33dfcb){_0x5cc357=_0x33dfcb;logger[_0x937a('0x19')](_0x937a('0x5d'),_0x5cc357['id']);logger[_0x937a('0x19')](_0x937a('0x5e'),_0x5cc357['id'],_0x420e69['name'],_0x57c1a0[_0x937a('0x38')]);switch(_0x57c1a0['type']){case _0x937a('0x5f'):emit(util[_0x937a('0x41')]('user:%s',_0x420e69[_0x937a('0x49')]),'trigger:salesforce:display',{'recordId':_0x5cc357['id']});break;case _0x937a('0x60'):emit(util[_0x937a('0x41')](_0x937a('0x61'),_0x420e69[_0x937a('0x49')]),_0x937a('0x62'),{'uri':util[_0x937a('0x41')](_0x937a('0x63'),_0x17cea9[_0x937a('0x64')],_0x5cc357['id'])});break;default:logger[_0x937a('0x65')](_0x937a('0x66'));}})[_0x937a('0x67')](function(_0x24eb8c){logger[_0x937a('0x65')](_0x937a('0x68'),_0x24eb8c);});};exports[_0x937a('0x69')]=function(_0xf1f077,_0x8d7372,_0x350307,_0x5ed346,_0x3b9419,_0x39f171,_0x3b4239){var _0xd52af4,_0x2e188c,_0x52a61b,_0x22626d;_0x39f171['serverUrl']=intUtil[_0x937a('0x6a')](_0x39f171[_0x937a('0x54')]);_0x39f171[_0x937a('0x4c')]=intUtil['stripTrailingSlash'](_0x39f171[_0x937a('0x4c')]);if(_0x3b4239&&_0x3b4239[_0x937a('0x6b')]&&_0x3b4239[_0x937a('0x6b')]!==_0x937a('0x6c')){logger['info']('[OUTBOUND]',_0x937a('0x56'));_0x8d7372[_0x937a('0x57')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39f171['serverUrl'],_0x8d7372['uniqueid'],md5(_0x8d7372[_0x937a('0x59')]));}return getConnection(_0x39f171)[_0x937a('0x26')](function(_0x947fe2){_0x22626d=_0x947fe2;return getUser(_0x39f171,_0x5ed346[_0x937a('0x6d')],_0x22626d);})[_0x937a('0x26')](function(_0x32b603){_0xd52af4=_0x32b603;return getEndUser(_0x39f171,_0x350307,_0x8d7372[_0x937a('0x6e')],_0x8d7372[_0x937a('0x6f')],_0x22626d);})[_0x937a('0x26')](function(_0x4f0195){_0x2e188c=_0x4f0195;return getTicket(_0x39f171,_0xd52af4,_0x2e188c,_0x350307,_0x8d7372,_0x350307[_0x937a('0x5c')],_0x22626d,_0x937a('0x69'));})[_0x937a('0x26')](function(_0x22015c){_0x52a61b=_0x22015c;logger[_0x937a('0x19')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x52a61b['id']);logger[_0x937a('0x19')](_0x937a('0x70'),_0x52a61b['id'],_0x5ed346[_0x937a('0x49')],_0x39f171[_0x937a('0x38')]);switch(_0x39f171[_0x937a('0x38')]){case _0x937a('0x5f'):emit(util[_0x937a('0x41')]('user:%s',_0x5ed346[_0x937a('0x49')]),_0x937a('0x71'),{'recordId':_0x52a61b['id']});break;case _0x937a('0x60'):emit(util[_0x937a('0x41')](_0x937a('0x61'),_0x5ed346[_0x937a('0x49')]),'trigger:browser:url',{'uri':util[_0x937a('0x41')]('%s/%s/e',_0x22626d[_0x937a('0x64')],_0x52a61b['id'])});break;default:logger['error']('[OUTBOUND]',_0x937a('0x72'));}})[_0x937a('0x67')](function(_0x211d7d){logger[_0x937a('0x65')](_0x937a('0x73'),_0x211d7d);});};exports['unmanaged']=function(_0x1e34f6,_0x465499,_0x3421e7,_0x3c48f7,_0x3400d6,_0x266dc4){var _0x38d4f3,_0x1ea2ae,_0x114042,_0x3f46c0;_0x266dc4[_0x937a('0x54')]=intUtil[_0x937a('0x6a')](_0x266dc4['serverUrl']);_0x266dc4['remoteUri']=intUtil[_0x937a('0x6a')](_0x266dc4[_0x937a('0x4c')]);if(_0x3400d6&&_0x3400d6[_0x937a('0x55')]){logger[_0x937a('0x19')]('['+_0x465499[_0x937a('0x74')]['toUpperCase']()+']',_0x937a('0x56'));_0x465499[_0x937a('0x57')]=util[_0x937a('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x266dc4['serverUrl'],_0x465499[_0x937a('0x59')],md5(_0x465499[_0x937a('0x59')]));}else{_0x465499[_0x937a('0x57')]='';}return getConnection(_0x266dc4)[_0x937a('0x26')](function(_0x315ff0){_0x3f46c0=_0x315ff0;if(!_[_0x937a('0x1d')](_0x3c48f7)){return getUser(_0x266dc4,_0x3c48f7[_0x937a('0x49')],_0x3f46c0);}else{return getUser(_0x266dc4,null,_0x3f46c0);}})[_0x937a('0x26')](function(_0x2b1902){_0x38d4f3=_0x2b1902;return getEndUser(_0x266dc4,_0x3421e7,_0x465499[_0x937a('0x5a')],_0x465499[_0x937a('0x5b')],_0x3f46c0);})['then'](function(_0x30dbc7){_0x1ea2ae=_0x30dbc7;return getTicket(_0x266dc4,_0x38d4f3,_0x1ea2ae,_0x3421e7,_0x465499,_0x3421e7[_0x937a('0x5c')],_0x3f46c0);})[_0x937a('0x26')](function(_0x3bf51a){_0x114042=_0x3bf51a;logger['info']('['+_0x465499[_0x937a('0x74')]['toUpperCase']()+_0x937a('0x75'),_0x114042['id']);logger[_0x937a('0x19')]('['+_0x465499[_0x937a('0x74')]['toUpperCase']()+_0x937a('0x76'),_0x266dc4[_0x937a('0x38')]);})[_0x937a('0x67')](function(_0x2fb307){logger[_0x937a('0x65')]('['+_0x465499['lastevent'][_0x937a('0x77')]()+']',_0x2fb307);});}; \ No newline at end of file +var _0x0516=['Account','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','ticketType','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','cloneDeep','additionalSearchAccount'];(function(_0x10e36f,_0x97a78f){var _0x1ac5ec=function(_0x1258b5){while(--_0x1258b5){_0x10e36f['push'](_0x10e36f['shift']());}};_0x1ac5ec(++_0x97a78f);}(_0x0516,0x14b));var _0x6051=function(_0x1e41ba,_0x455a21){_0x1e41ba=_0x1e41ba-0x0;var _0x201d61=_0x0516[_0x1e41ba];return _0x201d61;};'use strict';var _=require('lodash');var rp=require(_0x6051('0x0'));var moment=require(_0x6051('0x1'));var BPromise=require(_0x6051('0x2'));var md5=require(_0x6051('0x3'));var jsforce=require(_0x6051('0x4'));var util=require(_0x6051('0x5'));var Redis=require(_0x6051('0x6'));var intUtil=require(_0x6051('0x7'));var config=require(_0x6051('0x8'));var logger=require(_0x6051('0x9'))(_0x6051('0xa'));config[_0x6051('0xb')]=_[_0x6051('0xc')](config['redis'],{'host':_0x6051('0xd'),'port':0x18eb});var io=require(_0x6051('0xe'))(new Redis(config[_0x6051('0xb')]));function emit(_0x36599a,_0x2bf309,_0x18bc85){io['to'](_0x36599a)[_0x6051('0xf')](_0x2bf309,_0x18bc85);}function getTicket(_0x5e9141,_0xfc5591,_0x6e9745,_0xdac55e,_0x360da1,_0x2348f5,_0x24610e,_0x14090c){var _0x436daf=Object[_0x6051('0x10')]({},{'OwnerId':_0xfc5591['id'],'Subject':intUtil[_0x6051('0x11')](_0xdac55e[_0x6051('0x12')],_0x360da1,'\x20'),'Description':intUtil[_0x6051('0x11')](_0xdac55e[_0x6051('0x13')],_0x360da1,'\x0a')},getCustomFields(_0x2348f5,_0x360da1));if(_0x6e9745){if(_0xdac55e['ticketType']===_0x6051('0x14')){_0x436daf[_0x6051('0x15')]=moment[_0x6051('0x16')]();_0x436daf[_0x6051('0x17')]=![];_0x436daf[_0x6051('0x18')]=![];if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1a')||_0x6e9745['endUserType']===_0x6051('0x1b')){_0x436daf[_0x6051('0x1c')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1d')){_0x436daf['WhatId']=_0x6e9745['id'];}}else if(_0xdac55e[_0x6051('0x1e')]==='Case'){if(_0x6e9745[_0x6051('0x19')]==='contact'){_0x436daf[_0x6051('0x1f')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1d')){_0x436daf[_0x6051('0x20')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1b')&&_0xdac55e[_0x6051('0x21')]){_0x436daf[_0xdac55e[_0x6051('0x21')]]=_0x6e9745['id'];}else{logger[_0x6051('0x22')](_0x6051('0x23'));}}}return _0x24610e[_0x6051('0x24')](_0xdac55e[_0x6051('0x1e')])['create'](_0x436daf);}function getUser(_0x530f9a,_0xb42d13,_0x8ed5ac){if(!_[_0x6051('0x25')](_0xb42d13)&&intUtil[_0x6051('0x26')](_0xb42d13)){var _0x588077={'Email':_0xb42d13};var _0x1c3acf={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x8ed5ac[_0x6051('0x24')](_0x6051('0x27'))[_0x6051('0x28')](_0x588077,_0x1c3acf)[_0x6051('0x29')]()[_0x6051('0x2a')](function(_0x2aa069){if(_0x2aa069[_0x6051('0x2b')]){var _0x457d3d=_[_0x6051('0x28')](_0x2aa069,function(_0x1bd717){return _0x1bd717['Email']===_0xb42d13;});if(_0x457d3d){logger[_0x6051('0x22')](_0x6051('0x2c'),_0xb42d13);return BPromise[_0x6051('0x2d')]({'id':_0x457d3d['Id'],'name':_0x457d3d[_0x6051('0x2e')]});}}else{logger[_0x6051('0x22')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xb42d13);return _0x8ed5ac[_0x6051('0x2f')]()['then'](function(_0x2f62f2){return BPromise[_0x6051('0x2d')]({'id':_0x2f62f2[_0x6051('0x30')],'name':_0x2f62f2[_0x6051('0x31')]});});}});}else{logger['info'](_0x6051('0x32'),_0xb42d13);return _0x8ed5ac[_0x6051('0x2f')]()['then'](function(_0x19adf1){return BPromise[_0x6051('0x2d')]({'id':_0x19adf1[_0x6051('0x30')],'name':_0x19adf1[_0x6051('0x31')]});});}}function getEndUser(_0x5474e9,_0x55529b,_0x204123,_0xa94318,_0x43351d){var _0x18895b={'$or':{'Phone':_0xa94318}};var _0x2d7606={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6051('0x2d')]()[_0x6051('0x2a')](function(){logger[_0x6051('0x22')](_0x6051('0x33'),_0xa94318,_0x55529b[_0x6051('0x34')]);switch(_0x55529b[_0x6051('0x34')]){case _0x6051('0x35'):var _0x5d0827=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x36')]]=_0xa94318;_['merge'](_0x5d0827[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))[_0x6051('0x28')](_0x5d0827,_0x2d7606)[_0x6051('0x29')]()[_0x6051('0x2a')](function(_0x44b37f){if(_0x44b37f&&_0x44b37f[_0x6051('0x2b')]){return _0x44b37f;}else{var _0x370ceb=_['cloneDeep'](_0x18895b);if(_0x55529b['additionalSearchLead']){var _0x11793e={};_0x11793e[_0x55529b[_0x6051('0x39')]]=_0xa94318;_[_0x6051('0x3a')](_0x370ceb['$or'],_0x11793e);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x370ceb,_0x2d7606);}});case'account_contact_lead':var _0xb8e58b=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x3d')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x3d')]]=_0xa94318;_[_0x6051('0x3a')](_0xb8e58b[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')]('Account')[_0x6051('0x28')](_0xb8e58b,_0x2d7606)['execute']()['then'](function(_0x1c2394){if(_0x1c2394&&_0x1c2394[_0x6051('0x2b')]){return _0x1c2394;}else{var _0x509075=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x19b521={};_0x19b521[_0x55529b[_0x6051('0x36')]]=_0xa94318;_[_0x6051('0x3a')](_0x509075['$or'],_0x19b521);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))[_0x6051('0x28')](_0x509075,_0x2d7606)[_0x6051('0x2a')](function(_0x3f9107){if(_0x3f9107&&_0x3f9107['length']){return _0x3f9107;}else{var _0x5a6bca=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x39')]){var _0x32dd8d={};_0x32dd8d[_0x55529b[_0x6051('0x39')]]=_0xa94318;_['merge'](_0x5a6bca[_0x6051('0x37')],_0x32dd8d);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x5a6bca,_0x2d7606);}});}});case _0x6051('0x1a'):var _0x5d0827=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x36')]]=_0xa94318;_[_0x6051('0x3a')](_0x5d0827[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))['find'](_0x5d0827,_0x2d7606)[_0x6051('0x29')]();case _0x6051('0x1b'):var _0x178905=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x39')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x39')]]=_0xa94318;_['merge'](_0x178905[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x178905,_0x2d7606);case _0x6051('0x1d'):var _0xb8e58b=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x3d')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x3d')]]=_0xa94318;_[_0x6051('0x3a')](_0xb8e58b[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3e'))[_0x6051('0x28')](_0xb8e58b,_0x2d7606);default:return null;}})[_0x6051('0x2a')](function(_0x2827a8){if(_0x2827a8&&_0x2827a8['length']){var _0x508837=_['first'](_0x2827a8);if(_0x508837){return BPromise[_0x6051('0x2d')]({'id':_0x508837['Id'],'name':_0x508837[_0x6051('0x2e')],'phone':_0x508837[_0x6051('0x3f')],'endUserType':_0x508837[_0x6051('0x40')][_0x6051('0x41')][_0x6051('0x42')]()});}}})['then'](function(_0x13c273){if(_0x13c273){logger[_0x6051('0x22')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x13c273[_0x6051('0x19')],_0xa94318);return BPromise['resolve'](_0x13c273);}else{logger[_0x6051('0x22')](_0x6051('0x43'),_0xa94318);var _0x290389={'Phone':_0xa94318};if(_0x55529b[_0x6051('0x44')]){if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1a')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xa94318,_0x55529b[_0x6051('0x44')]);_0x290389[_0x6051('0x45')]=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')](_0x6051('0x48'),_0xa94318);}else if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1b')){logger['info'](_0x6051('0x49'),_0xa94318,_0x55529b['moduleCreate']);_0x290389['LastName']=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')]('Caller\x20-\x20%s',_0xa94318);_0x290389[_0x6051('0x4a')]=_0x6051('0x4b');}else if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1d')){logger[_0x6051('0x22')](_0x6051('0x49'),_0xa94318,_0x55529b['moduleCreate']);_0x290389[_0x6051('0x2e')]=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')]('Caller\x20-\x20%s',_0xa94318);}else{return null;}}return _0x43351d[_0x6051('0x24')](_[_0x6051('0x4c')](_0x55529b[_0x6051('0x44')]))[_0x6051('0x4d')](_0x290389)[_0x6051('0x2a')](function(_0x1c65ca){return BPromise[_0x6051('0x2d')]({'id':_0x1c65ca['id'],'endUserType':_0x55529b[_0x6051('0x44')]});});}});}function getCustomFields(_0x547b5e,_0x1f17a1){var _0x1d3e0d={};if(_0x547b5e[_0x6051('0x2b')]>0x0){_['forEach'](_0x547b5e,function(_0x5b74db){if(_[_0x6051('0x4e')]([_0x6051('0x4f'),_0x6051('0x50')],_0x5b74db[_0x6051('0x41')])&&_0x5b74db[_0x6051('0x51')]){_0x1d3e0d[_0x5b74db[_0x6051('0x51')]]=_0x5b74db[_0x6051('0x52')][_0x6051('0x53')]();}else if(_0x5b74db['type']===_0x6051('0x54')&&_0x5b74db['variableName']&&_0x5b74db[_0x6051('0x51')]){_0x1f17a1[_0x5b74db['variableName']]&&(_0x1d3e0d[_0x5b74db[_0x6051('0x51')]]=_0x1f17a1[_0x5b74db[_0x6051('0x55')]][_0x6051('0x53')]());}else if(_0x5b74db[_0x6051('0x41')]==='customVariable'&&_0x5b74db[_0x6051('0x56')]&&_0x5b74db[_0x6051('0x56')][_0x6051('0x57')]&&_0x5b74db[_0x6051('0x51')]){_0x1f17a1[_0x5b74db['Variable'][_0x6051('0x57')]['toLowerCase']()]&&(_0x1d3e0d[_0x5b74db['idField']]=_0x1f17a1[_0x5b74db[_0x6051('0x56')][_0x6051('0x57')]['toLowerCase']()][_0x6051('0x53')]());}});}return _0x1d3e0d;}function getConnection(_0x1a7b16){var _0x278fcf=_0x1a7b16[_0x6051('0x58')]['concat'](_0x1a7b16[_0x6051('0x59')]);var _0x3e572a=new jsforce[(_0x6051('0x5a'))]({'oauth2':{'loginUrl':_0x1a7b16[_0x6051('0x5b')]||_0x6051('0x5c'),'clientId':_0x1a7b16[_0x6051('0x5d')],'clientSecret':_0x1a7b16[_0x6051('0x5e')]}});return _0x3e572a[_0x6051('0x5f')](_0x1a7b16['username'],_0x278fcf)[_0x6051('0x2a')](function(){logger['info'](_0x6051('0x60'));return _0x3e572a;});}exports[_0x6051('0x61')]=function(_0x2071a1,_0x5b1846,_0x22cd07,_0x52008f,_0x3842a0,_0x188748){var _0x1b7068,_0x1c6d58,_0x266a51,_0x17043f;_0x188748['serverUrl']=intUtil[_0x6051('0x62')](_0x188748['serverUrl']);_0x188748['remoteUri']=intUtil[_0x6051('0x62')](_0x188748[_0x6051('0x5b')]);if(_0x3842a0&&_0x3842a0[_0x6051('0x63')]){logger['info'](_0x6051('0x64'),_0x6051('0x65'));_0x5b1846[_0x6051('0x66')]=util[_0x6051('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x188748[_0x6051('0x67')],_0x5b1846['uniqueid'],md5(_0x5b1846[_0x6051('0x68')]));}else{_0x5b1846['recordingURL']='';}return getConnection(_0x188748)[_0x6051('0x2a')](function(_0x32446d){_0x17043f=_0x32446d;return getUser(_0x188748,_0x52008f[_0x6051('0x69')],_0x17043f);})[_0x6051('0x2a')](function(_0x3efe98){_0x1b7068=_0x3efe98;return getEndUser(_0x188748,_0x22cd07,_0x5b1846[_0x6051('0x6a')],_0x5b1846[_0x6051('0x6b')],_0x17043f);})[_0x6051('0x2a')](function(_0x4d04da){_0x1c6d58=_0x4d04da;return getTicket(_0x188748,_0x1b7068,_0x1c6d58,_0x22cd07,_0x5b1846,_0x22cd07[_0x6051('0x6c')],_0x17043f,_0x6051('0x61'));})[_0x6051('0x2a')](function(_0x1e697e){_0x266a51=_0x1e697e;logger['info'](_0x6051('0x6d'),_0x266a51['id']);logger[_0x6051('0x22')](_0x6051('0x6e'),_0x266a51['id'],_0x52008f['name'],_0x188748[_0x6051('0x41')]);switch(_0x188748[_0x6051('0x41')]){case'integrationTab':emit(util[_0x6051('0x47')]('user:%s',_0x52008f['name']),'trigger:salesforce:display',{'recordId':_0x266a51['id']});break;case _0x6051('0x6f'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x52008f[_0x6051('0x57')]),_0x6051('0x71'),{'uri':util['format'](_0x6051('0x72'),_0x17043f[_0x6051('0x73')],_0x266a51['id'])});break;default:logger[_0x6051('0x74')](_0x6051('0x75'));}})[_0x6051('0x76')](function(_0x44ca37){logger[_0x6051('0x74')](_0x6051('0x64'),_0x44ca37);});};exports['outbound']=function(_0x43718e,_0x1e4047,_0x43e6c6,_0x240607,_0x5a2ccf,_0x110f68,_0x5d6e21){var _0x1cca10,_0x5669ef,_0x4fba9d,_0x18d078;_0x110f68['serverUrl']=intUtil['stripTrailingSlash'](_0x110f68[_0x6051('0x67')]);_0x110f68[_0x6051('0x5b')]=intUtil[_0x6051('0x62')](_0x110f68['remoteUri']);if(_0x5d6e21&&_0x5d6e21[_0x6051('0x77')]&&_0x5d6e21[_0x6051('0x77')]!==_0x6051('0x78')){logger[_0x6051('0x22')](_0x6051('0x79'),'Recording\x20is\x20enabled!');_0x1e4047[_0x6051('0x66')]=util[_0x6051('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x110f68[_0x6051('0x67')],_0x1e4047[_0x6051('0x68')],md5(_0x1e4047['uniqueid']));}return getConnection(_0x110f68)['then'](function(_0x4eb35a){_0x18d078=_0x4eb35a;return getUser(_0x110f68,_0x240607[_0x6051('0x69')],_0x18d078);})[_0x6051('0x2a')](function(_0x5e89ee){_0x1cca10=_0x5e89ee;return getEndUser(_0x110f68,_0x43e6c6,_0x1e4047['destcalleridname'],_0x1e4047['destcalleridnum'],_0x18d078);})[_0x6051('0x2a')](function(_0x3eaa2c){_0x5669ef=_0x3eaa2c;return getTicket(_0x110f68,_0x1cca10,_0x5669ef,_0x43e6c6,_0x1e4047,_0x43e6c6[_0x6051('0x6c')],_0x18d078,_0x6051('0x7a'));})[_0x6051('0x2a')](function(_0x16c635){_0x4fba9d=_0x16c635;logger['info'](_0x6051('0x7b'),_0x4fba9d['id']);logger[_0x6051('0x22')](_0x6051('0x7c'),_0x4fba9d['id'],_0x240607['name'],_0x110f68['type']);switch(_0x110f68[_0x6051('0x41')]){case _0x6051('0x7d'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x240607[_0x6051('0x57')]),'trigger:salesforce:display',{'recordId':_0x4fba9d['id']});break;case _0x6051('0x6f'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x240607[_0x6051('0x57')]),'trigger:browser:url',{'uri':util[_0x6051('0x47')](_0x6051('0x72'),_0x18d078[_0x6051('0x73')],_0x4fba9d['id'])});break;default:logger[_0x6051('0x74')](_0x6051('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x22159d){logger['error'](_0x6051('0x79'),_0x22159d);});};exports[_0x6051('0x7e')]=function(_0x2de740,_0xe290f8,_0x28968f,_0x2e4fdc,_0xf89fc0,_0x36650f){var _0x169c1b,_0x8022b0,_0x6f46f6,_0x344143;_0x36650f[_0x6051('0x67')]=intUtil[_0x6051('0x62')](_0x36650f['serverUrl']);_0x36650f[_0x6051('0x5b')]=intUtil[_0x6051('0x62')](_0x36650f['remoteUri']);if(_0xf89fc0&&_0xf89fc0['monitor_format']){logger['info']('['+_0xe290f8[_0x6051('0x7f')]['toUpperCase']()+']',_0x6051('0x65'));_0xe290f8['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36650f[_0x6051('0x67')],_0xe290f8[_0x6051('0x68')],md5(_0xe290f8[_0x6051('0x68')]));}else{_0xe290f8['recordingURL']='';}return getConnection(_0x36650f)[_0x6051('0x2a')](function(_0x4bd908){_0x344143=_0x4bd908;if(!_['isNil'](_0x2e4fdc)){return getUser(_0x36650f,_0x2e4fdc[_0x6051('0x57')],_0x344143);}else{return getUser(_0x36650f,null,_0x344143);}})[_0x6051('0x2a')](function(_0x1ac7f0){_0x169c1b=_0x1ac7f0;return getEndUser(_0x36650f,_0x28968f,_0xe290f8['calleridname'],_0xe290f8['calleridnum'],_0x344143);})[_0x6051('0x2a')](function(_0x529341){_0x8022b0=_0x529341;return getTicket(_0x36650f,_0x169c1b,_0x8022b0,_0x28968f,_0xe290f8,_0x28968f['Fields'],_0x344143);})[_0x6051('0x2a')](function(_0x41308a){_0x6f46f6=_0x41308a;logger[_0x6051('0x22')]('['+_0xe290f8[_0x6051('0x7f')]['toUpperCase']()+_0x6051('0x80'),_0x6f46f6['id']);logger['info']('['+_0xe290f8[_0x6051('0x7f')][_0x6051('0x81')]()+_0x6051('0x82'),_0x36650f[_0x6051('0x41')]);})[_0x6051('0x76')](function(_0x579b38){logger[_0x6051('0x74')]('['+_0xe290f8['lastevent'][_0x6051('0x81')]()+']',_0x579b38);});}; \ 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 c6c208b..f6b0a0e 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 _0xbec3=['sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','nameField','toLowerCase','content','toString','type','idField','customField','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET'];(function(_0xbb7389,_0x12b29d){var _0x12537b=function(_0x42a1f9){while(--_0x42a1f9){_0xbb7389['push'](_0xbb7389['shift']());}};_0x12537b(++_0x12b29d);}(_0xbec3,0x14a));var _0x3bec=function(_0x35081e,_0x44044f){_0x35081e=_0x35081e-0x0;var _0x483032=_0xbec3[_0x35081e];return _0x483032;};'use strict';var _=require(_0x3bec('0x0'));var Promise=require('bluebird');var rp=require(_0x3bec('0x1'));var util=require(_0x3bec('0x2'));var md5=require(_0x3bec('0x3'));var Redis=require(_0x3bec('0x4'));var intUtil=require(_0x3bec('0x5'));var config=require(_0x3bec('0x6'));var logger=require('../../../../config/logger')('servicenow');config[_0x3bec('0x7')]=_[_0x3bec('0x8')](config[_0x3bec('0x7')],{'host':_0x3bec('0x9'),'port':0x18eb});var io=require(_0x3bec('0xa'))(new Redis(config[_0x3bec('0x7')]));function getAdminUser(_0x168e19,_0xfec6ef,_0xb0d902,_0x531fd8,_0x3338a6,_0x34b1a0){return new Promise(function(_0x31adac,_0x1972c0){var _0x580231={'method':_0x3bec('0xb'),'uri':_0x531fd8+_0x3bec('0xc')+'&'+_0x3338a6+'&'+_0x34b1a0,'auth':_0xfec6ef,'json':!![]};return rp(_0x580231)['then'](function(_0x43f03a){if(_0x43f03a[_0x3bec('0xd')][_0x3bec('0xe')]>0x0){_0xb0d902[_0x3bec('0xf')]=_0x43f03a[_0x3bec('0xd')][0x0][_0x3bec('0x10')];}logger[_0x3bec('0x11')]('['+[_0x168e19['toUpperCase']()]+_0x3bec('0x12'),_0xb0d902);_0x31adac(_0xb0d902);})[_0x3bec('0x13')](function(_0x13b660){logger['error']('['+[_0x168e19[_0x3bec('0x14')]()]+']',_0x13b660['message']);_0x1972c0(_0x13b660[_0x3bec('0x15')]);});});}function getUser(_0x5176cd,_0x33e2cf,_0x5d9ce5,_0x33416e,_0x284a2b){return function(_0xf5ca10){logger[_0x3bec('0x11')]('['+[_0x5176cd[_0x3bec('0x14')]()]+_0x3bec('0x16'),_0xf5ca10);return new Promise(function(_0x294977,_0x5e6c63){if(intUtil[_0x3bec('0x17')](_0xf5ca10['userEmail'])){var _0x38e8c2={'method':'GET','uri':_0x5d9ce5+_0x3bec('0x18')+_0xf5ca10[_0x3bec('0x19')]+'&'+_0x33416e+'&'+_0x284a2b,'auth':_0x33e2cf,'json':!![]};logger[_0x3bec('0x11')]('['+[_0x5176cd['toUpperCase']()]+_0x3bec('0x1a'),_0x38e8c2);return rp(_0x38e8c2)[_0x3bec('0x1b')](function(_0x3188e5){logger[_0x3bec('0x11')]('['+[_0x5176cd['toUpperCase']()]+_0x3bec('0x1c'),_0x3188e5);if(_0x3188e5[_0x3bec('0xd')][_0x3bec('0xe')]>0x0&&String(_0x3188e5[_0x3bec('0xd')][0x0]['active'])===_0x3bec('0x1d')){_0xf5ca10[_0x3bec('0x1e')]=_0x3188e5[_0x3bec('0xd')][0x0]['sys_id'];}else{_0xf5ca10[_0x3bec('0x1e')]=_0xf5ca10[_0x3bec('0xf')];_0xf5ca10['userEmail']=_0xf5ca10['adminEmail'];}logger[_0x3bec('0x11')]('['+[_0x5176cd['toUpperCase']()]+_0x3bec('0x1f'),_0xf5ca10);_0x294977(_0xf5ca10);})[_0x3bec('0x13')](function(_0x21c983){logger[_0x3bec('0x20')]('['+[_0x5176cd[_0x3bec('0x14')]()]+']',_0x21c983[_0x3bec('0x15')]);_0x5e6c63(_0x21c983[_0x3bec('0x15')]);});}else{logger[_0x3bec('0x11')]('['+[_0x5176cd[_0x3bec('0x14')]()]+_0x3bec('0x21'));_0xf5ca10['userId']=_0xf5ca10['adminId'];_0xf5ca10['userEmail']=_0xf5ca10['adminEmail'];_0x294977(_0xf5ca10);}});};}function createEndUser(_0x356e80,_0x4c53ae,_0x361bf3,_0x55b82b,_0x4741e5){logger[_0x3bec('0x11')]('['+[_0x356e80['toUpperCase']()]+_0x3bec('0x22'),_0x361bf3);return new Promise(function(_0xfa1164,_0x4d6d5e){var _0x3407ab={'method':_0x3bec('0x23'),'uri':_0x55b82b+_0x3bec('0x24')+_0x4741e5,'body':{'user_name':_0x361bf3[_0x3bec('0x25')],'roles':'user','first_name':_0x361bf3['endUserNumber'],'active':'true','date_format':'System','phone':_0x361bf3[_0x3bec('0x25')]},'auth':_0x4c53ae,'json':!![]};return rp(_0x3407ab)[_0x3bec('0x1b')](function(_0x22d384){logger['info']('['+[_0x356e80[_0x3bec('0x14')]()]+'],\x20EndUser\x20schema',_0x22d384[_0x3bec('0xd')]);_0x361bf3['endUserId']=_0x22d384[_0x3bec('0xd')][_0x3bec('0x10')];_0xfa1164(_0x361bf3);})[_0x3bec('0x13')](function(_0x51d08c){logger[_0x3bec('0x20')]('['+[_0x356e80[_0x3bec('0x14')]()]+']',_0x51d08c[_0x3bec('0x15')]);_0x4d6d5e(_0x51d08c[_0x3bec('0x15')]);});});}function getEndUser(_0x5c62ba,_0x1139be,_0x5da58f,_0x1ca569,_0x2c89c3){return function(_0x548184){logger[_0x3bec('0x11')]('['+[_0x5c62ba[_0x3bec('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0x548184);return new Promise(function(_0x5ca034,_0x52b8b9){var _0x604292={'method':_0x3bec('0xb'),'uri':_0x5da58f+_0x3bec('0x26')+_0x548184[_0x3bec('0x25')]+'&'+_0x1ca569+'&'+_0x2c89c3,'auth':_0x1139be,'json':!![]};return rp(_0x604292)[_0x3bec('0x1b')](function(_0x3b6789){if(_0x3b6789[_0x3bec('0xd')]['length']>0x0){_0x548184[_0x3bec('0x27')]=_0x3b6789[_0x3bec('0xd')][0x0][_0x3bec('0x10')];logger['info']('['+[_0x5c62ba['toUpperCase']()]+_0x3bec('0x28'),_0x548184);_0x5ca034(_0x548184);}else{return createEndUser(_0x5c62ba,_0x1139be,_0x548184,_0x5da58f,_0x1ca569)[_0x3bec('0x1b')](function(_0x306ffd){logger[_0x3bec('0x11')]('['+[_0x5c62ba['toUpperCase']()]+_0x3bec('0x29'),_0x306ffd);_0x5ca034(_0x306ffd);});}})['catch'](function(_0x1791ac){logger[_0x3bec('0x20')]('['+[_0x5c62ba[_0x3bec('0x14')]()]+']',_0x1791ac[_0x3bec('0x15')]);_0x52b8b9(_0x1791ac[_0x3bec('0x15')]);});});};}function getCustomFields(_0x18c915,_0x3c0b74){var _0x5c0b89={};if(_0x18c915['length']>0x0){_[_0x3bec('0x2a')](_0x18c915,function(_0x57a50c){if(_[_0x3bec('0x2b')]([_0x3bec('0x2c'),'picklist'],_0x57a50c['type'])&&_0x57a50c[_0x3bec('0x2d')]&&!_0x57a50c['customField']){_0x5c0b89[_0x57a50c[_0x3bec('0x2d')][_0x3bec('0x2e')]()]=_0x57a50c[_0x3bec('0x2f')][_0x3bec('0x30')]();}else if(_[_0x3bec('0x2b')]([_0x3bec('0x2c'),'picklist'],_0x57a50c[_0x3bec('0x31')])&&_0x57a50c[_0x3bec('0x32')]&&_0x57a50c[_0x3bec('0x33')]){_0x5c0b89[_0x57a50c[_0x3bec('0x32')][_0x3bec('0x2e')]()]=_0x57a50c[_0x3bec('0x2f')][_0x3bec('0x30')]();}else if(_0x57a50c['type']===_0x3bec('0x34')&&_0x57a50c[_0x3bec('0x35')]&&_0x57a50c[_0x3bec('0x32')]&&_0x57a50c[_0x3bec('0x33')]){_0x5c0b89[_0x57a50c[_0x3bec('0x32')][_0x3bec('0x2e')]()]=_0x3c0b74[_0x57a50c[_0x3bec('0x35')]][_0x3bec('0x30')]();}else if(_0x57a50c[_0x3bec('0x31')]===_0x3bec('0x36')&&_0x57a50c[_0x3bec('0x37')]&&_0x57a50c['Variable']['name']&&_0x57a50c[_0x3bec('0x32')]&&_0x57a50c[_0x3bec('0x33')]){_0x5c0b89[_0x57a50c[_0x3bec('0x32')][_0x3bec('0x2e')]()]=_0x3c0b74[_0x57a50c[_0x3bec('0x37')]['name'][_0x3bec('0x2e')]()]['toString']();}});}return _0x5c0b89;}function getTicket(_0x188168,_0x2fdad3,_0xab7091,_0x120b63,_0x27ae35,_0x2aaead){return function(_0x1ba036){logger[_0x3bec('0x11')]('['+[_0x188168[_0x3bec('0x14')]()]+_0x3bec('0x38'),_0x1ba036);return new Promise(function(_0xb60ec1,_0x4348d7){var _0x17fbc5=_0x188168[_0x3bec('0x2e')]()===_0x3bec('0x39')?_0x1ba036['userId']:_0x1ba036['endUserId'];var _0x45aa39={'method':_0x3bec('0x23'),'uri':_0xab7091+_0x3bec('0x3a')+'?'+_0x2aaead,'body':Object[_0x3bec('0x3b')]({},{'active':_0x3bec('0x1d'),'caller_id':_0x17fbc5,'assigned_to':_0x1ba036[_0x3bec('0x1e')],'short_description':intUtil['getString'](_0x120b63[_0x3bec('0x3c')],_0x27ae35,'\x20'),'description':intUtil[_0x3bec('0x3d')](_0x120b63[_0x3bec('0x3e')],_0x27ae35,'\x0a')},getCustomFields(_0x120b63[_0x3bec('0x3f')],_0x27ae35)),'auth':_0x2fdad3,'json':!![]};return rp(_0x45aa39)[_0x3bec('0x1b')](function(_0x47c0a3){logger[_0x3bec('0x11')]('['+[_0x188168[_0x3bec('0x14')]()]+_0x3bec('0x40'),_0x47c0a3['result']);_0x1ba036[_0x3bec('0x41')]=_0x47c0a3[_0x3bec('0xd')][_0x3bec('0x10')];_0x1ba036[_0x3bec('0x42')]=_0x47c0a3['result'][_0x3bec('0x43')];logger['info']('['+[_0x188168['toUpperCase']()]+_0x3bec('0x44'),_0x1ba036);_0xb60ec1(_0x1ba036);})[_0x3bec('0x13')](function(_0x14349e){logger[_0x3bec('0x20')]('['+[_0x188168[_0x3bec('0x14')]()]+']',_0x14349e[_0x3bec('0x15')]);_0x4348d7(_0x14349e[_0x3bec('0x15')]);});});};}function createRemoteTag(_0x5e1266,_0xd632d5,_0x541d3f,_0x5c3cd2){return new Promise(function(_0x1f741a,_0x7bbe4e){var _0x4a0236={'method':_0x3bec('0x23'),'uri':_0x541d3f+_0x3bec('0x45')+'?'+_0x5c3cd2,'body':{'short_description':_0x5e1266,'global':!![],'active':!![],'name':_0x5e1266},'auth':_0xd632d5,'json':!![]};return rp(_0x4a0236)[_0x3bec('0x1b')](function(_0x30d7df){var _0x2b6d00=_0x30d7df[_0x3bec('0xd')][_0x3bec('0x10')];_0x1f741a(_0x2b6d00);});});}function getRemoteTag(_0x34ec7b,_0x4e35d7,_0x4cb78d,_0x209a0e,_0x2ceccf){return new Promise(function(_0x1a33eb,_0x122a96){var _0x5080eb={'method':_0x3bec('0xb'),'uri':_0x4cb78d+_0x3bec('0x45')+_0x3bec('0x46')+_0x34ec7b+'&'+_0x209a0e,'auth':_0x4e35d7,'json':!![]};return rp(_0x5080eb)[_0x3bec('0x1b')](function(_0x55c449){if(_0x55c449[_0x3bec('0xd')][_0x3bec('0xe')]>0x0){var _0x25712b=_0x55c449['result'][0x0][_0x3bec('0x10')];_0x1a33eb(_0x25712b);}else{return createRemoteTag(_0x34ec7b,_0x4e35d7,_0x4cb78d,_0x209a0e)[_0x3bec('0x1b')](function(_0x15beaf){_0x1a33eb(_0x15beaf);});}});});}function assignTagToIncident(_0x1a63ac,_0x415cfb,_0x2d593b,_0xacf3e2,_0x26eac4){return new Promise(function(_0x3a4763,_0x1f4e73){var _0xa4f4a1={'method':'POST','uri':_0x2d593b+_0x3bec('0x47')+'?'+_0x26eac4,'body':{'label':_0x1a63ac,'table':_0x3bec('0x3a'),'id_type':_0x3bec('0x48'),'table_key':_0xacf3e2[_0x3bec('0x41')],'title':_0x3bec('0x49')+_0xacf3e2[_0x3bec('0x42')],'id_display':_0xacf3e2[_0x3bec('0x42')]},'auth':_0x415cfb,'json':!![]};return rp(_0xa4f4a1)[_0x3bec('0x1b')](function(_0x247dcd){_0x3a4763();})[_0x3bec('0x13')](function(){_0x3a4763();});});}function manageTags(_0x486056,_0x31c565,_0x488d49,_0x541ff0,_0x4b06bb,_0x548a3d,_0x4f5a94){return new Promise(function(_0xce9407,_0x1d0325){var _0x1028a5=[];_0x31c565[_0x3bec('0x2a')](function(_0x5f1d42){_0x1028a5[_0x3bec('0x4a')](getRemoteTag(_0x5f1d42,_0x488d49,_0x541ff0,_0x548a3d,_0x4f5a94));});return Promise['all'](_0x1028a5)[_0x3bec('0x1b')](function(_0x5bc1d9){if(_0x5bc1d9[_0x3bec('0xe')]){logger['info']('['+[_0x486056[_0x3bec('0x14')]()]+_0x3bec('0x4b'),_0x5bc1d9);var _0xf52c2e=[];_0x5bc1d9['forEach'](function(_0x5cb720){_0xf52c2e[_0x3bec('0x4a')](assignTagToIncident(_0x5cb720,_0x488d49,_0x541ff0,_0x4b06bb,_0x548a3d));});return Promise[_0x3bec('0x4c')](_0xf52c2e)['then'](function(){_0xce9407();})['catch'](function(){_0xce9407();});}else{_0xce9407();}});});}function getTags(_0x5e573e,_0x45cf46,_0x2927ef,_0x4ff703,_0x19803b,_0x3b92be){return function(_0x59e8dd){return new Promise(function(_0x5b4cc1,_0x51fa70){var _0x3356e0=[];var _0x2845ae=_0x4ff703['Tags'];if(_0x2845ae&&_0x2845ae[_0x3bec('0xe')]>0x0){_0x3356e0=_[_0x3bec('0x4d')](_0x2845ae,'name');}if(_0x3356e0[_0x3bec('0xe')]>0x0){return manageTags(_0x5e573e,_0x3356e0,_0x45cf46,_0x2927ef,_0x59e8dd,_0x19803b,_0x3b92be)['then'](function(){_0x5b4cc1(_0x59e8dd);});}else{_0x5b4cc1(_0x59e8dd);}});};}function emit(_0x50bf37,_0x2f2f26,_0x5056d8){var _0x76f80e=_0x3bec('0x4e')+_0x3bec('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x3bec('0x50');var _0x49d090={'uri':_0x50bf37+_0x3bec('0x51')+_0x5056d8+_0x76f80e};io['to'](util[_0x3bec('0x52')](_0x3bec('0x53'),_0x2f2f26))[_0x3bec('0x54')](_0x3bec('0x55'),_0x49d090);}exports['cs']=function(_0x1d6a78,_0x3bafd5,_0x5dae16,_0x4568d4,_0x36ce14,_0x81113b,_0x198b9d,_0x570e54){var _0x18f84d={};var _0x4be74a={'user':_0x81113b[_0x3bec('0x56')],'pass':_0x81113b[_0x3bec('0x57')]};var _0x49a400=_0x3bec('0x58');var _0x573676=_0x3bec('0x59');_0x81113b[_0x3bec('0x5a')]=intUtil[_0x3bec('0x5b')](_0x81113b[_0x3bec('0x5a')]);_0x81113b[_0x3bec('0x5c')]=intUtil[_0x3bec('0x5b')](_0x81113b[_0x3bec('0x5c')]);var _0xb48869=util['format'](_0x3bec('0x5d'),_0x81113b[_0x3bec('0x5a')]);_0x18f84d[_0x3bec('0x19')]=!_[_0x3bec('0x5e')](_0x4568d4)?_0x4568d4[_0x3bec('0x5f')]:null;_0x18f84d[_0x3bec('0x60')]=_0x81113b['email'];_0x18f84d['endUserNumber']=_0x570e54['toLowerCase']()===_0x3bec('0x39')?_0x3bafd5[_0x3bec('0x61')]:_0x3bafd5['calleridnum'];_0x18f84d[_0x3bec('0x62')]=_0x570e54===_0x3bec('0x63')||_0x570e54===_0x3bec('0x64')?_0x3bec('0x63'):'outbound';var _0x7d22cf=util[_0x3bec('0x52')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x81113b[_0x3bec('0x5c')],_0x3bafd5[_0x3bec('0x65')],md5(_0x3bafd5[_0x3bec('0x65')]));if(_0x36ce14&&_0x36ce14['monitor_format']){logger[_0x3bec('0x11')](_0x3bec('0x66'),_0x3bec('0x67'));_0x3bafd5[_0x3bec('0x68')]=_0x7d22cf;}else if(_0x198b9d&&_0x198b9d[_0x3bec('0x69')]&&_0x198b9d[_0x3bec('0x69')]!==_0x3bec('0x6a')){logger[_0x3bec('0x11')](_0x3bec('0x6b'),_0x3bec('0x67'));_0x3bafd5[_0x3bec('0x68')]=_0x7d22cf;}else{_0x3bafd5[_0x3bec('0x68')]='';}return getAdminUser(_0x570e54,_0x4be74a,_0x18f84d,_0xb48869,_0x573676,_0x49a400)[_0x3bec('0x1b')](getUser(_0x570e54,_0x4be74a,_0xb48869,_0x573676,_0x49a400))[_0x3bec('0x1b')](getEndUser(_0x570e54,_0x4be74a,_0xb48869,_0x573676,_0x49a400))[_0x3bec('0x1b')](getTicket(_0x570e54,_0x4be74a,_0xb48869,_0x5dae16,_0x3bafd5,_0x573676))[_0x3bec('0x1b')](function(_0x538642){logger['info'](util[_0x3bec('0x52')](_0x3bec('0x6c'),_0x538642[_0x3bec('0x41')]));logger[_0x3bec('0x11')](util[_0x3bec('0x52')](_0x3bec('0x6d'),_0x570e54));if(_0x570e54!==_0x3bec('0x64')){logger[_0x3bec('0x11')]('['+[_0x570e54['toUpperCase']()]+']',_0x3bec('0x6e'));emit(_0x81113b[_0x3bec('0x5a')],_0x4568d4[_0x3bec('0x6f')],_0x538642['ticketId']);}})[_0x3bec('0x13')](function(_0x552ef1){logger[_0x3bec('0x20')]('['+[_0x570e54[_0x3bec('0x14')]()]+_0x3bec('0x70'),util[_0x3bec('0x71')](_0x552ef1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbb91=['../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','info','],\x20getUser\x20rp\x20obj','length','active','true','userId','sys_id','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','ticketId','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','./util'];(function(_0x5650ea,_0x55186b){var _0x5a82cf=function(_0x1fe01c){while(--_0x1fe01c){_0x5650ea['push'](_0x5650ea['shift']());}};_0x5a82cf(++_0x55186b);}(_0xbb91,0xce));var _0x1bb9=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xbb91[_0x737a1f];return _0x16eba1;};'use strict';var _=require(_0x1bb9('0x0'));var Promise=require(_0x1bb9('0x1'));var rp=require(_0x1bb9('0x2'));var util=require('util');var md5=require(_0x1bb9('0x3'));var Redis=require(_0x1bb9('0x4'));var intUtil=require(_0x1bb9('0x5'));var config=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));config[_0x1bb9('0x9')]=_['defaults'](config[_0x1bb9('0x9')],{'host':_0x1bb9('0xa'),'port':0x18eb});var io=require(_0x1bb9('0xb'))(new Redis(config[_0x1bb9('0x9')]));function getAdminUser(_0x257cae,_0x5becd3,_0x5a45f0,_0x14e709,_0x33f7b6,_0x3217ab){return new Promise(function(_0x4be0ec,_0x5d8df9){var _0x303345={'method':_0x1bb9('0xc'),'uri':_0x14e709+_0x1bb9('0xd')+'&'+_0x33f7b6+'&'+_0x3217ab,'auth':_0x5becd3,'json':!![]};return rp(_0x303345)[_0x1bb9('0xe')](function(_0xc697c7){if(_0xc697c7[_0x1bb9('0xf')]['length']>0x0){_0x5a45f0['adminId']=_0xc697c7[_0x1bb9('0xf')][0x0]['sys_id'];}logger['info']('['+[_0x257cae['toUpperCase']()]+_0x1bb9('0x10'),_0x5a45f0);_0x4be0ec(_0x5a45f0);})[_0x1bb9('0x11')](function(_0x399883){logger[_0x1bb9('0x12')]('['+[_0x257cae[_0x1bb9('0x13')]()]+']',_0x399883[_0x1bb9('0x14')]);_0x5d8df9(_0x399883[_0x1bb9('0x14')]);});});}function getUser(_0x1dd719,_0x11c55b,_0x21d334,_0xa2729e,_0x178b5e){return function(_0x1fee8b){logger['info']('['+[_0x1dd719[_0x1bb9('0x13')]()]+_0x1bb9('0x15'),_0x1fee8b);return new Promise(function(_0x1d5e98,_0x1ec5be){if(intUtil['validateEmail'](_0x1fee8b['userEmail'])){var _0x5c11c6={'method':_0x1bb9('0xc'),'uri':_0x21d334+_0x1bb9('0x16')+_0x1fee8b[_0x1bb9('0x17')]+'&'+_0xa2729e+'&'+_0x178b5e,'auth':_0x11c55b,'json':!![]};logger[_0x1bb9('0x18')]('['+[_0x1dd719[_0x1bb9('0x13')]()]+_0x1bb9('0x19'),_0x5c11c6);return rp(_0x5c11c6)['then'](function(_0x298961){logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+'],\x20getUser\x20entity',_0x298961);if(_0x298961[_0x1bb9('0xf')][_0x1bb9('0x1a')]>0x0&&String(_0x298961[_0x1bb9('0xf')][0x0][_0x1bb9('0x1b')])===_0x1bb9('0x1c')){_0x1fee8b[_0x1bb9('0x1d')]=_0x298961['result'][0x0][_0x1bb9('0x1e')];}else{_0x1fee8b[_0x1bb9('0x1d')]=_0x1fee8b[_0x1bb9('0x1f')];_0x1fee8b[_0x1bb9('0x17')]=_0x1fee8b[_0x1bb9('0x20')];}logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+_0x1bb9('0x21'),_0x1fee8b);_0x1d5e98(_0x1fee8b);})[_0x1bb9('0x11')](function(_0x21b0c9){logger[_0x1bb9('0x12')]('['+[_0x1dd719[_0x1bb9('0x13')]()]+']',_0x21b0c9[_0x1bb9('0x14')]);_0x1ec5be(_0x21b0c9[_0x1bb9('0x14')]);});}else{logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+_0x1bb9('0x22'));_0x1fee8b[_0x1bb9('0x1d')]=_0x1fee8b[_0x1bb9('0x1f')];_0x1fee8b[_0x1bb9('0x17')]=_0x1fee8b[_0x1bb9('0x20')];_0x1d5e98(_0x1fee8b);}});};}function createEndUser(_0xcab952,_0x57add6,_0x1026bd,_0xd11446,_0x8641a4){logger[_0x1bb9('0x18')]('['+[_0xcab952[_0x1bb9('0x13')]()]+_0x1bb9('0x23'),_0x1026bd);return new Promise(function(_0x4237fa,_0x3f1562){var _0x3204b2={'method':'POST','uri':_0xd11446+_0x1bb9('0x24')+_0x8641a4,'body':{'user_name':_0x1026bd[_0x1bb9('0x25')],'roles':_0x1bb9('0x26'),'first_name':_0x1026bd[_0x1bb9('0x25')],'active':_0x1bb9('0x1c'),'date_format':'System','phone':_0x1026bd[_0x1bb9('0x25')]},'auth':_0x57add6,'json':!![]};return rp(_0x3204b2)[_0x1bb9('0xe')](function(_0x165f33){logger['info']('['+[_0xcab952[_0x1bb9('0x13')]()]+_0x1bb9('0x27'),_0x165f33[_0x1bb9('0xf')]);_0x1026bd['endUserId']=_0x165f33[_0x1bb9('0xf')]['sys_id'];_0x4237fa(_0x1026bd);})[_0x1bb9('0x11')](function(_0x1ba731){logger[_0x1bb9('0x12')]('['+[_0xcab952[_0x1bb9('0x13')]()]+']',_0x1ba731[_0x1bb9('0x14')]);_0x3f1562(_0x1ba731[_0x1bb9('0x14')]);});});}function getEndUser(_0x5be855,_0x1f47e6,_0x28a3c4,_0x4a05bf,_0x5d4869){return function(_0x3e5f3e){logger[_0x1bb9('0x18')]('['+[_0x5be855['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x3e5f3e);return new Promise(function(_0x507db8,_0xee4ff3){var _0x3a0fad={'method':'GET','uri':_0x28a3c4+_0x1bb9('0x28')+_0x3e5f3e[_0x1bb9('0x25')]+'&'+_0x4a05bf+'&'+_0x5d4869,'auth':_0x1f47e6,'json':!![]};return rp(_0x3a0fad)[_0x1bb9('0xe')](function(_0x64396f){if(_0x64396f[_0x1bb9('0xf')]['length']>0x0){_0x3e5f3e['endUserId']=_0x64396f[_0x1bb9('0xf')][0x0][_0x1bb9('0x1e')];logger[_0x1bb9('0x18')]('['+[_0x5be855['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x3e5f3e);_0x507db8(_0x3e5f3e);}else{return createEndUser(_0x5be855,_0x1f47e6,_0x3e5f3e,_0x28a3c4,_0x4a05bf)['then'](function(_0x44aaa4){logger[_0x1bb9('0x18')]('['+[_0x5be855[_0x1bb9('0x13')]()]+_0x1bb9('0x29'),_0x44aaa4);_0x507db8(_0x44aaa4);});}})[_0x1bb9('0x11')](function(_0x2ffee6){logger['error']('['+[_0x5be855[_0x1bb9('0x13')]()]+']',_0x2ffee6[_0x1bb9('0x14')]);_0xee4ff3(_0x2ffee6['message']);});});};}function getCustomFields(_0x32ecb2,_0x512f9f){var _0x40f28b={};if(_0x32ecb2[_0x1bb9('0x1a')]>0x0){_[_0x1bb9('0x2a')](_0x32ecb2,function(_0x43c254){if(_['includes']([_0x1bb9('0x2b'),_0x1bb9('0x2c')],_0x43c254[_0x1bb9('0x2d')])&&_0x43c254[_0x1bb9('0x2e')]&&!_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254[_0x1bb9('0x2e')][_0x1bb9('0x30')]()]=_0x43c254[_0x1bb9('0x31')][_0x1bb9('0x32')]();}else if(_['includes']([_0x1bb9('0x2b'),_0x1bb9('0x2c')],_0x43c254[_0x1bb9('0x2d')])&&_0x43c254[_0x1bb9('0x33')]&&_0x43c254['customField']){_0x40f28b[_0x43c254[_0x1bb9('0x33')]['toLowerCase']()]=_0x43c254[_0x1bb9('0x31')][_0x1bb9('0x32')]();}else if(_0x43c254['type']===_0x1bb9('0x34')&&_0x43c254[_0x1bb9('0x35')]&&_0x43c254[_0x1bb9('0x33')]&&_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254[_0x1bb9('0x33')][_0x1bb9('0x30')]()]=_0x512f9f[_0x43c254[_0x1bb9('0x35')]][_0x1bb9('0x32')]();}else if(_0x43c254[_0x1bb9('0x2d')]==='customVariable'&&_0x43c254[_0x1bb9('0x36')]&&_0x43c254[_0x1bb9('0x36')][_0x1bb9('0x37')]&&_0x43c254['idField']&&_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254['idField'][_0x1bb9('0x30')]()]=_0x512f9f[_0x43c254[_0x1bb9('0x36')][_0x1bb9('0x37')]['toLowerCase']()][_0x1bb9('0x32')]();}});}return _0x40f28b;}function getTicket(_0x56fe6b,_0x457d50,_0x30102a,_0x2f5065,_0x5cd5c3,_0x28f58b){return function(_0x34bbc0){logger[_0x1bb9('0x18')]('['+[_0x56fe6b['toUpperCase']()]+_0x1bb9('0x38'),_0x34bbc0);return new Promise(function(_0x2be632,_0x102ba4){var _0x49d219=_0x56fe6b[_0x1bb9('0x30')]()===_0x1bb9('0x39')?_0x34bbc0['userId']:_0x34bbc0['endUserId'];var _0x5f0a14={'method':'POST','uri':_0x30102a+_0x1bb9('0x3a')+'?'+_0x28f58b,'body':Object[_0x1bb9('0x3b')]({},{'active':_0x1bb9('0x1c'),'caller_id':_0x49d219,'assigned_to':_0x34bbc0[_0x1bb9('0x1d')],'short_description':intUtil[_0x1bb9('0x3c')](_0x2f5065[_0x1bb9('0x3d')],_0x5cd5c3,'\x20'),'description':intUtil['getString'](_0x2f5065[_0x1bb9('0x3e')],_0x5cd5c3,'\x0a')},getCustomFields(_0x2f5065[_0x1bb9('0x3f')],_0x5cd5c3)),'auth':_0x457d50,'json':!![]};return rp(_0x5f0a14)['then'](function(_0x311523){logger[_0x1bb9('0x18')]('['+[_0x56fe6b['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x311523[_0x1bb9('0xf')]);_0x34bbc0['ticketId']=_0x311523[_0x1bb9('0xf')][_0x1bb9('0x1e')];_0x34bbc0['ticketNumber']=_0x311523[_0x1bb9('0xf')][_0x1bb9('0x40')];logger[_0x1bb9('0x18')]('['+[_0x56fe6b[_0x1bb9('0x13')]()]+_0x1bb9('0x41'),_0x34bbc0);_0x2be632(_0x34bbc0);})['catch'](function(_0x437321){logger[_0x1bb9('0x12')]('['+[_0x56fe6b[_0x1bb9('0x13')]()]+']',_0x437321[_0x1bb9('0x14')]);_0x102ba4(_0x437321[_0x1bb9('0x14')]);});});};}function createRemoteTag(_0x143017,_0x31d688,_0x422b80,_0x546d9a){return new Promise(function(_0x5497a0,_0x3fce42){var _0x2f5db6={'method':_0x1bb9('0x42'),'uri':_0x422b80+'label'+'?'+_0x546d9a,'body':{'short_description':_0x143017,'global':!![],'active':!![],'name':_0x143017},'auth':_0x31d688,'json':!![]};return rp(_0x2f5db6)[_0x1bb9('0xe')](function(_0x474912){var _0x2f45e4=_0x474912[_0x1bb9('0xf')][_0x1bb9('0x1e')];_0x5497a0(_0x2f45e4);});});}function getRemoteTag(_0x940348,_0x30219d,_0x28552d,_0x48b0f9,_0x208498){return new Promise(function(_0x47cf53,_0x81e74){var _0x537ecf={'method':'GET','uri':_0x28552d+_0x1bb9('0x43')+_0x1bb9('0x44')+_0x940348+'&'+_0x48b0f9,'auth':_0x30219d,'json':!![]};return rp(_0x537ecf)['then'](function(_0x24594e){if(_0x24594e[_0x1bb9('0xf')]['length']>0x0){var _0x51e902=_0x24594e[_0x1bb9('0xf')][0x0][_0x1bb9('0x1e')];_0x47cf53(_0x51e902);}else{return createRemoteTag(_0x940348,_0x30219d,_0x28552d,_0x48b0f9)['then'](function(_0x4047fd){_0x47cf53(_0x4047fd);});}});});}function assignTagToIncident(_0x2141fa,_0x593a8a,_0xc2b75d,_0x5c50c2,_0x214285){return new Promise(function(_0x11cf48,_0xe7ec08){var _0x5b578f={'method':'POST','uri':_0xc2b75d+_0x1bb9('0x45')+'?'+_0x214285,'body':{'label':_0x2141fa,'table':_0x1bb9('0x3a'),'id_type':'Incident','table_key':_0x5c50c2[_0x1bb9('0x46')],'title':'Incident\x20-\x20'+_0x5c50c2[_0x1bb9('0x47')],'id_display':_0x5c50c2[_0x1bb9('0x47')]},'auth':_0x593a8a,'json':!![]};return rp(_0x5b578f)[_0x1bb9('0xe')](function(_0x3e1ca6){_0x11cf48();})['catch'](function(){_0x11cf48();});});}function manageTags(_0x4fa5bb,_0x3fa373,_0x132357,_0x477031,_0x42ed43,_0x4afca7,_0x277958){return new Promise(function(_0x40eef8,_0x32be85){var _0x2e9036=[];_0x3fa373[_0x1bb9('0x2a')](function(_0x43f591){_0x2e9036[_0x1bb9('0x48')](getRemoteTag(_0x43f591,_0x132357,_0x477031,_0x4afca7,_0x277958));});return Promise[_0x1bb9('0x49')](_0x2e9036)[_0x1bb9('0xe')](function(_0x17c937){if(_0x17c937[_0x1bb9('0x1a')]){logger[_0x1bb9('0x18')]('['+[_0x4fa5bb['toUpperCase']()]+_0x1bb9('0x4a'),_0x17c937);var _0x35df2=[];_0x17c937[_0x1bb9('0x2a')](function(_0x1e7b40){_0x35df2[_0x1bb9('0x48')](assignTagToIncident(_0x1e7b40,_0x132357,_0x477031,_0x42ed43,_0x4afca7));});return Promise['all'](_0x35df2)[_0x1bb9('0xe')](function(){_0x40eef8();})[_0x1bb9('0x11')](function(){_0x40eef8();});}else{_0x40eef8();}});});}function getTags(_0x2946b8,_0x38db69,_0xa778b6,_0x5d6c74,_0x1f571a,_0x37d91e){return function(_0x31e030){return new Promise(function(_0x49229b,_0x2bfde5){var _0x343a80=[];var _0x5367e8=_0x5d6c74[_0x1bb9('0x4b')];if(_0x5367e8&&_0x5367e8['length']>0x0){_0x343a80=_[_0x1bb9('0x4c')](_0x5367e8,_0x1bb9('0x37'));}if(_0x343a80['length']>0x0){return manageTags(_0x2946b8,_0x343a80,_0x38db69,_0xa778b6,_0x31e030,_0x1f571a,_0x37d91e)[_0x1bb9('0xe')](function(){_0x49229b(_0x31e030);});}else{_0x49229b(_0x31e030);}});};}function emit(_0x5e3590,_0x3e074b,_0x2d91e2){var _0x130050=_0x1bb9('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x1bb9('0x4e')+'%255EORDERBYDESCnumber';var _0x6a0b58={'uri':_0x5e3590+_0x1bb9('0x4f')+_0x2d91e2+_0x130050};io['to'](util['format'](_0x1bb9('0x50'),_0x3e074b))[_0x1bb9('0x51')]('trigger:browser:url',_0x6a0b58);}exports['cs']=function(_0x5c3afd,_0x59b8e9,_0x205471,_0x473af1,_0x159538,_0x4f8f12,_0x4c24f6,_0x183e44){var _0x6a8019={};var _0x3dcb5d={'user':_0x4f8f12['username'],'pass':_0x4f8f12[_0x1bb9('0x52')]};var _0x307086=_0x1bb9('0x53');var _0x1cdfd5='sysparm_display_value=true';_0x4f8f12[_0x1bb9('0x54')]=intUtil[_0x1bb9('0x55')](_0x4f8f12[_0x1bb9('0x54')]);_0x4f8f12[_0x1bb9('0x56')]=intUtil[_0x1bb9('0x55')](_0x4f8f12[_0x1bb9('0x56')]);var _0x25a2e1=util[_0x1bb9('0x57')](_0x1bb9('0x58'),_0x4f8f12['remoteUri']);_0x6a8019['userEmail']=!_[_0x1bb9('0x59')](_0x473af1)?_0x473af1[_0x1bb9('0x5a')]:null;_0x6a8019[_0x1bb9('0x20')]=_0x4f8f12[_0x1bb9('0x5a')];_0x6a8019[_0x1bb9('0x25')]=_0x183e44[_0x1bb9('0x30')]()===_0x1bb9('0x39')?_0x59b8e9[_0x1bb9('0x5b')]:_0x59b8e9[_0x1bb9('0x5c')];_0x6a8019[_0x1bb9('0x5d')]=_0x183e44===_0x1bb9('0x5e')||_0x183e44===_0x1bb9('0x5f')?_0x1bb9('0x5e'):_0x1bb9('0x39');var _0xfb13bf=util['format'](_0x1bb9('0x60'),_0x4f8f12['serverUrl'],_0x59b8e9[_0x1bb9('0x61')],md5(_0x59b8e9[_0x1bb9('0x61')]));if(_0x159538&&_0x159538['monitor_format']){logger[_0x1bb9('0x18')]('[QUEUE]',_0x1bb9('0x62'));_0x59b8e9[_0x1bb9('0x63')]=_0xfb13bf;}else if(_0x4c24f6&&_0x4c24f6['recordingFormat']&&_0x4c24f6[_0x1bb9('0x64')]!==_0x1bb9('0x65')){logger['info'](_0x1bb9('0x66'),_0x1bb9('0x62'));_0x59b8e9[_0x1bb9('0x63')]=_0xfb13bf;}else{_0x59b8e9[_0x1bb9('0x63')]='';}return getAdminUser(_0x183e44,_0x3dcb5d,_0x6a8019,_0x25a2e1,_0x1cdfd5,_0x307086)[_0x1bb9('0xe')](getUser(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x1cdfd5,_0x307086))[_0x1bb9('0xe')](getEndUser(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x1cdfd5,_0x307086))['then'](getTicket(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x205471,_0x59b8e9,_0x1cdfd5))[_0x1bb9('0xe')](function(_0x11d050){logger[_0x1bb9('0x18')](util[_0x1bb9('0x57')](_0x1bb9('0x67'),_0x11d050['ticketId']));logger[_0x1bb9('0x18')](util[_0x1bb9('0x57')](_0x1bb9('0x68'),_0x183e44));if(_0x183e44!==_0x1bb9('0x5f')){logger[_0x1bb9('0x18')]('['+[_0x183e44[_0x1bb9('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4f8f12[_0x1bb9('0x54')],_0x473af1[_0x1bb9('0x37')],_0x11d050[_0x1bb9('0x46')]);}})[_0x1bb9('0x11')](function(_0x25d8ec){logger[_0x1bb9('0x12')]('['+[_0x183e44[_0x1bb9('0x13')]()]+_0x1bb9('0x69'),util['inspect'](_0x25d8ec,{'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 46d7cd9..6b1c112 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 _0x4a48=['phone_home','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField','content','variable','custom_fields','customVariable','Variable','toLowerCase','PLAIN','sessionID','Calls','queue','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:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','Inbound','toUpperCase','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','info','name','getString','Subjects','assigned_user_id','description','date_start','slice','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','variableName','push','idField','stringify','Basic\x20%s','apiKey','toString','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22'];(function(_0x1366f2,_0x3d55d7){var _0x4378e2=function(_0x4fc4d1){while(--_0x4fc4d1){_0x1366f2['push'](_0x1366f2['shift']());}};_0x4378e2(++_0x3d55d7);}(_0x4a48,0xb0));var _0x84a4=function(_0x1443c3,_0x493bac){_0x1443c3=_0x1443c3-0x0;var _0x5b261a=_0x4a48[_0x1443c3];return _0x5b261a;};'use strict';var _=require('lodash');var rp=require(_0x84a4('0x0'));var BPromise=require(_0x84a4('0x1'));var md5=require('md5');var util=require(_0x84a4('0x2'));var Redis=require(_0x84a4('0x3'));var intUtil=require(_0x84a4('0x4'));var config=require(_0x84a4('0x5'));var logger=require(_0x84a4('0x6'))('sugarcrm');config[_0x84a4('0x7')]=_['defaults'](config[_0x84a4('0x7')],{'host':_0x84a4('0x8'),'port':0x18eb});var io=require(_0x84a4('0x9'))(new Redis(config['redis']));var def={'method':_0x84a4('0xa'),'json':!![]};function emit(_0x35a1d4,_0x5a753b,_0xa29b75){io['to'](_0x35a1d4)['emit'](_0x5a753b,_0xa29b75);}function getTicket(_0x5b7f8f,_0x436526,_0x5a4bfa,_0x8c3b30,_0x5eb1d1,_0x2b4046,_0x4bba48,_0x42f18f){logger[_0x84a4('0xb')]('Creating\x20new\x20ticket...');var _0x1de858=new Date();var _0x411545=[{'name':_0x84a4('0xc'),'value':intUtil[_0x84a4('0xd')](_0x8c3b30[_0x84a4('0xe')],_0x5eb1d1,'\x20')},{'name':_0x84a4('0xf'),'value':_0x436526['id']},{'name':'created_by','value':_0x436526['id']},{'name':_0x84a4('0x10'),'value':intUtil[_0x84a4('0xd')](_0x8c3b30['Descriptions'],_0x5eb1d1,'\x0a')},{'name':_0x84a4('0x11'),'value':_0x1de858['toISOString']()[_0x84a4('0x12')](0x0,0x13)['replace']('T','\x20')},{'name':_0x84a4('0x13'),'value':'0'},{'name':_0x84a4('0x14'),'value':'15'},{'name':_0x84a4('0x15'),'value':_0x5a4bfa['id']},{'name':'parent_type','value':_0x84a4('0x16')},{'name':_0x84a4('0x17'),'value':_0x5a4bfa[_0x84a4('0xc')]},{'name':_0x84a4('0x18'),'value':_0x42f18f}];if(_0x2b4046[_0x84a4('0x19')]){_[_0x84a4('0x1a')](_0x2b4046,function(_0x52b255){if(_0x5eb1d1[_0x52b255[_0x84a4('0x1b')]]){_0x411545[_0x84a4('0x1c')]({'name':_0x52b255[_0x84a4('0x1d')],'value':_0x5eb1d1[_0x52b255[_0x84a4('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x84a4('0x1e')]({'session':_0x4bba48['id'],'module_name':'Calls','name_value_list':_0x411545})}});}function getAuth(_0x55f387){return util['format'](_0x84a4('0x1f'),new Buffer(_0x55f387[_0x84a4('0x20')]+':X')[_0x84a4('0x21')]('base64'));}function getServerInfo(_0x5dbdf7){return request({'form':{'method':'get_server_info','input_type':_0x84a4('0x22'),'response_type':_0x84a4('0x22'),'rest_data':JSON[_0x84a4('0x1e')]({'session':_0x5dbdf7['id']})}});}function getUser(_0x5640ab,_0x2ca5d5,_0x44adad){if(!_[_0x84a4('0x23')](_0x2ca5d5)){logger[_0x84a4('0xb')](_0x84a4('0x24'),_0x2ca5d5);return request({'form':{'method':_0x84a4('0x25'),'input_type':_0x84a4('0x22'),'response_type':_0x84a4('0x22'),'rest_data':JSON[_0x84a4('0x1e')]({'session':_0x44adad['id'],'module_name':_0x84a4('0x26'),'query':util[_0x84a4('0x27')](_0x84a4('0x28'),_0x2ca5d5),'order_by':'','offset':'0','select_fields':['id',_0x84a4('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x84a4('0x29')](function(_0x44f81f){if(_0x44f81f[_0x84a4('0x2a')][_0x84a4('0x19')]){var _0x16a818=_[_0x84a4('0x2b')](_0x44f81f[_0x84a4('0x2a')],function(_0x4c0a4e){return _0x4c0a4e['name_value_list'][_0x84a4('0x2c')][_0x84a4('0x2d')]===_0x2ca5d5;});if(_0x16a818){logger['info'](_0x84a4('0x2e'));return BPromise[_0x84a4('0x2f')]({'id':_0x16a818[_0x84a4('0x30')]['id']['value'],'name':_0x16a818['name_value_list']['name'][_0x84a4('0x2d')]});}}logger[_0x84a4('0xb')](_0x84a4('0x31'));return BPromise[_0x84a4('0x2f')]({'id':_0x44adad[_0x84a4('0x30')][_0x84a4('0x32')][_0x84a4('0x2d')],'name':_0x44adad[_0x84a4('0x30')][_0x84a4('0x2c')]['value']});});}else{logger[_0x84a4('0xb')](_0x84a4('0x33'));return BPromise[_0x84a4('0x2f')]({'id':_0x44adad[_0x84a4('0x30')]['user_id'][_0x84a4('0x2d')],'name':_0x44adad['name_value_list'][_0x84a4('0x2c')]['value']});}}function getEndUser(_0x4305dd,_0x14c037,_0x3b468a,_0x46419a){logger[_0x84a4('0xb')](_0x84a4('0x34'),_0x3b468a);return request({'form':{'method':_0x84a4('0x25'),'input_type':_0x84a4('0x22'),'response_type':_0x84a4('0x22'),'rest_data':JSON[_0x84a4('0x1e')]({'session':_0x46419a['id'],'module_name':_0x84a4('0x16'),'query':util[_0x84a4('0x27')](_0x84a4('0x35'),_0x3b468a),'order_by':'','offset':'0','select_fields':['id',_0x84a4('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x308084){if(_0x308084[_0x84a4('0x2a')][_0x84a4('0x19')]){var _0xed5de6=_['find'](_0x308084[_0x84a4('0x2a')],function(_0x2cc144){return _0x2cc144[_0x84a4('0x30')][_0x84a4('0x36')][_0x84a4('0x2d')]===_0x3b468a;});if(_0xed5de6){logger[_0x84a4('0xb')]('Enduser\x20found!');return BPromise[_0x84a4('0x2f')]({'id':_0xed5de6['name_value_list']['id'][_0x84a4('0x2d')],'name':_0xed5de6[_0x84a4('0x30')][_0x84a4('0xc')][_0x84a4('0x2d')],'phone':_0xed5de6[_0x84a4('0x30')]['phone_home'][_0x84a4('0x2d')]});}}else{logger[_0x84a4('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x84a4('0x37'),'input_type':_0x84a4('0x22'),'response_type':'JSON','rest_data':JSON[_0x84a4('0x1e')]({'session':_0x46419a['id'],'module_name':_0x84a4('0x16'),'name_value_list':[{'name':_0x84a4('0x38'),'value':_0x14c037!==_0x84a4('0x39')?_0x14c037:util[_0x84a4('0x27')](_0x84a4('0x3a'),_0x3b468a)},{'name':'phone_home','value':_0x3b468a}]})}})['then'](function(_0x34cdf1){logger[_0x84a4('0xb')](_0x84a4('0x3b'));return BPromise[_0x84a4('0x2f')]({'id':_0x34cdf1['id'],'name':_0x34cdf1[_0x84a4('0x2a')][_0x84a4('0x38')][_0x84a4('0x2d')],'phone':_0x34cdf1[_0x84a4('0x2a')][_0x84a4('0x36')][_0x84a4('0x2d')]});});}});}function request(_0x56f8c2){logger[_0x84a4('0x3c')](_0x84a4('0x3d'),JSON[_0x84a4('0x1e')](_0x56f8c2));return rp(_[_0x84a4('0x3e')](def,_0x56f8c2));}function getTags(_0x3aa51c,_0x499885){var _0x1bb6be=[];if(_0x3aa51c&&_0x3aa51c[_0x84a4('0x19')]>0x0){_0x1bb6be=_['map'](_0x3aa51c,_0x499885);}return _0x1bb6be;}function getCustomFields(_0xdb0b51,_0x13ab26){var _0x52b0e6=[];var _0x2c56e2={'custom_fields':[]};if(_0xdb0b51[_0x84a4('0x19')]>0x0){_['forEach'](_0xdb0b51,function(_0x208143){if(_0x208143[_0x84a4('0x3f')]===_0x84a4('0x40')&&_0x208143[_0x84a4('0x41')]&&!_0x208143[_0x84a4('0x42')]){_0x2c56e2[_0x208143['nameField']['toLowerCase']()]=_0x208143[_0x84a4('0x43')][_0x84a4('0x21')]();}else if(_0x208143['type']===_0x84a4('0x40')&&_0x208143['idField']&&_0x208143[_0x84a4('0x42')]){_0x2c56e2['custom_fields'][_0x84a4('0x1c')]({'id':_0x208143['idField'],'value':_0x208143[_0x84a4('0x43')]['toString']()});}else if(_0x208143[_0x84a4('0x3f')]===_0x84a4('0x44')&&_0x208143[_0x84a4('0x1b')]&&_0x208143[_0x84a4('0x1d')]&&_0x208143[_0x84a4('0x42')]){_0x13ab26[_0x208143[_0x84a4('0x1b')]]&&_0x2c56e2[_0x84a4('0x45')][_0x84a4('0x1c')]({'id':_0x208143[_0x84a4('0x1d')],'value':_0x13ab26[_0x208143['variableName']][_0x84a4('0x21')]()});}else if(_0x208143[_0x84a4('0x3f')]===_0x84a4('0x46')&&_0x208143['Variable']&&_0x208143['Variable'][_0x84a4('0xc')]&&_0x208143[_0x84a4('0x1d')]&&_0x208143[_0x84a4('0x42')]){_0x13ab26[_0x208143[_0x84a4('0x47')][_0x84a4('0xc')][_0x84a4('0x48')]()]&&_0x2c56e2[_0x84a4('0x45')][_0x84a4('0x1c')]({'id':_0x208143[_0x84a4('0x1d')],'value':_0x13ab26[_0x208143[_0x84a4('0x47')]['name'][_0x84a4('0x48')]()][_0x84a4('0x21')]()});}});}return _0x2c56e2;}function getConnection(_0x3e9691){return request({'method':_0x84a4('0xa'),'form':{'method':'login','input_type':_0x84a4('0x22'),'response_type':_0x84a4('0x22'),'rest_data':JSON[_0x84a4('0x1e')]({'user_auth':{'user_name':_0x3e9691['username'],'password':_0x3e9691['password'],'encryption':_0x84a4('0x49')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x3c4020){var _0x2f87a2=_0x3c4020;if(_0x2f87a2['id']){def[_0x84a4('0x4a')]=_0x2f87a2['id'];return BPromise[_0x84a4('0x2f')](_0x2f87a2);}else{throw new Error(util[_0x84a4('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x3e9691['id']));}});}function setRelationship(_0x1c7f62,_0x31ae6d,_0x1174ae,_0x1da72c){return request({'form':{'method':'set_relationship','input_type':_0x84a4('0x22'),'response_type':_0x84a4('0x22'),'rest_data':JSON[_0x84a4('0x1e')]({'session':_0x1c7f62['id'],'module_name':_0x84a4('0x4b'),'module_id':_0x1174ae['id'],'link_field_name':_0x1da72c,'related_ids':[_0x31ae6d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x84a4('0x4c')]=function(_0x59dfd6,_0x3b717a,_0x2bec68,_0x5bb216,_0xe4e483,_0xf3f1bd){var _0x3e46a6,_0x52f9db,_0x251fb3,_0x15f156;_0xf3f1bd[_0x84a4('0x4d')]=intUtil[_0x84a4('0x4e')](_0xf3f1bd[_0x84a4('0x4d')]);_0xf3f1bd['serverUrl']=intUtil[_0x84a4('0x4e')](_0xf3f1bd[_0x84a4('0x4f')]);def[_0x84a4('0x50')]=util['format']('%s/service/v4_1/rest.php',_0xf3f1bd['remoteUri']);if(_0xe4e483&&_0xe4e483[_0x84a4('0x51')]){logger['info'](_0x84a4('0x52'),_0x84a4('0x53'));_0x3b717a[_0x84a4('0x54')]=util[_0x84a4('0x27')](_0x84a4('0x55'),_0xf3f1bd[_0x84a4('0x4f')],_0x3b717a['uniqueid'],md5(_0x3b717a[_0x84a4('0x56')]));}else{_0x3b717a[_0x84a4('0x54')]='';}return getConnection(_0xf3f1bd)['then'](function(_0x24a789){_0x15f156=_0x24a789;return getUser(_0xf3f1bd,_0x5bb216[_0x84a4('0xc')],_0x15f156);})[_0x84a4('0x29')](function(_0x588889){_0x3e46a6=_0x588889;logger['info'](_0x84a4('0x57'),_0x3e46a6['id']);return getEndUser(_0xf3f1bd,_0x3b717a[_0x84a4('0x58')],_0x3b717a[_0x84a4('0x59')],_0x15f156);})[_0x84a4('0x29')](function(_0xb2a12d){_0x52f9db=_0xb2a12d;logger[_0x84a4('0xb')](_0x84a4('0x5a'),_0x52f9db['id']);return getTicket(_0xf3f1bd,_0x3e46a6,_0x52f9db,_0x2bec68,_0x3b717a,_0x2bec68[_0x84a4('0x5b')],_0x15f156,'Inbound');})['then'](function(_0x267405){_0x251fb3=_0x267405;logger[_0x84a4('0xb')](_0x84a4('0x5c'));logger[_0x84a4('0xb')](_0x84a4('0x5d'),_0x251fb3['id']);return setRelationship(_0x15f156,_0x3e46a6,_0x251fb3,_0x84a4('0x5e'));})[_0x84a4('0x29')](function(){return setRelationship(_0x15f156,_0x52f9db,_0x251fb3,_0x84a4('0x5f'));})[_0x84a4('0x29')](function(){return getServerInfo(_0x15f156);})[_0x84a4('0x29')](function(_0x16ec97){var _0x300705=parseInt(_0x16ec97[_0x84a4('0x60')]['charAt'](0x0));var _0x13ae5a=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xf3f1bd['remoteUri'],_0x251fb3['id']);if(_0x300705>0x6){_0x13ae5a=util[_0x84a4('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xf3f1bd['remoteUri'],_0x251fb3['id']);}logger['info']('[QUEUE]',_0x84a4('0x61'));emit(util[_0x84a4('0x27')](_0x84a4('0x62'),_0x5bb216['name']),_0x84a4('0x63'),{'uri':_0x13ae5a});})[_0x84a4('0x64')](function(_0xf5adab){logger[_0x84a4('0x65')](_0x84a4('0x52'),JSON[_0x84a4('0x1e')](_0xf5adab));});};exports[_0x84a4('0x66')]=function(_0x1c309b,_0x1f81d4,_0x4a4161,_0x8c1ad4,_0x144a0f,_0x30f46f,_0x5462ff){var _0x2a3ccd,_0xe3ba25,_0x60f410,_0x42014d;_0x30f46f[_0x84a4('0x4d')]=intUtil['stripTrailingSlash'](_0x30f46f[_0x84a4('0x4d')]);_0x30f46f[_0x84a4('0x4f')]=intUtil[_0x84a4('0x4e')](_0x30f46f['serverUrl']);def[_0x84a4('0x50')]=util[_0x84a4('0x27')](_0x84a4('0x67'),_0x30f46f[_0x84a4('0x4d')]);if(_0x5462ff&&_0x5462ff[_0x84a4('0x68')]&&_0x5462ff[_0x84a4('0x68')]!==_0x84a4('0x69')){logger[_0x84a4('0xb')](_0x84a4('0x6a'),_0x84a4('0x53'));_0x1f81d4['recordingURL']=util[_0x84a4('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x30f46f[_0x84a4('0x4f')],_0x1f81d4[_0x84a4('0x56')],md5(_0x1f81d4[_0x84a4('0x56')]));}return getConnection(_0x30f46f)['then'](function(_0xa2de55){_0x42014d=_0xa2de55;return getUser(_0x30f46f,_0x8c1ad4[_0x84a4('0xc')],_0x42014d);})[_0x84a4('0x29')](function(_0x23ef96){_0x2a3ccd=_0x23ef96;logger['info'](_0x84a4('0x57'),_0x2a3ccd['id']);return getEndUser(_0x30f46f,_0x1f81d4[_0x84a4('0x6b')],_0x1f81d4[_0x84a4('0x6c')],_0x42014d);})['then'](function(_0x12808e){_0xe3ba25=_0x12808e;logger[_0x84a4('0xb')](_0x84a4('0x5a'),_0xe3ba25['id']);return getTicket(_0x30f46f,_0x2a3ccd,_0xe3ba25,_0x4a4161,_0x1f81d4,_0x4a4161[_0x84a4('0x5b')],_0x42014d,_0x84a4('0x6d'));})[_0x84a4('0x29')](function(_0x57c225){_0x60f410=_0x57c225;logger[_0x84a4('0xb')]('Ticket\x20created!');logger[_0x84a4('0xb')](_0x84a4('0x5d'),_0x60f410['id']);return setRelationship(_0x42014d,_0x2a3ccd,_0x60f410,_0x84a4('0x5e'));})[_0x84a4('0x29')](function(){return setRelationship(_0x42014d,_0xe3ba25,_0x60f410,_0x84a4('0x5f'));})['then'](function(){return getServerInfo(_0x42014d);})[_0x84a4('0x29')](function(_0x1dcc0d){var _0x315e46=parseInt(_0x1dcc0d[_0x84a4('0x60')]['charAt'](0x0));var _0xb812c3=util[_0x84a4('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x30f46f[_0x84a4('0x4d')],_0x60f410['id']);if(_0x315e46>0x6){_0xb812c3=util[_0x84a4('0x27')](_0x84a4('0x6e'),_0x30f46f[_0x84a4('0x4d')],_0x60f410['id']);}logger[_0x84a4('0xb')](_0x84a4('0x6a'),_0x84a4('0x61'));emit(util[_0x84a4('0x27')](_0x84a4('0x62'),_0x8c1ad4[_0x84a4('0xc')]),'trigger:browser:url',{'uri':_0xb812c3});})['catch'](function(_0x407268){logger['error'](_0x84a4('0x6a'),JSON['stringify'](_0x407268));});};exports[_0x84a4('0x6f')]=function(_0x35a9e1,_0x630534,_0x63fdc8,_0x114c18,_0xf2ce6e,_0xfb40f9){var _0x5b2afe,_0x2b36f7,_0x34b90e,_0x4b88c2;_0xfb40f9['remoteUri']=intUtil[_0x84a4('0x4e')](_0xfb40f9['remoteUri']);_0xfb40f9[_0x84a4('0x4f')]=intUtil[_0x84a4('0x4e')](_0xfb40f9['serverUrl']);def['uri']=util['format'](_0x84a4('0x67'),_0xfb40f9[_0x84a4('0x4d')]);if(_0xf2ce6e&&_0xf2ce6e['monitor_format']){logger[_0x84a4('0xb')]('['+_0x630534[_0x84a4('0x70')]['toUpperCase']()+']',_0x84a4('0x53'));_0x630534[_0x84a4('0x54')]=util['format'](_0x84a4('0x55'),_0xfb40f9[_0x84a4('0x4f')],_0x630534[_0x84a4('0x56')],md5(_0x630534['uniqueid']));}else{_0x630534['recordingURL']='';}return getConnection(_0xfb40f9)[_0x84a4('0x29')](function(_0x18be9c){_0x4b88c2=_0x18be9c;if(!_[_0x84a4('0x23')](_0x114c18)){return getUser(_0xfb40f9,_0x114c18[_0x84a4('0xc')],_0x4b88c2);}else{return getUser(_0xfb40f9,null,_0x4b88c2);}})[_0x84a4('0x29')](function(_0x56577e){_0x5b2afe=_0x56577e;logger[_0x84a4('0xb')](_0x84a4('0x57'),_0x5b2afe['id']);return getEndUser(_0xfb40f9,_0x630534[_0x84a4('0x58')],_0x630534['calleridnum'],_0x4b88c2);})['then'](function(_0x468dd0){_0x2b36f7=_0x468dd0;logger[_0x84a4('0xb')](_0x84a4('0x5a'),_0x2b36f7['id']);return getTicket(_0xfb40f9,_0x5b2afe,_0x2b36f7,_0x63fdc8,_0x630534,_0x63fdc8['Fields'],_0x4b88c2,_0x84a4('0x71'));})[_0x84a4('0x29')](function(_0x88df98){_0x34b90e=_0x88df98;logger[_0x84a4('0xb')](_0x84a4('0x5c'));logger[_0x84a4('0xb')](_0x84a4('0x5d'),_0x34b90e['id']);return setRelationship(_0x4b88c2,_0x5b2afe,_0x34b90e,_0x84a4('0x5e'));})['then'](function(){return setRelationship(_0x4b88c2,_0x2b36f7,_0x34b90e,'contacts');})['then'](function(){return getServerInfo(_0x4b88c2);})[_0x84a4('0x64')](function(_0x20e8d4){logger[_0x84a4('0x65')]('['+_0x630534[_0x84a4('0x70')][_0x84a4('0x72')]()+']',JSON[_0x84a4('0x1e')](_0x20e8d4));});}; \ No newline at end of file +var _0xb5d7=['util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','push','idField','variableName','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','value','user_id','phone_home','Enduser\x20found!','set_entry','','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','map','forEach','string','nameField','toLowerCase','content','type','customField','custom_fields','customVariable','Variable','POST','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','uri','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','Outbound','Ticket\x20created!','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','The\x20User\x20ID\x20is:','toUpperCase','bluebird','md5'];(function(_0x263fcc,_0x38c118){var _0x25a0a1=function(_0x5af6b2){while(--_0x5af6b2){_0x263fcc['push'](_0x263fcc['shift']());}};_0x25a0a1(++_0x38c118);}(_0xb5d7,0x79));var _0x7b5d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb5d7[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x7b5d('0x0'));var md5=require(_0x7b5d('0x1'));var util=require(_0x7b5d('0x2'));var Redis=require(_0x7b5d('0x3'));var intUtil=require(_0x7b5d('0x4'));var config=require('../../../../config/environment');var logger=require(_0x7b5d('0x5'))(_0x7b5d('0x6'));config[_0x7b5d('0x7')]=_[_0x7b5d('0x8')](config['redis'],{'host':_0x7b5d('0x9'),'port':0x18eb});var io=require(_0x7b5d('0xa'))(new Redis(config[_0x7b5d('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x4ccde2,_0x180092,_0x50e1e5){io['to'](_0x4ccde2)[_0x7b5d('0xb')](_0x180092,_0x50e1e5);}function getTicket(_0x3c7fc6,_0x430fb3,_0x16a360,_0x2c0b91,_0x1939a1,_0x487197,_0x5d076e,_0x296b0e){logger[_0x7b5d('0xc')]('Creating\x20new\x20ticket...');var _0x168729=new Date();var _0x567dc8=[{'name':_0x7b5d('0xd'),'value':intUtil[_0x7b5d('0xe')](_0x2c0b91[_0x7b5d('0xf')],_0x1939a1,'\x20')},{'name':_0x7b5d('0x10'),'value':_0x430fb3['id']},{'name':_0x7b5d('0x11'),'value':_0x430fb3['id']},{'name':'description','value':intUtil[_0x7b5d('0xe')](_0x2c0b91[_0x7b5d('0x12')],_0x1939a1,'\x0a')},{'name':_0x7b5d('0x13'),'value':_0x168729[_0x7b5d('0x14')]()[_0x7b5d('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x7b5d('0x16'),'value':'0'},{'name':_0x7b5d('0x17'),'value':'15'},{'name':_0x7b5d('0x18'),'value':_0x16a360['id']},{'name':_0x7b5d('0x19'),'value':_0x7b5d('0x1a')},{'name':_0x7b5d('0x1b'),'value':_0x16a360[_0x7b5d('0xd')]},{'name':_0x7b5d('0x1c'),'value':_0x296b0e}];if(_0x487197[_0x7b5d('0x1d')]){_['forEach'](_0x487197,function(_0x270dd0){if(_0x1939a1[_0x270dd0['variableName']]){_0x567dc8[_0x7b5d('0x1e')]({'name':_0x270dd0[_0x7b5d('0x1f')],'value':_0x1939a1[_0x270dd0[_0x7b5d('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0x5d076e['id'],'module_name':_0x7b5d('0x23'),'name_value_list':_0x567dc8})}});}function getAuth(_0x44d51b){return util['format'](_0x7b5d('0x24'),new Buffer(_0x44d51b[_0x7b5d('0x25')]+':X')[_0x7b5d('0x26')](_0x7b5d('0x27')));}function getServerInfo(_0x1208de){return request({'form':{'method':_0x7b5d('0x28'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON['stringify']({'session':_0x1208de['id']})}});}function getUser(_0x13bce2,_0x173212,_0xc2ec9f){if(!_[_0x7b5d('0x29')](_0x173212)){logger[_0x7b5d('0xc')](_0x7b5d('0x2a'),_0x173212);return request({'form':{'method':_0x7b5d('0x2b'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0xc2ec9f['id'],'module_name':_0x7b5d('0x2c'),'query':util[_0x7b5d('0x2d')](_0x7b5d('0x2e'),_0x173212),'order_by':'','offset':'0','select_fields':['id','name',_0x7b5d('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7b5d('0x30')](function(_0x187e1f){if(_0x187e1f[_0x7b5d('0x31')][_0x7b5d('0x1d')]){var _0x4de2fc=_[_0x7b5d('0x32')](_0x187e1f[_0x7b5d('0x31')],function(_0x4295b9){return _0x4295b9[_0x7b5d('0x33')][_0x7b5d('0x2f')]['value']===_0x173212;});if(_0x4de2fc){logger['info'](_0x7b5d('0x34'));return BPromise[_0x7b5d('0x35')]({'id':_0x4de2fc[_0x7b5d('0x33')]['id']['value'],'name':_0x4de2fc[_0x7b5d('0x33')]['name']['value']});}}logger[_0x7b5d('0xc')](_0x7b5d('0x36'));return BPromise[_0x7b5d('0x35')]({'id':_0xc2ec9f[_0x7b5d('0x33')]['user_id'][_0x7b5d('0x37')],'name':_0xc2ec9f[_0x7b5d('0x33')]['user_name'][_0x7b5d('0x37')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0xc2ec9f[_0x7b5d('0x33')][_0x7b5d('0x38')][_0x7b5d('0x37')],'name':_0xc2ec9f[_0x7b5d('0x33')][_0x7b5d('0x2f')]['value']});}}function getEndUser(_0x3f3e5b,_0x262a41,_0x4b34f4,_0xf00bd6){logger[_0x7b5d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x4b34f4);return request({'form':{'method':_0x7b5d('0x2b'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0xf00bd6['id'],'module_name':_0x7b5d('0x1a'),'query':util[_0x7b5d('0x2d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4b34f4),'order_by':'','offset':'0','select_fields':['id',_0x7b5d('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4dd18b){if(_0x4dd18b[_0x7b5d('0x31')][_0x7b5d('0x1d')]){var _0x1e1ce2=_[_0x7b5d('0x32')](_0x4dd18b[_0x7b5d('0x31')],function(_0x53dede){return _0x53dede[_0x7b5d('0x33')][_0x7b5d('0x39')][_0x7b5d('0x37')]===_0x4b34f4;});if(_0x1e1ce2){logger[_0x7b5d('0xc')](_0x7b5d('0x3a'));return BPromise[_0x7b5d('0x35')]({'id':_0x1e1ce2['name_value_list']['id'][_0x7b5d('0x37')],'name':_0x1e1ce2['name_value_list']['name'][_0x7b5d('0x37')],'phone':_0x1e1ce2['name_value_list'][_0x7b5d('0x39')]['value']});}}else{logger[_0x7b5d('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x7b5d('0x3b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0xf00bd6['id'],'module_name':_0x7b5d('0x1a'),'name_value_list':[{'name':'first_name','value':_0x262a41!==_0x7b5d('0x3c')?_0x262a41:util['format'](_0x7b5d('0x3d'),_0x4b34f4)},{'name':_0x7b5d('0x39'),'value':_0x4b34f4}]})}})[_0x7b5d('0x30')](function(_0x12d970){logger[_0x7b5d('0xc')]('Enduser\x20created.');return BPromise[_0x7b5d('0x35')]({'id':_0x12d970['id'],'name':_0x12d970['entry_list'][_0x7b5d('0x3e')][_0x7b5d('0x37')],'phone':_0x12d970[_0x7b5d('0x31')][_0x7b5d('0x39')]['value']});});}});}function request(_0xda0024){logger[_0x7b5d('0x3f')](_0x7b5d('0x40'),JSON['stringify'](_0xda0024));return rp(_[_0x7b5d('0x41')](def,_0xda0024));}function getTags(_0x4522b4,_0xc9b331){var _0x31b97e=[];if(_0x4522b4&&_0x4522b4[_0x7b5d('0x1d')]>0x0){_0x31b97e=_[_0x7b5d('0x42')](_0x4522b4,_0xc9b331);}return _0x31b97e;}function getCustomFields(_0x3be80d,_0x3e5f4b){var _0x46a89b=[];var _0x2d5faf={'custom_fields':[]};if(_0x3be80d[_0x7b5d('0x1d')]>0x0){_[_0x7b5d('0x43')](_0x3be80d,function(_0x1c0771){if(_0x1c0771['type']===_0x7b5d('0x44')&&_0x1c0771[_0x7b5d('0x45')]&&!_0x1c0771['customField']){_0x2d5faf[_0x1c0771[_0x7b5d('0x45')][_0x7b5d('0x46')]()]=_0x1c0771[_0x7b5d('0x47')][_0x7b5d('0x26')]();}else if(_0x1c0771[_0x7b5d('0x48')]===_0x7b5d('0x44')&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x2d5faf['custom_fields'][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x1c0771[_0x7b5d('0x47')][_0x7b5d('0x26')]()});}else if(_0x1c0771[_0x7b5d('0x48')]==='variable'&&_0x1c0771[_0x7b5d('0x20')]&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x3e5f4b[_0x1c0771['variableName']]&&_0x2d5faf[_0x7b5d('0x4a')][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x3e5f4b[_0x1c0771[_0x7b5d('0x20')]][_0x7b5d('0x26')]()});}else if(_0x1c0771[_0x7b5d('0x48')]===_0x7b5d('0x4b')&&_0x1c0771[_0x7b5d('0x4c')]&&_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')]&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x3e5f4b[_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')][_0x7b5d('0x46')]()]&&_0x2d5faf[_0x7b5d('0x4a')][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x3e5f4b[_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')]['toLowerCase']()][_0x7b5d('0x26')]()});}});}return _0x2d5faf;}function getConnection(_0x258fda){return request({'method':_0x7b5d('0x4d'),'form':{'method':_0x7b5d('0x4e'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'user_auth':{'user_name':_0x258fda['username'],'password':_0x258fda[_0x7b5d('0x4f')],'encryption':_0x7b5d('0x50')},'application':_0x7b5d('0x51')})}})['then'](function(_0x316234){var _0x513bf3=_0x316234;if(_0x513bf3['id']){def[_0x7b5d('0x52')]=_0x513bf3['id'];return BPromise[_0x7b5d('0x35')](_0x513bf3);}else{throw new Error(util[_0x7b5d('0x2d')](_0x7b5d('0x53'),_0x258fda['id']));}});}function setRelationship(_0x500b55,_0x468d0f,_0x1dba73,_0x3defd2){return request({'form':{'method':_0x7b5d('0x54'),'input_type':_0x7b5d('0x21'),'response_type':'JSON','rest_data':JSON[_0x7b5d('0x22')]({'session':_0x500b55['id'],'module_name':'Calls','module_id':_0x1dba73['id'],'link_field_name':_0x3defd2,'related_ids':[_0x468d0f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7b5d('0x55')]=function(_0x40e57b,_0x5f5979,_0x3c741a,_0x286ddd,_0x487132,_0x1bc456){var _0x54f598,_0x253057,_0x1a61d1,_0x135a38;_0x1bc456[_0x7b5d('0x56')]=intUtil['stripTrailingSlash'](_0x1bc456[_0x7b5d('0x56')]);_0x1bc456['serverUrl']=intUtil[_0x7b5d('0x57')](_0x1bc456['serverUrl']);def['uri']=util['format'](_0x7b5d('0x58'),_0x1bc456[_0x7b5d('0x56')]);if(_0x487132&&_0x487132[_0x7b5d('0x59')]){logger[_0x7b5d('0xc')](_0x7b5d('0x5a'),_0x7b5d('0x5b'));_0x5f5979[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x1bc456[_0x7b5d('0x5e')],_0x5f5979[_0x7b5d('0x5f')],md5(_0x5f5979[_0x7b5d('0x5f')]));}else{_0x5f5979['recordingURL']='';}return getConnection(_0x1bc456)['then'](function(_0x2c7843){_0x135a38=_0x2c7843;return getUser(_0x1bc456,_0x286ddd['name'],_0x135a38);})[_0x7b5d('0x30')](function(_0x56107d){_0x54f598=_0x56107d;logger[_0x7b5d('0xc')]('The\x20User\x20ID\x20is:',_0x54f598['id']);return getEndUser(_0x1bc456,_0x5f5979[_0x7b5d('0x60')],_0x5f5979[_0x7b5d('0x61')],_0x135a38);})[_0x7b5d('0x30')](function(_0x3424f8){_0x253057=_0x3424f8;logger['info'](_0x7b5d('0x62'),_0x253057['id']);return getTicket(_0x1bc456,_0x54f598,_0x253057,_0x3c741a,_0x5f5979,_0x3c741a['Fields'],_0x135a38,_0x7b5d('0x63'));})[_0x7b5d('0x30')](function(_0x450e0a){_0x1a61d1=_0x450e0a;logger[_0x7b5d('0xc')]('Ticket\x20created!');logger[_0x7b5d('0xc')](_0x7b5d('0x64'),_0x1a61d1['id']);return setRelationship(_0x135a38,_0x54f598,_0x1a61d1,_0x7b5d('0x65'));})['then'](function(){return setRelationship(_0x135a38,_0x253057,_0x1a61d1,_0x7b5d('0x66'));})[_0x7b5d('0x30')](function(){return getServerInfo(_0x135a38);})[_0x7b5d('0x30')](function(_0x4ec92b){var _0x55bd1f=parseInt(_0x4ec92b[_0x7b5d('0x67')][_0x7b5d('0x68')](0x0));var _0x24521b=util[_0x7b5d('0x2d')](_0x7b5d('0x69'),_0x1bc456[_0x7b5d('0x56')],_0x1a61d1['id']);if(_0x55bd1f>0x6){_0x24521b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1bc456[_0x7b5d('0x56')],_0x1a61d1['id']);}logger[_0x7b5d('0xc')](_0x7b5d('0x5a'),_0x7b5d('0x6a'));emit(util['format'](_0x7b5d('0x6b'),_0x286ddd[_0x7b5d('0xd')]),_0x7b5d('0x6c'),{'uri':_0x24521b});})[_0x7b5d('0x6d')](function(_0x3b885e){logger[_0x7b5d('0x6e')]('[QUEUE]',JSON[_0x7b5d('0x22')](_0x3b885e));});};exports['outbound']=function(_0x1ece8b,_0x3331e,_0xbf5c26,_0x55297e,_0x1bedac,_0x5cb197,_0xf5dccf){var _0x334e6c,_0x13cc2f,_0x3250df,_0x4a5840;_0x5cb197[_0x7b5d('0x56')]=intUtil[_0x7b5d('0x57')](_0x5cb197[_0x7b5d('0x56')]);_0x5cb197[_0x7b5d('0x5e')]=intUtil[_0x7b5d('0x57')](_0x5cb197[_0x7b5d('0x5e')]);def[_0x7b5d('0x6f')]=util['format']('%s/service/v4_1/rest.php',_0x5cb197[_0x7b5d('0x56')]);if(_0xf5dccf&&_0xf5dccf[_0x7b5d('0x70')]&&_0xf5dccf[_0x7b5d('0x70')]!=='none'){logger[_0x7b5d('0xc')](_0x7b5d('0x71'),_0x7b5d('0x5b'));_0x3331e[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x5cb197[_0x7b5d('0x5e')],_0x3331e['uniqueid'],md5(_0x3331e[_0x7b5d('0x5f')]));}return getConnection(_0x5cb197)[_0x7b5d('0x30')](function(_0x1ac78c){_0x4a5840=_0x1ac78c;return getUser(_0x5cb197,_0x55297e[_0x7b5d('0xd')],_0x4a5840);})['then'](function(_0xb8d71d){_0x334e6c=_0xb8d71d;logger[_0x7b5d('0xc')]('The\x20User\x20ID\x20is:',_0x334e6c['id']);return getEndUser(_0x5cb197,_0x3331e['destcalleridname'],_0x3331e[_0x7b5d('0x72')],_0x4a5840);})['then'](function(_0x3a2628){_0x13cc2f=_0x3a2628;logger['info'](_0x7b5d('0x62'),_0x13cc2f['id']);return getTicket(_0x5cb197,_0x334e6c,_0x13cc2f,_0xbf5c26,_0x3331e,_0xbf5c26[_0x7b5d('0x73')],_0x4a5840,_0x7b5d('0x74'));})[_0x7b5d('0x30')](function(_0x43834c){_0x3250df=_0x43834c;logger[_0x7b5d('0xc')](_0x7b5d('0x75'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3250df['id']);return setRelationship(_0x4a5840,_0x334e6c,_0x3250df,'users');})['then'](function(){return setRelationship(_0x4a5840,_0x13cc2f,_0x3250df,'contacts');})[_0x7b5d('0x30')](function(){return getServerInfo(_0x4a5840);})[_0x7b5d('0x30')](function(_0x5ccfa0){var _0x2d0fe7=parseInt(_0x5ccfa0[_0x7b5d('0x67')][_0x7b5d('0x68')](0x0));var _0x11c545=util[_0x7b5d('0x2d')](_0x7b5d('0x69'),_0x5cb197[_0x7b5d('0x56')],_0x3250df['id']);if(_0x2d0fe7>0x6){_0x11c545=util[_0x7b5d('0x2d')](_0x7b5d('0x76'),_0x5cb197['remoteUri'],_0x3250df['id']);}logger[_0x7b5d('0xc')](_0x7b5d('0x71'),_0x7b5d('0x6a'));emit(util[_0x7b5d('0x2d')](_0x7b5d('0x6b'),_0x55297e[_0x7b5d('0xd')]),_0x7b5d('0x6c'),{'uri':_0x11c545});})[_0x7b5d('0x6d')](function(_0x18425d){logger[_0x7b5d('0x6e')](_0x7b5d('0x71'),JSON[_0x7b5d('0x22')](_0x18425d));});};exports[_0x7b5d('0x77')]=function(_0x15afb6,_0x356afb,_0xe3f43,_0x47b4ac,_0x292aa9,_0x11c71f){var _0x466dd0,_0x38f627,_0xf06ed6,_0x5dd121;_0x11c71f['remoteUri']=intUtil[_0x7b5d('0x57')](_0x11c71f[_0x7b5d('0x56')]);_0x11c71f[_0x7b5d('0x5e')]=intUtil[_0x7b5d('0x57')](_0x11c71f[_0x7b5d('0x5e')]);def[_0x7b5d('0x6f')]=util[_0x7b5d('0x2d')](_0x7b5d('0x58'),_0x11c71f[_0x7b5d('0x56')]);if(_0x292aa9&&_0x292aa9['monitor_format']){logger[_0x7b5d('0xc')]('['+_0x356afb[_0x7b5d('0x78')]['toUpperCase']()+']',_0x7b5d('0x5b'));_0x356afb[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x11c71f[_0x7b5d('0x5e')],_0x356afb[_0x7b5d('0x5f')],md5(_0x356afb[_0x7b5d('0x5f')]));}else{_0x356afb[_0x7b5d('0x5c')]='';}return getConnection(_0x11c71f)[_0x7b5d('0x30')](function(_0x2046a){_0x5dd121=_0x2046a;if(!_['isNil'](_0x47b4ac)){return getUser(_0x11c71f,_0x47b4ac[_0x7b5d('0xd')],_0x5dd121);}else{return getUser(_0x11c71f,null,_0x5dd121);}})[_0x7b5d('0x30')](function(_0x31728f){_0x466dd0=_0x31728f;logger[_0x7b5d('0xc')](_0x7b5d('0x79'),_0x466dd0['id']);return getEndUser(_0x11c71f,_0x356afb[_0x7b5d('0x60')],_0x356afb[_0x7b5d('0x61')],_0x5dd121);})[_0x7b5d('0x30')](function(_0x540d7b){_0x38f627=_0x540d7b;logger[_0x7b5d('0xc')](_0x7b5d('0x62'),_0x38f627['id']);return getTicket(_0x11c71f,_0x466dd0,_0x38f627,_0xe3f43,_0x356afb,_0xe3f43[_0x7b5d('0x73')],_0x5dd121,'Inbound');})['then'](function(_0x34b7a3){_0xf06ed6=_0x34b7a3;logger[_0x7b5d('0xc')](_0x7b5d('0x75'));logger['info'](_0x7b5d('0x64'),_0xf06ed6['id']);return setRelationship(_0x5dd121,_0x466dd0,_0xf06ed6,_0x7b5d('0x65'));})[_0x7b5d('0x30')](function(){return setRelationship(_0x5dd121,_0x38f627,_0xf06ed6,_0x7b5d('0x66'));})[_0x7b5d('0x30')](function(){return getServerInfo(_0x5dd121);})['catch'](function(_0x1fa78c){logger['error']('['+_0x356afb['lastevent'][_0x7b5d('0x7a')]()+']',JSON[_0x7b5d('0x22')](_0x1fa78c));});}; \ 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 765c112..2381013 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 _0x4e3a=['substring','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','%s:\x20%s','key','keyContent','variable','format','slice'];(function(_0x448a70,_0x225e66){var _0x2e3a0f=function(_0xd4cfb6){while(--_0xd4cfb6){_0x448a70['push'](_0x448a70['shift']());}};_0x2e3a0f(++_0x225e66);}(_0x4e3a,0xc1));var _0xa4e3=function(_0x179d5d,_0x22461a){_0x179d5d=_0x179d5d-0x0;var _0x169529=_0x4e3a[_0x179d5d];return _0x169529;};'use strict';var _=require(_0xa4e3('0x0'));var util=require(_0xa4e3('0x1'));exports[_0xa4e3('0x2')]=function(_0xb6658b,_0x43eb39,_0x4cdd5b){var _0xffce7f=[];if(_0xb6658b[_0xa4e3('0x3')]>0x0){var _0x3dbdc6=_[_0xa4e3('0x4')](_0xb6658b,['id']);for(var _0x55388e=0x0;_0x55388e<_0x3dbdc6[_0xa4e3('0x3')];_0x55388e++){var _0x5a59c2=_0x3dbdc6[_0x55388e];if(_0x5a59c2['type']===_0xa4e3('0x5')){_0xffce7f[_0xa4e3('0x6')](_0x5a59c2[_0xa4e3('0x7')]);}else if(_0x5a59c2[_0xa4e3('0x8')]==='variable'&&_0x5a59c2[_0xa4e3('0x9')]){_0x43eb39[_0x5a59c2[_0xa4e3('0x9')]]&&_0xffce7f[_0xa4e3('0x6')](_0x43eb39[_0x5a59c2['variableName']][_0xa4e3('0xa')]());}else if(_0x5a59c2[_0xa4e3('0x8')]===_0xa4e3('0xb')&&_0x5a59c2['Variable']&&_0x5a59c2[_0xa4e3('0xc')][_0xa4e3('0xd')]){_0x43eb39[_0x5a59c2[_0xa4e3('0xc')][_0xa4e3('0xd')][_0xa4e3('0xe')]()]&&_0xffce7f['push'](_0x43eb39[_0x5a59c2[_0xa4e3('0xc')][_0xa4e3('0xd')]['toLowerCase']()][_0xa4e3('0xa')]());}else if(_0x5a59c2[_0xa4e3('0x8')]===_0xa4e3('0xf')){if(_0x5a59c2[_0xa4e3('0x10')]===_0xa4e3('0x5')&&_0x5a59c2['key']){_0xffce7f[_0xa4e3('0x6')](util['format'](_0xa4e3('0x11'),_0x5a59c2[_0xa4e3('0x12')],_0x5a59c2[_0xa4e3('0x13')]));}else if(_0x5a59c2['keyType']===_0xa4e3('0x14')&&_0x5a59c2[_0xa4e3('0x9')]&&_0x5a59c2[_0xa4e3('0x12')]){_0x43eb39[_0x5a59c2[_0xa4e3('0x9')]]&&_0xffce7f['push'](util[_0xa4e3('0x15')](_0xa4e3('0x11'),_0x5a59c2[_0xa4e3('0x12')],_0x43eb39[_0x5a59c2[_0xa4e3('0x9')]]));}else if(_0x5a59c2[_0xa4e3('0x10')]===_0xa4e3('0xb')&&_0x5a59c2['Variable']&&_0x5a59c2[_0xa4e3('0xc')]['name']&&_0x5a59c2[_0xa4e3('0x12')]){_0x43eb39[_0x5a59c2['Variable'][_0xa4e3('0xd')][_0xa4e3('0xe')]()]&&_0xffce7f[_0xa4e3('0x6')](util[_0xa4e3('0x15')]('%s:\x20%s',_0x5a59c2[_0xa4e3('0x12')],_0x43eb39[_0x5a59c2[_0xa4e3('0xc')]['name'][_0xa4e3('0xe')]()]));}}}}return _0xffce7f['join'](_0x4cdd5b);};exports['stripTrailingSlash']=function(_0x38b99c){var _0x1b85bc=_0x38b99c[_0xa4e3('0x16')](-0x1);if(_0x1b85bc==='/'){_0x38b99c=_0x38b99c[_0xa4e3('0x17')](0x0,_0x38b99c['lastIndexOf'](_0x1b85bc));}return _0x38b99c;};exports[_0xa4e3('0x18')]=function(_0x4f012e){if(!_[_0xa4e3('0x19')](_0x4f012e)&&_0x4f012e!==''){var _0x408879=/^(([^<>()\[\]\\.,;:\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 _0x408879[_0xa4e3('0x1a')](String(_0x4f012e)[_0xa4e3('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x5790=['getString','sortBy','length','type','push','variable','variableName','toString','customVariable','Variable','toLowerCase','name','string','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash'];(function(_0x2738a0,_0x379e6e){var _0x4308ef=function(_0x5098a2){while(--_0x5098a2){_0x2738a0['push'](_0x2738a0['shift']());}};_0x4308ef(++_0x379e6e);}(_0x5790,0xe9));var _0x0579=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5790[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x0579('0x0'));var util=require('util');exports[_0x0579('0x1')]=function(_0x18da17,_0x55d16c,_0x23507f){var _0x197949=[];if(_0x18da17['length']>0x0){var _0x2fc868=_[_0x0579('0x2')](_0x18da17,['id']);for(var _0x12b2bb=0x0;_0x12b2bb<_0x2fc868[_0x0579('0x3')];_0x12b2bb++){var _0x34b563=_0x2fc868[_0x12b2bb];if(_0x34b563[_0x0579('0x4')]==='string'){_0x197949[_0x0579('0x5')](_0x34b563['content']);}else if(_0x34b563['type']===_0x0579('0x6')&&_0x34b563[_0x0579('0x7')]){_0x55d16c[_0x34b563['variableName']]&&_0x197949[_0x0579('0x5')](_0x55d16c[_0x34b563[_0x0579('0x7')]][_0x0579('0x8')]());}else if(_0x34b563[_0x0579('0x4')]===_0x0579('0x9')&&_0x34b563[_0x0579('0xa')]&&_0x34b563['Variable']['name']){_0x55d16c[_0x34b563[_0x0579('0xa')]['name'][_0x0579('0xb')]()]&&_0x197949[_0x0579('0x5')](_0x55d16c[_0x34b563[_0x0579('0xa')][_0x0579('0xc')]['toLowerCase']()][_0x0579('0x8')]());}else if(_0x34b563['type']==='keyValue'){if(_0x34b563['keyType']===_0x0579('0xd')&&_0x34b563[_0x0579('0xe')]){_0x197949[_0x0579('0x5')](util[_0x0579('0xf')](_0x0579('0x10'),_0x34b563['key'],_0x34b563[_0x0579('0x11')]));}else if(_0x34b563[_0x0579('0x12')]===_0x0579('0x6')&&_0x34b563[_0x0579('0x7')]&&_0x34b563[_0x0579('0xe')]){_0x55d16c[_0x34b563[_0x0579('0x7')]]&&_0x197949[_0x0579('0x5')](util['format']('%s:\x20%s',_0x34b563['key'],_0x55d16c[_0x34b563['variableName']]));}else if(_0x34b563['keyType']===_0x0579('0x9')&&_0x34b563[_0x0579('0xa')]&&_0x34b563['Variable'][_0x0579('0xc')]&&_0x34b563[_0x0579('0xe')]){_0x55d16c[_0x34b563['Variable'][_0x0579('0xc')]['toLowerCase']()]&&_0x197949['push'](util[_0x0579('0xf')](_0x0579('0x10'),_0x34b563[_0x0579('0xe')],_0x55d16c[_0x34b563[_0x0579('0xa')][_0x0579('0xc')]['toLowerCase']()]));}}}}return _0x197949[_0x0579('0x13')](_0x23507f);};exports[_0x0579('0x14')]=function(_0x3d5b2b){var _0x14db34=_0x3d5b2b[_0x0579('0x15')](-0x1);if(_0x14db34==='/'){_0x3d5b2b=_0x3d5b2b[_0x0579('0x16')](0x0,_0x3d5b2b[_0x0579('0x17')](_0x14db34));}return _0x3d5b2b;};exports['validateEmail']=function(_0x8916f6){if(!_[_0x0579('0x18')](_0x8916f6)&&_0x8916f6!==''){var _0x5644c1=/^(([^<>()\[\]\\.,;:\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 _0x5644c1[_0x0579('0x19')](String(_0x8916f6)[_0x0579('0xb')]());}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 f0d5be1..ca072ae 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x1cff41,_0x2d2794){var _0x1e1201=function(_0x575564){while(--_0x575564){_0x1cff41['push'](_0x1cff41['shift']());}};_0x1e1201(++_0x2d2794);}(_0x34e8,0x12c));var _0x834e=function(_0x37d726,_0x3fdf2e){_0x37d726=_0x37d726-0x0;var _0x4f169d=_0x34e8[_0x37d726];return _0x4f169d;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _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(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0xe706,0xa3));var _0x6e70=function(_0x25ad66,_0x46e4dc){_0x25ad66=_0x25ad66-0x0;var _0x141bc4=_0xe706[_0x25ad66];return _0x141bc4;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 52b69a0..a4e48d8 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 _0xe784=['results','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','variable','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','user:%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','emit','application/json','info','format','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone'];(function(_0x539274,_0x18f798){var _0x542cb9=function(_0x53fe9a){while(--_0x53fe9a){_0x539274['push'](_0x539274['shift']());}};_0x542cb9(++_0x18f798);}(_0xe784,0x122));var _0x4e78=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xe784[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x4e78('0x0'));var rp=require(_0x4e78('0x1'));var md5=require('md5');var util=require(_0x4e78('0x2'));var Redis=require(_0x4e78('0x3'));var intUtil=require(_0x4e78('0x4'));var config=require(_0x4e78('0x5'));var logger=require(_0x4e78('0x6'))(_0x4e78('0x7'));config['redis']=_[_0x4e78('0x8')](config[_0x4e78('0x9')],{'host':_0x4e78('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4e78('0x9')]));function emit(_0x4e23ab,_0x173d36,_0x3fe45e){io['to'](_0x4e23ab)[_0x4e78('0xb')](_0x173d36,_0x3fe45e);}var headers={'Content-Type':_0x4e78('0xc'),'Accept':_0x4e78('0xc')};function getTicket(_0x38e99b,_0x301b90,_0x15ff7c,_0x380766,_0x2d2dde){logger[_0x4e78('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x4e78('0xe')]('%s/tickets.json',_0x38e99b[_0x4e78('0xf')]),'method':_0x4e78('0x10'),'body':{'ticket':_[_0x4e78('0x11')]({'requester_id':_0x15ff7c['id'],'submitter_id':_0x301b90?_0x301b90['id']:undefined,'assignee_id':_0x301b90?_0x301b90['id']:undefined,'tags':getTags(_0x380766[_0x4e78('0x12')],'name'),'subject':intUtil['getString'](_0x380766[_0x4e78('0x13')],_0x2d2dde,'\x20'),'description':intUtil[_0x4e78('0x14')](_0x380766[_0x4e78('0x15')],_0x2d2dde,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x380766['Descriptions'],_0x2d2dde,'\x0a')}},getCustomFields(_0x380766[_0x4e78('0x16')],_0x2d2dde))}})[_0x4e78('0x17')](function(_0x10055e){logger['info'](_0x4e78('0x18'));return _0x10055e['ticket'];});}function getUser(_0x1fe1cc,_0x347403){if(intUtil[_0x4e78('0x19')](_0x347403)){logger[_0x4e78('0xd')]('Getting\x20agent\x20with\x20email',_0x347403);return request({'uri':util[_0x4e78('0xe')](_0x4e78('0x1a'),_0x1fe1cc[_0x4e78('0xf')]),'qs':{'query':util['format'](_0x4e78('0x1b'),_0x347403)}})[_0x4e78('0x17')](function(_0x398643){if(_0x398643[_0x4e78('0x1c')]){logger['info']('Agent\x20found!');return _[_0x4e78('0x1d')](_0x398643['results'],{'email':_0x347403,'role':'agent'});}else{logger[_0x4e78('0xd')](_0x4e78('0x1e'));return request({'uri':util[_0x4e78('0xe')](_0x4e78('0x1f'),_0x1fe1cc['remoteUri'])})['then'](function(_0x301091){logger[_0x4e78('0xd')]('Admin\x20account\x20selected.');return _0x301091[_0x4e78('0x20')];});}});}else{logger[_0x4e78('0xd')](_0x4e78('0x1e'));return request({'uri':util[_0x4e78('0xe')](_0x4e78('0x1f'),_0x1fe1cc['remoteUri'])})[_0x4e78('0x17')](function(_0x4f72d7){logger['info']('Admin\x20account\x20selected.');return _0x4f72d7['user'];});}}function getEndUser(_0x42a66d,_0x57e72f,_0x48112a){logger[_0x4e78('0xd')](_0x4e78('0x21'),_0x48112a);return request({'uri':util[_0x4e78('0xe')](_0x4e78('0x1a'),_0x42a66d[_0x4e78('0xf')]),'qs':{'query':util[_0x4e78('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x48112a)}})[_0x4e78('0x17')](function(_0x3a7daf){var _0x14769b;if(_0x3a7daf[_0x4e78('0x22')][_0x4e78('0x23')]){_0x3a7daf['results']=_[_0x4e78('0x24')](_0x3a7daf[_0x4e78('0x22')],{'suspended':![],'role':'end-user'});if(_0x3a7daf[_0x4e78('0x22')][_0x4e78('0x23')]){_0x14769b=_['first'](_0x3a7daf[_0x4e78('0x22')]);}}if(_0x14769b){logger[_0x4e78('0xd')](_0x4e78('0x25'));return _0x14769b;}else{logger[_0x4e78('0xd')](_0x4e78('0x26'));return request({'uri':util[_0x4e78('0xe')](_0x4e78('0x27'),_0x42a66d[_0x4e78('0xf')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x4e78('0xe')](_0x4e78('0x28'),_0x57e72f||_0x48112a),'phone':_0x48112a}}})[_0x4e78('0x17')](function(_0x74efc4){logger[_0x4e78('0xd')](_0x4e78('0x29'));return _0x74efc4['user'];});}});}function getAuth(_0x2d1d6d){var _0x388494;if(_0x2d1d6d[_0x4e78('0x2a')]===_0x4e78('0x2b')){_0x388494=util[_0x4e78('0xe')](_0x4e78('0x2c'),_0x2d1d6d[_0x4e78('0x2d')],_0x2d1d6d['password']);}else if(_0x2d1d6d['authType']===_0x4e78('0x2e')){_0x388494=util[_0x4e78('0xe')](_0x4e78('0x2f'),_0x2d1d6d[_0x4e78('0x2d')],_0x2d1d6d[_0x4e78('0x2e')]);}return util[_0x4e78('0xe')](_0x4e78('0x30'),new Buffer(_0x388494)[_0x4e78('0x31')](_0x4e78('0x32')));}function request(_0x45a443){logger[_0x4e78('0x33')](_0x4e78('0x34'),JSON['stringify'](_0x45a443));return rp(_[_0x4e78('0x8')](_0x45a443,{'method':_0x4e78('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x5119df,_0x4452f8){var _0x13069d=[];if(_0x5119df&&_0x5119df[_0x4e78('0x23')]>0x0){_0x13069d=_[_0x4e78('0x36')](_0x5119df,_0x4452f8);}return _0x13069d;}function getCustomFields(_0x3a74f8,_0xefe349){var _0x43322e=[];var _0x5e3cb1={'custom_fields':[]};if(_0x3a74f8['length']>0x0){_[_0x4e78('0x37')](_0x3a74f8,function(_0x47c35e){if(_['includes']([_0x4e78('0x38'),_0x4e78('0x39')],_0x47c35e[_0x4e78('0x3a')])&&_0x47c35e[_0x4e78('0x3b')]&&!_0x47c35e[_0x4e78('0x3c')]){_0x5e3cb1[_0x47c35e[_0x4e78('0x3b')][_0x4e78('0x3d')]()]=_0x47c35e[_0x4e78('0x3e')][_0x4e78('0x31')]();}else if(_[_0x4e78('0x3f')](['string',_0x4e78('0x39')],_0x47c35e['type'])&&_0x47c35e[_0x4e78('0x40')]&&_0x47c35e[_0x4e78('0x3c')]){_0x5e3cb1[_0x4e78('0x41')]['push']({'id':_0x47c35e['idField'],'value':_0x47c35e[_0x4e78('0x3e')]['toString']()});}else if(_0x47c35e['type']===_0x4e78('0x42')&&_0x47c35e['variableName']&&_0x47c35e[_0x4e78('0x40')]&&_0x47c35e[_0x4e78('0x3c')]){_0xefe349[_0x47c35e['variableName']]&&_0x5e3cb1['custom_fields'][_0x4e78('0x43')]({'id':_0x47c35e['idField'],'value':_0xefe349[_0x47c35e[_0x4e78('0x44')]][_0x4e78('0x31')]()});}else if(_0x47c35e[_0x4e78('0x3a')]===_0x4e78('0x45')&&_0x47c35e[_0x4e78('0x46')]&&_0x47c35e['Variable'][_0x4e78('0x47')]&&_0x47c35e['idField']&&_0x47c35e[_0x4e78('0x3c')]){_0xefe349[_0x47c35e['Variable'][_0x4e78('0x47')][_0x4e78('0x3d')]()]&&_0x5e3cb1['custom_fields'][_0x4e78('0x43')]({'id':_0x47c35e[_0x4e78('0x40')],'value':_0xefe349[_0x47c35e['Variable']['name'][_0x4e78('0x3d')]()][_0x4e78('0x31')]()});}});}return _0x5e3cb1;}exports[_0x4e78('0x48')]=function(_0xf8d54a,_0x1de430,_0x4d7adb,_0x3c693f,_0xfa0048,_0x498038){var _0x47012a,_0x53e877;_0x498038[_0x4e78('0xf')]=intUtil[_0x4e78('0x49')](_0x498038[_0x4e78('0xf')]);_0x498038[_0x4e78('0x4a')]=intUtil['stripTrailingSlash'](_0x498038[_0x4e78('0x4a')]);if(_0xfa0048&&_0xfa0048[_0x4e78('0x4b')]){logger[_0x4e78('0xd')](_0x4e78('0x4c'),'Recording\x20is\x20enabled!');_0x1de430[_0x4e78('0x4d')]=util[_0x4e78('0xe')](_0x4e78('0x4e'),_0x498038[_0x4e78('0x4a')],_0x1de430[_0x4e78('0x4f')],md5(_0x1de430['uniqueid']));}else{_0x1de430['recordingURL']='';}headers[_0x4e78('0x50')]=getAuth(_0x498038);return getUser(_0x498038,_0x3c693f[_0x4e78('0x51')])[_0x4e78('0x17')](function(_0x4d1e3a){_0x47012a=_0x4d1e3a;logger[_0x4e78('0xd')](_0x4e78('0x52'),_0x47012a['id']);return getEndUser(_0x498038,_0x1de430['calleridname'],_0x1de430[_0x4e78('0x53')]);})[_0x4e78('0x17')](function(_0x459356){_0x53e877=_0x459356;logger[_0x4e78('0xd')](_0x4e78('0x54'),_0x53e877['id']);return getTicket(_0x498038,_0x47012a,_0x53e877,_0x4d7adb,_0x1de430);})[_0x4e78('0x17')](function(_0xa440fd){if(_0xa440fd){logger[_0x4e78('0xd')]('The\x20Ticket\x20ID\x20is:',_0xa440fd['id']);switch(_0x498038[_0x4e78('0x3a')]){case'integrationTab':logger['info'](_0x4e78('0x4c'),_0x4e78('0x55'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x498038[_0x4e78('0xf')],_0x47012a['id'],_0xa440fd['id']),'method':_0x4e78('0x10')});case _0x4e78('0x56'):logger[_0x4e78('0xd')](_0x4e78('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4e78('0xe')]('user:%s',_0x3c693f[_0x4e78('0x47')]),_0x4e78('0x57'),{'uri':util[_0x4e78('0xe')](_0x4e78('0x58'),_0x498038[_0x4e78('0xf')][_0x4e78('0x59')](_0x4e78('0x5a'),''),_0xa440fd['id'])});break;default:logger[_0x4e78('0x5b')]('[QUEUE]',_0x4e78('0x5c'));}}})['catch'](function(_0x1ec17d){logger[_0x4e78('0x5b')](_0x4e78('0x5d'),util[_0x4e78('0x5e')](_0x1ec17d,{'showHidden':!![],'depth':null}));});};exports[_0x4e78('0x5f')]=function(_0x38cb58,_0x2f54e4,_0x1194b5,_0x192f0a,_0x4b5c52,_0x13723c,_0x1fdb93){var _0x20f9cc,_0x2a8bd0;_0x13723c[_0x4e78('0xf')]=intUtil[_0x4e78('0x49')](_0x13723c[_0x4e78('0xf')]);_0x13723c[_0x4e78('0x4a')]=intUtil[_0x4e78('0x49')](_0x13723c[_0x4e78('0x4a')]);if(_0x1fdb93&&_0x1fdb93[_0x4e78('0x60')]&&_0x1fdb93['recordingFormat']!=='none'){logger['info'](_0x4e78('0x61'),_0x4e78('0x62'));_0x2f54e4[_0x4e78('0x4d')]=util['format'](_0x4e78('0x4e'),_0x13723c['serverUrl'],_0x2f54e4[_0x4e78('0x4f')],md5(_0x2f54e4['uniqueid']));}headers[_0x4e78('0x50')]=getAuth(_0x13723c);return getUser(_0x13723c,_0x192f0a['email'])[_0x4e78('0x17')](function(_0x590fb2){_0x20f9cc=_0x590fb2;logger[_0x4e78('0xd')](_0x4e78('0x52'),_0x20f9cc['id']);return getEndUser(_0x13723c,_0x2f54e4['destcalleridname'],_0x2f54e4['destcalleridnum']);})[_0x4e78('0x17')](function(_0x343763){_0x2a8bd0=_0x343763;logger['info'](_0x4e78('0x54'),_0x2a8bd0['id']);return getTicket(_0x13723c,_0x20f9cc,_0x2a8bd0,_0x1194b5,_0x2f54e4);})['then'](function(_0x2d8c07){if(_0x2d8c07){logger[_0x4e78('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2d8c07['id']);switch(_0x13723c[_0x4e78('0x3a')]){case _0x4e78('0x63'):logger[_0x4e78('0xd')](_0x4e78('0x61'),_0x4e78('0x55'));return request({'uri':util[_0x4e78('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x13723c[_0x4e78('0xf')],_0x20f9cc['id'],_0x2d8c07['id']),'method':_0x4e78('0x10')});case _0x4e78('0x56'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4e78('0x64'),_0x192f0a[_0x4e78('0x47')]),_0x4e78('0x57'),{'uri':util[_0x4e78('0xe')](_0x4e78('0x58'),_0x13723c[_0x4e78('0xf')]['replace']('/api/v2',''),_0x2d8c07['id'])});break;default:logger[_0x4e78('0x5b')](_0x4e78('0x61'),_0x4e78('0x5c'));}}})[_0x4e78('0x65')](function(_0x27cff1){logger['error'](_0x4e78('0x66'),util[_0x4e78('0x5e')](_0x27cff1,{'showHidden':!![],'depth':null}));});};exports[_0x4e78('0x67')]=function(_0x459e97,_0x3f6154,_0x2cc790,_0x58e7cc,_0x4a46b1,_0x93f1e5){var _0x5618f1,_0x1c73ac;_0x93f1e5[_0x4e78('0xf')]=intUtil[_0x4e78('0x49')](_0x93f1e5[_0x4e78('0xf')]);_0x93f1e5[_0x4e78('0x4a')]=intUtil[_0x4e78('0x49')](_0x93f1e5[_0x4e78('0x4a')]);if(_0x4a46b1&&_0x4a46b1[_0x4e78('0x4b')]){logger[_0x4e78('0xd')]('['+_0x3f6154[_0x4e78('0x68')][_0x4e78('0x69')]()+']',_0x4e78('0x62'));_0x3f6154[_0x4e78('0x4d')]=util[_0x4e78('0xe')](_0x4e78('0x4e'),_0x93f1e5[_0x4e78('0x4a')],_0x3f6154[_0x4e78('0x4f')],md5(_0x3f6154[_0x4e78('0x4f')]));}else{_0x3f6154[_0x4e78('0x4d')]='';}headers['Authorization']=getAuth(_0x93f1e5);return getUser(_0x93f1e5)[_0x4e78('0x17')](function(_0x2020c5){_0x5618f1=_0x2020c5;logger[_0x4e78('0xd')](_0x4e78('0x52'),_0x5618f1['id']);return getEndUser(_0x93f1e5,_0x3f6154['calleridname'],_0x3f6154[_0x4e78('0x53')]);})['then'](function(_0x5a207c){_0x1c73ac=_0x5a207c;logger[_0x4e78('0xd')](_0x4e78('0x54'),_0x1c73ac['id']);return getTicket(_0x93f1e5,_0x5618f1,_0x1c73ac,_0x2cc790,_0x3f6154);})[_0x4e78('0x17')](function(_0x534cd5){if(_0x534cd5){logger['info'](_0x4e78('0x6a'),_0x534cd5['id']);}})[_0x4e78('0x65')](function(_0x5a2139){logger[_0x4e78('0x5b')]('['+_0x3f6154[_0x4e78('0x68')][_0x4e78('0x69')]()+']'+_0x4e78('0x6b'),util[_0x4e78('0x5e')](_0x5a2139,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x44e5=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Zendesk\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','authType','%s:%s','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','string','picklist','type','nameField','toLowerCase','idField','customField','push','content','variable','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x7266ce,_0x2d9063){var _0x870e0=function(_0x4dc8f9){while(--_0x4dc8f9){_0x7266ce['push'](_0x7266ce['shift']());}};_0x870e0(++_0x2d9063);}(_0x44e5,0x14e));var _0x544e=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x44e5[_0x231e16];return _0x570a7c;};'use strict';var _=require('lodash');var rp=require(_0x544e('0x0'));var md5=require(_0x544e('0x1'));var util=require(_0x544e('0x2'));var Redis=require(_0x544e('0x3'));var intUtil=require(_0x544e('0x4'));var config=require(_0x544e('0x5'));var logger=require(_0x544e('0x6'))(_0x544e('0x7'));config[_0x544e('0x8')]=_[_0x544e('0x9')](config[_0x544e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x544e('0xa'))(new Redis(config[_0x544e('0x8')]));function emit(_0x5cf9bb,_0x529c45,_0x53d624){io['to'](_0x5cf9bb)['emit'](_0x529c45,_0x53d624);}var headers={'Content-Type':_0x544e('0xb'),'Accept':'application/json'};function getTicket(_0x3a4baa,_0x951dd,_0x346684,_0x2ca11c,_0x10d18f){logger[_0x544e('0xc')](_0x544e('0xd'));return request({'uri':util['format']('%s/tickets.json',_0x3a4baa[_0x544e('0xe')]),'method':_0x544e('0xf'),'body':{'ticket':_[_0x544e('0x10')]({'requester_id':_0x346684['id'],'submitter_id':_0x951dd?_0x951dd['id']:undefined,'assignee_id':_0x951dd?_0x951dd['id']:undefined,'tags':getTags(_0x2ca11c[_0x544e('0x11')],_0x544e('0x12')),'subject':intUtil['getString'](_0x2ca11c[_0x544e('0x13')],_0x10d18f,'\x20'),'description':intUtil['getString'](_0x2ca11c[_0x544e('0x14')],_0x10d18f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2ca11c[_0x544e('0x14')],_0x10d18f,'\x0a')}},getCustomFields(_0x2ca11c[_0x544e('0x15')],_0x10d18f))}})[_0x544e('0x16')](function(_0x241de6){logger[_0x544e('0xc')](_0x544e('0x17'));return _0x241de6['ticket'];});}function getUser(_0x286614,_0x2159e7){if(intUtil['validateEmail'](_0x2159e7)){logger[_0x544e('0xc')](_0x544e('0x18'),_0x2159e7);return request({'uri':util[_0x544e('0x19')](_0x544e('0x1a'),_0x286614[_0x544e('0xe')]),'qs':{'query':util[_0x544e('0x19')](_0x544e('0x1b'),_0x2159e7)}})[_0x544e('0x16')](function(_0x2371f2){if(_0x2371f2[_0x544e('0x1c')]){logger[_0x544e('0xc')](_0x544e('0x1d'));return _['find'](_0x2371f2[_0x544e('0x1e')],{'email':_0x2159e7,'role':_0x544e('0x1f')});}else{logger[_0x544e('0xc')](_0x544e('0x20'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x21'),_0x286614[_0x544e('0xe')])})[_0x544e('0x16')](function(_0x176983){logger[_0x544e('0xc')](_0x544e('0x22'));return _0x176983['user'];});}});}else{logger['info'](_0x544e('0x20'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x21'),_0x286614[_0x544e('0xe')])})[_0x544e('0x16')](function(_0x3c4ec5){logger[_0x544e('0xc')]('Admin\x20account\x20selected.');return _0x3c4ec5['user'];});}}function getEndUser(_0x26785f,_0x5ea5fe,_0x5d374c){logger[_0x544e('0xc')](_0x544e('0x23'),_0x5d374c);return request({'uri':util['format']('%s/search.json',_0x26785f[_0x544e('0xe')]),'qs':{'query':util['format'](_0x544e('0x24'),_0x5d374c)}})[_0x544e('0x16')](function(_0x21a3c8){var _0x24709e;if(_0x21a3c8[_0x544e('0x1e')][_0x544e('0x25')]){_0x21a3c8['results']=_[_0x544e('0x26')](_0x21a3c8[_0x544e('0x1e')],{'suspended':![],'role':'end-user'});if(_0x21a3c8[_0x544e('0x1e')]['length']){_0x24709e=_[_0x544e('0x27')](_0x21a3c8['results']);}}if(_0x24709e){logger[_0x544e('0xc')]('Enduser\x20found!');return _0x24709e;}else{logger['info'](_0x544e('0x28'));return request({'uri':util['format'](_0x544e('0x29'),_0x26785f[_0x544e('0xe')]),'method':_0x544e('0xf'),'body':{'user':{'role':_0x544e('0x2a'),'name':util[_0x544e('0x19')](_0x544e('0x2b'),_0x5ea5fe||_0x5d374c),'phone':_0x5d374c}}})[_0x544e('0x16')](function(_0x17f910){logger[_0x544e('0xc')](_0x544e('0x2c'));return _0x17f910[_0x544e('0x2d')];});}});}function getAuth(_0x5e30e1){var _0x565f5e;if(_0x5e30e1[_0x544e('0x2e')]==='password'){_0x565f5e=util[_0x544e('0x19')](_0x544e('0x2f'),_0x5e30e1['username'],_0x5e30e1[_0x544e('0x30')]);}else if(_0x5e30e1[_0x544e('0x2e')]===_0x544e('0x31')){_0x565f5e=util[_0x544e('0x19')](_0x544e('0x32'),_0x5e30e1['username'],_0x5e30e1['token']);}return util[_0x544e('0x19')](_0x544e('0x33'),new Buffer(_0x565f5e)[_0x544e('0x34')](_0x544e('0x35')));}function request(_0x21ba06){logger[_0x544e('0x36')](_0x544e('0x37'),JSON[_0x544e('0x38')](_0x21ba06));return rp(_[_0x544e('0x9')](_0x21ba06,{'method':_0x544e('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x32366a,_0x561427){var _0xe3bd78=[];if(_0x32366a&&_0x32366a[_0x544e('0x25')]>0x0){_0xe3bd78=_['map'](_0x32366a,_0x561427);}return _0xe3bd78;}function getCustomFields(_0x28d8df,_0x3274a9){var _0x15c1fb=[];var _0x2c6fb0={'custom_fields':[]};if(_0x28d8df[_0x544e('0x25')]>0x0){_['forEach'](_0x28d8df,function(_0x4efe2c){if(_['includes']([_0x544e('0x3a'),_0x544e('0x3b')],_0x4efe2c[_0x544e('0x3c')])&&_0x4efe2c[_0x544e('0x3d')]&&!_0x4efe2c['customField']){_0x2c6fb0[_0x4efe2c['nameField'][_0x544e('0x3e')]()]=_0x4efe2c['content']['toString']();}else if(_['includes']([_0x544e('0x3a'),_0x544e('0x3b')],_0x4efe2c['type'])&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x2c6fb0['custom_fields'][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x4efe2c[_0x544e('0x42')][_0x544e('0x34')]()});}else if(_0x4efe2c[_0x544e('0x3c')]===_0x544e('0x43')&&_0x4efe2c[_0x544e('0x44')]&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x3274a9[_0x4efe2c[_0x544e('0x44')]]&&_0x2c6fb0[_0x544e('0x45')][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x3274a9[_0x4efe2c['variableName']][_0x544e('0x34')]()});}else if(_0x4efe2c[_0x544e('0x3c')]===_0x544e('0x46')&&_0x4efe2c[_0x544e('0x47')]&&_0x4efe2c[_0x544e('0x47')][_0x544e('0x12')]&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x3274a9[_0x4efe2c['Variable'][_0x544e('0x12')]['toLowerCase']()]&&_0x2c6fb0[_0x544e('0x45')][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x3274a9[_0x4efe2c['Variable']['name'][_0x544e('0x3e')]()][_0x544e('0x34')]()});}});}return _0x2c6fb0;}exports[_0x544e('0x48')]=function(_0x49415e,_0x15d5cf,_0x1e8f12,_0x1d9654,_0x463712,_0x24eb38){var _0x2e0236,_0x81f357;_0x24eb38[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x24eb38[_0x544e('0xe')]);_0x24eb38['serverUrl']=intUtil[_0x544e('0x49')](_0x24eb38['serverUrl']);if(_0x463712&&_0x463712[_0x544e('0x4a')]){logger['info'](_0x544e('0x4b'),_0x544e('0x4c'));_0x15d5cf[_0x544e('0x4d')]=util[_0x544e('0x19')](_0x544e('0x4e'),_0x24eb38[_0x544e('0x4f')],_0x15d5cf[_0x544e('0x50')],md5(_0x15d5cf[_0x544e('0x50')]));}else{_0x15d5cf[_0x544e('0x4d')]='';}headers[_0x544e('0x51')]=getAuth(_0x24eb38);return getUser(_0x24eb38,_0x1d9654['email'])[_0x544e('0x16')](function(_0x37417a){_0x2e0236=_0x37417a;logger['info']('The\x20User\x20ID\x20is:',_0x2e0236['id']);return getEndUser(_0x24eb38,_0x15d5cf['calleridname'],_0x15d5cf['calleridnum']);})[_0x544e('0x16')](function(_0x2851ba){_0x81f357=_0x2851ba;logger[_0x544e('0xc')](_0x544e('0x52'),_0x81f357['id']);return getTicket(_0x24eb38,_0x2e0236,_0x81f357,_0x1e8f12,_0x15d5cf);})['then'](function(_0x55ef93){if(_0x55ef93){logger[_0x544e('0xc')](_0x544e('0x53'),_0x55ef93['id']);switch(_0x24eb38['type']){case'integrationTab':logger[_0x544e('0xc')](_0x544e('0x4b'),_0x544e('0x54'));return request({'uri':util['format'](_0x544e('0x55'),_0x24eb38[_0x544e('0xe')],_0x2e0236['id'],_0x55ef93['id']),'method':_0x544e('0xf')});case'newTab':logger['info']('[QUEUE]',_0x544e('0x56'));emit(util[_0x544e('0x19')](_0x544e('0x57'),_0x1d9654[_0x544e('0x12')]),_0x544e('0x58'),{'uri':util[_0x544e('0x19')](_0x544e('0x59'),_0x24eb38['remoteUri'][_0x544e('0x5a')](_0x544e('0x5b'),''),_0x55ef93['id'])});break;default:logger[_0x544e('0x5c')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x544e('0x5d')](function(_0x45f7c){logger['error'](_0x544e('0x5e'),util[_0x544e('0x5f')](_0x45f7c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4230ea,_0x80bfc3,_0xcce6bf,_0x30392e,_0x503a14,_0x3af347,_0x33dafe){var _0x59c38a,_0xd9f5f8;_0x3af347[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x3af347[_0x544e('0xe')]);_0x3af347[_0x544e('0x4f')]=intUtil['stripTrailingSlash'](_0x3af347[_0x544e('0x4f')]);if(_0x33dafe&&_0x33dafe[_0x544e('0x60')]&&_0x33dafe[_0x544e('0x60')]!==_0x544e('0x61')){logger[_0x544e('0xc')](_0x544e('0x62'),_0x544e('0x4c'));_0x80bfc3[_0x544e('0x4d')]=util[_0x544e('0x19')](_0x544e('0x4e'),_0x3af347[_0x544e('0x4f')],_0x80bfc3[_0x544e('0x50')],md5(_0x80bfc3[_0x544e('0x50')]));}headers[_0x544e('0x51')]=getAuth(_0x3af347);return getUser(_0x3af347,_0x30392e['email'])['then'](function(_0x1b9190){_0x59c38a=_0x1b9190;logger[_0x544e('0xc')](_0x544e('0x63'),_0x59c38a['id']);return getEndUser(_0x3af347,_0x80bfc3[_0x544e('0x64')],_0x80bfc3['destcalleridnum']);})[_0x544e('0x16')](function(_0x318056){_0xd9f5f8=_0x318056;logger[_0x544e('0xc')](_0x544e('0x52'),_0xd9f5f8['id']);return getTicket(_0x3af347,_0x59c38a,_0xd9f5f8,_0xcce6bf,_0x80bfc3);})[_0x544e('0x16')](function(_0x56ab23){if(_0x56ab23){logger[_0x544e('0xc')](_0x544e('0x53'),_0x56ab23['id']);switch(_0x3af347[_0x544e('0x3c')]){case'integrationTab':logger['info'](_0x544e('0x62'),_0x544e('0x54'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x55'),_0x3af347[_0x544e('0xe')],_0x59c38a['id'],_0x56ab23['id']),'method':_0x544e('0xf')});case'newTab':logger['info'](_0x544e('0x62'),_0x544e('0x56'));emit(util[_0x544e('0x19')]('user:%s',_0x30392e[_0x544e('0x12')]),_0x544e('0x58'),{'uri':util[_0x544e('0x19')](_0x544e('0x59'),_0x3af347['remoteUri']['replace'](_0x544e('0x5b'),''),_0x56ab23['id'])});break;default:logger[_0x544e('0x5c')](_0x544e('0x62'),_0x544e('0x65'));}}})[_0x544e('0x5d')](function(_0x3bb2b8){logger[_0x544e('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x544e('0x5f')](_0x3bb2b8,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x6ca2be,_0x24a904,_0x487c53,_0x1975ec,_0x41c831,_0x26dc6c){var _0x255e17,_0x408f0c;_0x26dc6c[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x26dc6c['remoteUri']);_0x26dc6c[_0x544e('0x4f')]=intUtil[_0x544e('0x49')](_0x26dc6c[_0x544e('0x4f')]);if(_0x41c831&&_0x41c831[_0x544e('0x4a')]){logger[_0x544e('0xc')]('['+_0x24a904[_0x544e('0x66')][_0x544e('0x67')]()+']','Recording\x20is\x20enabled!');_0x24a904[_0x544e('0x4d')]=util['format'](_0x544e('0x4e'),_0x26dc6c[_0x544e('0x4f')],_0x24a904[_0x544e('0x50')],md5(_0x24a904[_0x544e('0x50')]));}else{_0x24a904[_0x544e('0x4d')]='';}headers[_0x544e('0x51')]=getAuth(_0x26dc6c);return getUser(_0x26dc6c)[_0x544e('0x16')](function(_0x12bf3a){_0x255e17=_0x12bf3a;logger[_0x544e('0xc')](_0x544e('0x63'),_0x255e17['id']);return getEndUser(_0x26dc6c,_0x24a904[_0x544e('0x68')],_0x24a904['calleridnum']);})[_0x544e('0x16')](function(_0x1a310b){_0x408f0c=_0x1a310b;logger[_0x544e('0xc')](_0x544e('0x52'),_0x408f0c['id']);return getTicket(_0x26dc6c,_0x255e17,_0x408f0c,_0x487c53,_0x24a904);})[_0x544e('0x16')](function(_0x138bc0){if(_0x138bc0){logger[_0x544e('0xc')](_0x544e('0x53'),_0x138bc0['id']);}})[_0x544e('0x5d')](function(_0x35a087){logger[_0x544e('0x5c')]('['+_0x24a904[_0x544e('0x66')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x544e('0x5f')](_0x35a087,{'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 1b7caeb..9198046 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 _0x73b3=['What_Id','Full_Name','$se_module','Call_Duration','mm:ss','answertime','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','stack','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','toUpperCase','/downloads?type=uniqueid&token=','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','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','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','info','GET','format','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','catch','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','First_Name','Last_Name'];(function(_0x136e11,_0x29bd0b){var _0x36d346=function(_0x44cd38){while(--_0x44cd38){_0x136e11['push'](_0x136e11['shift']());}};_0x36d346(++_0x29bd0b);}(_0x73b3,0x183));var _0x373b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x73b3[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x373b('0x0'));var rp=require(_0x373b('0x1'));var md5=require(_0x373b('0x2'));var util=require(_0x373b('0x3'));var intUtil=require(_0x373b('0x4'));var moment=require(_0x373b('0x5'));var Redis=require(_0x373b('0x6'));var BPromise=require(_0x373b('0x7'));var config=require(_0x373b('0x8'));var logger=require(_0x373b('0x9'))(_0x373b('0xa'));config[_0x373b('0xb')]=_['defaults'](config[_0x373b('0xb')],{'host':_0x373b('0xc'),'port':0x18eb});var io=require(_0x373b('0xd'))(new Redis(config[_0x373b('0xb')]));function emit(_0x19ddb1,_0x2af216,_0x14e9d0){io['to'](_0x19ddb1)[_0x373b('0xe')](_0x2af216,_0x14e9d0);}function request(_0x2d277b){logger[_0x373b('0xf')](_0x373b('0x10'),JSON[_0x373b('0x11')](_0x2d277b));return rp(_0x2d277b);}function getCustomFields(_0x38cd26,_0x181a61){var _0x2c60c6={};if(_0x38cd26[_0x373b('0x12')]>0x0){_[_0x373b('0x13')](_0x38cd26,function(_0x6163f1){if(_[_0x373b('0x14')]([_0x373b('0x15'),_0x373b('0x16')],_0x6163f1[_0x373b('0x17')])&&_0x6163f1[_0x373b('0x18')]){_0x2c60c6[_0x6163f1['idField']]=_0x6163f1['content'][_0x373b('0x19')]();}else if(_0x6163f1[_0x373b('0x17')]===_0x373b('0x1a')&&_0x6163f1[_0x373b('0x1b')]&&_0x6163f1[_0x373b('0x18')]&&_0x181a61[_0x6163f1['variableName']]){_0x2c60c6[_0x6163f1[_0x373b('0x18')]]=_0x181a61[_0x6163f1[_0x373b('0x1b')]][_0x373b('0x19')]();}else if(_0x6163f1[_0x373b('0x17')]===_0x373b('0x1c')&&_0x6163f1['Variable']&&_0x6163f1[_0x373b('0x1d')][_0x373b('0x1e')]&&_0x6163f1['idField']&&_0x181a61[_0x6163f1[_0x373b('0x1d')][_0x373b('0x1e')][_0x373b('0x1f')]()]){_0x2c60c6[_0x6163f1[_0x373b('0x18')]]=_0x181a61[_0x6163f1[_0x373b('0x1d')][_0x373b('0x1e')]['toLowerCase']()][_0x373b('0x19')]();}});}return _0x2c60c6;}function getName(_0x2cba54){if(_0x2cba54['indexOf']('\x20')>0x0){var _0x3d29a9=_0x2cba54[_0x373b('0x20')](/ (.+)/);if(_0x3d29a9[0x1]){return _0x3d29a9;}}return[_0x2cba54,_0x2cba54];}var accountsTokens={};function getAccessToken(_0x588432){return new Promise(function(_0x211704,_0x55c901){if(!_[_0x373b('0x21')](accountsTokens[_0x588432['id']])&&!_[_0x373b('0x21')](accountsTokens[_0x588432['id']][_0x373b('0x22')])){if(moment()[_0x373b('0x23')](accountsTokens[_0x588432['id']][_0x373b('0x24')])){_0x211704(accountsTokens[_0x588432['id']][_0x373b('0x22')]);}}var _0x42218f;switch(_0x588432[_0x373b('0x25')]){case'US':_0x42218f=_0x373b('0x26');break;case'AU':_0x42218f=_0x373b('0x27');break;case'EU':_0x42218f=_0x373b('0x28');break;case'IN':_0x42218f=_0x373b('0x29');break;case'CN':_0x42218f=_0x373b('0x2a');break;default:_0x42218f='https://accounts.zoho.eu';break;}var _0x2ef748={'method':_0x373b('0x2b'),'uri':_0x42218f+_0x373b('0x2c'),'qs':{'refresh_token':_0x588432[_0x373b('0x2d')],'client_id':_0x588432[_0x373b('0x2e')],'client_secret':_0x588432[_0x373b('0x2f')],'grant_type':_0x373b('0x30')},'json':!![]};return rp(_0x2ef748)[_0x373b('0x31')](function(_0x51e0bc){accountsTokens[_0x588432['id']]={'access_token':_0x51e0bc['access_token'],'expires_in':moment()[_0x373b('0x32')](_0x51e0bc[_0x373b('0x24')],_0x373b('0x33'))};_0x211704(_0x51e0bc[_0x373b('0x22')]);})['catch'](function(_0x122784){logger[_0x373b('0x34')](_0x373b('0x35'),_0x122784['stack']);_0x55c901(_0x122784);});});}function getUser(_0x3b0dc1,_0x48d58e,_0x3c5b3f,_0x550717){logger[_0x373b('0x36')]('Search\x20user');return request({'method':_0x373b('0x37'),'uri':util[_0x373b('0x38')](_0x373b('0x39'),_0x48d58e),'qs':{'type':_0x373b('0x3a')},'headers':{'Authorization':_0x373b('0x3b')+_0x3b0dc1},'json':!![]})['then'](function(_0x248220){if(_0x248220[_0x373b('0x3c')]){var _0x29d4a3=-0x1;if(_[_0x373b('0x3d')](_0x248220['users'])){if(!_[_0x373b('0x21')](_0x550717)){_0x29d4a3=_[_0x373b('0x3e')](_0x248220['users'],function(_0x5e0a50){return _0x5e0a50[_0x373b('0x3f')]===_0x550717;});}if(_0x29d4a3>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x373b('0x36')](_0x373b('0x40'));_0x29d4a3=_[_0x373b('0x3e')](_0x248220[_0x373b('0x3c')],function(_0x38eddb){return _0x38eddb[_0x373b('0x41')][_0x373b('0x1e')]===_0x373b('0x42');});}return _0x248220[_0x373b('0x3c')][_0x29d4a3];}else{if(_0x248220[_0x373b('0x43')][_0x373b('0x41')]['name']===_0x373b('0x42')){logger[_0x373b('0x36')](_0x373b('0x40'));user=_0x248220[_0x373b('0x43')];return user;}else{logger[_0x373b('0x34')](_0x373b('0x44'),JSON['stringify'](_0x248220));throw new Error(_0x373b('0x45')+JSON['stringify'](_0x248220));}}}else{logger[_0x373b('0x34')](_0x373b('0x44'),JSON[_0x373b('0x11')](_0x248220));throw new Error(_0x373b('0x45')+JSON['stringify'](_0x248220));}})[_0x373b('0x46')](function(_0x56a1a7){console[_0x373b('0x34')](_0x56a1a7);});}function getZohoUser(_0x3c338d,_0x38cee2){return new BPromise(function(_0x496852,_0x48f5f4){request(_0x3c338d)['then'](function(_0x577978){var _0x3a5643=null;if(_0x577978){_0x3a5643=_0x577978[_0x373b('0x47')][0x0];_0x3a5643[_0x373b('0x48')]=_0x38cee2;}_0x496852(_0x3a5643);})['catch'](function(_0x2bb850){_0x48f5f4(_0x2bb850);});});}function createEndUser(_0x599ff2,_0x337b99,_0x1bd85e,_0x4d51ad,_0x3f0431,_0x2fed4e){var _0x1bd85e=getName(_0x1bd85e);return request({'method':_0x373b('0x2b'),'uri':'https://www.zohoapis.'+_0x337b99+_0x373b('0x49')+_[_0x373b('0x4a')](_0x2fed4e[_0x373b('0x4b')])+'s','body':{'data':[{'Last_Name':_0x1bd85e[0x1],'First_Name':_0x1bd85e[0x0],'Phone':_0x4d51ad,'Owner':{'name':!_[_0x373b('0x21')](_0x3f0431[_0x373b('0x4c')][_0x373b('0x1e')])?_0x3f0431['role'][_0x373b('0x1e')]:!_[_0x373b('0x21')](_0x3f0431[_0x373b('0x4d')])?_0x3f0431[_0x373b('0x4d')]+'\x20'+_0x3f0431['last_name']:_0x3f0431[_0x373b('0x4e')],'id':_0x3f0431['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x599ff2},'json':!![]})[_0x373b('0x31')](function(_0x20d8a8){if(_0x20d8a8&&_0x20d8a8[_0x373b('0x47')][0x0][_0x373b('0x4f')]===_0x373b('0x50')){var _0x2dedf0=_0x20d8a8[_0x373b('0x47')][0x0][_0x373b('0x51')];_0x2dedf0[_0x373b('0x48')]=_[_0x373b('0x4a')](_0x2fed4e['moduleCreate'])+'s';return _0x2dedf0;}logger[_0x373b('0x34')](_0x373b('0x44'),JSON['stringify'](data));throw new Error(_0x373b('0x52')+JSON['stringify'](data));})[_0x373b('0x46')](function(_0x5b82f3){console[_0x373b('0x53')](_0x373b('0x54'),_0x5b82f3);});}function getEndUser(_0x22623d,_0x56b854,_0x612bdd,_0x2c586e,_0x5c3b3a,_0x446b6b,_0x465cfa){var _0x49c322={'method':_0x373b('0x37'),'uri':'','headers':{'Authorization':_0x373b('0x3b')+_0x22623d},'json':!![]};switch(_0x465cfa[_0x373b('0x55')]){case _0x373b('0x56'):_0x49c322[_0x373b('0x57')]=_0x373b('0x58')+_0x56b854+_0x373b('0x59')+_0x5c3b3a+'))';return getZohoUser(_0x49c322,_0x373b('0x5a'))['then'](function(_0x382706){if(_0x382706)return _0x382706;_0x49c322[_0x373b('0x57')]=_0x373b('0x58')+_0x56b854+_0x373b('0x5b')+_0x5c3b3a+'))';return getZohoUser(_0x49c322,_0x373b('0x5c'))[_0x373b('0x31')](function(_0x18c0cf){if(_0x18c0cf)return _0x18c0cf;if(_0x465cfa[_0x373b('0x4b')]!=_0x373b('0x5d')){return createEndUser(_0x22623d,_0x56b854,_0x2c586e,_0x5c3b3a,_0x446b6b,_0x465cfa);}else{return{};}});});break;case _0x373b('0x5e'):_0x49c322[_0x373b('0x57')]='https://www.zohoapis.'+_0x56b854+_0x373b('0x59')+_0x5c3b3a+'))';return getZohoUser(_0x49c322,_0x373b('0x5a'))[_0x373b('0x31')](function(_0x1162e9){if(_0x1162e9)return _0x1162e9;if(_0x465cfa['moduleCreate']!=_0x373b('0x5d')){return createEndUser(_0x22623d,_0x56b854,_0x2c586e,_0x5c3b3a,_0x446b6b,_0x465cfa);}else{return{};}});break;case _0x373b('0x5f'):_0x49c322[_0x373b('0x57')]=_0x373b('0x58')+_0x56b854+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5c3b3a+'))';return getZohoUser(_0x49c322,_0x373b('0x5c'))[_0x373b('0x31')](function(_0x1d784f){if(_0x1d784f)return _0x1d784f;if(_0x465cfa[_0x373b('0x4b')]!=_0x373b('0x5d')){return createEndUser(_0x22623d,_0x56b854,_0x2c586e,_0x5c3b3a,_0x446b6b,_0x465cfa);}else{return{};}});break;}}function getCall(_0x2f9207,_0x17484d,_0x52a8bb,_0x456172,_0x4c6526,_0x44d641,_0x25c73d,_0x33aed9){logger['info'](_0x373b('0x60'));var _0x585f38={};_0x585f38['Owner']={'name':!_[_0x373b('0x21')](_0x456172['role'][_0x373b('0x1e')])&&!_[_0x373b('0x21')](_0x456172[_0x373b('0x41')][_0x373b('0x1e')])&&_0x456172['profile'][_0x373b('0x1e')]===_0x373b('0x61')?_0x456172[_0x373b('0x4c')][_0x373b('0x1e')]:!_[_0x373b('0x21')](_0x456172[_0x373b('0x4d')])?_0x456172[_0x373b('0x4d')]+'\x20'+_0x456172[_0x373b('0x4e')]:_0x456172[_0x373b('0x4e')],'id':_0x456172['id']};_0x585f38[_0x373b('0x62')]=intUtil[_0x373b('0x63')](_0x44d641[_0x373b('0x64')],_0x25c73d,'\x20');_0x585f38[_0x373b('0x65')]=intUtil[_0x373b('0x63')](_0x44d641[_0x373b('0x66')],_0x25c73d,'\x0a');if(_0x4c6526['enduserType']===_0x373b('0x5a')){_0x585f38['Who_Id']={'name':!_[_0x373b('0x21')](_0x4c6526['Full_Name'])?_0x4c6526['Full_Name']:!_[_0x373b('0x21')](_0x4c6526[_0x373b('0x67')])?_0x4c6526['First_Name']+'\x20'+_0x4c6526[_0x373b('0x68')]:_0x4c6526[_0x373b('0x68')],'id':_0x4c6526['id']};}if(_0x4c6526['enduserType']==='Leads'){_0x585f38[_0x373b('0x69')]={'name':!_[_0x373b('0x21')](_0x4c6526[_0x373b('0x6a')])?_0x4c6526['Full_Name']:!_[_0x373b('0x21')](_0x4c6526['First_Name'])?_0x4c6526[_0x373b('0x67')]+'\x20'+_0x4c6526[_0x373b('0x68')]:_0x4c6526[_0x373b('0x68')],'id':_0x4c6526['id']};_0x585f38[_0x373b('0x6b')]=_['startCase'](_0x4c6526[_0x373b('0x48')]);}if(_0x25c73d['talktime']){_0x585f38[_0x373b('0x6c')]=moment['utc'](parseInt(_0x25c73d['talktime'])*0x3e8)[_0x373b('0x38')](_0x373b('0x6d'));}else if(_0x25c73d[_0x373b('0x6e')]&&_0x25c73d['endtime']){_0x585f38['Call_Duration']=moment[_0x373b('0x6f')](moment(_0x25c73d[_0x373b('0x70')],_0x373b('0x71'))[_0x373b('0x72')](moment(_0x25c73d[_0x373b('0x73')],_0x373b('0x71'))))[_0x373b('0x38')](_0x373b('0x6d'));}switch(_0x25c73d['lastevent']){case _0x373b('0x74'):_0x585f38[_0x373b('0x75')]=_0x373b('0x76');break;case _0x373b('0x77'):case'connect':_0x585f38['Call_Result']='Answered';break;case _0x373b('0x78'):_0x585f38[_0x373b('0x75')]=_0x373b('0x79');break;case _0x373b('0x7a'):_0x585f38['Call_Result']=_0x373b('0x7b');break;case _0x373b('0x7c'):_0x585f38[_0x373b('0x75')]=_0x373b('0x7d');default:}_0x585f38[_0x373b('0x7e')]=(_0x33aed9===_0x373b('0x7f')?moment(_0x25c73d[_0x373b('0x73')])[_0x373b('0x38')](_0x373b('0x71')):moment(_0x25c73d[_0x373b('0x80')])[_0x373b('0x38')](_0x373b('0x71')))||moment()[_0x373b('0x38')]('YYYY-MM-DDTHH:mm:ss');_0x585f38[_0x373b('0x81')]=_0x33aed9||_0x373b('0x82');_0x585f38=_[_0x373b('0x83')](_0x585f38,getCustomFields(_0x44d641['Fields'],_0x25c73d));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x17484d+_0x373b('0x84'),'headers':{'Authorization':_0x373b('0x3b')+_0x2f9207},'body':{'data':[_0x585f38]},'json':!![]})[_0x373b('0x31')](function(_0x125892){if(_0x125892&&_0x125892['data'][0x0]['code']===_0x373b('0x50')){logger[_0x373b('0x36')](_0x373b('0x85'));return{'id':_0x125892['data'][0x0][_0x373b('0x51')]['id']};}})[_0x373b('0x46')](function(_0x384d1b){logger['info']('err',_0x384d1b[_0x373b('0x86')]);console['log'](_0x373b('0x87'),_0x384d1b);});}exports[_0x373b('0x88')]=function(_0x168c95,_0x100d17,_0xfd7a82,_0x34e439,_0x38845a,_0x4eba01){var _0x131686,_0x2c400e,_0x5ee8a2;_0x4eba01[_0x373b('0x89')]=intUtil[_0x373b('0x8a')](_0x4eba01[_0x373b('0x89')]);_0x4eba01[_0x373b('0x8b')]=intUtil[_0x373b('0x8a')](_0x4eba01[_0x373b('0x8b')]);if(_0x38845a&&_0x38845a[_0x373b('0x8c')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x100d17[_0x373b('0x8d')]=_0x4eba01[_0x373b('0x8b')]+_0x373b('0x8e')+_0x100d17[_0x373b('0x8f')]+'/downloads?type=uniqueid&token='+md5(_0x100d17[_0x373b('0x8f')]);}else{_0x100d17[_0x373b('0x8d')]='';}var _0x21e3e7=_0x4eba01[_0x373b('0x89')]===_0x373b('0x90')?'eu':_0x373b('0x91');return getAccessToken(_0x4eba01)[_0x373b('0x31')](function(_0x176bf7){_0x5ee8a2=_0x176bf7;return getUser(_0x5ee8a2,_0x21e3e7,_0x4eba01,_0x34e439[_0x373b('0x3f')]);})[_0x373b('0x31')](function(_0x4d6cde){_0x131686=_0x4d6cde;logger[_0x373b('0x36')](_0x373b('0x92'),_0x131686['id']);return getEndUser(_0x5ee8a2,_0x21e3e7,_0x4eba01,_0x100d17[_0x373b('0x93')],_0x100d17['calleridnum'],_0x131686,_0xfd7a82);})[_0x373b('0x31')](function(_0x17330a){_0x2c400e=_0x17330a;return getCall(_0x5ee8a2,_0x21e3e7,_0x4eba01,_0x131686,_0x2c400e,_0xfd7a82,_0x100d17,_0x373b('0x82'));})[_0x373b('0x31')](function(_0x4c8198){if(_0x4c8198){logger[_0x373b('0x36')]('The\x20Call\x20ID\x20is:',_0x4c8198['id']);logger[_0x373b('0x36')](_0x373b('0x94'),_0x373b('0x95'));emit(util[_0x373b('0x38')](_0x373b('0x96'),_0x34e439[_0x373b('0x1e')]),_0x373b('0x97'),{'uri':_0x373b('0x98')+_0x4eba01[_0x373b('0x89')]+_0x373b('0x99')+_0x4c8198['id']});}})[_0x373b('0x46')](function(_0x117f7c){logger['error'](_0x373b('0x94'),JSON[_0x373b('0x11')](_0x117f7c));});};exports['outbound']=function(_0x4f0411,_0x416693,_0x28f7ec,_0x1d980d,_0x30815e,_0x26c81e,_0x1c1d9e){var _0x55047c,_0x85f1dd,_0xedded2;_0x26c81e['host']=intUtil['stripTrailingSlash'](_0x26c81e[_0x373b('0x89')]);_0x26c81e[_0x373b('0x8b')]=intUtil['stripTrailingSlash'](_0x26c81e[_0x373b('0x8b')]);if(_0x1c1d9e&&_0x1c1d9e['recordingFormat']&&_0x1c1d9e[_0x373b('0x9a')]!==_0x373b('0x9b')){logger[_0x373b('0x36')](_0x373b('0x9c'),_0x373b('0x9d'));_0x416693[_0x373b('0x8d')]=_0x26c81e[_0x373b('0x8b')]+_0x373b('0x8e')+_0x416693['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x416693[_0x373b('0x8f')]);}var _0x53cba0=_0x26c81e['host']===_0x373b('0x90')?'eu':_0x373b('0x91');return getAccessToken(_0x26c81e)[_0x373b('0x31')](function(_0x43334b){_0xedded2=_0x43334b;return getUser(_0xedded2,_0x53cba0,_0x26c81e,_0x1d980d['email']);})[_0x373b('0x31')](function(_0x178fc9){_0x55047c=_0x178fc9;logger[_0x373b('0x36')](_0x373b('0x92'),_0x55047c['id']);return getEndUser(_0xedded2,_0x53cba0,_0x26c81e,_0x416693[_0x373b('0x9e')],_0x416693[_0x373b('0x9f')],_0x55047c,_0x28f7ec);})[_0x373b('0x31')](function(_0x3f2868){_0x85f1dd=_0x3f2868;return getCall(_0xedded2,_0x53cba0,_0x26c81e,_0x55047c,_0x85f1dd,_0x28f7ec,_0x416693,'Outbound');})[_0x373b('0x31')](function(_0x2e56d6){if(_0x2e56d6){logger['info'](_0x373b('0xa0'),_0x2e56d6['id']);logger['info'](_0x373b('0x9c'),_0x373b('0x95'));emit(util[_0x373b('0x38')]('user:%s',_0x1d980d['name']),_0x373b('0x97'),{'uri':_0x373b('0x98')+_0x26c81e[_0x373b('0x89')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2e56d6['id']});}})[_0x373b('0x46')](function(_0x289ffa){logger[_0x373b('0x34')](_0x373b('0x9c'),JSON[_0x373b('0x11')](_0x289ffa));});};exports['unmanaged']=function(_0x579042,_0x2b8e08,_0x26ad34,_0x2efb2e,_0x1f1f49,_0x31e05c){var _0x9a84ef,_0x176c80,_0x23970a;_0x31e05c[_0x373b('0x89')]=intUtil[_0x373b('0x8a')](_0x31e05c[_0x373b('0x89')]);_0x31e05c['serverUrl']=intUtil[_0x373b('0x8a')](_0x31e05c['serverUrl']);if(_0x1f1f49&&_0x1f1f49[_0x373b('0x8c')]){logger[_0x373b('0x36')]('['+_0x2b8e08['lastevent'][_0x373b('0xa1')]()+']',_0x373b('0x9d'));_0x2b8e08[_0x373b('0x8d')]=_0x31e05c['serverUrl']+_0x373b('0x8e')+_0x2b8e08[_0x373b('0x8f')]+_0x373b('0xa2')+md5(_0x2b8e08[_0x373b('0x8f')]);}else{_0x2b8e08[_0x373b('0x8d')]='';}var _0x3dbdcd=_0x31e05c['host']===_0x373b('0x90')?'eu':_0x373b('0x91');return getAccessToken(_0x31e05c)[_0x373b('0x31')](function(_0x43036d){_0x23970a=_0x43036d;return getUser(_0x23970a,_0x3dbdcd,_0x31e05c);})[_0x373b('0x31')](function(_0x4e22ed){_0x9a84ef=_0x4e22ed;logger['info']('The\x20User\x20ID\x20is:',_0x9a84ef['id']);return getEndUser(_0x23970a,_0x3dbdcd,_0x31e05c,_0x2b8e08[_0x373b('0x93')],_0x2b8e08['calleridnum'],_0x9a84ef,_0x26ad34);})[_0x373b('0x31')](function(_0x50e81f){_0x176c80=_0x50e81f;return getCall(_0x23970a,_0x3dbdcd,_0x31e05c,_0x9a84ef,_0x176c80,_0x26ad34,_0x2b8e08,_0x373b('0x82'));})['then'](function(_0x56bdb9){if(_0x56bdb9){logger[_0x373b('0x36')](_0x373b('0xa0'),_0x56bdb9['id']);}})[_0x373b('0x46')](function(_0x184ede){logger[_0x373b('0x34')]('['+_0x2b8e08[_0x373b('0xa3')][_0x373b('0xa1')]()+']',JSON['stringify'](_0x184ede));});}; \ No newline at end of file +var _0xd5a2=['access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','uri','nothing','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','profile','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','mm:ss','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','rejected','abandoned','Abandoned','timeout','outbound','agentcalledAt','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','uniqueid','zoho.eu','destcalleridnum','Outbound','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','forEach','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xd5a2,0x79));var _0x2d5a=function(_0x2a826d,_0x48e05d){_0x2a826d=_0x2a826d-0x0;var _0x25f799=_0xd5a2[_0x2a826d];return _0x25f799;};'use strict';var _=require('lodash');var rp=require(_0x2d5a('0x0'));var md5=require(_0x2d5a('0x1'));var util=require(_0x2d5a('0x2'));var intUtil=require(_0x2d5a('0x3'));var moment=require(_0x2d5a('0x4'));var Redis=require(_0x2d5a('0x5'));var BPromise=require('bluebird');var config=require(_0x2d5a('0x6'));var logger=require('../../../../config/logger')(_0x2d5a('0x7'));config[_0x2d5a('0x8')]=_[_0x2d5a('0x9')](config['redis'],{'host':_0x2d5a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d5a('0x8')]));function emit(_0x333bbe,_0x28d78c,_0x3ad6d3){io['to'](_0x333bbe)[_0x2d5a('0xb')](_0x28d78c,_0x3ad6d3);}function request(_0x13be3c){logger[_0x2d5a('0xc')](_0x2d5a('0xd'),JSON[_0x2d5a('0xe')](_0x13be3c));return rp(_0x13be3c);}function getCustomFields(_0x4ec94b,_0x1af0a2){var _0x27daa5={};if(_0x4ec94b['length']>0x0){_[_0x2d5a('0xf')](_0x4ec94b,function(_0x46d9be){if(_[_0x2d5a('0x10')](['string',_0x2d5a('0x11')],_0x46d9be[_0x2d5a('0x12')])&&_0x46d9be['idField']){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x46d9be[_0x2d5a('0x14')][_0x2d5a('0x15')]();}else if(_0x46d9be[_0x2d5a('0x12')]===_0x2d5a('0x16')&&_0x46d9be['variableName']&&_0x46d9be[_0x2d5a('0x13')]&&_0x1af0a2[_0x46d9be[_0x2d5a('0x17')]]){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x1af0a2[_0x46d9be['variableName']][_0x2d5a('0x15')]();}else if(_0x46d9be[_0x2d5a('0x12')]===_0x2d5a('0x18')&&_0x46d9be[_0x2d5a('0x19')]&&_0x46d9be[_0x2d5a('0x19')][_0x2d5a('0x1a')]&&_0x46d9be[_0x2d5a('0x13')]&&_0x1af0a2[_0x46d9be[_0x2d5a('0x19')][_0x2d5a('0x1a')][_0x2d5a('0x1b')]()]){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x1af0a2[_0x46d9be['Variable'][_0x2d5a('0x1a')][_0x2d5a('0x1b')]()][_0x2d5a('0x15')]();}});}return _0x27daa5;}function getName(_0x424b0b){if(_0x424b0b['indexOf']('\x20')>0x0){var _0x3f08ce=_0x424b0b[_0x2d5a('0x1c')](/ (.+)/);if(_0x3f08ce[0x1]){return _0x3f08ce;}}return[_0x424b0b,_0x424b0b];}var accountsTokens={};function getAccessToken(_0x5159ba){return new Promise(function(_0x53c24f,_0x40f634){if(!_[_0x2d5a('0x1d')](accountsTokens[_0x5159ba['id']])&&!_[_0x2d5a('0x1d')](accountsTokens[_0x5159ba['id']][_0x2d5a('0x1e')])){if(moment()[_0x2d5a('0x1f')](accountsTokens[_0x5159ba['id']][_0x2d5a('0x20')])){_0x53c24f(accountsTokens[_0x5159ba['id']]['access_token']);}}var _0x27e084;switch(_0x5159ba[_0x2d5a('0x21')]){case'US':_0x27e084=_0x2d5a('0x22');break;case'AU':_0x27e084=_0x2d5a('0x23');break;case'EU':_0x27e084='https://accounts.zoho.eu';break;case'IN':_0x27e084=_0x2d5a('0x24');break;case'CN':_0x27e084=_0x2d5a('0x25');break;default:_0x27e084=_0x2d5a('0x26');break;}var _0x4de853={'method':_0x2d5a('0x27'),'uri':_0x27e084+_0x2d5a('0x28'),'qs':{'refresh_token':_0x5159ba[_0x2d5a('0x29')],'client_id':_0x5159ba[_0x2d5a('0x2a')],'client_secret':_0x5159ba[_0x2d5a('0x2b')],'grant_type':_0x2d5a('0x2c')},'json':!![]};return rp(_0x4de853)['then'](function(_0x15bb96){accountsTokens[_0x5159ba['id']]={'access_token':_0x15bb96[_0x2d5a('0x1e')],'expires_in':moment()[_0x2d5a('0x2d')](_0x15bb96['expires_in'],_0x2d5a('0x2e'))};_0x53c24f(_0x15bb96[_0x2d5a('0x1e')]);})[_0x2d5a('0x2f')](function(_0x56eca8){logger[_0x2d5a('0x30')](_0x2d5a('0x31'),_0x56eca8[_0x2d5a('0x32')]);_0x40f634(_0x56eca8);});});}function getUser(_0x55a28a,_0x5d7a25,_0x13b6fe,_0x1e64d3){logger['info'](_0x2d5a('0x33'));return request({'method':_0x2d5a('0x34'),'uri':util[_0x2d5a('0x35')](_0x2d5a('0x36'),_0x5d7a25),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x2d5a('0x37')+_0x55a28a},'json':!![]})[_0x2d5a('0x38')](function(_0x273004){if(_0x273004[_0x2d5a('0x39')]){var _0xb391c3=-0x1;if(_['isArrayLikeObject'](_0x273004['users'])){if(!_[_0x2d5a('0x1d')](_0x1e64d3)){_0xb391c3=_['findIndex'](_0x273004[_0x2d5a('0x39')],function(_0x575f50){return _0x575f50[_0x2d5a('0x3a')]===_0x1e64d3;});}if(_0xb391c3>=0x0){logger[_0x2d5a('0x3b')](_0x2d5a('0x3c'));}else{logger['info'](_0x2d5a('0x3d'));_0xb391c3=_[_0x2d5a('0x3e')](_0x273004[_0x2d5a('0x39')],function(_0x2bd230){return _0x2bd230['profile'][_0x2d5a('0x1a')]===_0x2d5a('0x3f');});}return _0x273004[_0x2d5a('0x39')][_0xb391c3];}else{if(_0x273004['user']['profile'][_0x2d5a('0x1a')]===_0x2d5a('0x3f')){logger[_0x2d5a('0x3b')](_0x2d5a('0x3d'));user=_0x273004[_0x2d5a('0x40')];return user;}else{logger[_0x2d5a('0x30')](_0x2d5a('0x41'),JSON[_0x2d5a('0xe')](_0x273004));throw new Error(_0x2d5a('0x42')+JSON[_0x2d5a('0xe')](_0x273004));}}}else{logger[_0x2d5a('0x30')]('The\x20failing\x20result\x20is',JSON[_0x2d5a('0xe')](_0x273004));throw new Error(_0x2d5a('0x42')+JSON['stringify'](_0x273004));}})['catch'](function(_0x2c8a9a){console[_0x2d5a('0x30')](_0x2c8a9a);});}function getZohoUser(_0x2c8b88,_0x5ba0b1){return new BPromise(function(_0x15fc97,_0x4c3130){request(_0x2c8b88)[_0x2d5a('0x38')](function(_0x5e0b56){var _0x4a5738=null;if(_0x5e0b56){_0x4a5738=_0x5e0b56[_0x2d5a('0x43')][0x0];_0x4a5738[_0x2d5a('0x44')]=_0x5ba0b1;}_0x15fc97(_0x4a5738);})[_0x2d5a('0x2f')](function(_0x5c84c3){_0x4c3130(_0x5c84c3);});});}function createEndUser(_0x324f63,_0x12154b,_0x44bac4,_0x42eed6,_0x2e636a,_0x1292ab){var _0x44bac4=getName(_0x44bac4);return request({'method':_0x2d5a('0x27'),'uri':_0x2d5a('0x45')+_0x12154b+'/crm/v2/'+_[_0x2d5a('0x46')](_0x1292ab[_0x2d5a('0x47')])+'s','body':{'data':[{'Last_Name':_0x44bac4[0x1],'First_Name':_0x44bac4[0x0],'Phone':_0x42eed6,'Owner':{'name':!_[_0x2d5a('0x1d')](_0x2e636a[_0x2d5a('0x48')][_0x2d5a('0x1a')])?_0x2e636a[_0x2d5a('0x48')][_0x2d5a('0x1a')]:!_[_0x2d5a('0x1d')](_0x2e636a['first_name'])?_0x2e636a[_0x2d5a('0x49')]+'\x20'+_0x2e636a[_0x2d5a('0x4a')]:_0x2e636a[_0x2d5a('0x4a')],'id':_0x2e636a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x324f63},'json':!![]})[_0x2d5a('0x38')](function(_0x3cde27){if(_0x3cde27&&_0x3cde27[_0x2d5a('0x43')][0x0]['code']===_0x2d5a('0x4b')){var _0x25a98a=_0x3cde27[_0x2d5a('0x43')][0x0][_0x2d5a('0x4c')];_0x25a98a[_0x2d5a('0x44')]=_[_0x2d5a('0x46')](_0x1292ab[_0x2d5a('0x47')])+'s';return _0x25a98a;}logger[_0x2d5a('0x30')]('The\x20failing\x20result\x20is',JSON[_0x2d5a('0xe')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x1c5c25){console[_0x2d5a('0x4d')](_0x2d5a('0x4e'),_0x1c5c25);});}function getEndUser(_0x229a6f,_0x10f95d,_0x2da65d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357){var _0x372bda={'method':_0x2d5a('0x34'),'uri':'','headers':{'Authorization':_0x2d5a('0x37')+_0x229a6f},'json':!![]};switch(_0x12d357[_0x2d5a('0x4f')]){case _0x2d5a('0x50'):_0x372bda['uri']=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x51')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x52'))[_0x2d5a('0x38')](function(_0x34af97){if(_0x34af97)return _0x34af97;_0x372bda['uri']='https://www.zohoapis.'+_0x10f95d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x53'))[_0x2d5a('0x38')](function(_0x3be1d2){if(_0x3be1d2)return _0x3be1d2;if(_0x12d357[_0x2d5a('0x47')]!='nothing'){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});});break;case _0x2d5a('0x54'):_0x372bda[_0x2d5a('0x55')]=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x51')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x52'))[_0x2d5a('0x38')](function(_0x92a36f){if(_0x92a36f)return _0x92a36f;if(_0x12d357[_0x2d5a('0x47')]!=_0x2d5a('0x56')){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});break;case'lead':_0x372bda[_0x2d5a('0x55')]=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x57')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x53'))[_0x2d5a('0x38')](function(_0x15529d){if(_0x15529d)return _0x15529d;if(_0x12d357['moduleCreate']!=_0x2d5a('0x56')){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});break;}}function getCall(_0x3bfc43,_0x171bc9,_0x4abf1b,_0x3d1d69,_0x18e3ee,_0x2423f9,_0x2a5d6d,_0x1045b3){logger[_0x2d5a('0x3b')]('Creating\x20new\x20call...');var _0x22e183={};_0x22e183[_0x2d5a('0x58')]={'name':!_[_0x2d5a('0x1d')](_0x3d1d69[_0x2d5a('0x48')][_0x2d5a('0x1a')])&&!_['isNil'](_0x3d1d69[_0x2d5a('0x59')]['name'])&&_0x3d1d69[_0x2d5a('0x59')][_0x2d5a('0x1a')]==='administrator'?_0x3d1d69[_0x2d5a('0x48')]['name']:!_['isNil'](_0x3d1d69[_0x2d5a('0x49')])?_0x3d1d69['first_name']+'\x20'+_0x3d1d69['last_name']:_0x3d1d69['last_name'],'id':_0x3d1d69['id']};_0x22e183[_0x2d5a('0x5a')]=intUtil['getString'](_0x2423f9[_0x2d5a('0x5b')],_0x2a5d6d,'\x20');_0x22e183[_0x2d5a('0x5c')]=intUtil['getString'](_0x2423f9[_0x2d5a('0x5d')],_0x2a5d6d,'\x0a');if(_0x18e3ee[_0x2d5a('0x44')]===_0x2d5a('0x52')){_0x22e183[_0x2d5a('0x5e')]={'name':!_['isNil'](_0x18e3ee['Full_Name'])?_0x18e3ee[_0x2d5a('0x5f')]:!_[_0x2d5a('0x1d')](_0x18e3ee[_0x2d5a('0x60')])?_0x18e3ee[_0x2d5a('0x60')]+'\x20'+_0x18e3ee['Last_Name']:_0x18e3ee['Last_Name'],'id':_0x18e3ee['id']};}if(_0x18e3ee[_0x2d5a('0x44')]===_0x2d5a('0x53')){_0x22e183[_0x2d5a('0x61')]={'name':!_[_0x2d5a('0x1d')](_0x18e3ee['Full_Name'])?_0x18e3ee[_0x2d5a('0x5f')]:!_[_0x2d5a('0x1d')](_0x18e3ee[_0x2d5a('0x60')])?_0x18e3ee[_0x2d5a('0x60')]+'\x20'+_0x18e3ee['Last_Name']:_0x18e3ee[_0x2d5a('0x62')],'id':_0x18e3ee['id']};_0x22e183[_0x2d5a('0x63')]=_[_0x2d5a('0x46')](_0x18e3ee[_0x2d5a('0x44')]);}if(_0x2a5d6d[_0x2d5a('0x64')]){_0x22e183[_0x2d5a('0x65')]=moment['utc'](parseInt(_0x2a5d6d['talktime'])*0x3e8)[_0x2d5a('0x35')](_0x2d5a('0x66'));}else if(_0x2a5d6d['answertime']&&_0x2a5d6d['endtime']){_0x22e183[_0x2d5a('0x65')]=moment[_0x2d5a('0x67')](moment(_0x2a5d6d['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2d5a('0x68')](moment(_0x2a5d6d[_0x2d5a('0x69')],_0x2d5a('0x6a'))))['format'](_0x2d5a('0x66'));}switch(_0x2a5d6d['lastevent']){case _0x2d5a('0x6b'):_0x22e183[_0x2d5a('0x6c')]=_0x2d5a('0x6d');break;case _0x2d5a('0x6e'):case _0x2d5a('0x6f'):_0x22e183[_0x2d5a('0x6c')]='Answered';break;case _0x2d5a('0x70'):_0x22e183[_0x2d5a('0x6c')]='Rejected';break;case _0x2d5a('0x71'):_0x22e183[_0x2d5a('0x6c')]=_0x2d5a('0x72');break;case _0x2d5a('0x73'):_0x22e183['Call_Result']='Timeout';default:}_0x22e183['Call_Start_Time']=(_0x1045b3===_0x2d5a('0x74')?moment(_0x2a5d6d[_0x2d5a('0x69')])[_0x2d5a('0x35')](_0x2d5a('0x6a')):moment(_0x2a5d6d[_0x2d5a('0x75')])[_0x2d5a('0x35')](_0x2d5a('0x6a')))||moment()[_0x2d5a('0x35')](_0x2d5a('0x6a'));_0x22e183['Call_Type']=_0x1045b3||_0x2d5a('0x76');_0x22e183=_['merge'](_0x22e183,getCustomFields(_0x2423f9[_0x2d5a('0x77')],_0x2a5d6d));return request({'method':_0x2d5a('0x27'),'uri':'https://www.zohoapis.'+_0x171bc9+_0x2d5a('0x78'),'headers':{'Authorization':_0x2d5a('0x37')+_0x3bfc43},'body':{'data':[_0x22e183]},'json':!![]})[_0x2d5a('0x38')](function(_0x4103de){if(_0x4103de&&_0x4103de[_0x2d5a('0x43')][0x0]['code']==='SUCCESS'){logger[_0x2d5a('0x3b')](_0x2d5a('0x79'));return{'id':_0x4103de[_0x2d5a('0x43')][0x0]['details']['id']};}})[_0x2d5a('0x2f')](function(_0x3c1e5f){logger[_0x2d5a('0x3b')](_0x2d5a('0x7a'),_0x3c1e5f[_0x2d5a('0x32')]);console[_0x2d5a('0x4d')](_0x2d5a('0x7a'),_0x3c1e5f);});}exports[_0x2d5a('0x7b')]=function(_0x344a25,_0x65b116,_0x9b3a98,_0x2d9649,_0x29c7a3,_0x2bf74c){var _0x6dff37,_0xc19024,_0x54ae91;_0x2bf74c['host']=intUtil['stripTrailingSlash'](_0x2bf74c[_0x2d5a('0x7c')]);_0x2bf74c[_0x2d5a('0x7d')]=intUtil[_0x2d5a('0x7e')](_0x2bf74c[_0x2d5a('0x7d')]);if(_0x29c7a3&&_0x29c7a3['monitor_format']){logger[_0x2d5a('0x3b')](_0x2d5a('0x7f'),'Recording\x20is\x20enabled!');_0x65b116[_0x2d5a('0x80')]=_0x2bf74c['serverUrl']+'/api/voice/recordings/'+_0x65b116['uniqueid']+_0x2d5a('0x81')+md5(_0x65b116['uniqueid']);}else{_0x65b116['recordingURL']='';}var _0x171659=_0x2bf74c[_0x2d5a('0x7c')]==='zoho.eu'?'eu':_0x2d5a('0x82');return getAccessToken(_0x2bf74c)[_0x2d5a('0x38')](function(_0x4e72f){_0x54ae91=_0x4e72f;return getUser(_0x54ae91,_0x171659,_0x2bf74c,_0x2d9649[_0x2d5a('0x3a')]);})['then'](function(_0x542eef){_0x6dff37=_0x542eef;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x6dff37['id']);return getEndUser(_0x54ae91,_0x171659,_0x2bf74c,_0x65b116['calleridname'],_0x65b116[_0x2d5a('0x84')],_0x6dff37,_0x9b3a98);})[_0x2d5a('0x38')](function(_0x3853ad){_0xc19024=_0x3853ad;return getCall(_0x54ae91,_0x171659,_0x2bf74c,_0x6dff37,_0xc19024,_0x9b3a98,_0x65b116,'Inbound');})['then'](function(_0x3c904b){if(_0x3c904b){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x3c904b['id']);logger[_0x2d5a('0x3b')]('[QUEUE]',_0x2d5a('0x86'));emit(util[_0x2d5a('0x35')](_0x2d5a('0x87'),_0x2d9649[_0x2d5a('0x1a')]),'trigger:browser:url',{'uri':_0x2d5a('0x88')+_0x2bf74c[_0x2d5a('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3c904b['id']});}})[_0x2d5a('0x2f')](function(_0xc1faca){logger[_0x2d5a('0x30')](_0x2d5a('0x7f'),JSON[_0x2d5a('0xe')](_0xc1faca));});};exports[_0x2d5a('0x74')]=function(_0x59162f,_0x17558a,_0x58d75d,_0x556abe,_0x462a53,_0x1aa0ba,_0x91e943){var _0x544e96,_0x259b0a,_0xd60f88;_0x1aa0ba['host']=intUtil[_0x2d5a('0x7e')](_0x1aa0ba[_0x2d5a('0x7c')]);_0x1aa0ba['serverUrl']=intUtil[_0x2d5a('0x7e')](_0x1aa0ba[_0x2d5a('0x7d')]);if(_0x91e943&&_0x91e943[_0x2d5a('0x89')]&&_0x91e943['recordingFormat']!==_0x2d5a('0x8a')){logger[_0x2d5a('0x3b')](_0x2d5a('0x8b'),'Recording\x20is\x20enabled!');_0x17558a['recordingURL']=_0x1aa0ba['serverUrl']+_0x2d5a('0x8c')+_0x17558a[_0x2d5a('0x8d')]+_0x2d5a('0x81')+md5(_0x17558a[_0x2d5a('0x8d')]);}var _0x44fcdf=_0x1aa0ba[_0x2d5a('0x7c')]===_0x2d5a('0x8e')?'eu':_0x2d5a('0x82');return getAccessToken(_0x1aa0ba)[_0x2d5a('0x38')](function(_0x25f6e4){_0xd60f88=_0x25f6e4;return getUser(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x556abe['email']);})[_0x2d5a('0x38')](function(_0x2510d4){_0x544e96=_0x2510d4;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x544e96['id']);return getEndUser(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x17558a['destcalleridname'],_0x17558a[_0x2d5a('0x8f')],_0x544e96,_0x58d75d);})[_0x2d5a('0x38')](function(_0x280134){_0x259b0a=_0x280134;return getCall(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x544e96,_0x259b0a,_0x58d75d,_0x17558a,_0x2d5a('0x90'));})[_0x2d5a('0x38')](function(_0x5737c1){if(_0x5737c1){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x5737c1['id']);logger[_0x2d5a('0x3b')](_0x2d5a('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2d5a('0x35')](_0x2d5a('0x87'),_0x556abe[_0x2d5a('0x1a')]),_0x2d5a('0x91'),{'uri':_0x2d5a('0x88')+_0x1aa0ba[_0x2d5a('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5737c1['id']});}})[_0x2d5a('0x2f')](function(_0x70da12){logger['error'](_0x2d5a('0x8b'),JSON[_0x2d5a('0xe')](_0x70da12));});};exports[_0x2d5a('0x92')]=function(_0x5af6e3,_0xb38db3,_0x4cc706,_0x6d2d61,_0x44adec,_0x4473e6){var _0x310451,_0x1a0eaa,_0x563561;_0x4473e6[_0x2d5a('0x7c')]=intUtil[_0x2d5a('0x7e')](_0x4473e6[_0x2d5a('0x7c')]);_0x4473e6[_0x2d5a('0x7d')]=intUtil[_0x2d5a('0x7e')](_0x4473e6[_0x2d5a('0x7d')]);if(_0x44adec&&_0x44adec[_0x2d5a('0x93')]){logger[_0x2d5a('0x3b')]('['+_0xb38db3[_0x2d5a('0x94')][_0x2d5a('0x95')]()+']',_0x2d5a('0x96'));_0xb38db3[_0x2d5a('0x80')]=_0x4473e6[_0x2d5a('0x7d')]+'/api/voice/recordings/'+_0xb38db3['uniqueid']+_0x2d5a('0x81')+md5(_0xb38db3[_0x2d5a('0x8d')]);}else{_0xb38db3['recordingURL']='';}var _0x479bd9=_0x4473e6[_0x2d5a('0x7c')]===_0x2d5a('0x8e')?'eu':_0x2d5a('0x82');return getAccessToken(_0x4473e6)[_0x2d5a('0x38')](function(_0x10aa69){_0x563561=_0x10aa69;return getUser(_0x563561,_0x479bd9,_0x4473e6);})[_0x2d5a('0x38')](function(_0x3330ba){_0x310451=_0x3330ba;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x310451['id']);return getEndUser(_0x563561,_0x479bd9,_0x4473e6,_0xb38db3['calleridname'],_0xb38db3[_0x2d5a('0x84')],_0x310451,_0x4cc706);})['then'](function(_0x5b116b){_0x1a0eaa=_0x5b116b;return getCall(_0x563561,_0x479bd9,_0x4473e6,_0x310451,_0x1a0eaa,_0x4cc706,_0xb38db3,_0x2d5a('0x76'));})[_0x2d5a('0x38')](function(_0x68a958){if(_0x68a958){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x68a958['id']);}})[_0x2d5a('0x2f')](function(_0x583858){logger[_0x2d5a('0x30')]('['+_0xb38db3[_0x2d5a('0x94')]['toUpperCase']()+']',JSON[_0x2d5a('0xe')](_0x583858));});}; \ 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 5c0d423..a1e2e8b 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 _0x874d=['../../../../config/logger','trigger','exec','data2','Script','data3','render','error','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x874d,0x1d1));var _0xd874=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x874d[_0x602ca8];return _0x26e8ab;};'use strict';var util=require(_0xd874('0x0'));var sh=require(_0xd874('0x1'));var Mustache=require(_0xd874('0x2'));var logger=require(_0xd874('0x3'))(_0xd874('0x4'));exports[_0xd874('0x5')]=function(_0x4503c1,_0x4b53e1){var _0x5b66a3=_0x4503c1[_0xd874('0x6')]?_0x4503c1[_0xd874('0x6')]:_0xd874('0x7');var _0x5b98f9=_0x4503c1[_0xd874('0x8')]?Mustache[_0xd874('0x9')](_0x4503c1['data3'],_0x4b53e1):_0x4b53e1;sh[_0xd874('0x5')](_0x5b98f9,function(_0x29b2e8,_0x348551,_0x4509d6){if(_0x29b2e8!==0x0){logger[_0xd874('0xa')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5b66a3,_0x5b98f9,_0x29b2e8,_0x4509d6));}else{logger[_0xd874('0xb')](util['format'](_0xd874('0xc'),_0x5b66a3,_0x5b98f9,_0x348551));}});}; \ No newline at end of file +var _0x2c6b=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1295a1,_0x5e11a7){var _0x868b0c=function(_0x24a52e){while(--_0x24a52e){_0x1295a1['push'](_0x1295a1['shift']());}};_0x868b0c(++_0x5e11a7);}(_0x2c6b,0x1ab));var _0xb2c6=function(_0x5de505,_0xee5804){_0x5de505=_0x5de505-0x0;var _0x1df98e=_0x2c6b[_0x5de505];return _0x1df98e;};'use strict';var util=require(_0xb2c6('0x0'));var sh=require(_0xb2c6('0x1'));var Mustache=require(_0xb2c6('0x2'));var logger=require(_0xb2c6('0x3'))(_0xb2c6('0x4'));exports[_0xb2c6('0x5')]=function(_0x3a40ca,_0x2e82c0){var _0xa5d270=_0x3a40ca[_0xb2c6('0x6')]?_0x3a40ca[_0xb2c6('0x6')]:_0xb2c6('0x7');var _0x1de330=_0x3a40ca[_0xb2c6('0x8')]?Mustache['render'](_0x3a40ca[_0xb2c6('0x8')],_0x2e82c0):_0x2e82c0;sh[_0xb2c6('0x5')](_0x1de330,function(_0x51752c,_0x2fbcf2,_0x5407bb){if(_0x51752c!==0x0){logger[_0xb2c6('0x9')](util[_0xb2c6('0xa')](_0xb2c6('0xb'),_0xa5d270,_0x1de330,_0x51752c,_0x5407bb));}else{logger['info'](util[_0xb2c6('0xa')](_0xb2c6('0xc'),_0xa5d270,_0x1de330,_0x2fbcf2));}});}; \ 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 b5d9b2a..a5602f4 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 _0x68a6=['stack','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode','name','message','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','parse','error'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x68a6,0xbe));var _0x668a=function(_0x1781d3,_0x20e76e){_0x1781d3=_0x1781d3-0x0;var _0x48f652=_0x68a6[_0x1781d3];return _0x48f652;};'use strict';var rp=require('request-promise');var util=require(_0x668a('0x0'));var _=require(_0x668a('0x1'));var Mustache=require(_0x668a('0x2'));var logger=require(_0x668a('0x3'))(_0x668a('0x4'));exports['exec']=function(_0x36b31a,_0x3236af){var _0x1cd358,_0x102115;var _0x36309e={'method':_0x36b31a[_0x668a('0x5')][_0x668a('0x6')](),'uri':Mustache[_0x668a('0x7')](_0x36b31a[_0x668a('0x8')],_0x3236af),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x36b31a[_0x668a('0x9')])===_0x668a('0xa')&&parseInt(_0x36b31a[_0x668a('0x9')])>=0x1&&parseInt(_0x36b31a[_0x668a('0x9')])<=0xa?parseInt(_0x36b31a[_0x668a('0x9')])*0x3e8:0x5*0x3e8};try{_0x36309e[_0x668a('0xb')]=_0x36b31a['data6']?JSON[_0x668a('0xc')](Mustache[_0x668a('0x7')](_0x36b31a['data6'],_0x3236af)):{};}catch(_0x2afc2c){logger[_0x668a('0xd')](_0x2afc2c[_0x668a('0xe')]);}switch(_0x36b31a['data1'][_0x668a('0x6')]()){case'GET':case _0x668a('0xf'):_0x1cd358=null;_0x36309e['qs']=_0x3236af;break;case _0x668a('0x10'):case _0x668a('0x11'):if(_0x36b31a[_0x668a('0x12')]){try{_0x1cd358=JSON[_0x668a('0xc')](Mustache[_0x668a('0x7')](_0x36b31a[_0x668a('0x12')],_0x3236af));_0x36309e['body']=_0x1cd358;}catch(_0x5a81a7){logger['error'](_0x5a81a7[_0x668a('0xe')]);logger['error'](_0x668a('0x13'));}}else{_0x1cd358=_0x3236af;_0x36309e['body']=_0x1cd358;}break;}logger[_0x668a('0x14')](util['format'](_0x668a('0x15'),_0x36b31a[_0x668a('0x5')],_0x36b31a['data2'],JSON[_0x668a('0x16')](_0x36309e)));rp(_0x36309e)[_0x668a('0x17')](function(_0x542a78){_0x1cd358=!_[_0x668a('0x18')](_0x1cd358)?_0x668a('0x19')+_0x1cd358:'';_0x102115=typeof _0x542a78[_0x668a('0x1a')]===_0x668a('0x1b')?JSON[_0x668a('0x16')](_0x542a78[_0x668a('0x1a')]):_0x542a78['body'];logger[_0x668a('0x14')](util[_0x668a('0x1c')](_0x668a('0x1d'),_0x36b31a[_0x668a('0x5')],_0x36b31a[_0x668a('0x8')],_0x542a78['statusCode'],_0x102115));})[_0x668a('0x1e')](function(_0x648ee4){logger[_0x668a('0xd')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x36b31a[_0x668a('0x5')],_0x36b31a[_0x668a('0x8')],_0x648ee4[_0x668a('0x1f')],_0x648ee4[_0x668a('0x20')],_0x648ee4[_0x668a('0x21')]));});}; \ No newline at end of file +var _0x3a13=['render','error','stack','data1','toUpperCase','GET','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','request-promise','lodash','mustache','../../../../config/logger','trigger','data2','data5','headers','data6','parse'];(function(_0x1f9e8d,_0xcd553c){var _0x4fa024=function(_0x18f7ff){while(--_0x18f7ff){_0x1f9e8d['push'](_0x1f9e8d['shift']());}};_0x4fa024(++_0xcd553c);}(_0x3a13,0x176));var _0x33a1=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x3a13[_0x3f0b30];return _0x2748a5;};'use strict';var rp=require(_0x33a1('0x0'));var util=require('util');var _=require(_0x33a1('0x1'));var Mustache=require(_0x33a1('0x2'));var logger=require(_0x33a1('0x3'))(_0x33a1('0x4'));exports['exec']=function(_0x35fc06,_0x43894d){var _0x5e8dd5,_0x315db9;var _0x224342={'method':_0x35fc06['data1']['toUpperCase'](),'uri':Mustache['render'](_0x35fc06[_0x33a1('0x5')],_0x43894d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35fc06[_0x33a1('0x6')])==='number'&&parseInt(_0x35fc06['data5'])>=0x1&&parseInt(_0x35fc06[_0x33a1('0x6')])<=0xa?parseInt(_0x35fc06[_0x33a1('0x6')])*0x3e8:0x5*0x3e8};try{_0x224342[_0x33a1('0x7')]=_0x35fc06[_0x33a1('0x8')]?JSON[_0x33a1('0x9')](Mustache[_0x33a1('0xa')](_0x35fc06[_0x33a1('0x8')],_0x43894d)):{};}catch(_0x3ae689){logger[_0x33a1('0xb')](_0x3ae689[_0x33a1('0xc')]);}switch(_0x35fc06[_0x33a1('0xd')][_0x33a1('0xe')]()){case _0x33a1('0xf'):case'DELETE':_0x5e8dd5=null;_0x224342['qs']=_0x43894d;break;case'POST':case _0x33a1('0x10'):if(_0x35fc06[_0x33a1('0x11')]){try{_0x5e8dd5=JSON[_0x33a1('0x9')](Mustache[_0x33a1('0xa')](_0x35fc06['data7'],_0x43894d));_0x224342[_0x33a1('0x12')]=_0x5e8dd5;}catch(_0x205c22){logger['error'](_0x205c22[_0x33a1('0xc')]);logger['error'](_0x33a1('0x13'));}}else{_0x5e8dd5=_0x43894d;_0x224342[_0x33a1('0x12')]=_0x5e8dd5;}break;}logger[_0x33a1('0x14')](util[_0x33a1('0x15')](_0x33a1('0x16'),_0x35fc06[_0x33a1('0xd')],_0x35fc06['data2'],JSON[_0x33a1('0x17')](_0x224342)));rp(_0x224342)[_0x33a1('0x18')](function(_0xe55a1a){_0x5e8dd5=!_[_0x33a1('0x19')](_0x5e8dd5)?_0x33a1('0x1a')+_0x5e8dd5:'';_0x315db9=typeof _0xe55a1a[_0x33a1('0x12')]===_0x33a1('0x1b')?JSON[_0x33a1('0x17')](_0xe55a1a[_0x33a1('0x12')]):_0xe55a1a['body'];logger[_0x33a1('0x14')](util[_0x33a1('0x15')](_0x33a1('0x1c'),_0x35fc06[_0x33a1('0xd')],_0x35fc06['data2'],_0xe55a1a[_0x33a1('0x1d')],_0x315db9));})[_0x33a1('0x1e')](function(_0x4da420){logger[_0x33a1('0xb')](util[_0x33a1('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x35fc06[_0x33a1('0xd')],_0x35fc06[_0x33a1('0x5')],_0x4da420[_0x33a1('0x1d')],_0x4da420[_0x33a1('0x1f')],_0x4da420['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8a96c9f..7835fd4 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 _0xaee1=['exports','bluebird','../../config/logger','client','http','Request','debug','rpc','routing','error','message','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaee1,0x109));var _0x1aee=function(_0x5dfa8e,_0xe4a802){_0x5dfa8e=_0x5dfa8e-0x0;var _0x3ba1e9=_0xaee1[_0x5dfa8e];return _0x3ba1e9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1aee('0x0'));var logger=require(_0x1aee('0x1'))('routing');var client=jayson[_0x1aee('0x2')][_0x1aee('0x3')]({'port':0x2329});client[_0x1aee('0x4')]=function(_0x644ac1,_0x3442a8){return new BPromise(function(_0x540c2a,_0x987392){return client['request'](_0x644ac1,_0x3442a8)['then'](function(_0x58677e){logger[_0x1aee('0x5')](_0x1aee('0x6'),_0x1aee('0x7'),_0x644ac1,_0x3442a8,_0x58677e);if(_0x58677e[_0x1aee('0x8')]){logger[_0x1aee('0x8')](_0x1aee('0x6'),_0x1aee('0x7'),_0x644ac1,_0x58677e[_0x1aee('0x8')][_0x1aee('0x9')],_0x3442a8);return _0x987392(_0x58677e[_0x1aee('0x8')][_0x1aee('0x9')]);}else{return _0x540c2a(_0x58677e['result']);}})[_0x1aee('0xa')](function(_0x423a17){logger[_0x1aee('0x8')](_0x1aee('0x6'),_0x1aee('0x7'),_0x644ac1,_0x423a17,_0x3442a8);return _0x987392(_0x423a17);});});};module[_0x1aee('0xb')]=client; \ No newline at end of file +var _0x96d4=['client','http','Request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x49dcfc,_0x1904ea){var _0x22374c=function(_0x36b875){while(--_0x36b875){_0x49dcfc['push'](_0x49dcfc['shift']());}};_0x22374c(++_0x1904ea);}(_0x96d4,0xdd));var _0x496d=function(_0x1458c2,_0x5e1de9){_0x1458c2=_0x1458c2-0x0;var _0x562d7a=_0x96d4[_0x1458c2];return _0x562d7a;};'use strict';var jayson=require(_0x496d('0x0'));var BPromise=require(_0x496d('0x1'));var logger=require(_0x496d('0x2'))(_0x496d('0x3'));var client=jayson[_0x496d('0x4')][_0x496d('0x5')]({'port':0x2329});client[_0x496d('0x6')]=function(_0x3efd4f,_0x5f2065){return new BPromise(function(_0x5166c3,_0x21d821){return client['request'](_0x3efd4f,_0x5f2065)[_0x496d('0x7')](function(_0x454206){logger[_0x496d('0x8')](_0x496d('0x9'),'routing',_0x3efd4f,_0x5f2065,_0x454206);if(_0x454206['error']){logger[_0x496d('0xa')](_0x496d('0x9'),_0x496d('0x3'),_0x3efd4f,_0x454206['error'][_0x496d('0xb')],_0x5f2065);return _0x21d821(_0x454206[_0x496d('0xa')]['message']);}else{return _0x5166c3(_0x454206[_0x496d('0xc')]);}})[_0x496d('0xd')](function(_0x3b15eb){logger[_0x496d('0xa')](_0x496d('0x9'),_0x496d('0x3'),_0x3efd4f,_0x3b15eb,_0x5f2065);return _0x21d821(_0x3b15eb);});});};module[_0x496d('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c48276d..798f893 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 _0x1f31=['initMailAccounts','refresh','listen','loginMailFrequency','./server','./realtime','./lib/email','resolve','then'];(function(_0x584d11,_0x417bb8){var _0x27032d=function(_0x49eee5){while(--_0x49eee5){_0x584d11['push'](_0x584d11['shift']());}};_0x27032d(++_0x417bb8);}(_0x1f31,0x8b));var _0x11f3=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x1f31[_0x316904];return _0xfa9a21;};'use strict';var BPromise=require('bluebird');var server=require(_0x11f3('0x0'));var Realtime=require(_0x11f3('0x1'));var EmailChannel=require(_0x11f3('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x11f3('0x3')]()[_0x11f3('0x4')](mailAccount['getMailAccounts']())[_0x11f3('0x4')](realtime[_0x11f3('0x5')]())['then'](function(){email[_0x11f3('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x11f3('0x7')](realtime,email)[_0x11f3('0x4')](function(){return initRealtime();})[_0x11f3('0x4')](function(){return setting['getSettings']();})['then'](function(_0x41a8c8){return setInterval(initRealtime,_0x41a8c8[_0x11f3('0x8')]*0x3e8);})['catch'](function(_0x1c9f16){console['log'](_0x1c9f16);});}main(); \ No newline at end of file +var _0x5a02=['catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','listen','getSettings','loginMailFrequency'];(function(_0xae2cbf,_0x1446a6){var _0x31931b=function(_0x2717af){while(--_0x2717af){_0xae2cbf['push'](_0xae2cbf['shift']());}};_0x31931b(++_0x1446a6);}(_0x5a02,0x152));var _0x25a0=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x5a02[_0x7275e9];return _0x17b99d;};'use strict';var BPromise=require('bluebird');var server=require(_0x25a0('0x0'));var Realtime=require(_0x25a0('0x1'));var EmailChannel=require(_0x25a0('0x2'));var mailAccount=require(_0x25a0('0x3'));var setting=require(_0x25a0('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x25a0('0x5')]()[_0x25a0('0x6')](mailAccount[_0x25a0('0x7')]())[_0x25a0('0x6')](realtime[_0x25a0('0x8')]())[_0x25a0('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x25a0('0x9')](realtime,email)[_0x25a0('0x6')](function(){return initRealtime();})[_0x25a0('0x6')](function(){return setting[_0x25a0('0xa')]();})[_0x25a0('0x6')](function(_0x1591a9){return setInterval(initRealtime,_0x1591a9[_0x25a0('0xb')]*0x3e8);})[_0x25a0('0xc')](function(_0x59eaea){console[_0x25a0('0xd')](_0x59eaea);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index dc137c4..7aad097 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 _0x845e=['mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','prototype','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel'];(function(_0x4be2f0,_0x4b9591){var _0x59467f=function(_0x2092fb){while(--_0x2092fb){_0x4be2f0['push'](_0x4be2f0['shift']());}};_0x59467f(++_0x4b9591);}(_0x845e,0x129));var _0xe845=function(_0x394bd2,_0x27272a){_0x394bd2=_0x394bd2-0x0;var _0x42a455=_0x845e[_0x394bd2];return _0x42a455;};'use strict';var _=require(_0xe845('0x0'));var moment=require(_0xe845('0x1'));var BPromise=require('bluebird');var md5=require(_0xe845('0x2'));var Redis=require(_0xe845('0x3'));var config=require(_0xe845('0x4'));var logger=require(_0xe845('0x5'))(_0xe845('0x6'));config['redis']=_[_0xe845('0x7')](config[_0xe845('0x8')],{'host':_0xe845('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xe845('0xa'));var EmailSmtp=require(_0xe845('0xb'));var mailAccount=require(_0xe845('0xc'));var md5Accounts={};function EmailChannel(_0x2e71ba){logger[_0xe845('0xd')](_0xe845('0xe'));this[_0xe845('0xf')]=_0x2e71ba[_0xe845('0xf')];this[_0xe845('0x10')]={};this[_0xe845('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xe845('0x12')]=function(_0x48d731){var _0x803f6b=this[_0xe845('0xf')][_0x48d731];var _0x3b2fec={'id':_0x803f6b['id'],'name':_0x803f6b[_0xe845('0x13')],'key':_0x803f6b[_0xe845('0x14')],'active':_0x803f6b[_0xe845('0x15')],'Imap':{'status':_0x803f6b[_0xe845('0x16')][_0xe845('0x17')],'messageStatus':_0x803f6b[_0xe845('0x16')][_0xe845('0x18')],'total':_0x803f6b['Imap']['total']}};if(_[_0xe845('0x19')](md5Accounts[_0x48d731])){md5Accounts[_0x48d731]={};}var _0x3c4def=md5(JSON[_0xe845('0x1a')](_0x3b2fec));if(md5Accounts[_0x48d731]['md5']!==_0x3c4def){md5Accounts[_0x48d731]['md5']=_0x3c4def;io[_0xe845('0x12')]('mailAccount:update',_0x3b2fec);}};EmailChannel[_0xe845('0x1b')]['refresh']=function(_0x77a7f9){for(var _0x2e3e2a in _0x77a7f9){if(_0x77a7f9['hasOwnProperty'](_0x2e3e2a)){if(_0x77a7f9[_0x2e3e2a][_0xe845('0x16')]&&_0x77a7f9[_0x2e3e2a][_0xe845('0x15')]){var _0x1ea561=_0x77a7f9[_0x2e3e2a][_0xe845('0x16')];if(!this['imapAccounts']['hasOwnProperty'](_0x1ea561['id'])){this[_0xe845('0x10')][_0x1ea561['id']]=new EmailImap(_0x1ea561,_0x77a7f9[_0x2e3e2a][_0xe845('0x6')]);this[_0xe845('0x10')][_0x1ea561['id']]['on'](_0xe845('0x1c'),this[_0xe845('0x1d')][_0xe845('0x1e')](this,_0x2e3e2a));this[_0xe845('0x10')][_0x1ea561['id']]['on'](_0xe845('0x6'),this[_0xe845('0x1f')]['bind'](this,_0x2e3e2a));this['imapAccounts'][_0x1ea561['id']]['on'](_0xe845('0x20'),this['handleImapEnd'][_0xe845('0x1e')](this,_0x2e3e2a));this[_0xe845('0x10')][_0x1ea561['id']]['on'](_0xe845('0x21'),this[_0xe845('0x22')][_0xe845('0x1e')](this,_0x2e3e2a));}}else{if(_[_0xe845('0x19')](this['mailAccounts'][_0x2e3e2a][_0xe845('0x16')])){this[_0xe845('0xf')][_0x2e3e2a][_0xe845('0x16')]={};}this[_0xe845('0xf')][_0x2e3e2a][_0xe845('0x16')][_0xe845('0x17')]=_0xe845('0x23');this[_0xe845('0xf')][_0x2e3e2a]['Imap'][_0xe845('0x18')]='';this[_0xe845('0x12')](_0x2e3e2a);}}}};EmailChannel[_0xe845('0x1b')][_0xe845('0x1d')]=function(_0x55baf6,_0x3d438e){if(this[_0xe845('0xf')][_0x55baf6]){this[_0xe845('0xf')][_0x55baf6]['Imap']['status']='connected';this[_0xe845('0xf')][_0x55baf6]['Imap']['messageStatus']=_0x3d438e[_0xe845('0x13')];if(_0x3d438e[_0xe845('0x24')]){this[_0xe845('0xf')][_0x55baf6][_0xe845('0x16')][_0xe845('0x25')]=_0x3d438e[_0xe845('0x24')]['total'];}return this[_0xe845('0x12')](_0x55baf6);}};EmailChannel[_0xe845('0x1b')][_0xe845('0x1f')]=function(_0x1f05c3,_0x5e4ec4){logger[_0xe845('0xd')](_0xe845('0x26'),_0x5e4ec4['firstName'],_0x5e4ec4[_0xe845('0x27')],_0x5e4ec4[_0xe845('0x28')],_0x1f05c3);if(this['mailAccounts'][_0x1f05c3]){return mailAccount[_0xe845('0x29')](_0x1f05c3,_0x5e4ec4)['then'](function(_0x199ce2){if(_0x199ce2){logger[_0xe845('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0xe845('0x2a')](function(_0x5ca25a){logger['error'](_0xe845('0x2b'),JSON[_0xe845('0x1a')](_0x5ca25a));});}};EmailChannel[_0xe845('0x1b')]['handleImapEnd']=function(_0x19a66a){if(this[_0xe845('0xf')][_0x19a66a]&&this['mailAccounts'][_0x19a66a][_0xe845('0x16')]){if(this[_0xe845('0x10')][this['mailAccounts'][_0x19a66a][_0xe845('0x16')]['id']]){delete this[_0xe845('0x10')][this[_0xe845('0xf')][_0x19a66a][_0xe845('0x16')]['id']];}this[_0xe845('0xf')][_0x19a66a][_0xe845('0x16')][_0xe845('0x2c')]=moment();this['emit'](_0x19a66a);}};EmailChannel[_0xe845('0x1b')]['handleImapError']=function(_0x2eccaa,_0x168d03){if(this['mailAccounts'][_0x2eccaa]){this[_0xe845('0xf')][_0x2eccaa][_0xe845('0x16')][_0xe845('0x17')]=_0xe845('0x21');this['mailAccounts'][_0x2eccaa][_0xe845('0x16')][_0xe845('0x18')]=_0x168d03;return this['emit'](_0x2eccaa);}};EmailChannel[_0xe845('0x1b')]['sendMail']=function(_0x35d96f,_0x50867c){return this['smtp'][_0xe845('0x2d')](_0x35d96f,_0x50867c);};EmailChannel[_0xe845('0x1b')][_0xe845('0x2e')]=function(_0xa1806a){var _0x217c93=this;if(this[_0xe845('0xf')][_0xa1806a['id']]){if(_['isNil'](this[_0xe845('0xf')][_0xa1806a['id']][_0xe845('0x2f')])){this['mailAccounts'][_0xa1806a['id']][_0xe845('0x2f')]={};}this[_0xe845('0xf')][_0xa1806a['id']]['Smtp'][_0xe845('0x2c')]=moment();return new BPromise(function(_0x5ad4c9,_0x2aad9e){return _0x217c93[_0xe845('0x11')][_0xe845('0x30')](_0xa1806a)[_0xe845('0x31')](function(_0x2c3d4b){_0x217c93[_0xe845('0xf')][_0xa1806a['id']]['Smtp']['status']=_0xe845('0x32');_0x217c93[_0xe845('0xf')][_0xa1806a['id']]['Smtp']['messageStatus']='';_0x217c93[_0xe845('0x12')](_0xa1806a['id']);_0x5ad4c9(_0x2c3d4b);})['catch'](function(_0x1ddd8c){_0x217c93[_0xe845('0xf')][_0xa1806a['id']][_0xe845('0x2f')][_0xe845('0x17')]=_0xe845('0x21');_0x217c93['mailAccounts'][_0xa1806a['id']][_0xe845('0x2f')][_0xe845('0x18')]=_0x1ddd8c;_0x217c93[_0xe845('0x12')](_0xa1806a['id']);_0x2aad9e(_0x1ddd8c);});});}return this[_0xe845('0x11')]['verify'](_0xa1806a);};module[_0xe845('0x33')]=EmailChannel; \ No newline at end of file +var _0x11e0=['Smtp','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','messageStatus','messages','firstName','lastName','from','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send'];(function(_0xe2f878,_0x451892){var _0x43ba4e=function(_0x20e1ee){while(--_0x20e1ee){_0xe2f878['push'](_0xe2f878['shift']());}};_0x43ba4e(++_0x451892);}(_0x11e0,0x96));var _0x011e=function(_0x59810d,_0x557a67){_0x59810d=_0x59810d-0x0;var _0x49c35a=_0x11e0[_0x59810d];return _0x49c35a;};'use strict';var _=require(_0x011e('0x0'));var moment=require('moment');var BPromise=require(_0x011e('0x1'));var md5=require(_0x011e('0x2'));var Redis=require(_0x011e('0x3'));var config=require(_0x011e('0x4'));var logger=require(_0x011e('0x5'))(_0x011e('0x6'));config[_0x011e('0x7')]=_[_0x011e('0x8')](config[_0x011e('0x7')],{'host':_0x011e('0x9'),'port':0x18eb});var io=require(_0x011e('0xa'))(new Redis(config[_0x011e('0x7')]));var EmailImap=require(_0x011e('0xb'));var EmailSmtp=require(_0x011e('0xc'));var mailAccount=require(_0x011e('0xd'));var md5Accounts={};function EmailChannel(_0x2e4e35){logger[_0x011e('0xe')]('start\x20email\x20channel');this[_0x011e('0xf')]=_0x2e4e35[_0x011e('0xf')];this[_0x011e('0x10')]={};this[_0x011e('0x11')]=new EmailSmtp();}EmailChannel[_0x011e('0x12')][_0x011e('0x13')]=function(_0x419628){var _0x4e7e3c=this[_0x011e('0xf')][_0x419628];var _0x1f2c0a={'id':_0x4e7e3c['id'],'name':_0x4e7e3c[_0x011e('0x14')],'key':_0x4e7e3c['key'],'active':_0x4e7e3c[_0x011e('0x15')],'Imap':{'status':_0x4e7e3c[_0x011e('0x16')][_0x011e('0x17')],'messageStatus':_0x4e7e3c[_0x011e('0x16')]['messageStatus'],'total':_0x4e7e3c[_0x011e('0x16')][_0x011e('0x18')]}};if(_[_0x011e('0x19')](md5Accounts[_0x419628])){md5Accounts[_0x419628]={};}var _0x1e64cd=md5(JSON[_0x011e('0x1a')](_0x1f2c0a));if(md5Accounts[_0x419628][_0x011e('0x2')]!==_0x1e64cd){md5Accounts[_0x419628]['md5']=_0x1e64cd;io[_0x011e('0x13')](_0x011e('0x1b'),_0x1f2c0a);}};EmailChannel[_0x011e('0x12')]['refresh']=function(_0x2bee0a){for(var _0x2fd54a in _0x2bee0a){if(_0x2bee0a[_0x011e('0x1c')](_0x2fd54a)){if(_0x2bee0a[_0x2fd54a][_0x011e('0x16')]&&_0x2bee0a[_0x2fd54a][_0x011e('0x15')]){var _0x30631a=_0x2bee0a[_0x2fd54a][_0x011e('0x16')];if(!this[_0x011e('0x10')][_0x011e('0x1c')](_0x30631a['id'])){this['imapAccounts'][_0x30631a['id']]=new EmailImap(_0x30631a,_0x2bee0a[_0x2fd54a]['email']);this[_0x011e('0x10')][_0x30631a['id']]['on'](_0x011e('0x1d'),this[_0x011e('0x1e')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on'](_0x011e('0x6'),this[_0x011e('0x20')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on']('end',this[_0x011e('0x21')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on']('error',this[_0x011e('0x22')][_0x011e('0x1f')](this,_0x2fd54a));}}else{if(_[_0x011e('0x19')](this[_0x011e('0xf')][_0x2fd54a]['Imap'])){this['mailAccounts'][_0x2fd54a][_0x011e('0x16')]={};}this[_0x011e('0xf')][_0x2fd54a][_0x011e('0x16')][_0x011e('0x17')]=_0x011e('0x23');this['mailAccounts'][_0x2fd54a]['Imap'][_0x011e('0x24')]='';this[_0x011e('0x13')](_0x2fd54a);}}}};EmailChannel[_0x011e('0x12')]['handleImapBox']=function(_0x3c6666,_0x19cc16){if(this['mailAccounts'][_0x3c6666]){this[_0x011e('0xf')][_0x3c6666][_0x011e('0x16')][_0x011e('0x17')]='connected';this[_0x011e('0xf')][_0x3c6666]['Imap'][_0x011e('0x24')]=_0x19cc16['name'];if(_0x19cc16[_0x011e('0x25')]){this[_0x011e('0xf')][_0x3c6666][_0x011e('0x16')][_0x011e('0x18')]=_0x19cc16[_0x011e('0x25')]['total'];}return this[_0x011e('0x13')](_0x3c6666);}};EmailChannel[_0x011e('0x12')][_0x011e('0x20')]=function(_0x4e430f,_0x5d9e28){logger[_0x011e('0xe')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5d9e28[_0x011e('0x26')],_0x5d9e28[_0x011e('0x27')],_0x5d9e28[_0x011e('0x28')],_0x4e430f);if(this['mailAccounts'][_0x4e430f]){return mailAccount['notify'](_0x4e430f,_0x5d9e28)['then'](function(_0x315f1b){if(_0x315f1b){logger[_0x011e('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0x011e('0x29')](function(_0x20810c){logger[_0x011e('0x2a')](_0x011e('0x2b'),JSON[_0x011e('0x1a')](_0x20810c));});}};EmailChannel[_0x011e('0x12')][_0x011e('0x21')]=function(_0x5e9076){if(this[_0x011e('0xf')][_0x5e9076]&&this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]){if(this[_0x011e('0x10')][this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['id']]){delete this[_0x011e('0x10')][this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['id']];}this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['lastSync']=moment();this[_0x011e('0x13')](_0x5e9076);}};EmailChannel[_0x011e('0x12')][_0x011e('0x22')]=function(_0x5a88f1,_0x57d296){if(this[_0x011e('0xf')][_0x5a88f1]){this[_0x011e('0xf')][_0x5a88f1][_0x011e('0x16')]['status']=_0x011e('0x2a');this['mailAccounts'][_0x5a88f1]['Imap'][_0x011e('0x24')]=_0x57d296;return this[_0x011e('0x13')](_0x5a88f1);}};EmailChannel[_0x011e('0x12')][_0x011e('0x2c')]=function(_0x59e99e,_0x2303c3){return this[_0x011e('0x11')][_0x011e('0x2d')](_0x59e99e,_0x2303c3);};EmailChannel[_0x011e('0x12')]['verifySmtp']=function(_0x3ea499){var _0x2c58a7=this;if(this[_0x011e('0xf')][_0x3ea499['id']]){if(_[_0x011e('0x19')](this[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')])){this[_0x011e('0xf')][_0x3ea499['id']]['Smtp']={};}this[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')]['lastSync']=moment();return new BPromise(function(_0x52116d,_0x41e998){return _0x2c58a7[_0x011e('0x11')][_0x011e('0x2f')](_0x3ea499)['then'](function(_0xaa63d3){_0x2c58a7[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x17')]='verified';_0x2c58a7[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x24')]='';_0x2c58a7[_0x011e('0x13')](_0x3ea499['id']);_0x52116d(_0xaa63d3);})[_0x011e('0x29')](function(_0xf273ad){_0x2c58a7['mailAccounts'][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x17')]=_0x011e('0x2a');_0x2c58a7['mailAccounts'][_0x3ea499['id']]['Smtp'][_0x011e('0x24')]=_0xf273ad;_0x2c58a7[_0x011e('0x13')](_0x3ea499['id']);_0x41e998(_0xf273ad);});});}return this['smtp'][_0x011e('0x2f')](_0x3ea499);};module[_0x011e('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 36d17cc..6879742 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 _0x190b=['user','password','port','tls','required','host','getHost','service','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','end','handleSimpleParser','handleMessageEnd','parser','textCode','hasOwnProperty','exports','path','util','imap','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil'];(function(_0x495c7b,_0x579346){var _0x28a4a5=function(_0x24174d){while(--_0x24174d){_0x495c7b['push'](_0x495c7b['shift']());}};_0x28a4a5(++_0x579346);}(_0x190b,0x1ab));var _0xb190=function(_0x81a6e0,_0xe0818e){_0x81a6e0=_0x81a6e0-0x0;var _0x1ea5cd=_0x190b[_0x81a6e0];return _0x1ea5cd;};'use strict';var fs=require('fs');var path=require(_0xb190('0x0'));var util=require(_0xb190('0x1'));var Imap=require(_0xb190('0x2'));var _=require('lodash');var rs=require(_0xb190('0x3'));var simpleParser=require(_0xb190('0x4'))[_0xb190('0x5')];var Iconv=require(_0xb190('0x6'))['Iconv'];var EventEmitter=require(_0xb190('0x7'))[_0xb190('0x8')];var utils=require(_0xb190('0x9'));var logger=require(_0xb190('0xa'))(_0xb190('0xb'));function EmailImap(_0x25624a,_0x55959f){this['mailbox']=_0xb190('0xc');this[_0xb190('0xd')]=this[_0xb190('0xe')](_0x25624a,_0x55959f);this[_0xb190('0x2')]=new Imap(this['account']);this['imap']['once'](_0xb190('0xf'),this[_0xb190('0x10')][_0xb190('0x11')](this));this['imap'][_0xb190('0x12')]('end',this[_0xb190('0x13')][_0xb190('0x11')](this));this[_0xb190('0x2')]['on'](_0xb190('0x14'),this[_0xb190('0x15')][_0xb190('0x11')](this));this[_0xb190('0x2')][_0xb190('0x16')]();}util[_0xb190('0x17')](EmailImap,EventEmitter);EmailImap[_0xb190('0x18')][_0xb190('0xe')]=function(_0x4b21d1,_0x3e4c78){var _0x51d620={'connTimeout':_0x4b21d1[_0xb190('0x19')]?_0x4b21d1['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4b21d1['authTimeout']?_0x4b21d1[_0xb190('0x1a')]*0x3e8:0x1388};if(_[_0xb190('0x1b')](_0x4b21d1['service'])){if(_0x4b21d1['authentication']){_0x51d620[_0xb190('0x1c')]=_0x4b21d1[_0xb190('0x1c')];_0x51d620[_0xb190('0x1d')]=_0x4b21d1[_0xb190('0x1d')];}_0x51d620['host']=_0x4b21d1['host'];_0x51d620[_0xb190('0x1e')]=_0x4b21d1['port']||0x3e1;if(_0x4b21d1[_0xb190('0x1f')]){_0x51d620[_0xb190('0x1f')]=!![];}else{_0x51d620['tls']=![];_0x51d620['autotls']=_0xb190('0x20');}}else{_0x51d620['user']=_0x4b21d1[_0xb190('0x1c')];_0x51d620[_0xb190('0x1d')]=_0x4b21d1[_0xb190('0x1d')];_0x51d620[_0xb190('0x21')]=utils[_0xb190('0x22')](_0x4b21d1[_0xb190('0x23')]);_0x51d620['port']=0x3e1;_0x51d620[_0xb190('0x1f')]=!![];}_0x51d620[_0xb190('0xb')]=_0x3e4c78||_0x4b21d1['user']||_0xb190('0x24');return _0x51d620;};EmailImap[_0xb190('0x18')][_0xb190('0x10')]=function(){this[_0xb190('0x2')][_0xb190('0x25')](this[_0xb190('0x26')],![],this[_0xb190('0x27')][_0xb190('0x11')](this));};EmailImap[_0xb190('0x18')][_0xb190('0x27')]=function(_0x53660d,_0x3c1af5){if(_0x53660d){this[_0xb190('0x15')](_0x53660d,!![]);}else{this[_0xb190('0x28')](_0xb190('0x29'),_0x3c1af5);this[_0xb190('0x2a')]();}};EmailImap[_0xb190('0x18')][_0xb190('0x2b')]=function(_0xe58fbc){if(_0xe58fbc){this[_0xb190('0x15')](_0xe58fbc,!![]);}else{this[_0xb190('0x2')]['end']();}};EmailImap[_0xb190('0x18')]['readUnseen']=function(){this[_0xb190('0x2')][_0xb190('0x2c')]([_0xb190('0x2d')],this[_0xb190('0x2e')][_0xb190('0x11')](this));};EmailImap['prototype'][_0xb190('0x2e')]=function(_0x4f635c,_0x1a20ca){if(_0x4f635c){this[_0xb190('0x15')](_0x4f635c,!![]);}else{if(_0x1a20ca[_0xb190('0x2f')]){try{var _0xec1a2d=this[_0xb190('0x2')][_0xb190('0x30')](_0x1a20ca,{'bodies':'','markSeen':!![]});_0xec1a2d['on'](_0xb190('0x31'),this['handleFetchMessage'][_0xb190('0x11')](this));_0xec1a2d[_0xb190('0x12')]('error',this[_0xb190('0x32')]['bind'](this));_0xec1a2d[_0xb190('0x12')]('end',this[_0xb190('0x33')][_0xb190('0x11')](this));}catch(_0x1362ff){logger[_0xb190('0x14')](_0x1362ff);}}else{this[_0xb190('0x2')][_0xb190('0x34')](!![],this['handleCloseBox'][_0xb190('0x11')](this));}}};EmailImap['prototype'][_0xb190('0x35')]=function(_0x14ff23,_0x3f67b4){_0x14ff23['on'](_0xb190('0x36'),this[_0xb190('0x37')][_0xb190('0x11')](this));_0x14ff23[_0xb190('0x12')](_0xb190('0x38'),this[_0xb190('0x39')][_0xb190('0x11')](this));_0x14ff23[_0xb190('0x12')](_0xb190('0x3a'),this['handleMessageEnd'][_0xb190('0x11')](this));};EmailImap[_0xb190('0x18')][_0xb190('0x37')]=function(_0xd107cc,_0x1d3b3c){simpleParser(_0xd107cc,{'Iconv':Iconv},this[_0xb190('0x3b')][_0xb190('0x11')](this));};EmailImap[_0xb190('0x18')][_0xb190('0x39')]=function(_0x2a9b9b){};EmailImap[_0xb190('0x18')][_0xb190('0x3c')]=function(){};EmailImap[_0xb190('0x18')][_0xb190('0x3b')]=function(_0x391912,_0x39f162){if(_0x391912){logger['error'](_0x391912);}else{var _0xaa2535=this;utils[_0xb190('0x3d')](this['account'],_0x39f162,function(_0x3ff8e3){_0xaa2535[_0xb190('0x28')](_0xb190('0xb'),_0x3ff8e3);});}};EmailImap['prototype'][_0xb190('0x33')]=function(){this[_0xb190('0x2')][_0xb190('0x34')](!![],this[_0xb190('0x2b')][_0xb190('0x11')](this));};EmailImap[_0xb190('0x18')]['handleFetchError']=function(_0x55ee7f){this[_0xb190('0x15')](_0x55ee7f);this[_0xb190('0x2')]['closeBox'](!![],this[_0xb190('0x2b')][_0xb190('0x11')](this));};EmailImap[_0xb190('0x18')][_0xb190('0x13')]=function(){this[_0xb190('0x28')](_0xb190('0x3a'));};EmailImap['prototype'][_0xb190('0x15')]=function(_0xbeed69,_0x38a736){logger['error'](_0xb190('0x15'),this[_0xb190('0xd')][_0xb190('0xb')],JSON['stringify'](_0xbeed69));var _0x5d0521='';if(_0xbeed69){if(_0xbeed69['textCode']){_0x5d0521=_0xbeed69[_0xb190('0x3e')];}else{for(var _0x25eb0c in _0xbeed69){if(_0xbeed69[_0xb190('0x3f')](_0x25eb0c)){_0x5d0521+=_['upperFirst'](_0x25eb0c)+':\x20'+_0xbeed69[_0x25eb0c]+'\x0a';}}}}if(_0x38a736){this[_0xb190('0x2')][_0xb190('0x3a')]();}else{this['emit'](_0xb190('0x14'),_0x5d0521);this['emit'](_0xb190('0x3a'));}};module[_0xb190('0x40')]=EmailImap; \ No newline at end of file +var _0xc8bf=['error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','search','handleReadUnseen','length','message','handleFetchError','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','closeBox','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','getAccount','account','once','ready','bind','end','handleEnd'];(function(_0x6dcfe7,_0x44b8e8){var _0x6d0996=function(_0x79d45d){while(--_0x79d45d){_0x6dcfe7['push'](_0x6dcfe7['shift']());}};_0x6d0996(++_0x44b8e8);}(_0xc8bf,0x181));var _0xfc8b=function(_0x201479,_0x242234){_0x201479=_0x201479-0x0;var _0x17b19e=_0xc8bf[_0x201479];return _0x17b19e;};'use strict';var fs=require('fs');var path=require(_0xfc8b('0x0'));var util=require(_0xfc8b('0x1'));var Imap=require(_0xfc8b('0x2'));var _=require(_0xfc8b('0x3'));var rs=require(_0xfc8b('0x4'));var simpleParser=require(_0xfc8b('0x5'))[_0xfc8b('0x6')];var Iconv=require(_0xfc8b('0x7'))['Iconv'];var EventEmitter=require(_0xfc8b('0x8'))[_0xfc8b('0x9')];var utils=require(_0xfc8b('0xa'));var logger=require(_0xfc8b('0xb'))(_0xfc8b('0xc'));function EmailImap(_0x4a1e34,_0x29dc20){this['mailbox']=_0xfc8b('0xd');this['account']=this[_0xfc8b('0xe')](_0x4a1e34,_0x29dc20);this['imap']=new Imap(this[_0xfc8b('0xf')]);this[_0xfc8b('0x2')][_0xfc8b('0x10')](_0xfc8b('0x11'),this['handleReady'][_0xfc8b('0x12')](this));this['imap'][_0xfc8b('0x10')](_0xfc8b('0x13'),this[_0xfc8b('0x14')][_0xfc8b('0x12')](this));this[_0xfc8b('0x2')]['on'](_0xfc8b('0x15'),this[_0xfc8b('0x16')][_0xfc8b('0x12')](this));this[_0xfc8b('0x2')]['connect']();}util[_0xfc8b('0x17')](EmailImap,EventEmitter);EmailImap[_0xfc8b('0x18')]['getAccount']=function(_0x78eb76,_0x4a06fc){var _0x1b8697={'connTimeout':_0x78eb76[_0xfc8b('0x19')]?_0x78eb76[_0xfc8b('0x19')]*0x3e8:0x2710,'authTimeout':_0x78eb76[_0xfc8b('0x1a')]?_0x78eb76['authTimeout']*0x3e8:0x1388};if(_[_0xfc8b('0x1b')](_0x78eb76[_0xfc8b('0x1c')])){if(_0x78eb76['authentication']){_0x1b8697[_0xfc8b('0x1d')]=_0x78eb76[_0xfc8b('0x1d')];_0x1b8697[_0xfc8b('0x1e')]=_0x78eb76['password'];}_0x1b8697[_0xfc8b('0x1f')]=_0x78eb76[_0xfc8b('0x1f')];_0x1b8697['port']=_0x78eb76[_0xfc8b('0x20')]||0x3e1;if(_0x78eb76[_0xfc8b('0x21')]){_0x1b8697[_0xfc8b('0x21')]=!![];}else{_0x1b8697[_0xfc8b('0x21')]=![];_0x1b8697[_0xfc8b('0x22')]='required';}}else{_0x1b8697['user']=_0x78eb76[_0xfc8b('0x1d')];_0x1b8697[_0xfc8b('0x1e')]=_0x78eb76[_0xfc8b('0x1e')];_0x1b8697[_0xfc8b('0x1f')]=utils[_0xfc8b('0x23')](_0x78eb76[_0xfc8b('0x1c')]);_0x1b8697[_0xfc8b('0x20')]=0x3e1;_0x1b8697[_0xfc8b('0x21')]=!![];}_0x1b8697['email']=_0x4a06fc||_0x78eb76['user']||_0xfc8b('0x24');return _0x1b8697;};EmailImap['prototype'][_0xfc8b('0x25')]=function(){this[_0xfc8b('0x2')][_0xfc8b('0x26')](this['mailbox'],![],this[_0xfc8b('0x27')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x59b2bf,_0x5345ed){if(_0x59b2bf){this[_0xfc8b('0x16')](_0x59b2bf,!![]);}else{this[_0xfc8b('0x28')](_0xfc8b('0x29'),_0x5345ed);this['readUnseen']();}};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x2a')]=function(_0x3fd826){if(_0x3fd826){this[_0xfc8b('0x16')](_0x3fd826,!![]);}else{this['imap'][_0xfc8b('0x13')]();}};EmailImap[_0xfc8b('0x18')]['readUnseen']=function(){this[_0xfc8b('0x2')][_0xfc8b('0x2b')](['UNSEEN'],this[_0xfc8b('0x2c')][_0xfc8b('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0xf0d853,_0x5821e0){if(_0xf0d853){this[_0xfc8b('0x16')](_0xf0d853,!![]);}else{if(_0x5821e0[_0xfc8b('0x2d')]){try{var _0x274f1d=this[_0xfc8b('0x2')]['fetch'](_0x5821e0,{'bodies':'','markSeen':!![]});_0x274f1d['on'](_0xfc8b('0x2e'),this['handleFetchMessage'][_0xfc8b('0x12')](this));_0x274f1d[_0xfc8b('0x10')](_0xfc8b('0x15'),this[_0xfc8b('0x2f')][_0xfc8b('0x12')](this));_0x274f1d[_0xfc8b('0x10')]('end',this['handleFetchEnd'][_0xfc8b('0x12')](this));}catch(_0xc49e28){logger['error'](_0xc49e28);}}else{this[_0xfc8b('0x2')]['closeBox'](!![],this[_0xfc8b('0x2a')]['bind'](this));}}};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x30')]=function(_0x1a2cc1,_0x36f3a4){_0x1a2cc1['on'](_0xfc8b('0x31'),this[_0xfc8b('0x32')][_0xfc8b('0x12')](this));_0x1a2cc1[_0xfc8b('0x10')]('attributes',this[_0xfc8b('0x33')][_0xfc8b('0x12')](this));_0x1a2cc1['once'](_0xfc8b('0x13'),this[_0xfc8b('0x34')][_0xfc8b('0x12')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x39425b,_0x2ca818){simpleParser(_0x39425b,{'Iconv':Iconv},this[_0xfc8b('0x35')]['bind'](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x33')]=function(_0x16b11c){};EmailImap[_0xfc8b('0x18')]['handleMessageEnd']=function(){};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x35')]=function(_0x2d4b3b,_0x1b492b){if(_0x2d4b3b){logger[_0xfc8b('0x15')](_0x2d4b3b);}else{var _0x28d963=this;utils['parser'](this[_0xfc8b('0xf')],_0x1b492b,function(_0x539ab4){_0x28d963[_0xfc8b('0x28')](_0xfc8b('0xc'),_0x539ab4);});}};EmailImap[_0xfc8b('0x18')]['handleFetchEnd']=function(){this[_0xfc8b('0x2')]['closeBox'](!![],this[_0xfc8b('0x2a')][_0xfc8b('0x12')](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x2f')]=function(_0x2eb0d5){this['handleError'](_0x2eb0d5);this['imap'][_0xfc8b('0x36')](!![],this[_0xfc8b('0x2a')][_0xfc8b('0x12')](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x14')]=function(){this[_0xfc8b('0x28')](_0xfc8b('0x13'));};EmailImap['prototype'][_0xfc8b('0x16')]=function(_0x5c9d7d,_0x287b2c){logger[_0xfc8b('0x15')]('handleError',this[_0xfc8b('0xf')][_0xfc8b('0xc')],JSON['stringify'](_0x5c9d7d));var _0x5e6f0e='';if(_0x5c9d7d){if(_0x5c9d7d[_0xfc8b('0x37')]){_0x5e6f0e=_0x5c9d7d[_0xfc8b('0x37')];}else{for(var _0x4ce14b in _0x5c9d7d){if(_0x5c9d7d['hasOwnProperty'](_0x4ce14b)){_0x5e6f0e+=_[_0xfc8b('0x38')](_0x4ce14b)+':\x20'+_0x5c9d7d[_0x4ce14b]+'\x0a';}}}}if(_0x287b2c){this[_0xfc8b('0x2')][_0xfc8b('0x13')]();}else{this[_0xfc8b('0x28')](_0xfc8b('0x15'),_0x5e6f0e);this[_0xfc8b('0x28')](_0xfc8b('0x13'));}};module[_0xfc8b('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index aae2acd..251f80a 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 _0x2d5c=['verify','Not\x20verifired','bluebird','prototype','send','createTransport','use','sendMail','toString'];(function(_0x43e0af,_0x13e0c6){var _0x1c317a=function(_0x200137){while(--_0x200137){_0x43e0af['push'](_0x43e0af['shift']());}};_0x1c317a(++_0x13e0c6);}(_0x2d5c,0x107));var _0xc2d5=function(_0x21f53d,_0x158c10){_0x21f53d=_0x21f53d-0x0;var _0x372e38=_0x2d5c[_0x21f53d];return _0x372e38;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xc2d5('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xc2d5('0x1')][_0xc2d5('0x2')]=function(_0x5168b0,_0x4d5f95){return new BPromise(function(_0x1f50e0,_0x5ad571){var _0x19daa9=nodemailer[_0xc2d5('0x3')](_0x5168b0);_0x19daa9[_0xc2d5('0x4')]('compile',inlineBase64());_0x19daa9[_0xc2d5('0x5')](_0x4d5f95,function(_0x473851,_0x5dbce5){if(_0x473851){_0x5ad571(_0x473851[_0xc2d5('0x6')]());}else{_0x1f50e0(_0x5dbce5);}});});};EmailSmtp[_0xc2d5('0x1')][_0xc2d5('0x7')]=function(_0x50fd7b){return new BPromise(function(_0x5ba7fc,_0x24e5a4){var _0x3076f7=nodemailer[_0xc2d5('0x3')](_0x50fd7b);_0x3076f7[_0xc2d5('0x7')](function(_0x2db091,_0x312788){if(_0x2db091){_0x24e5a4(_0x2db091['toString']());}else{if(_0x312788){_0x5ba7fc(_0x312788);}else{_0x24e5a4(_0xc2d5('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x88a8=['prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x88a8,0x1ed));var _0x888a=function(_0x5cc862,_0x2f62b6){_0x5cc862=_0x5cc862-0x0;var _0x16c794=_0x88a8[_0x5cc862];return _0x16c794;};'use strict';var nodemailer=require(_0x888a('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x888a('0x1'));function EmailSmtp(){}EmailSmtp[_0x888a('0x2')][_0x888a('0x3')]=function(_0x54e08d,_0x5939a9){return new BPromise(function(_0x3a7974,_0xe93622){var _0x5748f6=nodemailer[_0x888a('0x4')](_0x54e08d);_0x5748f6[_0x888a('0x5')](_0x888a('0x6'),inlineBase64());_0x5748f6['sendMail'](_0x5939a9,function(_0x137ca5,_0x2aed29){if(_0x137ca5){_0xe93622(_0x137ca5[_0x888a('0x7')]());}else{_0x3a7974(_0x2aed29);}});});};EmailSmtp[_0x888a('0x2')][_0x888a('0x8')]=function(_0x206299){return new BPromise(function(_0x5b4831,_0x303104){var _0x2ca348=nodemailer[_0x888a('0x4')](_0x206299);_0x2ca348['verify'](function(_0x3ead41,_0x3b7333){if(_0x3ead41){_0x303104(_0x3ead41[_0x888a('0x7')]());}else{if(_0x3b7333){_0x5b4831(_0x3b7333);}else{_0x303104(_0x888a('0x9'));}}});});};module[_0x888a('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 1a14c64..54ae6f6 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 _0x6a55=['Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','util','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','isEmpty','test','html','replace','includes','','body','textAsHtml','Empty\x20message

','Attachments'];(function(_0x41f7b5,_0x19a56d){var _0x225fa3=function(_0xe74b8f){while(--_0xe74b8f){_0x41f7b5['push'](_0x41f7b5['shift']());}};_0x225fa3(++_0x19a56d);}(_0x6a55,0xdb));var _0x56a5=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0x6a55[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require(_0x56a5('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x56a5('0x1'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x56a5('0x2'));var config=require('../../../config/environment');function getAddress(_0x3ff76a){var _0x5171fa=_[_0x56a5('0x3')](_0x3ff76a[_0x56a5('0x4')]);return _0x5171fa&&_0x5171fa[_0x56a5('0x5')]?_0x5171fa[_0x56a5('0x5')]:_0x56a5('0x6')+random[_0x56a5('0x7')](0x6)+_0x56a5('0x8');}function getFirstName(_0x387dcb){var _0x586f7a=_[_0x56a5('0x3')](_0x387dcb[_0x56a5('0x4')]);if(_0x586f7a&&_0x586f7a[_0x56a5('0x9')]){if(_0x586f7a[_0x56a5('0x9')]==_0x586f7a[_0x56a5('0x5')]){return _0x586f7a[_0x56a5('0x9')][_0x56a5('0xa')](0x0,_0x586f7a[_0x56a5('0x9')][_0x56a5('0xb')]('@'));}var _0x4cd7c4=_0x586f7a['name'][_0x56a5('0xc')](/\s+/);return _0x4cd7c4[_0x56a5('0xd')]>0x1?_0x4cd7c4[_0x56a5('0xe')](0x0,-0x1)[_0x56a5('0xf')]('\x20'):_0x586f7a[_0x56a5('0x9')];}return _0x56a5('0x10');}function getLastName(_0x4db11b){var _0x4a6dc5=_[_0x56a5('0x3')](_0x4db11b[_0x56a5('0x4')]);if(_0x4a6dc5&&_0x4a6dc5[_0x56a5('0x9')]){var _0x1d7aac=_0x4a6dc5[_0x56a5('0x9')][_0x56a5('0xc')](/\s+/);return _0x1d7aac[_0x56a5('0xd')]>0x1?_0x1d7aac['pop']():'';}return'';}function getMails(_0x360297,_0x5488c6){var _0x41e8b6='';for(var _0x51d031=0x0;_0x51d031<_0x5488c6[_0x56a5('0x4')][_0x56a5('0xd')];_0x51d031+=0x1){if(_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x5')]!==_0x360297){if(!_[_0x56a5('0x11')](_0x41e8b6)){_0x41e8b6+=',';}_0x41e8b6+=_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x9')]||_0x5488c6['value'][_0x51d031][_0x56a5('0x5')]||'';_0x41e8b6+='\x20<';_0x41e8b6+=_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x5')]?_0x5488c6[_0x56a5('0x4')][_0x51d031]['address']:_0x56a5('0x6')+random[_0x56a5('0x7')](0x6)+_0x56a5('0x8');_0x41e8b6+='>';}}return _0x41e8b6;}function parseEmail(_0x15e469,_0x155d3b,_0x529711){if(_0x155d3b['html']){var _0x29f181=/)<[^<]*)*<\/script>/gi;while(_0x29f181[_0x56a5('0x12')](_0x155d3b['html'])){_0x155d3b[_0x56a5('0x13')]=_0x155d3b[_0x56a5('0x13')][_0x56a5('0x14')](_0x29f181,'');}if(_0x155d3b[_0x56a5('0x13')][_0x56a5('0x15')](_0x56a5('0x16'))){var _0x148d73=[];_0x155d3b[_0x56a5('0x17')][_0x56a5('0x18')](_0x2035c7=>{_0x148d73[_0x56a5('0x19')](_0x2035c7[_0x56a5('0x1a')]);});var _0x460bc2=/]+>/g;var _0x4f68b9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5c76a7=_0x155d3b[_0x56a5('0x13')][_0x56a5('0x14')](_0x4f68b9,_0x56a5('0x1b'));var _0x43a815=_0x5c76a7['replace'](_0x460bc2,_0x56a5('0x1c'));for(let _0x54ec36=0x0;_0x54ec36<_0x148d73[_0x56a5('0xd')];_0x54ec36++){var _0x3c6ac1=_0x43a815[_0x56a5('0x14')](_0x56a5('0x1c'),'\x20[Attachment:\x20'+_0x148d73[_0x54ec36]+_0x56a5('0x1d'));_0x43a815=_0x3c6ac1;}_0x155d3b[_0x56a5('0x13')]=_0x43a815;}_0x529711[_0x56a5('0x1e')]=_0x155d3b['html'];}else{_0x529711[_0x56a5('0x1e')]=_0x155d3b[_0x56a5('0x1f')];}if(_0x529711[_0x56a5('0x1e')]){_0x529711[_0x56a5('0x1e')]=_0x529711[_0x56a5('0x1e')]['replace'](/0x0){var _0x6a7b4c=[_0x56a5('0x2e'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0xe63fd5=0x0;_0xe63fd5<_0x155d3b['headerLines'][_0x56a5('0xd')];_0xe63fd5++){var _0x3cba63=_[_0x56a5('0xb')](_0x6a7b4c,_0x155d3b[_0x56a5('0x2d')][_0xe63fd5][_0x56a5('0x2f')]);if(_0x3cba63>=0x0){_0x529711[_0x56a5('0x30')]=!![];}}}return _0x529711;}exports['parser']=function(_0x5c565a,_0x29ab9b,_0x3ccaf9){var _0x77cf3e={'from':getAddress(_0x29ab9b[_0x56a5('0x31')]),'firstName':getFirstName(_0x29ab9b[_0x56a5('0x31')]),'lastName':getLastName(_0x29ab9b[_0x56a5('0x31')]),'mapKey':'email','message':{'from':getMails(_0x5c565a[_0x56a5('0x2')],_0x29ab9b[_0x56a5('0x31')]),'to':_0x5c565a['email'],'cc':'','subject':_0x29ab9b[_0x56a5('0x32')]||'','messageId':_0x29ab9b[_0x56a5('0x33')],'inReplyTo':_0x29ab9b[_0x56a5('0x34')],'sentAt':moment(_0x29ab9b[_0x56a5('0x35')])['format'](_0x56a5('0x36')),'attach':![],'attachments':[]}};if(!_0x29ab9b['html']&&!_0x29ab9b[_0x56a5('0x1f')]){var _0x41abc7=_['filter'](_0x29ab9b[_0x56a5('0x17')],{'contentType':'application/ms-tnef'});if(_0x41abc7[_0x56a5('0xd')]){logger[_0x56a5('0x37')](util['format'](_0x56a5('0x38'),_0x29ab9b['messageId']));tnef[_0x56a5('0x39')](_['first'](_0x41abc7)[_0x56a5('0x2b')],function(_0x47c740,_0x1b6bc9){if(_0x1b6bc9){_0x29ab9b[_0x56a5('0x13')]=_0x1b6bc9[_0x56a5('0x3a')]||_0x56a5('0x3b');if(_0x1b6bc9[_0x56a5('0x3c')]){for(var _0x43196d=0x0;_0x43196d<_0x1b6bc9[_0x56a5('0x3c')]['length'];_0x43196d++){var _0x4e43f5=_0x1b6bc9['Attachments'][_0x43196d];_0x77cf3e[_0x56a5('0x21')][_0x56a5('0x17')][_0x56a5('0x19')]({'filename':_0x4e43f5['Title'],'content':Buffer[_0x56a5('0x31')](_0x4e43f5[_0x56a5('0x3d')])});}}}_0x3ccaf9(parseEmail(_0x5c565a,_0x29ab9b,_0x77cf3e));});}else{_0x29ab9b[_0x56a5('0x13')]='

Empty\x20message

';_0x3ccaf9(parseEmail(_0x5c565a,_0x29ab9b,_0x77cf3e));}}else{_0x3ccaf9(parseEmail(_0x5c565a,_0x29ab9b,_0x77cf3e));}};exports[_0x56a5('0x3e')]=function(_0x3e38b9){switch(_0x3e38b9){case'gmail':return _0x56a5('0x3f');case _0x56a5('0x40'):return _0x56a5('0x41');case _0x56a5('0x42'):return _0x56a5('0x43');case'outlook365':return _0x56a5('0x44');}return _0x56a5('0x45');}; \ No newline at end of file +var _0x6d11=['writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf','split','length','join','Anonymous','pop','@xcally.com','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x28188f['slice'](0x0,-0x1)[_0x16d1('0x10')]('\x20'):_0x4fca47[_0x16d1('0xb')];}return _0x16d1('0x11');}function getLastName(_0x32351b){var _0x2efcba=_['head'](_0x32351b[_0x16d1('0x7')]);if(_0x2efcba&&_0x2efcba[_0x16d1('0xb')]){var _0x29dddb=_0x2efcba[_0x16d1('0xb')][_0x16d1('0xe')](/\s+/);return _0x29dddb[_0x16d1('0xf')]>0x1?_0x29dddb[_0x16d1('0x12')]():'';}return'';}function getMails(_0x4ee46c,_0x169e76){var _0x2b399c='';for(var _0x555b2d=0x0;_0x555b2d<_0x169e76['value'][_0x16d1('0xf')];_0x555b2d+=0x1){if(_0x169e76['value'][_0x555b2d][_0x16d1('0x8')]!==_0x4ee46c){if(!_['isEmpty'](_0x2b399c)){_0x2b399c+=',';}_0x2b399c+=_0x169e76[_0x16d1('0x7')][_0x555b2d]['name']||_0x169e76[_0x16d1('0x7')][_0x555b2d][_0x16d1('0x8')]||'';_0x2b399c+='\x20<';_0x2b399c+=_0x169e76['value'][_0x555b2d]['address']?_0x169e76['value'][_0x555b2d]['address']:_0x16d1('0x9')+random['generate'](0x6)+_0x16d1('0x13');_0x2b399c+='>';}}return _0x2b399c;}function parseEmail(_0x7887d5,_0x1f6add,_0x50c1da){if(_0x1f6add['html']){var _0x2c7825=/)<[^<]*)*<\/script>/gi;while(_0x2c7825[_0x16d1('0x14')](_0x1f6add[_0x16d1('0x15')])){_0x1f6add['html']=_0x1f6add[_0x16d1('0x15')][_0x16d1('0x16')](_0x2c7825,'');}if(_0x1f6add[_0x16d1('0x15')][_0x16d1('0x17')](_0x16d1('0x18'))){var _0x1448b7=[];_0x1f6add[_0x16d1('0x19')][_0x16d1('0x1a')](_0x3f8436=>{_0x1448b7[_0x16d1('0x1b')](_0x3f8436[_0x16d1('0x1c')]);});var _0x15203b=/]+>/g;var _0x9edd96=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x262f89=_0x1f6add[_0x16d1('0x15')][_0x16d1('0x16')](_0x9edd96,'_SRC');var _0x25ae4e=_0x262f89[_0x16d1('0x16')](_0x15203b,_0x16d1('0x1d'));for(let _0x49fc1b=0x0;_0x49fc1b<_0x1448b7[_0x16d1('0xf')];_0x49fc1b++){var _0x1deb1e=_0x25ae4e[_0x16d1('0x16')](_0x16d1('0x1d'),_0x16d1('0x1e')+_0x1448b7[_0x49fc1b]+_0x16d1('0x1f'));_0x25ae4e=_0x1deb1e;}_0x1f6add[_0x16d1('0x15')]=_0x25ae4e;}_0x50c1da['body']=_0x1f6add[_0x16d1('0x15')];}else{_0x50c1da[_0x16d1('0x20')]=_0x1f6add[_0x16d1('0x21')];}if(_0x50c1da[_0x16d1('0x20')]){_0x50c1da['body']=_0x50c1da['body'][_0x16d1('0x16')](/0x0){var _0x1e54fc=[_0x16d1('0x31'),_0x16d1('0x32'),_0x16d1('0x33')];for(var _0x504145=0x0;_0x504145<_0x1f6add[_0x16d1('0x30')]['length'];_0x504145++){var _0x4833f7=_['indexOf'](_0x1e54fc,_0x1f6add['headerLines'][_0x504145][_0x16d1('0x34')]);if(_0x4833f7>=0x0){_0x50c1da[_0x16d1('0x35')]=!![];}}}return _0x50c1da;}exports[_0x16d1('0x36')]=function(_0x1eb761,_0x53de06,_0x2569d1){var _0x524ab8={'from':getAddress(_0x53de06[_0x16d1('0x37')]),'firstName':getFirstName(_0x53de06[_0x16d1('0x37')]),'lastName':getLastName(_0x53de06[_0x16d1('0x37')]),'mapKey':_0x16d1('0x5'),'message':{'from':getMails(_0x1eb761[_0x16d1('0x5')],_0x53de06[_0x16d1('0x37')]),'to':_0x1eb761[_0x16d1('0x5')],'cc':'','subject':_0x53de06[_0x16d1('0x38')]||'','messageId':_0x53de06[_0x16d1('0x39')],'inReplyTo':_0x53de06[_0x16d1('0x3a')],'sentAt':moment(_0x53de06[_0x16d1('0x3b')])[_0x16d1('0x3c')](_0x16d1('0x3d')),'attach':![],'attachments':[]}};if(!_0x53de06[_0x16d1('0x15')]&&!_0x53de06[_0x16d1('0x21')]){var _0x583747=_['filter'](_0x53de06[_0x16d1('0x19')],{'contentType':_0x16d1('0x3e')});if(_0x583747[_0x16d1('0xf')]){logger[_0x16d1('0x3f')](util[_0x16d1('0x3c')](_0x16d1('0x40'),_0x53de06['messageId']));tnef[_0x16d1('0x41')](_[_0x16d1('0x42')](_0x583747)[_0x16d1('0x2f')],function(_0x4ba7ee,_0x4c0c15){if(_0x4c0c15){_0x53de06[_0x16d1('0x15')]=_0x4c0c15[_0x16d1('0x43')]||'

Empty\x20message

';if(_0x4c0c15[_0x16d1('0x44')]){for(var _0x583151=0x0;_0x583151<_0x4c0c15[_0x16d1('0x44')][_0x16d1('0xf')];_0x583151++){var _0x4769c7=_0x4c0c15[_0x16d1('0x44')][_0x583151];_0x524ab8['message']['attachments'][_0x16d1('0x1b')]({'filename':_0x4769c7[_0x16d1('0x45')],'content':Buffer['from'](_0x4769c7[_0x16d1('0x46')])});}}}_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));});}else{_0x53de06[_0x16d1('0x15')]=_0x16d1('0x47');_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));}}else{_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));}};exports[_0x16d1('0x48')]=function(_0x3b77db){switch(_0x3b77db){case'gmail':return _0x16d1('0x49');case'yahoo':return _0x16d1('0x4a');case _0x16d1('0x4b'):return'imap-mail.outlook.com';case _0x16d1('0x4c'):return _0x16d1('0x4d');}return _0x16d1('0x4e');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 163a895..a57d415 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 _0xf40e=['name','key','SERV','active','Imap','exports','lodash'];(function(_0x3b9957,_0x1743fc){var _0x30ff8e=function(_0x105219){while(--_0x105219){_0x3b9957['push'](_0x3b9957['shift']());}};_0x30ff8e(++_0x1743fc);}(_0xf40e,0x164));var _0xef40=function(_0x2b2182,_0x462d8d){_0x2b2182=_0x2b2182-0x0;var _0x4a050b=_0xf40e[_0x2b2182];return _0x4a050b;};'use strict';var _=require(_0xef40('0x0'));function MailAccount(_0x5b91c7){this['id']=_0x5b91c7['id']||0x0;this[_0xef40('0x1')]=_0x5b91c7[_0xef40('0x1')]||'Service';this['key']=_0x5b91c7[_0xef40('0x2')]||_0xef40('0x3');this[_0xef40('0x4')]=_0x5b91c7[_0xef40('0x4')]||![];this[_0xef40('0x5')]=_0x5b91c7[_0xef40('0x5')]||[];this['Smtp']=_0x5b91c7['Smtp']||[];}module[_0xef40('0x6')]=MailAccount; \ No newline at end of file +var _0xb613=['SERV','active','Imap','Smtp','lodash','name','Service','key'];(function(_0x22a46e,_0x3950c2){var _0x1c7be3=function(_0x1bdf4c){while(--_0x1bdf4c){_0x22a46e['push'](_0x22a46e['shift']());}};_0x1c7be3(++_0x3950c2);}(_0xb613,0x1cc));var _0x3b61=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xb613[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x3b61('0x0'));function MailAccount(_0x48c99e){this['id']=_0x48c99e['id']||0x0;this[_0x3b61('0x1')]=_0x48c99e[_0x3b61('0x1')]||_0x3b61('0x2');this['key']=_0x48c99e[_0x3b61('0x3')]||_0x3b61('0x4');this[_0x3b61('0x5')]=_0x48c99e[_0x3b61('0x5')]||![];this[_0x3b61('0x6')]=_0x48c99e[_0x3b61('0x6')]||[];this[_0x3b61('0x7')]=_0x48c99e['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 9b3b6cb..60eac73 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 _0x162a=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x514204,_0xe05dff){var _0x3d528e=function(_0x36665a){while(--_0x36665a){_0x514204['push'](_0x514204['shift']());}};_0x3d528e(++_0xe05dff);}(_0x162a,0xb6));var _0xa162=function(_0x327005,_0x3b2608){_0x327005=_0x327005-0x0;var _0x5211d7=_0x162a[_0x327005];return _0x5211d7;};'use strict';var _=require(_0xa162('0x0'));var MailAccount=require(_0xa162('0x1'));var Realtime=function(){this[_0xa162('0x2')]={};};function freeIsNotKey(_0x262c27,_0x280241,_0x42bc43){var _0x1483e2=_[_0xa162('0x3')](_0x262c27,function(_0x38f161,_0xa77920){return _0x38f161[_0x42bc43];});for(var _0x4d7e89 in _0x280241){if(_0x280241[_0xa162('0x4')](_0x4d7e89)){if(!_0x1483e2[_0x4d7e89]){delete _0x280241[_0x4d7e89];}}}}Realtime[_0xa162('0x5')][_0xa162('0x6')]=function(_0x1d2d4c,_0x565b5a){for(var _0x58d344 in _0x565b5a){if(_0x1d2d4c[_0xa162('0x4')](_0x58d344)){_0x1d2d4c[_0x58d344]=_0x565b5a[_0x58d344];}}};Realtime[_0xa162('0x5')][_0xa162('0x7')]=function(){var _0x32401c=this;return function(_0x222302){if(_0x222302){freeIsNotKey(_0x222302,_0x32401c[_0xa162('0x2')],'id');for(var _0x4c2cb8=0x0,_0x2cad82={},_0x317504={};_0x4c2cb8<_0x222302[_0xa162('0x8')];_0x4c2cb8+=0x1){_0x2cad82=_0x222302[_0x4c2cb8];if(_[_0xa162('0x9')](_0x32401c[_0xa162('0x2')][_0x2cad82['id']])){_0x32401c['mailAccounts'][_0x2cad82['id']]=new MailAccount(_0x2cad82);}else{_[_0xa162('0xa')](_0x32401c[_0xa162('0x2')][_0x2cad82['id']],_0x2cad82);}}}return _0x32401c[_0xa162('0x2')];};};module[_0xa162('0xb')]=Realtime; \ No newline at end of file +var _0x96af=['prototype','mergeFromDatabase','exports','lodash','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96af,0x1ca));var _0xf96a=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0x96af[_0x406696];return _0x10e35c;};'use strict';var _=require(_0xf96a('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xf96a('0x1')]={};};function freeIsNotKey(_0xe2ae43,_0x588969,_0x56201){var _0x1fa968=_[_0xf96a('0x2')](_0xe2ae43,function(_0x2c48b8,_0xcfaa41){return _0x2c48b8[_0x56201];});for(var _0x29f1aa in _0x588969){if(_0x588969[_0xf96a('0x3')](_0x29f1aa)){if(!_0x1fa968[_0x29f1aa]){delete _0x588969[_0x29f1aa];}}}}Realtime[_0xf96a('0x4')][_0xf96a('0x5')]=function(_0x230c8c,_0x171391){for(var _0x40217c in _0x171391){if(_0x230c8c['hasOwnProperty'](_0x40217c)){_0x230c8c[_0x40217c]=_0x171391[_0x40217c];}}};Realtime[_0xf96a('0x4')]['initMailAccounts']=function(){var _0x3d6418=this;return function(_0xd5fbb1){if(_0xd5fbb1){freeIsNotKey(_0xd5fbb1,_0x3d6418['mailAccounts'],'id');for(var _0x5d21eb=0x0,_0x51b11a={},_0x5ddca5={};_0x5d21eb<_0xd5fbb1['length'];_0x5d21eb+=0x1){_0x51b11a=_0xd5fbb1[_0x5d21eb];if(_['isUndefined'](_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']])){_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']]=new MailAccount(_0x51b11a);}else{_['merge'](_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']],_0x51b11a);}}}return _0x3d6418[_0xf96a('0x1')];};};module[_0xf96a('0x6')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index f983d81..fe75119 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 _0x2c8f=['Imap','MailServerOut','Smtp','notify','Request','NotifyMailAccount','getMailAccounts','service','email','active','TemplateId','MailServerIn'];(function(_0x5e8e29,_0x4c2aea){var _0x1b9c84=function(_0x1208af){while(--_0x1208af){_0x5e8e29['push'](_0x5e8e29['shift']());}};_0x1b9c84(++_0x4c2aea);}(_0x2c8f,0x192));var _0xf2c8=function(_0x36a287,_0x2e4b4f){_0x36a287=_0x36a287-0x0;var _0x178261=_0x2c8f[_0x36a287];return _0x178261;};'use strict';var client=require('../client');exports[_0xf2c8('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0xf2c8('0x1'),_0xf2c8('0x2'),_0xf2c8('0x3'),'key','ListId',_0xf2c8('0x4')],'raw':![],'include':[{'model':_0xf2c8('0x5'),'as':_0xf2c8('0x6')},{'model':_0xf2c8('0x7'),'as':_0xf2c8('0x8')}]},'log':'getMailAccount'});};};exports[_0xf2c8('0x9')]=function(_0x28cc0d,_0x4e3109){return client[_0xf2c8('0xa')](_0xf2c8('0xb'),{'account':{'id':_0x28cc0d},'body':_0x4e3109,'log':_0xf2c8('0xb')});}; \ No newline at end of file +var _0xce68=['email','key','ListId','TemplateId','Imap','MailServerOut','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service'];(function(_0xcc18a5,_0x4dbb0a){var _0x314c9b=function(_0x4b9582){while(--_0x4b9582){_0xcc18a5['push'](_0xcc18a5['shift']());}};_0x314c9b(++_0x4dbb0a);}(_0xce68,0x10c));var _0x8ce6=function(_0x4dfcab,_0x283d3d){_0x4dfcab=_0x4dfcab-0x0;var _0x438396=_0xce68[_0x4dfcab];return _0x438396;};'use strict';var client=require(_0x8ce6('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8ce6('0x1')](_0x8ce6('0x2'),{'options':{'attributes':['id',_0x8ce6('0x3'),_0x8ce6('0x4'),_0x8ce6('0x5'),'active',_0x8ce6('0x6'),_0x8ce6('0x7'),_0x8ce6('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x8ce6('0x9')},{'model':_0x8ce6('0xa'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x8ce6('0xb')]=function(_0x357fbb,_0x17811e){return client[_0x8ce6('0x1')]('NotifyMailAccount',{'account':{'id':_0x357fbb},'body':_0x17811e,'log':_0x8ce6('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 35b438c..7086216 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 _0xe22a=['GetSettings','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x3ac2f8,_0x53c4a3){var _0xf0c9dc=function(_0x16619d){while(--_0x16619d){_0x3ac2f8['push'](_0x3ac2f8['shift']());}};_0xf0c9dc(++_0x53c4a3);}(_0xe22a,0x1eb));var _0xae22=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe22a[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xae22('0x0')]=function(){return client[_0xae22('0x1')](_0xae22('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xae22('0x3')]},'log':_0xae22('0x4')});}; \ No newline at end of file +var _0x0b8c=['GetSettings','../client','getSettings','ShowSetting'];(function(_0xd0bc07,_0xf98168){var _0x512631=function(_0xc1ffdf){while(--_0xc1ffdf){_0xd0bc07['push'](_0xd0bc07['shift']());}};_0x512631(++_0xf98168);}(_0x0b8c,0xe5));var _0xc0b8=function(_0x58d5d9,_0x5d104e){_0x58d5d9=_0x58d5d9-0x0;var _0x23d483=_0x0b8c[_0x58d5d9];return _0x23d483;};'use strict';var client=require(_0xc0b8('0x0'));exports[_0xc0b8('0x1')]=function(){return client['Request'](_0xc0b8('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xc0b8('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d632968..617fa41 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 d2e33fc..a51502e 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 _0x2fa6=['default','../../config/express','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','sticky-session','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x2fa6,0x8a));var _0x62fa=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2fa6[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x62fa('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x62fa('0x1'));var Redis=require('ioredis');var config=require(_0x62fa('0x2'));var app=express();var server=http[_0x62fa('0x3')](app);server[_0x62fa('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0x62fa('0x5')])){var socketio=require(_0x62fa('0x6'))(server,{'transports':[_0x62fa('0x7'),_0x62fa('0x8')]});config['redis']=_[_0x62fa('0x9')](config[_0x62fa('0xa')],{'host':_0x62fa('0xb'),'port':0x18eb});socketio[_0x62fa('0xc')](require(_0x62fa('0xd'))({'pubClient':new Redis(config[_0x62fa('0xa')]),'subClient':new Redis(config[_0x62fa('0xa')])}));require(_0x62fa('0xe'))['default']();require(_0x62fa('0xf'))[_0x62fa('0x10')](socketio);require(_0x62fa('0x11'))[_0x62fa('0x10')](app);require(_0x62fa('0x12'))[_0x62fa('0x10')](app);}else{server['once'](_0x62fa('0x13'),function(){console['log'](_0x62fa('0x14'),config[_0x62fa('0x5')]);});}exports=module[_0x62fa('0x15')]=app; \ No newline at end of file +var _0x6269=['websocket','redis','localhost','socket.io-redis','default','../../config/socketio','../../config/express','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','createServer','socket.io'];(function(_0x40f280,_0x53f1a4){var _0x11ad62=function(_0x15cc38){while(--_0x15cc38){_0x40f280['push'](_0x40f280['shift']());}};_0x11ad62(++_0x53f1a4);}(_0x6269,0x10b));var _0x9626=function(_0x21b861,_0x420c1d){_0x21b861=_0x21b861-0x0;var _0x38f7a7=_0x6269[_0x21b861];return _0x38f7a7;};'use strict';var _=require(_0x9626('0x0'));var http=require('http');var express=require(_0x9626('0x1'));var sticky=require(_0x9626('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x9626('0x3')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x9626('0x4'))(server,{'transports':[_0x9626('0x5'),'polling']});config['redis']=_['defaults'](config[_0x9626('0x6')],{'host':_0x9626('0x7'),'port':0x18eb});socketio['adapter'](require(_0x9626('0x8'))({'pubClient':new Redis(config[_0x9626('0x6')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x9626('0x9')]();require(_0x9626('0xa'))[_0x9626('0x9')](socketio);require(_0x9626('0xb'))['default'](app);require('../../routes')[_0x9626('0x9')](app);}else{server[_0x9626('0xc')]('listening',function(){console[_0x9626('0xd')](_0x9626('0xe'),config[_0x9626('0xf')]);});}exports=module[_0x9626('0x10')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index cb0573f..3a47ba6 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 _0x020d=['Request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x020d,0x181));var _0xd020=function(_0x158970,_0x536605){_0x158970=_0x158970-0x0;var _0x407633=_0x020d[_0x158970];return _0x407633;};'use strict';var jayson=require(_0xd020('0x0'));var BPromise=require(_0xd020('0x1'));var logger=require(_0xd020('0x2'))(_0xd020('0x3'));var client=jayson[_0xd020('0x4')]['http']({'port':0x2329});client[_0xd020('0x5')]=function(_0x570fe6,_0x4bac44){return new BPromise(function(_0x3bd820,_0x44e406){return client['request'](_0x570fe6,_0x4bac44)['then'](function(_0x10e33c){logger[_0xd020('0x6')](_0xd020('0x7'),_0xd020('0x3'),_0x570fe6,_0x4bac44,_0x10e33c);if(_0x10e33c[_0xd020('0x8')]){logger['error'](_0xd020('0x7'),_0xd020('0x3'),_0x570fe6,_0x10e33c[_0xd020('0x8')][_0xd020('0x9')],_0x4bac44);return _0x44e406(_0x10e33c[_0xd020('0x8')][_0xd020('0x9')]);}else{return _0x3bd820(_0x10e33c[_0xd020('0xa')]);}})[_0xd020('0xb')](function(_0x2e3ba2){logger[_0xd020('0x8')]('rpc',_0xd020('0x3'),_0x570fe6,_0x2e3ba2,_0x4bac44);return _0x44e406(_0x2e3ba2);});});};module[_0xd020('0xc')]=client; \ No newline at end of file +var _0x235a=['rpc','error','message','catch','exports','jayson/promise','../../config/logger','routing','client','http','request','then'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x235a,0x155));var _0xa235=function(_0x465efd,_0x3579f6){_0x465efd=_0x465efd-0x0;var _0x53bf39=_0x235a[_0x465efd];return _0x53bf39;};'use strict';var jayson=require(_0xa235('0x0'));var BPromise=require('bluebird');var logger=require(_0xa235('0x1'))(_0xa235('0x2'));var client=jayson[_0xa235('0x3')][_0xa235('0x4')]({'port':0x2329});client['Request']=function(_0x5efac9,_0xcc1027){return new BPromise(function(_0x2a941a,_0x34b749){return client[_0xa235('0x5')](_0x5efac9,_0xcc1027)[_0xa235('0x6')](function(_0x480dca){logger['debug'](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0xcc1027,_0x480dca);if(_0x480dca[_0xa235('0x8')]){logger[_0xa235('0x8')](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0x480dca[_0xa235('0x8')][_0xa235('0x9')],_0xcc1027);return _0x34b749(_0x480dca['error'][_0xa235('0x9')]);}else{return _0x2a941a(_0x480dca['result']);}})[_0xa235('0xa')](function(_0x20f558){logger[_0xa235('0x8')](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0x20f558,_0xcc1027);return _0x34b749(_0x20f558);});});};module[_0xa235('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index cbc01fe..fb5a678 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 _0xa26b=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0xc83a29,_0x5bf882){var _0x6a70fb=function(_0x250c42){while(--_0x250c42){_0xc83a29['push'](_0xc83a29['shift']());}};_0x6a70fb(++_0x5bf882);}(_0xa26b,0x6a));var _0xba26=function(_0x1fe165,_0x1b7ba9){_0x1fe165=_0x1fe165-0x0;var _0x4dfc1a=_0xa26b[_0x1fe165];return _0x4dfc1a;};'use strict';var BPromise=require(_0xba26('0x0'));var server=require('./server');var Realtime=require(_0xba26('0x1'));var user=require(_0xba26('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xba26('0x3'));var chatQueue=require(_0xba26('0x4'));var smsQueue=require(_0xba26('0x5'));var mailQueue=require(_0xba26('0x6'));var faxQueue=require(_0xba26('0x7'));var whatsappQueue=require(_0xba26('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xba26('0x9')]()[_0xba26('0xa')](user['getAgents']())['then'](realtime[_0xba26('0xb')]())[_0xba26('0xa')](interval[_0xba26('0xc')]())['then'](realtime[_0xba26('0xd')]())['then'](openchannelQueue[_0xba26('0xe')]())['then'](realtime['initOpenchannelQueues']())[_0xba26('0xa')](chatQueue[_0xba26('0xf')]())[_0xba26('0xa')](realtime[_0xba26('0x10')]())[_0xba26('0xa')](smsQueue[_0xba26('0x11')]())[_0xba26('0xa')](realtime[_0xba26('0x12')]())[_0xba26('0xa')](mailQueue[_0xba26('0x13')]())['then'](realtime[_0xba26('0x14')]())[_0xba26('0xa')](faxQueue[_0xba26('0x15')]())[_0xba26('0xa')](realtime[_0xba26('0x16')]())[_0xba26('0xa')](whatsappQueue[_0xba26('0x17')]())['then'](realtime[_0xba26('0x18')]())[_0xba26('0xa')](function(){return realtime;});}function main(){return server[_0xba26('0x19')](realtime)[_0xba26('0xa')](function(_0x2acb44){return initRealtime();})[_0xba26('0xa')](function(_0x2ca471){return setInterval(initRealtime,0x1388);})[_0xba26('0x1a')](function(_0x3660fb){console[_0xba26('0x1b')](_0x3660fb);});}main(); \ No newline at end of file +var _0x3c44=['initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues'];(function(_0x1e240e,_0x199b7f){var _0x40225a=function(_0x1bbd25){while(--_0x1bbd25){_0x1e240e['push'](_0x1e240e['shift']());}};_0x40225a(++_0x199b7f);}(_0x3c44,0x122));var _0x43c4=function(_0x311e45,_0x20e2dd){_0x311e45=_0x311e45-0x0;var _0x46c9d9=_0x3c44[_0x311e45];return _0x46c9d9;};'use strict';var BPromise=require(_0x43c4('0x0'));var server=require('./server');var Realtime=require(_0x43c4('0x1'));var user=require(_0x43c4('0x2'));var interval=require(_0x43c4('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x43c4('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x43c4('0x5'));var faxQueue=require(_0x43c4('0x6'));var whatsappQueue=require(_0x43c4('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x43c4('0x8')]()['then'](user[_0x43c4('0x9')]())[_0x43c4('0xa')](realtime[_0x43c4('0xb')]())[_0x43c4('0xa')](interval[_0x43c4('0xc')]())[_0x43c4('0xa')](realtime['initIntervals']())[_0x43c4('0xa')](openchannelQueue[_0x43c4('0xd')]())[_0x43c4('0xa')](realtime[_0x43c4('0xe')]())[_0x43c4('0xa')](chatQueue['getChatQueues']())[_0x43c4('0xa')](realtime[_0x43c4('0xf')]())[_0x43c4('0xa')](smsQueue[_0x43c4('0x10')]())['then'](realtime[_0x43c4('0x11')]())[_0x43c4('0xa')](mailQueue[_0x43c4('0x12')]())[_0x43c4('0xa')](realtime[_0x43c4('0x13')]())[_0x43c4('0xa')](faxQueue[_0x43c4('0x14')]())[_0x43c4('0xa')](realtime['initFaxQueues']())[_0x43c4('0xa')](whatsappQueue[_0x43c4('0x15')]())[_0x43c4('0xa')](realtime[_0x43c4('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x43c4('0x17')](realtime)[_0x43c4('0xa')](function(_0x3e0d6c){return initRealtime();})[_0x43c4('0xa')](function(_0x5569ad){return setInterval(initRealtime,0x1388);})[_0x43c4('0x18')](function(_0x1e4ea8){console[_0x43c4('0x19')](_0x1e4ea8);});}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 c675bd1..f7cde76 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x29b01f,_0x13e8bb){_0x29b01f=_0x29b01f-0x0;var _0xf7d6c3=_0x1261[_0x29b01f];return _0xf7d6c3;};'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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x343308,_0x500535){var _0x1504f1=function(_0x24e0b6){while(--_0x24e0b6){_0x343308['push'](_0x343308['shift']());}};_0x1504f1(++_0x500535);}(_0x5fc3,0xa8));var _0x35fc=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x5fc3[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};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 62a29ae..da454e6 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 _0x4191=['jayson/promise','client','request','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x4191,0x6d));var _0x1419=function(_0x3e136f,_0x3868f2){_0x3e136f=_0x3e136f-0x0;var _0x5629c1=_0x4191[_0x3e136f];return _0x5629c1;};'use strict';var BPromise=require(_0x1419('0x0'));var jayson=require(_0x1419('0x1'));var client=jayson[_0x1419('0x2')]['http']({'port':0x232b});function request(_0x115ce7,_0x41aadd){return new BPromise(function(_0x4f7049,_0x2063ac){return client[_0x1419('0x3')](_0x115ce7,_0x41aadd)['then'](function(_0x139a3c){if(_0x139a3c[_0x1419('0x4')]){return _0x2063ac(_0x139a3c[_0x1419('0x4')][_0x1419('0x5')]);}else{return _0x4f7049(_0x139a3c[_0x1419('0x6')]);}})[_0x1419('0x7')](function(_0x397972){return _0x2063ac(_0x397972);});});}exports[_0x1419('0x8')]=function(_0x128a85,_0x17f4d8){return request(_0x1419('0x9'),{'account':_0x128a85,'message':_0x17f4d8});}; \ No newline at end of file +var _0x675f=['jayson/promise','client','http','request','error','message','result','sendMailMessage','SendMail','bluebird'];(function(_0x1a3bb7,_0xd65f59){var _0x9ead71=function(_0x549a13){while(--_0x549a13){_0x1a3bb7['push'](_0x1a3bb7['shift']());}};_0x9ead71(++_0xd65f59);}(_0x675f,0x8b));var _0xf675=function(_0x358c03,_0x3f92ce){_0x358c03=_0x358c03-0x0;var _0x50b883=_0x675f[_0x358c03];return _0x50b883;};'use strict';var BPromise=require(_0xf675('0x0'));var jayson=require(_0xf675('0x1'));var client=jayson[_0xf675('0x2')][_0xf675('0x3')]({'port':0x232b});function request(_0x3f6799,_0x2b4bea){return new BPromise(function(_0x8aac09,_0x54aa72){return client[_0xf675('0x4')](_0x3f6799,_0x2b4bea)['then'](function(_0x19bf10){if(_0x19bf10[_0xf675('0x5')]){return _0x54aa72(_0x19bf10[_0xf675('0x5')][_0xf675('0x6')]);}else{return _0x8aac09(_0x19bf10[_0xf675('0x7')]);}})['catch'](function(_0x15a3b0){return _0x54aa72(_0x15a3b0);});});}exports[_0xf675('0x8')]=function(_0x5d0417,_0x146af2){return request(_0xf675('0x9'),{'account':_0x5d0417,'message':_0x146af2});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 012dcff..5dfdc70 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 _0x884b=['faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','mail','openchannel','fax','sms','whatsapp','length','toNumber','format','smsPause','chatStatusTime','openchannelCapacity','busy','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x884b,0x195));var _0xb884=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x884b[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0xb884('0x0'));var moment=require(_0xb884('0x1'));var md5=require('md5');var Redis=require(_0xb884('0x2'));var config=require(_0xb884('0x3'));config[_0xb884('0x4')]=_[_0xb884('0x5')](config[_0xb884('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb884('0x6'))(new Redis(config[_0xb884('0x4')]));function Agent(_0x1cc29e){this['id']=_0x1cc29e['id']||0x0;this['name']=_0x1cc29e[_0xb884('0x7')]||'';this[_0xb884('0x8')]=_0x1cc29e[_0xb884('0x8')]||!![];this[_0xb884('0x9')]=_0x1cc29e['voicePause']||![];this[_0xb884('0xa')]=_0x1cc29e[_0xb884('0xa')]||![];this[_0xb884('0xb')]=_0x1cc29e[_0xb884('0xb')]||![];this[_0xb884('0xc')]=_0x1cc29e[_0xb884('0xc')]||![];this['smsPause']=_0x1cc29e['smsPause']||![];this[_0xb884('0xd')]=_0x1cc29e[_0xb884('0xd')]||![];this[_0xb884('0xe')]=_0xb884('0xf');this['chatStatusTime']=0x0;this['chatCapacity']=_0x1cc29e[_0xb884('0x10')]||0x0;this[_0xb884('0x11')]=0x0;this[_0xb884('0x12')]=_0xb884('0xf');this[_0xb884('0x13')]=0x0;this[_0xb884('0x14')]=_0x1cc29e[_0xb884('0x14')]||0x0;this[_0xb884('0x15')]=0x0;this[_0xb884('0x16')]=_0xb884('0xf');this[_0xb884('0x17')]=0x0;this['faxCapacity']=_0x1cc29e['faxCapacity']||0x0;this[_0xb884('0x18')]=0x0;this[_0xb884('0x19')]=_0xb884('0xf');this[_0xb884('0x1a')]=0x0;this[_0xb884('0x1b')]=_0x1cc29e[_0xb884('0x1b')]||0x0;this[_0xb884('0x1c')]=0x0;this[_0xb884('0x1d')]=_0xb884('0xf');this[_0xb884('0x1e')]=0x0;this[_0xb884('0x1f')]=_0x1cc29e[_0xb884('0x1f')]||0x0;this[_0xb884('0x20')]=0x0;this[_0xb884('0x21')]=_0xb884('0xf');this[_0xb884('0x22')]=0x0;this['openchannelCapacity']=_0x1cc29e['openchannelCapacity']||0x0;this[_0xb884('0x23')]=0x0;this['busy']=![];this[_0xb884('0x24')]=undefined;this[_0xb884('0x25')]='';this[_0xb884('0x26')]();}Agent[_0xb884('0x27')][_0xb884('0x28')]=function(_0x47d027){if(this[_0x47d027+_0xb884('0x29')]>0x0){if(this[_0x47d027+'Capacity']>0x0&&this[_0x47d027+_0xb884('0x29')]>=this[_0x47d027+'Capacity']){return _0xb884('0x2a');}else{return _0xb884('0x2b');}}else{return _0xb884('0x2c');}};Agent[_0xb884('0x27')][_0xb884('0x26')]=function(){var _0x13e056=[_0xb884('0x2d'),'chat',_0xb884('0x2e'),_0xb884('0x2f'),_0xb884('0x30'),_0xb884('0x31')];for(var _0xb4e811=0x0;_0xb4e811<_0x13e056[_0xb884('0x32')];_0xb4e811+=0x1){var _0x5490fe=this[_0xb884('0x28')](_0x13e056[_0xb4e811]);if(this[_0x13e056[_0xb4e811]+'Status']!==_0x5490fe){this[_0x13e056[_0xb4e811]+'StatusTime']=_[_0xb884('0x33')](moment()[_0xb884('0x34')]('x'));}this[_0x13e056[_0xb4e811]+'Status']=_0x5490fe;}var _0x31565d={'id':this['id'],'name':this['name'],'online':this[_0xb884('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0xb884('0xb')],'smsPause':this[_0xb884('0x35')],'faxPause':this[_0xb884('0xc')],'openchannelPause':this[_0xb884('0xd')],'chatStatus':this[_0xb884('0xe')],'chatStatusTime':this[_0xb884('0x36')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xb884('0x11')],'mailStatus':this[_0xb884('0x12')],'mailStatusTime':this[_0xb884('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xb884('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xb884('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xb884('0x18')],'smsStatus':this[_0xb884('0x19')],'smsStatusTime':this[_0xb884('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xb884('0x1e')],'whatsappCapacity':this[_0xb884('0x1f')],'whatsappCurrentCapacity':this[_0xb884('0x20')],'openchannelStatus':this[_0xb884('0x21')],'openchannelStatusTime':this[_0xb884('0x22')],'openchannelCapacity':this[_0xb884('0x37')],'openchannelCurrentCapacity':this[_0xb884('0x23')],'busy':this[_0xb884('0x38')],'busyQueue':this[_0xb884('0x24')]};var _0xb8ebbc=md5(JSON[_0xb884('0x39')](_0x31565d));if(this[_0xb884('0x25')]!==_0xb8ebbc){this[_0xb884('0x25')]=_0xb8ebbc;io[_0xb884('0x3a')](_0xb884('0x3b'),_0x31565d);}};module[_0xb884('0x3c')]=Agent; \ No newline at end of file +var _0x0be6=['defaults','localhost','socket.io-emitter','name','voicePause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','whatsapp','length','Status','StatusTime','format','online','chatPause','faxPause','mailCurrentCapacity','faxStatusTime','stringify','emit','exports','md5','ioredis','../../../config/environment'];(function(_0x35b870,_0x11ad5f){var _0x143d6e=function(_0x3c2c89){while(--_0x3c2c89){_0x35b870['push'](_0x35b870['shift']());}};_0x143d6e(++_0x11ad5f);}(_0x0be6,0xa8));var _0x60be=function(_0x1ec274,_0x51440a){_0x1ec274=_0x1ec274-0x0;var _0x3d020f=_0x0be6[_0x1ec274];return _0x3d020f;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x60be('0x0'));var Redis=require(_0x60be('0x1'));var config=require(_0x60be('0x2'));config['redis']=_[_0x60be('0x3')](config['redis'],{'host':_0x60be('0x4'),'port':0x18eb});var io=require(_0x60be('0x5'))(new Redis(config['redis']));function Agent(_0x311554){this['id']=_0x311554['id']||0x0;this[_0x60be('0x6')]=_0x311554[_0x60be('0x6')]||'';this['online']=_0x311554['online']||!![];this[_0x60be('0x7')]=_0x311554[_0x60be('0x7')]||![];this['chatPause']=_0x311554['chatPause']||![];this[_0x60be('0x8')]=_0x311554[_0x60be('0x8')]||![];this['faxPause']=_0x311554['faxPause']||![];this[_0x60be('0x9')]=_0x311554[_0x60be('0x9')]||![];this[_0x60be('0xa')]=_0x311554['openchannelPause']||![];this[_0x60be('0xb')]=_0x60be('0xc');this[_0x60be('0xd')]=0x0;this[_0x60be('0xe')]=_0x311554[_0x60be('0xe')]||0x0;this[_0x60be('0xf')]=0x0;this[_0x60be('0x10')]='unknown';this[_0x60be('0x11')]=0x0;this[_0x60be('0x12')]=_0x311554[_0x60be('0x12')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x60be('0x13')]='unknown';this['faxStatusTime']=0x0;this[_0x60be('0x14')]=_0x311554[_0x60be('0x14')]||0x0;this[_0x60be('0x15')]=0x0;this[_0x60be('0x16')]=_0x60be('0xc');this[_0x60be('0x17')]=0x0;this[_0x60be('0x18')]=_0x311554[_0x60be('0x18')]||0x0;this[_0x60be('0x19')]=0x0;this[_0x60be('0x1a')]='unknown';this[_0x60be('0x1b')]=0x0;this['whatsappCapacity']=_0x311554[_0x60be('0x1c')]||0x0;this[_0x60be('0x1d')]=0x0;this[_0x60be('0x1e')]=_0x60be('0xc');this[_0x60be('0x1f')]=0x0;this[_0x60be('0x20')]=_0x311554[_0x60be('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x60be('0x21')]=![];this[_0x60be('0x22')]=undefined;this[_0x60be('0x0')]='';this['updateRealtime']();}Agent[_0x60be('0x23')][_0x60be('0x24')]=function(_0x105510){if(this[_0x105510+_0x60be('0x25')]>0x0){if(this[_0x105510+_0x60be('0x26')]>0x0&&this[_0x105510+_0x60be('0x25')]>=this[_0x105510+_0x60be('0x26')]){return _0x60be('0x27');}else{return _0x60be('0x28');}}else{return _0x60be('0x29');}};Agent[_0x60be('0x23')]['updateRealtime']=function(){var _0x5c3fba=[_0x60be('0x2a'),'chat',_0x60be('0x2b'),'fax','sms',_0x60be('0x2c')];for(var _0x35fe80=0x0;_0x35fe80<_0x5c3fba[_0x60be('0x2d')];_0x35fe80+=0x1){var _0x53af97=this[_0x60be('0x24')](_0x5c3fba[_0x35fe80]);if(this[_0x5c3fba[_0x35fe80]+_0x60be('0x2e')]!==_0x53af97){this[_0x5c3fba[_0x35fe80]+_0x60be('0x2f')]=_['toNumber'](moment()[_0x60be('0x30')]('x'));}this[_0x5c3fba[_0x35fe80]+_0x60be('0x2e')]=_0x53af97;}var _0x4b08b0={'id':this['id'],'name':this[_0x60be('0x6')],'online':this[_0x60be('0x31')],'voicePause':this[_0x60be('0x7')],'chatPause':this[_0x60be('0x32')],'mailPause':this[_0x60be('0x8')],'smsPause':this[_0x60be('0x9')],'faxPause':this[_0x60be('0x33')],'openchannelPause':this[_0x60be('0xa')],'chatStatus':this[_0x60be('0xb')],'chatStatusTime':this[_0x60be('0xd')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x60be('0x11')],'mailCapacity':this[_0x60be('0x12')],'mailCurrentCapacity':this[_0x60be('0x34')],'faxStatus':this[_0x60be('0x13')],'faxStatusTime':this[_0x60be('0x35')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x60be('0x15')],'smsStatus':this[_0x60be('0x16')],'smsStatusTime':this[_0x60be('0x17')],'smsCapacity':this[_0x60be('0x18')],'smsCurrentCapacity':this[_0x60be('0x19')],'whatsappStatus':this[_0x60be('0x1a')],'whatsappStatusTime':this[_0x60be('0x1b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x60be('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x60be('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x60be('0x21')],'busyQueue':this[_0x60be('0x22')]};var _0x15b3cf=md5(JSON[_0x60be('0x36')](_0x4b08b0));if(this[_0x60be('0x0')]!==_0x15b3cf){this['md5']=_0x15b3cf;io[_0x60be('0x37')]('user:save',_0x4b08b0);}};module[_0x60be('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 798681a..6bae3e9 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 _0xfaa9=['md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','length','chatPause','paused','available','format','chat:queue:%s','emit','exports','lodash'];(function(_0x2bb47f,_0x52b0af){var _0x4b56d8=function(_0x1201a5){while(--_0x1201a5){_0x2bb47f['push'](_0x2bb47f['shift']());}};_0x4b56d8(++_0x52b0af);}(_0xfaa9,0x137));var _0x9faa=function(_0x15d2ee,_0x2eb85e){_0x15d2ee=_0x15d2ee-0x0;var _0x546c99=_0xfaa9[_0x15d2ee];return _0x546c99;};'use strict';var _=require(_0x9faa('0x0'));var md5=require(_0x9faa('0x1'));var util=require(_0x9faa('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x9faa('0x3')]=_[_0x9faa('0x4')](config[_0x9faa('0x3')],{'host':_0x9faa('0x5'),'port':0x18eb});var io=require(_0x9faa('0x6'))(new Redis(config[_0x9faa('0x3')]));function ChatQueue(_0x510347){this['id']=_0x510347['id']||0x0;this[_0x9faa('0x7')]=_0x510347[_0x9faa('0x7')]||'';this['timeout']=_0x510347[_0x9faa('0x8')]||0xa;this[_0x9faa('0x9')]=_0x510347[_0x9faa('0x9')]||'beepall';this[_0x9faa('0xa')]=_0x510347[_0x9faa('0xa')];this[_0x9faa('0xb')]={};this[_0x9faa('0xc')]=0x0;this[_0x9faa('0x1')]='';this[_0x9faa('0xd')]();this['updateRealtime']();}ChatQueue[_0x9faa('0xe')]['updateRouting']=function(){var _0x3c7a6d=this[_0x9faa('0xb')]['_rr'];this[_0x9faa('0xb')]=_['map'](this['Agents'],'id');this[_0x9faa('0xb')][_0x9faa('0xf')]=_0x3c7a6d;};ChatQueue['prototype'][_0x9faa('0x10')]=function(){this[_0x9faa('0x11')]=0x0;this['paused']=0x0;for(var _0x28c5ac=0x0;_0x28c5ac=0x0?this['available']:0x0;var _0x432495={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9faa('0x11')],'name':this[_0x9faa('0x7')],'paused':this[_0x9faa('0x14')],'waiting':this[_0x9faa('0xc')]};var _0x5fca23=md5(JSON['stringify'](_0x432495));if(this[_0x9faa('0x1')]!==_0x5fca23){this['md5']=_0x5fca23;io['to'](util[_0x9faa('0x16')](_0x9faa('0x17'),_0x432495[_0x9faa('0x7')]))[_0x9faa('0x18')]('chat_queue:save',_0x432495);}};module[_0x9faa('0x19')]=ChatQueue; \ No newline at end of file +var _0xe1da=['redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','paused','online','chatPause','loggedIn','available','stringify','format','chat:queue:%s','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x3e997e,_0xcb6704){var _0x1873b5=function(_0x575e06){while(--_0x575e06){_0x3e997e['push'](_0x3e997e['shift']());}};_0x1873b5(++_0xcb6704);}(_0xe1da,0x67));var _0xae1d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe1da[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xae1d('0x0'));var md5=require(_0xae1d('0x1'));var util=require(_0xae1d('0x2'));var Redis=require(_0xae1d('0x3'));var config=require(_0xae1d('0x4'));config[_0xae1d('0x5')]=_[_0xae1d('0x6')](config[_0xae1d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xae1d('0x5')]));function ChatQueue(_0x1e82d3){this['id']=_0x1e82d3['id']||0x0;this[_0xae1d('0x7')]=_0x1e82d3[_0xae1d('0x7')]||'';this['timeout']=_0x1e82d3[_0xae1d('0x8')]||0xa;this[_0xae1d('0x9')]=_0x1e82d3['strategy']||_0xae1d('0xa');this['Agents']=_0x1e82d3[_0xae1d('0xb')];this[_0xae1d('0xc')]={};this[_0xae1d('0xd')]=0x0;this[_0xae1d('0x1')]='';this[_0xae1d('0xe')]();this['updateRealtime']();}ChatQueue[_0xae1d('0xf')][_0xae1d('0xe')]=function(){var _0x57e6e4=this[_0xae1d('0xc')]['_rr'];this[_0xae1d('0xc')]=_[_0xae1d('0x10')](this[_0xae1d('0xb')],'id');this[_0xae1d('0xc')][_0xae1d('0x11')]=_0x57e6e4;};ChatQueue[_0xae1d('0xf')][_0xae1d('0x12')]=function(){this['loggedIn']=0x0;this[_0xae1d('0x13')]=0x0;for(var _0x7fd796=0x0;_0x7fd796=0x0?this['available']:0x0;var _0x59fccb={'id':this['id'],'available':this[_0xae1d('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xae1d('0x7')],'paused':this[_0xae1d('0x13')],'waiting':this[_0xae1d('0xd')]};var _0x9ec5b4=md5(JSON[_0xae1d('0x18')](_0x59fccb));if(this['md5']!==_0x9ec5b4){this[_0xae1d('0x1')]=_0x9ec5b4;io['to'](util[_0xae1d('0x19')](_0xae1d('0x1a'),_0x59fccb[_0xae1d('0x7')]))['emit']('chat_queue:save',_0x59fccb);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 9c8ffd8..3b41baa 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 _0x71b4=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','faxPause','paused','available','waiting','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x3a60cf,_0x26282c){var _0x545ccf=function(_0x26e656){while(--_0x26e656){_0x3a60cf['push'](_0x3a60cf['shift']());}};_0x545ccf(++_0x26282c);}(_0x71b4,0x12d));var _0x471b=function(_0x46238b,_0x35cbac){_0x46238b=_0x46238b-0x0;var _0xd3a6e1=_0x71b4[_0x46238b];return _0xd3a6e1;};'use strict';var _=require(_0x471b('0x0'));var md5=require(_0x471b('0x1'));var util=require(_0x471b('0x2'));var Redis=require('ioredis');var config=require(_0x471b('0x3'));config[_0x471b('0x4')]=_[_0x471b('0x5')](config['redis'],{'host':_0x471b('0x6'),'port':0x18eb});var io=require(_0x471b('0x7'))(new Redis(config[_0x471b('0x4')]));function FaxQueue(_0x1c43ea){this['id']=_0x1c43ea['id']||0x0;this[_0x471b('0x8')]=_0x1c43ea[_0x471b('0x8')]||'';this['timeout']=_0x1c43ea[_0x471b('0x9')]||0xa;this[_0x471b('0xa')]=_0x1c43ea['strategy']||_0x471b('0xb');this[_0x471b('0xc')]=_0x1c43ea[_0x471b('0xc')];this[_0x471b('0xd')]={};this['waiting']=0x0;this[_0x471b('0x1')]='';this[_0x471b('0xe')]();this[_0x471b('0xf')]();}FaxQueue[_0x471b('0x10')]['updateRouting']=function(){var _0xb4eb5a=this[_0x471b('0xd')][_0x471b('0x11')];this[_0x471b('0xd')]=_[_0x471b('0x12')](this[_0x471b('0xc')],'id');this['mapAgentsId'][_0x471b('0x11')]=_0xb4eb5a;};FaxQueue[_0x471b('0x10')][_0x471b('0xf')]=function(){this[_0x471b('0x13')]=0x0;this['paused']=0x0;for(var _0x77b4a5=0x0;_0x77b4a5=0x0?this['available']:0x0;var _0x229fd9={'id':this['id'],'available':this[_0x471b('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x471b('0x8')],'paused':this['paused'],'waiting':this[_0x471b('0x19')]};var _0xbbef49=md5(JSON[_0x471b('0x1a')](_0x229fd9));if(this[_0x471b('0x1')]!==_0xbbef49){this[_0x471b('0x1')]=_0xbbef49;io['to'](util['format'](_0x471b('0x1b'),_0x229fd9[_0x471b('0x8')]))[_0x471b('0x1c')](_0x471b('0x1d'),_0x229fd9);}};module[_0x471b('0x1e')]=FaxQueue; \ No newline at end of file +var _0x4dd7=['strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','faxPause','available','paused','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x4dd7,0x14a));var _0x74dd=function(_0x982737,_0x1e01a6){_0x982737=_0x982737-0x0;var _0x24d720=_0x4dd7[_0x982737];return _0x24d720;};'use strict';var _=require(_0x74dd('0x0'));var md5=require(_0x74dd('0x1'));var util=require(_0x74dd('0x2'));var Redis=require(_0x74dd('0x3'));var config=require(_0x74dd('0x4'));config[_0x74dd('0x5')]=_[_0x74dd('0x6')](config[_0x74dd('0x5')],{'host':_0x74dd('0x7'),'port':0x18eb});var io=require(_0x74dd('0x8'))(new Redis(config['redis']));function FaxQueue(_0x500ba4){this['id']=_0x500ba4['id']||0x0;this['name']=_0x500ba4[_0x74dd('0x9')]||'';this[_0x74dd('0xa')]=_0x500ba4[_0x74dd('0xa')]||0xa;this[_0x74dd('0xb')]=_0x500ba4[_0x74dd('0xb')]||_0x74dd('0xc');this['Agents']=_0x500ba4[_0x74dd('0xd')];this[_0x74dd('0xe')]={};this[_0x74dd('0xf')]=0x0;this['md5']='';this['updateRouting']();this[_0x74dd('0x10')]();}FaxQueue[_0x74dd('0x11')][_0x74dd('0x12')]=function(){var _0x5e43bf=this[_0x74dd('0xe')][_0x74dd('0x13')];this[_0x74dd('0xe')]=_[_0x74dd('0x14')](this['Agents'],'id');this['mapAgentsId'][_0x74dd('0x13')]=_0x5e43bf;};FaxQueue[_0x74dd('0x11')][_0x74dd('0x10')]=function(){this[_0x74dd('0x15')]=0x0;this['paused']=0x0;for(var _0x18362c=0x0;_0x18362c=0x0?this[_0x74dd('0x18')]:0x0;var _0x2950c6={'id':this['id'],'available':this[_0x74dd('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x74dd('0x9')],'paused':this[_0x74dd('0x19')],'waiting':this[_0x74dd('0xf')]};var _0x4c83b7=md5(JSON['stringify'](_0x2950c6));if(this['md5']!==_0x4c83b7){this[_0x74dd('0x1')]=_0x4c83b7;io['to'](util[_0x74dd('0x1a')](_0x74dd('0x1b'),_0x2950c6[_0x74dd('0x9')]))[_0x74dd('0x1c')](_0x74dd('0x1d'),_0x2950c6);}};module[_0x74dd('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 79e3a0d..9853c5f 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 _0x5681=['name','Intervals'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x5681,0x1c4));var _0x1568=function(_0x3e7159,_0x8ea38){_0x3e7159=_0x3e7159-0x0;var _0x4cbff9=_0x5681[_0x3e7159];return _0x4cbff9;};'use strict';function Interval(_0x4ce923){this['id']=_0x4ce923['id']||0x0;this[_0x1568('0x0')]=_0x4ce923['name']||'';this['Intervals']=_0x4ce923[_0x1568('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xe2da=['Intervals','name'];(function(_0x385142,_0x25aa0e){var _0x5a02fd=function(_0x42e60c){while(--_0x42e60c){_0x385142['push'](_0x385142['shift']());}};_0x5a02fd(++_0x25aa0e);}(_0xe2da,0x1eb));var _0xae2d=function(_0x406e1c,_0x4acb3e){_0x406e1c=_0x406e1c-0x0;var _0x2166f1=_0xe2da[_0x406e1c];return _0x2166f1;};'use strict';function Interval(_0x4131ba){this['id']=_0x4131ba['id']||0x0;this['name']=_0x4131ba[_0xae2d('0x0')]||'';this[_0xae2d('0x1')]=_0x4131ba['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 430520d..a3ffa16 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 _0xfc95=['Agents','mapAgentsId','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','redis','defaults','name','timeout','beepall'];(function(_0x41a04f,_0x51e497){var _0x211f50=function(_0x28aa67){while(--_0x28aa67){_0x41a04f['push'](_0x41a04f['shift']());}};_0x211f50(++_0x51e497);}(_0xfc95,0x196));var _0x5fc9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xfc95[_0x2a5099];return _0x2802f1;};'use strict';var _=require('lodash');var md5=require(_0x5fc9('0x0'));var util=require(_0x5fc9('0x1'));var Redis=require(_0x5fc9('0x2'));var config=require('../../../config/environment');config[_0x5fc9('0x3')]=_[_0x5fc9('0x4')](config[_0x5fc9('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5fc9('0x3')]));function MailQueue(_0x3669f1){this['id']=_0x3669f1['id']||0x0;this[_0x5fc9('0x5')]=_0x3669f1[_0x5fc9('0x5')]||'';this['timeout']=_0x3669f1[_0x5fc9('0x6')]||0xa;this['strategy']=_0x3669f1['strategy']||_0x5fc9('0x7');this['Agents']=_0x3669f1[_0x5fc9('0x8')];this[_0x5fc9('0x9')]={};this['waiting']=0x0;this[_0x5fc9('0x0')]='';this['updateRouting']();this[_0x5fc9('0xa')]();}MailQueue[_0x5fc9('0xb')]['updateRouting']=function(){var _0x128b06=this[_0x5fc9('0x9')][_0x5fc9('0xc')];this[_0x5fc9('0x9')]=_['map'](this['Agents'],'id');this[_0x5fc9('0x9')][_0x5fc9('0xc')]=_0x128b06;};MailQueue[_0x5fc9('0xb')]['updateRealtime']=function(){this[_0x5fc9('0xd')]=0x0;this[_0x5fc9('0xe')]=0x0;for(var _0x3ab91b=0x0;_0x3ab91b=0x0?this[_0x5fc9('0x11')]:0x0;var _0x2c5fcc={'id':this['id'],'available':this[_0x5fc9('0x11')],'loggedIn':this[_0x5fc9('0xd')],'name':this['name'],'paused':this[_0x5fc9('0xe')],'waiting':this['waiting']};var _0x3853c6=md5(JSON[_0x5fc9('0x12')](_0x2c5fcc));if(this[_0x5fc9('0x0')]!==_0x3853c6){this['md5']=_0x3853c6;io['to'](util[_0x5fc9('0x13')](_0x5fc9('0x14'),_0x2c5fcc[_0x5fc9('0x5')]))[_0x5fc9('0x15')](_0x5fc9('0x16'),_0x2c5fcc);}};module['exports']=MailQueue; \ No newline at end of file +var _0x9881=['length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x9881,0xb7));var _0x1988=function(_0x539592,_0x160280){_0x539592=_0x539592-0x0;var _0x3979b0=_0x9881[_0x539592];return _0x3979b0;};'use strict';var _=require(_0x1988('0x0'));var md5=require(_0x1988('0x1'));var util=require(_0x1988('0x2'));var Redis=require(_0x1988('0x3'));var config=require(_0x1988('0x4'));config[_0x1988('0x5')]=_['defaults'](config[_0x1988('0x5')],{'host':_0x1988('0x6'),'port':0x18eb});var io=require(_0x1988('0x7'))(new Redis(config[_0x1988('0x5')]));function MailQueue(_0x52bf1f){this['id']=_0x52bf1f['id']||0x0;this['name']=_0x52bf1f[_0x1988('0x8')]||'';this['timeout']=_0x52bf1f[_0x1988('0x9')]||0xa;this[_0x1988('0xa')]=_0x52bf1f[_0x1988('0xa')]||'beepall';this['Agents']=_0x52bf1f[_0x1988('0xb')];this[_0x1988('0xc')]={};this[_0x1988('0xd')]=0x0;this['md5']='';this[_0x1988('0xe')]();this['updateRealtime']();}MailQueue[_0x1988('0xf')][_0x1988('0xe')]=function(){var _0x2b392e=this['mapAgentsId'][_0x1988('0x10')];this[_0x1988('0xc')]=_['map'](this[_0x1988('0xb')],'id');this[_0x1988('0xc')][_0x1988('0x10')]=_0x2b392e;};MailQueue[_0x1988('0xf')][_0x1988('0x11')]=function(){this[_0x1988('0x12')]=0x0;this[_0x1988('0x13')]=0x0;for(var _0x190d9d=0x0;_0x190d9d=0x0?this[_0x1988('0x17')]:0x0;var _0x4a637f={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1988('0x8')],'paused':this['paused'],'waiting':this[_0x1988('0xd')]};var _0x308758=md5(JSON['stringify'](_0x4a637f));if(this[_0x1988('0x1')]!==_0x308758){this['md5']=_0x308758;io['to'](util[_0x1988('0x18')](_0x1988('0x19'),_0x4a637f[_0x1988('0x8')]))[_0x1988('0x1a')](_0x1988('0x1b'),_0x4a637f);}};module[_0x1988('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0355044..1ce4ac9 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x122cac,_0x473824){var _0xe35004=function(_0x2f7953){while(--_0x2f7953){_0x122cac['push'](_0x122cac['shift']());}};_0xe35004(++_0x473824);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x5fc3[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x1261,0x144));var _0x1126=function(_0xea98ab,_0x297344){_0xea98ab=_0xea98ab-0x0;var _0x39058e=_0x1261[_0xea98ab];return _0x39058e;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index efb6eb2..7b20002 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 _0x4a81=['ioredis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','length','online','smsPause','available','paused','stringify','format','sms_queue:save','lodash','md5','util'];(function(_0x3232e3,_0x1f08db){var _0x5736ba=function(_0x37c167){while(--_0x37c167){_0x3232e3['push'](_0x3232e3['shift']());}};_0x5736ba(++_0x1f08db);}(_0x4a81,0x1b7));var _0x14a8=function(_0x10ad04,_0x3e5169){_0x10ad04=_0x10ad04-0x0;var _0x586228=_0x4a81[_0x10ad04];return _0x586228;};'use strict';var _=require(_0x14a8('0x0'));var md5=require(_0x14a8('0x1'));var util=require(_0x14a8('0x2'));var Redis=require(_0x14a8('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x14a8('0x4')](config['redis'],{'host':_0x14a8('0x5'),'port':0x18eb});var io=require(_0x14a8('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5c04ef){this['id']=_0x5c04ef['id']||0x0;this[_0x14a8('0x7')]=_0x5c04ef['name']||'';this[_0x14a8('0x8')]=_0x5c04ef['timeout']||0xa;this[_0x14a8('0x9')]=_0x5c04ef[_0x14a8('0x9')]||_0x14a8('0xa');this[_0x14a8('0xb')]=_0x5c04ef[_0x14a8('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x14a8('0x1')]='';this[_0x14a8('0xc')]();this[_0x14a8('0xd')]();}SmsQueue['prototype'][_0x14a8('0xc')]=function(){var _0x34f6e1=this[_0x14a8('0xe')][_0x14a8('0xf')];this[_0x14a8('0xe')]=_[_0x14a8('0x10')](this[_0x14a8('0xb')],'id');this[_0x14a8('0xe')]['_rr']=_0x34f6e1;};SmsQueue['prototype'][_0x14a8('0xd')]=function(){this[_0x14a8('0x11')]=0x0;this['paused']=0x0;for(var _0x19d25e=0x0;_0x19d25e=0x0?this[_0x14a8('0x15')]:0x0;var _0x1dac45={'id':this['id'],'available':this[_0x14a8('0x15')],'loggedIn':this[_0x14a8('0x11')],'name':this[_0x14a8('0x7')],'paused':this[_0x14a8('0x16')],'waiting':this['waiting']};var _0x208f70=md5(JSON[_0x14a8('0x17')](_0x1dac45));if(this['md5']!==_0x208f70){this['md5']=_0x208f70;io['to'](util[_0x14a8('0x18')]('sms:queue:%s',_0x1dac45[_0x14a8('0x7')]))['emit'](_0x14a8('0x19'),_0x1dac45);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x9b87=['emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','stringify','format','sms:queue:%s'];(function(_0x3bd1be,_0x18942b){var _0x361d8f=function(_0x302f8e){while(--_0x302f8e){_0x3bd1be['push'](_0x3bd1be['shift']());}};_0x361d8f(++_0x18942b);}(_0x9b87,0x8e));var _0x79b8=function(_0x514eff,_0x14e2b8){_0x514eff=_0x514eff-0x0;var _0x2608d6=_0x9b87[_0x514eff];return _0x2608d6;};'use strict';var _=require(_0x79b8('0x0'));var md5=require(_0x79b8('0x1'));var util=require(_0x79b8('0x2'));var Redis=require(_0x79b8('0x3'));var config=require(_0x79b8('0x4'));config[_0x79b8('0x5')]=_[_0x79b8('0x6')](config[_0x79b8('0x5')],{'host':_0x79b8('0x7'),'port':0x18eb});var io=require(_0x79b8('0x8'))(new Redis(config[_0x79b8('0x5')]));function SmsQueue(_0x399796){this['id']=_0x399796['id']||0x0;this[_0x79b8('0x9')]=_0x399796[_0x79b8('0x9')]||'';this[_0x79b8('0xa')]=_0x399796[_0x79b8('0xa')]||0xa;this['strategy']=_0x399796['strategy']||'beepall';this['Agents']=_0x399796[_0x79b8('0xb')];this[_0x79b8('0xc')]={};this[_0x79b8('0xd')]=0x0;this['md5']='';this[_0x79b8('0xe')]();this[_0x79b8('0xf')]();}SmsQueue[_0x79b8('0x10')]['updateRouting']=function(){var _0x5a4683=this[_0x79b8('0xc')][_0x79b8('0x11')];this[_0x79b8('0xc')]=_[_0x79b8('0x12')](this[_0x79b8('0xb')],'id');this[_0x79b8('0xc')][_0x79b8('0x11')]=_0x5a4683;};SmsQueue[_0x79b8('0x10')][_0x79b8('0xf')]=function(){this[_0x79b8('0x13')]=0x0;this[_0x79b8('0x14')]=0x0;for(var _0x59e229=0x0;_0x59e229=0x0?this[_0x79b8('0x16')]:0x0;var _0x383a34={'id':this['id'],'available':this[_0x79b8('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x79b8('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x9bcb94=md5(JSON[_0x79b8('0x17')](_0x383a34));if(this[_0x79b8('0x1')]!==_0x9bcb94){this[_0x79b8('0x1')]=_0x9bcb94;io['to'](util[_0x79b8('0x18')](_0x79b8('0x19'),_0x383a34[_0x79b8('0x9')]))[_0x79b8('0x1a')](_0x79b8('0x1b'),_0x383a34);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 035e4a4..926d56f 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 _0xd7fe=['prototype','_rr','map','paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime'];(function(_0x20eca8,_0x5cf63f){var _0x1dd774=function(_0x85e754){while(--_0x85e754){_0x20eca8['push'](_0x20eca8['shift']());}};_0x1dd774(++_0x5cf63f);}(_0xd7fe,0xfe));var _0xed7f=function(_0x43c115,_0x1d8aa1){_0x43c115=_0x43c115-0x0;var _0x55c19f=_0xd7fe[_0x43c115];return _0x55c19f;};'use strict';var _=require(_0xed7f('0x0'));var md5=require('md5');var util=require(_0xed7f('0x1'));var Redis=require(_0xed7f('0x2'));var config=require(_0xed7f('0x3'));config[_0xed7f('0x4')]=_['defaults'](config[_0xed7f('0x4')],{'host':_0xed7f('0x5'),'port':0x18eb});var io=require(_0xed7f('0x6'))(new Redis(config[_0xed7f('0x4')]));function WhatsappQueue(_0x148638){this['id']=_0x148638['id']||0x0;this[_0xed7f('0x7')]=_0x148638['name']||'';this[_0xed7f('0x8')]=_0x148638[_0xed7f('0x8')]||0xa;this[_0xed7f('0x9')]=_0x148638['strategy']||_0xed7f('0xa');this[_0xed7f('0xb')]=_0x148638[_0xed7f('0xb')];this[_0xed7f('0xc')]={};this[_0xed7f('0xd')]=0x0;this[_0xed7f('0xe')]='';this['updateRouting']();this[_0xed7f('0xf')]();}WhatsappQueue[_0xed7f('0x10')]['updateRouting']=function(){var _0x46601d=this[_0xed7f('0xc')][_0xed7f('0x11')];this[_0xed7f('0xc')]=_[_0xed7f('0x12')](this[_0xed7f('0xb')],'id');this[_0xed7f('0xc')][_0xed7f('0x11')]=_0x46601d;};WhatsappQueue['prototype'][_0xed7f('0xf')]=function(){this['loggedIn']=0x0;this[_0xed7f('0x13')]=0x0;for(var _0x54dbc5=0x0;_0x54dbc5=0x0?this[_0xed7f('0x17')]:0x0;var _0x512b52={'id':this['id'],'available':this['available'],'loggedIn':this[_0xed7f('0x15')],'name':this[_0xed7f('0x7')],'paused':this[_0xed7f('0x13')],'waiting':this[_0xed7f('0xd')]};var _0x4f78cb=md5(JSON[_0xed7f('0x18')](_0x512b52));if(this['md5']!==_0x4f78cb){this[_0xed7f('0xe')]=_0x4f78cb;io['to'](util[_0xed7f('0x19')](_0xed7f('0x1a'),_0x512b52[_0xed7f('0x7')]))[_0xed7f('0x1b')](_0xed7f('0x1c'),_0x512b52);}};module[_0xed7f('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x493d=['Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x493d,0xae));var _0xd493=function(_0x107741,_0x135bfd){_0x107741=_0x107741-0x0;var _0x42f9e1=_0x493d[_0x107741];return _0x42f9e1;};'use strict';var _=require(_0xd493('0x0'));var md5=require('md5');var util=require(_0xd493('0x1'));var Redis=require(_0xd493('0x2'));var config=require(_0xd493('0x3'));config[_0xd493('0x4')]=_[_0xd493('0x5')](config[_0xd493('0x4')],{'host':_0xd493('0x6'),'port':0x18eb});var io=require(_0xd493('0x7'))(new Redis(config[_0xd493('0x4')]));function WhatsappQueue(_0xef45c4){this['id']=_0xef45c4['id']||0x0;this[_0xd493('0x8')]=_0xef45c4[_0xd493('0x8')]||'';this['timeout']=_0xef45c4[_0xd493('0x9')]||0xa;this['strategy']=_0xef45c4[_0xd493('0xa')]||_0xd493('0xb');this[_0xd493('0xc')]=_0xef45c4[_0xd493('0xc')];this[_0xd493('0xd')]={};this['waiting']=0x0;this[_0xd493('0xe')]='';this[_0xd493('0xf')]();this[_0xd493('0x10')]();}WhatsappQueue[_0xd493('0x11')]['updateRouting']=function(){var _0x1838b2=this[_0xd493('0xd')][_0xd493('0x12')];this['mapAgentsId']=_[_0xd493('0x13')](this['Agents'],'id');this[_0xd493('0xd')][_0xd493('0x12')]=_0x1838b2;};WhatsappQueue[_0xd493('0x11')]['updateRealtime']=function(){this[_0xd493('0x14')]=0x0;this[_0xd493('0x15')]=0x0;for(var _0x194f7a=0x0;_0x194f7a=0x0?this['available']:0x0;var _0x1dad59={'id':this['id'],'available':this[_0xd493('0x18')],'loggedIn':this[_0xd493('0x14')],'name':this[_0xd493('0x8')],'paused':this[_0xd493('0x15')],'waiting':this[_0xd493('0x19')]};var _0xf61bcc=md5(JSON[_0xd493('0x1a')](_0x1dad59));if(this[_0xd493('0xe')]!==_0xf61bcc){this['md5']=_0xf61bcc;io['to'](util[_0xd493('0x1b')](_0xd493('0x1c'),_0x1dad59[_0xd493('0x8')]))['emit'](_0xd493('0x1d'),_0x1dad59);}};module[_0xd493('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 22e2fbd..4503736 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 906a9bc..302d0ca 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 _0x4a8d=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x290ef5,_0x32cfa7){var _0x450d92=function(_0x4308db){while(--_0x4308db){_0x290ef5['push'](_0x290ef5['shift']());}};_0x450d92(++_0x32cfa7);}(_0x4a8d,0x12e));var _0xd4a8=function(_0x2e1b8c,_0x49e918){_0x2e1b8c=_0x2e1b8c-0x0;var _0x999caa=_0x4a8d[_0x2e1b8c];return _0x999caa;};'use strict';var client=require('../client');exports[_0xd4a8('0x0')]=function(_0x336381,_0x53005a){return client[_0xd4a8('0x1')](_0xd4a8('0x2'),{'body':_0x53005a,'options':{'where':{'id':_0x336381}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x13959e,_0x4df559){return client[_0xd4a8('0x1')](_0xd4a8('0x3'),{'body':_0x4df559,'options':{'where':{'id':_0x13959e}},'log':_0xd4a8('0x4')});}; \ No newline at end of file +var _0x5695=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x48ce41,_0x5b31e3){var _0x15595c=function(_0x2c3888){while(--_0x2c3888){_0x48ce41['push'](_0x48ce41['shift']());}};_0x15595c(++_0x5b31e3);}(_0x5695,0xe4));var _0x5569=function(_0x4264bf,_0x39db0f){_0x4264bf=_0x4264bf-0x0;var _0x515e5f=_0x5695[_0x4264bf];return _0x515e5f;};'use strict';var client=require(_0x5569('0x0'));exports['update']=function(_0x490f08,_0x392d8e){return client[_0x5569('0x1')](_0x5569('0x2'),{'body':_0x392d8e,'options':{'where':{'id':_0x490f08}},'log':_0x5569('0x3')});};exports[_0x5569('0x4')]=function(_0x5d7c9b,_0x182d5e){return client[_0x5569('0x1')](_0x5569('0x5'),{'body':_0x182d5e,'options':{'where':{'id':_0x5d7c9b}},'log':_0x5569('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 7a8935e..0a398c9 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 _0xb074=['../client','Request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb074,0x13a));var _0x4b07=function(_0x2d519e,_0x2db1ea){_0x2d519e=_0x2d519e-0x0;var _0x4404c9=_0xb074[_0x2d519e];return _0x4404c9;};'use strict';var client=require(_0x4b07('0x0'));exports['create']=function(_0x4afdb2){return client[_0x4b07('0x1')]('CreateChatMessage',{'body':_0x4afdb2,'log':'createChatMessage'});}; \ No newline at end of file +var _0x11bd=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0xa1077a,_0x19049d){var _0x5d1859=function(_0x54d1c0){while(--_0x54d1c0){_0xa1077a['push'](_0xa1077a['shift']());}};_0x5d1859(++_0x19049d);}(_0x11bd,0x1ee));var _0xd11b=function(_0x347842,_0x44a39c){_0x347842=_0x347842-0x0;var _0x2748d0=_0x11bd[_0x347842];return _0x2748d0;};'use strict';var client=require(_0xd11b('0x0'));exports[_0xd11b('0x1')]=function(_0x262dde){return client[_0xd11b('0x2')](_0xd11b('0x3'),{'body':_0x262dde,'log':_0xd11b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f2f37ea..66e89a9 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 _0xf2e0=['chatPause','../client','getChatQueues','GetChatQueue','name','strategy','User','Agents','online'];(function(_0xe35959,_0xa9f05c){var _0x413148=function(_0x4f20c8){while(--_0x4f20c8){_0xe35959['push'](_0xe35959['shift']());}};_0x413148(++_0xa9f05c);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xf2e0[_0x491a7f];return _0x3d8f44;};'use strict';var client=require(_0x0f2e('0x0'));exports[_0x0f2e('0x1')]=function(){return function(){return client['Request'](_0x0f2e('0x2'),{'options':{'raw':![],'attributes':['id',_0x0f2e('0x3'),'timeout',_0x0f2e('0x4')],'include':[{'model':_0x0f2e('0x5'),'as':_0x0f2e('0x6'),'attributes':['id','name',_0x0f2e('0x7'),_0x0f2e('0x8')]}]},'log':_0x0f2e('0x1')});};}; \ No newline at end of file +var _0x2bae=['name','timeout','User','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x475740,_0x2e08c8){var _0x31da43=function(_0x4d23aa){while(--_0x4d23aa){_0x475740['push'](_0x475740['shift']());}};_0x31da43(++_0x2e08c8);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe2ba('0x0'));exports[_0xe2ba('0x1')]=function(){return function(){return client[_0xe2ba('0x2')](_0xe2ba('0x3'),{'options':{'raw':![],'attributes':['id',_0xe2ba('0x4'),_0xe2ba('0x5'),'strategy'],'include':[{'model':_0xe2ba('0x6'),'as':'Agents','attributes':['id',_0xe2ba('0x4'),'online',_0xe2ba('0x7')]}]},'log':_0xe2ba('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 783f5ff..bbebb93 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 _0xc6ab=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6ab,0x96));var _0xbc6a=function(_0x2fce73,_0x188e65){_0x2fce73=_0x2fce73-0x0;var _0xdf0728=_0xc6ab[_0x2fce73];return _0xdf0728;};'use strict';var client=require(_0xbc6a('0x0'));exports[_0xbc6a('0x1')]=function(_0x46da42){return client[_0xbc6a('0x2')](_0xbc6a('0x3'),{'body':_0x46da42,'log':'CreateChatQueueReport'});};exports['update']=function(_0xbf9d02,_0x1c351c){return client[_0xbc6a('0x2')](_0xbc6a('0x4'),{'body':_0x1c351c,'options':{'where':{'uniqueid':_0xbf9d02},'order':[['id',_0xbc6a('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xffdc=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x12cdb4,_0x356e67){var _0x3cde1e=function(_0x17ec35){while(--_0x17ec35){_0x12cdb4['push'](_0x12cdb4['shift']());}};_0x3cde1e(++_0x356e67);}(_0xffdc,0x7f));var _0xcffd=function(_0x46bc75,_0x3fda3b){_0x46bc75=_0x46bc75-0x0;var _0x3294c5=_0xffdc[_0x46bc75];return _0x3294c5;};'use strict';var client=require(_0xcffd('0x0'));exports[_0xcffd('0x1')]=function(_0x56b164){return client[_0xcffd('0x2')](_0xcffd('0x3'),{'body':_0x56b164,'log':'CreateChatQueueReport'});};exports[_0xcffd('0x4')]=function(_0x234c50,_0x37c566){return client[_0xcffd('0x2')](_0xcffd('0x5'),{'body':_0x37c566,'options':{'where':{'uniqueid':_0x234c50},'order':[['id','DESC']],'limit':0x1},'log':_0xcffd('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 78a044e..ab024a9 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x7a54,0x106));var _0x47a5=function(_0x5cf9dd,_0x3f4567){_0x5cf9dd=_0x5cf9dd-0x0;var _0x259c55=_0x7a54[_0x5cf9dd];return _0x259c55;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x7a54,0x106));var _0x47a5=function(_0x4a163f,_0x2fefe5){_0x4a163f=_0x4a163f-0x0;var _0x44f7f4=_0x7a54[_0x4a163f];return _0x44f7f4;};'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 9840171..8873a93 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 _0x2ce0=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2ce0,0x13e));var _0x02ce=function(_0xb6f9f1,_0x263eae){_0xb6f9f1=_0xb6f9f1-0x0;var _0x33d4a0=_0x2ce0[_0xb6f9f1];return _0x33d4a0;};'use strict';var client=require(_0x02ce('0x0'));exports[_0x02ce('0x1')]=function(_0x46f736){return client[_0x02ce('0x2')](_0x02ce('0x3'),{'body':_0x46f736,'log':_0x02ce('0x4')});}; \ No newline at end of file +var _0x1590=['Request','CreateFaxMessage','../client','create'];(function(_0x5da4e0,_0x4e560a){var _0x532670=function(_0x14649c){while(--_0x14649c){_0x5da4e0['push'](_0x5da4e0['shift']());}};_0x532670(++_0x4e560a);}(_0x1590,0x1ee));var _0x0159=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1590[_0x1f9f37];return _0x21c080;};'use strict';var client=require(_0x0159('0x0'));exports[_0x0159('0x1')]=function(_0x469749){return client[_0x0159('0x2')](_0x0159('0x3'),{'body':_0x469749,'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 2aa954d..7de4ccf 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 _0x51ee=['online','faxPause','getFaxQueues','../client','name','timeout','strategy','User','Agents'];(function(_0x37ac2c,_0x5b4aaa){var _0x4276b8=function(_0x1d0158){while(--_0x1d0158){_0x37ac2c['push'](_0x37ac2c['shift']());}};_0x4276b8(++_0x5b4aaa);}(_0x51ee,0x1f2));var _0xe51e=function(_0x3b6bd8,_0x16f06a){_0x3b6bd8=_0x3b6bd8-0x0;var _0xe9c612=_0x51ee[_0x3b6bd8];return _0xe9c612;};'use strict';var client=require(_0xe51e('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xe51e('0x1'),_0xe51e('0x2'),_0xe51e('0x3')],'include':[{'model':_0xe51e('0x4'),'as':_0xe51e('0x5'),'attributes':['id',_0xe51e('0x1'),_0xe51e('0x6'),_0xe51e('0x7')]}]},'log':_0xe51e('0x8')});};}; \ No newline at end of file +var _0x9c65=['User','Agents','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x9c65,0x159));var _0x59c6=function(_0x2898f7,_0x283d1d){_0x2898f7=_0x2898f7-0x0;var _0x2c6fc5=_0x9c65[_0x2898f7];return _0x2c6fc5;};'use strict';var client=require(_0x59c6('0x0'));exports[_0x59c6('0x1')]=function(){return function(){return client['Request'](_0x59c6('0x2'),{'options':{'raw':![],'attributes':['id',_0x59c6('0x3'),_0x59c6('0x4'),_0x59c6('0x5')],'include':[{'model':_0x59c6('0x6'),'as':_0x59c6('0x7'),'attributes':['id','name','online',_0x59c6('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c56f046..729bbd1 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 _0xbce8=['Request','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport','update'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xbce8,0x1ee));var _0x8bce=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0xbce8[_0x310d10];return _0x1fb8af;};'use strict';var client=require(_0x8bce('0x0'));exports[_0x8bce('0x1')]=function(_0x45e180){return client['Request'](_0x8bce('0x2'),{'body':_0x45e180,'log':_0x8bce('0x2')});};exports[_0x8bce('0x3')]=function(_0x482327,_0x1b8fad){return client[_0x8bce('0x4')](_0x8bce('0x5'),{'body':_0x1b8fad,'options':{'where':{'uniqueid':_0x482327},'order':[['id','DESC']],'limit':0x1},'log':_0x8bce('0x5')});}; \ No newline at end of file +var _0x60de=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x4aa784,_0x264dbd){var _0xfe46c=function(_0x4463cd){while(--_0x4463cd){_0x4aa784['push'](_0x4aa784['shift']());}};_0xfe46c(++_0x264dbd);}(_0x60de,0x77));var _0xe60d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x60de[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0xe60d('0x0'));exports[_0xe60d('0x1')]=function(_0x2f6bc3){return client[_0xe60d('0x2')]('CreateFaxQueueReport',{'body':_0x2f6bc3,'log':_0xe60d('0x3')});};exports['update']=function(_0xda929c,_0xc3127d){return client[_0xe60d('0x2')](_0xe60d('0x4'),{'body':_0xc3127d,'options':{'where':{'uniqueid':_0xda929c},'order':[['id',_0xe60d('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3a9c69e..01a359f 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 _0x8b87=['../client','getIntervals','Request','Interval','name'];(function(_0x506bfd,_0x5e2155){var _0x15c7b6=function(_0x66b829){while(--_0x66b829){_0x506bfd['push'](_0x506bfd['shift']());}};_0x15c7b6(++_0x5e2155);}(_0x8b87,0x1f4));var _0x78b8=function(_0x218923,_0x26ac60){_0x218923=_0x218923-0x0;var _0x25f8f9=_0x8b87[_0x218923];return _0x25f8f9;};'use strict';var client=require(_0x78b8('0x0'));exports[_0x78b8('0x1')]=function(){return function(){return client[_0x78b8('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x78b8('0x3'),'as':'Intervals','attributes':['id',_0x78b8('0x4'),'interval']}]},'log':_0x78b8('0x1')});};}; \ No newline at end of file +var _0x0747=['Interval','Intervals','interval','getIntervals','GetInterval','name'];(function(_0x4e4622,_0x3cb625){var _0x24505d=function(_0x75d2e2){while(--_0x75d2e2){_0x4e4622['push'](_0x4e4622['shift']());}};_0x24505d(++_0x3cb625);}(_0x0747,0x1e4));var _0x7074=function(_0x496436,_0x2a46c1){_0x496436=_0x496436-0x0;var _0x8c4fc5=_0x0747[_0x496436];return _0x8c4fc5;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request'](_0x7074('0x0'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7074('0x1')],'include':[{'model':_0x7074('0x2'),'as':_0x7074('0x3'),'attributes':['id',_0x7074('0x1'),_0x7074('0x4')]}]},'log':_0x7074('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f721ed9..f3cacfd 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 _0xe2cf=['addTags','Request','AddTagsToMailInteraction','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1d2922,_0xdcb3e0){_0x1d2922=_0x1d2922-0x0;var _0x1d7211=_0xe2cf[_0x1d2922];return _0x1d7211;};'use strict';var client=require('../client');exports[_0xfe2c('0x0')]=function(_0x546786,_0x11c3a4){return client['Request'](_0xfe2c('0x1'),{'body':_0x11c3a4,'options':{'where':{'id':_0x546786}},'log':_0xfe2c('0x2')});};exports[_0xfe2c('0x3')]=function(_0x11b6b8,_0x494978){return client[_0xfe2c('0x4')](_0xfe2c('0x5'),{'body':_0x494978,'options':{'where':{'id':_0x11b6b8}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7d25=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7d25,0x8a));var _0x57d2=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x7d25[_0x3e44fa];return _0x2a0aba;};'use strict';var client=require('../client');exports[_0x57d2('0x0')]=function(_0x1537a7,_0x35bca8){return client[_0x57d2('0x1')](_0x57d2('0x2'),{'body':_0x35bca8,'options':{'where':{'id':_0x1537a7}},'log':_0x57d2('0x3')});};exports[_0x57d2('0x4')]=function(_0x5c1baa,_0x5337ca){return client['Request']('AddTagsToMailInteraction',{'body':_0x5337ca,'options':{'where':{'id':_0x5c1baa}},'log':_0x57d2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6e31581..ecb0242 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 _0x854f=['Request','createMailMessage','../client','create'];(function(_0x52f11b,_0x46a2db){var _0x24ed4d=function(_0x51f190){while(--_0x51f190){_0x52f11b['push'](_0x52f11b['shift']());}};_0x24ed4d(++_0x46a2db);}(_0x854f,0x1d2));var _0xf854=function(_0x584b61,_0x6810b6){_0x584b61=_0x584b61-0x0;var _0x290d93=_0x854f[_0x584b61];return _0x290d93;};'use strict';var client=require(_0xf854('0x0'));exports[_0xf854('0x1')]=function(_0x4cc075){return client[_0xf854('0x2')]('CreateMailMessage',{'body':_0x4cc075,'log':_0xf854('0x3')});}; \ No newline at end of file +var _0x43b6=['CreateMailMessage','createMailMessage','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x43b6,0x179));var _0x643b=function(_0x462150,_0x48ac37){_0x462150=_0x462150-0x0;var _0x28a15c=_0x43b6[_0x462150];return _0x28a15c;};'use strict';var client=require('../client');exports[_0x643b('0x0')]=function(_0x30d1c8){return client['Request'](_0x643b('0x1'),{'body':_0x30d1c8,'log':_0x643b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 6ba5d22..4e5817a 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 _0x934e=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x45095b,_0x4f89c9){var _0x5c60ec=function(_0x333ace){while(--_0x333ace){_0x45095b['push'](_0x45095b['shift']());}};_0x5c60ec(++_0x4f89c9);}(_0x934e,0x16d));var _0xe934=function(_0x1bebc8,_0x4db2c0){_0x1bebc8=_0x1bebc8-0x0;var _0x247bb0=_0x934e[_0x1bebc8];return _0x247bb0;};'use strict';var client=require(_0xe934('0x0'));exports[_0xe934('0x1')]=function(){return function(){return client[_0xe934('0x2')](_0xe934('0x3'),{'options':{'raw':![],'attributes':['id',_0xe934('0x4'),_0xe934('0x5'),_0xe934('0x6')],'include':[{'model':_0xe934('0x7'),'as':_0xe934('0x8'),'attributes':['id','name',_0xe934('0x9'),_0xe934('0xa')]}]},'log':_0xe934('0x1')});};}; \ No newline at end of file +var _0xa671=['User','Agents','mailPause','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0xc9b215,_0x49ee80){var _0x356a0d=function(_0x1cad8b){while(--_0x1cad8b){_0xc9b215['push'](_0xc9b215['shift']());}};_0x356a0d(++_0x49ee80);}(_0xa671,0x153));var _0x1a67=function(_0x2b2e81,_0x8f4fd7){_0x2b2e81=_0x2b2e81-0x0;var _0x110630=_0xa671[_0x2b2e81];return _0x110630;};'use strict';var client=require('../client');exports[_0x1a67('0x0')]=function(){return function(){return client[_0x1a67('0x1')](_0x1a67('0x2'),{'options':{'raw':![],'attributes':['id',_0x1a67('0x3'),_0x1a67('0x4'),'strategy'],'include':[{'model':_0x1a67('0x5'),'as':_0x1a67('0x6'),'attributes':['id','name','online',_0x1a67('0x7')]}]},'log':_0x1a67('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 7b2ba8c..64c8741 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 _0x1a22=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1a22,0x152));var _0x21a2=function(_0x5d4510,_0x5aa2c8){_0x5d4510=_0x5d4510-0x0;var _0x3dfae0=_0x1a22[_0x5d4510];return _0x3dfae0;};'use strict';var client=require(_0x21a2('0x0'));exports[_0x21a2('0x1')]=function(_0x448eb5){return client['Request'](_0x21a2('0x2'),{'body':_0x448eb5,'log':_0x21a2('0x2')});};exports['update']=function(_0x42c7a2,_0x568e36){return client[_0x21a2('0x3')](_0x21a2('0x4'),{'body':_0x568e36,'options':{'where':{'uniqueid':_0x42c7a2},'order':[['id',_0x21a2('0x5')]],'limit':0x1},'log':_0x21a2('0x4')});}; \ No newline at end of file +var _0xc32c=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0xc32c,0x162));var _0xcc32=function(_0x10df5c,_0x14c714){_0x10df5c=_0x10df5c-0x0;var _0x9fcba6=_0xc32c[_0x10df5c];return _0x9fcba6;};'use strict';var client=require(_0xcc32('0x0'));exports[_0xcc32('0x1')]=function(_0x2e9bcf){return client[_0xcc32('0x2')](_0xcc32('0x3'),{'body':_0x2e9bcf,'log':_0xcc32('0x3')});};exports[_0xcc32('0x4')]=function(_0x1a7b0c,_0x25e414){return client[_0xcc32('0x2')]('UpdateMailQueueReport',{'body':_0x25e414,'options':{'where':{'uniqueid':_0x1a7b0c},'order':[['id',_0xcc32('0x5')]],'limit':0x1},'log':_0xcc32('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ef02c24..d594207 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 _0xece0=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xece0,0x1bc));var _0x0ece=function(_0x2009d9,_0x58fb32){_0x2009d9=_0x2009d9-0x0;var _0x184540=_0xece0[_0x2009d9];return _0x184540;};'use strict';var client=require(_0x0ece('0x0'));exports[_0x0ece('0x1')]=function(_0x57f6c1,_0x42bf1a){return client[_0x0ece('0x2')](_0x0ece('0x3'),{'body':_0x42bf1a,'options':{'where':{'id':_0x57f6c1}},'log':_0x0ece('0x4')});};exports['addTags']=function(_0x1fed26,_0x6d055d){return client[_0x0ece('0x2')](_0x0ece('0x5'),{'body':_0x6d055d,'options':{'where':{'id':_0x1fed26}},'log':_0x0ece('0x6')});}; \ No newline at end of file +var _0xe458=['updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0xe458,0x69));var _0x8e45=function(_0x5758f4,_0x4735e6){_0x5758f4=_0x5758f4-0x0;var _0x1bcef0=_0xe458[_0x5758f4];return _0x1bcef0;};'use strict';var client=require(_0x8e45('0x0'));exports['update']=function(_0x36cf4c,_0x3d7d35){return client[_0x8e45('0x1')](_0x8e45('0x2'),{'body':_0x3d7d35,'options':{'where':{'id':_0x36cf4c}},'log':_0x8e45('0x3')});};exports[_0x8e45('0x4')]=function(_0x2544f3,_0x1fac86){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x1fac86,'options':{'where':{'id':_0x2544f3}},'log':_0x8e45('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 1938632..4db84b2 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 _0x11ab=['CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5a7188,_0x2ec5ad){var _0x805ef=function(_0x2dfeba){while(--_0x2dfeba){_0x5a7188['push'](_0x5a7188['shift']());}};_0x805ef(++_0x2ec5ad);}(_0x11ab,0x101));var _0xb11a=function(_0x2b96b1,_0x1bb160){_0x2b96b1=_0x2b96b1-0x0;var _0x3c251c=_0x11ab[_0x2b96b1];return _0x3c251c;};'use strict';var client=require(_0xb11a('0x0'));exports['create']=function(_0x4f897d){return client['Request'](_0xb11a('0x1'),{'body':_0x4f897d,'log':_0xb11a('0x2')});}; \ No newline at end of file +var _0xdc0a=['create','Request','createOpenchannelMessage'];(function(_0x382d6b,_0x15e2a8){var _0x4d5c19=function(_0x2acb93){while(--_0x2acb93){_0x382d6b['push'](_0x382d6b['shift']());}};_0x4d5c19(++_0x15e2a8);}(_0xdc0a,0x150));var _0xadc0=function(_0x57c2c7,_0x2851b6){_0x57c2c7=_0x57c2c7-0x0;var _0x12efc7=_0xdc0a[_0x57c2c7];return _0x12efc7;};'use strict';var client=require('../client');exports[_0xadc0('0x0')]=function(_0xd18618){return client[_0xadc0('0x1')]('CreateOpenchannelMessage',{'body':_0xd18618,'log':_0xadc0('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f139288..2b93a49 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 _0xcce6=['online','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','strategy'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcce6,0x1d2));var _0x6cce=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xcce6[_0x303064];return _0x5a1d3d;};'use strict';var client=require(_0x6cce('0x0'));exports[_0x6cce('0x1')]=function(){return function(){return client[_0x6cce('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x6cce('0x3'),_0x6cce('0x4'),_0x6cce('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x6cce('0x6'),_0x6cce('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xf04c=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','Agents'];(function(_0x22c673,_0x4a3c2c){var _0x3a1c96=function(_0x5a8b97){while(--_0x5a8b97){_0x22c673['push'](_0x22c673['shift']());}};_0x3a1c96(++_0x4a3c2c);}(_0xf04c,0xfd));var _0xcf04=function(_0x25a74e,_0x2ac460){_0x25a74e=_0x25a74e-0x0;var _0x1635d7=_0xf04c[_0x25a74e];return _0x1635d7;};'use strict';var client=require(_0xcf04('0x0'));exports[_0xcf04('0x1')]=function(){return function(){return client[_0xcf04('0x2')](_0xcf04('0x3'),{'options':{'raw':![],'attributes':['id',_0xcf04('0x4'),'timeout',_0xcf04('0x5')],'include':[{'model':_0xcf04('0x6'),'as':_0xcf04('0x7'),'attributes':['id',_0xcf04('0x4'),'online',_0xcf04('0x8')]}]},'log':_0xcf04('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4c1df1c..a942382 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 _0xc7e1=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x4156f3,_0x4c7411){var _0x4d2082=function(_0x3fb9bf){while(--_0x3fb9bf){_0x4156f3['push'](_0x4156f3['shift']());}};_0x4d2082(++_0x4c7411);}(_0xc7e1,0x76));var _0x1c7e=function(_0x415878,_0x52b8d9){_0x415878=_0x415878-0x0;var _0x56103f=_0xc7e1[_0x415878];return _0x56103f;};'use strict';var client=require(_0x1c7e('0x0'));exports['create']=function(_0x49025b){return client[_0x1c7e('0x1')](_0x1c7e('0x2'),{'body':_0x49025b,'log':_0x1c7e('0x2')});};exports[_0x1c7e('0x3')]=function(_0x5b319a,_0x3f5118){return client[_0x1c7e('0x1')](_0x1c7e('0x4'),{'body':_0x3f5118,'options':{'where':{'uniqueid':_0x5b319a},'order':[['id',_0x1c7e('0x5')]],'limit':0x1},'log':_0x1c7e('0x4')});}; \ No newline at end of file +var _0x3a5d=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x34f1e7,_0x566996){var _0x8155d2=function(_0x5b59b6){while(--_0x5b59b6){_0x34f1e7['push'](_0x34f1e7['shift']());}};_0x8155d2(++_0x566996);}(_0x3a5d,0x193));var _0xd3a5=function(_0x1ae73b,_0x1148bc){_0x1ae73b=_0x1ae73b-0x0;var _0x2fc85b=_0x3a5d[_0x1ae73b];return _0x2fc85b;};'use strict';var client=require(_0xd3a5('0x0'));exports['create']=function(_0x2257d8){return client[_0xd3a5('0x1')](_0xd3a5('0x2'),{'body':_0x2257d8,'log':_0xd3a5('0x2')});};exports[_0xd3a5('0x3')]=function(_0x505fcf,_0x4d9edb){return client[_0xd3a5('0x1')](_0xd3a5('0x4'),{'body':_0x4d9edb,'options':{'where':{'uniqueid':_0x505fcf},'order':[['id',_0xd3a5('0x5')]],'limit':0x1},'log':_0xd3a5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 1c533d5..be12a85 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 _0xafe6=['Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0xafe6,0xac));var _0x6afe=function(_0x3cf1ad,_0x5a153d){_0x3cf1ad=_0x3cf1ad-0x0;var _0x481ca3=_0xafe6[_0x3cf1ad];return _0x481ca3;};'use strict';var client=require(_0x6afe('0x0'));exports[_0x6afe('0x1')]=function(_0x4e052d,_0x59a85d){return client[_0x6afe('0x2')](_0x6afe('0x3'),{'body':_0x59a85d,'options':{'where':{'id':_0x4e052d}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x40d720,_0x176f85){return client[_0x6afe('0x2')](_0x6afe('0x4'),{'body':_0x176f85,'options':{'where':{'id':_0x40d720}},'log':_0x6afe('0x5')});}; \ No newline at end of file +var _0x1354=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1354,0x95));var _0x4135=function(_0x320cb3,_0x49c0cf){_0x320cb3=_0x320cb3-0x0;var _0x899c86=_0x1354[_0x320cb3];return _0x899c86;};'use strict';var client=require(_0x4135('0x0'));exports[_0x4135('0x1')]=function(_0x3cb9a9,_0x27fa62){return client[_0x4135('0x2')](_0x4135('0x3'),{'body':_0x27fa62,'options':{'where':{'id':_0x3cb9a9}},'log':_0x4135('0x4')});};exports['addTags']=function(_0x2c75a3,_0x4ed434){return client[_0x4135('0x2')]('AddTagsToSmsInteraction',{'body':_0x4ed434,'options':{'where':{'id':_0x2c75a3}},'log':_0x4135('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 2ee8fb5..bbe1e36 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 _0x9748=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x37ee41,_0x1bec58){var _0x584c1c=function(_0x538f9b){while(--_0x538f9b){_0x37ee41['push'](_0x37ee41['shift']());}};_0x584c1c(++_0x1bec58);}(_0x9748,0xb9));var _0x8974=function(_0x2b2b30,_0xfd01ba){_0x2b2b30=_0x2b2b30-0x0;var _0x559518=_0x9748[_0x2b2b30];return _0x559518;};'use strict';var client=require('../client');exports[_0x8974('0x0')]=function(_0xf6af3b){return client[_0x8974('0x1')](_0x8974('0x2'),{'body':_0xf6af3b,'log':_0x8974('0x3')});}; \ No newline at end of file +var _0x767c=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x37d557,_0xadd016){var _0xd2bcf3=function(_0x3a3382){while(--_0x3a3382){_0x37d557['push'](_0x37d557['shift']());}};_0xd2bcf3(++_0xadd016);}(_0x767c,0xf6));var _0xc767=function(_0x4cd6ec,_0x50391c){_0x4cd6ec=_0x4cd6ec-0x0;var _0x181b2b=_0x767c[_0x4cd6ec];return _0x181b2b;};'use strict';var client=require(_0xc767('0x0'));exports[_0xc767('0x1')]=function(_0x3a8f57){return client['Request'](_0xc767('0x2'),{'body':_0x3a8f57,'log':_0xc767('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 03d77a6..3cca144 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x444fd3,_0x546a1e){var _0x17b6b3=function(_0x303bea){while(--_0x303bea){_0x444fd3['push'](_0x444fd3['shift']());}};_0x17b6b3(++_0x546a1e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0xcb91[_0x1d128e];return _0x3d5236;};'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 +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x185c79,_0x3db22c){var _0x49e7db=function(_0x28cbf5){while(--_0x28cbf5){_0x185c79['push'](_0x185c79['shift']());}};_0x49e7db(++_0x3db22c);}(_0x70e0,0x17b));var _0x070e=function(_0x416a9a,_0x588e07){_0x416a9a=_0x416a9a-0x0;var _0x4a6d04=_0x70e0[_0x416a9a];return _0x4a6d04;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 2fca3d9..d1f3bfb 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x2fe6fb,_0xd9d626){var _0x6a2221=function(_0x55d967){while(--_0x55d967){_0x2fe6fb['push'](_0x2fe6fb['shift']());}};_0x6a2221(++_0xd9d626);}(_0x3e74,0x175));var _0x43e7=function(_0x3ff979,_0x59e603){_0x3ff979=_0x3ff979-0x0;var _0xfbe34c=_0x3e74[_0x3ff979];return _0xfbe34c;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x711446,_0x1b57ae){var _0x599a3b=function(_0x37d117){while(--_0x37d117){_0x711446['push'](_0x711446['shift']());}};_0x599a3b(++_0x1b57ae);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index c4e99fc..baaab8f 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(_0x54ac43,_0x58b1de){var _0x437da7=function(_0x3fdb82){while(--_0x3fdb82){_0x54ac43['push'](_0x54ac43['shift']());}};_0x437da7(++_0x58b1de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x340c8e,_0x18f717){var _0x33d19c=function(_0x1a8299){while(--_0x1a8299){_0x340c8e['push'](_0x340c8e['shift']());}};_0x33d19c(++_0x18f717);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 ab6de25..05eb5a8 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 _0xcf71=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request'];(function(_0x53e55d,_0x3cbea6){var _0x3dde2e=function(_0x47e44b){while(--_0x47e44b){_0x53e55d['push'](_0x53e55d['shift']());}};_0x3dde2e(++_0x3cbea6);}(_0xcf71,0xba));var _0x1cf7=function(_0x3e9582,_0x5ef882){_0x3e9582=_0x3e9582-0x0;var _0xdf59d7=_0xcf71[_0x3e9582];return _0xdf59d7;};'use strict';var client=require(_0x1cf7('0x0'));exports[_0x1cf7('0x1')]=function(_0x1953aa,_0x259edc){return client['Request'](_0x1cf7('0x2'),{'body':_0x259edc,'options':{'where':{'id':_0x1953aa}},'log':_0x1cf7('0x3')});};exports[_0x1cf7('0x4')]=function(_0x21307d,_0x11e462){return client[_0x1cf7('0x5')](_0x1cf7('0x6'),{'body':_0x11e462,'options':{'where':{'id':_0x21307d}},'log':_0x1cf7('0x7')});}; \ No newline at end of file +var _0x677a=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x99956a,_0x3d5b6c){var _0x3da435=function(_0x188491){while(--_0x188491){_0x99956a['push'](_0x99956a['shift']());}};_0x3da435(++_0x3d5b6c);}(_0x677a,0xd6));var _0xa677=function(_0x155488,_0x5e3f9a){_0x155488=_0x155488-0x0;var _0x4da352=_0x677a[_0x155488];return _0x4da352;};'use strict';var client=require(_0xa677('0x0'));exports['update']=function(_0x3896be,_0x1a14cf){return client[_0xa677('0x1')](_0xa677('0x2'),{'body':_0x1a14cf,'options':{'where':{'id':_0x3896be}},'log':_0xa677('0x3')});};exports['addTags']=function(_0x1ca988,_0x2e46f8){return client[_0xa677('0x1')](_0xa677('0x4'),{'body':_0x2e46f8,'options':{'where':{'id':_0x1ca988}},'log':_0xa677('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4e59103..a16e5df 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 _0x2ccc=['CreateWhatsappMessage','createWhatsappMessage','Request'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x2ccc,0x191));var _0xc2cc=function(_0x3d47ec,_0x5f3354){_0x3d47ec=_0x3d47ec-0x0;var _0x3db7dc=_0x2ccc[_0x3d47ec];return _0x3db7dc;};'use strict';var client=require('../client');exports['create']=function(_0x2012e9){return client[_0xc2cc('0x0')](_0xc2cc('0x1'),{'body':_0x2012e9,'log':_0xc2cc('0x2')});}; \ No newline at end of file +var _0x3a9a=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0xdfd7dc,_0x2f45a1){var _0x5e2f73=function(_0x5a6300){while(--_0x5a6300){_0xdfd7dc['push'](_0xdfd7dc['shift']());}};_0x5e2f73(++_0x2f45a1);}(_0x3a9a,0x153));var _0xa3a9=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x3a9a[_0x383356];return _0x32ee5a;};'use strict';var client=require(_0xa3a9('0x0'));exports[_0xa3a9('0x1')]=function(_0x37c178){return client[_0xa3a9('0x2')](_0xa3a9('0x3'),{'body':_0x37c178,'log':_0xa3a9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index d1fb949..e564472 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 _0x8bd6=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents','online'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0x8bd6,0xfc));var _0x68bd=function(_0xe31fe0,_0x3bb16a){_0xe31fe0=_0xe31fe0-0x0;var _0x10d7cd=_0x8bd6[_0xe31fe0];return _0x10d7cd;};'use strict';var client=require(_0x68bd('0x0'));exports[_0x68bd('0x1')]=function(){return function(){return client[_0x68bd('0x2')](_0x68bd('0x3'),{'options':{'raw':![],'attributes':['id',_0x68bd('0x4'),'timeout',_0x68bd('0x5')],'include':[{'model':_0x68bd('0x6'),'as':_0x68bd('0x7'),'attributes':['id',_0x68bd('0x4'),_0x68bd('0x8'),'whatsappPause']}]},'log':_0x68bd('0x1')});};}; \ No newline at end of file +var _0x7f85=['User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy'];(function(_0x4b7d01,_0x394c1e){var _0xe34570=function(_0xebe1ff){while(--_0xebe1ff){_0x4b7d01['push'](_0x4b7d01['shift']());}};_0xe34570(++_0x394c1e);}(_0x7f85,0xaa));var _0x57f8=function(_0x11160d,_0x413adc){_0x11160d=_0x11160d-0x0;var _0x21520a=_0x7f85[_0x11160d];return _0x21520a;};'use strict';var client=require(_0x57f8('0x0'));exports[_0x57f8('0x1')]=function(){return function(){return client[_0x57f8('0x2')](_0x57f8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x57f8('0x4'),_0x57f8('0x5')],'include':[{'model':_0x57f8('0x6'),'as':_0x57f8('0x7'),'attributes':['id',_0x57f8('0x8'),_0x57f8('0x9'),_0x57f8('0xa')]}]},'log':_0x57f8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 58d6023..c2d4511 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 _0x0dd8=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x2e269b,_0x40cf1d){var _0x223e69=function(_0x13e4ef){while(--_0x13e4ef){_0x2e269b['push'](_0x2e269b['shift']());}};_0x223e69(++_0x40cf1d);}(_0x0dd8,0x8f));var _0x80dd=function(_0x40459e,_0x525aab){_0x40459e=_0x40459e-0x0;var _0x490ff4=_0x0dd8[_0x40459e];return _0x490ff4;};'use strict';var client=require(_0x80dd('0x0'));exports[_0x80dd('0x1')]=function(_0xc35e45){return client[_0x80dd('0x2')]('CreateWhatsappQueueReport',{'body':_0xc35e45,'log':_0x80dd('0x3')});};exports[_0x80dd('0x4')]=function(_0xbfa041,_0xdd5817){return client[_0x80dd('0x2')](_0x80dd('0x5'),{'body':_0xdd5817,'options':{'where':{'uniqueid':_0xbfa041},'order':[['id',_0x80dd('0x6')]],'limit':0x1},'log':_0x80dd('0x5')});}; \ No newline at end of file +var _0xa07d=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa07d,0x156));var _0xda07=function(_0x4d3940,_0x167a82){_0x4d3940=_0x4d3940-0x0;var _0x542862=_0xa07d[_0x4d3940];return _0x542862;};'use strict';var client=require(_0xda07('0x0'));exports[_0xda07('0x1')]=function(_0xcbfbf0){return client[_0xda07('0x2')](_0xda07('0x3'),{'body':_0xcbfbf0,'log':_0xda07('0x3')});};exports[_0xda07('0x4')]=function(_0x51e091,_0x448759){return client[_0xda07('0x2')]('UpdateWhatsappQueueReport',{'body':_0x448759,'options':{'where':{'uniqueid':_0x51e091},'order':[['id',_0xda07('0x5')]],'limit':0x1},'log':_0xda07('0x6')});}; \ 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 8700760..d7add79 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 _0xb763=['timeout','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','find','agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb763,0x117));var _0x3b76=function(_0x26f367,_0x507ec9){_0x26f367=_0x26f367-0x0;var _0x3ba922=_0xb763[_0x26f367];return _0x3ba922;};'use strict';var schema=require(_0x3b76('0x0'));var _=require(_0x3b76('0x1'));var util=require(_0x3b76('0x2'));var seqqueue=require(_0x3b76('0x3'));var logger=require(_0x3b76('0x4'))(_0x3b76('0x5'));var strategy=require(_0x3b76('0x6'));var queue=schema({'name':{'type':_0x3b76('0x7'),'required':!![],'message':_0x3b76('0x8')},'timeout':{'type':_0x3b76('0x9'),'message':_0x3b76('0xa')}});function writeLog(_0x4f6b18,_0x427df3,_0xabe42b){return logger[_0x3b76('0xb')](util[_0x3b76('0xc')](_0x3b76('0xd'),_0x4f6b18,_0x427df3[_0x3b76('0xe')],_0xabe42b));}function handleFindAgent(_0xff2965){return function(_0x324204){return _0x324204[_0x3b76('0xe')]['toLowerCase']()===_0xff2965[_0x3b76('0xf')]();};}exports[_0x3b76('0x10')]=function(_0x3aad9c,_0x2aeab2,_0x324352,_0x516eb0){return function(_0x5cc5ca){try{var _0x16ae7a={'name':_0x2aeab2[0x0],'timeout':_0x2aeab2[0x1]};var _0xaf92e5=queue[_0x3b76('0x0')](_0x16ae7a,{'typecast':!![]});if(_0xaf92e5[_0x3b76('0x11')]){logger[_0x3b76('0x12')](_0x3b76('0x13'),_0x3aad9c,_[_0x3b76('0x14')](_0xaf92e5,_0x3b76('0x15'))[_0x3b76('0x16')](',\x20'));_0x5cc5ca['stop']();}else{var _0x42681a=_[_0x3b76('0x17')](_0x324352[_0x3b76('0x18')],handleFindAgent(_0x16ae7a[_0x3b76('0xe')]));if(_0x42681a){var _0x2c6493=(_0x16ae7a[_0x3b76('0x19')]||0xa)*0x3e8;var _0x1a41a2,_0x25fd84;var _0x2e3f4b=seqqueue['createQueue'](_0x2c6493);_0x2e3f4b['id']=_0x3aad9c;_0x2e3f4b[_0x3b76('0x1a')]=_0x2c6493;_0x2e3f4b[_0x3b76('0x1b')]=_0x516eb0[_0x3b76('0x1b')];writeLog(_0x3aad9c,_0x42681a,util[_0x3b76('0xc')]('START:%s',_0x2c6493));_0x324352[_0x3b76('0x1c')][_0x3aad9c]['on'](_0x3b76('0x1d'),function(){logger[_0x3b76('0xb')](_0x3b76('0x1e'),_0x3aad9c);clearTimeout(_0x25fd84);_0x25fd84=undefined;_0x2e3f4b[_0x3b76('0x1f')]();if(_0x324352[_0x3b76('0x1c')][_0x3aad9c]){delete _0x324352[_0x3b76('0x1c')][_0x3aad9c];}_0x5cc5ca[_0x3b76('0x20')]();});_0x324352['rules'][_0x3aad9c]['on']('complete',function(){if(_0x324352[_0x3b76('0x1c')][_0x3aad9c]){delete _0x324352[_0x3b76('0x1c')][_0x3aad9c];}});_0x25fd84=setTimeout(function(){logger[_0x3b76('0xb')]('[%s][AGENT]\x20ROUTING\x20END',_0x3aad9c);clearTimeout(_0x25fd84);_0x2e3f4b['close']();_0x5cc5ca[_0x3b76('0x21')]();},_0x2c6493);strategy[_0x3b76('0x22')](_0x2e3f4b,_0x42681a,_0x324352,_0x516eb0);}else{logger['error'](_0x3b76('0x23'),_0x3aad9c,_0x16ae7a[_0x3b76('0xe')]);_0x5cc5ca[_0x3b76('0x20')]();}}}catch(_0x992b3f){console['log'](_0x992b3f);logger[_0x3b76('0x12')](_0x3b76('0x24'),_0x3aad9c,_0x992b3f[_0x3b76('0x25')]);_0x5cc5ca['stop']();}};}; \ No newline at end of file +var _0x2b98=['length','error','[%s][AGENT]\x20%s','map','message','join','find','timeout','createQueue','atimeout','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b98,0x109));var _0x82b9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2b98[_0x2b4411];return _0x8e41ef;};'use strict';var schema=require(_0x82b9('0x0'));var _=require(_0x82b9('0x1'));var util=require(_0x82b9('0x2'));var seqqueue=require(_0x82b9('0x3'));var logger=require(_0x82b9('0x4'))(_0x82b9('0x5'));var strategy=require(_0x82b9('0x6'));var queue=schema({'name':{'type':_0x82b9('0x7'),'required':!![],'message':_0x82b9('0x8')},'timeout':{'type':_0x82b9('0x9'),'message':_0x82b9('0xa')}});function writeLog(_0x20f993,_0x34736e,_0x183591){return logger['info'](util[_0x82b9('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x20f993,_0x34736e[_0x82b9('0xc')],_0x183591));}function handleFindAgent(_0x31a705){return function(_0xda0317){return _0xda0317[_0x82b9('0xc')][_0x82b9('0xd')]()===_0x31a705['toLowerCase']();};}exports[_0x82b9('0xe')]=function(_0x53d12a,_0x7b9755,_0x360dc4,_0x3f58f1){return function(_0x5c5924){try{var _0x39a9e1={'name':_0x7b9755[0x0],'timeout':_0x7b9755[0x1]};var _0x17311e=queue['validate'](_0x39a9e1,{'typecast':!![]});if(_0x17311e[_0x82b9('0xf')]){logger[_0x82b9('0x10')](_0x82b9('0x11'),_0x53d12a,_[_0x82b9('0x12')](_0x17311e,_0x82b9('0x13'))[_0x82b9('0x14')](',\x20'));_0x5c5924['stop']();}else{var _0x26d5b1=_[_0x82b9('0x15')](_0x360dc4['agents'],handleFindAgent(_0x39a9e1[_0x82b9('0xc')]));if(_0x26d5b1){var _0x5b0eda=(_0x39a9e1[_0x82b9('0x16')]||0xa)*0x3e8;var _0x238e8d,_0x59aee9;var _0x12f55a=seqqueue[_0x82b9('0x17')](_0x5b0eda);_0x12f55a['id']=_0x53d12a;_0x12f55a[_0x82b9('0x18')]=_0x5b0eda;_0x12f55a['channel']=_0x3f58f1[_0x82b9('0x19')];writeLog(_0x53d12a,_0x26d5b1,util['format'](_0x82b9('0x1a'),_0x5b0eda));_0x360dc4[_0x82b9('0x1b')][_0x53d12a]['on']('end',function(){logger[_0x82b9('0x1c')](_0x82b9('0x1d'),_0x53d12a);clearTimeout(_0x59aee9);_0x59aee9=undefined;_0x12f55a[_0x82b9('0x1e')]();if(_0x360dc4['rules'][_0x53d12a]){delete _0x360dc4['rules'][_0x53d12a];}_0x5c5924[_0x82b9('0x1f')]();});_0x360dc4[_0x82b9('0x1b')][_0x53d12a]['on'](_0x82b9('0x20'),function(){if(_0x360dc4['rules'][_0x53d12a]){delete _0x360dc4[_0x82b9('0x1b')][_0x53d12a];}});_0x59aee9=setTimeout(function(){logger[_0x82b9('0x1c')](_0x82b9('0x21'),_0x53d12a);clearTimeout(_0x59aee9);_0x12f55a['close']();_0x5c5924[_0x82b9('0x22')]();},_0x5b0eda);strategy[_0x82b9('0x23')](_0x12f55a,_0x26d5b1,_0x360dc4,_0x3f58f1);}else{logger[_0x82b9('0x10')](_0x82b9('0x24'),_0x53d12a,_0x39a9e1[_0x82b9('0xc')]);_0x5c5924[_0x82b9('0x1f')]();}}}catch(_0x444377){console[_0x82b9('0x25')](_0x444377);logger[_0x82b9('0x10')](_0x82b9('0x26'),_0x53d12a,_0x444377[_0x82b9('0x27')]);_0x5c5924['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 cac40f7..9cbf3de 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 _0x1c00=['$LATEST','message','channel','toString','amazonlex','providerResponse','dialogState','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime'];(function(_0x322652,_0x5a85c0){var _0x5d5e88=function(_0x5ce853){while(--_0x5ce853){_0x322652['push'](_0x322652['shift']());}};_0x5d5e88(++_0x5a85c0);}(_0x1c00,0x1ca));var _0x01c0=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x1c00[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x01c0('0x0'));var moment=require('moment');var AWS=require(_0x01c0('0x1'));var utils=require(_0x01c0('0x2'));var logger=require(_0x01c0('0x3'))(_0x01c0('0x4'));var rpc={'chatMessage':require(_0x01c0('0x5')),'openchannelMessage':require(_0x01c0('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x01c0('0x7')),'faxMessage':require(_0x01c0('0x8')),'whatsappMessage':require(_0x01c0('0x9'))};exports['consequence']=function(_0x30af88,_0x300363){return function(_0x50b345){try{if(!_['isNil'](this[_0x01c0('0xa')][_0x01c0('0xb')])){logger[_0x01c0('0xc')](_0x01c0('0xd'),_0x30af88,_0x01c0('0xe'));return _0x50b345[_0x01c0('0xf')]();}var _0x36a89c={'ContactId':this[_0x01c0('0x10')]['id'],'sentAt':moment()[_0x01c0('0x11')](_0x01c0('0x12')),'direction':_0x01c0('0x13')};if(this['channel']===_0x01c0('0x14')||this['channel']===_0x01c0('0x15')){_0x36a89c['phone']=this[_0x01c0('0xa')][_0x01c0('0x16')];}var _0x394b60=this['channel'];if(_0x394b60==='chat'){_0x36a89c[_0x01c0('0x17')]=this[_0x01c0('0x18')]['id'];}else{_0x36a89c[_[_0x01c0('0x19')](_0x394b60)+_0x01c0('0x1a')]=this[_0x01c0('0x18')]['id'];}_0x36a89c[_[_0x01c0('0x19')](_0x394b60)+_0x01c0('0x1b')]=this[_0x01c0('0xa')]['id'];if(this[_0x01c0('0xa')][_0x01c0('0x1c')]){var _0x30acd8=_0x300363[0x4];if(!_[_0x01c0('0x1d')](_0x30acd8)){_0x36a89c[_0x01c0('0x1e')]=utils[_0x01c0('0x1f')](_0x30acd8,this);return rpc[_0x394b60+_0x01c0('0x20')][_0x01c0('0x21')](_0x36a89c)[_0x01c0('0x22')](function(_0x5de904){logger['info'](_0x01c0('0xd'),_0x30af88,_0x36a89c['body']);})['catch'](function(_0x5b4738){logger[_0x01c0('0x23')](_0x01c0('0xd'),_0x30af88,JSON[_0x01c0('0x24')](_0x5b4738));})[_0x01c0('0x25')](function(){logger[_0x01c0('0xc')](_0x01c0('0x26'),_0x30af88);_0x50b345[_0x01c0('0x27')]();});}else{logger[_0x01c0('0xc')](_0x01c0('0x28'),_0x30af88);_0x50b345[_0x01c0('0x27')]();}}else{var _0x1a5ee0=this;var _0x577e86=new AWS[(_0x01c0('0x29'))]({'accessKeyId':_0x300363[0x0],'secretAccessKey':_0x300363[0x1],'region':_0x300363[0x2]});var _0xf079c5={'botAlias':_0x01c0('0x2a'),'botName':_0x300363[0x3],'inputText':this[_0x01c0('0x2b')][_0x01c0('0x1e')],'userId':this[_0x01c0('0x2c')]+':'+this[_0x01c0('0xa')]['id'][_0x01c0('0x2d')]()};_0x577e86['postText'](_0xf079c5,function(_0x9b5b47,_0x192639){if(_0x9b5b47){logger['error'](_0x01c0('0xd'),_0x30af88,_0x9b5b47[_0x01c0('0x2b')]);_0x50b345[_0x01c0('0xf')]();}else if(_0x192639&&_0x192639[_0x01c0('0x2b')]){_0x1a5ee0['body']['amazonlex']=_0x192639;_0x36a89c[_0x01c0('0x1e')]=_0x192639[_0x01c0('0x2b')];_0x36a89c['providerName']=_0x01c0('0x2e');_0x36a89c[_0x01c0('0x2f')]=JSON['stringify'](_0x192639);return rpc[_0x394b60+'Message'][_0x01c0('0x21')](_0x36a89c)[_0x01c0('0x22')](function(_0x111dd3){logger[_0x01c0('0xc')]('[%s][AMAZONLEX]\x20%s',_0x30af88,_0x36a89c[_0x01c0('0x1e')]);if(_0x192639[_0x01c0('0x30')]=='Failed'){_0x50b345['next']();}else{_0x50b345[_0x01c0('0x27')]();}})[_0x01c0('0x31')](function(_0x1f8389){logger[_0x01c0('0x23')](_0x01c0('0xd'),_0x30af88,JSON[_0x01c0('0x24')](_0x1f8389));_0x50b345[_0x01c0('0xf')]();});}else{_0x50b345[_0x01c0('0xf')]();}});}}catch(_0x4073bf){logger[_0x01c0('0x23')]('[%s][AMAZONLEX]\x20%s',_0x30af88,JSON[_0x01c0('0x24')](_0x4073bf));_0x50b345[_0x01c0('0x27')]();}};}; \ No newline at end of file +var _0xfc46=['UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc46,0x167));var _0x6fc4=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xfc46[_0x5d61b4];return _0x183fc5;};'use strict';var _=require(_0x6fc4('0x0'));var moment=require(_0x6fc4('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6fc4('0x2'));var logger=require(_0x6fc4('0x3'))(_0x6fc4('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6fc4('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6fc4('0x6')),'faxMessage':require(_0x6fc4('0x7')),'whatsappMessage':require(_0x6fc4('0x8'))};exports[_0x6fc4('0x9')]=function(_0x3e9a28,_0x305785){return function(_0x165feb){try{if(!_[_0x6fc4('0xa')](this[_0x6fc4('0xb')][_0x6fc4('0xc')])){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x165feb[_0x6fc4('0xf')]();}var _0x5af111={'ContactId':this[_0x6fc4('0x10')]['id'],'sentAt':moment()[_0x6fc4('0x11')](_0x6fc4('0x12')),'direction':_0x6fc4('0x13')};if(this[_0x6fc4('0x14')]===_0x6fc4('0x15')||this[_0x6fc4('0x14')]===_0x6fc4('0x16')){_0x5af111[_0x6fc4('0x17')]=this[_0x6fc4('0xb')][_0x6fc4('0x17')];}var _0x4d571e=this[_0x6fc4('0x14')];if(_0x4d571e===_0x6fc4('0x18')){_0x5af111[_0x6fc4('0x19')]=this['account']['id'];}else{_0x5af111[_[_0x6fc4('0x1a')](_0x4d571e)+_0x6fc4('0x1b')]=this[_0x6fc4('0x1c')]['id'];}_0x5af111[_[_0x6fc4('0x1a')](_0x4d571e)+_0x6fc4('0x1d')]=this[_0x6fc4('0xb')]['id'];if(this[_0x6fc4('0xb')][_0x6fc4('0x1e')]){var _0x241a96=_0x305785[0x4];if(!_[_0x6fc4('0x1f')](_0x241a96)){_0x5af111['body']=utils[_0x6fc4('0x20')](_0x241a96,this);return rpc[_0x4d571e+_0x6fc4('0x21')][_0x6fc4('0x22')](_0x5af111)[_0x6fc4('0x23')](function(_0x134e6b){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,_0x5af111[_0x6fc4('0x24')]);})['catch'](function(_0x3274d7){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x3274d7));})[_0x6fc4('0x27')](function(){logger[_0x6fc4('0xd')](_0x6fc4('0x28'),_0x3e9a28);_0x165feb[_0x6fc4('0x29')]();});}else{logger[_0x6fc4('0xd')](_0x6fc4('0x2a'),_0x3e9a28);_0x165feb['stop']();}}else{var _0x80801=this;var _0x5868de=new AWS[(_0x6fc4('0x2b'))]({'accessKeyId':_0x305785[0x0],'secretAccessKey':_0x305785[0x1],'region':_0x305785[0x2]});var _0x55260d={'botAlias':_0x6fc4('0x2c'),'botName':_0x305785[0x3],'inputText':this[_0x6fc4('0x2d')][_0x6fc4('0x24')],'userId':this['channel']+':'+this[_0x6fc4('0xb')]['id'][_0x6fc4('0x2e')]()};_0x5868de[_0x6fc4('0x2f')](_0x55260d,function(_0x33153f,_0x550104){if(_0x33153f){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,_0x33153f['message']);_0x165feb['next']();}else if(_0x550104&&_0x550104[_0x6fc4('0x2d')]){_0x80801[_0x6fc4('0x24')]['amazonlex']=_0x550104;_0x5af111[_0x6fc4('0x24')]=_0x550104[_0x6fc4('0x2d')];_0x5af111['providerName']=_0x6fc4('0x30');_0x5af111[_0x6fc4('0x31')]=JSON[_0x6fc4('0x26')](_0x550104);return rpc[_0x4d571e+'Message'][_0x6fc4('0x22')](_0x5af111)[_0x6fc4('0x23')](function(_0x527ba3){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,_0x5af111[_0x6fc4('0x24')]);if(_0x550104[_0x6fc4('0x32')]==_0x6fc4('0x33')){_0x165feb[_0x6fc4('0xf')]();}else{_0x165feb['stop']();}})[_0x6fc4('0x34')](function(_0x36eff0){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x36eff0));_0x165feb[_0x6fc4('0xf')]();});}else{_0x165feb[_0x6fc4('0xf')]();}});}}catch(_0x45a4ad){logger['error'](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x45a4ad));_0x165feb[_0x6fc4('0x29')]();}};}; \ 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 76ec141..21d70ba 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 _0x39b9=['contact','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','service','Smtp','host','port','secure','auth','pass','messageId','html','','replace','';_0x2bd244[_0x939b('0x38')]={'Auto-Submitted':_0x939b('0x39'),'X-Auto-Response-Suppress':'All','Precedence':_0x939b('0x3a')};return mailRpc['sendMailMessage'](_0x26d97a,_0x2bd244)['then'](function(_0x543089){logger[_0x939b('0x13')](_0x939b('0x3b'),_0x31cbcb);_0x2bd244[_0x939b('0x33')]=_0x543089['message'][_0x939b('0x33')];return rpc[_0x578b39+_0x939b('0x3c')]['create'](_0x2bd244);})[_0x939b('0x3d')](function(_0x4306e6){logger[_0x939b('0x13')](_0x939b('0x14'),_0x31cbcb,JSON['stringify'](_0x4306e6));})[_0x939b('0x3e')](function(_0x4d017e){logger[_0x939b('0x3f')]('[RPC][%s][AUTOREPLY]\x20%s',_0x31cbcb,JSON[_0x939b('0x40')](_0x4d017e));})[_0x939b('0x41')](function(){Promise[_0x939b('0x42')]()[_0x939b('0x3d')](function(){if(_0x29d6dd[0x0]!=='2'||_0x539643[_0x939b('0x1a')])return;return rpc[_0x578b39+_0x939b('0x43')][_0x939b('0x44')](_0x539643['id'],{'autoreplyExecuted':!![]})['then'](function(_0x29c0ef){logger[_0x939b('0x13')](_0x939b('0x1b'),_0x31cbcb,JSON['stringify'](_0x29c0ef));})['catch'](function(_0x2e2817){logger[_0x939b('0x3f')](_0x939b('0x45'),_0x31cbcb,JSON['stringify'](_0x2e2817));});})[_0x939b('0x3d')](function(){_0x21252d['next']();});});}else{return rpc[this[_0x939b('0x10')]+_0x939b('0x3c')]['create'](_0x2bd244)[_0x939b('0x3d')](function(_0x1b4db8){logger['info']('[%s][AUTOREPLY]\x20%s',_0x31cbcb,_0x2bd244['body']);})[_0x939b('0x3e')](function(_0x4c00da){logger[_0x939b('0x3f')](_0x939b('0x14'),_0x31cbcb,JSON[_0x939b('0x40')](_0x4c00da));})[_0x939b('0x41')](function(){Promise['resolve']()['then'](function(){if(_0x29d6dd[0x0]!=='2'||_0x539643[_0x939b('0x1a')])return;return rpc[_0x578b39+'Interaction'][_0x939b('0x44')](_0x539643['id'],{'autoreplyExecuted':!![]})[_0x939b('0x3d')](function(_0x21753f){logger[_0x939b('0x13')](_0x939b('0x1b'),_0x31cbcb,JSON[_0x939b('0x40')](_0x21753f));})[_0x939b('0x3e')](function(_0x5b09ed){logger[_0x939b('0x3f')](_0x939b('0x45'),_0x31cbcb,JSON[_0x939b('0x40')](_0x5b09ed));});})[_0x939b('0x3d')](function(){_0x21252d[_0x939b('0x19')]();});});}}}catch(_0x1259cb){logger[_0x939b('0x3f')](_0x939b('0x14'),_0x31cbcb,JSON[_0x939b('0x40')](_0x1259cb));_0x21252d[_0x939b('0x46')]();}};}; \ No newline at end of file +var _0xa52c=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','channel','mail','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','service','Smtp','host','port','secure','authentication','auth','user','pass','messageId','html','','replace','','headers','auto-replied','All','then','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0xa52c,0xe7));var _0xca52=function(_0x1ee9d0,_0x2ca43b){_0x1ee9d0=_0x1ee9d0-0x0;var _0x230994=_0xa52c[_0x1ee9d0];return _0x230994;};'use strict';var _=require(_0xca52('0x0'));var moment=require(_0xca52('0x1'));var utils=require(_0xca52('0x2'));var logger=require(_0xca52('0x3'))('routing');var rpc={'chatMessage':require(_0xca52('0x4')),'openchannelMessage':require(_0xca52('0x5')),'mailMessage':require(_0xca52('0x6')),'smsMessage':require(_0xca52('0x7')),'faxMessage':require(_0xca52('0x8')),'whatsappMessage':require(_0xca52('0x9')),'chatInteraction':require(_0xca52('0xa')),'openchannelInteraction':require(_0xca52('0xb')),'mailInteraction':require(_0xca52('0xc')),'smsInteraction':require(_0xca52('0xd')),'faxInteraction':require(_0xca52('0xe')),'whatsappInteraction':require(_0xca52('0xf'))};var mailRpc=require(_0xca52('0x10'));exports[_0xca52('0x11')]=function(_0x1885f4,_0x21841e,_0xf11aa2,_0x44c861){return function(_0x2f7936){try{var _0x336e3d=this['channel'];if(_0x336e3d==='mail'&&_0x44c861['body'][_0xca52('0x12')]){logger[_0xca52('0x13')](_0xca52('0x14'),_0x1885f4,_0xca52('0x15'));return _0x2f7936['next']();}if(_0x21841e[0x0]==='1'&&(_[_0xca52('0x16')](this['interaction']['created'])||!this['interaction']['created'])){logger[_0xca52('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1885f4,_0xca52('0x17'));return _0x2f7936[_0xca52('0x18')]();}if(_0x21841e[0x0]==='2'&&this['interaction'][_0xca52('0x19')]){logger[_0xca52('0x13')](_0xca52('0x1a'),_0x1885f4,_0xca52('0x1b'));return _0x2f7936['next']();}var _0x552e33={'ContactId':this[_0xca52('0x1c')]['id'],'sentAt':moment()['format'](_0xca52('0x1d')),'direction':'out'};if(this[_0xca52('0x1e')]===_0xca52('0x1f')){_0x552e33[_0xca52('0x20')]=utils[_0xca52('0x21')](_0x21841e[0x2],this);}else{_0x552e33[_0xca52('0x20')]=utils[_0xca52('0x21')](_0x21841e[0x1],this);}if(this[_0xca52('0x22')]){_0x552e33['to']=this[_0xca52('0x22')][_0xca52('0x23')]||'';if(this[_0xca52('0x1e')]===_0xca52('0x1f')&&_0x21841e[0x1]==='1'){_0x552e33['cc']=this['message']['cc']||'';}_0x552e33[_0xca52('0x23')]=this[_0xca52('0x22')]['to']||'';_0x552e33[_0xca52('0x24')]=this['message'][_0xca52('0x24')]||'';_0x552e33[_0xca52('0x25')]=!![];if(this['message'][_0xca52('0x26')]){_0x552e33[_0xca52('0x26')]='';_0x552e33[_0xca52('0x26')]+=_[_0xca52('0x27')](this['message'][_0xca52('0x26')],_0xca52('0x28'))?'':_0xca52('0x29');_0x552e33['subject']+=this[_0xca52('0x22')][_0xca52('0x26')];}}if(this[_0xca52('0x1e')]==='chat'){_0x552e33[_0xca52('0x2a')]=this[_0xca52('0x2b')]['id'];}else{_0x552e33[_[_0xca52('0x2c')](this[_0xca52('0x1e')])+_0xca52('0x2d')]=this[_0xca52('0x2b')]['id'];}_0x552e33[_[_0xca52('0x2c')](this[_0xca52('0x1e')])+_0xca52('0x2e')]=this[_0xca52('0x2f')]['id'];var _0x3be39c=this[_0xca52('0x2f')];if(rpc[this[_0xca52('0x1e')]+_0xca52('0x30')]){if(this[_0xca52('0x1e')]===_0xca52('0x1f')){var _0x16fd0c={'tls':{'rejectUnauthorized':![]}};if(this[_0xca52('0x2b')]['Smtp'][_0xca52('0x31')]){_0x16fd0c['service']=this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x31')];}else{_0x16fd0c[_0xca52('0x33')]=this[_0xca52('0x2b')]['Smtp'][_0xca52('0x33')];_0x16fd0c[_0xca52('0x34')]=this[_0xca52('0x2b')]['Smtp'][_0xca52('0x34')];_0x16fd0c[_0xca52('0x35')]=this[_0xca52('0x2b')]['Smtp']['secure'];}if(this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x36')]){_0x16fd0c[_0xca52('0x37')]={'user':this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x38')],'pass':this['account'][_0xca52('0x32')][_0xca52('0x39')]};}_0x552e33['inReplyTo']=this[_0xca52('0x22')][_0xca52('0x3a')];_0x552e33[_0xca52('0x3b')]=_0xca52('0x3c')+_[_0xca52('0x3d')](_0x552e33[_0xca52('0x20')],_0xca52('0x3e'),']+(>|$)/g,''),'priorityTrue':_0x7bd1f[0x1],'priorityFalse':_0x7bd1f[0x2]};var _0x4f1e6d=gotoif[_0x2091('0xa')](_0x35116a,{'typecast':!![]});if(_0x4f1e6d['length']){logger['error'](_0x2091('0xb'),_0x5ad5bd,_[_0x2091('0xc')](_0x4f1e6d,_0x2091('0xd'))[_0x2091('0xe')](',\x20'));_0x3ab9f9[_0x2091('0xf')]();}else{try{var _0xf7d2e8=eval('('+_0x35116a['condition']+')');var _0x938038=_0xf7d2e8?_0x35116a[_0x2091('0x10')]:_0x35116a[_0x2091('0x11')];logger['info'](_0x2091('0x12'),_0x5ad5bd,_0x35116a[_0x2091('0x13')],_0xf7d2e8,_0x938038||_0x2091('0x14'));if(_0x938038){var _0x4d80d3=_[_0x2091('0x15')](_0x3ab9f9[_0x2091('0x16')](),{'p':_0x938038});if(_0x4d80d3>=0x0){logger[_0x2091('0x17')](_0x2091('0x18'),_0x5ad5bd,_0x938038||'next',_0x4d80d3);_0x3ab9f9[_0x2091('0x14')](_0x4d80d3);}else{logger[_0x2091('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5ad5bd,_0x938038||_0x2091('0x14'));_0x3ab9f9['stop']();}}else{_0x3ab9f9[_0x2091('0x14')]();}}catch(_0x383536){logger['error'](_0x2091('0x19'),_0x5ad5bd,_0x383536[_0x2091('0xd')]);_0x3ab9f9[_0x2091('0xf')]();}}}catch(_0x4c32ab){logger[_0x2091('0x1a')](_0x2091('0xb'),_0x5ad5bd,JSON[_0x2091('0x1b')](_0x4c32ab));_0x3ab9f9['stop']();}};}; \ No newline at end of file +var _0x505d=['replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','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','stringify','validate','lodash','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x9ebb4a,_0x44a670){var _0x5c89da=function(_0x1e8f94){while(--_0x1e8f94){_0x9ebb4a['push'](_0x9ebb4a['shift']());}};_0x5c89da(++_0x44a670);}(_0x505d,0x1a6));var _0xd505=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x505d[_0x99868f];return _0x27a71b;};'use strict';var schema=require(_0xd505('0x0'));var _=require(_0xd505('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xd505('0x2'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xd505('0x3')},'priorityTrue':{'type':_0xd505('0x4'),'message':_0xd505('0x5')},'priorityFalse':{'type':'number','message':_0xd505('0x6')}});exports[_0xd505('0x7')]=function(_0x5cc7d1,_0x55e542){return function(_0x4247b1){try{var _0xe7fd77={'condition':htmlToText[_0xd505('0x8')](utils[_0xd505('0x9')](_0x55e542[0x0],this),{'wordwrap':![]})[_0xd505('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x55e542[0x1],'priorityFalse':_0x55e542[0x2]};var _0xd38092=gotoif[_0xd505('0x0')](_0xe7fd77,{'typecast':!![]});if(_0xd38092[_0xd505('0xb')]){logger[_0xd505('0xc')](_0xd505('0xd'),_0x5cc7d1,_['map'](_0xd38092,_0xd505('0xe'))[_0xd505('0xf')](',\x20'));_0x4247b1[_0xd505('0x10')]();}else{try{var _0x34744e=eval('('+_0xe7fd77['condition']+')');var _0x5c57f8=_0x34744e?_0xe7fd77[_0xd505('0x11')]:_0xe7fd77[_0xd505('0x12')];logger[_0xd505('0x13')](_0xd505('0x14'),_0x5cc7d1,_0xe7fd77['condition'],_0x34744e,_0x5c57f8||_0xd505('0x15'));if(_0x5c57f8){var _0x53f2b4=_[_0xd505('0x16')](_0x4247b1[_0xd505('0x17')](),{'p':_0x5c57f8});if(_0x53f2b4>=0x0){logger[_0xd505('0x13')](_0xd505('0x18'),_0x5cc7d1,_0x5c57f8||_0xd505('0x15'),_0x53f2b4);_0x4247b1[_0xd505('0x15')](_0x53f2b4);}else{logger['info'](_0xd505('0x19'),_0x5cc7d1,_0x5c57f8||'next');_0x4247b1[_0xd505('0x10')]();}}else{_0x4247b1[_0xd505('0x15')]();}}catch(_0x2480ba){logger[_0xd505('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5cc7d1,_0x2480ba['message']);_0x4247b1[_0xd505('0x10')]();}}}catch(_0x5b127a){logger[_0xd505('0xc')](_0xd505('0xd'),_0x5cc7d1,JSON[_0xd505('0x1a')](_0x5b127a));_0x4247b1[_0xd505('0x10')]();}};}; \ 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 653561a..ab80229 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 _0xdcaf=['map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdcaf,0x1d8));var _0xfdca=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcaf[_0x432682];return _0x463d05;};'use strict';var schema=require(_0xfdca('0x0'));var _=require(_0xfdca('0x1'));var logger=require(_0xfdca('0x2'))('routing');var gotop=schema({'priority':{'type':_0xfdca('0x3'),'required':!![],'message':_0xfdca('0x4')}});exports[_0xfdca('0x5')]=function(_0xb1359b,_0x243bdc){return function(_0x4950be){try{var _0x53caf5={'priority':_0x243bdc[0x0]};var _0x5cc872=gotop[_0xfdca('0x0')](_0x53caf5,{'typecast':!![]});if(_0x5cc872[_0xfdca('0x6')]){logger['error'](_0xfdca('0x7'),_0xb1359b,_[_0xfdca('0x8')](_0x5cc872,'message')[_0xfdca('0x9')](',\x20'));_0x4950be[_0xfdca('0xa')]();}else{logger[_0xfdca('0xb')](_0xfdca('0xc'),_0xb1359b,_0x53caf5['priority']);if(_0x53caf5[_0xfdca('0xd')]){var _0x38375c=_[_0xfdca('0xe')](_0x4950be[_0xfdca('0xf')](),{'p':_0x53caf5[_0xfdca('0xd')]});if(_0x38375c>=0x0){logger[_0xfdca('0xb')](_0xfdca('0x10'),_0xb1359b,_0x53caf5[_0xfdca('0xd')]||_0xfdca('0x11'),_0x38375c);_0x4950be[_0xfdca('0x11')](_0x38375c);}else{logger[_0xfdca('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0xb1359b,_0x53caf5['priority']||_0xfdca('0x11'));_0x4950be[_0xfdca('0xa')]();}}else{_0x4950be[_0xfdca('0x11')]();}}}catch(_0x5efc22){logger[_0xfdca('0x12')]('[%s][GOTOP]\x20%s',_0xb1359b,JSON[_0xfdca('0x13')](_0x5efc22));_0x4950be[_0xfdca('0xa')]();}};}; \ No newline at end of file +var _0xc45b=['routing','consequence','validate','length','error','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','../../../../config/logger'];(function(_0x41755a,_0x1e6703){var _0x1ace54=function(_0x57fdc7){while(--_0x57fdc7){_0x41755a['push'](_0x41755a['shift']());}};_0x1ace54(++_0x1e6703);}(_0xc45b,0x87));var _0xbc45=function(_0x336a59,_0x23d6f7){_0x336a59=_0x336a59-0x0;var _0x5cc4b6=_0xc45b[_0x336a59];return _0x5cc4b6;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xbc45('0x0'))(_0xbc45('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xbc45('0x2')]=function(_0x367b26,_0x295e53){return function(_0xbfbff0){try{var _0x32411c={'priority':_0x295e53[0x0]};var _0x1ed95c=gotop[_0xbc45('0x3')](_0x32411c,{'typecast':!![]});if(_0x1ed95c[_0xbc45('0x4')]){logger[_0xbc45('0x5')]('[%s][GOTOP]\x20%s',_0x367b26,_[_0xbc45('0x6')](_0x1ed95c,_0xbc45('0x7'))['join'](',\x20'));_0xbfbff0['stop']();}else{logger[_0xbc45('0x8')](_0xbc45('0x9'),_0x367b26,_0x32411c['priority']);if(_0x32411c[_0xbc45('0xa')]){var _0x5047a0=_[_0xbc45('0xb')](_0xbfbff0['rules'](),{'p':_0x32411c[_0xbc45('0xa')]});if(_0x5047a0>=0x0){logger[_0xbc45('0x8')](_0xbc45('0xc'),_0x367b26,_0x32411c[_0xbc45('0xa')]||_0xbc45('0xd'),_0x5047a0);_0xbfbff0[_0xbc45('0xd')](_0x5047a0);}else{logger[_0xbc45('0x8')](_0xbc45('0xe'),_0x367b26,_0x32411c[_0xbc45('0xa')]||_0xbc45('0xd'));_0xbfbff0[_0xbc45('0xf')]();}}else{_0xbfbff0['next']();}}}catch(_0x36eb7c){logger[_0xbc45('0x5')]('[%s][GOTOP]\x20%s',_0x367b26,JSON[_0xbc45('0x10')](_0x36eb7c));_0xbfbff0[_0xbc45('0xf')]();}};}; \ 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 40cd14e..d74d851 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 _0x46ec=['next','error','stringify','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','create','then','info','body'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x46ec,0x145));var _0xc46e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x46ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc46e('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc46e('0x1'));var rpc={'chatMessage':require(_0xc46e('0x2')),'openchannelMessage':require(_0xc46e('0x3')),'mailMessage':require(_0xc46e('0x4')),'smsMessage':require(_0xc46e('0x5')),'faxMessage':require(_0xc46e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xc46e('0x7')]=function(_0x3117cb,_0x13328c){return function(_0x229a7c){try{var _0x5058da={'body':utils[_0xc46e('0x8')](_0x13328c[0x0],this),'ContactId':this[_0xc46e('0x9')]['id']};if(this['channel']==='chat'){_0x5058da[_0xc46e('0xa')]=this[_0xc46e('0xb')]['id'];}else{_0x5058da[_['upperFirst'](this[_0xc46e('0xc')])+_0xc46e('0xd')]=this[_0xc46e('0xb')]['id'];}_0x5058da[_[_0xc46e('0xe')](this[_0xc46e('0xc')])+_0xc46e('0xf')]=this['interaction']['id'];if(rpc[this[_0xc46e('0xc')]+'Message']){return rpc[this[_0xc46e('0xc')]+'Message'][_0xc46e('0x10')](_0x5058da)[_0xc46e('0x11')](function(_0x2e2a56){logger[_0xc46e('0x12')]('[%s][MESSAGE]\x20%s',_0x3117cb,_0x5058da[_0xc46e('0x13')]);_0x229a7c[_0xc46e('0x14')]();})['catch'](function(_0x51affb){logger[_0xc46e('0x15')]('[%s][MESSAGE]\x20%s',_0x3117cb,JSON[_0xc46e('0x16')](_0x51affb));_0x229a7c['stop']();});}}catch(_0x3f61d3){logger[_0xc46e('0x15')]('[%s][MESSAGE]\x20%s',_0x3117cb,JSON[_0xc46e('0x16')](_0x3f61d3));_0x229a7c['stop']();}};}; \ No newline at end of file +var _0xbd9f=['../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','InteractionId','Message','create','then','info','next','catch','error','stringify','stop','[%s][MESSAGE]\x20%s','routing','../../rpc/openchannelMessage'];(function(_0x5ef8d3,_0x2256b1){var _0x578599=function(_0xa80110){while(--_0xa80110){_0x5ef8d3['push'](_0x5ef8d3['shift']());}};_0x578599(++_0x2256b1);}(_0xbd9f,0x98));var _0xfbd9=function(_0x2a1280,_0x5e126e){_0x2a1280=_0x2a1280-0x0;var _0x49eafc=_0xbd9f[_0x2a1280];return _0x49eafc;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xfbd9('0x0'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xfbd9('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfbd9('0x2')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xfbd9('0x3'))};exports[_0xfbd9('0x4')]=function(_0x18696a,_0x5a9faf){return function(_0x3329ae){try{var _0x4c6a18={'body':utils[_0xfbd9('0x5')](_0x5a9faf[0x0],this),'ContactId':this[_0xfbd9('0x6')]['id']};if(this['channel']===_0xfbd9('0x7')){_0x4c6a18[_0xfbd9('0x8')]=this[_0xfbd9('0x9')]['id'];}else{_0x4c6a18[_['upperFirst'](this[_0xfbd9('0xa')])+'AccountId']=this[_0xfbd9('0x9')]['id'];}_0x4c6a18[_['upperFirst'](this[_0xfbd9('0xa')])+_0xfbd9('0xb')]=this['interaction']['id'];if(rpc[this[_0xfbd9('0xa')]+_0xfbd9('0xc')]){return rpc[this['channel']+_0xfbd9('0xc')][_0xfbd9('0xd')](_0x4c6a18)[_0xfbd9('0xe')](function(_0x527707){logger[_0xfbd9('0xf')]('[%s][MESSAGE]\x20%s',_0x18696a,_0x4c6a18['body']);_0x3329ae[_0xfbd9('0x10')]();})[_0xfbd9('0x11')](function(_0x159743){logger[_0xfbd9('0x12')]('[%s][MESSAGE]\x20%s',_0x18696a,JSON[_0xfbd9('0x13')](_0x159743));_0x3329ae[_0xfbd9('0x14')]();});}}catch(_0x2b9553){logger['error'](_0xfbd9('0x15'),_0x18696a,JSON[_0xfbd9('0x13')](_0x2b9553));_0x3329ae['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 4bd6e2f..0f3a247 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 _0xc7a5=['[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','info'];(function(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_0xc7a5,0xdd));var _0x5c7a=function(_0x244949,_0x58c310){_0x244949=_0x244949-0x0;var _0x510823=_0xc7a5[_0x244949];return _0x510823;};'use strict';var utils=require(_0x5c7a('0x0'));var logger=require(_0x5c7a('0x1'))(_0x5c7a('0x2'));exports['consequence']=function(_0x203c9c,_0x532eae){return function(_0x19d79e){try{logger[_0x5c7a('0x3')](_0x5c7a('0x4'),_0x203c9c,utils[_0x5c7a('0x5')](_0x532eae[0x0],this));_0x19d79e[_0x5c7a('0x6')]();}catch(_0x2a208c){logger['error']('[%s][NOOP]\x20%s',_0x203c9c,JSON[_0x5c7a('0x7')](_0x2a208c));_0x19d79e[_0x5c7a('0x8')]();}};}; \ No newline at end of file +var _0xdfe0=['consequence','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger'];(function(_0xb94ea9,_0x3b469a){var _0xd50eca=function(_0x2d9a33){while(--_0x2d9a33){_0xb94ea9['push'](_0xb94ea9['shift']());}};_0xd50eca(++_0x3b469a);}(_0xdfe0,0xb8));var _0x0dfe=function(_0x326c89,_0x490b83){_0x326c89=_0x326c89-0x0;var _0x7918bb=_0xdfe0[_0x326c89];return _0x7918bb;};'use strict';var utils=require(_0x0dfe('0x0'));var logger=require(_0x0dfe('0x1'))('routing');exports[_0x0dfe('0x2')]=function(_0xf964f7,_0x59a1b6){return function(_0x24f0d1){try{logger['info'](_0x0dfe('0x3'),_0xf964f7,utils['getMustacheRender'](_0x59a1b6[0x0],this));_0x24f0d1['next']();}catch(_0xa1eb5f){logger['error'](_0x0dfe('0x3'),_0xf964f7,JSON[_0x0dfe('0x4')](_0xa1eb5f));_0x24f0d1[_0x0dfe('0x5')]();}};}; \ 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 1000210..d42a8dc 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 _0x0c6e=['map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','stop','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x0c6e,0xb0));var _0xe0c6=function(_0x36ba2b,_0x127418){_0x36ba2b=_0x36ba2b-0x0;var _0x4cae0c=_0x0c6e[_0x36ba2b];return _0x4cae0c;};'use strict';var schema=require(_0xe0c6('0x0'));var _=require(_0xe0c6('0x1'));var util=require('util');var seqqueue=require(_0xe0c6('0x2'));var moment=require(_0xe0c6('0x3'));var Redis=require(_0xe0c6('0x4'));var config=require(_0xe0c6('0x5'));var logger=require(_0xe0c6('0x6'))(_0xe0c6('0x7'));var strategy=require(_0xe0c6('0x8'));config[_0xe0c6('0x9')]=_[_0xe0c6('0xa')](config[_0xe0c6('0x9')],{'host':_0xe0c6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe0c6('0x9')]));var attributes=['id',_0xe0c6('0xc'),_0xe0c6('0xd'),'queue',_0xe0c6('0xe'),_0xe0c6('0xf')];function emit(_0x4bf936,_0x499769,_0x53672c){io['to'](_0x4bf936)[_0xe0c6('0x10')](_0x499769,_0x53672c);}function emitChannelQueueInteraction(_0x42805a,_0x33fd8a,_0x3f5c0e,_0x440dc5,_0x10da82,_0x53ded4,_0x4a19df,_0x46ec73){var _0xf89adf=_[_0xe0c6('0x11')](_0x3f5c0e);_0xf89adf[_0xe0c6('0xc')]=_0x46ec73;_0xf89adf[_0xe0c6('0x12')]=_0x33fd8a;_0xf89adf[_0xe0c6('0xd')]=_0x440dc5;_0xf89adf['id']=_0x10da82;if(_0x53ded4){_0x4a19df[util[_0xe0c6('0x13')](_0xe0c6('0x14'),_0x42805a)][_0x10da82]=_[_0xe0c6('0x15')](_0xf89adf,attributes);}else{delete _0x4a19df[util['format'](_0xe0c6('0x14'),_0x42805a)][_0x10da82];}emit(util['format']('%s:queue:%s',_0x42805a,_0x33fd8a),util[_0xe0c6('0x13')]('%s_queue_waiting_interaction:%s',_0x42805a,_0x53ded4?_0xe0c6('0x16'):_0xe0c6('0x17')),_['pick'](_0xf89adf,attributes));}var rpc={'openchannelQueueReport':require(_0xe0c6('0x18')),'mailQueueReport':require(_0xe0c6('0x19')),'chatQueueReport':require(_0xe0c6('0x1a')),'smsQueueReport':require(_0xe0c6('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xe0c6('0x1c'))};var queue=schema({'name':{'type':_0xe0c6('0x1d'),'required':!![],'message':_0xe0c6('0x1e')},'timeout':{'type':_0xe0c6('0x1f'),'message':_0xe0c6('0x20')}});function startRouting(_0x36647f,_0x795a4,_0x4f7f5b,_0x45c173){if(_0x36647f&&_0x795a4&&_0x4f7f5b){_0x795a4[_0xe0c6('0x21')]+=0x1;var _0x428d3d={'uniqueid':_0x36647f,'from':_0x4f7f5b['body']?_0x4f7f5b[_0xe0c6('0x22')]['from']:'','joinAt':moment()[_0xe0c6('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f7f5b[_0xe0c6('0x23')]?_0x4f7f5b[_0xe0c6('0x23')]['id']:null,'ListId':_0x4f7f5b[_0xe0c6('0x24')]?_0x4f7f5b[_0xe0c6('0x24')]['id']:null};_0x428d3d[_[_0xe0c6('0x25')](_0x4f7f5b[_0xe0c6('0x26')])+_0xe0c6('0x27')]=_0x795a4['id']||null;_0x428d3d[_[_0xe0c6('0x25')](_0x4f7f5b['channel'])+_0xe0c6('0x28')]=_0x4f7f5b[_0xe0c6('0x29')]?_0x4f7f5b['interaction']['id']:null;_0x428d3d[_[_0xe0c6('0x25')](_0x4f7f5b[_0xe0c6('0x26')])+_0xe0c6('0x2a')]=_0x4f7f5b['message']?_0x4f7f5b[_0xe0c6('0x2b')]['id']:null;_0x428d3d[_[_0xe0c6('0x25')](_0x4f7f5b['channel'])+(_0x4f7f5b['channel']!=='chat'?'AccountId':'WebsiteId')]=_0x4f7f5b[_0xe0c6('0xd')]?_0x4f7f5b[_0xe0c6('0xd')]['id']:null;logger[_0xe0c6('0x2c')](util[_0xe0c6('0x13')](_0xe0c6('0x2d'),_0x36647f,_0x795a4[_0xe0c6('0x2e')]));emitChannelQueueInteraction(_0x4f7f5b[_0xe0c6('0x26')],_0x795a4[_0xe0c6('0x2e')],_0x428d3d,_0x4f7f5b[_0xe0c6('0xd')][_0xe0c6('0x2e')],_0x4f7f5b[_0xe0c6('0x2b')]['id'],!![],_0x45c173,_0x795a4['id']);if(rpc[_0x4f7f5b[_0xe0c6('0x26')]+_0xe0c6('0x2f')]){return rpc[_0x4f7f5b[_0xe0c6('0x26')]+'QueueReport'][_0xe0c6('0x30')](_0x428d3d)[_0xe0c6('0x31')](function(_0x496fc5){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x159cda,_0x210a2e,_0x5bad89,_0x527cfe){if(_0x159cda&&_0x210a2e){_0x210a2e[_0xe0c6('0x21')]-=0x1;var _0x5d3e96={'leaveAt':moment()['format'](_0xe0c6('0x32')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe0c6('0x33')};logger[_0xe0c6('0x2c')](util[_0xe0c6('0x13')](_0xe0c6('0x34'),_0x159cda,_0x210a2e[_0xe0c6('0x2e')]));emitChannelQueueInteraction(_0x5bad89[_0xe0c6('0x26')],_0x210a2e[_0xe0c6('0x2e')],_0x5bad89[_0xe0c6('0x22')],_0x5bad89['account']['name'],_0x5bad89[_0xe0c6('0x2b')]['id'],![],_0x527cfe,_0x210a2e['id']);if(rpc[_0x5bad89[_0xe0c6('0x26')]+'QueueReport']){return rpc[_0x5bad89[_0xe0c6('0x26')]+'QueueReport'][_0xe0c6('0x35')](_0x159cda,_0x5d3e96)[_0xe0c6('0x31')](function(_0x1a4dbe){logger[_0xe0c6('0x36')](_0xe0c6('0x37'));});}}}function endRouting(_0x11f88d,_0x5eb08a,_0x348fa9,_0x3ac9c8){if(_0x11f88d&&_0x5eb08a){_0x5eb08a[_0xe0c6('0x21')]-=0x1;var _0x38bc1d={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xe0c6('0x13')](_0xe0c6('0x32')),'reason':_0xe0c6('0x38')};logger[_0xe0c6('0x2c')](util[_0xe0c6('0x13')](_0xe0c6('0x39'),_0x11f88d,_0x5eb08a[_0xe0c6('0x2e')]));emitChannelQueueInteraction(_0x348fa9['channel'],_0x5eb08a['name'],_0x348fa9[_0xe0c6('0x22')],_0x348fa9[_0xe0c6('0xd')][_0xe0c6('0x2e')],_0x348fa9['message']['id'],![],_0x3ac9c8);if(rpc[_0x348fa9[_0xe0c6('0x26')]+_0xe0c6('0x2f')]){return rpc[_0x348fa9[_0xe0c6('0x26')]+_0xe0c6('0x2f')][_0xe0c6('0x35')](_0x11f88d,_0x38bc1d)[_0xe0c6('0x31')](function(_0xbbef39){logger[_0xe0c6('0x36')](_0xe0c6('0x37'));});}}}function handleFindQueue(_0x2e15fc){return function(_0xd0b7ab){return _0xd0b7ab[_0xe0c6('0x2e')][_0xe0c6('0x3a')]()===_0x2e15fc[_0xe0c6('0x3a')]();};}exports[_0xe0c6('0x3b')]=function(_0x2fbc73,_0x4db589,_0x4b145d,_0x4803d7){return function(_0xae1e3d){try{var _0x47a3ad={'name':_0x4db589[0x0],'timeout':_0x4db589[0x1]};var _0x5793c6=queue[_0xe0c6('0x0')](_0x47a3ad,{'typecast':!![]});if(_0x5793c6['length']){logger[_0xe0c6('0x36')](_0xe0c6('0x3c'),_0x2fbc73,_[_0xe0c6('0x3d')](_0x5793c6,_0xe0c6('0x2b'))[_0xe0c6('0x3e')](',\x20'));_0xae1e3d['stop']();}else{var _0xfd1ec2=_[_0xe0c6('0x3f')](_0x4b145d[_0x4803d7[_0xe0c6('0x26')]+_0xe0c6('0x40')],handleFindQueue(_0x47a3ad['name']));if(_0xfd1ec2){startRouting(_0x2fbc73,_0xfd1ec2,_0x4803d7,_0x4b145d);var _0x2282a9=(_0xfd1ec2['timeout']||0xa)*0x3e8;var _0x3e8f54=(_0x47a3ad[_0xe0c6('0x38')]||0x14)*0x3e8;var _0x55d0a1,_0x4b8b49;if(_0x2282a9>_0x3e8f54){_0x3e8f54=_0x2282a9;}var _0x36f58d=seqqueue[_0xe0c6('0x41')](_0x2282a9);_0x36f58d['id']=_0x2fbc73;_0x36f58d[_0xe0c6('0x42')]=_0x2282a9;_0x36f58d[_0xe0c6('0x43')]=_0x3e8f54;_0x36f58d[_0xe0c6('0x26')]=_0x4803d7['channel'];_0x4b145d[_0xe0c6('0x44')][_0x2fbc73]['on'](_0xe0c6('0x45'),function(){logger[_0xe0c6('0x2c')](_0xe0c6('0x46'),_0x2fbc73);stopRouting(_0x2fbc73,_0xfd1ec2,_0x4803d7,_0x4b145d);clearTimeout(_0x55d0a1);_0x55d0a1=undefined;_0x36f58d[_0xe0c6('0x47')](!![]);if(_0x4b145d[_0xe0c6('0x44')][_0x2fbc73]){delete _0x4b145d[_0xe0c6('0x44')][_0x2fbc73];}_0xae1e3d['stop']();});_0x4b145d[_0xe0c6('0x44')][_0x2fbc73]['on'](_0xe0c6('0x48'),function(){if(_0x4b145d[_0xe0c6('0x44')][_0x2fbc73]){delete _0x4b145d[_0xe0c6('0x44')][_0x2fbc73];}});_0x55d0a1=setTimeout(function(){logger[_0xe0c6('0x2c')](_0xe0c6('0x49'),_0x2fbc73);endRouting(_0x2fbc73,_0xfd1ec2,_0x4803d7,_0x4b145d);clearTimeout(_0x55d0a1);_0x36f58d[_0xe0c6('0x47')](!![]);_0xae1e3d['next']();},_0x3e8f54);switch(_0xfd1ec2[_0xe0c6('0x4a')]){case _0xe0c6('0x4b'):strategy[_0xe0c6('0x4b')](_0x36f58d,_0xfd1ec2,_0x4b145d,_0x4803d7);break;default:strategy[_0xe0c6('0x4c')](_0x36f58d,_0xfd1ec2,_0x4b145d,_0x4803d7);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2fbc73,_0x47a3ad[_0xe0c6('0x2e')]);_0xae1e3d[_0xe0c6('0x4d')]();}}}catch(_0x3d4d2e){console['log'](_0x3d4d2e);logger[_0xe0c6('0x36')]('[%s][QUEUE]\x20%s',_0x2fbc73,_0x3d4d2e[_0xe0c6('0x4e')]);_0xae1e3d[_0xe0c6('0x4d')]();}};}; \ No newline at end of file +var _0x4790=['remove','pick','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','InteractionId','interaction','message','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','waiting','timeout','toLowerCase','[%s][QUEUE]\x20%s','join','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save'];(function(_0x43a2d9,_0x3576b8){var _0x4038bf=function(_0xfd77f8){while(--_0xfd77f8){_0x43a2d9['push'](_0x43a2d9['shift']());}};_0x4038bf(++_0x3576b8);}(_0x4790,0x84));var _0x0479=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0x4790[_0x55c979];return _0x690107;};'use strict';var schema=require(_0x0479('0x0'));var _=require(_0x0479('0x1'));var util=require(_0x0479('0x2'));var seqqueue=require(_0x0479('0x3'));var moment=require(_0x0479('0x4'));var Redis=require(_0x0479('0x5'));var config=require('../../../../config/environment');var logger=require(_0x0479('0x6'))(_0x0479('0x7'));var strategy=require(_0x0479('0x8'));config[_0x0479('0x9')]=_['defaults'](config['redis'],{'host':_0x0479('0xa'),'port':0x18eb});var io=require(_0x0479('0xb'))(new Redis(config[_0x0479('0x9')]));var attributes=['id','queue_id',_0x0479('0xc'),_0x0479('0xd'),_0x0479('0xe'),_0x0479('0xf')];function emit(_0x417637,_0x5aced6,_0x464500){io['to'](_0x417637)[_0x0479('0x10')](_0x5aced6,_0x464500);}function emitChannelQueueInteraction(_0x49c75a,_0x2c602d,_0x25a6aa,_0x4be0d0,_0x5ec523,_0x158bcd,_0x21b942,_0x5411d8){var _0x29fa84=_[_0x0479('0x11')](_0x25a6aa);_0x29fa84[_0x0479('0x12')]=_0x5411d8;_0x29fa84['queue']=_0x2c602d;_0x29fa84[_0x0479('0xc')]=_0x4be0d0;_0x29fa84['id']=_0x5ec523;if(_0x158bcd){_0x21b942[util[_0x0479('0x13')](_0x0479('0x14'),_0x49c75a)][_0x5ec523]=_['pick'](_0x29fa84,attributes);}else{delete _0x21b942[util['format']('%sQueuesWaitingInteractions',_0x49c75a)][_0x5ec523];}emit(util[_0x0479('0x13')](_0x0479('0x15'),_0x49c75a,_0x2c602d),util[_0x0479('0x13')](_0x0479('0x16'),_0x49c75a,_0x158bcd?_0x0479('0x17'):_0x0479('0x18')),_[_0x0479('0x19')](_0x29fa84,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0479('0x1a')),'chatQueueReport':require(_0x0479('0x1b')),'smsQueueReport':require(_0x0479('0x1c')),'faxQueueReport':require(_0x0479('0x1d')),'whatsappQueueReport':require(_0x0479('0x1e'))};var queue=schema({'name':{'type':_0x0479('0x1f'),'required':!![],'message':_0x0479('0x20')},'timeout':{'type':_0x0479('0x21'),'message':_0x0479('0x22')}});function startRouting(_0x20eb56,_0x13f097,_0x2e9233,_0x594910){if(_0x20eb56&&_0x13f097&&_0x2e9233){_0x13f097['waiting']+=0x1;var _0x14d426={'uniqueid':_0x20eb56,'from':_0x2e9233[_0x0479('0x23')]?_0x2e9233[_0x0479('0x23')][_0x0479('0xe')]:'','joinAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'ContactId':_0x2e9233[_0x0479('0x25')]?_0x2e9233[_0x0479('0x25')]['id']:null,'ListId':_0x2e9233[_0x0479('0x26')]?_0x2e9233['list']['id']:null};_0x14d426[_['upperFirst'](_0x2e9233[_0x0479('0x27')])+_0x0479('0x28')]=_0x13f097['id']||null;_0x14d426[_['upperFirst'](_0x2e9233['channel'])+_0x0479('0x29')]=_0x2e9233[_0x0479('0x2a')]?_0x2e9233[_0x0479('0x2a')]['id']:null;_0x14d426[_['upperFirst'](_0x2e9233[_0x0479('0x27')])+'MessageId']=_0x2e9233[_0x0479('0x2b')]?_0x2e9233[_0x0479('0x2b')]['id']:null;_0x14d426[_['upperFirst'](_0x2e9233['channel'])+(_0x2e9233[_0x0479('0x27')]!=='chat'?'AccountId':'WebsiteId')]=_0x2e9233['account']?_0x2e9233[_0x0479('0xc')]['id']:null;logger['info'](util[_0x0479('0x13')](_0x0479('0x2c'),_0x20eb56,_0x13f097['name']));emitChannelQueueInteraction(_0x2e9233['channel'],_0x13f097['name'],_0x14d426,_0x2e9233[_0x0479('0xc')][_0x0479('0x2d')],_0x2e9233[_0x0479('0x2b')]['id'],!![],_0x594910,_0x13f097['id']);if(rpc[_0x2e9233[_0x0479('0x27')]+_0x0479('0x2e')]){return rpc[_0x2e9233['channel']+_0x0479('0x2e')][_0x0479('0x2f')](_0x14d426)[_0x0479('0x30')](function(_0x1aeede){logger[_0x0479('0x31')](_0x0479('0x32'));});}}}function stopRouting(_0x58248d,_0x21e360,_0x7873be,_0x19f386){if(_0x58248d&&_0x21e360){_0x21e360['waiting']-=0x1;var _0x55492e={'leaveAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'acceptAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'reason':_0x0479('0x33')};logger[_0x0479('0x34')](util[_0x0479('0x13')](_0x0479('0x35'),_0x58248d,_0x21e360['name']));emitChannelQueueInteraction(_0x7873be[_0x0479('0x27')],_0x21e360[_0x0479('0x2d')],_0x7873be['body'],_0x7873be[_0x0479('0xc')][_0x0479('0x2d')],_0x7873be['message']['id'],![],_0x19f386,_0x21e360['id']);if(rpc[_0x7873be['channel']+'QueueReport']){return rpc[_0x7873be[_0x0479('0x27')]+_0x0479('0x2e')][_0x0479('0x36')](_0x58248d,_0x55492e)['catch'](function(_0x38e59d){logger['error'](_0x0479('0x37'));});}}}function endRouting(_0xff559e,_0x5338ea,_0x4c9c3d,_0x2a1897){if(_0xff559e&&_0x5338ea){_0x5338ea[_0x0479('0x38')]-=0x1;var _0x17721f={'leaveAt':moment()['format'](_0x0479('0x24')),'exitAt':moment()['format'](_0x0479('0x24')),'reason':_0x0479('0x39')};logger[_0x0479('0x34')](util[_0x0479('0x13')]('[%s][END:QUEUE][NAME:%s]',_0xff559e,_0x5338ea['name']));emitChannelQueueInteraction(_0x4c9c3d[_0x0479('0x27')],_0x5338ea[_0x0479('0x2d')],_0x4c9c3d[_0x0479('0x23')],_0x4c9c3d[_0x0479('0xc')][_0x0479('0x2d')],_0x4c9c3d[_0x0479('0x2b')]['id'],![],_0x2a1897);if(rpc[_0x4c9c3d['channel']+_0x0479('0x2e')]){return rpc[_0x4c9c3d[_0x0479('0x27')]+_0x0479('0x2e')][_0x0479('0x36')](_0xff559e,_0x17721f)[_0x0479('0x30')](function(_0x2803a2){logger[_0x0479('0x31')](_0x0479('0x37'));});}}}function handleFindQueue(_0x5284ae){return function(_0x2d5379){return _0x2d5379['name'][_0x0479('0x3a')]()===_0x5284ae[_0x0479('0x3a')]();};}exports['consequence']=function(_0xfa16f0,_0x5d20c4,_0x372a51,_0x3ce390){return function(_0x1d11c3){try{var _0x743a1a={'name':_0x5d20c4[0x0],'timeout':_0x5d20c4[0x1]};var _0x341399=queue['validate'](_0x743a1a,{'typecast':!![]});if(_0x341399['length']){logger[_0x0479('0x31')](_0x0479('0x3b'),_0xfa16f0,_['map'](_0x341399,_0x0479('0x2b'))[_0x0479('0x3c')](',\x20'));_0x1d11c3['stop']();}else{var _0x59246a=_[_0x0479('0x3d')](_0x372a51[_0x3ce390[_0x0479('0x27')]+'Queues'],handleFindQueue(_0x743a1a[_0x0479('0x2d')]));if(_0x59246a){startRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);var _0x37805a=(_0x59246a['timeout']||0xa)*0x3e8;var _0x25eadb=(_0x743a1a[_0x0479('0x39')]||0x14)*0x3e8;var _0x37302b,_0x4523c3;if(_0x37805a>_0x25eadb){_0x25eadb=_0x37805a;}var _0x358305=seqqueue[_0x0479('0x3e')](_0x37805a);_0x358305['id']=_0xfa16f0;_0x358305[_0x0479('0x3f')]=_0x37805a;_0x358305[_0x0479('0x40')]=_0x25eadb;_0x358305[_0x0479('0x27')]=_0x3ce390[_0x0479('0x27')];_0x372a51[_0x0479('0x41')][_0xfa16f0]['on'](_0x0479('0x42'),function(){logger['info'](_0x0479('0x43'),_0xfa16f0);stopRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);clearTimeout(_0x37302b);_0x37302b=undefined;_0x358305[_0x0479('0x44')](!![]);if(_0x372a51[_0x0479('0x41')][_0xfa16f0]){delete _0x372a51[_0x0479('0x41')][_0xfa16f0];}_0x1d11c3[_0x0479('0x45')]();});_0x372a51[_0x0479('0x41')][_0xfa16f0]['on'](_0x0479('0x46'),function(){if(_0x372a51[_0x0479('0x41')][_0xfa16f0]){delete _0x372a51[_0x0479('0x41')][_0xfa16f0];}});_0x37302b=setTimeout(function(){logger[_0x0479('0x34')](_0x0479('0x47'),_0xfa16f0);endRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);clearTimeout(_0x37302b);_0x358305[_0x0479('0x44')](!![]);_0x1d11c3[_0x0479('0x48')]();},_0x25eadb);switch(_0x59246a[_0x0479('0x49')]){case _0x0479('0x4a'):strategy[_0x0479('0x4a')](_0x358305,_0x59246a,_0x372a51,_0x3ce390);break;default:strategy[_0x0479('0x4b')](_0x358305,_0x59246a,_0x372a51,_0x3ce390);}}else{logger[_0x0479('0x31')](_0x0479('0x4c'),_0xfa16f0,_0x743a1a[_0x0479('0x2d')]);_0x1d11c3[_0x0479('0x45')]();}}}catch(_0x1df648){console['log'](_0x1df648);logger[_0x0479('0x31')](_0x0479('0x3b'),_0xfa16f0,_0x1df648[_0x0479('0x4d')]);_0x1d11c3[_0x0479('0x45')]();}};}; \ 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 d4a72d0..9a2da19 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 _0x4a81=['squeue','push','handleRun','bind','handleTimeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','agents','busy','realtime','busyQueue','showNotification','writeLog','RINGING','hideNotification','STOP','TIMEOUT','uuid','../../../../../config/logger','notificationId','agent','routing'];(function(_0x30df1c,_0x4b1d40){var _0x5a1822=function(_0x2f1753){while(--_0x2f1753){_0x30df1c['push'](_0x30df1c['shift']());}};_0x5a1822(++_0x4b1d40);}(_0x4a81,0x1ae));var _0x14a8=function(_0x1c5eba,_0x204453){_0x1c5eba=_0x1c5eba-0x0;var _0x46333d=_0x4a81[_0x1c5eba];return _0x46333d;};'use strict';var _=require('lodash');var uuid=require(_0x14a8('0x0'));var util=require('./util');var logger=require(_0x14a8('0x1'))('routing');var Agent=function(_0xf6d460,_0x2e6410,_0x1bdbba,_0xa6a10c){this[_0x14a8('0x2')]=uuid['v4']();this['squeue']=_0xf6d460;this[_0x14a8('0x3')]=_0x2e6410;this['realtime']=_0x1bdbba;this[_0x14a8('0x4')]=_0xa6a10c;this[_0x14a8('0x5')][_0x14a8('0x6')](this[_0x14a8('0x7')][_0x14a8('0x8')](this),this[_0x14a8('0x9')]['bind'](this));this[_0x14a8('0x5')]['on']('timeout',this['handleTimeout'][_0x14a8('0x8')](this));this[_0x14a8('0x5')]['on']('drained',this[_0x14a8('0xa')][_0x14a8('0x8')](this));};Agent[_0x14a8('0xb')][_0x14a8('0x6')]=function(){this[_0x14a8('0x5')][_0x14a8('0x6')](this[_0x14a8('0x7')][_0x14a8('0x8')](this),this[_0x14a8('0x9')][_0x14a8('0x8')](this));};Agent['prototype'][_0x14a8('0xa')]=function(){this[_0x14a8('0x9')](!![]);};Agent['prototype']['handleRun']=function(_0x30a04e){logger[_0x14a8('0xc')](_0x14a8('0xd'),this[_0x14a8('0x5')]['id'],this[_0x14a8('0x3')]['id']);if(_[_0x14a8('0xe')](this['realtime']['agents'][this['agent']['id']])){logger[_0x14a8('0xc')](_0x14a8('0xf'),this[_0x14a8('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x14a8('0x6')][_0x14a8('0x8')](this),0x3e8);}else{if(this[_0x14a8('0x4')][_0x14a8('0x10')]||util[_0x14a8('0x11')](this[_0x14a8('0x5')]['id'],this['realtime']['agents'][this[_0x14a8('0x3')]['id']],this[_0x14a8('0x5')][_0x14a8('0x12')],![])){this['realtime'][_0x14a8('0x13')][this[_0x14a8('0x3')]['id']][_0x14a8('0x14')]=!![];this[_0x14a8('0x15')][_0x14a8('0x13')][this[_0x14a8('0x3')]['id']][_0x14a8('0x16')]=undefined;util[_0x14a8('0x17')](this[_0x14a8('0x2')],this['squeue']['id'],this[_0x14a8('0x15')]['agents'][this[_0x14a8('0x3')]['id']],null,this['routing']);util[_0x14a8('0x18')](this['squeue']['id'],this[_0x14a8('0x15')]['agents'][this[_0x14a8('0x3')]['id']],_0x14a8('0x19')+(this[_0x14a8('0x4')][_0x14a8('0x10')]?':FORCED':''));}else{logger[_0x14a8('0xc')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x14a8('0x5')]['id'],this[_0x14a8('0x3')]['id']);setTimeout(this[_0x14a8('0x6')]['bind'](this),0x3e8);}}};Agent[_0x14a8('0xb')][_0x14a8('0x9')]=function(_0xed07cd){if(_['isNil'](this['realtime'][_0x14a8('0x13')][this[_0x14a8('0x3')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x14a8('0x5')]['id'],this[_0x14a8('0x3')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x14a8('0x5')]['id'],this[_0x14a8('0x3')]['id']);util[_0x14a8('0x1a')](this['notificationId'],this[_0x14a8('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],null,this[_0x14a8('0x4')]);this[_0x14a8('0x15')][_0x14a8('0x13')][this[_0x14a8('0x3')]['id']]['busy']=![];this[_0x14a8('0x15')][_0x14a8('0x13')][this[_0x14a8('0x3')]['id']][_0x14a8('0x16')]=undefined;util[_0x14a8('0x18')](this['squeue']['id'],this[_0x14a8('0x15')][_0x14a8('0x13')][this['agent']['id']],_0xed07cd?_0x14a8('0x1b'):_0x14a8('0x1c'));}if(!_0xed07cd){setTimeout(this[_0x14a8('0x6')]['bind'](this),0x3e8);}};function agent(_0x4ef6bf,_0x1ab4d0,_0x318775,_0x5d883b){return new Agent(_0x4ef6bf,_0x1ab4d0,_0x318775,_0x5d883b);}module['exports']=agent; \ No newline at end of file +var _0x87c1=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','realtime','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent'];(function(_0x1260e3,_0x4e663f){var _0x292fbd=function(_0x4aa523){while(--_0x4aa523){_0x1260e3['push'](_0x1260e3['shift']());}};_0x292fbd(++_0x4e663f);}(_0x87c1,0x1bf));var _0x187c=function(_0xa16c97,_0x15ee86){_0xa16c97=_0xa16c97-0x0;var _0x227cb3=_0x87c1[_0xa16c97];return _0x227cb3;};'use strict';var _=require(_0x187c('0x0'));var uuid=require('uuid');var util=require(_0x187c('0x1'));var logger=require(_0x187c('0x2'))('routing');var Agent=function(_0x2f23fa,_0x388011,_0x289ada,_0x16ad52){this[_0x187c('0x3')]=uuid['v4']();this[_0x187c('0x4')]=_0x2f23fa;this['agent']=_0x388011;this[_0x187c('0x5')]=_0x289ada;this['routing']=_0x16ad52;this[_0x187c('0x4')]['push'](this[_0x187c('0x6')][_0x187c('0x7')](this),this['handleTimeout'][_0x187c('0x7')](this));this[_0x187c('0x4')]['on'](_0x187c('0x8'),this[_0x187c('0x9')][_0x187c('0x7')](this));this[_0x187c('0x4')]['on']('drained',this[_0x187c('0xa')]['bind'](this));};Agent[_0x187c('0xb')][_0x187c('0xc')]=function(){this[_0x187c('0x4')]['push'](this[_0x187c('0x6')][_0x187c('0x7')](this),this[_0x187c('0x9')]['bind'](this));};Agent[_0x187c('0xb')][_0x187c('0xa')]=function(){this['handleTimeout'](!![]);};Agent[_0x187c('0xb')][_0x187c('0x6')]=function(_0xfdfe3c){logger[_0x187c('0xd')](_0x187c('0xe'),this[_0x187c('0x4')]['id'],this['agent']['id']);if(_[_0x187c('0xf')](this['realtime'][_0x187c('0x10')][this[_0x187c('0x11')]['id']])){logger[_0x187c('0xd')](_0x187c('0x12'),this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);setTimeout(this[_0x187c('0xc')]['bind'](this),0x3e8);}else{if(this[_0x187c('0x13')][_0x187c('0x14')]||util[_0x187c('0x15')](this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],this[_0x187c('0x4')][_0x187c('0x16')],![])){this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']][_0x187c('0x17')]=!![];this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']][_0x187c('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0x187c('0x4')]['id'],this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']],null,this['routing']);util[_0x187c('0x19')](this[_0x187c('0x4')]['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],'RINGING'+(this['routing'][_0x187c('0x14')]?_0x187c('0x1a'):''));}else{logger[_0x187c('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);setTimeout(this[_0x187c('0xc')][_0x187c('0x7')](this),0x3e8);}}};Agent[_0x187c('0xb')][_0x187c('0x9')]=function(_0x502994){if(_[_0x187c('0xf')](this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']])){return logger[_0x187c('0xd')](_0x187c('0x12'),this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);}else{logger['info'](_0x187c('0x1b'),this[_0x187c('0x4')]['id'],this['agent']['id']);util[_0x187c('0x1c')](this[_0x187c('0x3')],this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']],null,this[_0x187c('0x13')]);this['realtime'][_0x187c('0x10')][this[_0x187c('0x11')]['id']][_0x187c('0x17')]=![];this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']]['busyQueue']=undefined;util[_0x187c('0x19')](this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],_0x502994?_0x187c('0x1d'):'TIMEOUT');}if(!_0x502994){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x1fe2d7,_0x2c1eaf,_0x553d56,_0xf8cd5c){return new Agent(_0x1fe2d7,_0x2c1eaf,_0x553d56,_0xf8cd5c);}module[_0x187c('0x1e')]=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 714d6cd..45ac0aa 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 _0xa049=['isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','info','[%s][QUEUE]\x20EMPTY','hideNotification','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','Agents','length','realtime','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xa049,0x1db));var _0x9a04=function(_0x1fd5eb,_0x235203){_0x1fd5eb=_0x1fd5eb-0x0;var _0x102365=_0xa049[_0x1fd5eb];return _0x102365;};'use strict';var _=require(_0x9a04('0x0'));var uuid=require(_0x9a04('0x1'));var util=require('./util');var logger=require(_0x9a04('0x2'))(_0x9a04('0x3'));var Beepall=function(_0x444fdc,_0x3c975d,_0x3d2f24,_0x2ced45){this[_0x9a04('0x4')]=uuid['v4']();this[_0x9a04('0x5')]=_0x444fdc;this[_0x9a04('0x6')]=_0x3c975d;this['realtime']=_0x3d2f24;this[_0x9a04('0x3')]=_0x2ced45;this[_0x9a04('0x5')]['push'](this[_0x9a04('0x7')][_0x9a04('0x8')](this),this[_0x9a04('0x9')][_0x9a04('0x8')](this));this[_0x9a04('0x5')]['on'](_0x9a04('0xa'),this['handleTimeout'][_0x9a04('0x8')](this));this[_0x9a04('0x5')]['on'](_0x9a04('0xb'),this[_0x9a04('0xc')][_0x9a04('0x8')](this));};Beepall[_0x9a04('0xd')]['push']=function(){this[_0x9a04('0x5')][_0x9a04('0xe')](this[_0x9a04('0x7')]['bind'](this),this[_0x9a04('0x9')][_0x9a04('0x8')](this));};Beepall[_0x9a04('0xd')][_0x9a04('0xc')]=function(_0x7b3cc6){this['handleTimeout'](!![]);};Beepall[_0x9a04('0xd')]['handleRun']=function(_0xef2ada){var _0x83b9ff=!![];if(!_['isNil'](this[_0x9a04('0x6')])&&!_[_0x9a04('0xf')](this['queue'][_0x9a04('0x10')])&&this[_0x9a04('0x6')][_0x9a04('0x10')][_0x9a04('0x11')]>0x0){for(var _0xd86cdb=0x0,_0x54d0c8;_0xd86cdb0x0){for(var _0xb06d8=0x0,_0x5377cf;_0xb06d80x0&&_0x1e9ccf[_0x413911+_0x5adb('0x25')]>=_0x1e9ccf[_0x413911+_0x5adb('0x23')]){writeLog(_0x1a8014,_0x1e9ccf,_0x413911['toUpperCase']()+_0x5adb('0x26'));return![];}}return!![];};exports[_0x5adb('0x27')]=function(_0x3a4fca,_0x2c64a3,_0x36459b,_0x1c06c4,_0x4a5d46){return sendNotification(!![],_0x3a4fca,_0x2c64a3,_0x36459b,_0x1c06c4,_0x4a5d46);};exports['hideNotification']=function(_0x5d457e,_0x39bddd,_0x1eac55,_0x60a672,_0x512bab){return sendNotification(![],_0x5d457e,_0x39bddd,_0x1eac55,_0x60a672,_0x512bab);};exports[_0x5adb('0x28')]=writeLog; \ No newline at end of file +var _0x1623=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction'];(function(_0x27ee66,_0x42d5f6){var _0x2b5e03=function(_0x197a7e){while(--_0x197a7e){_0x27ee66['push'](_0x27ee66['shift']());}};_0x2b5e03(++_0x42d5f6);}(_0x1623,0xab));var _0x3162=function(_0x46f912,_0x45cedf){_0x46f912=_0x46f912-0x0;var _0x155241=_0x1623[_0x46f912];return _0x155241;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0x3162('0x1'));var Redis=require(_0x3162('0x2'));var config=require(_0x3162('0x3'));var logger=require(_0x3162('0x4'))(_0x3162('0x5'));config['redis']=_['defaults'](config[_0x3162('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3162('0x7'))(new Redis(config[_0x3162('0x6')]));function emit(_0x53260d,_0xffe9b6,_0x2dc07e){io['to'](_0x53260d)[_0x3162('0x8')](_0xffe9b6,_0x2dc07e);}function sendNotification(_0x36609e,_0x10d684,_0x382676,_0xe43099,_0x113d28,_0x4bde10){io['to'](util['format'](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))[_0x3162('0x8')](_0x3162('0xb'),_0xe43099);var _0x813d62=_0x4bde10||{};var _0x208f4e=_0x382676[_0x3162('0xc')]('.');var _0x38da60={'uniqueid':_0x10d684,'channel':_0x208f4e[0x0],'id':_0x208f4e[0x1],'title':_0x208f4e[0x0]+_0x3162('0xd'),'interactionId':_0x208f4e[0x2],'queue':_0x113d28?_0x113d28['name']:null,'sound':_0x813d62[_0x3162('0xe')]['notificationSound'],'shake':_0x813d62[_0x3162('0xe')][_0x3162('0xf')]};try{if(!_0x813d62['body']){_0x813d62['body']={};}if(_0x113d28){_0x813d62[_0x3162('0x10')][_0x3162('0x11')]=_0x113d28;}else if(_0x813d62[_0x3162('0x10')]['queue']){delete _0x813d62[_0x3162('0x10')][_0x3162('0x11')];}_0x38da60[_0x3162('0x12')]=utils['getMustacheRender'](_0x813d62[_0x3162('0xe')][_0x3162('0x13')],_0x813d62);}catch(_0x46864e){_0x38da60[_0x3162('0x12')]=_0x3162('0x14');logger[_0x3162('0x15')](util[_0x3162('0x16')]('[%s][QUEUE]\x20%s',_0x10d684,_0x46864e[_0x3162('0x17')]));}io['to'](util[_0x3162('0x16')](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))['emit'](util[_0x3162('0x16')]('notification:%s',_0x36609e?'save':_0x3162('0x18')),_0x38da60);}function writeLog(_0x3e4d23,_0x31946d,_0x523fab){return logger['info'](util[_0x3162('0x16')](_0x3162('0x19'),_0x3e4d23,_0x31946d[_0x3162('0xa')],_0x523fab));}exports[_0x3162('0x1a')]=function(_0x31b27b,_0x14cbba,_0x52ae25,_0x1b2713){if(_0x14cbba['busy']){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1b'));return![];}if(!_0x14cbba[_0x3162('0x1c')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1d'));return![];}if(_0x14cbba[_0x52ae25+_0x3162('0x1e')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1f'));return![];}if(_0x1b2713&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x21'))&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x22'))){if(_0x14cbba[_0x52ae25+_0x3162('0x21')]>0x0&&_0x14cbba[_0x52ae25+_0x3162('0x22')]>=_0x14cbba[_0x52ae25+_0x3162('0x21')]){writeLog(_0x31b27b,_0x14cbba,_0x52ae25[_0x3162('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3162('0x24')]=function(_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567){return sendNotification(!![],_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567);};exports['hideNotification']=function(_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec){return sendNotification(![],_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index bf2fd53..568a51b 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 _0xbd3a=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','map','join'];(function(_0x1fd9b1,_0x4b5809){var _0x13388d=function(_0x14bec6){while(--_0x14bec6){_0x1fd9b1['push'](_0x1fd9b1['shift']());}};_0x13388d(++_0x4b5809);}(_0xbd3a,0x1e5));var _0xabd3=function(_0x21ddf4,_0x546a49){_0x21ddf4=_0x21ddf4-0x0;var _0x183b5e=_0xbd3a[_0x21ddf4];return _0x183b5e;};'use strict';var schema=require('validate');var sh=require(_0xabd3('0x0'));var _=require(_0xabd3('0x1'));var utils=require(_0xabd3('0x2'));var logger=require('../../../../config/logger')(_0xabd3('0x3'));var system=schema({'command':{'type':_0xabd3('0x4'),'required':!![],'message':_0xabd3('0x5')}});exports[_0xabd3('0x6')]=function(_0x4552b7,_0x2ee490){return function(_0x45f933){try{var _0x2d2001={'command':_0x2ee490[0x0]};var _0xf6590b=system['validate'](_0x2d2001,{'typecast':!![]});if(_0xf6590b['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x4552b7,_[_0xabd3('0x7')](_0xf6590b,'message')[_0xabd3('0x8')](',\x20'));logger['info'](_0xabd3('0x9'),_0x4552b7);_0x45f933[_0xabd3('0xa')]();}else{var _0xd53540=this;var _0x1aa002=utils[_0xabd3('0xb')](_0x2ee490[0x0],this);logger['info'](_0xabd3('0xc'),_0x4552b7,_0x1aa002);sh[_0xabd3('0xd')](_[_0xabd3('0xe')](_0x1aa002),function(_0x418072,_0x5eb74a){logger[_0xabd3('0xf')](_0xabd3('0x10'),_0x4552b7,_0x418072);if(_0x418072==0x0){var _0x3f3498=_0x5eb74a[_0xabd3('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xabd3('0x12')](_0x2ee490[0x1])||_[_0xabd3('0x13')](_0x2ee490[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x4552b7);_0xd53540['body'][_0x2ee490[0x1]]=_0x3f3498;}else{logger[_0xabd3('0xf')](_0xabd3('0x14'),_0x4552b7,_0x2ee490[0x1],_0x3f3498);_0xd53540[_0xabd3('0x15')][_0x2ee490[0x1]]=_0x3f3498;}}_0x45f933[_0xabd3('0xa')]();});}}catch(_0x1ad1fb){logger[_0xabd3('0x16')](_0xabd3('0x17'),_0x4552b7,_[_0xabd3('0x18')](_0x1ad1fb)?JSON[_0xabd3('0x19')](_0x1ad1fb):_0x1ad1fb);logger[_0xabd3('0xf')](_0xabd3('0x9'),_0x4552b7);_0x45f933['next']();}};}; \ No newline at end of file +var _0xdb6e=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x22d7dd,_0x2305fc){var _0x2050b9=function(_0x1c20c7){while(--_0x1c20c7){_0x22d7dd['push'](_0x22d7dd['shift']());}};_0x2050b9(++_0x2305fc);}(_0xdb6e,0x179));var _0xedb6=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0xdb6e[_0x4ea6af];return _0x4cb1e6;};'use strict';var schema=require(_0xedb6('0x0'));var sh=require(_0xedb6('0x1'));var _=require(_0xedb6('0x2'));var utils=require(_0xedb6('0x3'));var logger=require(_0xedb6('0x4'))(_0xedb6('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xedb6('0x6')}});exports[_0xedb6('0x7')]=function(_0x2965e8,_0x473708){return function(_0x38be96){try{var _0x30de0d={'command':_0x473708[0x0]};var _0x35f987=system['validate'](_0x30de0d,{'typecast':!![]});if(_0x35f987[_0xedb6('0x8')]){logger[_0xedb6('0x9')](_0xedb6('0xa'),_0x2965e8,_['map'](_0x35f987,_0xedb6('0xb'))['join'](',\x20'));logger[_0xedb6('0xc')](_0xedb6('0xd'),_0x2965e8);_0x38be96['next']();}else{var _0x5dd041=this;var _0x1956d5=utils['getMustacheRender'](_0x473708[0x0],this);logger[_0xedb6('0xc')](_0xedb6('0xe'),_0x2965e8,_0x1956d5);sh[_0xedb6('0xf')](_[_0xedb6('0x10')](_0x1956d5),function(_0xe244f4,_0x51ffe2){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2965e8,_0xe244f4);if(_0xe244f4==0x0){var _0x5cd9a3=_0x51ffe2[_0xedb6('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x473708[0x1])||_[_0xedb6('0x12')](_0x473708[0x1])){logger['info'](_0xedb6('0x13'),_0x2965e8);_0x5dd041[_0xedb6('0x14')][_0x473708[0x1]]=_0x5cd9a3;}else{logger[_0xedb6('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2965e8,_0x473708[0x1],_0x5cd9a3);_0x5dd041['body'][_0x473708[0x1]]=_0x5cd9a3;}}_0x38be96[_0xedb6('0x15')]();});}}catch(_0x3db1d8){logger[_0xedb6('0x9')](_0xedb6('0xa'),_0x2965e8,_['isObject'](_0x3db1d8)?JSON[_0xedb6('0x16')](_0x3db1d8):_0x3db1d8);logger[_0xedb6('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2965e8);_0x38be96[_0xedb6('0x15')]();}};}; \ 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 4b34ebd..71d4eb2 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 _0x403f=['../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x5d3ff8,_0xdf24ef){var _0x2022a0=function(_0x42fa60){while(--_0x42fa60){_0x5d3ff8['push'](_0x5d3ff8['shift']());}};_0x2022a0(++_0xdf24ef);}(_0x403f,0x7a));var _0xf403=function(_0x5532db,_0x3f893c){_0x5532db=_0x5532db-0x0;var _0x5f66a=_0x403f[_0x5532db];return _0x5f66a;};'use strict';var schema=require(_0xf403('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xf403('0x1')),'openchannelInteraction':require(_0xf403('0x2')),'smsInteraction':require(_0xf403('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf403('0x4'))};var logger=require(_0xf403('0x5'))(_0xf403('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xf403('0x7')}});exports['consequence']=function(_0x1d77c7,_0x1748a2,_0x51379a,_0x14c478){return function(_0x5f1e80){try{var _0x1f22d0={'tag':_0x1748a2[0x0]};var _0x1e639d=tag[_0xf403('0x0')](_0x1f22d0,{'typecast':!![]});if(_0x1e639d[_0xf403('0x8')]){logger[_0xf403('0x9')](_0xf403('0xa'),_0x1d77c7,_[_0xf403('0xb')](_0x1e639d,'message')['join'](',\x20'));logger[_0xf403('0xc')](_0xf403('0xd'),_0x1d77c7);_0x5f1e80[_0xf403('0xe')]();}else{var _0x373b6b={'ids':[_0x1748a2[0x0]]};if(rpc[_0x14c478[_0xf403('0xf')]+_0xf403('0x10')]){rpc[_0x14c478[_0xf403('0xf')]+_0xf403('0x10')][_0xf403('0x11')](_0x14c478[_0xf403('0x12')]['id'],_0x373b6b)[_0xf403('0x13')](function(_0x255974){logger[_0xf403('0xc')](_0xf403('0x14'),_0x1d77c7,_0x1748a2[0x1],_0x14c478[_0xf403('0xf')],_0x14c478[_0xf403('0x12')]['id']);})[_0xf403('0x15')](function(_0x203f90){logger[_0xf403('0x9')]('[%s][TAG]\x20%s',_0x1d77c7,JSON[_0xf403('0x16')](_0x203f90));logger[_0xf403('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1d77c7);})[_0xf403('0x17')](function(){_0x5f1e80[_0xf403('0xe')]();});}}}catch(_0x188901){logger[_0xf403('0x9')](_0xf403('0xa'),_0x1d77c7,_[_0xf403('0x18')](_0x188901)?JSON['stringify'](_0x188901):_0x188901);logger['info'](_0xf403('0xd'),_0x1d77c7);_0x5f1e80[_0xf403('0xe')]();}};}; \ No newline at end of file +var _0xa355=['map','message','join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x530901,_0xfaf8f1){var _0xbe5cbe=function(_0x5a8da5){while(--_0x5a8da5){_0x530901['push'](_0x530901['shift']());}};_0xbe5cbe(++_0xfaf8f1);}(_0xa355,0x12d));var _0x5a35=function(_0x3ab862,_0x584207){_0x3ab862=_0x3ab862-0x0;var _0xfd3898=_0xa355[_0x3ab862];return _0xfd3898;};'use strict';var schema=require(_0x5a35('0x0'));var _=require(_0x5a35('0x1'));var rpc={'chatInteraction':require(_0x5a35('0x2')),'openchannelInteraction':require(_0x5a35('0x3')),'smsInteraction':require(_0x5a35('0x4')),'mailInteraction':require(_0x5a35('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x5a35('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x5a35('0x7')}});exports[_0x5a35('0x8')]=function(_0x20929a,_0x258c84,_0x547c04,_0x5c45b0){return function(_0x548b12){try{var _0x183362={'tag':_0x258c84[0x0]};var _0x5ad976=tag[_0x5a35('0x0')](_0x183362,{'typecast':!![]});if(_0x5ad976[_0x5a35('0x9')]){logger[_0x5a35('0xa')]('[%s][TAG]\x20%s',_0x20929a,_[_0x5a35('0xb')](_0x5ad976,_0x5a35('0xc'))[_0x5a35('0xd')](',\x20'));logger[_0x5a35('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x20929a);_0x548b12[_0x5a35('0xf')]();}else{var _0xbaa3f4={'ids':[_0x258c84[0x0]]};if(rpc[_0x5c45b0[_0x5a35('0x10')]+_0x5a35('0x11')]){rpc[_0x5c45b0['channel']+_0x5a35('0x11')][_0x5a35('0x12')](_0x5c45b0[_0x5a35('0x13')]['id'],_0xbaa3f4)['then'](function(_0x4998f0){logger['info'](_0x5a35('0x14'),_0x20929a,_0x258c84[0x1],_0x5c45b0[_0x5a35('0x10')],_0x5c45b0[_0x5a35('0x13')]['id']);})[_0x5a35('0x15')](function(_0x48e3dd){logger['error'](_0x5a35('0x16'),_0x20929a,JSON[_0x5a35('0x17')](_0x48e3dd));logger['info'](_0x5a35('0x18'),_0x20929a);})[_0x5a35('0x19')](function(){_0x548b12[_0x5a35('0xf')]();});}}}catch(_0x2e031d){logger['error'](_0x5a35('0x16'),_0x20929a,_['isObject'](_0x2e031d)?JSON[_0x5a35('0x17')](_0x2e031d):_0x2e031d);logger[_0x5a35('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x20929a);_0x548b12[_0x5a35('0xf')]();}};}; \ 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 d21c990..fbbfcd1 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x525d21,_0x5d2ec6){var _0x4c0836=function(_0x463a2a){while(--_0x463a2a){_0x525d21['push'](_0x525d21['shift']());}};_0x4c0836(++_0x5d2ec6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x24b299,_0x17a98b){var _0x3a7f69=function(_0x40c7bf){while(--_0x40c7bf){_0x24b299['push'](_0x24b299['shift']());}};_0x3a7f69(++_0x17a98b);}(_0xe706,0xa3));var _0x6e70=function(_0x1f2b0e,_0xc804dc){_0x1f2b0e=_0x1f2b0e-0x0;var _0x23b334=_0xe706[_0x1f2b0e];return _0x23b334;};'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 cba25d1..c259020 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 _0x0c5c=['../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','error','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','busy','busyQueue','end','QueueReport','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','routing','../rpc/openchannelQueueReport'];(function(_0x2a028e,_0x234f35){var _0x13086c=function(_0x1b1e51){while(--_0x1b1e51){_0x2a028e['push'](_0x2a028e['shift']());}};_0x13086c(++_0x234f35);}(_0x0c5c,0x1ce));var _0xc0c5=function(_0xfde299,_0x45e8dc){_0xfde299=_0xfde299-0x0;var _0x433014=_0x0c5c[_0xfde299];return _0x433014;};'use strict';var _=require(_0xc0c5('0x0'));var util=require(_0xc0c5('0x1'));var path=require(_0xc0c5('0x2'));var fs=require('fs');var jayson=require(_0xc0c5('0x3'));var BPromise=require(_0xc0c5('0x4'));var uuid=require(_0xc0c5('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xc0c5('0x6'));var rpc={'openchannelQueueReport':require(_0xc0c5('0x7')),'mailQueueReport':require(_0xc0c5('0x8')),'chatQueueReport':require(_0xc0c5('0x9')),'smsQueueReport':require(_0xc0c5('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc0c5('0xb'))};var RuleEngine=require(_0xc0c5('0xc'));function getId(_0x2820e5,_0x3a7d4d,_0x482f3f){return util[_0xc0c5('0xd')]('%s.%s.%s',_0x2820e5,_0x3a7d4d||0x0,_0x482f3f||0x0);}function getIntervals(_0x9f78e1,_0x26688c){var _0x5cf8ce=[];if(!_[_0xc0c5('0xe')](_0x26688c['IntervalId'])&&!_[_0xc0c5('0xe')](_0x9f78e1[_0x26688c[_0xc0c5('0xf')]])&&!_[_0xc0c5('0xe')](_0x9f78e1[_0x26688c[_0xc0c5('0xf')]][_0xc0c5('0x10')])){_0x5cf8ce=_[_0xc0c5('0x11')](_0x9f78e1[_0x26688c[_0xc0c5('0xf')]]['Intervals'],_0xc0c5('0x12'));}else if(!_['isNil'](_0x26688c[_0xc0c5('0x12')])){_0x5cf8ce=[_0x26688c[_0xc0c5('0x12')]];}return _0x5cf8ce;}exports[_0xc0c5('0x13')]=function(_0x188420){_0x188420[_0xc0c5('0x14')]={};return new BPromise(function(_0x6c4a4b,_0x1cb15f){var _0x5caf22={'Start':function(_0x595f7a){var _0x3d1487=this;return new Promise(function(_0x318648,_0x2e6a57){if(_0x595f7a){try{var _0x3828fd=[];var _0x49da52=getId(_0x595f7a[_0xc0c5('0x15')],_0x595f7a['message']?_0x595f7a[_0xc0c5('0x16')]['id']:0x0,_0x595f7a['interaction']?_0x595f7a[_0xc0c5('0x17')]['id']:0x0);if(_0x595f7a[_0xc0c5('0x18')]&&_[_0xc0c5('0x19')](_0x595f7a['applications'])&&_0x595f7a['applications'][_0xc0c5('0x1a')]){for(var _0x3fc119=0x0;_0x3fc119<_0x595f7a['applications'][_0xc0c5('0x1a')];_0x3fc119+=0x1){var _0x3d9625=_0x595f7a['applications'][_0x3fc119];if(fs['existsSync'](path[_0xc0c5('0x1b')](__dirname,_0xc0c5('0x18'),_0x3d9625[_0xc0c5('0x1c')]+_0xc0c5('0x1d')))){var _0x2d7d5c=[];switch(_0x3d9625[_0xc0c5('0x1c')][_0xc0c5('0x1e')]()){case _0xc0c5('0x1f'):var _0x57a1ff=_0x3d9625[_0xc0c5('0x20')][_0xc0c5('0x21')](',');if(_0x595f7a[_0xc0c5('0x15')]===_0xc0c5('0x22')){_0x2d7d5c[_0xc0c5('0x23')](_0x57a1ff[0x0]);_0x2d7d5c['push'](_0x57a1ff[0x1]);_0x2d7d5c[_0xc0c5('0x23')](_0x57a1ff['slice'](0x2,_0x57a1ff[_0xc0c5('0x1a')])[_0xc0c5('0x1b')](','));}else{_0x2d7d5c[_0xc0c5('0x23')](_0x57a1ff[0x0]);_0x2d7d5c[_0xc0c5('0x23')](_0x57a1ff[_0xc0c5('0x24')](0x1,_0x57a1ff[_0xc0c5('0x1a')])['join'](','));}break;case _0xc0c5('0x25'):var _0x1d98f1=_0x3d9625[_0xc0c5('0x20')][_0xc0c5('0x21')](',');_0x2d7d5c[_0xc0c5('0x23')](_0x1d98f1[0x0]);_0x2d7d5c[_0xc0c5('0x23')](_0x1d98f1[0x1]);_0x2d7d5c[_0xc0c5('0x23')](_0x1d98f1[_0xc0c5('0x24')](0x2,_0x1d98f1['length'])[_0xc0c5('0x1b')](','));break;case _0xc0c5('0x26'):var _0x158741=_0x3d9625[_0xc0c5('0x20')]['split'](',');_0x2d7d5c['push'](_0x158741[0x0]);_0x2d7d5c[_0xc0c5('0x23')](_0x158741[0x1]);_0x2d7d5c['push'](_0x158741[0x2]);_0x2d7d5c[_0xc0c5('0x23')](_0x158741[0x3]);_0x2d7d5c[_0xc0c5('0x23')](_0x158741[_0xc0c5('0x24')](0x4,_0x158741['length'])[_0xc0c5('0x1b')](','));break;case _0xc0c5('0x27'):var _0x2e1af5=_0x3d9625['appdata'][_0xc0c5('0x21')](',');_0x2d7d5c[_0xc0c5('0x23')](_0x2e1af5[0x0]);_0x2d7d5c['push'](_0x2e1af5[0x1]);_0x2d7d5c['push'](_0x2e1af5[0x2]);_0x2d7d5c[_0xc0c5('0x23')](_0x2e1af5[0x3]);_0x2d7d5c[_0xc0c5('0x23')](_0x2e1af5[_0xc0c5('0x24')](0x4,_0x2e1af5[_0xc0c5('0x1a')])[_0xc0c5('0x1b')](','));break;case'message':_0x2d7d5c[_0xc0c5('0x23')](_0x3d9625['appdata']);break;case'tag':_0x2d7d5c[_0xc0c5('0x23')](_0x3d9625[_0xc0c5('0x28')]);_0x2d7d5c[_0xc0c5('0x23')](_0x3d9625['appdata']);break;default:_0x2d7d5c=_[_0xc0c5('0xe')](_0x3d9625[_0xc0c5('0x20')])?[]:_0x3d9625[_0xc0c5('0x20')]['split'](',');}var _0x51986d={'id':util[_0xc0c5('0xd')](_0xc0c5('0x29'),_0x49da52,_0x3d9625['id'],_0x3d9625['app']),'condition':require(_0xc0c5('0x2a'))[_0xc0c5('0x2b')](_0x49da52,getIntervals(_0x188420[_0xc0c5('0x2c')],_0x3d9625),_0x188420),'consequence':require(_0xc0c5('0x2d')+_0x3d9625[_0xc0c5('0x1c')])['consequence'](_0x49da52,_0x2d7d5c,_0x188420,_0x595f7a),'p':_0x3d9625[_0xc0c5('0x2e')]||0x0};logger[_0xc0c5('0x2f')]('Push\x20new\x20rule',_0x51986d['id'],_0xc0c5('0x30'),getIntervals(_0x188420[_0xc0c5('0x2c')],_0x3d9625)[_0xc0c5('0x1b')](_0xc0c5('0x31')));_0x3828fd[_0xc0c5('0x23')](_0x51986d);}else{logger[_0xc0c5('0x32')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xc0c5('0x1b')](__dirname,_0xc0c5('0x18'),_0x3d9625[_0xc0c5('0x1c')]+_0xc0c5('0x1d')));}}_0x188420[_0xc0c5('0x14')][_0x49da52]=new RuleEngine(_0x3828fd);_0x188420[_0xc0c5('0x14')][_0x49da52][_0xc0c5('0x33')](_0x595f7a,function(_0x49a2a5){logger['info']('Applications\x20executed',JSON[_0xc0c5('0x34')](_0x49a2a5[_0xc0c5('0x35')]));if(_0x188420['rules'][_0x49da52]){_0x188420[_0xc0c5('0x14')][_0x49da52][_0xc0c5('0x36')](_0xc0c5('0x37'));}});return _0x318648({'code':0xc8,'message':_0x595f7a});}else{logger[_0xc0c5('0x2f')](_0xc0c5('0x38'));return _0x318648({'code':0xc8,'message':_0x595f7a});}}catch(_0x57025b){logger[_0xc0c5('0x32')](_0x57025b['stack']);return _0x2e6a57(_0x3d1487['error'](0x1f4,_0x57025b));}}return _0x2e6a57(_0xc0c5('0x39'));});},'AcceptMessage':function(_0x31c642){var _0x2c82d6=this;return new Promise(function(_0x24a577,_0x11db06){if(_0x31c642[_0xc0c5('0x3a')]&&_0x31c642[_0xc0c5('0x3a')]['id']){if(_0x188420['agents'][_0x31c642[_0xc0c5('0x3a')]['id']]){_0x188420['agents'][_0x31c642[_0xc0c5('0x3a')]['id']][_0xc0c5('0x3b')]=![];_0x188420['agents'][_0x31c642[_0xc0c5('0x3a')]['id']][_0xc0c5('0x3c')]=undefined;}}if(_0x31c642[_0xc0c5('0x16')]&&_0x31c642[_0xc0c5('0x16')]['id']){try{var _0x2a8557=getId(_0x31c642[_0xc0c5('0x15')],_0x31c642[_0xc0c5('0x16')]?_0x31c642['message']['id']:0x0,_0x31c642[_0xc0c5('0x17')]?_0x31c642['interaction']['id']:0x0);if(_0x188420['rules'][_0x2a8557]){_0x188420[_0xc0c5('0x14')][_0x2a8557][_0xc0c5('0x36')](_0xc0c5('0x3d'));if(rpc[_0x31c642[_0xc0c5('0x15')]+_0xc0c5('0x3e')]){rpc[_0x31c642[_0xc0c5('0x15')]+_0xc0c5('0x3e')]['update'](_0x2a8557,{'UserId':_0x31c642['message']['UserId']})[_0xc0c5('0x3f')](function(_0x500141){logger[_0xc0c5('0x32')](_0xc0c5('0x40'));});}}return _0x24a577({'code':0xc8,'message':_0x31c642});}catch(_0x5e8c76){logger['error'](_0x5e8c76[_0xc0c5('0x41')]);return _0x11db06(_0x2c82d6[_0xc0c5('0x32')](0x1f4,_0x5e8c76));}}logger[_0xc0c5('0x32')](_0xc0c5('0x42'));return _0x11db06(_0x2c82d6[_0xc0c5('0x32')](0x1f4,_0xc0c5('0x42')));});},'RejectMessage':function(_0x3dc57e){var _0x24f315=this;return new Promise(function(_0x6c53d8,_0x48e4f2){if(_0x3dc57e[_0xc0c5('0x3a')]&&_0x3dc57e[_0xc0c5('0x3a')]['id']){try{if(_0x188420[_0xc0c5('0x43')][_0x3dc57e[_0xc0c5('0x3a')]['id']]){_0x188420[_0xc0c5('0x43')][_0x3dc57e['agent']['id']][_0xc0c5('0x3b')]=![];_0x188420[_0xc0c5('0x43')][_0x3dc57e[_0xc0c5('0x3a')]['id']][_0xc0c5('0x3c')]=undefined;}return _0x6c53d8({'code':0xc8,'message':_0x3dc57e});}catch(_0x5d617){logger[_0xc0c5('0x32')](_0x5d617['stack']);return _0x48e4f2(_0x24f315['error'](0x1f4,_0x5d617));}}logger[_0xc0c5('0x32')]('message\x20is\x20empty');return _0x48e4f2(_0x24f315['error'](0x1f4,_0xc0c5('0x42')));});},'AbandonInteraction':function(_0xabc111){var _0x395218=this;return new Promise(function(_0x6ca5d3,_0x277fc3){if(_0xabc111['channel']&&_0xabc111[_0xc0c5('0x17')]&&_0xabc111[_0xc0c5('0x17')]['id']){try{var _0x5db069=getId(_0xabc111['channel'],_0xabc111[_0xc0c5('0x16')]?_0xabc111[_0xc0c5('0x16')]['id']:0x0,_0xabc111[_0xc0c5('0x17')]?_0xabc111[_0xc0c5('0x17')]['id']:0x0);if(_0x188420[_0xc0c5('0x14')][_0x5db069]){_0x188420['rules'][_0x5db069][_0xc0c5('0x36')]('end');}return _0x6ca5d3({'code':0xc8,'message':_0xabc111});}catch(_0x20e207){logger['error'](_0x20e207['stack']);return _0x277fc3(_0x395218[_0xc0c5('0x32')](0x1f4,_0x20e207));}}logger[_0xc0c5('0x32')]('message\x20is\x20empty');return _0x277fc3(_0x395218[_0xc0c5('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x448c7b){var _0x1a4146=this;return new Promise(function(_0x2fcb35,_0x3d0617){if(_0x188420['agents'][_0xc0c5('0x44')](_0x448c7b['id'])){for(var _0x3eb9dc in _0x448c7b[_0xc0c5('0x45')]){if(_0x448c7b[_0xc0c5('0x45')][_0xc0c5('0x44')](_0x3eb9dc)){if(_0x188420[_0xc0c5('0x43')][_0x448c7b['id']]['hasOwnProperty'](_0x3eb9dc+_0xc0c5('0x46'))){_0x188420['agents'][_0x448c7b['id']][_0x3eb9dc+_0xc0c5('0x46')]=parseInt(_0x448c7b['capacity'][_0x3eb9dc],0xa);}}}_0x188420['agents'][_0x448c7b['id']][_0xc0c5('0x47')]();return _0x2fcb35({'code':0xc8,'message':_0x188420['agents'][_0x448c7b['id']]});}else{return _0x3d0617(_0x1a4146['error'](0x1f4,_0xc0c5('0x48')));}});},'Agents':function(_0x181c34){return new Promise(function(_0x4a5aec,_0x5cb002){var _0x8d2178=_[_0xc0c5('0x49')](_0x188420['agents']);_0x4a5aec({'count':_0x8d2178[_0xc0c5('0x1a')],'rows':_0x8d2178});});},'ChatQueues':function(_0x3966c5){return new Promise(function(_0x69237a,_0x23627f){var _0x2237d2=[];for(var _0x6fac26 in _0x188420[_0xc0c5('0x4a')]){if(_0x188420[_0xc0c5('0x4a')][_0xc0c5('0x44')](_0x6fac26)){var _0x3fa97f=_0x188420[_0xc0c5('0x4a')][_0x6fac26];var _0x3491b4={'id':_0x3fa97f['id'],'available':_0x3fa97f[_0xc0c5('0x4b')],'loggedIn':_0x3fa97f[_0xc0c5('0x4c')],'name':_0x3fa97f[_0xc0c5('0x4d')],'paused':_0x3fa97f[_0xc0c5('0x4e')],'waiting':_0x3fa97f[_0xc0c5('0x4f')]};_0x2237d2[_0xc0c5('0x23')](_0x3491b4);}}_0x69237a({'count':_0x2237d2[_0xc0c5('0x1a')],'rows':_0x2237d2});});},'MailQueues':function(_0x24fb72){return new Promise(function(_0x45b684,_0x3ec6c3){var _0x2267bd=[];for(var _0x4cfb0c in _0x188420[_0xc0c5('0x50')]){if(_0x188420[_0xc0c5('0x50')][_0xc0c5('0x44')](_0x4cfb0c)){var _0xc24089=_0x188420[_0xc0c5('0x50')][_0x4cfb0c];var _0x3d8aa7={'id':_0xc24089['id'],'available':_0xc24089[_0xc0c5('0x4b')],'loggedIn':_0xc24089[_0xc0c5('0x4c')],'name':_0xc24089['name'],'paused':_0xc24089[_0xc0c5('0x4e')],'waiting':_0xc24089[_0xc0c5('0x4f')]};_0x2267bd[_0xc0c5('0x23')](_0x3d8aa7);}}_0x45b684({'count':_0x2267bd[_0xc0c5('0x1a')],'rows':_0x2267bd});});},'OpenchannelQueues':function(_0x3bade1){return new Promise(function(_0x209ea8,_0x4819b9){var _0x3110f8=[];for(var _0xf83df0 in _0x188420['openchannelQueues']){if(_0x188420[_0xc0c5('0x51')]['hasOwnProperty'](_0xf83df0)){var _0x588ac5=_0x188420['openchannelQueues'][_0xf83df0];var _0x4f5faf={'id':_0x588ac5['id'],'available':_0x588ac5[_0xc0c5('0x4b')],'loggedIn':_0x588ac5[_0xc0c5('0x4c')],'name':_0x588ac5[_0xc0c5('0x4d')],'paused':_0x588ac5[_0xc0c5('0x4e')],'waiting':_0x588ac5[_0xc0c5('0x4f')]};_0x3110f8[_0xc0c5('0x23')](_0x4f5faf);}}_0x209ea8({'count':_0x3110f8['length'],'rows':_0x3110f8});});},'SmsQueues':function(_0x4b1cf9){return new Promise(function(_0x3445c7,_0x1ba9de){var _0x17e7db=[];for(var _0x176c40 in _0x188420['smsQueues']){if(_0x188420['smsQueues'][_0xc0c5('0x44')](_0x176c40)){var _0x15966a=_0x188420['smsQueues'][_0x176c40];var _0x5908af={'id':_0x15966a['id'],'available':_0x15966a[_0xc0c5('0x4b')],'loggedIn':_0x15966a[_0xc0c5('0x4c')],'name':_0x15966a[_0xc0c5('0x4d')],'paused':_0x15966a[_0xc0c5('0x4e')],'waiting':_0x15966a[_0xc0c5('0x4f')]};_0x17e7db[_0xc0c5('0x23')](_0x5908af);}}_0x3445c7({'count':_0x17e7db[_0xc0c5('0x1a')],'rows':_0x17e7db});});},'FaxQueues':function(_0x38a8f5){return new Promise(function(_0x1cb216,_0x4102b8){var _0x1ec2a5=[];for(var _0x43c0df in _0x188420[_0xc0c5('0x52')]){if(_0x188420[_0xc0c5('0x52')][_0xc0c5('0x44')](_0x43c0df)){var _0xd48957=_0x188420[_0xc0c5('0x52')][_0x43c0df];var _0x4ce38e={'id':_0xd48957['id'],'available':_0xd48957[_0xc0c5('0x4b')],'loggedIn':_0xd48957[_0xc0c5('0x4c')],'name':_0xd48957[_0xc0c5('0x4d')],'paused':_0xd48957[_0xc0c5('0x4e')],'waiting':_0xd48957[_0xc0c5('0x4f')]};_0x1ec2a5['push'](_0x4ce38e);}}_0x1cb216({'count':_0x1ec2a5[_0xc0c5('0x1a')],'rows':_0x1ec2a5});});},'WhatsappQueues':function(_0x376397){return new Promise(function(_0x569197,_0x4054fc){var _0x2e6068=[];for(var _0x5297c4 in _0x188420['whatsappQueues']){if(_0x188420[_0xc0c5('0x53')]['hasOwnProperty'](_0x5297c4)){var _0x19185=_0x188420['whatsappQueues'][_0x5297c4];var _0x1948e5={'id':_0x19185['id'],'available':_0x19185[_0xc0c5('0x4b')],'loggedIn':_0x19185[_0xc0c5('0x4c')],'name':_0x19185[_0xc0c5('0x4d')],'paused':_0x19185[_0xc0c5('0x4e')],'waiting':_0x19185[_0xc0c5('0x4f')]};_0x2e6068[_0xc0c5('0x23')](_0x1948e5);}}_0x569197({'count':_0x2e6068[_0xc0c5('0x1a')],'rows':_0x2e6068});});},'ChatQueuesWaitingInteractions':function(_0x553f31){return new Promise(function(_0x3e394f,_0x584039){var _0x977ff8=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x54')]);_0x3e394f({'count':_0x977ff8[_0xc0c5('0x1a')],'rows':_0x977ff8});});},'MailQueuesWaitingInteractions':function(_0x2ffc47){return new Promise(function(_0x51d1aa,_0x22821c){var _0x345712=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x55')]);_0x51d1aa({'count':_0x345712[_0xc0c5('0x1a')],'rows':_0x345712});});},'OpenchannelQueuesWaitingInteractions':function(_0x1bf64f){return new Promise(function(_0x5e6452,_0x349c8c){var _0x120c20=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x56')]);_0x5e6452({'count':_0x120c20['length'],'rows':_0x120c20});});},'SmsQueuesWaitingInteractions':function(_0x24bf49){return new Promise(function(_0x2fd341,_0x1bfddc){var _0xc62aa4=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x57')]);_0x2fd341({'count':_0xc62aa4[_0xc0c5('0x1a')],'rows':_0xc62aa4});});},'FaxQueuesWaitingInteractions':function(_0x225d89){return new Promise(function(_0x2c815a,_0x4ba171){var _0x51db67=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x58')]);_0x2c815a({'count':_0x51db67[_0xc0c5('0x1a')],'rows':_0x51db67});});},'WhatsappQueuesWaitingInteractions':function(_0x295c33){return new Promise(function(_0x362046,_0x2f6c9d){var _0x148a96=_[_0xc0c5('0x49')](_0x188420[_0xc0c5('0x59')]);_0x362046({'count':_0x148a96['length'],'rows':_0x148a96});});}};var _0xb64a4=jayson[_0xc0c5('0x5a')](_0x5caf22)[_0xc0c5('0x5b')]();_0xb64a4['on'](_0xc0c5('0x32'),function(_0x5d481a){logger[_0xc0c5('0x32')](JSON[_0xc0c5('0x34')](_0x5d481a));return _0x1cb15f(_0x5d481a);});_0xb64a4[_0xc0c5('0x13')](0x232c,'127.0.0.1',function(){console[_0xc0c5('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x6c4a4b(_0xc0c5('0x5d')+0x232c);});});}; \ No newline at end of file +var _0x9467=['IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','mail','push','dialogflow','split','dialogflowv2','slice','tag','TagId','%s:%s:%s','./interval','intervals','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s'];(function(_0x5d0f97,_0x25009f){var _0xc7236=function(_0xa7353f){while(--_0xa7353f){_0x5d0f97['push'](_0x5d0f97['shift']());}};_0xc7236(++_0x25009f);}(_0x9467,0x169));var _0x7946=function(_0x3c36c6,_0x301c08){_0x3c36c6=_0x3c36c6-0x0;var _0x491f64=_0x9467[_0x3c36c6];return _0x491f64;};'use strict';var _=require('lodash');var util=require(_0x7946('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x7946('0x1'));var BPromise=require(_0x7946('0x2'));var uuid=require(_0x7946('0x3'));var config=require('../../../config/environment');var logger=require(_0x7946('0x4'))(_0x7946('0x5'));var rpc={'openchannelQueueReport':require(_0x7946('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x7946('0x7')),'faxQueueReport':require(_0x7946('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x3d1fc7,_0xbfd4d5,_0x349f1b){return util[_0x7946('0x9')](_0x7946('0xa'),_0x3d1fc7,_0xbfd4d5||0x0,_0x349f1b||0x0);}function getIntervals(_0x5192d1,_0x5a78c5){var _0x2a5d94=[];if(!_['isNil'](_0x5a78c5[_0x7946('0xb')])&&!_[_0x7946('0xc')](_0x5192d1[_0x5a78c5[_0x7946('0xb')]])&&!_['isNil'](_0x5192d1[_0x5a78c5[_0x7946('0xb')]][_0x7946('0xd')])){_0x2a5d94=_[_0x7946('0xe')](_0x5192d1[_0x5a78c5[_0x7946('0xb')]]['Intervals'],_0x7946('0xf'));}else if(!_['isNil'](_0x5a78c5[_0x7946('0xf')])){_0x2a5d94=[_0x5a78c5[_0x7946('0xf')]];}return _0x2a5d94;}exports[_0x7946('0x10')]=function(_0xab2053){_0xab2053[_0x7946('0x11')]={};return new BPromise(function(_0x40aecf,_0x32413b){var _0x42eaac={'Start':function(_0x4c7c16){var _0x438b51=this;return new Promise(function(_0xffc8da,_0x522427){if(_0x4c7c16){try{var _0x1bbc73=[];var _0x7bbe89=getId(_0x4c7c16[_0x7946('0x12')],_0x4c7c16[_0x7946('0x13')]?_0x4c7c16[_0x7946('0x13')]['id']:0x0,_0x4c7c16[_0x7946('0x14')]?_0x4c7c16[_0x7946('0x14')]['id']:0x0);if(_0x4c7c16[_0x7946('0x15')]&&_[_0x7946('0x16')](_0x4c7c16['applications'])&&_0x4c7c16[_0x7946('0x15')]['length']){for(var _0x3003b2=0x0;_0x3003b2<_0x4c7c16['applications'][_0x7946('0x17')];_0x3003b2+=0x1){var _0x2fe35f=_0x4c7c16[_0x7946('0x15')][_0x3003b2];if(fs[_0x7946('0x18')](path[_0x7946('0x19')](__dirname,'applications',_0x2fe35f['app']+_0x7946('0x1a')))){var _0xf0c5af=[];switch(_0x2fe35f[_0x7946('0x1b')][_0x7946('0x1c')]()){case _0x7946('0x1d'):var _0x7c725c=_0x2fe35f[_0x7946('0x1e')]['split'](',');if(_0x4c7c16[_0x7946('0x12')]===_0x7946('0x1f')){_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x0]);_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x1]);_0xf0c5af[_0x7946('0x20')](_0x7c725c['slice'](0x2,_0x7c725c[_0x7946('0x17')])[_0x7946('0x19')](','));}else{_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x0]);_0xf0c5af['push'](_0x7c725c['slice'](0x1,_0x7c725c[_0x7946('0x17')])[_0x7946('0x19')](','));}break;case _0x7946('0x21'):var _0x186048=_0x2fe35f[_0x7946('0x1e')][_0x7946('0x22')](',');_0xf0c5af['push'](_0x186048[0x0]);_0xf0c5af[_0x7946('0x20')](_0x186048[0x1]);_0xf0c5af[_0x7946('0x20')](_0x186048['slice'](0x2,_0x186048['length'])[_0x7946('0x19')](','));break;case _0x7946('0x23'):var _0x2784b4=_0x2fe35f['appdata'][_0x7946('0x22')](',');_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x0]);_0xf0c5af['push'](_0x2784b4[0x1]);_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x2]);_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x3]);_0xf0c5af[_0x7946('0x20')](_0x2784b4['slice'](0x4,_0x2784b4[_0x7946('0x17')])[_0x7946('0x19')](','));break;case'amazonlex':var _0xb80772=_0x2fe35f[_0x7946('0x1e')]['split'](',');_0xf0c5af[_0x7946('0x20')](_0xb80772[0x0]);_0xf0c5af[_0x7946('0x20')](_0xb80772[0x1]);_0xf0c5af['push'](_0xb80772[0x2]);_0xf0c5af[_0x7946('0x20')](_0xb80772[0x3]);_0xf0c5af[_0x7946('0x20')](_0xb80772[_0x7946('0x24')](0x4,_0xb80772[_0x7946('0x17')])['join'](','));break;case'message':_0xf0c5af['push'](_0x2fe35f['appdata']);break;case _0x7946('0x25'):_0xf0c5af[_0x7946('0x20')](_0x2fe35f[_0x7946('0x26')]);_0xf0c5af[_0x7946('0x20')](_0x2fe35f['appdata']);break;default:_0xf0c5af=_[_0x7946('0xc')](_0x2fe35f[_0x7946('0x1e')])?[]:_0x2fe35f[_0x7946('0x1e')]['split'](',');}var _0x1fb0c6={'id':util[_0x7946('0x9')](_0x7946('0x27'),_0x7bbe89,_0x2fe35f['id'],_0x2fe35f[_0x7946('0x1b')]),'condition':require(_0x7946('0x28'))['condition'](_0x7bbe89,getIntervals(_0xab2053[_0x7946('0x29')],_0x2fe35f),_0xab2053),'consequence':require('./applications/'+_0x2fe35f[_0x7946('0x1b')])[_0x7946('0x2a')](_0x7bbe89,_0xf0c5af,_0xab2053,_0x4c7c16),'p':_0x2fe35f[_0x7946('0x2b')]||0x0};logger[_0x7946('0x2c')]('Push\x20new\x20rule',_0x1fb0c6['id'],_0x7946('0x2d'),getIntervals(_0xab2053['intervals'],_0x2fe35f)[_0x7946('0x19')]('\x20|\x20'));_0x1bbc73['push'](_0x1fb0c6);}else{logger[_0x7946('0x2e')](_0x7946('0x2f'),path['join'](__dirname,_0x7946('0x15'),_0x2fe35f[_0x7946('0x1b')]+_0x7946('0x1a')));}}_0xab2053['rules'][_0x7bbe89]=new RuleEngine(_0x1bbc73);_0xab2053['rules'][_0x7bbe89]['execute'](_0x4c7c16,function(_0x218a13){logger['info'](_0x7946('0x30'),JSON[_0x7946('0x31')](_0x218a13[_0x7946('0x32')]));if(_0xab2053[_0x7946('0x11')][_0x7bbe89]){_0xab2053[_0x7946('0x11')][_0x7bbe89][_0x7946('0x33')](_0x7946('0x34'));}});return _0xffc8da({'code':0xc8,'message':_0x4c7c16});}else{logger['info'](_0x7946('0x35'));return _0xffc8da({'code':0xc8,'message':_0x4c7c16});}}catch(_0x23c5e2){logger[_0x7946('0x2e')](_0x23c5e2[_0x7946('0x36')]);return _0x522427(_0x438b51[_0x7946('0x2e')](0x1f4,_0x23c5e2));}}return _0x522427(_0x7946('0x37'));});},'AcceptMessage':function(_0x16f670){var _0x32a69d=this;return new Promise(function(_0x47bb3f,_0x22f922){if(_0x16f670['agent']&&_0x16f670[_0x7946('0x38')]['id']){if(_0xab2053[_0x7946('0x39')][_0x16f670[_0x7946('0x38')]['id']]){_0xab2053['agents'][_0x16f670[_0x7946('0x38')]['id']][_0x7946('0x3a')]=![];_0xab2053[_0x7946('0x39')][_0x16f670[_0x7946('0x38')]['id']][_0x7946('0x3b')]=undefined;}}if(_0x16f670[_0x7946('0x13')]&&_0x16f670['message']['id']){try{var _0x52d645=getId(_0x16f670[_0x7946('0x12')],_0x16f670[_0x7946('0x13')]?_0x16f670[_0x7946('0x13')]['id']:0x0,_0x16f670['interaction']?_0x16f670[_0x7946('0x14')]['id']:0x0);if(_0xab2053[_0x7946('0x11')][_0x52d645]){_0xab2053[_0x7946('0x11')][_0x52d645][_0x7946('0x33')](_0x7946('0x3c'));if(rpc[_0x16f670['channel']+'QueueReport']){rpc[_0x16f670[_0x7946('0x12')]+_0x7946('0x3d')][_0x7946('0x3e')](_0x52d645,{'UserId':_0x16f670[_0x7946('0x13')][_0x7946('0x3f')]})[_0x7946('0x40')](function(_0x235405){logger[_0x7946('0x2e')](_0x7946('0x41'));});}}return _0x47bb3f({'code':0xc8,'message':_0x16f670});}catch(_0x57c747){logger[_0x7946('0x2e')](_0x57c747[_0x7946('0x36')]);return _0x22f922(_0x32a69d[_0x7946('0x2e')](0x1f4,_0x57c747));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x22f922(_0x32a69d['error'](0x1f4,_0x7946('0x42')));});},'RejectMessage':function(_0x3e1301){var _0x112c64=this;return new Promise(function(_0x24f305,_0x304a3c){if(_0x3e1301[_0x7946('0x38')]&&_0x3e1301[_0x7946('0x38')]['id']){try{if(_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']]){_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']][_0x7946('0x3a')]=![];_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']][_0x7946('0x3b')]=undefined;}return _0x24f305({'code':0xc8,'message':_0x3e1301});}catch(_0x1a29de){logger['error'](_0x1a29de['stack']);return _0x304a3c(_0x112c64[_0x7946('0x2e')](0x1f4,_0x1a29de));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x304a3c(_0x112c64[_0x7946('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x298c3d){var _0x2c6f24=this;return new Promise(function(_0xcc0a2c,_0x3e9127){if(_0x298c3d[_0x7946('0x12')]&&_0x298c3d['interaction']&&_0x298c3d['interaction']['id']){try{var _0x1232fb=getId(_0x298c3d[_0x7946('0x12')],_0x298c3d[_0x7946('0x13')]?_0x298c3d[_0x7946('0x13')]['id']:0x0,_0x298c3d['interaction']?_0x298c3d['interaction']['id']:0x0);if(_0xab2053['rules'][_0x1232fb]){_0xab2053[_0x7946('0x11')][_0x1232fb][_0x7946('0x33')](_0x7946('0x3c'));}return _0xcc0a2c({'code':0xc8,'message':_0x298c3d});}catch(_0x148f87){logger[_0x7946('0x2e')](_0x148f87[_0x7946('0x36')]);return _0x3e9127(_0x2c6f24[_0x7946('0x2e')](0x1f4,_0x148f87));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x3e9127(_0x2c6f24[_0x7946('0x2e')](0x1f4,_0x7946('0x42')));});},'AgentCapacity':function(_0x13b5d7){var _0x1157f0=this;return new Promise(function(_0x122b20,_0x51abba){if(_0xab2053[_0x7946('0x39')][_0x7946('0x43')](_0x13b5d7['id'])){for(var _0xfedcc4 in _0x13b5d7[_0x7946('0x44')]){if(_0x13b5d7[_0x7946('0x44')][_0x7946('0x43')](_0xfedcc4)){if(_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0x7946('0x43')](_0xfedcc4+_0x7946('0x45'))){_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0xfedcc4+'CurrentCapacity']=parseInt(_0x13b5d7[_0x7946('0x44')][_0xfedcc4],0xa);}}}_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0x7946('0x46')]();return _0x122b20({'code':0xc8,'message':_0xab2053['agents'][_0x13b5d7['id']]});}else{return _0x51abba(_0x1157f0['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x263dd4){return new Promise(function(_0x491fd5,_0x285e12){var _0xfbda10=_[_0x7946('0x47')](_0xab2053[_0x7946('0x39')]);_0x491fd5({'count':_0xfbda10[_0x7946('0x17')],'rows':_0xfbda10});});},'ChatQueues':function(_0x383695){return new Promise(function(_0x161fa6,_0xb5ae75){var _0x214adf=[];for(var _0x1c6cf0 in _0xab2053[_0x7946('0x48')]){if(_0xab2053['chatQueues'][_0x7946('0x43')](_0x1c6cf0)){var _0x27f8bf=_0xab2053[_0x7946('0x48')][_0x1c6cf0];var _0x4c8510={'id':_0x27f8bf['id'],'available':_0x27f8bf['available'],'loggedIn':_0x27f8bf[_0x7946('0x49')],'name':_0x27f8bf[_0x7946('0x4a')],'paused':_0x27f8bf[_0x7946('0x4b')],'waiting':_0x27f8bf[_0x7946('0x4c')]};_0x214adf['push'](_0x4c8510);}}_0x161fa6({'count':_0x214adf[_0x7946('0x17')],'rows':_0x214adf});});},'MailQueues':function(_0x536827){return new Promise(function(_0x1a747f,_0x586f53){var _0x458293=[];for(var _0x2ff29c in _0xab2053[_0x7946('0x4d')]){if(_0xab2053['mailQueues'][_0x7946('0x43')](_0x2ff29c)){var _0x14d2e3=_0xab2053['mailQueues'][_0x2ff29c];var _0x17b273={'id':_0x14d2e3['id'],'available':_0x14d2e3[_0x7946('0x4e')],'loggedIn':_0x14d2e3[_0x7946('0x49')],'name':_0x14d2e3[_0x7946('0x4a')],'paused':_0x14d2e3[_0x7946('0x4b')],'waiting':_0x14d2e3[_0x7946('0x4c')]};_0x458293[_0x7946('0x20')](_0x17b273);}}_0x1a747f({'count':_0x458293[_0x7946('0x17')],'rows':_0x458293});});},'OpenchannelQueues':function(_0x5f0e31){return new Promise(function(_0x549a5f,_0x3ee7e6){var _0x3c16ac=[];for(var _0x1ffda4 in _0xab2053[_0x7946('0x4f')]){if(_0xab2053['openchannelQueues'][_0x7946('0x43')](_0x1ffda4)){var _0x543529=_0xab2053['openchannelQueues'][_0x1ffda4];var _0x1a3014={'id':_0x543529['id'],'available':_0x543529[_0x7946('0x4e')],'loggedIn':_0x543529['loggedIn'],'name':_0x543529[_0x7946('0x4a')],'paused':_0x543529[_0x7946('0x4b')],'waiting':_0x543529['waiting']};_0x3c16ac[_0x7946('0x20')](_0x1a3014);}}_0x549a5f({'count':_0x3c16ac[_0x7946('0x17')],'rows':_0x3c16ac});});},'SmsQueues':function(_0x33f09f){return new Promise(function(_0x1e3f83,_0x1d3703){var _0x64f18e=[];for(var _0x583179 in _0xab2053[_0x7946('0x50')]){if(_0xab2053[_0x7946('0x50')]['hasOwnProperty'](_0x583179)){var _0xc4fc84=_0xab2053[_0x7946('0x50')][_0x583179];var _0x3c21cf={'id':_0xc4fc84['id'],'available':_0xc4fc84[_0x7946('0x4e')],'loggedIn':_0xc4fc84[_0x7946('0x49')],'name':_0xc4fc84[_0x7946('0x4a')],'paused':_0xc4fc84[_0x7946('0x4b')],'waiting':_0xc4fc84['waiting']};_0x64f18e[_0x7946('0x20')](_0x3c21cf);}}_0x1e3f83({'count':_0x64f18e[_0x7946('0x17')],'rows':_0x64f18e});});},'FaxQueues':function(_0x34d21f){return new Promise(function(_0x32fe3f,_0x2c2d7a){var _0x411bab=[];for(var _0x7ea630 in _0xab2053[_0x7946('0x51')]){if(_0xab2053[_0x7946('0x51')][_0x7946('0x43')](_0x7ea630)){var _0x1fef80=_0xab2053[_0x7946('0x51')][_0x7ea630];var _0x221e4f={'id':_0x1fef80['id'],'available':_0x1fef80[_0x7946('0x4e')],'loggedIn':_0x1fef80[_0x7946('0x49')],'name':_0x1fef80['name'],'paused':_0x1fef80[_0x7946('0x4b')],'waiting':_0x1fef80['waiting']};_0x411bab[_0x7946('0x20')](_0x221e4f);}}_0x32fe3f({'count':_0x411bab[_0x7946('0x17')],'rows':_0x411bab});});},'WhatsappQueues':function(_0x597387){return new Promise(function(_0x575a19,_0x305d01){var _0x351182=[];for(var _0x515417 in _0xab2053[_0x7946('0x52')]){if(_0xab2053[_0x7946('0x52')][_0x7946('0x43')](_0x515417)){var _0xed67ff=_0xab2053[_0x7946('0x52')][_0x515417];var _0x12511f={'id':_0xed67ff['id'],'available':_0xed67ff[_0x7946('0x4e')],'loggedIn':_0xed67ff[_0x7946('0x49')],'name':_0xed67ff[_0x7946('0x4a')],'paused':_0xed67ff[_0x7946('0x4b')],'waiting':_0xed67ff[_0x7946('0x4c')]};_0x351182[_0x7946('0x20')](_0x12511f);}}_0x575a19({'count':_0x351182[_0x7946('0x17')],'rows':_0x351182});});},'ChatQueuesWaitingInteractions':function(_0x54e8ab){return new Promise(function(_0x18987b,_0x37a301){var _0x155d11=_[_0x7946('0x47')](_0xab2053[_0x7946('0x53')]);_0x18987b({'count':_0x155d11['length'],'rows':_0x155d11});});},'MailQueuesWaitingInteractions':function(_0x5976ce){return new Promise(function(_0x1b1fc6,_0x19ae8e){var _0x143323=_[_0x7946('0x47')](_0xab2053[_0x7946('0x54')]);_0x1b1fc6({'count':_0x143323[_0x7946('0x17')],'rows':_0x143323});});},'OpenchannelQueuesWaitingInteractions':function(_0x2230eb){return new Promise(function(_0x4e01a5,_0x45ca1c){var _0xd70ee0=_[_0x7946('0x47')](_0xab2053[_0x7946('0x55')]);_0x4e01a5({'count':_0xd70ee0['length'],'rows':_0xd70ee0});});},'SmsQueuesWaitingInteractions':function(_0x2815de){return new Promise(function(_0x5138bb,_0x3523de){var _0x127d29=_[_0x7946('0x47')](_0xab2053[_0x7946('0x56')]);_0x5138bb({'count':_0x127d29[_0x7946('0x17')],'rows':_0x127d29});});},'FaxQueuesWaitingInteractions':function(_0x311348){return new Promise(function(_0x3bce92,_0x323cc1){var _0x5e5ad9=_['values'](_0xab2053['faxQueuesWaitingInteractions']);_0x3bce92({'count':_0x5e5ad9[_0x7946('0x17')],'rows':_0x5e5ad9});});},'WhatsappQueuesWaitingInteractions':function(_0x39fa7f){return new Promise(function(_0x4ffcab,_0x1d1fbe){var _0x2809ea=_[_0x7946('0x47')](_0xab2053[_0x7946('0x57')]);_0x4ffcab({'count':_0x2809ea[_0x7946('0x17')],'rows':_0x2809ea});});}};var _0x1d9a17=jayson[_0x7946('0x58')](_0x42eaac)[_0x7946('0x59')]();_0x1d9a17['on'](_0x7946('0x2e'),function(_0x24af28){logger['error'](JSON[_0x7946('0x31')](_0x24af28));return _0x32413b(_0x24af28);});_0x1d9a17[_0x7946('0x10')](0x232c,'127.0.0.1',function(){console[_0x7946('0x5a')](_0x7946('0x5b'),0x232c);return _0x40aecf(_0x7946('0x5c')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 6a35f38..443382d 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 _0x3a90=['condition','rules','stop','length','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','then','error','message','result','catch'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3a90,0x64));var _0x03a9=function(_0x31f6e3,_0x37efc3){_0x31f6e3=_0x31f6e3-0x0;var _0x2ccc67=_0x3a90[_0x31f6e3];return _0x2ccc67;};'use strict';var util=require(_0x03a9('0x0'));var BPromise=require(_0x03a9('0x1'));var jayson=require(_0x03a9('0x2'));var _=require('lodash');var logger=require(_0x03a9('0x3'))(_0x03a9('0x4'));var client=jayson[_0x03a9('0x5')][_0x03a9('0x6')]({'port':0x232a});function request(_0x32f579,_0x4dbb85){return new BPromise(function(_0x40f01c,_0x1e2dbe){return client['request'](_0x32f579,_0x4dbb85)[_0x03a9('0x7')](function(_0x4291fe){if(_0x4291fe[_0x03a9('0x8')]){return _0x1e2dbe(_0x4291fe[_0x03a9('0x8')][_0x03a9('0x9')]);}else{return _0x40f01c(_0x4291fe[_0x03a9('0xa')]);}})[_0x03a9('0xb')](function(_0x1f00f6){return _0x1e2dbe(_0x1f00f6);});});}exports[_0x03a9('0xc')]=function(_0x2cfa29,_0x19963c,_0x20744f){return function(_0x376502){if(_0x20744f['rules']&&!_0x20744f[_0x03a9('0xd')][_0x2cfa29]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2cfa29);return _0x376502[_0x03a9('0xe')]();}var _0x1ceb44=[];for(var _0x1116b2=0x0;_0x1116b2<_0x19963c[_0x03a9('0xf')];_0x1116b2+=0x1){_0x1ceb44['push'](request('Command',{'command':util['format'](_0x03a9('0x10'),_0x19963c[_0x1116b2])})['then'](function(_0x14c0e4){return _0x14c0e4&&_0x14c0e4[_0x03a9('0x9')]&&_0x14c0e4[_0x03a9('0x9')][_0x03a9('0x11')](_0x03a9('0x12'))>=0x0?!![]:![];})[_0x03a9('0xb')](function(_0x35bdd2){logger['error'](_0x03a9('0x13'),_0x2cfa29,_0x19963c[_0x1116b2]);}));}BPromise[_0x03a9('0x14')](_0x1ceb44)[_0x03a9('0x7')](function(_0x1a1c60){var _0x7be8ad=_[_0x03a9('0x15')](_0x1a1c60);logger[_0x03a9('0x16')](_0x03a9('0x17'),_0x2cfa29,_0x19963c[_0x03a9('0x18')](_0x03a9('0x19')),_0x7be8ad);_0x376502[_0x03a9('0x1a')](_0x7be8ad);})[_0x03a9('0xb')](function(_0x2a7640){console[_0x03a9('0x1b')](_0x2a7640);logger[_0x03a9('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x2cfa29,_0x19963c[_0x03a9('0x18')]('\x20|\x20'),_0x2a7640['stack']);_0x376502[_0x03a9('0xe')]();});};}; \ No newline at end of file +var _0x2768=['message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','util','bluebird','routing','http','then','error'];(function(_0x511246,_0x301952){var _0xa1ae62=function(_0x238009){while(--_0x238009){_0x511246['push'](_0x511246['shift']());}};_0xa1ae62(++_0x301952);}(_0x2768,0xd2));var _0x8276=function(_0x456431,_0x32ab89){_0x456431=_0x456431-0x0;var _0x2bac7d=_0x2768[_0x456431];return _0x2bac7d;};'use strict';var util=require(_0x8276('0x0'));var BPromise=require(_0x8276('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require('../../../config/logger')(_0x8276('0x2'));var client=jayson['client'][_0x8276('0x3')]({'port':0x232a});function request(_0x13d276,_0x52f859){return new BPromise(function(_0x34d1d3,_0x2cc616){return client['request'](_0x13d276,_0x52f859)[_0x8276('0x4')](function(_0xbb6716){if(_0xbb6716[_0x8276('0x5')]){return _0x2cc616(_0xbb6716[_0x8276('0x5')][_0x8276('0x6')]);}else{return _0x34d1d3(_0xbb6716[_0x8276('0x7')]);}})[_0x8276('0x8')](function(_0x42232f){return _0x2cc616(_0x42232f);});});}exports[_0x8276('0x9')]=function(_0x4fdb9c,_0x31ccb2,_0x48cf1a){return function(_0x25f503){if(_0x48cf1a[_0x8276('0xa')]&&!_0x48cf1a[_0x8276('0xa')][_0x4fdb9c]){logger[_0x8276('0xb')](_0x8276('0xc'),_0x4fdb9c);return _0x25f503['stop']();}var _0x2c36da=[];for(var _0x225b48=0x0;_0x225b48<_0x31ccb2[_0x8276('0xd')];_0x225b48+=0x1){_0x2c36da['push'](request(_0x8276('0xe'),{'command':util[_0x8276('0xf')]('iftime\x20%s',_0x31ccb2[_0x225b48])})[_0x8276('0x4')](function(_0x203af7){return _0x203af7&&_0x203af7[_0x8276('0x6')]&&_0x203af7[_0x8276('0x6')]['indexOf'](_0x8276('0x10'))>=0x0?!![]:![];})[_0x8276('0x8')](function(_0x204059){logger[_0x8276('0x5')](_0x8276('0x11'),_0x4fdb9c,_0x31ccb2[_0x225b48]);}));}BPromise['all'](_0x2c36da)[_0x8276('0x4')](function(_0x32d021){var _0x13da7c=_[_0x8276('0x12')](_0x32d021);logger[_0x8276('0xb')](_0x8276('0x13'),_0x4fdb9c,_0x31ccb2['join'](_0x8276('0x14')),_0x13da7c);_0x25f503[_0x8276('0x15')](_0x13da7c);})[_0x8276('0x8')](function(_0x1c52f0){console[_0x8276('0x16')](_0x1c52f0);logger[_0x8276('0x5')](_0x8276('0x13'),_0x4fdb9c,_0x31ccb2['join'](_0x8276('0x14')),_0x1c52f0[_0x8276('0x17')]);_0x25f503['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index bc0458c..4784aad 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 _0x13f6=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','format','uniqueid','channel','queue','interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','membername','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]'];(function(_0x259e6b,_0x37559d){var _0x3f5b97=function(_0x463373){while(--_0x463373){_0x259e6b['push'](_0x259e6b['shift']());}};_0x3f5b97(++_0x37559d);}(_0x13f6,0x124));var _0x613f=function(_0x5f7203,_0x334239){_0x5f7203=_0x5f7203-0x0;var _0x4d1702=_0x13f6[_0x5f7203];return _0x4d1702;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563492,_0xd04cfd){utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x563492[_0x613f('0x4')],_0x563492[_0x613f('0x5')],_0x563492[_0x613f('0x6')],_0x563492['membername'],_0x563492[_0x613f('0x7')],_0x563492[_0x613f('0x8')],_0x563492['connectedlinenum'],_0x563492['lastevent']));if(_0x563492['queue']){utils['getVoiceQueueByName'](_0x563492[_0x613f('0x6')])[_0x613f('0x9')](function(_0x363736){if(_0x363736){_0x563492[_0x613f('0xa')]=_0x363736['type'];_0x563492[_0x613f('0xb')]=_0x563492[_0x613f('0xc')]?_0x363736[_0x613f('0xd')]:![];_0x563492['acwtime']=_0x563492[_0x613f('0xb')]?_0x363736[_0x613f('0xe')]:0x0;}utils[_0x613f('0xf')]('CreateVoiceAgentReport',_0x563492);});}else{utils[_0x613f('0xf')](_0x613f('0x10'),_0x563492);}if(_0xd04cfd){delete transfers[_0x563492['uniqueid']];}else{delete agents[_0x563492['destuniqueid']];}}exports['agentcalled']=function(_0x38d90a){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x12'),_0x38d90a[_0x613f('0x4')]),_0x38d90a);agents[_0x38d90a[_0x613f('0x13')]]=_0x38d90a;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();agents[_0x38d90a[_0x613f('0x13')]]['lastevent']=_0x613f('0x16');agents[_0x38d90a['destuniqueid']]['connectedlinenum']=null;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x17')]=null;utils['info'](util[_0x613f('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x38d90a[_0x613f('0x4')],agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x18')],_0x38d90a[_0x613f('0x13')]));}catch(_0x3c0feb){utils[_0x613f('0x19')](util['format']('[%s][agents][agentcalled]',_0x38d90a[_0x613f('0x4')]),_0x3c0feb);}};exports['agentringnoanswer']=function(_0x48493c){try{if(!_[_0x613f('0x1a')](agents[_0x48493c[_0x613f('0x13')]])){utils['debug'](util[_0x613f('0x3')](_0x613f('0x1b'),_0x48493c[_0x613f('0x4')]),_0x48493c);utils['info'](util['format'](_0x613f('0x1c'),_0x48493c[_0x613f('0x4')],agents[_0x48493c[_0x613f('0x13')]]['membername'],_0x48493c[_0x613f('0x13')]));agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1d')]=!![];agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1e')]=utils['now']();agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1f')]='timeout';agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x20')]=_0x613f('0x21');agents[_0x48493c['destuniqueid']]['holdtime']=_0x48493c['ringtime']?parseInt(_0x48493c[_0x613f('0x22')])/0x3e8:0x0;agents[_0x48493c['destuniqueid']][_0x613f('0x23')]=0x0;unanswered[_0x613f('0x24')](_0x48493c['destuniqueid']);}}catch(_0x121241){utils[_0x613f('0x19')](util['format']('[%s][agents][agentringnoanswer]',_0x48493c['uniqueid']),_0x121241);}};exports[_0x613f('0x25')]=function(_0x7c1a94){try{_[_0x613f('0x26')](agents,function(_0x47f4af,_0x23eda8){if(_0x47f4af[_0x613f('0x4')]==_0x7c1a94[_0x613f('0x4')]&&!_[_0x613f('0x27')](unanswered,_0x47f4af['destuniqueid'])){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x7c1a94);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x7c1a94[_0x613f('0x4')],_0x47f4af[_0x613f('0x18')],_0x47f4af[_0x613f('0x13')]));_0x47f4af['agentringnoanswer']=!![];_0x47f4af[_0x613f('0x1e')]=utils['now']();_0x47f4af[_0x613f('0x1f')]=_0x613f('0x29');_0x47f4af[_0x613f('0x20')]=_0x613f('0x29');_0x47f4af[_0x613f('0x2a')]=_0x7c1a94[_0x613f('0x2a')];_0x47f4af['talktime']=0x0;writeDB(_0x47f4af);}});}catch(_0x1a18ce){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x1a18ce);}};exports['agentconnect']=function(_0x59236e){try{if(agents[_0x59236e['destuniqueid']]){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x59236e);utils['info'](util[_0x613f('0x3')](_0x613f('0x2c'),_0x59236e['uniqueid'],agents[_0x59236e[_0x613f('0x13')]]['membername'],_0x59236e[_0x613f('0x13')]));agents[_0x59236e['destuniqueid']][_0x613f('0x2d')]=utils['now']();agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2e')]=_0x59236e[_0x613f('0x2e')];agents[_0x59236e['destuniqueid']][_0x613f('0x17')]=_0x59236e[_0x613f('0x17')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x2f');_[_0x613f('0x26')](agents,function(_0x3313c1,_0x4da8d3){if(_0x3313c1[_0x613f('0x13')]!=_0x59236e[_0x613f('0x13')]&&_0x3313c1[_0x613f('0x4')]==_0x59236e[_0x613f('0x4')]){_0x3313c1[_0x613f('0x23')]=0x0;_0x3313c1[_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];_0x3313c1['agentringnoanswer']=!![];_0x3313c1[_0x613f('0x1e')]=utils[_0x613f('0x15')]();_0x3313c1[_0x613f('0x1f')]=_0x613f('0x30');_0x3313c1[_0x613f('0x20')]=_0x613f('0x30');_0x3313c1[_0x613f('0x31')]=_0x59236e['destuniqueid'];_0x3313c1[_0x613f('0x32')]=_0x59236e[_0x613f('0x18')];writeDB(_0x3313c1);}});}}catch(_0x3bb605){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x3bb605);}};exports[_0x613f('0xc')]=function(_0x403feb){try{if(!_[_0x613f('0x1a')](agents[_0x403feb[_0x613f('0x13')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][agentcomplete]',_0x403feb[_0x613f('0x4')]),_0x403feb);utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x33'),_0x403feb['uniqueid'],agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x18')],_0x403feb[_0x613f('0x13')]));agents[_0x403feb[_0x613f('0x13')]][_0x613f('0xc')]=!![];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x23')]=utils['diffTime'](agents[_0x403feb['destuniqueid']][_0x613f('0x34')],agents[_0x403feb[_0x613f('0x13')]]['agentconnectAt']);agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x20')]=_0x403feb[_0x613f('0x20')];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x35');writeDB(agents[_0x403feb[_0x613f('0x13')]]);}}catch(_0x3a7f95){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x36'),_0x403feb[_0x613f('0x4')]),_0x3a7f95);}};exports[_0x613f('0x37')]=function(_0x17f8e5){try{if(!_[_0x613f('0x1a')](agents[_0x17f8e5[_0x613f('0x38')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]',_0x17f8e5['uniqueid']),_0x17f8e5);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x17f8e5['uniqueid'],agents[_0x17f8e5[_0x613f('0x38')]]['membername'],agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x4')]));agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x39')]=!![];agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x3b');agents[_0x17f8e5['transfereruniqueid']]['transferexten']=_0x17f8e5[_0x613f('0x3c')];agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x3d')]=agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x4')];}}catch(_0x395357){utils[_0x613f('0x19')](util['format']('[%s][agents][blindtransfer]',_0x17f8e5[_0x613f('0x4')]),_0x395357);}};exports['attendedtransfer']=function(_0x5dd54e){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x3e'),_0x5dd54e['origtransfereruniqueid']),_0x5dd54e);if(_0x5dd54e[_0x613f('0x3f')]==_0x5dd54e[_0x613f('0x40')]){if(!_[_0x613f('0x1a')](agents[_0x5dd54e[_0x613f('0x41')]])){utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e[_0x613f('0x41')]]['membername']));agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x39')]=!![];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x44')]=_0x5dd54e[_0x613f('0x45')];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3d')]=_0x5dd54e[_0x613f('0x3f')];}if(_0x5dd54e[_0x613f('0x46')]&&agents[_0x5dd54e[_0x613f('0x46')]]){agents[_0x5dd54e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x5dd54e[_0x613f('0x46')]]=_['clone'](agents[_0x5dd54e[_0x613f('0x46')]]);transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x47')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x14')]=utils['now']();transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x2d')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x46')]]['holdtime']=0x0;transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x48')]=0x2;}}else if(_0x5dd54e['secondtransfereruniqueid']==_0x5dd54e['secondtransfererlinkedid']){if(!_[_0x613f('0x1a')](agents[_0x5dd54e['origtransfereruniqueid']])){utils['info'](util['format'](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e['origtransfereruniqueid']]['membername']));agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x39')]=!![];agents[_0x5dd54e['origtransfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x44')]=_0x5dd54e['secondtransfererexten'];agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x3d')]=_0x5dd54e['secondtransfereruniqueid'];}if(_0x5dd54e[_0x613f('0x49')]&&agents[_0x5dd54e[_0x613f('0x49')]]){agents[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x1;transfers[_0x5dd54e[_0x613f('0x49')]]=_[_0x613f('0x4a')](agents[_0x5dd54e[_0x613f('0x49')]]);transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x49')]]['calleridname']=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]]['agentconnectAt']=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x2a')]=0x0;transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x2;}}}catch(_0x2ae459){utils['error'](util['format'](_0x613f('0x3e'),_0x5dd54e[_0x613f('0x3f')]),_0x2ae459);}};exports[_0x613f('0x4b')]=function(_0xddcd6){try{utils['debug'](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0xddcd6);if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6['uniqueid']][_0x613f('0x20')]===_0x613f('0x21')){if(_0xddcd6[_0x613f('0x4d')]==='21'){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x4e');agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]='rejected';}utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x18')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]));writeDB(agents[_0xddcd6['uniqueid']]);var _0x2c4b88=unanswered[_0x613f('0x50')](_0xddcd6[_0x613f('0x4')]);if(_0x2c4b88>-0x1){unanswered[_0x613f('0x51')](_0x2c4b88,0x1);}}if(transfers[_0xddcd6[_0x613f('0x4')]]){transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();transfers[_0xddcd6[_0x613f('0x4')]]['talktime']=utils[_0x613f('0x52')](transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')],transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x53');transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]=_0x613f('0x35');utils[_0x613f('0x2')](util['format'](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],transfers[_0xddcd6['uniqueid']][_0x613f('0x18')],transfers[_0xddcd6['uniqueid']][_0x613f('0x20')],transfers[_0xddcd6['uniqueid']]['lastevent']));writeDB(transfers[_0xddcd6[_0x613f('0x4')]],!![]);}if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt']=utils[_0x613f('0x15')]();agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x23')]=utils[_0x613f('0x52')](agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt'],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);agents[_0xddcd6['uniqueid']][_0x613f('0x20')]=agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x39')]?'transfer':'agent';agents[_0xddcd6['uniqueid']][_0x613f('0x1f')]=_0x613f('0x35');utils['info'](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6['uniqueid']][_0x613f('0x18')],agents[_0xddcd6['uniqueid']][_0x613f('0x20')],agents[_0xddcd6['uniqueid']]['lastevent']));writeDB(agents[_0xddcd6[_0x613f('0x4')]]);}}catch(_0x1b5f6e){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0x1b5f6e);}}; \ No newline at end of file +var _0x0565=['agentacw','agentcomplete','acwtime','acwTimeout','request','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','queue','then','type'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x0565,0xf2));var _0x5056=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x0565[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var utils=require(_0x5056('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2e0694,_0x354d5d){utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x5'),_0x2e0694[_0x5056('0x6')],_0x2e0694[_0x5056('0x7')],_0x2e0694['queue'],_0x2e0694[_0x5056('0x8')],_0x2e0694[_0x5056('0x9')],_0x2e0694[_0x5056('0xa')],_0x2e0694[_0x5056('0xb')],_0x2e0694['lastevent']));if(_0x2e0694['queue']){utils[_0x5056('0xc')](_0x2e0694[_0x5056('0xd')])[_0x5056('0xe')](function(_0x2e6f18){if(_0x2e6f18){_0x2e0694[_0x5056('0xf')]=_0x2e6f18[_0x5056('0xf')];_0x2e0694[_0x5056('0x10')]=_0x2e0694[_0x5056('0x11')]?_0x2e6f18['acw']:![];_0x2e0694[_0x5056('0x12')]=_0x2e0694[_0x5056('0x10')]?_0x2e6f18[_0x5056('0x13')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x2e0694);});}else{utils[_0x5056('0x14')]('CreateVoiceAgentReport',_0x2e0694);}if(_0x354d5d){delete transfers[_0x2e0694['uniqueid']];}else{delete agents[_0x2e0694['destuniqueid']];}}exports[_0x5056('0x15')]=function(_0x4b183a){try{utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x17'),_0x4b183a['uniqueid']),_0x4b183a);agents[_0x4b183a[_0x5056('0x18')]]=_0x4b183a;agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x19')]=utils[_0x5056('0x1a')]();agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x1b')]='called';agents[_0x4b183a[_0x5056('0x18')]]['connectedlinenum']=null;agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x1c')]=null;utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x1d'),_0x4b183a['uniqueid'],agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x8')],_0x4b183a['destuniqueid']));}catch(_0x5c1cec){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x17'),_0x4b183a[_0x5056('0x6')]),_0x5c1cec);}};exports[_0x5056('0x1f')]=function(_0xf04e08){try{if(!_[_0x5056('0x20')](agents[_0xf04e08['destuniqueid']])){utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]',_0xf04e08[_0x5056('0x6')]),_0xf04e08);utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0xf04e08[_0x5056('0x6')],agents[_0xf04e08[_0x5056('0x18')]]['membername'],_0xf04e08['destuniqueid']));agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x1f')]=!![];agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x21')]=utils['now']();agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x1b')]='timeout';agents[_0xf04e08[_0x5056('0x18')]]['reason']=_0x5056('0x22');agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x23')]=_0xf04e08[_0x5056('0x24')]?parseInt(_0xf04e08[_0x5056('0x24')])/0x3e8:0x0;agents[_0xf04e08['destuniqueid']][_0x5056('0x25')]=0x0;unanswered[_0x5056('0x26')](_0xf04e08[_0x5056('0x18')]);}}catch(_0x2ac79a){utils['error'](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]',_0xf04e08[_0x5056('0x6')]),_0x2ac79a);}};exports['queuecallerabandon']=function(_0x56ccba){try{_['forIn'](agents,function(_0x113be0,_0x252f75){if(_0x113be0['uniqueid']==_0x56ccba[_0x5056('0x6')]&&!_[_0x5056('0x27')](unanswered,_0x113be0[_0x5056('0x18')])){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x28'),_0x56ccba[_0x5056('0x6')]),_0x56ccba);utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x29'),_0x56ccba[_0x5056('0x6')],_0x113be0['membername'],_0x113be0['destuniqueid']));_0x113be0[_0x5056('0x1f')]=!![];_0x113be0[_0x5056('0x21')]=utils['now']();_0x113be0[_0x5056('0x1b')]=_0x5056('0x2a');_0x113be0['reason']=_0x5056('0x2a');_0x113be0[_0x5056('0x23')]=_0x56ccba[_0x5056('0x23')];_0x113be0[_0x5056('0x25')]=0x0;writeDB(_0x113be0);}});}catch(_0x33edfb){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x28'),_0x56ccba[_0x5056('0x6')]),_0x33edfb);}};exports[_0x5056('0x2b')]=function(_0x199129){try{if(agents[_0x199129[_0x5056('0x18')]]){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x2c'),_0x199129['uniqueid']),_0x199129);utils[_0x5056('0x3')](util['format'](_0x5056('0x2d'),_0x199129[_0x5056('0x6')],agents[_0x199129[_0x5056('0x18')]][_0x5056('0x8')],_0x199129['destuniqueid']));agents[_0x199129[_0x5056('0x18')]][_0x5056('0x2e')]=utils['now']();agents[_0x199129[_0x5056('0x18')]]['connectedlinenum']=_0x199129[_0x5056('0xb')];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x1c')]=_0x199129['connectedlinename'];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x23')]=_0x199129[_0x5056('0x24')];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x1b')]=_0x5056('0x2f');_[_0x5056('0x30')](agents,function(_0x21aa75,_0x15553e){if(_0x21aa75[_0x5056('0x18')]!=_0x199129[_0x5056('0x18')]&&_0x21aa75[_0x5056('0x6')]==_0x199129[_0x5056('0x6')]){_0x21aa75[_0x5056('0x25')]=0x0;_0x21aa75[_0x5056('0x23')]=_0x199129[_0x5056('0x24')];_0x21aa75['agentringnoanswer']=!![];_0x21aa75['agentringnoanswerAt']=utils[_0x5056('0x1a')]();_0x21aa75[_0x5056('0x1b')]=_0x5056('0x31');_0x21aa75[_0x5056('0x32')]=_0x5056('0x31');_0x21aa75[_0x5056('0x33')]=_0x199129[_0x5056('0x18')];_0x21aa75[_0x5056('0x34')]=_0x199129['membername'];writeDB(_0x21aa75);}});}}catch(_0x58f12f){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x2c'),_0x199129['uniqueid']),_0x58f12f);}};exports[_0x5056('0x11')]=function(_0x5b99e9){try{if(!_[_0x5056('0x20')](agents[_0x5b99e9[_0x5056('0x18')]])){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x35'),_0x5b99e9[_0x5056('0x6')]),_0x5b99e9);utils['info'](util[_0x5056('0x4')](_0x5056('0x36'),_0x5b99e9[_0x5056('0x6')],agents[_0x5b99e9['destuniqueid']]['membername'],_0x5b99e9['destuniqueid']));agents[_0x5b99e9['destuniqueid']][_0x5056('0x11')]=!![];agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x37')]=utils[_0x5056('0x1a')]();agents[_0x5b99e9[_0x5056('0x18')]]['talktime']=utils['diffTime'](agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x37')],agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x2e')]);agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x32')]=_0x5b99e9[_0x5056('0x32')];agents[_0x5b99e9['destuniqueid']]['lastevent']=_0x5056('0x38');writeDB(agents[_0x5b99e9[_0x5056('0x18')]]);}}catch(_0x5a2f73){utils[_0x5056('0x1e')](util[_0x5056('0x4')]('[%s][agents][agentcomplete]',_0x5b99e9['uniqueid']),_0x5a2f73);}};exports[_0x5056('0x39')]=function(_0x1ab1a9){try{if(!_['isNil'](agents[_0x1ab1a9['transfereruniqueid']])){utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][blindtransfer]',_0x1ab1a9['uniqueid']),_0x1ab1a9);utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x3a'),_0x1ab1a9[_0x5056('0x6')],agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x8')],agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x6')]));agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3c')]=!![];agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3d')]=_0x5056('0x3e');agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3f')]=_0x1ab1a9['extension'];agents[_0x1ab1a9['transfereruniqueid']][_0x5056('0x40')]=agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x6')];}}catch(_0x1c84b1){utils[_0x5056('0x1e')](util[_0x5056('0x4')]('[%s][agents][blindtransfer]',_0x1ab1a9[_0x5056('0x6')]),_0x1c84b1);}};exports[_0x5056('0x41')]=function(_0x41dba4){try{utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x42'),_0x41dba4[_0x5056('0x43')]),_0x41dba4);if(_0x41dba4[_0x5056('0x43')]==_0x41dba4[_0x5056('0x44')]){if(!_[_0x5056('0x20')](agents[_0x41dba4[_0x5056('0x45')]])){utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x41dba4[_0x5056('0x43')],agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x8')]));agents[_0x41dba4['secondtransfereruniqueid']][_0x5056('0x3c')]=!![];agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x3d')]=_0x5056('0x46');agents[_0x41dba4['secondtransfereruniqueid']]['transferexten']=_0x41dba4['origtransfererexten'];agents[_0x41dba4[_0x5056('0x45')]]['transferuniqueid']=_0x41dba4[_0x5056('0x43')];}if(_0x41dba4[_0x5056('0x47')]&&agents[_0x41dba4[_0x5056('0x47')]]){agents[_0x41dba4[_0x5056('0x47')]][_0x5056('0x48')]=0x1;transfers[_0x41dba4[_0x5056('0x47')]]=_['clone'](agents[_0x41dba4['transfereeuniqueid']]);transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0xa')]=agents[_0x41dba4['secondtransfereruniqueid']][_0x5056('0xa')];transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x49')]=agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x49')];transfers[_0x41dba4['transfereeuniqueid']][_0x5056('0x19')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4['transfereeuniqueid']][_0x5056('0x2e')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x23')]=0x0;transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x48')]=0x2;}}else if(_0x41dba4[_0x5056('0x45')]==_0x41dba4[_0x5056('0x4a')]){if(!_[_0x5056('0x20')](agents[_0x41dba4[_0x5056('0x43')]])){utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x4b'),_0x41dba4['origtransfereruniqueid'],agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x8')]));agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x3c')]=!![];agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x3d')]='ATTENDED';agents[_0x41dba4[_0x5056('0x43')]]['transferexten']=_0x41dba4[_0x5056('0x4c')];agents[_0x41dba4[_0x5056('0x43')]]['transferuniqueid']=_0x41dba4['secondtransfereruniqueid'];}if(_0x41dba4[_0x5056('0x4d')]&&agents[_0x41dba4[_0x5056('0x4d')]]){agents[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x48')]=0x1;transfers[_0x41dba4['transfertargetuniqueid']]=_['clone'](agents[_0x41dba4[_0x5056('0x4d')]]);transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0xa')]=agents[_0x41dba4['origtransfereruniqueid']][_0x5056('0xa')];transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x49')]=agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x49')];transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x19')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x2e')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x23')]=0x0;transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x48')]=0x2;}}}catch(_0x17131c){utils[_0x5056('0x1e')](util['format'](_0x5056('0x42'),_0x41dba4['origtransfereruniqueid']),_0x17131c);}};exports[_0x5056('0x4e')]=function(_0x5468d6){try{utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][hangup]',_0x5468d6[_0x5056('0x6')]),_0x5468d6);if(agents[_0x5468d6[_0x5056('0x6')]]&&agents[_0x5468d6['uniqueid']][_0x5056('0x32')]==='timeout'){if(_0x5468d6['cause']==='21'){agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')]=_0x5056('0x4f');agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]=_0x5056('0x4f');}utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x50'),_0x5468d6[_0x5056('0x6')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x8')],agents[_0x5468d6['uniqueid']][_0x5056('0x32')],agents[_0x5468d6['uniqueid']][_0x5056('0x1b')]));writeDB(agents[_0x5468d6[_0x5056('0x6')]]);var _0x53816f=unanswered[_0x5056('0x51')](_0x5468d6[_0x5056('0x6')]);if(_0x53816f>-0x1){unanswered[_0x5056('0x52')](_0x53816f,0x1);}}if(transfers[_0x5468d6[_0x5056('0x6')]]){transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x11')]=!![];transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')]=utils['now']();transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x25')]=utils[_0x5056('0x53')](transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')],transfers[_0x5468d6['uniqueid']][_0x5056('0x2e')]);transfers[_0x5468d6['uniqueid']][_0x5056('0x32')]=_0x5056('0x54');transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]=_0x5056('0x38');utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5468d6[_0x5056('0x6')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x8')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]));writeDB(transfers[_0x5468d6['uniqueid']],!![]);}if(agents[_0x5468d6['uniqueid']]&&agents[_0x5468d6['uniqueid']][_0x5056('0x2e')]){agents[_0x5468d6['uniqueid']][_0x5056('0x11')]=!![];agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')]=utils['now']();agents[_0x5468d6[_0x5056('0x6')]]['talktime']=utils[_0x5056('0x53')](agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')],agents[_0x5468d6['uniqueid']][_0x5056('0x2e')]);agents[_0x5468d6['uniqueid']]['reason']=agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x3c')]?'transfer':_0x5056('0x54');agents[_0x5468d6['uniqueid']][_0x5056('0x1b')]=_0x5056('0x38');utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x50'),_0x5468d6[_0x5056('0x6')],agents[_0x5468d6['uniqueid']][_0x5056('0x8')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]));writeDB(agents[_0x5468d6[_0x5056('0x6')]]);}}catch(_0x5d5c93){utils[_0x5056('0x1e')](util['format'](_0x5056('0x55'),_0x5468d6[_0x5056('0x6')]),_0x5d5c93);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ae8e4b1..af50f91 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 _0x44c1=['starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','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]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime'];(function(_0x5d0a61,_0x4b9f6f){var _0x1a107a=function(_0x460515){while(--_0x460515){_0x5d0a61['push'](_0x5d0a61['shift']());}};_0x1a107a(++_0x4b9f6f);}(_0x44c1,0xaa));var _0x144c=function(_0x10745e,_0x4cd185){_0x10745e=_0x10745e-0x0;var _0x5bded5=_0x44c1[_0x10745e];return _0x5bded5;};'use strict';var _=require('lodash');var util=require(_0x144c('0x0'));var utils=require(_0x144c('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x144c('0x2'),'FAILED',_0x144c('0x3'),_0x144c('0x2'),_0x144c('0x2'),_0x144c('0x2'),_0x144c('0x4'),_0x144c('0x5'),_0x144c('0x3'),_0x144c('0x3'),_0x144c('0x3')];var channels={};function writeDB(_0x27c613){var _0x167ff5;if(transfers[_0x144c('0x6')][_0x27c613[_0x144c('0x7')]]){_0x167ff5=_0x27c613['uniqueid'];_0x27c613[_0x144c('0x7')]=transfers['blinds'][_0x27c613['uniqueid']][_0x144c('0x8')];}utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0xb'),_0x27c613['uniqueid'],_0x27c613[_0x144c('0xc')],_0x27c613[_0x144c('0xd')],_0x27c613[_0x144c('0xe')],_0x27c613[_0x144c('0xf')],_0x27c613['calleridnum'],_0x27c613[_0x144c('0x10')],_0x27c613[_0x144c('0x11')]));if(_0x27c613[_0x144c('0x12')]){utils[_0x144c('0x13')](_0x27c613[_0x144c('0x12')])[_0x144c('0x14')](function(_0x36068d){if(_0x36068d){_0x27c613[_0x144c('0x15')]=_0x36068d['id'];}utils[_0x144c('0x16')](_0x144c('0x17'),_0x27c613);});}else{utils[_0x144c('0x16')](_0x144c('0x17'),_0x27c613);}if(channels[_0x27c613[_0x144c('0x7')]]){delete channels[_0x27c613['uniqueid']];}else if(_0x167ff5&&channels[_0x167ff5]){delete transfers[_0x144c('0x6')][_0x167ff5];delete channels[_0x167ff5];}}exports[_0x144c('0x18')]=function(_0x555cfb){try{utils['debug'](util[_0x144c('0xa')](_0x144c('0x19'),_0x555cfb[_0x144c('0x7')]),_0x555cfb);if(_0x555cfb[_0x144c('0x7')]==_0x555cfb[_0x144c('0x1a')]&&_0x555cfb[_0x144c('0xc')]!=_0x144c('0x1b')){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x1c'),_0x555cfb[_0x144c('0x7')],_0x555cfb[_0x144c('0x1d')],_0x555cfb[_0x144c('0x1e')]));channels[_0x555cfb[_0x144c('0x7')]]={'uniqueid':_0x555cfb[_0x144c('0x7')],'accountcode':_0x555cfb[_0x144c('0x12')],'source':_0x555cfb[_0x144c('0x1f')],'destination':_0x555cfb[_0x144c('0x1e')],'destinationcontext':_0x555cfb[_0x144c('0x1d')],'channel':_0x555cfb[_0x144c('0xc')],'starttime':utils[_0x144c('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x144c('0x2'),'amaflags':_0x144c('0x21')};}}catch(_0x19c4af){utils['error'](util[_0x144c('0xa')]('[%s][calls][newchannel]',_0x555cfb[_0x144c('0x7')]),_0x19c4af);}};exports[_0x144c('0x22')]=function(_0x568c12){try{utils[_0x144c('0x23')](util[_0x144c('0xa')]('[%s][calls][newstate]',_0x568c12[_0x144c('0x7')]),_0x568c12);if(!_[_0x144c('0x24')](channels[_0x568c12[_0x144c('0x7')]])&&_0x568c12[_0x144c('0x25')]==0x6){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x26'),_0x568c12[_0x144c('0x7')],_0x568c12[_0x144c('0x1d')],_0x568c12[_0x144c('0xc')]));if(_['isNil'](channels[_0x568c12[_0x144c('0x7')]][_0x144c('0x27')])){channels[_0x568c12['uniqueid']]['systemanswertime']=utils[_0x144c('0x20')]();}}else if(!_[_0x144c('0x24')](channels[_0x568c12[_0x144c('0x1a')]])&&_0x568c12['channelstate']==0x6&&_0x568c12[_0x144c('0x1d')]!=_0x144c('0x28')){utils['info'](util[_0x144c('0xa')](_0x144c('0x29'),_0x568c12['uniqueid'],_0x568c12[_0x144c('0x1a')],_0x568c12[_0x144c('0x1d')],_0x568c12[_0x144c('0xc')]));channels[_0x568c12[_0x144c('0x1a')]][_0x144c('0x12')]=_0x568c12[_0x144c('0x12')];channels[_0x568c12[_0x144c('0x1a')]][_0x144c('0x2a')]=_0x568c12[_0x144c('0xc')];if(_[_0x144c('0x24')](channels[_0x568c12[_0x144c('0x1a')]][_0x144c('0x2b')])){channels[_0x568c12[_0x144c('0x1a')]]['answertime']=utils[_0x144c('0x20')]();}channels[_0x568c12[_0x144c('0x1a')]][_0x144c('0x2c')]=dispositions[_['toNumber'](_0x568c12[_0x144c('0x25')])]||_0x144c('0x4');}}catch(_0x7589a6){utils[_0x144c('0x2d')](util[_0x144c('0xa')](_0x144c('0x2e'),_0x568c12[_0x144c('0x7')]),_0x7589a6);}};exports[_0x144c('0x2f')]=function(_0x3e7502){try{if(!_['isNil'](channels[_0x3e7502['uniqueid']])){utils[_0x144c('0x23')](util[_0x144c('0xa')](_0x144c('0x30'),_0x3e7502[_0x144c('0x7')]),_0x3e7502);if(_[_0x144c('0x24')](channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x31')])){channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x31')]=_0x3e7502[_0x144c('0x32')]+'\x20<'+_0x3e7502[_0x144c('0x1f')]+'>';}utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x33'),_0x3e7502['uniqueid'],channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x31')],_0x3e7502[_0x144c('0x34')]));channels[_0x3e7502['uniqueid']][_0x144c('0x35')]=utils[_0x144c('0x20')]();channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x36')]=utils[_0x144c('0x37')](channels[_0x3e7502['uniqueid']]['endtime'],channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x38')]);channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x39')]=channels[_0x3e7502['uniqueid']]['answertime']?utils[_0x144c('0x37')](channels[_0x3e7502[_0x144c('0x7')]]['endtime'],channels[_0x3e7502[_0x144c('0x7')]][_0x144c('0x2b')]):0x0;writeDB(channels[_0x3e7502['uniqueid']]);}}catch(_0x5aac60){utils[_0x144c('0x2d')](util[_0x144c('0xa')](_0x144c('0x30'),_0x3e7502[_0x144c('0x7')]),_0x5aac60);}};exports['attendedtransfer']=function(_0x36833c){try{if(!_[_0x144c('0x24')](channels[_0x36833c[_0x144c('0x3a')]])){utils[_0x144c('0x23')](util['format'](_0x144c('0x3b'),_0x36833c[_0x144c('0x3c')]),_0x36833c);if(channels[_0x36833c[_0x144c('0x3a')]]['channel']==_0x36833c[_0x144c('0x3d')]){utils['info'](util[_0x144c('0xa')](_0x144c('0x3e'),_0x36833c[_0x144c('0x3c')],_0x36833c['localtwolinkedid'],_0x36833c[_0x144c('0x3f')]));channels[_0x36833c['localtwolinkedid']][_0x144c('0x2a')]=_0x36833c[_0x144c('0x3f')];channels[_0x36833c[_0x144c('0x3a')]][_0x144c('0x40')]=_0x144c('0x41');}else if(channels[_0x36833c[_0x144c('0x3a')]][_0x144c('0xc')]=_0x36833c[_0x144c('0x42')]){utils[_0x144c('0x9')](util[_0x144c('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x36833c[_0x144c('0x3c')],_0x36833c[_0x144c('0x3a')],_0x36833c[_0x144c('0x43')]));channels[_0x36833c[_0x144c('0x3a')]]['destinationchannel']=_0x36833c[_0x144c('0x43')];channels[_0x36833c[_0x144c('0x3a')]][_0x144c('0x40')]='_attended';}}}catch(_0x1bbca0){utils[_0x144c('0x2d')](util[_0x144c('0xa')](_0x144c('0x3b'),_0x36833c[_0x144c('0x3c')]),_0x1bbca0);}};exports[_0x144c('0x44')]=function(_0x3595e2){try{if(!_[_0x144c('0x24')](channels[_0x3595e2['uniqueid']])){utils[_0x144c('0x23')](util[_0x144c('0xa')]('[%s][calls][musiconholdstart]',_0x3595e2[_0x144c('0x7')]),_0x3595e2);channels[_0x3595e2[_0x144c('0x7')]][_0x144c('0x45')]=utils['now']();utils[_0x144c('0x9')](util[_0x144c('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3595e2[_0x144c('0x7')],channels[_0x3595e2[_0x144c('0x7')]][_0x144c('0x45')]));}}catch(_0x5aebe3){utils[_0x144c('0x2d')](util['format'](_0x144c('0x46'),_0x3595e2[_0x144c('0x7')]),_0x5aebe3);}};exports['musiconholdstop']=function(_0x530016){try{if(!_['isNil'](channels[_0x530016['uniqueid']])){utils[_0x144c('0x23')](util[_0x144c('0xa')](_0x144c('0x47'),_0x530016[_0x144c('0x7')]),_0x530016);if(!_['isNil'](channels[_0x530016[_0x144c('0x7')]][_0x144c('0x45')])){channels[_0x530016[_0x144c('0x7')]][_0x144c('0x48')]+=utils[_0x144c('0x37')](utils[_0x144c('0x20')](),channels[_0x530016['uniqueid']][_0x144c('0x45')]);utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x49'),_0x530016['uniqueid'],channels[_0x530016[_0x144c('0x7')]][_0x144c('0x48')]));delete channels[_0x530016['uniqueid']][_0x144c('0x45')];}}}catch(_0x2c843e){utils[_0x144c('0x2d')](util[_0x144c('0xa')](_0x144c('0x47'),_0x530016[_0x144c('0x7')]),_0x2c843e);}};exports[_0x144c('0x4a')]=function(_0x245945){try{if(!_['isNil'](channels[_0x245945[_0x144c('0x7')]])){utils[_0x144c('0x23')](util[_0x144c('0xa')](_0x144c('0x4b'),_0x245945['uniqueid']),_0x245945);if(!_[_0x144c('0x24')](_0x245945[_0x144c('0x4c')]['xmd-originatecalleridnum'])){utils[_0x144c('0x9')](util[_0x144c('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x245945[_0x144c('0x7')],_0x245945[_0x144c('0x4d')]));channels[_0x245945['uniqueid']]['source']=_0x245945[_0x144c('0x4d')];}if(!_[_0x144c('0x24')](_0x245945[_0x144c('0x4c')]['xmd-phone'])){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x4e'),_0x245945[_0x144c('0x7')],_0x245945[_0x144c('0x4d')]));channels[_0x245945[_0x144c('0x7')]][_0x144c('0x4f')]=_0x245945[_0x144c('0x4d')];channels[_0x245945[_0x144c('0x7')]][_0x144c('0x31')]='\x22'+_0x245945[_0x144c('0x4d')]+_0x144c('0x50')+_0x245945[_0x144c('0x4d')]+'>';}if(!_['isNil'](_0x245945[_0x144c('0x4c')][_0x144c('0x51')])||!_[_0x144c('0x24')](_0x245945[_0x144c('0x4c')]['xmd-callerid'])){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x52'),_0x245945[_0x144c('0x7')],!_['isNil'](_0x245945[_0x144c('0x4c')]['xmd-callerid-preview'])?_0x144c('0x51'):_0x144c('0x53'),_0x245945[_0x144c('0x4d')]));channels[_0x245945[_0x144c('0x7')]][_0x144c('0x31')]=_0x245945[_0x144c('0x4d')];}if(!_[_0x144c('0x24')](_0x245945['variable'][_0x144c('0x54')])||!_['isNil'](_0x245945[_0x144c('0x4c')][_0x144c('0x55')])){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x52'),_0x245945[_0x144c('0x7')],!_['isNil'](_0x245945[_0x144c('0x4c')][_0x144c('0x54')])?_0x144c('0x54'):_0x144c('0x55'),_0x245945['value']));channels[_0x245945['uniqueid']][_0x144c('0x56')]=_0x144c('0x57');channels[_0x245945[_0x144c('0x7')]][_0x144c('0x58')]=_0x245945['value'];channels[_0x245945[_0x144c('0x7')]][_0x144c('0xd')]=!![];}if(!_['isNil'](_0x245945[_0x144c('0x4c')][_0x144c('0x59')])){utils[_0x144c('0x9')](util[_0x144c('0xa')](_0x144c('0x5a'),_0x245945[_0x144c('0x7')],_0x245945['value']));channels[_0x245945[_0x144c('0x7')]][_0x144c('0x5b')]=_0x245945[_0x144c('0x4d')];}if(!_[_0x144c('0x24')](_0x245945['variable'][_0x144c('0x5c')])){utils[_0x144c('0x9')](util[_0x144c('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x245945['uniqueid'],_0x245945[_0x144c('0x4d')]));channels[_0x245945[_0x144c('0x7')]][_0x144c('0x5d')]=_0x245945[_0x144c('0x4d')];}if(!_[_0x144c('0x24')](_0x245945[_0x144c('0x4c')][_0x144c('0x5e')])){utils[_0x144c('0x9')](util['format'](_0x144c('0x5f'),_0x245945[_0x144c('0x7')],_0x245945[_0x144c('0x4d')]));channels[_0x245945[_0x144c('0x7')]][_0x144c('0x60')]=_0x245945[_0x144c('0x4d')];}if(!_[_0x144c('0x24')](_0x245945[_0x144c('0x4c')][_0x144c('0x61')])){utils['info'](util[_0x144c('0xa')](_0x144c('0x62'),_0x245945[_0x144c('0x7')],_0x245945[_0x144c('0x4d')]));channels[_0x245945['uniqueid']]['sipcallid']=_0x245945['value'];}}}catch(_0x2a011f){utils[_0x144c('0x2d')](util['format'](_0x144c('0x4b'),_0x245945[_0x144c('0x7')]),_0x2a011f);}};exports[_0x144c('0x63')]=function(_0x5bf0e6){try{if(!_[_0x144c('0x24')](channels[_0x5bf0e6[_0x144c('0x7')]])){utils[_0x144c('0x23')](util['format']('[%s][calls][newexten]',_0x5bf0e6[_0x144c('0x7')]),_0x5bf0e6);utils[_0x144c('0x9')](util[_0x144c('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x5bf0e6['uniqueid'],_0x5bf0e6[_0x144c('0x64')],_0x5bf0e6[_0x144c('0x65')]));if(_0x5bf0e6['application'][_0x144c('0x66')]()==_0x144c('0x67')&&_[_0x144c('0x68')](_0x5bf0e6[_0x144c('0x65')]['toLowerCase'](),_0x144c('0x69'))){var _0x380015=_0x5bf0e6[_0x144c('0x65')]['split']('=');var _0xa2af3d=_0x380015[0x0][_0x144c('0x6a')](_0x380015[0x0][_0x144c('0x6b')]('(')+0x1,_0x380015[0x0]['lastIndexOf'](')'));var _0x36178e=_0x380015[0x1];channels[_0x5bf0e6['uniqueid']][_0xa2af3d]=_0x36178e;}if(!_[_0x144c('0x6c')](['hangup',_0x144c('0x6d'),_0x144c('0x6e'),'set',_0x144c('0x6f')],_0x5bf0e6['application'][_0x144c('0x66')]())){channels[_0x5bf0e6[_0x144c('0x7')]][_0x144c('0x56')]=_0x5bf0e6[_0x144c('0x64')];channels[_0x5bf0e6[_0x144c('0x7')]][_0x144c('0x58')]=_0x5bf0e6['appdata'];}}}catch(_0xe9eee2){utils[_0x144c('0x2d')](util[_0x144c('0xa')](_0x144c('0x70'),_0x5bf0e6[_0x144c('0x7')]),_0xe9eee2);}}; \ No newline at end of file +var _0x6819=['endtime','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','variable','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','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','toLowerCase','set','appdata','cdr','lastIndexOf','hangup','noop','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','then','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt'];(function(_0x540009,_0x197961){var _0x349c76=function(_0x441e0f){while(--_0x441e0f){_0x540009['push'](_0x540009['shift']());}};_0x349c76(++_0x197961);}(_0x6819,0xfd));var _0x9681=function(_0x3656f1,_0x2fd7ca){_0x3656f1=_0x3656f1-0x0;var _0x3ae213=_0x6819[_0x3656f1];return _0x3ae213;};'use strict';var _=require(_0x9681('0x0'));var util=require(_0x9681('0x1'));var utils=require(_0x9681('0x2'));var transfers=require(_0x9681('0x3'));var dispositions=[_0x9681('0x4'),_0x9681('0x5'),_0x9681('0x5'),_0x9681('0x4'),_0x9681('0x4'),_0x9681('0x4'),_0x9681('0x6'),'BUSY','FAILED','FAILED','FAILED'];var channels={};function writeDB(_0x4bbbc1){var _0x3ee915;if(transfers[_0x9681('0x7')][_0x4bbbc1[_0x9681('0x8')]]){_0x3ee915=_0x4bbbc1[_0x9681('0x8')];_0x4bbbc1[_0x9681('0x8')]=transfers[_0x9681('0x7')][_0x4bbbc1['uniqueid']][_0x9681('0x9')];}utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4bbbc1[_0x9681('0x8')],_0x4bbbc1[_0x9681('0xc')],_0x4bbbc1[_0x9681('0xd')],_0x4bbbc1[_0x9681('0xe')],_0x4bbbc1[_0x9681('0xf')],_0x4bbbc1[_0x9681('0x10')],_0x4bbbc1[_0x9681('0x11')],_0x4bbbc1['lastevent']));if(_0x4bbbc1[_0x9681('0x12')]){utils['getUserByInternal'](_0x4bbbc1['accountcode'])[_0x9681('0x13')](function(_0xf1b2c8){if(_0xf1b2c8){_0x4bbbc1['UserId']=_0xf1b2c8['id'];}utils['request']('CreateVoiceCallReport',_0x4bbbc1);});}else{utils['request'](_0x9681('0x14'),_0x4bbbc1);}if(channels[_0x4bbbc1[_0x9681('0x8')]]){delete channels[_0x4bbbc1[_0x9681('0x8')]];}else if(_0x3ee915&&channels[_0x3ee915]){delete transfers[_0x9681('0x7')][_0x3ee915];delete channels[_0x3ee915];}}exports[_0x9681('0x15')]=function(_0x3e67a1){try{utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x17'),_0x3e67a1[_0x9681('0x8')]),_0x3e67a1);if(_0x3e67a1['uniqueid']==_0x3e67a1[_0x9681('0x18')]&&_0x3e67a1['channel']!=_0x9681('0x19')){utils['info'](util[_0x9681('0xb')](_0x9681('0x1a'),_0x3e67a1[_0x9681('0x8')],_0x3e67a1[_0x9681('0x1b')],_0x3e67a1[_0x9681('0x1c')]));channels[_0x3e67a1[_0x9681('0x8')]]={'uniqueid':_0x3e67a1['uniqueid'],'accountcode':_0x3e67a1[_0x9681('0x12')],'source':_0x3e67a1['calleridnum'],'destination':_0x3e67a1[_0x9681('0x1c')],'destinationcontext':_0x3e67a1[_0x9681('0x1b')],'channel':_0x3e67a1[_0x9681('0xc')],'starttime':utils[_0x9681('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x9681('0x1e')};}}catch(_0x25f7f7){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][newchannel]',_0x3e67a1[_0x9681('0x8')]),_0x25f7f7);}};exports['newstate']=function(_0x532868){try{utils['debug'](util[_0x9681('0xb')]('[%s][calls][newstate]',_0x532868[_0x9681('0x8')]),_0x532868);if(!_[_0x9681('0x20')](channels[_0x532868['uniqueid']])&&_0x532868['channelstate']==0x6){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x21'),_0x532868[_0x9681('0x8')],_0x532868[_0x9681('0x1b')],_0x532868[_0x9681('0xc')]));if(_[_0x9681('0x20')](channels[_0x532868[_0x9681('0x8')]][_0x9681('0x22')])){channels[_0x532868[_0x9681('0x8')]][_0x9681('0x22')]=utils[_0x9681('0x1d')]();}}else if(!_[_0x9681('0x20')](channels[_0x532868['linkedid']])&&_0x532868[_0x9681('0x23')]==0x6&&_0x532868['context']!='transfer'){utils['info'](util['format'](_0x9681('0x24'),_0x532868['uniqueid'],_0x532868[_0x9681('0x18')],_0x532868[_0x9681('0x1b')],_0x532868['channel']));channels[_0x532868[_0x9681('0x18')]][_0x9681('0x12')]=_0x532868[_0x9681('0x12')];channels[_0x532868[_0x9681('0x18')]][_0x9681('0x25')]=_0x532868[_0x9681('0xc')];if(_['isNil'](channels[_0x532868[_0x9681('0x18')]][_0x9681('0x26')])){channels[_0x532868[_0x9681('0x18')]][_0x9681('0x26')]=utils['now']();}channels[_0x532868['linkedid']][_0x9681('0x27')]=dispositions[_[_0x9681('0x28')](_0x532868[_0x9681('0x23')])]||_0x9681('0x6');}}catch(_0x53946e){utils[_0x9681('0x1f')](util['format'](_0x9681('0x29'),_0x532868[_0x9681('0x8')]),_0x53946e);}};exports['hangup']=function(_0x1d7fcf){try{if(!_[_0x9681('0x20')](channels[_0x1d7fcf[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x2a'),_0x1d7fcf[_0x9681('0x8')]),_0x1d7fcf);if(_[_0x9681('0x20')](channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2b')])){channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2b')]=_0x1d7fcf[_0x9681('0x2c')]+'\x20<'+_0x1d7fcf[_0x9681('0x10')]+'>';}utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x2d'),_0x1d7fcf[_0x9681('0x8')],channels[_0x1d7fcf['uniqueid']][_0x9681('0x2b')],_0x1d7fcf[_0x9681('0x2e')]));channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2f')]=utils['now']();channels[_0x1d7fcf[_0x9681('0x8')]]['duration']=utils[_0x9681('0x30')](channels[_0x1d7fcf['uniqueid']][_0x9681('0x2f')],channels[_0x1d7fcf[_0x9681('0x8')]]['starttime']);channels[_0x1d7fcf[_0x9681('0x8')]]['billableseconds']=channels[_0x1d7fcf[_0x9681('0x8')]]['answertime']?utils[_0x9681('0x30')](channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2f')],channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x26')]):0x0;writeDB(channels[_0x1d7fcf['uniqueid']]);}}catch(_0x5d454a){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][hangup]',_0x1d7fcf[_0x9681('0x8')]),_0x5d454a);}};exports[_0x9681('0x31')]=function(_0x5b0dfe){try{if(!_['isNil'](channels[_0x5b0dfe['localtwolinkedid']])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x32'),_0x5b0dfe[_0x9681('0x33')]),_0x5b0dfe);if(channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0xc')]==_0x5b0dfe['transfereechannel']){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x35'),_0x5b0dfe[_0x9681('0x33')],_0x5b0dfe[_0x9681('0x34')],_0x5b0dfe['secondtransfererchannel']));channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x25')]=_0x5b0dfe[_0x9681('0x36')];channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x37')]=_0x9681('0x38');}else if(channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0xc')]=_0x5b0dfe['transfertargetchannel']){utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5b0dfe[_0x9681('0x33')],_0x5b0dfe[_0x9681('0x34')],_0x5b0dfe[_0x9681('0x39')]));channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x25')]=_0x5b0dfe['origtransfererchannel'];channels[_0x5b0dfe['localtwolinkedid']][_0x9681('0x37')]=_0x9681('0x38');}}}catch(_0x25dbf6){utils['error'](util['format'](_0x9681('0x32'),_0x5b0dfe[_0x9681('0x33')]),_0x25dbf6);}};exports[_0x9681('0x3a')]=function(_0x42ee80){try{if(!_[_0x9681('0x20')](channels[_0x42ee80[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][musiconholdstart]',_0x42ee80[_0x9681('0x8')]),_0x42ee80);channels[_0x42ee80[_0x9681('0x8')]][_0x9681('0x3b')]=utils['now']();utils['info'](util['format'](_0x9681('0x3c'),_0x42ee80[_0x9681('0x8')],channels[_0x42ee80[_0x9681('0x8')]][_0x9681('0x3b')]));}}catch(_0x5f1203){utils['error'](util[_0x9681('0xb')](_0x9681('0x3d'),_0x42ee80[_0x9681('0x8')]),_0x5f1203);}};exports[_0x9681('0x3e')]=function(_0xefdfd7){try{if(!_['isNil'](channels[_0xefdfd7[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][musiconholdstop]',_0xefdfd7[_0x9681('0x8')]),_0xefdfd7);if(!_[_0x9681('0x20')](channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')])){channels[_0xefdfd7[_0x9681('0x8')]]['mohtime']+=utils[_0x9681('0x30')](utils[_0x9681('0x1d')](),channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')]);utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x3f'),_0xefdfd7[_0x9681('0x8')],channels[_0xefdfd7['uniqueid']]['mohtime']));delete channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')];}}}catch(_0x1c271c){utils[_0x9681('0x1f')](util[_0x9681('0xb')](_0x9681('0x40'),_0xefdfd7[_0x9681('0x8')]),_0x1c271c);}};exports[_0x9681('0x41')]=function(_0x4e98d3){try{if(!_[_0x9681('0x20')](channels[_0x4e98d3[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][varset]',_0x4e98d3[_0x9681('0x8')]),_0x4e98d3);if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x42')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x43'),_0x4e98d3['uniqueid'],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']][_0x9681('0x45')]=_0x4e98d3[_0x9681('0x44')];}if(!_['isNil'](_0x4e98d3['variable'][_0x9681('0x46')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x47'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]]['destination']=_0x4e98d3[_0x9681('0x44')];channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x2b')]='\x22'+_0x4e98d3[_0x9681('0x44')]+_0x9681('0x48')+_0x4e98d3[_0x9681('0x44')]+'>';}if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x49')])||!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-callerid'])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x4b'),_0x4e98d3[_0x9681('0x8')],!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x49')])?_0x9681('0x49'):_0x9681('0x4c'),_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']][_0x9681('0x2b')]=_0x4e98d3['value'];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')][_0x9681('0x4d')])||!_['isNil'](_0x4e98d3[_0x9681('0x4a')][_0x9681('0x4e')])){utils['info'](util[_0x9681('0xb')](_0x9681('0x4b'),_0x4e98d3[_0x9681('0x8')],!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-queue'])?'xmd-queue':_0x9681('0x4e'),_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x4f')]=_0x9681('0x50');channels[_0x4e98d3['uniqueid']][_0x9681('0x51')]=_0x4e98d3[_0x9681('0x44')];channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0xd')]=!![];}if(!_['isNil'](_0x4e98d3['variable'][_0x9681('0x52')])){utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4e98d3[_0x9681('0x8')],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']]['ContactId']=_0x4e98d3[_0x9681('0x44')];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-cdrtype'])){utils['info'](util[_0x9681('0xb')](_0x9681('0x53'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3['value']));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x54')]=_0x4e98d3['value'];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['outboundrouteid'])){utils['info'](util[_0x9681('0xb')](_0x9681('0x55'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3['value']));channels[_0x4e98d3['uniqueid']]['routeid']=_0x4e98d3[_0x9681('0x44')];}if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x56')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x57'),_0x4e98d3['uniqueid'],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x56')]=_0x4e98d3[_0x9681('0x44')];}}}catch(_0x5cdac3){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][varset]',_0x4e98d3[_0x9681('0x8')]),_0x5cdac3);}};exports[_0x9681('0x58')]=function(_0x2b817a){try{if(!_[_0x9681('0x20')](channels[_0x2b817a[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x59'),_0x2b817a[_0x9681('0x8')]),_0x2b817a);utils[_0x9681('0xa')](util['format'](_0x9681('0x5a'),_0x2b817a[_0x9681('0x8')],_0x2b817a[_0x9681('0x5b')],_0x2b817a['appdata']));if(_0x2b817a[_0x9681('0x5b')][_0x9681('0x5c')]()==_0x9681('0x5d')&&_['startsWith'](_0x2b817a[_0x9681('0x5e')][_0x9681('0x5c')](),_0x9681('0x5f'))){var _0x17393f=_0x2b817a[_0x9681('0x5e')]['split']('=');var _0x87f4d=_0x17393f[0x0]['substring'](_0x17393f[0x0][_0x9681('0x60')]('(')+0x1,_0x17393f[0x0][_0x9681('0x60')](')'));var _0x179463=_0x17393f[0x1];channels[_0x2b817a[_0x9681('0x8')]][_0x87f4d]=_0x179463;}if(!_['includes']([_0x9681('0x61'),_0x9681('0x62'),'execif','set',_0x9681('0x63')],_0x2b817a['application'][_0x9681('0x5c')]())){channels[_0x2b817a[_0x9681('0x8')]][_0x9681('0x4f')]=_0x2b817a[_0x9681('0x5b')];channels[_0x2b817a[_0x9681('0x8')]][_0x9681('0x51')]=_0x2b817a[_0x9681('0x5e')];}}}catch(_0x4c1102){utils[_0x9681('0x1f')](util[_0x9681('0xb')](_0x9681('0x59'),_0x2b817a[_0x9681('0x8')]),_0x4c1102);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 7e93601..10862dd 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 _0xf088=['[core]\x20close','managerevent','./utils','connect','fullybooted','info','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x45cc01,_0x2e635a){var _0x349d47=function(_0x78edc){while(--_0x78edc){_0x45cc01['push'](_0x45cc01['shift']());}};_0x349d47(++_0x2e635a);}(_0xf088,0x106));var _0x8f08=function(_0xda074a,_0x3179a){_0xda074a=_0xda074a-0x0;var _0x1eab3b=_0xf088[_0xda074a];return _0x1eab3b;};'use strict';var utils=require(_0x8f08('0x0'));exports[_0x8f08('0x1')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0x8f08('0x2')]=function(){utils[_0x8f08('0x3')](_0x8f08('0x4'));};exports[_0x8f08('0x5')]=function(_0x1899e1){utils[_0x8f08('0x5')](_0x8f08('0x6'),_0x1899e1);};exports[_0x8f08('0x7')]=function(){utils[_0x8f08('0x3')](_0x8f08('0x8'));};exports[_0x8f08('0x9')]=function(_0x29dac1){}; \ No newline at end of file +var _0xff25=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','connect','info','fullybooted'];(function(_0x98417d,_0x2d249c){var _0x51ee3c=function(_0x270644){while(--_0x270644){_0x98417d['push'](_0x98417d['shift']());}};_0x51ee3c(++_0x2d249c);}(_0xff25,0x195));var _0x5ff2=function(_0x455ad6,_0x2301e9){_0x455ad6=_0x455ad6-0x0;var _0x2f706a=_0xff25[_0x455ad6];return _0x2f706a;};'use strict';var utils=require('./utils');exports[_0x5ff2('0x0')]=function(){utils[_0x5ff2('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0x5ff2('0x2')]=function(){utils[_0x5ff2('0x1')](_0x5ff2('0x3'));};exports[_0x5ff2('0x4')]=function(_0x55cc83){utils[_0x5ff2('0x4')](_0x5ff2('0x5'),_0x55cc83);};exports[_0x5ff2('0x6')]=function(){utils[_0x5ff2('0x1')](_0x5ff2('0x7'));};exports['managerevent']=function(_0x4a24c3){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6acbac6..86d3d46 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 _0x6b22=['called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','endtime','holdtime','billableseconds','diffTime','[%s][dials][hangup]','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','error','[%s][dials][varset]','isNil','outboundrouteid','info','value','dialbegin','now','lastevent'];(function(_0x69c561,_0x324c52){var _0x5d33d1=function(_0xbcbe97){while(--_0xbcbe97){_0x69c561['push'](_0x69c561['shift']());}};_0x5d33d1(++_0x324c52);}(_0x6b22,0x74));var _0x26b2=function(_0x48924a,_0xbc5e99){_0x48924a=_0x48924a-0x0;var _0x4337ee=_0x6b22[_0x48924a];return _0x4337ee;};'use strict';var _=require('lodash');var util=require(_0x26b2('0x0'));var utils=require(_0x26b2('0x1'));var dials={};function writeDB(_0x55ff47){utils['info'](util[_0x26b2('0x2')](_0x26b2('0x3'),_0x55ff47[_0x26b2('0x4')],_0x55ff47['channel'],_0x55ff47[_0x26b2('0x5')],_0x55ff47['calleridnum'],_0x55ff47['connectedlinenum'],_0x55ff47[_0x26b2('0x6')]));utils['request'](_0x26b2('0x7'),_0x55ff47);delete dials[_0x55ff47[_0x26b2('0x4')]];}exports['newexten']=function(_0x4cba2d){try{utils[_0x26b2('0x8')](util['format'](_0x26b2('0x9'),_0x4cba2d[_0x26b2('0x4')]),_0x4cba2d);utils['info'](util['format'](_0x26b2('0xa'),_0x4cba2d['uniqueid'],_0x4cba2d[_0x26b2('0xb')],_0x4cba2d[_0x26b2('0xc')]));if(_0x4cba2d[_0x26b2('0xb')]['toLowerCase']()==_0x26b2('0xd')&&_['startsWith'](_0x4cba2d[_0x26b2('0xc')][_0x26b2('0xe')](),'cdr(routeid)')){var _0x43dd03=_0x4cba2d[_0x26b2('0xc')][_0x26b2('0xf')]('=');dials[_0x4cba2d['uniqueid']]={'routeId':_0x43dd03[0x1]};}}catch(_0x1eefea){utils[_0x26b2('0x10')](util['format'](_0x26b2('0x9'),_0x4cba2d[_0x26b2('0x4')]),_0x1eefea);}};exports['varset']=function(_0x2c004b){try{utils['debug'](util['format'](_0x26b2('0x11'),_0x2c004b[_0x26b2('0x4')]),_0x2c004b);if(!_[_0x26b2('0x12')](_0x2c004b['variable'][_0x26b2('0x13')])){utils[_0x26b2('0x14')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2c004b[_0x26b2('0x4')],_0x2c004b['value']));dials[_0x2c004b[_0x26b2('0x4')]]={'routeId':_0x2c004b[_0x26b2('0x15')]};}}catch(_0x50756a){utils[_0x26b2('0x10')](util[_0x26b2('0x2')](_0x26b2('0x11'),_0x2c004b[_0x26b2('0x4')]),_0x50756a);}};exports[_0x26b2('0x16')]=function(_0x323886){try{if(!_[_0x26b2('0x12')](dials[_0x323886['uniqueid']])){utils[_0x26b2('0x8')](util['format']('[%s][dials][dialbegin]',_0x323886[_0x26b2('0x4')]),_0x323886);dials[_0x323886[_0x26b2('0x4')]]=_['assign'](dials[_0x323886['uniqueid']],_0x323886);dials[_0x323886['uniqueid']]['starttime']=utils[_0x26b2('0x17')]();dials[_0x323886[_0x26b2('0x4')]][_0x26b2('0x18')]=_0x26b2('0x19');utils[_0x26b2('0x14')](util[_0x26b2('0x2')](_0x26b2('0x1a'),_0x323886[_0x26b2('0x4')],dials[_0x323886['uniqueid']][_0x26b2('0x1b')]));}}catch(_0x542b70){utils[_0x26b2('0x10')](util['format'](_0x26b2('0x1c'),_0x323886['uniqueid']),_0x542b70);}};exports[_0x26b2('0x1d')]=function(_0x2f754d){try{if(!_['isNil'](dials[_0x2f754d[_0x26b2('0x4')]])){utils['debug'](util['format'](_0x26b2('0x1e'),_0x2f754d[_0x26b2('0x4')]),_0x2f754d);dials[_0x2f754d[_0x26b2('0x4')]]['dialstatus']=_0x2f754d['dialstatus'];if(_0x2f754d[_0x26b2('0x6')]==_0x26b2('0x1f')){dials[_0x2f754d[_0x26b2('0x4')]]=_[_0x26b2('0x20')](dials[_0x2f754d[_0x26b2('0x4')]],_0x2f754d);dials[_0x2f754d[_0x26b2('0x4')]]['answertime']=utils[_0x26b2('0x17')]();dials[_0x2f754d[_0x26b2('0x4')]][_0x26b2('0x18')]=_0x26b2('0x21');utils[_0x26b2('0x14')](util[_0x26b2('0x2')](_0x26b2('0x22'),_0x2f754d[_0x26b2('0x4')],_0x2f754d['dialstatus'],dials[_0x2f754d[_0x26b2('0x4')]][_0x26b2('0x23')]));}else{utils[_0x26b2('0x14')](util[_0x26b2('0x2')](_0x26b2('0x24'),_0x2f754d[_0x26b2('0x4')],_0x2f754d['dialstatus']));}}}catch(_0x369c34){utils[_0x26b2('0x10')](util[_0x26b2('0x2')]('[%s][dials][dialend]',_0x2f754d[_0x26b2('0x4')]),_0x369c34);}};exports[_0x26b2('0x25')]=function(_0x30600a){try{if(!_[_0x26b2('0x12')](dials[_0x30600a[_0x26b2('0x4')]])){utils[_0x26b2('0x8')](util[_0x26b2('0x2')]('[%s][dials][hangup]',_0x30600a[_0x26b2('0x4')]),_0x30600a);utils[_0x26b2('0x14')](util[_0x26b2('0x2')](_0x26b2('0x26'),_0x30600a['uniqueid'],_0x30600a['calleridnum'],_0x30600a['calleridname'],_0x30600a[_0x26b2('0x27')]));dials[_0x30600a[_0x26b2('0x4')]]=_[_0x26b2('0x20')](dials[_0x30600a[_0x26b2('0x4')]],{'endtime':utils[_0x26b2('0x17')](),'lastevent':_0x26b2('0x28')});dials[_0x30600a[_0x26b2('0x4')]][_0x26b2('0x29')]=utils['diffTime'](dials[_0x30600a['uniqueid']][_0x26b2('0x2a')],dials[_0x30600a[_0x26b2('0x4')]][_0x26b2('0x1b')]);dials[_0x30600a[_0x26b2('0x4')]][_0x26b2('0x2b')]=utils['diffTime'](dials[_0x30600a['uniqueid']][_0x26b2('0x23')]||dials[_0x30600a['uniqueid']][_0x26b2('0x2a')],dials[_0x30600a[_0x26b2('0x4')]]['starttime']);dials[_0x30600a['uniqueid']][_0x26b2('0x2c')]=dials[_0x30600a[_0x26b2('0x4')]][_0x26b2('0x23')]?utils[_0x26b2('0x2d')](dials[_0x30600a[_0x26b2('0x4')]]['endtime'],dials[_0x30600a[_0x26b2('0x4')]][_0x26b2('0x23')]):0x0;writeDB(dials[_0x30600a[_0x26b2('0x4')]]);}}catch(_0x5ad9ae){utils[_0x26b2('0x10')](util['format'](_0x26b2('0x2e'),_0x30600a['uniqueid']),_0x5ad9ae);}}; \ No newline at end of file +var _0x0db8=['[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','now','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr(routeid)','varset','debug'];(function(_0x1e867d,_0x16cffc){var _0x1f758d=function(_0x4a24d1){while(--_0x4a24d1){_0x1e867d['push'](_0x1e867d['shift']());}};_0x1f758d(++_0x16cffc);}(_0x0db8,0xed));var _0x80db=function(_0x4e21fb,_0x2eb08b){_0x4e21fb=_0x4e21fb-0x0;var _0x1edbb1=_0x0db8[_0x4e21fb];return _0x1edbb1;};'use strict';var _=require(_0x80db('0x0'));var util=require(_0x80db('0x1'));var utils=require('./utils');var dials={};function writeDB(_0xd782ba){utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x4'),_0xd782ba[_0x80db('0x5')],_0xd782ba[_0x80db('0x6')],_0xd782ba[_0x80db('0x7')],_0xd782ba[_0x80db('0x8')],_0xd782ba[_0x80db('0x9')],_0xd782ba[_0x80db('0xa')]));utils[_0x80db('0xb')](_0x80db('0xc'),_0xd782ba);delete dials[_0xd782ba['uniqueid']];}exports[_0x80db('0xd')]=function(_0x3e8fd8){try{utils['debug'](util[_0x80db('0x3')](_0x80db('0xe'),_0x3e8fd8['uniqueid']),_0x3e8fd8);utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0xf'),_0x3e8fd8[_0x80db('0x5')],_0x3e8fd8[_0x80db('0x10')],_0x3e8fd8[_0x80db('0x11')]));if(_0x3e8fd8[_0x80db('0x10')]['toLowerCase']()=='set'&&_[_0x80db('0x12')](_0x3e8fd8['appdata'][_0x80db('0x13')](),_0x80db('0x14'))){var _0x40c657=_0x3e8fd8['appdata']['split']('=');dials[_0x3e8fd8[_0x80db('0x5')]]={'routeId':_0x40c657[0x1]};}}catch(_0x4e23b8){utils['error'](util[_0x80db('0x3')]('[%s][dials][newexten]',_0x3e8fd8[_0x80db('0x5')]),_0x4e23b8);}};exports[_0x80db('0x15')]=function(_0x295dfd){try{utils[_0x80db('0x16')](util['format'](_0x80db('0x17'),_0x295dfd[_0x80db('0x5')]),_0x295dfd);if(!_[_0x80db('0x18')](_0x295dfd['variable'][_0x80db('0x19')])){utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x1a'),_0x295dfd[_0x80db('0x5')],_0x295dfd[_0x80db('0x1b')]));dials[_0x295dfd[_0x80db('0x5')]]={'routeId':_0x295dfd[_0x80db('0x1b')]};}}catch(_0x312e20){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x17'),_0x295dfd[_0x80db('0x5')]),_0x312e20);}};exports[_0x80db('0x1d')]=function(_0x368131){try{if(!_['isNil'](dials[_0x368131[_0x80db('0x5')]])){utils['debug'](util[_0x80db('0x3')](_0x80db('0x1e'),_0x368131[_0x80db('0x5')]),_0x368131);dials[_0x368131[_0x80db('0x5')]]=_['assign'](dials[_0x368131['uniqueid']],_0x368131);dials[_0x368131[_0x80db('0x5')]][_0x80db('0x1f')]=utils['now']();dials[_0x368131[_0x80db('0x5')]][_0x80db('0x20')]=_0x80db('0x21');utils['info'](util[_0x80db('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x368131[_0x80db('0x5')],dials[_0x368131['uniqueid']][_0x80db('0x1f')]));}}catch(_0x59aded){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x1e'),_0x368131[_0x80db('0x5')]),_0x59aded);}};exports[_0x80db('0x22')]=function(_0x41b97f){try{if(!_[_0x80db('0x18')](dials[_0x41b97f['uniqueid']])){utils[_0x80db('0x16')](util[_0x80db('0x3')](_0x80db('0x23'),_0x41b97f[_0x80db('0x5')]),_0x41b97f);dials[_0x41b97f['uniqueid']][_0x80db('0xa')]=_0x41b97f['dialstatus'];if(_0x41b97f['dialstatus']==_0x80db('0x24')){dials[_0x41b97f[_0x80db('0x5')]]=_[_0x80db('0x25')](dials[_0x41b97f[_0x80db('0x5')]],_0x41b97f);dials[_0x41b97f[_0x80db('0x5')]][_0x80db('0x26')]=utils['now']();dials[_0x41b97f['uniqueid']]['lastevent']=_0x80db('0x27');utils[_0x80db('0x2')](util['format'](_0x80db('0x28'),_0x41b97f[_0x80db('0x5')],_0x41b97f['dialstatus'],dials[_0x41b97f[_0x80db('0x5')]][_0x80db('0x26')]));}else{utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x29'),_0x41b97f['uniqueid'],_0x41b97f[_0x80db('0xa')]));}}}catch(_0x3ead00){utils['error'](util[_0x80db('0x3')]('[%s][dials][dialend]',_0x41b97f[_0x80db('0x5')]),_0x3ead00);}};exports[_0x80db('0x2a')]=function(_0xe1a2b4){try{if(!_[_0x80db('0x18')](dials[_0xe1a2b4[_0x80db('0x5')]])){utils['debug'](util[_0x80db('0x3')](_0x80db('0x2b'),_0xe1a2b4[_0x80db('0x5')]),_0xe1a2b4);utils[_0x80db('0x2')](util[_0x80db('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xe1a2b4[_0x80db('0x5')],_0xe1a2b4[_0x80db('0x8')],_0xe1a2b4['calleridname'],_0xe1a2b4[_0x80db('0x2c')]));dials[_0xe1a2b4['uniqueid']]=_[_0x80db('0x25')](dials[_0xe1a2b4[_0x80db('0x5')]],{'endtime':utils[_0x80db('0x2d')](),'lastevent':_0x80db('0x2e')});dials[_0xe1a2b4['uniqueid']][_0x80db('0x2f')]=utils[_0x80db('0x30')](dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x31')],dials[_0xe1a2b4['uniqueid']][_0x80db('0x1f')]);dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x32')]=utils[_0x80db('0x30')](dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x26')]||dials[_0xe1a2b4['uniqueid']][_0x80db('0x31')],dials[_0xe1a2b4['uniqueid']][_0x80db('0x1f')]);dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x33')]=dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x26')]?utils[_0x80db('0x30')](dials[_0xe1a2b4['uniqueid']][_0x80db('0x31')],dials[_0xe1a2b4[_0x80db('0x5')]]['answertime']):0x0;writeDB(dials[_0xe1a2b4[_0x80db('0x5')]]);}}catch(_0x5b346c){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x2b'),_0xe1a2b4[_0x80db('0x5')]),_0x5b346c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 4cc649b..b3d2e3a 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 _0x255d=['newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x255d,0x10b));var _0xd255=function(_0x2cbc89,_0x1b199e){_0x2cbc89=_0x2cbc89-0x0;var _0x58850a=_0x255d[_0x2cbc89];return _0x58850a;};var AsteriskManager=require(_0xd255('0x0'));var config=require(_0xd255('0x1'));var utils=require(_0xd255('0x2'));var util=require(_0xd255('0x3'));var ami=new AsteriskManager(config[_0xd255('0x4')][_0xd255('0x5')],config[_0xd255('0x4')]['ip'],config[_0xd255('0x4')][_0xd255('0x6')],config['asterisk'][_0xd255('0x7')],!![]);ami[_0xd255('0x8')]();if(config[_0xd255('0x9')]&&config[_0xd255('0x9')]['disabled']){utils[_0xd255('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0xd255('0xb'));var calls=require(_0xd255('0xc'));var queues=require(_0xd255('0xd'));var recordings=require(_0xd255('0xe'));var members=require('./members.controller');var dials=require(_0xd255('0xf'));var transfers=require('./transfers.controller');var core=require(_0xd255('0x10'));ami['on'](_0xd255('0x11'),core[_0xd255('0x11')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xd255('0x12'),core['fullybooted']);ami['on'](_0xd255('0x13'),core['error']);ami['on'](_0xd255('0x14'),core['close']);ami['on'](_0xd255('0x15'),core[_0xd255('0x15')]);ami['on'](_0xd255('0x16'),function(_0x439881){try{utils[_0xd255('0x17')](util[_0xd255('0x18')]('[%s][index][devicestatechange]',_0x439881['device']),_0x439881);members['devicestatechange'](_0x439881);}catch(_0x4955e8){utils['error'](util[_0xd255('0x18')](_0xd255('0x19'),_0x439881[_0xd255('0x1a')]),_0x4955e8);}});ami['on'](_0xd255('0x1b'),function(_0x2b9afc){try{utils[_0xd255('0x17')](util['format']('[%s][index][agentcalled]',_0x2b9afc['uniqueid']),_0x2b9afc);agents[_0xd255('0x1b')](_0x2b9afc);}catch(_0xd7df1d){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x1c'),_0x2b9afc['uniqueid']),_0xd7df1d);}});ami['on'](_0xd255('0x1d'),function(_0x67fb88){try{utils[_0xd255('0x17')](util[_0xd255('0x18')]('[%s][index][agentringnoanswer]',_0x67fb88[_0xd255('0x1e')]),_0x67fb88);agents[_0xd255('0x1d')](_0x67fb88);}catch(_0x388d3a){utils['error'](util[_0xd255('0x18')](_0xd255('0x1f'),_0x67fb88[_0xd255('0x1e')]),_0x388d3a);}});ami['on'](_0xd255('0x20'),function(_0x125dc7){try{utils[_0xd255('0x17')](util['format'](_0xd255('0x21'),_0x125dc7[_0xd255('0x1e')]),_0x125dc7);agents[_0xd255('0x20')](_0x125dc7);queues[_0xd255('0x20')](_0x125dc7);}catch(_0x15dc7b){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x21'),_0x125dc7[_0xd255('0x1e')]),_0x15dc7b);}});ami['on'](_0xd255('0x22'),function(_0x1826e2){try{utils[_0xd255('0x17')](util['format'](_0xd255('0x23'),_0x1826e2[_0xd255('0x1e')]),_0x1826e2);agents[_0xd255('0x22')](_0x1826e2);queues[_0xd255('0x22')](_0x1826e2);members['agentcomplete'](_0x1826e2);}catch(_0x2001e3){utils['error'](util['format'](_0xd255('0x23'),_0x1826e2[_0xd255('0x1e')]),_0x2001e3);}});ami['on'](_0xd255('0x24'),function(_0x4498ad){try{utils[_0xd255('0x17')](util['format'](_0xd255('0x25'),_0x4498ad['uniqueid']),_0x4498ad);agents['queuecallerabandon'](_0x4498ad);queues['queuecallerabandon'](_0x4498ad);}catch(_0x538bdb){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x25'),_0x4498ad['uniqueid']),_0x538bdb);}});ami['on'](_0xd255('0x26'),function(_0x31450c){try{utils[_0xd255('0x17')](util[_0xd255('0x18')](_0xd255('0x27'),_0x31450c[_0xd255('0x1e')]),_0x31450c);queues[_0xd255('0x26')](_0x31450c);recordings['queuecallerjoin'](_0x31450c);}catch(_0x3f7e52){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x27'),_0x31450c[_0xd255('0x1e')]),_0x3f7e52);}});ami['on'](_0xd255('0x28'),function(_0x4409ab){try{utils[_0xd255('0x17')](util[_0xd255('0x18')](_0xd255('0x29'),_0x4409ab[_0xd255('0x1e')]),_0x4409ab);queues[_0xd255('0x28')](_0x4409ab);}catch(_0x1aa1bd){utils[_0xd255('0x13')](util['format'](_0xd255('0x29'),_0x4409ab[_0xd255('0x1e')]),_0x1aa1bd);}});ami['on']('musiconholdstart',function(_0x39eac8){try{utils[_0xd255('0x17')](util['format'](_0xd255('0x2a'),_0x39eac8[_0xd255('0x1e')]),_0x39eac8);queues['musiconholdstart'](_0x39eac8);calls[_0xd255('0x2b')](_0x39eac8);}catch(_0x1b8833){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x2a'),_0x39eac8[_0xd255('0x1e')]),_0x1b8833);}});ami['on'](_0xd255('0x2c'),function(_0x260c3b){try{utils[_0xd255('0x17')](util[_0xd255('0x18')](_0xd255('0x2d'),_0x260c3b[_0xd255('0x1e')]),_0x260c3b);queues[_0xd255('0x2c')](_0x260c3b);calls[_0xd255('0x2c')](_0x260c3b);}catch(_0x59a6d1){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x2d'),_0x260c3b[_0xd255('0x1e')]),_0x59a6d1);}});ami['on'](_0xd255('0x2e'),function(_0x5ab779){try{utils[_0xd255('0x17')](util[_0xd255('0x18')]('[%s][index][newstate]',_0x5ab779[_0xd255('0x1e')]),_0x5ab779);calls[_0xd255('0x2e')](_0x5ab779);recordings[_0xd255('0x2e')](_0x5ab779);}catch(_0x82919f){utils[_0xd255('0x13')](util['format']('[%s][index][newstate]',_0x5ab779[_0xd255('0x1e')]),_0x82919f);}});ami['on'](_0xd255('0x2f'),function(_0x4a12ff){try{utils[_0xd255('0x17')](util[_0xd255('0x18')]('[%s][index][hangup]',_0x4a12ff[_0xd255('0x1e')]),_0x4a12ff);calls['hangup'](_0x4a12ff);recordings['hangup'](_0x4a12ff);dials[_0xd255('0x2f')](_0x4a12ff);agents[_0xd255('0x2f')](_0x4a12ff);queues['hangup'](_0x4a12ff);}catch(_0xe0c49){utils[_0xd255('0x13')](util[_0xd255('0x18')]('[%s][index][hangup]',_0x4a12ff[_0xd255('0x1e')]),_0xe0c49);}});ami['on'](_0xd255('0x30'),function(_0x1b94db){try{utils['debug'](util[_0xd255('0x18')](_0xd255('0x31'),_0x1b94db[_0xd255('0x1e')]),_0x1b94db);members[_0xd255('0x30')](_0x1b94db);}catch(_0x559588){utils[_0xd255('0x13')](util['format'](_0xd255('0x31'),_0x1b94db[_0xd255('0x1e')]),_0x559588);}});ami['on'](_0xd255('0x32'),function(_0xa9fcc0){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0xa9fcc0[_0xd255('0x1e')]),_0xa9fcc0);queues[_0xd255('0x32')](_0xa9fcc0);agents[_0xd255('0x32')](_0xa9fcc0);transfers[_0xd255('0x32')](_0xa9fcc0);}catch(_0x2cfd66){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x33'),_0xa9fcc0[_0xd255('0x1e')]),_0x2cfd66);}});ami['on'](_0xd255('0x34'),function(_0x560748){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0x560748[_0xd255('0x35')]),_0x560748);queues[_0xd255('0x34')](_0x560748);transfers['attendedtransfer'](_0x560748);agents['attendedtransfer'](_0x560748);calls[_0xd255('0x34')](_0x560748);}catch(_0xcaf735){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x36'),_0x560748[_0xd255('0x35')]),_0xcaf735);}});ami['on'](_0xd255('0x37'),function(_0x3df342){try{utils[_0xd255('0x17')](util['format'](_0xd255('0x38'),_0x3df342[_0xd255('0x1e')]),_0x3df342);queues[_0xd255('0x37')](_0x3df342);recordings[_0xd255('0x37')](_0x3df342);calls['varset'](_0x3df342);dials[_0xd255('0x37')](_0x3df342);}catch(_0x25adff){utils[_0xd255('0x13')](util[_0xd255('0x18')]('[%s][index][varset]',_0x3df342[_0xd255('0x1e')]),_0x25adff);}});ami['on']('newexten',function(_0x54fdab){try{utils[_0xd255('0x17')](util[_0xd255('0x18')](_0xd255('0x39'),_0x54fdab[_0xd255('0x1e')]),_0x54fdab);calls[_0xd255('0x3a')](_0x54fdab);recordings[_0xd255('0x3a')](_0x54fdab);dials[_0xd255('0x3a')](_0x54fdab);}catch(_0x14a0a7){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x39'),_0x54fdab['uniqueid']),_0x14a0a7);}});ami['on'](_0xd255('0x3b'),function(_0x451de5){try{utils[_0xd255('0x17')](util['format']('[%s][index][newchannel]',_0x451de5[_0xd255('0x1e')]),_0x451de5);calls[_0xd255('0x3b')](_0x451de5);recordings[_0xd255('0x3b')](_0x451de5);}catch(_0x310b3e){utils[_0xd255('0x13')](util[_0xd255('0x18')](_0xd255('0x3c'),_0x451de5['uniqueid']),_0x310b3e);}});ami['on'](_0xd255('0x3d'),function(_0x48631e){try{utils['debug'](util[_0xd255('0x18')]('[%s][index][dialbegin]',_0x48631e[_0xd255('0x1e')]),_0x48631e);dials[_0xd255('0x3d')](_0x48631e);}catch(_0x5c2190){utils[_0xd255('0x13')](util['format'](_0xd255('0x3e'),_0x48631e[_0xd255('0x1e')]),_0x5c2190);}});ami['on'](_0xd255('0x3f'),function(_0xffc999){try{utils[_0xd255('0x17')](util[_0xd255('0x18')](_0xd255('0x40'),_0xffc999[_0xd255('0x1e')]),_0xffc999);dials[_0xd255('0x3f')](_0xffc999);}catch(_0x23d94d){utils['error'](util['format'](_0xd255('0x40'),_0xffc999[_0xd255('0x1e')]),_0x23d94d);}});} \ No newline at end of file +var _0x4bb4=['./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','[%s][index][devicestatechange]','format','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED'];(function(_0x37acf7,_0x1fe112){var _0x1408b3=function(_0x368e86){while(--_0x368e86){_0x37acf7['push'](_0x37acf7['shift']());}};_0x1408b3(++_0x1fe112);}(_0x4bb4,0x10a));var _0x44bb=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x4bb4[_0x53758c];return _0x425eff;};var AsteriskManager=require(_0x44bb('0x0'));var config=require('../../config/environment');var utils=require(_0x44bb('0x1'));var util=require(_0x44bb('0x2'));var ami=new AsteriskManager(config[_0x44bb('0x3')]['port'],config['asterisk']['ip'],config['asterisk'][_0x44bb('0x4')],config[_0x44bb('0x3')][_0x44bb('0x5')],!![]);ami[_0x44bb('0x6')]();if(config[_0x44bb('0x7')]&&config[_0x44bb('0x7')][_0x44bb('0x8')]){utils['info'](_0x44bb('0x9'));}else{var agents=require(_0x44bb('0xa'));var calls=require(_0x44bb('0xb'));var queues=require(_0x44bb('0xc'));var recordings=require(_0x44bb('0xd'));var members=require('./members.controller');var dials=require(_0x44bb('0xe'));var transfers=require(_0x44bb('0xf'));var core=require(_0x44bb('0x10'));ami['on'](_0x44bb('0x11'),core[_0x44bb('0x11')]);ami['on'](_0x44bb('0x12'),core[_0x44bb('0x12')]);ami['on'](_0x44bb('0x13'),core[_0x44bb('0x13')]);ami['on'](_0x44bb('0x14'),core['error']);ami['on'](_0x44bb('0x15'),core['close']);ami['on'](_0x44bb('0x16'),core[_0x44bb('0x16')]);ami['on'](_0x44bb('0x17'),function(_0x493696){try{utils[_0x44bb('0x18')](util['format']('[%s][index][devicestatechange]',_0x493696[_0x44bb('0x19')]),_0x493696);members[_0x44bb('0x17')](_0x493696);}catch(_0x1895c0){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x1a'),_0x493696[_0x44bb('0x19')]),_0x1895c0);}});ami['on']('agentcalled',function(_0x2f733b){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x1c'),_0x2f733b['uniqueid']),_0x2f733b);agents[_0x44bb('0x1d')](_0x2f733b);}catch(_0x12d4df){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x1c'),_0x2f733b[_0x44bb('0x1e')]),_0x12d4df);}});ami['on'](_0x44bb('0x1f'),function(_0x429896){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')]('[%s][index][agentringnoanswer]',_0x429896[_0x44bb('0x1e')]),_0x429896);agents[_0x44bb('0x1f')](_0x429896);}catch(_0x4ccc79){utils['error'](util['format'](_0x44bb('0x20'),_0x429896['uniqueid']),_0x4ccc79);}});ami['on'](_0x44bb('0x21'),function(_0xaea7e2){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x22'),_0xaea7e2[_0x44bb('0x1e')]),_0xaea7e2);agents[_0x44bb('0x21')](_0xaea7e2);queues[_0x44bb('0x21')](_0xaea7e2);}catch(_0x4387a6){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x22'),_0xaea7e2['uniqueid']),_0x4387a6);}});ami['on']('agentcomplete',function(_0x49febc){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x23'),_0x49febc[_0x44bb('0x1e')]),_0x49febc);agents['agentcomplete'](_0x49febc);queues['agentcomplete'](_0x49febc);members[_0x44bb('0x24')](_0x49febc);}catch(_0xca535b){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')]('[%s][index][agentcomplete]',_0x49febc[_0x44bb('0x1e')]),_0xca535b);}});ami['on']('queuecallerabandon',function(_0x346abc){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x25'),_0x346abc[_0x44bb('0x1e')]),_0x346abc);agents[_0x44bb('0x26')](_0x346abc);queues[_0x44bb('0x26')](_0x346abc);}catch(_0x335d14){utils['error'](util[_0x44bb('0x1b')](_0x44bb('0x25'),_0x346abc[_0x44bb('0x1e')]),_0x335d14);}});ami['on'](_0x44bb('0x27'),function(_0x216563){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x28'),_0x216563['uniqueid']),_0x216563);queues[_0x44bb('0x27')](_0x216563);recordings['queuecallerjoin'](_0x216563);}catch(_0x4eec4a){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x28'),_0x216563[_0x44bb('0x1e')]),_0x4eec4a);}});ami['on']('queuecallerleave',function(_0x8700f4){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x29'),_0x8700f4[_0x44bb('0x1e')]),_0x8700f4);queues[_0x44bb('0x2a')](_0x8700f4);}catch(_0x31035e){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x29'),_0x8700f4[_0x44bb('0x1e')]),_0x31035e);}});ami['on'](_0x44bb('0x2b'),function(_0x5000d8){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x2c'),_0x5000d8['uniqueid']),_0x5000d8);queues['musiconholdstart'](_0x5000d8);calls['musiconholdstart'](_0x5000d8);}catch(_0x6bc9d2){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x2c'),_0x5000d8[_0x44bb('0x1e')]),_0x6bc9d2);}});ami['on']('musiconholdstop',function(_0x443cab){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x2d'),_0x443cab[_0x44bb('0x1e')]),_0x443cab);queues[_0x44bb('0x2e')](_0x443cab);calls[_0x44bb('0x2e')](_0x443cab);}catch(_0x3ada50){utils['error'](util[_0x44bb('0x1b')](_0x44bb('0x2d'),_0x443cab['uniqueid']),_0x3ada50);}});ami['on']('newstate',function(_0x245c08){try{utils[_0x44bb('0x18')](util['format']('[%s][index][newstate]',_0x245c08[_0x44bb('0x1e')]),_0x245c08);calls[_0x44bb('0x2f')](_0x245c08);recordings[_0x44bb('0x2f')](_0x245c08);}catch(_0x11e080){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x30'),_0x245c08[_0x44bb('0x1e')]),_0x11e080);}});ami['on'](_0x44bb('0x31'),function(_0x53a034){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x32'),_0x53a034[_0x44bb('0x1e')]),_0x53a034);calls[_0x44bb('0x31')](_0x53a034);recordings[_0x44bb('0x31')](_0x53a034);dials[_0x44bb('0x31')](_0x53a034);agents[_0x44bb('0x31')](_0x53a034);queues[_0x44bb('0x31')](_0x53a034);}catch(_0xfde4d1){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x32'),_0x53a034[_0x44bb('0x1e')]),_0xfde4d1);}});ami['on'](_0x44bb('0x33'),function(_0x4370ad){try{utils['debug'](util['format'](_0x44bb('0x34'),_0x4370ad[_0x44bb('0x1e')]),_0x4370ad);members['cdr'](_0x4370ad);}catch(_0x1f6203){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x34'),_0x4370ad[_0x44bb('0x1e')]),_0x1f6203);}});ami['on']('blindtransfer',function(_0x289b8e){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x35'),_0x289b8e[_0x44bb('0x1e')]),_0x289b8e);queues[_0x44bb('0x36')](_0x289b8e);agents['blindtransfer'](_0x289b8e);transfers[_0x44bb('0x36')](_0x289b8e);}catch(_0x249700){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')]('[%s][index][blindtransfer]',_0x289b8e[_0x44bb('0x1e')]),_0x249700);}});ami['on']('attendedtransfer',function(_0x494a7e){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x37'),_0x494a7e[_0x44bb('0x38')]),_0x494a7e);queues[_0x44bb('0x39')](_0x494a7e);transfers[_0x44bb('0x39')](_0x494a7e);agents[_0x44bb('0x39')](_0x494a7e);calls[_0x44bb('0x39')](_0x494a7e);}catch(_0x5eb20d){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x37'),_0x494a7e[_0x44bb('0x38')]),_0x5eb20d);}});ami['on'](_0x44bb('0x3a'),function(_0x282723){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x3b'),_0x282723[_0x44bb('0x1e')]),_0x282723);queues[_0x44bb('0x3a')](_0x282723);recordings[_0x44bb('0x3a')](_0x282723);calls['varset'](_0x282723);dials[_0x44bb('0x3a')](_0x282723);}catch(_0x473603){utils['error'](util[_0x44bb('0x1b')]('[%s][index][varset]',_0x282723['uniqueid']),_0x473603);}});ami['on']('newexten',function(_0x7be3a1){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x3c'),_0x7be3a1[_0x44bb('0x1e')]),_0x7be3a1);calls[_0x44bb('0x3d')](_0x7be3a1);recordings[_0x44bb('0x3d')](_0x7be3a1);dials[_0x44bb('0x3d')](_0x7be3a1);}catch(_0xe6d15c){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x3c'),_0x7be3a1[_0x44bb('0x1e')]),_0xe6d15c);}});ami['on']('newchannel',function(_0xb2197a){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x3e'),_0xb2197a[_0x44bb('0x1e')]),_0xb2197a);calls[_0x44bb('0x3f')](_0xb2197a);recordings[_0x44bb('0x3f')](_0xb2197a);}catch(_0x518894){utils[_0x44bb('0x14')](util['format']('[%s][index][newchannel]',_0xb2197a[_0x44bb('0x1e')]),_0x518894);}});ami['on'](_0x44bb('0x40'),function(_0x1ae597){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x41'),_0x1ae597[_0x44bb('0x1e')]),_0x1ae597);dials[_0x44bb('0x40')](_0x1ae597);}catch(_0x384526){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x42'),_0x1ae597['uniqueid']),_0x384526);}});ami['on'](_0x44bb('0x43'),function(_0x3dfe81){try{utils[_0x44bb('0x18')](util['format'](_0x44bb('0x44'),_0x3dfe81[_0x44bb('0x1e')]),_0x3dfe81);dials[_0x44bb('0x43')](_0x3dfe81);}catch(_0x3266fb){utils['error'](util[_0x44bb('0x1b')]('[%s][index][dialend]',_0x3dfe81[_0x44bb('0x1e')]),_0x3266fb);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 513eb03..73a52a0 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 _0x34bb=['source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','error','lodash','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','channel','data2','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','format','[%s][members][writeDB]','some','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','duration','exitAt','enterAt','[%s][members][devicestatechange]','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','data1','data3','destinationchannel','type'];(function(_0x353c5b,_0xbd8ac4){var _0x1e2180=function(_0x27eab7){while(--_0x27eab7){_0x353c5b['push'](_0x353c5b['shift']());}};_0x1e2180(++_0xbd8ac4);}(_0x34bb,0x129));var _0xb34b=function(_0x523ecd,_0x77b6bd){_0x523ecd=_0x523ecd-0x0;var _0x193631=_0x34bb[_0x523ecd];return _0x193631;};'use strict';var _=require(_0xb34b('0x0'));var util=require(_0xb34b('0x1'));var utils=require(_0xb34b('0x2'));var members={};var exclude=[_0xb34b('0x3'),_0xb34b('0x4')];function writeDB(_0x2549ef){utils[_0xb34b('0x5')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2549ef[_0xb34b('0x6')],_0x2549ef[_0xb34b('0x7')],_0x2549ef[_0xb34b('0x8')],_0x2549ef[_0xb34b('0x9')],_0x2549ef['membername'],_0x2549ef['type']));if(_0x2549ef[_0xb34b('0x7')]){utils[_0xb34b('0xa')](_0x2549ef['interface'])[_0xb34b('0xb')](function(_0x194a89){if(_0x194a89){_0x2549ef[_0xb34b('0xc')]=_0x194a89[_0xb34b('0xd')];_0x2549ef[_0xb34b('0xe')]=_0x194a89[_0xb34b('0xe')];utils[_0xb34b('0xf')](_0xb34b('0x10'),_0x2549ef);}else{utils[_0xb34b('0x11')](_0x2549ef[_0xb34b('0x7')][_0xb34b('0x12')]('/')[0x1])[_0xb34b('0xb')](function(_0x548c4a){if(_0x548c4a){_0x2549ef[_0xb34b('0xc')]=_0x548c4a[_0xb34b('0xd')];_0x2549ef[_0xb34b('0xe')]=_0x548c4a[_0xb34b('0xe')];utils['request'](_0xb34b('0x10'),_0x2549ef);}});}})[_0xb34b('0x13')](function(_0x254a72){utils['error'](util[_0xb34b('0x14')](_0xb34b('0x15'),_0x2549ef[_0xb34b('0x6')]),_0x254a72);});}delete members[_0x2549ef['interface']];}function startsWith(_0x32a454,_0x2d121e){return _[_0xb34b('0x16')](_0x32a454,function(_0x22d360){return _[_0xb34b('0x17')](_0x2d121e,_0x22d360);});}exports['devicestatechange']=function(_0x4f43cf){try{utils['debug'](util[_0xb34b('0x14')]('[%s][members][devicestatechange]',members[_0x4f43cf[_0xb34b('0x18')]]?members[_0x4f43cf[_0xb34b('0x18')]]['uniqueid']:_0x4f43cf['device']),_0x4f43cf);utils[_0xb34b('0x5')](util[_0xb34b('0x14')](_0xb34b('0x19'),members[_0x4f43cf[_0xb34b('0x18')]]?members[_0x4f43cf[_0xb34b('0x18')]][_0xb34b('0x6')]:_0x4f43cf[_0xb34b('0x18')],_0x4f43cf[_0xb34b('0x1a')],_0x4f43cf[_0xb34b('0x18')]));switch(_0x4f43cf['state']){case _0xb34b('0x1b'):case _0xb34b('0x1c'):if(!startsWith(exclude,_0x4f43cf[_0xb34b('0x18')])){members[_0x4f43cf[_0xb34b('0x18')]]={'channel':_0xb34b('0x1d'),'interface':_0x4f43cf[_0xb34b('0x18')],'type':_0xb34b('0x1e'),'enterAt':utils[_0xb34b('0x1f')](),'role':'agent'};}break;case _0xb34b('0x20'):if(!_[_0xb34b('0x21')](members[_0x4f43cf[_0xb34b('0x18')]])){members[_0x4f43cf['device']]['exitAt']=utils['now']();members[_0x4f43cf[_0xb34b('0x18')]][_0xb34b('0x22')]=utils['diffTime'](members[_0x4f43cf[_0xb34b('0x18')]][_0xb34b('0x23')],members[_0x4f43cf['device']][_0xb34b('0x24')]);if(members[_0x4f43cf[_0xb34b('0x18')]][_0xb34b('0x6')]){writeDB(members[_0x4f43cf[_0xb34b('0x18')]]);}}break;default:break;}}catch(_0x46ddf7){utils['error'](util[_0xb34b('0x14')](_0xb34b('0x25'),members[_0x4f43cf['device']]?members[_0x4f43cf['device']][_0xb34b('0x6')]:_0x4f43cf['device']),_0x46ddf7);}};exports['agentcomplete']=function(_0x42956f){try{if(!_['isNil'](members[_0x42956f['interface']])){utils['debug'](util[_0xb34b('0x14')](_0xb34b('0x26'),_0x42956f[_0xb34b('0x6')]),_0x42956f);utils['info'](util[_0xb34b('0x14')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x42956f[_0xb34b('0x6')],_0x42956f[_0xb34b('0x7')],_0x42956f[_0xb34b('0x27')]));members[_0x42956f[_0xb34b('0x7')]]=_[_0xb34b('0x28')](members[_0x42956f[_0xb34b('0x7')]],{'data4':_0x42956f[_0xb34b('0x27')],'uniqueid':_0x42956f[_0xb34b('0x6')]});}}catch(_0x142d97){utils['error'](util[_0xb34b('0x14')]('[%s][members][agentcomplete]',_0x42956f[_0xb34b('0x6')]),_0x142d97);}};exports['cdr']=function(_0x5ce55d){try{utils['debug'](util[_0xb34b('0x14')](_0xb34b('0x29'),_0x5ce55d[_0xb34b('0x6')]),_0x5ce55d);if(_0x5ce55d['channel']){var _0x3bd750=_0x5ce55d[_0xb34b('0x8')][_0xb34b('0x12')]('-')[0x0];if(!_['isNil'](members[_0x3bd750])){members[_0x3bd750]=_['assign'](members[_0x3bd750],{'data1':members[_0x3bd750][_0xb34b('0x2a')]||_0x5ce55d['type'],'data2':members[_0x3bd750]['data2']||_0x5ce55d['source'],'data3':members[_0x3bd750][_0xb34b('0x2b')]||_0x5ce55d['destination'],'uniqueid':members[_0x3bd750][_0xb34b('0x6')]||_0x5ce55d[_0xb34b('0x6')]});utils[_0xb34b('0x5')](util[_0xb34b('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5ce55d['uniqueid'],members[_0x3bd750][_0xb34b('0x2a')],members[_0x3bd750]['data2'],members[_0x3bd750][_0xb34b('0x2b')]));if(members[_0x3bd750][_0xb34b('0x23')]){writeDB(members[_0x3bd750]);}}}if(_0x5ce55d[_0xb34b('0x2c')]){var _0x59b57=_0x5ce55d[_0xb34b('0x2c')]['split']('-')[0x0];if(!_['isNil'](members[_0x59b57])){members[_0x59b57]=_[_0xb34b('0x28')](members[_0x59b57],{'data1':members[_0x59b57]['data1']||_0x5ce55d[_0xb34b('0x2d')],'data2':members[_0x59b57][_0xb34b('0x9')]||_0x5ce55d[_0xb34b('0x2e')],'data3':members[_0x59b57][_0xb34b('0x2b')]||_0x5ce55d['destination'],'uniqueid':members[_0x59b57][_0xb34b('0x6')]||_0x5ce55d['uniqueid']});utils[_0xb34b('0x5')](util[_0xb34b('0x14')](_0xb34b('0x2f'),_0x5ce55d[_0xb34b('0x6')],members[_0x59b57]['data1'],members[_0x59b57][_0xb34b('0x9')],members[_0x59b57][_0xb34b('0x2b')]));if(members[_0x59b57]['exitAt']){writeDB(members[_0x59b57]);}}}}catch(_0x5714c5){utils[_0xb34b('0x30')](util[_0xb34b('0x14')](_0xb34b('0x29'),_0x5ce55d[_0xb34b('0x6')]),_0x5714c5);}}; \ No newline at end of file +var _0x32f8=['catch','error','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','agentcomplete','debug','info','queue','assign','[%s][members][agentcomplete]','cdr','channel','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','name','internal','CreateMemberReport','split','request'];(function(_0x395733,_0x1cf610){var _0x38ac34=function(_0x5361b6){while(--_0x5361b6){_0x395733['push'](_0x395733['shift']());}};_0x38ac34(++_0x1cf610);}(_0x32f8,0xaf));var _0x832f=function(_0x361795,_0x2ad8c1){_0x361795=_0x361795-0x0;var _0x5ad15f=_0x32f8[_0x361795];return _0x5ad15f;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var utils=require(_0x832f('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x832f('0x3')];function writeDB(_0x1b0261){utils['info'](util[_0x832f('0x4')](_0x832f('0x5'),_0x1b0261[_0x832f('0x6')],_0x1b0261[_0x832f('0x7')],_0x1b0261['channel'],_0x1b0261[_0x832f('0x8')],_0x1b0261[_0x832f('0x9')],_0x1b0261[_0x832f('0xa')]));if(_0x1b0261['interface']){utils[_0x832f('0xb')](_0x1b0261[_0x832f('0x7')])['then'](function(_0x193b5a){if(_0x193b5a){_0x1b0261[_0x832f('0x9')]=_0x193b5a[_0x832f('0xc')];_0x1b0261[_0x832f('0xd')]=_0x193b5a[_0x832f('0xd')];utils['request'](_0x832f('0xe'),_0x1b0261);}else{utils['getUserByName'](_0x1b0261[_0x832f('0x7')][_0x832f('0xf')]('/')[0x1])['then'](function(_0xde09d9){if(_0xde09d9){_0x1b0261[_0x832f('0x9')]=_0xde09d9[_0x832f('0xc')];_0x1b0261['internal']=_0xde09d9[_0x832f('0xd')];utils[_0x832f('0x10')](_0x832f('0xe'),_0x1b0261);}});}})[_0x832f('0x11')](function(_0x3956ea){utils[_0x832f('0x12')](util[_0x832f('0x4')]('[%s][members][writeDB]',_0x1b0261[_0x832f('0x6')]),_0x3956ea);});}delete members[_0x1b0261[_0x832f('0x7')]];}function startsWith(_0x1c76d0,_0x49824c){return _[_0x832f('0x13')](_0x1c76d0,function(_0x4eb3d7){return _[_0x832f('0x14')](_0x49824c,_0x4eb3d7);});}exports[_0x832f('0x15')]=function(_0x5f4977){try{utils['debug'](util[_0x832f('0x4')](_0x832f('0x16'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977['device']]['uniqueid']:_0x5f4977['device']),_0x5f4977);utils['info'](util[_0x832f('0x4')](_0x832f('0x18'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]:_0x5f4977[_0x832f('0x17')],_0x5f4977['state'],_0x5f4977[_0x832f('0x17')]));switch(_0x5f4977[_0x832f('0x19')]){case'INUSE':case _0x832f('0x1a'):if(!startsWith(exclude,_0x5f4977['device'])){members[_0x5f4977[_0x832f('0x17')]]={'channel':'voice','interface':_0x5f4977['device'],'type':_0x832f('0x1b'),'enterAt':utils[_0x832f('0x1c')](),'role':_0x832f('0x1d')};}break;case _0x832f('0x1e'):if(!_[_0x832f('0x1f')](members[_0x5f4977[_0x832f('0x17')]])){members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x20')]=utils[_0x832f('0x1c')]();members[_0x5f4977['device']][_0x832f('0x21')]=utils['diffTime'](members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x20')],members[_0x5f4977[_0x832f('0x17')]]['enterAt']);if(members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]){writeDB(members[_0x5f4977[_0x832f('0x17')]]);}}break;default:break;}}catch(_0x3db92c){utils[_0x832f('0x12')](util[_0x832f('0x4')](_0x832f('0x16'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]:_0x5f4977['device']),_0x3db92c);}};exports[_0x832f('0x22')]=function(_0x12b81f){try{if(!_[_0x832f('0x1f')](members[_0x12b81f[_0x832f('0x7')]])){utils[_0x832f('0x23')](util['format']('[%s][members][agentcomplete]',_0x12b81f['uniqueid']),_0x12b81f);utils[_0x832f('0x24')](util[_0x832f('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x12b81f['uniqueid'],_0x12b81f[_0x832f('0x7')],_0x12b81f[_0x832f('0x25')]));members[_0x12b81f[_0x832f('0x7')]]=_[_0x832f('0x26')](members[_0x12b81f['interface']],{'data4':_0x12b81f[_0x832f('0x25')],'uniqueid':_0x12b81f['uniqueid']});}}catch(_0x623161){utils[_0x832f('0x12')](util[_0x832f('0x4')](_0x832f('0x27'),_0x12b81f[_0x832f('0x6')]),_0x623161);}};exports[_0x832f('0x28')]=function(_0x51f560){try{utils[_0x832f('0x23')](util[_0x832f('0x4')]('[%s][members][cdr]',_0x51f560[_0x832f('0x6')]),_0x51f560);if(_0x51f560['channel']){var _0x8ea9eb=_0x51f560[_0x832f('0x29')][_0x832f('0xf')]('-')[0x0];if(!_[_0x832f('0x1f')](members[_0x8ea9eb])){members[_0x8ea9eb]=_[_0x832f('0x26')](members[_0x8ea9eb],{'data1':members[_0x8ea9eb][_0x832f('0x2a')]||_0x51f560['type'],'data2':members[_0x8ea9eb][_0x832f('0x8')]||_0x51f560[_0x832f('0x2b')],'data3':members[_0x8ea9eb][_0x832f('0x2c')]||_0x51f560[_0x832f('0x2d')],'uniqueid':members[_0x8ea9eb][_0x832f('0x6')]||_0x51f560['uniqueid']});utils[_0x832f('0x24')](util[_0x832f('0x4')](_0x832f('0x2e'),_0x51f560[_0x832f('0x6')],members[_0x8ea9eb][_0x832f('0x2a')],members[_0x8ea9eb]['data2'],members[_0x8ea9eb][_0x832f('0x2c')]));if(members[_0x8ea9eb][_0x832f('0x20')]){writeDB(members[_0x8ea9eb]);}}}if(_0x51f560[_0x832f('0x2f')]){var _0x50214b=_0x51f560[_0x832f('0x2f')][_0x832f('0xf')]('-')[0x0];if(!_['isNil'](members[_0x50214b])){members[_0x50214b]=_[_0x832f('0x26')](members[_0x50214b],{'data1':members[_0x50214b]['data1']||_0x51f560[_0x832f('0xa')],'data2':members[_0x50214b][_0x832f('0x8')]||_0x51f560[_0x832f('0x2b')],'data3':members[_0x50214b][_0x832f('0x2c')]||_0x51f560[_0x832f('0x2d')],'uniqueid':members[_0x50214b][_0x832f('0x6')]||_0x51f560[_0x832f('0x6')]});utils[_0x832f('0x24')](util[_0x832f('0x4')](_0x832f('0x2e'),_0x51f560['uniqueid'],members[_0x50214b][_0x832f('0x2a')],members[_0x50214b]['data2'],members[_0x50214b][_0x832f('0x2c')]));if(members[_0x50214b]['exitAt']){writeDB(members[_0x50214b]);}}}}catch(_0x3bb355){utils[_0x832f('0x12')](util[_0x832f('0x4')]('[%s][members][cdr]',_0x51f560[_0x832f('0x6')]),_0x3bb355);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 87a2dc5..5a7c077 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 _0xcf2b=['queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','queuecallerjoinAt','count','agentconnect','membername','assigned','destaccountcode','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid'];(function(_0x53c88b,_0x295d4c){var _0x2d4c27=function(_0x5ae123){while(--_0x5ae123){_0x53c88b['push'](_0x53c88b['shift']());}};_0x2d4c27(++_0x295d4c);}(_0xcf2b,0xc2));var _0xbcf2=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0xcf2b[_0x17e771];return _0x1f3a6d;};'use strict';var _=require(_0xbcf2('0x0'));var util=require(_0xbcf2('0x1'));var utils=require(_0xbcf2('0x2'));var queues={};function writeDB(_0x45f2a0){utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x5'),_0x45f2a0[_0xbcf2('0x6')],_0x45f2a0[_0xbcf2('0x7')],_0x45f2a0[_0xbcf2('0x8')],_0x45f2a0[_0xbcf2('0x9')],_0x45f2a0[_0xbcf2('0xa')],_0x45f2a0['accountcode'],_0x45f2a0['queuecallerexitreason']));if(_0x45f2a0[_0xbcf2('0x8')]){utils[_0xbcf2('0xb')](_0x45f2a0['queue'])['then'](function(_0x383f3b){if(_0x383f3b){_0x45f2a0[_0xbcf2('0xc')]=_0x383f3b[_0xbcf2('0xc')];}utils[_0xbcf2('0xd')](_0xbcf2('0xe'),_0x45f2a0);});}else{utils[_0xbcf2('0xd')](_0xbcf2('0xe'),_0x45f2a0);}if(_0x45f2a0[_0xbcf2('0xf')]){delete queues[_0x45f2a0['transfereduniqueid']];}else{delete queues[_0x45f2a0[_0xbcf2('0x6')]];}}exports[_0xbcf2('0x10')]=function(_0x5c5ba6){try{utils[_0xbcf2('0x11')](util['format'](_0xbcf2('0x12'),_0x5c5ba6[_0xbcf2('0x6')]),_0x5c5ba6);utils['info'](util[_0xbcf2('0x4')](_0xbcf2('0x13'),_0x5c5ba6[_0xbcf2('0x6')],_0x5c5ba6[_0xbcf2('0x8')],_0x5c5ba6[_0xbcf2('0x14')]));queues[_0x5c5ba6[_0xbcf2('0x6')]]=_[_0xbcf2('0x15')](_0x5c5ba6,{'originalposition':_0x5c5ba6[_0xbcf2('0x14')],'queuecallerjoinAt':utils[_0xbcf2('0x16')](),'mohtime':0x0});}catch(_0x1e5330){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')](_0xbcf2('0x12'),_0x5c5ba6[_0xbcf2('0x6')]),_0x1e5330);}};exports['hangup']=function(_0x3173e3){try{if(!_[_0xbcf2('0x18')](queues[_0x3173e3['uniqueid']])){utils['debug'](util['format'](_0xbcf2('0x19'),_0x3173e3[_0xbcf2('0x6')]),_0x3173e3);if(queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x1a')]){if(!queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x1b')]&&!queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x1c')]){queues[_0x3173e3[_0xbcf2('0x6')]]['queuecallercomplete']=!![];queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x1d')]=utils[_0xbcf2('0x16')]();queues[_0x3173e3['uniqueid']]['queuecallerexitreason']=_0xbcf2('0x1e');}utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x1f'),_0x3173e3[_0xbcf2('0x6')],queues[_0x3173e3[_0xbcf2('0x6')]]['name'],queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x20')]));writeDB(queues[_0x3173e3[_0xbcf2('0x6')]]);}else if(queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0xf')]){utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x21'),_0x3173e3[_0xbcf2('0x6')],queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0x22')],queues[_0x3173e3['uniqueid']]['transfereduniqueid']));queues[queues[_0x3173e3[_0xbcf2('0x6')]][_0xbcf2('0xf')]]=queues[_0x3173e3[_0xbcf2('0x6')]];queues[queues[_0x3173e3[_0xbcf2('0x6')]]['transfereduniqueid']][_0xbcf2('0x23')]=0x2;delete queues[_0x3173e3['uniqueid']];}}}catch(_0x14a5eb){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')](_0xbcf2('0x19'),_0x3173e3[_0xbcf2('0x6')]),_0x14a5eb);}};exports[_0xbcf2('0x24')]=function(_0x36485f){try{utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x25'),_0x36485f[_0xbcf2('0x6')]),_0x36485f);if(!_['isNil'](_0x36485f[_0xbcf2('0x26')][_0xbcf2('0x27')])&&_0x36485f[_0xbcf2('0x28')][_0xbcf2('0x29')]()!=='CONTINUE'){if(!_[_0xbcf2('0x18')](queues[_0x36485f[_0xbcf2('0x6')]])){queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x1b')]=![];queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x2a')]=null;queues[_0x36485f['uniqueid']][_0xbcf2('0x1c')]=!![];queues[_0x36485f['uniqueid']]['queuecallerexitAt']=utils[_0xbcf2('0x16')]();queues[_0x36485f['uniqueid']][_0xbcf2('0x20')]=_0x36485f[_0xbcf2('0x28')][_0xbcf2('0x29')]();utils['info'](util[_0xbcf2('0x4')](_0xbcf2('0x2b'),_0x36485f['uniqueid'],queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x22')],_0x36485f['value'],queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x20')]));writeDB(queues[_0x36485f['uniqueid']]);}}else if(!_[_0xbcf2('0x18')](_0x36485f['variable'][_0xbcf2('0x2c')])){if(!_[_0xbcf2('0x18')](queues[_0x36485f[_0xbcf2('0x6')]])&&!queues[_0x36485f[_0xbcf2('0x6')]]['queuecallerabandon']){queues[_0x36485f[_0xbcf2('0x6')]]['queuecallerabandon']=![];queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x2a')]=null;queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x1c')]=!![];queues[_0x36485f['uniqueid']][_0xbcf2('0x2d')]=utils[_0xbcf2('0x16')]();queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x20')]='EXITWITHKEY';utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x2e'),_0x36485f[_0xbcf2('0x6')],queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x22')],_0x36485f['value'],queues[_0x36485f[_0xbcf2('0x6')]][_0xbcf2('0x20')]));}}}catch(_0x241cbb){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')](_0xbcf2('0x25'),_0x36485f[_0xbcf2('0x6')]),_0x241cbb);}};exports[_0xbcf2('0x1b')]=function(_0x192dd0){try{if(!_[_0xbcf2('0x18')](queues[_0x192dd0[_0xbcf2('0x6')]])){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x2f'),_0x192dd0[_0xbcf2('0x6')]),_0x192dd0);queues[_0x192dd0[_0xbcf2('0x6')]][_0xbcf2('0x1c')]=![];queues[_0x192dd0[_0xbcf2('0x6')]]['queuecallerexitAt']=null;queues[_0x192dd0[_0xbcf2('0x6')]]['queuecallerabandon']=!![];queues[_0x192dd0['uniqueid']][_0xbcf2('0x2a')]=utils[_0xbcf2('0x16')]();queues[_0x192dd0[_0xbcf2('0x6')]][_0xbcf2('0x20')]=_0xbcf2('0x30');utils[_0xbcf2('0x3')](util['format'](_0xbcf2('0x31'),_0x192dd0[_0xbcf2('0x6')],queues[_0x192dd0[_0xbcf2('0x6')]][_0xbcf2('0x22')],queues[_0x192dd0['uniqueid']][_0xbcf2('0x20')]));}}catch(_0xa99fa0){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')]('[%s][queues][queuecallerabandon]',_0x192dd0[_0xbcf2('0x6')]),_0xa99fa0);}};exports['queuecallerleave']=function(_0x3d7407){try{if(!_[_0xbcf2('0x18')](queues[_0x3d7407[_0xbcf2('0x6')]])){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x32'),_0x3d7407[_0xbcf2('0x6')]),_0x3d7407);utils['info'](util['format'](_0xbcf2('0x33'),_0x3d7407['uniqueid'],queues[_0x3d7407['uniqueid']][_0xbcf2('0x22')],_0x3d7407[_0xbcf2('0x34')],_0x3d7407[_0xbcf2('0x35')]));queues[_0x3d7407['uniqueid']][_0xbcf2('0x36')]=!![];queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x1a')]=utils[_0xbcf2('0x16')]();queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x37')]=utils['diffTime'](queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x1a')],queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x38')]);queues[_0x3d7407[_0xbcf2('0x6')]]['position']=_0x3d7407[_0xbcf2('0x14')];queues[_0x3d7407['uniqueid']][_0xbcf2('0x39')]=_0x3d7407['count'];queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x34')]=_0x3d7407['connectedlinenum'];queues[_0x3d7407[_0xbcf2('0x6')]][_0xbcf2('0x35')]=_0x3d7407[_0xbcf2('0x35')];}}catch(_0x1bf0b6){utils['error'](util[_0xbcf2('0x4')](_0xbcf2('0x32'),_0x3d7407['uniqueid']),_0x1bf0b6);}};exports[_0xbcf2('0x3a')]=function(_0x2accd4){try{if(!_[_0xbcf2('0x18')](queues[_0x2accd4[_0xbcf2('0x6')]])){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')]('[%s][queues][agentconnect]',_0x2accd4[_0xbcf2('0x6')]),_0x2accd4);utils[_0xbcf2('0x3')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2accd4[_0xbcf2('0x6')],queues[_0x2accd4['uniqueid']][_0xbcf2('0x22')],_0x2accd4[_0xbcf2('0x3b')],_0x2accd4['destaccountcode']));queues[_0x2accd4[_0xbcf2('0x6')]]['queuecallerabandon']=![];queues[_0x2accd4[_0xbcf2('0x6')]]['queuecallerabandon']=![];queues[_0x2accd4[_0xbcf2('0x6')]][_0xbcf2('0x2a')]=null;queues[_0x2accd4[_0xbcf2('0x6')]][_0xbcf2('0x1c')]=![];queues[_0x2accd4[_0xbcf2('0x6')]]['queuecallerexitreason']=null;queues[_0x2accd4[_0xbcf2('0x6')]][_0xbcf2('0x2d')]=null;queues[_0x2accd4[_0xbcf2('0x6')]][_0xbcf2('0x3c')]=!![];queues[_0x2accd4[_0xbcf2('0x6')]]['accountcode']=_0x2accd4[_0xbcf2('0x3d')];queues[_0x2accd4['uniqueid']][_0xbcf2('0x9')]=_0x2accd4[_0xbcf2('0x3b')];}}catch(_0x56e241){utils[_0xbcf2('0x17')](util['format'](_0xbcf2('0x3e'),_0x2accd4[_0xbcf2('0x6')]),_0x56e241);}};exports['agentcomplete']=function(_0x123f50){try{if(!_[_0xbcf2('0x18')](queues[_0x123f50[_0xbcf2('0x6')]])){if(queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x1a')]){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x3f'),_0x123f50[_0xbcf2('0x6')]),_0x123f50);queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x1b')]=![];queues[_0x123f50[_0xbcf2('0x6')]]['queuecallerabandon']=![];queues[_0x123f50['uniqueid']][_0xbcf2('0x2a')]=null;queues[_0x123f50[_0xbcf2('0x6')]]['queuecallerexit']=![];queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x2d')]=null;queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x3c')]=!![];queues[_0x123f50['uniqueid']]['lastAssignedTo']=_0x123f50[_0xbcf2('0x3b')];queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x40')]=!![];queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x1d')]=utils[_0xbcf2('0x16')]();if(_0x123f50[_0xbcf2('0x41')]==_0xbcf2('0x42')){if(!queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x42')]){queues[_0x123f50[_0xbcf2('0x6')]]['queuecallerexitreason']=_0xbcf2('0x43');}}else{queues[_0x123f50['uniqueid']][_0xbcf2('0x20')]=_0xbcf2('0x44')+_0x123f50['reason'][_0xbcf2('0x29')]();}utils[_0xbcf2('0x3')](util['format'](_0xbcf2('0x45'),_0x123f50[_0xbcf2('0x6')],queues[_0x123f50['uniqueid']][_0xbcf2('0x22')],_0x123f50[_0xbcf2('0x3b')],queues[_0x123f50[_0xbcf2('0x6')]][_0xbcf2('0x20')]));writeDB(queues[_0x123f50['uniqueid']]);}}}catch(_0x553220){utils[_0xbcf2('0x17')](util['format'](_0xbcf2('0x3f'),_0x123f50[_0xbcf2('0x6')]),_0x553220);}};exports[_0xbcf2('0x46')]=function(_0x222b08){try{if(!_[_0xbcf2('0x18')](queues[_0x222b08[_0xbcf2('0x47')]])){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x48'),_0x222b08[_0xbcf2('0x6')]),_0x222b08);queues[_0x222b08['transfereeuniqueid']]['transfer']=!![];queues[_0x222b08['transfereeuniqueid']][_0xbcf2('0x49')]='BLIND';queues[_0x222b08[_0xbcf2('0x47')]][_0xbcf2('0x4a')]=_0x222b08[_0xbcf2('0x4b')];queues[_0x222b08[_0xbcf2('0x47')]]['transferuniqueid']=_0x222b08[_0xbcf2('0x47')];queues[_0x222b08[_0xbcf2('0x47')]][_0xbcf2('0x20')]=_0xbcf2('0x4c');utils['info'](util[_0xbcf2('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x222b08['uniqueid'],queues[_0x222b08[_0xbcf2('0x47')]][_0xbcf2('0x22')],_0x222b08[_0xbcf2('0x47')],_0x222b08[_0xbcf2('0x4b')]));}}catch(_0x507233){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')](_0xbcf2('0x48'),_0x222b08[_0xbcf2('0x6')]),_0x507233);}};exports['attendedtransfer']=function(_0x2e17dd){try{utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')]('[%s][queues][attendedtransfer]',_0x2e17dd[_0xbcf2('0x4d')]),_0x2e17dd);if(_0x2e17dd[_0xbcf2('0x4d')]==_0x2e17dd[_0xbcf2('0x4e')]){if(!_[_0xbcf2('0x18')](queues[_0x2e17dd[_0xbcf2('0x4f')]])){utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x50'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd['secondtransfererlinkedid']][_0xbcf2('0x22')],_0x2e17dd[_0xbcf2('0x51')]));queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0x42')]=!![];queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0x49')]=_0xbcf2('0x52');queues[_0x2e17dd[_0xbcf2('0x4f')]]['transferexten']=_0x2e17dd[_0xbcf2('0x51')];queues[_0x2e17dd['secondtransfererlinkedid']][_0xbcf2('0x53')]=_0x2e17dd[_0xbcf2('0x4d')];queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0x20')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x2e17dd[_0xbcf2('0x4e')]])){if(_0x2e17dd[_0xbcf2('0x54')]&&queues[_0x2e17dd[_0xbcf2('0x54')]]){queues[_0x2e17dd[_0xbcf2('0x54')]][_0xbcf2('0x23')]=0x1;queues[_0x2e17dd['transfereeuniqueid']]=_[_0xbcf2('0x55')](queues[_0x2e17dd[_0xbcf2('0x54')]]);queues[_0x2e17dd[_0xbcf2('0x47')]][_0xbcf2('0xf')]=_0x2e17dd[_0xbcf2('0x56')];queues[_0x2e17dd['transfereeuniqueid']][_0xbcf2('0x23')]=0x2;queues[_0x2e17dd['transfereeuniqueid']][_0xbcf2('0xa')]=queues[_0x2e17dd['secondtransfererlinkedid']][_0xbcf2('0xa')];queues[_0x2e17dd['transfereeuniqueid']]['calleridname']=queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0x57')];queues[_0x2e17dd['transfereeuniqueid']][_0xbcf2('0x38')]=utils[_0xbcf2('0x16')]();queues[_0x2e17dd[_0xbcf2('0x47')]][_0xbcf2('0x1a')]=utils[_0xbcf2('0x16')]();queues[_0x2e17dd[_0xbcf2('0x47')]][_0xbcf2('0x37')]=0x0;queues[_0x2e17dd[_0xbcf2('0x47')]][_0xbcf2('0x58')]=0x0;utils['info'](util[_0xbcf2('0x4')](_0xbcf2('0x59'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd[_0xbcf2('0x47')]][_0xbcf2('0x22')],queues[_0x2e17dd['transfereeuniqueid']][_0xbcf2('0xa')],queues[_0x2e17dd['transfereeuniqueid']][_0xbcf2('0x57')]));}else{utils[_0xbcf2('0x3')](util['format'](_0xbcf2('0x5a'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd['origtransfererlinkedid']][_0xbcf2('0x22')],_0x2e17dd[_0xbcf2('0x4f')]));queues[_0x2e17dd['origtransfererlinkedid']]['transfereduniqueid']=_0x2e17dd['secondtransfererlinkedid'];}}}else if(_0x2e17dd[_0xbcf2('0x5b')]==_0x2e17dd[_0xbcf2('0x4f')]){if(!_[_0xbcf2('0x18')](queues[_0x2e17dd[_0xbcf2('0x4e')]])){utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x5c'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd[_0xbcf2('0x4e')]][_0xbcf2('0x22')],_0x2e17dd[_0xbcf2('0x5b')],_0x2e17dd[_0xbcf2('0x5d')]));queues[_0x2e17dd['origtransfererlinkedid']][_0xbcf2('0x42')]=!![];queues[_0x2e17dd[_0xbcf2('0x4e')]][_0xbcf2('0x49')]=_0xbcf2('0x52');queues[_0x2e17dd[_0xbcf2('0x4e')]]['transferexten']=_0x2e17dd[_0xbcf2('0x5d')];queues[_0x2e17dd['origtransfererlinkedid']]['transferuniqueid']=_0x2e17dd[_0xbcf2('0x5b')];queues[_0x2e17dd[_0xbcf2('0x4e')]]['queuecallerexitreason']=_0xbcf2('0x5e');}if(!_['isNil'](queues[_0x2e17dd[_0xbcf2('0x4f')]])){if(_0x2e17dd[_0xbcf2('0x5f')]&&queues[_0x2e17dd[_0xbcf2('0x5f')]]){queues[_0x2e17dd['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x2e17dd[_0xbcf2('0x56')]]=_[_0xbcf2('0x55')](queues[_0x2e17dd[_0xbcf2('0x5f')]]);queues[_0x2e17dd['transfertargetuniqueid']][_0xbcf2('0xf')]=_0x2e17dd[_0xbcf2('0x56')];queues[_0x2e17dd[_0xbcf2('0x56')]][_0xbcf2('0x23')]=0x2;queues[_0x2e17dd['transfertargetuniqueid']][_0xbcf2('0xa')]=queues[_0x2e17dd[_0xbcf2('0x4e')]]['calleridnum'];queues[_0x2e17dd[_0xbcf2('0x56')]]['calleridname']=queues[_0x2e17dd[_0xbcf2('0x4e')]][_0xbcf2('0x57')];queues[_0x2e17dd['transfertargetuniqueid']][_0xbcf2('0x38')]=utils[_0xbcf2('0x16')]();queues[_0x2e17dd[_0xbcf2('0x56')]]['queuecallerleaveAt']=utils['now']();queues[_0x2e17dd[_0xbcf2('0x56')]][_0xbcf2('0x37')]=0x0;queues[_0x2e17dd[_0xbcf2('0x56')]][_0xbcf2('0x58')]=0x0;utils[_0xbcf2('0x3')](util['format'](_0xbcf2('0x60'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd[_0xbcf2('0x56')]][_0xbcf2('0x22')],queues[_0x2e17dd[_0xbcf2('0x56')]]['transfereduniqueid'],queues[_0x2e17dd[_0xbcf2('0x56')]][_0xbcf2('0xa')],queues[_0x2e17dd[_0xbcf2('0x56')]]['calleridname']));}else{utils['info'](util[_0xbcf2('0x4')](_0xbcf2('0x5a'),_0x2e17dd[_0xbcf2('0x4d')],queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0x22')],_0x2e17dd['origtransfererlinkedid']));queues[_0x2e17dd[_0xbcf2('0x4f')]][_0xbcf2('0xf')]=_0x2e17dd[_0xbcf2('0x4e')];}}}}catch(_0x3043e3){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')](_0xbcf2('0x61'),_0x2e17dd[_0xbcf2('0x4d')]),_0x3043e3);}};exports[_0xbcf2('0x62')]=function(_0x3a5544){try{if(!_[_0xbcf2('0x18')](queues[_0x3a5544[_0xbcf2('0x6')]])){utils[_0xbcf2('0x11')](util[_0xbcf2('0x4')](_0xbcf2('0x63'),_0x3a5544[_0xbcf2('0x6')]),_0x3a5544);queues[_0x3a5544[_0xbcf2('0x6')]][_0xbcf2('0x64')]=utils[_0xbcf2('0x16')]();utils[_0xbcf2('0x3')](util[_0xbcf2('0x4')](_0xbcf2('0x65'),_0x3a5544[_0xbcf2('0x6')],queues[_0x3a5544[_0xbcf2('0x6')]][_0xbcf2('0x22')],queues[_0x3a5544[_0xbcf2('0x6')]][_0xbcf2('0x64')]));}}catch(_0x1f8339){utils[_0xbcf2('0x17')](util[_0xbcf2('0x4')]('[%s][queues][musiconholdstart]',_0x3a5544[_0xbcf2('0x6')]),_0x1f8339);}};exports[_0xbcf2('0x66')]=function(_0x4d8973){try{if(!_[_0xbcf2('0x18')](queues[_0x4d8973[_0xbcf2('0x6')]])){if(!_[_0xbcf2('0x18')](queues[_0x4d8973[_0xbcf2('0x6')]][_0xbcf2('0x64')])){utils['debug'](util[_0xbcf2('0x4')](_0xbcf2('0x67'),_0x4d8973[_0xbcf2('0x6')]),_0x4d8973);queues[_0x4d8973['uniqueid']][_0xbcf2('0x58')]+=utils[_0xbcf2('0x68')](utils[_0xbcf2('0x16')](),queues[_0x4d8973[_0xbcf2('0x6')]][_0xbcf2('0x64')]);utils[_0xbcf2('0x3')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x4d8973[_0xbcf2('0x6')],queues[_0x4d8973['uniqueid']][_0xbcf2('0x22')],queues[_0x4d8973[_0xbcf2('0x6')]]['mohtime']));delete queues[_0x4d8973[_0xbcf2('0x6')]][_0xbcf2('0x64')];}}}catch(_0x31fde2){utils[_0xbcf2('0x17')](util['format'](_0xbcf2('0x67'),_0x4d8973[_0xbcf2('0x6')]),_0x31fde2);}}; \ No newline at end of file +var _0xc6c8=['ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDEDTRANSFER','transfertargetlinkedid','[%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','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','isNil','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten'];(function(_0x3f76ce,_0x456af1){var _0x3b43b2=function(_0x56a2d2){while(--_0x56a2d2){_0x3f76ce['push'](_0x3f76ce['shift']());}};_0x3b43b2(++_0x456af1);}(_0xc6c8,0xe2));var _0x8c6c=function(_0x1234d2,_0x188e8a){_0x1234d2=_0x1234d2-0x0;var _0x559b64=_0xc6c8[_0x1234d2];return _0x559b64;};'use strict';var _=require(_0x8c6c('0x0'));var util=require(_0x8c6c('0x1'));var utils=require(_0x8c6c('0x2'));var queues={};function writeDB(_0x3ad15a){utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x4'),_0x3ad15a[_0x8c6c('0x5')],_0x3ad15a[_0x8c6c('0x6')],_0x3ad15a[_0x8c6c('0x7')],_0x3ad15a[_0x8c6c('0x8')],_0x3ad15a[_0x8c6c('0x9')],_0x3ad15a[_0x8c6c('0xa')],_0x3ad15a[_0x8c6c('0xb')]));if(_0x3ad15a[_0x8c6c('0x7')]){utils[_0x8c6c('0xc')](_0x3ad15a[_0x8c6c('0x7')])[_0x8c6c('0xd')](function(_0x3b5235){if(_0x3b5235){_0x3ad15a['type']=_0x3b5235['type'];}utils[_0x8c6c('0xe')](_0x8c6c('0xf'),_0x3ad15a);});}else{utils[_0x8c6c('0xe')]('CreateVoiceQueueReport',_0x3ad15a);}if(_0x3ad15a[_0x8c6c('0x10')]){delete queues[_0x3ad15a[_0x8c6c('0x10')]];}else{delete queues[_0x3ad15a[_0x8c6c('0x5')]];}}exports[_0x8c6c('0x11')]=function(_0x5dbb29){try{utils[_0x8c6c('0x12')](util['format']('[%s][queues][queuecallerjoin]',_0x5dbb29[_0x8c6c('0x5')]),_0x5dbb29);utils['info'](util[_0x8c6c('0x13')](_0x8c6c('0x14'),_0x5dbb29[_0x8c6c('0x5')],_0x5dbb29[_0x8c6c('0x7')],_0x5dbb29[_0x8c6c('0x15')]));queues[_0x5dbb29[_0x8c6c('0x5')]]=_[_0x8c6c('0x16')](_0x5dbb29,{'originalposition':_0x5dbb29[_0x8c6c('0x15')],'queuecallerjoinAt':utils[_0x8c6c('0x17')](),'mohtime':0x0});}catch(_0x451ab6){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x19'),_0x5dbb29[_0x8c6c('0x5')]),_0x451ab6);}};exports[_0x8c6c('0x1a')]=function(_0x5b0277){try{if(!_['isNil'](queues[_0x5b0277['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][hangup]',_0x5b0277[_0x8c6c('0x5')]),_0x5b0277);if(queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x1b')]){if(!queues[_0x5b0277['uniqueid']]['queuecallerabandon']&&!queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x1c')]){queues[_0x5b0277['uniqueid']][_0x8c6c('0x1d')]=!![];queues[_0x5b0277[_0x8c6c('0x5')]]['queuecallercompleteAt']=utils['now']();queues[_0x5b0277[_0x8c6c('0x5')]]['queuecallerexitreason']=_0x8c6c('0x1e');}utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x1f'),_0x5b0277[_0x8c6c('0x5')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x20')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0xb')]));writeDB(queues[_0x5b0277['uniqueid']]);}else if(queues[_0x5b0277['uniqueid']]['transfereduniqueid']){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5b0277['uniqueid'],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x20')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x10')]));queues[queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x10')]]=queues[_0x5b0277[_0x8c6c('0x5')]];queues[queues[_0x5b0277['uniqueid']][_0x8c6c('0x10')]][_0x8c6c('0x21')]=0x2;delete queues[_0x5b0277['uniqueid']];}}}catch(_0x51dbbf){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x22'),_0x5b0277['uniqueid']),_0x51dbbf);}};exports[_0x8c6c('0x23')]=function(_0x196902){try{utils[_0x8c6c('0x12')](util['format'](_0x8c6c('0x24'),_0x196902[_0x8c6c('0x5')]),_0x196902);if(!_['isNil'](_0x196902[_0x8c6c('0x25')][_0x8c6c('0x26')])&&_0x196902[_0x8c6c('0x27')][_0x8c6c('0x28')]()!==_0x8c6c('0x29')){if(!_[_0x8c6c('0x2a')](queues[_0x196902[_0x8c6c('0x5')]])){queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2c')]=null;queues[_0x196902[_0x8c6c('0x5')]]['queuecallerexit']=!![];queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2d')]=utils['now']();queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x196902[_0x8c6c('0x27')][_0x8c6c('0x28')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x196902[_0x8c6c('0x5')],queues[_0x196902['uniqueid']][_0x8c6c('0x20')],_0x196902[_0x8c6c('0x27')],queues[_0x196902[_0x8c6c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x196902[_0x8c6c('0x5')]]);}}else if(!_[_0x8c6c('0x2a')](_0x196902[_0x8c6c('0x25')]['queueposition'])){if(!_[_0x8c6c('0x2a')](queues[_0x196902[_0x8c6c('0x5')]])&&!queues[_0x196902['uniqueid']]['queuecallerabandon']){queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0x196902[_0x8c6c('0x5')]]['queuecallerabandonAt']=null;queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=!![];queues[_0x196902['uniqueid']][_0x8c6c('0x2d')]=utils[_0x8c6c('0x17')]();queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x8c6c('0x2e');utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x2f'),_0x196902['uniqueid'],queues[_0x196902['uniqueid']][_0x8c6c('0x20')],_0x196902['value'],queues[_0x196902['uniqueid']][_0x8c6c('0xb')]));}}}catch(_0x1ab92e){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x24'),_0x196902[_0x8c6c('0x5')]),_0x1ab92e);}};exports[_0x8c6c('0x2b')]=function(_0x486b21){try{if(!_[_0x8c6c('0x2a')](queues[_0x486b21[_0x8c6c('0x5')]])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][queuecallerabandon]',_0x486b21[_0x8c6c('0x5')]),_0x486b21);queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=![];queues[_0x486b21[_0x8c6c('0x5')]]['queuecallerexitAt']=null;queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=!![];queues[_0x486b21['uniqueid']][_0x8c6c('0x2c')]=utils[_0x8c6c('0x17')]();queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0xb')]='ABANDONED';utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x30'),_0x486b21[_0x8c6c('0x5')],queues[_0x486b21['uniqueid']][_0x8c6c('0x20')],queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0xb')]));}}catch(_0x200648){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')]('[%s][queues][queuecallerabandon]',_0x486b21['uniqueid']),_0x200648);}};exports[_0x8c6c('0x31')]=function(_0x26261d){try{if(!_[_0x8c6c('0x2a')](queues[_0x26261d['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x32'),_0x26261d[_0x8c6c('0x5')]),_0x26261d);utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x33'),_0x26261d[_0x8c6c('0x5')],queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x20')],_0x26261d[_0x8c6c('0x34')],_0x26261d['connectedlinename']));queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x31')]=!![];queues[_0x26261d[_0x8c6c('0x5')]]['queuecallerleaveAt']=utils[_0x8c6c('0x17')]();queues[_0x26261d[_0x8c6c('0x5')]]['holdtime']=utils[_0x8c6c('0x35')](queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x1b')],queues[_0x26261d[_0x8c6c('0x5')]]['queuecallerjoinAt']);queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x15')]=_0x26261d[_0x8c6c('0x15')];queues[_0x26261d[_0x8c6c('0x5')]]['count']=_0x26261d[_0x8c6c('0x36')];queues[_0x26261d['uniqueid']]['connectedlinenum']=_0x26261d[_0x8c6c('0x34')];queues[_0x26261d['uniqueid']]['connectedlinename']=_0x26261d[_0x8c6c('0x37')];}}catch(_0x28ceea){utils[_0x8c6c('0x18')](util['format'](_0x8c6c('0x32'),_0x26261d['uniqueid']),_0x28ceea);}};exports[_0x8c6c('0x38')]=function(_0x295a37){try{if(!_['isNil'](queues[_0x295a37['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x39'),_0x295a37[_0x8c6c('0x5')]),_0x295a37);utils['info'](util[_0x8c6c('0x13')](_0x8c6c('0x3a'),_0x295a37[_0x8c6c('0x5')],queues[_0x295a37[_0x8c6c('0x5')]]['name'],_0x295a37[_0x8c6c('0x3b')],_0x295a37[_0x8c6c('0x3c')]));queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerabandon']=![];queues[_0x295a37['uniqueid']][_0x8c6c('0x2b')]=![];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0x2c')]=null;queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerexit']=![];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0xb')]=null;queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerexitAt']=null;queues[_0x295a37['uniqueid']][_0x8c6c('0x3d')]=!![];queues[_0x295a37[_0x8c6c('0x5')]]['accountcode']=_0x295a37['destaccountcode'];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0x8')]=_0x295a37[_0x8c6c('0x3b')];}}catch(_0x2d609c){utils['error'](util['format'](_0x8c6c('0x39'),_0x295a37['uniqueid']),_0x2d609c);}};exports[_0x8c6c('0x3e')]=function(_0xa59428){try{if(!_[_0x8c6c('0x2a')](queues[_0xa59428[_0x8c6c('0x5')]])){if(queues[_0xa59428['uniqueid']][_0x8c6c('0x1b')]){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]',_0xa59428[_0x8c6c('0x5')]),_0xa59428);queues[_0xa59428[_0x8c6c('0x5')]]['queuecallerabandon']=![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0xa59428['uniqueid']][_0x8c6c('0x2c')]=null;queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x2d')]=null;queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x3d')]=!![];queues[_0xa59428['uniqueid']][_0x8c6c('0x8')]=_0xa59428[_0x8c6c('0x3b')];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x1d')]=!![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x3f')]=utils[_0x8c6c('0x17')]();if(_0xa59428[_0x8c6c('0x40')]==_0x8c6c('0x41')){if(!queues[_0xa59428['uniqueid']][_0x8c6c('0x41')]){queues[_0xa59428[_0x8c6c('0x5')]]['queuecallerexitreason']=_0x8c6c('0x42');}}else{queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x8c6c('0x43')+_0xa59428['reason'][_0x8c6c('0x28')]();}utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xa59428[_0x8c6c('0x5')],queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x20')],_0xa59428[_0x8c6c('0x3b')],queues[_0xa59428['uniqueid']][_0x8c6c('0xb')]));writeDB(queues[_0xa59428['uniqueid']]);}}}catch(_0x4baa17){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]',_0xa59428['uniqueid']),_0x4baa17);}};exports[_0x8c6c('0x44')]=function(_0x48a7f4){try{if(!_[_0x8c6c('0x2a')](queues[_0x48a7f4[_0x8c6c('0x45')]])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x46'),_0x48a7f4[_0x8c6c('0x5')]),_0x48a7f4);queues[_0x48a7f4['transfereeuniqueid']]['transfer']=!![];queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x47')]='BLIND';queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x48')]=_0x48a7f4[_0x8c6c('0x49')];queues[_0x48a7f4['transfereeuniqueid']][_0x8c6c('0x4a')]=_0x48a7f4[_0x8c6c('0x45')];queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0xb')]='BLINDTRANSFER';utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x48a7f4[_0x8c6c('0x5')],queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x20')],_0x48a7f4[_0x8c6c('0x45')],_0x48a7f4['extension']));}}catch(_0x5902cc){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x46'),_0x48a7f4[_0x8c6c('0x5')]),_0x5902cc);}};exports[_0x8c6c('0x4b')]=function(_0x257da1){try{utils['debug'](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]',_0x257da1[_0x8c6c('0x4c')]),_0x257da1);if(_0x257da1[_0x8c6c('0x4c')]==_0x257da1[_0x8c6c('0x4d')]){if(!_[_0x8c6c('0x2a')](queues[_0x257da1['secondtransfererlinkedid']])){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1[_0x8c6c('0x4e')]]['name'],_0x257da1[_0x8c6c('0x4f')]));queues[_0x257da1['secondtransfererlinkedid']][_0x8c6c('0x41')]=!![];queues[_0x257da1[_0x8c6c('0x4e')]]['transfertype']=_0x8c6c('0x50');queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x48')]=_0x257da1[_0x8c6c('0x4f')];queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x4a')]=_0x257da1[_0x8c6c('0x4c')];queues[_0x257da1['secondtransfererlinkedid']][_0x8c6c('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x8c6c('0x2a')](queues[_0x257da1[_0x8c6c('0x4d')]])){if(_0x257da1[_0x8c6c('0x51')]&&queues[_0x257da1[_0x8c6c('0x51')]]){queues[_0x257da1['transfereelinkedid']][_0x8c6c('0x21')]=0x1;queues[_0x257da1[_0x8c6c('0x45')]]=_[_0x8c6c('0x52')](queues[_0x257da1['transfereelinkedid']]);queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x10')]=_0x257da1[_0x8c6c('0x53')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x21')]=0x2;queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x9')]=queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x9')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x54')]=queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x54')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x55')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x1b')]=utils['now']();queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x56')]=0x0;queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x57')]=0x0;utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x20')],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x9')],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x54')]));}else{utils[_0x8c6c('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x4e')]));queues[_0x257da1[_0x8c6c('0x4d')]]['transfereduniqueid']=_0x257da1[_0x8c6c('0x4e')];}}}else if(_0x257da1[_0x8c6c('0x58')]==_0x257da1[_0x8c6c('0x4e')]){if(!_['isNil'](queues[_0x257da1[_0x8c6c('0x4d')]])){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x59'),_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1['origtransfererlinkedid']][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x58')],_0x257da1['secondtransfererexten']));queues[_0x257da1[_0x8c6c('0x4d')]]['transfer']=!![];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x47')]='ATTENDED';queues[_0x257da1[_0x8c6c('0x4d')]]['transferexten']=_0x257da1['secondtransfererexten'];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x4a')]=_0x257da1[_0x8c6c('0x58')];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0xb')]=_0x8c6c('0x5a');}if(!_['isNil'](queues[_0x257da1['secondtransfererlinkedid']])){if(_0x257da1[_0x8c6c('0x5b')]&&queues[_0x257da1[_0x8c6c('0x5b')]]){queues[_0x257da1['transfertargetlinkedid']][_0x8c6c('0x21')]=0x1;queues[_0x257da1['transfertargetuniqueid']]=_['clone'](queues[_0x257da1[_0x8c6c('0x5b')]]);queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x10')]=_0x257da1['transfertargetuniqueid'];queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x21')]=0x2;queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x9')]=queues[_0x257da1['origtransfererlinkedid']][_0x8c6c('0x9')];queues[_0x257da1[_0x8c6c('0x53')]]['calleridname']=queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x54')];queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x55')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x1b')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x53')]]['holdtime']=0x0;queues[_0x257da1['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x5c'),_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x20')],queues[_0x257da1['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x257da1[_0x8c6c('0x53')]]['calleridnum'],queues[_0x257da1['transfertargetuniqueid']]['calleridname']));}else{utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x5d'),_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x4d')]));queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x10')]=_0x257da1[_0x8c6c('0x4d')];}}}}catch(_0x42bb41){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x5e'),_0x257da1[_0x8c6c('0x4c')]),_0x42bb41);}};exports[_0x8c6c('0x5f')]=function(_0xaf1da9){try{if(!_[_0x8c6c('0x2a')](queues[_0xaf1da9['uniqueid']])){utils[_0x8c6c('0x12')](util['format'](_0x8c6c('0x60'),_0xaf1da9[_0x8c6c('0x5')]),_0xaf1da9);queues[_0xaf1da9[_0x8c6c('0x5')]]['musiconholdstartAt']=utils[_0x8c6c('0x17')]();utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x61'),_0xaf1da9[_0x8c6c('0x5')],queues[_0xaf1da9[_0x8c6c('0x5')]]['name'],queues[_0xaf1da9[_0x8c6c('0x5')]][_0x8c6c('0x62')]));}}catch(_0x6712c1){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x60'),_0xaf1da9[_0x8c6c('0x5')]),_0x6712c1);}};exports[_0x8c6c('0x63')]=function(_0x230322){try{if(!_['isNil'](queues[_0x230322[_0x8c6c('0x5')]])){if(!_['isNil'](queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x64'),_0x230322[_0x8c6c('0x5')]),_0x230322);queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x57')]+=utils[_0x8c6c('0x35')](utils['now'](),queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')]);utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x65'),_0x230322[_0x8c6c('0x5')],queues[_0x230322['uniqueid']]['name'],queues[_0x230322[_0x8c6c('0x5')]]['mohtime']));delete queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')];}}}catch(_0x4b85f3){utils[_0x8c6c('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x230322[_0x8c6c('0x5')]),_0x4b85f3);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b3e5213..1336189 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 _0x81ed=['[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','forEach','newexten','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','mixmonitor_filename','value','endsWith','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]'];(function(_0x5c376c,_0x293460){var _0x1ce49e=function(_0x1a52ad){while(--_0x1a52ad){_0x5c376c['push'](_0x5c376c['shift']());}};_0x1ce49e(++_0x293460);}(_0x81ed,0x144));var _0xd81e=function(_0x5d5d04,_0x47315c){_0x5d5d04=_0x5d5d04-0x0;var _0x2d959f=_0x81ed[_0x5d5d04];return _0x2d959f;};'use strict';var _=require(_0xd81e('0x0'));var util=require(_0xd81e('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x37f68e){utils[_0xd81e('0x2')](util['format'](_0xd81e('0x3'),_0x37f68e[_0xd81e('0x4')]));if(_0x37f68e[_0xd81e('0x5')]){utils[_0xd81e('0x6')](_0x37f68e['accountcode'])[_0xd81e('0x7')](function(_0x2ea3b8){if(_0x2ea3b8){_0x37f68e[_0xd81e('0x8')]=_0x2ea3b8[_0xd81e('0x9')];_0x37f68e[_0xd81e('0xa')]=_0x2ea3b8['id'];}utils[_0xd81e('0xb')](_0xd81e('0xc'),_0x37f68e);});}else{utils[_0xd81e('0xb')]('CreateVoiceRecording',_0x37f68e);}}exports[_0xd81e('0xd')]=function(_0x1af8da){try{utils[_0xd81e('0xe')](util['format']('[%s][recordings][newchannel]',_0x1af8da[_0xd81e('0x4')]),_0x1af8da);if(_0x1af8da[_0xd81e('0x4')]==_0x1af8da[_0xd81e('0xf')]){utils[_0xd81e('0x2')](util[_0xd81e('0x10')](_0xd81e('0x11'),_0x1af8da['uniqueid'],_0x1af8da[_0xd81e('0x12')],_0x1af8da['exten']));recordings[_0x1af8da[_0xd81e('0x4')]]={'uniqueid':_0x1af8da[_0xd81e('0x4')],'accountcode':_0x1af8da[_0xd81e('0x5')],'exten':_0x1af8da[_0xd81e('0x13')],'context':_0x1af8da[_0xd81e('0x12')],'channel':_0x1af8da[_0xd81e('0x14')],'monitors':[]};}}catch(_0x5749e8){utils[_0xd81e('0x15')](util['format'](_0xd81e('0x16'),_0x1af8da[_0xd81e('0x4')]),_0x5749e8);}};exports[_0xd81e('0x17')]=function(_0x48c617){try{utils['debug'](util['format'](_0xd81e('0x18'),_0x48c617['uniqueid']),_0x48c617);if(!_['isNil'](recordings[_0x48c617[_0xd81e('0x4')]])&&_0x48c617[_0xd81e('0x19')]==0x6){utils[_0xd81e('0x2')](util[_0xd81e('0x10')](_0xd81e('0x1a'),_0x48c617[_0xd81e('0x4')],_0x48c617[_0xd81e('0x12')],_0x48c617['channel']));}else if(!_['isNil'](recordings[_0x48c617[_0xd81e('0xf')]])&&_0x48c617['channelstate']==0x6&&_0x48c617[_0xd81e('0x12')]!='transfer'){utils[_0xd81e('0x2')](util[_0xd81e('0x10')](_0xd81e('0x1b'),_0x48c617[_0xd81e('0x4')],_0x48c617[_0xd81e('0xf')],_0x48c617[_0xd81e('0x12')],_0x48c617[_0xd81e('0x14')]));recordings[_0x48c617[_0xd81e('0xf')]][_0xd81e('0x5')]=_0x48c617[_0xd81e('0x5')];}}catch(_0x2bdceb){utils[_0xd81e('0x15')](util[_0xd81e('0x10')](_0xd81e('0x18'),_0x48c617['uniqueid']),_0x2bdceb);}};exports[_0xd81e('0x1c')]=function(_0x53027f){try{if(!_[_0xd81e('0x1d')](_0x53027f[_0xd81e('0x1e')])&&!_[_0xd81e('0x1d')](_0x53027f[_0xd81e('0x1e')][_0xd81e('0x1f')])){utils[_0xd81e('0xe')](util['format']('[%s][recordings][varset]',_0x53027f['uniqueid']),_0x53027f);utils['info'](util[_0xd81e('0x10')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x53027f[_0xd81e('0x4')],_0x53027f[_0xd81e('0x1e')],_0x53027f[_0xd81e('0x20')]));if(_[_0xd81e('0x21')](_0x53027f['value'],'.wav49')){_0x53027f[_0xd81e('0x20')]=_0x53027f[_0xd81e('0x20')]['replace'](_0xd81e('0x22'),_0xd81e('0x23'));}if(recordings[_0x53027f[_0xd81e('0xf')]]){var _0xc8f2a1=_[_0xd81e('0x24')](recordings[_0x53027f['linkedid']][_0xd81e('0x25')],{'value':_0x53027f[_0xd81e('0x20')]});if(_[_0xd81e('0x1d')](_0xc8f2a1)){recordings[_0x53027f[_0xd81e('0xf')]][_0xd81e('0x25')][_0xd81e('0x26')]({'value':_0x53027f[_0xd81e('0x20')]});}}}}catch(_0x471380){utils['error'](util[_0xd81e('0x10')](_0xd81e('0x27'),_0x53027f[_0xd81e('0x4')]),_0x471380);}};exports[_0xd81e('0x28')]=function(_0x14db42){try{if(!_[_0xd81e('0x1d')](recordings[_0x14db42[_0xd81e('0x4')]])){utils['debug'](util['format'](_0xd81e('0x29'),_0x14db42['uniqueid']),_0x14db42);utils[_0xd81e('0x2')](util['format'](_0xd81e('0x2a'),_0x14db42['uniqueid'],_0x14db42[_0xd81e('0x2b')],_0x14db42[_0xd81e('0x2c')],_0x14db42[_0xd81e('0x2d')]));recordings[_0x14db42['uniqueid']]['calleridnum']=_0x14db42[_0xd81e('0x2b')];recordings[_0x14db42['uniqueid']]['calleridname']=_0x14db42[_0xd81e('0x2c')];recordings[_0x14db42[_0xd81e('0x4')]]['connectedlinenum']=_0x14db42[_0xd81e('0x2e')];recordings[_0x14db42[_0xd81e('0x4')]][_0xd81e('0x2f')]=_0x14db42[_0xd81e('0x2f')];if(recordings[_0x14db42[_0xd81e('0x4')]]['type']=='outbound'&&recordings[_0x14db42[_0xd81e('0x4')]]['accountcode']){recordings[_0x14db42[_0xd81e('0x4')]]['connectedlinenum']=recordings[_0x14db42[_0xd81e('0x4')]][_0xd81e('0x5')];recordings[_0x14db42[_0xd81e('0x4')]][_0xd81e('0x2f')]='';}recordings[_0x14db42[_0xd81e('0x4')]][_0xd81e('0x25')][_0xd81e('0x30')](function(_0x329fb1){var _0x5ab6aa=_['clone'](recordings[_0x14db42[_0xd81e('0x4')]]);_0x5ab6aa[_0xd81e('0x20')]=_0x329fb1[_0xd81e('0x20')];writeDB(_0x5ab6aa);});delete recordings[_0x14db42['uniqueid']];}}catch(_0x9275b3){utils[_0xd81e('0x15')](util['format'](_0xd81e('0x29'),_0x14db42[_0xd81e('0x4')]),_0x9275b3);}};exports[_0xd81e('0x31')]=function(_0x457d3e){try{if(!_[_0xd81e('0x1d')](recordings[_0x457d3e[_0xd81e('0x4')]])){utils[_0xd81e('0xe')](util['format']('[%s][recordings][newexten]',_0x457d3e[_0xd81e('0x4')]),_0x457d3e);utils[_0xd81e('0x2')](util[_0xd81e('0x10')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x457d3e[_0xd81e('0x4')],_0x457d3e['application'],_0x457d3e[_0xd81e('0x32')]));if(_0x457d3e['application'][_0xd81e('0x33')]()==_0xd81e('0x34')&&_[_0xd81e('0x35')](_0x457d3e[_0xd81e('0x32')]['toLowerCase'](),_0xd81e('0x36'))){var _0x3af66e=_0x457d3e['appdata'][_0xd81e('0x37')]('=');var _0x3c8baa=_0x3af66e[0x0][_0xd81e('0x38')](_0x3af66e[0x0][_0xd81e('0x39')]('(')+0x1,_0x3af66e[0x0][_0xd81e('0x39')](')'));var _0x21fa92=_0x3af66e[0x1];recordings[_0x457d3e['uniqueid']][_0x3c8baa]=_0x21fa92;}}}catch(_0x53c386){utils[_0xd81e('0x15')](util['format'](_0xd81e('0x3a'),_0x457d3e['uniqueid']),_0x53c386);}};exports['queuecallerjoin']=function(_0x4c4a58){try{if(!_['isNil'](recordings[_0x4c4a58['uniqueid']])){utils[_0xd81e('0xe')](util[_0xd81e('0x10')](_0xd81e('0x3b'),_0x4c4a58[_0xd81e('0x4')]),_0x4c4a58);utils[_0xd81e('0x2')](util[_0xd81e('0x10')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4c4a58[_0xd81e('0x4')],_0x4c4a58[_0xd81e('0x3c')]));recordings[_0x4c4a58['uniqueid']][_0xd81e('0x3c')]=_0x4c4a58[_0xd81e('0x3c')];}}catch(_0x779166){utils['error'](util[_0xd81e('0x10')]('[%s][recordings][queuecallerjoin]',_0x4c4a58['uniqueid']),_0x779166);}}; \ No newline at end of file +var _0xe512=['[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','hangup','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug'];(function(_0x3e9402,_0x130b9e){var _0x1f5996=function(_0x5ad15c){while(--_0x5ad15c){_0x3e9402['push'](_0x3e9402['shift']());}};_0x1f5996(++_0x130b9e);}(_0xe512,0x1e9));var _0x2e51=function(_0x17402f,_0x3bf6f4){_0x17402f=_0x17402f-0x0;var _0x13ab54=_0xe512[_0x17402f];return _0x13ab54;};'use strict';var _=require(_0x2e51('0x0'));var util=require(_0x2e51('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x43c2c4){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x4'),_0x43c2c4[_0x2e51('0x5')]));if(_0x43c2c4[_0x2e51('0x6')]){utils[_0x2e51('0x7')](_0x43c2c4[_0x2e51('0x6')])['then'](function(_0x33aa98){if(_0x33aa98){_0x43c2c4[_0x2e51('0x8')]=_0x33aa98[_0x2e51('0x9')];_0x43c2c4[_0x2e51('0xa')]=_0x33aa98['id'];}utils[_0x2e51('0xb')](_0x2e51('0xc'),_0x43c2c4);});}else{utils[_0x2e51('0xb')](_0x2e51('0xc'),_0x43c2c4);}}exports[_0x2e51('0xd')]=function(_0x43197c){try{utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0xf'),_0x43197c[_0x2e51('0x5')]),_0x43197c);if(_0x43197c['uniqueid']==_0x43197c[_0x2e51('0x10')]){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x11'),_0x43197c[_0x2e51('0x5')],_0x43197c['context'],_0x43197c[_0x2e51('0x12')]));recordings[_0x43197c[_0x2e51('0x5')]]={'uniqueid':_0x43197c[_0x2e51('0x5')],'accountcode':_0x43197c[_0x2e51('0x6')],'exten':_0x43197c['exten'],'context':_0x43197c[_0x2e51('0x13')],'channel':_0x43197c[_0x2e51('0x14')],'monitors':[]};}}catch(_0x3a6cfb){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0xf'),_0x43197c[_0x2e51('0x5')]),_0x3a6cfb);}};exports[_0x2e51('0x16')]=function(_0x43fdf7){try{utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x17'),_0x43fdf7[_0x2e51('0x5')]),_0x43fdf7);if(!_['isNil'](recordings[_0x43fdf7[_0x2e51('0x5')]])&&_0x43fdf7[_0x2e51('0x18')]==0x6){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x19'),_0x43fdf7[_0x2e51('0x5')],_0x43fdf7[_0x2e51('0x13')],_0x43fdf7[_0x2e51('0x14')]));}else if(!_[_0x2e51('0x1a')](recordings[_0x43fdf7[_0x2e51('0x10')]])&&_0x43fdf7[_0x2e51('0x18')]==0x6&&_0x43fdf7[_0x2e51('0x13')]!=_0x2e51('0x1b')){utils[_0x2e51('0x2')](util['format'](_0x2e51('0x1c'),_0x43fdf7[_0x2e51('0x5')],_0x43fdf7['linkedid'],_0x43fdf7['context'],_0x43fdf7[_0x2e51('0x14')]));recordings[_0x43fdf7['linkedid']][_0x2e51('0x6')]=_0x43fdf7[_0x2e51('0x6')];}}catch(_0x1831bc){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x17'),_0x43fdf7[_0x2e51('0x5')]),_0x1831bc);}};exports['varset']=function(_0x38363d){try{if(!_[_0x2e51('0x1a')](_0x38363d[_0x2e51('0x1d')])&&!_[_0x2e51('0x1a')](_0x38363d[_0x2e51('0x1d')]['mixmonitor_filename'])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x1e'),_0x38363d[_0x2e51('0x5')]),_0x38363d);utils[_0x2e51('0x2')](util['format'](_0x2e51('0x1f'),_0x38363d[_0x2e51('0x5')],_0x38363d[_0x2e51('0x1d')],_0x38363d[_0x2e51('0x20')]));if(_[_0x2e51('0x21')](_0x38363d[_0x2e51('0x20')],'.wav49')){_0x38363d[_0x2e51('0x20')]=_0x38363d['value']['replace'](_0x2e51('0x22'),_0x2e51('0x23'));}if(recordings[_0x38363d[_0x2e51('0x10')]]){var _0x5c2b56=_['find'](recordings[_0x38363d[_0x2e51('0x10')]][_0x2e51('0x24')],{'value':_0x38363d[_0x2e51('0x20')]});if(_[_0x2e51('0x1a')](_0x5c2b56)){recordings[_0x38363d[_0x2e51('0x10')]]['monitors']['push']({'value':_0x38363d[_0x2e51('0x20')]});}}}}catch(_0x5023e6){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x1e'),_0x38363d[_0x2e51('0x5')]),_0x5023e6);}};exports[_0x2e51('0x25')]=function(_0x1529a2){try{if(!_[_0x2e51('0x1a')](recordings[_0x1529a2[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')]('[%s][recordings][hangup]',_0x1529a2[_0x2e51('0x5')]),_0x1529a2);utils[_0x2e51('0x2')](util[_0x2e51('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1529a2[_0x2e51('0x5')],_0x1529a2['calleridnum'],_0x1529a2[_0x2e51('0x26')],_0x1529a2[_0x2e51('0x27')]));recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x28')]=_0x1529a2[_0x2e51('0x28')];recordings[_0x1529a2['uniqueid']]['calleridname']=_0x1529a2[_0x2e51('0x26')];recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x29')]=_0x1529a2[_0x2e51('0x29')];recordings[_0x1529a2['uniqueid']][_0x2e51('0x2a')]=_0x1529a2['connectedlinename'];if(recordings[_0x1529a2['uniqueid']][_0x2e51('0x2b')]==_0x2e51('0x2c')&&recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x6')]){recordings[_0x1529a2['uniqueid']][_0x2e51('0x29')]=recordings[_0x1529a2['uniqueid']]['accountcode'];recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x2a')]='';}recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x24')][_0x2e51('0x2d')](function(_0x527d5e){var _0x43434d=_[_0x2e51('0x2e')](recordings[_0x1529a2['uniqueid']]);_0x43434d[_0x2e51('0x20')]=_0x527d5e[_0x2e51('0x20')];writeDB(_0x43434d);});delete recordings[_0x1529a2[_0x2e51('0x5')]];}}catch(_0x232d66){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x2f'),_0x1529a2[_0x2e51('0x5')]),_0x232d66);}};exports[_0x2e51('0x30')]=function(_0x10df2a){try{if(!_[_0x2e51('0x1a')](recordings[_0x10df2a[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x31'),_0x10df2a[_0x2e51('0x5')]),_0x10df2a);utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x32'),_0x10df2a[_0x2e51('0x5')],_0x10df2a[_0x2e51('0x33')],_0x10df2a[_0x2e51('0x34')]));if(_0x10df2a[_0x2e51('0x33')][_0x2e51('0x35')]()=='set'&&_[_0x2e51('0x36')](_0x10df2a[_0x2e51('0x34')][_0x2e51('0x35')](),_0x2e51('0x37'))){var _0x1c2135=_0x10df2a['appdata'][_0x2e51('0x38')]('=');var _0x4d4aa9=_0x1c2135[0x0][_0x2e51('0x39')](_0x1c2135[0x0][_0x2e51('0x3a')]('(')+0x1,_0x1c2135[0x0][_0x2e51('0x3a')](')'));var _0x541d13=_0x1c2135[0x1];recordings[_0x10df2a[_0x2e51('0x5')]][_0x4d4aa9]=_0x541d13;}}}catch(_0x2f5e18){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x31'),_0x10df2a['uniqueid']),_0x2f5e18);}};exports[_0x2e51('0x3b')]=function(_0x107fbe){try{if(!_['isNil'](recordings[_0x107fbe[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x3c'),_0x107fbe[_0x2e51('0x5')]),_0x107fbe);utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x3d'),_0x107fbe[_0x2e51('0x5')],_0x107fbe[_0x2e51('0x3e')]));recordings[_0x107fbe[_0x2e51('0x5')]][_0x2e51('0x3e')]=_0x107fbe[_0x2e51('0x3e')];}}catch(_0x5bd13c){utils[_0x2e51('0x15')](util[_0x2e51('0x3')]('[%s][recordings][queuecallerjoin]',_0x107fbe['uniqueid']),_0x5bd13c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f804a21..5398b99 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 _0xa4ff=['secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransfererchannel'];(function(_0x501da2,_0x16c47f){var _0x15131e=function(_0x43bacf){while(--_0x43bacf){_0x501da2['push'](_0x501da2['shift']());}};_0x15131e(++_0x16c47f);}(_0xa4ff,0x16b));var _0xfa4f=function(_0x3d2f63,_0x590356){_0x3d2f63=_0x3d2f63-0x0;var _0x35979c=_0xa4ff[_0x3d2f63];return _0x35979c;};'use strict';var _=require(_0xfa4f('0x0'));var util=require(_0xfa4f('0x1'));var utils=require(_0xfa4f('0x2'));function writeDB(_0x10174a){utils[_0xfa4f('0x3')](util[_0xfa4f('0x4')](_0xfa4f('0x5'),_0x10174a[_0xfa4f('0x6')]===_0xfa4f('0x7')?_0x10174a[_0xfa4f('0x8')]:_0x10174a['uniqueid'],_0x10174a[_0xfa4f('0x6')]));utils[_0xfa4f('0x9')](_0xfa4f('0xa'),_0x10174a);}exports[_0xfa4f('0xb')]={};exports[_0xfa4f('0xc')]=function(_0x180560){try{utils['debug'](util[_0xfa4f('0x4')](_0xfa4f('0xd'),_0x180560[_0xfa4f('0xe')]),_0x180560);utils['info'](util['format'](_0xfa4f('0xf'),_0x180560[_0xfa4f('0xe')],_0x180560[_0xfa4f('0x10')],_0x180560[_0xfa4f('0x11')],_0x180560[_0xfa4f('0x12')],_0x180560['transfereecalleridname']));_0x180560[_0xfa4f('0x6')]=_0xfa4f('0x13');exports[_0xfa4f('0xb')][_0x180560[_0xfa4f('0x14')]]=_0x180560;writeDB(_0x180560);}catch(_0x3998d5){utils[_0xfa4f('0x15')](util[_0xfa4f('0x4')](_0xfa4f('0xd'),_0x180560[_0xfa4f('0xe')]),_0x3998d5);}};exports['attendedtransfer']=function(_0x33c0e5){try{utils[_0xfa4f('0x16')](util[_0xfa4f('0x4')]('[%s][transfers][attendedtransfer]',_0x33c0e5['origtransfereruniqueid']),_0x33c0e5);utils['info'](util['format'](_0xfa4f('0x17'),_0x33c0e5[_0xfa4f('0x8')],_0x33c0e5['origtransferercalleridnum'],_0x33c0e5['origtransferercalleridname'],_0x33c0e5['transfertargetcalleridnum'],_0x33c0e5[_0xfa4f('0x18')]));_0x33c0e5=_[_0xfa4f('0x19')](_0x33c0e5,{'transfererchannel':_0x33c0e5[_0xfa4f('0x1a')],'transferercalleridnum':_0x33c0e5['origtransferercalleridnum'],'transferercalleridname':_0x33c0e5['origtransferercalleridname'],'transfererconnectedlinenum':_0x33c0e5[_0xfa4f('0x1b')],'transfererconnectedlinename':_0x33c0e5['secondtransfererconnectedlinename'],'transfereraccountcode':_0x33c0e5[_0xfa4f('0x1c')],'transferercontext':_0x33c0e5[_0xfa4f('0x1d')],'transfererexten':_0x33c0e5['secondtransfererexten'],'transfererlinkedid':_0x33c0e5['origtransfererlinkedid'],'context':_0x33c0e5[_0xfa4f('0x1e')],'extension':_0x33c0e5['origtransfererexten'],'type':_0xfa4f('0x7')});if(_['isNil'](_0x33c0e5[_0xfa4f('0x1f')])){_0x33c0e5=_[_0xfa4f('0x19')](_0x33c0e5,{'transfereechannel':_0x33c0e5[_0xfa4f('0x20')],'transfereecalleridnum':_0x33c0e5['transfertargetcalleridnum'],'transfereecalleridname':_0x33c0e5[_0xfa4f('0x18')],'transfereeconnectedlinenum':_0x33c0e5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x33c0e5[_0xfa4f('0x21')],'transfereeaccountcode':_0x33c0e5[_0xfa4f('0x22')],'transfereecontext':_0x33c0e5[_0xfa4f('0x23')],'transfereeexten':_0x33c0e5[_0xfa4f('0x24')],'transfereelinkedid':_0x33c0e5[_0xfa4f('0x25')]});}writeDB(_0x33c0e5);}catch(_0xe61a77){utils[_0xfa4f('0x15')](util[_0xfa4f('0x4')](_0xfa4f('0x26'),_0x33c0e5[_0xfa4f('0x8')]),_0xe61a77);}}; \ No newline at end of file +var _0x1b79=['request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','type','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','lodash','util','info','format','origtransfereruniqueid'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x1b79,0x1d4));var _0x91b7=function(_0x4afcf2,_0x2c820){_0x4afcf2=_0x4afcf2-0x0;var _0x3b106b=_0x1b79[_0x4afcf2];return _0x3b106b;};'use strict';var _=require(_0x91b7('0x0'));var util=require(_0x91b7('0x1'));var utils=require('./utils');function writeDB(_0x33697b){utils[_0x91b7('0x2')](util[_0x91b7('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x33697b['type']==='attended'?_0x33697b[_0x91b7('0x4')]:_0x33697b['uniqueid'],_0x33697b['type']));utils[_0x91b7('0x5')](_0x91b7('0x6'),_0x33697b);}exports[_0x91b7('0x7')]={};exports[_0x91b7('0x8')]=function(_0x4b1a90){try{utils[_0x91b7('0x9')](util[_0x91b7('0x3')](_0x91b7('0xa'),_0x4b1a90['uniqueid']),_0x4b1a90);utils[_0x91b7('0x2')](util[_0x91b7('0x3')](_0x91b7('0xb'),_0x4b1a90[_0x91b7('0xc')],_0x4b1a90[_0x91b7('0xd')],_0x4b1a90[_0x91b7('0xe')],_0x4b1a90[_0x91b7('0xf')],_0x4b1a90[_0x91b7('0x10')]));_0x4b1a90[_0x91b7('0x11')]=_0x91b7('0x12');exports['blinds'][_0x4b1a90[_0x91b7('0x13')]]=_0x4b1a90;writeDB(_0x4b1a90);}catch(_0xb6103b){utils[_0x91b7('0x14')](util[_0x91b7('0x3')](_0x91b7('0xa'),_0x4b1a90[_0x91b7('0xc')]),_0xb6103b);}};exports[_0x91b7('0x15')]=function(_0x1acf23){try{utils[_0x91b7('0x9')](util['format'](_0x91b7('0x16'),_0x1acf23[_0x91b7('0x4')]),_0x1acf23);utils[_0x91b7('0x2')](util[_0x91b7('0x3')](_0x91b7('0x17'),_0x1acf23[_0x91b7('0x4')],_0x1acf23[_0x91b7('0x18')],_0x1acf23[_0x91b7('0x19')],_0x1acf23[_0x91b7('0x1a')],_0x1acf23[_0x91b7('0x1b')]));_0x1acf23=_[_0x91b7('0x1c')](_0x1acf23,{'transfererchannel':_0x1acf23['origtransfererchannel'],'transferercalleridnum':_0x1acf23[_0x91b7('0x18')],'transferercalleridname':_0x1acf23[_0x91b7('0x19')],'transfererconnectedlinenum':_0x1acf23[_0x91b7('0x1d')],'transfererconnectedlinename':_0x1acf23[_0x91b7('0x1e')],'transfereraccountcode':_0x1acf23[_0x91b7('0x1f')],'transferercontext':_0x1acf23[_0x91b7('0x20')],'transfererexten':_0x1acf23[_0x91b7('0x21')],'transfererlinkedid':_0x1acf23[_0x91b7('0x22')],'context':_0x1acf23[_0x91b7('0x23')],'extension':_0x1acf23[_0x91b7('0x24')],'type':'attended'});if(_[_0x91b7('0x25')](_0x1acf23[_0x91b7('0x26')])){_0x1acf23=_[_0x91b7('0x1c')](_0x1acf23,{'transfereechannel':_0x1acf23[_0x91b7('0x27')],'transfereecalleridnum':_0x1acf23[_0x91b7('0x1a')],'transfereecalleridname':_0x1acf23[_0x91b7('0x1b')],'transfereeconnectedlinenum':_0x1acf23[_0x91b7('0x28')],'transfereeconnectedlinename':_0x1acf23['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1acf23['transfertargetaccountcode'],'transfereecontext':_0x1acf23[_0x91b7('0x29')],'transfereeexten':_0x1acf23[_0x91b7('0x2a')],'transfereelinkedid':_0x1acf23['transfertargetlinkedid']});}writeDB(_0x1acf23);}catch(_0x564115){utils[_0x91b7('0x14')](util[_0x91b7('0x3')](_0x91b7('0x16'),_0x1acf23[_0x91b7('0x4')]),_0x564115);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 78dfae2..26d3baa 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 _0xdc1e=['interface','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','name'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xdc1e,0x1f4));var _0xedc1=function(_0x296752,_0x4aaae6){_0x296752=_0x296752-0x0;var _0x5402c3=_0xdc1e[_0x296752];return _0x5402c3;};'use strict';var BPromise=require(_0xedc1('0x0'));var jayson=require('jayson/promise');var moment=require(_0xedc1('0x1'));var util=require(_0xedc1('0x2'));var client=jayson[_0xedc1('0x3')][_0xedc1('0x4')]({'port':0x2329});var logger=require(_0xedc1('0x5'))(_0xedc1('0x6'));exports[_0xedc1('0x7')]=function(_0x5e5ff4,_0x5a57d9){logger[_0xedc1('0x7')](_0x5e5ff4,_0x5a57d9?util[_0xedc1('0x8')](_0x5a57d9,{'showHidden':![],'depth':null}):'');};exports[_0xedc1('0x9')]=function(_0x465813,_0x506b11){logger[_0xedc1('0x9')](_0x465813,_0x506b11?util['inspect'](_0x506b11,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x188a2b,_0x4ed8e2){logger[_0xedc1('0xa')](_0x188a2b,_0x4ed8e2?util[_0xedc1('0x8')](_0x4ed8e2,{'showHidden':![],'depth':null}):'');};exports[_0xedc1('0xb')]=function(_0x548f45,_0x1d1691){return client['request'](_0x548f45,{'body':_0x1d1691})['then'](function(_0x1d8fbe){logger[_0xedc1('0x9')](_0xedc1('0xc'),_0x548f45,_0x1d8fbe?util[_0xedc1('0x8')](_0x1d8fbe,{'showHidden':![],'depth':null}):'');})[_0xedc1('0xd')](function(_0x1385f0){logger[_0xedc1('0xa')](_0xedc1('0xc'),_0x548f45,_0x1385f0?util[_0xedc1('0x8')](_0x1385f0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x51dffd){return client[_0xedc1('0xb')](_0xedc1('0xe'),{'options':{'raw':!![],'attributes':['id',_0xedc1('0xf'),_0xedc1('0x10'),_0xedc1('0x11')],'where':_0x51dffd,'limit':0x1}})[_0xedc1('0x12')](function(_0x1f3df8){logger[_0xedc1('0x9')](_0xedc1('0x13'),JSON['stringify'](_0x51dffd),_0x1f3df8?util['inspect'](_0x1f3df8,{'showHidden':![],'depth':null}):'');return _0x1f3df8[_0xedc1('0x14')][_0xedc1('0x15')]?_0x1f3df8['result'][0x0]:null;});}exports[_0xedc1('0x16')]=function(_0x4f9371){return new BPromise(function(_0x1dff39,_0x2422ab){if(_0x4f9371){return getUser({'internal':_0x4f9371})[_0xedc1('0x12')](function(_0x20ce47){logger['info'](_0xedc1('0x17'),_0x4f9371,_0x20ce47?_0xedc1('0x18'):_0xedc1('0x19'));return _0x1dff39(_0x20ce47);})[_0xedc1('0xd')](function(_0x376d68){logger[_0xedc1('0xa')](_0xedc1('0x1a'),_0x376d68?util['inspect'](_0x376d68,{'showHidden':![],'depth':null}):'');return _0x1dff39(null);});}return _0x1dff39(null);});};exports['getUserByInterface']=function(_0x5438c4){return new BPromise(function(_0x1cbeda,_0x2636eb){if(_0x5438c4){return getUser({'interface':_0x5438c4})[_0xedc1('0x12')](function(_0x54859e){logger[_0xedc1('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5438c4,_0x54859e?'found':_0xedc1('0x19'));return _0x1cbeda(_0x54859e);})[_0xedc1('0xd')](function(_0x2c256b){logger[_0xedc1('0xa')](_0xedc1('0x1b'),_0x2c256b?util['inspect'](_0x2c256b,{'showHidden':![],'depth':null}):'');return _0x1cbeda(null);});}return _0x1cbeda(null);});};exports[_0xedc1('0x1c')]=function(_0x4a3abc){return new BPromise(function(_0x569c31,_0x3bcdfb){if(_0x4a3abc){return getUser({'name':_0x4a3abc})['then'](function(_0x45c47f){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x4a3abc,_0x45c47f?_0xedc1('0x18'):'notfound');return _0x569c31(_0x45c47f);})[_0xedc1('0xd')](function(_0x480ff0){logger['error'](_0xedc1('0x1d'),_0x480ff0?util['inspect'](_0x480ff0,{'showHidden':![],'depth':null}):'');return _0x569c31(null);});}return _0x569c31(null);});};exports['getVoiceQueueByName']=function(_0xd6a604){return new BPromise(function(_0x39c149,_0x3c3289){if(_0xd6a604){return client[_0xedc1('0xb')](_0xedc1('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0xedc1('0x1f'),_0xedc1('0x20'),_0xedc1('0x21')],'where':{'name':_0xd6a604},'limit':0x1}})[_0xedc1('0x12')](function(_0x29d9eb){logger[_0xedc1('0x9')](_0xedc1('0x22'),_0xd6a604,_0x29d9eb?util['inspect'](_0x29d9eb,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0xd6a604,_0x29d9eb?_0xedc1('0x18'):_0xedc1('0x19'));return _0x39c149(_0x29d9eb['result']['length']?_0x29d9eb[_0xedc1('0x14')][0x0]:null);})['catch'](function(_0x89f9){logger['error'](_0xedc1('0x23'),_0x89f9?util[_0xedc1('0x8')](_0x89f9,{'showHidden':![],'depth':null}):'');return _0x39c149(null);});}return _0x39c149(null);});};exports[_0xedc1('0x24')]=function(_0x4c2d08,_0x149aca){return moment(_0x4c2d08)[_0xedc1('0x25')](_0x149aca,_0xedc1('0x26'))['format'](_0xedc1('0x27'));};exports[_0xedc1('0x28')]=function(_0x2ee094,_0x3711c8){return moment(_0x2ee094)[_0xedc1('0x29')](_0x3711c8,_0xedc1('0x26'))[_0xedc1('0x2a')](_0xedc1('0x27'));};exports['diffTime']=function(_0x1c0d8c,_0x559ddf){return moment(_0x1c0d8c)['diff'](moment(_0x559ddf),'seconds');};exports[_0xedc1('0x2b')]=function(_0x1a4a22,_0x2e909b){return parseInt(_0x1a4a22,0xa)+parseInt(_0x2e909b,0xa);};exports[_0xedc1('0x2c')]=function(){return moment()[_0xedc1('0x2a')](_0xedc1('0x27'));};exports['isAfter']=function(_0x47218a,_0x37c350){if(_0x37c350){return moment(_0x47218a)[_0xedc1('0x2d')](_0x37c350);}return!![];};exports[_0xedc1('0x2e')]=function(_0x30e185,_0x24c6b1){if(_0x24c6b1){return moment(_0x30e185)['isBefore'](_0x24c6b1);}else if(_0x30e185){return!![];}return![];}; \ No newline at end of file +var _0x9c8a=['acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','info','debug','inspect','error','request','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','then','[utils][getUserByName]','name','type','acw'];(function(_0x4d63ca,_0x43c8fa){var _0x1bbacc=function(_0x47a44a){while(--_0x47a44a){_0x4d63ca['push'](_0x4d63ca['shift']());}};_0x1bbacc(++_0x43c8fa);}(_0x9c8a,0x191));var _0xa9c8=function(_0x18f11d,_0x1e1dc5){_0x18f11d=_0x18f11d-0x0;var _0x1ec8f3=_0x9c8a[_0x18f11d];return _0x1ec8f3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa9c8('0x0'));var moment=require(_0xa9c8('0x1'));var util=require(_0xa9c8('0x2'));var client=jayson[_0xa9c8('0x3')][_0xa9c8('0x4')]({'port':0x2329});var logger=require(_0xa9c8('0x5'))('xdr');exports[_0xa9c8('0x6')]=function(_0x4fa96d,_0x2efe79){logger['info'](_0x4fa96d,_0x2efe79?util['inspect'](_0x2efe79,{'showHidden':![],'depth':null}):'');};exports[_0xa9c8('0x7')]=function(_0x301e63,_0x5bec8a){logger['debug'](_0x301e63,_0x5bec8a?util[_0xa9c8('0x8')](_0x5bec8a,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x54832f,_0x5a91df){logger[_0xa9c8('0x9')](_0x54832f,_0x5a91df?util[_0xa9c8('0x8')](_0x5a91df,{'showHidden':![],'depth':null}):'');};exports[_0xa9c8('0xa')]=function(_0x42f3d7,_0x1d2e29){return client[_0xa9c8('0xa')](_0x42f3d7,{'body':_0x1d2e29})['then'](function(_0x297e03){logger[_0xa9c8('0x7')]('[utils][request]\x20name:%s',_0x42f3d7,_0x297e03?util['inspect'](_0x297e03,{'showHidden':![],'depth':null}):'');})[_0xa9c8('0xb')](function(_0x5d25fb){logger[_0xa9c8('0x9')]('[utils][request]\x20name:%s',_0x42f3d7,_0x5d25fb?util['inspect'](_0x5d25fb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x25a667){return client['request'](_0xa9c8('0xc'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xa9c8('0xd')],'where':_0x25a667,'limit':0x1}})['then'](function(_0x55dcae){logger[_0xa9c8('0x7')](_0xa9c8('0xe'),JSON[_0xa9c8('0xf')](_0x25a667),_0x55dcae?util[_0xa9c8('0x8')](_0x55dcae,{'showHidden':![],'depth':null}):'');return _0x55dcae[_0xa9c8('0x10')]['length']?_0x55dcae['result'][0x0]:null;});}exports[_0xa9c8('0x11')]=function(_0x4bd0b7){return new BPromise(function(_0x4b2845,_0x822b2){if(_0x4bd0b7){return getUser({'internal':_0x4bd0b7})['then'](function(_0x25a2c1){logger[_0xa9c8('0x6')](_0xa9c8('0x12'),_0x4bd0b7,_0x25a2c1?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x4b2845(_0x25a2c1);})[_0xa9c8('0xb')](function(_0x1da1e0){logger[_0xa9c8('0x9')](_0xa9c8('0x15'),_0x1da1e0?util[_0xa9c8('0x8')](_0x1da1e0,{'showHidden':![],'depth':null}):'');return _0x4b2845(null);});}return _0x4b2845(null);});};exports['getUserByInterface']=function(_0x220733){return new BPromise(function(_0x183892,_0x491e72){if(_0x220733){return getUser({'interface':_0x220733})['then'](function(_0x246a54){logger['info'](_0xa9c8('0x16'),_0x220733,_0x246a54?_0xa9c8('0x13'):'notfound');return _0x183892(_0x246a54);})[_0xa9c8('0xb')](function(_0x3ff31d){logger[_0xa9c8('0x9')](_0xa9c8('0x17'),_0x3ff31d?util[_0xa9c8('0x8')](_0x3ff31d,{'showHidden':![],'depth':null}):'');return _0x183892(null);});}return _0x183892(null);});};exports['getUserByName']=function(_0x2f0376){return new BPromise(function(_0x5be2fc,_0x58740e){if(_0x2f0376){return getUser({'name':_0x2f0376})[_0xa9c8('0x18')](function(_0xb3393f){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x2f0376,_0xb3393f?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x5be2fc(_0xb3393f);})['catch'](function(_0x57bb48){logger['error'](_0xa9c8('0x19'),_0x57bb48?util['inspect'](_0x57bb48,{'showHidden':![],'depth':null}):'');return _0x5be2fc(null);});}return _0x5be2fc(null);});};exports['getVoiceQueueByName']=function(_0x257083){return new BPromise(function(_0x10ea59,_0x29c695){if(_0x257083){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa9c8('0x1a'),_0xa9c8('0x1b'),_0xa9c8('0x1c'),_0xa9c8('0x1d')],'where':{'name':_0x257083},'limit':0x1}})[_0xa9c8('0x18')](function(_0x3ddeaa){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x257083,_0x3ddeaa?util['inspect'](_0x3ddeaa,{'showHidden':![],'depth':null}):'');logger[_0xa9c8('0x6')](_0xa9c8('0x1e'),_0x257083,_0x3ddeaa?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x10ea59(_0x3ddeaa[_0xa9c8('0x10')]['length']?_0x3ddeaa[_0xa9c8('0x10')][0x0]:null);})[_0xa9c8('0xb')](function(_0x345649){logger[_0xa9c8('0x9')]('[utils][getVoiceQueueByName]',_0x345649?util['inspect'](_0x345649,{'showHidden':![],'depth':null}):'');return _0x10ea59(null);});}return _0x10ea59(null);});};exports[_0xa9c8('0x1f')]=function(_0x329765,_0x3c30a9){return moment(_0x329765)[_0xa9c8('0x20')](_0x3c30a9,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa9c8('0x21')]=function(_0x4f81eb,_0xf4b2d){return moment(_0x4f81eb)[_0xa9c8('0x22')](_0xf4b2d,_0xa9c8('0x23'))[_0xa9c8('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa9c8('0x25')]=function(_0x4c1761,_0x5a781f){return moment(_0x4c1761)[_0xa9c8('0x26')](moment(_0x5a781f),_0xa9c8('0x23'));};exports[_0xa9c8('0x27')]=function(_0x236ee4,_0x5c8ab9){return parseInt(_0x236ee4,0xa)+parseInt(_0x5c8ab9,0xa);};exports['now']=function(){return moment()['format'](_0xa9c8('0x28'));};exports[_0xa9c8('0x29')]=function(_0x1ca276,_0x58fc67){if(_0x58fc67){return moment(_0x1ca276)[_0xa9c8('0x29')](_0x58fc67);}return!![];};exports['isBefore']=function(_0x225071,_0x3d756d){if(_0x3d756d){return moment(_0x225071)[_0xa9c8('0x2a')](_0x3d756d);}else if(_0x225071){return!![];}return![];}; \ No newline at end of file